BCAST(3PVM)
π BCAST(3PVM) β the pvm_bcast tea π
okay bestie, pull up a chair, we're doing PVM Version 3.4 today and this one is genuinely one of my faves π«Ά
β¨ NAME β¨
pvm_bcast β broadcasts the data in the active message buffer to a group of processes. it's giving "one message, everybody hears it" energy π
πΈ SYNOPSIS πΈ
C:
int info = pvm_bcast( char *group, int msgtag )
Fortran:
call pvmfbcast( group, msgtag, info )
π PARAMETERS π
groupβ character string, the group name of an existing group. like, it has to actually exist, no cap.msgtagβ integer message tag that you supply. it should be>= 0. it's literally just so your program can tell different kinds of messages apart. iykyk.infoβ integer status code the routine hands back to you. anything less than zero means something went wrong π
π¦ DESCRIPTION π¦
so pvm_bcast broadcasts a message sitting in the active send buffer out to all the members of group. in PVM 3.2 and later, the broadcast message does not get sent back to the sender β she said "i already know what i said" π
any PVM task can call pvm_bcast(), and bestie, it does not need to be a member of the group. you can just show up, no invite needed. the content of the message gets told apart by msgtag. if pvm_bcast succeeds, info will be 0. if some error happens, info will be < 0 π
pvm_bcast is asynchronous. what that means: computation on the sending processor picks right back up as soon as the message is safely on its way to the receiving processors. slay. this is the opposite of synchronous communication, where the sending processor has to sit there and wait until a matching receive is executed by all the receiving processors. not her vibe.
pvm_bcast first figures out the tids of the group members by checking a group data base. then a multicast is performed to those tids. if the group gets changed during a broadcast, that change will not be reflected in the broadcast β the message already left, ok? βοΈ
real talk: multicasting is not supported by most multiprocessor vendors. typically their native calls only support broadcasting to all the user's processes on a multiprocessor. because of this omission, pvm_bcast may not be an efficient communication method on some multiprocessors. it's giving "we tried our best" π
π EXAMPLES π
C:
info = pvm_initsend( PvmDataRaw );
info = pvm_pkint( array, 10, 1 );
msgtag = 5 ;
info = pvm_bcast( "worker", msgtag );
Fortran:
CALL PVMFINITSEND( PVMDEFAULT )
CALL PVMFPKFLOAT( DATA, 100, 1, INFO )
CALL PVMFBCAST( 'worker', 5, INFO )
π ERRORS π
these error conditions can be returned by pvm_bcast:
PvmSysErrβpvmdwas not started or has crashed. she's not here, she left the group chat πPvmBadParamβ giving a negativemsgtag. bestie. no. negative tags are not the move πPvmNoGroupβ giving a non-existent group name. that group does not exist, you cannot sit with us π
π SEE ALSO π
pvm_joingroup(3PVM)β go join the group first, icon behavior π
and that's the whole page, bestie! π this was BCAST(3PVM) from PVM Version 3.4, dated 30 August, 1993 β 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