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

LAPACK using multiple cores with sequential library

David_W_5
Beginner
855 Views
Hello,

I am linking the following libraries with MKL10 on windows:

mkl_sequential_dll
mkl_intel_c_dll
mkl_core_dll

and noticed that LAPACK DGELSS is using multiple cores (all 8 of them). My application has only 2 threads.

MKL does respond to setting the environment variable MKL_NUM_THREADS=1, but ignores a runtime call to mkl_set_num_threads(1). Id rather call the API function that mess around with environment vars.

I'm using Windows threads, but I don't wan't MKL to thread itself. I thought that was the whole point of the sequential threading layer?

Can anyone help?

Thanks.

David.
0 Kudos
4 Replies
TimP
Honored Contributor III
855 Views
It appears the mkl_thread library has been linked, and the sequential library is not used. Could you submit your case (object files and link command) on your premier.intel.com account?
0 Kudos
David_W_5
Beginner
855 Views
Rather tricky at this stage since the error is in a very large codebase and it's proving difficult to isolate the case. It seems to depend on the matrix sizes, which is unsurprising. I'm working on it.

In the debugger I'm looking at the loaded libraries and I'm indeed seeing mkl_thread.dll being loaded which surprised me.

In dependency walker I'm only seeing implicit dependencies to mkl_sequential however. I see my call to MKL_Set_Num_Threads as well as calls to mkl_blass_dgemm.

It would seem that my LAPACK calls are being routed via mkl_thread which is being dynamically loaded.

I'm definitely *NOT* linking to the import library mkl_intel_thread_dll.lib as i've just deleted the .lib. However, the intel_thread.dll happens to be sitting on my path.

Does this help narrow down the problem?

thanks.

David.




0 Kudos
David_W_5
Beginner
855 Views
Further to my previous reply, I note that the intel_thread_dll is loaded as it is an implicit depedency of mkl_vml_p4m.dll.

I am calling several vml functions prior to lapack. If I remove these calls to vml, intel_thread.dll does not get loaded and more importantly the lapack functions get called on a single thread as expected.

Therefore, I conclude that this is a bug in the library where calls to vml result in a mixture of threading layers being used.

I shall submit this to premier.

David.
0 Kudos
Andrey_G_Intel2
Employee
855 Views

David,

could you say which VML functions are you using in your application?

Information about used MKL version will be appreciable also.

Andrey

0 Kudos
Reply