[svn-r26274] Merge of r26096 to r26271 from trunk.

Tested on: jam - serial: C++/Fortran
                 parallel: Fortran
This commit is contained in:
Dana Robinson 2015-02-22 07:16:30 -05:00
commit c07d803659
107 changed files with 1261 additions and 1093 deletions

View File

@ -40,9 +40,9 @@ option (HDF5_ENABLE_Z_LIB_SUPPORT "Enable Zlib Filters" OFF)
if (HDF5_ENABLE_Z_LIB_SUPPORT)
if (NOT H5_ZLIB_HEADER)
if (NOT ZLIB_USE_EXTERNAL)
FIND_PACKAGE (ZLIB NAMES ${ZLIB_PACKAGE_NAME}${HDF_PACKAGE_EXT})
find_package (ZLIB NAMES ${ZLIB_PACKAGE_NAME}${HDF_PACKAGE_EXT})
if (NOT ZLIB_FOUND)
FIND_PACKAGE (ZLIB) # Legacy find
find_package (ZLIB) # Legacy find
endif (NOT ZLIB_FOUND)
endif (NOT ZLIB_USE_EXTERNAL)
if (ZLIB_FOUND)
@ -84,9 +84,9 @@ option (HDF5_ENABLE_SZIP_SUPPORT "Use SZip Filter" OFF)
if (HDF5_ENABLE_SZIP_SUPPORT)
option (HDF5_ENABLE_SZIP_ENCODING "Use SZip Encoding" OFF)
if (NOT SZIP_USE_EXTERNAL)
FIND_PACKAGE (SZIP NAMES ${SZIP_PACKAGE_NAME}${HDF_PACKAGE_EXT})
find_package (SZIP NAMES ${SZIP_PACKAGE_NAME}${HDF_PACKAGE_EXT})
if (NOT SZIP_FOUND)
FIND_PACKAGE (SZIP) # Legacy find
find_package (SZIP) # Legacy find
endif (NOT SZIP_FOUND)
endif (NOT SZIP_USE_EXTERNAL)
if (SZIP_FOUND)

View File

@ -1,4 +1,4 @@
include (${HDF_RESOURCES_DIR}/CMakePackageConfigHelpers.cmake)
include (CMakePackageConfigHelpers.cmake)
#-----------------------------------------------------------------------------
# Check for Installation Utilities
@ -63,9 +63,9 @@ set (HDF5_VERSION_MINOR ${HDF5_PACKAGE_VERSION_MINOR})
#-----------------------------------------------------------------------------
# Configure the hdf5-config.cmake file for the build directory
#-----------------------------------------------------------------------------
set(INCLUDE_INSTALL_DIR HDF5_INSTALL_INCLUDE_DIR )
set(SHARE_INSTALL_DIR "${CMAKE_CURRENT_BINARY_DIR}/${HDF5_INSTALL_CMAKE_DIR}" )
set(CURRENT_BUILD_DIR "${CMAKE_CURRENT_BINARY_DIR}" )
set (INCLUDE_INSTALL_DIR ${HDF5_INSTALL_INCLUDE_DIR})
set (SHARE_INSTALL_DIR "${CMAKE_CURRENT_BINARY_DIR}/${HDF5_INSTALL_CMAKE_DIR}" )
set (CURRENT_BUILD_DIR "${CMAKE_CURRENT_BINARY_DIR}" )
configure_package_config_file (
${HDF_RESOURCES_DIR}/hdf5-config.cmake.in
"${HDF5_BINARY_DIR}/${HDF5_PACKAGE}${HDF_PACKAGE_EXT}-config.cmake"
@ -92,14 +92,14 @@ endif (NOT HDF5_EXTERNALLY_CONFIGURED)
#-----------------------------------------------------------------------------
# Configure the hdf5-config.cmake file for the install directory
#-----------------------------------------------------------------------------
set(INCLUDE_INSTALL_DIR HDF5_INSTALL_INCLUDE_DIR )
set(SHARE_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/${HDF5_INSTALL_CMAKE_DIR}" )
set(CURRENT_BUILD_DIR "${CMAKE_INSTALL_PREFIX}" )
set (INCLUDE_INSTALL_DIR ${HDF5_INSTALL_INCLUDE_DIR})
set (SHARE_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/${HDF5_INSTALL_CMAKE_DIR}" )
set (CURRENT_BUILD_DIR "${CMAKE_INSTALL_PREFIX}" )
configure_package_config_file (
${HDF_RESOURCES_DIR}/hdf5-config.cmake.in
"${HDF5_BINARY_DIR}/CMakeFiles/${HDF5_PACKAGE}${HDF_PACKAGE_EXT}-config.cmake"
INSTALL_DESTINATION "${HDF5_INSTALL_CMAKE_DIR}"
PATH_VARS HDF5_INSTALL_INCLUDE_DIR SHARE_INSTALL_DIR CURRENT_BUILD_DIR
PATH_VARS INCLUDE_INSTALL_DIR SHARE_INSTALL_DIR CURRENT_BUILD_DIR
)
if (NOT HDF5_EXTERNALLY_CONFIGURED)

View File

@ -1,4 +1,4 @@
cmake_minimum_required (VERSION 2.8.11)
cmake_minimum_required (VERSION 3.1.0)
PROJECT (HDF5 C CXX)
#-----------------------------------------------------------------------------
@ -805,7 +805,7 @@ if (EXISTS "${HDF5_SOURCE_DIR}/fortran" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/for
if (BUILD_SHARED_LIBS AND APPLE)
message (FATAL_ERROR " **** Shared FORTRAN libraries are unsupported **** ")
endif (BUILD_SHARED_LIBS AND APPLE)
option (HDF5_ENABLE_F2003 "Enable FORTRAN 2003 Standard" OFF)
option (HDF5_ENABLE_F2003 "Enable FORTRAN 2003 Standard" ON)
include (${HDF_RESOURCES_EXT_DIR}/HDFUseFortran.cmake)
if (HDF5_ENABLE_F2003)
if (NOT FORTRAN_HAVE_ISO_C_BINDING)

View File

@ -29,6 +29,8 @@
./Makefile.am
./m4/aclocal_fc.m4
./m4/aclocal_cxx.m4
./m4/aclocal_cxx.m4
./m4/aclocal_fc.m4
./README.txt
./BRANCH.txt
./acsite.m4
@ -2322,7 +2324,6 @@
# CMake-specific Files
./config/cmake/cacheinit.cmake
./config/cmake/CMakePackageConfigHelpers.cmake
./config/cmake/ConversionTests.c
./config/cmake/ConfigureChecks.cmake
./config/cmake/CTestCustom.cmake

View File

@ -1,4 +1,4 @@
HDF5 version 1.9.213 currently under development
HDF5 version 1.9.215 currently under development
Please refer to the release_docs/INSTALL file for installation instructions.
------------------------------------------------------------------------------

View File

@ -279,7 +279,7 @@ EOF
#==========
#==========
cat > $cfgfile <<'EOF'
cmake_minimum_required(VERSION 2.8.10 FATAL_ERROR)
cmake_minimum_required(VERSION 3.1.0 FATAL_ERROR)
########################################################
# This dashboard is maintained by The HDF Group
# For any comments please contact cdashhelp@hdfgroup.org

View File

@ -118,7 +118,8 @@ $Source = "";
"H5G_iterate_t" => "x",
"H5G_info_t" => "x",
"H5I_free_t" => "x",
"H5L_class_t" => "x",
"H5I_search_func_t" => "x",
"H5L_class_t" => "x",
"H5L_elink_traverse_t" => "x",
"H5L_iterate_t" => "x",
"H5MM_allocate_t" => "x",
@ -313,14 +314,14 @@ for $file (@ARGV) {
# Make modifications
my $original = $Source;
my $napi = $Source =~ s/\n([A-Za-z]\w*(\s+[a-z]\w*)*)\s*\n #type
my $napi = $Source =~ s/\n([A-Za-z]\w*(\s+[A-Za-z]\w*)*\s*\**)\n #type
(H5[A-Z]{0,2}[^_A-Z0-9]\w*) #name
\s*\((.*?)\)\s* #args
(\{.*?\n\}[^\n]*) #body
/rewrite_func($file,$1,$3,$4,$5)/segx;
$total_api += $napi;
# If the source changed then print out the new version
# If the source changed then print out the new version
if ($original ne $Source) {
printf "%s: instrumented %d API function%s\n",
$file, $napi, 1==$napi?"":"s";

View File

@ -1,4 +1,4 @@
cmake_minimum_required (VERSION 2.8.11)
cmake_minimum_required (VERSION 3.1.0)
PROJECT (HDF5_CPP)
#-----------------------------------------------------------------------------

View File

@ -1,4 +1,4 @@
cmake_minimum_required (VERSION 2.8.11)
cmake_minimum_required (VERSION 3.1.0)
# --------------------------------------------------------------------
# Notes: When creating examples they should be prefixed
# with "cpp_ex_". This allows for easier filtering of the examples.

View File

@ -1,4 +1,4 @@
cmake_minimum_required (VERSION 2.8.11)
cmake_minimum_required (VERSION 3.1.0)
PROJECT (HDF5_CPP_SRC)
#-----------------------------------------------------------------------------

View File

@ -1,4 +1,4 @@
cmake_minimum_required (VERSION 2.8.11)
cmake_minimum_required (VERSION 3.1.0)
PROJECT (HDF5_CPP_TEST)
# --------------------------------------------------------------------
# Notes: When creating unit test executables they should be prefixed

View File

@ -1,321 +0,0 @@
#.rst:
# CMakePackageConfigHelpers
# -------------------------
#
# Helpers functions for creating config files that can be included by other
# projects to find and use a package.
#
# Adds the :command:`configure_package_config_file()` and
# :command:`write_basic_package_version_file()` commands.
#
# Generating a Package Configuration File
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
#
# .. command:: configure_package_config_file
#
# Create a config file for a project::
#
# configure_package_config_file(<input> <output> INSTALL_DESTINATION <path>
# [PATH_VARS <var1> <var2> ... <varN>]
# [NO_SET_AND_CHECK_MACRO]
# [NO_CHECK_REQUIRED_COMPONENTS_MACRO]
# [INSTALL_PREFIX <path>])
#
#
# ``configure_package_config_file()`` should be used instead of the plain
# :command:`configure_file()` command when creating the ``<Name>Config.cmake``
# or ``<Name>-config.cmake`` file for installing a project or library. It helps
# making the resulting package relocatable by avoiding hardcoded paths in the
# installed ``Config.cmake`` file.
#
# In a ``FooConfig.cmake`` file there may be code like this to make the install
# destinations know to the using project:
#
# .. code-block:: cmake
#
# set(FOO_INCLUDE_DIR "@CMAKE_INSTALL_FULL_INCLUDEDIR@" )
# set(FOO_DATA_DIR "@CMAKE_INSTALL_PREFIX@/@RELATIVE_DATA_INSTALL_DIR@" )
# set(FOO_ICONS_DIR "@CMAKE_INSTALL_PREFIX@/share/icons" )
# ...logic to determine installedPrefix from the own location...
# set(FOO_CONFIG_DIR "${installedPrefix}/@CONFIG_INSTALL_DIR@" )
#
# All 4 options shown above are not sufficient, since the first 3 hardcode the
# absolute directory locations, and the 4th case works only if the logic to
# determine the ``installedPrefix`` is correct, and if ``CONFIG_INSTALL_DIR``
# contains a relative path, which in general cannot be guaranteed. This has the
# effect that the resulting ``FooConfig.cmake`` file would work poorly under
# Windows and OSX, where users are used to choose the install location of a
# binary package at install time, independent from how
# :variable:`CMAKE_INSTALL_PREFIX` was set at build/cmake time.
#
# Using ``configure_package_config_file`` helps. If used correctly, it makes
# the resulting ``FooConfig.cmake`` file relocatable. Usage:
#
# 1. write a ``FooConfig.cmake.in`` file as you are used to
# 2. insert a line containing only the string ``@PACKAGE_INIT@``
# 3. instead of ``set(FOO_DIR "@SOME_INSTALL_DIR@")``, use
# ``set(FOO_DIR "@PACKAGE_SOME_INSTALL_DIR@")`` (this must be after the
# ``@PACKAGE_INIT@`` line)
# 4. instead of using the normal :command:`configure_file()`, use
# ``configure_package_config_file()``
#
#
#
# The ``<input>`` and ``<output>`` arguments are the input and output file, the
# same way as in :command:`configure_file()`.
#
# The ``<path>`` given to ``INSTALL_DESTINATION`` must be the destination where
# the ``FooConfig.cmake`` file will be installed to. This path can either be
# absolute, or relative to the ``INSTALL_PREFIX`` path.
#
# The variables ``<var1>`` to ``<varN>`` given as ``PATH_VARS`` are the
# variables which contain install destinations. For each of them the macro will
# create a helper variable ``PACKAGE_<var...>``. These helper variables must be
# used in the ``FooConfig.cmake.in`` file for setting the installed location.
# They are calculated by ``configure_package_config_file`` so that they are
# always relative to the installed location of the package. This works both for
# relative and also for absolute locations. For absolute locations it works
# only if the absolute location is a subdirectory of ``INSTALL_PREFIX``.
#
# If the ``INSTALL_PREFIX`` argument is passed, this is used as base path to
# calculate all the relative paths. The ``<path>`` argument must be an absolute
# path. If this argument is not passed, the :variable:`CMAKE_INSTALL_PREFIX`
# variable will be used instead. The default value is good when generating a
# FooConfig.cmake file to use your package from the install tree. When
# generating a FooConfig.cmake file to use your package from the build tree this
# option should be used.
#
# By default ``configure_package_config_file`` also generates two helper macros,
# ``set_and_check()`` and ``check_required_components()`` into the
# ``FooConfig.cmake`` file.
#
# ``set_and_check()`` should be used instead of the normal ``set()`` command for
# setting directories and file locations. Additionally to setting the variable
# it also checks that the referenced file or directory actually exists and fails
# with a ``FATAL_ERROR`` otherwise. This makes sure that the created
# ``FooConfig.cmake`` file does not contain wrong references.
# When using the ``NO_SET_AND_CHECK_MACRO``, this macro is not generated
# into the ``FooConfig.cmake`` file.
#
# ``check_required_components(<package_name>)`` should be called at the end of
# the ``FooConfig.cmake`` file if the package supports components. This macro
# checks whether all requested, non-optional components have been found, and if
# this is not the case, sets the ``Foo_FOUND`` variable to ``FALSE``, so that
# the package is considered to be not found. It does that by testing the
# ``Foo_<Component>_FOUND`` variables for all requested required components.
# When using the ``NO_CHECK_REQUIRED_COMPONENTS_MACRO`` option, this macro is
# not generated into the ``FooConfig.cmake`` file.
#
# For an example see below the documentation for
# :command:`write_basic_package_version_file()`.
#
# Generating a Package Version File
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
#
# .. command:: write_basic_package_version_file
#
# Create a version file for a project::
#
# write_basic_package_version_file(<filename>
# [VERSION <major.minor.patch>]
# COMPATIBILITY <AnyNewerVersion|SameMajorVersion|ExactVersion> )
#
#
# Writes a file for use as ``<package>ConfigVersion.cmake`` file to
# ``<filename>``. See the documentation of :command:`find_package()` for
# details on this.
#
# ``<filename>`` is the output filename, it should be in the build tree.
# ``<major.minor.patch>`` is the version number of the project to be installed.
#
# If no ``VERSION`` is given, the :variable:`PROJECT_VERSION` variable is used.
# If this hasn't been set, it errors out.
#
# The ``COMPATIBILITY`` mode ``AnyNewerVersion`` means that the installed
# package version will be considered compatible if it is newer or exactly the
# same as the requested version. This mode should be used for packages which
# are fully backward compatible, also across major versions.
# If ``SameMajorVersion`` is used instead, then the behaviour differs from
# ``AnyNewerVersion`` in that the major version number must be the same as
# requested, e.g. version 2.0 will not be considered compatible if 1.0 is
# requested. This mode should be used for packages which guarantee backward
# compatibility within the same major version.
# If ``ExactVersion`` is used, then the package is only considered compatible if
# the requested version matches exactly its own version number (not considering
# the tweak version). For example, version 1.2.3 of a package is only
# considered compatible to requested version 1.2.3. This mode is for packages
# without compatibility guarantees.
# If your project has more elaborated version matching rules, you will need to
# write your own custom ``ConfigVersion.cmake`` file instead of using this
# macro.
#
# Internally, this macro executes :command:`configure_file()` to create the
# resulting version file. Depending on the ``COMPATIBLITY``, either the file
# ``BasicConfigVersion-SameMajorVersion.cmake.in`` or
# ``BasicConfigVersion-AnyNewerVersion.cmake.in`` is used. Please note that
# these two files are internal to CMake and you should not call
# :command:`configure_file()` on them yourself, but they can be used as starting
# point to create more sophisticted custom ``ConfigVersion.cmake`` files.
#
# Example Generating Package Files
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
#
# Example using both :command:`configure_package_config_file` and
# ``write_basic_package_version_file()``:
#
# ``CMakeLists.txt``:
#
# .. code-block:: cmake
#
# set(INCLUDE_INSTALL_DIR include/ ... CACHE )
# set(LIB_INSTALL_DIR lib/ ... CACHE )
# set(SYSCONFIG_INSTALL_DIR etc/foo/ ... CACHE )
# ...
# include(CMakePackageConfigHelpers)
# configure_package_config_file(FooConfig.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/FooConfig.cmake
# INSTALL_DESTINATION ${LIB_INSTALL_DIR}/Foo/cmake
# PATH_VARS INCLUDE_INSTALL_DIR SYSCONFIG_INSTALL_DIR)
# write_basic_package_version_file(${CMAKE_CURRENT_BINARY_DIR}/FooConfigVersion.cmake
# VERSION 1.2.3
# COMPATIBILITY SameMajorVersion )
# install(FILES ${CMAKE_CURRENT_BINARY_DIR}/FooConfig.cmake ${CMAKE_CURRENT_BINARY_DIR}/FooConfigVersion.cmake
# DESTINATION ${LIB_INSTALL_DIR}/Foo/cmake )
#
# ``FooConfig.cmake.in``:
#
# .. code-block:: cmake
#
# set(FOO_VERSION x.y.z)
# ...
# @PACKAGE_INIT@
# ...
# set_and_check(FOO_INCLUDE_DIR "@PACKAGE_INCLUDE_INSTALL_DIR@")
# set_and_check(FOO_SYSCONFIG_DIR "@PACKAGE_SYSCONFIG_INSTALL_DIR@")
#
# check_required_components(Foo)
#=============================================================================
# Copyright 2012 Alexander Neundorf <neundorf@kde.org>
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
include(CMakeParseArguments)
include(WriteBasicConfigVersionFile)
macro(WRITE_BASIC_PACKAGE_VERSION_FILE)
write_basic_config_version_file(${ARGN})
endmacro()
function(CONFIGURE_PACKAGE_CONFIG_FILE _inputFile _outputFile)
set(options NO_SET_AND_CHECK_MACRO NO_CHECK_REQUIRED_COMPONENTS_MACRO)
set(oneValueArgs INSTALL_DESTINATION INSTALL_PREFIX)
set(multiValueArgs PATH_VARS )
cmake_parse_arguments(CCF "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
if(CCF_UNPARSED_ARGUMENTS)
message(FATAL_ERROR "Unknown keywords given to CONFIGURE_PACKAGE_CONFIG_FILE(): \"${CCF_UNPARSED_ARGUMENTS}\"")
endif()
if(NOT CCF_INSTALL_DESTINATION)
message(FATAL_ERROR "No INSTALL_DESTINATION given to CONFIGURE_PACKAGE_CONFIG_FILE()")
endif()
if(DEFINED CCF_INSTALL_PREFIX)
if(IS_ABSOLUTE "${CCF_INSTALL_PREFIX}")
set(installPrefix "${CCF_INSTALL_PREFIX}")
else()
message(FATAL_ERROR "INSTALL_PREFIX must be an absolute path")
endif()
else()
set(installPrefix "${CMAKE_INSTALL_PREFIX}")
endif()
if(IS_ABSOLUTE "${CCF_INSTALL_DESTINATION}")
set(absInstallDir "${CCF_INSTALL_DESTINATION}")
else()
set(absInstallDir "${installPrefix}/${CCF_INSTALL_DESTINATION}")
endif()
file(RELATIVE_PATH PACKAGE_RELATIVE_PATH "${absInstallDir}" "${installPrefix}" )
foreach(var ${CCF_PATH_VARS})
if(NOT DEFINED ${var})
message(FATAL_ERROR "Variable ${var} does not exist")
else()
if(IS_ABSOLUTE "${${var}}")
string(REPLACE "${installPrefix}" "\${PACKAGE_PREFIX_DIR}"
PACKAGE_${var} "${${var}}")
else()
set(PACKAGE_${var} "\${PACKAGE_PREFIX_DIR}/${${var}}")
endif()
endif()
endforeach()
get_filename_component(inputFileName "${_inputFile}" NAME)
set(PACKAGE_INIT "
####### Expanded from @PACKAGE_INIT@ by configure_package_config_file() #######
####### Any changes to this file will be overwritten by the next CMake run ####
####### The input file was ${inputFileName} ########
get_filename_component(PACKAGE_PREFIX_DIR \"\${CMAKE_CURRENT_LIST_DIR}/${PACKAGE_RELATIVE_PATH}\" ABSOLUTE)
")
if("${absInstallDir}" MATCHES "^(/usr)?/lib(64)?/.+")
# Handle "/usr move" symlinks created by some Linux distros.
set(PACKAGE_INIT "${PACKAGE_INIT}
# Use original install prefix when loaded through a \"/usr move\"
# cross-prefix symbolic link such as /lib -> /usr/lib.
get_filename_component(_realCurr \"\${CMAKE_CURRENT_LIST_DIR}\" REALPATH)
get_filename_component(_realOrig \"${absInstallDir}\" REALPATH)
if(_realCurr STREQUAL _realOrig)
set(PACKAGE_PREFIX_DIR \"${installPrefix}\")
endif()
unset(_realOrig)
unset(_realCurr)
")
endif()
if(NOT CCF_NO_SET_AND_CHECK_MACRO)
set(PACKAGE_INIT "${PACKAGE_INIT}
macro(set_and_check _var _file)
set(\${_var} \"\${_file}\")
if(NOT EXISTS \"\${_file}\")
message(FATAL_ERROR \"File or directory \${_file} referenced by variable \${_var} does not exist !\")
endif()
endmacro()
")
endif()
if(NOT CCF_NO_CHECK_REQUIRED_COMPONENTS_MACRO)
set(PACKAGE_INIT "${PACKAGE_INIT}
macro(check_required_components _NAME)
foreach(comp \${\${_NAME}_FIND_COMPONENTS})
if(NOT \${_NAME}_\${comp}_FOUND)
if(\${_NAME}_FIND_REQUIRED_\${comp})
set(\${_NAME}_FOUND FALSE)
endif()
endif()
endforeach()
endmacro()
")
endif()
set(PACKAGE_INIT "${PACKAGE_INIT}
####################################################################################")
configure_file("${_inputFile}" "${_outputFile}" @ONLY)
endfunction()

View File

@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 2.8.10 FATAL_ERROR)
cmake_minimum_required(VERSION 3.1.0 FATAL_ERROR)
###############################################################################################################
# This script will build and run the examples from a compressed file
# Execute from a command line:

View File

@ -1,5 +1,5 @@
#-------------------------------------------------------------------------------
MACRO (H5_SET_LIB_OPTIONS libtarget libname libtype)
macro (H5_SET_LIB_OPTIONS libtarget libname libtype)
set (LIB_OUT_NAME "${libname}")
if (${libtype} MATCHES "SHARED")
if (WIN32)
@ -28,4 +28,4 @@ MACRO (H5_SET_LIB_OPTIONS libtarget libname libtype)
endif (HDF5_BUILD_WITH_INSTALL_NAME)
endif (APPLE)
ENDMACRO (H5_SET_LIB_OPTIONS)
endmacro (H5_SET_LIB_OPTIONS)

View File

@ -16,7 +16,7 @@ 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_ENABLE_F2003 ON CACHE BOOL "Enable FORTRAN 2003 Standard" FORCE)
set (HDF5_BUILD_HL_LIB ON CACHE BOOL "Build HIGH Level HDF5 Library" FORCE)

View File

@ -16,7 +16,7 @@ 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_ENABLE_F2003 ON CACHE BOOL "Enable FORTRAN 2003 Standard" FORCE)
set (HDF5_BUILD_HL_LIB ON CACHE BOOL "Build HIGH Level HDF5 Library" FORCE)

View File

@ -19,7 +19,7 @@
# After making changes, run bin/reconfigure to update other configure related
# files like Makefile.in.
LT_VERS_INTERFACE = 6
LT_VERS_REVISION = 203
LT_VERS_REVISION = 205
LT_VERS_AGE = 0
## If the API changes *at all*, increment LT_VERS_INTERFACE and

View File

@ -26,7 +26,7 @@ AC_PREREQ([2.69])
## NOTE: Do not forget to change the version number here when we do a
## release!!!
##
AC_INIT([HDF5], [1.9.213], [help@hdfgroup.org])
AC_INIT([HDF5], [1.9.215], [help@hdfgroup.org])
AC_CONFIG_SRCDIR([src/H5.c])
AC_CONFIG_HEADER([src/H5config.h])

View File

@ -1,4 +1,4 @@
cmake_minimum_required (VERSION 2.8.11)
cmake_minimum_required (VERSION 3.1.0)
PROJECT (HDF5_EXAMPLES)
#-----------------------------------------------------------------------------

View File

@ -1,4 +1,4 @@
cmake_minimum_required (VERSION 2.8.11)
cmake_minimum_required (VERSION 3.1.0)
PROJECT (HDF5_F90 C CXX Fortran)
if (H5_HAVE_PARALLEL)

View File

@ -1,4 +1,4 @@
cmake_minimum_required (VERSION 2.8.11)
cmake_minimum_required (VERSION 3.1.0)
PROJECT (HDF5_F90_EXAMPLES C CXX Fortran)
# --------------------------------------------------------------------
# Notes: When creating examples they should be prefixed

View File

@ -1,4 +1,4 @@
cmake_minimum_required (VERSION 2.8.11)
cmake_minimum_required (VERSION 3.1.0)
PROJECT (HDF5_F90_SRC C CXX Fortran)
#-----------------------------------------------------------------------------
@ -11,6 +11,8 @@ if (WIN32)
endif (NOT H5_HAVE_PARALLEL)
if (NOT HDF5_ENABLE_F2003)
set (H5_NOF03EXP ";")
else (NOT HDF5_ENABLE_F2003)
set (H5_F03EXP ";")
endif (NOT HDF5_ENABLE_F2003)
configure_file (${HDF5_F90_SRC_SOURCE_DIR}/hdf5_fortrandll.def.in ${HDF5_F90_SRC_BINARY_DIR}/hdf5_fortrandll.def @ONLY)
endif (MSVC)
@ -132,7 +134,6 @@ if (H5_HAVE_PARALLEL)
${HDF5_F90_SRC_SOURCE_DIR}/H5FDmpiof.c
)
endif (H5_HAVE_PARALLEL)
set_source_files_properties (${f90CStub_C_SRCS} PROPERTIES LANGUAGE C)
set (f90CStub_C_HDRS
@ -224,6 +225,7 @@ else (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND)
${HDF5_F90_SRC_SOURCE_DIR}/HDF5.f90
)
endif (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND)
set_source_files_properties (${f90_F_SRCS} PROPERTIES LANGUAGE Fortran)
#-----------------------------------------------------------------------------
# Add Main fortran library
@ -255,6 +257,7 @@ set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF
H5_SET_LIB_OPTIONS (${HDF5_F90_LIB_TARGET} ${HDF5_F90_LIB_NAME} ${LIB_TYPE})
set_target_properties (${HDF5_F90_LIB_TARGET} PROPERTIES
FOLDER libraries/fortran
LINKER_LANGUAGE Fortran
INTERFACE_INCLUDE_DIRECTORIES "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include>"
)

View File

@ -1738,21 +1738,23 @@ nh5tenum_create_c ( hid_t_f *parent_id , hid_t_f *new_type_id)
/****if* H5Tf/h5tenum_insert_c
* NAME
* h5tenum_insert_c
* h5tenum_insert_c
* PURPOSE
* Call H5Tenum_insert to insert a new enumeration datatype member.
* Call H5Tenum_insert to insert a new enumeration datatype member.
* INPUTS
* type_id - identifier of the datatype
* name - Name of the new member
* namelen - length of the name
* value - value of the new member
* type_id - identifier of the datatype
* name - Name of the new member
* namelen - length of the name
* value - value of the new member
* RETURNS
* 0 on success, -1 on failure
* 0 on success, -1 on failure
* AUTHOR
* XIANGYANG SU
* Thursday, February 3, 2000
* Thursday, February 3, 2000
* HISTORY
*
* 'value' is no longer cast into an int. If the user passes in an 8 byte integer then
* it should not be cast to an int (which might be 4 bytes). Instead the value
* is written as the size of an int_f.
* SOURCE
*/
@ -1761,19 +1763,18 @@ nh5tenum_insert_c(hid_t_f *type_id, _fcd name, int_f* namelen, int_f* value)
/******/
{
int ret_value = -1;
hid_t c_type_id;
char* c_name;
size_t c_namelen;
int_f c_value;
herr_t error;
int_f c_value;
c_namelen = *namelen;
c_name = (char *)HD5f2cstring(name, c_namelen);
if (c_name == NULL) return ret_value;
c_type_id = (hid_t)*type_id;
c_value = (int)*value;
error = H5Tenum_insert(c_type_id, c_name, &c_value);
c_value = *value;
error = H5Tenum_insert((hid_t)*type_id, c_name, &c_value);
HDfree(c_name);
if(error < 0) return ret_value;
@ -2421,3 +2422,46 @@ h5tconvert_c(hid_t_f *src_id, hid_t_f *dst_id, size_t_f *nelmts, void *buf, void
return ret_value;
}
/****if* H5Tf/h5tenum_insert_ptr_c
* NAME
* /h5tenum_insert_ptr_c
* PURPOSE
* Calls H5Tenum_insert
* INPUTS
* type_id - Datatype identifier for the enumeration datatype.
* name - Datatype identifier.
* value - Pointer to the value of the new member.
*
* OUTPUTS
*
* RETURNS
* 0 on success, -1 on failure
* AUTHOR
* M. Scot Breitenfeld
* February 6, 2015
*
* SOURCE
*/
int_f
h5tenum_insert_ptr_c(hid_t_f *type_id, _fcd name, int_f* namelen, void *value)
/******/
{
int ret_value = -1;
hid_t status;
char *c_name;
size_t c_namelen;
/*
* Convert FORTRAN name to C name
*/
c_namelen = *namelen;
c_name = (char *)HD5f2cstring(name, c_namelen);
if (c_name == NULL) return ret_value;
status = H5Tenum_insert( (hid_t)*type_id, c_name, value);
if ( status < 0 ) return ret_value;
ret_value = 0;
return ret_value;
}

View File

@ -2335,57 +2335,6 @@ CONTAINS
hdferr = h5tenum_create_c(parent_id, new_type_id)
END SUBROUTINE h5tenum_create_f
!
!****s* H5T/h5tenaum_insert_f
!
! NAME
! h5tenaum_insert_f
!
! PURPOSE
! Inserts a new enumeration datatype member.
!
! INPUTS
! type_id - datatype identifier
! OUTPUTS
! hdferr - Returns 0 if successful and -1 if fails
!
! AUTHOR
! Elena Pourmal
! August 12, 1999
!
! HISTORY
! Explicit Fortran interfaces were added for
! called C functions (it is needed for Windows
! port). March 7, 2001
! SOURCE
SUBROUTINE h5tenum_insert_f(type_id, name, value, hdferr)
IMPLICIT NONE
INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier
CHARACTER(LEN=*), INTENT(IN) :: name !Name of the new member
INTEGER, INTENT(IN) :: value !value of the new member
INTEGER, INTENT(OUT) :: hdferr ! Error code
!*****
INTEGER :: namelen
INTERFACE
INTEGER FUNCTION h5tenum_insert_c(type_id, name, namelen, value)
USE H5GLOBAL
!DEC$IF DEFINED(HDF5F90_WINDOWS)
!DEC$ATTRIBUTES C,reference,decorate,alias:'H5TENUM_INSERT_C'::h5tenum_insert_c
!DEC$ENDIF
!DEC$ATTRIBUTES reference :: name
INTEGER(HID_T), INTENT(IN) :: type_id
CHARACTER(LEN=*), INTENT(IN) :: name
INTEGER, INTENT(IN) :: value
INTEGER :: namelen
END FUNCTION h5tenum_insert_c
END INTERFACE
namelen = LEN(name)
hdferr = h5tenum_insert_c(type_id, name, namelen, value)
END SUBROUTINE h5tenum_insert_f
!
!****s* H5T/h5tenum_nameof_f
!

View File

@ -47,6 +47,11 @@ MODULE H5T_PROVISIONAL
!*****
INTERFACE h5tenum_insert_f
MODULE PROCEDURE h5tenum_insert_f03
MODULE PROCEDURE h5tenum_insert_f90
END INTERFACE
CONTAINS
!****s* H5T (F03)/H5Tconvert_f_F03
@ -93,6 +98,7 @@ CONTAINS
BIND(C, NAME='h5tconvert_c')
USE, INTRINSIC :: ISO_C_BINDING, ONLY : c_ptr
USE H5GLOBAL
IMPLICIT NONE
INTEGER(HID_T) , INTENT(IN) :: src_id
INTEGER(HID_T) , INTENT(IN) :: dst_id
INTEGER(SIZE_T), INTENT(IN) :: nelmts
@ -111,6 +117,107 @@ CONTAINS
hdferr = H5Tconvert_c(src_id, dst_id, nelmts, buf, background_default, plist_id_default)
END SUBROUTINE h5tconvert_f
!
!****s* (F03) H5T/h5tenum_insert_f90
!
! NAME
! h5tenum_insert_f
!
! PURPOSE
! Inserts a new enumeration datatype member.
!
! INPUTS
! type_id - Datatype identifier for the enumeration datatype.
! name - Datatype identifier.
! value - Value of the new member.
! OUTPUTS
! hdferr - Returns 0 if successful and -1 if fails
!
! AUTHOR
! Elena Pourmal
! August 12, 1999
!
! HISTORY
! Explicit Fortran interfaces were added for
! called C functions (it is needed for Windows
! port). March 7, 2001
! SOURCE
SUBROUTINE h5tenum_insert_f90(type_id, name, value, hdferr)
IMPLICIT NONE
INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier
CHARACTER(LEN=*), INTENT(IN) :: name !Name of the new member
INTEGER, INTENT(IN) :: value ! value of the new member
INTEGER, INTENT(OUT) :: hdferr ! Error code
!*****
INTEGER :: namelen
INTERFACE
INTEGER FUNCTION h5tenum_insert_c(type_id, name, namelen, value)
USE H5GLOBAL
!DEC$IF DEFINED(HDF5F90_WINDOWS)
!DEC$ATTRIBUTES C,reference,decorate,alias:'H5TENUM_INSERT_C'::h5tenum_insert_c
!DEC$ENDIF
!DEC$ATTRIBUTES reference :: name
INTEGER(HID_T), INTENT(IN) :: type_id
CHARACTER(LEN=*), INTENT(IN) :: name
INTEGER, INTENT(IN) :: value
INTEGER :: namelen
END FUNCTION h5tenum_insert_c
END INTERFACE
namelen = LEN(name)
hdferr = h5tenum_insert_c(type_id, name, namelen, value)
END SUBROUTINE h5tenum_insert_f90
!
!****s* (F03) H5T/h5tenum_insert_f03
!
! NAME
! h5tenum_insert_f
!
! PURPOSE
! Inserts a new enumeration datatype member.
!
! INPUTS
! type_id - Datatype identifier for the enumeration datatype.
! name - Datatype identifier.
! value - Pointer to the value of the new member.
! OUTPUTS
! hdferr - Returns 0 if successful and -1 if fails
!
! AUTHOR
! M. Scot Breitenfeld
! February 6, 2015
!
! HISTORY
! F2003 implementation of function
! SOURCE
SUBROUTINE h5tenum_insert_f03(type_id, name, value, hdferr)
USE, INTRINSIC :: ISO_C_BINDING, ONLY : c_ptr, c_char
USE H5GLOBAL
IMPLICIT NONE
INTEGER(HID_T) , INTENT(IN) :: type_id
CHARACTER(LEN=*), INTENT(IN) :: name
TYPE(C_PTR) , INTENT(IN) :: value
INTEGER, INTENT(OUT) :: hdferr
!*****
INTEGER :: namelen
INTERFACE
INTEGER FUNCTION h5tenum_insert_ptr_c(type_id, name, namelen, value) &
BIND(C, NAME='h5tenum_insert_ptr_c')
USE, INTRINSIC :: ISO_C_BINDING, ONLY : c_ptr, c_char
USE H5GLOBAL
IMPLICIT NONE
INTEGER(HID_T) , INTENT(IN) :: type_id
CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: name
INTEGER :: namelen
TYPE(C_PTR), VALUE :: value
END FUNCTION h5tenum_insert_ptr_c
END INTERFACE
namelen = LEN(name)
hdferr = h5tenum_insert_ptr_c(type_id, name, namelen, value)
END SUBROUTINE h5tenum_insert_f03
END MODULE H5T_PROVISIONAL

View File

@ -36,4 +36,60 @@
MODULE H5T_PROVISIONAL
USE H5GLOBAL
CONTAINS
!
!****s* H5T/h5tenum_insert_f
!
! NAME
! h5tenum_insert_f
!
! PURPOSE
! Inserts a new enumeration datatype member.
!
! INPUTS
! type_id - Datatype identifier for the enumeration datatype.
! name - Datatype identifier.
! value - Value of the new member.
! OUTPUTS
! hdferr - Returns 0 if successful and -1 if fails
!
! AUTHOR
! Elena Pourmal
! August 12, 1999
!
! HISTORY
! Explicit Fortran interfaces were added for
! called C functions (it is needed for Windows
! port). March 7, 2001
! SOURCE
SUBROUTINE h5tenum_insert_f(type_id, name, value, hdferr)
IMPLICIT NONE
INTEGER(HID_T), INTENT(IN) :: type_id
CHARACTER(LEN=*), INTENT(IN) :: name
INTEGER, INTENT(IN) :: value
INTEGER, INTENT(OUT) :: hdferr
!*****
INTEGER :: namelen
INTERFACE
INTEGER FUNCTION h5tenum_insert_c(type_id, name, namelen, value)
USE H5GLOBAL
!DEC$IF DEFINED(HDF5F90_WINDOWS)
!DEC$ATTRIBUTES C,reference,decorate,alias:'H5TENUM_INSERT_C'::h5tenum_insert_c
!DEC$ENDIF
!DEC$ATTRIBUTES reference :: name
INTEGER(HID_T), INTENT(IN) :: type_id
CHARACTER(LEN=*), INTENT(IN) :: name
INTEGER, INTENT(IN) :: value
INTEGER :: namelen
END FUNCTION h5tenum_insert_c
END INTERFACE
namelen = LEN(name)
hdferr = h5tenum_insert_c(type_id, name, namelen, value)
END SUBROUTINE h5tenum_insert_f
END MODULE H5T_PROVISIONAL

View File

@ -772,6 +772,7 @@ H5_FCDLL int_f nh5tinsert_array_c(hid_t_f * parent_id, _fcd name, int_f* namelen
H5_FCDLL int_f nh5tinsert_array_c2(hid_t_f * parent_id, _fcd name, int_f* namelen, size_t_f* offset, int_f* ndims, size_t_f* dims, hid_t_f* member_id);
H5_FCDLL int_f nh5tenum_create_c ( hid_t_f *parent_id , hid_t_f *new_type_id);
H5_FCDLL int_f nh5tenum_insert_c(hid_t_f *type_id, _fcd name, int_f* namelen, int_f* value);
H5_FCDLL int_f h5tenum_insert_ptr_c(hid_t_f *type_id, _fcd name, int_f* namelen, void *value);
H5_FCDLL int_f nh5tenum_nameof_c(hid_t_f *type_id, int_f* value, _fcd name, size_t_f* namelen);
H5_FCDLL int_f nh5tenum_valueof_c(hid_t_f *type_id, _fcd name, int_f* namelen, int_f* value);
H5_FCDLL int_f nh5tget_member_value_c(hid_t_f *type_id, int_f* member_no, int_f* value);

View File

@ -543,7 +543,6 @@ 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
@ -560,6 +559,9 @@ H5T_mp_H5TGET_CREATE_PLIST_F
H5T_mp_H5TCOMPILER_CONV_F
H5T_mp_H5TGET_NATIVE_TYPE_F
@H5_NOF03EXP@H5T_PROVISIONAL_mp_H5TCONVERT_F
@H5_F03EXP@H5T_PROVISIONAL_mp_H5TENUM_INSERT_F
@H5_NOF03EXP@H5T_PROVISIONAL_mp_H5TENUM_INSERT_F90
@H5_NOF03EXP@H5T_PROVISIONAL_mp_H5TENUM_INSERT_F03
; H5Z
H5Z_mp_H5ZUNREGISTER_F
H5Z_mp_H5ZFILTER_AVAIL_F

View File

@ -1,4 +1,4 @@
cmake_minimum_required (VERSION 2.8.11)
cmake_minimum_required (VERSION 3.1.0)
PROJECT (HDF5_FORTRAN_TESTS C CXX Fortran)
#-----------------------------------------------------------------------------
@ -10,6 +10,7 @@ INCLUDE_DIRECTORIES (${CMAKE_Fortran_MODULE_DIRECTORY} ${HDF5_F90_BINARY_DIR} ${
# Add Test Lib
#-----------------------------------------------------------------------------
add_library (${HDF5_F90_C_TEST_LIB_TARGET} ${LIB_TYPE} t.c)
set_source_files_properties (t.c PROPERTIES LANGUAGE C)
TARGET_C_PROPERTIES (${HDF5_F90_C_TEST_LIB_TARGET} " " " ")
target_link_libraries (${HDF5_F90_C_TEST_LIB_TARGET}
${HDF5_F90_C_LIB_TARGET}
@ -18,12 +19,14 @@ target_link_libraries (${HDF5_F90_C_TEST_LIB_TARGET}
H5_SET_LIB_OPTIONS (${HDF5_F90_C_TEST_LIB_TARGET} ${HDF5_F90_C_TEST_LIB_NAME} ${LIB_TYPE})
set_target_properties (${HDF5_F90_C_TEST_LIB_TARGET} PROPERTIES
FOLDER libraries/test/fortran
LINKER_LANGUAGE C
INTERFACE_INCLUDE_DIRECTORIES "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include>"
)
# See if the F2008 intrinsic STORAGE_SIZE and C_SIZEOF are supported. If not then
# fall back to F2003. If F2003 not supported then use F90 for the tests.
set_source_files_properties (tf_F90.f90 tf_F03.f90 tf_F08.f90 tf.f90 PROPERTIES LANGUAGE Fortran)
if (FORTRAN_HAVE_STORAGE_SIZE AND FORTRAN_HAVE_C_SIZEOF)
add_library (${HDF5_F90_TEST_LIB_TARGET} ${LIB_TYPE} tf_F08.f90 tf.f90)
elseif (HDF5_ENABLE_F2003)
@ -36,7 +39,7 @@ endif (FORTRAN_HAVE_STORAGE_SIZE AND FORTRAN_HAVE_C_SIZEOF)
set (SHARED_LINK_FLAGS " ")
if (WIN32)
if (BUILD_SHARED_LIBS)
set_property (TARGET ${HDF5_F90_TEST_LIB_TARGET} APPEND PROPERTY COMPILE_DEFINITIONS BUILD_HDF5_DLL)
set_property (TARGET ${HDF5_F90_TEST_LIB_TARGET} APPEND PROPERTY COMPILE_DEFINITIONS BUILD_HDF5_TEST_DLL)
if (MSVC)
set (SHARED_LINK_FLAGS "/DLL")
endif (MSVC)
@ -53,6 +56,7 @@ target_link_libraries (${HDF5_F90_TEST_LIB_TARGET}
H5_SET_LIB_OPTIONS (${HDF5_F90_TEST_LIB_TARGET} ${HDF5_F90_TEST_LIB_NAME} ${LIB_TYPE})
set_target_properties (${HDF5_F90_TEST_LIB_TARGET} PROPERTIES
FOLDER libraries/test/fortran
LINKER_LANGUAGE Fortran
INTERFACE_INCLUDE_DIRECTORIES "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include>"
)

View File

@ -11,11 +11,13 @@ set_tests_properties (FORTRAN_testhdf5_fortran PROPERTIES PASS_REGULAR_EXPRESSIO
#-- Adding test for testhdf5_fortran_1_8
add_test (NAME FORTRAN_testhdf5_fortran_1_8 COMMAND $<TARGET_FILE:testhdf5_fortran_1_8>)
set_tests_properties (FORTRAN_testhdf5_fortran_1_8 PROPERTIES PASS_REGULAR_EXPRESSION "[ ]*0 error.s")
set_tests_properties (FORTRAN_testhdf5_fortran_1_8 PROPERTIES DEPENDS FORTRAN_testhdf5_fortran)
#-- Adding test for fortranlib_test_F03
if (HDF5_ENABLE_F2003)
add_test (NAME FORTRAN_fortranlib_test_F03 COMMAND $<TARGET_FILE:fortranlib_test_F03>)
set_tests_properties (FORTRAN_fortranlib_test_F03 PROPERTIES PASS_REGULAR_EXPRESSION "[ ]*0 error.s")
set_tests_properties (FORTRAN_fortranlib_test_F03 PROPERTIES DEPENDS FORTRAN_testhdf5_fortran_1_8)
endif (HDF5_ENABLE_F2003)
#-- Adding test for fflush1

View File

@ -1419,7 +1419,7 @@ SUBROUTINE t_enum(total_error)
! Insert enumerated value for memtype.
!
val(1) = i
CALL H5Tenum_insert_f(memtype, TRIM(names(i+1)), val(1), error)
CALL H5Tenum_insert_f(memtype, TRIM(names(i+1)), C_LOC(val(1)), error)
CALL check("H5Tenum_insert_f", error, total_error)
!
! Insert enumerated value for filetype. We must first convert
@ -1428,7 +1428,11 @@ SUBROUTINE t_enum(total_error)
f_ptr = C_LOC(val(1))
CALL H5Tconvert_f(M_BASET, F_BASET, INT(1,SIZE_T), f_ptr, error)
CALL check("H5Tconvert_f",error, total_error)
CALL H5Tenum_insert_f(filetype, TRIM(names(i+1)), val(1), error)
IF(i.GE.1)THEN ! test both F90 and F03 APIs
CALL H5Tenum_insert_f(filetype, TRIM(names(i+1)), f_ptr, error)
ELSE
CALL H5Tenum_insert_f(filetype, TRIM(names(i+1)), val(1), error)
ENDIF
CALL check("H5Tenum_insert_f",error, total_error)
ENDDO
!
@ -3134,7 +3138,7 @@ SUBROUTINE t_enum_conv(total_error)
ENUMERATOR :: E1_RED, E1_GREEN, E1_BLUE, E1_WHITE, E1_BLACK
END ENUM
INTEGER :: val
INTEGER(KIND(E1_RED)), TARGET :: val
! Enumerated data array
! Some values are out of range for testing. The library should accept them
@ -3185,19 +3189,19 @@ SUBROUTINE t_enum_conv(total_error)
! Initialize enum data.
!
val = E1_RED
CALL H5Tenum_insert_f(dtype, "RED", val, error)
CALL H5Tenum_insert_f(dtype, "RED", C_LOC(val), error)
CALL check("h5tenum_insert_f",error, total_error)
val = E1_GREEN
CALL H5Tenum_insert_f(dtype, "GREEN", val, error)
CALL H5Tenum_insert_f(dtype, "GREEN", C_LOC(val), error)
CALL check("h5tenum_insert_f",error, total_error)
val = E1_BLUE
CALL H5Tenum_insert_f(dtype, "BLUE", val, error)
CALL H5Tenum_insert_f(dtype, "BLUE", C_LOC(val), error)
CALL check("h5tenum_insert_f",error, total_error)
val = E1_WHITE
CALL H5Tenum_insert_f(dtype, "WHITE", val, error)
CALL H5Tenum_insert_f(dtype, "WHITE", C_LOC(val), error)
CALL check("h5tenum_insert_f",error, total_error)
val = E1_BLACK
CALL H5Tenum_insert_f(dtype, "BLACK", val, error)
CALL H5Tenum_insert_f(dtype, "BLACK", C_LOC(val), error)
CALL check("h5tenum_insert_f",error, total_error)
!
! Create dataspace. Setting maximum size to be the current size.

View File

@ -36,7 +36,7 @@ MODULE TH5_MISC
CONTAINS
!This definition is needed for Windows DLLs
!DEC$if defined(BUILD_HDF5_DLL)
!DEC$if defined(BUILD_HDF5_TEST_DLL)
!DEC$attributes dllexport :: dreal_eq
!DEC$endif
LOGICAL FUNCTION dreal_eq(a,b)
@ -49,7 +49,7 @@ CONTAINS
END FUNCTION dreal_eq
!This definition is needed for Windows DLLs
!DEC$if defined(BUILD_HDF5_DLL)
!DEC$if defined(BUILD_HDF5_TEST_DLL)
!DEC$attributes dllexport :: verify_real_kind_7
!DEC$endif
SUBROUTINE verify_real_kind_7(string,value,correct_value,total_error)
@ -66,7 +66,7 @@ CONTAINS
END SUBROUTINE verify_real_kind_7
!This definition is needed for Windows DLLs
!DEC$if defined(BUILD_HDF5_DLL)
!DEC$if defined(BUILD_HDF5_TEST_DLL)
!DEC$attributes dllexport :: write_test_status
!DEC$endif
SUBROUTINE write_test_status( test_result, test_title, total_error)
@ -105,7 +105,7 @@ CONTAINS
!This definition is needed for Windows DLLs
!DEC$if defined(BUILD_HDF5_DLL)
!DEC$if defined(BUILD_HDF5_TEST_DLL)
!DEC$attributes dllexport :: check
!DEC$endif
SUBROUTINE check(string,error,total_error)
@ -119,7 +119,7 @@ CONTAINS
END SUBROUTINE check
!This definition is needed for Windows DLLs
!DEC$if defined(BUILD_HDF5_DLL)
!DEC$if defined(BUILD_HDF5_TEST_DLL)
!DEC$attributes dllexport :: verify
!DEC$endif
SUBROUTINE VERIFY(string,value,correct_value,total_error)
@ -133,7 +133,7 @@ CONTAINS
END SUBROUTINE verify
!This definition is needed for Windows DLLs
!DEC$if defined(BUILD_HDF5_DLL)
!DEC$if defined(BUILD_HDF5_TEST_DLL)
!DEC$attributes dllexport :: verify_Fortran_INTEGER_4
!DEC$endif
SUBROUTINE verify_Fortran_INTEGER_4(string,value,correct_value,total_error)
@ -150,7 +150,7 @@ CONTAINS
END SUBROUTINE verify_Fortran_INTEGER_4
!This definition is needed for Windows DLLs
!DEC$if defined(BUILD_HDF5_DLL)
!DEC$if defined(BUILD_HDF5_TEST_DLL)
!DEC$attributes dllexport :: verifyLogical
!DEC$endif
SUBROUTINE verifyLogical(string,value,correct_value,total_error)
@ -165,7 +165,7 @@ CONTAINS
END SUBROUTINE verifyLogical
!This definition is needed for Windows DLLs
!DEC$if defined(BUILD_HDF5_DLL)
!DEC$if defined(BUILD_HDF5_TEST_DLL)
!DEC$attributes dllexport :: verifyString
!DEC$endif
SUBROUTINE verifyString(string, value,correct_value,total_error)
@ -203,7 +203,7 @@ CONTAINS
SUBROUTINE h5_fixname_f(base_name, full_name, fapl, hdferr)
!
!This definition is needed for Windows DLLs
!DEC$if defined(BUILD_HDF5_DLL)
!DEC$if defined(BUILD_HDF5_TEST_DLL)
!DEC$attributes dllexport :: h5_fixname_f
!DEC$endif
USE H5GLOBAL
@ -263,7 +263,7 @@ CONTAINS
SUBROUTINE h5_cleanup_f(base_name, fapl, hdferr)
!
!This definition is needed for Windows DLLs
!DEC$if defined(BUILD_HDF5_DLL)
!DEC$if defined(BUILD_HDF5_TEST_DLL)
!DEC$attributes dllexport :: h5_cleanup_f
!DEC$endif
USE H5GLOBAL
@ -315,7 +315,7 @@ CONTAINS
SUBROUTINE h5_exit_f(status)
!
!This definition is needed for Windows DLLs
!DEC$if defined(BUILD_HDF5_DLL)
!DEC$if defined(BUILD_HDF5_TEST_DLL)
!DEC$attributes dllexport :: h5_exit_f
!DEC$endif
IMPLICIT NONE
@ -352,7 +352,7 @@ CONTAINS
SUBROUTINE h5_env_nocleanup_f(HDF5_NOCLEANUP)
!
!This definition is needed for Windows DLLs
!DEC$if defined(BUILD_HDF5_DLL)
!DEC$if defined(BUILD_HDF5_TEST_DLL)
!DEC$attributes dllexport :: h5_env_nocleanup_f
!DEC$endif
IMPLICIT NONE

View File

@ -66,7 +66,7 @@ MODULE TH5_MISC_PROVISIONAL
CONTAINS
!This definition is needed for Windows DLLs
!DEC$if defined(BUILD_HDF5_DLL)
!DEC$if defined(BUILD_HDF5_TEST_DLL)
!DEC$attributes dllexport :: h5_sizeof_cmpd
!DEC$endif
INTEGER(C_SIZE_T) FUNCTION H5_SIZEOF_CMPD(a)
@ -78,7 +78,7 @@ CONTAINS
END FUNCTION H5_SIZEOF_CMPD
!This definition is needed for Windows DLLs
!DEC$if defined(BUILD_HDF5_DLL)
!DEC$if defined(BUILD_HDF5_TEST_DLL)
!DEC$attributes dllexport :: h5_sizeof_chr
!DEC$endif
INTEGER(C_SIZE_T) FUNCTION H5_SIZEOF_CHR(a)
@ -90,7 +90,7 @@ CONTAINS
END FUNCTION H5_SIZEOF_CHR
!This definition is needed for Windows DLLs
!DEC$if defined(BUILD_HDF5_DLL)
!DEC$if defined(BUILD_HDF5_TEST_DLL)
!DEC$attributes dllexport :: h5_sizeof_i
!DEC$endif
INTEGER(C_SIZE_T) FUNCTION H5_SIZEOF_I(a)
@ -102,7 +102,7 @@ CONTAINS
END FUNCTION H5_SIZEOF_I
!This definition is needed for Windows DLLs
!DEC$if defined(BUILD_HDF5_DLL)
!DEC$if defined(BUILD_HDF5_TEST_DLL)
!DEC$attributes dllexport :: h5_sizeof_sp
!DEC$endif
INTEGER(C_SIZE_T) FUNCTION H5_SIZEOF_SP(a)
@ -114,7 +114,7 @@ CONTAINS
END FUNCTION H5_SIZEOF_SP
!This definition is needed for Windows DLLs
!DEC$if defined(BUILD_HDF5_DLL)
!DEC$if defined(BUILD_HDF5_TEST_DLL)
!DEC$attributes dllexport :: h5_sizeof_dp
!DEC$endif
INTEGER(C_SIZE_T) FUNCTION H5_SIZEOF_DP(a)

View File

@ -65,7 +65,7 @@ MODULE TH5_MISC_PROVISIONAL
CONTAINS
!This definition is needed for Windows DLLs
!DEC$if defined(BUILD_HDF5_DLL)
!DEC$if defined(BUILD_HDF5_TEST_DLL)
!DEC$attributes dllexport :: h5_sizeof_cmpd
!DEC$endif
INTEGER(C_SIZE_T) FUNCTION H5_SIZEOF_CMPD(a)
@ -77,7 +77,7 @@ CONTAINS
END FUNCTION H5_SIZEOF_CMPD
!This definition is needed for Windows DLLs
!DEC$if defined(BUILD_HDF5_DLL)
!DEC$if defined(BUILD_HDF5_TEST_DLL)
!DEC$attributes dllexport :: h5_sizeof_chr
!DEC$endif
INTEGER(C_SIZE_T) FUNCTION H5_SIZEOF_CHR(a)
@ -89,7 +89,7 @@ CONTAINS
END FUNCTION H5_SIZEOF_CHR
!This definition is needed for Windows DLLs
!DEC$if defined(BUILD_HDF5_DLL)
!DEC$if defined(BUILD_HDF5_TEST_DLL)
!DEC$attributes dllexport :: h5_sizeof_i
!DEC$endif
INTEGER(C_SIZE_T) FUNCTION H5_SIZEOF_I(a)
@ -102,7 +102,7 @@ CONTAINS
!This definition is needed for Windows DLLs
!DEC$if defined(BUILD_HDF5_DLL)
!DEC$if defined(BUILD_HDF5_TEST_DLL)
!DEC$attributes dllexport :: h5_sizeof_sp
!DEC$endif
INTEGER(C_SIZE_T) FUNCTION H5_SIZEOF_SP(a)
@ -114,7 +114,7 @@ CONTAINS
END FUNCTION H5_SIZEOF_SP
!This definition is needed for Windows DLLs
!DEC$if defined(BUILD_HDF5_DLL)
!DEC$if defined(BUILD_HDF5_TEST_DLL)
!DEC$attributes dllexport :: h5_sizeof_dp
!DEC$endif
INTEGER(C_SIZE_T) FUNCTION H5_SIZEOF_DP(a)

View File

@ -1,4 +1,4 @@
cmake_minimum_required (VERSION 2.8.11)
cmake_minimum_required (VERSION 3.1.0)
PROJECT (HDF5_FORTRAN_TESTPAR C CXX Fortran)
#-----------------------------------------------------------------------------

View File

@ -1,4 +1,4 @@
cmake_minimum_required (VERSION 2.8.11)
cmake_minimum_required (VERSION 3.1.0)
PROJECT (HDF5_HL C CXX)
#-----------------------------------------------------------------------------

View File

@ -1,4 +1,4 @@
cmake_minimum_required (VERSION 2.8.11)
cmake_minimum_required (VERSION 3.1.0)
PROJECT (HDF5_HL_CPP)
#-----------------------------------------------------------------------------

View File

@ -1,4 +1,4 @@
cmake_minimum_required (VERSION 2.8.11)
cmake_minimum_required (VERSION 3.1.0)
PROJECT (HDF5_HL_CPP_EXAMPLES)
#-----------------------------------------------------------------------------

View File

@ -1,4 +1,4 @@
cmake_minimum_required (VERSION 2.8.11)
cmake_minimum_required (VERSION 3.1.0)
PROJECT (HDF5_HL_CPP_SRC)
#-----------------------------------------------------------------------------

View File

@ -1,4 +1,4 @@
cmake_minimum_required (VERSION 2.8.11)
cmake_minimum_required (VERSION 3.1.0)
PROJECT (HDF5_HL_CPP_TEST)
#-----------------------------------------------------------------------------

View File

@ -1,4 +1,4 @@
cmake_minimum_required (VERSION 2.8.11)
cmake_minimum_required (VERSION 3.1.0)
PROJECT (HDF5_HL_EXAMPLES )
#-----------------------------------------------------------------------------

View File

@ -13,7 +13,6 @@
* access to either file, you may request a copy from help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#include "hdf5.h"
#include "hdf5_hl.h"
#include <stdlib.h>

View File

@ -13,7 +13,6 @@
* access to either file, you may request a copy from help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#include "hdf5.h"
#include "hdf5_hl.h"
#include <stdlib.h>

View File

@ -13,7 +13,6 @@
* access to either file, you may request a copy from help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#include "hdf5.h"
#include "hdf5_hl.h"
#include <stdlib.h>

View File

@ -13,7 +13,6 @@
* access to either file, you may request a copy from help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#include "hdf5.h"
#include "hdf5_hl.h"
#include <stdlib.h>

View File

@ -13,7 +13,6 @@
* access to either file, you may request a copy from help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#include "hdf5.h"
#include "hdf5_hl.h"
#include <stdlib.h>

View File

@ -1,4 +1,4 @@
cmake_minimum_required (VERSION 2.8.11)
cmake_minimum_required (VERSION 3.1.0)
PROJECT (HDF5_HL_F90 C CXX Fortran)
#-----------------------------------------------------------------------------
@ -9,9 +9,9 @@ add_subdirectory (${HDF5_HL_F90_SOURCE_DIR}/src ${HDF5_HL_F90_BINARY_DIR}/src)
#-----------------------------------------------------------------------------
# Build the HL Fortran Examples
#-----------------------------------------------------------------------------
if (HDF5_BUILD_FORTRAN_EXAMPLES)
if (HDF5_BUILD_EXAMPLES)
add_subdirectory (${HDF5_HL_F90_SOURCE_DIR}/examples ${HDF5_HL_F90_BINARY_DIR}/examples)
endif (HDF5_BUILD_FORTRAN_EXAMPLES)
endif (HDF5_BUILD_EXAMPLES)
#-----------------------------------------------------------------------------
# Testing

View File

@ -1,4 +1,4 @@
cmake_minimum_required (VERSION 2.8.11)
cmake_minimum_required (VERSION 3.1.0)
PROJECT (HDF5_HL_F90_EXAMPLES C CXX Fortran)
#-----------------------------------------------------------------------------

View File

@ -1,4 +1,4 @@
cmake_minimum_required (VERSION 2.8.11)
cmake_minimum_required (VERSION 3.1.0)
PROJECT(HDF5_HL_F90_SRC C CXX Fortran)
#-----------------------------------------------------------------------------
@ -45,6 +45,7 @@ set (HDF5_HL_F90_F_SRCS
${HDF5_HL_F90_SRC_SOURCE_DIR}/H5LTff.f90
${HDF5_HL_F90_SRC_SOURCE_DIR}/H5IMff.f90
)
set_source_files_properties (${HDF5_HL_F90_F_SRCS} PROPERTIES LANGUAGE Fortran)
add_library (${HDF5_HL_F90_LIB_TARGET} ${LIB_TYPE} ${HDF5_HL_F90_F_SRCS})
set (SHARED_LINK_FLAGS " ")
@ -52,8 +53,8 @@ if (BUILD_SHARED_LIBS)
if (WIN32)
set_property (TARGET ${HDF5_HL_F90_LIB_TARGET}
APPEND PROPERTY COMPILE_DEFINITIONS
BUILD_HDF5_DLL
)
BUILD_HDF5_HL_DLL
)
if (MSVC)
set (SHARED_LINK_FLAGS "/DLL")
endif (MSVC)
@ -72,6 +73,7 @@ set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF
H5_SET_LIB_OPTIONS (${HDF5_HL_F90_LIB_TARGET} ${HDF5_HL_F90_LIB_NAME} ${LIB_TYPE})
set_target_properties (${HDF5_HL_F90_LIB_TARGET} PROPERTIES
FOLDER libraries/hl/fortran
LINKER_LANGUAGE Fortran
INTERFACE_INCLUDE_DIRECTORIES "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include>"
)

View File

@ -48,7 +48,7 @@ CONTAINS
!
!This definition is needed for Windows DLLs
!DEC$if defined(BUILD_HDF5_DLL)
!DEC$if defined(BUILD_HDF5_HL_DLL)
!DEC$attributes dllexport :: h5dsset_scale_f
!DEC$endif
!
@ -63,6 +63,7 @@ CONTAINS
INTEGER FUNCTION H5DSset_scale_c(dsid, dimname, dimname_len )
USE h5global
IMPLICIT NONE
!DEC$IF DEFINED(HDF5F90_WINDOWS)
!DEC$ATTRIBUTES C,reference,decorate,alias:'H5DSSET_SCALE_C'::h5dsset_scale_c
!DEC$ENDIF
@ -105,7 +106,7 @@ CONTAINS
!
!This definition is needed for Windows DLLs
!DEC$if defined(BUILD_HDF5_DLL)
!DEC$if defined(BUILD_HDF5_HL_DLL)
!DEC$attributes dllexport :: h5dsattach_scale_f
!DEC$endif
!
@ -119,6 +120,7 @@ CONTAINS
INTEGER FUNCTION H5DSattach_scale_c(did, dsid, idx )
USE h5global
IMPLICIT NONE
!DEC$IF DEFINED(HDF5F90_WINDOWS)
!DEC$ATTRIBUTES C,reference,decorate,alias:'H5DSATTACH_SCALE_C':: h5dsattach_scale_c
!DEC$ENDIF
@ -157,7 +159,7 @@ CONTAINS
!
!This definition is needed for Windows DLLs
!DEC$if defined(BUILD_HDF5_DLL)
!DEC$if defined(BUILD_HDF5_HL_DLL)
!DEC$attributes dllexport :: h5dsdetach_scale_f
!DEC$endif
!
@ -171,6 +173,7 @@ CONTAINS
INTEGER FUNCTION H5DSdetach_scale_c(did, dsid, idx )
USE h5global
IMPLICIT NONE
!DEC$IF DEFINED(HDF5F90_WINDOWS)
!DEC$ATTRIBUTES C,reference,decorate,alias:'H5DSDETACH_SCALE_C':: h5dsdetach_scale_c
!DEC$ENDIF
@ -210,7 +213,7 @@ CONTAINS
!
!This definition is needed for Windows DLLs
!DEC$if defined(BUILD_HDF5_DLL)
!DEC$if defined(BUILD_HDF5_HL_DLL)
!DEC$attributes dllexport :: h5dsis_attached_f
!DEC$endif
!
@ -227,6 +230,7 @@ CONTAINS
INTEGER FUNCTION H5DSis_attached_c(did, dsid, idx, c_is_attached )
USE h5global
IMPLICIT NONE
!DEC$IF DEFINED(HDF5F90_WINDOWS)
!DEC$ATTRIBUTES C,reference,decorate,alias:'H5DSIS_ATTACHED_C':: h5dsis_attached_c
!DEC$ENDIF
@ -277,7 +281,7 @@ CONTAINS
!
!This definition is needed for Windows DLLs
!DEC$if defined(BUILD_HDF5_DLL)
!DEC$if defined(BUILD_HDF5_HL_DLL)
!DEC$attributes dllexport :: h5dsis_scale_f
!DEC$endif
!
@ -291,6 +295,7 @@ CONTAINS
INTEGER FUNCTION H5DSis_scale_c(did,c_is_scale)
USE h5global
IMPLICIT NONE
!DEC$IF DEFINED(HDF5F90_WINDOWS)
!DEC$ATTRIBUTES C,reference,decorate,alias:'H5DSIS_SCALE_C':: h5dsis_scale_c
!DEC$ENDIF
@ -333,7 +338,7 @@ CONTAINS
!
!This definition is needed for Windows DLLs
!DEC$if defined(BUILD_HDF5_DLL)
!DEC$if defined(BUILD_HDF5_HL_DLL)
!DEC$attributes dllexport :: h5dsset_label_f
!DEC$endif
!
@ -350,6 +355,7 @@ CONTAINS
INTEGER FUNCTION H5DSset_label_c(did, idx, label, label_len)
USE h5global
IMPLICIT NONE
!DEC$IF DEFINED(HDF5F90_WINDOWS)
!DEC$ATTRIBUTES C,reference,decorate,alias:'H5DSSET_LABEL_C'::h5dsset_label_c
!DEC$ENDIF
@ -391,7 +397,7 @@ CONTAINS
!
!This definition is needed for Windows DLLs
!DEC$if defined(BUILD_HDF5_DLL)
!DEC$if defined(BUILD_HDF5_HL_DLL)
!DEC$attributes dllexport :: h5dsget_label_f
!DEC$endif
!
@ -407,6 +413,7 @@ CONTAINS
INTEGER FUNCTION H5DSget_label_c(did, idx, label, size)
USE h5global
IMPLICIT NONE
!DEC$IF DEFINED(HDF5F90_WINDOWS)
!DEC$ATTRIBUTES C,reference,decorate,alias:'H5DSGET_LABEL_C'::h5dsget_label_c
!DEC$ENDIF
@ -448,7 +455,7 @@ CONTAINS
!
!This definition is needed for Windows DLLs
!DEC$if defined(BUILD_HDF5_DLL)
!DEC$if defined(BUILD_HDF5_HL_DLL)
!DEC$attributes dllexport :: h5dsget_scale_name_f
!DEC$endif
!
@ -462,6 +469,7 @@ CONTAINS
INTEGER FUNCTION H5DSget_scale_name_c(did, name, size)
USE h5global
IMPLICIT NONE
!DEC$IF DEFINED(HDF5F90_WINDOWS)
!DEC$ATTRIBUTES C,reference,decorate,alias:'H5DSGET_SCALE_NAME_C'::h5dsget_scale_name_c
!DEC$ENDIF
@ -499,7 +507,7 @@ CONTAINS
!
!This definition is needed for Windows DLLs
!DEC$if defined(BUILD_HDF5_DLL)
!DEC$if defined(BUILD_HDF5_HL_DLL)
!DEC$attributes dllexport :: h5dsget_num_scales_f
!DEC$endif
!
@ -513,6 +521,7 @@ CONTAINS
INTEGER FUNCTION H5DSget_num_scales_c(did, idx, num_scales)
USE h5global
IMPLICIT NONE
!DEC$IF DEFINED(HDF5F90_WINDOWS)
!DEC$ATTRIBUTES C,reference,decorate,alias:'H5DSGET_NUM_SCALES_C':: h5dsget_num_scales_c
!DEC$ENDIF

View File

@ -51,7 +51,7 @@ subroutine h5immake_image_8bit_f(loc_id,&
!
!This definition is needed for Windows DLLs
!DEC$if defined(BUILD_HDF5_DLL)
!DEC$if defined(BUILD_HDF5_HL_DLL)
!DEC$attributes dllexport :: h5immake_image_8bit_f
!DEC$endif
!
@ -67,6 +67,7 @@ subroutine h5immake_image_8bit_f(loc_id,&
interface
integer function h5immake_image_8bit_c(loc_id,namelen,dset_name,width,height,buf)
use h5global
IMPLICIT NONE
!DEC$IF DEFINED(HDF5F90_WINDOWS)
!DEC$ATTRIBUTES C,reference,decorate,alias:'H5IMMAKE_IMAGE_8BIT_C'::h5immake_image_8bit_c
!DEC$ENDIF
@ -114,7 +115,7 @@ subroutine h5imread_image_f(loc_id,&
!
!This definition is needed for Windows DLLs
!DEC$if defined(BUILD_HDF5_DLL)
!DEC$if defined(BUILD_HDF5_HL_DLL)
!DEC$attributes dllexport :: h5imread_image_f
!DEC$endif
!
@ -127,6 +128,7 @@ subroutine h5imread_image_f(loc_id,&
interface
integer function h5imread_image_c(loc_id,namelen,dset_name,buf)
use h5global
IMPLICIT NONE
!DEC$IF DEFINED(HDF5F90_WINDOWS)
!DEC$ATTRIBUTES C,reference,decorate,alias:'H5IMREAD_IMAGE_C'::h5imread_image_c
!DEC$ENDIF
@ -173,7 +175,7 @@ subroutine h5immake_image_24bit_f(loc_id,&
!
!This definition is needed for Windows DLLs
!DEC$if defined(BUILD_HDF5_DLL)
!DEC$if defined(BUILD_HDF5_HL_DLL)
!DEC$attributes dllexport :: h5immake_image_24bit_f
!DEC$endif
!
@ -191,6 +193,7 @@ subroutine h5immake_image_24bit_f(loc_id,&
interface
integer function h5immake_image_24bit_c(loc_id,namelen,dset_name,ilen,il,width,height,buf)
use h5global
IMPLICIT NONE
!DEC$IF DEFINED(HDF5F90_WINDOWS)
!DEC$ATTRIBUTES C,reference,decorate,alias:'H5IMMAKE_IMAGE_24BIT_C'::h5immake_image_24bit_c
!DEC$ENDIF
@ -246,7 +249,7 @@ subroutine h5imget_image_info_f(loc_id,&
!
!This definition is needed for Windows DLLs
!DEC$if defined(BUILD_HDF5_DLL)
!DEC$if defined(BUILD_HDF5_HL_DLL)
!DEC$attributes dllexport :: h5imget_image_info_f
!DEC$endif
!
@ -265,6 +268,7 @@ subroutine h5imget_image_info_f(loc_id,&
interface
integer function h5imget_image_info_c(loc_id,namelen,dset_name,width,height,planes,npals,ilen,interlace)
use h5global
IMPLICIT NONE
!DEC$IF DEFINED(HDF5F90_WINDOWS)
!DEC$ATTRIBUTES C,reference,decorate,alias:'H5IMGET_IMAGE_INFO_C'::h5imget_image_info_c
!DEC$ENDIF
@ -313,7 +317,7 @@ integer function h5imis_image_f(loc_id,&
!
!This definition is needed for Windows DLLs
!DEC$if defined(BUILD_HDF5_DLL)
!DEC$if defined(BUILD_HDF5_HL_DLL)
!DEC$attributes dllexport :: h5imis_image_f
!DEC$endif
!
@ -326,6 +330,7 @@ integer function h5imis_image_f(loc_id,&
interface
integer function h5imis_image_c(loc_id,namelen,dset_name)
use h5global
IMPLICIT NONE
!DEC$IF DEFINED(HDF5F90_WINDOWS)
!DEC$ATTRIBUTES C,reference,decorate,alias:'H5IMIS_IMAGE_C'::h5imis_image_c
!DEC$ENDIF
@ -370,7 +375,7 @@ subroutine h5immake_palette_f(loc_id,&
!
!This definition is needed for Windows DLLs
!DEC$if defined(BUILD_HDF5_DLL)
!DEC$if defined(BUILD_HDF5_HL_DLL)
!DEC$attributes dllexport :: h5immake_palette_f
!DEC$endif
!
@ -385,6 +390,7 @@ subroutine h5immake_palette_f(loc_id,&
interface
integer function h5immake_palette_c(loc_id,namelen,dset_name,pal_dims,buf)
use h5global
IMPLICIT NONE
!DEC$IF DEFINED(HDF5F90_WINDOWS)
!DEC$ATTRIBUTES C,reference,decorate,alias:'H5IMMAKE_PALETTE_C'::h5immake_palette_c
!DEC$ENDIF
@ -430,7 +436,7 @@ subroutine h5imlink_palette_f(loc_id,&
!
!This definition is needed for Windows DLLs
!DEC$if defined(BUILD_HDF5_DLL)
!DEC$if defined(BUILD_HDF5_HL_DLL)
!DEC$attributes dllexport :: h5imlink_palette_f
!DEC$endif
!
@ -444,6 +450,7 @@ subroutine h5imlink_palette_f(loc_id,&
interface
integer function h5imlink_palette_c(loc_id,namelen,dset_name,ilen,pal_name)
use h5global
IMPLICIT NONE
!DEC$IF DEFINED(HDF5F90_WINDOWS)
!DEC$ATTRIBUTES C,reference,decorate,alias:'H5IMLINK_PALETTE_C'::h5imlink_palette_c
!DEC$ENDIF
@ -490,7 +497,7 @@ subroutine h5imunlink_palette_f(loc_id,&
!
!This definition is needed for Windows DLLs
!DEC$if defined(BUILD_HDF5_DLL)
!DEC$if defined(BUILD_HDF5_HL_DLL)
!DEC$attributes dllexport :: h5imunlink_palette_f
!DEC$endif
!
@ -506,6 +513,7 @@ subroutine h5imunlink_palette_f(loc_id,&
interface
integer function h5imunlink_palette_c(loc_id,namelen,dset_name,ilen,pal_name)
use h5global
IMPLICIT NONE
!DEC$IF DEFINED(HDF5F90_WINDOWS)
!DEC$ATTRIBUTES C,reference,decorate,alias:'H5IMUNLINK_PALETTE_C'::h5imunlink_palette_c
!DEC$ENDIF
@ -553,7 +561,7 @@ subroutine h5imget_npalettes_f(loc_id,&
!
!This definition is needed for Windows DLLs
!DEC$if defined(BUILD_HDF5_DLL)
!DEC$if defined(BUILD_HDF5_HL_DLL)
!DEC$attributes dllexport :: h5imget_npalettes_f
!DEC$endif
!
@ -567,6 +575,7 @@ subroutine h5imget_npalettes_f(loc_id,&
interface
integer function h5imget_npalettes_c(loc_id,namelen,dset_name,npals)
use h5global
IMPLICIT NONE
!DEC$IF DEFINED(HDF5F90_WINDOWS)
!DEC$ATTRIBUTES C,reference,decorate,alias:'H5IMGET_NPALETTES_C'::h5imget_npalettes_c
!DEC$ENDIF
@ -612,7 +621,7 @@ subroutine h5imget_palette_info_f(loc_id,&
!
!This definition is needed for Windows DLLs
!DEC$if defined(BUILD_HDF5_DLL)
!DEC$if defined(BUILD_HDF5_HL_DLL)
!DEC$attributes dllexport :: h5imget_palette_info_f
!DEC$endif
!
@ -627,6 +636,7 @@ subroutine h5imget_palette_info_f(loc_id,&
interface
integer function h5imget_palette_info_c(loc_id,namelen,dset_name,pal_number,dims)
use h5global
IMPLICIT NONE
!DEC$IF DEFINED(HDF5F90_WINDOWS)
!DEC$ATTRIBUTES C,reference,decorate,alias:'H5IMGET_PALETTE_INFO_C'::h5imget_palette_info_c
!DEC$ENDIF
@ -674,7 +684,7 @@ subroutine h5imget_palette_f(loc_id,&
!
!This definition is needed for Windows DLLs
!DEC$if defined(BUILD_HDF5_DLL)
!DEC$if defined(BUILD_HDF5_HL_DLL)
!DEC$attributes dllexport :: h5imget_palette_f
!DEC$endif
!
@ -689,6 +699,7 @@ subroutine h5imget_palette_f(loc_id,&
interface
integer function h5imget_palette_c(loc_id,namelen,dset_name,pal_number,buf)
use h5global
IMPLICIT NONE
!DEC$IF DEFINED(HDF5F90_WINDOWS)
!DEC$ATTRIBUTES C,reference,decorate,alias:'H5IMGET_PALETTE_C'::h5imget_palette_c
!DEC$ENDIF
@ -731,7 +742,7 @@ integer function h5imis_palette_f(loc_id,&
!
!This definition is needed for Windows DLLs
!DEC$if defined(BUILD_HDF5_DLL)
!DEC$if defined(BUILD_HDF5_HL_DLL)
!DEC$attributes dllexport :: h5imis_palette_f
!DEC$endif
!
@ -744,6 +755,7 @@ integer function h5imis_palette_f(loc_id,&
interface
integer function h5imis_palette_c(loc_id,namelen,dset_name)
use h5global
IMPLICIT NONE
!DEC$IF DEFINED(HDF5F90_WINDOWS)
!DEC$ATTRIBUTES C,reference,decorate,alias:'H5IMIS_PALETTE_C'::h5imis_palette_c
!DEC$ENDIF

File diff suppressed because it is too large Load Diff

View File

@ -96,7 +96,7 @@ SUBROUTINE h5tbmake_table_f(table_title,&
!
!This definition is needed for Windows DLLs
!DEC$if defined(BUILD_HDF5_DLL)
!DEC$if defined(BUILD_HDF5_HL_DLL)
!DEC$attributes dllexport :: h5tbmake_table_f
!DEC$endif
!
@ -138,6 +138,7 @@ SUBROUTINE h5tbmake_table_f(table_title,&
field_names)
USE h5global
IMPLICIT NONE
!DEC$IF DEFINED(HDF5F90_WINDOWS)
!DEC$ATTRIBUTES C,reference,decorate,alias:'H5TBMAKE_TABLE_C'::h5tbmake_table_c
!DEC$ENDIF
@ -157,7 +158,7 @@ SUBROUTINE h5tbmake_table_f(table_title,&
INTEGER :: namelen ! name length
INTEGER :: namelen1 ! name length
INTEGER, DIMENSION(nfields) :: char_len_field_names ! field name's lengths
INTEGER :: max_char_size ! character len of field names
INTEGER :: max_char_size_field_names ! character len of field names
END FUNCTION h5tbmake_table_c
END INTERFACE
@ -218,7 +219,7 @@ SUBROUTINE h5tbwrite_field_name_f_int(loc_id,&
!
!This definition is needed for Windows DLLs
!DEC$if defined(BUILD_HDF5_DLL)
!DEC$if defined(BUILD_HDF5_HL_DLL)
!DEC$attributes dllexport :: h5tbwrite_field_name_f_int
!DEC$endif
!
@ -239,6 +240,7 @@ SUBROUTINE h5tbwrite_field_name_f_int(loc_id,&
start,nrecords,type_size,buf)
USE h5global
IMPLICIT NONE
!DEC$IF DEFINED(HDF5F90_WINDOWS)
!DEC$ATTRIBUTES C,reference,decorate,alias:'H5TBWRITE_FIELD_NAME_INT_C'::h5tbwrite_field_name_int_c
!DEC$ENDIF
@ -293,7 +295,7 @@ SUBROUTINE h5tbwrite_field_name_f_float(loc_id,&
!
!This definition is needed for Windows DLLs
!DEC$if defined(BUILD_HDF5_DLL)
!DEC$if defined(BUILD_HDF5_HL_DLL)
!DEC$attributes dllexport :: h5tbwrite_field_name_f_float
!DEC$endif
!
@ -314,6 +316,7 @@ SUBROUTINE h5tbwrite_field_name_f_float(loc_id,&
start,nrecords,type_size,buf)
USE h5global
IMPLICIT NONE
!DEC$IF DEFINED(HDF5F90_WINDOWS)
!DEC$ATTRIBUTES C,reference,decorate,alias:'H5TBWRITE_FIELD_NAME_FL_C'::h5tbwrite_field_name_fl_c
!DEC$ENDIF
@ -370,7 +373,7 @@ SUBROUTINE h5tbwrite_field_name_f_double(loc_id,&
!
!This definition is needed for Windows DLLs
!DEC$if defined(BUILD_HDF5_DLL)
!DEC$if defined(BUILD_HDF5_HL_DLL)
!DEC$attributes dllexport :: h5tbwrite_field_name_f_double
!DEC$endif
!
@ -391,6 +394,7 @@ SUBROUTINE h5tbwrite_field_name_f_double(loc_id,&
start,nrecords,type_size,buf)
USE h5global
IMPLICIT NONE
!DEC$IF DEFINED(HDF5F90_WINDOWS)
!DEC$ATTRIBUTES C,reference,decorate,alias:'H5TBWRITE_FIELD_NAME_DL_C'::h5tbwrite_field_name_dl_c
!DEC$ENDIF
@ -445,7 +449,7 @@ SUBROUTINE h5tbwrite_field_name_f_string(loc_id,&
!
!This definition is needed for Windows DLLs
!DEC$if defined(BUILD_HDF5_DLL)
!DEC$if defined(BUILD_HDF5_HL_DLL)
!DEC$attributes dllexport :: h5tbwrite_field_name_f_string
!DEC$endif
!
@ -466,6 +470,7 @@ SUBROUTINE h5tbwrite_field_name_f_string(loc_id,&
start,nrecords,type_size,buf)
USE h5global
IMPLICIT NONE
!DEC$IF DEFINED(HDF5F90_WINDOWS)
!DEC$ATTRIBUTES C,reference,decorate,alias:'H5TBWRITE_FIELD_NAME_ST_C'::h5tbwrite_field_name_st_c
!DEC$ENDIF
@ -521,7 +526,7 @@ SUBROUTINE h5tbread_field_name_f_int(loc_id,&
!
!This definition is needed for Windows DLLs
!DEC$if defined(BUILD_HDF5_DLL)
!DEC$if defined(BUILD_HDF5_HL_DLL)
!DEC$attributes dllexport :: h5tbread_field_name_f_int
!DEC$endif
!
@ -542,6 +547,7 @@ SUBROUTINE h5tbread_field_name_f_int(loc_id,&
start,nrecords,type_size,buf)
USE h5global
IMPLICIT NONE
!DEC$IF DEFINED(HDF5F90_WINDOWS)
!DEC$ATTRIBUTES C,reference,decorate,alias:'H5TBREAD_FIELD_NAME_INT_C'::h5tbread_field_name_int_c
!DEC$ENDIF
@ -596,7 +602,7 @@ SUBROUTINE h5tbread_field_name_f_float(loc_id,&
!
!This definition is needed for Windows DLLs
!DEC$if defined(BUILD_HDF5_DLL)
!DEC$if defined(BUILD_HDF5_HL_DLL)
!DEC$attributes dllexport :: h5tbread_field_name_f_float
!DEC$endif
!
@ -617,6 +623,7 @@ SUBROUTINE h5tbread_field_name_f_float(loc_id,&
start,nrecords,type_size,buf)
USE h5global
IMPLICIT NONE
!DEC$IF DEFINED(HDF5F90_WINDOWS)
!DEC$ATTRIBUTES C,reference,decorate,alias:'H5TBREAD_FIELD_NAME_FL_C'::h5tbread_field_name_fl_c
!DEC$ENDIF
@ -671,7 +678,7 @@ SUBROUTINE h5tbread_field_name_f_double(loc_id,&
!
!This definition is needed for Windows DLLs
!DEC$if defined(BUILD_HDF5_DLL)
!DEC$if defined(BUILD_HDF5_HL_DLL)
!DEC$attributes dllexport :: h5tbread_field_name_f_double
!DEC$endif
!
@ -692,6 +699,7 @@ SUBROUTINE h5tbread_field_name_f_double(loc_id,&
start,nrecords,type_size,buf)
USE h5global
IMPLICIT NONE
!DEC$IF DEFINED(HDF5F90_WINDOWS)
!DEC$ATTRIBUTES C,reference,decorate,alias:'H5TBREAD_FIELD_NAME_DL_C'::h5tbread_field_name_dl_c
!DEC$ENDIF
@ -746,7 +754,7 @@ SUBROUTINE h5tbread_field_name_f_string(loc_id,&
!
!This definition is needed for Windows DLLs
!DEC$if defined(BUILD_HDF5_DLL)
!DEC$if defined(BUILD_HDF5_HL_DLL)
!DEC$attributes dllexport :: h5tbread_field_name_f_string
!DEC$endif
!
@ -767,6 +775,7 @@ SUBROUTINE h5tbread_field_name_f_string(loc_id,&
start,nrecords,type_size,buf)
USE h5global
IMPLICIT NONE
!DEC$IF DEFINED(HDF5F90_WINDOWS)
!DEC$ATTRIBUTES C,reference,decorate,alias:'H5TBREAD_FIELD_NAME_ST_C'::h5tbread_field_name_st_c
!DEC$ENDIF
@ -822,7 +831,7 @@ SUBROUTINE h5tbwrite_field_index_f_int(loc_id,&
!
!This definition is needed for Windows DLLs
!DEC$if defined(BUILD_HDF5_DLL)
!DEC$if defined(BUILD_HDF5_HL_DLL)
!DEC$attributes dllexport :: h5tbwrite_field_index_f_int
!DEC$endif
!
@ -842,6 +851,7 @@ SUBROUTINE h5tbwrite_field_index_f_int(loc_id,&
start,nrecords,type_size,buf)
USE h5global
IMPLICIT NONE
!DEC$IF DEFINED(HDF5F90_WINDOWS)
!DEC$ATTRIBUTES C,reference,decorate,alias:'H5TBWRITE_FIELD_INDEX_INT_C'::h5tbwrite_field_index_int_c
!DEC$ENDIF
@ -893,7 +903,7 @@ SUBROUTINE h5tbwrite_field_index_f_float(loc_id,&
!
!This definition is needed for Windows DLLs
!DEC$if defined(BUILD_HDF5_DLL)
!DEC$if defined(BUILD_HDF5_HL_DLL)
!DEC$attributes dllexport :: h5tbwrite_field_index_f_float
!DEC$endif
!
@ -913,6 +923,7 @@ SUBROUTINE h5tbwrite_field_index_f_float(loc_id,&
start,nrecords,type_size,buf)
USE h5global
IMPLICIT NONE
!DEC$IF DEFINED(HDF5F90_WINDOWS)
!DEC$ATTRIBUTES C,reference,decorate,alias:'H5TBWRITE_FIELD_INDEX_FL_C'::h5tbwrite_field_index_fl_c
!DEC$ENDIF
@ -966,7 +977,7 @@ SUBROUTINE h5tbwrite_field_index_f_double(loc_id,&
!
!This definition is needed for Windows DLLs
!DEC$if defined(BUILD_HDF5_DLL)
!DEC$if defined(BUILD_HDF5_HL_DLL)
!DEC$attributes dllexport :: h5tbwrite_field_index_f_double
!DEC$endif
!
@ -986,6 +997,7 @@ SUBROUTINE h5tbwrite_field_index_f_double(loc_id,&
start,nrecords,type_size,buf)
USE h5global
IMPLICIT NONE
!DEC$IF DEFINED(HDF5F90_WINDOWS)
!DEC$ATTRIBUTES C,reference,decorate,alias:'H5TBWRITE_FIELD_INDEX_DL_C'::h5tbwrite_field_index_dl_c
!DEC$ENDIF
@ -1037,7 +1049,7 @@ SUBROUTINE h5tbwrite_field_index_f_string(loc_id,&
!
!This definition is needed for Windows DLLs
!DEC$if defined(BUILD_HDF5_DLL)
!DEC$if defined(BUILD_HDF5_HL_DLL)
!DEC$attributes dllexport :: h5tbwrite_field_index_f_string
!DEC$endif
!
@ -1057,6 +1069,7 @@ SUBROUTINE h5tbwrite_field_index_f_string(loc_id,&
start,nrecords,type_size,buf)
USE h5global
IMPLICIT NONE
!DEC$IF DEFINED(HDF5F90_WINDOWS)
!DEC$ATTRIBUTES C,reference,decorate,alias:'H5TBWRITE_FIELD_INDEX_ST_C'::h5tbwrite_field_index_st_c
!DEC$ENDIF
@ -1109,7 +1122,7 @@ SUBROUTINE h5tbread_field_index_f_int(loc_id,&
!
!This definition is needed for Windows DLLs
!DEC$if defined(BUILD_HDF5_DLL)
!DEC$if defined(BUILD_HDF5_HL_DLL)
!DEC$attributes dllexport ::h5tbread_field_index_f_int
!DEC$endif
!
@ -1129,6 +1142,7 @@ SUBROUTINE h5tbread_field_index_f_int(loc_id,&
start,nrecords,type_size,buf)
USE h5global
IMPLICIT NONE
!DEC$IF DEFINED(HDF5F90_WINDOWS)
!DEC$ATTRIBUTES C,reference,decorate,alias:'H5TBREAD_FIELD_INDEX_INT_C'::h5tbread_field_index_int_c
!DEC$ENDIF
@ -1180,7 +1194,7 @@ SUBROUTINE h5tbread_field_index_f_float(loc_id,&
!
!This definition is needed for Windows DLLs
!DEC$if defined(BUILD_HDF5_DLL)
!DEC$if defined(BUILD_HDF5_HL_DLL)
!DEC$attributes dllexport :: h5tbread_field_index_f_float
!DEC$endif
!
@ -1200,6 +1214,7 @@ SUBROUTINE h5tbread_field_index_f_float(loc_id,&
start,nrecords,type_size,buf)
USE h5global
IMPLICIT NONE
!DEC$IF DEFINED(HDF5F90_WINDOWS)
!DEC$ATTRIBUTES C,reference,decorate,alias:'H5TBREAD_FIELD_INDEX_FL_C'::h5tbread_field_index_fl_c
!DEC$ENDIF
@ -1251,7 +1266,7 @@ SUBROUTINE h5tbread_field_index_f_double(loc_id,&
!
!This definition is needed for Windows DLLs
!DEC$if defined(BUILD_HDF5_DLL)
!DEC$if defined(BUILD_HDF5_HL_DLL)
!DEC$attributes dllexport :: h5tbread_field_index_f_double
!DEC$endif
!
@ -1271,6 +1286,7 @@ SUBROUTINE h5tbread_field_index_f_double(loc_id,&
start,nrecords,type_size,buf)
USE h5global
IMPLICIT NONE
!DEC$IF DEFINED(HDF5F90_WINDOWS)
!DEC$ATTRIBUTES C,reference,decorate,alias:'H5TBREAD_FIELD_INDEX_DL_C'::h5tbread_field_index_dl_c
!DEC$ENDIF
@ -1322,7 +1338,7 @@ SUBROUTINE h5tbread_field_index_f_string(loc_id,&
!
!This definition is needed for Windows DLLs
!DEC$if defined(BUILD_HDF5_DLL)
!DEC$if defined(BUILD_HDF5_HL_DLL)
!DEC$attributes dllexport :: h5tbread_field_index_f_string
!DEC$endif
!
@ -1342,6 +1358,7 @@ SUBROUTINE h5tbread_field_index_f_string(loc_id,&
start,nrecords,type_size,buf)
USE h5global
IMPLICIT NONE
!DEC$IF DEFINED(HDF5F90_WINDOWS)
!DEC$ATTRIBUTES C,reference,decorate,alias:'H5TBREAD_FIELD_INDEX_ST_C'::h5tbread_field_index_st_c
!DEC$ENDIF
@ -1392,7 +1409,7 @@ SUBROUTINE h5tbinsert_field_f_int(loc_id,&
!
!This definition is needed for Windows DLLs
!DEC$if defined(BUILD_HDF5_DLL)
!DEC$if defined(BUILD_HDF5_HL_DLL)
!DEC$attributes dllexport :: h5tbinsert_field_f_int
!DEC$endif
!
@ -1413,6 +1430,7 @@ SUBROUTINE h5tbinsert_field_f_int(loc_id,&
field_type,field_index,buf)
USE h5global
IMPLICIT NONE
!DEC$IF DEFINED(HDF5F90_WINDOWS)
!DEC$ATTRIBUTES C,reference,decorate,alias:'H5TBINSERT_FIELD_INT_C'::h5tbinsert_field_int_c
!DEC$ENDIF
@ -1465,7 +1483,7 @@ SUBROUTINE h5tbinsert_field_f_float(loc_id,&
!
!This definition is needed for Windows DLLs
!DEC$if defined(BUILD_HDF5_DLL)
!DEC$if defined(BUILD_HDF5_HL_DLL)
!DEC$attributes dllexport :: h5tbinsert_field_f_float
!DEC$endif
!
@ -1486,6 +1504,7 @@ SUBROUTINE h5tbinsert_field_f_float(loc_id,&
field_type,field_index,buf)
USE h5global
IMPLICIT NONE
!DEC$IF DEFINED(HDF5F90_WINDOWS)
!DEC$ATTRIBUTES C,reference,decorate,alias:'H5TBINSERT_FIELD_FL_C'::h5tbinsert_field_fl_c
!DEC$ENDIF
@ -1538,7 +1557,7 @@ SUBROUTINE h5tbinsert_field_f_double(loc_id,&
!
!This definition is needed for Windows DLLs
!DEC$if defined(BUILD_HDF5_DLL)
!DEC$if defined(BUILD_HDF5_HL_DLL)
!DEC$attributes dllexport :: h5tbinsert_field_f_double
!DEC$endif
!
@ -1559,6 +1578,7 @@ SUBROUTINE h5tbinsert_field_f_double(loc_id,&
field_type,field_index,buf)
USE h5global
IMPLICIT NONE
!DEC$IF DEFINED(HDF5F90_WINDOWS)
!DEC$ATTRIBUTES C,reference,decorate,alias:'H5TBINSERT_FIELD_DL_C'::h5tbinsert_field_dl_c
!DEC$ENDIF
@ -1612,7 +1632,7 @@ SUBROUTINE h5tbinsert_field_f_string(loc_id,&
!
!This definition is needed for Windows DLLs
!DEC$if defined(BUILD_HDF5_DLL)
!DEC$if defined(BUILD_HDF5_HL_DLL)
!DEC$attributes dllexport :: h5tbinsert_field_f_string
!DEC$endif
!
@ -1633,6 +1653,7 @@ SUBROUTINE h5tbinsert_field_f_string(loc_id,&
field_type,field_index,buf)
USE h5global
IMPLICIT NONE
!DEC$IF DEFINED(HDF5F90_WINDOWS)
!DEC$ATTRIBUTES C,reference,decorate,alias:'H5TBINSERT_FIELD_ST_C'::h5tbinsert_field_st_c
!DEC$ENDIF
@ -1683,7 +1704,7 @@ SUBROUTINE h5tbdelete_field_f(loc_id,&
!
!This definition is needed for Windows DLLs
!DEC$if defined(BUILD_HDF5_DLL)
!DEC$if defined(BUILD_HDF5_HL_DLL)
!DEC$attributes dllexport :: h5tbdelete_field_f
!DEC$endif
!
@ -1700,6 +1721,7 @@ SUBROUTINE h5tbdelete_field_f(loc_id,&
INTEGER FUNCTION h5tbdelete_field_c(loc_id,namelen,dset_name,namelen1,field_name)
USE h5global
IMPLICIT NONE
!DEC$IF DEFINED(HDF5F90_WINDOWS)
!DEC$ATTRIBUTES C,reference,decorate,alias:'H5TBDELETE_FIELD_C'::h5tbdelete_field_c
!DEC$ENDIF
@ -1749,7 +1771,7 @@ SUBROUTINE h5tbget_table_info_f(loc_id,&
!
!This definition is needed for Windows DLLs
!DEC$if defined(BUILD_HDF5_DLL)
!DEC$if defined(BUILD_HDF5_HL_DLL)
!DEC$attributes dllexport :: h5tbget_table_info_f
!DEC$endif
!
@ -1764,6 +1786,7 @@ SUBROUTINE h5tbget_table_info_f(loc_id,&
INTERFACE
INTEGER FUNCTION h5tbget_table_info_c(loc_id,namelen,dset_name,nfields,nrecords)
USE h5global
IMPLICIT NONE
!DEC$IF DEFINED(HDF5F90_WINDOWS)
!DEC$ATTRIBUTES C,reference,decorate,alias:'H5TBGET_TABLE_INFO_C'::h5tbget_table_info_c
!DEC$ENDIF
@ -1813,7 +1836,7 @@ SUBROUTINE h5tbget_field_info_f(loc_id,&
IMPLICIT NONE
!
!This definition is needed for Windows DLLs
!DEC$if defined(BUILD_HDF5_DLL)
!DEC$if defined(BUILD_HDF5_HL_DLL)
!DEC$attributes dllexport :: h5tbget_field_info_f
!DEC$endif
!
@ -1837,6 +1860,7 @@ SUBROUTINE h5tbget_field_info_f(loc_id,&
field_sizes,field_offsets,type_size,namelen2, maxlen, field_names, c_maxlen_out)
USE h5global
IMPLICIT NONE
!DEC$IF DEFINED(HDF5F90_WINDOWS)
!DEC$ATTRIBUTES C,reference,decorate,alias:'H5TBGET_FIELD_INFO_C'::h5tbget_field_info_c
!DEC$ENDIF

View File

@ -1,4 +1,4 @@
cmake_minimum_required (VERSION 2.8.11)
cmake_minimum_required (VERSION 3.1.0)
PROJECT (HDF5_HL_FORTRAN_TESTS C CXX Fortran)
#-----------------------------------------------------------------------------

View File

@ -1,4 +1,4 @@
cmake_minimum_required (VERSION 2.8.11)
cmake_minimum_required (VERSION 3.1.0)
PROJECT (HDF5_HL_SRC)
#-----------------------------------------------------------------------------

View File

@ -21,7 +21,7 @@
#ifndef _HDF5_HL_H
#define _HDF5_HL_H
#include "hdf5.h" /* hdf5 main library */
#include "H5DOpublic.h" /* dataset optimization */
#include "H5DSpublic.h" /* dimension scales */
#include "H5LTpublic.h" /* lite */

View File

@ -1,4 +1,4 @@
cmake_minimum_required (VERSION 2.8.11)
cmake_minimum_required (VERSION 3.1.0)
PROJECT (HDF5_HL_TEST)
# --------------------------------------------------------------------
# Notes: When creating unit test executables they should be prefixed

View File

@ -18,7 +18,6 @@
*
*/
#include "hdf5.h"
#include "hdf5_hl.h"
#include <zlib.h>
#include <math.h>

View File

@ -1,4 +1,4 @@
cmake_minimum_required (VERSION 2.8.11)
cmake_minimum_required (VERSION 3.1.0)
PROJECT (HDF5_HL_TOOLS)
#-----------------------------------------------------------------------------

View File

@ -379,7 +379,7 @@ These five steps are described in detail below.
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_ENABLE_F2003 ON 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)
@ -552,7 +552,7 @@ HDF5_BUILD_FORTRAN "Build FORTRAN support" OFF
HDF5_BUILD_HL_LIB "Build HIGH Level HDF5 Library" OFF
HDF5_BUILD_TOOLS "Build HDF5 Tools" OFF
if (HDF5_BUILD_FORTRAN)
HDF5_ENABLE_F2003 "Enable FORTRAN 2003 Standard" OFF
HDF5_ENABLE_F2003 "Enable FORTRAN 2003 Standard" ON
---------------- HDF5 Advanced Options ---------------------
HDF5_DISABLE_COMPILER_WARNINGS "Disable compiler warnings" OFF
@ -632,7 +632,7 @@ platform configuration script.
# CTestScript.cmake file. Usage:
# "ctest -S HDF518LinuxCmake.cmake -C Release -O hdf518shared.log"
############################################################################
cmake_minimum_required(VERSION 2.8.10 FATAL_ERROR)
cmake_minimum_required(VERSION 3.1.0 FATAL_ERROR)
# this is the location of the source hardcoded to hdf5-1.8.13
set(CTEST_SOURCE_NAME hdf5-1.8.13)
@ -714,8 +714,8 @@ set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ALLOW_EXTERNAL_SUPPORT:STRING
#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DSZIP_LIBRARY:FILEPATH=some_location/lib/szlib.lib -DSZIP_INCLUDE_DIR:PATH=some_location/include")
#### fortran ####
### enable Fortran 2003
#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_F2003:BOOL=ON")
### disable Fortran 2003
#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_F2003:BOOL=OFF")
### disable Fortran
#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_FORTRAN:BOOL=OFF")

View File

@ -71,8 +71,7 @@ Preconditions:
http://hdfgroup.org/HDF5/doc_resource/SZIP/index.html.
The latest supported public release of SZIP is available from
ftp://ftp.hdfgroup.org/lib-external/szip/2.1. Binary distribution can be
found under ftp://ftp.hdfgroup.org/lib-external/szip/2.1/bin/cygwin
ftp://ftp.hdfgroup.org/lib-external/szip/2.1.
2.3 Additional Utilities

View File

@ -1,4 +1,4 @@
HDF5 version 1.9.213 currently under development
HDF5 version 1.9.215 currently under development
================================================================================
@ -1216,23 +1216,23 @@ Supported Platforms
(emu) Sun Fortran 95 8.6 SunOS_sparc
Sun C++ 5.12 SunOS_sparc
Windows 7 Visual Studio 2008 w/ Intel Fortran 14 (cmake)
Windows 7 Visual Studio 2008 (cmake)
Visual Studio 2010 w/ Intel Fortran 14 (cmake)
Visual Studio 2012 w/ Intel Fortran 14 (cmake)
Visual Studio 2013 w/ Intel Fortran 14 (cmake)
Cygwin(CYGWIN_NT-6.1 1.7.32(0.274/5/3) gcc(4.8.3) compiler and gfortran)
Visual Studio 2012 w/ Intel Fortran 15 (cmake)
Visual Studio 2013 w/ Intel Fortran 15 (cmake)
Cygwin(CYGWIN_NT-6.1 1.7.34(0.285/5/3) gcc(4.9.2) compiler and gfortran)
(cmake and autotools)
Windows 7 x64 Visual Studio 2008 w/ Intel Fortran 14 (cmake)
Windows 7 x64 Visual Studio 2008 (cmake)
Visual Studio 2010 w/ Intel Fortran 14 (cmake)
Visual Studio 2012 w/ Intel Fortran 14 (cmake)
Visual Studio 2013 w/ Intel Fortran 14 (cmake)
Visual Studio 2012 w/ Intel Fortran 15 (cmake)
Visual Studio 2013 w/ Intel Fortran 15 (cmake)
Windows 8.1 Visual Studio 2012 w/ Intel Fortran 14 (cmake)
Visual Studio 2013 w/ Intel Fortran 14 (cmake)
Windows 8.1 Visual Studio 2012 w/ Intel Fortran 15 (cmake)
Visual Studio 2013 w/ Intel Fortran 15 (cmake)
Windows 8.1 x64 Visual Studio 2012 w/ Intel Fortran 14 (cmake)
Visual Studio 2013 w/ Intel Fortran 14 (cmake)
Windows 8.1 x64 Visual Studio 2012 w/ Intel Fortran 15 (cmake)
Visual Studio 2013 w/ Intel Fortran 15 (cmake)
Mac OS X Lion 10.7.3 gcc i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 from Xcode 4.2.1
32- and 64-bit g++ i686-apple-darwin11-llvm-g++-4.2 (GCC) 4.2.1 from Xcode 4.2.1

View File

@ -179,7 +179,7 @@ Create a CMakeLists.txt file at the source root. Include the
following text in the file:
##########################################################
cmake_minimum_required (VERSION 2.8.12)
cmake_minimum_required (VERSION 3.1.0)
PROJECT (HDF5MyApp C CXX)
FIND_PACKAGE (HDF5 NAMES hdf5)
@ -232,7 +232,7 @@ ctest
# where hdf518Examples is the source folder relative to the location of these scripts
############################################################################
cmake_minimum_required(VERSION 2.8.12 FATAL_ERROR)
cmake_minimum_required(VERSION 3.1.0 FATAL_ERROR)
set(CTEST_DASHBOARD_ROOT ${CTEST_SCRIPT_DIRECTORY})
set(CTEST_SOURCE_NAME ${CTEST_SCRIPT_ARG})

View File

@ -1,4 +1,4 @@
cmake_minimum_required (VERSION 2.8.11)
cmake_minimum_required (VERSION 3.1.0)
PROJECT (HDF5_SRC C CXX)
#-----------------------------------------------------------------------------
@ -877,8 +877,8 @@ set_target_properties (${HDF5_LIB_TARGET} PROPERTIES
option (HDF5_ENABLE_DEBUG_APIS "Turn on debugging in all packages" OFF)
if (HDF5_ENABLE_DEBUG_APIS)
set_target_properties (${HDF5_LIB_TARGET} PROPERTIES
COMPILE_DEFINITIONS
"H5Z_DEBUG;H5VM_DEBUG;H5T_DEBUG;H5S_DEBUG;H5P_DEBUG;H5O_DEBUG;H5MM_DEBUG;H5MF_DEBUG;H5I_DEBUG;H5HL_DEBUG;H5HG_DEBUG;H5G_DEBUG;H5F_DEBUG;H5E_DEBUG;H5D_DEBUG;H5B_DEBUG;H5AC_DEBUG"
COMPILE_DEFINITIONS
"H5Z_DEBUG;H5VM_DEBUG;H5T_DEBUG;H5S_DEBUG;H5P_DEBUG;H5O_DEBUG;H5MM_DEBUG;H5MF_DEBUG;H5I_DEBUG;H5HL_DEBUG;H5HG_DEBUG;H5G_DEBUG;H5F_DEBUG;H5E_DEBUG;H5D_DEBUG;H5B_DEBUG;H5AC_DEBUG"
)
endif (HDF5_ENABLE_DEBUG_APIS)

147
src/H5B.c
View File

@ -510,22 +510,18 @@ H5B_split(H5F_t *f, hid_t dxpl_id, H5B_ins_ud_t *bt_ud, unsigned idx,
bt_ud->bt->nchildren = nleft;
/*
* Update sibling pointers.
* Update other sibling pointers.
*/
split_bt_ud->bt->left = bt_ud->addr;
split_bt_ud->bt->right = bt_ud->bt->right;
if(H5F_addr_defined(bt_ud->bt->right)) {
H5B_t *tmp_bt;
H5B_cache_ud_t cache_udata2; /* User-data for metadata cache callback */
H5B_t *tmp_bt;
cache_udata2.f = f;
cache_udata2.type = shared->type;
cache_udata2.rc_shared = bt_ud->bt->rc_shared;
if(NULL == (tmp_bt = (H5B_t *)H5AC_protect(f, dxpl_id, H5AC_BT, bt_ud->bt->right, &cache_udata2, H5AC_WRITE)))
HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to load right sibling")
if(NULL == (tmp_bt = (H5B_t *)H5AC_protect(f, dxpl_id, H5AC_BT, bt_ud->bt->right, &cache_udata, H5AC_WRITE)))
HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to load right sibling")
tmp_bt->left = split_bt_ud->addr;
tmp_bt->left = split_bt_ud->addr;
if(H5AC_unprotect(f, dxpl_id, H5AC_BT, bt_ud->bt->right, tmp_bt, H5AC__DIRTIED_FLAG) < 0)
HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree node")
@ -539,6 +535,7 @@ done:
HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree node")
split_bt_ud->bt = NULL;
split_bt_ud->addr = HADDR_UNDEF;
split_bt_ud->cache_flags = H5AC__NO_FLAGS_SET;
} /* end if */
FUNC_LEAVE_NOAPI(ret_value)
@ -559,8 +556,7 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
H5B_insert(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr,
void *udata)
H5B_insert(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr, void *udata)
{
/*
* These are defined this way to satisfy alignment constraints.
@ -609,6 +605,8 @@ H5B_insert(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr,
&lt_key_changed, md_key, udata, rt_key, &rt_key_changed,
&split_bt_ud/*out*/)) < 0)
HGOTO_ERROR(H5E_BTREE, H5E_CANTINIT, FAIL, "unable to insert key")
/* Check if the root node split */
if(H5B_INS_NOOP == my_ins) {
HDassert(!split_bt_ud.bt);
HGOTO_DONE(SUCCEED)
@ -633,7 +631,7 @@ H5B_insert(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr,
*/
H5_CHECK_OVERFLOW(shared->sizeof_rnode,size_t,hsize_t);
if(HADDR_UNDEF == (old_root_addr = H5MF_alloc(f, H5FD_MEM_BTREE, dxpl_id, (hsize_t)shared->sizeof_rnode)))
HGOTO_ERROR(H5E_BTREE, H5E_CANTALLOC, FAIL, "unable to allocate file space to move root")
HGOTO_ERROR(H5E_BTREE, H5E_CANTALLOC, FAIL, "unable to allocate file space to move root")
/*
* Move the node to the new location
@ -641,7 +639,7 @@ H5B_insert(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr,
/* Make a copy of the old root information */
if(NULL == (new_root_bt = H5B_copy(bt_ud.bt)))
HGOTO_ERROR(H5E_BTREE, H5E_CANTCOPY, FAIL, "unable to copy old root");
HGOTO_ERROR(H5E_BTREE, H5E_CANTCOPY, FAIL, "unable to copy old root")
/* Unprotect the old root so we can move it. Also force it to be marked
* dirty so it is written to the new location. */
@ -651,7 +649,7 @@ H5B_insert(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr,
/* Move the location of the old root on the disk */
if(H5AC_move_entry(f, H5AC_BT, bt_ud.addr, old_root_addr) < 0)
HGOTO_ERROR(H5E_BTREE, H5E_CANTSPLIT, FAIL, "unable to move B-tree root node")
HGOTO_ERROR(H5E_BTREE, H5E_CANTSPLIT, FAIL, "unable to move B-tree root node")
bt_ud.addr = old_root_addr;
/* Update the split b-tree's left pointer to point to the new location */
@ -769,7 +767,7 @@ H5B_insert_child(H5B_t *bt, unsigned *bt_flags, unsigned idx,
*bt_flags |= H5AC__DIRTIED_FLAG;
FUNC_LEAVE_NOAPI(SUCCEED)
}
} /* end H5B_insert_child() */
/*-------------------------------------------------------------------------
@ -1046,6 +1044,10 @@ H5B_insert_helper(H5F_t *f, hid_t dxpl_id, H5B_ins_ud_t *bt_ud,
else
HDmemcpy(rt_key, H5B_NKEY(bt, shared, idx + 1), type->sizeof_nkey);
} /* end if */
/*
* Handle changes/additions to children
*/
if(H5B_INS_CHANGE == my_ins) {
/*
* The insertion simply changed the address for the child.
@ -1081,7 +1083,7 @@ H5B_insert_helper(H5F_t *f, hid_t dxpl_id, H5B_ins_ud_t *bt_ud,
/* Insert the child */
if(H5B_insert_child(tmp_bt, tmp_bt_flags_ptr, idx, new_child_bt_ud.addr, my_ins, md_key) < 0)
HGOTO_ERROR(H5E_BTREE, H5E_CANTINSERT, H5B_INS_ERROR, "can't insert child")
}
} /* end else-if */
/*
* If this node split, return the mid key (the one that is shared
@ -1113,7 +1115,7 @@ done:
HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, H5B_INS_ERROR, "unable to unprotect new child")
FUNC_LEAVE_NOAPI(ret_value)
}
} /* end H5B_insert_helper() */
/*-------------------------------------------------------------------------
@ -1134,13 +1136,12 @@ static herr_t
H5B_iterate_helper(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr,
H5B_operator_t op, void *udata)
{
H5B_t *bt = NULL; /* Pointer to current B-tree node */
H5B_t *bt = NULL; /* Pointer to current B-tree node */
H5UC_t *rc_shared; /* Ref-counted shared info */
H5B_shared_t *shared; /* Pointer to shared B-tree info */
H5B_cache_ud_t cache_udata; /* User-data for metadata cache callback */
uint8_t *native = NULL; /* Array of keys in native format */
haddr_t *child = NULL; /* Array of child pointers */
herr_t ret_value; /* Return value */
unsigned u; /* Local index variable */
herr_t ret_value = H5_ITER_CONT; /* Return value */
FUNC_ENTER_NOAPI_NOINIT
@ -1155,7 +1156,7 @@ H5B_iterate_helper(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t add
/* Get shared info for B-tree */
if(NULL == (rc_shared = (type->get_shared)(f, udata)))
HGOTO_ERROR(H5E_BTREE, H5E_CANTGET, FAIL, "can't retrieve B-tree's shared ref. count object")
HGOTO_ERROR(H5E_BTREE, H5E_CANTGET, FAIL, "can't retrieve B-tree's shared ref. count object")
shared = (H5B_shared_t *)H5UC_GET_OBJ(rc_shared);
HDassert(shared);
@ -1164,99 +1165,21 @@ H5B_iterate_helper(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t add
cache_udata.type = type;
cache_udata.rc_shared = rc_shared;
if(NULL == (bt = (H5B_t *)H5AC_protect(f, dxpl_id, H5AC_BT, addr, &cache_udata, H5AC_READ)))
HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, H5_ITER_ERROR, "unable to load B-tree node")
HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, H5_ITER_ERROR, "unable to load B-tree node")
if(bt->level > 0) {
haddr_t left_child = bt->child[0]; /* Address of left-most child in node */
/* Release current node */
if(H5AC_unprotect(f, dxpl_id, H5AC_BT, addr, bt, H5AC__NO_FLAGS_SET) < 0)
HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, H5_ITER_ERROR, "unable to release B-tree node")
bt = NULL;
/* Keep following the left-most child until we reach a leaf node. */
if((ret_value = H5B_iterate_helper(f, dxpl_id, type, left_child, op, udata)) < 0)
HGOTO_ERROR(H5E_BTREE, H5E_CANTLIST, H5_ITER_ERROR, "unable to list B-tree node")
} /* end if */
else {
unsigned nchildren; /* Number of child pointers */
haddr_t next_addr; /* Address of next node to the right */
/* Allocate space for a copy of the native records & child pointers */
if(NULL == (native = H5FL_BLK_MALLOC(native_block, shared->sizeof_keys)))
HGOTO_ERROR(H5E_BTREE, H5E_CANTALLOC, H5_ITER_ERROR, "memory allocation failed for shared B-tree native records")
if(NULL == (child = H5FL_SEQ_MALLOC(haddr_t, (size_t)shared->two_k)))
HGOTO_ERROR(H5E_BTREE, H5E_CANTALLOC, H5_ITER_ERROR, "memory allocation failed for shared B-tree child addresses")
/* Cache information from this node */
nchildren = bt->nchildren;
next_addr = bt->right;
/* Copy the native keys & child pointers into local arrays */
HDmemcpy(native, bt->native, shared->sizeof_keys);
HDmemcpy(child, bt->child, (nchildren * sizeof(haddr_t)));
/* Release current node */
if(H5AC_unprotect(f, dxpl_id, H5AC_BT, addr, bt, H5AC__NO_FLAGS_SET) < 0)
HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, H5_ITER_ERROR, "unable to release B-tree node")
bt = NULL;
/*
* We've reached the left-most leaf. Now follow the right-sibling
* pointer from leaf to leaf until we've processed all leaves.
*/
ret_value = H5_ITER_CONT;
while(ret_value == H5_ITER_CONT) {
haddr_t *curr_child; /* Pointer to node's child addresses */
uint8_t *curr_native; /* Pointer to node's native keys */
unsigned u; /* Local index variable */
/*
* Perform the iteration operator, which might invoke an
* application callback.
*/
for(u = 0, curr_child = child, curr_native = native; u < nchildren && ret_value == H5_ITER_CONT; u++, curr_child++, curr_native += type->sizeof_nkey) {
ret_value = (*op)(f, dxpl_id, curr_native, *curr_child, curr_native + type->sizeof_nkey, udata);
if(ret_value < 0)
HERROR(H5E_BTREE, H5E_CANTLIST, "iterator function failed");
} /* end for */
/* Check for continuing iteration */
if(ret_value == H5_ITER_CONT) {
/* Check for another node */
if(H5F_addr_defined(next_addr)) {
/* Protect the next node to the right */
addr = next_addr;
if(NULL == (bt = (H5B_t *)H5AC_protect(f, dxpl_id, H5AC_BT, addr, &cache_udata, H5AC_READ)))
HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, H5_ITER_ERROR, "B-tree node")
/* Cache information from this node */
nchildren = bt->nchildren;
next_addr = bt->right;
/* Copy the native keys & child pointers into local arrays */
HDmemcpy(native, bt->native, shared->sizeof_keys);
HDmemcpy(child, bt->child, nchildren * sizeof(haddr_t));
/* Unprotect node */
if(H5AC_unprotect(f, dxpl_id, H5AC_BT, addr, bt, H5AC__NO_FLAGS_SET) < 0)
HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, H5_ITER_ERROR, "unable to release B-tree node")
bt = NULL;
} /* end if */
else
/* Exit loop */
break;
} /* end if */
} /* end while */
} /* end else */
/* Iterate over node's children */
for(u = 0; u < bt->nchildren && ret_value == H5_ITER_CONT; u++) {
if(bt->level > 0)
ret_value = H5B_iterate_helper(f, dxpl_id, type, bt->child[u], op, udata);
else
ret_value = (*op)(f, dxpl_id, H5B_NKEY(bt, shared, u), bt->child[u], H5B_NKEY(bt, shared, u + 1), udata);
if(ret_value < 0)
HERROR(H5E_BTREE, H5E_BADITER, "B-tree iteration failed");
} /* end for */
done:
if(bt && H5AC_unprotect(f, dxpl_id, H5AC_BT, addr, bt, H5AC__NO_FLAGS_SET) < 0)
HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, H5_ITER_ERROR, "unable to release B-tree node")
if(native)
native = H5FL_BLK_FREE(native_block, native);
if(child)
child = H5FL_SEQ_FREE(haddr_t, child);
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5B_iterate_helper() */
@ -1715,7 +1638,7 @@ H5B_delete(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr, void
/* Get shared info for B-tree */
if(NULL == (rc_shared = (type->get_shared)(f, udata)))
HGOTO_ERROR(H5E_BTREE, H5E_CANTGET, FAIL, "can't retrieve B-tree's shared ref. count object")
HGOTO_ERROR(H5E_BTREE, H5E_CANTGET, FAIL, "can't retrieve B-tree's shared ref. count object")
shared = (H5B_shared_t *)H5UC_GET_OBJ(rc_shared);
HDassert(shared);
@ -1724,7 +1647,7 @@ H5B_delete(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr, void
cache_udata.type = type;
cache_udata.rc_shared = rc_shared;
if(NULL == (bt = (H5B_t *)H5AC_protect(f, dxpl_id, H5AC_BT, addr, &cache_udata, H5AC_WRITE)))
HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to load B-tree node")
HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to load B-tree node")
/* Iterate over all children in tree, deleting them */
if(bt->level > 0) {

View File

@ -128,11 +128,11 @@ H5FL_DEFINE_STATIC(H5B2_t);
H5B2_t *
H5B2_create(H5F_t *f, hid_t dxpl_id, const H5B2_create_t *cparam, void *ctx_udata)
{
H5B2_t *bt2 = NULL; /* Pointer to the B-tree */
H5B2_hdr_t *hdr = NULL; /* Pointer to the B-tree header */
H5B2_t *bt2 = NULL; /* Pointer to the B-tree */
H5B2_hdr_t *hdr = NULL; /* Pointer to the B-tree header */
H5B2_hdr_cache_ud_t cache_udata; /* User-data for callback */
haddr_t hdr_addr; /* B-tree header address */
H5B2_t *ret_value; /* Return value */
H5B2_t *ret_value; /* Return value */
FUNC_ENTER_NOAPI(NULL)
@ -147,7 +147,7 @@ H5B2_create(H5F_t *f, hid_t dxpl_id, const H5B2_create_t *cparam, void *ctx_udat
/* Create shared v2 B-tree header */
if(HADDR_UNDEF == (hdr_addr = H5B2_hdr_create(f, dxpl_id, cparam, ctx_udata)))
HGOTO_ERROR(H5E_BTREE, H5E_CANTINIT, NULL, "can't create v2 B-tree header")
HGOTO_ERROR(H5E_BTREE, H5E_CANTINIT, NULL, "can't create v2 B-tree header")
/* Create v2 B-tree wrapper */
if(NULL == (bt2 = H5FL_MALLOC(H5B2_t)))
@ -157,7 +157,7 @@ H5B2_create(H5F_t *f, hid_t dxpl_id, const H5B2_create_t *cparam, void *ctx_udat
cache_udata.f = f;
cache_udata.ctx_udata = ctx_udata;
if(NULL == (hdr = (H5B2_hdr_t *)H5AC_protect(f, dxpl_id, H5AC_BT2_HDR, hdr_addr, &cache_udata, H5AC_WRITE)))
HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, NULL, "unable to load B-tree header")
HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, NULL, "unable to load B-tree header")
/* Point v2 B-tree wrapper at header and bump it's ref count */
bt2->hdr = hdr;
@ -166,7 +166,7 @@ H5B2_create(H5F_t *f, hid_t dxpl_id, const H5B2_create_t *cparam, void *ctx_udat
/* Increment # of files using this v2 B-tree header */
if(H5B2_hdr_fuse_incr(bt2->hdr) < 0)
HGOTO_ERROR(H5E_BTREE, H5E_CANTINC, NULL, "can't increment file reference count on shared v2 B-tree header")
HGOTO_ERROR(H5E_BTREE, H5E_CANTINC, NULL, "can't increment file reference count on shared v2 B-tree header")
/* Set file pointer for this v2 B-tree open context */
bt2->f = f;
@ -299,11 +299,11 @@ H5B2_insert(H5B2_t *bt2, hid_t dxpl_id, void *udata)
/* Attempt to insert record into B-tree */
if(hdr->depth > 0) {
if(H5B2_insert_internal(hdr, dxpl_id, hdr->depth, NULL, &hdr->root, udata) < 0)
if(H5B2_insert_internal(hdr, dxpl_id, hdr->depth, NULL, &hdr->root, H5B2_POS_ROOT, udata) < 0)
HGOTO_ERROR(H5E_BTREE, H5E_CANTINSERT, FAIL, "unable to insert record into B-tree internal node")
} /* end if */
else {
if(H5B2_insert_leaf(hdr, dxpl_id, &hdr->root, udata) < 0)
if(H5B2_insert_leaf(hdr, dxpl_id, &hdr->root, H5B2_POS_ROOT, udata) < 0)
HGOTO_ERROR(H5E_BTREE, H5E_CANTINSERT, FAIL, "unable to insert record into B-tree leaf node")
} /* end else */
@ -420,12 +420,13 @@ htri_t
H5B2_find(H5B2_t *bt2, hid_t dxpl_id, void *udata, H5B2_found_t op,
void *op_data)
{
H5B2_hdr_t *hdr; /* Pointer to the B-tree header */
H5B2_hdr_t *hdr; /* Pointer to the B-tree header */
H5B2_node_ptr_t curr_node_ptr; /* Node pointer info for current node */
unsigned depth; /* Current depth of the tree */
int cmp; /* Comparison value of records */
unsigned idx; /* Location of record which matches key */
htri_t ret_value = TRUE; /* Return value */
H5B2_nodepos_t curr_pos; /* Position of the current node */
htri_t ret_value = TRUE; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
@ -441,16 +442,39 @@ H5B2_find(H5B2_t *bt2, hid_t dxpl_id, void *udata, H5B2_found_t op,
/* Make copy of the root node pointer to start search with */
curr_node_ptr = hdr->root;
/* Current depth of the tree */
depth = hdr->depth;
/* Check for empty tree */
if(curr_node_ptr.node_nrec == 0)
HGOTO_DONE(FALSE)
/* Check record against min & max records in tree, to attempt to quickly
* find candidates or avoid further searching.
*/
if(hdr->min_native_rec != NULL) {
if((cmp = (hdr->cls->compare)(udata, hdr->min_native_rec)) < 0)
HGOTO_DONE(FALSE) /* Less than the least record--not found */
else if(cmp == 0) { /* Record is found */
if(op && (op)(hdr->min_native_rec, op_data) < 0)
HGOTO_ERROR(H5E_BTREE, H5E_NOTFOUND, FAIL, "'found' callback failed for B-tree find operation")
HGOTO_DONE(TRUE)
} /* end if */
} /* end if */
if(hdr->max_native_rec != NULL) {
if((cmp = (hdr->cls->compare)(udata, hdr->max_native_rec)) > 0)
HGOTO_DONE(FALSE) /* Greater than the greatest record--not found */
else if(cmp == 0) { /* Record is found */
if(op && (op)(hdr->max_native_rec, op_data) < 0)
HGOTO_ERROR(H5E_BTREE, H5E_NOTFOUND, FAIL, "'found' callback failed for B-tree find operation")
HGOTO_DONE(TRUE)
} /* end if */
} /* end if */
/* Current depth of the tree */
depth = hdr->depth;
/* Walk down B-tree to find record or leaf node where record is located */
cmp = -1;
while(depth > 0 && cmp != 0) {
curr_pos = H5B2_POS_ROOT;
while(depth > 0) {
H5B2_internal_t *internal; /* Pointer to internal node in B-tree */
H5B2_node_ptr_t next_node_ptr; /* Node pointer info for next node */
@ -467,6 +491,24 @@ H5B2_find(H5B2_t *bt2, hid_t dxpl_id, void *udata, H5B2_found_t op,
/* Get node pointer for next node to search */
next_node_ptr=internal->node_ptrs[idx];
/* Set the position of the next node */
if(H5B2_POS_MIDDLE != curr_pos) {
if(idx == 0) {
if(H5B2_POS_LEFT == curr_pos || H5B2_POS_ROOT == curr_pos)
curr_pos = H5B2_POS_LEFT;
else
curr_pos = H5B2_POS_MIDDLE;
} /* end if */
else if(idx == internal->nrec) {
if(H5B2_POS_RIGHT == curr_pos || H5B2_POS_ROOT == curr_pos)
curr_pos = H5B2_POS_RIGHT;
else
curr_pos = H5B2_POS_MIDDLE;
} /* end if */
else
curr_pos = H5B2_POS_MIDDLE;
} /* end if */
/* Unlock current node */
if(H5AC_unprotect(hdr->f, dxpl_id, H5AC_BT2_INT, curr_node_ptr.addr, internal, H5AC__NO_FLAGS_SET) < 0)
HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree node")
@ -523,6 +565,27 @@ H5B2_find(H5B2_t *bt2, hid_t dxpl_id, void *udata, H5B2_found_t op,
HGOTO_ERROR(H5E_BTREE, H5E_NOTFOUND, FAIL, "'found' callback failed for B-tree find operation")
} /* end if */
/* Check for record being the min or max for the tree */
/* (Don't use 'else' for the idx check, to allow for root leaf node) */
if(H5B2_POS_MIDDLE != curr_pos) {
if(idx == 0) {
if(H5B2_POS_LEFT == curr_pos || H5B2_POS_ROOT == curr_pos) {
if(hdr->min_native_rec == NULL)
if(NULL == (hdr->min_native_rec = (uint8_t *)HDmalloc(hdr->cls->nrec_size)))
HGOTO_ERROR(H5E_BTREE, H5E_CANTALLOC, FAIL, "memory allocation failed for v2 B-tree min record info")
HDmemcpy(hdr->min_native_rec, H5B2_LEAF_NREC(leaf, hdr, idx), hdr->cls->nrec_size);
} /* end if */
} /* end if */
if(idx == (unsigned)(leaf->nrec - 1)) {
if(H5B2_POS_RIGHT == curr_pos || H5B2_POS_ROOT == curr_pos) {
if(hdr->max_native_rec == NULL)
if(NULL == (hdr->max_native_rec = (uint8_t *)HDmalloc(hdr->cls->nrec_size)))
HGOTO_ERROR(H5E_BTREE, H5E_CANTALLOC, FAIL, "memory allocation failed for v2 B-tree max record info")
HDmemcpy(hdr->max_native_rec, H5B2_LEAF_NREC(leaf, hdr, idx), hdr->cls->nrec_size);
} /* end if */
} /* end if */
} /* end if */
} /* end else */
/* Unlock current node */
@ -577,9 +640,6 @@ H5B2_index(H5B2_t *bt2, hid_t dxpl_id, H5_iter_order_t order, hsize_t idx,
/* Make copy of the root node pointer to start search with */
curr_node_ptr = hdr->root;
/* Current depth of the tree */
depth = hdr->depth;
/* Check for empty tree */
if(curr_node_ptr.node_nrec == 0)
HGOTO_ERROR(H5E_BTREE, H5E_NOTFOUND, FAIL, "B-tree has no records")
@ -588,6 +648,9 @@ H5B2_index(H5B2_t *bt2, hid_t dxpl_id, H5_iter_order_t order, hsize_t idx,
if(idx >= curr_node_ptr.all_nrec)
HGOTO_ERROR(H5E_BTREE, H5E_NOTFOUND, FAIL, "B-tree doesn't have that many records")
/* Current depth of the tree */
depth = hdr->depth;
/* Check for reverse indexing and map requested index to appropriate forward index */
if(order == H5_ITER_DEC)
idx = curr_node_ptr.all_nrec - (idx + 1);
@ -736,7 +799,7 @@ H5B2_remove(H5B2_t *bt2, hid_t dxpl_id, void *udata, H5B2_remove_t op,
hbool_t depth_decreased = FALSE; /* Flag to indicate whether the depth of the B-tree decreased */
if(H5B2_remove_internal(hdr, dxpl_id, &depth_decreased, NULL, hdr->depth,
&(hdr->cache_info), NULL, &hdr->root, udata, op, op_data) < 0)
&(hdr->cache_info), NULL, H5B2_POS_ROOT, &hdr->root, udata, op, op_data) < 0)
HGOTO_ERROR(H5E_BTREE, H5E_CANTDELETE, FAIL, "unable to remove record from B-tree internal node")
/* Check for decreasing the depth of the B-tree */
@ -754,7 +817,7 @@ H5B2_remove(H5B2_t *bt2, hid_t dxpl_id, void *udata, H5B2_remove_t op,
} /* end for */
} /* end if */
else {
if(H5B2_remove_leaf(hdr, dxpl_id, &hdr->root, udata, op, op_data) < 0)
if(H5B2_remove_leaf(hdr, dxpl_id, &hdr->root, H5B2_POS_ROOT, udata, op, op_data) < 0)
HGOTO_ERROR(H5E_BTREE, H5E_CANTDELETE, FAIL, "unable to remove record from B-tree leaf node")
} /* end else */
@ -818,7 +881,7 @@ H5B2_remove_by_idx(H5B2_t *bt2, hid_t dxpl_id, H5_iter_order_t order,
hbool_t depth_decreased = FALSE; /* Flag to indicate whether the depth of the B-tree decreased */
if(H5B2_remove_internal_by_idx(hdr, dxpl_id, &depth_decreased, NULL, hdr->depth,
&(hdr->cache_info), NULL, &hdr->root, idx, op, op_data) < 0)
&(hdr->cache_info), NULL, &hdr->root, H5B2_POS_ROOT, idx, op, op_data) < 0)
HGOTO_ERROR(H5E_BTREE, H5E_CANTDELETE, FAIL, "unable to remove record from B-tree internal node")
/* Check for decreasing the depth of the B-tree */
@ -836,7 +899,7 @@ H5B2_remove_by_idx(H5B2_t *bt2, hid_t dxpl_id, H5_iter_order_t order,
} /* end for */
} /* end if */
else {
if(H5B2_remove_leaf_by_idx(hdr, dxpl_id, &hdr->root, (unsigned)idx, op, op_data) < 0)
if(H5B2_remove_leaf_by_idx(hdr, dxpl_id, &hdr->root, H5B2_POS_ROOT, (unsigned)idx, op, op_data) < 0)
HGOTO_ERROR(H5E_BTREE, H5E_CANTDELETE, FAIL, "unable to remove record from B-tree leaf node")
} /* end else */
@ -970,6 +1033,7 @@ H5B2_modify(H5B2_t *bt2, hid_t dxpl_id, void *udata, H5B2_modify_t op,
{
H5B2_hdr_t *hdr; /* Pointer to the B-tree header */
H5B2_node_ptr_t curr_node_ptr; /* Node pointer info for current node */
H5B2_nodepos_t curr_pos; /* Position of current node */
unsigned depth; /* Current depth of the tree */
int cmp; /* Comparison value of records */
unsigned idx; /* Location of record which matches key */
@ -990,16 +1054,17 @@ H5B2_modify(H5B2_t *bt2, hid_t dxpl_id, void *udata, H5B2_modify_t op,
/* Make copy of the root node pointer to start search with */
curr_node_ptr = hdr->root;
/* Current depth of the tree */
depth = hdr->depth;
/* Check for empty tree */
if(0 == curr_node_ptr.node_nrec)
HGOTO_ERROR(H5E_BTREE, H5E_NOTFOUND, FAIL, "B-tree has no records")
/* Current depth of the tree */
depth = hdr->depth;
/* Walk down B-tree to find record or leaf node where record is located */
cmp = -1;
while(depth > 0 && cmp != 0) {
curr_pos = H5B2_POS_ROOT;
while(depth > 0) {
unsigned internal_flags = H5AC__NO_FLAGS_SET;
H5B2_internal_t *internal; /* Pointer to internal node in B-tree */
H5B2_node_ptr_t next_node_ptr; /* Node pointer info for next node */
@ -1017,6 +1082,24 @@ H5B2_modify(H5B2_t *bt2, hid_t dxpl_id, void *udata, H5B2_modify_t op,
/* Get node pointer for next node to search */
next_node_ptr = internal->node_ptrs[idx];
/* Set the position of the next node */
if(H5B2_POS_MIDDLE != curr_pos) {
if(idx == 0) {
if(H5B2_POS_LEFT == curr_pos || H5B2_POS_ROOT == curr_pos)
curr_pos = H5B2_POS_LEFT;
else
curr_pos = H5B2_POS_MIDDLE;
} /* end if */
else if(idx == internal->nrec) {
if(H5B2_POS_RIGHT == curr_pos || H5B2_POS_ROOT == curr_pos)
curr_pos = H5B2_POS_RIGHT;
else
curr_pos = H5B2_POS_MIDDLE;
} /* end if */
else
curr_pos = H5B2_POS_MIDDLE;
} /* end if */
/* Unlock current node */
if(H5AC_unprotect(hdr->f, dxpl_id, H5AC_BT2_INT, curr_node_ptr.addr, internal, H5AC__NO_FLAGS_SET) < 0)
HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree node")
@ -1092,6 +1175,27 @@ H5B2_modify(H5B2_t *bt2, hid_t dxpl_id, void *udata, H5B2_modify_t op,
HGOTO_ERROR(H5E_BTREE, H5E_CANTMODIFY, FAIL, "'modify' callback failed for B-tree find operation")
} /* end if */
/* Check for modified record being the min or max for the tree */
/* (Don't use 'else' for the idx check, to allow for root leaf node) */
if(H5B2_POS_MIDDLE != curr_pos) {
if(idx == 0) {
if(H5B2_POS_LEFT == curr_pos || H5B2_POS_ROOT == curr_pos) {
if(hdr->min_native_rec == NULL)
if(NULL == (hdr->min_native_rec = (uint8_t *)HDmalloc(hdr->cls->nrec_size)))
HGOTO_ERROR(H5E_BTREE, H5E_CANTALLOC, FAIL, "memory allocation failed for v2 B-tree min record info")
HDmemcpy(hdr->min_native_rec, H5B2_LEAF_NREC(leaf, hdr, idx), hdr->cls->nrec_size);
} /* end if */
} /* end if */
if(idx == (unsigned)(leaf->nrec - 1)) {
if(H5B2_POS_RIGHT == curr_pos || H5B2_POS_ROOT == curr_pos) {
if(hdr->max_native_rec == NULL)
if(NULL == (hdr->max_native_rec = (uint8_t *)HDmalloc(hdr->cls->nrec_size)))
HGOTO_ERROR(H5E_BTREE, H5E_CANTALLOC, FAIL, "memory allocation failed for v2 B-tree max record info")
HDmemcpy(hdr->max_native_rec, H5B2_LEAF_NREC(leaf, hdr, idx), hdr->cls->nrec_size);
} /* end if */
} /* end if */
} /* end if */
} /* end else */
/* Mark the node as dirty if it changed */

View File

@ -15,11 +15,11 @@
/*-------------------------------------------------------------------------
*
* Created: H5B2cache.c
* Jan 31 2005
* Quincey Koziol <koziol@ncsa.uiuc.edu>
* Created: H5B2cache.c
* Jan 31 2005
* Quincey Koziol <koziol@hdfgroup.org>
*
* Purpose: Implement v2 B-tree metadata cache methods.
* Purpose: Implement v2 B-tree metadata cache methods.
*
*-------------------------------------------------------------------------
*/
@ -174,7 +174,7 @@ H5B2__cache_hdr_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata)
/* Allocate new B-tree header and reset cache info */
if(NULL == (hdr = H5B2_hdr_alloc(udata->f)))
HGOTO_ERROR(H5E_BTREE, H5E_CANTALLOC, NULL, "allocation failed for B-tree header")
HGOTO_ERROR(H5E_BTREE, H5E_CANTALLOC, NULL, "allocation failed for B-tree header")
/* Wrap the local buffer for serialized header info */
if(NULL == (wb = H5WB_wrap(hdr_buf, sizeof(hdr_buf))))
@ -186,7 +186,7 @@ H5B2__cache_hdr_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata)
/* Read header from disk */
if(H5F_block_read(f, H5FD_MEM_BTREE, addr, hdr->hdr_size, dxpl_id, buf) < 0)
HGOTO_ERROR(H5E_BTREE, H5E_READERROR, NULL, "can't read B-tree header")
HGOTO_ERROR(H5E_BTREE, H5E_READERROR, NULL, "can't read B-tree header")
/* Get temporary pointer to serialized header */
p = buf;
@ -203,7 +203,7 @@ H5B2__cache_hdr_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata)
/* B-tree class */
id = (H5B2_subid_t)*p++;
if(id >= H5B2_NUM_BTREE_ID)
HGOTO_ERROR(H5E_BTREE, H5E_BADTYPE, NULL, "incorrect B-tree type")
HGOTO_ERROR(H5E_BTREE, H5E_BADTYPE, NULL, "incorrect B-tree type")
/* Node size (in bytes) */
UINT32DECODE(p, cparam.node_size);
@ -234,12 +234,12 @@ H5B2__cache_hdr_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata)
/* Verify checksum */
if(stored_chksum != computed_chksum)
HGOTO_ERROR(H5E_BTREE, H5E_BADVALUE, NULL, "incorrect metadata checksum for v2 B-tree header")
HGOTO_ERROR(H5E_BTREE, H5E_BADVALUE, NULL, "incorrect metadata checksum for v2 B-tree header")
/* Initialize B-tree header info */
cparam.cls = H5B2_client_class_g[id];
if(H5B2_hdr_init(hdr, &cparam, udata->ctx_udata, depth) < 0)
HGOTO_ERROR(H5E_BTREE, H5E_CANTINIT, NULL, "can't initialize B-tree header info")
HGOTO_ERROR(H5E_BTREE, H5E_CANTINIT, NULL, "can't initialize B-tree header info")
/* Set the B-tree header's address */
hdr->addr = addr;
@ -342,17 +342,17 @@ H5B2__cache_hdr_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr,
/* Metadata checksum */
UINT32ENCODE(p, metadata_chksum);
/* Write the B-tree header. */
/* Write the B-tree header. */
HDassert((size_t)(p - buf) == hdr->hdr_size);
if(H5F_block_write(f, H5FD_MEM_BTREE, addr, hdr->hdr_size, dxpl_id, buf) < 0)
HGOTO_ERROR(H5E_BTREE, H5E_CANTFLUSH, FAIL, "unable to save B-tree header to disk")
if(H5F_block_write(f, H5FD_MEM_BTREE, addr, hdr->hdr_size, dxpl_id, buf) < 0)
HGOTO_ERROR(H5E_BTREE, H5E_CANTFLUSH, FAIL, "unable to save B-tree header to disk")
hdr->cache_info.is_dirty = FALSE;
hdr->cache_info.is_dirty = FALSE;
} /* end if */
if(destroy)
if(H5B2__cache_hdr_dest(f, hdr) < 0)
HGOTO_ERROR(H5E_BTREE, H5E_CANTFREE, FAIL, "unable to destroy B-tree header")
HGOTO_ERROR(H5E_BTREE, H5E_CANTFREE, FAIL, "unable to destroy B-tree header")
done:
/* Release resources */
@ -445,17 +445,17 @@ done:
/*-------------------------------------------------------------------------
* Function: H5B2__cache_hdr_size
* Function: H5B2__cache_hdr_size
*
* Purpose: Compute the size in bytes of a B-tree header
* on disk, and return it in *size_ptr. On failure,
* the value of *size_ptr is undefined.
* Purpose: Compute the size in bytes of a B-tree header
* on disk, and return it in *size_ptr. On failure,
* the value of *size_ptr is undefined.
*
* Return: Non-negative on success/Negative on failure
* Return: SUCCEED (Can't fail)
*
* Programmer: Quincey Koziol
* koziol@ncsa.uiuc.edu
* Feb 1 2005
* Programmer: Quincey Koziol
* koziol@hdfgroup.org
* Feb 1 2005
*
*-------------------------------------------------------------------------
*/
@ -466,6 +466,7 @@ H5B2__cache_hdr_size(const H5F_t UNUSED *f, const H5B2_hdr_t *hdr, size_t *size_
/* check arguments */
HDassert(f);
HDassert(hdr);
HDassert(size_ptr);
/* Set size value */
@ -519,14 +520,14 @@ H5B2__cache_internal_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata)
/* Increment ref. count on B-tree header */
if(H5B2_hdr_incr(udata->hdr) < 0)
HGOTO_ERROR(H5E_BTREE, H5E_CANTINC, NULL, "can't increment ref. count on B-tree header")
HGOTO_ERROR(H5E_BTREE, H5E_CANTINC, NULL, "can't increment ref. count on B-tree header")
/* Share B-tree information */
internal->hdr = udata->hdr;
/* Read header from disk */
if(H5F_block_read(f, H5FD_MEM_BTREE, addr, udata->hdr->node_size, dxpl_id, udata->hdr->page) < 0)
HGOTO_ERROR(H5E_BTREE, H5E_READERROR, NULL, "can't read B-tree internal node")
HGOTO_ERROR(H5E_BTREE, H5E_READERROR, NULL, "can't read B-tree internal node")
p = udata->hdr->page;
@ -541,7 +542,7 @@ H5B2__cache_internal_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata)
/* B-tree type */
if(*p++ != (uint8_t)udata->hdr->cls->id)
HGOTO_ERROR(H5E_BTREE, H5E_BADTYPE, NULL, "incorrect B-tree type")
HGOTO_ERROR(H5E_BTREE, H5E_BADTYPE, NULL, "incorrect B-tree type")
/* Allocate space for the native keys in memory */
if(NULL == (internal->int_native = (uint8_t *)H5FL_FAC_MALLOC(udata->hdr->node_info[udata->depth].nat_rec_fac)))
@ -593,7 +594,7 @@ H5B2__cache_internal_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata)
/* Verify checksum */
if(stored_chksum != computed_chksum)
HGOTO_ERROR(H5E_BTREE, H5E_BADVALUE, NULL, "incorrect metadata checksum for v2 internal node")
HGOTO_ERROR(H5E_BTREE, H5E_BADVALUE, NULL, "incorrect metadata checksum for v2 internal node")
/* Set return value */
ret_value = internal;
@ -853,7 +854,7 @@ H5B2__cache_leaf_load(H5F_t UNUSED *f, hid_t dxpl_id, haddr_t addr, void *_udata
/* Allocate new leaf node and reset cache info */
if(NULL == (leaf = H5FL_MALLOC(H5B2_leaf_t)))
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed")
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed")
HDmemset(&leaf->cache_info, 0, sizeof(H5AC_info_t));
/* Set the B-tree header's file context for this operation */
@ -861,33 +862,33 @@ H5B2__cache_leaf_load(H5F_t UNUSED *f, hid_t dxpl_id, haddr_t addr, void *_udata
/* Increment ref. count on B-tree header */
if(H5B2_hdr_incr(udata->hdr) < 0)
HGOTO_ERROR(H5E_BTREE, H5E_CANTINC, NULL, "can't increment ref. count on B-tree header")
HGOTO_ERROR(H5E_BTREE, H5E_CANTINC, NULL, "can't increment ref. count on B-tree header")
/* Share B-tree header information */
leaf->hdr = udata->hdr;
/* Read header from disk */
if(H5F_block_read(udata->f, H5FD_MEM_BTREE, addr, udata->hdr->node_size, dxpl_id, udata->hdr->page) < 0)
HGOTO_ERROR(H5E_BTREE, H5E_READERROR, NULL, "can't read B-tree leaf node")
HGOTO_ERROR(H5E_BTREE, H5E_READERROR, NULL, "can't read B-tree leaf node")
p = udata->hdr->page;
/* Magic number */
if(HDmemcmp(p, H5B2_LEAF_MAGIC, (size_t)H5_SIZEOF_MAGIC))
HGOTO_ERROR(H5E_BTREE, H5E_CANTLOAD, NULL, "wrong B-tree leaf node signature")
HGOTO_ERROR(H5E_BTREE, H5E_CANTLOAD, NULL, "wrong B-tree leaf node signature")
p += H5_SIZEOF_MAGIC;
/* Version */
if(*p++ != H5B2_LEAF_VERSION)
HGOTO_ERROR(H5E_BTREE, H5E_CANTLOAD, NULL, "wrong B-tree leaf node version")
HGOTO_ERROR(H5E_BTREE, H5E_CANTLOAD, NULL, "wrong B-tree leaf node version")
/* B-tree type */
if(*p++ != (uint8_t)udata->hdr->cls->id)
HGOTO_ERROR(H5E_BTREE, H5E_BADTYPE, NULL, "incorrect B-tree type")
HGOTO_ERROR(H5E_BTREE, H5E_BADTYPE, NULL, "incorrect B-tree type")
/* Allocate space for the native keys in memory */
if(NULL == (leaf->leaf_native = (uint8_t *)H5FL_FAC_MALLOC(udata->hdr->node_info[0].nat_rec_fac)))
HGOTO_ERROR(H5E_BTREE, H5E_NOSPACE, NULL, "memory allocation failed for B-tree leaf native keys")
HGOTO_ERROR(H5E_BTREE, H5E_NOSPACE, NULL, "memory allocation failed for B-tree leaf native keys")
/* Set the number of records in the leaf */
leaf->nrec = udata->nrec;

View File

@ -166,7 +166,7 @@ HDmemset(hdr->page, 0, hdr->node_size);
hdr->node_info[0].cum_max_nrec = hdr->node_info[0].max_nrec;
hdr->node_info[0].cum_max_nrec_size = 0;
if(NULL == (hdr->node_info[0].nat_rec_fac = H5FL_fac_init(hdr->cls->nrec_size * hdr->node_info[0].max_nrec)))
HGOTO_ERROR(H5E_BTREE, H5E_CANTINIT, FAIL, "can't create node native key block factory")
HGOTO_ERROR(H5E_BTREE, H5E_CANTINIT, FAIL, "can't create node native key block factory")
hdr->node_info[0].node_ptr_fac = NULL;
/* Allocate array of pointers to internal node native keys */
@ -250,7 +250,7 @@ H5B2_hdr_alloc(H5F_t *f)
/* Allocate space for the shared information */
if(NULL == (hdr = H5FL_CALLOC(H5B2_hdr_t)))
HGOTO_ERROR(H5E_BTREE, H5E_CANTALLOC, NULL, "memory allocation failed for B-tree header")
HGOTO_ERROR(H5E_BTREE, H5E_CANTALLOC, NULL, "memory allocation failed for B-tree header")
/* Assign non-zero information */
hdr->f = f;
@ -298,19 +298,19 @@ H5B2_hdr_create(H5F_t *f, hid_t dxpl_id, const H5B2_create_t *cparam,
/* Allocate v2 B-tree header */
if(NULL == (hdr = H5B2_hdr_alloc(f)))
HGOTO_ERROR(H5E_BTREE, H5E_CANTALLOC, HADDR_UNDEF, "allocation failed for B-tree header")
HGOTO_ERROR(H5E_BTREE, H5E_CANTALLOC, HADDR_UNDEF, "allocation failed for B-tree header")
/* Initialize shared B-tree info */
if(H5B2_hdr_init(hdr, cparam, ctx_udata, (uint16_t)0) < 0)
HGOTO_ERROR(H5E_BTREE, H5E_CANTINIT, HADDR_UNDEF, "can't create shared B-tree info")
HGOTO_ERROR(H5E_BTREE, H5E_CANTINIT, HADDR_UNDEF, "can't create shared B-tree info")
/* Allocate space for the header on disk */
if(HADDR_UNDEF == (hdr->addr = H5MF_alloc(f, H5FD_MEM_BTREE, dxpl_id, (hsize_t)hdr->hdr_size)))
HGOTO_ERROR(H5E_BTREE, H5E_CANTALLOC, HADDR_UNDEF, "file allocation failed for B-tree header")
HGOTO_ERROR(H5E_BTREE, H5E_CANTALLOC, HADDR_UNDEF, "file allocation failed for B-tree header")
/* Cache the new B-tree node */
if(H5AC_insert_entry(f, dxpl_id, H5AC_BT2_HDR, hdr->addr, hdr, H5AC__NO_FLAGS_SET) < 0)
HGOTO_ERROR(H5E_BTREE, H5E_CANTINSERT, HADDR_UNDEF, "can't add B-tree header to cache")
HGOTO_ERROR(H5E_BTREE, H5E_CANTINSERT, HADDR_UNDEF, "can't add B-tree header to cache")
/* Set address of v2 B-tree header to return */
ret_value = hdr->addr;
@ -398,15 +398,15 @@ done:
/*-------------------------------------------------------------------------
* Function: H5B2_hdr_fuse_incr
* Function: H5B2_hdr_fuse_incr
*
* Purpose: Increment file reference count on shared v2 B-tree header
* Purpose: Increment file reference count on shared v2 B-tree header
*
* Return: Non-negative on success/Negative on failure
* Return: SUCCEED (Can't fail)
*
* Programmer: Quincey Koziol
* koziol@hdfgroup.org
* Oct 27 2009
* Programmer: Quincey Koziol
* koziol@hdfgroup.org
* Oct 27 2009
*
*-------------------------------------------------------------------------
*/
@ -426,15 +426,15 @@ H5B2_hdr_fuse_incr(H5B2_hdr_t *hdr)
/*-------------------------------------------------------------------------
* Function: H5B2_hdr_fuse_decr
* Function: H5B2_hdr_fuse_decr
*
* Purpose: Decrement file reference count on shared v2 B-tree header
* Purpose: Decrement file reference count on shared v2 B-tree header
*
* Return: Non-negative on success/Negative on failure
* Return: The file's reference count after the decrement. (Can't fail)
*
* Programmer: Quincey Koziol
* koziol@hdfgroup.org
* Oct 27 2009
* Programmer: Quincey Koziol
* koziol@hdfgroup.org
* Oct 27 2009
*
*-------------------------------------------------------------------------
*/
@ -542,6 +542,16 @@ H5B2_hdr_free(H5B2_hdr_t *hdr)
hdr->node_info = H5FL_SEQ_FREE(H5B2_node_info_t, hdr->node_info);
} /* end if */
/* Release the min & max record info, if set */
if(hdr->min_native_rec) {
HDfree(hdr->min_native_rec);
hdr->min_native_rec = NULL;
} /* end if */
if(hdr->max_native_rec) {
HDfree(hdr->max_native_rec);
hdr->max_native_rec = NULL;
} /* end if */
/* Free B-tree header info */
hdr = H5FL_FREE(H5B2_hdr_t, hdr);

View File

@ -172,9 +172,9 @@ H5B2_locate_record(const H5B2_class_t *type, unsigned nrec, size_t *rec_off,
*-------------------------------------------------------------------------
*/
static herr_t
H5B2_split1(H5B2_hdr_t *hdr, hid_t dxpl_id, unsigned depth, H5B2_node_ptr_t *curr_node_ptr,
unsigned *parent_cache_info_flags_ptr, H5B2_internal_t *internal,
unsigned *internal_flags_ptr, unsigned idx)
H5B2_split1(H5B2_hdr_t *hdr, hid_t dxpl_id, unsigned depth,
H5B2_node_ptr_t *curr_node_ptr, unsigned *parent_cache_info_flags_ptr,
H5B2_internal_t *internal, unsigned *internal_flags_ptr, unsigned idx)
{
const H5AC_class_t *child_class; /* Pointer to child node's class info */
haddr_t left_addr, right_addr; /* Addresses of left & right child nodes */
@ -214,7 +214,7 @@ H5B2_split1(H5B2_hdr_t *hdr, hid_t dxpl_id, unsigned depth, H5B2_node_ptr_t *cur
left_addr = internal->node_ptrs[idx].addr;
right_addr = internal->node_ptrs[idx + 1].addr;
/* Protect both leafs */
/* Protect both leaves */
if(NULL == (left_int = H5B2_protect_internal(hdr, dxpl_id, left_addr, internal->node_ptrs[idx].node_nrec, (depth - 1), H5AC_WRITE)))
HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree internal node")
if(NULL == (right_int = H5B2_protect_internal(hdr, dxpl_id, right_addr, internal->node_ptrs[idx + 1].node_nrec, (depth - 1), H5AC_WRITE)))
@ -243,7 +243,7 @@ H5B2_split1(H5B2_hdr_t *hdr, hid_t dxpl_id, unsigned depth, H5B2_node_ptr_t *cur
left_addr = internal->node_ptrs[idx].addr;
right_addr = internal->node_ptrs[idx + 1].addr;
/* Protect both leafs */
/* Protect both leaves */
if(NULL == (left_leaf = H5B2_protect_leaf(hdr, dxpl_id, left_addr, internal->node_ptrs[idx].node_nrec, H5AC_WRITE)))
HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree leaf node")
if(NULL == (right_leaf = H5B2_protect_leaf(hdr, dxpl_id, right_addr, internal->node_ptrs[idx + 1].node_nrec, H5AC_WRITE)))
@ -341,7 +341,7 @@ done:
HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree leaf node")
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5B2_split1 */
} /* end H5B2_split1() */
/*-------------------------------------------------------------------------
@ -646,7 +646,7 @@ done:
HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree child node")
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5B2_redistribute2 */
} /* end H5B2_redistribute2() */
/*-------------------------------------------------------------------------
@ -1033,7 +1033,7 @@ done:
HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree child node")
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5B2_redistribute3 */
} /* end H5B2_redistribute3() */
/*-------------------------------------------------------------------------
@ -1505,7 +1505,7 @@ done:
HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree child node")
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5B2_swap_leaf */
} /* end H5B2_swap_leaf() */
/*-------------------------------------------------------------------------
@ -1523,7 +1523,7 @@ done:
*/
herr_t
H5B2_insert_leaf(H5B2_hdr_t *hdr, hid_t dxpl_id, H5B2_node_ptr_t *curr_node_ptr,
void *udata)
H5B2_nodepos_t curr_pos, void *udata)
{
H5B2_leaf_t *leaf; /* Pointer to leaf node */
int cmp; /* Comparison value of records */
@ -1574,6 +1574,27 @@ H5B2_insert_leaf(H5B2_hdr_t *hdr, hid_t dxpl_id, H5B2_node_ptr_t *curr_node_ptr,
/* Update record count for current node */
leaf->nrec++;
/* Check for new record being the min or max for the tree */
/* (Don't use 'else' for the idx check, to allow for root leaf node) */
if(H5B2_POS_MIDDLE != curr_pos) {
if(idx == 0) {
if(H5B2_POS_LEFT == curr_pos || H5B2_POS_ROOT == curr_pos) {
if(hdr->min_native_rec == NULL)
if(NULL == (hdr->min_native_rec = (uint8_t *)HDmalloc(hdr->cls->nrec_size)))
HGOTO_ERROR(H5E_BTREE, H5E_CANTALLOC, FAIL, "memory allocation failed for v2 B-tree min record info")
HDmemcpy(hdr->min_native_rec, H5B2_LEAF_NREC(leaf, hdr, idx), hdr->cls->nrec_size);
} /* end if */
} /* end if */
if(idx == (unsigned)(leaf->nrec - 1)) {
if(H5B2_POS_RIGHT == curr_pos || H5B2_POS_ROOT == curr_pos) {
if(hdr->max_native_rec == NULL)
if(NULL == (hdr->max_native_rec = (uint8_t *)HDmalloc(hdr->cls->nrec_size)))
HGOTO_ERROR(H5E_BTREE, H5E_CANTALLOC, FAIL, "memory allocation failed for v2 B-tree max record info")
HDmemcpy(hdr->max_native_rec, H5B2_LEAF_NREC(leaf, hdr, idx), hdr->cls->nrec_size);
} /* end if */
} /* end if */
} /* end if */
done:
/* Release the B-tree leaf node (marked as dirty) */
if(leaf && H5AC_unprotect(hdr->f, dxpl_id, H5AC_BT2_LEAF, curr_node_ptr->addr, leaf, H5AC__DIRTIED_FLAG) < 0)
@ -1599,11 +1620,12 @@ done:
herr_t
H5B2_insert_internal(H5B2_hdr_t *hdr, hid_t dxpl_id, unsigned depth,
unsigned *parent_cache_info_flags_ptr, H5B2_node_ptr_t *curr_node_ptr,
void *udata)
H5B2_nodepos_t curr_pos, void *udata)
{
H5B2_internal_t *internal; /* Pointer to internal node */
H5B2_internal_t *internal = NULL; /* Pointer to internal node */
unsigned internal_flags = H5AC__NO_FLAGS_SET;
unsigned idx; /* Location of record which matches key */
H5B2_nodepos_t next_pos = H5B2_POS_MIDDLE; /* Position of node */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI_NOINIT
@ -1618,7 +1640,7 @@ H5B2_insert_internal(H5B2_hdr_t *hdr, hid_t dxpl_id, unsigned depth,
if(NULL == (internal = H5B2_protect_internal(hdr, dxpl_id, curr_node_ptr->addr, curr_node_ptr->node_nrec, depth, H5AC_WRITE)))
HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree internal node")
/* Split or redistribute child node pointers, if necessary */
/* Split or redistribute child node pointers, if necessary */
{
int cmp; /* Comparison value of records */
unsigned retries; /* Number of times to attempt redistribution */
@ -1691,13 +1713,25 @@ H5B2_insert_internal(H5B2_hdr_t *hdr, hid_t dxpl_id, unsigned depth,
} /* end while */
} /* end block */
/* Check if this node is left/right-most */
if(H5B2_POS_MIDDLE != curr_pos) {
if(idx == 0) {
if(H5B2_POS_LEFT == curr_pos || H5B2_POS_ROOT == curr_pos)
next_pos = H5B2_POS_LEFT;
} /* end if */
else if(idx == internal->nrec) {
if(H5B2_POS_RIGHT == curr_pos || H5B2_POS_ROOT == curr_pos)
next_pos = H5B2_POS_RIGHT;
} /* end else */
} /* end if */
/* Attempt to insert node */
if(depth > 1) {
if(H5B2_insert_internal(hdr, dxpl_id, (depth - 1), &internal_flags, &internal->node_ptrs[idx], udata) < 0)
if(H5B2_insert_internal(hdr, dxpl_id, (depth - 1), &internal_flags, &internal->node_ptrs[idx], next_pos, udata) < 0)
HGOTO_ERROR(H5E_BTREE, H5E_CANTINSERT, FAIL, "unable to insert record into B-tree internal node")
} /* end if */
else {
if(H5B2_insert_leaf(hdr, dxpl_id, &internal->node_ptrs[idx], udata) < 0)
if(H5B2_insert_leaf(hdr, dxpl_id, &internal->node_ptrs[idx], next_pos, udata) < 0)
HGOTO_ERROR(H5E_BTREE, H5E_CANTINSERT, FAIL, "unable to insert record into B-tree leaf node")
} /* end else */
@ -2074,7 +2108,7 @@ done:
*/
herr_t
H5B2_remove_leaf(H5B2_hdr_t *hdr, hid_t dxpl_id, H5B2_node_ptr_t *curr_node_ptr,
void *udata, H5B2_remove_t op, void *op_data)
H5B2_nodepos_t curr_pos, void *udata, H5B2_remove_t op, void *op_data)
{
H5B2_leaf_t *leaf; /* Pointer to leaf node */
haddr_t leaf_addr = HADDR_UNDEF; /* Leaf address on disk */
@ -2102,6 +2136,27 @@ H5B2_remove_leaf(H5B2_hdr_t *hdr, hid_t dxpl_id, H5B2_node_ptr_t *curr_node_ptr,
if(H5B2_locate_record(hdr->cls, leaf->nrec, hdr->nat_off, leaf->leaf_native, udata, &idx) != 0)
HGOTO_ERROR(H5E_BTREE, H5E_NOTFOUND, FAIL, "record is not in B-tree")
/* Check for invalidating the min/max record for the tree */
if(H5B2_POS_MIDDLE != curr_pos) {
/* (Don't use 'else' for the idx check, to allow for root leaf node) */
if(idx == 0) {
if(H5B2_POS_LEFT == curr_pos || H5B2_POS_ROOT == curr_pos) {
if(hdr->min_native_rec) {
HDfree(hdr->min_native_rec);
hdr->min_native_rec = NULL;
} /* end if */
} /* end if */
} /* end if */
if(idx == (unsigned)(leaf->nrec - 1)) {
if(H5B2_POS_RIGHT == curr_pos || H5B2_POS_ROOT == curr_pos) {
if(hdr->max_native_rec) {
HDfree(hdr->max_native_rec);
hdr->max_native_rec = NULL;
} /* end if */
} /* end if */
} /* end if */
} /* end if */
/* Make 'remove' callback if there is one */
if(op)
if((op)(H5B2_LEAF_NREC(leaf, hdr, idx), op_data) < 0)
@ -2154,13 +2209,14 @@ done:
herr_t
H5B2_remove_internal(H5B2_hdr_t *hdr, hid_t dxpl_id, hbool_t *depth_decreased,
void *swap_loc, unsigned depth, H5AC_info_t *parent_cache_info,
unsigned *parent_cache_info_flags_ptr, H5B2_node_ptr_t *curr_node_ptr,
void *udata, H5B2_remove_t op, void *op_data)
unsigned *parent_cache_info_flags_ptr, H5B2_nodepos_t curr_pos,
H5B2_node_ptr_t *curr_node_ptr, void *udata, H5B2_remove_t op, void *op_data)
{
H5AC_info_t *new_cache_info; /* Pointer to new cache info */
unsigned *new_cache_info_flags_ptr = NULL;
H5B2_node_ptr_t *new_node_ptr; /* Pointer to new node pointer */
H5B2_internal_t *internal; /* Pointer to internal node */
H5B2_nodepos_t next_pos = H5B2_POS_MIDDLE; /* Position of next node */
unsigned internal_flags = H5AC__NO_FLAGS_SET;
haddr_t internal_addr; /* Address of internal node */
size_t merge_nrec; /* Number of records to merge node at */
@ -2211,6 +2267,9 @@ H5B2_remove_internal(H5B2_hdr_t *hdr, hid_t dxpl_id, hbool_t *depth_decreased,
/* Set flag to indicate root was collapsed */
collapsed_root = TRUE;
/* Indicate position of next node */
next_pos = H5B2_POS_ROOT;
} /* end if */
/* Merge or redistribute child node pointers, if necessary */
else {
@ -2306,16 +2365,28 @@ H5B2_remove_internal(H5B2_hdr_t *hdr, hid_t dxpl_id, hbool_t *depth_decreased,
new_cache_info_flags_ptr = &internal_flags;
new_cache_info = &internal->cache_info;
new_node_ptr = &internal->node_ptrs[idx];
/* Indicate position of next node */
if(H5B2_POS_MIDDLE != curr_pos) {
if(idx == 0) {
if(H5B2_POS_LEFT == curr_pos || H5B2_POS_ROOT == curr_pos)
next_pos = H5B2_POS_LEFT;
} /* end if */
else if(idx == internal->nrec) {
if(H5B2_POS_RIGHT == curr_pos || H5B2_POS_ROOT == curr_pos)
next_pos = H5B2_POS_RIGHT;
} /* end if */
} /* end if */
} /* end else */
/* Attempt to remove record from child node */
if(depth > 1) {
if(H5B2_remove_internal(hdr, dxpl_id, depth_decreased, swap_loc, depth - 1,
new_cache_info, new_cache_info_flags_ptr, new_node_ptr, udata, op, op_data) < 0)
new_cache_info, new_cache_info_flags_ptr, next_pos, new_node_ptr, udata, op, op_data) < 0)
HGOTO_ERROR(H5E_BTREE, H5E_CANTDELETE, FAIL, "unable to remove record from B-tree internal node")
} /* end if */
else {
if(H5B2_remove_leaf(hdr, dxpl_id, new_node_ptr, udata, op, op_data) < 0)
if(H5B2_remove_leaf(hdr, dxpl_id, new_node_ptr, next_pos, udata, op, op_data) < 0)
HGOTO_ERROR(H5E_BTREE, H5E_CANTDELETE, FAIL, "unable to remove record from B-tree leaf node")
} /* end else */
@ -2355,8 +2426,8 @@ done:
*/
herr_t
H5B2_remove_leaf_by_idx(H5B2_hdr_t *hdr, hid_t dxpl_id,
H5B2_node_ptr_t *curr_node_ptr, unsigned idx, H5B2_remove_t op,
void *op_data)
H5B2_node_ptr_t *curr_node_ptr, H5B2_nodepos_t curr_pos,
unsigned idx, H5B2_remove_t op, void *op_data)
{
H5B2_leaf_t *leaf; /* Pointer to leaf node */
haddr_t leaf_addr = HADDR_UNDEF; /* Leaf address on disk */
@ -2380,6 +2451,27 @@ H5B2_remove_leaf_by_idx(H5B2_hdr_t *hdr, hid_t dxpl_id,
HDassert(leaf->nrec == curr_node_ptr->node_nrec);
HDassert(idx < leaf->nrec);
/* Check for invalidating the min/max record for the tree */
if(H5B2_POS_MIDDLE != curr_pos) {
/* (Don't use 'else' for the idx check, to allow for root leaf node) */
if(idx == 0) {
if(H5B2_POS_LEFT == curr_pos || H5B2_POS_ROOT == curr_pos) {
if(hdr->min_native_rec) {
HDfree(hdr->min_native_rec);
hdr->min_native_rec = NULL;
} /* end if */
} /* end if */
} /* end if */
if(idx == (unsigned)(leaf->nrec - 1)) {
if(H5B2_POS_RIGHT == curr_pos || H5B2_POS_ROOT == curr_pos) {
if(hdr->max_native_rec) {
HDfree(hdr->max_native_rec);
hdr->max_native_rec = NULL;
} /* end if */
} /* end if */
} /* end if */
} /* end if */
/* Make 'remove' callback if there is one */
if(op)
if((op)(H5B2_LEAF_NREC(leaf, hdr, idx), op_data) < 0)
@ -2434,13 +2526,14 @@ herr_t
H5B2_remove_internal_by_idx(H5B2_hdr_t *hdr, hid_t dxpl_id,
hbool_t *depth_decreased, void *swap_loc, unsigned depth,
H5AC_info_t *parent_cache_info, unsigned *parent_cache_info_flags_ptr,
H5B2_node_ptr_t *curr_node_ptr, hsize_t n, H5B2_remove_t op,
void *op_data)
H5B2_node_ptr_t *curr_node_ptr, H5B2_nodepos_t curr_pos, hsize_t n,
H5B2_remove_t op, void *op_data)
{
H5AC_info_t *new_cache_info; /* Pointer to new cache info */
unsigned *new_cache_info_flags_ptr = NULL;
H5B2_node_ptr_t *new_node_ptr; /* Pointer to new node pointer */
H5B2_internal_t *internal; /* Pointer to internal node */
H5B2_nodepos_t next_pos = H5B2_POS_MIDDLE; /* Position of next node */
unsigned internal_flags = H5AC__NO_FLAGS_SET;
haddr_t internal_addr; /* Address of internal node */
size_t merge_nrec; /* Number of records to merge node at */
@ -2494,6 +2587,9 @@ H5B2_remove_internal_by_idx(H5B2_hdr_t *hdr, hid_t dxpl_id,
/* Set flag to indicate root was collapsed */
collapsed_root = TRUE;
/* Indicate position of next node */
next_pos = H5B2_POS_ROOT;
} /* end if */
/* Merge or redistribute child node pointers, if necessary */
else {
@ -2641,16 +2737,28 @@ H5B2_remove_internal_by_idx(H5B2_hdr_t *hdr, hid_t dxpl_id,
new_cache_info_flags_ptr = &internal_flags;
new_cache_info = &internal->cache_info;
new_node_ptr = &internal->node_ptrs[idx];
/* Indicate position of next node */
if(H5B2_POS_MIDDLE != curr_pos) {
if(idx == 0) {
if(H5B2_POS_LEFT == curr_pos || H5B2_POS_ROOT == curr_pos)
next_pos = H5B2_POS_LEFT;
} /* end if */
else if(idx == internal->nrec) {
if(H5B2_POS_RIGHT == curr_pos || H5B2_POS_ROOT == curr_pos)
next_pos = H5B2_POS_RIGHT;
} /* end if */
} /* end if */
} /* end else */
/* Attempt to remove record from child node */
if(depth > 1) {
if(H5B2_remove_internal_by_idx(hdr, dxpl_id, depth_decreased, swap_loc, depth - 1,
new_cache_info, new_cache_info_flags_ptr, new_node_ptr, n, op, op_data) < 0)
new_cache_info, new_cache_info_flags_ptr, new_node_ptr, next_pos, n, op, op_data) < 0)
HGOTO_ERROR(H5E_BTREE, H5E_CANTDELETE, FAIL, "unable to remove record from B-tree internal node")
} /* end if */
else {
if(H5B2_remove_leaf_by_idx(hdr, dxpl_id, new_node_ptr, (unsigned)n, op, op_data) < 0)
if(H5B2_remove_leaf_by_idx(hdr, dxpl_id, new_node_ptr, next_pos, (unsigned)n, op, op_data) < 0)
HGOTO_ERROR(H5E_BTREE, H5E_CANTDELETE, FAIL, "unable to remove record from B-tree leaf node")
} /* end else */

View File

@ -172,6 +172,8 @@ typedef struct H5B2_hdr_t {
uint8_t *page; /* Common disk page for I/O */
size_t *nat_off; /* Array of offsets of native records */
H5B2_node_info_t *node_info; /* Table of node info structs for current depth of B-tree */
uint8_t *min_native_rec; /* Pointer to minimum native record */
uint8_t *max_native_rec; /* Pointer to maximum native record */
/* Client information (not stored) */
const H5B2_class_t *cls; /* Class of B-tree client */
@ -208,6 +210,14 @@ struct H5B2_t {
H5F_t *f; /* Pointer to file for v2 B-tree */
};
/* Node position, for min/max determination */
typedef enum H5B2_nodepos_t {
H5B2_POS_ROOT, /* Node is root (i.e. both right & left-most in tree) */
H5B2_POS_RIGHT, /* Node is right-most in tree, at a given depth */
H5B2_POS_LEFT, /* Node is left-most in tree, at a given depth */
H5B2_POS_MIDDLE /* Node is neither right or left-most in tree */
} H5B2_nodepos_t;
/* Callback info for loading a free space header into the cache */
typedef struct H5B2_hdr_cache_ud_t {
H5F_t *f; /* File that v2 b-tree header is within */
@ -304,9 +314,9 @@ H5_DLL herr_t H5B2_internal_free(H5B2_internal_t *i);
/* Routines for inserting records */
H5_DLL herr_t H5B2_insert_internal(H5B2_hdr_t *hdr, hid_t dxpl_id,
unsigned depth, unsigned *parent_cache_info_flags_ptr,
H5B2_node_ptr_t *curr_node_ptr, void *udata);
H5B2_node_ptr_t *curr_node_ptr, H5B2_nodepos_t curr_pos, void *udata);
H5_DLL herr_t H5B2_insert_leaf(H5B2_hdr_t *hdr, hid_t dxpl_id,
H5B2_node_ptr_t *curr_node_ptr, void *udata);
H5B2_node_ptr_t *curr_node_ptr, H5B2_nodepos_t curr_pos, void *udata);
/* Routines for iterating over nodes/records */
H5_DLL herr_t H5B2_iterate_node(H5B2_hdr_t *hdr, hid_t dxpl_id, unsigned depth,
@ -326,19 +336,21 @@ H5_DLL herr_t H5B2_neighbor_leaf(H5B2_hdr_t *hdr, hid_t dxpl_id,
/* Routines for removing records */
H5_DLL herr_t H5B2_remove_internal(H5B2_hdr_t *hdr, hid_t dxpl_id,
hbool_t *depth_decreased, void *swap_loc, unsigned depth, H5AC_info_t *parent_cache_info,
hbool_t * parent_cache_info_dirtied_ptr, H5B2_node_ptr_t *curr_node_ptr, void *udata,
hbool_t *depth_decreased, void *swap_loc, unsigned depth,
H5AC_info_t *parent_cache_info, hbool_t * parent_cache_info_dirtied_ptr,
H5B2_nodepos_t curr_pos, H5B2_node_ptr_t *curr_node_ptr, void *udata,
H5B2_remove_t op, void *op_data);
H5_DLL herr_t H5B2_remove_leaf(H5B2_hdr_t *hdr, hid_t dxpl_id,
H5B2_node_ptr_t *curr_node_ptr, void *udata, H5B2_remove_t op,
void *op_data);
H5B2_node_ptr_t *curr_node_ptr, H5B2_nodepos_t curr_pos,
void *udata, H5B2_remove_t op, void *op_data);
H5_DLL herr_t H5B2_remove_internal_by_idx(H5B2_hdr_t *hdr, hid_t dxpl_id,
hbool_t *depth_decreased, void *swap_loc, unsigned depth, H5AC_info_t *parent_cache_info,
hbool_t * parent_cache_info_dirtied_ptr, H5B2_node_ptr_t *curr_node_ptr, hsize_t idx,
hbool_t *depth_decreased, void *swap_loc, unsigned depth,
H5AC_info_t *parent_cache_info, hbool_t * parent_cache_info_dirtied_ptr,
H5B2_node_ptr_t *curr_node_ptr, H5B2_nodepos_t curr_pos, hsize_t idx,
H5B2_remove_t op, void *op_data);
H5_DLL herr_t H5B2_remove_leaf_by_idx(H5B2_hdr_t *hdr, hid_t dxpl_id,
H5B2_node_ptr_t *curr_node_ptr, unsigned idx, H5B2_remove_t op,
void *op_data);
H5B2_node_ptr_t *curr_node_ptr, H5B2_nodepos_t curr_pos,
unsigned idx, H5B2_remove_t op, void *op_data);
/* Routines for deleting nodes */
H5_DLL herr_t H5B2_delete_node(H5B2_hdr_t *hdr, hid_t dxpl_id, unsigned depth,

View File

@ -13,10 +13,10 @@
* access to either file, you may request a copy from help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* Programmer: Quincey Koziol <koziol@ncsa.uiuc.edu>
/* Programmer: Quincey Koziol <koziol@hdfgroup.org>
* Monday, March 6, 2006
*
* Purpose: v2 B-tree metadata statistics functions.
* Purpose: v2 B-tree metadata statistics functions.
*
*/
@ -24,15 +24,15 @@
/* Module Setup */
/****************/
#define H5B2_PACKAGE /*suppress error about including H5B2pkg */
#define H5B2_PACKAGE /* Suppress error about including H5B2pkg */
/***********/
/* Headers */
/***********/
#include "H5private.h" /* Generic Functions */
#include "H5B2pkg.h" /* v2 B-trees */
#include "H5Eprivate.h" /* Error handling */
#include "H5private.h" /* Generic Functions */
#include "H5B2pkg.h" /* v2 B-trees */
#include "H5Eprivate.h" /* Error handling */
/****************/
@ -71,14 +71,13 @@
/*-------------------------------------------------------------------------
* Function: H5B2_stat_info
* Function: H5B2_stat_info
*
* Purpose: Retrieve metadata statistics for a v2 B-tree
* Purpose: Retrieve metadata statistics for a v2 B-tree
*
* Return: Success: non-negative
* Failure: negative
* Return: SUCCEED (Can't fail)
*
* Programmer: Quincey Koziol
* Programmer: Quincey Koziol
* Monday, March 6, 2006
*
*-------------------------------------------------------------------------
@ -105,7 +104,7 @@ H5B2_stat_info(H5B2_t *bt2, H5B2_stat_t *info)
* Purpose: Iterate over all the records in the B-tree, collecting
* storage info.
*
* Return: non-negative on success, negative on error
* Return: SUCCEED/FAIL
*
* Programmer: Vailin Choi
* June 19 2007
@ -115,7 +114,7 @@ H5B2_stat_info(H5B2_t *bt2, H5B2_stat_t *info)
herr_t
H5B2_size(H5B2_t *bt2, hid_t dxpl_id, hsize_t *btree_size)
{
H5B2_hdr_t *hdr; /* Pointer to the B-tree header */
H5B2_hdr_t *hdr; /* Pointer to the B-tree header */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)

View File

@ -195,7 +195,7 @@ H5B_class_t H5B_BTREE[1] = {{
H5D__btree_remove, /*remove */
H5D__btree_decode_key, /*decode */
H5D__btree_encode_key, /*encode */
H5D__btree_debug_key, /*debug */
H5D__btree_debug_key /*debug */
}};
@ -228,7 +228,7 @@ H5D__btree_get_shared(const H5F_t UNUSED *f, const void *_udata)
HDassert(udata);
HDassert(udata->storage);
HDassert(udata->storage->idx_type == H5D_CHUNK_BTREE);
HDassert(udata->storage->idx_type == H5D_CHUNK_IDX_BTREE);
HDassert(udata->storage->u.btree.shared);
/* Return the pointer to the ref-count object */
@ -868,7 +868,7 @@ done:
static herr_t
H5D__btree_idx_create(const H5D_chk_idx_info_t *idx_info)
{
H5D_chunk_common_ud_t udata; /* User data for B-tree callback */
H5D_chunk_common_ud_t udata; /* User data for B-tree callback */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_STATIC
@ -939,7 +939,7 @@ H5D__btree_idx_is_space_alloc(const H5O_storage_chunk_t *storage)
static herr_t
H5D__btree_idx_insert(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *udata)
{
herr_t ret_value = SUCCEED; /* Return value */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_STATIC
@ -1111,7 +1111,7 @@ H5D__btree_idx_iterate(const H5D_chk_idx_info_t *idx_info,
static herr_t
H5D__btree_idx_remove(const H5D_chk_idx_info_t *idx_info, H5D_chunk_common_ud_t *udata)
{
herr_t ret_value = SUCCEED; /* Return value */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_STATIC
@ -1453,7 +1453,7 @@ H5D_btree_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE * stream, int indent
/* Reset "fake" storage info */
HDmemset(&storage, 0, sizeof(storage));
storage.idx_type = H5D_CHUNK_BTREE;
storage.idx_type = H5D_CHUNK_IDX_BTREE;
/* Allocate the shared structure */
if(H5D__btree_shared_create(f, &storage, ndims) < 0)

View File

@ -318,24 +318,22 @@ H5D__chunk_direct_write(const H5D_t *dset, hid_t dxpl_id, uint32_t filters, hsiz
uint32_t data_size, const void *buf)
{
const H5O_layout_t *layout = &(dset->shared->layout); /* Dataset layout */
H5D_chunk_ud_t udata; /* User data for querying chunk info */
H5D_chunk_ud_t udata; /* User data for querying chunk info */
hsize_t chunk_idx;
H5D_dxpl_cache_t _dxpl_cache; /* Data transfer property cache buffer */
H5D_dxpl_cache_t *dxpl_cache = &_dxpl_cache; /* Data transfer property cache */
const H5D_rdcc_t *rdcc = &(dset->shared->cache.chunk); /*raw data chunk cache */
int space_ndims; /* Dataset's space rank */
hsize_t space_dim[H5O_LAYOUT_NDIMS]; /* Dataset's dataspace dimensions */
herr_t ret_value = SUCCEED; /* Return value */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_STATIC_TAG(dxpl_id, dset->oloc.addr, FAIL)
/* Allocate data space and initialize it if it hasn't been. */
if(!(*dset->shared->layout.ops->is_space_alloc)(&dset->shared->layout.storage)) {
if(!(*dset->shared->layout.ops->is_space_alloc)(&dset->shared->layout.storage))
/* Allocate storage */
if(H5D__alloc_storage(dset, dxpl_id, H5D_ALLOC_WRITE, FALSE, NULL) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize storage")
} /* end if */
/* Retrieve the dataset dimensions */
if((space_ndims = H5S_get_simple_extent_dims(dset->shared->space, space_dim, NULL)) < 0)
@ -385,11 +383,9 @@ H5D__chunk_direct_write(const H5D_t *dset, hid_t dxpl_id, uint32_t filters, hsiz
/* Evict the entry from the cache if present, but do not flush
* it to disk */
if(UINT_MAX != udata.idx_hint) {
if(H5D__chunk_cache_evict(dset, dxpl_id, dxpl_cache,
rdcc->slot[udata.idx_hint], FALSE) < 0)
if(UINT_MAX != udata.idx_hint)
if(H5D__chunk_cache_evict(dset, dxpl_id, dxpl_cache, rdcc->slot[udata.idx_hint], FALSE) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTREMOVE, FAIL, "unable to evict chunk")
} /* end if */
/* Write the data to the file */
if(H5F_block_write(dset->oloc.file, H5FD_MEM_DRAW, udata.addr, data_size, dxpl_id, buf) < 0)
@ -1317,13 +1313,12 @@ H5D__create_chunk_file_map_hyper(H5D_chunk_map_t *fm, const H5D_io_info_t
new_chunk_info->mspace_shared = FALSE;
/* Copy the chunk's coordinates */
for(u=0; u<fm->f_ndims; u++)
new_chunk_info->coords[u]=coords[u];
new_chunk_info->coords[fm->f_ndims]=0;
HDmemcpy(new_chunk_info->coords, coords, sizeof(hsize_t) * fm->f_ndims);
new_chunk_info->coords[fm->f_ndims] = 0;
/* Insert the new chunk into the skip list */
if(H5SL_insert(fm->sel_chunks, new_chunk_info, &new_chunk_info->index) < 0) {
H5D__free_chunk_info(new_chunk_info, NULL, NULL);
H5D__free_chunk_info(new_chunk_info, NULL, NULL);
HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINSERT, FAIL, "can't insert chunk into skip list")
} /* end if */
@ -1508,7 +1503,7 @@ H5D__chunk_file_cb(void UNUSED *elem, hid_t UNUSED type_id, unsigned ndims, cons
H5D_chunk_file_iter_ud_t *udata = (H5D_chunk_file_iter_ud_t *)_udata; /* User data for operation */
H5D_chunk_map_t *fm = udata->fm; /* File<->memory chunk mapping info */
H5D_chunk_info_t *chunk_info; /* Chunk information for current chunk */
hsize_t coords_in_chunk[H5O_LAYOUT_NDIMS]; /* Coordinates of element in chunk */
hsize_t coords_in_chunk[H5O_LAYOUT_NDIMS]; /* Coordinates of element in chunk */
hsize_t chunk_index; /* Chunk index */
unsigned u; /* Local index variable */
herr_t ret_value = SUCCEED; /* Return value */
@ -2238,8 +2233,6 @@ H5D__chunk_cinfo_cache_reset(H5D_chunk_cached_t *last)
static herr_t
H5D__chunk_cinfo_cache_update(H5D_chunk_cached_t *last, const H5D_chunk_ud_t *udata)
{
unsigned u; /* Local index variable */
FUNC_ENTER_STATIC_NOERR
/* Sanity check */
@ -2250,8 +2243,7 @@ H5D__chunk_cinfo_cache_update(H5D_chunk_cached_t *last, const H5D_chunk_ud_t *ud
HDassert(udata->common.offset);
/* Stored the information to cache */
for(u = 0; u < udata->common.layout->ndims; u++)
last->offset[u] = udata->common.offset[u];
HDmemcpy(last->offset, udata->common.offset, sizeof(hsize_t) * udata->common.layout->ndims);
last->nbytes = udata->nbytes;
last->filter_mask = udata->filter_mask;
last->addr = udata->addr;
@ -2820,7 +2812,6 @@ H5D__chunk_lock(const H5D_io_info_t *io_info, H5D_chunk_ud_t *udata,
haddr_t chunk_addr = HADDR_UNDEF; /* Address of chunk on disk */
size_t chunk_size; /*size of a chunk */
void *chunk = NULL; /*the file chunk */
unsigned u; /*counters */
void *ret_value; /*return value */
FUNC_ENTER_PACKAGE
@ -2846,9 +2837,13 @@ H5D__chunk_lock(const H5D_io_info_t *io_info, H5D_chunk_ud_t *udata,
ent = rdcc->slot[udata->idx_hint];
#ifndef NDEBUG
{
unsigned u; /*counters */
/* Make sure this is the right chunk */
for(u = 0; u < layout->u.chunk.ndims; u++)
HDassert(io_info->store->chunk.offset[u] == ent->offset[u]);
}
#endif /* NDEBUG */
/*
@ -2990,15 +2985,12 @@ H5D__chunk_lock(const H5D_io_info_t *io_info, H5D_chunk_ud_t *udata,
HGOTO_ERROR(H5E_IO, H5E_CANTINIT, NULL, "unable to preempt chunk(s) from cache")
/* Create a new entry */
if(NULL == (ent = H5FL_MALLOC(H5D_rdcc_ent_t)))
if(NULL == (ent = H5FL_CALLOC(H5D_rdcc_ent_t)))
HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, NULL, "can't allocate raw data chunk entry")
ent->locked = 0;
ent->dirty = FALSE;
ent->deleted = FALSE;
/* Initialize the new entry */
ent->chunk_addr = chunk_addr;
for(u = 0; u < layout->u.chunk.ndims; u++)
ent->offset[u] = io_info->store->chunk.offset[u];
HDmemcpy(ent->offset, io_info->store->chunk.offset, sizeof(hsize_t) * layout->u.chunk.ndims);
H5_ASSIGN_OVERFLOW(ent->rd_count, chunk_size, size_t, uint32_t);
H5_ASSIGN_OVERFLOW(ent->wr_count, chunk_size, size_t, uint32_t);
ent->chunk = (uint8_t *)chunk;
@ -3011,16 +3003,13 @@ H5D__chunk_lock(const H5D_io_info_t *io_info, H5D_chunk_ud_t *udata,
rdcc->nused++;
/* Add it to the linked list */
ent->next = NULL;
if(rdcc->tail) {
rdcc->tail->next = ent;
ent->prev = rdcc->tail;
rdcc->tail = ent;
} /* end if */
else {
else
rdcc->head = rdcc->tail = ent;
ent->prev = NULL;
} /* end else */
} /* end if */
else
/* We did not add the chunk to cache */
@ -3413,8 +3402,7 @@ H5D__chunk_allocate(const H5D_t *dset, hid_t dxpl_id, hbool_t full_overwrite,
continue;
else {
/* Reset the chunk offset indices */
HDmemset(chunk_offset, 0, ((unsigned)space_ndims
* sizeof(chunk_offset[0])));
HDmemset(chunk_offset, 0, ((unsigned)space_ndims * sizeof(chunk_offset[0])));
chunk_offset[op_dim] = min_unalloc[op_dim];
carry = FALSE;
@ -3444,10 +3432,12 @@ H5D__chunk_allocate(const H5D_t *dset, hid_t dxpl_id, hbool_t full_overwrite,
/* Make sure the chunk is really in the dataset and outside the
* original dimensions */
{
unsigned u; /* Local index variable */
hbool_t outside_orig = FALSE;
for(i=0; i<space_ndims; i++) {
HDassert(chunk_offset[i] < space_dim[i]);
if(chunk_offset[i] >= old_dim[i])
for(u = 0; u < (unsigned)space_ndims; u++) {
HDassert(chunk_offset[u] < space_dim[u]);
if(chunk_offset[u] >= old_dim[u])
outside_orig = TRUE;
} /* end for */
HDassert(outside_orig);
@ -3546,13 +3536,14 @@ H5D__chunk_allocate(const H5D_t *dset, hid_t dxpl_id, hbool_t full_overwrite,
/* Increment indices */
carry = TRUE;
for(i = (int)(space_ndims - 1); i >= 0; --i) {
for(i = ((int)space_ndims - 1); i >= 0; --i) {
chunk_offset[i] += chunk_dim[i];
if(chunk_offset[i] > max_unalloc[i])
if(chunk_offset[i] > max_unalloc[i]) {
if(i == op_dim)
chunk_offset[i] = min_unalloc[i];
else
chunk_offset[i] = 0;
} /* end if */
else {
carry = FALSE;
break;
@ -4006,7 +3997,7 @@ H5D__chunk_prune_by_extent(H5D_t *dset, hid_t dxpl_id, const hsize_t *old_dim)
hsize_t hyper_start[H5O_LAYOUT_NDIMS]; /* Starting location of hyperslab */
uint32_t elmts_per_chunk; /* Elements in chunk */
hbool_t carry; /* Flag to indicate that chunk increment carrys to higher dimension (sorta) */
int i; /* Local index variable */
unsigned u; /* Local index variable */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_PACKAGE
@ -4043,15 +4034,14 @@ H5D__chunk_prune_by_extent(H5D_t *dset, hid_t dxpl_id, const hsize_t *old_dim)
/* (also copy the chunk dimensions into 'hsize_t' array for creating dataspace) */
/* (also compute the dimensions which have been shrunk) */
elmts_per_chunk = 1;
for(i = 0; i < space_ndims; i++) {
elmts_per_chunk *= layout->u.chunk.dim[i];
chunk_dim[i] = layout->u.chunk.dim[i];
shrunk_dim[i] = space_dim[i] < old_dim[i];
for(u = 0; u < (unsigned)space_ndims; u++) {
elmts_per_chunk *= layout->u.chunk.dim[u];
chunk_dim[u] = layout->u.chunk.dim[u];
shrunk_dim[u] = space_dim[u] < old_dim[u];
} /* end for */
/* Create a dataspace for a chunk & set the extent */
if(NULL == (chunk_space = H5S_create_simple((unsigned)space_ndims,
chunk_dim, NULL)))
if(NULL == (chunk_space = H5S_create_simple((unsigned)space_ndims, chunk_dim, NULL)))
HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCREATE, FAIL, "can't create simple dataspace")
/* Reset hyperslab start array */
@ -4118,8 +4108,7 @@ H5D__chunk_prune_by_extent(H5D_t *dset, hid_t dxpl_id, const hsize_t *old_dim)
/ chunk_dim[op_dim]);
/* Determine if we need to fill chunks in this dimension */
if((hssize_t)min_mod_chunk_off[op_dim]
== max_fill_chunk_off[op_dim]) {
if((hssize_t)min_mod_chunk_off[op_dim] == max_fill_chunk_off[op_dim]) {
fill_dim[op_dim] = TRUE;
has_fill = TRUE;
} /* end if */
@ -4136,8 +4125,8 @@ H5D__chunk_prune_by_extent(H5D_t *dset, hid_t dxpl_id, const hsize_t *old_dim)
if(has_fill)
for(ent = rdcc->head; ent; ent = ent->next)
/* Check for chunk offset outside of new dimensions */
for(i = 0; i<space_ndims; i++)
if((hsize_t)ent->offset[i] >= space_dim[i]) {
for(u = 0; u < (unsigned)space_ndims; u++)
if((hsize_t)ent->offset[u] >= space_dim[u]) {
/* Mark the entry as "deleted" */
ent->deleted = TRUE;
break;
@ -4149,28 +4138,28 @@ H5D__chunk_prune_by_extent(H5D_t *dset, hid_t dxpl_id, const hsize_t *old_dim)
if(!shrunk_dim[op_dim])
continue;
else {
HDassert((hsize_t) max_mod_chunk_off[op_dim]
>= min_mod_chunk_off[op_dim]);
HDassert((hsize_t) max_mod_chunk_off[op_dim] >= min_mod_chunk_off[op_dim]);
/* Reset the chunk offset indices */
HDmemset(chunk_offset, 0, ((unsigned)space_ndims
* sizeof(chunk_offset[0])));
HDmemset(chunk_offset, 0, ((unsigned)space_ndims * sizeof(chunk_offset[0])));
chunk_offset[op_dim] = min_mod_chunk_off[op_dim];
/* Initialize "dims_outside_fill" array */
ndims_outside_fill = 0;
for(i=0; i<space_ndims; i++)
if((hssize_t)chunk_offset[i] > max_fill_chunk_off[i]) {
dims_outside_fill[i] = TRUE;
for(u = 0; u < (unsigned)space_ndims; u++)
if((hssize_t)chunk_offset[u] > max_fill_chunk_off[u]) {
dims_outside_fill[u] = TRUE;
ndims_outside_fill++;
} /* end if */
else
dims_outside_fill[i] = FALSE;
dims_outside_fill[u] = FALSE;
carry = FALSE;
} /* end if */
while(!carry) {
int i; /* Local index variable */
/* Calculate the index of this chunk */
if(H5VM_chunk_index((unsigned)space_ndims, chunk_offset,
layout->u.chunk.dim, layout->u.chunk.down_chunks,
@ -4191,8 +4180,8 @@ H5D__chunk_prune_by_extent(H5D_t *dset, hid_t dxpl_id, const hsize_t *old_dim)
{
hbool_t outside_dim = FALSE;
for(i=0; i<space_ndims; i++)
if(chunk_offset[i] >= space_dim[i]){
for(u = 0; u < (unsigned)space_ndims; u++)
if(chunk_offset[u] >= space_dim[u]) {
outside_dim = TRUE;
break;
} /* end if */
@ -4206,11 +4195,9 @@ H5D__chunk_prune_by_extent(H5D_t *dset, hid_t dxpl_id, const hsize_t *old_dim)
/* Evict the entry from the cache if present, but do not flush
* it to disk */
if(UINT_MAX != chk_udata.idx_hint) {
if(H5D__chunk_cache_evict(dset, dxpl_id, dxpl_cache,
rdcc->slot[chk_udata.idx_hint], FALSE) < 0)
if(UINT_MAX != chk_udata.idx_hint)
if(H5D__chunk_cache_evict(dset, dxpl_id, dxpl_cache, rdcc->slot[chk_udata.idx_hint], FALSE) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTREMOVE, FAIL, "unable to evict chunk")
} /* end if */
/* Remove the chunk from disk, if present */
if(H5F_addr_defined(chk_udata.addr)) {
@ -4218,8 +4205,7 @@ H5D__chunk_prune_by_extent(H5D_t *dset, hid_t dxpl_id, const hsize_t *old_dim)
idx_udata.offset = chunk_offset;
/* Remove the chunk from disk */
if((layout->storage.u.chunk.ops->remove)(&idx_info, &idx_udata)
< 0)
if((layout->storage.u.chunk.ops->remove)(&idx_info, &idx_udata) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTDELETE, FAIL, "unable to remove chunk entry from index")
} /* end if */
} /* end else */
@ -4248,8 +4234,7 @@ H5D__chunk_prune_by_extent(H5D_t *dset, hid_t dxpl_id, const hsize_t *old_dim)
} /* end if */
else {
/* Check if we just went outside the fill dimension */
if(!dims_outside_fill[i] && (hssize_t)chunk_offset[i]
> max_fill_chunk_off[i]) {
if(!dims_outside_fill[i] && (hssize_t)chunk_offset[i] > max_fill_chunk_off[i]) {
dims_outside_fill[i] = TRUE;
ndims_outside_fill++;
} /* end if */
@ -4267,8 +4252,7 @@ H5D__chunk_prune_by_extent(H5D_t *dset, hid_t dxpl_id, const hsize_t *old_dim)
if(min_mod_chunk_off[op_dim] == 0)
break;
else
max_mod_chunk_off[op_dim] = min_mod_chunk_off[op_dim]
- chunk_dim[op_dim];
max_mod_chunk_off[op_dim] = min_mod_chunk_off[op_dim] - chunk_dim[op_dim];
} /* end for(op_dim=0...) */
/* Reset any cached chunk info for this dataset */
@ -4278,10 +4262,9 @@ done:
/* Release resources */
if(chunk_space && H5S_close(chunk_space) < 0)
HDONE_ERROR(H5E_DATASET, H5E_CLOSEERROR, FAIL, "unable to release dataspace")
if(udata_init) {
if(udata_init)
if(udata.fb_info_init && H5D__fill_term(&udata.fb_info) < 0)
HDONE_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "Can't release fill buffer info")
} /* end if */
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5D__chunk_prune_by_extent() */
@ -4473,7 +4456,7 @@ H5D__chunk_update_cache(H5D_t *dset, hid_t dxpl_id)
H5D_rdcc_ent_t *old_ent; /* Old cache entry */
H5D_dxpl_cache_t _dxpl_cache; /* Data transfer property cache buffer */
H5D_dxpl_cache_t *dxpl_cache = &_dxpl_cache; /* Data transfer property cache */
unsigned rank; /*current # of dimensions */
unsigned rank; /* Current # of dimensions */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_PACKAGE
@ -5178,7 +5161,8 @@ H5D__chunk_dest(H5F_t *f, hid_t dxpl_id, H5D_t *dset)
idx_info.storage = &dset->shared->layout.storage.u.chunk;
/* Free any index structures */
if((dset->shared->layout.storage.u.chunk.ops->dest)(&idx_info) < 0)
if(dset->shared->layout.storage.u.chunk.ops->dest &&
(dset->shared->layout.storage.u.chunk.ops->dest)(&idx_info) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "unable to release chunk index info")
done:

View File

@ -478,7 +478,6 @@ done:
herr_t
H5D__get_space_status(H5D_t *dset, H5D_space_status_t *allocation, hid_t dxpl_id)
{
H5S_t *space; /* Dataset's dataspace */
hsize_t space_allocated; /* The number of bytes allocated for chunks */
hssize_t snelmts; /* Temporary holder for number of elements in dataspace */
hsize_t nelmts; /* Number of elements in dataspace */
@ -491,11 +490,10 @@ H5D__get_space_status(H5D_t *dset, H5D_space_status_t *allocation, hid_t dxpl_id
HDassert(dset);
/* Get the dataset's dataspace */
space = dset->shared->space;
HDassert(space);
HDassert(dset->shared->space);
/* Get the total number of elements in dataset's dataspace */
if((snelmts = H5S_GET_EXTENT_NPOINTS(space)) < 0)
if((snelmts = H5S_GET_EXTENT_NPOINTS(dset->shared->space)) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "unable to retrieve number of elements in dataspace")
nelmts = (hsize_t)snelmts;
@ -1185,6 +1183,7 @@ H5D_open(const H5G_loc_t *loc, hid_t dapl_id, hid_t dxpl_id)
HGOTO_ERROR(H5E_DATASET, H5E_CANTINC, NULL, "can't increment object count")
} /* end else */
/* Set the dataset to return */
ret_value = dataset;
done:
@ -1226,6 +1225,7 @@ H5D__open_oid(H5D_t *dataset, hid_t dapl_id, hid_t dxpl_id)
H5O_fill_t *fill_prop; /* Pointer to dataset's fill value info */
unsigned alloc_time_state; /* Allocation time state */
htri_t msg_exists; /* Whether a particular type of message exists */
hbool_t layout_init = FALSE; /* Flag to indicate that chunk information was initialized */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_STATIC_TAG(dxpl_id, dataset->oloc.addr, FAIL)
@ -1263,6 +1263,9 @@ H5D__open_oid(H5D_t *dataset, hid_t dapl_id, hid_t dxpl_id)
if(H5D__layout_oh_read(dataset, dxpl_id, dapl_id, plist) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get layout/pline/efl info")
/* Indicate that the layout information was initialized */
layout_init = TRUE;
/* Point at dataset's copy, to cache it for later */
fill_prop = &dataset->shared->dcpl_cache.fill;
@ -1338,6 +1341,9 @@ done:
if(H5F_addr_defined(dataset->oloc.addr) && H5O_close(&(dataset->oloc)) < 0)
HDONE_ERROR(H5E_DATASET, H5E_CLOSEERROR, FAIL, "unable to release object header")
if(dataset->shared) {
if(dataset->shared->layout.type == H5D_CHUNKED && layout_init)
if(H5D__chunk_dest(dataset->oloc.file, dxpl_id, dataset) < 0)
HDONE_ERROR(H5E_DATASET, H5E_CANTRELEASE, FAIL, "unable to destroy chunk cache")
if(dataset->shared->space && H5S_close(dataset->shared->space) < 0)
HDONE_ERROR(H5E_DATASET, H5E_CLOSEERROR, FAIL, "unable to release dataspace")
if(dataset->shared->type) {
@ -2212,6 +2218,7 @@ H5D__set_extent(H5D_t *dset, const hsize_t *size, hid_t dxpl_id)
*/
/* Update the index values for the cached chunks for this dataset */
if(H5D_CHUNKED == dset->shared->layout.type) {
/* Update the cached chunk info */
if(H5D__chunk_set_info(dset) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "unable to update # of chunks")
if(H5D__chunk_update_cache(dset, dxpl_id) < 0)
@ -2230,11 +2237,10 @@ H5D__set_extent(H5D_t *dset, const hsize_t *size, hid_t dxpl_id)
*-------------------------------------------------------------------------
*/
if(shrink && H5D_CHUNKED == dset->shared->layout.type &&
(*dset->shared->layout.ops->is_space_alloc)(&dset->shared->layout.storage)) {
(*dset->shared->layout.ops->is_space_alloc)(&dset->shared->layout.storage))
/* Remove excess chunks */
if(H5D__chunk_prune_by_extent(dset, dxpl_id, curr_dims) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "unable to remove chunks")
} /* end if */
/* Mark the dataspace as dirty, for later writing to the file */
if(H5D__mark(dset, dxpl_id, H5D_MARK_SPACE) < 0)
@ -2667,16 +2673,14 @@ H5D_get_space(H5D_t *dset)
HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to get data space")
/* Create an atom */
if((ret_value = H5I_register (H5I_DATASPACE, space, TRUE)) < 0)
HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register data space")
if((ret_value = H5I_register(H5I_DATASPACE, space, TRUE)) < 0)
HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register dataspace")
done:
if(ret_value < 0) {
if(space!=NULL) {
if(ret_value < 0)
if(space != NULL)
if(H5S_close(space) < 0)
HDONE_ERROR(H5E_DATASET, H5E_CLOSEERROR, FAIL, "unable to release dataspace")
} /* end if */
} /* end if */
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5D_get_space() */

View File

@ -305,7 +305,7 @@ H5D__pre_write(H5D_t *dset, hbool_t direct_write, hid_t mem_type_id,
int ndims = 0;
hsize_t dims[H5O_LAYOUT_NDIMS];
hsize_t internal_offset[H5O_LAYOUT_NDIMS];
int i;
unsigned u;
/* Get the dataset transfer property list */
if(NULL == (plist = (H5P_genplist_t *)H5I_object(dxpl_id)))
@ -327,16 +327,16 @@ H5D__pre_write(H5D_t *dset, hbool_t direct_write, hid_t mem_type_id,
if((ndims = H5S_get_simple_extent_dims(dset->shared->space, dims, NULL)) < 0)
HGOTO_ERROR(H5E_DATASPACE, H5E_CANTGET, FAIL, "can't retrieve dataspace extent dims")
for(i = 0; i < ndims; i++) {
for(u = 0; u < ndims; u++) {
/* Make sure the offset doesn't exceed the dataset's dimensions */
if(direct_offset[i] > dims[i])
if(direct_offset[u] > dims[u])
HGOTO_ERROR(H5E_DATASPACE, H5E_BADTYPE, FAIL, "offset exceeds dimensions of dataset")
/* Make sure the offset fall right on a chunk's boundary */
if(direct_offset[i] % dset->shared->layout.u.chunk.dim[i])
if(direct_offset[u] % dset->shared->layout.u.chunk.dim[u])
HGOTO_ERROR(H5E_DATASPACE, H5E_BADTYPE, FAIL, "offset doesn't fall on chunks's boundary")
internal_offset[i] = direct_offset[i];
internal_offset[u] = direct_offset[u];
} /* end for */
/* Terminate the offset with a zero */

View File

@ -833,39 +833,37 @@ H5D__link_chunk_collective_io(H5D_io_info_t *io_info, const H5D_type_info_t *typ
* equivalent of compressed contiguous datasets - QAK]
*/
if(total_chunks == 1) {
H5D_chunk_ud_t udata; /* User data for querying chunk info */
hsize_t coords[H5O_LAYOUT_NDIMS]; /* Coordinates of chunk in file dataset's dataspace */
H5SL_node_t *chunk_node; /* Pointer to chunk node for selection */
H5S_t *fspace; /* Dataspace describing chunk & selection in it */
H5S_t *mspace; /* Dataspace describing selection in memory corresponding to this chunk */
/* Initialize the chunk coordinates */
/* (must be all zero, since there's only one chunk) */
HDmemset(coords, 0, sizeof(coords));
/* Look up address of chunk */
if(H5D__chunk_lookup(io_info->dset, io_info->dxpl_id, coords,
io_info->store->chunk.index, &udata) < 0)
HGOTO_ERROR(H5E_STORAGE, H5E_CANTGET, FAIL, "couldn't get chunk info from skipped list")
ctg_store.contig.dset_addr = udata.addr;
/* Check for this process having selection in this chunk */
chunk_node = H5SL_first(fm->sel_chunks);
if(chunk_node == NULL) {
/* Set the dataspace info for I/O to NULL, this process doesn't have any I/O to perform */
fspace = mspace = NULL;
/* Set the dataspace info for I/O to NULL, this process doesn't have any I/O to perform */
fspace = mspace = NULL;
/* Initialize chunk address */
ctg_store.contig.dset_addr = 0;
} /* end if */
else {
H5D_chunk_info_t *chunk_info;
H5D_chunk_ud_t udata; /* User data for querying chunk info */
H5D_chunk_info_t *chunk_info; /* Info for chunk in skiplist */
/* Get the chunk info, for the selection in the chunk */
if(NULL == (chunk_info = H5SL_item(chunk_node)))
HGOTO_ERROR(H5E_STORAGE, H5E_CANTGET, FAIL, "couldn't get chunk info from skipped list")
/* Get the chunk info, for the selection in the chunk */
if(NULL == (chunk_info = (H5D_chunk_info_t *)H5SL_item(chunk_node)))
HGOTO_ERROR(H5E_STORAGE, H5E_CANTGET, FAIL, "couldn't get chunk info from skip list")
/* Set the dataspace info for I/O */
fspace = chunk_info->fspace;
mspace = chunk_info->mspace;
/* Set the dataspace info for I/O */
fspace = chunk_info->fspace;
mspace = chunk_info->mspace;
/* Look up address of chunk */
if(H5D__chunk_lookup(io_info->dset, io_info->dxpl_id, chunk_info->coords,
chunk_info->index, &udata) < 0)
HGOTO_ERROR(H5E_STORAGE, H5E_CANTGET, FAIL, "couldn't get chunk address")
ctg_store.contig.dset_addr = udata.addr;
} /* end else */
/* Set up the base storage address for this chunk */

View File

@ -362,7 +362,7 @@ typedef struct H5D_chunk_map_t {
} H5D_chunk_map_t;
/* Cached information about a particular chunk */
typedef struct H5D_chunk_cached_t{
typedef struct H5D_chunk_cached_t {
hbool_t valid; /*whether cache info is valid*/
hsize_t offset[H5O_LAYOUT_NDIMS]; /*logical offset to start*/
uint32_t nbytes; /*size of stored data */

View File

@ -56,7 +56,8 @@ typedef enum H5D_layout_t {
/* Types of chunk index data structures */
typedef enum H5D_chunk_index_t {
H5D_CHUNK_BTREE = 0 /* v1 B-tree index */
H5D_CHUNK_IDX_BTREE = 0, /* v1 B-tree index */
H5D_CHUNK_IDX_NTYPES /* this one must be last! */
} H5D_chunk_index_t;
/* Values for the space allocation time property */

View File

@ -152,6 +152,7 @@ H5Eget_major(H5E_major_t maj)
char *ret_value; /* Return value */
FUNC_ENTER_API_NOCLEAR(NULL)
H5TRACE1("*s", "i", maj);
/* Get the message object */
if(NULL == (msg = (H5E_msg_t *)H5I_object_verify(maj, H5I_ERROR_MSG)))
@ -204,6 +205,7 @@ H5Eget_minor(H5E_minor_t min)
char *ret_value; /* Return value */
FUNC_ENTER_API_NOCLEAR(NULL)
H5TRACE1("*s", "i", min);
/* Get the message object */
if(NULL == (msg = (H5E_msg_t *)H5I_object_verify(min, H5I_ERROR_MSG)))

View File

@ -886,6 +886,7 @@ H5FDopen(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr)
H5FD_t *ret_value=NULL;
FUNC_ENTER_API(NULL)
H5TRACE4("*x", "*sIuia", name, flags, fapl_id, maxaddr);
/* Check arguments */
if(H5P_DEFAULT == fapl_id)

View File

@ -883,6 +883,7 @@ H5Iobject_verify(hid_t id, H5I_type_t id_type)
void * ret_value; /* Return value */
FUNC_ENTER_API(NULL)
H5TRACE2("*x", "iIt", id, id_type);
if(H5I_IS_LIB_TYPE(id_type))
HGOTO_ERROR(H5E_ATOM, H5E_BADGROUP, NULL, "cannot call public function on library type")
@ -1023,6 +1024,7 @@ H5Iremove_verify(hid_t id, H5I_type_t id_type)
void * ret_value; /* Return value */
FUNC_ENTER_API(NULL)
H5TRACE2("*x", "iIt", id, id_type);
if(H5I_IS_LIB_TYPE(id_type))
HGOTO_ERROR(H5E_ATOM, H5E_BADGROUP, NULL, "cannot call public function on library type")
@ -1871,6 +1873,7 @@ H5Isearch(H5I_type_t type, H5I_search_func_t func, void *key)
void *ret_value; /* Return value */
FUNC_ENTER_API(NULL)
H5TRACE3("*x", "Itx*x", type, func, key);
/* Check arguments */
if(H5I_IS_LIB_TYPE(type))

View File

@ -147,7 +147,7 @@ H5O_layout_decode(H5F_t *f, hid_t UNUSED dxpl_id, H5O_t UNUSED *open_oh,
/* Set the chunk operations */
/* (Only "btree" indexing type currently supported in this version) */
mesg->storage.u.chunk.idx_type = H5D_CHUNK_BTREE;
mesg->storage.u.chunk.idx_type = H5D_CHUNK_IDX_BTREE;
mesg->storage.u.chunk.ops = H5D_COPS_BTREE;
} /* end if */
else {
@ -234,7 +234,7 @@ H5O_layout_decode(H5F_t *f, hid_t UNUSED dxpl_id, H5O_t UNUSED *open_oh,
/* Set the chunk operations */
/* (Only "btree" indexing type supported with v3 of message format) */
mesg->storage.u.chunk.idx_type = H5D_CHUNK_BTREE;
mesg->storage.u.chunk.idx_type = H5D_CHUNK_IDX_BTREE;
mesg->storage.u.chunk.ops = H5D_COPS_BTREE;
/* Set the layout operations */
@ -715,7 +715,7 @@ H5O_layout_debug(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, const void *_mesg,
/* Index information */
switch(mesg->storage.u.chunk.idx_type) {
case H5D_CHUNK_BTREE:
case H5D_CHUNK_IDX_BTREE:
HDfprintf(stream, "%*s%-*s %s\n", indent, "", fwidth,
"Index Type:", "v1 B-tree");
HDfprintf(stream, "%*s%-*s %a\n", indent, "", fwidth,

View File

@ -1596,6 +1596,7 @@ H5Pget_class_name(hid_t pclass_id)
char *ret_value; /* return value */
FUNC_ENTER_API(NULL)
H5TRACE1("*s", "i", pclass_id);
/* Check arguments. */
if(NULL == (pclass = (H5P_genclass_t *)H5I_object_verify(pclass_id, H5I_GENPROP_CLS)))

View File

@ -23,11 +23,11 @@
/***********/
/* Headers */
/***********/
#include "H5private.h" /* Generic Functions */
#include "H5Eprivate.h" /* Error handling */
#include "H5MMprivate.h" /* Memory management */
#include "H5PLprivate.h" /* Plugin */
#include "H5Zprivate.h" /* Filter pipeline */
#include "H5private.h" /* Generic Functions */
#include "H5Eprivate.h" /* Error handling */
#include "H5MMprivate.h" /* Memory management */
#include "H5PLprivate.h" /* Plugin */
#include "H5Zprivate.h" /* Filter pipeline */
/****************/
@ -40,7 +40,19 @@
/* Macros for supporting
* both Windows and Unix */
/****************************/
/* Windows support */
/* Windows support
*
* SPECIAL WINDOWS NOTE
*
* Some of the Win32 API functions expand to fooA or fooW depending on
* whether UNICODE or _UNICODE are defined. You MUST explicitly use
* the A version of the functions to force char * behavior until we
* work out a scheme for proper Windows Unicode support.
*
* If you do not do this, people will be unable to incorporate our
* source code into their own CMake builds if they define UNICODE.
*/
#ifdef H5_HAVE_WIN32_API
#define H5PL_PATH_SEPARATOR ";"
@ -49,7 +61,7 @@
#define H5PL_HANDLE HINSTANCE
/* Get a handle to a plugin library. Windows: TEXT macro handles Unicode strings */
#define H5PL_OPEN_DLIB(S) LoadLibraryEx(TEXT(S), NULL, LOAD_WITH_ALTERED_SEARCH_PATH)
#define H5PL_OPEN_DLIB(S) LoadLibraryExA(S, NULL, LOAD_WITH_ALTERED_SEARCH_PATH)
/* Get the address of a symbol in dynamic library */
#define H5PL_GET_LIB_FUNC(H,N) GetProcAddress(H,N)
@ -96,9 +108,9 @@ typedef const void *(*H5PL_get_plugin_info_t)(void);
/* Type for the list of info for opened plugin libraries */
typedef struct H5PL_table_t {
H5PL_type_t pl_type; /* plugin type */
int pl_id; /* ID for the plugin */
H5PL_HANDLE handle; /* plugin handle */
H5PL_type_t pl_type; /* plugin type */
int pl_id; /* ID for the plugin */
H5PL_HANDLE handle; /* plugin handle */
} H5PL_table_t;
@ -128,8 +140,8 @@ static herr_t H5PL__close(H5PL_HANDLE handle);
/*******************/
/* Table for opened plugin libraries */
static size_t H5PL_table_alloc_g = 0;
static size_t H5PL_table_used_g = 0;
static size_t H5PL_table_alloc_g = 0;
static size_t H5PL_table_used_g = 0;
static H5PL_table_t *H5PL_table_g = NULL;
/* Table of location paths for plugin libraries */
@ -173,15 +185,15 @@ H5PL__init_interface(void)
/*-------------------------------------------------------------------------
* Function: H5PL_no_plugin
* Function: H5PL_no_plugin
*
* Purpose: Quick way for filter module to query whether to load plugin
* Purpose: Quick way for filter module to query whether to load plugin
*
* Return: TRUE: No plugin loading during data reading
* Return: TRUE: No plugin loading during data reading
*
* FALSE: Load plugin during data reading
* FALSE: Load plugin during data reading
*
* Programmer: Raymond Lu
* Programmer: Raymond Lu
* 20 February 2013
*
*-------------------------------------------------------------------------
@ -201,18 +213,18 @@ done:
/*-------------------------------------------------------------------------
* Function: H5PL_term_interface
* Function: H5PL_term_interface
*
* Purpose: Terminate the H5PL interface: release all memory, reset all
* global variables to initial values. This only happens if all
* types have been destroyed from other interfaces.
* Purpose: Terminate the H5PL interface: release all memory, reset all
* global variables to initial values. This only happens if all
* types have been destroyed from other interfaces.
*
* Return: Success: Positive if any action was taken that might
* affect some other interface; zero otherwise.
* Return: Success: Positive if any action was taken that might
* affect some other interface; zero otherwise.
*
* Failure: Negative.
* Failure: Negative.
*
* Programmer: Raymond Lu
* Programmer: Raymond Lu
* 20 February 2013
*
*-------------------------------------------------------------------------
@ -227,13 +239,13 @@ H5PL_term_interface(void)
if(H5_interface_initialize_g) {
size_t u; /* Local index variable */
/* Close opened dynamic libraries */
/* Close opened dynamic libraries */
for(u = 0; u < H5PL_table_used_g; u++)
H5PL__close((H5PL_table_g[u]).handle);
/* Free the table of dynamic libraries */
H5PL_table_g = (H5PL_table_t *)H5MM_xfree(H5PL_table_g);
H5PL_table_used_g = H5PL_table_alloc_g = 0;
/* Free the table of dynamic libraries */
H5PL_table_g = (H5PL_table_t *)H5MM_xfree(H5PL_table_g);
H5PL_table_used_g = H5PL_table_alloc_g = 0;
/* Free the table of search paths */
for(u = 0; u < H5PL_num_paths_g; u++)
@ -242,7 +254,7 @@ H5PL_term_interface(void)
H5PL_num_paths_g = 0;
H5PL_path_found_g = FALSE;
H5_interface_initialize_g = 0;
H5_interface_initialize_g = 0;
i = 1;
} /* end if */
@ -251,15 +263,15 @@ H5PL_term_interface(void)
/*-------------------------------------------------------------------------
* Function: H5PL_load
* Function: H5PL_load
*
* Purpose: Given the plugin type and identifier, this function searches
* Purpose: Given the plugin type and identifier, this function searches
* and/or loads a dynamic plugin library first among the already
* opened libraries then in the designated location paths.
*
* Return: Non-NULL on success/NULL on failure
* Return: Non-NULL on success/NULL on failure
*
* Programmer: Raymond Lu
* Programmer: Raymond Lu
* 13 February 2013
*
*-------------------------------------------------------------------------
@ -314,13 +326,13 @@ done:
/*-------------------------------------------------------------------------
* Function: H5PL__init_path_table
* Function: H5PL__init_path_table
*
* Purpose: Initialize the path table.
* Purpose: Initialize the path table.
*
* Return: Non-negative on success/Negative on failure
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
* Programmer: Quincey Koziol
* 18 March 2013
*
*-------------------------------------------------------------------------
@ -369,18 +381,18 @@ done:
/*-------------------------------------------------------------------------
* Function: H5PL__find
* Function: H5PL__find
*
* Purpose: Given a path, this function opens the directory and envokes
* another function to go through all files to find the right
* plugin library. Two function definitions are for Unix and
* Windows.
*
* Return: TRUE on success,
* Return: TRUE on success,
* FALSE on not found,
* negative on failure
*
* Programmer: Raymond Lu
* Programmer: Raymond Lu
* 13 February 2013
*
*-------------------------------------------------------------------------
@ -457,17 +469,17 @@ done:
static htri_t
H5PL__find(H5PL_type_t plugin_type, int type_id, char *dir, const void **info)
{
WIN32_FIND_DATA fdFile;
HANDLE hFind;
char *pathname = NULL;
char service[2048];
htri_t ret_value = FALSE;
WIN32_FIND_DATAA fdFile;
HANDLE hFind;
char *pathname = NULL;
char service[2048];
htri_t ret_value = FALSE;
FUNC_ENTER_STATIC
/* Specify a file mask. *.* = We want everything! */
sprintf(service, "%s\\*.dll", dir);
if((hFind = FindFirstFile(service, &fdFile)) == INVALID_HANDLE_VALUE)
if((hFind = FindFirstFileA(service, &fdFile)) == INVALID_HANDLE_VALUE)
HGOTO_ERROR(H5E_PLUGIN, H5E_OPENERROR, FAIL, "can't open directory")
do {
@ -480,7 +492,7 @@ H5PL__find(H5PL_type_t plugin_type, int type_id, char *dir, const void **info)
/* Allocate & initialize the path name */
pathname_len = HDstrlen(dir) + HDstrlen(fdFile.cFileName) + 2;
if(NULL == (pathname = (char *)H5MM_malloc(pathname_len)))
if(NULL == (pathname = (char *)H5MM_malloc(pathname_len)))
HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "can't allocate memory for path")
HDsnprintf(pathname, pathname_len, "%s\\%s", dir, fdFile.cFileName);
@ -495,10 +507,10 @@ H5PL__find(H5PL_type_t plugin_type, int type_id, char *dir, const void **info)
HGOTO_DONE(TRUE)
} /* end if */
else
HDassert(pathname);
HDassert(pathname);
pathname = (char *)H5MM_xfree(pathname);
} /* end if */
} while(FindNextFile(hFind, &fdFile)); /* Find the next file. */
} while(FindNextFileA(hFind, &fdFile)); /* Find the next file. */
done:
if(hFind)
@ -512,17 +524,17 @@ done:
/*-------------------------------------------------------------------------
* Function: H5PL__open
* Function: H5PL__open
*
* Purpose: Iterates through all files to find the right plugin library.
* It loads the dynamic plugin library and keeps it on the list
* of loaded libraries.
* of loaded libraries.
*
* Return: TRUE on success,
* Return: TRUE on success,
* FALSE on not found,
* negative on failure
*
* Programmer: Raymond Lu
* Programmer: Raymond Lu
* 13 February 2013
*
*-------------------------------------------------------------------------
@ -600,16 +612,16 @@ done:
/*-------------------------------------------------------------------------
* Function: H5PL__search_table
* Function: H5PL__search_table
*
* Purpose: Search in the list of already opened dynamic libraries
* to see if the one we are looking for is already opened.
*
* Return: TRUE on success,
* Return: TRUE on success,
* FALSE on not found,
* Negative on failure
*
* Programmer: Raymond Lu
* Programmer: Raymond Lu
* 13 February 2013
*
*-------------------------------------------------------------------------
@ -631,12 +643,12 @@ H5PL__search_table(H5PL_type_t plugin_type, int type_id, const void **info)
const H5Z_class2_t *plugin_info;
if(NULL == (get_plugin_info = (H5PL_get_plugin_info_t)H5PL_GET_LIB_FUNC((H5PL_table_g[i]).handle, "H5PLget_plugin_info")))
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTGET, FAIL, "can't get function for H5PLget_plugin_info")
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTGET, FAIL, "can't get function for H5PLget_plugin_info")
if(NULL == (plugin_info = (const H5Z_class2_t *)(*get_plugin_info)()))
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTGET, FAIL, "can't get plugin info")
if(NULL == (plugin_info = (const H5Z_class2_t *)(*get_plugin_info)()))
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTGET, FAIL, "can't get plugin info")
*info = plugin_info;
*info = plugin_info;
HGOTO_DONE(TRUE)
} /* end if */
} /* end for */
@ -648,13 +660,13 @@ done:
/*-------------------------------------------------------------------------
* Function: H5PL__close
* Function: H5PL__close
*
* Purpose: Closes the handle for dynamic library
*
* Return: Non-negative on success/Negative on failure
* Return: Non-negative on success/Negative on failure
*
* Programmer: Raymond Lu
* Programmer: Raymond Lu
* 13 February 2013
*
*-------------------------------------------------------------------------
@ -668,4 +680,3 @@ H5PL__close(H5PL_HANDLE handle)
FUNC_LEAVE_NOAPI(SUCCEED)
} /* end H5PL__close() */

View File

@ -53,7 +53,7 @@
/* Define default layout information */
#define H5D_DEF_STORAGE_COMPACT_INIT {(hbool_t)FALSE, (size_t)0, NULL}
#define H5D_DEF_STORAGE_CONTIG_INIT {HADDR_UNDEF, (hsize_t)0}
#define H5D_DEF_STORAGE_CHUNK_INIT {H5D_CHUNK_BTREE, HADDR_UNDEF, NULL, {{HADDR_UNDEF, NULL}}}
#define H5D_DEF_STORAGE_CHUNK_INIT {H5D_CHUNK_IDX_BTREE, HADDR_UNDEF, NULL, {{HADDR_UNDEF, NULL}}}
#define H5D_DEF_LAYOUT_CHUNK_INIT {(unsigned)0, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, (uint32_t)0, (hsize_t)0, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}}
#ifdef H5_HAVE_C99_DESIGNATED_INITIALIZER
#define H5D_DEF_STORAGE_COMPACT {H5D_COMPACT, { .compact = H5D_DEF_STORAGE_COMPACT_INIT }}

View File

@ -920,6 +920,7 @@ H5Pget_driver_info(hid_t plist_id)
void *ret_value; /* Return value */
FUNC_ENTER_API(NULL)
H5TRACE1("*x", "i", plist_id);
if(NULL == (plist = (H5P_genplist_t *)H5I_object_verify(plist_id, H5I_GENPROP_LST)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a property list")

View File

@ -163,6 +163,7 @@ H5Tget_member_name(hid_t type_id, unsigned membno)
char *ret_value;
FUNC_ENTER_API(NULL)
H5TRACE2("*s", "iIu", type_id, membno);
/* Check args */
if (NULL == (dt = (H5T_t *)H5I_object_verify(type_id,H5I_DATATYPE)))

View File

@ -121,6 +121,7 @@ H5Tget_tag(hid_t type_id)
char *ret_value;
FUNC_ENTER_API(NULL)
H5TRACE1("*s", "i", type_id);
/* Check args */
if (NULL == (dt = H5I_object_verify(type_id,H5I_DATATYPE)))

View File

@ -1089,7 +1089,7 @@ H5VM_array_offset_pre(unsigned n, const hsize_t *acc, const hsize_t *offset)
HDassert(offset);
/* Compute offset in array */
for (i=(int)(n-1), ret_value=0; i>=0; --i)
for(i = (int)(n - 1), ret_value = 0; i >= 0; --i)
ret_value += acc[i] * offset[i];
FUNC_LEAVE_NOAPI(ret_value)

View File

@ -217,7 +217,7 @@
#define MPE_LOG_VARS \
static int eventa(FUNC) = -1; \
static int eventb(FUNC) = -1; \
char p_event_start[100];
char p_event_start[128];
/* Hardwire the color to "red", since that's what all the routines are using
* now. In the future, if we want to change that color for a given routine,

View File

@ -94,10 +94,10 @@ extern "C" {
/* Version numbers */
#define H5_VERS_MAJOR 1 /* For major interface/format changes */
#define H5_VERS_MINOR 9 /* For minor interface/format changes */
#define H5_VERS_RELEASE 213 /* For tweaks, bug-fixes, or development */
#define H5_VERS_RELEASE 215 /* For tweaks, bug-fixes, or development */
#define H5_VERS_SUBRELEASE "" /* For pre-releases like snap0 */
/* Empty string for real releases. */
#define H5_VERS_INFO "HDF5 library version: 1.9.213" /* Full version string */
#define H5_VERS_INFO "HDF5 library version: 1.9.215" /* Full version string */
#define H5check() H5check_version(H5_VERS_MAJOR,H5_VERS_MINOR, \
H5_VERS_RELEASE)

View File

@ -1,4 +1,4 @@
cmake_minimum_required (VERSION 2.8.11)
cmake_minimum_required (VERSION 3.1.0)
PROJECT (HDF5_TEST)
#-----------------------------------------------------------------------------

View File

@ -1,4 +1,4 @@
cmake_minimum_required (VERSION 2.8.11)
cmake_minimum_required (VERSION 3.1.0)
PROJECT (HDF5_TEST_PAR)
#-----------------------------------------------------------------------------

View File

@ -101,13 +101,17 @@ check_file(char* name, hid_t fapl)
if(H5Dclose(dset) < 0) goto error;
if(H5Fclose(file) < 0) goto error;
if(H5Pclose(plist) < 0) goto error;
if(H5Sclose(space) < 0) goto error;
return 0;
error:
H5E_BEGIN_TRY {
H5Fclose(file);
H5Pclose(plist);
H5Gclose(groups);
H5Dclose(dset);
H5Fclose(file);
H5Sclose(space);
} H5E_END_TRY;
return 1;
}
@ -205,6 +209,9 @@ main(int argc, char* argv[])
puts(" Test not compatible with current Virtual File Driver");
}
/* close HDF5 library */
H5close();
MPI_Finalize();
return 0;

View File

@ -1,4 +1,4 @@
cmake_minimum_required (VERSION 2.8.11)
cmake_minimum_required (VERSION 3.1.0)
PROJECT (HDF5_TOOLS)
#-----------------------------------------------------------------------------

View File

@ -1,4 +1,4 @@
cmake_minimum_required (VERSION 2.8.11)
cmake_minimum_required (VERSION 3.1.0)
PROJECT (HDF5_TOOLS_H5COPY)
#-----------------------------------------------------------------------------

View File

@ -1,4 +1,4 @@
cmake_minimum_required (VERSION 2.8.11)
cmake_minimum_required (VERSION 3.1.0)
PROJECT (HDF5_TOOLS_H5DIFF)
#-----------------------------------------------------------------------------

View File

@ -1,4 +1,4 @@
cmake_minimum_required (VERSION 2.8.11)
cmake_minimum_required (VERSION 3.1.0)
PROJECT (HDF5_TOOLS_H5DUMP)
#-----------------------------------------------------------------------------

View File

@ -1,4 +1,4 @@
cmake_minimum_required (VERSION 2.8.11)
cmake_minimum_required (VERSION 3.1.0)
PROJECT (HDF5_TOOLS_H5IMPORT)
#-----------------------------------------------------------------------------

View File

@ -1,4 +1,4 @@
cmake_minimum_required (VERSION 2.8.11)
cmake_minimum_required (VERSION 3.1.0)
PROJECT (HDF5_TOOLS_H5JAM)
#-----------------------------------------------------------------------------

Some files were not shown because too many files have changed in this diff Show More