RECV(3PVM)
π RECV(3PVM) β pvm_recv, bestie π
okay so you're out here in PVM Version 3.4 land trying to receive a message and you opened the RECV(3PVM) page?? iconic. sit down, grab a strawberry π, and let's get into it.
β¨ NAME β¨
pvm_recv β receive a message. that's it. that's the whole vibe. π
πΈ SYNOPSIS πΈ
C girlies:
int bufid = pvm_recv( int tid, int msgtag )
Fortran girlies:
call pvmfrecv( tid, msgtag, bufid )
π PARAMETERS π
tidβ Integer task identifier of the sending process, supplied by you, the user. it's giving "who sent this". πmsgtagβ Integer message tag, also supplied by you.msgtagshould be>= 0. no cap.bufidβ Integer that returns the value of the new active receive buffer identifier. any value less than zero means an error happened. π
π¦ DESCRIPTION π¦
so the routine pvm_recv blocks the process until a message with label msgtag has arrived from tid. literally just sits there waiting, main character energy, not moving. then pvm_recv places that message in a new active receive buffer, which also clears the current receive buffer. out with the old, in with the new. β¨
A -1 in msgtag or tid matches anything. this gives you the following options, bestie:
- If
tid = -1andmsgtagis defined by the user, thenpvm_recvwill accept a message from any process which has a matchingmsgtag. - If
msgtag = -1andtidis defined by the user, thenpvm_recvwill accept any message that is sent from processtid. - If
tid = -1andmsgtag = -1, thenpvm_recvwill accept any message from any process. wildcard slay. π
the PVM model guarantees the following about message order, and this is important so listen up:
If task 1 sends message A to task 2, then task 1 sends message B to task 2, message A will arrive at task 2 before message B.
moreover, if both messages arrive before task 2 does a receive, then a wildcard receive will always return message A. first come, first served, periodt.
if pvm_recv is successful, bufid will be the value of the new active receive buffer identifier. if some error occurs then bufid will be < 0. π
pvm_recv is blocking, which means the routine waits until a message matching the user specified tid and msgtag values arrives at the local pvmd. but if the message has already arrived, then pvm_recv returns immediately with the message. no waiting, we ate. π₯
once pvm_recv returns, the data in the message can be unpacked into the user's memory using the unpack routines. that's your next step, go unpack that bag. π«Ά
π EXAMPLES π
C:
tid = pvm_parent();
msgtag = 4 ;
bufid = pvm_recv( tid, msgtag );
info = pvm_upkint( tid_array, 10, 1 );
info = pvm_upkint( problem_size, 1, 1 );
info = pvm_upkfloat( input_array, 100, 1 );
Fortran:
CALL PVMFRECV( -1, 4, BUFID )
CALL PVMFUNPACK( INTEGER4, TIDS, 25, 1, INFO )
CALL PVMFUNPACK( REAL8, MATRIX, 100, 100, INFO )
π ERRORS π
these error conditions can be returned by pvm_recv:
PvmBadParamβ giving an invalidtidvalue, ormsgtag < -1. yeah that's a you problem, bestie. πPvmSysErrβpvmdnot responding. ghosting, but make it a daemon. π
π SEE ALSO π
pvm_bufinfo(3PVM), pvm_getminfo(3PVM), pvm_nrecv(3PVM), pvm_unpack(3PVM), pvm_probe(3PVM), pvm_send(3PVM), pvm_mcast(3PVM)
okay that's the whole page, you're officially a receive-buffer girlie now π§π this was PVM Version 3.4, dated 30 August, 1993 β old money, still slaying. go forth and pvm_recv, bestie!! π
ππ
π¦ 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