openPMD-api
 
Loading...
Searching...
No Matches
openPMD::Dataset Class Reference

Public Types

enum  : std::uint64_t { JOINED_DIMENSION = std::numeric_limits<std::uint64_t>::max() , UNDEFINED_EXTENT = std::numeric_limits<std::uint64_t>::max() - 1 }
 

Public Member Functions

 Dataset (Datatype, Extent, std::string options="{}")
 
 Dataset (Extent={UNDEFINED_EXTENT})
 Constructor that sets the datatype to undefined.
 
Datasetextend (Extent newExtent)
 
bool empty () const
 
std::optional< size_t > joinedDimension () const
 
bool undefinedExtent () const
 

Static Public Member Functions

static std::optional< size_t > joinedDimension (Extent const &)
 
static bool undefinedExtent (Extent const &)
 

Public Attributes

Extent extent
 
Datatype dtype
 
uint8_t rank
 
std::string options = "{}"
 backend-dependent JSON configuration
 

Friends

class RecordComponent
 

Member Enumeration Documentation

◆ anonymous enum

anonymous enum : std::uint64_t
Enumerator
JOINED_DIMENSION 

Setting one dimension of the extent as JOINED_DIMENSION means that the extent along that dimension will be defined by the sum of all parallel processes' contributions.

Only one dimension can be joined. For store operations, the offset should be an empty array and the extent should give the actual extent of the chunk (i.e. the number of joined elements along the joined dimension, equal to the global extent in all other dimensions). For more details, refer to docs/source/usage/workflow.rst.

UNDEFINED_EXTENT 

In some use cases, the extent needs not be specified.

For these, specify Extent{UNDEFINED_EXTENT}. Use cases:

  1. Some backends (i.e. JSON and TOML in template mode) support the creation of datasets with undefined datatype and extent. The extent should be given as {UNDEFINED_EXTENT} for that.
  2. With openPMD 2.0, the shape of constant components may be omitted in writing if it is defined somewhere else as part of the same Mesh / Species. (https://github.com/openPMD/openPMD-standard/pull/289) When reading such datasets, the openPMD-api will try to fill in the missing extents, so the extent for constistently-defined datasets should ideally not be reported by the read-side API as undefined.

Constructor & Destructor Documentation

◆ Dataset()

openPMD::Dataset::Dataset ( Extent e = {UNDEFINED_EXTENT})

Constructor that sets the datatype to undefined.

Helpful for:

  1. Resizing datasets, since datatypes need not be given twice.
  2. Initializing datasets as undefined, as used by template mode in the JSON/TOML backend. In this case, the default (undefined) specification for the Extent may be used.

The documentation for this class was generated from the following files: