mirror of
https://github.com/HDFGroup/hdf5.git
synced 2025-01-18 15:15:56 +08:00
HDFFV-9724 Corrected files and verified tests
This commit is contained in:
parent
732074d47e
commit
bd34c9e455
@ -631,6 +631,7 @@ if (HDF5_ENABLE_PARALLEL)
|
||||
# Used by Fortran + MPI
|
||||
CHECK_SYMBOL_EXISTS (MPI_Comm_c2f "${MPI_C_INCLUDE_DIRS}/mpi.h" H5_HAVE_MPI_MULTI_LANG_Comm)
|
||||
CHECK_SYMBOL_EXISTS (MPI_Info_c2f "${MPI_C_INCLUDE_DIRS}/mpi.h" H5_HAVE_MPI_MULTI_LANG_Info)
|
||||
INCLUDE_DIRECTORIES (${MPI_C_INCLUDE_DIRS})
|
||||
else ()
|
||||
message (STATUS "Parallel libraries not found")
|
||||
endif ()
|
||||
@ -639,7 +640,6 @@ endif ()
|
||||
# Parallel IO usage requires MPI to be Linked and Included
|
||||
if (H5_HAVE_PARALLEL)
|
||||
set (LINK_LIBS ${LINK_LIBS} ${MPI_C_LIBRARIES})
|
||||
set (LINK_SHARED_LIBS ${LINK_SHARED_LIBS} ${MPI_C_LIBRARIES})
|
||||
if (MPI_C_LINK_FLAGS)
|
||||
set (CMAKE_EXE_LINKER_FLAGS "${MPI_C_LINK_FLAGS} ${CMAKE_EXE_LINKER_FLAGS}")
|
||||
endif ()
|
||||
@ -864,7 +864,6 @@ if (EXISTS "${HDF5_SOURCE_DIR}/fortran" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/for
|
||||
|
||||
include (${HDF_RESOURCES_DIR}/HDF5UseFortran.cmake)
|
||||
set (LINK_Fortran_LIBS ${LINK_LIBS})
|
||||
set (LINK_Fortran_SHARED_LIBS ${LINK_SHARED_LIBS})
|
||||
|
||||
if (HDF5_ENABLE_F2003)
|
||||
if (NOT FORTRAN_HAVE_ISO_C_BINDING)
|
||||
@ -875,7 +874,6 @@ if (EXISTS "${HDF5_SOURCE_DIR}/fortran" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/for
|
||||
# Parallel IO usage requires MPI to be Linked and Included
|
||||
if (H5_HAVE_PARALLEL)
|
||||
set (LINK_Fortran_LIBS ${LINK_Fortran_LIBS} ${MPI_Fortran_LIBRARIES})
|
||||
set (LINK_Fortran_SHARED_LIBS ${LINK_Fortran_SHARED_LIBS} ${MPI_Fortran_LIBRARIES})
|
||||
if (MPI_Fortran_LINK_FLAGS)
|
||||
set (CMAKE_Fortran_EXE_LINKER_FLAGS "${MPI_Fortran_LINK_FLAGS} ${CMAKE_EXE_LINKER_FLAGS}")
|
||||
endif ()
|
||||
|
6
MANIFEST
6
MANIFEST
@ -1430,6 +1430,12 @@
|
||||
./tools/test/h5ls/h5ls_plugin.sh.in
|
||||
./tools/test/h5ls/testh5ls.sh.in
|
||||
./tools/test/h5ls/testh5lsvds.sh.in
|
||||
./tools/test/h5ls/vds_prefix/tvds-1.ls
|
||||
./tools/test/h5ls/vds_prefix/tvds-2.ls
|
||||
./tools/test/h5ls/vds_prefix/tvds-3_1.ls
|
||||
./tools/test/h5ls/vds_prefix/tvds-3_2.ls
|
||||
./tools/test/h5ls/vds_prefix/tvds-4.ls
|
||||
./tools/test/h5ls/vds_prefix/tvds-5.ls
|
||||
|
||||
# h5copy sources
|
||||
./tools/src/h5copy/Makefile.am
|
||||
|
@ -347,7 +347,7 @@ function (_MPI_check_compiler LANG QUERY_FLAG OUTPUT_VARIABLE RESULT_VARIABLE)
|
||||
# library that has invalid or missing version information there would be warning
|
||||
# messages emitted by ld.so in the compiler output. In either case, we'll treat
|
||||
# the output as invalid.
|
||||
if("${WRAPPER_OUTPUT}" MATCHES "undefined reference|unrecognized|need to set|no version information available")
|
||||
if("${WRAPPER_OUTPUT}" MATCHES "undefined reference|unrecognized|need to set|no version information available|command not found")
|
||||
set(WRAPPER_RETURN 255)
|
||||
endif()
|
||||
# Ensure that no error output might be passed upwards.
|
||||
@ -615,6 +615,16 @@ function (_MPI_interrogate_compiler lang)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(MPI_${LANG}_EXTRA_COMPILE_DEFINITIONS)
|
||||
list(APPEND MPI_COMPILE_DEFINITIONS_WORK "${MPI_${LANG}_EXTRA_COMPILE_DEFINITIONS}")
|
||||
endif()
|
||||
if(MPI_${LANG}_EXTRA_COMPILE_OPTIONS)
|
||||
list(APPEND MPI_COMPILE_OPTIONS_WORK "${MPI_${LANG}_EXTRA_COMPILE_OPTIONS}")
|
||||
endif()
|
||||
if(MPI_${LANG}_EXTRA_LIB_NAMES)
|
||||
list(APPEND MPI_PLAIN_LIB_NAMES_WORK "${MPI_${LANG}_EXTRA_LIB_NAMES}")
|
||||
endif()
|
||||
|
||||
# If we found MPI, set up all of the appropriate cache entries
|
||||
if(NOT MPI_${LANG}_COMPILE_OPTIONS)
|
||||
set(MPI_${LANG}_COMPILE_OPTIONS ${MPI_COMPILE_OPTIONS_WORK} CACHE STRING "MPI ${LANG} compilation options" FORCE)
|
||||
@ -823,33 +833,43 @@ endfunction()
|
||||
|
||||
macro(_MPI_assemble_libraries LANG)
|
||||
set(MPI_${LANG}_LIBRARIES "")
|
||||
foreach(mpilib IN LISTS MPI_${LANG}_LIB_NAMES)
|
||||
list(APPEND MPI_${LANG}_LIBRARIES ${MPI_${mpilib}_LIBRARY})
|
||||
endforeach()
|
||||
endmacro()
|
||||
|
||||
macro(_MPI_assemble_include_dirs LANG)
|
||||
set(MPI_${LANG}_INCLUDE_DIRS "${MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS}")
|
||||
if("${LANG}" MATCHES "(C|CXX)")
|
||||
if(MPI_${LANG}_HEADER_DIR)
|
||||
list(APPEND MPI_${LANG}_INCLUDE_DIRS "${MPI_${LANG}_HEADER_DIR}")
|
||||
endif()
|
||||
else() # Fortran
|
||||
if(MPI_${LANG}_F77_HEADER_DIR)
|
||||
list(APPEND MPI_${LANG}_INCLUDE_DIRS "${MPI_${LANG}_F77_HEADER_DIR}")
|
||||
endif()
|
||||
if(MPI_${LANG}_MODULE_DIR AND NOT "${MPI_${LANG}_MODULE_DIR}" IN_LIST MPI_${LANG}_INCLUDE_DIRS)
|
||||
list(APPEND MPI_${LANG}_INCLUDE_DIRS "${MPI_${LANG}_MODULE_DIR}")
|
||||
endif()
|
||||
endif()
|
||||
if(MPI_${LANG}_ADDITIONAL_INCLUDE_VARS)
|
||||
foreach(mpiadditionalinclude IN LISTS MPI_${LANG}_ADDITIONAL_INCLUDE_VARS)
|
||||
list(APPEND MPI_${LANG}_INCLUDE_DIRS "${MPI_${mpiadditionalinclude}_INCLUDE_DIR}")
|
||||
# Only for libraries do we need to check whether the compiler's linking stage is separate.
|
||||
if(NOT "${MPI_${LANG}_COMPILER}" STREQUAL "${CMAKE_${LANG}_COMPILER}" OR NOT MPI_${LANG}_WORKS_IMPLICIT)
|
||||
foreach(mpilib IN LISTS MPI_${LANG}_LIB_NAMES)
|
||||
list(APPEND MPI_${LANG}_LIBRARIES ${MPI_${mpilib}_LIBRARY})
|
||||
endforeach()
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
macro(_MPI_assemble_include_dirs LANG)
|
||||
if("${MPI_${LANG}_COMPILER}" STREQUAL "${CMAKE_${LANG}_COMPILER}")
|
||||
set(MPI_${LANG}_INCLUDE_DIRS "")
|
||||
else()
|
||||
set(MPI_${LANG}_INCLUDE_DIRS "${MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS}")
|
||||
if("${LANG}" MATCHES "(C|CXX)")
|
||||
if(MPI_${LANG}_HEADER_DIR)
|
||||
list(APPEND MPI_${LANG}_INCLUDE_DIRS "${MPI_${LANG}_HEADER_DIR}")
|
||||
endif()
|
||||
else() # Fortran
|
||||
if(MPI_${LANG}_F77_HEADER_DIR)
|
||||
list(APPEND MPI_${LANG}_INCLUDE_DIRS "${MPI_${LANG}_F77_HEADER_DIR}")
|
||||
endif()
|
||||
if(MPI_${LANG}_MODULE_DIR AND NOT "${MPI_${LANG}_MODULE_DIR}" IN_LIST MPI_${LANG}_INCLUDE_DIRS)
|
||||
list(APPEND MPI_${LANG}_INCLUDE_DIRS "${MPI_${LANG}_MODULE_DIR}")
|
||||
endif()
|
||||
endif()
|
||||
if(MPI_${LANG}_ADDITIONAL_INCLUDE_VARS)
|
||||
foreach(MPI_ADDITIONAL_INC_DIR IN LISTS MPI_${LANG}_ADDITIONAL_INCLUDE_VARS)
|
||||
list(APPEND MPI_${LANG}_INCLUDE_DIRS "${MPI_${MPI_ADDITIONAL_INC_DIR}_INCLUDE_DIR}")
|
||||
endforeach()
|
||||
endif()
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
function(_MPI_split_include_dirs LANG)
|
||||
if("${MPI_${LANG}_COMPILER}" STREQUAL "${CMAKE_${LANG}_COMPILER}")
|
||||
return()
|
||||
endif()
|
||||
# Backwards compatibility: Search INCLUDE_PATH if given.
|
||||
if(MPI_${LANG}_INCLUDE_PATH)
|
||||
list(APPEND MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS "${MPI_${LANG}_INCLUDE_PATH}")
|
||||
@ -885,6 +905,13 @@ function(_MPI_split_include_dirs LANG)
|
||||
endif()
|
||||
mark_as_advanced(MPI_${LANG}_F77_HEADER_DIR MPI_${LANG}_MODULE_DIR)
|
||||
endif()
|
||||
# Remove duplicates and default system directories from the list.
|
||||
if(MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS)
|
||||
list(REMOVE_DUPLICATES MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS)
|
||||
foreach(MPI_IMPLICIT_INC_DIR IN LISTS CMAKE_${LANG}_IMPLICIT_LINK_DIRECTORIES)
|
||||
list(REMOVE_ITEM MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS ${MPI_IMPLICIT_INC_DIR})
|
||||
endforeach()
|
||||
endif()
|
||||
set(MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS ${MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS} CACHE STRING "MPI ${LANG} additional include directories" FORCE)
|
||||
endfunction()
|
||||
|
||||
@ -1014,7 +1041,7 @@ elseif("${CMAKE_HOST_SYSTEM_NAME}" STREQUAL "Windows")
|
||||
elseif("${CMAKE_HOST_SYSTEM_NAME}" STREQUAL "FreeBSD")
|
||||
# FreeBSD ships mpich under the normal system paths - but available openmpi implementations
|
||||
# will be found in /usr/local/mpi/<name>
|
||||
MPI_search_mpi_prefix_folder("/usr/local/mpi/")
|
||||
MPI_search_mpi_prefix_folder("/usr/local/mpi")
|
||||
endif()
|
||||
|
||||
# Most MPI distributions have some form of mpiexec or mpirun which gives us something we can look for.
|
||||
@ -1050,48 +1077,54 @@ mark_as_advanced(MPIEXEC_EXECUTABLE MPIEXEC_NUMPROC_FLAG MPIEXEC_PREFLAGS MPIEXE
|
||||
#
|
||||
# Once we find the new variables, we translate them back into their old
|
||||
# equivalents below.
|
||||
foreach (LANG IN ITEMS C CXX)
|
||||
# Old input variables.
|
||||
set(_MPI_OLD_INPUT_VARS COMPILER COMPILE_FLAGS INCLUDE_PATH LINK_FLAGS)
|
||||
if(NOT MPI_IGNORE_LEGACY_VARIABLES)
|
||||
foreach (LANG IN ITEMS C CXX)
|
||||
# Old input variables.
|
||||
set(_MPI_OLD_INPUT_VARS COMPILER COMPILE_FLAGS INCLUDE_PATH LINK_FLAGS)
|
||||
|
||||
# Set new vars based on their old equivalents, if the new versions are not already set.
|
||||
foreach (var ${_MPI_OLD_INPUT_VARS})
|
||||
if (NOT MPI_${LANG}_${var} AND MPI_${var})
|
||||
set(MPI_${LANG}_${var} "${MPI_${var}}")
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
# Chop the old compile flags into options and definitions
|
||||
if(MPI_${LANG}_COMPILE_FLAGS)
|
||||
unset(MPI_${LANG}_COMPILE_OPTIONS)
|
||||
unset(MPI_${LANG}_COMPILE_DEFINITIONS)
|
||||
separate_arguments(MPI_SEPARATE_FLAGS NATIVE_COMMAND "${MPI_${LANG}_COMPILE_FLAGS}")
|
||||
foreach(_MPI_FLAG IN LISTS MPI_SEPARATE_FLAGS)
|
||||
if("${_MPI_FLAG}" MATCHES "^ *[-/D]([^ ]+)")
|
||||
list(APPEND MPI_${LANG}_COMPILE_DEFINITIONS "${CMAKE_MATCH_1}")
|
||||
else()
|
||||
list(APPEND MPI_${LANG}_COMPILE_FLAGS "${_MPI_FLAG}")
|
||||
# Set new vars based on their old equivalents, if the new versions are not already set.
|
||||
foreach (var ${_MPI_OLD_INPUT_VARS})
|
||||
if (NOT MPI_${LANG}_${var} AND MPI_${var})
|
||||
set(MPI_${LANG}_${var} "${MPI_${var}}")
|
||||
endif()
|
||||
endforeach()
|
||||
unset(MPI_SEPARATE_FLAGS)
|
||||
endif()
|
||||
|
||||
# If a list of libraries was given, we'll split it into new-style cache variables
|
||||
if(NOT MPI_${LANG}_LIB_NAMES)
|
||||
foreach(_MPI_LIB IN LISTS MPI_${LANG}_LIBRARIES MPI_LIBRARY MPI_EXTRA_LIBRARY)
|
||||
get_filename_component(_MPI_PLAIN_LIB_NAME "${_MPI_LIB}" NAME_WE)
|
||||
get_filename_component(_MPI_LIB_NAME "${_MPI_LIB}" NAME)
|
||||
get_filename_component(_MPI_LIB_DIR "${_MPI_LIB}" DIRECTORY)
|
||||
list(APPEND MPI_PLAIN_LIB_NAMES_WORK "${_MPI_PLAIN_LIB_NAME}")
|
||||
find_library(MPI_${_MPI_PLAIN_LIB_NAME}_LIBRARY
|
||||
NAMES "${_MPI_LIB_NAME}" "lib${_MPI_LIB_NAME}"
|
||||
HINTS ${_MPI_LIB_DIR} $ENV{MPI_LIB}
|
||||
DOC "Location of the ${_MPI_PLAIN_LIB_NAME} library for MPI"
|
||||
)
|
||||
mark_as_advanced(MPI_${_MPI_PLAIN_LIB_NAME}_LIBRARY)
|
||||
endforeach()
|
||||
endif()
|
||||
endforeach()
|
||||
# Chop the old compile flags into options and definitions
|
||||
|
||||
unset(MPI_${LANG}_EXTRA_COMPILE_DEFINITIONS)
|
||||
unset(MPI_${LANG}_EXTRA_COMPILE_OPTIONS)
|
||||
if(MPI_${LANG}_COMPILE_FLAGS)
|
||||
separate_arguments(MPI_SEPARATE_FLAGS NATIVE_COMMAND "${MPI_${LANG}_COMPILE_FLAGS}")
|
||||
foreach(_MPI_FLAG IN LISTS MPI_SEPARATE_FLAGS)
|
||||
if("${_MPI_FLAG}" MATCHES "^ *[-/D]([^ ]+)")
|
||||
list(APPEND MPI_${LANG}_EXTRA_COMPILE_DEFINITIONS "${CMAKE_MATCH_1}")
|
||||
else()
|
||||
list(APPEND MPI_${LANG}_EXTRA_COMPILE_OPTIONS "${_MPI_FLAG}")
|
||||
endif()
|
||||
endforeach()
|
||||
unset(MPI_SEPARATE_FLAGS)
|
||||
endif()
|
||||
|
||||
# If a list of libraries was given, we'll split it into new-style cache variables
|
||||
unset(MPI_${LANG}_EXTRA_LIB_NAMES)
|
||||
if(NOT MPI_${LANG}_LIB_NAMES)
|
||||
foreach(_MPI_LIB IN LISTS MPI_${LANG}_LIBRARIES MPI_LIBRARY MPI_EXTRA_LIBRARY)
|
||||
if(_MPI_LIB)
|
||||
get_filename_component(_MPI_PLAIN_LIB_NAME "${_MPI_LIB}" NAME_WE)
|
||||
get_filename_component(_MPI_LIB_NAME "${_MPI_LIB}" NAME)
|
||||
get_filename_component(_MPI_LIB_DIR "${_MPI_LIB}" DIRECTORY)
|
||||
list(APPEND MPI_${LANG}_EXTRA_LIB_NAMES "${_MPI_PLAIN_LIB_NAME}")
|
||||
find_library(MPI_${_MPI_PLAIN_LIB_NAME}_LIBRARY
|
||||
NAMES "${_MPI_LIB_NAME}" "lib${_MPI_LIB_NAME}"
|
||||
HINTS ${_MPI_LIB_DIR} $ENV{MPI_LIB}
|
||||
DOC "Location of the ${_MPI_PLAIN_LIB_NAME} library for MPI"
|
||||
)
|
||||
mark_as_advanced(MPI_${_MPI_PLAIN_LIB_NAME}_LIBRARY)
|
||||
endif()
|
||||
endforeach()
|
||||
endif()
|
||||
endforeach()
|
||||
endif()
|
||||
#=============================================================================
|
||||
|
||||
unset(MPI_VERSION)
|
||||
@ -1100,6 +1133,11 @@ unset(MPI_VERSION_MINOR)
|
||||
|
||||
unset(_MPI_MIN_VERSION)
|
||||
|
||||
# If the user specified a library name we assume they prefer that library over a wrapper. If not, they can disable skipping manually.
|
||||
if(NOT DEFINED MPI_SKIP_COMPILER_WRAPPER AND MPI_GUESS_LIBRARY_NAME)
|
||||
set(MPI_SKIP_COMPILER_WRAPPER TRUE)
|
||||
endif()
|
||||
|
||||
# This loop finds the compilers and sends them off for interrogation.
|
||||
foreach(LANG IN ITEMS C CXX Fortran)
|
||||
if(CMAKE_${LANG}_COMPILER_LOADED)
|
||||
@ -1121,6 +1159,8 @@ foreach(LANG IN ITEMS C CXX Fortran)
|
||||
mark_as_advanced(MPI_CXX_SKIP_MPICXX)
|
||||
endif()
|
||||
if(NOT (MPI_${LANG}_LIB_NAMES AND (MPI_${LANG}_INCLUDE_PATH OR MPI_${LANG}_INCLUDE_DIRS OR MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS)))
|
||||
set(MPI_${LANG}_TRIED_IMPLICIT FALSE)
|
||||
set(MPI_${LANG}_WORKS_IMPLICIT FALSE)
|
||||
if(NOT MPI_${LANG}_COMPILER AND NOT MPI_ASSUME_NO_BUILTIN_MPI)
|
||||
# Should the imported targets be empty, we effectively try whether the compiler supports MPI on its own, which is the case on e.g.
|
||||
# Cray PrgEnv.
|
||||
@ -1130,80 +1170,90 @@ foreach(LANG IN ITEMS C CXX Fortran)
|
||||
# If the compiler can build MPI code on its own, it functions as an MPI compiler and we'll set the variable to point to it.
|
||||
if(MPI_${LANG}_WORKS)
|
||||
set(MPI_${LANG}_COMPILER "${CMAKE_${LANG}_COMPILER}" CACHE FILEPATH "MPI compiler for ${LANG}" FORCE)
|
||||
set(MPI_${LANG}_WORKS_IMPLICIT TRUE)
|
||||
endif()
|
||||
set(MPI_${LANG}_TRIED_IMPLICIT TRUE)
|
||||
endif()
|
||||
|
||||
# If the user specified a library name we assume they prefer that library over a wrapper. If not, they can disable skipping manually.
|
||||
if(NOT DEFINED MPI_SKIP_COMPILER_WRAPPER AND MPI_GUESS_LIBRARY_NAME)
|
||||
set(MPI_SKIP_COMPILER_WRAPPER TRUE)
|
||||
endif()
|
||||
if(NOT MPI_SKIP_COMPILER_WRAPPER)
|
||||
if(MPI_${LANG}_COMPILER)
|
||||
# If the user supplies a compiler *name* instead of an absolute path, assume that we need to find THAT compiler.
|
||||
if (NOT IS_ABSOLUTE "${MPI_${LANG}_COMPILER}")
|
||||
# Get rid of our default list of names and just search for the name the user wants.
|
||||
set(_MPI_${LANG}_COMPILER_NAMES "${MPI_${LANG}_COMPILER}")
|
||||
unset(MPI_${LANG}_COMPILER CACHE)
|
||||
if(NOT "${MPI_${LANG}_COMPILER}" STREQUAL "${CMAKE_${LANG}_COMPILER}" OR NOT MPI_${LANG}_WORKS)
|
||||
set(MPI_${LANG}_WRAPPER_FOUND FALSE)
|
||||
set(MPI_PINNED_COMPILER FALSE)
|
||||
|
||||
if(NOT MPI_SKIP_COMPILER_WRAPPER)
|
||||
if(MPI_${LANG}_COMPILER)
|
||||
# If the user supplies a compiler *name* instead of an absolute path, assume that we need to find THAT compiler.
|
||||
if (NOT IS_ABSOLUTE "${MPI_${LANG}_COMPILER}")
|
||||
# Get rid of our default list of names and just search for the name the user wants.
|
||||
set(_MPI_${LANG}_COMPILER_NAMES "${MPI_${LANG}_COMPILER}")
|
||||
unset(MPI_${LANG}_COMPILER CACHE)
|
||||
endif()
|
||||
# If the user specifies a compiler, we don't want to try to search libraries either.
|
||||
set(MPI_PINNED_COMPILER TRUE)
|
||||
endif()
|
||||
# If the user specifies a compiler, we don't want to try to search libraries either.
|
||||
set(MPI_PINNED_COMPILER TRUE)
|
||||
else()
|
||||
set(MPI_PINNED_COMPILER FALSE)
|
||||
endif()
|
||||
|
||||
# If we have an MPI base directory, we'll try all compiler names in that one first.
|
||||
# This should prevent mixing different MPI environments
|
||||
if(_MPI_BASE_DIR)
|
||||
# If we have an MPI base directory, we'll try all compiler names in that one first.
|
||||
# This should prevent mixing different MPI environments
|
||||
if(_MPI_BASE_DIR)
|
||||
find_program(MPI_${LANG}_COMPILER
|
||||
NAMES ${_MPI_${LANG}_COMPILER_NAMES}
|
||||
PATH_SUFFIXES bin sbin
|
||||
HINTS ${_MPI_BASE_DIR}
|
||||
NO_DEFAULT_PATH
|
||||
DOC "MPI compiler for ${LANG}"
|
||||
)
|
||||
endif()
|
||||
|
||||
# If the base directory did not help (for example because the mpiexec isn't in the same directory as the compilers),
|
||||
# we shall try searching in the default paths.
|
||||
find_program(MPI_${LANG}_COMPILER
|
||||
NAMES ${_MPI_${LANG}_COMPILER_NAMES}
|
||||
PATH_SUFFIXES bin sbin
|
||||
HINTS ${_MPI_BASE_DIR}
|
||||
NO_DEFAULT_PATH
|
||||
DOC "MPI compiler for ${LANG}"
|
||||
)
|
||||
|
||||
if("${MPI_${LANG}_COMPILER}" STREQUAL "${CMAKE_${LANG}_COMPILER}")
|
||||
set(MPI_PINNED_COMPILER TRUE)
|
||||
|
||||
# If we haven't made the implicit compiler test yet, perform it now.
|
||||
if(NOT MPI_${LANG}_TRIED_IMPLICIT)
|
||||
_MPI_create_imported_target(${LANG})
|
||||
_MPI_check_lang_works(${LANG})
|
||||
endif()
|
||||
|
||||
# Should the MPI compiler not work implicitly for MPI, still interrogate it.
|
||||
# Otherwise, MPI compilers for which CMake has separate linking stages, e.g. Intel MPI on Windows where link.exe is being used
|
||||
# directly during linkage instead of CMAKE_<LANG>_COMPILER will not work.
|
||||
if(NOT MPI_${LANG}_WORKS)
|
||||
set(MPI_${LANG}_WORKS_IMPLICIT FALSE)
|
||||
_MPI_interrogate_compiler(${LANG})
|
||||
else()
|
||||
set(MPI_${LANG}_WORKS_IMPLICIT TRUE)
|
||||
endif()
|
||||
elseif(MPI_${LANG}_COMPILER)
|
||||
_MPI_interrogate_compiler(${LANG})
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# If the base directory did not help (for example because the mpiexec isn't in the same directory as the compilers),
|
||||
# we shall try searching in the default paths.
|
||||
find_program(MPI_${LANG}_COMPILER
|
||||
NAMES ${_MPI_${LANG}_COMPILER_NAMES}
|
||||
PATH_SUFFIXES bin sbin
|
||||
DOC "MPI compiler for ${LANG}"
|
||||
)
|
||||
|
||||
if(MPI_${LANG}_COMPILER STREQUAL CMAKE_${LANG}_COMPILER)
|
||||
set(MPI_SKIP_GUESSING TRUE)
|
||||
elseif(MPI_${LANG}_COMPILER)
|
||||
_MPI_interrogate_compiler(${LANG})
|
||||
else()
|
||||
set(MPI_${LANG}_WRAPPER_FOUND FALSE)
|
||||
endif()
|
||||
else()
|
||||
set(MPI_${LANG}_WRAPPER_FOUND FALSE)
|
||||
set(MPI_PINNED_COMPILER FALSE)
|
||||
endif()
|
||||
|
||||
if(NOT MPI_${LANG}_WRAPPER_FOUND AND NOT MPI_PINNED_COMPILER)
|
||||
# For C++, we may use the settings for C. Should a given compiler wrapper for C++ not exist, but one for C does, we copy over the
|
||||
# settings for C. An MPI distribution that is in this situation would be IBM Platform MPI.
|
||||
if("${LANG}" STREQUAL "CXX" AND MPI_C_WRAPPER_FOUND)
|
||||
set(MPI_${LANG}_COMPILE_OPTIONS ${MPI_C_COMPILE_OPTIONS} CACHE STRING "MPI ${LANG} compilation options" )
|
||||
set(MPI_${LANG}_COMPILE_DEFINITIONS ${MPI_C_COMPILE_DEFINITIONS} CACHE STRING "MPI ${LANG} compilation definitions" )
|
||||
set(MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS ${MPI_C_INCLUDE_DIRS} CACHE STRING "MPI ${LANG} additional include directories")
|
||||
set(MPI_${LANG}_LINK_FLAGS ${MPI_C_LINK_FLAGS} CACHE STRING "MPI ${LANG} linker flags" )
|
||||
set(MPI_${LANG}_LIB_NAMES ${MPI_C_LIB_NAMES} CACHE STRING "MPI ${LANG} libraries to link against" )
|
||||
set(MPI_${LANG}_WRAPPER_FOUND TRUE)
|
||||
elseif(NOT MPI_SKIP_GUESSING)
|
||||
_MPI_guess_settings(${LANG})
|
||||
if(NOT MPI_SKIP_GUESSING AND NOT MPI_${LANG}_WRAPPER_FOUND AND NOT MPI_PINNED_COMPILER)
|
||||
# For C++, we may use the settings for C. Should a given compiler wrapper for C++ not exist, but one for C does, we copy over the
|
||||
# settings for C. An MPI distribution that is in this situation would be IBM Platform MPI.
|
||||
if("${LANG}" STREQUAL "CXX" AND MPI_C_WRAPPER_FOUND)
|
||||
set(MPI_${LANG}_COMPILE_OPTIONS ${MPI_C_COMPILE_OPTIONS} CACHE STRING "MPI ${LANG} compilation options" )
|
||||
set(MPI_${LANG}_COMPILE_DEFINITIONS ${MPI_C_COMPILE_DEFINITIONS} CACHE STRING "MPI ${LANG} compilation definitions" )
|
||||
set(MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS ${MPI_C_INCLUDE_DIRS} CACHE STRING "MPI ${LANG} additional include directories")
|
||||
set(MPI_${LANG}_LINK_FLAGS ${MPI_C_LINK_FLAGS} CACHE STRING "MPI ${LANG} linker flags" )
|
||||
set(MPI_${LANG}_LIB_NAMES ${MPI_C_LIB_NAMES} CACHE STRING "MPI ${LANG} libraries to link against" )
|
||||
else()
|
||||
_MPI_guess_settings(${LANG})
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
_MPI_split_include_dirs(${LANG})
|
||||
if(NOT MPI_${LANG}_COMPILER STREQUAL CMAKE_${LANG}_COMPILER)
|
||||
_MPI_assemble_include_dirs(${LANG})
|
||||
_MPI_assemble_libraries(${LANG})
|
||||
endif()
|
||||
_MPI_assemble_include_dirs(${LANG})
|
||||
_MPI_assemble_libraries(${LANG})
|
||||
|
||||
_MPI_adjust_compile_definitions(${LANG})
|
||||
# We always create imported targets even if they're empty
|
||||
_MPI_create_imported_target(${LANG})
|
||||
@ -1217,7 +1267,9 @@ foreach(LANG IN ITEMS C CXX Fortran)
|
||||
set(MPI_${LANG}_COMPILE_DEFINITIONS "" CACHE STRING "MPI ${LANG} compilation definitions" )
|
||||
set(MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS "" CACHE STRING "MPI ${LANG} additional include directories")
|
||||
set(MPI_${LANG}_LINK_FLAGS "" CACHE STRING "MPI ${LANG} linker flags" )
|
||||
set(MPI_${LANG}_LIB_NAMES "" CACHE STRING "MPI ${LANG} libraries to link against" )
|
||||
if(NOT MPI_${LANG}_COMPILER STREQUAL CMAKE_${LANG}_COMPILER)
|
||||
set(MPI_${LANG}_LIB_NAMES "" CACHE STRING "MPI ${LANG} libraries to link against" )
|
||||
endif()
|
||||
mark_as_advanced(MPI_${LANG}_COMPILE_OPTIONS MPI_${LANG}_COMPILE_DEFINITIONS MPI_${LANG}_LINK_FLAGS
|
||||
MPI_${LANG}_LIB_NAMES MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS MPI_${LANG}_COMPILER)
|
||||
|
||||
@ -1337,7 +1389,7 @@ foreach(LANG IN ITEMS C CXX Fortran)
|
||||
set(MPI_${LANG}_FIND_VERSION_EXACT ${MPI_FIND_VERSION_EXACT})
|
||||
|
||||
unset(MPI_${LANG}_REQUIRED_VARS)
|
||||
if (MPI_${LANG}_WRAPPER_FOUND OR MPI_${LANG}_GUESS_FOUND)
|
||||
if (NOT "${MPI_${LANG}_COMPILER}" STREQUAL "${CMAKE_${LANG}_COMPILER}")
|
||||
foreach(mpilibname IN LISTS MPI_${LANG}_LIB_NAMES)
|
||||
list(APPEND MPI_${LANG}_REQUIRED_VARS "MPI_${mpilibname}_LIBRARY")
|
||||
endforeach()
|
||||
@ -1448,6 +1500,7 @@ if (MPI_NUMLIBS GREATER 1)
|
||||
else()
|
||||
set(MPI_EXTRA_LIBRARY "MPI_EXTRA_LIBRARY-NOTFOUND")
|
||||
endif()
|
||||
set(MPI_IGNORE_LEGACY_VARIABLES TRUE)
|
||||
#=============================================================================
|
||||
|
||||
# unset these vars to cleanup namespace
|
||||
|
@ -55,6 +55,7 @@ endif ()
|
||||
|
||||
if (TEST_ENV_VAR)
|
||||
set (ENV{${TEST_ENV_VAR}} "${TEST_ENV_VALUE}")
|
||||
#message (STATUS "ENV:${TEST_ENV_VAR}=$ENV{${TEST_ENV_VAR}}")
|
||||
endif ()
|
||||
|
||||
if (NOT TEST_INPUT)
|
||||
|
@ -63,13 +63,13 @@ if (H5_HAVE_PARALLEL)
|
||||
add_executable (ph5example ${HDF5_EXAMPLES_SOURCE_DIR}/ph5example.c)
|
||||
TARGET_NAMING (ph5example STATIC)
|
||||
TARGET_C_PROPERTIES (ph5example STATIC " " " ")
|
||||
target_link_libraries (ph5example ${HDF5_LIB_TARGET})
|
||||
target_link_libraries (ph5example ${HDF5_LIB_TARGET} ${MPI_C_LIBRARIES})
|
||||
set_target_properties (ph5example PROPERTIES FOLDER examples)
|
||||
if (BUILD_SHARED_LIBS)
|
||||
add_executable (ph5example-shared ${HDF5_EXAMPLES_SOURCE_DIR}/ph5example.c)
|
||||
TARGET_NAMING (ph5example-shared SHARED)
|
||||
TARGET_C_PROPERTIES (ph5example-shared SHARED " " " ")
|
||||
target_link_libraries (ph5example-shared ${HDF5_LIBSH_TARGET})
|
||||
target_link_libraries (ph5example-shared ${HDF5_LIBSH_TARGET} ${MPI_C_LIBRARIES})
|
||||
set_target_properties (ph5example-shared PROPERTIES FOLDER examples)
|
||||
endif ()
|
||||
endif ()
|
||||
|
@ -4451,7 +4451,7 @@ public class H5 implements java.io.Serializable {
|
||||
// //
|
||||
// ////////////////////////////////////////////////////////////
|
||||
|
||||
// Generic property list routines
|
||||
// /////// Generic property list routines ///////
|
||||
|
||||
/**
|
||||
* H5Pget_class_name retrieves the name of a generic property list class
|
||||
@ -4767,7 +4767,7 @@ public class H5 implements java.io.Serializable {
|
||||
|
||||
public synchronized static native int H5Piterate(long plist, int[] idx, H5P_iterate_cb op, H5P_iterate_t op_data) throws HDF5LibraryException;
|
||||
|
||||
// Object creation property list (OCPL) routines
|
||||
// /////// Object creation property list (OCPL) routines ///////
|
||||
|
||||
/**
|
||||
* H5Pget_attr_phase_change retrieves attribute storage phase change thresholds.
|
||||
@ -5071,7 +5071,7 @@ public class H5 implements java.io.Serializable {
|
||||
public synchronized static native int H5Pset_fletcher32(long plist) throws HDF5LibraryException,
|
||||
NullPointerException;
|
||||
|
||||
// File creation property list (FCPL) routines
|
||||
// /////// File creation property list (FCPL) routines ///////
|
||||
|
||||
/**
|
||||
* H5Pget_userblock retrieves the size of a user block in a file creation property list.
|
||||
@ -5480,7 +5480,7 @@ public class H5 implements java.io.Serializable {
|
||||
throws HDF5LibraryException, IllegalArgumentException;
|
||||
|
||||
|
||||
// File access property list (FAPL) routines
|
||||
// /////// File access property list (FAPL) routines ///////
|
||||
|
||||
/**
|
||||
* H5Pget_alignment retrieves the current settings for alignment properties from a file access property list.
|
||||
@ -5860,6 +5860,37 @@ public class H5 implements java.io.Serializable {
|
||||
public synchronized static native void H5Pset_metadata_read_attempts(long plist_id, long attempts)
|
||||
throws HDF5LibraryException;
|
||||
|
||||
/**
|
||||
* H5Pget_evict_on_close retrieves the file access property list setting that determines whether an HDF5 object
|
||||
* will be evicted from the library's metadata cache when it is closed.
|
||||
*
|
||||
* @param fapl_id
|
||||
* IN: File access property list identifier
|
||||
*
|
||||
* @return indication if the object will be evicted on close.
|
||||
*
|
||||
* @exception HDF5LibraryException
|
||||
* - Error from the HDF-5 Library.
|
||||
*
|
||||
**/
|
||||
public synchronized static native boolean H5Pget_evict_on_close(long fapl_id)
|
||||
throws HDF5LibraryException;
|
||||
|
||||
/**
|
||||
* H5Pset_evict_on_close controls the library's behavior of evicting metadata associated with a closed object.
|
||||
*
|
||||
* @param fapl_id
|
||||
* IN: File access property list identifier
|
||||
* @param evict_on_close
|
||||
* IN: Whether the HDF5 object should be evicted on close.
|
||||
*
|
||||
* @exception HDF5LibraryException
|
||||
* - Error from the HDF-5 Library.
|
||||
*
|
||||
**/
|
||||
public synchronized static native void H5Pset_evict_on_close(long fapl_id, boolean evict_on_close)
|
||||
throws HDF5LibraryException;
|
||||
|
||||
// Dataset creation property list (DCPL) routines //
|
||||
|
||||
/**
|
||||
@ -6066,6 +6097,36 @@ public class H5 implements java.io.Serializable {
|
||||
**/
|
||||
public synchronized static native String H5Pget_virtual_dsetname(long dcpl_id, long index) throws HDF5LibraryException, IllegalArgumentException;
|
||||
|
||||
// ///// unimplemented /////
|
||||
// /**
|
||||
// * H5Pget_vds_file_cache_size retrieves the size of the vds link open file cache.
|
||||
// *
|
||||
// * @param fapl_id
|
||||
// * IN: File access property list identifier
|
||||
// *
|
||||
// * @return VDS link open file cache size in number of files.
|
||||
// *
|
||||
// * @exception HDF5LibraryException
|
||||
// * - Error from the HDF-5 Library.
|
||||
// *
|
||||
// **/
|
||||
// public synchronized static native int H5Pget_vds_file_cache_size(long fapl_id) throws HDF5LibraryException;
|
||||
//
|
||||
// /**
|
||||
// * H5Pset_vds_file_cache_size sets the number of files that can be held open in an vds link open file cache.
|
||||
// *
|
||||
// * @param fapl_id
|
||||
// * IN: File access property list identifier
|
||||
// * @param efc_size
|
||||
// * IN: VDS link open file cache size in number of files.
|
||||
// *
|
||||
// * @exception HDF5LibraryException
|
||||
// * - Error from the HDF-5 Library.
|
||||
// *
|
||||
// **/
|
||||
// public synchronized static native void H5Pset_vds_file_cache_size(long fapl_id, int efc_size)
|
||||
// throws HDF5LibraryException;
|
||||
|
||||
/**
|
||||
* H5Pget_external returns information about an external file.
|
||||
*
|
||||
@ -6285,7 +6346,37 @@ public class H5 implements java.io.Serializable {
|
||||
public synchronized static native int H5Pset_fill_time(long plist_id, int fill_time) throws HDF5LibraryException,
|
||||
NullPointerException;
|
||||
|
||||
// Dataset access property list (DAPL) routines //
|
||||
// /////// Dataset creation property list (DCPL) routines ///////
|
||||
|
||||
/**
|
||||
* H5Pset_chunk_opts Sets the edge chunk option in a dataset creation property list.
|
||||
*
|
||||
* @param dcpl_id
|
||||
* IN: Dataset creation property list identifier
|
||||
* @param opts
|
||||
* IN: Edge chunk option flag. Valid values are:
|
||||
* H5D_CHUNK_DONT_FILTER_PARTIAL_CHUNKS - filters are not applied to partial edge chunks.
|
||||
* 0 - Disables option; partial edge chunks will be compressed.
|
||||
*
|
||||
* @exception HDF5LibraryException
|
||||
* - Error from the HDF-5 Library
|
||||
**/
|
||||
public synchronized static native void H5Pset_chunk_opts(long dcpl_id, int opts) throws HDF5LibraryException;
|
||||
|
||||
/**
|
||||
* H5Pget_chunk_opts retrieves the edge chunk option setting stored in the dataset creation property list .
|
||||
*
|
||||
* @param dcpl_id
|
||||
* IN: Dataset creation property list
|
||||
|
||||
* @return The edge chunk option setting.
|
||||
*
|
||||
* @exception HDF5LibraryException
|
||||
* - Error from the HDF-5 Library
|
||||
**/
|
||||
public synchronized static native int H5Pget_chunk_opts(long dcpl_id) throws HDF5LibraryException;
|
||||
|
||||
// /////// Dataset access property list (DAPL) routines ///////
|
||||
|
||||
/**
|
||||
* Retrieves the maximum possible number of elements in the meta data cache and the maximum possible number of bytes
|
||||
@ -6388,12 +6479,76 @@ public class H5 implements java.io.Serializable {
|
||||
**/
|
||||
public synchronized static native long H5Pget_virtual_printf_gap(long dapl_id) throws HDF5LibraryException;
|
||||
|
||||
/**
|
||||
* H5Pget_virtual_prefix Retrieves prefix applied to virtual file paths.
|
||||
*
|
||||
* @param dapl_id
|
||||
* IN: Link access property list identifier
|
||||
*
|
||||
* @return the prefix to be applied to virtual file paths.
|
||||
*
|
||||
* @exception HDF5LibraryException
|
||||
* - Error from the HDF-5 Library.
|
||||
*
|
||||
**/
|
||||
public synchronized static native String H5Pget_virtual_prefix(long dapl_id)
|
||||
throws HDF5LibraryException;
|
||||
|
||||
/**
|
||||
* H5Pset_virtual_prefix Sets prefix to be applied to virtual file paths.
|
||||
*
|
||||
* @param dapl_id
|
||||
* IN: Dataset access property list identifier
|
||||
* @param prefix
|
||||
* IN: Prefix to be applied to virtual file paths
|
||||
*
|
||||
* @exception HDF5LibraryException
|
||||
* - Error from the HDF-5 Library.
|
||||
* @exception NullPointerException
|
||||
* - prefix is null.
|
||||
*
|
||||
**/
|
||||
public synchronized static native void H5Pset_virtual_prefix(long dapl_id, String prefix)
|
||||
throws HDF5LibraryException, NullPointerException;
|
||||
|
||||
/**
|
||||
* H5Pget_efile_prefix Retrieves prefix applied to external file paths.
|
||||
*
|
||||
* @param dapl_id
|
||||
* IN: Link access property list identifier
|
||||
*
|
||||
* @return the prefix to be applied to external file paths.
|
||||
*
|
||||
* @exception HDF5LibraryException
|
||||
* - Error from the HDF-5 Library.
|
||||
*
|
||||
**/
|
||||
public synchronized static native String H5Pget_efile_prefix(long dapl_id)
|
||||
throws HDF5LibraryException;
|
||||
|
||||
/**
|
||||
* H5Pset_efile_prefix Sets prefix to be applied to external file paths.
|
||||
*
|
||||
* @param dapl_id
|
||||
* IN: Dataset access property list identifier
|
||||
* @param prefix
|
||||
* IN: Prefix to be applied to external file paths
|
||||
*
|
||||
* @exception HDF5LibraryException
|
||||
* - Error from the HDF-5 Library.
|
||||
* @exception NullPointerException
|
||||
* - prefix is null.
|
||||
*
|
||||
**/
|
||||
public synchronized static native void H5Pset_efile_prefix(long dapl_id, String prefix)
|
||||
throws HDF5LibraryException, NullPointerException;
|
||||
|
||||
// public synchronized static native void H5Pset_append_flush(long plist_id, int ndims, long[] boundary, H5D_append_cb func, H5D_append_t udata) throws HDF5LibraryException;
|
||||
|
||||
// public synchronized static native void H5Pget_append_flush(long plist_id, int dims, long[] boundary, H5D_append_cb func, H5D_append_t udata) throws HDF5LibraryException;
|
||||
|
||||
|
||||
// Dataset xfer property list (DXPL) routines //
|
||||
// /////// Dataset xfer property list (DXPL) routines ///////
|
||||
|
||||
/**
|
||||
* H5Pget_data_transform retrieves the data transform expression previously set in the dataset transfer property
|
||||
@ -6544,7 +6699,7 @@ public class H5 implements java.io.Serializable {
|
||||
public synchronized static native int H5Pset_hyper_vector_size(long dxpl_id, long vector_size)
|
||||
throws HDF5LibraryException, NullPointerException;
|
||||
|
||||
// Link creation property list (LCPL) routines //
|
||||
// /////// Link creation property list (LCPL) routines ///////
|
||||
|
||||
/**
|
||||
* H5Pget_create_intermediate_group determines whether property is set to enable creating missing intermediate
|
||||
@ -6579,7 +6734,7 @@ public class H5 implements java.io.Serializable {
|
||||
public synchronized static native int H5Pset_create_intermediate_group(long lcpl_id, boolean crt_intermed_group)
|
||||
throws HDF5LibraryException;
|
||||
|
||||
// Group creation property list (GCPL) routines //
|
||||
// /////// Group creation property list (GCPL) routines ///////
|
||||
|
||||
/**
|
||||
* H5Pget_local_heap_size_hint Retrieves the anticipated size of the local heap for original-style groups.
|
||||
@ -6736,14 +6891,14 @@ public class H5 implements java.io.Serializable {
|
||||
public synchronized static native int H5Pset_link_creation_order(long gcpl_id, int crt_order_flags)
|
||||
throws HDF5LibraryException;
|
||||
|
||||
// String creation property list (STRCPL) routines //
|
||||
// /////// String creation property list (STRCPL) routines ///////
|
||||
|
||||
public synchronized static native int H5Pget_char_encoding(long plist_id) throws HDF5LibraryException;
|
||||
|
||||
public synchronized static native void H5Pset_char_encoding(long plist_id, int encoding)
|
||||
throws HDF5LibraryException;
|
||||
|
||||
// Link access property list (LAPL) routines //
|
||||
// /////// Link access property list (LAPL) routines ///////
|
||||
|
||||
/**
|
||||
* H5Pget_nlinks retrieves the maximum number of soft or user-defined link traversals allowed, nlinks, before the
|
||||
@ -6896,7 +7051,7 @@ public class H5 implements java.io.Serializable {
|
||||
public synchronized static native int H5Pset_elink_acc_flags(long lapl_id, int flags) throws HDF5LibraryException,
|
||||
IllegalArgumentException;
|
||||
|
||||
// Object copy property list (OCPYPL) routines //
|
||||
// /////// Object copy property list (OCPYPL) routines ///////
|
||||
|
||||
/**
|
||||
* H5Pget_copy_object retrieves the properties to be used when an object is copied.
|
||||
@ -6927,7 +7082,7 @@ public class H5 implements java.io.Serializable {
|
||||
public synchronized static native void H5Pset_copy_object(long ocp_plist_id, int copy_options)
|
||||
throws HDF5LibraryException;
|
||||
|
||||
// Other/Older property list routines //
|
||||
// /////// Other/Older property list routines ///////
|
||||
|
||||
/**
|
||||
* H5Pget_version retrieves the version information of various objects for a file creation property list.
|
||||
@ -6955,7 +7110,7 @@ public class H5 implements java.io.Serializable {
|
||||
public synchronized static native int H5Pget_version(long plist, int[] version_info) throws HDF5LibraryException,
|
||||
NullPointerException, IllegalArgumentException;
|
||||
|
||||
// file drivers property list routines //
|
||||
// /////// file drivers property list routines ///////
|
||||
|
||||
public synchronized static native void H5Pget_fapl_core(long fapl_id, long[] increment, boolean[] backing_store)
|
||||
throws HDF5LibraryException, NullPointerException;
|
||||
@ -7102,20 +7257,28 @@ public class H5 implements java.io.Serializable {
|
||||
// File creation property list (FCPL) routines //
|
||||
|
||||
// File access property list (FAPL) routines //
|
||||
// herr_t H5Pset_driver( hid_t plist_id, hid_t new_driver_id, const void *new_driver_info )
|
||||
// const void *H5Pget_driver_info( hid_t plist_id )
|
||||
// herr_t H5Pget_multi_type ( hid_t fapl_id, H5FD_mem_t *type )
|
||||
// herr_t H5Pset_multi_type ( hid_t fapl_id, H5FD_mem_t type )
|
||||
// herr_t H5Pset_driver(hid_t plist_id, hid_t new_driver_id, const void *new_driver_info)
|
||||
// const void *H5Pget_driver_info(hid_t plist_id)
|
||||
// herr_t H5Pget_multi_type(hid_t fapl_id, H5FD_mem_t *type)
|
||||
// herr_t H5Pset_multi_type(hid_t fapl_id, H5FD_mem_t type)
|
||||
// herr_t H5Pget_file_image(hid_t fapl_id, void **buf_ptr_ptr, size_t *buf_len_ptr);
|
||||
// herr_t H5Pset_file_image(hid_t fapl_id, void *buf_ptr, size_t buf_len);
|
||||
// herr_t H5Pget_file_image_callbacks(hid_t fapl_id, H5FD_file_image_callbacks_t *callbacks_ptr);
|
||||
// herr_t H5Pset_file_image_callbacks(hid_t fapl_id, H5FD_file_image_callbacks_t *callbacks_ptr);
|
||||
// herr_t H5Pset_core_write_tracking(hid_t fapl_id, hbool_t is_enabled, size_t page_size);
|
||||
// herr_t H5Pget_core_write_tracking(hid_t fapl_id, hbool_t *is_enabled, size_t *page_size);
|
||||
// herr_t H5Pset_all_coll_metadata_ops(hid_t accpl_id, hbool_t is_collective);
|
||||
// herr_t H5Pset_coll_metadata_write(hid_t fapl_id, hbool_t is_collective);
|
||||
// herr_t H5Pget_coll_metadata_write(hid_t fapl_id, hbool_t *is_collective);
|
||||
// herr_t H5Pget_page_buffer_size(hid_t fapl_id, size_t *buf_size, unsigned *min_meta_perc, unsigned *min_raw_perc);
|
||||
// herr_t H5Pset_object_flush_cb (hid_t fapl_id, H5F_flush_cb_t func, void *user_data);
|
||||
// herr_t H5Pget_object_flush_cb (hid_t fapl_id, H5F_flush_cb_t *func, void **user_data);
|
||||
|
||||
// Dataset creation property list (DCPL) routines //
|
||||
|
||||
// Dataset access property list (DAPL) routines //
|
||||
// herr_t H5Pset_append_flush (hid_t dapl_id, int ndims, const hsize_t boundary[], H5D_append_cb_t func, void *user_data);
|
||||
// herr_t H5Pget_append_flush(hid_t dapl_id, int ndims, hsize_t boundary[], H5D_append_cb_t *func, void **user_data)
|
||||
|
||||
// Dataset xfer property list (DXPL) routines //
|
||||
// herr_t H5Pset_buffer(hid_t plist_id, size_t size, void *tconv, void *bkg);
|
||||
|
@ -88,6 +88,7 @@ public class HDF5Constants {
|
||||
public static final int H5D_VDS_ERROR = H5D_VDS_ERROR();
|
||||
public static final int H5D_VDS_FIRST_MISSING = H5D_VDS_FIRST_MISSING();
|
||||
public static final int H5D_VDS_LAST_AVAILABLE = H5D_VDS_LAST_AVAILABLE();
|
||||
public static final int H5D_CHUNK_DONT_FILTER_PARTIAL_CHUNKS = H5D_CHUNK_DONT_FILTER_PARTIAL_CHUNKS();
|
||||
|
||||
public static final int H5E_MAJOR = H5E_MAJOR();
|
||||
public static final int H5E_MINOR = H5E_MINOR();
|
||||
@ -768,6 +769,8 @@ public class HDF5Constants {
|
||||
|
||||
private static native final int H5D_VDS_LAST_AVAILABLE();
|
||||
|
||||
private static native final int H5D_CHUNK_DONT_FILTER_PARTIAL_CHUNKS();
|
||||
|
||||
private static native final long H5E_ALIGNMENT();
|
||||
|
||||
private static native final long H5E_ALREADYEXISTS();
|
||||
|
@ -47,20 +47,20 @@ which has a method:
|
||||
The native method is implemented in C using the
|
||||
<a href="http://java.sun.com/javase/6/docs/technotes/guides/jni/index.html">Java
|
||||
Native Method Interface </a>(JNI). This is written something like the following:
|
||||
<pre><b>JNIEXPORT jint
|
||||
<pre><b>JNIEXPORT jlong
|
||||
JNICALL Java_hdf_hdf5lib_H5_H5Fopen
|
||||
(
|
||||
JNIEnv *env,
|
||||
jclass class,
|
||||
jstring hdfFile,
|
||||
jint flags,
|
||||
jint access)
|
||||
jlong access)
|
||||
{
|
||||
|
||||
/* ...convert Java String to (char *) */
|
||||
|
||||
/* call the HDF library */
|
||||
retVal = H5Fopen((char *)file, (unsigned)flags, (hid_t)access );
|
||||
retVal = H5Fopen((char *)file, (unsigned)flags, (hid_t)access);
|
||||
|
||||
/* ... */
|
||||
}</b></pre>
|
||||
|
@ -140,6 +140,8 @@ JNIEXPORT jint JNICALL
|
||||
Java_hdf_hdf5lib_HDF5Constants_H5D_1VDS_1FIRST_1MISSING(JNIEnv *env, jclass cls) { return H5D_VDS_FIRST_MISSING; }
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_hdf_hdf5lib_HDF5Constants_H5D_1VDS_1LAST_1AVAILABLE(JNIEnv *env, jclass cls) { return H5D_VDS_LAST_AVAILABLE; }
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_hdf_hdf5lib_HDF5Constants_H5D_1CHUNK_1DONT_1FILTER_1PARTIAL_1CHUNKS(JNIEnv *env, jclass cls) { return H5D_CHUNK_DONT_FILTER_PARTIAL_CHUNKS; }
|
||||
|
||||
JNIEXPORT jlong JNICALL
|
||||
Java_hdf_hdf5lib_HDF5Constants_H5E_1ALIGNMENT(JNIEnv *env, jclass cls) { return H5E_ALIGNMENT; }
|
||||
|
@ -5733,6 +5733,217 @@ Java_hdf_hdf5lib_H5_H5Pset_1metadata_1read_1attempts
|
||||
} /* end else */
|
||||
} /* end Java_hdf_hdf5lib_H5_H5Pset_1metadata_1read_1attempts */
|
||||
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pset_virtual_prefix
|
||||
* Signature: (JLjava/lang/String;)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pset_1virtual_1prefix
|
||||
(JNIEnv *env, jclass clss, jlong dapl_id, jstring prefix)
|
||||
{
|
||||
herr_t retVal = -1;
|
||||
const char *aName;
|
||||
|
||||
PIN_JAVA_STRING(prefix, aName);
|
||||
if (aName != NULL) {
|
||||
retVal = H5Pset_virtual_prefix((hid_t)dapl_id, aName);
|
||||
|
||||
UNPIN_JAVA_STRING(prefix, aName);
|
||||
|
||||
if(retVal < 0)
|
||||
h5libraryError(env);
|
||||
}
|
||||
} /* end Java_hdf_hdf5lib_H5_H5Pset_1virtual_1prefix */
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pget_virtual_prefix
|
||||
* Signature: (J)Ljava/lang/String;
|
||||
*/
|
||||
JNIEXPORT jstring JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pget_1virtual_1prefix
|
||||
(JNIEnv *env, jclass clss, jlong dapl_id)
|
||||
{
|
||||
size_t size = 0;
|
||||
char *pre;
|
||||
jlong prefix_size = -1;
|
||||
jstring str = NULL;
|
||||
|
||||
prefix_size = (jlong)H5Pget_virtual_prefix((hid_t)dapl_id, (char*)NULL, size);
|
||||
if(prefix_size < 0) {
|
||||
h5libraryError(env);
|
||||
} /* end if */
|
||||
else {
|
||||
size = (size_t)prefix_size + 1;/* add extra space for the null terminator */
|
||||
pre = (char*)HDmalloc(sizeof(char)*size);
|
||||
if (pre == NULL) {
|
||||
h5outOfMemory(env, "H5Pget_virtual_prefix: malloc failed ");
|
||||
} /* end if */
|
||||
else {
|
||||
prefix_size = (jlong)H5Pget_virtual_prefix((hid_t)dapl_id, (char*)pre, size);
|
||||
|
||||
if (prefix_size >= 0) {
|
||||
str = ENVPTR->NewStringUTF(ENVPAR pre);
|
||||
HDfree(pre);
|
||||
if (str == NULL)
|
||||
h5JNIFatalError( env, "H5Pget_virtual_prefix: return string not allocated");
|
||||
} /* end if */
|
||||
else {
|
||||
HDfree(pre);
|
||||
h5libraryError(env);
|
||||
} /* end else */
|
||||
} /* end else */
|
||||
} /* end else */
|
||||
|
||||
return (jstring)str;
|
||||
} /* end Java_hdf_hdf5lib_H5_H5Pget_1virtual_1prefix */
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pset_efile_prefix
|
||||
* Signature: (JLjava/lang/String;)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pset_1efile_1prefix
|
||||
(JNIEnv *env, jclass clss, jlong dapl_id, jstring prefix)
|
||||
{
|
||||
herr_t retVal = -1;
|
||||
const char *aName;
|
||||
|
||||
PIN_JAVA_STRING(prefix, aName);
|
||||
if (aName != NULL) {
|
||||
retVal = H5Pset_efile_prefix((hid_t)dapl_id, aName);
|
||||
|
||||
UNPIN_JAVA_STRING(prefix, aName);
|
||||
|
||||
if(retVal < 0)
|
||||
h5libraryError(env);
|
||||
}
|
||||
} /* end Java_hdf_hdf5lib_H5_H5Pset_1efile_1prefix */
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pget_efile_prefix
|
||||
* Signature: (J)Ljava/lang/String;
|
||||
*/
|
||||
JNIEXPORT jstring JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pget_1efile_1prefix
|
||||
(JNIEnv *env, jclass clss, jlong dapl_id)
|
||||
{
|
||||
size_t size = 0;
|
||||
char *pre;
|
||||
jlong prefix_size = -1;
|
||||
jstring str = NULL;
|
||||
|
||||
prefix_size = (jlong)H5Pget_efile_prefix((hid_t)dapl_id, (char*)NULL, size);
|
||||
if(prefix_size < 0) {
|
||||
h5libraryError(env);
|
||||
} /* end if */
|
||||
else {
|
||||
size = (size_t)prefix_size + 1;/* add extra space for the null terminator */
|
||||
pre = (char*)HDmalloc(sizeof(char)*size);
|
||||
if (pre == NULL) {
|
||||
h5outOfMemory(env, "H5Pget_efile_prefix: malloc failed ");
|
||||
} /* end if */
|
||||
else {
|
||||
prefix_size = (jlong)H5Pget_efile_prefix((hid_t)dapl_id, (char*)pre, size);
|
||||
|
||||
if (prefix_size >= 0) {
|
||||
str = ENVPTR->NewStringUTF(ENVPAR pre);
|
||||
HDfree(pre);
|
||||
if (str == NULL)
|
||||
h5JNIFatalError( env, "H5Pget_efile_prefix: return string not allocated");
|
||||
} /* end if */
|
||||
else {
|
||||
HDfree(pre);
|
||||
h5libraryError(env);
|
||||
} /* end else */
|
||||
} /* end else */
|
||||
} /* end else */
|
||||
|
||||
return (jstring)str;
|
||||
} /* end Java_hdf_hdf5lib_H5_H5Pget_1efile_1prefix */
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pset_evict_on_close
|
||||
* Signature: (JZ)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pset_1evict_1on_1close
|
||||
(JNIEnv *env, jclass clss, jlong fapl_id, jboolean evict_on_close)
|
||||
{
|
||||
herr_t retVal = -1;
|
||||
hbool_t evict_on_close_val;
|
||||
|
||||
if (evict_on_close == JNI_TRUE)
|
||||
evict_on_close_val = TRUE;
|
||||
else
|
||||
evict_on_close_val = FALSE;
|
||||
|
||||
retVal = H5Pset_evict_on_close((hid_t)fapl_id, (hbool_t)evict_on_close_val);
|
||||
if (retVal < 0)
|
||||
h5libraryError(env);
|
||||
} /* end Java_hdf_hdf5lib_H5_H5Pset_1evict_1on_1close */
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pget_evict_on_close
|
||||
* Signature: (J)Z
|
||||
*/
|
||||
JNIEXPORT jboolean JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pget_1evict_1on_1close
|
||||
(JNIEnv *env, jclass clss, jlong fapl_id)
|
||||
{
|
||||
hbool_t evict_on_close_val = FALSE;
|
||||
jboolean bval = JNI_FALSE;
|
||||
|
||||
if (H5Pget_evict_on_close((hid_t)fapl_id, (hbool_t *)&evict_on_close_val) < 0) {
|
||||
h5libraryError(env);
|
||||
} /* end if */
|
||||
else {
|
||||
if (evict_on_close_val == TRUE)
|
||||
bval = JNI_TRUE;
|
||||
} /* end else */
|
||||
|
||||
return bval;
|
||||
} /* end Java_hdf_hdf5lib_H5_H5Pget_1evict_1on_1close */
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pset_chunk_opts
|
||||
* Signature: (JI)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pset_1chunk_1opts
|
||||
(JNIEnv *env, jclass clss, jlong dcpl_id, jint opts)
|
||||
{
|
||||
herr_t retVal = -1;
|
||||
|
||||
retVal = H5Pset_chunk_opts((hid_t)dcpl_id, (unsigned)opts);
|
||||
if (retVal < 0)
|
||||
h5libraryError(env);
|
||||
} /* end Java_hdf_hdf5lib_H5_H5Pset_1chunk_1opts */
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pget_chunk_opts
|
||||
* Signature: (J)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pget_1chunk_1opts
|
||||
(JNIEnv *env, jclass clss, jlong dcpl_id)
|
||||
{
|
||||
unsigned opts = 0;
|
||||
|
||||
if (H5Pget_chunk_opts((hid_t)dcpl_id, opts) < 0)
|
||||
h5libraryError(env);
|
||||
|
||||
return (jint)opts;
|
||||
} /* end Java_hdf_hdf5lib_H5_H5Pget_1chunk_1opts */
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* end extern "C" */
|
||||
#endif /* __cplusplus */
|
||||
|
@ -1533,7 +1533,6 @@ JNIEXPORT jlong JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pget_1metadata_1read_1attempts
|
||||
(JNIEnv *, jclass, jlong);
|
||||
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pset_metadata_read_attempts
|
||||
@ -1543,6 +1542,78 @@ JNIEXPORT void JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pset_1metadata_1read_1attempts
|
||||
(JNIEnv *, jclass, jlong, jlong);
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pset_virtual_prefix
|
||||
* Signature: (JLjava/lang/String;)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pset_1virtual_1prefix
|
||||
(JNIEnv *, jclass, jlong, jstring);
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pget_virtual_prefix
|
||||
* Signature: (J)Ljava/lang/String;
|
||||
*/
|
||||
JNIEXPORT jstring JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pget_1virtual_1prefix
|
||||
(JNIEnv *, jclass, jlong);
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pset_efile_prefix
|
||||
* Signature: (JLjava/lang/String;)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pset_1efile_1prefix
|
||||
(JNIEnv *, jclass, jlong, jstring);
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pget_efile_prefix
|
||||
* Signature: (J)Ljava/lang/String;
|
||||
*/
|
||||
JNIEXPORT jstring JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pget_1efile_1prefix
|
||||
(JNIEnv *, jclass, jlong);
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pset_evict_on_close
|
||||
* Signature: (JZ)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pset_1evict_1on_1close
|
||||
(JNIEnv *, jclass, jlong, jboolean);
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pget_evict_on_close
|
||||
* Signature: (J)Z
|
||||
*/
|
||||
JNIEXPORT jboolean JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pget_1evict_1on_1close
|
||||
(JNIEnv *, jclass, jlong);
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pset_chunk_opts
|
||||
* Signature: (JI)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pset_1chunk_1opts
|
||||
(JNIEnv *, jclass, jlong, jint);
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pget_chunk_opts
|
||||
* Signature: (J)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pget_1chunk_1opts
|
||||
(JNIEnv *, jclass, jlong);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* end extern "C" */
|
||||
|
@ -415,6 +415,7 @@ JUnit version 4.11
|
||||
.testH5PH5Pset_shared_mesg_phase_change_HighMaxlistValue
|
||||
.testH5P_layout
|
||||
.testH5Pget_link_creation_order
|
||||
.testH5Pget_efile_prefix
|
||||
.testH5Pset_shared_mesg_nindexes_InvalidHIGHnindexes
|
||||
.testH5P_file_space_page_size
|
||||
.testH5Pget_shared_mesg_index_Invalid_indexnum
|
||||
@ -444,6 +445,7 @@ JUnit version 4.11
|
||||
.testH5Pset_est_link_info_InvalidValues
|
||||
.testH5Pset_local_heap_size_hint
|
||||
.testH5Pget_est_link_info
|
||||
.testH5Pset_efile_prefix_null
|
||||
.testH5Pset_scaleoffset
|
||||
.testH5Pset_create_intermediate_group_invalidobject
|
||||
.testH5PH5Pset_shared_mesg_phase_change_HighMinbtreeValue
|
||||
@ -466,6 +468,7 @@ JUnit version 4.11
|
||||
.testH5Pget_sym_k_null
|
||||
.testH5Pset_nlinks
|
||||
.testH5P_obj_track_times
|
||||
.testH5Pset_efile_prefix
|
||||
.testH5P_userblock
|
||||
.testH5Pget_local_heap_size_hint
|
||||
.testH5Pset_shared_mesg_index_Invalid_indexnum
|
||||
@ -504,6 +507,7 @@ JUnit version 4.11
|
||||
.testH5Pset_mdc_config
|
||||
.testH5P_small_data_block_size
|
||||
.testH5Pset_fapl_log
|
||||
.testH5P_evict_on_close
|
||||
.testH5Pset_libver_bounds
|
||||
.testH5P_sieve_buf_size
|
||||
.testH5P_elink_file_cache_size
|
||||
@ -530,11 +534,14 @@ JUnit version 4.11
|
||||
.testH5Pget_source_datasetname
|
||||
.testH5Pvirtual_storage
|
||||
.testH5Pget_selection_source_dataset
|
||||
.testH5Pget_virtual_prefix
|
||||
.testH5Pget_source_filename
|
||||
.testH5Pset_get_virtual_printf_gap
|
||||
.testH5Pget_virtual_count
|
||||
.testH5Pset_virtual_prefix
|
||||
.testH5Pset_get_virtual_view
|
||||
.testH5Pget_mapping_parameters
|
||||
.testH5Pset_virtual_prefix_null
|
||||
.testH5P_genprop_basic_class
|
||||
.testH5P_genprop_class_iter
|
||||
.testH5P_genprop_basic_class_prop
|
||||
@ -640,7 +647,7 @@ JUnit version 4.11
|
||||
|
||||
Time: XXXX
|
||||
|
||||
OK (638 tests)
|
||||
OK (645 tests)
|
||||
|
||||
HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs):
|
||||
#000: (file name) line (number) in H5Fopen(): can't set access and transfer property lists
|
||||
|
@ -28,6 +28,7 @@ import hdf.hdf5lib.exceptions.HDF5LibraryException;
|
||||
|
||||
import org.junit.After;
|
||||
import org.junit.Before;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.rules.TestName;
|
||||
@ -852,7 +853,7 @@ public class TestH5P {
|
||||
}
|
||||
catch (Throwable err) {
|
||||
err.printStackTrace();
|
||||
fail("H5Pset_est_link_info: " + err);
|
||||
fail("H5Pset_elink_prefix: " + err);
|
||||
}
|
||||
assertTrue("H5Pset_elink_prefix", ret_val >= 0);
|
||||
}
|
||||
@ -1232,4 +1233,54 @@ public class TestH5P {
|
||||
fail("testH5P_file_space_page_size: " + err);
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testH5Pset_efile_prefix() {
|
||||
String prefix = "tmp";
|
||||
try {
|
||||
H5.H5Pset_efile_prefix(lapl_id, prefix);
|
||||
}
|
||||
catch (Throwable err) {
|
||||
err.printStackTrace();
|
||||
fail("H5Pset_efile_prefix: " + err);
|
||||
}
|
||||
}
|
||||
|
||||
@Test(expected = NullPointerException.class)
|
||||
public void testH5Pset_efile_prefix_null() throws Throwable{
|
||||
H5.H5Pset_efile_prefix(lapl_id, null);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testH5Pget_efile_prefix() {
|
||||
String prefix = "tmp";
|
||||
String pre = "";
|
||||
|
||||
try {
|
||||
H5.H5Pset_efile_prefix(lapl_id, prefix);
|
||||
pre = H5.H5Pget_efile_prefix(lapl_id);
|
||||
}
|
||||
catch (Throwable err) {
|
||||
err.printStackTrace();
|
||||
fail("H5Pget_efile_prefix: " + err);
|
||||
}
|
||||
assertTrue("The prefix: ", prefix.equals(pre));
|
||||
}
|
||||
|
||||
@Ignore
|
||||
public void testH5P_chunk_opts() {
|
||||
int chunk_opts = -1;
|
||||
|
||||
try {
|
||||
chunk_opts = H5.H5Pget_chunk_opts(ocpl_id);
|
||||
assertTrue("chunk_opts: "+chunk_opts, chunk_opts == 0);
|
||||
H5.H5Pset_chunk_opts(ocpl_id, HDF5Constants.H5D_CHUNK_DONT_FILTER_PARTIAL_CHUNKS);
|
||||
chunk_opts = H5.H5Pget_chunk_opts(ocpl_id);
|
||||
assertTrue("chunk_opts: "+chunk_opts, chunk_opts == HDF5Constants.H5D_CHUNK_DONT_FILTER_PARTIAL_CHUNKS);
|
||||
}
|
||||
catch (Throwable err) {
|
||||
err.printStackTrace();
|
||||
fail("H5Pget_lchunk_opts: " + err);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1376,4 +1376,18 @@ public class TestH5Pfapl {
|
||||
deleteH5file();
|
||||
_deleteLogFile();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testH5P_evict_on_close() {
|
||||
boolean ret_val_id = false;
|
||||
try {
|
||||
H5.H5Pset_evict_on_close(fapl_id, true);
|
||||
ret_val_id = H5.H5Pget_evict_on_close(fapl_id);
|
||||
assertTrue("H5P_evict_on_close", ret_val_id);
|
||||
}
|
||||
catch (Throwable err) {
|
||||
err.printStackTrace();
|
||||
fail("H5P_evict_on_close: " + err);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -429,4 +429,37 @@ public class TestH5Pvirtual {
|
||||
try {H5.H5Dclose(H5did);} catch (Exception ex) {}
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testH5Pset_virtual_prefix() {
|
||||
String prefix = "tmp";
|
||||
try {
|
||||
H5.H5Pset_virtual_prefix(H5dapl_id, prefix);
|
||||
}
|
||||
catch (Throwable err) {
|
||||
err.printStackTrace();
|
||||
fail("H5Pset_virtual_prefix: " + err);
|
||||
}
|
||||
}
|
||||
|
||||
@Test(expected = NullPointerException.class)
|
||||
public void testH5Pset_virtual_prefix_null() throws Throwable{
|
||||
H5.H5Pset_virtual_prefix(H5dapl_id, null);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testH5Pget_virtual_prefix() {
|
||||
String prefix = "tmp";
|
||||
String pre = "";
|
||||
|
||||
try {
|
||||
H5.H5Pset_virtual_prefix(H5dapl_id, prefix);
|
||||
pre = H5.H5Pget_virtual_prefix(H5dapl_id);
|
||||
}
|
||||
catch (Throwable err) {
|
||||
err.printStackTrace();
|
||||
fail("H5Pget_virtual_prefix: " + err);
|
||||
}
|
||||
assertTrue("The prefix: ", prefix.equals(pre));
|
||||
}
|
||||
}
|
||||
|
@ -58,7 +58,21 @@ New Features
|
||||
|
||||
Library:
|
||||
--------
|
||||
-
|
||||
- Add prefix option to VDS files.
|
||||
|
||||
Currently, VDS source files must be in the active directory to be
|
||||
found by the virtual file. Adding the option of a prefix to be set
|
||||
on the virtual file, using a data access property list (DAPL),
|
||||
allows the source files to located at an absolute or relative path
|
||||
to the virtual file.
|
||||
|
||||
New public APIs:
|
||||
herr_t H5Pset_virtual_prefix(hid_t dapl_id, const char* prefix);
|
||||
ssize_t H5Pget_virtual_prefix(hid_t dapl_id, char* prefix /*out*/, size_t size);
|
||||
The prefix can also be set with an environment variable, HDF5_VDS_PREFIX.
|
||||
|
||||
(ADB - 2017/12/12, HDFFV-9724)
|
||||
|
||||
|
||||
Parallel Library:
|
||||
-----------------
|
||||
@ -119,6 +133,20 @@ New Features
|
||||
------------
|
||||
-
|
||||
|
||||
Java Library:
|
||||
----------------
|
||||
- Wrappers added for the following APIs:
|
||||
H5Pset_evict_on_close
|
||||
H5Pget_evict_on_close
|
||||
H5Pset_chunk_opts
|
||||
H5Pget_chunk_opts
|
||||
H5Pset_efile_prefix
|
||||
H5Pget_efile_prefix
|
||||
H5Pset_virtual_prefix
|
||||
H5Pget_virtual_prefix
|
||||
|
||||
(ADB - 2017/12/20)
|
||||
|
||||
Tools:
|
||||
------
|
||||
- h5diff
|
||||
@ -213,7 +241,7 @@ Bug Fixes since HDF5-1.10.1 release
|
||||
CMake implementation for MPI was problematic and would create incorrect
|
||||
MPI library references in the hdf5 libraries.
|
||||
|
||||
Reworked the CMake MPI code to properly create CMake targets.Also merged
|
||||
Reworked the CMake MPI code to properly create CMake targets. Also merged
|
||||
the latest CMake FindMPI.cmake changes to the local copy. This is necessary
|
||||
until HDF changes the CMake minimum to 3.9 or greater.
|
||||
|
||||
|
@ -885,10 +885,7 @@ add_library (${HDF5_LIB_TARGET} STATIC ${common_SRCS} ${gen_SRCS} ${H5_PUBLIC_HE
|
||||
TARGET_C_PROPERTIES (${HDF5_LIB_TARGET} STATIC " " " ")
|
||||
target_link_libraries (${HDF5_LIB_TARGET} PRIVATE ${LINK_LIBS} ${LINK_COMP_LIBS})
|
||||
if (NOT WIN32)
|
||||
target_link_libraries (${HDF5_LIB_TARGET} PUBLIC dl)
|
||||
endif ()
|
||||
if (H5_HAVE_PARALLEL AND MPI_C_FOUND)
|
||||
target_include_directories (${HDF5_LIB_TARGET} PUBLIC ${MPI_C_INCLUDE_DIRS})
|
||||
target_link_libraries (${HDF5_LIB_TARGET} PUBLIC ${CMAKE_DL_LIBS})
|
||||
endif ()
|
||||
set_global_variable (HDF5_LIBRARIES_TO_EXPORT ${HDF5_LIB_TARGET})
|
||||
H5_SET_LIB_OPTIONS (${HDF5_LIB_TARGET} ${HDF5_LIB_NAME} STATIC)
|
||||
@ -929,10 +926,7 @@ if (BUILD_SHARED_LIBS)
|
||||
TARGET_C_PROPERTIES (${HDF5_LIBSH_TARGET} SHARED " " " ")
|
||||
target_link_libraries (${HDF5_LIBSH_TARGET} PRIVATE ${LINK_LIBS} ${LINK_COMP_LIBS})
|
||||
if (NOT WIN32)
|
||||
target_link_libraries (${HDF5_LIBSH_TARGET} PUBLIC dl)
|
||||
endif ()
|
||||
if (H5_HAVE_PARALLEL AND MPI_C_FOUND)
|
||||
target_include_directories (${HDF5_LIBSH_TARGET} PUBLIC ${MPI_C_INCLUDE_DIRS})
|
||||
target_link_libraries (${HDF5_LIBSH_TARGET} PUBLIC ${CMAKE_DL_LIBS})
|
||||
endif ()
|
||||
set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_LIBSH_TARGET}")
|
||||
H5_SET_LIB_OPTIONS (${HDF5_LIBSH_TARGET} ${HDF5_LIB_NAME} SHARED ${HDF5_PACKAGE_SOVERSION})
|
||||
|
78
src/H5Dint.c
78
src/H5Dint.c
@ -61,8 +61,8 @@ static herr_t H5D__cache_dataspace_info(const H5D_t *dset);
|
||||
static herr_t H5D__init_space(H5F_t *file, const H5D_t *dset, const H5S_t *space);
|
||||
static herr_t H5D__update_oh_info(H5F_t *file, hid_t dxpl_id, H5D_t *dset,
|
||||
hid_t dapl_id);
|
||||
static herr_t H5D_build_extfile_prefix(const H5D_t *dset, hid_t dapl_id,
|
||||
char **extfile_prefix);
|
||||
static herr_t H5D_build_file_prefix(const H5D_t *dset, hid_t dapl_id, const char * prefix_type,
|
||||
char **file_prefix);
|
||||
static herr_t H5D__open_oid(H5D_t *dataset, hid_t dapl_id, hid_t dxpl_id);
|
||||
static herr_t H5D__init_storage(const H5D_io_info_t *io_info, hbool_t full_overwrite,
|
||||
hsize_t old_dim[]);
|
||||
@ -963,24 +963,25 @@ done:
|
||||
} /* end H5D__update_oh_info() */
|
||||
|
||||
|
||||
|
||||
/*--------------------------------------------------------------------------
|
||||
* Function: H5D_build_extfile_prefix
|
||||
* Function: H5D_build_file_prefix
|
||||
*
|
||||
* Purpose: Determine the external file prefix to be used and store
|
||||
* it in extfile_prefix. Stores an empty string if no prefix
|
||||
* Purpose: Determine the file prefix to be used and store
|
||||
* it in file_prefix. Stores an empty string if no prefix
|
||||
* should be used.
|
||||
*
|
||||
* Return: SUCCEED/FAIL
|
||||
*--------------------------------------------------------------------------
|
||||
*/
|
||||
static herr_t
|
||||
H5D_build_extfile_prefix(const H5D_t *dset, hid_t dapl_id, char **extfile_prefix /*out*/)
|
||||
H5D_build_file_prefix(const H5D_t *dset, hid_t dapl_id, const char *prefix_type, char **file_prefix /*out*/)
|
||||
{
|
||||
char *prefix = NULL; /* prefix used to look for the file */
|
||||
char *extpath = NULL; /* absolute path of directory the HDF5 file is in */
|
||||
size_t extpath_len; /* length of extpath */
|
||||
char *filepath = NULL; /* absolute path of directory the HDF5 file is in */
|
||||
size_t filepath_len; /* length of file path */
|
||||
size_t prefix_len; /* length of prefix */
|
||||
size_t extfile_prefix_len; /* length of expanded prefix */
|
||||
size_t file_prefix_len; /* length of expanded prefix */
|
||||
H5P_genplist_t *plist = NULL; /* Property list pointer */
|
||||
herr_t ret_value = SUCCEED; /* Return value */
|
||||
|
||||
@ -990,20 +991,25 @@ H5D_build_extfile_prefix(const H5D_t *dset, hid_t dapl_id, char **extfile_prefix
|
||||
HDassert(dset);
|
||||
HDassert(dset->oloc.file);
|
||||
|
||||
extpath = H5F_EXTPATH(dset->oloc.file);
|
||||
HDassert(extpath);
|
||||
filepath = H5F_EXTPATH(dset->oloc.file);
|
||||
HDassert(filepath);
|
||||
|
||||
/* XXX: Future thread-safety note - getenv is not required
|
||||
* to be reentrant.
|
||||
*/
|
||||
prefix = HDgetenv("HDF5_EXTFILE_PREFIX");
|
||||
if (HDstrcmp(prefix_type, H5D_ACS_VDS_PREFIX_NAME) == 0)
|
||||
prefix = HDgetenv("HDF5_VDS_PREFIX");
|
||||
else if (HDstrcmp(prefix_type, H5D_ACS_EFILE_PREFIX_NAME) == 0)
|
||||
prefix = HDgetenv("HDF5_EXTFILE_PREFIX");
|
||||
else
|
||||
HGOTO_ERROR(H5E_PLIST, H5E_BADTYPE, FAIL, "prefix name is not sensible")
|
||||
|
||||
if(prefix == NULL || *prefix == '\0') {
|
||||
/* Set prefix to value of H5D_ACS_EFILE_PREFIX_NAME property */
|
||||
/* Set prefix to value of prefix_type property */
|
||||
if(NULL == (plist = H5P_object_verify(dapl_id, H5P_DATASET_ACCESS)))
|
||||
HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
|
||||
if(H5P_peek(plist, H5D_ACS_EFILE_PREFIX_NAME, &prefix) < 0)
|
||||
HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get external file prefix")
|
||||
if(H5P_peek(plist, prefix_type, &prefix) < 0)
|
||||
HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get file prefix")
|
||||
} /* end if */
|
||||
|
||||
/* Prefix has to be checked for NULL / empty string again because the
|
||||
@ -1013,29 +1019,29 @@ H5D_build_extfile_prefix(const H5D_t *dset, hid_t dapl_id, char **extfile_prefix
|
||||
/* filename is interpreted as relative to the current directory,
|
||||
* does not need to be expanded
|
||||
*/
|
||||
if(NULL == (*extfile_prefix = (char *)H5MM_strdup("")))
|
||||
if(NULL == (*file_prefix = (char *)H5MM_strdup("")))
|
||||
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed")
|
||||
} /* end if */
|
||||
else {
|
||||
if (HDstrncmp(prefix, "${ORIGIN}", HDstrlen("${ORIGIN}")) == 0) {
|
||||
/* Replace ${ORIGIN} at beginning of prefix by directory of HDF5 file */
|
||||
extpath_len = HDstrlen(extpath);
|
||||
filepath_len = HDstrlen(filepath);
|
||||
prefix_len = HDstrlen(prefix);
|
||||
extfile_prefix_len = extpath_len + prefix_len - HDstrlen("${ORIGIN}") + 1;
|
||||
file_prefix_len = filepath_len + prefix_len - HDstrlen("${ORIGIN}") + 1;
|
||||
|
||||
if(NULL == (*extfile_prefix = (char *)H5MM_malloc(extfile_prefix_len)))
|
||||
if(NULL == (*file_prefix = (char *)H5MM_malloc(file_prefix_len)))
|
||||
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "unable to allocate buffer")
|
||||
HDsnprintf(*extfile_prefix, extfile_prefix_len, "%s%s", extpath, prefix + HDstrlen("${ORIGIN}"));
|
||||
HDsnprintf(*file_prefix, file_prefix_len, "%s%s", filepath, prefix + HDstrlen("${ORIGIN}"));
|
||||
} /* end if */
|
||||
else {
|
||||
if(NULL == (*extfile_prefix = (char *)H5MM_strdup(prefix)))
|
||||
if(NULL == (*file_prefix = (char *)H5MM_strdup(prefix)))
|
||||
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed")
|
||||
} /* end else */
|
||||
} /* end else */
|
||||
|
||||
done:
|
||||
FUNC_LEAVE_NOAPI(ret_value)
|
||||
} /* H5D_build_extfile_prefix() */
|
||||
} /* H5D_build_file_prefix() */
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
@ -1217,9 +1223,13 @@ H5D__create(H5F_t *file, hid_t type_id, const H5S_t *space, hid_t dcpl_id,
|
||||
HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, NULL, "unable to set up flush append property")
|
||||
|
||||
/* Set the external file prefix */
|
||||
if(H5D_build_extfile_prefix(new_dset, dapl_id, &new_dset->shared->extfile_prefix) < 0)
|
||||
if(H5D_build_file_prefix(new_dset, dapl_id, H5D_ACS_EFILE_PREFIX_NAME, &new_dset->shared->extfile_prefix) < 0)
|
||||
HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, NULL, "unable to initialize external file prefix")
|
||||
|
||||
/* Set the vds file prefix */
|
||||
if(H5D_build_file_prefix(new_dset, dapl_id, H5D_ACS_VDS_PREFIX_NAME, &new_dset->shared->vds_prefix) < 0)
|
||||
HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, NULL, "unable to initialize vds prefix")
|
||||
|
||||
/* Add the dataset to the list of opened objects in the file */
|
||||
if(H5FO_top_incr(new_dset->oloc.file, new_dset->oloc.addr) < 0)
|
||||
HGOTO_ERROR(H5E_DATASET, H5E_CANTINC, NULL, "can't incr object ref. count")
|
||||
@ -1265,6 +1275,7 @@ done:
|
||||
if(new_dset->shared->dcpl_id != 0 && H5I_dec_ref(new_dset->shared->dcpl_id) < 0)
|
||||
HDONE_ERROR(H5E_DATASET, H5E_CANTDEC, NULL, "unable to decrement ref count on property list")
|
||||
new_dset->shared->extfile_prefix = (char *)H5MM_xfree(new_dset->shared->extfile_prefix);
|
||||
new_dset->shared->vds_prefix = (char *)H5MM_xfree(new_dset->shared->vds_prefix);
|
||||
new_dset->shared = H5FL_FREE(H5D_shared_t, new_dset->shared);
|
||||
} /* end if */
|
||||
new_dset->oloc.file = NULL;
|
||||
@ -1351,6 +1362,7 @@ H5D_open(const H5G_loc_t *loc, hid_t dapl_id, hid_t dxpl_id)
|
||||
H5D_shared_t *shared_fo = NULL;
|
||||
H5D_t *dataset = NULL;
|
||||
char *extfile_prefix = NULL; /* Expanded external file prefix */
|
||||
char *vds_prefix = NULL; /* Expanded vds prefix */
|
||||
H5D_t *ret_value = NULL; /* Return value */
|
||||
|
||||
FUNC_ENTER_NOAPI(NULL)
|
||||
@ -1371,9 +1383,13 @@ H5D_open(const H5G_loc_t *loc, hid_t dapl_id, hid_t dxpl_id)
|
||||
HGOTO_ERROR(H5E_DATASET, H5E_CANTCOPY, NULL, "can't copy path")
|
||||
|
||||
/* Get the external file prefix */
|
||||
if(H5D_build_extfile_prefix(dataset, dapl_id, &extfile_prefix) < 0)
|
||||
if(H5D_build_file_prefix(dataset, dapl_id, H5D_ACS_EFILE_PREFIX_NAME, &extfile_prefix) < 0)
|
||||
HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, NULL, "unable to initialize external file prefix")
|
||||
|
||||
/* Get the vds prefix */
|
||||
if(H5D_build_file_prefix(dataset, dapl_id, H5D_ACS_VDS_PREFIX_NAME, &vds_prefix) < 0)
|
||||
HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, NULL, "unable to initialize vds prefix")
|
||||
|
||||
/* Check if dataset was already open */
|
||||
if(NULL == (shared_fo = (H5D_shared_t *)H5FO_opened(dataset->oloc.file, dataset->oloc.addr))) {
|
||||
/* Clear any errors from H5FO_opened() */
|
||||
@ -1399,6 +1415,11 @@ H5D_open(const H5G_loc_t *loc, hid_t dapl_id, hid_t dxpl_id)
|
||||
/* Prevent string from being freed during done: */
|
||||
extfile_prefix = NULL;
|
||||
|
||||
/* Set the vds file prefix */
|
||||
dataset->shared->vds_prefix = vds_prefix;
|
||||
/* Prevent string from being freed during done: */
|
||||
vds_prefix = NULL;
|
||||
|
||||
} /* end if */
|
||||
else {
|
||||
/* Point to shared info */
|
||||
@ -1430,12 +1451,14 @@ H5D_open(const H5G_loc_t *loc, hid_t dapl_id, hid_t dxpl_id)
|
||||
|
||||
done:
|
||||
extfile_prefix = (char *)H5MM_xfree(extfile_prefix);
|
||||
vds_prefix = (char *)H5MM_xfree(vds_prefix);
|
||||
|
||||
if(ret_value == NULL) {
|
||||
/* Free the location--casting away const*/
|
||||
if(dataset) {
|
||||
if(shared_fo == NULL && dataset->shared) { /* Need to free shared fo */
|
||||
dataset->shared->extfile_prefix = (char *)H5MM_xfree(dataset->shared->extfile_prefix);
|
||||
dataset->shared->vds_prefix = (char *)H5MM_xfree(dataset->shared->vds_prefix);
|
||||
dataset->shared = H5FL_FREE(H5D_shared_t, dataset->shared);
|
||||
}
|
||||
|
||||
@ -1818,6 +1841,9 @@ H5D_close(H5D_t *dataset)
|
||||
/* Free the external file prefix */
|
||||
dataset->shared->extfile_prefix = (char *)H5MM_xfree(dataset->shared->extfile_prefix);
|
||||
|
||||
/* Free the vds file prefix */
|
||||
dataset->shared->vds_prefix = (char *)H5MM_xfree(dataset->shared->vds_prefix);
|
||||
|
||||
/* Release layout, fill-value, efl & pipeline messages */
|
||||
if(dataset->shared->dcpl_id != H5P_DATASET_CREATE_DEFAULT)
|
||||
free_failed |= (H5O_msg_reset(H5O_PLINE_ID, &dataset->shared->dcpl_cache.pline) < 0) ||
|
||||
@ -3360,6 +3386,10 @@ H5D_get_access_plist(H5D_t *dset)
|
||||
if(H5P_set(new_plist, H5D_ACS_VDS_PRINTF_GAP_NAME, &(dset->shared->layout.storage.u.virt.printf_gap)) < 0)
|
||||
HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set VDS printf gap")
|
||||
|
||||
/* Set the vds prefix option */
|
||||
if(H5P_set(new_plist, H5D_ACS_VDS_PREFIX_NAME, &(dset->shared->vds_prefix)) < 0)
|
||||
HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set vds prefix")
|
||||
|
||||
/* Set the external file prefix option */
|
||||
if(H5P_set(new_plist, H5D_ACS_EFILE_PREFIX_NAME, &(dset->shared->extfile_prefix)) < 0)
|
||||
HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set external file prefix")
|
||||
|
@ -476,6 +476,7 @@ typedef struct H5D_shared_t {
|
||||
|
||||
H5D_append_flush_t append_flush; /* Append flush property information */
|
||||
char *extfile_prefix; /* expanded external file prefix */
|
||||
char *vds_prefix; /* expanded vds prefix */
|
||||
} H5D_shared_t;
|
||||
|
||||
struct H5D_t {
|
||||
@ -598,7 +599,7 @@ H5_DLL herr_t H5D_set_io_info_dxpls(H5D_io_info_t *io_info, hid_t dxpl_id);
|
||||
H5_DLL herr_t H5D__format_convert(H5D_t *dataset, hid_t dxpl_id);
|
||||
|
||||
/* Internal I/O routines */
|
||||
H5_DLL herr_t H5D__pre_write(H5D_t *dset, hbool_t direct_write, hid_t mem_type_id,
|
||||
H5_DLL herr_t H5D__pre_write(H5D_t *dset, hbool_t direct_write, hid_t mem_type_id,
|
||||
const H5S_t *mem_space, const H5S_t *file_space, hid_t dxpl_id, const void *buf);
|
||||
H5_DLL herr_t H5D__read(H5D_t *dataset, hid_t mem_type_id,
|
||||
const H5S_t *mem_space, const H5S_t *file_space, hid_t dset_xfer_plist,
|
||||
|
@ -47,12 +47,13 @@
|
||||
#define H5D_CRT_EXT_FILE_LIST_NAME "efl" /* External file list */
|
||||
|
||||
/* ======== Dataset access property names ======== */
|
||||
#define H5D_ACS_DATA_CACHE_NUM_SLOTS_NAME "rdcc_nslots" /* Size of raw data chunk cache(slots) */
|
||||
#define H5D_ACS_DATA_CACHE_BYTE_SIZE_NAME "rdcc_nbytes" /* Size of raw data chunk cache(bytes) */
|
||||
#define H5D_ACS_PREEMPT_READ_CHUNKS_NAME "rdcc_w0" /* Preemption read chunks first */
|
||||
#define H5D_ACS_VDS_VIEW_NAME "vds_view" /* VDS view option */
|
||||
#define H5D_ACS_DATA_CACHE_NUM_SLOTS_NAME "rdcc_nslots" /* Size of raw data chunk cache(slots) */
|
||||
#define H5D_ACS_DATA_CACHE_BYTE_SIZE_NAME "rdcc_nbytes" /* Size of raw data chunk cache(bytes) */
|
||||
#define H5D_ACS_PREEMPT_READ_CHUNKS_NAME "rdcc_w0" /* Preemption read chunks first */
|
||||
#define H5D_ACS_VDS_VIEW_NAME "vds_view" /* VDS view option */
|
||||
#define H5D_ACS_VDS_PRINTF_GAP_NAME "vds_printf_gap" /* VDS printf gap size */
|
||||
#define H5D_ACS_APPEND_FLUSH_NAME "append_flush" /* Append flush actions */
|
||||
#define H5D_ACS_VDS_PREFIX_NAME "vds_prefix" /* VDS file prefix */
|
||||
#define H5D_ACS_APPEND_FLUSH_NAME "append_flush" /* Append flush actions */
|
||||
#define H5D_ACS_EFILE_PREFIX_NAME "external file prefix" /* External file prefix */
|
||||
|
||||
/* ======== Data transfer properties ======== */
|
||||
|
271
src/H5Dvirtual.c
271
src/H5Dvirtual.c
@ -55,6 +55,7 @@
|
||||
#include "H5Iprivate.h" /* IDs */
|
||||
#include "H5MMprivate.h" /* Memory management */
|
||||
#include "H5Oprivate.h" /* Object headers */
|
||||
#include "H5Pprivate.h" /* Property Lists */
|
||||
#include "H5Sprivate.h" /* Dataspaces */
|
||||
|
||||
|
||||
@ -731,6 +732,255 @@ done:
|
||||
FUNC_LEAVE_NOAPI(ret_value)
|
||||
} /* end H5D__virtual_delete */
|
||||
|
||||
|
||||
/*--------------------------------------------------------------------------
|
||||
* Function: H5D__virtual_build_name
|
||||
*
|
||||
* Purpose: Prepend PREFIX to FILE_NAME and store in FULL_NAME
|
||||
*
|
||||
* Return: Non-negative on success/Negative on failure
|
||||
*--------------------------------------------------------------------------*/
|
||||
static herr_t
|
||||
H5D__virtual_build_name(char *prefix, char *file_name, char **full_name/*out*/)
|
||||
{
|
||||
size_t prefix_len; /* length of prefix */
|
||||
size_t fname_len; /* Length of external link file name */
|
||||
herr_t ret_value = SUCCEED; /* Return value */
|
||||
|
||||
FUNC_ENTER_NOAPI_NOINIT
|
||||
|
||||
prefix_len = HDstrlen(prefix);
|
||||
fname_len = HDstrlen(file_name);
|
||||
|
||||
/* Allocate a buffer to hold the filename + prefix + possibly the delimiter + terminating null byte */
|
||||
if(NULL == (*full_name = (char *)H5MM_malloc(prefix_len + fname_len + 2)))
|
||||
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "unable to allocate filename buffer")
|
||||
|
||||
/* Compose the full file name */
|
||||
HDsnprintf(*full_name, (prefix_len + fname_len + 2), "%s%s%s", prefix,
|
||||
(H5_CHECK_DELIMITER(prefix[prefix_len - 1]) ? "" : H5_DIR_SEPS), file_name);
|
||||
|
||||
done:
|
||||
FUNC_LEAVE_NOAPI(ret_value)
|
||||
} /* H5D__virtual_build_name() */
|
||||
|
||||
|
||||
/*--------------------------------------------------------------------------
|
||||
* Function: H5D_getenv_prefix_name --
|
||||
*
|
||||
* Purpose: Get the first pathname in the list of pathnames stored in env_prefix,
|
||||
* which is separated by the environment delimiter.
|
||||
* env_prefix is modified to point to the remaining pathnames
|
||||
* in the list.
|
||||
*
|
||||
* Return: A pointer to a pathname
|
||||
--------------------------------------------------------------------------*/
|
||||
static char *
|
||||
H5D_getenv_prefix_name(char **env_prefix/*in,out*/)
|
||||
{
|
||||
char *retptr=NULL;
|
||||
char *strret=NULL;
|
||||
|
||||
FUNC_ENTER_NOAPI_NOINIT_NOERR
|
||||
|
||||
strret = HDstrchr(*env_prefix, H5_COLON_SEPC);
|
||||
if (strret == NULL) {
|
||||
retptr = *env_prefix;
|
||||
*env_prefix = strret;
|
||||
} else {
|
||||
retptr = *env_prefix;
|
||||
*env_prefix = strret + 1;
|
||||
*strret = '\0';
|
||||
}
|
||||
|
||||
FUNC_LEAVE_NOAPI(retptr)
|
||||
} /* end H5D_getenv_prefix_name() */
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: H5D__virtual_open_file
|
||||
*
|
||||
* Purpose: Attempts to open a source dataset file.
|
||||
*
|
||||
* Return: Non-negative on success/Negative on failure
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
static H5F_t *
|
||||
H5D__virtual_open_file(hid_t plist_id, const H5F_t *vdset_file,
|
||||
const char *file_name,
|
||||
hid_t fapl_id, hid_t dxpl_id)
|
||||
{
|
||||
H5F_t *src_file = NULL; /* Source file */
|
||||
H5F_t *ret_value = NULL; /* Actual return value */
|
||||
char *full_name = NULL; /* File name with prefix */
|
||||
char *my_prefix; /* Library's copy of the prefix */
|
||||
unsigned intent; /* File access permissions */
|
||||
char *actual_file_name = NULL; /* Virtual file's actual name */
|
||||
char *temp_file_name = NULL; /* Temporary pointer to file name */
|
||||
size_t temp_file_name_len; /* Length of temporary file name */
|
||||
|
||||
FUNC_ENTER_STATIC
|
||||
|
||||
/* Simplify intent flags for open calls */
|
||||
intent = H5F_INTENT(vdset_file);
|
||||
intent &= (H5F_ACC_RDWR | H5F_ACC_SWMR_WRITE | H5F_ACC_SWMR_READ);
|
||||
|
||||
/* Copy the file name to use */
|
||||
if(NULL == (temp_file_name = H5MM_strdup(file_name)))
|
||||
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed")
|
||||
temp_file_name_len = HDstrlen(temp_file_name);
|
||||
|
||||
/* target file_name is an absolute pathname: see RM for detailed description */
|
||||
if(H5_CHECK_ABSOLUTE(file_name) || H5_CHECK_ABS_PATH(file_name)) {
|
||||
/* Try opening file */
|
||||
if(NULL == (src_file = H5F_open(file_name, intent, H5P_FILE_CREATE_DEFAULT, fapl_id, dxpl_id))) {
|
||||
char *ptr;
|
||||
|
||||
H5E_clear_stack(NULL);
|
||||
|
||||
/* get last component of file_name */
|
||||
H5_GET_LAST_DELIMITER(file_name, ptr)
|
||||
HDassert(ptr);
|
||||
|
||||
/* Increment past delimiter */
|
||||
ptr++;
|
||||
|
||||
/* Copy into the temp. file name */
|
||||
HDstrncpy(temp_file_name, ptr, temp_file_name_len);
|
||||
temp_file_name[temp_file_name_len - 1] = '\0';
|
||||
} /* end if */
|
||||
} /* end if */
|
||||
else if(H5_CHECK_ABS_DRIVE(file_name)) {
|
||||
/* Try opening file */
|
||||
if(NULL == (src_file = H5F_open(file_name, intent, H5P_FILE_CREATE_DEFAULT, fapl_id, dxpl_id))) {
|
||||
|
||||
H5E_clear_stack(NULL);
|
||||
|
||||
/* strip "<drive-letter>:" */
|
||||
HDstrncpy(temp_file_name, &file_name[2], temp_file_name_len);
|
||||
temp_file_name[temp_file_name_len - 1] = '\0';
|
||||
} /* end if */
|
||||
} /* end if */
|
||||
|
||||
/* try searching from paths set in the environment variable */
|
||||
if(src_file == NULL) {
|
||||
char *env_prefix;
|
||||
|
||||
if(NULL != (env_prefix = HDgetenv("HDF5_VDS_PREFIX"))) {
|
||||
char *tmp_env_prefix, *saved_env;
|
||||
|
||||
if(NULL == (saved_env = tmp_env_prefix = H5MM_strdup(env_prefix)))
|
||||
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed")
|
||||
|
||||
while((tmp_env_prefix) && (*tmp_env_prefix)) {
|
||||
char *out_prefix_name;
|
||||
|
||||
out_prefix_name = H5D_getenv_prefix_name(&tmp_env_prefix/*in,out*/);
|
||||
if(out_prefix_name && (*out_prefix_name)) {
|
||||
if(H5D__virtual_build_name(out_prefix_name, temp_file_name, &full_name/*out*/) < 0) {
|
||||
saved_env = (char *)H5MM_xfree(saved_env);
|
||||
HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, NULL, "can't prepend prefix to filename")
|
||||
} /* end if */
|
||||
|
||||
src_file = H5F_open(full_name, intent, H5P_FILE_CREATE_DEFAULT, fapl_id, dxpl_id);
|
||||
full_name = (char *)H5MM_xfree(full_name);
|
||||
if(src_file != NULL)
|
||||
break;
|
||||
H5E_clear_stack(NULL);
|
||||
} /* end if */
|
||||
} /* end while */
|
||||
saved_env = (char *)H5MM_xfree(saved_env);
|
||||
} /* end if */
|
||||
} /* end if */
|
||||
|
||||
/* try searching from property list */
|
||||
if(src_file == NULL) {
|
||||
size_t size = 0;
|
||||
H5E_BEGIN_TRY {
|
||||
size = H5Pget_virtual_prefix(plist_id, NULL, 0);
|
||||
} H5E_END_TRY;
|
||||
if(size < 0)
|
||||
my_prefix = NULL;
|
||||
else {
|
||||
/* Allocate a buffer to hold the filename + prefix + possibly the delimiter + terminating null byte */
|
||||
if(NULL == (my_prefix = (char *)H5MM_malloc(size + 1)))
|
||||
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "unable to allocate prefix buffer")
|
||||
if(H5Pget_virtual_prefix(plist_id, my_prefix, size+1) < 0)
|
||||
HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't get vds prefix")
|
||||
if(my_prefix) {
|
||||
if(H5D__virtual_build_name(my_prefix, temp_file_name, &full_name/*out*/) < 0)
|
||||
HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, NULL, "can't prepend prefix to filename")
|
||||
my_prefix = (char *)H5MM_xfree(my_prefix);
|
||||
if(NULL == (src_file = H5F_open(full_name, intent, H5P_FILE_CREATE_DEFAULT, fapl_id, dxpl_id)))
|
||||
H5E_clear_stack(NULL);
|
||||
full_name = (char *)H5MM_xfree(full_name);
|
||||
}
|
||||
} /* end if */
|
||||
} /* end if */
|
||||
|
||||
/* try searching from main file's "extpath": see description in H5F_open() & H5_build_extpath() */
|
||||
if(src_file == NULL) {
|
||||
char *vdspath;
|
||||
|
||||
if(NULL != (vdspath = H5F_EXTPATH(vdset_file))) {
|
||||
if(H5D__virtual_build_name(vdspath, temp_file_name, &full_name/*out*/) < 0)
|
||||
HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, NULL, "can't prepend prefix to filename")
|
||||
if(NULL == (src_file = H5F_open(full_name, intent, H5P_FILE_CREATE_DEFAULT, fapl_id, dxpl_id)))
|
||||
H5E_clear_stack(NULL);
|
||||
full_name = (char *)H5MM_xfree(full_name);
|
||||
} /* end if */
|
||||
} /* end if */
|
||||
|
||||
/* try the relative file_name stored in temp_file_name */
|
||||
if(src_file == NULL) {
|
||||
if(NULL == (src_file = H5F_open(temp_file_name, intent, H5P_FILE_CREATE_DEFAULT, fapl_id, dxpl_id)))
|
||||
H5E_clear_stack(NULL);
|
||||
} /* end if */
|
||||
|
||||
/* try the 'resolved' name for the virtual file */
|
||||
if(src_file == NULL) {
|
||||
char *ptr = NULL;
|
||||
|
||||
/* Copy resolved file name */
|
||||
if(NULL == (actual_file_name = H5MM_strdup(H5F_ACTUAL_NAME(vdset_file))))
|
||||
HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, NULL, "can't duplicate resolved file name string")
|
||||
|
||||
/* get last component of file_name */
|
||||
H5_GET_LAST_DELIMITER(actual_file_name, ptr)
|
||||
if(!ptr)
|
||||
HGOTO_ERROR(H5E_DATASET, H5E_CANTOPENFILE, NULL, "unable to open vds file, vds file name = '%s', temp_file_name = '%s'", file_name, temp_file_name)
|
||||
|
||||
/* Truncate filename portion from actual file name path */
|
||||
*ptr = '\0';
|
||||
|
||||
/* Build new file name for the external file */
|
||||
if(H5D__virtual_build_name(actual_file_name, temp_file_name, &full_name/*out*/) < 0)
|
||||
HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, NULL, "can't prepend prefix to filename")
|
||||
actual_file_name = (char *)H5MM_xfree(actual_file_name);
|
||||
|
||||
/* Try opening with the resolved name */
|
||||
if(NULL == (src_file = H5F_open(full_name, intent, H5P_FILE_CREATE_DEFAULT, fapl_id, dxpl_id)))
|
||||
HGOTO_ERROR(H5E_DATASET, H5E_CANTOPENFILE, NULL, "unable to open vds file, vds file name = '%s', temp_file_name = '%s'", file_name, temp_file_name)
|
||||
full_name = (char *)H5MM_xfree(full_name);
|
||||
} /* end if */
|
||||
|
||||
/* Success */
|
||||
ret_value = src_file;
|
||||
done:
|
||||
if((NULL == ret_value) && src_file)
|
||||
if(H5F_try_close(src_file, NULL) < 0)
|
||||
HDONE_ERROR(H5E_DATASET, H5E_CANTCLOSEFILE, NULL, "can't close source file")
|
||||
if(my_prefix)
|
||||
my_prefix = (char *)H5MM_xfree(my_prefix);
|
||||
if(full_name)
|
||||
full_name = (char *)H5MM_xfree(full_name);
|
||||
if(temp_file_name)
|
||||
temp_file_name = (char *)H5MM_xfree(temp_file_name);
|
||||
if(actual_file_name)
|
||||
actual_file_name = (char *)H5MM_xfree(actual_file_name);
|
||||
|
||||
FUNC_LEAVE_NOAPI(ret_value)
|
||||
} /* H5D__virtual_open_file() */
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: H5D__virtual_open_source_dset
|
||||
@ -750,9 +1000,13 @@ H5D__virtual_open_source_dset(const H5D_t *vdset,
|
||||
H5O_storage_virtual_srcdset_t *source_dset, hid_t dxpl_id)
|
||||
{
|
||||
H5F_t *src_file = NULL; /* Source file */
|
||||
char *vds_prefix = NULL; /* Source file vds_prefix */
|
||||
hbool_t src_file_open = FALSE; /* Whether we have opened and need to close src_file */
|
||||
H5G_loc_t src_root_loc; /* Object location of source file root group */
|
||||
herr_t ret_value = SUCCEED; /* Return value */
|
||||
char *full_name = NULL; /* File name with prefix */
|
||||
unsigned intent; /* File access permissions */
|
||||
hid_t plist_id = -1; /* Property list pointer */
|
||||
|
||||
FUNC_ENTER_STATIC
|
||||
|
||||
@ -765,8 +1019,9 @@ H5D__virtual_open_source_dset(const H5D_t *vdset,
|
||||
|
||||
/* Check if we need to open the source file */
|
||||
if(HDstrcmp(source_dset->file_name, ".")) {
|
||||
/* Open the source file */
|
||||
if(NULL == (src_file = H5F_open(source_dset->file_name, H5F_INTENT(vdset->oloc.file) & (H5F_ACC_RDWR | H5F_ACC_SWMR_WRITE | H5F_ACC_SWMR_READ), H5P_FILE_CREATE_DEFAULT, vdset->shared->layout.storage.u.virt.source_fapl, dxpl_id)))
|
||||
if((plist_id = H5D_get_access_plist(vdset)) < 0)
|
||||
HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "Can't get access plist")
|
||||
if(NULL == (src_file = H5D__virtual_open_file(plist_id, vdset->oloc.file, source_dset->file_name, vdset->shared->layout.storage.u.virt.source_fapl, dxpl_id)))
|
||||
H5E_clear_stack(NULL); /* Quick hack until proper support for H5Fopen with missing file is implemented */
|
||||
else
|
||||
src_file_open = TRUE;
|
||||
@ -803,6 +1058,8 @@ H5D__virtual_open_source_dset(const H5D_t *vdset,
|
||||
} /* end if */
|
||||
|
||||
done:
|
||||
if(plist_id >= 0)
|
||||
H5Pclose(plist_id);
|
||||
/* Close source file */
|
||||
if(src_file_open)
|
||||
if(H5F_try_close(src_file, NULL) < 0)
|
||||
@ -1407,7 +1664,7 @@ H5D__virtual_set_extent_unlim(const H5D_t *dset, hid_t dxpl_id)
|
||||
HGOTO_ERROR(H5E_DATASET, H5E_CANTCLIP, FAIL, "failed to clip unlimited selection")
|
||||
} /* end if */
|
||||
|
||||
/* Update cached values unlim_extent_source and
|
||||
/* Update cached values unlim_extent_source and
|
||||
* clip_size_virtual */
|
||||
storage->list[i].unlim_extent_source = curr_dims[storage->list[i].unlim_dim_source];
|
||||
storage->list[i].clip_size_virtual = clip_size;
|
||||
@ -1559,7 +1816,7 @@ H5D__virtual_set_extent_unlim(const H5D_t *dset, hid_t dxpl_id)
|
||||
HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to modify size of data space")
|
||||
|
||||
/* Mark the space as dirty, for later writing to the file */
|
||||
if(H5F_INTENT(dset->oloc.file) & H5F_ACC_RDWR)
|
||||
if(H5F_INTENT(dset->oloc.file) & H5F_ACC_RDWR)
|
||||
if(H5D__mark(dset, dxpl_id, H5D_MARK_SPACE) < 0)
|
||||
HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "unable to mark dataspace as dirty")
|
||||
} /* end if */
|
||||
@ -2246,7 +2503,7 @@ H5D__virtual_pre_io(H5D_io_info_t *io_info,
|
||||
HGOTO_ERROR(H5E_DATASET, H5E_CLOSEERROR, FAIL, "can't close projected memory space")
|
||||
storage->list[i].sub_dset[j].projected_mem_space = NULL;
|
||||
} /* end if */
|
||||
else
|
||||
else
|
||||
*tot_nelmts += (hsize_t)select_nelmts;
|
||||
} /* end if */
|
||||
} /* end for */
|
||||
@ -2265,7 +2522,7 @@ H5D__virtual_pre_io(H5D_io_info_t *io_info,
|
||||
/* Check if anything is selected */
|
||||
if(select_nelmts > (hssize_t)0) {
|
||||
/* Open source dataset */
|
||||
if(!storage->list[i].source_dset.dset)
|
||||
if(!storage->list[i].source_dset.dset)
|
||||
/* Try to open dataset */
|
||||
if(H5D__virtual_open_source_dset(io_info->dset, &storage->list[i], &storage->list[i].source_dset, io_info->md_dxpl_id) < 0)
|
||||
HGOTO_ERROR(H5E_DATASET, H5E_CANTOPENOBJ, FAIL, "unable to open source dataset")
|
||||
@ -2506,7 +2763,7 @@ H5D__virtual_read(H5D_io_info_t *io_info, const H5D_type_info_t *type_info,
|
||||
HGOTO_ERROR(H5E_DATASET, H5E_CANTCLIP, FAIL, "unable to clip fill selection")
|
||||
|
||||
/* Write fill values to memory buffer */
|
||||
if(H5D__fill(io_info->dset->shared->dcpl_cache.fill.buf, io_info->dset->shared->type, io_info->u.rbuf,
|
||||
if(H5D__fill(io_info->dset->shared->dcpl_cache.fill.buf, io_info->dset->shared->type, io_info->u.rbuf,
|
||||
type_info->mem_type, fill_space, io_info->md_dxpl_id) < 0)
|
||||
HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "filling buf failed")
|
||||
|
||||
|
420
src/H5Fprivate.h
420
src/H5Fprivate.h
@ -25,13 +25,13 @@ typedef struct H5F_t H5F_t;
|
||||
#include "H5Fpublic.h"
|
||||
|
||||
/* Public headers needed by this file */
|
||||
#include "H5FDpublic.h" /* File drivers */
|
||||
#include "H5FDpublic.h" /* File drivers */
|
||||
|
||||
/* Private headers needed by this file */
|
||||
#ifdef H5_HAVE_PARALLEL
|
||||
#include "H5Pprivate.h" /* Property lists */
|
||||
#include "H5Pprivate.h" /* Property lists */
|
||||
#endif /* H5_HAVE_PARALLEL */
|
||||
#include "H5VMprivate.h" /* Vectors and arrays */
|
||||
#include "H5VMprivate.h" /* Vectors and arrays */
|
||||
|
||||
|
||||
/**************************/
|
||||
@ -43,68 +43,68 @@ typedef struct H5F_t H5F_t;
|
||||
* Currently, all file meta-data is little-endian.
|
||||
*/
|
||||
|
||||
# define INT16ENCODE(p, i) { \
|
||||
*(p) = (uint8_t)( (unsigned)(i) & 0xff); (p)++; \
|
||||
*(p) = (uint8_t)(((unsigned)(i) >> 8) & 0xff); (p)++; \
|
||||
# define INT16ENCODE(p, i) { \
|
||||
*(p) = (uint8_t)( (unsigned)(i) & 0xff); (p)++; \
|
||||
*(p) = (uint8_t)(((unsigned)(i) >> 8) & 0xff); (p)++; \
|
||||
}
|
||||
|
||||
# define UINT16ENCODE(p, i) { \
|
||||
*(p) = (uint8_t)( (unsigned)(i) & 0xff); (p)++; \
|
||||
*(p) = (uint8_t)(((unsigned)(i) >> 8) & 0xff); (p)++; \
|
||||
# define UINT16ENCODE(p, i) { \
|
||||
*(p) = (uint8_t)( (unsigned)(i) & 0xff); (p)++; \
|
||||
*(p) = (uint8_t)(((unsigned)(i) >> 8) & 0xff); (p)++; \
|
||||
}
|
||||
|
||||
# define INT32ENCODE(p, i) { \
|
||||
*(p) = (uint8_t)( (uint32_t)(i) & 0xff); (p)++; \
|
||||
*(p) = (uint8_t)(((uint32_t)(i) >> 8) & 0xff); (p)++; \
|
||||
*(p) = (uint8_t)(((uint32_t)(i) >> 16) & 0xff); (p)++; \
|
||||
*(p) = (uint8_t)(((uint32_t)(i) >> 24) & 0xff); (p)++; \
|
||||
# define INT32ENCODE(p, i) { \
|
||||
*(p) = (uint8_t)( (uint32_t)(i) & 0xff); (p)++; \
|
||||
*(p) = (uint8_t)(((uint32_t)(i) >> 8) & 0xff); (p)++; \
|
||||
*(p) = (uint8_t)(((uint32_t)(i) >> 16) & 0xff); (p)++; \
|
||||
*(p) = (uint8_t)(((uint32_t)(i) >> 24) & 0xff); (p)++; \
|
||||
}
|
||||
|
||||
# define UINT32ENCODE(p, i) { \
|
||||
*(p) = (uint8_t)( (i) & 0xff); (p)++; \
|
||||
*(p) = (uint8_t)(((i) >> 8) & 0xff); (p)++; \
|
||||
*(p) = (uint8_t)(((i) >> 16) & 0xff); (p)++; \
|
||||
*(p) = (uint8_t)(((i) >> 24) & 0xff); (p)++; \
|
||||
# define UINT32ENCODE(p, i) { \
|
||||
*(p) = (uint8_t)( (i) & 0xff); (p)++; \
|
||||
*(p) = (uint8_t)(((i) >> 8) & 0xff); (p)++; \
|
||||
*(p) = (uint8_t)(((i) >> 16) & 0xff); (p)++; \
|
||||
*(p) = (uint8_t)(((i) >> 24) & 0xff); (p)++; \
|
||||
}
|
||||
|
||||
/* Encode an unsigned integer into a variable-sized buffer */
|
||||
/* (Assumes that the high bits of the integer are zero) */
|
||||
# define ENCODE_VAR(p, typ, n, l) { \
|
||||
typ _n = (n); \
|
||||
size_t _i; \
|
||||
uint8_t *_p = (uint8_t*)(p); \
|
||||
\
|
||||
for(_i = 0; _i < l; _i++, _n >>= 8) \
|
||||
*_p++ = (uint8_t)(_n & 0xff); \
|
||||
(p) = (uint8_t*)(p) + l; \
|
||||
# define ENCODE_VAR(p, typ, n, l) { \
|
||||
typ _n = (n); \
|
||||
size_t _i; \
|
||||
uint8_t *_p = (uint8_t*)(p); \
|
||||
\
|
||||
for(_i = 0; _i < l; _i++, _n >>= 8) \
|
||||
*_p++ = (uint8_t)(_n & 0xff); \
|
||||
(p) = (uint8_t*)(p) + l; \
|
||||
}
|
||||
|
||||
/* Encode a 32-bit unsigned integer into a variable-sized buffer */
|
||||
/* (Assumes that the high bits of the integer are zero) */
|
||||
# define UINT32ENCODE_VAR(p, n, l) ENCODE_VAR(p, uint32_t, n, l)
|
||||
|
||||
# define INT64ENCODE(p, n) { \
|
||||
int64_t _n = (n); \
|
||||
size_t _i; \
|
||||
uint8_t *_p = (uint8_t*)(p); \
|
||||
\
|
||||
for (_i = 0; _i < sizeof(int64_t); _i++, _n >>= 8) \
|
||||
*_p++ = (uint8_t)(_n & 0xff); \
|
||||
for (/*void*/; _i < 8; _i++) \
|
||||
*_p++ = (n) < 0 ? 0xff : 0; \
|
||||
(p) = (uint8_t*)(p)+8; \
|
||||
# define INT64ENCODE(p, n) { \
|
||||
int64_t _n = (n); \
|
||||
size_t _i; \
|
||||
uint8_t *_p = (uint8_t*)(p); \
|
||||
\
|
||||
for (_i = 0; _i < sizeof(int64_t); _i++, _n >>= 8) \
|
||||
*_p++ = (uint8_t)(_n & 0xff); \
|
||||
for (/*void*/; _i < 8; _i++) \
|
||||
*_p++ = (n) < 0 ? 0xff : 0; \
|
||||
(p) = (uint8_t*)(p)+8; \
|
||||
}
|
||||
|
||||
# define UINT64ENCODE(p, n) { \
|
||||
uint64_t _n = (n); \
|
||||
size_t _i; \
|
||||
uint8_t *_p = (uint8_t*)(p); \
|
||||
\
|
||||
for (_i = 0; _i < sizeof(uint64_t); _i++, _n >>= 8) \
|
||||
*_p++ = (uint8_t)(_n & 0xff); \
|
||||
for (/*void*/; _i < 8; _i++) \
|
||||
*_p++ = 0; \
|
||||
(p) = (uint8_t*)(p) + 8; \
|
||||
# define UINT64ENCODE(p, n) { \
|
||||
uint64_t _n = (n); \
|
||||
size_t _i; \
|
||||
uint8_t *_p = (uint8_t*)(p); \
|
||||
\
|
||||
for (_i = 0; _i < sizeof(uint64_t); _i++, _n >>= 8) \
|
||||
*_p++ = (uint8_t)(_n & 0xff); \
|
||||
for (/*void*/; _i < 8; _i++) \
|
||||
*_p++ = 0; \
|
||||
(p) = (uint8_t*)(p) + 8; \
|
||||
}
|
||||
|
||||
/* Encode a 64-bit unsigned integer into a variable-sized buffer */
|
||||
@ -113,31 +113,31 @@ typedef struct H5F_t H5F_t;
|
||||
|
||||
/* Encode a 64-bit unsigned integer and its length into a variable-sized buffer */
|
||||
/* (Assumes that the high bits of the integer are zero) */
|
||||
# define UINT64ENCODE_VARLEN(p, n) { \
|
||||
uint64_t __n = (uint64_t)(n); \
|
||||
unsigned _s = H5VM_limit_enc_size(__n); \
|
||||
\
|
||||
*(p)++ = (uint8_t)_s; \
|
||||
UINT64ENCODE_VAR(p, __n, _s); \
|
||||
# define UINT64ENCODE_VARLEN(p, n) { \
|
||||
uint64_t __n = (uint64_t)(n); \
|
||||
unsigned _s = H5VM_limit_enc_size(__n); \
|
||||
\
|
||||
*(p)++ = (uint8_t)_s; \
|
||||
UINT64ENCODE_VAR(p, __n, _s); \
|
||||
}
|
||||
|
||||
# define H5_ENCODE_UNSIGNED(p, n) { \
|
||||
HDcompile_assert(sizeof(unsigned) == sizeof(uint32_t)); \
|
||||
UINT32ENCODE(p, n) \
|
||||
# define H5_ENCODE_UNSIGNED(p, n) { \
|
||||
HDcompile_assert(sizeof(unsigned) == sizeof(uint32_t)); \
|
||||
UINT32ENCODE(p, n) \
|
||||
}
|
||||
|
||||
/* Assumes the endianness of uint64_t is the same as double */
|
||||
# define H5_ENCODE_DOUBLE(p, n) { \
|
||||
uint64_t _n; \
|
||||
size_t _u; \
|
||||
uint8_t *_p = (uint8_t*)(p); \
|
||||
\
|
||||
HDcompile_assert(sizeof(double) == 8); \
|
||||
HDcompile_assert(sizeof(double) == sizeof(uint64_t)); \
|
||||
HDmemcpy(&_n, &n, sizeof(double)); \
|
||||
for(_u = 0; _u < sizeof(uint64_t); _u++, _n >>= 8) \
|
||||
*_p++ = (uint8_t)(_n & 0xff); \
|
||||
(p) = (uint8_t *)(p) + 8; \
|
||||
# define H5_ENCODE_DOUBLE(p, n) { \
|
||||
uint64_t _n; \
|
||||
size_t _u; \
|
||||
uint8_t *_p = (uint8_t*)(p); \
|
||||
\
|
||||
HDcompile_assert(sizeof(double) == 8); \
|
||||
HDcompile_assert(sizeof(double) == sizeof(uint64_t)); \
|
||||
HDmemcpy(&_n, &n, sizeof(double)); \
|
||||
for(_u = 0; _u < sizeof(uint64_t); _u++, _n >>= 8) \
|
||||
*_p++ = (uint8_t)(_n & 0xff); \
|
||||
(p) = (uint8_t *)(p) + 8; \
|
||||
}
|
||||
|
||||
/* DECODE converts little endian bytes pointed by p to integer values and store
|
||||
@ -148,68 +148,68 @@ typedef struct H5F_t H5F_t;
|
||||
* correctly even if i is actually a 64bit int like in a Cray.
|
||||
*/
|
||||
|
||||
# define INT16DECODE(p, i) { \
|
||||
(i) = (int16_t)((*(p) & 0xff)); (p)++; \
|
||||
# define INT16DECODE(p, i) { \
|
||||
(i) = (int16_t)((*(p) & 0xff)); (p)++; \
|
||||
(i) |= (int16_t)(((*(p) & 0xff) << 8) | \
|
||||
((*(p) & 0x80) ? ~0xffff : 0x0)); (p)++; \
|
||||
((*(p) & 0x80) ? ~0xffff : 0x0)); (p)++; \
|
||||
}
|
||||
|
||||
# define UINT16DECODE(p, i) { \
|
||||
(i) = (uint16_t) (*(p) & 0xff); (p)++; \
|
||||
(i) |= (uint16_t)((*(p) & 0xff) << 8); (p)++; \
|
||||
# define UINT16DECODE(p, i) { \
|
||||
(i) = (uint16_t) (*(p) & 0xff); (p)++; \
|
||||
(i) |= (uint16_t)((*(p) & 0xff) << 8); (p)++; \
|
||||
}
|
||||
|
||||
# define INT32DECODE(p, i) { \
|
||||
(i) = ((int32_t)(*(p) & (unsigned)0xff)); (p)++; \
|
||||
(i) |= ((int32_t)(*(p) & (unsigned)0xff) << 8); (p)++; \
|
||||
(i) |= ((int32_t)(*(p) & (unsigned)0xff) << 16); (p)++; \
|
||||
# define INT32DECODE(p, i) { \
|
||||
(i) = ((int32_t)(*(p) & (unsigned)0xff)); (p)++; \
|
||||
(i) |= ((int32_t)(*(p) & (unsigned)0xff) << 8); (p)++; \
|
||||
(i) |= ((int32_t)(*(p) & (unsigned)0xff) << 16); (p)++; \
|
||||
(i) |= ((int32_t)(((*(p) & (unsigned)0xff) << 24) | \
|
||||
((*(p) & (unsigned)0x80) ? (unsigned)(~0xffffffff) : (unsigned)0x0))); (p)++; \
|
||||
}
|
||||
|
||||
# define UINT32DECODE(p, i) { \
|
||||
(i) = (uint32_t)(*(p) & 0xff); (p)++; \
|
||||
(i) |= ((uint32_t)(*(p) & 0xff) << 8); (p)++; \
|
||||
(i) |= ((uint32_t)(*(p) & 0xff) << 16); (p)++; \
|
||||
(i) |= ((uint32_t)(*(p) & 0xff) << 24); (p)++; \
|
||||
# define UINT32DECODE(p, i) { \
|
||||
(i) = (uint32_t)(*(p) & 0xff); (p)++; \
|
||||
(i) |= ((uint32_t)(*(p) & 0xff) << 8); (p)++; \
|
||||
(i) |= ((uint32_t)(*(p) & 0xff) << 16); (p)++; \
|
||||
(i) |= ((uint32_t)(*(p) & 0xff) << 24); (p)++; \
|
||||
}
|
||||
|
||||
/* Decode a variable-sized buffer */
|
||||
/* (Assumes that the high bits of the integer will be zero) */
|
||||
# define DECODE_VAR(p, n, l) { \
|
||||
size_t _i; \
|
||||
\
|
||||
n = 0; \
|
||||
(p) += l; \
|
||||
for (_i = 0; _i < l; _i++) \
|
||||
n = (n << 8) | *(--p); \
|
||||
(p) += l; \
|
||||
# define DECODE_VAR(p, n, l) { \
|
||||
size_t _i; \
|
||||
\
|
||||
n = 0; \
|
||||
(p) += l; \
|
||||
for (_i = 0; _i < l; _i++) \
|
||||
n = (n << 8) | *(--p); \
|
||||
(p) += l; \
|
||||
}
|
||||
|
||||
/* Decode a variable-sized buffer into a 32-bit unsigned integer */
|
||||
/* (Assumes that the high bits of the integer will be zero) */
|
||||
# define UINT32DECODE_VAR(p, n, l) DECODE_VAR(p, n, l)
|
||||
|
||||
# define INT64DECODE(p, n) { \
|
||||
/* WE DON'T CHECK FOR OVERFLOW! */ \
|
||||
size_t _i; \
|
||||
\
|
||||
n = 0; \
|
||||
(p) += 8; \
|
||||
for (_i = 0; _i < sizeof(int64_t); _i++) \
|
||||
n = (n << 8) | *(--p); \
|
||||
(p) += 8; \
|
||||
# define INT64DECODE(p, n) { \
|
||||
/* WE DON'T CHECK FOR OVERFLOW! */ \
|
||||
size_t _i; \
|
||||
\
|
||||
n = 0; \
|
||||
(p) += 8; \
|
||||
for (_i = 0; _i < sizeof(int64_t); _i++) \
|
||||
n = (n << 8) | *(--p); \
|
||||
(p) += 8; \
|
||||
}
|
||||
|
||||
# define UINT64DECODE(p, n) { \
|
||||
/* WE DON'T CHECK FOR OVERFLOW! */ \
|
||||
size_t _i; \
|
||||
\
|
||||
n = 0; \
|
||||
(p) += 8; \
|
||||
for (_i = 0; _i < sizeof(uint64_t); _i++) \
|
||||
n = (n << 8) | *(--p); \
|
||||
(p) += 8; \
|
||||
# define UINT64DECODE(p, n) { \
|
||||
/* WE DON'T CHECK FOR OVERFLOW! */ \
|
||||
size_t _i; \
|
||||
\
|
||||
n = 0; \
|
||||
(p) += 8; \
|
||||
for (_i = 0; _i < sizeof(uint64_t); _i++) \
|
||||
n = (n << 8) | *(--p); \
|
||||
(p) += 8; \
|
||||
}
|
||||
|
||||
/* Decode a variable-sized buffer into a 64-bit unsigned integer */
|
||||
@ -218,58 +218,58 @@ typedef struct H5F_t H5F_t;
|
||||
|
||||
/* Decode a 64-bit unsigned integer and its length from a variable-sized buffer */
|
||||
/* (Assumes that the high bits of the integer will be zero) */
|
||||
# define UINT64DECODE_VARLEN(p, n) { \
|
||||
unsigned _s = *(p)++; \
|
||||
\
|
||||
UINT64DECODE_VAR(p, n, _s); \
|
||||
# define UINT64DECODE_VARLEN(p, n) { \
|
||||
unsigned _s = *(p)++; \
|
||||
\
|
||||
UINT64DECODE_VAR(p, n, _s); \
|
||||
}
|
||||
|
||||
# define H5_DECODE_UNSIGNED(p, n) { \
|
||||
HDcompile_assert(sizeof(unsigned) == sizeof(uint32_t)); \
|
||||
UINT32DECODE(p, n) \
|
||||
# define H5_DECODE_UNSIGNED(p, n) { \
|
||||
HDcompile_assert(sizeof(unsigned) == sizeof(uint32_t)); \
|
||||
UINT32DECODE(p, n) \
|
||||
}
|
||||
|
||||
/* Assumes the endianness of uint64_t is the same as double */
|
||||
# define H5_DECODE_DOUBLE(p, n) { \
|
||||
uint64_t _n; \
|
||||
size_t _u; \
|
||||
\
|
||||
HDcompile_assert(sizeof(double) == 8); \
|
||||
HDcompile_assert(sizeof(double) == sizeof(uint64_t)); \
|
||||
_n = 0; \
|
||||
(p) += 8; \
|
||||
for(_u = 0; _u < sizeof(uint64_t); _u++) \
|
||||
_n = (_n << 8) | *(--p); \
|
||||
HDmemcpy(&(n), &_n, sizeof(double)); \
|
||||
(p) += 8; \
|
||||
# define H5_DECODE_DOUBLE(p, n) { \
|
||||
uint64_t _n; \
|
||||
size_t _u; \
|
||||
\
|
||||
HDcompile_assert(sizeof(double) == 8); \
|
||||
HDcompile_assert(sizeof(double) == sizeof(uint64_t)); \
|
||||
_n = 0; \
|
||||
(p) += 8; \
|
||||
for(_u = 0; _u < sizeof(uint64_t); _u++) \
|
||||
_n = (_n << 8) | *(--p); \
|
||||
HDmemcpy(&(n), &_n, sizeof(double)); \
|
||||
(p) += 8; \
|
||||
}
|
||||
|
||||
/* Address-related macros */
|
||||
#define H5F_addr_overflow(X,Z) (HADDR_UNDEF==(X) || \
|
||||
HADDR_UNDEF==(X)+(haddr_t)(Z) || \
|
||||
(X)+(haddr_t)(Z)<(X))
|
||||
#define H5F_addr_defined(X) ((X)!=HADDR_UNDEF)
|
||||
#define H5F_addr_overflow(X,Z) (HADDR_UNDEF==(X) || \
|
||||
HADDR_UNDEF==(X)+(haddr_t)(Z) || \
|
||||
(X)+(haddr_t)(Z)<(X))
|
||||
#define H5F_addr_defined(X) ((X)!=HADDR_UNDEF)
|
||||
/* The H5F_addr_eq() macro guarantees that Y is not HADDR_UNDEF by making
|
||||
* certain that X is not HADDR_UNDEF and then checking that X equals Y
|
||||
*/
|
||||
#define H5F_addr_eq(X,Y) ((X)!=HADDR_UNDEF && \
|
||||
(X)==(Y))
|
||||
#define H5F_addr_ne(X,Y) (!H5F_addr_eq((X),(Y)))
|
||||
#define H5F_addr_lt(X,Y) ((X)!=HADDR_UNDEF && \
|
||||
(Y)!=HADDR_UNDEF && \
|
||||
(X)<(Y))
|
||||
#define H5F_addr_le(X,Y) ((X)!=HADDR_UNDEF && \
|
||||
(Y)!=HADDR_UNDEF && \
|
||||
(X)<=(Y))
|
||||
#define H5F_addr_gt(X,Y) ((X)!=HADDR_UNDEF && \
|
||||
(Y)!=HADDR_UNDEF && \
|
||||
(X)>(Y))
|
||||
#define H5F_addr_ge(X,Y) ((X)!=HADDR_UNDEF && \
|
||||
(Y)!=HADDR_UNDEF && \
|
||||
(X)>=(Y))
|
||||
#define H5F_addr_cmp(X,Y) (H5F_addr_eq((X), (Y)) ? 0 : \
|
||||
(H5F_addr_lt((X), (Y)) ? -1 : 1))
|
||||
#define H5F_addr_pow2(N) ((haddr_t)1<<(N))
|
||||
#define H5F_addr_eq(X,Y) ((X)!=HADDR_UNDEF && \
|
||||
(X)==(Y))
|
||||
#define H5F_addr_ne(X,Y) (!H5F_addr_eq((X),(Y)))
|
||||
#define H5F_addr_lt(X,Y) ((X)!=HADDR_UNDEF && \
|
||||
(Y)!=HADDR_UNDEF && \
|
||||
(X)<(Y))
|
||||
#define H5F_addr_le(X,Y) ((X)!=HADDR_UNDEF && \
|
||||
(Y)!=HADDR_UNDEF && \
|
||||
(X)<=(Y))
|
||||
#define H5F_addr_gt(X,Y) ((X)!=HADDR_UNDEF && \
|
||||
(Y)!=HADDR_UNDEF && \
|
||||
(X)>(Y))
|
||||
#define H5F_addr_ge(X,Y) ((X)!=HADDR_UNDEF && \
|
||||
(Y)!=HADDR_UNDEF && \
|
||||
(X)>=(Y))
|
||||
#define H5F_addr_cmp(X,Y) (H5F_addr_eq((X), (Y)) ? 0 : \
|
||||
(H5F_addr_lt((X), (Y)) ? -1 : 1))
|
||||
#define H5F_addr_pow2(N) ((haddr_t)1<<(N))
|
||||
#define H5F_addr_overlap(O1,L1,O2,L2) (((O1) < (O2) && ((O1) + (L1)) > (O2)) || \
|
||||
((O1) >= (O2) && (O1) < ((O2) + (L2))))
|
||||
|
||||
@ -294,7 +294,7 @@ typedef struct H5F_t H5F_t;
|
||||
#define H5F_BASE_ADDR(F) ((F)->shared->sblock->base_addr)
|
||||
#define H5F_SYM_LEAF_K(F) ((F)->shared->sblock->sym_leaf_k)
|
||||
#define H5F_KVALUE(F,T) ((F)->shared->sblock->btree_k[(T)->id])
|
||||
#define H5F_NREFS(F) ((F)->shared->nrefs)
|
||||
#define H5F_NREFS(F) ((F)->shared->nrefs)
|
||||
#define H5F_SIZEOF_ADDR(F) ((F)->shared->sizeof_addr)
|
||||
#define H5F_SIZEOF_SIZE(F) ((F)->shared->sizeof_size)
|
||||
#define H5F_SOHM_ADDR(F) ((F)->shared->sohm_addr)
|
||||
@ -325,8 +325,8 @@ typedef struct H5F_t H5F_t;
|
||||
#define H5F_USE_MDC_LOGGING(F) ((F)->shared->use_mdc_logging)
|
||||
#define H5F_START_MDC_LOG_ON_ACCESS(F) ((F)->shared->start_mdc_log_on_access)
|
||||
#define H5F_MDC_LOG_LOCATION(F) ((F)->shared->mdc_log_location)
|
||||
#define H5F_ALIGNMENT(F) ((F)->shared->alignment)
|
||||
#define H5F_THRESHOLD(F) ((F)->shared->threshold)
|
||||
#define H5F_ALIGNMENT(F) ((F)->shared->alignment)
|
||||
#define H5F_THRESHOLD(F) ((F)->shared->threshold)
|
||||
#define H5F_PGEND_META_THRES(F) ((F)->shared->fs.pgend_meta_thres)
|
||||
#define H5F_POINT_OF_NO_RETURN(F) ((F)->shared->fs.point_of_no_return)
|
||||
#define H5F_FIRST_ALLOC_DEALLOC(F) ((F)->shared->first_alloc_dealloc)
|
||||
@ -351,7 +351,7 @@ typedef struct H5F_t H5F_t;
|
||||
#define H5F_BASE_ADDR(F) (H5F_get_base_addr(F))
|
||||
#define H5F_SYM_LEAF_K(F) (H5F_sym_leaf_k(F))
|
||||
#define H5F_KVALUE(F,T) (H5F_Kvalue(F,T))
|
||||
#define H5F_NREFS(F) (H5F_get_nrefs(F))
|
||||
#define H5F_NREFS(F) (H5F_get_nrefs(F))
|
||||
#define H5F_SIZEOF_ADDR(F) (H5F_sizeof_addr(F))
|
||||
#define H5F_SIZEOF_SIZE(F) (H5F_sizeof_size(F))
|
||||
#define H5F_SOHM_ADDR(F) (H5F_get_sohm_addr(F))
|
||||
@ -382,8 +382,8 @@ typedef struct H5F_t H5F_t;
|
||||
#define H5F_USE_MDC_LOGGING(F) (H5F_use_mdc_logging(F))
|
||||
#define H5F_START_MDC_LOG_ON_ACCESS(F) (H5F_start_mdc_log_on_access(F))
|
||||
#define H5F_MDC_LOG_LOCATION(F) (H5F_mdc_log_location(F))
|
||||
#define H5F_ALIGNMENT(F) (H5F_get_alignment(F))
|
||||
#define H5F_THRESHOLD(F) (H5F_get_threshold(F))
|
||||
#define H5F_ALIGNMENT(F) (H5F_get_alignment(F))
|
||||
#define H5F_THRESHOLD(F) (H5F_get_threshold(F))
|
||||
#define H5F_PGEND_META_THRES(F) (H5F_get_pgend_meta_thres(F))
|
||||
#define H5F_POINT_OF_NO_RETURN(F) (H5F_get_point_of_no_return(F))
|
||||
#define H5F_FIRST_ALLOC_DEALLOC(F) (H5F_get_first_alloc_dealloc(F))
|
||||
@ -392,32 +392,32 @@ typedef struct H5F_t H5F_t;
|
||||
|
||||
|
||||
/* Macros to encode/decode offset/length's for storing in the file */
|
||||
#define H5F_ENCODE_OFFSET(f,p,o) switch(H5F_SIZEOF_ADDR(f)) { \
|
||||
case 4: UINT32ENCODE(p,o); break; \
|
||||
case 8: UINT64ENCODE(p,o); break; \
|
||||
case 2: UINT16ENCODE(p,o); break; \
|
||||
#define H5F_ENCODE_OFFSET(f,p,o) switch(H5F_SIZEOF_ADDR(f)) { \
|
||||
case 4: UINT32ENCODE(p,o); break; \
|
||||
case 8: UINT64ENCODE(p,o); break; \
|
||||
case 2: UINT16ENCODE(p,o); break; \
|
||||
}
|
||||
|
||||
#define H5F_DECODE_OFFSET(f,p,o) switch (H5F_SIZEOF_ADDR (f)) { \
|
||||
case 4: UINT32DECODE(p, o); break; \
|
||||
case 8: UINT64DECODE(p, o); break; \
|
||||
case 2: UINT16DECODE(p, o); break; \
|
||||
#define H5F_DECODE_OFFSET(f,p,o) switch (H5F_SIZEOF_ADDR (f)) { \
|
||||
case 4: UINT32DECODE(p, o); break; \
|
||||
case 8: UINT64DECODE(p, o); break; \
|
||||
case 2: UINT16DECODE(p, o); break; \
|
||||
}
|
||||
|
||||
#define H5F_ENCODE_LENGTH_LEN(p,l,s) switch(s) { \
|
||||
case 4: UINT32ENCODE(p,l); break; \
|
||||
case 8: UINT64ENCODE(p,l); break; \
|
||||
case 2: UINT16ENCODE(p,l); break; \
|
||||
default: HDassert("bad sizeof size" && 0); \
|
||||
#define H5F_ENCODE_LENGTH_LEN(p,l,s) switch(s) { \
|
||||
case 4: UINT32ENCODE(p,l); break; \
|
||||
case 8: UINT64ENCODE(p,l); break; \
|
||||
case 2: UINT16ENCODE(p,l); break; \
|
||||
default: HDassert("bad sizeof size" && 0); \
|
||||
}
|
||||
|
||||
#define H5F_ENCODE_LENGTH(f,p,l) H5F_ENCODE_LENGTH_LEN(p,l,H5F_SIZEOF_SIZE(f))
|
||||
|
||||
#define H5F_DECODE_LENGTH_LEN(p,l,s) switch(s) { \
|
||||
case 4: UINT32DECODE(p,l); break; \
|
||||
case 8: UINT64DECODE(p,l); break; \
|
||||
case 2: UINT16DECODE(p,l); break; \
|
||||
default: HDassert("bad sizeof size" && 0); \
|
||||
#define H5F_DECODE_LENGTH_LEN(p,l,s) switch(s) { \
|
||||
case 4: UINT32DECODE(p,l); break; \
|
||||
case 8: UINT64DECODE(p,l); break; \
|
||||
case 2: UINT16DECODE(p,l); break; \
|
||||
default: HDassert("bad sizeof size" && 0); \
|
||||
}
|
||||
|
||||
#define H5F_DECODE_LENGTH(f,p,l) H5F_DECODE_LENGTH_LEN(p,l,H5F_SIZEOF_SIZE(f))
|
||||
@ -427,13 +427,13 @@ typedef struct H5F_t H5F_t;
|
||||
* with.
|
||||
*/
|
||||
#if (H5_SIZEOF_SIZE_T >= H5_SIZEOF_OFF_T)
|
||||
# define H5F_OVERFLOW_SIZET2OFFT(X) \
|
||||
# define H5F_OVERFLOW_SIZET2OFFT(X) \
|
||||
((size_t)(X)>=(size_t)((size_t)1<<(8*sizeof(HDoff_t)-1)))
|
||||
#else
|
||||
# define H5F_OVERFLOW_SIZET2OFFT(X) 0
|
||||
#endif
|
||||
#if (H5_SIZEOF_HSIZE_T >= H5_SIZEOF_OFF_T)
|
||||
# define H5F_OVERFLOW_HSIZET2OFFT(X) \
|
||||
# define H5F_OVERFLOW_HSIZET2OFFT(X) \
|
||||
((hsize_t)(X) >= (hsize_t)((hsize_t)1 << (8 * sizeof(HDoff_t) - 1)))
|
||||
#else
|
||||
# define H5F_OVERFLOW_HSIZET2OFFT(X) 0
|
||||
@ -461,14 +461,14 @@ typedef struct H5F_t H5F_t;
|
||||
#define H5F_CRT_SHMSG_LIST_MAX_NAME "shmsg_list_max" /* Shared message list maximum size */
|
||||
#define H5F_CRT_SHMSG_BTREE_MIN_NAME "shmsg_btree_min" /* Shared message B-tree minimum size */
|
||||
#define H5F_CRT_FILE_SPACE_STRATEGY_NAME "file_space_strategy" /* File space handling strategy */
|
||||
#define H5F_CRT_FREE_SPACE_PERSIST_NAME "free_space_persist" /* Free-space persisting status */
|
||||
#define H5F_CRT_FREE_SPACE_PERSIST_NAME "free_space_persist" /* Free-space persisting status */
|
||||
#define H5F_CRT_FREE_SPACE_THRESHOLD_NAME "free_space_threshold" /* Free space section threshold */
|
||||
#define H5F_CRT_FILE_SPACE_PAGE_SIZE_NAME "file_space_page_size" /* File space page size */
|
||||
|
||||
|
||||
|
||||
/* ========= File Access properties ============ */
|
||||
#define H5F_ACS_META_CACHE_INIT_CONFIG_NAME "mdc_initCacheCfg" /* Initial metadata cache resize configuration */
|
||||
#define H5F_ACS_META_CACHE_INIT_CONFIG_NAME "mdc_initCacheCfg" /* Initial metadata cache resize configuration */
|
||||
#define H5F_ACS_DATA_CACHE_NUM_SLOTS_NAME "rdcc_nslots" /* Size of raw data chunk cache(slots) */
|
||||
#define H5F_ACS_DATA_CACHE_BYTE_SIZE_NAME "rdcc_nbytes" /* Size of raw data chunk cache(bytes) */
|
||||
#define H5F_ACS_PREEMPT_READ_CHUNKS_NAME "rdcc_w0" /* Preemption read chunks first */
|
||||
@ -487,7 +487,7 @@ typedef struct H5F_t H5F_t;
|
||||
#define H5F_ACS_LATEST_FORMAT_NAME "latest_format" /* 'Use latest format version' flag */
|
||||
#define H5F_ACS_WANT_POSIX_FD_NAME "want_posix_fd" /* Internal: query the file descriptor from the core VFD, instead of the memory address */
|
||||
#define H5F_ACS_METADATA_READ_ATTEMPTS_NAME "metadata_read_attempts" /* # of metadata read attempts */
|
||||
#define H5F_ACS_OBJECT_FLUSH_CB_NAME "object_flush_cb" /* Object flush callback */
|
||||
#define H5F_ACS_OBJECT_FLUSH_CB_NAME "object_flush_cb" /* Object flush callback */
|
||||
#define H5F_ACS_EFC_SIZE_NAME "efc_size" /* Size of external file cache */
|
||||
#define H5F_ACS_FILE_IMAGE_INFO_NAME "file_image_info" /* struct containing initial file image and callback info */
|
||||
#define H5F_ACS_CLEAR_STATUS_FLAGS_NAME "clear_status_flags" /* Whether to clear superblock status_flags (private property only used by h5clear) */
|
||||
@ -504,7 +504,7 @@ typedef struct H5F_t H5F_t;
|
||||
#define H5F_ACS_PAGE_BUFFER_MIN_RAW_PERC_NAME "page_buffer_min_raw_perc" /* the min raw data percentage for the page buffer cache */
|
||||
|
||||
/* ======================== File Mount properties ====================*/
|
||||
#define H5F_MNT_SYM_LOCAL_NAME "local" /* Whether absolute symlinks local to file. */
|
||||
#define H5F_MNT_SYM_LOCAL_NAME "local" /* Whether absolute symlinks local to file. */
|
||||
|
||||
|
||||
#ifdef H5_HAVE_PARALLEL
|
||||
@ -513,20 +513,20 @@ typedef struct H5F_t H5F_t;
|
||||
#endif /* H5_HAVE_PARALLEL */
|
||||
|
||||
/* Define the HDF5 file signature */
|
||||
#define H5F_SIGNATURE "\211HDF\r\n\032\n"
|
||||
#define H5F_SIGNATURE "\211HDF\r\n\032\n"
|
||||
#define H5F_SIGNATURE_LEN 8
|
||||
|
||||
/* Version #'s of the major components of the file format */
|
||||
#define HDF5_SUPERBLOCK_VERSION_DEF 0 /* The default super block format */
|
||||
#define HDF5_SUPERBLOCK_VERSION_1 1 /* Version with non-default B-tree 'K' value */
|
||||
#define HDF5_SUPERBLOCK_VERSION_2 2 /* Revised version with superblock extension and checksum */
|
||||
#define HDF5_SUPERBLOCK_VERSION_3 3 /* With file locking and consistency flags (at least this version for SWMR support) */
|
||||
#define HDF5_SUPERBLOCK_VERSION_LATEST HDF5_SUPERBLOCK_VERSION_3 /* The maximum super block format */
|
||||
#define HDF5_SUPERBLOCK_VERSION_DEF 0 /* The default super block format */
|
||||
#define HDF5_SUPERBLOCK_VERSION_1 1 /* Version with non-default B-tree 'K' value */
|
||||
#define HDF5_SUPERBLOCK_VERSION_2 2 /* Revised version with superblock extension and checksum */
|
||||
#define HDF5_SUPERBLOCK_VERSION_3 3 /* With file locking and consistency flags (at least this version for SWMR support) */
|
||||
#define HDF5_SUPERBLOCK_VERSION_LATEST HDF5_SUPERBLOCK_VERSION_3 /* The maximum super block format */
|
||||
#define HDF5_SUPERBLOCK_VERSION_V18_LATEST HDF5_SUPERBLOCK_VERSION_2 /* The latest superblock version for v18 */
|
||||
#define HDF5_FREESPACE_VERSION 0 /* of the Free-Space Info */
|
||||
#define HDF5_OBJECTDIR_VERSION 0 /* of the Object Directory format */
|
||||
#define HDF5_SHAREDHEADER_VERSION 0 /* of the Shared-Header Info */
|
||||
#define HDF5_DRIVERINFO_VERSION_0 0 /* of the Driver Information Block*/
|
||||
#define HDF5_FREESPACE_VERSION 0 /* of the Free-Space Info */
|
||||
#define HDF5_OBJECTDIR_VERSION 0 /* of the Object Directory format */
|
||||
#define HDF5_SHAREDHEADER_VERSION 0 /* of the Shared-Header Info */
|
||||
#define HDF5_DRIVERINFO_VERSION_0 0 /* of the Driver Information Block*/
|
||||
|
||||
/* B-tree internal 'K' values */
|
||||
#define HDF5_BTREE_SNODE_IK_DEF 16
|
||||
@ -536,54 +536,54 @@ typedef struct H5F_t H5F_t;
|
||||
if it is changed, the code
|
||||
must compensate. -QAK
|
||||
*/
|
||||
#define HDF5_BTREE_IK_MAX_ENTRIES 65536 /* 2^16 - 2 bytes for storing entries (children) */
|
||||
/* See format specification on version 1 B-trees */
|
||||
#define HDF5_BTREE_IK_MAX_ENTRIES 65536 /* 2^16 - 2 bytes for storing entries (children) */
|
||||
/* See format specification on version 1 B-trees */
|
||||
|
||||
/* Default file space handling strategy */
|
||||
#define H5F_FILE_SPACE_STRATEGY_DEF H5F_FSPACE_STRATEGY_FSM_AGGR
|
||||
#define H5F_FILE_SPACE_STRATEGY_DEF H5F_FSPACE_STRATEGY_FSM_AGGR
|
||||
|
||||
/* Default free space section threshold used by free-space managers */
|
||||
#define H5F_FREE_SPACE_PERSIST_DEF FALSE
|
||||
#define H5F_FREE_SPACE_PERSIST_DEF FALSE
|
||||
|
||||
/* Default free space section threshold used by free-space managers */
|
||||
#define H5F_FREE_SPACE_THRESHOLD_DEF 1
|
||||
#define H5F_FREE_SPACE_THRESHOLD_DEF 1
|
||||
|
||||
/* For paged aggregation: default file space page size when not set */
|
||||
#define H5F_FILE_SPACE_PAGE_SIZE_DEF 4096
|
||||
#define H5F_FILE_SPACE_PAGE_SIZE_DEF 4096
|
||||
/* For paged aggregation: minimum value for file space page size */
|
||||
#define H5F_FILE_SPACE_PAGE_SIZE_MIN 512
|
||||
#define H5F_FILE_SPACE_PAGE_SIZE_MIN 512
|
||||
/* For paged aggregation: maxiumum value for file space page size: 1 gigabyte */
|
||||
#define H5F_FILE_SPACE_PAGE_SIZE_MAX 1024*1024*1024
|
||||
#define H5F_FILE_SPACE_PAGE_SIZE_MAX 1024*1024*1024
|
||||
|
||||
/* For paged aggregation: drop free-space with size <= this threshold for small meta section */
|
||||
#define H5F_FILE_SPACE_PGEND_META_THRES 0
|
||||
|
||||
/* Default for threshold for alignment (can be set via H5Pset_alignment()) */
|
||||
#define H5F_ALIGN_DEF 1
|
||||
#define H5F_ALIGN_DEF 1
|
||||
/* Default for alignment (can be set via H5Pset_alignment()) */
|
||||
#define H5F_ALIGN_THRHD_DEF 1
|
||||
#define H5F_ALIGN_THRHD_DEF 1
|
||||
/* Default size for meta data aggregation block (can be set via H5Pset_meta_block_size()) */
|
||||
#define H5F_META_BLOCK_SIZE_DEF 2048
|
||||
#define H5F_META_BLOCK_SIZE_DEF 2048
|
||||
/* Default size for small data aggregation block (can be set via H5Pset_small_data_block_size()) */
|
||||
#define H5F_SDATA_BLOCK_SIZE_DEF 2048
|
||||
#define H5F_SDATA_BLOCK_SIZE_DEF 2048
|
||||
|
||||
/* Check for file using paged aggregation */
|
||||
#define H5F_PAGED_AGGR(F) (F->shared->fs_strategy == H5F_FSPACE_STRATEGY_PAGE && F->shared->fs_page_size)
|
||||
|
||||
/* Metadata read attempt values */
|
||||
#define H5F_METADATA_READ_ATTEMPTS 1 /* Default # of read attempts for non-SWMR access */
|
||||
#define H5F_SWMR_METADATA_READ_ATTEMPTS 100 /* Default # of read attempts for SWMR access */
|
||||
#define H5F_METADATA_READ_ATTEMPTS 1 /* Default # of read attempts for non-SWMR access */
|
||||
#define H5F_SWMR_METADATA_READ_ATTEMPTS 100 /* Default # of read attempts for SWMR access */
|
||||
|
||||
|
||||
/* Macros to define signatures of all objects in the file */
|
||||
|
||||
/* Size of signature information (on disk) */
|
||||
/* (all on-disk signatures should be this length) */
|
||||
#define H5_SIZEOF_MAGIC 4
|
||||
#define H5_SIZEOF_MAGIC 4
|
||||
|
||||
/* Size of checksum information (on disk) */
|
||||
/* (all on-disk checksums should be this length) */
|
||||
#define H5_SIZEOF_CHKSUM 4
|
||||
#define H5_SIZEOF_CHKSUM 4
|
||||
|
||||
/* v1 B-tree node signature */
|
||||
#define H5B_MAGIC "TREE"
|
||||
@ -704,11 +704,11 @@ typedef enum H5F_fs_state_t {
|
||||
typedef enum H5F_mem_page_t {
|
||||
H5F_MEM_PAGE_DEFAULT = 0, /* Not used */
|
||||
H5F_MEM_PAGE_SUPER = 1,
|
||||
H5F_MEM_PAGE_BTREE = 2,
|
||||
H5F_MEM_PAGE_DRAW = 3,
|
||||
H5F_MEM_PAGE_GHEAP = 4,
|
||||
H5F_MEM_PAGE_LHEAP = 5,
|
||||
H5F_MEM_PAGE_OHDR = 6,
|
||||
H5F_MEM_PAGE_BTREE = 2,
|
||||
H5F_MEM_PAGE_DRAW = 3,
|
||||
H5F_MEM_PAGE_GHEAP = 4,
|
||||
H5F_MEM_PAGE_LHEAP = 5,
|
||||
H5F_MEM_PAGE_OHDR = 6,
|
||||
H5F_MEM_PAGE_LARGE_SUPER = 7,
|
||||
H5F_MEM_PAGE_LARGE_BTREE = 8,
|
||||
H5F_MEM_PAGE_LARGE_DRAW = 9,
|
||||
|
@ -144,7 +144,7 @@ H5F_get_actual_name(const H5F_t *f)
|
||||
* Function: H5F_get_extpath
|
||||
*
|
||||
* Purpose: Retrieve the file's 'extpath' flags
|
||||
* This is used by H5L_extern_traverse() and H5D_build_extfile_prefix() to retrieve the main file's location
|
||||
* This is used by H5L_extern_traverse() and H5D_build_file_prefix() to retrieve the main file's location
|
||||
* when searching the target file.
|
||||
*
|
||||
* Return: 'extpath' on success/abort on failure (shouldn't fail)
|
||||
|
366
src/H5Pdapl.c
366
src/H5Pdapl.c
@ -71,6 +71,17 @@
|
||||
#define H5D_ACS_VDS_PRINTF_GAP_DEF (hsize_t)0
|
||||
#define H5D_ACS_VDS_PRINTF_GAP_ENC H5P__encode_hsize_t
|
||||
#define H5D_ACS_VDS_PRINTF_GAP_DEC H5P__decode_hsize_t
|
||||
/* Definitions for VDS file prefix */
|
||||
#define H5D_ACS_VDS_PREFIX_SIZE sizeof(char *)
|
||||
#define H5D_ACS_VDS_PREFIX_DEF NULL /*default is no prefix */
|
||||
#define H5D_ACS_VDS_PREFIX_SET H5P__dapl_vds_file_pref_set
|
||||
#define H5D_ACS_VDS_PREFIX_GET H5P__dapl_vds_file_pref_get
|
||||
#define H5D_ACS_VDS_PREFIX_ENC H5P__dapl_vds_file_pref_enc
|
||||
#define H5D_ACS_VDS_PREFIX_DEC H5P__dapl_vds_file_pref_dec
|
||||
#define H5D_ACS_VDS_PREFIX_DEL H5P__dapl_vds_file_pref_del
|
||||
#define H5D_ACS_VDS_PREFIX_COPY H5P__dapl_vds_file_pref_copy
|
||||
#define H5D_ACS_VDS_PREFIX_CMP H5P__dapl_vds_file_pref_cmp
|
||||
#define H5D_ACS_VDS_PREFIX_CLOSE H5P__dapl_vds_file_pref_close
|
||||
/* Definition for append flush */
|
||||
#define H5D_ACS_APPEND_FLUSH_SIZE sizeof(H5D_append_flush_t)
|
||||
#define H5D_ACS_APPEND_FLUSH_DEF {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},NULL,NULL}
|
||||
@ -112,6 +123,14 @@ static herr_t H5P__decode_chunk_cache_nbytes(const void **_pp, void *_value);
|
||||
/* Property list callbacks */
|
||||
static herr_t H5P__dacc_vds_view_enc(const void *value, void **pp, size_t *size);
|
||||
static herr_t H5P__dacc_vds_view_dec(const void **pp, void *value);
|
||||
static herr_t H5P__dapl_vds_file_pref_set(hid_t prop_id, const char* name, size_t size, void* value);
|
||||
static herr_t H5P__dapl_vds_file_pref_get(hid_t prop_id, const char* name, size_t size, void* value);
|
||||
static herr_t H5P__dapl_vds_file_pref_enc(const void *value, void **_pp, size_t *size);
|
||||
static herr_t H5P__dapl_vds_file_pref_dec(const void **_pp, void *value);
|
||||
static herr_t H5P__dapl_vds_file_pref_del(hid_t prop_id, const char* name, size_t size, void* value);
|
||||
static herr_t H5P__dapl_vds_file_pref_copy(const char* name, size_t size, void* value);
|
||||
static int H5P__dapl_vds_file_pref_cmp(const void *value1, const void *value2, size_t size);
|
||||
static herr_t H5P__dapl_vds_file_pref_close(const char* name, size_t size, void* value);
|
||||
|
||||
/* Property list callbacks */
|
||||
static herr_t H5P__dapl_efile_pref_set(hid_t prop_id, const char* name, size_t size, void* value);
|
||||
@ -160,6 +179,7 @@ const H5P_libclass_t H5P_CLS_DACC[1] = {{
|
||||
/* Property value defaults */
|
||||
static const H5D_append_flush_t H5D_def_append_flush_g = H5D_ACS_APPEND_FLUSH_DEF; /* Default setting for append flush */
|
||||
static const char *H5D_def_efile_prefix_g = H5D_ACS_EFILE_PREFIX_DEF; /* Default external file prefix string */
|
||||
static const char *H5D_def_vds_prefix_g = H5D_ACS_VDS_PREFIX_DEF; /* Default vds prefix string */
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
@ -210,6 +230,12 @@ H5P__dacc_reg_prop(H5P_genclass_t *pclass)
|
||||
NULL, NULL, NULL, NULL) < 0)
|
||||
HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class")
|
||||
|
||||
/* Register property for vds prefix */
|
||||
if(H5P_register_real(pclass, H5D_ACS_VDS_PREFIX_NAME, H5D_ACS_VDS_PREFIX_SIZE, &H5D_def_vds_prefix_g,
|
||||
NULL, H5D_ACS_VDS_PREFIX_SET, H5D_ACS_VDS_PREFIX_GET, H5D_ACS_VDS_PREFIX_ENC, H5D_ACS_VDS_PREFIX_DEC,
|
||||
H5D_ACS_VDS_PREFIX_DEL, H5D_ACS_VDS_PREFIX_COPY, H5D_ACS_VDS_PREFIX_CMP, H5D_ACS_VDS_PREFIX_CLOSE) < 0)
|
||||
HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class")
|
||||
|
||||
/* Register info for append flush */
|
||||
/* (Note: this property should not have an encode/decode callback -QAK) */
|
||||
if(H5P_register_real(pclass, H5D_ACS_APPEND_FLUSH_NAME, H5D_ACS_APPEND_FLUSH_SIZE, &H5D_def_append_flush_g,
|
||||
@ -226,6 +252,254 @@ done:
|
||||
FUNC_LEAVE_NOAPI(ret_value)
|
||||
} /* end H5P__dacc_reg_prop() */
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: H5P__dapl_vds_file_pref_set
|
||||
*
|
||||
* Purpose: Copies a vds file prefix property when it's set
|
||||
* for a property list
|
||||
*
|
||||
* Return: SUCCEED/FAIL
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
static herr_t
|
||||
H5P__dapl_vds_file_pref_set(hid_t H5_ATTR_UNUSED prop_id, const char H5_ATTR_UNUSED *name,
|
||||
size_t H5_ATTR_UNUSED size, void *value)
|
||||
{
|
||||
FUNC_ENTER_STATIC_NOERR
|
||||
|
||||
/* Sanity check */
|
||||
HDassert(value);
|
||||
|
||||
/* Copy the prefix */
|
||||
*(char **)value = H5MM_xstrdup(*(const char **)value);
|
||||
|
||||
FUNC_LEAVE_NOAPI(SUCCEED)
|
||||
} /* end H5P__dapl_vds_file_pref_set() */
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: H5P__dapl_vds_file_pref_get
|
||||
*
|
||||
* Purpose: Copies a vds file prefix property when it's retrieved
|
||||
* from a property list
|
||||
*
|
||||
* Return: SUCCEED/FAIL
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
static herr_t
|
||||
H5P__dapl_vds_file_pref_get(hid_t H5_ATTR_UNUSED prop_id, const char H5_ATTR_UNUSED *name,
|
||||
size_t H5_ATTR_UNUSED size, void *value)
|
||||
{
|
||||
FUNC_ENTER_STATIC_NOERR
|
||||
|
||||
/* Sanity check */
|
||||
HDassert(value);
|
||||
|
||||
/* Copy the prefix */
|
||||
*(char **)value = H5MM_xstrdup(*(const char **)value);
|
||||
|
||||
FUNC_LEAVE_NOAPI(SUCCEED)
|
||||
} /* end H5P__dapl_vds_file_pref_get() */
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: H5P__dapl_vds_file_pref_enc
|
||||
*
|
||||
* Purpose: Callback routine which is called whenever the vds file flags
|
||||
* property in the dataset access property list is
|
||||
* encoded.
|
||||
*
|
||||
* Return: SUCCEED/FAIL
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
static herr_t
|
||||
H5P__dapl_vds_file_pref_enc(const void *value, void **_pp, size_t *size)
|
||||
{
|
||||
const char *vds_file_pref = *(const char * const *)value;
|
||||
uint8_t **pp = (uint8_t **)_pp;
|
||||
size_t len = 0;
|
||||
uint64_t enc_value;
|
||||
unsigned enc_size;
|
||||
|
||||
FUNC_ENTER_NOAPI_NOINIT_NOERR
|
||||
|
||||
HDcompile_assert(sizeof(size_t) <= sizeof(uint64_t));
|
||||
|
||||
/* calculate prefix length */
|
||||
if(NULL != vds_file_pref)
|
||||
len = HDstrlen(vds_file_pref);
|
||||
|
||||
enc_value = (uint64_t)len;
|
||||
enc_size = H5VM_limit_enc_size(enc_value);
|
||||
HDassert(enc_size < 256);
|
||||
|
||||
if(NULL != *pp) {
|
||||
/* encode the length of the prefix */
|
||||
*(*pp)++ = (uint8_t)enc_size;
|
||||
UINT64ENCODE_VAR(*pp, enc_value, enc_size);
|
||||
|
||||
/* encode the prefix */
|
||||
if(NULL != vds_file_pref) {
|
||||
HDmemcpy(*(char **)pp, vds_file_pref, len);
|
||||
*pp += len;
|
||||
} /* end if */
|
||||
} /* end if */
|
||||
|
||||
*size += (1 + enc_size);
|
||||
if(NULL != vds_file_pref)
|
||||
*size += len;
|
||||
|
||||
FUNC_LEAVE_NOAPI(SUCCEED)
|
||||
} /* end H5P__dapl_vds_file_pref_enc() */
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: H5P__dapl_vds_file_pref_dec
|
||||
*
|
||||
* Purpose: Callback routine which is called whenever the vds file prefix
|
||||
* property in the dataset access property list is
|
||||
* decoded.
|
||||
*
|
||||
* Return: SUCCEED/FAIL
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
static herr_t
|
||||
H5P__dapl_vds_file_pref_dec(const void **_pp, void *_value)
|
||||
{
|
||||
char **vds_file_pref = (char **)_value;
|
||||
const uint8_t **pp = (const uint8_t **)_pp;
|
||||
size_t len;
|
||||
uint64_t enc_value; /* Decoded property value */
|
||||
unsigned enc_size; /* Size of encoded property */
|
||||
herr_t ret_value = SUCCEED;
|
||||
|
||||
FUNC_ENTER_NOAPI_NOINIT
|
||||
|
||||
HDassert(pp);
|
||||
HDassert(*pp);
|
||||
HDassert(vds_file_pref);
|
||||
HDcompile_assert(sizeof(size_t) <= sizeof(uint64_t));
|
||||
|
||||
/* Decode the size */
|
||||
enc_size = *(*pp)++;
|
||||
HDassert(enc_size < 256);
|
||||
|
||||
/* Decode the value */
|
||||
UINT64DECODE_VAR(*pp, enc_value, enc_size);
|
||||
len = (size_t)enc_value;
|
||||
|
||||
if(0 != len) {
|
||||
/* Make a copy of the user's prefix string */
|
||||
if(NULL == (*vds_file_pref = (char *)H5MM_malloc(len + 1)))
|
||||
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINIT, FAIL, "memory allocation failed for prefix")
|
||||
HDstrncpy(*vds_file_pref, *(const char **)pp, len);
|
||||
(*vds_file_pref)[len] = '\0';
|
||||
|
||||
*pp += len;
|
||||
} /* end if */
|
||||
else
|
||||
*vds_file_pref = NULL;
|
||||
|
||||
done:
|
||||
FUNC_LEAVE_NOAPI(ret_value)
|
||||
} /* end H5P__dapl_vds_file_pref_dec() */
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: H5P__dapl_vds_file_pref_del
|
||||
*
|
||||
* Purpose: Frees memory used to store the vds file prefix string
|
||||
*
|
||||
* Return: SUCCEED (Can't fail)
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
static herr_t
|
||||
H5P__dapl_vds_file_pref_del(hid_t H5_ATTR_UNUSED prop_id, const char H5_ATTR_UNUSED *name,
|
||||
size_t H5_ATTR_UNUSED size, void *value)
|
||||
{
|
||||
FUNC_ENTER_NOAPI_NOINIT_NOERR
|
||||
|
||||
HDassert(value);
|
||||
|
||||
H5MM_xfree(*(void **)value);
|
||||
|
||||
FUNC_LEAVE_NOAPI(SUCCEED)
|
||||
} /* end H5P__dapl_vds_file_pref_del() */
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: H5P__dapl_vds_file_pref_copy
|
||||
*
|
||||
* Purpose: Creates a copy of the vds file prefix string
|
||||
*
|
||||
* Return: SUCCEED/FAIL
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
static herr_t
|
||||
H5P__dapl_vds_file_pref_copy(const char H5_ATTR_UNUSED *name, size_t H5_ATTR_UNUSED size, void *value)
|
||||
{
|
||||
FUNC_ENTER_NOAPI_NOINIT_NOERR
|
||||
|
||||
HDassert(value);
|
||||
|
||||
*(char **)value = H5MM_xstrdup(*(const char **)value);
|
||||
|
||||
FUNC_LEAVE_NOAPI(SUCCEED)
|
||||
} /* end H5P__dapl_vds_file_pref_copy() */
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: H5P__dapl_vds_file_pref_cmp
|
||||
*
|
||||
* Purpose: Callback routine which is called whenever the vds file prefix
|
||||
* property in the dataset creation property list is
|
||||
* compared.
|
||||
*
|
||||
* Return: zero if VALUE1 and VALUE2 are equal, non zero otherwise.
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
static int
|
||||
H5P__dapl_vds_file_pref_cmp(const void *value1, const void *value2, size_t H5_ATTR_UNUSED size)
|
||||
{
|
||||
const char *pref1 = *(const char * const *)value1;
|
||||
const char *pref2 = *(const char * const *)value2;
|
||||
int ret_value = 0;
|
||||
|
||||
FUNC_ENTER_NOAPI_NOINIT_NOERR
|
||||
|
||||
if(NULL == pref1 && NULL != pref2)
|
||||
HGOTO_DONE(1);
|
||||
if(NULL != pref1 && NULL == pref2)
|
||||
HGOTO_DONE(-1);
|
||||
if(NULL != pref1 && NULL != pref2)
|
||||
ret_value = HDstrcmp(pref1, pref2);
|
||||
|
||||
done:
|
||||
FUNC_LEAVE_NOAPI(ret_value)
|
||||
} /* end H5P__dapl_vds_file_pref_cmp() */
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: H5P__dapl_vds_file_pref_close
|
||||
*
|
||||
* Purpose: Frees memory used to store the vds file prefix string
|
||||
*
|
||||
* Return: SUCCEED/FAIL
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
static herr_t
|
||||
H5P__dapl_vds_file_pref_close(const char H5_ATTR_UNUSED *name, size_t H5_ATTR_UNUSED size, void *value)
|
||||
{
|
||||
FUNC_ENTER_NOAPI_NOINIT_NOERR
|
||||
|
||||
HDassert(value);
|
||||
|
||||
H5MM_xfree(*(void **)value);
|
||||
|
||||
FUNC_LEAVE_NOAPI(SUCCEED)
|
||||
} /* end H5P__dapl_vds_file_pref_close() */
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: H5P__dapl_efile_pref_set
|
||||
@ -1220,3 +1494,95 @@ done:
|
||||
FUNC_LEAVE_API(ret_value)
|
||||
} /* end H5Pget_efile_prefix() */
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: H5Pset_virtual_prefix
|
||||
*
|
||||
* Purpose: Set a prefix to be applied to the path of any vds files
|
||||
* traversed.
|
||||
*
|
||||
* If the prefix starts with ${ORIGIN}, this will be replaced by
|
||||
* the absolute path of the directory of the HDF5 file containing
|
||||
* the dataset.
|
||||
*
|
||||
* If the prefix is ".", no prefix will be applied.
|
||||
*
|
||||
* This property can be overwritten by the environment variable
|
||||
* HDF5_VDS_PREFIX.
|
||||
*
|
||||
* Return: Non-negative on success/Negative on failure
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
herr_t
|
||||
H5Pset_virtual_prefix(hid_t plist_id, const char *prefix)
|
||||
{
|
||||
H5P_genplist_t *plist; /* Property list pointer */
|
||||
herr_t ret_value = SUCCEED; /* Return value */
|
||||
|
||||
FUNC_ENTER_API(FAIL)
|
||||
H5TRACE2("e", "i*s", plist_id, prefix);
|
||||
|
||||
/* Get the plist structure */
|
||||
if(NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_ACCESS)))
|
||||
HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
|
||||
|
||||
/* Set prefix */
|
||||
if(H5P_set(plist, H5D_ACS_VDS_PREFIX_NAME, &prefix) < 0)
|
||||
HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set prefix info")
|
||||
|
||||
done:
|
||||
FUNC_LEAVE_API(ret_value)
|
||||
} /* end H5Pset_virtual_prefix() */
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: H5Pget_virtual_prefix
|
||||
*
|
||||
* Purpose: Gets the prefix to be applied to any vds file
|
||||
* traversals made using this property list.
|
||||
*
|
||||
* If the pointer is not NULL, it points to a user-allocated
|
||||
* buffer.
|
||||
*
|
||||
* Return: Non-negative on success/Negative on failure
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
ssize_t
|
||||
H5Pget_virtual_prefix(hid_t plist_id, char *prefix, size_t size)
|
||||
{
|
||||
H5P_genplist_t *plist; /* Property list pointer */
|
||||
char *my_prefix; /* Library's copy of the prefix */
|
||||
size_t len; /* Length of prefix string */
|
||||
ssize_t ret_value; /* Return value */
|
||||
|
||||
FUNC_ENTER_API(FAIL)
|
||||
H5TRACE3("Zs", "i*sz", plist_id, prefix, size);
|
||||
|
||||
/* Get the plist structure */
|
||||
if(NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_ACCESS)))
|
||||
HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
|
||||
|
||||
/* Get the current prefix */
|
||||
if(H5P_peek(plist, H5D_ACS_VDS_PREFIX_NAME, &my_prefix) < 0)
|
||||
HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get vds file prefix")
|
||||
|
||||
/* Check for prefix being set */
|
||||
if(my_prefix) {
|
||||
/* Copy to user's buffer, if given */
|
||||
len = HDstrlen(my_prefix);
|
||||
if(prefix) {
|
||||
HDstrncpy(prefix, my_prefix, MIN(len + 1, size));
|
||||
if(len >= size)
|
||||
prefix[size - 1] = '\0';
|
||||
} /* end if */
|
||||
} /* end if */
|
||||
else
|
||||
len = 0;
|
||||
|
||||
/* Set return value */
|
||||
ret_value = (ssize_t)len;
|
||||
|
||||
done:
|
||||
FUNC_LEAVE_API(ret_value)
|
||||
} /* end H5Pget_virtual_prefix() */
|
||||
|
||||
|
936
src/H5Pfapl.c
936
src/H5Pfapl.c
File diff suppressed because it is too large
Load Diff
@ -420,6 +420,8 @@ H5_DLL herr_t H5Pset_virtual_view(hid_t plist_id, H5D_vds_view_t view);
|
||||
H5_DLL herr_t H5Pget_virtual_view(hid_t plist_id, H5D_vds_view_t *view);
|
||||
H5_DLL herr_t H5Pset_virtual_printf_gap(hid_t plist_id, hsize_t gap_size);
|
||||
H5_DLL herr_t H5Pget_virtual_printf_gap(hid_t plist_id, hsize_t *gap_size);
|
||||
H5_DLL herr_t H5Pset_virtual_prefix(hid_t dapl_id, const char* prefix);
|
||||
H5_DLL ssize_t H5Pget_virtual_prefix(hid_t dapl_id, char* prefix /*out*/, size_t size);
|
||||
H5_DLL herr_t H5Pset_append_flush(hid_t plist_id, unsigned ndims,
|
||||
const hsize_t boundary[], H5D_append_cb_t func, void *udata);
|
||||
H5_DLL herr_t H5Pget_append_flush(hid_t plist_id, unsigned dims,
|
||||
|
@ -1043,7 +1043,7 @@ H5_build_extpath(const char *name, char **extpath /*out*/)
|
||||
* Unix: does not apply
|
||||
*/
|
||||
if(H5_CHECK_ABS_DRIVE(name)) {
|
||||
drive = name[0] - 'A' + 1;
|
||||
drive = HDtoupper(name[0]) - 'A' + 1;
|
||||
retcwd = HDgetdcwd(drive, cwdpath, MAX_PATH_LEN);
|
||||
HDstrncpy(new_name, &name[2], name_len);
|
||||
} /* end if */
|
||||
|
@ -37,7 +37,7 @@ endif ()
|
||||
if (MINGW)
|
||||
target_link_libraries (${HDF5_TEST_LIB_TARGET} PRIVATE "wsock32.lib")
|
||||
endif ()
|
||||
target_link_libraries (${HDF5_TEST_LIB_TARGET} PRIVATE ${LINK_LIBS})
|
||||
target_link_libraries (${HDF5_TEST_LIB_TARGET} PUBLIC ${LINK_LIBS})
|
||||
target_link_libraries (${HDF5_TEST_LIB_TARGET} PUBLIC ${HDF5_LIB_TARGET})
|
||||
H5_SET_LIB_OPTIONS (${HDF5_TEST_LIB_TARGET} ${HDF5_TEST_LIB_NAME} STATIC)
|
||||
set_target_properties (${HDF5_TEST_LIB_TARGET} PROPERTIES
|
||||
@ -54,7 +54,7 @@ if (BUILD_SHARED_LIBS)
|
||||
if (MINGW)
|
||||
target_link_libraries (${HDF5_TEST_LIBSH_TARGET} PRIVATE "wsock32.lib")
|
||||
endif ()
|
||||
target_link_libraries (${HDF5_TEST_LIBSH_TARGET} PRIVATE ${LINK_LIBS})
|
||||
target_link_libraries (${HDF5_TEST_LIBSH_TARGET} PUBLIC ${LINK_LIBS})
|
||||
target_link_libraries (${HDF5_TEST_LIBSH_TARGET} PUBLIC ${HDF5_LIBSH_TARGET})
|
||||
H5_SET_LIB_OPTIONS (${HDF5_TEST_LIBSH_TARGET} ${HDF5_TEST_LIB_NAME} SHARED ${HDF5_PACKAGE_SOVERSION})
|
||||
set_target_properties (${HDF5_TEST_LIBSH_TARGET} PROPERTIES
|
||||
@ -174,13 +174,13 @@ set (testhdf5_SOURCES
|
||||
add_executable (testhdf5 ${testhdf5_SOURCES})
|
||||
TARGET_NAMING (testhdf5 STATIC)
|
||||
TARGET_C_PROPERTIES (testhdf5 STATIC " " " ")
|
||||
target_link_libraries (testhdf5 ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET})
|
||||
target_link_libraries (testhdf5 ${HDF5_TEST_LIB_TARGET})
|
||||
set_target_properties (testhdf5 PROPERTIES FOLDER test)
|
||||
if (BUILD_SHARED_LIBS)
|
||||
add_executable (testhdf5-shared ${testhdf5_SOURCES})
|
||||
TARGET_NAMING (testhdf5-shared SHARED)
|
||||
TARGET_C_PROPERTIES (testhdf5-shared SHARED " " " ")
|
||||
target_link_libraries (testhdf5-shared ${HDF5_TEST_LIBSH_TARGET} ${HDF5_LIBSH_TARGET})
|
||||
target_link_libraries (testhdf5-shared PUBLIC ${HDF5_TEST_LIBSH_TARGET})
|
||||
set_target_properties (testhdf5-shared PROPERTIES FOLDER test)
|
||||
endif ()
|
||||
|
||||
@ -188,13 +188,13 @@ MACRO (ADD_H5_EXE file)
|
||||
add_executable (${file} ${HDF5_TEST_SOURCE_DIR}/${file}.c)
|
||||
TARGET_NAMING (${file} STATIC)
|
||||
TARGET_C_PROPERTIES (${file} STATIC " " " ")
|
||||
target_link_libraries (${file} ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET})
|
||||
target_link_libraries (${file} PUBLIC ${HDF5_TEST_LIB_TARGET})
|
||||
set_target_properties (${file} PROPERTIES FOLDER test)
|
||||
if (BUILD_SHARED_LIBS)
|
||||
add_executable (${file}-shared ${HDF5_TEST_SOURCE_DIR}/${file}.c)
|
||||
TARGET_NAMING (${file}-shared SHARED)
|
||||
TARGET_C_PROPERTIES (${file}-shared SHARED " " " ")
|
||||
target_link_libraries (${file}-shared ${HDF5_TEST_LIBSH_TARGET} ${HDF5_LIBSH_TARGET})
|
||||
target_link_libraries (${file}-shared PUBLIC ${HDF5_TEST_LIBSH_TARGET})
|
||||
set_target_properties (${file}-shared PROPERTIES FOLDER test)
|
||||
endif ()
|
||||
ENDMACRO ()
|
||||
|
@ -452,7 +452,6 @@ set (test_CLEANFILES
|
||||
extlinks19B00026.h5
|
||||
extlinks19B00027.h5
|
||||
extlinks19B00028.h5
|
||||
tmp
|
||||
big.data
|
||||
big*.h5
|
||||
stdio.h5
|
||||
@ -582,6 +581,7 @@ set (test_CLEANFILES
|
||||
cache_logging.out
|
||||
vds_swmr.h5
|
||||
vds_swmr_src_*.h5
|
||||
tmp/vds_src_2.h5
|
||||
)
|
||||
|
||||
# Remove any output file left over from previous test run
|
||||
@ -839,21 +839,28 @@ add_test (NAME H5TEST-clear-error_test-objects
|
||||
WORKING_DIRECTORY
|
||||
${HDF5_TEST_BINARY_DIR}/H5TEST
|
||||
)
|
||||
add_test (NAME H5TEST-error_test COMMAND "${CMAKE_COMMAND}"
|
||||
-D "TEST_PROGRAM=$<TARGET_FILE:error_test>"
|
||||
-D "TEST_ARGS:STRING="
|
||||
-D "TEST_EXPECT=0"
|
||||
-D "TEST_MASK_ERROR=true"
|
||||
-D "TEST_OUTPUT=error_test.txt"
|
||||
-D "TEST_REFERENCE=error_test_1"
|
||||
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/H5TEST"
|
||||
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
|
||||
)
|
||||
set_tests_properties (H5TEST-error_test PROPERTIES
|
||||
DEPENDS H5TEST-clear-error_test-objects
|
||||
ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST;HDF5_PLUGIN_PRELOAD=::"
|
||||
WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST
|
||||
)
|
||||
if (HDF5_USE_16_API_DEFAULT)
|
||||
add_test (
|
||||
NAME H5TEST-error_test-SKIPPED
|
||||
COMMAND ${CMAKE_COMMAND} -E echo "SKIP $<TARGET_FILE:error_test>"
|
||||
)
|
||||
else ()
|
||||
add_test (NAME H5TEST-error_test COMMAND "${CMAKE_COMMAND}"
|
||||
-D "TEST_PROGRAM=$<TARGET_FILE:error_test>"
|
||||
-D "TEST_ARGS:STRING="
|
||||
-D "TEST_EXPECT=0"
|
||||
-D "TEST_MASK_ERROR=true"
|
||||
-D "TEST_OUTPUT=error_test.txt"
|
||||
-D "TEST_REFERENCE=error_test_1"
|
||||
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/H5TEST"
|
||||
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
|
||||
)
|
||||
set_tests_properties (H5TEST-error_test PROPERTIES
|
||||
DEPENDS H5TEST-clear-error_test-objects
|
||||
ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST;HDF5_PLUGIN_PRELOAD=::"
|
||||
WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST
|
||||
)
|
||||
endif ()
|
||||
|
||||
#-- Adding test for links_env
|
||||
add_test (NAME H5TEST-clear-links_env-objects
|
||||
@ -959,21 +966,28 @@ if (BUILD_SHARED_LIBS)
|
||||
WORKING_DIRECTORY
|
||||
${HDF5_TEST_BINARY_DIR}/H5TEST-shared
|
||||
)
|
||||
add_test (NAME H5TEST-shared-error_test COMMAND "${CMAKE_COMMAND}"
|
||||
-D "TEST_PROGRAM=$<TARGET_FILE:error_test-shared>"
|
||||
-D "TEST_ARGS:STRING="
|
||||
-D "TEST_EXPECT=0"
|
||||
-D "TEST_MASK_ERROR=true"
|
||||
-D "TEST_OUTPUT=error_test.txt"
|
||||
-D "TEST_REFERENCE=error_test_1"
|
||||
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/H5TEST-shared"
|
||||
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
|
||||
)
|
||||
set_tests_properties (H5TEST-shared-error_test PROPERTIES
|
||||
DEPENDS H5TEST-shared-clear-error_test-objects
|
||||
ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST-shared;HDF5_PLUGIN_PRELOAD=::"
|
||||
WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST-shared
|
||||
)
|
||||
if (HDF5_USE_16_API_DEFAULT)
|
||||
add_test (
|
||||
NAME H5TEST-shared-error_test-SKIPPED
|
||||
COMMAND ${CMAKE_COMMAND} -E echo "SKIP $<TARGET_FILE:error_test-shared>"
|
||||
)
|
||||
else ()
|
||||
add_test (NAME H5TEST-shared-error_test COMMAND "${CMAKE_COMMAND}"
|
||||
-D "TEST_PROGRAM=$<TARGET_FILE:error_test-shared>"
|
||||
-D "TEST_ARGS:STRING="
|
||||
-D "TEST_EXPECT=0"
|
||||
-D "TEST_MASK_ERROR=true"
|
||||
-D "TEST_OUTPUT=error_test.txt"
|
||||
-D "TEST_REFERENCE=error_test_1"
|
||||
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/H5TEST-shared"
|
||||
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
|
||||
)
|
||||
set_tests_properties (H5TEST-shared-error_test PROPERTIES
|
||||
DEPENDS H5TEST-shared-clear-error_test-objects
|
||||
ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST-shared;HDF5_PLUGIN_PRELOAD=::"
|
||||
WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST-shared
|
||||
)
|
||||
endif ()
|
||||
|
||||
#-- Adding test for links_env
|
||||
add_test (NAME H5TEST-shared-clear-links_env-objects
|
||||
|
1538
test/vds.c
1538
test/vds.c
File diff suppressed because it is too large
Load Diff
@ -72,6 +72,14 @@
|
||||
f-3.h5
|
||||
vds-eiger.h5
|
||||
)
|
||||
set (HDF5_REFERENCE_PREFIX_VDS
|
||||
1_vds.h5
|
||||
2_vds.h5
|
||||
4_vds.h5
|
||||
5_vds.h5
|
||||
vds-percival-unlim-maxmin.h5
|
||||
vds-eiger.h5
|
||||
)
|
||||
set (HDF5_ERROR_REFERENCE_VDS
|
||||
)
|
||||
|
||||
@ -80,12 +88,21 @@
|
||||
HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/vds/${vds_h5_file}" "${PROJECT_BINARY_DIR}/testfiles/vds/${fname}" "h5dump_vds_files")
|
||||
endforeach ()
|
||||
|
||||
foreach (vds_h5_file ${HDF5_REFERENCE_PREFIX_VDS})
|
||||
get_filename_component(fname "${vds_h5_file}" NAME)
|
||||
HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/vds/${vds_h5_file}" "${PROJECT_BINARY_DIR}/testfiles/vds/prefix/${fname}" "h5dump_vds_files")
|
||||
endforeach ()
|
||||
|
||||
foreach (ddl_vds ${HDF5_REFERENCE_VDS})
|
||||
get_filename_component(fname "${ddl_vds}" NAME)
|
||||
HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/vds/${ddl_vds}" "${PROJECT_BINARY_DIR}/testfiles/vds/${fname}" "h5dump_vds_files")
|
||||
endforeach ()
|
||||
|
||||
foreach (ddl_vds ${HDF5_REFERENCE_VDS})
|
||||
get_filename_component(fname "${ddl_vds}" NAME)
|
||||
HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/vds/${ddl_vds}" "${PROJECT_BINARY_DIR}/testfiles/vds/prefix/${fname}" "h5dump_vds_files")
|
||||
endforeach ()
|
||||
|
||||
foreach (ddl_vds ${HDF5_ERROR_REFERENCE_VDS})
|
||||
get_filename_component(fname "${ddl_vds}" NAME)
|
||||
HDFTEST_COPY_FILE("${PROJECT_SOURCE_DIR}/errfiles/${ddl_vds}" "${PROJECT_BINARY_DIR}/testfiles/vds/${fname}" "h5dump_vds_files")
|
||||
@ -134,6 +151,44 @@
|
||||
endif ()
|
||||
endmacro ()
|
||||
|
||||
macro (ADD_H5_VDS_PREFIX_TEST resultfile resultcode)
|
||||
# If using memchecker add tests without using scripts
|
||||
if (HDF5_ENABLE_USING_MEMCHECKER)
|
||||
add_test (NAME H5DUMP_PREFIX-${resultfile} COMMAND $<TARGET_FILE:h5dump> ${ARGN})
|
||||
set_tests_properties (H5DUMP_PREFIX-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/vds/prefix")
|
||||
if (NOT "${resultcode}" STREQUAL "0")
|
||||
set_tests_properties (H5DUMP_PREFIX-${resultfile} PROPERTIES WILL_FAIL "true")
|
||||
endif ()
|
||||
if (NOT "${last_vds_test}" STREQUAL "")
|
||||
set_tests_properties (H5DUMP_PREFIX-${resultfile} PROPERTIES DEPENDS ${last_VDS_test})
|
||||
endif ()
|
||||
else ()
|
||||
# Remove any output file left over from previous test run
|
||||
add_test (
|
||||
NAME H5DUMP_PREFIX-${resultfile}-clear-objects
|
||||
COMMAND ${CMAKE_COMMAND}
|
||||
-E remove
|
||||
${resultfile}.out
|
||||
${resultfile}.out.err
|
||||
)
|
||||
set_tests_properties (H5DUMP_PREFIX-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/vds/prefix")
|
||||
add_test (
|
||||
NAME H5DUMP_PREFIX-${resultfile}
|
||||
COMMAND "${CMAKE_COMMAND}"
|
||||
-D "TEST_PROGRAM=$<TARGET_FILE:h5dump>"
|
||||
-D "TEST_ARGS:STRING=${ARGN}"
|
||||
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles/vds/prefix"
|
||||
-D "TEST_OUTPUT=${resultfile}.out"
|
||||
-D "TEST_EXPECT=${resultcode}"
|
||||
-D "TEST_REFERENCE=${resultfile}.ddl"
|
||||
-D "TEST_ENV_VAR=HDF5_VDS_PREFIX"
|
||||
-D "TEST_ENV_VALUE=${PROJECT_BINARY_DIR}/testfiles/vds/"
|
||||
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
|
||||
)
|
||||
set_tests_properties (H5DUMP_PREFIX-${resultfile} PROPERTIES DEPENDS H5DUMP_PREFIX-${resultfile}-clear-objects)
|
||||
endif ()
|
||||
endmacro ()
|
||||
|
||||
macro (ADD_H5_VDS_LAYOUT resultfile resultcode)
|
||||
# If using memchecker add tests without using scripts
|
||||
if (HDF5_ENABLE_USING_MEMCHECKER)
|
||||
@ -261,3 +316,15 @@
|
||||
ADD_H5_VDS_LAYOUT (vds_layout-eiger 0 --enable-error-stack vds-eiger.h5)
|
||||
ADD_H5_VDS_LAYOUT (vds_layout-maxmin 0 --enable-error-stack vds-percival-unlim-maxmin.h5)
|
||||
endif ()
|
||||
|
||||
# Data read with prefix
|
||||
if (USE_FILTER_DEFLATE)
|
||||
ADD_H5_VDS_PREFIX_TEST (tvds-1 0 --enable-error-stack 1_vds.h5)
|
||||
ADD_H5_VDS_PREFIX_TEST (tvds-2 0 --enable-error-stack 2_vds.h5)
|
||||
ADD_H5_VDS_PREFIX_TEST (tvds-4 0 --enable-error-stack 4_vds.h5)
|
||||
ADD_H5_VDS_PREFIX_TEST (tvds-5 0 --enable-error-stack 5_vds.h5)
|
||||
ADD_H5_VDS_PREFIX_TEST (vds-first 0 --vds-view-first-missing --enable-error-stack vds-percival-unlim-maxmin.h5)
|
||||
ADD_H5_VDS_PREFIX_TEST (vds-gap1 0 -d /VDS-Eiger --vds-gap-size=1 --enable-error-stack vds-eiger.h5)
|
||||
ADD_H5_VDS_PREFIX_TEST (vds-gap2 0 --vds-gap-size=2 --enable-error-stack vds-eiger.h5)
|
||||
endif ()
|
||||
|
||||
|
@ -61,6 +61,17 @@
|
||||
get_filename_component(fname "${listfiles}" NAME)
|
||||
HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/vds/${listfiles}" "${PROJECT_BINARY_DIR}/testfiles/vds/${fname}" "h5ls_vds_files")
|
||||
endforeach ()
|
||||
|
||||
foreach (listfiles ${LIST_HDF5_TEST_FILES})
|
||||
get_filename_component(fname "${listfiles}" NAME)
|
||||
HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/vds/${listfiles}" "${PROJECT_BINARY_DIR}/testfiles/vds/prefix/${fname}" "h5ls_vds_files")
|
||||
endforeach ()
|
||||
|
||||
foreach (listfiles ${LIST_OTHER_TEST_FILES})
|
||||
get_filename_component(fname "${listfiles}" NAME)
|
||||
HDFTEST_COPY_FILE("${HDF5_TOOLS_TEST_H5LS_SOURCE_DIR}/vds_prefix/${listfiles}" "${PROJECT_BINARY_DIR}/testfiles/vds/prefix/${fname}" "h5ls_vds_files")
|
||||
endforeach ()
|
||||
|
||||
add_custom_target(h5ls_vds_files ALL COMMENT "Copying files needed by h5ls_vds tests" DEPENDS ${h5ls_vds_files_list})
|
||||
|
||||
##############################################################################
|
||||
@ -104,6 +115,43 @@
|
||||
endif ()
|
||||
endmacro ()
|
||||
|
||||
macro (ADD_H5_VDS_PREFIX_TEST resultfile resultcode)
|
||||
# If using memchecker add tests without using scripts
|
||||
if (HDF5_ENABLE_USING_MEMCHECKER)
|
||||
add_test (NAME H5LS_PREFIX-${resultfile} COMMAND $<TARGET_FILE:h5ls> ${ARGN})
|
||||
set_tests_properties (H5LS_PREFIX-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/vds/prefix")
|
||||
if ("${resultcode}" STREQUAL "1")
|
||||
set_tests_properties (H5LS_PREFIX-${resultfile} PROPERTIES WILL_FAIL "true")
|
||||
endif ()
|
||||
if (NOT "${last_test}" STREQUAL "")
|
||||
set_tests_properties (H5LS_PREFIX-${resultfile} PROPERTIES DEPENDS ${last_test})
|
||||
endif ()
|
||||
else ()
|
||||
add_test (
|
||||
NAME H5LS_PREFIX-${resultfile}-clear-objects
|
||||
COMMAND ${CMAKE_COMMAND}
|
||||
-E remove
|
||||
${resultfile}.out
|
||||
${resultfile}.out.err
|
||||
)
|
||||
set_tests_properties (H5LS_PREFIX-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/vds/prefix")
|
||||
add_test (
|
||||
NAME H5LS_PREFIX-${resultfile}
|
||||
COMMAND "${CMAKE_COMMAND}"
|
||||
-D "TEST_PROGRAM=$<TARGET_FILE:h5ls>"
|
||||
-D "TEST_ARGS=${ARGN}"
|
||||
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles"
|
||||
-D "TEST_OUTPUT=vds/prefix/${resultfile}.out"
|
||||
-D "TEST_EXPECT=${resultcode}"
|
||||
-D "TEST_REFERENCE=vds/prefix/${resultfile}.ls"
|
||||
-D "TEST_ENV_VAR=HDF5_VDS_PREFIX"
|
||||
-D "TEST_ENV_VALUE=\${ORIGIN}"
|
||||
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
|
||||
)
|
||||
set_tests_properties (H5LS_PREFIX-${resultfile} PROPERTIES DEPENDS H5LS_PREFIX-${resultfile}-clear-objects)
|
||||
endif ()
|
||||
endmacro ()
|
||||
|
||||
##############################################################################
|
||||
##############################################################################
|
||||
### T H E T E S T S ###
|
||||
@ -155,3 +203,10 @@
|
||||
ADD_H5_VDS_TEST (tvds-4 0 -w80 -v -S 4_vds.h5)
|
||||
ADD_H5_VDS_TEST (tvds-5 0 -w80 -v -S 5_vds.h5)
|
||||
|
||||
ADD_H5_VDS_PREFIX_TEST (tvds-1 0 -w80 -v -S vds/prefix/1_vds.h5)
|
||||
ADD_H5_VDS_PREFIX_TEST (tvds-2 0 -w80 -v -S vds/prefix/2_vds.h5)
|
||||
ADD_H5_VDS_PREFIX_TEST (tvds-3_1 0 -w80 -v -S vds/prefix/3_1_vds.h5)
|
||||
ADD_H5_VDS_PREFIX_TEST (tvds-3_2 0 -w80 -v -S vds/prefix/3_2_vds.h5)
|
||||
ADD_H5_VDS_PREFIX_TEST (tvds-4 0 -w80 -v -S vds/prefix/4_vds.h5)
|
||||
ADD_H5_VDS_PREFIX_TEST (tvds-5 0 -w80 -v -S vds/prefix/5_vds.h5)
|
||||
|
||||
|
14
tools/test/h5ls/vds_prefix/tvds-1.ls
Normal file
14
tools/test/h5ls/vds_prefix/tvds-1.ls
Normal file
@ -0,0 +1,14 @@
|
||||
Opened "vds/prefix/1_vds.h5" with sec2 driver.
|
||||
vds_dset Dataset {5/Inf, 18/18, 8/8}
|
||||
Location: 1:800
|
||||
Links: 1
|
||||
Maps: {6} Source {
|
||||
1_a.h5 /source_dset
|
||||
1_b.h5 /source_dset
|
||||
1_c.h5 /source_dset
|
||||
1_d.h5 /source_dset
|
||||
1_e.h5 /source_dset
|
||||
1_f.h5 /source_dset
|
||||
}
|
||||
Storage: 2880 logical bytes, 0 allocated bytes
|
||||
Type: 32-bit little-endian integer
|
13
tools/test/h5ls/vds_prefix/tvds-2.ls
Normal file
13
tools/test/h5ls/vds_prefix/tvds-2.ls
Normal file
@ -0,0 +1,13 @@
|
||||
Opened "vds/prefix/2_vds.h5" with sec2 driver.
|
||||
vds_dset Dataset {6/Inf, 8/8, 14/14}
|
||||
Location: 1:800
|
||||
Links: 1
|
||||
Maps: {5} Source {
|
||||
2_a.h5 /source_dset
|
||||
2_b.h5 /source_dset
|
||||
2_c.h5 /source_dset
|
||||
2_d.h5 /source_dset
|
||||
2_e.h5 /source_dset
|
||||
}
|
||||
Storage: 2688 logical bytes, 0 allocated bytes
|
||||
Type: 32-bit little-endian integer
|
14
tools/test/h5ls/vds_prefix/tvds-3_1.ls
Normal file
14
tools/test/h5ls/vds_prefix/tvds-3_1.ls
Normal file
@ -0,0 +1,14 @@
|
||||
Opened "vds/prefix/3_1_vds.h5" with sec2 driver.
|
||||
vds_dset Dataset {5/Inf, 25/25, 8/8}
|
||||
Location: 1:800
|
||||
Links: 1
|
||||
Maps: {6} Source {
|
||||
1_a.h5 /source_dset
|
||||
1_b.h5 /source_dset
|
||||
1_c.h5 /source_dset
|
||||
1_d.h5 /source_dset
|
||||
1_e.h5 /source_dset
|
||||
1_f.h5 /source_dset
|
||||
}
|
||||
Storage: 4000 logical bytes, 0 allocated bytes
|
||||
Type: 32-bit little-endian integer
|
13
tools/test/h5ls/vds_prefix/tvds-3_2.ls
Normal file
13
tools/test/h5ls/vds_prefix/tvds-3_2.ls
Normal file
@ -0,0 +1,13 @@
|
||||
Opened "vds/prefix/3_2_vds.h5" with sec2 driver.
|
||||
vds_dset Dataset {6/Inf, 13/13, 19/19}
|
||||
Location: 1:800
|
||||
Links: 1
|
||||
Maps: {5} Source {
|
||||
2_a.h5 /source_dset
|
||||
2_b.h5 /source_dset
|
||||
2_c.h5 /source_dset
|
||||
2_d.h5 /source_dset
|
||||
2_e.h5 /source_dset
|
||||
}
|
||||
Storage: 5928 logical bytes, 0 allocated bytes
|
||||
Type: 32-bit little-endian integer
|
9
tools/test/h5ls/vds_prefix/tvds-4.ls
Normal file
9
tools/test/h5ls/vds_prefix/tvds-4.ls
Normal file
@ -0,0 +1,9 @@
|
||||
Opened "vds/prefix/4_vds.h5" with sec2 driver.
|
||||
vds_dset Dataset {9/Inf, 4/4, 4/4}
|
||||
Location: 1:800
|
||||
Links: 1
|
||||
Maps: {1} Source {
|
||||
4_%b.h5 /source_dset
|
||||
}
|
||||
Storage: 576 logical bytes, 0 allocated bytes
|
||||
Type: 32-bit little-endian integer
|
11
tools/test/h5ls/vds_prefix/tvds-5.ls
Normal file
11
tools/test/h5ls/vds_prefix/tvds-5.ls
Normal file
@ -0,0 +1,11 @@
|
||||
Opened "vds/prefix/5_vds.h5" with sec2 driver.
|
||||
vds_dset Dataset {9/Inf, 4/4, 4/4}
|
||||
Location: 1:800
|
||||
Links: 1
|
||||
Maps: {3} Source {
|
||||
5_a.h5 /source_dset
|
||||
5_b.h5 /source_dset
|
||||
5_c.h5 /source_dset
|
||||
}
|
||||
Storage: 576 logical bytes, 0 allocated bytes
|
||||
Type: 32-bit little-endian integer
|
Loading…
Reference in New Issue
Block a user