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 @@ -363,12 +363,13 @@ void Iteration::flushIteration(internal::FlushParams const &flushParams)
363363 s.setParticlesPath (particlesPaths);
364364 }
365365
366- if (access::write (IOHandler ()->m_frontendAccess ))
367- {
368- flushAttributes (flushParams);
369- }
370- if (flushParams.flushLevel != FlushLevel::SkeletonOnly)
366+ if (flushParams.flushLevel != FlushLevel::SkeletonOnly &&
367+ flushParams.flushLevel != FlushLevel::CreateOrOpenFiles)
371368 {
369+ if (access::write (IOHandler ()->m_frontendAccess ))
370+ {
371+ flushAttributes (flushParams);
372+ }
372373 setDirty (false );
373374 meshes.setDirty (false );
374375 particles.setDirty (false );
Original file line number Diff line number Diff line change @@ -1406,9 +1406,13 @@ void Series::flushFileBased(
14061406 case Access::READ_WRITE:
14071407 case Access::CREATE:
14081408 case Access::APPEND: {
1409- bool allDirty = dirty ();
1409+ bool const allDirty = dirty ();
14101410 for (auto it = begin; it != end; ++it)
14111411 {
1412+ /* reset the dirty bit for every iteration (i.e. file)
1413+ * otherwise only the first iteration will have updates attributes
1414+ */
1415+ setDirty (allDirty);
14121416 // Phase 1
14131417 switch (openIterationIfDirty (it->first , it->second ))
14141418 {
@@ -1459,12 +1463,7 @@ void Series::flushFileBased(
14591463 {
14601464 IOHandler ()->flush (flushParams);
14611465 }
1462- /* reset the dirty bit for every iteration (i.e. file)
1463- * otherwise only the first iteration will have updates attributes
1464- */
1465- setDirty (allDirty);
14661466 }
1467- setDirty (false );
14681467 break ;
14691468 }
14701469 }
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/Series.hpp"
2425#include " openPMD/auxiliary/DerefDynamicCast.hpp"
@@ -275,10 +276,10 @@ void Attributable::flushAttributes(internal::FlushParams const &flushParams)
275276 }
276277 }
277278 // Do this outside the if branch to also setDirty to dirtyRecursive
278- if (flushParams. flushLevel != FlushLevel::SkeletonOnly)
279- {
280- setDirty ( false );
281- }
279+ assert (
280+ flushParams. flushLevel != FlushLevel::SkeletonOnly &&
281+ flushParams. flushLevel != FlushLevel::CreateOrOpenFiles );
282+ setDirty ( false );
282283}
283284
284285void Attributable::readAttributes (ReadMode mode)
You can’t perform that action at this time.
0 commit comments