diff options
author | John Mainzer <mainzer@hdfgroup.org> | 2017-03-20 18:13:13 (GMT) |
---|---|---|
committer | John Mainzer <mainzer@hdfgroup.org> | 2017-03-20 18:13:13 (GMT) |
commit | 52ee0344ef077b8109123b83b0677be7f132b4dc (patch) | |
tree | c78b7d1b038cca384558f2171fbf6e2ff2460757 /src | |
parent | b359e8f1a2349d177e70d34560d0a089ce37c4c8 (diff) | |
parent | b7c58f7dfca66d4caa26d7f8b318ad3514b8c46f (diff) | |
download | hdf5-52ee0344ef077b8109123b83b0677be7f132b4dc.zip hdf5-52ee0344ef077b8109123b83b0677be7f132b4dc.tar.gz hdf5-52ee0344ef077b8109123b83b0677be7f132b4dc.tar.bz2 |
Merge pull request #341 in HDFFV/hdf5 from ~MAINZER/hdf5_jrm:develop to develop
* commit 'b7c58f7dfca66d4caa26d7f8b318ad3514b8c46f':
Minor code changes to address comments in pull request
Checkin of additions to cache image parallel test code and associated bug fixes.
Diffstat (limited to 'src')
-rw-r--r-- | src/H5AC.c | 13 | ||||
-rw-r--r-- | src/H5C.c | 21 | ||||
-rw-r--r-- | src/H5Fint.c | 16 | ||||
-rw-r--r-- | src/H5MF.c | 6 | ||||
-rw-r--r-- | src/H5PB.c | 12 | ||||
-rw-r--r-- | src/H5PBprivate.h | 2 |
6 files changed, 50 insertions, 20 deletions
@@ -611,6 +611,7 @@ H5AC_dest(H5F_t *f, hid_t dxpl_id) /* Sanity check */ HDassert(f); + HDassert(f->shared); HDassert(f->shared->cache); #if H5AC_DUMP_STATS_ON_CLOSE @@ -641,9 +642,17 @@ H5AC_dest(H5F_t *f, hid_t dxpl_id) /* Sanity check */ HDassert(aux_ptr->magic == H5AC__H5AC_AUX_T_MAGIC); - /* Attempt to flush all entries from rank 0 & Bcast clean list to other ranks */ - if(H5AC__flush_entries(f, dxpl_id) < 0) + /* If the file was opened R/W, attempt to flush all entries + * from rank 0 & Bcast clean list to other ranks. + * + * Must not flush in the R/O case, as this will trigger the + * free space manager settle routines. + */ + if ( ( H5F_ACC_RDWR & H5F_INTENT(f) ) && + ( H5AC__flush_entries(f, dxpl_id) < 0 ) ) + HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't flush") + #endif /* H5_HAVE_PARALLEL */ /* Destroy the cache */ @@ -761,7 +761,10 @@ H5C_prep_for_file_close(H5F_t *f, hid_t dxpl_id) HGOTO_ERROR(H5E_CACHE, H5E_CANTCREATE, FAIL, "can't create cache image") #ifdef H5_HAVE_PARALLEL - if(!image_generated && cache_ptr->aux_ptr != NULL && f->shared->fs_persist) { + if ( ( H5F_INTENT(f) & H5F_ACC_RDWR ) && + ( ! image_generated ) && + ( cache_ptr->aux_ptr != NULL ) && + ( f->shared->fs_persist ) ) { /* If persistent free space managers are enabled, flushing the * metadata cache may result in the deletion, insertion, and/or * dirtying of entries. @@ -7295,14 +7298,20 @@ H5C__make_space_in_cache(H5F_t *f, hid_t dxpl_id, size_t space_needed, prev_ptr = entry_ptr->aux_prev; + if ( ( !(entry_ptr->prefetched_dirty) ) #ifdef H5_HAVE_PARALLEL - if(!(entry_ptr->coll_access)) { + && ( ! (entry_ptr->coll_access) ) #endif /* H5_HAVE_PARALLEL */ - if(H5C__flush_single_entry(f, dxpl_id, entry_ptr, H5C__FLUSH_INVALIDATE_FLAG | H5C__DEL_FROM_SLIST_ON_DESTROY_FLAG) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to flush entry") -#ifdef H5_HAVE_PARALLEL + ) { + + if ( H5C__flush_single_entry(f, dxpl_id, entry_ptr, + H5C__FLUSH_INVALIDATE_FLAG | + H5C__DEL_FROM_SLIST_ON_DESTROY_FLAG) < 0 ) + + HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, \ + "unable to flush entry") + } /* end if */ -#endif /* H5_HAVE_PARALLEL */ /* we are scanning the clean LRU, so the serialize function * will not be called on any entry -- thus there is no diff --git a/src/H5Fint.c b/src/H5Fint.c index 794be50..444d409 100644 --- a/src/H5Fint.c +++ b/src/H5Fint.c @@ -1006,8 +1006,15 @@ H5F__dest(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hbool_t flush) /* Push error, but keep going*/ HDONE_ERROR(H5E_FILE, H5E_CANTRELEASE, FAIL, "problems closing file") + /* Set up I/O info for operation */ + fio_info.f = f; + if(NULL == (fio_info.meta_dxpl = (H5P_genplist_t *)H5I_object(meta_dxpl_id))) + HDONE_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "can't get property list") + if(NULL == (fio_info.raw_dxpl = (H5P_genplist_t *)H5I_object(H5AC_rawdata_dxpl_id))) + HDONE_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "can't get property list") + /* Shutdown the page buffer cache */ - if(H5PB_dest(f) < 0) + if(H5PB_dest(&fio_info) < 0) /* Push error, but keep going*/ HDONE_ERROR(H5E_FILE, H5E_CANTRELEASE, FAIL, "problems closing page buffer cache") @@ -1027,13 +1034,6 @@ H5F__dest(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hbool_t flush) f->shared->root_grp = NULL; } /* end if */ - /* Set up I/O info for operation */ - fio_info.f = f; - if(NULL == (fio_info.meta_dxpl = (H5P_genplist_t *)H5I_object(meta_dxpl_id))) - HDONE_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "can't get property list") - if(NULL == (fio_info.raw_dxpl = (H5P_genplist_t *)H5I_object(H5AC_rawdata_dxpl_id))) - HDONE_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "can't get property list") - /* Destroy other components of the file */ if(H5F__accum_reset(&fio_info, TRUE) < 0) /* Push error, but keep going*/ @@ -1347,6 +1347,12 @@ HDfprintf(stderr, "%s: Entering: alloc_type = %u, addr = %a, size = %Hu, extra_r HDassert(f); HDassert(H5F_INTENT(f) & H5F_ACC_RDWR); + if(f->shared->first_alloc_dealloc) { + HDassert(! H5AC_cache_image_pending(f)); + if(H5MF_tidy_self_referential_fsm_hack(f, dxpl_id) < 0) + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTFREE, FAIL, "tidy of self referential fsm hack failed") + } /* end if */ + /* Set mapped type, treating global heap as raw data */ map_type = (alloc_type == H5FD_MEM_GHEAP) ? H5FD_MEM_DRAW : alloc_type; @@ -468,7 +468,7 @@ H5PB__dest_cb(void *item, void H5_ATTR_UNUSED *key, void *_op_data) /*------------------------------------------------------------------------- * Function: H5PB_dest * - * Purpose: destroy the PB on the file. + * Purpose: Flush and destroy the PB on the file if it exists. * * Return: Non-negative on success/Negative on failure * @@ -477,20 +477,26 @@ H5PB__dest_cb(void *item, void H5_ATTR_UNUSED *key, void *_op_data) *------------------------------------------------------------------------- */ herr_t -H5PB_dest(H5F_t *f) +H5PB_dest(const H5F_io_info2_t *fio_info) { herr_t ret_value = SUCCEED; /* Return value */ + H5F_t *f; /* file pointer */ FUNC_ENTER_NOAPI(FAIL) /* Sanity checks */ + HDassert(fio_info); + f = fio_info->f; HDassert(f); - /* Destroy page buffer info, if there is any */ + /* flush and destroy the page buffer, if it exists */ if(f->shared->page_buf) { H5PB_t *page_buf = f->shared->page_buf; H5PB_ud1_t op_data; /* Iteration context */ + if(H5PB_flush(fio_info)<0) + HGOTO_ERROR(H5E_PAGEBUF, H5E_CANTFLUSH, FAIL, "can't flush page buffer") + /* Set up context info */ op_data.page_buf = page_buf; diff --git a/src/H5PBprivate.h b/src/H5PBprivate.h index 3b5dcae..7dd4071 100644 --- a/src/H5PBprivate.h +++ b/src/H5PBprivate.h @@ -89,7 +89,7 @@ typedef struct H5PB_t { /* General routines */ H5_DLL herr_t H5PB_create(H5F_t *file, size_t page_buffer_size, unsigned page_buf_min_meta_perc, unsigned page_buf_min_raw_perc); H5_DLL herr_t H5PB_flush(const H5F_io_info2_t *fio_info); -H5_DLL herr_t H5PB_dest(H5F_t *file); +H5_DLL herr_t H5PB_dest(const H5F_io_info2_t *fio_info); H5_DLL herr_t H5PB_add_new_page(H5F_t *f, H5FD_mem_t type, haddr_t page_addr); H5_DLL herr_t H5PB_update_entry(H5PB_t *page_buf, haddr_t addr, size_t size, const void *buf); H5_DLL herr_t H5PB_remove_entry(const H5F_t *f, haddr_t addr); |