diff options
author | eschnett <eschnett@b61c5cb5-eaca-4651-9a7a-d64986f99364> | 2014-04-27 08:48:42 +0000 |
---|---|---|
committer | eschnett <eschnett@b61c5cb5-eaca-4651-9a7a-d64986f99364> | 2014-04-27 08:48:42 +0000 |
commit | c8a1876d6207084176b8c5e3231ced6967740cc8 (patch) | |
tree | ba3ed427051407ae3fa2369b0897734a26fa95ff | |
parent | 5873a0fc80f0e7ed23b46473646a22ee7fd7c725 (diff) |
Correct MPI errorsvn
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
-rw-r--r-- | src/Comm.c | 13 |
1 files changed, 12 insertions, 1 deletions
@@ -10,6 +10,7 @@ /* #define DEBUG_PUGH 1 */ +#include <assert.h> #include <stdlib.h> #include <stdio.h> #include <string.h> @@ -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) |