GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
RECVF(3PVM) PVM Version 3.4 RECVF(3PVM)

pvm_recvf - Redefines the comparison function used to accept messages.

C	int (*old)() = pvm_recvf( int (*new)( int bufid, int tid, int tag ))

Fortran NOT AVAILABLE

The routine pvm_recvf defines the comparison function to be used by the pvm_recv, pvm_nrecv, and pvm_probe functions. It is available as a means to customize PVM message passing. 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

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 default comparison function evaluates the source and message tag associated with all incoming messages.

tid
Integer task identifier of sending process supplied by the user.
tag
Integer message tag supplied by the user.
bufid
Integer message buffer identifier.

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.

Implementing message probe with recvf, using our matching function to return information in a global variable.
#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;
}

No error conditions are returned by pvm_recvf

pvm_bufinfo(3PVM), pvm_getminfo(3PVM), pvm_recv(3PVM), pvm_nrecv(3PVM), pvm_probe(3PVM), pvm_trecv(3PVM)
30 August, 1993

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.