RECV(3PVM)

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

✨ NAME ✨

omg hi bestie, welcome to RECV(3PVM) β€” the manual page for pvm_recv from PVM Version 3.4. It's giving "receive a message" and honestly? iconic. πŸŽ€

pvm_recv - Receive a message. That's the whole NAME section, periodt. πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

C    int bufid = pvm_recv( int tid, int msgtag )

Fortran   call pvmfrecv( tid, msgtag, bufid )

πŸŽ€ PARAMETERS πŸŽ€

  • tid β€” Integer task identifier of sending process supplied by the user. Like, who sent this? tid knows. πŸ‘€
  • msgtag β€” Integer message tag supplied by the user. msgtag should be >= 0. (The wildcard -1 lore is coming, don't worry. πŸ¦‹)
  • bufid β€” Integer returns the value of the new active receive buffer identifier. Values less than zero indicate an error. So if bufid is negative, it's not slay, it's a problem. πŸ’€

πŸ’… DESCRIPTION πŸ’…

Okay so pvm_recv is the moment you block your process until a message with label msgtag has arrived from tid. Then it places that message in a new active receive buffer, and that also clears the current receive buffer. New buffer, who dis? ✨

A -1 in msgtag or tid matches anything. This gives you these 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 chaos, but make it correct. 🌈

The PVM model guarantees the following about message order, and this part is important, no cap. 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. The queue is queued. πŸ‘‘

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. Simple as that. 😭

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. If the message has already arrived then pvm_recv returns immediately with the message. So it's not ghosting you, it's literally waiting by the phone. ☎️

Once pvm_recv returns, the data in the message can be unpacked into the user's memory using the unpack routines. That's your cue to unpack, bestie. πŸŽ€


🌈 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. 🚩
  • PvmSysErr β€” pvmd not responding. πŸ’€

πŸ”₯ SEE ALSO πŸ”₯

  • pvm_bufinfo(3PVM)
  • pvm_getminfo(3PVM)
  • pvm_nrecv(3PVM)
  • pvm_unpack(3PVM)
  • pvm_probe(3PVM)
  • pvm_send(3PVM)
  • pvm_mcast(3PVM)

mwah πŸ’‹ that's the whole RECV(3PVM) manual page, bestie β€” from PVM Version 3.4, dated 30 August, 1993, and yes, it's still giving main character energy. bye 🫢

πŸ“¦ where this page comes from