[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.

This commit is contained in:
Allen Byrne 2016-04-08 12:43:59 -05:00
parent c575abdeff
commit 1a5ee65d50
3 changed files with 35 additions and 10 deletions

View File

@ -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

View File

@ -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

View File

@ -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
*-------------------------------------------------------------------------
@ -270,12 +287,20 @@ hsize_t diff_datasetid( hid_t did1,
storage_size2=H5Dget_storage_size(did2);
if (storage_size1==0 || storage_size2==0)
{
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;
}
}
/*-------------------------------------------------------------------------
* check for comparable TYPE and SPACE