DNDSR 0.1.0.dev1+gcd065ad
Distributed Numeric Data Structure for CFV
Loading...
Searching...
No Matches
DNDS::Serializer::SerializerFactory Struct Reference

Config-backed factory selecting between JSON and HDF5 serializers. More...

#include <SerializerFactory.hpp>

Collaboration diagram for DNDS::Serializer::SerializerFactory:
[legend]

Public Member Functions

 SerializerFactory ()=default
 
 SerializerFactory (const std::string &_type)
 Construct with a specific backend name; other fields stay at defaults.
 
 DNDS_DECLARE_CONFIG (SerializerFactory)
 
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.
 

Public Attributes

std::string type = "JSON"
 Backend selector: "JSON" or "H5".
 
int hdfDeflateLevel = 0
 HDF5 gzip deflate level (0 = off, 9 = max).
 
int hdfChunkSize = 0
 HDF5 chunk size (0 = library-chosen auto).
 
bool hdfCollOnData = false
 Use collective HDF5 I/O for data arrays.
 
bool hdfCollOnMeta = true
 Use collective HDF5 I/O for metadata (usually safe).
 
int jsonBinaryDeflateLevel = 5
 Compression level used by the JSON backend's binary codec.
 
bool jsonUseCodecOnUInt8 = true
 Whether to apply the byte-codec to uint8 arrays in JSON (faster writes).
 

Detailed Description

Config-backed factory selecting between JSON and HDF5 serializers.

Exposes the tunables of both backends under a single config schema so users can switch formats by changing one JSON field. See DNDS_DECLARE_CONFIG body for the full list of fields.

Definition at line 21 of file SerializerFactory.hpp.

Constructor & Destructor Documentation

◆ SerializerFactory() [1/2]

DNDS::Serializer::SerializerFactory::SerializerFactory ( )
default

◆ SerializerFactory() [2/2]

DNDS::Serializer::SerializerFactory::SerializerFactory ( const std::string &  _type)
inline

Construct with a specific backend name; other fields stay at defaults.

Definition at line 40 of file SerializerFactory.hpp.

Member Function Documentation

◆ BuildSerializer()

SerializerBaseSSP DNDS::Serializer::SerializerFactory::BuildSerializer ( const MPIInfo mpi)
inline

Instantiate the selected serializer and apply its tunables.

Parameters
mpiMPI context (used only by the H5 backend).

Definition at line 59 of file SerializerFactory.hpp.

Here is the caller graph for this function:

◆ DNDS_DECLARE_CONFIG()

DNDS::Serializer::SerializerFactory::DNDS_DECLARE_CONFIG ( SerializerFactory  )
inline

Definition at line 42 of file SerializerFactory.hpp.

Here is the call graph for this function:

◆ ModifyFilePath()

std::tuple< std::string, std::string > DNDS::Serializer::SerializerFactory::ModifyFilePath ( std::string  fname,
const MPIInfo mpi,
std::string  rank_part_fmt = "%06d",
bool  read = false 
)
inline

Expand a user-supplied base file name into the backend-specific path layout.

JSON uses one file per rank under a <name>.dir/ directory (<rank>.json); H5 produces a single <name>.dnds.h5 file.

Parameters
fnameBase name supplied by the user (without suffix).
mpiMPI context (rank used for JSON per-rank filename).
rank_part_fmtprintf-style format used for the JSON rank-id component.
readtrue for read (skips directory creation).
Returns
Tuple (finalFilePath, displayPath) – the display path is the JSON dir or the H5 file, depending on backend.

Definition at line 92 of file SerializerFactory.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ hdfChunkSize

int DNDS::Serializer::SerializerFactory::hdfChunkSize = 0

HDF5 chunk size (0 = library-chosen auto).

Definition at line 28 of file SerializerFactory.hpp.

◆ hdfCollOnData

bool DNDS::Serializer::SerializerFactory::hdfCollOnData = false

Use collective HDF5 I/O for data arrays.

Definition at line 30 of file SerializerFactory.hpp.

◆ hdfCollOnMeta

bool DNDS::Serializer::SerializerFactory::hdfCollOnMeta = true

Use collective HDF5 I/O for metadata (usually safe).

Definition at line 32 of file SerializerFactory.hpp.

◆ hdfDeflateLevel

int DNDS::Serializer::SerializerFactory::hdfDeflateLevel = 0

HDF5 gzip deflate level (0 = off, 9 = max).

Definition at line 26 of file SerializerFactory.hpp.

◆ jsonBinaryDeflateLevel

int DNDS::Serializer::SerializerFactory::jsonBinaryDeflateLevel = 5

Compression level used by the JSON backend's binary codec.

Definition at line 34 of file SerializerFactory.hpp.

◆ jsonUseCodecOnUInt8

bool DNDS::Serializer::SerializerFactory::jsonUseCodecOnUInt8 = true

Whether to apply the byte-codec to uint8 arrays in JSON (faster writes).

Definition at line 36 of file SerializerFactory.hpp.

◆ type

std::string DNDS::Serializer::SerializerFactory::type = "JSON"

Backend selector: "JSON" or "H5".

Definition at line 24 of file SerializerFactory.hpp.


The documentation for this struct was generated from the following file: