Skip to content
Snippets Groups Projects
Commit a11f9492 authored by Thomas Jahns's avatar Thomas Jahns :cartwheel: Committed by Sergey Kosukhin
Browse files

Add work-around for MPICH 3.3 defect.

parent 33549b90
No related branches found
No related tags found
2 merge requests!34Version 2.2.0,!13Consolidation with CDI-PIO (develop)
......@@ -336,6 +336,19 @@ initSharedFP(struct sharedFP *bfd, int nProcsColl)
bfd->unfinished = nProcsColl;
}
/* MPICH 3.3 has a problem in its implementation of MPI_Testany and
* MPI_Waitany, see commit 0f7be7196cc05bf0c908761e148628e88d635190
* at https://github.com/pmodels/mpich */
#ifdef MPICH_CALC_VERSION
#if MPICH_NUMVERSION >= MPICH_CALC_VERSION(3, 3, 0, 0, 0) && MPI_NUMVERSION < MPICH_CALC_VERSION(3, 3, 1, 0, 0)
#define CDIPIO_MPICH33_WORKAROUND(code) code
#else
#define CDIPIO_MPICH33_WORKAROUND(code) code
#endif
#else
#define CDIPIO_MPICH33_WORKAROUND(code)
#endif
static void
fpgPOSIXFPGUARDSENDRECV(void)
{
......@@ -346,16 +359,20 @@ fpgPOSIXFPGUARDSENDRECV(void)
MPI_Comm commPio = commInqCommPio();
size_t nProcsColl = (size_t) (commInqSizeColl()), sentFinalize = nProcsColl;
struct syncMsg *msgWords = Malloc(sizeof(*msgWords) * nProcsColl);
MPI_Request *msgReq = Malloc(sizeof(*msgReq) * nProcsColl);
size_t numReq = nProcsColl;
CDIPIO_MPICH33_WORKAROUND(++numReq);
MPI_Request *msgReq = Malloc(sizeof(*msgReq) * numReq);
xdebug("ncollectors=%zu", nProcsColl);
CDIPIO_MPICH33_WORKAROUND(msgReq[0] = MPI_REQUEST_NULL; ++msgReq);
for (size_t i = 0; i < nProcsColl; ++i)
xmpi(MPI_Irecv(msgWords + i, 1, cdiPioSyncMsgDt, (int) i, collGuardTag, commPio, msgReq + i));
for (;;)
{
CDIPIO_MPICH33_WORKAROUND(--msgReq; ++nProcsColl);
xmpiStat(MPI_Waitany((int) nProcsColl, msgReq, &source, &status), &status);
CDIPIO_MPICH33_WORKAROUND(++msgReq; --nProcsColl; --source);
int fileID = msgWords[source].fileID;
assert(fileID >= 0);
int opcode = msgWords[source].command;
......@@ -404,6 +421,7 @@ fpgPOSIXFPGUARDSENDRECV(void)
{
if (sharedFPsFill) xabort("still files open");
Free(sharedFPs);
CDIPIO_MPICH33_WORKAROUND(--msgReq);
Free(msgReq);
Free(msgWords);
cdiPioDestroySyncMsgDt();
......
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