summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorElena Pourmal <epourmal@hdfgroup.org>1998-02-11 20:40:12 (GMT)
committerElena Pourmal <epourmal@hdfgroup.org>1998-02-11 20:40:12 (GMT)
commit069b6098ea7a7e8c9b6ed562cacff2ef400d6d38 (patch)
treed0f61ab23ab03103c3db70dab098a64838b99514 /examples
parent140a4c128f154427b43d235ac2dd9d4814262eea (diff)
downloadhdf5-069b6098ea7a7e8c9b6ed562cacff2ef400d6d38.zip
hdf5-069b6098ea7a7e8c9b6ed562cacff2ef400d6d38.tar.gz
hdf5-069b6098ea7a7e8c9b6ed562cacff2ef400d6d38.tar.bz2
[svn-r252] Call to H5Cget_layout has been added to check if the dataset is chunked.
Diffstat (limited to 'examples')
-rw-r--r--examples/h5_chunk_read.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/examples/h5_chunk_read.c b/examples/h5_chunk_read.c
index 362af6b..be2a0be 100644
--- a/examples/h5_chunk_read.c
+++ b/examples/h5_chunk_read.c
@@ -55,13 +55,18 @@ printf("dataset rank %d, dimensions %d x %d \n", rank, dims[0], dims[1]);
*/
cparms = H5Dget_create_parms(dataset); /* Get properties handle first. */
+/*
+ * Check if dataset is chunked.
+ */
+ if (H5D_CHUNKED == H5Cget_layout(cparms)) {
+
/*
* Get chunking information: rank and dimensions
*/
rank_chunk = H5Cget_chunk(cparms, 2, chunk_dims);
printf("chunk rank %d, dimensions %d x %d \n", rank_chunk,
chunk_dims[0], chunk_dims[1]);
-
+}
/*
* Define the memory space to read dataset.
@@ -131,6 +136,7 @@ for (j = 0; j < chunk_dims[0]; j++) {
/*
* Close/release resources.
*/
+H5Cclose(cparms);
H5Dclose(dataset);
H5Pclose(filespace);
H5Pclose(memspace);