HOME
| OPENMP API Specification: Version 5.1 November 2020

6.4  OMP_PROC_BIND

The OMP_PROC_BIND environment variable sets the initial value of the bind-var ICV. The value of this environment variable is either true, false, or a comma separated list of primary, master (master has been deprecated), close, or spread. The values of the list set the thread affinity policy to be used for parallel regions at the corresponding nested level.

If the environment variable is set to false, the execution environment may move OpenMP threads between OpenMP places, thread affinity is disabled, and proc_bind clauses on parallel constructs are ignored.

Otherwise, the execution environment should not move OpenMP threads between OpenMP places, thread affinity is enabled, and the initial thread is bound to the first place in the place-partition-var ICV prior to the first active parallel region. An initial thread that is created by a teams construct is bound to the first place in its place-partition-var ICV before it begins execution of the associated structured block.

If the environment variable is set to true, the thread affinity policy is implementation defined but must conform to the previous paragraph. The behavior of the program is implementation defined if the value in the OMP_PROC_BIND environment variable is not true, false, or a comma separated list of primary, master (master has been deprecated), close, or spread. The behavior is also implementation defined if an initial thread cannot be bound to the first place in the place-partition-var ICV.

The OMP_PROC_BIND environment variable sets the max-active-levels-var ICV to the number of active levels of parallelism that the implementation supports if the OMP_PROC_BIND environment variable is set to a comma-separated list of more than one element. The value of the max-active-level-var ICV may be overridden by setting OMP_MAX_ACTIVE_LEVELS or OMP_NESTED. See Section 6.8 and Section 6.9 for details.

Examples:  

 
setenv OMP_PROC_BIND false 
setenv OMP_PROC_BIND "spread, spread, close"  

Cross References