casacore
Adios2StManImpl.h
Go to the documentation of this file.
1 //# Adios2StManImpl.h: Implementation class definition of the ADIOS2 Storage Manager
2 //
3 //# ICRAR - International Centre for Radio Astronomy Research
4 //# (c) UWA - The University of Western Australia, 2018
5 //# Copyright by UWA (in the framework of the ICRAR)
6 //#
7 //# This library is free software; you can redistribute it and/or modify it
8 //# under the terms of the GNU Library General Public License as published by
9 //# the Free Software Foundation; either version 2 of the License, or (at your
10 //# option) any later version.
11 //#
12 //# This library is distributed in the hope that it will be useful, but WITHOUT
13 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 //# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
15 //# License for more details.
16 //#
17 //# You should have received a copy of the GNU Library General Public License
18 //# along with this library; if not, write to the Free Software Foundation,
19 //# Inc., 675 Massachusettes Ave, Cambridge, MA 02139, USA.
20 //#
21 //# Correspondence concerning AIPS++ should be addressed as follows:
22 //# Internet email: aips2-request@nrao.edu.
23 //# Postal address: AIPS++ Project Office
24 //# National Radio Astronomy Observatory
25 //# 520 Edgemont Road
26 //# Charlottesville, VA 22903-2475 USA
27 //#
28 
29 #ifndef ADIOS2STMANIMPL_H
30 #define ADIOS2STMANIMPL_H
31 
32 #include <adios2.h>
33 
34 #include "Adios2StMan.h"
35 
36 namespace casacore
37 {
38 
39 class Adios2StManColumn;
40 
42 {
43 public:
44 
46  MPI_Comm mpiComm,
47  std::string engineType,
48  std::map<std::string, std::string> engineParams,
49  std::vector<std::map<std::string, std::string>> transportParams,
50  std::vector<std::map<std::string, std::string>> operatorParams);
51 
52  impl(Adios2StMan &parent, std::string xmlFile, MPI_Comm mpiComm);
53 
54  ~impl();
55 
56  void checkMPI() const;
57  DataManager *clone() const;
60  void create64(rownr_t aNrRows);
61  rownr_t open64(rownr_t aRowNr, AipsIO &ios);
63  Bool flush(AipsIO &ios, Bool doFsync);
65  int aDataType,
66  const String &aDataTypeID);
68  int aDataType,
69  const String &aDataTypeID);
71  int aDataType,
72  const String &aDataTypeID);
74  int aDataType,
75  const String &aDataTypeID);
76  void deleteManager();
77  void addRow64(rownr_t aNrRows);
78  static DataManager *makeObject(const String &aDataManType,
79  const Record &spec);
82 
83 private:
85  String itsDataManName = "Adios2StMan";
88 
89  std::shared_ptr<adios2::ADIOS> itsAdios;
90  std::shared_ptr<adios2::IO> itsAdiosIO;
91  std::shared_ptr<adios2::Engine> itsAdiosEngine;
92 
93  // MPI communicator to be used by all instances of this storage manager
94  static MPI_Comm itsMpiComm;
95 
96  // The ADIOS2 XML configuration file
97  std::string itsAdiosXmlFile;
98  // The ADIOS2 Engine type
99  std::string itsAdiosEngineType;
100  // Parameters for the ADIOS2 engine
101  adios2::Params itsAdiosEngineParams;
102  // Parameters for the ADIOS2 transports
103  std::vector<adios2::Params> itsAdiosTransportParamsVec;
104  // Parameters for the ADIOS2 operators (compressors)
105  std::vector<adios2::Params> itsAdiosOperatorParamsVec;
106 
107  // The type of this storage manager
108  static constexpr const char *DATA_MANAGER_TYPE = "Adios2StMan";
109  // The name of the specification field for the ADIOS2 XML configuration file
110  static constexpr const char *SPEC_FIELD_XML_FILE = "XMLFILE";
111  // The name of the specification field for the ADIOS2 engine type
112  static constexpr const char *SPEC_FIELD_ENGINE_TYPE = "ENGINETYPE";
113  // The name of the specification field for the ADIOS2 engine parameters
114  static constexpr const char *SPEC_FIELD_ENGINE_PARAMS = "ENGINEPARAMS";
115  // The name of the specification field for the ADIOS2 transport parameters
116  static constexpr const char *SPEC_FIELD_TRANSPORT_PARAMS = "TRANSPORTPARAMS";
117  // The name of the specification field for the ADIOS2 operator parameters
118  static constexpr const char *SPEC_FIELD_OPERATOR_PARAMS = "OPERATORPARAMS";
119 
120  uInt ncolumn() const { return parent.ncolumn(); }
121  String fileName() const { return parent.fileName(); }
122 };
123 
124 } // namespace casacore
125 
126 #endif // ADIOS2STMANIMPL_H
static MPI_Comm itsMpiComm
MPI communicator to be used by all instances of this storage manager.
std::shared_ptr< adios2::IO > itsAdiosIO
DataManagerColumn * makeScalarColumn(const String &aName, int aDataType, const String &aDataTypeID)
DataManagerColumn * makeDirArrColumn(const String &aName, int aDataType, const String &aDataTypeID)
impl(Adios2StMan &parent, std::string xmlFile, MPI_Comm mpiComm)
DataManager * clone() const
std::string itsAdiosXmlFile
The ADIOS2 XML configuration file.
static constexpr const char * DATA_MANAGER_TYPE
The type of this storage manager.
String dataManagerType() const
String dataManagerName() const
PtrBlock< Adios2StManColumn * > itsColumnPtrBlk
static constexpr const char * SPEC_FIELD_ENGINE_PARAMS
The name of the specification field for the ADIOS2 engine parameters.
static constexpr const char * SPEC_FIELD_XML_FILE
The name of the specification field for the ADIOS2 XML configuration file.
static constexpr const char * SPEC_FIELD_TRANSPORT_PARAMS
The name of the specification field for the ADIOS2 transport parameters.
std::vector< adios2::Params > itsAdiosOperatorParamsVec
Parameters for the ADIOS2 operators (compressors)
Bool flush(AipsIO &ios, Bool doFsync)
DataManagerColumn * makeIndArrColumn(const String &aName, int aDataType, const String &aDataTypeID)
void addRow64(rownr_t aNrRows)
std::shared_ptr< adios2::Engine > itsAdiosEngine
rownr_t open64(rownr_t aRowNr, AipsIO &ios)
static DataManager * makeObject(const String &aDataManType, const Record &spec)
static constexpr const char * SPEC_FIELD_OPERATOR_PARAMS
The name of the specification field for the ADIOS2 operator parameters.
static constexpr const char * SPEC_FIELD_ENGINE_TYPE
The name of the specification field for the ADIOS2 engine type.
impl(Adios2StMan &parent, MPI_Comm mpiComm, std::string engineType, std::map< std::string, std::string > engineParams, std::vector< std::map< std::string, std::string >> transportParams, std::vector< std::map< std::string, std::string >> operatorParams)
Record dataManagerSpec() const
adios2::Params itsAdiosEngineParams
Parameters for the ADIOS2 engine.
std::string itsAdiosEngineType
The ADIOS2 Engine type.
rownr_t resync64(rownr_t aRowNr)
DataManagerColumn * makeColumnCommon(const String &aName, int aDataType, const String &aDataTypeID)
void create64(rownr_t aNrRows)
std::shared_ptr< adios2::ADIOS > itsAdios
std::vector< adios2::Params > itsAdiosTransportParamsVec
Parameters for the ADIOS2 transports.
Abstract base class for a data manager.
Definition: DataManager.h:221
uInt ncolumn() const
Get the nr of columns in this data manager (can be zero).
Definition: DataManager.h:285
String fileName() const
Compose a unique filename from the table name and sequence number.
A drop-in replacement for Block<T*>.
Definition: Block.h:814
String: the storage and methods of handling collections of characters.
Definition: String.h:225
this file contains all the compiler specific defines
Definition: mainpage.dox:28
unsigned int uInt
Definition: aipstype.h:51
bool Bool
Define the standard types used by Casacore.
Definition: aipstype.h:42
uInt64 rownr_t
Define the type of a row number in a table.
Definition: aipsxtype.h:46