diff options
author | Jacob Smith <jake.smith@hdfgroup.org> | 2019-05-31 22:24:26 (GMT) |
---|---|---|
committer | Jacob Smith <jake.smith@hdfgroup.org> | 2019-05-31 22:24:26 (GMT) |
commit | ad2a7f47896cf636b42fbc73b96781b2d5200f56 (patch) | |
tree | aa26349968b764368cf1976608f1da1d88752767 /tools/src/h5repack/h5repack_copy.c | |
parent | cb6029196af9a960872c627db53fcbc4cf89d923 (diff) | |
download | hdf5-ad2a7f47896cf636b42fbc73b96781b2d5200f56.zip hdf5-ad2a7f47896cf636b42fbc73b96781b2d5200f56.tar.gz hdf5-ad2a7f47896cf636b42fbc73b96781b2d5200f56.tar.bz2 |
First pass at repack consolidating external storage if layout given.
Checks out manually, tests still complain.
Diffstat (limited to 'tools/src/h5repack/h5repack_copy.c')
-rw-r--r-- | tools/src/h5repack/h5repack_copy.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/tools/src/h5repack/h5repack_copy.c b/tools/src/h5repack/h5repack_copy.c index 544793a..c638f3d 100644 --- a/tools/src/h5repack/h5repack_copy.c +++ b/tools/src/h5repack/h5repack_copy.c @@ -807,8 +807,17 @@ do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt, HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dget_type failed"); if ((dcpl_in = H5Dget_create_plist(dset_in)) < 0) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dget_create_plist failed"); - if ((dcpl_out = H5Pcopy(dcpl_in)) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pcopy failed"); + /* If the input dataset has external storage, it must be contiguous. + * Accordingly, there would be no filter or chunk properties to preserve. + */ + if (H5Pget_external_count(dcpl_in)) { + if ((dcpl_out = H5Pcreate(H5P_DATASET_CREATE)) < 0) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pcreate failed"); + } + else { + if ((dcpl_out = H5Pcopy(dcpl_in)) < 0) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pcopy failed"); + } if ((rank = H5Sget_simple_extent_ndims(f_space_id)) < 0) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Sget_simple_extent_ndims failed"); HDmemset(dims, 0, sizeof dims); @@ -1175,7 +1184,7 @@ do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt, HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dclose failed"); } /*------------------------------------------------------------------------- - * we do not have request for filter/chunking use H5Ocopy instead + * we do not have request for filter/chunking; use H5Ocopy instead *------------------------------------------------------------------------- */ else { |