mirror of
https://github.com/HDFGroup/hdf5.git
synced 2024-11-27 02:10:55 +08:00
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.
This commit is contained in:
commit
52ee0344ef
13
src/H5AC.c
13
src/H5AC.c
@ -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 */
|
||||
|
21
src/H5C.c
21
src/H5C.c
@ -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
|
||||
|
16
src/H5Fint.c
16
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;
|
||||
|
||||
|
12
src/H5PB.c
12
src/H5PB.c
@ -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;
|
||||
|
||||
|
@ -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);
|
||||
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user