summaryrefslogtreecommitdiffstats
path: root/src/H5Pdcpl.c
diff options
context:
space:
mode:
authorNeil Fortner <nfortne2@hdfgroup.org>2015-07-22 21:41:18 (GMT)
committerNeil Fortner <nfortne2@hdfgroup.org>2015-07-22 21:41:18 (GMT)
commit49076d6d229abdf59cccac47a86431c977a60037 (patch)
tree96e1966990476771734d9c757943c93f2e22fb87 /src/H5Pdcpl.c
parent6bb109bf6d0b17e4c67a1fc3d252a0b6547c875f (diff)
downloadhdf5-49076d6d229abdf59cccac47a86431c977a60037.zip
hdf5-49076d6d229abdf59cccac47a86431c977a60037.tar.gz
hdf5-49076d6d229abdf59cccac47a86431c977a60037.tar.bz2
[svn-r27425] Implement support for H5Pequal with VDS properties.
Testing for H5Pequal with VDS. Tested: ummon
Diffstat (limited to 'src/H5Pdcpl.c')
-rw-r--r--src/H5Pdcpl.c43
1 files changed, 42 insertions, 1 deletions
diff --git a/src/H5Pdcpl.c b/src/H5Pdcpl.c
index 29976c2..bc32274 100644
--- a/src/H5Pdcpl.c
+++ b/src/H5Pdcpl.c
@@ -825,7 +825,48 @@ H5P__dcrt_layout_cmp(const void *_layout1, const void *_layout2, size_t H5_ATTR_
break;
case H5D_VIRTUAL:
- HDassert(0 && "Not yet implemented...");//VDSINC
+ {
+ htri_t equal;
+ int strcmp_ret;
+ size_t u; /* Local index variable */
+
+ /* Compare number of mappings */
+ if(layout1->storage.u.virt.list_nused < layout2->storage.u.virt.list_nused) HGOTO_DONE(-1)
+ if(layout1->storage.u.virt.list_nused > layout2->storage.u.virt.list_nused) HGOTO_DONE(1)
+
+ /* Iterate over mappings */
+ for(u = 0; u < layout1->storage.u.virt.list_nused; u++) {
+ /* Compare virtual spaces. Note we cannot tell which is
+ * "greater", so just return 1 if different, -1 on failure.
+ */
+ if((equal = H5S_extent_equal(layout1->storage.u.virt.list[u].source_dset.virtual_select, layout2->storage.u.virt.list[u].source_dset.virtual_select)) < 0) HGOTO_DONE(-1)
+ if(!equal)
+ HGOTO_DONE(1)
+ if((equal = H5S_select_shape_same(layout1->storage.u.virt.list[u].source_dset.virtual_select, layout2->storage.u.virt.list[u].source_dset.virtual_select)) < 0) HGOTO_DONE(-1)
+ if(!equal)
+ HGOTO_DONE(1)
+
+ /* Compare source file names */
+ strcmp_ret = HDstrcmp(layout1->storage.u.virt.list[u].source_file_name, layout2->storage.u.virt.list[u].source_file_name);
+ if(strcmp_ret < 0) HGOTO_DONE(-1)
+ if(strcmp_ret > 0) HGOTO_DONE(1)
+
+ /* Compare source dataset names */
+ strcmp_ret = HDstrcmp(layout1->storage.u.virt.list[u].source_dset_name, layout2->storage.u.virt.list[u].source_dset_name);
+ if(strcmp_ret < 0) HGOTO_DONE(-1)
+ if(strcmp_ret > 0) HGOTO_DONE(1)
+
+ /* Compare source spaces. Note we cannot tell which is
+ * "greater", so just return 1 if different, -1 on failure.
+ */
+ if((equal = H5S_extent_equal(layout1->storage.u.virt.list[u].source_select, layout2->storage.u.virt.list[u].source_select)) < 0) HGOTO_DONE(-1)
+ if(!equal)
+ HGOTO_DONE(1)
+ if((equal = H5S_select_shape_same(layout1->storage.u.virt.list[u].source_select, layout2->storage.u.virt.list[u].source_select)) < 0) HGOTO_DONE(-1)
+ if(!equal)
+ HGOTO_DONE(1)
+ } /* end for */
+ } /* end block */
break;
case H5D_LAYOUT_ERROR: