<div dir="ltr">Hello.<div>After executing MPI_Send() for the first time in the root process, my program blocks.</div><div><br></div><div>int the root process, I have:</div><div><font color="#0000ff">...</font></div><div><div>
<font color="#0000ff"><span class="" style="white-space:pre"> </span> while(i++<iWorldSize)</font></div><div><font color="#0000ff"><span class="" style="white-space:pre"> </span> {</font></div><div><font color="#0000ff"><span class="" style="white-space:pre"> </span>cout << "executing send for the " << i-1 << "th time" << endl;</font></div>
<div><font color="#0000ff"><span class="" style="white-space:pre"> </span> MPI_Send(&A[i-1], n*m/iWorldSize, MPI_INT, j, itag, MPI_COMM_WORLD);</font></div><div><font color="#0000ff"><span class="" style="white-space:pre"> </span> cout << "executed send for the " << i << "th time" << endl;</font></div>
<div><font color="#0000ff"><span class="" style="white-space:pre"> </span> }//end while</font></div></div><div><font color="#0000ff">...</font></div><div><br></div><div>and in the slave processes I have</div><div><br></div>
<div><font color="#0000ff">...</font></div><div><div><font color="#0000ff"> MPI_Status status; </font></div><div><font color="#0000ff"><span class="" style="white-space:pre"> </span> </font></div><div><font color="#0000ff"><span class="" style="white-space:pre"> </span> int *buffer = new int[m*(n/iWorldSize)];</font></div>
<div><span class="" style="white-space:pre"><font color="#0000ff"> </font></span></div><div><font color="#0000ff"> cout << "\n\n\n**********Executing receive*******" << endl;</font></div><div>
<font color="#0000ff"> MPI_Recv(&buffer, m*(n/iWorld</font></div></div><div><font color="#0000ff">...</font></div><div><br></div><div>where did I go wrong?</div><div><br></div><div>Thank you</div></div>