Next: , Previous: , Up: Runtime Library Routines   [Contents][Index]

2.11 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.

Prototype:int omp_get_nested(void);
Interface:logical function omp_get_nested()
See also:

omp_set_max_active_levels, omp_set_nested, OMP_MAX_ACTIVE_LEVELS, OMP_NESTED


OpenMP specification v4.5, Section 3.2.11.