Intel® Fortran Compiler 17.0 Developer Guide and Reference

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.5 specification, which is 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 Directives

Use this directive for deferring execution.

Directive

Description

TASK

Defines a task region.

TASKLOOP

Specifies that the iterations of one or more associated DO loops should be executed in parallel using OpenMP* tasks. The iterations are distributed across tasks that are created by the construct and scheduled to be executed.

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.

Offload Target Control Directives

Use these directives to control execution on one or more offload targets.

Directive

Description

DECLARE TARGET

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

DISTRIBUTE

Specifies that loop iterations will be distributed 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 that device. This directive only applies to Intel® MIC Architecture.

TARGET DATA

Maps variables to 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 when targeting Intel® Many Integrated Core Architecture (Intel® MIC Architecture) .

TARGET EXIT DATA

Specifies that variables are unmapped from a device data environment. This directive only applies when targeting Intel® Many Integrated Core Architecture (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 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. A combined construct is a shortcut for specifying one construct immediately nested inside another construct. A combined construct is semantically identical to that of explicitly specifying the first construct containing one instance of the second construct and no other statements.

A composite construct is composed of two constructs but does not have identical semantics to specifying one of the constructs immediately nested inside the other. A composite construct either adds semantics not included in the constructs from which it is composed or the nesting of the one construct inside the other is not conforming.

Directive

Description

DISTRIBUTE PARALLEL DO1

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

DISTRIBUTE PARALLEL DO SIMD1

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 SIMD1

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

DO SIMD1

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 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.

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 PARALLEL

Creates a device data environment in a parallel region and executes the construct on that device. This directive only applies when targeting Intel® Many Integrated Core Architecture (Intel® MIC Architecture).

TARGET PARALLEL DO

Provides an abbreviated way to specify a TARGET construct that contains aPARALLEL DO construct and no other statement between them.

TARGET PARALLEL DO SIMD

Specifies a TARGET construct that contains aPARALLEL DO SIMD construct and no other statement between them.

TARGET SIMD

Specifies a TARGET construct that contains aSIMD construct and no other statement between them.

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 when targeting Intel® Many Integrated Core Architecture (Intel® MIC Architecture).

TARGET TEAMS DISTRIBUTE

Creates a device data environment and then executes the construct on that device. It also specifies that loop iterations will be distributed among the master threads of all thread teams in a league created by a TEAMS construct. This directive only applies when targeting Intel® Many Integrated Core Architecture (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 when targeting Intel® Many Integrated Core Architecture (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 when targeting Intel® Many Integrated Core Architecture (Intel® MIC Architecture).

TARGET TEAMS DISTRIBUTE SIMD

Creates a device data environment and then executes the construct on that device. It also specifies that loop iterations will be distributed 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 when targeting Intel® Many Integrated Core Architecture (Intel® MIC Architecture).

TASKLOOP SIMD 1

Specifies a loop that can be executed concurrently using SIMD instructions and that those iterations will also be executed in parallel using OpenMP* tasks.

TEAMS DISTRIBUTE

Creates a league of thread teams to execute the structured block in the master thread of each team. It also specifies that loop iterations will be distributed 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.

Footnotes:

1 This directive specifies a composite construct.