Intel® Moderncode for Parallel Architectures
Support for developing parallel programming applications on Intel® Architecture.
Announcements
The Intel sign-in experience has changed to support enhanced security controls. If you sign in, click here for more information.

linking with two versions of mkl (multi threaded and single threaded) in one application

Michal_K_2
Beginner
258 Views

Hi,

Is it possible to use both the single threaded version of mkl library and the multi threaded version of mkl in one application?

I need the single threaded version to use with PLASMA library, yet at some other part of my code, I need use mkl PARDISO, for which I need the multi threaded version.

Any help will be greatly appreciated.

Cheers

Michal

 

0 Kudos
3 Replies
Michal_K_2
Beginner
258 Views

I forgot to say that my operating system is Linux, debian wheezy.

 

Michal_K_2
Beginner
258 Views

I was able to fix the problem, by lining PLASMA with the multi threaded mkl. The crucial thing was to set

call kmp_set_defaults("KMP_AFFINITY=disabled")

which makes PLASMA with multi threaded mkl only 2% slower than PLASMA with single threaded mkl. Without this option it is 3 times slower.

It means that I do not need to link to the single threaded library anymore. 

 

jimdempseyatthecove
Black Belt
258 Views

If each is establishing its own thread pool, then experiment with KMP_BLOCKTIME environment variable settings or KMP_SET_BLOCKTIME function.

Jim Dempsey

 

Reply