INITSEND(3PVM)
π NAME π
pvm_initsend β clears the default send buffer and tells PVM how the next message should be encoded. it's the little pre-game ritual before every message you send, bestie. β¨
β¨ SYNOPSIS β¨
C:
int bufid = pvm_initsend( int encoding )
Fortran:
call pvmfinitsend( encoding, bufid )
π PARAMETERS π
encodingβ an Integer that specifies the encoding scheme for the next message. the options in C are:PvmDataDefault=0β XDR πPvmDataRaw=1β no encoding π¦PvmDataInPlace=2β data left in place π
and the option names in Fortran are:
PVMDEFAULT=0β XDR πPVMRAW=1β no encoding π¦PVMINPLACE=2β data left in place π
bufidβ an Integer that gets returned, and it holds the message buffer identifier. if it comes back less than zero, that's an error, no cap. π
π DESCRIPTION π
so pvm_initsend clears the send buffer and gets it ready to pack a brand new message. the encoding scheme used for the packing is decided by encoding. XDR encoding is the default, because PVM literally cannot know if you're gonna add a heterogeneous machine before this message gets sent β it's not psychic, bestie. π but if you already know the next message is only ever going to a machine that understands the native format, then you can use PvmDataRaw encoding and save on encoding costs. it's giving "trust me, I know my machines". π
PvmDataInPlace encoding says the data should be left in place while packing. the message buffer only holds the sizes and the pointers to the items that are gonna be sent. when pvm_send gets called, the items are copied directly out of your memory. this option decreases the number of times a message gets copied β but it comes at a price: you are not allowed to modify the items between the moment they're packed and the moment they're sent. β οΈ so don't touch them. seriously.
if pvm_initsend is successful, then bufid will hold the message buffer identifier. if some error happens, then bufid will be < 0. periodt.
π« RESTRICTIONS π«
PvmDataInPlace only allows dense data (stride = 1) in version 3.3. and it cannot be used on shared memory (*MP) architectures β a PvmNotImpl error will occur at send time. so if that's your setup, don't even try it, babe. π
π 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 )
π ERRORS π
these are the error conditions that pvm_initsend can return:
PvmBadParamβ giving an invalid encoding value. you handed it a number it doesn't recognize, oops. πPvmNoMemβ Malloc has failed. there is not enough memory to create the buffer. your machine said "no ma'am". π
π SEE ALSO π
pvm_mkbuf(3PVM)
okay that's the whole page, bestie β go forth and pack your messages correctly πβ¨
this has been PVM Version 3.4, dated 30 August, 1993 β mwah, love u, bye ππ«Ά
π¦ 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