I wish to send a contiguous array of memory between two nodes using MPI. For this purpose, I use the following Non-blocking Send/Receive command (MPI_Isend, MPI_Irecv). While executing the run command, I see two warning statements as follows:
Warning: Program exiting with outstanding receive requests
Basically, I want to see that the array data from "NorthEdge1" is passed to "NorthofNorthEdge3". How could I fix this? What else could I try to check this communication?
Here is an excerpt from the source code:
#define Rows 48
...
double *northedge1 = new double[Rows];
double *northofnorthedge3 = new double[Rows];
...
...
int main (int argc, char *argv[])
{
....
....
MPI_Request send_request, recv_request;
...
...
{开发者_开发知识库
MPI_Isend(northedge1, Rows, MPI_DOUBLE, my_rank+1, 0, MPI_COMM_WORLD, &send_request);
MPI_Irecv(northofnorthedge3, Rows, MPI_DOUBLE, my_rank+1, MPI_ANY_TAG, MPI_COMM_WORLD,
&recv_request);
}
It looks like you haven't called MPI_Waitall()
. The "immediate" send and receive routines only begin the communication. You have to block your process to ensure the communication has finished. Blocking in MPI is with a variant of MPI_Wait()
; in your case, you need MPI_Waitall()
.
精彩评论