summaryrefslogtreecommitdiffstats
path: root/tools/h5stat
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2009-09-24 22:14:50 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2009-09-24 22:14:50 (GMT)
commit426a3c1204fdcd1a999a966958a2edecc99b2d3b (patch)
treea786821d8e38f98f8977c30bf91c14b6d3267fd9 /tools/h5stat
parenta2a61197aa18fcafef35ecc4aaef268b2e4731d5 (diff)
downloadhdf5-426a3c1204fdcd1a999a966958a2edecc99b2d3b.zip
hdf5-426a3c1204fdcd1a999a966958a2edecc99b2d3b.tar.gz
hdf5-426a3c1204fdcd1a999a966958a2edecc99b2d3b.tar.bz2
[svn-r17522] Description:
Bring in the rest of Vailin's changes for testing fixed array chunk indices, across the range of range of all the tools and the appropriate dataset tests. Tested on: Mac OS X/32 10.5.8 (amazon) w/debug & production (h5committest not required for this branch)
Diffstat (limited to 'tools/h5stat')
-rw-r--r--tools/h5stat/h5stat.c6
-rw-r--r--tools/h5stat/h5stat_gentest.c86
-rw-r--r--tools/h5stat/testfiles/h5stat_filters-F.ddl2
-rw-r--r--tools/h5stat/testfiles/h5stat_filters.ddl2
-rw-r--r--tools/h5stat/testfiles/h5stat_idx.ddl75
-rw-r--r--tools/h5stat/testfiles/h5stat_idx.h5bin0 -> 2206 bytes
-rw-r--r--tools/h5stat/testfiles/h5stat_newgrat.ddl2
-rw-r--r--tools/h5stat/testfiles/h5stat_tsohm.ddl2
-rw-r--r--tools/h5stat/testh5stat.sh.in2
9 files changed, 169 insertions, 8 deletions
diff --git a/tools/h5stat/h5stat.c b/tools/h5stat/h5stat.c
index 78fb4f5..657cf32 100644
--- a/tools/h5stat/h5stat.c
+++ b/tools/h5stat/h5stat.c
@@ -88,7 +88,7 @@ typedef struct iter_t {
hsize_t SM_index_storage_size; /* index (btree & list) size for SOHM table (1.8) */
hsize_t SM_heap_storage_size; /* fractal heap size for SOHM table (1.8) */
hsize_t super_ext_size; /* superblock extension size */
- hsize_t datasets_btree_storage_size; /* btree size for chunked dataset */
+ hsize_t datasets_index_storage_size; /* meta size for chunked dataset's indexing type */
unsigned long nexternal; /* Number of external files for a dataset */
int local; /* Flag to indicate iteration over the object*/
} iter_t;
@@ -426,7 +426,7 @@ dataset_stats(iter_t *iter, const char *name, const H5O_info_t *oi)
assert(did > 0);
/* Update dataset metadata info */
- iter->datasets_btree_storage_size += oi->meta_size.obj.index_size;
+ iter->datasets_index_storage_size += oi->meta_size.obj.index_size;
/* Update attribute metadata info */
ret = attribute_stats(iter, oi);
@@ -860,7 +860,7 @@ print_file_metadata(const iter_t *iter)
HDfprintf(stdout, "\t\tHeap: %Hu\n", iter->attrs_heap_storage_size);
HDfprintf(stdout, "\tChunked datasets:\n");
- HDfprintf(stdout, "\t\tB-tree: %Hu\n", iter->datasets_btree_storage_size);
+ HDfprintf(stdout, "\t\tIndex: %Hu\n", iter->datasets_index_storage_size);
HDfprintf(stdout, "\tShared Messages:\n");
HDfprintf(stdout, "\t\tHeader: %Hu\n", iter->SM_hdr_storage_size);
diff --git a/tools/h5stat/h5stat_gentest.c b/tools/h5stat/h5stat_gentest.c
index 3f933f2..2a7f210 100644
--- a/tools/h5stat/h5stat_gentest.c
+++ b/tools/h5stat/h5stat_gentest.c
@@ -33,6 +33,11 @@
#define NUM_GRPS 35000
#define NUM_ATTRS 100
+/* Declarations for gen_idx_file() */
+#define FILE_IDX "h5stat_idx.h5"
+#define DSET "dset"
+#define DSET_FILTER "dset_filter"
+
/*
* Generate 1.8 HDF5 file
* with NUM_GRPS groups
@@ -81,12 +86,91 @@ static void gen_file(void)
assert(ret >= 0);
ret = H5Fclose(file);
assert(ret >= 0);
-}
+
+} /* gen_file() */
+
+/*
+ * Function: gen_idx_file
+ *
+ * Purpose: Create a file with datasets that use Fixed Array indexing:
+ * one dataset: fixed dimension, chunked layout, w/o filters
+ * one dataset: fixed dimension, chunked layout, w/ filters
+ *
+ */
+static void gen_idx_file(void)
+{
+ hid_t fapl; /* file access property id */
+ hid_t fid; /* file id */
+ hid_t sid; /* space id */
+ hid_t dcpl; /* dataset creation property id */
+ hid_t did, did2; /* dataset id */
+ hsize_t dims[1] = {10}; /* dataset dimension */
+ hsize_t c_dims[1] = {2}; /* chunk dimension */
+ herr_t status; /* return status */
+ int i; /* local index variable */
+ int buf[10]; /* data buffer */
+
+
+ /* Get a copy of the file aaccess property */
+ fapl = H5Pcreate(H5P_FILE_ACCESS);
+
+ /* Set the "use the latest format" bounds for creating objects in the file */
+ status = H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST);
+ assert(status >= 0);
+
+ /* Create dataset */
+ fid = H5Fcreate(FILE_IDX, H5F_ACC_TRUNC, H5P_DEFAULT, fapl);
+
+ /* Create data */
+ for(i = 0; i < 10; i++)
+ buf[i] = i;
+
+ /* Set chunk */
+ dcpl = H5Pcreate(H5P_DATASET_CREATE);
+ status = H5Pset_chunk(dcpl, 1, c_dims);
+ assert(status >= 0);
+
+ /* Create a 1D dataset */
+ sid = H5Screate_simple(1, dims, NULL);
+ did = H5Dcreate2(fid, DSET, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT);
+
+ /* Write to the dataset */
+ status = H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf);
+ assert(status >= 0);
+
+#if defined (H5_HAVE_FILTER_DEFLATE)
+ /* set deflate data */
+ status = H5Pset_deflate(dcpl, 9);
+ assert(status >= 0);
+
+ /* Create and write the dataset */
+ did2 = H5Dcreate2(fid, DSET_FILTER, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT);
+ status = H5Dwrite(did2, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf);
+ assert(status >= 0);
+
+ /* Close the dataset */
+ status = H5Dclose(did2);
+ assert(status >= 0);
+
+#endif
+
+ /* closing: dataspace, dataset, file */
+ status = H5Sclose(sid);
+ assert(status >= 0);
+ status = H5Dclose(did);
+ assert(status >= 0);
+ status = H5Fclose(fid);
+ assert(status >= 0);
+
+} /* gen_idx_file() */
int main(void)
{
gen_file();
+ /* Generate an HDF file to test for datasets with Fixed Array indexing */
+ gen_idx_file();
+
return 0;
}
diff --git a/tools/h5stat/testfiles/h5stat_filters-F.ddl b/tools/h5stat/testfiles/h5stat_filters-F.ddl
index 6bc6cc2..8f65c6d 100644
--- a/tools/h5stat/testfiles/h5stat_filters-F.ddl
+++ b/tools/h5stat/testfiles/h5stat_filters-F.ddl
@@ -14,7 +14,7 @@ Storage information:
B-tree/List: 0
Heap: 0
Chunked datasets:
- B-tree: 31392
+ Index: 31392
Shared Messages:
Header: 0
B-tree/List: 0
diff --git a/tools/h5stat/testfiles/h5stat_filters.ddl b/tools/h5stat/testfiles/h5stat_filters.ddl
index 8243a23..d070dba 100644
--- a/tools/h5stat/testfiles/h5stat_filters.ddl
+++ b/tools/h5stat/testfiles/h5stat_filters.ddl
@@ -22,7 +22,7 @@ Storage information:
B-tree/List: 0
Heap: 0
Chunked datasets:
- B-tree: 31392
+ Index: 31392
Shared Messages:
Header: 0
B-tree/List: 0
diff --git a/tools/h5stat/testfiles/h5stat_idx.ddl b/tools/h5stat/testfiles/h5stat_idx.ddl
new file mode 100644
index 0000000..f7e6031
--- /dev/null
+++ b/tools/h5stat/testfiles/h5stat_idx.ddl
@@ -0,0 +1,75 @@
+#############################
+Expected output for 'h5stat h5stat_idx.h5'
+#############################
+Filename: h5stat_idx.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. # of objects in group: 2
+Object header size: (total/unused)
+ Groups: 147/47
+ Datasets: 568/362
+ Datatypes: 0/0
+Storage information:
+ Groups:
+ B-tree/List: 0
+ Heap: 0
+ Attributes:
+ B-tree/List: 0
+ Heap: 0
+ Chunked datasets:
+ Index: 202
+ Shared Messages:
+ Header: 0
+ B-tree/List: 0
+ Heap: 0
+ Superblock extension: 0
+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: 1
+ Dataset ranks:
+ # of dataset with rank 1: 2
+1-D Dataset information:
+ Max. dimension size of 1-D datasets: 10
+ Small 1-D datasets:
+ Total small datasets: 0
+ 1-D Dataset dimension bins:
+ # of datasets of size 10 - 99: 2
+ Total # of datasets: 2
+Dataset storage information:
+ Total raw data size: 110
+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: 1
+ GZIP filter: 1
+ 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/h5stat/testfiles/h5stat_idx.h5 b/tools/h5stat/testfiles/h5stat_idx.h5
new file mode 100644
index 0000000..6a25272
--- /dev/null
+++ b/tools/h5stat/testfiles/h5stat_idx.h5
Binary files differ
diff --git a/tools/h5stat/testfiles/h5stat_newgrat.ddl b/tools/h5stat/testfiles/h5stat_newgrat.ddl
index f87f297..ce93b9c 100644
--- a/tools/h5stat/testfiles/h5stat_newgrat.ddl
+++ b/tools/h5stat/testfiles/h5stat_newgrat.ddl
@@ -22,7 +22,7 @@ Storage information:
B-tree/List: 2598
Heap: 4442
Chunked datasets:
- B-tree: 0
+ Index: 0
Shared Messages:
Header: 0
B-tree/List: 0
diff --git a/tools/h5stat/testfiles/h5stat_tsohm.ddl b/tools/h5stat/testfiles/h5stat_tsohm.ddl
index 577dfdd..25e1784 100644
--- a/tools/h5stat/testfiles/h5stat_tsohm.ddl
+++ b/tools/h5stat/testfiles/h5stat_tsohm.ddl
@@ -22,7 +22,7 @@ Storage information:
B-tree/List: 0
Heap: 0
Chunked datasets:
- B-tree: 0
+ Index: 0
Shared Messages:
Header: 38
B-tree/List: 550
diff --git a/tools/h5stat/testh5stat.sh.in b/tools/h5stat/testh5stat.sh.in
index 66d05be..28837ec 100644
--- a/tools/h5stat/testh5stat.sh.in
+++ b/tools/h5stat/testh5stat.sh.in
@@ -124,6 +124,8 @@ TOOLTEST h5stat_filters-dT.ddl -dT h5stat_filters.h5
TOOLTEST h5stat_tsohm.ddl h5stat_tsohm.h5
# h5stat_newgrat.h5 is generated by h5stat_gentest.c
TOOLTEST h5stat_newgrat.ddl h5stat_newgrat.h5
+# h5stat_idx.h5 is generated by h5stat_gentest.c
+TOOLTEST h5stat_idx.ddl h5stat_idx.h5
echo