Newsgroups: comp.parallel.mpi
From: Marcus Marr <marr@dcs.ed.ac.uk>
Subject: Re: Discarding Messages
Organization: Computer Systems Group, The University of Edinburgh
Date: Wed, 18 Jan 1995 17:02:57 GMT
Message-ID: <MARR.95Jan18170257@havra.dcs.ed.ac.uk>


In my original posting I asked:
marr> Is it possible for a process to discard a message that has been sent
marr> to it without knowing its datatype?  
marr> 
marr> Ideally, I am looking for a function:
marr> 	int MPI_Discard(int source, int tag, MPI_Comm comm);

To which Raja Daoud replied, suggesting I use the MPI_PACKED datatype
to receive the message (thanks Raja).  The code he presented, however,
assumed that a maximum message size was known beforehand.  One
improvement would be to query the return status to find the actual
size of the message so that a buffer of the correct size could be
created.  This leads to my next question:

    What is the defined behaviour of the MPI_Get_count() and
    MPI_Get_elements() functions when given MPI_PACKED as a datatype?

I would hope that either or both of these functions would return the
number of bytes in the message, as the LAM-MPI implementation does,
but is this the behaviour defined in the standard?

If the standard leaves the behaviour undefined, is there an
alternative way of discarding messages which does fit the standard?

Marcus.


