Newsgroups: comp.parallel.mpi
From: Rob Neely <neely>
Subject: Waiting only on last requestor between two procs
Organization: Lawrence Livermore National Laboratory
Date: 23 Oct 1995 23:04:18 GMT
Mime-Version: 1.0
Content-Type: text/plain
Content-Transfer-Encoding: 7bit
Message-ID: <46h71i$aia@lll-winken.llnl.gov>

Hello all, 

MPI guarantees that messages between two processors will be
received in the same order that they are sent, correct?

In that case, is it legal to "throw away" non-blocking communication
requestors except for the one corresponding to the last message?
The assumption being that if the last communication between the two
processors completed, then the ones prior necessarily must have.

For example, suppose the following code runs on the receiving
processor.  Assume that another processor has sent the four
messages (ie - all messages are coming from the same source):

---------------

    MPI_IRecv(buf0, count, MPI_FLOAT, source, tag, MPI_COMM_WORLD, &req[0]) ;
    MPI_IRecv(buf1, count, MPI_FLOAT, source, tag, MPI_COMM_WORLD, &req[1]) ;
    MPI_IRecv(buf2, count, MPI_FLOAT, source, tag, MPI_COMM_WORLD, &req[2]) ;
    MPI_IRecv(buf3, count, MPI_FLOAT, source, tag, MPI_COMM_WORLD, &req[3]) ;

    /* Do some other stuff */

#if THIS_SHORTCUT_WORKS

    MPI_Wait(req[3], &status) ;

#else 

    MPI_Waitall(4, req, statuses) ;

#endif

    /* Go on */

---------------

This of course assumes that you're going to sacrifice checking
the statuses of each message (in exchange for potentially significant
performance gains).  Are there any other pitfalls to doing this?

Thanks.

--Rob Neely, LLNL


