<div dir="ltr">What should I use?<div><br></div><div>Even the statement right after MPI_Sent doesn't execute. My code has something like this:</div><div>//////////////////////in the root process</div><div><div> while(i<iWorldSize)</div>
<div><span class="" style="white-space:pre"> </span> {</div><div><span class="" style="white-space:pre"> </span>cout << "executing send for the " << i << "th time" << endl;</div>
<div><span class="" style="white-space:pre"> </span> MPI_Send( A[i], n/iWorldSize * m, MPI_INT, i, itag, MPI_COMM_WORLD );</div><div><span class="" style="white-space:pre"> </span> sent++;</div><div><span class="" style="white-space:pre"> </span> cout << "executed send for the " << i << "th time, sending " <<</div>
<div><span class="" style="white-space:pre"> </span> n/iWorldSize * m << " bytes to processor " << i << endl;</div><div><span class="" style="white-space:pre"> </span> </div><div><span class="" style="white-space:pre"> </span> i+=n/iWorldSize;</div>
<div><span class="" style="white-space:pre"> </span> }//end while</div><div><span class="" style="white-space:pre"><br></span></div><div><span class="" style="white-space:pre"><br></span></div><div><span class="" style="white-space:pre">////////////////////in the slave process </span> </div>
</div><div><div> while(sent)</div><div> {</div><div><span class="" style="white-space:pre"> </span> cout << "**********sent= " << sent << endl;</div><div><span class="" style="white-space:pre"> </span> cout << "\n\n\n**********Executing receive*******" << endl;</div>
<div><span class="" style="white-space:pre"> </span> MPI_Recv(&buffer, n/iWorldSize*m, MPI_INT, 0, itag, MPI_COMM_WORLD, &status);</div><div><span class="" style="white-space:pre"> </span> sent=0;</div><div><span class="" style="white-space:pre"> </span> cout << "**********receive executed***********" << endl;</div>
<div><span style="white-space:pre"> </span>}</div></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Dec 2, 2013 at 5:21 PM, Pavan Balaji <span dir="ltr"><<a href="mailto:balaji@mcs.anl.gov" target="_blank">balaji@mcs.anl.gov</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
Did you try printing how many bytes you are receiving before calling MPI_Recv?<br>
<br>
— Pavan<br>
<div><div class="h5"><br>
On Dec 1, 2013, at 11:43 PM, Soheil Hooshdaran <<a href="mailto:shooshdaran577@gmail.com">shooshdaran577@gmail.com</a>> wrote:<br>
<br>
> Hello. Please tell me what is wrong with my program that it doesn't goes no further than executing MPI_Send() for the first time.<br>
> The file is attached<br>
><br>
><br>
> On Sat, Nov 30, 2013 at 7:02 PM, Soheil Hooshdaran <<a href="mailto:shooshdaran577@gmail.com">shooshdaran577@gmail.com</a>> wrote:<br>
> So what do I have to do now, sir? Especially regarding my Bcast()s a,d Recv()s<br>
><br>
><br>
> On Sat, Nov 30, 2013 at 1:05 AM, Pavan Balaji <<a href="mailto:balaji@mcs.anl.gov">balaji@mcs.anl.gov</a>> wrote:<br>
><br>
> Please keep <a href="mailto:discuss@mpich.org">discuss@mpich.org</a> cc’ed.<br>
><br>
> On Nov 29, 2013, at 2:19 PM, Soheil Hooshdaran <<a href="mailto:shooshdaran577@gmail.com">shooshdaran577@gmail.com</a>> wrote:<br>
> > executing send for the 3th time<br>
> > executed send for the 3th time, sending 40 bytes<br>
> > Fatal error in MPI_Recv: Message truncated, error stack:<br>
> > MPI_Recv(184).....................: MPI_Recv(buf=0xbff95c98, count=0, MPI_INT, src=0, tag=1, MPI_COMM_WORLD, status=0xbff95c70) failed<br>
> > MPIDI_CH3U_Receive_data_found(131): Message from rank 0 and tag 1 truncated; 160 bytes received but buffer size is 0<br>
><br>
> I don’t think I can explain the error any better than what the message above already says.<br>
><br>
> --<br>
> Pavan Balaji<br>
> <a href="http://www.mcs.anl.gov/~balaji" target="_blank">http://www.mcs.anl.gov/~balaji</a><br>
><br>
><br>
</div></div>> <p1_Hooshdaran_static[debug].cpp><br>
<div class="HOEnZb"><div class="h5"><br>
--<br>
Pavan Balaji<br>
<a href="http://www.mcs.anl.gov/~balaji" target="_blank">http://www.mcs.anl.gov/~balaji</a><br>
<br>
</div></div></blockquote></div><br></div>