The Queen's University of Belfast

Parallel Computer Centre
[Next] [Previous] [Top]
Additional Message Passing Features
PVMFTRECV()
Receive with timeout
PVMFTRECV(TID, MSGTAG, SEC, USEC,BUFID)
- tid - task identifier (sending process)
- msgtag - message tag
- sec, usec - integers defining the time to wait before returning without a message
- set both to 0 and it acts as a non-blocking receive
- bufid - returns the value of the new active receive buffer identifier ie <0 => error
PVMFTRECV blocks the process until a message, msgtag, has arrived from tid, it place the message in a new active receive buffer also clearing the current one.
PVMFPSEND()
Pack and send data in one call
PVMFPSEND(TID, MSGTAG, BUF, LEN,
DATATYPE, INFO)
- tid - task identifier of destination process
- msgtag - message tag supplied by the user, should be >= 1
- buf - pointer to a buffer to send
- len - length of buffer (in multiple of data type size)
- datatype - type of data to which buf points
- info - status code returned where <0 indicates an error
- pvmfpsend is asynchronous ie computation on the sending processor resumes as soon as the message is safely on its way to the receiving process
Eg
CALL PVMFPSEND(TID, MSGTAG, BUF, CNT,
REAL4, INFO)
- Creates and sends a single contiguous message (no stride argument)
- Data is not copied into a buffer (faster on MPP machines where latency is low)
- error conditions returned by pvmfpsend are
- PvmBadParam - invalid tid or msgtag
- PvmSysErr - pvmd not responding
PVMFSETRBUF()
Switches the active receive buffer and saves the previous buffer
PVMFSETRBUF(BUFID, OLDBUF)
- bufid - buffer identifier for the new active receive buffer eg 0 indicates the present active receive is saved and no active receive buffer exists
- oldbuf - buffer identifier for the previous active send buffer
Eg CALL PVMFSETRBUF(NEWBUF, OLDBUF)
- This routine is required when handling multiple message buffers for example switching back and forth between 2 buffers where one communicates with a graphical interface and the other is used to send data to the other tasks in the application.
- PVMFSETSBUF - send buffers
Error Handling
- All PVM routines return an error condition if they detect an error during execution
- PVM prints error conditions detected
- pvmfsetopt() turns automatic reporting off
- Diagnostic prints can be viewed using
- PVM console redirection or
- calling pvmfcatchout() - this causes the standard output of all subsequently spawned tasks to appear on the standard output of the spawner
- The write statement - test the value of the status/return code in the PVM calls and write an appropriate message

PVMFPERROR()
Prints the error status of the last PVM call
PVMFPERROR (MSG, INFO)
- msg - character string supplied by the user and is prepended to the error message of the last PVM call
- info - status code returned by the routine where <0 indicates an error
Eg
CALL PVMFSEND(TID, MSGTAG)
IF (INFO .LT. 0) THEN
CALL PVMFPERROR(`Step 1', INFO)
ENDIF
Setting and Getting Options
PVMFSETOPT(WHAT, VAL, OLDVAL)
PVMFGETOPT(WHAT, VAL)
- where
- what is an integer defining what is being set
- val is an integer specifying the new setting
- oldval is an integer specifying the previous setting
- includes automatic error message printing, debugging level, and communication routing method etc

[Next] [Previous] [Top]
All documents are the responsibility of, and copyright, © their authors and do not represent the views of The Parallel Computer Centre, nor of The Queen's University of Belfast.
Maintained by Alan Rea, email A.Rea@qub.ac.uk
Generated with CERN WebMaker