diff options
author | Allen Byrne <byrn@hdfgroup.org> | 2017-10-09 17:59:28 (GMT) |
---|---|---|
committer | Allen Byrne <byrn@hdfgroup.org> | 2017-10-09 17:59:28 (GMT) |
commit | daddf169b078f2c3982af513416e7f0f9208a211 (patch) | |
tree | 0fcf0403d46599b3867cb37fabae528215b97162 /tools/src/h5repack/h5repack.c | |
parent | a07d6b52fb0a231c2c6e60b1ae4d7550894c4b58 (diff) | |
download | hdf5-daddf169b078f2c3982af513416e7f0f9208a211.zip hdf5-daddf169b078f2c3982af513416e7f0f9208a211.tar.gz hdf5-daddf169b078f2c3982af513416e7f0f9208a211.tar.bz2 |
HDFFV-10297 - Fix test errors - five remaining
Diffstat (limited to 'tools/src/h5repack/h5repack.c')
-rw-r--r-- | tools/src/h5repack/h5repack.c | 91 |
1 files changed, 47 insertions, 44 deletions
diff --git a/tools/src/h5repack/h5repack.c b/tools/src/h5repack/h5repack.c index f34d466..6b8cf8a 100644 --- a/tools/src/h5repack/h5repack.c +++ b/tools/src/h5repack/h5repack.c @@ -693,6 +693,7 @@ static int check_objects(const char* fname, pack_opt_t *options) { hid_t did; hid_t sid; unsigned int i; + unsigned int uf; trav_table_t *travt = NULL; /* nothing to do */ @@ -740,52 +741,54 @@ static int check_objects(const char* fname, pack_opt_t *options) { if (options->verbose) printf("...Found\n"); - if (options->op_tbl->objs[i].filter->filtn < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "invalid filter"); - /* check for extra filter conditions */ - switch (options->op_tbl->objs[i].filter->filtn) { - /* chunk size must be smaller than pixels per block */ - case H5Z_FILTER_SZIP: - { - int j; - hsize_t csize = 1; - unsigned ppb = options->op_tbl->objs[i].filter->cd_values[0]; - hsize_t dims[H5S_MAX_RANK]; - int rank; - - if (options->op_tbl->objs[i].chunk.rank > 0) { - rank = options->op_tbl->objs[i].chunk.rank; - for (j = 0; j < rank; j++) - csize *= options->op_tbl->objs[i].chunk.chunk_lengths[j]; - } - else { - if ((did = H5Dopen2(fid, name, H5P_DEFAULT)) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dopen2 failed"); - if ((sid = H5Dget_space(did)) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dget_space failed"); - if ((rank = H5Sget_simple_extent_ndims(sid)) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Sget_simple_extent_ndims failed"); - HDmemset(dims, 0, sizeof dims); - if (H5Sget_simple_extent_dims(sid, dims, NULL) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Sget_simple_extent_dims failed"); - for (j = 0; j < rank; j++) - csize *= dims[j]; - if (H5Sclose(sid) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Sclose failed"); - if (H5Dclose(did) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dclose failed"); - } - - if (csize < ppb) { - printf(" <warning: SZIP settings, chunk size is smaller than pixels per block>\n"); - HGOTO_DONE(0); + for (uf = 0; uf < options->op_tbl->objs[i].nfilters; uf++) { + if (options->op_tbl->objs[i].filter[uf].filtn < 0) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "invalid filter"); + /* check for extra filter conditions */ + switch (options->op_tbl->objs[i].filter[uf].filtn) { + /* chunk size must be smaller than pixels per block */ + case H5Z_FILTER_SZIP: + { + int j; + hsize_t csize = 1; + unsigned ppb = options->op_tbl->objs[i].filter[uf].cd_values[0]; + hsize_t dims[H5S_MAX_RANK]; + int rank; + + if (options->op_tbl->objs[i].chunk.rank > 0) { + rank = options->op_tbl->objs[i].chunk.rank; + for (j = 0; j < rank; j++) + csize *= options->op_tbl->objs[i].chunk.chunk_lengths[j]; + } + else { + if ((did = H5Dopen2(fid, name, H5P_DEFAULT)) < 0) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dopen2 failed"); + if ((sid = H5Dget_space(did)) < 0) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dget_space failed"); + if ((rank = H5Sget_simple_extent_ndims(sid)) < 0) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Sget_simple_extent_ndims failed"); + HDmemset(dims, 0, sizeof dims); + if (H5Sget_simple_extent_dims(sid, dims, NULL) < 0) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Sget_simple_extent_dims failed"); + for (j = 0; j < rank; j++) + csize *= dims[j]; + if (H5Sclose(sid) < 0) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Sclose failed"); + if (H5Dclose(did) < 0) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dclose failed"); + } + + if (csize < ppb) { + printf(" <warning: SZIP settings, chunk size is smaller than pixels per block>\n"); + HGOTO_DONE(0); + } } + break; + default: + break; } - break; - default: - break; - } - } /* i */ + } /* for uf */ + } /* for i */ done: H5E_BEGIN_TRY { |