summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorAllen Byrne <50328838+byrnHDF@users.noreply.github.com>2023-02-13 14:04:56 (GMT)
committerGitHub <noreply@github.com>2023-02-13 14:04:56 (GMT)
commit09d21433abc3bd488764711754c1c9dce44161d2 (patch)
treea848b6d61df29829d8aa7142df1ace4e9c4b2e7d /tools
parenta4e797b4d1ca9cdc8dd2d77cefa310647666c902 (diff)
downloadhdf5-09d21433abc3bd488764711754c1c9dce44161d2.zip
hdf5-09d21433abc3bd488764711754c1c9dce44161d2.tar.gz
hdf5-09d21433abc3bd488764711754c1c9dce44161d2.tar.bz2
1.10 h5repack should only print if verbose (#2275)
--------- Co-authored-by: Larry Knox <lrknox@hdfgroup.org>
Diffstat (limited to 'tools')
-rw-r--r--tools/src/h5repack/h5repack_copy.c64
-rw-r--r--tools/test/h5dump/CMakeTests.cmake2
2 files changed, 38 insertions, 28 deletions
diff --git a/tools/src/h5repack/h5repack_copy.c b/tools/src/h5repack/h5repack_copy.c
index 45c4f1d..b039604 100644
--- a/tools/src/h5repack/h5repack_copy.c
+++ b/tools/src/h5repack/h5repack_copy.c
@@ -441,7 +441,7 @@ get_hyperslab(hid_t dcpl_id, int rank_dset, const hsize_t dims_dset[], size_t si
hsize_t dims_chunk[H5S_MAX_RANK];
hsize_t size_chunk = 1;
hsize_t nchunk_fit; /* number of chunks that fits in hyperslab buffer (H5TOOLS_BUFSIZE) */
- hsize_t ndatum_fit; /* number of dataum that fits in hyperslab buffer (H5TOOLS_BUFSIZE) */
+ hsize_t ndatum_fit; /* number of datum that fits in hyperslab buffer (H5TOOLS_BUFSIZE) */
hsize_t chunk_dims_map[H5S_MAX_RANK]; /* mapped chunk dimensions */
hsize_t hs_dims_map[H5S_MAX_RANK]; /* mapped hyperslab dimensions */
hsize_t hslab_nbytes; /* size of hyperslab in byte */
@@ -666,15 +666,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) {
@@ -692,10 +694,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)
@@ -1164,7 +1168,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);
@@ -1270,10 +1274,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 */
@@ -1285,10 +1291,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");
@@ -1327,10 +1335,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) {
diff --git a/tools/test/h5dump/CMakeTests.cmake b/tools/test/h5dump/CMakeTests.cmake
index 47ec1e4..8dc815a 100644
--- a/tools/test/h5dump/CMakeTests.cmake
+++ b/tools/test/h5dump/CMakeTests.cmake
@@ -1121,7 +1121,7 @@
ADD_H5ERR_MASK_TEST (torderlinks2 0 "unable to open external file, external link file name = 'fname'" --enable-error-stack --sort_by=name --sort_order=descending tfcontents1.h5)
# tests for floating point user defined printf format
- ADD_H5_TEST (tfpformat 0 --enable-error-stack -m %.7f tfpformat.h5)
+ ADD_H5_TEST (tfpformat 0 --enable-error-stack --format=%.7f tfpformat.h5)
# tests for traversal of external links
ADD_H5ERR_MASK_TEST (textlinksrc 0 "Too many soft links in path" --enable-error-stack textlinksrc.h5)