Technical data

106
Chapter 5: Fortran Enhancements for Multiprocessors
Executing Spooled Routines
The set of processes that cooperate to execute the parallel Fortran job are
members of a process share group created by the system call sproc. The
process share group is created by special Fortran start-up routines that are
used only when the executable is linked with the mp option, which enables
multiprocessing.
The rst process is the master process. It executes all the nonparallel portions
of the code. The other processes are slave processes; they are controlled by
the routine mp_slave_control. When they are inactive, they wait in the
special routine __mp_slave_wait_for_work.
When the master process calls mp_simple_sched, the master passes the
name of the spooled routine, the starting value of the DO loop index, the
number of times the loop is to be executed, and the loop index increment.
The mp_simple_sched routine divides the work and signals the slaves. The
master process then calls the spooled routine to do its work. When a slave is
signaled, it wakes up from the wait loop, calculates which iterations of the
spooled DO loop it is to execute, and then calls the spooled routine with the
appropriate arguments. When a slave completes its execution of the spooled
routine, it reports that it has nished and returns to
__mp_slave_wait_for_work.
When the master completes its execution of the spooled routine, it returns to
mp_simple_sched, then waits until all the slaves have completed
processing. The master then returns to the main routine and continues
execution.
Refer to Chapter 6 for an example of debugger output for the stack trace
command where, which shows the calling sequence.