[mpich-discuss] Generalized request classes

Rajeev Thakur thakur at mcs.anl.gov
Mon Aug 5 12:21:30 CDT 2013


One more thing. If the receive buffers can be allocated before hand to be large enough, you can simply post a receive of a large size. It doesn't have to match the send size. It can be larger (not smaller).

On Aug 5, 2013, at 12:08 PM, Jed Brown wrote:

> 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.




More information about the discuss mailing list