List of OpenMP* Standard Directives and Clauses

OpenMP* Directives

Directive

Description

parallel

Defines a parallel region.

do, enddo[nowait]

Identifies an iterative work-sharing construct that specifies a region in which the iterations of the associated loop should be executed in parallel. The argument nowait indicates that the loop that reached the end can proceed with further execution on its thread. If nowait is absent, all loops have to reach the end, and only then the execution continues on all threads.

sections

Identifies a non-iterative work-sharing constuct that specifies a set of constucts that are to be divided among threads in a team.

section

Indicates that the associated code block should be executed in parallel.

single,
end single

Identifies a construct that specifies that the associated structured block  is executed by only one thread in the team.

parallel do,
end parallel do

A shortcut for a parallel region that contains a single do directive.

Note
The parallel or do OpenMP directive must be immediately followed by a do statement (do-stmt as defined by R818 of the ANSI Fortran standard). If you place other statement or an OpenMP directive between the parallel or do directive and the do statement, the Intel® Fortran compiler issues a syntax error.

parallel sections

Provides a shortcut form for specifying a parallel region containing a single sections directive.

master,
end master

Identifies a constuct that specifies a structured block that is executed by the master thread of the team.

critical[lock],
end critical[lock]

Identifies a construct that restricts execution of the associated structured block to a single thread at a time.

barrier

Synchronizes all the threads in a team.

atomic

Ensures that a specific memory location is updated atomically.

flush

Specifies a "cross-thread" sequence point at which the implementation is required to ensure that all the threads in a team have a consistent view of certain objects in memory.

ordered,
end ordered

The structured block following an ordered directive is executed in the order in which iterations would be executed in a sequential loop.

threadprivate

Makes the named file-scope or namespace-scope variables specified private to a thread but file-scope visible within the thread.

 OpenMP Clauses

Clause

Description

private

Declares variables to be private to each thread in a team.

firstprivate

Provides a superset of the functionality provided by the private clause.

lastprivate

Provides a superset of the functionality provided by the private clause.

shared

Shares variables among all the threads in a team.

default

Enables you to affect the data-scope attributes of variables.

reduction

Performs a reduction on scalar variables.

ordered, end ordered

The structured block following an ordered directive is executed in the order in which iterations would be executed in a sequential loop.

if

If IF(scalar_logical_expression) clause is present, the enclosed code block is executed in parallel only if the scalar_logical_expression evaluates to .TRUE.. Otherwise the code block is serialized.

schedule

Specifies how iterations of the do loop are divided among the threads of the team.

copyin

Provides a mechanism to assign the same name to threadprivate variables for each thread in the team executing the parallel region.