Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
107 commits
Select commit Hold shift + click to select a range
bbc7e78
Base structure for scientific defaults
franzpoeschel Jan 12, 2026
2c10afc
Start adding defaults
franzpoeschel Jan 12, 2026
a84c715
debugging output
franzpoeschel Jan 12, 2026
09805c6
Fixes
franzpoeschel Jan 12, 2026
965fcad
BaseRecord --> unitDimension
franzpoeschel Jan 12, 2026
47dd320
nunja hehe
franzpoeschel Jan 12, 2026
7f49637
Fixes
franzpoeschel Jan 12, 2026
5d68a68
Further fixes
franzpoeschel Jan 13, 2026
0735fdd
further fixes
franzpoeschel Jan 13, 2026
d861aba
tests temporarily passing :D
franzpoeschel Jan 13, 2026
83c9c76
Cleanup
franzpoeschel Jan 13, 2026
a4d163d
UnitDimension for position/positionOffset
franzpoeschel Jan 13, 2026
1cd7c0d
WIP: RecordComponent stuff
franzpoeschel Jan 13, 2026
615a00d
Fix coretests
franzpoeschel Jan 14, 2026
a3bcd7d
Clean up Iteration finalizing logic
franzpoeschel Jan 14, 2026
f027f5b
Add defaults for Iteration class
franzpoeschel Jan 14, 2026
a469f94
Fix variadic template template parameters
franzpoeschel Jan 15, 2026
24de416
Remove flush-time check for populized components
franzpoeschel Jan 16, 2026
61abebd
Make the default specification more flexible
franzpoeschel Jan 16, 2026
17be0a7
WIP
franzpoeschel Jan 20, 2026
aed4574
continue
franzpoeschel Jan 20, 2026
105a09b
Split this into internal and public header
franzpoeschel Jan 21, 2026
d397399
Distinguish writing from reading
franzpoeschel Jan 21, 2026
a681895
Tests now working again
franzpoeschel Jan 21, 2026
6b50b2d
Mostly move Mesh reading to ScientificDefaults
franzpoeschel Jan 21, 2026
4dae283
Fix type conversions between char and string
franzpoeschel Jan 21, 2026
1ffc588
Somewhat working Mesh reading
franzpoeschel Jan 21, 2026
aa5407d
Fix little parent call bug
franzpoeschel Jan 22, 2026
1a6f171
Mention expected datatypes in attribute reading error messages
franzpoeschel Jan 22, 2026
1091274
Move Iteration reading to ScientificDefaults class
franzpoeschel Jan 22, 2026
068e019
Introduce genericsetter, use for unitDimension
franzpoeschel Jan 22, 2026
2e9efae
Record / BaseRecord Reading
franzpoeschel Jan 22, 2026
3c63b16
Readers for everything now except version-dependent stuff
franzpoeschel Jan 22, 2026
ffa9304
Add gridUnitDimension in ScientificDefaults
franzpoeschel Jan 23, 2026
b7a7849
Do not use templates for defaults setter
franzpoeschel Jan 26, 2026
bfe954f
Wew NewAttributeReader
franzpoeschel Jan 27, 2026
5c4cff0
Fixes
franzpoeschel Jan 27, 2026
b01d16b
Fixes
franzpoeschel Jan 27, 2026
5c27f43
Defaults for patchRecord
franzpoeschel Jan 27, 2026
ed4473c
Adapt PatchRecordComponent
franzpoeschel Jan 27, 2026
df14a37
Fixes
franzpoeschel Jan 27, 2026
0d3664b
Cleanup
franzpoeschel Jan 28, 2026
59e1eaa
Cleanup
franzpoeschel Jan 28, 2026
d3c7a5b
Avoid overcomplex attribute type conversions
franzpoeschel Jan 28, 2026
c720b59
reduce binary size a bit
franzpoeschel Jan 28, 2026
75c697e
Try further reducing amount of lambdas...
franzpoeschel Jan 28, 2026
f235b68
Annotate MB sizes
franzpoeschel Jan 28, 2026
3ac1455
Reduce implementation sizes for RequireScalar / RequireVector
franzpoeschel Jan 29, 2026
210e286
vibe-coded suggestions for size optimization
franzpoeschel Jan 29, 2026
78018fa
Avoid using lambdas for require_type
franzpoeschel Jan 29, 2026
8ace899
Change code order
franzpoeschel Jan 29, 2026
a222056
Replace if constexpr with SFINAE
franzpoeschel Jan 30, 2026
8200e23
Fix nvhpc/msvc builds
franzpoeschel Jan 30, 2026
f5750fb
doxygen fix
franzpoeschel Feb 2, 2026
54d58ef
Cleanup
franzpoeschel Feb 4, 2026
7bb30c2
scientificdefaults_internal.cpp
franzpoeschel Feb 24, 2026
fc35899
Add visitor pattern
franzpoeschel Feb 24, 2026
4e41fdf
wip: ScientificDefaults without CRT
franzpoeschel Feb 24, 2026
8153d1f
Move defaults impl to classes
franzpoeschel Feb 24, 2026
7cd0031
Fix visitHierarchy
franzpoeschel Feb 24, 2026
04821d8
Fix visithierarchy
franzpoeschel Feb 24, 2026
02cf91c
Compiles
franzpoeschel Feb 24, 2026
895fb50
Fix inheritance issue
franzpoeschel Feb 25, 2026
35ec8ae
Cleanup
franzpoeschel Mar 3, 2026
3502c46
Move files
franzpoeschel Mar 3, 2026
4bb6d5c
Split files
franzpoeschel Mar 3, 2026
eb385ed
Cleanup, documentation
franzpoeschel Mar 3, 2026
07d1096
Fix JSON backend bug when missing attributes
franzpoeschel Mar 3, 2026
a00d87e
Fix bug with metadata set too late
franzpoeschel Mar 20, 2026
867ee9a
Write defaults upon flush, thats good enough actually
franzpoeschel Mar 25, 2026
23e378d
... wip visitor without templates ...
franzpoeschel Mar 20, 2026
8f55bfe
somewhat compiles
franzpoeschel Mar 20, 2026
0e47c03
Clean up visitHierarchy API
franzpoeschel Mar 20, 2026
48d4465
Further cleanup
franzpoeschel Mar 20, 2026
14740bf
Implement lambda visitor in terms of explicit visitor
franzpoeschel Mar 20, 2026
110abeb
Fix Python bindings
franzpoeschel Mar 20, 2026
8c34387
populateDefaultMetadata -> commitStructuralSetup
franzpoeschel Mar 25, 2026
a432bd6
Cleanup
franzpoeschel Mar 25, 2026
ac59e11
Documentation
franzpoeschel Mar 25, 2026
2c60cae
Postfix traversal, document visitHierarchy
franzpoeschel Mar 25, 2026
5ec174b
commitStructuralSetup --> populateMissingMetadata(bool recursive)
franzpoeschel Apr 7, 2026
e6c0f67
Flush structural info of resetDataset() to backend immediately
franzpoeschel Mar 11, 2026
3cd3a7b
Erase flushMeshes/ParticlesPath
franzpoeschel Mar 11, 2026
004cd26
Move flushing from storeChunk to resetDataset
franzpoeschel Mar 11, 2026
37db0e0
Hmm, move CREATE_DATASET task back to storeChunk
franzpoeschel Mar 12, 2026
2f44a7a
Fix attribute flushing logic
franzpoeschel Mar 12, 2026
3c29bc2
flush mode helpers
franzpoeschel Jan 14, 2026
5322193
Fix dirty handling
franzpoeschel Jan 14, 2026
53f1ee9
Add TODO comment
franzpoeschel Mar 12, 2026
e022c5f
WIP Runtime verification of flush level
franzpoeschel Mar 12, 2026
238d903
dont flush to IO handler yet in resetDataset
franzpoeschel Mar 13, 2026
5fb1351
Revert "dont flush to IO handler yet in resetDataset"
franzpoeschel Mar 13, 2026
5399557
Continue fixing and breaking things..
franzpoeschel Mar 13, 2026
382c369
Fix API call after rebase
franzpoeschel Mar 16, 2026
ad75351
Fix dirty handling filebased
franzpoeschel Mar 16, 2026
ecc9f1d
TMP REVERT ME: deactivate span table tests
franzpoeschel Mar 16, 2026
e44aa8f
TMP REVERT ME take out hanging parallel test
franzpoeschel Mar 16, 2026
173efa4
Fix ranktable logic
franzpoeschel Mar 27, 2026
9623243
Take out the next hanging parallel test
franzpoeschel Mar 27, 2026
8826d27
Separate MPI tests by MPI barriers
franzpoeschel Mar 27, 2026
9634ae9
Fix wrong MPI_COMM_WORLD
franzpoeschel Mar 27, 2026
e2dd09a
wip: debugging state
franzpoeschel Mar 27, 2026
024f4f2
deactivate malicious tests
franzpoeschel Mar 30, 2026
d1dbe12
Revert "deactivate malicious tests"
franzpoeschel Mar 30, 2026
c8f69e0
Revert "wip: debugging state"
franzpoeschel Mar 30, 2026
d37210c
Revert "TMP REVERT ME take out hanging parallel test"
franzpoeschel Mar 30, 2026
3812746
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
32 changes: 28 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,17 @@ 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(bool write, OpenpmdStandard) override;
}; // Iteration

namespace traits
Expand Down
10 changes: 10 additions & 0 deletions include/openPMD/Mesh.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@
#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 <ostream>
#include <string>
Expand All @@ -41,6 +43,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 +326,18 @@ 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(bool write, 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
13 changes: 12 additions & 1 deletion include/openPMD/ParticleSpecies.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,23 +24,31 @@
#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 <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 +61,9 @@ class ParticleSpecies : public Container<Record>
{
return m_containerData;
}

protected:
void scientificDefaults_impl(bool write, OpenpmdStandard) override;
};

namespace traits
Expand Down
7 changes: 7 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,18 @@ 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(bool write, OpenpmdStandard) override;
}; // Record

template <typename T>
Expand Down
17 changes: 14 additions & 3 deletions include/openPMD/RecordComponent.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
#include "openPMD/auxiliary/UniquePtr.hpp"
#include "openPMD/backend/Attributable.hpp"
#include "openPMD/backend/BaseRecordComponent.hpp"
#include "openPMD/backend/HierarchyVisitor.hpp"
#include "openPMD/backend/scientific_defaults/ScientificDefaults.hpp"

// comment to prevent this include from being moved by clang-format
#include "openPMD/DatatypeMacros.hpp"
Expand Down Expand Up @@ -110,7 +112,9 @@ namespace internal
template <typename>
class BaseRecord;

class RecordComponent : public BaseRecordComponent
class RecordComponent
: public BaseRecordComponent
, protected internal::ScientificDefaults
{
template <typename T, typename T_key, typename T_container>
friend class Container;
Expand All @@ -128,6 +132,8 @@ class RecordComponent : public BaseRecordComponent
friend class MeshRecordComponent;
template <typename T>
friend T &internal::makeOwning(T &self, Series);
friend class internal::ScientificDefaults;
friend class Attributable;

public:
enum class Allocation
Expand Down Expand Up @@ -482,11 +488,13 @@ class RecordComponent : public BaseRecordComponent
auto visit(Args &&...args) -> decltype(Visitor::template call<char>(
std::declval<RecordComponent &>(), std::forward<Args>(args)...));

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

static constexpr char const *const SCALAR = "\vScalar";

protected:
void flush(std::string const &, internal::FlushParams const &);
void read(bool require_unit_si);
void read();

private:
/**
Expand Down Expand Up @@ -534,12 +542,15 @@ OPENPMD_protected
BaseRecordComponent::setData(m_recordComponentData);
}

void readBase(bool require_unit_si);
void readBase();

template <typename T>
void verifyChunk(Offset const &, Extent const &) const;

void verifyChunk(Datatype, Offset const &, Extent const &) const;

protected:
void scientificDefaults_impl(bool write, OpenpmdStandard) override;
}; // RecordComponent

namespace internal
Expand Down
Loading
Loading