Intel® oneAPI Math Kernel Library
Ask questions and share information with other developers who use Intel® Math Kernel Library.

Thread safety of MKL 10.2

New Contributor III
MKL 10.2 is documented as being "thread safe".

I am using Intel Inspector XE 2011 to verify some code that calls MKL in a simplified "OMP" parallel loop, see below, and I am getting getting 'Data Race' errrors inside MKL.

Intel Inspector XE 2011 ( which, BTW, is an incredible tool) complains about a data race condition of two threads writing to the one memory location in daxpy

Write location #1

!daxpy - 0x3ac200
!zlange - 0x10ed43

Write location #2

!daxpy - 0x3ac200
!zgetri - 0x102fed

In the sample code below the matrices ktinv and kt are "private" to each thread by definition. That means these matrices and all their data are "thread-local"and the matrix data from one thread is not shared by another thread.

#pragma omp parallel for
for( int i=0;i Matrix ktinv;
Matrix kt(4,4,Complex(0.0,0.0));
ktinv.reference( inverse(kt) );

Any feedback on whether this is just a bogus issue in daxpy
0 Kudos
1 Reply

Thank you for reporting the issue; we will investigate this.

Is it possible for you to provide more information about the CPU and OS for which theInspector reports a race condition? A simple code that reproduces the issue will also greatly help us to quickly get to the bottom of this. Finally, are you using MKL IA32 or Intel64?

Thank you,

-- Efe
0 Kudos