Skip to content
8 changes: 7 additions & 1 deletion include/picongpu/plugins/openPMD/NDScalars.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -174,11 +174,17 @@ namespace picongpu
DataSpace<simDim> gridPos = Environment<simDim>::get().GridController().getPosition();
::openPMD::Offset start;
::openPMD::Extent count;
::openPMD::Extent extent = mrc.getExtent();
start.reserve(ndim);
count.reserve(ndim);
for(int d = 0; d < ndim; ++d)
{
start.push_back(gridPos.revert()[d]);
/*
* When restarting with more parallel processes than the checkpoint had originally been written
* with, we must take care not to index past the dataset boundaries. Just loop around to the start
* in that case. Not the finest way, but it does the job for now..
*/
start.push_back(gridPos.revert()[d] % extent[d]);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is this really the best solution? This loads nextId and startId. If the GPU grid does not match the old one, this logic currently just uses modulus to loop around and hand out some random ID. No idea if that has downsides.

count.push_back(1);
}

Expand Down
6 changes: 6 additions & 0 deletions include/picongpu/plugins/openPMD/openPMDWriter.x.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1024,6 +1024,12 @@ make sure that environment variable OPENPMD_BP_BACKEND is not set to ADIOS1.
{
loadRngStatesImpl(&mThreadParams, restartStep);
}
catch(std::exception const& e)
{
log<picLog::INPUT_OUTPUT>("openPMD: loading RNG states failed, they will be re-initialized "
"instead. Original error:\n\t%1%")
% e.what();
}
catch(...)
{
log<picLog::INPUT_OUTPUT>(
Expand Down
Loading