SENSEI
A frame work for generic in situ analytics
sensei::HDF5DataAdaptor Class Reference
Inheritance diagram for sensei::HDF5DataAdaptor:
[legend]
Collaboration diagram for sensei::HDF5DataAdaptor:
[legend]

Public Member Functions

 senseiTypeMacro (HDF5DataAdaptor, DataAdaptor)
 
void SetStreamName (const std::string &name)
 
void SetStreaming (bool s)
 
void SetCollective (bool s)
 
int GetNumberOfMeshes (unsigned int &numMeshes) override
 SENSEI DataAdaptor API. More...
 
int GetMeshMetadata (unsigned int id, MeshMetadataPtr &metadata) override
 Get metadata of the i'th mesh. More...
 
int GetMesh (const std::string &meshName, bool structure_only, svtkDataObject *&mesh) override
 Fetches the requested data object from the simulation. More...
 
int AddGhostNodesArray (svtkDataObject *mesh, const std::string &meshName) override
 Adds ghost nodes on the specified mesh. More...
 
int AddGhostCellsArray (svtkDataObject *mesh, const std::string &meshName) override
 Adds ghost cells on the specified mesh. More...
 
int AddArray (svtkDataObject *mesh, const std::string &meshName, int association, const std::string &arrayName) override
 Fetches the named array from the simulation and adds it to the passed mesh. More...
 
int ReleaseData () override
 Release data allocated for the current timestep. More...
 
int OpenStream () override
 Opens a stream and connects to the simulation. More...
 
int CloseStream () override
 Closes a stream and disconnects from the simulation. More...
 
int AdvanceStream () override
 Signals the that we are finished with this time step. More...
 
int StreamGood () override
 Returns true while there is more data to process. More...
 
int Initialize (pugi::xml_node &parent) override
 Initialize the adaptor from an XML node. More...
 
int Finalize () override
 Called before the application is brought down. It is safe to use MPI here. More...
 
int GetSenderMeshMetadata (unsigned int id, MeshMetadataPtr &metadata) override
 Get metadta object describing the data that is available in the simulation. More...
 
- Public Member Functions inherited from sensei::InTransitDataAdaptor
 senseiTypeMacro (InTransitDataAdaptor, sensei::DataAdaptor)
 
virtual int SetConnectionInfo (const std::string &info)
 Pass in a string containing transport specific connection information. More...
 
virtual const std::string & GetConnectionInfo () const
 Return the current connection info. More...
 
virtual int SetReceiverMeshMetadata (unsigned int id, MeshMetadataPtr &metadata)
 This API that enables one to specify how the data is partitioned on the analysis/local side. More...
 
virtual int GetReceiverMeshMetadata (unsigned int id, MeshMetadataPtr &metadata)
 Returns the current receiver mesh metadata. More...
 
virtual void SetPartitioner (const sensei::PartitionerPtr &partitioner)
 Set/get the partitioner. More...
 
virtual sensei::PartitionerPtr GetPartitioner ()
 Return the current partitioner. More...
 
- Public Member Functions inherited from sensei::DataAdaptor
 senseiBaseTypeMacro (DataAdaptor, svtkObjectBase)
 
void PrintSelf (ostream &os, svtkIndent indent) override
 Prints the current state of the adaptor. More...
 
virtual int SetCommunicator (MPI_Comm comm)
 Set the communicator used by the adaptor. More...
 
MPI_Comm GetCommunicator ()
 Get the communicator used by the adaptor. More...
 
virtual int AddArrays (svtkDataObject *mesh, const std::string &meshName, int association, const std::vector< std::string > &arrayNames)
 Fetches multiple arrays from the simulation and adds them to the mesh. More...
 
virtual double GetDataTime ()
 Get the current simulated time. More...
 
virtual void SetDataTime (double time)
 Set the current simulated time. More...
 
virtual long GetDataTimeStep ()
 Get the current time step. More...
 
virtual void SetDataTimeStep (long index)
 Set the current simulated time step. More...
 

Static Public Member Functions

static HDF5DataAdaptorNew ()
 

Protected Member Functions

int UpdateTimeStep ()
 
- Protected Member Functions inherited from sensei::InTransitDataAdaptor
 InTransitDataAdaptor (const InTransitDataAdaptor &)=delete
 
void operator= (const InTransitDataAdaptor &)=delete
 
- Protected Member Functions inherited from sensei::DataAdaptor
 DataAdaptor (const DataAdaptor &)=delete
 
void operator= (const DataAdaptor &)=delete
 

Additional Inherited Members

- Protected Attributes inherited from sensei::InTransitDataAdaptor
InternalsType * Internals
 
- Protected Attributes inherited from sensei::DataAdaptor
InternalsType * Internals
 
MPI_Comm Comm
 

Member Function Documentation

◆ AddArray()

int sensei::HDF5DataAdaptor::AddArray ( svtkDataObject *  mesh,
const std::string &  meshName,
int  association,
const std::string &  arrayName 
)
overridevirtual

Fetches the named array from the simulation and adds it to the passed mesh.

Implementers should pass the data by zero copy when possible. See svtkAOSDataArrayTemplate and svtkSOADataArrayTemplate for details of passing data zero copy.

Parameters
[in]meshthe VTK object returned from GetMesh
[in]meshNamethe name of the mesh on which the array is stored
[in]associationfield association; one of svtkDataObject::FieldAssociations or svtkDataObject::AttributeTypes.
[in]arrayNamename of the array
Returns
zero if successful, non zero if an error occurred

Implements sensei::DataAdaptor.

◆ AddGhostCellsArray()

int sensei::HDF5DataAdaptor::AddGhostCellsArray ( svtkDataObject *  mesh,
const std::string &  meshName 
)
overridevirtual

Adds ghost cells on the specified mesh.

Implementers should set the array name to "svtkGhostType".

Parameters
[in]meshthe svtkDataObject returned from GetMesh
[in]meshNamethe name of the mesh to access (see GetMeshMetadata)
Returns
zero if successful, non zero if an error occurred

Reimplemented from sensei::DataAdaptor.

◆ AddGhostNodesArray()

int sensei::HDF5DataAdaptor::AddGhostNodesArray ( svtkDataObject *  mesh,
const std::string &  meshName 
)
overridevirtual

Adds ghost nodes on the specified mesh.

Implementers shouls set the name of the array to "svtkGhostType".

Parameters
[in]meshthe VTK object returned from GetMesh
[in]meshNamethe name of the mesh to access (see GetMeshMetadata)
Returns
zero if successful, non zero if an error occurred

Reimplemented from sensei::DataAdaptor.

◆ AdvanceStream()

int sensei::HDF5DataAdaptor::AdvanceStream ( )
overridevirtual

Signals the that we are finished with this time step.

Implements sensei::InTransitDataAdaptor.

◆ CloseStream()

int sensei::HDF5DataAdaptor::CloseStream ( )
overridevirtual

Closes a stream and disconnects from the simulation.

Implements sensei::InTransitDataAdaptor.

◆ Finalize()

int sensei::HDF5DataAdaptor::Finalize ( )
overridevirtual

Called before the application is brought down. It is safe to use MPI here.

Implements sensei::InTransitDataAdaptor.

◆ GetMesh()

int sensei::HDF5DataAdaptor::GetMesh ( const std::string &  meshName,
bool  structureOnly,
svtkDataObject *&  mesh 
)
overridevirtual

Fetches the requested data object from the simulation.

This method will return a svtkDataObject containing the simulation state. Implementers should prefer svtkMultiBlockData over svtkDataSet types. However, both approaches are supported. Callers should typically pass structureOnly to false. Caller may set stuctureOnly to true when data arrays without mesh geometry and connectivity are sufficient for processing. If structureOnly is set to true, then implementers should not populate the mesh geometry and connectivity information. This can result in large savings in data transfer.

Note
Callers are to take ownership of the newly allocated mesh and must Delete the returned mesh when finished to prevent a memory leak.
Parameters
[in]meshNamethe name of the mesh to access (see GetMeshMetadata)
[in]structureOnlyWhen set to true the returned mesh may not have any geometry or topology information.
[out]mesha reference to a pointer where a new VTK object is stored
Returns
zero if successful, non zero if an error occurred

Implements sensei::DataAdaptor.

◆ GetMeshMetadata()

int sensei::HDF5DataAdaptor::GetMeshMetadata ( unsigned int  id,
MeshMetadataPtr &  metadata 
)
overridevirtual

Get metadata of the i'th mesh.

The caller passes the integer id of the mesh for which the metadata is desired, and a pointer to a MeshMetadata instance where the metadata is stored.

Parameters
[in]idindex of the mesh to access
[out]metadataa pointer to instance where metadata is stored
Returns
zero if successful, non zero if an error occurred

Implements sensei::DataAdaptor.

◆ GetNumberOfMeshes()

int sensei::HDF5DataAdaptor::GetNumberOfMeshes ( unsigned int &  numMeshes)
overridevirtual

SENSEI DataAdaptor API.

Implements sensei::DataAdaptor.

◆ GetSenderMeshMetadata()

int sensei::HDF5DataAdaptor::GetSenderMeshMetadata ( unsigned int  id,
MeshMetadataPtr &  metadata 
)
overridevirtual

Get metadta object describing the data that is available in the simulation.

Implements sensei::InTransitDataAdaptor.

◆ Initialize()

int sensei::HDF5DataAdaptor::Initialize ( pugi::xml_node &  node)
overridevirtual

Initialize the adaptor from an XML node.

The default implementation handles initializing a sensei::ConfigurablePartitioner. If the ConfigurablePartitioner fails to initialize, then a we fall back to a default initialized sensei::BlockPartitioner.

Reimplemented from sensei::InTransitDataAdaptor.

◆ OpenStream()

int sensei::HDF5DataAdaptor::OpenStream ( )
overridevirtual

Opens a stream and connects to the simulation.

Implements sensei::InTransitDataAdaptor.

◆ ReleaseData()

int sensei::HDF5DataAdaptor::ReleaseData ( )
overridevirtual

Release data allocated for the current timestep.

This method allows implementers to free resources that were used in the conversion of the simulation data. However, note that callers of GetMesh must Delete the returned svtkDataObject which typically alleviates the need for the adaptor to hold references to the returned data. In most cases this method should not be overridden.

Note
The instrumentation (or bridge) code must call this method when done processing a time step to ensure that all resources are released. Analysis adaptors should not call this method.
Returns
zero if successful, non zero if an error occurred

Reimplemented from sensei::DataAdaptor.

◆ StreamGood()

int sensei::HDF5DataAdaptor::StreamGood ( )
overridevirtual

Returns true while there is more data to process.

Implements sensei::InTransitDataAdaptor.


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