openPMD-api
Classes | Typedefs | Enumerations | Functions | Variables
openPMD Namespace Reference

Public definitions of openPMD-api. More...

Classes

class  AbstractFilePosition
 
class  AbstractIOHandler
 Interface for communicating between logical and physically persistent data. More...
 
class  AbstractIOHandlerImpl
 
class  AbstractIOHandlerImplCommon
 
struct  AbstractParameter
 
struct  ADIOS1FilePosition
 
class  ADIOS1IOHandler
 
class  ADIOS1IOHandlerImpl
 
struct  ADIOS2FilePosition
 
class  ADIOS2IOHandler
 
class  ADIOS2IOHandlerImpl
 
class  Attributable
 Layer to manage storage of attributes associated with file objects. More...
 
class  Attribute
 Varidic datatype supporting at least all formats for attributes specified in the openPMD standard. More...
 
class  BaseRecord
 
class  BaseRecordComponent
 
class  BlockSlicer
 Abstract class to associate a thread with its local cuboid in the total cuboid. More...
 
struct  ChunkInfo
 Represents the meta info around a chunk in a dataset. More...
 
class  Container
 Map-like container that enforces openPMD requirements and handles IO. More...
 
class  Dataset
 
class  DatasetFiller
 An abstract class to create one iteration of data per thread. More...
 
struct  decay_equiv
 Fundamental equivalence check for two given types T and U. More...
 
struct  DoConvert
 
struct  DoConvert< std::vector< T >, std::vector< U >, false >
 
struct  DoConvert< T, U, false >
 
struct  DoConvert< T, U, true >
 
class  DummyIOHandler
 Dummy handler without any IO operations. More...
 
struct  File
 
struct  GetH5DataType
 
struct  HDF5FilePosition
 
class  HDF5IOHandler
 
class  HDF5IOHandlerImpl
 
class  IndexedIteration
 Subclass of Iteration that knows its own index withing the containing Series. More...
 
struct  InvalidatableFile
 Wrapper around a shared pointer to: More...
 
class  IOTask
 Self-contained description of a single IO operation. More...
 
class  Iteration
 Logical compilation of data from one snapshot (e.g. More...
 
struct  JSONFilePosition
 
class  JSONIOHandler
 
class  JSONIOHandlerImpl
 
class  Mesh
 Container for N-dimensional, homogeneous Records. More...
 
class  MeshRecordComponent
 
class  MPIBenchmark
 Class representing a benchmark. More...
 
struct  MPIBenchmarkReport
 The report for a single benchmark produced by <openPMD/benchmark/mpi/MPIBenchmark>. More...
 
class  no_such_attribute_error
 
class  no_such_file_error
 
class  OneDimensionalBlockSlicer
 
class  ParallelADIOS1IOHandler
 
class  ParallelADIOS1IOHandlerImpl
 
class  ParallelHDF5IOHandler
 
class  ParallelHDF5IOHandlerImpl
 
struct  Parameter
 Typesafe description of all required arguments for a specified Operation. More...
 
struct  Parameter< Operation::ADVANCE >
 
struct  Parameter< Operation::AVAILABLE_CHUNKS >
 
struct  Parameter< Operation::CLOSE_FILE >
 
struct  Parameter< Operation::CLOSE_PATH >
 
struct  Parameter< Operation::CREATE_DATASET >
 
struct  Parameter< Operation::CREATE_FILE >
 
struct  Parameter< Operation::CREATE_PATH >
 
struct  Parameter< Operation::DELETE_ATT >
 
struct  Parameter< Operation::DELETE_DATASET >
 
struct  Parameter< Operation::DELETE_FILE >
 
struct  Parameter< Operation::DELETE_PATH >
 
struct  Parameter< Operation::EXTEND_DATASET >
 
struct  Parameter< Operation::LIST_ATTS >
 
struct  Parameter< Operation::LIST_DATASETS >
 
struct  Parameter< Operation::LIST_PATHS >
 
struct  Parameter< Operation::OPEN_DATASET >
 
struct  Parameter< Operation::OPEN_FILE >
 
struct  Parameter< Operation::OPEN_PATH >
 
struct  Parameter< Operation::READ_ATT >
 
struct  Parameter< Operation::READ_DATASET >
 
struct  Parameter< Operation::WRITE_ATT >
 
struct  Parameter< Operation::WRITE_DATASET >
 
class  ParticlePatches
 
class  ParticleSpecies
 
class  PatchRecord
 
class  PatchRecordComponent
 
class  RandomDatasetFiller
 
class  ReadIterations
 Reading side of the streaming API. More...
 
class  Record
 
class  RecordComponent
 
class  Series
 Root level of the openPMD hierarchy. More...
 
class  SeriesIterator
 
class  SimpleDatasetFillerProvider
 
class  unsupported_data_error
 
class  Writable
 Layer to mirror structure of logical data and persistent data in file. More...
 
class  WriteIterations
 Writing side of the streaming API. More...
 
struct  WrittenChunkInfo
 Represents the meta info around a chunk that has been written by some data producing application. More...
 

Typedefs

using iterator_t = Container< Iteration, uint64_t >::iterator
 
using ChunkTable = std::vector< WrittenChunkInfo >
 
using Extent = std::vector< std::uint64_t >
 
using Offset = std::vector< std::uint64_t >
 
typedef Access AccessType
 

Enumerations

enum  Datatype : int {
  CHAR = 0, UCHAR, SHORT, INT,
  LONG, LONGLONG, USHORT, UINT,
  ULONG, ULONGLONG, FLOAT, DOUBLE,
  LONG_DOUBLE, CFLOAT, CDOUBLE, CLONG_DOUBLE,
  STRING, VEC_CHAR, VEC_SHORT, VEC_INT,
  VEC_LONG, VEC_LONGLONG, VEC_UCHAR, VEC_USHORT,
  VEC_UINT, VEC_ULONG, VEC_ULONGLONG, VEC_FLOAT,
  VEC_DOUBLE, VEC_LONG_DOUBLE, VEC_CFLOAT, VEC_CDOUBLE,
  VEC_CLONG_DOUBLE, VEC_STRING, ARR_DBL_7, BOOL,
  DATATYPE = 1000, UNDEFINED
}
 Concrete datatype of an object available at runtime.
 
enum  Access { Access::READ_ONLY, Access::READ_WRITE, Access::CREATE }
 File access mode to use during IO. More...
 
enum  Format {
  HDF5, ADIOS1, ADIOS2, ADIOS2_SST,
  JSON, DUMMY
}
 File format to use during IO.
 
enum  IterationEncoding { fileBased, groupBased }
 Encoding scheme of an Iterations Series'. More...
 
enum  AdvanceStatus : unsigned char { OK, OVER }
 In step-based mode (i.e. More...
 
enum  AdvanceMode : unsigned char { BEGINSTEP, ENDSTEP }
 In step-based mode (i.e. More...
 
enum  StepStatus : unsigned char { DuringStep, NoStep }
 Used in step-based mode (i.e. More...
 
enum  UnitDimension : uint8_t {
  UnitDimension::L = 0, UnitDimension::M, UnitDimension::T, UnitDimension::I,
  UnitDimension::theta, UnitDimension::N, UnitDimension::J
}
 Physical dimension of a record. More...
 

Functions

void warnWrongDtype (std::string const &key, Datatype store, Datatype request)
 
std::ostream & operator<< (std::ostream &os, openPMD::Datatype const &d)
 
Datatype stringToDatatype (std::string s)
 
std::string datatypeToString (openPMD::Datatype dt)
 
Datatype basicDatatype (Datatype dt)
 basicDatatype Strip openPMD Datatype of std::vector, std::array et. More...
 
Datatype toVectorType (Datatype dt)
 
Format determineFormat (std::string const &filename)
 Determine the storage format of a Series from the used filename extension. More...
 
std::string suffix (Format f)
 Determine the default filename suffix for a given storage format. More...
 
std::shared_ptr< AbstractIOHandlercreateIOHandler (std::string path, Access access, Format format, MPI_Comm comm, std::string const &options="{}")
 Construct an appropriate specific IOHandler for the desired IO mode that may be MPI-aware. More...
 
std::shared_ptr< AbstractIOHandlercreateIOHandler (std::string path, Access access, Format format, std::string const &options="{}")
 Construct an appropriate specific IOHandler for the desired IO mode. More...
 
WritablegetWritable (Attributable *a)
 
template<typename U >
getCast (Attribute const &a)
 Retrieve a stored specific Attribute and cast if convertible. More...
 
Datatype dtype_from_numpy (pybind11::dtype const dt)
 
Datatype dtype_from_bufferformat (std::string const &fmt)
 Return openPMD::Datatype from py::buffer_info::format.
 
pybind11::dtype dtype_to_numpy (Datatype const dt)
 
template<typename T >
constexpr Datatype determineDatatype ()
 
template<typename T >
constexpr Datatype determineDatatype (std::shared_ptr< T >)
 
size_t toBytes (Datatype d)
 Return number of bytes representing a Datatype. More...
 
size_t toBits (Datatype d)
 Return number of bits representing a Datatype. More...
 
bool isVector (Datatype d)
 Compare if a Datatype is a vector type. More...
 
bool isFloatingPoint (Datatype d)
 Compare if a Datatype is a floating point type. More...
 
bool isComplexFloatingPoint (Datatype d)
 Compare if a Datatype is a complex floating point type. More...
 
template<typename T >
bool isFloatingPoint ()
 Compare if a type is a floating point type. More...
 
template<typename T >
bool isComplexFloatingPoint ()
 Compare if a type is a complex floating point type. More...
 
std::tuple< bool, bool > isInteger (Datatype d)
 Compare if a Datatype is an integer type. More...
 
template<typename T >
std::tuple< bool, bool > isInteger ()
 Compare if a type is an integer type. More...
 
template<typename T_FP >
bool isSameFloatingPoint (Datatype d)
 Compare if a Datatype is equivalent to a floating point type. More...
 
template<typename T_CFP >
bool isSameComplexFloatingPoint (Datatype d)
 Compare if a Datatype is equivalent to a complex floating point type. More...
 
template<typename T_Int >
bool isSameInteger (Datatype d)
 Compare if a Datatype is equivalent to an integer type. More...
 
bool isSame (openPMD::Datatype const d, openPMD::Datatype const e)
 Comparison for two Datatypes. More...
 
template<typename ReturnType = void, typename Action , typename... Args>
ReturnType switchType (Datatype dt, Action action, Args &&... args)
 Generalizes switching over an openPMD datatype. More...
 
std::string getBP1Extent (Extent const &e, std::string const &delimiter=",")
 
std::string getZerosLikeBP1Extent (Extent const &e, std::string const &delimiter=",")
 
ADIOS_DATATYPES getBP1DataType (Datatype dtype)
 
std::string concrete_bp1_file_position (Writable *w)
 
std::string getEnvNum (std::string const &key, std::string const &defaultValue)
 
template<typename T >
Attribute readVectorAttributeInternal (void *data, int size)
 
hid_t getH5DataSpace (Attribute const &att)
 
std::string concrete_h5_file_position (Writable *w)
 
 OPENPMDAPI_EXPORT_ENUM_CLASS (Operation)
 Type of IO operation between logical and persistent data. More...
 
std::ostream & operator<< (std::ostream &, openPMD::IterationEncoding const &)
 
std::ostream & operator<< (std::ostream &, openPMD::Mesh::Geometry const &)
 
std::ostream & operator<< (std::ostream &, openPMD::Mesh::DataOrder const &)
 
std::string getVersion ()
 Return the version of the openPMD-api library (run-time) More...
 
std::string getStandard ()
 Return the maximum supported version of the openPMD standard (read & write, run-time) More...
 
std::string getStandardMinimum ()
 Return the minimum supported version of the openPMD standard (read, run-time) More...
 
std::map< std::string, bool > getVariants ()
 Return the feature variants of the openPMD-api library (run-time) More...
 
std::vector< std::string > getFileExtensions ()
 Return the file extensions supported in this variant of the openPMD-api library (run-time) More...
 
template<typename T >
std::shared_ptr< T > shareRaw (T *x)
 Share ownership with a raw pointer. More...
 
template<typename T >
std::shared_ptr< T const > shareRaw (T const *x)
 
template<typename T >
auto shareRaw (T &c) -> std::shared_ptr< typename std::remove_pointer< decltype(c.data()) >::type >
 
template<typename T >
auto shareRaw (T const &c) -> std::shared_ptr< typename std::remove_pointer< decltype(c.data()) >::type >
 

Variables

std::vector< DatatypeopenPMD_Datatypes
 All openPMD datatypes defined in Datatype, listed in order in a vector.
 
template<typename T , typename U >
constexpr bool decay_equiv_v = decay_equiv< T, U >::value
 
class OPENPMDAPI_EXPORT ADIOS1IOHandlerImpl
 
class OPENPMDAPI_EXPORT ParallelADIOS1IOHandlerImpl
 

Detailed Description

Public definitions of openPMD-api.

Enumeration Type Documentation

◆ Access

enum openPMD::Access
strong

File access mode to use during IO.

Enumerator
READ_ONLY 

open series as read-only, fails if series is not found

READ_WRITE 

open existing series as writable

CREATE 

create new series and truncate existing (files)

◆ AdvanceMode

enum openPMD::AdvanceMode : unsigned char
strong

In step-based mode (i.e.

when using the Streaming API), stepping/advancing through the Series is performed in terms of interleaving begin- and end-step calls. Distinguish both kinds by using this enum.

◆ AdvanceStatus

enum openPMD::AdvanceStatus : unsigned char
strong

In step-based mode (i.e.

when using the Streaming API), indicate whether there are further steps to read or not (i.e. the stream is not over or it is).

◆ IterationEncoding

◆ StepStatus

enum openPMD::StepStatus : unsigned char
strong

Used in step-based mode (i.e.

when using the Streaming API) to determine whether a step is currently active or not.

◆ UnitDimension

enum openPMD::UnitDimension : uint8_t
strong

Physical dimension of a record.

Dimensional base quantities of the international system of quantities

Enumerator

length

mass

time

electric current

theta 

thermodynamic temperature

amount of substance

luminous intensity

Function Documentation

◆ basicDatatype()

Datatype openPMD::basicDatatype ( Datatype  dt)

basicDatatype Strip openPMD Datatype of std::vector, std::array et.

al.

Parameters
dtThe "full" Datatype.
Returns
The "inner" Datatype.

◆ createIOHandler() [1/2]

std::shared_ptr< AbstractIOHandler > openPMD::createIOHandler ( std::string  path,
Access  access,
Format  format,
MPI_Comm  comm,
std::string const &  options = "{}" 
)

Construct an appropriate specific IOHandler for the desired IO mode that may be MPI-aware.

Parameters
pathPath to root folder for all operations associated with the desired handler.
accessAccess mode describing desired operations and permissions of the desired handler.
formatFormat describing the IO backend of the desired handler.
commMPI communicator used for IO.
optionsJSON-formatted option string, to be interpreted by the backend.
Returns
Smart pointer to created IOHandler.

◆ createIOHandler() [2/2]

std::shared_ptr< AbstractIOHandler > openPMD::createIOHandler ( std::string  path,
Access  access,
Format  format,
std::string const &  options = "{}" 
)

Construct an appropriate specific IOHandler for the desired IO mode.

Parameters
pathPath to root folder for all operations associated with the desired handler.
accessAccess describing desired operations and permissions of the desired handler.
formatFormat describing the IO backend of the desired handler.
optionsJSON-formatted option string, to be interpreted by the backend.
Returns
Smart pointer to created IOHandler.

◆ determineFormat()

Format openPMD::determineFormat ( std::string const &  filename)

Determine the storage format of a Series from the used filename extension.

Parameters
filenamestring containing the filename.
Returns
Format that best fits the filename extension.

◆ getCast()

template<typename U >
U openPMD::getCast ( Attribute const &  a)
inline

Retrieve a stored specific Attribute and cast if convertible.

Exceptions
std::runtime_errorif stored object is not static castable to U.
Template Parameters
UType of the object to be casted to.
Returns
Copy of the retrieved object, casted to type U.

◆ getFileExtensions()

std::vector< std::string > openPMD::getFileExtensions ( )

Return the file extensions supported in this variant of the openPMD-api library (run-time)

Returns
std::vector< std::string > with file extensions

◆ getStandard()

std::string openPMD::getStandard ( )

Return the maximum supported version of the openPMD standard (read & write, run-time)

Returns
std::string openPMD standard version (dot separated)

◆ getStandardMinimum()

std::string openPMD::getStandardMinimum ( )

Return the minimum supported version of the openPMD standard (read, run-time)

Returns
std::string minimum openPMD standard version (dot separated)

◆ getVariants()

std::map< std::string, bool > openPMD::getVariants ( )

Return the feature variants of the openPMD-api library (run-time)

Returns
std::map< std::string, bool > with variants such as backends

◆ getVersion()

std::string openPMD::getVersion ( )

Return the version of the openPMD-api library (run-time)

Returns
std::string API version (dot separated)

◆ isComplexFloatingPoint() [1/2]

bool openPMD::isComplexFloatingPoint ( Datatype  d)
inline

Compare if a Datatype is a complex floating point type.

Includes our vector types

Parameters
dDatatype to test
Returns
true if complex floating point, otherwise false

◆ isComplexFloatingPoint() [2/2]

template<typename T >
bool openPMD::isComplexFloatingPoint ( )
inline

Compare if a type is a complex floating point type.

Like isFloatingPoint but for complex floats

Template Parameters
Ttype to test
Returns
true if complex floating point, otherwise false

◆ isFloatingPoint() [1/2]

bool openPMD::isFloatingPoint ( Datatype  d)
inline

Compare if a Datatype is a floating point type.

Equivalent to std::is_floating_point including our vector types

Parameters
dDatatype to test
Returns
true if floating point, otherwise false

◆ isFloatingPoint() [2/2]

template<typename T >
bool openPMD::isFloatingPoint ( )
inline

Compare if a type is a floating point type.

Just std::is_floating_point but also valid for std::vector< > types

Template Parameters
Ttype to test
Returns
true if floating point, otherwise false

◆ isInteger() [1/2]

std::tuple< bool, bool > openPMD::isInteger ( Datatype  d)
inline

Compare if a Datatype is an integer type.

contrary to std::is_integer, the types bool and char types are not considered ints in this function

Parameters
dDatatype to test
Returns
std::tuple<bool, bool> with isInteger and isSigned result

◆ isInteger() [2/2]

template<typename T >
std::tuple< bool, bool > openPMD::isInteger ( )
inline

Compare if a type is an integer type.

contrary to std::is_integer, the types bool and char types are not considered ints in this function

Template Parameters
Ttype to test
Returns
std::tuple<bool, bool> with isInteger and isSigned result

◆ isSame()

bool openPMD::isSame ( openPMD::Datatype const  d,
openPMD::Datatype const  e 
)
inline

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.

◆ isSameComplexFloatingPoint()

template<typename T_CFP >
bool openPMD::isSameComplexFloatingPoint ( Datatype  d)
inline

Compare if a Datatype is equivalent to a complex floating point type.

Template Parameters
T_CFPcomplex floating point type to compare
Parameters
dDatatype to compare
Returns
true if both types are complex floating point and same bitness, else false

◆ isSameFloatingPoint()

template<typename T_FP >
bool openPMD::isSameFloatingPoint ( Datatype  d)
inline

Compare if a Datatype is equivalent to a floating point type.

Template Parameters
T_FPfloating point type to compare
Parameters
dDatatype to compare
Returns
true if both types are floating point and same bitness, else false

◆ isSameInteger()

template<typename T_Int >
bool openPMD::isSameInteger ( Datatype  d)
inline

Compare if a Datatype is equivalent to an integer type.

Template Parameters
T_Intsigned or unsigned integer type to compare
Parameters
dDatatype to compare
Returns
true if both types are integers, same signed and same bitness, else false

◆ isVector()

bool openPMD::isVector ( Datatype  d)
inline

Compare if a Datatype is a vector type.

Parameters
dDatatype to test
Returns
true if vector type, else false

◆ OPENPMDAPI_EXPORT_ENUM_CLASS()

openPMD::OPENPMDAPI_EXPORT_ENUM_CLASS ( Operation  )

Type of IO operation between logical and persistent data.

< Query chunks that can be loaded in a dataset

◆ shareRaw()

template<typename T >
std::shared_ptr< T > openPMD::shareRaw ( T *  x)

Share ownership with a raw pointer.

Helper function to share load/store data ownership unprotected and without reference counting with a raw pointer or stdlib container (that implements a contiguous data storage).

Warning
this is a helper function to bypass the shared-pointer API for storing data behind raw pointers. Using it puts the responsibility of buffer-consistency between stores and flushes to the users side without an indication via reference counting.

◆ suffix()

std::string openPMD::suffix ( Format  f)

Determine the default filename suffix for a given storage format.

Parameters
fFile format to determine suffix for.
Returns
String containing the default filename suffix

◆ switchType()

template<typename ReturnType = void, typename Action , typename... Args>
ReturnType openPMD::switchType ( Datatype  dt,
Action  action,
Args &&...  args 
)

Generalizes switching over an openPMD datatype.

Will call the functor passed to it using the C++ internal datatype corresponding to the openPMD datatype as template parameter for the templated <operator()>().

Template Parameters
ReturnTypeThe functor's return type.
ActionThe functor's type.
ArgsThe functors argument types.
Parameters
dtThe openPMD datatype.
actionThe functor.
argsThe functor's arguments.
Returns
The return value of the functor, when calling its <operator()>() with the passed arguments and the template parameter type corresponding to the openPMD type.

◆ toBits()

size_t openPMD::toBits ( Datatype  d)
inline

Return number of bits representing a Datatype.

Parameters
dDatatype
Returns
number of bits

◆ toBytes()

size_t openPMD::toBytes ( Datatype  d)
inline

Return number of bytes representing a Datatype.

Parameters
dDatatype
Returns
number of bytes