SETMWID(3PVM)
π 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 bypvm_getminfoandpvm_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 thebufidargument. bestie. that's not a real buffer πPvmNoSuchBufβ the message bufferbufiddoesn'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
- 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