summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorPeter Cao <xcao@hdfgroup.org>2013-03-19 18:48:23 (GMT)
committerPeter Cao <xcao@hdfgroup.org>2013-03-19 18:48:23 (GMT)
commita8b0ddf52b12f9e5025d53e223d45fa79448bc9a (patch)
treeebdd3ef278da3346a2f7c320190e19a82dd82ae7 /tools
parente96b3e8cb23d200e0028e85c30a6357bfc0d9a30 (diff)
downloadhdf5-a8b0ddf52b12f9e5025d53e223d45fa79448bc9a.zip
hdf5-a8b0ddf52b12f9e5025d53e223d45fa79448bc9a.tar.gz
hdf5-a8b0ddf52b12f9e5025d53e223d45fa79448bc9a.tar.bz2
[svn-r23383] fixed HDFFV-8344 and HDFFV-8346: add info for user registered filter in h5dump
Diffstat (limited to 'tools')
-rw-r--r--tools/lib/h5tools_dump.c16
-rw-r--r--tools/testfiles/tfletcher32.ddl2
-rw-r--r--tools/testfiles/tshuffle.ddl2
-rw-r--r--tools/testfiles/tuserfilter.ddl4
4 files changed, 17 insertions, 7 deletions
diff --git a/tools/lib/h5tools_dump.c b/tools/lib/h5tools_dump.c
index e2fc387..753a53e 100644
--- a/tools/lib/h5tools_dump.c
+++ b/tools/lib/h5tools_dump.c
@@ -2958,11 +2958,14 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info,
int ndims = H5Sget_simple_extent_dims(sid, dims, NULL);
/* only print the compression ratio for these filters */
- for(i = 0; i < nfilters; i++) {
+ for(i = 0; i < nfilters && !ok; i++) {
cd_nelmts = NELMTS(cd_values);
filtn = H5Pget_filter2(dcpl_id, (unsigned)i, &filt_flags, &cd_nelmts,
cd_values, sizeof(f_name), f_name, NULL);
-
+ ok = (filtn>=0);
+
+ /* this following code will not show compression ratio for
+ user defined filter. For example, see HDFFV-8344 --xcao@hdfgroup.org
switch(filtn) {
case H5Z_FILTER_DEFLATE:
case H5Z_FILTER_SZIP:
@@ -2971,6 +2974,7 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info,
ok = 1;
break;
}
+ */
}
if(ndims && ok) {
@@ -3148,6 +3152,9 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info,
cd_nelmts = NELMTS(cd_values);
filtn = H5Pget_filter2(dcpl_id, (unsigned)i, &filt_flags, &cd_nelmts,
cd_values, sizeof(f_name), f_name, NULL);
+
+ if (filtn<0)
+ continue; /* nothing to print for invalid filter */
ctx->need_prefix = TRUE;
h5tools_simple_prefix(stream, info, ctx, curr_pos, 0);
@@ -3241,10 +3248,13 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info,
h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, ncols, 0, 0);
break;
default:
+ /* filter do not have to be avaiable for showing registered filter info.
+ see HDFFV-8346 for details. --xcao@hdfgroup.org
if(H5Zfilter_avail(filtn))
h5tools_str_append(&buffer, "%s %s", "USER_REGISTERED_FILTER", BEGIN);
else
- h5tools_str_append(&buffer, "%s %s", "UNKNOWN_FILTER", BEGIN);
+ */
+ h5tools_str_append(&buffer, "%s %s", "USER_DEFINED_FILTER", BEGIN);
h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, ncols, 0, 0);
ctx->indent_level++;
diff --git a/tools/testfiles/tfletcher32.ddl b/tools/testfiles/tfletcher32.ddl
index 072ef23..c341ded 100644
--- a/tools/testfiles/tfletcher32.ddl
+++ b/tools/testfiles/tfletcher32.ddl
@@ -4,7 +4,7 @@ DATASET "fletcher32" {
DATASPACE SIMPLE { ( 20, 10 ) / ( 20, 10 ) }
STORAGE_LAYOUT {
CHUNKED ( 10, 5 )
- SIZE 816
+ SIZE 816 (0.980:1 COMPRESSION)
}
FILTERS {
CHECKSUM FLETCHER32
diff --git a/tools/testfiles/tshuffle.ddl b/tools/testfiles/tshuffle.ddl
index cd1b5f8..5c183fe 100644
--- a/tools/testfiles/tshuffle.ddl
+++ b/tools/testfiles/tshuffle.ddl
@@ -4,7 +4,7 @@ DATASET "shuffle" {
DATASPACE SIMPLE { ( 20, 10 ) / ( 20, 10 ) }
STORAGE_LAYOUT {
CHUNKED ( 10, 5 )
- SIZE 800
+ SIZE 800 (1.000:1 COMPRESSION)
}
FILTERS {
PREPROCESSING SHUFFLE
diff --git a/tools/testfiles/tuserfilter.ddl b/tools/testfiles/tuserfilter.ddl
index 07b478f..24745b9 100644
--- a/tools/testfiles/tuserfilter.ddl
+++ b/tools/testfiles/tuserfilter.ddl
@@ -4,10 +4,10 @@ DATASET "myfilter" {
DATASPACE SIMPLE { ( 20, 10 ) / ( 20, 10 ) }
STORAGE_LAYOUT {
CHUNKED ( 10, 5 )
- SIZE 800
+ SIZE 800 (1.000:1 COMPRESSION)
}
FILTERS {
- UNKNOWN_FILTER {
+ USER_DEFINED_FILTER {
FILTER_ID 405
COMMENT myfilter
PARAMS { 5 6 }