WARPXM v1.10.0
Loading...
Searching...
No Matches
wxhdf5io.h
Go to the documentation of this file.
1#ifndef wxhdf5io_h
2#define wxhdf5io_h
3
4// WarpX lib includes
5#include "wxiobase.h"
6
7#ifndef _DONT_USE_MPI_
8#include <mpi.h>
9#else
11#define MPI_Comm void*
13#define MPI_Info void*
14#endif
15
23class WxHdf5Io : public WxIoBase
24{
25
26public:
33 WxHdf5Io(MPI_Comm mc, MPI_Info mi);
34
43 WxHdf5Io(const std::string& bn, int d, MPI_Comm mc, MPI_Info mi);
44
48 virtual ~WxHdf5Io();
49
58 virtual WxIoNodeType createFile(const std::string& fileName);
59
68 virtual WxIoNodeType openFile(const std::string& fileName, const std::string& perms);
69
79 const std::string& dataName) const;
80
89 virtual WxIoNodeType openGroup(WxIoNodeType node, const std::string& dataName) const;
90
98 virtual std::list<std::string> getGroupNames(WxIoNodeType parentNode) const;
99
110 const std::string& name,
111 const WxRange& range,
112 const std::type_info& typeinfo) const;
113
123 const std::string& dataName) const;
124
134 const std::string& dataName) const;
135
139 virtual void closeFile(WxIoNodeType fileNode);
140
146 virtual void closeNode(WxIoNodeType node) const;
147
158 const std::string& attribName,
159 const std::string& attrib) const;
160
170 const std::string& attribName,
171 const std::vector<std::string>& stringsvector) const;
172
182 const std::string& attribName,
183 std::string& attrib) const;
184
193 std::vector<std::string> readStrVecAttribute(WxIoNodeType node,
194 const std::string& attribName) const;
195
196protected:
197private:
199 WxHdf5Io();
201 WxHdf5Io(const WxHdf5Io&);
202
204 WxHdf5Io& operator=(const WxHdf5Io&);
205
209 void setup(MPI_Comm mc, MPI_Info mi);
210
212 MPI_Comm mpiComm;
213
215 MPI_Info mpiInfo;
216};
217
219#endif // wxhdf5io_h
WxHdf5Io is the interface for the HDF5 implementation of HDF5.
Definition: wxhdf5io.h:24
virtual WxIoNodeType openDataSet(WxIoNodeType node, const std::string &dataName) const
Open a node.
void writeStrVecAttribute(WxIoNodeType node, const std::string &attribName, const std::vector< std::string > &stringsvector) const
Write a vector of strings as attribute.
virtual WxIoNodeType createFile(const std::string &fileName)
Create a file.
virtual void closeFile(WxIoNodeType fileNode)
Get the top node = file node.
virtual WxIoNodeType createDataSet(WxIoNodeType node, const std::string &dataName) const
Create an empty node.
virtual ~WxHdf5Io()
Virtual destructor.
virtual WxIoNodeType createGroup(WxIoNodeType node, const std::string &dataName) const
Create an empty group.
void readStrAttribute(WxIoNodeType node, const std::string &attribName, std::string &attrib) const
Read a string attribute.
virtual WxIoNodeType createDataSet(WxIoNodeType node, const std::string &name, const WxRange &range, const std::type_info &typeinfo) const
Collective dataset allocation.
virtual WxIoNodeType openFile(const std::string &fileName, const std::string &perms)
Open a file.
WxHdf5Io(const std::string &bn, int d, MPI_Comm mc, MPI_Info mi)
Constructor creates the individual templated writers.
virtual void closeNode(WxIoNodeType node) const
Close a data set.
void writeStrAttribute(WxIoNodeType node, const std::string &attribName, const std::string &attrib) const
Write a string attribute.
virtual std::list< std::string > getGroupNames(WxIoNodeType parentNode) const
Get list of group names under the supplied node.
WxHdf5Io(MPI_Comm mc, MPI_Info mi)
Constructor creates the individual templated writers.
virtual WxIoNodeType openGroup(WxIoNodeType node, const std::string &dataName) const
Open a group.
std::vector< std::string > readStrVecAttribute(WxIoNodeType node, const std::string &attribName) const
Read a vector of strings attribute.
Provides an abstract interface for access to hierachical datasets.
Definition: wxiobase.h:25
WxRange represents a hyper-rectangular domain of an n-dimensional space of integers.
Definition: wxrange.h:23
Provides a means for derived messengers to return implimentation specific message status flags and da...
Definition: wxiotmpl.h:23