Summary of IBM SMP and OpenMP pragma directives

The pragma directives summarized on this page give you control over how the compiler handles parallel processing in your program. These pragmas fall into two groups: IBM-specific directives, and directives conforming to the OpenMP Application Program Interface specification.

Use the -qsmp compiler option to specify how you want parallel processing handled in your program. You can also instruct the compiler to ignore all parallel processing-related pragma directives by specifying the -qignprag=ibm:omp compiler option.

Directives apply only to the statement or statement block immediately following the directive.

IBM Pragma Directives
C only
Description
#pragma ibm critical Instructs the compiler that the statement or statement block immediately following this pragma is a critical section.
#pragma ibm independent_calls Asserts that specified function calls within the chosen loop have no loop-carried dependencies.
#pragma ibm independent_loop Asserts that iterations of the chosen loop are independent, and that the loop can therefore be parallelized.
#pragma ibm iterations Specifies the approximate number of loop iterations for the chosen loop.
#pragma ibm parallel_loop Explicitly instructs the compiler to parallelize the chosen loop.
#pragma ibm permutation Asserts that on the loop following this pragma, different elements of the named arrays are guaranteed to have different values (that is, a[i] == a[j] iff i == j).
#pragma ibm schedule Specifies scheduling algorithms for parallel loop execution.
#pragma ibm sequential_loop Explicitly instructs the compiler to execute the chosen loop sequentially.
OpenMP Pragma Directives
Description
#pragma omp atomic Identifies a specific memory location that must be updated atomically and not be exposed to multiple, simultaneous writing threads.
#pragma omp parallel Defines a parallel region to be run by multiple threads in parallel. With specific exceptions, all other OpenMP directives work within parallelized regions defined by this directive.
#pragma omp for Work-sharing construct identifying an iterative for-loop whose iterations should be run in parallel.
#pragma omp parallel for Shortcut combination of omp parallel and omp for pragma directives, used to define a parallel region containing a single for directive.
#pragma omp ordered Work-sharing construct identifying a structured block of code that must be executed in sequential order.
#pragma omp section, #pragma omp sections Work-sharing construct identifying a non-iterative section of code containing one or more subsections of code that should be run in parallel.
#pragma omp parallel sections Shortcut combination of omp parallel and omp sections pragma directives, used to define a parallel region containing a single sections directive.
#pragma omp single Work-sharing construct identifying a section of code that must be run by a single available thread.
#pragma omp master Synchronization construct identifying a section of code that must be run only by the master thread.
#pragma omp critical Synchronization construct identifying a statement block that must be executed by a single thread at a time.
#pragma omp barrier Synchronizes all the threads in a parallel region.
#pragma omp flush Synchronization construct identifying a point at which the compiler ensures that all threads in a parallel region have the same view of specified objects in memory.
#pragma omp threadprivate Defines the scope of selected file-scope data variables as being private to a thread, but file-scope visible within that thread.