OMP_PROC_BIND
The OMP_PROC_BIND environment variable controls whether OpenMP threads can be moved between processors.
OMP_PROC_BIND syntax >>-OMP_PROC_BIND=--+-TRUE--+----------------------------------->< '-FALSE-'
- TRUE
- Binds the threads to processors.
- FALSE
- Allows threads to be moved between processors.
The OMP_PROC_BIND and XLSMPOPTS environment variables interact with each other according to the following rules:
OMP_PROC_BINDsettings | XLSMPOPTS settings | Thread binding results |
---|---|---|
OMP_PROC_BIND is not set | OMP_PROC_BIND is not set | Threads are not bound. |
OMP_PROC_BIND is set to startproc/stride or procs | Threads are bound according to the settings in XLSMPOPTS. | |
XLSMPOPTS setting is invalid | Threads are not bound. | |
OMP_PROC_BIND=TRUE | XLSMPOPTS is not set | Threads are bound. |
XLSMPOPTS is set to startproc/stride or procs | Threads are bound according to the settings in XLSMPOPTS1. | |
XLSMPOPTS setting is invalid | Threads are bound. | |
OMP_PROC_BIND=FALSE | XLSMPOPTS is not set | Threads are not bound. |
XLSMPOPTS is set (startproc/stride or procs) | ||
XLSMPOPTS setting is invalid | ||
Note:
|
The OMP_PROC_BIND environment variable provides a portable way to control whether OpenMP threads can be migrated. The startproc/stride or procs suboption of the XLSMPOPTS environment variable, which is an IBM extension, provides a finer control to bind OpenMP threads to processors. If portability of your application is important, use only the OMP_PROC_BIND environment variable to control thread binding.