diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2008-06-16 22:17:29 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2008-06-16 22:17:29 (GMT) |
commit | db2c4c497abab139485dbf6797e56b1340e4577d (patch) | |
tree | f7dfb321a3643658ed24aaf776ec4c1e48bc76a3 /tools/h5dump | |
parent | 55af47c47c3c0c7bc17266968f5e0e782189e819 (diff) | |
download | hdf5-db2c4c497abab139485dbf6797e56b1340e4577d.zip hdf5-db2c4c497abab139485dbf6797e56b1340e4577d.tar.gz hdf5-db2c4c497abab139485dbf6797e56b1340e4577d.tar.bz2 |
[svn-r15221] Description:
Bring changes from trunk from the time the branch was created (r14280)
up to the 1.8.0 release (r14525) back into the metadata journaling branch.
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode
Diffstat (limited to 'tools/h5dump')
-rw-r--r-- | tools/h5dump/Makefile.in | 1 | ||||
-rw-r--r-- | tools/h5dump/h5dump.c | 54 | ||||
-rw-r--r-- | tools/h5dump/h5dumpgentest.c | 2 | ||||
-rw-r--r-- | tools/h5dump/testh5dump.sh.in | 17 |
4 files changed, 57 insertions, 17 deletions
diff --git a/tools/h5dump/Makefile.in b/tools/h5dump/Makefile.in index 4bb4ad9..03f729b 100644 --- a/tools/h5dump/Makefile.in +++ b/tools/h5dump/Makefile.in @@ -215,6 +215,7 @@ SET_MAKE = @SET_MAKE@ SHELL = /bin/sh SIZE_T = @SIZE_T@ STATIC_SHARED = @STATIC_SHARED@ +STRICT_FORMAT_CHECKS = @STRICT_FORMAT_CHECKS@ STRIP = @STRIP@ TESTPARALLEL = @TESTPARALLEL@ TIME = @TIME@ diff --git a/tools/h5dump/h5dump.c b/tools/h5dump/h5dump.c index c69c5d70..70d889f 100644 --- a/tools/h5dump/h5dump.c +++ b/tools/h5dump/h5dump.c @@ -610,7 +610,7 @@ usage(const char *prog) fprintf(stdout, " OPTIONS\n"); fprintf(stdout, " -h, --help Print a usage message and exit\n"); fprintf(stdout, " -n, --contents Print a list of the file contents and exit\n"); - fprintf(stdout, " -B, --bootblock Print the content of the boot block\n"); + fprintf(stdout, " -B, --superblock Print the content of the super block\n"); fprintf(stdout, " -H, --header Print the header only; no data is displayed\n"); fprintf(stdout, " -A, --onlyattr Print the header and value of attributes\n"); fprintf(stdout, " -i, --object-ids Print the object ids\n"); @@ -620,7 +620,7 @@ usage(const char *prog) fprintf(stdout, " -a P, --attribute=P Print the specified attribute\n"); fprintf(stdout, " -d P, --dataset=P Print the specified dataset\n"); fprintf(stdout, " -y, --noindex Do not print array indices with the data\n"); - fprintf(stdout, " -p, --properties Print dataset filters, storage layout and fill value\n"); + fprintf(stdout, " -p, --properties Print dataset filters, storage layout and fill value\n"); fprintf(stdout, " -f D, --filedriver=D Specify which driver to open the file with\n"); fprintf(stdout, " -g P, --group=P Print the specified group and all members\n"); fprintf(stdout, " -l P, --soft-link=P Print the value(s) of the specified soft link\n"); @@ -2756,7 +2756,7 @@ static void dump_fcpl(hid_t fid) { hid_t fcpl; /* file creation property list ID */ - hid_t fapl; /* file access property list ID */ + hid_t fapl; /* file access property list ID */ hsize_t userblock; /* userblock size retrieved from FCPL */ size_t off_size; /* size of offsets in the file */ size_t len_size; /* size of lengths in the file */ @@ -2764,7 +2764,7 @@ dump_fcpl(hid_t fid) unsigned freelist; /* free list version # */ unsigned stab; /* symbol table entry version # */ unsigned shhdr; /* shared object header version # */ - hid_t fdriver; /* file driver */ + hid_t fdriver; /* file driver */ char dname[32]; /* buffer to store driver name */ unsigned sym_lk; /* symbol table B-tree leaf 'K' value */ unsigned sym_ik; /* symbol table B-tree internal 'K' value */ @@ -2781,7 +2781,7 @@ dump_fcpl(hid_t fid) fdriver=H5Pget_driver(fapl); H5Pclose(fapl); - /*------------------------------------------------------------------------- + /*------------------------------------------------------------------------- * SUPER_BLOCK *------------------------------------------------------------------------- */ @@ -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 */ @@ -3952,7 +3986,7 @@ main(int argc, const char *argv[]) /* allocate and initialize internal data structure */ init_prefix(&prefix, prefix_len); - /* find all objects that might be targets of a reference */ + /* Prepare to find objects that might be targets of a reference */ fill_ref_path_table(fid); if(doxml) { @@ -4094,7 +4128,6 @@ done: free_table(type_table); HDfree(prefix); - HDfree(info.prefix); HDfree(fname); /* To Do: clean up XML table */ @@ -5342,8 +5375,7 @@ xml_dump_group(hid_t gid, const char *name) if(HDstrcmp(name, "/") == 0) { isRoot = 1; - tmp = HDmalloc(2); - HDstrcpy(tmp, "/"); + tmp = HDstrdup("/"); } else { tmp = HDmalloc(HDstrlen(prefix) + HDstrlen(name) + 2); HDstrcpy(tmp, prefix); @@ -5401,8 +5433,8 @@ xml_dump_group(hid_t gid, const char *name) ptrstr = malloc(100); t_objname = xml_escape_the_name(found_obj->objname); par_name = xml_escape_the_name(par); - xml_name_to_XID(par,parentxid,100,1); - xml_name_to_XID(found_obj->objname,ptrstr,100,1); + xml_name_to_XID(found_obj->objname, ptrstr, 100, 1); + xml_name_to_XID(par, parentxid, 100, 1); printf("<%sGroupPtr OBJ-XID=\"%s\" H5Path=\"%s\" " "Parents=\"%s\" H5ParentPaths=\"%s\" />\n", xmlnsprefix, diff --git a/tools/h5dump/h5dumpgentest.c b/tools/h5dump/h5dumpgentest.c index 516a740..b21a020 100644 --- a/tools/h5dump/h5dumpgentest.c +++ b/tools/h5dump/h5dumpgentest.c @@ -1812,7 +1812,7 @@ static void gent_datareg(void) coord1[7][0]=9; coord1[7][1]=0; coord1[8][0]=7; coord1[8][1]=1; coord1[9][0]=3; coord1[9][1]=3; - H5Sselect_elements(sid2,H5S_SELECT_SET,POINT1_NPOINTS,(const hsize_t **)coord1); + H5Sselect_elements(sid2,H5S_SELECT_SET,POINT1_NPOINTS,coord1); H5Sget_select_npoints(sid2); diff --git a/tools/h5dump/testh5dump.sh.in b/tools/h5dump/testh5dump.sh.in index 3fc39f2..b7b8429 100644 --- a/tools/h5dump/testh5dump.sh.in +++ b/tools/h5dump/testh5dump.sh.in @@ -373,11 +373,18 @@ TOOLTEST tstring2.ddl -r -d str4 tstr3.h5 TOOLTEST tindicesyes.ddl taindices.h5 TOOLTEST tindicesno.ddl -y taindices.h5 -# array indices with subsetting -TOOLTEST tindicessub1.ddl -d 1d -s 3 -c 40 taindices.h5 -TOOLTEST tindicessub2.ddl -d 2d -s 1,3 -c 6,4 taindices.h5 -TOOLTEST tindicessub3.ddl -d 3d -s 0,1,3 -c 2,6,4 taindices.h5 -TOOLTEST tindicessub4.ddl -d 4d -s 0,0,1,3 -c 2,2,6,4 taindices.h5 +########## array indices with subsetting +# 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 -S 3,3 -c 3,2 -k 2,2 taindices.h5 + +# 3D case +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,2 -c 2,2,3,2 -S 1,1,3,3 -k 1,1,2,2 taindices.h5 # tests for filters |