From 7ff9aa3538d0ec7d1492ff79befe5f21afbf2b61 Mon Sep 17 00:00:00 2001 From: Vailin Choi Date: Fri, 13 Jul 2007 16:17:44 -0500 Subject: [svn-r13979] purpose: New feature. Description: Added routines to report on the amount of storage for: 1) 1.6 btree and heap storage info for groups 2) 1.8 btree, fractal heap storage info for groups, attributes and SOHM table 3) btree storage for chunked datasets 4) 1.8 superblock extension size. Platform tested: h5committested. --- MANIFEST | 7 ++- tools/misc/h5stat_gentest.c | 84 ++++++++++++++++++++++++++++++++ tools/misc/testfiles/h5stat_newgrat.ddl | 74 ++++++++++++++++++++++++++++ tools/misc/testfiles/h5stat_newgrat.h5 | Bin 0 -> 72236 bytes tools/misc/testfiles/h5stat_tsohm.ddl | 72 +++++++++++++++++++++++++++ tools/misc/testfiles/h5stat_tsohm.h5 | Bin 0 -> 3603 bytes 6 files changed, 236 insertions(+), 1 deletion(-) create mode 100644 tools/misc/h5stat_gentest.c create mode 100644 tools/misc/testfiles/h5stat_newgrat.ddl create mode 100644 tools/misc/testfiles/h5stat_newgrat.h5 create mode 100644 tools/misc/testfiles/h5stat_tsohm.ddl create mode 100644 tools/misc/testfiles/h5stat_tsohm.h5 diff --git a/MANIFEST b/MANIFEST index 859cd42..104fb32 100644 --- a/MANIFEST +++ b/MANIFEST @@ -989,6 +989,7 @@ ./tools/misc/h5repart.c ./tools/misc/h5repart_gentest.c ./tools/misc/h5stat.c +./tools/misc/h5stat_gentest.c ./tools/misc/repart_test.c ./tools/misc/testh5mkgrp.sh ./tools/misc/testh5repart.sh.in @@ -996,12 +997,16 @@ ./tools/misc/testfiles/h5stat_filters-d.ddl ./tools/misc/testfiles/h5stat_filters.ddl ./tools/misc/testfiles/h5stat_filters-dT.ddl -./tools/misc/testfiles/h5stat_filters-file.ddl ./tools/misc/testfiles/h5stat_filters-F.ddl +./tools/misc/testfiles/h5stat_filters-file.ddl ./tools/misc/testfiles/h5stat_filters-g.ddl ./tools/misc/testfiles/h5stat_filters.h5 ./tools/misc/testfiles/h5stat_help1.ddl ./tools/misc/testfiles/h5stat_help2.ddl +./tools/misc/testfiles/h5stat_newgrat.ddl +./tools/misc/testfiles/h5stat_newgrat.h5 +./tools/misc/testfiles/h5stat_tsohm.ddl +./tools/misc/testfiles/h5stat_tsohm.h5 # h5dump ./tools/testfiles/family_file00000.h5 diff --git a/tools/misc/h5stat_gentest.c b/tools/misc/h5stat_gentest.c new file mode 100644 index 0000000..f0219bd --- /dev/null +++ b/tools/misc/h5stat_gentest.c @@ -0,0 +1,84 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by The HDF Group. * + * Copyright by the Board of Trustees of the University of Illinois. * + * All rights reserved. * + * * + * This file is part of HDF5. The full HDF5 copyright notice, including * + * terms governing use, modification, and redistribution, is contained in * + * the files COPYING and Copyright.html. COPYING can be found at the root * + * of the source code distribution tree; Copyright.html can be found at the * + * root level of an installed copy of the electronic HDF5 document set and * + * is linked from the top-level documents page. It can also be found at * + * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * + * access to either file, you may request a copy from help@hdfgroup.org. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* + * Generate the binary hdf5 files for the h5stat tests. + * Usage: just execute the program without any arguments will + * generate all the binary hdf5 files in the ./testfiles directory. + * + * If you regenerate the test files (e.g., changing some code, + * trying it on a new platform, ...), you need to verify the correctness + * of the expected output and update the corresponding *.ddl files. + */ + +#include "hdf5.h" + +#define FILE "h5stat_newgrat.h5" +#define DATASET_NAME "DATASET_NAME" +#define GROUP_NAME "GROUP" +#define ATTR_NAME "ATTR" +#define NUM_GRPS 350 +#define NUM_ATTRS 100 + +/* + * Generate 1.8 HDF5 file + * with NUM_GRPS groups + * with NUM_ATTRS for the + */ +static void gen_file(void) +{ + int ret, i; + hid_t fapl, gid; + hid_t file, type_id, space_id, attr_id, dset_id; + char name[30]; + char attrname[30]; + + + fapl = H5Pcreate(H5P_FILE_ACCESS); + ret = H5Pset_latest_format(fapl,1); + + /* Create dataset */ + file=H5Fcreate(FILE, H5F_ACC_TRUNC, H5P_DEFAULT, fapl); + for (i=1; i<=NUM_GRPS; i++) { + sprintf(name, "%s%d", GROUP_NAME,i); + gid = H5Gcreate(file, name, (size_t)0); + H5Gclose(gid); + } + + + /* Create a datatype to commit and use */ + type_id=H5Tcopy(H5T_NATIVE_INT); + /* Create dataspace for dataset */ + space_id=H5Screate(H5S_SCALAR); + /* Create dataset */ + dset_id=H5Dcreate(file, DATASET_NAME,type_id,space_id,H5P_DEFAULT); + for (i=1; i<=NUM_ATTRS; i++) { + sprintf(attrname, "%s%d", ATTR_NAME,i); + attr_id=H5Acreate(dset_id,attrname, type_id,space_id,H5P_DEFAULT); + ret=H5Aclose(attr_id); + } + + ret=H5Dclose(dset_id); + ret=H5Sclose(space_id); + ret=H5Tclose(type_id); + ret=H5Fclose(file); +} + +int main(void) +{ + gen_file(); + + return 0; +} diff --git a/tools/misc/testfiles/h5stat_newgrat.ddl b/tools/misc/testfiles/h5stat_newgrat.ddl new file mode 100644 index 0000000..0cf8367 --- /dev/null +++ b/tools/misc/testfiles/h5stat_newgrat.ddl @@ -0,0 +1,74 @@ +############################# +Expected output for 'h5stat h5stat_newgrat.h5' +############################# +Filename: h5stat_newgrat.h5 +File information + # of unique groups: 351 + # of unique datasets: 1 + # of unique named dataypes: 0 + # of unique links: 0 + # of unique other: 0 + Max. # of links to object: 1 + Max. depth of hierarchy: 1 + Max. # of objects in group: 351 +Object header size: (total/unused) + Groups: 51597/32292 + Datasets: 414/312 +Storage information: + Groups: + B-tree/List: 5158 + Heap: 7643 + Attributes: + B-tree/List: 2598 + Heap: 4442 + Chunked datasets: + B-tree: 0 + Shared Messages: + Header: 0 + B-tree/List: 0 + Heap: 0 + Superblock extension: 0 +Small groups: + # of groups of size 0: 350 + Total # of small groups: 350 +Group bins: + # of groups of size 0: 350 + # of groups of size 100 - 999: 1 + Total # of groups: 351 +Dataset dimension information: + Max. rank of datasets: 0 + Dataset ranks: + # of dataset with rank 0: 1 +1-D Dataset information: + Max. dimension size of 1-D datasets: 0 + Small 1-D datasets: + Total small datasets: 0 +Dataset storage information: + Total raw data size: 0 +Dataset layout information: + Dataset layout counts[COMPACT]: 0 + Dataset layout counts[CONTIG]: 1 + Dataset layout counts[CHUNKED]: 0 + Number of external files : 0 +Dataset filters information: + Number of datasets with + NO filter: 1 + GZIP filter: 0 + SHUFFLE filter: 0 + FLETCHER32 filter: 0 + SZIP filter: 0 + NBIT filter: 0 + SCALEOFFSET filter: 0 + USER-DEFINED filter: 0 +Dataset datatype information: + # of unique datatypes used by datasets: 1 + Dataset datatype #0: + Count (total/named) = (1/0) + Size (desc./elmt) = (14/4) + Total dataset datatype count: 1 +Small # of attributes: + Total # of objects with small # of attributes: 0 +Attribute bins: + # of objects with 100 - 999 attributes: 1 + Total # of objects with attributes: 1 + Max. # of attributes to objects: 100 diff --git a/tools/misc/testfiles/h5stat_newgrat.h5 b/tools/misc/testfiles/h5stat_newgrat.h5 new file mode 100644 index 0000000..cab98bb Binary files /dev/null and b/tools/misc/testfiles/h5stat_newgrat.h5 differ diff --git a/tools/misc/testfiles/h5stat_tsohm.ddl b/tools/misc/testfiles/h5stat_tsohm.ddl new file mode 100644 index 0000000..cdca49a --- /dev/null +++ b/tools/misc/testfiles/h5stat_tsohm.ddl @@ -0,0 +1,72 @@ +############################# +Expected output for 'h5stat h5stat_tsohm.h5' +############################# +Filename: h5stat_tsohm.h5 +File information + # of unique groups: 1 + # of unique datasets: 2 + # of unique named dataypes: 0 + # of unique links: 0 + # of unique other: 0 + Max. # of links to object: 1 + Max. depth of hierarchy: 0 + Max. # of objects in group: 2 +Object header size: (total/unused) + Groups: 51/2 + Datasets: 568/358 +Storage information: + Groups: + B-tree/List: 872 + Heap: 120 + Attributes: + B-tree/List: 0 + Heap: 0 + Chunked datasets: + B-tree: 0 + Shared Messages: + Header: 38 + B-tree/List: 550 + Heap: 1316 + Superblock extension: 40 +Small groups: + # of groups of size 2: 1 + Total # of small groups: 1 +Group bins: + # of groups of size 1 - 9: 1 + Total # of groups: 1 +Dataset dimension information: + Max. rank of datasets: 2 + Dataset ranks: + # of dataset with rank 2: 2 +1-D Dataset information: + Max. dimension size of 1-D datasets: 0 + Small 1-D datasets: + Total small datasets: 0 +Dataset storage information: + Total raw data size: 0 +Dataset layout information: + Dataset layout counts[COMPACT]: 0 + Dataset layout counts[CONTIG]: 0 + Dataset layout counts[CHUNKED]: 2 + Number of external files : 0 +Dataset filters information: + Number of datasets with + NO filter: 2 + GZIP filter: 0 + SHUFFLE filter: 0 + FLETCHER32 filter: 0 + SZIP filter: 0 + NBIT filter: 0 + SCALEOFFSET filter: 0 + USER-DEFINED filter: 0 +Dataset datatype information: + # of unique datatypes used by datasets: 1 + Dataset datatype #0: + Count (total/named) = (2/0) + Size (desc./elmt) = (14/4) + Total dataset datatype count: 2 +Small # of attributes: + Total # of objects with small # of attributes: 0 +Attribute bins: + Total # of objects with attributes: 0 + Max. # of attributes to objects: 0 diff --git a/tools/misc/testfiles/h5stat_tsohm.h5 b/tools/misc/testfiles/h5stat_tsohm.h5 new file mode 100644 index 0000000..45ee36c Binary files /dev/null and b/tools/misc/testfiles/h5stat_tsohm.h5 differ -- cgit v0.12