[mpich-discuss] error recieving

Gustavo Correa gus at ldeo.columbia.edu
Fri Jan 3 15:19:35 CST 2014


Was the runtime error a segmentation fault?
Apparently your recv_buff is too small.

On Jan 3, 2014, at 2:35 AM, Soheil Hooshdaran wrote:

> Hi.
> What's wrong with my code?
> 	•   char send_buf[12]  = "hello world";
> 	•   char send_buf2[12]  = "hello iran";
> 	•   char recv_buf[10];
> 	•   int i;
> 	•   for(i=0;i<10;++i)
> 	•   if (world_rank == 0) {
> 	•     MPI_Send(send_buf, 12, MPI_CHAR, 1, 0, MPI_COMM_WORLD);
> 	•     //MPI_Send(send_buf2, 12, MPI_INT, 1, 1, MPI_COMM_WORLD);
> 	•   } else if (world_rank == 1) {
> 	•     MPI_Recv(recv_buf, 12, MPI_CHAR, 0, 0, MPI_COMM_WORLD, MPI_STATUS_IGNORE);
> 	•     printf("Process 1 received %s from process 0\n", recv_buf);
> 	•   }
>   
> Run-time errors are very hard to fix!Help me please
> 
> Thanks in advance
> Soheil Hooshdaran
> _______________________________________________
> discuss mailing list     discuss at mpich.org
> To manage subscription options or unsubscribe:
> https://lists.mpich.org/mailman/listinfo/discuss




More information about the discuss mailing list