Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
2ebbece
[pre-commit.ci] pre-commit autoupdate (#1853)
pre-commit-ci[bot] Mar 3, 2026
30061c6
Fix parallel deletion (#1858)
franzpoeschel Mar 3, 2026
cf3e1c5
Harmonize Datatype equality checks (#1854)
franzpoeschel Mar 4, 2026
c128403
Cache Iteration indexes instead of computing them on the spot (#1860)
guj Mar 10, 2026
17eb5e5
Do not flush if the backend does not support Span API (#1863)
franzpoeschel Mar 17, 2026
2552e63
create_directories: preserve sticky and setgid permissions (#1855)
franzpoeschel Mar 17, 2026
a307fd2
Python: Fix keep_alive specifications, add tests for keep_alive (#1851)
franzpoeschel Mar 17, 2026
5861118
Remove duplicate Python test (#1867)
franzpoeschel Mar 26, 2026
dd72086
Keep written flag consistent across MPI ranks for rankTable (#1869)
franzpoeschel Mar 30, 2026
cd6ee79
Flush dirty ADIOS2 files in sorted order (#1868)
franzpoeschel Mar 30, 2026
4b9ee19
HDF5: Close operations also upon failure (#1866)
franzpoeschel Apr 2, 2026
3a290ec
HDF5: proper status check (#1870)
franzpoeschel Apr 7, 2026
2540d26
Do not initially emplace any value for the cached Iteration index (#1…
franzpoeschel Apr 20, 2026
7aceab3
Fix defer::to_opaque (#1872)
franzpoeschel Apr 21, 2026
485b1c7
Remove catch2/catch_tostring.hpp include (#1875)
franzpoeschel Apr 22, 2026
68521cd
Add memory selection task to backend
franzpoeschel Aug 7, 2025
3f7b894
Add future helper
franzpoeschel Aug 7, 2025
cf2295b
Fixes for UniquePtr.hpp
franzpoeschel Aug 7, 2025
f698c25
Main implementation of LoadStoreChunk.hpp
franzpoeschel Aug 7, 2025
51ce207
Adapt RecordComponent implementation based on new API
franzpoeschel Aug 7, 2025
3063d62
Testing
franzpoeschel Aug 7, 2025
4d9198c
Enable support for const unique pointers?
franzpoeschel Aug 7, 2025
c21e608
Use a better trick to cheat clang-tidy
franzpoeschel Aug 7, 2025
51b4363
clang-tidy fixes
franzpoeschel Aug 8, 2025
c8c648d
Fix linker error
franzpoeschel Jan 8, 2026
92103ee
Reimplement unique_ptr-based span API
franzpoeschel Jan 8, 2026
7392415
Fix parallel tests
franzpoeschel Jan 8, 2026
06797e4
Type signature fix
franzpoeschel Jan 8, 2026
64d8606
Destructor for ~DeferredComputation
franzpoeschel Jan 9, 2026
77b731d
CI fixes
franzpoeschel Feb 3, 2026
db35556
wip: runtime-erase pointer type
franzpoeschel Feb 9, 2026
b87f4c0
Continue
franzpoeschel Feb 9, 2026
1e015ca
Mostly working again
franzpoeschel Feb 9, 2026
5d9c48c
bad fix, remove the bool from python bindings
franzpoeschel Feb 9, 2026
8ce5ade
Remove bool dataset operations from python API
franzpoeschel Feb 9, 2026
69560e0
Fix Coretest
franzpoeschel Feb 9, 2026
3545bb2
instantiate some more methods
franzpoeschel Feb 10, 2026
f1621c2
wip: unify common code into compiled functions
franzpoeschel Feb 10, 2026
a3fe3c2
clang-tidy fixes
franzpoeschel Feb 10, 2026
c7b0fbb
CI fixes
franzpoeschel Feb 11, 2026
529e533
Remove CRT pattern and core namespace
franzpoeschel Feb 12, 2026
fe6ba78
Move wrappers to header code
franzpoeschel Feb 12, 2026
d66ce95
Interface cleanup
franzpoeschel Feb 13, 2026
7f55724
Fix after rebase
franzpoeschel Mar 12, 2026
ad26c7f
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Mar 12, 2026
14c0251
Suffix ..Raw for internal legacy store/load operations
franzpoeschel Apr 7, 2026
a29cfcc
Remove enqueue prefixes, these are now default
franzpoeschel Apr 7, 2026
37924fc
Add future task with caching option
franzpoeschel Apr 7, 2026
c01e277
Add unsafeNoAutomaticFlush
franzpoeschel Apr 7, 2026
ee5e4f0
add missing constructor
franzpoeschel Apr 7, 2026
fb97579
remove internal use of raw methods
franzpoeschel Apr 7, 2026
3a33740
Remove raw methods
franzpoeschel Apr 7, 2026
f612b87
Avoid if constexpr, msvc doesnt get it
franzpoeschel Apr 8, 2026
4e22c20
Add Doxygen documentation to new functions and types
Apr 8, 2026
2bfc947
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Apr 8, 2026
1a84201
CI fixes
franzpoeschel Apr 8, 2026
65ddc5c
Documentation fixes
franzpoeschel Apr 14, 2026
3c76383
AI code review
franzpoeschel Apr 20, 2026
4268568
Rename forget() -> invalidate()
franzpoeschel Apr 20, 2026
e84e05c
Fix MSVC compilation
franzpoeschel Apr 21, 2026
2301ea2
Fix move constructor / assignment operator
franzpoeschel Apr 22, 2026
3ba15d5
Add a small test for DeferredComputation
franzpoeschel Apr 22, 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
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ repos:
# clang-format v13
# to run manually, use .github/workflows/clang-format/clang-format.sh
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v21.1.8
rev: v22.1.0
hooks:
- id: clang-format
# By default, the clang-format hook configures:
Expand All @@ -88,7 +88,7 @@ repos:
# Sorts Python imports according to PEP8
# https://www.python.org/dev/peps/pep-0008/#imports
- repo: https://github.com/pycqa/isort
rev: 7.0.0
rev: 8.0.1
hooks:
- id: isort
name: isort (python)
Expand Down
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,7 @@ set(CORE_SOURCE
src/Format.cpp
src/Iteration.cpp
src/IterationEncoding.cpp
src/LoadStoreChunk.cpp
src/Mesh.cpp
src/ParticlePatches.cpp
src/ParticleSpecies.cpp
Expand All @@ -411,6 +412,7 @@ set(CORE_SOURCE
src/version.cpp
src/auxiliary/Date.cpp
src/auxiliary/Filesystem.cpp
src/auxiliary/Future.cpp
src/auxiliary/JSON.cpp
src/auxiliary/JSONMatcher.cpp
src/auxiliary/Memory.cpp
Expand Down Expand Up @@ -826,6 +828,7 @@ if(openPMD_BUILD_TESTING)
elseif(${test_name} STREQUAL "Core")
list(APPEND ${out_list}
test/Files_Core/automatic_variable_encoding.cpp
test/Files_Core/read_nonexistent_attribute.cpp
)
endif()
endmacro()
Expand Down
12 changes: 12 additions & 0 deletions include/openPMD/Dataset.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,18 @@ namespace openPMD
using Extent = std::vector<std::uint64_t>;
using Offset = std::vector<std::uint64_t>;

/** Selection of a region of memory for storing chunks.
*
* Used to specify a non-contiguous memory region when storing
* data chunks. This allows writing data that is not contiguous
* in memory.
*/
struct MemorySelection
{
Offset offset;
Extent extent;
};

class Dataset
{
friend class RecordComponent;
Expand Down
138 changes: 90 additions & 48 deletions include/openPMD/Datatype.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,8 @@ template <typename T>
inline constexpr Datatype determineDatatype(T &&val)
{
(void)val; // don't need this, it only has a name for Doxygen
using T_stripped = std::remove_cv_t<std::remove_reference_t<T>>;
using T_stripped =
std::remove_extent_t<std::remove_cv_t<std::remove_reference_t<T>>>;
if constexpr (auxiliary::IsPointer_v<T_stripped>)
{
return determineDatatype<auxiliary::IsPointer_t<T_stripped>>();
Expand Down Expand Up @@ -419,6 +420,13 @@ inline size_t toBits(Datatype d)
return toBytes(d) * CHAR_BIT;
}

/** Check if a Datatype is a signed type
*
* @param d Datatype to test
* @return true if signed type (integer, floating point, complex), else false
*/
constexpr bool isSigned(Datatype d);

/** Compare if a Datatype is a vector type
*
* @param d Datatype to test
Expand Down Expand Up @@ -595,14 +603,26 @@ inline std::tuple<bool, bool> isInteger()
*/
template <typename T_FP>
inline bool isSameFloatingPoint(Datatype d)
{
return isSameFloatingPoint(d, determineDatatype<T_FP>());
}

/** Compare if two Datatypes are equivalent floating point types
*
* @param d1 First Datatype to compare
* @param d2 Second Datatype to compare
* @return true if both types are floating point and have same bitness, else
* false
*/
inline bool isSameFloatingPoint(Datatype d1, Datatype d2)
{
// template
bool tt_is_fp = isFloatingPoint<T_FP>();
bool tt_is_fp = isFloatingPoint(d1);

// Datatype
bool dt_is_fp = isFloatingPoint(d);
bool dt_is_fp = isFloatingPoint(d2);

if (tt_is_fp && dt_is_fp && toBits(d) == toBits(determineDatatype<T_FP>()))
if (tt_is_fp && dt_is_fp && toBits(d1) == toBits(d2))
return true;
else
return false;
Expand All @@ -617,15 +637,26 @@ inline bool isSameFloatingPoint(Datatype d)
*/
template <typename T_CFP>
inline bool isSameComplexFloatingPoint(Datatype d)
{
return isSameComplexFloatingPoint(d, determineDatatype<T_CFP>());
}

/** Compare if two Datatypes are equivalent complex floating point types
*
* @param d1 First Datatype to compare
* @param d2 Second Datatype to compare
* @return true if both types are complex floating point and have same bitness,
* else false
*/
inline bool isSameComplexFloatingPoint(Datatype d1, Datatype d2)
{
// template
bool tt_is_cfp = isComplexFloatingPoint<T_CFP>();
bool tt_is_cfp = isComplexFloatingPoint(d1);

// Datatype
bool dt_is_cfp = isComplexFloatingPoint(d);
bool dt_is_cfp = isComplexFloatingPoint(d2);

if (tt_is_cfp && dt_is_cfp &&
toBits(d) == toBits(determineDatatype<T_CFP>()))
if (tt_is_cfp && dt_is_cfp && toBits(d1) == toBits(d2))
return true;
else
return false;
Expand All @@ -640,17 +671,29 @@ inline bool isSameComplexFloatingPoint(Datatype d)
*/
template <typename T_Int>
inline bool isSameInteger(Datatype d)
{
return isSameInteger(d, determineDatatype<T_Int>());
}

/** Compare if two Datatypes are equivalent integer types
*
* @param d1 First Datatype to compare
* @param d2 Second Datatype to compare
* @return true if both types are integers, same signedness and same bitness,
* else false
*/
inline bool isSameInteger(Datatype d1, Datatype d2)
{
// template
bool tt_is_int, tt_is_sig;
std::tie(tt_is_int, tt_is_sig) = isInteger<T_Int>();
std::tie(tt_is_int, tt_is_sig) = isInteger(d1);

// Datatype
bool dt_is_int, dt_is_sig;
std::tie(dt_is_int, dt_is_sig) = isInteger(d);
std::tie(dt_is_int, dt_is_sig) = isInteger(d2);

if (tt_is_int && dt_is_int && tt_is_sig == dt_is_sig &&
toBits(d) == toBits(determineDatatype<T_Int>()))
toBits(d1) == toBits(d2))
return true;
else
return false;
Expand Down Expand Up @@ -691,46 +734,26 @@ constexpr bool isChar(Datatype d)
template <typename T_Char>
constexpr bool isSameChar(Datatype d);

/** Compare if two Datatypes are equivalent char types
*
* @param d1 First Datatype to compare
* @param d2 Second Datatype to compare
* @return true if both types are chars with same signedness and size, else
* false
*/
constexpr bool isSameChar(Datatype d1, Datatype d2);

/** Comparison for two Datatypes
*
* Besides returning true for the same types, identical implementations on
* some platforms, e.g. if long and long long are the same or double and
* long double will also return true.
*
* @param d First Datatype to compare
* @param e Second Datatype to compare
* @return true if the datatypes are equivalent
*/
inline bool isSame(openPMD::Datatype const d, openPMD::Datatype const e)
{
// exact same type
if (static_cast<int>(d) == static_cast<int>(e))
return true;

bool d_is_vec = isVector(d);
bool e_is_vec = isVector(e);

// same int
bool d_is_int, d_is_sig;
std::tie(d_is_int, d_is_sig) = isInteger(d);
bool e_is_int, e_is_sig;
std::tie(e_is_int, e_is_sig) = isInteger(e);
if (d_is_int && e_is_int && d_is_vec == e_is_vec && d_is_sig == e_is_sig &&
toBits(d) == toBits(e))
return true;

// same float
bool d_is_fp = isFloatingPoint(d);
bool e_is_fp = isFloatingPoint(e);

if (d_is_fp && e_is_fp && d_is_vec == e_is_vec && toBits(d) == toBits(e))
return true;

// same complex floating point
bool d_is_cfp = isComplexFloatingPoint(d);
bool e_is_cfp = isComplexFloatingPoint(e);

if (d_is_cfp && e_is_cfp && d_is_vec == e_is_vec && toBits(d) == toBits(e))
return true;

return false;
}
constexpr bool isSame(openPMD::Datatype d, openPMD::Datatype e);

/**
* @brief basicDatatype Strip openPMD Datatype of std::vector, std::array et.
Expand All @@ -740,15 +763,34 @@ inline bool isSame(openPMD::Datatype const d, openPMD::Datatype const e)
*/
Datatype basicDatatype(Datatype dt);

/** Convert a scalar Datatype to its vector variant
*
* @param dt Scalar Datatype to convert
* @return Vector Datatype (e.g., INT becomes VEC_INT)
*/
Datatype toVectorType(Datatype dt);

/** Convert a Datatype to its string representation
*
* @param dt Datatype to convert
* @return String representation of the Datatype
*/
std::string datatypeToString(Datatype dt);

/** Convert a string to a Datatype
*
* @param s String representation of a Datatype
* @return The corresponding Datatype
*/
Datatype stringToDatatype(const std::string &s);

void warnWrongDtype(std::string const &key, Datatype store, Datatype request);

std::ostream &operator<<(std::ostream &, openPMD::Datatype const &);
/** Stream operator for Datatype
*
* @param os Output stream
* @param dt Datatype to output
* @return Reference to the stream
*/
std::ostream &operator<<(std::ostream &os, openPMD::Datatype const &dt);

template <typename T>
constexpr auto datatypeIndex() -> size_t
Expand Down
Loading
Loading