IBM SMP directives exploit shared memory parallelism through the parallelization of countable loops. A loop is considered to be countable if it has any of the forms described in Countable loops. The XL C compiler provides pragma directives that you can use to improve on automatic parallelization performed by the compiler. Pragmas fall into two general categories:
IBM SMP directive syntax >>-#pragma ibm--pragma_name_and_args--countable_loop-----------><
Pragma directives must appear immediately before the countable loop to which they apply. More than one parallel processing pragma directive can be applied to a countable loop. For example:
#pragma ibm independent_loop #pragma ibm independent_calls #pragma ibm schedule(static,5) countable_loop
Some pragma directives are mutually exclusive of each other, such as, for example, the parallel_loop sequential_loop directives. If mutually exclusive pragmas are specified for the same loop, the pragma last specified applies to the loop.
Other pragmas, if specified repeatedly for a given loop, have an additive effect. For example:
#pragma ibm permutation (a,b) #pragma ibm permutation (c)
is equivalent to:
#pragma ibm permutation (a,b,c)
For a pragma-by-pragma description of the IBM SMP directives, refer to "Pragma directives for parallel processing".