From 83ef5f47116ad4889169bec370e1718eb4142e7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Franz=20P=C3=B6schel?= Date: Mon, 4 Apr 2022 14:11:05 +0200 Subject: [PATCH] CI fixes --- include/openPMD/backend/Writable.hpp | 8 ++++---- src/Iteration.cpp | 24 +++++++++++++++++++++--- src/backend/Attributable.cpp | 8 +++++++- 3 files changed, 32 insertions(+), 8 deletions(-) diff --git a/include/openPMD/backend/Writable.hpp b/include/openPMD/backend/Writable.hpp index 8944d92dea..a0fd34a92f 100644 --- a/include/openPMD/backend/Writable.hpp +++ b/include/openPMD/backend/Writable.hpp @@ -121,9 +121,9 @@ OPENPMD_private */ std::shared_ptr abstractFilePosition; std::shared_ptr IOHandler; - internal::AttributableData *attributable; - Writable *parent; - bool dirty; + internal::AttributableData *attributable = nullptr; + Writable *parent = nullptr; + bool dirty = false; /** * If parent is not null, then this is a vector of keys such that: * &(*parent)[key_1]...[key_n] == this @@ -146,6 +146,6 @@ OPENPMD_private * Writable and its meaning within the current dataset. * */ - bool written; + bool written = false; }; } // namespace openPMD diff --git a/src/Iteration.cpp b/src/Iteration.cpp index 4ffadd9c67..0e5f5559fd 100644 --- a/src/Iteration.cpp +++ b/src/Iteration.cpp @@ -237,9 +237,15 @@ void Iteration::flushFileBased( s.openIteration(i, *this); } - if (flushParams.flushLevel != FlushLevel::CreateOrOpenFiles) + switch (flushParams.flushLevel) { + case FlushLevel::CreateOrOpenFiles: + break; + case FlushLevel::SkeletonOnly: + case FlushLevel::InternalFlush: + case FlushLevel::UserFlush: flush(flushParams); + break; } } @@ -254,9 +260,15 @@ void Iteration::flushGroupBased( IOHandler()->enqueue(IOTask(this, pCreate)); } - if (flushParams.flushLevel != FlushLevel::CreateOrOpenFiles) + switch (flushParams.flushLevel) { + case FlushLevel::CreateOrOpenFiles: + break; + case FlushLevel::SkeletonOnly: + case FlushLevel::InternalFlush: + case FlushLevel::UserFlush: flush(flushParams); + break; } } @@ -272,9 +284,15 @@ void Iteration::flushVariableBased( this->setAttribute("snapshot", i); } - if (flushParams.flushLevel != FlushLevel::CreateOrOpenFiles) + switch (flushParams.flushLevel) { + case FlushLevel::CreateOrOpenFiles: + break; + case FlushLevel::SkeletonOnly: + case FlushLevel::InternalFlush: + case FlushLevel::UserFlush: flush(flushParams); + break; } } diff --git a/src/backend/Attributable.cpp b/src/backend/Attributable.cpp index 44238b161d..b73c850409 100644 --- a/src/backend/Attributable.cpp +++ b/src/backend/Attributable.cpp @@ -213,9 +213,15 @@ void Attributable::seriesFlush(internal::FlushParams flushParams) void Attributable::flushAttributes(internal::FlushParams const &flushParams) { - if (flushParams.flushLevel == FlushLevel::SkeletonOnly) + switch (flushParams.flushLevel) { + case FlushLevel::SkeletonOnly: + case FlushLevel::CreateOrOpenFiles: return; + case FlushLevel::InternalFlush: + case FlushLevel::UserFlush: + // pass + break; } if (dirty()) {