summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.github/workflows/clang-format-check.yml2
-rw-r--r--.github/workflows/clang-format-fix.yml2
-rw-r--r--release_docs/RELEASE.txt7
-rw-r--r--tools/src/h5repack/h5repack_copy.c64
-rw-r--r--tools/test/h5dump/CMakeTests.cmake2
5 files changed, 46 insertions, 31 deletions
diff --git a/.github/workflows/clang-format-check.yml b/.github/workflows/clang-format-check.yml
index 2d7943c..e8251f2 100644
--- a/.github/workflows/clang-format-check.yml
+++ b/.github/workflows/clang-format-check.yml
@@ -7,7 +7,7 @@ jobs:
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, 'skip-ci')"
steps:
- - uses: actions/checkout@v2
+ - uses: actions/checkout@v3
- name: Run clang-format style check for C and Java programs.
uses: DoozyX/clang-format-lint-action@v0.13
with:
diff --git a/.github/workflows/clang-format-fix.yml b/.github/workflows/clang-format-fix.yml
index a390a8b..c1110cf 100644
--- a/.github/workflows/clang-format-fix.yml
+++ b/.github/workflows/clang-format-fix.yml
@@ -8,7 +8,7 @@ jobs:
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, 'skip-ci')"
steps:
- - uses: actions/checkout@v2
+ - uses: actions/checkout@v3
- name: Run clang-format style check for C and Java programs.
uses: DoozyX/clang-format-lint-action@v0.13
with:
diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt
index 292f531..f91c5ea 100644
--- a/release_docs/RELEASE.txt
+++ b/release_docs/RELEASE.txt
@@ -239,7 +239,12 @@ Bug Fixes since HDF5-1.10.9 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 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)