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{
38
39class Adios2StManColumn;
40
42{
43public:
44
46 void *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 std::string configFile);
52
54
55#ifdef HAVE_MPI
56 void checkMPI() const;
57#endif
61 void create64(rownr_t aNrRows);
64 Bool flush(AipsIO &ios, Bool doFsync);
66 int aDataType,
67 const String &aDataTypeID);
69 int aDataType,
70 const String &aDataTypeID);
72 int aDataType,
73 const String &aDataTypeID);
75 int aDataType,
76 const String &aDataTypeID);
78 void addRow64(rownr_t aNrRows);
79 static DataManager *makeObject(const String &aDataManType,
80 const Record &spec);
83
84private:
86 String itsDataManName = "Adios2StMan";
89
90 std::shared_ptr<adios2::ADIOS> itsAdios;
91 std::shared_ptr<adios2::IO> itsAdiosIO;
92 std::shared_ptr<adios2::Engine> itsAdiosEngine;
93
94#ifdef HAVE_MPI
95 // MPI communicator to be used by all instances of this storage manager
96 static MPI_Comm itsMpiComm;
97#endif
98
99 // The ADIOS2 Engine type
101 // Parameters for the ADIOS2 engine
102 adios2::Params itsAdiosEngineParams;
103 // Parameters for the ADIOS2 transports
104 std::vector<adios2::Params> itsAdiosTransportParamsVec;
105 // Parameters for the ADIOS2 operators (compressors)
106 std::vector<adios2::Params> itsAdiosOperatorParamsVec;
107 // The ADIOS2 XML configuration file
109
110 // The type of this storage manager
111 static constexpr const char *DATA_MANAGER_TYPE = "Adios2StMan";
112 // The name of the specification field for the ADIOS2 XML configuration file
113 static constexpr const char *SPEC_FIELD_XML_FILE = "XMLFILE";
114 // The name of the specification field for the ADIOS2 engine type
115 static constexpr const char *SPEC_FIELD_ENGINE_TYPE = "ENGINETYPE";
116 // The name of the specification field for the ADIOS2 engine parameters
117 static constexpr const char *SPEC_FIELD_ENGINE_PARAMS = "ENGINEPARAMS";
118 // The name of the specification field for the ADIOS2 transport parameters
119 static constexpr const char *SPEC_FIELD_TRANSPORT_PARAMS = "TRANSPORTPARAMS";
120 // The name of the specification field for the ADIOS2 operator parameters
121 static constexpr const char *SPEC_FIELD_OPERATOR_PARAMS = "OPERATORPARAMS";
122
124 uInt ncolumn() const { return parent.ncolumn(); }
125 String fileName() const { return parent.fileName(); }
126};
127
128} // namespace casacore
129
130#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
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
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.
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
std::vector< adios2::Params > itsAdiosTransportParamsVec
Parameters for the ADIOS2 transports.
Abstract base class for a data manager.
uInt ncolumn() const
Get the nr of columns in this data manager (can be zero).
String fileName() const
Compose a unique filename from the table name and sequence number.
A drop-in replacement for Block<T*>.
Definition Block.h:812
String: the storage and methods of handling collections of characters.
Definition String.h:223
this file contains all the compiler specific defines
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