Fork me on GitHub

OpenMP Directives: C/C++ Directive Format

Format:

#pragma omp directive-name [clause, ...] newline
Required for all OpenMP C/C++ directives. A valid OpenMP directive must appear after the pragma and before any clauses. Optional. Clauses can be in any order, and repeated as necessary unless otherwise restricted. Required. Precedes the structured block which is enclosed by this directive.

Example:

#pragma omp parallel default(shared) private(beta,pi)

General Rules:

#pragma omp <directive>

    [ structured block of code ]