Technical data
74
Chapter 5: Fortran Enhancements for Multiprocessors
Four methods of scheduling the iterations are supported. A single program
may use any or all of them as it finds appropriate.
The simple method (MP_SCHEDTYPE=SIMPLE) divides the iterations
among the processes by dividing them into contiguous pieces and assigning
one piece to each process.
The interleave scheduling method (MP_SCHEDTYPE=INTERLEAVE)
breaks the iterations up into pieces of the size specified by the CHUNK
option, and execution of those pieces is interleaved among the processes. For
example, if there are four processes and CHUNK=2, then the first process
will execute iterations 1–2, 9–10, 17–18, …; the second process will execute
iterations 3–4, 11–12, 19–20,…; and so on. Although this is more complex
than the simple method, it is still a fixed schedule with only a single
scheduling decision.
In dynamic scheduling (MP_SCHEDTYPE=DYNAMIC) the iterations are
broken into CHUNK-sized pieces. As each process finishes a piece, it enters
a critical section to grab the next available piece. This gives good load
balancing at the price of higher overhead.
The fourth method is a variation of the guided self-scheduling algorithm
(MP_SCHEDTYPE=GSS). Here, the piece size is varied depending on the
number of iterations remaining. By parceling out relatively large pieces to
start with and relatively small pieces toward the end, the hope is to achieve
good load balancing while reducing the number of entries into the critical
section.
In addition to these four methods, the user may specify the scheduling
method at run time (MP_SCHEDTYPE=RUNTIME). Here, the scheduling
routine examines values in the user’s run-time environment and uses that
information to select one of the four methods. See “Advanced Features” on
page 97 for more details.
If both the MP_SCHEDTYPE and CHUNK clauses are omitted, SIMPLE
scheduling is assumed. If MP_SCHEDTYPE is set to INTERLEAVE or
DYNAMIC and the CHUNK clause are omitted, CHUNK=1 is assumed. If
MP_SCHEDTYPE is set to one of the other values, CHUNK is ignored. If the
MP_SCHEDTYPE clause is omitted, but CHUNK is set, then
MP_SCHEDTYPE=DYNAMIC is assumed.










