From 4cb6c01d7f59be968649e36a61346be044f76345 Mon Sep 17 00:00:00 2001 From: Pedro Vicente Nunes Date: Tue, 20 Jul 2004 14:21:03 -0500 Subject: [svn-r8904] Purpose: h5diff and h5repack changes Description: h5diff introduced the following four modes of output: Normal mode: print the number of differences found and where they occured Report mode: print the above plus the differences Verbose mode: print the above plus a list of objects and warnings Quiet mode: do not print output (h5diff always returns an exit code of 1 when differences are found) h5repack added an extra parameter for SZIP filter (coding method) the new syntax is -f SZIP= (pixels per block is a even number in 2-32 and coding method is 'EC' or 'NN') Example of use: ./h5repack -i file1 -o file2 -f SZIP=8,NN -v updated usage messages, test scripts and files accordingly Solution: Platforms tested: linux AIX solaris Misc. update: --- MANIFEST | 3 +- tools/h5diff/h5diff_main.c | 88 +++-- tools/h5diff/testh5diff.sh | 54 +-- tools/h5diff/testh5diff_attr.c | 44 +-- tools/h5diff/testh5diff_dset.c | 37 +- tools/h5repack/h5repack.c | 13 +- tools/h5repack/h5repack.h | 39 +- tools/h5repack/h5repack.sh.in | 14 +- tools/h5repack/h5repack_copy.c | 149 +++++--- tools/h5repack/h5repack_filters.c | 35 +- tools/h5repack/h5repack_main.c | 55 ++- tools/h5repack/h5repack_opttable.c | 31 +- tools/h5repack/h5repack_parse.c | 87 ++++- tools/h5repack/h5repack_refs.c | 13 +- tools/h5repack/h5repack_verify.c | 19 +- tools/h5repack/testh5repack_attr.c | 31 +- tools/h5repack/testh5repack_dset.c | 26 +- tools/h5repack/testh5repack_main.c | 73 ++-- tools/h5repack/testh5repack_make.c | 67 +++- tools/h5repack/testh5repack_util.c | 6 +- tools/lib/h5diff.c | 187 +++++---- tools/lib/h5diff.h | 171 +++++---- tools/lib/h5diff_array.c | 303 +++++++-------- tools/lib/h5diff_attr.c | 222 ++++++----- tools/lib/h5diff_dset.c | 219 +++++------ tools/lib/h5diff_util.c | 12 + tools/testfiles/file1.h5 | Bin 6240 -> 6240 bytes tools/testfiles/file2.h5 | Bin 6288 -> 6288 bytes tools/testfiles/file3.h5 | Bin 4352 -> 4352 bytes tools/testfiles/file4.h5 | Bin 10520 -> 10520 bytes tools/testfiles/file5.h5 | Bin 19272 -> 19216 bytes tools/testfiles/file6.h5 | Bin 19272 -> 19216 bytes tools/testfiles/file7.h5 | Bin 20584 -> 20312 bytes tools/testfiles/file8.h5 | Bin 20584 -> 20312 bytes tools/testfiles/h5diff_10.txt | 26 +- tools/testfiles/h5diff_11.txt | 10 +- tools/testfiles/h5diff_12.txt | 10 +- tools/testfiles/h5diff_13.txt | 20 +- tools/testfiles/h5diff_14.txt | 22 +- tools/testfiles/h5diff_15.txt | 16 +- tools/testfiles/h5diff_16.txt | 18 +- tools/testfiles/h5diff_17.txt | 23 ++ tools/testfiles/h5diff_18.txt | 3 + tools/testfiles/h5diff_20.txt | 3 +- tools/testfiles/h5diff_21.txt | 3 +- tools/testfiles/h5diff_22.txt | 3 +- tools/testfiles/h5diff_23.txt | 3 +- tools/testfiles/h5diff_24.txt | 3 +- tools/testfiles/h5diff_25.txt | 3 +- tools/testfiles/h5diff_50.txt | 4 +- tools/testfiles/h5diff_51.txt | 4 +- tools/testfiles/h5diff_52.txt | 4 +- tools/testfiles/h5diff_53.txt | 4 +- tools/testfiles/h5diff_54.txt | 4 +- tools/testfiles/h5diff_55.txt | 4 +- tools/testfiles/h5diff_56.txt | 4 +- tools/testfiles/h5diff_57.txt | 5 +- tools/testfiles/h5diff_600.txt | 26 +- tools/testfiles/h5diff_601.txt | 26 +- tools/testfiles/h5diff_602.txt | 26 +- tools/testfiles/h5diff_603.txt | 26 +- tools/testfiles/h5diff_604.txt | 26 +- tools/testfiles/h5diff_605.txt | 26 +- tools/testfiles/h5diff_606.txt | 26 +- tools/testfiles/h5diff_607.txt | 10 +- tools/testfiles/h5diff_608.txt | 10 +- tools/testfiles/h5diff_609.txt | 1 + tools/testfiles/h5diff_610.txt | 10 +- tools/testfiles/h5diff_611.txt | 28 +- tools/testfiles/h5diff_612.txt | 26 +- tools/testfiles/h5diff_613.txt | 26 +- tools/testfiles/h5diff_614.txt | 26 +- tools/testfiles/h5diff_615.txt | 26 +- tools/testfiles/h5diff_616.txt | 6 +- tools/testfiles/h5diff_617.txt | 6 +- tools/testfiles/h5diff_618.txt | 1 + tools/testfiles/h5diff_619.txt | 10 +- tools/testfiles/h5diff_620.txt | 26 +- tools/testfiles/h5diff_621.txt | 26 +- tools/testfiles/h5diff_622.txt | 26 +- tools/testfiles/h5diff_623.txt | 26 +- tools/testfiles/h5diff_624.txt | 26 +- tools/testfiles/h5diff_625.txt | 6 +- tools/testfiles/h5diff_626.txt | 7 +- tools/testfiles/h5diff_627.txt | 10 +- tools/testfiles/h5diff_628.txt | 5 +- tools/testfiles/h5diff_629.txt | 3 +- tools/testfiles/h5diff_70.txt | 121 +++++- tools/testfiles/h5diff_80.txt | 74 +++- tools/testfiles/h5diff_81.txt | 749 ------------------------------------- tools/testfiles/test1.h5 | Bin 33920 -> 33920 bytes tools/testfiles/test3.h5 | Bin 6984 -> 6984 bytes tools/testfiles/test4.h5 | Bin 29384 -> 29384 bytes tools/testfiles/test_all.h5 | Bin 5925 -> 28062 bytes tools/testfiles/test_deflate.h5 | Bin 5954 -> 5954 bytes tools/testfiles/test_fletcher32.h5 | Bin 7880 -> 7880 bytes tools/testfiles/test_shuffle.h5 | Bin 7864 -> 7864 bytes tools/testfiles/test_szip.h5 | Bin 5588 -> 5588 bytes 98 files changed, 1757 insertions(+), 1913 deletions(-) create mode 100644 tools/testfiles/h5diff_17.txt create mode 100644 tools/testfiles/h5diff_18.txt delete mode 100644 tools/testfiles/h5diff_81.txt diff --git a/MANIFEST b/MANIFEST index 51c0682..e1b7f14 100644 --- a/MANIFEST +++ b/MANIFEST @@ -1467,6 +1467,8 @@ ./tools/testfiles/h5diff_14.txt ./tools/testfiles/h5diff_15.txt ./tools/testfiles/h5diff_16.txt +./tools/testfiles/h5diff_17.txt +./tools/testfiles/h5diff_18.txt ./tools/testfiles/h5diff_20.txt ./tools/testfiles/h5diff_21.txt ./tools/testfiles/h5diff_22.txt @@ -1513,7 +1515,6 @@ ./tools/testfiles/h5diff_629.txt ./tools/testfiles/h5diff_70.txt ./tools/testfiles/h5diff_80.txt -./tools/testfiles/h5diff_81.txt #test files for h5repack ./tools/testfiles/test1.h5 diff --git a/tools/h5diff/h5diff_main.c b/tools/h5diff/h5diff_main.c index 8dbce22..ff3b2e1 100644 --- a/tools/h5diff/h5diff_main.c +++ b/tools/h5diff/h5diff_main.c @@ -16,11 +16,6 @@ #include #include -/* Due to alignment issue in Alpha clusters, options must be declared here - * not as a local variable in main(). - */ -diff_opt_t options = {0,0,0,0,0,0,0,0}; - static void usage(void); static int check_n_input( const char* ); static int check_f_input( const char* ); @@ -40,7 +35,12 @@ static int check_f_input( const char* ); * * Comments: * - * Modifications: + * Modifications: July 2004 + * Introduced the four modes: + * Normal mode: print the number of differences found and where they occured + * Report mode: print the above plus the differences + * Verbose mode: print the above plus a list of objects and warnings + * Quiet mode: do not print output * *------------------------------------------------------------------------- */ @@ -53,7 +53,11 @@ int main(int argc, const char *argv[]) const char *fname2 = NULL; const char *objname1 = NULL; const char *objname2 = NULL; - int nfound=0, ret; + hsize_t nfound=0; + int ret; + diff_opt_t options; + + memset(&options, 0, sizeof (diff_opt_t)); /*------------------------------------------------------------------------- * initial check of command line options @@ -98,10 +102,14 @@ int main(int argc, const char *argv[]) usage(); break; case 'v': - options.verbose = 1; + options.m_verbose = 1; + break; + case 'q': + /* use quiet mode; supress the message "0 differences found" */ + options.m_quiet = 1; break; case 'r': - options.r = 1; + options.m_report = 1; break; case 'd': /* if it is not another option */ @@ -189,24 +197,36 @@ int main(int argc, const char *argv[]) }/*for*/ + nfound = h5diff(fname1,fname2,objname1,objname2,&options); + /*------------------------------------------------------------------------- - * print the command line options + * print how many differences were found *------------------------------------------------------------------------- */ - - if (options.verbose) + if (!options.m_quiet) { - printf("$h5diff"); - for (i=1; i0 if differences, 0 if no differences, <0 if error + *------------------------------------------------------------------------- + */ + ret= (nfound==0 ? 0 : 1 ); + if (options.err_stat) + ret=-1; return ret; } @@ -256,8 +276,6 @@ int check_n_input( const char *str ) * * Return: 1 for ok, -1 for fail * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu - * * Date: May 9, 2003 * * Comments: @@ -292,10 +310,6 @@ int check_f_input( const char *str ) * * Return: void * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu - * - * Date: May 9, 2003 - * *------------------------------------------------------------------------- */ static @@ -309,8 +323,9 @@ void usage(void) printf("[obj2] Name of an HDF5 object, in absolute path\n"); printf("[OPTIONS] are:\n"); printf("[-h] Print out this information\n"); - printf("[-v] Verbose mode\n"); - printf("[-r] Print only what objects differ, not the differences\n"); + printf("[-r] Report mode. Print the differences\n"); + printf("[-v] Verbose mode. Print the differences, list of objects, warnings\n"); + printf("[-q] Quiet mode. Do not do output\n"); printf("[-n count] Print difference up to count number\n"); printf("[-d delta] Print difference when it is greater than limit delta\n"); printf("[-p relative] Print difference when it is greater than a relative limit\n"); @@ -322,20 +337,31 @@ void usage(void) printf("The -d compare criteria is |a - b| > delta\n"); printf("The -p compare criteria is |1 - b/a| > relative\n"); printf("\n"); - printf("Examples:\n"); + printf("h5diff has four modes of output:\n"); + printf(" Normal mode: print the number of differences found and where they occured\n"); + printf(" Report mode: print the above plus the differences\n"); + printf(" Verbose mode: print the above plus a list of objects and warnings\n"); + printf(" Quiet mode: do not print output (h5diff always returns an exit code of 1 when differences are found)\n"); printf("\n"); - printf("1) h5diff file1 file2 /a/b /a/c\n"); + printf("Examples of use:\n"); printf("\n"); - printf(" Compares object '/a/b' in file1 with '/a/c' in file2\n"); + printf("1) h5diff file1 file2 /g1/dset1 /g1/dset2\n"); printf("\n"); - printf("2) h5diff file1 file2 /a/b\n"); + printf(" Compares object '/g1/dset1' in file1 with '/g1/dset2' in file2\n"); printf("\n"); - printf(" Compares object '/a/b' in both files\n"); + printf("2) h5diff file1 file2 /g1/dset1\n"); + printf("\n"); + printf(" Compares object '/g1/dset1' in both files\n"); printf("\n"); printf("3) h5diff file1 file2\n"); printf("\n"); printf(" Compares all objects in both files\n"); printf("\n"); + printf("Note) file1 and file2 can be the same file. Use\n"); + printf("\n"); + printf(" h5diff file1 file1 /g1/dset1 /g1/dset2\n"); + printf("\n"); + printf(" to compare '/g1/dset1' and '/g1/dset2' in the same file\n"); exit(0); } diff --git a/tools/h5diff/testh5diff.sh b/tools/h5diff/testh5diff.sh index f9392fe..91a2eb5 100755 --- a/tools/h5diff/testh5diff.sh +++ b/tools/h5diff/testh5diff.sh @@ -102,23 +102,29 @@ TOOLTEST() { # 1.0 TOOLTEST h5diff_10.txt -h -# 1.1 -TOOLTEST h5diff_11.txt file1.h5 file2.h5 g1/dset1 g1/dset2 +# 1.1 normal mode +TOOLTEST h5diff_11.txt file1.h5 file2.h5 -# 1.2 -TOOLTEST h5diff_12.txt file1.h5 file2.h5 -v -n 2 g1/dset1 g1/dset2 +# 1.2 normal mode with objects +TOOLTEST h5diff_12.txt file1.h5 file2.h5 g1/dset1 g1/dset2 -# 1.3 -TOOLTEST h5diff_13.txt file1.h5 file2.h5 -v -d 5 g1/dset3 g1/dset4 +# 1.3 report mode +TOOLTEST h5diff_13.txt file1.h5 file2.h5 -r -# 1.4 -TOOLTEST h5diff_14.txt file1.h5 file2.h5 -v -p 0.05 g1/dset3 g1/dset4 +# 1.4 report mode with objects +TOOLTEST h5diff_14.txt file1.h5 file2.h5 -r g1/dset1 g1/dset2 -# 1.5 -TOOLTEST h5diff_15.txt file1.h5 file2.h5 -v -r g1/dset1 g1/dset2 +# 1.5 with -d +TOOLTEST h5diff_15.txt file1.h5 file2.h5 -r -d 5 g1/dset3 g1/dset4 -# 1.6 -TOOLTEST h5diff_16.txt file1.h5 file2.h5 +# 1.6 with -p +TOOLTEST h5diff_16.txt file1.h5 file2.h5 -r -p 0.05 g1/dset3 g1/dset4 + +# 1.7 verbose mode +TOOLTEST h5diff_17.txt file1.h5 file2.h5 -v + +# 1.8 quiet mode +TOOLTEST h5diff_18.txt file1.h5 file2.h5 -q # ############################################################################## # # not comparable types @@ -190,31 +196,31 @@ TOOLTEST h5diff_601.txt file1.h5 file2.h5 -x # ############################################################################## # 6.2: no value -TOOLTEST h5diff_602.txt file1.h5 file2.h5 -d g1/dset3 g1/dset4 +TOOLTEST h5diff_602.txt file1.h5 file2.h5 -d g1/dset3 g1/dset4 # 6.3: negative value -TOOLTEST h5diff_603.txt file1.h5 file2.h5 -d -4 g1/dset3 g1/dset4 +TOOLTEST h5diff_603.txt file1.h5 file2.h5 -d -4 g1/dset3 g1/dset4 # 6.4: zero -TOOLTEST h5diff_604.txt file1.h5 file2.h5 -d 0 g1/dset3 g1/dset4 +TOOLTEST h5diff_604.txt file1.h5 file2.h5 -d 0 g1/dset3 g1/dset4 # 6.5: non number -TOOLTEST h5diff_605.txt file1.h5 file2.h5 -d u g1/dset3 g1/dset4 +TOOLTEST h5diff_605.txt file1.h5 file2.h5 -d u g1/dset3 g1/dset4 # 6.6: hexadecimal TOOLTEST h5diff_606.txt file1.h5 file2.h5 -d 0x1 g1/dset3 g1/dset4 # 6.7: string -TOOLTEST h5diff_607.txt file1.h5 file2.h5 -d "1" g1/dset3 g1/dset4 +TOOLTEST h5diff_607.txt file1.h5 file2.h5 -d "1" g1/dset3 g1/dset4 # 6.8: repeated option -TOOLTEST h5diff_608.txt file1.h5 file2.h5 -d 1 -d 2 g1/dset3 g1/dset4 +TOOLTEST h5diff_608.txt file1.h5 file2.h5 -d 1 -d 2 g1/dset3 g1/dset4 # 6.9: number larger than biggest difference -TOOLTEST h5diff_609.txt file1.h5 file2.h5 -d 200 g1/dset3 g1/dset4 +TOOLTEST h5diff_609.txt file1.h5 file2.h5 -d 200 g1/dset3 g1/dset4 # 6.10: number smaller than smallest difference -TOOLTEST h5diff_610.txt file1.h5 file2.h5 -d 1 g1/dset3 g1/dset4 +TOOLTEST h5diff_610.txt file1.h5 file2.h5 -d 1 g1/dset3 g1/dset4 # ############################################################################## @@ -223,7 +229,7 @@ TOOLTEST h5diff_610.txt file1.h5 file2.h5 -d 1 g1/dset3 g1/dset4 # 6.11: no value -TOOLTEST h5diff_611.txt file1.h5 file2.h5 -p g1/dset3 g1/dset4 +TOOLTEST h5diff_611.txt file1.h5 file2.h5 -r -p g1/dset3 g1/dset4 # 6.12: negative value TOOLTEST h5diff_612.txt file1.h5 file2.h5 -p -4 g1/dset3 g1/dset4 @@ -293,15 +299,13 @@ TOOLTEST h5diff_629.txt file1.h6 file2.h6 # # attributes # ############################################################################## -TOOLTEST h5diff_70.txt file5.h5 file6.h5 +TOOLTEST h5diff_70.txt file5.h5 file6.h5 -v # ############################################################################## # # all dataset datatypes # ############################################################################## -TOOLTEST h5diff_80.txt file7.h5 file8.h5 - -TOOLTEST h5diff_81.txt file7.h5 file8.h5 -v +TOOLTEST h5diff_80.txt file7.h5 file8.h5 -v diff --git a/tools/h5diff/testh5diff_attr.c b/tools/h5diff/testh5diff_attr.c index bc88431..fb6dc39 100644 --- a/tools/h5diff/testh5diff_attr.c +++ b/tools/h5diff/testh5diff_attr.c @@ -27,6 +27,8 @@ * *------------------------------------------------------------------------- */ + + static void write_attr_in(hid_t loc_id, const char* dset_name, /* for saving reference to dataset*/ hid_t file_id, @@ -1025,42 +1027,7 @@ etc write_attr(loc_id,3,dims3,"float3D",H5T_NATIVE_FLOAT,buf83); } -/*------------------------------------------------------------------------- - * Function: write_null_attr - * - * Purpose: write null attribute in LOC_ID (dataset, group, named datatype) - * - * Programmer: Raymond Lu, slu@ncsa.uiuc.edu - * - * Date: May 24, 2004 - * - *------------------------------------------------------------------------- - */ -static void write_null_attr(hid_t loc_id, - int make_diffs /* flag to modify data buffers */) -{ - hid_t sid, attr_id; - int val = 2; - unsigned uval = 7; - - /* Create the null attribute */ - sid = H5Screate(H5S_NULL); - if(make_diffs) { - attr_id = H5Acreate(loc_id, "null_attr", H5T_NATIVE_INT, sid, H5P_DEFAULT); - - /* Not supposed to write anything */ - H5Awrite(attr_id, H5T_NATIVE_INT, &val); - } else { - attr_id = H5Acreate(loc_id, "null_attr", H5T_NATIVE_UINT, sid, H5P_DEFAULT); - - /* Not supposed to write anything */ - H5Awrite(attr_id, H5T_NATIVE_INT, &uval); - } - - /* Close */ - H5Aclose(attr_id); - H5Sclose(sid); -} + /*------------------------------------------------------------------------- * Check all HDF5 classes @@ -1069,6 +1036,8 @@ static void write_null_attr(hid_t loc_id, * H5T_ENUM, H5T_VLEN, H5T_ARRAY *------------------------------------------------------------------------- */ + + int test_attr(const char *file, int make_diffs /* flag to modify data buffers */) { @@ -1098,10 +1067,11 @@ int test_attr(const char *file, * write a series of attributes on the dataset, group, and root group *------------------------------------------------------------------------- */ + write_attr_in(dset_id,"dset",file_id,make_diffs); write_attr_in(group_id,NULL,0,make_diffs); write_attr_in(root_id,NULL,0,make_diffs); - write_null_attr(root_id,make_diffs); + /* Close */ status = H5Dclose(dset_id); diff --git a/tools/h5diff/testh5diff_dset.c b/tools/h5diff/testh5diff_dset.c index 242f5d7..8158c5e 100644 --- a/tools/h5diff/testh5diff_dset.c +++ b/tools/h5diff/testh5diff_dset.c @@ -602,37 +602,6 @@ static void write_dset_in(hid_t loc_id, write_dset(loc_id,3,dims3,"float3D",H5T_NATIVE_FLOAT,buf83); } -/*------------------------------------------------------------------------- - * Function: write_null_dset - * - * Purpose: write null dataset in LOC_ID - * - * Programmer: Raymond Lu, slu@ncsa.uiuc.edu - * - * Date: May 24, 2004 - * - *------------------------------------------------------------------------- - */ -static void write_null_dset(hid_t loc_id, int make_diffs) -{ - hid_t sid, dset_id; - int val = 2; - double dval = 7.8; - - /* Create the null dataset */ - sid = H5Screate(H5S_NULL); - if(make_diffs) { - dset_id = H5Dcreate(loc_id,"null_dset",H5T_NATIVE_INT,sid,H5P_DEFAULT); - H5Dwrite(dset_id,H5T_NATIVE_INT,H5S_ALL,H5S_ALL,H5P_DEFAULT,&val); - } else { - dset_id = H5Dcreate(loc_id,"null_dset",H5T_NATIVE_DOUBLE,sid,H5P_DEFAULT); - H5Dwrite(dset_id,H5T_NATIVE_DOUBLE,H5S_ALL,H5S_ALL,H5P_DEFAULT,&dval); - } - - /* Close */ - H5Dclose(dset_id); - H5Sclose(sid); -} /*------------------------------------------------------------------------- * Check all HDF5 classes @@ -641,6 +610,8 @@ static void write_null_dset(hid_t loc_id, int make_diffs) * H5T_ENUM, H5T_VLEN, H5T_ARRAY *------------------------------------------------------------------------- */ + + int test_dsetall(const char *file, int make_diffs /* flag to modify data buffers */) { @@ -677,7 +648,6 @@ int test_dsetall(const char *file, */ write_dset_in(group_id,"/dset",file_id,make_diffs); - write_null_dset(file_id, make_diffs); /* Close */ status = H5Dclose(dset_id); @@ -690,3 +660,6 @@ int test_dsetall(const char *file, assert(status>=0); return status; } + + + diff --git a/tools/h5repack/h5repack.c b/tools/h5repack/h5repack.c index 7ba5a6c..f9cb295 100644 --- a/tools/h5repack/h5repack.c +++ b/tools/h5repack/h5repack.c @@ -234,9 +234,6 @@ static int check_options(pack_opt_t *options) { int i, k, j, has_cp=0, has_ck=0; - unsigned szip_options_mask=H5_SZIP_NN_OPTION_MASK; - unsigned szip_pixels_per_block; - /*------------------------------------------------------------------------- * objects to layout *------------------------------------------------------------------------- @@ -337,8 +334,17 @@ static int check_options(pack_opt_t *options) default: break; case H5Z_FILTER_SZIP: + { + + unsigned szip_options_mask=H5_SZIP_NN_OPTION_MASK; + unsigned szip_pixels_per_block; szip_pixels_per_block=pack.filter[j].cd_values[0]; + + if (pack.filter[j].szip_coding==0) + szip_options_mask=H5_SZIP_NN_OPTION_MASK; + else + szip_options_mask=H5_SZIP_EC_OPTION_MASK; /* check szip parameters */ if ( pack.chunk.rank!=-1 /* @@ -364,6 +370,7 @@ static int check_options(pack_opt_t *options) } + } break; } /* switch */ diff --git a/tools/h5repack/h5repack.h b/tools/h5repack/h5repack.h index 3a3a7c0..4691a74 100644 --- a/tools/h5repack/h5repack.h +++ b/tools/h5repack/h5repack.h @@ -21,7 +21,9 @@ #include "h5diff.h" #include "h5tools.h" +#if 0 #define CHECK_SZIP +#endif #define H5FOPENERROR "unable to open file" @@ -58,6 +60,11 @@ typedef struct { typedef struct { H5Z_filter_t filtn; /* filter identification number */ int cd_values[CDVALUES]; /* filter client data values */ + /* extra input for szip, selects the coding method + entropy coding method: EC=0 + nearest neighbor coding method: NN=1 + */ + int szip_coding; } filter_info_t; /* chunk lengths along each dimension and rank */ @@ -192,17 +199,6 @@ int apply_filters(const char* name, /* object name from traverse list */ int has_filter(hid_t dcpl_id, H5Z_filter_t filtnin); -int check_szip_params( unsigned bits_per_pixel, - unsigned pixels_per_block, - unsigned pixels_per_scanline, - hsize_t image_pixels); - -int check_szip(hid_t type_id, /* dataset datatype */ - int rank, /* chunk rank */ - hsize_t *dims, /* chunk dims */ - unsigned szip_options_mask /*IN*/, - unsigned *szip_pixels_per_block /*IN,OUT*/, - pack_opt_t *options); int can_read(const char* name, /* object name from traverse list */ hid_t dcpl_id, /* dataset creation property list */ @@ -306,12 +302,12 @@ void write_attr_in(hid_t loc_id, const char* dset_name, /* for saving reference to dataset*/ hid_t fid, /* for reference create */ int make_diffs /* flag to modify data buffers */); -void write_null_attr(hid_t loc_id); void write_dset_in(hid_t loc_id, const char* dset_name, /* for saving reference to dataset*/ hid_t file_id, int make_diffs /* flag to modify data buffers */); -void write_null_dset(hid_t loc_id); + + /*------------------------------------------------------------------------- * tests utils @@ -337,6 +333,22 @@ int make_attr(hid_t loc_id, *------------------------------------------------------------------------- */ +#if defined (CHECK_SZIP) + +int check_szip_params( unsigned bits_per_pixel, + unsigned pixels_per_block, + unsigned pixels_per_scanline, + hsize_t image_pixels); + +int check_szip(hid_t type_id, /* dataset datatype */ + int rank, /* chunk rank */ + hsize_t *dims, /* chunk dims */ + unsigned szip_options_mask /*IN*/, + unsigned *szip_pixels_per_block /*IN,OUT*/, + pack_opt_t *options); + + + typedef struct { int compression_mode; @@ -368,6 +380,7 @@ typedef struct #define NN_MODE 1 #endif +#endif /* CHECK_SZIP */ #endif /* H5REPACK_H__ */ diff --git a/tools/h5repack/h5repack.sh.in b/tools/h5repack/h5repack.sh.in index e4d65de..98b46ba 100755 --- a/tools/h5repack/h5repack.sh.in +++ b/tools/h5repack/h5repack.sh.in @@ -25,7 +25,7 @@ USE_FILTER_FLETCHER32="@USE_FILTER_FLETCHER32@" H5REPACK=h5repack # The tool name H5REPACK_BIN=`pwd`/$H5REPACK # The path of the tool binary -H5DIFF=../h5diff/h5diff # The h5diff tool name +H5DIFF=../h5diff/h5diff # The h5diff tool name H5DIFF_BIN=`pwd`/$H5DIFF # The path of the h5diff tool binary nerrors=0 @@ -68,9 +68,9 @@ DIFFTEST() { VERIFY $@ if [ "`uname -s`" = "TFLOPS O/S" ]; then - $RUNSERIAL $H5DIFF_BIN $@ + $RUNSERIAL $H5DIFF_BIN $@ -q else - $RUNSERIAL $H5DIFF_BIN "$@" + $RUNSERIAL $H5DIFF_BIN "$@" -q fi RET=$? if [ $RET != 0 ] ; then @@ -151,7 +151,7 @@ else fi # szip with individual object -arg="test4.h5 -f dset2:SZIP=8 -l dset2:CHUNK=20x10" +arg="test4.h5 -f dset2:SZIP=8,EC -l dset2:CHUNK=20x10" if test $USE_FILTER_SZIP_ENCODER != "yes" -o $USE_FILTER_SZIP != "yes" ; then SKIP $arg else @@ -159,7 +159,7 @@ else fi # szip for all -arg="test4.h5 -f SZIP=8" +arg="test4.h5 -f SZIP=8,NN" if test $USE_FILTER_SZIP_ENCODER != "yes" -o $USE_FILTER_SZIP != "yes" ; then SKIP $arg else @@ -200,7 +200,7 @@ else fi # all filters -arg="test4.h5 -f dset2:SHUF -f dset2:FLET -f dset2:SZIP=8 -f dset2:GZIP=1 -l dset2:CHUNK=20x10" +arg="test4.h5 -f dset2:SHUF -f dset2:FLET -f dset2:SZIP=8,NN -f dset2:GZIP=1 -l dset2:CHUNK=20x10" if test $USE_FILTER_SZIP_ENCODER != "yes" -o $USE_FILTER_SZIP != "yes" -o $USE_FILTER_SHUFFLE != "yes" -o $USE_FILTER_FLETCHER32 != "yes" -o $USE_FILTER_DEFLATE != "yes" ; then SKIP $arg else @@ -285,7 +285,7 @@ fi #filter conversions -arg="test_deflate.h5 -f dset_deflate:SZIP=8" +arg="test_deflate.h5 -f dset_deflate:SZIP=8,NN" if test $USE_FILTER_SZIP_ENCODER != "yes" -o $USE_FILTER_SZIP != "yes" -o $USE_FILTER_DEFLATE != "yes" ; then SKIP $arg else diff --git a/tools/h5repack/h5repack_copy.c b/tools/h5repack/h5repack_copy.c index 870f3c7..110069b 100644 --- a/tools/h5repack/h5repack_copy.c +++ b/tools/h5repack/h5repack_copy.c @@ -19,6 +19,110 @@ #include "H5private.h" #include "h5repack.h" +#if 0 +#define PRINT_DEBUG +#endif + +/*------------------------------------------------------------------------- + * Function: print_obj + * + * Purpose: print name and filters of an object + * + *------------------------------------------------------------------------- + */ +static void print_obj(hid_t dcpl_id, char *name) +{ + char str[255]; +#if defined (PRINT_DEBUG ) + char temp[255]; +#endif + int nfilters; /* number of filters */ + unsigned filt_flags; /* filter flags */ + H5Z_filter_t filtn; /* filter identification number */ + unsigned cd_values[20]; /* filter client data values */ + size_t cd_nelmts; /* filter client number of values */ + char f_name[256]; /* filter name */ + int i; + + strcpy(str,"\0"); + + /* get information about input filters */ + if ((nfilters = H5Pget_nfilters(dcpl_id))<0) + return; + + for ( i=0; infilters; i++) - { - switch (obj->filter[i].filtn) - { - default: - break; - case H5Z_FILTER_DEFLATE: - strcat(str,"GZIP "); - break; - case H5Z_FILTER_SZIP: - strcat(str,"SZIP "); - break; - case H5Z_FILTER_SHUFFLE: - strcat(str,"SHUF "); - break; - case H5Z_FILTER_FLETCHER32: - strcat(str,"FLET "); - break; - } /* switch */ - }/*i*/ - - printf(" %-10s %s %s\n", "dataset",str,name ); - -} /*------------------------------------------------------------------------- @@ -262,9 +326,6 @@ int do_copy_objects(hid_t fidin, if ((msize=H5Tget_size(mtype_id))==0) goto error; - if (options->verbose) - print_filters(dcpl_id); - /*------------------------------------------------------------------------- * check for external files *------------------------------------------------------------------------- @@ -370,7 +431,7 @@ int do_copy_objects(hid_t fidin, free(buf); if (options->verbose && wrote) - print_obj(&obj,travt->objs[i].name ); + print_obj(dcpl_id,travt->objs[i].name ); diff --git a/tools/h5repack/h5repack_filters.c b/tools/h5repack/h5repack_filters.c index 61ef4a7..2536ced 100644 --- a/tools/h5repack/h5repack_filters.c +++ b/tools/h5repack/h5repack_filters.c @@ -122,8 +122,6 @@ 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 */ - unsigned szip_options_mask=H5_SZIP_NN_OPTION_MASK; - unsigned szip_pixels_per_block; int i; /* check first if the object is to be filtered */ @@ -205,15 +203,23 @@ int apply_filters(const char* name, /* object name from traverse list */ *------------------------------------------------------------------------- */ case H5Z_FILTER_SZIP: - szip_pixels_per_block=obj->filter[i].cd_values[0]; - + { + unsigned options_mask; + unsigned pixels_per_block; + + pixels_per_block=obj->filter[i].cd_values[0]; + if (obj->filter[i].szip_coding==0) + options_mask=H5_SZIP_NN_OPTION_MASK; + else + options_mask=H5_SZIP_EC_OPTION_MASK; + #if defined (CHECK_SZIP) /* check szip parameters */ if (check_szip(type_id, obj->chunk.rank, obj->chunk.chunk_lengths, - szip_options_mask, - &szip_pixels_per_block, + options_mask, + &pixels_per_block, options)==1) { #endif @@ -221,9 +227,10 @@ int apply_filters(const char* name, /* object name from traverse list */ /* set up for szip data */ if(H5Pset_chunk(dcpl_id,obj->chunk.rank,obj->chunk.chunk_lengths)<0) return -1; - if (H5Pset_szip(dcpl_id, szip_options_mask, szip_pixels_per_block)<0) + if (H5Pset_szip(dcpl_id,options_mask,pixels_per_block)<0) return -1; + #if defined (CHECK_SZIP) } else @@ -234,6 +241,7 @@ int apply_filters(const char* name, /* object name from traverse list */ #endif + } break; /*------------------------------------------------------------------------- @@ -269,7 +277,6 @@ out: } - /*------------------------------------------------------------------------- * Function: print_filters * @@ -277,7 +284,7 @@ out: * * Return: 0, ok, -1 no * - * Programmer: pvn@ncsa.uiuc.edu + * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu * * Date: December 19, 2003 * @@ -292,7 +299,7 @@ int print_filters(hid_t dcpl_id) unsigned cd_values[20]; /* filter client data values */ size_t cd_nelmts; /* filter client number of values */ size_t cd_num; /* filter client data counter */ - char f_name[256]; /* filter/file name */ + char f_name[256]; /* filter name */ char s[64]; /* temporary string buffer */ int i; @@ -338,6 +345,9 @@ int print_filters(hid_t dcpl_id) } +#if defined (CHECK_SZIP) + + /*------------------------------------------------------------------------- * Function: check_szip * @@ -353,7 +363,7 @@ int print_filters(hid_t dcpl_id) * Return: 1=can apply the filter * 0=cannot apply the filter * - * Programmer: pvn@ncsa.uiuc.edu + * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu * * Date: December 23, 2003 * @@ -560,3 +570,6 @@ int check_szip_params( unsigned bits_per_pixel, return 1; } +#endif /* CHECK_SZIP */ + + diff --git a/tools/h5repack/h5repack_main.c b/tools/h5repack/h5repack_main.c index 810d30f..442af99 100644 --- a/tools/h5repack/h5repack_main.c +++ b/tools/h5repack/h5repack_main.c @@ -17,9 +17,25 @@ static void usage(void); -/* -h5repack main program -*/ +/*------------------------------------------------------------------------- + * Function: main + * + * Purpose: h5repack main program + * + * Return: 1, error, 0, no error + * + * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu + * + * Date: May 9, 2003 + * + * Comments: + * + * Modifications: July 2004 + * Introduced the extra EC or NN option for SZIP + * + *------------------------------------------------------------------------- + */ + int main(int argc, char **argv) { @@ -33,6 +49,10 @@ int main(int argc, char **argv) for ( i = 1; i < argc; i++) { + if (strcmp(argv[i], "-h") == 0) { + usage(); + exit(0); + } if (strcmp(argv[i], "-i") == 0) { infile = argv[++i]; } @@ -76,11 +96,15 @@ int main(int argc, char **argv) else if (argv[i][0] == '-') { usage(); + exit(1); } } if (infile == NULL || outfile == NULL) + { usage(); + exit(1); + } /* pack it */ ret=h5repack(infile,outfile,&options); @@ -112,8 +136,9 @@ void usage(void) printf("-i input Input HDF5 File\n"); printf("-o output Output HDF5 File\n"); printf("[-h] Print usage message\n"); + printf("[-v] Verbose mode. Print output (list of objects, filters, warnings)\n"); printf("[-f 'filter'] Filter type: 'filter' is a string with the format\n"); - printf(" : \n"); + printf(" : = \n"); printf(" is a comma separated list of object names\n"); printf(" meaning apply compression only to those objects.\n"); printf(" if no object names are specified, the filter is applied to all objects\n"); @@ -124,8 +149,10 @@ void usage(void) printf(" FLET, to apply the HDF5 checksum filter\n"); printf(" NONE, to remove the filter\n"); printf(" is optional compression info\n"); - printf(" GZIP, the deflation level\n"); - printf(" SZIP, the pixels per block parameter\n"); + printf(" SHUF (no parameter)\n"); + printf(" FLET (no parameter)\n"); + printf(" GZIP= from 1-9\n"); + printf(" SZIP= (pixels per block is a even number in 2-32 and coding method is 'EC' or 'NN')\n"); printf("[-l 'layout'] Layout type. 'layout' is a string with the format\n"); printf(" : \n"); printf(" is a comma separated list of object names,\n"); @@ -143,8 +170,20 @@ void usage(void) printf("-m number Do not apply the filter to objects which size in bytes is smaller than number.\n"); printf(" If no size is specified a minimum of 1024 bytes is assumed.\n"); printf("\n"); - - exit(1); + printf("Examples of use:\n"); + printf("\n"); + printf("1) h5repack -i file1 -o file2 -f GZIP=1 -v\n"); + printf("\n"); + printf(" Applies GZIP compression to all objects in file1 and saves the output in file2\n"); + printf("\n"); + printf("2) h5repack -i file1 -o file2 -f dset1:SZIP=8,NN -v\n"); + printf("\n"); + printf(" Applies SZIP compression only to object 'dset1'\n"); + printf("\n"); + printf("3) h5repack -i file1 -o file2 -l dset1,dset2:CHUNK=20x10 -v\n"); + printf("\n"); + printf(" Applies chunked layout to objects 'dset1' and 'dset2'\n"); + printf("\n"); } diff --git a/tools/h5repack/h5repack_opttable.c b/tools/h5repack/h5repack_opttable.c index 71cf1a8..cf76e82 100644 --- a/tools/h5repack/h5repack_opttable.c +++ b/tools/h5repack/h5repack_opttable.c @@ -35,7 +35,8 @@ void init_packobject(pack_info_t *obj) strcpy(obj->path,"\0"); for ( j=0; jfilter[j].filtn = -1; + obj->filter[j].filtn = -1; + obj->filter[j].szip_coding = -1; for ( k=0; kfilter[j].cd_values[k] = -1; } @@ -109,7 +110,7 @@ static void aux_tblinsert_layout(pack_opttbl_t *table, static int aux_inctable(pack_opttbl_t *table, int n_objs ) { - int i, j, k; + int i; table->size += n_objs; table->objs = (pack_info_t*)realloc(table->objs, table->size * sizeof(pack_info_t)); @@ -119,17 +120,7 @@ static int aux_inctable(pack_opttbl_t *table, int n_objs ) } for (i = table->nelems; i < table->size; i++) { - strcpy(table->objs[i].path,"\0"); - for ( j=0; jobjs[i].filter[j].filtn = -1; - for ( k=0; kobjs[i].filter[j].cd_values[k] = -1; - } - table->objs[i].chunk.rank = -1; - table->objs[i].refobj_id = -1; - table->objs[i].layout = H5D_LAYOUT_ERROR; - table->objs[i].nfilters = 0; + init_packobject(&table->objs[i]); } return 0; } @@ -146,7 +137,7 @@ static int aux_inctable(pack_opttbl_t *table, int n_objs ) int options_table_init( pack_opttbl_t **tbl ) { - int i, j, k; + int i; pack_opttbl_t* table = (pack_opttbl_t*) malloc(sizeof(pack_opttbl_t)); if (table==NULL) { printf("Error: not enough memory for options table\n"); @@ -163,17 +154,7 @@ int options_table_init( pack_opttbl_t **tbl ) for ( i=0; isize; i++) { - strcpy(table->objs[i].path,"\0"); - for ( j=0; jobjs[i].filter[j].filtn = -1; - for ( k=0; kobjs[i].filter[j].cd_values[k] = -1; - } - table->objs[i].chunk.rank = -1; - table->objs[i].refobj_id = -1; - table->objs[i].layout = H5D_LAYOUT_ERROR; - table->objs[i].nfilters = 0; + init_packobject(&table->objs[i]); } *tbl = table; diff --git a/tools/h5repack/h5repack_parse.c b/tools/h5repack/h5repack_parse.c index 96f7bce..e6974c0 100644 --- a/tools/h5repack/h5repack_parse.c +++ b/tools/h5repack/h5repack_parse.c @@ -56,10 +56,11 @@ obj_list_t* parse_filter(const char *str, unsigned i, u; char c; size_t len=strlen(str); - int j, m, n, k, end_obj=-1, no_param=0; + int j, m, n, k, l, end_obj=-1, no_param=0; char sobj[MAX_NC_NAME]; char scomp[10]; char stype[5]; + char smask[3]; obj_list_t* obj_list=NULL; unsigned pixels_per_block; @@ -132,17 +133,74 @@ obj_list_t* parse_filter(const char *str, if ( c=='=') { /*one more parameter */ scomp[k]='\0'; /*cut space */ - /* here we could have 1, 2 or 3 digits */ - for ( m=0,u=i+1; u\n",str); - exit(1); - } - stype[m]=c; - } - stype[m]='\0'; + /*SZIP is a special case , it can be + SZIP=8,EC + SZIP=8,NN + */ + + if (strcmp(scomp,"SZIP")==0) + { + l=-1; /* mask index check */ + for ( m=0,u=i+1; u\n",str); + exit(1); + } + if (l==-1) + stype[m]=c; + else + { + smask[l]=c; + l++; + if (l==2) + { + smask[l]='\0'; + i=len-1; /* end */ + (*n_objs)--; /* we counted an extra ',' */ + if (strcmp(smask,"NN")==0) + filt->szip_coding=0; + else if (strcmp(smask,"EC")==0) + filt->szip_coding=1; + else + { + printf("Input Error: szip mask must be 'NN' or 'EC' \n"); + exit(1); + } + + } + } + + } /* u */ + } /*if */ + + else + { + /* here we could have 1 or 2 digits */ + for ( m=0,u=i+1; u\n",str); + exit(1); + } + stype[m]=c; + } /* u */ + + stype[m]='\0'; + } /*if */ + + + filt->cd_values[j++]=atoi(stype); i+=m; /* jump */ } @@ -249,6 +307,11 @@ obj_list_t* parse_filter(const char *str, printf("Input Error: pixels_per_block is too large in <%s>\n",str); exit(1); } + if ( (strcmp(smask,"NN")!=0) && (strcmp(smask,"EC")!=0) ) { + if (obj_list) free(obj_list); + printf("Input Error: szip mask must be 'NN' or 'EC' \n"); + exit(1); + } break; }; diff --git a/tools/h5repack/h5repack_refs.c b/tools/h5repack/h5repack_refs.c index ef7f298..0db17f5 100644 --- a/tools/h5repack/h5repack_refs.c +++ b/tools/h5repack/h5repack_refs.c @@ -22,7 +22,7 @@ static const char* MapIdToName(hid_t refobj_id, trav_table_t *travt); -static void close_obj(H5G_obj_t obj_type, hid_t obj_id); +static void close_obj(H5G_obj_t1 obj_type, hid_t obj_id); static int copy_refs_attr(hid_t loc_in, @@ -142,7 +142,6 @@ int do_copy_refobjs(hid_t fidin, */ if (next==0 && h5tools_canreadf((NULL),dcpl_id)==1) { - /*------------------------------------------------------------------------- * test for a valid output dataset *------------------------------------------------------------------------- @@ -156,7 +155,7 @@ int do_copy_refobjs(hid_t fidin, */ if (H5Tequal(mtype_id, H5T_STD_REF_OBJ)) { - H5G_obj_t obj_type; + H5G_obj_t1 obj_type; hid_t refobj_id; hobj_ref_t *refbuf=NULL; /* buffer for object references */ hobj_ref_t *buf=NULL; @@ -231,7 +230,7 @@ int do_copy_refobjs(hid_t fidin, */ else if (H5Tequal(mtype_id, H5T_STD_REF_DSETREG)) { - H5G_obj_t obj_type; + H5G_obj_t1 obj_type; hid_t refobj_id; hdset_reg_ref_t *refbuf=NULL; /* input buffer for region references */ hdset_reg_ref_t *buf=NULL; /* output buffer */ @@ -528,7 +527,7 @@ static int copy_refs_attr(hid_t loc_in, */ if (H5Tequal(mtype_id, H5T_STD_REF_OBJ)) { - H5G_obj_t obj_type; + H5G_obj_t1 obj_type; hid_t refobj_id; hobj_ref_t *refbuf=NULL; unsigned k; @@ -605,7 +604,7 @@ static int copy_refs_attr(hid_t loc_in, */ else if (H5Tequal(mtype_id, H5T_STD_REF_DSETREG)) { - H5G_obj_t obj_type; + H5G_obj_t1 obj_type; hid_t refobj_id; hdset_reg_ref_t *refbuf=NULL; /* input buffer for region references */ hdset_reg_ref_t *buf=NULL; /* output buffer */ @@ -715,7 +714,7 @@ error: *------------------------------------------------------------------------- */ -static void close_obj(H5G_obj_t obj_type, hid_t obj_id) +static void close_obj(H5G_obj_t1 obj_type, hid_t obj_id) { H5E_BEGIN_TRY { diff --git a/tools/h5repack/h5repack_verify.c b/tools/h5repack/h5repack_verify.c index 30d3c05..983371e 100644 --- a/tools/h5repack/h5repack_verify.c +++ b/tools/h5repack/h5repack_verify.c @@ -25,7 +25,7 @@ * * Return: 1 has, 0 does not, -1 error * - * Programmer: pvn@ncsa.uiuc.edu + * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu * * Date: December 19, 2003 * @@ -99,7 +99,7 @@ int has_filter(hid_t dcpl_id, * * Return: 1 has, 0 does not, -1 error * - * Programmer: pvn@ncsa.uiuc.edu + * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu * * Date: December 30, 2003 * @@ -157,7 +157,7 @@ int has_layout(hid_t dcpl_id, * * Return: 1=filter present, 0=filter not present, -1=error * - * Programmer: pvn@ncsa.uiuc.edu + * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu * * Date: December 19, 2003 * @@ -193,11 +193,6 @@ int h5repack_verify(const char *fname, goto error; if ((dcpl_id=H5Dget_create_plist(dset_id))<0) goto error; - - if (options->verbose) { - printf(" %-10s %s\n", "dataset",name ); - print_filters(dcpl_id); - } /*------------------------------------------------------------------------- * filter check @@ -263,11 +258,7 @@ int h5repack_verify(const char *fname, goto error; if ((dcpl_id=H5Dget_create_plist(dset_id))<0) goto error; - - if (options->verbose) { - printf(" %-10s %s\n", "dataset",name ); - print_filters(dcpl_id); - } + /*------------------------------------------------------------------------- * filter check *------------------------------------------------------------------------- @@ -344,7 +335,7 @@ error: * * Return: 1=identical, 0=not identical, -1=error * - * Programmer: pvn@ncsa.uiuc.edu + * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu * * Date: December 31, 2003 * diff --git a/tools/h5repack/testh5repack_attr.c b/tools/h5repack/testh5repack_attr.c index dc03415..a1dad92 100644 --- a/tools/h5repack/testh5repack_attr.c +++ b/tools/h5repack/testh5repack_attr.c @@ -21,7 +21,7 @@ * * Purpose: write attributes in LOC_ID (dataset, group, named datatype) * - * Programmer: pvn@ncsa.uiuc.edu + * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu * * Date: November 12, 2003 * @@ -1028,30 +1028,5 @@ etc make_attr(loc_id,3,dims3,"float3D",H5T_NATIVE_FLOAT,buf83); } -/*------------------------------------------------------------------------- - * Function: write_null_attr - * - * Purpose: write null attribute in LOC_ID (dataset, group, named datatype) - * - * Programmer: Raymond Lu, slu@ncsa.uiuc.edu - * - * Date: May 24, 2004 - * - *------------------------------------------------------------------------- - */ -void write_null_attr(hid_t loc_id) -{ - hid_t sid, attr_id; - int val = 2; - - /* Create the null attribute */ - sid = H5Screate(H5S_NULL); - attr_id = H5Acreate(loc_id, "null_attr", H5T_NATIVE_INT, sid, H5P_DEFAULT); - - /* Not supposed to write anything */ - H5Awrite(attr_id, H5T_NATIVE_INT, &val); - - /* Close */ - H5Aclose(attr_id); - H5Sclose(sid); -} + + diff --git a/tools/h5repack/testh5repack_dset.c b/tools/h5repack/testh5repack_dset.c index 7f6345b..57a5b27 100644 --- a/tools/h5repack/testh5repack_dset.c +++ b/tools/h5repack/testh5repack_dset.c @@ -617,31 +617,7 @@ void write_dset_in(hid_t loc_id, write_dset(loc_id,3,dims3,"float3D",H5T_NATIVE_FLOAT,buf83); } -/*------------------------------------------------------------------------- - * Function: write_null_dset - * - * Purpose: write null dataset in LOC_ID - * - * Programmer: Raymond Lu, slu@ncsa.uiuc.edu - * - * Date: May 24, 2004 - * - *------------------------------------------------------------------------- - */ -void write_null_dset(hid_t loc_id) -{ - hid_t sid, dset_id; - int val = 2; - - /* Create the null dataset */ - sid = H5Screate(H5S_NULL); - dset_id = H5Dcreate(loc_id,"null_dset",H5T_NATIVE_INT,sid,H5P_DEFAULT); - H5Dwrite(dset_id,H5T_NATIVE_INT,H5S_ALL,H5S_ALL,H5P_DEFAULT,&val); - - /* Close */ - H5Dclose(dset_id); - H5Sclose(sid); -} + /*------------------------------------------------------------------------- * Function: make_dset_reg_ref diff --git a/tools/h5repack/testh5repack_main.c b/tools/h5repack/testh5repack_main.c index 0c976f4..af19db2 100644 --- a/tools/h5repack/testh5repack_main.c +++ b/tools/h5repack/testh5repack_main.c @@ -29,7 +29,7 @@ * Return: Success: zero * Failure: non-zero * - * Programmer: + * Programmer: Pedro Vicente * January, 6, 2004 * *------------------------------------------------------------------------- @@ -58,7 +58,7 @@ int main (void) * it returns RET==0 if the objects have the same data *------------------------------------------------------------------------- */ - + /*------------------------------------------------------------------------- * file with all kinds of dataset datatypes *------------------------------------------------------------------------- @@ -178,7 +178,7 @@ int main (void) if (h5repack_init (&pack_options, 0)<0) TEST_ERROR; - if (h5repack_addfilter("GZIP=9",&pack_options)<0) + if (h5repack_addfilter("GZIP=1",&pack_options)<0) TEST_ERROR; if (h5repack_addlayout("CHUNK=20x10",&pack_options)<0) TEST_ERROR; @@ -212,7 +212,7 @@ int main (void) if (h5repack_init (&pack_options, 0)<0) TEST_ERROR; - if (h5repack_addfilter("dset2:SZIP=8",&pack_options)<0) + if (h5repack_addfilter("dset2:SZIP=8,EC",&pack_options)<0) TEST_ERROR; if (h5repack_addlayout("dset2:CHUNK=20x10",&pack_options)<0) TEST_ERROR; @@ -240,7 +240,7 @@ TESTING(" adding szip filter to all"); #if defined (H5_HAVE_FILTER_SZIP) && defined (H5_SZIP_CAN_ENCODE) if (h5repack_init (&pack_options, 0)<0) TEST_ERROR; - if (h5repack_addfilter("SZIP=8",&pack_options)<0) + if (h5repack_addfilter("SZIP=8,NN",&pack_options)<0) TEST_ERROR; if (h5repack(FNAME4,FNAME4OUT,&pack_options)<0) TEST_ERROR; @@ -399,8 +399,8 @@ TESTING(" addding shuffle filter to all"); TEST_ERROR; #endif -#if defined (H5_HAVE_FILTER_SZIP) && defined (H5_SZIP_CAN_ENCODE) - if (h5repack_addfilter("dset1:SZIP=8",&pack_options)<0) +#if defined (H5_SZIP_CAN_ENCODE) && defined (H5_HAVE_FILTER_SZIP) + if (h5repack_addfilter("dset1:SZIP=8,NN",&pack_options)<0) TEST_ERROR; #endif @@ -409,7 +409,6 @@ TESTING(" addding shuffle filter to all"); TEST_ERROR; #endif - if (h5repack(FNAME4,FNAME4OUT,&pack_options)<0) TEST_ERROR; if (h5diff(FNAME4,FNAME4OUT,NULL,NULL,&diff_options) == 1) @@ -902,21 +901,26 @@ TESTING(" addding shuffle filter to all"); SKIPPED(); #endif - /*------------------------------------------------------------------------- - * test the NONE global option + * file with all filters + * dset_all + * dset_deflate + * dset_szip + * dset_shuffle + * dset_fletcher32 *------------------------------------------------------------------------- */ + - TESTING(" removing all filters"); + TESTING(" filter conversion from deflate to szip"); #if defined (H5_HAVE_FILTER_SZIP) && defined (H5_HAVE_FILTER_DEFLATE) \ && defined (H5_HAVE_FILTER_FLETCHER32) && defined (H5_HAVE_FILTER_SHUFFLE) if (h5repack_init (&pack_options, 0)<0) TEST_ERROR; - if (h5repack_addfilter("NONE",&pack_options)<0) + if (h5repack_addfilter("dset_deflate:SZIP=8,NN",&pack_options)<0) TEST_ERROR; if (h5repack(FNAME11,FNAME11OUT,&pack_options)<0) TEST_ERROR; @@ -931,54 +935,59 @@ TESTING(" addding shuffle filter to all"); #else SKIPPED(); #endif - - TESTING(" filter conversion from deflate to szip"); -/*------------------------------------------------------------------------- - * filter conversion from deflate to szip - *------------------------------------------------------------------------- - */ -#if (defined (H5_SZIP_CAN_ENCODE) && defined (H5_HAVE_FILTER_SZIP)) && defined(H5_HAVE_FILTER_DEFLATE) + + TESTING(" filter conversion from szip to deflate"); + +#if defined (H5_HAVE_FILTER_SZIP) && defined (H5_HAVE_FILTER_DEFLATE) \ + && defined (H5_HAVE_FILTER_FLETCHER32) && defined (H5_HAVE_FILTER_SHUFFLE) + if (h5repack_init (&pack_options, 0)<0) TEST_ERROR; - if (h5repack_addfilter("dset_deflate:SZIP=8",&pack_options)<0) + if (h5repack_addfilter("dset_szip:GZIP=1",&pack_options)<0) TEST_ERROR; - if (h5repack(FNAME8,FNAME8OUT,&pack_options)<0) + if (h5repack(FNAME11,FNAME11OUT,&pack_options)<0) TEST_ERROR; - if (h5diff(FNAME8,FNAME8OUT,NULL,NULL,&diff_options) == 1) + if (h5diff(FNAME11,FNAME11OUT,NULL,NULL,&diff_options) == 1) TEST_ERROR; - if (h5repack_verify(FNAME8OUT,&pack_options)<=0) + if (h5repack_verify(FNAME11OUT,&pack_options)<=0) TEST_ERROR; if (h5repack_end (&pack_options)<0) TEST_ERROR; + PASSED(); #else SKIPPED(); #endif - TESTING(" filter conversion from szip to deflate"); + /*------------------------------------------------------------------------- - * filter conversion from szip to deflate + * test the NONE global option *------------------------------------------------------------------------- */ -#if (defined (H5_SZIP_CAN_ENCODE) && defined (H5_HAVE_FILTER_SZIP)) && defined(H5_HAVE_FILTER_DEFLATE) + + TESTING(" removing all filters"); + +#if defined (H5_HAVE_FILTER_SZIP) && defined (H5_HAVE_FILTER_DEFLATE) \ + && defined (H5_HAVE_FILTER_FLETCHER32) && defined (H5_HAVE_FILTER_SHUFFLE) + if (h5repack_init (&pack_options, 0)<0) TEST_ERROR; - if (h5repack_addfilter("dset_szip:GZIP=1",&pack_options)<0) + if (h5repack_addfilter("NONE",&pack_options)<0) TEST_ERROR; - if (h5repack(FNAME7,FNAME7OUT,&pack_options)<0) + if (h5repack(FNAME11,FNAME11OUT,&pack_options)<0) TEST_ERROR; - if (h5diff(FNAME7,FNAME7OUT,NULL,NULL,&diff_options) == 1) + if (h5diff(FNAME11,FNAME11OUT,NULL,NULL,&diff_options) == 1) TEST_ERROR; - if (h5repack_verify(FNAME7OUT,&pack_options)<=0) + if (h5repack_verify(FNAME11OUT,&pack_options)<=0) TEST_ERROR; if (h5repack_end (&pack_options)<0) TEST_ERROR; + PASSED(); #else SKIPPED(); #endif - - + /*------------------------------------------------------------------------- * end diff --git a/tools/h5repack/testh5repack_make.c b/tools/h5repack/testh5repack_make.c index 249512c..b0293e3 100644 --- a/tools/h5repack/testh5repack_make.c +++ b/tools/h5repack/testh5repack_make.c @@ -586,7 +586,7 @@ int make_fletcher32(hid_t loc_id) /*------------------------------------------------------------------------- - * checksum + * fletcher32 *------------------------------------------------------------------------- */ #if defined (H5_HAVE_FILTER_FLETCHER32) @@ -625,7 +625,7 @@ out: /*------------------------------------------------------------------------- * Function: make_all * - * Purpose: make a dataset with the all filters + * Purpose: make a file with all filters * *------------------------------------------------------------------------- */ @@ -683,6 +683,69 @@ int make_all(hid_t loc_id) goto out; /*------------------------------------------------------------------------- + * fletcher32 + *------------------------------------------------------------------------- + */ +#if defined (H5_HAVE_FILTER_FLETCHER32) + /* remove the filters from the dcpl */ + if (H5Premove_filter(dcpl,H5Z_FILTER_ALL)<0) + goto out; + /* set the checksum filter */ + if (H5Pset_fletcher32(dcpl)<0) + goto out; + if (make_dset(loc_id,"dset_fletcher32",sid,dcpl,buf)<0) + goto out; +#endif + +/*------------------------------------------------------------------------- + * SZIP + *------------------------------------------------------------------------- + */ + /* Make sure encoding is enabled */ +#if defined (H5_SZIP_CAN_ENCODE) && defined (H5_HAVE_FILTER_SZIP) + /* remove the filters from the dcpl */ + if (H5Premove_filter(dcpl,H5Z_FILTER_ALL)<0) + goto out; + /* set szip data */ + if(H5Pset_szip (dcpl,szip_options_mask,szip_pixels_per_block)<0) + goto out; + if (make_dset(loc_id,"dset_szip",sid,dcpl,buf)<0) + goto out; +#endif + +/*------------------------------------------------------------------------- + * shuffle + *------------------------------------------------------------------------- + */ +#if defined (H5_HAVE_FILTER_SHUFFLE) + /* remove the filters from the dcpl */ + if (H5Premove_filter(dcpl,H5Z_FILTER_ALL)<0) + goto out; + /* set the shuffle filter */ + if (H5Pset_shuffle(dcpl)<0) + goto out; + if (make_dset(loc_id,"dset_shuffle",sid,dcpl,buf)<0) + goto out; +#endif + +/*------------------------------------------------------------------------- + * GZIP + *------------------------------------------------------------------------- + */ +#if defined (H5_HAVE_FILTER_DEFLATE) + /* remove the filters from the dcpl */ + if (H5Premove_filter(dcpl,H5Z_FILTER_ALL)<0) + goto out; + /* set deflate data */ + if(H5Pset_deflate(dcpl, 1)<0) + goto out; + if (make_dset(loc_id,"dset_deflate",sid,dcpl,buf)<0) + goto out; +#endif + + + +/*------------------------------------------------------------------------- * close space and dcpl *------------------------------------------------------------------------- */ diff --git a/tools/h5repack/testh5repack_util.c b/tools/h5repack/testh5repack_util.c index 0f7253b..f74b414 100644 --- a/tools/h5repack/testh5repack_util.c +++ b/tools/h5repack/testh5repack_util.c @@ -20,7 +20,7 @@ * * Purpose: utility function to create and write a dataset in LOC_ID * - * Programmer: pvn@ncsa.uiuc.edu + * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu * * Date: November 12, 2003 * @@ -60,7 +60,7 @@ int make_dset(hid_t loc_id, * * Purpose: utility function to create and write a dataset in LOC_ID * - * Programmer: pvn@ncsa.uiuc.edu + * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu * * Date: November 12, 2003 * @@ -106,7 +106,7 @@ int write_dset( hid_t loc_id, * * Purpose: utility function to write an attribute in LOC_ID * - * Programmer: pvn@ncsa.uiuc.edu + * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu * * Date: November 12, 2003 * diff --git a/tools/lib/h5diff.c b/tools/lib/h5diff.c index ab90ebb..818bc40 100644 --- a/tools/lib/h5diff.c +++ b/tools/lib/h5diff.c @@ -16,13 +16,28 @@ #include "h5diff.h" #include "H5private.h" + + +/*------------------------------------------------------------------------- + * Function: print_objname + * + * Purpose: print object name only when: + * 1) verbose mode + * 2) when diff was found (normal mode) + *------------------------------------------------------------------------- + */ +int print_objname(diff_opt_t *options, hsize_t nfound) +{ + return ( (options->m_verbose || nfound) && !options->m_quiet) ?1:0; +} + /*------------------------------------------------------------------------- * Function: h5diff * - * Purpose: public function, can be called in an applicattion program. + * Purpose: public function, can be called in an application program. * return differences between 2 HDF5 files * - * Return: Number of differences found; -1 for error. + * Return: Number of differences found. * * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu * @@ -31,17 +46,25 @@ *------------------------------------------------------------------------- */ -int h5diff(const char *fname1, - const char *fname2, - const char *objname1, - const char *objname2, - diff_opt_t *options) +hsize_t h5diff(const char *fname1, + const char *fname2, + const char *objname1, + const char *objname2, + diff_opt_t *options) { int nobjects1, nobjects2; trav_info_t *info1=NULL; trav_info_t *info2=NULL; hid_t file1_id, file2_id; - int nfound=0; + hsize_t nfound=0; + + if (options->m_quiet && + (options->m_verbose || options->m_report)) + { + printf("Error: -q (quiet mode) cannot be added to verbose or report modes\n"); + options->err_stat=1; + return 0; + } /*------------------------------------------------------------------------- * open the files first; if they are not valid, no point in continuing @@ -50,31 +73,40 @@ int h5diff(const char *fname1, /* disable error reporting */ H5E_BEGIN_TRY { - /* Open the files */ if ((file1_id=H5Fopen(fname1,H5F_ACC_RDONLY,H5P_DEFAULT))<0 ) { printf("h5diff: <%s>: unable to open file\n", fname1 ); - nfound = -1; + options->err_stat=1; + goto out; } if ((file2_id=H5Fopen(fname2,H5F_ACC_RDONLY,H5P_DEFAULT))<0 ) { printf("h5diff: <%s>: unable to open file\n", fname2 ); - nfound = -1; + options->err_stat=1; + goto out; } /* enable error reporting */ } H5E_END_TRY; - if (nfound<0) - return -1; + /*------------------------------------------------------------------------- * get the number of objects in the files *------------------------------------------------------------------------- */ - nobjects1 = h5trav_getinfo( file1_id, NULL, 0 ); nobjects2 = h5trav_getinfo( file2_id, NULL, 0 ); + if (nobjects1<0 || nobjects2<0) + { + printf("Error: Could not get get file contents\n"); + options->err_stat=1; + goto out; + } + + assert(nobjects1>0); + assert(nobjects2>0); + /*------------------------------------------------------------------------- * get the list of objects in the files *------------------------------------------------------------------------- @@ -84,7 +116,10 @@ int h5diff(const char *fname1, info2 = (trav_info_t*) malloc( nobjects2 * sizeof(trav_info_t)); if (info1==NULL || info2==NULL) { - nfound=-1; + printf("Error: Not enough memory for object list\n"); + options->err_stat=1; + if (info1) h5trav_freeinfo(info1,nobjects1); + if (info2) h5trav_freeinfo(info2,nobjects1); goto out; } @@ -99,6 +134,7 @@ int h5diff(const char *fname1, if ( objname1 ) { assert(objname2); + options->cmn_objs=1; /* eliminate warning */ nfound=diff_compare(file1_id,fname1,objname1,nobjects1,info1, file2_id,fname2,objname2,nobjects2,info2,options); } @@ -120,12 +156,13 @@ int h5diff(const char *fname1, out: /* close */ - H5Fclose(file1_id); - H5Fclose(file2_id); - - return nfound; + H5E_BEGIN_TRY { + H5Fclose(file1_id); + H5Fclose(file2_id); + } H5E_END_TRY; + return nfound; } @@ -145,13 +182,13 @@ out: * *------------------------------------------------------------------------- */ -int diff_match( hid_t file1_id, - int nobjects1, - trav_info_t *info1, - hid_t file2_id, - int nobjects2, - trav_info_t *info2, - diff_opt_t *options ) +hsize_t diff_match( hid_t file1_id, + int nobjects1, + trav_info_t *info1, + hid_t file2_id, + int nobjects2, + trav_info_t *info2, + diff_opt_t *options ) { int more_names_exist = (nobjects1>0 && nobjects2>0) ? 1 : 0; trav_table_t *table=NULL; @@ -160,7 +197,8 @@ int diff_match( hid_t file1_id, int curr2=0; unsigned infile[2]; char c1, c2; - int nfound=0, i; + hsize_t nfound=0; + int i; /*------------------------------------------------------------------------- * build the list @@ -168,7 +206,6 @@ int diff_match( hid_t file1_id, */ trav_table_init( &table ); - while ( more_names_exist ) { /* criteria is string compare */ @@ -226,7 +263,7 @@ int diff_match( hid_t file1_id, *------------------------------------------------------------------------- */ - if (options->verbose) + if (options->m_verbose) { printf("\n"); printf("file1 file2\n"); @@ -249,12 +286,15 @@ int diff_match( hid_t file1_id, for (i = 0; i < table->nobjs; i++) { if ( table->objs[i].flags[0] && table->objs[i].flags[1] ) + { + options->cmn_objs=1; nfound+=diff( file1_id, table->objs[i].name, file2_id, table->objs[i].name, options, table->objs[i].type ); + } } /* free table */ @@ -294,21 +334,21 @@ int diff_match( hid_t file1_id, *------------------------------------------------------------------------- */ -int diff_compare( hid_t file1_id, - const char *file1_name, - const char *obj1_name, - int nobjects1, - trav_info_t *info1, - hid_t file2_id, - const char *file2_name, - const char *obj2_name, - int nobjects2, - trav_info_t *info2, - diff_opt_t *options ) +hsize_t diff_compare( hid_t file1_id, + const char *file1_name, + const char *obj1_name, + int nobjects1, + trav_info_t *info1, + hid_t file2_id, + const char *file2_name, + const char *obj2_name, + int nobjects2, + trav_info_t *info2, + diff_opt_t *options ) { - int f1=0, f2=0; - int nfound=0; + int f1=0, f2=0; + hsize_t nfound=0; int i = h5trav_getindex( obj1_name, nobjects1, info1 ); int j = h5trav_getindex( obj2_name, nobjects2, info2 ); @@ -323,20 +363,23 @@ int diff_compare( hid_t file1_id, printf( "Object <%s> could not be found in <%s>\n", obj2_name, file2_name ); f2=1; } - if ( f1 || f2 ) - return -1; + if ( f1 || f2 ) { + options->err_stat=1; + return 0; + } /* use the name with "/" first, as obtained by iterator function */ obj1_name=info1[i].name; obj2_name=info2[j].name; /* objects are not the same type */ - if ( info1[i].type != info2[j].type && options->verbose) + if ( info1[i].type != info2[j].type) { + if (options->m_verbose) printf("Comparison not possible: <%s> is of type %s and <%s> is of type %s\n", obj1_name, get_type(info1[i].type), obj2_name, get_type(info2[j].type) ); - return 1; + return 0; } nfound=diff( file1_id, obj1_name, file2_id, obj2_name, options, info1[i].type ); @@ -364,23 +407,23 @@ int diff_compare( hid_t file1_id, *------------------------------------------------------------------------- */ -int diff( hid_t file1_id, - const char *path1, - hid_t file2_id, - const char *path2, - diff_opt_t *options, - H5G_obj_t type ) +hsize_t diff( hid_t file1_id, + const char *path1, + hid_t file2_id, + const char *path2, + diff_opt_t *options, + H5G_obj_t1 type ) { - hid_t type1_id=-1; - hid_t type2_id=-1; - hid_t grp1_id=-1; - hid_t grp2_id=-1; + hid_t type1_id; + hid_t type2_id; + hid_t grp1_id; + hid_t grp2_id; int ret; H5G_stat_t sb1; H5G_stat_t sb2; char *buf1=NULL; char *buf2=NULL; - int nfound=-1; + hsize_t nfound=0; switch ( type ) { @@ -389,9 +432,9 @@ int diff( hid_t file1_id, *------------------------------------------------------------------------- */ case H5G_DATASET: - if (options->verbose) - printf( "Dataset: <%s> and <%s>\n",path1,path2); - nfound=diff_dataset(file1_id,file2_id,path1,path2,options); + nfound=diff_dataset(file1_id,file2_id,path1,path2,options); + if (print_objname(options,nfound)) + printf( "Dataset: <%s> and <%s>\n",path1,path2); break; /*------------------------------------------------------------------------- @@ -399,9 +442,6 @@ int diff( hid_t file1_id, *------------------------------------------------------------------------- */ case H5G_TYPE: - if (options->verbose) - printf( "Datatype: <%s> and <%s>\n",path1,path2); - if ((type1_id = H5Topen(file1_id, path1))<0) goto out; if ((type2_id = H5Topen(file2_id, path2))<0) @@ -412,6 +452,9 @@ int diff( hid_t file1_id, /* if H5Tequal is > 0 then the datatypes refer to the same datatype */ nfound = (ret>0) ? 0 : 1; + + if (print_objname(options,nfound)) + printf( "Datatype: <%s> and <%s>\n",path1,path2); /*------------------------------------------------------------------------- * compare attributes @@ -419,7 +462,7 @@ int diff( hid_t file1_id, *------------------------------------------------------------------------- */ if (path1) - nfound=diff_attr(type1_id,type2_id,path1,path2,options); + diff_attr(type1_id,type2_id,path1,path2,options); if ( H5Tclose(type1_id)<0) goto out; @@ -433,9 +476,6 @@ int diff( hid_t file1_id, *------------------------------------------------------------------------- */ case H5G_GROUP: - if (options->verbose) - printf( "Group: <%s> and <%s>\n",path1,path2); - if ((grp1_id = H5Gopen(file1_id, path1))<0) goto out; if ((grp2_id = H5Gopen(file2_id, path2))<0) @@ -445,6 +485,9 @@ int diff( hid_t file1_id, /* if "path1" != "path2" then the groups are "different" */ nfound = (ret!=0) ? 1 : 0; + + if (print_objname(options,nfound)) + printf( "Group: <%s> and <%s>\n",path1,path2); /*------------------------------------------------------------------------- * compare attributes @@ -452,7 +495,7 @@ int diff( hid_t file1_id, *------------------------------------------------------------------------- */ if (path1) - nfound=diff_attr(grp1_id,grp2_id,path1,path2,options); + diff_attr(grp1_id,grp2_id,path1,path2,options); if ( H5Gclose(grp1_id)<0) goto out; @@ -467,9 +510,6 @@ int diff( hid_t file1_id, *------------------------------------------------------------------------- */ case H5G_LINK: - if (options->verbose) - printf( "Link: <%s> and <%s>\n",path1,path2); - if (H5Gget_objinfo(file1_id,path1,FALSE,&sb1)<0) goto out; if (H5Gget_objinfo(file1_id,path1,FALSE,&sb2)<0) @@ -488,6 +528,9 @@ int diff( hid_t file1_id, /* if "buf1" != "buf2" then the links are "different" */ nfound = (ret!=0) ? 1 : 0; + if (print_objname(options,nfound)) + printf( "Link: <%s> and <%s>\n",path1,path2); + if (buf1) { free(buf1); buf1=NULL; @@ -503,7 +546,7 @@ int diff( hid_t file1_id, default: nfound=0; - if (options->verbose) { + if (options->m_verbose) { printf("Comparison not supported: <%s> and <%s> are of type %s\n", path1, path2, get_type(type) ); } diff --git a/tools/lib/h5diff.h b/tools/lib/h5diff.h index 0c52f76..4c56f81 100644 --- a/tools/lib/h5diff.h +++ b/tools/lib/h5diff.h @@ -18,6 +18,9 @@ #include "hdf5.h" #include "h5trav.h" +typedef H5G_obj_t H5G_obj_t1; + + #if 0 #define H5DIFF_DEBUG @@ -51,14 +54,18 @@ */ typedef struct { - int r; /* report only what objects differ */ - int d; /* delta */ - double delta; /* delta value */ - int p; /* relative error */ - double percent; /* relative error value */ - int n; /* count */ - int count; /* count value */ - int verbose; /* print information */ + int m_quiet; /* quiet mide: no output at all */ + int m_report; /* report mode: print the data */ + int m_verbose; /* verbose mode: print the data, list of objcets, warnings */ + int d; /* delta, absolute value to compare */ + double delta; /* delta value */ + int p; /* relative error to compare*/ + double percent; /* relative error value */ + int n; /* count, compare up to count */ + int count; /* count value */ + int err_stat; /* an error ocurred (1, error, 0, no error) */ + int cmn_objs; /* do we have comparable objects */ + } diff_opt_t; @@ -72,11 +79,11 @@ typedef struct { extern "C" { #endif -int h5diff(const char *fname1, - const char *fname2, - const char *objname1, - const char *objname2, - diff_opt_t *options); +hsize_t h5diff(const char *fname1, + const char *fname2, + const char *objname1, + const char *objname2, + diff_opt_t *options); #ifdef __cplusplus @@ -91,56 +98,56 @@ int h5diff(const char *fname1, */ -int diff_dataset( hid_t file1_id, - hid_t file2_id, - const char *obj1_name, - const char *obj2_name, - diff_opt_t *options ); +hsize_t diff_dataset( hid_t file1_id, + hid_t file2_id, + const char *obj1_name, + const char *obj2_name, + diff_opt_t *options ); -int diff_datasetid( hid_t dset1_id, - hid_t dset2_id, - const char *obj1_name, - const char *obj2_name, +hsize_t diff_datasetid( hid_t dset1_id, + hid_t dset2_id, + const char *obj1_name, + const char *obj2_name, + diff_opt_t *options ); + +hsize_t diff( hid_t file1_id, + const char *path1, + hid_t file2_id, + const char *path2, + diff_opt_t *options, + H5G_obj_t1 type ); + +hsize_t diff_compare( hid_t file1_id, + const char *file1_name, + const char *obj1_name, + int nobjects1, + trav_info_t *info1, + hid_t file2_id, + const char *file2_name, + const char *obj2_name, + int nobjects2, + trav_info_t *info2, + diff_opt_t *options ); + +hsize_t diff_match( hid_t file1_id, + int nobjects1, + trav_info_t *info1, + hid_t file2_id, + int nobjects2, + trav_info_t *info2, diff_opt_t *options ); -int diff( hid_t file1_id, - const char *path1, - hid_t file2_id, - const char *path2, - diff_opt_t *options, - H5G_obj_t type ); - -int diff_compare( hid_t file1_id, - const char *file1_name, - const char *obj1_name, - int nobjects1, - trav_info_t *info1, - hid_t file2_id, - const char *file2_name, - const char *obj2_name, - int nobjects2, - trav_info_t *info2, - diff_opt_t *options ); - -int diff_match( hid_t file1_id, - int nobjects1, - trav_info_t *info1, - hid_t file2_id, - int nobjects2, - trav_info_t *info2, - diff_opt_t *options ); - -int diff_array( void *_mem1, - void *_mem2, - hsize_t nelmts, - int rank, - hsize_t *dims, - diff_opt_t *options, - const char *name1, - const char *name2, - hid_t m_type, - hid_t container1_id, - hid_t container2_id); /* dataset where the reference came from*/ +hsize_t diff_array( void *_mem1, + void *_mem2, + hsize_t nelmts, + int rank, + hsize_t *dims, + diff_opt_t *options, + const char *name1, + const char *name2, + hid_t m_type, + hid_t container1_id, + hid_t container2_id); /* dataset where the reference came from*/ int diff_can_type( hid_t f_type1, /* file data type */ @@ -169,6 +176,7 @@ int diff_attr(hid_t loc1_id, *------------------------------------------------------------------------- */ +void print_found(hsize_t nfound); void print_type(hid_t type); const char* diff_basename(const char *name); const char* get_type(int type); @@ -184,15 +192,52 @@ void print_pos( int *ph, const char *obj1, const char *obj2 ); +int print_objname(diff_opt_t *options, hsize_t nfound); + + #if defined (H5DIFF_DEBUG) void print_sizes( const char *obj1, const char *obj2, hid_t f_type1, hid_t f_type2, hid_t m_type1, hid_t m_type2 ); #endif -#ifdef NOT_YET -void diff_list( const char *filename, int nobjects, trav_info_t *info ); -#endif /* NOT_YET */ + +hsize_t diff_native_uchar(unsigned char *mem1, + unsigned char *mem2, + hsize_t i, + int rank, + hsize_t *acc, + hsize_t *pos, + diff_opt_t *options, + const char *obj1, + const char *obj2, + int *ph); + + +hsize_t diff_char(unsigned char *mem1, + unsigned char *mem2, + hsize_t i, + int rank, + hsize_t *acc, + hsize_t *pos, + diff_opt_t *options, + const char *obj1, + const char *obj2, + int *ph); + +hsize_t diff_datum(void *_mem1, + void *_mem2, + hid_t m_type, + hsize_t i, + int rank, + hsize_t *acc, + hsize_t *pos, + diff_opt_t *options, + const char *obj1, + const char *obj2, + hid_t container1_id, + hid_t container2_id, /*where the reference came from*/ + int *ph); /*print header */ diff --git a/tools/lib/h5diff_array.c b/tools/lib/h5diff_array.c index 838cc3d..51d87d0 100644 --- a/tools/lib/h5diff_array.c +++ b/tools/lib/h5diff_array.c @@ -16,54 +16,28 @@ #include "h5diff.h" #include "H5private.h" -static int diff_datum(void *_mem1, - void *_mem2, - hid_t m_type, - hsize_t i, - int rank, - hsize_t *acc, - hsize_t *pos, - diff_opt_t *options, - const char *obj1, - const char *obj2, - hid_t container1_id, - hid_t container2_id, - int *ph); - -static int diff_native_uchar(unsigned char *mem1, - unsigned char *mem2, - hsize_t i, - int rank, - hsize_t *acc, - hsize_t *pos, - diff_opt_t *options, - const char *obj1, - const char *obj2, - int *ph); - -static int diff_char(unsigned char *mem1, - unsigned char *mem2, - hsize_t i, - int rank, - hsize_t *acc, - hsize_t *pos, - diff_opt_t *options, - const char *obj1, - const char *obj2, - int *ph); - +/* local functions */ +static void close_obj(H5G_obj_t1 obj_type, hid_t obj_id); +static int diff_region(hid_t region1_id, hid_t region2_id); static hbool_t is_zero(const void *_mem, size_t size); -static void close_obj(H5G_obj_t obj_type, hid_t obj_id); -static int diff_region(hid_t region1_id, hid_t region2_id); - +/*------------------------------------------------------------------------- + * Function: print_data + * + * Purpose: print data only in report or verbose modes + *------------------------------------------------------------------------- + */ +static int print_data(diff_opt_t *options) +{ + return (options->m_report || options->m_verbose==1)?1:0; +} /*------------------------------------------------------------------------- * Function: diff_array * * Purpose: compare two memory buffers; * - * Return: number of differences found, -1 on error + * Return: number of differences found * * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu * @@ -72,19 +46,19 @@ static int diff_region(hid_t region1_id, hid_t region2_id); *------------------------------------------------------------------------- */ -int diff_array( void *_mem1, - void *_mem2, - hsize_t nelmts, - int rank, - hsize_t *dims, - diff_opt_t *options, - const char *name1, - const char *name2, - hid_t m_type, - hid_t container1_id, - hid_t container2_id) /* dataset where the reference came from*/ +hsize_t diff_array( void *_mem1, + void *_mem2, + hsize_t nelmts, + int rank, + hsize_t *dims, + diff_opt_t *options, + const char *name1, + const char *name2, + hid_t m_type, + hid_t container1_id, + hid_t container2_id) /* dataset where the reference came from*/ { - int nfound=0; /* number of differences found */ + hsize_t nfound=0; /* number of differences found */ size_t size; /* size of datum */ unsigned char *mem1 = (unsigned char*)_mem1; unsigned char *mem2 = (unsigned char*)_mem2; @@ -164,7 +138,7 @@ int diff_array( void *_mem1, * * Purpose: Compare the values pointed to in _MEM1 and _MEM2 of type M_TYPE * - * Return: number of differences found, -1 on error + * Return: number of differences found * * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu * @@ -197,20 +171,19 @@ int diff_array( void *_mem1, *------------------------------------------------------------------------- */ -static -int diff_datum( void *_mem1, - void *_mem2, - hid_t m_type, - hsize_t i, - int rank, - hsize_t *acc, - hsize_t *pos, - diff_opt_t *options, - const char *obj1, - const char *obj2, - hid_t container1_id, - hid_t container2_id, /*where the reference came from*/ - int *ph) /*print header */ +hsize_t diff_datum(void *_mem1, + void *_mem2, + hid_t m_type, + hsize_t i, + int rank, + hsize_t *acc, + hsize_t *pos, + diff_opt_t *options, + const char *obj1, + const char *obj2, + hid_t container1_id, + hid_t container2_id, /*where the reference came from*/ + int *ph) /*print header */ { char fmt_llong[255], fmt_ullong[255]; char fmt_llongp[255], fmt_ullongp[255]; @@ -228,13 +201,14 @@ int diff_datum( void *_mem1, size_t size; int iszero1; int iszero2; - H5G_obj_t obj1_type; - H5G_obj_t obj2_type; + H5G_obj_t1 obj1_type; + H5G_obj_t1 obj2_type; hid_t obj1_id; hid_t obj2_id; H5G_stat_t sb1; H5G_stat_t sb2; - int nfound=0; /* differences found */ + hsize_t nfound=0; /* differences found */ + int ret; /* Build default formats for long long types */ sprintf(fmt_llong, "%%%sd %%%sd %%%sd\n", @@ -381,7 +355,7 @@ int diff_datum( void *_mem1, if (HDstrcmp(enum_name1,enum_name2)!=0) { nfound=1; - if ( options->r==0 ) + if ( print_data(options) ) { print_pos(ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -501,17 +475,22 @@ int diff_datum( void *_mem1, hid_t region2_id; if ((obj1_id = H5Rdereference(container1_id, H5R_DATASET_REGION, _mem1))<0) - return -1; + ret= -1; if ((obj2_id = H5Rdereference(container2_id, H5R_DATASET_REGION, _mem2))<0) - return -1; + ret= -1; if (H5Gget_objinfo(obj1_id, ".", FALSE, &sb1)<0) - return -1; + ret= -1; if (H5Gget_objinfo(obj2_id, ".", FALSE, &sb2)<0) - return -1; + ret= -1; if ((region1_id = H5Rget_region(container1_id, H5R_DATASET_REGION, _mem1))<0) - return -1; + ret= -1; if ((region2_id = H5Rget_region(container2_id, H5R_DATASET_REGION, _mem2))<0) - return -1; + ret= -1; + + if (ret==-1) { + options->err_stat=1; + return 0; + } if (diff_region(region1_id,region2_id)) { @@ -535,9 +514,13 @@ int diff_datum( void *_mem1, { if ((obj1_type = H5Rget_obj_type(container1_id, H5R_OBJECT, _mem1))<0) - return -1; + ret= -1; if ((obj2_type = H5Rget_obj_type(container2_id, H5R_OBJECT, _mem2))<0) - return -1; + ret= -1; + if (ret==-1) { + options->err_stat=1; + return 0; + } /* check object type */ if (obj1_type!=obj2_type) @@ -547,9 +530,13 @@ int diff_datum( void *_mem1, } if ((obj1_id = H5Rdereference(container1_id, H5R_OBJECT, _mem1))<0) - return -1; + ret= -1; if ((obj2_id = H5Rdereference(container2_id, H5R_OBJECT, _mem2))<0) - return -1; + ret= -1; + if (ret==-1) { + options->err_stat=1; + return 0; + } /*deep compare */ @@ -597,7 +584,7 @@ int diff_datum( void *_mem1, { if (abs(temp1_char-temp2_char) > options->delta) { - if ( options->r==0 ) + if ( print_data(options) ) { print_pos(ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -611,7 +598,7 @@ int diff_datum( void *_mem1, { if ( temp1_char!=0 && abs(1-temp2_char/temp1_char) > options->percent ) { - if ( options->r==0 ) + if ( print_data(options) ) { print_pos(ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -627,7 +614,7 @@ int diff_datum( void *_mem1, if ( temp1_char!=0 && abs(1-temp2_char/temp1_char) > options->percent && abs(temp1_char-temp2_char) > options->delta ) { - if ( options->r==0 ) + if ( print_data(options) ) { print_pos(ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -639,7 +626,7 @@ int diff_datum( void *_mem1, } else if (temp1_char != temp2_char) { - if ( options->r==0 ) + if ( print_data(options) ) { print_pos(ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -667,7 +654,7 @@ int diff_datum( void *_mem1, { if (abs(temp1_uchar-temp2_uchar) > options->delta) { - if ( options->r==0 ) + if ( print_data(options) ) { print_pos(ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -681,7 +668,7 @@ int diff_datum( void *_mem1, { if ( temp1_uchar!=0 && abs(1-temp2_uchar/temp1_uchar) > options->percent ) { - if ( options->r==0 ) + if ( print_data(options) ) { print_pos(ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -697,7 +684,7 @@ int diff_datum( void *_mem1, if ( temp1_uchar!=0 && abs(1-temp2_uchar/temp1_uchar) > options->percent && abs(temp1_uchar-temp2_uchar) > options->delta ) { - if ( options->r==0 ) + if ( print_data(options) ) { print_pos(ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -709,7 +696,7 @@ int diff_datum( void *_mem1, } else if (temp1_uchar != temp2_uchar) { - if ( options->r==0 ) + if ( print_data(options) ) { print_pos(ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -739,7 +726,7 @@ int diff_datum( void *_mem1, { if (abs(temp1_short-temp2_short) > options->delta) { - if ( options->r==0 ) + if ( print_data(options) ) { print_pos(ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -753,7 +740,7 @@ int diff_datum( void *_mem1, { if ( temp1_short!=0 && abs(1-temp2_short/temp1_short) > options->percent ) { - if ( options->r==0 ) + if ( print_data(options) ) { print_pos(ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -769,7 +756,7 @@ int diff_datum( void *_mem1, if ( temp1_short!=0 && abs(1-temp2_short/temp1_short) > options->percent && abs(temp1_short-temp2_short) > options->delta ) { - if ( options->r==0 ) + if ( print_data(options) ) { print_pos(ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -781,7 +768,7 @@ int diff_datum( void *_mem1, } else if (temp1_short != temp2_short) { - if ( options->r==0 ) + if ( print_data(options) ) { print_pos(ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -812,7 +799,7 @@ int diff_datum( void *_mem1, if (abs(temp1_ushort-temp2_ushort) > options->delta) { - if ( options->r==0 ) + if ( print_data(options) ) { print_pos(ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -827,7 +814,7 @@ int diff_datum( void *_mem1, if ( temp1_ushort!=0 && abs(1-temp2_ushort/temp1_ushort) > options->percent ) { - if ( options->r==0 ) + if ( print_data(options) ) { print_pos(ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -844,7 +831,7 @@ int diff_datum( void *_mem1, abs(temp1_ushort-temp2_ushort) > options->delta ) { - if ( options->r==0 ) + if ( print_data(options) ) { print_pos(ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -857,7 +844,7 @@ int diff_datum( void *_mem1, else if (temp1_ushort != temp2_ushort) { - if ( options->r==0 ) + if ( print_data(options) ) { print_pos(ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -889,7 +876,7 @@ int diff_datum( void *_mem1, if (abs(temp1_int-temp2_int) > options->delta) { - if ( options->r==0 ) + if ( print_data(options) ) { print_pos(ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -904,7 +891,7 @@ int diff_datum( void *_mem1, if ( temp1_int!=0 && abs(1-temp2_int/temp1_int) > options->percent ) { - if ( options->r==0 ) + if ( print_data(options) ) { print_pos(ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -921,7 +908,7 @@ int diff_datum( void *_mem1, abs(temp1_int-temp2_int) > options->delta ) { - if ( options->r==0 ) + if ( print_data(options) ) { print_pos(ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -934,7 +921,7 @@ int diff_datum( void *_mem1, else if (temp1_int != temp2_int) { - if ( options->r==0 ) + if ( print_data(options) ) { print_pos(ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -966,7 +953,7 @@ int diff_datum( void *_mem1, if (abs((int)(temp1_uint-temp2_uint)) > options->delta) { - if ( options->r==0 ) + if ( print_data(options) ) { print_pos(ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -981,7 +968,7 @@ int diff_datum( void *_mem1, if ( temp1_uint!=0 && abs((int)(1-temp2_uint/temp1_uint)) > options->percent ) { - if ( options->r==0 ) + if ( print_data(options) ) { print_pos(ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -998,7 +985,7 @@ int diff_datum( void *_mem1, abs((int)(temp1_uint-temp2_uint)) > options->delta ) { - if ( options->r==0 ) + if ( print_data(options) ) { print_pos(ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -1011,7 +998,7 @@ int diff_datum( void *_mem1, else if (temp1_uint != temp2_uint) { - if ( options->r==0 ) + if ( print_data(options) ) { print_pos(ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -1044,7 +1031,7 @@ int diff_datum( void *_mem1, if (labs(temp1_long-temp2_long) > (long)options->delta) { - if ( options->r==0 ) + if ( print_data(options) ) { print_pos(ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -1059,7 +1046,7 @@ int diff_datum( void *_mem1, if ( temp1_long!=0 && labs(1-temp2_long/temp1_long) > (long)options->percent ) { - if ( options->r==0 ) + if ( print_data(options) ) { print_pos(ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -1076,7 +1063,7 @@ int diff_datum( void *_mem1, labs(temp1_long-temp2_long) > (long)options->delta ) { - if ( options->r==0 ) + if ( print_data(options) ) { print_pos(ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -1089,7 +1076,7 @@ int diff_datum( void *_mem1, else if (temp1_long != temp2_long) { - if ( options->r==0 ) + if ( print_data(options) ) { print_pos(ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -1121,7 +1108,7 @@ int diff_datum( void *_mem1, if (labs((long)(temp1_ulong-temp2_ulong)) > (long)options->delta) { - if ( options->r==0 ) + if ( print_data(options) ) { print_pos(ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -1136,7 +1123,7 @@ int diff_datum( void *_mem1, if ( temp1_ulong!=0 && labs((long)(1-temp2_ulong/temp1_ulong)) > (long)options->percent ) { - if ( options->r==0 ) + if ( print_data(options) ) { print_pos(ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -1153,7 +1140,7 @@ int diff_datum( void *_mem1, labs((long)(temp1_ulong-temp2_ulong)) > (long)options->delta ) { - if ( options->r==0 ) + if ( print_data(options) ) { print_pos(ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -1166,7 +1153,7 @@ int diff_datum( void *_mem1, else if (temp1_ulong != temp2_ulong) { - if ( options->r==0 ) + if ( print_data(options) ) { print_pos(ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -1197,7 +1184,7 @@ int diff_datum( void *_mem1, if (labs((long)(temp1_llong-temp2_llong)) > (long)options->delta) { - if ( options->r==0 ) + if ( print_data(options) ) { print_pos(ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -1212,7 +1199,7 @@ int diff_datum( void *_mem1, if ( temp1_llong!=0 && labs((long)(1-temp2_llong/temp1_llong)) > (long)options->percent ) { - if ( options->r==0 ) + if ( print_data(options) ) { print_pos(ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -1229,7 +1216,7 @@ int diff_datum( void *_mem1, labs((long)(temp1_llong-temp2_llong)) > (long)options->delta ) { - if ( options->r==0 ) + if ( print_data(options) ) { print_pos(ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -1242,7 +1229,7 @@ int diff_datum( void *_mem1, else if (temp1_llong != temp2_llong) { - if ( options->r==0 ) + if ( print_data(options) ) { print_pos(ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -1273,7 +1260,7 @@ int diff_datum( void *_mem1, if (labs((long)(temp1_ullong-temp2_ullong)) > (long)options->delta) { - if ( options->r==0 ) + if ( print_data(options) ) { print_pos(ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -1289,7 +1276,7 @@ int diff_datum( void *_mem1, if ( temp1_ullong!=0 && labs((long)(1-temp2_ullong/temp1_ullong)) > (long)options->percent ) { - if ( options->r==0 ) + if ( print_data(options) ) { print_pos(ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -1307,7 +1294,7 @@ int diff_datum( void *_mem1, labs((long)(temp1_ullong-temp2_ullong)) > (long)options->delta ) { - if ( options->r==0 ) + if ( print_data(options) ) { print_pos(ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -1321,7 +1308,7 @@ int diff_datum( void *_mem1, else if (temp1_ullong != temp2_ullong) { - if ( options->r==0 ) + if ( print_data(options) ) { print_pos(ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -1358,7 +1345,7 @@ int diff_datum( void *_mem1, if (fabs(temp1_float-temp2_float) > options->delta) { - if ( options->r==0 ) + if ( print_data(options) ) { print_pos(ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -1373,7 +1360,7 @@ int diff_datum( void *_mem1, if ( temp1_float!=0 && fabs(1-temp2_float/temp1_float) > options->percent ) { - if ( options->r==0 ) + if ( print_data(options) ) { print_pos(ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -1390,7 +1377,7 @@ int diff_datum( void *_mem1, fabs(temp1_float-temp2_float) > options->delta ) { - if ( options->r==0 ) + if ( print_data(options) ) { print_pos(ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -1403,7 +1390,7 @@ int diff_datum( void *_mem1, else if (temp1_float != temp2_float) { - if ( options->r==0 ) + if ( print_data(options) ) { print_pos(ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -1433,7 +1420,7 @@ int diff_datum( void *_mem1, if (fabs(temp1_double-temp2_double) > options->delta) { - if ( options->r==0 ) + if ( print_data(options) ) { print_pos(ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -1448,7 +1435,7 @@ int diff_datum( void *_mem1, if ( temp1_double!=0 && fabs(1-temp2_double/temp1_double) > options->percent ) { - if ( options->r==0 ) + if ( print_data(options) ) { print_pos(ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -1465,7 +1452,7 @@ int diff_datum( void *_mem1, fabs(temp1_double-temp2_double) > options->delta ) { - if ( options->r==0 ) + if ( print_data(options) ) { print_pos(ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -1478,7 +1465,7 @@ int diff_datum( void *_mem1, else if (temp1_double != temp2_double) { - if ( options->r==0 ) + if ( print_data(options) ) { print_pos(ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -1514,19 +1501,18 @@ int diff_datum( void *_mem1, *------------------------------------------------------------------------- */ -static -int diff_native_uchar(unsigned char *mem1, - unsigned char *mem2, - hsize_t i, - int rank, - hsize_t *acc, - hsize_t *pos, - diff_opt_t *options, - const char *obj1, - const char *obj2, - int *ph) +hsize_t diff_native_uchar(unsigned char *mem1, + unsigned char *mem2, + hsize_t i, + int rank, + hsize_t *acc, + hsize_t *pos, + diff_opt_t *options, + const char *obj1, + const char *obj2, + int *ph) { - int nfound=0; /* differences found */ + hsize_t nfound=0; /* differences found */ unsigned char temp1_uchar; unsigned char temp2_uchar; @@ -1538,7 +1524,7 @@ int diff_native_uchar(unsigned char *mem1, { if (abs(temp1_uchar-temp2_uchar) > options->delta) { - if ( options->r==0 ) + if ( print_data(options) ) { print_pos(ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -1552,7 +1538,7 @@ int diff_native_uchar(unsigned char *mem1, { if ( temp1_uchar!=0 && abs(1-temp2_uchar/temp1_uchar) > options->percent ) { - if ( options->r==0 ) + if ( print_data(options) ) { print_pos(ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -1568,7 +1554,7 @@ int diff_native_uchar(unsigned char *mem1, if ( temp1_uchar!=0 && abs(1-temp2_uchar/temp1_uchar) > options->percent && abs(temp1_uchar-temp2_uchar) > options->delta ) { - if ( options->r==0 ) + if ( print_data(options) ) { print_pos(ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -1580,7 +1566,7 @@ int diff_native_uchar(unsigned char *mem1, } else if (temp1_uchar != temp2_uchar) { - if ( options->r==0 ) + if ( print_data(options) ) { print_pos(ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -1607,19 +1593,18 @@ int diff_native_uchar(unsigned char *mem1, *------------------------------------------------------------------------- */ -static -int diff_char(unsigned char *mem1, - unsigned char *mem2, - hsize_t i, - int rank, - hsize_t *acc, - hsize_t *pos, - diff_opt_t *options, - const char *obj1, - const char *obj2, - int *ph) +hsize_t diff_char(unsigned char *mem1, + unsigned char *mem2, + hsize_t i, + int rank, + hsize_t *acc, + hsize_t *pos, + diff_opt_t *options, + const char *obj1, + const char *obj2, + int *ph) { - int nfound=0; /* differences found */ + hsize_t nfound=0; /* differences found */ unsigned char temp1_uchar; unsigned char temp2_uchar; @@ -1628,7 +1613,7 @@ int diff_char(unsigned char *mem1, if (temp1_uchar != temp2_uchar) { - if ( options->r==0 ) + if ( print_data(options) ) { print_pos(ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -1673,7 +1658,7 @@ is_zero(const void *_mem, size_t size) */ static -void close_obj(H5G_obj_t obj_type, hid_t obj_id) +void close_obj(H5G_obj_t1 obj_type, hid_t obj_id) { switch (obj_type) { diff --git a/tools/lib/h5diff_attr.c b/tools/lib/h5diff_attr.c index a7e6ce4..bf3a874 100644 --- a/tools/lib/h5diff_attr.c +++ b/tools/lib/h5diff_attr.c @@ -28,7 +28,6 @@ * Return: * 0 : no differences found * 1 : differences found - * -1 : error ocurred * * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu * @@ -52,7 +51,7 @@ int diff_attr(hid_t loc1_id, hid_t ftype2_id=-1; /* file data type ID */ hid_t mtype1_id=-1; /* memory data type ID */ hid_t mtype2_id=-1; /* memory data type ID */ - size_t msize1; /* memory size of memory type */ + size_t msize1; /* memory size of memory type */ size_t msize2; /* memory size of memory type */ void *buf1=NULL; /* data buffer */ void *buf2=NULL; /* data buffer */ @@ -61,11 +60,12 @@ int diff_attr(hid_t loc1_id, int rank2; /* rank of dataset */ hsize_t dims1[H5S_MAX_RANK];/* dimensions of dataset */ hsize_t dims2[H5S_MAX_RANK];/* dimensions of dataset */ - char name1[255]; + char name1[255]; char name2[255]; - int n1, n2, i, j, nfound; - H5S_class_t space_type1, space_type2; + int n1, n2, i, j; int ret=0; + hsize_t nfound; + int cmp=1; if ((n1 = H5Aget_num_attrs(loc1_id))<0) goto error; @@ -100,7 +100,7 @@ int diff_attr(hid_t loc1_id, if (HDstrcmp(name1,name2)!=0) { - if (options->verbose) + if (options->m_verbose) { printf("Different name for attributes: <%s> and <%s>\n", name1, name2); } @@ -110,119 +110,109 @@ int diff_attr(hid_t loc1_id, continue; } - /* get the file datatype */ - if ((ftype1_id = H5Aget_type( attr1_id )) < 0 ) - goto error; + /* get the file datatype */ + if ((ftype1_id = H5Aget_type( attr1_id )) < 0 ) + goto error; if ((ftype2_id = H5Aget_type( attr2_id )) < 0 ) - goto error; + goto error; - /* get the dataspace handle */ - if ((space1_id = H5Aget_space( attr1_id )) < 0 ) - goto error; + /* get the dataspace handle */ + if ((space1_id = H5Aget_space( attr1_id )) < 0 ) + goto error; if ((space2_id = H5Aget_space( attr2_id )) < 0 ) - goto error; + goto error; - space_type1 = H5Sget_simple_extent_type(space1_id); - space_type2 = H5Sget_simple_extent_type(space2_id); + /* get dimensions */ + if ( (rank1 = H5Sget_simple_extent_dims(space1_id, dims1, NULL)) < 0 ) + goto error; + if ( (rank2 = H5Sget_simple_extent_dims(space2_id, dims2, NULL)) < 0 ) + goto error; - /* get dimensions */ - if(space_type1 == H5S_NULL && space_type2 == H5S_NULL) { - if(options->verbose) { - printf( "Attribute: <%s> and <%s>\n",name1,name2); - sprintf(name1,"%s of <%s>",name1,path1); - sprintf(name2,"%s of <%s>",name2,path2); - printf( "type %s %s difference\n",name1,name2); - if ( !(H5Tequal(ftype1_id, ftype2_id)) && options->verbose) { - printf("\t\t"); - print_type(ftype1_id); - printf("\t\t"); - print_type(ftype2_id); - printf("\n"); - } - - printf("1 differences found\n"); - } - } else { - if ( (rank1 = H5Sget_simple_extent_dims(space1_id, dims1, NULL)) < 0 ) - goto error; +/*------------------------------------------------------------------------- + * check for comparable TYPE and SPACE + *------------------------------------------------------------------------- + */ + + if (diff_can_type(ftype1_id, + ftype2_id, + rank1, + rank2, + dims1, + dims2, + NULL, + NULL, + name1, + name2, + options)!=1) + cmp=0; +/*------------------------------------------------------------------------- + * only attempt to compare if possible + *------------------------------------------------------------------------- + */ + if (cmp) + { + +/*------------------------------------------------------------------------- + * read to memory + *------------------------------------------------------------------------- + */ + nelmts1=1; + for (j=0; j",name1,path1); + sprintf(name2,"%s of <%s>",name2,path2); + nfound = diff_array(buf1, + buf2, + nelmts1, + rank1, + dims1, + options, + name1, + name2, + mtype1_id, + attr1_id, + attr2_id); + + }/*cmp*/ - /*------------------------------------------------------------------------- - * check for comparable TYPE and SPACE - *------------------------------------------------------------------------- - */ - if (diff_can_type(ftype1_id, - ftype2_id, - rank1, - rank2, - dims1, - dims2, - NULL, - NULL, - name1, - name2, - options)!=1) - goto error; - - /*------------------------------------------------------------------------- - * read to memory - *------------------------------------------------------------------------- - */ - nelmts1=1; - for (j=0; j and <%s>\n",name1,name2); + print_found(nfound); + } - if (options->verbose) - printf( "Attribute: <%s> and <%s>\n",name1,name2); - sprintf(name1,"%s of <%s>",name1,path1); - sprintf(name2,"%s of <%s>",name2,path2); - nfound = diff_array(buf1, - buf2, - nelmts1, - rank1, - dims1, - options, - name1, - name2, - mtype1_id, - attr1_id, - attr2_id); - - if (options->verbose && nfound) - printf("%d differences found\n", nfound ); - - if (mtype1_id && H5Tclose(mtype1_id)<0) goto error; - if (mtype2_id && H5Tclose(mtype2_id)<0) goto error; - } /*------------------------------------------------------------------------- * close @@ -231,6 +221,8 @@ int diff_attr(hid_t loc1_id, if (H5Tclose(ftype1_id)<0) goto error; if (H5Tclose(ftype2_id)<0) goto error; + if (H5Tclose(mtype1_id)<0) goto error; + if (H5Tclose(mtype2_id)<0) goto error; if (H5Sclose(space1_id)<0) goto error; if (H5Sclose(space2_id)<0) goto error; if (H5Aclose(attr1_id)<0) goto error; @@ -247,18 +239,20 @@ error: H5E_BEGIN_TRY { H5Tclose(ftype1_id); H5Tclose(ftype2_id); - H5Tclose(mtype1_id); + H5Tclose(mtype1_id); H5Tclose(mtype2_id); - H5Sclose(space1_id); + H5Sclose(space1_id); H5Sclose(space2_id); - H5Aclose(attr1_id); + H5Aclose(attr1_id); H5Aclose(attr2_id); if (buf1) HDfree(buf1); if (buf2) HDfree(buf2); } H5E_END_TRY; - return -1; + + options->err_stat=1; + return 0; } diff --git a/tools/lib/h5diff_dset.c b/tools/lib/h5diff_dset.c index 4f90d67..69acfbd 100644 --- a/tools/lib/h5diff_dset.c +++ b/tools/lib/h5diff_dset.c @@ -30,47 +30,43 @@ * *------------------------------------------------------------------------- */ -int diff_dataset( hid_t file1_id, - hid_t file2_id, - const char *obj1_name, - const char *obj2_name, - diff_opt_t *options ) +hsize_t diff_dataset( hid_t file1_id, + hid_t file2_id, + const char *obj1_name, + const char *obj2_name, + diff_opt_t *options ) { - hid_t dset1_id =-1; - hid_t dset2_id =-1; - hid_t dcpl1_id=-1; - hid_t dcpl2_id=-1; - int gout=0, nfound=0; - - - /* disable error reporting */ - H5E_BEGIN_TRY { + hid_t dset1_id=-1; + hid_t dset2_id=-1; + hid_t dcpl1_id=-1; + hid_t dcpl2_id=-1; + hsize_t nfound=0; /*------------------------------------------------------------------------- * open the handles *------------------------------------------------------------------------- */ - + /* disable error reporting */ + H5E_BEGIN_TRY { /* Open the datasets */ if ( (dset1_id = H5Dopen(file1_id,obj1_name)) < 0 ) { printf("Cannot open dataset <%s>\n", obj1_name ); - gout=1; + goto error; } if ( (dset2_id = H5Dopen(file2_id,obj2_name)) < 0 ) { printf("Cannot open dataset <%s>\n", obj2_name ); - gout=1; + goto error; } /* enable error reporting */ } H5E_END_TRY; - if (gout) - goto out; + if ((dcpl1_id=H5Dget_create_plist(dset1_id))<0) - goto out; + goto error; if ((dcpl2_id=H5Dget_create_plist(dset2_id))<0) - goto out; + goto error; /*------------------------------------------------------------------------- * check if the dataset creation property list has filters that @@ -79,8 +75,8 @@ int diff_dataset( hid_t file1_id, * 2) the internal filters might be turned off *------------------------------------------------------------------------- */ - if ((h5tools_canreadf((options->verbose?obj1_name:NULL),dcpl1_id)==1) && - (h5tools_canreadf((options->verbose?obj2_name:NULL),dcpl2_id)==1)) + if ((h5tools_canreadf((options->m_verbose?obj1_name:NULL),dcpl1_id)==1) && + (h5tools_canreadf((options->m_verbose?obj2_name:NULL),dcpl2_id)==1)) { nfound=diff_datasetid(dset1_id, dset2_id, @@ -92,7 +88,19 @@ int diff_dataset( hid_t file1_id, * close *------------------------------------------------------------------------- */ -out: + /* disable error reporting */ + H5E_BEGIN_TRY { + H5Pclose(dcpl1_id); + H5Pclose(dcpl2_id); + H5Dclose(dset1_id); + H5Dclose(dset2_id); + /* enable error reporting */ + } H5E_END_TRY; + + return nfound; + +error: + options->err_stat=1; /* disable error reporting */ H5E_BEGIN_TRY { H5Pclose(dcpl1_id); @@ -123,11 +131,11 @@ out: * *------------------------------------------------------------------------- */ -int diff_datasetid( hid_t dset1_id, - hid_t dset2_id, - const char *obj1_name, - const char *obj2_name, - diff_opt_t *options ) +hsize_t diff_datasetid( hid_t dset1_id, + hid_t dset2_id, + const char *obj1_name, + const char *obj2_name, + diff_opt_t *options ) { hid_t space1_id =-1; hid_t space2_id =-1; @@ -142,83 +150,37 @@ int diff_datasetid( hid_t dset1_id, hsize_t dims2[H5S_MAX_RANK]; hsize_t maxdim1[H5S_MAX_RANK]; hsize_t maxdim2[H5S_MAX_RANK]; - int nfound=0; /* number of differences found */ const char *name1=NULL; /* relative names */ const char *name2=NULL; hsize_t storage_size1; hsize_t storage_size2; - H5S_class_t space_type1, space_type2; + hsize_t nfound=0; /* number of differences found */ + int cmp=1; /* do diff or not */ int i; - if (obj1_name) - name1=diff_basename(obj1_name); - if (obj2_name) - name2=diff_basename(obj2_name); - -/*------------------------------------------------------------------------- - * Get the file data type - *------------------------------------------------------------------------- - */ - - /* Get the data type */ - if ( (f_type1 = H5Dget_type(dset1_id)) < 0 ) - goto out; - - /* Get the data type */ - if ( (f_type2 = H5Dget_type(dset2_id)) < 0 ) - goto out; - -/*------------------------------------------------------------------------- - * Get the file data space - *------------------------------------------------------------------------- - */ - - /* Get the dataspace handle */ + /* Get the dataspace handle */ if ( (space1_id = H5Dget_space(dset1_id)) < 0 ) - goto out; + goto error; - if ( (space2_id = H5Dget_space(dset2_id)) < 0 ) - goto out; - - /* Get space type */ - space_type1 = H5Sget_simple_extent_type(space1_id); - space_type2 = H5Sget_simple_extent_type(space2_id); - - /* get dimensions */ - if(space_type1 == H5S_NULL && space_type2 == H5S_NULL) { - if(options->verbose) { - /*printf( "Dataset: <%s> and <%s>\n",name1,name2);*/ - /*sprintf(name1,"%s of <%s>",name1,path1); - sprintf(name2,"%s of <%s>",name2,path2);*/ - printf( "type %s %s difference\n",name1,name2); - - if ( !(H5Tequal(f_type1, f_type2)) && options->verbose) { - printf("\t"); - print_type(f_type1); - printf("\t\t"); - print_type(f_type2); - printf("\n"); - } - - printf("1 differences found\n"); - nfound = 1; - } - goto out; - } - /* Get rank */ if ( (rank1 = H5Sget_simple_extent_ndims(space1_id)) < 0 ) - goto out; + goto error; + /* Get the dataspace handle */ + if ( (space2_id = H5Dget_space(dset2_id)) < 0 ) + goto error; + + /* Get rank */ if ( (rank2 = H5Sget_simple_extent_ndims(space2_id)) < 0 ) - goto out; + goto error; /* Get dimensions */ if ( H5Sget_simple_extent_dims(space1_id,dims1,maxdim1) < 0 ) - goto out; + goto error; + /* Get dimensions */ if ( H5Sget_simple_extent_dims(space2_id,dims2,maxdim2) < 0 ) - goto out; + goto error; /*------------------------------------------------------------------------- * Get the file data type @@ -227,11 +189,11 @@ int diff_datasetid( hid_t dset1_id, /* Get the data type */ if ( (f_type1 = H5Dget_type(dset1_id)) < 0 ) - goto out; + goto error; /* Get the data type */ if ( (f_type2 = H5Dget_type(dset2_id)) < 0 ) - goto out; + goto error; /*------------------------------------------------------------------------- @@ -243,9 +205,9 @@ int diff_datasetid( hid_t dset1_id, storage_size2=H5Dget_storage_size(dset2_id); if (storage_size1<=0 && storage_size2<=0) { - if (options->verbose && obj1_name && obj2_name) + if (options->m_verbose && obj1_name && obj2_name) printf("<%s> and <%s> are empty datasets\n", obj1_name, obj2_name); - goto out; + cmp=0; } @@ -265,15 +227,11 @@ int diff_datasetid( hid_t dset1_id, obj1_name, obj2_name, options)!=1) - goto out; - - - + cmp=0; /*------------------------------------------------------------------------- * get number of elements *------------------------------------------------------------------------- */ - nelmts1 = 1; for (i = 0; i < rank1; i++) { @@ -293,7 +251,7 @@ int diff_datasetid( hid_t dset1_id, *------------------------------------------------------------------------- */ - if ( (H5Tequal(f_type1, f_type2)==0) && options->verbose && obj1_name) + if ( (H5Tequal(f_type1, f_type2)==0) && options->m_verbose && obj1_name) { printf("Warning: Different storage datatype\n"); printf("<%s> has file datatype ", obj1_name); @@ -329,11 +287,11 @@ int diff_datasetid( hid_t dset1_id, sign2=H5Tget_sign(m_type2); if ( sign1 != sign2 ) { - if (options->verbose && obj1_name) { + if (options->m_verbose && obj1_name) { printf("Comparison not supported: <%s> has sign %s ", obj1_name, get_sign(sign1)); printf("and <%s> has sign %s\n", obj2_name, get_sign(sign2)); } - goto out; + cmp=0; } /*------------------------------------------------------------------------- @@ -363,13 +321,20 @@ int diff_datasetid( hid_t dset1_id, } assert(m_size1==m_size2); +/*------------------------------------------------------------------------- + * only attempt to compare if possible + *------------------------------------------------------------------------- + */ + if (cmp) + { + buf1 = (void *) HDmalloc((unsigned) (nelmts1*m_size1)); buf2 = (void *) HDmalloc((unsigned) (nelmts2*m_size2)); if ( buf1 == NULL || buf2 == NULL ) { printf( "cannot read into memory\n" ); - goto out; + goto error; } /*------------------------------------------------------------------------- @@ -378,15 +343,19 @@ int diff_datasetid( hid_t dset1_id, */ if ( H5Dread(dset1_id,m_type1,H5S_ALL,H5S_ALL,H5P_DEFAULT,buf1) < 0 ) - goto out; + goto error; if ( H5Dread(dset2_id,m_type2,H5S_ALL,H5S_ALL,H5P_DEFAULT,buf2) < 0 ) - goto out; + goto error; /*------------------------------------------------------------------------- * array compare *------------------------------------------------------------------------- */ + if (obj1_name) + name1=diff_basename(obj1_name); + if (obj2_name) + name2=diff_basename(obj2_name); nfound = diff_array(buf1, buf2, nelmts1, @@ -398,10 +367,6 @@ int diff_datasetid( hid_t dset1_id, m_type1, dset1_id, dset2_id); - - if (options->verbose && nfound) - printf("%d differences found\n", nfound ); - /*------------------------------------------------------------------------- * compare attributes * the if condition refers to cases when the dataset is a referenced object @@ -409,18 +374,36 @@ int diff_datasetid( hid_t dset1_id, */ if (obj1_name) - nfound=diff_attr(dset1_id,dset2_id,obj1_name,obj2_name,options); + diff_attr(dset1_id,dset2_id,obj1_name,obj2_name,options); + + }/*cmp*/ /*------------------------------------------------------------------------- * close *------------------------------------------------------------------------- */ - -out: - + + if ( buf1) HDfree(buf1); if ( buf2) HDfree(buf2); + /* close */ + /* disable error reporting */ + H5E_BEGIN_TRY { + H5Sclose(space1_id); + H5Sclose(space2_id); + H5Tclose(f_type1); + H5Tclose(f_type2); + H5Tclose(m_type1); + H5Tclose(m_type2); + /* enable error reporting */ + } H5E_END_TRY; + return nfound; + +error: + options->err_stat=1; + if ( buf1) HDfree(buf1); + if ( buf2) HDfree(buf2); /* close */ /* disable error reporting */ H5E_BEGIN_TRY { @@ -486,7 +469,7 @@ int diff_can_type( hid_t f_type1, /* file data type */ if ( tclass1 != tclass2 ) { - if (options->verbose && obj1_name) { + if (options->m_verbose && obj1_name) { printf("Comparison not possible: <%s> is of class %s and <%s> is of class %s\n", obj1_name, get_class(tclass1), obj2_name, get_class(tclass2) ); @@ -516,7 +499,7 @@ int diff_can_type( hid_t f_type1, /* file data type */ break; default: /*H5T_TIME */ - if (options->verbose && obj1_name ) + if (options->m_verbose && obj1_name ) printf("Comparison not supported: <%s> and <%s> are of class %s\n", obj1_name,obj2_name,get_class(tclass2) ); return 0; @@ -527,7 +510,7 @@ int diff_can_type( hid_t f_type1, /* file data type */ *------------------------------------------------------------------------- */ - if ( (H5Tequal(f_type1, f_type2)==0) && options->verbose && obj1_name) + if ( (H5Tequal(f_type1, f_type2)==0) && options->m_verbose && obj1_name) { printf("Warning: Different storage datatype\n"); printf("<%s> has file datatype ", obj1_name); @@ -545,7 +528,7 @@ int diff_can_type( hid_t f_type1, /* file data type */ if ( rank1 != rank2 ) { - if (options->verbose && obj1_name) { + if (options->m_verbose && obj1_name) { printf("Comparison not supported: <%s> has rank %d, dimensions ", obj1_name, rank1); print_dims(rank1,dims1); printf(", max dimensions "); @@ -583,7 +566,7 @@ int diff_can_type( hid_t f_type1, /* file data type */ if (dim_diff==1) { - if (options->verbose && obj1_name) { + if (options->m_verbose && obj1_name) { printf("Comparison not supported: <%s> has rank %d, dimensions ", obj1_name, rank1); print_dims(rank1,dims1); if (maxdim1 && maxdim2) { @@ -605,7 +588,7 @@ int diff_can_type( hid_t f_type1, /* file data type */ */ if (maxdim1 && maxdim2 && maxdim_diff==1 && obj1_name ) { - if (options->verbose) { + if (options->m_verbose) { printf( "Warning: Different maximum dimensions\n"); printf("<%s> has max dimensions ", obj1_name); print_dims(rank1,maxdim1); diff --git a/tools/lib/h5diff_util.c b/tools/lib/h5diff_util.c index 7af48c4..bbd1747 100644 --- a/tools/lib/h5diff_util.c +++ b/tools/lib/h5diff_util.c @@ -333,6 +333,18 @@ get_class(H5T_class_t tclass) } } +/*------------------------------------------------------------------------- + * Function: print_found + * + * Purpose: print number of differences found + * + *------------------------------------------------------------------------- + */ +void print_found(hsize_t nfound) +{ + HDfprintf(stdout,"%Hu differences found\n",nfound); +} + /*------------------------------------------------------------------------- * Function: print_sizes diff --git a/tools/testfiles/file1.h5 b/tools/testfiles/file1.h5 index f7c115d..d8f3dac 100644 Binary files a/tools/testfiles/file1.h5 and b/tools/testfiles/file1.h5 differ diff --git a/tools/testfiles/file2.h5 b/tools/testfiles/file2.h5 index a7d7ed0..b47d4ba 100644 Binary files a/tools/testfiles/file2.h5 and b/tools/testfiles/file2.h5 differ diff --git a/tools/testfiles/file3.h5 b/tools/testfiles/file3.h5 index 04483b4..bf09dda 100644 Binary files a/tools/testfiles/file3.h5 and b/tools/testfiles/file3.h5 differ diff --git a/tools/testfiles/file4.h5 b/tools/testfiles/file4.h5 index 3aa87d9..81dde1d 100644 Binary files a/tools/testfiles/file4.h5 and b/tools/testfiles/file4.h5 differ diff --git a/tools/testfiles/file5.h5 b/tools/testfiles/file5.h5 index 88cea8a..b3d2d43 100644 Binary files a/tools/testfiles/file5.h5 and b/tools/testfiles/file5.h5 differ diff --git a/tools/testfiles/file6.h5 b/tools/testfiles/file6.h5 index dccca4e..efca139 100644 Binary files a/tools/testfiles/file6.h5 and b/tools/testfiles/file6.h5 differ diff --git a/tools/testfiles/file7.h5 b/tools/testfiles/file7.h5 index 3f891d9..5785901 100644 Binary files a/tools/testfiles/file7.h5 and b/tools/testfiles/file7.h5 differ diff --git a/tools/testfiles/file8.h5 b/tools/testfiles/file8.h5 index 2590a1b..1083a35 100644 Binary files a/tools/testfiles/file8.h5 and b/tools/testfiles/file8.h5 differ diff --git a/tools/testfiles/h5diff_10.txt b/tools/testfiles/h5diff_10.txt index f291c68..44622f3 100644 --- a/tools/testfiles/h5diff_10.txt +++ b/tools/testfiles/h5diff_10.txt @@ -9,8 +9,9 @@ file2 File name of the second HDF5 file [obj2] Name of an HDF5 object, in absolute path [OPTIONS] are: [-h] Print out this information -[-v] Verbose mode -[-r] Print only what objects differ, not the differences +[-r] Report mode. Print the differences +[-v] Verbose mode. Print the differences, list of objects, warnings +[-q] Quiet mode. Do not do output [-n count] Print difference up to count number [-d delta] Print difference when it is greater than limit delta [-p relative] Print difference when it is greater than a relative limit @@ -22,17 +23,28 @@ The 'delta' and 'relative' values must be positive numbers The -d compare criteria is |a - b| > delta The -p compare criteria is |1 - b/a| > relative -Examples: +h5diff has four modes of output: + Normal mode: print the number of differences found and where they occured + Report mode: print the above plus the differences + Verbose mode: print the above plus a list of objects and warnings + Quiet mode: do not print output (h5diff always returns an exit code of 1 when differences are found) -1) h5diff file1 file2 /a/b /a/c +Examples of use: - Compares object '/a/b' in file1 with '/a/c' in file2 +1) h5diff file1 file2 /g1/dset1 /g1/dset2 -2) h5diff file1 file2 /a/b + Compares object '/g1/dset1' in file1 with '/g1/dset2' in file2 - Compares object '/a/b' in both files +2) h5diff file1 file2 /g1/dset1 + + Compares object '/g1/dset1' in both files 3) h5diff file1 file2 Compares all objects in both files +Note) file1 and file2 can be the same file. Use + + h5diff file1 file1 /g1/dset1 /g1/dset2 + + to compare '/g1/dset1' and '/g1/dset2' in the same file diff --git a/tools/testfiles/h5diff_11.txt b/tools/testfiles/h5diff_11.txt index 73fe62f..056e486 100644 --- a/tools/testfiles/h5diff_11.txt +++ b/tools/testfiles/h5diff_11.txt @@ -1,9 +1,5 @@ ############################# -Expected output for 'h5diff file1.h5 file2.h5 g1/dset1 g1/dset2' +Expected output for 'h5diff file1.h5 file2.h5' ############################# -position dset1 dset2 difference ------------------------------------------------------------- -[ 0 1 ] 1.000000 1.100000 0.100000 -[ 1 0 ] 1.000000 1.010000 0.010000 -[ 1 1 ] 1.000000 1.001000 0.001000 -[ 2 0 ] 1.000000 1.000100 0.000100 +Dataset: and +4 differences found diff --git a/tools/testfiles/h5diff_12.txt b/tools/testfiles/h5diff_12.txt index ad9afa4..d4605b2 100644 --- a/tools/testfiles/h5diff_12.txt +++ b/tools/testfiles/h5diff_12.txt @@ -1,11 +1,5 @@ ############################# -Expected output for 'h5diff file1.h5 file2.h5 -v -n 2 g1/dset1 g1/dset2' +Expected output for 'h5diff file1.h5 file2.h5 g1/dset1 g1/dset2' ############################# -$h5diff file1.h5 file2.h5 -v -n 2 g1/dset1 g1/dset2 Dataset: and -position dset1 dset2 difference ------------------------------------------------------------- -[ 0 1 ] 1.000000 1.100000 0.100000 -[ 1 0 ] 1.000000 1.010000 0.010000 -2 differences found - +4 differences found diff --git a/tools/testfiles/h5diff_13.txt b/tools/testfiles/h5diff_13.txt index 406b01a..8d5c69e 100644 --- a/tools/testfiles/h5diff_13.txt +++ b/tools/testfiles/h5diff_13.txt @@ -1,15 +1,11 @@ ############################# -Expected output for 'h5diff file1.h5 file2.h5 -v -d 5 g1/dset3 g1/dset4' +Expected output for 'h5diff file1.h5 file2.h5 -r' ############################# -$h5diff file1.h5 file2.h5 -v -d 5 g1/dset3 g1/dset4 -Dataset: and -position dset3 dset4 difference +position dset1 dset1 difference ------------------------------------------------------------ -[ 0 0 ] 100.000000 110.000000 10.000000 -[ 0 1 ] 110.000000 100.000000 10.000000 -[ 1 0 ] 100.000000 90.000000 10.000000 -[ 1 1 ] 100.000000 80.000000 20.000000 -[ 2 0 ] 100.000000 140.000000 40.000000 -[ 2 1 ] 100.000000 200.000000 100.000000 -6 differences found - +[ 0 1 ] 1.000000 1.100000 0.100000 +[ 1 0 ] 1.000000 1.010000 0.010000 +[ 1 1 ] 1.000000 1.001000 0.001000 +[ 2 0 ] 1.000000 1.000100 0.000100 +Dataset: and +4 differences found diff --git a/tools/testfiles/h5diff_14.txt b/tools/testfiles/h5diff_14.txt index 8efcf83..33683d3 100644 --- a/tools/testfiles/h5diff_14.txt +++ b/tools/testfiles/h5diff_14.txt @@ -1,15 +1,11 @@ ############################# -Expected output for 'h5diff file1.h5 file2.h5 -v -p 0.05 g1/dset3 g1/dset4' +Expected output for 'h5diff file1.h5 file2.h5 -r g1/dset1 g1/dset2' ############################# -$h5diff file1.h5 file2.h5 -v -p 0.05 g1/dset3 g1/dset4 -Dataset: and -position dset3 dset4 difference relative ------------------------------------------------------------------------- -[ 0 0 ] 100 110 10 0.1 -[ 0 1 ] 110 100 10 0.09090909091 -[ 1 0 ] 100 90 10 0.1 -[ 1 1 ] 100 80 20 0.2 -[ 2 0 ] 100 140 40 0.4 -[ 2 1 ] 100 200 100 1 -6 differences found - +position dset1 dset2 difference +------------------------------------------------------------ +[ 0 1 ] 1.000000 1.100000 0.100000 +[ 1 0 ] 1.000000 1.010000 0.010000 +[ 1 1 ] 1.000000 1.001000 0.001000 +[ 2 0 ] 1.000000 1.000100 0.000100 +Dataset: and +4 differences found diff --git a/tools/testfiles/h5diff_15.txt b/tools/testfiles/h5diff_15.txt index 961c652..e2aeb88 100644 --- a/tools/testfiles/h5diff_15.txt +++ b/tools/testfiles/h5diff_15.txt @@ -1,7 +1,13 @@ ############################# -Expected output for 'h5diff file1.h5 file2.h5 -v -r g1/dset1 g1/dset2' +Expected output for 'h5diff file1.h5 file2.h5 -r -d 5 g1/dset3 g1/dset4' ############################# -$h5diff file1.h5 file2.h5 -v -r g1/dset1 g1/dset2 -Dataset: and -4 differences found - +position dset3 dset4 difference +------------------------------------------------------------ +[ 0 0 ] 100.000000 110.000000 10.000000 +[ 0 1 ] 110.000000 100.000000 10.000000 +[ 1 0 ] 100.000000 90.000000 10.000000 +[ 1 1 ] 100.000000 80.000000 20.000000 +[ 2 0 ] 100.000000 140.000000 40.000000 +[ 2 1 ] 100.000000 200.000000 100.000000 +Dataset: and +6 differences found diff --git a/tools/testfiles/h5diff_16.txt b/tools/testfiles/h5diff_16.txt index a397ae4..1aa2f72 100644 --- a/tools/testfiles/h5diff_16.txt +++ b/tools/testfiles/h5diff_16.txt @@ -1,9 +1,13 @@ ############################# -Expected output for 'h5diff file1.h5 file2.h5' +Expected output for 'h5diff file1.h5 file2.h5 -r -p 0.05 g1/dset3 g1/dset4' ############################# -position dset1 dset1 difference ------------------------------------------------------------- -[ 0 1 ] 1.000000 1.100000 0.100000 -[ 1 0 ] 1.000000 1.010000 0.010000 -[ 1 1 ] 1.000000 1.001000 0.001000 -[ 2 0 ] 1.000000 1.000100 0.000100 +position dset3 dset4 difference relative +------------------------------------------------------------------------ +[ 0 0 ] 100 110 10 0.1 +[ 0 1 ] 110 100 10 0.09090909091 +[ 1 0 ] 100 90 10 0.1 +[ 1 1 ] 100 80 20 0.2 +[ 2 0 ] 100 140 40 0.4 +[ 2 1 ] 100 200 100 1 +Dataset: and +6 differences found diff --git a/tools/testfiles/h5diff_17.txt b/tools/testfiles/h5diff_17.txt new file mode 100644 index 0000000..6f7a360 --- /dev/null +++ b/tools/testfiles/h5diff_17.txt @@ -0,0 +1,23 @@ +############################# +Expected output for 'h5diff file1.h5 file2.h5 -v' +############################# + +file1 file2 +--------------------------------------- + x x /g1 + x x /g1/dset1 + x /g1/dset2 + x /g1/dset3 + x /g1/dset4 + x /g2 + +Group: and +position dset1 dset1 difference +------------------------------------------------------------ +[ 0 1 ] 1.000000 1.100000 0.100000 +[ 1 0 ] 1.000000 1.010000 0.010000 +[ 1 1 ] 1.000000 1.001000 0.001000 +[ 2 0 ] 1.000000 1.000100 0.000100 +Dataset: and +Group: and +4 differences found diff --git a/tools/testfiles/h5diff_18.txt b/tools/testfiles/h5diff_18.txt new file mode 100644 index 0000000..6e914e4 --- /dev/null +++ b/tools/testfiles/h5diff_18.txt @@ -0,0 +1,3 @@ +############################# +Expected output for 'h5diff file1.h5 file2.h5 -q' +############################# diff --git a/tools/testfiles/h5diff_20.txt b/tools/testfiles/h5diff_20.txt index 6896f3e..e524fd6 100644 --- a/tools/testfiles/h5diff_20.txt +++ b/tools/testfiles/h5diff_20.txt @@ -1,6 +1,5 @@ ############################# Expected output for 'h5diff file3.h5 file3.h5 -v dset group' ############################# -$h5diff file3.h5 file3.h5 -v dset group Comparison not possible: is of type H5G_DATASET and is of type H5G_GROUP - +0 differences found diff --git a/tools/testfiles/h5diff_21.txt b/tools/testfiles/h5diff_21.txt index 15f91b6..a22a665 100644 --- a/tools/testfiles/h5diff_21.txt +++ b/tools/testfiles/h5diff_21.txt @@ -1,6 +1,5 @@ ############################# Expected output for 'h5diff file3.h5 file3.h5 -v dset link' ############################# -$h5diff file3.h5 file3.h5 -v dset link Comparison not possible: is of type H5G_DATASET and is of type H5G_LINK - +0 differences found diff --git a/tools/testfiles/h5diff_22.txt b/tools/testfiles/h5diff_22.txt index a518e7e..1c4b45a 100644 --- a/tools/testfiles/h5diff_22.txt +++ b/tools/testfiles/h5diff_22.txt @@ -1,6 +1,5 @@ ############################# Expected output for 'h5diff file3.h5 file3.h5 -v dset type' ############################# -$h5diff file3.h5 file3.h5 -v dset type Comparison not possible: is of type H5G_DATASET and is of type H5G_TYPE - +0 differences found diff --git a/tools/testfiles/h5diff_23.txt b/tools/testfiles/h5diff_23.txt index ee20e1d..d709dc6 100644 --- a/tools/testfiles/h5diff_23.txt +++ b/tools/testfiles/h5diff_23.txt @@ -1,6 +1,5 @@ ############################# Expected output for 'h5diff file3.h5 file3.h5 -v group group' ############################# -$h5diff file3.h5 file3.h5 -v group group Group: and - +0 differences found diff --git a/tools/testfiles/h5diff_24.txt b/tools/testfiles/h5diff_24.txt index dc1ebb0..467038a 100644 --- a/tools/testfiles/h5diff_24.txt +++ b/tools/testfiles/h5diff_24.txt @@ -1,6 +1,5 @@ ############################# Expected output for 'h5diff file3.h5 file3.h5 -v type type' ############################# -$h5diff file3.h5 file3.h5 -v type type Datatype: and - +0 differences found diff --git a/tools/testfiles/h5diff_25.txt b/tools/testfiles/h5diff_25.txt index 1bbffac..dabfe91 100644 --- a/tools/testfiles/h5diff_25.txt +++ b/tools/testfiles/h5diff_25.txt @@ -1,6 +1,5 @@ ############################# Expected output for 'h5diff file3.h5 file3.h5 -v link link' ############################# -$h5diff file3.h5 file3.h5 -v link link Link: and - +0 differences found diff --git a/tools/testfiles/h5diff_50.txt b/tools/testfiles/h5diff_50.txt index 9fc3c7f..af07a2a 100644 --- a/tools/testfiles/h5diff_50.txt +++ b/tools/testfiles/h5diff_50.txt @@ -1,8 +1,6 @@ ############################# Expected output for 'h5diff file4.h5 file4.h5 -v dset0a dset0b' ############################# -$h5diff file4.h5 file4.h5 -v dset0a dset0b -Dataset: and Warning: Different storage datatype has file datatype H5T_STD_I16LE has file datatype H5T_STD_I32LE @@ -15,5 +13,5 @@ position dset0a dset0b difference [ 1 1 ] 1 4 3 [ 2 0 ] 1 5 4 [ 2 1 ] 1 6 5 +Dataset: and 4 differences found - diff --git a/tools/testfiles/h5diff_51.txt b/tools/testfiles/h5diff_51.txt index 858ace2..216c921 100644 --- a/tools/testfiles/h5diff_51.txt +++ b/tools/testfiles/h5diff_51.txt @@ -1,13 +1,11 @@ ############################# Expected output for 'h5diff file4.h5 file4.h5 -v dset1a dset1b' ############################# -$h5diff file4.h5 file4.h5 -v dset1a dset1b -Dataset: and position dset1a dset1b difference ------------------------------------------------------------ [ 1 0 ] 1 3 2 [ 1 1 ] 1 4 3 [ 2 0 ] 1 5 4 [ 2 1 ] 1 6 5 +Dataset: and 4 differences found - diff --git a/tools/testfiles/h5diff_52.txt b/tools/testfiles/h5diff_52.txt index d3999ad..f1e824f 100644 --- a/tools/testfiles/h5diff_52.txt +++ b/tools/testfiles/h5diff_52.txt @@ -1,13 +1,11 @@ ############################# Expected output for 'h5diff file4.h5 file4.h5 -v dset2a dset2b' ############################# -$h5diff file4.h5 file4.h5 -v dset2a dset2b -Dataset: and position dset2a dset2b difference ------------------------------------------------------------ [ 1 0 ] 1 3 2 [ 1 1 ] 1 4 3 [ 2 0 ] 1 5 4 [ 2 1 ] 1 6 5 +Dataset: and 4 differences found - diff --git a/tools/testfiles/h5diff_53.txt b/tools/testfiles/h5diff_53.txt index e7e899e..115985a 100644 --- a/tools/testfiles/h5diff_53.txt +++ b/tools/testfiles/h5diff_53.txt @@ -1,13 +1,11 @@ ############################# Expected output for 'h5diff file4.h5 file4.h5 -v dset3a dset4b' ############################# -$h5diff file4.h5 file4.h5 -v dset3a dset4b -Dataset: and position dset3a dset4b difference ------------------------------------------------------------ [ 1 0 ] 1 3 2 [ 1 1 ] 1 4 3 [ 2 0 ] 1 5 4 [ 2 1 ] 1 6 5 +Dataset: and 4 differences found - diff --git a/tools/testfiles/h5diff_54.txt b/tools/testfiles/h5diff_54.txt index bd21628..42f3d38 100644 --- a/tools/testfiles/h5diff_54.txt +++ b/tools/testfiles/h5diff_54.txt @@ -1,13 +1,11 @@ ############################# Expected output for 'h5diff file4.h5 file4.h5 -v dset4a dset4b' ############################# -$h5diff file4.h5 file4.h5 -v dset4a dset4b -Dataset: and position dset4a dset4b difference ------------------------------------------------------------ [ 1 0 ] 1 3 2 [ 1 1 ] 1 4 3 [ 2 0 ] 1 5 4 [ 2 1 ] 1 6 5 +Dataset: and 4 differences found - diff --git a/tools/testfiles/h5diff_55.txt b/tools/testfiles/h5diff_55.txt index 69de2c1..b52d080 100644 --- a/tools/testfiles/h5diff_55.txt +++ b/tools/testfiles/h5diff_55.txt @@ -1,13 +1,11 @@ ############################# Expected output for 'h5diff file4.h5 file4.h5 -v dset5a dset5b' ############################# -$h5diff file4.h5 file4.h5 -v dset5a dset5b -Dataset: and position dset5a dset5b difference ------------------------------------------------------------ [ 1 0 ] 1.000000 3.000000 2.000000 [ 1 1 ] 1.000000 4.000000 3.000000 [ 2 0 ] 1.000000 5.000000 4.000000 [ 2 1 ] 1.000000 6.000000 5.000000 +Dataset: and 4 differences found - diff --git a/tools/testfiles/h5diff_56.txt b/tools/testfiles/h5diff_56.txt index 0426f4d..888aebb 100644 --- a/tools/testfiles/h5diff_56.txt +++ b/tools/testfiles/h5diff_56.txt @@ -1,13 +1,11 @@ ############################# Expected output for 'h5diff file4.h5 file4.h5 -v dset6a dset6b' ############################# -$h5diff file4.h5 file4.h5 -v dset6a dset6b -Dataset: and position dset6a dset6b difference ------------------------------------------------------------ [ 1 0 ] 1.000000 3.000000 2.000000 [ 1 1 ] 1.000000 4.000000 3.000000 [ 2 0 ] 1.000000 5.000000 4.000000 [ 2 1 ] 1.000000 6.000000 5.000000 +Dataset: and 4 differences found - diff --git a/tools/testfiles/h5diff_57.txt b/tools/testfiles/h5diff_57.txt index 6794e73..0502f82 100644 --- a/tools/testfiles/h5diff_57.txt +++ b/tools/testfiles/h5diff_57.txt @@ -1,8 +1,6 @@ ############################# Expected output for 'h5diff file4.h5 file4.h5 -v dset7a dset7b' ############################# -$h5diff file4.h5 file4.h5 -v dset7a dset7b -Dataset: and Warning: Different storage datatype has file datatype H5T_STD_I8LE has file datatype H5T_STD_U8LE @@ -10,4 +8,5 @@ Warning: Different storage datatype has file datatype H5T_STD_I8LE has file datatype H5T_STD_U8LE Comparison not supported: has sign H5T_SGN_2 and has sign H5T_SGN_NONE - +Dataset: and +0 differences found diff --git a/tools/testfiles/h5diff_600.txt b/tools/testfiles/h5diff_600.txt index 50254b0..ec56f73 100644 --- a/tools/testfiles/h5diff_600.txt +++ b/tools/testfiles/h5diff_600.txt @@ -10,8 +10,9 @@ file2 File name of the second HDF5 file [obj2] Name of an HDF5 object, in absolute path [OPTIONS] are: [-h] Print out this information -[-v] Verbose mode -[-r] Print only what objects differ, not the differences +[-r] Report mode. Print the differences +[-v] Verbose mode. Print the differences, list of objects, warnings +[-q] Quiet mode. Do not do output [-n count] Print difference up to count number [-d delta] Print difference when it is greater than limit delta [-p relative] Print difference when it is greater than a relative limit @@ -23,17 +24,28 @@ The 'delta' and 'relative' values must be positive numbers The -d compare criteria is |a - b| > delta The -p compare criteria is |1 - b/a| > relative -Examples: +h5diff has four modes of output: + Normal mode: print the number of differences found and where they occured + Report mode: print the above plus the differences + Verbose mode: print the above plus a list of objects and warnings + Quiet mode: do not print output (h5diff always returns an exit code of 1 when differences are found) -1) h5diff file1 file2 /a/b /a/c +Examples of use: - Compares object '/a/b' in file1 with '/a/c' in file2 +1) h5diff file1 file2 /g1/dset1 /g1/dset2 -2) h5diff file1 file2 /a/b + Compares object '/g1/dset1' in file1 with '/g1/dset2' in file2 - Compares object '/a/b' in both files +2) h5diff file1 file2 /g1/dset1 + + Compares object '/g1/dset1' in both files 3) h5diff file1 file2 Compares all objects in both files +Note) file1 and file2 can be the same file. Use + + h5diff file1 file1 /g1/dset1 /g1/dset2 + + to compare '/g1/dset1' and '/g1/dset2' in the same file diff --git a/tools/testfiles/h5diff_601.txt b/tools/testfiles/h5diff_601.txt index 2896b76..285ed72 100644 --- a/tools/testfiles/h5diff_601.txt +++ b/tools/testfiles/h5diff_601.txt @@ -10,8 +10,9 @@ file2 File name of the second HDF5 file [obj2] Name of an HDF5 object, in absolute path [OPTIONS] are: [-h] Print out this information -[-v] Verbose mode -[-r] Print only what objects differ, not the differences +[-r] Report mode. Print the differences +[-v] Verbose mode. Print the differences, list of objects, warnings +[-q] Quiet mode. Do not do output [-n count] Print difference up to count number [-d delta] Print difference when it is greater than limit delta [-p relative] Print difference when it is greater than a relative limit @@ -23,17 +24,28 @@ The 'delta' and 'relative' values must be positive numbers The -d compare criteria is |a - b| > delta The -p compare criteria is |1 - b/a| > relative -Examples: +h5diff has four modes of output: + Normal mode: print the number of differences found and where they occured + Report mode: print the above plus the differences + Verbose mode: print the above plus a list of objects and warnings + Quiet mode: do not print output (h5diff always returns an exit code of 1 when differences are found) -1) h5diff file1 file2 /a/b /a/c +Examples of use: - Compares object '/a/b' in file1 with '/a/c' in file2 +1) h5diff file1 file2 /g1/dset1 /g1/dset2 -2) h5diff file1 file2 /a/b + Compares object '/g1/dset1' in file1 with '/g1/dset2' in file2 - Compares object '/a/b' in both files +2) h5diff file1 file2 /g1/dset1 + + Compares object '/g1/dset1' in both files 3) h5diff file1 file2 Compares all objects in both files +Note) file1 and file2 can be the same file. Use + + h5diff file1 file1 /g1/dset1 /g1/dset2 + + to compare '/g1/dset1' and '/g1/dset2' in the same file diff --git a/tools/testfiles/h5diff_602.txt b/tools/testfiles/h5diff_602.txt index 160b9e9b..d7d3883 100644 --- a/tools/testfiles/h5diff_602.txt +++ b/tools/testfiles/h5diff_602.txt @@ -10,8 +10,9 @@ file2 File name of the second HDF5 file [obj2] Name of an HDF5 object, in absolute path [OPTIONS] are: [-h] Print out this information -[-v] Verbose mode -[-r] Print only what objects differ, not the differences +[-r] Report mode. Print the differences +[-v] Verbose mode. Print the differences, list of objects, warnings +[-q] Quiet mode. Do not do output [-n count] Print difference up to count number [-d delta] Print difference when it is greater than limit delta [-p relative] Print difference when it is greater than a relative limit @@ -23,17 +24,28 @@ The 'delta' and 'relative' values must be positive numbers The -d compare criteria is |a - b| > delta The -p compare criteria is |1 - b/a| > relative -Examples: +h5diff has four modes of output: + Normal mode: print the number of differences found and where they occured + Report mode: print the above plus the differences + Verbose mode: print the above plus a list of objects and warnings + Quiet mode: do not print output (h5diff always returns an exit code of 1 when differences are found) -1) h5diff file1 file2 /a/b /a/c +Examples of use: - Compares object '/a/b' in file1 with '/a/c' in file2 +1) h5diff file1 file2 /g1/dset1 /g1/dset2 -2) h5diff file1 file2 /a/b + Compares object '/g1/dset1' in file1 with '/g1/dset2' in file2 - Compares object '/a/b' in both files +2) h5diff file1 file2 /g1/dset1 + + Compares object '/g1/dset1' in both files 3) h5diff file1 file2 Compares all objects in both files +Note) file1 and file2 can be the same file. Use + + h5diff file1 file1 /g1/dset1 /g1/dset2 + + to compare '/g1/dset1' and '/g1/dset2' in the same file diff --git a/tools/testfiles/h5diff_603.txt b/tools/testfiles/h5diff_603.txt index 5630fd6..c386e09 100644 --- a/tools/testfiles/h5diff_603.txt +++ b/tools/testfiles/h5diff_603.txt @@ -10,8 +10,9 @@ file2 File name of the second HDF5 file [obj2] Name of an HDF5 object, in absolute path [OPTIONS] are: [-h] Print out this information -[-v] Verbose mode -[-r] Print only what objects differ, not the differences +[-r] Report mode. Print the differences +[-v] Verbose mode. Print the differences, list of objects, warnings +[-q] Quiet mode. Do not do output [-n count] Print difference up to count number [-d delta] Print difference when it is greater than limit delta [-p relative] Print difference when it is greater than a relative limit @@ -23,17 +24,28 @@ The 'delta' and 'relative' values must be positive numbers The -d compare criteria is |a - b| > delta The -p compare criteria is |1 - b/a| > relative -Examples: +h5diff has four modes of output: + Normal mode: print the number of differences found and where they occured + Report mode: print the above plus the differences + Verbose mode: print the above plus a list of objects and warnings + Quiet mode: do not print output (h5diff always returns an exit code of 1 when differences are found) -1) h5diff file1 file2 /a/b /a/c +Examples of use: - Compares object '/a/b' in file1 with '/a/c' in file2 +1) h5diff file1 file2 /g1/dset1 /g1/dset2 -2) h5diff file1 file2 /a/b + Compares object '/g1/dset1' in file1 with '/g1/dset2' in file2 - Compares object '/a/b' in both files +2) h5diff file1 file2 /g1/dset1 + + Compares object '/g1/dset1' in both files 3) h5diff file1 file2 Compares all objects in both files +Note) file1 and file2 can be the same file. Use + + h5diff file1 file1 /g1/dset1 /g1/dset2 + + to compare '/g1/dset1' and '/g1/dset2' in the same file diff --git a/tools/testfiles/h5diff_604.txt b/tools/testfiles/h5diff_604.txt index 58f3259..5ae0b91 100644 --- a/tools/testfiles/h5diff_604.txt +++ b/tools/testfiles/h5diff_604.txt @@ -10,8 +10,9 @@ file2 File name of the second HDF5 file [obj2] Name of an HDF5 object, in absolute path [OPTIONS] are: [-h] Print out this information -[-v] Verbose mode -[-r] Print only what objects differ, not the differences +[-r] Report mode. Print the differences +[-v] Verbose mode. Print the differences, list of objects, warnings +[-q] Quiet mode. Do not do output [-n count] Print difference up to count number [-d delta] Print difference when it is greater than limit delta [-p relative] Print difference when it is greater than a relative limit @@ -23,17 +24,28 @@ The 'delta' and 'relative' values must be positive numbers The -d compare criteria is |a - b| > delta The -p compare criteria is |1 - b/a| > relative -Examples: +h5diff has four modes of output: + Normal mode: print the number of differences found and where they occured + Report mode: print the above plus the differences + Verbose mode: print the above plus a list of objects and warnings + Quiet mode: do not print output (h5diff always returns an exit code of 1 when differences are found) -1) h5diff file1 file2 /a/b /a/c +Examples of use: - Compares object '/a/b' in file1 with '/a/c' in file2 +1) h5diff file1 file2 /g1/dset1 /g1/dset2 -2) h5diff file1 file2 /a/b + Compares object '/g1/dset1' in file1 with '/g1/dset2' in file2 - Compares object '/a/b' in both files +2) h5diff file1 file2 /g1/dset1 + + Compares object '/g1/dset1' in both files 3) h5diff file1 file2 Compares all objects in both files +Note) file1 and file2 can be the same file. Use + + h5diff file1 file1 /g1/dset1 /g1/dset2 + + to compare '/g1/dset1' and '/g1/dset2' in the same file diff --git a/tools/testfiles/h5diff_605.txt b/tools/testfiles/h5diff_605.txt index bef85ea..887e3b2 100644 --- a/tools/testfiles/h5diff_605.txt +++ b/tools/testfiles/h5diff_605.txt @@ -10,8 +10,9 @@ file2 File name of the second HDF5 file [obj2] Name of an HDF5 object, in absolute path [OPTIONS] are: [-h] Print out this information -[-v] Verbose mode -[-r] Print only what objects differ, not the differences +[-r] Report mode. Print the differences +[-v] Verbose mode. Print the differences, list of objects, warnings +[-q] Quiet mode. Do not do output [-n count] Print difference up to count number [-d delta] Print difference when it is greater than limit delta [-p relative] Print difference when it is greater than a relative limit @@ -23,17 +24,28 @@ The 'delta' and 'relative' values must be positive numbers The -d compare criteria is |a - b| > delta The -p compare criteria is |1 - b/a| > relative -Examples: +h5diff has four modes of output: + Normal mode: print the number of differences found and where they occured + Report mode: print the above plus the differences + Verbose mode: print the above plus a list of objects and warnings + Quiet mode: do not print output (h5diff always returns an exit code of 1 when differences are found) -1) h5diff file1 file2 /a/b /a/c +Examples of use: - Compares object '/a/b' in file1 with '/a/c' in file2 +1) h5diff file1 file2 /g1/dset1 /g1/dset2 -2) h5diff file1 file2 /a/b + Compares object '/g1/dset1' in file1 with '/g1/dset2' in file2 - Compares object '/a/b' in both files +2) h5diff file1 file2 /g1/dset1 + + Compares object '/g1/dset1' in both files 3) h5diff file1 file2 Compares all objects in both files +Note) file1 and file2 can be the same file. Use + + h5diff file1 file1 /g1/dset1 /g1/dset2 + + to compare '/g1/dset1' and '/g1/dset2' in the same file diff --git a/tools/testfiles/h5diff_606.txt b/tools/testfiles/h5diff_606.txt index fe5308c..0566ec7 100644 --- a/tools/testfiles/h5diff_606.txt +++ b/tools/testfiles/h5diff_606.txt @@ -10,8 +10,9 @@ file2 File name of the second HDF5 file [obj2] Name of an HDF5 object, in absolute path [OPTIONS] are: [-h] Print out this information -[-v] Verbose mode -[-r] Print only what objects differ, not the differences +[-r] Report mode. Print the differences +[-v] Verbose mode. Print the differences, list of objects, warnings +[-q] Quiet mode. Do not do output [-n count] Print difference up to count number [-d delta] Print difference when it is greater than limit delta [-p relative] Print difference when it is greater than a relative limit @@ -23,17 +24,28 @@ The 'delta' and 'relative' values must be positive numbers The -d compare criteria is |a - b| > delta The -p compare criteria is |1 - b/a| > relative -Examples: +h5diff has four modes of output: + Normal mode: print the number of differences found and where they occured + Report mode: print the above plus the differences + Verbose mode: print the above plus a list of objects and warnings + Quiet mode: do not print output (h5diff always returns an exit code of 1 when differences are found) -1) h5diff file1 file2 /a/b /a/c +Examples of use: - Compares object '/a/b' in file1 with '/a/c' in file2 +1) h5diff file1 file2 /g1/dset1 /g1/dset2 -2) h5diff file1 file2 /a/b + Compares object '/g1/dset1' in file1 with '/g1/dset2' in file2 - Compares object '/a/b' in both files +2) h5diff file1 file2 /g1/dset1 + + Compares object '/g1/dset1' in both files 3) h5diff file1 file2 Compares all objects in both files +Note) file1 and file2 can be the same file. Use + + h5diff file1 file1 /g1/dset1 /g1/dset2 + + to compare '/g1/dset1' and '/g1/dset2' in the same file diff --git a/tools/testfiles/h5diff_607.txt b/tools/testfiles/h5diff_607.txt index 01cf531..fa296f7 100644 --- a/tools/testfiles/h5diff_607.txt +++ b/tools/testfiles/h5diff_607.txt @@ -1,11 +1,5 @@ ############################# Expected output for 'h5diff file1.h5 file2.h5 -d 1 g1/dset3 g1/dset4' ############################# -position dset3 dset4 difference ------------------------------------------------------------- -[ 0 0 ] 100.000000 110.000000 10.000000 -[ 0 1 ] 110.000000 100.000000 10.000000 -[ 1 0 ] 100.000000 90.000000 10.000000 -[ 1 1 ] 100.000000 80.000000 20.000000 -[ 2 0 ] 100.000000 140.000000 40.000000 -[ 2 1 ] 100.000000 200.000000 100.000000 +Dataset: and +6 differences found diff --git a/tools/testfiles/h5diff_608.txt b/tools/testfiles/h5diff_608.txt index 983f569..073322f 100644 --- a/tools/testfiles/h5diff_608.txt +++ b/tools/testfiles/h5diff_608.txt @@ -1,11 +1,5 @@ ############################# Expected output for 'h5diff file1.h5 file2.h5 -d 1 -d 2 g1/dset3 g1/dset4' ############################# -position dset3 dset4 difference ------------------------------------------------------------- -[ 0 0 ] 100.000000 110.000000 10.000000 -[ 0 1 ] 110.000000 100.000000 10.000000 -[ 1 0 ] 100.000000 90.000000 10.000000 -[ 1 1 ] 100.000000 80.000000 20.000000 -[ 2 0 ] 100.000000 140.000000 40.000000 -[ 2 1 ] 100.000000 200.000000 100.000000 +Dataset: and +6 differences found diff --git a/tools/testfiles/h5diff_609.txt b/tools/testfiles/h5diff_609.txt index 279122f..1312380 100644 --- a/tools/testfiles/h5diff_609.txt +++ b/tools/testfiles/h5diff_609.txt @@ -1,3 +1,4 @@ ############################# Expected output for 'h5diff file1.h5 file2.h5 -d 200 g1/dset3 g1/dset4' ############################# +0 differences found diff --git a/tools/testfiles/h5diff_610.txt b/tools/testfiles/h5diff_610.txt index 01cf531..fa296f7 100644 --- a/tools/testfiles/h5diff_610.txt +++ b/tools/testfiles/h5diff_610.txt @@ -1,11 +1,5 @@ ############################# Expected output for 'h5diff file1.h5 file2.h5 -d 1 g1/dset3 g1/dset4' ############################# -position dset3 dset4 difference ------------------------------------------------------------- -[ 0 0 ] 100.000000 110.000000 10.000000 -[ 0 1 ] 110.000000 100.000000 10.000000 -[ 1 0 ] 100.000000 90.000000 10.000000 -[ 1 1 ] 100.000000 80.000000 20.000000 -[ 2 0 ] 100.000000 140.000000 40.000000 -[ 2 1 ] 100.000000 200.000000 100.000000 +Dataset: and +6 differences found diff --git a/tools/testfiles/h5diff_611.txt b/tools/testfiles/h5diff_611.txt index 10dec8f..f18b753 100644 --- a/tools/testfiles/h5diff_611.txt +++ b/tools/testfiles/h5diff_611.txt @@ -1,5 +1,5 @@ ############################# -Expected output for 'h5diff file1.h5 file2.h5 -p g1/dset3 g1/dset4' +Expected output for 'h5diff file1.h5 file2.h5 -r -p g1/dset3 g1/dset4' ############################# <-p g1/dset3> is not a valid option Usage: h5diff file1 file2 [OPTIONS] [obj1[obj2]] @@ -10,8 +10,9 @@ file2 File name of the second HDF5 file [obj2] Name of an HDF5 object, in absolute path [OPTIONS] are: [-h] Print out this information -[-v] Verbose mode -[-r] Print only what objects differ, not the differences +[-r] Report mode. Print the differences +[-v] Verbose mode. Print the differences, list of objects, warnings +[-q] Quiet mode. Do not do output [-n count] Print difference up to count number [-d delta] Print difference when it is greater than limit delta [-p relative] Print difference when it is greater than a relative limit @@ -23,17 +24,28 @@ The 'delta' and 'relative' values must be positive numbers The -d compare criteria is |a - b| > delta The -p compare criteria is |1 - b/a| > relative -Examples: +h5diff has four modes of output: + Normal mode: print the number of differences found and where they occured + Report mode: print the above plus the differences + Verbose mode: print the above plus a list of objects and warnings + Quiet mode: do not print output (h5diff always returns an exit code of 1 when differences are found) -1) h5diff file1 file2 /a/b /a/c +Examples of use: - Compares object '/a/b' in file1 with '/a/c' in file2 +1) h5diff file1 file2 /g1/dset1 /g1/dset2 -2) h5diff file1 file2 /a/b + Compares object '/g1/dset1' in file1 with '/g1/dset2' in file2 - Compares object '/a/b' in both files +2) h5diff file1 file2 /g1/dset1 + + Compares object '/g1/dset1' in both files 3) h5diff file1 file2 Compares all objects in both files +Note) file1 and file2 can be the same file. Use + + h5diff file1 file1 /g1/dset1 /g1/dset2 + + to compare '/g1/dset1' and '/g1/dset2' in the same file diff --git a/tools/testfiles/h5diff_612.txt b/tools/testfiles/h5diff_612.txt index 803b64e..9666af3 100644 --- a/tools/testfiles/h5diff_612.txt +++ b/tools/testfiles/h5diff_612.txt @@ -10,8 +10,9 @@ file2 File name of the second HDF5 file [obj2] Name of an HDF5 object, in absolute path [OPTIONS] are: [-h] Print out this information -[-v] Verbose mode -[-r] Print only what objects differ, not the differences +[-r] Report mode. Print the differences +[-v] Verbose mode. Print the differences, list of objects, warnings +[-q] Quiet mode. Do not do output [-n count] Print difference up to count number [-d delta] Print difference when it is greater than limit delta [-p relative] Print difference when it is greater than a relative limit @@ -23,17 +24,28 @@ The 'delta' and 'relative' values must be positive numbers The -d compare criteria is |a - b| > delta The -p compare criteria is |1 - b/a| > relative -Examples: +h5diff has four modes of output: + Normal mode: print the number of differences found and where they occured + Report mode: print the above plus the differences + Verbose mode: print the above plus a list of objects and warnings + Quiet mode: do not print output (h5diff always returns an exit code of 1 when differences are found) -1) h5diff file1 file2 /a/b /a/c +Examples of use: - Compares object '/a/b' in file1 with '/a/c' in file2 +1) h5diff file1 file2 /g1/dset1 /g1/dset2 -2) h5diff file1 file2 /a/b + Compares object '/g1/dset1' in file1 with '/g1/dset2' in file2 - Compares object '/a/b' in both files +2) h5diff file1 file2 /g1/dset1 + + Compares object '/g1/dset1' in both files 3) h5diff file1 file2 Compares all objects in both files +Note) file1 and file2 can be the same file. Use + + h5diff file1 file1 /g1/dset1 /g1/dset2 + + to compare '/g1/dset1' and '/g1/dset2' in the same file diff --git a/tools/testfiles/h5diff_613.txt b/tools/testfiles/h5diff_613.txt index 61e1d91..5043115 100644 --- a/tools/testfiles/h5diff_613.txt +++ b/tools/testfiles/h5diff_613.txt @@ -10,8 +10,9 @@ file2 File name of the second HDF5 file [obj2] Name of an HDF5 object, in absolute path [OPTIONS] are: [-h] Print out this information -[-v] Verbose mode -[-r] Print only what objects differ, not the differences +[-r] Report mode. Print the differences +[-v] Verbose mode. Print the differences, list of objects, warnings +[-q] Quiet mode. Do not do output [-n count] Print difference up to count number [-d delta] Print difference when it is greater than limit delta [-p relative] Print difference when it is greater than a relative limit @@ -23,17 +24,28 @@ The 'delta' and 'relative' values must be positive numbers The -d compare criteria is |a - b| > delta The -p compare criteria is |1 - b/a| > relative -Examples: +h5diff has four modes of output: + Normal mode: print the number of differences found and where they occured + Report mode: print the above plus the differences + Verbose mode: print the above plus a list of objects and warnings + Quiet mode: do not print output (h5diff always returns an exit code of 1 when differences are found) -1) h5diff file1 file2 /a/b /a/c +Examples of use: - Compares object '/a/b' in file1 with '/a/c' in file2 +1) h5diff file1 file2 /g1/dset1 /g1/dset2 -2) h5diff file1 file2 /a/b + Compares object '/g1/dset1' in file1 with '/g1/dset2' in file2 - Compares object '/a/b' in both files +2) h5diff file1 file2 /g1/dset1 + + Compares object '/g1/dset1' in both files 3) h5diff file1 file2 Compares all objects in both files +Note) file1 and file2 can be the same file. Use + + h5diff file1 file1 /g1/dset1 /g1/dset2 + + to compare '/g1/dset1' and '/g1/dset2' in the same file diff --git a/tools/testfiles/h5diff_614.txt b/tools/testfiles/h5diff_614.txt index a0a8b49..4f1783c 100644 --- a/tools/testfiles/h5diff_614.txt +++ b/tools/testfiles/h5diff_614.txt @@ -10,8 +10,9 @@ file2 File name of the second HDF5 file [obj2] Name of an HDF5 object, in absolute path [OPTIONS] are: [-h] Print out this information -[-v] Verbose mode -[-r] Print only what objects differ, not the differences +[-r] Report mode. Print the differences +[-v] Verbose mode. Print the differences, list of objects, warnings +[-q] Quiet mode. Do not do output [-n count] Print difference up to count number [-d delta] Print difference when it is greater than limit delta [-p relative] Print difference when it is greater than a relative limit @@ -23,17 +24,28 @@ The 'delta' and 'relative' values must be positive numbers The -d compare criteria is |a - b| > delta The -p compare criteria is |1 - b/a| > relative -Examples: +h5diff has four modes of output: + Normal mode: print the number of differences found and where they occured + Report mode: print the above plus the differences + Verbose mode: print the above plus a list of objects and warnings + Quiet mode: do not print output (h5diff always returns an exit code of 1 when differences are found) -1) h5diff file1 file2 /a/b /a/c +Examples of use: - Compares object '/a/b' in file1 with '/a/c' in file2 +1) h5diff file1 file2 /g1/dset1 /g1/dset2 -2) h5diff file1 file2 /a/b + Compares object '/g1/dset1' in file1 with '/g1/dset2' in file2 - Compares object '/a/b' in both files +2) h5diff file1 file2 /g1/dset1 + + Compares object '/g1/dset1' in both files 3) h5diff file1 file2 Compares all objects in both files +Note) file1 and file2 can be the same file. Use + + h5diff file1 file1 /g1/dset1 /g1/dset2 + + to compare '/g1/dset1' and '/g1/dset2' in the same file diff --git a/tools/testfiles/h5diff_615.txt b/tools/testfiles/h5diff_615.txt index 2f19008..fb04fed 100644 --- a/tools/testfiles/h5diff_615.txt +++ b/tools/testfiles/h5diff_615.txt @@ -10,8 +10,9 @@ file2 File name of the second HDF5 file [obj2] Name of an HDF5 object, in absolute path [OPTIONS] are: [-h] Print out this information -[-v] Verbose mode -[-r] Print only what objects differ, not the differences +[-r] Report mode. Print the differences +[-v] Verbose mode. Print the differences, list of objects, warnings +[-q] Quiet mode. Do not do output [-n count] Print difference up to count number [-d delta] Print difference when it is greater than limit delta [-p relative] Print difference when it is greater than a relative limit @@ -23,17 +24,28 @@ The 'delta' and 'relative' values must be positive numbers The -d compare criteria is |a - b| > delta The -p compare criteria is |1 - b/a| > relative -Examples: +h5diff has four modes of output: + Normal mode: print the number of differences found and where they occured + Report mode: print the above plus the differences + Verbose mode: print the above plus a list of objects and warnings + Quiet mode: do not print output (h5diff always returns an exit code of 1 when differences are found) -1) h5diff file1 file2 /a/b /a/c +Examples of use: - Compares object '/a/b' in file1 with '/a/c' in file2 +1) h5diff file1 file2 /g1/dset1 /g1/dset2 -2) h5diff file1 file2 /a/b + Compares object '/g1/dset1' in file1 with '/g1/dset2' in file2 - Compares object '/a/b' in both files +2) h5diff file1 file2 /g1/dset1 + + Compares object '/g1/dset1' in both files 3) h5diff file1 file2 Compares all objects in both files +Note) file1 and file2 can be the same file. Use + + h5diff file1 file1 /g1/dset1 /g1/dset2 + + to compare '/g1/dset1' and '/g1/dset2' in the same file diff --git a/tools/testfiles/h5diff_616.txt b/tools/testfiles/h5diff_616.txt index efaf8a3..0f71910 100644 --- a/tools/testfiles/h5diff_616.txt +++ b/tools/testfiles/h5diff_616.txt @@ -1,7 +1,5 @@ ############################# Expected output for 'h5diff file1.h5 file2.h5 -p 0.21 g1/dset3 g1/dset4' ############################# -position dset3 dset4 difference relative ------------------------------------------------------------------------- -[ 2 0 ] 100 140 40 0.4 -[ 2 1 ] 100 200 100 1 +Dataset: and +2 differences found diff --git a/tools/testfiles/h5diff_617.txt b/tools/testfiles/h5diff_617.txt index 267c992..ef74c72 100644 --- a/tools/testfiles/h5diff_617.txt +++ b/tools/testfiles/h5diff_617.txt @@ -1,7 +1,5 @@ ############################# Expected output for 'h5diff file1.h5 file2.h5 -p 0.21 -p 0.22 g1/dset3 g1/dset4' ############################# -position dset3 dset4 difference relative ------------------------------------------------------------------------- -[ 2 0 ] 100 140 40 0.4 -[ 2 1 ] 100 200 100 1 +Dataset: and +2 differences found diff --git a/tools/testfiles/h5diff_618.txt b/tools/testfiles/h5diff_618.txt index 78d3ca2..d436346 100644 --- a/tools/testfiles/h5diff_618.txt +++ b/tools/testfiles/h5diff_618.txt @@ -1,3 +1,4 @@ ############################# Expected output for 'h5diff file1.h5 file2.h5 -p 2 g1/dset3 g1/dset4' ############################# +0 differences found diff --git a/tools/testfiles/h5diff_619.txt b/tools/testfiles/h5diff_619.txt index 8ef4136..18d1efb 100644 --- a/tools/testfiles/h5diff_619.txt +++ b/tools/testfiles/h5diff_619.txt @@ -1,11 +1,5 @@ ############################# Expected output for 'h5diff file1.h5 file2.h5 -p 0.005 g1/dset3 g1/dset4' ############################# -position dset3 dset4 difference relative ------------------------------------------------------------------------- -[ 0 0 ] 100 110 10 0.1 -[ 0 1 ] 110 100 10 0.09090909091 -[ 1 0 ] 100 90 10 0.1 -[ 1 1 ] 100 80 20 0.2 -[ 2 0 ] 100 140 40 0.4 -[ 2 1 ] 100 200 100 1 +Dataset: and +6 differences found diff --git a/tools/testfiles/h5diff_620.txt b/tools/testfiles/h5diff_620.txt index 2d01f76de..9201dd1 100644 --- a/tools/testfiles/h5diff_620.txt +++ b/tools/testfiles/h5diff_620.txt @@ -10,8 +10,9 @@ file2 File name of the second HDF5 file [obj2] Name of an HDF5 object, in absolute path [OPTIONS] are: [-h] Print out this information -[-v] Verbose mode -[-r] Print only what objects differ, not the differences +[-r] Report mode. Print the differences +[-v] Verbose mode. Print the differences, list of objects, warnings +[-q] Quiet mode. Do not do output [-n count] Print difference up to count number [-d delta] Print difference when it is greater than limit delta [-p relative] Print difference when it is greater than a relative limit @@ -23,17 +24,28 @@ The 'delta' and 'relative' values must be positive numbers The -d compare criteria is |a - b| > delta The -p compare criteria is |1 - b/a| > relative -Examples: +h5diff has four modes of output: + Normal mode: print the number of differences found and where they occured + Report mode: print the above plus the differences + Verbose mode: print the above plus a list of objects and warnings + Quiet mode: do not print output (h5diff always returns an exit code of 1 when differences are found) -1) h5diff file1 file2 /a/b /a/c +Examples of use: - Compares object '/a/b' in file1 with '/a/c' in file2 +1) h5diff file1 file2 /g1/dset1 /g1/dset2 -2) h5diff file1 file2 /a/b + Compares object '/g1/dset1' in file1 with '/g1/dset2' in file2 - Compares object '/a/b' in both files +2) h5diff file1 file2 /g1/dset1 + + Compares object '/g1/dset1' in both files 3) h5diff file1 file2 Compares all objects in both files +Note) file1 and file2 can be the same file. Use + + h5diff file1 file1 /g1/dset1 /g1/dset2 + + to compare '/g1/dset1' and '/g1/dset2' in the same file diff --git a/tools/testfiles/h5diff_621.txt b/tools/testfiles/h5diff_621.txt index 11a3e16..2566846 100644 --- a/tools/testfiles/h5diff_621.txt +++ b/tools/testfiles/h5diff_621.txt @@ -10,8 +10,9 @@ file2 File name of the second HDF5 file [obj2] Name of an HDF5 object, in absolute path [OPTIONS] are: [-h] Print out this information -[-v] Verbose mode -[-r] Print only what objects differ, not the differences +[-r] Report mode. Print the differences +[-v] Verbose mode. Print the differences, list of objects, warnings +[-q] Quiet mode. Do not do output [-n count] Print difference up to count number [-d delta] Print difference when it is greater than limit delta [-p relative] Print difference when it is greater than a relative limit @@ -23,17 +24,28 @@ The 'delta' and 'relative' values must be positive numbers The -d compare criteria is |a - b| > delta The -p compare criteria is |1 - b/a| > relative -Examples: +h5diff has four modes of output: + Normal mode: print the number of differences found and where they occured + Report mode: print the above plus the differences + Verbose mode: print the above plus a list of objects and warnings + Quiet mode: do not print output (h5diff always returns an exit code of 1 when differences are found) -1) h5diff file1 file2 /a/b /a/c +Examples of use: - Compares object '/a/b' in file1 with '/a/c' in file2 +1) h5diff file1 file2 /g1/dset1 /g1/dset2 -2) h5diff file1 file2 /a/b + Compares object '/g1/dset1' in file1 with '/g1/dset2' in file2 - Compares object '/a/b' in both files +2) h5diff file1 file2 /g1/dset1 + + Compares object '/g1/dset1' in both files 3) h5diff file1 file2 Compares all objects in both files +Note) file1 and file2 can be the same file. Use + + h5diff file1 file1 /g1/dset1 /g1/dset2 + + to compare '/g1/dset1' and '/g1/dset2' in the same file diff --git a/tools/testfiles/h5diff_622.txt b/tools/testfiles/h5diff_622.txt index 5d082eb..20613a5 100644 --- a/tools/testfiles/h5diff_622.txt +++ b/tools/testfiles/h5diff_622.txt @@ -10,8 +10,9 @@ file2 File name of the second HDF5 file [obj2] Name of an HDF5 object, in absolute path [OPTIONS] are: [-h] Print out this information -[-v] Verbose mode -[-r] Print only what objects differ, not the differences +[-r] Report mode. Print the differences +[-v] Verbose mode. Print the differences, list of objects, warnings +[-q] Quiet mode. Do not do output [-n count] Print difference up to count number [-d delta] Print difference when it is greater than limit delta [-p relative] Print difference when it is greater than a relative limit @@ -23,17 +24,28 @@ The 'delta' and 'relative' values must be positive numbers The -d compare criteria is |a - b| > delta The -p compare criteria is |1 - b/a| > relative -Examples: +h5diff has four modes of output: + Normal mode: print the number of differences found and where they occured + Report mode: print the above plus the differences + Verbose mode: print the above plus a list of objects and warnings + Quiet mode: do not print output (h5diff always returns an exit code of 1 when differences are found) -1) h5diff file1 file2 /a/b /a/c +Examples of use: - Compares object '/a/b' in file1 with '/a/c' in file2 +1) h5diff file1 file2 /g1/dset1 /g1/dset2 -2) h5diff file1 file2 /a/b + Compares object '/g1/dset1' in file1 with '/g1/dset2' in file2 - Compares object '/a/b' in both files +2) h5diff file1 file2 /g1/dset1 + + Compares object '/g1/dset1' in both files 3) h5diff file1 file2 Compares all objects in both files +Note) file1 and file2 can be the same file. Use + + h5diff file1 file1 /g1/dset1 /g1/dset2 + + to compare '/g1/dset1' and '/g1/dset2' in the same file diff --git a/tools/testfiles/h5diff_623.txt b/tools/testfiles/h5diff_623.txt index 6bfe66b..92f3e55 100644 --- a/tools/testfiles/h5diff_623.txt +++ b/tools/testfiles/h5diff_623.txt @@ -10,8 +10,9 @@ file2 File name of the second HDF5 file [obj2] Name of an HDF5 object, in absolute path [OPTIONS] are: [-h] Print out this information -[-v] Verbose mode -[-r] Print only what objects differ, not the differences +[-r] Report mode. Print the differences +[-v] Verbose mode. Print the differences, list of objects, warnings +[-q] Quiet mode. Do not do output [-n count] Print difference up to count number [-d delta] Print difference when it is greater than limit delta [-p relative] Print difference when it is greater than a relative limit @@ -23,17 +24,28 @@ The 'delta' and 'relative' values must be positive numbers The -d compare criteria is |a - b| > delta The -p compare criteria is |1 - b/a| > relative -Examples: +h5diff has four modes of output: + Normal mode: print the number of differences found and where they occured + Report mode: print the above plus the differences + Verbose mode: print the above plus a list of objects and warnings + Quiet mode: do not print output (h5diff always returns an exit code of 1 when differences are found) -1) h5diff file1 file2 /a/b /a/c +Examples of use: - Compares object '/a/b' in file1 with '/a/c' in file2 +1) h5diff file1 file2 /g1/dset1 /g1/dset2 -2) h5diff file1 file2 /a/b + Compares object '/g1/dset1' in file1 with '/g1/dset2' in file2 - Compares object '/a/b' in both files +2) h5diff file1 file2 /g1/dset1 + + Compares object '/g1/dset1' in both files 3) h5diff file1 file2 Compares all objects in both files +Note) file1 and file2 can be the same file. Use + + h5diff file1 file1 /g1/dset1 /g1/dset2 + + to compare '/g1/dset1' and '/g1/dset2' in the same file diff --git a/tools/testfiles/h5diff_624.txt b/tools/testfiles/h5diff_624.txt index 9feda50..069c65b 100644 --- a/tools/testfiles/h5diff_624.txt +++ b/tools/testfiles/h5diff_624.txt @@ -10,8 +10,9 @@ file2 File name of the second HDF5 file [obj2] Name of an HDF5 object, in absolute path [OPTIONS] are: [-h] Print out this information -[-v] Verbose mode -[-r] Print only what objects differ, not the differences +[-r] Report mode. Print the differences +[-v] Verbose mode. Print the differences, list of objects, warnings +[-q] Quiet mode. Do not do output [-n count] Print difference up to count number [-d delta] Print difference when it is greater than limit delta [-p relative] Print difference when it is greater than a relative limit @@ -23,17 +24,28 @@ The 'delta' and 'relative' values must be positive numbers The -d compare criteria is |a - b| > delta The -p compare criteria is |1 - b/a| > relative -Examples: +h5diff has four modes of output: + Normal mode: print the number of differences found and where they occured + Report mode: print the above plus the differences + Verbose mode: print the above plus a list of objects and warnings + Quiet mode: do not print output (h5diff always returns an exit code of 1 when differences are found) -1) h5diff file1 file2 /a/b /a/c +Examples of use: - Compares object '/a/b' in file1 with '/a/c' in file2 +1) h5diff file1 file2 /g1/dset1 /g1/dset2 -2) h5diff file1 file2 /a/b + Compares object '/g1/dset1' in file1 with '/g1/dset2' in file2 - Compares object '/a/b' in both files +2) h5diff file1 file2 /g1/dset1 + + Compares object '/g1/dset1' in both files 3) h5diff file1 file2 Compares all objects in both files +Note) file1 and file2 can be the same file. Use + + h5diff file1 file1 /g1/dset1 /g1/dset2 + + to compare '/g1/dset1' and '/g1/dset2' in the same file diff --git a/tools/testfiles/h5diff_625.txt b/tools/testfiles/h5diff_625.txt index 780131f..74477c8 100644 --- a/tools/testfiles/h5diff_625.txt +++ b/tools/testfiles/h5diff_625.txt @@ -1,7 +1,5 @@ ############################# Expected output for 'h5diff file1.h5 file2.h5 -n 2 g1/dset3 g1/dset4' ############################# -position dset3 dset4 difference ------------------------------------------------------------- -[ 0 0 ] 100.000000 110.000000 10.000000 -[ 0 1 ] 110.000000 100.000000 10.000000 +Dataset: and +2 differences found diff --git a/tools/testfiles/h5diff_626.txt b/tools/testfiles/h5diff_626.txt index e1e38d6..85eb7dc 100644 --- a/tools/testfiles/h5diff_626.txt +++ b/tools/testfiles/h5diff_626.txt @@ -1,8 +1,5 @@ ############################# Expected output for 'h5diff file1.h5 file2.h5 -n 2 -n 3 g1/dset3 g1/dset4' ############################# -position dset3 dset4 difference ------------------------------------------------------------- -[ 0 0 ] 100.000000 110.000000 10.000000 -[ 0 1 ] 110.000000 100.000000 10.000000 -[ 1 0 ] 100.000000 90.000000 10.000000 +Dataset: and +3 differences found diff --git a/tools/testfiles/h5diff_627.txt b/tools/testfiles/h5diff_627.txt index 30e6c50..999bbc3 100644 --- a/tools/testfiles/h5diff_627.txt +++ b/tools/testfiles/h5diff_627.txt @@ -1,11 +1,5 @@ ############################# Expected output for 'h5diff file1.h5 file2.h5 -n 200 g1/dset3 g1/dset4' ############################# -position dset3 dset4 difference ------------------------------------------------------------- -[ 0 0 ] 100.000000 110.000000 10.000000 -[ 0 1 ] 110.000000 100.000000 10.000000 -[ 1 0 ] 100.000000 90.000000 10.000000 -[ 1 1 ] 100.000000 80.000000 20.000000 -[ 2 0 ] 100.000000 140.000000 40.000000 -[ 2 1 ] 100.000000 200.000000 100.000000 +Dataset: and +6 differences found diff --git a/tools/testfiles/h5diff_628.txt b/tools/testfiles/h5diff_628.txt index 008b4d3..604df64 100644 --- a/tools/testfiles/h5diff_628.txt +++ b/tools/testfiles/h5diff_628.txt @@ -1,6 +1,5 @@ ############################# Expected output for 'h5diff file1.h5 file2.h5 -n 1 g1/dset3 g1/dset4' ############################# -position dset3 dset4 difference ------------------------------------------------------------- -[ 0 0 ] 100.000000 110.000000 10.000000 +Dataset: and +1 differences found diff --git a/tools/testfiles/h5diff_629.txt b/tools/testfiles/h5diff_629.txt index 8d7ced3..8f25c6e 100644 --- a/tools/testfiles/h5diff_629.txt +++ b/tools/testfiles/h5diff_629.txt @@ -2,4 +2,5 @@ Expected output for 'h5diff file1.h6 file2.h6' ############################# h5diff: : unable to open file -h5diff: : unable to open file +No common objects found. Files are not comparable. +Use -v for a list of objects. diff --git a/tools/testfiles/h5diff_70.txt b/tools/testfiles/h5diff_70.txt index a0413de..0fc1e09 100644 --- a/tools/testfiles/h5diff_70.txt +++ b/tools/testfiles/h5diff_70.txt @@ -1,35 +1,56 @@ ############################# -Expected output for 'h5diff file5.h5 file6.h5' +Expected output for 'h5diff file5.h5 file6.h5 -v' ############################# + +file1 file2 +--------------------------------------- + x x /dset + x x /g1 + + and are empty datasets +Dataset: and +Group: and position string of string of difference ------------------------------------------------------------ [ 0 ] a z [ 0 ] b z [ 1 ] d z [ 1 ] e z +Attribute: > and > +4 differences found position bitfield of bitfield of difference ------------------------------------------------------------ [ 0 ] 1 0 1 [ 1 ] 2 0 2 +Attribute: > and > +2 differences found position opaque of opaque of difference ------------------------------------------------------------ [ 0 ] 1 0 1 [ 1 ] 2 0 2 +Attribute: > and > +2 differences found position compound of compound of difference ------------------------------------------------------------ [ 0 ] 1 0 1 [ 0 ] 2.000000 0.000000 2.000000 [ 1 ] 3 0 3 [ 1 ] 4.000000 0.000000 4.000000 +Attribute: > and > +4 differences found position enum of enum of difference ------------------------------------------------------------ [ 0 ] RED GREEN [ 1 ] RED GREEN +Attribute: > and > +2 differences found position vlen of vlen of difference ------------------------------------------------------------ [ 0 ] 1 0 1 [ 1 ] 2 0 2 [ 1 ] 3 0 3 +Attribute: > and > +3 differences found position array of array of difference ------------------------------------------------------------ [ 0 ] 1 0 1 @@ -38,14 +59,20 @@ position array of array of difference [ 1 ] 4 0 4 [ 1 ] 5 0 5 [ 1 ] 6 0 6 +Attribute: > and > +6 differences found position integer of integer of difference ------------------------------------------------------------ [ 0 ] 1 0 1 [ 1 ] 2 0 2 +Attribute: > and > +2 differences found position float of float of difference ------------------------------------------------------------ [ 0 ] 1.000000 0.000000 1.000000 [ 1 ] 2.000000 0.000000 2.000000 +Attribute: > and > +2 differences found position string2D of string2D of difference ------------------------------------------------------------ [ 0 0 ] a z @@ -60,6 +87,8 @@ position string2D of string2D of difference [ 2 0 ] j z [ 2 1 ] k z [ 2 1 ] l z +Attribute: > and > +12 differences found position bitfield2D of bitfield2D of difference ------------------------------------------------------------ [ 0 0 ] 1 0 1 @@ -68,6 +97,8 @@ position bitfield2D of bitfield2D of difference [ 1 1 ] 4 0 4 [ 2 0 ] 5 0 5 [ 2 1 ] 6 0 6 +Attribute: > and > +6 differences found position opaque2D of opaque2D of difference ------------------------------------------------------------ [ 0 0 ] 1 0 1 @@ -76,6 +107,8 @@ position opaque2D of opaque2D of difference [ 1 1 ] 4 0 4 [ 2 0 ] 5 0 5 [ 2 1 ] 6 0 6 +Attribute: > and > +6 differences found position compound2D of compound2D of difference ------------------------------------------------------------ [ 0 0 ] 1 0 1 @@ -90,6 +123,8 @@ position compound2D of compound2D of difference [ 2 0 ] 10.000000 0.000000 10.000000 [ 2 1 ] 11 0 11 [ 2 1 ] 12.000000 0.000000 12.000000 +Attribute: > and > +12 differences found position enum2D of enum2D of difference ------------------------------------------------------------ [ 0 0 ] RED GREEN @@ -98,6 +133,8 @@ position enum2D of enum2D of difference [ 1 1 ] RED GREEN [ 2 0 ] RED GREEN [ 2 1 ] RED GREEN +Attribute: > and > +6 differences found position vlen2D of vlen2D of difference ------------------------------------------------------------ [ 0 1 ] 1 0 1 @@ -111,6 +148,8 @@ position vlen2D of vlen2D of difference [ 2 1 ] 9 0 9 [ 2 1 ] 10 0 10 [ 2 1 ] 11 0 11 +Attribute: > and > +11 differences found position array2D of array2D of difference ------------------------------------------------------------ [ 0 0 ] 1 0 1 @@ -131,6 +170,8 @@ position array2D of array2D of difference [ 2 1 ] 16 0 16 [ 2 1 ] 17 0 17 [ 2 1 ] 18 0 18 +Attribute: > and > +18 differences found position integer2D of integer2D of difference ------------------------------------------------------------ [ 0 0 ] 1 0 1 @@ -139,6 +180,8 @@ position integer2D of integer2D of difference [ 1 1 ] 4 0 4 [ 2 0 ] 5 0 5 [ 2 1 ] 6 0 6 +Attribute: > and > +6 differences found position float2D of float2D of difference ------------------------------------------------------------ [ 0 0 ] 1.000000 0.000000 1.000000 @@ -147,6 +190,8 @@ position float2D of float2D of difference [ 1 1 ] 4.000000 0.000000 4.000000 [ 2 0 ] 5.000000 0.000000 5.000000 [ 2 1 ] 6.000000 0.000000 6.000000 +Attribute: > and > +6 differences found position string3D of string3D of difference ------------------------------------------------------------ [ 0 0 0 ] a z @@ -196,6 +241,8 @@ position string3D of string3D of difference [ 3 2 0 ] W z [ 3 2 1 ] X z [ 3 2 1 ] Z z +Attribute: > and > +47 differences found position bitfield3D of bitfield3D of difference ------------------------------------------------------------ [ 0 0 0 ] 1 0 1 @@ -222,6 +269,8 @@ position bitfield3D of bitfield3D of difference [ 3 1 1 ] 22 0 22 [ 3 2 0 ] 23 0 23 [ 3 2 1 ] 24 0 24 +Attribute: > and > +24 differences found position opaque3D of opaque3D of difference ------------------------------------------------------------ [ 0 0 0 ] 1 0 1 @@ -248,6 +297,8 @@ position opaque3D of opaque3D of difference [ 3 1 1 ] 22 0 22 [ 3 2 0 ] 23 0 23 [ 3 2 1 ] 24 0 24 +Attribute: > and > +24 differences found position compound3D of compound3D of difference ------------------------------------------------------------ [ 0 0 0 ] 1 0 1 @@ -298,6 +349,8 @@ position compound3D of compound3D of difference [ 3 2 0 ] 46.000000 0.000000 46.000000 [ 3 2 1 ] 47 0 47 [ 3 2 1 ] 48.000000 0.000000 48.000000 +Attribute: > and > +48 differences found position enum3D of enum3D of difference ------------------------------------------------------------ [ 0 0 0 ] GREEN RED @@ -324,6 +377,8 @@ position enum3D of enum3D of difference [ 3 1 1 ] GREEN RED [ 3 2 0 ] GREEN RED [ 3 2 1 ] GREEN RED +Attribute: > and > +24 differences found position vlen3D of vlen3D of difference ------------------------------------------------------------ [ 0 0 1 ] 1 0 1 @@ -385,6 +440,8 @@ position vlen3D of vlen3D of difference [ 3 2 1 ] 57 0 57 [ 3 2 1 ] 58 0 58 [ 3 2 1 ] 59 0 59 +Attribute: > and > +59 differences found position array3D of array3D of difference ------------------------------------------------------------ [ 0 0 0 ] 1 0 1 @@ -459,6 +516,8 @@ position array3D of array3D of difference [ 3 2 1 ] 70 0 70 [ 3 2 1 ] 71 0 71 [ 3 2 1 ] 72 0 72 +Attribute: > and > +72 differences found position integer3D of integer3D of difference ------------------------------------------------------------ [ 0 0 0 ] 1 0 1 @@ -485,6 +544,8 @@ position integer3D of integer3D of difference [ 3 1 1 ] 22 0 22 [ 3 2 0 ] 23 0 23 [ 3 2 1 ] 24 0 24 +Attribute: > and > +24 differences found position float3D of float3D of difference ------------------------------------------------------------ [ 0 0 0 ] 1.000000 0.000000 1.000000 @@ -511,35 +572,50 @@ position float3D of float3D of difference [ 3 1 1 ] 22.000000 0.000000 22.000000 [ 3 2 0 ] 23.000000 0.000000 23.000000 [ 3 2 1 ] 24.000000 0.000000 24.000000 +Attribute: > and > +24 differences found +Group: and position string of string of difference ------------------------------------------------------------ [ 0 ] a z [ 0 ] b z [ 1 ] d z [ 1 ] e z +Attribute: > and > +4 differences found position bitfield of bitfield of difference ------------------------------------------------------------ [ 0 ] 1 0 1 [ 1 ] 2 0 2 +Attribute: > and > +2 differences found position opaque of opaque of difference ------------------------------------------------------------ [ 0 ] 1 0 1 [ 1 ] 2 0 2 +Attribute: > and > +2 differences found position compound of compound of difference ------------------------------------------------------------ [ 0 ] 1 0 1 [ 0 ] 2.000000 0.000000 2.000000 [ 1 ] 3 0 3 [ 1 ] 4.000000 0.000000 4.000000 +Attribute: > and > +4 differences found position enum of enum of difference ------------------------------------------------------------ [ 0 ] RED GREEN [ 1 ] RED GREEN +Attribute: > and > +2 differences found position vlen of vlen of difference ------------------------------------------------------------ [ 0 ] 1 0 1 [ 1 ] 2 0 2 [ 1 ] 3 0 3 +Attribute: > and > +3 differences found position array of array of difference ------------------------------------------------------------ [ 0 ] 1 0 1 @@ -548,14 +624,20 @@ position array of array of difference [ 1 ] 4 0 4 [ 1 ] 5 0 5 [ 1 ] 6 0 6 +Attribute: > and > +6 differences found position integer of integer of difference ------------------------------------------------------------ [ 0 ] 1 0 1 [ 1 ] 2 0 2 +Attribute: > and > +2 differences found position float of float of difference ------------------------------------------------------------ [ 0 ] 1.000000 0.000000 1.000000 [ 1 ] 2.000000 0.000000 2.000000 +Attribute: > and > +2 differences found position string2D of string2D of difference ------------------------------------------------------------ [ 0 0 ] a z @@ -570,6 +652,8 @@ position string2D of string2D of difference [ 2 0 ] j z [ 2 1 ] k z [ 2 1 ] l z +Attribute: > and > +12 differences found position bitfield2D of bitfield2D of difference ------------------------------------------------------------ [ 0 0 ] 1 0 1 @@ -578,6 +662,8 @@ position bitfield2D of bitfield2D of difference [ 1 1 ] 4 0 4 [ 2 0 ] 5 0 5 [ 2 1 ] 6 0 6 +Attribute: > and > +6 differences found position opaque2D of opaque2D of difference ------------------------------------------------------------ [ 0 0 ] 1 0 1 @@ -586,6 +672,8 @@ position opaque2D of opaque2D of difference [ 1 1 ] 4 0 4 [ 2 0 ] 5 0 5 [ 2 1 ] 6 0 6 +Attribute: > and > +6 differences found position compound2D of compound2D of difference ------------------------------------------------------------ [ 0 0 ] 1 0 1 @@ -600,6 +688,8 @@ position compound2D of compound2D of difference [ 2 0 ] 10.000000 0.000000 10.000000 [ 2 1 ] 11 0 11 [ 2 1 ] 12.000000 0.000000 12.000000 +Attribute: > and > +12 differences found position enum2D of enum2D of difference ------------------------------------------------------------ [ 0 0 ] RED GREEN @@ -608,6 +698,8 @@ position enum2D of enum2D of difference [ 1 1 ] RED GREEN [ 2 0 ] RED GREEN [ 2 1 ] RED GREEN +Attribute: > and > +6 differences found position vlen2D of vlen2D of difference ------------------------------------------------------------ [ 0 1 ] 1 0 1 @@ -621,6 +713,8 @@ position vlen2D of vlen2D of difference [ 2 1 ] 9 0 9 [ 2 1 ] 10 0 10 [ 2 1 ] 11 0 11 +Attribute: > and > +11 differences found position array2D of array2D of difference ------------------------------------------------------------ [ 0 0 ] 1 0 1 @@ -641,6 +735,8 @@ position array2D of array2D of difference [ 2 1 ] 16 0 16 [ 2 1 ] 17 0 17 [ 2 1 ] 18 0 18 +Attribute: > and > +18 differences found position integer2D of integer2D of difference ------------------------------------------------------------ [ 0 0 ] 1 0 1 @@ -649,6 +745,8 @@ position integer2D of integer2D of difference [ 1 1 ] 4 0 4 [ 2 0 ] 5 0 5 [ 2 1 ] 6 0 6 +Attribute: > and > +6 differences found position float2D of float2D of difference ------------------------------------------------------------ [ 0 0 ] 1.000000 0.000000 1.000000 @@ -657,6 +755,8 @@ position float2D of float2D of difference [ 1 1 ] 4.000000 0.000000 4.000000 [ 2 0 ] 5.000000 0.000000 5.000000 [ 2 1 ] 6.000000 0.000000 6.000000 +Attribute: > and > +6 differences found position string3D of string3D of difference ------------------------------------------------------------ [ 0 0 0 ] a z @@ -706,6 +806,8 @@ position string3D of string3D of difference [ 3 2 0 ] W z [ 3 2 1 ] X z [ 3 2 1 ] Z z +Attribute: > and > +47 differences found position bitfield3D of bitfield3D of difference ------------------------------------------------------------ [ 0 0 0 ] 1 0 1 @@ -732,6 +834,8 @@ position bitfield3D of bitfield3D of difference [ 3 1 1 ] 22 0 22 [ 3 2 0 ] 23 0 23 [ 3 2 1 ] 24 0 24 +Attribute: > and > +24 differences found position opaque3D of opaque3D of difference ------------------------------------------------------------ [ 0 0 0 ] 1 0 1 @@ -758,6 +862,8 @@ position opaque3D of opaque3D of difference [ 3 1 1 ] 22 0 22 [ 3 2 0 ] 23 0 23 [ 3 2 1 ] 24 0 24 +Attribute: > and > +24 differences found position compound3D of compound3D of difference ------------------------------------------------------------ [ 0 0 0 ] 1 0 1 @@ -808,6 +914,8 @@ position compound3D of compound3D of difference [ 3 2 0 ] 46.000000 0.000000 46.000000 [ 3 2 1 ] 47 0 47 [ 3 2 1 ] 48.000000 0.000000 48.000000 +Attribute: > and > +48 differences found position enum3D of enum3D of difference ------------------------------------------------------------ [ 0 0 0 ] GREEN RED @@ -834,6 +942,8 @@ position enum3D of enum3D of difference [ 3 1 1 ] GREEN RED [ 3 2 0 ] GREEN RED [ 3 2 1 ] GREEN RED +Attribute: > and > +24 differences found position vlen3D of vlen3D of difference ------------------------------------------------------------ [ 0 0 1 ] 1 0 1 @@ -895,6 +1005,8 @@ position vlen3D of vlen3D of difference [ 3 2 1 ] 57 0 57 [ 3 2 1 ] 58 0 58 [ 3 2 1 ] 59 0 59 +Attribute: > and > +59 differences found position array3D of array3D of difference ------------------------------------------------------------ [ 0 0 0 ] 1 0 1 @@ -969,6 +1081,8 @@ position array3D of array3D of difference [ 3 2 1 ] 70 0 70 [ 3 2 1 ] 71 0 71 [ 3 2 1 ] 72 0 72 +Attribute: > and > +72 differences found position integer3D of integer3D of difference ------------------------------------------------------------ [ 0 0 0 ] 1 0 1 @@ -995,6 +1109,8 @@ position integer3D of integer3D of difference [ 3 1 1 ] 22 0 22 [ 3 2 0 ] 23 0 23 [ 3 2 1 ] 24 0 24 +Attribute: > and > +24 differences found position float3D of float3D of difference ------------------------------------------------------------ [ 0 0 0 ] 1.000000 0.000000 1.000000 @@ -1021,3 +1137,6 @@ position float3D of float3D of difference [ 3 1 1 ] 22.000000 0.000000 22.000000 [ 3 2 0 ] 23.000000 0.000000 23.000000 [ 3 2 1 ] 24.000000 0.000000 24.000000 +Attribute: > and > +24 differences found +0 differences found diff --git a/tools/testfiles/h5diff_80.txt b/tools/testfiles/h5diff_80.txt index 0bdf1ee..420b2dc 100644 --- a/tools/testfiles/h5diff_80.txt +++ b/tools/testfiles/h5diff_80.txt @@ -1,10 +1,48 @@ ############################# -Expected output for 'h5diff file7.h5 file8.h5' +Expected output for 'h5diff file7.h5 file8.h5 -v' ############################# + +file1 file2 +--------------------------------------- + x x /dset + x x /g1 + x x /g1/array + x x /g1/array2D + x x /g1/array3D + x x /g1/bitfield + x x /g1/bitfield2D + x x /g1/bitfield3D + x x /g1/compound + x x /g1/compound2D + x x /g1/compound3D + x x /g1/enum + x x /g1/enum2D + x x /g1/enum3D + x x /g1/float + x x /g1/float2D + x x /g1/float3D + x x /g1/integer + x x /g1/integer2D + x x /g1/integer3D + x x /g1/opaque + x x /g1/opaque2D + x x /g1/opaque3D + x x /g1/reference + x x /g1/reference2D + x x /g1/reference3D + x x /g1/string + x x /g1/string2D + x x /g1/string3D + x x /g1/vlen + x x /g1/vlen2D + x x /g1/vlen3D + position dset dset difference ------------------------------------------------------------ [ 0 ] 1 0 1 [ 1 ] 2 0 2 +Dataset: and +Group: and position array array difference ------------------------------------------------------------ [ 0 ] 1 0 1 @@ -13,6 +51,7 @@ position array array difference [ 1 ] 4 0 4 [ 1 ] 5 0 5 [ 1 ] 6 0 6 +Dataset: and position array2D array2D difference ------------------------------------------------------------ [ 0 0 ] 1 0 1 @@ -33,6 +72,7 @@ position array2D array2D difference [ 2 1 ] 16 0 16 [ 2 1 ] 17 0 17 [ 2 1 ] 18 0 18 +Dataset: and position array3D array3D difference ------------------------------------------------------------ [ 0 0 0 ] 1 0 1 @@ -107,10 +147,12 @@ position array3D array3D difference [ 3 2 1 ] 70 0 70 [ 3 2 1 ] 71 0 71 [ 3 2 1 ] 72 0 72 +Dataset: and position bitfield bitfield difference ------------------------------------------------------------ [ 0 ] 1 0 1 [ 1 ] 2 0 2 +Dataset: and position bitfield2D bitfield2D difference ------------------------------------------------------------ [ 0 0 ] 1 0 1 @@ -119,6 +161,7 @@ position bitfield2D bitfield2D difference [ 1 1 ] 4 0 4 [ 2 0 ] 5 0 5 [ 2 1 ] 6 0 6 +Dataset: and position bitfield3D bitfield3D difference ------------------------------------------------------------ [ 0 0 0 ] 1 0 1 @@ -145,12 +188,14 @@ position bitfield3D bitfield3D difference [ 3 1 1 ] 22 0 22 [ 3 2 0 ] 23 0 23 [ 3 2 1 ] 24 0 24 +Dataset: and position compound compound difference ------------------------------------------------------------ [ 0 ] 1 0 1 [ 0 ] 2.000000 0.000000 2.000000 [ 1 ] 3 0 3 [ 1 ] 4.000000 0.000000 4.000000 +Dataset: and position compound2D compound2D difference ------------------------------------------------------------ [ 0 0 ] 1 0 1 @@ -165,6 +210,7 @@ position compound2D compound2D difference [ 2 0 ] 10.000000 0.000000 10.000000 [ 2 1 ] 11 0 11 [ 2 1 ] 12.000000 0.000000 12.000000 +Dataset: and position compound3D compound3D difference ------------------------------------------------------------ [ 0 0 0 ] 1 0 1 @@ -215,13 +261,20 @@ position compound3D compound3D difference [ 3 2 0 ] 46.000000 0.000000 46.000000 [ 3 2 1 ] 47 0 47 [ 3 2 1 ] 48.000000 0.000000 48.000000 +Dataset: and position enum enum difference ------------------------------------------------------------ [ 0 ] RED GREEN +Dataset: and + and are empty datasets +Dataset: and + and are empty datasets +Dataset: and position float float difference ------------------------------------------------------------ [ 0 ] 1.000000 0.000000 1.000000 [ 1 ] 2.000000 0.000000 2.000000 +Dataset: and position float2D float2D difference ------------------------------------------------------------ [ 0 0 ] 1.000000 0.000000 1.000000 @@ -230,6 +283,7 @@ position float2D float2D difference [ 1 1 ] 4.000000 0.000000 4.000000 [ 2 0 ] 5.000000 0.000000 5.000000 [ 2 1 ] 6.000000 0.000000 6.000000 +Dataset: and position float3D float3D difference ------------------------------------------------------------ [ 0 0 0 ] 1.000000 0.000000 1.000000 @@ -256,10 +310,12 @@ position float3D float3D difference [ 3 1 1 ] 22.000000 0.000000 22.000000 [ 3 2 0 ] 23.000000 0.000000 23.000000 [ 3 2 1 ] 24.000000 0.000000 24.000000 +Dataset: and position integer integer difference ------------------------------------------------------------ [ 0 ] 1 0 1 [ 1 ] 2 0 2 +Dataset: and position integer2D integer2D difference ------------------------------------------------------------ [ 0 0 ] 1 0 1 @@ -268,6 +324,7 @@ position integer2D integer2D difference [ 1 1 ] 4 0 4 [ 2 0 ] 5 0 5 [ 2 1 ] 6 0 6 +Dataset: and position integer3D integer3D difference ------------------------------------------------------------ [ 0 0 0 ] 1 0 1 @@ -294,10 +351,12 @@ position integer3D integer3D difference [ 3 1 1 ] 22 0 22 [ 3 2 0 ] 23 0 23 [ 3 2 1 ] 24 0 24 +Dataset: and position opaque opaque difference ------------------------------------------------------------ [ 0 ] 1 0 1 [ 1 ] 2 0 2 +Dataset: and position opaque2D opaque2D difference ------------------------------------------------------------ [ 0 0 ] 1 0 1 @@ -306,6 +365,7 @@ position opaque2D opaque2D difference [ 1 1 ] 4 0 4 [ 2 0 ] 5 0 5 [ 2 1 ] 6 0 6 +Dataset: and position opaque3D opaque3D difference ------------------------------------------------------------ [ 0 0 0 ] 1 0 1 @@ -332,6 +392,7 @@ position opaque3D opaque3D difference [ 3 1 1 ] 22 0 22 [ 3 2 0 ] 23 0 23 [ 3 2 1 ] 24 0 24 +Dataset: and position difference ------------------------------------------------------------ [ 0 ] 1 0 1 @@ -340,6 +401,7 @@ position difference ------------------------------------------------------------ [ 0 ] 1 0 1 [ 1 ] 2 0 2 +Dataset: and position difference ------------------------------------------------------------ [ 0 ] 1 0 1 @@ -364,6 +426,7 @@ position difference ------------------------------------------------------------ [ 0 ] 1 0 1 [ 1 ] 2 0 2 +Dataset: and position difference ------------------------------------------------------------ [ 0 ] 1 0 1 @@ -460,12 +523,14 @@ position difference ------------------------------------------------------------ [ 0 ] 1 0 1 [ 1 ] 2 0 2 +Dataset: and position string string difference ------------------------------------------------------------ [ 0 ] a z [ 0 ] b z [ 1 ] d z [ 1 ] e z +Dataset: and position string2D string2D difference ------------------------------------------------------------ [ 0 0 ] a z @@ -480,6 +545,7 @@ position string2D string2D difference [ 2 0 ] j z [ 2 1 ] k z [ 2 1 ] l z +Dataset: and position string3D string3D difference ------------------------------------------------------------ [ 0 0 0 ] a z @@ -529,11 +595,13 @@ position string3D string3D difference [ 3 2 0 ] W z [ 3 2 1 ] X z [ 3 2 1 ] Z z +Dataset: and position vlen vlen difference ------------------------------------------------------------ [ 0 ] 1 0 1 [ 1 ] 2 0 2 [ 1 ] 3 0 3 +Dataset: and position vlen2D vlen2D difference ------------------------------------------------------------ [ 0 1 ] 1 0 1 @@ -547,6 +615,7 @@ position vlen2D vlen2D difference [ 2 1 ] 9 0 9 [ 2 1 ] 10 0 10 [ 2 1 ] 11 0 11 +Dataset: and position vlen3D vlen3D difference ------------------------------------------------------------ [ 0 0 1 ] 1 0 1 @@ -608,3 +677,6 @@ position vlen3D vlen3D difference [ 3 2 1 ] 57 0 57 [ 3 2 1 ] 58 0 58 [ 3 2 1 ] 59 0 59 +Dataset: and +Group: and +491 differences found diff --git a/tools/testfiles/h5diff_81.txt b/tools/testfiles/h5diff_81.txt deleted file mode 100644 index 004babd..0000000 --- a/tools/testfiles/h5diff_81.txt +++ /dev/null @@ -1,749 +0,0 @@ -############################# -Expected output for 'h5diff file7.h5 file8.h5 -v' -############################# -$h5diff file7.h5 file8.h5 -v - -file1 file2 ---------------------------------------- - x x /dset - x x /g1 - x x /g1/array - x x /g1/array2D - x x /g1/array3D - x x /g1/bitfield - x x /g1/bitfield2D - x x /g1/bitfield3D - x x /g1/compound - x x /g1/compound2D - x x /g1/compound3D - x x /g1/enum - x x /g1/enum2D - x x /g1/enum3D - x x /g1/float - x x /g1/float2D - x x /g1/float3D - x x /g1/integer - x x /g1/integer2D - x x /g1/integer3D - x x /g1/opaque - x x /g1/opaque2D - x x /g1/opaque3D - x x /g1/reference - x x /g1/reference2D - x x /g1/reference3D - x x /g1/string - x x /g1/string2D - x x /g1/string3D - x x /g1/vlen - x x /g1/vlen2D - x x /g1/vlen3D - x x /null_dset - -Dataset: and -position dset dset difference ------------------------------------------------------------- -[ 0 ] 1 0 1 -[ 1 ] 2 0 2 -2 differences found -Group: and -Dataset: and -position array array difference ------------------------------------------------------------- -[ 0 ] 1 0 1 -[ 0 ] 2 0 2 -[ 0 ] 3 0 3 -[ 1 ] 4 0 4 -[ 1 ] 5 0 5 -[ 1 ] 6 0 6 -6 differences found -Dataset: and -position array2D array2D difference ------------------------------------------------------------- -[ 0 0 ] 1 0 1 -[ 0 0 ] 2 0 2 -[ 0 0 ] 3 0 3 -[ 0 1 ] 4 0 4 -[ 0 1 ] 5 0 5 -[ 0 1 ] 6 0 6 -[ 1 0 ] 7 0 7 -[ 1 0 ] 8 0 8 -[ 1 0 ] 9 0 9 -[ 1 1 ] 10 0 10 -[ 1 1 ] 11 0 11 -[ 1 1 ] 12 0 12 -[ 2 0 ] 13 0 13 -[ 2 0 ] 14 0 14 -[ 2 0 ] 15 0 15 -[ 2 1 ] 16 0 16 -[ 2 1 ] 17 0 17 -[ 2 1 ] 18 0 18 -18 differences found -Dataset: and -position array3D array3D difference ------------------------------------------------------------- -[ 0 0 0 ] 1 0 1 -[ 0 0 0 ] 2 0 2 -[ 0 0 0 ] 3 0 3 -[ 0 0 1 ] 4 0 4 -[ 0 0 1 ] 5 0 5 -[ 0 0 1 ] 6 0 6 -[ 0 1 0 ] 7 0 7 -[ 0 1 0 ] 8 0 8 -[ 0 1 0 ] 9 0 9 -[ 0 1 1 ] 10 0 10 -[ 0 1 1 ] 11 0 11 -[ 0 1 1 ] 12 0 12 -[ 0 2 0 ] 13 0 13 -[ 0 2 0 ] 14 0 14 -[ 0 2 0 ] 15 0 15 -[ 0 2 1 ] 16 0 16 -[ 0 2 1 ] 17 0 17 -[ 0 2 1 ] 18 0 18 -[ 1 0 0 ] 19 0 19 -[ 1 0 0 ] 20 0 20 -[ 1 0 0 ] 21 0 21 -[ 1 0 1 ] 22 0 22 -[ 1 0 1 ] 23 0 23 -[ 1 0 1 ] 24 0 24 -[ 1 1 0 ] 25 0 25 -[ 1 1 0 ] 26 0 26 -[ 1 1 0 ] 27 0 27 -[ 1 1 1 ] 28 0 28 -[ 1 1 1 ] 29 0 29 -[ 1 1 1 ] 30 0 30 -[ 1 2 0 ] 31 0 31 -[ 1 2 0 ] 32 0 32 -[ 1 2 0 ] 33 0 33 -[ 1 2 1 ] 34 0 34 -[ 1 2 1 ] 35 0 35 -[ 1 2 1 ] 36 0 36 -[ 2 0 0 ] 37 0 37 -[ 2 0 0 ] 38 0 38 -[ 2 0 0 ] 39 0 39 -[ 2 0 1 ] 40 0 40 -[ 2 0 1 ] 41 0 41 -[ 2 0 1 ] 42 0 42 -[ 2 1 0 ] 43 0 43 -[ 2 1 0 ] 44 0 44 -[ 2 1 0 ] 45 0 45 -[ 2 1 1 ] 46 0 46 -[ 2 1 1 ] 47 0 47 -[ 2 1 1 ] 48 0 48 -[ 2 2 0 ] 49 0 49 -[ 2 2 0 ] 50 0 50 -[ 2 2 0 ] 51 0 51 -[ 2 2 1 ] 52 0 52 -[ 2 2 1 ] 53 0 53 -[ 2 2 1 ] 54 0 54 -[ 3 0 0 ] 55 0 55 -[ 3 0 0 ] 56 0 56 -[ 3 0 0 ] 57 0 57 -[ 3 0 1 ] 58 0 58 -[ 3 0 1 ] 59 0 59 -[ 3 0 1 ] 60 0 60 -[ 3 1 0 ] 61 0 61 -[ 3 1 0 ] 62 0 62 -[ 3 1 0 ] 63 0 63 -[ 3 1 1 ] 64 0 64 -[ 3 1 1 ] 65 0 65 -[ 3 1 1 ] 66 0 66 -[ 3 2 0 ] 67 0 67 -[ 3 2 0 ] 68 0 68 -[ 3 2 0 ] 69 0 69 -[ 3 2 1 ] 70 0 70 -[ 3 2 1 ] 71 0 71 -[ 3 2 1 ] 72 0 72 -72 differences found -Dataset: and -position bitfield bitfield difference ------------------------------------------------------------- -[ 0 ] 1 0 1 -[ 1 ] 2 0 2 -2 differences found -Dataset: and -position bitfield2D bitfield2D difference ------------------------------------------------------------- -[ 0 0 ] 1 0 1 -[ 0 1 ] 2 0 2 -[ 1 0 ] 3 0 3 -[ 1 1 ] 4 0 4 -[ 2 0 ] 5 0 5 -[ 2 1 ] 6 0 6 -6 differences found -Dataset: and -position bitfield3D bitfield3D difference ------------------------------------------------------------- -[ 0 0 0 ] 1 0 1 -[ 0 0 1 ] 2 0 2 -[ 0 1 0 ] 3 0 3 -[ 0 1 1 ] 4 0 4 -[ 0 2 0 ] 5 0 5 -[ 0 2 1 ] 6 0 6 -[ 1 0 0 ] 7 0 7 -[ 1 0 1 ] 8 0 8 -[ 1 1 0 ] 9 0 9 -[ 1 1 1 ] 10 0 10 -[ 1 2 0 ] 11 0 11 -[ 1 2 1 ] 12 0 12 -[ 2 0 0 ] 13 0 13 -[ 2 0 1 ] 14 0 14 -[ 2 1 0 ] 15 0 15 -[ 2 1 1 ] 16 0 16 -[ 2 2 0 ] 17 0 17 -[ 2 2 1 ] 18 0 18 -[ 3 0 0 ] 19 0 19 -[ 3 0 1 ] 20 0 20 -[ 3 1 0 ] 21 0 21 -[ 3 1 1 ] 22 0 22 -[ 3 2 0 ] 23 0 23 -[ 3 2 1 ] 24 0 24 -24 differences found -Dataset: and -position compound compound difference ------------------------------------------------------------- -[ 0 ] 1 0 1 -[ 0 ] 2.000000 0.000000 2.000000 -[ 1 ] 3 0 3 -[ 1 ] 4.000000 0.000000 4.000000 -4 differences found -Dataset: and -position compound2D compound2D difference ------------------------------------------------------------- -[ 0 0 ] 1 0 1 -[ 0 0 ] 2.000000 0.000000 2.000000 -[ 0 1 ] 3 0 3 -[ 0 1 ] 4.000000 0.000000 4.000000 -[ 1 0 ] 5 0 5 -[ 1 0 ] 6.000000 0.000000 6.000000 -[ 1 1 ] 7 0 7 -[ 1 1 ] 8.000000 0.000000 8.000000 -[ 2 0 ] 9 0 9 -[ 2 0 ] 10.000000 0.000000 10.000000 -[ 2 1 ] 11 0 11 -[ 2 1 ] 12.000000 0.000000 12.000000 -12 differences found -Dataset: and -position compound3D compound3D difference ------------------------------------------------------------- -[ 0 0 0 ] 1 0 1 -[ 0 0 0 ] 2.000000 0.000000 2.000000 -[ 0 0 1 ] 3 0 3 -[ 0 0 1 ] 4.000000 0.000000 4.000000 -[ 0 1 0 ] 5 0 5 -[ 0 1 0 ] 6.000000 0.000000 6.000000 -[ 0 1 1 ] 7 0 7 -[ 0 1 1 ] 8.000000 0.000000 8.000000 -[ 0 2 0 ] 9 0 9 -[ 0 2 0 ] 10.000000 0.000000 10.000000 -[ 0 2 1 ] 11 0 11 -[ 0 2 1 ] 12.000000 0.000000 12.000000 -[ 1 0 0 ] 13 0 13 -[ 1 0 0 ] 14.000000 0.000000 14.000000 -[ 1 0 1 ] 15 0 15 -[ 1 0 1 ] 16.000000 0.000000 16.000000 -[ 1 1 0 ] 17 0 17 -[ 1 1 0 ] 18.000000 0.000000 18.000000 -[ 1 1 1 ] 19 0 19 -[ 1 1 1 ] 20.000000 0.000000 20.000000 -[ 1 2 0 ] 21 0 21 -[ 1 2 0 ] 22.000000 0.000000 22.000000 -[ 1 2 1 ] 23 0 23 -[ 1 2 1 ] 24.000000 0.000000 24.000000 -[ 2 0 0 ] 25 0 25 -[ 2 0 0 ] 26.000000 0.000000 26.000000 -[ 2 0 1 ] 27 0 27 -[ 2 0 1 ] 28.000000 0.000000 28.000000 -[ 2 1 0 ] 29 0 29 -[ 2 1 0 ] 30.000000 0.000000 30.000000 -[ 2 1 1 ] 31 0 31 -[ 2 1 1 ] 32.000000 0.000000 32.000000 -[ 2 2 0 ] 33 0 33 -[ 2 2 0 ] 34.000000 0.000000 34.000000 -[ 2 2 1 ] 35 0 35 -[ 2 2 1 ] 36.000000 0.000000 36.000000 -[ 3 0 0 ] 37 0 37 -[ 3 0 0 ] 38.000000 0.000000 38.000000 -[ 3 0 1 ] 39 0 39 -[ 3 0 1 ] 40.000000 0.000000 40.000000 -[ 3 1 0 ] 41 0 41 -[ 3 1 0 ] 42.000000 0.000000 42.000000 -[ 3 1 1 ] 43 0 43 -[ 3 1 1 ] 44.000000 0.000000 44.000000 -[ 3 2 0 ] 45 0 45 -[ 3 2 0 ] 46.000000 0.000000 46.000000 -[ 3 2 1 ] 47 0 47 -[ 3 2 1 ] 48.000000 0.000000 48.000000 -48 differences found -Dataset: and -position enum enum difference ------------------------------------------------------------- -[ 0 ] RED GREEN -1 differences found -Dataset: and - and are empty datasets -Dataset: and - and are empty datasets -Dataset: and -position float float difference ------------------------------------------------------------- -[ 0 ] 1.000000 0.000000 1.000000 -[ 1 ] 2.000000 0.000000 2.000000 -2 differences found -Dataset: and -position float2D float2D difference ------------------------------------------------------------- -[ 0 0 ] 1.000000 0.000000 1.000000 -[ 0 1 ] 2.000000 0.000000 2.000000 -[ 1 0 ] 3.000000 0.000000 3.000000 -[ 1 1 ] 4.000000 0.000000 4.000000 -[ 2 0 ] 5.000000 0.000000 5.000000 -[ 2 1 ] 6.000000 0.000000 6.000000 -6 differences found -Dataset: and -position float3D float3D difference ------------------------------------------------------------- -[ 0 0 0 ] 1.000000 0.000000 1.000000 -[ 0 0 1 ] 2.000000 0.000000 2.000000 -[ 0 1 0 ] 3.000000 0.000000 3.000000 -[ 0 1 1 ] 4.000000 0.000000 4.000000 -[ 0 2 0 ] 5.000000 0.000000 5.000000 -[ 0 2 1 ] 6.000000 0.000000 6.000000 -[ 1 0 0 ] 7.000000 0.000000 7.000000 -[ 1 0 1 ] 8.000000 0.000000 8.000000 -[ 1 1 0 ] 9.000000 0.000000 9.000000 -[ 1 1 1 ] 10.000000 0.000000 10.000000 -[ 1 2 0 ] 11.000000 0.000000 11.000000 -[ 1 2 1 ] 12.000000 0.000000 12.000000 -[ 2 0 0 ] 13.000000 0.000000 13.000000 -[ 2 0 1 ] 14.000000 0.000000 14.000000 -[ 2 1 0 ] 15.000000 0.000000 15.000000 -[ 2 1 1 ] 16.000000 0.000000 16.000000 -[ 2 2 0 ] 17.000000 0.000000 17.000000 -[ 2 2 1 ] 18.000000 0.000000 18.000000 -[ 3 0 0 ] 19.000000 0.000000 19.000000 -[ 3 0 1 ] 20.000000 0.000000 20.000000 -[ 3 1 0 ] 21.000000 0.000000 21.000000 -[ 3 1 1 ] 22.000000 0.000000 22.000000 -[ 3 2 0 ] 23.000000 0.000000 23.000000 -[ 3 2 1 ] 24.000000 0.000000 24.000000 -24 differences found -Dataset: and -position integer integer difference ------------------------------------------------------------- -[ 0 ] 1 0 1 -[ 1 ] 2 0 2 -2 differences found -Dataset: and -position integer2D integer2D difference ------------------------------------------------------------- -[ 0 0 ] 1 0 1 -[ 0 1 ] 2 0 2 -[ 1 0 ] 3 0 3 -[ 1 1 ] 4 0 4 -[ 2 0 ] 5 0 5 -[ 2 1 ] 6 0 6 -6 differences found -Dataset: and -position integer3D integer3D difference ------------------------------------------------------------- -[ 0 0 0 ] 1 0 1 -[ 0 0 1 ] 2 0 2 -[ 0 1 0 ] 3 0 3 -[ 0 1 1 ] 4 0 4 -[ 0 2 0 ] 5 0 5 -[ 0 2 1 ] 6 0 6 -[ 1 0 0 ] 7 0 7 -[ 1 0 1 ] 8 0 8 -[ 1 1 0 ] 9 0 9 -[ 1 1 1 ] 10 0 10 -[ 1 2 0 ] 11 0 11 -[ 1 2 1 ] 12 0 12 -[ 2 0 0 ] 13 0 13 -[ 2 0 1 ] 14 0 14 -[ 2 1 0 ] 15 0 15 -[ 2 1 1 ] 16 0 16 -[ 2 2 0 ] 17 0 17 -[ 2 2 1 ] 18 0 18 -[ 3 0 0 ] 19 0 19 -[ 3 0 1 ] 20 0 20 -[ 3 1 0 ] 21 0 21 -[ 3 1 1 ] 22 0 22 -[ 3 2 0 ] 23 0 23 -[ 3 2 1 ] 24 0 24 -24 differences found -Dataset: and -position opaque opaque difference ------------------------------------------------------------- -[ 0 ] 1 0 1 -[ 1 ] 2 0 2 -2 differences found -Dataset: and -position opaque2D opaque2D difference ------------------------------------------------------------- -[ 0 0 ] 1 0 1 -[ 0 1 ] 2 0 2 -[ 1 0 ] 3 0 3 -[ 1 1 ] 4 0 4 -[ 2 0 ] 5 0 5 -[ 2 1 ] 6 0 6 -6 differences found -Dataset: and -position opaque3D opaque3D difference ------------------------------------------------------------- -[ 0 0 0 ] 1 0 1 -[ 0 0 1 ] 2 0 2 -[ 0 1 0 ] 3 0 3 -[ 0 1 1 ] 4 0 4 -[ 0 2 0 ] 5 0 5 -[ 0 2 1 ] 6 0 6 -[ 1 0 0 ] 7 0 7 -[ 1 0 1 ] 8 0 8 -[ 1 1 0 ] 9 0 9 -[ 1 1 1 ] 10 0 10 -[ 1 2 0 ] 11 0 11 -[ 1 2 1 ] 12 0 12 -[ 2 0 0 ] 13 0 13 -[ 2 0 1 ] 14 0 14 -[ 2 1 0 ] 15 0 15 -[ 2 1 1 ] 16 0 16 -[ 2 2 0 ] 17 0 17 -[ 2 2 1 ] 18 0 18 -[ 3 0 0 ] 19 0 19 -[ 3 0 1 ] 20 0 20 -[ 3 1 0 ] 21 0 21 -[ 3 1 1 ] 22 0 22 -[ 3 2 0 ] 23 0 23 -[ 3 2 1 ] 24 0 24 -24 differences found -Dataset: and -position difference ------------------------------------------------------------- -[ 0 ] 1 0 1 -[ 1 ] 2 0 2 -2 differences found -position difference ------------------------------------------------------------- -[ 0 ] 1 0 1 -[ 1 ] 2 0 2 -2 differences found -4 differences found -Dataset: and -position difference ------------------------------------------------------------- -[ 0 ] 1 0 1 -[ 1 ] 2 0 2 -2 differences found -position difference ------------------------------------------------------------- -[ 0 ] 1 0 1 -[ 1 ] 2 0 2 -2 differences found -position difference ------------------------------------------------------------- -[ 0 ] 1 0 1 -[ 1 ] 2 0 2 -2 differences found -position difference ------------------------------------------------------------- -[ 0 ] 1 0 1 -[ 1 ] 2 0 2 -2 differences found -position difference ------------------------------------------------------------- -[ 0 ] 1 0 1 -[ 1 ] 2 0 2 -2 differences found -position difference ------------------------------------------------------------- -[ 0 ] 1 0 1 -[ 1 ] 2 0 2 -2 differences found -12 differences found -Dataset: and -position difference ------------------------------------------------------------- -[ 0 ] 1 0 1 -[ 1 ] 2 0 2 -2 differences found -position difference ------------------------------------------------------------- -[ 0 ] 1 0 1 -[ 1 ] 2 0 2 -2 differences found -position difference ------------------------------------------------------------- -[ 0 ] 1 0 1 -[ 1 ] 2 0 2 -2 differences found -position difference ------------------------------------------------------------- -[ 0 ] 1 0 1 -[ 1 ] 2 0 2 -2 differences found -position difference ------------------------------------------------------------- -[ 0 ] 1 0 1 -[ 1 ] 2 0 2 -2 differences found -position difference ------------------------------------------------------------- -[ 0 ] 1 0 1 -[ 1 ] 2 0 2 -2 differences found -position difference ------------------------------------------------------------- -[ 0 ] 1 0 1 -[ 1 ] 2 0 2 -2 differences found -position difference ------------------------------------------------------------- -[ 0 ] 1 0 1 -[ 1 ] 2 0 2 -2 differences found -position difference ------------------------------------------------------------- -[ 0 ] 1 0 1 -[ 1 ] 2 0 2 -2 differences found -position difference ------------------------------------------------------------- -[ 0 ] 1 0 1 -[ 1 ] 2 0 2 -2 differences found -position difference ------------------------------------------------------------- -[ 0 ] 1 0 1 -[ 1 ] 2 0 2 -2 differences found -position difference ------------------------------------------------------------- -[ 0 ] 1 0 1 -[ 1 ] 2 0 2 -2 differences found -position difference ------------------------------------------------------------- -[ 0 ] 1 0 1 -[ 1 ] 2 0 2 -2 differences found -position difference ------------------------------------------------------------- -[ 0 ] 1 0 1 -[ 1 ] 2 0 2 -2 differences found -position difference ------------------------------------------------------------- -[ 0 ] 1 0 1 -[ 1 ] 2 0 2 -2 differences found -position difference ------------------------------------------------------------- -[ 0 ] 1 0 1 -[ 1 ] 2 0 2 -2 differences found -position difference ------------------------------------------------------------- -[ 0 ] 1 0 1 -[ 1 ] 2 0 2 -2 differences found -position difference ------------------------------------------------------------- -[ 0 ] 1 0 1 -[ 1 ] 2 0 2 -2 differences found -position difference ------------------------------------------------------------- -[ 0 ] 1 0 1 -[ 1 ] 2 0 2 -2 differences found -position difference ------------------------------------------------------------- -[ 0 ] 1 0 1 -[ 1 ] 2 0 2 -2 differences found -position difference ------------------------------------------------------------- -[ 0 ] 1 0 1 -[ 1 ] 2 0 2 -2 differences found -position difference ------------------------------------------------------------- -[ 0 ] 1 0 1 -[ 1 ] 2 0 2 -2 differences found -position difference ------------------------------------------------------------- -[ 0 ] 1 0 1 -[ 1 ] 2 0 2 -2 differences found -position difference ------------------------------------------------------------- -[ 0 ] 1 0 1 -[ 1 ] 2 0 2 -2 differences found -48 differences found -Dataset: and -position string string difference ------------------------------------------------------------- -[ 0 ] a z -[ 0 ] b z -[ 1 ] d z -[ 1 ] e z -4 differences found -Dataset: and -position string2D string2D difference ------------------------------------------------------------- -[ 0 0 ] a z -[ 0 0 ] b z -[ 0 1 ] c z -[ 0 1 ] d z -[ 1 0 ] e z -[ 1 0 ] f z -[ 1 1 ] g z -[ 1 1 ] h z -[ 2 0 ] i z -[ 2 0 ] j z -[ 2 1 ] k z -[ 2 1 ] l z -12 differences found -Dataset: and -position string3D string3D difference ------------------------------------------------------------- -[ 0 0 0 ] a z -[ 0 0 0 ] b z -[ 0 0 1 ] c z -[ 0 0 1 ] d z -[ 0 1 0 ] e z -[ 0 1 0 ] f z -[ 0 1 1 ] g z -[ 0 1 1 ] h z -[ 0 2 0 ] i z -[ 0 2 0 ] j z -[ 0 2 1 ] k z -[ 0 2 1 ] l z -[ 1 0 0 ] m z -[ 1 0 0 ] n z -[ 1 0 1 ] p z -[ 1 0 1 ] q z -[ 1 1 0 ] r z -[ 1 1 0 ] s z -[ 1 1 1 ] t z -[ 1 1 1 ] u z -[ 1 2 0 ] v z -[ 1 2 0 ] w z -[ 1 2 1 ] x z -[ 2 0 0 ] A z -[ 2 0 0 ] B z -[ 2 0 1 ] C z -[ 2 0 1 ] D z -[ 2 1 0 ] E z -[ 2 1 0 ] F z -[ 2 1 1 ] G z -[ 2 1 1 ] H z -[ 2 2 0 ] I z -[ 2 2 0 ] J z -[ 2 2 1 ] K z -[ 2 2 1 ] L z -[ 3 0 0 ] M z -[ 3 0 0 ] N z -[ 3 0 1 ] P z -[ 3 0 1 ] Q z -[ 3 1 0 ] R z -[ 3 1 0 ] S z -[ 3 1 1 ] T z -[ 3 1 1 ] U z -[ 3 2 0 ] V z -[ 3 2 0 ] W z -[ 3 2 1 ] X z -[ 3 2 1 ] Z z -47 differences found -Dataset: and -position vlen vlen difference ------------------------------------------------------------- -[ 0 ] 1 0 1 -[ 1 ] 2 0 2 -[ 1 ] 3 0 3 -3 differences found -Dataset: and -position vlen2D vlen2D difference ------------------------------------------------------------- -[ 0 1 ] 1 0 1 -[ 1 0 ] 2 0 2 -[ 1 0 ] 3 0 3 -[ 1 1 ] 4 0 4 -[ 1 1 ] 5 0 5 -[ 2 0 ] 6 0 6 -[ 2 0 ] 7 0 7 -[ 2 0 ] 8 0 8 -[ 2 1 ] 9 0 9 -[ 2 1 ] 10 0 10 -[ 2 1 ] 11 0 11 -11 differences found -Dataset: and -position vlen3D vlen3D difference ------------------------------------------------------------- -[ 0 0 1 ] 1 0 1 -[ 0 1 0 ] 2 0 2 -[ 0 1 1 ] 3 0 3 -[ 0 2 0 ] 4 0 4 -[ 0 2 1 ] 5 0 5 -[ 1 0 0 ] 6 0 6 -[ 1 0 0 ] 7 0 7 -[ 1 0 1 ] 8 0 8 -[ 1 0 1 ] 9 0 9 -[ 1 1 0 ] 10 0 10 -[ 1 1 0 ] 11 0 11 -[ 1 1 1 ] 12 0 12 -[ 1 1 1 ] 13 0 13 -[ 1 2 0 ] 14 0 14 -[ 1 2 0 ] 15 0 15 -[ 1 2 1 ] 16 0 16 -[ 1 2 1 ] 17 0 17 -[ 2 0 0 ] 18 0 18 -[ 2 0 0 ] 19 0 19 -[ 2 0 0 ] 20 0 20 -[ 2 0 1 ] 21 0 21 -[ 2 0 1 ] 22 0 22 -[ 2 0 1 ] 23 0 23 -[ 2 1 0 ] 24 0 24 -[ 2 1 0 ] 25 0 25 -[ 2 1 0 ] 26 0 26 -[ 2 1 1 ] 27 0 27 -[ 2 1 1 ] 28 0 28 -[ 2 1 1 ] 29 0 29 -[ 2 2 0 ] 30 0 30 -[ 2 2 0 ] 31 0 31 -[ 2 2 0 ] 32 0 32 -[ 2 2 1 ] 33 0 33 -[ 2 2 1 ] 34 0 34 -[ 2 2 1 ] 35 0 35 -[ 3 0 0 ] 36 0 36 -[ 3 0 0 ] 37 0 37 -[ 3 0 0 ] 38 0 38 -[ 3 0 0 ] 39 0 39 -[ 3 0 1 ] 40 0 40 -[ 3 0 1 ] 41 0 41 -[ 3 0 1 ] 42 0 42 -[ 3 0 1 ] 43 0 43 -[ 3 1 0 ] 44 0 44 -[ 3 1 0 ] 45 0 45 -[ 3 1 0 ] 46 0 46 -[ 3 1 0 ] 47 0 47 -[ 3 1 1 ] 48 0 48 -[ 3 1 1 ] 49 0 49 -[ 3 1 1 ] 50 0 50 -[ 3 1 1 ] 51 0 51 -[ 3 2 0 ] 52 0 52 -[ 3 2 0 ] 53 0 53 -[ 3 2 0 ] 54 0 54 -[ 3 2 0 ] 55 0 55 -[ 3 2 1 ] 56 0 56 -[ 3 2 1 ] 57 0 57 -[ 3 2 1 ] 58 0 58 -[ 3 2 1 ] 59 0 59 -59 differences found -Dataset: and -type null_dset null_dset difference - H5T_IEEE_F64LE H5T_STD_I32LE -1 differences found -Group: and - diff --git a/tools/testfiles/test1.h5 b/tools/testfiles/test1.h5 index fcf276d..9b7f3f3 100644 Binary files a/tools/testfiles/test1.h5 and b/tools/testfiles/test1.h5 differ diff --git a/tools/testfiles/test3.h5 b/tools/testfiles/test3.h5 index 2ab5c25..f2e9a2c 100644 Binary files a/tools/testfiles/test3.h5 and b/tools/testfiles/test3.h5 differ diff --git a/tools/testfiles/test4.h5 b/tools/testfiles/test4.h5 index 223858d..1931f23 100644 Binary files a/tools/testfiles/test4.h5 and b/tools/testfiles/test4.h5 differ diff --git a/tools/testfiles/test_all.h5 b/tools/testfiles/test_all.h5 index 5a9d7fd..a3a1398 100644 Binary files a/tools/testfiles/test_all.h5 and b/tools/testfiles/test_all.h5 differ diff --git a/tools/testfiles/test_deflate.h5 b/tools/testfiles/test_deflate.h5 index 840aee0..368d622 100644 Binary files a/tools/testfiles/test_deflate.h5 and b/tools/testfiles/test_deflate.h5 differ diff --git a/tools/testfiles/test_fletcher32.h5 b/tools/testfiles/test_fletcher32.h5 index 36ca3f5..f21bcbf 100644 Binary files a/tools/testfiles/test_fletcher32.h5 and b/tools/testfiles/test_fletcher32.h5 differ diff --git a/tools/testfiles/test_shuffle.h5 b/tools/testfiles/test_shuffle.h5 index f283612..73c1a9d 100644 Binary files a/tools/testfiles/test_shuffle.h5 and b/tools/testfiles/test_shuffle.h5 differ diff --git a/tools/testfiles/test_szip.h5 b/tools/testfiles/test_szip.h5 index 7d0cb0b..ca2d9aa 100644 Binary files a/tools/testfiles/test_szip.h5 and b/tools/testfiles/test_szip.h5 differ -- cgit v0.12