8#include "pybind11_json/pybind11_json.hpp"
9namespace py = pybind11;
16#include <pybind11/stl.h>
36 .def(
"OpenFile", &tSerializer::OpenFile, py::arg(
"fName"), py::arg(
"read"))
37 .def(
"CloseFile", &tSerializer::CloseFile)
38 .def(
"GoToPath", &tSerializer::GoToPath, py::arg(
"p"))
39 .def(
"CreatePath", &tSerializer::CreatePath, py::arg(
"p"))
40 .def(
"GetCurrentPath", &tSerializer::GetCurrentPath)
41 .def(
"ListCurrentPath", &tSerializer::ListCurrentPath)
42 .def(
"IsPerRank", &tSerializer::IsPerRank);
56 .def(
"SetDeflateLevel", &tSerializer::SetDeflateLevel)
57 .def(
"SetUseCodecOnUint8", &tSerializer::SetUseCodecOnUint8);
69 .def(py::init<const MPIInfo &>(), py::arg(
"mpi"));
71 .def(
"SetChunkAndDeflate", &tSerializer::SetChunkAndDeflate, py::arg(
"n_chunksize"), py::arg(
"n_deflateLevel"))
72 .def(
"SetCollectiveRW", &tSerializer::SetCollectiveRW);
87 py::arg(
"fname"), py::arg(
"mpi"), py::arg(
"rank_part_fmt") =
"%06d",
88 py::arg(
"read") =
false)
93 nlohmann::ordered_json j;
101 nlohmann::json j(options_in);
Shared pybind11 plumbing used by every *_bind.hpp in DNDS (buffer-protocol type check,...
MPI wrappers: MPIInfo, collective operations, type mapping, CommStrategy.
Base types and abstract interface for array serialization.
Configurable factory that builds either a SerializerJSON or a SerializerH5 with all tunables exposed ...
MPI-parallel HDF5 serializer implementing the SerializerBase interface.
Per-rank JSON serializer implementing the SerializerBase interface.
Abstract interface for reading/writing scalars, vectors, and byte arrays.
MPI-parallel HDF5 serializer; all ranks collectively read/write a single .h5 file.
Per-rank JSON file serializer; each MPI rank writes its own .json file.
void pybind11_SerializerBase_define(py::module_ m)
auto pybind11_SerializerJSON_declare(py::module_ m)
void pybind11_SerializerFactory_define(py::module_ m)
void pybind11_SerializerJSON_define(py::module_ m)
auto pybind11_SerializerBase_get_class(py::module_ m)
auto pybind11_SerializerBase_declare(py::module_ m)
void pybind11_bind_Serializer(py::module_ m)
void pybind11_SerializerH5_define(py::module_ m)
auto pybind11_SerializerFactory_declare(py::module_ m)
auto pybind11_SerializerH5_declare(py::module_ m)
py::classh< T > py_class_ssp
void from_json(const nlohmann::ordered_json &j, host_device_vector< real > &v)
void to_json(nlohmann::ordered_json &j, const host_device_vector< real > &v)
Config-backed factory selecting between JSON and HDF5 serializers.
SerializerBaseSSP BuildSerializer(const MPIInfo &mpi)
Instantiate the selected serializer and apply its tunables.
std::tuple< std::string, std::string > ModifyFilePath(std::string fname, const MPIInfo &mpi, std::string rank_part_fmt="%06d", bool read=false)
Expand a user-supplied base file name into the backend-specific path layout.