Skip to content

Commit 8d018f7

Browse files
storeChunk: Workaround for bug with parallel flushing (#5510)
* Little fix for parallel flushing * Workaround for openPMD/openPMD-api#1794 * Add the workaround also for recent releases
1 parent b6700a4 commit 8d018f7

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

include/picongpu/plugins/openPMD/writer/ParticleAttribute.hpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,20 @@ namespace picongpu
158158
if(elements == 0)
159159
{
160160
// accumulateWrittenBytes += 0;
161+
162+
// Workaround for this bug: https://github.com/openPMD/openPMD-api/pull/1794
163+
// and also this one for good measure https://github.com/openPMD/openPMD-api/pull/1862
164+
// In the affected versions of the openPMD-api, Span-based storeChunk must be
165+
// treated as an MPI-collective call.
166+
for(uint32_t d = 0; d < components; d++)
167+
{
168+
::openPMD::RecordComponent recordComponent
169+
= components > 1 ? record[name_lookup[d]] : record[::openPMD::MeshRecordComponent::SCALAR];
170+
171+
recordComponent.storeChunk<ComponentType>(
172+
::openPMD::Offset{globalOffset},
173+
::openPMD::Extent{elements});
174+
}
161175
return;
162176
}
163177

0 commit comments

Comments
 (0)