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

Writes simulation data to disk in a VTK based format. More...

#include <VTKPosthocIO.h>

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

Public Member Functions

 senseiTypeMacro (VTKPosthocIO, AnalysisAdaptor)
 
bool Execute (DataAdaptor *data, DataAdaptor **) override
 Invokes in situ processing, data movement or I/O. More...
 
int Finalize () override
 Clean up and shut down the data consuming library if needed. 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 VTKPosthocIONew ()
 Constructs a VTKPosthocIO instance. More...
 

Protected Member Functions

 VTKPosthocIO (const VTKPosthocIO &)=delete
 
void operator= (const VTKPosthocIO &)=delete
 
- Protected Member Functions inherited from sensei::AnalysisAdaptor
 AnalysisAdaptor (const AnalysisAdaptor &)=delete
 
void operator= (const AnalysisAdaptor &)=delete
 

Run time configuration

enum  { MODE_PARAVIEW =0, MODE_VISIT =1 }
 File creation modes. More...
 
enum  { WRITER_VTK_LEGACY =0, WRITER_VTK_XML =1 }
 
int SetOutputDir (const std::string &outputDir)
 Sets the directory files will be written to. More...
 
int SetMode (int mode)
 Sets the file creation mode. MODE_PARAVIEW=0, MODE_VISIT=1. More...
 
int SetMode (std::string mode)
 Set the file creation mode by string Use either "paraview" or "visit". More...
 
int SetWriter (int writer)
 Sets the writer type to a VTK legacy writer(WRITER_VTK_LEGACY=0) or the VTK XML writer (WRITER_VTK_XML=1). More...
 
int SetWriter (std::string writer)
 Sets the writer type to a VTK legacy writer("legacy") or the VTK XML writer ("xml"). More...
 
void SetGhostArrayName (const std::string &name)
 if set this overrides the default of vtkGhostType for ParaView and avtGhostZones for VisIt More...
 
std::string GetGhostArrayName ()
 Get the name of the ghost cells array. 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 (unsigned int frequency)
 Controls how many calls to Execute do nothing between actual I/O. More...
 

Additional Inherited Members

- Public Types inherited from sensei::AnalysisAdaptor
enum  { DEVICE_HOST =-1, DEVICE_AUTO =-2 }
 values controling device selection More...
 
- Protected Attributes inherited from sensei::AnalysisAdaptor
MPI_Comm Comm
 
int Verbose
 
int DeviceId
 
int DevicesPerNode
 
int DevicesToUse
 
int DeviceStart
 
int DeviceStride
 
int Asynchronous
 

Detailed Description

Writes simulation data to disk in a VTK based format.

This can be useful for generating preview datasets that allow configuration of Catalyst and/or Libsim scripts, or for staging data on resources such as burst buffers. This adaptor supports writing to VisIt(.visit) or ParaView(.pvd) compatible format. One must provide a set of data requirments, consisting of a list of meshes and the arrays to write from each mesh. File names are derived using the output directory, the mesh name, and the mode.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum

File creation modes.

Member Function Documentation

◆ AddDataRequirement()

int sensei::VTKPosthocIO::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.

◆ Execute()

bool sensei::VTKPosthocIO::Execute ( DataAdaptor dataIn,
DataAdaptor **  dataOut 
)
overridevirtual

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.

Implements sensei::AnalysisAdaptor.

◆ Finalize()

int sensei::VTKPosthocIO::Finalize ( )
overridevirtual

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 from sensei::AnalysisAdaptor.

◆ GetGhostArrayName()

std::string sensei::VTKPosthocIO::GetGhostArrayName ( )

Get the name of the ghost cells array.

◆ New()

static VTKPosthocIO* sensei::VTKPosthocIO::New ( )
static

Constructs a VTKPosthocIO instance.

◆ SetDataRequirements()

int sensei::VTKPosthocIO::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.

◆ SetFrequency()

int sensei::VTKPosthocIO::SetFrequency ( unsigned int  frequency)

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

◆ SetGhostArrayName()

void sensei::VTKPosthocIO::SetGhostArrayName ( const std::string &  name)

if set this overrides the default of vtkGhostType for ParaView and avtGhostZones for VisIt

◆ SetMode() [1/2]

int sensei::VTKPosthocIO::SetMode ( int  mode)

Sets the file creation mode. MODE_PARAVIEW=0, MODE_VISIT=1.

◆ SetMode() [2/2]

int sensei::VTKPosthocIO::SetMode ( std::string  mode)

Set the file creation mode by string Use either "paraview" or "visit".

◆ SetOutputDir()

int sensei::VTKPosthocIO::SetOutputDir ( const std::string &  outputDir)

Sets the directory files will be written to.

◆ SetWriter() [1/2]

int sensei::VTKPosthocIO::SetWriter ( int  writer)

Sets the writer type to a VTK legacy writer(WRITER_VTK_LEGACY=0) or the VTK XML writer (WRITER_VTK_XML=1).

◆ SetWriter() [2/2]

int sensei::VTKPosthocIO::SetWriter ( std::string  writer)

Sets the writer type to a VTK legacy writer("legacy") or the VTK XML writer ("xml").


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