SENSEI
A frame work for generic in situ analytics
ADIOS2DataAdaptor.h
1 #ifndef ADIOS2DataAdaptor_h
2 #define ADIOS2DataAdaptor_h
3 
4 #include "InTransitDataAdaptor.h"
5 
6 #include <adios2_c.h>
7 #include <mpi.h>
8 #include <string>
9 
10 namespace pugi { class xml_node; }
11 
12 namespace sensei
13 {
14 
15 /// The read side of the ADIOS 2 transport layer
16 class SENSEI_EXPORT ADIOS2DataAdaptor : public sensei::InTransitDataAdaptor
17 {
18 public:
19  static ADIOS2DataAdaptor* New();
21 
22  /// @brief Set the filename.
23  /// Default value is "sensei.bp" which is suitable for use with streams or
24  /// transport engines such as SST. When reading file series from disk using
25  /// engines such as BP4 one should include a integer printf format specifier,
26  /// for example "sensei_%04d.bp".
27  void SetFileName(const std::string &fileName);
28 
29  // set te adios engine to use. this will be the same engine
30  // given to the write side analysis adaptor
31  void SetReadEngine(const std::string &readEngine);
32 
33  // add name value pairs to pass into ADIOS after the
34  // engine has been created
35  void AddParameter(const std::string &name, const std::string &value);
36 
37  /// SENSEI InTransitDataAdaptor control API
38  int Initialize(pugi::xml_node &parent) override;
39  int Finalize() override;
40 
41  int OpenStream() override;
42  int CloseStream() override;
43  int AdvanceStream() override;
44  int StreamGood() override;
45 
46  /// SENSEI InTransitDataAdaptor explicit paritioning API
47  int GetSenderMeshMetadata(unsigned int id, MeshMetadataPtr &metadata) override;
48 
49  /// SENSEI DataAdaptor API
50  int GetNumberOfMeshes(unsigned int &numMeshes) override;
51 
52  int GetMeshMetadata(unsigned int id, MeshMetadataPtr &metadata) override;
53 
54  int GetMesh(const std::string &meshName, bool structure_only,
55  svtkDataObject *&mesh) override;
56 
57  int AddGhostNodesArray(svtkDataObject* mesh, const std::string &meshName) override;
58  int AddGhostCellsArray(svtkDataObject* mesh, const std::string &meshName) override;
59 
60  int AddArray(svtkDataObject* mesh, const std::string &meshName,
61  int association, const std::string &arrayName) override;
62 
63  int ReleaseData() override;
64 
65 protected:
68 
69  // reads the current time step and time values from the stream
70  // stores them in the base class information object
71  int UpdateTimeStep();
72 
73 private:
74  struct InternalsType;
75  InternalsType *Internals;
76 
77  ADIOS2DataAdaptor(const ADIOS2DataAdaptor&) = delete;
78  void operator=(const ADIOS2DataAdaptor&) = delete;
79 };
80 
81 }
82 
83 #endif
int Initialize(MPI_Comm comm, const std::string &fileName, InTransitDataAdaptor *&dataAdaptor)
Creates a sensei::ConfigurableAnalysis adaptor and sensei::InTransitDataAdaptor based on a SENSEI XML...
The read side of the ADIOS 2 transport layer.
Definition: ADIOS2DataAdaptor.h:16
Defines the control API for in transit data movement.
Definition: InTransitDataAdaptor.h:27
SENSEI.
Definition: ADIOS2AnalysisAdaptor.h:27
Definition: ADIOS2DataAdaptor.h:10