103 void write(
void* buffer,
const std::size_t& startIdx,
104 const std::size_t& endIdx) {
107 std::stringstream message;
108 message <<
"Checkpoint table uninitialized." << std::endl;
109 throw std::runtime_error(message.str());
112 hsize_t s = (hsize_t)(startIdx);
113 hsize_t
e = (hsize_t)(endIdx);
116 hsize_t fStart[2] = {s, 0};
117 hsize_t fCount[2] = {l, 1};
119 hsize_t mStart[2] = {s, 0};
120 hsize_t mCount[2] = {l, 1};
122 hsize_t mDim[2] = {l, 1};
124 H5::DataSpace mspace(2, mDim);
126 dp_.selectHyperslab(H5S_SELECT_SET, fCount, fStart);
127 mspace.selectHyperslab(H5S_SELECT_SET, mCount, mStart);
130 }
catch (H5::Exception&) {
131 std::stringstream message;
132 message <<
"Could not write " <<
name_ <<
" from " <<
loc_.getFileName();
133 throw std::runtime_error(message.str());
146 void read(
void* buffer,
const std::size_t& startIdx,
147 const std::size_t& endIdx) {
150 std::stringstream message;
151 message <<
"Checkpoint table uninitialized." << std::endl;
152 throw std::runtime_error(message.str());
155 hsize_t s = (hsize_t)(startIdx);
156 hsize_t
e = (hsize_t)(endIdx);
159 hsize_t fStart[2] = {s, 0};
160 hsize_t fCount[2] = {l, 1};
162 hsize_t mStart[2] = {s, 0};
163 hsize_t mCount[2] = {l, 1};
165 hsize_t mDim[2] = {l, 1};
167 H5::DataSpace mspace(2, mDim);
169 dp_.selectHyperslab(H5S_SELECT_SET, fCount, fStart);
170 mspace.selectHyperslab(H5S_SELECT_SET, mCount, mStart);
173 }
catch (H5::Exception&) {
174 std::stringstream message;
175 message <<
"Could not read " <<
name_ <<
" from " <<
loc_.getFileName();
176 throw std::runtime_error(message.str());