SENSEI
A frame work for generic in situ analytics
sensei::AnalysisAdaptor Class Referenceabstract

The base class for data consumers. More...

#include <AnalysisAdaptor.h>

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

Public Types

enum  { DEVICE_HOST =-1, DEVICE_AUTO =-2 }
 values controling device selection More...
 

Public Member Functions

 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...
 
virtual bool Execute (DataAdaptor *dataIn, DataAdaptor **dataOut)=0
 Invokes in situ processing, data movement or I/O. More...
 
virtual int Finalize ()
 Clean up and shut down the data consuming library if needed. More...
 

Protected Member Functions

 AnalysisAdaptor (const AnalysisAdaptor &)=delete
 
void operator= (const AnalysisAdaptor &)=delete
 

Protected Attributes

MPI_Comm Comm
 
int Verbose
 
int DeviceId
 
int DevicesPerNode
 
int DevicesToUse
 
int DeviceStart
 
int DeviceStride
 
int Asynchronous
 

Detailed Description

The base class for data consumers.

Implementors will override ::Eexcute, and ::Finalize and can choose to implement an Initialze method. In ::Execute the sensei::DataAdaptor API is used to fetch simulation data. The fetched data is transformed as needed by the underlying processing, movement or I/O library. Simulations invoke in situ processing by calling the ::Execute method. Typically simulations will make use of the sensei::ConfigurableAnalysis.

An analysis adaptor can optionally return a sensei::DataAdaptor instance from ::Execute. Such an output may be used for further analysis or provide feedback and other control information back to the simulation itself.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum

values controling device selection

Member Function Documentation

◆ Execute()

virtual bool sensei::AnalysisAdaptor::Execute ( DataAdaptor dataIn,
DataAdaptor **  dataOut 
)
pure virtual

Invokes in situ processing, data movement or I/O.

The simulation will call this method when data is ready to be processed. Callers will pass a simulation specific sensei::DataAdaptor that can be used to fetch the needed simulation data for processing. Callers pass a non-null address to a pointer to a sensei::DataAdaptor to signal that output is desired if it is available. In that case a newly allocated data adaptor instance is returned in the pointer. This data adaptor can be used to fetch the output. The caller trakes ownership of the returned data adaptor instance and must call Delete on it when finished. Callers that do not want the output data should pass nullptr to signal that it is not needed.

Parameters
[in]dataInthe simulation provided data adaptor used to fetch data for processing
[out]dataOutthe address of a pointer to a data adaptor that could be used to fetch data from the analysis. This should be null if the caller does not want to access the output data. If it is not null and if the implementation can provide output a data, a data adaptor is allocated and returned via this pointer. In that case the caller can use the adaptor to fetch the data. The caller takes ownership of the returned data adaptor and must call Delete on it when finished.
Returns
false if an error has occurred. Typically this means that in situ processing is not possible due to misconfiguration or communication error. In that case callers should abort so as not to waste compute resources.

Implemented in sensei::SliceExtract, sensei::ADIOS2AnalysisAdaptor, sensei::PythonAnalysis, sensei::LibsimAnalysisAdaptor, sensei::VTKPosthocIO, sensei::DataBinning, sensei::VTKAmrWriter, sensei::ConfigurableAnalysis, sensei::CatalystAnalysisAdaptor, sensei::HDF5AnalysisAdaptor, sensei::AscentAnalysisAdaptor, sensei::ParticleDensity, sensei::Autocorrelation, sensei::Catalyst2AnalysisAdaptor, sensei::Histogram, sensei::OSPRayAnalysisAdaptor, and sensei::Calculator.

◆ Finalize()

virtual int sensei::AnalysisAdaptor::Finalize ( )
inlinevirtual

Clean up and shut down the data consuming library if needed.

This method is called when the run is finsihed clean up and shut down should occur here rather than in the destructor as MPI may not be available at desctruction time.

Returns
zero if successful.

Reimplemented in sensei::SliceExtract, sensei::ADIOS2AnalysisAdaptor, sensei::PythonAnalysis, sensei::LibsimAnalysisAdaptor, sensei::VTKPosthocIO, sensei::DataBinning, sensei::VTKAmrWriter, sensei::ConfigurableAnalysis, sensei::CatalystAnalysisAdaptor, sensei::HDF5AnalysisAdaptor, sensei::AscentAnalysisAdaptor, sensei::ParticleDensity, sensei::Autocorrelation, sensei::Catalyst2AnalysisAdaptor, sensei::Histogram, sensei::OSPRayAnalysisAdaptor, and sensei::Calculator.

◆ GetAsynchronous()

virtual int sensei::AnalysisAdaptor::GetAsynchronous ( )
inlinevirtual

Get asynchronous mode.

◆ GetCommunicator()

MPI_Comm sensei::AnalysisAdaptor::GetCommunicator ( )
inline

returns the MPI communicator to be used for all communication

◆ GetDeviceId()

virtual int sensei::AnalysisAdaptor::GetDeviceId ( )
virtual

Get the device that the analysis should run on.

When ::SetDeviceId has the special value of DEVICE_AUTO (-2) the * following algorithm is used:

DeviceId = ( MPI rank % DevicesInUse * DeviceStride + DeviceStart ) % DevicesPerNode

See ::SetDeviceId.

◆ GetDeviceStart()

virtual int sensei::AnalysisAdaptor::GetDeviceStart ( )
inlinevirtual

Get the first device to use.

◆ GetDevicesToUse()

virtual int sensei::AnalysisAdaptor::GetDevicesToUse ( )
inlinevirtual

Get the number of devices to use per node.

◆ GetDeviceStride()

virtual int sensei::AnalysisAdaptor::GetDeviceStride ( )
inlinevirtual

Get the number of devices to skip.

◆ GetVerbose()

virtual int sensei::AnalysisAdaptor::GetVerbose ( )
inlinevirtual

Get the level of verbosity of console output.

◆ PrintSelf()

void sensei::AnalysisAdaptor::PrintSelf ( ostream &  os,
svtkIndent  indent 
)
override

Prints the current state of the adaptor.

◆ SetAsynchronous()

virtual void sensei::AnalysisAdaptor::SetAsynchronous ( int  val)
inlinevirtual

When set the analysis should buffer the simulation data and run in the background returning to the simulation immediately.

This mode requires MPI_THREAD_MULTIPLE and each thread must use a different communictor or serialize the calls to MPI collectives. The environment variable SENSEI_ASYNCHRONOUS provides the initial value. Oterwise the default is 0.

Reimplemented in sensei::ConfigurableAnalysis, and sensei::DataBinning.

◆ SetCommunicator()

virtual int sensei::AnalysisAdaptor::SetCommunicator ( MPI_Comm  comm)
virtual

Set the MPI communicator to be used by the adaptor.

The default communicator is a duplicate of MPI_COMMM_WORLD, giving each adaptor a unique communication space. Users wishing to override this should set the communicator before doing anything else. Derived classes should use the communicator returned by GetCommunicator.

Reimplemented in sensei::ConfigurableAnalysis.

◆ SetDeviceId()

virtual void sensei::AnalysisAdaptor::SetDeviceId ( int  val)
inlinevirtual

Set the device that the analysis should run on.

A value of DEVICE_HOST (-1) indicates that the analysis should run on the host while a value greater or equal to 0 specifies the device explicitly. The special value of DEVICE_AUTO (-2) is reserved for automatic device selection. The environment variable SENSEI_DEVICE_ID provides the initial value. Otherwise the default is DEVICE_HOST. See ::GetDeviceId for an explanation of the automatic device selection algorithm.

Reimplemented in sensei::ConfigurableAnalysis.

◆ SetDeviceStart()

virtual void sensei::AnalysisAdaptor::SetDeviceStart ( int  val)
inlinevirtual

Set the first on node device to use in automatic device selection.

The environment variable SENSEI_DEVICE_START provides the initial value. Otherwise the default is 0. See ::SetDeviceId for an explanation of automatic device selection.

Reimplemented in sensei::ConfigurableAnalysis.

◆ SetDevicesToUse()

virtual void sensei::AnalysisAdaptor::SetDevicesToUse ( int  val)
inlinevirtual

Set the number of devices to use per node.

This value can be smaller than the number of actual devices but should not exceed it. The environment variable SENSEI_DEVICES_TO_USE provides the initial value. Otherwise the default is the number of actual devices available. See ::SetDeviceId for an explanation of automatic device selection.

Reimplemented in sensei::ConfigurableAnalysis.

◆ SetDeviceStride()

virtual void sensei::AnalysisAdaptor::SetDeviceStride ( int  val)
inlinevirtual

Set the number of devices to skip in automatic device selection.

The environment variable SENSEI_DEVICE_STRIDE provides the initial value. Otherwise the default is 0. See ::SetDeviceId for an explanation of automatic device selection.

Reimplemented in sensei::ConfigurableAnalysis.

◆ SetVerbose()

virtual void sensei::AnalysisAdaptor::SetVerbose ( int  val)
inlinevirtual

Set the level of verbosity of console output.

The environment variable SENSEI_VERBOSE provides the initial value if set. Otherwise the default is 0.

Reimplemented in sensei::SliceExtract, and sensei::ConfigurableAnalysis.


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