diff options
author | Dana Robinson <derobins@hdfgroup.org> | 2014-02-03 21:15:01 (GMT) |
---|---|---|
committer | Dana Robinson <derobins@hdfgroup.org> | 2014-02-03 21:15:01 (GMT) |
commit | 292aec8f551b5a702fb305d7cce572a42169569e (patch) | |
tree | 5485675a09a0be431352db6f9cab859afc7cb26e | |
parent | 6a2fbff85be6168186a6c49498d7bb4e53f10b8f (diff) | |
download | hdf5-292aec8f551b5a702fb305d7cce572a42169569e.zip hdf5-292aec8f551b5a702fb305d7cce572a42169569e.tar.gz hdf5-292aec8f551b5a702fb305d7cce572a42169569e.tar.bz2 |
[svn-r24678] Fixed incorrect svn:executable and svn:eol-style Subversion attributes.
No code changes.
41 files changed, 4941 insertions, 4941 deletions
diff --git a/config/cmake/FindHDF5.cmake.in b/config/cmake/FindHDF5.cmake.in index 1b51ed4..f45fb34 100644 --- a/config/cmake/FindHDF5.cmake.in +++ b/config/cmake/FindHDF5.cmake.in @@ -1,86 +1,86 @@ -#
-# To be used by projects that make use of Cmakeified hdf5-@HDF5_PACKAGE_VERSION@
-#
-
-#
-# Find the HDF5 includes and get all installed hdf5 library settings from
-# HDF5-config.cmake file : Requires a CMake compatible hdf5-1.8.5 or later
-# for this feature to work. The following vars are set if hdf5 is found.
-#
-# HDF5_FOUND - True if found, otherwise all other vars are undefined
-# HDF5_INCLUDE_DIR - The include dir for main *.h files
-# HDF5_FORTRAN_INCLUDE_DIR - The include dir for fortran modules and headers
-# HDF5_VERSION_STRING - full version (e.g. @HDF5_PACKAGE_VERSION@)
-# HDF5_VERSION_MAJOR - major part of version (e.g. @HDF5_PACKAGE_VERSION_MAJOR@)
-# HDF5_VERSION_MINOR - minor part (e.g. @HDF5_PACKAGE_VERSION_MINOR@)
-#
-# The following boolean vars will be defined
-# HDF5_ENABLE_PARALLEL - 1 if HDF5 parallel supported
-# HDF5_BUILD_FORTRAN - 1 if HDF5 was compiled with fortran on
-# HDF5_BUILD_CPP_LIB - 1 if HDF5 was compiled with cpp on
-# HDF5_BUILD_TOOLS - 1 if HDF5 was compiled with tools on
-# HDF5_BUILD_HL_LIB - 1 if HDF5 was compiled with high level on
-# HDF5_BUILD_HL_CPP_LIB - 1 if HDF5 was compiled with high level and cpp on
-#
-# Target names that are valid (depending on enabled options)
-# will be the following
-#
-# hdf5 : HDF5 C library
-# hdf5_tools : the tools library
-# hdf5_f90cstub : used by Fortran to C interface
-# hdf5_fortran : Fortran HDF5 library
-# hdf5_cpp : HDF5 cpp interface library
-# hdf5_hl : High Level library
-# hdf5_hl_f90cstub : used by Fortran to C interface to High Level library
-# hdf5_hl_fortran : Fortran High Level library
-# hdf5_hl_cpp : High Level cpp interface library
-#
-# To aid in finding HDF5 as part of a subproject set
-# HDF5_ROOT_DIR_HINT to the location where @HDF5_PACKAGE@@HDF_PACKAGE_EXT@-config.cmake lies
-
-INCLUDE (SelectLibraryConfigurations)
-INCLUDE (FindPackageHandleStandardArgs)
-
-# The HINTS option should only be used for values computed from the system.
-SET (_HDF5_HINTS
- $ENV{HOME}/.local
- $ENV{HDF5_ROOT}
- $ENV{HDF5_ROOT_DIR_HINT}
-)
-# Hard-coded guesses should still go in PATHS. This ensures that the user
-# environment can always override hard guesses.
-SET (_HDF5_PATHS
- $ENV{HOME}/.local
- $ENV{HDF5_ROOT}
- $ENV{HDF5_ROOT_DIR_HINT}
- /usr/lib/@HDF5_PACKAGE@
- /usr/share/@HDF5_PACKAGE@
- /usr/local/@HDF5_PACKAGE@
- /usr/local/@HDF5_PACKAGE@/share
-)
-
-FIND_PATH (HDF5_ROOT_DIR "@HDF5_PACKAGE@@HDF_PACKAGE_EXT@-config.cmake"
- HINTS ${_HDF5_HINTS}
- PATHS ${_HDF5_PATHS}
- PATH_SUFFIXES
- cmake/@HDF5_PACKAGE@
- lib/cmake/@HDF5_PACKAGE@
- share/cmake/@HDF5_PACKAGE@
-)
-
-FIND_PATH (HDF5_INCLUDE_DIRS "H5public.h"
- HINTS ${_HDF5_HINTS}
- PATHS ${_HDF5_PATHS}
- PATH_SUFFIXES
- include
- Include
-)
-
-# For backwards compatibility we set HDF5_INCLUDE_DIR to the value of
-# HDF5_INCLUDE_DIRS
-SET ( HDF5_INCLUDE_DIR "${HDF5_INCLUDE_DIRS}" )
-
-IF (HDF5_INCLUDE_DIR)
- SET (HDF5_FOUND "YES")
- INCLUDE (${HDF5_ROOT_DIR}/@HDF5_PACKAGE@@HDF_PACKAGE_EXT@-config.cmake)
-ENDIF (HDF5_INCLUDE_DIR)
+# +# To be used by projects that make use of Cmakeified hdf5-@HDF5_PACKAGE_VERSION@ +# + +# +# Find the HDF5 includes and get all installed hdf5 library settings from +# HDF5-config.cmake file : Requires a CMake compatible hdf5-1.8.5 or later +# for this feature to work. The following vars are set if hdf5 is found. +# +# HDF5_FOUND - True if found, otherwise all other vars are undefined +# HDF5_INCLUDE_DIR - The include dir for main *.h files +# HDF5_FORTRAN_INCLUDE_DIR - The include dir for fortran modules and headers +# HDF5_VERSION_STRING - full version (e.g. @HDF5_PACKAGE_VERSION@) +# HDF5_VERSION_MAJOR - major part of version (e.g. @HDF5_PACKAGE_VERSION_MAJOR@) +# HDF5_VERSION_MINOR - minor part (e.g. @HDF5_PACKAGE_VERSION_MINOR@) +# +# The following boolean vars will be defined +# HDF5_ENABLE_PARALLEL - 1 if HDF5 parallel supported +# HDF5_BUILD_FORTRAN - 1 if HDF5 was compiled with fortran on +# HDF5_BUILD_CPP_LIB - 1 if HDF5 was compiled with cpp on +# HDF5_BUILD_TOOLS - 1 if HDF5 was compiled with tools on +# HDF5_BUILD_HL_LIB - 1 if HDF5 was compiled with high level on +# HDF5_BUILD_HL_CPP_LIB - 1 if HDF5 was compiled with high level and cpp on +# +# Target names that are valid (depending on enabled options) +# will be the following +# +# hdf5 : HDF5 C library +# hdf5_tools : the tools library +# hdf5_f90cstub : used by Fortran to C interface +# hdf5_fortran : Fortran HDF5 library +# hdf5_cpp : HDF5 cpp interface library +# hdf5_hl : High Level library +# hdf5_hl_f90cstub : used by Fortran to C interface to High Level library +# hdf5_hl_fortran : Fortran High Level library +# hdf5_hl_cpp : High Level cpp interface library +# +# To aid in finding HDF5 as part of a subproject set +# HDF5_ROOT_DIR_HINT to the location where @HDF5_PACKAGE@@HDF_PACKAGE_EXT@-config.cmake lies + +INCLUDE (SelectLibraryConfigurations) +INCLUDE (FindPackageHandleStandardArgs) + +# The HINTS option should only be used for values computed from the system. +SET (_HDF5_HINTS + $ENV{HOME}/.local + $ENV{HDF5_ROOT} + $ENV{HDF5_ROOT_DIR_HINT} +) +# Hard-coded guesses should still go in PATHS. This ensures that the user +# environment can always override hard guesses. +SET (_HDF5_PATHS + $ENV{HOME}/.local + $ENV{HDF5_ROOT} + $ENV{HDF5_ROOT_DIR_HINT} + /usr/lib/@HDF5_PACKAGE@ + /usr/share/@HDF5_PACKAGE@ + /usr/local/@HDF5_PACKAGE@ + /usr/local/@HDF5_PACKAGE@/share +) + +FIND_PATH (HDF5_ROOT_DIR "@HDF5_PACKAGE@@HDF_PACKAGE_EXT@-config.cmake" + HINTS ${_HDF5_HINTS} + PATHS ${_HDF5_PATHS} + PATH_SUFFIXES + cmake/@HDF5_PACKAGE@ + lib/cmake/@HDF5_PACKAGE@ + share/cmake/@HDF5_PACKAGE@ +) + +FIND_PATH (HDF5_INCLUDE_DIRS "H5public.h" + HINTS ${_HDF5_HINTS} + PATHS ${_HDF5_PATHS} + PATH_SUFFIXES + include + Include +) + +# For backwards compatibility we set HDF5_INCLUDE_DIR to the value of +# HDF5_INCLUDE_DIRS +SET ( HDF5_INCLUDE_DIR "${HDF5_INCLUDE_DIRS}" ) + +IF (HDF5_INCLUDE_DIR) + SET (HDF5_FOUND "YES") + INCLUDE (${HDF5_ROOT_DIR}/@HDF5_PACKAGE@@HDF_PACKAGE_EXT@-config.cmake) +ENDIF (HDF5_INCLUDE_DIR) diff --git a/config/cmake/cacheinit.cmake b/config/cmake/cacheinit.cmake index 43ba754..167fe2e 100644 --- a/config/cmake/cacheinit.cmake +++ b/config/cmake/cacheinit.cmake @@ -1,78 +1,78 @@ -# This is the CMakeCache file.
-
-########################
-# EXTERNAL cache entries
-########################
-
-SET (BUILD_SHARED_LIBS ON CACHE BOOL "Build Shared Libraries" FORCE)
-
-SET (BUILD_TESTING ON CACHE BOOL "Build HDF5 Unit Testing" FORCE)
-
-SET (HDF_PACKAGE_EXT "" CACHE STRING "Name of HDF package extension" FORCE)
-
-SET (HDF5_BUILD_CPP_LIB ON CACHE BOOL "Build HDF5 C++ Library" FORCE)
-
-SET (HDF5_BUILD_EXAMPLES ON CACHE BOOL "Build HDF5 Library Examples" FORCE)
-
-SET (HDF5_BUILD_FORTRAN ON CACHE BOOL "Build FORTRAN support" FORCE)
-
-SET (HDF5_ENABLE_F2003 OFF CACHE BOOL "Enable FORTRAN 2003 Standard" FORCE)
-
-SET (HDF5_BUILD_HL_LIB ON CACHE BOOL "Build HIGH Level HDF5 Library" FORCE)
-
-SET (HDF5_BUILD_TOOLS ON CACHE BOOL "Build HDF5 Tools" FORCE)
-
-SET (HDF5_BUILD_GENERATORS OFF CACHE BOOL "Build Test Generators" FORCE)
-
-SET (HDF5_ENABLE_Z_LIB_SUPPORT ON CACHE BOOL "Enable Zlib Filters" FORCE)
-
-SET (HDF5_ENABLE_SZIP_SUPPORT ON CACHE BOOL "Use SZip Filter" FORCE)
-
-SET (HDF5_ENABLE_SZIP_ENCODING ON CACHE BOOL "Use SZip Encoding" FORCE)
-
-SET (HDF5_ENABLE_HSIZET ON CACHE BOOL "Enable datasets larger than memory" FORCE)
-
-SET (HDF5_ENABLE_UNSUPPORTED OFF CACHE BOOL "Enable unsupported combinations of configuration options" FORCE)
-
-SET (HDF5_ENABLE_DEPRECATED_SYMBOLS ON CACHE BOOL "Enable deprecated public API symbols" FORCE)
-
-SET (HDF5_ENABLE_DIRECT_VFD OFF CACHE BOOL "Build the Direct I/O Virtual File Driver" FORCE)
-
-SET (HDF5_ENABLE_PARALLEL OFF CACHE BOOL "Enable parallel build (requires MPI)" FORCE)
-
-SET (MPIEXEC_MAX_NUMPROCS "3" CACHE STRING "Minimum number of processes for HDF parallel tests" FORCE)
-
-SET (HDF5_BUILD_PARALLEL_ALL OFF CACHE BOOL "Build Parallel Programs" FORCE)
-
-SET (HDF5_ENABLE_COVERAGE OFF CACHE BOOL "Enable code coverage for Libraries and Programs" FORCE)
-
-SET (HDF5_ENABLE_USING_MEMCHECKER OFF CACHE BOOL "Indicate that a memory checker is used" FORCE)
-
-SET (HDF5_DISABLE_COMPILER_WARNINGS OFF CACHE BOOL "Disable compiler warnings" FORCE)
-
-SET (HDF5_USE_FOLDERS ON CACHE BOOL "Enable folder grouping of projects in IDEs." FORCE)
-
-SET (HDF5_USE_16_API_DEFAULT OFF CACHE BOOL "Use the HDF5 1.6.x API by default" FORCE)
-
-SET (HDF5_USE_18_API_DEFAULT OFF CACHE BOOL "Use the HDF5 1.8.x API by default" FORCE)
-
-SET (HDF5_ENABLE_THREADSAFE OFF CACHE BOOL "(WINDOWS)Enable Threadsafety" FORCE)
-
-SET (HDF5_PACKAGE_EXTLIBS OFF CACHE BOOL "(WINDOWS)CPACK - include external libraries" FORCE)
-
-SET (HDF5_NO_PACKAGES OFF CACHE BOOL "CPACK - Disable packaging" FORCE)
-
-SET (HDF5_ALLOW_EXTERNAL_SUPPORT "NO" CACHE STRING "Allow External Library Building (NO SVN TGZ)" FORCE)
-SET_PROPERTY(CACHE HDF5_ALLOW_EXTERNAL_SUPPORT PROPERTY STRINGS NO SVN TGZ)
-
-SET (ZLIB_SVN_URL "http://svn.hdfgroup.uiuc.edu/zlib/trunk" CACHE STRING "Use ZLib from HDF repository" FORCE)
-
-SET (SZIP_SVN_URL "http://svn.hdfgroup.uiuc.edu/szip/trunk" CACHE STRING "Use SZip from HDF repository" FORCE)
-
-SET (ZLIB_TGZ_NAME "ZLib.tar.gz" CACHE STRING "Use ZLib from compressed file" FORCE)
-
-SET (SZIP_TGZ_NAME "SZip.tar.gz" CACHE STRING "Use SZip from compressed file" FORCE)
-
-SET (ZLIB_PACKAGE_NAME "zlib" CACHE STRING "Name of ZLIB package" FORCE)
-
-SET (SZIP_PACKAGE_NAME "szip" CACHE STRING "Name of SZIP package" FORCE)
+# This is the CMakeCache file. + +######################## +# EXTERNAL cache entries +######################## + +SET (BUILD_SHARED_LIBS ON CACHE BOOL "Build Shared Libraries" FORCE) + +SET (BUILD_TESTING ON CACHE BOOL "Build HDF5 Unit Testing" FORCE) + +SET (HDF_PACKAGE_EXT "" CACHE STRING "Name of HDF package extension" FORCE) + +SET (HDF5_BUILD_CPP_LIB ON CACHE BOOL "Build HDF5 C++ Library" FORCE) + +SET (HDF5_BUILD_EXAMPLES ON CACHE BOOL "Build HDF5 Library Examples" FORCE) + +SET (HDF5_BUILD_FORTRAN ON CACHE BOOL "Build FORTRAN support" FORCE) + +SET (HDF5_ENABLE_F2003 OFF CACHE BOOL "Enable FORTRAN 2003 Standard" FORCE) + +SET (HDF5_BUILD_HL_LIB ON CACHE BOOL "Build HIGH Level HDF5 Library" FORCE) + +SET (HDF5_BUILD_TOOLS ON CACHE BOOL "Build HDF5 Tools" FORCE) + +SET (HDF5_BUILD_GENERATORS OFF CACHE BOOL "Build Test Generators" FORCE) + +SET (HDF5_ENABLE_Z_LIB_SUPPORT ON CACHE BOOL "Enable Zlib Filters" FORCE) + +SET (HDF5_ENABLE_SZIP_SUPPORT ON CACHE BOOL "Use SZip Filter" FORCE) + +SET (HDF5_ENABLE_SZIP_ENCODING ON CACHE BOOL "Use SZip Encoding" FORCE) + +SET (HDF5_ENABLE_HSIZET ON CACHE BOOL "Enable datasets larger than memory" FORCE) + +SET (HDF5_ENABLE_UNSUPPORTED OFF CACHE BOOL "Enable unsupported combinations of configuration options" FORCE) + +SET (HDF5_ENABLE_DEPRECATED_SYMBOLS ON CACHE BOOL "Enable deprecated public API symbols" FORCE) + +SET (HDF5_ENABLE_DIRECT_VFD OFF CACHE BOOL "Build the Direct I/O Virtual File Driver" FORCE) + +SET (HDF5_ENABLE_PARALLEL OFF CACHE BOOL "Enable parallel build (requires MPI)" FORCE) + +SET (MPIEXEC_MAX_NUMPROCS "3" CACHE STRING "Minimum number of processes for HDF parallel tests" FORCE) + +SET (HDF5_BUILD_PARALLEL_ALL OFF CACHE BOOL "Build Parallel Programs" FORCE) + +SET (HDF5_ENABLE_COVERAGE OFF CACHE BOOL "Enable code coverage for Libraries and Programs" FORCE) + +SET (HDF5_ENABLE_USING_MEMCHECKER OFF CACHE BOOL "Indicate that a memory checker is used" FORCE) + +SET (HDF5_DISABLE_COMPILER_WARNINGS OFF CACHE BOOL "Disable compiler warnings" FORCE) + +SET (HDF5_USE_FOLDERS ON CACHE BOOL "Enable folder grouping of projects in IDEs." FORCE) + +SET (HDF5_USE_16_API_DEFAULT OFF CACHE BOOL "Use the HDF5 1.6.x API by default" FORCE) + +SET (HDF5_USE_18_API_DEFAULT OFF CACHE BOOL "Use the HDF5 1.8.x API by default" FORCE) + +SET (HDF5_ENABLE_THREADSAFE OFF CACHE BOOL "(WINDOWS)Enable Threadsafety" FORCE) + +SET (HDF5_PACKAGE_EXTLIBS OFF CACHE BOOL "(WINDOWS)CPACK - include external libraries" FORCE) + +SET (HDF5_NO_PACKAGES OFF CACHE BOOL "CPACK - Disable packaging" FORCE) + +SET (HDF5_ALLOW_EXTERNAL_SUPPORT "NO" CACHE STRING "Allow External Library Building (NO SVN TGZ)" FORCE) +SET_PROPERTY(CACHE HDF5_ALLOW_EXTERNAL_SUPPORT PROPERTY STRINGS NO SVN TGZ) + +SET (ZLIB_SVN_URL "http://svn.hdfgroup.uiuc.edu/zlib/trunk" CACHE STRING "Use ZLib from HDF repository" FORCE) + +SET (SZIP_SVN_URL "http://svn.hdfgroup.uiuc.edu/szip/trunk" CACHE STRING "Use SZip from HDF repository" FORCE) + +SET (ZLIB_TGZ_NAME "ZLib.tar.gz" CACHE STRING "Use ZLib from compressed file" FORCE) + +SET (SZIP_TGZ_NAME "SZip.tar.gz" CACHE STRING "Use SZip from compressed file" FORCE) + +SET (ZLIB_PACKAGE_NAME "zlib" CACHE STRING "Name of ZLIB package" FORCE) + +SET (SZIP_PACKAGE_NAME "szip" CACHE STRING "Name of SZIP package" FORCE) diff --git a/config/cmake/hdf5-config-version.cmake.in b/config/cmake/hdf5-config-version.cmake.in index c1201cc..0f3d8b5 100644 --- a/config/cmake/hdf5-config-version.cmake.in +++ b/config/cmake/hdf5-config-version.cmake.in @@ -1,27 +1,27 @@ -#-----------------------------------------------------------------------------
-# HDF5 Version file for install directory
-#-----------------------------------------------------------------------------
-
-SET (PACKAGE_VERSION @HDF5_VERSION_STRING@)
-
-IF ("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL @H5_VERS_MAJOR@)
-
- # exact match for version @H5_VERS_MAJOR@.@H5_VERS_MINOR@
- IF ("${PACKAGE_FIND_VERSION_MINOR}" EQUAL @H5_VERS_MINOR@)
-
- # compatible with any version @H5_VERS_MAJOR@.@H5_VERS_MINOR@.x
- SET (PACKAGE_VERSION_COMPATIBLE 1)
-
- IF ("${PACKAGE_FIND_VERSION_PATCH}" EQUAL @H5_VERS_RELEASE@)
- SET (PACKAGE_VERSION_EXACT 1)
-
- IF ("${PACKAGE_FIND_VERSION_TWEAK}" EQUAL @H5_VERS_SUBRELEASE@)
- # not using this yet
- ENDIF ("${PACKAGE_FIND_VERSION_TWEAK}" EQUAL @H5_VERS_SUBRELEASE@)
-
- ENDIF ("${PACKAGE_FIND_VERSION_PATCH}" EQUAL @H5_VERS_RELEASE@)
-
- ENDIF ("${PACKAGE_FIND_VERSION_MINOR}" EQUAL @H5_VERS_MINOR@)
-ENDIF ("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL @H5_VERS_MAJOR@)
-
-
+#----------------------------------------------------------------------------- +# HDF5 Version file for install directory +#----------------------------------------------------------------------------- + +SET (PACKAGE_VERSION @HDF5_VERSION_STRING@) + +IF ("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL @H5_VERS_MAJOR@) + + # exact match for version @H5_VERS_MAJOR@.@H5_VERS_MINOR@ + IF ("${PACKAGE_FIND_VERSION_MINOR}" EQUAL @H5_VERS_MINOR@) + + # compatible with any version @H5_VERS_MAJOR@.@H5_VERS_MINOR@.x + SET (PACKAGE_VERSION_COMPATIBLE 1) + + IF ("${PACKAGE_FIND_VERSION_PATCH}" EQUAL @H5_VERS_RELEASE@) + SET (PACKAGE_VERSION_EXACT 1) + + IF ("${PACKAGE_FIND_VERSION_TWEAK}" EQUAL @H5_VERS_SUBRELEASE@) + # not using this yet + ENDIF ("${PACKAGE_FIND_VERSION_TWEAK}" EQUAL @H5_VERS_SUBRELEASE@) + + ENDIF ("${PACKAGE_FIND_VERSION_PATCH}" EQUAL @H5_VERS_RELEASE@) + + ENDIF ("${PACKAGE_FIND_VERSION_MINOR}" EQUAL @H5_VERS_MINOR@) +ENDIF ("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL @H5_VERS_MAJOR@) + + diff --git a/config/cmake/hdf5-config.cmake.build.in b/config/cmake/hdf5-config.cmake.build.in index fbe97ac..7f65be8 100644 --- a/config/cmake/hdf5-config.cmake.build.in +++ b/config/cmake/hdf5-config.cmake.build.in @@ -1,73 +1,73 @@ -#-----------------------------------------------------------------------------
-# HDF5 Config file for compiling against hdf5 build directory
-#-----------------------------------------------------------------------------
-GET_FILENAME_COMPONENT (SELF_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
-
-#-----------------------------------------------------------------------------
-# User Options
-#-----------------------------------------------------------------------------
-SET (HDF5_ENABLE_PARALLEL @HDF5_ENABLE_PARALLEL@)
-SET (HDF5_BUILD_FORTRAN @HDF5_BUILD_FORTRAN@)
-SET (HDF5_ENABLE_F2003 @HDF5_ENABLE_F2003@)
-SET (HDF5_BUILD_CPP_LIB @HDF5_BUILD_CPP_LIB@)
-SET (HDF5_BUILD_TOOLS @HDF5_BUILD_TOOLS@)
-SET (HDF5_BUILD_HL_LIB @HDF5_BUILD_HL_LIB@)
-SET (HDF5_ENABLE_Z_LIB_SUPPORT @HDF5_ENABLE_Z_LIB_SUPPORT@)
-SET (HDF5_ENABLE_SZIP_SUPPORT @HDF5_ENABLE_SZIP_SUPPORT@)
-SET (HDF5_ENABLE_SZIP_ENCODING @HDF5_ENABLE_SZIP_ENCODING@)
-SET (HDF5_BUILD_SHARED_LIBS @BUILD_SHARED_LIBS@)
-
-#-----------------------------------------------------------------------------
-# Dependencies
-#-----------------------------------------------------------------------------
-IF(HDF5_ENABLE_PARALLEL)
- SET(HDF5_MPI_C_INCLUDE_PATH "@MPI_C_INCLUDE_PATH@")
- SET(HDF5_MPI_C_LIBRARIES "@MPI_C_LIBRARIES@")
-ENDIF(HDF5_ENABLE_PARALLEL)
-
-#-----------------------------------------------------------------------------
-# Directories
-#-----------------------------------------------------------------------------
-SET (HDF5_INCLUDE_DIR "@HDF5_INCLUDES_BUILD_TIME@" "${HDF5_MPI_C_INCLUDE_PATH}" )
-
-IF (HDF5_BUILD_FORTRAN)
- SET (HDF5_INCLUDE_DIR_FORTRAN "@CMAKE_Fortran_MODULE_DIRECTORY@" )
-ENDIF (HDF5_BUILD_FORTRAN)
-
-IF (HDF5_BUILD_CPP_LIB)
- SET (HDF5_INCLUDE_DIR_CPP ${HDF5_INCLUDE_DIR} )
-ENDIF (HDF5_BUILD_CPP_LIB)
-
-IF (HDF5_BUILD_HL_LIB)
- SET (HDF5_INCLUDE_DIR_HL ${HDF5_INCLUDE_DIR} )
-ENDIF (HDF5_BUILD_HL_LIB)
-
-IF (HDF5_BUILD_HL_LIB AND HDF5_BUILD_CPP_LIB)
- SET (HDF5_INCLUDE_DIR_HL_CPP ${HDF5_INCLUDE_DIR} )
-ENDIF (HDF5_BUILD_HL_LIB AND HDF5_BUILD_CPP_LIB)
-
-IF (HDF5_BUILD_TOOLS)
- SET (HDF5_INCLUDE_DIR_TOOLS ${HDF5_INCLUDE_DIR} )
-ENDIF (HDF5_BUILD_TOOLS)
-
-IF (HDF5_BUILD_SHARED_LIBS)
- SET (H5_BUILT_AS_DYNAMIC_LIB 1 )
-ELSE (HDF5_BUILD_SHARED_LIBS)
- SET (H5_BUILT_AS_STATIC_LIB 1 )
-ENDIF (HDF5_BUILD_SHARED_LIBS)
-
-#-----------------------------------------------------------------------------
-# Version Strings
-#-----------------------------------------------------------------------------
-SET (HDF5_VERSION_STRING @HDF5_VERSION_STRING@)
-SET (HDF5_VERSION_MAJOR @HDF5_VERSION_MAJOR@)
-SET (HDF5_VERSION_MINOR @HDF5_VERSION_MINOR@)
-
-#-----------------------------------------------------------------------------
-# Don't include targets if this file is being picked up by another
-# project which has already build hdf5 as a subproject
-#-----------------------------------------------------------------------------
-IF (NOT TARGET "@HDF5_PACKAGE@")
- INCLUDE (${SELF_DIR}/@HDF5_PACKAGE@@HDF_PACKAGE_EXT@-targets.cmake)
- SET (HDF5_LIBRARIES "@HDF5_LIBRARIES_TO_EXPORT@")
-ENDIF (NOT TARGET "@HDF5_PACKAGE@")
+#----------------------------------------------------------------------------- +# HDF5 Config file for compiling against hdf5 build directory +#----------------------------------------------------------------------------- +GET_FILENAME_COMPONENT (SELF_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH) + +#----------------------------------------------------------------------------- +# User Options +#----------------------------------------------------------------------------- +SET (HDF5_ENABLE_PARALLEL @HDF5_ENABLE_PARALLEL@) +SET (HDF5_BUILD_FORTRAN @HDF5_BUILD_FORTRAN@) +SET (HDF5_ENABLE_F2003 @HDF5_ENABLE_F2003@) +SET (HDF5_BUILD_CPP_LIB @HDF5_BUILD_CPP_LIB@) +SET (HDF5_BUILD_TOOLS @HDF5_BUILD_TOOLS@) +SET (HDF5_BUILD_HL_LIB @HDF5_BUILD_HL_LIB@) +SET (HDF5_ENABLE_Z_LIB_SUPPORT @HDF5_ENABLE_Z_LIB_SUPPORT@) +SET (HDF5_ENABLE_SZIP_SUPPORT @HDF5_ENABLE_SZIP_SUPPORT@) +SET (HDF5_ENABLE_SZIP_ENCODING @HDF5_ENABLE_SZIP_ENCODING@) +SET (HDF5_BUILD_SHARED_LIBS @BUILD_SHARED_LIBS@) + +#----------------------------------------------------------------------------- +# Dependencies +#----------------------------------------------------------------------------- +IF(HDF5_ENABLE_PARALLEL) + SET(HDF5_MPI_C_INCLUDE_PATH "@MPI_C_INCLUDE_PATH@") + SET(HDF5_MPI_C_LIBRARIES "@MPI_C_LIBRARIES@") +ENDIF(HDF5_ENABLE_PARALLEL) + +#----------------------------------------------------------------------------- +# Directories +#----------------------------------------------------------------------------- +SET (HDF5_INCLUDE_DIR "@HDF5_INCLUDES_BUILD_TIME@" "${HDF5_MPI_C_INCLUDE_PATH}" ) + +IF (HDF5_BUILD_FORTRAN) + SET (HDF5_INCLUDE_DIR_FORTRAN "@CMAKE_Fortran_MODULE_DIRECTORY@" ) +ENDIF (HDF5_BUILD_FORTRAN) + +IF (HDF5_BUILD_CPP_LIB) + SET (HDF5_INCLUDE_DIR_CPP ${HDF5_INCLUDE_DIR} ) +ENDIF (HDF5_BUILD_CPP_LIB) + +IF (HDF5_BUILD_HL_LIB) + SET (HDF5_INCLUDE_DIR_HL ${HDF5_INCLUDE_DIR} ) +ENDIF (HDF5_BUILD_HL_LIB) + +IF (HDF5_BUILD_HL_LIB AND HDF5_BUILD_CPP_LIB) + SET (HDF5_INCLUDE_DIR_HL_CPP ${HDF5_INCLUDE_DIR} ) +ENDIF (HDF5_BUILD_HL_LIB AND HDF5_BUILD_CPP_LIB) + +IF (HDF5_BUILD_TOOLS) + SET (HDF5_INCLUDE_DIR_TOOLS ${HDF5_INCLUDE_DIR} ) +ENDIF (HDF5_BUILD_TOOLS) + +IF (HDF5_BUILD_SHARED_LIBS) + SET (H5_BUILT_AS_DYNAMIC_LIB 1 ) +ELSE (HDF5_BUILD_SHARED_LIBS) + SET (H5_BUILT_AS_STATIC_LIB 1 ) +ENDIF (HDF5_BUILD_SHARED_LIBS) + +#----------------------------------------------------------------------------- +# Version Strings +#----------------------------------------------------------------------------- +SET (HDF5_VERSION_STRING @HDF5_VERSION_STRING@) +SET (HDF5_VERSION_MAJOR @HDF5_VERSION_MAJOR@) +SET (HDF5_VERSION_MINOR @HDF5_VERSION_MINOR@) + +#----------------------------------------------------------------------------- +# Don't include targets if this file is being picked up by another +# project which has already build hdf5 as a subproject +#----------------------------------------------------------------------------- +IF (NOT TARGET "@HDF5_PACKAGE@") + INCLUDE (${SELF_DIR}/@HDF5_PACKAGE@@HDF_PACKAGE_EXT@-targets.cmake) + SET (HDF5_LIBRARIES "@HDF5_LIBRARIES_TO_EXPORT@") +ENDIF (NOT TARGET "@HDF5_PACKAGE@") diff --git a/config/cmake/hdf5-config.cmake.install.in b/config/cmake/hdf5-config.cmake.install.in index 9c5a5a1..451b86d 100644 --- a/config/cmake/hdf5-config.cmake.install.in +++ b/config/cmake/hdf5-config.cmake.install.in @@ -1,81 +1,81 @@ -#-----------------------------------------------------------------------------
-# HDF5 Config file for compiling against hdf5 install directory
-#-----------------------------------------------------------------------------
-GET_FILENAME_COMPONENT (SELF_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
-GET_FILENAME_COMPONENT(_IMPORT_PREFIX "${SELF_DIR}" PATH)
-GET_FILENAME_COMPONENT(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH)
-IF (NOT WIN32)
- GET_FILENAME_COMPONENT(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH)
-ENDIF (NOT WIN32)
-
-#-----------------------------------------------------------------------------
-# User Options
-#-----------------------------------------------------------------------------
-SET (HDF5_ENABLE_PARALLEL @HDF5_ENABLE_PARALLEL@)
-SET (HDF5_BUILD_FORTRAN @HDF5_BUILD_FORTRAN@)
-SET (HDF5_ENABLE_F2003 @HDF5_ENABLE_F2003@)
-SET (HDF5_BUILD_CPP_LIB @HDF5_BUILD_CPP_LIB@)
-SET (HDF5_BUILD_TOOLS @HDF5_BUILD_TOOLS@)
-SET (HDF5_BUILD_HL_LIB @HDF5_BUILD_HL_LIB@)
-SET (HDF5_ENABLE_Z_LIB_SUPPORT @HDF5_ENABLE_Z_LIB_SUPPORT@)
-SET (HDF5_ENABLE_SZIP_SUPPORT @HDF5_ENABLE_SZIP_SUPPORT@)
-SET (HDF5_ENABLE_SZIP_ENCODING @HDF5_ENABLE_SZIP_ENCODING@)
-SET (HDF5_BUILD_SHARED_LIBS @BUILD_SHARED_LIBS@)
-SET (HDF5_PACKAGE_EXTLIBS @HDF5_PACKAGE_EXTLIBS@)
-
-#-----------------------------------------------------------------------------
-# Dependencies
-#-----------------------------------------------------------------------------
-IF(HDF5_ENABLE_PARALLEL)
- SET(HDF5_MPI_C_INCLUDE_PATH "@MPI_C_INCLUDE_PATH@")
- SET(HDF5_MPI_C_LIBRARIES "@MPI_C_LIBRARIES@")
-ENDIF(HDF5_ENABLE_PARALLEL)
-
-#-----------------------------------------------------------------------------
-# Directories
-#-----------------------------------------------------------------------------
-SET (HDF5_INCLUDE_DIR "${_IMPORT_PREFIX}/include" "${HDF5_MPI_C_INCLUDE_PATH}" )
-
-IF (HDF5_BUILD_FORTRAN)
- SET (HDF5_INCLUDE_DIR_FORTRAN "${_IMPORT_PREFIX}/include/fortran" )
-ENDIF (HDF5_BUILD_FORTRAN)
-
-IF (HDF5_BUILD_CPP_LIB)
- SET (HDF5_INCLUDE_DIR_CPP "${_IMPORT_PREFIX}/include/cpp" )
-ENDIF (HDF5_BUILD_CPP_LIB)
-
-IF (HDF5_BUILD_HL_LIB)
- SET (HDF5_INCLUDE_DIR_HL "${_IMPORT_PREFIX}/include/hl" )
-ENDIF (HDF5_BUILD_HL_LIB)
-
-IF (HDF5_BUILD_HL_LIB AND HDF5_BUILD_CPP_LIB)
- SET (HDF5_INCLUDE_DIR_HL_CPP "${_IMPORT_PREFIX}/include/hl/cpp" )
-ENDIF (HDF5_BUILD_HL_LIB AND HDF5_BUILD_CPP_LIB)
-
-IF (HDF5_BUILD_TOOLS)
- SET (HDF5_INCLUDE_DIR_TOOLS "${_IMPORT_PREFIX}/include" )
- SET (HDF5_TOOLS_DIR "${_IMPORT_PREFIX}/bin" )
-ENDIF (HDF5_BUILD_TOOLS)
-
-#-----------------------------------------------------------------------------
-# Version Strings
-#-----------------------------------------------------------------------------
-SET (HDF5_VERSION_STRING @HDF5_VERSION_STRING@)
-SET (HDF5_VERSION_MAJOR @HDF5_VERSION_MAJOR@)
-SET (HDF5_VERSION_MINOR @HDF5_VERSION_MINOR@)
-
-#-----------------------------------------------------------------------------
-# Don't include targets if this file is being picked up by another
-# project which has already built hdf5 as a subproject
-#-----------------------------------------------------------------------------
-IF (NOT TARGET "@HDF5_PACKAGE@")
- IF (HDF5_ENABLE_Z_LIB_SUPPORT AND HDF5_PACKAGE_EXTLIBS AND NOT TARGET "zlib")
- INCLUDE (${SELF_DIR}/../ZLIB/@ZLIB_PACKAGE_NAME@@HDF_PACKAGE_EXT@-targets.cmake)
- ENDIF (HDF5_ENABLE_Z_LIB_SUPPORT AND HDF5_PACKAGE_EXTLIBS AND NOT TARGET "zlib")
- IF (HDF5_ENABLE_SZIP_SUPPORT AND HDF5_PACKAGE_EXTLIBS AND NOT TARGET "szip")
- INCLUDE (${SELF_DIR}/../SZIP/@SZIP_PACKAGE_NAME@@HDF_PACKAGE_EXT@-targets.cmake)
- ENDIF (HDF5_ENABLE_SZIP_SUPPORT AND HDF5_PACKAGE_EXTLIBS AND NOT TARGET "szip")
- INCLUDE (${SELF_DIR}/@HDF5_PACKAGE@@HDF_PACKAGE_EXT@-targets.cmake)
- SET (HDF5_LIBRARIES "@HDF5_LIBRARIES_TO_EXPORT@")
-ENDIF (NOT TARGET "@HDF5_PACKAGE@")
-
+#----------------------------------------------------------------------------- +# HDF5 Config file for compiling against hdf5 install directory +#----------------------------------------------------------------------------- +GET_FILENAME_COMPONENT (SELF_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH) +GET_FILENAME_COMPONENT(_IMPORT_PREFIX "${SELF_DIR}" PATH) +GET_FILENAME_COMPONENT(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH) +IF (NOT WIN32) + GET_FILENAME_COMPONENT(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH) +ENDIF (NOT WIN32) + +#----------------------------------------------------------------------------- +# User Options +#----------------------------------------------------------------------------- +SET (HDF5_ENABLE_PARALLEL @HDF5_ENABLE_PARALLEL@) +SET (HDF5_BUILD_FORTRAN @HDF5_BUILD_FORTRAN@) +SET (HDF5_ENABLE_F2003 @HDF5_ENABLE_F2003@) +SET (HDF5_BUILD_CPP_LIB @HDF5_BUILD_CPP_LIB@) +SET (HDF5_BUILD_TOOLS @HDF5_BUILD_TOOLS@) +SET (HDF5_BUILD_HL_LIB @HDF5_BUILD_HL_LIB@) +SET (HDF5_ENABLE_Z_LIB_SUPPORT @HDF5_ENABLE_Z_LIB_SUPPORT@) +SET (HDF5_ENABLE_SZIP_SUPPORT @HDF5_ENABLE_SZIP_SUPPORT@) +SET (HDF5_ENABLE_SZIP_ENCODING @HDF5_ENABLE_SZIP_ENCODING@) +SET (HDF5_BUILD_SHARED_LIBS @BUILD_SHARED_LIBS@) +SET (HDF5_PACKAGE_EXTLIBS @HDF5_PACKAGE_EXTLIBS@) + +#----------------------------------------------------------------------------- +# Dependencies +#----------------------------------------------------------------------------- +IF(HDF5_ENABLE_PARALLEL) + SET(HDF5_MPI_C_INCLUDE_PATH "@MPI_C_INCLUDE_PATH@") + SET(HDF5_MPI_C_LIBRARIES "@MPI_C_LIBRARIES@") +ENDIF(HDF5_ENABLE_PARALLEL) + +#----------------------------------------------------------------------------- +# Directories +#----------------------------------------------------------------------------- +SET (HDF5_INCLUDE_DIR "${_IMPORT_PREFIX}/include" "${HDF5_MPI_C_INCLUDE_PATH}" ) + +IF (HDF5_BUILD_FORTRAN) + SET (HDF5_INCLUDE_DIR_FORTRAN "${_IMPORT_PREFIX}/include/fortran" ) +ENDIF (HDF5_BUILD_FORTRAN) + +IF (HDF5_BUILD_CPP_LIB) + SET (HDF5_INCLUDE_DIR_CPP "${_IMPORT_PREFIX}/include/cpp" ) +ENDIF (HDF5_BUILD_CPP_LIB) + +IF (HDF5_BUILD_HL_LIB) + SET (HDF5_INCLUDE_DIR_HL "${_IMPORT_PREFIX}/include/hl" ) +ENDIF (HDF5_BUILD_HL_LIB) + +IF (HDF5_BUILD_HL_LIB AND HDF5_BUILD_CPP_LIB) + SET (HDF5_INCLUDE_DIR_HL_CPP "${_IMPORT_PREFIX}/include/hl/cpp" ) +ENDIF (HDF5_BUILD_HL_LIB AND HDF5_BUILD_CPP_LIB) + +IF (HDF5_BUILD_TOOLS) + SET (HDF5_INCLUDE_DIR_TOOLS "${_IMPORT_PREFIX}/include" ) + SET (HDF5_TOOLS_DIR "${_IMPORT_PREFIX}/bin" ) +ENDIF (HDF5_BUILD_TOOLS) + +#----------------------------------------------------------------------------- +# Version Strings +#----------------------------------------------------------------------------- +SET (HDF5_VERSION_STRING @HDF5_VERSION_STRING@) +SET (HDF5_VERSION_MAJOR @HDF5_VERSION_MAJOR@) +SET (HDF5_VERSION_MINOR @HDF5_VERSION_MINOR@) + +#----------------------------------------------------------------------------- +# Don't include targets if this file is being picked up by another +# project which has already built hdf5 as a subproject +#----------------------------------------------------------------------------- +IF (NOT TARGET "@HDF5_PACKAGE@") + IF (HDF5_ENABLE_Z_LIB_SUPPORT AND HDF5_PACKAGE_EXTLIBS AND NOT TARGET "zlib") + INCLUDE (${SELF_DIR}/../ZLIB/@ZLIB_PACKAGE_NAME@@HDF_PACKAGE_EXT@-targets.cmake) + ENDIF (HDF5_ENABLE_Z_LIB_SUPPORT AND HDF5_PACKAGE_EXTLIBS AND NOT TARGET "zlib") + IF (HDF5_ENABLE_SZIP_SUPPORT AND HDF5_PACKAGE_EXTLIBS AND NOT TARGET "szip") + INCLUDE (${SELF_DIR}/../SZIP/@SZIP_PACKAGE_NAME@@HDF_PACKAGE_EXT@-targets.cmake) + ENDIF (HDF5_ENABLE_SZIP_SUPPORT AND HDF5_PACKAGE_EXTLIBS AND NOT TARGET "szip") + INCLUDE (${SELF_DIR}/@HDF5_PACKAGE@@HDF_PACKAGE_EXT@-targets.cmake) + SET (HDF5_LIBRARIES "@HDF5_LIBRARIES_TO_EXPORT@") +ENDIF (NOT TARGET "@HDF5_PACKAGE@") + diff --git a/config/cmake/mccacheinit.cmake b/config/cmake/mccacheinit.cmake index 8ca3879..49ffa92 100644 --- a/config/cmake/mccacheinit.cmake +++ b/config/cmake/mccacheinit.cmake @@ -1,81 +1,81 @@ -# This is the CMakeCache file.
-
-########################
-# EXTERNAL cache entries
-########################
-
-SET (BUILD_SHARED_LIBS OFF CACHE BOOL "Build Shared Libraries" FORCE)
-
-SET (BUILD_TESTING ON CACHE BOOL "Build HDF5 Unit Testing" FORCE)
-
-SET (HDF_PACKAGE_EXT "" CACHE STRING "Name of HDF package extension" FORCE)
-
-SET (HDF5_BUILD_CPP_LIB ON CACHE BOOL "Build HDF5 C++ Library" FORCE)
-
-SET (HDF5_BUILD_EXAMPLES ON CACHE BOOL "Build HDF5 Library Examples" FORCE)
-
-SET (HDF5_BUILD_FORTRAN ON CACHE BOOL "Build FORTRAN support" FORCE)
-
-SET (HDF5_ENABLE_F2003 OFF CACHE BOOL "Enable FORTRAN 2003 Standard" FORCE)
-
-SET (HDF5_BUILD_HL_LIB ON CACHE BOOL "Build HIGH Level HDF5 Library" FORCE)
-
-SET (HDF5_BUILD_TOOLS ON CACHE BOOL "Build HDF5 Tools" FORCE)
-
-SET (HDF5_BUILD_GENERATORS OFF CACHE BOOL "Build Test Generators" FORCE)
-
-SET (HDF5_ENABLE_Z_LIB_SUPPORT ON CACHE BOOL "Enable Zlib Filters" FORCE)
-
-SET (HDF5_ENABLE_SZIP_SUPPORT ON CACHE BOOL "Use SZip Filter" FORCE)
-
-SET (HDF5_ENABLE_SZIP_ENCODING ON CACHE BOOL "Use SZip Encoding" FORCE)
-
-SET (HDF5_ENABLE_HSIZET ON CACHE BOOL "Enable datasets larger than memory" FORCE)
-
-SET (HDF5_ENABLE_UNSUPPORTED OFF CACHE BOOL "Enable unsupported combinations of configuration options" FORCE)
-
-SET (HDF5_ENABLE_DEPRECATED_SYMBOLS ON CACHE BOOL "Enable deprecated public API symbols" FORCE)
-
-SET (HDF5_ENABLE_DIRECT_VFD OFF CACHE BOOL "Build the Direct I/O Virtual File Driver" FORCE)
-
-SET (HDF5_ENABLE_PARALLEL OFF CACHE BOOL "Enable parallel build (requires MPI)" FORCE)
-
-SET (MPIEXEC_MAX_NUMPROCS "3" CACHE STRING "Minimum number of processes for HDF parallel tests" FORCE)
-
-SET (HDF5_BUILD_PARALLEL_ALL OFF CACHE BOOL "Build Parallel Programs" FORCE)
-
-SET (HDF5_ENABLE_COVERAGE OFF CACHE BOOL "Enable code coverage for Libraries and Programs" FORCE)
-
-SET (HDF5_ENABLE_USING_MEMCHECKER ON CACHE BOOL "Indicate that a memory checker is used" FORCE)
-
-SET (HDF5_DISABLE_COMPILER_WARNINGS OFF CACHE BOOL "Disable compiler warnings" FORCE)
-
-SET (HDF5_USE_FOLDERS ON CACHE BOOL "Enable folder grouping of projects in IDEs." FORCE)
-
-SET (HDF5_USE_16_API_DEFAULT OFF CACHE BOOL "Use the HDF5 1.6.x API by default" FORCE)
-
-SET (HDF5_USE_18_API_DEFAULT OFF CACHE BOOL "Use the HDF5 1.8.x API by default" FORCE)
-
-SET (HDF5_ENABLE_THREADSAFE OFF CACHE BOOL "(WINDOWS)Enable Threadsafety" FORCE)
-
-SET (HDF5_PACKAGE_EXTLIBS OFF CACHE BOOL "(WINDOWS)CPACK - include external libraries" FORCE)
-
-SET (HDF5_NO_PACKAGES ON CACHE BOOL "CPACK - Disable packaging" FORCE)
-
-SET (HDF5_ALLOW_EXTERNAL_SUPPORT "NO" CACHE STRING "Allow External Library Building" FORCE)
-
-SET (ZLIB_SVN_URL "http://svn.hdfgroup.uiuc.edu/zlib/trunk" CACHE STRING "Use ZLib from HDF repository" FORCE)
-
-SET (SZIP_SVN_URL "http://svn.hdfgroup.uiuc.edu/szip/trunk" CACHE STRING "Use SZip from HDF repository" FORCE)
-
-SET (ZLIB_TGZ_NAME "ZLib.tar.gz" CACHE STRING "Use ZLib from compressed file" FORCE)
-
-SET (SZIP_TGZ_NAME "SZip.tar.gz" CACHE STRING "Use SZip from compressed file" FORCE)
-
-SET (CMAKE_BUILD_TYPE "Debug" CACHE STRING "Build Debug" FORCE)
-
-SET (CTEST_BUILD_CONFIGURATION "Debug" CACHE STRING "Build Debug" FORCE)
-
-SET (ZLIB_PACKAGE_NAME "zlib" CACHE STRING "Name of ZLIB package" FORCE)
-
-SET (SZIP_PACKAGE_NAME "szip" CACHE STRING "Name of SZIP package" FORCE)
+# This is the CMakeCache file. + +######################## +# EXTERNAL cache entries +######################## + +SET (BUILD_SHARED_LIBS OFF CACHE BOOL "Build Shared Libraries" FORCE) + +SET (BUILD_TESTING ON CACHE BOOL "Build HDF5 Unit Testing" FORCE) + +SET (HDF_PACKAGE_EXT "" CACHE STRING "Name of HDF package extension" FORCE) + +SET (HDF5_BUILD_CPP_LIB ON CACHE BOOL "Build HDF5 C++ Library" FORCE) + +SET (HDF5_BUILD_EXAMPLES ON CACHE BOOL "Build HDF5 Library Examples" FORCE) + +SET (HDF5_BUILD_FORTRAN ON CACHE BOOL "Build FORTRAN support" FORCE) + +SET (HDF5_ENABLE_F2003 OFF CACHE BOOL "Enable FORTRAN 2003 Standard" FORCE) + +SET (HDF5_BUILD_HL_LIB ON CACHE BOOL "Build HIGH Level HDF5 Library" FORCE) + +SET (HDF5_BUILD_TOOLS ON CACHE BOOL "Build HDF5 Tools" FORCE) + +SET (HDF5_BUILD_GENERATORS OFF CACHE BOOL "Build Test Generators" FORCE) + +SET (HDF5_ENABLE_Z_LIB_SUPPORT ON CACHE BOOL "Enable Zlib Filters" FORCE) + +SET (HDF5_ENABLE_SZIP_SUPPORT ON CACHE BOOL "Use SZip Filter" FORCE) + +SET (HDF5_ENABLE_SZIP_ENCODING ON CACHE BOOL "Use SZip Encoding" FORCE) + +SET (HDF5_ENABLE_HSIZET ON CACHE BOOL "Enable datasets larger than memory" FORCE) + +SET (HDF5_ENABLE_UNSUPPORTED OFF CACHE BOOL "Enable unsupported combinations of configuration options" FORCE) + +SET (HDF5_ENABLE_DEPRECATED_SYMBOLS ON CACHE BOOL "Enable deprecated public API symbols" FORCE) + +SET (HDF5_ENABLE_DIRECT_VFD OFF CACHE BOOL "Build the Direct I/O Virtual File Driver" FORCE) + +SET (HDF5_ENABLE_PARALLEL OFF CACHE BOOL "Enable parallel build (requires MPI)" FORCE) + +SET (MPIEXEC_MAX_NUMPROCS "3" CACHE STRING "Minimum number of processes for HDF parallel tests" FORCE) + +SET (HDF5_BUILD_PARALLEL_ALL OFF CACHE BOOL "Build Parallel Programs" FORCE) + +SET (HDF5_ENABLE_COVERAGE OFF CACHE BOOL "Enable code coverage for Libraries and Programs" FORCE) + +SET (HDF5_ENABLE_USING_MEMCHECKER ON CACHE BOOL "Indicate that a memory checker is used" FORCE) + +SET (HDF5_DISABLE_COMPILER_WARNINGS OFF CACHE BOOL "Disable compiler warnings" FORCE) + +SET (HDF5_USE_FOLDERS ON CACHE BOOL "Enable folder grouping of projects in IDEs." FORCE) + +SET (HDF5_USE_16_API_DEFAULT OFF CACHE BOOL "Use the HDF5 1.6.x API by default" FORCE) + +SET (HDF5_USE_18_API_DEFAULT OFF CACHE BOOL "Use the HDF5 1.8.x API by default" FORCE) + +SET (HDF5_ENABLE_THREADSAFE OFF CACHE BOOL "(WINDOWS)Enable Threadsafety" FORCE) + +SET (HDF5_PACKAGE_EXTLIBS OFF CACHE BOOL "(WINDOWS)CPACK - include external libraries" FORCE) + +SET (HDF5_NO_PACKAGES ON CACHE BOOL "CPACK - Disable packaging" FORCE) + +SET (HDF5_ALLOW_EXTERNAL_SUPPORT "NO" CACHE STRING "Allow External Library Building" FORCE) + +SET (ZLIB_SVN_URL "http://svn.hdfgroup.uiuc.edu/zlib/trunk" CACHE STRING "Use ZLib from HDF repository" FORCE) + +SET (SZIP_SVN_URL "http://svn.hdfgroup.uiuc.edu/szip/trunk" CACHE STRING "Use SZip from HDF repository" FORCE) + +SET (ZLIB_TGZ_NAME "ZLib.tar.gz" CACHE STRING "Use ZLib from compressed file" FORCE) + +SET (SZIP_TGZ_NAME "SZip.tar.gz" CACHE STRING "Use SZip from compressed file" FORCE) + +SET (CMAKE_BUILD_TYPE "Debug" CACHE STRING "Build Debug" FORCE) + +SET (CTEST_BUILD_CONFIGURATION "Debug" CACHE STRING "Build Debug" FORCE) + +SET (ZLIB_PACKAGE_NAME "zlib" CACHE STRING "Name of ZLIB package" FORCE) + +SET (SZIP_PACKAGE_NAME "szip" CACHE STRING "Name of SZIP package" FORCE) diff --git a/examples/h5_cmprss.c b/examples/h5_cmprss.c index 4a2f982..8d365a3 100644 --- a/examples/h5_cmprss.c +++ b/examples/h5_cmprss.c @@ -1,125 +1,125 @@ -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- * Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
- * All rights reserved. *
- * *
- * This file is part of HDF5. The full HDF5 copyright notice, including *
- * terms governing use, modification, and redistribution, is contained in *
- * the files COPYING and Copyright.html. COPYING can be found at the root *
- * of the source code distribution tree; Copyright.html can be found at the *
- * root level of an installed copy of the electronic HDF5 document set and *
- * is linked from the top-level documents page. It can also be found at *
- * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have *
- * access to either file, you may request a copy from help@hdfgroup.org. *
- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-
-/*
- * This example illustrates how to create a compressed dataset.
- * It is used in the HDF5 Tutorial.
- */
-
-#include "hdf5.h"
-
-#define FILE "cmprss.h5"
-#define RANK 2
-#define DIM0 100
-#define DIM1 20
-
-int main () {
-
- hid_t file_id, dataset_id, dataspace_id; /* identifiers */
- hid_t plist_id;
-
- size_t nelmts;
- unsigned flags, filter_info;
- H5Z_filter_t filter_type;
-
- herr_t status;
- hsize_t dims[2];
- hsize_t cdims[2];
-
- int idx;
- int i,j, numfilt;
- int buf[DIM0][DIM1];
- int rbuf [DIM0][DIM1];
-
- /* Uncomment these variables to use SZIP compression
- unsigned szip_options_mask;
- unsigned szip_pixels_per_block;
- */
-
- /* Create a file. */
- file_id = H5Fcreate (FILE, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
-
-
- /* Create dataset "Compressed Data" in the group using absolute name. */
- dims[0] = DIM0;
- dims[1] = DIM1;
- dataspace_id = H5Screate_simple (RANK, dims, NULL);
-
- plist_id = H5Pcreate (H5P_DATASET_CREATE);
-
- /* Dataset must be chunked for compression */
- cdims[0] = 20;
- cdims[1] = 20;
- status = H5Pset_chunk (plist_id, 2, cdims);
-
- /* Set ZLIB / DEFLATE Compression using compression level 6.
- * To use SZIP Compression comment out these lines.
- */
- status = H5Pset_deflate (plist_id, 6);
-
- /* Uncomment these lines to set SZIP Compression
- szip_options_mask = H5_SZIP_NN_OPTION_MASK;
- szip_pixels_per_block = 16;
- status = H5Pset_szip (plist_id, szip_options_mask, szip_pixels_per_block);
- */
-
- dataset_id = H5Dcreate2 (file_id, "Compressed_Data", H5T_STD_I32BE,
- dataspace_id, H5P_DEFAULT, plist_id, H5P_DEFAULT);
-
- for (i = 0; i< DIM0; i++)
- for (j=0; j<DIM1; j++)
- buf[i][j] = i+j;
-
- status = H5Dwrite (dataset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf);
-
- status = H5Sclose (dataspace_id);
- status = H5Dclose (dataset_id);
- status = H5Pclose (plist_id);
- status = H5Fclose (file_id);
-
- /* Now reopen the file and dataset in the file. */
- file_id = H5Fopen (FILE, H5F_ACC_RDWR, H5P_DEFAULT);
- dataset_id = H5Dopen2 (file_id, "Compressed_Data", H5P_DEFAULT);
-
- /* Retrieve filter information. */
- plist_id = H5Dget_create_plist (dataset_id);
-
- numfilt = H5Pget_nfilters (plist_id);
- printf ("Number of filters associated with dataset: %i\n", numfilt);
-
- for (i=0; i<numfilt; i++) {
- nelmts = 0;
- filter_type = H5Pget_filter2 (plist_id, 0, &flags, &nelmts, NULL, 0, NULL,
- &filter_info);
- printf ("Filter Type: ");
- switch (filter_type) {
- case H5Z_FILTER_DEFLATE:
- printf ("H5Z_FILTER_DEFLATE\n");
- break;
- case H5Z_FILTER_SZIP:
- printf ("H5Z_FILTER_SZIP\n");
- break;
- default:
- printf ("Other filter type included.\n");
- }
- }
-
- status = H5Dread (dataset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL,
- H5P_DEFAULT, rbuf);
-
- status = H5Dclose (dataset_id);
- status = H5Pclose (plist_id);
- status = H5Fclose (file_id);
-}
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by The HDF Group. * + * Copyright by the Board of Trustees of the University of Illinois. * + * All rights reserved. * + * * + * This file is part of HDF5. The full HDF5 copyright notice, including * + * terms governing use, modification, and redistribution, is contained in * + * the files COPYING and Copyright.html. COPYING can be found at the root * + * of the source code distribution tree; Copyright.html can be found at the * + * root level of an installed copy of the electronic HDF5 document set and * + * is linked from the top-level documents page. It can also be found at * + * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * + * access to either file, you may request a copy from help@hdfgroup.org. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* + * This example illustrates how to create a compressed dataset. + * It is used in the HDF5 Tutorial. + */ + +#include "hdf5.h" + +#define FILE "cmprss.h5" +#define RANK 2 +#define DIM0 100 +#define DIM1 20 + +int main () { + + hid_t file_id, dataset_id, dataspace_id; /* identifiers */ + hid_t plist_id; + + size_t nelmts; + unsigned flags, filter_info; + H5Z_filter_t filter_type; + + herr_t status; + hsize_t dims[2]; + hsize_t cdims[2]; + + int idx; + int i,j, numfilt; + int buf[DIM0][DIM1]; + int rbuf [DIM0][DIM1]; + + /* Uncomment these variables to use SZIP compression + unsigned szip_options_mask; + unsigned szip_pixels_per_block; + */ + + /* Create a file. */ + file_id = H5Fcreate (FILE, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); + + + /* Create dataset "Compressed Data" in the group using absolute name. */ + dims[0] = DIM0; + dims[1] = DIM1; + dataspace_id = H5Screate_simple (RANK, dims, NULL); + + plist_id = H5Pcreate (H5P_DATASET_CREATE); + + /* Dataset must be chunked for compression */ + cdims[0] = 20; + cdims[1] = 20; + status = H5Pset_chunk (plist_id, 2, cdims); + + /* Set ZLIB / DEFLATE Compression using compression level 6. + * To use SZIP Compression comment out these lines. + */ + status = H5Pset_deflate (plist_id, 6); + + /* Uncomment these lines to set SZIP Compression + szip_options_mask = H5_SZIP_NN_OPTION_MASK; + szip_pixels_per_block = 16; + status = H5Pset_szip (plist_id, szip_options_mask, szip_pixels_per_block); + */ + + dataset_id = H5Dcreate2 (file_id, "Compressed_Data", H5T_STD_I32BE, + dataspace_id, H5P_DEFAULT, plist_id, H5P_DEFAULT); + + for (i = 0; i< DIM0; i++) + for (j=0; j<DIM1; j++) + buf[i][j] = i+j; + + status = H5Dwrite (dataset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf); + + status = H5Sclose (dataspace_id); + status = H5Dclose (dataset_id); + status = H5Pclose (plist_id); + status = H5Fclose (file_id); + + /* Now reopen the file and dataset in the file. */ + file_id = H5Fopen (FILE, H5F_ACC_RDWR, H5P_DEFAULT); + dataset_id = H5Dopen2 (file_id, "Compressed_Data", H5P_DEFAULT); + + /* Retrieve filter information. */ + plist_id = H5Dget_create_plist (dataset_id); + + numfilt = H5Pget_nfilters (plist_id); + printf ("Number of filters associated with dataset: %i\n", numfilt); + + for (i=0; i<numfilt; i++) { + nelmts = 0; + filter_type = H5Pget_filter2 (plist_id, 0, &flags, &nelmts, NULL, 0, NULL, + &filter_info); + printf ("Filter Type: "); + switch (filter_type) { + case H5Z_FILTER_DEFLATE: + printf ("H5Z_FILTER_DEFLATE\n"); + break; + case H5Z_FILTER_SZIP: + printf ("H5Z_FILTER_SZIP\n"); + break; + default: + printf ("Other filter type included.\n"); + } + } + + status = H5Dread (dataset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, + H5P_DEFAULT, rbuf); + + status = H5Dclose (dataset_id); + status = H5Pclose (plist_id); + status = H5Fclose (file_id); +} diff --git a/examples/h5_crtatt.c b/examples/h5_crtatt.c index 416839f..5e1378c 100644 --- a/examples/h5_crtatt.c +++ b/examples/h5_crtatt.c @@ -1,63 +1,63 @@ -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- * Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
- * All rights reserved. *
- * *
- * This file is part of HDF5. The full HDF5 copyright notice, including *
- * terms governing use, modification, and redistribution, is contained in *
- * the files COPYING and Copyright.html. COPYING can be found at the root *
- * of the source code distribution tree; Copyright.html can be found at the *
- * root level of an installed copy of the electronic HDF5 document set and *
- * is linked from the top-level documents page. It can also be found at *
- * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have *
- * access to either file, you may request a copy from help@hdfgroup.org. *
- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-
-/*
- * This example illustrates how to create an attribute attached to a
- * dataset. It is used in the HDF5 Tutorial.
- */
-
-#include "hdf5.h"
-#define FILE "dset.h5"
-
-int main() {
-
- hid_t file_id, dataset_id, attribute_id, dataspace_id; /* identifiers */
- hsize_t dims;
- int attr_data[2];
- herr_t status;
-
- /* Initialize the attribute data. */
- attr_data[0] = 100;
- attr_data[1] = 200;
-
- /* Open an existing file. */
- file_id = H5Fopen(FILE, H5F_ACC_RDWR, H5P_DEFAULT);
-
- /* Open an existing dataset. */
- dataset_id = H5Dopen2(file_id, "/dset", H5P_DEFAULT);
-
- /* Create the data space for the attribute. */
- dims = 2;
- dataspace_id = H5Screate_simple(1, &dims, NULL);
-
- /* Create a dataset attribute. */
- attribute_id = H5Acreate2 (dataset_id, "Units", H5T_STD_I32BE, dataspace_id,
- H5P_DEFAULT, H5P_DEFAULT);
-
- /* Write the attribute data. */
- status = H5Awrite(attribute_id, H5T_NATIVE_INT, attr_data);
-
- /* Close the attribute. */
- status = H5Aclose(attribute_id);
-
- /* Close the dataspace. */
- status = H5Sclose(dataspace_id);
-
- /* Close to the dataset. */
- status = H5Dclose(dataset_id);
-
- /* Close the file. */
- status = H5Fclose(file_id);
-}
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by The HDF Group. * + * Copyright by the Board of Trustees of the University of Illinois. * + * All rights reserved. * + * * + * This file is part of HDF5. The full HDF5 copyright notice, including * + * terms governing use, modification, and redistribution, is contained in * + * the files COPYING and Copyright.html. COPYING can be found at the root * + * of the source code distribution tree; Copyright.html can be found at the * + * root level of an installed copy of the electronic HDF5 document set and * + * is linked from the top-level documents page. It can also be found at * + * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * + * access to either file, you may request a copy from help@hdfgroup.org. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* + * This example illustrates how to create an attribute attached to a + * dataset. It is used in the HDF5 Tutorial. + */ + +#include "hdf5.h" +#define FILE "dset.h5" + +int main() { + + hid_t file_id, dataset_id, attribute_id, dataspace_id; /* identifiers */ + hsize_t dims; + int attr_data[2]; + herr_t status; + + /* Initialize the attribute data. */ + attr_data[0] = 100; + attr_data[1] = 200; + + /* Open an existing file. */ + file_id = H5Fopen(FILE, H5F_ACC_RDWR, H5P_DEFAULT); + + /* Open an existing dataset. */ + dataset_id = H5Dopen2(file_id, "/dset", H5P_DEFAULT); + + /* Create the data space for the attribute. */ + dims = 2; + dataspace_id = H5Screate_simple(1, &dims, NULL); + + /* Create a dataset attribute. */ + attribute_id = H5Acreate2 (dataset_id, "Units", H5T_STD_I32BE, dataspace_id, + H5P_DEFAULT, H5P_DEFAULT); + + /* Write the attribute data. */ + status = H5Awrite(attribute_id, H5T_NATIVE_INT, attr_data); + + /* Close the attribute. */ + status = H5Aclose(attribute_id); + + /* Close the dataspace. */ + status = H5Sclose(dataspace_id); + + /* Close to the dataset. */ + status = H5Dclose(dataset_id); + + /* Close the file. */ + status = H5Fclose(file_id); +} diff --git a/examples/h5_crtdat.c b/examples/h5_crtdat.c index bbb29b2..f9327e7 100644 --- a/examples/h5_crtdat.c +++ b/examples/h5_crtdat.c @@ -1,51 +1,51 @@ -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- * Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
- * All rights reserved. *
- * *
- * This file is part of HDF5. The full HDF5 copyright notice, including *
- * terms governing use, modification, and redistribution, is contained in *
- * the files COPYING and Copyright.html. COPYING can be found at the root *
- * of the source code distribution tree; Copyright.html can be found at the *
- * root level of an installed copy of the electronic HDF5 document set and *
- * is linked from the top-level documents page. It can also be found at *
- * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have *
- * access to either file, you may request a copy from help@hdfgroup.org. *
- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-
-/*
- * This example illustrates how to create a dataset that is a 4 x 6
- * array. It is used in the HDF5 Tutorial.
- */
-
-#include "hdf5.h"
-#define FILE "dset.h5"
-
-int main() {
-
- hid_t file_id, dataset_id, dataspace_id; /* identifiers */
- hsize_t dims[2];
- herr_t status;
-
- /* Create a new file using default properties. */
- file_id = H5Fcreate(FILE, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
-
- /* Create the data space for the dataset. */
- dims[0] = 4;
- dims[1] = 6;
- dataspace_id = H5Screate_simple(2, dims, NULL);
-
- /* Create the dataset. */
- dataset_id = H5Dcreate2(file_id, "/dset", H5T_STD_I32BE, dataspace_id,
- H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
-
- /* End access to the dataset and release resources used by it. */
- status = H5Dclose(dataset_id);
-
- /* Terminate access to the data space. */
- status = H5Sclose(dataspace_id);
-
- /* Close the file. */
- status = H5Fclose(file_id);
-}
-
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by The HDF Group. * + * Copyright by the Board of Trustees of the University of Illinois. * + * All rights reserved. * + * * + * This file is part of HDF5. The full HDF5 copyright notice, including * + * terms governing use, modification, and redistribution, is contained in * + * the files COPYING and Copyright.html. COPYING can be found at the root * + * of the source code distribution tree; Copyright.html can be found at the * + * root level of an installed copy of the electronic HDF5 document set and * + * is linked from the top-level documents page. It can also be found at * + * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * + * access to either file, you may request a copy from help@hdfgroup.org. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* + * This example illustrates how to create a dataset that is a 4 x 6 + * array. It is used in the HDF5 Tutorial. + */ + +#include "hdf5.h" +#define FILE "dset.h5" + +int main() { + + hid_t file_id, dataset_id, dataspace_id; /* identifiers */ + hsize_t dims[2]; + herr_t status; + + /* Create a new file using default properties. */ + file_id = H5Fcreate(FILE, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); + + /* Create the data space for the dataset. */ + dims[0] = 4; + dims[1] = 6; + dataspace_id = H5Screate_simple(2, dims, NULL); + + /* Create the dataset. */ + dataset_id = H5Dcreate2(file_id, "/dset", H5T_STD_I32BE, dataspace_id, + H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + + /* End access to the dataset and release resources used by it. */ + status = H5Dclose(dataset_id); + + /* Terminate access to the data space. */ + status = H5Sclose(dataspace_id); + + /* Close the file. */ + status = H5Fclose(file_id); +} + diff --git a/examples/h5_crtgrp.c b/examples/h5_crtgrp.c index 3a94a8f..a626ed8 100644 --- a/examples/h5_crtgrp.c +++ b/examples/h5_crtgrp.c @@ -1,40 +1,40 @@ -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- * Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
- * All rights reserved. *
- * *
- * This file is part of HDF5. The full HDF5 copyright notice, including *
- * terms governing use, modification, and redistribution, is contained in *
- * the files COPYING and Copyright.html. COPYING can be found at the root *
- * of the source code distribution tree; Copyright.html can be found at the *
- * root level of an installed copy of the electronic HDF5 document set and *
- * is linked from the top-level documents page. It can also be found at *
- * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have *
- * access to either file, you may request a copy from help@hdfgroup.org. *
- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-
-/*
- * This example illustrates how to create and close a group.
- * It is used in the HDF5 Tutorial.
- */
-
-#include "hdf5.h"
-#define FILE "group.h5"
-
-int main() {
-
- hid_t file_id, group_id; /* identifiers */
- herr_t status;
-
- /* Create a new file using default properties. */
- file_id = H5Fcreate(FILE, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
-
- /* Create a group named "/MyGroup" in the file. */
- group_id = H5Gcreate2(file_id, "/MyGroup", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
-
- /* Close the group. */
- status = H5Gclose(group_id);
-
- /* Terminate access to the file. */
- status = H5Fclose(file_id);
-}
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by The HDF Group. * + * Copyright by the Board of Trustees of the University of Illinois. * + * All rights reserved. * + * * + * This file is part of HDF5. The full HDF5 copyright notice, including * + * terms governing use, modification, and redistribution, is contained in * + * the files COPYING and Copyright.html. COPYING can be found at the root * + * of the source code distribution tree; Copyright.html can be found at the * + * root level of an installed copy of the electronic HDF5 document set and * + * is linked from the top-level documents page. It can also be found at * + * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * + * access to either file, you may request a copy from help@hdfgroup.org. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* + * This example illustrates how to create and close a group. + * It is used in the HDF5 Tutorial. + */ + +#include "hdf5.h" +#define FILE "group.h5" + +int main() { + + hid_t file_id, group_id; /* identifiers */ + herr_t status; + + /* Create a new file using default properties. */ + file_id = H5Fcreate(FILE, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); + + /* Create a group named "/MyGroup" in the file. */ + group_id = H5Gcreate2(file_id, "/MyGroup", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + + /* Close the group. */ + status = H5Gclose(group_id); + + /* Terminate access to the file. */ + status = H5Fclose(file_id); +} diff --git a/examples/h5_crtgrpar.c b/examples/h5_crtgrpar.c index 9e6fc40..e8cf7c3 100644 --- a/examples/h5_crtgrpar.c +++ b/examples/h5_crtgrpar.c @@ -1,48 +1,48 @@ -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- * Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
- * All rights reserved. *
- * *
- * This file is part of HDF5. The full HDF5 copyright notice, including *
- * terms governing use, modification, and redistribution, is contained in *
- * the files COPYING and Copyright.html. COPYING can be found at the root *
- * of the source code distribution tree; Copyright.html can be found at the *
- * root level of an installed copy of the electronic HDF5 document set and *
- * is linked from the top-level documents page. It can also be found at *
- * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have *
- * access to either file, you may request a copy from help@hdfgroup.org. *
- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-
-/*
- * This example illustrates the creation of groups using absolute and
- * relative names. It is used in the HDF5 Tutorial.
- */
-
-#include "hdf5.h"
-#define FILE "groups.h5"
-
-int main() {
-
- hid_t file_id, group1_id, group2_id, group3_id; /* identifiers */
- herr_t status;
-
- /* Create a new file using default properties. */
- file_id = H5Fcreate(FILE, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
-
- /* Create group "MyGroup" in the root group using absolute name. */
- group1_id = H5Gcreate2(file_id, "/MyGroup", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
-
- /* Create group "Group_A" in group "MyGroup" using absolute name. */
- group2_id = H5Gcreate2(file_id, "/MyGroup/Group_A", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
-
- /* Create group "Group_B" in group "MyGroup" using relative name. */
- group3_id = H5Gcreate2(group1_id, "Group_B", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
-
- /* Close groups. */
- status = H5Gclose(group1_id);
- status = H5Gclose(group2_id);
- status = H5Gclose(group3_id);
-
- /* Close the file. */
- status = H5Fclose(file_id);
-}
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by The HDF Group. * + * Copyright by the Board of Trustees of the University of Illinois. * + * All rights reserved. * + * * + * This file is part of HDF5. The full HDF5 copyright notice, including * + * terms governing use, modification, and redistribution, is contained in * + * the files COPYING and Copyright.html. COPYING can be found at the root * + * of the source code distribution tree; Copyright.html can be found at the * + * root level of an installed copy of the electronic HDF5 document set and * + * is linked from the top-level documents page. It can also be found at * + * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * + * access to either file, you may request a copy from help@hdfgroup.org. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* + * This example illustrates the creation of groups using absolute and + * relative names. It is used in the HDF5 Tutorial. + */ + +#include "hdf5.h" +#define FILE "groups.h5" + +int main() { + + hid_t file_id, group1_id, group2_id, group3_id; /* identifiers */ + herr_t status; + + /* Create a new file using default properties. */ + file_id = H5Fcreate(FILE, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); + + /* Create group "MyGroup" in the root group using absolute name. */ + group1_id = H5Gcreate2(file_id, "/MyGroup", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + + /* Create group "Group_A" in group "MyGroup" using absolute name. */ + group2_id = H5Gcreate2(file_id, "/MyGroup/Group_A", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + + /* Create group "Group_B" in group "MyGroup" using relative name. */ + group3_id = H5Gcreate2(group1_id, "Group_B", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + + /* Close groups. */ + status = H5Gclose(group1_id); + status = H5Gclose(group2_id); + status = H5Gclose(group3_id); + + /* Close the file. */ + status = H5Fclose(file_id); +} diff --git a/examples/h5_crtgrpd.c b/examples/h5_crtgrpd.c index 9c45928..d6a320b 100644 --- a/examples/h5_crtgrpd.c +++ b/examples/h5_crtgrpd.c @@ -1,91 +1,91 @@ -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- * Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
- * All rights reserved. *
- * *
- * This file is part of HDF5. The full HDF5 copyright notice, including *
- * terms governing use, modification, and redistribution, is contained in *
- * the files COPYING and Copyright.html. COPYING can be found at the root *
- * of the source code distribution tree; Copyright.html can be found at the *
- * root level of an installed copy of the electronic HDF5 document set and *
- * is linked from the top-level documents page. It can also be found at *
- * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have *
- * access to either file, you may request a copy from help@hdfgroup.org. *
- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-
-/*
- * This example illustrates how to create a dataset in a group.
- * It is used in the HDF5 Tutorial.
- */
-
-#include "hdf5.h"
-#define FILE "groups.h5"
-
-int main() {
-
- hid_t file_id, group_id, dataset_id, dataspace_id; /* identifiers */
- hsize_t dims[2];
- herr_t status;
- int i, j, dset1_data[3][3], dset2_data[2][10];
-
- /* Initialize the first dataset. */
- for (i = 0; i < 3; i++)
- for (j = 0; j < 3; j++)
- dset1_data[i][j] = j + 1;
-
- /* Initialize the second dataset. */
- for (i = 0; i < 2; i++)
- for (j = 0; j < 10; j++)
- dset2_data[i][j] = j + 1;
-
- /* Open an existing file. */
- file_id = H5Fopen(FILE, H5F_ACC_RDWR, H5P_DEFAULT);
-
- /* Create the data space for the first dataset. */
- dims[0] = 3;
- dims[1] = 3;
- dataspace_id = H5Screate_simple(2, dims, NULL);
-
- /* Create a dataset in group "MyGroup". */
- dataset_id = H5Dcreate2(file_id, "/MyGroup/dset1", H5T_STD_I32BE, dataspace_id,
- H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
-
- /* Write the first dataset. */
- status = H5Dwrite(dataset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT,
- dset1_data);
-
- /* Close the data space for the first dataset. */
- status = H5Sclose(dataspace_id);
-
- /* Close the first dataset. */
- status = H5Dclose(dataset_id);
-
- /* Open an existing group of the specified file. */
- group_id = H5Gopen2(file_id, "/MyGroup/Group_A", H5P_DEFAULT);
-
- /* Create the data space for the second dataset. */
- dims[0] = 2;
- dims[1] = 10;
- dataspace_id = H5Screate_simple(2, dims, NULL);
-
- /* Create the second dataset in group "Group_A". */
- dataset_id = H5Dcreate2(group_id, "dset2", H5T_STD_I32BE, dataspace_id,
- H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
-
- /* Write the second dataset. */
- status = H5Dwrite(dataset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT,
- dset2_data);
-
- /* Close the data space for the second dataset. */
- status = H5Sclose(dataspace_id);
-
- /* Close the second dataset */
- status = H5Dclose(dataset_id);
-
- /* Close the group. */
- status = H5Gclose(group_id);
-
- /* Close the file. */
- status = H5Fclose(file_id);
-}
-
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by The HDF Group. * + * Copyright by the Board of Trustees of the University of Illinois. * + * All rights reserved. * + * * + * This file is part of HDF5. The full HDF5 copyright notice, including * + * terms governing use, modification, and redistribution, is contained in * + * the files COPYING and Copyright.html. COPYING can be found at the root * + * of the source code distribution tree; Copyright.html can be found at the * + * root level of an installed copy of the electronic HDF5 document set and * + * is linked from the top-level documents page. It can also be found at * + * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * + * access to either file, you may request a copy from help@hdfgroup.org. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* + * This example illustrates how to create a dataset in a group. + * It is used in the HDF5 Tutorial. + */ + +#include "hdf5.h" +#define FILE "groups.h5" + +int main() { + + hid_t file_id, group_id, dataset_id, dataspace_id; /* identifiers */ + hsize_t dims[2]; + herr_t status; + int i, j, dset1_data[3][3], dset2_data[2][10]; + + /* Initialize the first dataset. */ + for (i = 0; i < 3; i++) + for (j = 0; j < 3; j++) + dset1_data[i][j] = j + 1; + + /* Initialize the second dataset. */ + for (i = 0; i < 2; i++) + for (j = 0; j < 10; j++) + dset2_data[i][j] = j + 1; + + /* Open an existing file. */ + file_id = H5Fopen(FILE, H5F_ACC_RDWR, H5P_DEFAULT); + + /* Create the data space for the first dataset. */ + dims[0] = 3; + dims[1] = 3; + dataspace_id = H5Screate_simple(2, dims, NULL); + + /* Create a dataset in group "MyGroup". */ + dataset_id = H5Dcreate2(file_id, "/MyGroup/dset1", H5T_STD_I32BE, dataspace_id, + H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + + /* Write the first dataset. */ + status = H5Dwrite(dataset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, + dset1_data); + + /* Close the data space for the first dataset. */ + status = H5Sclose(dataspace_id); + + /* Close the first dataset. */ + status = H5Dclose(dataset_id); + + /* Open an existing group of the specified file. */ + group_id = H5Gopen2(file_id, "/MyGroup/Group_A", H5P_DEFAULT); + + /* Create the data space for the second dataset. */ + dims[0] = 2; + dims[1] = 10; + dataspace_id = H5Screate_simple(2, dims, NULL); + + /* Create the second dataset in group "Group_A". */ + dataset_id = H5Dcreate2(group_id, "dset2", H5T_STD_I32BE, dataspace_id, + H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + + /* Write the second dataset. */ + status = H5Dwrite(dataset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, + dset2_data); + + /* Close the data space for the second dataset. */ + status = H5Sclose(dataspace_id); + + /* Close the second dataset */ + status = H5Dclose(dataset_id); + + /* Close the group. */ + status = H5Gclose(group_id); + + /* Close the file. */ + status = H5Fclose(file_id); +} + diff --git a/examples/h5_rdwt.c b/examples/h5_rdwt.c index d5444e0..0e290ca 100644 --- a/examples/h5_rdwt.c +++ b/examples/h5_rdwt.c @@ -1,53 +1,53 @@ -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- * Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
- * All rights reserved. *
- * *
- * This file is part of HDF5. The full HDF5 copyright notice, including *
- * terms governing use, modification, and redistribution, is contained in *
- * the files COPYING and Copyright.html. COPYING can be found at the root *
- * of the source code distribution tree; Copyright.html can be found at the *
- * root level of an installed copy of the electronic HDF5 document set and *
- * is linked from the top-level documents page. It can also be found at *
- * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have *
- * access to either file, you may request a copy from help@hdfgroup.org. *
- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-
-/*
- * This example illustrates how to write and read data in an existing
- * dataset. It is used in the HDF5 Tutorial.
- */
-
-#include "hdf5.h"
-#define FILE "dset.h5"
-
-int main() {
-
- hid_t file_id, dataset_id; /* identifiers */
- herr_t status;
- int i, j, dset_data[4][6];
-
- /* Initialize the dataset. */
- for (i = 0; i < 4; i++)
- for (j = 0; j < 6; j++)
- dset_data[i][j] = i * 6 + j + 1;
-
- /* Open an existing file. */
- file_id = H5Fopen(FILE, H5F_ACC_RDWR, H5P_DEFAULT);
-
- /* Open an existing dataset. */
- dataset_id = H5Dopen2(file_id, "/dset", H5P_DEFAULT);
-
- /* Write the dataset. */
- status = H5Dwrite(dataset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT,
- dset_data);
-
- status = H5Dread(dataset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT,
- dset_data);
-
- /* Close the dataset. */
- status = H5Dclose(dataset_id);
-
- /* Close the file. */
- status = H5Fclose(file_id);
-}
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by The HDF Group. * + * Copyright by the Board of Trustees of the University of Illinois. * + * All rights reserved. * + * * + * This file is part of HDF5. The full HDF5 copyright notice, including * + * terms governing use, modification, and redistribution, is contained in * + * the files COPYING and Copyright.html. COPYING can be found at the root * + * of the source code distribution tree; Copyright.html can be found at the * + * root level of an installed copy of the electronic HDF5 document set and * + * is linked from the top-level documents page. It can also be found at * + * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * + * access to either file, you may request a copy from help@hdfgroup.org. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* + * This example illustrates how to write and read data in an existing + * dataset. It is used in the HDF5 Tutorial. + */ + +#include "hdf5.h" +#define FILE "dset.h5" + +int main() { + + hid_t file_id, dataset_id; /* identifiers */ + herr_t status; + int i, j, dset_data[4][6]; + + /* Initialize the dataset. */ + for (i = 0; i < 4; i++) + for (j = 0; j < 6; j++) + dset_data[i][j] = i * 6 + j + 1; + + /* Open an existing file. */ + file_id = H5Fopen(FILE, H5F_ACC_RDWR, H5P_DEFAULT); + + /* Open an existing dataset. */ + dataset_id = H5Dopen2(file_id, "/dset", H5P_DEFAULT); + + /* Write the dataset. */ + status = H5Dwrite(dataset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, + dset_data); + + status = H5Dread(dataset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, + dset_data); + + /* Close the dataset. */ + status = H5Dclose(dataset_id); + + /* Close the file. */ + status = H5Fclose(file_id); +} diff --git a/fortran/examples/h5_cmprss.f90 b/fortran/examples/h5_cmprss.f90 index 847a922..9ab28f7 100644 --- a/fortran/examples/h5_cmprss.f90 +++ b/fortran/examples/h5_cmprss.f90 @@ -1,131 +1,131 @@ -! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-! Copyright by The HDF Group. *
-! Copyright by the Board of Trustees of the University of Illinois. *
-! All rights reserved. *
-! *
-! This file is part of HDF5. The full HDF5 copyright notice, including *
-! terms governing use, modification, and redistribution, is contained in *
-! the files COPYING and Copyright.html. COPYING can be found at the root *
-! of the source code distribution tree; Copyright.html can be found at the *
-! root level of an installed copy of the electronic HDF5 document set and *
-! is linked from the top-level documents page. It can also be found at *
-! http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have *
-! access to either file, you may request a copy from help@hdfgroup.org. *
-! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-!
-! This example illustrates how to create a compressed dataset.
-! It is used in the HDF5 Tutorial.
-!
-PROGRAM h5_cmprss
-
- USE HDF5 ! This module contains all necessary modules
-
- IMPLICIT NONE
- !
- ! The dataset is stored in file "h5_cmprss.h5"
- !
- CHARACTER(LEN=12), PARAMETER :: filename = "h5_cmprss.h5"
- INTEGER, PARAMETER :: rank = 2 ! Rank of the data set
- INTEGER, PARAMETER :: dim0 = 100 ! Data set sizes
- INTEGER, PARAMETER :: dim1 = 20
-
- INTEGER(hid_t) :: file_id, dataset_id, dataspace_id ! Identifiers
- INTEGER(hid_t) :: plist_id ! Property list identifier
-
- INTEGER :: error
- INTEGER(hsize_t), DIMENSION(1:rank) :: dims ! dimensions of data
- INTEGER(hsize_t), DIMENSION(1:rank) :: cdims ! sizes of chunked data
-
- INTEGER :: i,j, numfilt
- INTEGER, DIMENSION(1:dim0,1:dim1) :: buf ! write buffer
- INTEGER, DIMENSION(1:dim0,1:dim1) :: rbuf ! read buffer
- INTEGER(HSIZE_T), DIMENSION(1:rank) :: data_dims ! dimensions of data buffers
-
- INTEGER, DIMENSION(1:1) :: cd_values ! Auxiliary data for the filter
- INTEGER(size_t) :: nelmts ! Number of elements in cd_values
- INTEGER :: flags ! Bit vector specifying certain general properties of the filter
- INTEGER(SIZE_T) :: namelen = 180 ! Anticipated number of characters in name
- CHARACTER(LEN=180) :: name ! Name of the filter
- INTEGER :: filter_id ! Filter identification number
-
- ! Uncomment these variables to use SZIP compression
- !INTEGER :: szip_options_mask
- !INTEGER :: szip_pixels_per_block
-
- !
- !Initialize FORTRAN predifined datatypes
- !
- CALL h5open_f(error)
- !
- ! Create a file
- CALL h5fcreate_f(filename, H5F_ACC_TRUNC_F, file_id, error)
- !
- ! Create dataset "Compressed Data" in the group using absolute name.
- dims(1:2) = (/dim0, dim1/)
- CALL h5screate_simple_f(rank, dims, dataspace_id, error)
- CALL h5pcreate_f(H5P_DATASET_CREATE_F, plist_id, error)
- !
- ! Dataset must be chunked for compression
- cdims(1:2) = 20
- CALL h5pset_chunk_f(plist_id, 2, cdims, error)
-
- ! Set ZLIB / DEFLATE Compression using compression level 6.
- ! To use SZIP Compression comment out these lines.
- CALL h5pset_deflate_f(plist_id, 6, error)
-
- ! Uncomment these lines to set SZIP Compression
- !szip_options_mask = H5_SZIP_NN_OM_F
- !szip_pixels_per_block = 16
- !CALL H5Pset_szip_f(plist_id, szip_options_mask, szip_pixels_per_block, error)
-
- ! Create data set
- CALL h5dcreate_f(file_id, "Compressed_Data", H5T_NATIVE_INTEGER, dataspace_id, &
- dataset_id, error, dcpl_id=plist_id)
-
- DO j = 1, dim1
- DO i = 1, dim0
- buf(i,j) = i+j
- ENDDO
- ENDDO
-
- data_dims(1:2) = (/dim0,dim1/)
- CALL h5dwrite_f(dataset_id, H5T_NATIVE_INTEGER, buf, data_dims, error)
-
- ! Close resources
- CALL h5sclose_f(dataspace_id, error)
- CALL h5pclose_f(plist_id, error)
- CALL h5dclose_f(dataset_id, error)
- CALL h5fclose_f(file_id, error)
-
- ! Now reopen the file and dataset in the file.
- CALL h5fopen_f(filename, H5F_ACC_RDONLY_F, file_id, error)
- CALL h5dopen_f(file_id, "Compressed_Data", dataset_id, error)
-
- ! Retrieve filter information.
- CALL h5dget_create_plist_f(dataset_id, plist_id, error)
-
- CALL h5pget_nfilters_f(plist_id, numfilt, error)
- WRITE(*,'(A, I0)') "Number of filters associated with dataset: ", numfilt
-
- DO i = 1, numfilt
- nelmts = 1
- CALL h5pget_filter_f(plist_id, 0, flags, nelmts, cd_values, &
- namelen, name, filter_id, error)
-
- WRITE(*,'(30X,A)', ADVANCE='NO')"Filter Type: "
- IF(filter_id.EQ.H5Z_FILTER_DEFLATE_F)THEN
- WRITE(*,'(A)') "H5Z_FILTER_DEFLATE"
- ELSEIF (filter_id.EQ.H5Z_FILTER_SZIP_F)THEN
- WRITE(*,'(A)') "H5Z_FILTER_SZIP"
- ELSE
- WRITE(*,'(A)') "Other filter type included"
- ENDIF
- ENDDO
- data_dims(1:2) = (/dim0,dim1/)
- CALL h5dread_f(dataset_id, H5T_NATIVE_INTEGER, rbuf, data_dims, error)
-
- CALL h5dclose_f(dataset_id, error)
- CALL h5pclose_f(plist_id, error)
- CALL h5fclose_f(file_id, error)
-
-END PROGRAM h5_cmprss
+! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +! Copyright by The HDF Group. * +! Copyright by the Board of Trustees of the University of Illinois. * +! All rights reserved. * +! * +! This file is part of HDF5. The full HDF5 copyright notice, including * +! terms governing use, modification, and redistribution, is contained in * +! the files COPYING and Copyright.html. COPYING can be found at the root * +! of the source code distribution tree; Copyright.html can be found at the * +! root level of an installed copy of the electronic HDF5 document set and * +! is linked from the top-level documents page. It can also be found at * +! http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * +! access to either file, you may request a copy from help@hdfgroup.org. * +! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +! +! This example illustrates how to create a compressed dataset. +! It is used in the HDF5 Tutorial. +! +PROGRAM h5_cmprss + + USE HDF5 ! This module contains all necessary modules + + IMPLICIT NONE + ! + ! The dataset is stored in file "h5_cmprss.h5" + ! + CHARACTER(LEN=12), PARAMETER :: filename = "h5_cmprss.h5" + INTEGER, PARAMETER :: rank = 2 ! Rank of the data set + INTEGER, PARAMETER :: dim0 = 100 ! Data set sizes + INTEGER, PARAMETER :: dim1 = 20 + + INTEGER(hid_t) :: file_id, dataset_id, dataspace_id ! Identifiers + INTEGER(hid_t) :: plist_id ! Property list identifier + + INTEGER :: error + INTEGER(hsize_t), DIMENSION(1:rank) :: dims ! dimensions of data + INTEGER(hsize_t), DIMENSION(1:rank) :: cdims ! sizes of chunked data + + INTEGER :: i,j, numfilt + INTEGER, DIMENSION(1:dim0,1:dim1) :: buf ! write buffer + INTEGER, DIMENSION(1:dim0,1:dim1) :: rbuf ! read buffer + INTEGER(HSIZE_T), DIMENSION(1:rank) :: data_dims ! dimensions of data buffers + + INTEGER, DIMENSION(1:1) :: cd_values ! Auxiliary data for the filter + INTEGER(size_t) :: nelmts ! Number of elements in cd_values + INTEGER :: flags ! Bit vector specifying certain general properties of the filter + INTEGER(SIZE_T) :: namelen = 180 ! Anticipated number of characters in name + CHARACTER(LEN=180) :: name ! Name of the filter + INTEGER :: filter_id ! Filter identification number + + ! Uncomment these variables to use SZIP compression + !INTEGER :: szip_options_mask + !INTEGER :: szip_pixels_per_block + + ! + !Initialize FORTRAN predifined datatypes + ! + CALL h5open_f(error) + ! + ! Create a file + CALL h5fcreate_f(filename, H5F_ACC_TRUNC_F, file_id, error) + ! + ! Create dataset "Compressed Data" in the group using absolute name. + dims(1:2) = (/dim0, dim1/) + CALL h5screate_simple_f(rank, dims, dataspace_id, error) + CALL h5pcreate_f(H5P_DATASET_CREATE_F, plist_id, error) + ! + ! Dataset must be chunked for compression + cdims(1:2) = 20 + CALL h5pset_chunk_f(plist_id, 2, cdims, error) + + ! Set ZLIB / DEFLATE Compression using compression level 6. + ! To use SZIP Compression comment out these lines. + CALL h5pset_deflate_f(plist_id, 6, error) + + ! Uncomment these lines to set SZIP Compression + !szip_options_mask = H5_SZIP_NN_OM_F + !szip_pixels_per_block = 16 + !CALL H5Pset_szip_f(plist_id, szip_options_mask, szip_pixels_per_block, error) + + ! Create data set + CALL h5dcreate_f(file_id, "Compressed_Data", H5T_NATIVE_INTEGER, dataspace_id, & + dataset_id, error, dcpl_id=plist_id) + + DO j = 1, dim1 + DO i = 1, dim0 + buf(i,j) = i+j + ENDDO + ENDDO + + data_dims(1:2) = (/dim0,dim1/) + CALL h5dwrite_f(dataset_id, H5T_NATIVE_INTEGER, buf, data_dims, error) + + ! Close resources + CALL h5sclose_f(dataspace_id, error) + CALL h5pclose_f(plist_id, error) + CALL h5dclose_f(dataset_id, error) + CALL h5fclose_f(file_id, error) + + ! Now reopen the file and dataset in the file. + CALL h5fopen_f(filename, H5F_ACC_RDONLY_F, file_id, error) + CALL h5dopen_f(file_id, "Compressed_Data", dataset_id, error) + + ! Retrieve filter information. + CALL h5dget_create_plist_f(dataset_id, plist_id, error) + + CALL h5pget_nfilters_f(plist_id, numfilt, error) + WRITE(*,'(A, I0)') "Number of filters associated with dataset: ", numfilt + + DO i = 1, numfilt + nelmts = 1 + CALL h5pget_filter_f(plist_id, 0, flags, nelmts, cd_values, & + namelen, name, filter_id, error) + + WRITE(*,'(30X,A)', ADVANCE='NO')"Filter Type: " + IF(filter_id.EQ.H5Z_FILTER_DEFLATE_F)THEN + WRITE(*,'(A)') "H5Z_FILTER_DEFLATE" + ELSEIF (filter_id.EQ.H5Z_FILTER_SZIP_F)THEN + WRITE(*,'(A)') "H5Z_FILTER_SZIP" + ELSE + WRITE(*,'(A)') "Other filter type included" + ENDIF + ENDDO + data_dims(1:2) = (/dim0,dim1/) + CALL h5dread_f(dataset_id, H5T_NATIVE_INTEGER, rbuf, data_dims, error) + + CALL h5dclose_f(dataset_id, error) + CALL h5pclose_f(plist_id, error) + CALL h5fclose_f(file_id, error) + +END PROGRAM h5_cmprss diff --git a/fortran/src/hdf5_fortrandll.def.in b/fortran/src/hdf5_fortrandll.def.in index 62030f0..b5662c0 100644 --- a/fortran/src/hdf5_fortrandll.def.in +++ b/fortran/src/hdf5_fortrandll.def.in @@ -1,572 +1,572 @@ -EXPORTS
-; H5LIB
-H5LIB_mp_H5OPEN_F
-H5LIB_mp_H5CLOSE_F
-H5LIB_mp_H5GET_LIBVERSION_F
-H5LIB_mp_H5CHECK_VERSION_F
-H5LIB_mp_H5GARBAGE_COLLECT_F
-H5LIB_mp_H5DONT_ATEXIT_F
-H5LIB_mp_H5KIND_TO_TYPE
-@H5_NOF03EXP@H5LIB_PROVISIONAL_mp_H5OFFSETOF
-; H5_DBLE_INTERFACE
-H5_DBLE_INTERFACE_mp_H5AREAD_DOUBLE_SCALAR
-H5_DBLE_INTERFACE_mp_H5AREAD_DOUBLE_1
-H5_DBLE_INTERFACE_mp_H5AREAD_DOUBLE_2
-H5_DBLE_INTERFACE_mp_H5AREAD_DOUBLE_3
-H5_DBLE_INTERFACE_mp_H5AREAD_DOUBLE_4
-H5_DBLE_INTERFACE_mp_H5AREAD_DOUBLE_5
-H5_DBLE_INTERFACE_mp_H5AREAD_DOUBLE_6
-H5_DBLE_INTERFACE_mp_H5AREAD_DOUBLE_7
-H5_DBLE_INTERFACE_mp_H5AWRITE_DOUBLE_SCALAR
-H5_DBLE_INTERFACE_mp_H5AWRITE_DOUBLE_1
-H5_DBLE_INTERFACE_mp_H5AWRITE_DOUBLE_2
-H5_DBLE_INTERFACE_mp_H5AWRITE_DOUBLE_3
-H5_DBLE_INTERFACE_mp_H5AWRITE_DOUBLE_4
-H5_DBLE_INTERFACE_mp_H5AWRITE_DOUBLE_5
-H5_DBLE_INTERFACE_mp_H5AWRITE_DOUBLE_6
-H5_DBLE_INTERFACE_mp_H5AWRITE_DOUBLE_7
-H5_DBLE_INTERFACE_mp_H5DFILL_DOUBLE
-H5_DBLE_INTERFACE_mp_H5DREAD_DOUBLE_SCALAR
-H5_DBLE_INTERFACE_mp_H5DREAD_DOUBLE_1
-H5_DBLE_INTERFACE_mp_H5DREAD_DOUBLE_2
-H5_DBLE_INTERFACE_mp_H5DREAD_DOUBLE_3
-H5_DBLE_INTERFACE_mp_H5DREAD_DOUBLE_4
-H5_DBLE_INTERFACE_mp_H5DREAD_DOUBLE_5
-H5_DBLE_INTERFACE_mp_H5DREAD_DOUBLE_6
-H5_DBLE_INTERFACE_mp_H5DREAD_DOUBLE_7
-H5_DBLE_INTERFACE_mp_H5DWRITE_DOUBLE_SCALAR
-H5_DBLE_INTERFACE_mp_H5DWRITE_DOUBLE_1
-H5_DBLE_INTERFACE_mp_H5DWRITE_DOUBLE_2
-H5_DBLE_INTERFACE_mp_H5DWRITE_DOUBLE_3
-H5_DBLE_INTERFACE_mp_H5DWRITE_DOUBLE_4
-H5_DBLE_INTERFACE_mp_H5DWRITE_DOUBLE_5
-H5_DBLE_INTERFACE_mp_H5DWRITE_DOUBLE_6
-H5_DBLE_INTERFACE_mp_H5DWRITE_DOUBLE_7
-H5_DBLE_INTERFACE_mp_H5PGET_DOUBLE
-H5_DBLE_INTERFACE_mp_H5PSET_DOUBLE
-H5_DBLE_INTERFACE_mp_H5PSET_FILL_VALUE_DOUBLE
-H5_DBLE_INTERFACE_mp_H5PGET_FILL_VALUE_DOUBLE
-H5_DBLE_INTERFACE_mp_H5PINSERT_DOUBLE
-H5_DBLE_INTERFACE_mp_H5PREGISTER_DOUBLE
-; H5A
-H5A_mp_H5ACREATE_F
-H5A_mp_H5AOPEN_NAME_F
-H5A_mp_H5AOPEN_IDX_F
-H5A_PROVISIONAL_mp_H5AWRITE_INTEGER_SCALAR
-H5A_PROVISIONAL_mp_H5AWRITE_INTEGER_1
-H5A_PROVISIONAL_mp_H5AWRITE_INTEGER_2
-H5A_PROVISIONAL_mp_H5AWRITE_INTEGER_3
-H5A_PROVISIONAL_mp_H5AWRITE_INTEGER_4
-H5A_PROVISIONAL_mp_H5AWRITE_INTEGER_5
-H5A_PROVISIONAL_mp_H5AWRITE_INTEGER_6
-H5A_PROVISIONAL_mp_H5AWRITE_INTEGER_7
-H5A_PROVISIONAL_mp_H5AWRITE_REAL_SCALAR
-H5A_PROVISIONAL_mp_H5AWRITE_REAL_1
-H5A_PROVISIONAL_mp_H5AWRITE_REAL_2
-H5A_PROVISIONAL_mp_H5AWRITE_REAL_3
-H5A_PROVISIONAL_mp_H5AWRITE_REAL_4
-H5A_PROVISIONAL_mp_H5AWRITE_REAL_5
-H5A_PROVISIONAL_mp_H5AWRITE_REAL_6
-H5A_PROVISIONAL_mp_H5AWRITE_REAL_7
-H5A_PROVISIONAL_mp_H5AWRITE_CHAR_SCALAR
-H5A_PROVISIONAL_mp_H5AWRITE_CHAR_1
-H5A_PROVISIONAL_mp_H5AWRITE_CHAR_2
-H5A_PROVISIONAL_mp_H5AWRITE_CHAR_3
-H5A_PROVISIONAL_mp_H5AWRITE_CHAR_4
-H5A_PROVISIONAL_mp_H5AWRITE_CHAR_5
-H5A_PROVISIONAL_mp_H5AWRITE_CHAR_6
-H5A_PROVISIONAL_mp_H5AWRITE_CHAR_7
-H5A_PROVISIONAL_mp_H5AREAD_INTEGER_SCALAR
-H5A_PROVISIONAL_mp_H5AREAD_INTEGER_1
-H5A_PROVISIONAL_mp_H5AREAD_INTEGER_2
-H5A_PROVISIONAL_mp_H5AREAD_INTEGER_3
-H5A_PROVISIONAL_mp_H5AREAD_INTEGER_4
-H5A_PROVISIONAL_mp_H5AREAD_INTEGER_5
-H5A_PROVISIONAL_mp_H5AREAD_INTEGER_6
-H5A_PROVISIONAL_mp_H5AREAD_INTEGER_7
-H5A_PROVISIONAL_mp_H5AREAD_REAL_SCALAR
-H5A_PROVISIONAL_mp_H5AREAD_REAL_1
-H5A_PROVISIONAL_mp_H5AREAD_REAL_2
-H5A_PROVISIONAL_mp_H5AREAD_REAL_3
-H5A_PROVISIONAL_mp_H5AREAD_REAL_4
-H5A_PROVISIONAL_mp_H5AREAD_REAL_5
-H5A_PROVISIONAL_mp_H5AREAD_REAL_6
-H5A_PROVISIONAL_mp_H5AREAD_REAL_7
-H5A_PROVISIONAL_mp_H5AREAD_CHAR_SCALAR
-H5A_PROVISIONAL_mp_H5AREAD_CHAR_1
-H5A_PROVISIONAL_mp_H5AREAD_CHAR_2
-H5A_PROVISIONAL_mp_H5AREAD_CHAR_3
-H5A_PROVISIONAL_mp_H5AREAD_CHAR_4
-H5A_PROVISIONAL_mp_H5AREAD_CHAR_5
-H5A_PROVISIONAL_mp_H5AREAD_CHAR_6
-H5A_PROVISIONAL_mp_H5AREAD_CHAR_7
-H5A_mp_H5AGET_SPACE_F
-H5A_mp_H5AGET_TYPE_F
-H5A_mp_H5AGET_NAME_F
-H5A_mp_H5AGET_NAME_BY_IDX_F
-H5A_mp_H5AGET_NUM_ATTRS_F
-H5A_mp_H5ADELETE_F
-H5A_mp_H5ACLOSE_F
-H5A_mp_H5AGET_STORAGE_SIZE_F
-H5A_mp_H5AGET_CREATE_PLIST_F
-H5A_mp_H5ARENAME_BY_NAME_F
-H5A_mp_H5AOPEN_F
-H5A_mp_H5ADELETE_BY_IDX_F
-H5A_mp_H5ADELETE_BY_NAME_F
-H5A_mp_H5AOPEN_BY_IDX_F
-H5A_mp_H5AGET_INFO_F
-H5A_mp_H5AGET_INFO_BY_IDX_F
-H5A_mp_H5AGET_INFO_BY_NAME_F
-H5A_mp_H5ACREATE_BY_NAME_F
-H5A_mp_H5AEXISTS_F
-H5A_mp_H5AEXISTS_BY_NAME_F
-H5A_mp_H5AOPEN_BY_NAME_F
-H5A_mp_H5ARENAME_F
-@H5_NOF03EXP@H5A_PROVISIONAL_mp_H5AWRITE_PTR
-@H5_NOF03EXP@H5A_PROVISIONAL_mp_H5AREAD_PTR
-; H5D
-H5D_mp_H5DCREATE_F
-H5D_mp_H5DOPEN_F
-H5D_mp_H5DCLOSE_F
-H5D_PROVISIONAL_mp_H5DWRITE_REFERENCE_OBJ
-H5D_PROVISIONAL_mp_H5DWRITE_REFERENCE_DSETREG
-H5D_PROVISIONAL_mp_H5DWRITE_INTEGER_SCALAR
-H5D_PROVISIONAL_mp_H5DWRITE_INTEGER_1
-H5D_PROVISIONAL_mp_H5DWRITE_INTEGER_2
-H5D_PROVISIONAL_mp_H5DWRITE_INTEGER_3
-H5D_PROVISIONAL_mp_H5DWRITE_INTEGER_4
-H5D_PROVISIONAL_mp_H5DWRITE_INTEGER_5
-H5D_PROVISIONAL_mp_H5DWRITE_INTEGER_6
-H5D_PROVISIONAL_mp_H5DWRITE_INTEGER_7
-H5D_PROVISIONAL_mp_H5DWRITE_CHAR_SCALAR
-H5D_PROVISIONAL_mp_H5DWRITE_CHAR_1
-H5D_PROVISIONAL_mp_H5DWRITE_CHAR_2
-H5D_PROVISIONAL_mp_H5DWRITE_CHAR_3
-H5D_PROVISIONAL_mp_H5DWRITE_CHAR_4
-H5D_PROVISIONAL_mp_H5DWRITE_CHAR_5
-H5D_PROVISIONAL_mp_H5DWRITE_CHAR_6
-H5D_PROVISIONAL_mp_H5DWRITE_CHAR_7
-H5D_PROVISIONAL_mp_H5DWRITE_REAL_SCALAR
-H5D_PROVISIONAL_mp_H5DWRITE_REAL_1
-H5D_PROVISIONAL_mp_H5DWRITE_REAL_2
-H5D_PROVISIONAL_mp_H5DWRITE_REAL_3
-H5D_PROVISIONAL_mp_H5DWRITE_REAL_4
-H5D_PROVISIONAL_mp_H5DWRITE_REAL_5
-H5D_PROVISIONAL_mp_H5DWRITE_REAL_6
-H5D_PROVISIONAL_mp_H5DWRITE_REAL_7
-H5D_PROVISIONAL_mp_H5DREAD_REFERENCE_OBJ
-H5D_PROVISIONAL_mp_H5DREAD_REFERENCE_DSETREG
-H5D_PROVISIONAL_mp_H5DREAD_INTEGER_SCALAR
-H5D_PROVISIONAL_mp_H5DREAD_INTEGER_1
-H5D_PROVISIONAL_mp_H5DREAD_INTEGER_2
-H5D_PROVISIONAL_mp_H5DREAD_INTEGER_3
-H5D_PROVISIONAL_mp_H5DREAD_INTEGER_4
-H5D_PROVISIONAL_mp_H5DREAD_INTEGER_5
-H5D_PROVISIONAL_mp_H5DREAD_INTEGER_6
-H5D_PROVISIONAL_mp_H5DREAD_INTEGER_7
-H5D_PROVISIONAL_mp_H5DREAD_CHAR_SCALAR
-H5D_PROVISIONAL_mp_H5DREAD_CHAR_1
-H5D_PROVISIONAL_mp_H5DREAD_CHAR_2
-H5D_PROVISIONAL_mp_H5DREAD_CHAR_3
-H5D_PROVISIONAL_mp_H5DREAD_CHAR_4
-H5D_PROVISIONAL_mp_H5DREAD_CHAR_5
-H5D_PROVISIONAL_mp_H5DREAD_CHAR_6
-H5D_PROVISIONAL_mp_H5DREAD_CHAR_7
-H5D_PROVISIONAL_mp_H5DREAD_REAL_SCALAR
-H5D_PROVISIONAL_mp_H5DREAD_REAL_1
-H5D_PROVISIONAL_mp_H5DREAD_REAL_2
-H5D_PROVISIONAL_mp_H5DREAD_REAL_3
-H5D_PROVISIONAL_mp_H5DREAD_REAL_4
-H5D_PROVISIONAL_mp_H5DREAD_REAL_5
-H5D_PROVISIONAL_mp_H5DREAD_REAL_6
-H5D_PROVISIONAL_mp_H5DREAD_REAL_7
-H5D_mp_H5DGET_SPACE_F
-H5D_mp_H5DGET_TYPE_F
-H5D_mp_H5DSET_EXTENT_F
-H5D_mp_H5DGET_CREATE_PLIST_F
-H5D_mp_H5DGET_STORAGE_SIZE_F
-H5D_mp_H5DVLEN_GET_MAX_LEN_F
-H5D_mp_H5DWRITE_VL_INTEGER
-H5D_mp_H5DREAD_VL_INTEGER
-H5D_mp_H5DWRITE_VL_REAL
-H5D_mp_H5DREAD_VL_REAL
-H5D_mp_H5DWRITE_VL_STRING
-H5D_mp_H5DREAD_VL_STRING
-H5D_PROVISIONAL_mp_H5DFILL_INTEGER
-H5D_PROVISIONAL_mp_H5DFILL_REAL
-H5D_PROVISIONAL_mp_H5DFILL_CHAR
-H5D_mp_H5DGET_SPACE_STATUS_F
-H5D_mp_H5DCREATE_ANON_F
-H5D_mp_H5DGET_SPACE_F
-H5D_mp_H5DGET_TYPE_F
-H5D_mp_H5DSET_EXTENT_F
-H5D_mp_H5DGET_CREATE_PLIST_F
-H5D_mp_H5DGET_STORAGE_SIZE_F
-H5D_mp_H5DVLEN_GET_MAX_LEN_F
-H5D_mp_H5DGET_ACCESS_PLIST_F
-@H5_NOF03EXP@H5D_PROVISIONAL_mp_H5DWRITE_PTR
-@H5_NOF03EXP@H5D_PROVISIONAL_mp_H5DREAD_PTR
-@H5_NOF03EXP@H5D_PROVISIONAL_mp_H5DVLEN_RECLAIM_F
-; H5E
-H5E_mp_H5ECLEAR_F
-H5E_mp_H5EPRINT_F
-H5E_mp_H5EGET_MAJOR_F
-H5E_mp_H5EGET_MINOR_F
-H5E_PROVISIONAL_mp_H5ESET_AUTO_F
-; H5F
-H5F_mp_H5FCREATE_F
-H5F_mp_H5FFLUSH_F
-H5F_mp_H5FCLOSE_F
-H5F_mp_H5FGET_OBJ_COUNT_F
-H5F_mp_H5FGET_OBJ_IDS_F
-H5F_mp_H5FGET_FREESPACE_F
-H5F_mp_H5FMOUNT_F
-H5F_mp_H5FUNMOUNT_F
-H5F_mp_H5FOPEN_F
-H5F_mp_H5FREOPEN_F
-H5F_mp_H5FGET_CREATE_PLIST_F
-H5F_mp_H5FGET_ACCESS_PLIST_F
-H5F_mp_H5FIS_HDF5_F
-H5F_mp_H5FGET_NAME_F
-H5F_mp_H5FGET_FILESIZE_F
-@H5_NOF03EXP@H5F_PROVISIONAL_mp_H5FGET_FILE_IMAGE_F
-; H5G
-H5G_mp_H5GOPEN_F
-H5G_mp_H5GCREATE_F
-H5G_mp_H5GCLOSE_F
-H5G_mp_H5GGET_OBJ_INFO_IDX_F
-H5G_mp_H5GN_MEMBERS_F
-H5G_mp_H5GLINK_F
-H5G_mp_H5GLINK2_F
-H5G_mp_H5GUNLINK_F
-H5G_mp_H5GMOVE_F
-H5G_mp_H5GMOVE2_F
-H5G_mp_H5GGET_LINKVAL_F
-H5G_mp_H5GSET_COMMENT_F
-H5G_mp_H5GGET_COMMENT_F
-H5G_mp_H5GCREATE_ANON_F
-H5G_mp_H5GGET_CREATE_PLIST_F
-H5G_mp_H5GGET_INFO_F
-H5G_mp_H5GGET_INFO_BY_IDX_F
-H5G_mp_H5GGET_INFO_BY_NAME_F
-H5G_mp_H5GGET_OBJ_INFO_IDX_F
-; H5GLOBAL
-; PREDEFINED_TYPES DATA
-; FLOATING_TYPES DATA
-; INTEGER_TYPES DATA
-; H5F_FLAGS DATA
-; H5GENERIC_FLAGS DATA
-; H5G_FLAGS DATA
-; H5D_FLAGS DATA
-; H5FD_FLAGS DATA
-; H5FD_HID_FLAGS DATA
-; H5I_FLAGS DATA
-; H5L_FLAGS DATA
-; H5O_FLAGS DATA
-; H5P_FLAGS DATA
-; H5P_FLAGS_INT DATA
-; H5R_FLAGS DATA
-; H5S_FLAGS DATA
-; H5T_FLAGS DATA
-; H5Z_FLAGS DATA
-; H5LIB_FLAGS DATA
-; H5I
-H5I_mp_H5IGET_TYPE_F
-H5I_mp_H5IGET_NAME_F
-H5I_mp_H5IINC_REF_F
-H5I_mp_H5IDEC_REF_F
-H5I_mp_H5IGET_REF_F
-H5I_mp_H5IGET_FILE_ID_F
-H5I_mp_H5IIS_VALID_F
-; H5L
-H5L_mp_H5LCOPY_F
-H5L_mp_H5LDELETE_F
-H5L_mp_H5LCREATE_SOFT_F
-H5L_mp_H5LCREATE_HARD_F
-H5L_mp_H5LCREATE_EXTERNAL_F
-H5L_mp_H5LDELETE_BY_IDX_F
-H5L_mp_H5LEXISTS_F
-H5L_mp_H5LGET_INFO_F
-H5L_mp_H5LGET_INFO_BY_IDX_F
-H5L_mp_H5LIS_REGISTERED_F
-H5L_mp_H5LMOVE_F
-H5L_mp_H5LGET_NAME_BY_IDX_F
-@H5_NOF03EXP@H5L_PROVISIONAL_mp_H5LITERATE_F
-@H5_NOF03EXP@H5L_PROVISIONAL_mp_H5LITERATE_BY_NAME_F
-; H5O
-H5O_mp_H5OCLOSE_F
-H5O_mp_H5OCOPY_F
-H5O_mp_H5ODECR_REFCOUNT_F
-H5O_mp_H5OEXISTS_BY_NAME_F
-H5O_mp_H5OGET_COMMENT_F
-H5O_mp_H5OGET_COMMENT_BY_NAME_F
-H5O_mp_H5OINCR_REFCOUNT_F
-H5O_mp_H5OLINK_F
-H5O_mp_H5OOPEN_BY_ADDR_F
-H5O_mp_H5OOPEN_BY_IDX_F
-H5O_mp_H5OOPEN_F
-H5O_mp_H5OSET_COMMENT_F
-H5O_mp_H5OSET_COMMENT_BY_NAME_F
-@H5_NOF03EXP@H5O_PROVISIONAL_mp_H5OGET_INFO_BY_IDX_F
-@H5_NOF03EXP@H5O_PROVISIONAL_mp_H5OGET_INFO_BY_NAME_F
-@H5_NOF03EXP@H5O_PROVISIONAL_mp_H5OGET_INFO_F
-@H5_NOF03EXP@H5O_PROVISIONAL_mp_H5OVISIT_BY_NAME_F
-@H5_NOF03EXP@H5O_PROVISIONAL_mp_H5OVISIT_F
-; H5P
-H5P_mp_H5PCREATE_F
-H5P_mp_H5PSET_PRESERVE_F
-H5P_mp_H5PGET_PRESERVE_F
-H5P_mp_H5PGET_CLASS_F
-H5P_mp_H5PCOPY_F
-H5P_mp_H5PCLOSE_F
-H5P_mp_H5PSET_CHUNK_F
-H5P_mp_H5PGET_CHUNK_F
-H5P_mp_H5PSET_DEFLATE_F
-H5P_PROVISIONAL_mp_H5PSET_FILL_VALUE_INTEGER
-H5P_PROVISIONAL_mp_H5PGET_FILL_VALUE_INTEGER
-H5P_PROVISIONAL_mp_H5PSET_FILL_VALUE_REAL
-H5P_PROVISIONAL_mp_H5PGET_FILL_VALUE_REAL
-H5P_PROVISIONAL_mp_H5PSET_FILL_VALUE_CHAR
-H5P_PROVISIONAL_mp_H5PGET_FILL_VALUE_CHAR
-H5P_mp_H5PGET_VERSION_F
-H5P_mp_H5PSET_USERBLOCK_F
-H5P_mp_H5PGET_USERBLOCK_F
-H5P_mp_H5PSET_SIZES_F
-H5P_mp_H5PGET_SIZES_F
-H5P_mp_H5PSET_SYM_K_F
-H5P_mp_H5PGET_SYM_K_F
-H5P_mp_H5PSET_ISTORE_K_F
-H5P_mp_H5PGET_ISTORE_K_F
-H5P_mp_H5PGET_DRIVER_F
-H5P_mp_H5PSET_FAPL_STDIO_F
-H5P_mp_H5PSET_FAPL_SEC2_F
-H5P_mp_H5PSET_ALIGNMENT_F
-H5P_mp_H5PGET_ALIGNMENT_F
-H5P_mp_H5PSET_FAPL_CORE_F
-H5P_mp_H5PGET_FAPL_CORE_F
-H5P_mp_H5PSET_FAPL_FAMILY_F
-H5P_mp_H5PGET_FAPL_FAMILY_F
-H5P_mp_H5PSET_CACHE_F
-H5P_mp_H5PGET_CACHE_F
-H5P_mp_H5PSET_FAPL_SPLIT_F
-H5P_mp_H5PSET_GC_REFERENCES_F
-H5P_mp_H5PGET_GC_REFERENCES_F
-H5P_mp_H5PSET_LAYOUT_F
-H5P_mp_H5PGET_LAYOUT_F
-H5P_mp_H5PSET_FILTER_F
-H5P_mp_H5PGET_NFILTERS_F
-H5P_mp_H5PGET_FILTER_F
-H5P_mp_H5PSET_EXTERNAL_F
-H5P_mp_H5PGET_EXTERNAL_COUNT_F
-H5P_mp_H5PGET_EXTERNAL_F
-H5P_mp_H5PSET_BTREE_RATIOS_F
-H5P_mp_H5PGET_BTREE_RATIOS_F
-H5P_mp_H5PGET_FCLOSE_DEGREE_F
-H5P_mp_H5PSET_FCLOSE_DEGREE_F
-H5P_mp_H5PEQUAL_F
-H5P_mp_H5PSET_BUFFER_F
-H5P_mp_H5PGET_BUFFER_F
-H5P_mp_H5PFILL_VALUE_DEFINED_F
-H5P_mp_H5PSET_ALLOC_TIME_F
-H5P_mp_H5PGET_ALLOC_TIME_F
-H5P_mp_H5PSET_FILL_TIME_F
-H5P_mp_H5PGET_FILL_TIME_F
-H5P_mp_H5PSET_META_BLOCK_SIZE_F
-H5P_mp_H5PGET_META_BLOCK_SIZE_F
-H5P_mp_H5PSET_SIEVE_BUF_SIZE_F
-H5P_mp_H5PGET_SIEVE_BUF_SIZE_F
-H5P_mp_H5PSET_SMALL_DATA_BLOCK_SIZE_F
-H5P_mp_H5PGET_SMALL_DATA_BLOCK_SIZE_F
-H5P_mp_H5PSET_HYPER_VECTOR_SIZE_F
-H5P_mp_H5PGET_HYPER_VECTOR_SIZE_F
-H5P_PROVISIONAL_mp_H5PSET_INTEGER
-H5P_PROVISIONAL_mp_H5PSET_REAL
-H5P_PROVISIONAL_mp_H5PSET_CHAR
-H5P_PROVISIONAL_mp_H5PGET_INTEGER
-H5P_PROVISIONAL_mp_H5PGET_REAL
-H5P_PROVISIONAL_mp_H5PGET_CHAR
-H5P_mp_H5PEXIST_F
-H5P_mp_H5PGET_SIZE_F
-H5P_mp_H5PGET_NPROPS_F
-H5P_mp_H5PGET_CLASS_NAME_F
-H5P_mp_H5PGET_CLASS_PARENT_F
-H5P_mp_H5PISA_CLASS_F
-H5P_mp_H5PCOPY_PROP_F
-H5P_mp_H5PREMOVE_F
-H5P_mp_H5PUNREGISTER_F
-H5P_mp_H5PCLOSE_CLASS_F
-H5P_PROVISIONAL_mp_H5PCREATE_CLASS_F
-H5P_PROVISIONAL_mp_H5PREGISTER_INTEGER
-H5P_PROVISIONAL_mp_H5PREGISTER_REAL
-H5P_PROVISIONAL_mp_H5PREGISTER_CHAR
-H5P_PROVISIONAL_mp_H5PINSERT_INTEGER
-H5P_PROVISIONAL_mp_H5PINSERT_REAL
-H5P_PROVISIONAL_mp_H5PINSERT_CHAR
-H5P_mp_H5PSET_SHUFFLE_F
-H5P_mp_H5PSET_EDC_CHECK_F
-H5P_mp_H5PGET_EDC_CHECK_F
-H5P_mp_H5PSET_FLETCHER32_F
-H5P_mp_H5PSET_FAMILY_OFFSET_F
-H5P_mp_H5PSET_FAPL_MULTI_L
-H5P_mp_H5PSET_FAPL_MULTI_S
-H5P_mp_H5PGET_FAPL_MULTI_F
-H5P_mp_H5PSET_SZIP_F
-H5P_mp_H5PALL_FILTERS_AVAIL_F
-H5P_mp_H5PGET_FILTER_BY_ID_F
-H5P_mp_H5PMODIFY_FILTER_F
-H5P_mp_H5PREMOVE_FILTER_F
-H5P_mp_H5PGET_ATTR_PHASE_CHANGE_F
-H5P_mp_H5PSET_ATTR_CREATION_ORDER_F
-H5P_mp_H5PSET_SHARED_MESG_NINDEXES_F
-H5P_mp_H5PSET_SHARED_MESG_INDEX_F
-H5P_mp_H5PGET_ATTR_CREATION_ORDER_F
-H5P_mp_H5PSET_LIBVER_BOUNDS_F
-H5P_mp_H5PSET_LINK_CREATION_ORDER_F
-H5P_mp_H5PGET_LINK_PHASE_CHANGE_F
-H5P_mp_H5PGET_OBJ_TRACK_TIMES_F
-H5P_mp_H5PSET_OBJ_TRACK_TIMES_F
-H5P_mp_H5PSET_CREATE_INTER_GROUP_F
-H5P_mp_H5PGET_LINK_CREATION_ORDER_F
-H5P_mp_H5PSET_CHAR_ENCODING_F
-H5P_mp_H5PGET_CHAR_ENCODING_F
-H5P_mp_H5PSET_COPY_OBJECT_F
-H5P_mp_H5PGET_COPY_OBJECT_F
-H5P_mp_H5PGET_DATA_TRANSFORM_F
-H5P_mp_H5PSET_DATA_TRANSFORM_F
-H5P_mp_H5PGET_LOCAL_HEAP_SIZE_HINT_F
-H5P_mp_H5PGET_EST_LINK_INFO_F
-H5P_mp_H5PSET_LOCAL_HEAP_SIZE_HINT_F
-H5P_mp_H5PSET_EST_LINK_INFO_F
-H5P_mp_H5PSET_LINK_PHASE_CHANGE_F
-H5P_mp_H5PSET_FAPL_DIRECT_F
-H5P_mp_H5PGET_FAPL_DIRECT_F
-H5P_mp_H5PSET_ATTR_PHASE_CHANGE_F
-H5P_mp_H5PSET_NBIT_F
-H5P_mp_H5PSET_SCALEOFFSET_F
-H5P_mp_H5PSET_NLINKS_F
-H5P_mp_H5PGET_NLINKS_F
-H5P_mp_H5PGET_CREATE_INTER_GROUP_F
-H5P_mp_H5PSET_CHUNK_CACHE_F
-H5P_mp_H5PGET_CHUNK_CACHE_F
-@H5_NOF03EXP@H5P_PROVISIONAL_mp_H5PSET_FILL_VALUE_PTR
-@H5_NOF03EXP@H5P_PROVISIONAL_mp_H5PGET_FILL_VALUE_PTR
-@H5_NOF03EXP@H5P_PROVISIONAL_mp_H5PSET_PTR
-@H5_NOF03EXP@H5P_PROVISIONAL_mp_H5PGET_PTR
-@H5_NOF03EXP@H5P_PROVISIONAL_mp_H5PREGISTER_PTR
-@H5_NOF03EXP@H5P_PROVISIONAL_mp_H5PINSERT_PTR
-; H5R
-H5R_PROVISIONAL_mp_H5RCREATE_OBJECT_F
-H5R_PROVISIONAL_mp_H5RCREATE_REGION_F
-H5R_PROVISIONAL_mp_H5RDEREFERENCE_OBJECT_F
-H5R_PROVISIONAL_mp_H5RDEREFERENCE_REGION_F
-H5R_PROVISIONAL_mp_H5RGET_REGION_REGION_F
-H5R_mp_H5RGET_OBJECT_TYPE_OBJ_F
-H5R_PROVISIONAL_mp_H5RGET_NAME_OBJECT_F
-H5R_PROVISIONAL_mp_H5RGET_NAME_REGION_F
-@H5_NOF03EXP@H5R_PROVISIONAL_mp_H5RGET_REGION_PTR_F
-@H5_NOF03EXP@H5R_PROVISIONAL_mp_H5RCREATE_PTR_F
-@H5_NOF03EXP@H5R_PROVISIONAL_mp_H5RDEREFERENCE_PTR_F
-@H5_NOF03EXP@H5R_PROVISIONAL_mp_H5RGET_NAME_PTR_F
-@H5_NOF03EXP@H5R_PROVISIONAL_mp_H5RGET_OBJ_TYPE_F
-; H5S
-H5S_mp_H5SCREATE_SIMPLE_F
-H5S_mp_H5SCLOSE_F
-H5S_mp_H5SCREATE_F
-H5S_mp_H5SCOPY_F
-H5S_mp_H5SGET_SELECT_HYPER_NBLOCKS_F
-H5S_mp_H5SGET_SELECT_HYPER_BLOCKLIST_F
-H5S_mp_H5SGET_SELECT_BOUNDS_F
-H5S_mp_H5SGET_SELECT_ELEM_NPOINTS_F
-H5S_mp_H5SGET_SELECT_ELEM_POINTLIST_F
-H5S_mp_H5SSELECT_ELEMENTS_F
-H5S_mp_H5SSELECT_ALL_F
-H5S_mp_H5SSELECT_NONE_F
-H5S_mp_H5SSELECT_VALID_F
-H5S_mp_H5SGET_SIMPLE_EXTENT_NPOINTS_F
-H5S_mp_H5SGET_SELECT_NPOINTS_F
-H5S_mp_H5SGET_SIMPLE_EXTENT_NDIMS_F
-H5S_mp_H5SGET_SIMPLE_EXTENT_DIMS_F
-H5S_mp_H5SGET_SIMPLE_EXTENT_TYPE_F
-H5S_mp_H5SSET_EXTENT_SIMPLE_F
-H5S_mp_H5SIS_SIMPLE_F
-H5S_mp_H5SOFFSET_SIMPLE_F
-H5S_mp_H5SEXTENT_COPY_F
-H5S_mp_H5SSET_EXTENT_NONE_F
-H5S_mp_H5SSELECT_HYPERSLAB_F
-H5S_mp_H5SGET_SELECT_TYPE_F
-H5S_mp_H5SDECODE_F
-H5S_mp_H5SENCODE_F
-H5S_mp_H5SEXTENT_EQUAL_F
-; H5T
-H5T_mp_H5TOPEN_F
-H5T_mp_H5TCOMMIT_F
-H5T_mp_H5TCOPY_F
-H5T_mp_H5TEQUAL_F
-H5T_mp_H5TCLOSE_F
-H5T_mp_H5TGET_CLASS_F
-H5T_mp_H5TGET_SIZE_F
-H5T_mp_H5TSET_SIZE_F
-H5T_mp_H5TGET_ORDER_F
-H5T_mp_H5TSET_ORDER_F
-H5T_mp_H5TGET_PRECISION_F
-H5T_mp_H5TSET_PRECISION_F
-H5T_mp_H5TGET_OFFSET_F
-H5T_mp_H5TSET_OFFSET_F
-H5T_mp_H5TGET_PAD_F
-H5T_mp_H5TSET_PAD_F
-H5T_mp_H5TGET_SIGN_F
-H5T_mp_H5TSET_SIGN_F
-H5T_mp_H5TGET_FIELDS_F
-H5T_mp_H5TSET_FIELDS_F
-H5T_mp_H5TGET_EBIAS_F
-H5T_mp_H5TSET_EBIAS_F
-H5T_mp_H5TGET_NORM_F
-H5T_mp_H5TSET_NORM_F
-H5T_mp_H5TGET_INPAD_F
-H5T_mp_H5TSET_INPAD_F
-H5T_mp_H5TGET_CSET_F
-H5T_mp_H5TSET_CSET_F
-H5T_mp_H5TGET_STRPAD_F
-H5T_mp_H5TSET_STRPAD_F
-H5T_mp_H5TGET_NMEMBERS_F
-H5T_mp_H5TGET_MEMBER_NAME_F
-H5T_mp_H5TGET_MEMBER_OFFSET_F
-H5T_mp_H5TGET_MEMBER_INDEX_F
-H5T_mp_H5TGET_ARRAY_DIMS_F
-H5T_mp_H5TGET_ARRAY_NDIMS_F
-H5T_mp_H5TGET_SUPER_F
-H5T_mp_H5TGET_MEMBER_TYPE_F
-H5T_mp_H5TCREATE_F
-H5T_mp_H5TINSERT_F
-H5T_mp_H5TPACK_F
-H5T_mp_H5TARRAY_CREATE_F
-H5T_mp_H5TENUM_CREATE_F
-H5T_mp_H5TENUM_INSERT_F
-H5T_mp_H5TENUM_NAMEOF_F
-H5T_mp_H5TENUM_VALUEOF_F
-H5T_mp_H5TGET_MEMBER_VALUE_F
-H5T_mp_H5TSET_TAG_F
-H5T_mp_H5TGET_TAG_F
-H5T_mp_H5TVLEN_CREATE_F
-H5T_mp_H5TIS_VARIABLE_STR_F
-H5T_mp_H5TGET_MEMBER_CLASS_F
-H5T_mp_H5TCOMMIT_ANON_F
-H5T_mp_H5TCOMMITTED_F
-H5T_mp_H5TDECODE_F
-H5T_mp_H5TENCODE_F
-H5T_mp_H5TGET_CREATE_PLIST_F
-H5T_mp_H5TCOMPILER_CONV_F
-H5T_mp_H5TGET_NATIVE_TYPE_F
-@H5_NOF03EXP@H5T_PROVISIONAL_mp_H5TCONVERT_F
-; H5Z
-H5Z_mp_H5ZUNREGISTER_F
-H5Z_mp_H5ZFILTER_AVAIL_F
-H5Z_mp_H5ZGET_FILTER_INFO_F
-; Parallel
-@H5_NOPAREXP@H5FDMPIO_mp_H5PSET_FAPL_MPIO_F
-@H5_NOPAREXP@H5FDMPIO_mp_H5PGET_FAPL_MPIO_F
-@H5_NOPAREXP@H5FDMPIO_mp_H5PSET_DXPL_MPIO_F
-@H5_NOPAREXP@H5FDMPIO_mp_H5PGET_DXPL_MPIO_F
-@H5_NOPAREXP@H5FDMPIO_mp_H5PSET_FAPL_MPIPOSIX_F
-@H5_NOPAREXP@H5FDMPIO_mp_H5PGET_FAPL_MPIPOSIX_F
-@H5_NOPAREXP@H5FDMPIO_mp_H5PGET_MPIO_ACTUAL_IO_MODE_F
+EXPORTS +; H5LIB +H5LIB_mp_H5OPEN_F +H5LIB_mp_H5CLOSE_F +H5LIB_mp_H5GET_LIBVERSION_F +H5LIB_mp_H5CHECK_VERSION_F +H5LIB_mp_H5GARBAGE_COLLECT_F +H5LIB_mp_H5DONT_ATEXIT_F +H5LIB_mp_H5KIND_TO_TYPE +@H5_NOF03EXP@H5LIB_PROVISIONAL_mp_H5OFFSETOF +; H5_DBLE_INTERFACE +H5_DBLE_INTERFACE_mp_H5AREAD_DOUBLE_SCALAR +H5_DBLE_INTERFACE_mp_H5AREAD_DOUBLE_1 +H5_DBLE_INTERFACE_mp_H5AREAD_DOUBLE_2 +H5_DBLE_INTERFACE_mp_H5AREAD_DOUBLE_3 +H5_DBLE_INTERFACE_mp_H5AREAD_DOUBLE_4 +H5_DBLE_INTERFACE_mp_H5AREAD_DOUBLE_5 +H5_DBLE_INTERFACE_mp_H5AREAD_DOUBLE_6 +H5_DBLE_INTERFACE_mp_H5AREAD_DOUBLE_7 +H5_DBLE_INTERFACE_mp_H5AWRITE_DOUBLE_SCALAR +H5_DBLE_INTERFACE_mp_H5AWRITE_DOUBLE_1 +H5_DBLE_INTERFACE_mp_H5AWRITE_DOUBLE_2 +H5_DBLE_INTERFACE_mp_H5AWRITE_DOUBLE_3 +H5_DBLE_INTERFACE_mp_H5AWRITE_DOUBLE_4 +H5_DBLE_INTERFACE_mp_H5AWRITE_DOUBLE_5 +H5_DBLE_INTERFACE_mp_H5AWRITE_DOUBLE_6 +H5_DBLE_INTERFACE_mp_H5AWRITE_DOUBLE_7 +H5_DBLE_INTERFACE_mp_H5DFILL_DOUBLE +H5_DBLE_INTERFACE_mp_H5DREAD_DOUBLE_SCALAR +H5_DBLE_INTERFACE_mp_H5DREAD_DOUBLE_1 +H5_DBLE_INTERFACE_mp_H5DREAD_DOUBLE_2 +H5_DBLE_INTERFACE_mp_H5DREAD_DOUBLE_3 +H5_DBLE_INTERFACE_mp_H5DREAD_DOUBLE_4 +H5_DBLE_INTERFACE_mp_H5DREAD_DOUBLE_5 +H5_DBLE_INTERFACE_mp_H5DREAD_DOUBLE_6 +H5_DBLE_INTERFACE_mp_H5DREAD_DOUBLE_7 +H5_DBLE_INTERFACE_mp_H5DWRITE_DOUBLE_SCALAR +H5_DBLE_INTERFACE_mp_H5DWRITE_DOUBLE_1 +H5_DBLE_INTERFACE_mp_H5DWRITE_DOUBLE_2 +H5_DBLE_INTERFACE_mp_H5DWRITE_DOUBLE_3 +H5_DBLE_INTERFACE_mp_H5DWRITE_DOUBLE_4 +H5_DBLE_INTERFACE_mp_H5DWRITE_DOUBLE_5 +H5_DBLE_INTERFACE_mp_H5DWRITE_DOUBLE_6 +H5_DBLE_INTERFACE_mp_H5DWRITE_DOUBLE_7 +H5_DBLE_INTERFACE_mp_H5PGET_DOUBLE +H5_DBLE_INTERFACE_mp_H5PSET_DOUBLE +H5_DBLE_INTERFACE_mp_H5PSET_FILL_VALUE_DOUBLE +H5_DBLE_INTERFACE_mp_H5PGET_FILL_VALUE_DOUBLE +H5_DBLE_INTERFACE_mp_H5PINSERT_DOUBLE +H5_DBLE_INTERFACE_mp_H5PREGISTER_DOUBLE +; H5A +H5A_mp_H5ACREATE_F +H5A_mp_H5AOPEN_NAME_F +H5A_mp_H5AOPEN_IDX_F +H5A_PROVISIONAL_mp_H5AWRITE_INTEGER_SCALAR +H5A_PROVISIONAL_mp_H5AWRITE_INTEGER_1 +H5A_PROVISIONAL_mp_H5AWRITE_INTEGER_2 +H5A_PROVISIONAL_mp_H5AWRITE_INTEGER_3 +H5A_PROVISIONAL_mp_H5AWRITE_INTEGER_4 +H5A_PROVISIONAL_mp_H5AWRITE_INTEGER_5 +H5A_PROVISIONAL_mp_H5AWRITE_INTEGER_6 +H5A_PROVISIONAL_mp_H5AWRITE_INTEGER_7 +H5A_PROVISIONAL_mp_H5AWRITE_REAL_SCALAR +H5A_PROVISIONAL_mp_H5AWRITE_REAL_1 +H5A_PROVISIONAL_mp_H5AWRITE_REAL_2 +H5A_PROVISIONAL_mp_H5AWRITE_REAL_3 +H5A_PROVISIONAL_mp_H5AWRITE_REAL_4 +H5A_PROVISIONAL_mp_H5AWRITE_REAL_5 +H5A_PROVISIONAL_mp_H5AWRITE_REAL_6 +H5A_PROVISIONAL_mp_H5AWRITE_REAL_7 +H5A_PROVISIONAL_mp_H5AWRITE_CHAR_SCALAR +H5A_PROVISIONAL_mp_H5AWRITE_CHAR_1 +H5A_PROVISIONAL_mp_H5AWRITE_CHAR_2 +H5A_PROVISIONAL_mp_H5AWRITE_CHAR_3 +H5A_PROVISIONAL_mp_H5AWRITE_CHAR_4 +H5A_PROVISIONAL_mp_H5AWRITE_CHAR_5 +H5A_PROVISIONAL_mp_H5AWRITE_CHAR_6 +H5A_PROVISIONAL_mp_H5AWRITE_CHAR_7 +H5A_PROVISIONAL_mp_H5AREAD_INTEGER_SCALAR +H5A_PROVISIONAL_mp_H5AREAD_INTEGER_1 +H5A_PROVISIONAL_mp_H5AREAD_INTEGER_2 +H5A_PROVISIONAL_mp_H5AREAD_INTEGER_3 +H5A_PROVISIONAL_mp_H5AREAD_INTEGER_4 +H5A_PROVISIONAL_mp_H5AREAD_INTEGER_5 +H5A_PROVISIONAL_mp_H5AREAD_INTEGER_6 +H5A_PROVISIONAL_mp_H5AREAD_INTEGER_7 +H5A_PROVISIONAL_mp_H5AREAD_REAL_SCALAR +H5A_PROVISIONAL_mp_H5AREAD_REAL_1 +H5A_PROVISIONAL_mp_H5AREAD_REAL_2 +H5A_PROVISIONAL_mp_H5AREAD_REAL_3 +H5A_PROVISIONAL_mp_H5AREAD_REAL_4 +H5A_PROVISIONAL_mp_H5AREAD_REAL_5 +H5A_PROVISIONAL_mp_H5AREAD_REAL_6 +H5A_PROVISIONAL_mp_H5AREAD_REAL_7 +H5A_PROVISIONAL_mp_H5AREAD_CHAR_SCALAR +H5A_PROVISIONAL_mp_H5AREAD_CHAR_1 +H5A_PROVISIONAL_mp_H5AREAD_CHAR_2 +H5A_PROVISIONAL_mp_H5AREAD_CHAR_3 +H5A_PROVISIONAL_mp_H5AREAD_CHAR_4 +H5A_PROVISIONAL_mp_H5AREAD_CHAR_5 +H5A_PROVISIONAL_mp_H5AREAD_CHAR_6 +H5A_PROVISIONAL_mp_H5AREAD_CHAR_7 +H5A_mp_H5AGET_SPACE_F +H5A_mp_H5AGET_TYPE_F +H5A_mp_H5AGET_NAME_F +H5A_mp_H5AGET_NAME_BY_IDX_F +H5A_mp_H5AGET_NUM_ATTRS_F +H5A_mp_H5ADELETE_F +H5A_mp_H5ACLOSE_F +H5A_mp_H5AGET_STORAGE_SIZE_F +H5A_mp_H5AGET_CREATE_PLIST_F +H5A_mp_H5ARENAME_BY_NAME_F +H5A_mp_H5AOPEN_F +H5A_mp_H5ADELETE_BY_IDX_F +H5A_mp_H5ADELETE_BY_NAME_F +H5A_mp_H5AOPEN_BY_IDX_F +H5A_mp_H5AGET_INFO_F +H5A_mp_H5AGET_INFO_BY_IDX_F +H5A_mp_H5AGET_INFO_BY_NAME_F +H5A_mp_H5ACREATE_BY_NAME_F +H5A_mp_H5AEXISTS_F +H5A_mp_H5AEXISTS_BY_NAME_F +H5A_mp_H5AOPEN_BY_NAME_F +H5A_mp_H5ARENAME_F +@H5_NOF03EXP@H5A_PROVISIONAL_mp_H5AWRITE_PTR +@H5_NOF03EXP@H5A_PROVISIONAL_mp_H5AREAD_PTR +; H5D +H5D_mp_H5DCREATE_F +H5D_mp_H5DOPEN_F +H5D_mp_H5DCLOSE_F +H5D_PROVISIONAL_mp_H5DWRITE_REFERENCE_OBJ +H5D_PROVISIONAL_mp_H5DWRITE_REFERENCE_DSETREG +H5D_PROVISIONAL_mp_H5DWRITE_INTEGER_SCALAR +H5D_PROVISIONAL_mp_H5DWRITE_INTEGER_1 +H5D_PROVISIONAL_mp_H5DWRITE_INTEGER_2 +H5D_PROVISIONAL_mp_H5DWRITE_INTEGER_3 +H5D_PROVISIONAL_mp_H5DWRITE_INTEGER_4 +H5D_PROVISIONAL_mp_H5DWRITE_INTEGER_5 +H5D_PROVISIONAL_mp_H5DWRITE_INTEGER_6 +H5D_PROVISIONAL_mp_H5DWRITE_INTEGER_7 +H5D_PROVISIONAL_mp_H5DWRITE_CHAR_SCALAR +H5D_PROVISIONAL_mp_H5DWRITE_CHAR_1 +H5D_PROVISIONAL_mp_H5DWRITE_CHAR_2 +H5D_PROVISIONAL_mp_H5DWRITE_CHAR_3 +H5D_PROVISIONAL_mp_H5DWRITE_CHAR_4 +H5D_PROVISIONAL_mp_H5DWRITE_CHAR_5 +H5D_PROVISIONAL_mp_H5DWRITE_CHAR_6 +H5D_PROVISIONAL_mp_H5DWRITE_CHAR_7 +H5D_PROVISIONAL_mp_H5DWRITE_REAL_SCALAR +H5D_PROVISIONAL_mp_H5DWRITE_REAL_1 +H5D_PROVISIONAL_mp_H5DWRITE_REAL_2 +H5D_PROVISIONAL_mp_H5DWRITE_REAL_3 +H5D_PROVISIONAL_mp_H5DWRITE_REAL_4 +H5D_PROVISIONAL_mp_H5DWRITE_REAL_5 +H5D_PROVISIONAL_mp_H5DWRITE_REAL_6 +H5D_PROVISIONAL_mp_H5DWRITE_REAL_7 +H5D_PROVISIONAL_mp_H5DREAD_REFERENCE_OBJ +H5D_PROVISIONAL_mp_H5DREAD_REFERENCE_DSETREG +H5D_PROVISIONAL_mp_H5DREAD_INTEGER_SCALAR +H5D_PROVISIONAL_mp_H5DREAD_INTEGER_1 +H5D_PROVISIONAL_mp_H5DREAD_INTEGER_2 +H5D_PROVISIONAL_mp_H5DREAD_INTEGER_3 +H5D_PROVISIONAL_mp_H5DREAD_INTEGER_4 +H5D_PROVISIONAL_mp_H5DREAD_INTEGER_5 +H5D_PROVISIONAL_mp_H5DREAD_INTEGER_6 +H5D_PROVISIONAL_mp_H5DREAD_INTEGER_7 +H5D_PROVISIONAL_mp_H5DREAD_CHAR_SCALAR +H5D_PROVISIONAL_mp_H5DREAD_CHAR_1 +H5D_PROVISIONAL_mp_H5DREAD_CHAR_2 +H5D_PROVISIONAL_mp_H5DREAD_CHAR_3 +H5D_PROVISIONAL_mp_H5DREAD_CHAR_4 +H5D_PROVISIONAL_mp_H5DREAD_CHAR_5 +H5D_PROVISIONAL_mp_H5DREAD_CHAR_6 +H5D_PROVISIONAL_mp_H5DREAD_CHAR_7 +H5D_PROVISIONAL_mp_H5DREAD_REAL_SCALAR +H5D_PROVISIONAL_mp_H5DREAD_REAL_1 +H5D_PROVISIONAL_mp_H5DREAD_REAL_2 +H5D_PROVISIONAL_mp_H5DREAD_REAL_3 +H5D_PROVISIONAL_mp_H5DREAD_REAL_4 +H5D_PROVISIONAL_mp_H5DREAD_REAL_5 +H5D_PROVISIONAL_mp_H5DREAD_REAL_6 +H5D_PROVISIONAL_mp_H5DREAD_REAL_7 +H5D_mp_H5DGET_SPACE_F +H5D_mp_H5DGET_TYPE_F +H5D_mp_H5DSET_EXTENT_F +H5D_mp_H5DGET_CREATE_PLIST_F +H5D_mp_H5DGET_STORAGE_SIZE_F +H5D_mp_H5DVLEN_GET_MAX_LEN_F +H5D_mp_H5DWRITE_VL_INTEGER +H5D_mp_H5DREAD_VL_INTEGER +H5D_mp_H5DWRITE_VL_REAL +H5D_mp_H5DREAD_VL_REAL +H5D_mp_H5DWRITE_VL_STRING +H5D_mp_H5DREAD_VL_STRING +H5D_PROVISIONAL_mp_H5DFILL_INTEGER +H5D_PROVISIONAL_mp_H5DFILL_REAL +H5D_PROVISIONAL_mp_H5DFILL_CHAR +H5D_mp_H5DGET_SPACE_STATUS_F +H5D_mp_H5DCREATE_ANON_F +H5D_mp_H5DGET_SPACE_F +H5D_mp_H5DGET_TYPE_F +H5D_mp_H5DSET_EXTENT_F +H5D_mp_H5DGET_CREATE_PLIST_F +H5D_mp_H5DGET_STORAGE_SIZE_F +H5D_mp_H5DVLEN_GET_MAX_LEN_F +H5D_mp_H5DGET_ACCESS_PLIST_F +@H5_NOF03EXP@H5D_PROVISIONAL_mp_H5DWRITE_PTR +@H5_NOF03EXP@H5D_PROVISIONAL_mp_H5DREAD_PTR +@H5_NOF03EXP@H5D_PROVISIONAL_mp_H5DVLEN_RECLAIM_F +; H5E +H5E_mp_H5ECLEAR_F +H5E_mp_H5EPRINT_F +H5E_mp_H5EGET_MAJOR_F +H5E_mp_H5EGET_MINOR_F +H5E_PROVISIONAL_mp_H5ESET_AUTO_F +; H5F +H5F_mp_H5FCREATE_F +H5F_mp_H5FFLUSH_F +H5F_mp_H5FCLOSE_F +H5F_mp_H5FGET_OBJ_COUNT_F +H5F_mp_H5FGET_OBJ_IDS_F +H5F_mp_H5FGET_FREESPACE_F +H5F_mp_H5FMOUNT_F +H5F_mp_H5FUNMOUNT_F +H5F_mp_H5FOPEN_F +H5F_mp_H5FREOPEN_F +H5F_mp_H5FGET_CREATE_PLIST_F +H5F_mp_H5FGET_ACCESS_PLIST_F +H5F_mp_H5FIS_HDF5_F +H5F_mp_H5FGET_NAME_F +H5F_mp_H5FGET_FILESIZE_F +@H5_NOF03EXP@H5F_PROVISIONAL_mp_H5FGET_FILE_IMAGE_F +; H5G +H5G_mp_H5GOPEN_F +H5G_mp_H5GCREATE_F +H5G_mp_H5GCLOSE_F +H5G_mp_H5GGET_OBJ_INFO_IDX_F +H5G_mp_H5GN_MEMBERS_F +H5G_mp_H5GLINK_F +H5G_mp_H5GLINK2_F +H5G_mp_H5GUNLINK_F +H5G_mp_H5GMOVE_F +H5G_mp_H5GMOVE2_F +H5G_mp_H5GGET_LINKVAL_F +H5G_mp_H5GSET_COMMENT_F +H5G_mp_H5GGET_COMMENT_F +H5G_mp_H5GCREATE_ANON_F +H5G_mp_H5GGET_CREATE_PLIST_F +H5G_mp_H5GGET_INFO_F +H5G_mp_H5GGET_INFO_BY_IDX_F +H5G_mp_H5GGET_INFO_BY_NAME_F +H5G_mp_H5GGET_OBJ_INFO_IDX_F +; H5GLOBAL +; PREDEFINED_TYPES DATA +; FLOATING_TYPES DATA +; INTEGER_TYPES DATA +; H5F_FLAGS DATA +; H5GENERIC_FLAGS DATA +; H5G_FLAGS DATA +; H5D_FLAGS DATA +; H5FD_FLAGS DATA +; H5FD_HID_FLAGS DATA +; H5I_FLAGS DATA +; H5L_FLAGS DATA +; H5O_FLAGS DATA +; H5P_FLAGS DATA +; H5P_FLAGS_INT DATA +; H5R_FLAGS DATA +; H5S_FLAGS DATA +; H5T_FLAGS DATA +; H5Z_FLAGS DATA +; H5LIB_FLAGS DATA +; H5I +H5I_mp_H5IGET_TYPE_F +H5I_mp_H5IGET_NAME_F +H5I_mp_H5IINC_REF_F +H5I_mp_H5IDEC_REF_F +H5I_mp_H5IGET_REF_F +H5I_mp_H5IGET_FILE_ID_F +H5I_mp_H5IIS_VALID_F +; H5L +H5L_mp_H5LCOPY_F +H5L_mp_H5LDELETE_F +H5L_mp_H5LCREATE_SOFT_F +H5L_mp_H5LCREATE_HARD_F +H5L_mp_H5LCREATE_EXTERNAL_F +H5L_mp_H5LDELETE_BY_IDX_F +H5L_mp_H5LEXISTS_F +H5L_mp_H5LGET_INFO_F +H5L_mp_H5LGET_INFO_BY_IDX_F +H5L_mp_H5LIS_REGISTERED_F +H5L_mp_H5LMOVE_F +H5L_mp_H5LGET_NAME_BY_IDX_F +@H5_NOF03EXP@H5L_PROVISIONAL_mp_H5LITERATE_F +@H5_NOF03EXP@H5L_PROVISIONAL_mp_H5LITERATE_BY_NAME_F +; H5O +H5O_mp_H5OCLOSE_F +H5O_mp_H5OCOPY_F +H5O_mp_H5ODECR_REFCOUNT_F +H5O_mp_H5OEXISTS_BY_NAME_F +H5O_mp_H5OGET_COMMENT_F +H5O_mp_H5OGET_COMMENT_BY_NAME_F +H5O_mp_H5OINCR_REFCOUNT_F +H5O_mp_H5OLINK_F +H5O_mp_H5OOPEN_BY_ADDR_F +H5O_mp_H5OOPEN_BY_IDX_F +H5O_mp_H5OOPEN_F +H5O_mp_H5OSET_COMMENT_F +H5O_mp_H5OSET_COMMENT_BY_NAME_F +@H5_NOF03EXP@H5O_PROVISIONAL_mp_H5OGET_INFO_BY_IDX_F +@H5_NOF03EXP@H5O_PROVISIONAL_mp_H5OGET_INFO_BY_NAME_F +@H5_NOF03EXP@H5O_PROVISIONAL_mp_H5OGET_INFO_F +@H5_NOF03EXP@H5O_PROVISIONAL_mp_H5OVISIT_BY_NAME_F +@H5_NOF03EXP@H5O_PROVISIONAL_mp_H5OVISIT_F +; H5P +H5P_mp_H5PCREATE_F +H5P_mp_H5PSET_PRESERVE_F +H5P_mp_H5PGET_PRESERVE_F +H5P_mp_H5PGET_CLASS_F +H5P_mp_H5PCOPY_F +H5P_mp_H5PCLOSE_F +H5P_mp_H5PSET_CHUNK_F +H5P_mp_H5PGET_CHUNK_F +H5P_mp_H5PSET_DEFLATE_F +H5P_PROVISIONAL_mp_H5PSET_FILL_VALUE_INTEGER +H5P_PROVISIONAL_mp_H5PGET_FILL_VALUE_INTEGER +H5P_PROVISIONAL_mp_H5PSET_FILL_VALUE_REAL +H5P_PROVISIONAL_mp_H5PGET_FILL_VALUE_REAL +H5P_PROVISIONAL_mp_H5PSET_FILL_VALUE_CHAR +H5P_PROVISIONAL_mp_H5PGET_FILL_VALUE_CHAR +H5P_mp_H5PGET_VERSION_F +H5P_mp_H5PSET_USERBLOCK_F +H5P_mp_H5PGET_USERBLOCK_F +H5P_mp_H5PSET_SIZES_F +H5P_mp_H5PGET_SIZES_F +H5P_mp_H5PSET_SYM_K_F +H5P_mp_H5PGET_SYM_K_F +H5P_mp_H5PSET_ISTORE_K_F +H5P_mp_H5PGET_ISTORE_K_F +H5P_mp_H5PGET_DRIVER_F +H5P_mp_H5PSET_FAPL_STDIO_F +H5P_mp_H5PSET_FAPL_SEC2_F +H5P_mp_H5PSET_ALIGNMENT_F +H5P_mp_H5PGET_ALIGNMENT_F +H5P_mp_H5PSET_FAPL_CORE_F +H5P_mp_H5PGET_FAPL_CORE_F +H5P_mp_H5PSET_FAPL_FAMILY_F +H5P_mp_H5PGET_FAPL_FAMILY_F +H5P_mp_H5PSET_CACHE_F +H5P_mp_H5PGET_CACHE_F +H5P_mp_H5PSET_FAPL_SPLIT_F +H5P_mp_H5PSET_GC_REFERENCES_F +H5P_mp_H5PGET_GC_REFERENCES_F +H5P_mp_H5PSET_LAYOUT_F +H5P_mp_H5PGET_LAYOUT_F +H5P_mp_H5PSET_FILTER_F +H5P_mp_H5PGET_NFILTERS_F +H5P_mp_H5PGET_FILTER_F +H5P_mp_H5PSET_EXTERNAL_F +H5P_mp_H5PGET_EXTERNAL_COUNT_F +H5P_mp_H5PGET_EXTERNAL_F +H5P_mp_H5PSET_BTREE_RATIOS_F +H5P_mp_H5PGET_BTREE_RATIOS_F +H5P_mp_H5PGET_FCLOSE_DEGREE_F +H5P_mp_H5PSET_FCLOSE_DEGREE_F +H5P_mp_H5PEQUAL_F +H5P_mp_H5PSET_BUFFER_F +H5P_mp_H5PGET_BUFFER_F +H5P_mp_H5PFILL_VALUE_DEFINED_F +H5P_mp_H5PSET_ALLOC_TIME_F +H5P_mp_H5PGET_ALLOC_TIME_F +H5P_mp_H5PSET_FILL_TIME_F +H5P_mp_H5PGET_FILL_TIME_F +H5P_mp_H5PSET_META_BLOCK_SIZE_F +H5P_mp_H5PGET_META_BLOCK_SIZE_F +H5P_mp_H5PSET_SIEVE_BUF_SIZE_F +H5P_mp_H5PGET_SIEVE_BUF_SIZE_F +H5P_mp_H5PSET_SMALL_DATA_BLOCK_SIZE_F +H5P_mp_H5PGET_SMALL_DATA_BLOCK_SIZE_F +H5P_mp_H5PSET_HYPER_VECTOR_SIZE_F +H5P_mp_H5PGET_HYPER_VECTOR_SIZE_F +H5P_PROVISIONAL_mp_H5PSET_INTEGER +H5P_PROVISIONAL_mp_H5PSET_REAL +H5P_PROVISIONAL_mp_H5PSET_CHAR +H5P_PROVISIONAL_mp_H5PGET_INTEGER +H5P_PROVISIONAL_mp_H5PGET_REAL +H5P_PROVISIONAL_mp_H5PGET_CHAR +H5P_mp_H5PEXIST_F +H5P_mp_H5PGET_SIZE_F +H5P_mp_H5PGET_NPROPS_F +H5P_mp_H5PGET_CLASS_NAME_F +H5P_mp_H5PGET_CLASS_PARENT_F +H5P_mp_H5PISA_CLASS_F +H5P_mp_H5PCOPY_PROP_F +H5P_mp_H5PREMOVE_F +H5P_mp_H5PUNREGISTER_F +H5P_mp_H5PCLOSE_CLASS_F +H5P_PROVISIONAL_mp_H5PCREATE_CLASS_F +H5P_PROVISIONAL_mp_H5PREGISTER_INTEGER +H5P_PROVISIONAL_mp_H5PREGISTER_REAL +H5P_PROVISIONAL_mp_H5PREGISTER_CHAR +H5P_PROVISIONAL_mp_H5PINSERT_INTEGER +H5P_PROVISIONAL_mp_H5PINSERT_REAL +H5P_PROVISIONAL_mp_H5PINSERT_CHAR +H5P_mp_H5PSET_SHUFFLE_F +H5P_mp_H5PSET_EDC_CHECK_F +H5P_mp_H5PGET_EDC_CHECK_F +H5P_mp_H5PSET_FLETCHER32_F +H5P_mp_H5PSET_FAMILY_OFFSET_F +H5P_mp_H5PSET_FAPL_MULTI_L +H5P_mp_H5PSET_FAPL_MULTI_S +H5P_mp_H5PGET_FAPL_MULTI_F +H5P_mp_H5PSET_SZIP_F +H5P_mp_H5PALL_FILTERS_AVAIL_F +H5P_mp_H5PGET_FILTER_BY_ID_F +H5P_mp_H5PMODIFY_FILTER_F +H5P_mp_H5PREMOVE_FILTER_F +H5P_mp_H5PGET_ATTR_PHASE_CHANGE_F +H5P_mp_H5PSET_ATTR_CREATION_ORDER_F +H5P_mp_H5PSET_SHARED_MESG_NINDEXES_F +H5P_mp_H5PSET_SHARED_MESG_INDEX_F +H5P_mp_H5PGET_ATTR_CREATION_ORDER_F +H5P_mp_H5PSET_LIBVER_BOUNDS_F +H5P_mp_H5PSET_LINK_CREATION_ORDER_F +H5P_mp_H5PGET_LINK_PHASE_CHANGE_F +H5P_mp_H5PGET_OBJ_TRACK_TIMES_F +H5P_mp_H5PSET_OBJ_TRACK_TIMES_F +H5P_mp_H5PSET_CREATE_INTER_GROUP_F +H5P_mp_H5PGET_LINK_CREATION_ORDER_F +H5P_mp_H5PSET_CHAR_ENCODING_F +H5P_mp_H5PGET_CHAR_ENCODING_F +H5P_mp_H5PSET_COPY_OBJECT_F +H5P_mp_H5PGET_COPY_OBJECT_F +H5P_mp_H5PGET_DATA_TRANSFORM_F +H5P_mp_H5PSET_DATA_TRANSFORM_F +H5P_mp_H5PGET_LOCAL_HEAP_SIZE_HINT_F +H5P_mp_H5PGET_EST_LINK_INFO_F +H5P_mp_H5PSET_LOCAL_HEAP_SIZE_HINT_F +H5P_mp_H5PSET_EST_LINK_INFO_F +H5P_mp_H5PSET_LINK_PHASE_CHANGE_F +H5P_mp_H5PSET_FAPL_DIRECT_F +H5P_mp_H5PGET_FAPL_DIRECT_F +H5P_mp_H5PSET_ATTR_PHASE_CHANGE_F +H5P_mp_H5PSET_NBIT_F +H5P_mp_H5PSET_SCALEOFFSET_F +H5P_mp_H5PSET_NLINKS_F +H5P_mp_H5PGET_NLINKS_F +H5P_mp_H5PGET_CREATE_INTER_GROUP_F +H5P_mp_H5PSET_CHUNK_CACHE_F +H5P_mp_H5PGET_CHUNK_CACHE_F +@H5_NOF03EXP@H5P_PROVISIONAL_mp_H5PSET_FILL_VALUE_PTR +@H5_NOF03EXP@H5P_PROVISIONAL_mp_H5PGET_FILL_VALUE_PTR +@H5_NOF03EXP@H5P_PROVISIONAL_mp_H5PSET_PTR +@H5_NOF03EXP@H5P_PROVISIONAL_mp_H5PGET_PTR +@H5_NOF03EXP@H5P_PROVISIONAL_mp_H5PREGISTER_PTR +@H5_NOF03EXP@H5P_PROVISIONAL_mp_H5PINSERT_PTR +; H5R +H5R_PROVISIONAL_mp_H5RCREATE_OBJECT_F +H5R_PROVISIONAL_mp_H5RCREATE_REGION_F +H5R_PROVISIONAL_mp_H5RDEREFERENCE_OBJECT_F +H5R_PROVISIONAL_mp_H5RDEREFERENCE_REGION_F +H5R_PROVISIONAL_mp_H5RGET_REGION_REGION_F +H5R_mp_H5RGET_OBJECT_TYPE_OBJ_F +H5R_PROVISIONAL_mp_H5RGET_NAME_OBJECT_F +H5R_PROVISIONAL_mp_H5RGET_NAME_REGION_F +@H5_NOF03EXP@H5R_PROVISIONAL_mp_H5RGET_REGION_PTR_F +@H5_NOF03EXP@H5R_PROVISIONAL_mp_H5RCREATE_PTR_F +@H5_NOF03EXP@H5R_PROVISIONAL_mp_H5RDEREFERENCE_PTR_F +@H5_NOF03EXP@H5R_PROVISIONAL_mp_H5RGET_NAME_PTR_F +@H5_NOF03EXP@H5R_PROVISIONAL_mp_H5RGET_OBJ_TYPE_F +; H5S +H5S_mp_H5SCREATE_SIMPLE_F +H5S_mp_H5SCLOSE_F +H5S_mp_H5SCREATE_F +H5S_mp_H5SCOPY_F +H5S_mp_H5SGET_SELECT_HYPER_NBLOCKS_F +H5S_mp_H5SGET_SELECT_HYPER_BLOCKLIST_F +H5S_mp_H5SGET_SELECT_BOUNDS_F +H5S_mp_H5SGET_SELECT_ELEM_NPOINTS_F +H5S_mp_H5SGET_SELECT_ELEM_POINTLIST_F +H5S_mp_H5SSELECT_ELEMENTS_F +H5S_mp_H5SSELECT_ALL_F +H5S_mp_H5SSELECT_NONE_F +H5S_mp_H5SSELECT_VALID_F +H5S_mp_H5SGET_SIMPLE_EXTENT_NPOINTS_F +H5S_mp_H5SGET_SELECT_NPOINTS_F +H5S_mp_H5SGET_SIMPLE_EXTENT_NDIMS_F +H5S_mp_H5SGET_SIMPLE_EXTENT_DIMS_F +H5S_mp_H5SGET_SIMPLE_EXTENT_TYPE_F +H5S_mp_H5SSET_EXTENT_SIMPLE_F +H5S_mp_H5SIS_SIMPLE_F +H5S_mp_H5SOFFSET_SIMPLE_F +H5S_mp_H5SEXTENT_COPY_F +H5S_mp_H5SSET_EXTENT_NONE_F +H5S_mp_H5SSELECT_HYPERSLAB_F +H5S_mp_H5SGET_SELECT_TYPE_F +H5S_mp_H5SDECODE_F +H5S_mp_H5SENCODE_F +H5S_mp_H5SEXTENT_EQUAL_F +; H5T +H5T_mp_H5TOPEN_F +H5T_mp_H5TCOMMIT_F +H5T_mp_H5TCOPY_F +H5T_mp_H5TEQUAL_F +H5T_mp_H5TCLOSE_F +H5T_mp_H5TGET_CLASS_F +H5T_mp_H5TGET_SIZE_F +H5T_mp_H5TSET_SIZE_F +H5T_mp_H5TGET_ORDER_F +H5T_mp_H5TSET_ORDER_F +H5T_mp_H5TGET_PRECISION_F +H5T_mp_H5TSET_PRECISION_F +H5T_mp_H5TGET_OFFSET_F +H5T_mp_H5TSET_OFFSET_F +H5T_mp_H5TGET_PAD_F +H5T_mp_H5TSET_PAD_F +H5T_mp_H5TGET_SIGN_F +H5T_mp_H5TSET_SIGN_F +H5T_mp_H5TGET_FIELDS_F +H5T_mp_H5TSET_FIELDS_F +H5T_mp_H5TGET_EBIAS_F +H5T_mp_H5TSET_EBIAS_F +H5T_mp_H5TGET_NORM_F +H5T_mp_H5TSET_NORM_F +H5T_mp_H5TGET_INPAD_F +H5T_mp_H5TSET_INPAD_F +H5T_mp_H5TGET_CSET_F +H5T_mp_H5TSET_CSET_F +H5T_mp_H5TGET_STRPAD_F +H5T_mp_H5TSET_STRPAD_F +H5T_mp_H5TGET_NMEMBERS_F +H5T_mp_H5TGET_MEMBER_NAME_F +H5T_mp_H5TGET_MEMBER_OFFSET_F +H5T_mp_H5TGET_MEMBER_INDEX_F +H5T_mp_H5TGET_ARRAY_DIMS_F +H5T_mp_H5TGET_ARRAY_NDIMS_F +H5T_mp_H5TGET_SUPER_F +H5T_mp_H5TGET_MEMBER_TYPE_F +H5T_mp_H5TCREATE_F +H5T_mp_H5TINSERT_F +H5T_mp_H5TPACK_F +H5T_mp_H5TARRAY_CREATE_F +H5T_mp_H5TENUM_CREATE_F +H5T_mp_H5TENUM_INSERT_F +H5T_mp_H5TENUM_NAMEOF_F +H5T_mp_H5TENUM_VALUEOF_F +H5T_mp_H5TGET_MEMBER_VALUE_F +H5T_mp_H5TSET_TAG_F +H5T_mp_H5TGET_TAG_F +H5T_mp_H5TVLEN_CREATE_F +H5T_mp_H5TIS_VARIABLE_STR_F +H5T_mp_H5TGET_MEMBER_CLASS_F +H5T_mp_H5TCOMMIT_ANON_F +H5T_mp_H5TCOMMITTED_F +H5T_mp_H5TDECODE_F +H5T_mp_H5TENCODE_F +H5T_mp_H5TGET_CREATE_PLIST_F +H5T_mp_H5TCOMPILER_CONV_F +H5T_mp_H5TGET_NATIVE_TYPE_F +@H5_NOF03EXP@H5T_PROVISIONAL_mp_H5TCONVERT_F +; H5Z +H5Z_mp_H5ZUNREGISTER_F +H5Z_mp_H5ZFILTER_AVAIL_F +H5Z_mp_H5ZGET_FILTER_INFO_F +; Parallel +@H5_NOPAREXP@H5FDMPIO_mp_H5PSET_FAPL_MPIO_F +@H5_NOPAREXP@H5FDMPIO_mp_H5PGET_FAPL_MPIO_F +@H5_NOPAREXP@H5FDMPIO_mp_H5PSET_DXPL_MPIO_F +@H5_NOPAREXP@H5FDMPIO_mp_H5PGET_DXPL_MPIO_F +@H5_NOPAREXP@H5FDMPIO_mp_H5PSET_FAPL_MPIPOSIX_F +@H5_NOPAREXP@H5FDMPIO_mp_H5PGET_FAPL_MPIPOSIX_F +@H5_NOPAREXP@H5FDMPIO_mp_H5PGET_MPIO_ACTUAL_IO_MODE_F diff --git a/perform/sio_timer.c b/perform/sio_timer.c index f233de3..4e42ee6 100644 --- a/perform/sio_timer.c +++ b/perform/sio_timer.c @@ -1,197 +1,197 @@ -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- * Copyright by The HDF Group. *
- * All rights reserved. *
- * *
- * This file is part of HDF5. The full HDF5 copyright notice, including *
- * terms governing use, modification, and redistribution, is contained in *
- * the files COPYING and Copyright.html. COPYING can be found at the root *
- * of the source code distribution tree; Copyright.html can be found at the *
- * root level of an installed copy of the electronic HDF5 document set and *
- * is linked from the top-level documents page. It can also be found at *
- * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have *
- * access to either file, you may request a copy from help@hdfgroup.org. *
- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-
-/*
- * Purpose:
- *
- * This is a module of useful timing functions for performance testing.
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-
-#include "sio_timer.h"
-
-
-#include "sio_perf.h"
-
-/*
- * The number to divide the tv_usec field with to get a nice decimal to add to
- * the number of seconds.
- */
-#define MICROSECOND 1000000.0
-
-/* global variables */
-sio_time *timer_g; /* timer: global for stub functions */
-
-/*
- * Function: sub_time
- * Purpose: Struct two time values, and return the difference, in microseconds
- *
- * Note that the function assumes that a > b
- * Programmer: Leon Arber, 1/27/06
- */
-static double sub_time(struct timeval* a, struct timeval* b)
-{
- return (((double)a->tv_sec +
- ((double)a->tv_usec) / MICROSECOND) -
- ((double)b->tv_sec +
- ((double)b->tv_usec) / MICROSECOND));
-}
-
-
-/*
- * Function: sio_time_new
- * Purpose: Build us a brand, spankin', new performance time object.
- * The object is a black box to the user.
- * Return: Pointer to sio_time object
- * Programmer: Bill Wendling, 01. October 2001
- * Modifications:
- */
-sio_time *
-sio_time_new(void)
-{
- sio_time *pt = (sio_time *)calloc(1, sizeof(struct sio_time_));
-
- /* set global timer variable */
- timer_g = pt;
-
- return pt;
-}
-
-/*
- * Function: sio_time_destroy
- * Purpose: Remove the memory allocated for the sio_time object. Only
- * need to call on a pointer allocated with the ``sio_time_new''
- * function.
- * Return: Nothing
- * Programmer: Bill Wendling, 01. October 2001
- * Modifications:
- */
-void
-sio_time_destroy(sio_time *pt)
-{
- HDfree(pt);
- /* reset the global timer pointer too. */
- timer_g = NULL;
-}
-
-
-
-/*
- * Function: set_time
- * Purpose: Set the time in a ``sio_time'' object.
- * Return: Pointer to the passed in ``sio_time'' object.
- * Programmer: Bill Wendling, 01. October 2001
- * Modifications:
- */
-sio_time *
-set_time(sio_time *pt, timer_type t, int start_stop)
-{
- if (pt) {
- if (start_stop == TSTART) {
- HDgettimeofday(&pt->sys_timer[t], NULL);
-
- /* When we start the timer for HDF5_FINE_WRITE_FIXED_DIMS or HDF5_FINE_READ_FIXED_DIMS
- * we compute the time it took to only open the file */
- if(t == HDF5_FINE_WRITE_FIXED_DIMS)
- pt->total_time[HDF5_FILE_WRITE_OPEN] += sub_time(&(pt->sys_timer[t]), &(pt->sys_timer[HDF5_GROSS_WRITE_FIXED_DIMS]));
- else if(t == HDF5_FINE_READ_FIXED_DIMS)
- pt->total_time[HDF5_FILE_READ_OPEN] += sub_time(&(pt->sys_timer[t]), &(pt->sys_timer[HDF5_GROSS_READ_FIXED_DIMS]));
-
-
- } else {
- struct timeval sys_t;
-
- HDgettimeofday(&sys_t, NULL);
- pt->total_time[t] += sub_time(&sys_t, &(pt->sys_timer[t]));
-
-/* ((double)sys_t.tv_sec +
- ((double)sys_t.tv_usec) / MICROSECOND) -
- ((double)pt->sys_timer[t].tv_sec +
- ((double)pt->sys_timer[t].tv_usec) / MICROSECOND);*/
-
- /* When we stop the timer for HDF5_GROSS_WRITE_FIXED_DIMS or HDF5_GROSS_READ_FIXED_DIMS
- * we compute the time it took to close the file after the last read/write finished */
- if(t == HDF5_GROSS_WRITE_FIXED_DIMS)
- pt->total_time[HDF5_FILE_WRITE_CLOSE] += sub_time(&(pt->sys_timer[t]), &(pt->sys_timer[HDF5_FINE_WRITE_FIXED_DIMS]));
- else if(t == HDF5_GROSS_READ_FIXED_DIMS)
- pt->total_time[HDF5_FILE_READ_CLOSE] += sub_time(&(pt->sys_timer[t]), &(pt->sys_timer[HDF5_FINE_READ_FIXED_DIMS]));
-
- }
-
- if (sio_debug_level >= 4) {
- const char *msg;
-
- switch (t) {
- case HDF5_FILE_OPENCLOSE:
- msg = "File Open/Close";
- break;
- case HDF5_DATASET_CREATE:
- msg = "Dataset Create";
- break;
- case HDF5_MPI_WRITE:
- msg = "MPI Write";
- break;
- case HDF5_MPI_READ:
- msg = "MPI Read";
- break;
- case HDF5_FINE_WRITE_FIXED_DIMS:
- msg = "Fine Write";
- break;
- case HDF5_FINE_READ_FIXED_DIMS:
- msg = "Fine Read";
- break;
- case HDF5_GROSS_WRITE_FIXED_DIMS:
- msg = "Gross Write";
- break;
- case HDF5_GROSS_READ_FIXED_DIMS:
- msg = "Gross Read";
- break;
- case HDF5_RAW_WRITE_FIXED_DIMS:
- msg = "Raw Write";
- break;
- case HDF5_RAW_READ_FIXED_DIMS:
- msg = "Raw Read";
- break;
- default:
- msg = "Unknown Timer";
- break;
- }
-
- fprintf(output, " %s %s: %.2f\n", msg,
- (start_stop == TSTART ? "Start" : "Stop"),
- pt->total_time[t]);
- }
- }
-
- return pt;
-}
-
-/*
- * Function: get_time
- * Purpose: Get the time from a ``sio_time'' object.
- * Return: The number of seconds as a DOUBLE.
- * Programmer: Bill Wendling, 01. October 2001
- * Modifications:
- */
-double
-get_time(sio_time *pt, timer_type t)
-{
- return pt->total_time[t];
-}
-#ifdef STANDALONE
-#include "sio_standalone.c"
-#endif
-
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by The HDF Group. * + * All rights reserved. * + * * + * This file is part of HDF5. The full HDF5 copyright notice, including * + * terms governing use, modification, and redistribution, is contained in * + * the files COPYING and Copyright.html. COPYING can be found at the root * + * of the source code distribution tree; Copyright.html can be found at the * + * root level of an installed copy of the electronic HDF5 document set and * + * is linked from the top-level documents page. It can also be found at * + * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * + * access to either file, you may request a copy from help@hdfgroup.org. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* + * Purpose: + * + * This is a module of useful timing functions for performance testing. + */ + +#include <stdio.h> +#include <stdlib.h> + +#include "sio_timer.h" + + +#include "sio_perf.h" + +/* + * The number to divide the tv_usec field with to get a nice decimal to add to + * the number of seconds. + */ +#define MICROSECOND 1000000.0 + +/* global variables */ +sio_time *timer_g; /* timer: global for stub functions */ + +/* + * Function: sub_time + * Purpose: Struct two time values, and return the difference, in microseconds + * + * Note that the function assumes that a > b + * Programmer: Leon Arber, 1/27/06 + */ +static double sub_time(struct timeval* a, struct timeval* b) +{ + return (((double)a->tv_sec + + ((double)a->tv_usec) / MICROSECOND) - + ((double)b->tv_sec + + ((double)b->tv_usec) / MICROSECOND)); +} + + +/* + * Function: sio_time_new + * Purpose: Build us a brand, spankin', new performance time object. + * The object is a black box to the user. + * Return: Pointer to sio_time object + * Programmer: Bill Wendling, 01. October 2001 + * Modifications: + */ +sio_time * +sio_time_new(void) +{ + sio_time *pt = (sio_time *)calloc(1, sizeof(struct sio_time_)); + + /* set global timer variable */ + timer_g = pt; + + return pt; +} + +/* + * Function: sio_time_destroy + * Purpose: Remove the memory allocated for the sio_time object. Only + * need to call on a pointer allocated with the ``sio_time_new'' + * function. + * Return: Nothing + * Programmer: Bill Wendling, 01. October 2001 + * Modifications: + */ +void +sio_time_destroy(sio_time *pt) +{ + HDfree(pt); + /* reset the global timer pointer too. */ + timer_g = NULL; +} + + + +/* + * Function: set_time + * Purpose: Set the time in a ``sio_time'' object. + * Return: Pointer to the passed in ``sio_time'' object. + * Programmer: Bill Wendling, 01. October 2001 + * Modifications: + */ +sio_time * +set_time(sio_time *pt, timer_type t, int start_stop) +{ + if (pt) { + if (start_stop == TSTART) { + HDgettimeofday(&pt->sys_timer[t], NULL); + + /* When we start the timer for HDF5_FINE_WRITE_FIXED_DIMS or HDF5_FINE_READ_FIXED_DIMS + * we compute the time it took to only open the file */ + if(t == HDF5_FINE_WRITE_FIXED_DIMS) + pt->total_time[HDF5_FILE_WRITE_OPEN] += sub_time(&(pt->sys_timer[t]), &(pt->sys_timer[HDF5_GROSS_WRITE_FIXED_DIMS])); + else if(t == HDF5_FINE_READ_FIXED_DIMS) + pt->total_time[HDF5_FILE_READ_OPEN] += sub_time(&(pt->sys_timer[t]), &(pt->sys_timer[HDF5_GROSS_READ_FIXED_DIMS])); + + + } else { + struct timeval sys_t; + + HDgettimeofday(&sys_t, NULL); + pt->total_time[t] += sub_time(&sys_t, &(pt->sys_timer[t])); + +/* ((double)sys_t.tv_sec + + ((double)sys_t.tv_usec) / MICROSECOND) - + ((double)pt->sys_timer[t].tv_sec + + ((double)pt->sys_timer[t].tv_usec) / MICROSECOND);*/ + + /* When we stop the timer for HDF5_GROSS_WRITE_FIXED_DIMS or HDF5_GROSS_READ_FIXED_DIMS + * we compute the time it took to close the file after the last read/write finished */ + if(t == HDF5_GROSS_WRITE_FIXED_DIMS) + pt->total_time[HDF5_FILE_WRITE_CLOSE] += sub_time(&(pt->sys_timer[t]), &(pt->sys_timer[HDF5_FINE_WRITE_FIXED_DIMS])); + else if(t == HDF5_GROSS_READ_FIXED_DIMS) + pt->total_time[HDF5_FILE_READ_CLOSE] += sub_time(&(pt->sys_timer[t]), &(pt->sys_timer[HDF5_FINE_READ_FIXED_DIMS])); + + } + + if (sio_debug_level >= 4) { + const char *msg; + + switch (t) { + case HDF5_FILE_OPENCLOSE: + msg = "File Open/Close"; + break; + case HDF5_DATASET_CREATE: + msg = "Dataset Create"; + break; + case HDF5_MPI_WRITE: + msg = "MPI Write"; + break; + case HDF5_MPI_READ: + msg = "MPI Read"; + break; + case HDF5_FINE_WRITE_FIXED_DIMS: + msg = "Fine Write"; + break; + case HDF5_FINE_READ_FIXED_DIMS: + msg = "Fine Read"; + break; + case HDF5_GROSS_WRITE_FIXED_DIMS: + msg = "Gross Write"; + break; + case HDF5_GROSS_READ_FIXED_DIMS: + msg = "Gross Read"; + break; + case HDF5_RAW_WRITE_FIXED_DIMS: + msg = "Raw Write"; + break; + case HDF5_RAW_READ_FIXED_DIMS: + msg = "Raw Read"; + break; + default: + msg = "Unknown Timer"; + break; + } + + fprintf(output, " %s %s: %.2f\n", msg, + (start_stop == TSTART ? "Start" : "Stop"), + pt->total_time[t]); + } + } + + return pt; +} + +/* + * Function: get_time + * Purpose: Get the time from a ``sio_time'' object. + * Return: The number of seconds as a DOUBLE. + * Programmer: Bill Wendling, 01. October 2001 + * Modifications: + */ +double +get_time(sio_time *pt, timer_type t) +{ + return pt->total_time[t]; +} +#ifdef STANDALONE +#include "sio_standalone.c" +#endif + diff --git a/release_docs/USING_CMake_Examples.txt b/release_docs/USING_CMake_Examples.txt index 4dae021..a8db864 100644 --- a/release_docs/USING_CMake_Examples.txt +++ b/release_docs/USING_CMake_Examples.txt @@ -1,81 +1,81 @@ -************************************************************************
-* Build and Test HDF5 Examples with CMake *
-************************************************************************
-
-Notes: This short instruction is written for users who want to quickly
- test the installation of HDF5 by using the CMake tools to build
- and test the HDF5 Examples. The following instructions will show
- the default usage and then present common changes for non-default
- installations.
- For more information, see the USING_HDF5_CMake.txt file.
-
- More information about using CMake can be found at the KitWare
- site, www.cmake.org.
-
- CMake uses the command line and these instructions use the script
- method of the ctest command.
-
-
-========================================================================
-I. Preconditions
-========================================================================
-
- 1. We suggest you obtain the latest CMake for windows from the Kitware
- web site. The HDF5 1.8.x product requires a minimum CMake version
- of 2.8.10.
-
- 2. You have installed the HDF5 library built with CMake, by executing
- the HDF Install Utility (the *.exe file in the binary package for
- Windows or the *.sh on Linux). If you are using a Windows platform,
- you can obtain a pre-built Windows binary from The HDF Group's website
- at www.hdfgroup.org. See Section "III. Common changes to the
- HDF518_Examples.cmake file", for the line to change the location.
-
- 3. On Windows, you have installed the 7Zip package. See Section "III.
- Common changes to the HDF518_Examples.cmake file", for the line to
- change the command.
-
-
-
-========================================================================
-II. Building HDF5 Examples with CMake
-========================================================================
-
-Files in the HDF5 install directory:
- HDF5Examples-0.1.1-Source.zip (or HDF5Examples-0.1.1-Source.tar.gz)
- HDF518_Examples.cmake
-
-Default installation process:
- Create a directory to run the examples, i.e. \test_hdf5.
- Copy HDF5Examples-0.1.1-Source.zip(.tar.gz) to this directory, do NOT unzip.
- Copy HDF518_Examples.cmake to this directory.
- Edit line 8 of the HDF518_Examples.cmake file and change the INSTALLDIR
- to the HDF5 install location.
-
- Execute from this directory:
- ctest -S HDF518_Examples.cmake,HDF5Examples-0.1.1-Source -C Release -O test.log
-
-The script will uncompress the examples file HDF5Examples-0.1.1-Source.zip(.tar.gz),
- and create a build directory inside the HDF5Examples-0.1.1-Source directory.
- It will then configure, build, and execute the examples. All the log files
- will be found under the build\Testing\Temporary directory, check these for
- errors.
-
-The amount of script information can be increased by adding -V to the ctest
- command. Even more information can be shown by adding -VV instead of -V.
-
-
-========================================================================
-III. Common changes to the HDF518_Examples.cmake file
-========================================================================
-
-Line 8: change the INSTALLDIR to a different HDF5 install location.
-
-Line 14: uncomment to allow Mac machines to build shared examples.
-
-Line 15: uncomment to not build and test Fortran examples.
-
-Line 16: uncomment to build and test Fortran examples with F2003 option.
-
-Line 68: change the CTEST_7Z_COMMAND to a different unzip program.
-
+************************************************************************ +* Build and Test HDF5 Examples with CMake * +************************************************************************ + +Notes: This short instruction is written for users who want to quickly + test the installation of HDF5 by using the CMake tools to build + and test the HDF5 Examples. The following instructions will show + the default usage and then present common changes for non-default + installations. + For more information, see the USING_HDF5_CMake.txt file. + + More information about using CMake can be found at the KitWare + site, www.cmake.org. + + CMake uses the command line and these instructions use the script + method of the ctest command. + + +======================================================================== +I. Preconditions +======================================================================== + + 1. We suggest you obtain the latest CMake for windows from the Kitware + web site. The HDF5 1.8.x product requires a minimum CMake version + of 2.8.10. + + 2. You have installed the HDF5 library built with CMake, by executing + the HDF Install Utility (the *.exe file in the binary package for + Windows or the *.sh on Linux). If you are using a Windows platform, + you can obtain a pre-built Windows binary from The HDF Group's website + at www.hdfgroup.org. See Section "III. Common changes to the + HDF518_Examples.cmake file", for the line to change the location. + + 3. On Windows, you have installed the 7Zip package. See Section "III. + Common changes to the HDF518_Examples.cmake file", for the line to + change the command. + + + +======================================================================== +II. Building HDF5 Examples with CMake +======================================================================== + +Files in the HDF5 install directory: + HDF5Examples-0.1.1-Source.zip (or HDF5Examples-0.1.1-Source.tar.gz) + HDF518_Examples.cmake + +Default installation process: + Create a directory to run the examples, i.e. \test_hdf5. + Copy HDF5Examples-0.1.1-Source.zip(.tar.gz) to this directory, do NOT unzip. + Copy HDF518_Examples.cmake to this directory. + Edit line 8 of the HDF518_Examples.cmake file and change the INSTALLDIR + to the HDF5 install location. + + Execute from this directory: + ctest -S HDF518_Examples.cmake,HDF5Examples-0.1.1-Source -C Release -O test.log + +The script will uncompress the examples file HDF5Examples-0.1.1-Source.zip(.tar.gz), + and create a build directory inside the HDF5Examples-0.1.1-Source directory. + It will then configure, build, and execute the examples. All the log files + will be found under the build\Testing\Temporary directory, check these for + errors. + +The amount of script information can be increased by adding -V to the ctest + command. Even more information can be shown by adding -VV instead of -V. + + +======================================================================== +III. Common changes to the HDF518_Examples.cmake file +======================================================================== + +Line 8: change the INSTALLDIR to a different HDF5 install location. + +Line 14: uncomment to allow Mac machines to build shared examples. + +Line 15: uncomment to not build and test Fortran examples. + +Line 16: uncomment to build and test Fortran examples with F2003 option. + +Line 68: change the CTEST_7Z_COMMAND to a different unzip program. + diff --git a/src/H5FAint.c b/src/H5FAint.c index b42b3ae..b42b3ae 100755..100644 --- a/src/H5FAint.c +++ b/src/H5FAint.c diff --git a/src/H5FSint.c b/src/H5FSint.c index 4d34490..43c3b83 100755..100644 --- a/src/H5FSint.c +++ b/src/H5FSint.c @@ -1,145 +1,145 @@ -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- * Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
- * All rights reserved. *
- * *
- * This file is part of HDF5. The full HDF5 copyright notice, including *
- * terms governing use, modification, and redistribution, is contained in *
- * the files COPYING and Copyright.html. COPYING can be found at the root *
- * of the source code distribution tree; Copyright.html can be found at the *
- * root level of an installed copy of the electronic HDF5 document set and *
- * is linked from the top-level documents page. It can also be found at *
- * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have *
- * access to either file, you may request a copy from help@hdfgroup.org. *
- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-
-/*-------------------------------------------------------------------------
- *
- * Created: H5FSint.c
- * Fall 2012
- * Dana Robinson <derobins@hdfgroup.org>
- *
- * Purpose: Internal routines for free space managers.
- *
- *-------------------------------------------------------------------------
- */
-
-/**********************/
-/* Module Declaration */
-/**********************/
-
-#define H5FS_PACKAGE
-
-
-/***********************/
-/* Other Packages Used */
-/***********************/
-
-
-/***********/
-/* Headers */
-/***********/
-#include "H5private.h" /* Generic Functions */
-#include "H5Eprivate.h" /* Error Handling */
-#include "H5FSpkg.h" /* Free Space Managers */
-
-
-/****************/
-/* Local Macros */
-/****************/
-
-
-/******************/
-/* Local Typedefs */
-/******************/
-
-
-/********************/
-/* Package Typedefs */
-/********************/
-
-
-/********************/
-/* Local Prototypes */
-/********************/
-
-
-/*********************/
-/* Package Variables */
-/*********************/
-
-
-/*****************************/
-/* Library Private Variables */
-/*****************************/
-
-
-/*******************/
-/* Local Variables */
-/*******************/
-
-
-
-/*-------------------------------------------------------------------------
- * Function: H5FS__create_flush_depend
- *
- * Purpose: Create a flush dependency between two data structure components
- *
- * Return: SUCCEED/FAIL
- *
- * Programmer: Dana Robinson
- * Fall 2012
- *
- *-------------------------------------------------------------------------
- */
-herr_t
-H5FS__create_flush_depend(H5AC_info_t *parent_entry, H5AC_info_t *child_entry)
-{
- herr_t ret_value = SUCCEED; /* Return value */
-
- FUNC_ENTER_NOAPI_NOINIT
-
- /* Sanity check */
- HDassert(parent_entry);
- HDassert(child_entry);
-
- /* Create a flush dependency between parent and child entry */
- if(H5AC_create_flush_dependency(parent_entry, child_entry) < 0)
- HGOTO_ERROR(H5E_FSPACE, H5E_CANTDEPEND, FAIL, "unable to create flush dependency")
-
-done:
- FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5FS__create_flush_depend() */
-
-
-/*-------------------------------------------------------------------------
- * Function: H5FS__destroy_flush_depend
- *
- * Purpose: Destroy a flush dependency between two data structure components
- *
- * Return: SUCCEED/FAIL
- *
- * Programmer: Dana Robinson
- * Fall 2012
- *
- *-------------------------------------------------------------------------
- */
-herr_t
-H5FS__destroy_flush_depend(H5AC_info_t *parent_entry, H5AC_info_t *child_entry)
-{
- herr_t ret_value = SUCCEED; /* Return value */
-
- FUNC_ENTER_NOAPI_NOINIT
-
- /* Sanity check */
- HDassert(parent_entry);
- HDassert(child_entry);
-
- /* Destroy a flush dependency between parent and child entry */
- if(H5AC_destroy_flush_dependency(parent_entry, child_entry) < 0)
- HGOTO_ERROR(H5E_FSPACE, H5E_CANTUNDEPEND, FAIL, "unable to destroy flush dependency")
-
-done:
- FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5FS__destroy_flush_depend() */
-
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by The HDF Group. * + * Copyright by the Board of Trustees of the University of Illinois. * + * All rights reserved. * + * * + * This file is part of HDF5. The full HDF5 copyright notice, including * + * terms governing use, modification, and redistribution, is contained in * + * the files COPYING and Copyright.html. COPYING can be found at the root * + * of the source code distribution tree; Copyright.html can be found at the * + * root level of an installed copy of the electronic HDF5 document set and * + * is linked from the top-level documents page. It can also be found at * + * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * + * access to either file, you may request a copy from help@hdfgroup.org. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/*------------------------------------------------------------------------- + * + * Created: H5FSint.c + * Fall 2012 + * Dana Robinson <derobins@hdfgroup.org> + * + * Purpose: Internal routines for free space managers. + * + *------------------------------------------------------------------------- + */ + +/**********************/ +/* Module Declaration */ +/**********************/ + +#define H5FS_PACKAGE + + +/***********************/ +/* Other Packages Used */ +/***********************/ + + +/***********/ +/* Headers */ +/***********/ +#include "H5private.h" /* Generic Functions */ +#include "H5Eprivate.h" /* Error Handling */ +#include "H5FSpkg.h" /* Free Space Managers */ + + +/****************/ +/* Local Macros */ +/****************/ + + +/******************/ +/* Local Typedefs */ +/******************/ + + +/********************/ +/* Package Typedefs */ +/********************/ + + +/********************/ +/* Local Prototypes */ +/********************/ + + +/*********************/ +/* Package Variables */ +/*********************/ + + +/*****************************/ +/* Library Private Variables */ +/*****************************/ + + +/*******************/ +/* Local Variables */ +/*******************/ + + + +/*------------------------------------------------------------------------- + * Function: H5FS__create_flush_depend + * + * Purpose: Create a flush dependency between two data structure components + * + * Return: SUCCEED/FAIL + * + * Programmer: Dana Robinson + * Fall 2012 + * + *------------------------------------------------------------------------- + */ +herr_t +H5FS__create_flush_depend(H5AC_info_t *parent_entry, H5AC_info_t *child_entry) +{ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI_NOINIT + + /* Sanity check */ + HDassert(parent_entry); + HDassert(child_entry); + + /* Create a flush dependency between parent and child entry */ + if(H5AC_create_flush_dependency(parent_entry, child_entry) < 0) + HGOTO_ERROR(H5E_FSPACE, H5E_CANTDEPEND, FAIL, "unable to create flush dependency") + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5FS__create_flush_depend() */ + + +/*------------------------------------------------------------------------- + * Function: H5FS__destroy_flush_depend + * + * Purpose: Destroy a flush dependency between two data structure components + * + * Return: SUCCEED/FAIL + * + * Programmer: Dana Robinson + * Fall 2012 + * + *------------------------------------------------------------------------- + */ +herr_t +H5FS__destroy_flush_depend(H5AC_info_t *parent_entry, H5AC_info_t *child_entry) +{ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI_NOINIT + + /* Sanity check */ + HDassert(parent_entry); + HDassert(child_entry); + + /* Destroy a flush dependency between parent and child entry */ + if(H5AC_destroy_flush_dependency(parent_entry, child_entry) < 0) + HGOTO_ERROR(H5E_FSPACE, H5E_CANTUNDEPEND, FAIL, "unable to destroy flush dependency") + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5FS__destroy_flush_depend() */ + diff --git a/src/H5HLdblk.c b/src/H5HLdblk.c index 8878351..8878351 100755..100644 --- a/src/H5HLdblk.c +++ b/src/H5HLdblk.c diff --git a/src/H5HLprfx.c b/src/H5HLprfx.c index 1f7a1a1..1f7a1a1 100755..100644 --- a/src/H5HLprfx.c +++ b/src/H5HLprfx.c diff --git a/test/flushrefresh.c b/test/flushrefresh.c index 7686fe3..7686fe3 100755..100644 --- a/test/flushrefresh.c +++ b/test/flushrefresh.c diff --git a/test/gen_bogus.c b/test/gen_bogus.c index 7456ae6..7d8d073 100644 --- a/test/gen_bogus.c +++ b/test/gen_bogus.c @@ -20,7 +20,7 @@ * Purpose: This program is run to generate an HDF5 data file with several * datasets that have "bogus" messages in their object header. */ -
+ #include "H5private.h" #include "hdf5.h" #include "H5Oprivate.h" diff --git a/test/swmr_addrem_writer.c b/test/swmr_addrem_writer.c index 0df8dec..0c21e2d 100644 --- a/test/swmr_addrem_writer.c +++ b/test/swmr_addrem_writer.c @@ -1,458 +1,458 @@ -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- * Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
- * All rights reserved. *
- * *
- * This file is part of HDF5. The full HDF5 copyright notice, including *
- * terms governing use, modification, and redistribution, is contained in *
- * the files COPYING and Copyright.html. COPYING can be found at the root *
- * of the source code distribution tree; Copyright.html can be found at the *
- * root level of an installed copy of the electronic HDF5 document set and *
- * is linked from the top-level documents page. It can also be found at *
- * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have *
- * access to either file, you may request a copy from help@hdfgroup.org. *
- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-
-/*-------------------------------------------------------------------------
- *
- * Created: swmr_addrem_writer.c
- *
- * Purpose: Adds and removes data to a randomly selected subset of the
- * datasets in the SWMR test file.
- *
- * This program is intended to run concurrently with the
- * swmr_reader program. It is also run AFTER a sequential
- * (not concurrent!) invoking of swmr_writer so the writer
- * can dump a bunch of data into the datasets. Otherwise,
- * there wouldn't be much to shrink :)
- *
- *-------------------------------------------------------------------------
- */
-
-/***********/
-/* Headers */
-/***********/
-
-#include <assert.h>
-#include <sys/time.h>
-
-#include "swmr_common.h"
-
-/****************/
-/* Local Macros */
-/****************/
-
-/* The maximum # of records to add/remove from the dataset in one step */
-#define MAX_SIZE_CHANGE 10
-
-/********************/
-/* Local Prototypes */
-/********************/
-
-static hid_t open_skeleton(const char *filename, unsigned verbose);
-static int addrem_records(hid_t fid, unsigned verbose, unsigned long nops,
- unsigned long flush_count);
-static void usage(void);
-
-
-/*-------------------------------------------------------------------------
- * Function: open_skeleton
- *
- * Purpose: Opens the SWMR HDF5 file and datasets.
- *
- * Parameters: const char *filename
- * The filename of the SWMR HDF5 file to open
- *
- * unsigned verbose
- * Whether or not to emit verbose console messages
- *
- * Return: Success: The file ID of the opened SWMR file
- * The dataset IDs are stored in a global array
- *
- * Failure: -1
- *
- *-------------------------------------------------------------------------
- */
-static hid_t
-open_skeleton(const char *filename, unsigned verbose)
-{
- hid_t fid; /* File ID for new HDF5 file */
- hid_t fapl; /* File access property list */
- hid_t sid; /* Dataspace ID */
- hsize_t dim[2]; /* Dataspace dimension */
- unsigned u, v; /* Local index variable */
-
- assert(filename);
-
- /* Create file access property list */
- if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0)
- return -1;
-
- /* Set to use the latest library format */
- if(H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0)
- return -1;
-
-#ifdef QAK
- /* Increase the initial size of the metadata cache */
- {
- H5AC_cache_config_t mdc_config;
-
- mdc_config.version = H5AC__CURR_CACHE_CONFIG_VERSION;
- H5Pget_mdc_config(fapl, &mdc_config);
- fprintf(stderr, "mdc_config.initial_size = %lu\n", (unsigned long)mdc_config.initial_size);
- fprintf(stderr, "mdc_config.epoch_length = %lu\n", (unsigned long)mdc_config.epoch_length);
- mdc_config.set_initial_size = 1;
- mdc_config.initial_size = 16 * 1024 * 1024;
- /* mdc_config.epoch_length = 5000; */
- H5Pset_mdc_config(fapl, &mdc_config);
- }
-#endif /* QAK */
-
-#ifdef QAK
- H5Pset_fapl_log(fapl, "append.log", H5FD_LOG_ALL, (size_t)(512 * 1024 * 1024));
-#endif /* QAK */
-
- /* Open the file */
- if((fid = H5Fopen(filename, H5F_ACC_RDWR | H5F_ACC_SWMR_WRITE, fapl)) < 0)
- return -1;
-
- /* Close file access property list */
- if(H5Pclose(fapl) < 0)
- return -1;
-
- /* Emit informational message */
- if(verbose)
- fprintf(stderr, "Opening datasets\n");
-
- /* Open the datasets */
- for(u = 0; u < NLEVELS; u++)
- for(v = 0; v < symbol_count[u]; v++) {
- if((symbol_info[u][v].dsid = H5Dopen2(fid, symbol_info[u][v].name, H5P_DEFAULT)) < 0)
- return -1;
- if((sid = H5Dget_space(symbol_info[u][v].dsid)) < 0)
- return -1;
- if(2 != H5Sget_simple_extent_ndims(sid))
- return -1;
- if(H5Sget_simple_extent_dims(sid, dim, NULL) < 0)
- return -1;
- symbol_info[u][v].nrecords = dim[1];
- } /* end for */
-
- return fid;
-}
-
-
-/*-------------------------------------------------------------------------
- * Function: addrem_records
- *
- * Purpose: Adds/removes a specified number of records to random datasets
- * to the SWMR test file.
- *
- * Parameters: hid_t fid
- * The file ID of the SWMR HDF5 file
- *
- * unsigned verbose
- * Whether or not to emit verbose console messages
- *
- * unsigned long nops
- * # of records to read/write in the datasets
- *
- * unsigned long flush_count
- * # of records to write before flushing the file to disk
- *
- * Return: Success: 0
- * Failure: -1
- *
- *-------------------------------------------------------------------------
- */
-static int
-addrem_records(hid_t fid, unsigned verbose, unsigned long nops, unsigned long flush_count)
-{
- hid_t tid; /* Datatype ID for records */
- hid_t mem_sid; /* Memory dataspace ID */
- hsize_t start[2] = {0, 0}, count[2] = {1, 1}; /* Hyperslab selection values */
- hsize_t dim[2] = {1, 0}; /* Dataspace dimensions */
- symbol_t buf[MAX_SIZE_CHANGE]; /* Write buffer */
- H5AC_cache_config_t mdc_config_orig; /* Original metadata cache configuration */
- H5AC_cache_config_t mdc_config_cork; /* Corked metadata cache configuration */
- unsigned long op_to_flush; /* # of operations before flush */
- unsigned long u, v; /* Local index variables */
-
- assert(fid > 0);
-
- /* Reset the buffer */
- memset(&buf, 0, sizeof(buf));
-
- /* Create a dataspace for the record to add */
- if((mem_sid = H5Screate_simple(2, count, NULL)) < 0)
- return -1;
-
- /* Create datatype for appending records */
- if((tid = create_symbol_datatype()) < 0)
- return -1;
-
- /* Get the current metadata cache configuration, and set up the corked
- * configuration */
- mdc_config_orig.version = H5AC__CURR_CACHE_CONFIG_VERSION;
- if(H5Fget_mdc_config(fid, &mdc_config_orig) < 0)
- return -1;
- memcpy(&mdc_config_cork, &mdc_config_orig, sizeof(mdc_config_cork));
- mdc_config_cork.evictions_enabled = FALSE;
- mdc_config_cork.incr_mode = H5C_incr__off;
- mdc_config_cork.flash_incr_mode = H5C_flash_incr__off;
- mdc_config_cork.decr_mode = H5C_decr__off;
-
- /* Add and remove records to random datasets, according to frequency
- * distribution */
- op_to_flush = flush_count;
- for(u=0; u<nops; u++) {
- symbol_info_t *symbol; /* Symbol to write record to */
- hid_t file_sid; /* Dataset's space ID */
-
- /* Get a random dataset, according to the symbol distribution */
- symbol = choose_dataset();
-
- /* Decide whether to shrink or expand, and by how much */
- count[1] = (hsize_t)random() % (MAX_SIZE_CHANGE * 2) + 1;
-
- if(count[1] > MAX_SIZE_CHANGE) {
- /* Add records */
- count[1] -= MAX_SIZE_CHANGE;
-
- /* Set the buffer's IDs (equal to its position) */
- for(v=0; v<count[1]; v++)
- buf[v].rec_id = (uint64_t)symbol->nrecords + (uint64_t)v;
-
- /* Set the memory space to the correct size */
- if(H5Sset_extent_simple(mem_sid, 2, count, NULL) < 0)
- return -1;
-
- /* Get the coordinates to write */
- start[1] = symbol->nrecords;
-
- /* Cork the metadata cache, to prevent the object header from being
- * flushed before the data has been written */
- /*if(H5Fset_mdc_config(fid, &mdc_config_cork) < 0)
- return(-1);*/
-
- /* Extend the dataset's dataspace to hold the new record */
- symbol->nrecords+= count[1];
- dim[1] = symbol->nrecords;
- if(H5Dset_extent(symbol->dsid, dim) < 0)
- return -1;
-
- /* Get the dataset's dataspace */
- if((file_sid = H5Dget_space(symbol->dsid)) < 0)
- return -1;
-
- /* Choose the last record in the dataset */
- if(H5Sselect_hyperslab(file_sid, H5S_SELECT_SET, start, NULL, count, NULL) < 0)
- return -1;
-
- /* Write record to the dataset */
- if(H5Dwrite(symbol->dsid, tid, mem_sid, file_sid, H5P_DEFAULT, &buf) < 0)
- return -1;
-
- /* Uncork the metadata cache */
- /*if(H5Fset_mdc_config(fid, &mdc_config_orig) < 0)
- return -1;*/
-
- /* Close the dataset's dataspace */
- if(H5Sclose(file_sid) < 0)
- return -1;
- } /* end if */
- else {
- /* Shrink the dataset's dataspace */
- if(count[1] > symbol->nrecords)
- symbol->nrecords = 0;
- else
- symbol->nrecords -= count[1];
- dim[1] = symbol->nrecords;
- if(H5Dset_extent(symbol->dsid, dim) < 0)
- return -1;
- } /* end else */
-
- /* Check for flushing file */
- if(flush_count > 0) {
- /* Decrement count of records to write before flushing */
- op_to_flush--;
-
- /* Check for counter being reached */
- if(0 == op_to_flush) {
- /* Flush contents of file */
- if(H5Fflush(fid, H5F_SCOPE_GLOBAL) < 0)
- return -1;
-
- /* Reset flush counter */
- op_to_flush = flush_count;
- } /* end if */
- } /* end if */
- } /* end for */
-
- /* Emit informational message */
- if(verbose)
- fprintf(stderr, "Closing datasets\n");
-
- /* Close the datasets */
- for(u = 0; u < NLEVELS; u++)
- for(v = 0; v < symbol_count[u]; v++)
- if(H5Dclose(symbol_info[u][v].dsid) < 0)
- return -1;
-
- return 0;
-}
-
-static void
-usage(void)
-{
- printf("\n");
- printf("Usage error!\n");
- printf("\n");
- printf("Usage: swmr_addrem_writer [-q] [-f <# of operations between flushing\n");
- printf(" file contents>] [-r <random seed>] <# of operations>\n");
- printf("\n");
- printf("<# of operations between flushing file contents> should be 0 (for\n");
- printf("no flushing) or between 1 and (<# of operations> - 1).\n");
- printf("\n");
- printf("<# of operations> must be specified.\n");
- printf("\n");
- printf("Defaults to verbose (no '-q' given), flushing every 1000 operations\n");
- printf("('-f 1000'), and will generate a random seed (no -r given).\n");
- printf("\n");
- exit(1);
-}
-
-int main(int argc, const char *argv[])
-{
- hid_t fid; /* File ID for file opened */
- long nops = 0; /* # of times to grow or shrink the dataset */
- long flush_count = 1000; /* # of records to write between flushing file */
- unsigned verbose = 1; /* Whether to emit some informational messages */
- unsigned use_seed = 0; /* Set to 1 if a seed was set on the command line */
- unsigned random_seed = 0; /* Random # seed */
- unsigned u; /* Local index variable */
- int temp;
-
- /* Parse command line options */
- if(argc < 2)
- usage();
- if(argc > 1) {
- u = 1;
- while(u < (unsigned)argc) {
- if(argv[u][0] == '-') {
- switch(argv[u][1]) {
- /* # of records to write between flushing file */
- case 'f':
- flush_count = atol(argv[u + 1]);
- if(flush_count < 0)
- usage();
- u += 2;
- break;
-
- /* Be quiet */
- case 'q':
- verbose = 0;
- u++;
- break;
-
- /* Random # seed */
- case 'r':
- use_seed = 1;
- temp = atoi(argv[u + 1]);
- if(temp < 0)
- usage();
- else
- random_seed = (unsigned)temp;
- u += 2;
- break;
-
- default:
- usage();
- break;
- } /* end switch */
- } /* end if */
- else {
- /* Get the number of records to append */
- nops = atol(argv[u]);
- if(nops <= 0)
- usage();
-
- u++;
- } /* end else */
- } /* end while */
- } /* end if */
- if(nops <= 0)
- usage();
- if(flush_count >= nops)
- usage();
-
- /* Emit informational message */
- if(verbose) {
- fprintf(stderr, "Parameters:\n");
- fprintf(stderr, "\t# of operations between flushes = %ld\n", flush_count);
- fprintf(stderr, "\t# of operations = %ld\n", nops);
- } /* end if */
-
- /* Set the random seed */
- if(0 == use_seed) {
- struct timeval t;
- gettimeofday(&t, NULL);
- random_seed = (unsigned)((t.tv_sec * 1000) + t.tv_usec);
- } /* end if */
- srandom(random_seed);
- /* ALWAYS emit the random seed for possible debugging */
- fprintf(stderr, "Using writer random seed: %u\n", random_seed);
-
- /* Emit informational message */
- if(verbose)
- fprintf(stderr, "Generating symbol names\n");
-
- /* Generate dataset names */
- if(generate_symbols() < 0)
- return -1;
-
- /* Emit informational message */
- if(verbose)
- fprintf(stderr, "Opening skeleton file: %s\n", FILENAME);
-
- /* Open file skeleton */
- if((fid = open_skeleton(FILENAME, verbose)) < 0) {
- fprintf(stderr, "Error opening skeleton file!\n");
- exit(1);
- } /* end if */
-
- /* Send a message to indicate "H5Fopen" is complete--releasing the file lock */
- h5_send_message(WRITER_MESSAGE);
-
- /* Emit informational message */
- if(verbose)
- fprintf(stderr, "Adding and removing records\n");
-
- /* Grow and shrink datasets */
- if(addrem_records(fid, verbose, (unsigned long)nops, (unsigned long)flush_count) < 0) {
- fprintf(stderr, "Error adding and removing records from datasets!\n");
- exit(1);
- } /* end if */
-
- /* Emit informational message */
- if(verbose)
- fprintf(stderr, "Releasing symbols\n");
-
- /* Clean up the symbols */
- if(shutdown_symbols() < 0) {
- fprintf(stderr, "Error releasing symbols!\n");
- exit(1);
- } /* end if */
-
- /* Emit informational message */
- if(verbose)
- fprintf(stderr, "Closing objects\n");
-
- /* Close objects opened */
- if(H5Fclose(fid) < 0) {
- fprintf(stderr, "Error closing file!\n");
- exit(1);
- } /* end if */
-
- return 0;
-}
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by The HDF Group. * + * Copyright by the Board of Trustees of the University of Illinois. * + * All rights reserved. * + * * + * This file is part of HDF5. The full HDF5 copyright notice, including * + * terms governing use, modification, and redistribution, is contained in * + * the files COPYING and Copyright.html. COPYING can be found at the root * + * of the source code distribution tree; Copyright.html can be found at the * + * root level of an installed copy of the electronic HDF5 document set and * + * is linked from the top-level documents page. It can also be found at * + * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * + * access to either file, you may request a copy from help@hdfgroup.org. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/*------------------------------------------------------------------------- + * + * Created: swmr_addrem_writer.c + * + * Purpose: Adds and removes data to a randomly selected subset of the + * datasets in the SWMR test file. + * + * This program is intended to run concurrently with the + * swmr_reader program. It is also run AFTER a sequential + * (not concurrent!) invoking of swmr_writer so the writer + * can dump a bunch of data into the datasets. Otherwise, + * there wouldn't be much to shrink :) + * + *------------------------------------------------------------------------- + */ + +/***********/ +/* Headers */ +/***********/ + +#include <assert.h> +#include <sys/time.h> + +#include "swmr_common.h" + +/****************/ +/* Local Macros */ +/****************/ + +/* The maximum # of records to add/remove from the dataset in one step */ +#define MAX_SIZE_CHANGE 10 + +/********************/ +/* Local Prototypes */ +/********************/ + +static hid_t open_skeleton(const char *filename, unsigned verbose); +static int addrem_records(hid_t fid, unsigned verbose, unsigned long nops, + unsigned long flush_count); +static void usage(void); + + +/*------------------------------------------------------------------------- + * Function: open_skeleton + * + * Purpose: Opens the SWMR HDF5 file and datasets. + * + * Parameters: const char *filename + * The filename of the SWMR HDF5 file to open + * + * unsigned verbose + * Whether or not to emit verbose console messages + * + * Return: Success: The file ID of the opened SWMR file + * The dataset IDs are stored in a global array + * + * Failure: -1 + * + *------------------------------------------------------------------------- + */ +static hid_t +open_skeleton(const char *filename, unsigned verbose) +{ + hid_t fid; /* File ID for new HDF5 file */ + hid_t fapl; /* File access property list */ + hid_t sid; /* Dataspace ID */ + hsize_t dim[2]; /* Dataspace dimension */ + unsigned u, v; /* Local index variable */ + + assert(filename); + + /* Create file access property list */ + if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) + return -1; + + /* Set to use the latest library format */ + if(H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) + return -1; + +#ifdef QAK + /* Increase the initial size of the metadata cache */ + { + H5AC_cache_config_t mdc_config; + + mdc_config.version = H5AC__CURR_CACHE_CONFIG_VERSION; + H5Pget_mdc_config(fapl, &mdc_config); + fprintf(stderr, "mdc_config.initial_size = %lu\n", (unsigned long)mdc_config.initial_size); + fprintf(stderr, "mdc_config.epoch_length = %lu\n", (unsigned long)mdc_config.epoch_length); + mdc_config.set_initial_size = 1; + mdc_config.initial_size = 16 * 1024 * 1024; + /* mdc_config.epoch_length = 5000; */ + H5Pset_mdc_config(fapl, &mdc_config); + } +#endif /* QAK */ + +#ifdef QAK + H5Pset_fapl_log(fapl, "append.log", H5FD_LOG_ALL, (size_t)(512 * 1024 * 1024)); +#endif /* QAK */ + + /* Open the file */ + if((fid = H5Fopen(filename, H5F_ACC_RDWR | H5F_ACC_SWMR_WRITE, fapl)) < 0) + return -1; + + /* Close file access property list */ + if(H5Pclose(fapl) < 0) + return -1; + + /* Emit informational message */ + if(verbose) + fprintf(stderr, "Opening datasets\n"); + + /* Open the datasets */ + for(u = 0; u < NLEVELS; u++) + for(v = 0; v < symbol_count[u]; v++) { + if((symbol_info[u][v].dsid = H5Dopen2(fid, symbol_info[u][v].name, H5P_DEFAULT)) < 0) + return -1; + if((sid = H5Dget_space(symbol_info[u][v].dsid)) < 0) + return -1; + if(2 != H5Sget_simple_extent_ndims(sid)) + return -1; + if(H5Sget_simple_extent_dims(sid, dim, NULL) < 0) + return -1; + symbol_info[u][v].nrecords = dim[1]; + } /* end for */ + + return fid; +} + + +/*------------------------------------------------------------------------- + * Function: addrem_records + * + * Purpose: Adds/removes a specified number of records to random datasets + * to the SWMR test file. + * + * Parameters: hid_t fid + * The file ID of the SWMR HDF5 file + * + * unsigned verbose + * Whether or not to emit verbose console messages + * + * unsigned long nops + * # of records to read/write in the datasets + * + * unsigned long flush_count + * # of records to write before flushing the file to disk + * + * Return: Success: 0 + * Failure: -1 + * + *------------------------------------------------------------------------- + */ +static int +addrem_records(hid_t fid, unsigned verbose, unsigned long nops, unsigned long flush_count) +{ + hid_t tid; /* Datatype ID for records */ + hid_t mem_sid; /* Memory dataspace ID */ + hsize_t start[2] = {0, 0}, count[2] = {1, 1}; /* Hyperslab selection values */ + hsize_t dim[2] = {1, 0}; /* Dataspace dimensions */ + symbol_t buf[MAX_SIZE_CHANGE]; /* Write buffer */ + H5AC_cache_config_t mdc_config_orig; /* Original metadata cache configuration */ + H5AC_cache_config_t mdc_config_cork; /* Corked metadata cache configuration */ + unsigned long op_to_flush; /* # of operations before flush */ + unsigned long u, v; /* Local index variables */ + + assert(fid > 0); + + /* Reset the buffer */ + memset(&buf, 0, sizeof(buf)); + + /* Create a dataspace for the record to add */ + if((mem_sid = H5Screate_simple(2, count, NULL)) < 0) + return -1; + + /* Create datatype for appending records */ + if((tid = create_symbol_datatype()) < 0) + return -1; + + /* Get the current metadata cache configuration, and set up the corked + * configuration */ + mdc_config_orig.version = H5AC__CURR_CACHE_CONFIG_VERSION; + if(H5Fget_mdc_config(fid, &mdc_config_orig) < 0) + return -1; + memcpy(&mdc_config_cork, &mdc_config_orig, sizeof(mdc_config_cork)); + mdc_config_cork.evictions_enabled = FALSE; + mdc_config_cork.incr_mode = H5C_incr__off; + mdc_config_cork.flash_incr_mode = H5C_flash_incr__off; + mdc_config_cork.decr_mode = H5C_decr__off; + + /* Add and remove records to random datasets, according to frequency + * distribution */ + op_to_flush = flush_count; + for(u=0; u<nops; u++) { + symbol_info_t *symbol; /* Symbol to write record to */ + hid_t file_sid; /* Dataset's space ID */ + + /* Get a random dataset, according to the symbol distribution */ + symbol = choose_dataset(); + + /* Decide whether to shrink or expand, and by how much */ + count[1] = (hsize_t)random() % (MAX_SIZE_CHANGE * 2) + 1; + + if(count[1] > MAX_SIZE_CHANGE) { + /* Add records */ + count[1] -= MAX_SIZE_CHANGE; + + /* Set the buffer's IDs (equal to its position) */ + for(v=0; v<count[1]; v++) + buf[v].rec_id = (uint64_t)symbol->nrecords + (uint64_t)v; + + /* Set the memory space to the correct size */ + if(H5Sset_extent_simple(mem_sid, 2, count, NULL) < 0) + return -1; + + /* Get the coordinates to write */ + start[1] = symbol->nrecords; + + /* Cork the metadata cache, to prevent the object header from being + * flushed before the data has been written */ + /*if(H5Fset_mdc_config(fid, &mdc_config_cork) < 0) + return(-1);*/ + + /* Extend the dataset's dataspace to hold the new record */ + symbol->nrecords+= count[1]; + dim[1] = symbol->nrecords; + if(H5Dset_extent(symbol->dsid, dim) < 0) + return -1; + + /* Get the dataset's dataspace */ + if((file_sid = H5Dget_space(symbol->dsid)) < 0) + return -1; + + /* Choose the last record in the dataset */ + if(H5Sselect_hyperslab(file_sid, H5S_SELECT_SET, start, NULL, count, NULL) < 0) + return -1; + + /* Write record to the dataset */ + if(H5Dwrite(symbol->dsid, tid, mem_sid, file_sid, H5P_DEFAULT, &buf) < 0) + return -1; + + /* Uncork the metadata cache */ + /*if(H5Fset_mdc_config(fid, &mdc_config_orig) < 0) + return -1;*/ + + /* Close the dataset's dataspace */ + if(H5Sclose(file_sid) < 0) + return -1; + } /* end if */ + else { + /* Shrink the dataset's dataspace */ + if(count[1] > symbol->nrecords) + symbol->nrecords = 0; + else + symbol->nrecords -= count[1]; + dim[1] = symbol->nrecords; + if(H5Dset_extent(symbol->dsid, dim) < 0) + return -1; + } /* end else */ + + /* Check for flushing file */ + if(flush_count > 0) { + /* Decrement count of records to write before flushing */ + op_to_flush--; + + /* Check for counter being reached */ + if(0 == op_to_flush) { + /* Flush contents of file */ + if(H5Fflush(fid, H5F_SCOPE_GLOBAL) < 0) + return -1; + + /* Reset flush counter */ + op_to_flush = flush_count; + } /* end if */ + } /* end if */ + } /* end for */ + + /* Emit informational message */ + if(verbose) + fprintf(stderr, "Closing datasets\n"); + + /* Close the datasets */ + for(u = 0; u < NLEVELS; u++) + for(v = 0; v < symbol_count[u]; v++) + if(H5Dclose(symbol_info[u][v].dsid) < 0) + return -1; + + return 0; +} + +static void +usage(void) +{ + printf("\n"); + printf("Usage error!\n"); + printf("\n"); + printf("Usage: swmr_addrem_writer [-q] [-f <# of operations between flushing\n"); + printf(" file contents>] [-r <random seed>] <# of operations>\n"); + printf("\n"); + printf("<# of operations between flushing file contents> should be 0 (for\n"); + printf("no flushing) or between 1 and (<# of operations> - 1).\n"); + printf("\n"); + printf("<# of operations> must be specified.\n"); + printf("\n"); + printf("Defaults to verbose (no '-q' given), flushing every 1000 operations\n"); + printf("('-f 1000'), and will generate a random seed (no -r given).\n"); + printf("\n"); + exit(1); +} + +int main(int argc, const char *argv[]) +{ + hid_t fid; /* File ID for file opened */ + long nops = 0; /* # of times to grow or shrink the dataset */ + long flush_count = 1000; /* # of records to write between flushing file */ + unsigned verbose = 1; /* Whether to emit some informational messages */ + unsigned use_seed = 0; /* Set to 1 if a seed was set on the command line */ + unsigned random_seed = 0; /* Random # seed */ + unsigned u; /* Local index variable */ + int temp; + + /* Parse command line options */ + if(argc < 2) + usage(); + if(argc > 1) { + u = 1; + while(u < (unsigned)argc) { + if(argv[u][0] == '-') { + switch(argv[u][1]) { + /* # of records to write between flushing file */ + case 'f': + flush_count = atol(argv[u + 1]); + if(flush_count < 0) + usage(); + u += 2; + break; + + /* Be quiet */ + case 'q': + verbose = 0; + u++; + break; + + /* Random # seed */ + case 'r': + use_seed = 1; + temp = atoi(argv[u + 1]); + if(temp < 0) + usage(); + else + random_seed = (unsigned)temp; + u += 2; + break; + + default: + usage(); + break; + } /* end switch */ + } /* end if */ + else { + /* Get the number of records to append */ + nops = atol(argv[u]); + if(nops <= 0) + usage(); + + u++; + } /* end else */ + } /* end while */ + } /* end if */ + if(nops <= 0) + usage(); + if(flush_count >= nops) + usage(); + + /* Emit informational message */ + if(verbose) { + fprintf(stderr, "Parameters:\n"); + fprintf(stderr, "\t# of operations between flushes = %ld\n", flush_count); + fprintf(stderr, "\t# of operations = %ld\n", nops); + } /* end if */ + + /* Set the random seed */ + if(0 == use_seed) { + struct timeval t; + gettimeofday(&t, NULL); + random_seed = (unsigned)((t.tv_sec * 1000) + t.tv_usec); + } /* end if */ + srandom(random_seed); + /* ALWAYS emit the random seed for possible debugging */ + fprintf(stderr, "Using writer random seed: %u\n", random_seed); + + /* Emit informational message */ + if(verbose) + fprintf(stderr, "Generating symbol names\n"); + + /* Generate dataset names */ + if(generate_symbols() < 0) + return -1; + + /* Emit informational message */ + if(verbose) + fprintf(stderr, "Opening skeleton file: %s\n", FILENAME); + + /* Open file skeleton */ + if((fid = open_skeleton(FILENAME, verbose)) < 0) { + fprintf(stderr, "Error opening skeleton file!\n"); + exit(1); + } /* end if */ + + /* Send a message to indicate "H5Fopen" is complete--releasing the file lock */ + h5_send_message(WRITER_MESSAGE); + + /* Emit informational message */ + if(verbose) + fprintf(stderr, "Adding and removing records\n"); + + /* Grow and shrink datasets */ + if(addrem_records(fid, verbose, (unsigned long)nops, (unsigned long)flush_count) < 0) { + fprintf(stderr, "Error adding and removing records from datasets!\n"); + exit(1); + } /* end if */ + + /* Emit informational message */ + if(verbose) + fprintf(stderr, "Releasing symbols\n"); + + /* Clean up the symbols */ + if(shutdown_symbols() < 0) { + fprintf(stderr, "Error releasing symbols!\n"); + exit(1); + } /* end if */ + + /* Emit informational message */ + if(verbose) + fprintf(stderr, "Closing objects\n"); + + /* Close objects opened */ + if(H5Fclose(fid) < 0) { + fprintf(stderr, "Error closing file!\n"); + exit(1); + } /* end if */ + + return 0; +} diff --git a/test/swmr_remove_reader.c b/test/swmr_remove_reader.c index 93bd55c..2b4a39d 100644 --- a/test/swmr_remove_reader.c +++ b/test/swmr_remove_reader.c @@ -1,513 +1,513 @@ -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- * Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
- * All rights reserved. *
- * *
- * This file is part of HDF5. The full HDF5 copyright notice, including *
- * terms governing use, modification, and redistribution, is contained in *
- * the files COPYING and Copyright.html. COPYING can be found at the root *
- * of the source code distribution tree; Copyright.html can be found at the *
- * root level of an installed copy of the electronic HDF5 document set and *
- * is linked from the top-level documents page. It can also be found at *
- * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have *
- * access to either file, you may request a copy from help@hdfgroup.org. *
- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-
-/*-------------------------------------------------------------------------
- *
- * Created: swmr_remove_reader.c
- *
- * Purpose: Reads data from a randomly selected subset of the datasets
- * in the SWMR test file. Unlike the regular reader, these
- * datasets will be shrinking.
- *
- * This program is intended to run concurrently with the
- * swmr_remove_writer program.
- *
- *-------------------------------------------------------------------------
- */
-
-/***********/
-/* Headers */
-/***********/
-
-#include <assert.h>
-#include <unistd.h>
-#include <sys/time.h>
-
-#include "swmr_common.h"
-
-/*******************/
-/* Local Variables */
-/*******************/
-
-static hid_t symbol_tid = -1;
-
-/********************/
-/* Local Prototypes */
-/********************/
-
-static int check_dataset(hid_t fid, unsigned verbose, const char *sym_name,
- symbol_t *record, hid_t rec_sid);
-static int read_records(const char *filename, unsigned verbose, unsigned long nseconds,
- unsigned poll_time, unsigned ncommon, unsigned nrandom);
-static void usage(void);
-
-
-/*-------------------------------------------------------------------------
- * Function: check_dataset
- *
- * Purpose: For a given dataset, checks to make sure that the stated
- * and actual sizes are the same. If they are not, then
- * we have an inconsistent dataset due to a SWMR error.
- *
- * Parameters: hid_t fid
- * The SWMR test file's ID.
- *
- * unsigned verbose
- * Whether verbose console output is desired.
- *
- * const char *sym_name
- * The name of the dataset from which to read.
- *
- * symbol_t *record
- * Memory for the record. Must be pre-allocated.
- *
- * hid_t rec_sid
- * The memory dataspace for access. It's always the same so
- * there is no need to re-create it every time this function
- * is called.
- *
- * Return: Success: 0
- * Failure: -1
- *
- *-------------------------------------------------------------------------
- */
-static int
-check_dataset(hid_t fid, unsigned verbose, const char *sym_name, symbol_t *record,
- hid_t rec_sid)
-{
- hid_t dsid; /* Dataset ID */
- hid_t file_sid; /* Dataset's space ID */
- hssize_t snpoints; /* Number of elements in dataset */
- hsize_t start[2] = {0, 0}, count[2] = {1, 1}; /* Hyperslab selection values */
-
- assert(fid >= 0);
- assert(sym_name);
- assert(record);
- assert(rec_sid >= 0);
-
- /* Open dataset for symbol */
- if((dsid = H5Dopen2(fid, sym_name, H5P_DEFAULT)) < 0)
- return -1;
-
- /* Get the dataset's dataspace */
- if((file_sid = H5Dget_space(dsid)) < 0)
- return -1;
-
- /* Get the number of elements (= records, for 1-D datasets) */
- if((snpoints = H5Sget_simple_extent_npoints(file_sid)) < 0)
- return -1;
-
- /* Emit informational message */
- if(verbose)
- fprintf(stderr, "Symbol = '%s', # of records = %lld\n", sym_name, (long long)snpoints);
-
- /* Check if there are records for symbol */
- if(snpoints > 0) {
- /* Choose a random record in the dataset, choosing the last record half
- * the time */
- start[1] = (hsize_t)(random() % (snpoints * 2));
- if(start[1] > (hsize_t)(snpoints - 1))
- start[1] = (hsize_t)(snpoints - 1);
- if(H5Sselect_hyperslab(file_sid, H5S_SELECT_SET, start, NULL, count, NULL) < 0)
- return -1;
-
- /* Read record from dataset */
-#ifdef FILLVAL_WORKS
- /* When shrinking the dataset, we cannot guarantee that the buffer will
- * even be touched, unless there is a fill value. Since fill values do
- * not work with SWMR currently (see note in swmr_generator.c), we
- * simply initialize rec_id to 0. */
- record->rec_id = (uint64_t)ULLONG_MAX - 1;
-#else /* FILLVAL_WORKS */
- record->rec_id = (uint64_t)0;
-#endif /* FILLVAL_WORKS */
- if(H5Dread(dsid, symbol_tid, rec_sid, file_sid, H5P_DEFAULT, record) < 0)
- return -1;
-
- /* Verify record value - note that it may be the fill value, because the
- * chunk may be deleted before the object header has the updated
- * dimensions */
- if(record->rec_id != start[1] && record->rec_id != (uint64_t)0) {
- fprintf(stderr, "*** ERROR ***\n");
- fprintf(stderr, "Incorrect record value!\n");
- fprintf(stderr, "Symbol = '%s', # of records = %lld, record->rec_id = %llx\n", sym_name, (long long)snpoints, (unsigned long long)record->rec_id);
- return -1;
- } /* end if */
- } /* end if */
-
- /* Close the dataset's dataspace */
- if(H5Sclose(file_sid) < 0)
- return -1;
-
- /* Close dataset for symbol */
- if(H5Dclose(dsid) < 0)
- return -1;
-
- return 0;
-} /* end check_dataset() */
-
-
-/*-------------------------------------------------------------------------
- * Function: read_records
- *
- * Purpose: For a given dataset, checks to make sure that the stated
- * and actual sizes are the same. If they are not, then
- * we have an inconsistent dataset due to a SWMR error.
- *
- * The "common" datasets are a random selection from among
- * the level 0 datasets. The "random" datasets are a random
- * selection from among all the file's datasets. This scheme
- * ensures that the level 0 datasets are interrogated vigorously.
- *
- * Parameters: const char *filename
- * The SWMR test file's name.
- *
- * unsigned verbose
- * Whether verbose console output is desired.
- *
- * unsigned long nseconds
- * The amount of time to read records (ns).
- *
- * unsigned poll_time
- * The amount of time to sleep (s).
- *
- * unsigned ncommon
- * The number of common/non-random datasets that will be opened.
- *
- * unsigned nrandom
- * The number of random datasets that will be opened.
- *
- * Return: Success: 0
- * Failure: -1
- *
- *-------------------------------------------------------------------------
- */
-static int
-read_records(const char *filename, unsigned verbose, unsigned long nseconds,
- unsigned poll_time, unsigned ncommon, unsigned nrandom)
-{
- time_t start_time; /* Starting time */
- time_t curr_time; /* Current time */
- symbol_info_t **sym_com = NULL; /* Pointers to array of common dataset IDs */
- symbol_info_t **sym_rand = NULL; /* Pointers to array of random dataset IDs */
- hid_t mem_sid; /* Memory dataspace ID */
- hid_t fid; /* SWMR test file ID */
- symbol_t record; /* The record to add to the dataset */
- unsigned v; /* Local index variable */
-
- assert(filename);
- assert(nseconds != 0);
- assert(poll_time != 0);
-
- /* Reset the record */
- /* (record's 'info' field might need to change for each record written, also) */
- memset(&record, 0, sizeof(record));
-
- /* Emit informational message */
- if(verbose)
- fprintf(stderr, "Choosing datasets\n");
-
- /* Allocate space for 'common' datasets, if any */
- if(ncommon > 0) {
- /* Allocate array to hold pointers to symbols for common datasets */
- if(NULL == (sym_com = (symbol_info_t **)malloc(sizeof(symbol_info_t *) * ncommon)))
- return -1;
-
- /* Open the common datasets */
- for(v = 0; v < ncommon; v++) {
- unsigned offset; /* Offset of symbol to use */
-
- /* Determine the offset of the symbol, within level 0 symbols */
- /* (level 0 symbols are the most common symbols) */
- offset = (unsigned)(random() % symbol_count[0]);
- sym_com[v] = &symbol_info[0][offset];
-
- /* Emit informational message */
- if(verbose)
- fprintf(stderr, "Common symbol #%u = '%s'\n", v, symbol_info[0][offset].name);
- } /* end for */
- } /* end if */
-
- /* Allocate space for 'random' datasets, if any */
- if(nrandom > 0) {
- /* Allocate array to hold pointers to symbols for random datasets */
- if(NULL == (sym_rand = (symbol_info_t **)malloc(sizeof(symbol_info_t *) * nrandom)))
- return -1;
-
- /* Determine the random datasets */
- for(v = 0; v < nrandom; v++) {
- symbol_info_t *sym; /* Symbol to use */
-
- /* Determine the symbol, within all symbols */
- if(NULL == (sym = choose_dataset()))
- return -1;
- sym_rand[v] = sym;
-
- /* Emit informational message */
- if(verbose)
- fprintf(stderr, "Random symbol #%u = '%s'\n", v, sym->name);
- } /* end for */
- } /* end if */
-
- /* Create a dataspace for the record to read */
- if((mem_sid = H5Screate(H5S_SCALAR)) < 0)
- return -1;
-
- /* Emit informational message */
- if(verbose)
- fprintf(stderr, "Reading records\n");
-
- /* Get the starting time */
- start_time = time(NULL);
- curr_time = start_time;
-
- /* Loop over reading records until [at least] the correct # of seconds have passed */
- while(curr_time < (time_t)(start_time + (time_t)nseconds)) {
-
- /* Emit informational message */
- if(verbose)
- fprintf(stderr, "Opening file: %s\n", filename);
-
- /* Open the file */
- if((fid = H5Fopen(filename, H5F_ACC_RDONLY | H5F_ACC_SWMR_READ, H5P_DEFAULT)) < 0)
- return -1;
-
- /* Check 'common' datasets, if any */
- if(ncommon > 0) {
- /* Emit informational message */
- if(verbose)
- fprintf(stderr, "Checking common symbols\n");
-
- /* Iterate over common datasets */
- for(v = 0; v < ncommon; v++) {
- /* Check common dataset */
- if(check_dataset(fid, verbose, sym_com[v]->name, &record, mem_sid) < 0)
- return -1;
- memset(&record, 0, sizeof(record));
- } /* end for */
- } /* end if */
-
- /* Check 'random' datasets, if any */
- if(nrandom > 0) {
- /* Emit informational message */
- if(verbose)
- fprintf(stderr, "Checking random symbols\n");
-
- /* Iterate over random datasets */
- for(v = 0; v < nrandom; v++) {
- /* Check random dataset */
- if(check_dataset(fid, verbose, sym_rand[v]->name, &record, mem_sid) < 0)
- return -1;
- memset(&record, 0, sizeof(record));
- } /* end for */
- } /* end if */
-
- /* Emit informational message */
- if(verbose)
- fprintf(stderr, "Closing file\n");
-
- /* Close the file */
- if(H5Fclose(fid) < 0)
- return -1;
-
- /* Sleep for the appropriate # of seconds */
- sleep(poll_time);
-
- /* Retrieve the current time */
- curr_time = time(NULL);
- } /* end while */
-
- /* Close the memory dataspace */
- if(H5Sclose(mem_sid) < 0)
- return -1;
-
- /* Emit informational message */
- if(verbose)
- fprintf(stderr, "Closing datasets\n");
-
- /* Close 'random' datasets, if any */
- if(nrandom > 0) {
- /* Release array holding dataset ID's for random datasets */
- free(sym_rand);
- } /* end if */
-
- /* Close 'common' datasets, if any */
- if(ncommon > 0) {
- /* Release array holding dataset ID's for common datasets */
- free(sym_com);
- } /* end if */
-
- return 0;
-} /* end read_records() */
-
-static void
-usage(void)
-{
- printf("\n");
- printf("Usage error!\n");
- printf("\n");
- printf("Usage: swmr_remove_reader [-q] [-s <# of seconds to sleep between\n");
- printf(" polling>] [-h <# of common symbols to poll>] [-l <# of random symbols\n");
- printf(" to poll>] [-r <random seed>] <# of seconds to test>\n");
- printf("\n");
- printf("Defaults to verbose (no '-q' given), 1 second between polling ('-s 1'),\n");
- printf("5 common symbols to poll ('-h 5'), 10 random symbols to poll ('-l 10'),\n");
- printf("and will generate a random seed (no -r given).\n");
- printf("\n");
- exit(1);
-}
-
-int main(int argc, const char *argv[])
-{
- long nseconds = 0; /* # of seconds to test */
- int poll_time = 1; /* # of seconds between polling */
- int ncommon = 5; /* # of common symbols to poll */
- int nrandom = 10; /* # of random symbols to poll */
- unsigned verbose = 1; /* Whether to emit some informational messages */
- unsigned use_seed = 0; /* Set to 1 if a seed was set on the command line */
- unsigned random_seed = 0; /* Random # seed */
- unsigned u; /* Local index variables */
- int temp;
-
- /* Parse command line options */
- if(argc < 2)
- usage();
- if(argc > 1) {
- u = 1;
- while(u < (unsigned)argc) {
- if(argv[u][0] == '-') {
- switch(argv[u][1]) {
- /* # of common symbols to poll */
- case 'h':
- ncommon = atoi(argv[u + 1]);
- if(ncommon < 0)
- usage();
- u += 2;
- break;
-
- /* # of random symbols to poll */
- case 'l':
- nrandom = atoi(argv[u + 1]);
- if(nrandom < 0)
- usage();
- u += 2;
- break;
-
- /* Be quiet */
- case 'q':
- verbose = 0;
- u++;
- break;
-
- /* Random # seed */
- case 'r':
- use_seed = 1;
- temp = atoi(argv[u + 1]);
- if(temp < 0)
- usage();
- else
- random_seed = (unsigned)temp;
- u += 2;
- break;
-
- /* # of seconds between polling */
- case 's':
- poll_time = atoi(argv[u + 1]);
- if(poll_time < 0)
- usage();
- u += 2;
- break;
-
- default:
- usage();
- break;
- } /* end switch */
- } /* end if */
- else {
- /* Get the number of records to append */
- nseconds = atol(argv[u]);
- if(nseconds <= 0)
- usage();
-
- u++;
- } /* end else */
- } /* end while */
- } /* end if */
- if(nseconds <= 0)
- usage();
- if(poll_time >= nseconds)
- usage();
-
- /* Emit informational message */
- if(verbose) {
- fprintf(stderr, "Parameters:\n");
- fprintf(stderr, "\t# of seconds between polling = %d\n", poll_time);
- fprintf(stderr, "\t# of common symbols to poll = %d\n", ncommon);
- fprintf(stderr, "\t# of random symbols to poll = %d\n", nrandom);
- fprintf(stderr, "\t# of seconds to test = %ld\n", nseconds);
- } /* end if */
-
- /* Set the random seed */
- if(0 == use_seed) {
- struct timeval t;
- gettimeofday(&t, NULL);
- random_seed = (unsigned)((t.tv_sec * 1000) + t.tv_usec);
- } /* end if */
- srandom(random_seed);
- /* ALWAYS emit the random seed for possible debugging */
- fprintf(stderr, "Using reader random seed: %u\n", random_seed);
-
- /* Emit informational message */
- if(verbose)
- fprintf(stderr, "Generating symbol names\n");
-
- /* Generate dataset names */
- if(generate_symbols() < 0) {
- fprintf(stderr, "Error generating symbol names!\n");
- exit(1);
- } /* end if */
-
- /* Create datatype for creating datasets */
- if((symbol_tid = create_symbol_datatype()) < 0)
- return -1;
-
- /* Reading records from datasets */
- if(read_records(FILENAME, verbose, (unsigned long)nseconds, (unsigned)poll_time, (unsigned)ncommon, (unsigned)nrandom) < 0) {
- fprintf(stderr, "Error reading records from datasets!\n");
- exit(1);
- } /* end if */
-
- /* Emit informational message */
- if(verbose)
- fprintf(stderr, "Releasing symbols\n");
-
- /* Clean up the symbols */
- if(shutdown_symbols() < 0) {
- fprintf(stderr, "Error releasing symbols!\n");
- exit(1);
- } /* end if */
-
- /* Emit informational message */
- if(verbose)
- fprintf(stderr, "Closing objects\n");
-
- /* Close objects created */
- if(H5Tclose(symbol_tid) < 0) {
- fprintf(stderr, "Error closing symbol datatype!\n");
- exit(1);
- } /* end if */
-
- return 0;
-}
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by The HDF Group. * + * Copyright by the Board of Trustees of the University of Illinois. * + * All rights reserved. * + * * + * This file is part of HDF5. The full HDF5 copyright notice, including * + * terms governing use, modification, and redistribution, is contained in * + * the files COPYING and Copyright.html. COPYING can be found at the root * + * of the source code distribution tree; Copyright.html can be found at the * + * root level of an installed copy of the electronic HDF5 document set and * + * is linked from the top-level documents page. It can also be found at * + * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * + * access to either file, you may request a copy from help@hdfgroup.org. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/*------------------------------------------------------------------------- + * + * Created: swmr_remove_reader.c + * + * Purpose: Reads data from a randomly selected subset of the datasets + * in the SWMR test file. Unlike the regular reader, these + * datasets will be shrinking. + * + * This program is intended to run concurrently with the + * swmr_remove_writer program. + * + *------------------------------------------------------------------------- + */ + +/***********/ +/* Headers */ +/***********/ + +#include <assert.h> +#include <unistd.h> +#include <sys/time.h> + +#include "swmr_common.h" + +/*******************/ +/* Local Variables */ +/*******************/ + +static hid_t symbol_tid = -1; + +/********************/ +/* Local Prototypes */ +/********************/ + +static int check_dataset(hid_t fid, unsigned verbose, const char *sym_name, + symbol_t *record, hid_t rec_sid); +static int read_records(const char *filename, unsigned verbose, unsigned long nseconds, + unsigned poll_time, unsigned ncommon, unsigned nrandom); +static void usage(void); + + +/*------------------------------------------------------------------------- + * Function: check_dataset + * + * Purpose: For a given dataset, checks to make sure that the stated + * and actual sizes are the same. If they are not, then + * we have an inconsistent dataset due to a SWMR error. + * + * Parameters: hid_t fid + * The SWMR test file's ID. + * + * unsigned verbose + * Whether verbose console output is desired. + * + * const char *sym_name + * The name of the dataset from which to read. + * + * symbol_t *record + * Memory for the record. Must be pre-allocated. + * + * hid_t rec_sid + * The memory dataspace for access. It's always the same so + * there is no need to re-create it every time this function + * is called. + * + * Return: Success: 0 + * Failure: -1 + * + *------------------------------------------------------------------------- + */ +static int +check_dataset(hid_t fid, unsigned verbose, const char *sym_name, symbol_t *record, + hid_t rec_sid) +{ + hid_t dsid; /* Dataset ID */ + hid_t file_sid; /* Dataset's space ID */ + hssize_t snpoints; /* Number of elements in dataset */ + hsize_t start[2] = {0, 0}, count[2] = {1, 1}; /* Hyperslab selection values */ + + assert(fid >= 0); + assert(sym_name); + assert(record); + assert(rec_sid >= 0); + + /* Open dataset for symbol */ + if((dsid = H5Dopen2(fid, sym_name, H5P_DEFAULT)) < 0) + return -1; + + /* Get the dataset's dataspace */ + if((file_sid = H5Dget_space(dsid)) < 0) + return -1; + + /* Get the number of elements (= records, for 1-D datasets) */ + if((snpoints = H5Sget_simple_extent_npoints(file_sid)) < 0) + return -1; + + /* Emit informational message */ + if(verbose) + fprintf(stderr, "Symbol = '%s', # of records = %lld\n", sym_name, (long long)snpoints); + + /* Check if there are records for symbol */ + if(snpoints > 0) { + /* Choose a random record in the dataset, choosing the last record half + * the time */ + start[1] = (hsize_t)(random() % (snpoints * 2)); + if(start[1] > (hsize_t)(snpoints - 1)) + start[1] = (hsize_t)(snpoints - 1); + if(H5Sselect_hyperslab(file_sid, H5S_SELECT_SET, start, NULL, count, NULL) < 0) + return -1; + + /* Read record from dataset */ +#ifdef FILLVAL_WORKS + /* When shrinking the dataset, we cannot guarantee that the buffer will + * even be touched, unless there is a fill value. Since fill values do + * not work with SWMR currently (see note in swmr_generator.c), we + * simply initialize rec_id to 0. */ + record->rec_id = (uint64_t)ULLONG_MAX - 1; +#else /* FILLVAL_WORKS */ + record->rec_id = (uint64_t)0; +#endif /* FILLVAL_WORKS */ + if(H5Dread(dsid, symbol_tid, rec_sid, file_sid, H5P_DEFAULT, record) < 0) + return -1; + + /* Verify record value - note that it may be the fill value, because the + * chunk may be deleted before the object header has the updated + * dimensions */ + if(record->rec_id != start[1] && record->rec_id != (uint64_t)0) { + fprintf(stderr, "*** ERROR ***\n"); + fprintf(stderr, "Incorrect record value!\n"); + fprintf(stderr, "Symbol = '%s', # of records = %lld, record->rec_id = %llx\n", sym_name, (long long)snpoints, (unsigned long long)record->rec_id); + return -1; + } /* end if */ + } /* end if */ + + /* Close the dataset's dataspace */ + if(H5Sclose(file_sid) < 0) + return -1; + + /* Close dataset for symbol */ + if(H5Dclose(dsid) < 0) + return -1; + + return 0; +} /* end check_dataset() */ + + +/*------------------------------------------------------------------------- + * Function: read_records + * + * Purpose: For a given dataset, checks to make sure that the stated + * and actual sizes are the same. If they are not, then + * we have an inconsistent dataset due to a SWMR error. + * + * The "common" datasets are a random selection from among + * the level 0 datasets. The "random" datasets are a random + * selection from among all the file's datasets. This scheme + * ensures that the level 0 datasets are interrogated vigorously. + * + * Parameters: const char *filename + * The SWMR test file's name. + * + * unsigned verbose + * Whether verbose console output is desired. + * + * unsigned long nseconds + * The amount of time to read records (ns). + * + * unsigned poll_time + * The amount of time to sleep (s). + * + * unsigned ncommon + * The number of common/non-random datasets that will be opened. + * + * unsigned nrandom + * The number of random datasets that will be opened. + * + * Return: Success: 0 + * Failure: -1 + * + *------------------------------------------------------------------------- + */ +static int +read_records(const char *filename, unsigned verbose, unsigned long nseconds, + unsigned poll_time, unsigned ncommon, unsigned nrandom) +{ + time_t start_time; /* Starting time */ + time_t curr_time; /* Current time */ + symbol_info_t **sym_com = NULL; /* Pointers to array of common dataset IDs */ + symbol_info_t **sym_rand = NULL; /* Pointers to array of random dataset IDs */ + hid_t mem_sid; /* Memory dataspace ID */ + hid_t fid; /* SWMR test file ID */ + symbol_t record; /* The record to add to the dataset */ + unsigned v; /* Local index variable */ + + assert(filename); + assert(nseconds != 0); + assert(poll_time != 0); + + /* Reset the record */ + /* (record's 'info' field might need to change for each record written, also) */ + memset(&record, 0, sizeof(record)); + + /* Emit informational message */ + if(verbose) + fprintf(stderr, "Choosing datasets\n"); + + /* Allocate space for 'common' datasets, if any */ + if(ncommon > 0) { + /* Allocate array to hold pointers to symbols for common datasets */ + if(NULL == (sym_com = (symbol_info_t **)malloc(sizeof(symbol_info_t *) * ncommon))) + return -1; + + /* Open the common datasets */ + for(v = 0; v < ncommon; v++) { + unsigned offset; /* Offset of symbol to use */ + + /* Determine the offset of the symbol, within level 0 symbols */ + /* (level 0 symbols are the most common symbols) */ + offset = (unsigned)(random() % symbol_count[0]); + sym_com[v] = &symbol_info[0][offset]; + + /* Emit informational message */ + if(verbose) + fprintf(stderr, "Common symbol #%u = '%s'\n", v, symbol_info[0][offset].name); + } /* end for */ + } /* end if */ + + /* Allocate space for 'random' datasets, if any */ + if(nrandom > 0) { + /* Allocate array to hold pointers to symbols for random datasets */ + if(NULL == (sym_rand = (symbol_info_t **)malloc(sizeof(symbol_info_t *) * nrandom))) + return -1; + + /* Determine the random datasets */ + for(v = 0; v < nrandom; v++) { + symbol_info_t *sym; /* Symbol to use */ + + /* Determine the symbol, within all symbols */ + if(NULL == (sym = choose_dataset())) + return -1; + sym_rand[v] = sym; + + /* Emit informational message */ + if(verbose) + fprintf(stderr, "Random symbol #%u = '%s'\n", v, sym->name); + } /* end for */ + } /* end if */ + + /* Create a dataspace for the record to read */ + if((mem_sid = H5Screate(H5S_SCALAR)) < 0) + return -1; + + /* Emit informational message */ + if(verbose) + fprintf(stderr, "Reading records\n"); + + /* Get the starting time */ + start_time = time(NULL); + curr_time = start_time; + + /* Loop over reading records until [at least] the correct # of seconds have passed */ + while(curr_time < (time_t)(start_time + (time_t)nseconds)) { + + /* Emit informational message */ + if(verbose) + fprintf(stderr, "Opening file: %s\n", filename); + + /* Open the file */ + if((fid = H5Fopen(filename, H5F_ACC_RDONLY | H5F_ACC_SWMR_READ, H5P_DEFAULT)) < 0) + return -1; + + /* Check 'common' datasets, if any */ + if(ncommon > 0) { + /* Emit informational message */ + if(verbose) + fprintf(stderr, "Checking common symbols\n"); + + /* Iterate over common datasets */ + for(v = 0; v < ncommon; v++) { + /* Check common dataset */ + if(check_dataset(fid, verbose, sym_com[v]->name, &record, mem_sid) < 0) + return -1; + memset(&record, 0, sizeof(record)); + } /* end for */ + } /* end if */ + + /* Check 'random' datasets, if any */ + if(nrandom > 0) { + /* Emit informational message */ + if(verbose) + fprintf(stderr, "Checking random symbols\n"); + + /* Iterate over random datasets */ + for(v = 0; v < nrandom; v++) { + /* Check random dataset */ + if(check_dataset(fid, verbose, sym_rand[v]->name, &record, mem_sid) < 0) + return -1; + memset(&record, 0, sizeof(record)); + } /* end for */ + } /* end if */ + + /* Emit informational message */ + if(verbose) + fprintf(stderr, "Closing file\n"); + + /* Close the file */ + if(H5Fclose(fid) < 0) + return -1; + + /* Sleep for the appropriate # of seconds */ + sleep(poll_time); + + /* Retrieve the current time */ + curr_time = time(NULL); + } /* end while */ + + /* Close the memory dataspace */ + if(H5Sclose(mem_sid) < 0) + return -1; + + /* Emit informational message */ + if(verbose) + fprintf(stderr, "Closing datasets\n"); + + /* Close 'random' datasets, if any */ + if(nrandom > 0) { + /* Release array holding dataset ID's for random datasets */ + free(sym_rand); + } /* end if */ + + /* Close 'common' datasets, if any */ + if(ncommon > 0) { + /* Release array holding dataset ID's for common datasets */ + free(sym_com); + } /* end if */ + + return 0; +} /* end read_records() */ + +static void +usage(void) +{ + printf("\n"); + printf("Usage error!\n"); + printf("\n"); + printf("Usage: swmr_remove_reader [-q] [-s <# of seconds to sleep between\n"); + printf(" polling>] [-h <# of common symbols to poll>] [-l <# of random symbols\n"); + printf(" to poll>] [-r <random seed>] <# of seconds to test>\n"); + printf("\n"); + printf("Defaults to verbose (no '-q' given), 1 second between polling ('-s 1'),\n"); + printf("5 common symbols to poll ('-h 5'), 10 random symbols to poll ('-l 10'),\n"); + printf("and will generate a random seed (no -r given).\n"); + printf("\n"); + exit(1); +} + +int main(int argc, const char *argv[]) +{ + long nseconds = 0; /* # of seconds to test */ + int poll_time = 1; /* # of seconds between polling */ + int ncommon = 5; /* # of common symbols to poll */ + int nrandom = 10; /* # of random symbols to poll */ + unsigned verbose = 1; /* Whether to emit some informational messages */ + unsigned use_seed = 0; /* Set to 1 if a seed was set on the command line */ + unsigned random_seed = 0; /* Random # seed */ + unsigned u; /* Local index variables */ + int temp; + + /* Parse command line options */ + if(argc < 2) + usage(); + if(argc > 1) { + u = 1; + while(u < (unsigned)argc) { + if(argv[u][0] == '-') { + switch(argv[u][1]) { + /* # of common symbols to poll */ + case 'h': + ncommon = atoi(argv[u + 1]); + if(ncommon < 0) + usage(); + u += 2; + break; + + /* # of random symbols to poll */ + case 'l': + nrandom = atoi(argv[u + 1]); + if(nrandom < 0) + usage(); + u += 2; + break; + + /* Be quiet */ + case 'q': + verbose = 0; + u++; + break; + + /* Random # seed */ + case 'r': + use_seed = 1; + temp = atoi(argv[u + 1]); + if(temp < 0) + usage(); + else + random_seed = (unsigned)temp; + u += 2; + break; + + /* # of seconds between polling */ + case 's': + poll_time = atoi(argv[u + 1]); + if(poll_time < 0) + usage(); + u += 2; + break; + + default: + usage(); + break; + } /* end switch */ + } /* end if */ + else { + /* Get the number of records to append */ + nseconds = atol(argv[u]); + if(nseconds <= 0) + usage(); + + u++; + } /* end else */ + } /* end while */ + } /* end if */ + if(nseconds <= 0) + usage(); + if(poll_time >= nseconds) + usage(); + + /* Emit informational message */ + if(verbose) { + fprintf(stderr, "Parameters:\n"); + fprintf(stderr, "\t# of seconds between polling = %d\n", poll_time); + fprintf(stderr, "\t# of common symbols to poll = %d\n", ncommon); + fprintf(stderr, "\t# of random symbols to poll = %d\n", nrandom); + fprintf(stderr, "\t# of seconds to test = %ld\n", nseconds); + } /* end if */ + + /* Set the random seed */ + if(0 == use_seed) { + struct timeval t; + gettimeofday(&t, NULL); + random_seed = (unsigned)((t.tv_sec * 1000) + t.tv_usec); + } /* end if */ + srandom(random_seed); + /* ALWAYS emit the random seed for possible debugging */ + fprintf(stderr, "Using reader random seed: %u\n", random_seed); + + /* Emit informational message */ + if(verbose) + fprintf(stderr, "Generating symbol names\n"); + + /* Generate dataset names */ + if(generate_symbols() < 0) { + fprintf(stderr, "Error generating symbol names!\n"); + exit(1); + } /* end if */ + + /* Create datatype for creating datasets */ + if((symbol_tid = create_symbol_datatype()) < 0) + return -1; + + /* Reading records from datasets */ + if(read_records(FILENAME, verbose, (unsigned long)nseconds, (unsigned)poll_time, (unsigned)ncommon, (unsigned)nrandom) < 0) { + fprintf(stderr, "Error reading records from datasets!\n"); + exit(1); + } /* end if */ + + /* Emit informational message */ + if(verbose) + fprintf(stderr, "Releasing symbols\n"); + + /* Clean up the symbols */ + if(shutdown_symbols() < 0) { + fprintf(stderr, "Error releasing symbols!\n"); + exit(1); + } /* end if */ + + /* Emit informational message */ + if(verbose) + fprintf(stderr, "Closing objects\n"); + + /* Close objects created */ + if(H5Tclose(symbol_tid) < 0) { + fprintf(stderr, "Error closing symbol datatype!\n"); + exit(1); + } /* end if */ + + return 0; +} diff --git a/test/swmr_remove_writer.c b/test/swmr_remove_writer.c index f8fc8d1..562c0a2 100644 --- a/test/swmr_remove_writer.c +++ b/test/swmr_remove_writer.c @@ -1,377 +1,377 @@ -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- * Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
- * All rights reserved. *
- * *
- * This file is part of HDF5. The full HDF5 copyright notice, including *
- * terms governing use, modification, and redistribution, is contained in *
- * the files COPYING and Copyright.html. COPYING can be found at the root *
- * of the source code distribution tree; Copyright.html can be found at the *
- * root level of an installed copy of the electronic HDF5 document set and *
- * is linked from the top-level documents page. It can also be found at *
- * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have *
- * access to either file, you may request a copy from help@hdfgroup.org. *
- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-
-/*-------------------------------------------------------------------------
- *
- * Created: swmr_remove_writer.c
- *
- * Purpose: Removes data from a randomly selected subset of the datasets
- * in the SWMR test file.
- *
- * This program is intended to run concurrently with the
- * swmr_remove_reader program. It is also run AFTER a sequential
- * (not concurrent!) invoking of swmr_writer so the writer
- * can dump a bunch of data into the datasets. Otherwise,
- * there wouldn't be much to shrink :)
- *
- *-------------------------------------------------------------------------
- */
-
-/***********/
-/* Headers */
-/***********/
-
-#include <assert.h>
-#include <sys/time.h>
-
-#include "swmr_common.h"
-
-/****************/
-/* Local Macros */
-/****************/
-
-/* The maximum number of records to remove in one step */
-#define MAX_REMOVE_SIZE 10
-
-/********************/
-/* Local Prototypes */
-/********************/
-
-static hid_t open_skeleton(const char *filename, unsigned verbose);
-static int remove_records(hid_t fid, unsigned verbose, unsigned long nshrinks,
- unsigned long flush_count);
-static void usage(void);
-
-
-/*-------------------------------------------------------------------------
- * Function: open_skeleton
- *
- * Purpose: Opens the SWMR HDF5 file and datasets.
- *
- * Parameters: const char *filename
- * The filename of the SWMR HDF5 file to open
- *
- * unsigned verbose
- * Whether or not to emit verbose console messages
- *
- * Return: Success: The file ID of the opened SWMR file
- * The dataset IDs are stored in a global array
- *
- * Failure: -1
- *
- *-------------------------------------------------------------------------
- */
-static hid_t
-open_skeleton(const char *filename, unsigned verbose)
-{
- hid_t fid; /* File ID for new HDF5 file */
- hid_t fapl; /* File access property list */
- hid_t sid; /* Dataspace ID */
- hsize_t dim[2]; /* Dataspace dimensions */
- unsigned u, v; /* Local index variable */
-
- assert(filename);
-
- /* Create file access property list */
- if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0)
- return -1;
-
- /* Set to use the latest library format */
- if(H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0)
- return -1;
-
-#ifdef QAK
-/* Increase the initial size of the metadata cache */
- {
- H5AC_cache_config_t mdc_config;
-
- mdc_config.version = H5AC__CURR_CACHE_CONFIG_VERSION;
- H5Pget_mdc_config(fapl, &mdc_config);
- fprintf(stderr, "mdc_config.initial_size = %lu\n", (unsigned long)mdc_config.initial_size);
- fprintf(stderr, "mdc_config.epoch_length = %lu\n", (unsigned long)mdc_config.epoch_length);
- mdc_config.set_initial_size = 1;
- mdc_config.initial_size = 16 * 1024 * 1024;
- /* mdc_config.epoch_length = 5000; */
- H5Pset_mdc_config(fapl, &mdc_config);
- }
-#endif /* QAK */
-
-#ifdef QAK
- H5Pset_fapl_log(fapl, "append.log", H5FD_LOG_ALL, (size_t)(512 * 1024 * 1024));
-#endif /* QAK */
-
- /* Open the file */
- if((fid = H5Fopen(filename, H5F_ACC_RDWR | H5F_ACC_SWMR_WRITE, fapl)) < 0)
- return -1;
-
- /* Close file access property list */
- if(H5Pclose(fapl) < 0)
- return -1;
-
- /* Emit informational message */
- if(verbose)
- fprintf(stderr, "Opening datasets\n");
-
- /* Open the datasets */
- for(u = 0; u < NLEVELS; u++)
- for(v = 0; v < symbol_count[u]; v++) {
- if((symbol_info[u][v].dsid = H5Dopen2(fid, symbol_info[u][v].name, H5P_DEFAULT)) < 0)
- return -1;
- if((sid = H5Dget_space(symbol_info[u][v].dsid)) < 0)
- return -1;
- if(2 != H5Sget_simple_extent_ndims(sid))
- return -1;
- if(H5Sget_simple_extent_dims(sid, dim, NULL) < 0)
- return -1;
- symbol_info[u][v].nrecords = dim[1];
- } /* end for */
-
- return fid;
-}
-
-
-/*-------------------------------------------------------------------------
- * Function: remove_records
- *
- * Purpose: Removes a specified number of records from random datasets in
- * the SWMR test file.
- *
- * Parameters: hid_t fid
- * The file ID of the SWMR HDF5 file
- *
- * unsigned verbose
- * Whether or not to emit verbose console messages
- *
- * unsigned long nshrinks
- * # of records to remove from the datasets
- *
- * unsigned long flush_count
- * # of records to write before flushing the file to disk
- *
- * Return: Success: 0
- * Failure: -1
- *
- *-------------------------------------------------------------------------
- */
-static int
-remove_records(hid_t fid, unsigned verbose, unsigned long nshrinks, unsigned long flush_count)
-{
- unsigned long shrink_to_flush; /* # of removals before flush */
- hsize_t dim[2] = {1,0}; /* Dataspace dimensions */
- unsigned long u, v; /* Local index variables */
-
- assert(fid >= 0);
-
- /* Remove records from random datasets, according to frequency distribution */
- shrink_to_flush = flush_count;
- for(u = 0; u < nshrinks; u++) {
- symbol_info_t *symbol; /* Symbol to remove record from */
- hsize_t remove_size; /* Size to reduce dataset dimension by */
-
- /* Get a random dataset, according to the symbol distribution */
- symbol = choose_dataset();
-
- /* Shrink the dataset's dataspace */
- remove_size = (hsize_t)random() % MAX_REMOVE_SIZE + 1;
- if(remove_size > symbol->nrecords)
- symbol->nrecords = 0;
- else
- symbol->nrecords -= remove_size;
- dim[1] = symbol->nrecords;
- if(H5Dset_extent(symbol->dsid, dim) < 0)
- return -1;
-
- /* Check for flushing file */
- if(flush_count > 0) {
- /* Decrement count of records to write before flushing */
- shrink_to_flush--;
-
- /* Check for counter being reached */
- if(0 == shrink_to_flush) {
- /* Flush contents of file */
- if(H5Fflush(fid, H5F_SCOPE_GLOBAL) < 0)
- return -1;
-
- /* Reset flush counter */
- shrink_to_flush = flush_count;
- } /* end if */
- } /* end if */
- } /* end for */
-
- /* Emit informational message */
- if(verbose)
- fprintf(stderr, "Closing datasets\n");
-
- /* Close the datasets */
- for(u = 0; u < NLEVELS; u++)
- for(v = 0; v < symbol_count[u]; v++)
- if(H5Dclose(symbol_info[u][v].dsid) < 0)
- return -1;
-
- return 0;
-}
-
-static void
-usage(void)
-{
- printf("\n");
- printf("Usage error!\n");
- printf("\n");
- printf("Usage: swmr_remove_writer [-q] [-f <# of shrinks between flushing\n");
- printf(" file contents>] [-r <random seed>] <# of shrinks>\n");
- printf("\n");
- printf("<# of shrinks between flushing file contents> should be 0 (for no\n");
- printf("flushing) or between 1 and (<# of shrinks> - 1)\n");
- printf("\n");
- printf("Defaults to verbose (no '-q' given), flushing every 1000 shrinks\n");
- printf("('-f 1000'), and will generate a random seed (no -r given).\n");
- printf("\n");
- exit(1);
-}
-
-int main(int argc, const char *argv[])
-{
- hid_t fid; /* File ID for file opened */
- long nshrinks = 0; /* # of times to shrink the dataset */
- long flush_count = 1000; /* # of records to write between flushing file */
- unsigned verbose = 1; /* Whether to emit some informational messages */
- unsigned use_seed = 0; /* Set to 1 if a seed was set on the command line */
- unsigned random_seed = 0; /* Random # seed */
- unsigned u; /* Local index variable */
- int temp;
-
- /* Parse command line options */
- if(argc < 2)
- usage();
- if(argc > 1) {
- u = 1;
- while(u < (unsigned)argc) {
- if(argv[u][0] == '-') {
- switch(argv[u][1]) {
- /* # of records to write between flushing file */
- case 'f':
- flush_count = atol(argv[u + 1]);
- if(flush_count < 0)
- usage();
- u += 2;
- break;
-
- /* Be quiet */
- case 'q':
- verbose = 0;
- u++;
- break;
-
- /* Random # seed */
- case 'r':
- use_seed = 1;
- temp = atoi(argv[u + 1]);
- if(temp < 0)
- usage();
- else
- random_seed = (unsigned)temp;
- u += 2;
- break;
-
- default:
- usage();
- break;
- } /* end switch */
- } /* end if */
- else {
- /* Get the number of records to append */
- nshrinks = atol(argv[u]);
- if(nshrinks <= 0)
- usage();
-
- u++;
- } /* end else */
- } /* end while */
- } /* end if */
- if(nshrinks <= 0)
- usage();
- if(flush_count >= nshrinks)
- usage();
-
- /* Emit informational message */
- if(verbose) {
- fprintf(stderr, "Parameters:\n");
- fprintf(stderr, "\t# of shrinks between flushes = %ld\n", flush_count);
- fprintf(stderr, "\t# of shrinks = %ld\n", nshrinks);
- } /* end if */
-
- /* Set the random seed */
- if(0 == use_seed) {
- struct timeval t;
- gettimeofday(&t, NULL);
- random_seed = (unsigned)((t.tv_sec * 1000) + t.tv_usec);
- } /* end if */
- srandom(random_seed);
- /* ALWAYS emit the random seed for possible debugging */
- fprintf(stderr, "Using writer random seed: %u\n", random_seed);
-
- /* Emit informational message */
- if(verbose)
- fprintf(stderr, "Generating symbol names\n");
-
- /* Generate dataset names */
- if(generate_symbols() < 0)
- return -1;
-
- /* Emit informational message */
- if(verbose)
- fprintf(stderr, "Opening skeleton file: %s\n", FILENAME);
-
- /* Open file skeleton */
- if((fid = open_skeleton(FILENAME, verbose)) < 0) {
- fprintf(stderr, "Error opening skeleton file!\n");
- exit(1);
- } /* end if */
-
- /* Send a message to indicate "H5Fopen" is complete--releasing the file lock */
- h5_send_message(WRITER_MESSAGE);
-
- /* Emit informational message */
- if(verbose)
- fprintf(stderr, "Removing records\n");
-
- /* Remove records from datasets */
- if(remove_records(fid, verbose, (unsigned long)nshrinks, (unsigned long)flush_count) < 0) {
- fprintf(stderr, "Error removing records from datasets!\n");
- exit(1);
- } /* end if */
-
- /* Emit informational message */
- if(verbose)
- fprintf(stderr, "Releasing symbols\n");
-
- /* Clean up the symbols */
- if(shutdown_symbols() < 0) {
- fprintf(stderr, "Error releasing symbols!\n");
- exit(1);
- } /* end if */
-
- /* Emit informational message */
- if(verbose)
- fprintf(stderr, "Closing objects\n");
-
- /* Close objects opened */
- if(H5Fclose(fid) < 0) {
- fprintf(stderr, "Error closing file!\n");
- exit(1);
- } /* end if */
-
- return 0;
-}
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by The HDF Group. * + * Copyright by the Board of Trustees of the University of Illinois. * + * All rights reserved. * + * * + * This file is part of HDF5. The full HDF5 copyright notice, including * + * terms governing use, modification, and redistribution, is contained in * + * the files COPYING and Copyright.html. COPYING can be found at the root * + * of the source code distribution tree; Copyright.html can be found at the * + * root level of an installed copy of the electronic HDF5 document set and * + * is linked from the top-level documents page. It can also be found at * + * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * + * access to either file, you may request a copy from help@hdfgroup.org. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/*------------------------------------------------------------------------- + * + * Created: swmr_remove_writer.c + * + * Purpose: Removes data from a randomly selected subset of the datasets + * in the SWMR test file. + * + * This program is intended to run concurrently with the + * swmr_remove_reader program. It is also run AFTER a sequential + * (not concurrent!) invoking of swmr_writer so the writer + * can dump a bunch of data into the datasets. Otherwise, + * there wouldn't be much to shrink :) + * + *------------------------------------------------------------------------- + */ + +/***********/ +/* Headers */ +/***********/ + +#include <assert.h> +#include <sys/time.h> + +#include "swmr_common.h" + +/****************/ +/* Local Macros */ +/****************/ + +/* The maximum number of records to remove in one step */ +#define MAX_REMOVE_SIZE 10 + +/********************/ +/* Local Prototypes */ +/********************/ + +static hid_t open_skeleton(const char *filename, unsigned verbose); +static int remove_records(hid_t fid, unsigned verbose, unsigned long nshrinks, + unsigned long flush_count); +static void usage(void); + + +/*------------------------------------------------------------------------- + * Function: open_skeleton + * + * Purpose: Opens the SWMR HDF5 file and datasets. + * + * Parameters: const char *filename + * The filename of the SWMR HDF5 file to open + * + * unsigned verbose + * Whether or not to emit verbose console messages + * + * Return: Success: The file ID of the opened SWMR file + * The dataset IDs are stored in a global array + * + * Failure: -1 + * + *------------------------------------------------------------------------- + */ +static hid_t +open_skeleton(const char *filename, unsigned verbose) +{ + hid_t fid; /* File ID for new HDF5 file */ + hid_t fapl; /* File access property list */ + hid_t sid; /* Dataspace ID */ + hsize_t dim[2]; /* Dataspace dimensions */ + unsigned u, v; /* Local index variable */ + + assert(filename); + + /* Create file access property list */ + if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) + return -1; + + /* Set to use the latest library format */ + if(H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) + return -1; + +#ifdef QAK +/* Increase the initial size of the metadata cache */ + { + H5AC_cache_config_t mdc_config; + + mdc_config.version = H5AC__CURR_CACHE_CONFIG_VERSION; + H5Pget_mdc_config(fapl, &mdc_config); + fprintf(stderr, "mdc_config.initial_size = %lu\n", (unsigned long)mdc_config.initial_size); + fprintf(stderr, "mdc_config.epoch_length = %lu\n", (unsigned long)mdc_config.epoch_length); + mdc_config.set_initial_size = 1; + mdc_config.initial_size = 16 * 1024 * 1024; + /* mdc_config.epoch_length = 5000; */ + H5Pset_mdc_config(fapl, &mdc_config); + } +#endif /* QAK */ + +#ifdef QAK + H5Pset_fapl_log(fapl, "append.log", H5FD_LOG_ALL, (size_t)(512 * 1024 * 1024)); +#endif /* QAK */ + + /* Open the file */ + if((fid = H5Fopen(filename, H5F_ACC_RDWR | H5F_ACC_SWMR_WRITE, fapl)) < 0) + return -1; + + /* Close file access property list */ + if(H5Pclose(fapl) < 0) + return -1; + + /* Emit informational message */ + if(verbose) + fprintf(stderr, "Opening datasets\n"); + + /* Open the datasets */ + for(u = 0; u < NLEVELS; u++) + for(v = 0; v < symbol_count[u]; v++) { + if((symbol_info[u][v].dsid = H5Dopen2(fid, symbol_info[u][v].name, H5P_DEFAULT)) < 0) + return -1; + if((sid = H5Dget_space(symbol_info[u][v].dsid)) < 0) + return -1; + if(2 != H5Sget_simple_extent_ndims(sid)) + return -1; + if(H5Sget_simple_extent_dims(sid, dim, NULL) < 0) + return -1; + symbol_info[u][v].nrecords = dim[1]; + } /* end for */ + + return fid; +} + + +/*------------------------------------------------------------------------- + * Function: remove_records + * + * Purpose: Removes a specified number of records from random datasets in + * the SWMR test file. + * + * Parameters: hid_t fid + * The file ID of the SWMR HDF5 file + * + * unsigned verbose + * Whether or not to emit verbose console messages + * + * unsigned long nshrinks + * # of records to remove from the datasets + * + * unsigned long flush_count + * # of records to write before flushing the file to disk + * + * Return: Success: 0 + * Failure: -1 + * + *------------------------------------------------------------------------- + */ +static int +remove_records(hid_t fid, unsigned verbose, unsigned long nshrinks, unsigned long flush_count) +{ + unsigned long shrink_to_flush; /* # of removals before flush */ + hsize_t dim[2] = {1,0}; /* Dataspace dimensions */ + unsigned long u, v; /* Local index variables */ + + assert(fid >= 0); + + /* Remove records from random datasets, according to frequency distribution */ + shrink_to_flush = flush_count; + for(u = 0; u < nshrinks; u++) { + symbol_info_t *symbol; /* Symbol to remove record from */ + hsize_t remove_size; /* Size to reduce dataset dimension by */ + + /* Get a random dataset, according to the symbol distribution */ + symbol = choose_dataset(); + + /* Shrink the dataset's dataspace */ + remove_size = (hsize_t)random() % MAX_REMOVE_SIZE + 1; + if(remove_size > symbol->nrecords) + symbol->nrecords = 0; + else + symbol->nrecords -= remove_size; + dim[1] = symbol->nrecords; + if(H5Dset_extent(symbol->dsid, dim) < 0) + return -1; + + /* Check for flushing file */ + if(flush_count > 0) { + /* Decrement count of records to write before flushing */ + shrink_to_flush--; + + /* Check for counter being reached */ + if(0 == shrink_to_flush) { + /* Flush contents of file */ + if(H5Fflush(fid, H5F_SCOPE_GLOBAL) < 0) + return -1; + + /* Reset flush counter */ + shrink_to_flush = flush_count; + } /* end if */ + } /* end if */ + } /* end for */ + + /* Emit informational message */ + if(verbose) + fprintf(stderr, "Closing datasets\n"); + + /* Close the datasets */ + for(u = 0; u < NLEVELS; u++) + for(v = 0; v < symbol_count[u]; v++) + if(H5Dclose(symbol_info[u][v].dsid) < 0) + return -1; + + return 0; +} + +static void +usage(void) +{ + printf("\n"); + printf("Usage error!\n"); + printf("\n"); + printf("Usage: swmr_remove_writer [-q] [-f <# of shrinks between flushing\n"); + printf(" file contents>] [-r <random seed>] <# of shrinks>\n"); + printf("\n"); + printf("<# of shrinks between flushing file contents> should be 0 (for no\n"); + printf("flushing) or between 1 and (<# of shrinks> - 1)\n"); + printf("\n"); + printf("Defaults to verbose (no '-q' given), flushing every 1000 shrinks\n"); + printf("('-f 1000'), and will generate a random seed (no -r given).\n"); + printf("\n"); + exit(1); +} + +int main(int argc, const char *argv[]) +{ + hid_t fid; /* File ID for file opened */ + long nshrinks = 0; /* # of times to shrink the dataset */ + long flush_count = 1000; /* # of records to write between flushing file */ + unsigned verbose = 1; /* Whether to emit some informational messages */ + unsigned use_seed = 0; /* Set to 1 if a seed was set on the command line */ + unsigned random_seed = 0; /* Random # seed */ + unsigned u; /* Local index variable */ + int temp; + + /* Parse command line options */ + if(argc < 2) + usage(); + if(argc > 1) { + u = 1; + while(u < (unsigned)argc) { + if(argv[u][0] == '-') { + switch(argv[u][1]) { + /* # of records to write between flushing file */ + case 'f': + flush_count = atol(argv[u + 1]); + if(flush_count < 0) + usage(); + u += 2; + break; + + /* Be quiet */ + case 'q': + verbose = 0; + u++; + break; + + /* Random # seed */ + case 'r': + use_seed = 1; + temp = atoi(argv[u + 1]); + if(temp < 0) + usage(); + else + random_seed = (unsigned)temp; + u += 2; + break; + + default: + usage(); + break; + } /* end switch */ + } /* end if */ + else { + /* Get the number of records to append */ + nshrinks = atol(argv[u]); + if(nshrinks <= 0) + usage(); + + u++; + } /* end else */ + } /* end while */ + } /* end if */ + if(nshrinks <= 0) + usage(); + if(flush_count >= nshrinks) + usage(); + + /* Emit informational message */ + if(verbose) { + fprintf(stderr, "Parameters:\n"); + fprintf(stderr, "\t# of shrinks between flushes = %ld\n", flush_count); + fprintf(stderr, "\t# of shrinks = %ld\n", nshrinks); + } /* end if */ + + /* Set the random seed */ + if(0 == use_seed) { + struct timeval t; + gettimeofday(&t, NULL); + random_seed = (unsigned)((t.tv_sec * 1000) + t.tv_usec); + } /* end if */ + srandom(random_seed); + /* ALWAYS emit the random seed for possible debugging */ + fprintf(stderr, "Using writer random seed: %u\n", random_seed); + + /* Emit informational message */ + if(verbose) + fprintf(stderr, "Generating symbol names\n"); + + /* Generate dataset names */ + if(generate_symbols() < 0) + return -1; + + /* Emit informational message */ + if(verbose) + fprintf(stderr, "Opening skeleton file: %s\n", FILENAME); + + /* Open file skeleton */ + if((fid = open_skeleton(FILENAME, verbose)) < 0) { + fprintf(stderr, "Error opening skeleton file!\n"); + exit(1); + } /* end if */ + + /* Send a message to indicate "H5Fopen" is complete--releasing the file lock */ + h5_send_message(WRITER_MESSAGE); + + /* Emit informational message */ + if(verbose) + fprintf(stderr, "Removing records\n"); + + /* Remove records from datasets */ + if(remove_records(fid, verbose, (unsigned long)nshrinks, (unsigned long)flush_count) < 0) { + fprintf(stderr, "Error removing records from datasets!\n"); + exit(1); + } /* end if */ + + /* Emit informational message */ + if(verbose) + fprintf(stderr, "Releasing symbols\n"); + + /* Clean up the symbols */ + if(shutdown_symbols() < 0) { + fprintf(stderr, "Error releasing symbols!\n"); + exit(1); + } /* end if */ + + /* Emit informational message */ + if(verbose) + fprintf(stderr, "Closing objects\n"); + + /* Close objects opened */ + if(H5Fclose(fid) < 0) { + fprintf(stderr, "Error closing file!\n"); + exit(1); + } /* end if */ + + return 0; +} diff --git a/test/swmr_sparse_reader.c b/test/swmr_sparse_reader.c index 1678949..067cf97 100644 --- a/test/swmr_sparse_reader.c +++ b/test/swmr_sparse_reader.c @@ -1,447 +1,447 @@ -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- * Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
- * All rights reserved. *
- * *
- * This file is part of HDF5. The full HDF5 copyright notice, including *
- * terms governing use, modification, and redistribution, is contained in *
- * the files COPYING and Copyright.html. COPYING can be found at the root *
- * of the source code distribution tree; Copyright.html can be found at the *
- * root level of an installed copy of the electronic HDF5 document set and *
- * is linked from the top-level documents page. It can also be found at *
- * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have *
- * access to either file, you may request a copy from help@hdfgroup.org. *
- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-
-/*-------------------------------------------------------------------------
- *
- * Created: swmr_sparse_reader.c
- *
- * Purpose: Reads data from a randomly selected subset of the datasets
- * in the SWMR test file. Unlike the regular reader, these
- * datasets will be shrinking.
- *
- * This program is intended to run concurrently with the
- * swmr_sparse_writer program.
- *
- *-------------------------------------------------------------------------
- */
-
-/***********/
-/* Headers */
-/***********/
-
-#include <assert.h>
-#include "swmr_common.h"
-
-#include <unistd.h>
-
-/****************/
-/* Local Macros */
-/****************/
-
-#define TIMEOUT 300
-
-/*******************/
-/* Local Variables */
-/*******************/
-
-static hid_t symbol_tid = (-1);
-
-/********************/
-/* Local Prototypes */
-/********************/
-
-static int check_dataset(hid_t fid, unsigned verbose, const symbol_info_t *symbol,
- symbol_t *record, hid_t rec_sid);
-static int read_records(const char *filename, unsigned verbose, unsigned long nrecords,
- unsigned poll_time, unsigned reopen_count);
-static void usage(void);
-
-
-/*-------------------------------------------------------------------------
- * Function: check_dataset
- *
- * Purpose: For a given dataset, checks to make sure that the stated
- * and actual sizes are the same. If they are not, then
- * we have an inconsistent dataset due to a SWMR error.
- *
- * Parameters: hid_t fid
- * The SWMR test file's ID.
- *
- * unsigned verbose
- * Whether verbose console output is desired.
- *
- * const symbol_info_t *symbol
- * The dataset from which to read (the ID is in the struct).
- * Must be pre-allocated.
- *
- * symbol_t *record
- * Memory for the record. Must be pre-allocated.
- *
- * hid_t rec_sid
- * The memory dataspace for access. It's always the same so
- * there is no need to re-create it every time this function
- * is called.
- *
- * Return: Success: 0
- * Failure: -1
- *
- *-------------------------------------------------------------------------
- */
-static int
-check_dataset(hid_t fid, unsigned verbose, const symbol_info_t *symbol, symbol_t *record,
- hid_t rec_sid)
-{
- hid_t dsid; /* Dataset ID */
- hid_t file_sid; /* Dataset's space ID */
- hsize_t start[2] = {0, 0}; /* Hyperslab selection values */
- hsize_t count[2] = {1, 1}; /* Hyperslab selection values */
-
- assert(fid >= 0);
- assert(symbol);
- assert(record);
- assert(rec_sid >= 0);
-
- /* Open dataset for symbol */
- if((dsid = H5Dopen2(fid, symbol->name, H5P_DEFAULT)) < 0)
- return -1;
-
- /* Get the dataset's dataspace */
- if((file_sid = H5Dget_space(dsid)) < 0)
- return -1;
-
- /* Choose the random record in the dataset (will be the same as chosen by
- * the writer) */
- start[1] = (hsize_t)random() % symbol->nrecords;
- if(H5Sselect_hyperslab(file_sid, H5S_SELECT_SET, start, NULL, count, NULL) < 0)
- return -1;
-
- /* Emit informational message */
- if(verbose)
- fprintf(stderr, "Symbol = '%s', location = %lld\n", symbol->name, (long long)start);
-
- /* Read record from dataset */
- record->rec_id = (uint64_t)ULLONG_MAX;
- if(H5Dread(dsid, symbol_tid, rec_sid, file_sid, H5P_DEFAULT, record) < 0)
- return -1;
-
- /* Verify record value */
- if(record->rec_id != start[1]) {
- fprintf(stderr, "*** ERROR ***\n");
- fprintf(stderr, "Incorrect record value!\n");
- fprintf(stderr, "Symbol = '%s', location = %lld, record->rec_id = %llu\n", symbol->name, (long long)start, (unsigned long long)record->rec_id);
- return(-1);
- } /* end if */
-
- /* Close the dataset's dataspace */
- if(H5Sclose(file_sid) < 0)
- return -1;
-
- /* Close dataset for symbol */
- if(H5Dclose(dsid) < 0)
- return -1;
-
- return 0;
-} /* end check_dataset() */
-
-
-/*-------------------------------------------------------------------------
- * Function: read_records
- *
- * Purpose: For a given dataset, checks to make sure that the stated
- * and actual sizes are the same. If they are not, then
- * we have an inconsistent dataset due to a SWMR error.
- *
- * Parameters: const char *filename
- * The SWMR test file's name.
- *
- * unsigned verbose
- * Whether verbose console output is desired.
- *
- * unsigned long nrecords
- * The total number of records to read.
- *
- * unsigned poll_time
- * The amount of time to sleep (s).
- *
- * unsigned reopen_count
- *
- *
- * Return: Success: 0
- * Failure: -1
- *
- *-------------------------------------------------------------------------
- */
-static int
-read_records(const char *filename, unsigned verbose, unsigned long nrecords,
- unsigned poll_time, unsigned reopen_count)
-{
- hid_t fid; /* File ID */
- hid_t aid; /* Attribute ID */
- time_t start_time; /* Starting time */
- hid_t mem_sid; /* Memory dataspace ID */
- symbol_t record; /* The record to add to the dataset */
- unsigned seed; /* Seed for random number generator */
- unsigned iter_to_reopen = reopen_count; /* # of iterations until reopen */
- unsigned long u; /* Local index variable */
- hid_t fapl;
-
- assert(filename);
- assert(poll_time != 0);
-
- fapl = H5Pcreate(H5P_FILE_ACCESS);
- H5Pset_fclose_degree(fapl, H5F_CLOSE_SEMI);
- /* Emit informational message */
- if(verbose)
- fprintf(stderr, "Opening file: %s\n", filename);
-
- /* Open the file */
- if((fid = H5Fopen(filename, H5F_ACC_RDONLY | H5F_ACC_SWMR_READ, fapl)) < 0)
- return -1;
-
- /* Seed the random number generator with the attribute in the file */
- if((aid = H5Aopen(fid, "seed", H5P_DEFAULT)) < 0)
- return -1;
- if(H5Aread(aid, H5T_NATIVE_UINT, &seed) < 0)
- return -1;
- if(H5Aclose(aid) < 0)
- return -1;
- srandom(seed);
-
- /* Reset the record */
- /* (record's 'info' field might need to change for each record written, also) */
- memset(&record, 0, sizeof(record));
-
- /* Create a dataspace for the record to read */
- if((mem_sid = H5Screate(H5S_SCALAR)) < 0)
- return -1;
-
- /* Emit informational message */
- if(verbose)
- fprintf(stderr, "Reading records\n");
-
- /* Get the starting time */
- start_time = time(NULL);
-
- /* Read records */
- for(u = 0; u < nrecords; u++) {
- symbol_info_t *symbol = NULL; /* Symbol (dataset) */
- htri_t attr_exists; /* Whether the sequence number attribute exists */
- unsigned long file_u; /* Attribute sequence number (writer's "u") */
-
- /* Get a random dataset, according to the symbol distribution */
- symbol = choose_dataset();
-
- /* Fill in "nrecords" field. Note that this depends on the writer
- * using the same algorithm and "nrecords" */
- symbol->nrecords = nrecords / 5;
-
- /* Wait until we can read the dataset */
- do {
- /* Check if sequence attribute exists */
- if((attr_exists = H5Aexists_by_name(fid, symbol->name, "seq", H5P_DEFAULT)) < 0)
- return -1;
-
- if(attr_exists) {
- /* Read sequence number attribute */
- if((aid = H5Aopen_by_name(fid, symbol->name, "seq", H5P_DEFAULT, H5P_DEFAULT)) < 0)
- return -1;
- if(H5Aread(aid, H5T_NATIVE_ULONG, &file_u) < 0)
- return -1;
- if(H5Aclose(aid) < 0)
- return -1;
-
- /* Check if sequence number is at least u - if so, this should
- * guarantee that this record has been written */
- if(file_u >= u)
- break;
- } /* end if */
-
- /* Check for timeout */
- if(time(NULL) >= (time_t)(start_time + (time_t)TIMEOUT)) {
- fprintf(stderr, "Reader timed out\n");
- return -1;
- } /* end if */
-
- /* Pause */
- sleep(poll_time);
-
- /* Retrieve and print the collection of metadata read retries */
- if(print_metadata_retries_info(fid) < 0)
- fprintf(stderr, "Warning: could not obtain metadata retries info\n");
-
- /* Reopen the file */
- if(H5Fclose(fid) < 0)
- return -1;
- if((fid = H5Fopen(filename, H5F_ACC_RDONLY | H5F_ACC_SWMR_READ, fapl)) < 0)
- return -1;
- iter_to_reopen = reopen_count;
- } while(1);
-
- /* Emit informational message */
- if(verbose)
- fprintf(stderr, "Checking dataset %lu\n", u);
-
- /* Check dataset */
- if(check_dataset(fid, verbose, symbol, &record, mem_sid) < 0)
- return -1;
- memset(&record, 0, sizeof(record));
-
- /* Check for reopen */
- iter_to_reopen--;
- if(iter_to_reopen == 0) {
- /* Emit informational message */
- if(verbose)
- fprintf(stderr, "Reopening file: %s\n", filename);
-
- /* Retrieve and print the collection of metadata read retries */
- if(print_metadata_retries_info(fid) < 0)
- fprintf(stderr, "Warning: could not obtain metadata retries info\n");
-
- /* Reopen the file */
- if(H5Fclose(fid) < 0)
- return -1;
- if((fid = H5Fopen(filename, H5F_ACC_RDONLY | H5F_ACC_SWMR_READ, fapl)) < 0)
- return -1;
- iter_to_reopen = reopen_count;
- } /* end if */
- } /* end while */
-
- /* Retrieve and print the collection of metadata read retries */
- if(print_metadata_retries_info(fid) < 0)
- fprintf(stderr, "Warning: could not obtain metadata retries info\n");
-
- /* Close file */
- if(H5Fclose(fid) < 0)
- return -1;
-
- /* Close the memory dataspace */
- if(H5Sclose(mem_sid) < 0)
- return -1;
-
- return 0;
-} /* end read_records() */
-
-static void
-usage(void)
-{
- printf("\n");
- printf("Usage error!\n");
- printf("\n");
- printf("Usage: swmr_sparse_reader [-q] [-s <# of seconds to wait for writer>]\n");
- printf(" [-n <# of reads between reopens>] <# of records>\n");
- printf("\n");
- printf("Defaults to verbose (no '-q' given), 1 second wait ('-s 1') and 1 read\n");
- printf("between reopens ('-r 1')\n");
- printf("\n");
- printf("Note that the # of records *must* be the same as that supplied to\n");
- printf("swmr_sparse_writer\n");
- printf("\n");
- exit(1);
-} /* end usage() */
-
-int main(int argc, const char *argv[])
-{
- long nrecords = 0; /* # of records to read */
- int poll_time = 1; /* # of seconds to sleep when waiting for writer */
- int reopen_count = 1; /* # of reads between reopens */
- unsigned verbose = 1; /* Whether to emit some informational messages */
- unsigned u; /* Local index variables */
-
- /* Parse command line options */
- if(argc < 2)
- usage();
- if(argc > 1) {
- u = 1;
- while(u < (unsigned)argc) {
- if(argv[u][0] == '-') {
- switch(argv[u][1]) {
- /* # of reads between reopens */
- case 'n':
- reopen_count = atoi(argv[u + 1]);
- if(reopen_count < 0)
- usage();
- u += 2;
- break;
-
- /* Be quiet */
- case 'q':
- verbose = 0;
- u++;
- break;
-
- /* # of seconds between polling */
- case 's':
- poll_time = atoi(argv[u + 1]);
- if(poll_time < 0)
- usage();
- u += 2;
- break;
-
- default:
- usage();
- break;
- } /* end switch */
- } /* end if */
- else {
- /* Get the number of records to read */
- nrecords = atol(argv[u]);
- if(nrecords <= 0)
- usage();
-
- u++;
- } /* end else */
- } /* end while */
- } /* end if */
-
- /* Emit informational message */
- if(verbose) {
- fprintf(stderr, "Parameters:\n");
- fprintf(stderr, "\t# of seconds between polling = %d\n", poll_time);
- fprintf(stderr, "\t# of reads between reopens = %d\n", reopen_count);
- fprintf(stderr, "\t# of records to read = %ld\n", nrecords);
- } /* end if */
-
- /* Emit informational message */
- if(verbose)
- fprintf(stderr, "Generating symbol names\n");
-
- /* Generate dataset names */
- if(generate_symbols() < 0) {
- fprintf(stderr, "Error generating symbol names!\n");
- exit(1);
- } /* end if */
-
- /* Create datatype for creating datasets */
- if((symbol_tid = create_symbol_datatype()) < 0)
- return -1;
-
- /* Reading records from datasets */
- if(read_records(FILENAME, verbose, (unsigned long) nrecords, (unsigned)poll_time, (unsigned)reopen_count) < 0) {
- fprintf(stderr, "Error reading records from datasets!\n");
- exit(1);
- } /* end if */
-
- /* Emit informational message */
- if(verbose)
- fprintf(stderr, "Releasing symbols\n");
-
- /* Clean up the symbols */
- if(shutdown_symbols() < 0) {
- fprintf(stderr, "Error releasing symbols!\n");
- exit(1);
- } /* end if */
-
- /* Emit informational message */
- if(verbose)
- fprintf(stderr, "Closing objects\n");
-
- /* Close objects created */
- if(H5Tclose(symbol_tid) < 0) {
- fprintf(stderr, "Error closing symbol datatype!\n");
- exit(1);
- } /* end if */
-
- return 0;
-}
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by The HDF Group. * + * Copyright by the Board of Trustees of the University of Illinois. * + * All rights reserved. * + * * + * This file is part of HDF5. The full HDF5 copyright notice, including * + * terms governing use, modification, and redistribution, is contained in * + * the files COPYING and Copyright.html. COPYING can be found at the root * + * of the source code distribution tree; Copyright.html can be found at the * + * root level of an installed copy of the electronic HDF5 document set and * + * is linked from the top-level documents page. It can also be found at * + * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * + * access to either file, you may request a copy from help@hdfgroup.org. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/*------------------------------------------------------------------------- + * + * Created: swmr_sparse_reader.c + * + * Purpose: Reads data from a randomly selected subset of the datasets + * in the SWMR test file. Unlike the regular reader, these + * datasets will be shrinking. + * + * This program is intended to run concurrently with the + * swmr_sparse_writer program. + * + *------------------------------------------------------------------------- + */ + +/***********/ +/* Headers */ +/***********/ + +#include <assert.h> +#include "swmr_common.h" + +#include <unistd.h> + +/****************/ +/* Local Macros */ +/****************/ + +#define TIMEOUT 300 + +/*******************/ +/* Local Variables */ +/*******************/ + +static hid_t symbol_tid = (-1); + +/********************/ +/* Local Prototypes */ +/********************/ + +static int check_dataset(hid_t fid, unsigned verbose, const symbol_info_t *symbol, + symbol_t *record, hid_t rec_sid); +static int read_records(const char *filename, unsigned verbose, unsigned long nrecords, + unsigned poll_time, unsigned reopen_count); +static void usage(void); + + +/*------------------------------------------------------------------------- + * Function: check_dataset + * + * Purpose: For a given dataset, checks to make sure that the stated + * and actual sizes are the same. If they are not, then + * we have an inconsistent dataset due to a SWMR error. + * + * Parameters: hid_t fid + * The SWMR test file's ID. + * + * unsigned verbose + * Whether verbose console output is desired. + * + * const symbol_info_t *symbol + * The dataset from which to read (the ID is in the struct). + * Must be pre-allocated. + * + * symbol_t *record + * Memory for the record. Must be pre-allocated. + * + * hid_t rec_sid + * The memory dataspace for access. It's always the same so + * there is no need to re-create it every time this function + * is called. + * + * Return: Success: 0 + * Failure: -1 + * + *------------------------------------------------------------------------- + */ +static int +check_dataset(hid_t fid, unsigned verbose, const symbol_info_t *symbol, symbol_t *record, + hid_t rec_sid) +{ + hid_t dsid; /* Dataset ID */ + hid_t file_sid; /* Dataset's space ID */ + hsize_t start[2] = {0, 0}; /* Hyperslab selection values */ + hsize_t count[2] = {1, 1}; /* Hyperslab selection values */ + + assert(fid >= 0); + assert(symbol); + assert(record); + assert(rec_sid >= 0); + + /* Open dataset for symbol */ + if((dsid = H5Dopen2(fid, symbol->name, H5P_DEFAULT)) < 0) + return -1; + + /* Get the dataset's dataspace */ + if((file_sid = H5Dget_space(dsid)) < 0) + return -1; + + /* Choose the random record in the dataset (will be the same as chosen by + * the writer) */ + start[1] = (hsize_t)random() % symbol->nrecords; + if(H5Sselect_hyperslab(file_sid, H5S_SELECT_SET, start, NULL, count, NULL) < 0) + return -1; + + /* Emit informational message */ + if(verbose) + fprintf(stderr, "Symbol = '%s', location = %lld\n", symbol->name, (long long)start); + + /* Read record from dataset */ + record->rec_id = (uint64_t)ULLONG_MAX; + if(H5Dread(dsid, symbol_tid, rec_sid, file_sid, H5P_DEFAULT, record) < 0) + return -1; + + /* Verify record value */ + if(record->rec_id != start[1]) { + fprintf(stderr, "*** ERROR ***\n"); + fprintf(stderr, "Incorrect record value!\n"); + fprintf(stderr, "Symbol = '%s', location = %lld, record->rec_id = %llu\n", symbol->name, (long long)start, (unsigned long long)record->rec_id); + return(-1); + } /* end if */ + + /* Close the dataset's dataspace */ + if(H5Sclose(file_sid) < 0) + return -1; + + /* Close dataset for symbol */ + if(H5Dclose(dsid) < 0) + return -1; + + return 0; +} /* end check_dataset() */ + + +/*------------------------------------------------------------------------- + * Function: read_records + * + * Purpose: For a given dataset, checks to make sure that the stated + * and actual sizes are the same. If they are not, then + * we have an inconsistent dataset due to a SWMR error. + * + * Parameters: const char *filename + * The SWMR test file's name. + * + * unsigned verbose + * Whether verbose console output is desired. + * + * unsigned long nrecords + * The total number of records to read. + * + * unsigned poll_time + * The amount of time to sleep (s). + * + * unsigned reopen_count + * + * + * Return: Success: 0 + * Failure: -1 + * + *------------------------------------------------------------------------- + */ +static int +read_records(const char *filename, unsigned verbose, unsigned long nrecords, + unsigned poll_time, unsigned reopen_count) +{ + hid_t fid; /* File ID */ + hid_t aid; /* Attribute ID */ + time_t start_time; /* Starting time */ + hid_t mem_sid; /* Memory dataspace ID */ + symbol_t record; /* The record to add to the dataset */ + unsigned seed; /* Seed for random number generator */ + unsigned iter_to_reopen = reopen_count; /* # of iterations until reopen */ + unsigned long u; /* Local index variable */ + hid_t fapl; + + assert(filename); + assert(poll_time != 0); + + fapl = H5Pcreate(H5P_FILE_ACCESS); + H5Pset_fclose_degree(fapl, H5F_CLOSE_SEMI); + /* Emit informational message */ + if(verbose) + fprintf(stderr, "Opening file: %s\n", filename); + + /* Open the file */ + if((fid = H5Fopen(filename, H5F_ACC_RDONLY | H5F_ACC_SWMR_READ, fapl)) < 0) + return -1; + + /* Seed the random number generator with the attribute in the file */ + if((aid = H5Aopen(fid, "seed", H5P_DEFAULT)) < 0) + return -1; + if(H5Aread(aid, H5T_NATIVE_UINT, &seed) < 0) + return -1; + if(H5Aclose(aid) < 0) + return -1; + srandom(seed); + + /* Reset the record */ + /* (record's 'info' field might need to change for each record written, also) */ + memset(&record, 0, sizeof(record)); + + /* Create a dataspace for the record to read */ + if((mem_sid = H5Screate(H5S_SCALAR)) < 0) + return -1; + + /* Emit informational message */ + if(verbose) + fprintf(stderr, "Reading records\n"); + + /* Get the starting time */ + start_time = time(NULL); + + /* Read records */ + for(u = 0; u < nrecords; u++) { + symbol_info_t *symbol = NULL; /* Symbol (dataset) */ + htri_t attr_exists; /* Whether the sequence number attribute exists */ + unsigned long file_u; /* Attribute sequence number (writer's "u") */ + + /* Get a random dataset, according to the symbol distribution */ + symbol = choose_dataset(); + + /* Fill in "nrecords" field. Note that this depends on the writer + * using the same algorithm and "nrecords" */ + symbol->nrecords = nrecords / 5; + + /* Wait until we can read the dataset */ + do { + /* Check if sequence attribute exists */ + if((attr_exists = H5Aexists_by_name(fid, symbol->name, "seq", H5P_DEFAULT)) < 0) + return -1; + + if(attr_exists) { + /* Read sequence number attribute */ + if((aid = H5Aopen_by_name(fid, symbol->name, "seq", H5P_DEFAULT, H5P_DEFAULT)) < 0) + return -1; + if(H5Aread(aid, H5T_NATIVE_ULONG, &file_u) < 0) + return -1; + if(H5Aclose(aid) < 0) + return -1; + + /* Check if sequence number is at least u - if so, this should + * guarantee that this record has been written */ + if(file_u >= u) + break; + } /* end if */ + + /* Check for timeout */ + if(time(NULL) >= (time_t)(start_time + (time_t)TIMEOUT)) { + fprintf(stderr, "Reader timed out\n"); + return -1; + } /* end if */ + + /* Pause */ + sleep(poll_time); + + /* Retrieve and print the collection of metadata read retries */ + if(print_metadata_retries_info(fid) < 0) + fprintf(stderr, "Warning: could not obtain metadata retries info\n"); + + /* Reopen the file */ + if(H5Fclose(fid) < 0) + return -1; + if((fid = H5Fopen(filename, H5F_ACC_RDONLY | H5F_ACC_SWMR_READ, fapl)) < 0) + return -1; + iter_to_reopen = reopen_count; + } while(1); + + /* Emit informational message */ + if(verbose) + fprintf(stderr, "Checking dataset %lu\n", u); + + /* Check dataset */ + if(check_dataset(fid, verbose, symbol, &record, mem_sid) < 0) + return -1; + memset(&record, 0, sizeof(record)); + + /* Check for reopen */ + iter_to_reopen--; + if(iter_to_reopen == 0) { + /* Emit informational message */ + if(verbose) + fprintf(stderr, "Reopening file: %s\n", filename); + + /* Retrieve and print the collection of metadata read retries */ + if(print_metadata_retries_info(fid) < 0) + fprintf(stderr, "Warning: could not obtain metadata retries info\n"); + + /* Reopen the file */ + if(H5Fclose(fid) < 0) + return -1; + if((fid = H5Fopen(filename, H5F_ACC_RDONLY | H5F_ACC_SWMR_READ, fapl)) < 0) + return -1; + iter_to_reopen = reopen_count; + } /* end if */ + } /* end while */ + + /* Retrieve and print the collection of metadata read retries */ + if(print_metadata_retries_info(fid) < 0) + fprintf(stderr, "Warning: could not obtain metadata retries info\n"); + + /* Close file */ + if(H5Fclose(fid) < 0) + return -1; + + /* Close the memory dataspace */ + if(H5Sclose(mem_sid) < 0) + return -1; + + return 0; +} /* end read_records() */ + +static void +usage(void) +{ + printf("\n"); + printf("Usage error!\n"); + printf("\n"); + printf("Usage: swmr_sparse_reader [-q] [-s <# of seconds to wait for writer>]\n"); + printf(" [-n <# of reads between reopens>] <# of records>\n"); + printf("\n"); + printf("Defaults to verbose (no '-q' given), 1 second wait ('-s 1') and 1 read\n"); + printf("between reopens ('-r 1')\n"); + printf("\n"); + printf("Note that the # of records *must* be the same as that supplied to\n"); + printf("swmr_sparse_writer\n"); + printf("\n"); + exit(1); +} /* end usage() */ + +int main(int argc, const char *argv[]) +{ + long nrecords = 0; /* # of records to read */ + int poll_time = 1; /* # of seconds to sleep when waiting for writer */ + int reopen_count = 1; /* # of reads between reopens */ + unsigned verbose = 1; /* Whether to emit some informational messages */ + unsigned u; /* Local index variables */ + + /* Parse command line options */ + if(argc < 2) + usage(); + if(argc > 1) { + u = 1; + while(u < (unsigned)argc) { + if(argv[u][0] == '-') { + switch(argv[u][1]) { + /* # of reads between reopens */ + case 'n': + reopen_count = atoi(argv[u + 1]); + if(reopen_count < 0) + usage(); + u += 2; + break; + + /* Be quiet */ + case 'q': + verbose = 0; + u++; + break; + + /* # of seconds between polling */ + case 's': + poll_time = atoi(argv[u + 1]); + if(poll_time < 0) + usage(); + u += 2; + break; + + default: + usage(); + break; + } /* end switch */ + } /* end if */ + else { + /* Get the number of records to read */ + nrecords = atol(argv[u]); + if(nrecords <= 0) + usage(); + + u++; + } /* end else */ + } /* end while */ + } /* end if */ + + /* Emit informational message */ + if(verbose) { + fprintf(stderr, "Parameters:\n"); + fprintf(stderr, "\t# of seconds between polling = %d\n", poll_time); + fprintf(stderr, "\t# of reads between reopens = %d\n", reopen_count); + fprintf(stderr, "\t# of records to read = %ld\n", nrecords); + } /* end if */ + + /* Emit informational message */ + if(verbose) + fprintf(stderr, "Generating symbol names\n"); + + /* Generate dataset names */ + if(generate_symbols() < 0) { + fprintf(stderr, "Error generating symbol names!\n"); + exit(1); + } /* end if */ + + /* Create datatype for creating datasets */ + if((symbol_tid = create_symbol_datatype()) < 0) + return -1; + + /* Reading records from datasets */ + if(read_records(FILENAME, verbose, (unsigned long) nrecords, (unsigned)poll_time, (unsigned)reopen_count) < 0) { + fprintf(stderr, "Error reading records from datasets!\n"); + exit(1); + } /* end if */ + + /* Emit informational message */ + if(verbose) + fprintf(stderr, "Releasing symbols\n"); + + /* Clean up the symbols */ + if(shutdown_symbols() < 0) { + fprintf(stderr, "Error releasing symbols!\n"); + exit(1); + } /* end if */ + + /* Emit informational message */ + if(verbose) + fprintf(stderr, "Closing objects\n"); + + /* Close objects created */ + if(H5Tclose(symbol_tid) < 0) { + fprintf(stderr, "Error closing symbol datatype!\n"); + exit(1); + } /* end if */ + + return 0; +} diff --git a/test/swmr_sparse_writer.c b/test/swmr_sparse_writer.c index 5866b38..77d012e 100644 --- a/test/swmr_sparse_writer.c +++ b/test/swmr_sparse_writer.c @@ -1,454 +1,454 @@ -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- * Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
- * All rights reserved. *
- * *
- * This file is part of HDF5. The full HDF5 copyright notice, including *
- * terms governing use, modification, and redistribution, is contained in *
- * the files COPYING and Copyright.html. COPYING can be found at the root *
- * of the source code distribution tree; Copyright.html can be found at the *
- * root level of an installed copy of the electronic HDF5 document set and *
- * is linked from the top-level documents page. It can also be found at *
- * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have *
- * access to either file, you may request a copy from help@hdfgroup.org. *
- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-
- /*-------------------------------------------------------------------------
- *
- * Created: swmr_sparse_writer.c
- *
- * Purpose: Writes data to a randomly selected subset of the datasets
- * in the SWMR test file.
- *
- * This program is intended to run concurrently with the
- * swmr_sparse_reader program.
- *
- *-------------------------------------------------------------------------
- */
-
-/***********/
-/* Headers */
-/***********/
-
-#include <assert.h>
-
-#include "swmr_common.h"
-
-/****************/
-/* Local Macros */
-/****************/
-
-#define BUSY_WAIT 100000
-
-/********************/
-/* Local Prototypes */
-/********************/
-
-static hid_t open_skeleton(const char *filename, unsigned verbose);
-static int add_records(hid_t fid, unsigned verbose, unsigned long nrecords,
- unsigned long flush_count);
-static void usage(void);
-
-
-
-/*-------------------------------------------------------------------------
- * Function: open_skeleton
- *
- * Purpose: Opens the SWMR HDF5 file and datasets.
- *
- * Parameters: const char *filename
- * The filename of the SWMR HDF5 file to open
- *
- * unsigned verbose
- * Whether or not to emit verbose console messages
- *
- * Return: Success: The file ID of the opened SWMR file
- * The dataset IDs are stored in a global array
- *
- * Failure: -1
- *
- *-------------------------------------------------------------------------
- */
-static hid_t
-open_skeleton(const char *filename, unsigned verbose)
-{
- hid_t fid; /* File ID for new HDF5 file */
- hid_t fapl; /* File access property list */
- hid_t aid; /* Attribute ID */
- unsigned seed; /* Seed for random number generator */
- unsigned u, v; /* Local index variable */
-
- assert(filename);
-
- /* Create file access property list */
- if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0)
- return -1;
-
- /* Set to use the latest library format */
- if(H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0)
- return -1;
-
-#ifdef QAK
- /* Increase the initial size of the metadata cache */
- {
- H5AC_cache_config_t mdc_config;
-
- mdc_config.version = H5AC__CURR_CACHE_CONFIG_VERSION;
- H5Pget_mdc_config(fapl, &mdc_config);
- fprintf(stderr, "mdc_config.initial_size = %lu\n", (unsigned long)mdc_config.initial_size);
- fprintf(stderr,"mdc_config.epoch_length = %lu\n", (unsigned long)mdc_config.epoch_length);
- mdc_config.set_initial_size = 1;
- mdc_config.initial_size = 16 * 1024 * 1024;
- /* mdc_config.epoch_length = 5000; */
- H5Pset_mdc_config(fapl, &mdc_config);
- }
-#endif /* QAK */
-
-#ifdef QAK
- H5Pset_fapl_log(fapl, "append.log", H5FD_LOG_ALL, (size_t)(512 * 1024 * 1024));
-#endif /* QAK */
-
- /* Open the file */
- if((fid = H5Fopen(filename, H5F_ACC_RDWR | H5F_ACC_SWMR_WRITE, fapl)) < 0)
- return -1;
-
- /* Close file access property list */
- if(H5Pclose(fapl) < 0)
- return -1;
-
- /* Emit informational message */
- if(verbose)
- fprintf(stderr, "Opening datasets\n");
-
- /* Seed the random number generator with the attribute in the file */
- if((aid = H5Aopen(fid, "seed", H5P_DEFAULT)) < 0)
- return -1;
- if(H5Aread(aid, H5T_NATIVE_UINT, &seed) < 0)
- return -1;
- if(H5Aclose(aid) < 0)
- return -1;
- srandom(seed);
-
- /* Open the datasets */
- for(u = 0; u < NLEVELS; u++)
- for(v = 0; v < symbol_count[u]; v++) {
- if((symbol_info[u][v].dsid = H5Dopen2(fid, symbol_info[u][v].name, H5P_DEFAULT)) < 0)
- return(-1);
- symbol_info[u][v].nrecords = 0;
- } /* end for */
-
- return fid;
-}
-
-
-/*-------------------------------------------------------------------------
- * Function: add_records
- *
- * Purpose: Writes a specified number of records to random datasets in
- * the SWMR test file.
- *
- * Parameters: hid_t fid
- * The file ID of the SWMR HDF5 file
- *
- * unsigned verbose
- * Whether or not to emit verbose console messages
- *
- * unsigned long nrecords
- * # of records to write to the datasets
- *
- * unsigned long flush_count
- * # of records to write before flushing the file to disk
- *
- * Return: Success: 0
- * Failure: -1
- *
- *-------------------------------------------------------------------------
- */
-static int
-add_records(hid_t fid, unsigned verbose, unsigned long nrecords, unsigned long flush_count)
-{
- hid_t tid; /* Datatype ID for records */
- hid_t mem_sid; /* Memory dataspace ID */
- hsize_t start[2] = {0, 0}; /* Hyperslab selection values */
- hsize_t count[2] = {1, 1}; /* Hyperslab selection values */
- symbol_t record; /* The record to add to the dataset */
- H5AC_cache_config_t mdc_config_orig; /* Original metadata cache configuration */
- H5AC_cache_config_t mdc_config_cork; /* Corked metadata cache configuration */
- unsigned long rec_to_flush; /* # of records left to write before flush */
- volatile int dummy; /* Dummy varialbe for busy sleep */
- hsize_t dim[2] = {1,0}; /* Dataspace dimensions */
- unsigned long u, v; /* Local index variables */
-
- assert(fid >= 0);
-
- /* Reset the record */
- /* (record's 'info' field might need to change for each record written, also) */
- memset(&record, 0, sizeof(record));
-
- /* Create a dataspace for the record to add */
- if((mem_sid = H5Screate(H5S_SCALAR)) < 0)
- return -1;
-
- /* Create datatype for appending records */
- if((tid = create_symbol_datatype()) < 0)
- return -1;
-
- /* Get the current metadata cache configuration, and set up the corked
- * configuration */
- mdc_config_orig.version = H5AC__CURR_CACHE_CONFIG_VERSION;
- if(H5Fget_mdc_config(fid, &mdc_config_orig) < 0)
- return -1;
- memcpy(&mdc_config_cork, &mdc_config_orig, sizeof(mdc_config_cork));
- mdc_config_cork.evictions_enabled = FALSE;
- mdc_config_cork.incr_mode = H5C_incr__off;
- mdc_config_cork.flash_incr_mode = H5C_flash_incr__off;
- mdc_config_cork.decr_mode = H5C_decr__off;
-
- /* Add records to random datasets, according to frequency distribution */
- rec_to_flush = flush_count;
- for(u = 0; u < nrecords; u++) {
- symbol_info_t *symbol; /* Symbol to write record to */
- hid_t file_sid; /* Dataset's space ID */
- hid_t aid; /* Attribute ID */
-
- /* Get a random dataset, according to the symbol distribution */
- symbol = choose_dataset();
-
- /* Cork the metadata cache, to prevent the object header from being
- * flushed before the data has been written */
- /*if(H5Fset_mdc_config(fid, &mdc_config_cork) < 0)
- return(-1);*/
-
- /* If this is the first time the dataset has been opened, extend it and
- * add the sequence attribute */
- if(symbol->nrecords == 0) {
- symbol->nrecords = nrecords / 5;
- dim[1] = symbol->nrecords;
-
- if(H5Dset_extent(symbol->dsid, dim) < 0)
- return -1;
-
- if((file_sid = H5Screate(H5S_SCALAR)) < 0)
- return -1;
- if((aid = H5Acreate2(symbol->dsid, "seq", H5T_NATIVE_ULONG, file_sid, H5P_DEFAULT, H5P_DEFAULT)) < 0)
- return -1;
- if(H5Sclose(file_sid) < 0)
- return -1;
- } /* end if */
- else if((aid = H5Aopen(symbol->dsid, "seq", H5P_DEFAULT)) < 0)
- return -1;
-
- /* Get the coordinate to write */
- start[1] = (hsize_t)random() % symbol->nrecords;
-
- /* Set the record's ID (equal to its position) */
- record.rec_id = start[1];
-
- /* Get the dataset's dataspace */
- if((file_sid = H5Dget_space(symbol->dsid)) < 0)
- return -1;
-
- /* Choose a random record in the dataset */
- if(H5Sselect_hyperslab(file_sid, H5S_SELECT_SET, start, NULL, count, NULL) < 0)
- return -1;
-
- /* Write record to the dataset */
- if(H5Dwrite(symbol->dsid, tid, mem_sid, file_sid, H5P_DEFAULT, &record) < 0)
- return -1;
-
- /* Write the sequence number attribute. Since we synchronize the random
- * number seed, the readers will always generate the same sequence of
- * randomly chosen datasets and offsets. Therefore, and because of the
- * flush dependencies on the object header, the reader will be
- * guaranteed to see the written data if the sequence attribute is >=u.
- */
- if(H5Awrite(aid, H5T_NATIVE_ULONG, &u) < 0)
- return -1;
-
- /* Close the attribute */
- if(H5Aclose(aid) < 0)
- return -1;
-
- /* Uncork the metadata cache */
- /*if(H5Fset_mdc_config(fid, &mdc_config_orig) < 0)
- return(-1);*/
-
- /* Close the dataset's dataspace */
- if(H5Sclose(file_sid) < 0)
- return -1;
-
- /* Check for flushing file */
- if(flush_count > 0) {
- /* Decrement count of records to write before flushing */
- rec_to_flush--;
-
- /* Check for counter being reached */
- if(0 == rec_to_flush) {
- /* Flush contents of file */
- if(H5Fflush(fid, H5F_SCOPE_GLOBAL) < 0)
- return -1;
-
- /* Reset flush counter */
- rec_to_flush = flush_count;
- } /* end if */
- } /* end if */
-
-#ifdef OUT
- /* Busy wait, to let readers catch up */
- dummy = 0;
- for(v=0; v<BUSY_WAIT; v++)
- dummy++;
- if((unsigned long)dummy != v)
- return -1;
-#endif
- } /* end for */
-
- /* Close the memory dataspace */
- if(H5Sclose(mem_sid) < 0)
- return -1;
-
- /* Close the datatype */
- if(H5Tclose(tid) < 0)
- return -1;
-
- /* Emit informational message */
- if(verbose)
- fprintf(stderr, "Closing datasets\n");
-
- /* Close the datasets */
- for(u = 0; u < NLEVELS; u++)
- for(v = 0; v < symbol_count[u]; v++)
- if(H5Dclose(symbol_info[u][v].dsid) < 0)
- return -1;
-
- return 0;
-}
-
-static void
-usage(void)
-{
- printf("\n");
- printf("Usage error!\n");
- printf("\n");
- printf("Usage: swmr_sparse_writer [-q] [-f <# of records to write between\n");
- printf(" flushing file contents>] <# of records>\n");
- printf("\n");
- printf("<# of records to write between flushing file contents> should be 0\n");
- printf("(for no flushing) or between 1 and (<# of records> - 1)\n");
- printf("\n");
- printf("Defaults to verbose (no '-q' given) and flushing every 1000 records\n");
- printf("('-f 1000')\n");
- printf("\n");
- exit(1);
-}
-
-int main(int argc, const char *argv[])
-{
- hid_t fid; /* File ID for file opened */
- long nrecords = 0; /* # of records to append */
- long flush_count = 1000; /* # of records to write between flushing file */
- unsigned verbose = 1; /* Whether to emit some informational messages */
- unsigned u; /* Local index variable */
-
- /* Parse command line options */
- if(argc < 2)
- usage();
- if(argc > 1) {
- u = 1;
- while(u < (unsigned)argc) {
- if(argv[u][0] == '-') {
- switch(argv[u][1]) {
- /* # of records to write between flushing file */
- case 'f':
- flush_count = atol(argv[u + 1]);
- if(flush_count < 0)
- usage();
- u += 2;
- break;
-
- /* Be quiet */
- case 'q':
- verbose = 0;
- u++;
- break;
-
- default:
- usage();
- break;
- } /* end switch */
- } /* end if */
- else {
- /* Get the number of records to append */
- nrecords = atol(argv[u]);
- if(nrecords <= 0)
- usage();
-
- u++;
- } /* end else */
- } /* end while */
- } /* end if */
- if(nrecords <= 0)
- usage();
- if(flush_count >= nrecords)
- usage();
-
- /* Emit informational message */
- if(verbose) {
- fprintf(stderr, "Parameters:\n");
- fprintf(stderr, "\t# of records between flushes = %ld\n", flush_count);
- fprintf(stderr, "\t# of records to write = %ld\n", nrecords);
- } /* end if */
-
- /* Emit informational message */
- if(verbose)
- fprintf(stderr, "Generating symbol names\n");
-
- /* Generate dataset names */
- if(generate_symbols() < 0)
- return -1;
-
- /* Emit informational message */
- if(verbose)
- fprintf(stderr, "Opening skeleton file: %s\n", FILENAME);
-
- /* Open file skeleton */
- if((fid = open_skeleton(FILENAME, verbose)) < 0) {
- fprintf(stderr, "Error opening skeleton file!\n");
- exit(1);
- } /* end if */
-
- /* Send a message to indicate "H5Fopen" is complete--releasing the file lock */
- h5_send_message(WRITER_MESSAGE);
-
- /* Emit informational message */
- if(verbose)
- fprintf(stderr, "Adding records\n");
-
- /* Append records to datasets */
- if(add_records(fid, verbose, (unsigned long)nrecords, (unsigned long)flush_count) < 0) {
- fprintf(stderr, "Error appending records to datasets!\n");
- exit(1);
- } /* end if */
-
- /* Emit informational message */
- if(verbose)
- fprintf(stderr, "Releasing symbols\n");
-
- /* Clean up the symbols */
- if(shutdown_symbols() < 0) {
- fprintf(stderr, "Error releasing symbols!\n");
- exit(1);
- } /* end if */
-
- /* Emit informational message */
- if(verbose)
- fprintf(stderr, "Closing objects\n");
-
- /* Close objects opened */
- if(H5Fclose(fid) < 0) {
- fprintf(stderr, "Error closing file!\n");
- exit(1);
- } /* end if */
-
- return 0;
-}
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by The HDF Group. * + * Copyright by the Board of Trustees of the University of Illinois. * + * All rights reserved. * + * * + * This file is part of HDF5. The full HDF5 copyright notice, including * + * terms governing use, modification, and redistribution, is contained in * + * the files COPYING and Copyright.html. COPYING can be found at the root * + * of the source code distribution tree; Copyright.html can be found at the * + * root level of an installed copy of the electronic HDF5 document set and * + * is linked from the top-level documents page. It can also be found at * + * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * + * access to either file, you may request a copy from help@hdfgroup.org. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + + /*------------------------------------------------------------------------- + * + * Created: swmr_sparse_writer.c + * + * Purpose: Writes data to a randomly selected subset of the datasets + * in the SWMR test file. + * + * This program is intended to run concurrently with the + * swmr_sparse_reader program. + * + *------------------------------------------------------------------------- + */ + +/***********/ +/* Headers */ +/***********/ + +#include <assert.h> + +#include "swmr_common.h" + +/****************/ +/* Local Macros */ +/****************/ + +#define BUSY_WAIT 100000 + +/********************/ +/* Local Prototypes */ +/********************/ + +static hid_t open_skeleton(const char *filename, unsigned verbose); +static int add_records(hid_t fid, unsigned verbose, unsigned long nrecords, + unsigned long flush_count); +static void usage(void); + + + +/*------------------------------------------------------------------------- + * Function: open_skeleton + * + * Purpose: Opens the SWMR HDF5 file and datasets. + * + * Parameters: const char *filename + * The filename of the SWMR HDF5 file to open + * + * unsigned verbose + * Whether or not to emit verbose console messages + * + * Return: Success: The file ID of the opened SWMR file + * The dataset IDs are stored in a global array + * + * Failure: -1 + * + *------------------------------------------------------------------------- + */ +static hid_t +open_skeleton(const char *filename, unsigned verbose) +{ + hid_t fid; /* File ID for new HDF5 file */ + hid_t fapl; /* File access property list */ + hid_t aid; /* Attribute ID */ + unsigned seed; /* Seed for random number generator */ + unsigned u, v; /* Local index variable */ + + assert(filename); + + /* Create file access property list */ + if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) + return -1; + + /* Set to use the latest library format */ + if(H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) + return -1; + +#ifdef QAK + /* Increase the initial size of the metadata cache */ + { + H5AC_cache_config_t mdc_config; + + mdc_config.version = H5AC__CURR_CACHE_CONFIG_VERSION; + H5Pget_mdc_config(fapl, &mdc_config); + fprintf(stderr, "mdc_config.initial_size = %lu\n", (unsigned long)mdc_config.initial_size); + fprintf(stderr,"mdc_config.epoch_length = %lu\n", (unsigned long)mdc_config.epoch_length); + mdc_config.set_initial_size = 1; + mdc_config.initial_size = 16 * 1024 * 1024; + /* mdc_config.epoch_length = 5000; */ + H5Pset_mdc_config(fapl, &mdc_config); + } +#endif /* QAK */ + +#ifdef QAK + H5Pset_fapl_log(fapl, "append.log", H5FD_LOG_ALL, (size_t)(512 * 1024 * 1024)); +#endif /* QAK */ + + /* Open the file */ + if((fid = H5Fopen(filename, H5F_ACC_RDWR | H5F_ACC_SWMR_WRITE, fapl)) < 0) + return -1; + + /* Close file access property list */ + if(H5Pclose(fapl) < 0) + return -1; + + /* Emit informational message */ + if(verbose) + fprintf(stderr, "Opening datasets\n"); + + /* Seed the random number generator with the attribute in the file */ + if((aid = H5Aopen(fid, "seed", H5P_DEFAULT)) < 0) + return -1; + if(H5Aread(aid, H5T_NATIVE_UINT, &seed) < 0) + return -1; + if(H5Aclose(aid) < 0) + return -1; + srandom(seed); + + /* Open the datasets */ + for(u = 0; u < NLEVELS; u++) + for(v = 0; v < symbol_count[u]; v++) { + if((symbol_info[u][v].dsid = H5Dopen2(fid, symbol_info[u][v].name, H5P_DEFAULT)) < 0) + return(-1); + symbol_info[u][v].nrecords = 0; + } /* end for */ + + return fid; +} + + +/*------------------------------------------------------------------------- + * Function: add_records + * + * Purpose: Writes a specified number of records to random datasets in + * the SWMR test file. + * + * Parameters: hid_t fid + * The file ID of the SWMR HDF5 file + * + * unsigned verbose + * Whether or not to emit verbose console messages + * + * unsigned long nrecords + * # of records to write to the datasets + * + * unsigned long flush_count + * # of records to write before flushing the file to disk + * + * Return: Success: 0 + * Failure: -1 + * + *------------------------------------------------------------------------- + */ +static int +add_records(hid_t fid, unsigned verbose, unsigned long nrecords, unsigned long flush_count) +{ + hid_t tid; /* Datatype ID for records */ + hid_t mem_sid; /* Memory dataspace ID */ + hsize_t start[2] = {0, 0}; /* Hyperslab selection values */ + hsize_t count[2] = {1, 1}; /* Hyperslab selection values */ + symbol_t record; /* The record to add to the dataset */ + H5AC_cache_config_t mdc_config_orig; /* Original metadata cache configuration */ + H5AC_cache_config_t mdc_config_cork; /* Corked metadata cache configuration */ + unsigned long rec_to_flush; /* # of records left to write before flush */ + volatile int dummy; /* Dummy varialbe for busy sleep */ + hsize_t dim[2] = {1,0}; /* Dataspace dimensions */ + unsigned long u, v; /* Local index variables */ + + assert(fid >= 0); + + /* Reset the record */ + /* (record's 'info' field might need to change for each record written, also) */ + memset(&record, 0, sizeof(record)); + + /* Create a dataspace for the record to add */ + if((mem_sid = H5Screate(H5S_SCALAR)) < 0) + return -1; + + /* Create datatype for appending records */ + if((tid = create_symbol_datatype()) < 0) + return -1; + + /* Get the current metadata cache configuration, and set up the corked + * configuration */ + mdc_config_orig.version = H5AC__CURR_CACHE_CONFIG_VERSION; + if(H5Fget_mdc_config(fid, &mdc_config_orig) < 0) + return -1; + memcpy(&mdc_config_cork, &mdc_config_orig, sizeof(mdc_config_cork)); + mdc_config_cork.evictions_enabled = FALSE; + mdc_config_cork.incr_mode = H5C_incr__off; + mdc_config_cork.flash_incr_mode = H5C_flash_incr__off; + mdc_config_cork.decr_mode = H5C_decr__off; + + /* Add records to random datasets, according to frequency distribution */ + rec_to_flush = flush_count; + for(u = 0; u < nrecords; u++) { + symbol_info_t *symbol; /* Symbol to write record to */ + hid_t file_sid; /* Dataset's space ID */ + hid_t aid; /* Attribute ID */ + + /* Get a random dataset, according to the symbol distribution */ + symbol = choose_dataset(); + + /* Cork the metadata cache, to prevent the object header from being + * flushed before the data has been written */ + /*if(H5Fset_mdc_config(fid, &mdc_config_cork) < 0) + return(-1);*/ + + /* If this is the first time the dataset has been opened, extend it and + * add the sequence attribute */ + if(symbol->nrecords == 0) { + symbol->nrecords = nrecords / 5; + dim[1] = symbol->nrecords; + + if(H5Dset_extent(symbol->dsid, dim) < 0) + return -1; + + if((file_sid = H5Screate(H5S_SCALAR)) < 0) + return -1; + if((aid = H5Acreate2(symbol->dsid, "seq", H5T_NATIVE_ULONG, file_sid, H5P_DEFAULT, H5P_DEFAULT)) < 0) + return -1; + if(H5Sclose(file_sid) < 0) + return -1; + } /* end if */ + else if((aid = H5Aopen(symbol->dsid, "seq", H5P_DEFAULT)) < 0) + return -1; + + /* Get the coordinate to write */ + start[1] = (hsize_t)random() % symbol->nrecords; + + /* Set the record's ID (equal to its position) */ + record.rec_id = start[1]; + + /* Get the dataset's dataspace */ + if((file_sid = H5Dget_space(symbol->dsid)) < 0) + return -1; + + /* Choose a random record in the dataset */ + if(H5Sselect_hyperslab(file_sid, H5S_SELECT_SET, start, NULL, count, NULL) < 0) + return -1; + + /* Write record to the dataset */ + if(H5Dwrite(symbol->dsid, tid, mem_sid, file_sid, H5P_DEFAULT, &record) < 0) + return -1; + + /* Write the sequence number attribute. Since we synchronize the random + * number seed, the readers will always generate the same sequence of + * randomly chosen datasets and offsets. Therefore, and because of the + * flush dependencies on the object header, the reader will be + * guaranteed to see the written data if the sequence attribute is >=u. + */ + if(H5Awrite(aid, H5T_NATIVE_ULONG, &u) < 0) + return -1; + + /* Close the attribute */ + if(H5Aclose(aid) < 0) + return -1; + + /* Uncork the metadata cache */ + /*if(H5Fset_mdc_config(fid, &mdc_config_orig) < 0) + return(-1);*/ + + /* Close the dataset's dataspace */ + if(H5Sclose(file_sid) < 0) + return -1; + + /* Check for flushing file */ + if(flush_count > 0) { + /* Decrement count of records to write before flushing */ + rec_to_flush--; + + /* Check for counter being reached */ + if(0 == rec_to_flush) { + /* Flush contents of file */ + if(H5Fflush(fid, H5F_SCOPE_GLOBAL) < 0) + return -1; + + /* Reset flush counter */ + rec_to_flush = flush_count; + } /* end if */ + } /* end if */ + +#ifdef OUT + /* Busy wait, to let readers catch up */ + dummy = 0; + for(v=0; v<BUSY_WAIT; v++) + dummy++; + if((unsigned long)dummy != v) + return -1; +#endif + } /* end for */ + + /* Close the memory dataspace */ + if(H5Sclose(mem_sid) < 0) + return -1; + + /* Close the datatype */ + if(H5Tclose(tid) < 0) + return -1; + + /* Emit informational message */ + if(verbose) + fprintf(stderr, "Closing datasets\n"); + + /* Close the datasets */ + for(u = 0; u < NLEVELS; u++) + for(v = 0; v < symbol_count[u]; v++) + if(H5Dclose(symbol_info[u][v].dsid) < 0) + return -1; + + return 0; +} + +static void +usage(void) +{ + printf("\n"); + printf("Usage error!\n"); + printf("\n"); + printf("Usage: swmr_sparse_writer [-q] [-f <# of records to write between\n"); + printf(" flushing file contents>] <# of records>\n"); + printf("\n"); + printf("<# of records to write between flushing file contents> should be 0\n"); + printf("(for no flushing) or between 1 and (<# of records> - 1)\n"); + printf("\n"); + printf("Defaults to verbose (no '-q' given) and flushing every 1000 records\n"); + printf("('-f 1000')\n"); + printf("\n"); + exit(1); +} + +int main(int argc, const char *argv[]) +{ + hid_t fid; /* File ID for file opened */ + long nrecords = 0; /* # of records to append */ + long flush_count = 1000; /* # of records to write between flushing file */ + unsigned verbose = 1; /* Whether to emit some informational messages */ + unsigned u; /* Local index variable */ + + /* Parse command line options */ + if(argc < 2) + usage(); + if(argc > 1) { + u = 1; + while(u < (unsigned)argc) { + if(argv[u][0] == '-') { + switch(argv[u][1]) { + /* # of records to write between flushing file */ + case 'f': + flush_count = atol(argv[u + 1]); + if(flush_count < 0) + usage(); + u += 2; + break; + + /* Be quiet */ + case 'q': + verbose = 0; + u++; + break; + + default: + usage(); + break; + } /* end switch */ + } /* end if */ + else { + /* Get the number of records to append */ + nrecords = atol(argv[u]); + if(nrecords <= 0) + usage(); + + u++; + } /* end else */ + } /* end while */ + } /* end if */ + if(nrecords <= 0) + usage(); + if(flush_count >= nrecords) + usage(); + + /* Emit informational message */ + if(verbose) { + fprintf(stderr, "Parameters:\n"); + fprintf(stderr, "\t# of records between flushes = %ld\n", flush_count); + fprintf(stderr, "\t# of records to write = %ld\n", nrecords); + } /* end if */ + + /* Emit informational message */ + if(verbose) + fprintf(stderr, "Generating symbol names\n"); + + /* Generate dataset names */ + if(generate_symbols() < 0) + return -1; + + /* Emit informational message */ + if(verbose) + fprintf(stderr, "Opening skeleton file: %s\n", FILENAME); + + /* Open file skeleton */ + if((fid = open_skeleton(FILENAME, verbose)) < 0) { + fprintf(stderr, "Error opening skeleton file!\n"); + exit(1); + } /* end if */ + + /* Send a message to indicate "H5Fopen" is complete--releasing the file lock */ + h5_send_message(WRITER_MESSAGE); + + /* Emit informational message */ + if(verbose) + fprintf(stderr, "Adding records\n"); + + /* Append records to datasets */ + if(add_records(fid, verbose, (unsigned long)nrecords, (unsigned long)flush_count) < 0) { + fprintf(stderr, "Error appending records to datasets!\n"); + exit(1); + } /* end if */ + + /* Emit informational message */ + if(verbose) + fprintf(stderr, "Releasing symbols\n"); + + /* Clean up the symbols */ + if(shutdown_symbols() < 0) { + fprintf(stderr, "Error releasing symbols!\n"); + exit(1); + } /* end if */ + + /* Emit informational message */ + if(verbose) + fprintf(stderr, "Closing objects\n"); + + /* Close objects opened */ + if(H5Fclose(fid) < 0) { + fprintf(stderr, "Error closing file!\n"); + exit(1); + } /* end if */ + + return 0; +} diff --git a/tools/h5copy/CMakeLists.txt b/tools/h5copy/CMakeLists.txt index 6faf332..895eafd 100644 --- a/tools/h5copy/CMakeLists.txt +++ b/tools/h5copy/CMakeLists.txt @@ -37,9 +37,9 @@ ENDIF (BUILD_TESTING) ############################################################################## ############################################################################## -#-----------------------------------------------------------------------------
-# Rules for Installation of tools using make Install target
-#-----------------------------------------------------------------------------
+#----------------------------------------------------------------------------- +# Rules for Installation of tools using make Install target +#----------------------------------------------------------------------------- #INSTALL_PROGRAM_PDB (h5copy ${HDF5_INSTALL_BIN_DIR} toolsapplications) diff --git a/tools/h5diff/CMakeLists.txt b/tools/h5diff/CMakeLists.txt index d79c290..7d043c7 100644 --- a/tools/h5diff/CMakeLists.txt +++ b/tools/h5diff/CMakeLists.txt @@ -55,9 +55,9 @@ ENDIF (BUILD_TESTING) ############################################################################## ############################################################################## -#-----------------------------------------------------------------------------
-# Rules for Installation of tools using make Install target
-#-----------------------------------------------------------------------------
+#----------------------------------------------------------------------------- +# Rules for Installation of tools using make Install target +#----------------------------------------------------------------------------- #INSTALL_PROGRAM_PDB (h5diff ${HDF5_INSTALL_BIN_DIR} toolsapplications) diff --git a/tools/h5diff/testfiles/h5diff_101w.txt b/tools/h5diff/testfiles/h5diff_101w.txt index d1f49da..71f4e87 100644 --- a/tools/h5diff/testfiles/h5diff_101w.txt +++ b/tools/h5diff/testfiles/h5diff_101w.txt @@ -1,11 +1,11 @@ -dataset: </g1/d1> and </g1/d2>
-size: [3x2] [3x2]
-position d1 d2 difference
-------------------------------------------------------------
-[ 0 1 ] 1e-016 4e-016 3e-016
-[ 1 0 ] 1e-016 2e-016 1e-016
-[ 1 1 ] 0 1e-016 1e-016
-[ 2 0 ] 3.3e-016 1e-016 2.3e-016
-[ 2 1 ] 1e-016 0 1e-016
-5 differences found
-EXIT CODE: 1
+dataset: </g1/d1> and </g1/d2> +size: [3x2] [3x2] +position d1 d2 difference +------------------------------------------------------------ +[ 0 1 ] 1e-016 4e-016 3e-016 +[ 1 0 ] 1e-016 2e-016 1e-016 +[ 1 1 ] 0 1e-016 1e-016 +[ 2 0 ] 3.3e-016 1e-016 2.3e-016 +[ 2 1 ] 1e-016 0 1e-016 +5 differences found +EXIT CODE: 1 diff --git a/tools/h5diff/testfiles/h5diff_102w.txt b/tools/h5diff/testfiles/h5diff_102w.txt index dda3581..19a097c 100644 --- a/tools/h5diff/testfiles/h5diff_102w.txt +++ b/tools/h5diff/testfiles/h5diff_102w.txt @@ -1,10 +1,10 @@ -dataset: </g1/fp1> and </g1/fp2>
-size: [3x2] [3x2]
-position fp1 fp2 difference
-------------------------------------------------------------
-[ 0 1 ] 1e-007 2e-007 1e-007
-[ 1 0 ] 1e-007 3e-007 2e-007
-[ 1 1 ] 2.2e-007 1e-007 1.2e-007
-[ 2 0 ] 1e-007 0 1e-007
-4 differences found
-EXIT CODE: 1
+dataset: </g1/fp1> and </g1/fp2> +size: [3x2] [3x2] +position fp1 fp2 difference +------------------------------------------------------------ +[ 0 1 ] 1e-007 2e-007 1e-007 +[ 1 0 ] 1e-007 3e-007 2e-007 +[ 1 1 ] 2.2e-007 1e-007 1.2e-007 +[ 2 0 ] 1e-007 0 1e-007 +4 differences found +EXIT CODE: 1 diff --git a/tools/h5dump/CMakeLists.txt b/tools/h5dump/CMakeLists.txt index 30ff215..c753c28 100644 --- a/tools/h5dump/CMakeLists.txt +++ b/tools/h5dump/CMakeLists.txt @@ -48,9 +48,9 @@ ENDIF (BUILD_TESTING) ############################################################################## ############################################################################## -#-----------------------------------------------------------------------------
-# Rules for Installation of tools using make Install target
-#-----------------------------------------------------------------------------
+#----------------------------------------------------------------------------- +# Rules for Installation of tools using make Install target +#----------------------------------------------------------------------------- #INSTALL_PROGRAM_PDB (h5dump ${HDF5_INSTALL_BIN_DIR} toolsapplications) diff --git a/tools/h5import/CMakeLists.txt b/tools/h5import/CMakeLists.txt index 7caf44a..65a76dc 100644 --- a/tools/h5import/CMakeLists.txt +++ b/tools/h5import/CMakeLists.txt @@ -38,9 +38,9 @@ ENDIF (BUILD_TESTING) ############################################################################## ############################################################################## -#-----------------------------------------------------------------------------
-# Rules for Installation of tools using make Install target
-#-----------------------------------------------------------------------------
+#----------------------------------------------------------------------------- +# Rules for Installation of tools using make Install target +#----------------------------------------------------------------------------- #INSTALL_PROGRAM_PDB (h5import ${HDF5_INSTALL_BIN_DIR} toolsapplications) diff --git a/tools/h5jam/CMakeLists.txt b/tools/h5jam/CMakeLists.txt index 49d1b0c..021c826 100644 --- a/tools/h5jam/CMakeLists.txt +++ b/tools/h5jam/CMakeLists.txt @@ -64,9 +64,9 @@ ENDIF (BUILD_TESTING) ############################################################################## ############################################################################## -#-----------------------------------------------------------------------------
-# Rules for Installation of tools using make Install target
-#-----------------------------------------------------------------------------
+#----------------------------------------------------------------------------- +# Rules for Installation of tools using make Install target +#----------------------------------------------------------------------------- #INSTALL_PROGRAM_PDB (h5jam ${HDF5_INSTALL_BIN_DIR} toolsapplications) diff --git a/tools/h5ls/CMakeLists.txt b/tools/h5ls/CMakeLists.txt index eeaf1ea..3f6073e 100644 --- a/tools/h5ls/CMakeLists.txt +++ b/tools/h5ls/CMakeLists.txt @@ -31,9 +31,9 @@ ENDIF (BUILD_TESTING) ############################################################################## ############################################################################## -#-----------------------------------------------------------------------------
-# Rules for Installation of tools using make Install target
-#-----------------------------------------------------------------------------
+#----------------------------------------------------------------------------- +# Rules for Installation of tools using make Install target +#----------------------------------------------------------------------------- #INSTALL_PROGRAM_PDB (h5ls ${HDF5_INSTALL_BIN_DIR} toolsapplications) diff --git a/tools/h5repack/CMakeLists.txt b/tools/h5repack/CMakeLists.txt index 176fc2b..0fbd40e 100644 --- a/tools/h5repack/CMakeLists.txt +++ b/tools/h5repack/CMakeLists.txt @@ -89,9 +89,9 @@ ENDIF (BUILD_TESTING) ############################################################################## ############################################################################## -#-----------------------------------------------------------------------------
-# Rules for Installation of tools using make Install target
-#-----------------------------------------------------------------------------
+#----------------------------------------------------------------------------- +# Rules for Installation of tools using make Install target +#----------------------------------------------------------------------------- #INSTALL_PROGRAM_PDB (h5repack ${HDF5_INSTALL_BIN_DIR} toolsapplications) diff --git a/tools/h5stat/CMakeLists.txt b/tools/h5stat/CMakeLists.txt index 6086fc2..6ab7274 100644 --- a/tools/h5stat/CMakeLists.txt +++ b/tools/h5stat/CMakeLists.txt @@ -40,9 +40,9 @@ ENDIF (BUILD_TESTING) ############################################################################## ############################################################################## -#-----------------------------------------------------------------------------
-# Rules for Installation of tools using make Install target
-#-----------------------------------------------------------------------------
+#----------------------------------------------------------------------------- +# Rules for Installation of tools using make Install target +#----------------------------------------------------------------------------- #INSTALL_PROGRAM_PDB (h5stat ${HDF5_INSTALL_BIN_DIR} toolsapplications) diff --git a/tools/misc/CMakeLists.txt b/tools/misc/CMakeLists.txt index 8e1003e..310a951 100644 --- a/tools/misc/CMakeLists.txt +++ b/tools/misc/CMakeLists.txt @@ -69,9 +69,9 @@ ENDIF (BUILD_TESTING) ############################################################################## ############################################################################## -#-----------------------------------------------------------------------------
-# Rules for Installation of tools using make Install target
-#-----------------------------------------------------------------------------
+#----------------------------------------------------------------------------- +# Rules for Installation of tools using make Install target +#----------------------------------------------------------------------------- #INSTALL_PROGRAM_PDB (h5debug ${HDF5_INSTALL_BIN_DIR} toolsapplications) #INSTALL_PROGRAM_PDB (h5repart ${HDF5_INSTALL_BIN_DIR} toolsapplications) diff --git a/tools/misc/h5perf_gentest.c b/tools/misc/h5perf_gentest.c index 6a080d0..6729ed4 100644 --- a/tools/misc/h5perf_gentest.c +++ b/tools/misc/h5perf_gentest.c @@ -1,598 +1,598 @@ -/*****************************************************************************
- This test generates attributes, groups, and datasets of many types. It
- creates a large number of attributes, groups, and datasets by specifying
- -a, -g, -d options respectively. Using "-h" option to see details.
-
- Programmer: Peter Cao <xcao@hdfgroup.org>, Jan. 2013
- ****************************************************************************/
-
-#include "hdf5.h"
-#include <stdio.h>
-#include <stdlib.h>
-
-#define FNAME "test_perf.h5"
-#define NGROUPS 20
-#define NDSETS 20
-#define NATTRS 20
-#define DIM0 40
-#define NROWS 100
-#define NTYPES 9
-#define MAXVLEN 10
-#define FIXED_LEN 8
-
-typedef enum { SOLID=0, LIQUID, GAS, PLASMA } phase_t;
-
-typedef struct {
- int i;
- unsigned long long l;
- float f;
- double d;
- char s[FIXED_LEN];
- phase_t e;
- float f_array[FIXED_LEN];
- hvl_t i_vlen;
- char *s_vlen;
-} test_comp_t;
-
-typedef struct {
- int zipcode;
- char *city;
-} zipcode_t;
-
-int add_attrs(hid_t oid, int idx);
-int add_attr(hid_t oid, const char *name, hid_t tid, hid_t sid, void *buf) ;
-herr_t create_perf_test_file(const char *fname, int ngrps, int ndsets,
- int nattrs, hsize_t nrows, hsize_t dim0, hsize_t chunk, int vlen,
- int compressed, int latest);
-
-int main (int argc, char *argv[])
-{
- char fname[32];
- int i, ngrps=NGROUPS, ndsets=NDSETS, nattrs=NATTRS, dim0=DIM0,
- chunk=DIM0/10+1, nrows=NROWS, vlen=MAXVLEN, l=0, z=0;
-
- memset(fname, 0, 32);
- for (i=1; i<argc; i++) {
- if (strcmp(argv[i], "-f")==0)
- strcpy(fname, argv[i+1]);
- else if (strcmp(argv[i], "-g")==0)
- ngrps = atoi(argv[i+1]);
- else if (strcmp(argv[i], "-d")==0)
- ndsets = atoi(argv[i+1]);
- else if (strcmp(argv[i], "-a")==0)
- nattrs = atoi(argv[i+1]);
- else if (strcmp(argv[i], "-r")==0)
- nrows = atoi(argv[i+1]);
- else if (strcmp(argv[i], "-s")==0)
- dim0 = atoi(argv[i+1]);
- else if (strcmp(argv[i], "-c")==0)
- chunk = atoi(argv[i+1]);
- else if (strcmp(argv[i], "-v")==0)
- vlen = atoi(argv[i+1]);
- else if (strcmp(argv[i], "-l")==0)
- l = 1;
- else if (strcmp(argv[i], "-z")==0)
- z = 1;
- else if (strcmp(argv[i], "-h")==0) {
- printf("\nOPTONS:\n");
- printf("\t-f F:\tname of the test file (default: %s).\n", FNAME);
- printf("\t-g N:\tnumber of top level groups (default: %d).\n", NGROUPS);
- printf("\t-d N:\tnumber of datasets (default: %d).\n", NDSETS);
- printf("\t-a N:\tnumber of attributes (default: %d).\n", NATTRS);
- printf("\t-r N:\tnumber of rows in the large compound dataset (default: %d).\n", NROWS);
- printf("\t-s N:\tsize of dim0 in datasets (default: %d).\n", DIM0);
- printf("\t-c N:\tchunk size of dim0 (default: %d).\n", (DIM0/10+1));
- printf("\t-v N:\tmax vlen size (default: %d).\n", MAXVLEN);
- printf("\t-l:\tuse latest format (default: no).\n");
- printf("\t-z:\tuse gzip compression (default: no).\n");
- printf("\t-h:\tthis help information.\n");
- printf("Example:\n");
- printf("\t./a.out -f test.h5 -g 10000 -d 5000 -a 500 -r 10000 -s 200 -c 20 -v 40 -l -z\n\n");
- exit(0);
- }
- }
-
- if (strlen(fname)<=0)
- sprintf(fname, FNAME);
-
- create_perf_test_file(fname, ngrps, ndsets, nattrs, (hsize_t)nrows,
- (hsize_t)dim0, (hsize_t)chunk, vlen, z, l);
-
- return 0;
-}
-
-/*****************************************************************************
- This function generates attributes, groups, and datasets of many types.
-
- Parameters:
- fname: file_name.
- ngrps: number of top level groups.
- ndsets: number of datasets.
- attrs: number of attributes.
- nrow: number of rows in a dataset.
- chunk: chunk size (single number).
- vlen: max vlen size.
- comp: use latest format.
- latest: use gzip comnpression.
-
- Return: Non-negative on success/Negative on failure
-
- Programmer: Peter Cao <xcao@hdfgroup.org>, Jan. 2013
- ****************************************************************************/
-herr_t create_perf_test_file(const char *fname, int ngrps, int ndsets,
- int nattrs, hsize_t nrows, hsize_t dim0, hsize_t chunk, int vlen,
- int compressed, int latest)
-{
- int i, j, k;
- hid_t fid, sid_null, sid_scalar, sid_1d, sid_2d, did, aid, sid_2, sid_large,
- fapl=H5P_DEFAULT, dcpl=H5P_DEFAULT, gid1, gid2, cmp_tid, tid_str,
- tid_enum, tid_array_f, tid_vlen_i, tid_vlen_s;
- char name[32], tmp_name1[32], tmp_name2[32], tmp_name3[32];
- hsize_t dims[1]={dim0}, dims2d[2]={dim0, (dim0/4+1)}, dims_array[1]={FIXED_LEN},
- dim1[1]={2};
- char *enum_names[4] = {"SOLID", "LIQUID", "GAS", "PLASMA"};
- test_comp_t *buf_comp=NULL, *buf_comp_large=NULL;
- int *buf_int=NULL;
- float (*buf_float_a)[FIXED_LEN]=NULL;
- double **buf_double2d=NULL;
- hvl_t *buf_vlen_i=NULL;
- char (*buf_str)[FIXED_LEN];
- char **buf_vlen_s=NULL;
- hobj_ref_t buf_ref[2];
- hdset_reg_ref_t buf_reg_ref[2];
- size_t offset, len;
- herr_t status;
- char *names[NTYPES] = { "int", "ulong", "float", "double", "fixed string",
- "enum", "fixed float array", "vlen int array", "vlen strings"};
- hid_t types[NTYPES] = { H5T_NATIVE_INT, H5T_NATIVE_UINT64, H5T_NATIVE_FLOAT,
- H5T_NATIVE_DOUBLE, tid_str, tid_enum, tid_array_f, tid_vlen_i, tid_vlen_s};
- hsize_t coords[4][2] = { {0, 1}, {3, 5}, {1, 0}, {2, 4}}, start=0, stride=1, count=1;
-
- if (nrows < NROWS) nrows = NROWS;
- if (ngrps<NGROUPS) ngrps=NGROUPS;
- if (ndsets<NDSETS) ndsets=NDSETS;
- if (nattrs<NATTRS) nattrs=NATTRS;
- if (dim0<DIM0) dim0=DIM0;
- if (chunk>dim0) chunk=dim0/4;
- if (chunk<1) chunk = 1;
- if (vlen<1) vlen = MAXVLEN;
-
- /* create fixed string datatype */
- types[4] = tid_str = H5Tcopy (H5T_C_S1);
- H5Tset_size (tid_str, FIXED_LEN);
-
- /* create enum datatype */
- types[5] = tid_enum = H5Tenum_create(H5T_NATIVE_INT);
- for (i = (int) SOLID; i <= (int) PLASMA; i++) {
- phase_t val = (phase_t) i;
- status = H5Tenum_insert (tid_enum, enum_names[i], &val);
- }
-
- /* create float array datatype */
- types[6] = tid_array_f = H5Tarray_create (H5T_NATIVE_FLOAT, 1, dims_array);
-
- /* create variable length integer datatypes */
- types[7] = tid_vlen_i = H5Tvlen_create (H5T_NATIVE_INT);
-
- /* create variable length string datatype */
- types[8] = tid_vlen_s = H5Tcopy (H5T_C_S1);
- H5Tset_size (tid_vlen_s, H5T_VARIABLE);
-
- /* create compound datatypes */
- cmp_tid = H5Tcreate (H5T_COMPOUND, sizeof (test_comp_t));
- offset = 0;
- for (i=0; i<NTYPES-2; i++) {
- H5Tinsert(cmp_tid, names[i], offset, types[i]);
- offset += H5Tget_size(types[i]);
- }
-
- H5Tinsert(cmp_tid, names[7], offset, types[7]);
- offset += sizeof (hvl_t);
- H5Tinsert(cmp_tid, names[8], offset, types[8]);
-
- /* create dataspace */
- sid_1d = H5Screate_simple (1, dims, NULL);
- sid_2d = H5Screate_simple (2, dims2d, NULL);
- sid_2 = H5Screate_simple (1, dim1, NULL);
- sid_large = H5Screate_simple (1, &nrows, NULL);
- sid_null = H5Screate (H5S_NULL);
- sid_scalar = H5Screate (H5S_SCALAR);
-
- /* create fid access property */
- fapl = H5Pcreate (H5P_FILE_ACCESS);
- H5Pset_libver_bounds (fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST);
-
- /* create dataset creation property */
- dcpl = H5Pcreate (H5P_DATASET_CREATE);
-
- /* set dataset chunk */
- if (chunk>0) {
- H5Pset_chunk (dcpl, 1, &chunk);
- }
-
- /* set dataset compression */
- if (compressed) {
- if (chunk<=0) {
- chunk = dim0/10+1;;
- H5Pset_chunk (dcpl, 1, &chunk);
- }
- H5Pset_shuffle (dcpl);
- H5Pset_deflate (dcpl, 6);
- }
-
- /* allocate buffers */
- buf_comp = (test_comp_t *)calloc(dim0, sizeof(test_comp_t));
- buf_comp_large = (test_comp_t *)calloc(nrows, sizeof(test_comp_t));
- buf_int = (int *)calloc(dim0, sizeof(int));
- buf_float_a = malloc(dim0*sizeof(*buf_float_a));
- buf_vlen_i = (hvl_t *)calloc(dim0, sizeof (hvl_t));
- buf_vlen_s = (char **)calloc(dim0, sizeof(char *));
- buf_str = malloc(dim0*sizeof (*buf_str));
-
- /* allocate array of doulbe pointers */
- buf_double2d = (double **)calloc(dims2d[0],sizeof(double *));
- /* allocate a contigous chunk of memory for the data */
- buf_double2d[0] = (double *)calloc( dims2d[0]*dims2d[1],sizeof(double) );
- /* assign memory city to pointer array */
- for (i=1; i <dims2d[0]; i++) buf_double2d[i] = buf_double2d[0]+i*dims2d[1];
-
- /* fill buffer values */
- len = 1;
- for (i=0; i<dims[0]; i++) {
- buf_comp[i].i = buf_int[i] = i-2147483648;
- buf_comp[i].l = 0xffffffffffffffff-i;
- buf_comp[i].f = 1.0/(i+1.0);
- buf_comp[i].d = 987654321.0*i+1.0/(i+1.0);
- buf_comp[i].e = (phase_t) (i % (int) (PLASMA + 1));
-
- for (j=0; j<FIXED_LEN; j++) {
- buf_comp[i].f_array[j] = buf_float_a[i][j] = i*100+j;
- buf_str[i][j] = 'a' + (i%26);
- }
- buf_str[i][FIXED_LEN-1] = 0;
- strcpy(buf_comp[i].s, buf_str[i]);
-
- len = (1-cos(i/8.0))/2*vlen+1;
- if (!i) len = vlen;
- buf_vlen_i[i].len = len;
- buf_vlen_i[i].p = (int *)calloc(len, sizeof(int));
- for (j=0; j<len; j++) ((int*)(buf_vlen_i[i].p))[j] = i*100+j;
- buf_comp[i].i_vlen = buf_vlen_i[i];
-
- buf_vlen_s[i] = (char *)calloc(len, sizeof(char));
- for (j=0; j<len-1; j++)
- buf_vlen_s[i][j] = j%26+'A';
- buf_comp[i].s_vlen = buf_vlen_s[i];
-
- for (j=0; j<dims2d[1]; j++)
- buf_double2d[i][j] = i+j/10000.0;
- }
-
- for (i=0; i<nrows; i++) {
- buf_comp_large[i].i = i-2147483648;
- buf_comp_large[i].l = 0xffffffffffffffff-i;
- buf_comp_large[i].f = 1.0/(i+1.0);
- buf_comp_large[i].d = 987654321.0*i+1.0/(i+1.0);
- buf_comp_large[i].e = (phase_t) (i % (int) (PLASMA + 1));
- for (j=0; j<FIXED_LEN-1; j++) {
- buf_comp_large[i].f_array[j] = i*100+j;
- buf_comp_large[i].s[j] = 'a' + (i%26);
- }
- len = i%vlen+1;
- buf_comp_large[i].i_vlen.len = len;
- buf_comp_large[i].i_vlen.p = (int *)calloc(len, sizeof(int));
- for (j=0; j<len; j++) ((int*)(buf_comp_large[i].i_vlen.p))[j] = i*100+j;
- buf_comp_large[i].s_vlen = (char *)calloc(i+2, sizeof(char));
- for (j=0; j<i+1; j++) (buf_comp_large[i].s_vlen)[j] = j%26+'A';
- }
-
- /* create file */
- if (latest)
- fid = H5Fcreate (fname, H5F_ACC_TRUNC, H5P_DEFAULT, fapl);
- else
- fid = H5Fcreate (fname, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
- add_attrs(fid, 0);
-
- sprintf(name, "a cmp ds of %d rows", nrows);
- did = H5Dcreate (fid, name, cmp_tid, sid_large, H5P_DEFAULT, dcpl, H5P_DEFAULT);
- H5Dwrite (did, cmp_tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_comp_large);
- add_attrs(did, 0);
- H5Dclose(did);
-
- // /* add attributes*/
- gid1 = H5Gcreate (fid, "attributes", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
- if (nattrs<1) nattrs = 1;
- i=0;
- while (i<nattrs) i += add_attrs(gid1, i);
- H5Gclose(gid1);
-
- /* add many sub groups to a group*/
- gid1 = H5Gcreate (fid, "groups", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
- add_attrs(gid1, 0);
- for (i=0; i<ngrps; i++) {
- /* create sub groups */
- sprintf(name, "g%02d", i);
- gid2 = H5Gcreate (gid1, name, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
- if (i<10) add_attrs(gid2, 0);
- H5Gclose(gid2);
- }
- H5Gclose(gid1);
-
- /* add many datasets to a group */
- gid1 = H5Gcreate (fid, "datasets", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
- add_attrs(gid1, 0);
- for (j=0; j<ndsets; j+=12) {
- /* 1 add a null dataset */
- sprintf(name, "%05d null dataset", j);
- did = H5Dcreate (gid1, name, H5T_STD_I32LE, sid_null, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
- if (!j) add_attrs(did, j);
- H5Dclose(did);
-
- /* 2 add scalar int point */
- sprintf(name, "%05d scalar int point", j);
- did = H5Dcreate (gid1, name, H5T_NATIVE_INT, sid_scalar, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
- H5Dwrite (did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, &j);
- if (!j) add_attrs(did, j);
- H5Dclose(did);
-
- /* 3 scalar vlen string */
- sprintf(name, "%05d scalar vlen string", j);
- did = H5Dcreate (gid1, name, tid_vlen_s, sid_scalar, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
- H5Dwrite (did, tid_vlen_s, H5S_ALL, H5S_ALL, H5P_DEFAULT, &buf_vlen_s[0]);
- if (!j) add_attrs(did, j);
- H5Dclose(did);
-
- /* 4 add fixed-length float array */
- sprintf(name, "%05d fixed-length float array", j);
- did = H5Dcreate (gid1, name, tid_array_f, sid_1d, H5P_DEFAULT, dcpl, H5P_DEFAULT);
- H5Dwrite (did, tid_array_f, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_float_a);
- if (!j) add_attrs(did, j);
- H5Dclose(did);
-
- /* 5 add fixed-length strings */
- sprintf(name, "%05d fixed-length strings", j);
- did = H5Dcreate (gid1, name, tid_str, sid_1d, H5P_DEFAULT, dcpl, H5P_DEFAULT);
- H5Dwrite (did, tid_str, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_str);
- if (!j) add_attrs(did, j);
- H5Dclose(did);
-
- /* 6 add compound data */
- sprintf(name, "%05d compund data", j);
- did = H5Dcreate (gid1, name, cmp_tid, sid_1d, H5P_DEFAULT, dcpl, H5P_DEFAULT);
- H5Dwrite (did, cmp_tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_comp);
- if (!j) add_attrs(did, j);
- H5Dclose(did);
-
- /* 7 add 2D double */
- sprintf(name, "%05d 2D double", j);
- strcpy (tmp_name1, name);
- did = H5Dcreate (gid1, name, H5T_NATIVE_DOUBLE, sid_2d, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
- H5Dwrite (did, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_double2d[0]);
- if (!j) add_attrs(did, j);
- H5Dclose(did);
-
- /* 8 add 1D int array */
- sprintf(name, "%05d 1D int array", j);
- did = H5Dcreate (gid1, name, H5T_NATIVE_INT, sid_1d, H5P_DEFAULT, dcpl, H5P_DEFAULT);
- H5Dwrite (did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_int);
- if (!j) add_attrs(did, j);
- H5Dclose(did);
-
- /* 9 add vlen int array */
- sprintf(name, "%05d vlen int array", j);
- strcpy (tmp_name2, name);
- did = H5Dcreate (gid1, name, tid_vlen_i, sid_1d, H5P_DEFAULT, dcpl, H5P_DEFAULT);
- H5Dwrite (did, tid_vlen_i, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_vlen_i);
- if (!j) add_attrs(did, j);
- H5Dclose(did);
-
- /* 10 add vlen strings */
- sprintf(name, "%05d vlen strings", j);
- strcpy (tmp_name3, name);
- did = H5Dcreate (gid1, name, tid_vlen_s, sid_1d, H5P_DEFAULT, dcpl, H5P_DEFAULT);
- H5Dwrite (did, tid_vlen_s, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_vlen_s);
- if (!j) add_attrs(did, j);
- H5Dclose(did);
-
- /* 11 add object refs */
- H5Rcreate(&buf_ref[0],gid1, ".", H5R_OBJECT, -1);
- H5Rcreate(&buf_ref[1],gid1, tmp_name3, H5R_OBJECT, -1);
- sprintf(name, "%05d obj refs", j);
- did = H5Dcreate (gid1, name, H5T_STD_REF_OBJ, sid_2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
- H5Dwrite (did, H5T_STD_REF_OBJ, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_ref);
- if (!j) add_attrs(did, j);
- H5Dclose(did);
-
- /* 12 add region refs */
- H5Sselect_elements (sid_2d, H5S_SELECT_SET, 4, coords[0]);
- H5Rcreate(&buf_reg_ref[0],gid1, tmp_name1, H5R_DATASET_REGION, sid_2d);
- H5Sselect_none(sid_2d);
- count = dims[0]/2+1;
- H5Sselect_hyperslab (sid_1d, H5S_SELECT_SET, &start, &stride, &count,NULL);
- H5Rcreate(&buf_reg_ref[1],gid1, tmp_name2, H5R_DATASET_REGION, sid_1d);
- H5Sselect_none(sid_1d);
- sprintf(name, "%05d region refs", j);
- did = H5Dcreate (gid1, name, H5T_STD_REF_DSETREG, sid_2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
- H5Dwrite (did, H5T_STD_REF_DSETREG, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_reg_ref);
- if (!j) add_attrs(did, j);
- H5Dclose(did);
- }
- H5Gclose(gid1);
-
- H5Tclose (tid_array_f);
- H5Tclose (tid_vlen_i);
- H5Tclose (tid_vlen_s);
- H5Tclose (tid_enum);
- H5Tclose (tid_str);
- H5Tclose (cmp_tid);
- H5Pclose (dcpl);
- H5Pclose (fapl);
- H5Sclose (sid_1d);
- H5Sclose (sid_2d);
- H5Sclose (sid_2);
- H5Sclose (sid_large);
- H5Sclose (sid_null);
- H5Sclose (sid_scalar);
- H5Fclose (fid);
-
- for (i=0; i<dims[0]; i++) {
- if (buf_vlen_i[i].p) free(buf_vlen_i[i].p);
- if (buf_vlen_s[i]) free(buf_vlen_s[i]);
- }
-
- for (i=0; i<nrows; i++) {
- if (buf_comp_large[i].i_vlen.p) free(buf_comp_large[i].i_vlen.p);
- if (buf_comp_large[i].s_vlen) free(buf_comp_large[i].s_vlen);
- }
-
- free (buf_comp);
- free (buf_comp_large);
- free (buf_int);
- free (buf_float_a);
- free (buf_double2d[0]);
- free (buf_double2d);
- free (buf_str);
- free(buf_vlen_i);
- free(buf_vlen_s);
-
- return 0;
-}
-
-/* add a single attribute */
-int add_attr(hid_t oid, const char *name, hid_t tid, hid_t sid, void *buf)
-{
- hid_t aid;
-
- aid = H5Acreate (oid, name, tid, sid, H5P_DEFAULT, H5P_DEFAULT);
- if (aid <0)
- return 0;
-
- H5Awrite(aid, tid, buf);
-
- H5Aclose(aid);
-
- return 1;
-}
-
-/*
- adds different types of attributes to an object.
-
- returns the number of attributes added to the objects.
- */
-int add_attrs(hid_t oid, int idx)
-{
- char name[32];
- int i0, i1, i2, j, nattrs=0;
- hid_t aid, tid, tid1, sid;
- hvl_t i_vlen[4];
- hobj_ref_t ref;
- zipcode_t cmp_data[4];
- unsigned int i = 0xffffffff;
- long long l = -2147483647;
- float f = 123456789.987654321;
- double d = 987654321.123456789;
- char *s[7] = {"Parting", "is such", "sweeter", "sorrow."};
- float f_array[4] = {1.0, 2.22, 3.333, 4.444};
- char *s_vlen[4] = {"Parting", "is such", "sweet", "sorrow."};
- hsize_t dims1[1]={1}, dims2[1]={4}, dims3[2]={3,5};
- int int3d[4][3][5];
- size_t offset = 0;
-
- for (i0=0; i0<4; i0++) {
- i_vlen[i0].len = (i0+1);
- i_vlen[i0].p = (int *)calloc(i_vlen[i0].len, sizeof(int));
- for (j=0; j<i_vlen[i0].len; j++)
- ((int *)i_vlen[i0].p)[j] = i0*100+j;
- for (i1=0; i1<3; i1++) {
- for (i2=0; i2<5; i2++)
- int3d[i0][i1][i2] = i0*i1-i1*i2+i0*i2;
- }
- }
-
- cmp_data[0].zipcode = 01001;
- cmp_data[0].city = "Agawam, Massachusetts";
- cmp_data[1].zipcode = 99950;
- cmp_data[1].city = "Ketchikan, Alaska";
- cmp_data[2].zipcode = 00501;
- cmp_data[2].city = "Holtsville, New York";
- cmp_data[3].zipcode = 61820;
- cmp_data[3].city = "Champaign, Illinois";
-
- /* 1 scalar point */
- sid = H5Screate (H5S_SCALAR);
- sprintf(name, "%05d scalar int", idx);
- nattrs += add_attr(oid, name, H5T_NATIVE_UINT, sid, &i);
- sprintf(name, "%05d scalar ulong", idx);
- nattrs += add_attr(oid, name, H5T_NATIVE_INT64, sid, &l);
- sprintf(name, "%05d scalar str", idx);
- tid = H5Tcopy (H5T_C_S1);
- H5Tset_size (tid, H5T_VARIABLE);
- nattrs += add_attr(oid, name, tid, sid, &s[2]);
- H5Tclose(tid);
- H5Sclose(sid);
-
- /* 4 single point */
- sid = H5Screate_simple (1, dims1, NULL);
- H5Rcreate(&ref, oid, ".", H5R_OBJECT, -1);
- sprintf(name, "%05d single float", idx);
- nattrs += add_attr(oid, name, H5T_NATIVE_FLOAT, sid, &f);
- sprintf(name, "%05d single double", idx);
- nattrs += add_attr(oid, name, H5T_NATIVE_DOUBLE, sid, &d);
- sprintf(name, "%05d single obj_ref", idx);
- nattrs += add_attr(oid, name, H5T_STD_REF_OBJ, sid, &ref);
- H5Sclose(sid);
-
- /* 7 fixed length 1D array */
- sid = H5Screate_simple (1, dims1, NULL);
- tid = H5Tarray_create (H5T_NATIVE_FLOAT, 1, dims2);
- sprintf(name, "%05d array float", idx);
- nattrs += add_attr(oid, name, tid, sid, &f_array[0]);
- H5Tclose(tid);
- tid = H5Tcopy (H5T_C_S1);
- H5Tset_size (tid, strlen(s[0])+1);
- tid1 = H5Tarray_create (tid, 1, dims2);
- sprintf(name, "%05d array str", idx);
- nattrs += add_attr(oid, name, tid1, sid, s);
- H5Tclose(tid1);
- H5Tclose(tid);
- H5Sclose(sid);
-
- /* 9 fixed length 2D int arrays */
- sid = H5Screate_simple (1, dims2, NULL);
- tid = H5Tarray_create (H5T_NATIVE_INT, 2, dims3);
- sprintf(name, "%05d array int 2D", idx);
- nattrs += add_attr(oid, name, tid, sid, int3d[0][0]);
- H5Tclose(tid);
- H5Sclose(sid);
-
- /* 10 variable length arrays */
- sid = H5Screate_simple (1, dims2, NULL);
- tid = H5Tcopy (H5T_C_S1);
- H5Tset_size (tid, H5T_VARIABLE);
- sprintf(name, "%05d vlen strings", idx);
- nattrs += add_attr(oid, name, tid, sid, s_vlen);
- H5Tclose(tid);
- tid = H5Tvlen_create (H5T_NATIVE_INT);;
- sprintf(name, "%05d vlen int array", idx);
- nattrs += add_attr(oid, name, tid, sid, i_vlen);
- H5Tclose(tid);
- H5Sclose(sid);
-
- /* 12 compound data */
- sid = H5Screate_simple (1, dims2, NULL);
- tid = H5Tcreate (H5T_COMPOUND, sizeof (zipcode_t));
- tid1 = H5Tcopy (H5T_C_S1);
- H5Tset_size (tid1, H5T_VARIABLE);
- H5Tinsert (tid, "zip code", 0, H5T_NATIVE_INT); offset += sizeof(H5T_NATIVE_INT);
- H5Tinsert (tid, "City", offset, tid1); offset += sizeof(char *);
- sprintf(name, "%05d compound data", idx);
- nattrs += add_attr(oid, name, tid, sid, cmp_data);
- H5Tclose(tid1);
- H5Tclose(tid);
- H5Sclose(sid);
-
- for (i0=0; i0<4; i0++)
- free(i_vlen[i0].p);
-
- return nattrs;
-}
+/***************************************************************************** + This test generates attributes, groups, and datasets of many types. It + creates a large number of attributes, groups, and datasets by specifying + -a, -g, -d options respectively. Using "-h" option to see details. + + Programmer: Peter Cao <xcao@hdfgroup.org>, Jan. 2013 + ****************************************************************************/ + +#include "hdf5.h" +#include <stdio.h> +#include <stdlib.h> + +#define FNAME "test_perf.h5" +#define NGROUPS 20 +#define NDSETS 20 +#define NATTRS 20 +#define DIM0 40 +#define NROWS 100 +#define NTYPES 9 +#define MAXVLEN 10 +#define FIXED_LEN 8 + +typedef enum { SOLID=0, LIQUID, GAS, PLASMA } phase_t; + +typedef struct { + int i; + unsigned long long l; + float f; + double d; + char s[FIXED_LEN]; + phase_t e; + float f_array[FIXED_LEN]; + hvl_t i_vlen; + char *s_vlen; +} test_comp_t; + +typedef struct { + int zipcode; + char *city; +} zipcode_t; + +int add_attrs(hid_t oid, int idx); +int add_attr(hid_t oid, const char *name, hid_t tid, hid_t sid, void *buf) ; +herr_t create_perf_test_file(const char *fname, int ngrps, int ndsets, + int nattrs, hsize_t nrows, hsize_t dim0, hsize_t chunk, int vlen, + int compressed, int latest); + +int main (int argc, char *argv[]) +{ + char fname[32]; + int i, ngrps=NGROUPS, ndsets=NDSETS, nattrs=NATTRS, dim0=DIM0, + chunk=DIM0/10+1, nrows=NROWS, vlen=MAXVLEN, l=0, z=0; + + memset(fname, 0, 32); + for (i=1; i<argc; i++) { + if (strcmp(argv[i], "-f")==0) + strcpy(fname, argv[i+1]); + else if (strcmp(argv[i], "-g")==0) + ngrps = atoi(argv[i+1]); + else if (strcmp(argv[i], "-d")==0) + ndsets = atoi(argv[i+1]); + else if (strcmp(argv[i], "-a")==0) + nattrs = atoi(argv[i+1]); + else if (strcmp(argv[i], "-r")==0) + nrows = atoi(argv[i+1]); + else if (strcmp(argv[i], "-s")==0) + dim0 = atoi(argv[i+1]); + else if (strcmp(argv[i], "-c")==0) + chunk = atoi(argv[i+1]); + else if (strcmp(argv[i], "-v")==0) + vlen = atoi(argv[i+1]); + else if (strcmp(argv[i], "-l")==0) + l = 1; + else if (strcmp(argv[i], "-z")==0) + z = 1; + else if (strcmp(argv[i], "-h")==0) { + printf("\nOPTONS:\n"); + printf("\t-f F:\tname of the test file (default: %s).\n", FNAME); + printf("\t-g N:\tnumber of top level groups (default: %d).\n", NGROUPS); + printf("\t-d N:\tnumber of datasets (default: %d).\n", NDSETS); + printf("\t-a N:\tnumber of attributes (default: %d).\n", NATTRS); + printf("\t-r N:\tnumber of rows in the large compound dataset (default: %d).\n", NROWS); + printf("\t-s N:\tsize of dim0 in datasets (default: %d).\n", DIM0); + printf("\t-c N:\tchunk size of dim0 (default: %d).\n", (DIM0/10+1)); + printf("\t-v N:\tmax vlen size (default: %d).\n", MAXVLEN); + printf("\t-l:\tuse latest format (default: no).\n"); + printf("\t-z:\tuse gzip compression (default: no).\n"); + printf("\t-h:\tthis help information.\n"); + printf("Example:\n"); + printf("\t./a.out -f test.h5 -g 10000 -d 5000 -a 500 -r 10000 -s 200 -c 20 -v 40 -l -z\n\n"); + exit(0); + } + } + + if (strlen(fname)<=0) + sprintf(fname, FNAME); + + create_perf_test_file(fname, ngrps, ndsets, nattrs, (hsize_t)nrows, + (hsize_t)dim0, (hsize_t)chunk, vlen, z, l); + + return 0; +} + +/***************************************************************************** + This function generates attributes, groups, and datasets of many types. + + Parameters: + fname: file_name. + ngrps: number of top level groups. + ndsets: number of datasets. + attrs: number of attributes. + nrow: number of rows in a dataset. + chunk: chunk size (single number). + vlen: max vlen size. + comp: use latest format. + latest: use gzip comnpression. + + Return: Non-negative on success/Negative on failure + + Programmer: Peter Cao <xcao@hdfgroup.org>, Jan. 2013 + ****************************************************************************/ +herr_t create_perf_test_file(const char *fname, int ngrps, int ndsets, + int nattrs, hsize_t nrows, hsize_t dim0, hsize_t chunk, int vlen, + int compressed, int latest) +{ + int i, j, k; + hid_t fid, sid_null, sid_scalar, sid_1d, sid_2d, did, aid, sid_2, sid_large, + fapl=H5P_DEFAULT, dcpl=H5P_DEFAULT, gid1, gid2, cmp_tid, tid_str, + tid_enum, tid_array_f, tid_vlen_i, tid_vlen_s; + char name[32], tmp_name1[32], tmp_name2[32], tmp_name3[32]; + hsize_t dims[1]={dim0}, dims2d[2]={dim0, (dim0/4+1)}, dims_array[1]={FIXED_LEN}, + dim1[1]={2}; + char *enum_names[4] = {"SOLID", "LIQUID", "GAS", "PLASMA"}; + test_comp_t *buf_comp=NULL, *buf_comp_large=NULL; + int *buf_int=NULL; + float (*buf_float_a)[FIXED_LEN]=NULL; + double **buf_double2d=NULL; + hvl_t *buf_vlen_i=NULL; + char (*buf_str)[FIXED_LEN]; + char **buf_vlen_s=NULL; + hobj_ref_t buf_ref[2]; + hdset_reg_ref_t buf_reg_ref[2]; + size_t offset, len; + herr_t status; + char *names[NTYPES] = { "int", "ulong", "float", "double", "fixed string", + "enum", "fixed float array", "vlen int array", "vlen strings"}; + hid_t types[NTYPES] = { H5T_NATIVE_INT, H5T_NATIVE_UINT64, H5T_NATIVE_FLOAT, + H5T_NATIVE_DOUBLE, tid_str, tid_enum, tid_array_f, tid_vlen_i, tid_vlen_s}; + hsize_t coords[4][2] = { {0, 1}, {3, 5}, {1, 0}, {2, 4}}, start=0, stride=1, count=1; + + if (nrows < NROWS) nrows = NROWS; + if (ngrps<NGROUPS) ngrps=NGROUPS; + if (ndsets<NDSETS) ndsets=NDSETS; + if (nattrs<NATTRS) nattrs=NATTRS; + if (dim0<DIM0) dim0=DIM0; + if (chunk>dim0) chunk=dim0/4; + if (chunk<1) chunk = 1; + if (vlen<1) vlen = MAXVLEN; + + /* create fixed string datatype */ + types[4] = tid_str = H5Tcopy (H5T_C_S1); + H5Tset_size (tid_str, FIXED_LEN); + + /* create enum datatype */ + types[5] = tid_enum = H5Tenum_create(H5T_NATIVE_INT); + for (i = (int) SOLID; i <= (int) PLASMA; i++) { + phase_t val = (phase_t) i; + status = H5Tenum_insert (tid_enum, enum_names[i], &val); + } + + /* create float array datatype */ + types[6] = tid_array_f = H5Tarray_create (H5T_NATIVE_FLOAT, 1, dims_array); + + /* create variable length integer datatypes */ + types[7] = tid_vlen_i = H5Tvlen_create (H5T_NATIVE_INT); + + /* create variable length string datatype */ + types[8] = tid_vlen_s = H5Tcopy (H5T_C_S1); + H5Tset_size (tid_vlen_s, H5T_VARIABLE); + + /* create compound datatypes */ + cmp_tid = H5Tcreate (H5T_COMPOUND, sizeof (test_comp_t)); + offset = 0; + for (i=0; i<NTYPES-2; i++) { + H5Tinsert(cmp_tid, names[i], offset, types[i]); + offset += H5Tget_size(types[i]); + } + + H5Tinsert(cmp_tid, names[7], offset, types[7]); + offset += sizeof (hvl_t); + H5Tinsert(cmp_tid, names[8], offset, types[8]); + + /* create dataspace */ + sid_1d = H5Screate_simple (1, dims, NULL); + sid_2d = H5Screate_simple (2, dims2d, NULL); + sid_2 = H5Screate_simple (1, dim1, NULL); + sid_large = H5Screate_simple (1, &nrows, NULL); + sid_null = H5Screate (H5S_NULL); + sid_scalar = H5Screate (H5S_SCALAR); + + /* create fid access property */ + fapl = H5Pcreate (H5P_FILE_ACCESS); + H5Pset_libver_bounds (fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST); + + /* create dataset creation property */ + dcpl = H5Pcreate (H5P_DATASET_CREATE); + + /* set dataset chunk */ + if (chunk>0) { + H5Pset_chunk (dcpl, 1, &chunk); + } + + /* set dataset compression */ + if (compressed) { + if (chunk<=0) { + chunk = dim0/10+1;; + H5Pset_chunk (dcpl, 1, &chunk); + } + H5Pset_shuffle (dcpl); + H5Pset_deflate (dcpl, 6); + } + + /* allocate buffers */ + buf_comp = (test_comp_t *)calloc(dim0, sizeof(test_comp_t)); + buf_comp_large = (test_comp_t *)calloc(nrows, sizeof(test_comp_t)); + buf_int = (int *)calloc(dim0, sizeof(int)); + buf_float_a = malloc(dim0*sizeof(*buf_float_a)); + buf_vlen_i = (hvl_t *)calloc(dim0, sizeof (hvl_t)); + buf_vlen_s = (char **)calloc(dim0, sizeof(char *)); + buf_str = malloc(dim0*sizeof (*buf_str)); + + /* allocate array of doulbe pointers */ + buf_double2d = (double **)calloc(dims2d[0],sizeof(double *)); + /* allocate a contigous chunk of memory for the data */ + buf_double2d[0] = (double *)calloc( dims2d[0]*dims2d[1],sizeof(double) ); + /* assign memory city to pointer array */ + for (i=1; i <dims2d[0]; i++) buf_double2d[i] = buf_double2d[0]+i*dims2d[1]; + + /* fill buffer values */ + len = 1; + for (i=0; i<dims[0]; i++) { + buf_comp[i].i = buf_int[i] = i-2147483648; + buf_comp[i].l = 0xffffffffffffffff-i; + buf_comp[i].f = 1.0/(i+1.0); + buf_comp[i].d = 987654321.0*i+1.0/(i+1.0); + buf_comp[i].e = (phase_t) (i % (int) (PLASMA + 1)); + + for (j=0; j<FIXED_LEN; j++) { + buf_comp[i].f_array[j] = buf_float_a[i][j] = i*100+j; + buf_str[i][j] = 'a' + (i%26); + } + buf_str[i][FIXED_LEN-1] = 0; + strcpy(buf_comp[i].s, buf_str[i]); + + len = (1-cos(i/8.0))/2*vlen+1; + if (!i) len = vlen; + buf_vlen_i[i].len = len; + buf_vlen_i[i].p = (int *)calloc(len, sizeof(int)); + for (j=0; j<len; j++) ((int*)(buf_vlen_i[i].p))[j] = i*100+j; + buf_comp[i].i_vlen = buf_vlen_i[i]; + + buf_vlen_s[i] = (char *)calloc(len, sizeof(char)); + for (j=0; j<len-1; j++) + buf_vlen_s[i][j] = j%26+'A'; + buf_comp[i].s_vlen = buf_vlen_s[i]; + + for (j=0; j<dims2d[1]; j++) + buf_double2d[i][j] = i+j/10000.0; + } + + for (i=0; i<nrows; i++) { + buf_comp_large[i].i = i-2147483648; + buf_comp_large[i].l = 0xffffffffffffffff-i; + buf_comp_large[i].f = 1.0/(i+1.0); + buf_comp_large[i].d = 987654321.0*i+1.0/(i+1.0); + buf_comp_large[i].e = (phase_t) (i % (int) (PLASMA + 1)); + for (j=0; j<FIXED_LEN-1; j++) { + buf_comp_large[i].f_array[j] = i*100+j; + buf_comp_large[i].s[j] = 'a' + (i%26); + } + len = i%vlen+1; + buf_comp_large[i].i_vlen.len = len; + buf_comp_large[i].i_vlen.p = (int *)calloc(len, sizeof(int)); + for (j=0; j<len; j++) ((int*)(buf_comp_large[i].i_vlen.p))[j] = i*100+j; + buf_comp_large[i].s_vlen = (char *)calloc(i+2, sizeof(char)); + for (j=0; j<i+1; j++) (buf_comp_large[i].s_vlen)[j] = j%26+'A'; + } + + /* create file */ + if (latest) + fid = H5Fcreate (fname, H5F_ACC_TRUNC, H5P_DEFAULT, fapl); + else + fid = H5Fcreate (fname, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); + add_attrs(fid, 0); + + sprintf(name, "a cmp ds of %d rows", nrows); + did = H5Dcreate (fid, name, cmp_tid, sid_large, H5P_DEFAULT, dcpl, H5P_DEFAULT); + H5Dwrite (did, cmp_tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_comp_large); + add_attrs(did, 0); + H5Dclose(did); + + // /* add attributes*/ + gid1 = H5Gcreate (fid, "attributes", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + if (nattrs<1) nattrs = 1; + i=0; + while (i<nattrs) i += add_attrs(gid1, i); + H5Gclose(gid1); + + /* add many sub groups to a group*/ + gid1 = H5Gcreate (fid, "groups", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + add_attrs(gid1, 0); + for (i=0; i<ngrps; i++) { + /* create sub groups */ + sprintf(name, "g%02d", i); + gid2 = H5Gcreate (gid1, name, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + if (i<10) add_attrs(gid2, 0); + H5Gclose(gid2); + } + H5Gclose(gid1); + + /* add many datasets to a group */ + gid1 = H5Gcreate (fid, "datasets", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + add_attrs(gid1, 0); + for (j=0; j<ndsets; j+=12) { + /* 1 add a null dataset */ + sprintf(name, "%05d null dataset", j); + did = H5Dcreate (gid1, name, H5T_STD_I32LE, sid_null, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + if (!j) add_attrs(did, j); + H5Dclose(did); + + /* 2 add scalar int point */ + sprintf(name, "%05d scalar int point", j); + did = H5Dcreate (gid1, name, H5T_NATIVE_INT, sid_scalar, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + H5Dwrite (did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, &j); + if (!j) add_attrs(did, j); + H5Dclose(did); + + /* 3 scalar vlen string */ + sprintf(name, "%05d scalar vlen string", j); + did = H5Dcreate (gid1, name, tid_vlen_s, sid_scalar, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + H5Dwrite (did, tid_vlen_s, H5S_ALL, H5S_ALL, H5P_DEFAULT, &buf_vlen_s[0]); + if (!j) add_attrs(did, j); + H5Dclose(did); + + /* 4 add fixed-length float array */ + sprintf(name, "%05d fixed-length float array", j); + did = H5Dcreate (gid1, name, tid_array_f, sid_1d, H5P_DEFAULT, dcpl, H5P_DEFAULT); + H5Dwrite (did, tid_array_f, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_float_a); + if (!j) add_attrs(did, j); + H5Dclose(did); + + /* 5 add fixed-length strings */ + sprintf(name, "%05d fixed-length strings", j); + did = H5Dcreate (gid1, name, tid_str, sid_1d, H5P_DEFAULT, dcpl, H5P_DEFAULT); + H5Dwrite (did, tid_str, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_str); + if (!j) add_attrs(did, j); + H5Dclose(did); + + /* 6 add compound data */ + sprintf(name, "%05d compund data", j); + did = H5Dcreate (gid1, name, cmp_tid, sid_1d, H5P_DEFAULT, dcpl, H5P_DEFAULT); + H5Dwrite (did, cmp_tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_comp); + if (!j) add_attrs(did, j); + H5Dclose(did); + + /* 7 add 2D double */ + sprintf(name, "%05d 2D double", j); + strcpy (tmp_name1, name); + did = H5Dcreate (gid1, name, H5T_NATIVE_DOUBLE, sid_2d, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + H5Dwrite (did, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_double2d[0]); + if (!j) add_attrs(did, j); + H5Dclose(did); + + /* 8 add 1D int array */ + sprintf(name, "%05d 1D int array", j); + did = H5Dcreate (gid1, name, H5T_NATIVE_INT, sid_1d, H5P_DEFAULT, dcpl, H5P_DEFAULT); + H5Dwrite (did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_int); + if (!j) add_attrs(did, j); + H5Dclose(did); + + /* 9 add vlen int array */ + sprintf(name, "%05d vlen int array", j); + strcpy (tmp_name2, name); + did = H5Dcreate (gid1, name, tid_vlen_i, sid_1d, H5P_DEFAULT, dcpl, H5P_DEFAULT); + H5Dwrite (did, tid_vlen_i, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_vlen_i); + if (!j) add_attrs(did, j); + H5Dclose(did); + + /* 10 add vlen strings */ + sprintf(name, "%05d vlen strings", j); + strcpy (tmp_name3, name); + did = H5Dcreate (gid1, name, tid_vlen_s, sid_1d, H5P_DEFAULT, dcpl, H5P_DEFAULT); + H5Dwrite (did, tid_vlen_s, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_vlen_s); + if (!j) add_attrs(did, j); + H5Dclose(did); + + /* 11 add object refs */ + H5Rcreate(&buf_ref[0],gid1, ".", H5R_OBJECT, -1); + H5Rcreate(&buf_ref[1],gid1, tmp_name3, H5R_OBJECT, -1); + sprintf(name, "%05d obj refs", j); + did = H5Dcreate (gid1, name, H5T_STD_REF_OBJ, sid_2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + H5Dwrite (did, H5T_STD_REF_OBJ, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_ref); + if (!j) add_attrs(did, j); + H5Dclose(did); + + /* 12 add region refs */ + H5Sselect_elements (sid_2d, H5S_SELECT_SET, 4, coords[0]); + H5Rcreate(&buf_reg_ref[0],gid1, tmp_name1, H5R_DATASET_REGION, sid_2d); + H5Sselect_none(sid_2d); + count = dims[0]/2+1; + H5Sselect_hyperslab (sid_1d, H5S_SELECT_SET, &start, &stride, &count,NULL); + H5Rcreate(&buf_reg_ref[1],gid1, tmp_name2, H5R_DATASET_REGION, sid_1d); + H5Sselect_none(sid_1d); + sprintf(name, "%05d region refs", j); + did = H5Dcreate (gid1, name, H5T_STD_REF_DSETREG, sid_2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + H5Dwrite (did, H5T_STD_REF_DSETREG, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_reg_ref); + if (!j) add_attrs(did, j); + H5Dclose(did); + } + H5Gclose(gid1); + + H5Tclose (tid_array_f); + H5Tclose (tid_vlen_i); + H5Tclose (tid_vlen_s); + H5Tclose (tid_enum); + H5Tclose (tid_str); + H5Tclose (cmp_tid); + H5Pclose (dcpl); + H5Pclose (fapl); + H5Sclose (sid_1d); + H5Sclose (sid_2d); + H5Sclose (sid_2); + H5Sclose (sid_large); + H5Sclose (sid_null); + H5Sclose (sid_scalar); + H5Fclose (fid); + + for (i=0; i<dims[0]; i++) { + if (buf_vlen_i[i].p) free(buf_vlen_i[i].p); + if (buf_vlen_s[i]) free(buf_vlen_s[i]); + } + + for (i=0; i<nrows; i++) { + if (buf_comp_large[i].i_vlen.p) free(buf_comp_large[i].i_vlen.p); + if (buf_comp_large[i].s_vlen) free(buf_comp_large[i].s_vlen); + } + + free (buf_comp); + free (buf_comp_large); + free (buf_int); + free (buf_float_a); + free (buf_double2d[0]); + free (buf_double2d); + free (buf_str); + free(buf_vlen_i); + free(buf_vlen_s); + + return 0; +} + +/* add a single attribute */ +int add_attr(hid_t oid, const char *name, hid_t tid, hid_t sid, void *buf) +{ + hid_t aid; + + aid = H5Acreate (oid, name, tid, sid, H5P_DEFAULT, H5P_DEFAULT); + if (aid <0) + return 0; + + H5Awrite(aid, tid, buf); + + H5Aclose(aid); + + return 1; +} + +/* + adds different types of attributes to an object. + + returns the number of attributes added to the objects. + */ +int add_attrs(hid_t oid, int idx) +{ + char name[32]; + int i0, i1, i2, j, nattrs=0; + hid_t aid, tid, tid1, sid; + hvl_t i_vlen[4]; + hobj_ref_t ref; + zipcode_t cmp_data[4]; + unsigned int i = 0xffffffff; + long long l = -2147483647; + float f = 123456789.987654321; + double d = 987654321.123456789; + char *s[7] = {"Parting", "is such", "sweeter", "sorrow."}; + float f_array[4] = {1.0, 2.22, 3.333, 4.444}; + char *s_vlen[4] = {"Parting", "is such", "sweet", "sorrow."}; + hsize_t dims1[1]={1}, dims2[1]={4}, dims3[2]={3,5}; + int int3d[4][3][5]; + size_t offset = 0; + + for (i0=0; i0<4; i0++) { + i_vlen[i0].len = (i0+1); + i_vlen[i0].p = (int *)calloc(i_vlen[i0].len, sizeof(int)); + for (j=0; j<i_vlen[i0].len; j++) + ((int *)i_vlen[i0].p)[j] = i0*100+j; + for (i1=0; i1<3; i1++) { + for (i2=0; i2<5; i2++) + int3d[i0][i1][i2] = i0*i1-i1*i2+i0*i2; + } + } + + cmp_data[0].zipcode = 01001; + cmp_data[0].city = "Agawam, Massachusetts"; + cmp_data[1].zipcode = 99950; + cmp_data[1].city = "Ketchikan, Alaska"; + cmp_data[2].zipcode = 00501; + cmp_data[2].city = "Holtsville, New York"; + cmp_data[3].zipcode = 61820; + cmp_data[3].city = "Champaign, Illinois"; + + /* 1 scalar point */ + sid = H5Screate (H5S_SCALAR); + sprintf(name, "%05d scalar int", idx); + nattrs += add_attr(oid, name, H5T_NATIVE_UINT, sid, &i); + sprintf(name, "%05d scalar ulong", idx); + nattrs += add_attr(oid, name, H5T_NATIVE_INT64, sid, &l); + sprintf(name, "%05d scalar str", idx); + tid = H5Tcopy (H5T_C_S1); + H5Tset_size (tid, H5T_VARIABLE); + nattrs += add_attr(oid, name, tid, sid, &s[2]); + H5Tclose(tid); + H5Sclose(sid); + + /* 4 single point */ + sid = H5Screate_simple (1, dims1, NULL); + H5Rcreate(&ref, oid, ".", H5R_OBJECT, -1); + sprintf(name, "%05d single float", idx); + nattrs += add_attr(oid, name, H5T_NATIVE_FLOAT, sid, &f); + sprintf(name, "%05d single double", idx); + nattrs += add_attr(oid, name, H5T_NATIVE_DOUBLE, sid, &d); + sprintf(name, "%05d single obj_ref", idx); + nattrs += add_attr(oid, name, H5T_STD_REF_OBJ, sid, &ref); + H5Sclose(sid); + + /* 7 fixed length 1D array */ + sid = H5Screate_simple (1, dims1, NULL); + tid = H5Tarray_create (H5T_NATIVE_FLOAT, 1, dims2); + sprintf(name, "%05d array float", idx); + nattrs += add_attr(oid, name, tid, sid, &f_array[0]); + H5Tclose(tid); + tid = H5Tcopy (H5T_C_S1); + H5Tset_size (tid, strlen(s[0])+1); + tid1 = H5Tarray_create (tid, 1, dims2); + sprintf(name, "%05d array str", idx); + nattrs += add_attr(oid, name, tid1, sid, s); + H5Tclose(tid1); + H5Tclose(tid); + H5Sclose(sid); + + /* 9 fixed length 2D int arrays */ + sid = H5Screate_simple (1, dims2, NULL); + tid = H5Tarray_create (H5T_NATIVE_INT, 2, dims3); + sprintf(name, "%05d array int 2D", idx); + nattrs += add_attr(oid, name, tid, sid, int3d[0][0]); + H5Tclose(tid); + H5Sclose(sid); + + /* 10 variable length arrays */ + sid = H5Screate_simple (1, dims2, NULL); + tid = H5Tcopy (H5T_C_S1); + H5Tset_size (tid, H5T_VARIABLE); + sprintf(name, "%05d vlen strings", idx); + nattrs += add_attr(oid, name, tid, sid, s_vlen); + H5Tclose(tid); + tid = H5Tvlen_create (H5T_NATIVE_INT);; + sprintf(name, "%05d vlen int array", idx); + nattrs += add_attr(oid, name, tid, sid, i_vlen); + H5Tclose(tid); + H5Sclose(sid); + + /* 12 compound data */ + sid = H5Screate_simple (1, dims2, NULL); + tid = H5Tcreate (H5T_COMPOUND, sizeof (zipcode_t)); + tid1 = H5Tcopy (H5T_C_S1); + H5Tset_size (tid1, H5T_VARIABLE); + H5Tinsert (tid, "zip code", 0, H5T_NATIVE_INT); offset += sizeof(H5T_NATIVE_INT); + H5Tinsert (tid, "City", offset, tid1); offset += sizeof(char *); + sprintf(name, "%05d compound data", idx); + nattrs += add_attr(oid, name, tid, sid, cmp_data); + H5Tclose(tid1); + H5Tclose(tid); + H5Sclose(sid); + + for (i0=0; i0<4; i0++) + free(i_vlen[i0].p); + + return nattrs; +} diff --git a/vms/test/H5srcdir_str.h b/vms/test/H5srcdir_str.h index 9dfcf56..2eb1a39 100644 --- a/vms/test/H5srcdir_str.h +++ b/vms/test/H5srcdir_str.h @@ -1,22 +1,22 @@ -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- * Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
- * All rights reserved. *
- * *
- * This file is part of HDF5. The full HDF5 copyright notice, including *
- * terms governing use, modification, and redistribution, is contained in *
- * the files COPYING and Copyright.html. COPYING can be found at the root *
- * of the source code distribution tree; Copyright.html can be found at the *
- * root level of an installed copy of the electronic HDF5 document set and *
- * is linked from the top-level documents page. It can also be found at *
- * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have *
- * access to either file, you may request a copy from help@hdfgroup.org. *
- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-
-/* If you are reading this file and it has a '.h' suffix, it was automatically
- * generated from the '.in' version. Make changes there. But for OpenVMS, this
- * file is created by hand.
- */
-
-/* Set the 'srcdir' path from configure time */
-static const char *config_srcdir = "[-.test]";
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by The HDF Group. * + * Copyright by the Board of Trustees of the University of Illinois. * + * All rights reserved. * + * * + * This file is part of HDF5. The full HDF5 copyright notice, including * + * terms governing use, modification, and redistribution, is contained in * + * the files COPYING and Copyright.html. COPYING can be found at the root * + * of the source code distribution tree; Copyright.html can be found at the * + * root level of an installed copy of the electronic HDF5 document set and * + * is linked from the top-level documents page. It can also be found at * + * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * + * access to either file, you may request a copy from help@hdfgroup.org. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* If you are reading this file and it has a '.h' suffix, it was automatically + * generated from the '.in' version. Make changes there. But for OpenVMS, this + * file is created by hand. + */ + +/* Set the 'srcdir' path from configure time */ +static const char *config_srcdir = "[-.test]"; |