PKMESG(3PVM)

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

πŸ’– PKMESG πŸ’– β€” the 3PVM girlies' guide to packing messages inside messages

okay so bestie, listen. this is the 3PVM page for the trio pvm_pkmesg, pvm_pkmesgbody and pvm_upkmesg, and it's literally about putting whole messages inside other messages like it's a matryoshka doll but make it PVM. no cap.


✨ NAME ✨

pvm_pkmesg, pvm_pkmesgbody, pvm_upkmesg β€” pack messages into other messages. yes, messages. in. messages. we're nesting, we're serving structure, we're giving inception energy. πŸŒ€


🌸 SYNOPSIS 🌸

C girlies, here's your moment:

int info = pvm_pkmesg( int bufid )
int info = pvm_pkmesgbody( int bufid )
int newbufid = pvm_upkmesg( )

Fortran besties, don't feel left out, you get the exact same power:

call pvmfpkmesg( bufid, info )
call pvmfpkmesgbody( bufid, info )
call pvmfupkmesg( bufid, newbufid )

πŸŽ€ PARAMETERS πŸŽ€

  • bufid β€” the message buffer you're packing. this is the lil snack you're tucking into the bigger snack.
  • newbufid β€” the new message buffer that got unpacked, or the result code. she's flexible, she contains multitudes.
  • info β€” the result code. she's gonna tell you how it went. πŸ’…

πŸ¦‹ DESCRIPTION πŸ¦‹

these functions exist so you can include messages inside other messages, as data elements. like, a message is data now. a message is content. the way that PVM said "everything is data" and meant it. periodt.

pvm_pkmesg packs the specified message into the current send buffer. the entire body of the message gets packed, along with all these header attributes:

  • length
  • context tag
  • message tag
  • wait identifier
  • encoding
  • checksum
  • source and destination addresses
⚠️ bestie the buffer you specify must not be the same as the current send buffer. don't do it. not the vibe. that's a PvmBadParam waiting to happen.

multiple messages can be packed into a single message, and packed messages can be mixed with any other data types. so yes, you can absolutely make a lil message lasagna. 🍝

pvm_upkmesg unpacks a message from the current receive buffer, allocating a brand new message buffer for it. the body of the newly created message, plus all those header attributes listed above, match the one originally packed using pvm_pkmesg. it's giving perfect memory, it's giving faithful reproduction, it's giving icon behavior. πŸ‘‘

pvm_pkmesgbody is similar to pvm_pkmesg, but it packs only the body of the specified message, omitting the header fields. in other words, it splices the messages together (and the included message is left unaltered, she stays exactly as she was, no notes). when you call pvm_pkmesgbody, the encoding types of the two messages must match, because the included message body is simply appended to the send buffer. calls to pvm_pkmesgbody can be mixed with calls to pack any other data types.

🚨 note: pvm_upkmesgbody doesn't exist. and why? because PVM doesn't keep track of the boundary between the two messages. that's it. that's the whole reason. no boundary, no unpack, no service. lowkey tragic but highkey sensible. πŸ’€

🌈 EXAMPLES 🌈

here's the moment you've all been waiting for, a real one:

pvm_recv(-1, -1);
pvm_initsend(PvmDataDefault);
pvm_pkstr("here is the message I received...");
pvm_pkmesg(pvm_getrbuf());

look at her. receiving, initializing, packing a string, and then packing the entire received buffer on top. obsessed. πŸ”₯


😭 ERRORS 😭

the following error conditions can be returned by pvm_pkmesg, pvm_pkmesgbody or pvm_upkmesg:

  • PvmBadParam β€” an invalid value was specified for the bufid argument, or bufid is the current send buffer. (remember what we said. don't pack the send buffer into itself, babe.)
  • PvmNoSuchBuf β€” message buffer bufid doesn't exist. she's not here. she never was. πŸ™ˆ
  • PvmNoMem β€” Libpvm is unable to allocate memory to pack data. out of room, out of vibes.
  • PvmNoData β€” the end of the message has been reached, perhaps because pack and unpack calls were mismatched. mismatched calls are a situationship and they never end well.
  • PvmNoBuf β€” there is no current send (or receive) buffer. nothing to work with. empty.
  • PvmMismatch β€” pvm_pkmesgbody was called and the encoding types of bufid and the current send buffer don't match. the encodings have to match, bestie, it's literally the rule.

πŸ‘‘ SEE ALSO πŸ‘‘

go read these next, they're the supporting cast and they ate:

  • pvm_getrbuf(3PVM)
  • pvm_getsbuf(3PVM)
  • pvm_pack(3PVM)

and that's the whole page, you're officially a message-inception girly now. 🫢 this was PVM Version 3.4, dated 10 February, 1995 β€” yeah she's vintage, she's a classic, she's been slaying since before you were born, and honestly? iconic behavior. mwah. πŸ’…βœ¨πŸŽ€

πŸ“¦ where this page comes from