summaryrefslogtreecommitdiffstats
path: root/tools/h5dump
diff options
context:
space:
mode:
Diffstat (limited to 'tools/h5dump')
-rw-r--r--tools/h5dump/h5dump.c34
-rw-r--r--tools/h5dump/testh5dump.sh.in10
2 files changed, 39 insertions, 5 deletions
diff --git a/tools/h5dump/h5dump.c b/tools/h5dump/h5dump.c
index 3bcb40a..70d889f 100644
--- a/tools/h5dump/h5dump.c
+++ b/tools/h5dump/h5dump.c
@@ -3181,6 +3181,8 @@ parse_subset_params(char *dset)
* Tuesday, 9. January 2001
*
* Modifications:
+ * Pedro Vicente, Tuesday, January 15, 2008
+ * check for block overlap
*
*-------------------------------------------------------------------------
*/
@@ -3253,6 +3255,38 @@ handle_datasets(hid_t fid, char *dset, void *data)
}
}
+
+ /*-------------------------------------------------------------------------
+ * check for block overlap
+ *-------------------------------------------------------------------------
+ */
+
+ if(sset)
+ {
+ hid_t sid = H5Dget_space(dsetid);
+ unsigned int ndims = H5Sget_simple_extent_ndims(sid);
+ unsigned int i;
+
+ for ( i = 0; i < ndims; i++)
+ {
+ if ( sset->count[i] > 1 )
+ {
+
+ if ( sset->stride[i] < sset->block[i] )
+ {
+ error_msg(progname, "wrong subset selection; blocks overlap\n");
+ d_status = EXIT_FAILURE;
+ return;
+
+ }
+
+ }
+
+ }
+ H5Sclose(sid);
+
+ }
+
H5Oget_info(dsetid, &oinfo);
if(oinfo.rc > 1) {
obj_t *found_obj; /* Found object */
diff --git a/tools/h5dump/testh5dump.sh.in b/tools/h5dump/testh5dump.sh.in
index c0055d6..b7b8429 100644
--- a/tools/h5dump/testh5dump.sh.in
+++ b/tools/h5dump/testh5dump.sh.in
@@ -374,17 +374,17 @@ TOOLTEST tindicesyes.ddl taindices.h5
TOOLTEST tindicesno.ddl -y taindices.h5
########## array indices with subsetting
-# 1D case, start at 1, 2 counts of size 3 blocks, separated by stride 10 elements
-TOOLTEST tindicessub1.ddl -d 1d -s 1 -c 2 -k 3 -S 10 taindices.h5
+# 1D case
+TOOLTEST tindicessub1.ddl -d 1d -s 1 -S 10 -c 2 -k 3 taindices.h5
# 2D case
-TOOLTEST tindicessub2.ddl -d 2d -s 1,2 -c 2,3 -k 1,1 -S 2,1 taindices.h5
+TOOLTEST tindicessub2.ddl -d 2d -s 1,2 -S 3,3 -c 3,2 -k 2,2 taindices.h5
# 3D case
-TOOLTEST tindicessub3.ddl -d 3d -s 0,1,2 -c 1,2,3 -k 1,1,1 -S 1,2,1 taindices.h5
+TOOLTEST tindicessub3.ddl -d 3d -s 0,1,2 -S 1,3,3 -c 2,2,2 -k 1,2,2 taindices.h5
# 4D case
-TOOLTEST tindicessub4.ddl -d 4d -s 0,0,1,3 -c 2,2,6,4 taindices.h5
+TOOLTEST tindicessub4.ddl -d 4d -s 0,0,1,2 -c 2,2,3,2 -S 1,1,3,3 -k 1,1,2,2 taindices.h5
# tests for filters