Technical data
102
Chapter 5: Fortran Enhancements for Multiprocessors
mp_setlock, mp_unsetlock, mp_barrier
These zero-argument functions provide convenient (although limited)
access to the locking and barrier functions provided by ussetlock(3p),
usunsetlock(3p), and barrier(3p). The convenience is that no user
initialization need be done because calls such as usconfig(3p) and usinit(3p)
are done automatically. The limitation is that there is only one lock and one
barrier. For a great many programs, this is sufficient. Users needing more
complex or flexible locking facilities should use the ussetlock family of
routines directly.
Local COMMON Blocks
A special ld(1) option allows named COMMON blocks to be local to a
process. This means that each process in the parallel job gets its own private
copy of the common block. This can be helpful in converting certain types of
Fortran programs into a parallel form.
The common block must be a named COMMON (blank COMMON may
not be made local), and it must not be initialized by DATA statements.
To create a local COMMON block, give the special loader directive
–Xlocaldata followed by a list of COMMON block names. Note that the
external name of a COMMON block known to the loader has a trailing
underscore and is not surrounded by slashes. For example, the command
% f77 –mp a.o –Xlocaldata foo_
would make the COMMON block /foo/ be a local COMMON block in the
resulting a.out file.
It is occasionally desirable to be able to copy values from the master thread’s
version of the COMMON block into the slave thread’s version. The special
directive C$COPYIN allows this. It has the form
C$COPYIN item [, item …]










