From 0d912d463206762d8dfe5fa46fd2318b1ee50123 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 21 Feb 2018 16:23:07 -0600 Subject: HDFFV-10412 moved check back into normal path --- release_docs/RELEASE.txt | 12 +++++++++++ tools/src/h5repack/h5repack_filters.c | 40 +++++++++++++++++------------------ 2 files changed, 32 insertions(+), 20 deletions(-) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index e7186c5..4675423 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -310,6 +310,18 @@ Bug Fixes since HDF5-1.10.1 release Tools ----- + - h5repack + + h5repack changes the chunk parameters when a change of layout is not + specified and a filter is applied. + + HDFFV-10297, HDFFV-10319 reworked code for h5repack and h5diff code + in the tools library. The check for an existing layout was incorrectly + placed into an if block and not executed. The check was moved into + the normal path of the function. + + (ADB - 2018/02/21, HDFFV-10412) + - h5dump the tools library will hide the error stack during file open. diff --git a/tools/src/h5repack/h5repack_filters.c b/tools/src/h5repack/h5repack_filters.c index ae0bfd5..253be6d 100644 --- a/tools/src/h5repack/h5repack_filters.c +++ b/tools/src/h5repack/h5repack_filters.c @@ -280,33 +280,33 @@ int apply_filters(const char* name, /* object name from traverse list */ *has_filter = 1; if (H5Premove_filter(dcpl_id, H5Z_FILTER_ALL) < 0) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Premove_filter failed"); - - /*------------------------------------------------------------------------- - * check if there is an existent chunk - * read it only if there is not a requested layout - *------------------------------------------------------------------------- - */ - if (obj.layout == -1) { - if ((layout = H5Pget_layout(dcpl_id)) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pget_layout failed"); - - if (layout == H5D_CHUNKED) { - if ((rank = H5Pget_chunk(dcpl_id, NELMTS(chsize), chsize/*out*/)) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pget_chunk failed"); - obj.layout = H5D_CHUNKED; - obj.chunk.rank = rank; - for (i = 0; i < rank; i++) - obj.chunk.chunk_lengths[i] = chsize[i]; - } - } } else if(nfilters) { - *has_filter = 1; + *has_filter = 1; if (aux_copy_obj(dcpl_id, name, &filtobj) < 0) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "aux_copy_obj failed"); } /*------------------------------------------------------------------------- + * check if there is an existent chunk + * read it only if there is not a requested layout + *------------------------------------------------------------------------- + */ + if (obj.layout == -1) { + if ((layout = H5Pget_layout(dcpl_id)) < 0) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pget_layout failed"); + + if (layout == H5D_CHUNKED) { + if ((rank = H5Pget_chunk(dcpl_id, NELMTS(chsize), chsize/*out*/)) < 0) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pget_chunk failed"); + obj.layout = H5D_CHUNKED; + obj.chunk.rank = rank; + for (i = 0; i < rank; i++) + obj.chunk.chunk_lengths[i] = chsize[i]; + } + } + + /*------------------------------------------------------------------------- * the type of filter and additional parameter * type can be one of the filters * H5Z_FILTER_NONE 0 , uncompress if compressed -- cgit v0.12 From b996ee29726b820869776620c6a9f496c4823762 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 21 Feb 2018 16:29:41 -0600 Subject: HDFFV-10412 fix typo --- tools/src/h5repack/h5repack_filters.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/src/h5repack/h5repack_filters.c b/tools/src/h5repack/h5repack_filters.c index 253be6d..0092abc 100644 --- a/tools/src/h5repack/h5repack_filters.c +++ b/tools/src/h5repack/h5repack_filters.c @@ -282,7 +282,7 @@ int apply_filters(const char* name, /* object name from traverse list */ HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Premove_filter failed"); } else if(nfilters) { - *has_filter = 1; + *has_filter = 1; if (aux_copy_obj(dcpl_id, name, &filtobj) < 0) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "aux_copy_obj failed"); } -- cgit v0.12 From 76a0003f96f8e1336062089380adc95f8b3dee56 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 22 Feb 2018 10:18:17 -0600 Subject: HDFFV-10412 update test ref files --- tools/test/h5repack/testfiles/deflate_limit.h5repack_layout.h5.ddl | 4 ++-- tools/test/h5repack/testfiles/h5repack_layout.h5-plugin_test.ddl | 2 +- .../h5repack/testfiles/h5repack_layout.h5-plugin_version_test.ddl | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/test/h5repack/testfiles/deflate_limit.h5repack_layout.h5.ddl b/tools/test/h5repack/testfiles/deflate_limit.h5repack_layout.h5.ddl index 1dcc742..75f54fa 100644 --- a/tools/test/h5repack/testfiles/deflate_limit.h5repack_layout.h5.ddl +++ b/tools/test/h5repack/testfiles/deflate_limit.h5repack_layout.h5.ddl @@ -76,8 +76,8 @@ GROUP "/" { DATATYPE H5T_STD_I32LE DATASPACE SIMPLE { ( 40, 20 ) / ( 40, 20 ) } STORAGE_LAYOUT { - CHUNKED ( 40, 20 ) - SIZE 1150 (2.783:1 COMPRESSION) + CHUNKED ( 20, 10 ) + SIZE 1283 (2.494:1 COMPRESSION) } FILTERS { COMPRESSION DEFLATE { LEVEL 1 } diff --git a/tools/test/h5repack/testfiles/h5repack_layout.h5-plugin_test.ddl b/tools/test/h5repack/testfiles/h5repack_layout.h5-plugin_test.ddl index 4856f84..a8b4562 100644 --- a/tools/test/h5repack/testfiles/h5repack_layout.h5-plugin_test.ddl +++ b/tools/test/h5repack/testfiles/h5repack_layout.h5-plugin_test.ddl @@ -92,7 +92,7 @@ GROUP "/" { DATATYPE H5T_STD_I32LE DATASPACE SIMPLE { ( 40, 20 ) / ( 40, 20 ) } STORAGE_LAYOUT { - CHUNKED ( 40, 20 ) + CHUNKED ( 20, 10 ) SIZE 3200 (1.000:1 COMPRESSION) } FILTERS { diff --git a/tools/test/h5repack/testfiles/h5repack_layout.h5-plugin_version_test.ddl b/tools/test/h5repack/testfiles/h5repack_layout.h5-plugin_version_test.ddl index 5a1ebe7..a1fc0cb 100644 --- a/tools/test/h5repack/testfiles/h5repack_layout.h5-plugin_version_test.ddl +++ b/tools/test/h5repack/testfiles/h5repack_layout.h5-plugin_version_test.ddl @@ -92,7 +92,7 @@ GROUP "/" { DATATYPE H5T_STD_I32LE DATASPACE SIMPLE { ( 40, 20 ) / ( 40, 20 ) } STORAGE_LAYOUT { - CHUNKED ( 40, 20 ) + CHUNKED ( 20, 10 ) SIZE 3200 (1.000:1 COMPRESSION) } FILTERS { -- cgit v0.12