XGCa
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
adios2.hpp
Go to the documentation of this file.
1 #ifndef ADIOS2_HPP
2 #define ADIOS2_HPP
3 
4 #include <adios2.h>
5 #include <mpi.h>
6 #include <memory>
7 
8 void ADIOS2Init(const std::string configFile, MPI_Comm &comm);
9 
10 using ADIOS2Ptr = std::shared_ptr<adios2::ADIOS>;
11 using EnginePtr = std::shared_ptr<adios2::Engine>;
12 using IOPtr = std::shared_ptr<adios2::IO>;
13 
15 
16 // communicator for processes on the same compute node
17 // used only for IO
18 extern MPI_Comm SML_COMM_COMPNODE;
19 extern int SML_COMM_RANK_COMPNODE;
20 extern int SML_COMM_SIZE_COMPNODE;
21 
22 extern MPI_Comm SML_COMM_ONEPERNODE;
23 extern int SML_COMM_RANK_ONEPERNODE;
24 extern int SML_COMM_SIZE_ONEPERNODE;
25 
27 {
28 public:
31  adios2::Mode mode;
32 
33  ADIOS2Stream();
34  ADIOS2Stream(const std::string &IOName);
35  ~ADIOS2Stream();
36 
37  IOPtr DeclareIO(const std::string &IOName);
38  void Open(const std::string &StreamName, const adios2::Mode mode);
39  void Open(const std::string &StreamName, const adios2::Mode mode, MPI_Comm &comm);
40  void Close();
41 
42 private:
43  const std::string m_StreamName;
44 
45 };
46 
47 ADIOS2Stream* ADIOS2Lookup(const std::string &IOName);
48 
49 #endif
const std::string m_StreamName
Definition: adios2.hpp:43
int SML_COMM_RANK_ONEPERNODE
Definition: adios2.cpp:16
MPI_Comm SML_COMM_COMPNODE
Definition: adios2.cpp:11
std::shared_ptr< adios2::Engine > EnginePtr
Definition: adios2.hpp:11
void Open(const std::string &StreamName, const adios2::Mode mode)
int SML_COMM_SIZE_ONEPERNODE
Definition: adios2.cpp:17
ADIOS2Ptr GetADIOSPtr2()
EnginePtr engine
Definition: adios2.hpp:30
std::shared_ptr< adios2::IO > IOPtr
Definition: adios2.hpp:12
Definition: adios2.hpp:26
int SML_COMM_RANK_COMPNODE
Definition: adios2.cpp:12
int SML_COMM_SIZE_COMPNODE
Definition: adios2.cpp:13
adios2::Mode mode
Definition: adios2.hpp:31
MPI_Comm SML_COMM_ONEPERNODE
Definition: adios2.cpp:15
std::shared_ptr< adios2::ADIOS > ADIOS2Ptr
Definition: adios2.hpp:10
ADIOS2Stream * ADIOS2Lookup(const std::string &IOName)
IOPtr io
Definition: adios2.hpp:29
void ADIOS2Init(const std::string configFile, MPI_Comm &comm)
IOPtr DeclareIO(const std::string &IOName)