2003-10-23 05:56:21 +08:00
|
|
|
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
2007-02-07 22:56:24 +08:00
|
|
|
* Copyright by The HDF Group. *
|
2003-10-23 05:56:21 +08:00
|
|
|
* Copyright by the Board of Trustees of the University of Illinois. *
|
|
|
|
* All rights reserved. *
|
|
|
|
* *
|
|
|
|
* This file is part of HDF5. The full HDF5 copyright notice, including *
|
|
|
|
* terms governing use, modification, and redistribution, is contained in *
|
|
|
|
* the files COPYING and Copyright.html. COPYING can be found at the root *
|
|
|
|
* of the source code distribution tree; Copyright.html can be found at the *
|
|
|
|
* root level of an installed copy of the electronic HDF5 document set and *
|
|
|
|
* is linked from the top-level documents page. It can also be found at *
|
2007-02-07 22:56:24 +08:00
|
|
|
* http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have *
|
|
|
|
* access to either file, you may request a copy from help@hdfgroup.org. *
|
2003-10-23 05:56:21 +08:00
|
|
|
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
|
|
|
|
|
|
|
#ifndef H5DIFF_H__
|
|
|
|
#define H5DIFF_H__
|
|
|
|
|
|
|
|
#include "hdf5.h"
|
|
|
|
#include "h5trav.h"
|
|
|
|
|
|
|
|
/*-------------------------------------------------------------------------
|
|
|
|
* command line options
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
*/
|
|
|
|
|
|
|
|
typedef struct {
|
2007-09-13 23:44:56 +08:00
|
|
|
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 */
|
|
|
|
hsize_t count; /* count value */
|
|
|
|
int err_stat; /* an error ocurred (1, error, 0, no error) */
|
2009-01-27 03:29:22 +08:00
|
|
|
int cmn_objs; /* do we have common objects */
|
2007-09-13 23:44:56 +08:00
|
|
|
int not_cmp; /* are the objects comparable */
|
2008-08-05 05:13:16 +08:00
|
|
|
int contents; /* equal contents */
|
2009-01-14 00:33:31 +08:00
|
|
|
int do_nans; /* consider Nans while diffing floats */
|
2009-01-27 03:29:22 +08:00
|
|
|
int m_list_not_cmp; /* list not comparable messages */
|
2003-10-29 01:40:05 +08:00
|
|
|
} diff_opt_t;
|
2003-10-23 05:56:21 +08:00
|
|
|
|
|
|
|
|
|
|
|
/*-------------------------------------------------------------------------
|
|
|
|
* public functions
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2005-08-14 04:53:35 +08:00
|
|
|
hsize_t h5diff(const char *fname1,
|
|
|
|
const char *fname2,
|
|
|
|
const char *objname1,
|
|
|
|
const char *objname2,
|
2004-07-21 03:21:03 +08:00
|
|
|
diff_opt_t *options);
|
2005-02-10 02:19:54 +08:00
|
|
|
|
2005-02-09 19:36:17 +08:00
|
|
|
#ifdef H5_HAVE_PARALLEL
|
|
|
|
void phdiff_dismiss_workers(void);
|
2005-02-10 02:19:54 +08:00
|
|
|
void print_manager_output(void);
|
2005-02-09 19:36:17 +08:00
|
|
|
#endif
|
2003-10-23 05:56:21 +08:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*-------------------------------------------------------------------------
|
|
|
|
* private functions
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
2005-08-14 04:53:35 +08:00
|
|
|
hsize_t diff_dataset( hid_t file1_id,
|
|
|
|
hid_t file2_id,
|
|
|
|
const char *obj1_name,
|
2004-07-21 03:21:03 +08:00
|
|
|
const char *obj2_name,
|
2007-02-22 04:05:04 +08:00
|
|
|
diff_opt_t *options);
|
2003-10-29 01:40:05 +08:00
|
|
|
|
2005-08-14 04:53:35 +08:00
|
|
|
hsize_t diff_datasetid( hid_t dset1_id,
|
|
|
|
hid_t dset2_id,
|
|
|
|
const char *obj1_name,
|
|
|
|
const char *obj2_name,
|
2007-02-22 04:05:04 +08:00
|
|
|
diff_opt_t *options);
|
2004-07-21 03:21:03 +08:00
|
|
|
|
2005-08-14 04:53:35 +08:00
|
|
|
hsize_t diff( hid_t file1_id,
|
|
|
|
const char *path1,
|
|
|
|
hid_t file2_id,
|
|
|
|
const char *path2,
|
|
|
|
diff_opt_t *options,
|
2007-09-13 23:44:56 +08:00
|
|
|
h5trav_type_t type );
|
2004-07-21 03:21:03 +08:00
|
|
|
|
2005-08-14 04:53:35 +08:00
|
|
|
hsize_t diff_compare( hid_t file1_id,
|
|
|
|
const char *file1_name,
|
|
|
|
const char *obj1_name,
|
2004-07-21 03:21:03 +08:00
|
|
|
trav_info_t *info1,
|
2005-08-14 04:53:35 +08:00
|
|
|
hid_t file2_id,
|
|
|
|
const char *file2_name,
|
|
|
|
const char *obj2_name,
|
2004-07-21 03:21:03 +08:00
|
|
|
trav_info_t *info2,
|
|
|
|
diff_opt_t *options );
|
|
|
|
|
2005-08-14 04:53:35 +08:00
|
|
|
hsize_t diff_match( hid_t file1_id,
|
2004-07-21 03:21:03 +08:00
|
|
|
trav_info_t *info1,
|
2005-08-14 04:53:35 +08:00
|
|
|
hid_t file2_id,
|
|
|
|
trav_info_t *info2,
|
2003-12-03 07:13:27 +08:00
|
|
|
diff_opt_t *options );
|
|
|
|
|
2005-08-14 04:53:35 +08:00
|
|
|
hsize_t diff_array( void *_mem1,
|
|
|
|
void *_mem2,
|
|
|
|
hsize_t nelmts,
|
2006-10-26 04:38:28 +08:00
|
|
|
hsize_t hyper_start,
|
2005-08-14 04:53:35 +08:00
|
|
|
int rank,
|
|
|
|
hsize_t *dims,
|
|
|
|
diff_opt_t *options,
|
|
|
|
const char *name1,
|
2004-07-21 03:21:03 +08:00
|
|
|
const char *name2,
|
|
|
|
hid_t m_type,
|
|
|
|
hid_t container1_id,
|
|
|
|
hid_t container2_id); /* dataset where the reference came from*/
|
2003-10-23 05:56:21 +08:00
|
|
|
|
2003-11-04 06:10:57 +08:00
|
|
|
|
2005-08-14 04:53:35 +08:00
|
|
|
int diff_can_type( hid_t f_type1, /* file data type */
|
2003-11-04 06:10:57 +08:00
|
|
|
hid_t f_type2, /* file data type */
|
2005-08-14 04:53:35 +08:00
|
|
|
int rank1,
|
2003-11-04 06:10:57 +08:00
|
|
|
int rank2,
|
2005-08-14 04:53:35 +08:00
|
|
|
hsize_t *dims1,
|
2003-11-04 06:10:57 +08:00
|
|
|
hsize_t *dims2,
|
2005-08-14 04:53:35 +08:00
|
|
|
hsize_t *maxdim1,
|
2003-11-04 06:10:57 +08:00
|
|
|
hsize_t *maxdim2,
|
2005-08-14 04:53:35 +08:00
|
|
|
const char *obj1_name,
|
|
|
|
const char *obj2_name,
|
2009-02-11 23:57:25 +08:00
|
|
|
diff_opt_t *options,
|
|
|
|
int is_compound);
|
2003-11-04 06:10:57 +08:00
|
|
|
|
|
|
|
|
2007-03-06 00:26:50 +08:00
|
|
|
hsize_t diff_attr(hid_t loc1_id,
|
|
|
|
hid_t loc2_id,
|
|
|
|
const char *path1,
|
|
|
|
const char *path2,
|
|
|
|
diff_opt_t *options);
|
2003-11-04 06:10:57 +08:00
|
|
|
|
|
|
|
|
2003-10-23 05:56:21 +08:00
|
|
|
/*-------------------------------------------------------------------------
|
|
|
|
* utility functions
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
*/
|
|
|
|
|
2004-07-21 03:21:03 +08:00
|
|
|
void print_found(hsize_t nfound);
|
2005-01-27 07:03:29 +08:00
|
|
|
void parallel_print(const char* format, ... );
|
2003-10-29 01:40:05 +08:00
|
|
|
void print_type(hid_t type);
|
|
|
|
const char* diff_basename(const char *name);
|
[svn-r14154] Description:
Finish deprecating last H5G symbol (H5G_obj_t) - yay!
Lots of misc. library fixes to remove confusion between links and
objects. The tools could still use another pass, to remove h5trav_type_t type
and make the correct distinction between links & objects.
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
AIX/32 5.3 (copper) w/FORTRAN, w/parallel, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-09-26 06:18:33 +08:00
|
|
|
const char* get_type(h5trav_type_t type);
|
2003-10-23 05:56:21 +08:00
|
|
|
const char* get_class(H5T_class_t tclass);
|
|
|
|
const char* get_sign(H5T_sign_t sign);
|
2007-02-22 04:05:04 +08:00
|
|
|
void print_dimensions (int rank, hsize_t *dims);
|
2006-03-22 00:01:42 +08:00
|
|
|
int print_objname(diff_opt_t *options, hsize_t nfound);
|
2007-02-20 04:21:09 +08:00
|
|
|
void do_print_objname (const char *OBJ, const char *path1, const char *path2);
|
|
|
|
|
2004-07-21 03:21:03 +08:00
|
|
|
|
2006-10-26 04:38:28 +08:00
|
|
|
|
2005-08-14 04:53:35 +08:00
|
|
|
hsize_t diff_datum(void *_mem1,
|
|
|
|
void *_mem2,
|
2004-07-21 03:21:03 +08:00
|
|
|
hid_t m_type,
|
2005-08-14 04:53:35 +08:00
|
|
|
hsize_t i,
|
|
|
|
int rank,
|
2006-12-12 04:39:38 +08:00
|
|
|
hsize_t *dims,
|
2005-08-14 04:53:35 +08:00
|
|
|
hsize_t *acc,
|
|
|
|
hsize_t *pos,
|
|
|
|
diff_opt_t *options,
|
|
|
|
const char *obj1,
|
2004-07-21 03:21:03 +08:00
|
|
|
const char *obj2,
|
|
|
|
hid_t container1_id,
|
|
|
|
hid_t container2_id, /*where the reference came from*/
|
2005-08-14 04:53:35 +08:00
|
|
|
int *ph); /*print header */
|
2003-10-23 05:56:21 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
2004-11-17 03:51:39 +08:00
|
|
|
hsize_t diff_float(unsigned char *mem1,
|
2007-09-13 23:44:56 +08:00
|
|
|
unsigned char *mem2,
|
|
|
|
hsize_t nelmts,
|
|
|
|
hsize_t hyper_start,
|
|
|
|
int rank,
|
|
|
|
hsize_t *dims,
|
|
|
|
hsize_t *acc,
|
|
|
|
hsize_t *pos,
|
|
|
|
diff_opt_t *options,
|
|
|
|
const char *obj1,
|
|
|
|
const char *obj2,
|
|
|
|
int *ph);
|
2004-11-17 03:51:39 +08:00
|
|
|
|
|
|
|
hsize_t diff_double(unsigned char *mem1,
|
2008-10-29 03:13:42 +08:00
|
|
|
unsigned char *mem2,
|
|
|
|
hsize_t nelmts,
|
|
|
|
hsize_t hyper_start,
|
|
|
|
int rank,
|
|
|
|
hsize_t *dims,
|
|
|
|
hsize_t *acc,
|
|
|
|
hsize_t *pos,
|
|
|
|
diff_opt_t *options,
|
|
|
|
const char *obj1,
|
|
|
|
const char *obj2,
|
|
|
|
int *ph);
|
|
|
|
|
|
|
|
#if H5_SIZEOF_LONG_DOUBLE !=0
|
|
|
|
|
|
|
|
hsize_t diff_ldouble(unsigned char *mem1,
|
|
|
|
unsigned char *mem2,
|
|
|
|
hsize_t nelmts,
|
|
|
|
hsize_t hyper_start,
|
|
|
|
int rank,
|
|
|
|
hsize_t *dims,
|
|
|
|
hsize_t *acc,
|
|
|
|
hsize_t *pos,
|
|
|
|
diff_opt_t *options,
|
|
|
|
const char *obj1,
|
|
|
|
const char *obj2,
|
|
|
|
int *ph);
|
|
|
|
|
|
|
|
#endif
|
2004-11-17 03:51:39 +08:00
|
|
|
|
|
|
|
hsize_t diff_schar(unsigned char *mem1,
|
2007-09-13 23:44:56 +08:00
|
|
|
unsigned char *mem2,
|
|
|
|
hsize_t nelmts,
|
|
|
|
hsize_t hyper_start,
|
|
|
|
int rank,
|
|
|
|
hsize_t *dims,
|
|
|
|
hsize_t *acc,
|
|
|
|
hsize_t *pos,
|
|
|
|
diff_opt_t *options,
|
|
|
|
const char *obj1,
|
|
|
|
const char *obj2,
|
|
|
|
int *ph);
|
2004-11-17 03:51:39 +08:00
|
|
|
|
|
|
|
hsize_t diff_uchar(unsigned char *mem1,
|
2007-09-13 23:44:56 +08:00
|
|
|
unsigned char *mem2,
|
|
|
|
hsize_t nelmts,
|
|
|
|
hsize_t hyper_start,
|
|
|
|
int rank,
|
|
|
|
hsize_t *dims,
|
|
|
|
hsize_t *acc,
|
|
|
|
hsize_t *pos,
|
|
|
|
diff_opt_t *options,
|
|
|
|
const char *obj1,
|
|
|
|
const char *obj2,
|
|
|
|
int *ph);
|
2004-11-17 03:51:39 +08:00
|
|
|
|
|
|
|
hsize_t diff_short(unsigned char *mem1,
|
2007-09-13 23:44:56 +08:00
|
|
|
unsigned char *mem2,
|
|
|
|
hsize_t nelmts,
|
|
|
|
hsize_t hyper_start,
|
|
|
|
int rank,
|
|
|
|
hsize_t *dims,
|
|
|
|
hsize_t *acc,
|
|
|
|
hsize_t *pos,
|
|
|
|
diff_opt_t *options,
|
|
|
|
const char *obj1,
|
|
|
|
const char *obj2,
|
|
|
|
int *ph);
|
2004-11-17 03:51:39 +08:00
|
|
|
|
|
|
|
hsize_t diff_ushort(unsigned char *mem1,
|
2007-09-13 23:44:56 +08:00
|
|
|
unsigned char *mem2,
|
|
|
|
hsize_t nelmts,
|
|
|
|
hsize_t hyper_start,
|
|
|
|
int rank,
|
|
|
|
hsize_t *dims,
|
|
|
|
hsize_t *acc,
|
|
|
|
hsize_t *pos,
|
|
|
|
diff_opt_t *options,
|
|
|
|
const char *obj1,
|
|
|
|
const char *obj2,
|
|
|
|
int *ph);
|
2004-11-17 03:51:39 +08:00
|
|
|
|
|
|
|
hsize_t diff_int(unsigned char *mem1,
|
2007-09-13 23:44:56 +08:00
|
|
|
unsigned char *mem2,
|
|
|
|
hsize_t nelmts,
|
|
|
|
hsize_t hyper_start,
|
|
|
|
int rank,
|
|
|
|
hsize_t *dims,
|
|
|
|
hsize_t *acc,
|
|
|
|
hsize_t *pos,
|
|
|
|
diff_opt_t *options,
|
|
|
|
const char *obj1,
|
|
|
|
const char *obj2,
|
|
|
|
int *ph);
|
2004-11-17 03:51:39 +08:00
|
|
|
|
|
|
|
hsize_t diff_uint(unsigned char *mem1,
|
2007-09-13 23:44:56 +08:00
|
|
|
unsigned char *mem2,
|
|
|
|
hsize_t nelmts,
|
|
|
|
hsize_t hyper_start,
|
|
|
|
int rank,
|
|
|
|
hsize_t *dims,
|
|
|
|
hsize_t *acc,
|
|
|
|
hsize_t *pos,
|
|
|
|
diff_opt_t *options,
|
|
|
|
const char *obj1,
|
|
|
|
const char *obj2,
|
|
|
|
int *ph);
|
2004-11-17 03:51:39 +08:00
|
|
|
|
|
|
|
hsize_t diff_long(unsigned char *mem1,
|
2007-09-13 23:44:56 +08:00
|
|
|
unsigned char *mem2,
|
|
|
|
hsize_t nelmts,
|
|
|
|
hsize_t hyper_start,
|
|
|
|
int rank,
|
|
|
|
hsize_t *dims,
|
|
|
|
hsize_t *acc,
|
|
|
|
hsize_t *pos,
|
|
|
|
diff_opt_t *options,
|
|
|
|
const char *obj1,
|
|
|
|
const char *obj2,
|
|
|
|
int *ph);
|
2004-11-17 03:51:39 +08:00
|
|
|
|
|
|
|
hsize_t diff_ulong(unsigned char *mem1,
|
2007-09-13 23:44:56 +08:00
|
|
|
unsigned char *mem2,
|
|
|
|
hsize_t nelmts,
|
|
|
|
hsize_t hyper_start,
|
|
|
|
int rank,
|
|
|
|
hsize_t *dims,
|
|
|
|
hsize_t *acc,
|
|
|
|
hsize_t *pos,
|
|
|
|
diff_opt_t *options,
|
|
|
|
const char *obj1,
|
|
|
|
const char *obj2,
|
|
|
|
int *ph);
|
2004-11-17 03:51:39 +08:00
|
|
|
|
|
|
|
hsize_t diff_llong(unsigned char *mem1,
|
2007-09-13 23:44:56 +08:00
|
|
|
unsigned char *mem2,
|
|
|
|
hsize_t nelmts,
|
|
|
|
hsize_t hyper_start,
|
|
|
|
int rank,
|
|
|
|
hsize_t *dims,
|
|
|
|
hsize_t *acc,
|
|
|
|
hsize_t *pos,
|
|
|
|
diff_opt_t *options,
|
|
|
|
const char *obj1,
|
|
|
|
const char *obj2,
|
|
|
|
int *ph);
|
2004-11-17 03:51:39 +08:00
|
|
|
|
|
|
|
hsize_t diff_ullong(unsigned char *mem1,
|
2007-09-13 23:44:56 +08:00
|
|
|
unsigned char *mem2,
|
|
|
|
hsize_t nelmts,
|
|
|
|
hsize_t hyper_start,
|
|
|
|
int rank,
|
|
|
|
hsize_t *dims,
|
|
|
|
hsize_t *acc,
|
|
|
|
hsize_t *pos,
|
|
|
|
diff_opt_t *options,
|
|
|
|
const char *obj1,
|
|
|
|
const char *obj2,
|
|
|
|
int *ph);
|
2004-11-17 03:51:39 +08:00
|
|
|
|
2003-10-23 05:56:21 +08:00
|
|
|
#endif /* H5DIFF_H__ */
|
2007-09-13 23:44:56 +08:00
|
|
|
|