Skip to content
Snippets Groups Projects
Commit ae75140e authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

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

parent 769c0ddd
No related branches found
No related tags found
2 merge requests!136Master,!110Make sure the HDF5 dataset chunks are smaller than the dataset itself.
......@@ -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) chunk_shape[0] = N;
/* 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) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment