From cbe163c6ce286b96dd461375cf76649dee98567d Mon Sep 17 00:00:00 2001 From: Jonathan Kim Date: Fri, 20 Nov 2009 17:17:48 -0500 Subject: [svn-r17921] Purpose: Fix Bug1672 - Display garbage value on LE machine for BE data. Description: Casuing by calling diff_dataset twice when -r or no option was given. Change to call it once which fix the problem. It also improves the performance. (diffing time in half) According further test, it also occurred on BE machine as well and it seems occruing only with the BE data attached to Bugzilla. Don't know how the file was created. Anyway this fix will prevent from diffing with garbage values in similiar potential case. Tested on: linux32 (jam) , linux64 (almani), solaris (linew) --- release_docs/RELEASE.txt | 2 ++ tools/h5diff/testfiles/h5diff_200.txt | 1 + tools/h5diff/testfiles/h5diff_201.txt | 1 + tools/h5diff/testfiles/h5diff_202.txt | 1 + tools/h5diff/testfiles/h5diff_203.txt | 1 + tools/h5diff/testfiles/h5diff_204.txt | 1 + tools/h5diff/testfiles/h5diff_205.txt | 1 + tools/h5diff/testfiles/h5diff_206.txt | 1 + tools/h5diff/testfiles/h5diff_207.txt | 1 + tools/h5diff/testfiles/h5diff_609.txt | 2 ++ tools/h5diff/testfiles/h5diff_618.txt | 2 ++ tools/lib/h5diff.c | 57 ++++++++++++++--------------------- 12 files changed, 36 insertions(+), 35 deletions(-) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 74d866f..2dae9e6 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -71,6 +71,8 @@ New Features Tools ----- + - h5diff: fix for displaying garbage value on LE machine for BE data. + (JKM - 2009/11/20) High-Level APIs diff --git a/tools/h5diff/testfiles/h5diff_200.txt b/tools/h5diff/testfiles/h5diff_200.txt index 56d723d..5a4d02e 100644 --- a/tools/h5diff/testfiles/h5diff_200.txt +++ b/tools/h5diff/testfiles/h5diff_200.txt @@ -1,3 +1,4 @@ +dataset: and -------------------------------- Some objects are not comparable -------------------------------- diff --git a/tools/h5diff/testfiles/h5diff_201.txt b/tools/h5diff/testfiles/h5diff_201.txt index 84d6766..da916ea 100644 --- a/tools/h5diff/testfiles/h5diff_201.txt +++ b/tools/h5diff/testfiles/h5diff_201.txt @@ -1 +1,2 @@ +dataset: and Not comparable: or is an empty dataset diff --git a/tools/h5diff/testfiles/h5diff_202.txt b/tools/h5diff/testfiles/h5diff_202.txt index fd4a191..8e3c7ac 100644 --- a/tools/h5diff/testfiles/h5diff_202.txt +++ b/tools/h5diff/testfiles/h5diff_202.txt @@ -1,2 +1,3 @@ +dataset: and Not comparable: is of class H5T_FLOAT and is of class H5T_INTEGER Not comparable: has sign H5T_SGN_ERROR and has sign H5T_SGN_2 diff --git a/tools/h5diff/testfiles/h5diff_203.txt b/tools/h5diff/testfiles/h5diff_203.txt index 496523c..90294e3 100644 --- a/tools/h5diff/testfiles/h5diff_203.txt +++ b/tools/h5diff/testfiles/h5diff_203.txt @@ -1,2 +1,3 @@ +dataset: and Not comparable: has rank 1, dimensions [6], max dimensions [6] and has rank 2, dimensions [3x2], max dimensions [3x2] diff --git a/tools/h5diff/testfiles/h5diff_204.txt b/tools/h5diff/testfiles/h5diff_204.txt index 098a203..a94091d 100644 --- a/tools/h5diff/testfiles/h5diff_204.txt +++ b/tools/h5diff/testfiles/h5diff_204.txt @@ -1,2 +1,3 @@ +dataset: and Not comparable: has rank 2, dimensions [3x2], max dimensions [3x2] and has rank 2, dimensions [2x2], max dimensions [2x2] diff --git a/tools/h5diff/testfiles/h5diff_205.txt b/tools/h5diff/testfiles/h5diff_205.txt index 3e2d1f2..c3708cb 100644 --- a/tools/h5diff/testfiles/h5diff_205.txt +++ b/tools/h5diff/testfiles/h5diff_205.txt @@ -1,3 +1,4 @@ +dataset: and Not comparable: has rank 2, dimensions [2x2], max dimensions [2x2] and has rank 2, dimensions [3x2], max dimensions [3x2] Not comparable: has sign H5T_SGN_2 and has sign H5T_SGN_NONE diff --git a/tools/h5diff/testfiles/h5diff_206.txt b/tools/h5diff/testfiles/h5diff_206.txt index 164aed9..3557b1e 100644 --- a/tools/h5diff/testfiles/h5diff_206.txt +++ b/tools/h5diff/testfiles/h5diff_206.txt @@ -1 +1,2 @@ +dataset: and Not comparable: has a class H5T_FLOAT and has a class H5T_INTEGER diff --git a/tools/h5diff/testfiles/h5diff_207.txt b/tools/h5diff/testfiles/h5diff_207.txt index bb8e23f..4dfcbb7 100644 --- a/tools/h5diff/testfiles/h5diff_207.txt +++ b/tools/h5diff/testfiles/h5diff_207.txt @@ -1,2 +1,3 @@ +dataset: and Not comparable: or is an empty dataset Not comparable: has 2 members has 1 members diff --git a/tools/h5diff/testfiles/h5diff_609.txt b/tools/h5diff/testfiles/h5diff_609.txt index e69de29..9369dd9 100644 --- a/tools/h5diff/testfiles/h5diff_609.txt +++ b/tools/h5diff/testfiles/h5diff_609.txt @@ -0,0 +1,2 @@ +dataset: and +0 differences found diff --git a/tools/h5diff/testfiles/h5diff_618.txt b/tools/h5diff/testfiles/h5diff_618.txt index e69de29..9369dd9 100644 --- a/tools/h5diff/testfiles/h5diff_618.txt +++ b/tools/h5diff/testfiles/h5diff_618.txt @@ -0,0 +1,2 @@ +dataset: and +0 differences found diff --git a/tools/lib/h5diff.c b/tools/lib/h5diff.c index bfe2a61..7d11f2f 100644 --- a/tools/lib/h5diff.c +++ b/tools/lib/h5diff.c @@ -49,7 +49,7 @@ int print_objname (diff_opt_t * options, hsize_t nfound) { - return ((options->m_verbose || nfound) && !options->m_quiet) ? 1 : 0; + return ((options->m_verbose || nfound) && !options->m_quiet) ? 1 : 0; } /*------------------------------------------------------------------------- @@ -359,6 +359,11 @@ out: * Modifications: Jan 2005 Leon Arber, larber@uiuc.edu * Added support for parallel diffing * + * Pedro Vicente, pvn@hdfgroup.org, Nov 4, 2008 + * Compare the graph and make h5diff return 1 for difference if + * 1) the number of objects in file1 is not the same as in file2 + * 2) the graph does not match, i.e same names (absolute path) + * 3) objects with the same name are not of the same type *------------------------------------------------------------------------- */ hsize_t diff_match(hid_t file1_id, @@ -911,45 +916,27 @@ hsize_t diff(hid_t file1_id, *------------------------------------------------------------------------- */ case H5TRAV_TYPE_DATASET: - /*------------------------------------------------------------------------- - * verbose, always print name - *------------------------------------------------------------------------- - */ - if(options->m_verbose) + /* verbose (-v) and report (-r) mode */ + if(options->m_verbose || options->m_report) { - if(print_objname(options, (hsize_t)1)) - do_print_objname("dataset", path1, path2); + do_print_objname("dataset", path1, path2); nfound = diff_dataset(file1_id, file2_id, path1, path2, options); print_found(nfound); - } /* end if */ - /*------------------------------------------------------------------------- - * non verbose, check first if we have differences by enabling quiet mode - * so that printing is off, and compare again if differences found, - * disabling quiet mode - *------------------------------------------------------------------------- - */ + } + /* quiet mode (-q), just count differences */ + else if(options->m_quiet) + { + nfound = diff_dataset(file1_id, file2_id, path1, path2, options); + } + /* the rest (-c, none, ...) */ else { - if(options->m_quiet == 0) - { - /* shut up temporarily */ - options->m_quiet = 1; - nfound = diff_dataset(file1_id, file2_id, path1, path2, options); - - /* print again */ - options->m_quiet = 0; - if(nfound) - { - if(print_objname(options,nfound)) - do_print_objname("dataset", path1, path2); - nfound = diff_dataset(file1_id, file2_id, path1, path2, options); - print_found(nfound); - } /* end if */ - } /* end if */ - /* in quiet mode, just count differences */ - else - nfound = diff_dataset(file1_id, file2_id, path1, path2, options); - } /* end else */ + do_print_objname("dataset", path1, path2); + nfound = diff_dataset(file1_id, file2_id, path1, path2, options); + /* not comparable, no display the different number */ + if (!options->not_cmp) + print_found(nfound); + } break; /*------------------------------------------------------------------------- -- cgit v0.12