Parallel Programming Guide for HP-UX Systems
Parallel synchronization
Synchronization tools
Chapter 8 137
where
namelist
is a comma-separated list of one or more gate or barrier
names, as appropriate.
In C and C++
In C and C++, gates and barriers should appear only in definition and
declaration statements, and as formal, and actual arguments. They
declare default-size variables.
In Fortran
The Fortran gate and barrier variable declarations can only appear:
•InCOMMON statements (statement must precede GATE
directive/BARRIER directive)
•InDIMENSION statements (statement must precede GATE
directive/BARRIER directive)
• In preceding type statements
• As dummy arguments
• As actual arguments
Gate and barrier types override other same-named types declared prior
to the gate/barrier pragmas. Once a variable is defined as a gate or
barrier, it cannot be redeclared as another type. Gates and barriers
cannot be equivalenced.
If you place gates or barriers in COMMON, the COMMON block declaration
must precede the GATE directive/BARRIER directive. The COMMON block
should contain only gates or only barriers. Arrays of gates or barriers
must be dimensioned using DIMENSION statements. The DIMENSION
statement must precede the GATE directive/BARRIER directive.
Synchronization functions
The Fortran, C, and C++ allocation, deallocation, lock and unlock
functions for use with gates and barriers are described in this section.
The 4- and 8-byte versions are provided. The 8-byte Fortran functions
are primarily for use with compiler options that change the default data
size to 8 bytes (for example, -I8 ). You must be consistent in your choice
of versions—memory allocated using an 8-byte function must be
deallocated using an 8-byte function.