From c8a1876d6207084176b8c5e3231ced6967740cc8 Mon Sep 17 00:00:00 2001 From: eschnett Date: Sun, 27 Apr 2014 08:48:42 +0000 Subject: Correct MPI error Ensure all MPI_Requests are initialized before they are used. git-svn-id: http://svn.cactuscode.org/arrangements/CactusPUGH/PUGH/trunk@533 b61c5cb5-eaca-4651-9a7a-d64986f99364 --- src/Comm.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/Comm.c b/src/Comm.c index ff04905..3155672 100644 --- a/src/Comm.c +++ b/src/Comm.c @@ -10,6 +10,7 @@ /* #define DEBUG_PUGH 1 */ +#include #include #include #include @@ -919,6 +920,11 @@ static int PUGH_Sync(pGH *pughGH, pComm *comm) t1 = MPI_Wtime(); #endif + if (pughGH->commmodel == PUGH_ALLOCATEDBUFFERS) + { + comm->rreq[2*dir] = MPI_REQUEST_NULL; + comm->rreq[2*dir+1] = MPI_REQUEST_NULL; + } PostReceiveGA(pughGH, 2*dir, comm); PostReceiveGA(pughGH, 2*dir+1, comm); @@ -927,6 +933,11 @@ static int PUGH_Sync(pGH *pughGH, pComm *comm) printf("PR : %f\n",t2-t1); #endif + if (pughGH->commmodel == PUGH_ALLOCATEDBUFFERS) + { + comm->sreq[2*dir] = MPI_REQUEST_NULL; + comm->sreq[2*dir+1] = MPI_REQUEST_NULL; + } PostSendGA(pughGH, 2*dir, comm); PostSendGA(pughGH, 2*dir+1, comm); @@ -938,7 +949,7 @@ static int PUGH_Sync(pGH *pughGH, pComm *comm) /* Now comes the big difference between derived types and allocated buffers. With derived types, we now have to wait on all our recieve AND SEND buffers so we can - keep on using the send buffers ( as communications are + keep on using the send buffers (as communications are in-place). With the allocated we have to wait on each recieve, but not on the send, since we don't need the send buffer until we pack a send again (above) -- cgit v1.2.3