24#include "openPMD/IO/AbstractIOHandler.hpp"
25#include "openPMD/config.hpp"
27#include "openPMD/IO/AbstractIOHandlerImpl.hpp"
29#include "openPMD/auxiliary/JSON_internal.hpp"
33#include <unordered_map>
34#include <unordered_set>
40class HDF5IOHandlerImpl :
public AbstractIOHandlerImpl
42 friend class HDF5IOHandler;
43 friend class ParallelHDF5IOHandler;
47 ~HDF5IOHandlerImpl()
override;
87 std::unordered_map<Writable *, std::string> m_fileNames;
88 std::unordered_map<std::string, hid_t> m_fileNamesWithID;
90 std::unordered_set<hid_t> m_openFileIDs;
92 hid_t m_datasetTransferProperty;
93 hid_t m_fileAccessProperty;
94 hid_t m_fileCreateProperty;
96 hbool_t m_hdf5_collective_metadata = 1;
99 hid_t m_H5T_BOOL_ENUM;
102 hid_t m_H5T_CLONG_DOUBLE;
111 hid_t m_H5T_LONG_DOUBLE_80_LE;
112 hid_t m_H5T_CLONG_DOUBLE_80_LE;
122 std::optional<MPI_Comm> m_communicator;
126 nlohmann::json m_global_dataset_config;
127 nlohmann::json m_global_flush_config;
135 std::optional<File> getFile(
Writable *);
137 requireFile(std::string
const &functionName,
Writable *,
bool checkParent);
Interface for communicating between logical and physically persistent data.
Definition AbstractIOHandler.hpp:206
Definition HDF5IOHandlerImpl.hpp:41
void createDataset(Writable *, Parameter< Operation::CREATE_DATASET > const &) override
Create a new dataset of given type, extent and storage properties.
Definition HDF5IOHandler.cpp:825
void deleteAttribute(Writable *, Parameter< Operation::DELETE_ATT > const &) override
Delete an existing attribute.
Definition HDF5IOHandler.cpp:1797
void listPaths(Writable *, Parameter< Operation::LIST_PATHS > &) override
List all paths/sub-groups inside a group, non-recursively.
Definition HDF5IOHandler.cpp:3127
void openFile(Writable *, Parameter< Operation::OPEN_FILE > &) override
Open an existing file assuming it conforms to openPMD.
Definition HDF5IOHandler.cpp:1247
void closeFile(Writable *, Parameter< Operation::CLOSE_FILE > const &) override
Close the file corresponding with the writable and release file handles.
Definition HDF5IOHandler.cpp:1300
void deleteDataset(Writable *, Parameter< Operation::DELETE_DATASET > const &) override
Delete an existing dataset.
Definition HDF5IOHandler.cpp:1745
void extendDataset(Writable *, Parameter< Operation::EXTEND_DATASET > const &) override
Increase the extent of an existing dataset.
Definition HDF5IOHandler.cpp:1106
void availableChunks(Writable *, Parameter< Operation::AVAILABLE_CHUNKS > &) override
Report chunks that are available for loading from the dataset represented by this writable.
Definition HDF5IOHandler.cpp:1177
void deregister(Writable *, Parameter< Operation::DEREGISTER > const &) override
Notify the backend that the Writable has been / will be deallocated.
Definition HDF5IOHandler.cpp:3315
void readDataset(Writable *, Parameter< Operation::READ_DATASET > &) override
Read a chunk of data from an existing dataset.
Definition HDF5IOHandler.cpp:2321
void writeAttribute(Writable *, Parameter< Operation::WRITE_ATT > const &) override
Create a single attribute and fill the value, possibly overwriting an existing attribute.
Definition HDF5IOHandler.cpp:1979
void listDatasets(Writable *, Parameter< Operation::LIST_DATASETS > &) override
List all datasets inside a group, non-recursively.
Definition HDF5IOHandler.cpp:3182
void deleteFile(Writable *, Parameter< Operation::DELETE_FILE > const &) override
Delete an existing file from physical storage.
Definition HDF5IOHandler.cpp:1658
void createFile(Writable *, Parameter< Operation::CREATE_FILE > const &) override
Create a new file in physical storage, possibly overriding an existing file.
Definition HDF5IOHandler.cpp:278
void touch(Writable *, Parameter< Operation::TOUCH > const &) override
Treat this writable's file as open/active/dirty.
Definition HDF5IOHandler.cpp:3321
void checkFile(Writable *, Parameter< Operation::CHECK_FILE > &) override
Check if the file specified by the parameter is already present on disk.
Definition HDF5IOHandler.cpp:349
void listAttributes(Writable *, Parameter< Operation::LIST_ATTS > &) override
List all attributes associated with an object.
Definition HDF5IOHandler.cpp:3238
void openDataset(Writable *, Parameter< Operation::OPEN_DATASET > &) override
Open an existing dataset and determine its datatype and extent.
Definition HDF5IOHandler.cpp:1406
void deletePath(Writable *, Parameter< Operation::DELETE_PATH > const &) override
Delete all objects within an existing path.
Definition HDF5IOHandler.cpp:1693
void readAttribute(Writable *, Parameter< Operation::READ_ATT > &) override
Read the value of an existing attribute.
Definition HDF5IOHandler.cpp:2488
void createPath(Writable *, Parameter< Operation::CREATE_PATH > const &) override
Create all necessary groups for a path, possibly recursively.
Definition HDF5IOHandler.cpp:383
void openPath(Writable *, Parameter< Operation::OPEN_PATH > const &) override
Open all contained groups in a path, possibly recursively.
Definition HDF5IOHandler.cpp:1318
void writeDataset(Writable *, Parameter< Operation::WRITE_DATASET > &) override
Write a chunk of data into an existing dataset.
Definition HDF5IOHandler.cpp:1832
Layer to mirror structure of logical data and persistent data in file.
Definition Writable.hpp:76
Extend nlohmann::json with tracing of which keys have been accessed by operator[]().
Definition JSON_internal.hpp:69
Public definitions of openPMD-api.
Definition Date.cpp:29
Typesafe description of all required arguments for a specified Operation.
Definition IOTask.hpp:148
Definition FlushParametersInternal.hpp:32