LAM/MPI logo

LAM/MPI General User's Mailing List Archives

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

From: dennis lastor (dennis.lastor_at_[hidden])
Date: 2005-11-01 14:34:06


I am trying to pass a 1D array using MPI_Send / MPI_Recv. The array
gets passed properly, but then it appears as if I hang on the receive.
 Here is a snippet of the code I am using:

float node0[400];
....
float data_buf[400];

if (node == 0) {
.....
.....
  node1[0] = 0.1;
  node1[1] = 0.4;
  node1_cnt = 2;
  MPI_Send( &node1 , node1_cnt, MPI_FLOAT, 1, 1, comm_2d);

}//while still master

    MPI_Recv( data_buf , 2, MPI_FLOAT, 0, 1, comm_2d, NULL);
    printf("BUFFER %f %f \n",data_buf[0],data_buf[1]);

  MPI_Finalize();
}

I get the following output:

 BUFFER 0.100000 0.400000

Which implies that the receive completed, but then it hangs.

Any feedback would be greatly appreciated.
Thanks in advance,