OMP_PLACES

The OMP_PLACES environment variable specifies a list of places that are available when the OpenMP program is executed. The value of OMP_PLACES can be either one of the following values:
  • An explicit list of places that are described by non-negative numbers
  • An abstract name that describes a set of places
Read syntax diagramSkip visual syntax diagram
OMP_PLACES syntax

>>-OMP_PLACES=--+-place_list-+---------------------------------><
                '-place_name-'   

where place_list takes one of the following syntax forms:
Read syntax diagramSkip visual syntax diagram
place_list syntax: form 1

   .-,------------------------------------------------------.   
   V .-!-.                                                  |   
>>---+---+--{--+-lower_bound--:--length--+-----------+-+--}-+--><
               |                         '-: -stride-' |        
               | .-,---.                               |        
               | V     |                               |        
               '---num-+-------------------------------'        

Read syntax diagramSkip visual syntax diagram
place_list syntax: form 2

   .-!-.                                                               
>>-+---+--{--lower_bound--:--length--}--:--num_places--:--multiplier-><

where lower_bound, length, stride, num, num_places, and multiplier are positive integers. The thread number in each place starts with the value that is a multiple of multiplier. The exclusion operator ! excludes the number or place that follows the operator immediately.
Read syntax diagramSkip visual syntax diagram
place_name syntax

   .-cores---.                         
>>-+-threads-+--+------------------+---------------------------><
                '-(--num_places--)-'   

threads
Each place contains a hardware thread.
cores
Each place contains a core. If OMP_PLACES is not set, the default setting is cores.
num_places
Is the number of places.

Usage

When requested places are fewer than that are available on the system, the execution environment assigns places in the order of the place list at run time. When requested places are more than that are available on the system, the execution environment assigns the maximum number of places that the system supports at run time.

For a program that contains both OpenMP and OpenMPI code, the OpenMP runtime detects the existence of OpenMPI code by the presence of the OMPI_COMM_WORLD_RANK environment variable. If you do not set OMP_PLACES explicitly, the compiler sets OMP_PLACES to cores and removes any unavailable resources from OMP_PLACES based on the OpenMPI affinity policy. In addition, OMP_PROC_BIND is set to TRUE.

For examples on how to set the OMP_PLACES environment variable, see examples in OMP_PROC_BIND.



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