File tree Expand file tree Collapse file tree 4 files changed +21
-16
lines changed
Expand file tree Collapse file tree 4 files changed +21
-16
lines changed Original file line number Diff line number Diff line change @@ -634,7 +634,11 @@ void CustomHierarchy::flush_internal(
634634 {
635635 dataset.flush (name, flushParams, /* set_defaults = */ false );
636636 }
637- setDirty (false );
637+ if (flushParams.flushLevel != FlushLevel::SkeletonOnly &&
638+ flushParams.flushLevel != FlushLevel::CreateOrOpenFiles)
639+ {
640+ setDirty (false );
641+ }
638642}
639643
640644void CustomHierarchy::flush (
Original file line number Diff line number Diff line change @@ -364,12 +364,13 @@ void Iteration::flushIteration(internal::FlushParams const &flushParams)
364364 s.setParticlesPath (particlesPaths);
365365 }
366366
367- if (access::write (IOHandler ()->m_frontendAccess ))
368- {
369- flushAttributes (flushParams);
370- }
371- if (flushParams.flushLevel != FlushLevel::SkeletonOnly)
367+ if (flushParams.flushLevel != FlushLevel::SkeletonOnly &&
368+ flushParams.flushLevel != FlushLevel::CreateOrOpenFiles)
372369 {
370+ if (access::write (IOHandler ()->m_frontendAccess ))
371+ {
372+ flushAttributes (flushParams);
373+ }
373374 setDirty (false );
374375 meshes.setDirty (false );
375376 particles.setDirty (false );
Original file line number Diff line number Diff line change @@ -1412,9 +1412,13 @@ void Series::flushFileBased(
14121412 case Access::READ_WRITE:
14131413 case Access::CREATE:
14141414 case Access::APPEND: {
1415- bool allDirty = dirty ();
1415+ bool const allDirty = dirty ();
14161416 for (auto it = begin; it != end; ++it)
14171417 {
1418+ /* reset the dirty bit for every iteration (i.e. file)
1419+ * otherwise only the first iteration will have updates attributes
1420+ */
1421+ setDirty (allDirty);
14181422 // Phase 1
14191423 switch (openIterationIfDirty (it->first , it->second ))
14201424 {
@@ -1461,12 +1465,7 @@ void Series::flushFileBased(
14611465 it->second .get ().m_closed =
14621466 internal::CloseStatus::ClosedInBackend;
14631467 }
1464- /* reset the dirty bit for every iteration (i.e. file)
1465- * otherwise only the first iteration will have updates attributes
1466- */
1467- setDirty (allDirty);
14681468 }
1469- setDirty (false );
14701469
14711470 // Phase 3
14721471 if (flushIOHandler)
Original file line number Diff line number Diff line change 1919 * If not, see <http://www.gnu.org/licenses/>.
2020 */
2121#include " openPMD/backend/Attributable.hpp"
22+ #include " openPMD/IO/AbstractIOHandler.hpp"
2223#include " openPMD/Iteration.hpp"
2324#include " openPMD/ParticleSpecies.hpp"
2425#include " openPMD/RecordComponent.hpp"
@@ -278,10 +279,10 @@ void Attributable::flushAttributes(internal::FlushParams const &flushParams)
278279 }
279280 }
280281 // Do this outside the if branch to also setDirty to dirtyRecursive
281- if (flushParams. flushLevel != FlushLevel::SkeletonOnly)
282- {
283- setDirty ( false );
284- }
282+ assert (
283+ flushParams. flushLevel != FlushLevel::SkeletonOnly &&
284+ flushParams. flushLevel != FlushLevel::CreateOrOpenFiles );
285+ setDirty ( false );
285286}
286287
287288void Attributable::readAttributes (ReadMode mode)
You can’t perform that action at this time.
0 commit comments