diff options
author | Dana Robinson <derobins@hdfgroup.org> | 2021-04-08 00:35:30 (GMT) |
---|---|---|
committer | Dana Robinson <derobins@hdfgroup.org> | 2021-04-08 00:35:30 (GMT) |
commit | ce39d7501c58427add05aba62956acb84a6f56da (patch) | |
tree | 02f3845f417bd80bc1c6469e78ef3981babec648 /src | |
parent | 2f4152d02dbe55c158fa0ceb91ce8fb1a5a47bd3 (diff) | |
download | hdf5-ce39d7501c58427add05aba62956acb84a6f56da.zip hdf5-ce39d7501c58427add05aba62956acb84a6f56da.tar.gz hdf5-ce39d7501c58427add05aba62956acb84a6f56da.tar.bz2 |
Brings H5CX_pop() changes from develop
Diffstat (limited to 'src')
-rw-r--r-- | src/H5Atest.c | 2 | ||||
-rw-r--r-- | src/H5CX.c | 40 | ||||
-rw-r--r-- | src/H5CXprivate.h | 2 | ||||
-rw-r--r-- | src/H5Ftest.c | 4 | ||||
-rw-r--r-- | src/H5Gtest.c | 24 | ||||
-rw-r--r-- | src/H5Itest.c | 9 | ||||
-rw-r--r-- | src/H5Otest.c | 16 | ||||
-rw-r--r-- | src/H5VLint.c | 6 | ||||
-rw-r--r-- | src/H5private.h | 6 |
9 files changed, 56 insertions, 53 deletions
diff --git a/src/H5Atest.c b/src/H5Atest.c index 62d608e..6537a9d 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() ) */ @@ -932,9 +932,11 @@ H5CX_retrieve_state(H5CX_state_t **api_state) /* Keep a reference to the current VOL wrapping context */ (*api_state)->vol_wrap_ctx = (*head)->ctx.vol_wrap_ctx; - if (NULL != (*api_state)->vol_wrap_ctx) + if (NULL != (*api_state)->vol_wrap_ctx) { + HDassert((*head)->ctx.vol_wrap_ctx_valid); if (H5VL_inc_vol_wrapper((*api_state)->vol_wrap_ctx) < 0) HGOTO_ERROR(H5E_CONTEXT, H5E_CANTINC, FAIL, "can't increment refcount on VOL wrapping context") + } /* end if */ /* Keep a copy of the VOL connector property, if there is one */ if ((*head)->ctx.vol_connector_prop_valid && (*head)->ctx.vol_connector_prop.connector_id > 0) { @@ -1023,6 +1025,8 @@ H5CX_restore_state(const H5CX_state_t *api_state) /* Restore the VOL wrapper context */ (*head)->ctx.vol_wrap_ctx = api_state->vol_wrap_ctx; + if (NULL != (*head)->ctx.vol_wrap_ctx) + (*head)->ctx.vol_wrap_ctx_valid = TRUE; /* Restore the VOL connector info */ if (api_state->vol_connector_prop.connector_id) { @@ -3559,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 */ @@ -3575,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); @@ -3614,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 */ @@ -3622,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 f9289cb..c500356 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 03b613c..b76c579 100644 --- a/src/H5Ftest.c +++ b/src/H5Ftest.c @@ -118,7 +118,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) @@ -162,7 +162,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 81adc86..0d21f22 100644 --- a/src/H5Gtest.c +++ b/src/H5Gtest.c @@ -11,7 +11,7 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* Programmer: Quincey Koziol <koziol@ncsa.uiuc.edu> +/* Programmer: Quincey Koziol * Monday, October 17, 2005 * * Purpose: Group testing functions. @@ -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) @@ -553,10 +553,10 @@ done: herr_t H5G__user_path_test(hid_t obj_id, char *user_path, size_t *user_path_len, unsigned *obj_hidden) { - void * obj_ptr; /* Pointer to object for ID */ - H5G_name_t *obj_path; /* Pointer to group hier. path for obj */ - hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ - herr_t ret_value = SUCCEED; /* Return value */ + void * obj_ptr; /* Pointer to object for ID */ + const H5G_name_t *obj_path; /* Pointer to group hier. path for obj */ + hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -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 defc587..6f2c03a 100644 --- a/src/H5Itest.c +++ b/src/H5Itest.c @@ -11,10 +11,8 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* Programmer: Quincey Koziol <koziol@hdfgoup.org> - * Tuesday, July 27, 2010 - * - * Purpose: ID testing functions. +/* + * H5Itest.c - ID testing functions */ /****************/ @@ -28,7 +26,6 @@ /* Headers */ /***********/ #include "H5private.h" /* Generic Functions */ -#include "H5ACprivate.h" /* Metadata cache */ #include "H5CXprivate.h" /* API Contexts */ #include "H5Eprivate.h" /* Error handling */ #include "H5Gprivate.h" /* Groups */ @@ -105,7 +102,7 @@ done: if (vol_wrapper_set && H5VL_reset_vol_wrapper() < 0) HDONE_ERROR(H5E_ATOM, 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 0c7fb69..48bc77f 100644 --- a/src/H5Otest.c +++ b/src/H5Otest.c @@ -11,7 +11,7 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* Programmer: Quincey Koziol <koziol@hdfgroup.org> +/* Programmer: Quincey Koziol * Monday, December 4, 2006 * * Purpose: Object header testing functions. @@ -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,8 +778,8 @@ 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) -} /* H5O__msg_get_chunkno_test() */ +} /* H5O__msg_move_to_new_chunk_test() */ diff --git a/src/H5VLint.c b/src/H5VLint.c index b7ea708..289dfef 100644 --- a/src/H5VLint.c +++ b/src/H5VLint.c @@ -222,7 +222,7 @@ H5VL__init_package(void) FUNC_ENTER_PACKAGE - /* Initialize the atom group for the VL IDs */ + /* Initialize the ID group for the VL IDs */ if (H5I_register_type(H5I_VOL_CLS) < 0) HGOTO_ERROR(H5E_VOL, H5E_CANTINIT, FAIL, "unable to initialize H5VL interface") @@ -710,7 +710,7 @@ H5VL_register(H5I_type_t type, void *object, H5VL_t *vol_connector, hbool_t app_ /* Register VOL object as _object_ type, for future object API calls */ if ((ret_value = H5I_register(type, vol_obj, app_ref)) < 0) - HGOTO_ERROR(H5E_VOL, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to atomize handle") + HGOTO_ERROR(H5E_VOL, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register handle") done: FUNC_LEAVE_NOAPI(ret_value) @@ -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 16291ca..0e824c8 100644 --- a/src/H5private.h +++ b/src/H5private.h @@ -2165,7 +2165,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) \ @@ -2568,7 +2568,7 @@ H5_DLL herr_t H5CX_pop(void); #define FUNC_LEAVE_API(ret_value) \ VFD_SWMR_LEAVE(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); \ @@ -2580,7 +2580,7 @@ H5_DLL herr_t H5CX_pop(void); /* Use this macro when VFD SWMR EOT is not used on leaving an API function */ #define FUNC_LEAVE_API_NO_EOT(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); \ |