PKMESG(3PVM)
π PKMESG(3PVM) β bestie, you can put a whole message inside another message
okay so this is PKMESG(3PVM) from PVM Version 3.4 and it's literally the "message-ception" page. we're packing entire messages into other messages like it's nothing. nesting era. π
The stars of the show are pvm_pkmesg, pvm_pkmesgbody, and pvm_upkmesg β they pack messages into other messages. 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. your little envelope π«Άnewbufidβ the new message buffer that got unpacked, or a result code. depends on the vibes.infoβ the result code. classic.
πΈ DESCRIPTION πΈ
So these functions are how you include messages inside other messages, treating them like just another data element. nesting! main character energy honestly. π
pvm_pkmesg packs the specified message into the current send buffer. Not just the body β the entire body gets packed, along with all these header attributes:
lengthcontext tagmessage tagwait identifierencodingchecksumsource and destination addresses
π¨ lowkey important: the buffer you specify must not be the same as the current send buffer. no self-packaging bestie, that's not the move.
You can pack multiple messages into a single message, and you can mix those packed messages with any other data types. go off. π₯
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 you originally packed with pvm_pkmesg. it's giving exact replica. β¨
pvm_pkmesgbody is similar to pvm_pkmesg, except it packs only the body of the specified message and leaves the header fields out entirely. So basically it splices the messages together, and the included message is left unaltered. untouched. preserved. queen behavior. π
β οΈ but listen: when you call pvm_pkmesgbody, the encoding types of the two messages must match, because the included message body just gets appended straight to the send buffer. no conversion, no translation, no mercy. they have to be twins.
Calls to pvm_pkmesgbody can be mixed with calls to pack any other data types, so you're free to be chaotic with it.
π Note: pvm_upkmesgbody doesn't exist. like, at all. why? because PVM doesn't keep track of the boundary between the two messages. the line between them is simply lost to history. π rip to a function that never was.
π¦ 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, packed a string, and then packed the entire received message in there too. obsessed. π
π ERRORS π
Here's the drama β these 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, the self-pack thing again. don't.)PvmNoSuchBufβ message bufferbufiddoesn't exist. it's not real, bestie, it never was. π»PvmNoMemβ Libpvm is unable to allocate memory to pack data. ran out of room, tragic.PvmNoDataβ the end of the message has been reached, possibly because your pack and unpack calls were mismatched. mismatched? in this economy? πPvmNoBufβ there is no current send (or receive) buffer. nothing to work with. empty. void.PvmMismatchβpvm_pkmesgbodywas called and the encoding types ofbufidand the current send buffer don't match. told you they had to be twins. π
π SEE ALSO π
pvm_getrbuf(3PVM)pvm_getsbuf(3PVM)pvm_pack(3PVM)
and that's the whole page, iykyk. this iconic lil manpage was living its best life back on 10 February, 1995, and yeah, that date is in the footer, so consider this your cute lil sign-off. mwah. π«Άπ
π¦ 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