RECV(3PVM)

πŸ“¦ version 3.4.6, in debian bookworm, ubuntu jammy

πŸ’Œ 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. msgtag should 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 = -1 and msgtag is defined by the user, then pvm_recv will accept a message from any process which has a matching msgtag.
  • If msgtag = -1 and tid is defined by the user, then pvm_recv will accept any message that is sent from process tid.
  • If tid = -1 and msgtag = -1, then pvm_recv will 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 invalid tid value, or msgtag < -1. yeah that's a you problem, bestie. 😭
  • PvmSysErr β€” pvmd not 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