Great! qualifying the Recv with node == 1 works, that was the issue.
Thanks!!
On 11/1/05, dennis lastor <dennis.lastor_at_[hidden]> wrote:
>
> 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,
>
> _______________________________________________
> This list is archived at http://www.lam-mpi.org/MailArchives/lam/
>
|