omp_get_nested
– Nested parallel regions ¶This function returns true
if nested parallel regions are
enabled, false
otherwise. Here, true
and false
represent their language-specific counterparts.
The state of nested parallel regions at startup depends on several
environment variables. If OMP_MAX_ACTIVE_LEVELS
is defined
and is set to greater than one, then nested parallel regions will be
enabled. If not defined, then the value of the OMP_NESTED
environment variable will be followed if defined. If neither are
defined, then if either OMP_NUM_THREADS
or OMP_PROC_BIND
are defined with a list of more than one value, then nested parallel
regions are enabled. If none of these are defined, then nested parallel
regions are disabled by default.
Nested parallel regions can be enabled or disabled at runtime using
omp_set_nested
, or by setting the maximum number of nested
regions with omp_set_max_active_levels
to one to disable, or
above one to enable.
Note that the omp_get_nested
API routine was deprecated
in the OpenMP specification 5.0 in favor of omp_get_max_active_levels
.
Prototype: | int omp_get_nested(void); |
Interface: | logical function omp_get_nested() |
omp_get_max_active_levels
– Current maximum number of active regions, omp_set_nested
– Enable/disable nested parallel regions,
OMP_MAX_ACTIVE_LEVELS
– Set the maximum number of nested parallel regions, OMP_NESTED
– Nested parallel regions
OpenMP specification v4.5, Section 3.2.11.