From 069b6098ea7a7e8c9b6ed562cacff2ef400d6d38 Mon Sep 17 00:00:00 2001 From: Elena Pourmal Date: Wed, 11 Feb 1998 15:40:12 -0500 Subject: [svn-r252] Call to H5Cget_layout has been added to check if the dataset is chunked. --- examples/h5_chunk_read.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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); -- cgit v0.12