LAM/MPI logo

LAM/MPI General User's Mailing List Archives

  |   Home   |   Download   |   Documentation   |   FAQ   |   all just in this list

From: Davide Cesari (dcesari_at_[hidden])
Date: 2003-05-27 00:28:06


Hi, Martin

On Mon, 26 May 2003, Martin Dimitrov wrote:

> I am a beginner in MPI and I am following the examples of an MPI
> tutorial.
> However I cannot execute the examples. Please help.
>
> The following example was supposed to execute to completion everytime.
> It was not supposed to deadlock. However it deadlocks. Can you please
> tell me what am I doing wrong.

...

> if(myrank == 0){ /*receive a message, then send*/
> MPI_Irecv(b, 100, MPI_DOUBLE, 1, 19, MPI_COMM_WORLD, &request);
> MPI_Send(a, 100, MPI_DOUBLE, 1, 17, MPI_COMM_WORLD);
> MPI_Wait(&request, &status);
> }
> if(myrank == 1){ /*send a message, then receive*/
> MPI_Irecv(b, 100, MPI_DOUBLE, 1, 17, MPI_COMM_WORLD, &request);
> MPI_Send(a, 100, MPI_DOUBLE, 1, 19, MPI_COMM_WORLD);
> MPI_Wait(&request, &status);
> }
_________________________________^^_____
the error is that rank 1 is sending and receiving to and from itself, not
to and from rank 0.

        best regards, Davide