diff options
author | mainzer <mainzer#hdfgroup.org> | 2017-03-16 17:42:10 (GMT) |
---|---|---|
committer | mainzer <mainzer#hdfgroup.org> | 2017-03-16 17:42:10 (GMT) |
commit | 11ce930ae94bd21b1a8d4afdde7b982439f2800b (patch) | |
tree | 581a2a020c12b4714b6d00aee2b1ef1f12c3ba61 /src | |
parent | cee9624b0febcb60a7b2699262104e9eaf20313d (diff) | |
download | hdf5-11ce930ae94bd21b1a8d4afdde7b982439f2800b.zip hdf5-11ce930ae94bd21b1a8d4afdde7b982439f2800b.tar.gz hdf5-11ce930ae94bd21b1a8d4afdde7b982439f2800b.tar.bz2 |
Checkin of additions to cache image parallel test code and
associated bug fixes.
Also, modifications to H5PB_dest() to flush the page buffer before
destroying the page buffer. This is necessary, as when persistant
free space managers are enabled, the page buffer will typically contain
dirty FSM data at page buffer destroy time.
Tested serial/debug, serial/production, serial/check-vfd/debug,
parallel/debug, parallel/production on Jelly.
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 | 9 | ||||
-rw-r--r-- | src/H5PBprivate.h | 2 |
6 files changed, 47 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..3a2b422 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(f, &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,7 +477,7 @@ H5PB__dest_cb(void *item, void H5_ATTR_UNUSED *key, void *_op_data) *------------------------------------------------------------------------- */ herr_t -H5PB_dest(H5F_t *f) +H5PB_dest(H5F_t *f, const H5F_io_info2_t *fio_info) { herr_t ret_value = SUCCEED; /* Return value */ @@ -486,11 +486,14 @@ H5PB_dest(H5F_t *f) /* Sanity checks */ 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..3933029 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(H5F_t *file, 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); |