RECVFSection: PVM Version 3.4 (3PVM)Updated: 30 August, 1993 |
RECVFSection: PVM Version 3.4 (3PVM)Updated: 30 August, 1993 |
C int (*old)() = pvm_recvf( int (*new)( int bufid, int tid, int tag ))
Fortran NOT AVAILABLE
recvf returns the old value of the matching function, or 0 if the old function was the default matcher
pvm_recvf is intended for sophisticated C programmers who understand the function of such routines (like signal) and who require a receive routine that can match on more complex message contexts than the default provides.
The matching function should return:
Value Action taken
< 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.
#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; }