summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPedro Vicente Nunes <pvn@hdfgroup.org>2005-02-14 19:25:54 (GMT)
committerPedro Vicente Nunes <pvn@hdfgroup.org>2005-02-14 19:25:54 (GMT)
commit5f8a378ea2b83767cc16546722153f5ba08c7dfa (patch)
treed02bf5bcf765bfeaa6ddf4fa8cdbe86fa11959b4
parenta0f9d3a64180a001971ba5c1d2fdac62f2ae21bc (diff)
downloadhdf5-5f8a378ea2b83767cc16546722153f5ba08c7dfa.zip
hdf5-5f8a378ea2b83767cc16546722153f5ba08c7dfa.tar.gz
hdf5-5f8a378ea2b83767cc16546722153f5ba08c7dfa.tar.bz2
[svn-r10001] 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:
-rw-r--r--tools/h5repack/h5repack_filters.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/tools/h5repack/h5repack_filters.c b/tools/h5repack/h5repack_filters.c
index 5d815c9..7108c3a 100644
--- a/tools/h5repack/h5repack_filters.c
+++ b/tools/h5repack/h5repack_filters.c
@@ -202,6 +202,8 @@ 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;
@@ -250,6 +252,29 @@ 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