PKMESG(3PVM)
π PKMESG β packing messages inside messages, bestie π
okay so this is PKMESG(3PVM) from PVM Version 3.4, and it's literally the "message-ception" page. we're putting whole messages inside other messages. no cap. π«Ά
β¨ NAME β¨
pvm_pkmesg, pvm_pkmesgbody, pvm_upkmesg β pack messages into other messages. yes the whole vibe is nesting. it's giving russian dolls but make it IPC. πͺ
πΈ SYNOPSIS πΈ
C besties:
int info = pvm_pkmesg( int bufid )
int info = pvm_pkmesgbody( int bufid )
int newbufid = pvm_upkmesg( )
Fortran besties:
call pvmfpkmesg( bufid, info )
call pvmfpkmesgbody( bufid, info )
call pvmfupkmesg( bufid, newbufid )
π PARAMETERS π
bufidβ the message buffer you're packing. the little guy going into the envelope πnewbufidβ either the new message buffer that got unpacked, or a result code. it's doing double duty, she contains multitudes β¨infoβ result code. the receipts. π§Ύ
π DESCRIPTION π
so these functions exist so you can shove entire messages into other messages, treating them like they're just another data element. iconic behavior honestly.
pvm_pkmesg packs the specified message into the current send buffer. and not just the body β the entire body plus all the header attributes go in:
- length
- context tag
- message tag
- wait identifier
- encoding
- checksum
- source and destination addresses
π¨ okay important: the buffer you specify must not be the same as the current send buffer. like, do not do that. that's the rule.
the slay part: you can pack multiple messages into a single message, and packed messages can be mixed with any other data types. go off, truly. π₯
pvm_upkmesg unpacks a message from the current receive buffer, and it allocates a new message buffer for it. the body of the newly created message, plus all those header attributes listed above, match the one you originally packed with pvm_pkmesg. so it comes out looking exactly like it went in. periodt. π
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. π¦
β οΈ but listen: when you callpvm_pkmesgbody, the encoding types of the two messages must match, because the included message body is simply appended to the send buffer. no matching encoding = no vibes. also, calls topvm_pkmesgbodycan be mixed with calls to pack any other data types. flexible queen.
π Note: pvm_upkmesgbody doesn't exist, because PVM doesn't keep track of the boundary between the two messages. she simply cannot tell where one ends and the other begins π so don't go looking for it, bestie.
π EXAMPLES π
pvm_recv(-1, -1);
pvm_initsend(PvmDataDefault);
pvm_pkstr("here is the message I received...");
pvm_pkmesg(pvm_getrbuf());
look at that. received a message, started a new send buffer, packed a string, then packed the entire received message in after it. main character energy fr fr. π
π ERRORS π
the following error conditions can be returned by pvm_pkmesg, pvm_pkmesgbody or pvm_upkmesg:
PvmBadParamβ an invalid value was specified for thebufidargument, orbufidis the current send buffer. (yeah, that thing we told you not to do.)PvmNoSuchBufβ message bufferbufiddoesn't exist. she's not here. πPvmNoMemβ Libpvm is unable to allocate memory to pack data. out of room, no space, the vibe is cramped.PvmNoDataβ the end of the message has been reached, perhaps because pack and unpack calls were mismatched. you zigged when you should have zagged πPvmNoBufβ there is no current send (or receive) buffer. nothing to work with. empty.PvmMismatchβpvm_pkmesgbodywas called and the encoding types ofbufidand the current send buffer don't match. told you the encodings had to match!! β οΈ
π¦ SEE ALSO π¦
pvm_getrbuf(3PVM)pvm_getsbuf(3PVM)pvm_pack(3PVM)
and that's the whole page, bestie. mwah. π
this was PVM Version 3.4, dated 10 February, 1995 β yes she's vintage, yes she still ate, and no we will not be discussing how old that makes her. πβ¨
π¦ where this page comes from
- debian bookworm: pvm-dev 3.4.6-5
- ubuntu jammy: pvm-dev 3.4.6-3.2
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms