OMP_THREAD_LIMIT

The OMP_THREAD_LIMIT environment variable sets the number of OpenMP threads to use for the whole program.
Read syntax diagramSkip visual syntax diagram
>>-OMP_THREAD_LIMIT--=--n--------------------------------------><

n
The number of OpenMP threads to use for the whole program. It must be a positive scalar integer that is less than 65536.

Usage

When OMP_THREAD_LIMIT=1, the parallel regions are run sequentially rather than in parallel. However, when OMP_THREAD_LIMIT is much smaller than the number of threads that are required in the program, the parallel region might still run in parallel but with fewer threads. When there are nested parallel regions, some parallel regions might run in parallel, some might run sequentially, and some might run in parallel but with threads that are recycled from other regions.

If the OMP_THREAD_LIMIT environment variable is not set and the OMP_NUM_THREADS environment variable is set to a single value, the default value for OMP_THREAD_LIMIT is the value of OMP_NUM_THREADS or the number of available processors, whichever is greater.

If the OMP_THREAD_LIMIT environment variable is not set and the OMP_NUM_THREADS environment variable is set to a list, the default value for OMP_THREAD_LIMIT is the multiplication of all the numbers in the list or the number of available processors, whichever is greater.

If neither the OMP_THREAD_LIMIT nor OMP_NUM_THREADS environment variable is set, the default value for OMP_THREAD_LIMIT is the number of available processors.



Voice your opinion on getting help information Ask IBM compiler experts a technical question in the IBM XL compilers forum Reach out to us