Developer Guide and Reference

Contents

OpenMP*
Pragmas
Summary

This is a summary of the OpenMP*
pragmas
supported in the Intel®
C++
Compiler. For detailed information about the OpenMP* API, see the
OpenMP Application Program Interface
Version TR4: Version 5.0 specification, which is available from the OpenMP* web site.

PARALLEL
Pragma

Use this
pragma
to form a team of threads and execute those threads in parallel.
Pragma
Description
omp parallel
Specifies that a structured block should be run in parallel by a team of threads.

TASKING
Pragma

Use this
pragma
for deferring execution.
Pragma
Description
omp task
Specifies the beginning of a code block whose execution may be deferred.
omp taskloop
Specifies that the iterations of one or more associated
for
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
Pragmas

Use these
pragmas
to share work among a team of threads.
Pragma
Description
omp for
Specifies a parallel loop. Each iteration of the loop is executed by one of the threads in the team.
omp sections
Defines a region of structured blocks that will be distributed among the threads in a team.
omp single
Specifies that a block of code is to be executed by only one thread in the team at a time.

SYNCHRONIZATION
Pragmas

Use these
pragmas
to synchronize between threads.
Pragma
Description
omp atomic
Specifies a computation that must be executed atomically.
omp barrier
Specifies a point in the code where each thread must wait until all threads in the team arrive.
omp critical
Specifies a code block that is restricted to access by only one thread at a time.
omp flush
Identifies a point at which the view of the memory by the thread becomes consistent with the memory.
omp master
Specifies the beginning of a code block that must be executed only once by the master thread of the team.
omp ordered
Specifies a block of code that the threads in a team must execute in the natural order of the loop iterations.
omp taskgroup
Causes the program to wait until the completion of all enclosed and descendant tasks.
omp taskwait
Specifies a wait on the completion of child tasks generated since the beginning of the current task.
omp taskyield
Specifies that the current task can be suspended at this point in favor of execution of a different task.

Data Environment
Pragma

Use this
pragma
to give threads global private data.
Pragma
Description
omp threadprivate
Specifies a list of globally-visible variables that will be allocated private to each thread.

Offload Target Control
Pragmas

Use these
pragmas
to control execution on one or more offload targets. Offload is not supported on Windows* systems.
Pragma
Description
omp distribute
Specifies that the iterations of one or more loops should be distributed among the master threads of all thread teams in a league.
omp target enter data
Specifies that variables are mapped to a device data environment.