casacore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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;
58  String dataManagerType() const;
59  String dataManagerName() const;
60  void create64(rownr_t aNrRows);
61  rownr_t open64(rownr_t aRowNr, AipsIO &ios);
62  rownr_t resync64(rownr_t aRowNr);
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);
80  Record dataManagerSpec() const;
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
std::shared_ptr< adios2::IO > itsAdiosIO
DataManager * clone() const
std::shared_ptr< adios2::ADIOS > itsAdios
uInt ncolumn() const
Get the nr of columns in this data manager (can be zero).
Definition: DataManager.h:285
AipsIO is the object persistency mechanism of Casacore.
Definition: AipsIO.h:168
Abstract base class for a column in a data manager.
String fileName() const
Compose a unique filename from the table name and sequence number.
void create64(rownr_t aNrRows)
DataManagerColumn * makeDirArrColumn(const String &aName, int aDataType, const String &aDataTypeID)
DataManagerColumn * makeIndArrColumn(const String &aName, int aDataType, const String &aDataTypeID)
static constexpr const char * SPEC_FIELD_OPERATOR_PARAMS
The name of the specification field for the ADIOS2 operator parameters.
DataManagerColumn * makeScalarColumn(const String &aName, int aDataType, const String &aDataTypeID)
std::string itsAdiosXmlFile
The ADIOS2 XML configuration file.
Bool flush(AipsIO &ios, Bool doFsync)
A hierarchical collection of named fields of various types.
Definition: Record.h:180
bool Bool
Define the standard types used by Casacore.
Definition: aipstype.h:42
static constexpr const char * SPEC_FIELD_TRANSPORT_PARAMS
The name of the specification field for the ADIOS2 transport parameters.
static constexpr const char * SPEC_FIELD_XML_FILE
The name of the specification field for the ADIOS2 XML configuration file.
std::shared_ptr< adios2::Engine > itsAdiosEngine
static constexpr const char * DATA_MANAGER_TYPE
The type of this storage manager.
void addRow64(rownr_t aNrRows)
A drop-in replacement for Block&lt;T*&gt;.
Definition: Block.h:814
String dataManagerName() const
std::vector< adios2::Params > itsAdiosOperatorParamsVec
Parameters for the ADIOS2 operators (compressors)
uInt64 rownr_t
Define the type of a row number in a table.
Definition: aipsxtype.h:46
static constexpr const char * SPEC_FIELD_ENGINE_PARAMS
The name of the specification field for the ADIOS2 engine parameters.
Abstract base class for a data manager.
Definition: DataManager.h:220
Record dataManagerSpec() const
static constexpr const char * SPEC_FIELD_ENGINE_TYPE
The name of the specification field for the ADIOS2 engine type.
String: the storage and methods of handling collections of characters.
Definition: String.h:225
adios2::Params itsAdiosEngineParams
Parameters for the ADIOS2 engine.
static DataManager * makeObject(const String &aDataManType, const Record &spec)
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)
DataManagerColumn * makeColumnCommon(const String &aName, int aDataType, const String &aDataTypeID)
std::string itsAdiosEngineType
The ADIOS2 Engine type.
std::vector< adios2::Params > itsAdiosTransportParamsVec
Parameters for the ADIOS2 transports.
String dataManagerType() const
static MPI_Comm itsMpiComm
MPI communicator to be used by all instances of this storage manager.
unsigned int uInt
Definition: aipstype.h:51
PtrBlock< Adios2StManColumn * > itsColumnPtrBlk
rownr_t resync64(rownr_t aRowNr)
rownr_t open64(rownr_t aRowNr, AipsIO &ios)