F. New features and clarifications in version 2.0
This appendix summarizes the key changes made to the OpenMP C/C++ specification in moving from version 1.0 to version 2.0. The following items are new features added to the specification:
Commas are allowed in OpenMP directives.
Addition of the
num_threads
clause. This clause allows a user to request a specific number of threads for a parallel construct.The threadprivate directive has been extended to accept static block-scope variables.
C99 Variable Length Arrays are complete types and can be specified anywhere complete types are allowed, such as in the lists of
private
,firstprivate
, andlastprivate
clauses (see section 2.7.2).A private variable in a parallel region can be marked private again in a nested directive.
The
copyprivate
clause has been added. It provides a mechanism to use a private variable to broadcast a value from one member of a team to the other members. It's an alternative to using a shared variable for the value when providing such a shared variable would be difficult (for example, in a recursion requiring a different variable at each level). The copyprivate clause can only appear on thesingle
directive.Addition of timing routines omp_get_wtick and omp_get_wtime similar to the MPI routines. These functions are necessary to do wall clock timings.
An appendix with a list of implementation-defined behaviors in OpenMP C/C++ has been added. An implementation is required to define and document its behavior in these cases.
The following changes serve to clarify or correct features in the previous OpenMP API specification for C/C++:
Clarified that the behavior of omp_set_nested and omp_set_dynamic when
omp_in_parallel
returns nonzero is undefined.Clarified directive nesting when nested parallel is used.
The lock initialization and lock destruction functions can be called in a parallel region.
New examples have been added to appendix A.