PKMESG(3PVM)

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

πŸ’Œ PKMESG(3PVM) β€” the pvm_pkmesg, pvm_pkmesgbody and pvm_upkmesg girlies πŸ’Œ

okay so bestie, welcome to PKMESG(3PVM), straight out of the PVM Version 3.4 era, and this one is genuinely so fun?? it's about stuffing whole messages inside other messages. messages-ception. it's giving 🎁 in a 🎁. let's go 🫢


✨ NAME ✨

pvm_pkmesg, pvm_pkmesgbody, pvm_upkmesg β€” pack messages into other messages. yes literally that. nesting era πŸ‘‘


🌸 SYNOPSIS 🌸

C side, say it with me:

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

Fortran besties, this one's for you:

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

πŸŽ€ PARAMETERS πŸŽ€

  • bufid β€” the message buffer you're packing. the lil star of the show πŸ’–
  • newbufid β€” the new message buffer that got unpacked, or a result code.
  • info β€” the result code. it's the vibe report, basically.

πŸ¦‹ DESCRIPTION πŸ¦‹

so these functions are how you put messages inside other messages, treating them like regular data elements. nesting!! as a treat!! πŸ’…

pvm_pkmesg packs the message you specified into the current send buffer. it takes the entire body of the message and also all the header attributes, which are:

  • length
  • context tag
  • message tag
  • wait identifier
  • encoding
  • checksum
  • source and destination addresses
heads up: the buffer you specify must not be the same as the current send buffer. that's a hard no bestie πŸ™ˆ

you can pack multiple messages into a single message, and those packed messages can be mixed with any other data types. freestyle it, no cap.

pvm_upkmesg unpacks a message from the current receive buffer and allocates a brand new message buffer for it. the body of that newly created message, plus the header attributes listed above, will match the one that was originally packed with pvm_pkmesg. it's a perfect little clone 🧬✨

pvm_pkmesgbody is similar to pvm_pkmesg, but 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. lowkey the chillest one.

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 encoding match, no service 😭

calls to pvm_pkmesgbody can be mixed with calls to pack any other data types. slay.

note: pvm_upkmesgbody doesn't exist, because PVM doesn't keep track of the boundary between the two messages. rip to a function that never was πŸ’€

🌈 EXAMPLES 🌈

look at her go:

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

receiving, initialising, packing a string, and then packing the whole received message in too. iconic behaviour, honestly. ate πŸ’…


πŸ’€ ERRORS πŸ’€

these are the error conditions that pvm_pkmesg, pvm_pkmesgbody or pvm_upkmesg can hand back to you. deep breaths bestie 🫢

  • PvmBadParam β€” an invalid value was specified for the bufid argument, or bufid is the current send buffer. (we love a self-referential packing attempt, but no πŸ’”)
  • PvmNoSuchBuf β€” message buffer bufid doesn't exist. she's not here, girl, she's gone πŸ‘»
  • PvmNoMem β€” Libpvm is unable to allocate memory to pack data. memory said "not today" 😭
  • PvmNoData β€” the end of the message has been reached, perhaps because pack and unpack calls were mismatched. we've all been there πŸ™ˆ
  • PvmNoBuf β€” there is no current send (or receive) buffer. nothing to work with, nothing to pack, empty handed πŸ₯²
  • PvmMismatch β€” pvm_pkmesgbody was called and the encoding types of bufid and the current send buffer don't match. encoding mismatch, incompatible, it's giving situationship πŸ’”

πŸ”₯ SEE ALSO πŸ”₯

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

and that's the whole page, bestie!! go forth and nest your messages πŸ¦‹πŸŒΈπŸ’–

this lil gem is from PVM Version 3.4, dated 10 February, 1995 β€” yes she's vintage, yes she still serves, periodt πŸ‘‘βœ¨

πŸ“¦ where this page comes from