diff options
author | Quincey Koziol <koziol@lbl.gov> | 2020-12-01 16:15:34 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-01 16:15:34 (GMT) |
commit | adf7b1d4cf788f25a52619f5d1c957ac5a7c345c (patch) | |
tree | 3795ebb0bb5f7f752e26392971d0efdfe7c930cc /src | |
parent | 123c5a653dbe3867e06eb8c31da952b7ef042f95 (diff) | |
download | hdf5-adf7b1d4cf788f25a52619f5d1c957ac5a7c345c.zip hdf5-adf7b1d4cf788f25a52619f5d1c957ac5a7c345c.tar.gz hdf5-adf7b1d4cf788f25a52619f5d1c957ac5a7c345c.tar.bz2 |
Add flag to H5CX_pop that allow setting the properties to return to application to be skipped. (#134)
Diffstat (limited to 'src')
-rw-r--r-- | src/H5Atest.c | 2 | ||||
-rw-r--r-- | src/H5CX.c | 34 | ||||
-rw-r--r-- | src/H5CXprivate.h | 2 | ||||
-rw-r--r-- | src/H5Ftest.c | 4 | ||||
-rw-r--r-- | src/H5Gtest.c | 14 | ||||
-rw-r--r-- | src/H5Itest.c | 2 | ||||
-rw-r--r-- | src/H5Otest.c | 12 | ||||
-rw-r--r-- | src/H5VLint.c | 2 | ||||
-rw-r--r-- | src/H5private.h | 4 |
9 files changed, 39 insertions, 37 deletions
diff --git a/src/H5Atest.c b/src/H5Atest.c index dcbb4e3..e4a1e2d 100644 --- a/src/H5Atest.c +++ b/src/H5Atest.c @@ -136,7 +136,7 @@ H5A__get_shared_rc_test(hid_t attr_id, hsize_t *ref_count) HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't retrieve shared message ref count") done: - if (api_ctx_pushed && H5CX_pop() < 0) + if (api_ctx_pushed && H5CX_pop(FALSE) < 0) HDONE_ERROR(H5E_ATTR, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_NOAPI(ret_value) @@ -422,7 +422,7 @@ typedef struct H5CX_fapl_cache_t { static H5CX_node_t **H5CX__get_context(void); #endif /* H5_HAVE_THREADSAFE */ static void H5CX__push_common(H5CX_node_t *cnode); -static H5CX_node_t *H5CX__pop_common(void); +static H5CX_node_t *H5CX__pop_common(hbool_t update_dxpl_props); /*********************/ /* Package Variables */ @@ -678,7 +678,7 @@ H5CX_term_package(void) /* Pop the top context node from the stack */ /* (Can't check for errors, as rest of library is shut down) */ - cnode = H5CX__pop_common(); + cnode = H5CX__pop_common(FALSE); /* Free the context node */ /* (Allocated with HDmalloc() in H5CX_push_special() ) */ @@ -3563,7 +3563,7 @@ done: *------------------------------------------------------------------------- */ static H5CX_node_t * -H5CX__pop_common(void) +H5CX__pop_common(hbool_t update_dxpl_props) { H5CX_node_t **head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ @@ -3579,21 +3579,23 @@ H5CX__pop_common(void) HDassert(head && *head); /* Check for cached DXPL properties to return to application */ + if (update_dxpl_props) { #ifdef H5_HAVE_PARALLEL - H5CX_SET_PROP(H5D_MPIO_ACTUAL_CHUNK_OPT_MODE_NAME, mpio_actual_chunk_opt) - H5CX_SET_PROP(H5D_MPIO_ACTUAL_IO_MODE_NAME, mpio_actual_io_mode) - H5CX_SET_PROP(H5D_MPIO_LOCAL_NO_COLLECTIVE_CAUSE_NAME, mpio_local_no_coll_cause) - H5CX_SET_PROP(H5D_MPIO_GLOBAL_NO_COLLECTIVE_CAUSE_NAME, mpio_global_no_coll_cause) + H5CX_SET_PROP(H5D_MPIO_ACTUAL_CHUNK_OPT_MODE_NAME, mpio_actual_chunk_opt) + H5CX_SET_PROP(H5D_MPIO_ACTUAL_IO_MODE_NAME, mpio_actual_io_mode) + H5CX_SET_PROP(H5D_MPIO_LOCAL_NO_COLLECTIVE_CAUSE_NAME, mpio_local_no_coll_cause) + H5CX_SET_PROP(H5D_MPIO_GLOBAL_NO_COLLECTIVE_CAUSE_NAME, mpio_global_no_coll_cause) #ifdef H5_HAVE_INSTRUMENTED_LIBRARY - H5CX_SET_PROP(H5D_XFER_COLL_CHUNK_LINK_HARD_NAME, mpio_coll_chunk_link_hard) - H5CX_SET_PROP(H5D_XFER_COLL_CHUNK_MULTI_HARD_NAME, mpio_coll_chunk_multi_hard) - H5CX_SET_PROP(H5D_XFER_COLL_CHUNK_LINK_NUM_TRUE_NAME, mpio_coll_chunk_link_num_true) - H5CX_SET_PROP(H5D_XFER_COLL_CHUNK_LINK_NUM_FALSE_NAME, mpio_coll_chunk_link_num_false) - H5CX_SET_PROP(H5D_XFER_COLL_CHUNK_MULTI_RATIO_COLL_NAME, mpio_coll_chunk_multi_ratio_coll) - H5CX_SET_PROP(H5D_XFER_COLL_CHUNK_MULTI_RATIO_IND_NAME, mpio_coll_chunk_multi_ratio_ind) - H5CX_SET_PROP(H5D_XFER_COLL_RANK0_BCAST_NAME, mpio_coll_rank0_bcast) + H5CX_SET_PROP(H5D_XFER_COLL_CHUNK_LINK_HARD_NAME, mpio_coll_chunk_link_hard) + H5CX_SET_PROP(H5D_XFER_COLL_CHUNK_MULTI_HARD_NAME, mpio_coll_chunk_multi_hard) + H5CX_SET_PROP(H5D_XFER_COLL_CHUNK_LINK_NUM_TRUE_NAME, mpio_coll_chunk_link_num_true) + H5CX_SET_PROP(H5D_XFER_COLL_CHUNK_LINK_NUM_FALSE_NAME, mpio_coll_chunk_link_num_false) + H5CX_SET_PROP(H5D_XFER_COLL_CHUNK_MULTI_RATIO_COLL_NAME, mpio_coll_chunk_multi_ratio_coll) + H5CX_SET_PROP(H5D_XFER_COLL_CHUNK_MULTI_RATIO_IND_NAME, mpio_coll_chunk_multi_ratio_ind) + H5CX_SET_PROP(H5D_XFER_COLL_RANK0_BCAST_NAME, mpio_coll_rank0_bcast) #endif /* H5_HAVE_INSTRUMENTED_LIBRARY */ #endif /* H5_HAVE_PARALLEL */ + } /* end if */ /* Pop the top context node from the stack */ ret_value = (*head); @@ -3618,7 +3620,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5CX_pop(void) +H5CX_pop(hbool_t update_dxpl_props) { H5CX_node_t *cnode; /* Context node */ herr_t ret_value = SUCCEED; /* Return value */ @@ -3626,7 +3628,7 @@ H5CX_pop(void) FUNC_ENTER_NOAPI(FAIL) /* Perform common operations and get top context from stack */ - if (NULL == (cnode = H5CX__pop_common())) + if (NULL == (cnode = H5CX__pop_common(update_dxpl_props))) HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "error getting API context node") /* Free the context node */ diff --git a/src/H5CXprivate.h b/src/H5CXprivate.h index 767ccf1..fa338c1 100644 --- a/src/H5CXprivate.h +++ b/src/H5CXprivate.h @@ -63,7 +63,7 @@ typedef struct H5CX_state_t { /* Library private routines */ #ifndef _H5private_H H5_DLL herr_t H5CX_push(void); -H5_DLL herr_t H5CX_pop(void); +H5_DLL herr_t H5CX_pop(hbool_t update_dxpl_props); #endif /* _H5private_H */ H5_DLL void H5CX_push_special(void); H5_DLL hbool_t H5CX_is_def_dxpl(void); diff --git a/src/H5Ftest.c b/src/H5Ftest.c index c2ce16e..9688a77 100644 --- a/src/H5Ftest.c +++ b/src/H5Ftest.c @@ -108,7 +108,7 @@ H5F__get_sohm_mesg_count_test(hid_t file_id, unsigned type_id, size_t *mesg_coun HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "can't retrieve shared message count") done: - if (api_ctx_pushed && H5CX_pop() < 0) + if (api_ctx_pushed && H5CX_pop(FALSE) < 0) HDONE_ERROR(H5E_FILE, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_NOAPI(ret_value) @@ -152,7 +152,7 @@ H5F__check_cached_stab_test(hid_t file_id) HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "unable to verify cached symbol table info") done: - if (api_ctx_pushed && H5CX_pop() < 0) + if (api_ctx_pushed && H5CX_pop(FALSE) < 0) HDONE_ERROR(H5E_FILE, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5Gtest.c b/src/H5Gtest.c index 414001e..0cdb380 100644 --- a/src/H5Gtest.c +++ b/src/H5Gtest.c @@ -178,7 +178,7 @@ H5G__is_empty_test(hid_t gid) } /* end if */ done: - if (api_ctx_pushed && H5CX_pop() < 0) + if (api_ctx_pushed && H5CX_pop(FALSE) < 0) HDONE_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_NOAPI(ret_value) @@ -245,7 +245,7 @@ H5G__has_links_test(hid_t gid, unsigned *nmsgs) } /* end if */ done: - if (api_ctx_pushed && H5CX_pop() < 0) + if (api_ctx_pushed && H5CX_pop(FALSE) < 0) HDONE_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_NOAPI(ret_value) @@ -301,7 +301,7 @@ H5G__has_stab_test(hid_t gid) HGOTO_ERROR(H5E_SYM, H5E_BADVALUE, FAIL, "both symbol table and link messages found") done: - if (api_ctx_pushed && H5CX_pop() < 0) + if (api_ctx_pushed && H5CX_pop(FALSE) < 0) HDONE_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_NOAPI(ret_value) @@ -376,7 +376,7 @@ H5G__is_new_dense_test(hid_t gid) } /* end if */ done: - if (api_ctx_pushed && H5CX_pop() < 0) + if (api_ctx_pushed && H5CX_pop(FALSE) < 0) HDONE_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_NOAPI(ret_value) @@ -469,7 +469,7 @@ done: HDONE_ERROR(H5E_SYM, H5E_CANTCLOSEOBJ, FAIL, "can't close v2 B-tree for name index") if (bt2_corder && H5B2_close(bt2_corder) < 0) HDONE_ERROR(H5E_SYM, H5E_CANTCLOSEOBJ, FAIL, "can't close v2 B-tree for creation order index") - if (api_ctx_pushed && H5CX_pop() < 0) + if (api_ctx_pushed && H5CX_pop(FALSE) < 0) HDONE_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_NOAPI(ret_value) @@ -522,7 +522,7 @@ H5G__lheap_size_test(hid_t gid, size_t *lheap_size) HGOTO_ERROR(H5E_SYM, H5E_CANTGETSIZE, FAIL, "can't query local heap size") done: - if (api_ctx_pushed && H5CX_pop() < 0) + if (api_ctx_pushed && H5CX_pop(FALSE) < 0) HDONE_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_NOAPI(ret_value) @@ -633,7 +633,7 @@ H5G__user_path_test(hid_t obj_id, char *user_path, size_t *user_path_len, unsign } /* end else */ done: - if (api_ctx_pushed && H5CX_pop() < 0) + if (api_ctx_pushed && H5CX_pop(FALSE) < 0) HDONE_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5Itest.c b/src/H5Itest.c index be09a03..40618d1 100644 --- a/src/H5Itest.c +++ b/src/H5Itest.c @@ -102,7 +102,7 @@ done: if (vol_wrapper_set && H5VL_reset_vol_wrapper() < 0) HDONE_ERROR(H5E_ID, H5E_CANTRESET, FAIL, "can't reset VOL wrapper info") - if (api_ctx_pushed && H5CX_pop() < 0) + if (api_ctx_pushed && H5CX_pop(FALSE) < 0) HDONE_ERROR(H5E_SYM, H5E_CANTRESET, (-1), "can't reset API context") FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5Otest.c b/src/H5Otest.c index 1d38a85..ea894e8 100644 --- a/src/H5Otest.c +++ b/src/H5Otest.c @@ -128,7 +128,7 @@ H5O__is_attr_dense_test(hid_t oid) done: if (oh && H5O_unprotect(loc, oh, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to release object header") - if (api_ctx_pushed && H5CX_pop() < 0) + if (api_ctx_pushed && H5CX_pop(FALSE) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_NOAPI(ret_value) @@ -230,7 +230,7 @@ done: HDONE_ERROR(H5E_OHDR, H5E_CANTCLOSEOBJ, FAIL, "can't close v2 B-tree for name index") if (oh && H5O_unprotect(loc, oh, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to release object header") - if (api_ctx_pushed && H5CX_pop() < 0) + if (api_ctx_pushed && H5CX_pop(FALSE) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_NOAPI(ret_value) @@ -327,7 +327,7 @@ done: HDONE_ERROR(H5E_OHDR, H5E_CANTCLOSEOBJ, FAIL, "can't close v2 B-tree for name index") if (oh && H5O_unprotect(loc, oh, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to release object header") - if (api_ctx_pushed && H5CX_pop() < 0) + if (api_ctx_pushed && H5CX_pop(FALSE) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_NOAPI(ret_value) @@ -431,7 +431,7 @@ done: HDONE_ERROR(H5E_OHDR, H5E_CANTCLOSEOBJ, FAIL, "can't close v2 B-tree for creation order index") if (oh && H5O_unprotect(loc, oh, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to release object header") - if (api_ctx_pushed && H5CX_pop() < 0) + if (api_ctx_pushed && H5CX_pop(FALSE) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_NOAPI(ret_value) @@ -667,7 +667,7 @@ H5O__msg_get_chunkno_test(hid_t oid, unsigned msg_type, unsigned *chunk_num) done: if (oh && H5O_unprotect(loc, oh, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to release object header") - if (api_ctx_pushed && H5CX_pop() < 0) + if (api_ctx_pushed && H5CX_pop(FALSE) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_NOAPI(ret_value) @@ -778,7 +778,7 @@ H5O__msg_move_to_new_chunk_test(hid_t oid, unsigned msg_type) done: if (oh && H5O_unprotect(loc, oh, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to release object header") - if (api_ctx_pushed && H5CX_pop() < 0) + if (api_ctx_pushed && H5CX_pop(FALSE) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5VLint.c b/src/H5VLint.c index 74b8f22..b92c16a 100644 --- a/src/H5VLint.c +++ b/src/H5VLint.c @@ -2022,7 +2022,7 @@ H5VL_reset_lib_state(void) FUNC_ENTER_NOAPI(FAIL) /* Pop the API context off the stack */ - if (H5CX_pop() < 0) + if (H5CX_pop(FALSE) < 0) HGOTO_ERROR(H5E_VOL, H5E_CANTRESET, FAIL, "can't pop API context") done: diff --git a/src/H5private.h b/src/H5private.h index 2d90766..fd0d8f5 100644 --- a/src/H5private.h +++ b/src/H5private.h @@ -2185,7 +2185,7 @@ extern hbool_t H5_MPEinit_g; /* Has the MPE Library been initialized? */ /* Forward declaration of H5CXpush() / H5CXpop() */ /* (Including H5CXprivate.h creates bad circular dependencies - QAK, 3/18/2018) */ H5_DLL herr_t H5CX_push(void); -H5_DLL herr_t H5CX_pop(void); +H5_DLL herr_t H5CX_pop(hbool_t update_dxpl_props); #ifndef NDEBUG #define FUNC_ENTER_CHECK_NAME(asrt) \ @@ -2543,7 +2543,7 @@ H5_DLL herr_t H5CX_pop(void); #define FUNC_LEAVE_API(ret_value) \ FUNC_LEAVE_API_COMMON(ret_value); \ - (void)H5CX_pop(); \ + (void)H5CX_pop(TRUE); \ H5_POP_FUNC \ if (err_occurred) \ (void)H5E_dump_api_stack(TRUE); \ |