HOME
| OPENMP API Specification: Version 5.0 November 2018

6.13  OMP_DISPLAY_AFFINITY

The OMP_DISPLAY_AFFINITY environment variable instructs the runtime to display formatted affinity information for all OpenMP threads in the parallel region upon entering the first parallel region and when any change occurs in the information accessible by the format specifiers listed in Table 6.2. If affinity of any thread in a parallel region changes then thread affinity information for all threads in that region is displayed. If the thread affinity for each respective parallel region at each nesting level has already been displayed and the thread affinity has not changed, then the information is not displayed again. There is no specific order in displaying thread affinity information for all threads in the same parallel region.

The value of the OMP_DISPLAY_AFFINITY environment variable may be set to one of these values:

TRUE | FALSE

The TRUE value instructs the runtime to display the OpenMP thread affinity information, and uses the format setting defined in the affinity-format-var ICV.

The runtime does not display the OpenMP thread affinity information when the value of the OMP_DISPLAY_AFFINITY environment variable is FALSE or undefined. For all values of the environment variable other than TRUE or FALSE, the display action is implementation defined.

Example:  

 
setenv OMP_DISPLAY_AFFINITY TRUE  

The above example causes an OpenMP implementation to display OpenMP thread affinity information during execution of the program, in a format given by the affinity-format-var ICV. The following is a sample output:  

 
nesting_level=   1,   thread_num=   0,   thread_affinity=    0,1 
nesting_level=   1,   thread_num=   1,   thread_affinity=    2,3  

Cross References