Intel® Fortran Compiler 16.0 User and Reference Guide

OpenMP* Directives Summary

This is a summary of the OpenMP* directives and clauses supported in the Intel® Fortran Compiler. For detailed information about the OpenMP*API, see the OpenMP Application Program Interface Versions 4.0 and 4.5 specifications, which are available from the OpenMP* web site.

In the directive lists below, an OpenMP directive is qualified with the word Directive when the name of the directive is also used for one or more elements besides the directive. For example: FLUSH refers to a directive, a statement, and a subroutine.

PARALLEL Directive

Use this directive to form a team of threads and execute those threads in parallel.

Directive

Description

PARALLEL Directive (OpenMP*)

Defines a parallel region.

TASKING Directive

Use this directive for deferring execution.

Directive

Description

TASK

Defines a task region.

WORKSHARING Directives

Use these directives to share work among a team of threads.

Directive

Description

DO Directive

Identifies an iterative worksharing construct in which the iterations of the associated loop should be divided among threads in a team.

SECTIONS

Specifies that the enclosed SECTION directives define blocks of code to be divided among threads in a team. Each section is executed once by a thread in the team.

SINGLE

Specifies that a block of code is to be executed by only one thread in the team at a time.

WORKSHARE

Divides the work of executing a block of statements or constructs into separate units. It also distributes the work of executing the units to threads of the team so each unit is only executed once.

SYNCHRONIZATION Directives

Use these directives to synchronize between threads.

Directive

Description

ATOMIC

Ensures that a specific memory location is updated atomically; this prevents the possibility of multiple, simultaneous reading and writing of threads.

BARRIER

Synchronizes all the threads in a team. It causes each thread to wait until all of the other threads in the team have reached the barrier.

CRITICAL Directive

Restricts access to a block of code to only one thread at a time.

FLUSH Directive

Identifies synchronization points at which the threads in a team must provide a consistent view of memory.

MASTER

Specifies a block of code to be executed by the master thread of the team.

ORDERED

Specifies a block of code that the threads in a team must execute in the natural order of the loop iterations.

TASKGROUP

Specifies a wait for the completion of all child tasks of the current task and all of their descendant tasks.

TASKWAIT

Specifies a wait on the completion of child tasks generated since the beginning of the current task.

TASKYIELD

Specifies that the current task can be suspended at this point in favor of execution of a different task.

Data Environment Directive

Use this directive to give threads global private data.

Directive

Description

THREADPRIVATE

Specifies named common blocks to be private (local) to each thread; they are global within the thread.

Coprocessor Control Directives

Use these directives to control execution on one or more coprocessors.

Directive

Description

DECLARE TARGET

Specifies named routines and variables that are created or mapped to a device. This directive only applies to Intel® Many Integrated Core Architecture (Intel® MIC Architecture) and Intel® Graphics Technology.

DISTRIBUTE

Specifies that loop iterations will be shared among the master threads of all thread teams in a league created by a teams construct. This directive only applies to Intel® MIC Architecture.

TARGET Directive

Creates a device data environment and executes the construct on the same device. This directive only applies to Intel® MIC Architecture.

TARGET DATA

Creates a device data environment for the extent of the region. This directive only applies to Intel® MIC Architecture.

TARGET ENTER DATA

Specifies that variables are mapped to a device data environment. This directive only applies to Intel® MIC Architecture.

TARGET EXIT DATA

Specifies that variables are unmapped from a device data environment. This directive only applies to Intel® MIC Architecture.

TARGET UPDATE

Makes the list items in the device data environment consistent with their corresponding original list items.
This directive only applies to Intel® MIC Architecture.

TEAMS

Creates a league of thread teams inside a target region to execute a structured block in the master thread of each team. This directive only applies to Intel® MIC Architecture.

Vectorization Directives

Use these directives to control execution on vector hardware.

Directive

Description

SIMD Directive (OpenMP*)

Requires and controls SIMD vectorization of loops.

DECLARE SIMD

Generates a SIMD procedure.

Cancellation Constructs

Directive

Description

CANCEL

Requests cancellation of the innermost enclosing region of the construct specified, and causes the encountering implicit or explicit task to proceed to the end of the cancelled construct.

CANCELLATION POINT

Defines a point at which implicit or explicit tasks check to see if cancellation has been requested for the innermost enclosing region of the type specified.

Combined Directives

Use these directives as shortcuts for multiple directives in sequence.

Directive

Description

DISTRIBUTE PARALLEL DO

Specifies a loop that can be executed in parallel by multiple threads that are members of multiple teams.

DISTRIBUTE PARALLEL DO SIMD

Specifies a loop that will be executed in parallel by multiple threads that are members of multiple teams. It will be executed concurrently using SIMD instructions.

DISTRIBUTE SIMD

Specifies a loop that will be distributed across the master threads of the teams region. It will be executed concurrently using SIMD instructions.

DO SIMD

Specifies a loop that can be executed concurrently using SIMD instructions.

PARALLEL DO

Provides an abbreviated way to specify a parallel region containing a single DO directive.

PARALLEL DO SIMD

Specifies a parallel region that contains a loop to execute with Single Instruction Multiple Data (SIMD) instructions.

Specifies a loop that can be executed concurrently using SIMD instructions. It provides a shortcut for specifying a PARALLEL construct containing one SIMD loop construct and no other statement.

PARALLEL SECTIONS

Provides an abbreviated way to specify a parallel region containing a single SECTIONS directive. The semantics are identical to explicitly specifying a PARALLEL directive immediately followed by a SECTIONS directive.

PARALLEL WORKSHARE

Provides an abbreviated way to specify a parallel region containing a single WORKSHARE directive.

TARGET TEAMS

Creates a device data environment and executes the construct on the same device. It also creates a league of thread teams with the master thread in each team executing the structured block. This directive only applies to Intel® MIC Architecture.

TARGET TEAMS DISTRIBUTE

Creates a device data environment and executes the construct on the same device. It also specifies that loop iterations will be shared among the master threads of all thread teams in a league created by a TEAMS construct. This directive only applies to Intel® MIC Architecture.

TARGET TEAMS DISTRIBUTE PARALLEL DO

Creates a device data environment and then executes the construct on that device. It also specifies a loop that can be executed in parallel by multiple threads that are members of multiple teams created by a TEAMS construct. This directive only applies to Intel® MIC Architecture.

TARGET TEAMS DISTRIBUTE PARALLEL DO SIMD

Creates a device data environment and then executes the construct on that device. It also specifies a loop that can be executed in parallel by multiple threads that are members of multiple teams created by a TEAMS construct. The loop will be distributed across the teams, which will be executed concurrently using SIMD instructions. This directive only applies to Intel® MIC Architecture.

TARGET TEAMS DISTRIBUTE SIMD

Creates a device data environment and executes the construct on the same device. It also specifies that loop iterations will be shared among the master threads of all thread teams in a league created by a teams construct. It will be executed concurrently using SIMD instructions. This directive only applies to Intel® MIC Architecture.

TEAMS DISTRIBUTE

Creates a league of thread teams to execute a structured block in the master thread of each team. It also specifies that loop iterations will be shared among the master threads of all thread teams in a league created by a TEAMS construct.

TEAMS DISTRIBUTE PARALLEL DO

Creates a league of thread teams to execute a structured block in the master thread of each team. It also specifies a loop that can be executed in parallel by multiple threads that are members of multiple teams.

TEAMS DISTRIBUTE PARALLEL DO SIMD

Creates a league of thread teams to execute a structured block in the master thread of each team. It also specifies a loop that can be executed in parallel by multiple threads that are members of multiple teams. The loop will be distributed across the master threads of the teams region, which will be executed concurrently using SIMD instructions.

TEAMS DISTRIBUTE SIMD

Creates a league of thread teams to execute the structured block in the master thread of each team. It also specifies a loop that will be distributed across the master threads of the teams.

See Also