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 permitted in OpenMP directives (Section 2.1 on page 7).

  • Addition of the num_threads clause. This clause allows a user to request a specific number of threads for a parallel construct (Section 2.3 on page 8).

  • The threadprivate directive has been extended to accept static block-scope variables (Section 2.7.1 on page 23).

  • C99 Variable Length Arrays are complete types, and thus can be specified anywhere complete types are allowed, for instance in the lists of private, firstprivate, and lastprivate clauses (Section 2.7.2 on page 25).

  • A private variable in a parallel region can be marked private again in a nested directive (Section on page 25).

  • 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 is 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 the single directive (Section on page 32).

  • Addition of timing routines omp_get_wtick and omp_get_wtime similar to the MPI routines. These functions are necessary for performing wall clock timings (Section 3.3.1 on page 44 and Section 3.3.2 on page 45).

  • 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 (Appendix E on page 97).

  • 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 (Section 3.1.7 on page 39, and Section 3.1.9 on page 40).

    • Clarified directive nesting when nested parallel is used (Section 2.9 on page 33).

    • The lock initialization and lock destruction functions can be called in a parallel region (Section 3.2.1 on page 42 and Section 3.2.2 on page 42).

    • New examples have been added (Appendix A on page 51).