From e002ec033acc2ce13241ff09f5572b6990c1c126 Mon Sep 17 00:00:00 2001 From: Daniel Garcia-Sanchez Date: Mon, 8 Oct 2018 11:27:07 +0200 Subject: [PATCH] Separate functions by three empty lines --- source/base/hdf5.cc | 99 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 99 insertions(+) diff --git a/source/base/hdf5.cc b/source/base/hdf5.cc index e6a86c0c55..3df8b0e8d3 100644 --- a/source/base/hdf5.cc +++ b/source/base/hdf5.cc @@ -102,6 +102,8 @@ namespace HDF5 return t_type; } + + // Several HDF5 functions such as H5Screate_simple() require a // one-dimensional array that specifies the size of each dimension of the // container, see: @@ -124,6 +126,8 @@ namespace HDF5 return std::vector{data.size()}; } + + template typename std::enable_if< std::is_same>::value, @@ -133,6 +137,8 @@ namespace HDF5 return std::vector{data.size()}; } + + template typename std::enable_if< std::is_same(data.size()); } + + template typename std::enable_if< std::is_same>::value, @@ -167,6 +176,8 @@ namespace HDF5 return static_cast(data.size()); } + + template typename std::enable_if< std::is_same(data.m() * data.n()); } + + // This function returns the pointer to the raw data of a container template typename std::enable_if< @@ -190,6 +203,8 @@ namespace HDF5 return data.data(); } + + template typename std::enable_if< std::is_same>::value, @@ -202,6 +217,8 @@ namespace HDF5 return &data[0]; } + + template typename std::enable_if< std::is_same typename std::enable_if< std::is_same>::value, @@ -243,6 +264,7 @@ namespace HDF5 } + template typename std::enable_if< std::is_same())); } + + template typename std::enable_if< std::is_same>::value, @@ -293,6 +319,8 @@ namespace HDF5 dimensions.begin(), dimensions.end(), 1, std::multiplies())); } + + template typename std::enable_if< std::is_same T HDF5Object::attr(const std::string &attr_name) @@ -388,6 +421,8 @@ namespace HDF5 return value; } + + template <> bool HDF5Object::attr(const std::string &attr_name) @@ -406,6 +441,8 @@ namespace HDF5 return bool_value; } + + template <> std::string HDF5Object::attr(const std::string &attr_name) @@ -452,6 +489,8 @@ namespace HDF5 return string_value; } + + template void HDF5Object::write_attr(const std::string &attr_name, const T value) @@ -486,6 +525,8 @@ namespace HDF5 Assert(ret >= 0, ExcMessage("Error at H5Aclose")); } + + template <> void HDF5Object::write_attr(const std::string &attr_name, const std::string value) @@ -540,6 +581,8 @@ namespace HDF5 Assert(ret >= 0, ExcMessage("Error at H5Aclose")); } + + DataSet::DataSet(const std::string &name, const hid_t & parent_group_id, const bool mpi) @@ -586,6 +629,8 @@ namespace HDF5 } } + + DataSet::DataSet(const std::string & name, const hid_t & parent_group_id, const std::vector &dimensions, @@ -629,6 +674,8 @@ namespace HDF5 } } + + template Container DataSet::read() @@ -677,6 +724,8 @@ namespace HDF5 return data; } + + template std::vector DataSet::read_selection(const std::vector &coordinates) @@ -744,6 +793,8 @@ namespace HDF5 return data; } + + template Container DataSet::read_hyperslab(const std::vector &offset, @@ -809,6 +860,8 @@ namespace HDF5 return data; } + + template void DataSet::read_none() @@ -863,6 +916,8 @@ namespace HDF5 Assert(ret >= 0, ExcMessage("Error at H5SClose")); } + + template void DataSet::write(const Container &data) @@ -908,6 +963,8 @@ namespace HDF5 } } + + template void DataSet::write_selection(const std::vector & data, @@ -968,6 +1025,8 @@ namespace HDF5 Assert(ret >= 0, ExcMessage("Error at H5SClose")); } + + template void DataSet::write_hyperslab(const Container & data, @@ -1033,6 +1092,8 @@ namespace HDF5 Assert(ret >= 0, ExcMessage("Error at H5Sclose")); } + + template void DataSet::write_hyperslab(const Container & data, @@ -1097,6 +1158,8 @@ namespace HDF5 Assert(ret >= 0, ExcMessage("Error at H5Sclose")); } + + template void DataSet::write_none() @@ -1147,6 +1210,8 @@ namespace HDF5 Assert(ret >= 0, ExcMessage("Error at H5Sclose")); } + + template <> H5D_mpio_actual_io_mode_t DataSet::io_mode() @@ -1193,6 +1258,8 @@ namespace HDF5 return std::string("Internal error"); } + + template <> uint32_t DataSet::local_no_collective_cause() @@ -1217,6 +1284,8 @@ namespace HDF5 return internal::no_collective_cause_to_string(_local_no_collective_cause); } + + template <> uint32_t DataSet::global_no_collective_cause() @@ -1241,36 +1310,48 @@ namespace HDF5 return internal::no_collective_cause_to_string(_global_no_collective_cause); } + + bool DataSet::query_io_mode() const { return _query_io_mode; } + + void DataSet::query_io_mode(bool query_io_mode) { _query_io_mode = query_io_mode; } + + std::vector DataSet::dimensions() const { return _dimensions; } + + unsigned int DataSet::size() const { return _size; } + + unsigned int DataSet::rank() const { return _rank; } + + Group::Group(const std::string &name, const Group & parentGroup, const bool mpi, @@ -1303,28 +1384,38 @@ namespace HDF5 } } + + Group::Group(const std::string &name, const bool mpi) : HDF5Object(name, mpi) {} + + Group Group::group(const std::string &name) { return Group(name, *this, mpi, Mode::open); } + + Group Group::create_group(const std::string &name) { return Group(name, *this, mpi, Mode::create); } + + DataSet Group::dataset(const std::string &name) { return DataSet(name, *hdf5_reference, mpi); } + + template DataSet Group::create_dataset(const std::string & name, @@ -1334,6 +1425,8 @@ namespace HDF5 return DataSet(name, *hdf5_reference, dimensions, t_type, mpi); } + + template void Group::write_dataset(const std::string &name, const Container &data) const @@ -1401,16 +1494,22 @@ namespace HDF5 } } + + File::File(const std::string &name, const MPI_Comm mpi_communicator, const Mode mode) : File(name, true, mpi_communicator, mode) {} + + File::File(const std::string &name, const Mode mode) : File(name, false, MPI_COMM_NULL, mode) {} + + # ifndef DOXYGEN // instantiations of functions -- 2.39.5