Technical data

Advanced Features
97
The way that iterations are assigned to processes is known as scheduling.
Interleaving is one possible schedule. Both interleaving and the simple
scheduling methods are examples of xed schedules; the iterations are
assigned to processes by a single decision made when the loop is entered.
For more complex loops, it may be desirable to use DYNAMIC or GSS
schedules.
Comparing the output from pixie or from pc-sample proling allows you to
see how well the load is being balanced so you can compare the different
methods of dividing the load. Refer to the discussion of the
MP_SCHEDTYPE clause in C$DOACROSS on page 71 for more
information.
Even when the load is perfectly balanced, iterations may still take varying
amounts of time to nish because of random factors. One process may have
to read the disk, another may be interrupted to let a different program run,
and so on. Because of these unpredictable events, the time spent waiting for
all processes to complete can be several hundred cycles, even with near
perfect balance.
Advanced Features
A number of features are provided so that sophisticated users can override
the multiprocessing defaults and customize the parallelism to their
particular applications. This section provides a brief explanation of these
features.
mp_block and mp_unblock
mp_block(3f) puts the slave threads into a blocked state using the system
call blockproc(2). The slave threads stay blocked until a call is made to
mp_unblock(3f). These routines are useful if the job has bursts of parallelism
separated by long stretches of single processing, as with an interactive
program. You can block the slave processes so they consume CPU cycles
only as needed, thus freeing the machine for other users. The Fortran system
automatically unblocks the slaves on entering a parallel region should you
neglect to do so.