summaryrefslogtreecommitdiffstats
path: root/tools/lib/h5diff.h
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2020-07-15 16:20:16 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2020-07-15 16:20:16 (GMT)
commitbac0fc6309aaf777d4b6d093cf027dce3ecfb58c (patch)
tree1b944edb35a01a5bb8bb72445f82afb52317f06e /tools/lib/h5diff.h
parent900e75544e214a82de3b7fcdbc083ee71d484892 (diff)
downloadhdf5-bac0fc6309aaf777d4b6d093cf027dce3ecfb58c.zip
hdf5-bac0fc6309aaf777d4b6d093cf027dce3ecfb58c.tar.gz
hdf5-bac0fc6309aaf777d4b6d093cf027dce3ecfb58c.tar.bz2
Tools refactor
Move error_stack setup to tools library Add structure for h5dump properties Eliminate duplicated h5diff functions Use properties structure in place of argument lists.
Diffstat (limited to 'tools/lib/h5diff.h')
-rw-r--r--tools/lib/h5diff.h176
1 files changed, 66 insertions, 110 deletions
diff --git a/tools/lib/h5diff.h b/tools/lib/h5diff.h
index 37eb775..c3c111f 100644
--- a/tools/lib/h5diff.h
+++ b/tools/lib/h5diff.h
@@ -18,23 +18,6 @@
#include "h5tools.h"
#include "h5trav.h"
-/*
- * Debug printf macros. The prefix allows output filtering by test scripts.
- */
-#ifdef H5DIFF_DEBUG
-#define h5difftrace(x) HDfprintf(stderr, "h5diff debug: " x)
-#define h5diffdebug2(x1, x2) HDfprintf(stderr, "h5diff debug: " x1, x2)
-#define h5diffdebug3(x1, x2, x3) HDfprintf(stderr, "h5diff debug: " x1, x2, x3)
-#define h5diffdebug4(x1, x2, x3, x4) HDfprintf(stderr, "h5diff debug: " x1, x2, x3, x4)
-#define h5diffdebug5(x1, x2, x3, x4, x5) HDfprintf(stderr, "h5diff debug: " x1, x2, x3, x4, x5)
-#else
-#define h5difftrace(x)
-#define h5diffdebug2(x1, x2)
-#define h5diffdebug3(x1, x2, x3)
-#define h5diffdebug4(x1, x2, x3, x4)
-#define h5diffdebug5(x1, x2, x3, x4, x5)
-#endif
-
#define MAX_FILENAME 1024
/*-------------------------------------------------------------------------
@@ -58,6 +41,7 @@ struct exclude_path_list {
struct exclude_path_list *next;
};
+
/* Enumeration value for keeping track of whether an error occurred or differences were found */
typedef enum {
H5DIFF_NO_ERR, /* No error occurred */
@@ -66,31 +50,46 @@ typedef enum {
} diff_err_t;
typedef struct {
- int m_quiet; /* quiet mode: 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 m_verbose_level; /* control verbose details */
- int d; /* delta, absolute value to compare */
- double delta; /* delta value */
- int p; /* relative error to compare*/
- int use_system_epsilon; /* flag to use system epsilon (1 or 0) */
- double percent; /* relative error value */
- int n; /* count, compare up to count */
- hsize_t count; /* count value */
- hbool_t follow_links; /* follow symbolic links */
- int no_dangle_links; /* return error when find dangling link */
- diff_err_t err_stat; /* an error ocurred (2, error, 1, differences, 0, no error) */
- int cmn_objs; /* do we have common objects */
- int not_cmp; /* are the objects comparable */
- int contents; /* equal contents */
- int do_nans; /* consider Nans while diffing floats */
- int m_list_not_cmp; /* list not comparable messages */
- int exclude_path; /* exclude path to an object */
- struct exclude_path_list * exclude; /* keep exclude path list */
- h5tools_vol_info_t vol_info_1; /* VOL information for input file */
- h5tools_vol_info_t vol_info_2; /* VOL information for output file */
- hbool_t custom_vol_1; /* Using a custom input VOL? */
- hbool_t custom_vol_2; /* Using a custom output VOL? */
+ int mode_quiet; /* quiet mode: no output at all */
+ int mode_report; /* report mode: print the data */
+ int mode_verbose; /* verbose mode: print the data, list of objcets, warnings */
+ int mode_verbose_level; /* control verbose details */
+ int mode_list_not_cmp; /* list not comparable messages */
+ int print_header; /* print header */
+ int print_percentage; /* print percentage */
+ int delta_bool; /* delta, absolute value to compare */
+ double delta; /* delta value */
+ int use_system_epsilon; /* flag to use system epsilon (1 or 0) */
+ int percent_bool; /* relative error to compare*/
+ double percent; /* relative error value */
+ hbool_t follow_links; /* follow symbolic links */
+ int no_dangle_links; /* return error when find dangling link */
+ int cmn_objs; /* do we have common objects */
+ int not_cmp; /* are the objects comparable */
+ int contents; /* equal contents */
+ int do_nans; /* consider Nans while diffing floats */
+ int exclude_path; /* exclude path to an object */
+ int exclude_attr_path; /* exclude path to an object */
+ struct exclude_path_list *exclude; /* keep exclude path list */
+ struct exclude_path_list *exclude_attr; /* keep exclude attribute list */
+ int count_bool; /* count, compare up to count */
+ hsize_t count; /* count value */
+ diff_err_t err_stat; /* an error ocurred (2, error, 1, differences, 0, no error) */
+ hsize_t nelmts; /* total number of elements */
+ hsize_t hs_nelmts; /* number of elements to read at a time*/
+ int rank; /* dimensionality */
+ size_t m_size; /* m_size for diff */
+ hid_t m_tid; /* m_tid for diff */
+ hsize_t dims[H5S_MAX_RANK]; /* dimensions of object */
+ hsize_t p_min_idx[H5S_MAX_RANK]; /* min selected index */
+ hsize_t p_max_idx[H5S_MAX_RANK]; /* max selected index */
+ hsize_t acc[H5S_MAX_RANK]; /* accumulator position */
+ hsize_t pos[H5S_MAX_RANK]; /* matrix position */
+ hsize_t sm_pos[H5S_MAX_RANK]; /* stripmine position */
+ char *obj_name[2]; /* name for object */
+ struct subset_t *sset[2]; /* subsetting parameters */
+ h5tools_vol_info_t vol_info[2]; /* VOL information for input file, output file */
+ hbool_t custom_vol[2]; /* Using a custom input, output VOL? */
} diff_opt_t;
@@ -103,18 +102,9 @@ typedef struct {
extern "C" {
#endif
-H5TOOLS_DLL hsize_t h5diff(const char *fname1,
- const char *fname2,
- const char *objname1,
- const char *objname2,
- diff_opt_t *opts);
+H5TOOLS_DLL hsize_t h5diff(const char *fname1, const char *fname2, const char *objname1, const char *objname2, diff_opt_t *opts);
-H5TOOLS_DLL hsize_t diff( hid_t file1_id,
- const char *path1,
- hid_t file2_id,
- const char *path2,
- diff_opt_t *opts,
- diff_args_t *argdata);
+H5TOOLS_DLL hsize_t diff(hid_t file1_id, const char *path1, hid_t file2_id, const char *path2, diff_opt_t *opts, diff_args_t *argdata);
#ifdef H5_HAVE_PARALLEL
H5TOOLS_DLL void phdiff_dismiss_workers(void);
@@ -133,63 +123,29 @@ H5TOOLS_DLL void print_manager_output(void);
*/
-hsize_t diff_dataset( hid_t file1_id,
- hid_t file2_id,
- const char *obj1_name,
- const char *obj2_name,
- diff_opt_t *opts);
-
-hsize_t diff_datasetid( hid_t dset1_id,
- hid_t dset2_id,
- const char *obj1_name,
- const char *obj2_name,
- diff_opt_t *opts);
-
-
-hsize_t diff_match( hid_t file1_id, const char *grp1, trav_info_t *info1,
- hid_t file2_id, const char *grp2, trav_info_t *info2,
- trav_table_t *table, diff_opt_t *opts );
-
-hsize_t diff_array( void *_mem1,
- void *_mem2,
- hsize_t nelmts,
- hsize_t hyper_start,
- int rank,
- hsize_t *dims,
- diff_opt_t *opts,
- 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 */
- hid_t f_type2, /* file data type */
- int rank1,
- int rank2,
- hsize_t *dims1,
- hsize_t *dims2,
- hsize_t *maxdim1,
- hsize_t *maxdim2,
- const char *obj1_name,
- const char *obj2_name,
- diff_opt_t *opts,
- int is_compound);
-
-hsize_t diff_attr_data(hid_t attr1_id,
- hid_t attr2_id,
- const char *attr1_name,
- const char *attr2_name,
- const char *path1,
- const char *path2,
- diff_opt_t *opts);
-
-hsize_t diff_attr(hid_t loc1_id,
- hid_t loc2_id,
- const char *path1,
- const char *path2,
- diff_opt_t *opts);
+hsize_t diff_dataset(hid_t file1_id, hid_t file2_id,
+ const char *obj1_name, const char *obj2_name, diff_opt_t *opts);
+
+hsize_t diff_datasetid(hid_t dset1_id, hid_t dset2_id,
+ const char *obj1_name, const char *obj2_name, diff_opt_t *opts);
+
+
+hsize_t diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1,
+ hid_t file2_id, const char *grp2, trav_info_t *info2,
+ trav_table_t *table, diff_opt_t *opts);
+
+hsize_t diff_array(void *_mem1, void *_mem2,
+ diff_opt_t *opts, hid_t container1_id, hid_t container2_id);
+
+int diff_can_type(hid_t f_type1, hid_t f_type2, int rank1, int rank2,
+ hsize_t *dims1, hsize_t *dims2, hsize_t *maxdim1, hsize_t *maxdim2,
+ diff_opt_t *opts, int is_compound);
+
+hsize_t diff_attr_data(hid_t attr1_id, hid_t attr2_id, const char *name1, const char *name2,
+ const char *path1, const char *path2, diff_opt_t *opts);
+
+hsize_t diff_attr(hid_t loc1_id, hid_t loc2_id,
+ const char *path1, const char *path2, diff_opt_t *opts);
/*-------------------------------------------------------------------------