diff options
author | Pedro Vicente Nunes <pvn@hdfgroup.org> | 2003-10-29 17:46:11 (GMT) |
---|---|---|
committer | Pedro Vicente Nunes <pvn@hdfgroup.org> | 2003-10-29 17:46:11 (GMT) |
commit | 8b45b9a5f0305b6f881f25a8a7649fb67decca0f (patch) | |
tree | a8c73133e1344cc8f8d57a11b80262cc481edd64 /tools/lib | |
parent | d1f7c81a466c0bf041c380abee0f0c21ca30c86f (diff) | |
download | hdf5-8b45b9a5f0305b6f881f25a8a7649fb67decca0f.zip hdf5-8b45b9a5f0305b6f881f25a8a7649fb67decca0f.tar.gz hdf5-8b45b9a5f0305b6f881f25a8a7649fb67decca0f.tar.bz2 |
[svn-r7785] Purpose:
h5repack new features
Description:
added a copy routine for all types
added a copy routine for attributes
commnented some debug messages in h5trav
added the verbose option to some h5diff messages
Platforms tested:
linux
solaris 2.5
IRIX
Misc. update:
Diffstat (limited to 'tools/lib')
-rw-r--r-- | tools/lib/h5diff.c | 34 | ||||
-rw-r--r-- | tools/lib/h5diff.h | 12 | ||||
-rw-r--r-- | tools/lib/h5diff_array.c | 362 | ||||
-rw-r--r-- | tools/lib/h5diff_dset.c | 110 | ||||
-rw-r--r-- | tools/lib/h5trav.c | 4 |
5 files changed, 271 insertions, 251 deletions
diff --git a/tools/lib/h5diff.c b/tools/lib/h5diff.c index 8a013c7..9f20f4a 100644 --- a/tools/lib/h5diff.c +++ b/tools/lib/h5diff.c @@ -39,7 +39,7 @@ int h5diff(const char *fname1, const char *fname2, const char *objname1, const char *objname2, - diff_opt_t options) + diff_opt_t *options) { int nobjects1, nobjects2; trav_info_t *info1=NULL; @@ -148,7 +148,7 @@ int diff_match( hid_t file1_id, hid_t file2_id, int nobjects2, trav_info_t *info2, - diff_opt_t options ) + diff_opt_t *options ) { int more_names_exist = (nobjects1>0 && nobjects2>0) ? 1 : 0; trav_table_t *table=NULL; @@ -223,7 +223,7 @@ int diff_match( hid_t file1_id, *------------------------------------------------------------------------- */ - if (options.verbose) + if (options->verbose) { printf("\n"); printf("file1 file2\n"); @@ -281,7 +281,7 @@ int diff_compare( hid_t file1_id, const char *obj2_name, int nobjects2, trav_info_t *info2, - diff_opt_t options ) + diff_opt_t *options ) { int f1=0, f2=0; @@ -308,7 +308,7 @@ int diff_compare( hid_t file1_id, obj2_name=info2[j].name; /* objects are not the same type */ - if ( info1[i].type != info2[j].type ) + if ( info1[i].type != info2[j].type && options->verbose) { printf("Comparison not supported\n"); printf("<%s> is of type %s and <%s> is of type %s\n", @@ -345,7 +345,7 @@ int diff( hid_t file1_id, const char *obj1_name, hid_t file2_id, const char *obj2_name, - diff_opt_t options, + diff_opt_t *options, int type ) { int nfound=0; @@ -357,14 +357,16 @@ int diff( hid_t file1_id, break; default: - printf("Comparison not supported\n"); - printf("<%s> is of type %s and <%s> is of type %s\n", - obj1_name, get_type(type), - obj2_name, get_type(type) ); + if (options->verbose) { + printf("Comparison not supported\n"); + printf("<%s> is of type %s and <%s> is of type %s\n", + obj1_name, get_type(type), + obj2_name, get_type(type) ); + } break; } - if (options.verbose) + if (options->verbose) printf("\n"); return nfound; } @@ -398,19 +400,19 @@ void diff_list( const char *filename, int nobjects, trav_info_t *info ) switch ( info[i].type ) { case H5G_GROUP: - printf("%s %20s\n", info[i].name, "group" ); + printf(" %-10s %s\n", "group", info[i].name ); break; case H5G_DATASET: - printf("%s %20s\n", info[i].name, "dataset" ); + printf(" %-10s %s\n", "dataset", info[i].name ); break; case H5G_TYPE: - printf("%s %20s\n", info[i].name, "datatype" ); + printf(" %-10s %s\n", "datatype", info[i].name ); break; case H5G_LINK: - printf("%s %20s\n", info[i].name, "link" ); + printf(" %-10s %s\n", "link", info[i].name ); break; default: - printf("%s %20s\n", info[i].name, "User defined object" ); + printf(" %-10s %s\n", "User defined object", info[i].name ); break; } } diff --git a/tools/lib/h5diff.h b/tools/lib/h5diff.h index 3313765..e9230bc 100644 --- a/tools/lib/h5diff.h +++ b/tools/lib/h5diff.h @@ -74,7 +74,7 @@ int h5diff(const char *fname1, const char *fname2, const char *objname1, const char *objname2, - diff_opt_t options); + diff_opt_t *options); #ifdef __cplusplus @@ -93,13 +93,13 @@ int diff_dataset( hid_t file1_id, hid_t file2_id, const char *obj1_name, const char *obj2_name, - diff_opt_t options ); + diff_opt_t *options ); int diff( hid_t file1_id, const char *obj1_name, hid_t file2_id, const char *obj2_name, - diff_opt_t options, + diff_opt_t *options, int type ); int diff_compare( hid_t file1_id, @@ -112,7 +112,7 @@ int diff_compare( hid_t file1_id, const char *obj2_name, int nobjects2, trav_info_t *info2, - diff_opt_t options ); + diff_opt_t *options ); int diff_match( hid_t file1_id, int nobjects1, @@ -120,14 +120,14 @@ int diff_match( hid_t file1_id, hid_t file2_id, int nobjects2, trav_info_t *info2, - diff_opt_t options ); + diff_opt_t *options ); int diff_array( void *buf1, void *buf2, hsize_t tot_cnt, int rank, hsize_t *dims, - diff_opt_t options, + diff_opt_t *options, const char *obj1, const char *obj2, hid_t m_type ); diff --git a/tools/lib/h5diff_array.c b/tools/lib/h5diff_array.c index f9518de..c47a835 100644 --- a/tools/lib/h5diff_array.c +++ b/tools/lib/h5diff_array.c @@ -39,7 +39,7 @@ int diff_array( void *buf1, hsize_t tot_cnt, int rank, hsize_t *dims, - diff_opt_t options, + diff_opt_t *options, const char *obj1, const char *obj2, hid_t m_type ) @@ -91,13 +91,13 @@ int diff_array( void *buf1, memcpy(&temp1_char, _buf1, sizeof(char)); memcpy(&temp2_char, _buf2, sizeof(char)); /* -d and !-p */ - if (options.d && !options.p) + if (options->d && !options->p) { - if (abs(temp1_char-temp2_char) > options.delta) + if (abs(temp1_char-temp2_char) > options->delta) { - if (options.n && nfound>=options.count) + if (options->n && nfound>=options->count) return nfound; - if ( options.r==0 ) + if ( options->r==0 ) { print_pos(&ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -107,13 +107,13 @@ int diff_array( void *buf1, } } /* !-d and -p */ - else if (!options.d && options.p) + else if (!options->d && options->p) { - if ( temp1_char!=0 && abs(1-temp2_char/temp1_char) > options.percent ) + if ( temp1_char!=0 && abs(1-temp2_char/temp1_char) > options->percent ) { - if (options.n && nfound>=options.count) + if (options->n && nfound>=options->count) return nfound; - if ( options.r==0 ) + if ( options->r==0 ) { print_pos(&ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -124,14 +124,14 @@ int diff_array( void *buf1, } } /* -d and -p */ - else if ( options.d && options.p) + else if ( options->d && options->p) { - if ( temp1_char!=0 && abs(1-temp2_char/temp1_char) > options.percent && - abs(temp1_char-temp2_char) > options.delta ) + if ( temp1_char!=0 && abs(1-temp2_char/temp1_char) > options->percent && + abs(temp1_char-temp2_char) > options->delta ) { - if (options.n && nfound>=options.count) + if (options->n && nfound>=options->count) return nfound; - if ( options.r==0 ) + if ( options->r==0 ) { print_pos(&ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -143,9 +143,9 @@ int diff_array( void *buf1, } else if (temp1_char != temp2_char) { - if (options.n && nfound>=options.count) + if (options->n && nfound>=options->count) return nfound; - if ( options.r==0 ) + if ( options->r==0 ) { print_pos(&ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -175,13 +175,13 @@ int diff_array( void *buf1, memcpy(&temp1_uchar, _buf1, sizeof(unsigned char)); memcpy(&temp2_uchar, _buf2, sizeof(unsigned char)); /* -d and !-p */ - if (options.d && !options.p) + if (options->d && !options->p) { - if (abs(temp1_uchar-temp2_uchar) > options.delta) + if (abs(temp1_uchar-temp2_uchar) > options->delta) { - if (options.n && nfound>=options.count) + if (options->n && nfound>=options->count) return nfound; - if ( options.r==0 ) + if ( options->r==0 ) { print_pos(&ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -191,13 +191,13 @@ int diff_array( void *buf1, } } /* !-d and -p */ - else if (!options.d && options.p) + else if (!options->d && options->p) { - if ( temp1_uchar!=0 && abs(1-temp2_uchar/temp1_uchar) > options.percent ) + if ( temp1_uchar!=0 && abs(1-temp2_uchar/temp1_uchar) > options->percent ) { - if (options.n && nfound>=options.count) + if (options->n && nfound>=options->count) return nfound; - if ( options.r==0 ) + if ( options->r==0 ) { print_pos(&ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -208,14 +208,14 @@ int diff_array( void *buf1, } } /* -d and -p */ - else if ( options.d && options.p) + else if ( options->d && options->p) { - if ( temp1_uchar!=0 && abs(1-temp2_uchar/temp1_uchar) > options.percent && - abs(temp1_uchar-temp2_uchar) > options.delta ) + if ( temp1_uchar!=0 && abs(1-temp2_uchar/temp1_uchar) > options->percent && + abs(temp1_uchar-temp2_uchar) > options->delta ) { - if (options.n && nfound>=options.count) + if (options->n && nfound>=options->count) return nfound; - if ( options.r==0 ) + if ( options->r==0 ) { print_pos(&ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -227,9 +227,9 @@ int diff_array( void *buf1, } else if (temp1_uchar != temp2_uchar) { - if (options.n && nfound>=options.count) + if (options->n && nfound>=options->count) return nfound; - if ( options.r==0 ) + if ( options->r==0 ) { print_pos(&ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -260,13 +260,13 @@ int diff_array( void *buf1, memcpy(&temp1_short, _buf1, sizeof(short)); memcpy(&temp2_short, _buf2, sizeof(short)); /* -d and !-p */ - if (options.d && !options.p) + if (options->d && !options->p) { - if (abs(temp1_short-temp2_short) > options.delta) + if (abs(temp1_short-temp2_short) > options->delta) { - if (options.n && nfound>=options.count) + if (options->n && nfound>=options->count) return nfound; - if ( options.r==0 ) + if ( options->r==0 ) { print_pos(&ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -276,13 +276,13 @@ int diff_array( void *buf1, } } /* !-d and -p */ - else if (!options.d && options.p) + else if (!options->d && options->p) { - if ( temp1_short!=0 && abs(1-temp2_short/temp1_short) > options.percent ) + if ( temp1_short!=0 && abs(1-temp2_short/temp1_short) > options->percent ) { - if (options.n && nfound>=options.count) + if (options->n && nfound>=options->count) return nfound; - if ( options.r==0 ) + if ( options->r==0 ) { print_pos(&ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -293,14 +293,14 @@ int diff_array( void *buf1, } } /* -d and -p */ - else if ( options.d && options.p) + else if ( options->d && options->p) { - if ( temp1_short!=0 && abs(1-temp2_short/temp1_short) > options.percent && - abs(temp1_short-temp2_short) > options.delta ) + if ( temp1_short!=0 && abs(1-temp2_short/temp1_short) > options->percent && + abs(temp1_short-temp2_short) > options->delta ) { - if (options.n && nfound>=options.count) + if (options->n && nfound>=options->count) return nfound; - if ( options.r==0 ) + if ( options->r==0 ) { print_pos(&ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -312,9 +312,9 @@ int diff_array( void *buf1, } else if (temp1_short != temp2_short) { - if (options.n && nfound>=options.count) + if (options->n && nfound>=options->count) return nfound; - if ( options.r==0 ) + if ( options->r==0 ) { print_pos(&ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -344,13 +344,13 @@ int diff_array( void *buf1, memcpy(&temp1_ushort, _buf1, sizeof(unsigned short)); memcpy(&temp2_ushort, _buf2, sizeof(unsigned short)); /* -d and !-p */ - if (options.d && !options.p) + if (options->d && !options->p) { - if (abs(temp1_ushort-temp2_ushort) > options.delta) + if (abs(temp1_ushort-temp2_ushort) > options->delta) { - if (options.n && nfound>=options.count) + if (options->n && nfound>=options->count) return nfound; - if ( options.r==0 ) + if ( options->r==0 ) { print_pos(&ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -360,13 +360,13 @@ int diff_array( void *buf1, } } /* !-d and -p */ - else if (!options.d && options.p) + else if (!options->d && options->p) { - if ( temp1_ushort!=0 && abs(1-temp2_ushort/temp1_ushort) > options.percent ) + if ( temp1_ushort!=0 && abs(1-temp2_ushort/temp1_ushort) > options->percent ) { - if (options.n && nfound>=options.count) + if (options->n && nfound>=options->count) return nfound; - if ( options.r==0 ) + if ( options->r==0 ) { print_pos(&ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -377,14 +377,14 @@ int diff_array( void *buf1, } } /* -d and -p */ - else if ( options.d && options.p) + else if ( options->d && options->p) { - if ( temp1_ushort!=0 && abs(1-temp2_ushort/temp1_ushort) > options.percent && - abs(temp1_ushort-temp2_ushort) > options.delta ) + if ( temp1_ushort!=0 && abs(1-temp2_ushort/temp1_ushort) > options->percent && + abs(temp1_ushort-temp2_ushort) > options->delta ) { - if (options.n && nfound>=options.count) + if (options->n && nfound>=options->count) return nfound; - if ( options.r==0 ) + if ( options->r==0 ) { print_pos(&ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -396,9 +396,9 @@ int diff_array( void *buf1, } else if (temp1_ushort != temp2_ushort) { - if (options.n && nfound>=options.count) + if (options->n && nfound>=options->count) return nfound; - if ( options.r==0 ) + if ( options->r==0 ) { print_pos(&ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -429,13 +429,13 @@ int diff_array( void *buf1, memcpy(&temp1_int, _buf1, sizeof(int)); memcpy(&temp2_int, _buf2, sizeof(int)); /* -d and !-p */ - if (options.d && !options.p) + if (options->d && !options->p) { - if (abs(temp1_int-temp2_int) > options.delta) + if (abs(temp1_int-temp2_int) > options->delta) { - if (options.n && nfound>=options.count) + if (options->n && nfound>=options->count) return nfound; - if ( options.r==0 ) + if ( options->r==0 ) { print_pos(&ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -445,13 +445,13 @@ int diff_array( void *buf1, } } /* !-d and -p */ - else if (!options.d && options.p) + else if (!options->d && options->p) { - if ( temp1_int!=0 && abs(1-temp2_int/temp1_int) > options.percent ) + if ( temp1_int!=0 && abs(1-temp2_int/temp1_int) > options->percent ) { - if (options.n && nfound>=options.count) + if (options->n && nfound>=options->count) return nfound; - if ( options.r==0 ) + if ( options->r==0 ) { print_pos(&ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -462,14 +462,14 @@ int diff_array( void *buf1, } } /* -d and -p */ - else if ( options.d && options.p) + else if ( options->d && options->p) { - if ( temp1_int!=0 && abs(1-temp2_int/temp1_int) > options.percent && - abs(temp1_int-temp2_int) > options.delta ) + if ( temp1_int!=0 && abs(1-temp2_int/temp1_int) > options->percent && + abs(temp1_int-temp2_int) > options->delta ) { - if (options.n && nfound>=options.count) + if (options->n && nfound>=options->count) return nfound; - if ( options.r==0 ) + if ( options->r==0 ) { print_pos(&ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -481,9 +481,9 @@ int diff_array( void *buf1, } else if (temp1_int != temp2_int) { - if (options.n && nfound>=options.count) + if (options->n && nfound>=options->count) return nfound; - if ( options.r==0 ) + if ( options->r==0 ) { print_pos(&ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -514,13 +514,13 @@ int diff_array( void *buf1, memcpy(&temp1_uint, _buf1, sizeof(unsigned int)); memcpy(&temp2_uint, _buf2, sizeof(unsigned int)); /* -d and !-p */ - if (options.d && !options.p) + if (options->d && !options->p) { - if (abs((int)(temp1_uint-temp2_uint)) > options.delta) + if (abs((int)(temp1_uint-temp2_uint)) > options->delta) { - if (options.n && nfound>=options.count) + if (options->n && nfound>=options->count) return nfound; - if ( options.r==0 ) + if ( options->r==0 ) { print_pos(&ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -530,13 +530,13 @@ int diff_array( void *buf1, } } /* !-d and -p */ - else if (!options.d && options.p) + else if (!options->d && options->p) { - if ( temp1_uint!=0 && abs((int)(1-temp2_uint/temp1_uint)) > options.percent ) + if ( temp1_uint!=0 && abs((int)(1-temp2_uint/temp1_uint)) > options->percent ) { - if (options.n && nfound>=options.count) + if (options->n && nfound>=options->count) return nfound; - if ( options.r==0 ) + if ( options->r==0 ) { print_pos(&ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -547,14 +547,14 @@ int diff_array( void *buf1, } } /* -d and -p */ - else if ( options.d && options.p) + else if ( options->d && options->p) { - if ( temp1_uint!=0 && abs((int)(1-temp2_uint/temp1_uint)) > options.percent && - abs((int)(temp1_uint-temp2_uint)) > options.delta ) + if ( temp1_uint!=0 && abs((int)(1-temp2_uint/temp1_uint)) > options->percent && + abs((int)(temp1_uint-temp2_uint)) > options->delta ) { - if (options.n && nfound>=options.count) + if (options->n && nfound>=options->count) return nfound; - if ( options.r==0 ) + if ( options->r==0 ) { print_pos(&ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -566,9 +566,9 @@ int diff_array( void *buf1, } else if (temp1_uint != temp2_uint) { - if (options.n && nfound>=options.count) + if (options->n && nfound>=options->count) return nfound; - if ( options.r==0 ) + if ( options->r==0 ) { print_pos(&ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -599,13 +599,13 @@ int diff_array( void *buf1, memcpy(&temp1_long, _buf1, sizeof(long)); memcpy(&temp2_long, _buf2, sizeof(long)); /* -d and !-p */ - if (options.d && !options.p) + if (options->d && !options->p) { - if (labs(temp1_long-temp2_long) > (long)options.delta) + if (labs(temp1_long-temp2_long) > (long)options->delta) { - if (options.n && nfound>=options.count) + if (options->n && nfound>=options->count) return nfound; - if ( options.r==0 ) + if ( options->r==0 ) { print_pos(&ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -615,13 +615,13 @@ int diff_array( void *buf1, } } /* !-d and -p */ - else if (!options.d && options.p) + else if (!options->d && options->p) { - if ( temp1_long!=0 && labs(1-temp2_long/temp1_long) > (long)options.percent ) + if ( temp1_long!=0 && labs(1-temp2_long/temp1_long) > (long)options->percent ) { - if (options.n && nfound>=options.count) + if (options->n && nfound>=options->count) return nfound; - if ( options.r==0 ) + if ( options->r==0 ) { print_pos(&ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -632,14 +632,14 @@ int diff_array( void *buf1, } } /* -d and -p */ - else if ( options.d && options.p) + else if ( options->d && options->p) { - if ( temp1_long!=0 && labs(1-temp2_long/temp1_long) > (long)options.percent && - labs(temp1_long-temp2_long) > (long)options.delta ) + if ( temp1_long!=0 && labs(1-temp2_long/temp1_long) > (long)options->percent && + labs(temp1_long-temp2_long) > (long)options->delta ) { - if (options.n && nfound>=options.count) + if (options->n && nfound>=options->count) return nfound; - if ( options.r==0 ) + if ( options->r==0 ) { print_pos(&ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -651,9 +651,9 @@ int diff_array( void *buf1, } else if (temp1_long != temp2_long) { - if (options.n && nfound>=options.count) + if (options->n && nfound>=options->count) return nfound; - if ( options.r==0 ) + if ( options->r==0 ) { print_pos(&ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -683,13 +683,13 @@ int diff_array( void *buf1, memcpy(&temp1_ulong, _buf1, sizeof(unsigned long)); memcpy(&temp2_ulong, _buf2, sizeof(unsigned long)); /* -d and !-p */ - if (options.d && !options.p) + if (options->d && !options->p) { - if (labs((long)(temp1_ulong-temp2_ulong)) > (long)options.delta) + if (labs((long)(temp1_ulong-temp2_ulong)) > (long)options->delta) { - if (options.n && nfound>=options.count) + if (options->n && nfound>=options->count) return nfound; - if ( options.r==0 ) + if ( options->r==0 ) { print_pos(&ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -699,13 +699,13 @@ int diff_array( void *buf1, } } /* !-d and -p */ - else if (!options.d && options.p) + else if (!options->d && options->p) { - if ( temp1_ulong!=0 && labs((long)(1-temp2_ulong/temp1_ulong)) > (long)options.percent ) + if ( temp1_ulong!=0 && labs((long)(1-temp2_ulong/temp1_ulong)) > (long)options->percent ) { - if (options.n && nfound>=options.count) + if (options->n && nfound>=options->count) return nfound; - if ( options.r==0 ) + if ( options->r==0 ) { print_pos(&ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -716,14 +716,14 @@ int diff_array( void *buf1, } } /* -d and -p */ - else if ( options.d && options.p) + else if ( options->d && options->p) { - if ( temp1_ulong!=0 && labs((long)(1-temp2_ulong/temp1_ulong)) > (long)options.percent && - labs((long)(temp1_ulong-temp2_ulong)) > (long)options.delta ) + if ( temp1_ulong!=0 && labs((long)(1-temp2_ulong/temp1_ulong)) > (long)options->percent && + labs((long)(temp1_ulong-temp2_ulong)) > (long)options->delta ) { - if (options.n && nfound>=options.count) + if (options->n && nfound>=options->count) return nfound; - if ( options.r==0 ) + if ( options->r==0 ) { print_pos(&ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -735,9 +735,9 @@ int diff_array( void *buf1, } else if (temp1_ulong != temp2_ulong) { - if (options.n && nfound>=options.count) + if (options->n && nfound>=options->count) return nfound; - if ( options.r==0 ) + if ( options->r==0 ) { print_pos(&ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -767,13 +767,13 @@ int diff_array( void *buf1, memcpy(&temp1_llong, _buf1, sizeof(long_long)); memcpy(&temp2_llong, _buf2, sizeof(long_long)); /* -d and !-p */ - if (options.d && !options.p) + if (options->d && !options->p) { - if (labs((long)(temp1_llong-temp2_llong)) > (long)options.delta) + if (labs((long)(temp1_llong-temp2_llong)) > (long)options->delta) { - if (options.n && nfound>=options.count) + if (options->n && nfound>=options->count) return nfound; - if ( options.r==0 ) + if ( options->r==0 ) { print_pos(&ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -783,13 +783,13 @@ int diff_array( void *buf1, } } /* !-d and -p */ - else if (!options.d && options.p) + else if (!options->d && options->p) { - if ( temp1_llong!=0 && labs((long)(1-temp2_llong/temp1_llong)) > (long)options.percent ) + if ( temp1_llong!=0 && labs((long)(1-temp2_llong/temp1_llong)) > (long)options->percent ) { - if (options.n && nfound>=options.count) + if (options->n && nfound>=options->count) return nfound; - if ( options.r==0 ) + if ( options->r==0 ) { print_pos(&ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -800,14 +800,14 @@ int diff_array( void *buf1, } } /* -d and -p */ - else if ( options.d && options.p) + else if ( options->d && options->p) { - if ( temp1_llong!=0 && labs((long)(1-temp2_llong/temp1_llong)) > (long)options.percent && - labs((long)(temp1_llong-temp2_llong)) > (long)options.delta ) + if ( temp1_llong!=0 && labs((long)(1-temp2_llong/temp1_llong)) > (long)options->percent && + labs((long)(temp1_llong-temp2_llong)) > (long)options->delta ) { - if (options.n && nfound>=options.count) + if (options->n && nfound>=options->count) return nfound; - if ( options.r==0 ) + if ( options->r==0 ) { print_pos(&ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -819,9 +819,9 @@ int diff_array( void *buf1, } else if (temp1_llong != temp2_llong) { - if (options.n && nfound>=options.count) + if (options->n && nfound>=options->count) return nfound; - if ( options.r==0 ) + if ( options->r==0 ) { print_pos(&ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -851,13 +851,13 @@ int diff_array( void *buf1, memcpy(&temp1_ullong, _buf1, sizeof(unsigned long_long)); memcpy(&temp2_ullong, _buf2, sizeof(unsigned long_long)); /* -d and !-p */ - if (options.d && !options.p) + if (options->d && !options->p) { - if (labs((long)(temp1_ullong-temp2_ullong)) > (long)options.delta) + if (labs((long)(temp1_ullong-temp2_ullong)) > (long)options->delta) { - if (options.n && nfound>=options.count) + if (options->n && nfound>=options->count) return nfound; - if ( options.r==0 ) + if ( options->r==0 ) { print_pos(&ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -868,13 +868,13 @@ int diff_array( void *buf1, } } /* !-d and -p */ - else if (!options.d && options.p) + else if (!options->d && options->p) { - if ( temp1_ullong!=0 && labs((long)(1-temp2_ullong/temp1_ullong)) > (long)options.percent ) + if ( temp1_ullong!=0 && labs((long)(1-temp2_ullong/temp1_ullong)) > (long)options->percent ) { - if (options.n && nfound>=options.count) + if (options->n && nfound>=options->count) return nfound; - if ( options.r==0 ) + if ( options->r==0 ) { print_pos(&ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -886,14 +886,14 @@ int diff_array( void *buf1, } } /* -d and -p */ - else if ( options.d && options.p) + else if ( options->d && options->p) { - if ( temp1_ullong!=0 && labs((long)(1-temp2_ullong/temp1_ullong)) > (long)options.percent && - labs((long)(temp1_ullong-temp2_ullong)) > (long)options.delta ) + if ( temp1_ullong!=0 && labs((long)(1-temp2_ullong/temp1_ullong)) > (long)options->percent && + labs((long)(temp1_ullong-temp2_ullong)) > (long)options->delta ) { - if (options.n && nfound>=options.count) + if (options->n && nfound>=options->count) return nfound; - if ( options.r==0 ) + if ( options->r==0 ) { print_pos(&ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -906,9 +906,9 @@ int diff_array( void *buf1, } else if (temp1_ullong != temp2_ullong) { - if (options.n && nfound>=options.count) + if (options->n && nfound>=options->count) return nfound; - if ( options.r==0 ) + if ( options->r==0 ) { print_pos(&ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -939,13 +939,13 @@ int diff_array( void *buf1, memcpy(&temp1_float, _buf1, sizeof(float)); memcpy(&temp2_float, _buf2, sizeof(float)); /* -d and !-p */ - if (options.d && !options.p) + if (options->d && !options->p) { - if (fabs(temp1_float-temp2_float) > options.delta) + if (fabs(temp1_float-temp2_float) > options->delta) { - if (options.n && nfound>=options.count) + if (options->n && nfound>=options->count) return nfound; - if ( options.r==0 ) + if ( options->r==0 ) { print_pos(&ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -955,13 +955,13 @@ int diff_array( void *buf1, } } /* !-d and -p */ - else if (!options.d && options.p) + else if (!options->d && options->p) { - if ( temp1_float!=0 && fabs(1-temp2_float/temp1_float) > options.percent ) + if ( temp1_float!=0 && fabs(1-temp2_float/temp1_float) > options->percent ) { - if (options.n && nfound>=options.count) + if (options->n && nfound>=options->count) return nfound; - if ( options.r==0 ) + if ( options->r==0 ) { print_pos(&ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -972,14 +972,14 @@ int diff_array( void *buf1, } } /* -d and -p */ - else if ( options.d && options.p) + else if ( options->d && options->p) { - if ( temp1_float!=0 && fabs(1-temp2_float/temp1_float) > options.percent && - fabs(temp1_float-temp2_float) > options.delta ) + if ( temp1_float!=0 && fabs(1-temp2_float/temp1_float) > options->percent && + fabs(temp1_float-temp2_float) > options->delta ) { - if (options.n && nfound>=options.count) + if (options->n && nfound>=options->count) return nfound; - if ( options.r==0 ) + if ( options->r==0 ) { print_pos(&ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -991,9 +991,9 @@ int diff_array( void *buf1, } else if (temp1_float != temp2_float) { - if (options.n && nfound>=options.count) + if (options->n && nfound>=options->count) return nfound; - if ( options.r==0 ) + if ( options->r==0 ) { print_pos(&ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -1023,13 +1023,13 @@ int diff_array( void *buf1, memcpy(&temp1_double, _buf1, sizeof(double)); memcpy(&temp2_double, _buf2, sizeof(double)); /* -d and !-p */ - if (options.d && !options.p) + if (options->d && !options->p) { - if (fabs(temp1_double-temp2_double) > options.delta) + if (fabs(temp1_double-temp2_double) > options->delta) { - if (options.n && nfound>=options.count) + if (options->n && nfound>=options->count) return nfound; - if ( options.r==0 ) + if ( options->r==0 ) { print_pos(&ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -1039,13 +1039,13 @@ int diff_array( void *buf1, } } /* !-d and -p */ - else if (!options.d && options.p) + else if (!options->d && options->p) { - if ( temp1_double!=0 && fabs(1-temp2_double/temp1_double) > options.percent ) + if ( temp1_double!=0 && fabs(1-temp2_double/temp1_double) > options->percent ) { - if (options.n && nfound>=options.count) + if (options->n && nfound>=options->count) return nfound; - if ( options.r==0 ) + if ( options->r==0 ) { print_pos(&ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -1056,14 +1056,14 @@ int diff_array( void *buf1, } } /* -d and -p */ - else if ( options.d && options.p) + else if ( options->d && options->p) { - if ( temp1_double!=0 && fabs(1-temp2_double/temp1_double) > options.percent && - fabs(temp1_double-temp2_double) > options.delta ) + if ( temp1_double!=0 && fabs(1-temp2_double/temp1_double) > options->percent && + fabs(temp1_double-temp2_double) > options->delta ) { - if (options.n && nfound>=options.count) + if (options->n && nfound>=options->count) return nfound; - if ( options.r==0 ) + if ( options->r==0 ) { print_pos(&ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -1075,9 +1075,9 @@ int diff_array( void *buf1, } else if (temp1_double != temp2_double) { - if (options.n && nfound>=options.count) + if (options->n && nfound>=options->count) return nfound; - if ( options.r==0 ) + if ( options->r==0 ) { print_pos(&ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); diff --git a/tools/lib/h5diff_dset.c b/tools/lib/h5diff_dset.c index 15a8769..f668297 100644 --- a/tools/lib/h5diff_dset.c +++ b/tools/lib/h5diff_dset.c @@ -40,7 +40,7 @@ int diff_dataset( hid_t file1_id, hid_t file2_id, const char *obj1_name, const char *obj2_name, - diff_opt_t options ) + diff_opt_t *options ) { hid_t dset1_id =-1; hid_t dset2_id =-1; @@ -139,10 +139,12 @@ int diff_dataset( hid_t file1_id, if ( tclass1 != tclass2 ) { - printf("Comparison not supported\n"); - printf("<%s> is of class %s and <%s> is of class %s\n", - obj1_name, get_class(tclass1), - obj2_name, get_class(tclass2) ); + if (options->verbose) { + printf("Comparison not supported\n"); + printf("<%s> is of class %s and <%s> is of class %s\n", + obj1_name, get_class(tclass1), + obj2_name, get_class(tclass2) ); + } goto out; } @@ -163,10 +165,12 @@ int diff_dataset( hid_t file1_id, case H5T_ENUM: case H5T_VLEN: case H5T_ARRAY: - printf("Comparison not supported\n"); - printf("<%s> is of class %s and <%s> is of class %s\n", - obj1_name, get_class(tclass1), - obj2_name, get_class(tclass2) ); + if (options->verbose ) { + printf("Comparison not supported\n"); + printf("<%s> is of class %s and <%s> is of class %s\n", + obj1_name, get_class(tclass1), + obj2_name, get_class(tclass2) ); + } goto out; default: break; @@ -179,16 +183,18 @@ int diff_dataset( hid_t file1_id, if ( rank1 != rank2 ) { - printf("Comparison not supported\n"); - printf("<%s> has rank %d, dimensions ", obj1_name, rank1); - print_dims(rank1,dims1); - printf(", max dimensions "); - print_dims(rank1,maxdim1); - printf("\n" ); - printf("<%s> has rank %d, dimensions ", obj2_name, rank2); - print_dims(rank2,dims2); - printf(", max dimensions "); - print_dims(rank2,maxdim2); + if (options->verbose) { + printf("Comparison not supported\n"); + printf("<%s> has rank %d, dimensions ", obj1_name, rank1); + print_dims(rank1,dims1); + printf(", max dimensions "); + print_dims(rank1,maxdim1); + printf("\n" ); + printf("<%s> has rank %d, dimensions ", obj2_name, rank2); + print_dims(rank2,dims2); + printf(", max dimensions "); + print_dims(rank2,maxdim2); + } goto out; } @@ -213,16 +219,18 @@ int diff_dataset( hid_t file1_id, if (dim_diff==1) { - printf("Comparison not supported\n"); - printf("<%s> has rank %d, dimensions ", obj1_name, rank1); - print_dims(rank1,dims1); - printf(", max dimensions "); - print_dims(rank1,maxdim1); - printf("\n" ); - printf("<%s> has rank %d, dimensions ", obj2_name, rank2); - print_dims(rank2,dims2); - printf(", max dimensions "); - print_dims(rank2,maxdim2); + if (options->verbose) { + printf("Comparison not supported\n"); + printf("<%s> has rank %d, dimensions ", obj1_name, rank1); + print_dims(rank1,dims1); + printf(", max dimensions "); + print_dims(rank1,maxdim1); + printf("\n" ); + printf("<%s> has rank %d, dimensions ", obj2_name, rank2); + print_dims(rank2,dims2); + printf(", max dimensions "); + print_dims(rank2,maxdim2); + } goto out; } @@ -232,13 +240,15 @@ int diff_dataset( hid_t file1_id, */ if (maxdim_diff==1) { - printf( "Warning: Different maximum dimensions\n"); - printf("<%s> has max dimensions ", obj1_name); - print_dims(rank1,maxdim1); - printf("\n"); - printf("<%s> has max dimensions ", obj2_name); - print_dims(rank2,maxdim2); - printf("\n"); + if (options->verbose) { + printf( "Warning: Different maximum dimensions\n"); + printf("<%s> has max dimensions ", obj1_name); + print_dims(rank1,maxdim1); + printf("\n"); + printf("<%s> has max dimensions ", obj2_name); + print_dims(rank2,maxdim2); + printf("\n"); + } } /*------------------------------------------------------------------------- @@ -265,7 +275,7 @@ int diff_dataset( hid_t file1_id, *------------------------------------------------------------------------- */ - if ( (H5Tequal(f_type1, f_type2)==0) ) + if ( (H5Tequal(f_type1, f_type2)==0) && options->verbose) { printf("Warning: Different storage datatype\n"); printf("<%s> has file datatype ", obj1_name); @@ -298,13 +308,15 @@ int diff_dataset( hid_t file1_id, can1=diff_can(m_type1); can2=diff_can(m_type2); - if ( can1==0 || can2==0 ) + if ( (can1==0 || can2==0)) { - printf("Comparison not supported\n"); - if ( can1==0 ) - printf("<%s> type is not supported\n", obj1_name); - if ( can2==0 ) - printf("<%s> type is not supported\n", obj2_name); + if (options->verbose) { + printf("Comparison not supported\n"); + if ( can1==0 ) + printf("<%s> type is not supported\n", obj1_name); + if ( can2==0 ) + printf("<%s> type is not supported\n", obj2_name); + } goto out; } @@ -317,9 +329,11 @@ int diff_dataset( hid_t file1_id, sign2=H5Tget_sign(m_type2); if ( sign1 != sign2 ) { - printf("Comparison not supported\n"); - printf("<%s> has sign %s\n", obj1_name, get_sign(sign1)); - printf("<%s> has sign %s", obj2_name, get_sign(sign2)); + if (options->verbose) { + printf("Comparison not supported\n"); + printf("<%s> has sign %s\n", obj1_name, get_sign(sign1)); + printf("<%s> has sign %s", obj2_name, get_sign(sign2)); + } goto out; } @@ -374,12 +388,12 @@ int diff_dataset( hid_t file1_id, * array compare *------------------------------------------------------------------------- */ - if (options.verbose) + if (options->verbose) printf( "Comparing <%s> with <%s>\n", obj1_name, obj2_name ); name1=diff_basename(obj1_name); name2=diff_basename(obj2_name); nfound = diff_array(buf1,buf2,tot_cnt1,rank1,dims1,options,name1,name2,m_type1); - if (options.verbose) + if (options->verbose) printf("%d differences found\n", nfound ); /*------------------------------------------------------------------------- diff --git a/tools/lib/h5trav.c b/tools/lib/h5trav.c index 09c2033..ba74b6c 100644 --- a/tools/lib/h5trav.c +++ b/tools/lib/h5trav.c @@ -360,7 +360,9 @@ int traverse( hid_t loc_id, } else { +#if defined (H5_TRAV_DEBUG) printf("%s %s\n", "HARDLINK", table->objs[j].objname); +#endif } } @@ -397,7 +399,9 @@ int traverse( hid_t loc_id, } else { +#if defined (H5_TRAV_DEBUG) printf("%s %s\n", "HARDLINK", table->objs[j].objname); +#endif } } |