What should I use?
Even the statement right after MPI_Sent doesn't execute. My code has something like this:
//////////////////////in the root process
while(i<iWorldSize)
{
cout << "executing send for the " << i << "th time" << endl;
MPI_Send( A[i], n/iWorldSize * m, MPI_INT, i, itag, MPI_COMM_WORLD );
sent++;
cout << "executed send for the " << i << "th time, sending " <<
n/iWorldSize * m << " bytes to processor " << i << endl;
i+=n/iWorldSize;
}//end while
////////////////////in the slave process
while(sent)
{
cout << "**********sent= " << sent << endl;
cout << "\n\n\n**********Executing receive*******" << endl;
MPI_Recv(&buffer, n/iWorldSize*m, MPI_INT, 0, itag, MPI_COMM_WORLD, &status);
sent=0;
cout << "**********receive executed***********" << endl;
}