From 918973d9fc5b96cd559546eb5e09c87542ce598d Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Thu, 2 Jul 2009 14:22:12 -0500 Subject: [svn-r17143] Description: Bring r17084:17142 from trunk to revise_chunks brach Tested on: FreeBSD/32 6.3 (duty) (h5committest not required on this branch) --- MANIFEST | 1 - README.txt | 2 +- c++/src/Makefile.in | 2 +- config/lt_vers.am | 2 +- configure | 22 +-- configure.in | 2 +- fortran/src/H5Fff.f90 | 3 +- fortran/src/Makefile.in | 2 +- hl/c++/src/Makefile.in | 2 +- hl/fortran/src/Makefile.in | 2 +- hl/src/Makefile.in | 2 +- release_docs/INSTALL | 2 +- release_docs/RELEASE.txt | 4 +- src/H5A.c | 14 +- src/H5Aint.c | 3 - src/H5Apkg.h | 1 - src/H5EApkg.h | 303 +------------------------------ src/H5EAtest.c | 4 +- src/H5Eprivate.h | 62 ++++++- src/H5F.c | 12 +- src/H5Fpkg.h | 3 +- src/H5Fprivate.h | 2 + src/H5Fquery.c | 29 ++- src/H5HFdblock.c | 10 +- src/H5HFiblock.c | 30 ++- src/H5Oattr.c | 6 - src/H5Z.c | 2 +- src/H5private.h | 263 +++++++++++++++++++++++++++ src/H5public.h | 4 +- src/Makefile.in | 2 +- test/dsets.c | 11 ++ test/tattr.c | 62 +++++++ vms/src/h5pubconf.h | 6 +- windows/c++/examples/testcppExamples.BAT | 93 +--------- windows/src/H5pubconf.h | 6 +- 35 files changed, 510 insertions(+), 466 deletions(-) diff --git a/MANIFEST b/MANIFEST index e15d5b8..5b2437b 100644 --- a/MANIFEST +++ b/MANIFEST @@ -1644,7 +1644,6 @@ ./hl/test/test_table_be.hdf5 ./hl/test/test_table_cray.hdf5 ./hl/test/usa.wri -./hl/test/dtype_file.txt # tools ./hl/tools/COPYING diff --git a/README.txt b/README.txt index 0fe3513..63a7ba7 100644 --- a/README.txt +++ b/README.txt @@ -1,4 +1,4 @@ -HDF5 version 1.9.42-FA_a2 currently under development +HDF5 version 1.9.43-FA_a2 currently under development ==> README.txt <== Messages to be sent to the list should be sent to "@hdfgroup.org". diff --git a/c++/src/Makefile.in b/c++/src/Makefile.in index 8becac5..1309bcc 100644 --- a/c++/src/Makefile.in +++ b/c++/src/Makefile.in @@ -360,7 +360,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 32 +LT_VERS_REVISION = 33 LT_VERS_AGE = 0 # Include src directory diff --git a/config/lt_vers.am b/config/lt_vers.am index 46e9f0d..0542683 100644 --- a/config/lt_vers.am +++ b/config/lt_vers.am @@ -17,7 +17,7 @@ # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 32 +LT_VERS_REVISION = 33 LT_VERS_AGE = 0 ## If the API changes *at all*, increment LT_VERS_INTERFACE and diff --git a/configure b/configure index 22eb85d..4198694 100755 --- a/configure +++ b/configure @@ -1,7 +1,7 @@ #! /bin/sh -# From configure.in Id: configure.in 17019 2009-06-09 17:56:22Z koziol . +# From configure.in Id: configure.in 17047 2009-06-14 15:41:49Z lrknox . # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.61 for HDF5 1.9.42-FA_a2. +# Generated by GNU Autoconf 2.61 for HDF5 1.9.43-FA_a2. # # Report bugs to . # @@ -724,8 +724,8 @@ SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME='HDF5' PACKAGE_TARNAME='hdf5' -PACKAGE_VERSION='1.9.42-FA_a2' -PACKAGE_STRING='HDF5 1.9.42-FA_a2' +PACKAGE_VERSION='1.9.43-FA_a2' +PACKAGE_STRING='HDF5 1.9.43-FA_a2' PACKAGE_BUGREPORT='help@hdfgroup.org' ac_unique_file="src/H5.c" @@ -1502,7 +1502,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures HDF5 1.9.42-FA_a2 to adapt to many kinds of systems. +\`configure' configures HDF5 1.9.43-FA_a2 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1572,7 +1572,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of HDF5 1.9.42-FA_a2:";; + short | recursive ) echo "Configuration of HDF5 1.9.43-FA_a2:";; esac cat <<\_ACEOF @@ -1756,7 +1756,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -HDF5 configure 1.9.42-FA_a2 +HDF5 configure 1.9.43-FA_a2 generated by GNU Autoconf 2.61 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -1770,7 +1770,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by HDF5 $as_me 1.9.42-FA_a2, which was +It was created by HDF5 $as_me 1.9.43-FA_a2, which was generated by GNU Autoconf 2.61. Invocation command line was $ $0 $@ @@ -2465,7 +2465,7 @@ fi # Define the identity of the package. PACKAGE='hdf5' - VERSION='1.9.42-FA_a2' + VERSION='1.9.43-FA_a2' cat >>confdefs.h <<_ACEOF @@ -52523,7 +52523,7 @@ exec 6>&1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by HDF5 $as_me 1.9.42-FA_a2, which was +This file was extended by HDF5 $as_me 1.9.43-FA_a2, which was generated by GNU Autoconf 2.61. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -52576,7 +52576,7 @@ Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ -HDF5 config.status 1.9.42-FA_a2 +HDF5 config.status 1.9.43-FA_a2 configured by $0, generated by GNU Autoconf 2.61, with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" diff --git a/configure.in b/configure.in index 3ea4445..c5b9e68 100644 --- a/configure.in +++ b/configure.in @@ -26,7 +26,7 @@ dnl dnl NOTE: Don't forget to change the version number here when we do a dnl release!!! dnl -AC_INIT([HDF5], [1.9.42-FA_a2], [help@hdfgroup.org]) +AC_INIT([HDF5], [1.9.43-FA_a2], [help@hdfgroup.org]) AC_CONFIG_SRCDIR([src/H5.c]) AM_CONFIG_HEADER([src/H5config.h]) diff --git a/fortran/src/H5Fff.f90 b/fortran/src/H5Fff.f90 index 5d76865..43c7c8f 100644 --- a/fortran/src/H5Fff.f90 +++ b/fortran/src/H5Fff.f90 @@ -91,7 +91,8 @@ if (present(creation_prp)) creation_prp_default = creation_prp if (present(access_prp)) access_prp_default = access_prp - namelen = LEN(name) + namelen = LEN_TRIM(name) + hdferr = h5fcreate_c(name, namelen, access_flags, & creation_prp_default, access_prp_default, file_id) diff --git a/fortran/src/Makefile.in b/fortran/src/Makefile.in index dabafe1..5229ef2 100644 --- a/fortran/src/Makefile.in +++ b/fortran/src/Makefile.in @@ -389,7 +389,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 32 +LT_VERS_REVISION = 33 LT_VERS_AGE = 0 # Include src directory in both Fortran and C flags (C compiler is used diff --git a/hl/c++/src/Makefile.in b/hl/c++/src/Makefile.in index 97be687..6d32a58 100644 --- a/hl/c++/src/Makefile.in +++ b/hl/c++/src/Makefile.in @@ -349,7 +349,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 32 +LT_VERS_REVISION = 33 LT_VERS_AGE = 0 # Include src directory diff --git a/hl/fortran/src/Makefile.in b/hl/fortran/src/Makefile.in index f694eba..83b86b0 100644 --- a/hl/fortran/src/Makefile.in +++ b/hl/fortran/src/Makefile.in @@ -354,7 +354,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 32 +LT_VERS_REVISION = 33 LT_VERS_AGE = 0 INCLUDES = -I$(top_srcdir)/src -I$(top_srcdir)/hl/src -I$(top_builddir)/hl/src \ -I$(top_srcdir)/fortran/src -I$(top_builddir)/fortran/src diff --git a/hl/src/Makefile.in b/hl/src/Makefile.in index ddd9452..5d835b8 100644 --- a/hl/src/Makefile.in +++ b/hl/src/Makefile.in @@ -350,7 +350,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 32 +LT_VERS_REVISION = 33 LT_VERS_AGE = 0 # Add include directories to the C preprocessor flags diff --git a/release_docs/INSTALL b/release_docs/INSTALL index 9f18c55..3b84354 100644 --- a/release_docs/INSTALL +++ b/release_docs/INSTALL @@ -284,7 +284,7 @@ CONTENTS build the distribution with 64-bit support should specify the correct flags with the CC variable: - $ CC='cc -xarch=v9' ./configure + $ CC='cc -m64' ./configure To configure AIX 64-bit support including the Fortran and C++ APIs, (Note: need to set $AR to 'ar -X 64'.) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 4dd784a..af5fef5 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -1,4 +1,4 @@ -HDF5 version 1.9.42-FA_a2 currently under development +HDF5 version 1.9.43-FA_a2 currently under development ================================================================================ @@ -167,6 +167,8 @@ Bug Fixes since HDF5-1.8.0 release Library ------- + - Fixed a bug where H5Pget_fitler_by_id would succeed when called for a + filter that wasn't present. (NAF - 2009/06/25 - 1250) - Fixed an issue with committed compound datatypes containing a vlen. Also fixed memory leaks involving committed datatypes. (NAF - 2009/06/10 - 1593) diff --git a/src/H5A.c b/src/H5A.c index 325f7be..d359130 100644 --- a/src/H5A.c +++ b/src/H5A.c @@ -436,9 +436,6 @@ H5A_create(const H5G_loc_t *loc, const char *name, const H5T_t *type, if(H5S_set_latest_version(attr->shared->ds) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set latest version of dataspace") - /* Mark it initially set to initialized */ - attr->shared->initialized = TRUE; /*for now, set to false later*/ - /* Copy the object header information */ if(H5O_loc_copy(&(attr->oloc), loc->oloc, H5_COPY_DEEP) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, FAIL, "unable to copy entry") @@ -498,9 +495,6 @@ H5A_create(const H5G_loc_t *loc, const char *name, const H5T_t *type, if((ret_value = H5I_register(H5I_ATTR, attr, TRUE)) < 0) HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register attribute for ID") - /* Now it's safe to say it's uninitialized */ - attr->shared->initialized = FALSE; - done: /* Cleanup on failure */ if(ret_value < 0 && attr && H5A_close(attr) < 0) @@ -550,7 +544,6 @@ H5Aopen(hid_t loc_id, const char *attr_name, hid_t UNUSED aapl_id) /* Read in attribute from object header */ if(NULL == (attr = H5O_attr_open_by_name(loc.oloc, attr_name, H5AC_ind_dxpl_id))) HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, FAIL, "unable to load attribute info from object header") - attr->shared->initialized = TRUE; /* Finish initializing attribute */ if(H5A_open_common(&loc, attr) < 0) @@ -805,7 +798,6 @@ H5A_open_by_idx(const H5G_loc_t *loc, const char *obj_name, H5_index_t idx_type, /* Read in attribute from object header */ if(NULL == (attr = H5O_attr_open_by_idx(obj_loc.oloc, idx_type, order, n, dxpl_id))) HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, NULL, "unable to load attribute info from object header") - attr->shared->initialized = TRUE; /* Finish initializing attribute */ if(H5A_open_common(&obj_loc, attr) < 0) @@ -871,7 +863,6 @@ H5A_open_by_name(const H5G_loc_t *loc, const char *obj_name, const char *attr_na /* Read in attribute from object header */ if(NULL == (attr = H5O_attr_open_by_name(obj_loc.oloc, attr_name, dxpl_id))) HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, NULL, "unable to load attribute info from object header") - attr->shared->initialized = TRUE; /* Finish initializing attribute */ if(H5A_open_common(loc, attr) < 0) @@ -1036,9 +1027,6 @@ H5A_write(H5A_t *attr, const H5T_t *mem_type, const void *buf, hid_t dxpl_id) HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, FAIL, "unable to modify attribute") } /* end if */ - /* Indicate the the attribute doesn't need fill-values */ - attr->shared->initialized = TRUE; - done: /* Release resources */ if(src_id >= 0) @@ -1144,7 +1132,7 @@ H5A_read(const H5A_t *attr, const H5T_t *mem_type, void *buf, hid_t dxpl_id) dst_type_size = H5T_GET_SIZE(mem_type); /* Check if the attribute has any data yet, if not, fill with zeroes */ - if(attr->obj_opened && !attr->shared->initialized) + if(attr->obj_opened && !attr->shared->data) HDmemset(buf, 0, (dst_type_size * nelmts)); else { /* Attribute exists and has a value */ /* Convert memory buffer into disk buffer */ diff --git a/src/H5Aint.c b/src/H5Aint.c index 2ac17fa..475239a 100644 --- a/src/H5Aint.c +++ b/src/H5Aint.c @@ -1022,9 +1022,6 @@ H5A_attr_copy_file(const H5A_t *attr_src, H5F_t *file_dst, hbool_t *recompute_si if(H5A_set_version(file_dst, attr_dst) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, NULL, "unable to update attribute version") - /* Indicate that the fill values aren't to be written out */ - attr_dst->shared->initialized = TRUE; - /* Set return value */ ret_value = attr_dst; diff --git a/src/H5Apkg.h b/src/H5Apkg.h index 3c62635..4216fa3 100644 --- a/src/H5Apkg.h +++ b/src/H5Apkg.h @@ -75,7 +75,6 @@ /* Define the shared attribute structure */ typedef struct H5A_shared_t { unsigned version; /* Version to encode attribute with */ - hbool_t initialized;/* Indicate whether the attribute has been modified */ char *name; /* Attribute's name */ H5T_cset_t encoding; /* Character encoding of attribute name */ diff --git a/src/H5EApkg.h b/src/H5EApkg.h index e74e3b4..9b91bdb 100644 --- a/src/H5EApkg.h +++ b/src/H5EApkg.h @@ -34,307 +34,6 @@ /* Other private headers needed by this file */ #include "H5FLprivate.h" /* Free Lists */ -/************************************************/ -/* Revisions to FUNC_ENTER/LEAVE & Error Macros */ -/************************************************/ - -/* `S' is the name of a function which is being tested to check if it's */ -/* a public API function */ -#define H5_IS_PUB(S) (((HDisdigit(S[1]) || HDisupper(S[1])) && HDislower(S[2])) || \ - ((HDisdigit(S[2]) || HDisupper(S[2])) && HDislower(S[3])) || \ - (!S[4] || ((HDisdigit(S[3]) || HDisupper(S[3])) && HDislower(S[4])))) - -/* `S' is the name of a function which is being tested to check if it's */ -/* a private library function */ -#define H5_IS_PRIV(S) (((HDisdigit(S[1]) || HDisupper(S[1])) && '_' == S[2] && HDislower(S[3])) || \ - ((HDisdigit(S[2]) || HDisupper(S[2])) && '_' == S[3] && HDislower(S[4])) || \ - ((HDisdigit(S[3]) || HDisupper(S[3])) && '_' == S[4] && HDislower(S[5]))) - -/* `S' is the name of a function which is being tested to check if it's */ -/* a package private function */ -#define H5_IS_PKG(S) (((HDisdigit(S[1]) || HDisupper(S[1])) && '_' == S[2] && '_' == S[3] && HDislower(S[4])) || \ - ((HDisdigit(S[2]) || HDisupper(S[2])) && '_' == S[3] && '_' == S[4] && HDislower(S[5])) || \ - ((HDisdigit(S[3]) || HDisupper(S[3])) && '_' == S[4] && '_' == S[5] && HDislower(S[6]))) - -#ifndef NDEBUG -#define FUNC_ENTER_NAME_CHECK(asrt) \ - { \ - static hbool_t func_check = FALSE; \ - \ - if(!func_check) { \ - /* Check function naming status */ \ - HDassert(asrt); \ - \ - /* Don't check again */ \ - func_check = TRUE; \ - } /* end if */ \ - } /* end scope */ -#else /* NDEBUG */ -#define FUNC_ENTER_NAME_CHECK(asrt) -#endif /* NDEBUG */ - -/* Macros for referencing package initialization symbols */ -#define H5_PACKAGE_INIT_VAR(x) H5_GLUE3(H5_, x, _init_g) -#define H5_PACKAGE_INIT_FUNC(x) H5_GLUE(x, __pkg_init) - -/* Macros to check if a package is initialized */ -#define H5_CHECK_PACKAGE_INIT_REG_YES(asrt) HDassert(H5_PACKAGE_INIT_VAR(pkg)); -#define H5_CHECK_PACKAGE_INIT_REG_NO(asrt) -#define H5_CHECK_PACKAGE_INIT_INIT_YES(asrt) -#define H5_CHECK_PACKAGE_INIT_INIT_NO(asrt) - -/* Macros to initialize package, if a package initialization routine is defined */ -#define H5_PKG_YES_INIT(pkg) \ - if(!H5_PACKAGE_INIT_VAR(pkg)) { \ - if(H5_GLUE(pkg, _pkg_init)() < 0) { \ - /* (Can't use H5E_THROW here) */ \ - H5E_PRINTF(H5E_CANTINIT, "interface initialization failed"); \ - ret_value = fail_value; \ - goto func_init_failed; \ - } /* end if */ \ - } /* end if */ -#define H5_PKG_NO_INIT(pkg) - -/* Macros to declare package initialization symbols, if a package initialization routine is defined */ -#define H5_PKG_YES_INIT_VAR(pkg) extern hbool_t H5_PACKAGE_INIT_VAR(H5_MY_PKG); -#define H5_PKG_NO_INIT_VAR(pkg) -#define H5_PKG_YES_INIT_FUNC(pkg) extern herr_t H5_PACKAGE_INIT_FUNC(pkg)(void); -#define H5_PKG_NO_INIT_FUNC(pkg) - -/* Declare package initialization symbols (if in a package) */ -#define H5_DECLARE_PKG_VAR(pkg_init, pkg) H5_GLUE3(H5_PKG_, pkg_init, _INIT_VAR)(pkg) -#define H5_DECLARE_PKG_FUNC(pkg_init, pkg) H5_GLUE3(H5_PKG_, pkg_init, _INIT_FUNC)(pkg) -#ifdef H5_MY_PKG -H5_DECLARE_PKG_VAR(H5_MY_PKG_INIT, H5_MY_PKG) -H5_DECLARE_PKG_FUNC(H5_MY_PKG_INIT, H5_MY_PKG) -#endif /* H5_MY_PKG */ - -/* API re-entrance variable */ -extern hbool_t H5_api_entered_g; /* Has library already been entered through API? */ - -/* Use FUNC to safely handle variations of C99 __func__ keyword handling */ -#ifdef H5_HAVE_C99_FUNC -#define FUNC __func__ -#elif defined(H5_HAVE_FUNCTION) -#define FUNC __FUNCTION__ -#else -#error "We need __func__ or __FUNCTION__ to test function names!" -#endif - -/* Macros for entering different scopes of routines */ -#define H5_PACKAGE_ENTER(pkg, pkg_init, init) \ - FUNC_ENTER_NAME_CHECK(H5_IS_PKG(FUNC)) \ - \ - /* The library should be initialized already */ \ - HDassert(H5_INIT_GLOBAL); \ - \ - /* This interface should be initialized already */ \ - /* (except for package initialization routines :-) */ \ - H5_GLUE4(H5_CHECK_PACKAGE_INIT_, init, _, pkg_init)(pkg) \ - \ - /* Push the name of this function on the function stack */ \ - H5_PUSH_FUNC(FUNC) \ - \ - /* Enter scope for this type of function */ \ - { - -#define H5_PRIVATE_ENTER(pkg, pkg_init) \ - FUNC_ENTER_NAME_CHECK(H5_IS_PRIV(FUNC)) \ - \ - /* The library should be initialized already */ \ - HDassert(H5_INIT_GLOBAL); \ - \ - /* Initialize this interface if desired */ \ - H5_GLUE3(H5_PKG_, pkg_init, _INIT)(pkg) \ - \ - /* Push the name of this function on the function stack */ \ - H5_PUSH_FUNC(FUNC) \ - \ - /* Enter scope for this type of function */ \ - {{ - -#define H5_PUBLIC_ENTER(pkg, pkg_init) \ - FUNC_ENTER_API_VARS(FUNC) \ - FUNC_ENTER_API_THREADSAFE; \ - FUNC_ENTER_NAME_CHECK(H5_IS_PUB(FUNC)) \ - \ - /* Clear thread error stack when entering public functions */ \ - H5E_clear_stack(NULL); \ - \ - /* Initialize the library or bust */ \ - if(!(H5_INIT_GLOBAL)) { \ - H5_INIT_GLOBAL = TRUE; \ - if(H5_init_library() < 0) { \ - /* (Can't use H5E_THROW here) */ \ - H5E_PRINTF(H5E_CANTINIT, "interface initialization failed"); \ - ret_value = fail_value; \ - goto func_init_failed; \ - } /* end if */ \ - } /* end if */ \ - \ - /* Initialize this interface if desired */ \ - H5_GLUE3(H5_PKG_, pkg_init, _INIT)(pkg) \ - \ - /* Check for re-entering API routine */ \ - HDassert(!H5_api_entered_g); \ - H5_api_entered_g = TRUE; \ - \ - /* Start logging MPI's MPE information */ \ - BEGIN_MPE_LOG(FUNC) \ - \ - /* Push the name of this function on the function stack */ \ - H5_PUSH_FUNC(FUNC) \ - \ - /* Enter scope for this type of function */ \ - {{{ - -/* Macros for substituting the package name */ -#define FUNC_ENTER_STATIC H5_PACKAGE_ENTER(H5_MY_PKG, H5_MY_PKG_INIT, REG) -#define FUNC_ENTER_PKGINIT H5_PACKAGE_ENTER(H5_MY_PKG, H5_MY_PKG_INIT, INIT) -#define FUNC_ENTER_PKG H5_PACKAGE_ENTER(H5_MY_PKG, H5_MY_PKG_INIT, REG) -#define FUNC_ENTER_PRIV H5_PRIVATE_ENTER(H5_MY_PKG, H5_MY_PKG_INIT) -#define FUNC_ENTER_PUB H5_PUBLIC_ENTER(H5_MY_PKG, H5_MY_PKG_INIT) - -/* Macros for substituting a function prefix */ -#define FUNC_PREFIX_STATIC static -#define FUNC_PREFIX_PKGINIT -#define FUNC_PREFIX_PKG -#define FUNC_PREFIX_PRIV -#define FUNC_PREFIX_PUB - -/* Macros for declaring error variables */ -#define FUNC_ERR_VAR_ERR(ret_typ, err) \ - hbool_t past_catch = FALSE; \ - ret_typ fail_value = err; -#define FUNC_ERR_VAR_ERRCATCH(ret_typ, err) \ - hbool_t past_catch = FALSE; -#define FUNC_ERR_VAR_NOERR(ret_typ, err) - -/* Use this macro when entering all functions */ -#define BEGIN_FUNC(scope, use_err, ret_typ, ret_init, err, func) \ -H5_GLUE(FUNC_PREFIX_, scope) \ -ret_typ \ -func \ -/* Open function */ \ -{ \ - ret_typ ret_value = ret_init; \ - H5_GLUE(FUNC_ERR_VAR_, use_err)(ret_typ, err) \ - H5_GLUE(FUNC_ENTER_, scope) - -/* Macros for label when a function initialization can fail */ -#define H5_PRIV_YES_FUNC_INIT_FAILED func_init_failed: -#define H5_PRIV_NO_FUNC_INIT_FAILED -#define H5_PRIV_FUNC_INIT_FAILED(pkg_init) H5_GLUE3(H5_PRIV_, pkg_init, _FUNC_INIT_FAILED) - -/* Macros for leaving different scopes of routines */ -#define FUNC_LEAVE_PKGINIT \ - /* Leave scope for this type of function */ \ - } \ - \ - /* Pop the name of this function off the function stack */ \ - H5_POP_FUNC - -#define FUNC_LEAVE_STATIC \ - /* Leave scope for this type of function */ \ - } \ - \ - /* Pop the name of this function off the function stack */ \ - H5_POP_FUNC - -#define FUNC_LEAVE_PKG \ - /* Leave scope for this type of function */ \ - } \ - \ - /* Pop the name of this function off the function stack */ \ - H5_POP_FUNC - -#define FUNC_LEAVE_PRIV \ - /* Leave scope for this type of function */ \ - }} \ - \ - /* Label for errors during FUNC_ENTER */ \ - H5_PRIV_FUNC_INIT_FAILED(H5_MY_PKG_INIT) \ - \ - /* Pop the name of this function off the function stack */ \ - H5_POP_FUNC - -#define FUNC_LEAVE_PUB \ - /* Leave scope for this type of function */ \ - }}} \ - \ - /* Label for errors during FUNC_ENTER */ \ -func_init_failed: \ - \ - /* Dump error stack if an error occurred during API routine */ \ - if(ret_value == fail_value) \ - (void)H5E_dump_api_stack(TRUE); \ - \ - /* Finish the API tracing info */ \ - H5TRACE_RETURN(ret_value); \ - \ - /* Pop the name of this function off the function stack */ \ - H5_POP_FUNC \ - \ - /* Finish the MPE tracing info */ \ - FINISH_MPE_LOG; \ - \ - /* Check for leaving API routine */ \ - HDassert(H5_api_entered_g); \ - H5_api_entered_g = FALSE; \ - \ - /* Release thread-safety semaphore */ \ - FUNC_LEAVE_API_THREADSAFE - -/* Use this macro when leaving all functions */ -#define END_FUNC(scope) \ - /* Scope-specific function conclusion */ \ - H5_GLUE(FUNC_LEAVE_, scope) \ - \ - /* Leave routine */ \ - return(ret_value); \ - \ - /* Close Function */ \ -} - - -/* - * H5E_PRINTF macro, used to facilitate error reporting between a BEGIN_FUNC() - * and an END_FUNC() within a function body. The arguments are the minor - * error number, a description of the error (as a printf-like format string), - * and an optional set of arguments for the printf format arguments. - */ -#define H5E_PRINTF(...) H5E_printf_stack(NULL, __FILE__, FUNC, __LINE__, H5E_ERR_CLS_g, H5_MY_PKG_ERR, __VA_ARGS__) - -/* - * H5_LEAVE macro, used to facilitate control flow between a - * BEGIN_FUNC() and an END_FUNC() within a function body. The argument is - * the return value. - * The return value is assigned to a variable `ret_value' and control branches - * to the `catch_except' label, if we're not already past it. - */ -#define H5_LEAVE(v) { \ - ret_value = v; \ - if(!past_catch) \ - goto catch_except; \ -} - -/* - * H5E_THROW macro, used to facilitate error reporting between a - * FUNC_ENTER() and a FUNC_LEAVE() within a function body. The arguments are - * the minor error number, and an error string. - * The return value is assigned to a variable `ret_value' and control branches - * to the `catch_except' label, if we're not already past it. - */ -#define H5E_THROW(...) { \ - H5E_PRINTF(__VA_ARGS__); \ - H5_LEAVE(fail_value) \ -} - -/* Macro for "catching" flow of control when an error occurs. Note that the - * H5_LEAVE macro won't jump back here once it's past this point. - */ -#define CATCH past_catch = TRUE; catch_except:; - /**************************/ /* Package Private Macros */ @@ -370,7 +69,7 @@ func_init_failed: \ /* General metadata fields */ \ H5EA_METADATA_PREFIX_SIZE(TRUE) \ \ - /* General heap information */ \ + /* General array information */ \ + 1 /* Array type */ \ + 1 /* Element Size */ \ + 1 /* Max. # of elements bits */ \ diff --git a/src/H5EAtest.c b/src/H5EAtest.c index 646b674..87f9195 100644 --- a/src/H5EAtest.c +++ b/src/H5EAtest.c @@ -247,7 +247,7 @@ H5EA__test_encode(void *raw, const void *_elmt, size_t nelmts, void *_ctx)) /* Encode native elements into raw elements */ while(nelmts) { /* Encode element */ - /* (advances 'raw' pointer */ + /* (advances 'raw' pointer) */ UINT64ENCODE(raw, *elmt); /* Advance native element pointer */ @@ -293,7 +293,7 @@ H5EA__test_decode(const void *_raw, void *_elmt, size_t nelmts, void *_ctx)) /* Decode raw elements into native elements */ while(nelmts) { /* Decode element */ - /* (advances 'raw' pointer */ + /* (advances 'raw' pointer) */ UINT64DECODE(raw, *elmt); /* Advance native element pointer */ diff --git a/src/H5Eprivate.h b/src/H5Eprivate.h index c6adb67..3ca05e7 100644 --- a/src/H5Eprivate.h +++ b/src/H5Eprivate.h @@ -76,15 +76,6 @@ typedef struct H5E_t H5E_t; */ #define HGOTO_DONE(ret_val) {ret_value = ret_val; goto done;} -/* Library-private functions defined in H5E package */ -H5_DLL herr_t H5E_init(void); -H5_DLL herr_t H5E_push_stack(H5E_t *estack, const char *file, const char *func, - unsigned line, hid_t cls_id, hid_t maj_id, hid_t min_id, const char *desc); -H5_DLL herr_t H5E_printf_stack(H5E_t *estack, const char *file, const char *func, - unsigned line, hid_t cls_id, hid_t maj_id, hid_t min_id, const char *fmt, ...); -H5_DLL herr_t H5E_clear_stack(H5E_t *estack); -H5_DLL herr_t H5E_dump_api_stack(hbool_t is_api); - /* * Macros handling system error messages as described in C standard. * These macros assume errnum is a valid system error code. @@ -127,5 +118,58 @@ extern int H5E_mpi_error_str_len; } #endif /* H5_HAVE_PARALLEL */ + +/******************************************************************************/ +/* Revisions to Error Macros, to go with Revisions to FUNC_ENTER/LEAVE Macros */ +/******************************************************************************/ + +/* + * H5E_PRINTF macro, used to facilitate error reporting between a BEGIN_FUNC() + * and an END_FUNC() within a function body. The arguments are the minor + * error number, a description of the error (as a printf-like format string), + * and an optional set of arguments for the printf format arguments. + */ +#define H5E_PRINTF(...) H5E_printf_stack(NULL, __FILE__, FUNCNAME, __LINE__, H5E_ERR_CLS_g, H5_MY_PKG_ERR, __VA_ARGS__) + +/* + * H5_LEAVE macro, used to facilitate control flow between a + * BEGIN_FUNC() and an END_FUNC() within a function body. The argument is + * the return value. + * The return value is assigned to a variable `ret_value' and control branches + * to the `catch_except' label, if we're not already past it. + */ +#define H5_LEAVE(v) { \ + ret_value = v; \ + if(!past_catch) \ + goto catch_except; \ +} + +/* + * H5E_THROW macro, used to facilitate error reporting between a + * FUNC_ENTER() and a FUNC_LEAVE() within a function body. The arguments are + * the minor error number, and an error string. + * The return value is assigned to a variable `ret_value' and control branches + * to the `catch_except' label, if we're not already past it. + */ +#define H5E_THROW(...) { \ + H5E_PRINTF(__VA_ARGS__); \ + H5_LEAVE(fail_value) \ +} + +/* Macro for "catching" flow of control when an error occurs. Note that the + * H5_LEAVE macro won't jump back here once it's past this point. + */ +#define CATCH past_catch = TRUE; catch_except:; + + +/* Library-private functions defined in H5E package */ +H5_DLL herr_t H5E_init(void); +H5_DLL herr_t H5E_push_stack(H5E_t *estack, const char *file, const char *func, + unsigned line, hid_t cls_id, hid_t maj_id, hid_t min_id, const char *desc); +H5_DLL herr_t H5E_printf_stack(H5E_t *estack, const char *file, const char *func, + unsigned line, hid_t cls_id, hid_t maj_id, hid_t min_id, const char *fmt, ...); +H5_DLL herr_t H5E_clear_stack(H5E_t *estack); +H5_DLL herr_t H5E_dump_api_stack(hbool_t is_api); + #endif /* _H5Eprivate_H */ diff --git a/src/H5F.c b/src/H5F.c index 88c079e..86348d6 100644 --- a/src/H5F.c +++ b/src/H5F.c @@ -949,13 +949,23 @@ H5F_new(H5F_file_t *shared, hid_t fcpl_id, hid_t fapl_id, H5FD_t *lf) f->shared->maxaddr = H5FD_get_maxaddr(lf); if(!H5F_addr_defined(f->shared->maxaddr)) HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, NULL, "bad maximum address from VFD") - f->shared->tmp_addr = f->shared->maxaddr; if(H5FD_get_feature_flags(lf, &f->shared->feature_flags) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTGET, NULL, "can't get feature flags from VFD") if(H5FD_get_fs_type_map(lf, f->shared->fs_type_map) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTGET, NULL, "can't get free space type mapping from VFD") if(H5MF_init_merge_flags(f) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, NULL, "problem initializing free space merge flags") + f->shared->tmp_addr = f->shared->maxaddr; + /* Disable temp. space allocation for parallel I/O (for now) */ + /* (When we've arranged to have the relocated metadata addresses (and + * sizes) broadcast during the "end of epoch" metadata operations, + * this can be enabled - QAK) + */ + /* (This should be disabled when the metadata journaling branch is + * merged into the trunk and journaling is enabled, at least until + * we make it work. - QAK) + */ + f->shared->use_tmp_space = !(IS_H5FD_MPI(f)); /* Bump superblock version if we are to use the latest version of the format */ if(f->shared->latest_format) diff --git a/src/H5Fpkg.h b/src/H5Fpkg.h index 15fd91e..fbeaf5b 100644 --- a/src/H5Fpkg.h +++ b/src/H5Fpkg.h @@ -162,9 +162,10 @@ typedef struct H5F_file_t { haddr_t root_addr; /* Root group address */ H5FO_t *open_objs; /* Open objects in file */ H5RC_t *grp_btree_shared; /* Ref-counted group B-tree node info */ - haddr_t tmp_addr; /* Next address to use for temp. space in the file */ /* File space allocation information */ + hbool_t use_tmp_space; /* Whether temp. file space allocation is allowed */ + haddr_t tmp_addr; /* Next address to use for temp. space in the file */ unsigned fs_aggr_merge[H5FD_MEM_NTYPES]; /* Flags for whether free space can merge with aggregator(s) */ H5F_fs_state_t fs_state[H5FD_MEM_NTYPES]; /* State of free space manager for each type */ haddr_t fs_addr[H5FD_MEM_NTYPES]; /* Address of free space manager info for each type */ diff --git a/src/H5Fprivate.h b/src/H5Fprivate.h index 9f7f057..8e69d35 100644 --- a/src/H5Fprivate.h +++ b/src/H5Fprivate.h @@ -265,6 +265,7 @@ typedef struct H5F_blk_aggr_t H5F_blk_aggr_t; #define H5F_HAS_FEATURE(F,FL) ((F)->shared->lf->feature_flags & (FL)) #define H5F_DRIVER_ID(F) ((F)->shared->lf->driver_id) #define H5F_GET_FILENO(F,FILENUM) ((FILENUM) = (F)->shared->lf->fileno) +#define H5F_USE_TMP_SPACE(F) ((F)->shared->use_tmp_space) #define H5F_IS_TMP_ADDR(F, ADDR) (H5F_addr_le((F)->shared->tmp_addr, (ADDR))) #else /* H5F_PACKAGE */ #define H5F_INTENT(F) (H5F_get_intent(F)) @@ -288,6 +289,7 @@ typedef struct H5F_blk_aggr_t H5F_blk_aggr_t; #define H5F_HAS_FEATURE(F,FL) (H5F_has_feature(F,FL)) #define H5F_DRIVER_ID(F) (H5F_get_driver_id(F)) #define H5F_GET_FILENO(F,FILENUM) (H5F_get_fileno((F), &(FILENUM))) +#define H5F_USE_TMP_SPACE(F) (H5F_use_tmp_space(F)) #define H5F_IS_TMP_ADDR(F, ADDR) (H5F_is_tmp_addr((F), (ADDR))) #endif /* H5F_PACKAGE */ diff --git a/src/H5Fquery.c b/src/H5Fquery.c index 5538d60..44c1b32 100644 --- a/src/H5Fquery.c +++ b/src/H5Fquery.c @@ -711,8 +711,35 @@ H5F_is_tmp_addr(const H5F_t *f, haddr_t addr) HDassert(f); HDassert(f->shared); - HDassert(f->shared->lf); FUNC_LEAVE_NOAPI(H5F_addr_le(f->shared->tmp_addr, addr)) } /* end H5F_is_tmp_addr() */ + +/*------------------------------------------------------------------------- + * Function: H5F_use_tmp_space + * + * Purpose: Quick and dirty routine to determine if using temporary + * file space is allowed for this file. + * (Mainly added to stop non-file routines from poking about in the + * H5F_t data structure) + * + * Return: TRUE/FALSE on success/abort on failure (shouldn't fail) + * + * Programmer: Quincey Koziol + * July 1, 2009 + * + *------------------------------------------------------------------------- + */ +hbool_t +H5F_use_tmp_space(const H5F_t *f) +{ + /* Use FUNC_ENTER_NOAPI_NOINIT_NOFUNC here to avoid performance issues */ + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5F_use_tmp_space) + + HDassert(f); + HDassert(f->shared); + + FUNC_LEAVE_NOAPI(f->shared->use_tmp_space) +} /* end H5F_use_tmp_space() */ + diff --git a/src/H5HFdblock.c b/src/H5HFdblock.c index 7e68533..3a911d6 100644 --- a/src/H5HFdblock.c +++ b/src/H5HFdblock.c @@ -149,8 +149,14 @@ HDmemset(dblock->blk, 0, dblock->size); #endif /* H5_CLEAR_MEMORY */ /* Allocate [temporary] space for the direct block on disk */ - if(HADDR_UNDEF == (dblock_addr = H5MF_alloc_tmp(hdr->f, (hsize_t)dblock->size))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "file allocation failed for fractal heap direct block") + if(H5F_USE_TMP_SPACE(hdr->f)) { + if(HADDR_UNDEF == (dblock_addr = H5MF_alloc_tmp(hdr->f, (hsize_t)dblock->size))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "file allocation failed for fractal heap direct block") + } /* end if */ + else { + if(HADDR_UNDEF == (dblock_addr = H5MF_alloc(hdr->f, H5FD_MEM_FHEAP_DBLOCK, dxpl_id, (hsize_t)dblock->size))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "file allocation failed for fractal heap direct block") + } /* end else */ #ifdef QAK HDfprintf(stderr, "%s: direct block address = %a\n", FUNC, dblock_addr); #endif /* QAK */ diff --git a/src/H5HFiblock.c b/src/H5HFiblock.c index 3383ef9..c0fa1e4 100644 --- a/src/H5HFiblock.c +++ b/src/H5HFiblock.c @@ -600,8 +600,14 @@ HDfprintf(stderr, "%s: new_next_entry = %u\n", FUNC, new_next_entry); iblock->size = H5HF_MAN_INDIRECT_SIZE(hdr, iblock); /* Allocate [temporary] space for the new indirect block on disk */ - if(HADDR_UNDEF == (new_addr = H5MF_alloc_tmp(hdr->f, (hsize_t)iblock->size))) - HGOTO_ERROR(H5E_HEAP, H5E_NOSPACE, FAIL, "file allocation failed for fractal heap indirect block") + if(H5F_USE_TMP_SPACE(hdr->f)) { + if(HADDR_UNDEF == (new_addr = H5MF_alloc_tmp(hdr->f, (hsize_t)iblock->size))) + HGOTO_ERROR(H5E_HEAP, H5E_NOSPACE, FAIL, "file allocation failed for fractal heap indirect block") + } /* end if */ + else { + if(HADDR_UNDEF == (new_addr = H5MF_alloc(hdr->f, H5FD_MEM_FHEAP_IBLOCK, dxpl_id, (hsize_t)iblock->size))) + HGOTO_ERROR(H5E_HEAP, H5E_NOSPACE, FAIL, "file allocation failed for fractal heap indirect block") + } /* end else */ #ifdef QAK HDfprintf(stderr, "%s: Check 1.0 - iblock->addr = %a, new_addr = %a\n", FUNC, iblock->addr, new_addr); #endif /* QAK */ @@ -771,8 +777,14 @@ HDfprintf(stderr, "%s: iblock->nrows = %u\n", FUNC, iblock->nrows); iblock->size = H5HF_MAN_INDIRECT_SIZE(hdr, iblock); /* Allocate [temporary] space for the new indirect block on disk */ - if(HADDR_UNDEF == (new_addr = H5MF_alloc_tmp(hdr->f, (hsize_t)iblock->size))) - HGOTO_ERROR(H5E_HEAP, H5E_NOSPACE, FAIL, "file allocation failed for fractal heap indirect block") + if(H5F_USE_TMP_SPACE(hdr->f)) { + if(HADDR_UNDEF == (new_addr = H5MF_alloc_tmp(hdr->f, (hsize_t)iblock->size))) + HGOTO_ERROR(H5E_HEAP, H5E_NOSPACE, FAIL, "file allocation failed for fractal heap indirect block") + } /* end if */ + else { + if(HADDR_UNDEF == (new_addr = H5MF_alloc(hdr->f, H5FD_MEM_FHEAP_IBLOCK, dxpl_id, (hsize_t)iblock->size))) + HGOTO_ERROR(H5E_HEAP, H5E_NOSPACE, FAIL, "file allocation failed for fractal heap indirect block") + } /* end else */ #ifdef QAK HDfprintf(stderr, "%s: new_addr = %a\n", FUNC, new_addr); #endif /* QAK */ @@ -1087,8 +1099,14 @@ HDfprintf(stderr, "%s: dir_rows = %u\n", FUNC, dir_rows); iblock->child_iblocks = NULL; /* Allocate [temporary] space for the indirect block on disk */ - if(HADDR_UNDEF == (*addr_p = H5MF_alloc_tmp(hdr->f, (hsize_t)iblock->size))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "file allocation failed for fractal heap indirect block") + if(H5F_USE_TMP_SPACE(hdr->f)) { + if(HADDR_UNDEF == (*addr_p = H5MF_alloc_tmp(hdr->f, (hsize_t)iblock->size))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "file allocation failed for fractal heap indirect block") + } /* end if */ + else { + if(HADDR_UNDEF == (*addr_p = H5MF_alloc(hdr->f, H5FD_MEM_FHEAP_IBLOCK, dxpl_id, (hsize_t)iblock->size))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "file allocation failed for fractal heap indirect block") + } /* end else */ iblock->addr = *addr_p; /* Attach to parent indirect block, if there is one */ diff --git a/src/H5Oattr.c b/src/H5Oattr.c index 27b9d5e..1e85c69 100644 --- a/src/H5Oattr.c +++ b/src/H5Oattr.c @@ -226,9 +226,6 @@ H5O_attr_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, unsigned UNUSED mesg_fl HDmemcpy(attr->shared->data, p, attr->shared->data_size); } /* end if */ - /* Indicate that the fill values aren't to be written out */ - attr->shared->initialized = 1; - /* Increment the reference count for this object header message in cache(compact storage) or for the object from dense storage. */ attr->shared->nrefs++; @@ -805,9 +802,6 @@ H5O_attr_debug(H5F_t *f, hid_t dxpl_id, const void *_mesg, FILE * stream, int in "Character Set of Name:", s); HDfprintf(stream, "%*s%-*s %t\n", indent, "", fwidth, - "Initialized:", - mesg->shared->initialized); - HDfprintf(stream, "%*s%-*s %t\n", indent, "", fwidth, "Object opened:", mesg->obj_opened); HDfprintf(stream, "%*s%-*s %a\n", indent, "", fwidth, diff --git a/src/H5Z.c b/src/H5Z.c index 417ae77..1c58ab0 100644 --- a/src/H5Z.c +++ b/src/H5Z.c @@ -1115,7 +1115,7 @@ H5Z_filter_info(const H5O_pline_t *pline, H5Z_filter_t filter) break; /* Check if the filter was not already in the pipeline */ - if(idx>pline->nused) + if(idx>=pline->nused) HGOTO_ERROR(H5E_PLINE, H5E_NOTFOUND, NULL, "filter not in pipeline") /* Set return value */ diff --git a/src/H5private.h b/src/H5private.h index cb776de..9c18be2 100644 --- a/src/H5private.h +++ b/src/H5private.h @@ -1955,6 +1955,269 @@ static herr_t H5_INTERFACE_INIT_FUNC(void); } /*end scope from beginning of FUNC_ENTER*/ +/****************************************/ +/* Revisions to FUNC_ENTER/LEAVE Macros */ +/****************************************/ + +/* `S' is the name of a function which is being tested to check if it's */ +/* a public API function */ +#define H5_IS_PUB(S) (((HDisdigit(S[1]) || HDisupper(S[1])) && HDislower(S[2])) || \ + ((HDisdigit(S[2]) || HDisupper(S[2])) && HDislower(S[3])) || \ + (!S[4] || ((HDisdigit(S[3]) || HDisupper(S[3])) && HDislower(S[4])))) + +/* `S' is the name of a function which is being tested to check if it's */ +/* a private library function */ +#define H5_IS_PRIV(S) (((HDisdigit(S[1]) || HDisupper(S[1])) && '_' == S[2] && HDislower(S[3])) || \ + ((HDisdigit(S[2]) || HDisupper(S[2])) && '_' == S[3] && HDislower(S[4])) || \ + ((HDisdigit(S[3]) || HDisupper(S[3])) && '_' == S[4] && HDislower(S[5]))) + +/* `S' is the name of a function which is being tested to check if it's */ +/* a package private function */ +#define H5_IS_PKG(S) (((HDisdigit(S[1]) || HDisupper(S[1])) && '_' == S[2] && '_' == S[3] && HDislower(S[4])) || \ + ((HDisdigit(S[2]) || HDisupper(S[2])) && '_' == S[3] && '_' == S[4] && HDislower(S[5])) || \ + ((HDisdigit(S[3]) || HDisupper(S[3])) && '_' == S[4] && '_' == S[5] && HDislower(S[6]))) + +#ifndef NDEBUG +#define FUNC_ENTER_NAME_CHECK(asrt) \ + { \ + static hbool_t func_check = FALSE; \ + \ + if(!func_check) { \ + /* Check function naming status */ \ + HDassert(asrt); \ + \ + /* Don't check again */ \ + func_check = TRUE; \ + } /* end if */ \ + } /* end scope */ +#else /* NDEBUG */ +#define FUNC_ENTER_NAME_CHECK(asrt) +#endif /* NDEBUG */ + +/* Macros for referencing package initialization symbols */ +#define H5_PACKAGE_INIT_VAR(x) H5_GLUE3(H5_, x, _init_g) +#define H5_PACKAGE_INIT_FUNC(x) H5_GLUE(x, __pkg_init) + +/* Macros to check if a package is initialized */ +#define H5_CHECK_PACKAGE_INIT_REG_YES(asrt) HDassert(H5_PACKAGE_INIT_VAR(pkg)); +#define H5_CHECK_PACKAGE_INIT_REG_NO(asrt) +#define H5_CHECK_PACKAGE_INIT_INIT_YES(asrt) +#define H5_CHECK_PACKAGE_INIT_INIT_NO(asrt) + +/* Macros to initialize package, if a package initialization routine is defined */ +#define H5_PKG_YES_INIT(pkg) \ + if(!H5_PACKAGE_INIT_VAR(pkg)) { \ + if(H5_GLUE(pkg, _pkg_init)() < 0) { \ + /* (Can't use H5E_THROW here) */ \ + H5E_PRINTF(H5E_CANTINIT, "interface initialization failed"); \ + ret_value = fail_value; \ + goto func_init_failed; \ + } /* end if */ \ + } /* end if */ +#define H5_PKG_NO_INIT(pkg) + +/* Macros to declare package initialization symbols, if a package initialization routine is defined */ +#define H5_PKG_YES_INIT_VAR(pkg) extern hbool_t H5_PACKAGE_INIT_VAR(H5_MY_PKG); +#define H5_PKG_NO_INIT_VAR(pkg) +#define H5_PKG_YES_INIT_FUNC(pkg) extern herr_t H5_PACKAGE_INIT_FUNC(pkg)(void); +#define H5_PKG_NO_INIT_FUNC(pkg) + +/* Declare package initialization symbols (if in a package) */ +#define H5_DECLARE_PKG_VAR(pkg_init, pkg) H5_GLUE3(H5_PKG_, pkg_init, _INIT_VAR)(pkg) +#define H5_DECLARE_PKG_FUNC(pkg_init, pkg) H5_GLUE3(H5_PKG_, pkg_init, _INIT_FUNC)(pkg) +#ifdef H5_MY_PKG +H5_DECLARE_PKG_VAR(H5_MY_PKG_INIT, H5_MY_PKG) +H5_DECLARE_PKG_FUNC(H5_MY_PKG_INIT, H5_MY_PKG) +#endif /* H5_MY_PKG */ + +/* API re-entrance variable */ +extern hbool_t H5_api_entered_g; /* Has library already been entered through API? */ + +/* Use FUNCNAME to safely handle variations of C99 __func__ keyword handling */ +#ifdef H5_HAVE_C99_FUNC +#define FUNCNAME __func__ +#elif defined(H5_HAVE_FUNCTION) +#define FUNCNAME __FUNCTION__ +#else +#error "We need __func__ or __FUNCTION__ to test function names!" +#endif + +/* Macros for entering different scopes of routines */ +#define H5_PACKAGE_ENTER(pkg, pkg_init, init) \ + FUNC_ENTER_NAME_CHECK(H5_IS_PKG(FUNCNAME)) \ + \ + /* The library should be initialized already */ \ + HDassert(H5_INIT_GLOBAL); \ + \ + /* This interface should be initialized already */ \ + /* (except for package initialization routines :-) */ \ + H5_GLUE4(H5_CHECK_PACKAGE_INIT_, init, _, pkg_init)(pkg) \ + \ + /* Push the name of this function on the function stack */ \ + H5_PUSH_FUNC(FUNCNAME) \ + \ + /* Enter scope for this type of function */ \ + { + +#define H5_PRIVATE_ENTER(pkg, pkg_init) \ + FUNC_ENTER_NAME_CHECK(H5_IS_PRIV(FUNCNAME)) \ + \ + /* The library should be initialized already */ \ + HDassert(H5_INIT_GLOBAL); \ + \ + /* Initialize this interface if desired */ \ + H5_GLUE3(H5_PKG_, pkg_init, _INIT)(pkg) \ + \ + /* Push the name of this function on the function stack */ \ + H5_PUSH_FUNC(FUNCNAME) \ + \ + /* Enter scope for this type of function */ \ + {{ + +#define H5_PUBLIC_ENTER(pkg, pkg_init) \ + FUNC_ENTER_API_VARS(FUNCNAME) \ + FUNC_ENTER_API_THREADSAFE; \ + FUNC_ENTER_NAME_CHECK(H5_IS_PUB(FUNCNAME)) \ + \ + /* Clear thread error stack when entering public functions */ \ + H5E_clear_stack(NULL); \ + \ + /* Initialize the library or bust */ \ + if(!(H5_INIT_GLOBAL)) { \ + H5_INIT_GLOBAL = TRUE; \ + if(H5_init_library() < 0) { \ + /* (Can't use H5E_THROW here) */ \ + H5E_PRINTF(H5E_CANTINIT, "interface initialization failed"); \ + ret_value = fail_value; \ + goto func_init_failed; \ + } /* end if */ \ + } /* end if */ \ + \ + /* Initialize this interface if desired */ \ + H5_GLUE3(H5_PKG_, pkg_init, _INIT)(pkg) \ + \ + /* Check for re-entering API routine */ \ + HDassert(!H5_api_entered_g); \ + H5_api_entered_g = TRUE; \ + \ + /* Start logging MPI's MPE information */ \ + BEGIN_MPE_LOG(FUNCNAME) \ + \ + /* Push the name of this function on the function stack */ \ + H5_PUSH_FUNC(FUNCNAME) \ + \ + /* Enter scope for this type of function */ \ + {{{ + +/* Macros for substituting the package name */ +#define FUNC_ENTER_STATIC H5_PACKAGE_ENTER(H5_MY_PKG, H5_MY_PKG_INIT, REG) +#define FUNC_ENTER_PKGINIT H5_PACKAGE_ENTER(H5_MY_PKG, H5_MY_PKG_INIT, INIT) +#define FUNC_ENTER_PKG H5_PACKAGE_ENTER(H5_MY_PKG, H5_MY_PKG_INIT, REG) +#define FUNC_ENTER_PRIV H5_PRIVATE_ENTER(H5_MY_PKG, H5_MY_PKG_INIT) +#define FUNC_ENTER_PUB H5_PUBLIC_ENTER(H5_MY_PKG, H5_MY_PKG_INIT) + +/* Macros for substituting a function prefix */ +#define FUNC_PREFIX_STATIC static +#define FUNC_PREFIX_PKGINIT +#define FUNC_PREFIX_PKG +#define FUNC_PREFIX_PRIV +#define FUNC_PREFIX_PUB + +/* Macros for declaring error variables */ +#define FUNC_ERR_VAR_ERR(ret_typ, err) \ + hbool_t past_catch = FALSE; \ + ret_typ fail_value = err; +#define FUNC_ERR_VAR_ERRCATCH(ret_typ, err) \ + hbool_t past_catch = FALSE; +#define FUNC_ERR_VAR_NOERR(ret_typ, err) + +/* Use this macro when entering all functions */ +#define BEGIN_FUNC(scope, use_err, ret_typ, ret_init, err, func) \ +H5_GLUE(FUNC_PREFIX_, scope) \ +ret_typ \ +func \ +/* Open function */ \ +{ \ + ret_typ ret_value = ret_init; \ + H5_GLUE(FUNC_ERR_VAR_, use_err)(ret_typ, err) \ + H5_GLUE(FUNC_ENTER_, scope) + +/* Macros for label when a function initialization can fail */ +#define H5_PRIV_YES_FUNC_INIT_FAILED func_init_failed: +#define H5_PRIV_NO_FUNC_INIT_FAILED +#define H5_PRIV_FUNC_INIT_FAILED(pkg_init) H5_GLUE3(H5_PRIV_, pkg_init, _FUNC_INIT_FAILED) + +/* Macros for leaving different scopes of routines */ +#define FUNC_LEAVE_PKGINIT \ + /* Leave scope for this type of function */ \ + } \ + \ + /* Pop the name of this function off the function stack */ \ + H5_POP_FUNC + +#define FUNC_LEAVE_STATIC \ + /* Leave scope for this type of function */ \ + } \ + \ + /* Pop the name of this function off the function stack */ \ + H5_POP_FUNC + +#define FUNC_LEAVE_PKG \ + /* Leave scope for this type of function */ \ + } \ + \ + /* Pop the name of this function off the function stack */ \ + H5_POP_FUNC + +#define FUNC_LEAVE_PRIV \ + /* Leave scope for this type of function */ \ + }} \ + \ + /* Label for errors during FUNC_ENTER */ \ + H5_PRIV_FUNC_INIT_FAILED(H5_MY_PKG_INIT) \ + \ + /* Pop the name of this function off the function stack */ \ + H5_POP_FUNC + +#define FUNC_LEAVE_PUB \ + /* Leave scope for this type of function */ \ + }}} \ + \ + /* Label for errors during FUNC_ENTER */ \ +func_init_failed: \ + \ + /* Dump error stack if an error occurred during API routine */ \ + if(ret_value == fail_value) \ + (void)H5E_dump_api_stack(TRUE); \ + \ + /* Finish the API tracing info */ \ + H5TRACE_RETURN(ret_value); \ + \ + /* Pop the name of this function off the function stack */ \ + H5_POP_FUNC \ + \ + /* Finish the MPE tracing info */ \ + FINISH_MPE_LOG; \ + \ + /* Check for leaving API routine */ \ + HDassert(H5_api_entered_g); \ + H5_api_entered_g = FALSE; \ + \ + /* Release thread-safety semaphore */ \ + FUNC_LEAVE_API_THREADSAFE + +/* Use this macro when leaving all functions */ +#define END_FUNC(scope) \ + /* Scope-specific function conclusion */ \ + H5_GLUE(FUNC_LEAVE_, scope) \ + \ + /* Leave routine */ \ + return(ret_value); \ + \ + /* Close Function */ \ +} + + /* Macro for "stringizing" an integer in the C preprocessor (use H5_TOSTRING) */ /* (use H5_TOSTRING, H5_STRINGIZE is just part of the implementation) */ #define H5_STRINGIZE(x) #x diff --git a/src/H5public.h b/src/H5public.h index e0effba..2e53920 100644 --- a/src/H5public.h +++ b/src/H5public.h @@ -71,10 +71,10 @@ extern "C" { /* Version numbers */ #define H5_VERS_MAJOR 1 /* For major interface/format changes */ #define H5_VERS_MINOR 9 /* For minor interface/format changes */ -#define H5_VERS_RELEASE 42 /* For tweaks, bug-fixes, or development */ +#define H5_VERS_RELEASE 43 /* For tweaks, bug-fixes, or development */ #define H5_VERS_SUBRELEASE "FA_a2" /* For pre-releases like snap0 */ /* Empty string for real releases. */ -#define H5_VERS_INFO "HDF5 library version: 1.9.42-FA_a2" /* Full version string */ +#define H5_VERS_INFO "HDF5 library version: 1.9.43-FA_a2" /* Full version string */ #define H5check() H5check_version(H5_VERS_MAJOR,H5_VERS_MINOR, \ H5_VERS_RELEASE) diff --git a/src/Makefile.in b/src/Makefile.in index 2c95fc8..2fa92f9 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -409,7 +409,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 32 +LT_VERS_REVISION = 33 LT_VERS_AGE = 0 H5detect_CFLAGS = -g diff --git a/test/dsets.c b/test/dsets.c index 74bb0c9..81d4b2c 100644 --- a/test/dsets.c +++ b/test/dsets.c @@ -5557,6 +5557,7 @@ test_filter_delete(hid_t file) hsize_t dims[2]={20,20}; /* dataspace dimensions */ hsize_t chunk_dims[2]={10,10}; /* chunk dimensions */ int nfilters; /* number of filters in DCPL */ + unsigned flags; /* flags for filter */ herr_t ret; /* generic return value */ int i; @@ -5597,6 +5598,16 @@ test_filter_delete(hid_t file) goto error; } + /* try to get the info for the deflate filter */ + H5E_BEGIN_TRY { + ret=H5Pget_filter_by_id2(dcpl1,H5Z_FILTER_DEFLATE,&flags,NULL,NULL,0,NULL,NULL); + } H5E_END_TRY; + if(ret >=0) { + H5_FAILED(); + printf(" Line %d: Shouldn't have deleted filter!\n",__LINE__); + goto error; + } /* end if */ + /* try to delete the deflate filter again */ H5E_BEGIN_TRY { ret=H5Premove_filter(dcpl1,H5Z_FILTER_DEFLATE); diff --git a/test/tattr.c b/test/tattr.c index 4b130e6..5501056 100644 --- a/test/tattr.c +++ b/test/tattr.c @@ -10145,6 +10145,66 @@ test_attr_bug5(hid_t fcpl, hid_t fapl) /**************************************************************** ** +** test_attr_bug6(): Test basic H5A (attribute) code. +** Tests if reading an empty attribute is OK. +** +****************************************************************/ +static void +test_attr_bug6(hid_t fcpl, hid_t fapl) +{ + hid_t fid; /* File ID */ + hid_t gid; /* Group ID */ + hid_t aid1, aid2; /* Attribute IDs */ + hid_t sid; /* Dataspace ID */ + hsize_t dims[ATTR1_RANK] = {ATTR1_DIM1}; /* Attribute dimensions */ + int intar[ATTR1_DIM1]; /* Data reading buffer */ + herr_t ret; /* Generic return status */ + + /* Output message about test being performed */ + MESSAGE(5, ("Testing that empty attribute can be read\n")); + + /* Create file */ + fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl, fapl); + CHECK(fid, FAIL, "H5Fcreate"); + + /* Open root group */ + gid = H5Gopen2(fid, "/", H5P_DEFAULT); + CHECK(gid, FAIL, "H5Gopen2"); + + /* Create dataspace */ + sid = H5Screate_simple(1, dims, NULL); + CHECK(sid, FAIL, "H5Screate_simple"); + + /* Create attribute on group */ + aid1 = H5Acreate2(gid, ATTR1_NAME, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT); + CHECK(aid1, FAIL, "H5Acreate2"); + + ret = H5Aclose(aid1); + CHECK(ret, FAIL, "H5Aclose"); + + /* Open the attribute again */ + aid2 = H5Aopen(gid, ATTR1_NAME, H5P_DEFAULT); + CHECK(aid2, FAIL, "H5Aopen"); + + ret = H5Aread(aid2, H5T_NATIVE_INT, intar); + CHECK(ret, FAIL, "H5Aread"); + + /* Close IDs */ + ret = H5Aclose(aid2); + CHECK(ret, FAIL, "H5Aclose"); + + ret = H5Gclose(gid); + CHECK(ret, FAIL, "H5Gclose"); + + ret = H5Fclose(fid); + CHECK(ret, FAIL, "H5Fclose"); + + ret = H5Sclose(sid); + CHECK(ret, FAIL, "H5Sclose"); +} + +/**************************************************************** +** ** test_attr(): Main H5A (attribute) testing routine. ** ****************************************************************/ @@ -10288,6 +10348,7 @@ test_attr(void) test_attr_bug3(my_fcpl, my_fapl); /* Test "self referential" attributes */ test_attr_bug4(my_fcpl, my_fapl); /* Test attributes on named datatypes */ test_attr_bug5(my_fcpl, my_fapl); /* Test opening/closing attributes through different file handles */ + test_attr_bug6(my_fcpl, my_fapl); /* Test reading empty attribute */ } /* end for */ } /* end if */ else { @@ -10311,6 +10372,7 @@ test_attr(void) test_attr_bug3(fcpl, my_fapl); /* Test "self referential" attributes */ test_attr_bug4(fcpl, my_fapl); /* Test attributes on named datatypes */ test_attr_bug5(fcpl, my_fapl); /* Test opening/closing attributes through different file handles */ + test_attr_bug6(fcpl, my_fapl); /* Test reading empty attribute */ } /* end else */ } /* end for */ diff --git a/vms/src/h5pubconf.h b/vms/src/h5pubconf.h index 13a5d15..2dddc76 100644 --- a/vms/src/h5pubconf.h +++ b/vms/src/h5pubconf.h @@ -480,13 +480,13 @@ #define H5_PACKAGE_NAME "HDF5" /* Define to the full name and version of this package. */ -#define H5_PACKAGE_STRING "HDF5 1.9.42-FA_a2" +#define H5_PACKAGE_STRING "HDF5 1.9.43-FA_a2" /* Define to the one symbol short name of this package. */ #define H5_PACKAGE_TARNAME "hdf5" /* Define to the version of this package. */ -#define H5_PACKAGE_VERSION "1.9.42-FA_a2" +#define H5_PACKAGE_VERSION "1.9.43-FA_a2" /* Width for printf() for type `long long' or `__int64', use `ll' */ #define H5_PRINTF_LL_WIDTH "ll" @@ -639,7 +639,7 @@ /* #undef H5_USING_MEMCHECKER */ /* Version number of package */ -#define H5_VERSION "1.9.42-FA_a2" +#define H5_VERSION "1.9.43-FA_a2" /* Define if vsnprintf() returns the correct value for formatted strings that don't fit into size allowed */ diff --git a/windows/c++/examples/testcppExamples.BAT b/windows/c++/examples/testcppExamples.BAT index b10fd0f..a6a83ed 100755 --- a/windows/c++/examples/testcppExamples.BAT +++ b/windows/c++/examples/testcppExamples.BAT @@ -19,94 +19,15 @@ REM Last Modified: 10/20/2004 if %1.==. GOTO WRONG if "%1"=="/?" GOTO HELP -if %1==release GOTO RELEASE -if %1==debug GOTO DEBUG -GOTO WRONG -:RELEASE -if %2.==. GOTO REL -if %2==dll GOTO RELDLL -GOTO WRONG - -:REL -type nul > %1.txt -cd cppexamplesREL -createtest >> ..\%1.txt -readdatatest >> ..\%1.txt -writedatatest >> ..\%1.txt -compoundtest >> ..\%1.txt -extend_dstest >> ..\%1.txt -chunkstest >> ..\%1.txt -h5grouptest >> ..\%1.txt -cd .. -fc %1.txt expected.out >temp.txt -if %ERRORLEVEL%==0 ( - echo All HDF5 C++ examples tests passed. -) else ( - echo HDF5 C++ examples tests failed. - more temp.txt -) -del temp.txt -GOTO END - -:RELDLL -type nul > %1.txt -cd cppexamplesRELDLL -createtestdll >> ..\%1.txt -readdatatestdll >> ..\%1.txt -writedatatestdll >> ..\%1.txt -compoundtestdll >> ..\%1.txt -extend_dstestdll >> ..\%1.txt -chunkstestdll >> ..\%1.txt -h5grouptestdll >> ..\%1.txt -cd .. -fc %1.txt expected.out >temp.txt -if %ERRORLEVEL%==0 ( - echo All HDF5 C++ examples tests passed. -) else ( - echo HDF5 C++ examples tests failed. - more temp.txt -) -del temp.txt -GOTO END - -:DEBUG -if %2.==. GOTO DBG -if %2==dll GOTO DBGDLL -GOTO WRONG - -:DBG -type nul > %1.txt -cd cppexamplesDBG -createtest >> ..\%1.txt -readdatatest >> ..\%1.txt -writedatatest >> ..\%1.txt -compoundtest >> ..\%1.txt -extend_dstest >> ..\%1.txt -chunkstest >> ..\%1.txt -h5grouptest >> ..\%1.txt -cd .. -fc %1.txt expected.out >temp.txt -if %ERRORLEVEL%==0 ( - echo All HDF5 C++ examples tests passed. -) else ( - echo HDF5 C++ examples tests failed. - more temp.txt -) -del temp.txt -GOTO END - -:DBGDLL type nul > %1.txt -cd cppexamplesDBGDLL -createtestdll >> ..\%1.txt -readdatatestdll >> ..\%1.txt -writedatatestdll >> ..\%1.txt -compoundtestdll >> ..\%1.txt -extend_dstestdll >> ..\%1.txt -chunkstestdll >> ..\%1.txt -h5grouptestdll >> ..\%1.txt -cd .. +createtest%2\%1\createtest%2 >> %1.txt +readdatatest%2\%1\readdatatest%2 >> %1.txt +writedatatest%2\%1\writedatatest%2 >> %1.txt +compoundtest%2\%1\compoundtest%2 >> %1.txt +extend_dstest%2\%1\extend_dstest%2 >> %1.txt +chunkstest%2\%1\chunkstest%2 >> %1.txt +h5grouptest%2\%1\h5grouptest%2 >> %1.txt fc %1.txt expected.out >temp.txt if %ERRORLEVEL%==0 ( echo All HDF5 C++ examples tests passed. diff --git a/windows/src/H5pubconf.h b/windows/src/H5pubconf.h index b89598d..1b21b06 100755 --- a/windows/src/H5pubconf.h +++ b/windows/src/H5pubconf.h @@ -479,13 +479,13 @@ #define H5_PACKAGE_NAME "HDF5" /* Define to the full name and version of this package. */ -#define H5_PACKAGE_STRING "HDF5 1.9.42-FA_a2" +#define H5_PACKAGE_STRING "HDF5 1.9.43-FA_a2" /* Define to the one symbol short name of this package. */ #define H5_PACKAGE_TARNAME "hdf5" /* Define to the version of this package. */ -#define H5_PACKAGE_VERSION "1.9.42-FA_a2" +#define H5_PACKAGE_VERSION "1.9.43-FA_a2" /* Width for printf() for type `long long' or `__int64', use `ll' */ #define H5_PRINTF_LL_WIDTH "I64" @@ -642,7 +642,7 @@ /* #undef H5_USING_MEMCHECKER */ /* Version number of package */ -#define H5_VERSION "1.9.42-FA_a2" +#define H5_VERSION "1.9.43-FA_a2" /* Define if vsnprintf() returns the correct value for formatted strings that don't fit into size allowed */ -- cgit v0.12