| OPENMP API Specification: "Version 5.2 -- GIT rev 95b2e3a44"

3  Directive and Construct Syntax

This chapter describes the syntax of OpenMP directives, clauses and any related base language code. OpenMP directives are specified with various base-language mechanisms that allow compilers to ignore OpenMP directives and conditionally compiled code if support of the OpenMP API is not provided or enabled. A compliant implementation must provide an option or interface that ensures that underlying support of all OpenMP directives and OpenMP conditional compilation mechanisms is enabled. In the remainder of this document, the phrase OpenMP compilation is used to mean a compilation with these OpenMP features enabled.


The following restrictions apply to OpenMP directives:

Restrictions on explicit OpenMP regions (that arise from executable directives) are as follows:

A throw executed inside a region that arises from a thread-limiting directive must cause execution to resume within the same region, and the same thread that threw the exception must catch it. If the directive is also exception-aborting then whether the exception is caught or the throw results in runtime error termination is implementation defined.
A directive may not appear in a pure procedure unless it is pure. A directive may not appear in a WHERE, FORALL or DO CONCURRENT construct. If more than one image is executing the program, any image control statement, ERROR STOP statement, FAIL IMAGE statement, collective subroutine call or access to a coindexed object that appears in an explicit OpenMP region will result in unspecified behavior.
 3.1  Directive Format
  3.1.1  Fixed Source Form Directives
  3.1.2  Free Source Form Directives
 3.2  Clause Format
  3.2.1  OpenMP Argument Lists
  3.2.2  Reserved Locators
  3.2.3  OpenMP Operations
  3.2.4  Array Shaping
  3.2.5  Array Sections
  3.2.6  iterator Modifier
 3.3  Conditional Compilation
  3.3.1  Fixed Source Form Conditional Compilation Sentinels
  3.3.2  Free Source Form Conditional Compilation Sentinel
 3.4  if Clause
 3.5  destroy Clause