Skip to content

Workarounds for Lustre I/O issues #4426

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: development
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Src/Base/AMReX_PlotFileUtil.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@

#include "AMReX_ParallelDescriptor.H"
#include <AMReX_VisMF.H>
#include <AMReX_AsyncOut.H>
#include <AMReX_PlotFileUtil.H>
Expand Down Expand Up @@ -236,6 +237,7 @@ WriteMultiLevelPlotfile (const std::string& plotfilename, int nlevels,
}
VisMF::Write(*data, MultiFabFileFullPrefix(level, plotfilename, levelPrefix, mfPrefix));
}
ParallelDescriptor::Barrier();
}
}

Expand Down
10 changes: 4 additions & 6 deletions Src/Base/AMReX_VisMF.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1111,7 +1111,7 @@ VisMF::Write (const FabArray<FArrayBox>& mf,
nfi.Stream().flush();
delete [] allFabData;

} else { // ---- write fabs individually
} else { // ---- write fabs individually
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The white space change is unnecessary and I think is incorrect.

for(MFIter mfi(mf); mfi.isValid(); ++mfi) {
std::streamoff hLength = 0;
const FArrayBox &fab = mf[mfi];
Expand All @@ -1123,10 +1123,9 @@ VisMF::Write (const FabArray<FArrayBox>& mf,
hLength = static_cast<std::streamoff>(hss.tellp());
auto tstr = hss.str();
nfi.Stream().write(tstr.c_str(), hLength); // ---- the fab header
nfi.Stream().flush();
}
Real const* fabdata = fab.dataPtr();
#ifdef AMREX_USE_GPU
#ifdef AMREX_USE_GPU
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems unnecessary.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will revert the spurious whitespace changes.

std::unique_ptr<FArrayBox> hostfab;
if (fab.arena()->isManaged() || fab.arena()->isDevice()) {
hostfab = std::make_unique<FArrayBox>(fab.box(), fab.nComp(),
Expand All @@ -1136,20 +1135,19 @@ VisMF::Write (const FabArray<FArrayBox>& mf,
Gpu::streamSynchronize();
fabdata = hostfab->dataPtr();
}
#endif
#endif
if(doConvert) {
char *cDataPtr = new char[writeDataSize];
RealDescriptor::convertFromNativeFormat(static_cast<void *> (cDataPtr),
writeDataItems,
fabdata, *whichRD);
nfi.Stream().write(cDataPtr, writeDataSize);
nfi.Stream().flush();
delete [] cDataPtr;
} else { // ---- copy from the fab
nfi.Stream().write((char *) fabdata, writeDataSize);
nfi.Stream().flush();
}
}
nfi.Stream().flush();
}
}

Expand Down
4 changes: 2 additions & 2 deletions Src/Particle/AMReX_ParticleIO.H
Original file line number Diff line number Diff line change
Expand Up @@ -613,10 +613,10 @@ ParticleContainer_impl<ParticleType, NArrayReal, NArrayInt, Allocator, CellAssig
particle_io_flags, tile_map[grid], count[grid], is_checkpoint);

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

WriteParticleRealData(rstuff.dataPtr(), rstuff.size(), ofs);
ofs.flush(); // Some systems require this flush() (probably due to a bug)
//ofs.flush(); // Some systems require this flush() (probably due to a bug)
}
}

Expand Down
1 change: 1 addition & 0 deletions Src/Particle/AMReX_WriteBinaryParticleData.H
Original file line number Diff line number Diff line change
Expand Up @@ -669,6 +669,7 @@ void WriteBinaryParticleDataSync (PC const& pc,
}
}
}
ParallelDescriptor::Barrier();
}

if (ParallelDescriptor::IOProcessor())
Expand Down
Loading