SENSEI
A frame work for generic in situ analytics
|
The ConfigurableInTransitDataAdaptor implements the InTransitDataAdaptor interface, provides a factory for creating a concrete instance of the InTransitDataAdpator from an XML configuration, and delegates in coming calls through the InTransitDataAdapotor/DataAdaptor API to the instance. More...
#include <ConfigurableInTransitDataAdaptor.h>
Public Member Functions | |
senseiTypeMacro (ConfigurableInTransitDataAdaptor, InTransitDataAdaptor) | |
int | Initialize (const std::string &fileName) |
int | SetConnectionInfo (const std::string &info) override |
Pass in a string containing transport specific connection information. More... | |
const std::string & | GetConnectionInfo () const override |
Return the current connection info. More... | |
int | Initialize (pugi::xml_node &node) override |
Initialize the adaptor from an XML node. More... | |
int | GetSenderMeshMetadata (unsigned int id, MeshMetadataPtr &metadata) override |
Get metadta object describing the data that is available in the simulation. More... | |
int | GetReceiverMeshMetadata (unsigned int id, MeshMetadataPtr &metadata) override |
Returns the current receiver mesh metadata. More... | |
int | SetReceiverMeshMetadata (unsigned int id, MeshMetadataPtr &metadata) override |
This API that enables one to specify how the data is partitioned on the analysis/local side. More... | |
void | SetPartitioner (const sensei::PartitionerPtr &partitioner) override |
Set/get the partitioner. More... | |
sensei::PartitionerPtr | GetPartitioner () override |
Return the current partitioner. 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 | Finalize () override |
Called before the application is brought down. It is safe to use MPI here. More... | |
int | GetNumberOfMeshes (unsigned int &numMeshes) override |
Gets the number of meshes a simulation can provide. More... | |
int | GetMeshMetadata (unsigned int id, MeshMetadataPtr &metadata) override |
Get metadata of the i'th mesh. More... | |
int | GetMesh (const std::string &meshName, bool structureOnly, 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 | AddArrays (svtkDataObject *mesh, const std::string &meshName, int association, const std::vector< std::string > &arrayName) override |
Fetches multiple arrays from the simulation and adds them to the mesh. More... | |
int | ReleaseData () override |
Release data allocated for the current timestep. More... | |
double | GetDataTime () override |
Get the current simulated time. More... | |
void | SetDataTime (double time) override |
Set the current simulated time. More... | |
long | GetDataTimeStep () override |
Get the current time step. More... | |
void | SetDataTimeStep (long index) override |
Set the current simulated time step. More... | |
Public Member Functions inherited from sensei::InTransitDataAdaptor | |
senseiTypeMacro (InTransitDataAdaptor, sensei::DataAdaptor) | |
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... | |
Static Public Member Functions | |
static ConfigurableInTransitDataAdaptor * | New () |
Protected Member Functions | |
ConfigurableInTransitDataAdaptor (const ConfigurableInTransitDataAdaptor &)=delete | |
void | operator= (const ConfigurableInTransitDataAdaptor &)=delete |
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 |
Protected Attributes | |
InternalsType * | Internals |
Protected Attributes inherited from sensei::InTransitDataAdaptor | |
InternalsType * | Internals |
Protected Attributes inherited from sensei::DataAdaptor | |
InternalsType * | Internals |
MPI_Comm | Comm |
The ConfigurableInTransitDataAdaptor implements the InTransitDataAdaptor interface, provides a factory for creating a concrete instance of the InTransitDataAdpator from an XML configuration, and delegates in coming calls through the InTransitDataAdapotor/DataAdaptor API to the instance.
The purpose of this class is to provide run-time configurability of the concrete InTransitDataAdaptors.
Configurartion shold be placed in an element of type transport
, the type
attribute names the concrete class to create and initialize. Each concrete class will have a number of attributes used for configuration.
The supported transport types are:
adios_1, adios_2, hdf5, libis
Illustrative example of the XML:
|
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.
[in] | mesh | the VTK object returned from GetMesh |
[in] | meshName | the name of the mesh on which the array is stored |
[in] | association | field association; one of svtkDataObject::FieldAssociations or svtkDataObject::AttributeTypes. |
[in] | arrayName | name of the array |
Implements sensei::DataAdaptor.
|
overridevirtual |
Fetches multiple arrays from the simulation and adds them to the mesh.
Implementers typically do not have to override this method.
[in] | mesh | the VTK object returned from GetMesh |
[in] | meshName | the name of the mesh on which the array is stored |
[in] | association | field association; one of svtkDataObject::FieldAssociations or svtkDataObject::AttributeTypes. |
[in] | arrayNames | vector of array names to add |
Reimplemented from sensei::DataAdaptor.
|
overridevirtual |
Adds ghost cells on the specified mesh.
Implementers should set the array name to "svtkGhostType".
[in] | mesh | the svtkDataObject returned from GetMesh |
[in] | meshName | the name of the mesh to access (see GetMeshMetadata) |
Reimplemented from sensei::DataAdaptor.
|
overridevirtual |
Adds ghost nodes on the specified mesh.
Implementers shouls set the name of the array to "svtkGhostType".
[in] | mesh | the VTK object returned from GetMesh |
[in] | meshName | the name of the mesh to access (see GetMeshMetadata) |
Reimplemented from sensei::DataAdaptor.
|
overridevirtual |
Signals the that we are finished with this time step.
Implements sensei::InTransitDataAdaptor.
|
overridevirtual |
Closes a stream and disconnects from the simulation.
Implements sensei::InTransitDataAdaptor.
|
overridevirtual |
Called before the application is brought down. It is safe to use MPI here.
Implements sensei::InTransitDataAdaptor.
|
overridevirtual |
Return the current connection info.
Reimplemented from sensei::InTransitDataAdaptor.
|
overridevirtual |
Get the current simulated time.
Reimplemented from sensei::DataAdaptor.
|
overridevirtual |
Get the current time step.
Reimplemented from sensei::DataAdaptor.
|
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.
[in] | meshName | the name of the mesh to access (see GetMeshMetadata) |
[in] | structureOnly | When set to true the returned mesh may not have any geometry or topology information. |
[out] | mesh | a reference to a pointer where a new VTK object is stored |
Implements sensei::DataAdaptor.
|
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.
[in] | id | index of the mesh to access |
[out] | metadata | a pointer to instance where metadata is stored |
Implements sensei::DataAdaptor.
|
overridevirtual |
Gets the number of meshes a simulation can provide.
The caller passes a reference to an integer variable in the first argument upon return this variable contains the number of meshes the simulation can provide. If successfull the method returns 0, a non-zero return indicates an error occurred.
[out] | numMeshes | an integer variable where number of meshes is stored |
Implements sensei::DataAdaptor.
|
overridevirtual |
Return the current partitioner.
Reimplemented from sensei::InTransitDataAdaptor.
|
overridevirtual |
Returns the current receiver mesh metadata.
Reimplemented from sensei::InTransitDataAdaptor.
|
overridevirtual |
Get metadta object describing the data that is available in the simulation.
Implements sensei::InTransitDataAdaptor.
|
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.
|
overridevirtual |
Opens a stream and connects to the simulation.
Implements sensei::InTransitDataAdaptor.
|
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.
Reimplemented from sensei::DataAdaptor.
|
overridevirtual |
Pass in a string containing transport specific connection information.
This is optional, as XML may be used to specify connection as well. When used the details will be specific to the transport, for instance ADIOS uses a file to negotiate the connection, hence for ADIOS connection info will be a path to that file.
Reimplemented from sensei::InTransitDataAdaptor.
|
overridevirtual |
Set the current simulated time.
The default implementation stores the passed time. Implemetors typically call this method rather than overriding the method.
Reimplemented from sensei::DataAdaptor.
|
overridevirtual |
Set the current simulated time step.
The default implementation stores the passed time step. Implemetors typically call this method rather than overriding the method.
Reimplemented from sensei::DataAdaptor.
|
overridevirtual |
Set/get the partitioner.
The partitioner is used when no receiver mesh metadata has been set. The Initialize method will initialize an instance of a ConfigurablePartitioner using user provided XML, if that fails will fall back to a default initialized instance of BlockPartitioner.
Reimplemented from sensei::InTransitDataAdaptor.
|
overridevirtual |
This API that enables one to specify how the data is partitioned on the analysis/local side.
Analyses that need control over how data lands can use this to say where data lands. The metadata object passed here will be returned to the Analysis, and the transport layer will use it to move blocks onto the correct ranks. Care, should be taken as there will be variablility in terms of what various transport layers support. The requirement for SENSEI 3.0 is that blocks are elemental. In other words given M ranks and P blocks on the sender/simulation side, a partitioning with N ranks and P blocks on the receiver/analysis side is supported. A transport may support more sophistocated partitioning, but it's not required. An analysis need not use this API, in that case the default is handled by the transport layer. See comments in InTransitDataAdaptor::Initialize for the universal partioning options as well as comments in the specific transport's implementation.
The default implementation manages the metadata objects, derived classes must handle the details of initiallizing these objects. Get calls will return -1 if no object has been set for a given id.
Reimplemented from sensei::InTransitDataAdaptor.
|
overridevirtual |
Returns true while there is more data to process.
Implements sensei::InTransitDataAdaptor.