Commit 83fd6c5b by Tobias Burnus Committed by Tobias Burnus

intrinsic.texi (OpenMP Modules): Update to OpenMPv4.

gcc/fortran/
2013-10-16  Tobias Burnus  <burnus@net-b.de>

        * intrinsic.texi (OpenMP Modules): Update to OpenMPv4.
        Document omp_proc_bind_kind.

libgomp/
2013-10-16  Tobias Burnus  <burnus@net-b.de>

        * libgomp.texi: (Runtime Library Routines): Update references
        * for
        OpenMP 4.0. Add omp_get_cancellation, omp_get_default_device,
        omp_get_num_devices, omp_get_num_teams, omp_get_proc_bind,
        omp_get_team_num, omp_is_initial_device, omp_set_default_device.
        (Environment Variables): Update references for OpenMP 4.0. Add
        OMP_CANCELLATION, OMP_DEFAULT_DEVICE, OMP_PLACES.
        Move OMP_DISPLAY_ENV and OMP_PROC_BIND up to be in alphabetical
        order.

From-SVN: r203635
parent bf7b5747
2013-10-16 Tobias Burnus <burnus@net-b.de>
* intrinsic.texi (OpenMP Modules): Update to OpenMPv4.
Document omp_proc_bind_kind.
2013-10-15 Tobias Burnus <burnus@net-b.de>
PR fortran/58652
......
......@@ -13177,7 +13177,7 @@ Both are equivalent to the value @code{NULL} in C.
@section OpenMP Modules @code{OMP_LIB} and @code{OMP_LIB_KINDS}
@table @asis
@item @emph{Standard}:
OpenMP Application Program Interface v3.1
OpenMP Application Program Interface v4.0
@end table
......@@ -13190,8 +13190,8 @@ the named constants defined in the modules are listed
below.
For details refer to the actual
@uref{http://www.openmp.org/mp-documents/spec31.pdf,
OpenMP Application Program Interface v3.1}.
@uref{http://www.openmp.org/mp-documents/OpenMP4.0.0.pdf,
OpenMP Application Program Interface v4.0}.
@code{OMP_LIB_KINDS} provides the following scalar default-integer
named constants:
......@@ -13199,15 +13199,17 @@ named constants:
@table @asis
@item @code{omp_lock_kind}
@item @code{omp_nest_lock_kind}
@item @code{omp_proc_bind_kind}
@item @code{omp_sched_kind}
@end table
@code{OMP_LIB} provides the scalar default-integer
named constant @code{openmp_version} with a value of the form
@var{yyyymm}, where @code{yyyy} is the year and @var{mm} the month
of the OpenMP version; for OpenMP v3.1 the value is @code{201107}.
of the OpenMP version; for OpenMP v3.1 the value is @code{201107}
and for OpenMP v4.0 the value is @code{201307}.
And the following scalar integer named constants of the
The following scalar integer named constants of the
kind @code{omp_sched_kind}:
@table @asis
......@@ -13216,3 +13218,14 @@ kind @code{omp_sched_kind}:
@item @code{omp_sched_guided}
@item @code{omp_sched_auto}
@end table
And the following scalar integer named constants of the
kind @code{omp_proc_bind_kind}:
@table @asis
@item @code{omp_proc_bind_false}
@item @code{omp_proc_bind_true}
@item @code{omp_proc_bind_master}
@item @code{omp_proc_bind_close}
@item @code{omp_proc_bind_spread}
@end table
2013-10-16 Tobias Burnus <burnus@net-b.de>
* libgomp.texi: (Runtime Library Routines): Update references for
OpenMP 4.0. Add omp_get_cancellation, omp_get_default_device,
omp_get_num_devices, omp_get_num_teams, omp_get_proc_bind,
omp_get_team_num, omp_is_initial_device, omp_set_default_device.
(Environment Variables): Update references for OpenMP 4.0. Add
OMP_CANCELLATION, OMP_DEFAULT_DEVICE, OMP_PLACES.
Move OMP_DISPLAY_ENV and OMP_PROC_BIND up to be in alphabetical
order.
2013-10-14 Jakub Jelinek <jakub@redhat.com>
* env.c (parse_bind_var): Initialize value to avoid
......
......@@ -116,7 +116,7 @@ arranges for automatic linking of the OpenMP runtime library
A complete description of all OpenMP directives accepted may be found in
the @uref{http://www.openmp.org, OpenMP Application Program Interface} manual,
version 3.1.
version 4.0.
@c ---------------------------------------------------------------------
......@@ -126,30 +126,37 @@ version 3.1.
@node Runtime Library Routines
@chapter Runtime Library Routines
The runtime routines described here are defined by section 3 of the OpenMP
specifications in version 3.1. The routines are structured in following
The runtime routines described here are defined by Section 3 of the OpenMP
specification in version 4.0. The routines are structured in following
three parts:
Control threads, processors and the parallel environment.
They have C linkage, and don't throw exceptions.
Control threads, processors and the parallel environment. They have C
linkage, and do not throw exceptions.
@menu
* omp_get_active_level:: Number of active parallel regions
* omp_get_ancestor_thread_num:: Ancestor thread ID
* omp_get_cancellation:: Whether cancellation support is enabled
* omp_get_default_device:: Get the default device for target regions
* omp_get_dynamic:: Dynamic teams setting
* omp_get_level:: Number of parallel regions
* omp_get_max_active_levels:: Maximum number of active regions
* omp_get_max_threads:: Maximum number of threads of parallel region
* omp_get_nested:: Nested parallel regions
* omp_get_num_devices:: Number of target devices
* omp_get_num_procs:: Number of processors online
* omp_get_num_teams:: Number of teams
* omp_get_num_threads:: Size of the active team
* omp_get_proc_bind:: Whether theads may be moved between CPUs
* omp_get_schedule:: Obtain the runtime scheduling method
* omp_get_team_num:: Get team number
* omp_get_team_size:: Number of threads in a team
* omp_get_thread_limit:: Maximum number of threads
* omp_get_thread_num:: Current thread ID
* omp_in_parallel:: Whether a parallel region is active
* omp_in_final:: Whether in final or included task region
* omp_is_initial_device:: Whether executing on the host device
* omp_set_default_device:: Set the default device for target regions
* omp_set_dynamic:: Enable/disable dynamic teams
* omp_set_max_active_levels:: Limits the number of active parallel regions
* omp_set_nested:: Enable/disable nested parallel regions
......@@ -202,7 +209,7 @@ which enclose the calling call.
@ref{omp_get_level}, @ref{omp_get_max_active_levels}, @ref{omp_set_max_active_levels}
@item @emph{Reference}:
@uref{http://www.openmp.org/, OpenMP specifications v3.1}, section 3.2.19.
@uref{http://www.openmp.org/, OpenMP specification v4.0}, Section 3.2.20.
@end table
......@@ -231,7 +238,60 @@ zero to @code{omp_get_level} -1 is returned; if @var{level} is
@ref{omp_get_level}, @ref{omp_get_thread_num}, @ref{omp_get_team_size}
@item @emph{Reference}:
@uref{http://www.openmp.org/, OpenMP specifications v3.1}, section 3.2.17.
@uref{http://www.openmp.org/, OpenMP specification v4.0}, Section 3.2.18.
@end table
@node omp_get_cancellation
@section @code{omp_get_cancellation} -- Whether cancellation support is enabled
@table @asis
@item @emph{Description}:
This function returns @code{true} if cancellation is activated, @code{false}
otherwise. Here, @code{true} and @code{false} represent their language-specific
counterparts. Unless @env{OMP_CANCELLATION} is set true, cancellations are
deactivated.
@item @emph{C/C++}:
@multitable @columnfractions .20 .80
@item @emph{Prototype}: @tab @code{int omp_get_cancellation(void);}
@end multitable
@item @emph{Fortran}:
@multitable @columnfractions .20 .80
@item @emph{Interface}: @tab @code{logical function omp_get_cancellation()}
@end multitable
@item @emph{See also}:
@ref{OMP_CANCELLATION}
@item @emph{Reference}:
@uref{http://www.openmp.org/, OpenMP specification v4.0}, Section 3.2.9.
@end table
@node omp_get_default_device
@section @code{omp_get_default_device} -- Get the default device for target regions
@table @asis
@item @emph{Description}:
Get the default device for target regions without device clause.
@item @emph{C/C++}:
@multitable @columnfractions .20 .80
@item @emph{Prototype}: @tab @code{int omp_get_default_device(void);}
@end multitable
@item @emph{Fortran}:
@multitable @columnfractions .20 .80
@item @emph{Interface}: @tab @code{integer function omp_get_default_device()}
@end multitable
@item @emph{See also}:
@ref{OMP_DEFAULT_DEVICE}, @ref{omp_set_default_device}
@item @emph{Reference}:
@uref{http://www.openmp.org/, OpenMP specification v4.0}, Section 3.2.24.
@end table
......@@ -245,7 +305,7 @@ Here, @code{true} and @code{false} represent their language-specific
counterparts.
The dynamic team setting may be initialized at startup by the
@code{OMP_DYNAMIC} environment variable or at runtime using
@env{OMP_DYNAMIC} environment variable or at runtime using
@code{omp_set_dynamic}. If undefined, dynamic adjustment is
disabled by default.
......@@ -263,7 +323,7 @@ disabled by default.
@ref{omp_set_dynamic}, @ref{OMP_DYNAMIC}
@item @emph{Reference}:
@uref{http://www.openmp.org/, OpenMP specifications v3.1}, section 3.2.8.
@uref{http://www.openmp.org/, OpenMP specification v4.0}, Section 3.2.8.
@end table
......@@ -289,7 +349,7 @@ which enclose the calling call.
@ref{omp_get_active_level}
@item @emph{Reference}:
@uref{http://www.openmp.org/, OpenMP specifications v3.1}, section 3.2.16.
@uref{http://www.openmp.org/, OpenMP specification v4.0}, Section 3.2.17.
@end table
......@@ -314,7 +374,7 @@ This function obtains the maximum allowed number of nested, active parallel regi
@ref{omp_set_max_active_levels}, @ref{omp_get_active_level}
@item @emph{Reference}:
@uref{http://www.openmp.org/, OpenMP specifications v3.1}, section 3.2.15.
@uref{http://www.openmp.org/, OpenMP specification v4.0}, Section 3.2.16.
@end table
......@@ -340,7 +400,7 @@ that does not use the clause @code{num_threads}.
@ref{omp_set_num_threads}, @ref{omp_set_dynamic}, @ref{omp_get_thread_limit}
@item @emph{Reference}:
@uref{http://www.openmp.org/, OpenMP specifications v3.1}, section 3.2.3.
@uref{http://www.openmp.org/, OpenMP specification v4.0}, Section 3.2.3.
@end table
......@@ -354,7 +414,7 @@ enabled, @code{false} otherwise. Here, @code{true} and @code{false}
represent their language-specific counterparts.
Nested parallel regions may be initialized at startup by the
@code{OMP_NESTED} environment variable or at runtime using
@env{OMP_NESTED} environment variable or at runtime using
@code{omp_set_nested}. If undefined, nested parallel regions are
disabled by default.
......@@ -372,7 +432,29 @@ disabled by default.
@ref{omp_set_nested}, @ref{OMP_NESTED}
@item @emph{Reference}:
@uref{http://www.openmp.org/, OpenMP specifications v3.1}, section 3.2.10.
@uref{http://www.openmp.org/, OpenMP specification v4.0}, Section 3.2.11.
@end table
@node omp_get_num_devices
@section @code{omp_get_num_devices} -- Number of target devices
@table @asis
@item @emph{Description}:
Returns the number of target devices.
@item @emph{C/C++}:
@multitable @columnfractions .20 .80
@item @emph{Prototype}: @tab @code{int omp_get_num_devices(void);}
@end multitable
@item @emph{Fortran}:
@multitable @columnfractions .20 .80
@item @emph{Interface}: @tab @code{integer function omp_get_num_devices()}
@end multitable
@item @emph{Reference}:
@uref{http://www.openmp.org/, OpenMP specification v4.0}, Section 3.2.25.
@end table
......@@ -381,7 +463,7 @@ disabled by default.
@section @code{omp_get_num_procs} -- Number of processors online
@table @asis
@item @emph{Description}:
Returns the number of processors online.
Returns the number of processors online on that device.
@item @emph{C/C++}:
@multitable @columnfractions .20 .80
......@@ -394,7 +476,29 @@ Returns the number of processors online.
@end multitable
@item @emph{Reference}:
@uref{http://www.openmp.org/, OpenMP specifications v3.1}, section 3.2.5.
@uref{http://www.openmp.org/, OpenMP specification v4.0}, Section 3.2.5.
@end table
@node omp_get_num_teams
@section @code{omp_get_num_teams} -- Number of teams
@table @asis
@item @emph{Description}:
Returns the number of teams in the current team region.
@item @emph{C/C++}:
@multitable @columnfractions .20 .80
@item @emph{Prototype}: @tab @code{int omp_get_num_teams(void);}
@end multitable
@item @emph{Fortran}:
@multitable @columnfractions .20 .80
@item @emph{Interface}: @tab @code{integer function omp_get_num_teams()}
@end multitable
@item @emph{Reference}:
@uref{http://www.openmp.org/, OpenMP specification v4.0}, Section 3.2.26.
@end table
......@@ -407,10 +511,10 @@ Returns the number of threads in the current team. In a sequential section of
the program @code{omp_get_num_threads} returns 1.
The default team size may be initialized at startup by the
@code{OMP_NUM_THREADS} environment variable. At runtime, the size
@env{OMP_NUM_THREADS} environment variable. At runtime, the size
of the current team may be set either by the @code{NUM_THREADS}
clause or by @code{omp_set_num_threads}. If none of the above were
used to define a specific value and @code{OMP_DYNAMIC} is disabled,
used to define a specific value and @env{OMP_DYNAMIC} is disabled,
one thread per CPU online is used.
@item @emph{C/C++}:
......@@ -427,7 +531,35 @@ one thread per CPU online is used.
@ref{omp_get_max_threads}, @ref{omp_set_num_threads}, @ref{OMP_NUM_THREADS}
@item @emph{Reference}:
@uref{http://www.openmp.org/, OpenMP specifications v3.1}, section 3.2.2.
@uref{http://www.openmp.org/, OpenMP specification v4.0}, Section 3.2.2.
@end table
@node omp_get_proc_bind
@section @code{omp_get_proc_bind} -- Whether theads may be moved between CPUs
@table @asis
@item @emph{Description}:
This functions returns the currently active thread affinity policy, which is
set via @env{OMP_PROC_BIND}. Possible values are @code{omp_proc_bind_false},
@code{omp_proc_bind_true}, @code{omp_proc_bind_master},
@code{omp_proc_bind_close} and @code{omp_proc_bind_spread}.
@item @emph{C/C++}:
@multitable @columnfractions .20 .80
@item @emph{Prototype}: @tab @code{omp_proc_bind_t omp_get_proc_bind(void);}
@end multitable
@item @emph{Fortran}:
@multitable @columnfractions .20 .80
@item @emph{Interface}: @tab @code{integer(kind=omp_proc_bind_kind) function omp_get_proc_bind()}
@end multitable
@item @emph{See also}:
@ref{OMP_PROC_BIND}, @ref{OMP_PLACES}, @ref{GOMP_CPU_AFFINITY},
@item @emph{Reference}:
@uref{http://www.openmp.org/, OpenMP specification v4.0}, Section 3.2.22.
@end table
......@@ -443,12 +575,12 @@ set to the value @code{omp_sched_static}, @code{omp_sched_dynamic},
@item @emph{C/C++}
@multitable @columnfractions .20 .80
@item @emph{Prototype}: @tab @code{void omp_schedule(omp_sched_t *kind, int *modifier);}
@item @emph{Prototype}: @tab @code{void omp_get_schedule(omp_sched_t *kind, int *modifier);}
@end multitable
@item @emph{Fortran}:
@multitable @columnfractions .20 .80
@item @emph{Interface}: @tab @code{subroutine omp_schedule(kind, modifier)}
@item @emph{Interface}: @tab @code{subroutine omp_get_schedule(kind, modifier)}
@item @tab @code{integer(kind=omp_sched_kind) kind}
@item @tab @code{integer modifier}
@end multitable
......@@ -457,7 +589,29 @@ set to the value @code{omp_sched_static}, @code{omp_sched_dynamic},
@ref{omp_set_schedule}, @ref{OMP_SCHEDULE}
@item @emph{Reference}:
@uref{http://www.openmp.org/, OpenMP specifications v3.1}, section 3.2.12.
@uref{http://www.openmp.org/, OpenMP specification v4.0}, Section 3.2.13.
@end table
@node omp_get_team_num
@section @code{omp_get_team_num} -- Get team number
@table @asis
@item @emph{Description}:
Returns the team number of the calling thread.
@item @emph{C/C++}:
@multitable @columnfractions .20 .80
@item @emph{Prototype}: @tab @code{int omp_get_team_num(void);}
@end multitable
@item @emph{Fortran}:
@multitable @columnfractions .20 .80
@item @emph{Interface}: @tab @code{integer function omp_get_team_num()}
@end multitable
@item @emph{Reference}:
@uref{http://www.openmp.org/, OpenMP specification v4.0}, Section 3.2.27.
@end table
......@@ -487,7 +641,7 @@ to @code{omp_get_num_threads}.
@ref{omp_get_num_threads}, @ref{omp_get_level}, @ref{omp_get_ancestor_thread_num}
@item @emph{Reference}:
@uref{http://www.openmp.org/, OpenMP specifications v3.1}, section 3.2.18.
@uref{http://www.openmp.org/, OpenMP specification v4.0}, Section 3.2.19.
@end table
......@@ -512,7 +666,7 @@ Return the maximum number of threads of the program.
@ref{omp_get_max_threads}, @ref{OMP_THREAD_LIMIT}
@item @emph{Reference}:
@uref{http://www.openmp.org/, OpenMP specifications v3.1}, section 3.2.13.
@uref{http://www.openmp.org/, OpenMP specification v4.0}, Section 3.2.14.
@end table
......@@ -541,7 +695,7 @@ value of the master thread of a team is always 0.
@ref{omp_get_num_threads}, @ref{omp_get_ancestor_thread_num}
@item @emph{Reference}:
@uref{http://www.openmp.org/, OpenMP specifications v3.1}, section 3.2.4.
@uref{http://www.openmp.org/, OpenMP specification v4.0}, Section 3.2.4.
@end table
......@@ -565,7 +719,7 @@ their language-specific counterparts.
@end multitable
@item @emph{Reference}:
@uref{http://www.openmp.org/, OpenMP specifications v3.1}, section 3.2.6.
@uref{http://www.openmp.org/, OpenMP specification v4.0}, Section 3.2.6.
@end table
......@@ -588,10 +742,62 @@ and @code{false} represent their language-specific counterparts.
@end multitable
@item @emph{Reference}:
@uref{http://www.openmp.org/, OpenMP specifications v3.1}, section 3.2.20.
@uref{http://www.openmp.org/, OpenMP specification v4.0}, Section 3.2.21.
@end table
@node omp_is_initial_device
@section @code{omp_is_initial_device} -- Whether executing on the host device
@table @asis
@item @emph{Description}:
This function returns @code{true} if currently running on the host device,
@code{false} otherwise. Here, @code{true} and @code{false} represent
their language-specific counterparts.
@item @emph{C/C++}:
@multitable @columnfractions .20 .80
@item @emph{Prototype}: @tab @code{int omp_is_initial_device(void);}
@end multitable
@item @emph{Fortran}:
@multitable @columnfractions .20 .80
@item @emph{Interface}: @tab @code{logical function omp_is_initial_device()}
@end multitable
@item @emph{Reference}:
@uref{http://www.openmp.org/, OpenMP specification v4.0}, Section 3.2.28.
@end table
@node omp_set_default_device
@section @code{omp_set_default_device} -- Set the default device for target regions
@table @asis
@item @emph{Description}:
Set the default device for target regions without device clause. The argument
shall be a nonnegative device number.
@item @emph{C/C++}:
@multitable @columnfractions .20 .80
@item @emph{Prototype}: @tab @code{void omp_set_default_device(int device_num);}
@end multitable
@item @emph{Fortran}:
@multitable @columnfractions .20 .80
@item @emph{Interface}: @tab @code{subroutine omp_set_default_device(device_num)}
@item @tab @code{integer device_num}
@end multitable
@item @emph{See also}:
@ref{OMP_DEFAULT_DEVICE}, @ref{omp_get_default_device}
@item @emph{Reference}:
@uref{http://www.openmp.org/, OpenMP specification v4.0}, Section 3.2.23.
@end table
@node omp_set_dynamic
@section @code{omp_set_dynamic} -- Enable/disable dynamic teams
@table @asis
......@@ -616,7 +822,7 @@ adjustment of team sizes and @code{false} disables it.
@ref{OMP_DYNAMIC}, @ref{omp_get_dynamic}
@item @emph{Reference}:
@uref{http://www.openmp.org/, OpenMP specifications v3.1}, section 3.2.7.
@uref{http://www.openmp.org/, OpenMP specification v4.0}, Section 3.2.7.
@end table
......@@ -643,7 +849,7 @@ parallel regions.
@ref{omp_get_max_active_levels}, @ref{omp_get_active_level}
@item @emph{Reference}:
@uref{http://www.openmp.org/, OpenMP specifications v3.1}, section 3.2.14.
@uref{http://www.openmp.org/, OpenMP specification v4.0}, Section 3.2.15.
@end table
......@@ -672,7 +878,7 @@ dynamic adjustment of team sizes and @code{false} disables it.
@ref{OMP_NESTED}, @ref{omp_get_nested}
@item @emph{Reference}:
@uref{http://www.openmp.org/, OpenMP specifications v3.1}, section 3.2.9.
@uref{http://www.openmp.org/, OpenMP specification v4.0}, Section 3.2.10.
@end table
......@@ -700,7 +906,7 @@ argument of @code{omp_set_num_threads} shall be a positive integer.
@ref{OMP_NUM_THREADS}, @ref{omp_get_num_threads}, @ref{omp_get_max_threads}
@item @emph{Reference}:
@uref{http://www.openmp.org/, OpenMP specifications v3.1}, section 3.2.1.
@uref{http://www.openmp.org/, OpenMP specification v4.0}, Section 3.2.1.
@end table
......@@ -718,7 +924,7 @@ For @code{omp_sched_auto} the @var{modifier} argument is ignored.
@item @emph{C/C++}
@multitable @columnfractions .20 .80
@item @emph{Prototype}: @tab @code{void omp_set_schedule(omp_sched_t *kind, int *modifier);}
@item @emph{Prototype}: @tab @code{void omp_set_schedule(omp_sched_t kind, int modifier);}
@end multitable
@item @emph{Fortran}:
......@@ -733,7 +939,7 @@ For @code{omp_sched_auto} the @var{modifier} argument is ignored.
@ref{OMP_SCHEDULE}
@item @emph{Reference}:
@uref{http://www.openmp.org/, OpenMP specifications v3.1}, section 3.2.11.
@uref{http://www.openmp.org/, OpenMP specification v4.0}, Section 3.2.12.
@end table
......@@ -760,7 +966,7 @@ an unlocked state.
@ref{omp_destroy_lock}
@item @emph{Reference}:
@uref{http://www.openmp.org/, OpenMP specifications v3.1}, section 3.3.1.
@uref{http://www.openmp.org/, OpenMP specification v4.0}, Section 3.3.1.
@end table
......@@ -789,7 +995,7 @@ a deadlock occurs.
@ref{omp_init_lock}, @ref{omp_test_lock}, @ref{omp_unset_lock}
@item @emph{Reference}:
@uref{http://www.openmp.org/, OpenMP specifications v3.1}, section 3.3.3.
@uref{http://www.openmp.org/, OpenMP specification v4.0}, Section 3.3.3.
@end table
......@@ -819,7 +1025,7 @@ does not block if the lock is not available. This function returns
@ref{omp_init_lock}, @ref{omp_set_lock}, @ref{omp_set_lock}
@item @emph{Reference}:
@uref{http://www.openmp.org/, OpenMP specifications v3.1}, section 3.3.5.
@uref{http://www.openmp.org/, OpenMP specification v4.0}, Section 3.3.5.
@end table
......@@ -849,7 +1055,7 @@ again, set the lock to itself.
@ref{omp_set_lock}, @ref{omp_test_lock}
@item @emph{Reference}:
@uref{http://www.openmp.org/, OpenMP specifications v3.1}, section 3.3.4.
@uref{http://www.openmp.org/, OpenMP specification v4.0}, Section 3.3.4.
@end table
......@@ -876,7 +1082,7 @@ in the unlocked state.
@ref{omp_init_lock}
@item @emph{Reference}:
@uref{http://www.openmp.org/, OpenMP specifications v3.1}, section 3.3.2.
@uref{http://www.openmp.org/, OpenMP specification v4.0}, Section 3.3.2.
@end table
......@@ -903,7 +1109,7 @@ an unlocked state and the nesting count is set to zero.
@ref{omp_destroy_nest_lock}
@item @emph{Reference}:
@uref{http://www.openmp.org/, OpenMP specifications v3.1}, section 3.3.1.
@uref{http://www.openmp.org/, OpenMP specification v4.0}, Section 3.3.1.
@end table
......@@ -931,7 +1137,7 @@ nesting count for the lock is incremented.
@ref{omp_init_nest_lock}, @ref{omp_unset_nest_lock}
@item @emph{Reference}:
@uref{http://www.openmp.org/, OpenMP specifications v3.1}, section 3.3.3.
@uref{http://www.openmp.org/, OpenMP specification v4.0}, Section 3.3.3.
@end table
......@@ -962,7 +1168,7 @@ is returned. Otherwise, the return value equals zero.
@ref{omp_init_lock}, @ref{omp_set_lock}, @ref{omp_set_lock}
@item @emph{Reference}:
@uref{http://www.openmp.org/, OpenMP specifications v3.1}, section 3.3.5.
@uref{http://www.openmp.org/, OpenMP specification v4.0}, Section 3.3.5.
@end table
......@@ -992,7 +1198,7 @@ one of them is chosen to, again, set the lock to itself.
@ref{omp_set_nest_lock}
@item @emph{Reference}:
@uref{http://www.openmp.org/, OpenMP specifications v3.1}, section 3.3.4.
@uref{http://www.openmp.org/, OpenMP specification v4.0}, Section 3.3.4.
@end table
......@@ -1019,7 +1225,7 @@ in the unlocked state and its nesting count must equal zero.
@ref{omp_init_lock}
@item @emph{Reference}:
@uref{http://www.openmp.org/, OpenMP specifications v3.1}, section 3.3.2.
@uref{http://www.openmp.org/, OpenMP specification v4.0}, Section 3.3.2.
@end table
......@@ -1045,7 +1251,7 @@ successive clock ticks.
@ref{omp_get_wtime}
@item @emph{Reference}:
@uref{http://www.openmp.org/, OpenMP specifications v3.1}, section 3.4.2.
@uref{http://www.openmp.org/, OpenMP specification v4.0}, Section 3.4.2.
@end table
......@@ -1073,7 +1279,7 @@ guaranteed not to change during the execution of the program.
@ref{omp_get_wtick}
@item @emph{Reference}:
@uref{http://www.openmp.org/, OpenMP specifications v3.1}, section 3.4.1.
@uref{http://www.openmp.org/, OpenMP specification v4.0}, Section 3.4.1.
@end table
......@@ -1090,22 +1296,81 @@ section 4 of the OpenMP specification in version 4.0, while those
beginning with @env{GOMP_} are GNU extensions.
@menu
* OMP_CANCELLATION:: Set whether cancellation is activated
* OMP_DISPLAY_ENV:: Show OpenMP version and environment variables
* OMP_DEFAULT_DEVICE:: Set the device used in target regions
* OMP_DYNAMIC:: Dynamic adjustment of threads
* OMP_MAX_ACTIVE_LEVELS:: Set the maximum number of nested parallel regions
* OMP_NESTED:: Nested parallel regions
* OMP_NUM_THREADS:: Specifies the number of threads to use
* OMP_PROC_BIND:: Whether theads may be moved between CPUs
* OMP_PLACES:: Specifies on which CPUs the theads should be placed
* OMP_STACKSIZE:: Set default thread stack size
* OMP_SCHEDULE:: How threads are scheduled
* OMP_THREAD_LIMIT:: Set the maximum number of threads
* OMP_WAIT_POLICY:: How waiting threads are handled
* OMP_DISPLAY_ENV:: Show OpenMP version and environment variables
* OMP_PROC_BIND:: Whether theads may be moved between CPUs
* GOMP_CPU_AFFINITY:: Bind threads to specific CPUs
* GOMP_STACKSIZE:: Set default thread stack size
* GOMP_SPINCOUNT:: Set the busy-wait spin count
@end menu
@node OMP_CANCELLATION
@section @env{OMP_CANCELLATION} -- Set whether cancellation is activated
@cindex Environment Variable
@table @asis
@item @emph{Description}:
If set to @code{TRUE}, the cancellation is activated. If set to @code{FALSE} or
if unset, cancellation is disabled and the @code{cancel} construct is ignored.
@item @emph{See also}:
@ref{omp_get_cancellation}
@item @emph{Reference}:
@uref{http://www.openmp.org/, OpenMP specification v4.0}, Section 4.11
@end table
@node OMP_DISPLAY_ENV
@section @env{OMP_DISPLAY_ENV} -- Show OpenMP version and environment variables
@cindex Environment Variable
@table @asis
@item @emph{Description}:
If set to @code{TRUE}, the OpenMP version number and the values
associated with the OpenMP environment variables are printed to @code{stderr}.
If set to @code{VERBOSE}, it additionally shows the value of the environment
variables which are GNU extensions. If undefined or set to @code{FALSE},
this information will not be shown.
@item @emph{Reference}:
@uref{http://www.openmp.org/, OpenMP specification v4.0}, Section 4.12
@end table
@node OMP_DEFAULT_DEVICE
@section @env{OMP_DEFAULT_DEVICE} -- Set the device used in target regions
@cindex Environment Variable
@table @asis
@item @emph{Description}:
Set to choose the device which is used in a @code{target} region, unless the
value is overridden by @code{omp_set_default_device} or by a @code{device}
clause. The value shall be the nonnegative device number. If no device with
the given device number exists, the code is executed on the host. If unset,
device number 0 will be used.
@item @emph{See also}:
@ref{omp_get_default_device}, @ref{omp_set_default_device},
@item @emph{Reference}:
@uref{http://www.openmp.org/, OpenMP specification v4.0}, Section 4.11
@end table
@node OMP_DYNAMIC
@section @env{OMP_DYNAMIC} -- Dynamic adjustment of threads
@cindex Environment Variable
......@@ -1120,7 +1385,7 @@ disabled by default.
@ref{omp_set_dynamic}
@item @emph{Reference}:
@uref{http://www.openmp.org/, OpenMP specifications v4.0}, section 4.3
@uref{http://www.openmp.org/, OpenMP specification v4.0}, Section 4.3
@end table
......@@ -1138,7 +1403,7 @@ If undefined, the number of active levels is unlimited.
@ref{omp_set_max_active_levels}
@item @emph{Reference}:
@uref{http://www.openmp.org/, OpenMP specifications v4.0}, section 4.9
@uref{http://www.openmp.org/, OpenMP specification v4.0}, Section 4.9
@end table
......@@ -1158,7 +1423,7 @@ regions are disabled by default.
@ref{omp_set_nested}
@item @emph{Reference}:
@uref{http://www.openmp.org/, OpenMP specifications v4.0}, section 4.6
@uref{http://www.openmp.org/, OpenMP specification v4.0}, Section 4.6
@end table
......@@ -1178,7 +1443,76 @@ level. If undefined one thread per CPU is used.
@ref{omp_set_num_threads}
@item @emph{Reference}:
@uref{http://www.openmp.org/, OpenMP specifications v4.0}, section 4.2
@uref{http://www.openmp.org/, OpenMP specification v4.0}, Section 4.2
@end table
@node OMP_PLACES
@section @env{OMP_PLACES} -- Specifies on which CPUs the theads should be placed
@cindex Environment Variable
@table @asis
@item @emph{Description}:
The thread placement can be either specified using an abstract name or by an
explicit list of the places. The abstract names @code{threads}, @code{cores}
and @code{sockets} can be optionally followed by a positive number in
parentheses, which denotes the how many places shall be created. With
@code{threads} each place corresponds to a single hardware thread; @code{cores}
to a single core with the corresponding number of hardware threads; and with
@code{sockets} the place corresponds to a single socket. The resulting
placement can be shown by setting the @env{OMP_DISPLAY_ENV} environment
variable.
Alternatively, the placement can be specified explicitly as comma-separated
list of places. A place is specified by set of nonnegative numbers in curly
braces, denoting the denoting the hardware threads. The hardware threads
belonging to a place can either be specified as comma-separated list of
nonnegative thread numbers or using an interval. Multiple places can also be
either specified by a comma-separated list of places or by an interval. To
specify an interval, a colon followed by the count is placed after after
the hardware thread number or the place. Optionally, the length can be
followed by a colon and the stride number -- otherwise a unit stride is
assumed. For instance, the following specifies the same places list:
@code{"@{0,1,2@}, @{3,4,6@}, @{7,8,9@}, @{10,11,12@}"};
@code{"@{0:3@}, @{3:3@}, @{7:3@}, @{10:3@}"}; and @code{"@{0:2@}:4:3"}.
If @env{OMP_PLACES} and @env{GOMP_CPU_AFFINITY} are unset and
@env{OMP_PROC_BIND} is either unset or @code{false}, threads may be moved
between CPUs following no placement policy.
@item @emph{See also}:
@ref{OMP_PROC_BIND}, @ref{GOMP_CPU_AFFINITY}, @ref{omp_get_proc_bind},
@ref{OMP_DISPLAY_ENV}
@item @emph{Reference}:
@uref{http://www.openmp.org/, OpenMP specification v4.0}, Section 4.5
@end table
@node OMP_PROC_BIND
@section @env{OMP_PROC_BIND} -- Whether theads may be moved between CPUs
@cindex Environment Variable
@table @asis
@item @emph{Description}:
Specifies whether threads may be moved between processors. If set to
@code{TRUE}, OpenMP theads should not be moved; if set to @code{FALSE}
they may be moved. Alternatively, a comma separated list with the
values @code{MASTER}, @code{CLOSE} and @code{SPREAD} can be used to specify
the thread affinity policy for the corresponding nesting level. With
@code{MASTER} the worker threads are in the same place partition as the
master thread. With @code{CLOSE} those are kept close to the master thread
in contiguous place partitions. And with @code{SPREAD} a sparse distribution
across the place partitions is used.
When undefined, @env{OMP_PROC_BIND} defaults to @code{TRUE} when
@env{OMP_PLACES} or @env{GOMP_CPU_AFFINITY} is set and @code{FALSE} otherwise.
@item @emph{See also}:
@ref{OMP_PLACES}, @ref{GOMP_CPU_AFFINITY}, @ref{omp_get_proc_bind}
@item @emph{Reference}:
@uref{http://www.openmp.org/, OpenMP specification v4.0}, Section 4.4
@end table
......@@ -1199,7 +1533,7 @@ dynamic scheduling and a chunk size of 1 is used.
@ref{omp_set_schedule}
@item @emph{Reference}:
@uref{http://www.openmp.org/, OpenMP specifications v4.0}, sections 2.7.1 and 4.1
@uref{http://www.openmp.org/, OpenMP specification v4.0}, Sections 2.7.1 and 4.1
@end table
......@@ -1219,7 +1553,7 @@ stack size is left unchanged. If undefined, the stack size is system
dependent.
@item @emph{Reference}:
@uref{http://www.openmp.org/, OpenMP specifications v4.0}, section 4.7
@uref{http://www.openmp.org/, OpenMP specification v4.0}, Section 4.7
@end table
......@@ -1234,11 +1568,10 @@ value of this variable shall be a positive integer. If undefined,
the number of threads is not limited.
@item @emph{See also}:
@ref{OMP_NUM_THREADS}
@ref{omp_get_thread_limit}
@ref{OMP_NUM_THREADS}, @ref{omp_get_thread_limit}
@item @emph{Reference}:
@uref{http://www.openmp.org/, OpenMP specifications v4.0}, section 4.10
@uref{http://www.openmp.org/, OpenMP specification v4.0}, Section 4.10
@end table
......@@ -1258,43 +1591,7 @@ before waiting passively.
@ref{GOMP_SPINCOUNT}
@item @emph{Reference}:
@uref{http://www.openmp.org/, OpenMP specifications v4.0}, section 4.8
@end table
@node OMP_PROC_BIND
@section @env{OMP_PROC_BIND} -- Whether theads may be moved between CPUs
@cindex Environment Variable
@table @asis
@item @emph{Description}:
Specifies whether threads may be moved between processors. If set to
@code{TRUE}, OpenMP theads should not be moved, if set to @code{FALSE}
they may be moved. If undefined, threads may move between processors.
@item @emph{See also}:
@ref{GOMP_CPU_AFFINITY}
@item @emph{Reference}:
@uref{http://www.openmp.org/, OpenMP specifications v4.0}, section 4.4
@end table
@node OMP_DISPLAY_ENV
@section @env{OMP_DISPLAY_ENV} -- Show OpenMP version and environment variables
@cindex Environment Variable
@table @asis
@item @emph{Description}:
If set to @code{TRUE}, the OpenMP version number and the values
associated with the OpenMP environment variables are printed to @code{stderr}.
If set to @code{VERBOSE}, it additionally shows the value of the environment
variables which are GNU extensions. If undefined or set to @code{FALSE},
this information will not be shown.
@item @emph{Reference}:
@uref{http://www.openmp.org/, OpenMP specifications v4.0}, section 4.12
@uref{http://www.openmp.org/, OpenMP specification v4.0}, Section 4.8
@end table
......@@ -1321,11 +1618,13 @@ Fortran, may be used to query the setting of the @code{GOMP_CPU_AFFINITY}
environment variable. A defined CPU affinity on startup cannot be changed
or disabled during the runtime of the application.
If this environment variable is omitted, the host system will handle the
assignment of threads to CPUs.
If both @env{GOMP_CPU_AFFINITY} and @env{OMP_PROC_BIND} are set,
@env{OMP_PROC_BIND} has a higher precedence. If neither has been set and
@env{OMP_PROC_BIND} is unset, or when @env{OMP_PROC_BIND} is set to
@code{FALSE}, the host system will handle the assignment of threads to CPUs.
@item @emph{See also}:
@ref{OMP_PROC_BIND}
@ref{OMP_PLACES}, @ref{OMP_PROC_BIND}
@end table
......@@ -1778,7 +2077,7 @@ becomes
@chapter Reporting Bugs
Bugs in the GNU OpenMP implementation should be reported via
@uref{http://gcc.gnu.org/bugzilla/, bugzilla}. For all cases, please add
@uref{http://gcc.gnu.org/bugzilla/, Bugzilla}. For all cases, please add
"openmp" to the keywords field in the bug report.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment