SETMINFO(3PVM)
π SETMINFO β the pvm_getminfo / pvm_setminfo era π
okay bestie, pull up a chair, we're reading the PVM Version 3.4 manual together and honestly? it's giving message header lore and I'm obsessed. no cap, this one's niche but it's so useful. π
β¨ NAME β¨
pvm_getminfo, pvm_setminfo β get or set header information of a message. that's it, that's the whole vibe. π
πΈ SYNOPSIS πΈ
C side, in all its glory:
int info = pvm_getminfo( int bufid, struct pvmminfo *mi )
int info = pvm_setminfo( int bufid, struct pvmminfo *mi )
Fortran girlies, this one's for you:
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 handle, your main character ID. β¨miβ the struct holding all the header information. the whole fit, basically. πinfoβ the result code. it tells you how it went. π«Ά
and for the Fortran parameters? keep reading bestie, the description's got you. π
π DESCRIPTION π
so these functions read and set the information that rides along in message headers β the kind of stuff certain applications genuinely care about. typically you reach for them when you need to grab the message context or the wait id so you can reuse those exact same values in a reply message. it's the "let me match the energy they sent me" of IPC. π₯
the fields affected are:
lenβ the length in bytes of the body of the message. it'll equal the actual size of the data packed ifPvmDataRawis used β otherwise, heads up, it may include pad bytes. πctxβ the context sent with the message.tagβ the tag sent with the message.widβ Wait Identifier, used to match a reply message to the corresponding request. this is the matching queen, the one that keeps track of who's replying to whom. πencβ Message Encoding, either the data signature of the sender, or0x10000000for XDR.crcβ the CRC checksum of the message body.srcβ the tid of the sender.dstβ the tid of the destination.
β οΈ important, don't skip: all fields may be read, but onlyctx,tag,wid,srcanddstmay be set. the rest are read-only, look-but-don't-touch, no editing, periodt. π
pvm_getmwid and pvm_setmwid return PvmOk if successful, or else a negative error code. (yes bestie, the page really does say pvm_getmwid and pvm_setmwid right there β I'm just the messenger, I don't make the rules. π)
π EXAMPLES π
return a message to a caller with the same tag and wait id β here's the whole thing:
/* 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);
see how it grabs the receive buffer info, grabs the send buffer info, copies the wait id over, and sends it back to mi1.src with mi1.tag? that's the whole trick and it ate. β¨
π ERRORS π
the following error conditions can be returned by pvm_getmwid or pvm_setmwid:
PvmBadParamβ invalid value for thebufidormiargument. you gave it something cursed, bestie. πPvmNoSuchBufβ message bufferbufiddoesn't exist. it's not there. it never was. ghosted. π»
π SEE ALSO π
pvm_bufinfo(3PVM)β go read that one next, fr fr.
and that's a wrap on SETMINFO from PVM Version 3.4, dated 13 March, 1996 β an absolute vintage icon, no notes, she served and she's still serving. stay matched, stay tagged, and may your wait ids always find their way home. πβ¨π¦π
π¦ 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