Refactor tools library error handling macros
This commit is contained in:
committed by
David Young
parent
4f86f43b60
commit
d4aa380dd1
@@ -289,7 +289,7 @@ hsize_t diff_array(
|
||||
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 +314,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 +375,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,9 +384,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_ENDDEBUG("exit: %d", nfound);
|
||||
H5TOOLS_POP_STACK();
|
||||
return nfound;
|
||||
}
|
||||
@@ -460,7 +460,7 @@ static hsize_t diff_datum(
|
||||
hbool_t both_zero;
|
||||
|
||||
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 +474,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(1, "Invalid type class");
|
||||
break;
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
@@ -489,7 +489,7 @@ 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;
|
||||
nmembs = members->n;
|
||||
@@ -509,7 +509,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 +523,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 +539,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 +576,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 +616,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 +627,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 +643,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];
|
||||
@@ -706,7 +706,7 @@ static hsize_t diff_datum(
|
||||
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,12 +730,12 @@ 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;
|
||||
@@ -756,34 +756,34 @@ static hsize_t diff_datum(
|
||||
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 +803,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(1, "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(1, "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(1, "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(1, "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(1, "H5Oclose H5R_DATASET_REGION1 failed");
|
||||
}
|
||||
else {
|
||||
H5TOOLS_ERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Ropen_object H5R_DATASET_REGION1 failed");
|
||||
H5TOOLS_ERROR(1, "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(1, "H5Oclose H5R_DATASET_REGION1 failed");
|
||||
}
|
||||
else {
|
||||
H5TOOLS_ERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Ropen_object H5R_DATASET_REGION1 failed");
|
||||
H5TOOLS_ERROR(1, "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(1, "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(1, "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 +904,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(1, "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(1, "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_ERROR(opts->err_stat, "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(1, "H5Sclose H5R_DATASET_REGION2 failed");
|
||||
}
|
||||
else
|
||||
H5TOOLS_ERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Ropen_region H5R_DATASET_REGION2 failed");
|
||||
H5TOOLS_ERROR(1, "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(1, "H5Sclose H5R_DATASET_REGION2 failed");
|
||||
}
|
||||
else
|
||||
H5TOOLS_ERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Ropen_region H5R_DATASET_REGION2 failed");
|
||||
H5TOOLS_ERROR(1, "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(1, "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(1, "H5Rdestroy H5R_DATASET_REGION2 failed");
|
||||
}
|
||||
break;
|
||||
case H5R_ATTR:
|
||||
@@ -961,41 +973,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_ERROR(opts->err_stat, "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(FAIL, "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(FAIL, "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(1, "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(1, "H5Rdestroy H5R_ATTR failed");
|
||||
}
|
||||
break;
|
||||
case H5R_BADTYPE:
|
||||
@@ -1003,7 +1019,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
|
||||
@@ -1015,23 +1031,23 @@ static hsize_t diff_datum(
|
||||
hid_t region1_id = -1;
|
||||
hid_t region2_id = -1;
|
||||
|
||||
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 +1068,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 +1108,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;
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
@@ -1103,7 +1119,7 @@ static hsize_t diff_datum(
|
||||
{
|
||||
hid_t memb_type = -1;
|
||||
|
||||
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 +1140,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 +1151,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(1, "Type size is not char size");
|
||||
HDmemcpy(&temp1_char, mem1, sizeof(char));
|
||||
HDmemcpy(&temp2_char, mem2, sizeof(char));
|
||||
/* -d and !-p */
|
||||
@@ -1210,7 +1226,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(1, "Type size is not unsigned char size");
|
||||
|
||||
HDmemcpy(&temp1_uchar, mem1, sizeof(unsigned char));
|
||||
HDmemcpy(&temp2_uchar, mem2, sizeof(unsigned char));
|
||||
@@ -1286,7 +1302,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(1, "Type size is not short size");
|
||||
|
||||
HDmemcpy(&temp1_short, mem1, sizeof(short));
|
||||
HDmemcpy(&temp2_short, mem2, sizeof(short));
|
||||
@@ -1362,7 +1378,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(1, "Type size is not unsigned short size");
|
||||
|
||||
HDmemcpy(&temp1_ushort, mem1, sizeof(unsigned short));
|
||||
HDmemcpy(&temp2_ushort, mem2, sizeof(unsigned short));
|
||||
@@ -1438,7 +1454,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(1, "Type size is not int size");
|
||||
|
||||
HDmemcpy(&temp1_int, mem1, sizeof(int));
|
||||
HDmemcpy(&temp2_int, mem2, sizeof(int));
|
||||
@@ -1514,7 +1530,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(1, "Type size is not unsigned int size");
|
||||
|
||||
HDmemcpy(&temp1_uint, mem1, sizeof(unsigned int));
|
||||
HDmemcpy(&temp2_uint, mem2, sizeof(unsigned int));
|
||||
@@ -1590,7 +1606,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(1, "Type size is not long size");
|
||||
|
||||
HDmemcpy(&temp1_long, mem1, sizeof(long));
|
||||
HDmemcpy(&temp2_long, mem2, sizeof(long));
|
||||
@@ -1666,7 +1682,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(1, "Type size is not unsigned long size");
|
||||
|
||||
HDmemcpy(&temp1_ulong, mem1, sizeof(unsigned long));
|
||||
HDmemcpy(&temp2_ulong, mem2, sizeof(unsigned long));
|
||||
@@ -1743,7 +1759,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 +1767,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(1, "Type size is not float size");
|
||||
|
||||
HDmemcpy(&temp1_float, mem1, sizeof(float));
|
||||
HDmemcpy(&temp2_float, mem2, sizeof(float));
|
||||
@@ -1910,7 +1926,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(1, "Type size is not double size");
|
||||
|
||||
HDmemcpy(&temp1_double, mem1, sizeof(double));
|
||||
HDmemcpy(&temp2_double, mem2, sizeof(double));
|
||||
@@ -2069,7 +2085,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(1, "Type size is not long double size");
|
||||
}
|
||||
|
||||
HDmemcpy(&temp1_double, mem1, sizeof(long double));
|
||||
@@ -2224,9 +2240,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_ENDDEBUG("exit");
|
||||
H5TOOLS_POP_STACK();
|
||||
return nfound;
|
||||
}
|
||||
@@ -2317,7 +2333,7 @@ static hsize_t diff_region(hid_t obj1_id, hid_t obj2_id, hid_t region1_id, hid_t
|
||||
hsize_t nfound_p = 0; /* point differences found */
|
||||
|
||||
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 +2350,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 +2363,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_GOTO_ERROR(opts->err_stat, "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_GOTO_ERROR(opts->err_stat, "Buffer allocation failed");
|
||||
}
|
||||
else {
|
||||
H5_CHECK_OVERFLOW(nblocks2, hssize_t, hsize_t);
|
||||
@@ -2412,21 +2428,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_GOTO_ERROR(opts->err_stat, "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_GOTO_ERROR(opts->err_stat, "Buffer allocation failed");
|
||||
}
|
||||
else {
|
||||
H5_CHECK_OVERFLOW(npoints1, hssize_t, hsize_t);
|
||||
@@ -2490,7 +2506,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_ENDDEBUG("exit with diffs:%d", ret_value);
|
||||
H5TOOLS_POP_STACK();
|
||||
return ret_value;
|
||||
}
|
||||
@@ -2515,7 +2531,7 @@ static hsize_t character_compare(char *mem1, char *mem2, hsize_t i, size_t u,
|
||||
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,9 +2544,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_ENDDEBUG("exit: %d", nfound);
|
||||
H5TOOLS_POP_STACK();
|
||||
return nfound;
|
||||
}
|
||||
@@ -4510,20 +4526,20 @@ int ull2float(unsigned long long ull_value, float *f_value)
|
||||
size_t dst_size;
|
||||
|
||||
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,9 +4551,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_ENDDEBUG("exit");
|
||||
H5TOOLS_POP_STACK();
|
||||
return ret_value;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user