X06ADF returns the OpenMP thread number of the calling thread.
X06ADF, for multi-threaded implementations, returns the calling OpenMP thread's unique thread number within the current team. The master thread will always return
. The remaining threads will return a value between
and the value returned by
X06ABF less
.
If this routine is called from a sequential part of a multi-threaded program then it will return the value .
In serial implementations of the NAG Library this routine will always return
. See the
X06 Chapter Introduction for a discussion of the behaviour of these routines when called in serial.
None.
None.
Not applicable.
Not applicable.
None.
In this example we presume a multi-threaded implementation of the NAG Library. We call X06ADF both outside and inside an OpenMP active parallel region. Outside we expect a single thread to display the value . Inside the region we use the value to have only the master thread display the result.
We also call
X06AFF inside and outside of the region. Outside we expect it to return
, as we are not in an active parallel region, and inside we expect to see the value
, indicating that the parallel region is an active one.
If you use a serial implementation of the NAG library, regardless of whether the code is compiled with OpenMP or not,
X06ABF will always return
and X06ADF and
X06AFF will always return
. The appropriate results file will be included with the distribution material for your implementation.
None.