summaryrefslogtreecommitdiffstats
path: root/tools/lib/h5diff_array.c
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2020-01-13 17:35:40 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2020-01-13 17:35:40 (GMT)
commit06f3c95c6ef68fdeff32569bc038ca3ba83b7aaa (patch)
treeb3cee1b654645e10d40a52474fd13cebeab0a9a9 /tools/lib/h5diff_array.c
parent281de962f5b4faae04bdada895ff1e39bec9d87c (diff)
downloadhdf5-06f3c95c6ef68fdeff32569bc038ca3ba83b7aaa.zip
hdf5-06f3c95c6ef68fdeff32569bc038ca3ba83b7aaa.tar.gz
hdf5-06f3c95c6ef68fdeff32569bc038ca3ba83b7aaa.tar.bz2
Merge tools changes from develop
Diffstat (limited to 'tools/lib/h5diff_array.c')
-rw-r--r--tools/lib/h5diff_array.c372
1 files changed, 188 insertions, 184 deletions
diff --git a/tools/lib/h5diff_array.c b/tools/lib/h5diff_array.c
index dcc2c81..f671b06 100644
--- a/tools/lib/h5diff_array.c
+++ b/tools/lib/h5diff_array.c
@@ -275,7 +275,6 @@ hsize_t diff_array(
hid_t container1_id,
hid_t container2_id) /* dataset where the reference came from*/
{
- H5TOOLS_ERR_INIT(int, 0)
hsize_t nfound = 0; /* number of differences found */
size_t size; /* size of datum */
unsigned char *mem1 = (unsigned char*) _mem1;
@@ -288,8 +287,7 @@ hsize_t diff_array(
mcomp_t members;
H5T_class_t type_class;
- H5TOOLS_PUSH_STACK();
- H5TOOLS_DEBUG(H5E_tools_min_dbg_id_g, "diff_array start - errstat:%d", opts->err_stat);
+ H5TOOLS_DEBUG("diff_array start - errstat:%d", opts->err_stat);
/* get the size. */
size = H5Tget_size(m_type);
type_class = H5Tget_class(m_type);
@@ -314,7 +312,7 @@ hsize_t diff_array(
pos[j] = 0;
}
- H5TOOLS_DEBUG(H5E_tools_min_dbg_id_g, "diff_array type_class:%d", type_class);
+ H5TOOLS_DEBUG("diff_array type_class:%d", type_class);
switch (type_class) {
case H5T_NO_CLASS:
case H5T_TIME:
@@ -375,7 +373,7 @@ hsize_t diff_array(
case H5T_REFERENCE:
HDmemset(&members, 0, sizeof(mcomp_t));
get_member_types(m_type, &members);
- H5TOOLS_DEBUG(H5E_tools_min_dbg_id_g, "call diff_datum nelmts:%d - errstat:%d", nelmts, opts->err_stat);
+ H5TOOLS_DEBUG("call diff_datum nelmts:%d - errstat:%d", nelmts, opts->err_stat);
for (i = 0; i < nelmts; i++) {
nfound += diff_datum(mem1 + i * size, mem2 + i * size, m_type, i, rank, dims, acc, pos, opts,
name1, name2, container1_id, container2_id, &ph, &members);
@@ -384,10 +382,9 @@ hsize_t diff_array(
} /* i */
close_member_types(&members);
} /* switch */
- H5TOOLS_DEBUG(H5E_tools_min_dbg_id_g, "diff_array finish:%d - errstat:%d", nfound, opts->err_stat);
+ H5TOOLS_DEBUG("diff_array finish:%d - errstat:%d", nfound, opts->err_stat);
- H5TOOLS_ENDDEBUG(H5E_tools_min_dbg_id_g, "exit: %d", nfound);
- H5TOOLS_POP_STACK();
+ H5TOOLS_ENDDEBUG("exit: %d", nfound);
return nfound;
}
@@ -441,7 +438,6 @@ static hsize_t diff_datum(
int *ph, /*print header */
mcomp_t *members) /*compound members */
{
- H5TOOLS_ERR_INIT(hsize_t, opts->err_stat)
unsigned char *mem1 = (unsigned char*) _mem1;
unsigned char *mem2 = (unsigned char*) _mem2;
size_t u;
@@ -458,9 +454,9 @@ static hsize_t diff_datum(
hsize_t nfound = 0; /* differences found */
double per;
hbool_t both_zero;
+ diff_err_t ret_value = opts->err_stat;
- H5TOOLS_PUSH_STACK();
- H5TOOLS_DEBUG(H5E_tools_min_dbg_id_g, "diff_datum start - errstat:%d", opts->err_stat);
+ H5TOOLS_DEBUG("diff_datum start - errstat:%d", opts->err_stat);
type_size = H5Tget_size(m_type);
type_class = H5Tget_class(m_type);
@@ -474,14 +470,14 @@ static hsize_t diff_datum(
type_class != H5T_STRING &&
type_class != H5T_VLEN &&
HDmemcmp(mem1, mem2, type_size) == 0)
- HGOTO_DONE(opts->err_stat);
+ H5TOOLS_GOTO_DONE(opts->err_stat);
switch (H5Tget_class(m_type)) {
case H5T_NO_CLASS:
case H5T_TIME:
case H5T_NCLASSES:
default:
- H5TOOLS_GOTO_ERROR(1, H5E_tools_min_id_g, "Invalid type class");
+ H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "Invalid type class");
break;
/*-------------------------------------------------------------------------
@@ -489,9 +485,9 @@ static hsize_t diff_datum(
*-------------------------------------------------------------------------
*/
case H5T_COMPOUND:
- H5TOOLS_DEBUG(H5E_tools_min_dbg_id_g, "diff_datum H5T_COMPOUND");
+ H5TOOLS_DEBUG("diff_datum H5T_COMPOUND");
{
- hid_t memb_type = -1;
+ hid_t memb_type = H5I_INVALID_HID;
nmembs = members->n;
for (j = 0; j < nmembs; j++) {
@@ -509,7 +505,7 @@ static hsize_t diff_datum(
*-------------------------------------------------------------------------
*/
case H5T_STRING:
- H5TOOLS_DEBUG(H5E_tools_min_dbg_id_g, "diff_datum H5T_STRING");
+ H5TOOLS_DEBUG("diff_datum H5T_STRING");
{
char *s = NULL;
char *sx = NULL;
@@ -523,7 +519,7 @@ static hsize_t diff_datum(
/* if variable length string */
if (H5Tis_variable_str(m_type)) {
- H5TOOLS_DEBUG(H5E_tools_min_dbg_id_g, "diff_datum H5T_STRING variable");
+ H5TOOLS_DEBUG("diff_datum H5T_STRING variable");
/* Get pointer to first string */
s1 = *(char **)((void *)mem1);
if (s1)
@@ -539,7 +535,7 @@ static hsize_t diff_datum(
size2 = 0;
}
else if (H5T_STR_NULLTERM == pad) {
- H5TOOLS_DEBUG(H5E_tools_min_dbg_id_g, "diff_datum H5T_STRING null term");
+ H5TOOLS_DEBUG("diff_datum H5T_STRING null term");
/* Get pointer to first string */
s1 = (char*) mem1;
if (s1)
@@ -576,10 +572,10 @@ static hsize_t diff_datum(
* of length of strings.
* For now mimic the previous way.
*/
- H5TOOLS_DEBUG(H5E_tools_min_dbg_id_g, "diff_datum string size:%d", size1);
- H5TOOLS_DEBUG(H5E_tools_min_dbg_id_g, "diff_datum string size:%d", size2);
+ H5TOOLS_DEBUG("diff_datum string size:%d", size1);
+ H5TOOLS_DEBUG("diff_datum string size:%d", size2);
if (size1 != size2) {
- H5TOOLS_DEBUG(H5E_tools_min_dbg_id_g, "diff_datum string sizes difference");
+ H5TOOLS_DEBUG("diff_datum string sizes difference");
nfound++;
}
if (size1 < size2) {
@@ -616,7 +612,7 @@ static hsize_t diff_datum(
*-------------------------------------------------------------------------
*/
case H5T_BITFIELD:
- H5TOOLS_DEBUG(H5E_tools_min_dbg_id_g, "diff_datum H5T_BITFIELD");
+ H5TOOLS_DEBUG("diff_datum H5T_BITFIELD");
/* byte-by-byte comparison */
for (u = 0; u < type_size; u++)
nfound += character_compare_opt(mem1 + u, mem2 + u, index, rank, dims, acc, pos, opts, obj1, obj2, ph);
@@ -627,7 +623,7 @@ static hsize_t diff_datum(
*-------------------------------------------------------------------------
*/
case H5T_OPAQUE:
- H5TOOLS_DEBUG(H5E_tools_min_dbg_id_g, "diff_datum H5T_OPAQUE");
+ H5TOOLS_DEBUG("diff_datum H5T_OPAQUE");
/* byte-by-byte comparison */
for (u = 0; u < type_size; u++)
nfound += character_compare_opt(mem1 + u, mem2 + u, index, rank, dims, acc, pos, opts, obj1, obj2, ph);
@@ -643,7 +639,7 @@ static hsize_t diff_datum(
* compared, we convert both bit patterns to their corresponding
* enumeration constant and do a string comparison
*/
- H5TOOLS_DEBUG(H5E_tools_min_dbg_id_g, "diff_datum H5T_ENUM");
+ H5TOOLS_DEBUG("diff_datum H5T_ENUM");
{
char enum_name1[1024];
char enum_name2[1024];
@@ -702,11 +698,11 @@ static hsize_t diff_datum(
*/
case H5T_ARRAY:
{
- hid_t memb_type = -1;
+ hid_t memb_type = H5I_INVALID_HID;
hsize_t adims[H5S_MAX_RANK];
int ndims;
- H5TOOLS_DEBUG(H5E_tools_min_dbg_id_g, "diff_datum H5T_ARRAY");
+ H5TOOLS_DEBUG("diff_datum H5T_ARRAY");
/* get the array's base datatype for each element */
memb_type = H5Tget_super(m_type);
size = H5Tget_size(memb_type);
@@ -730,16 +726,16 @@ static hsize_t diff_datum(
*-------------------------------------------------------------------------
*/
case H5T_REFERENCE:
- H5TOOLS_DEBUG(H5E_tools_min_dbg_id_g, "diff_datum H5T_REFERENCE");
+ H5TOOLS_DEBUG("diff_datum H5T_REFERENCE");
iszero1 = all_zero(_mem1, H5Tget_size(m_type));
iszero2 = all_zero(_mem2, H5Tget_size(m_type));
if (iszero1 != iszero2) {
nfound++;
- HGOTO_DONE (opts->err_stat);
+ H5TOOLS_GOTO_DONE(opts->err_stat);
}
else if (!iszero1 && !iszero2) {
- hid_t obj1_id = -1;
- hid_t obj2_id = -1;
+ hid_t obj1_id = H5I_INVALID_HID;
+ hid_t obj2_id = H5I_INVALID_HID;
/*-------------------------------------------------------------------------
* H5T_STD_REF
@@ -748,42 +744,42 @@ static hsize_t diff_datum(
*/
if (H5Tequal(m_type, H5T_STD_REF)) {
/* if (type_size == H5R_STD_REF_SIZE) */
- hid_t region1_id = -1;
- hid_t region2_id = -1;
+ hid_t region1_id = H5I_INVALID_HID;
+ hid_t region2_id = H5I_INVALID_HID;
H5R_ref_t *ref1_buf = (const H5R_ref_t *)_mem1;
H5R_ref_t *ref2_buf = (const H5R_ref_t *)_mem2;
H5O_type_t obj1_type = -1; /* Object type */
H5O_type_t obj2_type = -1; /* Object type */
H5R_type_t ref_type; /* Reference type */
- H5TOOLS_DEBUG(H5E_tools_min_dbg_id_g, "diff_datum H5T_REFERENCE - H5T_STD_REF");
+ H5TOOLS_DEBUG("diff_datum H5T_REFERENCE - H5T_STD_REF");
ref_type = H5Rget_type(ref1_buf);
switch (ref_type) {
case H5R_OBJECT1:
- H5TOOLS_DEBUG(H5E_tools_min_dbg_id_g, "ref_type is H5R_OBJECT1");
+ H5TOOLS_DEBUG("ref_type is H5R_OBJECT1");
if (H5Rget_obj_type3(ref1_buf, H5P_DEFAULT, &obj1_type) < 0) {
- opts->err_stat = 1;
- H5TOOLS_INFO(H5E_tools_min_id_g, "H5Rget_obj_type3 object 1 failed");
+ opts->err_stat = H5DIFF_ERR;
+ H5TOOLS_INFO("H5Rget_obj_type3 object 1 failed");
}
if (H5Rget_obj_type3(ref2_buf, H5P_DEFAULT, &obj2_type) < 0) {
- opts->err_stat = 1;
- H5TOOLS_INFO(H5E_tools_min_id_g, "H5Rget_obj_type3 object 2 failed");
+ opts->err_stat = H5DIFF_ERR;
+ H5TOOLS_INFO("H5Rget_obj_type3 object 2 failed");
}
/* check object type */
if (obj1_type != obj2_type) {
parallel_print("Different object types referenced: <%s> and <%s>", obj1, obj2);
opts->not_cmp = 1;
- HGOTO_DONE (opts->err_stat);
+ H5TOOLS_GOTO_DONE(opts->err_stat);
}
if((obj1_id = H5Ropen_object(ref1_buf, H5P_DEFAULT, H5P_DEFAULT)) < 0) {
- opts->err_stat = 1;
- H5TOOLS_INFO(H5E_tools_min_id_g, "H5Ropen_object object 1 failed");
+ opts->err_stat = H5DIFF_ERR;
+ H5TOOLS_INFO("H5Ropen_object object 1 failed");
}
if((obj2_id = H5Ropen_object(ref2_buf, H5P_DEFAULT, H5P_DEFAULT)) < 0) {
- opts->err_stat = 1;
- H5TOOLS_INFO(H5E_tools_min_id_g, "H5Ropen_object object 2 failed");
+ opts->err_stat = H5DIFF_ERR;
+ H5TOOLS_INFO("H5Ropen_object object 2 failed");
}
switch (obj1_type) {
@@ -803,88 +799,92 @@ static hsize_t diff_datum(
break;
} /* end switch */
if(obj1_id >= 0)
- if(H5Oclose(obj1_id) < 0)
- H5TOOLS_INFO(H5E_tools_g, H5E_tools_min_id_g, "H5Oclose H5R_OBJECT1 failed");
+ if(H5Oclose(obj1_id) < 0) {
+ opts->err_stat = H5DIFF_ERR;
+ H5TOOLS_INFO("H5Oclose H5R_OBJECT1 failed");
+ }
if(obj2_id >= 0)
- if(H5Oclose(obj2_id) < 0)
- H5TOOLS_INFO(H5E_tools_g, H5E_tools_min_id_g, "H5Oclose H5R_OBJECT1 failed");
+ if(H5Oclose(obj2_id) < 0) {
+ opts->err_stat = H5DIFF_ERR;
+ H5TOOLS_INFO("H5Oclose H5R_OBJECT1 failed");
+ }
if(H5Rdestroy(ref2_buf) < 0)
- H5TOOLS_ERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Rdestroy H5R_OBJECT1 failed");
+ H5TOOLS_ERROR(H5DIFF_ERR, "H5Rdestroy H5R_OBJECT1 failed");
if(H5Rdestroy(ref1_buf) < 0)
- H5TOOLS_ERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Rdestroy H5R_OBJECT1 failed");
+ H5TOOLS_ERROR(H5DIFF_ERR, "H5Rdestroy H5R_OBJECT1 failed");
break;
case H5R_DATASET_REGION1:
- H5TOOLS_DEBUG(H5E_tools_min_dbg_id_g, "ref_type is H5R_DATASET_REGION1");
+ H5TOOLS_DEBUG("ref_type is H5R_DATASET_REGION1");
if((obj1_id = H5Ropen_object(ref1_buf, H5P_DEFAULT, H5P_DEFAULT)) >= 0) {
if((obj2_id = H5Ropen_object(ref2_buf, H5P_DEFAULT, H5P_DEFAULT)) >= 0) {
if((region1_id = H5Ropen_region(ref1_buf, H5P_DEFAULT, H5P_DEFAULT)) >= 0) {
if((region2_id = H5Ropen_region(ref2_buf, H5P_DEFAULT, H5P_DEFAULT)) >= 0) {
nfound = diff_region(obj1_id, obj2_id, region1_id, region2_id, opts);
if(H5Sclose(region2_id) < 0)
- H5TOOLS_ERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Sclose H5R_DATASET_REGION1 failed");
+ H5TOOLS_ERROR(H5DIFF_ERR, "H5Sclose H5R_DATASET_REGION1 failed");
}
if(H5Sclose(region1_id) < 0)
- H5TOOLS_ERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Sclose H5R_DATASET_REGION1 failed");
+ H5TOOLS_ERROR(H5DIFF_ERR, "H5Sclose H5R_DATASET_REGION1 failed");
}
if(H5Oclose(obj2_id) < 0)
- H5TOOLS_ERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Oclose H5R_DATASET_REGION1 failed");
+ H5TOOLS_ERROR(H5DIFF_ERR, "H5Oclose H5R_DATASET_REGION1 failed");
}
else {
- H5TOOLS_ERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Ropen_object H5R_DATASET_REGION1 failed");
+ H5TOOLS_ERROR(H5DIFF_ERR, "H5Ropen_object H5R_DATASET_REGION1 failed");
}
if(H5Oclose(obj1_id) < 0)
- H5TOOLS_ERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Oclose H5R_DATASET_REGION1 failed");
+ H5TOOLS_ERROR(H5DIFF_ERR, "H5Oclose H5R_DATASET_REGION1 failed");
}
else {
- H5TOOLS_ERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Ropen_object H5R_DATASET_REGION1 failed");
+ H5TOOLS_ERROR(H5DIFF_ERR, "H5Ropen_object H5R_DATASET_REGION1 failed");
}
if(H5Rdestroy(ref2_buf) < 0)
- H5TOOLS_ERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Rdestroy H5R_DATASET_REGION1 failed");
+ H5TOOLS_ERROR(H5DIFF_ERR, "H5Rdestroy H5R_DATASET_REGION1 failed");
if(H5Rdestroy(ref1_buf) < 0)
- H5TOOLS_ERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Rdestroy H5R_DATASET_REGION1 failed");
+ H5TOOLS_ERROR(H5DIFF_ERR, "H5Rdestroy H5R_DATASET_REGION1 failed");
break;
case H5R_OBJECT2:
- H5TOOLS_DEBUG(H5E_tools_min_dbg_id_g, "ref_type is H5R_OBJECT2");
+ H5TOOLS_DEBUG("ref_type is H5R_OBJECT2");
if (H5Rget_obj_type3(ref1_buf, H5P_DEFAULT, &obj1_type) < 0) {
- opts->err_stat = 1;
- H5TOOLS_INFO(H5E_tools_min_id_g, "H5Rget_obj_type3 object 1 failed");
+ opts->err_stat = H5DIFF_ERR;
+ H5TOOLS_INFO("H5Rget_obj_type3 object 1 failed");
}
if (H5Rget_obj_type3(ref2_buf, H5P_DEFAULT, &obj2_type) < 0) {
- opts->err_stat = 1;
- H5TOOLS_INFO(H5E_tools_min_id_g, "H5Rget_obj_type3 object 2 failed");
+ opts->err_stat = H5DIFF_ERR;
+ H5TOOLS_INFO("H5Rget_obj_type3 object 2 failed");
}
/* check object type */
if (obj1_type != obj2_type) {
parallel_print("Different object types referenced: <%s> and <%s>", obj1, obj2);
opts->not_cmp = 1;
- HGOTO_DONE (opts->err_stat);
+ H5TOOLS_GOTO_DONE(opts->err_stat);
}
if((obj1_id = H5Ropen_object(ref1_buf, H5P_DEFAULT, H5P_DEFAULT)) < 0) {
- opts->err_stat = 1;
- H5TOOLS_INFO(H5E_tools_min_id_g, "H5Ropen_object object 1 failed");
+ opts->err_stat = H5DIFF_ERR;
+ H5TOOLS_INFO("H5Ropen_object object 1 failed");
}
if((obj2_id = H5Ropen_object(ref2_buf, H5P_DEFAULT, H5P_DEFAULT)) < 0) {
- opts->err_stat = 1;
- H5TOOLS_INFO(H5E_tools_min_id_g, "H5Ropen_object object 2 failed");
+ opts->err_stat = H5DIFF_ERR;
+ H5TOOLS_INFO("H5Ropen_object object 2 failed");
}
switch (obj1_type) {
case H5O_TYPE_DATASET:
- H5TOOLS_DEBUG(H5E_tools_min_dbg_id_g, "ref_type is H5R_OBJECT2 : DATASET");
+ H5TOOLS_DEBUG("ref_type is H5R_OBJECT2 : DATASET");
nfound = diff_datasetid(obj1_id, obj2_id, NULL, NULL, opts);
break;
case H5O_TYPE_GROUP:
- H5TOOLS_DEBUG(H5E_tools_min_dbg_id_g, "ref_type is H5R_OBJECT2 : GROUP");
+ H5TOOLS_DEBUG("ref_type is H5R_OBJECT2 : GROUP");
if (opts->m_verbose)
parallel_print("Warning: Comparison not possible of group object types referenced: <%s> and <%s>\n", obj1, obj2);
opts->not_cmp = 1;
break;
case H5O_TYPE_NAMED_DATATYPE:
- H5TOOLS_DEBUG(H5E_tools_min_dbg_id_g, "ref_type is H5R_OBJECT2 : NAMED");
+ H5TOOLS_DEBUG("ref_type is H5R_OBJECT2 : NAMED");
if (opts->m_verbose)
parallel_print("Warning: Comparison not possible of named datatypes object types referenced: <%s> and <%s>\n", obj1, obj2);
opts->not_cmp = 1;
@@ -900,60 +900,68 @@ static hsize_t diff_datum(
break;
} /* end switch */
if(obj1_id >= 0)
- if(H5Oclose(obj1_id) < 0)
- H5TOOLS_INFO(H5E_tools_g, H5E_tools_min_id_g, "H5Oclose H5R_OBJECT2 failed");
+ if(H5Oclose(obj1_id) < 0) {
+ opts->err_stat = H5DIFF_ERR;
+ H5TOOLS_INFO("H5Oclose H5R_OBJECT2 failed");
+ }
if(obj2_id >= 0)
- if(H5Oclose(obj2_id) < 0)
- H5TOOLS_INFO(H5E_tools_g, H5E_tools_min_id_g, "H5Oclose H5R_OBJECT2 failed");
+ if(H5Oclose(obj2_id) < 0) {
+ opts->err_stat = H5DIFF_ERR;
+ H5TOOLS_INFO("H5Oclose H5R_OBJECT2 failed");
+ }
if(H5Rdestroy(ref2_buf) < 0)
- H5TOOLS_ERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Rdestroy H5R_OBJECT2 failed");
+ H5TOOLS_ERROR(H5DIFF_ERR, "H5Rdestroy H5R_OBJECT2 failed");
if(H5Rdestroy(ref1_buf) < 0)
- H5TOOLS_ERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Rdestroy H5R_OBJECT2 failed");
+ H5TOOLS_ERROR(H5DIFF_ERR, "H5Rdestroy H5R_OBJECT2 failed");
break;
case H5R_DATASET_REGION2:
- H5TOOLS_DEBUG(H5E_tools_min_dbg_id_g, "ref_type is H5R_DATASET_REGION2");
+ H5TOOLS_DEBUG("ref_type is H5R_DATASET_REGION2");
/* if (obj_id < 0) - could mean that no reference was written do not throw failure */
obj1_id = H5Ropen_object(ref1_buf, H5P_DEFAULT, H5P_DEFAULT);
obj2_id = H5Ropen_object(ref2_buf, H5P_DEFAULT, H5P_DEFAULT);
- if((obj1_id < 0) || (obj1_id < 0))
- H5Epush2(H5tools_ERR_STACK_g, __FILE__, FUNC, __LINE__, H5tools_ERR_CLS_g, H5E_tools_g, H5E_tools_min_id_g,
- "H5Ropen_object H5R_DATASET_REGION2 failed");
+ if((obj1_id < 0) || (obj1_id < 0)) {
+ H5TOOLS_INFO("H5Ropen_object H5R_DATASET_REGION2 failed");
+ }
else {
- H5TOOLS_DEBUG(H5E_tools_min_dbg_id_g, "open_region - H5R_DATASET_REGION2");
+ H5TOOLS_DEBUG("open_region - H5R_DATASET_REGION2");
if((region1_id = H5Ropen_region(ref1_buf, H5P_DEFAULT, H5P_DEFAULT)) >= 0) {
if (h5tools_is_zero(ref1_buf, H5Tget_size(H5T_STD_REF))) {
- H5TOOLS_DEBUG(H5E_tools_min_dbg_id_g, "NULL H5R_DATASET_REGION2");
+ H5TOOLS_DEBUG("NULL H5R_DATASET_REGION2");
}
else {
if((region2_id = H5Ropen_region(ref2_buf, H5P_DEFAULT, H5P_DEFAULT)) >= 0) {
if (h5tools_is_zero(ref2_buf, H5Tget_size(H5T_STD_REF))) {
- H5TOOLS_DEBUG(H5E_tools_min_dbg_id_g, "NULL H5R_DATASET_REGION2");
+ H5TOOLS_DEBUG("NULL H5R_DATASET_REGION2");
}
else {
nfound = diff_region(obj1_id, obj2_id, region1_id, region2_id, opts);
}
if(H5Sclose(region2_id) < 0)
- H5TOOLS_ERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Sclose H5R_DATASET_REGION2 failed");
+ H5TOOLS_ERROR(H5DIFF_ERR, "H5Sclose H5R_DATASET_REGION2 failed");
}
else
- H5TOOLS_ERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Ropen_region H5R_DATASET_REGION2 failed");
+ H5TOOLS_ERROR(H5DIFF_ERR, "H5Ropen_region H5R_DATASET_REGION2 failed");
} /* end else to if (h5tools_is_zero(... */
if(H5Sclose(region1_id) < 0)
- H5TOOLS_ERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Sclose H5R_DATASET_REGION2 failed");
+ H5TOOLS_ERROR(H5DIFF_ERR, "H5Sclose H5R_DATASET_REGION2 failed");
}
else
- H5TOOLS_ERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Ropen_region H5R_DATASET_REGION2 failed");
+ H5TOOLS_ERROR(H5DIFF_ERR, "H5Ropen_region H5R_DATASET_REGION2 failed");
if (obj1_id >= 0)
- if(H5Dclose(obj1_id) < 0)
- H5TOOLS_INFO(H5E_tools_g, H5E_tools_min_id_g, "H5Dclose H5R_DATASET_REGION2 failed");
+ if(H5Dclose(obj1_id) < 0) {
+ opts->err_stat = H5DIFF_ERR;
+ H5TOOLS_INFO("H5Dclose H5R_DATASET_REGION2 failed");
+ }
if (obj2_id >= 0)
- if(H5Dclose(obj2_id) < 0)
- H5TOOLS_INFO(H5E_tools_g, H5E_tools_min_id_g, "H5Dclose H5R_DATASET_REGION2 failed");
+ if(H5Dclose(obj2_id) < 0) {
+ opts->err_stat = H5DIFF_ERR;
+ H5TOOLS_INFO("H5Dclose H5R_DATASET_REGION2 failed");
+ }
if(H5Rdestroy(ref1_buf) < 0)
- H5TOOLS_ERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Rdestroy H5R_DATASET_REGION2 failed");
+ H5TOOLS_ERROR(H5DIFF_ERR, "H5Rdestroy H5R_DATASET_REGION2 failed");
if(H5Rdestroy(ref2_buf) < 0)
- H5TOOLS_ERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Rdestroy H5R_DATASET_REGION2 failed");
+ H5TOOLS_ERROR(H5DIFF_ERR, "H5Rdestroy H5R_DATASET_REGION2 failed");
}
break;
case H5R_ATTR:
@@ -961,41 +969,45 @@ static hsize_t diff_datum(
char name1[ATTR_NAME_MAX];
char name2[ATTR_NAME_MAX];
- H5TOOLS_DEBUG(H5E_tools_min_dbg_id_g, "ref_type is H5R_ATTR");
+ H5TOOLS_DEBUG("ref_type is H5R_ATTR");
if((obj1_id = H5Ropen_attr(ref1_buf, H5P_DEFAULT, H5P_DEFAULT)) < 0) {
parallel_print("Warning: Cannot open referenced attribute: attribute 1\n");
- H5TOOLS_INFO(H5E_tools_min_id_g, "H5Ropen_attr object 1 failed");
+ H5TOOLS_INFO("H5Ropen_attr object 1 failed");
}
if((obj2_id = H5Ropen_attr(ref2_buf, H5P_DEFAULT, H5P_DEFAULT)) < 0) {
parallel_print("Warning: Cannot open referenced attribute: attribute 2\n");
- H5TOOLS_INFO(H5E_tools_min_id_g, "H5Ropen_attr object 2 failed");
+ H5TOOLS_INFO("H5Ropen_attr object 2 failed");
}
- if((obj1_id < 0) || (obj1_id < 0))
- H5Epush2(H5tools_ERR_STACK_g, __FILE__, FUNC, __LINE__, H5tools_ERR_CLS_g, H5E_tools_g, H5E_tools_min_id_g,
- "H5Ropen_attr H5R_ATTR failed");
+ if((obj1_id < 0) || (obj1_id < 0)) {
+ H5TOOLS_INFO("H5Ropen_attr H5R_ATTR failed");
+ }
else {
/* get name */
if(H5Aget_name(obj1_id, (size_t)ATTR_NAME_MAX, name1) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Aget_name first attribute failed");
+ H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "H5Aget_name first attribute failed");
/* get name */
if(H5Aget_name(obj2_id, (size_t)ATTR_NAME_MAX, name2) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Aget_name second attribute failed");
+ H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "H5Aget_name second attribute failed");
- H5TOOLS_DEBUG(H5E_tools_min_dbg_id_g, "H5R_ATTR diff_attr_data - name1=%s, name2=%s", name1, name2);
+ H5TOOLS_DEBUG("H5R_ATTR diff_attr_data - name1=%s, name2=%s", name1, name2);
nfound = diff_attr_data(obj1_id, obj2_id, name1, name2, NULL, NULL, opts);
}
if(obj1_id >= 0)
- if(H5Aclose(obj1_id) < 0)
- H5TOOLS_INFO(H5E_tools_g, H5E_tools_min_id_g, "H5Aclose H5R_ATTR failed");
+ if(H5Aclose(obj1_id) < 0) {
+ opts->err_stat = H5DIFF_ERR;
+ H5TOOLS_INFO("H5Aclose H5R_ATTR failed");
+ }
if(obj2_id >= 0)
- if(H5Aclose(obj2_id) < 0)
- H5TOOLS_INFO(H5E_tools_g, H5E_tools_min_id_g, "H5Aclose H5R_ATTR failed");
+ if(H5Aclose(obj2_id) < 0) {
+ opts->err_stat = H5DIFF_ERR;
+ H5TOOLS_INFO("H5Aclose H5R_ATTR failed");
+ }
if(H5Rdestroy(ref2_buf) < 0)
- H5TOOLS_ERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Rdestroy H5R_ATTR failed");
+ H5TOOLS_ERROR(H5DIFF_ERR, "H5Rdestroy H5R_ATTR failed");
if(H5Rdestroy(ref1_buf) < 0)
- H5TOOLS_ERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Rdestroy H5R_ATTR failed");
+ H5TOOLS_ERROR(H5DIFF_ERR, "H5Rdestroy H5R_ATTR failed");
}
break;
case H5R_BADTYPE:
@@ -1003,7 +1015,7 @@ static hsize_t diff_datum(
default:
break;
} /* end switch */
- H5TOOLS_DEBUG(H5E_tools_min_dbg_id_g, "diff_datum H5T_REFERENCE - H5T_STD_REF complete nfound:%d - errstat:%d", nfound, opts->err_stat);
+ H5TOOLS_DEBUG("diff_datum H5T_REFERENCE - H5T_STD_REF complete nfound:%d - errstat:%d", nfound, opts->err_stat);
}
/*-------------------------------------------------------------------------
* H5T_STD_REF_DSETREG
@@ -1012,26 +1024,26 @@ static hsize_t diff_datum(
*/
else if (H5Tequal(m_type, H5T_STD_REF_DSETREG)) {
/* if (type_size == H5R_DSET_REG_REF_BUF_SIZE) */
- hid_t region1_id = -1;
- hid_t region2_id = -1;
+ hid_t region1_id = H5I_INVALID_HID;
+ hid_t region2_id = H5I_INVALID_HID;
- H5TOOLS_INFO(H5E_tools_min_info_id_g, "H5T_STD_REF_DSETREG reference type");
+ H5TOOLS_INFO("H5T_STD_REF_DSETREG reference type");
if ((obj1_id = H5Rdereference2(container1_id, H5P_DEFAULT, H5R_DATASET_REGION, _mem1)) < 0) {
- opts->err_stat = 1;
- H5TOOLS_INFO(H5E_tools_min_id_g, "H5Rdereference2 object 1 failed");
+ opts->err_stat = H5DIFF_ERR;
+ H5TOOLS_INFO("H5Rdereference2 object 1 failed");
}
if ((obj2_id = H5Rdereference2(container2_id, H5P_DEFAULT, H5R_DATASET_REGION, _mem2)) < 0) {
- opts->err_stat = 1;
- H5TOOLS_INFO(H5E_tools_min_id_g, "H5Rdereference2 object 2 failed");
+ opts->err_stat = H5DIFF_ERR;
+ H5TOOLS_INFO("H5Rdereference2 object 2 failed");
}
if ((region1_id = H5Rget_region(container1_id, H5R_DATASET_REGION, _mem1)) < 0) {
- opts->err_stat = 1;
- H5TOOLS_INFO(H5E_tools_min_id_g, "H5Rget_region object 1 failed");
+ opts->err_stat = H5DIFF_ERR;
+ H5TOOLS_INFO("H5Rget_region object 1 failed");
}
if ((region2_id = H5Rget_region(container2_id, H5R_DATASET_REGION, _mem2)) < 0) {
- opts->err_stat = 1;
- H5TOOLS_INFO(H5E_tools_min_id_g, "H5Rget_region object 2 failed");
+ opts->err_stat = H5DIFF_ERR;
+ H5TOOLS_INFO("H5Rget_region object 2 failed");
}
nfound = diff_region(obj1_id, obj2_id, region1_id, region2_id, opts);
@@ -1052,31 +1064,31 @@ static hsize_t diff_datum(
H5O_type_t obj1_type;
H5O_type_t obj2_type;
- H5TOOLS_INFO(H5E_tools_min_info_id_g, "H5T_STD_REF_OBJ reference type");
+ H5TOOLS_INFO("H5T_STD_REF_OBJ reference type");
if (H5Rget_obj_type2(container1_id, H5R_OBJECT, _mem1, &obj1_type) < 0) {
- opts->err_stat = 1;
- H5TOOLS_INFO(H5E_tools_min_id_g, "H5Rget_obj_type2 object 1 failed");
+ opts->err_stat = H5DIFF_ERR;
+ H5TOOLS_INFO("H5Rget_obj_type2 object 1 failed");
}
if (H5Rget_obj_type2(container2_id, H5R_OBJECT, _mem2, &obj2_type) < 0) {
- opts->err_stat = 1;
- H5TOOLS_INFO(H5E_tools_min_id_g, "H5Rget_obj_type2 object 2 failed");
+ opts->err_stat = H5DIFF_ERR;
+ H5TOOLS_INFO("H5Rget_obj_type2 object 2 failed");
}
/* check object type */
if (obj1_type != obj2_type) {
parallel_print("Different object types referenced: <%s> and <%s>", obj1, obj2);
opts->not_cmp = 1;
- HGOTO_DONE (opts->err_stat);
+ H5TOOLS_GOTO_DONE(opts->err_stat);
}
if ((obj1_id = H5Rdereference2(container1_id, H5P_DEFAULT, H5R_OBJECT, _mem1)) < 0) {
- opts->err_stat = 1;
- H5TOOLS_INFO(H5E_tools_min_id_g, "H5Rdereference2 object 1 failed");
+ opts->err_stat = H5DIFF_ERR;
+ H5TOOLS_INFO("H5Rdereference2 object 1 failed");
}
if ((obj2_id = H5Rdereference2(container2_id, H5P_DEFAULT, H5R_OBJECT, _mem2)) < 0) {
- opts->err_stat = 1;
- H5TOOLS_INFO(H5E_tools_min_id_g, "H5Rdereference2 object 2 failed");
+ opts->err_stat = H5DIFF_ERR;
+ H5TOOLS_INFO("H5Rdereference2 object 2 failed");
}
/* compare */
@@ -1092,7 +1104,7 @@ static hsize_t diff_datum(
H5Oclose(obj2_id);
}/*object reference*/
}/*is zero*/
- H5TOOLS_DEBUG(H5E_tools_min_dbg_id_g, "diff_datum H5T_REFERENCE complete");
+ H5TOOLS_DEBUG("diff_datum H5T_REFERENCE complete");
break;
/*-------------------------------------------------------------------------
@@ -1101,9 +1113,9 @@ static hsize_t diff_datum(
*/
case H5T_VLEN:
{
- hid_t memb_type = -1;
+ hid_t memb_type = H5I_INVALID_HID;
- H5TOOLS_DEBUG(H5E_tools_min_dbg_id_g, "diff_datum H5T_VLEN");
+ H5TOOLS_DEBUG("diff_datum H5T_VLEN");
/* get the VL sequences's base datatype for each element */
memb_type = H5Tget_super(m_type);
size = H5Tget_size(memb_type);
@@ -1124,7 +1136,7 @@ static hsize_t diff_datum(
*-------------------------------------------------------------------------
*/
case H5T_INTEGER:
- H5TOOLS_DEBUG(H5E_tools_min_dbg_id_g, "diff_datum H5T_INTEGER");
+ H5TOOLS_DEBUG("diff_datum H5T_INTEGER");
type_sign = H5Tget_sign(m_type);
/*-------------------------------------------------------------------------
* H5T_NATIVE_SCHAR
@@ -1135,7 +1147,7 @@ static hsize_t diff_datum(
char temp2_char;
if(type_size != sizeof(char))
- H5TOOLS_GOTO_ERROR(1, H5E_tools_min_id_g, "Type size is not char size");
+ H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "Type size is not char size");
HDmemcpy(&temp1_char, mem1, sizeof(char));
HDmemcpy(&temp2_char, mem2, sizeof(char));
/* -d and !-p */
@@ -1210,7 +1222,7 @@ static hsize_t diff_datum(
unsigned char temp2_uchar;
if(type_size != sizeof(unsigned char))
- H5TOOLS_GOTO_ERROR(1, H5E_tools_min_id_g, "Type size is not unsigned char size");
+ H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "Type size is not unsigned char size");
HDmemcpy(&temp1_uchar, mem1, sizeof(unsigned char));
HDmemcpy(&temp2_uchar, mem2, sizeof(unsigned char));
@@ -1286,7 +1298,7 @@ static hsize_t diff_datum(
short temp2_short;
if(type_size != sizeof(short))
- H5TOOLS_GOTO_ERROR(1, H5E_tools_min_id_g, "Type size is not short size");
+ H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "Type size is not short size");
HDmemcpy(&temp1_short, mem1, sizeof(short));
HDmemcpy(&temp2_short, mem2, sizeof(short));
@@ -1362,7 +1374,7 @@ static hsize_t diff_datum(
unsigned short temp2_ushort;
if(type_size != sizeof(unsigned short))
- H5TOOLS_GOTO_ERROR(1, H5E_tools_min_id_g, "Type size is not unsigned short size");
+ H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "Type size is not unsigned short size");
HDmemcpy(&temp1_ushort, mem1, sizeof(unsigned short));
HDmemcpy(&temp2_ushort, mem2, sizeof(unsigned short));
@@ -1438,7 +1450,7 @@ static hsize_t diff_datum(
int temp2_int;
if(type_size != sizeof(int))
- H5TOOLS_GOTO_ERROR(1, H5E_tools_min_id_g, "Type size is not int size");
+ H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "Type size is not int size");
HDmemcpy(&temp1_int, mem1, sizeof(int));
HDmemcpy(&temp2_int, mem2, sizeof(int));
@@ -1514,7 +1526,7 @@ static hsize_t diff_datum(
unsigned int temp2_uint;
if(type_size != sizeof(unsigned int))
- H5TOOLS_GOTO_ERROR(1, H5E_tools_min_id_g, "Type size is not unsigned int size");
+ H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "Type size is not unsigned int size");
HDmemcpy(&temp1_uint, mem1, sizeof(unsigned int));
HDmemcpy(&temp2_uint, mem2, sizeof(unsigned int));
@@ -1590,7 +1602,7 @@ static hsize_t diff_datum(
long temp2_long;
if(type_size != sizeof(long))
- H5TOOLS_GOTO_ERROR(1, H5E_tools_min_id_g, "Type size is not long size");
+ H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "Type size is not long size");
HDmemcpy(&temp1_long, mem1, sizeof(long));
HDmemcpy(&temp2_long, mem2, sizeof(long));
@@ -1666,7 +1678,7 @@ static hsize_t diff_datum(
unsigned long temp2_ulong;
if(type_size != sizeof(unsigned long))
- H5TOOLS_GOTO_ERROR(1, H5E_tools_min_id_g, "Type size is not unsigned long size");
+ H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "Type size is not unsigned long size");
HDmemcpy(&temp1_ulong, mem1, sizeof(unsigned long));
HDmemcpy(&temp2_ulong, mem2, sizeof(unsigned long));
@@ -1743,7 +1755,7 @@ static hsize_t diff_datum(
* H5T_NATIVE_FLOAT
*-------------------------------------------------------------------------
*/
- H5TOOLS_DEBUG(H5E_tools_min_dbg_id_g, "diff_datum H5T_FLOAT");
+ H5TOOLS_DEBUG("diff_datum H5T_FLOAT");
if (type_size == 4) {
float temp1_float;
float temp2_float;
@@ -1751,7 +1763,7 @@ static hsize_t diff_datum(
hbool_t isnan2 = FALSE;
if(type_size != sizeof(float))
- H5TOOLS_GOTO_ERROR(1, H5E_tools_min_id_g, "Type size is not float size");
+ H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "Type size is not float size");
HDmemcpy(&temp1_float, mem1, sizeof(float));
HDmemcpy(&temp2_float, mem2, sizeof(float));
@@ -1910,7 +1922,7 @@ static hsize_t diff_datum(
hbool_t isnan2 = FALSE;
if(type_size != sizeof(double))
- H5TOOLS_GOTO_ERROR(1, H5E_tools_min_id_g, "Type size is not double size");
+ H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "Type size is not double size");
HDmemcpy(&temp1_double, mem1, sizeof(double));
HDmemcpy(&temp2_double, mem2, sizeof(double));
@@ -2069,7 +2081,7 @@ static hsize_t diff_datum(
hbool_t isnan2 = FALSE;
if(type_size != sizeof(long double)) {
- H5TOOLS_GOTO_ERROR(1, H5E_tools_min_id_g, "Type size is not long double size");
+ H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "Type size is not long double size");
}
HDmemcpy(&temp1_double, mem1, sizeof(long double));
@@ -2224,10 +2236,9 @@ static hsize_t diff_datum(
done:
opts->err_stat = opts->err_stat | ret_value;
- H5TOOLS_DEBUG(H5E_tools_min_dbg_id_g, "diff_datum finish:%d - errstat:%d", nfound, opts->err_stat);
+ H5TOOLS_DEBUG("diff_datum finish:%d - errstat:%d", nfound, opts->err_stat);
- H5TOOLS_ENDDEBUG(H5E_tools_min_dbg_id_g, "exit");
- H5TOOLS_POP_STACK();
+ H5TOOLS_ENDDEBUG("exit");
return nfound;
}
@@ -2304,7 +2315,6 @@ void print_points(int i, hsize_t *ptdata, int ndims) {
static hsize_t diff_region(hid_t obj1_id, hid_t obj2_id, hid_t region1_id, hid_t region2_id, diff_opt_t *opts)
{
- H5TOOLS_ERR_INIT(hsize_t, 0)
hssize_t nblocks1, npoints1;
hssize_t nblocks2, npoints2;
hsize_t alloc_size;
@@ -2315,9 +2325,9 @@ static hsize_t diff_region(hid_t obj1_id, hid_t obj2_id, hid_t region1_id, hid_t
int i, j;
hsize_t nfound_b = 0; /* block differences found */
hsize_t nfound_p = 0; /* point differences found */
+ hsize_t ret_value = 0;
- H5TOOLS_PUSH_STACK();
- H5TOOLS_DEBUG(H5E_tools_min_dbg_id_g, "diff_region start");
+ H5TOOLS_DEBUG("diff_region start");
ndims1 = H5Sget_simple_extent_ndims(region1_id);
ndims2 = H5Sget_simple_extent_ndims(region2_id);
@@ -2334,12 +2344,12 @@ static hsize_t diff_region(hid_t obj1_id, hid_t obj2_id, hid_t region1_id, hid_t
npoints1 = H5Sget_select_elem_npoints(region1_id);
npoints2 = H5Sget_select_elem_npoints(region2_id);
} H5E_END_TRY;
- H5TOOLS_DEBUG(H5E_tools_min_dbg_id_g, "diff_region blocks: 1=%ld-2=%ld", nblocks1, nblocks2);
- H5TOOLS_DEBUG(H5E_tools_min_dbg_id_g, "diff_region points: 1=%ld-2=%ld", npoints1, npoints2);
+ H5TOOLS_DEBUG("diff_region blocks: 1=%ld-2=%ld", nblocks1, nblocks2);
+ H5TOOLS_DEBUG("diff_region points: 1=%ld-2=%ld", npoints1, npoints2);
if (nblocks1 != nblocks2 || npoints1 != npoints2 || ndims1 != ndims2) {
opts->not_cmp = 1;
- HGOTO_DONE (0);
+ H5TOOLS_GOTO_DONE(0);
}
/*-------------------------------------------------------------------------
@@ -2347,22 +2357,22 @@ static hsize_t diff_region(hid_t obj1_id, hid_t obj2_id, hid_t region1_id, hid_t
*-------------------------------------------------------------------------
*/
if (nblocks1 > 0) {
- H5TOOLS_DEBUG(H5E_tools_min_dbg_id_g, "region compare blocks");
+ H5TOOLS_DEBUG("region compare blocks");
HDassert(ndims1 > 0);
alloc_size = (hsize_t) nblocks1 * (unsigned) ndims1 * 2 * sizeof(ptdata1[0]);
HDassert(alloc_size == (hsize_t)((size_t )alloc_size)); /*check for overflow*/
if((ptdata1 = (hsize_t *) HDmalloc((size_t )alloc_size)) == NULL) {
- opts->err_stat = 1;
- H5TOOLS_INFO(H5E_tools_min_id_g, "Buffer allocation failed");
+ opts->err_stat = H5DIFF_ERR;
+ H5TOOLS_INFO("Buffer allocation failed");
}
else {
H5_CHECK_OVERFLOW(nblocks1, hssize_t, hsize_t);
H5Sget_select_hyper_blocklist(region1_id, (hsize_t) 0, (hsize_t) nblocks1, ptdata1);
if((ptdata2 = (hsize_t *) HDmalloc((size_t )alloc_size)) == NULL) {
- opts->err_stat = 1;
- H5TOOLS_INFO(H5E_tools_min_id_g, "Buffer allocation failed");
+ opts->err_stat = H5DIFF_ERR;
+ H5TOOLS_INFO("Buffer allocation failed");
}
else {
H5_CHECK_OVERFLOW(nblocks2, hssize_t, hsize_t);
@@ -2412,21 +2422,21 @@ static hsize_t diff_region(hid_t obj1_id, hid_t obj2_id, hid_t region1_id, hid_t
*-------------------------------------------------------------------------
*/
if (npoints1 > 0) {
- H5TOOLS_DEBUG(H5E_tools_min_dbg_id_g, "region compare points");
+ H5TOOLS_DEBUG("region compare points");
alloc_size = (hsize_t) npoints1 * (unsigned) ndims1 * sizeof(ptdata1[0]);
HDassert(alloc_size == (hsize_t)((size_t )alloc_size)); /*check for overflow*/
if((ptdata1 = (hsize_t *) HDmalloc((size_t )alloc_size)) == NULL) {
- opts->err_stat = 1;
- H5TOOLS_INFO(H5E_tools_min_id_g, "Buffer allocation failed");
+ opts->err_stat = H5DIFF_ERR;
+ H5TOOLS_INFO("Buffer allocation failed");
}
else {
H5_CHECK_OVERFLOW(npoints1, hssize_t, hsize_t);
H5Sget_select_elem_pointlist(region1_id, (hsize_t) 0, (hsize_t) npoints1, ptdata1);
if((ptdata2 = (hsize_t *) HDmalloc((size_t )alloc_size)) == NULL) {
- opts->err_stat = 1;
- H5TOOLS_INFO(H5E_tools_min_id_g, "Buffer allocation failed");
+ opts->err_stat = H5DIFF_ERR;
+ H5TOOLS_INFO("Buffer allocation failed");
}
else {
H5_CHECK_OVERFLOW(npoints1, hssize_t, hsize_t);
@@ -2490,8 +2500,7 @@ static hsize_t diff_region(hid_t obj1_id, hid_t obj2_id, hid_t region1_id, hid_t
ret_value = nfound_p + nfound_b;
done:
- H5TOOLS_ENDDEBUG(H5E_tools_min_dbg_id_g, "exit with diffs:%d", ret_value);
- H5TOOLS_POP_STACK();
+ H5TOOLS_ENDDEBUG("exit with diffs:%d", ret_value);
return ret_value;
}
@@ -2507,15 +2516,13 @@ done:
static hsize_t character_compare(char *mem1, char *mem2, hsize_t i, size_t u,
int rank, hsize_t *dims, hsize_t *acc, hsize_t *pos, diff_opt_t *opts, const char *obj1, const char *obj2, int *ph)
{
- H5TOOLS_ERR_INIT(int, 0)
hsize_t nfound = 0; /* differences found */
char temp1_uchar;
char temp2_uchar;
- H5TOOLS_PUSH_STACK();
HDmemcpy(&temp1_uchar, mem1, sizeof(unsigned char));
HDmemcpy(&temp2_uchar, mem2, sizeof(unsigned char));
- H5TOOLS_DEBUG(H5E_tools_min_dbg_id_g, "character_compare start %d=%d",temp1_uchar,temp2_uchar);
+ H5TOOLS_DEBUG("character_compare start %d=%d",temp1_uchar,temp2_uchar);
if (temp1_uchar != temp2_uchar) {
if (print_data(opts)) {
@@ -2528,10 +2535,9 @@ static hsize_t character_compare(char *mem1, char *mem2, hsize_t i, size_t u,
}
nfound++;
}
- H5TOOLS_DEBUG(H5E_tools_min_dbg_id_g, "character_compare finish");
+ H5TOOLS_DEBUG("character_compare finish");
- H5TOOLS_ENDDEBUG(H5E_tools_min_dbg_id_g, "exit: %d", nfound);
- H5TOOLS_POP_STACK();
+ H5TOOLS_ENDDEBUG("exit: %d", nfound);
return nfound;
}
@@ -4503,27 +4509,26 @@ static hsize_t diff_ullong(unsigned char *mem1, unsigned char *mem2,
static
int ull2float(unsigned long long ull_value, float *f_value)
{
- H5TOOLS_ERR_INIT(int, SUCCEED)
- hid_t dxpl_id = -1;
+ hid_t dxpl_id = H5I_INVALID_HID;
unsigned char *buf = NULL;
size_t src_size;
size_t dst_size;
+ int ret_value = 0;
- H5TOOLS_PUSH_STACK();
- H5TOOLS_DEBUG(H5E_tools_min_dbg_id_g, "ull2float start");
+ H5TOOLS_DEBUG("ull2float start");
if ((dxpl_id = H5Pcreate(H5P_DATASET_XFER)) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pcreate failed");
+ H5TOOLS_GOTO_ERROR(FAIL, "H5Pcreate failed");
src_size = H5Tget_size(H5T_NATIVE_ULLONG);
dst_size = H5Tget_size(H5T_NATIVE_FLOAT);
if((buf = (unsigned char*) HDcalloc((size_t )1, MAX(src_size, dst_size))) == NULL)
- H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "Could not allocate buffer for dims");
+ H5TOOLS_GOTO_ERROR(FAIL, "Could not allocate buffer for dims");
HDmemcpy(buf, &ull_value, src_size);
/* do conversion */
if (H5Tconvert(H5T_NATIVE_ULLONG, H5T_NATIVE_FLOAT, (size_t) 1, buf, NULL, dxpl_id) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tconvert failed");
+ H5TOOLS_GOTO_ERROR(FAIL, "H5Tconvert failed");
HDmemcpy(f_value, buf, dst_size);
@@ -4535,10 +4540,9 @@ done:
if (buf)
HDfree(buf);
- H5TOOLS_DEBUG(H5E_tools_min_dbg_id_g, "ull2float finish");
+ H5TOOLS_DEBUG("ull2float finish");
- H5TOOLS_ENDDEBUG(H5E_tools_min_dbg_id_g, "exit");
- H5TOOLS_POP_STACK();
+ H5TOOLS_ENDDEBUG("exit");
return ret_value;
}