]>
Commit | Line | Data |
---|---|---|
c63539ff ML |
1 | .. |
2 | Copyright 1988-2022 Free Software Foundation, Inc. | |
3 | This is part of the GCC manual. | |
4 | For copying conditions, see the copyright.rst file. | |
5 | ||
6 | .. index:: Environment Variable | |
7 | ||
8 | .. _omp_proc_bind: | |
9 | ||
10 | OMP_PROC_BIND -- Whether theads may be moved between CPUs | |
11 | ********************************************************* | |
12 | ||
13 | Description: | |
14 | Specifies whether threads may be moved between processors. If set to | |
15 | ``TRUE``, OpenMP theads should not be moved; if set to ``FALSE`` | |
16 | they may be moved. Alternatively, a comma separated list with the | |
17 | values ``PRIMARY``, ``MASTER``, ``CLOSE`` and ``SPREAD`` can | |
18 | be used to specify the thread affinity policy for the corresponding nesting | |
19 | level. With ``PRIMARY`` and ``MASTER`` the worker threads are in the | |
20 | same place partition as the primary thread. With ``CLOSE`` those are | |
21 | kept close to the primary thread in contiguous place partitions. And | |
22 | with ``SPREAD`` a sparse distribution | |
23 | across the place partitions is used. Specifying more than one item in the | |
24 | list will automatically enable nesting by default. | |
25 | ||
26 | When undefined, :envvar:`OMP_PROC_BIND` defaults to ``TRUE`` when | |
27 | :envvar:`OMP_PLACES` or :envvar:`GOMP_CPU_AFFINITY` is set and ``FALSE`` otherwise. | |
28 | ||
29 | See also: | |
30 | :ref:`omp_get_proc_bind`, :ref:`GOMP_CPU_AFFINITY`, | |
31 | :ref:`OMP_NESTED`, :ref:`OMP_PLACES` | |
32 | ||
33 | Reference: | |
34 | :openmp:`4.5`, Section 4.4 |