SENSEI
A frame work for generic in situ analytics
sensei::ADIOS2AnalysisAdaptor Class Reference

The write side of the ADIOS2 transport. More...

#include <ADIOS2AnalysisAdaptor.h>

Inheritance diagram for sensei::ADIOS2AnalysisAdaptor:
[legend]
Collaboration diagram for sensei::ADIOS2AnalysisAdaptor:
[legend]

Public Member Functions

 senseiTypeMacro (ADIOS2AnalysisAdaptor, AnalysisAdaptor)
 
bool Execute (DataAdaptor *data, DataAdaptor **result) override
 Invokes ADIOS2 based I/O or streaming. More...
 
int Finalize () override
 Shut down and clean up including flushing and closing all streams and files. More...
 
runtime configuration
int Initialize (pugi::xml_node &parent)
 initialize from an XML representation More...
 
void AddParameter (const std::string &key, const std::string &value)
 Add name value pairs to be passed to ADIOS. More...
 
void SetEngineName (const std::string &engineName)
 Set the ADIOS2 engine. More...
 
std::string GetEngineName () const
 Get the ADIOS2 engine. More...
 
void SetFileName (const std::string &filename)
 Set the filename. More...
 
std::string GetFileName () const
 Returns the filename. More...
 
void SetStepsPerFile (long steps)
 Set the number of time steps to store in each file. More...
 
int SetDataRequirements (const DataRequirements &reqs)
 Adds a set of sensei::DataRequirements, typically this will come from an XML configuratiopn file. More...
 
int AddDataRequirement (const std::string &meshName, int association, const std::vector< std::string > &arrays)
 Add an indivudal data requirement. More...
 
int SetFrequency (long frequency)
 Controls how many calls to Execute do nothing between actual I/O and streaming. More...
 
- Public Member Functions inherited from sensei::AnalysisAdaptor
 senseiBaseTypeMacro (AnalysisAdaptor, svtkObjectBase)
 
void PrintSelf (ostream &os, svtkIndent indent) override
 Prints the current state of the adaptor. More...
 
virtual int SetCommunicator (MPI_Comm comm)
 Set the MPI communicator to be used by the adaptor. More...
 
MPI_Comm GetCommunicator ()
 returns the MPI communicator to be used for all communication More...
 
virtual void SetVerbose (int val)
 Set the level of verbosity of console output. More...
 
virtual int GetVerbose ()
 Get the level of verbosity of console output. More...
 
virtual void SetAsynchronous (int val)
 When set the analysis should buffer the simulation data and run in the background returning to the simulation immediately. More...
 
virtual int GetAsynchronous ()
 Get asynchronous mode. More...
 
virtual void SetDeviceId (int val)
 Set the device that the analysis should run on. More...
 
virtual int GetDeviceId ()
 Get the device that the analysis should run on. More...
 
virtual void SetDevicesToUse (int val)
 Set the number of devices to use per node. More...
 
virtual int GetDevicesToUse ()
 Get the number of devices to use per node. More...
 
virtual void SetDeviceStart (int val)
 Set the first on node device to use in automatic device selection. More...
 
virtual int GetDeviceStart ()
 Get the first device to use. More...
 
virtual void SetDeviceStride (int val)
 Set the number of devices to skip in automatic device selection. More...
 
virtual int GetDeviceStride ()
 Get the number of devices to skip. More...
 

Static Public Member Functions

static ADIOS2AnalysisAdaptorNew ()
 constructs a new ADIOS2AnalysisAdaptor instance. More...
 

Protected Member Functions

int InitializeADIOS2 ()
 
int DefineVariables (const std::vector< MeshMetadataPtr > &metadata)
 
int UpdateStream ()
 
int WriteTimestep (unsigned long timeStep, double time, const std::vector< MeshMetadataPtr > &metadata, const std::vector< svtkCompositeDataSetPtr > &dobjects)
 
int FinalizeADIOS2 ()
 
int FetchFromProducer (sensei::DataAdaptor *da, std::vector< svtkCompositeDataSetPtr > &objects, std::vector< MeshMetadataPtr > &metadata)
 
- Protected Member Functions inherited from sensei::AnalysisAdaptor
 AnalysisAdaptor (const AnalysisAdaptor &)=delete
 
void operator= (const AnalysisAdaptor &)=delete
 

Protected Attributes

senseiADIOS2::DataObjectCollectionSchema * Schema
 
sensei::DataRequirements Requirements
 
std::string EngineName
 
std::string FileName
 
senseiADIOS2::AdiosHandle Handles
 
adios2_adios * Adios
 
std::vector< std::pair< std::string, std::string > > Parameters
 
long StepsPerFile
 
long StepIndex
 
long FileIndex
 
long Frequency
 
- Protected Attributes inherited from sensei::AnalysisAdaptor
MPI_Comm Comm
 
int Verbose
 
int DeviceId
 
int DevicesPerNode
 
int DevicesToUse
 
int DeviceStart
 
int DeviceStride
 
int Asynchronous
 

Additional Inherited Members

- Public Types inherited from sensei::AnalysisAdaptor
enum  { DEVICE_HOST =-1, DEVICE_AUTO =-2 }
 values controling device selection More...
 

Detailed Description

The write side of the ADIOS2 transport.

Member Function Documentation

◆ AddDataRequirement()

int sensei::ADIOS2AnalysisAdaptor::AddDataRequirement ( const std::string &  meshName,
int  association,
const std::vector< std::string > &  arrays 
)

Add an indivudal data requirement.

Data requirements tell the adaptor what to fetch from the simulation and write to disk. If none are given then all available data is fetched and written.

Parameters
[in]meshNamethe name of the mesh to fetch and write
[in]associationthe type of data array to fetch and write vtkDataObject::POINT or vtkDataObject::CELL
[in]arraysa list of arrays to fetch and write
Returns
zero if successful.

◆ AddParameter()

void sensei::ADIOS2AnalysisAdaptor::AddParameter ( const std::string &  key,
const std::string &  value 
)

Add name value pairs to be passed to ADIOS.

◆ Execute()

bool sensei::ADIOS2AnalysisAdaptor::Execute ( DataAdaptor data,
DataAdaptor **  result 
)
overridevirtual

Invokes ADIOS2 based I/O or streaming.

Implements sensei::AnalysisAdaptor.

◆ Finalize()

int sensei::ADIOS2AnalysisAdaptor::Finalize ( )
overridevirtual

Shut down and clean up including flushing and closing all streams and files.

Reimplemented from sensei::AnalysisAdaptor.

◆ GetEngineName()

std::string sensei::ADIOS2AnalysisAdaptor::GetEngineName ( ) const
inline

Get the ADIOS2 engine.

◆ GetFileName()

std::string sensei::ADIOS2AnalysisAdaptor::GetFileName ( ) const
inline

Returns the filename.

◆ Initialize()

int sensei::ADIOS2AnalysisAdaptor::Initialize ( pugi::xml_node &  parent)

initialize from an XML representation

◆ New()

static ADIOS2AnalysisAdaptor* sensei::ADIOS2AnalysisAdaptor::New ( )
static

constructs a new ADIOS2AnalysisAdaptor instance.

◆ SetDataRequirements()

int sensei::ADIOS2AnalysisAdaptor::SetDataRequirements ( const DataRequirements reqs)

Adds a set of sensei::DataRequirements, typically this will come from an XML configuratiopn file.

Data requirements tell the adaptor what to fetch from the simulation and write to disk. If none are given then all available data is fetched and written.

◆ SetEngineName()

void sensei::ADIOS2AnalysisAdaptor::SetEngineName ( const std::string &  engineName)
inline

Set the ADIOS2 engine.

◆ SetFileName()

void sensei::ADIOS2AnalysisAdaptor::SetFileName ( const std::string &  filename)
inline

Set the filename.

Default value is "sensei.bp" which is suitable for use with streams or transport engines such as SST. When writing files to disk using the BP4 engine one could SetStepsPerFile to prevent all steps being accumulated in a single file. In this case one should also use a printf like format specifier compatible with an int type in the file name. For example "sensei_%04d.bp".

◆ SetFrequency()

int sensei::ADIOS2AnalysisAdaptor::SetFrequency ( long  frequency)

Controls how many calls to Execute do nothing between actual I/O and streaming.

◆ SetStepsPerFile()

void sensei::ADIOS2AnalysisAdaptor::SetStepsPerFile ( long  steps)
inline

Set the number of time steps to store in each file.

The default value is 0 which results in all the steps landing in a single file. If set to non-zero then multiple files per run are created each with this number of steps. An ordinal file index is incorporated in the file name. See notes in SetFileName for details on specifying the format specifier.


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