casacore
Loading...
Searching...
No Matches
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: casa-feedback@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
36namespace casacore {
37
39
41 public:
42 impl(Adios2StMan &parent, void *mpiComm, std::string engineType,
43 std::map<std::string, std::string> engineParams,
44 std::vector<std::map<std::string, std::string>> transportParams,
45 std::vector<std::map<std::string, std::string>> operatorParams, std::string configFile);
46
48
49#ifdef HAVE_MPI
50 void checkMPI() const;
51#endif
55 void setDataManagerName(const String &aName);
56 void create64(rownr_t aNrRows);
59 Bool flush(AipsIO &ios, Bool doFsync);
60 DataManagerColumn *makeColumnCommon(const String &aName, int aDataType,
61 const String &aDataTypeID);
62 DataManagerColumn *makeScalarColumn(const String &aName, int aDataType,
63 const String &aDataTypeID);
64 DataManagerColumn *makeDirArrColumn(const String &aName, int aDataType,
65 const String &aDataTypeID);
66 DataManagerColumn *makeIndArrColumn(const String &aName, int aDataType,
67 const String &aDataTypeID);
69 void addRow64(rownr_t aNrRows);
70 static DataManager *makeObject(const String &aDataManType, const Record &spec);
73
74 private:
76 String itsDataManName = "Adios2StMan";
79
80 std::shared_ptr<adios2::ADIOS> itsAdios;
81 std::shared_ptr<adios2::IO> itsAdiosIO;
82 std::shared_ptr<adios2::Engine> itsAdiosEngine;
83
84#ifdef HAVE_MPI
85 // MPI communicator to be used by all instances of this storage manager
86 static MPI_Comm itsMpiComm;
87#endif
88
89 // The ADIOS2 Engine type
90 std::string itsAdiosEngineType;
91 // Parameters for the ADIOS2 engine
92 adios2::Params itsAdiosEngineParams;
93 // Parameters for the ADIOS2 transports
94 std::vector<adios2::Params> itsAdiosTransportParamsVec;
95 // Parameters for the ADIOS2 operators (compressors)
96 std::vector<adios2::Params> itsAdiosOperatorParamsVec;
97 // The ADIOS2 XML configuration file
98 std::string itsAdiosConfigFile;
99
100 // The type of this storage manager
101 static constexpr const char *DATA_MANAGER_TYPE = "Adios2StMan";
102 // The name of the specification field for the ADIOS2 XML configuration file
103 static constexpr const char *SPEC_FIELD_XML_FILE = "XMLFILE";
104 // The name of the specification field for the ADIOS2 engine type
105 static constexpr const char *SPEC_FIELD_ENGINE_TYPE = "ENGINETYPE";
106 // The name of the specification field for the ADIOS2 engine parameters
107 static constexpr const char *SPEC_FIELD_ENGINE_PARAMS = "ENGINEPARAMS";
108 // The name of the specification field for the ADIOS2 transport parameters
109 static constexpr const char *SPEC_FIELD_TRANSPORT_PARAMS = "TRANSPORTPARAMS";
110 // The name of the specification field for the ADIOS2 operator parameters
111 static constexpr const char *SPEC_FIELD_OPERATOR_PARAMS = "OPERATORPARAMS";
112
114 uInt ncolumn() const { return parent.ncolumn(); }
115 String fileName() const { return parent.fileName(); }
116};
117
118} // namespace casacore
119
120#endif // ADIOS2STMANIMPL_H
Block< Adios2StManColumn * > itsColumnPtrBlk
static MPI_Comm itsMpiComm
MPI communicator to be used by all instances of this storage manager.
std::shared_ptr< adios2::IO > itsAdiosIO
static DataManager * makeObject(const String &aDataManType, const Record &spec)
impl(Adios2StMan &parent, void *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, std::string configFile)
static constexpr const char * DATA_MANAGER_TYPE
The type of this storage manager.
DataManagerColumn * makeDirArrColumn(const String &aName, int aDataType, const String &aDataTypeID)
String dataManagerType() const
String dataManagerName() const
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.
DataManagerColumn * makeIndArrColumn(const String &aName, int aDataType, const String &aDataTypeID)
std::vector< adios2::Params > itsAdiosOperatorParamsVec
Parameters for the ADIOS2 operators (compressors).
Bool flush(AipsIO &ios, Bool doFsync)
void addRow64(rownr_t aNrRows)
std::shared_ptr< adios2::Engine > itsAdiosEngine
rownr_t open64(rownr_t aRowNr, AipsIO &ios)
static constexpr const char * SPEC_FIELD_OPERATOR_PARAMS
The name of the specification field for the ADIOS2 operator parameters.
DataManager * clone() const
static constexpr const char * SPEC_FIELD_ENGINE_TYPE
The name of the specification field for the ADIOS2 engine type.
Record dataManagerSpec() const
std::string itsAdiosConfigFile
The ADIOS2 XML configuration file.
DataManagerColumn * makeScalarColumn(const String &aName, int aDataType, const String &aDataTypeID)
adios2::Params itsAdiosEngineParams
Parameters for the ADIOS2 engine.
DataManagerColumn * makeColumnCommon(const String &aName, int aDataType, const String &aDataTypeID)
std::string itsAdiosEngineType
The ADIOS2 Engine type.
rownr_t resync64(rownr_t aRowNr)
void create64(rownr_t aNrRows)
std::shared_ptr< adios2::ADIOS > itsAdios
void setDataManagerName(const String &aName)
std::vector< adios2::Params > itsAdiosTransportParamsVec
Parameters for the ADIOS2 transports.
Adios2StMan(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={})
DataManager()
Default constructor.
String: the storage and methods of handling collections of characters.
Definition String.h:355
For temporary backward namespace compatibility, use casa as alias for casacore.
Definition mainpage.dox:28
unsigned int uInt
Definition aipstype.h:49
bool Bool
Define the standard types used by Casacore.
Definition aipstype.h:40
uInt64 rownr_t
Define the type of a row number in a table.
Definition aipsxtype.h:44