SUBROUTINE PBEGINF( )

This connects all the processes together and initializes the environment. Should be the first executable statement in the parallel program.


SUBROUTINE PEND( )

Terminates parallel execution. Must be called before exit by all processes.

This tidies up any shared resources and notifies the load balancing server that it has completed. PEND does return but only to allow you to exit normally. It is important that the FORTRAN runtime environment be allowed to tidy up after itself. Calling PBEGINF or PEND more than once per process is bound to produce some bizarre sort of screw up.


INTEGER FUNCTION NNODES( )

Returns number of processes.


INTEGER FUNCTION NODEID( )

Returns logical node no. of the current process (0,1,...,NNODES()-1).


SUBROUTINE LLOG( )

Opens separate logfiles in the current directory for each process. The files are named log.<NODEID()>.


SUBROUTINE STATS( )

Print out summary of communication statistics for calling process.


INTEGER FUNCTION MTIME( )

Return wall time from an arbitrary origin in centi-seconds.


DOUBLE PRECISION FUNCITON TCGTIME( )

Return wall time from an arbitrary origin in seconds as accurately as possible.


SUBROUTINE SND(TYPE, BUF, LENBUF, NODE, SYNC)

Send a message of type TYPE to node NODE. LENBUF is the length of the message in bytes. BUF may be any type other than a FORTRAN CHARACTER variable or constant. SYNC indicates synchronous (1) or asynchronous (0) communication. If asynchronous communication is requested the buffer may not be modified until WAITCOM is called. This avoids having to waste valuable local memory taking a copy of the message. If a bit is set in the TYPE matching MSGDBL, MSGINT or MSGCHR then XDR is used if communication is over sockets.

Requests for asynchronous communication on UNIX machines where it is not supported are quietly ignored.


SUBROUTINE RCV(TYPE, BUF, LENBUF, LENMES, NODESEL, NODEFROM, SYNC)

Receive a message of type TYPE from node NODESEL. LENBUF is the length of the receiving buffer in bytes. LENMES returns the length of the message received. An error results if the buffer is not large enough. NODEFROM returns the node from which the message was received. If the NODESEL is specified as -1 then the next node to send to this process is chosen. The selection of the 'next' process is guaranteed to be fair. The length of the buffer is checked and the type of the message must agree with that being received (there is only one channel between processes so messages are received in the order sent). BUF may be of any type other than CHARACTER. SYNC indicates synchronous (1) or asynchronous (0) communication. If a bit is set in the TYPE matching MSGDBL, MSGINT or MSGCHR then XDR is used if communication is over sockets.

Requests for asynchronous communication on UNIX machines where it is not supported are quietly ignored.


INTEGER FUNCTION PROBE(TYPE, NODE)

Return 1/0 for TRUE/FALSE if a message of the given type is available from the given node. If node is specified as -1 then a message of the given type from any node will match (note that a wildcard probe is much more expensive than probing a specific node).


SUBROUTINE BRDCST(TYPE, BUF, LENBUF, IFROM)

Broadcast from process IFROM to all other processes a message of type TYPE and length LENBUF. All processes call this routine which uses an optimized algorithm to distribute the data in O(log p) time. If a bit is set in the TYPE matching MSGDBL, MSGINT or MSGCHR then XDR is used if communication is over sockets. Note that LENBUF presently must have the correct value on the originating and receiving nodes. This call may be modified to include an extra parameter with the function of LENMES in the RCV() syntax.


SUBROUTINE SYNCH(TYPE)

Synchronize all processes by exchanging messages of the given type in time O(log p). Internally might use messages with TYPE tag.


SUBROUTINE SETDBG(ONOFF)

Switch debugging output on (ONOFF=1) or off (ONOFF=0). This output is useful to trace messages being passed and also to help debug the message passing software.


INTEGER FUNCTION NXTVAL(MPROC)

This call simulates a simple shared counter by communicating with a dedicated server process. It returns the next counter associated with a single active loop (0,1,2,...). MPROC is the number of processes actively requesting values. After the end of the loop each process calls NXTVAL(-MPROC) which implements a barrier. It is used as follows:

Call with negative mproc to indicate end of loop ... processes c block here until mproc processes have registered completion.

On most UNIX machines (A.D. 1993) the cost is approx. 0.05s per call. On the DELTA and IPSC the cost is less than 0.0003s assuming no contention. Clearly the value from NXTVAL can be used to indicate that some locally determined no. of iterations should be done as the overhead of NXTVAL may be relatively large.


SUBROUTINE PARERR(CODE)

Call to request error termination .. it tries to zap all the other processes and generally tidy up. The value of code is printed out in the error message.

C programs should call ERROR_(char *message, long status).


SUBROUTINE WAITCOM(NODE)

Wait for all asynchronous communication with node NODE to be completed. NODE=-1 implies all nodes. Currently this is only applicable to the Intel MPPs where the actual value of NODE is ignored and -1 assumed.


SUBROUTINE DGOP(TYPE, X, N, OP)

Double Global OPeration. X(1:N) is a vector present on each process. DGOP 'sums' elements of X accross all nodes using the commutative operator OP. The result is broadcast to all nodes. Supported operations include '+', '*', 'max', 'min', 'absmax', 'absmin'. The use of lowerecase is presently necessary. XDR data translation is internally enabled.


SUBROUTINE IGOP(TYPE, X, N, OP)

Integer Global OPeration. The integer version of DGOP described above, also include the bitwise OR operation.


INTEGER FUNCTION MITOB(N)

Returns the no. of bytes that N Fortran integers occupy.


INTEGER FUNCTION MDTOB(N)

Returns the no. of bytes that N DOUBLE PRECISIONs occupy.


INTEGER FUNCTION MITOD(N)

Returns the minimum no. of DOUBLRE PRECSIONs numbers which representation in machine memory occupies as much storage as N INTEGERs.


INTEGER FUNCTION MDTOI(N)

Returns the minimum no. of INTEGER numbers which representation in machine memory occupies as much storage as N DOUBLE PRECISION numbers.


SUBROUTINE PFCOPY(TYPE, NODE0, FILENAME)

NODE0 has access to the unopened file with name in FILENAME the contents of which are to be copied to files known to all other processes using messages of type TYPE. All processes call PFCOPY() simultaneously, as for BRDCST(). Since processes may be working in the same directory it is advisable to have each process use a unique file name. The file is closed at the end of the operation.

If the data in the file is all of the same type (integer, double etc.) AND there is no additional record structure (such as that imposed by FORTRAN) TYPE should be set to reflect this so that data translation can occur between different machines (the blocking is set to accomodate this). machines (the blocking is set to accomodate this). Otherwise if binary transfer is not meaningful U'll have to write your own application specific routine.


INTEGER FUNCTION NICEFTN(INCR)

Portable rapper around nice for FORTRAN users. See the local nice() system call man page for info. On the IPSC/DELTA this is a null operation and returns 0.


SUBROUTINE EVON()

SUBROUTINE EVOFF()

Enable/disable event logging. Each process logs events to the ASCII file 'events.<nodeid>' (with much buffering so for modest applications it is only dumped out at the end). This includes events such as process creation/termination, message passing etc. Event logging may be enabled just around critical sections of code. Applications may generate additional information with the following (FORTRAN) calls.


SUBROUTINE EVBGIN(INFO)

SUBROUTINE EVEND(INFO)

SUBROUTINE EVENT(INFO)

EVBGIN marks the beginning of an extended event (state?) by logging the message in INFO to the event file (along with a timestamp). EVEND marks the termination of a state similarly. These calls need not be paired for correct functioning, but are in the logical interpretation of the event file. EVENT logs the message INFO to the file with a timestamp.

PBEGINF(), if compiled with -DEVENTLOG opens the file 'events.<nodeid>' and PEND() dumps out event information and closes the file. Imbetween, event logging is disabled by default and must be enabled by the application.