X06ABF (PDF version)
X06 Chapter Contents
X06 Chapter Introduction
NAG Library Manual

NAG Library Routine Document

X06ABF

 Contents

    1  Purpose
    7  Accuracy
    10  Example

1  Purpose

X06ABF returns the number of OpenMP threads in the current team.

2  Specification

FUNCTION X06ABF ( )
INTEGER X06ABF

3  Description

X06ABF, for multi-threaded implementations, returns the number of OpenMP threads in the current team. If the number of threads is deemed critical then you are advised to use X06ABF to retrieve this value as it may be less than that requested with either a call to X06AAF, your OMP_NUM_THREADS environment variable value or by using a num_threads clause on an OpenMP parallel directive.
The number of threads actually in use in a parallel region is dependent on several factors. Please refer to Section 4 for a full description of how the number of threads is chosen for a particular parallel region.
If this routine is called from a sequential part of a multi-threaded program then it will return the value 1.
In serial implementations of the NAG Library this routine will always return 1. See the X06 Chapter Introduction for a discussion of the behaviour of these routines when called in serial.

4  References

OpenMP Specifications http://openmp.org/wp/OpenMP-Specifications
Chapman B, Jost G and van der Pas R (2008) Using OpenMP Portable Shared Memory Parallel Programming The MIT Press

5  Parameters

None.

6  Error Indicators and Warnings

None.

7  Accuracy

Not applicable.

8  Parallelism and Performance

Not applicable.

9  Further Comments

None.

10  Example

See Section 10 in X06AAF for a demonstration of how to use X06ABF.

X06ABF (PDF version)
X06 Chapter Contents
X06 Chapter Introduction
NAG Library Manual

© The Numerical Algorithms Group Ltd, Oxford, UK. 2015