PROBE(3PVM)

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

πŸ’… NAME πŸ’…

pvm_probe β€” bestie, it literally checks if your message has arrived. that's it, that's the whole job 🫢


✨ SYNOPSIS ✨

C:

int bufid = pvm_probe( int tid, int msgtag )

Fortran:

call pvmfprobe( tid, msgtag, bufid )

πŸŽ€ PARAMETERS πŸŽ€

  • tid β€” an Integer task identifier for the sending process, and it's supplied by you, the user πŸ’–
  • msgtag β€” an Integer message tag, also supplied by you. heads up: msgtag should be >= 0.
  • bufid β€” an Integer that returns the value of the new active receive buffer identifier. anything less than zero = an error, no cap.

🌸 DESCRIPTION 🌸

okay so the routine pvm_probe checks whether a message with label msgtag has arrived from tid. if a matching message has arrived, pvm_probe hands you back a buffer identifier in bufid. and the way that you can then use that bufid with pvm_bufinfo to find out stuff about the message, like its source and its length? iconic. πŸ‘‘

if the message you asked for has not arrived yet, then pvm_probe comes back with a 0 in bufid. and if some error happens, bufid will be < 0. 😭

now this is the part where it gets fun β€” a -1 in msgtag or tid matches anything. literally anything. so that gives you these options, bestie:

  • if tid = -1 and msgtag is defined by the user, then pvm_probe will accept a message from any process which has a matching msgtag ✨
  • if msgtag = -1 and tid is defined by the user, then pvm_probe will accept any message that is sent from process tid 🌈
  • if tid = -1 and msgtag = -1, then pvm_probe will accept any message from any process. wild. πŸ¦‹

also, pvm_probe can be called multiple times to check if a given message has arrived yet. but here's the thing β€” after the message has arrived, pvm_recv must be called before the message can be unpacked into your memory using the unpack routines. so don't skip that step, okay? it's giving mandatory. πŸ’…


🧚 EXAMPLES 🧚

C:

tid = pvm_parent();
msgtag = 4 ;
arrived = pvm_probe( tid, msgtag );
if ( arrived )
     info = pvm_bufinfo( arrived, &len, &tag, &tid );
else
     /* go do other computing */

Fortran:

CALL PVMFPROBE( -1, 4, ARRIVED )
IF ( ARRIVED .GT. 0 ) THEN
     CALL PVMFBUFINFO( ARRIVED, LEN, TAG, TID, INFO )
ELSE
*         GO DO USEFUL WORK
ENDIF

πŸ’€ ERRORS πŸ’€

these error conditions can be returned by pvm_probe. keep them in mind, fr fr.

  • PvmBadParam β€” you gave an invalid tid value or msgtag. πŸ™ˆ
  • PvmSysErr β€” pvmd not responding. it's not ghosting you, it's just... not responding. 😭

πŸ‘‘ SEE ALSO πŸ‘‘

pvm_bufinfo(3PVM), pvm_getminfo(3PVM), pvm_nrecv(3PVM), pvm_recv(3PVM), pvm_unpack(3PVM)


and that's the whole page, bestie 🫢 this was PVM Version 3.4, dated 30 August, 1993 β€” yeah she's vintage but she ATE and left no crumbs. periodt. πŸ’–βœ¨πŸŽ€
πŸ“¦ where this page comes from