PROBE(3PVM)
π PROBE(3PVM) β pvm_probe π
okay bestie, sit down, hydrate, and let me tell you about pvm_probe from PVM Version 3.4. this one's a little detective. she doesn't grab your mail, she just peeks at the mailbox and goes "yeah something's in there" π΅οΈβοΈβ¨
β¨ NAME β¨
pvm_probe β check if message has arrived. that's it. that's the whole job. she's nosy, not pushy. π
πΈ SYNOPSIS πΈ
C:
int bufid = pvm_probe( int tid, int msgtag )
Fortran:
call pvmfprobe( tid, msgtag, bufid )
π PARAMETERS π
tidβ integer task identifier of the sending process, supplied by you, the user. πmsgtagβ integer message tag, also supplied by you. and bestie,msgtagshould be>= 0. no cap.bufidβ integer that returns the value of the new active receive buffer identifier. if it comes back less than zero? that's an error, babes. values less than zero indicate an error. π
π¦ DESCRIPTION π¦
so pvm_probe checks whether a message with label msgtag has arrived from tid. that's the vibe check. if a matching message has arrived, pvm_probe hands you back a buffer identifier in bufid. and that bufid is lowkey a key π β you can use it with pvm_bufinfo to find out info about the message, like its source and its length.
if the message you asked about hasn't arrived yet? pvm_probe comes back with a 0 in bufid. not an error, just a "nope, not yet, keep scrolling." and if some error happens, bufid will be < 0. π
now here's the part that's giving flexibility. a -1 in msgtag or tid matches anything. so you get these options:
- if
tid = -1andmsgtagis defined by you, thenpvm_probewill accept a message from any process that has a matchingmsgtag. - if
msgtag = -1andtidis defined by you, thenpvm_probewill accept any message that is sent from processtid. - if
tid = -1andmsgtag = -1, thenpvm_probewill accept any message from any process. wildcard mode activated, main character energy. π
also, you can call pvm_probe multiple times to check if a given message has arrived yet. keep peeking, it's fine. BUT β and this is the important part β after the message has arrived, pvm_recv must be called before the message can be unpacked into your memory using the unpack routines. probe is the peek, pvm_recv is the actual grab. don't skip the grab. π«Ά
π« 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
see how the else branch is literally just "go do other computing"? that's the whole point. probe is non-blocking, she does not wait around. she has places to be. π β¨
π₯ ERRORS π₯
these error conditions can be returned by pvm_probe. bestie, write these down:
PvmBadParamβ you gave an invalidtidvalue ormsgtag. oops. πPvmSysErrβpvmdnot responding. the daemon ghosted you. π
π SEE ALSO π
pvm_bufinfo(3PVM), pvm_getminfo(3PVM), pvm_nrecv(3PVM), pvm_recv(3PVM), pvm_unpack(3PVM)
go read those next, bestie, they're all part of the same lil message-handling friend group. π§
and that's the page!! this one's from PVM Version 3.4, dated 30 August, 1993 β yeah she's an old queen but she still slays ππ if you made it to the bottom of this manpage, congrats, you're literally the moment. mwah πβ¨
π¦ 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