omp_display_env (GNU libgomp)

#### 3.14.1 `omp_display_env` – print the initial ICV values ¶

Description:

  Each time this routine is invoked, the OpenMP version number and initial value of internal control variables (ICVs) is printed on `stderr`. The displayed values are those at startup after evaluating the environment variables; later calls to API routines or clauses used in enclosing constructs do not affect the output.

  If the verbose argument is `false`, only the OpenMP version and standard OpenMP ICVs are shown; if it is `true`, additionally, the GCC-specific ICVs are shown.

  The output consists of multiple lines and starts with ‘`OPENMP DISPLAY ENVIRONMENT BEGIN`’ followed by the name-value lines and ends with ‘`OPENMP DISPLAY ENVIRONMENT END`’. The name is followed by an equal sign and the value is enclosed in single quotes.

  The first line has as name either ‘`_OPENMP`’ or ‘`openmp_version`’ and shows as value the supported OpenMP version number (4-digit year, 2-digit month) of the implementation, matching the value of the `_OPENMP` macro and, in Fortran, the named constant `openmp_version`.

  In each of the succeeding lines, the name matches the environment-variable name of an ICV and shows its value. Those line are might be prefixed by pair of brackets and a space, where the brackets enclose a comma-separated list of devices to which the ICV-value combination applies to; the value can either be a numeric device number or an abstract name denoting all devices (`all`), the initial host device (`host`) or all devices but the host (`device`). Note that the same ICV might be printed multiple times for multiple devices, even if all have the same value.

  The effect when invoked from within a `target` region is unspecified.

C/C++:

  Prototype: | `void omp_display_env(int verbose)`

Fortran:

  Interface: | `subroutine omp_display_env(verbose)`
  | `logical, intent(in) :: verbose`

Example:

  Note that the GCC-specific ICVs, such as the shown `GOMP_SPINCOUNT`, are only printed when verbose set to `true`.

      OPENMP DISPLAY ENVIRONMENT BEGIN
        _OPENMP = '202111'
        [host] OMP_DYNAMIC = 'FALSE'
        [host] OMP_NESTED = 'FALSE'
        [all] OMP_CANCELLATION = 'FALSE'
        ...
        [host] GOMP_SPINCOUNT = '300000'
      OPENMP DISPLAY ENVIRONMENT END

See also:

  `OMP_DISPLAY_ENV` – Show OpenMP version and environment variables, OpenMP Environment Variables, Implementation-defined ICV Initialization

Reference:

  OpenMP specification v5.1, Section 3.15