diff options
Diffstat (limited to 'tools/h5stat/h5stat.c')
-rw-r--r-- | tools/h5stat/h5stat.c | 425 |
1 files changed, 293 insertions, 132 deletions
diff --git a/tools/h5stat/h5stat.c b/tools/h5stat/h5stat.c index 24bfce0..efcac48 100644 --- a/tools/h5stat/h5stat.c +++ b/tools/h5stat/h5stat.c @@ -79,6 +79,7 @@ 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 */ @@ -88,7 +89,9 @@ 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; @@ -97,11 +100,13 @@ typedef struct iter_t { const char *progname = "h5stat"; int d_status = EXIT_SUCCESS; static int display_all = TRUE; -static int display_file_metadata = FALSE; static int display_file = FALSE; +static int display_file_metadata = FALSE; static int display_group = FALSE; +static int display_group_metadata = FALSE; static int display_dset = FALSE; -static int display_dtype_metadata = FALSE; +static int display_dset_metadata = FALSE; +static int display_dset_dtype_meta = FALSE; static int display_object = FALSE; static int display_attr = FALSE; @@ -112,24 +117,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'}, @@ -138,10 +143,11 @@ static struct long_options l_opts[] = { {"groupmet", no_arg, 'G'}, {"groupme", no_arg, 'G'}, {"groupm", no_arg, 'G'}, - {"dset", no_arg, 'd'}, - {"dse", no_arg, 'd'}, - {"ds", no_arg, 'd'}, - {"d", no_arg, 'd'}, + {"group", no_arg, 'g'}, + {"grou", no_arg, 'g'}, + {"gro", no_arg, 'g'}, + {"gr", no_arg, 'g'}, + {"dsetmetadata", no_arg, 'D'}, {"dsetmetadat", no_arg, 'D'}, {"dsetmetada", no_arg, 'D'}, @@ -150,6 +156,9 @@ 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'}, @@ -159,6 +168,9 @@ 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' }, @@ -178,7 +190,6 @@ 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' } }; @@ -187,7 +198,7 @@ leave(int ret) { h5tools_close(); exit(ret); -} +} /* leave() */ static void usage(const char *prog) @@ -199,15 +210,15 @@ 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 metadata\n"); + fprintf(stdout, " -F, --filemetadata Print file space information for file's metadata\n"); fprintf(stdout, " -g, --group Print group information\n"); - fprintf(stdout, " -G, --groupmetadata Print group metadata\n"); + fprintf(stdout, " -G, --groupmetadata Print file space information for groups' metadata\n"); fprintf(stdout, " -d, --dset Print dataset information\n"); - fprintf(stdout, " -D, --dsetmetadata Print dataset metadata\n"); - fprintf(stdout, " -T, --dtypemetadata Print datatype metadata\n"); + fprintf(stdout, " -D, --dsetmetadata Print file space information for datasets' metadata\n"); + fprintf(stdout, " -T, --dtypemetadata Print datasets' datatype metadata\n"); fprintf(stdout, " -A, --attribute Print attribute information\n"); fprintf(stdout, "\n"); -} +} /* usage() */ /*------------------------------------------------------------------------- @@ -236,7 +247,7 @@ ceil_log10(unsigned long x) } /* end while */ return(ret); -} +} /* ceil_log10() */ /*------------------------------------------------------------------------- @@ -381,6 +392,10 @@ 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 @@ -415,6 +430,7 @@ 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); @@ -422,7 +438,32 @@ dataset_stats(iter_t *iter, const char *name, const H5O_info_t *oi) /* Get storage info */ storage = H5Dget_storage_size(did); - iter->dset_storage_size += storage; + + /* 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; /* Gather dataspace statistics */ sid = H5Dget_space(did); @@ -505,22 +546,6 @@ 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) @@ -533,6 +558,7 @@ dataset_stats(iter_t *iter, const char *name, const H5O_info_t *oi) else iter->dset_comptype[H5_NFILTERS_IMPL - 1]++; /*other filters*/ } /* end if */ + } /* end for */ } /* endif nfltr */ @@ -554,12 +580,18 @@ dataset_stats(iter_t *iter, const char *name, const H5O_info_t *oi) * Failure: -1 * * 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++; @@ -567,6 +599,10 @@ 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() */ @@ -668,6 +704,10 @@ 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 * @@ -682,9 +722,13 @@ 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 'A': - display_all = FALSE; - display_attr = TRUE; + case 'h': + usage(progname); + leave(EXIT_SUCCESS); + + case 'V': + print_version(progname); + leave(EXIT_SUCCESS); break; case 'F': @@ -699,6 +743,7 @@ parse_command_line(int argc, const char *argv[]) case 'G': display_all = FALSE; + display_group_metadata = TRUE; break; case 'g': @@ -706,13 +751,9 @@ 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': @@ -720,13 +761,14 @@ parse_command_line(int argc, const char *argv[]) display_dset = TRUE; break; - case 'h': - usage(progname); - leave(EXIT_SUCCESS); + case 'T': + display_all = FALSE; + display_dset_dtype_meta = TRUE; + break; - case 'V': - print_version(progname); - leave(EXIT_SUCCESS); + case 'A': + display_all = FALSE; + display_attr = TRUE; break; case 'O': @@ -752,7 +794,7 @@ parse_command_line(int argc, const char *argv[]) } /* end if */ return hand; -} +} /* parse_command_line() */ /*------------------------------------------------------------------------- @@ -779,7 +821,7 @@ iter_init(iter_t *iter, hid_t fid) iter->fid = fid; return 0; -} +} /* iter_init() */ /*------------------------------------------------------------------------- @@ -811,7 +853,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() */ /*------------------------------------------------------------------------- @@ -826,20 +868,29 @@ 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("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"); + 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); + 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); @@ -849,17 +900,18 @@ 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_index_storage_size); + 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, "\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() */ /*------------------------------------------------------------------------- @@ -916,60 +968,35 @@ print_group_info(const iter_t *iter) printf("\tTotal # of groups: %lu\n", total); return 0; -} +} /* print_group_info() */ - /*------------------------------------------------------------------------- - * Function: print_attr_info + * Function: print_group_metadata * - * Purpose: Prints information about attributes in the file + * Purpose: Prints file space information for groups' metadata * * Return: Success: 0 * * Failure: Never fails * - * Programmer: Vailin Choi - * July 12, 2007 - * - * Modifications: + * Programmer: Vailin Choi; October 2009 * *------------------------------------------------------------------------- */ static herr_t -print_attr_info(const iter_t *iter) +print_group_metadata(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("File space information for groups' metadata (in bytes):\n"); - 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, "\tObject headers (total/unused): %Hu/%Hu\n", + iter->group_ohdr_info.total_size, iter->group_ohdr_info.free_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); + HDfprintf(stdout, "\tB-tree/List: %Hu\n", iter->groups_btree_storage_size); + HDfprintf(stdout, "\tHeap: %Hu\n", iter->groups_heap_storage_size); return 0; -} +} /* print_group_metadata() */ - /*------------------------------------------------------------------------- * Function: print_dataset_info * @@ -983,6 +1010,8 @@ print_attr_info(const iter_t *iter) * Saturday, August 12, 2006 * * Modifications: + * 2/2010; Vailin Choi + * Moved coding for datatype to another routine. * *------------------------------------------------------------------------- */ @@ -991,7 +1020,6 @@ 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) { @@ -1037,6 +1065,7 @@ 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++) @@ -1055,25 +1084,131 @@ print_dataset_info(const iter_t *iter) 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]); - 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; -} +} /* 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); + + return 0; +} /* print_attr_info() */ /*------------------------------------------------------------------------- @@ -1095,19 +1230,29 @@ print_file_statistics(const iter_t *iter) { if(display_all) { display_file = TRUE; - display_file_metadata = TRUE; display_group = TRUE; display_dset = TRUE; - display_dtype_metadata = TRUE; + display_dset_dtype_meta = 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); -} +} /* print_file_statistics() */ + /*------------------------------------------------------------------------- @@ -1130,7 +1275,7 @@ static void print_object_statistics(const char *name) { printf("Object name %s\n", name); -} +} /* print_object_statistics() */ /*------------------------------------------------------------------------- @@ -1156,15 +1301,25 @@ print_statistics(const char *name, const iter_t *iter) print_object_statistics(name); else print_file_statistics(iter); -} +} /* print_statistics() */ +/*------------------------------------------------------------------------- + * 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; + hid_t fcpl; /* file creation property id */ struct handler_t *hand; H5F_info_t finfo; @@ -1202,6 +1357,12 @@ 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; @@ -1230,5 +1391,5 @@ main(int argc, const char *argv[]) } leave(EXIT_SUCCESS); -} +} /* main() */ |