summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAllen Byrne <50328838+byrnHDF@users.noreply.github.com>2022-12-02 17:39:49 (GMT)
committerGitHub <noreply@github.com>2022-12-02 17:39:49 (GMT)
commit88b24c258b8d938ab19eb015d019162bd66d5be6 (patch)
tree044dd5d06588c9ec34848863361cb7b45fdb6f7c
parent4e0277c35a5a6e8eb84058a905efa06bb3915985 (diff)
downloadhdf5-88b24c258b8d938ab19eb015d019162bd66d5be6.zip
hdf5-88b24c258b8d938ab19eb015d019162bd66d5be6.tar.gz
hdf5-88b24c258b8d938ab19eb015d019162bd66d5be6.tar.bz2
Output should only be printed if verbose. (#2273)
* Output should only be printed if verbose. * Add note
-rw-r--r--release_docs/RELEASE.txt7
-rw-r--r--tools/src/h5repack/h5repack_copy.c62
2 files changed, 42 insertions, 27 deletions
diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt
index 7013cbc..8709686 100644
--- a/release_docs/RELEASE.txt
+++ b/release_docs/RELEASE.txt
@@ -270,7 +270,12 @@ Bug Fixes since HDF5-1.13.3 release
Tools
-----
- -
+ - Fix h5repack to only print output when verbose option is selected
+
+ When timing option was added to h5repack, the check for verbose was
+ incorrectly implemented.
+
+ (ADB - 2022/12/02, GH #2270)
Performance
diff --git a/tools/src/h5repack/h5repack_copy.c b/tools/src/h5repack/h5repack_copy.c
index a3f4047..42c393b 100644
--- a/tools/src/h5repack/h5repack_copy.c
+++ b/tools/src/h5repack/h5repack_copy.c
@@ -665,15 +665,17 @@ do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt, pack_opt_t *opti
*-------------------------------------------------------------------------
*/
- if (options->verbose == 2) {
- HDprintf("-----------------------------------------------------------------\n");
- HDprintf(" Type Filter (Compression) Timing read/write Name\n");
- HDprintf("-----------------------------------------------------------------\n");
- }
- else {
- HDprintf("-----------------------------------------\n");
- HDprintf(" Type Filter (Compression) Name\n");
- HDprintf("-----------------------------------------\n");
+ if (options->verbose > 0) {
+ if (options->verbose == 2) {
+ HDprintf("-----------------------------------------------------------------\n");
+ HDprintf(" Type Filter (Compression) Timing read/write Name\n");
+ HDprintf("-----------------------------------------------------------------\n");
+ }
+ else {
+ HDprintf("-----------------------------------------\n");
+ HDprintf(" Type Filter (Compression) Name\n");
+ HDprintf("-----------------------------------------\n");
+ }
}
if (travt->objs) {
@@ -691,10 +693,12 @@ do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt, pack_opt_t *opti
*-------------------------------------------------------------------------
*/
case H5TRAV_TYPE_GROUP:
- if (options->verbose == 2)
- HDprintf(FORMAT_OBJ_NOTIME, "group", travt->objs[i].name);
- else
- HDprintf(FORMAT_OBJ, "group", travt->objs[i].name);
+ if (options->verbose > 0) {
+ if (options->verbose == 2)
+ HDprintf(FORMAT_OBJ_NOTIME, "group", travt->objs[i].name);
+ else
+ HDprintf(FORMAT_OBJ, "group", travt->objs[i].name);
+ }
/* open input group */
if ((grp_in = H5Gopen2(fidin, travt->objs[i].name, H5P_DEFAULT)) < 0)
@@ -1198,7 +1202,7 @@ do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt, pack_opt_t *opti
if (options->verbose > 0) {
double ratio = 0;
- /* only print the compression ration if there was a filter request */
+ /* only print the compression ratio if there was a filter request */
if (apply_s && apply_f && req_filter) {
/* get the storage size of the output dataset */
dsize_out = H5Dget_storage_size(dset_out);
@@ -1304,10 +1308,12 @@ do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt, pack_opt_t *opti
if (H5Dclose(dset_out) < 0)
H5TOOLS_GOTO_ERROR((-1), "H5Dclose failed");
- if (options->verbose == 2)
- HDprintf(FORMAT_OBJ_TIME, "dset", 0.0, write_time, travt->objs[i].name);
- else
- HDprintf(FORMAT_OBJ, "dset", travt->objs[i].name);
+ if (options->verbose > 0) {
+ if (options->verbose == 2)
+ HDprintf(FORMAT_OBJ_TIME, "dset", 0.0, write_time, travt->objs[i].name);
+ else
+ HDprintf(FORMAT_OBJ, "dset", travt->objs[i].name);
+ }
} /* end whether we have request for filter/chunking */
@@ -1319,10 +1325,12 @@ do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt, pack_opt_t *opti
*-------------------------------------------------------------------------
*/
case H5TRAV_TYPE_NAMED_DATATYPE:
- if (options->verbose == 2)
- HDprintf(FORMAT_OBJ_NOTIME, "type", travt->objs[i].name);
- else
- HDprintf(FORMAT_OBJ, "type", travt->objs[i].name);
+ if (options->verbose > 0) {
+ if (options->verbose == 2)
+ HDprintf(FORMAT_OBJ_NOTIME, "type", travt->objs[i].name);
+ else
+ HDprintf(FORMAT_OBJ, "type", travt->objs[i].name);
+ }
if ((type_in = H5Topen2(fidin, travt->objs[i].name, H5P_DEFAULT)) < 0)
H5TOOLS_GOTO_ERROR((-1), "H5Topen2 failed");
@@ -1361,10 +1369,12 @@ do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt, pack_opt_t *opti
*/
case H5TRAV_TYPE_LINK:
case H5TRAV_TYPE_UDLINK:
- if (options->verbose == 2)
- HDprintf(FORMAT_OBJ_NOTIME, "link", travt->objs[i].name);
- else
- HDprintf(FORMAT_OBJ, "link", travt->objs[i].name);
+ if (options->verbose > 0) {
+ if (options->verbose == 2)
+ HDprintf(FORMAT_OBJ_NOTIME, "link", travt->objs[i].name);
+ else
+ HDprintf(FORMAT_OBJ, "link", travt->objs[i].name);
+ }
/* Check -X option. */
if (options->merge) {