From e6310e08692c631e95a9d827a0f7ec0ddf12d82a Mon Sep 17 00:00:00 2001 From: Pedro Vicente Nunes Date: Thu, 6 Apr 2006 16:14:01 -0500 Subject: [svn-r12208] Purpose: new feature Description: some more formatting for the new printout of compression ratios Solution: Platforms tested: linux solaris AIX Misc. update: --- tools/h5repack/h5repack.h | 3 ++- tools/h5repack/h5repack_copy.c | 10 ++++++---- tools/h5repack/h5repack_filters.c | 12 ++++++++++-- tools/h5repack/h5repack_list.c | 2 +- 4 files changed, 19 insertions(+), 8 deletions(-) diff --git a/tools/h5repack/h5repack.h b/tools/h5repack/h5repack.h index e835b66..c4e70db 100644 --- a/tools/h5repack/h5repack.h +++ b/tools/h5repack/h5repack.h @@ -185,7 +185,8 @@ int apply_filters(const char* name, /* object name from traverse list */ hsize_t *dims, /* dimensions of dataset */ hid_t dcpl_id, /* dataset creation property list */ hid_t type_id, /* datatype */ - pack_opt_t *options); /* repack options */ + pack_opt_t *options, /* repack options */ + int *apply_f); int has_filter(hid_t dcpl_id, H5Z_filter_t filtnin); diff --git a/tools/h5repack/h5repack_copy.c b/tools/h5repack/h5repack_copy.c index 82553d5..666a7fa 100644 --- a/tools/h5repack/h5repack_copy.c +++ b/tools/h5repack/h5repack_copy.c @@ -375,7 +375,7 @@ int do_copy_objects(hid_t fidin, goto error; if (next) - fprintf(stderr,"warning: <%s> has external files, ignoring read...\n", + fprintf(stderr," \n", travt->objs[i].name ); /*------------------------------------------------------------------------- @@ -387,6 +387,8 @@ int do_copy_objects(hid_t fidin, */ if (next==0 && h5tools_canreadf((travt->objs[i].name),dcpl_id)==1) { + apply_s=1; + apply_f=1; /*------------------------------------------------------------------------- * references are a special case @@ -417,7 +419,7 @@ int do_copy_objects(hid_t fidin, * check for datasets too small *------------------------------------------------------------------------- */ - apply_s=1; + if (nelmts*msize < options->threshold ) apply_s=0; @@ -426,7 +428,7 @@ int do_copy_objects(hid_t fidin, *------------------------------------------------------------------------- */ if (apply_s){ - if (apply_filters(travt->objs[i].name,rank,dims,dcpl_out,mtype_id,options)<0) + if (apply_filters(travt->objs[i].name,rank,dims,dcpl_out,mtype_id,options,&apply_f)<0) goto error; } @@ -443,7 +445,7 @@ int do_copy_objects(hid_t fidin, dset_out=H5Dcreate(fidout,travt->objs[i].name,mtype_id,space_id,dcpl_out); } H5E_END_TRY; - apply_f=1; + if (dset_out==FAIL) { if ((dset_out=H5Dcreate(fidout,travt->objs[i].name,mtype_id,space_id,dcpl_id))<0) diff --git a/tools/h5repack/h5repack_filters.c b/tools/h5repack/h5repack_filters.c index 1cd6955..a3ba70d 100644 --- a/tools/h5repack/h5repack_filters.c +++ b/tools/h5repack/h5repack_filters.c @@ -191,7 +191,8 @@ int apply_filters(const char* name, /* object name from traverse list */ hsize_t *dims, /* dimensions of dataset */ hid_t dcpl_id, /* dataset creation property list */ hid_t type_id, /* dataset datatype */ - pack_opt_t *options) /* repack options */ + pack_opt_t *options, /* repack options */ + int *apply_f) { int nfilters; /* number of filters in DCPL */ hsize_t chsize[64]; /* chunk size in elements */ @@ -199,6 +200,12 @@ int apply_filters(const char* name, /* object name from traverse list */ int i; pack_info_t obj; + if (rank==0) + { + *apply_f=0; + return 0; + } + /*------------------------------------------------------------------------- * initialize the assigment object *------------------------------------------------------------------------- @@ -400,7 +407,6 @@ int apply_filters(const char* name, /* object name from traverse list */ } return 0; - } @@ -466,6 +472,8 @@ int print_filters(hid_t dcpl_id) } return 0; + + } diff --git a/tools/h5repack/h5repack_list.c b/tools/h5repack/h5repack_list.c index 7831380..f2eb2c9 100644 --- a/tools/h5repack/h5repack_list.c +++ b/tools/h5repack/h5repack_list.c @@ -133,7 +133,7 @@ int check_objects(const char* fname, if (csize < ppb ) { - printf("warning: SZIP settins, chunk size is smaller than pixels per block...Exiting\n"); + printf(" \n"); goto out; } -- cgit v0.12