Note: this function is deprecated and will be withdrawn at Mark 31.3. Replaced by
x06ajc.
Old Code
nag_omp_set_nested(nesting)
New Code
nag_omp_set_max_active_levels(num, &ifail)
if
nesting would be set to
then
num must be
. If
nesting would be set to
set
num to the number of nested active parallel regions required.
x06agc, for multithreaded implementations, enables or disables the nesting of OpenMP parallel regions by setting an OpenMP Internal Control Variable (ICV) and any vendor library specific options where that is possible. See the
Users' Note for your implementation for details of the scope of
x06agc.
Nesting is disabled by default in OpenMP.
In serial implementations of the NAG Library
x06agc has no effect. See the
Chapter X06 for a discussion of the behaviour of these functions when called in serial.
None.
Not applicable.
None.
In this example we presume a multithreaded implementation of the NAG Library. We call
x06agc to enable the nesting of OpenMP parallel regions by setting an ICV. Inside a first, or ‘outer’, parallel region we call
x06ahc to display the status of nesting, and expect to see it return the value
.
Each thread then spawns a second ‘inner’ parallel region. Within this region we have each thread increment the value total. As there are threads in the outer region and threads in each inner region we expect the final value of this variable to be .
If you use a serial implementation of the NAG Library, regardless of whether the code is compiled with OpenMP or not,
x06agc will have no effect and
x06ahc will always return
. The total number of threads will be
. The appropriate results file will be included with the distribution material for your implementation.
None.