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

Add new work-around for new fail dimension of PGI 20.

parent 48a57d6c
No related branches found
No related tags found
No related merge requests found
......@@ -1274,22 +1274,19 @@ planPasses(const struct streamMapping *mapping, const struct cdiPioConf *conf, s
* recordAggLim data bytes, but use at least one, unless none
* remain */
size_t firstRecordOfPass = 0, curRecord;
#if defined(__PGI) && __PGIC__ == 20
#if !defined __PGI || __PGIC__ != 20
struct passPlan(*passes)[collSize] = NULL;
#else
/* we need the following workaround because pggpp2 fails to produce
* LLVM IR assembly file with -O2 optimization level */
struct passPlan *passes = NULL;
#else
struct passPlan(*passes)[collSize] = NULL;
#endif
size_t sizeof_pass = collSize * sizeof(struct passPlan);
do
{
size_t taskBegin = firstRecordOfPass;
curRecord = firstRecordOfPass - 1;
#if defined(__PGI) && __PGIC__ == 20
passes = Realloc(passes, sizeof(*passes) * collSize * (numPasses + 1));
#else
passes = Realloc(passes, sizeof(*passes) * (numPasses + 1));
#endif
passes = Realloc(passes, sizeof_pass * (numPasses + 1));
for (size_t rank = 0; rank < collSize; ++rank)
{
size_t recordAggBufSize = 0;
......@@ -1297,24 +1294,26 @@ planPasses(const struct streamMapping *mapping, const struct cdiPioConf *conf, s
&& ((recordAggBufSize + writtenRecords[curRecord + 1].dataSize) < recordAggBufLim))
recordAggBufSize += writtenRecords[++curRecord].dataSize;
if (curRecord == taskBegin - 1 && curRecord + 1 < numWrittenRecords) ++curRecord;
#if defined(__PGI) && __PGIC__ == 20
passes[collSize * numPasses + rank] = (struct passPlan)
{
#if !defined __PGI || __PGIC__ != 20
passes[numPasses][rank]
#else
passes[numPasses][rank] = (struct passPlan){
passes[numPasses * collSize + rank]
#endif
.recordAggStart = (unsigned) taskBegin, .recordAggEnd = (unsigned) curRecord,
.varStart = writtenRecords[taskBegin].varID, .varEnd = writtenRecords[curRecord].varID,
};
= (struct passPlan){
.recordAggStart = (unsigned) taskBegin,
.recordAggEnd = (unsigned) curRecord,
.varStart = writtenRecords[taskBegin].varID,
.varEnd = writtenRecords[curRecord].varID,
};
taskBegin = curRecord + 1;
}
++numPasses, firstRecordOfPass = curRecord + 1;
}
while (curRecord + 1 < numWrittenRecords);
#if defined(__PGI) && __PGIC__ == 20
*passes_ = (struct passPlan(*)[]) passes;
#else
#if !defined __PGI || __PGIC__ != 20
*passes_ = passes;
#else
*passes_ = (struct passPlan(*)[collSize]) passes;
#endif
}
Free(recordDataSizePfxSums);
......
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