SETMWID(3PVM)

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

πŸ’– SETMWID β€” bestie edition πŸ’–

okay so we're doing SETMWID(3PVM) today, which lives in the PVM Version 3.4 manual and honestly? it's giving "tiny function, big feelings." come sit with me 🫢


✨ NAME ✨

pvm_getmwid, pvm_setmwid β€” get or set the wait ID of a message, fr fr.

[In Version 3.4: Relaced by pvm_getminfo and pvm_setminfo]

heads up bestie: that bracket note is quoted exactly as it appears, typo and all πŸ’… in Version 3.4 these got replaced by pvm_getminfo and pvm_setminfo, so like… noted.

🌸 SYNOPSIS 🌸

C β€” the whole vibe:

int info = pvm_getmwid( int bufid )
int info = pvm_setmwid( int bufid, int waitid )

Fortran β€” not available. she said "no πŸ’€"


πŸŽ€ PARAMETERS πŸŽ€

  • bufid β€” the message buffer identifier. it's the lil name tag that says which message we're talking about πŸ’–
  • waitid β€” the wait identifier number. this is the actual ID you're slapping onto the message ✨

πŸ’… DESCRIPTION πŸ’…

okay so picture this: a wait identifier is literally part of a message, same energy as the source, the destination, the tag, and the body. it's just one more field chilling in there 🌈

what's it for? matching a reply back to the request that started it. it's the "hey it's me, the one who asked" of the messaging world. no cap πŸ”₯

the default wait ID for a message is zero, which means none. like, zero wait ID = no wait ID, periodt.

pvm_getmwid hands you back the wait ID that's associated with a message buffer. or, if things go sideways, a negative error code 😭

pvm_setmwid assigns a brand new wait ID to a message buffer. it returns PvmOk unless an error happens. slay πŸ’…


πŸ‘‘ EXAMPLES πŸ‘‘

here's the iconic little routine, copied character for character because we do not freestyle code in this house:

     int src, tag;

     pvm_recv(-1, -1);
     /* ... process, compose reply message */
     pvm_setmwid(pvm_getsbuf(), pvm_getmwid(pvm_getrbuf()));
     pvm_bufinfo(pvm_getrbuf(), (int *)0, &tag, &src);
     pvm_send(src, tag);

see what she's doing? receive something, do the work, then copy the wait ID off the receive buffer onto the send buffer so the reply knows which request it belongs to. it's giving main character energy ✨


πŸ’€ ERRORS πŸ’€

these are the error conditions that pvm_getmwid or pvm_setmwid can throw at you:

  • PvmBadParam β€” you passed an invalid value for the bufid argument. bestie. that's not a real buffer πŸ™ˆ
  • PvmNoSuchBuf β€” the message buffer bufid doesn't exist. it's not here, it never was, it's ghosting you πŸ‘»

πŸ¦‹ SEE ALSO πŸ¦‹

  • pvm_bufinfo(3PVM) β€” go read this one next, it's the friend of the family πŸ’œ

and that's the whole page, bestie!! this one came from PVM Version 3.4, dated 18 May, 1994, and the page itself answers to the name SETMWID(3PVM). stay hydrated, keep your bufids valid, and go get that wait ID matched up πŸ’–πŸŽ€πŸŒΈβœ¨πŸ«Ά

πŸ“¦ where this page comes from