diff options
author | Jonathan Kim <jkm@hdfgroup.org> | 2012-09-24 23:13:57 (GMT) |
---|---|---|
committer | Jonathan Kim <jkm@hdfgroup.org> | 2012-09-24 23:13:57 (GMT) |
commit | 50e3990f2a9e3bba421460d8d5cb21bb6f6e98fe (patch) | |
tree | 764c642d62a1082e02cb0004871dc33b81dbff08 /tools/h5repack/h5repack_copy.c | |
parent | 528bd520b83136e9c50ac6cff4ac116fc8054e7a (diff) | |
download | hdf5-50e3990f2a9e3bba421460d8d5cb21bb6f6e98fe.zip hdf5-50e3990f2a9e3bba421460d8d5cb21bb6f6e98fe.tar.gz hdf5-50e3990f2a9e3bba421460d8d5cb21bb6f6e98fe.tar.bz2 |
[svn-r22805] Purpose:
HDFFV-8012 - h5repack changes max dims and cause failure if only "-f none" is used without changing layout for chunked dataset when a chunk dim is bigger than a dataset dim
Description:
"h5repack -f <obj>:NONE <file.h5> out.h5" command failed if source file contains chunked dataset and a chunk dim is bigger than a dataset dim.
Another issue is that the command changed max dims if chunk dim is smaller than the dataset dim.
These issue occurred when dataset size is smaller than 64k (compact size limit)
Fixed them.
Tested:
jam (linux32-LE), koala (linux64-LE), ostrich (linuxppc64-BE), tejeda (mac32-LE), linew (solaris-BE), Windows (32-LE cmake), cmake (jam)
Diffstat (limited to 'tools/h5repack/h5repack_copy.c')
-rw-r--r-- | tools/h5repack/h5repack_copy.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/tools/h5repack/h5repack_copy.c b/tools/h5repack/h5repack_copy.c index cf55d7f..02337fd 100644 --- a/tools/h5repack/h5repack_copy.c +++ b/tools/h5repack/h5repack_copy.c @@ -773,6 +773,7 @@ int do_copy_objects(hid_t fidin, void *hslab_buf=NULL; /* hyperslab buffer for raw data */ int has_filter; /* current object has a filter */ int req_filter; /* there was a request for a filter */ + int req_obj_layout=0; /* request layout to current object */ unsigned crt_order_flags; /* group creation order flag */ unsigned i; unsigned u; @@ -904,6 +905,22 @@ int do_copy_objects(hid_t fidin, } } + /* check if layout change requested individual object */ + if (options->layout_g != H5D_LAYOUT_ERROR) + { + pack_info_t *pckinfo; + /* any dataset is specified */ + if (options->op_tbl->nelems > 0) + { + /* check if object exist */ + pckinfo = options_get_object (travt->objs[i].name, options->op_tbl); + if (pckinfo) + { + req_obj_layout = 1; + } + } + } + /* early detection of references */ if((dset_in = H5Dopen2(fidin, travt->objs[i].name, H5P_DEFAULT)) < 0) goto error; @@ -1023,6 +1040,9 @@ int do_copy_objects(hid_t fidin, goto error; } + /* only if layout change requested for entire file or + * individual obj */ + if (options->all_layout > 0 || req_obj_layout == 1) /*------------------------------------------------- * Unset the unlimited max dims if convert to other * than chunk layouts, because unlimited max dims |