PKMESG(3PVM)

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

πŸ’– PKMESG(3PVM) πŸ’–

okay bestie, welcome to the PVM Version 3.4 manual page for PKMESG β€” yes that's the whole manual-name situation, and yes we're doing this together, grab a boba πŸ§‹


✨ NAME ✨

pvm_pkmesg, pvm_pkmesgbody, pvm_upkmesg β€” Pack messages into other messages.

it's giving message inception fr fr πŸ’…


🌸 SYNOPSIS 🌸

C:

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

Fortran:

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

πŸŽ€ PARAMETERS πŸŽ€

  • bufid β€” the message buffer you wanna pack, bestie. that's the one.
  • newbufid β€” the new message buffer that got unpacked, or the result code. two jobs, iconic behavior πŸ‘‘
  • info β€” the result code. it tells you how it went. lowkey important.

πŸ¦‹ DESCRIPTION πŸ¦‹

so here's the whole vibe: these functions let you put messages inside other messages, treating them like they're just lil data elements. nested. gorgeous. no cap.

pvm_pkmesg packs the message you specified into the current send buffer. the entire body of the message gets packed, and it brings its header attributes along too like a full entourage:

  • length
  • context tag
  • message tag
  • wait identifier
  • encoding
  • checksum
  • source and destination addresses
⚠️ the buffer you specify must not be the same as the current send buffer. do not do that. that's not the move.

you can pack multiple messages into a single message, and those packed messages can be mixed in with any other data types. versatile queen πŸ’…

pvm_upkmesg unpacks a message from the current receive buffer, and it allocates a brand new message buffer for it. the body of that newly created message β€” plus all those header attributes listed above β€” match the one that was originally packed with pvm_pkmesg. it's a perfect copy. ate. ✨

pvm_pkmesgbody is like pvm_pkmesg's chill sibling: it packs only the body of the specified message and omits the header fields. in other words, it splices the messages together, and the included message is left unaltered. untouched. pristine. 🧚

⚠️ when you call pvm_pkmesgbody, the encoding types of the two messages must match, because the included message body is just simply appended to the send buffer. no conversion, no drama, just vibes. and yes, calls to pvm_pkmesgbody can absolutely be mixed with calls to pack any other data types.
πŸ’€ Note: pvm_upkmesgbody doesn't exist. why? because PVM doesn't keep track of the boundary between the two messages. so there's literally nothing to find. it's not a bug, it's just... not a thing. periodt.

🌈 EXAMPLES 🌈

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

look at her go. receiving, packing a string, then packing the whole received message on top. main character energy πŸ’–


πŸ’œ ERRORS πŸ’œ

these are the error conditions that pvm_pkmesg, pvm_pkmesgbody or pvm_upkmesg can hand back to you, bestie:

  • PvmBadParam β€” an invalid value was specified for the bufid argument, or bufid is the current send buffer. (told you not to do that 😭)
  • PvmNoSuchBuf β€” message buffer bufid doesn't exist. it's not there. it never was. πŸ™ˆ
  • PvmNoMem β€” Libpvm is unable to allocate memory to pack data. out of room, out of luck.
  • PvmNoData β€” the end of the message has been reached, maybe because pack and unpack calls were mismatched. mismatched?? in this economy?? 😭
  • PvmNoBuf β€” there is no current send (or receive) buffer. nothing to work with.
  • PvmMismatch β€” pvm_pkmesgbody was called and the encoding types of bufid and the current send buffer don't match. encoding mismatch is a whole heartbreak.

🌟 SEE ALSO 🌟

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

and that's the whole page, bestie!! 🫢 go forth and nest those messages responsibly. this was PVM Version 3.4, dated 10 February, 1995 β€” yeah she's vintage, she's still slaying, we stan a legacy library πŸ‘‘βœ¨πŸ’–

byeeee πŸ’…

πŸ“¦ where this page comes from