SETMINFO(3PVM)

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

πŸŽ€ SETMINFO(3PVM) πŸŽ€

okay bestie so this one is from the PVM Version 3.4 manual, and it's literally the glow-up guide for message headers πŸ’–


✨ NAME ✨

pvm_getminfo, pvm_setminfo β€” get or set header information of a message. reading the receipt vs. writing the receipt, that's the whole vibe 🧾✨


🌸 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 )

so C gets the cute little struct, and Fortran gets the whole laundry list of arguments. both are valid. both ate. πŸ’…


πŸ¦‹ PARAMETERS πŸ¦‹

  • bufid β€” the message buffer identifier. it's giving "which message are we even talking about" ✨
  • mi β€” the struct that's holding all the header info, like a little handbag of metadata πŸ‘œ
  • info β€” result code. the "how did it go" receipt 🫢
  • For a description of the Fortran parameters, see below. (yes queen, keep scrolling, they're all listed in the DESCRIPTION πŸ’–)

πŸ‘‘ DESCRIPTION πŸ‘‘

These functions read and set information passed in message headers, which may be of interest to certain applications. Typically, they will be used when it is necessary to get the message context or wait id to use the same values in a reply message. (translation: you're replying to someone and you need to match their energy exactly β€” same context, same wait id, no cap πŸ’Œ)

The fields affected are:

  • len β€” The length in bytes of the body of the message. This will be equal to the actual size of the data packed, if PvmDataRaw is used, otherwise it may include pad bytes. so like, the true size of the fit unless there's padding sneaking in πŸ™ˆ
  • 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 main character of reply-matching ngl πŸ’…
  • enc β€” Message Encoding, either the data signature of the sender, or 0x10000000 for XDR.
  • crc β€” The CRC checksum of the message body. the vibe check, but mathematically rigorous ⭐
  • src β€” The tid of the sender.
  • dst β€” The tid of the destination.

All fields may be read, but only ctx, tag, wid, src and dst may be set.

not me reading len, enc and crc and then trying to write them back 😭 bestie you can look but you cannot touch, those three are read-only, periodt.

pvm_getmwid and pvm_setmwid return PvmOk if successful, or else a negative error code.


🌈 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);

see how it grabs the info off the receive buffer, then copies the wid onto the send buffer, and sends it right back to mi1.src with mi1.tag? that's the whole "reply like you remember them" arc and honestly? iconic. 🫢✨


πŸ’€ ERRORS πŸ’€

The following error conditions can be returned by pvm_getmwid or pvm_setmwid:

  • PvmBadParam β€” Invalid value for bufid or mi argument. you handed it something cursed, bestie πŸ™ˆ
  • PvmNoSuchBuf β€” Message buffer bufid doesn't exist. ghost buffer. no thoughts, no header, no message πŸ’€

πŸ“ SEE ALSO πŸ“

  • pvm_bufinfo(3PVM) β€” go read that one too, it's the sibling page and it's lowkey essential πŸ’œ

that's the whole page, no notes πŸ’– huge shoutout to the PVM Version 3.4 girlies and this absolute relic dated 13 March, 1996 β€” she's vintage, she's valid, she's still compiling. mwah, stay buffered, bestie πŸŽ€βœ¨πŸ¦‹

πŸ“¦ where this page comes from