NAG C Library Function Document

nag_omp_in_parallel (x06afc)

1
Purpose

nag_omp_in_parallel (x06afc) returns 1 if called from within an active OpenMP parallel region, and 0 otherwise.

2
Specification

#include <nag.h>
#include <nagx06.h>
Integer  nag_omp_in_parallel ()

3
Description

nag_omp_in_parallel (x06afc), for multi-threaded implementations, returns 1 if called from within an active OpenMP parallel region, and 0 otherwise.
In serial implementations of the NAG C Library this function will always return 0. See the x06 Chapter Introduction for a discussion of the behaviour of these functions when called in serial.

4
References

OpenMP Specifications
Chapman B, Jost G and van der Pas R (2008) Using OpenMP Portable Shared Memory Parallel Programming The MIT Press

5
Arguments

None.

6
Error Indicators and Warnings

None.

7
Accuracy

Not applicable.

8
Parallelism and Performance

nag_omp_in_parallel (x06afc) is not threaded in any implementation.

9
Further Comments

None.

10
Example

See Section 10 in nag_omp_get_thread_num (x06adc) for a demonstration of how to use nag_omp_in_parallel (x06afc).