
There seems to be a mistake in the text concerning example 2.25.  The
program does not match the description in the text.  It seems likely
that the program is wrong: the point of this section is to demonstrate
how you can send two messages from one process to another and force
them to be received in the opposite order (safely).  The program as it
is written instead does an exchange between the two processes.  The
program shown in the first edition of the book seems to be right, and
the text is almost identical to the second edition.  I will go by the
program from the first edition:

 http://netlib2.cs.utk.edu/utk/papers/mpi-book/node57.html



CALL MPI_COMM_RANK(comm, rank, ierr)
IF (rank.EQ.0) THEN
    CALL MPI_SEND(sendbuf1, count, MPI_REAL, 1, 1, comm, ierr)
    CALL MPI_SEND(sendbuf2, count, MPI_REAL, 1, 2, comm, ierr)
ELSE     ! rank.EQ.1
    CALL MPI_IRECV(recvbuf2, count, MPI_REAL, 0, 2, comm, req1, ierr)
    CALL MPI_IRECV(recvbuf1, count, MPI_REAL, 0, 1, comm, req2, ierr)
    CALL MPI_WAIT(req1, status, ierr)
    CALL MPI_WAIT(req2, status, ierr)
END IF

