[Mpi-comments] mpi-comments Digest, Vol 8, Issue 1

HOLMES Daniel d.holmes at epcc.ed.ac.uk
Thu Sep 13 09:48:34 CDT 2018


Hi Alain,

I could not find anything explicitly stating that MPI_Iprobe would
initiate a receive the way MPI_Irecv does.

This is because the probe functions do not initiate a receive the way a receive does; they only probe the matching list and report back to the user but do not change what they find there.

Your modified example is guaranteed to deadlock using any standard-conforming MPI library. The MPI_SSEND must not complete before a matching receive operation has been started and has matched. The matching receive operation (the MPI_IRECV in rank 1) cannot be reached because the MPI_RECV must not complete before a matching send operation has been started. The matching send operation (the MPI_SEND in rank 0) cannot be reached because the MPI_SSEND is blocked. The MPI_IPROBE is not a receive operation and does not cause a match to happen - it is therefore not relevant to the deadlock situation described above.

Your modified example can be fixed by replacing MPI_IPROBE with MPI_MPROBE (note this a blocking function) and replacing MPI_IRECV with MPI_IMRECV, although a nonblocking function immediately followed by a call to MPI_WAIT is better expressed by a blocking function, i.e. MPI_MRECV in this case.

The example must use the blocking MPI_MPROBE rather than the nonblocking MPI_IMPROBE because the match for the MPI_SSEND must occur before the MPI_RECV can complete (because that requires the MPI_SEND to be reached in rank 0, which requires that the MPI_SSEND completes, which requires that it must have been matched in rank 1, which requires that the mprobe must be complete not just started).

Cheers,
Dan.
—
Dr Daniel Holmes PhD
Applications Consultant in HPC Research
d.holmes at epcc.ed.ac.uk<mailto:d.holmes at epcc.ed.ac.uk>
Phone: +44 (0) 131 651 3465
Mobile: +44 (0) 7940 524 088
Address: Room 2.09, Bayes Centre, 47 Potterrow, Central Area, Edinburgh, EH8 9BT
—
The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336.
—

On 13 Sep 2018, at 15:08, mpi-comments-request at lists.mpi-forum.org<mailto:mpi-comments-request at lists.mpi-forum.org> wrote:

----- Original Message -----

Hi,
(text location provided w.r.t MPI 3.1 https://www.mpi-forum.org/docs/mpi-3.1/mpi31-report.pdf)

a) In 3.2.4, page 29, there is a discussion regarding the size of the
buffer and size of the actual message with an "advice to users" section
stating that :
"The MPI_PROBE function described in Section 3.8 can be used to receive
messages of unknown length."

b) There is no such discussion in 3.7.2 so one could assume (maybe too
optimistically) that the same advice applies w.r.t. MPI_Iprobe.

c) In 3.8.1. page 66 line 9 "The MPI implementation of MPI_PROBE and
MPI_IPROBE needs to guarantee progress: [calling those functions, msg
should arrive eventually if send and not intercepted].

d) The "Progress" note in 3.7.4, illustrated by example 3.14, seems to
indicate that a synchronous send can not be blocked if a recv has been
posted regardless of the completion of that receive.

But I could not find anything explicitly stating that MPI_Iprobe would
initiate a receive the way MPI_Irecv does.
That is, a slightly modified 3.14 example:
CALL MPI_COMM_RANK(comm, rank, ierr)
IF (RANK.EQ.0) THEN
   CALL MPI_SSEND(a, n, MPI_REAL, 1, 0, comm, ierr)
   CALL MPI_SEND(b, 1, MPI_REAL, 1, 1, comm, ierr)
ELSE IF (rank.EQ.1) THEN
   CALL MPI_IPROBE(0, 0, comm, flag, status1, ierr)
   CALL MPI_RECV(b, 1, MPI_REAL, 0, 1, comm, status2, ierr)
   ... extract size info from status1  once available ....
   CALL MPI_IRECV(a, n, MPI_REAL, 0, 0, comm, r, ierr)
   CALL MPI_WAIT(r, status, ierr)
END IF

could deadlock in a correct MPI implementation.

If I am correct in assuming that the MPI standard ask for the MPI_Iprobe
to progress, it is not required to initiate. If true, it means the the
point a) above does not extend to the non blocking communications and
that the MPI does not provide a way to receive messages of unknown size
whithout adding more opportunities for deadlocks.
Am I correct ? and if yes, does that indicate that the discussion and
advice of point a could be adapted and explicitly added for the non
blocking case (point b).
Thanks

Alain

End of mpi-comments Digest, Vol 8, Issue 1
******************************************

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mpi-forum.org/pipermail/mpi-comments/attachments/20180913/17e3ef08/attachment-0001.html>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: not available
URL: <http://lists.mpi-forum.org/pipermail/mpi-comments/attachments/20180913/17e3ef08/attachment-0001.ksh>


More information about the mpi-comments mailing list