Commit 5fc79cac authored by Peter W. Draper's avatar Peter W. Draper
Browse files

Merge branch 'io_chunck_bug' into 'master'

Make sure the HDF5 dataset chunks are smaller than the dataset itself.

That solves issue #116. Thanks !

No need to do anything for the parallel-HDF5 version as there is no chunking there.

See merge request !110
parents 2203631a 7db676d5
......@@ -201,6 +201,9 @@ void prepareArray(hid_t grp, char* fileName, FILE* xmfFile, char* name,
chunk_shape[1] = 0;
}
/* Make sure the chunks are not larger than the dataset */
if (chunk_shape[0] > N_total) chunk_shape[0] = N_total;
/* Change shape of data space */
h_err = H5Sset_extent_simple(h_space, rank, shape, NULL);
if (h_err < 0) {
......
......@@ -199,6 +199,9 @@ void writeArrayBackEnd(hid_t grp, char* fileName, FILE* xmfFile, char* name,
chunk_shape[1] = 0;
}
/* Make sure the chunks are not larger than the dataset */
if (chunk_shape[0] > N) chunk_shape[0] = N;
/* Change shape of data space */
h_err = H5Sset_extent_simple(h_space, rank, shape, NULL);
if (h_err < 0) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment