Newsgroups: comp.parallel.mpi
From: rdaoud@magnus.acs.ohio-state.edu (Raja B Daoud)
Subject: Re: Discarding Messages
Organization: Ohio Supercomputer Center
Date: 17 Jan 1995 07:26:08 GMT
Message-ID: <3ffreg$rpu@charm.magnus.acs.ohio-state.edu>

Marcus Marr <marr@dcs.ed.ac.uk> wrote:
>Is it possible for a process to discard a message that has been sent
>to it without knowing its datatype?  
>
>Ideally, I am looking for a function:
>	int MPI_Discard(int source, int tag, MPI_Comm comm);

Page 85, line25:

"A message sent with any type (including MPI_PACKED) can be received using
the type MPI_PACKED."

So the discard function may look like:

	for (flag = 1; flag; ) {
		MPI_Iprobe(source, tag, comm, &flag, &status);
		if (flag) {
			MPI_Recv(buf, count, MPI_PACKED, status.MPI_SOURCE,
					status.MPI_TAG, comm, &status);
		}
	}

making sure the buffer is big enough.

--Raja

-=-
Raja Daoud				raja@osc.edu
Ohio Supercomputer Center		http://www.osc.edu/lam.html

