NOTIFY(3PVM)

NAME
pvm_notify - Request notification of PVM event such as host failure.

SYNOPSIS
C    int info = pvm_notify( int what, int msgtag, int cnt, int *tids )
Fortran    call pvmfnotify( what, msgtag, cnt, tids, info )

PARAMETERS

what
    Integer identifier of what event should trigger the notification. Presently the options are:
    	Value	Meaning
    	PvmTaskExit	notify if task exits
    	PvmHostDelete	notify if host is deleted
    	PvmHostAdd	notify if host is added

msgtag
    Integer message tag to be used in notification.

cnt Integer specifying the length of the tids array.

tids
    Integer array of length cnt that contains a list of task or pvmd tids to be notified about. The array should be empty with the PvmHostAdd option.

info
    Integer status code returned by the routine. Values less than zero indicate an error.

DISCUSSION
The routine pvm_notify requests PVM to notify the caller on detecting certain events. In response to a notify request, some number of messages (see below) are sent by PVM back to the calling task. The messages are tagged with the code (msgtag) supplied to notify. The tids array specifies who to monitor when using TaskExit or HostDelete it contains nothing when using HostAdd. If required, the routines pvm_config and pvm_tasks can be used to obtain task and pvmd tids. The notification messages have the following format:

TaskExit
    One reply message for each tid requested. The message body contains a single tid of exited task.

HostDelete
    One message for each tid requested. The message body contains a single pvmd-tid of exited pvmd.

HostAdd
    One message. The message body contains an integer count followed by a list of pvmd-tids of the new pvmds.

Tids in the notify messages are packed as integers.

The calling task(s) are responsible for receiving the message with the specified msgtag and taking appropriate action. Future versions of PVM may expand the list of available notification events.

Note that the notify request is "consumed" - e.g. a PvmHostAdd request generates a single reply message.

EXAMPLES
C:
	info = pvm_notify( PvmTaskExit, 9999, ntask, tids )

Fortran:
	CALL PVMFNOTIFY( PVMHOSTDELETE, 1111, NUMHOSTS, DTIDS, INFO )

ERRORS
	PvmSysErr	pvmd not responding.
	PvmBadParam	giving an invalid argument value.

SEE ALSO
tasks(3PVM), config(3PVM)