casacore
Loading...
Searching...
No Matches
Adios2StMan.h
Go to the documentation of this file.
1// # Adios2StMan.h: Base class of the ADIOS2 Storage Manager
2// # Copyright (C) 2018
3// # Associated Universities, Inc. Washington DC, USA.
4// #
5// # This library is free software; you can redistribute it and/or modify it
6// # under the terms of the GNU Library General Public License as published by
7// # the Free Software Foundation; either version 2 of the License, or (at your
8// # option) any later version.
9// #
10// # This library is distributed in the hope that it will be useful, but WITHOUT
11// # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12// # FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
13// # License for more details.
14// #
15// # You should have received a copy of the GNU Library General Public License
16// # along with this library; if not, write to the Free Software Foundation,
17// # Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
18// #
19// # Correspondence concerning AIPS++ should be addressed as follows:
20// # Internet email: casa-feedback@nrao.edu.
21// # Postal address: AIPS++ Project Office
22// # National Radio Astronomy Observatory
23// # 520 Edgemont Road
24// # Charlottesville, VA 22903-2475 USA
25
26#ifndef ADIOS2STMAN_H
27#define ADIOS2STMAN_H
28
29#include <map>
30#include <memory>
31#include <string>
32#include <vector>
33
34#ifdef HAVE_MPI
35#include <mpi.h>
36#endif
37
38#include <casacore/casa/IO/AipsIO.h>
39#include <casacore/tables/DataMan/DataManager.h>
40#include <casacore/tables/Tables/Table.h>
41
42namespace casacore {
43
44class Adios2StMan : public DataManager {
45 friend class Adios2StManColumn;
46 template <typename T>
47 friend class Adios2StManColumnT;
48
49 public:
50 // tag for differentiating string-based constructors
51 struct from_config_t {};
52 constexpr static from_config_t from_config{};
53
54#ifdef HAVE_MPI
55 Adios2StMan(MPI_Comm mpiComm, std::string engineType = {},
56 std::map<std::string, std::string> engineParams = {},
57 std::vector<std::map<std::string, std::string>> transportParams = {},
58 std::vector<std::map<std::string, std::string>> operatorParams = {});
59
60 Adios2StMan(MPI_Comm mpiComm, std::string configFile, from_config_t);
61#endif // HAVE_MPI
62
63 Adios2StMan(std::string engineType = {}, std::map<std::string, std::string> engineParams = {},
64 std::vector<std::map<std::string, std::string>> transportParams = {},
65 std::vector<std::map<std::string, std::string>> operatorParams = {});
66
67 Adios2StMan(std::string configFile, from_config_t);
68
69 virtual ~Adios2StMan();
70
71 virtual DataManager *clone() const;
72 virtual String dataManagerType() const;
73 void setDataManagerName(const String &aName);
74 virtual String dataManagerName() const;
75 virtual void create64(rownr_t aNrRows);
76 virtual rownr_t open64(rownr_t aRowNr, AipsIO &ios);
77 virtual rownr_t resync64(rownr_t aRowNr);
78 virtual Bool flush(AipsIO &, Bool doFsync);
79 virtual DataManagerColumn *makeScalarColumn(const String &aName, int aDataType,
80 const String &aDataTypeID);
81 virtual DataManagerColumn *makeDirArrColumn(const String &aName, int aDataType,
82 const String &aDataTypeID);
83 virtual DataManagerColumn *makeIndArrColumn(const String &aName, int aDataType,
84 const String &aDataTypeID);
85 virtual void deleteManager();
86 virtual void addRow64(rownr_t aNrRows);
87 static DataManager *makeObject(const String &aDataManType, const Record &spec);
90
91 private:
92 class impl;
93 std::unique_ptr<impl> pimpl;
94
95#ifdef HAVE_MPI
96 Adios2StMan(MPI_Comm mpiComm, std::string engineType,
97 std::map<std::string, std::string> engineParams,
98 std::vector<std::map<std::string, std::string>> transportParams,
99 std::vector<std::map<std::string, std::string>> operatorParams,
100 std::string configFile);
101#endif // HAVE_MPI
102
103 Adios2StMan(std::string engineType, std::map<std::string, std::string> engineParams,
104 std::vector<std::map<std::string, std::string>> transportParams,
105 std::vector<std::map<std::string, std::string>> operatorParams,
106 std::string configFile);
107
108}; // end of class Adios2StMan
109
110extern "C" void register_adios2stman();
111} // namespace casacore
112
113#endif
virtual Bool flush(AipsIO &, Bool doFsync)
Flush and optionally fsync the data.
friend class Adios2StManColumn
Definition Adios2StMan.h:45
std::unique_ptr< impl > pimpl
Definition Adios2StMan.h:93
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, std::string configFile)
void setDataManagerName(const String &aName)
virtual void create64(rownr_t aNrRows)
Let the data manager initialize itself for a new table.
static DataManager * makeObject(const String &aDataManType, const Record &spec)
Adios2StMan(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)
virtual DataManager * clone() const
Make a clone of the derived object.
Adios2StMan(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={})
virtual DataManagerColumn * makeScalarColumn(const String &aName, int aDataType, const String &aDataTypeID)
Create a column in the data manager on behalf of a table column.
static constexpr from_config_t from_config
Definition Adios2StMan.h:52
Adios2StMan(std::string configFile, from_config_t)
virtual void addRow64(rownr_t aNrRows)
Add rows to all columns.
Adios2StMan(MPI_Comm mpiComm, std::string configFile, from_config_t)
virtual String dataManagerName() const
Return the name of the data manager.
virtual DataManagerColumn * makeDirArrColumn(const String &aName, int aDataType, const String &aDataTypeID)
Create a direct array column.
virtual DataManagerColumn * makeIndArrColumn(const String &aName, int aDataType, const String &aDataTypeID)
Create an indirect array column.
virtual String dataManagerType() const
Return the type name of the data manager (in fact its class name).
friend class Adios2StManColumnT
Definition Adios2StMan.h:47
virtual rownr_t open64(rownr_t aRowNr, AipsIO &ios)
Let the data manager initialize itself for an existing table.
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={})
Record dataManagerSpec() const
Return a record containing data manager specifications.
virtual void deleteManager()
The data manager will be deleted (because all its columns are requested to be deleted).
virtual rownr_t resync64(rownr_t aRowNr)
Resync the data by rereading cached data from the file.
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
bool Bool
Define the standard types used by Casacore.
Definition aipstype.h:40
void register_adios2stman()
uInt64 rownr_t
Define the type of a row number in a table.
Definition aipsxtype.h:44
tag for differentiating string-based constructors
Definition Adios2StMan.h:51