diff options
author | Allen Byrne <byrn@hdfgroup.org> | 2018-04-06 14:21:06 (GMT) |
---|---|---|
committer | Allen Byrne <byrn@hdfgroup.org> | 2018-04-06 14:21:06 (GMT) |
commit | 5e943e85e27645f03ec44fe36d007821bf29d6b6 (patch) | |
tree | 0ea16d3d7cbb1f20ed6aba5d132df311b19635a7 /src/H5Atest.c | |
parent | f6a5236e43ab8d461d472ecda9d70297fb7a53b5 (diff) | |
parent | 048ae59d2970dd21810577c999f756c028b6faaf (diff) | |
download | hdf5-5e943e85e27645f03ec44fe36d007821bf29d6b6.zip hdf5-5e943e85e27645f03ec44fe36d007821bf29d6b6.tar.gz hdf5-5e943e85e27645f03ec44fe36d007821bf29d6b6.tar.bz2 |
Merging in latest from upstream (HDFFV/hdf5:refs/heads/develop)
* commit '048ae59d2970dd21810577c999f756c028b6faaf':
Correct errors with non-"instrumented library" builds (production & parallel, generally speaking).
Update java error stack tests
Revert using H5MF_sect_small_can_shrink and H5MF_sect_small_shrink for the file's free space manager (and add a comment about them).
Add comment for the file flush when the file low / high bounds are changed after a file is open.
Expanded comments abuot H5CX_t fields.
Add an assert to verify that we don't write when between MPI_Barrier() calls during a flush.
Add comments for internal structs.
Remove redundant 'is_collective' parameter from H5CX_set_loc.
Correct typo in comment.
Revert some tangential code cleanups.
Add API context source files to CMake configuration file.
Corrections for parallel I/O & tests.
Update handling of reporting for breaking collective I/O when the default DXPL is used.
Update encoded DXPLs to reflect changes in properties.
Correct typo for error checking malloc return value.
Refactor H5CX code to reduce duplication.
Cleanup API context function usage.
Add API context interface and use it throughout the library.
Diffstat (limited to 'src/H5Atest.c')
-rw-r--r-- | src/H5Atest.c | 29 |
1 files changed, 19 insertions, 10 deletions
diff --git a/src/H5Atest.c b/src/H5Atest.c index b923637..31fbe8e 100644 --- a/src/H5Atest.c +++ b/src/H5Atest.c @@ -36,6 +36,7 @@ #include "H5private.h" /* Generic Functions */ #include "H5Apkg.h" /* Attributes */ #include "H5ACprivate.h" /* Metadata cache */ +#include "H5CXprivate.h" /* API Contexts */ #include "H5Eprivate.h" /* Error handling */ #include "H5Iprivate.h" /* IDs */ #include "H5SMprivate.h" /* Shared object header messages */ @@ -77,7 +78,7 @@ /*------------------------------------------------------------------------- - * Function: H5A_is_shared_test + * Function: H5A__is_shared_test * * Purpose: Check if an attribute is shared * @@ -90,12 +91,12 @@ *------------------------------------------------------------------------- */ htri_t -H5A_is_shared_test(hid_t attr_id) +H5A__is_shared_test(hid_t attr_id) { H5A_t *attr; /* Attribute object for ID */ htri_t ret_value = FAIL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* Check arguments */ if(NULL == (attr = (H5A_t *)H5I_object_verify(attr_id, H5I_ATTR))) @@ -106,11 +107,11 @@ H5A_is_shared_test(hid_t attr_id) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5A_is_shared_test() */ +} /* end H5A__is_shared_test() */ /*------------------------------------------------------------------------- - * Function: H5A_get_shared_rc_test + * Function: H5A__get_shared_rc_test * * Purpose: Retrieve the refcount for a shared attribute * @@ -123,26 +124,34 @@ done: *------------------------------------------------------------------------- */ herr_t -H5A_get_shared_rc_test(hid_t attr_id, hsize_t *ref_count) +H5A__get_shared_rc_test(hid_t attr_id, hsize_t *ref_count) { H5A_t *attr; /* Attribute object for ID */ + hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* Check arguments */ if(NULL == (attr = (H5A_t *)H5I_object_verify(attr_id, H5I_ATTR))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not an attribute") + /* Push API context */ + if(H5CX_push() < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set API context") + api_ctx_pushed = TRUE; + /* Sanity check */ HDassert(H5O_msg_is_shared(H5O_ATTR_ID, attr)); /* Retrieve ref count for shared or shareable attribute */ - if(H5SM_get_refcount(attr->oloc.file, H5AC_ind_read_dxpl_id, H5O_ATTR_ID, - &attr->sh_loc, ref_count) < 0) + if(H5SM_get_refcount(attr->oloc.file, H5O_ATTR_ID, &attr->sh_loc, ref_count) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't retrieve shared message ref count") done: + if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_ATTR, H5E_CANTRESET, FAIL, "can't reset API context") + FUNC_LEAVE_NOAPI(ret_value) -} /* end H5A_get_shared_rc_test() */ +} /* end H5A__get_shared_rc_test() */ |