11.3.3 DO_PARALLEL Directive (VAX only)

The DO_PARALLEL directive tells the compiler to run an indexed DO- loop in parallel. It takes the following form:

cPAR$ DO_PARALLEL [count]
c
Is the letter or character that introduces the directive tag (see Section 11.1).
count
Is a numeric expression specifying the number of iterations in each set distributed to processes running the DO-loop. Any remaining iterations run in the last process. For example, if the total number of iterations is 1330, count is 100, and two processes are running the DO-loop, then each process is distributed sets of 100 iterations at a time. The last set contains the last 30 iterations.

The numeric expression must evaluate to a positive, non-zero integer. If necessary, the process converts it to an integer by truncation. For example, 50.56 is acceptable and is converted to 50. However, 0.20 is not acceptable because it is converted to zero.

Rules and Behavior

The indexed DO statement must be the next executable statement following the DO_PARALLEL directive. Only comments can appear between the directive and its corresponding DO-loop.

The parallel DO-loop control variable must be a private integer. If it is not specified PRIVATE, the compiler gives an informational message and changes the control variable's default to PRIVATE. If the control variable is not an integer, the compiler gives an error.

A parallel DO-loop cannot contain the following:

A parallel DO-loop must not have a branch into or out of its body.

When calculations in parallel DO-loops require scalar (sequential) execution to achieve correct results, you must guard those calculations (called critical regions) against parallel execution. This situation occurs when calculations modify shared values that are needed in successive iterations of the parallel DO-loop or elsewhere in the routine.

For More Information:

For details on directives that guard critical regions, see Section 11.3.4.


Previous Page Next Page Table of Contents