From f4293f6e9261f3d9397af41e7e7ae3ce03a00b6a Mon Sep 17 00:00:00 2001 From: Vailin Choi Date: Tue, 16 Feb 2010 14:41:11 -0500 Subject: [svn-r18265] Should not have committed the following into this 1.8.4 branch. Undo the commit. ------------------------------------------------------------------------ r18260 | vchoi | 2010-02-15 17:13:15 -0600 (Mon, 15 Feb 2010) | 8 lines Changes to h5stat in response to bug 1778: 1. Gather attribute info for named datatype, 2. Fixed -T, -G, -A, -D options 3. Brought over some changes from trunk h5stat --- tools/h5stat/h5stat.c | 410 ++++++++------------------- tools/h5stat/testfiles/h5stat_filters-F.ddl | 17 +- tools/h5stat/testfiles/h5stat_filters-UD.ddl | 8 - tools/h5stat/testfiles/h5stat_filters-UT.ddl | 13 - tools/h5stat/testfiles/h5stat_filters-d.ddl | 3 +- tools/h5stat/testfiles/h5stat_filters-dT.ddl | 3 +- tools/h5stat/testfiles/h5stat_filters.ddl | 20 +- tools/h5stat/testfiles/h5stat_help1.ddl | 8 +- tools/h5stat/testfiles/h5stat_help2.ddl | 8 +- tools/h5stat/testfiles/h5stat_newgrat-UA.ddl | 10 - tools/h5stat/testfiles/h5stat_newgrat-UG.ddl | 8 - tools/h5stat/testfiles/h5stat_newgrat.ddl | 18 +- tools/h5stat/testfiles/h5stat_tsohm.ddl | 18 +- tools/h5stat/testh5stat.sh.in | 6 - 14 files changed, 162 insertions(+), 388 deletions(-) delete mode 100644 tools/h5stat/testfiles/h5stat_filters-UD.ddl delete mode 100644 tools/h5stat/testfiles/h5stat_filters-UT.ddl delete mode 100644 tools/h5stat/testfiles/h5stat_newgrat-UA.ddl delete mode 100644 tools/h5stat/testfiles/h5stat_newgrat-UG.ddl diff --git a/tools/h5stat/h5stat.c b/tools/h5stat/h5stat.c index 8ac510e..f5537e1 100644 --- a/tools/h5stat/h5stat.c +++ b/tools/h5stat/h5stat.c @@ -79,7 +79,6 @@ typedef struct iter_t { unsigned long *dset_dim_bins; /* Pointer to array of bins for dataset dimensions */ ohdr_info_t dset_ohdr_info; /* Object header information for datasets */ hsize_t dset_storage_size; /* Size of raw data for datasets */ - hsize_t dset_external_storage_size; /* Size of raw data for datasets with external storage */ ohdr_info_t dtype_ohdr_info; /* Object header information for datatypes */ hsize_t groups_btree_storage_size; /* btree size for group */ hsize_t groups_heap_storage_size; /* heap size for group */ @@ -89,9 +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 ublk_size; /* user block size (if exists) */ hsize_t datasets_index_storage_size;/* meta size for chunked dataset's indexing type */ - hsize_t datasets_heap_storage_size; /* heap size for dataset with external storage */ unsigned long nexternal; /* Number of external files for a dataset */ int local; /* Flag to indicate iteration over the object*/ } iter_t; @@ -100,13 +97,11 @@ typedef struct iter_t { const char *progname = "h5stat"; int d_status = EXIT_SUCCESS; static int display_all = TRUE; -static int display_file = FALSE; static int display_file_metadata = FALSE; +static int display_file = FALSE; static int display_group = FALSE; -static int display_group_metadata = FALSE; static int display_dset = FALSE; -static int display_dset_metadata = FALSE; -static int display_dset_dtype_meta = FALSE; +static int display_dtype_metadata = FALSE; static int display_object = FALSE; static int display_attr = FALSE; @@ -117,22 +112,24 @@ struct handler_t { static const char *s_opts ="ADdFfhGgTO:V"; -/* e.g. "filemetadata" has to precedue "file"; "groupmetadata" has to precede "group" etc. */ static struct long_options l_opts[] = { {"help", no_arg, 'h'}, {"hel", no_arg, 'h'}, - {"he", no_arg, 'h'}, - {"filemetadata", no_arg, 'F'}, - {"filemetadat", no_arg, 'F'}, - {"filemetada", no_arg, 'F'}, - {"filemetad", no_arg, 'F'}, - {"filemeta", no_arg, 'F'}, - {"filemet", no_arg, 'F'}, - {"fileme", no_arg, 'F'}, - {"filem", no_arg, 'F'}, {"file", no_arg, 'f'}, {"fil", no_arg, 'f'}, {"fi", no_arg, 'f'}, + {"FILEmetadata", no_arg, 'F'}, + {"FILEmetadat", no_arg, 'F'}, + {"FILEmetada", no_arg, 'F'}, + {"FILEmetad", no_arg, 'F'}, + {"FILEmeta", no_arg, 'F'}, + {"FILEmet", no_arg, 'F'}, + {"FILEme", no_arg, 'F'}, + {"FILEm", no_arg, 'F'}, + {"group", no_arg, 'g'}, + {"grou", no_arg, 'g'}, + {"gro", no_arg, 'g'}, + {"gr", no_arg, 'g'}, {"groupmetadata", no_arg, 'G'}, {"groupmetadat", no_arg, 'G'}, {"groupmetada", no_arg, 'G'}, @@ -141,10 +138,10 @@ static struct long_options l_opts[] = { {"groupmet", no_arg, 'G'}, {"groupme", no_arg, 'G'}, {"groupm", no_arg, 'G'}, - {"group", no_arg, 'g'}, - {"grou", no_arg, 'g'}, - {"gro", no_arg, 'g'}, - {"gr", no_arg, 'g'}, + {"dset", no_arg, 'd'}, + {"dse", no_arg, 'd'}, + {"ds", no_arg, 'd'}, + {"d", no_arg, 'd'}, {"dsetmetadata", no_arg, 'D'}, {"dsetmetadat", no_arg, 'D'}, {"dsetmetada", no_arg, 'D'}, @@ -153,9 +150,6 @@ static struct long_options l_opts[] = { {"dsetmet", no_arg, 'D'}, {"dsetme", no_arg, 'D'}, {"dsetm", no_arg, 'D'}, - {"dset", no_arg, 'd'}, - {"dse", no_arg, 'd'}, - {"ds", no_arg, 'd'}, {"dtypemetadata", no_arg, 'T'}, {"dtypemetadat", no_arg, 'T'}, {"dtypemetada", no_arg, 'T'}, @@ -165,9 +159,6 @@ static struct long_options l_opts[] = { {"dtypeme", no_arg, 'T'}, {"dtypem", no_arg, 'T'}, {"dtype", no_arg, 'T'}, - {"dtyp", no_arg, 'T'}, - {"dty", no_arg, 'T'}, - {"dt", no_arg, 'T'}, { "object", require_arg, 'O' }, { "objec", require_arg, 'O' }, { "obje", require_arg, 'O' }, @@ -187,6 +178,7 @@ static struct long_options l_opts[] = { { "attr", no_arg, 'A' }, { "att", no_arg, 'A' }, { "at", no_arg, 'A' }, + { "a", no_arg, 'A' }, { NULL, 0, '\0' } }; @@ -207,13 +199,12 @@ static void usage(const char *prog) fprintf(stdout, " -h, --help Print a usage message and exit\n"); fprintf(stdout, " -V, --version Print version number and exit\n"); fprintf(stdout, " -f, --file Print file information\n"); - fprintf(stdout, " -F, --filemetadata Print file space information for file's metadata\n"); + fprintf(stdout, " -F, --filemetadata Print file metadata\n"); fprintf(stdout, " -g, --group Print group information\n"); - fprintf(stdout, " -G, --groupmetadata Print file space information for groups' metadata\n"); - + fprintf(stdout, " -G, --groupmetadata Print group metadata\n"); fprintf(stdout, " -d, --dset Print dataset information\n"); - fprintf(stdout, " -D, --dsetmetadata Print file space information for datasets' metadata\n"); - fprintf(stdout, " -T, --dtypemetadata Print datasets' datatype metadata\n"); + fprintf(stdout, " -D, --dsetmetadata Print dataset metadata\n"); + fprintf(stdout, " -T, --dtypemetadata Print datatype metadata\n"); fprintf(stdout, " -A, --attribute Print attribute information\n"); fprintf(stdout, "\n"); } @@ -390,10 +381,6 @@ group_stats(iter_t *iter, const char *name, const H5O_info_t *oi) * Programmer: Quincey Koziol * Tuesday, August 16, 2005 * - * Modifications: - * 2/2010; Vailin Choi - * Handle external data (brought over from trunk h5stat) - * *------------------------------------------------------------------------- */ static herr_t @@ -428,7 +415,6 @@ dataset_stats(iter_t *iter, const char *name, const H5O_info_t *oi) /* Update dataset metadata info */ iter->datasets_index_storage_size += oi->meta_size.obj.index_size; - iter->datasets_heap_storage_size += oi->meta_size.obj.heap_size; /* Update attribute metadata info */ ret = attribute_stats(iter, oi); @@ -436,32 +422,7 @@ dataset_stats(iter_t *iter, const char *name, const H5O_info_t *oi) /* Get storage info */ storage = H5Dget_storage_size(did); - - /* Gather layout statistics */ - dcpl = H5Dget_create_plist(did); - assert(dcpl > 0); - - lout = H5Pget_layout(dcpl); - assert(lout >= 0); - - /* Object header's total size for H5D_COMPACT layout includes raw data size */ - /* "storage" also includes H5D_COMPACT raw data size */ - if(lout == H5D_COMPACT) - iter->dset_ohdr_info.total_size -= storage; - - /* Track the layout type for dataset */ - (iter->dset_layouts[lout])++; - - /* Get the number of external files for the dataset */ - num_ext = H5Pget_external_count(dcpl); - assert (num_ext >= 0); - - /* Accumulate raw data size accordingly */ - if(num_ext) { - iter->nexternal += (unsigned long)num_ext; - iter->dset_external_storage_size += (unsigned long)storage; - } else - iter->dset_storage_size += storage; + iter->dset_storage_size += storage; /* Gather dataspace statistics */ sid = H5Dget_space(did); @@ -544,6 +505,22 @@ dataset_stats(iter_t *iter, const char *name, const H5O_info_t *oi) ret = H5Tclose(tid); assert(ret >= 0); + /* Gather layout statistics */ + dcpl = H5Dget_create_plist(did); + assert(dcpl > 0); + + lout = H5Pget_layout(dcpl); + assert(lout >= 0); + + /* Track the layout type for dataset */ + (iter->dset_layouts[lout])++; + + num_ext = H5Pget_external_count(dcpl); + assert (num_ext >= 0); + + if(num_ext) + iter->nexternal += (unsigned long)num_ext; + /* Track different filters */ if((nfltr = H5Pget_nfilters(dcpl)) >= 0) { if(nfltr == 0) @@ -576,17 +553,11 @@ dataset_stats(iter_t *iter, const char *name, const H5O_info_t *oi) * * Programmer: Vailin Choi; July 7th, 2009 * - * Modifications: - * 2/2010; Vailin Choi - * Gather attribute info for named datatype - * *------------------------------------------------------------------------- */ static herr_t datatype_stats(iter_t *iter, const H5O_info_t *oi) { - herr_t ret; - /* Gather statistics about this type of object */ iter->uniq_dtypes++; @@ -594,10 +565,6 @@ datatype_stats(iter_t *iter, const H5O_info_t *oi) iter->dtype_ohdr_info.total_size += oi->hdr.space.total; iter->dtype_ohdr_info.free_size += oi->hdr.space.free; - /* Update attribute metadata info */ - ret = attribute_stats(iter, oi); - assert(ret >= 0); - return 0; } /* end datatype_stats() */ @@ -699,10 +666,6 @@ lnk_stats(const char UNUSED *path, const H5L_info_t *li, void *_iter) * Programmer: Elena Pourmal * Saturday, August 12, 2006 * - * Modifications: - * 2/2010; Vailin Choi - * Handle -G and -T options - * *------------------------------------------------------------------------- */ static struct handler_t * @@ -717,13 +680,9 @@ parse_command_line(int argc, const char *argv[]) /* parse command line options */ while ((opt = get_option(argc, argv, s_opts, l_opts)) != EOF) { switch ((char)opt) { - case 'h': - usage(progname); - leave(EXIT_SUCCESS); - - case 'V': - print_version(progname); - leave(EXIT_SUCCESS); + case 'A': + display_all = FALSE; + display_attr = TRUE; break; case 'F': @@ -738,7 +697,6 @@ parse_command_line(int argc, const char *argv[]) case 'G': display_all = FALSE; - display_group_metadata = TRUE; break; case 'g': @@ -746,9 +704,13 @@ parse_command_line(int argc, const char *argv[]) display_group = TRUE; break; + case 'T': + display_all = FALSE; + display_dtype_metadata = TRUE; + break; + case 'D': display_all = FALSE; - display_dset_metadata = TRUE; break; case 'd': @@ -756,14 +718,13 @@ parse_command_line(int argc, const char *argv[]) display_dset = TRUE; break; - case 'T': - display_all = FALSE; - display_dset_dtype_meta = TRUE; - break; + case 'h': + usage(progname); + leave(EXIT_SUCCESS); - case 'A': - display_all = FALSE; - display_attr = TRUE; + case 'V': + print_version(progname); + leave(EXIT_SUCCESS); break; case 'O': @@ -848,7 +809,7 @@ print_file_info(const iter_t *iter) HDfprintf(stdout, "\tMax. # of objects in group: %Hu\n", iter->max_fanout); return 0; -} /* print_file_info() */ +} /*------------------------------------------------------------------------- @@ -863,29 +824,20 @@ print_file_info(const iter_t *iter) * Programmer: Elena Pourmal * Saturday, August 12, 2006 * - * Modifications: - * 2/2010; Vailin Choi - * Brought over from trunk h5stat - * (Note: couldn't get superblock size because of H5F_info_t in H5public.h) - * *------------------------------------------------------------------------- */ static herr_t print_file_metadata(const iter_t *iter) { - printf("File space information for file metadata (in bytes):\n"); - HDfprintf(stdout, "\tSuperblock extension: %Hu\n", iter->super_ext_size); - HDfprintf(stdout, "\tUser block: %Hu\n", iter->ublk_size); - - HDfprintf(stdout, "\tObject headers: (total/unused)\n"); - HDfprintf(stdout, "\t\tGroups: %Hu/%Hu\n", iter->group_ohdr_info.total_size, - iter->group_ohdr_info.free_size); - HDfprintf(stdout, "\t\tDatasets(exclude compact data): %Hu/%Hu\n", - iter->dset_ohdr_info.total_size, - iter->dset_ohdr_info.free_size); - HDfprintf(stdout, "\t\tDatatypes: %Hu/%Hu\n", iter->dtype_ohdr_info.total_size, - iter->dtype_ohdr_info.free_size); - + printf("Object header size: (total/unused)\n"); + HDfprintf(stdout, "\tGroups: %Hu/%Hu\n", iter->group_ohdr_info.total_size, + iter->group_ohdr_info.free_size); + HDfprintf(stdout, "\tDatasets: %Hu/%Hu\n", iter->dset_ohdr_info.total_size, + iter->dset_ohdr_info.free_size); + HDfprintf(stdout, "\tDatatypes: %Hu/%Hu\n", iter->dtype_ohdr_info.total_size, + iter->dtype_ohdr_info.free_size); + + printf("Storage information:\n"); HDfprintf(stdout, "\tGroups:\n"); HDfprintf(stdout, "\t\tB-tree/List: %Hu\n", iter->groups_btree_storage_size); HDfprintf(stdout, "\t\tHeap: %Hu\n", iter->groups_heap_storage_size); @@ -895,18 +847,17 @@ 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\tIndex: %Hu\n", iter->datasets_index_storage_size); - - HDfprintf(stdout, "\tDatasets:\n"); - HDfprintf(stdout, "\t\tHeap: %Hu\n", iter->datasets_heap_storage_size); + HDfprintf(stdout, "\t\tB-tree: %Hu\n", iter->datasets_index_storage_size); HDfprintf(stdout, "\tShared Messages:\n"); HDfprintf(stdout, "\t\tHeader: %Hu\n", iter->SM_hdr_storage_size); HDfprintf(stdout, "\t\tB-tree/List: %Hu\n", iter->SM_index_storage_size); HDfprintf(stdout, "\t\tHeap: %Hu\n", iter->SM_heap_storage_size); + HDfprintf(stdout, "\tSuperblock extension: %Hu\n", iter->super_ext_size); + return 0; -} /* print_file_metadata() */ +} /*------------------------------------------------------------------------- @@ -963,35 +914,58 @@ print_group_info(const iter_t *iter) printf("\tTotal # of groups: %lu\n", total); return 0; -} /* print_group_info() */ +} /*------------------------------------------------------------------------- - * Function: print_group_metadata + * Function: print_attr_info * - * Purpose: Prints file space information for groups' metadata + * Purpose: Prints information about attributes in the file * * Return: Success: 0 * * Failure: Never fails * - * Programmer: Vailin Choi; October 2009 + * Programmer: Vailin Choi + * July 12, 2007 + * + * Modifications: * *------------------------------------------------------------------------- */ static herr_t -print_group_metadata(const iter_t *iter) +print_attr_info(const iter_t *iter) { - printf("File space information for groups' metadata (in bytes):\n"); + unsigned long power; /* Temporary "power" for bins */ + unsigned long total; /* Total count for various statistics */ + unsigned u; /* Local index variable */ - HDfprintf(stdout, "\tObject headers (total/unused): %Hu/%Hu\n", - iter->group_ohdr_info.total_size, iter->group_ohdr_info.free_size); + printf("Small # of attributes:\n"); + total = 0; + for(u = 1; u < SIZE_SMALL_ATTRS; u++) { + if(iter->num_small_attrs[u] > 0) { + printf("\t# of objects with %u attributes: %lu\n", u, iter->num_small_attrs[u]); + total += iter->num_small_attrs[u]; + } /* end if */ + } /* end for */ + printf("\tTotal # of objects with small # of attributes: %lu\n", total); - HDfprintf(stdout, "\tB-tree/List: %Hu\n", iter->groups_btree_storage_size); - HDfprintf(stdout, "\tHeap: %Hu\n", iter->groups_heap_storage_size); + printf("Attribute bins:\n"); + total = 0; + power = 1; + for(u = 1; u < iter->attr_nbins; u++) { + if(iter->attr_bins[u] > 0) { + printf("\t# of objects with %lu - %lu attributes: %lu\n", power, (power * 10) - 1, + iter->attr_bins[u]); + total += iter->attr_bins[u]; + } /* end if */ + power *= 10; + } /* end for */ + printf("\tTotal # of objects with attributes: %lu\n", total); + printf("\tMax. # of attributes to objects: %lu\n", (unsigned long)iter->max_attrs); return 0; -} /* print_group_metadata() */ +} /*------------------------------------------------------------------------- @@ -1007,8 +981,6 @@ print_group_metadata(const iter_t *iter) * Saturday, August 12, 2006 * * Modifications: - * 2/2010; Vailin Choi - * Moved coding for datatype to another routine. * *------------------------------------------------------------------------- */ @@ -1017,6 +989,7 @@ print_dataset_info(const iter_t *iter) { unsigned long power; /* Temporary "power" for bins */ unsigned long total; /* Total count for various statistics */ + size_t dtype_size; /* Size of encoded datatype */ unsigned u; /* Local index variable */ if(iter->uniq_dsets > 0) { @@ -1062,7 +1035,6 @@ print_dataset_info(const iter_t *iter) printf("Dataset storage information:\n"); HDfprintf(stdout, "\tTotal raw data size: %Hu\n", iter->dset_storage_size); - HDfprintf(stdout, "\tTotal external raw data size: %Hu\n", iter->dset_external_storage_size); printf("Dataset layout information:\n"); for(u = 0; u < H5D_NLAYOUTS; u++) @@ -1080,129 +1052,23 @@ print_dataset_info(const iter_t *iter) printf("\t\tNBIT filter: %lu\n", iter->dset_comptype[H5Z_FILTER_NBIT]); printf("\t\tSCALEOFFSET filter: %lu\n", iter->dset_comptype[H5Z_FILTER_SCALEOFFSET]); printf("\t\tUSER-DEFINED filter: %lu\n", iter->dset_comptype[H5_NFILTERS_IMPL-1]); - } /* end if */ - - return 0; -} /* print_dataset_info() */ - - -/*------------------------------------------------------------------------- - * Function: print_dataset_metadata - * - * Purpose: Prints file space information for datasets' metadata - * - * Return: Success: 0 - * - * Failure: Never fails - * - * Programmer: Vailin Choi; October 2009 - * Brought over from trunk h5stat. - * - *------------------------------------------------------------------------- - */ -static herr_t -print_dset_metadata(const iter_t *iter) -{ - printf("File space information for datasets' metadata (in bytes):\n"); - - HDfprintf(stdout, "\tObject headers (total/unused): %Hu/%Hu\n", - iter->dset_ohdr_info.total_size, iter->dset_ohdr_info.free_size); - - HDfprintf(stdout, "\tIndex for Chunked datasets: %Hu\n", - iter->datasets_index_storage_size); - HDfprintf(stdout, "\tHeap: %Hu\n", iter->datasets_heap_storage_size); - - return 0; -} /* print_dset_metadata() */ - -/*------------------------------------------------------------------------- - * Function: print_dset_dtype_meta - * - * Purpose: Prints datasets' datatype information - * - * Return: Success: 0 - * - * Failure: Never fails - * - * Modifications: - * Moved from print_dataset_info() - * - *------------------------------------------------------------------------- - */ -static herr_t -print_dset_dtype_meta(const iter_t *iter) -{ - unsigned long total; /* Total count for various statistics */ - size_t dtype_size; /* Size of encoded datatype */ - unsigned u; /* Local index variable */ - - if(iter->dset_ntypes) { - printf("Dataset datatype information:\n"); - printf("\t# of unique datatypes used by datasets: %lu\n", iter->dset_ntypes); - total = 0; - for(u = 0; u < iter->dset_ntypes; u++) { - H5Tencode(iter->dset_type_info[u].tid, NULL, &dtype_size); - printf("\tDataset datatype #%u:\n", u); - printf("\t\tCount (total/named) = (%lu/%lu)\n", - iter->dset_type_info[u].count, iter->dset_type_info[u].named); - printf("\t\tSize (desc./elmt) = (%lu/%lu)\n", (unsigned long)dtype_size, - (unsigned long)H5Tget_size(iter->dset_type_info[u].tid)); - H5Tclose(iter->dset_type_info[u].tid); - total += iter->dset_type_info[u].count; - } /* end for */ - printf("\tTotal dataset datatype count: %lu\n", total); - } - - return 0; -} /* print_dset_dtype_meta() */ - - -/*------------------------------------------------------------------------- - * Function: print_attr_info - * - * Purpose: Prints information about attributes in the file - * - * Return: Success: 0 - * - * Failure: Never fails - * - * Programmer: Vailin Choi - * July 12, 2007 - * - * Modifications: - * - *------------------------------------------------------------------------- - */ -static herr_t -print_attr_info(const iter_t *iter) -{ - unsigned long power; /* Temporary "power" for bins */ - unsigned long total; /* Total count for various statistics */ - unsigned u; /* Local index variable */ - printf("Small # of attributes:\n"); - total = 0; - for(u = 1; u < SIZE_SMALL_ATTRS; u++) { - if(iter->num_small_attrs[u] > 0) { - printf("\t# of objects with %u attributes: %lu\n", u, iter->num_small_attrs[u]); - total += iter->num_small_attrs[u]; - } /* end if */ - } /* end for */ - printf("\tTotal # of objects with small # of attributes: %lu\n", total); - - printf("Attribute bins:\n"); - total = 0; - power = 1; - for(u = 1; u < iter->attr_nbins; u++) { - if(iter->attr_bins[u] > 0) { - printf("\t# of objects with %lu - %lu attributes: %lu\n", power, (power * 10) - 1, - iter->attr_bins[u]); - total += iter->attr_bins[u]; - } /* end if */ - power *= 10; - } /* end for */ - printf("\tTotal # of objects with attributes: %lu\n", total); - printf("\tMax. # of attributes to objects: %lu\n", (unsigned long)iter->max_attrs); + if(display_dtype_metadata) { + printf("Dataset datatype information:\n"); + printf("\t# of unique datatypes used by datasets: %lu\n", iter->dset_ntypes); + total = 0; + for(u = 0; u < iter->dset_ntypes; u++) { + H5Tencode(iter->dset_type_info[u].tid, NULL, &dtype_size); + printf("\tDataset datatype #%u:\n", u); + printf("\t\tCount (total/named) = (%lu/%lu)\n", iter->dset_type_info[u].count, iter->dset_type_info[u].named); + printf("\t\tSize (desc./elmt) = (%lu/%lu)\n", (unsigned long)dtype_size, + (unsigned long)H5Tget_size(iter->dset_type_info[u].tid)); + H5Tclose(iter->dset_type_info[u].tid); + total += iter->dset_type_info[u].count; + } /* end for */ + printf("\tTotal dataset datatype count: %lu\n", total); + } + } /* end if */ return 0; } @@ -1220,10 +1086,6 @@ print_attr_info(const iter_t *iter) * Programmer: Elena Pourmal * Saturday, August 12, 2006 * - * Modifications: - * 2/2010; Vailin Choi - * Turned on the appropriate displays. - * *------------------------------------------------------------------------- */ static void @@ -1231,26 +1093,17 @@ print_file_statistics(const iter_t *iter) { if(display_all) { display_file = TRUE; + display_file_metadata = TRUE; display_group = TRUE; display_dset = TRUE; - display_dset_dtype_meta = TRUE; + display_dtype_metadata = TRUE; display_attr = TRUE; - - display_file_metadata = TRUE; - display_group_metadata = TRUE; - display_dset_metadata = TRUE; } if(display_file) print_file_info(iter); if(display_file_metadata) print_file_metadata(iter); - if(display_group) print_group_info(iter); - if(!display_all && display_group_metadata) print_group_metadata(iter); - if(display_dset) print_dataset_info(iter); - if(display_dset_dtype_meta) print_dset_dtype_meta(iter); - if(!display_all && display_dset_metadata) print_dset_metadata(iter); - if(display_attr) print_attr_info(iter); } @@ -1275,8 +1128,7 @@ static void print_object_statistics(const char *name) { printf("Object name %s\n", name); -} /* print_object_statistics() */ - +} /*------------------------------------------------------------------------- @@ -1305,22 +1157,12 @@ print_statistics(const char *name, const iter_t *iter) } -/*------------------------------------------------------------------------- - * Function: main - * - * Modifications: - * 2/2010; Vailin Choi - * Get the size of user block - * - *------------------------------------------------------------------------- - */ int main(int argc, const char *argv[]) { iter_t iter; const char *fname = NULL; - hid_t fid; /* file id */ - hid_t fcpl; /* file creation property id */ + hid_t fid; struct handler_t *hand; H5F_info_t finfo; @@ -1358,12 +1200,6 @@ main(int argc, const char *argv[]) iter.SM_heap_storage_size = finfo.sohm.msgs_info.heap_size; } /* end else */ - if((fcpl = H5Fget_create_plist(fid)) < 0) - warn_msg(progname, "Unable to retrieve file creation property\n"); - - if(H5Pget_userblock(fcpl, &iter.ublk_size) < 0) - warn_msg(progname, "Unable to retrieve userblock size\n"); - /* Walk the objects or all file */ if(display_object) { unsigned u; diff --git a/tools/h5stat/testfiles/h5stat_filters-F.ddl b/tools/h5stat/testfiles/h5stat_filters-F.ddl index e20ef87..6bc6cc2 100644 --- a/tools/h5stat/testfiles/h5stat_filters-F.ddl +++ b/tools/h5stat/testfiles/h5stat_filters-F.ddl @@ -2,13 +2,11 @@ Expected output for 'h5stat -F h5stat_filters.h5' ############################# Filename: h5stat_filters.h5 -File space information for file metadata (in bytes): - Superblock extension: 0 - User block: 0 - Object headers: (total/unused) - Groups: 48/8 - Datasets(exclude compact data): 4136/1344 - Datatypes: 80/0 +Object header size: (total/unused) + Groups: 48/8 + Datasets: 4936/1344 + Datatypes: 80/0 +Storage information: Groups: B-tree/List: 1200 Heap: 288 @@ -16,10 +14,9 @@ File space information for file metadata (in bytes): B-tree/List: 0 Heap: 0 Chunked datasets: - Index: 31392 - Datasets: - Heap: 72 + B-tree: 31392 Shared Messages: Header: 0 B-tree/List: 0 Heap: 0 + Superblock extension: 0 diff --git a/tools/h5stat/testfiles/h5stat_filters-UD.ddl b/tools/h5stat/testfiles/h5stat_filters-UD.ddl deleted file mode 100644 index decfb81..0000000 --- a/tools/h5stat/testfiles/h5stat_filters-UD.ddl +++ /dev/null @@ -1,8 +0,0 @@ -############################# -Expected output for 'h5stat -D h5stat_filters.h5' -############################# -Filename: h5stat_filters.h5 -File space information for datasets' metadata (in bytes): - Object headers (total/unused): 4136/1344 - Index for Chunked datasets: 31392 - Heap: 72 diff --git a/tools/h5stat/testfiles/h5stat_filters-UT.ddl b/tools/h5stat/testfiles/h5stat_filters-UT.ddl deleted file mode 100644 index 189eaa6..0000000 --- a/tools/h5stat/testfiles/h5stat_filters-UT.ddl +++ /dev/null @@ -1,13 +0,0 @@ -############################# -Expected output for 'h5stat -T h5stat_filters.h5' -############################# -Filename: h5stat_filters.h5 -Dataset datatype information: - # of unique datatypes used by datasets: 2 - Dataset datatype #0: - Count (total/named) = (14/0) - Size (desc./elmt) = (14/4) - Dataset datatype #1: - Count (total/named) = (1/0) - Size (desc./elmt) = (14/4) - Total dataset datatype count: 15 diff --git a/tools/h5stat/testfiles/h5stat_filters-d.ddl b/tools/h5stat/testfiles/h5stat_filters-d.ddl index 3cc9071..42d0de3 100644 --- a/tools/h5stat/testfiles/h5stat_filters-d.ddl +++ b/tools/h5stat/testfiles/h5stat_filters-d.ddl @@ -15,8 +15,7 @@ Dataset dimension information: # of datasets of size 100 - 999: 1 Total # of datasets: 1 Dataset storage information: - Total raw data size: 8659 - Total external raw data size: 400 + Total raw data size: 9059 Dataset layout information: Dataset layout counts[COMPACT]: 1 Dataset layout counts[CONTIG]: 2 diff --git a/tools/h5stat/testfiles/h5stat_filters-dT.ddl b/tools/h5stat/testfiles/h5stat_filters-dT.ddl index ae9121d..2edcf7e 100644 --- a/tools/h5stat/testfiles/h5stat_filters-dT.ddl +++ b/tools/h5stat/testfiles/h5stat_filters-dT.ddl @@ -15,8 +15,7 @@ Dataset dimension information: # of datasets of size 100 - 999: 1 Total # of datasets: 1 Dataset storage information: - Total raw data size: 8659 - Total external raw data size: 400 + Total raw data size: 9059 Dataset layout information: Dataset layout counts[COMPACT]: 1 Dataset layout counts[CONTIG]: 2 diff --git a/tools/h5stat/testfiles/h5stat_filters.ddl b/tools/h5stat/testfiles/h5stat_filters.ddl index 03ea440..f9adebd 100644 --- a/tools/h5stat/testfiles/h5stat_filters.ddl +++ b/tools/h5stat/testfiles/h5stat_filters.ddl @@ -10,13 +10,11 @@ File information # of unique other: 0 Max. # of links to object: 1 Max. # of objects in group: 16 -File space information for file metadata (in bytes): - Superblock extension: 0 - User block: 0 - Object headers: (total/unused) - Groups: 48/8 - Datasets(exclude compact data): 4136/1344 - Datatypes: 80/0 +Object header size: (total/unused) + Groups: 48/8 + Datasets: 4936/1344 + Datatypes: 80/0 +Storage information: Groups: B-tree/List: 1200 Heap: 288 @@ -24,13 +22,12 @@ File space information for file metadata (in bytes): B-tree/List: 0 Heap: 0 Chunked datasets: - Index: 31392 - Datasets: - Heap: 72 + B-tree: 31392 Shared Messages: Header: 0 B-tree/List: 0 Heap: 0 + Superblock extension: 0 Small groups: Total # of small groups: 0 Group bins: @@ -49,8 +46,7 @@ Dataset dimension information: # of datasets of size 100 - 999: 1 Total # of datasets: 1 Dataset storage information: - Total raw data size: 8659 - Total external raw data size: 400 + Total raw data size: 9059 Dataset layout information: Dataset layout counts[COMPACT]: 1 Dataset layout counts[CONTIG]: 2 diff --git a/tools/h5stat/testfiles/h5stat_help1.ddl b/tools/h5stat/testfiles/h5stat_help1.ddl index 9e59044..0a86b4c 100644 --- a/tools/h5stat/testfiles/h5stat_help1.ddl +++ b/tools/h5stat/testfiles/h5stat_help1.ddl @@ -7,11 +7,11 @@ Usage: h5stat [OPTIONS] file -h, --help Print a usage message and exit -V, --version Print version number and exit -f, --file Print file information - -F, --filemetadata Print file space information for file's metadata + -F, --filemetadata Print file metadata -g, --group Print group information - -G, --groupmetadata Print file space information for groups' metadata + -G, --groupmetadata Print group metadata -d, --dset Print dataset information - -D, --dsetmetadata Print file space information for datasets' metadata - -T, --dtypemetadata Print datasets' datatype metadata + -D, --dsetmetadata Print dataset metadata + -T, --dtypemetadata Print datatype metadata -A, --attribute Print attribute information diff --git a/tools/h5stat/testfiles/h5stat_help2.ddl b/tools/h5stat/testfiles/h5stat_help2.ddl index 3276273..e41eb9e 100644 --- a/tools/h5stat/testfiles/h5stat_help2.ddl +++ b/tools/h5stat/testfiles/h5stat_help2.ddl @@ -7,11 +7,11 @@ Usage: h5stat [OPTIONS] file -h, --help Print a usage message and exit -V, --version Print version number and exit -f, --file Print file information - -F, --filemetadata Print file space information for file's metadata + -F, --filemetadata Print file metadata -g, --group Print group information - -G, --groupmetadata Print file space information for groups' metadata + -G, --groupmetadata Print group metadata -d, --dset Print dataset information - -D, --dsetmetadata Print file space information for datasets' metadata - -T, --dtypemetadata Print datasets' datatype metadata + -D, --dsetmetadata Print dataset metadata + -T, --dtypemetadata Print datatype metadata -A, --attribute Print attribute information diff --git a/tools/h5stat/testfiles/h5stat_newgrat-UA.ddl b/tools/h5stat/testfiles/h5stat_newgrat-UA.ddl deleted file mode 100644 index 70f9a82..0000000 --- a/tools/h5stat/testfiles/h5stat_newgrat-UA.ddl +++ /dev/null @@ -1,10 +0,0 @@ -############################# -Expected output for 'h5stat -A h5stat_newgrat.h5' -############################# -Filename: h5stat_newgrat.h5 -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/h5stat/testfiles/h5stat_newgrat-UG.ddl b/tools/h5stat/testfiles/h5stat_newgrat-UG.ddl deleted file mode 100644 index b300a8f..0000000 --- a/tools/h5stat/testfiles/h5stat_newgrat-UG.ddl +++ /dev/null @@ -1,8 +0,0 @@ -############################# -Expected output for 'h5stat -G h5stat_newgrat.h5' -############################# -Filename: h5stat_newgrat.h5 -File space information for groups' metadata (in bytes): - Object headers (total/unused): 5145147/3220092 - B-tree/List: 470054 - Heap: 739102 diff --git a/tools/h5stat/testfiles/h5stat_newgrat.ddl b/tools/h5stat/testfiles/h5stat_newgrat.ddl index 9ee3b5f..4f9bcac 100644 --- a/tools/h5stat/testfiles/h5stat_newgrat.ddl +++ b/tools/h5stat/testfiles/h5stat_newgrat.ddl @@ -10,13 +10,11 @@ File information # of unique other: 0 Max. # of links to object: 1 Max. # of objects in group: 35001 -File space information for file metadata (in bytes): - Superblock extension: 0 - User block: 0 - Object headers: (total/unused) - Groups: 5145147/3220092 - Datasets(exclude compact data): 414/312 - Datatypes: 0/0 +Object header size: (total/unused) + Groups: 5145147/3220092 + Datasets: 414/312 + Datatypes: 0/0 +Storage information: Groups: B-tree/List: 470054 Heap: 739102 @@ -24,13 +22,12 @@ File space information for file metadata (in bytes): B-tree/List: 2598 Heap: 4442 Chunked datasets: - Index: 0 - Datasets: - Heap: 0 + B-tree: 0 Shared Messages: Header: 0 B-tree/List: 0 Heap: 0 + Superblock extension: 0 Small groups: # of groups of size 0: 35000 Total # of small groups: 35000 @@ -48,7 +45,6 @@ Dataset dimension information: Total small datasets: 0 Dataset storage information: Total raw data size: 0 - Total external raw data size: 0 Dataset layout information: Dataset layout counts[COMPACT]: 0 Dataset layout counts[CONTIG]: 1 diff --git a/tools/h5stat/testfiles/h5stat_tsohm.ddl b/tools/h5stat/testfiles/h5stat_tsohm.ddl index e3b58d5..e536c33 100644 --- a/tools/h5stat/testfiles/h5stat_tsohm.ddl +++ b/tools/h5stat/testfiles/h5stat_tsohm.ddl @@ -10,13 +10,11 @@ File information # of unique other: 0 Max. # of links to object: 1 Max. # of objects in group: 3 -File space information for file metadata (in bytes): - Superblock extension: 40 - User block: 0 - Object headers: (total/unused) - Groups: 51/2 - Datasets(exclude compact data): 852/447 - Datatypes: 0/0 +Object header size: (total/unused) + Groups: 51/2 + Datasets: 852/447 + Datatypes: 0/0 +Storage information: Groups: B-tree/List: 872 Heap: 120 @@ -24,13 +22,12 @@ File space information for file metadata (in bytes): B-tree/List: 0 Heap: 0 Chunked datasets: - Index: 0 - Datasets: - Heap: 0 + B-tree: 0 Shared Messages: Header: 38 B-tree/List: 550 Heap: 1316 + Superblock extension: 40 Small groups: # of groups of size 3: 1 Total # of small groups: 1 @@ -47,7 +44,6 @@ Dataset dimension information: Total small datasets: 0 Dataset storage information: Total raw data size: 0 - Total external raw data size: 0 Dataset layout information: Dataset layout counts[COMPACT]: 0 Dataset layout counts[CONTIG]: 0 diff --git a/tools/h5stat/testh5stat.sh.in b/tools/h5stat/testh5stat.sh.in index 7ad07b9..66d05be 100644 --- a/tools/h5stat/testh5stat.sh.in +++ b/tools/h5stat/testh5stat.sh.in @@ -119,17 +119,11 @@ TOOLTEST h5stat_filters-F.ddl -F h5stat_filters.h5 TOOLTEST h5stat_filters-d.ddl -d h5stat_filters.h5 TOOLTEST h5stat_filters-g.ddl -g h5stat_filters.h5 TOOLTEST h5stat_filters-dT.ddl -dT h5stat_filters.h5 -TOOLTEST h5stat_filters-UD.ddl -D h5stat_filters.h5 -TOOLTEST h5stat_filters-UT.ddl -T h5stat_filters.h5 -# # h5stat_tsohm.h5 is a copy of ../../../test/tsohm.h5 generated by tsohm.c # as of release 1.8.0-alpha4 TOOLTEST h5stat_tsohm.ddl h5stat_tsohm.h5 -# # h5stat_newgrat.h5 is generated by h5stat_gentest.c TOOLTEST h5stat_newgrat.ddl h5stat_newgrat.h5 -TOOLTEST h5stat_newgrat-UG.ddl -G h5stat_newgrat.h5 -TOOLTEST h5stat_newgrat-UA.ddl -A h5stat_newgrat.h5 echo -- cgit v0.12