openPMD-api
Classes | Public Member Functions | List of all members
openPMD::detail::PreloadAdiosAttributes Class Reference

Class that is responsible for scheduling and buffering openPMD attribute loads from ADIOS2, if using ADIOS variables to store openPMD attributes. More...

#include <ADIOS2PreloadAttributes.hpp>

Classes

struct  AttributeLocation
 Internally used struct to store meta information on a buffered attribute. More...
 

Public Member Functions

 PreloadAdiosAttributes (PreloadAdiosAttributes const &other)=delete
 
PreloadAdiosAttributesoperator= (PreloadAdiosAttributes const &other)=delete
 
 PreloadAdiosAttributes (PreloadAdiosAttributes &&other)=default
 
PreloadAdiosAttributesoperator= (PreloadAdiosAttributes &&other)=default
 
void preloadAttributes (adios2::IO &IO, adios2::Engine &engine)
 Schedule attributes for preloading. More...
 
template<typename T >
AttributeWithShape< T > getAttribute (std::string const &name) const
 Get an attribute that has been buffered previously. More...
 
Datatype attributeType (std::string const &name) const
 

Detailed Description

Class that is responsible for scheduling and buffering openPMD attribute loads from ADIOS2, if using ADIOS variables to store openPMD attributes.

Reasoning: ADIOS variables can be of any shape and size, and ADIOS cannot know which variables to buffer. While it will preload and buffer scalar variables, openPMD also stores vector-type attributes which are not preloaded. Since in Streaming setups, every variable load requires full communication back to the writer, this can quickly become very expensive. Hence, do this manually.

Member Function Documentation

◆ getAttribute()

template<typename T >
AttributeWithShape< T > openPMD::detail::PreloadAdiosAttributes::getAttribute ( std::string const &  name) const

Get an attribute that has been buffered previously.

Template Parameters
TThe underlying primitive datatype of the attribute. Will fail if the type found in ADIOS does not match.
Parameters
nameThe full name of the attribute.
Returns
Pointer to the buffered attribute along with information on the attribute's shape. Valid only until any non-const member of PreloadAdiosAttributes is called.

◆ preloadAttributes()

void openPMD::detail::PreloadAdiosAttributes::preloadAttributes ( adios2::IO &  IO,
adios2::Engine &  engine 
)

Schedule attributes for preloading.

This will invalidate all previously buffered attributes. This will not flush the scheduled loads. This way, attributes can be loaded along with the next adios2::Engine flush.

Parameters
IO
engine

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