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

OpenMP not using all processors

Edward_Z_1
Beginner
724 Views

I am trying to use MKL libraries and OpenMP in a MSVS C++ application on Windows7. The application shows affinity for all 24 processors (2 nodes, 6 processors, HyperThreaded). omp_get_num_procs() also shows 24 processors.  When I run the program only 1 node and 6 processors are accessed. This is confirmed  when I use "KMP_AFFINITY=verbose,none". It ouputs "OMP: Info #179: KMP_AFFINITY: 1 packages x 6 cores/pkg x 1 threads/core (6 total cores)".  I get no compiler or linker complaints.

I am in the process of creating a simple program to see if it has the same problem and hopefully find something I missed in the settings. Does anyone have any suggestions?

Thanks, Ted 

0 Kudos
2 Replies
Edward_Z_1
Beginner
724 Views


Comment by Brian Bliss (Intel): on OpenMP runtime forum

Try  "KMP_AFFINITY=verbose,norespect,none".

If the initialization thread's affinity mask is set to be just the first node, then OpenMP RTL will consider that to be the portion of the machine that you are interested in running on.  If you say "norespect", then any proc that the RTL can detect will be included in the machine model.

----------------------------------------------------------------------------------------------------------------------------------------------------------------

This did the trick.  I verified with and without HyperThreads enabled.   Sorry I did not catch that from the documentation. This is my first venture into OpenMP.

 

0 Kudos
Ying_H_Intel
Employee
724 Views

Hi Edward Z, 

Thanks for sharing.  

Best Regards,

Ying

0 Kudos
Reply