NOTIFY(3PVM)

πŸ“¦ version 3.4.6, in debian bookworm, ubuntu jammy

πŸ’– 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 β€” for PvmTaskExit and PvmHostDelete, this is the length of the tids array. for PvmHostAdd, it's how many times you want to be notified. periodt.
  • tids β€” for PvmTaskExit and PvmHostDelete, this is an array of length cnt full of task or pvmd TIDs that you want to be notified about. and when you're using the PvmHostAdd option? 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