One difference is that putting a blocking send before the irecv is a classic "unsafe" MPI program. It depends on eager send buffering to complete the MPI_Send so the MPI_Irecv can be posted. The example with MPI_Send first would be allowed to hang.

The original program is correct and safe MPI.


Dick Treumann - MPI Team
IBM Systems & Technology Group
Dept X2ZA / MS P963 -- 2455 South Road -- Poughkeepsie, NY 12601
Tele (845) 433-7846 Fax (845) 433-8363


users-bounces@open-mpi.org wrote on 02/05/2009 05:48:34 AM:

> [image removed]

>
> Re: [OMPI users] MPI_Test bug?

>
> Gabriele Fatigati

>
> to:

>
> Open MPI Users

>
> 02/05/2009 05:49 AM

>
> Sent by:

>
> users-bounces@open-mpi.org

>
> Please respond to Open MPI Users

>
> Hi Jody,
> thanks four your quick reply. But what's the difference?
>
> 2009/2/5 jody <jody.xha@gmail.com>:
> > Hi Gabriele
> >
> > Shouldn't you reverse the order of your send and recv from
> >    MPI_Irecv(buffer_recv, bufferLen, MPI_INT, recv_to, tag,
> > MPI_COMM_WORLD, &request);
> >    MPI_Send(buffer_send, bufferLen, MPI_INT, send_to, tag, MPI_COMM_WORLD);
> >
> > to
> >
> >    MPI_Send(buffer_send, bufferLen, MPI_INT, send_to, tag, MPI_COMM_WORLD);
> >    MPI_Irecv(buffer_recv, bufferLen, MPI_INT, recv_to, tag,
> > MPI_COMM_WORLD, &request);
> >
> > ?
> > Jody
> >
> > On Thu, Feb 5, 2009 at 11:37 AM, Gabriele Fatigati
> <g.fatigati@cineca.it> wrote:
> >> Dear OpenMPI developer,
> >> i have found a very strange behaviour of MPI_Test. I'm using OpenMPI
> >> 1.2 over Infiniband interconnection net.
> >>
> >> I've tried to implement net check with a series of MPI_Irecv and
> >> MPI_Send  beetwen processors, testing with MPI_Wait the end of Irecv.
> >> For strange reasons, i've noted that, when i launch the test in one
> >> node, it works well. If i launch over 2 or more procs over different
> >> nodes, MPI_Test fails many time before to tell that the IRecv is
> >> finished.
> >>
> >> I've tried that it fails also after one minutes, with very small
> >> buffer( less than eager limit). It's impossible that the communication
> >> is pending after one minutes, with 10 integer sended. To solve this,
> >> I need to implement a loop over MPI_Test, and only after 3 or 4
> >> MPI_Test it returns that IRecv finished successful. Is it possible
> >> that MPI_Test needs to call many time also if the communication is
> >> already finished?
> >>
> >> In attach you have my simple C test program.
> >>
> >> Thanks in advance.
> >>
> >> --
> >> Ing. Gabriele Fatigati
> >>
> >> Parallel programmer
> >>
> >> CINECA Systems & Tecnologies Department
> >>
> >> Supercomputing Group
> >>
> >> Via Magnanelli 6/3, Casalecchio di Reno (BO) Italy
> >>
> >> www.cineca.it                    Tel:   +39 051 6171722
> >>
> >> g.fatigati [AT] cineca.it
> >>
> >> _______________________________________________
> >> users mailing list
> >> users@open-mpi.org
> >> http://www.open-mpi.org/mailman/listinfo.cgi/users
> >>
> > _______________________________________________
> > users mailing list
> > users@open-mpi.org
> > http://www.open-mpi.org/mailman/listinfo.cgi/users
> >
> >
>
>
>
> --
> Ing. Gabriele Fatigati
>
> Parallel programmer
>
> CINECA Systems & Tecnologies Department
>
> Supercomputing Group
>
> Via Magnanelli 6/3, Casalecchio di Reno (BO) Italy
>
> www.cineca.it                    Tel:   +39 051 6171722
>
> g.fatigati [AT] cineca.it
> _______________________________________________
> users mailing list
> users@open-mpi.org
> http://www.open-mpi.org/mailman/listinfo.cgi/users