<HTML><HEAD>
<META content="text/html; charset=utf-8" http-equiv=Content-Type></HEAD>
<BODY>
<DIV>
<DIV style="FONT-SIZE: 11pt; FONT-FAMILY: Calibri,sans-serif">Thanks for the response. Actually I was using float as the data type in the program whereas MPI_DOUBLE is used in communication.. That has been the reason<BR>Serializing means assigning a tag?<BR><BR>Sent from my Windows phone</DIV></DIV>
<DIV dir=ltr>
<HR>
<SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: Calibri,sans-serif; FONT-WEIGHT: bold">From: </SPAN><SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: Calibri,sans-serif"><A href="mailto:balaji@mcs.anl.gov">Pavan Balaji</A></SPAN><BR><SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: Calibri,sans-serif; FONT-WEIGHT: bold">Sent: </SPAN><SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: Calibri,sans-serif">‎12/‎25/‎2013 22:14</SPAN><BR><SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: Calibri,sans-serif; FONT-WEIGHT: bold">To: </SPAN><SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: Calibri,sans-serif"><A href="mailto:discuss@mpich.org">discuss@mpich.org</A></SPAN><BR><SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: Calibri,sans-serif; FONT-WEIGHT: bold">Subject: </SPAN><SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: Calibri,sans-serif">Re: [mpich-discuss] MPI_Send/MPI_Recv - getting delayed indeffinitely</SPAN><BR><BR></DIV><BR>Conceptually, I don’t see anything wrong with the code snippet.  There is a performance problem since you are serializing the MPI_Recv’s at the master.  So it cannot receive data from worker2 before it receives data from worker1, even if worker2 is ready earlier.  That’ll lose some performance, but it should not affect correctness (and for a 3 node program, you might not care about it anyway).<BR><BR>The segmentation fault might be an issue with the serial part of your code.  Typically this means you didn’t allocate enough memory somewhere.  Did you try running the processes with a debugger?<BR><BR>Instead of doing:<BR><BR>% mpiexec -n 3 ./foo<BR><BR>try this:<BR><BR>% mpiexec -n 3 ddd ./foo<BR><BR>“ddd” is a frontend for gdb and will open a different debugging screen for each process.<BR><BR>  — Pavan<BR><BR>On Dec 23, 2013, at 8:04 PM, Madhawa Bandara <madawa911@gmail.com> wrote:<BR><BR>> <BR>> Hi,<BR>> <BR>> I use mpich2 on a small cluster of 3 nodes and each node has Ubuntu 12.04 installed. I use this cluster to do the following.<BR>> <BR>> 1. Master node send some matrices to the 2 workers<BR>> 2. Workers perform some calculations and send the resulted matrices back to the master.<BR>> 3. Master perform some final calculations.<BR>> <BR>> code snippet:<BR>> <BR>> //master(taskid=0)<BR>> <BR>>  MPI_Send(ha11, n / 2 * n / 2, MPI_DOUBLE, 1, 1, MPI_COMM_WORLD); //to worker 1<BR>>  MPI_Send(ha11, n / 2 * n / 2, MPI_DOUBLE, 2, 1, MPI_COMM_WORLD); //to worker 2<BR>> <BR>> <BR>>  MPI_Recv(hM1, n / 2 * n / 2, MPI_DOUBLE, 1, 2, MPI_COMM_WORLD,&status); //from worker 1<BR>>  MPI_Recv(hM2, n / 2 * n / 2, MPI_DOUBLE, 2, 2, MPI_COMM_WORLD,&status);//from worker 2<BR>> <BR>> //final calculations using hM1,hM2<BR>> <BR>> //worker 1 (taskid=1)<BR>> <BR>> MPI_Recv(ha11, n / 2 * n / 2, MPI_DOUBLE, 0, 1, MPI_COMM_WORLD,&status);<BR>> //does some calculations<BR>> MPI_Send(hM1, n / 2 * n / 2, MPI_DOUBLE, 0, 2, MPI_COMM_WORLD); //sends back<BR>> <BR>>  <BR>> //worker 2(taskid=2)<BR>> MPI_Recv(ha11, n / 2 * n / 2, MPI_DOUBLE, 0, 1, MPI_COMM_WORLD,&status);<BR>> //does some calculations<BR>> MPI_Send(hM2, n / 2 * n / 2, MPI_DOUBLE, 0, 2, MPI_COMM_WORLD); //sends back<BR>> <BR>> <BR>> This worked fine at first, for n=128 to n=2048. But after I pushed 'n' beyond 2048 I got a segmentation fault from the worker 1. <BR>> <BR>> Since then, code works fine for the small n values. But whenever I set the value n=128 or greater, worker 1 is getting delayed indefinitely while the rest of the nodes works fine.<BR>> <BR>> What could be the reason for this? And how can I resolve this?  If I have done any mistakes please point out. Thanks in advance.<BR>> -- <BR>> Regards,<BR>> H.K. Madhawa Bandara<BR>> <BR>> <BR>> <BR>> _______________________________________________<BR>> discuss mailing list     discuss@mpich.org<BR>> To manage subscription options or unsubscribe:<BR>> https://lists.mpich.org/mailman/listinfo/discuss<BR><BR>--<BR>Pavan Balaji<BR>http://www.mcs.anl.gov/~balaji<BR><BR>_______________________________________________<BR>discuss mailing list     discuss@mpich.org<BR>To manage subscription options or unsubscribe:<BR>https://lists.mpich.org/mailman/listinfo/discuss<BR></BODY></HTML>