Skip to content
Snippets Groups Projects
Commit 411c069b authored by Tim Mattox's avatar Tim Mattox
Browse files

BUGFIX: Prevent possible deadlock in Irregular::create_atom and create_data

parent 3a2da51a
No related branches found
No related tags found
No related merge requests found
......@@ -395,7 +395,9 @@ int Irregular::create_atom(int n, int *sizes, int *proclist, int sortflag)
sendmax_proc = 0;
for (i = 0; i < nsend_proc; i++) {
MPI_Send(&length_send[i],1,MPI_INT,proc_send[i],0,world);
MPI_Request tmpReq; // Use non-blocking send to avoid possible deadlock
MPI_Isend(&length_send[i],1,MPI_INT,proc_send[i],0,world,&tmpReq);
MPI_Request_free(&tmpReq); // the MPI_Barrier below marks completion
sendmax_proc = MAX(sendmax_proc,length_send[i]);
}
......@@ -641,7 +643,9 @@ int Irregular::create_data(int n, int *proclist, int sortflag)
sendmax_proc = 0;
for (i = 0; i < nsend_proc; i++) {
MPI_Send(&num_send[i],1,MPI_INT,proc_send[i],0,world);
MPI_Request tmpReq; // Use non-blocking send to avoid possible deadlock
MPI_Isend(&num_send[i],1,MPI_INT,proc_send[i],0,world,&tmpReq);
MPI_Request_free(&tmpReq); // the MPI_Barrier below marks completion
sendmax_proc = MAX(sendmax_proc,num_send[i]);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment