Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

OMP: Warning #96:

Michal_K_
Beginner
1,849 Views

Hello

When I run a code that uses multithreaded blas(mkl library), and I want to run it with a single thread, I get a warning:

OMP: Warning #96: Cannot form a team with 24 threads, using 1 instead.
OMP: Hint: Consider unsetting KMP_ALL_THREADS and OMP_THREAD_LIMIT (if ei\
ther is set).

How can I prevent this warning from being printed?

I set threads number limit to 1 on purpose, and I want to keep it this way.

And I want to link multithreaded blas with my code. Just in one part of the code, I have to run it with one thread.

Thanks for help!

Cheers

Michal

 

0 Kudos
1 Reply
jimdempseyatthecove
Honored Contributor III
1,849 Views

Try building your application without the openmp option. The multi-threaded verson of the MKL/blas library will itself load/bind with the OpenMP library and instantiate the OpenMP thread team for its use. Your OMP_NUM_THREADS and/or OMP_MAX_THREADS environment variables should be set for what you want MKL to use. You can also use MKL_NUM_THREADS environment variable.

In the past, "multi-threaded library" tended to mean "multi-thread safe" library. The application was multi-threaded with each thread (concurrently) calling a one-thread context function. In the case of MKL, both versions of the library are  "multi-thread safe". The single (MKL) threaded library is used by multi-threaded applications, the multi-threaded MKL library is used by single-threaded applications. IOW the multi-threadedness exists in one domain (application/MKL).

In some situations you may want (need) to use multi-threaded MKL together with a multi-threaded application. Under this circumstance, it may be favorable to undersubscribe the thread count for the application as well as undersubscribe the threadcount for MKL

OMP_NUM_THEADS=someFracton
MKL_NUM_THREADS=otherFraction

On your system this could be 12,12 or 6,18, or 18,6, or... (you find the sweet spot)

Note, the sweet spot where the sum of the two fractions is not necessarily the total hardware threads available to the process. It could be more or less.

Jim Dempsey

0 Kudos
Reply