[mpich-discuss] Generalized request classes

Jed Brown jedbrown at mcs.anl.gov
Mon Aug 5 12:08:24 CDT 2013


Rajeev Thakur <thakur at mcs.anl.gov> writes:

> If the sizes of messages are that unknown, you can also try MPI
> one-sided communication.

I'd have thought the reason to use Iprobe was that the receive buffers
could not be allocated in advance, in which case one-sided puts don't
buy you anything and gets require the sizes and addresses to be sent
somehow.

> On Aug 5, 2013, at 9:48 AM, Matthieu Dorier wrote:
>
>> For the Iprob, the case I'm considering is indeed the one where a
>> process has to do non-blocking sends and non-blocking receives of
>> undefined lengths; I ended up with two options: 1) using a busy loop
>> that does an MPI_Testany for the list of send requests and a series
>> of MPI_Iprob for a list of (source,tag) pairs, or 2) split each
>> receive operation into one Irecv of known length 1 MPI_INT that gives
>> the size of the next message, then a blocking MPI_Recv of this
>> size. No busy loop needed by one extra (yet small) message.

A third option is to MPI_Probe on MPI_ANY_SOURCE for the expected number
of receives, allocating your receive buffer when you know the size.
This assumes you can use a single tag for the round of communication.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 835 bytes
Desc: not available
URL: <http://lists.mpich.org/pipermail/discuss/attachments/20130805/b701df1e/attachment.sig>


More information about the discuss mailing list