Skip to content

Commit 2b010ce

Browse files
committed
lustre workaround
1 parent ae7024c commit 2b010ce

File tree

4 files changed

+9
-8
lines changed

4 files changed

+9
-8
lines changed

Src/Base/AMReX_PlotFileUtil.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11

2+
#include "AMReX_ParallelDescriptor.H"
23
#include <AMReX_VisMF.H>
34
#include <AMReX_AsyncOut.H>
45
#include <AMReX_PlotFileUtil.H>
@@ -236,6 +237,7 @@ WriteMultiLevelPlotfile (const std::string& plotfilename, int nlevels,
236237
}
237238
VisMF::Write(*data, MultiFabFileFullPrefix(level, plotfilename, levelPrefix, mfPrefix));
238239
}
240+
ParallelDescriptor::Barrier();
239241
}
240242
}
241243

Src/Base/AMReX_VisMF.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1111,7 +1111,7 @@ VisMF::Write (const FabArray<FArrayBox>& mf,
11111111
nfi.Stream().flush();
11121112
delete [] allFabData;
11131113

1114-
} else { // ---- write fabs individually
1114+
} else { // ---- write fabs individually
11151115
for(MFIter mfi(mf); mfi.isValid(); ++mfi) {
11161116
std::streamoff hLength = 0;
11171117
const FArrayBox &fab = mf[mfi];
@@ -1123,10 +1123,9 @@ VisMF::Write (const FabArray<FArrayBox>& mf,
11231123
hLength = static_cast<std::streamoff>(hss.tellp());
11241124
auto tstr = hss.str();
11251125
nfi.Stream().write(tstr.c_str(), hLength); // ---- the fab header
1126-
nfi.Stream().flush();
11271126
}
11281127
Real const* fabdata = fab.dataPtr();
1129-
#ifdef AMREX_USE_GPU
1128+
#ifdef AMREX_USE_GPU
11301129
std::unique_ptr<FArrayBox> hostfab;
11311130
if (fab.arena()->isManaged() || fab.arena()->isDevice()) {
11321131
hostfab = std::make_unique<FArrayBox>(fab.box(), fab.nComp(),
@@ -1136,20 +1135,19 @@ VisMF::Write (const FabArray<FArrayBox>& mf,
11361135
Gpu::streamSynchronize();
11371136
fabdata = hostfab->dataPtr();
11381137
}
1139-
#endif
1138+
#endif
11401139
if(doConvert) {
11411140
char *cDataPtr = new char[writeDataSize];
11421141
RealDescriptor::convertFromNativeFormat(static_cast<void *> (cDataPtr),
11431142
writeDataItems,
11441143
fabdata, *whichRD);
11451144
nfi.Stream().write(cDataPtr, writeDataSize);
1146-
nfi.Stream().flush();
11471145
delete [] cDataPtr;
11481146
} else { // ---- copy from the fab
11491147
nfi.Stream().write((char *) fabdata, writeDataSize);
1150-
nfi.Stream().flush();
11511148
}
11521149
}
1150+
nfi.Stream().flush();
11531151
}
11541152
}
11551153

Src/Particle/AMReX_ParticleIO.H

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -613,10 +613,10 @@ ParticleContainer_impl<ParticleType, NArrayReal, NArrayInt, Allocator, CellAssig
613613
particle_io_flags, tile_map[grid], count[grid], is_checkpoint);
614614

615615
writeIntData(istuff.dataPtr(), istuff.size(), ofs);
616-
ofs.flush(); // Some systems require this flush() (probably due to a bug)
616+
//ofs.flush(); // Some systems require this flush() (probably due to a bug)
617617

618618
WriteParticleRealData(rstuff.dataPtr(), rstuff.size(), ofs);
619-
ofs.flush(); // Some systems require this flush() (probably due to a bug)
619+
//ofs.flush(); // Some systems require this flush() (probably due to a bug)
620620
}
621621
}
622622

Src/Particle/AMReX_WriteBinaryParticleData.H

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -669,6 +669,7 @@ void WriteBinaryParticleDataSync (PC const& pc,
669669
}
670670
}
671671
}
672+
ParallelDescriptor::Barrier();
672673
}
673674

674675
if (ParallelDescriptor::IOProcessor())

0 commit comments

Comments
 (0)