summaryrefslogtreecommitdiffstats
path: root/tools/h5repack/h5repack_filters.c
diff options
context:
space:
mode:
authorPedro Vicente Nunes <pvn@hdfgroup.org>2004-10-18 16:42:12 (GMT)
committerPedro Vicente Nunes <pvn@hdfgroup.org>2004-10-18 16:42:12 (GMT)
commitd8fdc955cc9cf13c6778a55c3502f2a7089ae472 (patch)
treecdf33b5051a2ff7a36da502af88fc9631e0d7c1e /tools/h5repack/h5repack_filters.c
parent1de960855f489baa174b77cff15c46a84a55d201 (diff)
downloadhdf5-d8fdc955cc9cf13c6778a55c3502f2a7089ae472.zip
hdf5-d8fdc955cc9cf13c6778a55c3502f2a7089ae472.tar.gz
hdf5-d8fdc955cc9cf13c6778a55c3502f2a7089ae472.tar.bz2
[svn-r9428] Purpose:
bug fix Description: when specifying both an input object e.g -f mydset:GZIP=1 and a defined chunk -l CHUNK=20x20 the filter used a defined default chunk instead Solution: add a check for the input chunk Platforms tested: linux (small change) Misc. update:
Diffstat (limited to 'tools/h5repack/h5repack_filters.c')
-rw-r--r--tools/h5repack/h5repack_filters.c29
1 files changed, 19 insertions, 10 deletions
diff --git a/tools/h5repack/h5repack_filters.c b/tools/h5repack/h5repack_filters.c
index b506b16..5056a3f 100644
--- a/tools/h5repack/h5repack_filters.c
+++ b/tools/h5repack/h5repack_filters.c
@@ -116,6 +116,7 @@ int apply_filters(const char* name, /* object name from traverse list */
hid_t dcpl_id, /* dataset creation property list */
hid_t type_id, /* dataset datatype */
pack_opt_t *options, /* repack options */
+ int has_layout, /* input chunk */
pack_info_t *obj) /* info about object to filter */
{
int nfilters; /* number of filters in DCPL */
@@ -131,6 +132,22 @@ int apply_filters(const char* name, /* object name from traverse list */
if (rank==0)
goto out;
+/*-------------------------------------------------------------------------
+ * filters require CHUNK layout; if we do not have one define a default
+ *-------------------------------------------------------------------------
+ */
+ if (has_layout)
+ {
+ layout_this(dcpl_id,name,options,obj);
+ }
+ else
+ {
+ obj->chunk.rank=rank;
+ for (i=0; i<rank; i++)
+ obj->chunk.chunk_lengths[i] = dims[i];
+ }
+
+
/* check for datasets too small */
if ((size=H5Tget_size(type_id))==0)
return 0;
@@ -157,16 +174,8 @@ int apply_filters(const char* name, /* object name from traverse list */
if (H5Premove_filter(dcpl_id,H5Z_FILTER_ALL)<0)
return -1;
}
-/*-------------------------------------------------------------------------
- * filters require CHUNK layout; if we do not have one define a default
- *-------------------------------------------------------------------------
- */
- if (obj->chunk.rank<=0)
- {
- obj->chunk.rank=rank;
- for (i=0; i<rank; i++)
- obj->chunk.chunk_lengths[i] = dims[i];
- }
+
+
/*-------------------------------------------------------------------------
* the type of filter and additional parameter