NOTIFY(3PVM)
π NOTIFY(3PVM) β the pvm_notify page, bestie edition π
okay so this is the manual page for pvm_notify, from PVM Version 3.4. sit down, grab a strawberry π, and let's get into it because this one is genuinely so useful.
β¨ NAME β¨
pvm_notify β request notification of a PVM event, like, say, a host straight-up failing. π
β¨ SYNOPSIS β¨
C girlies:
int info = pvm_notify( int what, int msgtag, int cnt, int *tids )
Fortran girlies:
call pvmfnotify( what, msgtag, cnt, tids, info )
β¨ PARAMETERS β¨
whatβ which type of event is gonna trigger the notification. right now it's one of these, and yes there are exactly three, no more, don't come for me:PvmTaskExitβ a task exits or gets killed πPvmHostDeleteβ a host is deleted or crashes πPvmHostAddβ a new host gets added π
msgtagβ the message tag that's gonna be used in the notification. pick it, own it.cntβ forPvmTaskExitandPvmHostDelete, this is the length of thetidsarray. forPvmHostAdd, it's how many times you want to be notified. periodt.tidsβ forPvmTaskExitandPvmHostDelete, this is an array of lengthcntfull of task or pvmd TIDs that you want to be notified about. and when you're using thePvmHostAddoption? this array just... isn't used. she's off duty. πinfoβ the integer status code the routine hands back to you. anything less than zero means something went wrong, bestie.
β¨ DESCRIPTION β¨
the pvm_notify routine asks PVM to notify you, the caller, when it detects certain events. PVM then sends one or more notify messages (details below, keep scrolling π«Ά) back to the task that called it. those messages carry the tag msgtag that you handed to notify.
here's the format of those notification messages, one by one:
PvmTaskExit
one notify message for each TID you requested. the message body contains a single TID of the task that exited.
PvmHostDelete
one notify message for each TID you requested. the message body contains a single pvmd-TID of the pvmd that exited.
PvmHostAdd
cnt notify messages get sent, one each time the local pvmd's host table gets updated. the message body contains an integer length followed by a list of pvmd-TIDs of the new pvmds. the counter of PvmHostAdd messages still waiting to be sent gets replaced by successive calls to pvm_notify. specifying a cnt of -1 turns on PvmHostAdd messages until some future notify; a count of zero disables them. π
also, the TIDs inside the notify messages are packed as integers. noted, no cap.
and listen β the calling task is the one responsible for receiving messages with that specified tag and taking appropriate action. that's on you, babe. π
future versions of PVM may expand the list of available notification events, so stay tuned ig. β
β¨ EXAMPLES β¨
C:
info = pvm_notify( PvmTaskExit, 9999, ntask, tids );
Fortran:
CALL PVMFNOTIFY( PVMHOSTDELETE, 1111, NUMHOSTS, DTIDS, INFO )
so, to "cancel" a notify request in PVM, you can just re-invoke the pvm_notify routine with an extra PvmNotifyCancel flag in the what argument. but β and this is the important bit β the remaining arguments to this cancelling invocation have to match the original invocation exactly, aside from that additional PvmNotifyCancel, which you can add(+) or OR(|) onto 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 actually occurred. iconic behaviour honestly, but do not forget it. π
β¨ ERRORS β¨
PvmSysErrβ pvmd is not responding. she's ghosting you. πPvmBadParamβ you gave an invalid argument value. oops. π
β¨ SEE ALSO β¨
pvm_tasks(3PVM), pvm_config(3PVM) β go read those next, bestie, they're right there.
and that's the whole page!! this was PVM Version 3.4, dated 31 January, 1994 β yes she's a vintage queen and she still ate ππ mwah, love u, go notify somebody about it π«Άβ¨
π¦ where this page comes from
- debian bookworm: pvm-dev 3.4.6-5
- ubuntu jammy: pvm-dev 3.4.6-3.2
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms