summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPedro Vicente Nunes <pvn@hdfgroup.org>2004-01-14 20:09:44 (GMT)
committerPedro Vicente Nunes <pvn@hdfgroup.org>2004-01-14 20:09:44 (GMT)
commit7f7fbb47183b6d6a95da4071acb2f8fff1e51c0b (patch)
treeb9c0c5b3ecee990ccb0c6e5f69c7c0f2f4567304
parent62a9b30a6465db12dd9ee552045cca9d95a40bc3 (diff)
downloadhdf5-7f7fbb47183b6d6a95da4071acb2f8fff1e51c0b.zip
hdf5-7f7fbb47183b6d6a95da4071acb2f8fff1e51c0b.tar.gz
hdf5-7f7fbb47183b6d6a95da4071acb2f8fff1e51c0b.tar.bz2
[svn-r8062] Purpose:
bug fix Description: cases of rank 0 were not handled, now a warning is made that the dataset cannot be compressed Solution: Platforms tested: linux solaris AIX Misc. update:
-rw-r--r--tools/h5repack/h5repack.h2
-rw-r--r--tools/h5repack/h5repack_copy.c28
-rw-r--r--tools/h5repack/h5repack_filters.c4
-rw-r--r--tools/h5repack/h5repack_main.c5
-rw-r--r--tools/h5repack/h5repack_verify.c2
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,