File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree 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 @@ -1418,9 +1418,13 @@ void Series::flushFileBased(
14181418 case Access::READ_WRITE:
14191419 case Access::CREATE:
14201420 case Access::APPEND: {
1421- bool allDirty = dirty ();
1421+ bool const allDirty = dirty ();
14221422 for (auto it = begin; it != end; ++it)
14231423 {
1424+ /* reset the dirty bit for every iteration (i.e. file)
1425+ * otherwise only the first iteration will have updates attributes
1426+ */
1427+ setDirty (allDirty);
14241428 // Phase 1
14251429 switch (openIterationIfDirty (it->first , it->second ))
14261430 {
@@ -1467,12 +1471,7 @@ void Series::flushFileBased(
14671471 it->second .get ().m_closed =
14681472 internal::CloseStatus::ClosedInBackend;
14691473 }
1470- /* reset the dirty bit for every iteration (i.e. file)
1471- * otherwise only the first iteration will have updates attributes
1472- */
1473- setDirty (allDirty);
14741474 }
1475- setDirty (false );
14761475
14771476 // Phase 3
14781477 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"
@@ -293,10 +294,10 @@ void Attributable::flushAttributes(internal::FlushParams const &flushParams)
293294 }
294295 }
295296 // Do this outside the if branch to also setDirty to dirtyRecursive
296- if (flushParams. flushLevel != FlushLevel::SkeletonOnly)
297- {
298- setDirty ( false );
299- }
297+ assert (
298+ flushParams. flushLevel != FlushLevel::SkeletonOnly &&
299+ flushParams. flushLevel != FlushLevel::CreateOrOpenFiles );
300+ setDirty ( false );
300301}
301302
302303void Attributable::readAttributes (ReadMode mode)
You can’t perform that action at this time.
0 commit comments