Intel® oneAPI Math Kernel Library
Ask questions and share information with other developers who use Intel® Math Kernel Library.
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.

MKL Parallelism problem

sspine
Beginner
1,801 Views

I'm trying MKL10 with OpenMP on dual-core linux machine.

The MKL user's guide told me:

In Intel MKL 10.0, the OpenMP* software determines the default
number of threads. The default number of threads is equal to the number
of logical processors in your system for Intel OpenMP* libraries.

But this is not the truth for me. I have tried cblas_dgemm function (matrix multiply) using the default settings, MKL only uses one core for the calculation. But after I set the environment variable MKL_NUM_THREADS to 2, the MKL can utilize both cores, and the calculation time is about 1/2 of the first case.

The following are my settings:

MKL: 10.0.4.023 with customized shared library

OS: SuSE Linux 10.2, 32-bit

CPU: Intel Core2 Duo

Can someone tell me what on earth the default behaviour of MKL as for MKL_NUM_THREADS?

Thanks!

0 Kudos
2 Replies
sspine
Beginner
1,801 Views

No one can answer this question?

MKL user manual tells me that the default value of OMP_NUM_THREADS=2. But the user manul does not tell me the default value of MKL_NUM_THREADS. I guess MKL_NUM_THREADS=1 by default. Since MKL_NUM_THREADS takes precesence over OMP_NUM_THREADS, the multi-core support is disabled by default. If this is the truth, it can be approved by my experiment.

Another question is function set_mkl_num_threads() will depend on what libraries? Linux always tell me that some functions unavailable, but I do not know where can I find them.

0 Kudos
Vladimir_Lunev
New Contributor I
1,801 Views
Quoting - sspine

No one can answer this question?

MKL user manual tells me that the default value of OMP_NUM_THREADS=2. But the user manul does not tell me the default value of MKL_NUM_THREADS. I guess MKL_NUM_THREADS=1 by default. Since MKL_NUM_THREADS takes precesence over OMP_NUM_THREADS, the multi-core support is disabled by default. If this is the truth, it can be approved by my experiment.

Another question is function set_mkl_num_threads() will depend on what libraries? Linux always tell me that some functions unavailable, but I do not know where can I find them.


Hi,

MKL uses "Number of physical cores" threads by the default. If you has set MKL_NUM_THREADS or OMP_NUM_THREADS to the positive value then this value is used instead of the default.

Please, how did you link MKL?

Thanks,
-Vladimir

0 Kudos
Reply