Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

OpenMP + MKL precision ??

pat97269
Beginner
495 Views

Hi, 

I have a problem in the precision of the MKL , with dsyevd by example, when using -openmp even though this part of the code is purely sequential. There is a difference between the solution without openmp , and with openmp ( free for the number of threads).

NOOMP  eigvect           -0.0000015360581732           -0.9999999999988203           -0.9999999999988203            0.0000015360581732

OMP 1  eigvect           -0.0000015360581732           -0.9999999999988203           -0.9999999999988203            0.0000015360581732

OMP 2 eigvect           -0.0000015360581732           -0.9999999999988203           -0.9999999999988203            0.0000015360581732

OMP 3 eigvect           -0.0000015362783716           -0.9999999999988201           -0.9999999999988201            0.0000015362783716

OMP 4 eigvect           -0.0000015360581732           -0.9999999999988203           -0.9999999999988203            0.0000015360581732

I have set MKL_ALL=1, if not then the result is different for 1 ,2 ,3, and 4 threads.  The problem is that those small differences change the behavior later in the program. Considering that i dont want to use openmp in the mkl, i should have the same values. But another thing is,  is that normal that the results are different using threads in mkl ?

Also, if i link with blas lapack instead of MKL, i don't have that problem.

thanks

0 Kudos
1 Reply
TimP
Honored Contributor III
495 Views
MKL results are expected to vary with number of threads, within the accuracy of the results. If you don't want this, you can link mkl_sequential, set MKL_NUM_THREADS, or possibly use the MKL consistency option: software.intel.com/sites/.../7080_2_IN_ParallelMag_Issue11_CBWR.PDF which has been discussed on the MKL forum. If you have been successful in linking against the gfortran blas library provided with linux, that is probably built with no threading, like mkl sequential.
0 Kudos
Reply