The Queen's University of Belfast

Parallel Computer Centre
[Next] [Previous] [Top]
Additional Features
PVMFTASKS()
Returns information about the tasks running on the virtual machine - this is the same as doing a ps console command
PVMFTASKS(WHERE, NTASK, TID, PTID,
DTID, FLAG, AOUT, INFO)
- where - integer specifying what tasks to return information about
- 0 - all tasks on the virtual machine
- pvmd tid - all tasks on a given host
- tid - specific task
- ntask - returns the number of tasks being reported on
- tid - integer returning task ID of one task
- ptid - integer returning parent task ID
- dtid - returns pvmd task ID of host task
- flag - returns the status of task
- aout - character string returning the name of the spawned task
- info - status code returned by the routine ie <0 indicates an error
Eg
CALL PVMFTASKS(DTID, NTASK, INFO)
PVMFTIDTOHOST()
Returns the host ID on which the specified task is running
PVMFTIDTOHOST(TID, DTID)
- tid - task identifier
- dtid - tid of the host's pvmd
Eg
CALL PVMFTIDTOHOST(TID, HOSTID)
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.
PVMFSETRBUF()
Switches the active send buffer and saves the previous buffer
PVMFSETRBUF(BUFID, OLDBUF)
- bufid - buffer identifier for the new active send 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.
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

Dynamic Configuration
PVMFADDHOST()
Adds a host to the virtual machine
PVMFADDHOST(HOST, INFO)
- host - a character string containing the name of the machines to be added
- info - status code where a value <1 indicates a failure
- useful to add more hosts as they become available or if the application dynamically determines it could use more computational power
eg
CALL PVMFADDHOST(`pawnee-atm', INFO)
PVMFDELHOST()
Deletes a host to the virtual machine
PVMFDELHOST(HOST, INFO)
- host - a character string containing the name of the machines to be deleted
- info - status code where a value <1 indicates a failure
- pvmfnotify - can be used to notify an application of the failure of a host
eg
CALL PVMFDELHOST(`pawnee-atm', INFO)
PVMFNOTIFY()
Request notification of PVM event
PVMFNOTIFY(WHAT, MSGTAG, CNT,
TIDS, INFO)
- what - integer identifier of event should trigger the notification eg
- PvmTaskExit - notify if tasks exits
- PvmHostDelete - notify if host is deleted
- PvmHostAdd - notify if host is added
- msgtag - message tag to be used in notification
- cnt - length of tids array for PvmTaskExit and PvmHostDelete
- tids - integer array of length the number of tasks to be notified - should be empty with a PvmAddHost option
- info - status code where a value <0 indicates a failure
- calling task(s) are responsible for receiving the message with the specified message tag and taking the appropriate action
- future PVM versions may expand the list of notifiable events
Eg
CALL PVMFNOTIFY (PVMHOSTDELETE,
1111,NPROC, TIDS, INFO)
PVMFKILL()
Terminates a specified PVM process
PVMFKILL(TID, INFO)
- tid - integer task identifier of the PVM process to be killed ie not yourself
- info - integer status code returned by the
routine, values less than zero indicate an
error
- pvmfexit() is used to kill yourself
- Error conditions returned by pvmfkill are
- PvmBadParam - giving an invalid tid value
- PvmSysErr - pvmd not responding
PVMFCONFIG()
Returns information about the present virtual machine configuration
PVMFCONFIG(NHOST, NARCH, DTID, NAME,
ARCH, SPEED, INFO)
- nhost - integer returning the number of hosts in the virtual machine
- narch - integer returning the number of different data formats being used
- dtid - integer returning pvmd task ID for this host
- name - character string returning the name of this host
- arch - character string returning the name of host architecture
- speed - integer returning relative speed of this host ie default = 1000
- info - integer status code returned by the routine, values less than 0 indicate an error
Eg
DO i = 1, NHOST
CALL PVMFCONFIG(NHOST, NARCH,
DTID(i), HOST(i), ARCH(i), SPEED(i), INFO)
ENDDO
- Error condition returned by this is PvmSysErr when the pvmd is not responding
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
PVMFCATCHOUT()
Catch output from child tasks
PVMFCATCHOUT (ONOFF)
- this routine causes the parent task to catch output from tasks spawned after this call
- output collection can only be turned on or off and is logged to stdout of the parent task
Eg
CALL PVMFCATCHOUT(1)
This switches output collection on 0 switches it off.
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)
- error conditions returned by pvmfpsend are
- PvmBadParam - invalid tid or msgtag
- PvmSysErr - pvmd not responding
[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