topic Hi John, in IntelĀ® oneAPI Math Kernel Library
https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/MKL-s-distributed-FFT-library-fails-with-a-floating-point-error/m-p/1024448#M19827
<P>Hi John,</P>
<P>Thank you for clear reproducer. I was able to reproduce the problem.</P>
<P>Yes... it looks like an inconsistency in MKL CFFT for in-place 2D+ transforms. It needs more time to investigate where exactly the problem occurs.</P>
<P>Anyway, you can workaround the problem in two ways (with the same idea -- change algorithm inside CFFT):</P>
<OL>
<LI>try to use out-of-place transform</LI>
<LI>try to set workspace to CFFT (unfortunately it means that MKL FFTW3 MPI wrappers should be modified). in this case CFFT will do in-place transform but with a buffer of the same size (set on user side). the problem disappears in this case too.</LI>
</OL>
<P>BTW, I would recommend to use out-of-place CFFT since it gives much more performance. The thing is that when you ask CFFT to make in-place transform it really does it, i.e. it uses only constant amount of additional memory and hence it requires a lot of small MPI communications. This really slows down Cluster FFT.</P>Fri, 27 Feb 2015 10:27:00 GMTEvarist_F_Intel2015-02-27T10:27:00ZMKL's (distributed) FFT library fails with a floating-point error
https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/MKL-s-distributed-FFT-library-fails-with-a-floating-point-error/m-p/1024447#M19826
<P>When repeatedly calling MKL's distributed (cluster) DFT library via the FFTW3 interface library, it will fail with a floating-point error with certain combination's of grid sizes and MPI processes (eg, a 1024 x 256 x 1 grid running with 17 MPI processes). This is repeatable, and I have uploaded an example code that demonstrates the problem. I am compiling using "Composer XE 2015" tools (MKL), eg</P>
<P>[jshaw@cl4n074]: make fft_mpi<BR />
echo "Building ... fft_mpi"<BR />
Building ... fft_mpi<BR />
g++ -I/home/jshaw/XCuda-2.4.0/inc -DNDEBUG -O2 -I/home/jshaw/XCuda-2.4.0/inc -I/opt/lic/intel13/impi/4.1.0.024/include64 -I/opt/lic/intel15/composer_xe_2015.1.133/mkl/include -I/opt/lic/intel15/composer_xe_2015.1.133/mkl/include/fftw fft_mpi.cpp -o fft_mpi -L/home/jshaw/XCuda-2.4.0/lib/x86_64-CentOS-6.5 -lXCuda -L/home/jshaw/XCuda-2.4.0/lib/x86_64-CentOS-6.5 -lXCut -L/opt/lic/intel13/impi/4.1.0.024/lib64 -lmpi -L/home/jshaw/fftw-libs-1.1/x86_64-CentOS-6.5/lib -lfftw3x_cdft_lp64 -L/opt/lic/intel15/composer_xe_2015.1.133/mkl/lib/intel64 -lmkl_cdft_core -lmkl_intel_lp64 -lmkl_core -lmkl_sequential -lmkl_blacs_intelmpi_lp64 -lpthread -lm -ldl -lirc</P>
<P>[jshaw@cl4n074]: mpirun -np 17 fft_mpi</P>
<P>FFT-MPI for Complex Multi-dimensional Transforms (float)<BR />
MPI procs: 17, dim: 1024x256x1, loops: 100 (2 MBytes)</P>
<P>Allocating FFT memory ...<BR />
rank: 0 (16592 61 0)<BR />
rank: 2 (16592 61 122)<BR />
rank: 7 (16592 60 424)<BR />
rank: 8 (16592 60 484)<BR />
rank: 9 (16592 60 544)<BR />
rank: 10 (16592 60 604)<BR />
rank: 12 (16592 60 724)<BR />
rank: 13 (16592 60 784)<BR />
rank: 15 (16592 60 904)<BR />
rank: 16 (16592 60 964)<BR />
rank: 1 (16592 61 61)<BR />
rank: 3 (16592 61 183)<BR />
rank: 4 (16592 60 244)<BR />
rank: 5 (16592 60 304)<BR />
rank: 6 (16592 60 364)<BR />
rank: 11 (16592 60 664)<BR />
rank: 14 (16592 60 844)<BR />
Initializing ...<BR />
Planning ...<BR />
loop: <1fnr> <2fnr> <3fnr> <4fnr> <5fnr> <6fnr> <7fnr> <8fnr> <9fnr> <10fnr> <11fnr> <12fnr> <13fAPPLICATION TERMINATED WITH THE EXIT STRING: Floating point exception (signal 8)<BR />
[jshaw@cl4n074]:</P>
<P>Note that the XCuda libraries referenced in the compile/link line are NOT required for this example to work! The code will run correctly with various grid sizes and numbers of MPI processes. Its not as simple as having too many or too few MPI processes, or the FFT grid being small or large. I regularly run codes with large 3D grids. The issue is that one cannot pick arbitrary grid sizes or MPI ranks (as you should be able to). Any help or thoughts on how this can be fixed are appreciated. Is this a legitimate bug in MKL?</P>Thu, 26 Feb 2015 19:26:17 GMThttps://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/MKL-s-distributed-FFT-library-fails-with-a-floating-point-error/m-p/1024447#M19826John_G__S_2015-02-26T19:26:17ZHi John,
https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/MKL-s-distributed-FFT-library-fails-with-a-floating-point-error/m-p/1024448#M19827
<P>Hi John,</P>
<P>Thank you for clear reproducer. I was able to reproduce the problem.</P>
<P>Yes... it looks like an inconsistency in MKL CFFT for in-place 2D+ transforms. It needs more time to investigate where exactly the problem occurs.</P>
<P>Anyway, you can workaround the problem in two ways (with the same idea -- change algorithm inside CFFT):</P>
<OL>
<LI>try to use out-of-place transform</LI>
<LI>try to set workspace to CFFT (unfortunately it means that MKL FFTW3 MPI wrappers should be modified). in this case CFFT will do in-place transform but with a buffer of the same size (set on user side). the problem disappears in this case too.</LI>
</OL>
<P>BTW, I would recommend to use out-of-place CFFT since it gives much more performance. The thing is that when you ask CFFT to make in-place transform it really does it, i.e. it uses only constant amount of additional memory and hence it requires a lot of small MPI communications. This really slows down Cluster FFT.</P>Fri, 27 Feb 2015 10:27:00 GMThttps://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/MKL-s-distributed-FFT-library-fails-with-a-floating-point-error/m-p/1024448#M19827Evarist_F_Intel2015-02-27T10:27:00ZI verified that using out-of
https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/MKL-s-distributed-FFT-library-fails-with-a-floating-point-error/m-p/1024449#M19828
<P>I verified that using out-of-place FFT transforms work. I found little difference in the run times, but this was on a shared-memory machine. It may be different with a distributed-memory cluster. Thanks.</P>
<P> </P>Wed, 04 Mar 2015 20:07:05 GMThttps://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/MKL-s-distributed-FFT-library-fails-with-a-floating-point-error/m-p/1024449#M19828John_G__S_2015-03-04T20:07:05Z