GNU libgomp: omp_in_parallel

Next: omp_in_final, Previous: omp_get_thread_num, Up: Runtime Library Routines [Contents][Index]

### 2.20 `omp_in_parallel` – Whether a parallel region is active

Description:

  This function returns `true` if currently running in parallel, `false` otherwise. Here, `true` and `false` represent their language-specific counterparts.

C/C++:

  Prototype: | `int omp_in_parallel(void);`

Fortran:

  Interface: | `logical function omp_in_parallel()`

Reference:

  OpenMP specification v4.0, Section 3.2.6.