SETMINFO(3PVM)
π NAME π
pvm_getminfo, pvm_setminfo β grab the header info off a message, or set it. That's it, that's the whole gig. β¨
Ok so real talk, this page is SETMINFO(3PVM) from PVM Version 3.4, and it's basically the "peek behind the curtain" of your message headers. Let's go π«Ά
πΈ SYNOPSIS πΈ
C int info = pvm_getminfo( int bufid, struct pvmminfo *mi )
int info = pvm_setminfo( int bufid, struct pvmminfo *mi )
Fortran call pvmfgetminfo( bufid, len, ctx, tag, wid, enc, crc,
src, dst, info )
call pvmfsetminfo( bufid, ctx, tag, wid, src, dst, info )
π PARAMETERS π
bufidβ the message buffer identifier. Your lil ticket to the buffer you care about πmiβ the struct holding all the header info. It's giving "everything bagel" of message metadata.infoβ result code. The receipts, basically.
For a description of the Fortran parameters, see below. π (spoiler: it's the field list, keep scrolling bestie)
β¨ DESCRIPTION β¨
So these functions read and set information that gets passed around in message headers, and honestly? Some applications are obsessed with that info. The classic use case: you need to get the message context or the wait id so you can use those exact same values in a reply message. Reply etiquette, but make it distributed systems. π
Here's the field-by-field breakdown:
lenβ the length in bytes of the body of the message. Heads up: this equals the actual size of the data packed ifPvmDataRawis used, otherwise it may include pad bytes. So don't come for her if the number looks a lil thicc.ctxβ the context sent with the message.tagβ the tag sent with the message.widβ Wait Identifier. This is the one that matches a reply message to the corresponding request. It's the "who asked" tracker. π₯encβ Message Encoding. Either the data signature of the sender, or0x10000000for XDR.crcβ the CRC checksum of the message body. Integrity check era. πsrcβ the tid of the sender.dstβ the tid of the destination.
Read carefully, bestie: all fields may be read, but onlyctx,tag,wid,srcanddstmay be set. The rest are read-only. No touching. π«
And btw β pvm_getmwid and pvm_setmwid return PvmOk if successful, or else a negative error code. Ngl that's literally what the page says, so I'm saying it too. β¨
π EXAMPLES π
/* return a message to a caller with the same tag and wait id */
struct pvmminfo mi1, mi2;
pvm_recv(-1, -1);
/* ... process, compose reply message */
pvm_getminfo(pvm_getrbuf(), &mi1);
pvm_getminfo(pvm_getsbuf(), &mi2);
mi2.wid = mi1.wid;
pvm_send(mi1.src, mi1.tag);
The way this little snippet copies mi1.wid into mi2.wid so the reply lines up with the request? Chef's kiss. That's the whole point of wid right there. π
π ERRORS π
These are the error conditions that can come back from pvm_getmwid or pvm_setmwid:
PvmBadParamβ invalid value for thebufidormiargument. Something you passed is not it, bestie. πPvmNoSuchBufβ the message bufferbufiddoesn't exist. Ghosted. π
π¦ SEE ALSO π¦
pvm_bufinfo(3PVM)
k that's the whole page!! π Go forth and match your wait ids. This was SETMINFO(3PVM) from PVM Version 3.4, dated 13 March, 1996 β a true vintage icon, and she still slays. ππβ¨
π¦ 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