RECVF(3PVM)
π RECVF β bestie edition π
okay so this is pvm_recvf, from the PVM Version 3.4 manual, section 3PVM. it lives in the C world only, and it's about β¨customizing how PVM decides which message you're actually receivingβ¨. no cap, it's a whole vibe.
π NAME π
pvm_recvf β redefines the comparison function used to accept messages. that's it, that's the girl. π
β¨ SYNOPSIS β¨
C only, bestie:
int (*old)() = pvm_recvf( int (*new)( int bufid, int tid, int tag ))
Fortran: NOT AVAILABLE π« β nope, not today, not ever, sorry to the Fortran girlies.
π¦ DESCRIPTION π¦
so pvm_recvf defines the comparison function that pvm_recv, pvm_nrecv, and pvm_probe are gonna use. it exists as a way to customize PVM message passing β like, make it yours. pvm_recvf sets a user-supplied comparison function to evaluate messages for receiving.
recvf returns the old value of the matching function, or 0 if the old function was the default matcher. so you can swap it out and swap it back, iykyk. π
real talk tho:pvm_recvfis intended for sophisticated C programmers who understand the function of such routines (likesignal) and who require a receive routine that can match on more complex message contexts than the default provides. it's giving advanced. it's giving main character energy. don't come in here unprepared. π
πΈ MATCHING FUNCTION πΈ
the default comparison function evaluates the source and message tag associated with all incoming messages.
π PARAMETERS π
tidβ Integer task identifier of sending process supplied by the user.tagβ Integer message tag supplied by the user.bufidβ Integer message buffer identifier.
and the matching function should return:
< 0β Return immediately with this error code. πββοΈ0β Do not pick this message. π1β Pick this message and do not scan the rest. π> 1β Pick this highest ranked message after scanning them all. β
like, that's the whole scoring system. it's basically a vibe check for messages.
π EXAMPLES π
Implementing message probe with recvf, using our matching function to return information in a global variable. iconic behavior honestly.
#include <pvm3.h>
static int foundit = 0;
static int
foo_match(mid, tid, tag)
int mid;
int tid;
int tag;
{
int t, c;
struct pvmminfo header;
pvm_getminfo(mid, &header);
if ((tid == -1 || tid == header.src) && (tag == -1 || tag == header.tag))
foundit = 1;
return 0;
}
int
probe(src, tag)
{
int (*omatch)();
int cc;
omatch = pvm_recvf(foo_match);
foundit = 0;
if ((cc = pvm_nrecv(src, tag)) < 0)
return cc;
pvm_recvf(omatch);
return foundit;
}
π ERRORS π
No error conditions are returned by pvm_recvf. not a single one. she's unproblematic fr fr. π«Ά
π SEE ALSO π
pvm_bufinfo(3PVM)pvm_getminfo(3PVM)pvm_recv(3PVM)pvm_nrecv(3PVM)pvm_probe(3PVM)pvm_trecv(3PVM)
and that's the whole page, bestie!! πβ¨
this was PVM Version 3.4, and the page is dated 30 August, 1993 β yeah she's a vintage queen and she still slays. π go match some messages. π π
π¦ 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