Skip to content

Commit

Permalink
Merge pull request #2652 in HDFFV/hdf5 from hdf5_1_12_opt_h5open_over…
Browse files Browse the repository at this point in the history
…head to hdf5_1_12

* commit '0a091d879133ff5f54199aaeeeb274a5b2883a77':
  Add info to release notes.
  Reduce overhead for H5open, which is involved in the public symbols like H5T_NATIVE_INT, etc.
  • Loading branch information
qkoziol committed Jun 19, 2020
2 parents 7acf788 + 0a091d8 commit f9f1310
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 5 deletions.
5 changes: 5 additions & 0 deletions release_docs/RELEASE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,11 @@ Bug Fixes since HDF5-1.12.0 release
==================================
Library
-------
- Reduce overhead for H5open(), which is involved in public symbols like
H5T_NATIVE_INT, etc.

(QAK - 2020/06/18)

- Cache last ID looked up for an ID type (dataset, datatype, file, etc),
improving performance when accessing the same ID repeatedly.

Expand Down
8 changes: 5 additions & 3 deletions src/H5.c
Original file line number Diff line number Diff line change
Expand Up @@ -936,11 +936,13 @@ H5open(void)
{
herr_t ret_value=SUCCEED; /* Return value */

FUNC_ENTER_API_NOCLEAR(FAIL)
H5TRACE0("e","");
FUNC_ENTER_API_NOPUSH(FAIL)
/*NO TRACE*/

/* all work is done by FUNC_ENTER() */

done:
FUNC_LEAVE_API(ret_value)
FUNC_LEAVE_API_NOPUSH(ret_value)
} /* end H5open() */


Expand Down
29 changes: 27 additions & 2 deletions src/H5private.h
Original file line number Diff line number Diff line change
Expand Up @@ -2081,8 +2081,9 @@ H5_DLL herr_t H5CX_pop(void);
} /* end if */ \
\
/* Initialize the package, if appropriate */ \
H5_PACKAGE_INIT(H5_MY_PKG_INIT, err) \
\
H5_PACKAGE_INIT(H5_MY_PKG_INIT, err)

#define FUNC_ENTER_API_PUSH(err) \
/* Push the name of this function on the function stack */ \
H5_PUSH_FUNC \
\
Expand All @@ -2096,6 +2097,7 @@ H5_DLL herr_t H5CX_pop(void);
#define FUNC_ENTER_API(err) {{ \
FUNC_ENTER_API_COMMON \
FUNC_ENTER_API_INIT(err); \
FUNC_ENTER_API_PUSH(err); \
/* Clear thread error stack entering public functions */ \
H5E_clear_stack(NULL); \
{
Expand All @@ -2107,6 +2109,7 @@ H5_DLL herr_t H5CX_pop(void);
#define FUNC_ENTER_API_NOCLEAR(err) {{ \
FUNC_ENTER_API_COMMON \
FUNC_ENTER_API_INIT(err); \
FUNC_ENTER_API_PUSH(err); \
{

/*
Expand Down Expand Up @@ -2136,6 +2139,18 @@ H5_DLL herr_t H5CX_pop(void);
BEGIN_MPE_LOG \
{

/*
* Use this macro for API functions that should only perform initialization
* of the library or an interface, but not push any state (API context,
* function name, start MPE logging, etc) examples are: H5open.
*
*/
#define FUNC_ENTER_API_NOPUSH(err) {{{{{ \
FUNC_ENTER_COMMON(H5_IS_API(FUNC)); \
FUNC_ENTER_API_THREADSAFE; \
FUNC_ENTER_API_INIT(err); \
{

/* Note: this macro only works when there's _no_ interface initialization routine for the module */
#define FUNC_ENTER_NOAPI_INIT(err) \
/* Initialize the package, if appropriate */ \
Expand Down Expand Up @@ -2325,6 +2340,16 @@ H5_DLL herr_t H5CX_pop(void);
return(ret_value); \
}}}} /*end scope from beginning of FUNC_ENTER*/

/* Use this macro to match the FUNC_ENTER_API_NOPUSH macro */
#define FUNC_LEAVE_API_NOPUSH(ret_value) \
; \
} /*end scope from end of FUNC_ENTER*/ \
if(err_occurred) \
(void)H5E_dump_api_stack(TRUE); \
FUNC_LEAVE_API_THREADSAFE \
return(ret_value); \
}}}}} /*end scope from beginning of FUNC_ENTER*/

#define FUNC_LEAVE_NOAPI(ret_value) \
; \
} /*end scope from end of FUNC_ENTER*/ \
Expand Down

0 comments on commit f9f1310

Please sign in to comment.