x06aac, for multithreaded implementations, sets the number of threads
to be requested for subsequent parallel regions to
num. The first element of the list held by the OpenMP Internal Control Variable (ICV) used in determining the number of threads is set. See the
Users' Note for your implementation for details of the scope of this function.
The number of threads used in parallel regions will be equal to, or less than, the value of the ICV. The actual number of threads used is dependent on several factors, such as the presence of a
num_threads clause on the
parallel directive or the number of threads already in use by the program. Please refer to
Section 4 for a full description of how the number of threads is chosen for a particular parallel region.
In serial implementations of the
NAG Library this function has no effect.
See the
X06 Chapter Introduction for a discussion of the behaviour of these functions when called in serial.
Not applicable.
Background information to multithreading can be found in the
Multithreading documentation.
None.
In this example we presume a multithreaded implementation of the
NAG Library. We set the OpenMP Internal Control Variable used in determining the number of threads
to
with a call to
x06aac and retrieve it again with
x06acc.
We then, using
x06abc, display the number of threads in use both outside, and inside, the OpenMP parallel region.
We expect to see
x06abc returning
outside of the parallel region, as the current team of threads there will consist of a single thread, and
from within it.
If you use a serial implementation of the
NAG Library, regardless of whether the code is compiled with OpenMP or not, calling
x06aac has no effect and
x06abc and
x06acc will always return
. The appropriate results file will be included with the distribution material for your implementation.
None.