diff options
-rw-r--r-- | tools/h5repack/h5repack.h | 2 | ||||
-rw-r--r-- | tools/h5repack/h5repack_copy.c | 28 | ||||
-rw-r--r-- | tools/h5repack/h5repack_filters.c | 4 | ||||
-rw-r--r-- | tools/h5repack/h5repack_main.c | 5 | ||||
-rw-r--r-- | tools/h5repack/h5repack_verify.c | 2 |
5 files changed, 26 insertions, 15 deletions
diff --git a/tools/h5repack/h5repack.h b/tools/h5repack/h5repack.h index 2d4ad5d..79add4f 100644 --- a/tools/h5repack/h5repack.h +++ b/tools/h5repack/h5repack.h @@ -19,7 +19,7 @@ #include "hdf5.h" #include "h5trav.h" -#if 0 +#if 1 #define H5_REPACK_DEBUG #endif diff --git a/tools/h5repack/h5repack_copy.c b/tools/h5repack/h5repack_copy.c index be263ae..bbeb289 100644 --- a/tools/h5repack/h5repack_copy.c +++ b/tools/h5repack/h5repack_copy.c @@ -73,10 +73,6 @@ int copy_objects(const char* fnamein, if (h5trav_gettable(fidin,travt)<0) goto out; -#if defined (H5_REPACK_DEBUG) - h5trav_printtable(travt); -#endif - /*------------------------------------------------------------------------- * do the copy *------------------------------------------------------------------------- @@ -221,6 +217,7 @@ int do_copy_objects(hid_t fidin, goto error; if ( (rank=H5Sget_simple_extent_ndims(space_id))<0) goto error; + HDmemset(dims, 0, sizeof dims); if ( H5Sget_simple_extent_dims(space_id,dims,NULL)<0) goto error; nelmts=1; @@ -282,15 +279,24 @@ int do_copy_objects(hid_t fidin, */ if (filter_this(travt->objs[i].name,options,&obj)) { - /* filters require CHUNK layout; if we do not have one define a default */ - if (obj.chunk.rank==0) + if (rank) { - obj.chunk.rank=rank; - for (j=0; j<rank; j++) - obj.chunk.chunk_lengths[j] = dims[j]; + /* filters require CHUNK layout; if we do not have one define a default */ + if (obj.chunk.rank==0) + { + obj.chunk.rank=rank; + for (j=0; j<rank; j++) + obj.chunk.chunk_lengths[j] = dims[j]; + } + if (apply_filters(dcpl_id,H5Tget_size(mtype_id),options,&obj)<0) + continue; + } + else + { + if (options->verbose) + printf("Warning: Filter could not be applied to <%s>\n", + travt->objs[i].name); } - if (apply_filters(dcpl_id,H5Tget_size(mtype_id),options,&obj)<0) - continue; } /*------------------------------------------------------------------------- diff --git a/tools/h5repack/h5repack_filters.c b/tools/h5repack/h5repack_filters.c index e3edb8a..8fb45f9 100644 --- a/tools/h5repack/h5repack_filters.c +++ b/tools/h5repack/h5repack_filters.c @@ -128,7 +128,7 @@ int print_filters(hid_t dcpl_id) { cd_nelmts = NELMTS(cd_values); filtn = H5Pget_filter(dcpl_id, - i, + (unsigned)i, &filt_flags, &cd_nelmts, cd_values, @@ -190,7 +190,7 @@ int apply_filters(hid_t dcpl_id, { cd_nelmts = NELMTS(cd_values); filtn = H5Pget_filter(dcpl_id, - i, + (unsigned)i, &filt_flags, &cd_nelmts, cd_values, diff --git a/tools/h5repack/h5repack_main.c b/tools/h5repack/h5repack_main.c index 8ae0f91..73b77b5 100644 --- a/tools/h5repack/h5repack_main.c +++ b/tools/h5repack/h5repack_main.c @@ -90,6 +90,11 @@ int main(int argc, char **argv) /* pack it */ h5repack(infile,outfile,&options); +#if defined(H5_REPACK_DEBUG) + if (h5repack_verify(outfile,&options)<=0) + printf("Warning: Output file does not have some of the requested filters\n"); +#endif + /* free tables */ h5repack_end(&options); diff --git a/tools/h5repack/h5repack_verify.c b/tools/h5repack/h5repack_verify.c index 1cdca59..acede45 100644 --- a/tools/h5repack/h5repack_verify.c +++ b/tools/h5repack/h5repack_verify.c @@ -57,7 +57,7 @@ int has_filter(hid_t dcpl_id, { cd_nelmts = NELMTS(cd_values); filtn = H5Pget_filter(dcpl_id, - i, + (unsigned)i, &filt_flags, &cd_nelmts, cd_values, |