summaryrefslogtreecommitdiffstats
path: root/tools/lib/h5diff_dset.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/lib/h5diff_dset.c')
-rw-r--r--tools/lib/h5diff_dset.c50
1 files changed, 37 insertions, 13 deletions
diff --git a/tools/lib/h5diff_dset.c b/tools/lib/h5diff_dset.c
index 9d0462d..af6a171 100644
--- a/tools/lib/h5diff_dset.c
+++ b/tools/lib/h5diff_dset.c
@@ -192,7 +192,8 @@ hsize_t diff_datasetid(hid_t did1,
hid_t sm_space = -1; /*stripmine data space */
size_t need; /* bytes needed for malloc */
int i;
- unsigned int vl_data = 0; /*contains VL datatypes */
+ unsigned int vl_data1 = 0; /*contains VL datatypes */
+ unsigned int vl_data2 = 0; /*contains VL datatypes */
h5difftrace("diff_datasetid start\n");
/* Get the dataspace handle */
@@ -314,7 +315,9 @@ hsize_t diff_datasetid(hid_t did1,
* VLEN memory buffer later
*/
if(TRUE == h5tools_detect_vlen(m_tid1))
- vl_data = TRUE;
+ vl_data1 = TRUE;
+ if(TRUE == h5tools_detect_vlen(m_tid2))
+ vl_data2 = TRUE;
h5diffdebug2("h5tools_detect_vlen - errstat:%d\n", opts->err_stat);
/*------------------------------------------------------------------------
@@ -405,11 +408,12 @@ hsize_t diff_datasetid(hid_t did1,
h5diffdebug2("diff_array nfound:%d\n", nfound);
/* reclaim any VL memory, if necessary */
- if(vl_data) {
- h5difftrace("check vl_data\n");
+ h5diffdebug2("check vl_data1:%d\n", vl_data1);
+ if(vl_data1)
H5Dvlen_reclaim(m_tid1, sid1, H5P_DEFAULT, buf1);
+ h5diffdebug2("check vl_data2:%d\n", vl_data2);
+ if(vl_data2)
H5Dvlen_reclaim(m_tid2, sid2, H5P_DEFAULT, buf2);
- } /* end if */
if(buf1 != NULL) {
HDfree(buf1);
buf1 = NULL;
@@ -499,10 +503,10 @@ hsize_t diff_datasetid(hid_t did1,
dadims, opts, name1, name2, dam_tid, did1, did2);
/* reclaim any VL memory, if necessary */
- if(vl_data) {
+ if(vl_data1)
H5Dvlen_reclaim(m_tid1, sm_space, H5P_DEFAULT, sm_buf1);
- H5Dvlen_reclaim(m_tid1, sm_space, H5P_DEFAULT, sm_buf2);
- } /* end if */
+ if(vl_data2)
+ H5Dvlen_reclaim(m_tid2, sm_space, H5P_DEFAULT, sm_buf2);
/* calculate the next hyperslab offset */
for(i = rank1, carry = 1; i > 0 && carry; --i) {
@@ -539,29 +543,29 @@ done:
/* free */
if(buf1 != NULL) {
/* reclaim any VL memory, if necessary */
- if(vl_data)
+ if(vl_data1)
H5Dvlen_reclaim(m_tid1, sid1, H5P_DEFAULT, buf1);
HDfree(buf1);
buf1 = NULL;
}
if(buf2 != NULL) {
/* reclaim any VL memory, if necessary */
- if(vl_data)
+ if(vl_data2)
H5Dvlen_reclaim(m_tid2, sid2, H5P_DEFAULT, buf2);
HDfree(buf2);
buf2 = NULL;
}
if(sm_buf1 != NULL) {
/* reclaim any VL memory, if necessary */
- if(vl_data)
+ if(vl_data1)
H5Dvlen_reclaim(m_tid1, sm_space, H5P_DEFAULT, sm_buf1);
HDfree(sm_buf1);
sm_buf1 = NULL;
}
if(sm_buf2 != NULL) {
/* reclaim any VL memory, if necessary */
- if(vl_data)
- H5Dvlen_reclaim(m_tid1, sm_space, H5P_DEFAULT, sm_buf2);
+ if(vl_data2)
+ H5Dvlen_reclaim(m_tid2, sm_space, H5P_DEFAULT, sm_buf2);
HDfree(sm_buf2);
sm_buf2 = NULL;
}
@@ -570,6 +574,7 @@ done:
H5E_BEGIN_TRY {
H5Sclose(sid1);
H5Sclose(sid2);
+ H5Sclose(sm_space);
H5Tclose(f_tid1);
H5Tclose(f_tid2);
H5Tclose(m_tid1);
@@ -761,12 +766,31 @@ int diff_can_type(hid_t f_tid1, /* file data type */
}
}
+ if(tclass1 == H5T_STRING) {
+ htri_t vstrtype1 = -1;
+ htri_t vstrtype2 = -1;
+ h5difftrace("diff_can_type end - H5T_STRING\n");
+
+ vstrtype1 = H5Tis_variable_str(f_tid1);
+ vstrtype2 = H5Tis_variable_str(f_tid2);
+
+ /* no compare if either one but not both are variable string type */
+ if (vstrtype1 != vstrtype2) {
+ if((opts->m_verbose || opts->m_list_not_cmp) && obj1_name && obj2_name)
+ parallel_print("Not comparable: <%s> or <%s> is of mixed string type\n",
+ obj1_name, obj2_name);
+ opts->not_cmp = 1;
+ HGOTO_DONE(0);
+ }
+ }
+
if(tclass1 == H5T_COMPOUND) {
int nmembs1;
int nmembs2;
int j;
hid_t memb_type1 = -1;
hid_t memb_type2 = -1;
+ h5difftrace("diff_can_type end - H5T_COMPOUND\n");
nmembs1 = H5Tget_nmembers(f_tid1);
nmembs2 = H5Tget_nmembers(f_tid2);