Intel® Fortran Compiler 16.0 User and Reference Guide

Clauses Used in Multiple OpenMP* Fortran Directives

This topic summarizes clauses that are used in more than one OpenMP* Fortran directive.

Other clauses (or keywords) are available for some OpenMP* Fortran directives. For more information, see each directive description.

Some of the OpenMP* Fortran directives have clauses (or options) you can specify to control the scope attributes of variables for the duration of the directive.

Data Scope Attribute Clauses

Name

Description

DEFAULT

Lets you specify a scope for all variables in the lexical extent of a parallel region.

FIRSTPRIVATE

Provides a superset of the functionality provided by the PRIVATE clause. It declares one or more variables to be private to each thread in a team, and initializes each of them with the value of the corresponding original variable.

LASTPRIVATE

Provides a superset of the functionality provided by the PRIVATE clause. It declares one or more variables to be private to an implicit task, and causes the corresponding original variable to be updated after the end of the region.

LINEAR

Specifies that all variables in a list are private to a SIMD task and that they have a linear relationship within the iteration space of a loop.

PRIVATE

Declares one or more variables to be private to each thread in a team.

REDUCTION

Performs a reduction operation on the specified variables.

SHARED

Specifies variables that will be shared by all the threads in a team.

The data copying clauses let you copy data values from private or threadprivate variables in one implicit task or thread to the corresponding variables in other implicit tasks or threads in the team.

Data Copying Clauses

Name

Description

COPYIN

Specifies that the data in the master thread of the team is to be copied to the thread private copies of the common block at the beginning of the parallel region.

COPYPRIVATE

Uses a private variable to broadcast a value, or a pointer to a shared object, from one member of a team to the other members. The COPYPRIVATE clause can only appear in the END SINGLE directive.

The data motion clause MAP is used in OpenMP* Fortran TARGET directives. This data motion clause does not modify the values of any of the internal control variables (ICVs).

List items that appear in this data motion clause may have corresponding new list items created in the device data environment that is associated with the construct. If a new list item is created, a new list item of the same type, kind, and rank is allocated. The initial value of the new list item is undefined.

The original list items and new list items may share storage. This means that data races can occur. Data races are caused by unintended sharing of data; for example, when WRITEs to either item by one task or device are followed by a READ of the other item by another task or device without intervening synchronization.

Data Motion Clause

Name

Description

MAP

Maps a variable from the data environment of the current task to the data environment of the device associated with the construct.

The following are other clauses that can be used in more than one OpenMP* Fortran directive.

Miscellaneous Clauses

Name

Description

ALIGNED

Specifies that all variables in a list are aligned.

COLLAPSE

Specifies how many loops are associated with the loop construct.

DEPEND

Enforces additional constraints on the scheduling of a task by enabling dependences between sibling tasks in the task region.

DEVICE

Specifies the target device for certain TARGET directives.

IF

Specifies a conditional expression. If the expression evaluates to .FALSE., the construct is not executed.

NOWAIT

Specifies that threads may resume execution before the execution of the region completes.