Parallel Programming in OpenMP

Appendix A: A Quick Reference to OpenMP

Table A.1: OpenMP directives.

Fortran

C/C++

Syntax

      <b class="bold">sentinel directive-name [clause] ...                   Fixed form        Free formSentinel     !$omp  c$omp  *$omp    !$ompContinuation        !$omp+           Trailing &Conditional      !$  c$  *$            !$ compilation</b>
<b class="bold">#pragma omp directive-name [clause] ...Continuation     Trailing \Conditional</b>      #ifdef _OPENMP compilation        ...                 #endif

Parallel region construct

<b class="bold">!$omp parallel [clause] ...</b>    structured-block<b class="bold">!$omp end parallel</b>
<b class="bold">#pragma omp parallel [clause] ...</b>    structured-block

Work-sharing constructs

<b class="bold">!$omp do [clause] ...</b>    do-loop<b class="bold">!$omp enddo [nowait]</b>
<b class="bold">#pragma omp for [clause] ...</b>    for-loop
<b class="bold">!$omp sections [clause] ...</b>[<b class="bold">!$omp section</b>    structured-block] ...<b class="bold">!$omp end sections [nowait]</b>
<b class="bold">#pragma omp sections [clause] ...{[ #pragma omp section</b>    structured-block] ...}
<b class="bold">!$omp single [clause] ...</b>    structured-block<b class="bold">!$omp end single [nowait]</b>
<b class="bold">#pragma omp single [clause] ...</b>    structured-block

UNLIMITED FREE
ACCESS
TO THE WORLD'S BEST IDEAS

SUBMIT
Already a GlobalSpec user? Log in.

This is embarrasing...

An error occurred while processing the form. Please try again in a few minutes.

Customize Your GlobalSpec Experience

Category: Waveplates and Retardation Plates
Finish!
Privacy Policy

This is embarrasing...

An error occurred while processing the form. Please try again in a few minutes.