diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2009-11-16 20:45:05 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2009-11-16 20:45:05 (GMT) |
commit | d2b87ec47ebdb096c331c7b62a195b9cea2f33ae (patch) | |
tree | a066f01361afaf5df457cef612bb0bb9fd80fe18 /src/H5private.h | |
parent | ee5a1e07350f0dcf3ef07d9443aa2f4c073392f4 (diff) | |
download | hdf5-d2b87ec47ebdb096c331c7b62a195b9cea2f33ae.zip hdf5-d2b87ec47ebdb096c331c7b62a195b9cea2f33ae.tar.gz hdf5-d2b87ec47ebdb096c331c7b62a195b9cea2f33ae.tar.bz2 |
[svn-r17896] Description:
Bring r17546:17895 from trunk to revise_chunks branch. Changes to
fixed and extensible array dataset chunk indexing code to accommodate changes
to private APIs in those interfaces. Also, other adjustments to source code
and expected output in response to changes on the trunk.
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x,
w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers, w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in debug mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.6.2 (amazon) in debug mode
Mac OS X/32 10.6.2 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
Diffstat (limited to 'src/H5private.h')
-rw-r--r-- | src/H5private.h | 142 |
1 files changed, 84 insertions, 58 deletions
diff --git a/src/H5private.h b/src/H5private.h index 2c4576f..65800fc 100644 --- a/src/H5private.h +++ b/src/H5private.h @@ -460,6 +460,11 @@ typedef enum { H5_COPY_DEEP /* Deep copy from source to destination, including duplicating fields pointed to */ } H5_copy_depth_t; +/* Common object copying udata (right now only used for groups and datasets) */ +typedef struct H5O_copy_file_ud_common_t { + struct H5O_pline_t *src_pline; /* Copy of filter pipeline for object */ +} H5O_copy_file_ud_common_t; + /* Unique object "position" */ typedef struct { unsigned long fileno; /* The unique identifier for the file of the object */ @@ -1743,10 +1748,14 @@ static herr_t H5_INTERFACE_INIT_FUNC(void); #define FUNC_ENTER_COMMON_NOFUNC(func_name,asrt) #endif /* NDEBUG */ -#define FUNC_ENTER_COMMON(func_name,asrt) \ - static const char FUNC[]=#func_name; \ +#define FUNC_ENTER_COMMON(func_name, asrt) \ + static const char FUNC[] = #func_name; \ hbool_t err_occurred = FALSE; \ - FUNC_ENTER_COMMON_NOFUNC(func_name,asrt); + FUNC_ENTER_COMMON_NOFUNC(func_name, asrt); + +#define FUNC_ENTER_COMMON_NOERR(func_name, asrt) \ + static const char FUNC[] = #func_name; \ + FUNC_ENTER_COMMON_NOFUNC(func_name, asrt); /* Threadsafety initialization code for API routines */ #define FUNC_ENTER_API_THREADSAFE \ @@ -1757,22 +1766,37 @@ static herr_t H5_INTERFACE_INIT_FUNC(void); H5_API_UNSET_CANCEL \ H5_API_LOCK -/* Threadsafety termination code for API routines */ -#define FUNC_LEAVE_API_THREADSAFE \ - H5_API_UNLOCK \ - H5_API_SET_CANCEL - /* Local variables for API routines */ #define FUNC_ENTER_API_VARS(func_name) \ MPE_LOG_VARS(func_name) \ H5TRACE_DECL +#define FUNC_ENTER_API_COMMON(func_name) \ + FUNC_ENTER_API_VARS(func_name) \ + FUNC_ENTER_COMMON(func_name, H5_IS_API(#func_name)); \ + FUNC_ENTER_API_THREADSAFE; + +#define FUNC_ENTER_API_INIT(func_name,err) \ + /* Initialize the library */ \ + if(!(H5_INIT_GLOBAL)) { \ + H5_INIT_GLOBAL = TRUE; \ + if(H5_init_library() < 0) \ + HGOTO_ERROR(H5E_FUNC, H5E_CANTINIT, err, \ + "library initialization failed") \ + } \ + \ + /* Initialize the interface, if appropriate */ \ + H5_INTERFACE_INIT(err) \ + \ + /* Push the name of this function on the function stack */ \ + H5_PUSH_FUNC(#func_name) \ + \ + BEGIN_MPE_LOG(func_name) + /* Use this macro for all "normal" API functions */ #define FUNC_ENTER_API(func_name,err) {{ \ - FUNC_ENTER_API_VARS(func_name) \ - FUNC_ENTER_COMMON(func_name,H5_IS_API(#func_name)); \ - FUNC_ENTER_API_THREADSAFE; \ - FUNC_ENTER_API_COMMON(func_name,err); \ + FUNC_ENTER_API_COMMON(func_name) \ + FUNC_ENTER_API_INIT(func_name,err); \ /* Clear thread error stack entering public functions */ \ H5E_clear_stack(NULL); \ { @@ -1782,10 +1806,8 @@ static herr_t H5_INTERFACE_INIT_FUNC(void); * like H5Eprint and H5Ewalk. */ #define FUNC_ENTER_API_NOCLEAR(func_name,err) {{ \ - FUNC_ENTER_API_VARS(func_name) \ - FUNC_ENTER_COMMON(func_name,H5_IS_API(#func_name)); \ - FUNC_ENTER_API_THREADSAFE; \ - FUNC_ENTER_API_COMMON(func_name,err); \ + FUNC_ENTER_API_COMMON(func_name) \ + FUNC_ENTER_API_INIT(func_name,err); \ { /* @@ -1795,9 +1817,7 @@ static herr_t H5_INTERFACE_INIT_FUNC(void); * */ #define FUNC_ENTER_API_NOINIT(func_name) {{ \ - FUNC_ENTER_API_VARS(func_name) \ - FUNC_ENTER_COMMON(func_name,H5_IS_API(#func_name)); \ - FUNC_ENTER_API_THREADSAFE; \ + FUNC_ENTER_API_COMMON(func_name) \ H5_PUSH_FUNC(#func_name) \ BEGIN_MPE_LOG(func_name); \ { @@ -1809,16 +1829,30 @@ static herr_t H5_INTERFACE_INIT_FUNC(void); * are: H5close, H5check_version, etc. * */ -#define FUNC_ENTER_API_NOINIT_NOFS(func_name) {{ \ +#define FUNC_ENTER_API_NOINIT_NOERR_NOFS(func_name) {{ \ FUNC_ENTER_API_VARS(func_name) \ - FUNC_ENTER_COMMON(func_name,H5_IS_API(#func_name)); \ - FUNC_ENTER_API_THREADSAFE; \ + FUNC_ENTER_COMMON_NOERR(func_name, H5_IS_API(#func_name)); \ + FUNC_ENTER_API_THREADSAFE; \ BEGIN_MPE_LOG(func_name); \ { +/* Note: this macro only works when there's _no_ interface initialization routine for the module */ +#define FUNC_ENTER_NOAPI_INIT(func_name,err) \ + /* Initialize the interface, if appropriate */ \ + H5_INTERFACE_INIT(err) \ + \ + /* Push the name of this function on the function stack */ \ + H5_PUSH_FUNC(#func_name) + /* Use this macro for all "normal" non-API functions */ #define FUNC_ENTER_NOAPI(func_name,err) { \ - FUNC_ENTER_COMMON(func_name,!H5_IS_API(#func_name)); \ + FUNC_ENTER_COMMON(func_name, !H5_IS_API(#func_name)); \ + FUNC_ENTER_NOAPI_INIT(func_name,err) \ + { + +/* Use this macro for all non-API functions, which propagate errors, but don't issue them */ +#define FUNC_ENTER_NOAPI_NOERR(func_name,err) { \ + FUNC_ENTER_COMMON_NOERR(func_name, !H5_IS_API(#func_name)); \ FUNC_ENTER_NOAPI_INIT(func_name,err) \ { @@ -1836,8 +1870,22 @@ static herr_t H5_INTERFACE_INIT_FUNC(void); * - functions which are called during library shutdown, since we don't * want to re-initialize the library. */ -#define FUNC_ENTER_NOAPI_NOINIT(func_name) { \ - FUNC_ENTER_COMMON(func_name,!H5_IS_API(#func_name)); \ +#define FUNC_ENTER_NOAPI_NOINIT(func_name) { \ + FUNC_ENTER_COMMON(func_name, !H5_IS_API(#func_name)); \ + H5_PUSH_FUNC(#func_name) \ + { + +/* + * Use this macro for non-API functions which fall into these categories: + * - static functions, since they must be called from a function in the + * interface, the library and interface must already be + * initialized. + * - functions which are called during library shutdown, since we don't + * want to re-initialize the library. + * - functions that propagate, but don't issue errors + */ +#define FUNC_ENTER_NOAPI_NOINIT_NOERR(func_name) { \ + FUNC_ENTER_COMMON_NOERR(func_name, !H5_IS_API(#func_name)); \ H5_PUSH_FUNC(#func_name) \ { @@ -1871,31 +1919,6 @@ static herr_t H5_INTERFACE_INIT_FUNC(void); FUNC_ENTER_COMMON_NOFUNC(func_name,!H5_IS_API(#func_name)); \ { -#define FUNC_ENTER_API_COMMON(func_name,err) \ - /* Initialize the library */ \ - if (!(H5_INIT_GLOBAL)) { \ - H5_INIT_GLOBAL = TRUE; \ - if (H5_init_library()<0) \ - HGOTO_ERROR (H5E_FUNC, H5E_CANTINIT, err, \ - "library initialization failed") \ - } \ - \ - /* Initialize the interface, if appropriate */ \ - H5_INTERFACE_INIT(err) \ - \ - /* Push the name of this function on the function stack */ \ - H5_PUSH_FUNC(#func_name) \ - \ - BEGIN_MPE_LOG(func_name) - -/* Note: this macro only works when there's _no_ interface initialization routine for the module */ -#define FUNC_ENTER_NOAPI_INIT(func_name,err) \ - /* Initialize the interface, if appropriate */ \ - H5_INTERFACE_INIT(err) \ - \ - /* Push the name of this function on the function stack */ \ - H5_PUSH_FUNC(#func_name) - /*------------------------------------------------------------------------- * Purpose: Register function exit for code profiling. This should be * the last statement executed by a function. @@ -1912,6 +1935,11 @@ static herr_t H5_INTERFACE_INIT_FUNC(void); * *------------------------------------------------------------------------- */ +/* Threadsafety termination code for API routines */ +#define FUNC_LEAVE_API_THREADSAFE \ + H5_API_UNLOCK \ + H5_API_SET_CANCEL + #define FUNC_LEAVE_API(ret_value) \ FINISH_MPE_LOG; \ H5TRACE_RETURN(ret_value); \ @@ -1919,28 +1947,26 @@ static herr_t H5_INTERFACE_INIT_FUNC(void); if(err_occurred) \ (void)H5E_dump_api_stack(TRUE); \ FUNC_LEAVE_API_THREADSAFE \ - return (ret_value); \ + return(ret_value); \ } /*end scope from end of FUNC_ENTER*/ \ }} /*end scope from beginning of FUNC_ENTER*/ #define FUNC_LEAVE_API_NOFS(ret_value) \ FINISH_MPE_LOG; \ H5TRACE_RETURN(ret_value); \ - if(err_occurred) \ - (void)H5E_dump_api_stack(TRUE); \ FUNC_LEAVE_API_THREADSAFE \ - return (ret_value); \ + return(ret_value); \ } /*end scope from end of FUNC_ENTER*/ \ }} /*end scope from beginning of FUNC_ENTER*/ #define FUNC_LEAVE_NOAPI(ret_value) \ - H5_POP_FUNC \ - return (ret_value); \ + H5_POP_FUNC \ + return(ret_value); \ } /*end scope from end of FUNC_ENTER*/ \ } /*end scope from beginning of FUNC_ENTER*/ #define FUNC_LEAVE_NOAPI_VOID \ - H5_POP_FUNC \ + H5_POP_FUNC \ return; \ } /*end scope from end of FUNC_ENTER*/ \ } /*end scope from beginning of FUNC_ENTER*/ @@ -1951,7 +1977,7 @@ static herr_t H5_INTERFACE_INIT_FUNC(void); * (so far, just the H5CS routines themselves) */ #define FUNC_LEAVE_NOAPI_NOFS(ret_value) \ - return (ret_value); \ + return(ret_value); \ } /*end scope from end of FUNC_ENTER*/ \ } /*end scope from beginning of FUNC_ENTER*/ |