summaryrefslogtreecommitdiffstats
path: root/src/H5Fint.c
diff options
context:
space:
mode:
authorVailin Choi <vchoi@jam.ad.hdfgroup.org>2018-11-14 21:35:35 (GMT)
committerVailin Choi <vchoi@jam.ad.hdfgroup.org>2018-11-14 21:35:35 (GMT)
commitce2748f0114cb1eae00799f8349a5451152c7fa3 (patch)
treefd3e39e6de7b37651a2c7047bd3ad128b5c4e204 /src/H5Fint.c
parente62f4bd4fab00b0cd03e269a858c21558a9321fa (diff)
downloadhdf5-ce2748f0114cb1eae00799f8349a5451152c7fa3.zip
hdf5-ce2748f0114cb1eae00799f8349a5451152c7fa3.tar.gz
hdf5-ce2748f0114cb1eae00799f8349a5451152c7fa3.tar.bz2
(A) Fixes for the assertion failures described in issue #2 (see John Mainzer's last checkin message):
--src/H5PB.c: checks for size >= page size --src/H5MF.c: disable/enable page buffering in H5MF_tidy_self_referential_fsm_hack() --src/H5MFsection.c: call H5PB_remove_entry() for both raw/metadata pages in H5MF__sect_small_merge() (B) Port and modify existing concurrent swmr tests to VFD SWMR. Also modify the following: --remove flushes from VFD SWMR writer tests --set Nreaders to 0 in test/testvfdswmr.sh.in to test for writers only Please enter the commit message for your changes. Lines starting
Diffstat (limited to 'src/H5Fint.c')
-rw-r--r--src/H5Fint.c22
1 files changed, 16 insertions, 6 deletions
diff --git a/src/H5Fint.c b/src/H5Fint.c
index bca09b2..3cc82d8 100644
--- a/src/H5Fint.c
+++ b/src/H5Fint.c
@@ -132,7 +132,7 @@ static herr_t H5F__idx_entry_cmp(const void *_entry1, const void *_entry2);
/*********************/
/* VFD SWMR globals */
-H5F_t *vfd_swmr_file_g; /* Points to the file struct */
+H5F_t *vfd_swmr_file_g = NULL; /* Points to the file struct */
hbool_t vfd_swmr_g = FALSE; /* Is this a VFD SWMR configured file */
hbool_t vfd_swmr_writer_g = FALSE; /* Is this the VFD SWMR writer */
uint64_t tick_num_g = 0; /* The current tick_num */
@@ -1370,6 +1370,7 @@ H5F__dest(H5F_t *f, hbool_t flush)
if(H5F__vfd_swmr_close_or_flush(f, TRUE) < 0)
HDONE_ERROR(H5E_FILE, H5E_CANTCLOSEFILE, FAIL, "unable to close the metadata file")
}
+ vfd_swmr_file_g = NULL;
/* Close the file */
if(H5FD_close(f->shared->lf) < 0)
@@ -3651,6 +3652,7 @@ H5F__vfd_swmr_init(H5F_t *f, hbool_t file_create)
} else { /* VFD SWMR reader */
HDassert(!f->shared->vfd_swmr_config.vfd_swmr_writer);
+
vfd_swmr_writer_g = f->shared->vfd_swmr_writer = FALSE;
/* Set tick_num_g to the current tick read from the metadata file */
@@ -3941,8 +3943,6 @@ H5F__vfd_swmr_close_or_flush(H5F_t *f, hbool_t closing)
} /* end while */
f->shared->dl_head_ptr = f->shared->dl_tail_ptr = NULL;
- vfd_swmr_file_g = NULL;
-
} else { /* For file flush */
/* Update end_of_tick */
if(H5F__vfd_swmr_update_end_of_tick_and_tick_num(f, TRUE) < 0)
@@ -4136,15 +4136,25 @@ done:
herr_t
H5F_vfd_swmr_reader_end_of_tick(void)
{
+ uint64_t tmp_tick_num = 0;
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
/* construct */
if(vfd_swmr_file_g) {
- /* Update end_of_tick */
- if(H5F__vfd_swmr_update_end_of_tick_and_tick_num(vfd_swmr_file_g, FALSE) < 0)
- HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "unable to update end of tick")
+ HDassert(vfd_swmr_file_g->shared);
+ HDassert(vfd_swmr_file_g->shared->lf);
+
+ if(H5FD_vfd_swmr_get_tick_and_idx(vfd_swmr_file_g->shared->lf, TRUE, &tmp_tick_num, NULL, NULL) < 0)
+ HGOTO_ERROR(H5E_ARGS, H5E_CANTGET, FAIL, "error in retrieving tick_num from driver")
+ if(tmp_tick_num != tick_num_g) {
+ vfd_swmr_file_g->shared->tick_num = tick_num_g = tmp_tick_num;
+
+ /* Update end_of_tick */
+ if(H5F__vfd_swmr_update_end_of_tick_and_tick_num(vfd_swmr_file_g, FALSE) < 0)
+ HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "unable to update end of tick")
+ }
}
done: