SETMINFO(3PVM)

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

πŸ’– 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 if PvmDataRaw is 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, or 0x10000000 for 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 only ctx, tag, wid, src and dst may 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 the bufid or mi argument. you gave it something cursed, bestie. 😭
  • PvmNoSuchBuf β€” message buffer bufid doesn'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