diff --git a/src/opt/hdf5-mpi/include/h5_rdataset.h b/src/opt/hdf5-mpi/include/h5_rdataset.h new file mode 100644 index 0000000..f07f621 --- /dev/null +++ b/src/opt/hdf5-mpi/include/h5_rdataset.h @@ -0,0 +1,56 @@ +// -*- C++ -*- +/** + + @file opt/hdf5-mpi/include/h5_rdataset.h + @brief RDataset declaration. + + Copyright (c) 2024 Christian Zimmermann. All rights reserved. + Mail: chizeta@f3l.de + + **/ + +#ifndef __cxz_h5_rdataset_h__ +#define __cxz_h5_rdataset_h__ + +namespace CNORXZ +{ + namespace hdf5 + { + /** **** + Class to handle hdf5 datasets on multiple ranks. + */ + template + class RDataset : public SDataset + { + public: + DEFAULT_MEMBERS(RDataset); /**< Default constructors and assignments. */ + + /** Construct the class. + @param name Dataset name. + @param _parent Parent content object. + */ + RDataset(const String& name, const ContentBase* _parent); + + /** Initalize the dataset. + @param data Array containing the dataset. + */ + template + RDataset& init(const mpi::RArray& data); + + /** Read the dataset. + @return Array containing the dataset values. + */ + mpi::RArray read() const; + + /** Read a given subset of the dataset. + The subset needs to be hypercubic. + @param beg Index indicating the global begin edge of the hypercube. + @param end Index indicating the global end edge of the hypercube (inclusive). + @return Array containing the dataset values. + */ + template + mpi::RArray read(const IndexInterface& beg, const IndexInterface& end) const; + + }; + +#endif diff --git a/src/opt/hdf5/include/h5_dataset.cc.h b/src/opt/hdf5/include/h5_dataset.cc.h index 5ce17ea..0991597 100644 --- a/src/opt/hdf5/include/h5_dataset.cc.h +++ b/src/opt/hdf5/include/h5_dataset.cc.h @@ -22,7 +22,7 @@ namespace CNORXZ Dataset& Dataset::init(const ArrayBase& data) { const hid_t tid = getTypeId(*data.data()); - VCHECK(tid); + //VCHECK(tid); init(data.range(), tid); if(data.begin().formatIsTrivial()){ Vector dims(mDataRange->dim());