summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeil Fortner <nfortne2@hdfgroup.org>2015-03-19 20:04:36 (GMT)
committerNeil Fortner <nfortne2@hdfgroup.org>2015-03-19 20:04:36 (GMT)
commit43dec53436614341f3597271603b90d41dac5ac2 (patch)
treeb057617d8483473d4e2ca4a71f7188cf5f47169c
parent4cfe53284bb6c3f7f57ff70af6ceb7396683aaa4 (diff)
downloadhdf5-43dec53436614341f3597271603b90d41dac5ac2.zip
hdf5-43dec53436614341f3597271603b90d41dac5ac2.tar.gz
hdf5-43dec53436614341f3597271603b90d41dac5ac2.tar.bz2
[svn-r26482] Opening source files now reuses the flags from the virtual file.
Added tests for I/O on virtual dataset with source datasets in unopened files. Note there are still some code coverage assertions in the selection matching algorithm - if you hit these try taking them out. Note make check still fails in h5dump test (unrelated to this checkin). Tested: ummon
-rw-r--r--src/H5Dvirtual.c2
-rw-r--r--src/H5Shyper.c11
-rw-r--r--test/vds.c29
3 files changed, 33 insertions, 9 deletions
diff --git a/src/H5Dvirtual.c b/src/H5Dvirtual.c
index 3d957a2..14efe42 100644
--- a/src/H5Dvirtual.c
+++ b/src/H5Dvirtual.c
@@ -213,7 +213,7 @@ H5D__virtual_open_source_dset(const H5D_t *vdset,
/* Check if we need to open the source file */
if(HDstrcmp(virtual_ent->source_file_name, ".")) {
/* Open the source file */
- if(NULL == (src_file = H5F_open(virtual_ent->source_file_name, H5F_ACC_RDONLY, H5P_FILE_CREATE_DEFAULT, H5P_FILE_ACCESS_DEFAULT, dxpl_id)))
+ if(NULL == (src_file = H5F_open(virtual_ent->source_file_name, H5F_INTENT(vdset->oloc.file) & H5F_ACC_RDWR, H5P_FILE_CREATE_DEFAULT, H5P_FILE_ACCESS_DEFAULT, dxpl_id)))
HGOTO_ERROR(H5E_DATASET, H5E_CANTOPENFILE, FAIL, "unable to open source file")
src_file_open = TRUE;
} /* end if */
diff --git a/src/H5Shyper.c b/src/H5Shyper.c
index c64f1c9..1fd19fe 100644
--- a/src/H5Shyper.c
+++ b/src/H5Shyper.c
@@ -9016,7 +9016,8 @@ H5S__hyper_project_intersection(const H5S_t *src_space, const H5S_t *dst_space,
* intersect space */
while(1) {
if(advance_ss || (ss_off[ss_i] + ss_len[ss_i] <= sis_off[sis_i])) {
- /* Sequences do not intersect, advance source space */
+ /* Either we finished the current source sequence or the
+ * sequences do not intersect. Advance source space. */
ss_sel_off += (hsize_t)ss_len[ss_i];
if(++ss_i == ss_nseq) {
if(ss_nelem > 0) {
@@ -9045,8 +9046,12 @@ H5S__hyper_project_intersection(const H5S_t *src_space, const H5S_t *dst_space,
} /* end if */
else if(advance_sis
|| (sis_off[sis_i] + sis_len[sis_i] <= ss_off[ss_i])) {
+ /* Either we finished the current source intersect sequence or
+ * the sequences do not intersect. Advance source intersect
+ * space. */
if(++sis_i == sis_nseq) {
if(sis_nelem > 0) {
+ HDassert(0 && "Checking code coverage..."); //VDSINC
/* Try to grab more sequences from src_intersect_space
*/
if(H5S_SELECT_GET_SEQ_LIST(src_intersect_space, 0u, &sis_iter, H5S_PROJECT_INTERSECT_NSEQS, sis_nelem, &sis_nseq, &nelem, sis_off, sis_len) < 0)
@@ -9125,8 +9130,8 @@ H5S__hyper_project_intersection(const H5S_t *src_space, const H5S_t *dst_space,
/* Check for more than one full row (in every dim) and
* append multiple spans at once? -NAF */
/* Append spans in higher dimensions if we're going
- * ouside the plan of the span currently being built
- * (i.e. they're finished being built) */
+ * ouside the plane of the span currently being built
+ * (i.e. it's finished being built) */
for(i = proj_rank - 1; ((i > 0)
&& ((proj_off / proj_down_dims[i])
!= curr_span_dim[i - 1])); i--) {
diff --git a/test/vds.c b/test/vds.c
index d261cd5..cc0a9de 100644
--- a/test/vds.c
+++ b/test/vds.c
@@ -1071,11 +1071,17 @@ test_basic_io(unsigned config, hid_t fapl)
if(H5Dwrite(srcdset[0], H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf[0]) < 0)
TEST_ERROR
- /* Close srcdset if config option specified */
+ /* Close srcdset and srcfile if config option specified */
if(config & TEST_IO_CLOSE_SRC) {
if(H5Dclose(srcdset[0]) < 0)
TEST_ERROR
srcdset[0] = -1;
+
+ if(config & TEST_IO_DIFFERENT_FILE) {
+ if(H5Fclose(srcfile[0]) < 0)
+ TEST_ERROR
+ srcfile[0] = -1;
+ } /* end if */
} /* end if */
/* Read data through virtual dataset */
@@ -1098,10 +1104,14 @@ test_basic_io(unsigned config, hid_t fapl)
if(H5Dwrite(vdset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf[0]) < 0)
TEST_ERROR
- /* Reopen srcdset if config option specified */
- if(config & TEST_IO_CLOSE_SRC)
+ /* Reopen srcdset and srcfile if config option specified */
+ if(config & TEST_IO_CLOSE_SRC) {
+ if(config & TEST_IO_DIFFERENT_FILE)
+ if((srcfile[0] = H5Fopen(srcfilename, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0)
+ TEST_ERROR
if((srcdset[0] = H5Dopen2(srcfile[0], "src_dset", H5P_DEFAULT)) < 0)
TEST_ERROR
+ } /* end if */
/* Read data directly from source dataset */
HDmemset(rbuf[0], 0, sizeof(rbuf));
@@ -1211,7 +1221,7 @@ test_basic_io(unsigned config, hid_t fapl)
if(H5Dwrite(srcdset[1], H5T_NATIVE_INT, vspace[1], H5S_ALL, H5P_DEFAULT, buf[0]) < 0)
TEST_ERROR
- /* Close srcdsets if config option specified */
+ /* Close srcdsets and srcfile if config option specified */
if(config & TEST_IO_CLOSE_SRC) {
if(H5Dclose(srcdset[0]) < 0)
TEST_ERROR
@@ -1219,6 +1229,12 @@ test_basic_io(unsigned config, hid_t fapl)
if(H5Dclose(srcdset[1]) < 0)
TEST_ERROR
srcdset[1] = -1;
+
+ if(config & TEST_IO_DIFFERENT_FILE) {
+ if(H5Fclose(srcfile[0]) < 0)
+ TEST_ERROR
+ srcfile[0] = -1;
+ } /* end if */
} /* end if */
/* Read data through virtual dataset */
@@ -1241,8 +1257,11 @@ test_basic_io(unsigned config, hid_t fapl)
if(H5Dwrite(vdset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf[0]) < 0)
TEST_ERROR
- /* Reopen srcdsets if config option specified */
+ /* Reopen srcdsets and srcfile if config option specified */
if(config & TEST_IO_CLOSE_SRC) {
+ if(config & TEST_IO_DIFFERENT_FILE)
+ if((srcfile[0] = H5Fopen(srcfilename, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0)
+ TEST_ERROR
if((srcdset[0] = H5Dopen2(srcfile[0], "src_dset1", H5P_DEFAULT)) < 0)
TEST_ERROR
if((srcdset[1] = H5Dopen2(srcfile[0], "src_dset2", H5P_DEFAULT)) < 0)