PKMESG(3PVM)
π 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:
lengthcontext tagmessage tagwait identifierencodingchecksumsource 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 thebufidargument, orbufidis the current send buffer. (we love a self-referential packing attempt, but no π)PvmNoSuchBufβ message bufferbufiddoesn'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_pkmesgbodywas called and the encoding types ofbufidand 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
- 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