summaryrefslogtreecommitdiffstats
path: root/tools/h5repack/h5repack_copy.c
diff options
context:
space:
mode:
authorJonathan Kim <jkm@hdfgroup.org>2012-09-26 18:10:01 (GMT)
committerJonathan Kim <jkm@hdfgroup.org>2012-09-26 18:10:01 (GMT)
commit06e9ab4420adb7a6ae04514adcb134d27114e410 (patch)
tree493a66696596e465c5d780b2cb9854c7efa31781 /tools/h5repack/h5repack_copy.c
parent87271a753ddd14a32959f11a19fb1e44d745daf5 (diff)
downloadhdf5-06e9ab4420adb7a6ae04514adcb134d27114e410.zip
hdf5-06e9ab4420adb7a6ae04514adcb134d27114e410.tar.gz
hdf5-06e9ab4420adb7a6ae04514adcb134d27114e410.tar.bz2
[svn-r22814] 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. Merged from HDF5 trunk r22805 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.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/tools/h5repack/h5repack_copy.c b/tools/h5repack/h5repack_copy.c
index 94bd565..cfd542a 100644
--- a/tools/h5repack/h5repack_copy.c
+++ b/tools/h5repack/h5repack_copy.c
@@ -732,6 +732,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;
@@ -863,6 +864,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;
@@ -982,6 +999,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