diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2018-03-18 23:36:49 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2018-03-18 23:36:49 (GMT) |
commit | f38864920d4e0bc8adaf9a23fd3f775ad90cb3f7 (patch) | |
tree | b5f709e5415db2f1a9287b43565fea826b3018f5 /src/H5ACmpio.c | |
parent | 4a17aff4085ad6ee265b95730aca3f493056dec8 (diff) | |
parent | 7aa4eb1b04014f1ad7e1c857ca6509aeeb6c0ae7 (diff) | |
download | hdf5-f38864920d4e0bc8adaf9a23fd3f775ad90cb3f7.zip hdf5-f38864920d4e0bc8adaf9a23fd3f775ad90cb3f7.tar.gz hdf5-f38864920d4e0bc8adaf9a23fd3f775ad90cb3f7.tar.bz2 |
Merge branch 'develop' of https://bitbucket.hdfgroup.org/scm/hdffv/hdf5 into merge_func_enter_vol
Plus initial steps toward merging API context push into FUNC_ENTER_API* macros
Diffstat (limited to 'src/H5ACmpio.c')
-rw-r--r-- | src/H5ACmpio.c | 31 |
1 files changed, 20 insertions, 11 deletions
diff --git a/src/H5ACmpio.c b/src/H5ACmpio.c index 03e31b4..7671abc 100644 --- a/src/H5ACmpio.c +++ b/src/H5ACmpio.c @@ -37,6 +37,7 @@ #include "H5private.h" /* Generic Functions */ #include "H5ACpkg.h" /* Metadata cache */ #include "H5Cprivate.h" /* Cache */ +#include "H5CXprivate.h" /* API Contexts */ #include "H5Eprivate.h" /* Error handling */ #include "H5Fpkg.h" /* Files */ #include "H5MMprivate.h" /* Memory management */ @@ -1414,10 +1415,9 @@ H5AC__propagate_flushed_and_still_clean_entries_list(H5F_t *f) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Can't broadcast clean slist.") HDassert(H5SL_count(aux_ptr->c_slist_ptr) == 0); } /* end if */ - else { + else if(H5AC__receive_and_apply_clean_list(f) < 0) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Can't receive and/or process clean slist broadcast.") - } /* end else */ done: FUNC_LEAVE_NOAPI(ret_value) @@ -1426,7 +1426,7 @@ done: /*------------------------------------------------------------------------- * - * Function: H5AC_receive_haddr_list() + * Function: H5AC__receive_haddr_list() * * Purpose: Receive the list of entry addresses from process 0, * and return it in a buffer pointed to by *haddr_buf_ptr_ptr. @@ -1493,7 +1493,7 @@ done: haddr_buf_ptr = (haddr_t *)H5MM_xfree((void *)haddr_buf_ptr); FUNC_LEAVE_NOAPI(ret_value) -} /* H5AC_receive_haddr_list() */ +} /* H5AC__receive_haddr_list() */ /*------------------------------------------------------------------------- @@ -1693,9 +1693,14 @@ H5AC__rsp__dist_md_write__flush(H5F_t *f) if(H5AC__copy_candidate_list_to_buffer(cache_ptr, &num_entries, &haddr_buf_ptr) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't construct candidate buffer.") - /* initial sync point barrier */ - if(MPI_SUCCESS != (mpi_result = MPI_Barrier(aux_ptr->mpi_comm))) - HMPI_GOTO_ERROR(FAIL, "MPI_Barrier failed", mpi_result) + /* Initial sync point barrier + * + * When flushing from within the close operation from a file, + * it's possible to skip this barrier (on the second flush of the cache). + */ + if(!H5CX_get_mpi_file_flushing()) + if(MPI_SUCCESS != (mpi_result = MPI_Barrier(aux_ptr->mpi_comm))) + HMPI_GOTO_ERROR(FAIL, "MPI_Barrier failed", mpi_result) /* Enable writes during this operation */ aux_ptr->write_permitted = TRUE; @@ -1893,12 +1898,16 @@ H5AC__rsp__p0_only__flush(H5F_t *f) HDassert(aux_ptr->magic == H5AC__H5AC_AUX_T_MAGIC); HDassert(aux_ptr->metadata_write_strategy == H5AC_METADATA_WRITE_STRATEGY__PROCESS_0_ONLY); - /* to prevent "messages from the future" we must + /* To prevent "messages from the future" we must * synchronize all processes before we start the flush. * Hence the following barrier. + * + * However, when flushing from within the close operation from a file, + * it's possible to skip this barrier (on the second flush of the cache). */ - if(MPI_SUCCESS != (mpi_result = MPI_Barrier(aux_ptr->mpi_comm))) - HMPI_GOTO_ERROR(FAIL, "MPI_Barrier failed", mpi_result) + if(!H5CX_get_mpi_file_flushing()) + if(MPI_SUCCESS != (mpi_result = MPI_Barrier(aux_ptr->mpi_comm))) + HMPI_GOTO_ERROR(FAIL, "MPI_Barrier failed", mpi_result) /* Flush data to disk, from rank 0 process */ if(aux_ptr->mpi_rank == 0) { @@ -1918,7 +1927,7 @@ H5AC__rsp__p0_only__flush(H5F_t *f) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't flush.") /* this code exists primarily for the test bed -- it allows us to - * enforce posix semantics on the server that pretends to be a + * enforce POSIX semantics on the server that pretends to be a * file system in our parallel tests. */ if(aux_ptr->write_done) |