mirror of
https://github.com/HDFGroup/hdf5.git
synced 2025-04-12 17:31:09 +08:00
Merging in latest from upstream (HDFFV/hdf5:refs/heads/develop)
* commit 'af21ce90d9465e805807f17da21f93e64e03492a': (46 commits) Changed to Unix line endings and chmod -x. Fix runtest case for data to stdout in tool Updated the parallel install docs. Eliminated the need for a separate script variable. Flipped swapped testing strings. Specify variable type. Remove unnecessary whitespace. Added test_vol_plugin.sh to the list of scripts to clean Fixed a CMake build issue (CMake still doesn't run the VOL plugin tests) Added more sub-tests to the VOL plugin test. Added a simple test for registration of VOL connector plugins. Autotools only for right now, but this will be fleshed out in future work. OHDR tests now accept h5_fileaccess() fapls. Formatting, informative comments, and minor renaming. Fix some CMake listings Add error checking to the minimized dset header size calculation. Update printf->HDprintf statements. Remove `#if 0` block of deprecated code. Fix mistake with H5E_BEGIN_TRY {...} H5E_END_TRY block containing ERROR-raising macros. Formatting tweaks. Added a helpful message to the flush script. Added a shell script so we can run the parallel flush test on OpenMPI. Add "compact" storage test to relative header size comparisons. Formatting adjustments. Formatting adjustments ...
This commit is contained in:
commit
f9736d817e
16
MANIFEST
16
MANIFEST
@ -974,7 +974,6 @@
|
||||
./test/dtypes.c
|
||||
./test/dtransform.c
|
||||
./test/earray.c
|
||||
./test/echo_vol.c
|
||||
./test/efc.c
|
||||
./test/enc_dec_plist.c
|
||||
./test/enc_dec_plist_cross_platform.c
|
||||
@ -1022,6 +1021,7 @@
|
||||
./test/gen_deflate.c
|
||||
./test/gen_file_image.c
|
||||
./test/gen_filespace.c
|
||||
./test/gen_filters.c
|
||||
./test/gen_mergemsg.c
|
||||
./test/gen_new_array.c
|
||||
./test/gen_new_fill.c
|
||||
@ -1065,6 +1065,8 @@
|
||||
./test/noencoder.h5
|
||||
./test/none.h5
|
||||
./test/ntypes.c
|
||||
./test/null_vol_connector.c
|
||||
./test/null_vol_connector.h
|
||||
./test/ohdr.c
|
||||
./test/objcopy.c
|
||||
./test/page_buffer.c
|
||||
@ -1105,12 +1107,15 @@
|
||||
./test/testlinks_env.sh.in
|
||||
./test/test_filenotclosed.sh.in
|
||||
./test/test_filter_plugin.sh.in
|
||||
./test/test_filters_le.h5
|
||||
./test/test_filters_be.h5
|
||||
./test/testflushrefresh.sh.in
|
||||
./test/testframe.c
|
||||
./test/testhdf5.c
|
||||
./test/testhdf5.h
|
||||
./test/testlibinfo.sh.in
|
||||
./test/test_usecases.sh.in
|
||||
./test/test_vol_plugin.sh.in
|
||||
./test/testmeta.c
|
||||
./test/testswmr.sh.in
|
||||
./test/testvdsswmr.sh.in
|
||||
@ -1152,16 +1157,14 @@
|
||||
./test/use_common.c
|
||||
./test/use_disable_mdc_flushes.c
|
||||
./test/use.h
|
||||
./test/vfd.c
|
||||
./test/vol.c
|
||||
./test/test_filters_le.h5
|
||||
./test/test_filters_be.h5
|
||||
./test/gen_filters.c
|
||||
./test/vds.c
|
||||
./test/vds_swmr.h
|
||||
./test/vds_swmr_gen.c
|
||||
./test/vds_swmr_reader.c
|
||||
./test/vds_swmr_writer.c
|
||||
./test/vfd.c
|
||||
./test/vol.c
|
||||
./test/vol_plugin.c
|
||||
|
||||
./test/testfiles/err_compat_1
|
||||
./test/testfiles/err_compat_2
|
||||
@ -1292,6 +1295,7 @@
|
||||
./testpar/t_span_tree.c
|
||||
./testpar/t_init_term.c
|
||||
./testpar/testpar.h
|
||||
./testpar/testpflush.sh.in
|
||||
./testpar/testphdf5.c
|
||||
./testpar/testphdf5.h
|
||||
|
||||
|
0
config/cmake/CTestScript.cmake
Executable file → Normal file
0
config/cmake/CTestScript.cmake
Executable file → Normal file
0
config/cmake/HDF5_Examples_options.cmake
Executable file → Normal file
0
config/cmake/HDF5_Examples_options.cmake
Executable file → Normal file
0
config/cmake/libh5cc.in
Executable file → Normal file
0
config/cmake/libh5cc.in
Executable file → Normal file
0
config/cmake/libhdf5.pc.in
Executable file → Normal file
0
config/cmake/libhdf5.pc.in
Executable file → Normal file
490
config/cmake/scripts/CTestScript.cmake
Executable file → Normal file
490
config/cmake/scripts/CTestScript.cmake
Executable file → Normal file
@ -9,261 +9,261 @@
|
||||
# If you do not have access to either file, you may request a copy from
|
||||
# help@hdfgroup.org.
|
||||
#
|
||||
cmake_minimum_required (VERSION 3.10)
|
||||
########################################################
|
||||
# This dashboard is maintained by The HDF Group
|
||||
# For any comments please contact cdashhelp@hdfgroup.org
|
||||
#
|
||||
########################################################
|
||||
# -----------------------------------------------------------
|
||||
# -- Get environment
|
||||
# -----------------------------------------------------------
|
||||
if (NOT SITE_OS_NAME)
|
||||
## machine name not provided - attempt to discover with uname
|
||||
## -- set hostname
|
||||
## --------------------------
|
||||
find_program (HOSTNAME_CMD NAMES hostname)
|
||||
exec_program (${HOSTNAME_CMD} ARGS OUTPUT_VARIABLE HOSTNAME)
|
||||
set (CTEST_SITE "${HOSTNAME}${CTEST_SITE_EXT}")
|
||||
find_program (UNAME NAMES uname)
|
||||
macro (getuname name flag)
|
||||
exec_program ("${UNAME}" ARGS "${flag}" OUTPUT_VARIABLE "${name}")
|
||||
endmacro ()
|
||||
|
||||
getuname (osname -s)
|
||||
getuname (osrel -r)
|
||||
getuname (cpu -m)
|
||||
message (STATUS "Dashboard script uname output: ${osname}-${osrel}-${cpu}\n")
|
||||
|
||||
set (CTEST_BUILD_NAME "${osname}-${osrel}-${cpu}")
|
||||
else ()
|
||||
## machine name provided
|
||||
## --------------------------
|
||||
if (CMAKE_HOST_UNIX)
|
||||
set (CTEST_BUILD_NAME "${SITE_OS_NAME}-${SITE_OS_VERSION}-${SITE_OS_BITS}-${SITE_COMPILER_NAME}-${SITE_COMPILER_VERSION}")
|
||||
else ()
|
||||
set (CTEST_BUILD_NAME "${SITE_OS_NAME}-${SITE_OS_VERSION}-${SITE_COMPILER_NAME}")
|
||||
endif ()
|
||||
endif ()
|
||||
cmake_minimum_required (VERSION 3.10)
|
||||
########################################################
|
||||
# This dashboard is maintained by The HDF Group
|
||||
# For any comments please contact cdashhelp@hdfgroup.org
|
||||
#
|
||||
########################################################
|
||||
# -----------------------------------------------------------
|
||||
# -- Get environment
|
||||
# -----------------------------------------------------------
|
||||
if (NOT SITE_OS_NAME)
|
||||
## machine name not provided - attempt to discover with uname
|
||||
## -- set hostname
|
||||
## --------------------------
|
||||
find_program (HOSTNAME_CMD NAMES hostname)
|
||||
exec_program (${HOSTNAME_CMD} ARGS OUTPUT_VARIABLE HOSTNAME)
|
||||
set (CTEST_SITE "${HOSTNAME}${CTEST_SITE_EXT}")
|
||||
find_program (UNAME NAMES uname)
|
||||
macro (getuname name flag)
|
||||
exec_program ("${UNAME}" ARGS "${flag}" OUTPUT_VARIABLE "${name}")
|
||||
endmacro ()
|
||||
|
||||
getuname (osname -s)
|
||||
getuname (osrel -r)
|
||||
getuname (cpu -m)
|
||||
message (STATUS "Dashboard script uname output: ${osname}-${osrel}-${cpu}\n")
|
||||
|
||||
set (CTEST_BUILD_NAME "${osname}-${osrel}-${cpu}")
|
||||
else ()
|
||||
## machine name provided
|
||||
## --------------------------
|
||||
if (CMAKE_HOST_UNIX)
|
||||
set (CTEST_BUILD_NAME "${SITE_OS_NAME}-${SITE_OS_VERSION}-${SITE_OS_BITS}-${SITE_COMPILER_NAME}-${SITE_COMPILER_VERSION}")
|
||||
else ()
|
||||
set (CTEST_BUILD_NAME "${SITE_OS_NAME}-${SITE_OS_VERSION}-${SITE_COMPILER_NAME}")
|
||||
endif ()
|
||||
endif ()
|
||||
if (SITE_BUILDNAME_SUFFIX)
|
||||
set (CTEST_BUILD_NAME "${SITE_BUILDNAME_SUFFIX}-${CTEST_BUILD_NAME}")
|
||||
endif ()
|
||||
set (BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DSITE:STRING=${CTEST_SITE} -DBUILDNAME:STRING=${CTEST_BUILD_NAME}")
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# MAC machines need special option
|
||||
#-----------------------------------------------------------------------------
|
||||
if (APPLE)
|
||||
# Compiler choice
|
||||
execute_process (COMMAND xcrun --find cc OUTPUT_VARIABLE XCODE_CC OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
execute_process (COMMAND xcrun --find c++ OUTPUT_VARIABLE XCODE_CXX OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
set (ENV{CC} "${XCODE_CC}")
|
||||
set (ENV{CXX} "${XCODE_CXX}")
|
||||
|
||||
set (BUILD_OPTIONS "${BUILD_OPTIONS} -DCTEST_USE_LAUNCHERS:BOOL=ON -DCMAKE_BUILD_WITH_INSTALL_RPATH:BOOL=OFF")
|
||||
endif ()
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
set (NEED_REPOSITORY_CHECKOUT 0)
|
||||
set (CTEST_CMAKE_COMMAND "\"${CMAKE_COMMAND}\"")
|
||||
if (CTEST_USE_TAR_SOURCE)
|
||||
## Uncompress source if tar file provided
|
||||
## --------------------------
|
||||
if (WIN32)
|
||||
message (STATUS "extracting... [${CMAKE_EXECUTABLE_NAME} x ${CTEST_DASHBOARD_ROOT}\\${CTEST_USE_TAR_SOURCE}.zip]")
|
||||
execute_process (COMMAND ${CMAKE_EXECUTABLE_NAME} -E tar -xvf ${CTEST_DASHBOARD_ROOT}\\${CTEST_USE_TAR_SOURCE}.zip RESULT_VARIABLE rv)
|
||||
else ()
|
||||
message (STATUS "extracting... [${CMAKE_EXECUTABLE_NAME} -E tar -xvf ${CTEST_DASHBOARD_ROOT}/${CTEST_USE_TAR_SOURCE}.tar]")
|
||||
execute_process (COMMAND ${CMAKE_EXECUTABLE_NAME} -E tar -xvf ${CTEST_DASHBOARD_ROOT}/${CTEST_USE_TAR_SOURCE}.tar RESULT_VARIABLE rv)
|
||||
endif ()
|
||||
|
||||
if (NOT rv EQUAL 0)
|
||||
message (STATUS "extracting... [error-(${rv}) clean up]")
|
||||
file (REMOVE_RECURSE "${CTEST_SOURCE_DIRECTORY}")
|
||||
message (FATAL_ERROR "error: extract of ${CTEST_USE_TAR_SOURCE} failed")
|
||||
endif ()
|
||||
|
||||
file (RENAME ${CTEST_DASHBOARD_ROOT}/${CTEST_USE_TAR_SOURCE} ${CTEST_SOURCE_DIRECTORY})
|
||||
set (LOCAL_SKIP_UPDATE "TRUE")
|
||||
else ()
|
||||
if (LOCAL_UPDATE)
|
||||
if (CTEST_USE_GIT_SOURCE)
|
||||
find_program (CTEST_GIT_COMMAND NAMES git git.cmd)
|
||||
set (CTEST_GIT_UPDATE_OPTIONS)
|
||||
|
||||
if (NOT EXISTS "${CTEST_SOURCE_DIRECTORY}")
|
||||
set (NEED_REPOSITORY_CHECKOUT 1)
|
||||
endif ()
|
||||
|
||||
if (${NEED_REPOSITORY_CHECKOUT})
|
||||
if (REPOSITORY_BRANCH)
|
||||
set (CTEST_GIT_options "clone \"${REPOSITORY_URL}\" --branch \"${REPOSITORY_BRANCH}\" --single-branch \"${CTEST_SOURCE_DIRECTORY}\" --recurse-submodules")
|
||||
else ()
|
||||
set (CTEST_GIT_options "clone \"${REPOSITORY_URL}\" \"${CTEST_SOURCE_DIRECTORY}\" --recurse-submodules")
|
||||
endif ()
|
||||
set (CTEST_CHECKOUT_COMMAND "${CTEST_GIT_COMMAND} ${CTEST_GIT_options}")
|
||||
else ()
|
||||
set (CTEST_GIT_options "pull")
|
||||
endif ()
|
||||
set (CTEST_UPDATE_COMMAND "${CTEST_GIT_COMMAND}")
|
||||
else ()
|
||||
## --------------------------
|
||||
## use subversion to get source
|
||||
#-----------------------------------------------------------------------------
|
||||
## cygwin does not handle the find_package() call
|
||||
## --------------------------
|
||||
set (CTEST_UPDATE_COMMAND "SVNCommand")
|
||||
if (NOT SITE_CYGWIN})
|
||||
find_package (Subversion)
|
||||
set (CTEST_SVN_COMMAND "${Subversion_SVN_EXECUTABLE}")
|
||||
set (CTEST_UPDATE_COMMAND "${Subversion_SVN_EXECUTABLE}")
|
||||
else ()
|
||||
set (CTEST_SVN_COMMAND "/usr/bin/svn")
|
||||
set (CTEST_UPDATE_COMMAND "/usr/bin/svn")
|
||||
endif ()
|
||||
|
||||
if (NOT EXISTS "${CTEST_SOURCE_DIRECTORY}")
|
||||
set (NEED_REPOSITORY_CHECKOUT 1)
|
||||
endif ()
|
||||
|
||||
if (NOT CTEST_REPO_VERSION)
|
||||
set (CTEST_REPO_VERSION "HEAD")
|
||||
endif ()
|
||||
if (${NEED_REPOSITORY_CHECKOUT})
|
||||
set (CTEST_CHECKOUT_COMMAND
|
||||
"\"${CTEST_SVN_COMMAND}\" co ${REPOSITORY_URL} \"${CTEST_SOURCE_DIRECTORY}\" -r ${CTEST_REPO_VERSION}")
|
||||
else ()
|
||||
if (CTEST_REPO_VERSION)
|
||||
set (CTEST_SVN_UPDATE_OPTIONS "-r ${CTEST_REPO_VERSION}")
|
||||
endif ()
|
||||
endif ()
|
||||
endif ()
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
## Clear the build directory
|
||||
## --------------------------
|
||||
set (CTEST_START_WITH_EMPTY_BINARY_DIRECTORY TRUE)
|
||||
if (NOT EXISTS "${CTEST_BINARY_DIRECTORY}")
|
||||
file (MAKE_DIRECTORY "${CTEST_BINARY_DIRECTORY}")
|
||||
else ()
|
||||
ctest_empty_binary_directory (${CTEST_BINARY_DIRECTORY})
|
||||
endif ()
|
||||
|
||||
# Use multiple CPU cores to build
|
||||
include (ProcessorCount)
|
||||
ProcessorCount (N)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# MAC machines need special option
|
||||
#-----------------------------------------------------------------------------
|
||||
if (APPLE)
|
||||
# Compiler choice
|
||||
execute_process (COMMAND xcrun --find cc OUTPUT_VARIABLE XCODE_CC OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
execute_process (COMMAND xcrun --find c++ OUTPUT_VARIABLE XCODE_CXX OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
set (ENV{CC} "${XCODE_CC}")
|
||||
set (ENV{CXX} "${XCODE_CXX}")
|
||||
|
||||
set (BUILD_OPTIONS "${BUILD_OPTIONS} -DCTEST_USE_LAUNCHERS:BOOL=ON -DCMAKE_BUILD_WITH_INSTALL_RPATH:BOOL=OFF")
|
||||
endif ()
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
set (NEED_REPOSITORY_CHECKOUT 0)
|
||||
set (CTEST_CMAKE_COMMAND "\"${CMAKE_COMMAND}\"")
|
||||
if (CTEST_USE_TAR_SOURCE)
|
||||
## Uncompress source if tar file provided
|
||||
## --------------------------
|
||||
if (WIN32)
|
||||
message (STATUS "extracting... [${CMAKE_EXECUTABLE_NAME} x ${CTEST_DASHBOARD_ROOT}\\${CTEST_USE_TAR_SOURCE}.zip]")
|
||||
execute_process (COMMAND ${CMAKE_EXECUTABLE_NAME} -E tar -xvf ${CTEST_DASHBOARD_ROOT}\\${CTEST_USE_TAR_SOURCE}.zip RESULT_VARIABLE rv)
|
||||
else ()
|
||||
message (STATUS "extracting... [${CMAKE_EXECUTABLE_NAME} -E tar -xvf ${CTEST_DASHBOARD_ROOT}/${CTEST_USE_TAR_SOURCE}.tar]")
|
||||
execute_process (COMMAND ${CMAKE_EXECUTABLE_NAME} -E tar -xvf ${CTEST_DASHBOARD_ROOT}/${CTEST_USE_TAR_SOURCE}.tar RESULT_VARIABLE rv)
|
||||
endif ()
|
||||
|
||||
if (NOT rv EQUAL 0)
|
||||
message (STATUS "extracting... [error-(${rv}) clean up]")
|
||||
file (REMOVE_RECURSE "${CTEST_SOURCE_DIRECTORY}")
|
||||
message (FATAL_ERROR "error: extract of ${CTEST_USE_TAR_SOURCE} failed")
|
||||
endif ()
|
||||
|
||||
file (RENAME ${CTEST_DASHBOARD_ROOT}/${CTEST_USE_TAR_SOURCE} ${CTEST_SOURCE_DIRECTORY})
|
||||
set (LOCAL_SKIP_UPDATE "TRUE")
|
||||
else ()
|
||||
if (LOCAL_UPDATE)
|
||||
if (CTEST_USE_GIT_SOURCE)
|
||||
find_program (CTEST_GIT_COMMAND NAMES git git.cmd)
|
||||
set (CTEST_GIT_UPDATE_OPTIONS)
|
||||
|
||||
if (NOT EXISTS "${CTEST_SOURCE_DIRECTORY}")
|
||||
set (NEED_REPOSITORY_CHECKOUT 1)
|
||||
endif ()
|
||||
|
||||
if (${NEED_REPOSITORY_CHECKOUT})
|
||||
if (REPOSITORY_BRANCH)
|
||||
set (CTEST_GIT_options "clone \"${REPOSITORY_URL}\" --branch \"${REPOSITORY_BRANCH}\" --single-branch \"${CTEST_SOURCE_DIRECTORY}\" --recurse-submodules")
|
||||
else ()
|
||||
set (CTEST_GIT_options "clone \"${REPOSITORY_URL}\" \"${CTEST_SOURCE_DIRECTORY}\" --recurse-submodules")
|
||||
endif ()
|
||||
set (CTEST_CHECKOUT_COMMAND "${CTEST_GIT_COMMAND} ${CTEST_GIT_options}")
|
||||
else ()
|
||||
set (CTEST_GIT_options "pull")
|
||||
endif ()
|
||||
set (CTEST_UPDATE_COMMAND "${CTEST_GIT_COMMAND}")
|
||||
else ()
|
||||
## --------------------------
|
||||
## use subversion to get source
|
||||
#-----------------------------------------------------------------------------
|
||||
## cygwin does not handle the find_package() call
|
||||
## --------------------------
|
||||
set (CTEST_UPDATE_COMMAND "SVNCommand")
|
||||
if (NOT SITE_CYGWIN})
|
||||
find_package (Subversion)
|
||||
set (CTEST_SVN_COMMAND "${Subversion_SVN_EXECUTABLE}")
|
||||
set (CTEST_UPDATE_COMMAND "${Subversion_SVN_EXECUTABLE}")
|
||||
else ()
|
||||
set (CTEST_SVN_COMMAND "/usr/bin/svn")
|
||||
set (CTEST_UPDATE_COMMAND "/usr/bin/svn")
|
||||
endif ()
|
||||
|
||||
if (NOT EXISTS "${CTEST_SOURCE_DIRECTORY}")
|
||||
set (NEED_REPOSITORY_CHECKOUT 1)
|
||||
endif ()
|
||||
|
||||
if (NOT CTEST_REPO_VERSION)
|
||||
set (CTEST_REPO_VERSION "HEAD")
|
||||
endif ()
|
||||
if (${NEED_REPOSITORY_CHECKOUT})
|
||||
set (CTEST_CHECKOUT_COMMAND
|
||||
"\"${CTEST_SVN_COMMAND}\" co ${REPOSITORY_URL} \"${CTEST_SOURCE_DIRECTORY}\" -r ${CTEST_REPO_VERSION}")
|
||||
else ()
|
||||
if (CTEST_REPO_VERSION)
|
||||
set (CTEST_SVN_UPDATE_OPTIONS "-r ${CTEST_REPO_VERSION}")
|
||||
endif ()
|
||||
endif ()
|
||||
endif ()
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
## Clear the build directory
|
||||
## --------------------------
|
||||
set (CTEST_START_WITH_EMPTY_BINARY_DIRECTORY TRUE)
|
||||
if (NOT EXISTS "${CTEST_BINARY_DIRECTORY}")
|
||||
file (MAKE_DIRECTORY "${CTEST_BINARY_DIRECTORY}")
|
||||
else ()
|
||||
ctest_empty_binary_directory (${CTEST_BINARY_DIRECTORY})
|
||||
endif ()
|
||||
|
||||
# Use multiple CPU cores to build
|
||||
include (ProcessorCount)
|
||||
ProcessorCount (N)
|
||||
if (NOT N EQUAL 0)
|
||||
if (MAX_PROC_COUNT)
|
||||
if (N GREATER MAX_PROC_COUNT)
|
||||
set (N ${MAX_PROC_COUNT})
|
||||
endif ()
|
||||
endif ()
|
||||
if (NOT WIN32)
|
||||
set (CTEST_BUILD_FLAGS -j${N})
|
||||
endif ()
|
||||
set (ctest_test_args ${ctest_test_args} PARALLEL_LEVEL ${N})
|
||||
endif ()
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Send the main script as a note.
|
||||
list (APPEND CTEST_NOTES_FILES
|
||||
"${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}"
|
||||
"${CMAKE_CURRENT_LIST_FILE}"
|
||||
"${CTEST_SOURCE_DIRECTORY}/config/cmake/cacheinit.cmake"
|
||||
)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Check for required variables.
|
||||
# --------------------------
|
||||
foreach (req
|
||||
CTEST_CMAKE_GENERATOR
|
||||
CTEST_SITE
|
||||
CTEST_BUILD_NAME
|
||||
)
|
||||
if (NOT DEFINED ${req})
|
||||
message (FATAL_ERROR "The containing script must set ${req}")
|
||||
endif ()
|
||||
endforeach ()
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Initialize the CTEST commands
|
||||
#------------------------------
|
||||
if (CMAKE_GENERATOR_TOOLSET)
|
||||
set (CTEST_CONFIGURE_TOOLSET "-T${CMAKE_GENERATOR_TOOLSET}")
|
||||
else ()
|
||||
set (CTEST_CONFIGURE_TOOLSET "")
|
||||
endif()
|
||||
if (LOCAL_MEMCHECK_TEST)
|
||||
find_program (CTEST_MEMORYCHECK_COMMAND NAMES valgrind)
|
||||
set (CTEST_CONFIGURE_COMMAND
|
||||
"${CTEST_CMAKE_COMMAND} -C \"${CTEST_SOURCE_DIRECTORY}/config/cmake/mccacheinit.cmake\" -DCMAKE_BUILD_TYPE:STRING=${CTEST_CONFIGURATION_TYPE} ${BUILD_OPTIONS} \"-G${CTEST_CMAKE_GENERATOR}\" \"${CTEST_CONFIGURE_TOOLSET}\" \"${CTEST_SOURCE_DIRECTORY}\""
|
||||
)
|
||||
else ()
|
||||
if (LOCAL_COVERAGE_TEST)
|
||||
find_program (CTEST_COVERAGE_COMMAND NAMES gcov)
|
||||
endif ()
|
||||
set (CTEST_CONFIGURE_COMMAND
|
||||
"${CTEST_CMAKE_COMMAND} -C \"${CTEST_SOURCE_DIRECTORY}/config/cmake/cacheinit.cmake\" -DCMAKE_BUILD_TYPE:STRING=${CTEST_CONFIGURATION_TYPE} ${BUILD_OPTIONS} \"-G${CTEST_CMAKE_GENERATOR}\" \"${CTEST_CONFIGURE_TOOLSET}\" \"${CTEST_SOURCE_DIRECTORY}\""
|
||||
)
|
||||
endif ()
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
## -- set output to english
|
||||
set ($ENV{LC_MESSAGES} "en_EN")
|
||||
|
||||
# Print summary information.
|
||||
foreach (v
|
||||
CTEST_SITE
|
||||
CTEST_BUILD_NAME
|
||||
CTEST_SOURCE_DIRECTORY
|
||||
CTEST_BINARY_DIRECTORY
|
||||
CTEST_CMAKE_GENERATOR
|
||||
CTEST_CONFIGURATION_TYPE
|
||||
CTEST_GIT_COMMAND
|
||||
CTEST_CHECKOUT_COMMAND
|
||||
CTEST_CONFIGURE_COMMAND
|
||||
CTEST_SCRIPT_DIRECTORY
|
||||
CTEST_USE_LAUNCHERS
|
||||
)
|
||||
set (vars "${vars} ${v}=[${${v}}]\n")
|
||||
endforeach ()
|
||||
message (STATUS "Dashboard script configuration:\n${vars}\n")
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
#-----------------------------------------------------------------------------
|
||||
## NORMAL process
|
||||
## -- LOCAL_UPDATE updates the source folder from svn
|
||||
## -- LOCAL_SUBMIT reports to CDash server
|
||||
## -- LOCAL_SKIP_TEST skips the test process (only builds)
|
||||
## -- LOCAL_MEMCHECK_TEST executes the Valgrind testing
|
||||
## -- LOCAL_COVERAGE_TEST executes code coverage process
|
||||
## --------------------------
|
||||
ctest_start (${MODEL} TRACK ${MODEL})
|
||||
if (LOCAL_UPDATE)
|
||||
ctest_update (SOURCE "${CTEST_SOURCE_DIRECTORY}")
|
||||
endif ()
|
||||
configure_file (${CTEST_SOURCE_DIRECTORY}/config/cmake/CTestCustom.cmake ${CTEST_BINARY_DIRECTORY}/CTestCustom.cmake)
|
||||
ctest_read_custom_files ("${CTEST_BINARY_DIRECTORY}")
|
||||
ctest_configure (BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res)
|
||||
if (LOCAL_SUBMIT)
|
||||
ctest_submit (PARTS Update Configure Notes)
|
||||
endif ()
|
||||
if (${res} LESS 0 OR ${res} GREATER 0)
|
||||
file (APPEND ${CTEST_SCRIPT_DIRECTORY}/FailedCTest.txt "Failed Configure: ${res}\n")
|
||||
endif ()
|
||||
|
||||
ctest_build (BUILD "${CTEST_BINARY_DIRECTORY}" APPEND RETURN_VALUE res NUMBER_ERRORS errval)
|
||||
if (LOCAL_SUBMIT)
|
||||
ctest_submit (PARTS Build)
|
||||
endif ()
|
||||
if (${res} LESS 0 OR ${res} GREATER 0 OR ${errval} GREATER 0)
|
||||
file (APPEND ${CTEST_SCRIPT_DIRECTORY}/FailedCTest.txt "Failed ${errval} Build: ${res}\n")
|
||||
endif ()
|
||||
|
||||
if (NOT LOCAL_SKIP_TEST)
|
||||
if (NOT LOCAL_MEMCHECK_TEST)
|
||||
if (NOT WIN32)
|
||||
set (CTEST_BUILD_FLAGS -j${N})
|
||||
endif ()
|
||||
set (ctest_test_args ${ctest_test_args} PARALLEL_LEVEL ${N})
|
||||
endif ()
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Send the main script as a note.
|
||||
list (APPEND CTEST_NOTES_FILES
|
||||
"${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}"
|
||||
"${CMAKE_CURRENT_LIST_FILE}"
|
||||
"${CTEST_SOURCE_DIRECTORY}/config/cmake/cacheinit.cmake"
|
||||
)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Check for required variables.
|
||||
# --------------------------
|
||||
foreach (req
|
||||
CTEST_CMAKE_GENERATOR
|
||||
CTEST_SITE
|
||||
CTEST_BUILD_NAME
|
||||
)
|
||||
if (NOT DEFINED ${req})
|
||||
message (FATAL_ERROR "The containing script must set ${req}")
|
||||
endif ()
|
||||
endforeach ()
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Initialize the CTEST commands
|
||||
#------------------------------
|
||||
if (CMAKE_GENERATOR_TOOLSET)
|
||||
set (CTEST_CONFIGURE_TOOLSET "-T${CMAKE_GENERATOR_TOOLSET}")
|
||||
else ()
|
||||
set (CTEST_CONFIGURE_TOOLSET "")
|
||||
endif()
|
||||
if (LOCAL_MEMCHECK_TEST)
|
||||
find_program (CTEST_MEMORYCHECK_COMMAND NAMES valgrind)
|
||||
set (CTEST_CONFIGURE_COMMAND
|
||||
"${CTEST_CMAKE_COMMAND} -C \"${CTEST_SOURCE_DIRECTORY}/config/cmake/mccacheinit.cmake\" -DCMAKE_BUILD_TYPE:STRING=${CTEST_CONFIGURATION_TYPE} ${BUILD_OPTIONS} \"-G${CTEST_CMAKE_GENERATOR}\" \"${CTEST_CONFIGURE_TOOLSET}\" \"${CTEST_SOURCE_DIRECTORY}\""
|
||||
)
|
||||
else ()
|
||||
if (LOCAL_COVERAGE_TEST)
|
||||
find_program (CTEST_COVERAGE_COMMAND NAMES gcov)
|
||||
endif ()
|
||||
set (CTEST_CONFIGURE_COMMAND
|
||||
"${CTEST_CMAKE_COMMAND} -C \"${CTEST_SOURCE_DIRECTORY}/config/cmake/cacheinit.cmake\" -DCMAKE_BUILD_TYPE:STRING=${CTEST_CONFIGURATION_TYPE} ${BUILD_OPTIONS} \"-G${CTEST_CMAKE_GENERATOR}\" \"${CTEST_CONFIGURE_TOOLSET}\" \"${CTEST_SOURCE_DIRECTORY}\""
|
||||
)
|
||||
endif ()
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
## -- set output to english
|
||||
set ($ENV{LC_MESSAGES} "en_EN")
|
||||
|
||||
# Print summary information.
|
||||
foreach (v
|
||||
CTEST_SITE
|
||||
CTEST_BUILD_NAME
|
||||
CTEST_SOURCE_DIRECTORY
|
||||
CTEST_BINARY_DIRECTORY
|
||||
CTEST_CMAKE_GENERATOR
|
||||
CTEST_CONFIGURATION_TYPE
|
||||
CTEST_GIT_COMMAND
|
||||
CTEST_CHECKOUT_COMMAND
|
||||
CTEST_CONFIGURE_COMMAND
|
||||
CTEST_SCRIPT_DIRECTORY
|
||||
CTEST_USE_LAUNCHERS
|
||||
)
|
||||
set (vars "${vars} ${v}=[${${v}}]\n")
|
||||
endforeach ()
|
||||
message (STATUS "Dashboard script configuration:\n${vars}\n")
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
#-----------------------------------------------------------------------------
|
||||
## NORMAL process
|
||||
## -- LOCAL_UPDATE updates the source folder from svn
|
||||
## -- LOCAL_SUBMIT reports to CDash server
|
||||
## -- LOCAL_SKIP_TEST skips the test process (only builds)
|
||||
## -- LOCAL_MEMCHECK_TEST executes the Valgrind testing
|
||||
## -- LOCAL_COVERAGE_TEST executes code coverage process
|
||||
## --------------------------
|
||||
ctest_start (${MODEL} TRACK ${MODEL})
|
||||
if (LOCAL_UPDATE)
|
||||
ctest_update (SOURCE "${CTEST_SOURCE_DIRECTORY}")
|
||||
endif ()
|
||||
configure_file (${CTEST_SOURCE_DIRECTORY}/config/cmake/CTestCustom.cmake ${CTEST_BINARY_DIRECTORY}/CTestCustom.cmake)
|
||||
ctest_read_custom_files ("${CTEST_BINARY_DIRECTORY}")
|
||||
ctest_configure (BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res)
|
||||
if (LOCAL_SUBMIT)
|
||||
ctest_submit (PARTS Update Configure Notes)
|
||||
endif ()
|
||||
if (${res} LESS 0 OR ${res} GREATER 0)
|
||||
file (APPEND ${CTEST_SCRIPT_DIRECTORY}/FailedCTest.txt "Failed Configure: ${res}\n")
|
||||
endif ()
|
||||
|
||||
ctest_build (BUILD "${CTEST_BINARY_DIRECTORY}" APPEND RETURN_VALUE res NUMBER_ERRORS errval)
|
||||
if (LOCAL_SUBMIT)
|
||||
ctest_submit (PARTS Build)
|
||||
endif ()
|
||||
if (${res} LESS 0 OR ${res} GREATER 0 OR ${errval} GREATER 0)
|
||||
file (APPEND ${CTEST_SCRIPT_DIRECTORY}/FailedCTest.txt "Failed ${errval} Build: ${res}\n")
|
||||
endif ()
|
||||
|
||||
if (NOT LOCAL_SKIP_TEST)
|
||||
if (NOT LOCAL_MEMCHECK_TEST)
|
||||
if (NOT LOCAL_BATCH_TEST)
|
||||
ctest_test (BUILD "${CTEST_BINARY_DIRECTORY}" APPEND ${ctest_test_args} RETURN_VALUE res)
|
||||
else ()
|
||||
|
0
config/cmake/scripts/HDF5config.cmake
Executable file → Normal file
0
config/cmake/scripts/HDF5config.cmake
Executable file → Normal file
0
config/cmake/scripts/HDF5options.cmake
Executable file → Normal file
0
config/cmake/scripts/HDF5options.cmake
Executable file → Normal file
@ -97,10 +97,10 @@ if (EXISTS ${TEST_FOLDER}/${TEST_OUTPUT}.err)
|
||||
string (REGEX REPLACE "^.*_pmi_alps[^\n]+\n" "" TEST_STREAM "${TEST_STREAM}")
|
||||
|
||||
if (NOT ERROR_APPEND)
|
||||
# append error output to the stdout output file
|
||||
# write back to original .err file
|
||||
file (WRITE ${TEST_FOLDER}/${TEST_OUTPUT}.err "${TEST_STREAM}")
|
||||
else ()
|
||||
# write back to original .err file
|
||||
# append error output to the stdout output file
|
||||
file (APPEND ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}")
|
||||
endif ()
|
||||
endif ()
|
||||
@ -125,8 +125,11 @@ message (STATUS "COMMAND Error: ${TEST_ERROR}")
|
||||
|
||||
# remove special output
|
||||
file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM)
|
||||
string (REGEX REPLACE "^.*_pmi_alps[^\n]+\n" "" TEST_STREAM "${TEST_STREAM}")
|
||||
file (WRITE ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}")
|
||||
string (FIND TEST_STREAM "_pmi_alps" "${TEST_FIND_RESULT}")
|
||||
if ("${TEST_FIND_RESULT}" GREATER "0")
|
||||
string (REGEX REPLACE "^.*_pmi_alps[^\n]+\n" "" TEST_STREAM "${TEST_STREAM}")
|
||||
file (WRITE ${TEST_FOLDER}/${TEST_OUTPUT} ${TEST_STREAM})
|
||||
endif ()
|
||||
|
||||
# if the output file needs Storage text removed
|
||||
if (TEST_MASK)
|
||||
|
@ -249,7 +249,7 @@ build-check-p: $(LIB) $(PROGS) $(chk_TESTS)
|
||||
echo "**** Hint ****"; \
|
||||
echo "Parallel test files reside in the current directory" \
|
||||
"by default."; \
|
||||
echo "Set HDF5_PARAPREFIX to use another directory. E.g.,"; \
|
||||
echo "Set HDF5_PARAPREFIX to use another directory. e.g.,"; \
|
||||
echo " HDF5_PARAPREFIX=/PFS/user/me"; \
|
||||
echo " export HDF5_PARAPREFIX"; \
|
||||
echo " make check"; \
|
||||
|
@ -3409,7 +3409,9 @@ AC_CONFIG_FILES([src/libhdf5.settings
|
||||
test/test_filenotclosed.sh
|
||||
test/test_filter_plugin.sh
|
||||
test/test_usecases.sh
|
||||
test/test_vol_plugin.sh
|
||||
testpar/Makefile
|
||||
testpar/testpflush.sh
|
||||
tools/Makefile
|
||||
tools/lib/Makefile
|
||||
tools/src/Makefile
|
||||
|
@ -102,7 +102,7 @@ qsub -I -q debug -l mppwidth=8
|
||||
- configure HDF5:
|
||||
RUNSERIAL="aprun -q -n 1" RUNPARALLEL="aprun -q -n 6" FC=ftn CC=cc /path/to/source/configure --enable-fortran --enable-parallel --disable-shared
|
||||
|
||||
RUNSERIAL and RUNPARALLEL tells the library how it should launch programs that are part of the build procedure.
|
||||
RUNSERIAL and RUNPARALLEL tell the library how it should launch programs that are part of the build procedure.
|
||||
|
||||
- Compile HDF5:
|
||||
gmake
|
||||
@ -155,12 +155,16 @@ to run a parallel application on one processor and on many processors. If the
|
||||
compiler is `mpicc' and the user hasn't specified values for RUNSERIAL and
|
||||
RUNPARALLEL then configure chooses `mpiexec' from the same directory as `mpicc':
|
||||
|
||||
RUNSERIAL: /usr/local/mpi/bin/mpiexec -np 1
|
||||
RUNPARALLEL: /usr/local/mpi/bin/mpiexec -np $${NPROCS:=6}
|
||||
RUNSERIAL: mpiexec -n 1
|
||||
RUNPARALLEL: mpiexec -n $${NPROCS:=6}
|
||||
|
||||
The `$${NPROCS:=6}' will be substituted with the value of the NPROCS
|
||||
environment variable at the time `make check' is run (or the value 6).
|
||||
|
||||
Note that some MPI implementations (e.g. OpenMPI 4.0) disallow oversubscribing
|
||||
nodes by default so you'll have to either set NPROCS equal to the number of
|
||||
processors available (or fewer) or redefine RUNPARALLEL with appropriate
|
||||
flag(s) (--oversubscribe in OpenMPI).
|
||||
|
||||
4. Parallel test suite
|
||||
----------------------
|
||||
|
257
src/H5Dint.c
257
src/H5Dint.c
@ -25,6 +25,7 @@
|
||||
#include "H5CXprivate.h" /* API Contexts */
|
||||
#include "H5Dpkg.h" /* Datasets */
|
||||
#include "H5Eprivate.h" /* Error handling */
|
||||
#include "H5Fprivate.h" /* Files */
|
||||
#include "H5FLprivate.h" /* Free Lists */
|
||||
#include "H5FOprivate.h" /* File objects */
|
||||
#include "H5Iprivate.h" /* IDs */
|
||||
@ -59,6 +60,9 @@ static herr_t H5D__init_storage(const H5D_io_info_t *io_info, hbool_t full_overw
|
||||
hsize_t old_dim[]);
|
||||
static herr_t H5D__append_flush_setup(H5D_t *dset, hid_t dapl_id);
|
||||
static herr_t H5D__close_cb(H5VL_object_t *dset_vol_obj);
|
||||
static herr_t H5D__use_minimized_dset_headers(H5F_t *file, H5D_t *dset, hbool_t *minimize);
|
||||
static herr_t H5D__prepare_minimized_oh(H5F_t *file, H5D_t *dset, H5O_loc_t *oloc);
|
||||
static size_t H5D__calculate_minimum_header_size(H5F_t *file, H5D_t *dset, H5O_t *ohdr);
|
||||
|
||||
|
||||
/*********************/
|
||||
@ -656,6 +660,211 @@ done:
|
||||
FUNC_LEAVE_NOAPI(ret_value)
|
||||
} /* end H5D__init_space() */
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: H5D__use_minimized_dset_headers
|
||||
*
|
||||
* Purpose: Compartmentalize check for file- or dcpl-set values indicating
|
||||
* to create a "minimized" dataset object header.
|
||||
* Upon success, write resulting value to out pointer `minimize`.
|
||||
*
|
||||
* Return: Success: SUCCEED (0) (non-negative value)
|
||||
* Failure: FAIL (-1) (negative value)
|
||||
*
|
||||
* Programmer: Jacob Smith
|
||||
* 16 August 2018
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
static herr_t
|
||||
H5D__use_minimized_dset_headers(H5F_t *file, H5D_t *dset, hbool_t *minimize)
|
||||
{
|
||||
H5P_genplist_t *plist = NULL;
|
||||
herr_t ret_value = SUCCEED;
|
||||
|
||||
FUNC_ENTER_NOAPI_NOINIT;
|
||||
|
||||
HDassert(file);
|
||||
HDassert(dset);
|
||||
HDassert(minimize);
|
||||
|
||||
plist = H5P_object_verify(dset->shared->dcpl_id, H5P_DATASET_CREATE);
|
||||
if(NULL == plist)
|
||||
HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "problem getting dcpl")
|
||||
if(H5P_get(plist, H5D_CRT_MIN_DSET_HDR_SIZE_NAME, minimize) == FAIL)
|
||||
HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get minimize value from dcpl")
|
||||
|
||||
if(FALSE == *minimize)
|
||||
*minimize = H5F_get_min_dset_ohdr(file);
|
||||
|
||||
done:
|
||||
if(FAIL == ret_value)
|
||||
*minimize = FALSE;
|
||||
FUNC_LEAVE_NOAPI(ret_value);
|
||||
} /* H5D__use_minimized_dset_headers */
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: H5D__calculate_minimium_header_size
|
||||
*
|
||||
* Purpose: Calculate the size required for the minimized object header.
|
||||
*
|
||||
* Return: Success: Positive value > 0
|
||||
* Failure: 0
|
||||
*
|
||||
* Programmer: Jacob Smith
|
||||
* 16 August 2018
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
static size_t
|
||||
H5D__calculate_minimum_header_size(H5F_t *file, H5D_t *dset, H5O_t *ohdr)
|
||||
{
|
||||
H5T_t *type = NULL;
|
||||
H5O_fill_t *fill_prop = NULL;
|
||||
hbool_t use_at_least_v18 = FALSE;
|
||||
const char continuation[1] = ""; /* requred for work-around */
|
||||
size_t get_value = 0;
|
||||
size_t ret_value = 0;
|
||||
|
||||
FUNC_ENTER_NOAPI_NOINIT;
|
||||
|
||||
HDassert(file);
|
||||
HDassert(dset);
|
||||
HDassert(ohdr);
|
||||
|
||||
type = dset->shared->type;
|
||||
fill_prop = &(dset->shared->dcpl_cache.fill);
|
||||
use_at_least_v18 = (H5F_LOW_BOUND(file) >= H5F_LIBVER_V18);
|
||||
|
||||
/* Datatype message size */
|
||||
get_value = H5O_msg_size_oh(file, ohdr, H5O_DTYPE_ID, type, 0);
|
||||
if (get_value == 0)
|
||||
HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, 0, "Can't get size of datatype message")
|
||||
ret_value += get_value;
|
||||
|
||||
/* Shared Dataspace message size */
|
||||
get_value = H5O_msg_size_oh(file, ohdr, H5O_SDSPACE_ID, dset->shared->space, 0);
|
||||
if (get_value == 0)
|
||||
HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, 0, "can't get size of dataspace message")
|
||||
ret_value += get_value;
|
||||
|
||||
/* "Layout" message size */
|
||||
get_value = H5O_msg_size_oh(file, ohdr, H5O_LAYOUT_ID, &dset->shared->layout, 0);
|
||||
if (get_value == 0)
|
||||
HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, 0, "can't get size of layout message")
|
||||
ret_value += get_value;
|
||||
|
||||
/* Fill Value message size */
|
||||
get_value = H5O_msg_size_oh(file, ohdr, H5O_FILL_NEW_ID, fill_prop, 0);
|
||||
if (get_value == 0)
|
||||
HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, 0, "can't get size of fill value message")
|
||||
ret_value += get_value;
|
||||
|
||||
/* "Continuation" message size */
|
||||
/* message pointer "continuation" is unused by raw get function, however,
|
||||
* a null pointer would be intercepted by an assert in H5O_msg_size_oh().
|
||||
*/
|
||||
get_value = H5O_msg_size_oh(file, ohdr, H5O_CONT_ID, continuation, 0);
|
||||
if (get_value == 0)
|
||||
HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, 0, "can't get size of continuation message")
|
||||
ret_value += get_value;
|
||||
|
||||
/* Fill Value (backwards compatability) message size */
|
||||
if(fill_prop->buf && !use_at_least_v18) {
|
||||
H5O_fill_t old_fill_prop; /* Copy for writing "old" fill value */
|
||||
|
||||
/* Shallow copy the fill value property */
|
||||
/* guards against shared component modification */
|
||||
HDmemcpy(&old_fill_prop, fill_prop, sizeof(old_fill_prop));
|
||||
|
||||
if (H5O_msg_reset_share(H5O_FILL_ID, &old_fill_prop) < 0)
|
||||
HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, 0, "can't reset the copied fill property")
|
||||
|
||||
get_value = H5O_msg_size_oh(file, ohdr, H5O_FILL_ID, &old_fill_prop, 0);
|
||||
if (get_value == 0)
|
||||
HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, 0, "can't get size of fill value (backwards compat) message")
|
||||
ret_value += get_value;
|
||||
}
|
||||
|
||||
/* Filter/Pipeline message size */
|
||||
if(H5D_CHUNKED == dset->shared->layout.type) {
|
||||
H5O_pline_t *pline = &dset->shared->dcpl_cache.pline;
|
||||
if(pline->nused > 0) {
|
||||
get_value = H5O_msg_size_oh(file, ohdr, H5O_PLINE_ID, pline, 0);
|
||||
if (get_value == 0)
|
||||
HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, 0, "can't get size of filter message")
|
||||
ret_value += get_value;
|
||||
}
|
||||
}
|
||||
|
||||
/* External File Link message size */
|
||||
if(dset->shared->dcpl_cache.efl.nused > 0) {
|
||||
get_value = H5O_msg_size_oh(file, ohdr, H5O_EFL_ID, &dset->shared->dcpl_cache.efl, 0);
|
||||
if (get_value == 0)
|
||||
HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, 0, "can't get size of external file link message")
|
||||
ret_value += get_value;
|
||||
}
|
||||
|
||||
/* Modification Time message size */
|
||||
if(H5O_HDR_STORE_TIMES & H5O_OH_GET_FLAGS(ohdr)) {
|
||||
HDassert(H5O_OH_GET_VERSION(ohdr) >= 1); /* 1 :: H5O_VERSION_1 (H5Opkg.h) */
|
||||
|
||||
if(H5O_OH_GET_VERSION(ohdr) == 1) {
|
||||
/* v1 object headers store modification time as a message */
|
||||
time_t mtime;
|
||||
get_value = H5O_msg_size_oh(file, ohdr, H5O_MTIME_NEW_ID, &mtime, 0);
|
||||
if (get_value == 0)
|
||||
HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, 0, "can't get size of modification time message")
|
||||
ret_value += get_value;
|
||||
}
|
||||
}
|
||||
|
||||
done:
|
||||
FUNC_LEAVE_NOAPI(ret_value);
|
||||
} /* H5D__calculate_minimum_header_size */
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: H5D__prepare_minimized_oh
|
||||
*
|
||||
* Purpose: Create an object header (H5O_t) allocated with the smallest
|
||||
* possible size.
|
||||
*
|
||||
* Return: Success: SUCCEED (0) (non-negative value)
|
||||
* Failure: FAIL (-1) (negative value)
|
||||
*
|
||||
* Programmer: Jacob Smith
|
||||
* 16 August 2018
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
static herr_t
|
||||
H5D__prepare_minimized_oh(H5F_t *file, H5D_t *dset, H5O_loc_t *oloc)
|
||||
{
|
||||
H5O_t *oh = NULL;
|
||||
size_t ohdr_size = 0;
|
||||
herr_t ret_value = SUCCEED;
|
||||
|
||||
FUNC_ENTER_NOAPI_NOINIT;
|
||||
|
||||
HDassert(file);
|
||||
HDassert(dset);
|
||||
HDassert(oloc);
|
||||
|
||||
oh = H5O__create_ohdr(file, dset->shared->dcpl_id);
|
||||
if(NULL == oh)
|
||||
HGOTO_ERROR(H5E_OHDR, H5E_BADVALUE, FAIL, "can't instantiate object header")
|
||||
|
||||
ohdr_size = H5D__calculate_minimum_header_size(file, dset, oh);
|
||||
if (ohdr_size == 0)
|
||||
HGOTO_ERROR(H5E_OHDR, H5E_BADVALUE, FAIL, "computed header size is invalid")
|
||||
|
||||
/* Special allocation of space for compact datsets is handled by the call here. */
|
||||
if(H5O__apply_ohdr(file, oh, dset->shared->dcpl_id, ohdr_size, (size_t)1, oloc) == FAIL)
|
||||
HGOTO_ERROR(H5E_OHDR, H5E_BADVALUE, FAIL, "can't apply object header to file")
|
||||
|
||||
done:
|
||||
FUNC_LEAVE_NOAPI(ret_value);
|
||||
} /* H5D__prepare_minimized_oh */
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: H5D__update_oh_info
|
||||
@ -669,17 +878,18 @@ done:
|
||||
static herr_t
|
||||
H5D__update_oh_info(H5F_t *file, H5D_t *dset, hid_t dapl_id)
|
||||
{
|
||||
H5O_t *oh = NULL; /* Pointer to dataset's object header */
|
||||
size_t ohdr_size = H5D_MINHDR_SIZE; /* Size of dataset's object header */
|
||||
H5O_loc_t *oloc = NULL; /* Dataset's object location */
|
||||
H5O_layout_t *layout; /* Dataset's layout information */
|
||||
H5T_t *type; /* Dataset's datatype */
|
||||
H5O_fill_t *fill_prop; /* Pointer to dataset's fill value information */
|
||||
H5D_fill_value_t fill_status; /* Fill value status */
|
||||
hbool_t fill_changed = FALSE; /* Flag indicating the fill value was changed */
|
||||
hbool_t layout_init = FALSE; /* Flag to indicate that chunk information was initialized */
|
||||
hbool_t use_at_least_v18; /* Flag indicating to use at least v18 format versions */
|
||||
herr_t ret_value = SUCCEED; /* Return value */
|
||||
H5O_t *oh = NULL; /* Pointer to dataset's object header */
|
||||
size_t ohdr_size = H5D_MINHDR_SIZE; /* Size of dataset's object header */
|
||||
H5O_loc_t *oloc = NULL; /* Dataset's object location */
|
||||
H5O_layout_t *layout; /* Dataset's layout information */
|
||||
H5T_t *type; /* Dataset's datatype */
|
||||
H5O_fill_t *fill_prop; /* Pointer to dataset's fill value information */
|
||||
H5D_fill_value_t fill_status; /* Fill value status */
|
||||
hbool_t fill_changed = FALSE; /* Flag indicating the fill value was changed */
|
||||
hbool_t layout_init = FALSE; /* Flag to indicate that chunk information was initialized */
|
||||
hbool_t use_at_least_v18; /* Flag indicating to use at least v18 format versions */
|
||||
hbool_t minimize_header = FALSE;
|
||||
herr_t ret_value = SUCCEED; /* Return value */
|
||||
|
||||
FUNC_ENTER_STATIC
|
||||
|
||||
@ -747,13 +957,24 @@ H5D__update_oh_info(H5F_t *file, H5D_t *dset, hid_t dapl_id)
|
||||
HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set fill value info")
|
||||
} /* end if */
|
||||
|
||||
/* Add the dataset's raw data size to the size of the header, if the raw data will be stored as compact */
|
||||
if(layout->type == H5D_COMPACT)
|
||||
ohdr_size += layout->storage.u.compact.size;
|
||||
if(H5D__use_minimized_dset_headers(file, dset, &minimize_header) == FAIL)
|
||||
HGOTO_ERROR(H5E_ARGS, H5E_CANTGET, FAIL, "can't get minimize settings")
|
||||
|
||||
if(TRUE == minimize_header) {
|
||||
if(H5D__prepare_minimized_oh(file, dset, oloc) == FAIL)
|
||||
HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't create minimized dataset object header")
|
||||
} else {
|
||||
/* Add the dataset's raw data size to the size of the header, if the
|
||||
* raw data will be stored as compact
|
||||
*/
|
||||
if(H5D_COMPACT == layout->type)
|
||||
ohdr_size += layout->storage.u.compact.size;
|
||||
|
||||
/* Create an object header for the dataset */
|
||||
if(H5O_create(file, ohdr_size, (size_t)1, dset->shared->dcpl_id, oloc/*out*/) < 0)
|
||||
HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to create dataset object header")
|
||||
} /* If use minimum/standard object header space */
|
||||
|
||||
/* Create an object header for the dataset */
|
||||
if(H5O_create(file, ohdr_size, (size_t)1, dset->shared->dcpl_id, oloc/*out*/) < 0)
|
||||
HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to create dataset object header")
|
||||
HDassert(file == dset->oloc.file);
|
||||
|
||||
/* Pin the object header */
|
||||
@ -910,7 +1131,7 @@ H5D__build_file_prefix(const H5D_t *dset, hid_t dapl_id, const char *prefix_type
|
||||
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed")
|
||||
} /* end if */
|
||||
else {
|
||||
if (HDstrncmp(prefix, "${ORIGIN}", HDstrlen("${ORIGIN}")) == 0) {
|
||||
if(HDstrncmp(prefix, "${ORIGIN}", HDstrlen("${ORIGIN}")) == 0) {
|
||||
/* Replace ${ORIGIN} at beginning of prefix by directory of HDF5 file */
|
||||
filepath_len = HDstrlen(filepath);
|
||||
prefix_len = HDstrlen(prefix);
|
||||
|
@ -45,6 +45,7 @@
|
||||
#define H5D_CRT_FILL_VALUE_NAME "fill_value" /* Fill value */
|
||||
#define H5D_CRT_ALLOC_TIME_STATE_NAME "alloc_time_state" /* Space allocation time state */
|
||||
#define H5D_CRT_EXT_FILE_LIST_NAME "efl" /* External file list */
|
||||
#define H5D_CRT_MIN_DSET_HDR_SIZE_NAME "dset_oh_minimize"/* Minimize object header */
|
||||
|
||||
/* ======== Dataset access property names ======== */
|
||||
#define H5D_ACS_DATA_CACHE_NUM_SLOTS_NAME "rdcc_nslots" /* Size of raw data chunk cache(slots) */
|
||||
|
88
src/H5F.c
88
src/H5F.c
@ -1335,7 +1335,7 @@ H5Fget_metadata_read_retry_info(hid_t file_id, H5F_retry_info_t *info)
|
||||
H5TRACE2("e", "i*x", file_id, info);
|
||||
|
||||
/* Check args */
|
||||
if (!info)
|
||||
if(!info)
|
||||
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no info struct")
|
||||
|
||||
/* Get the file pointer */
|
||||
@ -1822,3 +1822,89 @@ done:
|
||||
FUNC_LEAVE_API(ret_value)
|
||||
} /* H5Fincrement_filesize() */
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: H5Fget_dset_no_attrs_hint
|
||||
*
|
||||
* Purpose:
|
||||
*
|
||||
* Get the file-level setting to create minimized dataset object headers.
|
||||
* Result is stored at pointer `minimize`.
|
||||
*
|
||||
* Return:
|
||||
*
|
||||
* Success: SUCCEED (0) (non-negative value)
|
||||
* Failure: FAIL (-1) (negative value)
|
||||
*
|
||||
* Programmer:
|
||||
*
|
||||
* Jacob Smith
|
||||
* 15 August 2018
|
||||
*
|
||||
* Changes: None.
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
herr_t
|
||||
H5Fget_dset_no_attrs_hint(hid_t file_id, hbool_t *minimize)
|
||||
{
|
||||
H5VL_object_t *vol_obj = NULL;
|
||||
herr_t ret_value = SUCCEED;
|
||||
|
||||
FUNC_ENTER_API(FAIL)
|
||||
H5TRACE2("e", "i*b", file_id, minimize);
|
||||
|
||||
if(NULL == minimize)
|
||||
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "out pointer 'minimize' cannot be NULL")
|
||||
|
||||
vol_obj = (H5VL_object_t *)H5I_object_verify(file_id, H5I_FILE);
|
||||
if(NULL == vol_obj)
|
||||
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid file identifier")
|
||||
|
||||
if(H5VL_file_optional(vol_obj, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL, H5VL_NATIVE_FILE_GET_MIN_DSET_OHDR_FLAG, minimize) < 0)
|
||||
HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "unable to set file's dataset header minimization flag")
|
||||
|
||||
done:
|
||||
FUNC_LEAVE_API(ret_value)
|
||||
} /* H5Fget_dset_no_attrs_hint */
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: H5Fset_dset_no_attrs_hint
|
||||
*
|
||||
* Purpose:
|
||||
*
|
||||
* Set the file-level setting to create minimized dataset object headers.
|
||||
*
|
||||
* Return:
|
||||
*
|
||||
* Success: SUCCEED (0) (non-negative value)
|
||||
* Failure: FAIL (-1) (negative value)
|
||||
*
|
||||
* Programmer:
|
||||
*
|
||||
* Jacob Smith
|
||||
* 15 August 2018
|
||||
*
|
||||
* Changes: None.
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
herr_t
|
||||
H5Fset_dset_no_attrs_hint(hid_t file_id, hbool_t minimize)
|
||||
{
|
||||
H5VL_object_t *vol_obj = NULL;
|
||||
herr_t ret_value = SUCCEED;
|
||||
|
||||
FUNC_ENTER_API(FAIL)
|
||||
H5TRACE2("e", "ib", file_id, minimize);
|
||||
|
||||
vol_obj = (H5VL_object_t *)H5I_object_verify(file_id, H5I_FILE);
|
||||
if(NULL == vol_obj)
|
||||
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid file identifier")
|
||||
|
||||
if(H5VL_file_optional(vol_obj, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL, H5VL_NATIVE_FILE_SET_MIN_DSET_OHDR_FLAG, minimize) < 0)
|
||||
HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "unable to set file's dataset header minimization flag")
|
||||
|
||||
done:
|
||||
FUNC_LEAVE_API(ret_value)
|
||||
} /* H5Fset_dset_no_attrs_hint */
|
||||
|
||||
|
@ -420,8 +420,8 @@ done:
|
||||
* Purpose: Initialize this driver by registering the driver with the
|
||||
* library.
|
||||
*
|
||||
* Return: Success: The driver ID for the core driver.
|
||||
* Failure: Negative.
|
||||
* Return: Success: The driver ID for the core driver
|
||||
* Failure: H5I_INVALID_HID
|
||||
*
|
||||
* Programmer: Robb Matzke
|
||||
* Thursday, July 29, 1999
|
||||
@ -433,7 +433,7 @@ H5FD_core_init(void)
|
||||
{
|
||||
hid_t ret_value = H5I_INVALID_HID; /* Return value */
|
||||
|
||||
FUNC_ENTER_NOAPI(FAIL)
|
||||
FUNC_ENTER_NOAPI(H5I_INVALID_HID)
|
||||
|
||||
if(H5I_VFL != H5I_get_type(H5FD_CORE_g))
|
||||
H5FD_CORE_g = H5FD_register(&H5FD_core_g, sizeof(H5FD_class_t), FALSE);
|
||||
|
@ -206,30 +206,27 @@ done:
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: H5FD_direct_init
|
||||
* Function: H5FD_direct_init
|
||||
*
|
||||
* Purpose: Initialize this driver by registering the driver with the
|
||||
* library.
|
||||
* Purpose: Initialize this driver by registering the driver with the
|
||||
* library.
|
||||
*
|
||||
* Return: Success: The driver ID for the direct driver.
|
||||
*
|
||||
* Failure: Negative.
|
||||
* Return: Success: The driver ID for the direct driver
|
||||
* Failure: H5I_INVALID_HID
|
||||
*
|
||||
* Programmer: Raymond Lu
|
||||
* Wednesday, 20 September 2006
|
||||
*
|
||||
* Modifications:
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
hid_t
|
||||
H5FD_direct_init(void)
|
||||
{
|
||||
hid_t ret_value; /* Return value */
|
||||
hid_t ret_value = H5I_INVALID_HID; /* Return value */
|
||||
|
||||
FUNC_ENTER_NOAPI(FAIL)
|
||||
FUNC_ENTER_NOAPI(H5I_INVALID_HID)
|
||||
|
||||
if (H5I_VFL!=H5I_get_type(H5FD_DIRECT_g))
|
||||
if (H5I_VFL != H5I_get_type(H5FD_DIRECT_g))
|
||||
H5FD_DIRECT_g = H5FD_register(&H5FD_direct_g,sizeof(H5FD_class_t),FALSE);
|
||||
|
||||
/* Set return value */
|
||||
@ -237,7 +234,7 @@ H5FD_direct_init(void)
|
||||
|
||||
done:
|
||||
FUNC_LEAVE_NOAPI(ret_value)
|
||||
}
|
||||
} /* end H5FD_direct_init() */
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
|
@ -171,28 +171,25 @@ done:
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: H5FD_family_init
|
||||
* Function: H5FD_family_init
|
||||
*
|
||||
* Purpose: Initialize this driver by registering the driver with the
|
||||
* library.
|
||||
* Purpose: Initialize this driver by registering the driver with the
|
||||
* library.
|
||||
*
|
||||
* Return: Success: The driver ID for the family driver.
|
||||
* Return: Success: The driver ID for the family driver
|
||||
* Failure: H5I_INVALID_HID
|
||||
*
|
||||
* Failure: Negative
|
||||
*
|
||||
* Programmer: Robb Matzke
|
||||
* Programmer: Robb Matzke
|
||||
* Wednesday, August 4, 1999
|
||||
*
|
||||
* Modifications:
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
hid_t
|
||||
H5FD_family_init(void)
|
||||
{
|
||||
hid_t ret_value = H5FD_FAMILY_g; /* Return value */
|
||||
hid_t ret_value = H5I_INVALID_HID; /* Return value */
|
||||
|
||||
FUNC_ENTER_NOAPI(FAIL)
|
||||
FUNC_ENTER_NOAPI(H5I_INVALID_HID)
|
||||
|
||||
if(H5I_VFL != H5I_get_type(H5FD_FAMILY_g))
|
||||
H5FD_FAMILY_g = H5FD_register(&H5FD_family_g, sizeof(H5FD_class_t), FALSE);
|
||||
|
@ -252,8 +252,8 @@ done:
|
||||
* Purpose: Initialize this driver by registering the driver with the
|
||||
* library.
|
||||
*
|
||||
* Return: Success: The driver ID for the log driver.
|
||||
* Failure: Negative.
|
||||
* Return: Success: The driver ID for the log driver
|
||||
* Failure: H5I_INVALID_HID
|
||||
*
|
||||
* Programmer: Robb Matzke
|
||||
* Thursday, July 29, 1999
|
||||
@ -265,7 +265,7 @@ H5FD_log_init(void)
|
||||
{
|
||||
hid_t ret_value = H5I_INVALID_HID; /* Return value */
|
||||
|
||||
FUNC_ENTER_NOAPI(FAIL)
|
||||
FUNC_ENTER_NOAPI(H5I_INVALID_HID)
|
||||
|
||||
if(H5I_VFL != H5I_get_type(H5FD_LOG_g))
|
||||
H5FD_LOG_g = H5FD_register(&H5FD_log_g, sizeof(H5FD_class_t), FALSE);
|
||||
|
@ -187,15 +187,15 @@ done:
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: H5FD_mpio_init
|
||||
* Function: H5FD_mpio_init
|
||||
*
|
||||
* Purpose: Initialize this driver by registering the driver with the
|
||||
* library.
|
||||
* Purpose: Initialize this driver by registering the driver with the
|
||||
* library.
|
||||
*
|
||||
* Return: Success: The driver ID for the mpio driver.
|
||||
* Failure: Negative.
|
||||
* Return: Success: The driver ID for the mpio driver
|
||||
* Failure: H5I_INVALID_HID
|
||||
*
|
||||
* Programmer: Robb Matzke
|
||||
* Programmer: Robb Matzke
|
||||
* Thursday, August 5, 1999
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
@ -206,10 +206,10 @@ H5FD_mpio_init(void)
|
||||
#ifdef H5FDmpio_DEBUG
|
||||
static int H5FD_mpio_Debug_inited = 0;
|
||||
#endif /* H5FDmpio_DEBUG */
|
||||
const char *s; /* String for environment variables */
|
||||
hid_t ret_value; /* Return value */
|
||||
const char *s; /* String for environment variables */
|
||||
hid_t ret_value = H5I_INVALID_HID; /* Return value */
|
||||
|
||||
FUNC_ENTER_NOAPI(FAIL)
|
||||
FUNC_ENTER_NOAPI(H5I_INVALID_HID)
|
||||
|
||||
/* Register the MPI-IO VFD, if it isn't already */
|
||||
if(H5I_VFL != H5I_get_type(H5FD_MPIO_g))
|
||||
@ -217,8 +217,10 @@ H5FD_mpio_init(void)
|
||||
|
||||
/* Allow MPI buf-and-file-type optimizations? */
|
||||
s = HDgetenv("HDF5_MPI_OPT_TYPES");
|
||||
if(s && HDisdigit(*s))
|
||||
H5FD_mpi_opt_types_g = (hbool_t)HDstrtol(s, NULL, 0);
|
||||
if(s && HDisdigit(*s)) {
|
||||
long env_val = HDstrtol(s, NULL, 0);
|
||||
H5FD_mpi_opt_types_g = (0 == env_val) ? FALSE : TRUE;
|
||||
}
|
||||
|
||||
#ifdef H5FDmpio_DEBUG
|
||||
if(!H5FD_mpio_Debug_inited) {
|
||||
@ -226,12 +228,12 @@ H5FD_mpio_init(void)
|
||||
s = HDgetenv("H5FD_mpio_Debug");
|
||||
if(s) {
|
||||
/* Set debug mask */
|
||||
while(*s) {
|
||||
H5FD_mpio_Debug[(int)*s]++;
|
||||
s++;
|
||||
} /* end while */
|
||||
while(*s) {
|
||||
H5FD_mpio_Debug[(int)*s]++;
|
||||
s++;
|
||||
} /* end while */
|
||||
} /* end if */
|
||||
H5FD_mpio_Debug_inited++;
|
||||
H5FD_mpio_Debug_inited++;
|
||||
} /* end if */
|
||||
#endif /* H5FDmpio_DEBUG */
|
||||
|
||||
|
@ -26,11 +26,6 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
/* Disable certain warnings in PC-Lint: */
|
||||
/*lint --emacro( {534, 830}, H5P_DEFAULT, H5P_FILE_ACCESS, H5P_DATASET_XFER) */
|
||||
/*lint --emacro( {534, 830}, H5FD_MULTI) */
|
||||
/*lint -esym( 534, H5Eclear2, H5Epush2) */
|
||||
|
||||
#include "hdf5.h"
|
||||
|
||||
|
||||
@ -211,16 +206,15 @@ my_strdup(const char *s)
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: H5FD_multi_init
|
||||
* Function: H5FD_multi_init
|
||||
*
|
||||
* Purpose: Initialize this driver by registering the driver with the
|
||||
* library.
|
||||
* Purpose: Initialize this driver by registering the driver with the
|
||||
* library.
|
||||
*
|
||||
* Return: Success: The driver ID for the multi driver.
|
||||
* Return: Success: The driver ID for the multi driver
|
||||
* Failure: H5I_INVALID_HID
|
||||
*
|
||||
* Failure: Negative
|
||||
*
|
||||
* Programmer: Robb Matzke
|
||||
* Programmer: Robb Matzke
|
||||
* Wednesday, August 4, 1999
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
@ -231,11 +225,11 @@ H5FD_multi_init(void)
|
||||
/* Clear the error stack */
|
||||
H5Eclear2(H5E_DEFAULT);
|
||||
|
||||
if(H5I_VFL!=H5Iget_type(H5FD_MULTI_g))
|
||||
if(H5I_VFL != H5Iget_type(H5FD_MULTI_g))
|
||||
H5FD_MULTI_g = H5FDregister(&H5FD_multi_g);
|
||||
|
||||
return H5FD_MULTI_g;
|
||||
}
|
||||
} /* end H5FD_multi_init() */
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
|
@ -208,8 +208,8 @@ done:
|
||||
* Purpose: Initialize this driver by registering the driver with the
|
||||
* library.
|
||||
*
|
||||
* Return: Success: The driver ID for the sec2 driver.
|
||||
* Failure: Negative
|
||||
* Return: Success: The driver ID for the sec2 driver
|
||||
* Failure: H5I_INVALID_HID
|
||||
*
|
||||
* Programmer: Robb Matzke
|
||||
* Thursday, July 29, 1999
|
||||
@ -221,7 +221,7 @@ H5FD_sec2_init(void)
|
||||
{
|
||||
hid_t ret_value = H5I_INVALID_HID; /* Return value */
|
||||
|
||||
FUNC_ENTER_NOAPI(FAIL)
|
||||
FUNC_ENTER_NOAPI(H5I_INVALID_HID)
|
||||
|
||||
if(H5I_VFL != H5I_get_type(H5FD_SEC2_g))
|
||||
H5FD_SEC2_g = H5FD_register(&H5FD_sec2_g, sizeof(H5FD_class_t), FALSE);
|
||||
|
24
src/H5Fint.c
24
src/H5Fint.c
@ -3715,3 +3715,27 @@ done:
|
||||
FUNC_LEAVE_NOAPI(ret_value)
|
||||
} /* end H5F_get_file_id() */
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: H5F_set_min_dset_ohdr
|
||||
*
|
||||
* Purpose: Set the crt_dset_ohdr_flag field with a new value.
|
||||
*
|
||||
* Return: SUCCEED/FAIL
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
herr_t
|
||||
H5F_set_min_dset_ohdr(H5F_t *f, hbool_t minimize)
|
||||
{
|
||||
/* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */
|
||||
FUNC_ENTER_NOAPI_NOINIT_NOERR
|
||||
|
||||
/* Sanity check */
|
||||
HDassert(f);
|
||||
HDassert(f->shared);
|
||||
|
||||
f->shared->crt_dset_min_ohdr_flag = minimize;
|
||||
|
||||
FUNC_LEAVE_NOAPI(SUCCEED)
|
||||
} /* H5F_set_min_dset_ohdr() */
|
||||
|
||||
|
@ -358,6 +358,7 @@ struct H5F_file_t {
|
||||
|
||||
/* Object flush info */
|
||||
H5F_object_flush_t object_flush; /* Information for object flush callback */
|
||||
hbool_t crt_dset_min_ohdr_flag; /* flag to minimize created dataset object header */
|
||||
};
|
||||
|
||||
/*
|
||||
@ -382,7 +383,6 @@ struct H5F_t {
|
||||
#endif /* H5_HAVE_PARALLEL */
|
||||
};
|
||||
|
||||
|
||||
/*****************************/
|
||||
/* Package Private Variables */
|
||||
/*****************************/
|
||||
|
@ -331,6 +331,8 @@ typedef struct H5F_t H5F_t;
|
||||
#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)
|
||||
#define H5F_EOA_PRE_FSM_FSALLOC(F) ((F)->shared->eoa_pre_fsm_fsalloc)
|
||||
#define H5F_GET_MIN_DSET_OHDR(F) ((F)->shared->crt_dset_min_ohdr_flag)
|
||||
#define H5F_SET_MIN_DSET_OHDR(F, V) ((F)->shared->crt_dset_min_ohdr_flag = (V))
|
||||
#else /* H5F_MODULE */
|
||||
#define H5F_LOW_BOUND(F) (H5F_get_low_bound(F))
|
||||
#define H5F_HIGH_BOUND(F) (H5F_get_high_bound(F))
|
||||
@ -388,6 +390,8 @@ typedef struct H5F_t H5F_t;
|
||||
#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))
|
||||
#define H5F_EOA_PRE_FSM_FSALLOC(F) (H5F_get_eoa_pre_fsm_fsalloc(F))
|
||||
#define H5F_GET_MIN_DSET_OHDR(F) (H5F_get_min_dset_ohdr(F))
|
||||
#define H5F_SET_MIN_DSET_OHDR(F, V) (H5F_set_min_dset_ohdr((F), (V)))
|
||||
#endif /* H5F_MODULE */
|
||||
|
||||
|
||||
@ -740,6 +744,8 @@ H5_DLL hsize_t H5F_get_pgend_meta_thres(const H5F_t *f);
|
||||
H5_DLL hbool_t H5F_get_point_of_no_return(const H5F_t *f);
|
||||
H5_DLL hbool_t H5F_get_first_alloc_dealloc(const H5F_t *f);
|
||||
H5_DLL haddr_t H5F_get_eoa_pre_fsm_fsalloc(const H5F_t *f);
|
||||
H5_DLL hbool_t H5F_get_min_dset_ohdr(const H5F_t *f);
|
||||
H5_DLL herr_t H5F_set_min_dset_ohdr(H5F_t *f, hbool_t minimize);
|
||||
|
||||
/* Functions than retrieve values set/cached from the superblock/FCPL */
|
||||
H5_DLL haddr_t H5F_get_base_addr(const H5F_t *f);
|
||||
|
@ -217,7 +217,6 @@ typedef struct H5F_retry_info_t {
|
||||
/* Callback for H5Pset_object_flush_cb() in a file access property list */
|
||||
typedef herr_t (*H5F_flush_cb_t)(hid_t object_id, void *udata);
|
||||
|
||||
|
||||
/*********************/
|
||||
/* Public Prototypes */
|
||||
/*********************/
|
||||
@ -275,6 +274,8 @@ H5_DLL herr_t H5Freset_page_buffering_stats(hid_t file_id);
|
||||
H5_DLL herr_t H5Fget_page_buffering_stats(hid_t file_id, unsigned accesses[2],
|
||||
unsigned hits[2], unsigned misses[2], unsigned evictions[2], unsigned bypasses[2]);
|
||||
H5_DLL herr_t H5Fget_mdc_image_info(hid_t file_id, haddr_t *image_addr, hsize_t *image_size);
|
||||
H5_DLL herr_t H5Fget_dset_no_attrs_hint(hid_t file_id, hbool_t *minimize);
|
||||
H5_DLL herr_t H5Fset_dset_no_attrs_hint(hid_t file_id, hbool_t minimize);
|
||||
|
||||
#ifdef H5_HAVE_PARALLEL
|
||||
H5_DLL herr_t H5Fset_mpi_atomicity(hid_t file_id, hbool_t flag);
|
||||
|
@ -512,6 +512,25 @@ H5F_sym_leaf_k(const H5F_t *f)
|
||||
FUNC_LEAVE_NOAPI(f->shared->sblock->sym_leaf_k)
|
||||
} /* end H5F_sym_leaf_k() */
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: H5F_get_min_dset_ohdr
|
||||
*
|
||||
* Purpose: Get the setting flag for minimized dataset object headers
|
||||
*
|
||||
* Return: TRUE/FALSE as set in file
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
hbool_t
|
||||
H5F_get_min_dset_ohdr(const H5F_t *f)
|
||||
{
|
||||
FUNC_ENTER_NOAPI_NOINIT_NOERR
|
||||
|
||||
HDassert(f);
|
||||
|
||||
FUNC_LEAVE_NOAPI(f->shared->crt_dset_min_ohdr_flag)
|
||||
} /* end H5F_get_min_dset_ohdr */
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: H5F_Kvalue
|
||||
|
267
src/H5Oint.c
267
src/H5Oint.c
@ -83,7 +83,6 @@ static herr_t H5O__visit_cb(hid_t group, const char *name, const H5L_info_t *lin
|
||||
void *_udata);
|
||||
static const H5O_obj_class_t *H5O__obj_class_real(const H5O_t *oh);
|
||||
|
||||
|
||||
/*********************/
|
||||
/* Package Variables */
|
||||
/*********************/
|
||||
@ -277,99 +276,183 @@ done:
|
||||
* matzke@llnl.gov
|
||||
* Aug 5 1997
|
||||
*
|
||||
* Changes: 2018 August 17
|
||||
* Jacob Smith
|
||||
* Refactor out the operations into two separate steps --
|
||||
* preparation and application -- to facilitate overriding the
|
||||
* library-default size allocated for the object header. This
|
||||
* function is retained as a wrapper, to minimize changes to
|
||||
* unaffected calling functions.
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
herr_t
|
||||
H5O_create(H5F_t *f, size_t size_hint, size_t initial_rc, hid_t ocpl_id,
|
||||
H5O_loc_t *loc/*out*/)
|
||||
H5O_create(H5F_t *f, size_t size_hint, size_t initial_rc, hid_t ocpl_id, H5O_loc_t *loc /*out*/)
|
||||
{
|
||||
H5P_genplist_t *oc_plist; /* Object creation property list */
|
||||
H5O_t *oh = NULL; /* Object header created */
|
||||
haddr_t oh_addr; /* Address of initial object header */
|
||||
size_t oh_size; /* Size of initial object header */
|
||||
uint8_t oh_flags; /* Object header's initial status flags */
|
||||
unsigned insert_flags = H5AC__NO_FLAGS_SET; /* Flags for inserting object header into cache */
|
||||
hbool_t store_msg_crt_idx; /* Whether to always store message creation indices for this file */
|
||||
herr_t ret_value = SUCCEED; /* return value */
|
||||
H5O_t *oh = NULL;
|
||||
herr_t ret_value = SUCCEED;
|
||||
|
||||
FUNC_ENTER_NOAPI(FAIL)
|
||||
|
||||
/* check args */
|
||||
HDassert(f);
|
||||
HDassert(loc);
|
||||
HDassert(TRUE == H5P_isa_class(ocpl_id, H5P_OBJECT_CREATE));
|
||||
|
||||
/* create object header in freelist
|
||||
* header version is set internally
|
||||
*/
|
||||
oh = H5O__create_ohdr(f, ocpl_id);
|
||||
if(NULL == oh)
|
||||
HGOTO_ERROR(H5E_OHDR, H5E_BADVALUE, FAIL, "Can't instantiate object header")
|
||||
|
||||
/* apply object header information to file
|
||||
*/
|
||||
if(H5O__apply_ohdr(f, oh, ocpl_id, size_hint, initial_rc, loc) < 0)
|
||||
HGOTO_ERROR(H5E_OHDR, H5E_BADVALUE, FAIL, "Can't apply object header to file")
|
||||
|
||||
done:
|
||||
if((FAIL == ret_value) && (NULL != oh) && (H5O__free(oh) < 0))
|
||||
HDONE_ERROR(H5E_OHDR, H5E_CANTFREE, FAIL, "can't delete object header")
|
||||
|
||||
FUNC_LEAVE_NOAPI(ret_value)
|
||||
} /* end H5O_create() */
|
||||
|
||||
|
||||
/*-----------------------------------------------------------------------------
|
||||
* Function: H5O__create_ohdr
|
||||
*
|
||||
* Purpose: Create the object header, set version and flags.
|
||||
*
|
||||
* Return: Success: Pointer to the newly-crated header object.
|
||||
* Failure: NULL
|
||||
*
|
||||
* Programmer: Jacob Smith
|
||||
* 2018 August 17
|
||||
*
|
||||
*-----------------------------------------------------------------------------
|
||||
*/
|
||||
H5O_t *
|
||||
H5O__create_ohdr(H5F_t *f, hid_t ocpl_id)
|
||||
{
|
||||
H5P_genplist_t *oc_plist;
|
||||
H5O_t *oh = NULL; /* Object header in Freelist */
|
||||
uint8_t oh_flags; /* Initial status flags */
|
||||
H5O_t *ret_value = NULL;
|
||||
|
||||
FUNC_ENTER_NOAPI(NULL)
|
||||
|
||||
HDassert(f);
|
||||
HDassert(TRUE == H5P_isa_class(ocpl_id, H5P_OBJECT_CREATE));
|
||||
|
||||
/* Check for invalid access request */
|
||||
if(0 == (H5F_INTENT(f) & H5F_ACC_RDWR))
|
||||
HGOTO_ERROR(H5E_OHDR, H5E_BADVALUE, FAIL, "no write intent on file")
|
||||
HGOTO_ERROR(H5E_OHDR, H5E_BADVALUE, NULL, "no write intent on file")
|
||||
|
||||
/* Make certain we allocate at least a reasonable size for the object header */
|
||||
size_hint = H5O_ALIGN_F(f, MAX(H5O_MIN_SIZE, size_hint));
|
||||
oh = H5FL_CALLOC(H5O_t);
|
||||
if(NULL == oh)
|
||||
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed")
|
||||
|
||||
/* Get the property list */
|
||||
if(NULL == (oc_plist = (H5P_genplist_t *)H5I_object(ocpl_id)))
|
||||
HGOTO_ERROR(H5E_PLIST, H5E_BADTYPE, FAIL, "not a property list")
|
||||
oc_plist = (H5P_genplist_t *)H5I_object(ocpl_id);
|
||||
if(NULL == oc_plist)
|
||||
HGOTO_ERROR(H5E_PLIST, H5E_BADTYPE, NULL, "not a property list")
|
||||
|
||||
/* Get any object header status flags set by properties */
|
||||
if(H5P_get(oc_plist, H5O_CRT_OHDR_FLAGS_NAME, &oh_flags) < 0)
|
||||
HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get object header flags")
|
||||
HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't get object header flags")
|
||||
|
||||
/* Allocate the object header and zero out header fields */
|
||||
if(NULL == (oh = H5FL_CALLOC(H5O_t)))
|
||||
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed")
|
||||
if(H5O_set_version(f, oh, oh_flags, H5F_STORE_MSG_CRT_IDX(f)) < 0)
|
||||
HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, NULL, "can't set version of object header")
|
||||
|
||||
/* Initialize file-specific information for object header */
|
||||
store_msg_crt_idx = H5F_STORE_MSG_CRT_IDX(f);
|
||||
oh->flags = oh_flags;
|
||||
|
||||
if(H5O_set_version(f, oh, oh_flags, store_msg_crt_idx) < 0)
|
||||
HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set version of objecdt header")
|
||||
ret_value = oh;
|
||||
|
||||
done:
|
||||
if((NULL == ret_value) && (NULL != oh) && (H5O__free(oh) < 0))
|
||||
HDONE_ERROR(H5E_OHDR, H5E_CANTFREE, NULL, "can't delete object header")
|
||||
|
||||
FUNC_LEAVE_NOAPI(ret_value)
|
||||
} /* H5O__create_ohdr() */
|
||||
|
||||
|
||||
/*-----------------------------------------------------------------------------
|
||||
* Function: H5O__apply_ohdr
|
||||
*
|
||||
* Purpose: Initialize and set the object header in the file.
|
||||
* Record some information at `loc_out`.
|
||||
*
|
||||
* Return: Success: SUCCEED (0) (non-negative value)
|
||||
* Failure: FAIL (-1) (negative value)
|
||||
*
|
||||
* Programmer: Jacob Smith
|
||||
* 2018 August 17
|
||||
*
|
||||
*-----------------------------------------------------------------------------
|
||||
*/
|
||||
herr_t
|
||||
H5O__apply_ohdr(H5F_t *f, H5O_t *oh, hid_t ocpl_id, size_t size_hint, size_t initial_rc, H5O_loc_t *loc_out)
|
||||
{
|
||||
haddr_t oh_addr;
|
||||
size_t oh_size;
|
||||
H5P_genplist_t *oc_plist = NULL;
|
||||
unsigned insert_flags = H5AC__NO_FLAGS_SET;
|
||||
herr_t ret_value = SUCCEED;
|
||||
|
||||
FUNC_ENTER_NOAPI(FAIL)
|
||||
|
||||
HDassert(f);
|
||||
HDassert(loc_out);
|
||||
HDassert(oh);
|
||||
HDassert(TRUE == H5P_isa_class(ocpl_id, H5P_OBJECT_CREATE));
|
||||
|
||||
/* Allocate at least a reasonable size for the object header */
|
||||
size_hint = H5O_ALIGN_F(f, MAX(H5O_MIN_SIZE, size_hint));
|
||||
|
||||
oh->sizeof_size = H5F_SIZEOF_SIZE(f);
|
||||
oh->sizeof_addr = H5F_SIZEOF_ADDR(f);
|
||||
oh->swmr_write = !!(H5F_INTENT(f) & H5F_ACC_SWMR_WRITE);
|
||||
oh->swmr_write = !!(H5F_INTENT(f) & H5F_ACC_SWMR_WRITE); /* funky cast */
|
||||
|
||||
#ifdef H5O_ENABLE_BAD_MESG_COUNT
|
||||
/* Check whether the "bad message count" property is set */
|
||||
if(H5P_exist_plist(oc_plist, H5O_BAD_MESG_COUNT_NAME) > 0) {
|
||||
/* Retrieve bad message count flag */
|
||||
if(0 < H5P_exist_plist(oc_plist, H5O_BAD_MESG_COUNT_NAME))
|
||||
/* Get bad message count flag -- from property list */
|
||||
if(H5P_get(oc_plist, H5O_BAD_MESG_COUNT_NAME, &oh->store_bad_mesg_count) < 0)
|
||||
HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't get bad message count flag")
|
||||
}
|
||||
#endif /* H5O_ENABLE_BAD_MESG_COUNT */
|
||||
|
||||
/* Create object header proxy if doing SWMR writes */
|
||||
if(oh->swmr_write) {
|
||||
/* Create virtual entry, for use as proxy */
|
||||
if(NULL == (oh->proxy = H5AC_proxy_entry_create()))
|
||||
oh->proxy = H5AC_proxy_entry_create();
|
||||
if(NULL == oh->proxy)
|
||||
HGOTO_ERROR(H5E_OHDR, H5E_CANTCREATE, FAIL, "can't create object header proxy")
|
||||
}
|
||||
else
|
||||
} else {
|
||||
oh->proxy = NULL;
|
||||
}
|
||||
|
||||
/* Set initial status flags */
|
||||
oh->flags = oh_flags;
|
||||
oc_plist = (H5P_genplist_t *)H5I_object(ocpl_id);
|
||||
if(NULL == oc_plist)
|
||||
HGOTO_ERROR(H5E_PLIST, H5E_BADTYPE, FAIL, "not a property list")
|
||||
|
||||
/* Initialize version-specific fields */
|
||||
if(oh->version > H5O_VERSION_1) {
|
||||
/* Initialize all time fields with current time, if we are storing them */
|
||||
/* Initialize all time fields */
|
||||
if(oh->flags & H5O_HDR_STORE_TIMES)
|
||||
oh->atime = oh->mtime = oh->ctime = oh->btime = H5_now();
|
||||
else
|
||||
oh->atime = oh->mtime = oh->ctime = oh->btime = 0;
|
||||
|
||||
/* Make certain attribute creation order tracking is enabled if
|
||||
* attributes can be shared in this file.
|
||||
*/
|
||||
if(store_msg_crt_idx)
|
||||
if(H5F_STORE_MSG_CRT_IDX(f))
|
||||
/* flag to record message creation indices */
|
||||
oh->flags |= H5O_HDR_ATTR_CRT_ORDER_TRACKED;
|
||||
|
||||
/* Retrieve attribute storage phase change values from property list */
|
||||
/* Get attribute storage phase change values -- from property list */
|
||||
if(H5P_get(oc_plist, H5O_CRT_ATTR_MAX_COMPACT_NAME, &oh->max_compact) < 0)
|
||||
HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get max. # of compact attributes")
|
||||
if(H5P_get(oc_plist, H5O_CRT_ATTR_MIN_DENSE_NAME, &oh->min_dense) < 0)
|
||||
HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get min. # of dense attributes")
|
||||
|
||||
/* Check for non-default attribute storage phase change values */
|
||||
if(oh->max_compact != H5O_CRT_ATTR_MAX_COMPACT_DEF || oh->min_dense != H5O_CRT_ATTR_MIN_DENSE_DEF)
|
||||
if(H5O_CRT_ATTR_MAX_COMPACT_DEF != oh->max_compact || H5O_CRT_ATTR_MIN_DENSE_DEF != oh->min_dense )
|
||||
oh->flags |= H5O_HDR_ATTR_STORE_PHASE_CHANGE;
|
||||
|
||||
/* Determine correct value for chunk #0 size bits */
|
||||
@ -383,23 +466,25 @@ H5O_create(H5F_t *f, size_t size_hint, size_t initial_rc, hid_t ocpl_id,
|
||||
oh->flags |= H5O_HDR_CHUNK0_4;
|
||||
else if(size_hint > 255)
|
||||
oh->flags |= H5O_HDR_CHUNK0_2;
|
||||
} /* end if */
|
||||
else {
|
||||
} else {
|
||||
/* Reset unused time fields */
|
||||
oh->atime = oh->mtime = oh->ctime = oh->btime = 0;
|
||||
} /* end else */
|
||||
} /* end if/else header version >1 */
|
||||
|
||||
/* Compute total size of initial object header */
|
||||
/* (i.e. object header prefix and first chunk) */
|
||||
oh_size = (size_t)H5O_SIZEOF_HDR(oh) + size_hint;
|
||||
|
||||
/* Allocate disk space for header and first chunk */
|
||||
if(HADDR_UNDEF == (oh_addr = H5MF_alloc(f, H5FD_MEM_OHDR, (hsize_t)oh_size)))
|
||||
oh_addr = H5MF_alloc(f, H5FD_MEM_OHDR, (hsize_t)oh_size);
|
||||
if(HADDR_UNDEF == oh_addr)
|
||||
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "file allocation failed for object header")
|
||||
|
||||
/* Create the chunk list */
|
||||
oh->nchunks = oh->alloc_nchunks = 1;
|
||||
if(NULL == (oh->chunk = H5FL_SEQ_MALLOC(H5O_chunk_t, (size_t)oh->alloc_nchunks)))
|
||||
oh->nchunks = 1;
|
||||
oh->alloc_nchunks = 1;
|
||||
oh->chunk = H5FL_SEQ_MALLOC(H5O_chunk_t, (size_t)oh->alloc_nchunks);
|
||||
if(NULL == oh->chunk)
|
||||
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed")
|
||||
|
||||
/* Initialize the first chunk */
|
||||
@ -409,25 +494,27 @@ H5O_create(H5F_t *f, size_t size_hint, size_t initial_rc, hid_t ocpl_id,
|
||||
|
||||
/* Allocate enough space for the first chunk */
|
||||
/* (including space for serializing the object header prefix */
|
||||
if(NULL == (oh->chunk[0].image = H5FL_BLK_CALLOC(chunk_image, oh_size)))
|
||||
oh->chunk[0].image = H5FL_BLK_CALLOC(chunk_image, oh_size);
|
||||
if(NULL == oh->chunk[0].image)
|
||||
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed")
|
||||
oh->chunk[0].chunk_proxy = NULL;
|
||||
|
||||
/* Put magic # for object header in first chunk */
|
||||
if(oh->version > H5O_VERSION_1)
|
||||
if(H5O_VERSION_1 < oh->version)
|
||||
HDmemcpy(oh->chunk[0].image, H5O_HDR_MAGIC, (size_t)H5_SIZEOF_MAGIC);
|
||||
|
||||
/* Create the message list */
|
||||
oh->nmesgs = 1;
|
||||
oh->alloc_nmesgs = H5O_NMESGS;
|
||||
if(NULL == (oh->mesg = H5FL_SEQ_CALLOC(H5O_mesg_t, oh->alloc_nmesgs)))
|
||||
oh->mesg = H5FL_SEQ_CALLOC(H5O_mesg_t, oh->alloc_nmesgs);
|
||||
if(NULL == oh->mesg)
|
||||
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed")
|
||||
|
||||
/* Initialize the initial "null" message, covering the entire first chunk */
|
||||
/* Initialize the initial "null" message; covers the entire first chunk */
|
||||
oh->mesg[0].type = H5O_MSG_NULL;
|
||||
oh->mesg[0].dirty = TRUE;
|
||||
oh->mesg[0].native = NULL;
|
||||
oh->mesg[0].raw = oh->chunk[0].image + (H5O_SIZEOF_HDR(oh) - H5O_SIZEOF_CHKSUM_OH(oh)) + H5O_SIZEOF_MSGHDR_OH(oh);
|
||||
oh->mesg[0].raw = oh->chunk[0].image + H5O_SIZEOF_HDR(oh) - H5O_SIZEOF_CHKSUM_OH(oh) + H5O_SIZEOF_MSGHDR_OH(oh);
|
||||
oh->mesg[0].raw_size = size_hint - (size_t)H5O_SIZEOF_MSGHDR_OH(oh);
|
||||
oh->mesg[0].chunkno = 0;
|
||||
|
||||
@ -452,20 +539,15 @@ H5O_create(H5F_t *f, size_t size_hint, size_t initial_rc, hid_t ocpl_id,
|
||||
H5_END_TAG
|
||||
|
||||
/* Set up object location */
|
||||
loc->file = f;
|
||||
loc->addr = oh_addr;
|
||||
loc_out->file = f;
|
||||
loc_out->addr = oh_addr;
|
||||
|
||||
/* Open it */
|
||||
if(H5O_open(loc) < 0)
|
||||
if(H5O_open(loc_out) < 0)
|
||||
HGOTO_ERROR(H5E_OHDR, H5E_CANTOPENOBJ, FAIL, "unable to open object header")
|
||||
|
||||
done:
|
||||
if(ret_value < 0 && oh)
|
||||
if(H5O__free(oh) < 0)
|
||||
HDONE_ERROR(H5E_OHDR, H5E_CANTFREE, FAIL, "unable to destroy object header data")
|
||||
|
||||
FUNC_LEAVE_NOAPI(ret_value)
|
||||
} /* end H5O_create() */
|
||||
FUNC_LEAVE_NOAPI(ret_value);
|
||||
} /* H5O__apply_ohdr() */
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
@ -2418,6 +2500,63 @@ H5O_get_oh_addr(const H5O_t *oh)
|
||||
FUNC_LEAVE_NOAPI(oh->chunk[0].addr)
|
||||
} /* end H5O_get_oh_addr() */
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: H5O_get_oh_flags
|
||||
*
|
||||
* Programmer: Jacob Smith
|
||||
* 2018 August 17
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
uint8_t
|
||||
H5O_get_oh_flags(const H5O_t *oh)
|
||||
{
|
||||
FUNC_ENTER_NOAPI_NOINIT_NOERR
|
||||
HDassert(oh);
|
||||
FUNC_LEAVE_NOAPI(oh->flags); /* flags can be 0 */
|
||||
} /* H5O_get_oh_flags() */
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: H5O_get_oh_mtime
|
||||
*
|
||||
* Purpose: Retrieve an object's modification time. Assumes that the
|
||||
* caller has verified that accessing this variable is appropriate
|
||||
* to the header in question.
|
||||
*
|
||||
* Programmer: Jacob Smith
|
||||
* 2018 August 17
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
time_t
|
||||
H5O_get_oh_mtime(const H5O_t *oh)
|
||||
{
|
||||
FUNC_ENTER_NOAPI_NOINIT_NOERR
|
||||
HDassert(oh);
|
||||
HDassert(oh->mtime);
|
||||
FUNC_LEAVE_NOAPI(oh->mtime);
|
||||
} /* H5O_get_oh_mtime() */
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: H5O_get_oh_version
|
||||
*
|
||||
* Programmer: Jacob Smith
|
||||
* 2018 August 17
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
uint8_t
|
||||
H5O_get_oh_version(const H5O_t *oh)
|
||||
{
|
||||
FUNC_ENTER_NOAPI_NOINIT_NOERR
|
||||
HDassert(oh);
|
||||
HDassert(oh->version);
|
||||
FUNC_LEAVE_NOAPI(oh->version);
|
||||
} /* H5O_get_oh_version() */
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: H5O_get_rc_and_type
|
||||
|
@ -121,8 +121,14 @@ typedef struct H5O_mesg_t H5O_mesg_t;
|
||||
/* If the module using this macro is allowed access to the private variables, access them directly */
|
||||
#ifdef H5O_MODULE
|
||||
#define H5O_OH_GET_ADDR(O) ((O)->chunk[0].addr)
|
||||
#define H5O_OH_GET_VERSION(O) ((O)->version)
|
||||
#define H5O_OH_GET_FLAGS(O) ((O)->flags)
|
||||
#define H5O_OH_GET_MTIME(O) ((O)->mtime)
|
||||
#else /* H5O_MODULE */
|
||||
#define H5O_OH_GET_ADDR(O) (H5O_get_oh_addr(O))
|
||||
#define H5O_OH_GET_VERSION(O) (H5O_get_oh_version(O))
|
||||
#define H5O_OH_GET_FLAGS(O) (H5O_get_oh_flags(O))
|
||||
#define H5O_OH_GET_MTIME(O) (H5O_get_oh_mtime(O))
|
||||
#endif /* H5O_MODULE */
|
||||
|
||||
/* Set the fields in a shared message structure */
|
||||
@ -865,6 +871,9 @@ struct H5P_genplist_t;
|
||||
H5_DLL herr_t H5O_init(void);
|
||||
H5_DLL herr_t H5O_create(H5F_t *f, size_t size_hint, size_t initial_rc,
|
||||
hid_t ocpl_id, H5O_loc_t *loc/*out*/);
|
||||
H5_DLL H5O_t *H5O__create_ohdr(H5F_t *f, hid_t ocpl_id);
|
||||
H5_DLL herr_t H5O__apply_ohdr(H5F_t *f, H5O_t *oh, hid_t ocpl_id,
|
||||
size_t size_hint, size_t initial_rc, H5O_loc_t *loc_out);
|
||||
H5_DLL herr_t H5O_open(H5O_loc_t *loc);
|
||||
H5_DLL void *H5O_open_by_idx(const H5G_loc_t *loc, const char *name,
|
||||
H5_index_t idx_type, H5_iter_order_t order, hsize_t n, H5I_type_t *opened_type/*out*/);
|
||||
@ -891,6 +900,9 @@ H5_DLL void *H5O_open_name(const H5G_loc_t *loc, const char *name, H5I_type_t *o
|
||||
H5_DLL herr_t H5O_get_nlinks(const H5O_loc_t *loc, hsize_t *nlinks);
|
||||
H5_DLL void *H5O_obj_create(H5F_t *f, H5O_type_t obj_type, void *crt_info, H5G_loc_t *obj_loc);
|
||||
H5_DLL haddr_t H5O_get_oh_addr(const H5O_t *oh);
|
||||
H5_DLL uint8_t H5O_get_oh_flags(const H5O_t *oh);
|
||||
H5_DLL time_t H5O_get_oh_mtime(const H5O_t *oh);
|
||||
H5_DLL uint8_t H5O_get_oh_version(const H5O_t *oh);
|
||||
H5_DLL herr_t H5O_get_rc_and_type(const H5O_loc_t *oloc, unsigned *rc, H5O_type_t *otype);
|
||||
H5_DLL H5AC_proxy_entry_t *H5O_get_proxy(const H5O_t *oh);
|
||||
|
||||
|
104
src/H5Pdcpl.c
104
src/H5Pdcpl.c
@ -117,6 +117,11 @@
|
||||
#define H5D_CRT_EXT_FILE_LIST_COPY H5P__dcrt_ext_file_list_copy
|
||||
#define H5D_CRT_EXT_FILE_LIST_CMP H5P__dcrt_ext_file_list_cmp
|
||||
#define H5D_CRT_EXT_FILE_LIST_CLOSE H5P__dcrt_ext_file_list_close
|
||||
/* Definitions for dataset object header minimization */
|
||||
#define H5D_CRT_MIN_DSET_HDR_SIZE_SIZE sizeof(hbool_t)
|
||||
#define H5D_CRT_MIN_DSET_HDR_SIZE_DEF FALSE
|
||||
#define H5D_CRT_MIN_DSET_HDR_SIZE_ENC H5P__encode_hbool_t
|
||||
#define H5D_CRT_MIN_DSET_HDR_SIZE_DEC H5P__decode_hbool_t
|
||||
|
||||
|
||||
/******************/
|
||||
@ -209,6 +214,7 @@ static const H5O_layout_t H5D_def_layout_g = H5D_CRT_LAYOUT_DEF; /* Defau
|
||||
static const H5O_fill_t H5D_def_fill_g = H5D_CRT_FILL_VALUE_DEF; /* Default fill value */
|
||||
static const unsigned H5D_def_alloc_time_state_g = H5D_CRT_ALLOC_TIME_STATE_DEF; /* Default allocation time state */
|
||||
static const H5O_efl_t H5D_def_efl_g = H5D_CRT_EXT_FILE_LIST_DEF; /* Default external file list */
|
||||
static const unsigned H5O_ohdr_min_g = H5D_CRT_MIN_DSET_HDR_SIZE_DEF; /* Default object header minimization */
|
||||
|
||||
/* Defaults for each type of layout */
|
||||
#ifdef H5_HAVE_C99_DESIGNATED_INITIALIZER
|
||||
@ -271,6 +277,12 @@ H5P__dcrt_reg_prop(H5P_genclass_t *pclass)
|
||||
H5D_CRT_EXT_FILE_LIST_DEL, H5D_CRT_EXT_FILE_LIST_COPY, H5D_CRT_EXT_FILE_LIST_CMP, H5D_CRT_EXT_FILE_LIST_CLOSE) < 0)
|
||||
HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class")
|
||||
|
||||
/* Register the object header minimization property */
|
||||
if(H5P__register_real(pclass, H5D_CRT_MIN_DSET_HDR_SIZE_NAME, H5D_CRT_MIN_DSET_HDR_SIZE_SIZE, &H5O_ohdr_min_g,
|
||||
NULL, NULL, NULL, H5D_CRT_MIN_DSET_HDR_SIZE_ENC, H5D_CRT_MIN_DSET_HDR_SIZE_DEC,
|
||||
NULL, NULL, NULL, NULL) < 0)
|
||||
HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class")
|
||||
|
||||
/* Register the type ID property*/
|
||||
if(H5P__register_real(pclass, H5VL_PROP_DSET_TYPE_ID, sizeof(hid_t), &type_id,
|
||||
NULL, NULL, NULL, NULL, NULL, NULL, NULL, H5P_ignore_cmp, NULL) < 0)
|
||||
@ -3749,3 +3761,95 @@ done:
|
||||
FUNC_LEAVE_API(ret_value)
|
||||
} /* end H5Pget_fill_time() */
|
||||
|
||||
|
||||
/*-----------------------------------------------------------------------------
|
||||
* Function: H5Pget_dset_no_attrs_hint
|
||||
*
|
||||
* Purpose:
|
||||
*
|
||||
* Access the flag for whether or not datasets created by the given dcpl
|
||||
* will be created with a "minimized" object header.
|
||||
*
|
||||
* Return:
|
||||
*
|
||||
* Failure: Negative value (FAIL)
|
||||
* Success: Non-negative value (SUCCEED)
|
||||
*
|
||||
* Programmer: Jacob Smith
|
||||
* 2018 August 14
|
||||
*
|
||||
* Modifications: None.
|
||||
*
|
||||
*-----------------------------------------------------------------------------
|
||||
*/
|
||||
herr_t
|
||||
H5Pget_dset_no_attrs_hint(hid_t dcpl_id, hbool_t *minimize)
|
||||
{
|
||||
hbool_t setting = FALSE;
|
||||
H5P_genplist_t *plist = NULL;
|
||||
herr_t ret_value = SUCCEED;
|
||||
|
||||
FUNC_ENTER_API(FAIL)
|
||||
H5TRACE2("e", "i*b", dcpl_id, minimize);
|
||||
|
||||
if(NULL == minimize)
|
||||
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "receiving pointer cannot be NULL")
|
||||
|
||||
plist = H5P_object_verify(dcpl_id, H5P_DATASET_CREATE);
|
||||
if(NULL == plist)
|
||||
HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
|
||||
|
||||
if(H5P_peek(plist, H5D_CRT_MIN_DSET_HDR_SIZE_NAME, &setting) < 0)
|
||||
HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get dset oh minimize flag value")
|
||||
|
||||
*minimize = setting;
|
||||
|
||||
done:
|
||||
FUNC_LEAVE_API(ret_value)
|
||||
} /* H5Pget_dset_no_attrs_hint() */
|
||||
|
||||
|
||||
/*-----------------------------------------------------------------------------
|
||||
* Function: H5Pset_dset_no_attrs_hint
|
||||
*
|
||||
* Purpose:
|
||||
*
|
||||
* Set the dcpl to minimize (or explicitly to not minimized) dataset object
|
||||
* headers upon creation.
|
||||
*
|
||||
* Return:
|
||||
*
|
||||
* Failure: Negative value (FAIL)
|
||||
* Success: Non-negative value (SUCCEED)
|
||||
*
|
||||
* Programmer: Jacob Smith
|
||||
* 2018 August 14
|
||||
*
|
||||
* Modifications: None.
|
||||
*
|
||||
*-----------------------------------------------------------------------------
|
||||
*/
|
||||
herr_t
|
||||
H5Pset_dset_no_attrs_hint(hid_t dcpl_id, hbool_t minimize)
|
||||
{
|
||||
H5P_genplist_t *plist = NULL;
|
||||
hbool_t prev_set = FALSE;
|
||||
herr_t ret_value = SUCCEED;
|
||||
|
||||
FUNC_ENTER_API(FAIL)
|
||||
H5TRACE2("e", "ib", dcpl_id, minimize);
|
||||
|
||||
plist = H5P_object_verify(dcpl_id, H5P_DATASET_CREATE);
|
||||
if(NULL == plist)
|
||||
HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
|
||||
|
||||
if(H5P_peek(plist, H5D_CRT_MIN_DSET_HDR_SIZE_NAME, &prev_set) < 0)
|
||||
HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get extant dset oh minimize flag value")
|
||||
|
||||
if(H5P_poke(plist, H5D_CRT_MIN_DSET_HDR_SIZE_NAME, &minimize) < 0)
|
||||
HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't get dset oh minimize flag value")
|
||||
|
||||
done:
|
||||
FUNC_LEAVE_API(ret_value)
|
||||
} /* H5Pset_dset_no_attrs_hint() */
|
||||
|
||||
|
@ -412,6 +412,8 @@ H5_DLL herr_t H5Pget_alloc_time(hid_t plist_id, H5D_alloc_time_t
|
||||
H5_DLL herr_t H5Pset_fill_time(hid_t plist_id, H5D_fill_time_t fill_time);
|
||||
H5_DLL herr_t H5Pget_fill_time(hid_t plist_id, H5D_fill_time_t
|
||||
*fill_time/*out*/);
|
||||
H5_DLL herr_t H5Pget_dset_no_attrs_hint(hid_t dcpl_id, hbool_t *minimize);
|
||||
H5_DLL herr_t H5Pset_dset_no_attrs_hint(hid_t dcpl_id, hbool_t minimize);
|
||||
|
||||
/* Dataset access property list (DAPL) routines */
|
||||
H5_DLL herr_t H5Pset_chunk_cache(hid_t dapl_id, size_t rdcc_nslots,
|
||||
|
11
src/H5VL.c
11
src/H5VL.c
@ -11,7 +11,7 @@
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
/*
|
||||
* Purpose: The Virtual Object Layer as described in documentation.
|
||||
* Purpose: The Virtual Object Layer as described in documentation.
|
||||
* The pupose is to provide an abstraction on how to access the
|
||||
* underlying HDF5 container, whether in a local file with
|
||||
* a specific file format, or remotely on other machines, etc...
|
||||
@ -486,14 +486,11 @@ done:
|
||||
/*---------------------------------------------------------------------------
|
||||
* Function: H5VLcmp_connector_cls
|
||||
*
|
||||
* Purpose: Compares two connector classes
|
||||
* Purpose: Compares two connector classes (based on their value field)
|
||||
*
|
||||
* Return: Success: Non-negative, with *cmp set to positive if
|
||||
* connector_id1 is greater than connector_id2, negative if connector_id2
|
||||
* is greater than connector_id1 and zero if connector_id1 and connector_id2
|
||||
* are equal.
|
||||
* Return: Success: Non-negative, *cmp set to a value like strcmp
|
||||
*
|
||||
* Failure: Negative
|
||||
* Failure: Negative, *cmp unset
|
||||
*
|
||||
*---------------------------------------------------------------------------
|
||||
*/
|
||||
|
@ -881,7 +881,7 @@ done:
|
||||
*
|
||||
* Return: Positive if VALUE1 is greater than VALUE2, negative if
|
||||
* VALUE2 is greater than VALUE1 and zero if VALUE1 and
|
||||
* VALUE2 are equal.
|
||||
* VALUE2 are equal (like strcmp).
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
|
@ -66,6 +66,8 @@ typedef int H5VL_native_file_optional_t;
|
||||
#define H5VL_NATIVE_FILE_GET_EOA 22 /* H5Fget_eoa */
|
||||
#define H5VL_NATIVE_FILE_INCR_FILESIZE 23 /* H5Fincrement_filesize */
|
||||
#define H5VL_NATIVE_FILE_SET_LIBVER_BOUNDS 24 /* H5Fset_latest_format/libver_bounds */
|
||||
#define H5VL_NATIVE_FILE_GET_MIN_DSET_OHDR_FLAG 25 /* H5Fget_dset_no_attrs_hint */
|
||||
#define H5VL_NATIVE_FILE_SET_MIN_DSET_OHDR_FLAG 26 /* H5Fset_dset_no_attrs_hint */
|
||||
|
||||
/* Typedef and values for native VOL connector group optional VOL operations */
|
||||
typedef int H5VL_native_group_optional_t;
|
||||
|
@ -377,6 +377,8 @@ H5VL__native_file_specific(void *obj, H5VL_file_specific_t specific_type,
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
|
||||
default:
|
||||
HGOTO_ERROR(H5E_VOL, H5E_UNSUPPORTED, FAIL, "invalid specific operation")
|
||||
} /* end switch */
|
||||
@ -750,6 +752,23 @@ H5VL__native_file_optional(void *obj, hid_t H5_ATTR_UNUSED dxpl_id, void H5_ATTR
|
||||
break;
|
||||
}
|
||||
|
||||
/* H5Fget_dset_no_attrs_hint */
|
||||
case H5VL_NATIVE_FILE_GET_MIN_DSET_OHDR_FLAG:
|
||||
{
|
||||
hbool_t *minimize = va_arg(arguments, hbool_t *);
|
||||
*minimize = H5F_GET_MIN_DSET_OHDR(f);
|
||||
break;
|
||||
}
|
||||
|
||||
/* H5Fset_dset_no_attrs_hint */
|
||||
case H5VL_NATIVE_FILE_SET_MIN_DSET_OHDR_FLAG:
|
||||
{
|
||||
int minimize = va_arg(arguments, int);
|
||||
if(H5F_set_min_dset_ohdr(f, (hbool_t)minimize) < 0)
|
||||
HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "cannot set file's dataset object header minimization flag")
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
HGOTO_ERROR(H5E_VOL, H5E_UNSUPPORTED, FAIL, "invalid optional operation")
|
||||
} /* end switch */
|
||||
|
@ -115,7 +115,7 @@ typedef enum H5VL_file_get_t {
|
||||
H5VL_FILE_GET_INTENT, /* file intent */
|
||||
H5VL_FILE_GET_NAME, /* file name */
|
||||
H5VL_FILE_GET_OBJ_COUNT, /* object count in file */
|
||||
H5VL_FILE_GET_OBJ_IDS /* object ids in file */
|
||||
H5VL_FILE_GET_OBJ_IDS /* object ids in file */
|
||||
} H5VL_file_get_t;
|
||||
|
||||
/* types for file SPECIFIC callback */
|
||||
|
@ -133,7 +133,7 @@ if (BUILD_SHARED_LIBS)
|
||||
# Define VOL Plugin Test Sources
|
||||
#-----------------------------------------------------------------------------
|
||||
set (VOL_PLUGIN_LIBS
|
||||
echo_vol
|
||||
null_vol_connector
|
||||
)
|
||||
|
||||
foreach (vol_lib ${VOL_PLUGIN_LIBS})
|
||||
|
@ -359,6 +359,9 @@ set (test_CLEANFILES
|
||||
lheap.h5
|
||||
fheap.h5
|
||||
ohdr.h5
|
||||
ohdr_min_a.h5
|
||||
ohdr_min_b.h5
|
||||
min_dset_ohdr_testfile.h5
|
||||
stab.h5
|
||||
extern_*.h5
|
||||
extern_*.raw
|
||||
|
@ -41,8 +41,8 @@ SCRIPT_DEPEND = error_test$(EXEEXT) err_compat$(EXEEXT) links_env$(EXEEXT) filen
|
||||
swmr_sparse_reader$(EXEEXT) swmr_sparse_writer$(EXEEXT) swmr_start_write$(EXEEXT) \
|
||||
vds_swmr_gen$(EXEEXT) vds_swmr_reader$(EXEEXT) vds_swmr_writer$(EXEEXT)
|
||||
if HAVE_SHARED_CONDITIONAL
|
||||
TEST_SCRIPT += test_filter_plugin.sh
|
||||
SCRIPT_DEPEND += filter_plugin$(EXEEXT)
|
||||
TEST_SCRIPT += test_filter_plugin.sh test_vol_plugin.sh
|
||||
SCRIPT_DEPEND += filter_plugin$(EXEEXT) vol_plugin$(EXEEXT)
|
||||
endif
|
||||
|
||||
check_SCRIPTS = $(TEST_SCRIPT)
|
||||
@ -52,8 +52,8 @@ check_SCRIPTS = $(TEST_SCRIPT)
|
||||
# As an exception, long-running tests should occur earlier in the list.
|
||||
# This gives them more time to run when tests are executing in parallel.
|
||||
TEST_PROG= testhdf5 \
|
||||
cache cache_api cache_image cache_tagging lheap ohdr stab gheap \
|
||||
evict_on_close farray earray btree2 fheap \
|
||||
cache cache_api cache_image cache_tagging lheap ohdr \
|
||||
stab gheap evict_on_close farray earray btree2 fheap \
|
||||
pool accum hyperslab istore bittests dt_arith page_buffer \
|
||||
dtypes dsets cmpd_dset filter_fail extend direct_chunk external efc \
|
||||
objcopy links unlink twriteorder big mtime fillval mount \
|
||||
@ -83,7 +83,7 @@ check_PROGRAMS=$(TEST_PROG) error_test err_compat tcheck_version \
|
||||
swmr_remove_writer swmr_addrem_writer swmr_sparse_reader swmr_sparse_writer \
|
||||
swmr_check_compat_vfd vds_swmr_gen vds_swmr_reader vds_swmr_writer
|
||||
if HAVE_SHARED_CONDITIONAL
|
||||
check_PROGRAMS+= filter_plugin
|
||||
check_PROGRAMS+= filter_plugin vol_plugin
|
||||
endif
|
||||
|
||||
# These programs generate test files for the tests. They don't need to be
|
||||
@ -106,9 +106,7 @@ if HAVE_SHARED_CONDITIONAL
|
||||
# The libh5test library provides common support code for the tests.
|
||||
# The filter_plugin* libraries are for use in filter_plugin.c.
|
||||
# Build them as shared libraries if that option was enabled in configure.
|
||||
#
|
||||
# echo_vol is used for testing VOL plugin functionality.
|
||||
noinst_LTLIBRARIES=libh5test.la libfilter_plugin1_dsets.la libfilter_plugin2_dsets.la libfilter_plugin3_dsets.la libfilter_plugin4_groups.la echo_vol.la
|
||||
noinst_LTLIBRARIES=libh5test.la libfilter_plugin1_dsets.la libfilter_plugin2_dsets.la libfilter_plugin3_dsets.la libfilter_plugin4_groups.la libnull_vol_connector.la
|
||||
libfilter_plugin1_dsets_la_SOURCES=filter_plugin1_dsets.c
|
||||
libfilter_plugin2_dsets_la_SOURCES=filter_plugin2_dsets.c
|
||||
libfilter_plugin3_dsets_la_SOURCES=filter_plugin3_dsets.c
|
||||
@ -121,8 +119,10 @@ if HAVE_SHARED_CONDITIONAL
|
||||
libfilter_plugin4_groups_la_LIBADD=$(LIBHDF5)
|
||||
|
||||
# VOL plugin test libraries
|
||||
echo_vol_la_SOURCES=echo_vol.c
|
||||
echo_vol_la_LDFLAGS=$(AM_LDFLAGS) -avoid-version -module -shared -export-dynamic -rpath /nowhere
|
||||
#
|
||||
# null_vol_connector is used for testing basic VOL plugin functionality.
|
||||
libnull_vol_connector_la_SOURCES=null_vol_connector.c
|
||||
libnull_vol_connector_la_LDFLAGS=$(AM_LDFLAGS) -avoid-version -module -shared -export-dynamic -rpath /nowhere
|
||||
|
||||
else
|
||||
# The libh5test library provides common support code for the tests.
|
||||
@ -177,6 +177,7 @@ CHECK_CLEANFILES+=accum.h5 cmpd_dset.h5 compact_dataset.h5 dataset.h5 dset_offse
|
||||
extend.h5 istore.h5 extlinks*.h5 frspace.h5 links*.h5 \
|
||||
sys_file1 tfile[1-7].h5 th5s[1-4].h5 lheap.h5 fheap.h5 ohdr.h5 \
|
||||
stab.h5 extern_[1-5].h5 extern_[1-4][rw].raw gheap[0-4].h5 \
|
||||
ohdr_min_a.h5 ohdr_min_b.h5 min_dset_ohdr_testfile.h5\
|
||||
dt_arith[1-2] links.h5 links[0-6]*.h5 extlinks[0-15].h5 tmp \
|
||||
big.data big[0-9][0-9][0-9][0-9][0-9].h5 \
|
||||
stdio.h5 sec2.h5 dtypes[0-9].h5 dtypes1[0].h5 dt_arith[1-2].h5 tattr.h5 \
|
||||
@ -220,6 +221,7 @@ use_disable_mdc_flushes_SOURCES=use_disable_mdc_flushes.c
|
||||
|
||||
# Temporary files.
|
||||
DISTCLEANFILES=testerror.sh testlibinfo.sh testcheck_version.sh testlinks_env.sh test_filter_plugin.sh \
|
||||
testswmr.sh testvdsswmr.sh test_usecases.sh testflushrefresh.sh test_filenotclosed.sh
|
||||
testswmr.sh testvdsswmr.sh test_usecases.sh testflushrefresh.sh test_filenotclosed.sh \
|
||||
test_vol_plugin.sh
|
||||
|
||||
include $(top_srcdir)/config/conclude.am
|
||||
|
580
test/dsets.c
580
test/dsets.c
File diff suppressed because it is too large
Load Diff
@ -146,6 +146,9 @@ main(void)
|
||||
if((H5Pset_fill_value(dcpl, H5T_NATIVE_DOUBLE, &fill)) < 0)
|
||||
FAIL_STACK_ERROR
|
||||
|
||||
if((H5Pset_dset_no_attrs_hint(dcpl, FALSE)) < 0)
|
||||
FAIL_STACK_ERROR
|
||||
|
||||
max_size[0] = 100;
|
||||
if((H5Pset_external(dcpl, "ext1.data", (off_t)0,
|
||||
(hsize_t)(max_size[0] * sizeof(int)/4))) < 0)
|
||||
|
@ -125,6 +125,9 @@ main(void)
|
||||
if((ret = H5Pset_fill_value(dcpl1, H5T_STD_I32BE, &fill)) < 0)
|
||||
assert(ret > 0);
|
||||
|
||||
if((ret = H5Pset_dset_no_attrs_hint(dcpl1, FALSE)) < 0)
|
||||
assert(ret > 0);
|
||||
|
||||
max_size[0] = 100;
|
||||
if((ret = H5Pset_external(dcpl1, "ext1.data", (off_t)0,
|
||||
(hsize_t)(max_size[0] * sizeof(int)/4))) < 0)
|
||||
|
@ -158,47 +158,8 @@ h5_clean_files(const char *base_name[], hid_t fapl)
|
||||
int i;
|
||||
|
||||
for(i = 0; base_name[i]; i++) {
|
||||
char filename[1024];
|
||||
char temp[2048];
|
||||
hid_t driver;
|
||||
|
||||
if(NULL == h5_fixname(base_name[i], fapl, filename, sizeof(filename)))
|
||||
continue;
|
||||
|
||||
driver = H5Pget_driver(fapl);
|
||||
|
||||
if(driver == H5FD_FAMILY) {
|
||||
int j;
|
||||
|
||||
for(j = 0; /*void*/; j++) {
|
||||
HDsnprintf(temp, sizeof temp, filename, j);
|
||||
|
||||
if(HDaccess(temp, F_OK) < 0)
|
||||
break;
|
||||
|
||||
HDremove(temp);
|
||||
} /* end for */
|
||||
} else if(driver == H5FD_CORE) {
|
||||
hbool_t backing; /* Whether the core file has backing store */
|
||||
|
||||
H5Pget_fapl_core(fapl, NULL, &backing);
|
||||
|
||||
/* If the file was stored to disk with bacing store, remove it */
|
||||
if(backing)
|
||||
HDremove(filename);
|
||||
} else if (driver == H5FD_MULTI) {
|
||||
H5FD_mem_t mt;
|
||||
|
||||
HDassert(HDstrlen(multi_letters)==H5FD_MEM_NTYPES);
|
||||
|
||||
for(mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; H5_INC_ENUM(H5FD_mem_t,mt)) {
|
||||
HDsnprintf(temp, sizeof temp, "%s-%c.h5", filename, multi_letters[mt]);
|
||||
HDremove(temp); /*don't care if it fails*/
|
||||
} /* end for */
|
||||
} else {
|
||||
HDremove(filename);
|
||||
}
|
||||
} /* end for */
|
||||
h5_delete_test_file(base_name[i], fapl);
|
||||
}
|
||||
|
||||
/* Close the FAPL used to access the file */
|
||||
H5Pclose(fapl);
|
||||
@ -266,10 +227,10 @@ h5_delete_test_file(const char *base_name, hid_t fapl)
|
||||
for(mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; H5_INC_ENUM(H5FD_mem_t,mt)) {
|
||||
HDsnprintf(sub_filename, sizeof(sub_filename), "%s-%c.h5", filename, multi_letters[mt]);
|
||||
HDremove(sub_filename);
|
||||
} /* end for */
|
||||
}
|
||||
} else {
|
||||
HDremove(filename);
|
||||
} /* end if */
|
||||
} /* end driver selection tree */
|
||||
|
||||
return;
|
||||
} /* end h5_delete_test_file() */
|
||||
@ -652,7 +613,7 @@ h5_fixname_real(const char *base_name, hid_t fapl, const char *_suffix,
|
||||
printf("*** Hint ***\n"
|
||||
"You can use environment variable HDF5_PARAPREFIX to "
|
||||
"run parallel test files in a\n"
|
||||
"different directory or to add file type prefix. E.g.,\n"
|
||||
"different directory or to add file type prefix. e.g.,\n"
|
||||
" HDF5_PARAPREFIX=pfs:/PFS/user/me\n"
|
||||
" export HDF5_PARAPREFIX\n"
|
||||
"*** End of Hint ***\n");
|
||||
|
350
test/links.c
350
test/links.c
@ -315,6 +315,8 @@ typedef struct {
|
||||
const obj_visit_t *info; /* Pointer to the object visit structure to use */
|
||||
} ovisit_ud_t;
|
||||
|
||||
static hid_t dcpl_g; /* for [un]minimized dataset object headers */
|
||||
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
@ -377,7 +379,7 @@ mklinks(hid_t fapl, hbool_t new_format)
|
||||
if(H5Gclose(grp) < 0) TEST_ERROR
|
||||
|
||||
/* Create a dataset */
|
||||
if((d1 = H5Dcreate2(file, "d1", H5T_NATIVE_INT, scalar, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
|
||||
if((d1 = H5Dcreate2(file, "d1", H5T_NATIVE_INT, scalar, H5P_DEFAULT, dcpl_g, H5P_DEFAULT)) < 0) TEST_ERROR
|
||||
if(H5Dclose(d1) < 0) TEST_ERROR
|
||||
|
||||
/* Create a hard link */
|
||||
@ -451,8 +453,8 @@ new_links(hid_t fapl, hbool_t new_format)
|
||||
if((grp2_b = H5Gcreate2(file_b, "grp2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
|
||||
|
||||
/* Create datasets */
|
||||
if((dset1 = H5Dcreate2(file_a, "dataset1", H5T_NATIVE_INT, scalar, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
|
||||
if((dset2 = H5Dcreate2(grp1_a, "dataset2", H5T_NATIVE_INT, scalar, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
|
||||
if((dset1 = H5Dcreate2(file_a, "dataset1", H5T_NATIVE_INT, scalar, H5P_DEFAULT, dcpl_g, H5P_DEFAULT)) < 0) TEST_ERROR
|
||||
if((dset2 = H5Dcreate2(grp1_a, "dataset2", H5T_NATIVE_INT, scalar, H5P_DEFAULT, dcpl_g, H5P_DEFAULT)) < 0) TEST_ERROR
|
||||
|
||||
/* Create links within a file. Both of source and destination use
|
||||
* H5L_SAME_LOC. Both hard and soft links should fail. */
|
||||
@ -545,7 +547,7 @@ cklinks(hid_t fapl, hbool_t new_format)
|
||||
if(H5Oget_info_by_name2(file, "grp1/hard", &oinfo2, H5O_INFO_BASIC, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
|
||||
if(H5O_TYPE_DATASET != oinfo2.type) {
|
||||
H5_FAILED();
|
||||
printf(" %d: Unexpected object type should have been a dataset\n", __LINE__);
|
||||
HDprintf(" %d: Unexpected object type should have been a dataset\n", __LINE__);
|
||||
TEST_ERROR
|
||||
} /* end if */
|
||||
if(H5F_addr_ne(oinfo1.addr, oinfo2.addr)) {
|
||||
@ -580,7 +582,7 @@ cklinks(hid_t fapl, hbool_t new_format)
|
||||
if(H5Oget_info_by_name2(file, "grp1/soft", &oinfo2, H5O_INFO_BASIC, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
|
||||
if(H5O_TYPE_DATASET != oinfo2.type) {
|
||||
H5_FAILED();
|
||||
printf(" %d: Unexpected object type should have been a dataset\n", __LINE__);
|
||||
HDprintf(" %d: Unexpected object type should have been a dataset\n", __LINE__);
|
||||
TEST_ERROR
|
||||
} /* end if */
|
||||
if(H5F_addr_ne(oinfo1.addr, oinfo2.addr)) {
|
||||
@ -609,12 +611,12 @@ cklinks(hid_t fapl, hbool_t new_format)
|
||||
if(H5Lget_info(file, "grp1/dangle", &linfo2, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
|
||||
if(H5L_TYPE_SOFT != linfo2.type) {
|
||||
H5_FAILED();
|
||||
printf(" %d: Unexpected object type should have been a symbolic link\n", __LINE__);
|
||||
HDprintf(" %d: Unexpected object type should have been a symbolic link\n", __LINE__);
|
||||
TEST_ERROR
|
||||
} /* end if */
|
||||
if(H5Lget_val(file, "grp1/dangle", linkval, sizeof linkval, H5P_DEFAULT) < 0) {
|
||||
H5_FAILED();
|
||||
printf(" %d: Can't retrieve link value\n", __LINE__);
|
||||
HDprintf(" %d: Can't retrieve link value\n", __LINE__);
|
||||
TEST_ERROR
|
||||
} /* end if */
|
||||
if(HDstrcmp(linkval, "foobar")) {
|
||||
@ -636,12 +638,12 @@ cklinks(hid_t fapl, hbool_t new_format)
|
||||
if(H5Lget_info(file, "grp1/recursive", &linfo2, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
|
||||
if(H5L_TYPE_SOFT != linfo2.type) {
|
||||
H5_FAILED();
|
||||
printf(" %d: Unexpected object type should have been a symbolic link\n", __LINE__);
|
||||
HDprintf(" %d: Unexpected object type should have been a symbolic link\n", __LINE__);
|
||||
TEST_ERROR
|
||||
} /* end if */
|
||||
if(H5Lget_val(file, "grp1/recursive", linkval, sizeof linkval, H5P_DEFAULT) < 0) {
|
||||
H5_FAILED();
|
||||
printf(" %d: Can't retrieve link value\n", __LINE__);
|
||||
HDprintf(" %d: Can't retrieve link value\n", __LINE__);
|
||||
TEST_ERROR
|
||||
} /* end if */
|
||||
if(HDstrcmp(linkval, "/grp1/recursive")) {
|
||||
@ -706,7 +708,7 @@ ck_new_links(hid_t fapl, hbool_t new_format)
|
||||
/* Check hard links */
|
||||
if(H5O_TYPE_DATASET != oi_hard1.type || H5O_TYPE_DATASET != oi_hard2.type) {
|
||||
H5_FAILED();
|
||||
printf(" %d: Unexpected object type should have been a dataset\n", __LINE__);
|
||||
HDprintf(" %d: Unexpected object type should have been a dataset\n", __LINE__);
|
||||
TEST_ERROR
|
||||
}
|
||||
if(H5F_addr_ne(oi_dset.addr, oi_hard1.addr) || H5F_addr_ne(oi_dset.addr, oi_hard2.addr)) {
|
||||
@ -1014,7 +1016,7 @@ test_lcpl(hid_t fapl, hbool_t new_format)
|
||||
if((space_id=H5Screate_simple(2 ,dims, NULL)) < 0) TEST_ERROR
|
||||
|
||||
/* Create a dataset using the default LCPL */
|
||||
if((dset_id = H5Dcreate2(file_id, "/dataset", H5T_NATIVE_INT, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
|
||||
if((dset_id = H5Dcreate2(file_id, "/dataset", H5T_NATIVE_INT, space_id, H5P_DEFAULT, dcpl_g, H5P_DEFAULT)) < 0) TEST_ERROR
|
||||
if(H5Dclose(dset_id) < 0) TEST_ERROR
|
||||
|
||||
/* Check that its character encoding is the default */
|
||||
@ -1043,7 +1045,7 @@ test_lcpl(hid_t fapl, hbool_t new_format)
|
||||
if(linfo.cset != H5T_CSET_UTF8) TEST_ERROR
|
||||
|
||||
/* Create a dataset using the new LCPL */
|
||||
if((dset_id = H5Dcreate2(file_id, "/dataset2", H5T_NATIVE_INT, space_id, lcpl_id, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
|
||||
if((dset_id = H5Dcreate2(file_id, "/dataset2", H5T_NATIVE_INT, space_id, lcpl_id, dcpl_g, H5P_DEFAULT)) < 0) TEST_ERROR
|
||||
if(H5Dclose(dset_id) < 0) TEST_ERROR
|
||||
|
||||
/* Check that its character encoding is UTF-8 */
|
||||
@ -2602,7 +2604,7 @@ external_link_toomany(hid_t fapl, hbool_t new_format)
|
||||
} H5E_END_TRY;
|
||||
if (gid >= 0) {
|
||||
H5_FAILED();
|
||||
printf("%d: Should have failed for sequence of too many nested links.", __LINE__);
|
||||
HDprintf("%d: Should have failed for sequence of too many nested links.", __LINE__);
|
||||
goto error;
|
||||
}
|
||||
|
||||
@ -3758,7 +3760,11 @@ external_set_elink_fapl2(hid_t fapl, hbool_t new_format)
|
||||
if((space = H5Screate_simple(2, dims, NULL)) < 0) TEST_ERROR
|
||||
|
||||
/* Create dataset creation property list */
|
||||
if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) TEST_ERROR;
|
||||
if (dcpl_g == H5P_DEFAULT)
|
||||
dcpl = H5Pcreate(H5P_DATASET_CREATE);
|
||||
else
|
||||
dcpl = H5Pcopy(dcpl_g);
|
||||
if (0 > dcpl) TEST_ERROR;
|
||||
if(H5Pset_alloc_time(dcpl, H5D_ALLOC_TIME_LATE) < 0) TEST_ERROR;
|
||||
|
||||
/* create "Dataset" in group "A" of target file */
|
||||
@ -6100,7 +6106,7 @@ external_link_closing(hid_t fapl, hbool_t new_format)
|
||||
/* Test creating each kind of object */
|
||||
if((gid = H5Gcreate2(fid1, "elink/elink/elink/group1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
|
||||
if(H5Tcommit2(fid1, "elink/elink/elink/type1", tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
|
||||
if((did = H5Dcreate2(fid1, "elink/elink/elink/dataset1", tid2, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
|
||||
if((did = H5Dcreate2(fid1, "elink/elink/elink/dataset1", tid2, sid, H5P_DEFAULT, dcpl_g, H5P_DEFAULT)) < 0) TEST_ERROR
|
||||
|
||||
/* Close objects */
|
||||
if(H5Gclose(gid) < 0) TEST_ERROR
|
||||
@ -7298,7 +7304,7 @@ external_open_twice(hid_t fapl, hbool_t new_format)
|
||||
if((space = H5Screate(H5S_SCALAR)) < 0)
|
||||
TEST_ERROR
|
||||
if((oid1 = H5Dcreate2(fid2, "dset", H5T_NATIVE_INT, space, H5P_DEFAULT,
|
||||
H5P_DEFAULT, H5P_DEFAULT)) < 0)
|
||||
dcpl_g, H5P_DEFAULT)) < 0)
|
||||
TEST_ERROR
|
||||
if(H5Dclose(oid1) < 0)
|
||||
TEST_ERROR
|
||||
@ -7514,8 +7520,11 @@ external_link_with_committed_datatype(hid_t fapl, hbool_t new_format)
|
||||
if((sid2 = H5Screate_simple(2, dims, NULL)) < 0)
|
||||
FAIL_STACK_ERROR
|
||||
|
||||
if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0)
|
||||
FAIL_STACK_ERROR
|
||||
if (dcpl_g == H5P_DEFAULT)
|
||||
dcpl = H5Pcreate(H5P_DATASET_CREATE);
|
||||
else
|
||||
dcpl = H5Pcopy(dcpl_g);
|
||||
if (0 > dcpl) FAIL_STACK_ERROR
|
||||
if(H5Pset_chunk(dcpl, 2, chunks) < 0)
|
||||
FAIL_STACK_ERROR
|
||||
|
||||
@ -9058,7 +9067,7 @@ lapl_nlinks(hid_t fapl, hbool_t new_format)
|
||||
dims[0] = 2;
|
||||
dims[1] = 2;
|
||||
if((sid = H5Screate_simple(2, dims, NULL)) < 0) TEST_ERROR
|
||||
if((did = H5Dcreate2(gid, "dataset", H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
|
||||
if((did = H5Dcreate2(gid, "dataset", H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl_g, H5P_DEFAULT)) < 0) TEST_ERROR
|
||||
if(H5Dclose(did) < 0) TEST_ERROR
|
||||
|
||||
/* Close group */
|
||||
@ -9170,7 +9179,7 @@ linkinfo(hid_t fapl, hbool_t new_format)
|
||||
if(H5Lcreate_soft("group", fid, "softlink", H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
|
||||
|
||||
if((sid = H5Screate(H5S_SCALAR)) < 0) TEST_ERROR
|
||||
if((did = H5Dcreate2(fid, "dataset", H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
|
||||
if((did = H5Dcreate2(fid, "dataset", H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl_g, H5P_DEFAULT)) < 0) TEST_ERROR
|
||||
|
||||
if(H5Lcreate_ud(fid, "ud_link", (H5L_type_t)UD_PLIST_TYPE, NULL, (size_t)0, H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
|
||||
if(H5Lcreate_external("file_name", "obj_path", fid, "ext_link", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
|
||||
@ -9335,13 +9344,13 @@ build_visit_file(hid_t fapl)
|
||||
/* Create dataset in each group */
|
||||
if((sid = H5Screate(H5S_SCALAR)) < 0) TEST_ERROR
|
||||
|
||||
if((did = H5Dcreate2(fid, "/Dataset_zero", H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
|
||||
if((did = H5Dcreate2(fid, "/Dataset_zero", H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl_g, H5P_DEFAULT)) < 0) TEST_ERROR
|
||||
if(H5Dclose(did) < 0) TEST_ERROR
|
||||
|
||||
if((did = H5Dcreate2(fid, "/Group1/Dataset_one", H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
|
||||
if((did = H5Dcreate2(fid, "/Group1/Dataset_one", H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl_g, H5P_DEFAULT)) < 0) TEST_ERROR
|
||||
if(H5Dclose(did) < 0) TEST_ERROR
|
||||
|
||||
if((did = H5Dcreate2(fid, "/Group1/Group2/Dataset_two", H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
|
||||
if((did = H5Dcreate2(fid, "/Group1/Group2/Dataset_two", H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl_g, H5P_DEFAULT)) < 0) TEST_ERROR
|
||||
if(H5Dclose(did) < 0) TEST_ERROR
|
||||
|
||||
if(H5Sclose(sid) < 0) TEST_ERROR
|
||||
@ -14890,6 +14899,7 @@ main(void)
|
||||
hid_t fapl, fapl2; /* File access property lists */
|
||||
int nerrors = 0;
|
||||
unsigned new_format; /* Whether to use the new format or not */
|
||||
unsigned minimize_dset_oh;
|
||||
unsigned efc; /* Whether to use the external file cache */
|
||||
const char *env_h5_drvr; /* File Driver value from environment */
|
||||
|
||||
@ -14900,165 +14910,187 @@ main(void)
|
||||
h5_reset();
|
||||
fapl = h5_fileaccess();
|
||||
|
||||
/* Copy the file access property list */
|
||||
/* fapl2 uses "latest version bounds" */
|
||||
if((fapl2 = H5Pcopy(fapl)) < 0) TEST_ERROR
|
||||
|
||||
/* Set the "use the latest version of the format" bounds for creating objects in the file */
|
||||
if(H5Pset_libver_bounds(fapl2, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) TEST_ERROR
|
||||
|
||||
/* Loop over using new group format */
|
||||
for(new_format = FALSE; new_format <= TRUE; new_format++) {
|
||||
hid_t my_fapl;
|
||||
for (minimize_dset_oh = 0; minimize_dset_oh <= 1; minimize_dset_oh++) {
|
||||
if (minimize_dset_oh) {
|
||||
HDprintf("\n-Testing with minimzed dataset object headers-\n");
|
||||
dcpl_g = H5Pcreate(H5P_DATASET_CREATE);
|
||||
if (0 > dcpl_g) TEST_ERROR
|
||||
} else {
|
||||
HDprintf("\n-Testing with unminimzed dataset object headers-\n");
|
||||
dcpl_g = H5P_DEFAULT;
|
||||
}
|
||||
|
||||
/* Check for FAPL to use */
|
||||
if(new_format)
|
||||
my_fapl = fapl2;
|
||||
else
|
||||
my_fapl = fapl;
|
||||
for(new_format = FALSE; new_format <= TRUE; new_format++) {
|
||||
hid_t my_fapl;
|
||||
|
||||
/* General tests... (on both old & new format groups */
|
||||
nerrors += mklinks(my_fapl, new_format) < 0 ? 1 : 0;
|
||||
nerrors += cklinks(my_fapl, new_format) < 0 ? 1 : 0;
|
||||
nerrors += new_links(my_fapl, new_format) < 0 ? 1 : 0;
|
||||
nerrors += ck_new_links(my_fapl, new_format) < 0 ? 1 : 0;
|
||||
nerrors += long_links(my_fapl, new_format) < 0 ? 1 : 0;
|
||||
nerrors += toomany(my_fapl, new_format) < 0 ? 1 : 0;
|
||||
/* Check for FAPL to use */
|
||||
if(new_format) {
|
||||
my_fapl = fapl2;
|
||||
HDprintf("\n--Testing with 'new format'--\n");
|
||||
} else {
|
||||
my_fapl = fapl;
|
||||
HDprintf("\n--Testing with 'old format'--\n");
|
||||
}
|
||||
|
||||
/* Test new H5L link creation routine */
|
||||
nerrors += test_lcpl(my_fapl, new_format);
|
||||
nerrors += test_move(my_fapl, new_format);
|
||||
nerrors += test_copy(my_fapl, new_format);
|
||||
nerrors += test_move_preserves(my_fapl, new_format);
|
||||
/* always enter tests without external cache */
|
||||
if(H5Pset_elink_file_cache_size(my_fapl, 0) < 0)
|
||||
TEST_ERROR
|
||||
|
||||
/* General tests... (on both old & new format groups */
|
||||
nerrors += mklinks(my_fapl, new_format) < 0 ? 1 : 0;
|
||||
nerrors += cklinks(my_fapl, new_format) < 0 ? 1 : 0;
|
||||
nerrors += new_links(my_fapl, new_format) < 0 ? 1 : 0;
|
||||
nerrors += ck_new_links(my_fapl, new_format) < 0 ? 1 : 0;
|
||||
nerrors += long_links(my_fapl, new_format) < 0 ? 1 : 0;
|
||||
nerrors += toomany(my_fapl, new_format) < 0 ? 1 : 0;
|
||||
|
||||
/* Test new H5L link creation routine */
|
||||
nerrors += test_lcpl(my_fapl, new_format);
|
||||
nerrors += test_move(my_fapl, new_format);
|
||||
nerrors += test_copy(my_fapl, new_format);
|
||||
nerrors += test_move_preserves(my_fapl, new_format);
|
||||
#ifndef H5_NO_DEPRECATED_SYMBOLS
|
||||
nerrors += test_deprec(my_fapl, new_format);
|
||||
nerrors += test_deprec(my_fapl, new_format);
|
||||
#endif /* H5_NO_DEPRECATED_SYMBOLS */
|
||||
|
||||
/* tests for external link */
|
||||
/* Test external file cache first, so it sees the default efc setting on
|
||||
* the fapl */
|
||||
nerrors += external_file_cache(my_fapl, new_format) < 0 ? 1 : 0;
|
||||
/* tests for external link */
|
||||
/* Test external file cache first, so it sees the default efc setting on
|
||||
* the fapl */
|
||||
nerrors += external_file_cache(my_fapl, new_format) < 0 ? 1 : 0;
|
||||
|
||||
/* This test cannot run with the EFC because it assumes that an
|
||||
* intermediate file is not held open */
|
||||
nerrors += external_link_mult(my_fapl, new_format) < 0 ? 1 : 0;
|
||||
/* This test cannot run with the EFC because it assumes that an
|
||||
* intermediate file is not held open */
|
||||
nerrors += external_link_mult(my_fapl, new_format) < 0 ? 1 : 0;
|
||||
|
||||
/* This test cannot run with the EFC because the EFC cannot currently
|
||||
* reopen a cached file with a different intent */
|
||||
nerrors += external_set_elink_acc_flags(env_h5_drvr, my_fapl, new_format) < 0 ? 1 : 0;
|
||||
/* This test cannot run with the EFC because the EFC cannot currently
|
||||
* reopen a cached file with a different intent */
|
||||
nerrors += external_set_elink_acc_flags(env_h5_drvr, my_fapl, new_format) < 0 ? 1 : 0;
|
||||
|
||||
/* Try external link tests both with and without the external file cache
|
||||
*/
|
||||
for(efc = FALSE; efc <= TRUE; efc++) {
|
||||
if(efc) {
|
||||
if(H5Pset_elink_file_cache_size(my_fapl, 8) < 0)
|
||||
TEST_ERROR
|
||||
printf("\n---Testing with external file cache---\n");
|
||||
} /* end if */
|
||||
else {
|
||||
if(H5Pset_elink_file_cache_size(my_fapl, 0) < 0)
|
||||
TEST_ERROR
|
||||
printf("\n---Testing without external file cache---\n");
|
||||
} /* end else */
|
||||
/* Try external link tests both with and without the external file cache
|
||||
*/
|
||||
for(efc = FALSE; efc <= TRUE; efc++) {
|
||||
if(efc) {
|
||||
if(H5Pset_elink_file_cache_size(my_fapl, 8) < 0)
|
||||
TEST_ERROR
|
||||
HDprintf("\n---Testing with external file cache---\n");
|
||||
} /* end if */
|
||||
else {
|
||||
if(H5Pset_elink_file_cache_size(my_fapl, 0) < 0)
|
||||
TEST_ERROR
|
||||
HDprintf("\n---Testing without external file cache---\n");
|
||||
} /* end else */
|
||||
|
||||
nerrors += external_link_root(my_fapl, new_format) < 0 ? 1 : 0;
|
||||
nerrors += external_link_path(my_fapl, new_format) < 0 ? 1 : 0;
|
||||
nerrors += external_link_self(my_fapl, new_format) < 0 ? 1 : 0;
|
||||
nerrors += external_link_pingpong(my_fapl, new_format) < 0 ? 1 : 0;
|
||||
nerrors += external_link_toomany(my_fapl, new_format) < 0 ? 1 : 0;
|
||||
nerrors += external_link_dangling(my_fapl, new_format) < 0 ? 1 : 0;
|
||||
nerrors += external_link_recursive(my_fapl, new_format) < 0 ? 1 : 0;
|
||||
nerrors += external_link_query(my_fapl, new_format) < 0 ? 1 : 0;
|
||||
nerrors += external_link_unlink_compact(my_fapl, new_format) < 0 ? 1 : 0;
|
||||
nerrors += external_link_unlink_dense(my_fapl, new_format) < 0 ? 1 : 0;
|
||||
nerrors += external_link_move(my_fapl, new_format) < 0 ? 1 : 0;
|
||||
nerrors += external_link_ride(my_fapl, new_format) < 0 ? 1 : 0;
|
||||
nerrors += external_link_closing(my_fapl, new_format) < 0 ? 1 : 0;
|
||||
nerrors += external_link_endian(new_format) < 0 ? 1 : 0;
|
||||
nerrors += external_link_strong(my_fapl, new_format) < 0 ? 1 : 0;
|
||||
nerrors += external_link_root(my_fapl, new_format) < 0 ? 1 : 0;
|
||||
nerrors += external_link_path(my_fapl, new_format) < 0 ? 1 : 0;
|
||||
nerrors += external_link_self(my_fapl, new_format) < 0 ? 1 : 0;
|
||||
nerrors += external_link_pingpong(my_fapl, new_format) < 0 ? 1 : 0;
|
||||
nerrors += external_link_toomany(my_fapl, new_format) < 0 ? 1 : 0;
|
||||
nerrors += external_link_dangling(my_fapl, new_format) < 0 ? 1 : 0;
|
||||
nerrors += external_link_recursive(my_fapl, new_format) < 0 ? 1 : 0;
|
||||
nerrors += external_link_query(my_fapl, new_format) < 0 ? 1 : 0;
|
||||
nerrors += external_link_unlink_compact(my_fapl, new_format) < 0 ? 1 : 0;
|
||||
nerrors += external_link_unlink_dense(my_fapl, new_format) < 0 ? 1 : 0;
|
||||
nerrors += external_link_move(my_fapl, new_format) < 0 ? 1 : 0;
|
||||
nerrors += external_link_ride(my_fapl, new_format) < 0 ? 1 : 0;
|
||||
nerrors += external_link_closing(my_fapl, new_format) < 0 ? 1 : 0;
|
||||
nerrors += external_link_endian(new_format) < 0 ? 1 : 0;
|
||||
nerrors += external_link_strong(my_fapl, new_format) < 0 ? 1 : 0;
|
||||
|
||||
nerrors += external_link_prefix(my_fapl, new_format) < 0 ? 1 : 0;
|
||||
nerrors += external_link_abs_mainpath(my_fapl, new_format) < 0 ? 1 : 0;
|
||||
nerrors += external_link_rel_mainpath(my_fapl, new_format) < 0 ? 1 : 0;
|
||||
nerrors += external_link_cwd(my_fapl, new_format) < 0 ? 1 : 0;
|
||||
nerrors += external_link_abstar(my_fapl, new_format) < 0 ? 1 : 0;
|
||||
nerrors += external_link_abstar_cur(my_fapl, new_format) < 0 ? 1 : 0;
|
||||
nerrors += external_link_reltar(my_fapl, new_format) < 0 ? 1 : 0;
|
||||
nerrors += external_link_chdir(my_fapl, new_format) < 0 ? 1 : 0;
|
||||
nerrors += external_set_elink_fapl1(my_fapl, new_format) < 0 ? 1 : 0;
|
||||
nerrors += external_set_elink_fapl2(my_fapl, new_format) < 0 ? 1 : 0;
|
||||
nerrors += external_set_elink_fapl3(new_format) < 0 ? 1 : 0;
|
||||
nerrors += external_set_elink_cb(my_fapl, new_format) < 0 ? 1 : 0;
|
||||
nerrors += external_link_prefix(my_fapl, new_format) < 0 ? 1 : 0;
|
||||
nerrors += external_link_abs_mainpath(my_fapl, new_format) < 0 ? 1 : 0;
|
||||
nerrors += external_link_rel_mainpath(my_fapl, new_format) < 0 ? 1 : 0;
|
||||
nerrors += external_link_cwd(my_fapl, new_format) < 0 ? 1 : 0;
|
||||
nerrors += external_link_abstar(my_fapl, new_format) < 0 ? 1 : 0;
|
||||
nerrors += external_link_abstar_cur(my_fapl, new_format) < 0 ? 1 : 0;
|
||||
nerrors += external_link_reltar(my_fapl, new_format) < 0 ? 1 : 0;
|
||||
nerrors += external_link_chdir(my_fapl, new_format) < 0 ? 1 : 0;
|
||||
nerrors += external_set_elink_fapl1(my_fapl, new_format) < 0 ? 1 : 0;
|
||||
nerrors += external_set_elink_fapl2(my_fapl, new_format) < 0 ? 1 : 0;
|
||||
nerrors += external_set_elink_fapl3(new_format) < 0 ? 1 : 0;
|
||||
nerrors += external_set_elink_cb(my_fapl, new_format) < 0 ? 1 : 0;
|
||||
#ifdef H5_HAVE_WINDOW_PATH
|
||||
nerrors += external_link_win1(my_fapl, new_format) < 0 ? 1 : 0;
|
||||
nerrors += external_link_win2(my_fapl, new_format) < 0 ? 1 : 0;
|
||||
nerrors += external_link_win3(my_fapl, new_format) < 0 ? 1 : 0;
|
||||
nerrors += external_link_win4(my_fapl, new_format) < 0 ? 1 : 0;
|
||||
nerrors += external_link_win5(my_fapl, new_format) < 0 ? 1 : 0;
|
||||
nerrors += external_link_win6(my_fapl, new_format) < 0 ? 1 : 0;
|
||||
nerrors += external_link_win7(my_fapl, new_format) < 0 ? 1 : 0;
|
||||
nerrors += external_link_win8(my_fapl, new_format) < 0 ? 1 : 0;
|
||||
nerrors += external_link_win9(my_fapl, new_format) < 0 ? 1 : 0;
|
||||
nerrors += external_link_win1(my_fapl, new_format) < 0 ? 1 : 0;
|
||||
nerrors += external_link_win2(my_fapl, new_format) < 0 ? 1 : 0;
|
||||
nerrors += external_link_win3(my_fapl, new_format) < 0 ? 1 : 0;
|
||||
nerrors += external_link_win4(my_fapl, new_format) < 0 ? 1 : 0;
|
||||
nerrors += external_link_win5(my_fapl, new_format) < 0 ? 1 : 0;
|
||||
nerrors += external_link_win6(my_fapl, new_format) < 0 ? 1 : 0;
|
||||
nerrors += external_link_win7(my_fapl, new_format) < 0 ? 1 : 0;
|
||||
nerrors += external_link_win8(my_fapl, new_format) < 0 ? 1 : 0;
|
||||
nerrors += external_link_win9(my_fapl, new_format) < 0 ? 1 : 0;
|
||||
#endif
|
||||
nerrors += external_symlink(env_h5_drvr, my_fapl, new_format) < 0 ? 1 : 0;
|
||||
nerrors += external_copy_invalid_object(my_fapl, new_format) < 0 ? 1 : 0;
|
||||
nerrors += external_dont_fail_to_source(my_fapl, new_format) < 0 ? 1 : 0;
|
||||
nerrors += external_open_twice(my_fapl, new_format) < 0 ? 1 : 0;
|
||||
nerrors += external_link_with_committed_datatype(my_fapl, new_format) < 0 ? 1 : 0;
|
||||
} /* end for */
|
||||
nerrors += external_symlink(env_h5_drvr, my_fapl, new_format) < 0 ? 1 : 0;
|
||||
nerrors += external_copy_invalid_object(my_fapl, new_format) < 0 ? 1 : 0;
|
||||
nerrors += external_dont_fail_to_source(my_fapl, new_format) < 0 ? 1 : 0;
|
||||
nerrors += external_open_twice(my_fapl, new_format) < 0 ? 1 : 0;
|
||||
nerrors += external_link_with_committed_datatype(my_fapl, new_format) < 0 ? 1 : 0;
|
||||
} /* with/without external file cache */
|
||||
|
||||
/* These tests assume that external links are a form of UD links,
|
||||
* so assume that everything that passed for external links
|
||||
* above has already been tested for UD links.
|
||||
*/
|
||||
if(new_format == TRUE) {
|
||||
nerrors += ud_hard_links(fapl2) < 0 ? 1 : 0; /* requires new format groups */
|
||||
nerrors += ud_link_reregister(fapl2) < 0 ? 1 : 0; /* requires new format groups */
|
||||
} /* end if */
|
||||
nerrors += ud_callbacks(my_fapl, new_format) < 0 ? 1 : 0;
|
||||
nerrors += ud_link_errors(my_fapl, new_format) < 0 ? 1 : 0;
|
||||
nerrors += lapl_udata(my_fapl, new_format) < 0 ? 1 : 0;
|
||||
nerrors += lapl_nlinks(my_fapl, new_format) < 0 ? 1 : 0;
|
||||
nerrors += linkinfo(my_fapl, new_format) < 0 ? 1 : 0;
|
||||
/* These tests assume that external links are a form of UD links,
|
||||
* so assume that everything that passed for external links
|
||||
* above has already been tested for UD links.
|
||||
*/
|
||||
if(new_format == TRUE) {
|
||||
nerrors += ud_hard_links(fapl2) < 0 ? 1 : 0; /* requires new format groups */
|
||||
nerrors += ud_link_reregister(fapl2) < 0 ? 1 : 0; /* requires new format groups */
|
||||
} /* end if */
|
||||
nerrors += ud_callbacks(my_fapl, new_format) < 0 ? 1 : 0;
|
||||
nerrors += ud_link_errors(my_fapl, new_format) < 0 ? 1 : 0;
|
||||
nerrors += lapl_udata(my_fapl, new_format) < 0 ? 1 : 0;
|
||||
nerrors += lapl_nlinks(my_fapl, new_format) < 0 ? 1 : 0;
|
||||
nerrors += linkinfo(my_fapl, new_format) < 0 ? 1 : 0;
|
||||
|
||||
/* Misc. extra tests, useful for both new & old format files */
|
||||
nerrors += link_visit(my_fapl, new_format) < 0 ? 1 : 0;
|
||||
nerrors += link_visit_by_name(my_fapl, new_format) < 0 ? 1 : 0;
|
||||
nerrors += obj_visit(my_fapl, new_format) < 0 ? 1 : 0;
|
||||
nerrors += obj_visit_by_name(my_fapl, new_format) < 0 ? 1 : 0;
|
||||
nerrors += obj_visit_stop(my_fapl, new_format) < 0 ? 1 : 0;
|
||||
nerrors += link_filters(my_fapl, new_format) < 0 ? 1 : 0;
|
||||
nerrors += obj_exists(my_fapl, new_format) < 0 ? 1 : 0;
|
||||
/* Misc. extra tests, useful for both new & old format files */
|
||||
nerrors += link_visit(my_fapl, new_format) < 0 ? 1 : 0;
|
||||
nerrors += link_visit_by_name(my_fapl, new_format) < 0 ? 1 : 0;
|
||||
nerrors += obj_visit(my_fapl, new_format) < 0 ? 1 : 0;
|
||||
nerrors += obj_visit_by_name(my_fapl, new_format) < 0 ? 1 : 0;
|
||||
nerrors += obj_visit_stop(my_fapl, new_format) < 0 ? 1 : 0;
|
||||
nerrors += link_filters(my_fapl, new_format) < 0 ? 1 : 0;
|
||||
nerrors += obj_exists(my_fapl, new_format) < 0 ? 1 : 0;
|
||||
|
||||
/* Keep this test last, it's testing files that are used above */
|
||||
/* do not do this for files used by external link tests */
|
||||
nerrors += check_all_closed(my_fapl, new_format, EXTSTOP) < 0 ? 1 : 0;
|
||||
} /* end for */
|
||||
/* Keep this test last, it's testing files that are used above */
|
||||
/* do not do this for files used by external link tests */
|
||||
nerrors += check_all_closed(my_fapl, new_format, EXTSTOP) < 0 ? 1 : 0;
|
||||
} /* new/old format */
|
||||
|
||||
/* New group revision feature tests */
|
||||
nerrors += corder_create_empty(fapl2) < 0 ? 1 : 0;
|
||||
|
||||
/* New group revision feature tests */
|
||||
nerrors += corder_create_empty(fapl2) < 0 ? 1 : 0;
|
||||
/* XXX: when creation order indexing is fully working, go back and add checks
|
||||
* to these tests to make certain that the creation order values are
|
||||
* correct.
|
||||
*/
|
||||
nerrors += corder_create_compact(fapl2) < 0 ? 1 : 0;
|
||||
nerrors += corder_create_dense(fapl2) < 0 ? 1 : 0;
|
||||
nerrors += corder_transition(fapl2) < 0 ? 1 : 0;
|
||||
nerrors += corder_delete(fapl2) < 0 ? 1 : 0;
|
||||
nerrors += link_info_by_idx(fapl2) < 0 ? 1 : 0;
|
||||
nerrors += delete_by_idx(fapl2) < 0 ? 1 : 0;
|
||||
nerrors += link_iterate(fapl2) < 0 ? 1 : 0;
|
||||
nerrors += open_by_idx(fapl2) < 0 ? 1 : 0;
|
||||
nerrors += object_info(fapl2) < 0 ? 1 : 0;
|
||||
nerrors += group_info(fapl2) < 0 ? 1 : 0;
|
||||
nerrors += timestamps(fapl2) < 0 ? 1 : 0;
|
||||
nerrors += corder_create_compact(fapl2) < 0 ? 1 : 0;
|
||||
nerrors += corder_create_dense(fapl2) < 0 ? 1 : 0;
|
||||
nerrors += corder_transition(fapl2) < 0 ? 1 : 0;
|
||||
nerrors += corder_delete(fapl2) < 0 ? 1 : 0;
|
||||
nerrors += link_info_by_idx(fapl2) < 0 ? 1 : 0;
|
||||
nerrors += delete_by_idx(fapl2) < 0 ? 1 : 0;
|
||||
nerrors += link_iterate(fapl2) < 0 ? 1 : 0;
|
||||
nerrors += open_by_idx(fapl2) < 0 ? 1 : 0;
|
||||
nerrors += object_info(fapl2) < 0 ? 1 : 0;
|
||||
nerrors += group_info(fapl2) < 0 ? 1 : 0;
|
||||
nerrors += timestamps(fapl2) < 0 ? 1 : 0;
|
||||
|
||||
/* Test new API calls on old-style groups */
|
||||
nerrors += link_info_by_idx_old(fapl) < 0 ? 1 : 0;
|
||||
nerrors += delete_by_idx_old(fapl) < 0 ? 1 : 0;
|
||||
nerrors += link_iterate_old(fapl) < 0 ? 1 : 0;
|
||||
nerrors += open_by_idx_old(fapl) < 0 ? 1 : 0;
|
||||
nerrors += object_info_old(fapl) < 0 ? 1 : 0;
|
||||
nerrors += group_info_old(fapl) < 0 ? 1 : 0;
|
||||
/* Test new API calls on old-style groups */
|
||||
nerrors += link_info_by_idx_old(fapl) < 0 ? 1 : 0;
|
||||
nerrors += delete_by_idx_old(fapl) < 0 ? 1 : 0;
|
||||
nerrors += link_iterate_old(fapl) < 0 ? 1 : 0;
|
||||
nerrors += open_by_idx_old(fapl) < 0 ? 1 : 0;
|
||||
nerrors += object_info_old(fapl) < 0 ? 1 : 0;
|
||||
nerrors += group_info_old(fapl) < 0 ? 1 : 0;
|
||||
|
||||
if (minimize_dset_oh) {
|
||||
if (H5Pclose(dcpl_g) < 0)
|
||||
TEST_ERROR;
|
||||
dcpl_g = -1;
|
||||
}
|
||||
} /* [un]minimized dataset object headers */
|
||||
|
||||
/* Close 2nd FAPL */
|
||||
H5Pclose(fapl2);
|
||||
@ -15075,11 +15107,11 @@ main(void)
|
||||
|
||||
/* Results */
|
||||
if(nerrors) {
|
||||
printf("***** %d LINK TEST%s FAILED! *****\n",
|
||||
HDprintf("***** %d LINK TEST%s FAILED! *****\n",
|
||||
nerrors, 1 == nerrors ? "" : "S");
|
||||
HDexit(EXIT_FAILURE);
|
||||
}
|
||||
printf("All link tests passed.\n");
|
||||
HDprintf("All link tests passed.\n");
|
||||
|
||||
/* clean up symlink created by external link tests */
|
||||
HDremove(SYMLINK1);
|
||||
|
@ -10,19 +10,20 @@
|
||||
* help@hdfgroup.org. *
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
/*
|
||||
* Purpose: A simple virtual object layer (VOL) plugin that just echoes
|
||||
* the name of the API call.
|
||||
/* Purpose: A simple virtual object layer (VOL) connector with almost no
|
||||
* functionality that is used for testing basic plugin handling
|
||||
* (registration, etc.).
|
||||
*/
|
||||
|
||||
#include "H5PLextern.h"
|
||||
|
||||
/* The VOL class struct.
|
||||
*/
|
||||
static const H5VL_class_t echo_vol_g = {
|
||||
#include "null_vol_connector.h"
|
||||
|
||||
/* The VOL class struct */
|
||||
static const H5VL_class_t null_vol_g = {
|
||||
0, /* version */
|
||||
(H5VL_class_value_t)501, /* value */
|
||||
"echo", /* name */
|
||||
NULL_VOL_CONNECTOR_VALUE, /* value */
|
||||
NULL_VOL_CONNECTOR_NAME, /* name */
|
||||
0, /* capability flags */
|
||||
NULL, /* initialize */
|
||||
NULL, /* terminate */
|
||||
@ -106,22 +107,10 @@ static const H5VL_class_t echo_vol_g = {
|
||||
NULL /* optional */
|
||||
};
|
||||
|
||||
|
||||
|
||||
/* These two functions are necessary to load this plugin using
|
||||
* the HDF5 library.
|
||||
*/
|
||||
|
||||
H5PL_type_t
|
||||
H5PLget_plugin_type(void)
|
||||
{
|
||||
return H5PL_TYPE_VOL;
|
||||
}
|
||||
|
||||
|
||||
const void*
|
||||
H5PLget_plugin_info(void)
|
||||
{
|
||||
return &echo_vol_g;
|
||||
}
|
||||
H5PL_type_t H5PLget_plugin_type(void) {return H5PL_TYPE_VOL;}
|
||||
const void *H5PLget_plugin_info(void) {return &null_vol_g;}
|
||||
|
25
test/null_vol_connector.h
Normal file
25
test/null_vol_connector.h
Normal file
@ -0,0 +1,25 @@
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
* Copyright by The HDF Group. *
|
||||
* All rights reserved. *
|
||||
* *
|
||||
* This file is part of HDF5. The full HDF5 copyright notice, including *
|
||||
* terms governing use, modification, and redistribution, is contained in *
|
||||
* the COPYING file, which can be found at the root of the source code *
|
||||
* distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. *
|
||||
* If you do not have access to either file, you may request a copy from *
|
||||
* help@hdfgroup.org. *
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
/* Purpose: A simple virtual object layer (VOL) connector with almost no
|
||||
* functionality that is used for testing basic plugin handling
|
||||
* (registration, etc.).
|
||||
*/
|
||||
|
||||
#ifndef _null_vol_connector_H
|
||||
#define _null_vol_connector_H
|
||||
|
||||
#define NULL_VOL_CONNECTOR_VALUE ((H5VL_class_value_t)160)
|
||||
#define NULL_VOL_CONNECTOR_NAME "null_vol_connector"
|
||||
|
||||
#endif /* _null_vol_connector_H */
|
||||
|
901
test/ohdr.c
901
test/ohdr.c
@ -36,9 +36,16 @@
|
||||
|
||||
const char *FILENAME[] = {
|
||||
"ohdr",
|
||||
"ohdr_min_a",
|
||||
"ohdr_min_b",
|
||||
NULL
|
||||
};
|
||||
|
||||
/* used for object header size comparison */
|
||||
#define EQ 1
|
||||
#define LT 2
|
||||
#define GT 3
|
||||
|
||||
/* The tbogus.h5 is generated from gen_bogus.c in HDF5 'test' directory.
|
||||
* To get this data file, define H5O_ENABLE_BOGUS in src/H5Oprivate, rebuild
|
||||
* the library and simply compile gen_bogus.c with that HDF5 library and run it.
|
||||
@ -733,6 +740,885 @@ error:
|
||||
return FAIL;
|
||||
} /* test_unknown() */
|
||||
|
||||
/*
|
||||
* Set an attribute with the given information.
|
||||
* If the out parameter `attr_id` is negative, a new attribute will be
|
||||
* created with the given information. Else, it will attempt to update the
|
||||
* attribute with the new value.
|
||||
*
|
||||
* `dataspace_id` ignored if `attribute_id` >= 0
|
||||
*/
|
||||
static herr_t
|
||||
put_attribute(hid_t loc_id, const char *attrname, const void *attrvalue, hid_t datatype_id, hid_t dataspace_id, hid_t *attribute_id)
|
||||
{
|
||||
if((*attribute_id) < 0) {
|
||||
hid_t id = -1;
|
||||
id = H5Acreate(loc_id, attrname, datatype_id, dataspace_id, H5P_DEFAULT, H5P_DEFAULT);
|
||||
if(id < 0)
|
||||
return FAIL;
|
||||
*attribute_id = id;
|
||||
}
|
||||
return H5Awrite(*attribute_id, datatype_id, attrvalue);
|
||||
} /* put_attribute */
|
||||
|
||||
/*
|
||||
* Count the number of attributes attached to an object.
|
||||
* Returns negative in event of error.
|
||||
*/
|
||||
static int
|
||||
count_attributes(hid_t dset_id)
|
||||
{
|
||||
H5O_info_t info;
|
||||
|
||||
if(H5Oget_info(dset_id, &info, H5O_INFO_ALL) < 0)
|
||||
return -1;
|
||||
else
|
||||
return (int)info.num_attrs; /* should never exceed int bounds */
|
||||
} /* count_attributes */
|
||||
|
||||
/*
|
||||
* Get the total space used by the object header.
|
||||
* Used by oh_compare()
|
||||
* On success, stores size in `size_out` pointer.
|
||||
*/
|
||||
static herr_t
|
||||
_oh_getsize(hid_t did, hsize_t *size_out)
|
||||
{
|
||||
H5O_info_t info;
|
||||
if(FAIL == H5Oget_info2(did, &info, H5O_INFO_HDR))
|
||||
return FAIL;
|
||||
*size_out = info.hdr.space.total;
|
||||
return SUCCEED;
|
||||
} /* _oh_getsize */
|
||||
|
||||
/*
|
||||
* Compare the TOTAL space used by datasets' object headers.
|
||||
* Returns negative value if an error occurred,
|
||||
* else positive #defined indicator value EQ, LT, GT.
|
||||
*/
|
||||
static int
|
||||
oh_compare(hid_t did1, hid_t did2)
|
||||
{
|
||||
hsize_t space1 = 0;
|
||||
hsize_t space2 = 0;
|
||||
|
||||
if(FAIL == _oh_getsize(did1, &space1))
|
||||
return -1;
|
||||
if(FAIL == _oh_getsize(did2, &space2))
|
||||
return -2;
|
||||
|
||||
if(space1 < space2)
|
||||
return LT;
|
||||
else if(space1 > space2)
|
||||
return GT;
|
||||
else
|
||||
return EQ;
|
||||
} /* oh_compare() */
|
||||
|
||||
/*
|
||||
* Demonstrate attribute addition to datasets.
|
||||
* Conduct additions side-by-side with a standard datataset and one with
|
||||
* minimized dataset object headers.
|
||||
*/
|
||||
static herr_t
|
||||
test_minimized_dset_ohdr_attribute_addition(hid_t fapl_id)
|
||||
{
|
||||
hsize_t array_10[1] = {10}; /* dataspace extent */
|
||||
char buffer[10] = ""; /* to inspect string attribute */
|
||||
int a_out = 0;
|
||||
char filename[512] = "";
|
||||
hid_t int_type_id = -1;
|
||||
hid_t char_type_id = -1;
|
||||
hid_t dcpl_id = -1;
|
||||
hid_t dspace_id = -1;
|
||||
hid_t dspace_scalar_id = -1;
|
||||
hid_t dset_id = -1;
|
||||
hid_t mindset_id = -1;
|
||||
hid_t attr_1_id = -1;
|
||||
hid_t attr_1a_id = -1;
|
||||
hid_t attr_2_id = -1;
|
||||
hid_t attr_2a_id = -1;
|
||||
hid_t attr_3_id = -1;
|
||||
hid_t attr_3a_id = -1;
|
||||
hid_t file_id = -1;
|
||||
herr_t ret;
|
||||
int count = 0;
|
||||
|
||||
TESTING("minimized dset object headers attribute additions")
|
||||
|
||||
/*********
|
||||
* SETUP *
|
||||
*********/
|
||||
|
||||
if(h5_fixname(FILENAME[1], H5P_DEFAULT, filename, sizeof(filename)) == NULL)
|
||||
TEST_ERROR
|
||||
|
||||
dspace_id = H5Screate_simple(1, array_10, NULL);
|
||||
if(dspace_id < 0) TEST_ERROR
|
||||
|
||||
dspace_scalar_id = H5Screate(H5S_SCALAR);
|
||||
if(dspace_scalar_id < 0) TEST_ERROR
|
||||
|
||||
char_type_id = H5Tcopy(H5T_NATIVE_CHAR);
|
||||
if(char_type_id < 0) TEST_ERROR
|
||||
|
||||
int_type_id = H5Tcopy(H5T_NATIVE_INT);
|
||||
if(int_type_id < 0) TEST_ERROR
|
||||
|
||||
dcpl_id = H5Pcreate(H5P_DATASET_CREATE);
|
||||
if(dcpl_id < 0) TEST_ERROR
|
||||
|
||||
ret = H5Pset_dset_no_attrs_hint(dcpl_id, TRUE);
|
||||
if(ret < 0) TEST_ERROR
|
||||
|
||||
file_id = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id);
|
||||
if(file_id < 0) TEST_ERROR
|
||||
|
||||
H5E_BEGIN_TRY {
|
||||
count = count_attributes(dset_id);
|
||||
} H5E_END_TRY;
|
||||
if(count != -1) TEST_ERROR
|
||||
|
||||
dset_id = H5Dcreate(file_id, "dataset", int_type_id, dspace_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
|
||||
if(dset_id < 0) TEST_ERROR
|
||||
|
||||
mindset_id = H5Dcreate(file_id, "mindataset", int_type_id, dspace_id, H5P_DEFAULT, dcpl_id, H5P_DEFAULT);
|
||||
if(mindset_id < 0) TEST_ERROR
|
||||
|
||||
/********************
|
||||
* TEST/DEMONSTRATE *
|
||||
********************/
|
||||
|
||||
/* -------------------
|
||||
* no attributes added
|
||||
*/
|
||||
|
||||
count = count_attributes(dset_id);
|
||||
if(count != 0) TEST_ERROR
|
||||
count = count_attributes(mindset_id);
|
||||
if(count != 0) TEST_ERROR
|
||||
|
||||
/* -----------------
|
||||
* add one attribute
|
||||
*/
|
||||
ret = put_attribute(dset_id, "PURPOSE", "DEMO", char_type_id, dspace_id, &attr_1_id);
|
||||
if(ret < 0) TEST_ERROR
|
||||
|
||||
ret = put_attribute(mindset_id, "PURPOSE", "DEMO", char_type_id, dspace_id, &attr_1a_id);
|
||||
if(ret < 0) TEST_ERROR
|
||||
|
||||
count = count_attributes(dset_id);
|
||||
if(count != 1) TEST_ERROR
|
||||
count = count_attributes(mindset_id);
|
||||
if(count != 1) TEST_ERROR
|
||||
|
||||
ret = H5Aread(attr_1_id, char_type_id, buffer);
|
||||
if(ret < 0) TEST_ERROR
|
||||
if(HDstrcmp("DEMO", buffer)) TEST_ERROR
|
||||
|
||||
ret = H5Aread(attr_1a_id, char_type_id, buffer);
|
||||
if(ret < 0) TEST_ERROR
|
||||
if(HDstrcmp("DEMO", buffer)) TEST_ERROR
|
||||
|
||||
/* -----------------
|
||||
* modify one attribute
|
||||
*/
|
||||
|
||||
ret = put_attribute(dset_id, "PURPOSE", "REWRITE", char_type_id, -1, &attr_1_id);
|
||||
if(ret < 0) TEST_ERROR
|
||||
|
||||
ret = put_attribute(mindset_id, "PURPOSE", "REWRITE", char_type_id, -1, &attr_1a_id);
|
||||
if(ret < 0) TEST_ERROR
|
||||
|
||||
count = count_attributes(dset_id);
|
||||
if(count != 1) TEST_ERROR
|
||||
count = count_attributes(mindset_id);
|
||||
if(count != 1) TEST_ERROR
|
||||
|
||||
ret = H5Aread(attr_1_id, char_type_id, buffer);
|
||||
if(ret < 0) TEST_ERROR
|
||||
if(HDstrcmp("REWRITE", buffer)) TEST_ERROR
|
||||
|
||||
ret = H5Aread(attr_1a_id, char_type_id, buffer);
|
||||
if(ret < 0) TEST_ERROR
|
||||
if(HDstrcmp("REWRITE", buffer)) TEST_ERROR
|
||||
|
||||
/* -----------------
|
||||
* add second attribute
|
||||
*/
|
||||
|
||||
a_out = 5;
|
||||
ret = put_attribute(dset_id, "RANK", &a_out, int_type_id, dspace_scalar_id, &attr_2_id);
|
||||
if(ret < 0) TEST_ERROR
|
||||
|
||||
a_out = 3;
|
||||
ret = put_attribute(mindset_id, "RANK", &a_out, int_type_id, dspace_scalar_id, &attr_2a_id);
|
||||
if(ret < 0) TEST_ERROR
|
||||
|
||||
count = count_attributes(dset_id);
|
||||
if(count != 2) TEST_ERROR
|
||||
count = count_attributes(mindset_id);
|
||||
if(count != 2) TEST_ERROR
|
||||
|
||||
ret = H5Aread(attr_2_id, int_type_id, &a_out);
|
||||
if(ret < 0) TEST_ERROR
|
||||
if(a_out != 5) TEST_ERROR
|
||||
|
||||
ret = H5Aread(attr_2a_id, int_type_id, &a_out);
|
||||
if(ret < 0) TEST_ERROR
|
||||
if(a_out != 3) TEST_ERROR
|
||||
|
||||
/* -----------------
|
||||
* add third attribute
|
||||
*/
|
||||
|
||||
a_out = -86;
|
||||
ret = put_attribute(dset_id, "FLAVOR", &a_out, int_type_id, dspace_scalar_id, &attr_3_id);
|
||||
if(ret < 0) TEST_ERROR
|
||||
|
||||
a_out = 2185;
|
||||
ret = put_attribute(mindset_id, "FLAVOR", &a_out, int_type_id, dspace_scalar_id, &attr_3a_id);
|
||||
if(ret < 0) TEST_ERROR
|
||||
|
||||
count = count_attributes(dset_id);
|
||||
if(count != 3) TEST_ERROR
|
||||
count = count_attributes(mindset_id);
|
||||
if(count != 3) TEST_ERROR
|
||||
|
||||
ret = H5Aread(attr_3_id, int_type_id, &a_out);
|
||||
if(ret < 0) TEST_ERROR
|
||||
if(a_out != -86) TEST_ERROR
|
||||
|
||||
ret = H5Aread(attr_3a_id, int_type_id, &a_out);
|
||||
if(ret < 0) TEST_ERROR
|
||||
if(a_out != 2185) TEST_ERROR
|
||||
|
||||
/************
|
||||
* TEARDOWN *
|
||||
************/
|
||||
|
||||
if(H5Tclose(int_type_id) < 0) TEST_ERROR
|
||||
if(H5Tclose(char_type_id) < 0) TEST_ERROR
|
||||
if(H5Pclose(dcpl_id) < 0) TEST_ERROR
|
||||
if(H5Sclose(dspace_id) < 0) TEST_ERROR
|
||||
if(H5Dclose(dset_id) < 0) TEST_ERROR
|
||||
if(H5Dclose(mindset_id) < 0) TEST_ERROR
|
||||
if(H5Aclose(attr_1_id) < 0) TEST_ERROR
|
||||
if(H5Aclose(attr_1a_id) < 0) TEST_ERROR
|
||||
if(H5Aclose(attr_2_id) < 0) TEST_ERROR
|
||||
if(H5Aclose(attr_2a_id) < 0) TEST_ERROR
|
||||
if(H5Aclose(attr_3_id) < 0) TEST_ERROR
|
||||
if(H5Aclose(attr_3a_id) < 0) TEST_ERROR
|
||||
if(H5Fclose(file_id) < 0) TEST_ERROR
|
||||
|
||||
PASSED()
|
||||
return SUCCEED;
|
||||
|
||||
error :
|
||||
H5E_BEGIN_TRY {
|
||||
(void)H5Tclose(int_type_id);
|
||||
(void)H5Tclose(char_type_id);
|
||||
(void)H5Pclose(dcpl_id);
|
||||
(void)H5Sclose(dspace_id);
|
||||
(void)H5Dclose(dset_id);
|
||||
(void)H5Dclose(mindset_id);
|
||||
(void)H5Aclose(attr_1_id);
|
||||
(void)H5Aclose(attr_1a_id);
|
||||
(void)H5Aclose(attr_2_id);
|
||||
(void)H5Aclose(attr_2a_id);
|
||||
(void)H5Aclose(attr_3_id);
|
||||
(void)H5Aclose(attr_3a_id);
|
||||
(void)H5Fclose(file_id);
|
||||
} H5E_END_TRY;
|
||||
return FAIL;
|
||||
} /* test_minimized_dset_ohdr_attribute_addition */
|
||||
|
||||
/*
|
||||
* Compare header sizes against when headers have been minimized.
|
||||
* Repeats tests with headers "compact" and normal.
|
||||
*/
|
||||
static herr_t
|
||||
test_minimized_dset_ohdr_size_comparisons(hid_t fapl_id)
|
||||
{
|
||||
hsize_t array_10[1] = {10}; /* dataspace extents */
|
||||
unsigned compact = 0;
|
||||
|
||||
/* IDs that are file-agnostic */
|
||||
hid_t dspace_id = -1;
|
||||
hid_t int_type_id = -1;
|
||||
hid_t dcpl_minimize = -1;
|
||||
hid_t dcpl_dontmin = -1;
|
||||
hid_t dcpl_default = -1;
|
||||
|
||||
/* IDs for non-minimized file open */
|
||||
hid_t file_f_id = -1; /* lower 'f' for standard file setting */
|
||||
hid_t dset_f_x_id = -1; /* 'x' for default */
|
||||
hid_t dset_f_N_id = -1; /* 'N' for explcit non-minimized dset */
|
||||
hid_t dset_f_Y_id = -1; /* 'Y' for minimized dset */
|
||||
|
||||
/* IDs for minimized file open */
|
||||
hid_t file_F_id = -1; /* upper 'F' for minimized file setting */
|
||||
hid_t dset_F_x_id = -1; /* 'x' for default */
|
||||
hid_t dset_F_N_id = -1; /* 'N' for explcit non-minimized dset */
|
||||
hid_t dset_F_Y_id = -1; /* 'Y' for minimized dset */
|
||||
|
||||
char filename_a[512] = "";
|
||||
char filename_b[512] = "";
|
||||
|
||||
herr_t ret;
|
||||
|
||||
/* dataset suffixes:
|
||||
* | default | minimize | don't minimize (dcpl-set)
|
||||
* ---------------+---------+----------+---------------
|
||||
* file-default | f_x | f_Y | f_N
|
||||
* ---------------+---------+----------+---------------
|
||||
* file-minimized | F_x | F_Y | F_N
|
||||
*/
|
||||
|
||||
TESTING("minimized dset object headers size comparisons");
|
||||
|
||||
/*********
|
||||
* SETUP *
|
||||
*********/
|
||||
|
||||
if(h5_fixname(FILENAME[1], H5P_DEFAULT, filename_a, sizeof(filename_a)) == NULL)
|
||||
TEST_ERROR
|
||||
|
||||
if(h5_fixname(FILENAME[2], H5P_DEFAULT, filename_b, sizeof(filename_b)) == NULL)
|
||||
TEST_ERROR
|
||||
|
||||
for (compact = 0; compact < 2; compact++) { /* 0 or 1 */
|
||||
dcpl_default = H5Pcreate(H5P_DATASET_CREATE);
|
||||
if(dcpl_default < 0) TEST_ERROR
|
||||
|
||||
dcpl_minimize = H5Pcreate(H5P_DATASET_CREATE);
|
||||
if(dcpl_minimize < 0) TEST_ERROR
|
||||
ret = H5Pset_dset_no_attrs_hint(dcpl_minimize, TRUE);
|
||||
if(ret < 0) TEST_ERROR
|
||||
|
||||
dcpl_dontmin = H5Pcreate(H5P_DATASET_CREATE);
|
||||
if(dcpl_dontmin < 0) TEST_ERROR
|
||||
ret = H5Pset_dset_no_attrs_hint(dcpl_dontmin, FALSE);
|
||||
if(ret < 0) TEST_ERROR
|
||||
|
||||
if(compact) {
|
||||
HDprintf("...compact ");
|
||||
ret = H5Pset_layout(dcpl_default, H5D_COMPACT);
|
||||
if(ret < 0) TEST_ERROR
|
||||
ret = H5Pset_layout(dcpl_minimize, H5D_COMPACT);
|
||||
if(ret < 0) TEST_ERROR
|
||||
ret = H5Pset_layout(dcpl_dontmin, H5D_COMPACT);
|
||||
if(ret < 0) TEST_ERROR
|
||||
} else
|
||||
HDprintf("...not compact ");
|
||||
|
||||
dspace_id = H5Screate_simple(1, array_10, NULL);
|
||||
if(dspace_id < 0) TEST_ERROR
|
||||
|
||||
int_type_id = H5Tcopy(H5T_NATIVE_INT);
|
||||
if(int_type_id < 0) TEST_ERROR
|
||||
|
||||
file_f_id = H5Fcreate(filename_a, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id);
|
||||
if(file_f_id < 0) TEST_ERROR
|
||||
|
||||
dset_f_x_id = H5Dcreate(file_f_id, "default", int_type_id, dspace_id, H5P_DEFAULT, dcpl_default, H5P_DEFAULT);
|
||||
if(dset_f_x_id < 0) TEST_ERROR
|
||||
|
||||
dset_f_N_id = H5Dcreate(file_f_id, "dsetNOT", int_type_id, dspace_id, H5P_DEFAULT, dcpl_dontmin, H5P_DEFAULT);
|
||||
if(dset_f_N_id < 0) TEST_ERROR
|
||||
|
||||
dset_f_Y_id = H5Dcreate(file_f_id, "dsetMIN", int_type_id, dspace_id, H5P_DEFAULT, dcpl_minimize, H5P_DEFAULT);
|
||||
if(dset_f_x_id < 0) TEST_ERROR
|
||||
|
||||
file_F_id = H5Fcreate(filename_b, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id);
|
||||
if(file_F_id < 0) TEST_ERROR
|
||||
ret = H5Fset_dset_no_attrs_hint(file_F_id, TRUE);
|
||||
if(ret < 0) TEST_ERROR
|
||||
|
||||
dset_F_x_id = H5Dcreate(file_F_id, "default", int_type_id, dspace_id, H5P_DEFAULT, dcpl_default, H5P_DEFAULT);
|
||||
if(dset_F_x_id < 0) TEST_ERROR
|
||||
|
||||
dset_F_N_id = H5Dcreate(file_F_id, "dsetNOT", int_type_id, dspace_id, H5P_DEFAULT, dcpl_dontmin, H5P_DEFAULT);
|
||||
if(dset_F_N_id < 0) TEST_ERROR
|
||||
|
||||
dset_F_Y_id = H5Dcreate(file_F_id, "dsetMIN", int_type_id, dspace_id, H5P_DEFAULT, dcpl_minimize, H5P_DEFAULT);
|
||||
if(dset_F_Y_id < 0) TEST_ERROR
|
||||
|
||||
/*********
|
||||
* TESTS *
|
||||
*********/
|
||||
|
||||
if(oh_compare(dset_f_x_id, dset_f_x_id) != EQ) TEST_ERROR /* identity */
|
||||
|
||||
if(oh_compare(dset_f_x_id, dset_f_N_id) != EQ) TEST_ERROR
|
||||
if(oh_compare(dset_f_x_id, dset_f_Y_id) != GT) TEST_ERROR
|
||||
if(oh_compare(dset_f_N_id, dset_f_Y_id) != GT) TEST_ERROR
|
||||
|
||||
if(oh_compare(dset_F_x_id, dset_F_N_id) != EQ) TEST_ERROR
|
||||
if(oh_compare(dset_F_x_id, dset_F_Y_id) != EQ) TEST_ERROR
|
||||
if(oh_compare(dset_F_N_id, dset_F_Y_id) != EQ) TEST_ERROR
|
||||
|
||||
if(oh_compare(dset_F_x_id, dset_f_Y_id) != EQ) TEST_ERROR
|
||||
if(oh_compare(dset_F_x_id, dset_f_x_id) != LT) TEST_ERROR
|
||||
|
||||
/************
|
||||
* TEARDOWN *
|
||||
************/
|
||||
|
||||
if(H5Sclose(dspace_id) < 0) TEST_ERROR
|
||||
if(H5Tclose(int_type_id) < 0) TEST_ERROR
|
||||
if(H5Pclose(dcpl_default) < 0) TEST_ERROR
|
||||
if(H5Pclose(dcpl_minimize) < 0) TEST_ERROR
|
||||
if(H5Pclose(dcpl_dontmin) < 0) TEST_ERROR
|
||||
|
||||
if(H5Fclose(file_f_id) < 0) TEST_ERROR
|
||||
if(H5Dclose(dset_f_x_id) < 0) TEST_ERROR
|
||||
if(H5Dclose(dset_f_N_id) < 0) TEST_ERROR
|
||||
if(H5Dclose(dset_f_Y_id) < 0) TEST_ERROR
|
||||
|
||||
if(H5Fclose(file_F_id) < 0) TEST_ERROR
|
||||
if(H5Dclose(dset_F_x_id) < 0) TEST_ERROR
|
||||
if(H5Dclose(dset_F_N_id) < 0) TEST_ERROR
|
||||
if(H5Dclose(dset_F_Y_id) < 0) TEST_ERROR
|
||||
|
||||
} /* compact and non-compact */
|
||||
|
||||
PASSED()
|
||||
return SUCCEED;
|
||||
|
||||
error :
|
||||
H5E_BEGIN_TRY {
|
||||
(void)H5Pclose(dcpl_default);
|
||||
(void)H5Pclose(dcpl_minimize);
|
||||
(void)H5Pclose(dcpl_dontmin);
|
||||
(void)H5Sclose(dspace_id);
|
||||
(void)H5Tclose(int_type_id);
|
||||
|
||||
(void)H5Fclose(file_f_id);
|
||||
(void)H5Dclose(dset_f_x_id);
|
||||
(void)H5Dclose(dset_f_N_id);
|
||||
(void)H5Dclose(dset_f_Y_id);
|
||||
|
||||
(void)H5Fclose(file_F_id);
|
||||
(void)H5Dclose(dset_F_x_id);
|
||||
(void)H5Dclose(dset_F_N_id);
|
||||
(void)H5Dclose(dset_F_Y_id);
|
||||
} H5E_END_TRY;
|
||||
return FAIL;
|
||||
} /* test_minimized_dset_ohdr_size_comparisons */
|
||||
|
||||
/*
|
||||
* Test minimized dataset object header with filter/pipeline message
|
||||
*/
|
||||
static herr_t
|
||||
test_minimized_dset_ohdr_with_filter(hid_t fapl_id)
|
||||
{
|
||||
char filename[512] = "";
|
||||
const hsize_t extents[1] = {1024}; /* extents of dataspace */
|
||||
const unsigned filter_values[] = {0}; /* TBD */
|
||||
const hsize_t chunk_dim[] = {32}; /* needed for filter */
|
||||
const int ndims = 1;
|
||||
hid_t dspace_id = -1;
|
||||
hid_t dtype_id = -1;
|
||||
hid_t dcpl_xZ_id = -1;
|
||||
hid_t dcpl_mx_id = -1;
|
||||
hid_t dcpl_mZ_id = -1;
|
||||
hid_t dset_xx_id = -1;
|
||||
hid_t dset_xZ_id = -1;
|
||||
hid_t dset_mx_id = -1;
|
||||
hid_t dset_mZ_id = -1;
|
||||
hid_t file_id = -1;
|
||||
herr_t ret;
|
||||
|
||||
/* dcpl suffixes:
|
||||
* | default | minimize
|
||||
* ----------+---------+---------
|
||||
* no filter | xx | mx
|
||||
* ----------+---------+---------
|
||||
* filter | xZ | mZ
|
||||
*/
|
||||
|
||||
TESTING("minimized dset object headers with filter message");
|
||||
|
||||
/*********
|
||||
* SETUP *
|
||||
*********/
|
||||
|
||||
if(h5_fixname(FILENAME[1], H5P_DEFAULT, filename, sizeof(filename)) == NULL)
|
||||
TEST_ERROR
|
||||
|
||||
dcpl_mx_id = H5Pcreate(H5P_DATASET_CREATE);
|
||||
if(dcpl_mx_id < 0) TEST_ERROR
|
||||
ret = H5Pset_dset_no_attrs_hint(dcpl_mx_id, TRUE);
|
||||
if(ret < 0) TEST_ERROR
|
||||
|
||||
dcpl_xZ_id = H5Pcreate(H5P_DATASET_CREATE);
|
||||
if(dcpl_xZ_id < 0) TEST_ERROR
|
||||
ret = H5Pset_chunk(dcpl_xZ_id, ndims, chunk_dim);
|
||||
if(ret < 0) TEST_ERROR
|
||||
ret = H5Pset_filter(dcpl_xZ_id, H5Z_FILTER_DEFLATE, H5Z_FLAG_OPTIONAL, 0, filter_values);
|
||||
if(ret < 0) TEST_ERROR
|
||||
dcpl_mZ_id = H5Pcreate(H5P_DATASET_CREATE);
|
||||
if(dcpl_mZ_id < 0) TEST_ERROR
|
||||
ret = H5Pset_dset_no_attrs_hint(dcpl_mZ_id, TRUE);
|
||||
if(ret < 0) TEST_ERROR
|
||||
ret = H5Pset_chunk(dcpl_mZ_id, ndims, chunk_dim);
|
||||
if(ret < 0) TEST_ERROR
|
||||
ret = H5Pset_filter( dcpl_mZ_id, H5Z_FILTER_DEFLATE, H5Z_FLAG_OPTIONAL, 0, filter_values);
|
||||
if(ret < 0) TEST_ERROR
|
||||
|
||||
dspace_id = H5Screate_simple(1, extents, extents);
|
||||
if(dspace_id < 0) TEST_ERROR
|
||||
|
||||
dtype_id = H5Tcopy(H5T_NATIVE_INT);
|
||||
if(dtype_id < 0) TEST_ERROR
|
||||
|
||||
file_id = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id);
|
||||
if(file_id < 0) TEST_ERROR
|
||||
|
||||
dset_xx_id = H5Dcreate(file_id, "xx", dtype_id, dspace_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
|
||||
if(dset_xx_id < 0) TEST_ERROR
|
||||
|
||||
dset_mx_id = H5Dcreate(file_id, "Mx", dtype_id, dspace_id, H5P_DEFAULT, dcpl_mx_id, H5P_DEFAULT);
|
||||
if(dset_mx_id < 0) TEST_ERROR
|
||||
|
||||
dset_xZ_id = H5Dcreate(file_id, "xZ", dtype_id, dspace_id, H5P_DEFAULT, dcpl_xZ_id, H5P_DEFAULT);
|
||||
if(dset_xZ_id < 0) TEST_ERROR
|
||||
|
||||
dset_mZ_id = H5Dcreate(file_id, "MZ", dtype_id, dspace_id, H5P_DEFAULT, dcpl_mZ_id, H5P_DEFAULT);
|
||||
if(dset_mZ_id < 0) TEST_ERROR
|
||||
|
||||
/*********
|
||||
* TESTS *
|
||||
*********/
|
||||
|
||||
if(oh_compare(dset_mx_id, dset_xx_id) != LT) TEST_ERROR
|
||||
if(oh_compare(dset_mx_id, dset_xZ_id) != LT) TEST_ERROR
|
||||
if(oh_compare(dset_mZ_id, dset_mx_id) != GT) TEST_ERROR
|
||||
if(oh_compare(dset_mZ_id, dset_xZ_id) != LT) TEST_ERROR
|
||||
|
||||
/************
|
||||
* TEARDOWN *
|
||||
************/
|
||||
|
||||
if(H5Sclose(dspace_id) < 0) TEST_ERROR
|
||||
if(H5Tclose(dtype_id) < 0) TEST_ERROR
|
||||
if(H5Pclose(dcpl_xZ_id) < 0) TEST_ERROR
|
||||
if(H5Pclose(dcpl_mx_id) < 0) TEST_ERROR
|
||||
if(H5Pclose(dcpl_mZ_id) < 0) TEST_ERROR
|
||||
if(H5Dclose(dset_xx_id) < 0) TEST_ERROR
|
||||
if(H5Dclose(dset_xZ_id) < 0) TEST_ERROR
|
||||
if(H5Dclose(dset_mx_id) < 0) TEST_ERROR
|
||||
if(H5Dclose(dset_mZ_id) < 0) TEST_ERROR
|
||||
if(H5Fclose(file_id) < 0) TEST_ERROR
|
||||
|
||||
PASSED()
|
||||
return SUCCEED;
|
||||
|
||||
error:
|
||||
H5E_BEGIN_TRY {
|
||||
(void)H5Sclose(dspace_id);
|
||||
(void)H5Tclose(dtype_id);
|
||||
(void)H5Pclose(dcpl_xZ_id);
|
||||
(void)H5Pclose(dcpl_mx_id);
|
||||
(void)H5Pclose(dcpl_mZ_id);
|
||||
(void)H5Dclose(dset_xx_id);
|
||||
(void)H5Dclose(dset_xZ_id);
|
||||
(void)H5Dclose(dset_mx_id);
|
||||
(void)H5Dclose(dset_mZ_id);
|
||||
(void)H5Fclose(file_id);
|
||||
} H5E_END_TRY;
|
||||
return FAIL;
|
||||
} /* test_minimized_dset_ohdr_with_filter */
|
||||
|
||||
/*
|
||||
* Test minimized dataset object header and recording modification times.
|
||||
*/
|
||||
static herr_t
|
||||
test_minimized_dset_ohdr_modification_times(hid_t _fapl_id)
|
||||
{
|
||||
/* test-local structure for parameterized testing
|
||||
*/
|
||||
struct testcase {
|
||||
unsigned oh_version;
|
||||
};
|
||||
|
||||
char filename[512] = "";
|
||||
const hsize_t extents[1] = {128}; /* extents of dataspace */
|
||||
hid_t dspace_id = -1;
|
||||
hid_t dtype_id = -1;
|
||||
hid_t dcpl_xT_id = -1; /* Track modtime */
|
||||
hid_t dcpl_mx_id = -1; /* minimized */
|
||||
hid_t dcpl_mT_id = -1; /* minimized, Track */
|
||||
hid_t dcpl_mN_id = -1; /* minimized, do Not track */
|
||||
hid_t dset_xx_id = -1;
|
||||
hid_t dset_xT_id = -1;
|
||||
hid_t dset_mx_id = -1;
|
||||
hid_t dset_mT_id = -1;
|
||||
hid_t dset_mN_id = -1;
|
||||
hid_t file_id = -1;
|
||||
hid_t fapl_id = -1;
|
||||
herr_t ret;
|
||||
|
||||
unsigned i = 0; /* for testcase loop */
|
||||
unsigned n_cases = 2; /* must match `cases` array size below */
|
||||
struct testcase cases[2] = {
|
||||
{ 1, }, /* version 1 object header */
|
||||
{ 2, }, /* version 2 object header */
|
||||
};
|
||||
|
||||
/* dcpl suffixes:
|
||||
* | default | minimize
|
||||
* ------------+---------+---------
|
||||
* default | xx | mx
|
||||
* ------------+---------+---------
|
||||
* don't track | xN | mN
|
||||
* ------------+---------+---------
|
||||
* track | xT | mT
|
||||
*/
|
||||
|
||||
TESTING("minimized dset object headers with modification times");
|
||||
|
||||
/*********
|
||||
* SETUP *
|
||||
*********/
|
||||
|
||||
if(h5_fixname(FILENAME[1], H5P_DEFAULT, filename, sizeof(filename)) == NULL)
|
||||
TEST_ERROR
|
||||
|
||||
dcpl_mx_id = H5Pcreate(H5P_DATASET_CREATE);
|
||||
if(dcpl_mx_id < 0) TEST_ERROR
|
||||
ret = H5Pset_dset_no_attrs_hint(dcpl_mx_id, TRUE);
|
||||
if(ret < 0) TEST_ERROR
|
||||
|
||||
dcpl_xT_id = H5Pcreate(H5P_DATASET_CREATE);
|
||||
if(dcpl_xT_id < 0) TEST_ERROR
|
||||
ret = H5Pset_obj_track_times(dcpl_xT_id, TRUE);
|
||||
if(ret < 0) TEST_ERROR
|
||||
|
||||
dcpl_mT_id = H5Pcreate(H5P_DATASET_CREATE);
|
||||
if(dcpl_mT_id < 0) TEST_ERROR
|
||||
ret = H5Pset_dset_no_attrs_hint(dcpl_mT_id, TRUE);
|
||||
if(ret < 0) TEST_ERROR
|
||||
ret = H5Pset_obj_track_times(dcpl_mT_id, TRUE);
|
||||
if(ret < 0) TEST_ERROR
|
||||
|
||||
dcpl_mN_id = H5Pcreate(H5P_DATASET_CREATE);
|
||||
if(dcpl_mN_id < 0) TEST_ERROR
|
||||
ret = H5Pset_dset_no_attrs_hint(dcpl_mN_id, TRUE);
|
||||
if(ret < 0) TEST_ERROR
|
||||
ret = H5Pset_obj_track_times(dcpl_mN_id, FALSE);
|
||||
if(ret < 0) TEST_ERROR
|
||||
|
||||
dspace_id = H5Screate_simple(1, extents, extents);
|
||||
if(dspace_id < 0) TEST_ERROR
|
||||
|
||||
dtype_id = H5Tcopy(H5T_NATIVE_INT);
|
||||
if(dtype_id < 0) TEST_ERROR
|
||||
|
||||
for (i = 0; i < n_cases; i++) {
|
||||
|
||||
/* -------------- *
|
||||
* per-case setup *
|
||||
* -------------- */
|
||||
|
||||
fapl_id = H5Pcopy(_fapl_id);
|
||||
if(fapl_id < 0) TEST_ERROR
|
||||
|
||||
if(cases[i].oh_version > 1) {
|
||||
fapl_id = H5Pcreate(H5P_FILE_ACCESS);
|
||||
if(fapl_id < 0) TEST_ERROR
|
||||
ret = H5Pset_libver_bounds(fapl_id, H5F_LIBVER_V18, H5F_LIBVER_V110);
|
||||
if(ret < 0) TEST_ERROR
|
||||
}
|
||||
|
||||
file_id = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id);
|
||||
if(file_id < 0) TEST_ERROR
|
||||
|
||||
dset_xx_id = H5Dcreate( file_id, "xx", dtype_id, dspace_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
|
||||
if(dset_xx_id < 0) TEST_ERROR
|
||||
|
||||
dset_mx_id = H5Dcreate(file_id, "mx", dtype_id, dspace_id, H5P_DEFAULT, dcpl_mx_id, H5P_DEFAULT);
|
||||
if(dset_mx_id < 0) TEST_ERROR
|
||||
|
||||
dset_xT_id = H5Dcreate(file_id, "xT", dtype_id, dspace_id, H5P_DEFAULT, dcpl_xT_id, H5P_DEFAULT);
|
||||
if(dset_xT_id < 0) TEST_ERROR
|
||||
dset_mT_id = H5Dcreate(file_id, "mT", dtype_id, dspace_id, H5P_DEFAULT, dcpl_mT_id, H5P_DEFAULT);
|
||||
if(dset_mT_id < 0) TEST_ERROR
|
||||
|
||||
dset_mN_id = H5Dcreate(file_id, "mN", dtype_id, dspace_id, H5P_DEFAULT, dcpl_mN_id, H5P_DEFAULT);
|
||||
if(dset_mN_id < 0) TEST_ERROR
|
||||
|
||||
/* ----- *
|
||||
* TESTS *
|
||||
* ----- */
|
||||
|
||||
/* sanity check */
|
||||
if(oh_compare(dset_mx_id, dset_xx_id) != LT) TEST_ERROR
|
||||
if(oh_compare(dset_mx_id, dset_xT_id) != LT) TEST_ERROR
|
||||
|
||||
if(oh_compare(dset_xx_id, dset_xT_id) != EQ) TEST_ERROR
|
||||
if(oh_compare(dset_mx_id, dset_mT_id) != EQ) TEST_ERROR
|
||||
if(oh_compare(dset_mN_id, dset_mT_id) != LT) TEST_ERROR
|
||||
|
||||
if(oh_compare(dset_mT_id, dset_xT_id) != LT) TEST_ERROR
|
||||
|
||||
/* ----------------- *
|
||||
* per-case teardown *
|
||||
* ----------------- */
|
||||
|
||||
if(H5Dclose(dset_xx_id) < 0) TEST_ERROR
|
||||
if(H5Dclose(dset_xT_id) < 0) TEST_ERROR
|
||||
if(H5Dclose(dset_mx_id) < 0) TEST_ERROR
|
||||
if(H5Dclose(dset_mT_id) < 0) TEST_ERROR
|
||||
if(H5Dclose(dset_mN_id) < 0) TEST_ERROR
|
||||
if(H5Fclose(file_id) < 0) TEST_ERROR
|
||||
if(H5Pclose(fapl_id) < 0) TEST_ERROR
|
||||
|
||||
} /* for each version tested */
|
||||
|
||||
/************
|
||||
* TEARDOWN *
|
||||
************/
|
||||
|
||||
if(H5Sclose(dspace_id) < 0) TEST_ERROR
|
||||
if(H5Tclose(dtype_id) < 0) TEST_ERROR
|
||||
if(H5Pclose(dcpl_xT_id) < 0) TEST_ERROR
|
||||
if(H5Pclose(dcpl_mx_id) < 0) TEST_ERROR
|
||||
if(H5Pclose(dcpl_mT_id) < 0) TEST_ERROR
|
||||
if(H5Pclose(dcpl_mN_id) < 0) TEST_ERROR
|
||||
|
||||
PASSED()
|
||||
return SUCCEED;
|
||||
|
||||
error:
|
||||
H5E_BEGIN_TRY {
|
||||
(void)H5Sclose(dspace_id);
|
||||
(void)H5Tclose(dtype_id);
|
||||
(void)H5Pclose(dcpl_xT_id);
|
||||
(void)H5Pclose(dcpl_mx_id);
|
||||
(void)H5Pclose(dcpl_mT_id);
|
||||
(void)H5Pclose(dcpl_mN_id);
|
||||
(void)H5Dclose(dset_xx_id);
|
||||
(void)H5Dclose(dset_xT_id);
|
||||
(void)H5Dclose(dset_mx_id);
|
||||
(void)H5Dclose(dset_mT_id);
|
||||
(void)H5Dclose(dset_mN_id);
|
||||
(void)H5Fclose(file_id);
|
||||
(void)H5Pclose(fapl_id);
|
||||
} H5E_END_TRY;
|
||||
return FAIL;
|
||||
} /* test_minimized_dset_ohdr_modification_times */
|
||||
|
||||
/*
|
||||
* Test minimized dataset object header with a fill value set.
|
||||
*/
|
||||
static herr_t
|
||||
test_minimized_dset_ohdr_fillvalue_backwards_compatability(hid_t _fapl_id)
|
||||
{
|
||||
char filename[512] = "";
|
||||
const hsize_t extents[1] = {64}; /* extents of dataspace */
|
||||
const int fill[1] = {343}; /* fill value of dataset */
|
||||
hid_t file_id = -1;
|
||||
hid_t dtype_id = -1;
|
||||
hid_t dspace_id = -1;
|
||||
hid_t dcpl_id = -1;
|
||||
hid_t fapl_id = -1;
|
||||
hid_t dset_0_id = -1;
|
||||
hid_t dset_1_id = -1;
|
||||
herr_t ret;
|
||||
|
||||
/*********
|
||||
* SETUP *
|
||||
*********/
|
||||
|
||||
TESTING("minimized dset object headers with fill values and different libver support");
|
||||
|
||||
if(h5_fixname(FILENAME[1], H5P_DEFAULT, filename, sizeof(filename)) == NULL)
|
||||
TEST_ERROR
|
||||
|
||||
dspace_id = H5Screate_simple(1, extents, extents);
|
||||
if(dspace_id < 0) TEST_ERROR
|
||||
|
||||
dtype_id = H5Tcopy(H5T_NATIVE_INT);
|
||||
if(dtype_id < 0) TEST_ERROR
|
||||
|
||||
dcpl_id = H5Pcreate(H5P_DATASET_CREATE);
|
||||
if(dcpl_id < 0) TEST_ERROR
|
||||
|
||||
ret = H5Pset_dset_no_attrs_hint(dcpl_id, TRUE);
|
||||
if(ret == FAIL) TEST_ERROR;
|
||||
|
||||
ret = H5Pset_fill_value(dcpl_id, dtype_id, fill);
|
||||
if(ret == FAIL) TEST_ERROR;
|
||||
|
||||
fapl_id = H5Pcopy(_fapl_id);
|
||||
if(fapl_id < 0) TEST_ERROR
|
||||
|
||||
ret = H5Pset_libver_bounds(fapl_id, H5F_LIBVER_EARLIEST, H5F_LIBVER_LATEST);
|
||||
if(ret == FAIL) TEST_ERROR;
|
||||
|
||||
file_id = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id);
|
||||
if(file_id < 0) TEST_ERROR
|
||||
|
||||
dset_0_id = H5Dcreate(file_id, "fullrange", dtype_id, dspace_id, H5P_DEFAULT, dcpl_id, H5P_DEFAULT);
|
||||
if(dset_0_id < 0) TEST_ERROR
|
||||
|
||||
/* Close file and re-open with different libver bounds.
|
||||
* Dataset "fullrange" must also be closed for expected reopen behavior.
|
||||
*/
|
||||
if(H5Fclose(file_id) < 0) TEST_ERROR;
|
||||
if(H5Dclose(dset_0_id) < 0) TEST_ERROR
|
||||
|
||||
ret = H5Pset_libver_bounds(fapl_id, H5F_LIBVER_V18, H5F_LIBVER_LATEST);
|
||||
if(ret == FAIL) TEST_ERROR;
|
||||
|
||||
file_id = H5Fopen(filename, H5F_ACC_RDWR, fapl_id);
|
||||
if(file_id < 0) TEST_ERROR
|
||||
|
||||
dset_1_id = H5Dcreate(file_id, "upperrange", dtype_id, dspace_id, H5P_DEFAULT, dcpl_id, H5P_DEFAULT);
|
||||
if(dset_1_id < 0) TEST_ERROR
|
||||
|
||||
/* re-open "fullrange" dataset
|
||||
*/
|
||||
dset_0_id = H5Dopen2(file_id, "fullrange", H5P_DEFAULT);
|
||||
if(dset_0_id < 0) TEST_ERROR
|
||||
|
||||
/*********
|
||||
* TESTS *
|
||||
*********/
|
||||
|
||||
/* dset not supporting pre-1.08 should be smaller? */
|
||||
if(oh_compare(dset_1_id, dset_0_id) != LT) TEST_ERROR
|
||||
|
||||
/************
|
||||
* TEARDOWN *
|
||||
************/
|
||||
|
||||
if(H5Sclose(dspace_id) < 0) TEST_ERROR
|
||||
if(H5Tclose(dtype_id) < 0) TEST_ERROR
|
||||
if(H5Pclose(dcpl_id) < 0) TEST_ERROR
|
||||
if(H5Pclose(fapl_id) < 0) TEST_ERROR
|
||||
if(H5Dclose(dset_0_id) < 0) TEST_ERROR
|
||||
if(H5Dclose(dset_1_id) < 0) TEST_ERROR
|
||||
if(H5Fclose(file_id) < 0) TEST_ERROR;
|
||||
|
||||
PASSED()
|
||||
return SUCCEED;
|
||||
|
||||
error:
|
||||
H5E_BEGIN_TRY {
|
||||
(void)H5Sclose(dspace_id);
|
||||
(void)H5Tclose(dtype_id);
|
||||
(void)H5Pclose(dcpl_id);
|
||||
(void)H5Pclose(fapl_id);
|
||||
(void)H5Dclose(dset_0_id);
|
||||
(void)H5Dclose(dset_1_id);
|
||||
(void)H5Fclose(file_id);
|
||||
} H5E_END_TRY;
|
||||
return FAIL;
|
||||
} /* test_minimized_dset_ohdr_fillvalue_backwards_compatability */
|
||||
|
||||
#define STR_EARLIEST "earliest"
|
||||
#define STR_V18 "v18"
|
||||
#define STR_LATEST "latest"
|
||||
@ -1030,6 +1916,21 @@ main(void)
|
||||
if(test_ohdr_cache(filename, fapl) < 0)
|
||||
TEST_ERROR
|
||||
|
||||
if(test_minimized_dset_ohdr_attribute_addition(fapl) < 0)
|
||||
TEST_ERROR
|
||||
|
||||
if(test_minimized_dset_ohdr_size_comparisons(fapl) < 0)
|
||||
TEST_ERROR
|
||||
|
||||
if(test_minimized_dset_ohdr_with_filter(fapl) < 0)
|
||||
TEST_ERROR
|
||||
|
||||
if(test_minimized_dset_ohdr_modification_times(fapl) < 0)
|
||||
TEST_ERROR
|
||||
|
||||
if(test_minimized_dset_ohdr_fillvalue_backwards_compatability(fapl) < 0)
|
||||
TEST_ERROR
|
||||
|
||||
} /* high */
|
||||
} /* low */
|
||||
|
||||
|
518
test/tattr.c
518
test/tattr.c
@ -165,6 +165,12 @@ typedef struct {
|
||||
static herr_t attr_op1(hid_t loc_id, const char *name, const H5A_info_t *ainfo,
|
||||
void *op_data);
|
||||
|
||||
/* Global dcpl ID, can be re-set as a generated dcpl for various operations
|
||||
* across multiple tests.
|
||||
* e.g., minimized dataset object headers
|
||||
*/
|
||||
static hid_t dcpl_g = H5P_DEFAULT;
|
||||
|
||||
|
||||
|
||||
/****************************************************************
|
||||
@ -204,7 +210,7 @@ test_attr_basic_write(hid_t fapl)
|
||||
CHECK(sid1, FAIL, "H5Screate_simple");
|
||||
|
||||
/* Create a dataset */
|
||||
dataset = H5Dcreate2(fid1, DSET1_NAME, H5T_NATIVE_UCHAR, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
|
||||
dataset = H5Dcreate2(fid1, DSET1_NAME, H5T_NATIVE_UCHAR, sid1, H5P_DEFAULT, dcpl_g, H5P_DEFAULT);
|
||||
CHECK(dataset, FAIL, "H5Dcreate2");
|
||||
|
||||
/* Create dataspace for attribute */
|
||||
@ -524,7 +530,7 @@ test_attr_flush(hid_t fapl)
|
||||
spc = H5Screate(H5S_SCALAR);
|
||||
CHECK(spc, FAIL, "H5Screate");
|
||||
|
||||
set = H5Dcreate2(fil, DSET1_NAME, H5T_NATIVE_DOUBLE, spc, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
|
||||
set = H5Dcreate2(fil, DSET1_NAME, H5T_NATIVE_DOUBLE, spc, H5P_DEFAULT, dcpl_g, H5P_DEFAULT);
|
||||
CHECK(set, FAIL, "H5Dcreate2");
|
||||
|
||||
att = H5Acreate2(set, ATTR1_NAME, H5T_NATIVE_DOUBLE, spc, H5P_DEFAULT, H5P_DEFAULT);
|
||||
@ -595,7 +601,7 @@ test_attr_plist(hid_t fapl)
|
||||
CHECK(sid1, FAIL, "H5Screate_simple");
|
||||
|
||||
/* Create a dataset */
|
||||
dataset = H5Dcreate2(fid1, DSET1_NAME, H5T_NATIVE_UCHAR, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
|
||||
dataset = H5Dcreate2(fid1, DSET1_NAME, H5T_NATIVE_UCHAR, sid1, H5P_DEFAULT, dcpl_g, H5P_DEFAULT);
|
||||
CHECK(dataset, FAIL, "H5Dcreate2");
|
||||
|
||||
/* Create dataspace for attribute */
|
||||
@ -709,7 +715,7 @@ test_attr_compound_write(hid_t fapl)
|
||||
CHECK(sid1, FAIL, "H5Screate_simple");
|
||||
|
||||
/* Create a dataset */
|
||||
dataset = H5Dcreate2(fid1, DSET1_NAME, H5T_NATIVE_UCHAR, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
|
||||
dataset = H5Dcreate2(fid1, DSET1_NAME, H5T_NATIVE_UCHAR, sid1, H5P_DEFAULT, dcpl_g, H5P_DEFAULT);
|
||||
CHECK(dataset, FAIL, "H5Dcreate2");
|
||||
|
||||
/* Close dataset's dataspace */
|
||||
@ -945,7 +951,7 @@ test_attr_scalar_write(hid_t fapl)
|
||||
CHECK(sid1, FAIL, "H5Screate_simple");
|
||||
|
||||
/* Create a dataset */
|
||||
dataset = H5Dcreate2(fid1, DSET1_NAME, H5T_NATIVE_UCHAR, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
|
||||
dataset = H5Dcreate2(fid1, DSET1_NAME, H5T_NATIVE_UCHAR, sid1, H5P_DEFAULT, dcpl_g, H5P_DEFAULT);
|
||||
CHECK(dataset, FAIL, "H5Dcreate2");
|
||||
|
||||
/* Create dataspace for attribute */
|
||||
@ -1086,7 +1092,7 @@ test_attr_mult_write(hid_t fapl)
|
||||
CHECK(sid1, FAIL, "H5Screate_simple");
|
||||
|
||||
/* Create a dataset */
|
||||
dataset = H5Dcreate2(fid1, DSET1_NAME, H5T_NATIVE_UCHAR, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
|
||||
dataset = H5Dcreate2(fid1, DSET1_NAME, H5T_NATIVE_UCHAR, sid1, H5P_DEFAULT, dcpl_g, H5P_DEFAULT);
|
||||
CHECK(dataset, FAIL, "H5Dcreate2");
|
||||
|
||||
/* Close dataset's dataspace */
|
||||
@ -1464,7 +1470,7 @@ test_attr_iterate(hid_t fapl)
|
||||
CHECK(sid, FAIL, "H5Screate");
|
||||
|
||||
/* Create a new dataset */
|
||||
dataset = H5Dcreate2(file, DSET2_NAME, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
|
||||
dataset = H5Dcreate2(file, DSET2_NAME, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl_g, H5P_DEFAULT);
|
||||
CHECK(dataset, FAIL, "H5Dcreate2");
|
||||
|
||||
/* Close dataspace */
|
||||
@ -1688,7 +1694,7 @@ test_attr_dtype_shared(hid_t fapl)
|
||||
CHECK(space_id, FAIL, "H5Screate");
|
||||
|
||||
/* Create dataset */
|
||||
dset_id = H5Dcreate2(file_id, DSET1_NAME, type_id, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
|
||||
dset_id = H5Dcreate2(file_id, DSET1_NAME, type_id, space_id, H5P_DEFAULT, dcpl_g, H5P_DEFAULT);
|
||||
CHECK(dset_id, FAIL, "H5Dcreate2");
|
||||
|
||||
/* Check reference count on named datatype */
|
||||
@ -1842,7 +1848,7 @@ test_attr_duplicate_ids(hid_t fapl)
|
||||
|
||||
/* Create a dataset */
|
||||
dataset = H5Dcreate2(fid1, DSET1_NAME, H5T_NATIVE_UCHAR, sid1, H5P_DEFAULT,
|
||||
H5P_DEFAULT, H5P_DEFAULT);
|
||||
dcpl_g, H5P_DEFAULT);
|
||||
CHECK(dataset, FAIL, "H5Dcreate2");
|
||||
|
||||
/* Create dataspace for attribute */
|
||||
@ -2167,9 +2173,14 @@ test_attr_dense_create(hid_t fcpl, hid_t fapl)
|
||||
sid = H5Screate(H5S_SCALAR);
|
||||
CHECK(sid, FAIL, "H5Screate");
|
||||
|
||||
/* Query the group creation properties */
|
||||
dcpl = H5Pcreate(H5P_DATASET_CREATE);
|
||||
CHECK(dcpl, FAIL, "H5Pcreate");
|
||||
/* need DCPL to query the group creation properties */
|
||||
if (dcpl_g == H5P_DEFAULT) {
|
||||
dcpl = H5Pcreate(H5P_DATASET_CREATE);
|
||||
CHECK(dcpl, FAIL, "H5Pcreate");
|
||||
} else {
|
||||
dcpl = H5Pcopy(dcpl_g);
|
||||
CHECK(dcpl, FAIL, "H5Pcopy");
|
||||
}
|
||||
|
||||
/* Create a dataset */
|
||||
dataset = H5Dcreate2(fid, DSET1_NAME, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT);
|
||||
@ -2298,9 +2309,14 @@ test_attr_dense_open(hid_t fcpl, hid_t fapl)
|
||||
sid = H5Screate(H5S_SCALAR);
|
||||
CHECK(sid, FAIL, "H5Screate");
|
||||
|
||||
/* Query the group creation properties */
|
||||
dcpl = H5Pcreate(H5P_DATASET_CREATE);
|
||||
CHECK(dcpl, FAIL, "H5Pcreate");
|
||||
/* need DCPL to query the group creation properties */
|
||||
if (dcpl_g == H5P_DEFAULT) {
|
||||
dcpl = H5Pcreate(H5P_DATASET_CREATE);
|
||||
CHECK(dcpl, FAIL, "H5Pcreate");
|
||||
} else {
|
||||
dcpl = H5Pcopy(dcpl_g);
|
||||
CHECK(dcpl, FAIL, "H5Pcopy");
|
||||
}
|
||||
|
||||
/* Enable creation order tracking on attributes, so creation order tests work */
|
||||
ret = H5Pset_attr_creation_order(dcpl, H5P_CRT_ORDER_TRACKED);
|
||||
@ -2412,14 +2428,25 @@ test_attr_dense_delete(hid_t fcpl, hid_t fapl)
|
||||
h5_stat_size_t empty_filesize; /* Size of empty file */
|
||||
h5_stat_size_t filesize; /* Size of file after modifications */
|
||||
H5O_info_t oinfo; /* Object info */
|
||||
int use_min_dset_oh = (dcpl_g != H5P_DEFAULT);
|
||||
herr_t ret; /* Generic return value */
|
||||
|
||||
/* Output message about test being performed */
|
||||
MESSAGE(5, ("Testing Deleting Attributes in Dense Storage\n"));
|
||||
|
||||
/* Create file */
|
||||
if (use_min_dset_oh) { /* using minimized dataset headers */
|
||||
/* modify fcpl...
|
||||
* sidestep "bug" where file space is lost with minimized dset ohdrs
|
||||
*/
|
||||
fcpl = H5Pcopy(fcpl);
|
||||
CHECK(fcpl, FAIL, "H5Pcopy");
|
||||
ret = H5Pset_file_space_strategy(fcpl, H5F_FSPACE_STRATEGY_FSM_AGGR, TRUE, 1);
|
||||
CHECK(ret, FAIL, "H5Pset_file_space_strategy");
|
||||
}
|
||||
fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl, fapl);
|
||||
CHECK(fid, FAIL, "H5Fcreate");
|
||||
if (use_min_dset_oh)
|
||||
CHECK(H5Pclose(fcpl), FAIL, "H5Pclose");
|
||||
|
||||
/* Close file */
|
||||
ret = H5Fclose(fid);
|
||||
@ -2438,9 +2465,14 @@ test_attr_dense_delete(hid_t fcpl, hid_t fapl)
|
||||
sid = H5Screate(H5S_SCALAR);
|
||||
CHECK(sid, FAIL, "H5Screate");
|
||||
|
||||
/* Query the group creation properties */
|
||||
dcpl = H5Pcreate(H5P_DATASET_CREATE);
|
||||
CHECK(dcpl, FAIL, "H5Pcreate");
|
||||
/* need DCPL to query the group creation properties */
|
||||
if (use_min_dset_oh) {
|
||||
dcpl = H5Pcopy(dcpl_g);
|
||||
CHECK(dcpl, FAIL, "H5Pcopy");
|
||||
} else {
|
||||
dcpl = H5Pcreate(H5P_DATASET_CREATE);
|
||||
CHECK(dcpl, FAIL, "H5Pcreate");
|
||||
}
|
||||
|
||||
/* Enable creation order tracking on attributes, so creation order tests work */
|
||||
ret = H5Pset_attr_creation_order(dcpl, H5P_CRT_ORDER_TRACKED);
|
||||
@ -2591,14 +2623,25 @@ test_attr_dense_rename(hid_t fcpl, hid_t fapl)
|
||||
h5_stat_size_t filesize; /* Size of file after modifications */
|
||||
H5O_info_t oinfo; /* Object info */
|
||||
unsigned u; /* Local index variable */
|
||||
int use_min_dset_oh = (dcpl_g != H5P_DEFAULT);
|
||||
herr_t ret; /* Generic return value */
|
||||
|
||||
/* Output message about test being performed */
|
||||
MESSAGE(5, ("Testing Renaming Attributes in Dense Storage\n"));
|
||||
|
||||
/* Create file */
|
||||
if (use_min_dset_oh) { /* using minimized dataset headers */
|
||||
/* modify fcpl...
|
||||
* sidestep "bug" where file space is lost with minimized dset ohdrs
|
||||
*/
|
||||
fcpl = H5Pcopy(fcpl);
|
||||
CHECK(fcpl, FAIL, "H5Pcopy");
|
||||
ret = H5Pset_file_space_strategy(fcpl, H5F_FSPACE_STRATEGY_FSM_AGGR, TRUE, 1);
|
||||
CHECK(ret, FAIL, "H5Pset_file_space_strategy");
|
||||
}
|
||||
fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl, fapl);
|
||||
CHECK(fid, FAIL, "H5Fcreate");
|
||||
if (use_min_dset_oh)
|
||||
CHECK(H5Pclose(fcpl), FAIL, "H5Pclose");
|
||||
|
||||
/* Close file */
|
||||
ret = H5Fclose(fid);
|
||||
@ -2617,9 +2660,14 @@ test_attr_dense_rename(hid_t fcpl, hid_t fapl)
|
||||
sid = H5Screate(H5S_SCALAR);
|
||||
CHECK(sid, FAIL, "H5Screate");
|
||||
|
||||
/* Query the group creation properties */
|
||||
dcpl = H5Pcreate(H5P_DATASET_CREATE);
|
||||
CHECK(dcpl, FAIL, "H5Pcreate");
|
||||
/* need DCPL to query the group creation properties */
|
||||
if (use_min_dset_oh) {
|
||||
dcpl = H5Pcopy(dcpl_g);
|
||||
CHECK(dcpl, FAIL, "H5Pcopy");
|
||||
} else {
|
||||
dcpl = H5Pcreate(H5P_DATASET_CREATE);
|
||||
CHECK(dcpl, FAIL, "H5Pcreate");
|
||||
}
|
||||
|
||||
/* Create a dataset */
|
||||
dataset = H5Dcreate2(fid, DSET1_NAME, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT);
|
||||
@ -2750,20 +2798,29 @@ test_attr_dense_unlink(hid_t fcpl, hid_t fapl)
|
||||
h5_stat_size_t filesize; /* Size of file after modifications */
|
||||
H5O_info_t oinfo; /* Object info */
|
||||
unsigned u; /* Local index variable */
|
||||
int use_min_dset_oh = (dcpl_g != H5P_DEFAULT);
|
||||
herr_t ret; /* Generic return value */
|
||||
|
||||
/* Output message about test being performed */
|
||||
MESSAGE(5, ("Testing Unlinking Object with Attributes in Dense Storage\n"));
|
||||
|
||||
/* Create file */
|
||||
if (use_min_dset_oh) { /* using minimized dataset headers */
|
||||
/* modify fcpl...
|
||||
* sidestep "bug" where file space is lost with minimized dset ohdrs
|
||||
*/
|
||||
fcpl = H5Pcopy(fcpl);
|
||||
CHECK(fcpl, FAIL, "H5Pcopy");
|
||||
ret = H5Pset_file_space_strategy(fcpl, H5F_FSPACE_STRATEGY_FSM_AGGR, TRUE, 1);
|
||||
CHECK(ret, FAIL, "H5Pset_file_space_strategy");
|
||||
}
|
||||
fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl, fapl);
|
||||
CHECK(fid, FAIL, "H5Fcreate");
|
||||
if (use_min_dset_oh)
|
||||
CHECK(H5Pclose(fcpl), FAIL, "H5Pclose");
|
||||
|
||||
/* Close file */
|
||||
ret = H5Fclose(fid);
|
||||
CHECK(ret, FAIL, "H5Fclose");
|
||||
|
||||
/* Get size of file */
|
||||
empty_filesize = h5_get_file_size(FILENAME, fapl);
|
||||
if(empty_filesize < 0)
|
||||
TestErrPrintf("Line %d: file size wrong!\n", __LINE__);
|
||||
@ -2776,9 +2833,14 @@ test_attr_dense_unlink(hid_t fcpl, hid_t fapl)
|
||||
sid = H5Screate(H5S_SCALAR);
|
||||
CHECK(sid, FAIL, "H5Screate");
|
||||
|
||||
/* Query the group creation properties */
|
||||
dcpl = H5Pcreate(H5P_DATASET_CREATE);
|
||||
CHECK(dcpl, FAIL, "H5Pcreate");
|
||||
/* need DCPL to query the group creation properties */
|
||||
if (use_min_dset_oh) {
|
||||
dcpl = H5Pcopy(dcpl_g);
|
||||
CHECK(dcpl, FAIL, "H5Pcopy");
|
||||
} else {
|
||||
dcpl = H5Pcreate(H5P_DATASET_CREATE);
|
||||
CHECK(dcpl, FAIL, "H5Pcreate");
|
||||
}
|
||||
|
||||
/* Create a dataset */
|
||||
dataset = H5Dcreate2(fid, DSET1_NAME, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT);
|
||||
@ -2904,9 +2966,14 @@ test_attr_dense_limits(hid_t fcpl, hid_t fapl)
|
||||
sid = H5Screate(H5S_SCALAR);
|
||||
CHECK(sid, FAIL, "H5Screate");
|
||||
|
||||
/* Query the group creation properties */
|
||||
dcpl = H5Pcreate(H5P_DATASET_CREATE);
|
||||
CHECK(dcpl, FAIL, "H5Pcreate");
|
||||
/* need DCPL to query the group creation properties */
|
||||
if (dcpl_g == H5P_DEFAULT) {
|
||||
dcpl = H5Pcreate(H5P_DATASET_CREATE);
|
||||
CHECK(dcpl, FAIL, "H5Pcreate");
|
||||
} else {
|
||||
dcpl = H5Pcopy(dcpl_g);
|
||||
CHECK(dcpl, FAIL, "H5Pcopy");
|
||||
}
|
||||
|
||||
/* Change limits on compact/dense attribute storage */
|
||||
max_compact = 0;
|
||||
@ -3071,9 +3138,14 @@ test_attr_dense_dup_ids(hid_t fcpl, hid_t fapl)
|
||||
sid = H5Screate(H5S_SCALAR);
|
||||
CHECK(sid, FAIL, "H5Screate");
|
||||
|
||||
/* Query the group creation properties */
|
||||
dcpl = H5Pcreate(H5P_DATASET_CREATE);
|
||||
CHECK(dcpl, FAIL, "H5Pcreate");
|
||||
/* need DCPL to query the group creation properties */
|
||||
if (dcpl_g == H5P_DEFAULT) {
|
||||
dcpl = H5Pcreate(H5P_DATASET_CREATE);
|
||||
CHECK(dcpl, FAIL, "H5Pcreate");
|
||||
} else {
|
||||
dcpl = H5Pcopy(dcpl_g);
|
||||
CHECK(dcpl, FAIL, "H5Pcopy");
|
||||
}
|
||||
|
||||
/* Create a dataset */
|
||||
dataset = H5Dcreate2(fid, DSET1_NAME, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT);
|
||||
@ -3601,9 +3673,14 @@ test_attr_big(hid_t fcpl, hid_t fapl)
|
||||
big_sid = H5Screate_simple(ATTR6_RANK, dims, NULL);
|
||||
CHECK(big_sid, FAIL, "H5Screate_simple");
|
||||
|
||||
/* Query the group creation properties */
|
||||
dcpl = H5Pcreate(H5P_DATASET_CREATE);
|
||||
CHECK(dcpl, FAIL, "H5Pcreate");
|
||||
/* need DCPL to query the group creation properties */
|
||||
if (dcpl_g == H5P_DEFAULT) {
|
||||
dcpl = H5Pcreate(H5P_DATASET_CREATE);
|
||||
CHECK(dcpl, FAIL, "H5Pcreate");
|
||||
} else {
|
||||
dcpl = H5Pcopy(dcpl_g);
|
||||
CHECK(dcpl, FAIL, "H5Pcopy");
|
||||
}
|
||||
|
||||
/* Retrieve limits for compact/dense attribute storage */
|
||||
ret = H5Pget_attr_phase_change(dcpl, &max_compact, &min_dense);
|
||||
@ -3868,7 +3945,7 @@ test_attr_null_space(hid_t fcpl, hid_t fapl)
|
||||
CHECK(null_sid, FAIL, "H5Screate");
|
||||
|
||||
/* Create a dataset */
|
||||
dataset = H5Dcreate2(fid, DSET1_NAME, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
|
||||
dataset = H5Dcreate2(fid, DSET1_NAME, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, dcpl_g, H5P_DEFAULT);
|
||||
CHECK(dataset, FAIL, "H5Dcreate2");
|
||||
|
||||
|
||||
@ -4061,7 +4138,7 @@ test_attr_deprec(hid_t fcpl, hid_t fapl)
|
||||
CHECK(sid, FAIL, "H5Screate");
|
||||
|
||||
/* Create a dataset */
|
||||
dataset = H5Dcreate2(fid, DSET1_NAME, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
|
||||
dataset = H5Dcreate2(fid, DSET1_NAME, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, dcpl_g, H5P_DEFAULT);
|
||||
CHECK(dataset, FAIL, "H5Dcreate2");
|
||||
|
||||
|
||||
@ -4296,8 +4373,13 @@ test_attr_corder_create_basic(hid_t fcpl, hid_t fapl)
|
||||
CHECK(fid, FAIL, "H5Fcreate");
|
||||
|
||||
/* Create dataset creation property list */
|
||||
dcpl = H5Pcreate(H5P_DATASET_CREATE);
|
||||
CHECK(dcpl, FAIL, "H5Pcreate");
|
||||
if (dcpl_g == H5P_DEFAULT) {
|
||||
dcpl = H5Pcreate(H5P_DATASET_CREATE);
|
||||
CHECK(dcpl, FAIL, "H5Pcreate");
|
||||
} else {
|
||||
dcpl = H5Pcopy(dcpl_g);
|
||||
CHECK(dcpl, FAIL, "H5Pcopy");
|
||||
}
|
||||
|
||||
/* Get creation order indexing on object */
|
||||
ret = H5Pget_attr_creation_order(dcpl, &crt_order_flags);
|
||||
@ -4419,8 +4501,13 @@ test_attr_corder_create_compact(hid_t fcpl, hid_t fapl)
|
||||
CHECK(fid, FAIL, "H5Fcreate");
|
||||
|
||||
/* Create dataset creation property list */
|
||||
dcpl = H5Pcreate(H5P_DATASET_CREATE);
|
||||
CHECK(dcpl, FAIL, "H5Pcreate");
|
||||
if (dcpl_g == H5P_DEFAULT) {
|
||||
dcpl = H5Pcreate(H5P_DATASET_CREATE);
|
||||
CHECK(dcpl, FAIL, "H5Pcreate");
|
||||
} else {
|
||||
dcpl = H5Pcopy(dcpl_g);
|
||||
CHECK(dcpl, FAIL, "H5Pcopy");
|
||||
}
|
||||
|
||||
/* Set attribute creation order tracking & indexing for object */
|
||||
ret = H5Pset_attr_creation_order(dcpl, (H5P_CRT_ORDER_TRACKED | H5P_CRT_ORDER_INDEXED));
|
||||
@ -4619,8 +4706,13 @@ test_attr_corder_create_dense(hid_t fcpl, hid_t fapl)
|
||||
CHECK(fid, FAIL, "H5Fcreate");
|
||||
|
||||
/* Create dataset creation property list */
|
||||
dcpl = H5Pcreate(H5P_DATASET_CREATE);
|
||||
CHECK(dcpl, FAIL, "H5Pcreate");
|
||||
if (dcpl_g == H5P_DEFAULT) {
|
||||
dcpl = H5Pcreate(H5P_DATASET_CREATE);
|
||||
CHECK(dcpl, FAIL, "H5Pcreate");
|
||||
} else {
|
||||
dcpl = H5Pcopy(dcpl_g);
|
||||
CHECK(dcpl, FAIL, "H5Pcopy");
|
||||
}
|
||||
|
||||
/* Set attribute creation order tracking & indexing for object */
|
||||
ret = H5Pset_attr_creation_order(dcpl, (H5P_CRT_ORDER_TRACKED | H5P_CRT_ORDER_INDEXED));
|
||||
@ -4954,8 +5046,13 @@ test_attr_corder_transition(hid_t fcpl, hid_t fapl)
|
||||
CHECK(fid, FAIL, "H5Fcreate");
|
||||
|
||||
/* Create dataset creation property list */
|
||||
dcpl = H5Pcreate(H5P_DATASET_CREATE);
|
||||
CHECK(dcpl, FAIL, "H5Pcreate");
|
||||
if (dcpl_g == H5P_DEFAULT) {
|
||||
dcpl = H5Pcreate(H5P_DATASET_CREATE);
|
||||
CHECK(dcpl, FAIL, "H5Pcreate");
|
||||
} else {
|
||||
dcpl = H5Pcopy(dcpl_g);
|
||||
CHECK(dcpl, FAIL, "H5Pcopy");
|
||||
}
|
||||
|
||||
/* Set attribute creation order tracking & indexing for object */
|
||||
ret = H5Pset_attr_creation_order(dcpl, (H5P_CRT_ORDER_TRACKED | H5P_CRT_ORDER_INDEXED));
|
||||
@ -5365,8 +5462,13 @@ test_attr_corder_delete(hid_t fcpl, hid_t fapl)
|
||||
CHECK(sid, FAIL, "H5Screate");
|
||||
|
||||
/* Create dataset creation property list */
|
||||
dcpl = H5Pcreate(H5P_DATASET_CREATE);
|
||||
CHECK(dcpl, FAIL, "H5Pcreate");
|
||||
if (dcpl_g == H5P_DEFAULT) {
|
||||
dcpl = H5Pcreate(H5P_DATASET_CREATE);
|
||||
CHECK(dcpl, FAIL, "H5Pcreate");
|
||||
} else {
|
||||
dcpl = H5Pcopy(dcpl_g);
|
||||
CHECK(dcpl, FAIL, "H5Pcopy");
|
||||
}
|
||||
|
||||
/* Set attribute creation order tracking & indexing for object */
|
||||
ret = H5Pset_attr_creation_order(dcpl, (H5P_CRT_ORDER_TRACKED | H5P_CRT_ORDER_INDEXED));
|
||||
@ -5708,8 +5810,13 @@ test_attr_info_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl)
|
||||
CHECK(sid, FAIL, "H5Screate");
|
||||
|
||||
/* Create dataset creation property list */
|
||||
dcpl = H5Pcreate(H5P_DATASET_CREATE);
|
||||
CHECK(dcpl, FAIL, "H5Pcreate");
|
||||
if (dcpl_g == H5P_DEFAULT) {
|
||||
dcpl = H5Pcreate(H5P_DATASET_CREATE);
|
||||
CHECK(dcpl, FAIL, "H5Pcreate");
|
||||
} else {
|
||||
dcpl = H5Pcopy(dcpl_g);
|
||||
CHECK(dcpl, FAIL, "H5Pcopy");
|
||||
}
|
||||
|
||||
/* Query the attribute creation properties */
|
||||
ret = H5Pget_attr_phase_change(dcpl, &max_compact, &min_dense);
|
||||
@ -6068,8 +6175,13 @@ test_attr_delete_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl)
|
||||
CHECK(sid, FAIL, "H5Screate");
|
||||
|
||||
/* Create dataset creation property list */
|
||||
dcpl = H5Pcreate(H5P_DATASET_CREATE);
|
||||
CHECK(dcpl, FAIL, "H5Pcreate");
|
||||
if (dcpl_g == H5P_DEFAULT) {
|
||||
dcpl = H5Pcreate(H5P_DATASET_CREATE);
|
||||
CHECK(dcpl, FAIL, "H5Pcreate");
|
||||
} else {
|
||||
dcpl = H5Pcopy(dcpl_g);
|
||||
CHECK(dcpl, FAIL, "H5Pcopy");
|
||||
}
|
||||
|
||||
/* Query the attribute creation properties */
|
||||
ret = H5Pget_attr_phase_change(dcpl, &max_compact, &min_dense);
|
||||
@ -7011,8 +7123,13 @@ test_attr_iterate2(hbool_t new_format, hid_t fcpl, hid_t fapl)
|
||||
CHECK(sid, FAIL, "H5Screate");
|
||||
|
||||
/* Create dataset creation property list */
|
||||
dcpl = H5Pcreate(H5P_DATASET_CREATE);
|
||||
CHECK(dcpl, FAIL, "H5Pcreate");
|
||||
if (dcpl_g == H5P_DEFAULT) {
|
||||
dcpl = H5Pcreate(H5P_DATASET_CREATE);
|
||||
CHECK(dcpl, FAIL, "H5Pcreate");
|
||||
} else {
|
||||
dcpl = H5Pcopy(dcpl_g);
|
||||
CHECK(dcpl, FAIL, "H5Pcopy");
|
||||
}
|
||||
|
||||
/* Query the attribute creation properties */
|
||||
ret = H5Pget_attr_phase_change(dcpl, &max_compact, &min_dense);
|
||||
@ -7372,8 +7489,13 @@ test_attr_open_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl)
|
||||
CHECK(sid, FAIL, "H5Screate");
|
||||
|
||||
/* Create dataset creation property list */
|
||||
dcpl = H5Pcreate(H5P_DATASET_CREATE);
|
||||
CHECK(dcpl, FAIL, "H5Pcreate");
|
||||
if (dcpl_g == H5P_DEFAULT) {
|
||||
dcpl = H5Pcreate(H5P_DATASET_CREATE);
|
||||
CHECK(dcpl, FAIL, "H5Pcreate");
|
||||
} else {
|
||||
dcpl = H5Pcopy(dcpl_g);
|
||||
CHECK(dcpl, FAIL, "H5Pcopy");
|
||||
}
|
||||
|
||||
/* Query the attribute creation properties */
|
||||
ret = H5Pget_attr_phase_change(dcpl, &max_compact, &min_dense);
|
||||
@ -7719,8 +7841,13 @@ test_attr_open_by_name(hbool_t new_format, hid_t fcpl, hid_t fapl)
|
||||
CHECK(sid, FAIL, "H5Screate");
|
||||
|
||||
/* Create dataset creation property list */
|
||||
dcpl = H5Pcreate(H5P_DATASET_CREATE);
|
||||
CHECK(dcpl, FAIL, "H5Pcreate");
|
||||
if (dcpl_g == H5P_DEFAULT) {
|
||||
dcpl = H5Pcreate(H5P_DATASET_CREATE);
|
||||
CHECK(dcpl, FAIL, "H5Pcreate");
|
||||
} else {
|
||||
dcpl = H5Pcopy(dcpl_g);
|
||||
CHECK(dcpl, FAIL, "H5Pcopy");
|
||||
}
|
||||
|
||||
/* Query the attribute creation properties */
|
||||
ret = H5Pget_attr_phase_change(dcpl, &max_compact, &min_dense);
|
||||
@ -7973,8 +8100,13 @@ test_attr_create_by_name(hbool_t new_format, hid_t fcpl, hid_t fapl)
|
||||
CHECK(sid, FAIL, "H5Screate");
|
||||
|
||||
/* Create dataset creation property list */
|
||||
dcpl = H5Pcreate(H5P_DATASET_CREATE);
|
||||
CHECK(dcpl, FAIL, "H5Pcreate");
|
||||
if (dcpl_g == H5P_DEFAULT) {
|
||||
dcpl = H5Pcreate(H5P_DATASET_CREATE);
|
||||
CHECK(dcpl, FAIL, "H5Pcreate");
|
||||
} else {
|
||||
dcpl = H5Pcopy(dcpl_g);
|
||||
CHECK(dcpl, FAIL, "H5Pcopy");
|
||||
}
|
||||
|
||||
/* Query the attribute creation properties */
|
||||
ret = H5Pget_attr_phase_change(dcpl, &max_compact, &min_dense);
|
||||
@ -8274,8 +8406,13 @@ test_attr_shared_write(hid_t fcpl, hid_t fapl)
|
||||
} /* end if */
|
||||
|
||||
/* Set up to query the object creation properties */
|
||||
dcpl = H5Pcreate(H5P_DATASET_CREATE);
|
||||
CHECK(dcpl, FAIL, "H5Pcreate");
|
||||
if (dcpl_g == H5P_DEFAULT) {
|
||||
dcpl = H5Pcreate(H5P_DATASET_CREATE);
|
||||
CHECK(dcpl, FAIL, "H5Pcreate");
|
||||
} else {
|
||||
dcpl = H5Pcopy(dcpl_g);
|
||||
CHECK(dcpl, FAIL, "H5Pcopy");
|
||||
}
|
||||
|
||||
/* Create datasets */
|
||||
dataset = H5Dcreate2(fid, DSET1_NAME, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT);
|
||||
@ -8605,8 +8742,13 @@ test_attr_shared_rename(hid_t fcpl, hid_t fapl)
|
||||
} /* end if */
|
||||
|
||||
/* Set up to query the object creation properties */
|
||||
dcpl = H5Pcreate(H5P_DATASET_CREATE);
|
||||
CHECK(dcpl, FAIL, "H5Pcreate");
|
||||
if (dcpl_g == H5P_DEFAULT) {
|
||||
dcpl = H5Pcreate(H5P_DATASET_CREATE);
|
||||
CHECK(dcpl, FAIL, "H5Pcreate");
|
||||
} else {
|
||||
dcpl = H5Pcopy(dcpl_g);
|
||||
CHECK(dcpl, FAIL, "H5Pcopy");
|
||||
}
|
||||
|
||||
/* Create datasets */
|
||||
dataset = H5Dcreate2(fid, DSET1_NAME, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT);
|
||||
@ -9051,8 +9193,13 @@ test_attr_shared_delete(hid_t fcpl, hid_t fapl)
|
||||
} /* end if */
|
||||
|
||||
/* Set up to query the object creation properties */
|
||||
dcpl = H5Pcreate(H5P_DATASET_CREATE);
|
||||
CHECK(dcpl, FAIL, "H5Pcreate");
|
||||
if (dcpl_g == H5P_DEFAULT) {
|
||||
dcpl = H5Pcreate(H5P_DATASET_CREATE);
|
||||
CHECK(dcpl, FAIL, "H5Pcreate");
|
||||
} else {
|
||||
dcpl = H5Pcopy(dcpl_g);
|
||||
CHECK(dcpl, FAIL, "H5Pcopy");
|
||||
}
|
||||
|
||||
/* Create datasets */
|
||||
dataset = H5Dcreate2(fid, DSET1_NAME, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT);
|
||||
@ -9420,8 +9567,13 @@ test_attr_shared_unlink(hid_t fcpl, hid_t fapl)
|
||||
} /* end if */
|
||||
|
||||
/* Set up to query the object creation properties */
|
||||
dcpl = H5Pcreate(H5P_DATASET_CREATE);
|
||||
CHECK(dcpl, FAIL, "H5Pcreate");
|
||||
if (dcpl_g == H5P_DEFAULT) {
|
||||
dcpl = H5Pcreate(H5P_DATASET_CREATE);
|
||||
CHECK(dcpl, FAIL, "H5Pcreate");
|
||||
} else {
|
||||
dcpl = H5Pcopy(dcpl_g);
|
||||
CHECK(dcpl, FAIL, "H5Pcopy");
|
||||
}
|
||||
|
||||
/* Create datasets */
|
||||
dataset = H5Dcreate2(fid, DSET1_NAME, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT);
|
||||
@ -10012,7 +10164,7 @@ test_attr_bug3(hid_t fcpl, hid_t fapl)
|
||||
CHECK(ret, FAIL, "H5Tcommit2");
|
||||
|
||||
/* Create dataset */
|
||||
did = H5Dcreate2(fid, "dset", tid2, sid2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
|
||||
did = H5Dcreate2(fid, "dset", tid2, sid2, H5P_DEFAULT, dcpl_g, H5P_DEFAULT);
|
||||
CHECK(did, FAIL, "H5Dcreate2");
|
||||
|
||||
/* Create attribute on datatype, using that datatype as its datatype */
|
||||
@ -10147,7 +10299,7 @@ test_attr_bug4(hid_t fcpl, hid_t fapl)
|
||||
CHECK(ret, FAIL, "H5Tcommit2");
|
||||
|
||||
/* Create dataset */
|
||||
did = H5Dcreate2(fid, "dset", tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
|
||||
did = H5Dcreate2(fid, "dset", tid, sid, H5P_DEFAULT, dcpl_g, H5P_DEFAULT);
|
||||
CHECK(did, FAIL, "H5Dcreate2");
|
||||
|
||||
/* Create attributes on group and dataset */
|
||||
@ -10229,7 +10381,7 @@ test_attr_bug5(hid_t fcpl, hid_t fapl)
|
||||
CHECK(ret, FAIL, "H5Tcommit2");
|
||||
|
||||
/* Create dataset */
|
||||
did1 = H5Dcreate2(fid1, BUG3_DSET_NAME, tid1, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
|
||||
did1 = H5Dcreate2(fid1, BUG3_DSET_NAME, tid1, sid, H5P_DEFAULT, dcpl_g, H5P_DEFAULT);
|
||||
CHECK(did1, FAIL, "H5Dcreate2");
|
||||
|
||||
/* Create attribute on root group */
|
||||
@ -10927,105 +11079,96 @@ test_attr(void)
|
||||
{
|
||||
hid_t fapl = (-1), fapl2 = (-1); /* File access property lists */
|
||||
hid_t fcpl = (-1), fcpl2 = (-1); /* File creation property lists */
|
||||
unsigned new_format; /* Whether to use the new format or not */
|
||||
unsigned use_shared; /* Whether to use shared attributes or not */
|
||||
herr_t ret; /* Generic return value */
|
||||
hid_t dcpl = -1;
|
||||
unsigned new_format; /* Whether to use the new format or not */
|
||||
unsigned use_shared; /* Whether to use shared attributes or not */
|
||||
unsigned minimize_dset_oh; /* Whether to use minimized dataset object headers */
|
||||
herr_t ret; /* Generic return value */
|
||||
|
||||
/* Output message about test being performed */
|
||||
MESSAGE(5, ("Testing Attributes\n"));
|
||||
|
||||
/* Create a default file access property list */
|
||||
fapl = H5Pcreate(H5P_FILE_ACCESS);
|
||||
CHECK(fapl, FAIL, "H5Pcreate");
|
||||
|
||||
/* Copy the file access property list */
|
||||
fapl2 = H5Pcopy(fapl);
|
||||
CHECK(fapl2, FAIL, "H5Pcopy");
|
||||
|
||||
/* Set the "use the latest version of the format" bounds for creating objects in the file */
|
||||
ret = H5Pset_libver_bounds(fapl2, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST);
|
||||
CHECK(ret, FAIL, "H5Pset_libver_bounds");
|
||||
|
||||
/* Create a default file creation property list */
|
||||
fcpl = H5Pcreate(H5P_FILE_CREATE);
|
||||
CHECK(fcpl, FAIL, "H5Pcreate");
|
||||
|
||||
/* Copy the file creation property list */
|
||||
/* files with fcpl2 make all attributes ( > 1 byte) shared
|
||||
* (i.e. all of them :-) */
|
||||
fcpl2 = H5Pcopy(fcpl);
|
||||
CHECK(fcpl2, FAIL, "H5Pcopy");
|
||||
|
||||
/* Make attributes > 1 byte shared (i.e. all of them :-) */
|
||||
ret = H5Pset_shared_mesg_nindexes(fcpl2, (unsigned)1);
|
||||
CHECK_I(ret, "H5Pset_shared_mesg_nindexes");
|
||||
ret = H5Pset_shared_mesg_index(fcpl2, (unsigned)0, H5O_SHMESG_ATTR_FLAG, (unsigned)1);
|
||||
CHECK_I(ret, "H5Pset_shared_mesg_index");
|
||||
|
||||
/* Loop over using new group format */
|
||||
for(new_format = FALSE; new_format <= TRUE; new_format++) {
|
||||
hid_t my_fapl;
|
||||
for(minimize_dset_oh = 0; minimize_dset_oh <= 1; minimize_dset_oh++) {
|
||||
if(minimize_dset_oh == 0) {
|
||||
MESSAGE(7, ("testing with default dataset object headers\n"));
|
||||
dcpl_g = H5P_DEFAULT;
|
||||
} else {
|
||||
MESSAGE(7, ("testing with minimzied dataset object headers\n"));
|
||||
dcpl = H5Pcreate(H5P_DATASET_CREATE);
|
||||
CHECK(dcpl, FAIL, "H5Pcreate");
|
||||
ret = H5Pset_dset_no_attrs_hint(dcpl, TRUE);
|
||||
CHECK_I(ret, "H5Pset_dset_no_attrs_hint");
|
||||
dcpl_g = dcpl;
|
||||
}
|
||||
|
||||
/* Set the FAPL for the type of format */
|
||||
if(new_format) {
|
||||
MESSAGE(7, ("testing with new file format\n"));
|
||||
my_fapl = fapl2;
|
||||
} /* end if */
|
||||
else {
|
||||
MESSAGE(7, ("testing with old file format\n"));
|
||||
my_fapl = fapl;
|
||||
} /* end else */
|
||||
for(new_format = FALSE; new_format <= TRUE; new_format++) {
|
||||
hid_t my_fapl;
|
||||
|
||||
/* These next two tests use the same file information */
|
||||
test_attr_basic_write(my_fapl); /* Test basic H5A writing code */
|
||||
test_attr_basic_read(my_fapl); /* Test basic H5A reading code */
|
||||
if(new_format) {
|
||||
MESSAGE(7, ("testing with new file format\n"));
|
||||
my_fapl = fapl2;
|
||||
} else {
|
||||
MESSAGE(7, ("testing with old file format\n"));
|
||||
my_fapl = fapl;
|
||||
}
|
||||
|
||||
/* These next two tests use their own file information */
|
||||
test_attr_flush(my_fapl); /* Test H5A I/O in the presence of H5Fflush calls */
|
||||
test_attr_plist(my_fapl); /* Test attribute property lists */
|
||||
/* These next two tests use the same file information */
|
||||
test_attr_basic_write(my_fapl); /* Test basic H5A writing code */
|
||||
test_attr_basic_read(my_fapl); /* Test basic H5A reading code */
|
||||
|
||||
/* These next two tests use the same file information */
|
||||
test_attr_compound_write(my_fapl); /* Test complex datatype H5A writing code */
|
||||
test_attr_compound_read(my_fapl); /* Test complex datatype H5A reading code */
|
||||
/* These next two tests use their own file information */
|
||||
test_attr_flush(my_fapl); /* Test H5A I/O in the presence of H5Fflush calls */
|
||||
test_attr_plist(my_fapl); /* Test attribute property lists */
|
||||
|
||||
/* These next two tests use the same file information */
|
||||
test_attr_scalar_write(my_fapl); /* Test scalar dataspace H5A writing code */
|
||||
test_attr_scalar_read(my_fapl); /* Test scalar dataspace H5A reading code */
|
||||
/* These next two tests use the same file information */
|
||||
test_attr_compound_write(my_fapl); /* Test complex datatype H5A writing code */
|
||||
test_attr_compound_read(my_fapl); /* Test complex datatype H5A reading code */
|
||||
|
||||
/* These next four tests use the same file information */
|
||||
test_attr_mult_write(my_fapl); /* Test H5A writing code for multiple attributes */
|
||||
test_attr_mult_read(my_fapl); /* Test H5A reading code for multiple attributes */
|
||||
test_attr_iterate(my_fapl); /* Test H5A iterator code */
|
||||
test_attr_delete(my_fapl); /* Test H5A code for deleting attributes */
|
||||
/* These next two tests use the same file information */
|
||||
test_attr_scalar_write(my_fapl); /* Test scalar dataspace H5A writing code */
|
||||
test_attr_scalar_read(my_fapl); /* Test scalar dataspace H5A reading code */
|
||||
|
||||
/* This next test uses its own file information */
|
||||
test_attr_dtype_shared(my_fapl); /* Test using shared dataypes in attributes */
|
||||
/* These next four tests use the same file information */
|
||||
test_attr_mult_write(my_fapl); /* Test H5A writing code for multiple attributes */
|
||||
test_attr_mult_read(my_fapl); /* Test H5A reading code for multiple attributes */
|
||||
test_attr_iterate(my_fapl); /* Test H5A iterator code */
|
||||
test_attr_delete(my_fapl); /* Test H5A code for deleting attributes */
|
||||
|
||||
/* This next test uses its own file information */
|
||||
test_attr_duplicate_ids(my_fapl);
|
||||
/* This next test uses its own file information */
|
||||
test_attr_dtype_shared(my_fapl); /* Test using shared dataypes in attributes */
|
||||
|
||||
/* This next test uses its own file information */
|
||||
test_attr_duplicate_ids(my_fapl);
|
||||
|
||||
/* Tests on "new format" attribute storage */
|
||||
if(new_format == TRUE) {
|
||||
/* Loop over using shared attributes */
|
||||
for(use_shared = FALSE; use_shared <= TRUE; use_shared++) {
|
||||
hid_t my_fcpl;
|
||||
|
||||
/* Set the FCPL for shared or not */
|
||||
if(use_shared) {
|
||||
if(new_format == TRUE && use_shared) {
|
||||
MESSAGE(7, ("testing with shared attributes\n"));
|
||||
my_fcpl = fcpl2;
|
||||
} /* end if */
|
||||
else {
|
||||
} else {
|
||||
MESSAGE(7, ("testing without shared attributes\n"));
|
||||
my_fcpl = fcpl;
|
||||
} /* end else */
|
||||
|
||||
/* General attribute tests */
|
||||
test_attr_dense_create(my_fcpl, my_fapl); /* Test dense attribute storage creation */
|
||||
test_attr_dense_open(my_fcpl, my_fapl); /* Test opening attributes in dense storage */
|
||||
test_attr_dense_delete(my_fcpl, my_fapl); /* Test deleting attributes in dense storage */
|
||||
test_attr_dense_rename(my_fcpl, my_fapl); /* Test renaming attributes in dense storage */
|
||||
test_attr_dense_unlink(my_fcpl, my_fapl); /* Test unlinking object with attributes in dense storage */
|
||||
test_attr_dense_limits(my_fcpl, my_fapl); /* Test dense attribute storage limits */
|
||||
test_attr_dense_dup_ids(my_fcpl, my_fapl); /* Test duplicated IDs for dense attribute storage */
|
||||
}
|
||||
|
||||
test_attr_big(my_fcpl, my_fapl); /* Test storing big attribute */
|
||||
test_attr_null_space(my_fcpl, my_fapl); /* Test storing attribute with NULL dataspace */
|
||||
@ -11034,15 +11177,8 @@ test_attr(void)
|
||||
test_attr_info_null_info_pointer(my_fcpl, my_fapl); /* Test passing a NULL attribute info pointer to H5Aget_info(_by_name/_by_idx) */
|
||||
test_attr_rename_invalid_name(my_fcpl, my_fapl); /* Test passing a NULL or empty attribute name to H5Arename(_by_name) */
|
||||
|
||||
/* Attribute creation order tests */
|
||||
test_attr_corder_create_basic(my_fcpl, my_fapl);/* Test creating an object w/attribute creation order info */
|
||||
test_attr_corder_create_compact(my_fcpl, my_fapl); /* Test compact attribute storage on an object w/attribute creation order info */
|
||||
test_attr_corder_create_dense(my_fcpl, my_fapl);/* Test dense attribute storage on an object w/attribute creation order info */
|
||||
test_attr_corder_create_reopen(my_fcpl, my_fapl);/* Test creating attributes w/reopening file from using new format to using old format */
|
||||
test_attr_corder_transition(my_fcpl, my_fapl); /* Test attribute storage transitions on an object w/attribute creation order info */
|
||||
test_attr_corder_delete(my_fcpl, my_fapl); /* Test deleting object using dense storage w/attribute creation order info */
|
||||
|
||||
/* New attribute API routine tests */
|
||||
/* New attribute API routine tests
|
||||
*/
|
||||
test_attr_info_by_idx(new_format, my_fcpl, my_fapl); /* Test querying attribute info by index */
|
||||
test_attr_delete_by_idx(new_format, my_fcpl, my_fapl); /* Test deleting attribute by index */
|
||||
test_attr_iterate2(new_format, my_fcpl, my_fapl); /* Test iterating over attributes by index */
|
||||
@ -11050,58 +11186,68 @@ test_attr(void)
|
||||
test_attr_open_by_name(new_format, my_fcpl, my_fapl); /* Test opening attributes by name */
|
||||
test_attr_create_by_name(new_format, my_fcpl, my_fapl); /* Test creating attributes by name */
|
||||
|
||||
/* More complex tests with both "new format" and "shared" attributes */
|
||||
if(use_shared == TRUE) {
|
||||
test_attr_shared_write(my_fcpl, my_fapl); /* Test writing to shared attributes in compact & dense storage */
|
||||
test_attr_shared_rename(my_fcpl, my_fapl); /* Test renaming shared attributes in compact & dense storage */
|
||||
test_attr_shared_delete(my_fcpl, my_fapl); /* Test deleting shared attributes in compact & dense storage */
|
||||
test_attr_shared_unlink(my_fcpl, my_fapl); /* Test unlinking object with shared attributes in compact & dense storage */
|
||||
} /* end if */
|
||||
|
||||
/* Tests that address specific bugs */
|
||||
/* Tests that address specific bugs
|
||||
*/
|
||||
test_attr_bug1(my_fcpl, my_fapl); /* Test odd allocation operations */
|
||||
test_attr_bug2(my_fcpl, my_fapl); /* Test many deleted attributes */
|
||||
test_attr_bug3(my_fcpl, my_fapl); /* Test "self referential" attributes */
|
||||
test_attr_bug4(my_fcpl, my_fapl); /* Test attributes on named datatypes */
|
||||
test_attr_bug5(my_fcpl, my_fapl); /* Test opening/closing attributes through different file handles */
|
||||
test_attr_bug6(my_fcpl, my_fapl); /* Test reading empty attribute */
|
||||
test_attr_bug7(my_fcpl, my_fapl); /* Test creating and deleting large attributes in ohdr chunk 0 */
|
||||
/* test_attr_bug7 is specific to the "new" object header format,
|
||||
* and in fact fails if used with the old format due to the
|
||||
* attributes being larger than 64K */
|
||||
test_attr_bug8(my_fcpl, my_fapl); /* Test attribute expanding object header with undecoded messages */
|
||||
test_attr_bug9(my_fcpl, my_fapl); /* Test large attributes converting to dense storage */
|
||||
test_attr_delete_last_dense(my_fcpl, my_fapl); /* Test */
|
||||
} /* end for */
|
||||
} /* end if */
|
||||
else {
|
||||
/* General attribute tests */
|
||||
test_attr_big(fcpl, my_fapl); /* Test storing big attribute */
|
||||
test_attr_null_space(fcpl, my_fapl); /* Test storing attribute with NULL dataspace */
|
||||
test_attr_deprec(fcpl, my_fapl); /* Test deprecated API routines */
|
||||
test_attr_many(new_format, fcpl, my_fapl); /* Test storing lots of attributes */
|
||||
test_attr_info_null_info_pointer(fcpl, my_fapl); /* Test passing a NULL attribute info pointer to H5Aget_info(_by_name/_by_idx) */
|
||||
test_attr_rename_invalid_name(fcpl, my_fapl); /* Test passing a NULL or empty attribute name to H5Arename(_by_name) */
|
||||
|
||||
/* New attribute API routine tests, on old-format storage */
|
||||
test_attr_info_by_idx(new_format, fcpl, my_fapl); /* Test querying attribute info by index */
|
||||
test_attr_delete_by_idx(new_format, fcpl, my_fapl); /* Test deleting attribute by index */
|
||||
test_attr_iterate2(new_format, fcpl, my_fapl); /* Test iterating over attributes by index */
|
||||
test_attr_open_by_idx(new_format, fcpl, my_fapl); /* Test opening attributes by index */
|
||||
test_attr_open_by_name(new_format, fcpl, my_fapl); /* Test opening attributes by name */
|
||||
test_attr_create_by_name(new_format, fcpl, my_fapl); /* Test creating attributes by name */
|
||||
/* tests specific to the "new format"
|
||||
*/
|
||||
if (new_format == TRUE) {
|
||||
/* General attribute tests */
|
||||
test_attr_dense_create(my_fcpl, my_fapl); /* Test dense attribute storage creation */
|
||||
test_attr_dense_open(my_fcpl, my_fapl); /* Test opening attributes in dense storage */
|
||||
test_attr_dense_delete(my_fcpl, my_fapl); /* Test deleting attributes in dense storage */
|
||||
test_attr_dense_rename(my_fcpl, my_fapl); /* Test renaming attributes in dense storage */
|
||||
test_attr_dense_unlink(my_fcpl, my_fapl); /* Test unlinking object with attributes in dense storage */
|
||||
test_attr_dense_limits(my_fcpl, my_fapl); /* Test dense attribute storage limits */
|
||||
test_attr_dense_dup_ids(my_fcpl, my_fapl); /* Test duplicated IDs for dense attribute storage */
|
||||
|
||||
/* Tests that address specific bugs */
|
||||
test_attr_bug1(fcpl, my_fapl); /* Test odd allocation operations */
|
||||
test_attr_bug2(fcpl, my_fapl); /* Test many deleted attributes */
|
||||
test_attr_bug3(fcpl, my_fapl); /* Test "self referential" attributes */
|
||||
test_attr_bug4(fcpl, my_fapl); /* Test attributes on named datatypes */
|
||||
test_attr_bug5(fcpl, my_fapl); /* Test opening/closing attributes through different file handles */
|
||||
test_attr_bug6(fcpl, my_fapl); /* Test reading empty attribute */
|
||||
/* Skip test_attr_bug7 because it is specific to the new object
|
||||
* header format and in fact fails if used with the old format, due
|
||||
* to the attributes being larger than 64K */
|
||||
test_attr_bug8(fcpl, my_fapl); /* Test attribute expanding object header with undecoded messages */
|
||||
test_attr_bug9(fcpl, my_fapl); /* Test large attributes converting to dense storage */
|
||||
} /* end else */
|
||||
} /* end for */
|
||||
/* Attribute creation order tests
|
||||
*/
|
||||
test_attr_corder_create_basic(my_fcpl, my_fapl);/* Test creating an object w/attribute creation order info */
|
||||
test_attr_corder_create_compact(my_fcpl, my_fapl); /* Test compact attribute storage on an object w/attribute creation order info */
|
||||
test_attr_corder_create_dense(my_fcpl, my_fapl);/* Test dense attribute storage on an object w/attribute creation order info */
|
||||
test_attr_corder_create_reopen(my_fcpl, my_fapl);/* Test creating attributes w/reopening file from using new format to using old format */
|
||||
test_attr_corder_transition(my_fcpl, my_fapl); /* Test attribute storage transitions on an object w/attribute creation order info */
|
||||
test_attr_corder_delete(my_fcpl, my_fapl); /* Test deleting object using dense storage w/attribute creation order info */
|
||||
|
||||
/* More complex tests with exclusively both "new format" and "shared" attributes
|
||||
*/
|
||||
if(use_shared == TRUE) {
|
||||
test_attr_shared_write(my_fcpl, my_fapl); /* Test writing to shared attributes in compact & dense storage */
|
||||
test_attr_shared_rename(my_fcpl, my_fapl); /* Test renaming shared attributes in compact & dense storage */
|
||||
test_attr_shared_delete(my_fcpl, my_fapl); /* Test deleting shared attributes in compact & dense storage */
|
||||
test_attr_shared_unlink(my_fcpl, my_fapl); /* Test unlinking object with shared attributes in compact & dense storage */
|
||||
} /* if using shared attributes */
|
||||
|
||||
test_attr_delete_last_dense(my_fcpl, my_fapl);
|
||||
|
||||
/* test_attr_bug7 is specific to the "new" object header format,
|
||||
* and in fact fails if used with the old format due to the
|
||||
* attributes being larger than 64K */
|
||||
test_attr_bug7(my_fcpl, my_fapl); /* Test creating and deleting large attributes in ohdr chunk 0 */
|
||||
|
||||
} /* if using "new format" */
|
||||
} /* for unshared/shared attributes */
|
||||
} /* for old/new format */
|
||||
|
||||
if (minimize_dset_oh != 0) {
|
||||
ret = H5Pclose(dcpl);
|
||||
CHECK(ret, FAIL, "H5Pclose");
|
||||
dcpl_g = H5P_DEFAULT;
|
||||
}
|
||||
|
||||
} /* for default/minimized dataset object headers */
|
||||
|
||||
/* Close FCPLs */
|
||||
ret = H5Pclose(fcpl);
|
||||
|
84
test/test_vol_plugin.sh.in
Normal file
84
test/test_vol_plugin.sh.in
Normal file
@ -0,0 +1,84 @@
|
||||
#! /bin/sh
|
||||
#
|
||||
# Copyright by The HDF Group.
|
||||
# All rights reserved.
|
||||
#
|
||||
# This file is part of HDF5. The full HDF5 copyright notice, including
|
||||
# terms governing use, modification, and redistribution, is contained in
|
||||
# the COPYING file, which can be found at the root of the source code
|
||||
# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases.
|
||||
# If you do not have access to either file, you may request a copy from
|
||||
# help@hdfgroup.org.
|
||||
#
|
||||
# This shell script is for testing VOL connector plugins.
|
||||
#
|
||||
srcdir=@srcdir@
|
||||
TOP_BUILDDIR=@top_builddir@
|
||||
|
||||
EXIT_SUCCESS=0
|
||||
EXIT_FAILURE=1
|
||||
|
||||
nerrors=0
|
||||
verbose=yes
|
||||
exit_code=$EXIT_SUCCESS
|
||||
|
||||
TEST_NAME=vol_plugin
|
||||
TEST_BIN=`pwd`/$TEST_NAME
|
||||
FROM_DIR=`pwd`/.libs
|
||||
case $(uname) in
|
||||
CYGWIN* )
|
||||
NULL_VOL_PLUGIN="$FROM_DIR/cygnull_vol_connector*"
|
||||
;;
|
||||
*)
|
||||
NULL_VOL_PLUGIN="$FROM_DIR/libnull_vol_connector*"
|
||||
;;
|
||||
esac
|
||||
TEMP_PLUGIN_DIR=null_vol_plugin_dir
|
||||
CP="cp -p" # Use -p to preserve mode,ownership, timestamps
|
||||
RM="rm -rf"
|
||||
|
||||
# Print a line-line message left justified in a field of 70 characters
|
||||
# beginning with the word "Testing".
|
||||
#
|
||||
TESTING() {
|
||||
SPACES=" "
|
||||
echo "Testing $* $SPACES" | cut -c1-70 | tr -d '\012'
|
||||
}
|
||||
|
||||
# Main Body
|
||||
# Create test directory if necessary.
|
||||
test -d $TEMP_PLUGIN_DIR || mkdir -p $TEMP_PLUGIN_DIR
|
||||
if [ $? != 0 ]; then
|
||||
echo "Failed to create VOL connector plugin test directory ($TEMP_PLUGIN_DIR)"
|
||||
exit $EXIT_FAILURE
|
||||
fi
|
||||
|
||||
# Copy plugin for the tests.
|
||||
$CP $NULL_VOL_PLUGIN $TEMP_PLUGIN_DIR
|
||||
if [ $? != 0 ]; then
|
||||
echo "Failed to copy NULL VOL plugin ($NULL_VOL_PLUGIN) to test directory."
|
||||
exit $EXIT_FAILURE
|
||||
fi
|
||||
|
||||
# setup plugin path
|
||||
ENVCMD="env HDF5_PLUGIN_PATH=${TEMP_PLUGIN_DIR}"
|
||||
|
||||
# Run the test
|
||||
$ENVCMD $TEST_BIN
|
||||
if [ $? != 0 ]; then
|
||||
nerrors=`expr $nerrors + 1`
|
||||
fi
|
||||
|
||||
# print results
|
||||
if test $nerrors -ne 0 ; then
|
||||
echo "$nerrors errors encountered"
|
||||
exit_code=$EXIT_FAILURE
|
||||
else
|
||||
echo "All VOL plugin tests passed."
|
||||
exit_code=$EXIT_SUCCESS
|
||||
fi
|
||||
|
||||
# Clean up temporary files/directories and leave
|
||||
$RM $TEMP_PLUGIN_DIR
|
||||
|
||||
exit $exit_code
|
127
test/tfile.c
127
test/tfile.c
@ -7139,6 +7139,132 @@ test_incr_filesize(void)
|
||||
}
|
||||
} /* end test_incr_filesize() */
|
||||
|
||||
/****************************************************************
|
||||
**
|
||||
** test_min_dset_ohdr():
|
||||
** Test API calls to toggle dataset object header minimization.
|
||||
**
|
||||
** TODO (as separate function?):
|
||||
** + setting persists between close and (re)open?
|
||||
** + dataset header sizes created while changing value of toggle
|
||||
**
|
||||
****************************************************************/
|
||||
static void
|
||||
test_min_dset_ohdr(void)
|
||||
{
|
||||
const char basename[] = "min_dset_ohdr_testfile";
|
||||
char filename[FILENAME_LEN] = "";
|
||||
hid_t file_id = -1;
|
||||
hid_t file2_id = -1;
|
||||
hbool_t minimize;
|
||||
herr_t ret;
|
||||
|
||||
MESSAGE(5, ("Testing dataset object header minimization\n"));
|
||||
|
||||
/*********/
|
||||
/* SETUP */
|
||||
/*********/
|
||||
|
||||
h5_fixname(basename, H5P_DEFAULT, filename, sizeof(filename));
|
||||
|
||||
file_id = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
|
||||
CHECK_I(file_id, "H5Fcreate");
|
||||
|
||||
/*********/
|
||||
/* TESTS */
|
||||
/*********/
|
||||
|
||||
/*----------------------------------------
|
||||
* TEST default value
|
||||
*/
|
||||
ret = H5Fget_dset_no_attrs_hint(file_id, &minimize);
|
||||
CHECK(ret, FAIL, "H5Fget_dset_no_attrs_hint");
|
||||
VERIFY(minimize, FALSE, "minimize flag");
|
||||
|
||||
/*----------------------------------------
|
||||
* TEST set to TRUE
|
||||
*/
|
||||
ret = H5Fset_dset_no_attrs_hint(file_id, TRUE);
|
||||
CHECK(ret, FAIL, "H5Fset_dset_no_attrs_hint");
|
||||
|
||||
ret = H5Fget_dset_no_attrs_hint(file_id, &minimize);
|
||||
CHECK(ret, FAIL, "H5Fget_dset_no_attrs_hint");
|
||||
VERIFY(minimize, TRUE, "minimize flag");
|
||||
|
||||
/*----------------------------------------
|
||||
* TEST second file open on same filename
|
||||
*/
|
||||
file2_id = H5Fopen(filename, H5F_ACC_RDWR, H5P_DEFAULT);
|
||||
CHECK_I(file2_id, "H5Fopen");
|
||||
|
||||
/* verify TRUE setting on second open
|
||||
*/
|
||||
ret = H5Fget_dset_no_attrs_hint(file_id, &minimize);
|
||||
CHECK(ret, FAIL, "H5Fget_dset_no_attrs_hint");
|
||||
VERIFY(minimize, TRUE, "minimize flag");
|
||||
|
||||
/* re-set to FALSE on first open
|
||||
*/
|
||||
ret = H5Fset_dset_no_attrs_hint(file_id, FALSE);
|
||||
CHECK(ret, FAIL, "H5Fset_dset_no_attrs_hint");
|
||||
|
||||
/* verify FALSE set on both opens
|
||||
*/
|
||||
ret = H5Fget_dset_no_attrs_hint(file_id, &minimize);
|
||||
CHECK(ret, FAIL, "H5Fget_dset_no_attrs_hint");
|
||||
VERIFY(minimize, FALSE, "minimize flag");
|
||||
|
||||
ret = H5Fget_dset_no_attrs_hint(file2_id, &minimize);
|
||||
CHECK(ret, FAIL, "H5Fget_dset_no_attrs_hint");
|
||||
VERIFY(minimize, FALSE, "minimize flag");
|
||||
|
||||
/* re-set to TRUE on second open
|
||||
*/
|
||||
ret = H5Fset_dset_no_attrs_hint(file2_id, TRUE);
|
||||
CHECK(ret, FAIL, "H5Fset_dset_no_attrs_hint");
|
||||
|
||||
/* verify TRUE set on both opens
|
||||
*/
|
||||
ret = H5Fget_dset_no_attrs_hint(file_id, &minimize);
|
||||
CHECK(ret, FAIL, "H5Fget_dset_no_attrs_hint");
|
||||
VERIFY(minimize, TRUE, "minimize flag");
|
||||
|
||||
ret = H5Fget_dset_no_attrs_hint(file2_id, &minimize);
|
||||
CHECK(ret, FAIL, "H5Fget_dset_no_attrs_hint");
|
||||
VERIFY(minimize, TRUE, "minimize flag");
|
||||
|
||||
/*----------------------------------------
|
||||
* TEST error cases
|
||||
*/
|
||||
|
||||
/* trying to set with invalid file ID */
|
||||
H5E_BEGIN_TRY {
|
||||
ret = H5Fset_dset_no_attrs_hint(-1, TRUE);
|
||||
} H5E_END_TRY;
|
||||
VERIFY(ret, FAIL, "H5Fset_dset_no_attrs_hint");
|
||||
|
||||
/* trying to get with invalid file ID */
|
||||
H5E_BEGIN_TRY {
|
||||
ret = H5Fget_dset_no_attrs_hint(-1, &minimize);
|
||||
} H5E_END_TRY;
|
||||
VERIFY(ret, FAIL, "H5Fget_dset_no_attrs_hint");
|
||||
|
||||
/* trying to get with invalid pointer */
|
||||
H5E_BEGIN_TRY {
|
||||
ret = H5Fget_dset_no_attrs_hint(file_id, NULL);
|
||||
} H5E_END_TRY;
|
||||
VERIFY(ret, FAIL, "H5Fget_dset_no_attrs_hint");
|
||||
|
||||
/************/
|
||||
/* TEARDOWN */
|
||||
/************/
|
||||
|
||||
ret = H5Fclose(file_id);
|
||||
CHECK(ret, FAIL, "H5Fclose");
|
||||
ret = H5Fclose(file2_id);
|
||||
CHECK(ret, FAIL, "H5Fclose");
|
||||
} /* end test_min_dset_ohdr() */
|
||||
|
||||
/****************************************************************
|
||||
**
|
||||
** test_deprec():
|
||||
@ -7426,6 +7552,7 @@ test_file(void)
|
||||
test_libver_macros(); /* Test the macros for library version comparison */
|
||||
test_libver_macros2(); /* Test the macros for library version comparison */
|
||||
test_incr_filesize(); /* Test H5Fincrement_filesize() and H5Fget_eoa() */
|
||||
test_min_dset_ohdr(); /* Test datset object header minimization */
|
||||
#ifndef H5_NO_DEPRECATED_SYMBOLS
|
||||
test_file_ishdf5(); /* Test detecting HDF5 files correctly */
|
||||
test_deprec(); /* Test deprecated routines */
|
||||
|
1861
test/tsohm.c
1861
test/tsohm.c
File diff suppressed because it is too large
Load Diff
291
test/vol_plugin.c
Normal file
291
test/vol_plugin.c
Normal file
@ -0,0 +1,291 @@
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
* Copyright by The HDF Group. *
|
||||
* All rights reserved. *
|
||||
* *
|
||||
* This file is part of HDF5. The full HDF5 copyright notice, including *
|
||||
* terms governing use, modification, and redistribution, is contained in *
|
||||
* the COPYING file, which can be found at the root of the source code *
|
||||
* distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. *
|
||||
* If you do not have access to either file, you may request a copy from *
|
||||
* help@hdfgroup.org. *
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
/*
|
||||
* Purpose: Tests basic VOL plugin operations (registration, etc.).
|
||||
* Uses the null VOL connector (built with the testing code)
|
||||
* which is loaded as a dynamic plugin.
|
||||
*
|
||||
* TO DO: Adapt the null VOL connector to do something interesting with
|
||||
* the property list.
|
||||
*/
|
||||
|
||||
#include "h5test.h"
|
||||
|
||||
#include "null_vol_connector.h"
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: test_registration_by_value()
|
||||
*
|
||||
* Purpose: Tests if we can load, register, and close a VOL
|
||||
* connector by value.
|
||||
*
|
||||
* Return: SUCCEED/FAIL
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
static herr_t
|
||||
test_registration_by_value(void)
|
||||
{
|
||||
htri_t is_registered = FAIL;
|
||||
hid_t vol_id = H5I_INVALID_HID;
|
||||
|
||||
TESTING("VOL registration by value");
|
||||
|
||||
/* The null VOL connector should not be registered at the start of the test */
|
||||
if((is_registered = H5VLis_connector_registered(NULL_VOL_CONNECTOR_NAME)) < 0)
|
||||
TEST_ERROR;
|
||||
if(TRUE == is_registered)
|
||||
FAIL_PUTS_ERROR("NULL VOL connector is inappropriately registered");
|
||||
|
||||
/* Register the connector by value */
|
||||
if((vol_id = H5VLregister_connector_by_value(NULL_VOL_CONNECTOR_VALUE, H5P_DEFAULT)) < 0)
|
||||
TEST_ERROR;
|
||||
|
||||
/* The connector should be registered now */
|
||||
if((is_registered = H5VLis_connector_registered(NULL_VOL_CONNECTOR_NAME)) < 0)
|
||||
TEST_ERROR;
|
||||
if(FALSE == is_registered)
|
||||
FAIL_PUTS_ERROR("NULL VOL connector was not registered");
|
||||
|
||||
/* Unregister the connector */
|
||||
if(H5VLunregister_connector(vol_id) < 0)
|
||||
TEST_ERROR;
|
||||
|
||||
/* The connector should not be registered now */
|
||||
if((is_registered = H5VLis_connector_registered(NULL_VOL_CONNECTOR_NAME)) < 0)
|
||||
TEST_ERROR;
|
||||
if(TRUE == is_registered)
|
||||
FAIL_PUTS_ERROR("NULL VOL connector is inappropriately registered");
|
||||
|
||||
PASSED();
|
||||
return SUCCEED;
|
||||
|
||||
error:
|
||||
H5E_BEGIN_TRY {
|
||||
H5VLunregister_connector(vol_id);
|
||||
} H5E_END_TRY;
|
||||
return FAIL;
|
||||
|
||||
} /* end test_registration_by_value() */
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: test_registration_by_name()
|
||||
*
|
||||
* Purpose: Tests if we can load, register, and close a VOL
|
||||
* connector by name.
|
||||
*
|
||||
* Return: SUCCEED/FAIL
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
static herr_t
|
||||
test_registration_by_name(void)
|
||||
{
|
||||
htri_t is_registered = FAIL;
|
||||
hid_t vol_id = H5I_INVALID_HID;
|
||||
|
||||
TESTING("VOL registration by name");
|
||||
|
||||
/* The null VOL connector should not be registered at the start of the test */
|
||||
if((is_registered = H5VLis_connector_registered(NULL_VOL_CONNECTOR_NAME)) < 0)
|
||||
TEST_ERROR;
|
||||
if(TRUE == is_registered)
|
||||
FAIL_PUTS_ERROR("NULL VOL connector is inappropriately registered");
|
||||
|
||||
/* Register the connector by name */
|
||||
if((vol_id = H5VLregister_connector_by_name(NULL_VOL_CONNECTOR_NAME, H5P_DEFAULT)) < 0)
|
||||
TEST_ERROR;
|
||||
|
||||
/* The connector should be registered now */
|
||||
if((is_registered = H5VLis_connector_registered(NULL_VOL_CONNECTOR_NAME)) < 0)
|
||||
TEST_ERROR;
|
||||
if(FALSE == is_registered)
|
||||
FAIL_PUTS_ERROR("NULL VOL connector was not registered");
|
||||
|
||||
/* Unregister the connector */
|
||||
if(H5VLunregister_connector(vol_id) < 0)
|
||||
TEST_ERROR;
|
||||
|
||||
/* The connector should not be registered now */
|
||||
if((is_registered = H5VLis_connector_registered(NULL_VOL_CONNECTOR_NAME)) < 0)
|
||||
TEST_ERROR;
|
||||
if(TRUE == is_registered)
|
||||
FAIL_PUTS_ERROR("NULL VOL connector is inappropriately registered");
|
||||
|
||||
PASSED();
|
||||
return SUCCEED;
|
||||
|
||||
error:
|
||||
H5E_BEGIN_TRY {
|
||||
H5VLunregister_connector(vol_id);
|
||||
} H5E_END_TRY;
|
||||
return FAIL;
|
||||
|
||||
} /* end test_registration_by_name() */
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: test_multiple_registration()
|
||||
*
|
||||
* Purpose: Tests if we can register a VOL connector multiple times.
|
||||
*
|
||||
* Return: SUCCEED/FAIL
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
#define N_REGISTRATIONS 10
|
||||
static herr_t
|
||||
test_multiple_registration(void)
|
||||
{
|
||||
htri_t is_registered = FAIL;
|
||||
hid_t vol_ids[N_REGISTRATIONS];
|
||||
int i;
|
||||
|
||||
TESTING("registering a VOL connector multiple times");
|
||||
|
||||
/* The null VOL connector should not be registered at the start of the test */
|
||||
if((is_registered = H5VLis_connector_registered(NULL_VOL_CONNECTOR_NAME)) < 0)
|
||||
TEST_ERROR;
|
||||
if(TRUE == is_registered)
|
||||
FAIL_PUTS_ERROR("NULL VOL connector is inappropriately registered");
|
||||
|
||||
/* Register the connector multiple times */
|
||||
for(i = 0; i < N_REGISTRATIONS; i++) {
|
||||
if((vol_ids[i] = H5VLregister_connector_by_name(NULL_VOL_CONNECTOR_NAME, H5P_DEFAULT)) < 0)
|
||||
TEST_ERROR;
|
||||
}
|
||||
|
||||
/* The connector should be registered now */
|
||||
if((is_registered = H5VLis_connector_registered(NULL_VOL_CONNECTOR_NAME)) < 0)
|
||||
TEST_ERROR;
|
||||
if(FALSE == is_registered)
|
||||
FAIL_PUTS_ERROR("NULL VOL connector was not registered");
|
||||
|
||||
/* Unregister the connector */
|
||||
for(i = 0; i < N_REGISTRATIONS; i++) {
|
||||
if(H5VLunregister_connector(vol_ids[i]) < 0)
|
||||
TEST_ERROR;
|
||||
/* Also test close on some of the IDs. This call currently works
|
||||
* identically to unregister.
|
||||
*/
|
||||
i++;
|
||||
if(H5VLclose(vol_ids[i]) < 0)
|
||||
TEST_ERROR;
|
||||
}
|
||||
|
||||
/* The connector should not be registered now */
|
||||
if((is_registered = H5VLis_connector_registered(NULL_VOL_CONNECTOR_NAME)) < 0)
|
||||
TEST_ERROR;
|
||||
if(TRUE == is_registered)
|
||||
FAIL_PUTS_ERROR("NULL VOL connector is inappropriately registered");
|
||||
|
||||
PASSED();
|
||||
return SUCCEED;
|
||||
|
||||
error:
|
||||
H5E_BEGIN_TRY {
|
||||
for(i = 0; i < N_REGISTRATIONS; i++)
|
||||
H5VLunregister_connector(vol_ids[i]);
|
||||
} H5E_END_TRY;
|
||||
return FAIL;
|
||||
|
||||
} /* end test_multiple_registration() */
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: test_getters()
|
||||
*
|
||||
* Purpose: Tests H5VL getters
|
||||
*
|
||||
* Return: SUCCEED/FAIL
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
static herr_t
|
||||
test_getters(void)
|
||||
{
|
||||
htri_t is_registered = FAIL;
|
||||
hid_t vol_id = H5I_INVALID_HID;
|
||||
hid_t vol_id_out = H5I_INVALID_HID;
|
||||
|
||||
TESTING("VOL getters");
|
||||
|
||||
/* The null VOL connector should not be registered at the start of the test */
|
||||
if((is_registered = H5VLis_connector_registered(NULL_VOL_CONNECTOR_NAME)) < 0)
|
||||
TEST_ERROR;
|
||||
if(TRUE == is_registered)
|
||||
FAIL_PUTS_ERROR("NULL VOL connector is inappropriately registered");
|
||||
|
||||
/* Register the connector by name */
|
||||
if((vol_id = H5VLregister_connector_by_name(NULL_VOL_CONNECTOR_NAME, H5P_DEFAULT)) < 0)
|
||||
TEST_ERROR;
|
||||
|
||||
/* Get the connector's ID */
|
||||
if((vol_id_out = H5VLget_connector_id(NULL_VOL_CONNECTOR_NAME)) < 0)
|
||||
TEST_ERROR;
|
||||
if(vol_id != vol_id_out)
|
||||
FAIL_PUTS_ERROR("VOL connector IDs don't match");
|
||||
|
||||
/* Unregister the connector */
|
||||
if(H5VLunregister_connector(vol_id) < 0)
|
||||
TEST_ERROR;
|
||||
|
||||
PASSED();
|
||||
return SUCCEED;
|
||||
|
||||
error:
|
||||
H5E_BEGIN_TRY {
|
||||
H5VLunregister_connector(vol_id);
|
||||
} H5E_END_TRY;
|
||||
return FAIL;
|
||||
|
||||
} /* end test_getters() */
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: main
|
||||
*
|
||||
* Purpose: Tests VOL connector plugin operations
|
||||
*
|
||||
* Return: EXIT_SUCCESS/EXIT_FAILURE
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
int
|
||||
main(void)
|
||||
{
|
||||
int nerrors = 0;
|
||||
|
||||
h5_reset();
|
||||
|
||||
HDputs("Testing VOL connector plugin functionality.");
|
||||
|
||||
nerrors += test_registration_by_name() < 0 ? 1 : 0;
|
||||
nerrors += test_registration_by_value() < 0 ? 1 : 0;
|
||||
nerrors += test_multiple_registration() < 0 ? 1 : 0;
|
||||
nerrors += test_getters() < 0 ? 1 : 0;
|
||||
|
||||
if(nerrors) {
|
||||
HDprintf("***** %d VOL connector plugin TEST%s FAILED! *****\n",
|
||||
nerrors, nerrors > 1 ? "S" : "");
|
||||
HDexit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
HDputs("All VOL connector plugin tests passed.");
|
||||
|
||||
HDexit(EXIT_SUCCESS);
|
||||
|
||||
} /* end main() */
|
||||
|
@ -21,11 +21,19 @@ include $(top_srcdir)/config/commence.am
|
||||
|
||||
AM_CPPFLAGS+=-I$(top_srcdir)/src -I$(top_srcdir)/test
|
||||
|
||||
# Test scripts--
|
||||
# testpflush.sh:
|
||||
TEST_SCRIPT_PARA = testpflush.sh
|
||||
SCRIPT_DEPEND = t_pflush1$(EXEEXT) t_pflush2$(EXEEXT)
|
||||
|
||||
check_SCRIPTS = $(TEST_SCRIPT_PARA)
|
||||
|
||||
# Test programs. These are our main targets.
|
||||
#
|
||||
TEST_PROG_PARA=t_mpi t_bigio testphdf5 t_cache t_cache_image t_pflush1 t_pflush2 t_pread t_pshutdown t_prestart t_init_term t_shapesame t_filters_parallel
|
||||
TEST_PROG_PARA=t_mpi t_bigio testphdf5 t_cache t_cache_image t_pread t_pshutdown t_prestart t_init_term t_shapesame t_filters_parallel
|
||||
|
||||
check_PROGRAMS = $(TEST_PROG_PARA)
|
||||
# t_pflush1 and t_pflush2 are used by testpflush.sh
|
||||
check_PROGRAMS = $(TEST_PROG_PARA) t_pflush1 t_pflush2
|
||||
|
||||
testphdf5_SOURCES=testphdf5.c t_dset.c t_file.c t_file_image.c t_mdset.c \
|
||||
t_ph5basic.c t_coll_chunk.c t_span_tree.c t_chunk_alloc.c t_filter_read.c \
|
||||
|
64
testpar/testpflush.sh.in
Normal file
64
testpar/testpflush.sh.in
Normal file
@ -0,0 +1,64 @@
|
||||
#! /bin/sh
|
||||
#
|
||||
# Copyright by The HDF Group.
|
||||
# Copyright by the Board of Trustees of the University of Illinois.
|
||||
# All rights reserved.
|
||||
#
|
||||
# This file is part of HDF5. The full HDF5 copyright notice, including
|
||||
# terms governing use, modification, and redistribution, is contained in
|
||||
# the COPYING file, which can be found at the root of the source code
|
||||
# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases.
|
||||
# If you do not have access to either file, you may request a copy from
|
||||
# help@hdfgroup.org.
|
||||
#
|
||||
#
|
||||
# Test script for the parallel flush test
|
||||
#
|
||||
# The parallel flush test uses two programs to test flush operations
|
||||
# in parallel HDF5. The first program purposely exits without calling
|
||||
# MPI_Finalize(), which is an error under the MPI standard and mpiexec
|
||||
# in some implementations will return an error code even though all
|
||||
# processes exit successfully. This script lets us swallow the error
|
||||
# from the first program.
|
||||
#
|
||||
# True errors in the first program will be detected as errors in the
|
||||
# second program, so watch out for that.
|
||||
#
|
||||
# Programmer: Dana Robinson
|
||||
# Fall 2018
|
||||
|
||||
# The build (current) directory might be different than the source directory.
|
||||
if test -z "$srcdir"; then
|
||||
srcdir=.
|
||||
fi
|
||||
|
||||
# Turn the $$ we use to avoid Autotools munging into $
|
||||
#
|
||||
# Allowing $$ to substitute in both the RUNPARALLEL string and the
|
||||
# regexp is intentional. There doesn't seem to be a way around
|
||||
# this using quote shenanigans. The downside is that there is a remote
|
||||
# chance that the shell's pid will match a number in the RUNPARALLEL
|
||||
# variable, but that seems less likely to cause problems than expecting
|
||||
# library builders to specify two almost identical versions of the
|
||||
# RUNPARALLEL command, one for use in scripts and one via Makefiles.
|
||||
RUNPARALLELSCRIPT=`echo "@RUNPARALLEL@" | sed "s/$$/\$/g"`
|
||||
|
||||
# ==========================================
|
||||
# Run the first parallel flush test program
|
||||
# (note that we ignore any errors here)
|
||||
# ==========================================
|
||||
echo "*** NOTE ***********************************************************"
|
||||
echo "You may see complaints from mpiexec et al. that not all processes"
|
||||
echo "called MPI_Finalize(). This is an intended characteristic of the"
|
||||
echo "test and should not be considered an error."
|
||||
echo "********************************************************************"
|
||||
eval ${RUNPARALLELSCRIPT} ./t_pflush1
|
||||
|
||||
|
||||
# ===========================================
|
||||
# Run the second parallel flush test program
|
||||
# The return code of this call is the return
|
||||
# code of the script.
|
||||
# ===========================================
|
||||
eval ${RUNPARALLELSCRIPT} ./t_pflush2
|
||||
|
@ -53,7 +53,7 @@ usage (const char *prog)
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: parse_command_line
|
||||
*
|
||||
* Purpose: Parse the command line for the h5dumper.
|
||||
* Purpose: Parse the command line.
|
||||
*
|
||||
* Return: Success: void
|
||||
* Failure: Exits program with EXIT_FAILURE value.
|
||||
@ -89,7 +89,7 @@ parse_command_line (int argc, const char *argv[])
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: main
|
||||
*
|
||||
* Purpose: HDF5 user block unjammer
|
||||
* Purpose: HDF5 user block tell size
|
||||
*
|
||||
* Return: EXIT_SUCCESS/EXIT_FAILURE
|
||||
*-------------------------------------------------------------------------
|
||||
|
Loading…
x
Reference in New Issue
Block a user