INITSEND(3PVM)
π INITSEND(3PVM) β the pvm_initsend glow-up
okay bestie, welcome to INITSEND(3PVM) from the PVM Version 3.4 manual β this is the page that tells you how to wipe your send buffer clean and pick how your message is gonna get encoded. it's giving fresh-start energy. let's go π
β¨ NAME β¨
pvm_initsend β clears the default send buffer and tells PVM how to encode your message.
like, it's the reset button before you pack a whole new vibe into a message π
πΈ SYNOPSIS πΈ
C:
int bufid = pvm_initsend( int encoding )
Fortran:
call pvmfinitsend( encoding, bufid )
π¦ PARAMETERS π¦
encodingβ an integer that says which encoding scheme the next message is gonna use. In C your options are:PvmDataDefaultβ0β XDRPvmDataRawβ1β no encodingPvmDataInPlaceβ2β data left in place
and in Fortran the option names go by:
PVMDEFAULTβ0β XDRPVMRAWβ1β no encodingPVMINPLACEβ2β data left in place
bufidβ the integer that comes back holding your message buffer identifier. if it's less than zero, bestie, that means an error happened π
π DESCRIPTION π
so pvm_initsend literally clears the send buffer and gets it ready for packing up a brand new message. the encoding scheme you're gonna pack with? that's set by encoding. π«Ά
XDR encoding is the default, and here's why: PVM has no idea whether you're about to add a heterogeneous machine into the mix before this message actually gets sent. it can't read your mind, queen. but if you know the next message is only ever going to a machine that understands the native format, you can use PvmDataRaw encoding and save on those encoding costs. ate. β¨
PvmDataInPlace encoding says: leave the data in place while packing. the message buffer only holds the sizes and pointers to the items being sent. then when pvm_send gets called, the items are copied directly out of your memory. this option cuts down the number of times a message gets copied, but the trade-off is real β you're not allowed to modify the items between the moment they're packed and the moment they're sent. so like, hands off, okay? π
if pvm_initsend succeeds, bufid will contain the message buffer identifier. if some error occurs, then bufid will be < 0. no cap.
π« RESTRICTIONS π«
listen up, because this one matters:PvmDataInPlaceallows only dense (stride = 1) data in version 3.3. it cannot be used on shared memory (*MP) architectures β aPvmNotImplerror will occur at send time. so if you're on*MP, that's a hard no, babes. π
π EXAMPLES π
C:
bufid = pvm_initsend( PvmDataDefault );
info = pvm_pkint( array, 10, 1 );
msgtag = 3 ;
info = pvm_send( tid, msgtag );
Fortran:
CALL PVMFINITSEND(PVMRAW, BUFID)
CALL PVMFPACK( REAL4, DATA, 100, 1, INFO )
CALL PVMFSEND( TID, 3, INFO )
look at that. iconic. π
π ERRORS π
these error conditions can be returned by pvm_initsend:
PvmBadParamβ you gave an invalid encoding value. wrong vibe, try again πPvmNoMemβMallochas failed. there is not enough memory to create the buffer. tragic. truly.
π SEE ALSO π
pvm_mkbuf(3PVM)
and that's the whole page, bestie!! this was INITSEND(3PVM) from PVM Version 3.4, dated 30 August, 1993 β yes she's an elder but she still slays π go clear that buffer and pack something beautiful. 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