REG_RM(3PVM) PVM Version 3.4 REG_RM(3PVM)NAME
pvm_reg_rm - Register task as PVM resource manager.
SYNOPSIS
C #include <pvmsdpro.h>
int cc = pvm_reg_rm( struct pvmhostinfo **hip )
struct pvmhostinfo {
int hi_tid;
char *hi_name;
char *hi_arch;
int hi_speed;
};
Fortran Not Available
PARAMETERS
hostp Returns pointer to a pvmhostinfo structure which contains information about the master host.
DESCRIPTION
Registers the calling task as a PVM task and slave host manager. This means it intercepts certain libpvm calls from other tasks in order
to have a say in scheduling policy. The resource manager will asynchronously receive messages from tasks containing requests for service,
as well as messages from pvmds notifying it of system failures.
Before you start using this function, be warned that it's not a trivial thing, i.e. you can't just call it to turn off the default round-
robin task assignment. Rather, it allows you to write your own resource manager and hook it to PVM.
To understand what the following messages mean, you should refer to the PVM source code and/or user guide section on implementation;
There's just too much to say about them.
When one of the following libpvm functions is called in a task with resource manager set, the given message tag is sent to to resource man-
ager.
Libpvm call RM message Normal message
pvm_addhosts() SM_ADDHOST TM_ADDHOST
pvm_config() SM_CONFIG TM_CONFIG
pvm_delhosts() SM_DELHOST TM_DELHOST
pvm_notify() SM_NOTIFY TM_NOTIFY
pvm_spawn() SM_SPAWN TM_SPAWN
pvm_tasks() SM_TASK TM_TASK
pvm_reg_rm() SM_SCHED TM_SCHED
The resource manager must in turn compose the following messages and send them to the pvmds:
RM message Normal message
SM_EXEC DM_EXEC
SM_EXECACK DM_EXECACK
SM_ADD DM_ADD
SM_ADDACK DM_ADDACK
SM_HANDOFF (none - change of resource manager)
The following messages are sent asynchronously to the resource manager by the system:
RM message Meaning
SM_TASKX notify of task exit/fail
SM_HOSTX notify of host delete/fail
The resource manager task must use pvm_setopt(PvmResvTids, 1) to allow sending reserved messages. Messages should be packed using encoding
PvmDataDefault to ensure they can be unpacked anywhere in the system.
pvm_reg_rm() returns PvmOk when successful.
SEE ALSO pvm_addhosts(3PVM), pvm_config(3PVM), pvm_delhosts(3PVM), pvm_notify(3PVM), pvm_spawn(3PVM), pvm_tasks(3PVM)
4 March, 1994 REG_RM(3PVM)
Check Out this Related Man Page
NOTIFY(3PVM) PVM Version 3.4 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 Type of event to trigger the notification. Presently one of:
Value Meaning
PvmTaskExit Task exits or is killed
PvmHostDelete Host is deleted or crashes
PvmHostAdd New host is added
msgtag Message tag to be used in notification.
cnt For PvmTaskExit and PvmHostDelete, specifies the length of the tids array. For PvmHostAdd, specifies the number of times to
notify.
tids For PvmTaskExit and PvmHostDelete, an array of length cnt of task or pvmd TIDs to be notified about. The array is not used with
the PvmHostAdd option.
info Integer status code returned by the routine. Values less than zero indicate an error.
DESCRIPTION
The routine pvm_notify requests PVM to notify the caller on detecting certain events. One or more notify messages (see below) are sent by
PVM back to the calling task. The messages have tag msgtag supplied to notify.
The notification messages have the following format:
PvmTaskExit
One notify message for each TID requested. The message body contains a single TID of exited task.
PvmHostDelete
One notify message for each TID requested. The message body contains a single pvmd-TID of exited pvmd.
PvmHostAdd
cnt notify messages are sent, one each time the local pvmd's host table is updated. The message body contains an integer length
followed by a list of pvmd-TIDs of new pvmds. The counter of PvmHostAdd messages yet to be sent is replaced by successive calls to
pvm_notify. Specifying a cnt of -1 turns on PvmHostAdd messages until a future notify; a count of zero disables them.
TIDs in the notify messages are packed as integers.
The calling task is responsible for receiving messages with the specified tag and taking appropriate action.
Future versions of PVM may expand the list of available notification events.
EXAMPLES
C:
info = pvm_notify( PvmTaskExit, 9999, ntask, tids );
Fortran:
CALL PVMFNOTIFY( PVMHOSTDELETE, 1111, NUMHOSTS, DTIDS, INFO )
To "cancel" a notify request in PVM, the pvm_notify routine can be re-invoked with an additional PvmNotifyCancel flag in the what argument.
The remaining arguments to this cancelling invocation must match the original invocation exactly, aside from the additional PvmNotifyCancel
which can be added(+) or OR-ed(|) to the what argument:
pvm_notify( PvmTaskExit, 9999, ntask, tids );
. . .
pvm_notify( PvmTaskExit | PvmNotifyCancel, 9999, ntask, tids );
Note that when a notify is cancelled, the notify message is delivered, as if the given event (i.e. task exit, host add or delete) had
occurred.
ERRORS
PvmSysErr
pvmd not responding.
PvmBadParam
giving an invalid argument value.
SEE ALSO pvm_tasks(3PVM), pvm_config(3PVM)
31 January, 1994 NOTIFY(3PVM)