summaryrefslogtreecommitdiffstats
path: root/tools/h5dump/h5dump.c
diff options
context:
space:
mode:
authorScot Breitenfeld <brtnfld@hdfgroup.org>2008-04-30 19:23:26 (GMT)
committerScot Breitenfeld <brtnfld@hdfgroup.org>2008-04-30 19:23:26 (GMT)
commit5773fd34bc5adf59b4530d95ac9f0c0585902803 (patch)
tree456ad239799382e1f083fb7fc74399e43b471912 /tools/h5dump/h5dump.c
parent0138995d1ce2068db1f790503435a2121132d3ad (diff)
downloadhdf5-5773fd34bc5adf59b4530d95ac9f0c0585902803.zip
hdf5-5773fd34bc5adf59b4530d95ac9f0c0585902803.tar.gz
hdf5-5773fd34bc5adf59b4530d95ac9f0c0585902803.tar.bz2
[svn-r14902] Merged fortran_1_8 branch changes r14505:14901 into the trunk. New fortran wrappers added.
Diffstat (limited to 'tools/h5dump/h5dump.c')
-rw-r--r--tools/h5dump/h5dump.c83
1 files changed, 6 insertions, 77 deletions
diff --git a/tools/h5dump/h5dump.c b/tools/h5dump/h5dump.c
index 2389ef4..70d889f 100644
--- a/tools/h5dump/h5dump.c
+++ b/tools/h5dump/h5dump.c
@@ -2440,9 +2440,6 @@ static void dump_fill_value(hid_t dcpl,hid_t type_id, hid_t obj_id)
*
* Programmer: pvn
*
- * Modifications: pvn, March 28, 2008
- * Add a COMPRESSION ratio information for cases when filters are present
- *
*-------------------------------------------------------------------------
*/
static void
@@ -2458,7 +2455,7 @@ dump_dcpl(hid_t dcpl_id,hid_t type_id, hid_t obj_id)
unsigned szip_pixels_per_block;
hsize_t chsize[64]; /* chunk size in elements */
int rank; /* rank */
- char name[256]; /* external file name */
+ char name[256]; /* external file name */
off_t offset; /* offset of external file */
hsize_t size; /* size of external file */
H5D_fill_value_t fvstatus;
@@ -2470,12 +2467,11 @@ dump_dcpl(hid_t dcpl_id,hid_t type_id, hid_t obj_id)
unsigned j;
storage_size=H5Dget_storage_size(obj_id);
- nfilters = H5Pget_nfilters(dcpl_id);
ioffset=H5Dget_offset(obj_id);
next=H5Pget_external_count(dcpl_id);
strcpy(f_name,"\0");
- /*-------------------------------------------------------------------------
+ /*-------------------------------------------------------------------------
* STORAGE_LAYOUT
*-------------------------------------------------------------------------
*/
@@ -2494,72 +2490,7 @@ dump_dcpl(hid_t dcpl_id,hid_t type_id, hid_t obj_id)
HDfprintf(stdout, ", %Hu", chsize[i]);
printf(" %s\n", dump_header_format->dataspacedimend);
indentation(indent + COL);
-
-
- /* if there are filters, print a compression ratio */
- if ( nfilters )
- {
-
- hid_t sid = H5Dget_space( obj_id );
- hid_t tid = H5Dget_type( obj_id );
- size_t datum_size = H5Tget_size( tid );
- hsize_t dims[H5S_MAX_RANK];
- int ndims = H5Sget_simple_extent_dims( sid, dims, NULL);
- hsize_t nelmts = 1;
- hsize_t size;
- double per = 0;
- hssize_t a, b;
- int ok = 0;
-
- /* only print the compression ratio for these filters */
- for ( i = 0; i < nfilters; i++)
- {
- cd_nelmts = NELMTS(cd_values);
- filtn = H5Pget_filter2(dcpl_id, (unsigned)i, &filt_flags, &cd_nelmts,
- cd_values, sizeof(f_name), f_name, NULL);
-
- switch (filtn)
- {
- case H5Z_FILTER_DEFLATE:
- case H5Z_FILTER_SZIP:
- case H5Z_FILTER_NBIT:
- case H5Z_FILTER_SCALEOFFSET:
- ok = 1;
- break;
- }
- }
-
- if (ndims && ok )
- {
-
- for (i = 0; i < ndims; i++)
- {
- nelmts *= dims[i];
- }
- size = nelmts * datum_size;
-
- a = size; b = storage_size;
- if (a!=0)
- per = (double) (b-a)/a;
-
- per = -per;
- per *=100;
-
- HDfprintf(stdout, "SIZE %Hu (%.1f%%COMPRESSION)\n ", storage_size, per);
-
- }
- else
- HDfprintf(stdout, "SIZE %Hu\n ", storage_size);
-
-
- H5Sclose(sid);
- H5Tclose(tid);
-
- }
- else
- {
- HDfprintf(stdout, "SIZE %Hu\n ", storage_size);
- }
+ HDfprintf(stdout, "SIZE %Hu\n ", storage_size);
/*end indent */
indent -= COL;
@@ -2632,16 +2563,14 @@ dump_dcpl(hid_t dcpl_id,hid_t type_id, hid_t obj_id)
* FILTERS
*-------------------------------------------------------------------------
*/
-
+ nfilters = H5Pget_nfilters(dcpl_id);
indentation(indent + COL);
printf("%s %s\n", FILTERS, BEGIN);
indent += COL;
- if (nfilters)
- {
- for (i=0; i<nfilters; i++)
- {
+ if (nfilters) {
+ for (i=0; i<nfilters; i++) {
cd_nelmts = NELMTS(cd_values);
filtn = H5Pget_filter2(dcpl_id, (unsigned)i, &filt_flags, &cd_nelmts,
cd_values, sizeof(f_name), f_name, NULL);