summaryrefslogtreecommitdiffstats
path: root/tools/h5repack/h5repack_filters.c
diff options
context:
space:
mode:
authorPedro Vicente Nunes <pvn@hdfgroup.org>2005-02-14 19:25:23 (GMT)
committerPedro Vicente Nunes <pvn@hdfgroup.org>2005-02-14 19:25:23 (GMT)
commitd308ee9e68863c3bd7424fd3215d38ab4c1a9156 (patch)
tree867889735ace163fb0a8db8eddeeac85f0b46558 /tools/h5repack/h5repack_filters.c
parent2d481178177f5be801838a1c661642d2883d8f13 (diff)
downloadhdf5-d308ee9e68863c3bd7424fd3215d38ab4c1a9156.zip
hdf5-d308ee9e68863c3bd7424fd3215d38ab4c1a9156.tar.gz
hdf5-d308ee9e68863c3bd7424fd3215d38ab4c1a9156.tar.bz2
[svn-r10000] Purpose:
bug fix Description: in 1 case when there was not a requested layout, the original chunk was not preserved Solution: Platforms tested: linux (small change) Misc. update:
Diffstat (limited to 'tools/h5repack/h5repack_filters.c')
-rw-r--r--tools/h5repack/h5repack_filters.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/tools/h5repack/h5repack_filters.c b/tools/h5repack/h5repack_filters.c
index 43b7dcc..89490e3 100644
--- a/tools/h5repack/h5repack_filters.c
+++ b/tools/h5repack/h5repack_filters.c
@@ -202,8 +202,11 @@ int apply_filters(const char* name, /* object name from traverse list */
unsigned aggression; /* the deflate level */
hsize_t nelmts; /* number of elements in dataset */
size_t size; /* size of datatype in bytes */
+ hsize_t chsize[64]; /* chunk size in elements */
+ H5D_layout_t layout;
int i;
pack_info_t obj;
+
if (rank==0)
goto out;
@@ -250,6 +253,31 @@ int apply_filters(const char* name, /* object name from traverse list */
if (H5Premove_filter(dcpl_id,H5Z_FILTER_ALL)<0)
return -1;
}
+
+
+ /*-------------------------------------------------------------------------
+ * check if there is an existent chunk
+ * read it only if there is not a requested layout
+ *-------------------------------------------------------------------------
+ */
+ if (obj.layout == -1 )
+ {
+ if ((layout = H5Pget_layout(dcpl_id))<0)
+ return -1;
+
+ if (layout==H5D_CHUNKED)
+ {
+ if ((rank = H5Pget_chunk(dcpl_id,NELMTS(chsize),chsize/*out*/))<0)
+ return -1;
+ obj.layout=H5D_CHUNKED;
+ obj.chunk.rank=rank;
+ for ( i=0; i<rank; i++)
+ obj.chunk.chunk_lengths[i] = chsize[i];
+ }
+ }
+
+
+
/*-------------------------------------------------------------------------
* the type of filter and additional parameter