Intel® Moderncode for Parallel Architectures
Support for developing parallel programming applications on Intel® Architecture.
1696 Discussions

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

Michal_K_2
Beginner
445 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
445 Views

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

 

0 Kudos
Michal_K_2
Beginner
445 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. 

 

0 Kudos
jimdempseyatthecove
Honored Contributor III
445 Views

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

Jim Dempsey

 

0 Kudos
Reply