Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
114 commits
Select commit Hold shift + click to select a range
7b5e8df
Base structure for scientific defaults
franzpoeschel Jan 12, 2026
2bef9e7
Start adding defaults
franzpoeschel Jan 12, 2026
16179ff
debugging output
franzpoeschel Jan 12, 2026
eb393d9
Fixes
franzpoeschel Jan 12, 2026
bdf8761
BaseRecord --> unitDimension
franzpoeschel Jan 12, 2026
ef41e87
nunja hehe
franzpoeschel Jan 12, 2026
b909a23
Fixes
franzpoeschel Jan 12, 2026
a0eb086
Further fixes
franzpoeschel Jan 13, 2026
f2b1a71
further fixes
franzpoeschel Jan 13, 2026
fbb3f6b
tests temporarily passing :D
franzpoeschel Jan 13, 2026
98b2af8
Cleanup
franzpoeschel Jan 13, 2026
b076606
UnitDimension for position/positionOffset
franzpoeschel Jan 13, 2026
22ff525
WIP: RecordComponent stuff
franzpoeschel Jan 13, 2026
e0b34a3
Fix coretests
franzpoeschel Jan 14, 2026
a3e4e92
Clean up Iteration finalizing logic
franzpoeschel Jan 14, 2026
c09793a
Add defaults for Iteration class
franzpoeschel Jan 14, 2026
e4460f9
Fix variadic template template parameters
franzpoeschel Jan 15, 2026
6053612
Remove flush-time check for populized components
franzpoeschel Jan 16, 2026
1daaee5
Make the default specification more flexible
franzpoeschel Jan 16, 2026
111ddf7
WIP
franzpoeschel Jan 20, 2026
52fe9a0
continue
franzpoeschel Jan 20, 2026
0cce083
Split this into internal and public header
franzpoeschel Jan 21, 2026
aba3d83
Distinguish writing from reading
franzpoeschel Jan 21, 2026
52eeb6e
Tests now working again
franzpoeschel Jan 21, 2026
088388d
Mostly move Mesh reading to ScientificDefaults
franzpoeschel Jan 21, 2026
322f0bb
Fix type conversions between char and string
franzpoeschel Jan 21, 2026
f8733f6
Somewhat working Mesh reading
franzpoeschel Jan 21, 2026
a870be8
Fix little parent call bug
franzpoeschel Jan 22, 2026
bc377db
Mention expected datatypes in attribute reading error messages
franzpoeschel Jan 22, 2026
185f50a
Move Iteration reading to ScientificDefaults class
franzpoeschel Jan 22, 2026
315c1a2
Introduce genericsetter, use for unitDimension
franzpoeschel Jan 22, 2026
2df9ce6
Record / BaseRecord Reading
franzpoeschel Jan 22, 2026
2e216ac
Readers for everything now except version-dependent stuff
franzpoeschel Jan 22, 2026
ae2e160
Add gridUnitDimension in ScientificDefaults
franzpoeschel Jan 23, 2026
9082923
Do not use templates for defaults setter
franzpoeschel Jan 26, 2026
0b0b1a9
Wew NewAttributeReader
franzpoeschel Jan 27, 2026
85b7957
Fixes
franzpoeschel Jan 27, 2026
f896c42
Fixes
franzpoeschel Jan 27, 2026
9b9f614
Defaults for patchRecord
franzpoeschel Jan 27, 2026
01f860b
Adapt PatchRecordComponent
franzpoeschel Jan 27, 2026
60dd741
Fixes
franzpoeschel Jan 27, 2026
7282feb
Cleanup
franzpoeschel Jan 28, 2026
72d345c
Cleanup
franzpoeschel Jan 28, 2026
03c46b9
Avoid overcomplex attribute type conversions
franzpoeschel Jan 28, 2026
51463d3
reduce binary size a bit
franzpoeschel Jan 28, 2026
7d618fd
Try further reducing amount of lambdas...
franzpoeschel Jan 28, 2026
edb2070
Annotate MB sizes
franzpoeschel Jan 28, 2026
6de9d31
Reduce implementation sizes for RequireScalar / RequireVector
franzpoeschel Jan 29, 2026
c817f3f
vibe-coded suggestions for size optimization
franzpoeschel Jan 29, 2026
9b63443
Avoid using lambdas for require_type
franzpoeschel Jan 29, 2026
9486f0c
Change code order
franzpoeschel Jan 29, 2026
9f2da45
Replace if constexpr with SFINAE
franzpoeschel Jan 30, 2026
1c651ed
Fix nvhpc/msvc builds
franzpoeschel Jan 30, 2026
1952b4b
doxygen fix
franzpoeschel Feb 2, 2026
12a9b70
Cleanup
franzpoeschel Feb 4, 2026
cf6ecf4
scientificdefaults_internal.cpp
franzpoeschel Feb 24, 2026
2106ac0
Add visitor pattern
franzpoeschel Feb 24, 2026
12c781f
wip: ScientificDefaults without CRT
franzpoeschel Feb 24, 2026
fc81641
Move defaults impl to classes
franzpoeschel Feb 24, 2026
889bc52
Fix visitHierarchy
franzpoeschel Feb 24, 2026
3471d13
Fix visithierarchy
franzpoeschel Feb 24, 2026
b1ba8ce
Compiles
franzpoeschel Feb 24, 2026
760076a
Fix inheritance issue
franzpoeschel Feb 25, 2026
4eff107
Cleanup
franzpoeschel Mar 3, 2026
e8bab6f
Move files
franzpoeschel Mar 3, 2026
643bb9f
Split files
franzpoeschel Mar 3, 2026
dd7ffc1
Cleanup, documentation
franzpoeschel Mar 3, 2026
ea6efa3
Fix JSON backend bug when missing attributes
franzpoeschel Mar 3, 2026
cbe7112
Fix bug with metadata set too late
franzpoeschel Mar 20, 2026
ed88b3e
Write defaults upon flush, thats good enough actually
franzpoeschel Mar 25, 2026
c3968b2
... wip visitor without templates ...
franzpoeschel Mar 20, 2026
56ea053
somewhat compiles
franzpoeschel Mar 20, 2026
74a7072
Clean up visitHierarchy API
franzpoeschel Mar 20, 2026
138e042
Further cleanup
franzpoeschel Mar 20, 2026
56757e7
Implement lambda visitor in terms of explicit visitor
franzpoeschel Mar 20, 2026
b1cc308
Fix Python bindings
franzpoeschel Mar 20, 2026
3c1561b
populateDefaultMetadata -> commitStructuralSetup
franzpoeschel Mar 25, 2026
f5cbe76
Cleanup
franzpoeschel Mar 25, 2026
e5b05cd
Documentation
franzpoeschel Mar 25, 2026
c2aae96
Postfix traversal, document visitHierarchy
franzpoeschel Mar 25, 2026
833c586
commitStructuralSetup --> populateMissingMetadata(bool recursive)
franzpoeschel Apr 7, 2026
fd6fd98
CI fixes
franzpoeschel Apr 8, 2026
b38a3af
Default values only upon ::close
franzpoeschel Apr 14, 2026
48b61b4
Documentation and cleanup
franzpoeschel Apr 28, 2026
59b1b7f
Review fixes
franzpoeschel Apr 29, 2026
7d49900
Review fixes
franzpoeschel Apr 29, 2026
ff33df4
Fix dirty handling
franzpoeschel Apr 29, 2026
3f5d513
Fix forward declaration
franzpoeschel Apr 29, 2026
70a6105
Flush structural info of resetDataset() to backend immediately
franzpoeschel Mar 11, 2026
a17505b
Erase flushMeshes/ParticlesPath
franzpoeschel Mar 11, 2026
d138636
Move flushing from storeChunk to resetDataset
franzpoeschel Mar 11, 2026
416e432
Hmm, move CREATE_DATASET task back to storeChunk
franzpoeschel Mar 12, 2026
45a4dd3
Fix attribute flushing logic
franzpoeschel Mar 12, 2026
cec4a5a
flush mode helpers
franzpoeschel Jan 14, 2026
fac8e50
Fix dirty handling
franzpoeschel Jan 14, 2026
60ce9bf
Add TODO comment
franzpoeschel Mar 12, 2026
19d75da
WIP Runtime verification of flush level
franzpoeschel Mar 12, 2026
015b364
dont flush to IO handler yet in resetDataset
franzpoeschel Mar 13, 2026
59a33a8
Revert "dont flush to IO handler yet in resetDataset"
franzpoeschel Mar 13, 2026
04d171f
Continue fixing and breaking things..
franzpoeschel Mar 13, 2026
49feabd
Fix API call after rebase
franzpoeschel Mar 16, 2026
eae9ed3
Fix dirty handling filebased
franzpoeschel Mar 16, 2026
3df2e85
TMP REVERT ME: deactivate span table tests
franzpoeschel Mar 16, 2026
e1038c9
TMP REVERT ME take out hanging parallel test
franzpoeschel Mar 16, 2026
e699402
Fix ranktable logic
franzpoeschel Mar 27, 2026
775ce31
Take out the next hanging parallel test
franzpoeschel Mar 27, 2026
e887966
Separate MPI tests by MPI barriers
franzpoeschel Mar 27, 2026
39abf86
Fix wrong MPI_COMM_WORLD
franzpoeschel Mar 27, 2026
7279f4d
wip: debugging state
franzpoeschel Mar 27, 2026
5df9fa7
deactivate malicious tests
franzpoeschel Mar 30, 2026
94fd6b7
Revert "deactivate malicious tests"
franzpoeschel Mar 30, 2026
10cd565
Revert "wip: debugging state"
franzpoeschel Mar 30, 2026
d9c3061
Revert "TMP REVERT ME take out hanging parallel test"
franzpoeschel Mar 30, 2026
f066423
Revert some WIPs
franzpoeschel Mar 30, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,11 @@ set(CORE_SOURCE
src/backend/PatchRecord.cpp
src/backend/PatchRecordComponent.cpp
src/backend/Writable.cpp
src/backend/scientific_defaults/ScientificDefaults.cpp
src/backend/scientific_defaults/ScientificDefaults_auxiliary.cpp
src/backend/scientific_defaults/ProcessParsedAttribute.cpp
src/backend/scientific_defaults/AttributeReader.cpp
src/backend/scientific_defaults/ConfigAttribute.cpp
src/auxiliary/OneDimensionalBlockSlicer.cpp
src/helper/list_series.cpp
src/snapshots/ContainerImpls.cpp
Expand Down
62 changes: 62 additions & 0 deletions include/openPMD/IO/AbstractIOHandler.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#include "openPMD/IterationEncoding.hpp"
#include "openPMD/config.hpp"
#include "openPMD/version.hpp"
#include <ostream>

#if openPMD_HAVE_MPI
#include <mpi.h>
Expand Down Expand Up @@ -81,6 +82,66 @@ enum class FlushLevel
CreateOrOpenFiles
};

std::ostream &operator<<(std::ostream &, FlushLevel);

namespace flush_level
{
inline constexpr auto global_flushpoint(FlushLevel fl)
{
switch (fl)
{
case FlushLevel::UserFlush:
return true;
case FlushLevel::InternalFlush:
case FlushLevel::SkeletonOnly:
case FlushLevel::CreateOrOpenFiles:
return false;
}
return false; // unreachable
}
// same as global_flushpoint for now, but we will soon introduce
// immediate_flush
inline constexpr auto write_datasets(FlushLevel fl)
{
switch (fl)
{
case FlushLevel::UserFlush:
return true;
case FlushLevel::InternalFlush:
case FlushLevel::SkeletonOnly:
case FlushLevel::CreateOrOpenFiles:
return false;
}
return false; // unreachable
}
inline constexpr auto write_attributes(FlushLevel fl)
{
switch (fl)
{
case FlushLevel::UserFlush:
case FlushLevel::InternalFlush:
return true;
case FlushLevel::SkeletonOnly:
case FlushLevel::CreateOrOpenFiles:
return false;
}
return false; // unreachable
}
inline constexpr auto flush_hierarchy(FlushLevel fl)
{
switch (fl)
{
case FlushLevel::UserFlush:
case FlushLevel::InternalFlush:
case FlushLevel::SkeletonOnly:
return true;
case FlushLevel::CreateOrOpenFiles:
return false;
}
return false; // unreachable
}
} // namespace flush_level

enum class OpenpmdStandard
{
v_1_0_0,
Expand Down Expand Up @@ -121,6 +182,7 @@ namespace internal
* To be used for reading
*/
FlushParams const defaultFlushParams{};
FlushParams const publicFlush{FlushLevel::UserFlush};

struct ParsedFlushParams;

Expand Down
2 changes: 1 addition & 1 deletion include/openPMD/IO/AbstractIOHandlerImpl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class AbstractIOHandlerImpl

virtual ~AbstractIOHandlerImpl() = default;

std::future<void> flush();
std::future<void> flush(FlushLevel);

/**
* Close the file corresponding with the writable and release file handles.
Expand Down
3 changes: 3 additions & 0 deletions include/openPMD/IO/IOTask.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
#include <cstddef>
#include <memory>
#include <optional>
#include <ostream>
#include <string>
#include <utility>
#include <variant>
Expand Down Expand Up @@ -89,6 +90,8 @@ OPENPMDAPI_EXPORT_ENUM_CLASS(Operation){
}; // note: if you change the enum members here, please update
// docs/source/dev/design.rst

std::ostream &operator<<(std::ostream &os, Operation op);

namespace internal
{
/*
Expand Down
2 changes: 1 addition & 1 deletion include/openPMD/IO/JSON/JSONIOHandlerImpl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ class JSONIOHandlerImpl : public AbstractIOHandlerImpl

void touch(Writable *, Parameter<Operation::TOUCH> const &) override;

std::future<void> flush();
std::future<void> flush(internal::ParsedFlushParams &params);

private:
#if openPMD_HAVE_MPI
Expand Down
39 changes: 35 additions & 4 deletions include/openPMD/Iteration.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
#include "openPMD/auxiliary/Variant.hpp"
#include "openPMD/backend/Attributable.hpp"
#include "openPMD/backend/Container.hpp"
#include "openPMD/backend/HierarchyVisitor.hpp"
#include "openPMD/backend/scientific_defaults/ScientificDefaults.hpp"

#include <cstdint>
#include <deque>
Expand Down Expand Up @@ -145,13 +147,28 @@ namespace internal
std::optional<DeferredParseAccess> m_deferredParseAccess{};
};
} // namespace internal

class Meshes : public Container<Mesh>
{
public:
void visitHierarchy(HierarchyVisitor &v, bool recursive) override;
};

class Particles : public Container<ParticleSpecies>
{
public:
void visitHierarchy(HierarchyVisitor &v, bool recursive) override;
};

/** @brief Logical compilation of data from one snapshot (e.g. a single
* simulation cycle).
*
* @see
* https://github.com/openPMD/openPMD-standard/blob/latest/STANDARD.md#required-attributes-for-the-basepath
*/
class Iteration : public Attributable
class Iteration
: public Attributable
, internal::ScientificDefaults
{
template <typename T, typename T_key, typename T_container>
friend class Container;
Expand All @@ -164,6 +181,8 @@ class Iteration : public Attributable
friend class StatefulSnapshotsContainer;
template <typename>
friend struct traits::GenerationPolicy;
friend class internal::ScientificDefaults;
friend class Attributable;

public:
Iteration(Iteration const &) = default;
Expand Down Expand Up @@ -279,8 +298,10 @@ class Iteration : public Attributable
[[deprecated("This attribute is no longer set by the openPMD-api.")]] bool
closedByWriter() const;

Container<Mesh> meshes{};
Container<ParticleSpecies> particles{}; // particleSpecies?
void visitHierarchy(HierarchyVisitor &v, bool recursive) override;

Meshes meshes{};
Particles particles{};

virtual ~Iteration() = default;

Expand Down Expand Up @@ -442,14 +463,18 @@ class Iteration : public Attributable
*
* @param w The Writable representing the parent.
*/
virtual void linkHierarchy(Writable &w);
void linkHierarchy(Writable &w) override;

/**
* @brief Access an iteration in read mode that has potentially not been
* parsed yet.
*
*/
void runDeferredParseAccess();

protected:
void scientificDefaults_impl(
internal::WriteOrRead, OpenpmdStandard) override;
}; // Iteration

namespace traits
Expand Down Expand Up @@ -513,4 +538,10 @@ class IndexedIteration : public Iteration
: Iteration(std::forward<Iteration_t>(it)), iterationIndex(index)
{}
};

class Iterations : public Container<Iteration, Iteration::IterationIndex_t>
{
public:
void visitHierarchy(HierarchyVisitor &v, bool recursive) override;
};
} // namespace openPMD
12 changes: 12 additions & 0 deletions include/openPMD/Mesh.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@
#include "openPMD/UnitDimension.hpp"
#include "openPMD/backend/Attributable.hpp"
#include "openPMD/backend/BaseRecord.hpp"
#include "openPMD/backend/Container.hpp"
#include "openPMD/backend/MeshRecordComponent.hpp"
#include "openPMD/backend/scientific_defaults/ScientificDefaults.hpp"
#include "openPMD/backend/scientific_defaults/ScientificDefaults_auxiliary.hpp"

#include <ostream>
#include <string>
Expand All @@ -41,6 +44,8 @@ class Mesh : public BaseRecord<MeshRecordComponent>
{
friend class Container<Mesh>;
friend class Iteration;
friend class internal::ScientificDefaults;
friend class Attributable;

public:
Mesh(Mesh const &) = default;
Expand Down Expand Up @@ -322,12 +327,19 @@ class Mesh : public BaseRecord<MeshRecordComponent>
typename = std::enable_if_t<std::is_floating_point<T>::value>>
Mesh &setTimeOffset(T timeOffset);

void visitHierarchy(HierarchyVisitor &v, bool recursive) override;

private:
Mesh();

void
flush_impl(std::string const &, internal::FlushParams const &) override;
void read();
auto retrieveDimensionality() const -> uint64_t;

protected:
void scientificDefaults_impl(
internal::WriteOrRead, OpenpmdStandard) override;
}; // Mesh

template <typename T>
Expand Down
2 changes: 2 additions & 0 deletions include/openPMD/ParticlePatches.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ class ParticlePatches : public Container<PatchRecord>
size_t numPatches() const;
~ParticlePatches() override = default;

void visitHierarchy(HierarchyVisitor &v, bool recursive) override;

private:
ParticlePatches() = default;
void read();
Expand Down
15 changes: 14 additions & 1 deletion include/openPMD/ParticleSpecies.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,23 +24,32 @@
#include "openPMD/Record.hpp"
#include "openPMD/backend/Attributable.hpp"
#include "openPMD/backend/Container.hpp"
#include "openPMD/backend/HierarchyVisitor.hpp"
#include "openPMD/backend/scientific_defaults/ScientificDefaults.hpp"
#include "openPMD/backend/scientific_defaults/ScientificDefaults_auxiliary.hpp"

#include <string>

namespace openPMD
{

class ParticleSpecies : public Container<Record>
class ParticleSpecies
: public Container<Record>
, internal::ScientificDefaults
{
friend class Container<ParticleSpecies>;
friend class Container<Record>;
friend class Iteration;
template <typename T>
friend T &internal::makeOwning(T &self, Series);
friend class internal::ScientificDefaults;
friend class Attributable;

public:
ParticlePatches particlePatches;

void visitHierarchy(HierarchyVisitor &v, bool recursive) override;

private:
ParticleSpecies();

Expand All @@ -53,6 +62,10 @@ class ParticleSpecies : public Container<Record>
{
return m_containerData;
}

protected:
void scientificDefaults_impl(
internal::WriteOrRead, OpenpmdStandard) override;
};

namespace traits
Expand Down
8 changes: 8 additions & 0 deletions include/openPMD/Record.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include "openPMD/RecordComponent.hpp"
#include "openPMD/UnitDimension.hpp"
#include "openPMD/backend/BaseRecord.hpp"
#include "openPMD/backend/scientific_defaults/ScientificDefaults.hpp"

#include <string>
#include <type_traits>
Expand All @@ -34,6 +35,7 @@ class Record : public BaseRecord<RecordComponent>
friend class Container<Record>;
friend class Iteration;
friend class ParticleSpecies;
friend class internal::ScientificDefaults;

public:
Record(Record const &) = default;
Expand All @@ -48,13 +50,19 @@ class Record : public BaseRecord<RecordComponent>
template <typename T>
Record &setTimeOffset(T);

void visitHierarchy(HierarchyVisitor &v, bool recursive) override;

private:
Record();

void
flush_impl(std::string const &, internal::FlushParams const &) override;

[[nodiscard]] internal::HomogenizeExtents read();

protected:
void scientificDefaults_impl(
internal::WriteOrRead, OpenpmdStandard) override;
}; // Record

template <typename T>
Expand Down
Loading
Loading