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  impl(Adios2StMan &parent, MPI_Comm mpiComm = MPI_COMM_WORLD);
45  impl(Adios2StMan &parent, MPI_Comm mpiComm, std::string engineType,
46  std::map<std::string, std::string> engineParams,
47  std::vector<std::map<std::string, std::string>> transportParams,
48  size_t readerCacheRows);
49 
50  ~impl();
51 
52  DataManager *clone() const;
53  String dataManagerType() const;
54  String dataManagerName() const;
55  void create(uInt aNrRows);
56  void open(uInt aRowNr, AipsIO &ios);
57  void resync(uInt aRowNr);
58  Bool flush(AipsIO &ios, Bool doFsync);
59  DataManagerColumn *makeColumnCommon(const String &aName, int aDataType,
60  const String &aDataTypeID);
62  int aDataType,
63  const String &aDataTypeID);
65  int aDataType,
66  const String &aDataTypeID);
68  int aDataType,
69  const String &aDataTypeID);
70  void deleteManager();
71  void addRow(uInt aNrRows);
72  static DataManager *makeObject(const String &aDataManType,
73  const Record &spec);
74  uInt getNrRows();
75 
76 private:
78  String itsDataManName = "Adios2StMan";
82 
83  std::shared_ptr<adios2::ADIOS> itsAdios;
84  std::shared_ptr<adios2::IO> itsAdiosIO;
85  std::shared_ptr<adios2::Engine> itsAdiosEngine;
86 
88  size_t itsReadCacheMaxRows = 1024;
89 
90  static std::string itsAdiosEngineType;
91  static adios2::Params itsAdiosEngineParams;
92  static std::vector<adios2::Params> itsAdiosTransportParamsVec;
93 
94  static MPI_Comm itsMpiComm;
95 
96  uInt ncolumn() const { return parent.ncolumn(); }
97  String fileName() const { return parent.fileName(); }
98 };
99 
100 } // namespace casacore
101 
102 #endif // ADIOS2STMANIMPL_H
std::shared_ptr< adios2::IO > itsAdiosIO
impl(Adios2StMan &parent, MPI_Comm mpiComm=MPI_COMM_WORLD)
std::shared_ptr< adios2::ADIOS > itsAdios
String dataManagerName() const
AipsIO is the object persistency mechanism of Casacore.
Definition: AipsIO.h:168
Abstract base class for a column in a data manager.
Definition: DataManager.h:611
void addRow(uInt aNrRows)
DataManager * clone() const
DataManagerColumn * makeDirArrColumn(const String &aName, int aDataType, const String &aDataTypeID)
uInt ncolumn() const
Get the nr of columns in this data manager (can be zero).
Definition: DataManager.h:289
DataManagerColumn * makeIndArrColumn(const String &aName, int aDataType, const String &aDataTypeID)
void resync(uInt aRowNr)
DataManagerColumn * makeScalarColumn(const String &aName, int aDataType, const String &aDataTypeID)
void create(uInt aNrRows)
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
std::shared_ptr< adios2::Engine > itsAdiosEngine
void open(uInt aRowNr, AipsIO &ios)
A drop-in replacement for Block<T*>.
Definition: Block.h:814
Abstract base class for a data manager.
Definition: DataManager.h:224
String fileName() const
Compose a unique filename from the table name and sequence number.
String: the storage and methods of handling collections of characters.
Definition: String.h:223
String dataManagerType() const
static adios2::Params itsAdiosEngineParams
static DataManager * makeObject(const String &aDataManType, const Record &spec)
DataManagerColumn * makeColumnCommon(const String &aName, int aDataType, const String &aDataTypeID)
static std::string itsAdiosEngineType
static std::vector< adios2::Params > itsAdiosTransportParamsVec
this file contains all the compiler specific defines
Definition: mainpage.dox:28
unsigned int uInt
Definition: aipstype.h:51
PtrBlock< Adios2StManColumn * > itsColumnPtrBlk