summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2016-04-08 17:43:59 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2016-04-08 17:43:59 (GMT)
commit1a5ee65d50787b8c363b0e54c47847361e1f62b6 (patch)
treee127e78d3f639edaa1ac3f17691a0b08e6519b23 /tools
parentc575abdeff8d70335e0621e0959565e3083d9cc2 (diff)
downloadhdf5-1a5ee65d50787b8c363b0e54c47847361e1f62b6.zip
hdf5-1a5ee65d50787b8c363b0e54c47847361e1f62b6.tar.gz
hdf5-1a5ee65d50787b8c363b0e54c47847361e1f62b6.tar.bz2
[svn-r29672] HDFFV-1956: h5diff will warn if a dataset is virtual instead of failing. h5diff does not consider the layout type when comparing datasets.
Diffstat (limited to 'tools')
-rw-r--r--tools/h5diff/testfiles/h5diff_v1.txt2
-rw-r--r--tools/h5diff/testfiles/h5diff_v3.txt2
-rw-r--r--tools/lib/h5diff_dset.c41
3 files changed, 35 insertions, 10 deletions
diff --git a/tools/h5diff/testfiles/h5diff_v1.txt b/tools/h5diff/testfiles/h5diff_v1.txt
index 31a3eae..8210cf9 100644
--- a/tools/h5diff/testfiles/h5diff_v1.txt
+++ b/tools/h5diff/testfiles/h5diff_v1.txt
@@ -7,7 +7,7 @@ file1 file2
group : </> and </>
0 differences found
dataset: </vds_dset> and </vds_dset>
-Not comparable: </vds_dset> or </vds_dset> is an empty dataset
+Warning: </vds_dset> or </vds_dset> is a virtual dataset
Not comparable: </vds_dset> has rank 3, dimensions [5x18x8], max dimensions [18446744073709551615x18x8]
and </vds_dset> has rank 3, dimensions [6x8x14], max dimensions [18446744073709551615x8x14]
0 differences found
diff --git a/tools/h5diff/testfiles/h5diff_v3.txt b/tools/h5diff/testfiles/h5diff_v3.txt
index 8c5d2a2..57af303 100644
--- a/tools/h5diff/testfiles/h5diff_v3.txt
+++ b/tools/h5diff/testfiles/h5diff_v3.txt
@@ -1,4 +1,4 @@
-Not comparable: </vds_dset> or </vds_dset> is an empty dataset
+Warning: </vds_dset> or </vds_dset> is a virtual dataset
Not comparable: </vds_dset> has rank 3, dimensions [5x18x8], max dimensions [18446744073709551615x18x8]
and </vds_dset> has rank 3, dimensions [6x8x14], max dimensions [18446744073709551615x8x14]
EXIT CODE: 0
diff --git a/tools/lib/h5diff_dset.c b/tools/lib/h5diff_dset.c
index b8dd0e8..63f1483 100644
--- a/tools/lib/h5diff_dset.c
+++ b/tools/lib/h5diff_dset.c
@@ -71,9 +71,7 @@ hsize_t diff_dataset( hid_t file1_id,
if((dcpl1 = H5Dget_create_plist(did1)) < 0)
goto error;
if((dcpl2 = H5Dget_create_plist(did2)) < 0)
- {
goto error;
- }
/*-------------------------------------------------------------------------
* check if the dataset creation property list has filters that
@@ -191,6 +189,10 @@ hsize_t diff_datasetid( hid_t did1,
hid_t f_tid2=-1;
hid_t m_tid1=-1;
hid_t m_tid2=-1;
+ hid_t dcpl1 = -1;
+ hid_t dcpl2 = -1;
+ H5D_layout_t stl1 = -1;
+ H5D_layout_t stl2 = -1;
size_t m_size1;
size_t m_size2;
H5T_sign_t sign1;
@@ -260,6 +262,21 @@ hsize_t diff_datasetid( hid_t did1,
goto error;
}
+
+ /*-------------------------------------------------------------------------
+ * get the storage layout type
+ *-------------------------------------------------------------------------
+ */
+ if((dcpl1 = H5Dget_create_plist(did1)) < 0)
+ goto error;
+ if((dcpl2 = H5Dget_create_plist(did2)) < 0)
+ goto error;
+
+ if((stl1 = H5Pget_layout(dcpl1)) < 0)
+ goto error;
+ if((stl2 = H5Pget_layout(dcpl2)) < 0)
+ goto error;
+
/*-------------------------------------------------------------------------
* check for empty datasets
*-------------------------------------------------------------------------
@@ -271,10 +288,18 @@ hsize_t diff_datasetid( hid_t did1,
if (storage_size1==0 || storage_size2==0)
{
- if ( (options->m_verbose||options->m_list_not_cmp) && obj1_name && obj2_name)
- parallel_print("Not comparable: <%s> or <%s> is an empty dataset\n", obj1_name, obj2_name);
- can_compare=0;
- options->not_cmp=1;
+ if (stl1==H5D_VIRTUAL || stl2==H5D_VIRTUAL)
+ {
+ if ( (options->m_verbose||options->m_list_not_cmp) && obj1_name && obj2_name)
+ parallel_print("Warning: <%s> or <%s> is a virtual dataset\n", obj1_name, obj2_name);
+ }
+ else
+ {
+ if ( (options->m_verbose||options->m_list_not_cmp) && obj1_name && obj2_name)
+ parallel_print("Not comparable: <%s> or <%s> is an empty dataset\n", obj1_name, obj2_name);
+ can_compare=0;
+ options->not_cmp=1;
+ }
}
/*-------------------------------------------------------------------------
@@ -329,7 +354,7 @@ hsize_t diff_datasetid( hid_t did1,
parallel_print("Not comparable: <%s> has sign %s ", obj1_name, get_sign(sign1));
parallel_print("and <%s> has sign %s\n", obj2_name, get_sign(sign2));
}
-
+
can_compare=0;
options->not_cmp=1;
}
@@ -369,7 +394,7 @@ hsize_t diff_datasetid( hid_t did1,
h5difftrace("upgrade the smaller memory size?\n");
if (FAIL == match_up_memsize (f_tid1, f_tid2,
- &m_tid1, &m_tid2,
+ &m_tid1, &m_tid2,
&m_size1, &m_size2))
goto error;