Routines for exercises

pvmfexit(info)
info
integer status code returned by the routine. Values less than zero indicate an error.
This routine tells the local PVM daemon that the calling process is leaving PVM. The routine does not kill the process, which can continue to perform like any other serial process. The routine should also be called by all PVM processes before they stop or exit. It must be called by processes that were not started with pvmfspawn; otherwise PVM will not know if the process has crashed or left normally.


pvmfinitsend(encoding, bufid)
encoding
integer specifying the next message's encoding scheme. Options are:
PVMDEFAULT
XDR if heterogeneous
PVMRAW
no coding
PVMINPLACE
data left in place
bufid
integer returned containing the message buffer identifier. Values less than zero indicate an error.
This routine clears the send buffer and prepares it for packing a new message.


pvmfmcast(ntask, tids, msgtag, info)
ntask
integer specifying the number of tasks to which messages are sent.
tids
integer array of length at least ntask containing the task IDs of the tasks to which messages are to be sent.
msgtag
integer message tag supplied by the user - should be greater than or equal to zero.
info
integer status code returned by the routine. Values less than zero indicate an error. This routine multi-casts a message stored in the active send buffer to ntask tasks specified in the tids array. The receiving processes can call pvmfrecv to receive their copy of the multi-cast. pvmfmcast is asynchronous and computation on the sending processor resumes as soon as the message has been sent.


pvmfmytid(tid)
tid
integer task identifier of the calling PVM process. Value less than zero indicates an error.
This routine must be the first PVM call in any program using PVM 3.0. The routine enrolls the calling process into PVM on its first call. It also generates a unique tid if this process was not created by pvmfspawn.


pvmfpack(what, xp, nitem, stride, info)
what
integer specifying the type of data being packed. Options are:
  • string
  • real4
  • byte1
  • complex8
  • integer2
  • real8
  • integer4
  • complex16
xp
Pointer to the beginning of a block of bytes.
nitem
The total number of items to be packed.
stride
The stride to be used when packing items.
info
Integer status code returned by routine. Values less than zero indicate an error.
Packs an array of the given data type into the active send buffer.


pvmfparent(tid)
tid
integer returns the task identifier of the parent of the calling process. If the calling process was not created with pvmfspawn, then tid=PvmNoParent (error code=-23).

pvmfrecv(tid, msgtag, bufid)
tid
integer task identifier of sending process, supplied by user. -1 is a wildcard and matches any tid.
msgtag
integer message tag supplied by user - should be >=0. -1 matches any message tag.
bufid
integer returns the value of the new active receive buffer identifier. Values less than zero indicate an error.
This routine "blocks" the process until a message with label msgtag arrives from tid. The routine then places the message in a new active receive buffer which also clears the current receive buffer.


pvmfsend(tid, msgtag, info)
tid
integer task indentifier of destination process.
msgtag
integer message tag supplied by the user - should be >=0.
info
integer status code returned by the routine. Values less than zero indicate an error.
This routine sends a message stored in the active buffer to the PVM process identified by tid. msgtag is used to label the message.

The routine is asynchronous so computation on the sending processor resumes as soon as the message has been sent.


pvmfserror(set, oldset)
set
integer defining whether error detection is to be turned on (1) or off (0).
oldset
integer defining the previous setting of pvmfserror.
This routine sets automatic printing of error messages for all subsequent PVM calls by the calling process.


pvmfspawn(task, flag, where, ntask, tids, numt)
task
character string containing the executable file name of the PVM process to be started. The executable must already reside on the host on which it is to be started.
flag
integer specifying spawn options from:
PVMDEFAULT
PVM chooses any machine
PVMHOST
the where argument specifies host
PVMARCH
where specifies architecture type
PVMDEBUG
start up processes under debugger
PVMTRACE
processes will generate trace data (for future expansion)
Use sum of these where appropriate e.g. PVMDEFAULT+PVMDEBUG
where
character string specifying where to start the PVM process. where can be host name or a PVM architecture class. If flag is *, PVM ignores where and selects most appropriate host.
ntask
integer specifying the number of copies of the executable to start.
tids
integer array of length ntask. On return the array contains tids of the PVM processes started by this call. Error code is generated in the array if there is a error starting a given task.
numt
integer returning the actual number of tasks started.
This routine starts ntask copies of the executable named task. If PVMDEBUG is set, then the PVM daemon will start the task(s) under a debugger. Debugger is a shell script that users can modify. Presently the script starts an xterm with dbx.


pvmfunpack(what, xp, nitem, stride, info)
The arguments are defined in the
pvmfpack routine.
xp
Pointer to the beginning of a block of bytes - memory location into which data is to be unpacked.
Messages should be unpacked as they were packed to ensure data integrity.

UP


Submitted by Mark Johnston,
last updated on 19 January 1995.