summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2018-01-02 20:37:25 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2018-01-02 20:37:25 (GMT)
commitd31b45766fa5bdbb7245cf5aa9444c9e6c6ca863 (patch)
tree9a13b5ed0513c16f752e2ab98ac245d6ededaf8f
parent08f7c97077585f9a9c36dc9c6f976e53fafdc690 (diff)
parent17b8f0bb936633f01bf6deba247e37bcadbc6b82 (diff)
downloadhdf5-d31b45766fa5bdbb7245cf5aa9444c9e6c6ca863.zip
hdf5-d31b45766fa5bdbb7245cf5aa9444c9e6c6ca863.tar.gz
hdf5-d31b45766fa5bdbb7245cf5aa9444c9e6c6ca863.tar.bz2
Merge pull request #840 in HDFFV/hdf5 from ~BYRN/hdf5_adb:develop to develop
* commit '17b8f0bb936633f01bf6deba247e37bcadbc6b82': Fix valgrind issues HDFFV-9724 init var to null HDFFV-9724 add valgrind ENV Fix memory leak due to addition of FORMAT check loop HDFFV-9724 prefix of 0 length should be null value HDFFV-9724 Corrected files and verified tests Add library INTERFACE and MPI to tools
-rw-r--r--CMakeLists.txt4
-rw-r--r--MANIFEST6
-rw-r--r--c++/src/CMakeLists.txt4
-rw-r--r--config/cmake/CTestCustom.cmake81
-rw-r--r--config/cmake_ext_mod/FindMPI.cmake287
-rw-r--r--config/cmake_ext_mod/runTest.cmake1
-rw-r--r--examples/CMakeLists.txt4
-rw-r--r--hl/c++/src/CMakeLists.txt12
-rw-r--r--hl/fortran/src/CMakeLists.txt8
-rw-r--r--hl/src/CMakeLists.txt4
-rw-r--r--java/src/hdf/hdf5lib/H5.java197
-rw-r--r--java/src/hdf/hdf5lib/HDF5Constants.java3
-rw-r--r--java/src/hdf/overview.html6
-rw-r--r--java/src/jni/CMakeLists.txt2
-rw-r--r--java/src/jni/h5Constants.c2
-rw-r--r--java/src/jni/h5pImp.c211
-rw-r--r--java/src/jni/h5pImp.h73
-rw-r--r--java/test/JUnit-interface.txt9
-rw-r--r--java/test/TestH5P.java53
-rw-r--r--java/test/TestH5Pfapl.java14
-rw-r--r--java/test/TestH5Pvirtual.java33
-rw-r--r--release_docs/RELEASE.txt32
-rw-r--r--src/CMakeLists.txt10
-rw-r--r--src/H5Dint.c78
-rw-r--r--src/H5Dpkg.h3
-rw-r--r--src/H5Dprivate.h11
-rw-r--r--src/H5Dvirtual.c271
-rw-r--r--src/H5Fprivate.h420
-rw-r--r--src/H5Fquery.c2
-rw-r--r--src/H5Pdapl.c366
-rw-r--r--src/H5Pfapl.c938
-rw-r--r--src/H5Ppublic.h2
-rw-r--r--src/H5system.c2
-rw-r--r--test/CMakeLists.txt26
-rw-r--r--test/CMakeTests.cmake76
-rw-r--r--test/filter_plugin.c204
-rw-r--r--test/vds.c1538
-rw-r--r--testpar/CMakeLists.txt10
-rw-r--r--tools/lib/CMakeLists.txt10
-rw-r--r--tools/test/h5dump/CMakeTestsVDS.cmake70
-rw-r--r--tools/test/h5ls/CMakeTestsVDS.cmake58
-rw-r--r--tools/test/h5ls/vds_prefix/tvds-1.ls14
-rw-r--r--tools/test/h5ls/vds_prefix/tvds-2.ls13
-rw-r--r--tools/test/h5ls/vds_prefix/tvds-3_1.ls14
-rw-r--r--tools/test/h5ls/vds_prefix/tvds-3_2.ls13
-rw-r--r--tools/test/h5ls/vds_prefix/tvds-4.ls9
-rw-r--r--tools/test/h5ls/vds_prefix/tvds-5.ls11
47 files changed, 3594 insertions, 1621 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index e22ac2e..d4e6300 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -631,6 +631,7 @@ if (HDF5_ENABLE_PARALLEL)
# Used by Fortran + MPI
CHECK_SYMBOL_EXISTS (MPI_Comm_c2f "${MPI_C_INCLUDE_DIRS}/mpi.h" H5_HAVE_MPI_MULTI_LANG_Comm)
CHECK_SYMBOL_EXISTS (MPI_Info_c2f "${MPI_C_INCLUDE_DIRS}/mpi.h" H5_HAVE_MPI_MULTI_LANG_Info)
+ INCLUDE_DIRECTORIES (${MPI_C_INCLUDE_DIRS})
else ()
message (STATUS "Parallel libraries not found")
endif ()
@@ -639,7 +640,6 @@ endif ()
# Parallel IO usage requires MPI to be Linked and Included
if (H5_HAVE_PARALLEL)
set (LINK_LIBS ${LINK_LIBS} ${MPI_C_LIBRARIES})
- set (LINK_SHARED_LIBS ${LINK_SHARED_LIBS} ${MPI_C_LIBRARIES})
if (MPI_C_LINK_FLAGS)
set (CMAKE_EXE_LINKER_FLAGS "${MPI_C_LINK_FLAGS} ${CMAKE_EXE_LINKER_FLAGS}")
endif ()
@@ -864,7 +864,6 @@ if (EXISTS "${HDF5_SOURCE_DIR}/fortran" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/for
include (${HDF_RESOURCES_DIR}/HDF5UseFortran.cmake)
set (LINK_Fortran_LIBS ${LINK_LIBS})
- set (LINK_Fortran_SHARED_LIBS ${LINK_SHARED_LIBS})
if (HDF5_ENABLE_F2003)
if (NOT FORTRAN_HAVE_ISO_C_BINDING)
@@ -875,7 +874,6 @@ if (EXISTS "${HDF5_SOURCE_DIR}/fortran" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/for
# Parallel IO usage requires MPI to be Linked and Included
if (H5_HAVE_PARALLEL)
set (LINK_Fortran_LIBS ${LINK_Fortran_LIBS} ${MPI_Fortran_LIBRARIES})
- set (LINK_Fortran_SHARED_LIBS ${LINK_Fortran_SHARED_LIBS} ${MPI_Fortran_LIBRARIES})
if (MPI_Fortran_LINK_FLAGS)
set (CMAKE_Fortran_EXE_LINKER_FLAGS "${MPI_Fortran_LINK_FLAGS} ${CMAKE_EXE_LINKER_FLAGS}")
endif ()
diff --git a/MANIFEST b/MANIFEST
index 9b91c78..c6c7b3c 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -1430,6 +1430,12 @@
./tools/test/h5ls/h5ls_plugin.sh.in
./tools/test/h5ls/testh5ls.sh.in
./tools/test/h5ls/testh5lsvds.sh.in
+./tools/test/h5ls/vds_prefix/tvds-1.ls
+./tools/test/h5ls/vds_prefix/tvds-2.ls
+./tools/test/h5ls/vds_prefix/tvds-3_1.ls
+./tools/test/h5ls/vds_prefix/tvds-3_2.ls
+./tools/test/h5ls/vds_prefix/tvds-4.ls
+./tools/test/h5ls/vds_prefix/tvds-5.ls
# h5copy sources
./tools/src/h5copy/Makefile.am
diff --git a/c++/src/CMakeLists.txt b/c++/src/CMakeLists.txt
index b147cfa..3b9a0c3 100644
--- a/c++/src/CMakeLists.txt
+++ b/c++/src/CMakeLists.txt
@@ -82,7 +82,7 @@ set (CPP_HDRS
add_library (${HDF5_CPP_LIB_TARGET} STATIC ${CPP_SOURCES} ${CPP_HDRS})
TARGET_C_PROPERTIES (${HDF5_CPP_LIB_TARGET} STATIC " " " ")
-target_link_libraries (${HDF5_CPP_LIB_TARGET} ${HDF5_LIB_TARGET})
+target_link_libraries (${HDF5_CPP_LIB_TARGET} PUBLIC ${HDF5_LIB_TARGET})
set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_CPP_LIB_TARGET}")
H5_SET_LIB_OPTIONS (${HDF5_CPP_LIB_TARGET} ${HDF5_CPP_LIB_NAME} STATIC)
set_target_properties (${HDF5_CPP_LIB_TARGET} PROPERTIES
@@ -94,7 +94,7 @@ set (install_targets ${HDF5_CPP_LIB_TARGET})
if (BUILD_SHARED_LIBS)
add_library (${HDF5_CPP_LIBSH_TARGET} SHARED ${CPP_SOURCES} ${CPP_HDRS})
TARGET_C_PROPERTIES (${HDF5_CPP_LIBSH_TARGET} SHARED " " " ")
- target_link_libraries (${HDF5_CPP_LIBSH_TARGET} ${HDF5_LIBSH_TARGET})
+ target_link_libraries (${HDF5_CPP_LIBSH_TARGET} PUBLIC ${HDF5_LIBSH_TARGET})
set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_CPP_LIBSH_TARGET}")
H5_SET_LIB_OPTIONS (${HDF5_CPP_LIBSH_TARGET} ${HDF5_CPP_LIB_NAME} SHARED ${HDF5_CXX_PACKAGE_SOVERSION})
set_target_properties (${HDF5_CPP_LIBSH_TARGET} PROPERTIES
diff --git a/config/cmake/CTestCustom.cmake b/config/cmake/CTestCustom.cmake
index 7aff076..33e6d4c 100644
--- a/config/cmake/CTestCustom.cmake
+++ b/config/cmake/CTestCustom.cmake
@@ -45,11 +45,13 @@ set (CTEST_CUSTOM_MEMCHECK_IGNORE
H5TEST-clear-objects
H5TEST-clear-cache-objects
H5TEST-clear-cache_api-objects
+ H5TEST-clear-cache_image-objects
H5TEST-clear-cache_tagging-objects
- H5TEST-clear-ttsafe-objects
H5TEST-clear-err_compat-objects
H5TEST-clear-error_test-objects
+ H5TEST-clear-filenotclosed-objects
H5TEST-clear-links_env-objects
+ H5TEST-clear-ttsafe-objects
PERFORM_h5perform-clear-objects
HL_TOOLS-clear-objects
HL_test-clear-objects
@@ -58,6 +60,18 @@ set (CTEST_CUSTOM_MEMCHECK_IGNORE
CPP_testhdf5-clear-objects
######### tools/h5clear #########
H5CLEAR-clearall-objects
+ H5CLEAR-copy_h5clear_log_v3.h5
+ H5CLEAR-copy_h5clear_mdc_image.h5
+ H5CLEAR-copy_h5clear_sec2_v0.h5
+ H5CLEAR-copy_h5clear_sec2_v2.h5
+ H5CLEAR-copy_h5clear_sec2_v3.h5
+ H5CLEAR-copy_latest_h5clear_log_v3.h5
+ H5CLEAR-copy_latest_h5clear_sec2_v3.h5
+ H5CLEAR-copy_mod_h5clear_mdc_image.h5
+ H5CLEAR-copy_mod_h5clr_mdc_image2.h5
+ H5CLEAR-copy_orig_h5clear_sec2_v0.h5
+ H5CLEAR-copy_orig_h5clear_sec2_v2.h5
+ H5CLEAR-copy_orig_h5clear_sec2_v3.h5
H5CLEAR-h5clear_gentest # does not close ids by design
######### tools/h5copy #########
H5COPY-clearall-objects
@@ -209,6 +223,68 @@ set (CTEST_CUSTOM_MEMCHECK_IGNORE
H5LS_VDS-clearall-objects
######### tools/h5repack #########
H5REPACK-clearall-objects
+ H5REPACK-add_alignment-clear-objects
+ H5REPACK-add_userblock-clear-objects
+ H5REPACK-all_filters-clear-objects
+ H5REPACK-attr-clear-objects
+ H5REPACK-committed_dt-clear-objects
+ H5REPACK-deflate_convert-clear-objects
+ H5REPACK-deflate_copy-clear-objects
+ H5REPACK-deflate_file-clear-objects
+ H5REPACK-deflate_remove-clear-objects
+ H5REPACK-early-clear-objects
+ H5REPACK-error4-clear-objects
+ H5REPACK-family-clear-objects
+ H5REPACK-fill-clear-objects
+ H5REPACK-fletcher_all-clear-objects
+ H5REPACK-fletcher_copy-clear-objects
+ H5REPACK-fletcher_individual-clear-objects
+ H5REPACK-fletcher_remove-clear-objects
+ H5REPACK-global_filters-clear-objects
+ H5REPACK-gt_mallocsize-clear-objects
+ H5REPACK-gzip_all-clear-objects
+ H5REPACK-gzip_individual-clear-objects
+ H5REPACK-hlink-clear-objects
+ H5REPACK-layout-clear-objects
+ H5REPACK-native_attr-clear-objects
+ H5REPACK-native_fill-clear-objects
+ H5REPACK-nbit_add-clear-objects
+ H5REPACK-nbit_copy-clear-objects
+ H5REPACK-nbit_remove-clear-objects
+ H5REPACK-nested_8bit_enum-clear-objects
+ H5REPACK-objs-clear-objects
+ H5REPACK-remove_all-clear-objects
+ H5REPACK-scale_add-clear-objects
+ H5REPACK-scale_copy-clear-objects
+ H5REPACK-scale_remove-clear-objects
+ H5REPACK-shuffle_all-clear-objects
+ H5REPACK-shuffle_copy-clear-objects
+ H5REPACK-shuffle_individual-clear-objects
+ H5REPACK-shuffle_remove-clear-objects
+ H5REPACK-szip_all-clear-objects
+ H5REPACK-szip_convert-clear-objects
+ H5REPACK-szip_copy-clear-objects
+ H5REPACK-szip_individual-clear-objects
+ H5REPACK-szip_remove-clear-objects
+ H5REPACK-upgrade_layout-clear-objects
+ H5REPACK_DMP-crtorder-clear-objects
+ H5REPACK_DMP-deflate_limit-clear-objects
+ H5REPACK-bug1814-clear-objects
+ H5REPACK-HDFFV-5932-clear-objects
+ H5REPACK-HDFFV-7840-clear-objects
+ H5REPACK_META-meta_long_N-clear-objects
+ H5REPACK_META-meta_short_N-clear-objects
+ H5REPACK_OLD-old_style_layout_short_switches-clear-objects
+ H5REPACK_STAT-GS_AGGR-clear-objects
+ H5REPACK_STAT-S_AGGR-clear-objects
+ H5REPACK_STAT-SP_NONE-clear-objects
+ H5REPACK_STAT-SP_PAGE-clear-objects
+ H5REPACK_STAT-SPT_FSM_AGGR-clear-objects
+ H5REPACK_STAT-STG_PAGE-clear-objects
+ #########
+ H5REPACK_META-meta_long
+ H5REPACK_META-meta_short
+ #########
H5REPACK-gzip_verbose_filters #uses runTest.cmake
H5REPACK_VERIFY_LAYOUT-dset2_chunk_20x10 #uses grepTest.cmake
H5REPACK_VERIFY_LAYOUT_ALL-chunk_20x10 #uses grepTest.cmake
@@ -236,6 +312,8 @@ set (CTEST_CUSTOM_MEMCHECK_IGNORE
######### tools/misc #########
H5REPART-clearall-objects
H5MKGRP-clearall-objects
+ ######### tools/perform #########
+ PERFORM_h5perform-clearall-objects
######### hl/tools/h5watch #########
H5WATCH-clearall-objects
######### examples #########
@@ -244,5 +322,6 @@ set (CTEST_CUSTOM_MEMCHECK_IGNORE
CPP_ex_tutr-clear-objects
HL_ex-clear-objects
f90_ex-clear-objects
+ HL_CPP_ex_ptExampleFL-clear-objects
HL_FORTRAN_f90_ex-clear-objects
)
diff --git a/config/cmake_ext_mod/FindMPI.cmake b/config/cmake_ext_mod/FindMPI.cmake
index 8084472..d01dd35 100644
--- a/config/cmake_ext_mod/FindMPI.cmake
+++ b/config/cmake_ext_mod/FindMPI.cmake
@@ -347,7 +347,7 @@ function (_MPI_check_compiler LANG QUERY_FLAG OUTPUT_VARIABLE RESULT_VARIABLE)
# library that has invalid or missing version information there would be warning
# messages emitted by ld.so in the compiler output. In either case, we'll treat
# the output as invalid.
- if("${WRAPPER_OUTPUT}" MATCHES "undefined reference|unrecognized|need to set|no version information available")
+ if("${WRAPPER_OUTPUT}" MATCHES "undefined reference|unrecognized|need to set|no version information available|command not found")
set(WRAPPER_RETURN 255)
endif()
# Ensure that no error output might be passed upwards.
@@ -615,6 +615,16 @@ function (_MPI_interrogate_compiler lang)
endif()
endif()
+ if(MPI_${LANG}_EXTRA_COMPILE_DEFINITIONS)
+ list(APPEND MPI_COMPILE_DEFINITIONS_WORK "${MPI_${LANG}_EXTRA_COMPILE_DEFINITIONS}")
+ endif()
+ if(MPI_${LANG}_EXTRA_COMPILE_OPTIONS)
+ list(APPEND MPI_COMPILE_OPTIONS_WORK "${MPI_${LANG}_EXTRA_COMPILE_OPTIONS}")
+ endif()
+ if(MPI_${LANG}_EXTRA_LIB_NAMES)
+ list(APPEND MPI_PLAIN_LIB_NAMES_WORK "${MPI_${LANG}_EXTRA_LIB_NAMES}")
+ endif()
+
# If we found MPI, set up all of the appropriate cache entries
if(NOT MPI_${LANG}_COMPILE_OPTIONS)
set(MPI_${LANG}_COMPILE_OPTIONS ${MPI_COMPILE_OPTIONS_WORK} CACHE STRING "MPI ${LANG} compilation options" FORCE)
@@ -823,33 +833,43 @@ endfunction()
macro(_MPI_assemble_libraries LANG)
set(MPI_${LANG}_LIBRARIES "")
- foreach(mpilib IN LISTS MPI_${LANG}_LIB_NAMES)
- list(APPEND MPI_${LANG}_LIBRARIES ${MPI_${mpilib}_LIBRARY})
- endforeach()
+ # Only for libraries do we need to check whether the compiler's linking stage is separate.
+ if(NOT "${MPI_${LANG}_COMPILER}" STREQUAL "${CMAKE_${LANG}_COMPILER}" OR NOT MPI_${LANG}_WORKS_IMPLICIT)
+ foreach(mpilib IN LISTS MPI_${LANG}_LIB_NAMES)
+ list(APPEND MPI_${LANG}_LIBRARIES ${MPI_${mpilib}_LIBRARY})
+ endforeach()
+ endif()
endmacro()
macro(_MPI_assemble_include_dirs LANG)
- set(MPI_${LANG}_INCLUDE_DIRS "${MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS}")
- if("${LANG}" MATCHES "(C|CXX)")
- if(MPI_${LANG}_HEADER_DIR)
- list(APPEND MPI_${LANG}_INCLUDE_DIRS "${MPI_${LANG}_HEADER_DIR}")
- endif()
- else() # Fortran
- if(MPI_${LANG}_F77_HEADER_DIR)
- list(APPEND MPI_${LANG}_INCLUDE_DIRS "${MPI_${LANG}_F77_HEADER_DIR}")
+ if("${MPI_${LANG}_COMPILER}" STREQUAL "${CMAKE_${LANG}_COMPILER}")
+ set(MPI_${LANG}_INCLUDE_DIRS "")
+ else()
+ set(MPI_${LANG}_INCLUDE_DIRS "${MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS}")
+ if("${LANG}" MATCHES "(C|CXX)")
+ if(MPI_${LANG}_HEADER_DIR)
+ list(APPEND MPI_${LANG}_INCLUDE_DIRS "${MPI_${LANG}_HEADER_DIR}")
+ endif()
+ else() # Fortran
+ if(MPI_${LANG}_F77_HEADER_DIR)
+ list(APPEND MPI_${LANG}_INCLUDE_DIRS "${MPI_${LANG}_F77_HEADER_DIR}")
+ endif()
+ if(MPI_${LANG}_MODULE_DIR AND NOT "${MPI_${LANG}_MODULE_DIR}" IN_LIST MPI_${LANG}_INCLUDE_DIRS)
+ list(APPEND MPI_${LANG}_INCLUDE_DIRS "${MPI_${LANG}_MODULE_DIR}")
+ endif()
endif()
- if(MPI_${LANG}_MODULE_DIR AND NOT "${MPI_${LANG}_MODULE_DIR}" IN_LIST MPI_${LANG}_INCLUDE_DIRS)
- list(APPEND MPI_${LANG}_INCLUDE_DIRS "${MPI_${LANG}_MODULE_DIR}")
+ if(MPI_${LANG}_ADDITIONAL_INCLUDE_VARS)
+ foreach(MPI_ADDITIONAL_INC_DIR IN LISTS MPI_${LANG}_ADDITIONAL_INCLUDE_VARS)
+ list(APPEND MPI_${LANG}_INCLUDE_DIRS "${MPI_${MPI_ADDITIONAL_INC_DIR}_INCLUDE_DIR}")
+ endforeach()
endif()
endif()
- if(MPI_${LANG}_ADDITIONAL_INCLUDE_VARS)
- foreach(mpiadditionalinclude IN LISTS MPI_${LANG}_ADDITIONAL_INCLUDE_VARS)
- list(APPEND MPI_${LANG}_INCLUDE_DIRS "${MPI_${mpiadditionalinclude}_INCLUDE_DIR}")
- endforeach()
- endif()
endmacro()
function(_MPI_split_include_dirs LANG)
+ if("${MPI_${LANG}_COMPILER}" STREQUAL "${CMAKE_${LANG}_COMPILER}")
+ return()
+ endif()
# Backwards compatibility: Search INCLUDE_PATH if given.
if(MPI_${LANG}_INCLUDE_PATH)
list(APPEND MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS "${MPI_${LANG}_INCLUDE_PATH}")
@@ -885,6 +905,13 @@ function(_MPI_split_include_dirs LANG)
endif()
mark_as_advanced(MPI_${LANG}_F77_HEADER_DIR MPI_${LANG}_MODULE_DIR)
endif()
+ # Remove duplicates and default system directories from the list.
+ if(MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS)
+ list(REMOVE_DUPLICATES MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS)
+ foreach(MPI_IMPLICIT_INC_DIR IN LISTS CMAKE_${LANG}_IMPLICIT_LINK_DIRECTORIES)
+ list(REMOVE_ITEM MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS ${MPI_IMPLICIT_INC_DIR})
+ endforeach()
+ endif()
set(MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS ${MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS} CACHE STRING "MPI ${LANG} additional include directories" FORCE)
endfunction()
@@ -1014,7 +1041,7 @@ elseif("${CMAKE_HOST_SYSTEM_NAME}" STREQUAL "Windows")
elseif("${CMAKE_HOST_SYSTEM_NAME}" STREQUAL "FreeBSD")
# FreeBSD ships mpich under the normal system paths - but available openmpi implementations
# will be found in /usr/local/mpi/<name>
- MPI_search_mpi_prefix_folder("/usr/local/mpi/")
+ MPI_search_mpi_prefix_folder("/usr/local/mpi")
endif()
# Most MPI distributions have some form of mpiexec or mpirun which gives us something we can look for.
@@ -1050,48 +1077,54 @@ mark_as_advanced(MPIEXEC_EXECUTABLE MPIEXEC_NUMPROC_FLAG MPIEXEC_PREFLAGS MPIEXE
#
# Once we find the new variables, we translate them back into their old
# equivalents below.
-foreach (LANG IN ITEMS C CXX)
- # Old input variables.
- set(_MPI_OLD_INPUT_VARS COMPILER COMPILE_FLAGS INCLUDE_PATH LINK_FLAGS)
-
- # Set new vars based on their old equivalents, if the new versions are not already set.
- foreach (var ${_MPI_OLD_INPUT_VARS})
- if (NOT MPI_${LANG}_${var} AND MPI_${var})
- set(MPI_${LANG}_${var} "${MPI_${var}}")
- endif()
- endforeach()
-
- # Chop the old compile flags into options and definitions
- if(MPI_${LANG}_COMPILE_FLAGS)
- unset(MPI_${LANG}_COMPILE_OPTIONS)
- unset(MPI_${LANG}_COMPILE_DEFINITIONS)
- separate_arguments(MPI_SEPARATE_FLAGS NATIVE_COMMAND "${MPI_${LANG}_COMPILE_FLAGS}")
- foreach(_MPI_FLAG IN LISTS MPI_SEPARATE_FLAGS)
- if("${_MPI_FLAG}" MATCHES "^ *[-/D]([^ ]+)")
- list(APPEND MPI_${LANG}_COMPILE_DEFINITIONS "${CMAKE_MATCH_1}")
- else()
- list(APPEND MPI_${LANG}_COMPILE_FLAGS "${_MPI_FLAG}")
+if(NOT MPI_IGNORE_LEGACY_VARIABLES)
+ foreach (LANG IN ITEMS C CXX)
+ # Old input variables.
+ set(_MPI_OLD_INPUT_VARS COMPILER COMPILE_FLAGS INCLUDE_PATH LINK_FLAGS)
+
+ # Set new vars based on their old equivalents, if the new versions are not already set.
+ foreach (var ${_MPI_OLD_INPUT_VARS})
+ if (NOT MPI_${LANG}_${var} AND MPI_${var})
+ set(MPI_${LANG}_${var} "${MPI_${var}}")
endif()
endforeach()
- unset(MPI_SEPARATE_FLAGS)
- endif()
- # If a list of libraries was given, we'll split it into new-style cache variables
- if(NOT MPI_${LANG}_LIB_NAMES)
- foreach(_MPI_LIB IN LISTS MPI_${LANG}_LIBRARIES MPI_LIBRARY MPI_EXTRA_LIBRARY)
- get_filename_component(_MPI_PLAIN_LIB_NAME "${_MPI_LIB}" NAME_WE)
- get_filename_component(_MPI_LIB_NAME "${_MPI_LIB}" NAME)
- get_filename_component(_MPI_LIB_DIR "${_MPI_LIB}" DIRECTORY)
- list(APPEND MPI_PLAIN_LIB_NAMES_WORK "${_MPI_PLAIN_LIB_NAME}")
- find_library(MPI_${_MPI_PLAIN_LIB_NAME}_LIBRARY
- NAMES "${_MPI_LIB_NAME}" "lib${_MPI_LIB_NAME}"
- HINTS ${_MPI_LIB_DIR} $ENV{MPI_LIB}
- DOC "Location of the ${_MPI_PLAIN_LIB_NAME} library for MPI"
- )
- mark_as_advanced(MPI_${_MPI_PLAIN_LIB_NAME}_LIBRARY)
- endforeach()
- endif()
-endforeach()
+ # Chop the old compile flags into options and definitions
+
+ unset(MPI_${LANG}_EXTRA_COMPILE_DEFINITIONS)
+ unset(MPI_${LANG}_EXTRA_COMPILE_OPTIONS)
+ if(MPI_${LANG}_COMPILE_FLAGS)
+ separate_arguments(MPI_SEPARATE_FLAGS NATIVE_COMMAND "${MPI_${LANG}_COMPILE_FLAGS}")
+ foreach(_MPI_FLAG IN LISTS MPI_SEPARATE_FLAGS)
+ if("${_MPI_FLAG}" MATCHES "^ *[-/D]([^ ]+)")
+ list(APPEND MPI_${LANG}_EXTRA_COMPILE_DEFINITIONS "${CMAKE_MATCH_1}")
+ else()
+ list(APPEND MPI_${LANG}_EXTRA_COMPILE_OPTIONS "${_MPI_FLAG}")
+ endif()
+ endforeach()
+ unset(MPI_SEPARATE_FLAGS)
+ endif()
+
+ # If a list of libraries was given, we'll split it into new-style cache variables
+ unset(MPI_${LANG}_EXTRA_LIB_NAMES)
+ if(NOT MPI_${LANG}_LIB_NAMES)
+ foreach(_MPI_LIB IN LISTS MPI_${LANG}_LIBRARIES MPI_LIBRARY MPI_EXTRA_LIBRARY)
+ if(_MPI_LIB)
+ get_filename_component(_MPI_PLAIN_LIB_NAME "${_MPI_LIB}" NAME_WE)
+ get_filename_component(_MPI_LIB_NAME "${_MPI_LIB}" NAME)
+ get_filename_component(_MPI_LIB_DIR "${_MPI_LIB}" DIRECTORY)
+ list(APPEND MPI_${LANG}_EXTRA_LIB_NAMES "${_MPI_PLAIN_LIB_NAME}")
+ find_library(MPI_${_MPI_PLAIN_LIB_NAME}_LIBRARY
+ NAMES "${_MPI_LIB_NAME}" "lib${_MPI_LIB_NAME}"
+ HINTS ${_MPI_LIB_DIR} $ENV{MPI_LIB}
+ DOC "Location of the ${_MPI_PLAIN_LIB_NAME} library for MPI"
+ )
+ mark_as_advanced(MPI_${_MPI_PLAIN_LIB_NAME}_LIBRARY)
+ endif()
+ endforeach()
+ endif()
+ endforeach()
+endif()
#=============================================================================
unset(MPI_VERSION)
@@ -1100,6 +1133,11 @@ unset(MPI_VERSION_MINOR)
unset(_MPI_MIN_VERSION)
+# If the user specified a library name we assume they prefer that library over a wrapper. If not, they can disable skipping manually.
+if(NOT DEFINED MPI_SKIP_COMPILER_WRAPPER AND MPI_GUESS_LIBRARY_NAME)
+ set(MPI_SKIP_COMPILER_WRAPPER TRUE)
+endif()
+
# This loop finds the compilers and sends them off for interrogation.
foreach(LANG IN ITEMS C CXX Fortran)
if(CMAKE_${LANG}_COMPILER_LOADED)
@@ -1121,6 +1159,8 @@ foreach(LANG IN ITEMS C CXX Fortran)
mark_as_advanced(MPI_CXX_SKIP_MPICXX)
endif()
if(NOT (MPI_${LANG}_LIB_NAMES AND (MPI_${LANG}_INCLUDE_PATH OR MPI_${LANG}_INCLUDE_DIRS OR MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS)))
+ set(MPI_${LANG}_TRIED_IMPLICIT FALSE)
+ set(MPI_${LANG}_WORKS_IMPLICIT FALSE)
if(NOT MPI_${LANG}_COMPILER AND NOT MPI_ASSUME_NO_BUILTIN_MPI)
# Should the imported targets be empty, we effectively try whether the compiler supports MPI on its own, which is the case on e.g.
# Cray PrgEnv.
@@ -1130,80 +1170,90 @@ foreach(LANG IN ITEMS C CXX Fortran)
# If the compiler can build MPI code on its own, it functions as an MPI compiler and we'll set the variable to point to it.
if(MPI_${LANG}_WORKS)
set(MPI_${LANG}_COMPILER "${CMAKE_${LANG}_COMPILER}" CACHE FILEPATH "MPI compiler for ${LANG}" FORCE)
+ set(MPI_${LANG}_WORKS_IMPLICIT TRUE)
endif()
+ set(MPI_${LANG}_TRIED_IMPLICIT TRUE)
endif()
- # If the user specified a library name we assume they prefer that library over a wrapper. If not, they can disable skipping manually.
- if(NOT DEFINED MPI_SKIP_COMPILER_WRAPPER AND MPI_GUESS_LIBRARY_NAME)
- set(MPI_SKIP_COMPILER_WRAPPER TRUE)
- endif()
- if(NOT MPI_SKIP_COMPILER_WRAPPER)
- if(MPI_${LANG}_COMPILER)
- # If the user supplies a compiler *name* instead of an absolute path, assume that we need to find THAT compiler.
- if (NOT IS_ABSOLUTE "${MPI_${LANG}_COMPILER}")
- # Get rid of our default list of names and just search for the name the user wants.
- set(_MPI_${LANG}_COMPILER_NAMES "${MPI_${LANG}_COMPILER}")
- unset(MPI_${LANG}_COMPILER CACHE)
+ if(NOT "${MPI_${LANG}_COMPILER}" STREQUAL "${CMAKE_${LANG}_COMPILER}" OR NOT MPI_${LANG}_WORKS)
+ set(MPI_${LANG}_WRAPPER_FOUND FALSE)
+ set(MPI_PINNED_COMPILER FALSE)
+
+ if(NOT MPI_SKIP_COMPILER_WRAPPER)
+ if(MPI_${LANG}_COMPILER)
+ # If the user supplies a compiler *name* instead of an absolute path, assume that we need to find THAT compiler.
+ if (NOT IS_ABSOLUTE "${MPI_${LANG}_COMPILER}")
+ # Get rid of our default list of names and just search for the name the user wants.
+ set(_MPI_${LANG}_COMPILER_NAMES "${MPI_${LANG}_COMPILER}")
+ unset(MPI_${LANG}_COMPILER CACHE)
+ endif()
+ # If the user specifies a compiler, we don't want to try to search libraries either.
+ set(MPI_PINNED_COMPILER TRUE)
+ endif()
+
+ # If we have an MPI base directory, we'll try all compiler names in that one first.
+ # This should prevent mixing different MPI environments
+ if(_MPI_BASE_DIR)
+ find_program(MPI_${LANG}_COMPILER
+ NAMES ${_MPI_${LANG}_COMPILER_NAMES}
+ PATH_SUFFIXES bin sbin
+ HINTS ${_MPI_BASE_DIR}
+ NO_DEFAULT_PATH
+ DOC "MPI compiler for ${LANG}"
+ )
endif()
- # If the user specifies a compiler, we don't want to try to search libraries either.
- set(MPI_PINNED_COMPILER TRUE)
- else()
- set(MPI_PINNED_COMPILER FALSE)
- endif()
- # If we have an MPI base directory, we'll try all compiler names in that one first.
- # This should prevent mixing different MPI environments
- if(_MPI_BASE_DIR)
+ # If the base directory did not help (for example because the mpiexec isn't in the same directory as the compilers),
+ # we shall try searching in the default paths.
find_program(MPI_${LANG}_COMPILER
NAMES ${_MPI_${LANG}_COMPILER_NAMES}
PATH_SUFFIXES bin sbin
- HINTS ${_MPI_BASE_DIR}
- NO_DEFAULT_PATH
DOC "MPI compiler for ${LANG}"
)
- endif()
- # If the base directory did not help (for example because the mpiexec isn't in the same directory as the compilers),
- # we shall try searching in the default paths.
- find_program(MPI_${LANG}_COMPILER
- NAMES ${_MPI_${LANG}_COMPILER_NAMES}
- PATH_SUFFIXES bin sbin
- DOC "MPI compiler for ${LANG}"
- )
-
- if(MPI_${LANG}_COMPILER STREQUAL CMAKE_${LANG}_COMPILER)
- set(MPI_SKIP_GUESSING TRUE)
- elseif(MPI_${LANG}_COMPILER)
- _MPI_interrogate_compiler(${LANG})
- else()
- set(MPI_${LANG}_WRAPPER_FOUND FALSE)
+ if("${MPI_${LANG}_COMPILER}" STREQUAL "${CMAKE_${LANG}_COMPILER}")
+ set(MPI_PINNED_COMPILER TRUE)
+
+ # If we haven't made the implicit compiler test yet, perform it now.
+ if(NOT MPI_${LANG}_TRIED_IMPLICIT)
+ _MPI_create_imported_target(${LANG})
+ _MPI_check_lang_works(${LANG})
+ endif()
+
+ # Should the MPI compiler not work implicitly for MPI, still interrogate it.
+ # Otherwise, MPI compilers for which CMake has separate linking stages, e.g. Intel MPI on Windows where link.exe is being used
+ # directly during linkage instead of CMAKE_<LANG>_COMPILER will not work.
+ if(NOT MPI_${LANG}_WORKS)
+ set(MPI_${LANG}_WORKS_IMPLICIT FALSE)
+ _MPI_interrogate_compiler(${LANG})
+ else()
+ set(MPI_${LANG}_WORKS_IMPLICIT TRUE)
+ endif()
+ elseif(MPI_${LANG}_COMPILER)
+ _MPI_interrogate_compiler(${LANG})
+ endif()
endif()
- else()
- set(MPI_${LANG}_WRAPPER_FOUND FALSE)
- set(MPI_PINNED_COMPILER FALSE)
- endif()
- if(NOT MPI_${LANG}_WRAPPER_FOUND AND NOT MPI_PINNED_COMPILER)
- # For C++, we may use the settings for C. Should a given compiler wrapper for C++ not exist, but one for C does, we copy over the
- # settings for C. An MPI distribution that is in this situation would be IBM Platform MPI.
- if("${LANG}" STREQUAL "CXX" AND MPI_C_WRAPPER_FOUND)
- set(MPI_${LANG}_COMPILE_OPTIONS ${MPI_C_COMPILE_OPTIONS} CACHE STRING "MPI ${LANG} compilation options" )
- set(MPI_${LANG}_COMPILE_DEFINITIONS ${MPI_C_COMPILE_DEFINITIONS} CACHE STRING "MPI ${LANG} compilation definitions" )
- set(MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS ${MPI_C_INCLUDE_DIRS} CACHE STRING "MPI ${LANG} additional include directories")
- set(MPI_${LANG}_LINK_FLAGS ${MPI_C_LINK_FLAGS} CACHE STRING "MPI ${LANG} linker flags" )
- set(MPI_${LANG}_LIB_NAMES ${MPI_C_LIB_NAMES} CACHE STRING "MPI ${LANG} libraries to link against" )
- set(MPI_${LANG}_WRAPPER_FOUND TRUE)
- elseif(NOT MPI_SKIP_GUESSING)
- _MPI_guess_settings(${LANG})
+ if(NOT MPI_SKIP_GUESSING AND NOT MPI_${LANG}_WRAPPER_FOUND AND NOT MPI_PINNED_COMPILER)
+ # For C++, we may use the settings for C. Should a given compiler wrapper for C++ not exist, but one for C does, we copy over the
+ # settings for C. An MPI distribution that is in this situation would be IBM Platform MPI.
+ if("${LANG}" STREQUAL "CXX" AND MPI_C_WRAPPER_FOUND)
+ set(MPI_${LANG}_COMPILE_OPTIONS ${MPI_C_COMPILE_OPTIONS} CACHE STRING "MPI ${LANG} compilation options" )
+ set(MPI_${LANG}_COMPILE_DEFINITIONS ${MPI_C_COMPILE_DEFINITIONS} CACHE STRING "MPI ${LANG} compilation definitions" )
+ set(MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS ${MPI_C_INCLUDE_DIRS} CACHE STRING "MPI ${LANG} additional include directories")
+ set(MPI_${LANG}_LINK_FLAGS ${MPI_C_LINK_FLAGS} CACHE STRING "MPI ${LANG} linker flags" )
+ set(MPI_${LANG}_LIB_NAMES ${MPI_C_LIB_NAMES} CACHE STRING "MPI ${LANG} libraries to link against" )
+ else()
+ _MPI_guess_settings(${LANG})
+ endif()
endif()
endif()
endif()
_MPI_split_include_dirs(${LANG})
- if(NOT MPI_${LANG}_COMPILER STREQUAL CMAKE_${LANG}_COMPILER)
- _MPI_assemble_include_dirs(${LANG})
- _MPI_assemble_libraries(${LANG})
- endif()
+ _MPI_assemble_include_dirs(${LANG})
+ _MPI_assemble_libraries(${LANG})
+
_MPI_adjust_compile_definitions(${LANG})
# We always create imported targets even if they're empty
_MPI_create_imported_target(${LANG})
@@ -1217,7 +1267,9 @@ foreach(LANG IN ITEMS C CXX Fortran)
set(MPI_${LANG}_COMPILE_DEFINITIONS "" CACHE STRING "MPI ${LANG} compilation definitions" )
set(MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS "" CACHE STRING "MPI ${LANG} additional include directories")
set(MPI_${LANG}_LINK_FLAGS "" CACHE STRING "MPI ${LANG} linker flags" )
- set(MPI_${LANG}_LIB_NAMES "" CACHE STRING "MPI ${LANG} libraries to link against" )
+ if(NOT MPI_${LANG}_COMPILER STREQUAL CMAKE_${LANG}_COMPILER)
+ set(MPI_${LANG}_LIB_NAMES "" CACHE STRING "MPI ${LANG} libraries to link against" )
+ endif()
mark_as_advanced(MPI_${LANG}_COMPILE_OPTIONS MPI_${LANG}_COMPILE_DEFINITIONS MPI_${LANG}_LINK_FLAGS
MPI_${LANG}_LIB_NAMES MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS MPI_${LANG}_COMPILER)
@@ -1337,7 +1389,7 @@ foreach(LANG IN ITEMS C CXX Fortran)
set(MPI_${LANG}_FIND_VERSION_EXACT ${MPI_FIND_VERSION_EXACT})
unset(MPI_${LANG}_REQUIRED_VARS)
- if (MPI_${LANG}_WRAPPER_FOUND OR MPI_${LANG}_GUESS_FOUND)
+ if (NOT "${MPI_${LANG}_COMPILER}" STREQUAL "${CMAKE_${LANG}_COMPILER}")
foreach(mpilibname IN LISTS MPI_${LANG}_LIB_NAMES)
list(APPEND MPI_${LANG}_REQUIRED_VARS "MPI_${mpilibname}_LIBRARY")
endforeach()
@@ -1448,6 +1500,7 @@ if (MPI_NUMLIBS GREATER 1)
else()
set(MPI_EXTRA_LIBRARY "MPI_EXTRA_LIBRARY-NOTFOUND")
endif()
+set(MPI_IGNORE_LEGACY_VARIABLES TRUE)
#=============================================================================
# unset these vars to cleanup namespace
diff --git a/config/cmake_ext_mod/runTest.cmake b/config/cmake_ext_mod/runTest.cmake
index 2479728..5569a73 100644
--- a/config/cmake_ext_mod/runTest.cmake
+++ b/config/cmake_ext_mod/runTest.cmake
@@ -55,6 +55,7 @@ endif ()
if (TEST_ENV_VAR)
set (ENV{${TEST_ENV_VAR}} "${TEST_ENV_VALUE}")
+ #message (STATUS "ENV:${TEST_ENV_VAR}=$ENV{${TEST_ENV_VAR}}")
endif ()
if (NOT TEST_INPUT)
diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt
index d8eb1a2..04a99ce 100644
--- a/examples/CMakeLists.txt
+++ b/examples/CMakeLists.txt
@@ -63,13 +63,13 @@ if (H5_HAVE_PARALLEL)
add_executable (ph5example ${HDF5_EXAMPLES_SOURCE_DIR}/ph5example.c)
TARGET_NAMING (ph5example STATIC)
TARGET_C_PROPERTIES (ph5example STATIC " " " ")
- target_link_libraries (ph5example ${HDF5_LIB_TARGET})
+ target_link_libraries (ph5example ${HDF5_LIB_TARGET} ${MPI_C_LIBRARIES})
set_target_properties (ph5example PROPERTIES FOLDER examples)
if (BUILD_SHARED_LIBS)
add_executable (ph5example-shared ${HDF5_EXAMPLES_SOURCE_DIR}/ph5example.c)
TARGET_NAMING (ph5example-shared SHARED)
TARGET_C_PROPERTIES (ph5example-shared SHARED " " " ")
- target_link_libraries (ph5example-shared ${HDF5_LIBSH_TARGET})
+ target_link_libraries (ph5example-shared ${HDF5_LIBSH_TARGET} ${MPI_C_LIBRARIES})
set_target_properties (ph5example-shared PROPERTIES FOLDER examples)
endif ()
endif ()
diff --git a/hl/c++/src/CMakeLists.txt b/hl/c++/src/CMakeLists.txt
index 38604cd..70f0a79 100644
--- a/hl/c++/src/CMakeLists.txt
+++ b/hl/c++/src/CMakeLists.txt
@@ -12,11 +12,7 @@ set (HDF5_HL_CPP_HDRS ${HDF5_HL_CPP_SRC_SOURCE_DIR}/H5PacketTable.h)
add_library (${HDF5_HL_CPP_LIB_TARGET} STATIC ${HDF5_HL_CPP_SOURCES})
TARGET_C_PROPERTIES (${HDF5_HL_CPP_LIB_TARGET} STATIC " " " ")
-target_link_libraries (
- ${HDF5_HL_CPP_LIB_TARGET}
- ${HDF5_HL_LIB_TARGET}
- ${HDF5_LIB_TARGET}
-)
+target_link_libraries (${HDF5_HL_CPP_LIB_TARGET} PUBLIC ${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET})
set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_HL_CPP_LIB_TARGET}")
H5_SET_LIB_OPTIONS (${HDF5_HL_CPP_LIB_TARGET} ${HDF5_HL_CPP_LIB_NAME} STATIC)
set_target_properties (${HDF5_HL_CPP_LIB_TARGET} PROPERTIES
@@ -28,11 +24,7 @@ set (install_targets ${HDF5_HL_CPP_LIB_TARGET})
if (BUILD_SHARED_LIBS)
add_library (${HDF5_HL_CPP_LIBSH_TARGET} SHARED ${HDF5_HL_CPP_SOURCES})
TARGET_C_PROPERTIES (${HDF5_HL_CPP_LIBSH_TARGET} SHARED " " " ")
- target_link_libraries (
- ${HDF5_HL_CPP_LIBSH_TARGET}
- ${HDF5_HL_LIBSH_TARGET}
- ${HDF5_LIBSH_TARGET}
- )
+ target_link_libraries (${HDF5_HL_CPP_LIBSH_TARGET} PUBLIC ${HDF5_HL_LIBSH_TARGET} ${HDF5_LIBSH_TARGET})
set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_HL_CPP_LIBSH_TARGET}")
H5_SET_LIB_OPTIONS (${HDF5_HL_CPP_LIBSH_TARGET} ${HDF5_HL_CPP_LIB_NAME} SHARED ${HDF5_HL_CXX_PACKAGE_SOVERSION})
set_target_properties (${HDF5_HL_CPP_LIBSH_TARGET} PROPERTIES
diff --git a/hl/fortran/src/CMakeLists.txt b/hl/fortran/src/CMakeLists.txt
index c870aed..3fc66c4 100644
--- a/hl/fortran/src/CMakeLists.txt
+++ b/hl/fortran/src/CMakeLists.txt
@@ -77,7 +77,7 @@ set (HDF5_HL_F90_HEADERS ${HDF5_HL_F90_SRC_SOURCE_DIR}/H5LTf90proto.h)
add_library (${HDF5_HL_F90_C_LIB_TARGET} STATIC ${HDF5_HL_F90_C_SOURCES} ${HDF5_HL_F90_HEADERS})
TARGET_C_PROPERTIES (${HDF5_HL_F90_C_LIB_TARGET} STATIC " " " ")
-target_link_libraries (${HDF5_HL_F90_C_LIB_TARGET} ${HDF5_F90_C_LIB_TARGET} ${HDF5_HL_LIB_TARGET})
+target_link_libraries (${HDF5_HL_F90_C_LIB_TARGET} PUBLIC ${HDF5_F90_C_LIB_TARGET} ${HDF5_HL_LIB_TARGET})
set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_HL_F90_C_LIB_TARGET}")
H5_SET_LIB_OPTIONS (${HDF5_HL_F90_C_LIB_TARGET} ${HDF5_HL_F90_C_LIB_NAME} STATIC)
set_target_properties (${HDF5_HL_F90_C_LIB_TARGET} PROPERTIES
@@ -90,7 +90,7 @@ set (install_targets ${HDF5_HL_F90_C_LIB_TARGET})
if (BUILD_SHARED_LIBS)
add_library (${HDF5_HL_F90_C_LIBSH_TARGET} SHARED ${HDF5_HL_F90_C_SOURCES} ${HDF5_HL_F90_HEADERS})
TARGET_C_PROPERTIES (${HDF5_HL_F90_C_LIBSH_TARGET} SHARED " " " ")
- target_link_libraries (${HDF5_HL_F90_C_LIBSH_TARGET} ${HDF5_F90_C_LIBSH_TARGET} ${HDF5_HL_LIBSH_TARGET})
+ target_link_libraries (${HDF5_HL_F90_C_LIBSH_TARGET} PUBLIC ${HDF5_F90_C_LIBSH_TARGET} ${HDF5_HL_LIBSH_TARGET})
set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_HL_F90_C_LIBSH_TARGET}")
H5_SET_LIB_OPTIONS (${HDF5_HL_F90_C_LIBSH_TARGET} ${HDF5_HL_F90_C_LIB_NAME} SHARED ${HDF5_HL_F_PACKAGE_SOVERSION})
set_target_properties (${HDF5_HL_F90_C_LIBSH_TARGET} PROPERTIES
@@ -170,7 +170,7 @@ endif ()
add_library (${HDF5_HL_F90_LIB_TARGET} STATIC ${HDF5_HL_F90_F_SOURCES})
TARGET_FORTRAN_PROPERTIES (${HDF5_HL_F90_LIB_TARGET} STATIC " " " ")
-target_link_libraries (${HDF5_HL_F90_LIB_TARGET} ${HDF5_HL_F90_C_LIB_TARGET} ${HDF5_F90_LIB_TARGET})
+target_link_libraries (${HDF5_HL_F90_LIB_TARGET} PUBLIC ${HDF5_HL_F90_C_LIB_TARGET} ${HDF5_F90_LIB_TARGET})
set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_HL_F90_LIB_TARGET}")
H5_SET_LIB_OPTIONS (${HDF5_HL_F90_LIB_TARGET} ${HDF5_HL_F90_LIB_NAME} STATIC)
set_target_properties (${HDF5_HL_F90_LIB_TARGET} PROPERTIES
@@ -194,7 +194,7 @@ if (BUILD_SHARED_LIBS)
set (SHARED_LINK_FLAGS "/DLL /DEF:${HDF5_HL_F90_SRC_BINARY_DIR}/hdf5_hl_fortrandll.def")
endif ()
TARGET_FORTRAN_PROPERTIES (${HDF5_HL_F90_LIBSH_TARGET} SHARED " " ${SHARED_LINK_FLAGS})
- target_link_libraries (${HDF5_HL_F90_LIBSH_TARGET} ${HDF5_HL_F90_C_LIBSH_TARGET} ${HDF5_F90_LIBSH_TARGET})
+ target_link_libraries (${HDF5_HL_F90_LIBSH_TARGET} PUBLIC ${HDF5_HL_F90_C_LIBSH_TARGET} ${HDF5_F90_LIBSH_TARGET})
set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_HL_F90_LIBSH_TARGET}")
H5_SET_LIB_OPTIONS (${HDF5_HL_F90_LIBSH_TARGET} ${HDF5_HL_F90_LIB_NAME} SHARED ${HDF5_HL_F_PACKAGE_SOVERSION})
set_target_properties (${HDF5_HL_F90_LIBSH_TARGET} PROPERTIES
diff --git a/hl/src/CMakeLists.txt b/hl/src/CMakeLists.txt
index 86472fb..3dd6ce8 100644
--- a/hl/src/CMakeLists.txt
+++ b/hl/src/CMakeLists.txt
@@ -31,7 +31,7 @@ set (HL_HEADERS
add_library (${HDF5_HL_LIB_TARGET} STATIC ${HL_SOURCES} ${HL_HEADERS})
TARGET_C_PROPERTIES (${HDF5_HL_LIB_TARGET} STATIC " " " ")
-target_link_libraries (${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET})
+target_link_libraries (${HDF5_HL_LIB_TARGET} PUBLIC ${HDF5_LIB_TARGET})
H5_SET_LIB_OPTIONS (${HDF5_HL_LIB_TARGET} ${HDF5_HL_LIB_NAME} STATIC)
set_target_properties (${HDF5_HL_LIB_TARGET} PROPERTIES
FOLDER libraries/hl
@@ -43,7 +43,7 @@ set (install_targets ${HDF5_HL_LIB_TARGET})
if (BUILD_SHARED_LIBS)
add_library (${HDF5_HL_LIBSH_TARGET} SHARED ${HL_SOURCES} ${HL_HEADERS})
TARGET_C_PROPERTIES (${HDF5_HL_LIBSH_TARGET} SHARED " " " ")
- target_link_libraries (${HDF5_HL_LIBSH_TARGET} ${HDF5_LIBSH_TARGET})
+ target_link_libraries (${HDF5_HL_LIBSH_TARGET} PUBLIC ${HDF5_LIBSH_TARGET})
H5_SET_LIB_OPTIONS (${HDF5_HL_LIBSH_TARGET} ${HDF5_HL_LIB_NAME} SHARED ${HDF5_HL_PACKAGE_SOVERSION})
set_target_properties (${HDF5_HL_LIBSH_TARGET} PROPERTIES
FOLDER libraries/hl
diff --git a/java/src/hdf/hdf5lib/H5.java b/java/src/hdf/hdf5lib/H5.java
index 7b5b5c9..78ebbe2 100644
--- a/java/src/hdf/hdf5lib/H5.java
+++ b/java/src/hdf/hdf5lib/H5.java
@@ -4451,7 +4451,7 @@ public class H5 implements java.io.Serializable {
// //
// ////////////////////////////////////////////////////////////
- // Generic property list routines
+ // /////// Generic property list routines ///////
/**
* H5Pget_class_name retrieves the name of a generic property list class
@@ -4767,7 +4767,7 @@ public class H5 implements java.io.Serializable {
public synchronized static native int H5Piterate(long plist, int[] idx, H5P_iterate_cb op, H5P_iterate_t op_data) throws HDF5LibraryException;
- // Object creation property list (OCPL) routines
+ // /////// Object creation property list (OCPL) routines ///////
/**
* H5Pget_attr_phase_change retrieves attribute storage phase change thresholds.
@@ -5071,7 +5071,7 @@ public class H5 implements java.io.Serializable {
public synchronized static native int H5Pset_fletcher32(long plist) throws HDF5LibraryException,
NullPointerException;
- // File creation property list (FCPL) routines
+ // /////// File creation property list (FCPL) routines ///////
/**
* H5Pget_userblock retrieves the size of a user block in a file creation property list.
@@ -5480,7 +5480,7 @@ public class H5 implements java.io.Serializable {
throws HDF5LibraryException, IllegalArgumentException;
- // File access property list (FAPL) routines
+ // /////// File access property list (FAPL) routines ///////
/**
* H5Pget_alignment retrieves the current settings for alignment properties from a file access property list.
@@ -5860,6 +5860,37 @@ public class H5 implements java.io.Serializable {
public synchronized static native void H5Pset_metadata_read_attempts(long plist_id, long attempts)
throws HDF5LibraryException;
+ /**
+ * H5Pget_evict_on_close retrieves the file access property list setting that determines whether an HDF5 object
+ * will be evicted from the library's metadata cache when it is closed.
+ *
+ * @param fapl_id
+ * IN: File access property list identifier
+ *
+ * @return indication if the object will be evicted on close.
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ *
+ **/
+ public synchronized static native boolean H5Pget_evict_on_close(long fapl_id)
+ throws HDF5LibraryException;
+
+ /**
+ * H5Pset_evict_on_close controls the library's behavior of evicting metadata associated with a closed object.
+ *
+ * @param fapl_id
+ * IN: File access property list identifier
+ * @param evict_on_close
+ * IN: Whether the HDF5 object should be evicted on close.
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ *
+ **/
+ public synchronized static native void H5Pset_evict_on_close(long fapl_id, boolean evict_on_close)
+ throws HDF5LibraryException;
+
// Dataset creation property list (DCPL) routines //
/**
@@ -6066,6 +6097,36 @@ public class H5 implements java.io.Serializable {
**/
public synchronized static native String H5Pget_virtual_dsetname(long dcpl_id, long index) throws HDF5LibraryException, IllegalArgumentException;
+// ///// unimplemented /////
+// /**
+// * H5Pget_vds_file_cache_size retrieves the size of the vds link open file cache.
+// *
+// * @param fapl_id
+// * IN: File access property list identifier
+// *
+// * @return VDS link open file cache size in number of files.
+// *
+// * @exception HDF5LibraryException
+// * - Error from the HDF-5 Library.
+// *
+// **/
+// public synchronized static native int H5Pget_vds_file_cache_size(long fapl_id) throws HDF5LibraryException;
+//
+// /**
+// * H5Pset_vds_file_cache_size sets the number of files that can be held open in an vds link open file cache.
+// *
+// * @param fapl_id
+// * IN: File access property list identifier
+// * @param efc_size
+// * IN: VDS link open file cache size in number of files.
+// *
+// * @exception HDF5LibraryException
+// * - Error from the HDF-5 Library.
+// *
+// **/
+// public synchronized static native void H5Pset_vds_file_cache_size(long fapl_id, int efc_size)
+// throws HDF5LibraryException;
+
/**
* H5Pget_external returns information about an external file.
*
@@ -6285,7 +6346,37 @@ public class H5 implements java.io.Serializable {
public synchronized static native int H5Pset_fill_time(long plist_id, int fill_time) throws HDF5LibraryException,
NullPointerException;
- // Dataset access property list (DAPL) routines //
+ // /////// Dataset creation property list (DCPL) routines ///////
+
+ /**
+ * H5Pset_chunk_opts Sets the edge chunk option in a dataset creation property list.
+ *
+ * @param dcpl_id
+ * IN: Dataset creation property list identifier
+ * @param opts
+ * IN: Edge chunk option flag. Valid values are:
+ * H5D_CHUNK_DONT_FILTER_PARTIAL_CHUNKS - filters are not applied to partial edge chunks.
+ * 0 - Disables option; partial edge chunks will be compressed.
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library
+ **/
+ public synchronized static native void H5Pset_chunk_opts(long dcpl_id, int opts) throws HDF5LibraryException;
+
+ /**
+ * H5Pget_chunk_opts retrieves the edge chunk option setting stored in the dataset creation property list .
+ *
+ * @param dcpl_id
+ * IN: Dataset creation property list
+
+ * @return The edge chunk option setting.
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library
+ **/
+ public synchronized static native int H5Pget_chunk_opts(long dcpl_id) throws HDF5LibraryException;
+
+ // /////// Dataset access property list (DAPL) routines ///////
/**
* Retrieves the maximum possible number of elements in the meta data cache and the maximum possible number of bytes
@@ -6388,12 +6479,76 @@ public class H5 implements java.io.Serializable {
**/
public synchronized static native long H5Pget_virtual_printf_gap(long dapl_id) throws HDF5LibraryException;
+ /**
+ * H5Pget_virtual_prefix Retrieves prefix applied to virtual file paths.
+ *
+ * @param dapl_id
+ * IN: Link access property list identifier
+ *
+ * @return the prefix to be applied to virtual file paths.
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ *
+ **/
+ public synchronized static native String H5Pget_virtual_prefix(long dapl_id)
+ throws HDF5LibraryException;
+
+ /**
+ * H5Pset_virtual_prefix Sets prefix to be applied to virtual file paths.
+ *
+ * @param dapl_id
+ * IN: Dataset access property list identifier
+ * @param prefix
+ * IN: Prefix to be applied to virtual file paths
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ * @exception NullPointerException
+ * - prefix is null.
+ *
+ **/
+ public synchronized static native void H5Pset_virtual_prefix(long dapl_id, String prefix)
+ throws HDF5LibraryException, NullPointerException;
+
+ /**
+ * H5Pget_efile_prefix Retrieves prefix applied to external file paths.
+ *
+ * @param dapl_id
+ * IN: Link access property list identifier
+ *
+ * @return the prefix to be applied to external file paths.
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ *
+ **/
+ public synchronized static native String H5Pget_efile_prefix(long dapl_id)
+ throws HDF5LibraryException;
+
+ /**
+ * H5Pset_efile_prefix Sets prefix to be applied to external file paths.
+ *
+ * @param dapl_id
+ * IN: Dataset access property list identifier
+ * @param prefix
+ * IN: Prefix to be applied to external file paths
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ * @exception NullPointerException
+ * - prefix is null.
+ *
+ **/
+ public synchronized static native void H5Pset_efile_prefix(long dapl_id, String prefix)
+ throws HDF5LibraryException, NullPointerException;
+
// public synchronized static native void H5Pset_append_flush(long plist_id, int ndims, long[] boundary, H5D_append_cb func, H5D_append_t udata) throws HDF5LibraryException;
// public synchronized static native void H5Pget_append_flush(long plist_id, int dims, long[] boundary, H5D_append_cb func, H5D_append_t udata) throws HDF5LibraryException;
- // Dataset xfer property list (DXPL) routines //
+ // /////// Dataset xfer property list (DXPL) routines ///////
/**
* H5Pget_data_transform retrieves the data transform expression previously set in the dataset transfer property
@@ -6544,7 +6699,7 @@ public class H5 implements java.io.Serializable {
public synchronized static native int H5Pset_hyper_vector_size(long dxpl_id, long vector_size)
throws HDF5LibraryException, NullPointerException;
- // Link creation property list (LCPL) routines //
+ // /////// Link creation property list (LCPL) routines ///////
/**
* H5Pget_create_intermediate_group determines whether property is set to enable creating missing intermediate
@@ -6579,7 +6734,7 @@ public class H5 implements java.io.Serializable {
public synchronized static native int H5Pset_create_intermediate_group(long lcpl_id, boolean crt_intermed_group)
throws HDF5LibraryException;
- // Group creation property list (GCPL) routines //
+ // /////// Group creation property list (GCPL) routines ///////
/**
* H5Pget_local_heap_size_hint Retrieves the anticipated size of the local heap for original-style groups.
@@ -6736,14 +6891,14 @@ public class H5 implements java.io.Serializable {
public synchronized static native int H5Pset_link_creation_order(long gcpl_id, int crt_order_flags)
throws HDF5LibraryException;
- // String creation property list (STRCPL) routines //
+ // /////// String creation property list (STRCPL) routines ///////
public synchronized static native int H5Pget_char_encoding(long plist_id) throws HDF5LibraryException;
public synchronized static native void H5Pset_char_encoding(long plist_id, int encoding)
throws HDF5LibraryException;
- // Link access property list (LAPL) routines //
+ // /////// Link access property list (LAPL) routines ///////
/**
* H5Pget_nlinks retrieves the maximum number of soft or user-defined link traversals allowed, nlinks, before the
@@ -6896,7 +7051,7 @@ public class H5 implements java.io.Serializable {
public synchronized static native int H5Pset_elink_acc_flags(long lapl_id, int flags) throws HDF5LibraryException,
IllegalArgumentException;
- // Object copy property list (OCPYPL) routines //
+ // /////// Object copy property list (OCPYPL) routines ///////
/**
* H5Pget_copy_object retrieves the properties to be used when an object is copied.
@@ -6927,7 +7082,7 @@ public class H5 implements java.io.Serializable {
public synchronized static native void H5Pset_copy_object(long ocp_plist_id, int copy_options)
throws HDF5LibraryException;
- // Other/Older property list routines //
+ // /////// Other/Older property list routines ///////
/**
* H5Pget_version retrieves the version information of various objects for a file creation property list.
@@ -6955,7 +7110,7 @@ public class H5 implements java.io.Serializable {
public synchronized static native int H5Pget_version(long plist, int[] version_info) throws HDF5LibraryException,
NullPointerException, IllegalArgumentException;
- // file drivers property list routines //
+ // /////// file drivers property list routines ///////
public synchronized static native void H5Pget_fapl_core(long fapl_id, long[] increment, boolean[] backing_store)
throws HDF5LibraryException, NullPointerException;
@@ -7102,20 +7257,28 @@ public class H5 implements java.io.Serializable {
// File creation property list (FCPL) routines //
// File access property list (FAPL) routines //
- // herr_t H5Pset_driver( hid_t plist_id, hid_t new_driver_id, const void *new_driver_info )
- // const void *H5Pget_driver_info( hid_t plist_id )
- // herr_t H5Pget_multi_type ( hid_t fapl_id, H5FD_mem_t *type )
- // herr_t H5Pset_multi_type ( hid_t fapl_id, H5FD_mem_t type )
+ // herr_t H5Pset_driver(hid_t plist_id, hid_t new_driver_id, const void *new_driver_info)
+ // const void *H5Pget_driver_info(hid_t plist_id)
+ // herr_t H5Pget_multi_type(hid_t fapl_id, H5FD_mem_t *type)
+ // herr_t H5Pset_multi_type(hid_t fapl_id, H5FD_mem_t type)
// herr_t H5Pget_file_image(hid_t fapl_id, void **buf_ptr_ptr, size_t *buf_len_ptr);
// herr_t H5Pset_file_image(hid_t fapl_id, void *buf_ptr, size_t buf_len);
// herr_t H5Pget_file_image_callbacks(hid_t fapl_id, H5FD_file_image_callbacks_t *callbacks_ptr);
// herr_t H5Pset_file_image_callbacks(hid_t fapl_id, H5FD_file_image_callbacks_t *callbacks_ptr);
// herr_t H5Pset_core_write_tracking(hid_t fapl_id, hbool_t is_enabled, size_t page_size);
// herr_t H5Pget_core_write_tracking(hid_t fapl_id, hbool_t *is_enabled, size_t *page_size);
+ // herr_t H5Pset_all_coll_metadata_ops(hid_t accpl_id, hbool_t is_collective);
+ // herr_t H5Pset_coll_metadata_write(hid_t fapl_id, hbool_t is_collective);
+ // herr_t H5Pget_coll_metadata_write(hid_t fapl_id, hbool_t *is_collective);
+ // herr_t H5Pget_page_buffer_size(hid_t fapl_id, size_t *buf_size, unsigned *min_meta_perc, unsigned *min_raw_perc);
+ // herr_t H5Pset_object_flush_cb (hid_t fapl_id, H5F_flush_cb_t func, void *user_data);
+ // herr_t H5Pget_object_flush_cb (hid_t fapl_id, H5F_flush_cb_t *func, void **user_data);
// Dataset creation property list (DCPL) routines //
// Dataset access property list (DAPL) routines //
+ // herr_t H5Pset_append_flush (hid_t dapl_id, int ndims, const hsize_t boundary[], H5D_append_cb_t func, void *user_data);
+ // herr_t H5Pget_append_flush(hid_t dapl_id, int ndims, hsize_t boundary[], H5D_append_cb_t *func, void **user_data)
// Dataset xfer property list (DXPL) routines //
// herr_t H5Pset_buffer(hid_t plist_id, size_t size, void *tconv, void *bkg);
diff --git a/java/src/hdf/hdf5lib/HDF5Constants.java b/java/src/hdf/hdf5lib/HDF5Constants.java
index 8a3d6c8..3e43ba2 100644
--- a/java/src/hdf/hdf5lib/HDF5Constants.java
+++ b/java/src/hdf/hdf5lib/HDF5Constants.java
@@ -88,6 +88,7 @@ public class HDF5Constants {
public static final int H5D_VDS_ERROR = H5D_VDS_ERROR();
public static final int H5D_VDS_FIRST_MISSING = H5D_VDS_FIRST_MISSING();
public static final int H5D_VDS_LAST_AVAILABLE = H5D_VDS_LAST_AVAILABLE();
+ public static final int H5D_CHUNK_DONT_FILTER_PARTIAL_CHUNKS = H5D_CHUNK_DONT_FILTER_PARTIAL_CHUNKS();
public static final int H5E_MAJOR = H5E_MAJOR();
public static final int H5E_MINOR = H5E_MINOR();
@@ -768,6 +769,8 @@ public class HDF5Constants {
private static native final int H5D_VDS_LAST_AVAILABLE();
+ private static native final int H5D_CHUNK_DONT_FILTER_PARTIAL_CHUNKS();
+
private static native final long H5E_ALIGNMENT();
private static native final long H5E_ALREADYEXISTS();
diff --git a/java/src/hdf/overview.html b/java/src/hdf/overview.html
index 39d75b7..9c19442 100644
--- a/java/src/hdf/overview.html
+++ b/java/src/hdf/overview.html
@@ -47,20 +47,20 @@ which has a method:
The native method is implemented in C using the
<a href="http://java.sun.com/javase/6/docs/technotes/guides/jni/index.html">Java
Native Method Interface </a>(JNI). This is written something like the following:
-<pre><b>JNIEXPORT jint
+<pre><b>JNIEXPORT jlong
JNICALL Java_hdf_hdf5lib_H5_H5Fopen
(
&nbsp;JNIEnv *env,
&nbsp;jclass class,
&nbsp;jstring hdfFile,
&nbsp;jint flags,
-&nbsp;jint access)
+&nbsp;jlong access)
&nbsp;{
&nbsp;/* ...convert Java String to (char *) */
&nbsp;/* call the HDF library */
-&nbsp;retVal = H5Fopen((char *)file, (unsigned)flags, (hid_t)access );
+&nbsp;retVal = H5Fopen((char *)file, (unsigned)flags, (hid_t)access);
&nbsp;/* ... */
}</b></pre>
diff --git a/java/src/jni/CMakeLists.txt b/java/src/jni/CMakeLists.txt
index 9e6c099..10d1b6d 100644
--- a/java/src/jni/CMakeLists.txt
+++ b/java/src/jni/CMakeLists.txt
@@ -51,7 +51,7 @@ set (CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE ON)
########### JNI libraries always must be built shared ###############
add_library (${HDF5_JAVA_JNI_LIB_TARGET} SHARED ${HDF5_JAVA_JNI_CSRCS} ${HDF5_JAVA_JNI_CHDRS})
TARGET_C_PROPERTIES (${HDF5_JAVA_JNI_LIB_TARGET} SHARED " " " ")
-target_link_libraries (${HDF5_JAVA_JNI_LIB_TARGET} ${HDF5_LIB_TARGET})
+target_link_libraries (${HDF5_JAVA_JNI_LIB_TARGET} PUBLIC ${HDF5_LIB_TARGET})
set_target_properties (${HDF5_JAVA_JNI_LIB_TARGET} PROPERTIES FOLDER libraries/jni)
SET_GLOBAL_VARIABLE (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_JAVA_JNI_LIB_TARGET}")
H5_SET_LIB_OPTIONS (${HDF5_JAVA_JNI_LIB_TARGET} ${HDF5_JAVA_JNI_LIB_NAME} SHARED ${HDF5_JAVA_PACKAGE_SOVERSION})
diff --git a/java/src/jni/h5Constants.c b/java/src/jni/h5Constants.c
index f6f8bfa..5a4b53e 100644
--- a/java/src/jni/h5Constants.c
+++ b/java/src/jni/h5Constants.c
@@ -140,6 +140,8 @@ JNIEXPORT jint JNICALL
Java_hdf_hdf5lib_HDF5Constants_H5D_1VDS_1FIRST_1MISSING(JNIEnv *env, jclass cls) { return H5D_VDS_FIRST_MISSING; }
JNIEXPORT jint JNICALL
Java_hdf_hdf5lib_HDF5Constants_H5D_1VDS_1LAST_1AVAILABLE(JNIEnv *env, jclass cls) { return H5D_VDS_LAST_AVAILABLE; }
+JNIEXPORT jint JNICALL
+Java_hdf_hdf5lib_HDF5Constants_H5D_1CHUNK_1DONT_1FILTER_1PARTIAL_1CHUNKS(JNIEnv *env, jclass cls) { return H5D_CHUNK_DONT_FILTER_PARTIAL_CHUNKS; }
JNIEXPORT jlong JNICALL
Java_hdf_hdf5lib_HDF5Constants_H5E_1ALIGNMENT(JNIEnv *env, jclass cls) { return H5E_ALIGNMENT; }
diff --git a/java/src/jni/h5pImp.c b/java/src/jni/h5pImp.c
index dcfcd82..cf27341 100644
--- a/java/src/jni/h5pImp.c
+++ b/java/src/jni/h5pImp.c
@@ -5733,6 +5733,217 @@ Java_hdf_hdf5lib_H5_H5Pset_1metadata_1read_1attempts
} /* end else */
} /* end Java_hdf_hdf5lib_H5_H5Pset_1metadata_1read_1attempts */
+
+/*
+ * Class: hdf_hdf5lib_H5
+ * Method: H5Pset_virtual_prefix
+ * Signature: (JLjava/lang/String;)V
+ */
+JNIEXPORT void JNICALL
+Java_hdf_hdf5lib_H5_H5Pset_1virtual_1prefix
+ (JNIEnv *env, jclass clss, jlong dapl_id, jstring prefix)
+{
+ herr_t retVal = -1;
+ const char *aName;
+
+ PIN_JAVA_STRING(prefix, aName);
+ if (aName != NULL) {
+ retVal = H5Pset_virtual_prefix((hid_t)dapl_id, aName);
+
+ UNPIN_JAVA_STRING(prefix, aName);
+
+ if(retVal < 0)
+ h5libraryError(env);
+ }
+} /* end Java_hdf_hdf5lib_H5_H5Pset_1virtual_1prefix */
+
+/*
+ * Class: hdf_hdf5lib_H5
+ * Method: H5Pget_virtual_prefix
+ * Signature: (J)Ljava/lang/String;
+ */
+JNIEXPORT jstring JNICALL
+Java_hdf_hdf5lib_H5_H5Pget_1virtual_1prefix
+ (JNIEnv *env, jclass clss, jlong dapl_id)
+{
+ size_t size = 0;
+ char *pre;
+ jlong prefix_size = -1;
+ jstring str = NULL;
+
+ prefix_size = (jlong)H5Pget_virtual_prefix((hid_t)dapl_id, (char*)NULL, size);
+ if(prefix_size < 0) {
+ h5libraryError(env);
+ } /* end if */
+ else {
+ size = (size_t)prefix_size + 1;/* add extra space for the null terminator */
+ pre = (char*)HDmalloc(sizeof(char)*size);
+ if (pre == NULL) {
+ h5outOfMemory(env, "H5Pget_virtual_prefix: malloc failed ");
+ } /* end if */
+ else {
+ prefix_size = (jlong)H5Pget_virtual_prefix((hid_t)dapl_id, (char*)pre, size);
+
+ if (prefix_size >= 0) {
+ str = ENVPTR->NewStringUTF(ENVPAR pre);
+ HDfree(pre);
+ if (str == NULL)
+ h5JNIFatalError( env, "H5Pget_virtual_prefix: return string not allocated");
+ } /* end if */
+ else {
+ HDfree(pre);
+ h5libraryError(env);
+ } /* end else */
+ } /* end else */
+ } /* end else */
+
+ return (jstring)str;
+} /* end Java_hdf_hdf5lib_H5_H5Pget_1virtual_1prefix */
+
+/*
+ * Class: hdf_hdf5lib_H5
+ * Method: H5Pset_efile_prefix
+ * Signature: (JLjava/lang/String;)V
+ */
+JNIEXPORT void JNICALL
+Java_hdf_hdf5lib_H5_H5Pset_1efile_1prefix
+ (JNIEnv *env, jclass clss, jlong dapl_id, jstring prefix)
+{
+ herr_t retVal = -1;
+ const char *aName;
+
+ PIN_JAVA_STRING(prefix, aName);
+ if (aName != NULL) {
+ retVal = H5Pset_efile_prefix((hid_t)dapl_id, aName);
+
+ UNPIN_JAVA_STRING(prefix, aName);
+
+ if(retVal < 0)
+ h5libraryError(env);
+ }
+} /* end Java_hdf_hdf5lib_H5_H5Pset_1efile_1prefix */
+
+/*
+ * Class: hdf_hdf5lib_H5
+ * Method: H5Pget_efile_prefix
+ * Signature: (J)Ljava/lang/String;
+ */
+JNIEXPORT jstring JNICALL
+Java_hdf_hdf5lib_H5_H5Pget_1efile_1prefix
+ (JNIEnv *env, jclass clss, jlong dapl_id)
+{
+ size_t size = 0;
+ char *pre;
+ jlong prefix_size = -1;
+ jstring str = NULL;
+
+ prefix_size = (jlong)H5Pget_efile_prefix((hid_t)dapl_id, (char*)NULL, size);
+ if(prefix_size < 0) {
+ h5libraryError(env);
+ } /* end if */
+ else {
+ size = (size_t)prefix_size + 1;/* add extra space for the null terminator */
+ pre = (char*)HDmalloc(sizeof(char)*size);
+ if (pre == NULL) {
+ h5outOfMemory(env, "H5Pget_efile_prefix: malloc failed ");
+ } /* end if */
+ else {
+ prefix_size = (jlong)H5Pget_efile_prefix((hid_t)dapl_id, (char*)pre, size);
+
+ if (prefix_size >= 0) {
+ str = ENVPTR->NewStringUTF(ENVPAR pre);
+ HDfree(pre);
+ if (str == NULL)
+ h5JNIFatalError( env, "H5Pget_efile_prefix: return string not allocated");
+ } /* end if */
+ else {
+ HDfree(pre);
+ h5libraryError(env);
+ } /* end else */
+ } /* end else */
+ } /* end else */
+
+ return (jstring)str;
+} /* end Java_hdf_hdf5lib_H5_H5Pget_1efile_1prefix */
+
+/*
+ * Class: hdf_hdf5lib_H5
+ * Method: H5Pset_evict_on_close
+ * Signature: (JZ)V
+ */
+JNIEXPORT void JNICALL
+Java_hdf_hdf5lib_H5_H5Pset_1evict_1on_1close
+ (JNIEnv *env, jclass clss, jlong fapl_id, jboolean evict_on_close)
+{
+ herr_t retVal = -1;
+ hbool_t evict_on_close_val;
+
+ if (evict_on_close == JNI_TRUE)
+ evict_on_close_val = TRUE;
+ else
+ evict_on_close_val = FALSE;
+
+ retVal = H5Pset_evict_on_close((hid_t)fapl_id, (hbool_t)evict_on_close_val);
+ if (retVal < 0)
+ h5libraryError(env);
+} /* end Java_hdf_hdf5lib_H5_H5Pset_1evict_1on_1close */
+
+/*
+ * Class: hdf_hdf5lib_H5
+ * Method: H5Pget_evict_on_close
+ * Signature: (J)Z
+ */
+JNIEXPORT jboolean JNICALL
+Java_hdf_hdf5lib_H5_H5Pget_1evict_1on_1close
+ (JNIEnv *env, jclass clss, jlong fapl_id)
+{
+ hbool_t evict_on_close_val = FALSE;
+ jboolean bval = JNI_FALSE;
+
+ if (H5Pget_evict_on_close((hid_t)fapl_id, (hbool_t *)&evict_on_close_val) < 0) {
+ h5libraryError(env);
+ } /* end if */
+ else {
+ if (evict_on_close_val == TRUE)
+ bval = JNI_TRUE;
+ } /* end else */
+
+ return bval;
+} /* end Java_hdf_hdf5lib_H5_H5Pget_1evict_1on_1close */
+
+/*
+ * Class: hdf_hdf5lib_H5
+ * Method: H5Pset_chunk_opts
+ * Signature: (JI)V
+ */
+JNIEXPORT void JNICALL
+Java_hdf_hdf5lib_H5_H5Pset_1chunk_1opts
+ (JNIEnv *env, jclass clss, jlong dcpl_id, jint opts)
+{
+ herr_t retVal = -1;
+
+ retVal = H5Pset_chunk_opts((hid_t)dcpl_id, (unsigned)opts);
+ if (retVal < 0)
+ h5libraryError(env);
+} /* end Java_hdf_hdf5lib_H5_H5Pset_1chunk_1opts */
+
+/*
+ * Class: hdf_hdf5lib_H5
+ * Method: H5Pget_chunk_opts
+ * Signature: (J)I
+ */
+JNIEXPORT jint JNICALL
+Java_hdf_hdf5lib_H5_H5Pget_1chunk_1opts
+ (JNIEnv *env, jclass clss, jlong dcpl_id)
+{
+ unsigned opts = 0;
+
+ if (H5Pget_chunk_opts((hid_t)dcpl_id, opts) < 0)
+ h5libraryError(env);
+
+ return (jint)opts;
+} /* end Java_hdf_hdf5lib_H5_H5Pget_1chunk_1opts */
+
#ifdef __cplusplus
} /* end extern "C" */
#endif /* __cplusplus */
diff --git a/java/src/jni/h5pImp.h b/java/src/jni/h5pImp.h
index d413f69..1d12e3d 100644
--- a/java/src/jni/h5pImp.h
+++ b/java/src/jni/h5pImp.h
@@ -1533,7 +1533,6 @@ JNIEXPORT jlong JNICALL
Java_hdf_hdf5lib_H5_H5Pget_1metadata_1read_1attempts
(JNIEnv *, jclass, jlong);
-
/*
* Class: hdf_hdf5lib_H5
* Method: H5Pset_metadata_read_attempts
@@ -1543,6 +1542,78 @@ JNIEXPORT void JNICALL
Java_hdf_hdf5lib_H5_H5Pset_1metadata_1read_1attempts
(JNIEnv *, jclass, jlong, jlong);
+/*
+ * Class: hdf_hdf5lib_H5
+ * Method: H5Pset_virtual_prefix
+ * Signature: (JLjava/lang/String;)V
+ */
+JNIEXPORT void JNICALL
+Java_hdf_hdf5lib_H5_H5Pset_1virtual_1prefix
+(JNIEnv *, jclass, jlong, jstring);
+
+/*
+ * Class: hdf_hdf5lib_H5
+ * Method: H5Pget_virtual_prefix
+ * Signature: (J)Ljava/lang/String;
+ */
+JNIEXPORT jstring JNICALL
+Java_hdf_hdf5lib_H5_H5Pget_1virtual_1prefix
+(JNIEnv *, jclass, jlong);
+
+/*
+ * Class: hdf_hdf5lib_H5
+ * Method: H5Pset_efile_prefix
+ * Signature: (JLjava/lang/String;)V
+ */
+JNIEXPORT void JNICALL
+Java_hdf_hdf5lib_H5_H5Pset_1efile_1prefix
+(JNIEnv *, jclass, jlong, jstring);
+
+/*
+ * Class: hdf_hdf5lib_H5
+ * Method: H5Pget_efile_prefix
+ * Signature: (J)Ljava/lang/String;
+ */
+JNIEXPORT jstring JNICALL
+Java_hdf_hdf5lib_H5_H5Pget_1efile_1prefix
+(JNIEnv *, jclass, jlong);
+
+/*
+ * Class: hdf_hdf5lib_H5
+ * Method: H5Pset_evict_on_close
+ * Signature: (JZ)V
+ */
+JNIEXPORT void JNICALL
+Java_hdf_hdf5lib_H5_H5Pset_1evict_1on_1close
+(JNIEnv *, jclass, jlong, jboolean);
+
+/*
+ * Class: hdf_hdf5lib_H5
+ * Method: H5Pget_evict_on_close
+ * Signature: (J)Z
+ */
+JNIEXPORT jboolean JNICALL
+Java_hdf_hdf5lib_H5_H5Pget_1evict_1on_1close
+(JNIEnv *, jclass, jlong);
+
+/*
+ * Class: hdf_hdf5lib_H5
+ * Method: H5Pset_chunk_opts
+ * Signature: (JI)V
+ */
+JNIEXPORT void JNICALL
+Java_hdf_hdf5lib_H5_H5Pset_1chunk_1opts
+(JNIEnv *, jclass, jlong, jint);
+
+/*
+ * Class: hdf_hdf5lib_H5
+ * Method: H5Pget_chunk_opts
+ * Signature: (J)I
+ */
+JNIEXPORT jint JNICALL
+Java_hdf_hdf5lib_H5_H5Pget_1chunk_1opts
+(JNIEnv *, jclass, jlong);
+
#ifdef __cplusplus
} /* end extern "C" */
diff --git a/java/test/JUnit-interface.txt b/java/test/JUnit-interface.txt
index ab2f3b1..91ea286 100644
--- a/java/test/JUnit-interface.txt
+++ b/java/test/JUnit-interface.txt
@@ -415,6 +415,7 @@ JUnit version 4.11
.testH5PH5Pset_shared_mesg_phase_change_HighMaxlistValue
.testH5P_layout
.testH5Pget_link_creation_order
+.testH5Pget_efile_prefix
.testH5Pset_shared_mesg_nindexes_InvalidHIGHnindexes
.testH5P_file_space_page_size
.testH5Pget_shared_mesg_index_Invalid_indexnum
@@ -444,6 +445,7 @@ JUnit version 4.11
.testH5Pset_est_link_info_InvalidValues
.testH5Pset_local_heap_size_hint
.testH5Pget_est_link_info
+.testH5Pset_efile_prefix_null
.testH5Pset_scaleoffset
.testH5Pset_create_intermediate_group_invalidobject
.testH5PH5Pset_shared_mesg_phase_change_HighMinbtreeValue
@@ -466,6 +468,7 @@ JUnit version 4.11
.testH5Pget_sym_k_null
.testH5Pset_nlinks
.testH5P_obj_track_times
+.testH5Pset_efile_prefix
.testH5P_userblock
.testH5Pget_local_heap_size_hint
.testH5Pset_shared_mesg_index_Invalid_indexnum
@@ -504,6 +507,7 @@ JUnit version 4.11
.testH5Pset_mdc_config
.testH5P_small_data_block_size
.testH5Pset_fapl_log
+.testH5P_evict_on_close
.testH5Pset_libver_bounds
.testH5P_sieve_buf_size
.testH5P_elink_file_cache_size
@@ -530,11 +534,14 @@ JUnit version 4.11
.testH5Pget_source_datasetname
.testH5Pvirtual_storage
.testH5Pget_selection_source_dataset
+.testH5Pget_virtual_prefix
.testH5Pget_source_filename
.testH5Pset_get_virtual_printf_gap
.testH5Pget_virtual_count
+.testH5Pset_virtual_prefix
.testH5Pset_get_virtual_view
.testH5Pget_mapping_parameters
+.testH5Pset_virtual_prefix_null
.testH5P_genprop_basic_class
.testH5P_genprop_class_iter
.testH5P_genprop_basic_class_prop
@@ -640,7 +647,7 @@ JUnit version 4.11
Time: XXXX
-OK (638 tests)
+OK (645 tests)
HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs):
#000: (file name) line (number) in H5Fopen(): can't set access and transfer property lists
diff --git a/java/test/TestH5P.java b/java/test/TestH5P.java
index 5aafb5b..9e45e4c 100644
--- a/java/test/TestH5P.java
+++ b/java/test/TestH5P.java
@@ -28,6 +28,7 @@ import hdf.hdf5lib.exceptions.HDF5LibraryException;
import org.junit.After;
import org.junit.Before;
+import org.junit.Ignore;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TestName;
@@ -852,7 +853,7 @@ public class TestH5P {
}
catch (Throwable err) {
err.printStackTrace();
- fail("H5Pset_est_link_info: " + err);
+ fail("H5Pset_elink_prefix: " + err);
}
assertTrue("H5Pset_elink_prefix", ret_val >= 0);
}
@@ -1232,4 +1233,54 @@ public class TestH5P {
fail("testH5P_file_space_page_size: " + err);
}
}
+
+ @Test
+ public void testH5Pset_efile_prefix() {
+ String prefix = "tmp";
+ try {
+ H5.H5Pset_efile_prefix(lapl_id, prefix);
+ }
+ catch (Throwable err) {
+ err.printStackTrace();
+ fail("H5Pset_efile_prefix: " + err);
+ }
+ }
+
+ @Test(expected = NullPointerException.class)
+ public void testH5Pset_efile_prefix_null() throws Throwable{
+ H5.H5Pset_efile_prefix(lapl_id, null);
+ }
+
+ @Test
+ public void testH5Pget_efile_prefix() {
+ String prefix = "tmp";
+ String pre = "";
+
+ try {
+ H5.H5Pset_efile_prefix(lapl_id, prefix);
+ pre = H5.H5Pget_efile_prefix(lapl_id);
+ }
+ catch (Throwable err) {
+ err.printStackTrace();
+ fail("H5Pget_efile_prefix: " + err);
+ }
+ assertTrue("The prefix: ", prefix.equals(pre));
+ }
+
+ @Ignore
+ public void testH5P_chunk_opts() {
+ int chunk_opts = -1;
+
+ try {
+ chunk_opts = H5.H5Pget_chunk_opts(ocpl_id);
+ assertTrue("chunk_opts: "+chunk_opts, chunk_opts == 0);
+ H5.H5Pset_chunk_opts(ocpl_id, HDF5Constants.H5D_CHUNK_DONT_FILTER_PARTIAL_CHUNKS);
+ chunk_opts = H5.H5Pget_chunk_opts(ocpl_id);
+ assertTrue("chunk_opts: "+chunk_opts, chunk_opts == HDF5Constants.H5D_CHUNK_DONT_FILTER_PARTIAL_CHUNKS);
+ }
+ catch (Throwable err) {
+ err.printStackTrace();
+ fail("H5Pget_lchunk_opts: " + err);
+ }
+ }
}
diff --git a/java/test/TestH5Pfapl.java b/java/test/TestH5Pfapl.java
index d4a2231..48a5986 100644
--- a/java/test/TestH5Pfapl.java
+++ b/java/test/TestH5Pfapl.java
@@ -1376,4 +1376,18 @@ public class TestH5Pfapl {
deleteH5file();
_deleteLogFile();
}
+
+ @Test
+ public void testH5P_evict_on_close() {
+ boolean ret_val_id = false;
+ try {
+ H5.H5Pset_evict_on_close(fapl_id, true);
+ ret_val_id = H5.H5Pget_evict_on_close(fapl_id);
+ assertTrue("H5P_evict_on_close", ret_val_id);
+ }
+ catch (Throwable err) {
+ err.printStackTrace();
+ fail("H5P_evict_on_close: " + err);
+ }
+ }
}
diff --git a/java/test/TestH5Pvirtual.java b/java/test/TestH5Pvirtual.java
index 40cfbac..ff2e4dc 100644
--- a/java/test/TestH5Pvirtual.java
+++ b/java/test/TestH5Pvirtual.java
@@ -429,4 +429,37 @@ public class TestH5Pvirtual {
try {H5.H5Dclose(H5did);} catch (Exception ex) {}
}
}
+
+ @Test
+ public void testH5Pset_virtual_prefix() {
+ String prefix = "tmp";
+ try {
+ H5.H5Pset_virtual_prefix(H5dapl_id, prefix);
+ }
+ catch (Throwable err) {
+ err.printStackTrace();
+ fail("H5Pset_virtual_prefix: " + err);
+ }
+ }
+
+ @Test(expected = NullPointerException.class)
+ public void testH5Pset_virtual_prefix_null() throws Throwable{
+ H5.H5Pset_virtual_prefix(H5dapl_id, null);
+ }
+
+ @Test
+ public void testH5Pget_virtual_prefix() {
+ String prefix = "tmp";
+ String pre = "";
+
+ try {
+ H5.H5Pset_virtual_prefix(H5dapl_id, prefix);
+ pre = H5.H5Pget_virtual_prefix(H5dapl_id);
+ }
+ catch (Throwable err) {
+ err.printStackTrace();
+ fail("H5Pget_virtual_prefix: " + err);
+ }
+ assertTrue("The prefix: ", prefix.equals(pre));
+ }
}
diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt
index 7498d01..3882c4c 100644
--- a/release_docs/RELEASE.txt
+++ b/release_docs/RELEASE.txt
@@ -58,7 +58,21 @@ New Features
Library:
--------
- -
+ - Add prefix option to VDS files.
+
+ Currently, VDS source files must be in the active directory to be
+ found by the virtual file. Adding the option of a prefix to be set
+ on the virtual file, using a data access property list (DAPL),
+ allows the source files to located at an absolute or relative path
+ to the virtual file.
+
+ New public APIs:
+ herr_t H5Pset_virtual_prefix(hid_t dapl_id, const char* prefix);
+ ssize_t H5Pget_virtual_prefix(hid_t dapl_id, char* prefix /*out*/, size_t size);
+ The prefix can also be set with an environment variable, HDF5_VDS_PREFIX.
+
+ (ADB - 2017/12/12, HDFFV-9724)
+
Parallel Library:
-----------------
@@ -119,6 +133,20 @@ New Features
------------
-
+ Java Library:
+ ----------------
+ - Wrappers added for the following APIs:
+ H5Pset_evict_on_close
+ H5Pget_evict_on_close
+ H5Pset_chunk_opts
+ H5Pget_chunk_opts
+ H5Pset_efile_prefix
+ H5Pget_efile_prefix
+ H5Pset_virtual_prefix
+ H5Pget_virtual_prefix
+
+ (ADB - 2017/12/20)
+
Tools:
------
- h5diff
@@ -213,7 +241,7 @@ Bug Fixes since HDF5-1.10.1 release
CMake implementation for MPI was problematic and would create incorrect
MPI library references in the hdf5 libraries.
- Reworked the CMake MPI code to properly create CMake targets.Also merged
+ Reworked the CMake MPI code to properly create CMake targets. Also merged
the latest CMake FindMPI.cmake changes to the local copy. This is necessary
until HDF changes the CMake minimum to 3.9 or greater.
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index b163b8a..0552244 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -885,10 +885,7 @@ add_library (${HDF5_LIB_TARGET} STATIC ${common_SRCS} ${gen_SRCS} ${H5_PUBLIC_HE
TARGET_C_PROPERTIES (${HDF5_LIB_TARGET} STATIC " " " ")
target_link_libraries (${HDF5_LIB_TARGET} PRIVATE ${LINK_LIBS} ${LINK_COMP_LIBS})
if (NOT WIN32)
- target_link_libraries (${HDF5_LIB_TARGET} PUBLIC dl)
-endif ()
-if (H5_HAVE_PARALLEL AND MPI_C_FOUND)
- target_include_directories (${HDF5_LIB_TARGET} PUBLIC ${MPI_C_INCLUDE_DIRS})
+ target_link_libraries (${HDF5_LIB_TARGET} PUBLIC ${CMAKE_DL_LIBS})
endif ()
set_global_variable (HDF5_LIBRARIES_TO_EXPORT ${HDF5_LIB_TARGET})
H5_SET_LIB_OPTIONS (${HDF5_LIB_TARGET} ${HDF5_LIB_NAME} STATIC)
@@ -929,10 +926,7 @@ if (BUILD_SHARED_LIBS)
TARGET_C_PROPERTIES (${HDF5_LIBSH_TARGET} SHARED " " " ")
target_link_libraries (${HDF5_LIBSH_TARGET} PRIVATE ${LINK_LIBS} ${LINK_COMP_LIBS})
if (NOT WIN32)
- target_link_libraries (${HDF5_LIBSH_TARGET} PUBLIC dl)
- endif ()
- if (H5_HAVE_PARALLEL AND MPI_C_FOUND)
- target_include_directories (${HDF5_LIBSH_TARGET} PUBLIC ${MPI_C_INCLUDE_DIRS})
+ target_link_libraries (${HDF5_LIBSH_TARGET} PUBLIC ${CMAKE_DL_LIBS})
endif ()
set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_LIBSH_TARGET}")
H5_SET_LIB_OPTIONS (${HDF5_LIBSH_TARGET} ${HDF5_LIB_NAME} SHARED ${HDF5_PACKAGE_SOVERSION})
diff --git a/src/H5Dint.c b/src/H5Dint.c
index b6c0341..bfe1497 100644
--- a/src/H5Dint.c
+++ b/src/H5Dint.c
@@ -61,8 +61,8 @@ static herr_t H5D__cache_dataspace_info(const H5D_t *dset);
static herr_t H5D__init_space(H5F_t *file, const H5D_t *dset, const H5S_t *space);
static herr_t H5D__update_oh_info(H5F_t *file, hid_t dxpl_id, H5D_t *dset,
hid_t dapl_id);
-static herr_t H5D_build_extfile_prefix(const H5D_t *dset, hid_t dapl_id,
- char **extfile_prefix);
+static herr_t H5D_build_file_prefix(const H5D_t *dset, hid_t dapl_id, const char * prefix_type,
+ char **file_prefix);
static herr_t H5D__open_oid(H5D_t *dataset, hid_t dapl_id, hid_t dxpl_id);
static herr_t H5D__init_storage(const H5D_io_info_t *io_info, hbool_t full_overwrite,
hsize_t old_dim[]);
@@ -963,24 +963,25 @@ done:
} /* end H5D__update_oh_info() */
+
/*--------------------------------------------------------------------------
- * Function: H5D_build_extfile_prefix
+ * Function: H5D_build_file_prefix
*
- * Purpose: Determine the external file prefix to be used and store
- * it in extfile_prefix. Stores an empty string if no prefix
+ * Purpose: Determine the file prefix to be used and store
+ * it in file_prefix. Stores an empty string if no prefix
* should be used.
*
* Return: SUCCEED/FAIL
*--------------------------------------------------------------------------
*/
static herr_t
-H5D_build_extfile_prefix(const H5D_t *dset, hid_t dapl_id, char **extfile_prefix /*out*/)
+H5D_build_file_prefix(const H5D_t *dset, hid_t dapl_id, const char *prefix_type, char **file_prefix /*out*/)
{
char *prefix = NULL; /* prefix used to look for the file */
- char *extpath = NULL; /* absolute path of directory the HDF5 file is in */
- size_t extpath_len; /* length of extpath */
+ char *filepath = NULL; /* absolute path of directory the HDF5 file is in */
+ size_t filepath_len; /* length of file path */
size_t prefix_len; /* length of prefix */
- size_t extfile_prefix_len; /* length of expanded prefix */
+ size_t file_prefix_len; /* length of expanded prefix */
H5P_genplist_t *plist = NULL; /* Property list pointer */
herr_t ret_value = SUCCEED; /* Return value */
@@ -990,20 +991,25 @@ H5D_build_extfile_prefix(const H5D_t *dset, hid_t dapl_id, char **extfile_prefix
HDassert(dset);
HDassert(dset->oloc.file);
- extpath = H5F_EXTPATH(dset->oloc.file);
- HDassert(extpath);
+ filepath = H5F_EXTPATH(dset->oloc.file);
+ HDassert(filepath);
/* XXX: Future thread-safety note - getenv is not required
* to be reentrant.
*/
- prefix = HDgetenv("HDF5_EXTFILE_PREFIX");
+ if (HDstrcmp(prefix_type, H5D_ACS_VDS_PREFIX_NAME) == 0)
+ prefix = HDgetenv("HDF5_VDS_PREFIX");
+ else if (HDstrcmp(prefix_type, H5D_ACS_EFILE_PREFIX_NAME) == 0)
+ prefix = HDgetenv("HDF5_EXTFILE_PREFIX");
+ else
+ HGOTO_ERROR(H5E_PLIST, H5E_BADTYPE, FAIL, "prefix name is not sensible")
if(prefix == NULL || *prefix == '\0') {
- /* Set prefix to value of H5D_ACS_EFILE_PREFIX_NAME property */
+ /* Set prefix to value of prefix_type property */
if(NULL == (plist = H5P_object_verify(dapl_id, H5P_DATASET_ACCESS)))
HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
- if(H5P_peek(plist, H5D_ACS_EFILE_PREFIX_NAME, &prefix) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get external file prefix")
+ if(H5P_peek(plist, prefix_type, &prefix) < 0)
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get file prefix")
} /* end if */
/* Prefix has to be checked for NULL / empty string again because the
@@ -1013,29 +1019,29 @@ H5D_build_extfile_prefix(const H5D_t *dset, hid_t dapl_id, char **extfile_prefix
/* filename is interpreted as relative to the current directory,
* does not need to be expanded
*/
- if(NULL == (*extfile_prefix = (char *)H5MM_strdup("")))
+ if(NULL == (*file_prefix = (char *)H5MM_strdup("")))
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed")
} /* end if */
else {
if (HDstrncmp(prefix, "${ORIGIN}", HDstrlen("${ORIGIN}")) == 0) {
/* Replace ${ORIGIN} at beginning of prefix by directory of HDF5 file */
- extpath_len = HDstrlen(extpath);
+ filepath_len = HDstrlen(filepath);
prefix_len = HDstrlen(prefix);
- extfile_prefix_len = extpath_len + prefix_len - HDstrlen("${ORIGIN}") + 1;
+ file_prefix_len = filepath_len + prefix_len - HDstrlen("${ORIGIN}") + 1;
- if(NULL == (*extfile_prefix = (char *)H5MM_malloc(extfile_prefix_len)))
+ if(NULL == (*file_prefix = (char *)H5MM_malloc(file_prefix_len)))
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "unable to allocate buffer")
- HDsnprintf(*extfile_prefix, extfile_prefix_len, "%s%s", extpath, prefix + HDstrlen("${ORIGIN}"));
+ HDsnprintf(*file_prefix, file_prefix_len, "%s%s", filepath, prefix + HDstrlen("${ORIGIN}"));
} /* end if */
else {
- if(NULL == (*extfile_prefix = (char *)H5MM_strdup(prefix)))
+ if(NULL == (*file_prefix = (char *)H5MM_strdup(prefix)))
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed")
} /* end else */
} /* end else */
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* H5D_build_extfile_prefix() */
+} /* H5D_build_file_prefix() */
/*-------------------------------------------------------------------------
@@ -1217,9 +1223,13 @@ H5D__create(H5F_t *file, hid_t type_id, const H5S_t *space, hid_t dcpl_id,
HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, NULL, "unable to set up flush append property")
/* Set the external file prefix */
- if(H5D_build_extfile_prefix(new_dset, dapl_id, &new_dset->shared->extfile_prefix) < 0)
+ if(H5D_build_file_prefix(new_dset, dapl_id, H5D_ACS_EFILE_PREFIX_NAME, &new_dset->shared->extfile_prefix) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, NULL, "unable to initialize external file prefix")
+ /* Set the vds file prefix */
+ if(H5D_build_file_prefix(new_dset, dapl_id, H5D_ACS_VDS_PREFIX_NAME, &new_dset->shared->vds_prefix) < 0)
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, NULL, "unable to initialize vds prefix")
+
/* Add the dataset to the list of opened objects in the file */
if(H5FO_top_incr(new_dset->oloc.file, new_dset->oloc.addr) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTINC, NULL, "can't incr object ref. count")
@@ -1265,6 +1275,7 @@ done:
if(new_dset->shared->dcpl_id != 0 && H5I_dec_ref(new_dset->shared->dcpl_id) < 0)
HDONE_ERROR(H5E_DATASET, H5E_CANTDEC, NULL, "unable to decrement ref count on property list")
new_dset->shared->extfile_prefix = (char *)H5MM_xfree(new_dset->shared->extfile_prefix);
+ new_dset->shared->vds_prefix = (char *)H5MM_xfree(new_dset->shared->vds_prefix);
new_dset->shared = H5FL_FREE(H5D_shared_t, new_dset->shared);
} /* end if */
new_dset->oloc.file = NULL;
@@ -1351,6 +1362,7 @@ H5D_open(const H5G_loc_t *loc, hid_t dapl_id, hid_t dxpl_id)
H5D_shared_t *shared_fo = NULL;
H5D_t *dataset = NULL;
char *extfile_prefix = NULL; /* Expanded external file prefix */
+ char *vds_prefix = NULL; /* Expanded vds prefix */
H5D_t *ret_value = NULL; /* Return value */
FUNC_ENTER_NOAPI(NULL)
@@ -1371,9 +1383,13 @@ H5D_open(const H5G_loc_t *loc, hid_t dapl_id, hid_t dxpl_id)
HGOTO_ERROR(H5E_DATASET, H5E_CANTCOPY, NULL, "can't copy path")
/* Get the external file prefix */
- if(H5D_build_extfile_prefix(dataset, dapl_id, &extfile_prefix) < 0)
+ if(H5D_build_file_prefix(dataset, dapl_id, H5D_ACS_EFILE_PREFIX_NAME, &extfile_prefix) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, NULL, "unable to initialize external file prefix")
+ /* Get the vds prefix */
+ if(H5D_build_file_prefix(dataset, dapl_id, H5D_ACS_VDS_PREFIX_NAME, &vds_prefix) < 0)
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, NULL, "unable to initialize vds prefix")
+
/* Check if dataset was already open */
if(NULL == (shared_fo = (H5D_shared_t *)H5FO_opened(dataset->oloc.file, dataset->oloc.addr))) {
/* Clear any errors from H5FO_opened() */
@@ -1399,6 +1415,11 @@ H5D_open(const H5G_loc_t *loc, hid_t dapl_id, hid_t dxpl_id)
/* Prevent string from being freed during done: */
extfile_prefix = NULL;
+ /* Set the vds file prefix */
+ dataset->shared->vds_prefix = vds_prefix;
+ /* Prevent string from being freed during done: */
+ vds_prefix = NULL;
+
} /* end if */
else {
/* Point to shared info */
@@ -1430,12 +1451,14 @@ H5D_open(const H5G_loc_t *loc, hid_t dapl_id, hid_t dxpl_id)
done:
extfile_prefix = (char *)H5MM_xfree(extfile_prefix);
+ vds_prefix = (char *)H5MM_xfree(vds_prefix);
if(ret_value == NULL) {
/* Free the location--casting away const*/
if(dataset) {
if(shared_fo == NULL && dataset->shared) { /* Need to free shared fo */
dataset->shared->extfile_prefix = (char *)H5MM_xfree(dataset->shared->extfile_prefix);
+ dataset->shared->vds_prefix = (char *)H5MM_xfree(dataset->shared->vds_prefix);
dataset->shared = H5FL_FREE(H5D_shared_t, dataset->shared);
}
@@ -1818,6 +1841,9 @@ H5D_close(H5D_t *dataset)
/* Free the external file prefix */
dataset->shared->extfile_prefix = (char *)H5MM_xfree(dataset->shared->extfile_prefix);
+ /* Free the vds file prefix */
+ dataset->shared->vds_prefix = (char *)H5MM_xfree(dataset->shared->vds_prefix);
+
/* Release layout, fill-value, efl & pipeline messages */
if(dataset->shared->dcpl_id != H5P_DATASET_CREATE_DEFAULT)
free_failed |= (H5O_msg_reset(H5O_PLINE_ID, &dataset->shared->dcpl_cache.pline) < 0) ||
@@ -3360,6 +3386,10 @@ H5D_get_access_plist(H5D_t *dset)
if(H5P_set(new_plist, H5D_ACS_VDS_PRINTF_GAP_NAME, &(dset->shared->layout.storage.u.virt.printf_gap)) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set VDS printf gap")
+ /* Set the vds prefix option */
+ if(H5P_set(new_plist, H5D_ACS_VDS_PREFIX_NAME, &(dset->shared->vds_prefix)) < 0)
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set vds prefix")
+
/* Set the external file prefix option */
if(H5P_set(new_plist, H5D_ACS_EFILE_PREFIX_NAME, &(dset->shared->extfile_prefix)) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set external file prefix")
diff --git a/src/H5Dpkg.h b/src/H5Dpkg.h
index 542abd0..45f2d3a 100644
--- a/src/H5Dpkg.h
+++ b/src/H5Dpkg.h
@@ -476,6 +476,7 @@ typedef struct H5D_shared_t {
H5D_append_flush_t append_flush; /* Append flush property information */
char *extfile_prefix; /* expanded external file prefix */
+ char *vds_prefix; /* expanded vds prefix */
} H5D_shared_t;
struct H5D_t {
@@ -598,7 +599,7 @@ H5_DLL herr_t H5D_set_io_info_dxpls(H5D_io_info_t *io_info, hid_t dxpl_id);
H5_DLL herr_t H5D__format_convert(H5D_t *dataset, hid_t dxpl_id);
/* Internal I/O routines */
-H5_DLL herr_t H5D__pre_write(H5D_t *dset, hbool_t direct_write, hid_t mem_type_id,
+H5_DLL herr_t H5D__pre_write(H5D_t *dset, hbool_t direct_write, hid_t mem_type_id,
const H5S_t *mem_space, const H5S_t *file_space, hid_t dxpl_id, const void *buf);
H5_DLL herr_t H5D__read(H5D_t *dataset, hid_t mem_type_id,
const H5S_t *mem_space, const H5S_t *file_space, hid_t dset_xfer_plist,
diff --git a/src/H5Dprivate.h b/src/H5Dprivate.h
index fb994d8..ed13467 100644
--- a/src/H5Dprivate.h
+++ b/src/H5Dprivate.h
@@ -47,12 +47,13 @@
#define H5D_CRT_EXT_FILE_LIST_NAME "efl" /* External file list */
/* ======== Dataset access property names ======== */
-#define H5D_ACS_DATA_CACHE_NUM_SLOTS_NAME "rdcc_nslots" /* Size of raw data chunk cache(slots) */
-#define H5D_ACS_DATA_CACHE_BYTE_SIZE_NAME "rdcc_nbytes" /* Size of raw data chunk cache(bytes) */
-#define H5D_ACS_PREEMPT_READ_CHUNKS_NAME "rdcc_w0" /* Preemption read chunks first */
-#define H5D_ACS_VDS_VIEW_NAME "vds_view" /* VDS view option */
+#define H5D_ACS_DATA_CACHE_NUM_SLOTS_NAME "rdcc_nslots" /* Size of raw data chunk cache(slots) */
+#define H5D_ACS_DATA_CACHE_BYTE_SIZE_NAME "rdcc_nbytes" /* Size of raw data chunk cache(bytes) */
+#define H5D_ACS_PREEMPT_READ_CHUNKS_NAME "rdcc_w0" /* Preemption read chunks first */
+#define H5D_ACS_VDS_VIEW_NAME "vds_view" /* VDS view option */
#define H5D_ACS_VDS_PRINTF_GAP_NAME "vds_printf_gap" /* VDS printf gap size */
-#define H5D_ACS_APPEND_FLUSH_NAME "append_flush" /* Append flush actions */
+#define H5D_ACS_VDS_PREFIX_NAME "vds_prefix" /* VDS file prefix */
+#define H5D_ACS_APPEND_FLUSH_NAME "append_flush" /* Append flush actions */
#define H5D_ACS_EFILE_PREFIX_NAME "external file prefix" /* External file prefix */
/* ======== Data transfer properties ======== */
diff --git a/src/H5Dvirtual.c b/src/H5Dvirtual.c
index 3be2353..306fe62 100644
--- a/src/H5Dvirtual.c
+++ b/src/H5Dvirtual.c
@@ -55,6 +55,7 @@
#include "H5Iprivate.h" /* IDs */
#include "H5MMprivate.h" /* Memory management */
#include "H5Oprivate.h" /* Object headers */
+#include "H5Pprivate.h" /* Property Lists */
#include "H5Sprivate.h" /* Dataspaces */
@@ -731,6 +732,255 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5D__virtual_delete */
+
+/*--------------------------------------------------------------------------
+ * Function: H5D__virtual_build_name
+ *
+ * Purpose: Prepend PREFIX to FILE_NAME and store in FULL_NAME
+ *
+ * Return: Non-negative on success/Negative on failure
+ *--------------------------------------------------------------------------*/
+static herr_t
+H5D__virtual_build_name(char *prefix, char *file_name, char **full_name/*out*/)
+{
+ size_t prefix_len; /* length of prefix */
+ size_t fname_len; /* Length of external link file name */
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_NOAPI_NOINIT
+
+ prefix_len = HDstrlen(prefix);
+ fname_len = HDstrlen(file_name);
+
+ /* Allocate a buffer to hold the filename + prefix + possibly the delimiter + terminating null byte */
+ if(NULL == (*full_name = (char *)H5MM_malloc(prefix_len + fname_len + 2)))
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "unable to allocate filename buffer")
+
+ /* Compose the full file name */
+ HDsnprintf(*full_name, (prefix_len + fname_len + 2), "%s%s%s", prefix,
+ (H5_CHECK_DELIMITER(prefix[prefix_len - 1]) ? "" : H5_DIR_SEPS), file_name);
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* H5D__virtual_build_name() */
+
+
+/*--------------------------------------------------------------------------
+ * Function: H5D_getenv_prefix_name --
+ *
+ * Purpose: Get the first pathname in the list of pathnames stored in env_prefix,
+ * which is separated by the environment delimiter.
+ * env_prefix is modified to point to the remaining pathnames
+ * in the list.
+ *
+ * Return: A pointer to a pathname
+--------------------------------------------------------------------------*/
+static char *
+H5D_getenv_prefix_name(char **env_prefix/*in,out*/)
+{
+ char *retptr=NULL;
+ char *strret=NULL;
+
+ FUNC_ENTER_NOAPI_NOINIT_NOERR
+
+ strret = HDstrchr(*env_prefix, H5_COLON_SEPC);
+ if (strret == NULL) {
+ retptr = *env_prefix;
+ *env_prefix = strret;
+ } else {
+ retptr = *env_prefix;
+ *env_prefix = strret + 1;
+ *strret = '\0';
+ }
+
+ FUNC_LEAVE_NOAPI(retptr)
+} /* end H5D_getenv_prefix_name() */
+
+/*-------------------------------------------------------------------------
+ * Function: H5D__virtual_open_file
+ *
+ * Purpose: Attempts to open a source dataset file.
+ *
+ * Return: Non-negative on success/Negative on failure
+ *-------------------------------------------------------------------------
+ */
+static H5F_t *
+H5D__virtual_open_file(hid_t plist_id, const H5F_t *vdset_file,
+ const char *file_name,
+ hid_t fapl_id, hid_t dxpl_id)
+{
+ H5F_t *src_file = NULL; /* Source file */
+ H5F_t *ret_value = NULL; /* Actual return value */
+ char *full_name = NULL; /* File name with prefix */
+ char *my_prefix = NULL; /* Library's copy of the prefix */
+ unsigned intent; /* File access permissions */
+ char *actual_file_name = NULL; /* Virtual file's actual name */
+ char *temp_file_name = NULL; /* Temporary pointer to file name */
+ size_t temp_file_name_len; /* Length of temporary file name */
+
+ FUNC_ENTER_STATIC
+
+ /* Simplify intent flags for open calls */
+ intent = H5F_INTENT(vdset_file);
+ intent &= (H5F_ACC_RDWR | H5F_ACC_SWMR_WRITE | H5F_ACC_SWMR_READ);
+
+ /* Copy the file name to use */
+ if(NULL == (temp_file_name = H5MM_strdup(file_name)))
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed")
+ temp_file_name_len = HDstrlen(temp_file_name);
+
+ /* target file_name is an absolute pathname: see RM for detailed description */
+ if(H5_CHECK_ABSOLUTE(file_name) || H5_CHECK_ABS_PATH(file_name)) {
+ /* Try opening file */
+ if(NULL == (src_file = H5F_open(file_name, intent, H5P_FILE_CREATE_DEFAULT, fapl_id, dxpl_id))) {
+ char *ptr;
+
+ H5E_clear_stack(NULL);
+
+ /* get last component of file_name */
+ H5_GET_LAST_DELIMITER(file_name, ptr)
+ HDassert(ptr);
+
+ /* Increment past delimiter */
+ ptr++;
+
+ /* Copy into the temp. file name */
+ HDstrncpy(temp_file_name, ptr, temp_file_name_len);
+ temp_file_name[temp_file_name_len - 1] = '\0';
+ } /* end if */
+ } /* end if */
+ else if(H5_CHECK_ABS_DRIVE(file_name)) {
+ /* Try opening file */
+ if(NULL == (src_file = H5F_open(file_name, intent, H5P_FILE_CREATE_DEFAULT, fapl_id, dxpl_id))) {
+
+ H5E_clear_stack(NULL);
+
+ /* strip "<drive-letter>:" */
+ HDstrncpy(temp_file_name, &file_name[2], temp_file_name_len);
+ temp_file_name[temp_file_name_len - 1] = '\0';
+ } /* end if */
+ } /* end if */
+
+ /* try searching from paths set in the environment variable */
+ if(src_file == NULL) {
+ char *env_prefix;
+
+ if(NULL != (env_prefix = HDgetenv("HDF5_VDS_PREFIX"))) {
+ char *tmp_env_prefix, *saved_env;
+
+ if(NULL == (saved_env = tmp_env_prefix = H5MM_strdup(env_prefix)))
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed")
+
+ while((tmp_env_prefix) && (*tmp_env_prefix)) {
+ char *out_prefix_name;
+
+ out_prefix_name = H5D_getenv_prefix_name(&tmp_env_prefix/*in,out*/);
+ if(out_prefix_name && (*out_prefix_name)) {
+ if(H5D__virtual_build_name(out_prefix_name, temp_file_name, &full_name/*out*/) < 0) {
+ saved_env = (char *)H5MM_xfree(saved_env);
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, NULL, "can't prepend prefix to filename")
+ } /* end if */
+
+ src_file = H5F_open(full_name, intent, H5P_FILE_CREATE_DEFAULT, fapl_id, dxpl_id);
+ full_name = (char *)H5MM_xfree(full_name);
+ if(src_file != NULL)
+ break;
+ H5E_clear_stack(NULL);
+ } /* end if */
+ } /* end while */
+ saved_env = (char *)H5MM_xfree(saved_env);
+ } /* end if */
+ } /* end if */
+
+ /* try searching from property list */
+ if(src_file == NULL) {
+ size_t size = 0;
+ H5E_BEGIN_TRY {
+ size = H5Pget_virtual_prefix(plist_id, NULL, 0);
+ } H5E_END_TRY;
+ if(size <= 0)
+ my_prefix = NULL;
+ else {
+ /* Allocate a buffer to hold the filename + prefix + possibly the delimiter + terminating null byte */
+ if(NULL == (my_prefix = (char *)H5MM_malloc(size + 1)))
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "unable to allocate prefix buffer")
+ if(H5Pget_virtual_prefix(plist_id, my_prefix, size+1) < 0)
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't get vds prefix")
+ if(my_prefix) {
+ if(H5D__virtual_build_name(my_prefix, temp_file_name, &full_name/*out*/) < 0)
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, NULL, "can't prepend prefix to filename")
+ my_prefix = (char *)H5MM_xfree(my_prefix);
+ if(NULL == (src_file = H5F_open(full_name, intent, H5P_FILE_CREATE_DEFAULT, fapl_id, dxpl_id)))
+ H5E_clear_stack(NULL);
+ full_name = (char *)H5MM_xfree(full_name);
+ }
+ } /* end if */
+ } /* end if */
+
+ /* try searching from main file's "extpath": see description in H5F_open() & H5_build_extpath() */
+ if(src_file == NULL) {
+ char *vdspath;
+
+ if(NULL != (vdspath = H5F_EXTPATH(vdset_file))) {
+ if(H5D__virtual_build_name(vdspath, temp_file_name, &full_name/*out*/) < 0)
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, NULL, "can't prepend prefix to filename")
+ if(NULL == (src_file = H5F_open(full_name, intent, H5P_FILE_CREATE_DEFAULT, fapl_id, dxpl_id)))
+ H5E_clear_stack(NULL);
+ full_name = (char *)H5MM_xfree(full_name);
+ } /* end if */
+ } /* end if */
+
+ /* try the relative file_name stored in temp_file_name */
+ if(src_file == NULL) {
+ if(NULL == (src_file = H5F_open(temp_file_name, intent, H5P_FILE_CREATE_DEFAULT, fapl_id, dxpl_id)))
+ H5E_clear_stack(NULL);
+ } /* end if */
+
+ /* try the 'resolved' name for the virtual file */
+ if(src_file == NULL) {
+ char *ptr = NULL;
+
+ /* Copy resolved file name */
+ if(NULL == (actual_file_name = H5MM_strdup(H5F_ACTUAL_NAME(vdset_file))))
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, NULL, "can't duplicate resolved file name string")
+
+ /* get last component of file_name */
+ H5_GET_LAST_DELIMITER(actual_file_name, ptr)
+ if(!ptr)
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTOPENFILE, NULL, "unable to open vds file, vds file name = '%s', temp_file_name = '%s'", file_name, temp_file_name)
+
+ /* Truncate filename portion from actual file name path */
+ *ptr = '\0';
+
+ /* Build new file name for the external file */
+ if(H5D__virtual_build_name(actual_file_name, temp_file_name, &full_name/*out*/) < 0)
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, NULL, "can't prepend prefix to filename")
+ actual_file_name = (char *)H5MM_xfree(actual_file_name);
+
+ /* Try opening with the resolved name */
+ if(NULL == (src_file = H5F_open(full_name, intent, H5P_FILE_CREATE_DEFAULT, fapl_id, dxpl_id)))
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTOPENFILE, NULL, "unable to open vds file, vds file name = '%s', temp_file_name = '%s'", file_name, temp_file_name)
+ full_name = (char *)H5MM_xfree(full_name);
+ } /* end if */
+
+ /* Success */
+ ret_value = src_file;
+done:
+ if((NULL == ret_value) && src_file)
+ if(H5F_try_close(src_file, NULL) < 0)
+ HDONE_ERROR(H5E_DATASET, H5E_CANTCLOSEFILE, NULL, "can't close source file")
+ if(my_prefix)
+ my_prefix = (char *)H5MM_xfree(my_prefix);
+ if(full_name)
+ full_name = (char *)H5MM_xfree(full_name);
+ if(temp_file_name)
+ temp_file_name = (char *)H5MM_xfree(temp_file_name);
+ if(actual_file_name)
+ actual_file_name = (char *)H5MM_xfree(actual_file_name);
+
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* H5D__virtual_open_file() */
+
/*-------------------------------------------------------------------------
* Function: H5D__virtual_open_source_dset
@@ -750,9 +1000,13 @@ H5D__virtual_open_source_dset(const H5D_t *vdset,
H5O_storage_virtual_srcdset_t *source_dset, hid_t dxpl_id)
{
H5F_t *src_file = NULL; /* Source file */
+ char *vds_prefix = NULL; /* Source file vds_prefix */
hbool_t src_file_open = FALSE; /* Whether we have opened and need to close src_file */
H5G_loc_t src_root_loc; /* Object location of source file root group */
herr_t ret_value = SUCCEED; /* Return value */
+ char *full_name = NULL; /* File name with prefix */
+ unsigned intent; /* File access permissions */
+ hid_t plist_id = -1; /* Property list pointer */
FUNC_ENTER_STATIC
@@ -765,8 +1019,9 @@ H5D__virtual_open_source_dset(const H5D_t *vdset,
/* Check if we need to open the source file */
if(HDstrcmp(source_dset->file_name, ".")) {
- /* Open the source file */
- if(NULL == (src_file = H5F_open(source_dset->file_name, H5F_INTENT(vdset->oloc.file) & (H5F_ACC_RDWR | H5F_ACC_SWMR_WRITE | H5F_ACC_SWMR_READ), H5P_FILE_CREATE_DEFAULT, vdset->shared->layout.storage.u.virt.source_fapl, dxpl_id)))
+ if((plist_id = H5D_get_access_plist(vdset)) < 0)
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "Can't get access plist")
+ if(NULL == (src_file = H5D__virtual_open_file(plist_id, vdset->oloc.file, source_dset->file_name, vdset->shared->layout.storage.u.virt.source_fapl, dxpl_id)))
H5E_clear_stack(NULL); /* Quick hack until proper support for H5Fopen with missing file is implemented */
else
src_file_open = TRUE;
@@ -803,6 +1058,8 @@ H5D__virtual_open_source_dset(const H5D_t *vdset,
} /* end if */
done:
+ if(plist_id >= 0)
+ H5Pclose(plist_id);
/* Close source file */
if(src_file_open)
if(H5F_try_close(src_file, NULL) < 0)
@@ -1407,7 +1664,7 @@ H5D__virtual_set_extent_unlim(const H5D_t *dset, hid_t dxpl_id)
HGOTO_ERROR(H5E_DATASET, H5E_CANTCLIP, FAIL, "failed to clip unlimited selection")
} /* end if */
- /* Update cached values unlim_extent_source and
+ /* Update cached values unlim_extent_source and
* clip_size_virtual */
storage->list[i].unlim_extent_source = curr_dims[storage->list[i].unlim_dim_source];
storage->list[i].clip_size_virtual = clip_size;
@@ -1559,7 +1816,7 @@ H5D__virtual_set_extent_unlim(const H5D_t *dset, hid_t dxpl_id)
HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to modify size of data space")
/* Mark the space as dirty, for later writing to the file */
- if(H5F_INTENT(dset->oloc.file) & H5F_ACC_RDWR)
+ if(H5F_INTENT(dset->oloc.file) & H5F_ACC_RDWR)
if(H5D__mark(dset, dxpl_id, H5D_MARK_SPACE) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "unable to mark dataspace as dirty")
} /* end if */
@@ -2246,7 +2503,7 @@ H5D__virtual_pre_io(H5D_io_info_t *io_info,
HGOTO_ERROR(H5E_DATASET, H5E_CLOSEERROR, FAIL, "can't close projected memory space")
storage->list[i].sub_dset[j].projected_mem_space = NULL;
} /* end if */
- else
+ else
*tot_nelmts += (hsize_t)select_nelmts;
} /* end if */
} /* end for */
@@ -2265,7 +2522,7 @@ H5D__virtual_pre_io(H5D_io_info_t *io_info,
/* Check if anything is selected */
if(select_nelmts > (hssize_t)0) {
/* Open source dataset */
- if(!storage->list[i].source_dset.dset)
+ if(!storage->list[i].source_dset.dset)
/* Try to open dataset */
if(H5D__virtual_open_source_dset(io_info->dset, &storage->list[i], &storage->list[i].source_dset, io_info->md_dxpl_id) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTOPENOBJ, FAIL, "unable to open source dataset")
@@ -2506,7 +2763,7 @@ H5D__virtual_read(H5D_io_info_t *io_info, const H5D_type_info_t *type_info,
HGOTO_ERROR(H5E_DATASET, H5E_CANTCLIP, FAIL, "unable to clip fill selection")
/* Write fill values to memory buffer */
- if(H5D__fill(io_info->dset->shared->dcpl_cache.fill.buf, io_info->dset->shared->type, io_info->u.rbuf,
+ if(H5D__fill(io_info->dset->shared->dcpl_cache.fill.buf, io_info->dset->shared->type, io_info->u.rbuf,
type_info->mem_type, fill_space, io_info->md_dxpl_id) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "filling buf failed")
diff --git a/src/H5Fprivate.h b/src/H5Fprivate.h
index daf0a52..96b8e36 100644
--- a/src/H5Fprivate.h
+++ b/src/H5Fprivate.h
@@ -25,13 +25,13 @@ typedef struct H5F_t H5F_t;
#include "H5Fpublic.h"
/* Public headers needed by this file */
-#include "H5FDpublic.h" /* File drivers */
+#include "H5FDpublic.h" /* File drivers */
/* Private headers needed by this file */
#ifdef H5_HAVE_PARALLEL
-#include "H5Pprivate.h" /* Property lists */
+#include "H5Pprivate.h" /* Property lists */
#endif /* H5_HAVE_PARALLEL */
-#include "H5VMprivate.h" /* Vectors and arrays */
+#include "H5VMprivate.h" /* Vectors and arrays */
/**************************/
@@ -43,68 +43,68 @@ typedef struct H5F_t H5F_t;
* Currently, all file meta-data is little-endian.
*/
-# define INT16ENCODE(p, i) { \
- *(p) = (uint8_t)( (unsigned)(i) & 0xff); (p)++; \
- *(p) = (uint8_t)(((unsigned)(i) >> 8) & 0xff); (p)++; \
+# define INT16ENCODE(p, i) { \
+ *(p) = (uint8_t)( (unsigned)(i) & 0xff); (p)++; \
+ *(p) = (uint8_t)(((unsigned)(i) >> 8) & 0xff); (p)++; \
}
-# define UINT16ENCODE(p, i) { \
- *(p) = (uint8_t)( (unsigned)(i) & 0xff); (p)++; \
- *(p) = (uint8_t)(((unsigned)(i) >> 8) & 0xff); (p)++; \
+# define UINT16ENCODE(p, i) { \
+ *(p) = (uint8_t)( (unsigned)(i) & 0xff); (p)++; \
+ *(p) = (uint8_t)(((unsigned)(i) >> 8) & 0xff); (p)++; \
}
-# define INT32ENCODE(p, i) { \
- *(p) = (uint8_t)( (uint32_t)(i) & 0xff); (p)++; \
- *(p) = (uint8_t)(((uint32_t)(i) >> 8) & 0xff); (p)++; \
- *(p) = (uint8_t)(((uint32_t)(i) >> 16) & 0xff); (p)++; \
- *(p) = (uint8_t)(((uint32_t)(i) >> 24) & 0xff); (p)++; \
+# define INT32ENCODE(p, i) { \
+ *(p) = (uint8_t)( (uint32_t)(i) & 0xff); (p)++; \
+ *(p) = (uint8_t)(((uint32_t)(i) >> 8) & 0xff); (p)++; \
+ *(p) = (uint8_t)(((uint32_t)(i) >> 16) & 0xff); (p)++; \
+ *(p) = (uint8_t)(((uint32_t)(i) >> 24) & 0xff); (p)++; \
}
-# define UINT32ENCODE(p, i) { \
- *(p) = (uint8_t)( (i) & 0xff); (p)++; \
- *(p) = (uint8_t)(((i) >> 8) & 0xff); (p)++; \
- *(p) = (uint8_t)(((i) >> 16) & 0xff); (p)++; \
- *(p) = (uint8_t)(((i) >> 24) & 0xff); (p)++; \
+# define UINT32ENCODE(p, i) { \
+ *(p) = (uint8_t)( (i) & 0xff); (p)++; \
+ *(p) = (uint8_t)(((i) >> 8) & 0xff); (p)++; \
+ *(p) = (uint8_t)(((i) >> 16) & 0xff); (p)++; \
+ *(p) = (uint8_t)(((i) >> 24) & 0xff); (p)++; \
}
/* Encode an unsigned integer into a variable-sized buffer */
/* (Assumes that the high bits of the integer are zero) */
-# define ENCODE_VAR(p, typ, n, l) { \
- typ _n = (n); \
- size_t _i; \
- uint8_t *_p = (uint8_t*)(p); \
- \
- for(_i = 0; _i < l; _i++, _n >>= 8) \
- *_p++ = (uint8_t)(_n & 0xff); \
- (p) = (uint8_t*)(p) + l; \
+# define ENCODE_VAR(p, typ, n, l) { \
+ typ _n = (n); \
+ size_t _i; \
+ uint8_t *_p = (uint8_t*)(p); \
+ \
+ for(_i = 0; _i < l; _i++, _n >>= 8) \
+ *_p++ = (uint8_t)(_n & 0xff); \
+ (p) = (uint8_t*)(p) + l; \
}
/* Encode a 32-bit unsigned integer into a variable-sized buffer */
/* (Assumes that the high bits of the integer are zero) */
# define UINT32ENCODE_VAR(p, n, l) ENCODE_VAR(p, uint32_t, n, l)
-# define INT64ENCODE(p, n) { \
- int64_t _n = (n); \
- size_t _i; \
- uint8_t *_p = (uint8_t*)(p); \
- \
- for (_i = 0; _i < sizeof(int64_t); _i++, _n >>= 8) \
- *_p++ = (uint8_t)(_n & 0xff); \
- for (/*void*/; _i < 8; _i++) \
- *_p++ = (n) < 0 ? 0xff : 0; \
- (p) = (uint8_t*)(p)+8; \
+# define INT64ENCODE(p, n) { \
+ int64_t _n = (n); \
+ size_t _i; \
+ uint8_t *_p = (uint8_t*)(p); \
+ \
+ for (_i = 0; _i < sizeof(int64_t); _i++, _n >>= 8) \
+ *_p++ = (uint8_t)(_n & 0xff); \
+ for (/*void*/; _i < 8; _i++) \
+ *_p++ = (n) < 0 ? 0xff : 0; \
+ (p) = (uint8_t*)(p)+8; \
}
-# define UINT64ENCODE(p, n) { \
- uint64_t _n = (n); \
- size_t _i; \
- uint8_t *_p = (uint8_t*)(p); \
- \
- for (_i = 0; _i < sizeof(uint64_t); _i++, _n >>= 8) \
- *_p++ = (uint8_t)(_n & 0xff); \
- for (/*void*/; _i < 8; _i++) \
- *_p++ = 0; \
- (p) = (uint8_t*)(p) + 8; \
+# define UINT64ENCODE(p, n) { \
+ uint64_t _n = (n); \
+ size_t _i; \
+ uint8_t *_p = (uint8_t*)(p); \
+ \
+ for (_i = 0; _i < sizeof(uint64_t); _i++, _n >>= 8) \
+ *_p++ = (uint8_t)(_n & 0xff); \
+ for (/*void*/; _i < 8; _i++) \
+ *_p++ = 0; \
+ (p) = (uint8_t*)(p) + 8; \
}
/* Encode a 64-bit unsigned integer into a variable-sized buffer */
@@ -113,31 +113,31 @@ typedef struct H5F_t H5F_t;
/* Encode a 64-bit unsigned integer and its length into a variable-sized buffer */
/* (Assumes that the high bits of the integer are zero) */
-# define UINT64ENCODE_VARLEN(p, n) { \
- uint64_t __n = (uint64_t)(n); \
- unsigned _s = H5VM_limit_enc_size(__n); \
- \
- *(p)++ = (uint8_t)_s; \
- UINT64ENCODE_VAR(p, __n, _s); \
+# define UINT64ENCODE_VARLEN(p, n) { \
+ uint64_t __n = (uint64_t)(n); \
+ unsigned _s = H5VM_limit_enc_size(__n); \
+ \
+ *(p)++ = (uint8_t)_s; \
+ UINT64ENCODE_VAR(p, __n, _s); \
}
-# define H5_ENCODE_UNSIGNED(p, n) { \
- HDcompile_assert(sizeof(unsigned) == sizeof(uint32_t)); \
- UINT32ENCODE(p, n) \
+# define H5_ENCODE_UNSIGNED(p, n) { \
+ HDcompile_assert(sizeof(unsigned) == sizeof(uint32_t)); \
+ UINT32ENCODE(p, n) \
}
/* Assumes the endianness of uint64_t is the same as double */
-# define H5_ENCODE_DOUBLE(p, n) { \
- uint64_t _n; \
- size_t _u; \
- uint8_t *_p = (uint8_t*)(p); \
- \
- HDcompile_assert(sizeof(double) == 8); \
- HDcompile_assert(sizeof(double) == sizeof(uint64_t)); \
- HDmemcpy(&_n, &n, sizeof(double)); \
- for(_u = 0; _u < sizeof(uint64_t); _u++, _n >>= 8) \
- *_p++ = (uint8_t)(_n & 0xff); \
- (p) = (uint8_t *)(p) + 8; \
+# define H5_ENCODE_DOUBLE(p, n) { \
+ uint64_t _n; \
+ size_t _u; \
+ uint8_t *_p = (uint8_t*)(p); \
+ \
+ HDcompile_assert(sizeof(double) == 8); \
+ HDcompile_assert(sizeof(double) == sizeof(uint64_t)); \
+ HDmemcpy(&_n, &n, sizeof(double)); \
+ for(_u = 0; _u < sizeof(uint64_t); _u++, _n >>= 8) \
+ *_p++ = (uint8_t)(_n & 0xff); \
+ (p) = (uint8_t *)(p) + 8; \
}
/* DECODE converts little endian bytes pointed by p to integer values and store
@@ -148,68 +148,68 @@ typedef struct H5F_t H5F_t;
* correctly even if i is actually a 64bit int like in a Cray.
*/
-# define INT16DECODE(p, i) { \
- (i) = (int16_t)((*(p) & 0xff)); (p)++; \
+# define INT16DECODE(p, i) { \
+ (i) = (int16_t)((*(p) & 0xff)); (p)++; \
(i) |= (int16_t)(((*(p) & 0xff) << 8) | \
- ((*(p) & 0x80) ? ~0xffff : 0x0)); (p)++; \
+ ((*(p) & 0x80) ? ~0xffff : 0x0)); (p)++; \
}
-# define UINT16DECODE(p, i) { \
- (i) = (uint16_t) (*(p) & 0xff); (p)++; \
- (i) |= (uint16_t)((*(p) & 0xff) << 8); (p)++; \
+# define UINT16DECODE(p, i) { \
+ (i) = (uint16_t) (*(p) & 0xff); (p)++; \
+ (i) |= (uint16_t)((*(p) & 0xff) << 8); (p)++; \
}
-# define INT32DECODE(p, i) { \
- (i) = ((int32_t)(*(p) & (unsigned)0xff)); (p)++; \
- (i) |= ((int32_t)(*(p) & (unsigned)0xff) << 8); (p)++; \
- (i) |= ((int32_t)(*(p) & (unsigned)0xff) << 16); (p)++; \
+# define INT32DECODE(p, i) { \
+ (i) = ((int32_t)(*(p) & (unsigned)0xff)); (p)++; \
+ (i) |= ((int32_t)(*(p) & (unsigned)0xff) << 8); (p)++; \
+ (i) |= ((int32_t)(*(p) & (unsigned)0xff) << 16); (p)++; \
(i) |= ((int32_t)(((*(p) & (unsigned)0xff) << 24) | \
((*(p) & (unsigned)0x80) ? (unsigned)(~0xffffffff) : (unsigned)0x0))); (p)++; \
}
-# define UINT32DECODE(p, i) { \
- (i) = (uint32_t)(*(p) & 0xff); (p)++; \
- (i) |= ((uint32_t)(*(p) & 0xff) << 8); (p)++; \
- (i) |= ((uint32_t)(*(p) & 0xff) << 16); (p)++; \
- (i) |= ((uint32_t)(*(p) & 0xff) << 24); (p)++; \
+# define UINT32DECODE(p, i) { \
+ (i) = (uint32_t)(*(p) & 0xff); (p)++; \
+ (i) |= ((uint32_t)(*(p) & 0xff) << 8); (p)++; \
+ (i) |= ((uint32_t)(*(p) & 0xff) << 16); (p)++; \
+ (i) |= ((uint32_t)(*(p) & 0xff) << 24); (p)++; \
}
/* Decode a variable-sized buffer */
/* (Assumes that the high bits of the integer will be zero) */
-# define DECODE_VAR(p, n, l) { \
- size_t _i; \
- \
- n = 0; \
- (p) += l; \
- for (_i = 0; _i < l; _i++) \
- n = (n << 8) | *(--p); \
- (p) += l; \
+# define DECODE_VAR(p, n, l) { \
+ size_t _i; \
+ \
+ n = 0; \
+ (p) += l; \
+ for (_i = 0; _i < l; _i++) \
+ n = (n << 8) | *(--p); \
+ (p) += l; \
}
/* Decode a variable-sized buffer into a 32-bit unsigned integer */
/* (Assumes that the high bits of the integer will be zero) */
# define UINT32DECODE_VAR(p, n, l) DECODE_VAR(p, n, l)
-# define INT64DECODE(p, n) { \
- /* WE DON'T CHECK FOR OVERFLOW! */ \
- size_t _i; \
- \
- n = 0; \
- (p) += 8; \
- for (_i = 0; _i < sizeof(int64_t); _i++) \
- n = (n << 8) | *(--p); \
- (p) += 8; \
+# define INT64DECODE(p, n) { \
+ /* WE DON'T CHECK FOR OVERFLOW! */ \
+ size_t _i; \
+ \
+ n = 0; \
+ (p) += 8; \
+ for (_i = 0; _i < sizeof(int64_t); _i++) \
+ n = (n << 8) | *(--p); \
+ (p) += 8; \
}
-# define UINT64DECODE(p, n) { \
- /* WE DON'T CHECK FOR OVERFLOW! */ \
- size_t _i; \
- \
- n = 0; \
- (p) += 8; \
- for (_i = 0; _i < sizeof(uint64_t); _i++) \
- n = (n << 8) | *(--p); \
- (p) += 8; \
+# define UINT64DECODE(p, n) { \
+ /* WE DON'T CHECK FOR OVERFLOW! */ \
+ size_t _i; \
+ \
+ n = 0; \
+ (p) += 8; \
+ for (_i = 0; _i < sizeof(uint64_t); _i++) \
+ n = (n << 8) | *(--p); \
+ (p) += 8; \
}
/* Decode a variable-sized buffer into a 64-bit unsigned integer */
@@ -218,58 +218,58 @@ typedef struct H5F_t H5F_t;
/* Decode a 64-bit unsigned integer and its length from a variable-sized buffer */
/* (Assumes that the high bits of the integer will be zero) */
-# define UINT64DECODE_VARLEN(p, n) { \
- unsigned _s = *(p)++; \
- \
- UINT64DECODE_VAR(p, n, _s); \
+# define UINT64DECODE_VARLEN(p, n) { \
+ unsigned _s = *(p)++; \
+ \
+ UINT64DECODE_VAR(p, n, _s); \
}
-# define H5_DECODE_UNSIGNED(p, n) { \
- HDcompile_assert(sizeof(unsigned) == sizeof(uint32_t)); \
- UINT32DECODE(p, n) \
+# define H5_DECODE_UNSIGNED(p, n) { \
+ HDcompile_assert(sizeof(unsigned) == sizeof(uint32_t)); \
+ UINT32DECODE(p, n) \
}
/* Assumes the endianness of uint64_t is the same as double */
-# define H5_DECODE_DOUBLE(p, n) { \
- uint64_t _n; \
- size_t _u; \
- \
- HDcompile_assert(sizeof(double) == 8); \
- HDcompile_assert(sizeof(double) == sizeof(uint64_t)); \
- _n = 0; \
- (p) += 8; \
- for(_u = 0; _u < sizeof(uint64_t); _u++) \
- _n = (_n << 8) | *(--p); \
- HDmemcpy(&(n), &_n, sizeof(double)); \
- (p) += 8; \
+# define H5_DECODE_DOUBLE(p, n) { \
+ uint64_t _n; \
+ size_t _u; \
+ \
+ HDcompile_assert(sizeof(double) == 8); \
+ HDcompile_assert(sizeof(double) == sizeof(uint64_t)); \
+ _n = 0; \
+ (p) += 8; \
+ for(_u = 0; _u < sizeof(uint64_t); _u++) \
+ _n = (_n << 8) | *(--p); \
+ HDmemcpy(&(n), &_n, sizeof(double)); \
+ (p) += 8; \
}
/* Address-related macros */
-#define H5F_addr_overflow(X,Z) (HADDR_UNDEF==(X) || \
- HADDR_UNDEF==(X)+(haddr_t)(Z) || \
- (X)+(haddr_t)(Z)<(X))
-#define H5F_addr_defined(X) ((X)!=HADDR_UNDEF)
+#define H5F_addr_overflow(X,Z) (HADDR_UNDEF==(X) || \
+ HADDR_UNDEF==(X)+(haddr_t)(Z) || \
+ (X)+(haddr_t)(Z)<(X))
+#define H5F_addr_defined(X) ((X)!=HADDR_UNDEF)
/* The H5F_addr_eq() macro guarantees that Y is not HADDR_UNDEF by making
* certain that X is not HADDR_UNDEF and then checking that X equals Y
*/
-#define H5F_addr_eq(X,Y) ((X)!=HADDR_UNDEF && \
- (X)==(Y))
-#define H5F_addr_ne(X,Y) (!H5F_addr_eq((X),(Y)))
-#define H5F_addr_lt(X,Y) ((X)!=HADDR_UNDEF && \
- (Y)!=HADDR_UNDEF && \
- (X)<(Y))
-#define H5F_addr_le(X,Y) ((X)!=HADDR_UNDEF && \
- (Y)!=HADDR_UNDEF && \
- (X)<=(Y))
-#define H5F_addr_gt(X,Y) ((X)!=HADDR_UNDEF && \
- (Y)!=HADDR_UNDEF && \
- (X)>(Y))
-#define H5F_addr_ge(X,Y) ((X)!=HADDR_UNDEF && \
- (Y)!=HADDR_UNDEF && \
- (X)>=(Y))
-#define H5F_addr_cmp(X,Y) (H5F_addr_eq((X), (Y)) ? 0 : \
- (H5F_addr_lt((X), (Y)) ? -1 : 1))
-#define H5F_addr_pow2(N) ((haddr_t)1<<(N))
+#define H5F_addr_eq(X,Y) ((X)!=HADDR_UNDEF && \
+ (X)==(Y))
+#define H5F_addr_ne(X,Y) (!H5F_addr_eq((X),(Y)))
+#define H5F_addr_lt(X,Y) ((X)!=HADDR_UNDEF && \
+ (Y)!=HADDR_UNDEF && \
+ (X)<(Y))
+#define H5F_addr_le(X,Y) ((X)!=HADDR_UNDEF && \
+ (Y)!=HADDR_UNDEF && \
+ (X)<=(Y))
+#define H5F_addr_gt(X,Y) ((X)!=HADDR_UNDEF && \
+ (Y)!=HADDR_UNDEF && \
+ (X)>(Y))
+#define H5F_addr_ge(X,Y) ((X)!=HADDR_UNDEF && \
+ (Y)!=HADDR_UNDEF && \
+ (X)>=(Y))
+#define H5F_addr_cmp(X,Y) (H5F_addr_eq((X), (Y)) ? 0 : \
+ (H5F_addr_lt((X), (Y)) ? -1 : 1))
+#define H5F_addr_pow2(N) ((haddr_t)1<<(N))
#define H5F_addr_overlap(O1,L1,O2,L2) (((O1) < (O2) && ((O1) + (L1)) > (O2)) || \
((O1) >= (O2) && (O1) < ((O2) + (L2))))
@@ -294,7 +294,7 @@ typedef struct H5F_t H5F_t;
#define H5F_BASE_ADDR(F) ((F)->shared->sblock->base_addr)
#define H5F_SYM_LEAF_K(F) ((F)->shared->sblock->sym_leaf_k)
#define H5F_KVALUE(F,T) ((F)->shared->sblock->btree_k[(T)->id])
-#define H5F_NREFS(F) ((F)->shared->nrefs)
+#define H5F_NREFS(F) ((F)->shared->nrefs)
#define H5F_SIZEOF_ADDR(F) ((F)->shared->sizeof_addr)
#define H5F_SIZEOF_SIZE(F) ((F)->shared->sizeof_size)
#define H5F_SOHM_ADDR(F) ((F)->shared->sohm_addr)
@@ -325,8 +325,8 @@ typedef struct H5F_t H5F_t;
#define H5F_USE_MDC_LOGGING(F) ((F)->shared->use_mdc_logging)
#define H5F_START_MDC_LOG_ON_ACCESS(F) ((F)->shared->start_mdc_log_on_access)
#define H5F_MDC_LOG_LOCATION(F) ((F)->shared->mdc_log_location)
-#define H5F_ALIGNMENT(F) ((F)->shared->alignment)
-#define H5F_THRESHOLD(F) ((F)->shared->threshold)
+#define H5F_ALIGNMENT(F) ((F)->shared->alignment)
+#define H5F_THRESHOLD(F) ((F)->shared->threshold)
#define H5F_PGEND_META_THRES(F) ((F)->shared->fs.pgend_meta_thres)
#define H5F_POINT_OF_NO_RETURN(F) ((F)->shared->fs.point_of_no_return)
#define H5F_FIRST_ALLOC_DEALLOC(F) ((F)->shared->first_alloc_dealloc)
@@ -351,7 +351,7 @@ typedef struct H5F_t H5F_t;
#define H5F_BASE_ADDR(F) (H5F_get_base_addr(F))
#define H5F_SYM_LEAF_K(F) (H5F_sym_leaf_k(F))
#define H5F_KVALUE(F,T) (H5F_Kvalue(F,T))
-#define H5F_NREFS(F) (H5F_get_nrefs(F))
+#define H5F_NREFS(F) (H5F_get_nrefs(F))
#define H5F_SIZEOF_ADDR(F) (H5F_sizeof_addr(F))
#define H5F_SIZEOF_SIZE(F) (H5F_sizeof_size(F))
#define H5F_SOHM_ADDR(F) (H5F_get_sohm_addr(F))
@@ -382,8 +382,8 @@ typedef struct H5F_t H5F_t;
#define H5F_USE_MDC_LOGGING(F) (H5F_use_mdc_logging(F))
#define H5F_START_MDC_LOG_ON_ACCESS(F) (H5F_start_mdc_log_on_access(F))
#define H5F_MDC_LOG_LOCATION(F) (H5F_mdc_log_location(F))
-#define H5F_ALIGNMENT(F) (H5F_get_alignment(F))
-#define H5F_THRESHOLD(F) (H5F_get_threshold(F))
+#define H5F_ALIGNMENT(F) (H5F_get_alignment(F))
+#define H5F_THRESHOLD(F) (H5F_get_threshold(F))
#define H5F_PGEND_META_THRES(F) (H5F_get_pgend_meta_thres(F))
#define H5F_POINT_OF_NO_RETURN(F) (H5F_get_point_of_no_return(F))
#define H5F_FIRST_ALLOC_DEALLOC(F) (H5F_get_first_alloc_dealloc(F))
@@ -392,32 +392,32 @@ typedef struct H5F_t H5F_t;
/* Macros to encode/decode offset/length's for storing in the file */
-#define H5F_ENCODE_OFFSET(f,p,o) switch(H5F_SIZEOF_ADDR(f)) { \
- case 4: UINT32ENCODE(p,o); break; \
- case 8: UINT64ENCODE(p,o); break; \
- case 2: UINT16ENCODE(p,o); break; \
+#define H5F_ENCODE_OFFSET(f,p,o) switch(H5F_SIZEOF_ADDR(f)) { \
+ case 4: UINT32ENCODE(p,o); break; \
+ case 8: UINT64ENCODE(p,o); break; \
+ case 2: UINT16ENCODE(p,o); break; \
}
-#define H5F_DECODE_OFFSET(f,p,o) switch (H5F_SIZEOF_ADDR (f)) { \
- case 4: UINT32DECODE(p, o); break; \
- case 8: UINT64DECODE(p, o); break; \
- case 2: UINT16DECODE(p, o); break; \
+#define H5F_DECODE_OFFSET(f,p,o) switch (H5F_SIZEOF_ADDR (f)) { \
+ case 4: UINT32DECODE(p, o); break; \
+ case 8: UINT64DECODE(p, o); break; \
+ case 2: UINT16DECODE(p, o); break; \
}
-#define H5F_ENCODE_LENGTH_LEN(p,l,s) switch(s) { \
- case 4: UINT32ENCODE(p,l); break; \
- case 8: UINT64ENCODE(p,l); break; \
- case 2: UINT16ENCODE(p,l); break; \
- default: HDassert("bad sizeof size" && 0); \
+#define H5F_ENCODE_LENGTH_LEN(p,l,s) switch(s) { \
+ case 4: UINT32ENCODE(p,l); break; \
+ case 8: UINT64ENCODE(p,l); break; \
+ case 2: UINT16ENCODE(p,l); break; \
+ default: HDassert("bad sizeof size" && 0); \
}
#define H5F_ENCODE_LENGTH(f,p,l) H5F_ENCODE_LENGTH_LEN(p,l,H5F_SIZEOF_SIZE(f))
-#define H5F_DECODE_LENGTH_LEN(p,l,s) switch(s) { \
- case 4: UINT32DECODE(p,l); break; \
- case 8: UINT64DECODE(p,l); break; \
- case 2: UINT16DECODE(p,l); break; \
- default: HDassert("bad sizeof size" && 0); \
+#define H5F_DECODE_LENGTH_LEN(p,l,s) switch(s) { \
+ case 4: UINT32DECODE(p,l); break; \
+ case 8: UINT64DECODE(p,l); break; \
+ case 2: UINT16DECODE(p,l); break; \
+ default: HDassert("bad sizeof size" && 0); \
}
#define H5F_DECODE_LENGTH(f,p,l) H5F_DECODE_LENGTH_LEN(p,l,H5F_SIZEOF_SIZE(f))
@@ -427,13 +427,13 @@ typedef struct H5F_t H5F_t;
* with.
*/
#if (H5_SIZEOF_SIZE_T >= H5_SIZEOF_OFF_T)
-# define H5F_OVERFLOW_SIZET2OFFT(X) \
+# define H5F_OVERFLOW_SIZET2OFFT(X) \
((size_t)(X)>=(size_t)((size_t)1<<(8*sizeof(HDoff_t)-1)))
#else
# define H5F_OVERFLOW_SIZET2OFFT(X) 0
#endif
#if (H5_SIZEOF_HSIZE_T >= H5_SIZEOF_OFF_T)
-# define H5F_OVERFLOW_HSIZET2OFFT(X) \
+# define H5F_OVERFLOW_HSIZET2OFFT(X) \
((hsize_t)(X) >= (hsize_t)((hsize_t)1 << (8 * sizeof(HDoff_t) - 1)))
#else
# define H5F_OVERFLOW_HSIZET2OFFT(X) 0
@@ -461,14 +461,14 @@ typedef struct H5F_t H5F_t;
#define H5F_CRT_SHMSG_LIST_MAX_NAME "shmsg_list_max" /* Shared message list maximum size */
#define H5F_CRT_SHMSG_BTREE_MIN_NAME "shmsg_btree_min" /* Shared message B-tree minimum size */
#define H5F_CRT_FILE_SPACE_STRATEGY_NAME "file_space_strategy" /* File space handling strategy */
-#define H5F_CRT_FREE_SPACE_PERSIST_NAME "free_space_persist" /* Free-space persisting status */
+#define H5F_CRT_FREE_SPACE_PERSIST_NAME "free_space_persist" /* Free-space persisting status */
#define H5F_CRT_FREE_SPACE_THRESHOLD_NAME "free_space_threshold" /* Free space section threshold */
#define H5F_CRT_FILE_SPACE_PAGE_SIZE_NAME "file_space_page_size" /* File space page size */
/* ========= File Access properties ============ */
-#define H5F_ACS_META_CACHE_INIT_CONFIG_NAME "mdc_initCacheCfg" /* Initial metadata cache resize configuration */
+#define H5F_ACS_META_CACHE_INIT_CONFIG_NAME "mdc_initCacheCfg" /* Initial metadata cache resize configuration */
#define H5F_ACS_DATA_CACHE_NUM_SLOTS_NAME "rdcc_nslots" /* Size of raw data chunk cache(slots) */
#define H5F_ACS_DATA_CACHE_BYTE_SIZE_NAME "rdcc_nbytes" /* Size of raw data chunk cache(bytes) */
#define H5F_ACS_PREEMPT_READ_CHUNKS_NAME "rdcc_w0" /* Preemption read chunks first */
@@ -487,7 +487,7 @@ typedef struct H5F_t H5F_t;
#define H5F_ACS_LATEST_FORMAT_NAME "latest_format" /* 'Use latest format version' flag */
#define H5F_ACS_WANT_POSIX_FD_NAME "want_posix_fd" /* Internal: query the file descriptor from the core VFD, instead of the memory address */
#define H5F_ACS_METADATA_READ_ATTEMPTS_NAME "metadata_read_attempts" /* # of metadata read attempts */
-#define H5F_ACS_OBJECT_FLUSH_CB_NAME "object_flush_cb" /* Object flush callback */
+#define H5F_ACS_OBJECT_FLUSH_CB_NAME "object_flush_cb" /* Object flush callback */
#define H5F_ACS_EFC_SIZE_NAME "efc_size" /* Size of external file cache */
#define H5F_ACS_FILE_IMAGE_INFO_NAME "file_image_info" /* struct containing initial file image and callback info */
#define H5F_ACS_CLEAR_STATUS_FLAGS_NAME "clear_status_flags" /* Whether to clear superblock status_flags (private property only used by h5clear) */
@@ -504,7 +504,7 @@ typedef struct H5F_t H5F_t;
#define H5F_ACS_PAGE_BUFFER_MIN_RAW_PERC_NAME "page_buffer_min_raw_perc" /* the min raw data percentage for the page buffer cache */
/* ======================== File Mount properties ====================*/
-#define H5F_MNT_SYM_LOCAL_NAME "local" /* Whether absolute symlinks local to file. */
+#define H5F_MNT_SYM_LOCAL_NAME "local" /* Whether absolute symlinks local to file. */
#ifdef H5_HAVE_PARALLEL
@@ -513,20 +513,20 @@ typedef struct H5F_t H5F_t;
#endif /* H5_HAVE_PARALLEL */
/* Define the HDF5 file signature */
-#define H5F_SIGNATURE "\211HDF\r\n\032\n"
+#define H5F_SIGNATURE "\211HDF\r\n\032\n"
#define H5F_SIGNATURE_LEN 8
/* Version #'s of the major components of the file format */
-#define HDF5_SUPERBLOCK_VERSION_DEF 0 /* The default super block format */
-#define HDF5_SUPERBLOCK_VERSION_1 1 /* Version with non-default B-tree 'K' value */
-#define HDF5_SUPERBLOCK_VERSION_2 2 /* Revised version with superblock extension and checksum */
-#define HDF5_SUPERBLOCK_VERSION_3 3 /* With file locking and consistency flags (at least this version for SWMR support) */
-#define HDF5_SUPERBLOCK_VERSION_LATEST HDF5_SUPERBLOCK_VERSION_3 /* The maximum super block format */
+#define HDF5_SUPERBLOCK_VERSION_DEF 0 /* The default super block format */
+#define HDF5_SUPERBLOCK_VERSION_1 1 /* Version with non-default B-tree 'K' value */
+#define HDF5_SUPERBLOCK_VERSION_2 2 /* Revised version with superblock extension and checksum */
+#define HDF5_SUPERBLOCK_VERSION_3 3 /* With file locking and consistency flags (at least this version for SWMR support) */
+#define HDF5_SUPERBLOCK_VERSION_LATEST HDF5_SUPERBLOCK_VERSION_3 /* The maximum super block format */
#define HDF5_SUPERBLOCK_VERSION_V18_LATEST HDF5_SUPERBLOCK_VERSION_2 /* The latest superblock version for v18 */
-#define HDF5_FREESPACE_VERSION 0 /* of the Free-Space Info */
-#define HDF5_OBJECTDIR_VERSION 0 /* of the Object Directory format */
-#define HDF5_SHAREDHEADER_VERSION 0 /* of the Shared-Header Info */
-#define HDF5_DRIVERINFO_VERSION_0 0 /* of the Driver Information Block*/
+#define HDF5_FREESPACE_VERSION 0 /* of the Free-Space Info */
+#define HDF5_OBJECTDIR_VERSION 0 /* of the Object Directory format */
+#define HDF5_SHAREDHEADER_VERSION 0 /* of the Shared-Header Info */
+#define HDF5_DRIVERINFO_VERSION_0 0 /* of the Driver Information Block*/
/* B-tree internal 'K' values */
#define HDF5_BTREE_SNODE_IK_DEF 16
@@ -536,54 +536,54 @@ typedef struct H5F_t H5F_t;
if it is changed, the code
must compensate. -QAK
*/
-#define HDF5_BTREE_IK_MAX_ENTRIES 65536 /* 2^16 - 2 bytes for storing entries (children) */
- /* See format specification on version 1 B-trees */
+#define HDF5_BTREE_IK_MAX_ENTRIES 65536 /* 2^16 - 2 bytes for storing entries (children) */
+ /* See format specification on version 1 B-trees */
/* Default file space handling strategy */
-#define H5F_FILE_SPACE_STRATEGY_DEF H5F_FSPACE_STRATEGY_FSM_AGGR
+#define H5F_FILE_SPACE_STRATEGY_DEF H5F_FSPACE_STRATEGY_FSM_AGGR
/* Default free space section threshold used by free-space managers */
-#define H5F_FREE_SPACE_PERSIST_DEF FALSE
+#define H5F_FREE_SPACE_PERSIST_DEF FALSE
/* Default free space section threshold used by free-space managers */
-#define H5F_FREE_SPACE_THRESHOLD_DEF 1
+#define H5F_FREE_SPACE_THRESHOLD_DEF 1
/* For paged aggregation: default file space page size when not set */
-#define H5F_FILE_SPACE_PAGE_SIZE_DEF 4096
+#define H5F_FILE_SPACE_PAGE_SIZE_DEF 4096
/* For paged aggregation: minimum value for file space page size */
-#define H5F_FILE_SPACE_PAGE_SIZE_MIN 512
+#define H5F_FILE_SPACE_PAGE_SIZE_MIN 512
/* For paged aggregation: maxiumum value for file space page size: 1 gigabyte */
-#define H5F_FILE_SPACE_PAGE_SIZE_MAX 1024*1024*1024
+#define H5F_FILE_SPACE_PAGE_SIZE_MAX 1024*1024*1024
/* For paged aggregation: drop free-space with size <= this threshold for small meta section */
#define H5F_FILE_SPACE_PGEND_META_THRES 0
/* Default for threshold for alignment (can be set via H5Pset_alignment()) */
-#define H5F_ALIGN_DEF 1
+#define H5F_ALIGN_DEF 1
/* Default for alignment (can be set via H5Pset_alignment()) */
-#define H5F_ALIGN_THRHD_DEF 1
+#define H5F_ALIGN_THRHD_DEF 1
/* Default size for meta data aggregation block (can be set via H5Pset_meta_block_size()) */
-#define H5F_META_BLOCK_SIZE_DEF 2048
+#define H5F_META_BLOCK_SIZE_DEF 2048
/* Default size for small data aggregation block (can be set via H5Pset_small_data_block_size()) */
-#define H5F_SDATA_BLOCK_SIZE_DEF 2048
+#define H5F_SDATA_BLOCK_SIZE_DEF 2048
/* Check for file using paged aggregation */
#define H5F_PAGED_AGGR(F) (F->shared->fs_strategy == H5F_FSPACE_STRATEGY_PAGE && F->shared->fs_page_size)
/* Metadata read attempt values */
-#define H5F_METADATA_READ_ATTEMPTS 1 /* Default # of read attempts for non-SWMR access */
-#define H5F_SWMR_METADATA_READ_ATTEMPTS 100 /* Default # of read attempts for SWMR access */
+#define H5F_METADATA_READ_ATTEMPTS 1 /* Default # of read attempts for non-SWMR access */
+#define H5F_SWMR_METADATA_READ_ATTEMPTS 100 /* Default # of read attempts for SWMR access */
/* Macros to define signatures of all objects in the file */
/* Size of signature information (on disk) */
/* (all on-disk signatures should be this length) */
-#define H5_SIZEOF_MAGIC 4
+#define H5_SIZEOF_MAGIC 4
/* Size of checksum information (on disk) */
/* (all on-disk checksums should be this length) */
-#define H5_SIZEOF_CHKSUM 4
+#define H5_SIZEOF_CHKSUM 4
/* v1 B-tree node signature */
#define H5B_MAGIC "TREE"
@@ -704,11 +704,11 @@ typedef enum H5F_fs_state_t {
typedef enum H5F_mem_page_t {
H5F_MEM_PAGE_DEFAULT = 0, /* Not used */
H5F_MEM_PAGE_SUPER = 1,
- H5F_MEM_PAGE_BTREE = 2,
- H5F_MEM_PAGE_DRAW = 3,
- H5F_MEM_PAGE_GHEAP = 4,
- H5F_MEM_PAGE_LHEAP = 5,
- H5F_MEM_PAGE_OHDR = 6,
+ H5F_MEM_PAGE_BTREE = 2,
+ H5F_MEM_PAGE_DRAW = 3,
+ H5F_MEM_PAGE_GHEAP = 4,
+ H5F_MEM_PAGE_LHEAP = 5,
+ H5F_MEM_PAGE_OHDR = 6,
H5F_MEM_PAGE_LARGE_SUPER = 7,
H5F_MEM_PAGE_LARGE_BTREE = 8,
H5F_MEM_PAGE_LARGE_DRAW = 9,
diff --git a/src/H5Fquery.c b/src/H5Fquery.c
index 61b4183..4765d00 100644
--- a/src/H5Fquery.c
+++ b/src/H5Fquery.c
@@ -144,7 +144,7 @@ H5F_get_actual_name(const H5F_t *f)
* Function: H5F_get_extpath
*
* Purpose: Retrieve the file's 'extpath' flags
- * This is used by H5L_extern_traverse() and H5D_build_extfile_prefix() to retrieve the main file's location
+ * This is used by H5L_extern_traverse() and H5D_build_file_prefix() to retrieve the main file's location
* when searching the target file.
*
* Return: 'extpath' on success/abort on failure (shouldn't fail)
diff --git a/src/H5Pdapl.c b/src/H5Pdapl.c
index 494de3e..da06297 100644
--- a/src/H5Pdapl.c
+++ b/src/H5Pdapl.c
@@ -71,6 +71,17 @@
#define H5D_ACS_VDS_PRINTF_GAP_DEF (hsize_t)0
#define H5D_ACS_VDS_PRINTF_GAP_ENC H5P__encode_hsize_t
#define H5D_ACS_VDS_PRINTF_GAP_DEC H5P__decode_hsize_t
+/* Definitions for VDS file prefix */
+#define H5D_ACS_VDS_PREFIX_SIZE sizeof(char *)
+#define H5D_ACS_VDS_PREFIX_DEF NULL /*default is no prefix */
+#define H5D_ACS_VDS_PREFIX_SET H5P__dapl_vds_file_pref_set
+#define H5D_ACS_VDS_PREFIX_GET H5P__dapl_vds_file_pref_get
+#define H5D_ACS_VDS_PREFIX_ENC H5P__dapl_vds_file_pref_enc
+#define H5D_ACS_VDS_PREFIX_DEC H5P__dapl_vds_file_pref_dec
+#define H5D_ACS_VDS_PREFIX_DEL H5P__dapl_vds_file_pref_del
+#define H5D_ACS_VDS_PREFIX_COPY H5P__dapl_vds_file_pref_copy
+#define H5D_ACS_VDS_PREFIX_CMP H5P__dapl_vds_file_pref_cmp
+#define H5D_ACS_VDS_PREFIX_CLOSE H5P__dapl_vds_file_pref_close
/* Definition for append flush */
#define H5D_ACS_APPEND_FLUSH_SIZE sizeof(H5D_append_flush_t)
#define H5D_ACS_APPEND_FLUSH_DEF {0,{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},NULL,NULL}
@@ -112,6 +123,14 @@ static herr_t H5P__decode_chunk_cache_nbytes(const void **_pp, void *_value);
/* Property list callbacks */
static herr_t H5P__dacc_vds_view_enc(const void *value, void **pp, size_t *size);
static herr_t H5P__dacc_vds_view_dec(const void **pp, void *value);
+static herr_t H5P__dapl_vds_file_pref_set(hid_t prop_id, const char* name, size_t size, void* value);
+static herr_t H5P__dapl_vds_file_pref_get(hid_t prop_id, const char* name, size_t size, void* value);
+static herr_t H5P__dapl_vds_file_pref_enc(const void *value, void **_pp, size_t *size);
+static herr_t H5P__dapl_vds_file_pref_dec(const void **_pp, void *value);
+static herr_t H5P__dapl_vds_file_pref_del(hid_t prop_id, const char* name, size_t size, void* value);
+static herr_t H5P__dapl_vds_file_pref_copy(const char* name, size_t size, void* value);
+static int H5P__dapl_vds_file_pref_cmp(const void *value1, const void *value2, size_t size);
+static herr_t H5P__dapl_vds_file_pref_close(const char* name, size_t size, void* value);
/* Property list callbacks */
static herr_t H5P__dapl_efile_pref_set(hid_t prop_id, const char* name, size_t size, void* value);
@@ -160,6 +179,7 @@ const H5P_libclass_t H5P_CLS_DACC[1] = {{
/* Property value defaults */
static const H5D_append_flush_t H5D_def_append_flush_g = H5D_ACS_APPEND_FLUSH_DEF; /* Default setting for append flush */
static const char *H5D_def_efile_prefix_g = H5D_ACS_EFILE_PREFIX_DEF; /* Default external file prefix string */
+static const char *H5D_def_vds_prefix_g = H5D_ACS_VDS_PREFIX_DEF; /* Default vds prefix string */
/*-------------------------------------------------------------------------
@@ -210,6 +230,12 @@ H5P__dacc_reg_prop(H5P_genclass_t *pclass)
NULL, NULL, NULL, NULL) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class")
+ /* Register property for vds prefix */
+ if(H5P_register_real(pclass, H5D_ACS_VDS_PREFIX_NAME, H5D_ACS_VDS_PREFIX_SIZE, &H5D_def_vds_prefix_g,
+ NULL, H5D_ACS_VDS_PREFIX_SET, H5D_ACS_VDS_PREFIX_GET, H5D_ACS_VDS_PREFIX_ENC, H5D_ACS_VDS_PREFIX_DEC,
+ H5D_ACS_VDS_PREFIX_DEL, H5D_ACS_VDS_PREFIX_COPY, H5D_ACS_VDS_PREFIX_CMP, H5D_ACS_VDS_PREFIX_CLOSE) < 0)
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class")
+
/* Register info for append flush */
/* (Note: this property should not have an encode/decode callback -QAK) */
if(H5P_register_real(pclass, H5D_ACS_APPEND_FLUSH_NAME, H5D_ACS_APPEND_FLUSH_SIZE, &H5D_def_append_flush_g,
@@ -226,6 +252,254 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5P__dacc_reg_prop() */
+
+/*-------------------------------------------------------------------------
+ * Function: H5P__dapl_vds_file_pref_set
+ *
+ * Purpose: Copies a vds file prefix property when it's set
+ * for a property list
+ *
+ * Return: SUCCEED/FAIL
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+H5P__dapl_vds_file_pref_set(hid_t H5_ATTR_UNUSED prop_id, const char H5_ATTR_UNUSED *name,
+ size_t H5_ATTR_UNUSED size, void *value)
+{
+ FUNC_ENTER_STATIC_NOERR
+
+ /* Sanity check */
+ HDassert(value);
+
+ /* Copy the prefix */
+ *(char **)value = H5MM_xstrdup(*(const char **)value);
+
+ FUNC_LEAVE_NOAPI(SUCCEED)
+} /* end H5P__dapl_vds_file_pref_set() */
+
+
+/*-------------------------------------------------------------------------
+ * Function: H5P__dapl_vds_file_pref_get
+ *
+ * Purpose: Copies a vds file prefix property when it's retrieved
+ * from a property list
+ *
+ * Return: SUCCEED/FAIL
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+H5P__dapl_vds_file_pref_get(hid_t H5_ATTR_UNUSED prop_id, const char H5_ATTR_UNUSED *name,
+ size_t H5_ATTR_UNUSED size, void *value)
+{
+ FUNC_ENTER_STATIC_NOERR
+
+ /* Sanity check */
+ HDassert(value);
+
+ /* Copy the prefix */
+ *(char **)value = H5MM_xstrdup(*(const char **)value);
+
+ FUNC_LEAVE_NOAPI(SUCCEED)
+} /* end H5P__dapl_vds_file_pref_get() */
+
+
+/*-------------------------------------------------------------------------
+ * Function: H5P__dapl_vds_file_pref_enc
+ *
+ * Purpose: Callback routine which is called whenever the vds file flags
+ * property in the dataset access property list is
+ * encoded.
+ *
+ * Return: SUCCEED/FAIL
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+H5P__dapl_vds_file_pref_enc(const void *value, void **_pp, size_t *size)
+{
+ const char *vds_file_pref = *(const char * const *)value;
+ uint8_t **pp = (uint8_t **)_pp;
+ size_t len = 0;
+ uint64_t enc_value;
+ unsigned enc_size;
+
+ FUNC_ENTER_NOAPI_NOINIT_NOERR
+
+ HDcompile_assert(sizeof(size_t) <= sizeof(uint64_t));
+
+ /* calculate prefix length */
+ if(NULL != vds_file_pref)
+ len = HDstrlen(vds_file_pref);
+
+ enc_value = (uint64_t)len;
+ enc_size = H5VM_limit_enc_size(enc_value);
+ HDassert(enc_size < 256);
+
+ if(NULL != *pp) {
+ /* encode the length of the prefix */
+ *(*pp)++ = (uint8_t)enc_size;
+ UINT64ENCODE_VAR(*pp, enc_value, enc_size);
+
+ /* encode the prefix */
+ if(NULL != vds_file_pref) {
+ HDmemcpy(*(char **)pp, vds_file_pref, len);
+ *pp += len;
+ } /* end if */
+ } /* end if */
+
+ *size += (1 + enc_size);
+ if(NULL != vds_file_pref)
+ *size += len;
+
+ FUNC_LEAVE_NOAPI(SUCCEED)
+} /* end H5P__dapl_vds_file_pref_enc() */
+
+
+/*-------------------------------------------------------------------------
+ * Function: H5P__dapl_vds_file_pref_dec
+ *
+ * Purpose: Callback routine which is called whenever the vds file prefix
+ * property in the dataset access property list is
+ * decoded.
+ *
+ * Return: SUCCEED/FAIL
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+H5P__dapl_vds_file_pref_dec(const void **_pp, void *_value)
+{
+ char **vds_file_pref = (char **)_value;
+ const uint8_t **pp = (const uint8_t **)_pp;
+ size_t len;
+ uint64_t enc_value; /* Decoded property value */
+ unsigned enc_size; /* Size of encoded property */
+ herr_t ret_value = SUCCEED;
+
+ FUNC_ENTER_NOAPI_NOINIT
+
+ HDassert(pp);
+ HDassert(*pp);
+ HDassert(vds_file_pref);
+ HDcompile_assert(sizeof(size_t) <= sizeof(uint64_t));
+
+ /* Decode the size */
+ enc_size = *(*pp)++;
+ HDassert(enc_size < 256);
+
+ /* Decode the value */
+ UINT64DECODE_VAR(*pp, enc_value, enc_size);
+ len = (size_t)enc_value;
+
+ if(0 != len) {
+ /* Make a copy of the user's prefix string */
+ if(NULL == (*vds_file_pref = (char *)H5MM_malloc(len + 1)))
+ HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINIT, FAIL, "memory allocation failed for prefix")
+ HDstrncpy(*vds_file_pref, *(const char **)pp, len);
+ (*vds_file_pref)[len] = '\0';
+
+ *pp += len;
+ } /* end if */
+ else
+ *vds_file_pref = NULL;
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5P__dapl_vds_file_pref_dec() */
+
+
+/*-------------------------------------------------------------------------
+ * Function: H5P__dapl_vds_file_pref_del
+ *
+ * Purpose: Frees memory used to store the vds file prefix string
+ *
+ * Return: SUCCEED (Can't fail)
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+H5P__dapl_vds_file_pref_del(hid_t H5_ATTR_UNUSED prop_id, const char H5_ATTR_UNUSED *name,
+ size_t H5_ATTR_UNUSED size, void *value)
+{
+ FUNC_ENTER_NOAPI_NOINIT_NOERR
+
+ HDassert(value);
+
+ H5MM_xfree(*(void **)value);
+
+ FUNC_LEAVE_NOAPI(SUCCEED)
+} /* end H5P__dapl_vds_file_pref_del() */
+
+
+/*-------------------------------------------------------------------------
+ * Function: H5P__dapl_vds_file_pref_copy
+ *
+ * Purpose: Creates a copy of the vds file prefix string
+ *
+ * Return: SUCCEED/FAIL
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+H5P__dapl_vds_file_pref_copy(const char H5_ATTR_UNUSED *name, size_t H5_ATTR_UNUSED size, void *value)
+{
+ FUNC_ENTER_NOAPI_NOINIT_NOERR
+
+ HDassert(value);
+
+ *(char **)value = H5MM_xstrdup(*(const char **)value);
+
+ FUNC_LEAVE_NOAPI(SUCCEED)
+} /* end H5P__dapl_vds_file_pref_copy() */
+
+
+/*-------------------------------------------------------------------------
+ * Function: H5P__dapl_vds_file_pref_cmp
+ *
+ * Purpose: Callback routine which is called whenever the vds file prefix
+ * property in the dataset creation property list is
+ * compared.
+ *
+ * Return: zero if VALUE1 and VALUE2 are equal, non zero otherwise.
+ *-------------------------------------------------------------------------
+ */
+static int
+H5P__dapl_vds_file_pref_cmp(const void *value1, const void *value2, size_t H5_ATTR_UNUSED size)
+{
+ const char *pref1 = *(const char * const *)value1;
+ const char *pref2 = *(const char * const *)value2;
+ int ret_value = 0;
+
+ FUNC_ENTER_NOAPI_NOINIT_NOERR
+
+ if(NULL == pref1 && NULL != pref2)
+ HGOTO_DONE(1);
+ if(NULL != pref1 && NULL == pref2)
+ HGOTO_DONE(-1);
+ if(NULL != pref1 && NULL != pref2)
+ ret_value = HDstrcmp(pref1, pref2);
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5P__dapl_vds_file_pref_cmp() */
+
+
+/*-------------------------------------------------------------------------
+ * Function: H5P__dapl_vds_file_pref_close
+ *
+ * Purpose: Frees memory used to store the vds file prefix string
+ *
+ * Return: SUCCEED/FAIL
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+H5P__dapl_vds_file_pref_close(const char H5_ATTR_UNUSED *name, size_t H5_ATTR_UNUSED size, void *value)
+{
+ FUNC_ENTER_NOAPI_NOINIT_NOERR
+
+ HDassert(value);
+
+ H5MM_xfree(*(void **)value);
+
+ FUNC_LEAVE_NOAPI(SUCCEED)
+} /* end H5P__dapl_vds_file_pref_close() */
+
/*-------------------------------------------------------------------------
* Function: H5P__dapl_efile_pref_set
@@ -1220,3 +1494,95 @@ done:
FUNC_LEAVE_API(ret_value)
} /* end H5Pget_efile_prefix() */
+
+/*-------------------------------------------------------------------------
+ * Function: H5Pset_virtual_prefix
+ *
+ * Purpose: Set a prefix to be applied to the path of any vds files
+ * traversed.
+ *
+ * If the prefix starts with ${ORIGIN}, this will be replaced by
+ * the absolute path of the directory of the HDF5 file containing
+ * the dataset.
+ *
+ * If the prefix is ".", no prefix will be applied.
+ *
+ * This property can be overwritten by the environment variable
+ * HDF5_VDS_PREFIX.
+ *
+ * Return: Non-negative on success/Negative on failure
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5Pset_virtual_prefix(hid_t plist_id, const char *prefix)
+{
+ H5P_genplist_t *plist; /* Property list pointer */
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_API(FAIL)
+ H5TRACE2("e", "i*s", plist_id, prefix);
+
+ /* Get the plist structure */
+ if(NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_ACCESS)))
+ HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+
+ /* Set prefix */
+ if(H5P_set(plist, H5D_ACS_VDS_PREFIX_NAME, &prefix) < 0)
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set prefix info")
+
+done:
+ FUNC_LEAVE_API(ret_value)
+} /* end H5Pset_virtual_prefix() */
+
+
+/*-------------------------------------------------------------------------
+ * Function: H5Pget_virtual_prefix
+ *
+ * Purpose: Gets the prefix to be applied to any vds file
+ * traversals made using this property list.
+ *
+ * If the pointer is not NULL, it points to a user-allocated
+ * buffer.
+ *
+ * Return: Non-negative on success/Negative on failure
+ *-------------------------------------------------------------------------
+ */
+ssize_t
+H5Pget_virtual_prefix(hid_t plist_id, char *prefix, size_t size)
+{
+ H5P_genplist_t *plist; /* Property list pointer */
+ char *my_prefix; /* Library's copy of the prefix */
+ size_t len; /* Length of prefix string */
+ ssize_t ret_value; /* Return value */
+
+ FUNC_ENTER_API(FAIL)
+ H5TRACE3("Zs", "i*sz", plist_id, prefix, size);
+
+ /* Get the plist structure */
+ if(NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_ACCESS)))
+ HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+
+ /* Get the current prefix */
+ if(H5P_peek(plist, H5D_ACS_VDS_PREFIX_NAME, &my_prefix) < 0)
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get vds file prefix")
+
+ /* Check for prefix being set */
+ if(my_prefix) {
+ /* Copy to user's buffer, if given */
+ len = HDstrlen(my_prefix);
+ if(prefix) {
+ HDstrncpy(prefix, my_prefix, MIN(len + 1, size));
+ if(len >= size)
+ prefix[size - 1] = '\0';
+ } /* end if */
+ } /* end if */
+ else
+ len = 0;
+
+ /* Set return value */
+ ret_value = (ssize_t)len;
+
+done:
+ FUNC_LEAVE_API(ret_value)
+} /* end H5Pget_virtual_prefix() */
+
diff --git a/src/H5Pfapl.c b/src/H5Pfapl.c
index 915aa38..ea9bfb4 100644
--- a/src/H5Pfapl.c
+++ b/src/H5Pfapl.c
@@ -13,9 +13,9 @@
/*-------------------------------------------------------------------------
*
- * Created: H5Pfapl.c
+ * Created: H5Pfapl.c
*
- * Purpose: File access property list class routines
+ * Purpose: File access property list class routines
*
*-------------------------------------------------------------------------
*/
@@ -41,7 +41,7 @@
#include "H5Ppkg.h" /* Property lists */
/* Includes needed to set as default file driver */
-#include "H5FDsec2.h" /* Posix unbuffered I/O file driver */
+#include "H5FDsec2.h" /* Posix unbuffered I/O file driver */
#include "H5FDstdio.h" /* Standard C buffered I/O */
#ifdef H5_HAVE_WINDOWS
#include "H5FDwindows.h" /* Win32 I/O */
@@ -54,10 +54,10 @@
/* ========= File Access properties ============ */
/* Definitions for the initial metadata cache resize configuration */
-#define H5F_ACS_META_CACHE_INIT_CONFIG_SIZE sizeof(H5AC_cache_config_t)
-#define H5F_ACS_META_CACHE_INIT_CONFIG_DEF H5AC__DEFAULT_CACHE_CONFIG
-#define H5F_ACS_META_CACHE_INIT_CONFIG_ENC H5P__facc_cache_config_enc
-#define H5F_ACS_META_CACHE_INIT_CONFIG_DEC H5P__facc_cache_config_dec
+#define H5F_ACS_META_CACHE_INIT_CONFIG_SIZE sizeof(H5AC_cache_config_t)
+#define H5F_ACS_META_CACHE_INIT_CONFIG_DEF H5AC__DEFAULT_CACHE_CONFIG
+#define H5F_ACS_META_CACHE_INIT_CONFIG_ENC H5P__facc_cache_config_enc
+#define H5F_ACS_META_CACHE_INIT_CONFIG_DEC H5P__facc_cache_config_dec
#define H5F_ACS_META_CACHE_INIT_CONFIG_CMP H5P__facc_cache_config_cmp
/* Definitions for size of raw data chunk cache(slots) */
#define H5F_ACS_DATA_CACHE_NUM_SLOTS_SIZE sizeof(size_t)
@@ -118,10 +118,10 @@
#define H5F_ACS_FILE_DRV_CMP H5P__facc_file_driver_cmp
#define H5F_ACS_FILE_DRV_CLOSE H5P__facc_file_driver_close
/* Definition for file close degree */
-#define H5F_CLOSE_DEGREE_SIZE sizeof(H5F_close_degree_t)
-#define H5F_CLOSE_DEGREE_DEF H5F_CLOSE_DEFAULT
-#define H5F_CLOSE_DEGREE_ENC H5P__facc_fclose_degree_enc
-#define H5F_CLOSE_DEGREE_DEC H5P__facc_fclose_degree_dec
+#define H5F_CLOSE_DEGREE_SIZE sizeof(H5F_close_degree_t)
+#define H5F_CLOSE_DEGREE_DEF H5F_CLOSE_DEFAULT
+#define H5F_CLOSE_DEGREE_ENC H5P__facc_fclose_degree_enc
+#define H5F_CLOSE_DEGREE_DEC H5P__facc_fclose_degree_dec
/* Definition for offset position in file for family file driver */
#define H5F_ACS_FAMILY_OFFSET_SIZE sizeof(hsize_t)
#define H5F_ACS_FAMILY_OFFSET_DEF 0
@@ -175,12 +175,12 @@
#define H5F_ACS_CORE_WRITE_TRACKING_PAGE_SIZE_ENC H5P__encode_size_t
#define H5F_ACS_CORE_WRITE_TRACKING_PAGE_SIZE_DEC H5P__decode_size_t
/* Definition for # of metadata read attempts */
-#define H5F_ACS_METADATA_READ_ATTEMPTS_SIZE sizeof(unsigned)
-#define H5F_ACS_METADATA_READ_ATTEMPTS_DEF 0
-#define H5F_ACS_METADATA_READ_ATTEMPTS_ENC H5P__encode_unsigned
-#define H5F_ACS_METADATA_READ_ATTEMPTS_DEC H5P__decode_unsigned
+#define H5F_ACS_METADATA_READ_ATTEMPTS_SIZE sizeof(unsigned)
+#define H5F_ACS_METADATA_READ_ATTEMPTS_DEF 0
+#define H5F_ACS_METADATA_READ_ATTEMPTS_ENC H5P__encode_unsigned
+#define H5F_ACS_METADATA_READ_ATTEMPTS_DEC H5P__decode_unsigned
/* Definition for object flush callback */
-#define H5F_ACS_OBJECT_FLUSH_CB_SIZE sizeof(H5F_object_flush_t)
+#define H5F_ACS_OBJECT_FLUSH_CB_SIZE sizeof(H5F_object_flush_t)
#define H5F_ACS_OBJECT_FLUSH_CB_DEF {NULL, NULL}
/* Definition for status_flags in the superblock */
#define H5F_ACS_CLEAR_STATUS_FLAGS_SIZE sizeof(hbool_t)
@@ -309,21 +309,21 @@ static herr_t H5P__facc_cache_image_config_dec(const void **_pp, void *_value);
/* File access property list class library initialization object */
const H5P_libclass_t H5P_CLS_FACC[1] = {{
- "file access", /* Class name for debugging */
+ "file access", /* Class name for debugging */
H5P_TYPE_FILE_ACCESS, /* Class type */
- &H5P_CLS_ROOT_g, /* Parent class */
- &H5P_CLS_FILE_ACCESS_g, /* Pointer to class */
- &H5P_CLS_FILE_ACCESS_ID_g, /* Pointer to class ID */
- &H5P_LST_FILE_ACCESS_ID_g, /* Pointer to default property list ID */
- H5P__facc_reg_prop, /* Default property registration routine */
-
- NULL, /* Class creation callback */
- NULL, /* Class creation callback info */
- NULL, /* Class copy callback */
- NULL, /* Class copy callback info */
- NULL, /* Class close callback */
- NULL /* Class close callback info */
+ &H5P_CLS_ROOT_g, /* Parent class */
+ &H5P_CLS_FILE_ACCESS_g, /* Pointer to class */
+ &H5P_CLS_FILE_ACCESS_ID_g, /* Pointer to class ID */
+ &H5P_LST_FILE_ACCESS_ID_g, /* Pointer to default property list ID */
+ H5P__facc_reg_prop, /* Default property registration routine */
+
+ NULL, /* Class creation callback */
+ NULL, /* Class creation callback info */
+ NULL, /* Class copy callback */
+ NULL, /* Class copy callback info */
+ NULL, /* Class close callback */
+ NULL /* Class close callback info */
}};
@@ -395,149 +395,149 @@ H5P__facc_reg_prop(H5P_genclass_t *pclass)
FUNC_ENTER_STATIC
/* Register the initial metadata cache resize configuration */
- if(H5P_register_real(pclass, H5F_ACS_META_CACHE_INIT_CONFIG_NAME, H5F_ACS_META_CACHE_INIT_CONFIG_SIZE, &H5F_def_mdc_initCacheCfg_g,
- NULL, NULL, NULL, H5F_ACS_META_CACHE_INIT_CONFIG_ENC, H5F_ACS_META_CACHE_INIT_CONFIG_DEC,
+ if(H5P_register_real(pclass, H5F_ACS_META_CACHE_INIT_CONFIG_NAME, H5F_ACS_META_CACHE_INIT_CONFIG_SIZE, &H5F_def_mdc_initCacheCfg_g,
+ NULL, NULL, NULL, H5F_ACS_META_CACHE_INIT_CONFIG_ENC, H5F_ACS_META_CACHE_INIT_CONFIG_DEC,
NULL, NULL, H5F_ACS_META_CACHE_INIT_CONFIG_CMP, NULL) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class")
/* Register the size of raw data chunk cache (elements) */
- if(H5P_register_real(pclass, H5F_ACS_DATA_CACHE_NUM_SLOTS_NAME, H5F_ACS_DATA_CACHE_NUM_SLOTS_SIZE, &H5F_def_rdcc_nslots_g,
- NULL, NULL, NULL, H5F_ACS_DATA_CACHE_NUM_SLOTS_ENC, H5F_ACS_DATA_CACHE_NUM_SLOTS_DEC,
+ if(H5P_register_real(pclass, H5F_ACS_DATA_CACHE_NUM_SLOTS_NAME, H5F_ACS_DATA_CACHE_NUM_SLOTS_SIZE, &H5F_def_rdcc_nslots_g,
+ NULL, NULL, NULL, H5F_ACS_DATA_CACHE_NUM_SLOTS_ENC, H5F_ACS_DATA_CACHE_NUM_SLOTS_DEC,
NULL, NULL, NULL, NULL) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class")
/* Register the size of raw data chunk cache(bytes) */
- if(H5P_register_real(pclass, H5F_ACS_DATA_CACHE_BYTE_SIZE_NAME, H5F_ACS_DATA_CACHE_BYTE_SIZE_SIZE, &H5F_def_rdcc_nbytes_g,
- NULL, NULL, NULL, H5F_ACS_DATA_CACHE_BYTE_SIZE_ENC, H5F_ACS_DATA_CACHE_BYTE_SIZE_DEC,
+ if(H5P_register_real(pclass, H5F_ACS_DATA_CACHE_BYTE_SIZE_NAME, H5F_ACS_DATA_CACHE_BYTE_SIZE_SIZE, &H5F_def_rdcc_nbytes_g,
+ NULL, NULL, NULL, H5F_ACS_DATA_CACHE_BYTE_SIZE_ENC, H5F_ACS_DATA_CACHE_BYTE_SIZE_DEC,
NULL, NULL, NULL, NULL) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class")
/* Register the preemption for reading chunks */
- if(H5P_register_real(pclass, H5F_ACS_PREEMPT_READ_CHUNKS_NAME, H5F_ACS_PREEMPT_READ_CHUNKS_SIZE, &H5F_def_rdcc_w0_g,
- NULL, NULL, NULL, H5F_ACS_PREEMPT_READ_CHUNKS_ENC, H5F_ACS_PREEMPT_READ_CHUNKS_DEC,
+ if(H5P_register_real(pclass, H5F_ACS_PREEMPT_READ_CHUNKS_NAME, H5F_ACS_PREEMPT_READ_CHUNKS_SIZE, &H5F_def_rdcc_w0_g,
+ NULL, NULL, NULL, H5F_ACS_PREEMPT_READ_CHUNKS_ENC, H5F_ACS_PREEMPT_READ_CHUNKS_DEC,
NULL, NULL, NULL, NULL) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class")
/* Register the threshold for alignment */
- if(H5P_register_real(pclass, H5F_ACS_ALIGN_THRHD_NAME, H5F_ACS_ALIGN_THRHD_SIZE, &H5F_def_threshold_g,
- NULL, NULL, NULL, H5F_ACS_ALIGN_THRHD_ENC, H5F_ACS_ALIGN_THRHD_DEC,
+ if(H5P_register_real(pclass, H5F_ACS_ALIGN_THRHD_NAME, H5F_ACS_ALIGN_THRHD_SIZE, &H5F_def_threshold_g,
+ NULL, NULL, NULL, H5F_ACS_ALIGN_THRHD_ENC, H5F_ACS_ALIGN_THRHD_DEC,
NULL, NULL, NULL, NULL) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class")
/* Register the alignment */
- if(H5P_register_real(pclass, H5F_ACS_ALIGN_NAME, H5F_ACS_ALIGN_SIZE, &H5F_def_alignment_g,
- NULL, NULL, NULL, H5F_ACS_ALIGN_ENC, H5F_ACS_ALIGN_DEC,
+ if(H5P_register_real(pclass, H5F_ACS_ALIGN_NAME, H5F_ACS_ALIGN_SIZE, &H5F_def_alignment_g,
+ NULL, NULL, NULL, H5F_ACS_ALIGN_ENC, H5F_ACS_ALIGN_DEC,
NULL, NULL, NULL, NULL) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class")
/* Register the minimum metadata allocation block size */
- if(H5P_register_real(pclass, H5F_ACS_META_BLOCK_SIZE_NAME, H5F_ACS_META_BLOCK_SIZE_SIZE, &H5F_def_meta_block_size_g,
- NULL, NULL, NULL, H5F_ACS_META_BLOCK_SIZE_ENC, H5F_ACS_META_BLOCK_SIZE_DEC,
+ if(H5P_register_real(pclass, H5F_ACS_META_BLOCK_SIZE_NAME, H5F_ACS_META_BLOCK_SIZE_SIZE, &H5F_def_meta_block_size_g,
+ NULL, NULL, NULL, H5F_ACS_META_BLOCK_SIZE_ENC, H5F_ACS_META_BLOCK_SIZE_DEC,
NULL, NULL, NULL, NULL) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class")
/* Register the maximum sieve buffer size */
- if(H5P_register_real(pclass, H5F_ACS_SIEVE_BUF_SIZE_NAME, H5F_ACS_SIEVE_BUF_SIZE_SIZE, &H5F_def_sieve_buf_size_g,
- NULL, NULL, NULL, H5F_ACS_SIEVE_BUF_SIZE_ENC, H5F_ACS_SIEVE_BUF_SIZE_DEC,
+ if(H5P_register_real(pclass, H5F_ACS_SIEVE_BUF_SIZE_NAME, H5F_ACS_SIEVE_BUF_SIZE_SIZE, &H5F_def_sieve_buf_size_g,
+ NULL, NULL, NULL, H5F_ACS_SIEVE_BUF_SIZE_ENC, H5F_ACS_SIEVE_BUF_SIZE_DEC,
NULL, NULL, NULL, NULL) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class")
/* Register the minimum "small data" allocation block size */
- if(H5P_register_real(pclass, H5F_ACS_SDATA_BLOCK_SIZE_NAME, H5F_ACS_SDATA_BLOCK_SIZE_SIZE, &H5F_def_sdata_block_size_g,
- NULL, NULL, NULL, H5F_ACS_SDATA_BLOCK_SIZE_ENC, H5F_ACS_SDATA_BLOCK_SIZE_DEC,
+ if(H5P_register_real(pclass, H5F_ACS_SDATA_BLOCK_SIZE_NAME, H5F_ACS_SDATA_BLOCK_SIZE_SIZE, &H5F_def_sdata_block_size_g,
+ NULL, NULL, NULL, H5F_ACS_SDATA_BLOCK_SIZE_ENC, H5F_ACS_SDATA_BLOCK_SIZE_DEC,
NULL, NULL, NULL, NULL) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class")
/* Register the garbage collection reference */
- if(H5P_register_real(pclass, H5F_ACS_GARBG_COLCT_REF_NAME, H5F_ACS_GARBG_COLCT_REF_SIZE, &H5F_def_gc_ref_g,
- NULL, NULL, NULL, H5F_ACS_GARBG_COLCT_REF_ENC, H5F_ACS_GARBG_COLCT_REF_DEC,
+ if(H5P_register_real(pclass, H5F_ACS_GARBG_COLCT_REF_NAME, H5F_ACS_GARBG_COLCT_REF_SIZE, &H5F_def_gc_ref_g,
+ NULL, NULL, NULL, H5F_ACS_GARBG_COLCT_REF_ENC, H5F_ACS_GARBG_COLCT_REF_DEC,
NULL, NULL, NULL, NULL) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class")
/* Register the file driver ID & info */
/* (Note: this property should not have an encode/decode callback -QAK) */
- if(H5P_register_real(pclass, H5F_ACS_FILE_DRV_NAME, H5F_ACS_FILE_DRV_SIZE, &def_driver_prop,
+ if(H5P_register_real(pclass, H5F_ACS_FILE_DRV_NAME, H5F_ACS_FILE_DRV_SIZE, &def_driver_prop,
H5F_ACS_FILE_DRV_CRT, H5F_ACS_FILE_DRV_SET, H5F_ACS_FILE_DRV_GET, NULL, NULL,
H5F_ACS_FILE_DRV_DEL, H5F_ACS_FILE_DRV_COPY, H5F_ACS_FILE_DRV_CMP, H5F_ACS_FILE_DRV_CLOSE) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class")
/* Register the file close degree */
- if(H5P_register_real(pclass, H5F_ACS_CLOSE_DEGREE_NAME, H5F_CLOSE_DEGREE_SIZE, &H5F_def_close_degree_g,
- NULL, NULL, NULL, H5F_CLOSE_DEGREE_ENC, H5F_CLOSE_DEGREE_DEC,
+ if(H5P_register_real(pclass, H5F_ACS_CLOSE_DEGREE_NAME, H5F_CLOSE_DEGREE_SIZE, &H5F_def_close_degree_g,
+ NULL, NULL, NULL, H5F_CLOSE_DEGREE_ENC, H5F_CLOSE_DEGREE_DEC,
NULL, NULL, NULL, NULL) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class")
/* Register the offset of family driver info */
- if(H5P_register_real(pclass, H5F_ACS_FAMILY_OFFSET_NAME, H5F_ACS_FAMILY_OFFSET_SIZE, &H5F_def_family_offset_g,
- NULL, NULL, NULL, H5F_ACS_FAMILY_OFFSET_ENC, H5F_ACS_FAMILY_OFFSET_DEC,
+ if(H5P_register_real(pclass, H5F_ACS_FAMILY_OFFSET_NAME, H5F_ACS_FAMILY_OFFSET_SIZE, &H5F_def_family_offset_g,
+ NULL, NULL, NULL, H5F_ACS_FAMILY_OFFSET_ENC, H5F_ACS_FAMILY_OFFSET_DEC,
NULL, NULL, NULL, NULL) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class")
/* Register the private property of new family file size. It's used by h5repart only. */
/* (Note: this property should not have an encode/decode callback -QAK) */
- if(H5P_register_real(pclass, H5F_ACS_FAMILY_NEWSIZE_NAME, H5F_ACS_FAMILY_NEWSIZE_SIZE, &H5F_def_family_newsize_g,
+ if(H5P_register_real(pclass, H5F_ACS_FAMILY_NEWSIZE_NAME, H5F_ACS_FAMILY_NEWSIZE_SIZE, &H5F_def_family_newsize_g,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class")
/* Register the private property of whether convert family to sec2 driver. It's used by h5repart only. */
/* (Note: this property should not have an encode/decode callback -QAK) */
- if(H5P_register_real(pclass, H5F_ACS_FAMILY_TO_SEC2_NAME, H5F_ACS_FAMILY_TO_SEC2_SIZE, &H5F_def_family_to_sec2_g,
+ if(H5P_register_real(pclass, H5F_ACS_FAMILY_TO_SEC2_NAME, H5F_ACS_FAMILY_TO_SEC2_SIZE, &H5F_def_family_to_sec2_g,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class")
/* Register the data type of multi driver info */
- if(H5P_register_real(pclass, H5F_ACS_MULTI_TYPE_NAME, H5F_ACS_MULTI_TYPE_SIZE, &H5F_def_mem_type_g,
- NULL, NULL, NULL, H5F_ACS_MULTI_TYPE_ENC, H5F_ACS_MULTI_TYPE_DEC,
+ if(H5P_register_real(pclass, H5F_ACS_MULTI_TYPE_NAME, H5F_ACS_MULTI_TYPE_SIZE, &H5F_def_mem_type_g,
+ NULL, NULL, NULL, H5F_ACS_MULTI_TYPE_ENC, H5F_ACS_MULTI_TYPE_DEC,
NULL, NULL, NULL, NULL) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class")
/* Register the 'use the latest version of the format' flag */
- if(H5P_register_real(pclass, H5F_ACS_LATEST_FORMAT_NAME, H5F_ACS_LATEST_FORMAT_SIZE, &H5F_def_latest_format_g,
- NULL, NULL, NULL, H5F_ACS_LATEST_FORMAT_ENC, H5F_ACS_LATEST_FORMAT_DEC,
+ if(H5P_register_real(pclass, H5F_ACS_LATEST_FORMAT_NAME, H5F_ACS_LATEST_FORMAT_SIZE, &H5F_def_latest_format_g,
+ NULL, NULL, NULL, H5F_ACS_LATEST_FORMAT_ENC, H5F_ACS_LATEST_FORMAT_DEC,
NULL, NULL, NULL, NULL) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class")
/* Register the private property of whether to retrieve the file descriptor from the core VFD */
/* (used internally to the library only) */
/* (Note: this property should not have an encode/decode callback -QAK) */
- if(H5P_register_real(pclass, H5F_ACS_WANT_POSIX_FD_NAME, H5F_ACS_WANT_POSIX_FD_SIZE, &H5F_def_want_posix_fd_g,
+ if(H5P_register_real(pclass, H5F_ACS_WANT_POSIX_FD_NAME, H5F_ACS_WANT_POSIX_FD_SIZE, &H5F_def_want_posix_fd_g,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class")
/* Register the external file cache size */
- if(H5P_register_real(pclass, H5F_ACS_EFC_SIZE_NAME, H5F_ACS_EFC_SIZE_SIZE, &H5F_def_efc_size_g,
- NULL, NULL, NULL, H5F_ACS_EFC_SIZE_ENC, H5F_ACS_EFC_SIZE_DEC,
+ if(H5P_register_real(pclass, H5F_ACS_EFC_SIZE_NAME, H5F_ACS_EFC_SIZE_SIZE, &H5F_def_efc_size_g,
+ NULL, NULL, NULL, H5F_ACS_EFC_SIZE_ENC, H5F_ACS_EFC_SIZE_DEC,
NULL, NULL, NULL, NULL) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class")
/* Register the initial file image info */
/* (Note: this property should not have an encode/decode callback -QAK) */
- if(H5P_register_real(pclass, H5F_ACS_FILE_IMAGE_INFO_NAME, H5F_ACS_FILE_IMAGE_INFO_SIZE, &H5F_def_file_image_info_g,
+ if(H5P_register_real(pclass, H5F_ACS_FILE_IMAGE_INFO_NAME, H5F_ACS_FILE_IMAGE_INFO_SIZE, &H5F_def_file_image_info_g,
NULL, H5F_ACS_FILE_IMAGE_INFO_SET, H5F_ACS_FILE_IMAGE_INFO_GET, NULL, NULL,
H5F_ACS_FILE_IMAGE_INFO_DEL, H5F_ACS_FILE_IMAGE_INFO_COPY, H5F_ACS_FILE_IMAGE_INFO_CMP, H5F_ACS_FILE_IMAGE_INFO_CLOSE) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class")
/* Register the core VFD backing store write tracking flag */
- if(H5P_register_real(pclass, H5F_ACS_CORE_WRITE_TRACKING_FLAG_NAME, H5F_ACS_CORE_WRITE_TRACKING_FLAG_SIZE, &H5F_def_core_write_tracking_flag_g,
- NULL, NULL, NULL, H5F_ACS_CORE_WRITE_TRACKING_FLAG_ENC, H5F_ACS_CORE_WRITE_TRACKING_FLAG_DEC,
+ if(H5P_register_real(pclass, H5F_ACS_CORE_WRITE_TRACKING_FLAG_NAME, H5F_ACS_CORE_WRITE_TRACKING_FLAG_SIZE, &H5F_def_core_write_tracking_flag_g,
+ NULL, NULL, NULL, H5F_ACS_CORE_WRITE_TRACKING_FLAG_ENC, H5F_ACS_CORE_WRITE_TRACKING_FLAG_DEC,
NULL, NULL, NULL, NULL) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class")
/* Register the size of the core VFD backing store page size */
- if(H5P_register_real(pclass, H5F_ACS_CORE_WRITE_TRACKING_PAGE_SIZE_NAME, H5F_ACS_CORE_WRITE_TRACKING_PAGE_SIZE_SIZE, &H5F_def_core_write_tracking_page_size_g,
- NULL, NULL, NULL, H5F_ACS_CORE_WRITE_TRACKING_PAGE_SIZE_ENC, H5F_ACS_CORE_WRITE_TRACKING_PAGE_SIZE_DEC,
+ if(H5P_register_real(pclass, H5F_ACS_CORE_WRITE_TRACKING_PAGE_SIZE_NAME, H5F_ACS_CORE_WRITE_TRACKING_PAGE_SIZE_SIZE, &H5F_def_core_write_tracking_page_size_g,
+ NULL, NULL, NULL, H5F_ACS_CORE_WRITE_TRACKING_PAGE_SIZE_ENC, H5F_ACS_CORE_WRITE_TRACKING_PAGE_SIZE_DEC,
NULL, NULL, NULL, NULL) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class")
/* Register the # of read attempts */
- if(H5P_register_real(pclass, H5F_ACS_METADATA_READ_ATTEMPTS_NAME, H5F_ACS_METADATA_READ_ATTEMPTS_SIZE, &H5F_def_metadata_read_attempts_g,
- NULL, NULL, NULL, H5F_ACS_METADATA_READ_ATTEMPTS_ENC, H5F_ACS_METADATA_READ_ATTEMPTS_DEC,
+ if(H5P_register_real(pclass, H5F_ACS_METADATA_READ_ATTEMPTS_NAME, H5F_ACS_METADATA_READ_ATTEMPTS_SIZE, &H5F_def_metadata_read_attempts_g,
+ NULL, NULL, NULL, H5F_ACS_METADATA_READ_ATTEMPTS_ENC, H5F_ACS_METADATA_READ_ATTEMPTS_DEC,
NULL, NULL, NULL, NULL) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class")
/* Register object flush callback */
/* (Note: this property should not have an encode/decode callback -QAK) */
- if(H5P_register_real(pclass, H5F_ACS_OBJECT_FLUSH_CB_NAME, H5F_ACS_OBJECT_FLUSH_CB_SIZE, &H5F_def_object_flush_cb_g,
+ if(H5P_register_real(pclass, H5F_ACS_OBJECT_FLUSH_CB_NAME, H5F_ACS_OBJECT_FLUSH_CB_SIZE, &H5F_def_object_flush_cb_g,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class")
@@ -563,44 +563,44 @@ H5P__facc_reg_prop(H5P_genclass_t *pclass)
HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class")
/* Register the evict on close flag */
- if(H5P_register_real(pclass, H5F_ACS_EVICT_ON_CLOSE_FLAG_NAME, H5F_ACS_EVICT_ON_CLOSE_FLAG_SIZE, &H5F_def_evict_on_close_flag_g,
- NULL, NULL, NULL, H5F_ACS_EVICT_ON_CLOSE_FLAG_ENC, H5F_ACS_EVICT_ON_CLOSE_FLAG_DEC,
+ if(H5P_register_real(pclass, H5F_ACS_EVICT_ON_CLOSE_FLAG_NAME, H5F_ACS_EVICT_ON_CLOSE_FLAG_SIZE, &H5F_def_evict_on_close_flag_g,
+ NULL, NULL, NULL, H5F_ACS_EVICT_ON_CLOSE_FLAG_ENC, H5F_ACS_EVICT_ON_CLOSE_FLAG_DEC,
NULL, NULL, NULL, NULL) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class")
#ifdef H5_HAVE_PARALLEL
/* Register the metadata collective read flag */
- if(H5P_register_real(pclass, H5_COLL_MD_READ_FLAG_NAME, H5F_ACS_COLL_MD_READ_FLAG_SIZE, &H5F_def_coll_md_read_flag_g,
- NULL, NULL, NULL, H5F_ACS_COLL_MD_READ_FLAG_ENC, H5F_ACS_COLL_MD_READ_FLAG_DEC,
+ if(H5P_register_real(pclass, H5_COLL_MD_READ_FLAG_NAME, H5F_ACS_COLL_MD_READ_FLAG_SIZE, &H5F_def_coll_md_read_flag_g,
+ NULL, NULL, NULL, H5F_ACS_COLL_MD_READ_FLAG_ENC, H5F_ACS_COLL_MD_READ_FLAG_DEC,
NULL, NULL, NULL, NULL) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class")
/* Register the metadata collective write flag */
- if(H5P_register_real(pclass, H5F_ACS_COLL_MD_WRITE_FLAG_NAME, H5F_ACS_COLL_MD_WRITE_FLAG_SIZE, &H5F_def_coll_md_write_flag_g,
- NULL, NULL, NULL, H5F_ACS_COLL_MD_WRITE_FLAG_ENC, H5F_ACS_COLL_MD_WRITE_FLAG_DEC,
+ if(H5P_register_real(pclass, H5F_ACS_COLL_MD_WRITE_FLAG_NAME, H5F_ACS_COLL_MD_WRITE_FLAG_SIZE, &H5F_def_coll_md_write_flag_g,
+ NULL, NULL, NULL, H5F_ACS_COLL_MD_WRITE_FLAG_ENC, H5F_ACS_COLL_MD_WRITE_FLAG_DEC,
NULL, NULL, NULL, NULL) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class")
#endif /* H5_HAVE_PARALLEL */
/* Register the initial metadata cache image configuration */
- if(H5P_register_real(pclass, H5F_ACS_META_CACHE_INIT_IMAGE_CONFIG_NAME, H5F_ACS_META_CACHE_INIT_IMAGE_CONFIG_SIZE, &H5F_def_mdc_initCacheImageCfg_g,
- NULL, NULL, NULL, H5F_ACS_META_CACHE_INIT_IMAGE_CONFIG_ENC, H5F_ACS_META_CACHE_INIT_IMAGE_CONFIG_DEC,
+ if(H5P_register_real(pclass, H5F_ACS_META_CACHE_INIT_IMAGE_CONFIG_NAME, H5F_ACS_META_CACHE_INIT_IMAGE_CONFIG_SIZE, &H5F_def_mdc_initCacheImageCfg_g,
+ NULL, NULL, NULL, H5F_ACS_META_CACHE_INIT_IMAGE_CONFIG_ENC, H5F_ACS_META_CACHE_INIT_IMAGE_CONFIG_DEC,
NULL, NULL, H5F_ACS_META_CACHE_INIT_IMAGE_CONFIG_CMP, NULL) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class")
/* Register the size of the page buffer size */
- if(H5P_register_real(pclass, H5F_ACS_PAGE_BUFFER_SIZE_NAME, H5F_ACS_PAGE_BUFFER_SIZE_SIZE, &H5F_def_page_buf_size_g,
- NULL, NULL, NULL, H5F_ACS_PAGE_BUFFER_SIZE_ENC, H5F_ACS_PAGE_BUFFER_SIZE_DEC,
+ if(H5P_register_real(pclass, H5F_ACS_PAGE_BUFFER_SIZE_NAME, H5F_ACS_PAGE_BUFFER_SIZE_SIZE, &H5F_def_page_buf_size_g,
+ NULL, NULL, NULL, H5F_ACS_PAGE_BUFFER_SIZE_ENC, H5F_ACS_PAGE_BUFFER_SIZE_DEC,
NULL, NULL, NULL, NULL) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class")
/* Register the size of the page buffer minimum metadata size */
- if(H5P_register_real(pclass, H5F_ACS_PAGE_BUFFER_MIN_META_PERC_NAME, H5F_ACS_PAGE_BUFFER_MIN_META_PERC_SIZE, &H5F_def_page_buf_min_meta_perc_g,
- NULL, NULL, NULL, H5F_ACS_PAGE_BUFFER_MIN_META_PERC_ENC, H5F_ACS_PAGE_BUFFER_MIN_META_PERC_DEC,
+ if(H5P_register_real(pclass, H5F_ACS_PAGE_BUFFER_MIN_META_PERC_NAME, H5F_ACS_PAGE_BUFFER_MIN_META_PERC_SIZE, &H5F_def_page_buf_min_meta_perc_g,
+ NULL, NULL, NULL, H5F_ACS_PAGE_BUFFER_MIN_META_PERC_ENC, H5F_ACS_PAGE_BUFFER_MIN_META_PERC_DEC,
NULL, NULL, NULL, NULL) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class")
/* Register the size of the page buffer minimum raw data size */
- if(H5P_register_real(pclass, H5F_ACS_PAGE_BUFFER_MIN_RAW_PERC_NAME, H5F_ACS_PAGE_BUFFER_MIN_RAW_PERC_SIZE, &H5F_def_page_buf_min_raw_perc_g,
- NULL, NULL, NULL, H5F_ACS_PAGE_BUFFER_MIN_RAW_PERC_ENC, H5F_ACS_PAGE_BUFFER_MIN_RAW_PERC_DEC,
+ if(H5P_register_real(pclass, H5F_ACS_PAGE_BUFFER_MIN_RAW_PERC_NAME, H5F_ACS_PAGE_BUFFER_MIN_RAW_PERC_SIZE, &H5F_def_page_buf_min_raw_perc_g,
+ NULL, NULL, NULL, H5F_ACS_PAGE_BUFFER_MIN_RAW_PERC_ENC, H5F_ACS_PAGE_BUFFER_MIN_RAW_PERC_DEC,
NULL, NULL, NULL, NULL) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class")
@@ -610,33 +610,33 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5Pset_alignment
+ * Function: H5Pset_alignment
*
- * Purpose: Sets the alignment properties of a file access property list
- * so that any file object >= THRESHOLD bytes will be aligned on
- * an address which is a multiple of ALIGNMENT. The addresses
- * are relative to the end of the user block; the alignment is
- * calculated by subtracting the user block size from the
- * absolute file address and then adjusting the address to be a
- * multiple of ALIGNMENT.
+ * Purpose: Sets the alignment properties of a file access property list
+ * so that any file object >= THRESHOLD bytes will be aligned on
+ * an address which is a multiple of ALIGNMENT. The addresses
+ * are relative to the end of the user block; the alignment is
+ * calculated by subtracting the user block size from the
+ * absolute file address and then adjusting the address to be a
+ * multiple of ALIGNMENT.
*
- * Default values for THRESHOLD and ALIGNMENT are one, implying
- * no alignment. Generally the default values will result in
- * the best performance for single-process access to the file.
- * For MPI-IO and other parallel systems, choose an alignment
- * which is a multiple of the disk block size.
+ * Default values for THRESHOLD and ALIGNMENT are one, implying
+ * no alignment. Generally the default values will result in
+ * the best performance for single-process access to the file.
+ * For MPI-IO and other parallel systems, choose an alignment
+ * which is a multiple of the disk block size.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Tuesday, June 9, 1998
*
* Modifications:
*
- * Raymond Lu
- * Tuesday, Oct 23, 2001
- * Changed file access property list mechanism to the new
- * generic property list.
+ * Raymond Lu
+ * Tuesday, Oct 23, 2001
+ * Changed file access property list mechanism to the new
+ * generic property list.
*-------------------------------------------------------------------------
*/
herr_t
@@ -668,15 +668,15 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5Pget_alignment
+ * Function: H5Pget_alignment
*
- * Purpose: Returns the current settings for alignment properties from a
- * file access property list. The THRESHOLD and/or ALIGNMENT
- * pointers may be null pointers.
+ * Purpose: Returns the current settings for alignment properties from a
+ * file access property list. The THRESHOLD and/or ALIGNMENT
+ * pointers may be null pointers.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Tuesday, June 9, 1998
*
*-------------------------------------------------------------------------
@@ -709,20 +709,20 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5P_set_driver
+ * Function: H5P_set_driver
*
- * Purpose: Set the file driver (DRIVER_ID) for a file access
- * property list (PLIST_ID) and supply an optional
- * struct containing the driver-specific properites
- * (DRIVER_INFO). The driver properties will be copied into the
- * property list and the reference count on the driver will be
- * incremented, allowing the caller to close the driver ID but
- * still use the property list.
+ * Purpose: Set the file driver (DRIVER_ID) for a file access
+ * property list (PLIST_ID) and supply an optional
+ * struct containing the driver-specific properites
+ * (DRIVER_INFO). The driver properties will be copied into the
+ * property list and the reference count on the driver will be
+ * incremented, allowing the caller to close the driver ID but
+ * still use the property list.
*
- * Return: Success: Non-negative
- * Failure: Negative
+ * Return: Success: Non-negative
+ * Failure: Negative
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Tuesday, August 3, 1999
*
*-------------------------------------------------------------------------
@@ -757,20 +757,20 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5Pset_driver
+ * Function: H5Pset_driver
*
- * Purpose: Set the file driver (DRIVER_ID) for a file access
- * property list (PLIST_ID) and supply an optional
- * struct containing the driver-specific properites
- * (DRIVER_INFO). The driver properties will be copied into the
- * property list and the reference count on the driver will be
- * incremented, allowing the caller to close the driver ID but
- * still use the property list.
+ * Purpose: Set the file driver (DRIVER_ID) for a file access
+ * property list (PLIST_ID) and supply an optional
+ * struct containing the driver-specific properites
+ * (DRIVER_INFO). The driver properties will be copied into the
+ * property list and the reference count on the driver will be
+ * incremented, allowing the caller to close the driver ID but
+ * still use the property list.
*
- * Return: Success: Non-negative
- * Failure: Negative
+ * Return: Success: Non-negative
+ * Failure: Negative
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Tuesday, August 3, 1999
*
*-------------------------------------------------------------------------
@@ -800,20 +800,20 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5P_peek_driver
+ * Function: H5P_peek_driver
*
- * Purpose: Return the ID of the low-level file driver. PLIST_ID should
- * be a file access property list.
+ * Purpose: Return the ID of the low-level file driver. PLIST_ID should
+ * be a file access property list.
*
- * Return: Success: A low-level driver ID which is the same ID
- * used when the driver was set for the property
- * list. The driver ID is only valid as long as
- * the file driver remains registered.
+ * Return: Success: A low-level driver ID which is the same ID
+ * used when the driver was set for the property
+ * list. The driver ID is only valid as long as
+ * the file driver remains registered.
*
- * Failure: Negative
+ * Failure: Negative
*
- * Programmer: Robb Matzke
- * Thursday, February 26, 1998
+ * Programmer: Robb Matzke
+ * Thursday, February 26, 1998
*
*-------------------------------------------------------------------------
*/
@@ -844,22 +844,22 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5Pget_driver
+ * Function: H5Pget_driver
*
- * Purpose: Return the ID of the low-level file driver. PLIST_ID should
- * be a file access property list.
+ * Purpose: Return the ID of the low-level file driver. PLIST_ID should
+ * be a file access property list.
*
- * Note: The ID returned should not be closed.
+ * Note: The ID returned should not be closed.
*
- * Return: Success: A low-level driver ID which is the same ID
- * used when the driver was set for the property
- * list. The driver ID is only valid as long as
- * the file driver remains registered.
+ * Return: Success: A low-level driver ID which is the same ID
+ * used when the driver was set for the property
+ * list. The driver ID is only valid as long as
+ * the file driver remains registered.
*
- * Failure: Negative
+ * Failure: Negative
*
- * Programmer: Robb Matzke
- * Thursday, February 26, 1998
+ * Programmer: Robb Matzke
+ * Thursday, February 26, 1998
*
*-------------------------------------------------------------------------
*/
@@ -867,7 +867,7 @@ hid_t
H5Pget_driver(hid_t plist_id)
{
H5P_genplist_t *plist; /* Property list pointer */
- hid_t ret_value; /* Return value */
+ hid_t ret_value; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE1("i", "i", plist_id);
@@ -885,20 +885,20 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5P_peek_driver_info
+ * Function: H5P_peek_driver_info
*
- * Purpose: Returns a pointer directly to the file driver-specific
- * information of a file access.
+ * Purpose: Returns a pointer directly to the file driver-specific
+ * information of a file access.
*
- * Return: Success: Ptr to *uncopied* driver specific data
- * structure if any.
+ * Return: Success: Ptr to *uncopied* driver specific data
+ * structure if any.
*
- * Failure: NULL. Null is also returned if the driver has
- * not registered any driver-specific properties
- * although no error is pushed on the stack in
- * this case.
+ * Failure: NULL. Null is also returned if the driver has
+ * not registered any driver-specific properties
+ * although no error is pushed on the stack in
+ * this case.
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Wednesday, August 4, 1999
*
*-------------------------------------------------------------------------
@@ -927,20 +927,20 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5Pget_driver_info
+ * Function: H5Pget_driver_info
*
- * Purpose: Returns a pointer directly to the file driver-specific
- * information of a file access.
+ * Purpose: Returns a pointer directly to the file driver-specific
+ * information of a file access.
*
- * Return: Success: Ptr to *uncopied* driver specific data
- * structure if any.
+ * Return: Success: Ptr to *uncopied* driver specific data
+ * structure if any.
*
- * Failure: NULL. Null is also returned if the driver has
- * not registered any driver-specific properties
- * although no error is pushed on the stack in
- * this case.
+ * Failure: NULL. Null is also returned if the driver has
+ * not registered any driver-specific properties
+ * although no error is pushed on the stack in
+ * this case.
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Wednesday, August 4, 1999
*
*-------------------------------------------------------------------------
@@ -973,7 +973,7 @@ done:
*
* Note: This is an "in-place" copy, since this routine gets called
* after the top-level copy has been performed and this routine
- * finishes the "deep" part of the copy.
+ * finishes the "deep" part of the copy.
*
* Return: Success: Non-negative
* Failure: Negative
@@ -1486,30 +1486,30 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5Pset_cache
+ * Function: H5Pset_cache
*
- * Purpose: Set the number of objects in the meta data cache and the
- * maximum number of chunks and bytes in the raw data chunk
- * cache.
+ * Purpose: Set the number of objects in the meta data cache and the
+ * maximum number of chunks and bytes in the raw data chunk
+ * cache.
*
- * The RDCC_W0 value should be between 0 and 1 inclusive and
- * indicates how much chunks that have been fully read or fully
- * written are favored for preemption. A value of zero means
- * fully read or written chunks are treated no differently than
- * other chunks (the preemption is strictly LRU) while a value
- * of one means fully read chunks are always preempted before
- * other chunks.
+ * The RDCC_W0 value should be between 0 and 1 inclusive and
+ * indicates how much chunks that have been fully read or fully
+ * written are favored for preemption. A value of zero means
+ * fully read or written chunks are treated no differently than
+ * other chunks (the preemption is strictly LRU) while a value
+ * of one means fully read chunks are always preempted before
+ * other chunks.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Tuesday, May 19, 1998
*
*-------------------------------------------------------------------------
*/
herr_t
H5Pset_cache(hid_t plist_id, int H5_ATTR_UNUSED mdc_nelmts,
- size_t rdcc_nslots, size_t rdcc_nbytes, double rdcc_w0)
+ size_t rdcc_nslots, size_t rdcc_nbytes, double rdcc_w0)
{
H5P_genplist_t *plist; /* Property list pointer */
herr_t ret_value = SUCCEED; /* return value */
@@ -1540,24 +1540,24 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5Pget_cache
+ * Function: H5Pget_cache
*
- * Purpose: Retrieves the maximum possible number of elements in the meta
- * data cache and the maximum possible number of elements and
- * bytes and the RDCC_W0 value in the raw data chunk cache. Any
- * (or all) arguments may be null pointers in which case the
- * corresponding datum is not returned.
+ * Purpose: Retrieves the maximum possible number of elements in the meta
+ * data cache and the maximum possible number of elements and
+ * bytes and the RDCC_W0 value in the raw data chunk cache. Any
+ * (or all) arguments may be null pointers in which case the
+ * corresponding datum is not returned.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Tuesday, May 19, 1998
*
*-------------------------------------------------------------------------
*/
herr_t
H5Pget_cache(hid_t plist_id, int *mdc_nelmts,
- size_t *rdcc_nslots, size_t *rdcc_nbytes, double *rdcc_w0)
+ size_t *rdcc_nslots, size_t *rdcc_nbytes, double *rdcc_w0)
{
H5P_genplist_t *plist; /* Property list pointer */
herr_t ret_value = SUCCEED; /* return value */
@@ -1592,14 +1592,14 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5Pset_mdc_image_config
+ * Function: H5Pset_mdc_image_config
*
- * Purpose: Set the initial metadata cache image configuration in the
- * target FAPL.
+ * Purpose: Set the initial metadata cache image configuration in the
+ * target FAPL.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: J. Mainzer
+ * Programmer: J. Mainzer
* Thursday, June 25, 2015
*
*-------------------------------------------------------------------------
@@ -1636,18 +1636,18 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5Pget_mdc_image_config
+ * Function: H5Pget_mdc_image_config
*
- * Purpose: Retrieve the metadata cache initial image configuration
- * from the target FAPL.
+ * Purpose: Retrieve the metadata cache initial image configuration
+ * from the target FAPL.
*
- * Observe that the function will fail if config_ptr is
- * NULL, or if config_ptr->version specifies an unknown
- * version of H5AC_cache_image_config_t.
+ * Observe that the function will fail if config_ptr is
+ * NULL, or if config_ptr->version specifies an unknown
+ * version of H5AC_cache_image_config_t.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: J. Mainzer
+ * Programmer: J. Mainzer
* Friday, June 26, 2015
*
*-------------------------------------------------------------------------
@@ -1687,14 +1687,14 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5Pset_mdc_config
+ * Function: H5Pset_mdc_config
*
- * Purpose: Set the initial metadata cache resize configuration in the
- * target FAPL.
+ * Purpose: Set the initial metadata cache resize configuration in the
+ * target FAPL.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: J. Mainzer
+ * Programmer: J. Mainzer
* Thursday, April 7, 2005
*
*-------------------------------------------------------------------------
@@ -1731,18 +1731,18 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5Pget_mdc_config
+ * Function: H5Pget_mdc_config
*
- * Purpose: Retrieve the metadata cache initial resize configuration
- * from the target FAPL.
+ * Purpose: Retrieve the metadata cache initial resize configuration
+ * from the target FAPL.
*
- * Observe that the function will fail if config_ptr is
- * NULL, or if config_ptr->version specifies an unknown
- * version of H5AC_cache_config_t.
+ * Observe that the function will fail if config_ptr is
+ * NULL, or if config_ptr->version specifies an unknown
+ * version of H5AC_cache_config_t.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: J. Mainzer
+ * Programmer: J. Mainzer
* Thursday, April 7, 2005
*
*-------------------------------------------------------------------------
@@ -1782,33 +1782,33 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5Pset_gc_references
+ * Function: H5Pset_gc_references
*
- * Purpose: Sets the flag for garbage collecting references for the file.
- * Dataset region references (and other reference types
- * probably) use space in the file heap. If garbage collection
- * is on and the user passes in an uninitialized value in a
- * reference structure, the heap might get corrupted. When
- * garbage collection is off however and the user re-uses a
- * reference, the previous heap block will be orphaned and not
- * returned to the free heap space. When garbage collection is
- * on, the user must initialize the reference structures to 0 or
- * risk heap corruption.
+ * Purpose: Sets the flag for garbage collecting references for the file.
+ * Dataset region references (and other reference types
+ * probably) use space in the file heap. If garbage collection
+ * is on and the user passes in an uninitialized value in a
+ * reference structure, the heap might get corrupted. When
+ * garbage collection is off however and the user re-uses a
+ * reference, the previous heap block will be orphaned and not
+ * returned to the free heap space. When garbage collection is
+ * on, the user must initialize the reference structures to 0 or
+ * risk heap corruption.
*
- * Default value for garbage collecting references is off, just
- * to be on the safe side.
+ * Default value for garbage collecting references is off, just
+ * to be on the safe side.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Quincey Koziol
- * June, 1999
+ * Programmer: Quincey Koziol
+ * June, 1999
*
* Modifications:
*
- * Raymond Lu
- * Tuesday, Oct 23, 2001
- * Changed the file access list to the new generic property
- * list.
+ * Raymond Lu
+ * Tuesday, Oct 23, 2001
+ * Changed the file access list to the new generic property
+ * list.
*
*-------------------------------------------------------------------------
*/
@@ -1835,22 +1835,22 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5Pget_gc_references
+ * Function: H5Pget_gc_references
*
- * Purpose: Returns the current setting for the garbage collection
- * references property from a file access property list.
+ * Purpose: Returns the current setting for the garbage collection
+ * references property from a file access property list.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* June, 1999
*
* Modifications:
*
- * Raymond Lu
- * Tuesday, Oct 23, 2001
- * Changed the file access list to the new generic property
- * list.
+ * Raymond Lu
+ * Tuesday, Oct 23, 2001
+ * Changed the file access list to the new generic property
+ * list.
*
*-------------------------------------------------------------------------
*/
@@ -1949,31 +1949,31 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5Pset_meta_block_size
+ * Function: H5Pset_meta_block_size
*
- * Purpose: Sets the minimum size of metadata block allocations when
+ * Purpose: Sets the minimum size of metadata block allocations when
* the H5FD_FEAT_AGGREGATE_METADATA is set by a VFL driver.
* Each "raw" metadata block is allocated to be this size and then
* specific pieces of metadata (object headers, local heaps, B-trees, etc)
* are sub-allocated from this block.
*
- * The default value is set to 2048 (bytes), indicating that metadata
+ * The default value is set to 2048 (bytes), indicating that metadata
* will be attempted to be bunched together in (at least) 2K blocks in
* the file. Setting the value to 0 with this API function will
* turn off the metadata aggregation, even if the VFL driver attempts to
* use that strategy.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Friday, August 25, 2000
*
* Modifications:
*
- * Raymond Lu
- * Tuesday, Oct 23, 2001
- * Changed the file access list to the new generic property
- * list.
+ * Raymond Lu
+ * Tuesday, Oct 23, 2001
+ * Changed the file access list to the new generic property
+ * list.
*
*-------------------------------------------------------------------------
*/
@@ -2000,22 +2000,22 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5Pget_meta_block_size
+ * Function: H5Pget_meta_block_size
*
- * Purpose: Returns the current settings for the metadata block allocation
+ * Purpose: Returns the current settings for the metadata block allocation
* property from a file access property list.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Friday, August 29, 2000
*
* Modifications:
*
- * Raymond Lu
- * Tuesday, Oct 23, 2001
- * Changed the file access list to the new generic property
- * list.
+ * Raymond Lu
+ * Tuesday, Oct 23, 2001
+ * Changed the file access list to the new generic property
+ * list.
*
*-------------------------------------------------------------------------
*/
@@ -2044,31 +2044,31 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5Pset_sieve_buf_size
+ * Function: H5Pset_sieve_buf_size
*
- * Purpose: Sets the maximum size of the data seive buffer used for file
+ * Purpose: Sets the maximum size of the data seive buffer used for file
* drivers which are capable of using data sieving. The data sieve
* buffer is used when performing I/O on datasets in the file. Using a
* buffer which is large anough to hold several pieces of the dataset
* being read in for hyperslab selections boosts performance by quite a
* bit.
*
- * The default value is set to 64KB, indicating that file I/O for raw data
+ * The default value is set to 64KB, indicating that file I/O for raw data
* reads and writes will occur in at least 64KB blocks.
* Setting the value to 0 with this API function will turn off the
* data sieving, even if the VFL driver attempts to use that strategy.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Thursday, September 21, 2000
*
* Modifications:
*
- * Raymond Lu
- * Tuesday, Oct 23, 2001
- * Changed the file access list to the new generic property
- * list.
+ * Raymond Lu
+ * Tuesday, Oct 23, 2001
+ * Changed the file access list to the new generic property
+ * list.
*
*-------------------------------------------------------------------------
*/
@@ -2095,22 +2095,22 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5Pget_sieve_buf_size
+ * Function: H5Pget_sieve_buf_size
*
- * Purpose: Returns the current settings for the data sieve buffer size
+ * Purpose: Returns the current settings for the data sieve buffer size
* property from a file access property list.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Thursday, September 21, 2000
*
* Modifications:
*
- * Raymond Lu
- * Tuesday, Oct 23, 2001
- * Changed the file access list to the new generic property
- * list.
+ * Raymond Lu
+ * Tuesday, Oct 23, 2001
+ * Changed the file access list to the new generic property
+ * list.
*
*-------------------------------------------------------------------------
*/
@@ -2138,23 +2138,23 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5Pset_small_data_block_size
+ * Function: H5Pset_small_data_block_size
*
- * Purpose: Sets the minimum size of "small" raw data block allocations
+ * Purpose: Sets the minimum size of "small" raw data block allocations
* when the H5FD_FEAT_AGGREGATE_SMALLDATA is set by a VFL driver.
* Each "small" raw data block is allocated to be this size and then
* pieces of raw data which are small enough to fit are sub-allocated from
* this block.
*
- * The default value is set to 2048 (bytes), indicating that raw data
+ * The default value is set to 2048 (bytes), indicating that raw data
* smaller than this value will be attempted to be bunched together in (at
* least) 2K blocks in the file. Setting the value to 0 with this API
* function will turn off the "small" raw data aggregation, even if the
* VFL driver attempts to use that strategy.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Wednesday, June 5, 2002
*
* Modifications:
@@ -2184,14 +2184,14 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5Pget_small_data_block_size
+ * Function: H5Pget_small_data_block_size
*
- * Purpose: Returns the current settings for the "small" raw data block
+ * Purpose: Returns the current settings for the "small" raw data block
* allocation property from a file access property list.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Wednesday, June 5, 2002
*
* Modifications:
@@ -2223,9 +2223,9 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5Pset_libver_bounds
+ * Function: H5Pset_libver_bounds
*
- * Purpose: Indicates which versions of the file format the library should
+ * Purpose: Indicates which versions of the file format the library should
* use when creating objects. LOW is the earliest version of the HDF5
* library that is guaranteed to be able to access the objects created
* (the format of some objects in an HDF5 file may not have changed between
@@ -2301,9 +2301,9 @@ done:
* releases and then map down to the previous actual library release which
* had a format change.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Sunday, December 30, 2007
*
*-------------------------------------------------------------------------
@@ -2341,14 +2341,14 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5Pget_libver_bounds
+ * Function: H5Pget_libver_bounds
*
- * Purpose: Returns the current settings for the library version format bounds
+ * Purpose: Returns the current settings for the library version format bounds
* from a file access property list.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Thursday, January 3, 2008
*
*-------------------------------------------------------------------------
@@ -2464,9 +2464,9 @@ done:
/*-------------------------------------------------------------------------
* Function: H5Pset_file_image
*
- * Purpose: Sets the initial file image. Some file drivers can initialize
- * the starting data in a file from a buffer.
- *
+ * Purpose: Sets the initial file image. Some file drivers can initialize
+ * the starting data in a file from a buffer.
+ *
* Return: Non-negative on success/Negative on failure
*
* Programmer: Jacob Gruber
@@ -2480,22 +2480,22 @@ H5Pset_file_image(hid_t fapl_id, void *buf_ptr, size_t buf_len)
H5P_genplist_t *fapl; /* Property list pointer */
H5FD_file_image_info_t image_info; /* File image info */
herr_t ret_value = SUCCEED; /* Return value */
-
+
FUNC_ENTER_API(FAIL)
H5TRACE3("e", "i*xz", fapl_id, buf_ptr, buf_len);
/* validate parameters */
if(!(((buf_ptr == NULL) && (buf_len == 0)) || ((buf_ptr != NULL) && (buf_len > 0))))
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "inconsistant buf_ptr and buf_len")
-
+
/* Get the plist structure */
if(NULL == (fapl = H5P_object_verify(fapl_id, H5P_FILE_ACCESS)))
HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
-
+
/* Get old image info */
if(H5P_peek(fapl, H5F_ACS_FILE_IMAGE_INFO_NAME, &image_info) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get old file image pointer")
-
+
/* Release previous buffer, if it exists */
if(image_info.buffer != NULL) {
if(image_info.callbacks.image_free) {
@@ -2504,8 +2504,8 @@ H5Pset_file_image(hid_t fapl_id, void *buf_ptr, size_t buf_len)
} /* end if */
else
H5MM_xfree(image_info.buffer);
- } /* end if */
-
+ } /* end if */
+
/* Update struct */
if(buf_ptr) {
/* Allocate memory */
@@ -2517,15 +2517,15 @@ H5Pset_file_image(hid_t fapl_id, void *buf_ptr, size_t buf_len)
else
if(NULL == (image_info.buffer = H5MM_malloc(buf_len)))
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "unable to allocate memory block")
-
+
/* Copy data */
if(image_info.callbacks.image_memcpy) {
- if(image_info.buffer != image_info.callbacks.image_memcpy(image_info.buffer,
- buf_ptr, buf_len, H5FD_FILE_IMAGE_OP_PROPERTY_LIST_SET,
+ if(image_info.buffer != image_info.callbacks.image_memcpy(image_info.buffer,
+ buf_ptr, buf_len, H5FD_FILE_IMAGE_OP_PROPERTY_LIST_SET,
image_info.callbacks.udata))
- HGOTO_ERROR(H5E_RESOURCE, H5E_CANTCOPY, FAIL, "image_memcpy callback failed")
+ HGOTO_ERROR(H5E_RESOURCE, H5E_CANTCOPY, FAIL, "image_memcpy callback failed")
} /* end if */
- else
+ else
HDmemcpy(image_info.buffer, buf_ptr, buf_len);
} /* end if */
else
@@ -2545,24 +2545,24 @@ done:
/*-------------------------------------------------------------------------
* Function: H5Pget_file_image
*
- * Purpose: If the file image exists and buf_ptr_ptr is not NULL,
- * allocate a buffer of the correct size, copy the image into
- * the new buffer, and return the buffer to the caller in
- * *buf_ptr_ptr. Do this using the file image callbacks
- * if defined.
+ * Purpose: If the file image exists and buf_ptr_ptr is not NULL,
+ * allocate a buffer of the correct size, copy the image into
+ * the new buffer, and return the buffer to the caller in
+ * *buf_ptr_ptr. Do this using the file image callbacks
+ * if defined.
*
- * NB: It is the responsibility of the caller to free the
- * buffer whose address is returned in *buf_ptr_ptr. Do
- * this using free if the file image callbacks are not
- * defined, or with whatever method is appropriate if
- * the callbacks are defined.
+ * NB: It is the responsibility of the caller to free the
+ * buffer whose address is returned in *buf_ptr_ptr. Do
+ * this using free if the file image callbacks are not
+ * defined, or with whatever method is appropriate if
+ * the callbacks are defined.
*
- * If buf_ptr_ptr is not NULL, and no image exists, set
- * *buf_ptr_ptr to NULL.
+ * If buf_ptr_ptr is not NULL, and no image exists, set
+ * *buf_ptr_ptr to NULL.
*
- * If buf_len_ptr is not NULL, set *buf_len_ptr equal
- * to the length of the file image if it exists, and
- * to 0 if it does not.
+ * If buf_len_ptr is not NULL, set *buf_len_ptr equal
+ * to the length of the file image if it exists, and
+ * to 0 if it does not.
*
* Return: Non-negative on success/Negative on failure
*
@@ -2590,7 +2590,7 @@ H5Pget_file_image(hid_t fapl_id, void **buf_ptr_ptr, size_t *buf_len_ptr)
HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get file image info")
/* verify file image field consistancy */
- HDassert(((image_info.buffer != NULL) && (image_info.size > 0)) ||
+ HDassert(((image_info.buffer != NULL) && (image_info.size > 0)) ||
((image_info.buffer == NULL) && (image_info.size == 0)));
/* Set output size */
@@ -2611,15 +2611,15 @@ H5Pget_file_image(hid_t fapl_id, void **buf_ptr_ptr, size_t *buf_len_ptr)
else
if(NULL == (copy_ptr = H5MM_malloc(image_info.size)))
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "unable to allocate copy")
-
+
/* Copy data */
if(image_info.callbacks.image_memcpy) {
if(copy_ptr != image_info.callbacks.image_memcpy(copy_ptr, image_info.buffer,
- image_info.size, H5FD_FILE_IMAGE_OP_PROPERTY_LIST_GET,
+ image_info.size, H5FD_FILE_IMAGE_OP_PROPERTY_LIST_GET,
image_info.callbacks.udata))
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTCOPY, FAIL, "image_memcpy callback failed")
} /* end if */
- else
+ else
HDmemcpy(copy_ptr, image_info.buffer, image_info.size);
} /* end if */
@@ -2636,7 +2636,7 @@ done:
*
* Purpose: Sets the callbacks for file images. Some file drivers allow
* the use of user-defined callbacks for allocating, freeing and
- * copying the drivers internal buffer, potentially allowing a
+ * copying the drivers internal buffer, potentially allowing a
* clever user to do optimizations such as avoiding large mallocs
* and memcpys or to perform detailed logging.
*
@@ -2666,7 +2666,7 @@ H5Pset_file_image_callbacks(hid_t fapl_id, H5FD_file_image_callbacks_t *callback
HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get old file image info")
/* verify file image field consistancy */
- HDassert(((info.buffer != NULL) && (info.size > 0)) ||
+ HDassert(((info.buffer != NULL) && (info.size > 0)) ||
((info.buffer == NULL) && (info.size == 0)));
/* Make sure a file image hasn't already been set */
@@ -2675,7 +2675,7 @@ H5Pset_file_image_callbacks(hid_t fapl_id, H5FD_file_image_callbacks_t *callback
/* verify that callbacks_ptr is not NULL */
if(NULL == callbacks_ptr)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "NULL callbacks_ptr")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "NULL callbacks_ptr")
/* Make sure udata callbacks are going to be set if udata is going to be set */
if(callbacks_ptr->udata)
@@ -2686,7 +2686,7 @@ H5Pset_file_image_callbacks(hid_t fapl_id, H5FD_file_image_callbacks_t *callback
if(info.callbacks.udata != NULL) {
HDassert(info.callbacks.udata_free);
if(info.callbacks.udata_free(info.callbacks.udata) < 0)
- HGOTO_ERROR(H5E_RESOURCE, H5E_CANTFREE, FAIL, "udata_free callback failed")
+ HGOTO_ERROR(H5E_RESOURCE, H5E_CANTFREE, FAIL, "udata_free callback failed")
} /* end if */
/* Update struct */
@@ -2713,7 +2713,7 @@ done:
*
* Purpose: Sets the callbacks for file images. Some file drivers allow
* the use of user-defined callbacks for allocating, freeing and
- * copying the drivers internal buffer, potentially allowing a
+ * copying the drivers internal buffer, potentially allowing a
* clever user to do optimizations such as avoiding large mallocs
*
* Return: Non-negative on success/Negative on failure
@@ -2742,12 +2742,12 @@ H5Pget_file_image_callbacks(hid_t fapl_id, H5FD_file_image_callbacks_t *callback
HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get file image info")
/* verify file image field consistancy */
- HDassert(((info.buffer != NULL) && (info.size > 0)) ||
+ HDassert(((info.buffer != NULL) && (info.size > 0)) ||
((info.buffer == NULL) && (info.size == 0)));
/* verify that callbacks_ptr is not NULL */
if(NULL == callbacks_ptr)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "NULL callbacks_ptr")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "NULL callbacks_ptr")
/* Transfer values to parameters */
*callbacks_ptr = info.callbacks;
@@ -2768,12 +2768,12 @@ done:
* Function: H5P__file_image_info_copy
*
* Purpose: Copy file image info. The buffer
- * and udata may need to be copied, possibly using their
+ * and udata may need to be copied, possibly using their
* respective callbacks so the default copy won't work.
*
* Note: This is an "in-place" copy, since this routine gets called
* after the top-level copy has been performed and this routine
- * finishes the "deep" part of the copy.
+ * finishes the "deep" part of the copy.
*
* Return: Success: Non-negative
* Failure: Negative
@@ -2796,7 +2796,7 @@ H5P__file_image_info_copy(void *value)
info = (H5FD_file_image_info_t *)value;
/* verify file image field consistancy */
- HDassert(((info->buffer != NULL) && (info->size > 0)) ||
+ HDassert(((info->buffer != NULL) && (info->size > 0)) ||
((info->buffer == NULL) && (info->size == 0)));
if(info->buffer && info->size > 0) {
@@ -2815,14 +2815,14 @@ H5P__file_image_info_copy(void *value)
if(NULL == (info->buffer = H5MM_malloc(info->size)))
HGOTO_ERROR(H5E_PLIST, H5E_CANTALLOC, FAIL, "unable to allocate memory block")
} /* end else */
-
+
/* Copy data to new buffer */
if(info->callbacks.image_memcpy) {
- if(info->buffer != info->callbacks.image_memcpy(info->buffer, old_buffer,
- info->size, H5FD_FILE_IMAGE_OP_PROPERTY_LIST_COPY, info->callbacks.udata))
- HGOTO_ERROR(H5E_PLIST, H5E_CANTCOPY, FAIL, "image_memcpy callback failed")
+ if(info->buffer != info->callbacks.image_memcpy(info->buffer, old_buffer,
+ info->size, H5FD_FILE_IMAGE_OP_PROPERTY_LIST_COPY, info->callbacks.udata))
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTCOPY, FAIL, "image_memcpy callback failed")
} /* end if */
- else
+ else
HDmemcpy(info->buffer, old_buffer, info->size);
} /* end if */
@@ -2846,8 +2846,8 @@ done:
* Function: H5P__file_image_info_free
*
* Purpose: Free file image info. The buffer and udata may need to be
- * freed, possibly using their respective callbacks, so the
- * default free won't work.
+ * freed, possibly using their respective callbacks, so the
+ * default free won't work.
*
* Return: Success: Non-negative
* Failure: Negative
@@ -2868,16 +2868,16 @@ H5P__file_image_info_free(void *value)
H5FD_file_image_info_t *info; /* Image info struct */
info = (H5FD_file_image_info_t *)value;
-
+
/* Verify file image field consistancy */
- HDassert(((info->buffer != NULL) && (info->size > 0)) ||
+ HDassert(((info->buffer != NULL) && (info->size > 0)) ||
((info->buffer == NULL) && (info->size == 0)));
/* Free buffer */
- if(info->buffer != NULL && info->size > 0) {
+ if(info->buffer != NULL && info->size > 0) {
if(info->callbacks.image_free) {
if((*info->callbacks.image_free)(info->buffer, H5FD_FILE_IMAGE_OP_PROPERTY_LIST_CLOSE, info->callbacks.udata) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTFREE, FAIL, "image_free callback failed")
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTFREE, FAIL, "image_free callback failed")
} /* end if */
else
H5MM_xfree(info->buffer);
@@ -2903,7 +2903,7 @@ done:
* Purpose: Compare two cache image configurations.
*
* Return: positive if VALUE1 is greater than VALUE2, negative if VALUE2 is
- * greater than VALUE1 and zero if VALUE1 and VALUE2 are equal.
+ * greater than VALUE1 and zero if VALUE1 and VALUE2 are equal.
*
* Programmer: John Mainzer
* June 26, 2015
@@ -2944,11 +2944,11 @@ done:
* Function: H5P__facc_cache_image_config_enc
*
* Purpose: Callback routine which is called whenever the default
- * cache image config property in the file creation
- * property list is encoded.
+ * cache image config property in the file creation
+ * property list is encoded.
*
- * Return: Success: Non-negative
- * Failure: Negative
+ * Return: Success: Non-negative
+ * Failure: Negative
*
* Programmer: John Mainzer
* June 26, 2015
@@ -2990,11 +2990,11 @@ H5P__facc_cache_image_config_enc(const void *value, void **_pp, size_t *size)
* Function: H5P__facc_cache_image_config_dec
*
* Purpose: Callback routine which is called whenever the default
- * cache image config property in the file creation property
- * list is decoded.
+ * cache image config property in the file creation property
+ * list is decoded.
*
- * Return: Success: Non-negative
- * Failure: Negative
+ * Return: Success: Non-negative
+ * Failure: Negative
*
* Programmer: John Mainzer
* June 26, 2015
@@ -3109,7 +3109,7 @@ done:
*
* Purpose: Delete callback for the file image info property, called
* when the property is deleted from the plist. The buffer
- * and udata may need to be freed, possibly using their
+ * and udata may need to be freed, possibly using their
* respective callbacks so the default free won't work.
*
* Return: Non-negative on success/Negative on failure
@@ -3139,7 +3139,7 @@ done:
* Function: H5P__facc_file_image_info_copy
*
* Purpose: Copy callback for the file image info property. The buffer
- * and udata may need to be copied, possibly using their
+ * and udata may need to be copied, possibly using their
* respective callbacks so the default copy won't work.
*
* Return: Non-negative on success/Negative on failure
@@ -3228,7 +3228,7 @@ done:
* Function: H5P__facc_file_image_info_close
*
* Purpose: Close callback for the file image info property. The buffer
- * and udata may need to be freed, possibly using their
+ * and udata may need to be freed, possibly using their
* respective callbacks so the standard free won't work.
*
* Return: Non-negative on success/Negative on failure
@@ -3260,7 +3260,7 @@ done:
* Purpose: Compare two cache configurations.
*
* Return: positive if VALUE1 is greater than VALUE2, negative if VALUE2 is
- * greater than VALUE1 and zero if VALUE1 and VALUE2 are equal.
+ * greater than VALUE1 and zero if VALUE1 and VALUE2 are equal.
*
* Programmer: Mohamad Chaarawi
* September 24, 2012
@@ -3373,8 +3373,8 @@ done:
* cache config property in the file creation property list is
* encoded.
*
- * Return: Success: Non-negative
- * Failure: Negative
+ * Return: Success: Non-negative
+ * Failure: Negative
*
* Programmer: Mohamad Chaarawi
* August 09, 2012
@@ -3518,8 +3518,8 @@ H5P__facc_cache_config_enc(const void *value, void **_pp, size_t *size)
* cache config property in the file creation property list is
* decoded.
*
- * Return: Success: Non-negative
- * Failure: Negative
+ * Return: Success: Non-negative
+ * Failure: Negative
*
* Programmer: Mohamad Chaarawi
* August 09, 2012
@@ -3653,8 +3653,8 @@ done:
* degree property in the file access property list
* is encoded.
*
- * Return: Success: Non-negative
- * Failure: Negative
+ * Return: Success: Non-negative
+ * Failure: Negative
*
* Programmer: Quincey Koziol
* Wednesday, August 15, 2012
@@ -3691,8 +3691,8 @@ H5P__facc_fclose_degree_enc(const void *value, void **_pp, size_t *size)
* degree property in the file access property list
* is decoded.
*
- * Return: Success: Non-negative
- * Failure: Negative
+ * Return: Success: Non-negative
+ * Failure: Negative
*
* Programmer: Quincey Koziol
* Wednesday, August 15, 2012
@@ -3726,8 +3726,8 @@ H5P__facc_fclose_degree_dec(const void **_pp, void *_value)
* memory type property in the file access property list
* is encoded.
*
- * Return: Success: Non-negative
- * Failure: Negative
+ * Return: Success: Non-negative
+ * Failure: Negative
*
* Programmer: Quincey Koziol
* Wednesday, August 15, 2012
@@ -3764,8 +3764,8 @@ H5P__facc_multi_type_enc(const void *value, void **_pp, size_t *size)
* memory type property in the file access property list
* is decoded.
*
- * Return: Success: Non-negative
- * Failure: Negative
+ * Return: Success: Non-negative
+ * Failure: Negative
*
* Programmer: Quincey Koziol
* Wednesday, August 15, 2012
@@ -3793,12 +3793,12 @@ H5P__facc_multi_type_dec(const void **_pp, void *_value)
/*-------------------------------------------------------------------------
- * Function: H5Pset_core_write_tracking
+ * Function: H5Pset_core_write_tracking
*
- * Purpose: Enables/disables core VFD write tracking and page
+ * Purpose: Enables/disables core VFD write tracking and page
* aggregation size.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
* Programmer: Dana Robinson
* Tuesday, April 8, 2014
@@ -3834,12 +3834,12 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5Pget_core_write_tracking
+ * Function: H5Pget_core_write_tracking
*
- * Purpose: Gets information about core VFD write tracking and page
+ * Purpose: Gets information about core VFD write tracking and page
* aggregation size.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
* Programmer: Dana Robinson
* Tuesday, April 8, 2014
@@ -3876,19 +3876,19 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5Pset_metadata_read_attempts
+ * Function: H5Pset_metadata_read_attempts
+ *
+ * Purpose: Sets the # of read attempts in the file access property list
+ * when reading metadata with checksum.
+ * The # of read attempts set via this routine will only apply
+ * when opening a file with SWMR access.
+ * The # of read attempts set via this routine does not have
+ * any effect when opening a file with non-SWMR access; for this
+ * case, the # of read attempts will be always be 1.
*
- * Purpose: Sets the # of read attempts in the file access property list
- * when reading metadata with checksum.
- * The # of read attempts set via this routine will only apply
- * when opening a file with SWMR access.
- * The # of read attempts set via this routine does not have
- * any effect when opening a file with non-SWMR access; for this
- * case, the # of read attempts will be always be 1.
- *
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Vailin Choi; Sept 2013
+ * Programmer: Vailin Choi; Sept 2013
*
*-------------------------------------------------------------------------
*/
@@ -3919,13 +3919,13 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5Pget_metadata_read_attempts
+ * Function: H5Pget_metadata_read_attempts
*
- * Purpose: Returns the # of metadata read attempts set in the file access property list.
+ * Purpose: Returns the # of metadata read attempts set in the file access property list.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Vailin Choi; Sept 2013
+ * Programmer: Vailin Choi; Sept 2013
*
*-------------------------------------------------------------------------
*/
@@ -3945,13 +3945,13 @@ H5Pget_metadata_read_attempts(hid_t plist_id, unsigned *attempts/*out*/)
if(NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_ACCESS)))
HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
- /* Get the # of read attempts set */
+ /* Get the # of read attempts set */
if(H5P_get(plist, H5F_ACS_METADATA_READ_ATTEMPTS_NAME, attempts) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get the number of metadata read attempts")
- /* If not set, return the default value */
- if(*attempts == H5F_ACS_METADATA_READ_ATTEMPTS_DEF) /* 0 */
- *attempts = H5F_METADATA_READ_ATTEMPTS;
+ /* If not set, return the default value */
+ if(*attempts == H5F_ACS_METADATA_READ_ATTEMPTS_DEF) /* 0 */
+ *attempts = H5F_METADATA_READ_ATTEMPTS;
} /* end if */
done:
@@ -3960,14 +3960,14 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5Pset_obj_flush_cb
+ * Function: H5Pset_obj_flush_cb
*
- * Purpose: Sets the callback function to invoke and the user data when an
- * object flush occurs in the file.
- *
- * Return: Non-negative on success/Negative on failure
+ * Purpose: Sets the callback function to invoke and the user data when an
+ * object flush occurs in the file.
*
- * Programmer: Vailin Choi; Dec 2013
+ * Return: Non-negative on success/Negative on failure
+ *
+ * Programmer: Vailin Choi; Dec 2013
*
*-------------------------------------------------------------------------
*/
@@ -4004,14 +4004,14 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5Pget_obj_flush_cb
+ * Function: H5Pget_obj_flush_cb
+ *
+ * Purpose: Retrieves the callback function and user data set in the
+ * property list for an object flush.
*
- * Purpose: Retrieves the callback function and user data set in the
- * property list for an object flush.
- *
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Vailin Choi; Dec 2013
+ * Programmer: Vailin Choi; Dec 2013
*
*-------------------------------------------------------------------------
*/
@@ -4035,9 +4035,9 @@ H5Pget_object_flush_cb(hid_t plist_id, H5F_flush_cb_t *func, void **udata)
/* Assign return value */
if(func)
- *func = flush_info.func;
+ *func = flush_info.func;
if(udata)
- *udata = flush_info.udata;
+ *udata = flush_info.udata;
done:
FUNC_LEAVE_API(ret_value)
@@ -4045,11 +4045,11 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5Pset_mdc_log_options
+ * Function: H5Pset_mdc_log_options
*
- * Purpose: Set metadata cache log options.
+ * Purpose: Set metadata cache log options.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
*-------------------------------------------------------------------------
*/
@@ -4097,11 +4097,11 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5Pget_mdc_log_options
+ * Function: H5Pget_mdc_log_options
*
- * Purpose: Get metadata cache log options.
+ * Purpose: Get metadata cache log options.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
*-------------------------------------------------------------------------
*/
@@ -4455,8 +4455,8 @@ done:
*
* Purpose: Generic encoding callback routine for 'coll_md_read_flag' properties.
*
- * Return: Success: Non-negative
- * Failure: Negative
+ * Return: Success: Non-negative
+ * Failure: Negative
*
* Programmer: Mohamad Chaarawi
* Sunday, June 21, 2015
@@ -4493,8 +4493,8 @@ H5P__encode_coll_md_read_flag_t(const void *value, void **_pp, size_t *size)
*
* Purpose: Generic decoding callback routine for 'coll_md_read_flag' properties.
*
- * Return: Success: Non-negative
- * Failure: Negative
+ * Return: Success: Non-negative
+ * Failure: Negative
*
* Programmer: Mohamad Chaarawi
* Sunday, June 21, 2015
@@ -4523,22 +4523,22 @@ H5P__decode_coll_md_read_flag_t(const void **_pp, void *_value)
/*-------------------------------------------------------------------------
- * Function: H5Pset_all_coll_metadata_ops
+ * Function: H5Pset_all_coll_metadata_ops
*
- * Purpose: Tell the library whether the metadata read operations will
- * be done collectively (1) or not (0). Default is independent.
- * With collective mode, the library will optimize access to
- * metadata operations on the file.
+ * Purpose: Tell the library whether the metadata read operations will
+ * be done collectively (1) or not (0). Default is independent.
+ * With collective mode, the library will optimize access to
+ * metadata operations on the file.
*
- * Note: This routine accepts file access property lists, link
- * access property lists, attribute access property lists,
- * dataset access property lists, group access property lists,
- * named datatype access property lists,
- * and dataset transfer property lists.
+ * Note: This routine accepts file access property lists, link
+ * access property lists, attribute access property lists,
+ * dataset access property lists, group access property lists,
+ * named datatype access property lists,
+ * and dataset transfer property lists.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Mohamad Chaarawi
+ * Programmer: Mohamad Chaarawi
* Sunday, June 21, 2015
*
*-------------------------------------------------------------------------
@@ -4582,19 +4582,19 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5Pget_all_coll_metadata_ops
+ * Function: H5Pget_all_coll_metadata_ops
*
- * Purpose: Gets information about collective metadata read mode.
+ * Purpose: Gets information about collective metadata read mode.
*
- * Note: This routine accepts file access property lists, link
- * access property lists, attribute access property lists,
- * dataset access property lists, group access property lists,
- * named datatype access property lists,
- * and dataset transfer property lists.
+ * Note: This routine accepts file access property lists, link
+ * access property lists, attribute access property lists,
+ * dataset access property lists, group access property lists,
+ * named datatype access property lists,
+ * and dataset transfer property lists.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Mohamad Chaarawi
+ * Programmer: Mohamad Chaarawi
* Sunday, June 21, 2015
*
*-------------------------------------------------------------------------
@@ -4640,14 +4640,14 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5Pset_coll_metadata_write
+ * Function: H5Pset_coll_metadata_write
*
- * Purpose: Tell the library whether the metadata write operations will
- * be done collectively (1) or not (0). Default is collective.
+ * Purpose: Tell the library whether the metadata write operations will
+ * be done collectively (1) or not (0). Default is collective.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Mohamad Chaarawi
+ * Programmer: Mohamad Chaarawi
* Sunday, June 21, 2015
*
*-------------------------------------------------------------------------
@@ -4679,13 +4679,13 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5Pget_coll_metadata_write
+ * Function: H5Pget_coll_metadata_write
*
- * Purpose: Gets information about collective metadata write mode.
+ * Purpose: Gets information about collective metadata write mode.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Mohamad Chaarawi
+ * Programmer: Mohamad Chaarawi
* Sunday, June 21, 2015
*
*-------------------------------------------------------------------------
@@ -4717,15 +4717,15 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5Pset_page_buffer_size
+ * Function: H5Pset_page_buffer_size
*
* Purpose: Set the maximum page buffering size. This has to be a
* multiple of the page allocation size which must be enabled;
* otherwise file create/open will fail.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Mohamad Chaarawi
+ * Programmer: Mohamad Chaarawi
* June 2015
*
*-------------------------------------------------------------------------
@@ -4765,13 +4765,13 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5Pget_page_buffer_size
+ * Function: H5Pget_page_buffer_size
*
- * Purpose: Retrieves the maximum page buffer size.
+ * Purpose: Retrieves the maximum page buffer size.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Mohamad Chaarawi
+ * Programmer: Mohamad Chaarawi
* June 2015
*
*-------------------------------------------------------------------------
diff --git a/src/H5Ppublic.h b/src/H5Ppublic.h
index 493a322..a2c0418 100644
--- a/src/H5Ppublic.h
+++ b/src/H5Ppublic.h
@@ -420,6 +420,8 @@ H5_DLL herr_t H5Pset_virtual_view(hid_t plist_id, H5D_vds_view_t view);
H5_DLL herr_t H5Pget_virtual_view(hid_t plist_id, H5D_vds_view_t *view);
H5_DLL herr_t H5Pset_virtual_printf_gap(hid_t plist_id, hsize_t gap_size);
H5_DLL herr_t H5Pget_virtual_printf_gap(hid_t plist_id, hsize_t *gap_size);
+H5_DLL herr_t H5Pset_virtual_prefix(hid_t dapl_id, const char* prefix);
+H5_DLL ssize_t H5Pget_virtual_prefix(hid_t dapl_id, char* prefix /*out*/, size_t size);
H5_DLL herr_t H5Pset_append_flush(hid_t plist_id, unsigned ndims,
const hsize_t boundary[], H5D_append_cb_t func, void *udata);
H5_DLL herr_t H5Pget_append_flush(hid_t plist_id, unsigned dims,
diff --git a/src/H5system.c b/src/H5system.c
index a8726c2..719b7e0 100644
--- a/src/H5system.c
+++ b/src/H5system.c
@@ -1043,7 +1043,7 @@ H5_build_extpath(const char *name, char **extpath /*out*/)
* Unix: does not apply
*/
if(H5_CHECK_ABS_DRIVE(name)) {
- drive = name[0] - 'A' + 1;
+ drive = HDtoupper(name[0]) - 'A' + 1;
retcwd = HDgetdcwd(drive, cwdpath, MAX_PATH_LEN);
HDstrncpy(new_name, &name[2], name_len);
} /* end if */
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index fca864b..713f2bd 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -32,12 +32,13 @@ set (TEST_LIB_HEADERS
add_library (${HDF5_TEST_LIB_TARGET} STATIC ${TEST_LIB_SOURCES} ${TEST_LIB_HEADERS})
TARGET_C_PROPERTIES (${HDF5_TEST_LIB_TARGET} STATIC " " " ")
if (MSVC)
- target_link_libraries (${HDF5_TEST_LIB_TARGET} "ws2_32.lib")
+ target_link_libraries (${HDF5_TEST_LIB_TARGET} PRIVATE "ws2_32.lib")
endif ()
if (MINGW)
- target_link_libraries (${HDF5_TEST_LIB_TARGET} "wsock32.lib")
+ target_link_libraries (${HDF5_TEST_LIB_TARGET} PRIVATE "wsock32.lib")
endif ()
-target_link_libraries (${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET} ${LINK_LIBS})
+target_link_libraries (${HDF5_TEST_LIB_TARGET} PUBLIC ${LINK_LIBS})
+target_link_libraries (${HDF5_TEST_LIB_TARGET} PUBLIC ${HDF5_LIB_TARGET})
H5_SET_LIB_OPTIONS (${HDF5_TEST_LIB_TARGET} ${HDF5_TEST_LIB_NAME} STATIC)
set_target_properties (${HDF5_TEST_LIB_TARGET} PROPERTIES
FOLDER libraries/test
@@ -48,12 +49,13 @@ if (BUILD_SHARED_LIBS)
add_library (${HDF5_TEST_LIBSH_TARGET} SHARED ${TEST_LIB_SOURCES} ${TEST_LIB_HEADERS})
TARGET_C_PROPERTIES (${HDF5_TEST_LIBSH_TARGET} SHARED " " " ")
if (MSVC)
- target_link_libraries (${HDF5_TEST_LIBSH_TARGET} "ws2_32.lib")
+ target_link_libraries (${HDF5_TEST_LIBSH_TARGET} PRIVATE "ws2_32.lib")
endif ()
if (MINGW)
- target_link_libraries (${HDF5_TEST_LIBSH_TARGET} "wsock32.lib")
+ target_link_libraries (${HDF5_TEST_LIBSH_TARGET} PRIVATE "wsock32.lib")
endif ()
- target_link_libraries (${HDF5_TEST_LIBSH_TARGET} ${HDF5_LIBSH_TARGET} ${LINK_LIBS})
+ target_link_libraries (${HDF5_TEST_LIBSH_TARGET} PUBLIC ${LINK_LIBS})
+ target_link_libraries (${HDF5_TEST_LIBSH_TARGET} PUBLIC ${HDF5_LIBSH_TARGET})
H5_SET_LIB_OPTIONS (${HDF5_TEST_LIBSH_TARGET} ${HDF5_TEST_LIB_NAME} SHARED ${HDF5_PACKAGE_SOVERSION})
set_target_properties (${HDF5_TEST_LIBSH_TARGET} PROPERTIES
FOLDER libraries/test
@@ -97,7 +99,7 @@ endif ()
add_library (${HDF5_TEST_PLUGIN_TARGET} SHARED ${HDF5_TEST_SOURCE_DIR}/${plugin_name}.c)
TARGET_C_PROPERTIES (${HDF5_TEST_PLUGIN_TARGET} SHARED " " " ")
- target_link_libraries (${HDF5_TEST_PLUGIN_TARGET} ${HDF5_TEST_LIB_TARGET})
+ target_link_libraries (${HDF5_TEST_PLUGIN_TARGET} PUBLIC ${HDF5_TEST_LIB_TARGET})
H5_SET_LIB_OPTIONS (${HDF5_TEST_PLUGIN_TARGET} ${HDF5_TEST_PLUGIN_NAME} SHARED ${HDF5_PACKAGE_SOVERSION})
set_target_properties (${HDF5_TEST_PLUGIN_TARGET} PROPERTIES FOLDER libraries/TEST_PLUGIN)
@@ -123,7 +125,7 @@ endif ()
add_library (${HDF5_TEST_PLUGIN_TARGET} SHARED ${HDF5_TEST_SOURCE_DIR}/${plugin_name}.c)
TARGET_C_PROPERTIES (${HDF5_TEST_PLUGIN_TARGET} SHARED " " " ")
- target_link_libraries (${HDF5_TEST_PLUGIN_TARGET} ${HDF5_TEST_LIB_TARGET})
+ target_link_libraries (${HDF5_TEST_PLUGIN_TARGET} PUBLIC ${HDF5_TEST_LIB_TARGET})
H5_SET_LIB_OPTIONS (${HDF5_TEST_PLUGIN_TARGET} ${HDF5_TEST_PLUGIN_NAME} SHARED ${HDF5_PACKAGE_SOVERSION})
set_target_properties (${HDF5_TEST_PLUGIN_TARGET} PROPERTIES FOLDER libraries/TEST_PLUGIN)
@@ -172,13 +174,13 @@ set (testhdf5_SOURCES
add_executable (testhdf5 ${testhdf5_SOURCES})
TARGET_NAMING (testhdf5 STATIC)
TARGET_C_PROPERTIES (testhdf5 STATIC " " " ")
-target_link_libraries (testhdf5 ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET})
+target_link_libraries (testhdf5 ${HDF5_TEST_LIB_TARGET})
set_target_properties (testhdf5 PROPERTIES FOLDER test)
if (BUILD_SHARED_LIBS)
add_executable (testhdf5-shared ${testhdf5_SOURCES})
TARGET_NAMING (testhdf5-shared SHARED)
TARGET_C_PROPERTIES (testhdf5-shared SHARED " " " ")
- target_link_libraries (testhdf5-shared ${HDF5_TEST_LIBSH_TARGET} ${HDF5_LIBSH_TARGET})
+ target_link_libraries (testhdf5-shared PUBLIC ${HDF5_TEST_LIBSH_TARGET})
set_target_properties (testhdf5-shared PROPERTIES FOLDER test)
endif ()
@@ -186,13 +188,13 @@ MACRO (ADD_H5_EXE file)
add_executable (${file} ${HDF5_TEST_SOURCE_DIR}/${file}.c)
TARGET_NAMING (${file} STATIC)
TARGET_C_PROPERTIES (${file} STATIC " " " ")
- target_link_libraries (${file} ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET})
+ target_link_libraries (${file} PUBLIC ${HDF5_TEST_LIB_TARGET})
set_target_properties (${file} PROPERTIES FOLDER test)
if (BUILD_SHARED_LIBS)
add_executable (${file}-shared ${HDF5_TEST_SOURCE_DIR}/${file}.c)
TARGET_NAMING (${file}-shared SHARED)
TARGET_C_PROPERTIES (${file}-shared SHARED " " " ")
- target_link_libraries (${file}-shared ${HDF5_TEST_LIBSH_TARGET} ${HDF5_LIBSH_TARGET})
+ target_link_libraries (${file}-shared PUBLIC ${HDF5_TEST_LIBSH_TARGET})
set_target_properties (${file}-shared PROPERTIES FOLDER test)
endif ()
ENDMACRO ()
diff --git a/test/CMakeTests.cmake b/test/CMakeTests.cmake
index 973d389..fca2f27 100644
--- a/test/CMakeTests.cmake
+++ b/test/CMakeTests.cmake
@@ -452,7 +452,6 @@ set (test_CLEANFILES
extlinks19B00026.h5
extlinks19B00027.h5
extlinks19B00028.h5
- tmp
big.data
big*.h5
stdio.h5
@@ -582,6 +581,7 @@ set (test_CLEANFILES
cache_logging.out
vds_swmr.h5
vds_swmr_src_*.h5
+ tmp/vds_src_2.h5
)
# Remove any output file left over from previous test run
@@ -839,21 +839,28 @@ add_test (NAME H5TEST-clear-error_test-objects
WORKING_DIRECTORY
${HDF5_TEST_BINARY_DIR}/H5TEST
)
-add_test (NAME H5TEST-error_test COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:error_test>"
- -D "TEST_ARGS:STRING="
- -D "TEST_EXPECT=0"
- -D "TEST_MASK_ERROR=true"
- -D "TEST_OUTPUT=error_test.txt"
- -D "TEST_REFERENCE=error_test_1"
- -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/H5TEST"
- -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
-)
-set_tests_properties (H5TEST-error_test PROPERTIES
- DEPENDS H5TEST-clear-error_test-objects
- ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST;HDF5_PLUGIN_PRELOAD=::"
- WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST
-)
+if (HDF5_USE_16_API_DEFAULT)
+ add_test (
+ NAME H5TEST-error_test-SKIPPED
+ COMMAND ${CMAKE_COMMAND} -E echo "SKIP $<TARGET_FILE:error_test>"
+ )
+else ()
+ add_test (NAME H5TEST-error_test COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:error_test>"
+ -D "TEST_ARGS:STRING="
+ -D "TEST_EXPECT=0"
+ -D "TEST_MASK_ERROR=true"
+ -D "TEST_OUTPUT=error_test.txt"
+ -D "TEST_REFERENCE=error_test_1"
+ -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/H5TEST"
+ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
+ )
+ set_tests_properties (H5TEST-error_test PROPERTIES
+ DEPENDS H5TEST-clear-error_test-objects
+ ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST;HDF5_PLUGIN_PRELOAD=::"
+ WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST
+ )
+endif ()
#-- Adding test for links_env
add_test (NAME H5TEST-clear-links_env-objects
@@ -959,21 +966,28 @@ if (BUILD_SHARED_LIBS)
WORKING_DIRECTORY
${HDF5_TEST_BINARY_DIR}/H5TEST-shared
)
- add_test (NAME H5TEST-shared-error_test COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:error_test-shared>"
- -D "TEST_ARGS:STRING="
- -D "TEST_EXPECT=0"
- -D "TEST_MASK_ERROR=true"
- -D "TEST_OUTPUT=error_test.txt"
- -D "TEST_REFERENCE=error_test_1"
- -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/H5TEST-shared"
- -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
- )
- set_tests_properties (H5TEST-shared-error_test PROPERTIES
- DEPENDS H5TEST-shared-clear-error_test-objects
- ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST-shared;HDF5_PLUGIN_PRELOAD=::"
- WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST-shared
- )
+ if (HDF5_USE_16_API_DEFAULT)
+ add_test (
+ NAME H5TEST-shared-error_test-SKIPPED
+ COMMAND ${CMAKE_COMMAND} -E echo "SKIP $<TARGET_FILE:error_test-shared>"
+ )
+ else ()
+ add_test (NAME H5TEST-shared-error_test COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:error_test-shared>"
+ -D "TEST_ARGS:STRING="
+ -D "TEST_EXPECT=0"
+ -D "TEST_MASK_ERROR=true"
+ -D "TEST_OUTPUT=error_test.txt"
+ -D "TEST_REFERENCE=error_test_1"
+ -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/H5TEST-shared"
+ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
+ )
+ set_tests_properties (H5TEST-shared-error_test PROPERTIES
+ DEPENDS H5TEST-shared-clear-error_test-objects
+ ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST-shared;HDF5_PLUGIN_PRELOAD=::"
+ WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST-shared
+ )
+ endif ()
#-- Adding test for links_env
add_test (NAME H5TEST-shared-clear-links_env-objects
diff --git a/test/filter_plugin.c b/test/filter_plugin.c
index 8b7e0e4..9897c84 100644
--- a/test/filter_plugin.c
+++ b/test/filter_plugin.c
@@ -134,7 +134,7 @@ allocate_and_init_2D_array(int ***arr, const hsize_t *sizes, int **initial_value
return SUCCEED;
error:
free_2D_array(arr);
-
+
return FAIL;
} /* end allocate_and_init_2D_array() */
@@ -165,7 +165,7 @@ compare_2D_arrays(int **dset1, int **dset2, const hsize_t *sizes, /*OUT*/ hbool_
}
return SUCCEED;
-
+
} /* end compare_2D_arrays() */
@@ -612,7 +612,7 @@ test_read_data(hid_t did, int *origin_data)
free_2D_array(&check);
PASSED();
-
+
return SUCCEED;
error:
@@ -943,14 +943,14 @@ error:
* paths.
*
* Return: SUCCEED/FAIL
- *
+ *
*-------------------------------------------------------------------------
*/
static herr_t
test_path_api_calls(void)
{
unsigned int n_starting_paths;
- unsigned int u;
+ unsigned int u;
unsigned int n_paths;
herr_t ret;
ssize_t path_len = -1;
@@ -1319,7 +1319,7 @@ error:
* Purpose: Turns the chunk cache off
*
* Return: SUCCEED/FAIL
- *
+ *
*-------------------------------------------------------------------------
*/
static herr_t
@@ -1360,37 +1360,36 @@ main(void)
unsigned new_format;
int nerrors = 0;
- /* Testing setup */
- h5_reset();
-
/*******************************************************************/
/* ENSURE THAT WRITING TO DATASETS AND CREATING GROUPS WORKS */
/*******************************************************************/
+ /* Test with old & new format groups */
+ for (new_format = FALSE; new_format <= TRUE; new_format++) {
+ hid_t my_fapl_id;
- /* Get a VFD-dependent filename */
- if ((old_ff_fapl_id = h5_fileaccess()) < 0)
- TEST_ERROR;
-
- /* Turn off the chunk cache, so all the chunks are immediately written to disk */
- if (disable_chunk_cache(old_ff_fapl_id) < 0)
- TEST_ERROR;
+ /* Testing setup */
+ h5_reset();
- /* Copy the file access property list and set the latest file format on it */
- if ((new_ff_fapl_id = H5Pcopy(old_ff_fapl_id)) < 0)
- TEST_ERROR;
- if (H5Pset_libver_bounds(new_ff_fapl_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0)
- TEST_ERROR;
+ /* Get a VFD-dependent filename */
+ if ((old_ff_fapl_id = h5_fileaccess()) < 0)
+ TEST_ERROR;
- /* Fix up the filename for the VFD */
- h5_fixname(FILENAME[0], old_ff_fapl_id, filename, sizeof(filename));
+ /* Turn off the chunk cache, so all the chunks are immediately written to disk */
+ if (disable_chunk_cache(old_ff_fapl_id) < 0)
+ TEST_ERROR;
- /* Test with old & new format groups */
- for (new_format = FALSE; new_format <= TRUE; new_format++) {
- hid_t my_fapl_id;
+ /* Fix up the filename for the VFD */
+ h5_fixname(FILENAME[0], old_ff_fapl_id, filename, sizeof(filename));
/* Set the FAPL for the type of format */
if (new_format) {
HDputs("\nTesting with new file format:");
+ /* Copy the file access property list and set the latest file format on it */
+ if ((new_ff_fapl_id = H5Pcopy(old_ff_fapl_id)) < 0)
+ TEST_ERROR;
+ if (H5Pset_libver_bounds(new_ff_fapl_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0)
+ TEST_ERROR;
+
my_fapl_id = new_ff_fapl_id;
}
else {
@@ -1410,61 +1409,121 @@ main(void)
if (H5Fclose(fid) < 0)
TEST_ERROR;
- } /* end for */
- /* Close FAPLs */
- if (H5Pclose(old_ff_fapl_id) < 0)
- TEST_ERROR;
- if (H5Pclose(new_ff_fapl_id) < 0)
- TEST_ERROR;
+ /* Close FAPLs */
+ if (H5Pclose(old_ff_fapl_id) < 0)
+ TEST_ERROR;
+ if (new_format) {
+ if (H5Pclose(new_ff_fapl_id) < 0)
+ TEST_ERROR;
+ }
- /* Restore the default error handler (set in h5_reset()) */
- h5_restore_err();
+ /* Restore the default error handler (set in h5_reset()) */
+ h5_restore_err();
- /*******************************************************************/
- /* ENSURE THAT READING FROM DATASETS AND OPENING GROUPS WORKS */
- /*******************************************************************/
+ /*******************************************************************/
+ /* ENSURE THAT READING FROM DATASETS AND OPENING GROUPS WORKS */
+ /*******************************************************************/
- HDputs("\nTesting reading data with with dynamic plugin filters:");
+ HDputs("\nTesting reading data with with dynamic plugin filters:");
- /* Close the library so that all loaded plugin libraries are unloaded */
- h5_reset();
- if ((old_ff_fapl_id = h5_fileaccess()) < 0)
- TEST_ERROR;
+ /* Close the library so that all loaded plugin libraries are unloaded */
+ h5_reset();
+ if ((old_ff_fapl_id = h5_fileaccess()) < 0)
+ TEST_ERROR;
- /* Reopen the file for testing data reading */
- if ((fid = H5Fopen(filename, H5F_ACC_RDONLY, old_ff_fapl_id)) < 0)
- TEST_ERROR;
+ /* Set the FAPL for the type of format */
+ if (new_format) {
+ /* Copy the file access property list and set the latest file format on it */
+ if ((new_ff_fapl_id = H5Pcopy(old_ff_fapl_id)) < 0)
+ TEST_ERROR;
+ if (H5Pset_libver_bounds(new_ff_fapl_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0)
+ TEST_ERROR;
- /* Read the data with filters */
- nerrors += (test_dataset_read_with_filters(fid) < 0 ? 1 : 0);
+ my_fapl_id = new_ff_fapl_id;
+ }
+ else
+ my_fapl_id = old_ff_fapl_id;
- /* Test creating groups using dynamically-loaded plugin filters */
- nerrors += (test_opening_groups_using_plugins(fid) < 0 ? 1 : 0);
+ /* Reopen the file for testing data reading */
+ if ((fid = H5Fopen(filename, H5F_ACC_RDONLY, my_fapl_id)) < 0)
+ TEST_ERROR;
- /* Restore the default error handler (set in h5_reset()) */
- h5_restore_err();
+ /* Read the data with filters */
+ nerrors += (test_dataset_read_with_filters(fid) < 0 ? 1 : 0);
- /*******************************************************************/
- /* ENSURE THAT DISABLING FILTER PLUGINS VIA THE FILTER FLAGS WORKS */
- /*******************************************************************/
+ /* Test creating groups using dynamically-loaded plugin filters */
+ nerrors += (test_opening_groups_using_plugins(fid) < 0 ? 1 : 0);
- /* Close the library so that all loaded plugin libraries are unloaded */
- h5_reset();
- if ((old_ff_fapl_id = h5_fileaccess()) < 0)
- TEST_ERROR;
+ /* Close FAPLs */
+ if (H5Pclose(old_ff_fapl_id) < 0)
+ TEST_ERROR;
+ if (new_format) {
+ if (H5Pclose(new_ff_fapl_id) < 0)
+ TEST_ERROR;
+ }
- /* Reopen the file for testing data reading */
- if ((fid = H5Fopen(filename, H5F_ACC_RDONLY, old_ff_fapl_id)) < 0)
- TEST_ERROR;
+ /* Restore the default error handler (set in h5_reset()) */
+ h5_restore_err();
- /* When filters are disabled, make sure we can't read data from a
- * dataset that requires a filter plugin.
- */
- nerrors += (test_no_read_when_plugins_disabled(fid) < 0 ? 1 : 0);
+ /*******************************************************************/
+ /* ENSURE THAT DISABLING FILTER PLUGINS VIA THE FILTER FLAGS WORKS */
+ /*******************************************************************/
- if (H5Fclose(fid) < 0)
- TEST_ERROR;
+ /* Close the library so that all loaded plugin libraries are unloaded */
+ h5_reset();
+ if ((old_ff_fapl_id = h5_fileaccess()) < 0)
+ TEST_ERROR;
+
+ /* Set the FAPL for the type of format */
+ if (new_format) {
+ /* Copy the file access property list and set the latest file format on it */
+ if ((new_ff_fapl_id = H5Pcopy(old_ff_fapl_id)) < 0)
+ TEST_ERROR;
+ if (H5Pset_libver_bounds(new_ff_fapl_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0)
+ TEST_ERROR;
+
+ my_fapl_id = new_ff_fapl_id;
+ }
+ else
+ my_fapl_id = old_ff_fapl_id;
+
+ /* Reopen the file for testing data reading */
+ if ((fid = H5Fopen(filename, H5F_ACC_RDONLY, my_fapl_id)) < 0)
+ TEST_ERROR;
+
+ /* When filters are disabled, make sure we can't read data from a
+ * dataset that requires a filter plugin.
+ */
+ nerrors += (test_no_read_when_plugins_disabled(fid) < 0 ? 1 : 0);
+
+ if (H5Fclose(fid) < 0)
+ TEST_ERROR;
+
+ /*********************/
+ /* CLEAN UP */
+ /*********************/
+ /* Close FAPLs */
+ if (new_format) {
+ if (H5Pclose(new_ff_fapl_id) < 0)
+ TEST_ERROR;
+ }
+ else {
+ /* Restore the default error handler (set in h5_reset()) */
+ h5_restore_err();
+
+ if (H5Pclose(old_ff_fapl_id) < 0)
+ TEST_ERROR;
+ }
+
+ /* Free up saved arrays */
+ free_2D_array(&orig_deflate_g);
+ free_2D_array(&orig_dynlib1_g);
+ free_2D_array(&orig_dynlib2_g);
+ free_2D_array(&orig_dynlib4_g);
+ } /* end for */
+
+ h5_cleanup(FILENAME, old_ff_fapl_id);
/************************************/
/* TEST THE FILTER PLUGIN API CALLS */
@@ -1473,21 +1532,10 @@ main(void)
/* Test the APIs for access to the filter plugin path table */
nerrors += (test_path_api_calls() < 0 ? 1 : 0);
- /*********************/
- /* CLEAN UP AND EXIT */
- /*********************/
-
- /* Free up saved arrays */
- free_2D_array(&orig_deflate_g);
- free_2D_array(&orig_dynlib1_g);
- free_2D_array(&orig_dynlib2_g);
- free_2D_array(&orig_dynlib4_g);
-
if (nerrors)
TEST_ERROR;
HDprintf("All plugin tests passed.\n");
- h5_cleanup(FILENAME, old_ff_fapl_id);
HDexit(EXIT_SUCCESS);
diff --git a/test/vds.c b/test/vds.c
index c9b7a1b..a882698 100644
--- a/test/vds.c
+++ b/test/vds.c
@@ -36,6 +36,12 @@ const char *FILENAME[] = {
"vds_src_1",
"vds%%_src",
"vds_dapl",
+ "vds_virt_2",
+ "vds_virt_3",
+ "vds_src_2",
+ "vds_src_3",
+ "vds%%_src2",
+ "vds_dapl2",
NULL
};
@@ -49,6 +55,8 @@ const char *FILENAME[] = {
#define FILENAME_BUF_SIZE 1024
+#define TMPDIR "tmp/"
+
/*-------------------------------------------------------------------------
* Function: vds_select_equal
@@ -57,14 +65,7 @@ const char *FILENAME[] = {
* provided dataspaces are the same.
*
* Return: Success: 0
- *
* Failure: -1
- *
- * Programmer: Neil Fortner
- * Monday, March 2, 2015
- *
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static htri_t
@@ -130,7 +131,7 @@ vds_select_equal(hid_t space1, hid_t space2)
if(buf1[i] != buf2[i]) {
ret_value = FALSE;
break;
- } /* end if */
+ }
/* Free buffers */
HDfree(buf1);
@@ -180,7 +181,7 @@ vds_select_equal(hid_t space1, hid_t space2)
if(buf1[i] != buf2[i]) {
ret_value = FALSE;
break;
- } /* end if */
+ }
/* Free buffers */
HDfree(buf1);
@@ -217,14 +218,7 @@ error:
* parameters.
*
* Return: Success: 0
- *
* Failure: -1
- *
- * Programmer: Neil Fortner
- * Monday, March 2, 2015
- *
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static int
@@ -298,8 +292,7 @@ vds_check_mapping(hid_t dcpl, size_t i, hid_t vspace, hid_t srcspace,
error:
H5E_BEGIN_TRY {
- if(space_out >= 0)
- (void)H5Sclose(space_out);
+ H5Sclose(space_out);
} H5E_END_TRY
return -1;
@@ -312,14 +305,7 @@ error:
* Purpose: Tests API functions related to virtual datasets.
*
* Return: Success: 0
- *
* Failure: number of errors
- *
- * Programmer: Neil Fortner
- * Monday, February 16, 2015
- *
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
/* Helper function to get DCPL for examination depending on config */
@@ -370,12 +356,12 @@ test_api_get_ex_dcpl(test_api_config_t config, hid_t fapl, hid_t dcpl,
file = -1;
if((file = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Open dataset */
if((dset = H5Dopen2(file, "vdset", H5P_DEFAULT)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Get DCPL from dataset */
if((*ex_dcpl = H5Dget_create_plist(dset)) < 0)
@@ -394,8 +380,8 @@ test_api_get_ex_dcpl(test_api_config_t config, hid_t fapl, hid_t dcpl,
if(oinfo.meta_size.obj.heap_size != exp_meta_size) {
printf("VDS metadata size: %llu Expected: %llu\n", (long long unsigned)oinfo.meta_size.obj.heap_size, (long long unsigned)exp_meta_size);
TEST_ERROR
- } /* end if */
- } /* end if */
+ }
+ }
else
if((oinfo.meta_size.obj.heap_size != exp_meta_size)
&& (oinfo.meta_size.obj.heap_size != (hsize_t)0))
@@ -424,12 +410,12 @@ test_api_get_ex_dcpl(test_api_config_t config, hid_t fapl, hid_t dcpl,
if(H5Fclose(file) < 0)
TEST_ERROR
file = -1;
- } /* end if */
+ }
else if(config == TEST_API_COPY_PLIST) {
/* Copy property list */
if((*ex_dcpl = H5Pcopy(dcpl)) < 0)
TEST_ERROR
- } /* end if */
+ }
else if(config == TEST_API_ENCDEC_PLIST) {
size_t plist_buf_size;
@@ -448,14 +434,14 @@ test_api_get_ex_dcpl(test_api_config_t config, hid_t fapl, hid_t dcpl,
/* Free plist_buf */
HDfree(plist_buf);
plist_buf = NULL;
- } /* end if */
+ }
else {
/* Simply copy the id to ex_dcpl and increment the ref count so ex_dcpl
* can be closed */
if(H5Iinc_ref(dcpl) < 0)
TEST_ERROR
*ex_dcpl = dcpl;
- } /* end else */
+ }
/* Verify examination DCPL is equal to original DCPL. Do not compare the
* plist to itself, and do not do the comparison if we reopened the file,
@@ -466,16 +452,14 @@ test_api_get_ex_dcpl(test_api_config_t config, hid_t fapl, hid_t dcpl,
TEST_ERROR
if(!tri_ret)
TEST_ERROR
- } /* end if */
+ }
return 0;
error:
H5E_BEGIN_TRY {
- if(file >= 0)
- (void)H5Fclose(file);
- if(dset >= 0)
- (void)H5Dclose(dset);
+ H5Fclose(file);
+ H5Dclose(dset);
} H5E_END_TRY;
if(plist_buf)
HDfree(plist_buf);
@@ -532,7 +516,7 @@ test_api(test_api_config_t config, hid_t fapl)
case TEST_API_NTESTS:
default:
TEST_ERROR
- } /* end switch */
+ }
h5_fixname(FILENAME[0], fapl, filename, sizeof filename);
@@ -818,7 +802,7 @@ test_api(test_api_config_t config, hid_t fapl)
/* Create virtual dataspace */
if((vspace[i] = H5Screate_simple(2, dims, NULL)) < 0)
TEST_ERROR
- } /* end for */
+ }
/* Select all (should not be necessary, but just to be sure) */
if(H5Sselect_all(srcspace[0]) < 0)
@@ -932,7 +916,7 @@ test_api(test_api_config_t config, hid_t fapl)
if(H5Sclose(vspace[i]) < 0)
TEST_ERROR
vspace[i] = -1;
- } /* end for */
+ }
if(H5Pclose(ex_dcpl) < 0)
TEST_ERROR
ex_dcpl = -1;
@@ -1038,7 +1022,7 @@ test_api(test_api_config_t config, hid_t fapl)
/* Add virtual layout mapping */
if(H5Pset_virtual(dcpl, vspace[i], tmp_filename, tmp_dsetname, srcspace[0]) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Get examination DCPL */
if(test_api_get_ex_dcpl(config, fapl, dcpl, &ex_dcpl, vspace[0], filename, (hsize_t)697) < 0)
@@ -1063,7 +1047,7 @@ test_api(test_api_config_t config, hid_t fapl)
/* Check that the mapping in the DCPL is correct */
if(vds_check_mapping(ex_dcpl, (size_t)i, vspace[i], srcspace[0], tmp_filename, tmp_dsetname) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Close */
if(H5Sclose(srcspace[0]) < 0)
@@ -1073,7 +1057,7 @@ test_api(test_api_config_t config, hid_t fapl)
if(H5Sclose(vspace[i]) < 0)
TEST_ERROR
vspace[i] = -1;
- } /* end for */
+ }
if(H5Pclose(ex_dcpl) < 0)
TEST_ERROR
ex_dcpl = -1;
@@ -1123,23 +1107,460 @@ test_api(test_api_config_t config, hid_t fapl)
error:
H5E_BEGIN_TRY {
- for(i = 0; i < (sizeof(srcspace) / sizeof(srcspace[0])); i++) {
- if(srcspace[i] >= 0)
- (void)H5Sclose(srcspace[i]);
- } /* end for */
- for(i = 0; i < (sizeof(vspace) / sizeof(vspace[0])); i++) {
- if(vspace[i] >= 0)
- (void)H5Sclose(vspace[i]);
- } /* end for */
- if(dcpl >= 0)
- (void)H5Pclose(dcpl);
- if(ex_dcpl >= 0)
- (void)H5Pclose(ex_dcpl);
+ for(i = 0; i < (sizeof(srcspace) / sizeof(srcspace[0])); i++)
+ H5Sclose(srcspace[i]);
+ for(i = 0; i < (sizeof(vspace) / sizeof(vspace[0])); i++)
+ H5Sclose(vspace[i]);
+ H5Pclose(dcpl);
+ H5Pclose(ex_dcpl);
} H5E_END_TRY;
return 1;
} /* end test_api() */
+/*-------------------------------------------------------------------------
+ * Function: vds_link_prefix
+ *
+ * Purpose: Set up vds link prefix via H5Pset_virtual_prefix() to be "tmp"
+ * Should be able to access the target source files in tmp directory via the prefix set
+ * by H5Pset_virtual_prefix()
+ *
+ * Return: Success: 0
+ * Failure: -1
+ *-------------------------------------------------------------------------
+ */
+static int
+test_vds_prefix(unsigned config, hid_t fapl)
+{
+ char srcfilename[FILENAME_BUF_SIZE];
+ char srcfilename_map[FILENAME_BUF_SIZE];
+ char vfilename[FILENAME_BUF_SIZE];
+ char vfilename2[FILENAME_BUF_SIZE];
+ char srcfilenamepct[FILENAME_BUF_SIZE];
+ char srcfilenamepct_map[FILENAME_BUF_SIZE];
+ const char *srcfilenamepct_map_orig = "vds%%%%_src";
+ hid_t srcfile[4] = {-1, -1, -1, -1}; /* Files with source dsets */
+ hid_t vfile = -1; /* File with virtual dset */
+ hid_t vfile2 = -1; /* File with copied virtual dset */
+ hid_t dcpl = -1; /* Dataset creation property list */
+ hid_t dapl = -1; /* Dataset access property list */
+ hid_t srcspace[4] = {-1, -1, -1, -1}; /* Source dataspaces */
+ hid_t vspace[4] = {-1, -1, -1, -1}; /* Virtual dset dataspaces */
+ hid_t memspace = -1; /* Memory dataspace */
+ hid_t srcdset[4] = {-1, -1, -1, -1}; /* Source datsets */
+ hid_t vdset = -1; /* Virtual dataset */
+ hsize_t dims[4] = {10, 26, 0, 0}; /* Data space current size */
+ hsize_t start[4]; /* Hyperslab start */
+ hsize_t stride[4]; /* Hyperslab stride */
+ hsize_t count[4]; /* Hyperslab count */
+ hsize_t block[4]; /* Hyperslab block */
+ hssize_t offset[2] = {0, 0}; /* Selection offset */
+ int buf[10][26]; /* Write and expected read buffer */
+ int rbuf[10][26]; /* Read buffer */
+ int rbuf99[9][9]; /* 9x9 Read buffer */
+ int evbuf[10][26]; /* Expected VDS "buffer" */
+ int erbuf[10][26]; /* Expected read buffer */
+ int fill = -1; /* Fill value */
+ herr_t ret; /* Generic return value */
+ int i, j;
+ char buffer[1024]; /* buffer to read vds_prefix */
+
+ TESTING("basic virtual dataset I/O via H5Pset_vds_prefix()")
+
+ h5_fixname(FILENAME[0], fapl, vfilename, sizeof vfilename);
+ h5_fixname(FILENAME[7], fapl, vfilename2, sizeof vfilename2);
+ h5_fixname(FILENAME[8], fapl, srcfilename, sizeof srcfilename);
+ h5_fixname_printf(FILENAME[8], fapl, srcfilename_map, sizeof srcfilename_map);
+ h5_fixname(FILENAME[10], fapl, srcfilenamepct, sizeof srcfilenamepct);
+ h5_fixname_printf(srcfilenamepct_map_orig, fapl, srcfilenamepct_map, sizeof srcfilenamepct_map);
+
+ /* create tmp directory and get current working directory path */
+ if (HDmkdir(TMPDIR, (mode_t)0755) < 0 && errno != EEXIST)
+ TEST_ERROR
+
+ /* Create DCPL */
+ if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0)
+ TEST_ERROR
+
+ /* Set fill value */
+ if(H5Pset_fill_value(dcpl, H5T_NATIVE_INT, &fill) < 0)
+ TEST_ERROR
+
+ /* Initialize VDS prefix items */
+ if((dapl = H5Pcreate(H5P_DATASET_ACCESS)) < 0)
+ TEST_ERROR
+
+ if(H5Pset_virtual_prefix(dapl, TMPDIR) < 0)
+ TEST_ERROR
+ if(H5Pget_virtual_prefix(dapl, buffer, sizeof(buffer)) < 0)
+ TEST_ERROR
+
+ if(HDstrcmp(buffer, TMPDIR) != 0)
+ FAIL_PUTS_ERROR("vds prefix not set correctly");
+
+ /*
+ * Test 1: All - all selection
+ */
+ /* Create source dataspace */
+ if((srcspace[0] = H5Screate_simple(2, dims, NULL)) < 0)
+ TEST_ERROR
+
+ /* Create virtual dataspace */
+ if((vspace[0] = H5Screate_simple(2, dims, NULL)) < 0)
+ TEST_ERROR
+
+ /* Select all (should not be necessary, but just to be sure) */
+ if(H5Sselect_all(srcspace[0]) < 0)
+ TEST_ERROR
+ if(H5Sselect_all(vspace[0]) < 0)
+ TEST_ERROR
+
+ /* Add virtual layout mapping */
+ if(H5Pset_virtual(dcpl, vspace[0], config & TEST_IO_DIFFERENT_FILE ? srcfilename_map : ".", "src_dset", srcspace[0]) < 0)
+ TEST_ERROR
+
+ /* Create virtual file */
+ if((vfile = H5Fcreate(vfilename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
+ TEST_ERROR
+
+ /* Create source file if requested */
+ if(config & TEST_IO_DIFFERENT_FILE) {
+ HDgetcwd(buffer, 1024);
+ HDchdir(TMPDIR);
+ if((srcfile[0] = H5Fcreate(srcfilename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
+ TEST_ERROR
+ HDchdir(buffer);
+ }
+ else {
+ srcfile[0] = vfile;
+ if(H5Iinc_ref(srcfile[0]) < 0)
+ TEST_ERROR
+ }
+
+ /* Create source dataset */
+ if((srcdset[0] = H5Dcreate2(srcfile[0], "src_dset", H5T_NATIVE_INT, srcspace[0], H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ TEST_ERROR
+
+ /* Create virtual dataset */
+ if((vdset = H5Dcreate2(vfile, "v_dset", H5T_NATIVE_INT, vspace[0], H5P_DEFAULT, dcpl, dapl)) < 0)
+ TEST_ERROR
+
+ /* Populate write buffer */
+ for(i = 0; i < (int)(sizeof(buf) / sizeof(buf[0])); i++)
+ for(j = 0; j < (int)(sizeof(buf[0]) / sizeof(buf[0][0])); j++)
+ buf[i][j] = (i * (int)(sizeof(buf[0]) / sizeof(buf[0][0]))) + j;
+
+ /* Write data directly to source dataset */
+ if(H5Dwrite(srcdset[0], H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf[0]) < 0)
+ TEST_ERROR
+
+ /* Close srcdset and srcfile if config option specified */
+ if(config & TEST_IO_CLOSE_SRC) {
+ if(H5Dclose(srcdset[0]) < 0)
+ TEST_ERROR
+ srcdset[0] = -1;
+
+ if(config & TEST_IO_DIFFERENT_FILE) {
+ if(H5Fclose(srcfile[0]) < 0)
+ TEST_ERROR
+ srcfile[0] = -1;
+ }
+ }
+
+ /* Reopen virtual dataset and file if config option specified */
+ if(config & TEST_IO_REOPEN_VIRT) {
+ if(H5Dclose(vdset) < 0)
+ TEST_ERROR
+ vdset = -1;
+ if(H5Fclose(vfile) < 0)
+ TEST_ERROR
+ vfile = -1;
+ if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0)
+ TEST_ERROR
+ if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0)
+ TEST_ERROR
+ }
+
+ /* Read data through virtual dataset */
+ HDmemset(rbuf[0], 0, sizeof(rbuf));
+ if(H5Dread(vdset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rbuf[0]) < 0)
+ TEST_ERROR
+
+ /* Verify read data */
+ for(i = 0; i < (int)(sizeof(buf) / sizeof(buf[0])); i++) {
+ for(j = 0; j < (int)(sizeof(buf[0]) / sizeof(buf[0][0])); j++)
+ if(rbuf[i][j] != buf[i][j]) {
+ TEST_ERROR
+ }
+ }
+
+ /* Adjust write buffer */
+ for(i = 0; i < (int)(sizeof(buf) / sizeof(buf[0])); i++)
+ for(j = 0; j < (int)(sizeof(buf[0]) / sizeof(buf[0][0])); j++)
+ buf[i][j] += (int)(sizeof(buf) / sizeof(buf[0][0]));
+
+ /* Write data through virtual dataset */
+ if(H5Dwrite(vdset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf[0]) < 0)
+ TEST_ERROR
+
+ /* Reopen srcdset and srcfile if config option specified */
+ if(config & TEST_IO_CLOSE_SRC) {
+ if(config & TEST_IO_DIFFERENT_FILE) {
+ HDgetcwd(buffer, 1024);
+ HDchdir(TMPDIR);
+ if((srcfile[0] = H5Fopen(srcfilename, H5F_ACC_RDONLY, fapl)) < 0)
+ TEST_ERROR
+ HDchdir(buffer);
+ }
+ if((srcdset[0] = H5Dopen2(srcfile[0], "src_dset", H5P_DEFAULT)) < 0)
+ TEST_ERROR
+ }
+
+ /* Read data directly from source dataset */
+ HDmemset(rbuf[0], 0, sizeof(rbuf));
+ if(H5Dread(srcdset[0], H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rbuf[0]) < 0)
+ TEST_ERROR
+
+ /* Verify read data */
+ for(i = 0; i < (int)(sizeof(buf) / sizeof(buf[0])); i++)
+ for(j = 0; j < (int)(sizeof(buf[0]) / sizeof(buf[0][0])); j++)
+ if(rbuf[i][j] != buf[i][j])
+ TEST_ERROR
+
+ /* Close */
+ if(H5Dclose(srcdset[0]) < 0)
+ TEST_ERROR
+ srcdset[0] = -1;
+ if(H5Dclose(vdset) < 0)
+ TEST_ERROR
+ vdset = -1;
+ if(H5Fclose(srcfile[0]) < 0)
+ TEST_ERROR
+ srcfile[0] = -1;
+ if(H5Fclose(vfile) < 0)
+ TEST_ERROR
+ vfile = -1;
+ if(H5Sclose(srcspace[0]) < 0)
+ TEST_ERROR
+ srcspace[0] = -1;
+ if(H5Sclose(vspace[0]) < 0)
+ TEST_ERROR
+ vspace[0] = -1;
+ if(H5Pclose(dapl) < 0)
+ TEST_ERROR
+ dapl = -1;
+ if(H5Pclose(dcpl) < 0)
+ TEST_ERROR
+ dcpl = -1;
+
+ /*
+ * Test 2: All - all selection with ENV prefix
+ */
+ if(HDsetenv("HDF5_VDS_PREFIX", "${ORIGIN}/tmp", 1))
+ TEST_ERROR
+
+ /* Create DCPL */
+ if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0)
+ TEST_ERROR
+
+ /* Set fill value */
+ if(H5Pset_fill_value(dcpl, H5T_NATIVE_INT, &fill) < 0)
+ TEST_ERROR
+
+ /* Set prefix to a nonexistent directory, will be overwritten by environment variable */
+ if((dapl = H5Pcreate(H5P_DATASET_ACCESS)) < 0)
+ TEST_ERROR
+
+ if(H5Pset_virtual_prefix(dapl, "someprefix") < 0)
+ TEST_ERROR
+ if(H5Pget_virtual_prefix(dapl, buffer, sizeof(buffer)) < 0)
+ TEST_ERROR
+
+ if(HDstrcmp(buffer, "someprefix") != 0)
+ FAIL_PUTS_ERROR("vds prefix not set correctly");
+
+ /* Create source dataspace */
+ if((srcspace[0] = H5Screate_simple(2, dims, NULL)) < 0)
+ TEST_ERROR
+
+ /* Create virtual dataspace */
+ if((vspace[0] = H5Screate_simple(2, dims, NULL)) < 0)
+ TEST_ERROR
+
+ /* Select all (should not be necessary, but just to be sure) */
+ if(H5Sselect_all(srcspace[0]) < 0)
+ TEST_ERROR
+ if(H5Sselect_all(vspace[0]) < 0)
+ TEST_ERROR
+
+ /* Add virtual layout mapping */
+ if(H5Pset_virtual(dcpl, vspace[0], config & TEST_IO_DIFFERENT_FILE ? srcfilename_map : ".", "src_dset", srcspace[0]) < 0)
+ TEST_ERROR
+
+ /* Create virtual file */
+ if((vfile = H5Fcreate(vfilename2, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
+ TEST_ERROR
+
+ /* Create source file if requested */
+ if(config & TEST_IO_DIFFERENT_FILE) {
+ HDgetcwd(buffer, 1024);
+ HDchdir(TMPDIR);
+ if((srcfile[0] = H5Fcreate(srcfilename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
+ TEST_ERROR
+ HDchdir(buffer);
+ }
+ else {
+ srcfile[0] = vfile;
+ if(H5Iinc_ref(srcfile[0]) < 0)
+ TEST_ERROR
+ }
+
+ /* Create source dataset */
+ if((srcdset[0] = H5Dcreate2(srcfile[0], "src_dset", H5T_NATIVE_INT, srcspace[0], H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ TEST_ERROR
+
+ /* Create virtual dataset */
+ if((vdset = H5Dcreate2(vfile, "v_dset", H5T_NATIVE_INT, vspace[0], H5P_DEFAULT, dcpl, dapl)) < 0)
+ TEST_ERROR
+
+ /* Populate write buffer */
+ for(i = 0; i < (int)(sizeof(buf) / sizeof(buf[0])); i++)
+ for(j = 0; j < (int)(sizeof(buf[0]) / sizeof(buf[0][0])); j++)
+ buf[i][j] = (i * (int)(sizeof(buf[0]) / sizeof(buf[0][0]))) + j;
+
+ /* Write data directly to source dataset */
+ if(H5Dwrite(srcdset[0], H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf[0]) < 0)
+ TEST_ERROR
+
+ /* Close srcdset and srcfile if config option specified */
+ if(config & TEST_IO_CLOSE_SRC) {
+ if(H5Dclose(srcdset[0]) < 0)
+ TEST_ERROR
+ srcdset[0] = -1;
+
+ if(config & TEST_IO_DIFFERENT_FILE) {
+ if(H5Fclose(srcfile[0]) < 0)
+ TEST_ERROR
+ srcfile[0] = -1;
+ }
+ }
+
+ /* Reopen virtual dataset and file if config option specified */
+ if(config & TEST_IO_REOPEN_VIRT) {
+ if(H5Dclose(vdset) < 0)
+ TEST_ERROR
+ vdset = -1;
+ if(H5Fclose(vfile) < 0)
+ TEST_ERROR
+ vfile = -1;
+ if((vfile = H5Fopen(vfilename2, H5F_ACC_RDWR, fapl)) < 0)
+ TEST_ERROR
+ if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0)
+ TEST_ERROR
+ }
+
+ /* Read data through virtual dataset */
+ HDmemset(rbuf[0], 0, sizeof(rbuf));
+ if(H5Dread(vdset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rbuf[0]) < 0)
+ TEST_ERROR
+
+ /* Verify read data */
+ for(i = 0; i < (int)(sizeof(buf) / sizeof(buf[0])); i++) {
+ for(j = 0; j < (int)(sizeof(buf[0]) / sizeof(buf[0][0])); j++)
+ if(rbuf[i][j] != buf[i][j]) {
+ TEST_ERROR
+ }
+ }
+
+ /* Adjust write buffer */
+ for(i = 0; i < (int)(sizeof(buf) / sizeof(buf[0])); i++)
+ for(j = 0; j < (int)(sizeof(buf[0]) / sizeof(buf[0][0])); j++)
+ buf[i][j] += (int)(sizeof(buf) / sizeof(buf[0][0]));
+
+ /* Write data through virtual dataset */
+ if(H5Dwrite(vdset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf[0]) < 0)
+ TEST_ERROR
+
+ /* Reopen srcdset and srcfile if config option specified */
+ if(config & TEST_IO_CLOSE_SRC) {
+ if(config & TEST_IO_DIFFERENT_FILE) {
+ HDgetcwd(buffer, 1024);
+ HDchdir(TMPDIR);
+ if((srcfile[0] = H5Fopen(srcfilename, H5F_ACC_RDONLY, fapl)) < 0)
+ TEST_ERROR
+ HDchdir(buffer);
+ }
+ if((srcdset[0] = H5Dopen2(srcfile[0], "src_dset", H5P_DEFAULT)) < 0)
+ TEST_ERROR
+ }
+
+ /* Read data directly from source dataset */
+ HDmemset(rbuf[0], 0, sizeof(rbuf));
+ if(H5Dread(srcdset[0], H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rbuf[0]) < 0)
+ TEST_ERROR
+
+ /* Verify read data */
+ for(i = 0; i < (int)(sizeof(buf) / sizeof(buf[0])); i++)
+ for(j = 0; j < (int)(sizeof(buf[0]) / sizeof(buf[0][0])); j++)
+ if(rbuf[i][j] != buf[i][j])
+ TEST_ERROR
+
+ /* Close */
+ if(H5Dclose(vdset) < 0)
+ TEST_ERROR
+ vdset = -1;
+ if(H5Dclose(srcdset[0]) < 0)
+ TEST_ERROR
+ srcdset[0] = -1;
+ if(H5Fclose(srcfile[0]) < 0)
+ TEST_ERROR
+ srcfile[0] = -1;
+ if(H5Fclose(vfile) < 0)
+ TEST_ERROR
+ vfile = -1;
+ if(H5Sclose(srcspace[0]) < 0)
+ TEST_ERROR
+ srcspace[0] = -1;
+ if(H5Sclose(vspace[0]) < 0)
+ TEST_ERROR
+ vspace[0] = -1;
+ if(H5Pclose(dapl) < 0)
+ TEST_ERROR
+ dapl = -1;
+ if(H5Pclose(dcpl) < 0)
+ TEST_ERROR
+ dcpl = -1;
+
+ if(HDsetenv("HDF5_VDS_PREFIX", "", 1) < 0)
+ TEST_ERROR
+
+ PASSED();
+ return 0;
+
+ error:
+ H5E_BEGIN_TRY {
+ for(i = 0; i < (int)(sizeof(srcdset) / sizeof(srcdset[0])); i++)
+ H5Dclose(srcdset[i]);
+ H5Dclose(vdset);
+ for(i = 0; i < (int)(sizeof(srcfile) / sizeof(srcfile[0])); i++)
+ H5Fclose(srcfile[i]);
+ H5Fclose(vfile);
+ H5Fclose(vfile2);
+ for(i = 0; i < (int)(sizeof(srcspace) / sizeof(srcspace[0])); i++)
+ H5Sclose(srcspace[i]);
+ for(i = 0; i < (int)(sizeof(vspace) / sizeof(vspace[0])); i++)
+ H5Sclose(vspace[i]);
+ H5Sclose(memspace);
+ H5Pclose(dapl);
+ H5Pclose(dcpl);
+ } H5E_END_TRY;
+
+ if(HDsetenv("HDF5_VDS_PREFIX", "", 1) < 0)
+ TEST_ERROR
+
+ return 1;
+} /* end vds_link_prefix() */
+
/*-------------------------------------------------------------------------
* Function: test_basic_io
@@ -1148,14 +1569,7 @@ error:
* pattern-matching file/dataset strings
*
* Return: Success: 0
- *
* Failure: number of errors
- *
- * Programmer: Neil Fortner
- * Tuesday, March 3, 2015
- *
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static int
@@ -1238,12 +1652,12 @@ test_basic_io(unsigned config, hid_t fapl)
if(config & TEST_IO_DIFFERENT_FILE) {
if((srcfile[0] = H5Fcreate(srcfilename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
else {
srcfile[0] = vfile;
if(H5Iinc_ref(srcfile[0]) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Create source dataset */
if((srcdset[0] = H5Dcreate2(srcfile[0], "src_dset", H5T_NATIVE_INT, srcspace[0], H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
@@ -1272,8 +1686,8 @@ test_basic_io(unsigned config, hid_t fapl)
if(H5Fclose(srcfile[0]) < 0)
TEST_ERROR
srcfile[0] = -1;
- } /* end if */
- } /* end if */
+ }
+ }
/* Reopen virtual dataset and file if config option specified */
if(config & TEST_IO_REOPEN_VIRT) {
@@ -1287,7 +1701,7 @@ test_basic_io(unsigned config, hid_t fapl)
TEST_ERROR
if((vdset = H5Dopen2(vfile, "v_dset", H5P_DEFAULT)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Read data through virtual dataset */
HDmemset(rbuf[0], 0, sizeof(rbuf));
@@ -1316,7 +1730,7 @@ test_basic_io(unsigned config, hid_t fapl)
TEST_ERROR
if((srcdset[0] = H5Dopen2(srcfile[0], "src_dset", H5P_DEFAULT)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Read data directly from source dataset */
HDmemset(rbuf[0], 0, sizeof(rbuf));
@@ -1400,12 +1814,12 @@ test_basic_io(unsigned config, hid_t fapl)
if(config & TEST_IO_DIFFERENT_FILE) {
if((srcfile[0] = H5Fcreate(srcfilename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
else {
srcfile[0] = vfile;
if(H5Iinc_ref(srcfile[0]) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Create source datasets */
if((srcdset[0] = H5Dcreate2(srcfile[0], "%src_dset1", H5T_NATIVE_INT, srcspace[0], H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
@@ -1441,8 +1855,8 @@ test_basic_io(unsigned config, hid_t fapl)
if(H5Fclose(srcfile[0]) < 0)
TEST_ERROR
srcfile[0] = -1;
- } /* end if */
- } /* end if */
+ }
+ }
/* Reopen virtual dataset and file if config option specified */
if(config & TEST_IO_REOPEN_VIRT) {
@@ -1456,7 +1870,7 @@ test_basic_io(unsigned config, hid_t fapl)
TEST_ERROR
if((vdset = H5Dopen2(vfile, "v_dset", H5P_DEFAULT)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Read data through virtual dataset */
HDmemset(rbuf[0], 0, sizeof(rbuf));
@@ -1487,7 +1901,7 @@ test_basic_io(unsigned config, hid_t fapl)
TEST_ERROR
if((srcdset[1] = H5Dopen2(srcfile[0], "src_dset2%", H5P_DEFAULT)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Read data directly from source datasets */
HDmemset(rbuf[0], 0, sizeof(rbuf));
@@ -1536,8 +1950,8 @@ test_basic_io(unsigned config, hid_t fapl)
if(H5Fclose(srcfile[0]) < 0)
TEST_ERROR
srcfile[0] = -1;
- } /* end if */
- } /* end if */
+ }
+ }
/* Reopen virtual file if config option specified */
if(config & TEST_IO_REOPEN_VIRT) {
@@ -1546,7 +1960,7 @@ test_basic_io(unsigned config, hid_t fapl)
vfile = -1;
if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Open v_dset2 */
if((vdset = H5Dopen2(vfile, "v_dset2", H5P_DEFAULT)) < 0)
@@ -1572,7 +1986,7 @@ test_basic_io(unsigned config, hid_t fapl)
TEST_ERROR
if((srcdset[1] = H5Dopen2(srcfile[0], "src_dset2%", H5P_DEFAULT)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Only copy to a different file if the source datasets are in a different
* file */
@@ -1614,8 +2028,8 @@ test_basic_io(unsigned config, hid_t fapl)
if(H5Fclose(srcfile[0]) < 0)
TEST_ERROR
srcfile[0] = -1;
- } /* end if */
- } /* end if */
+ }
+ }
/* Reopen copied virtual file if config option specified */
if(config & TEST_IO_REOPEN_VIRT) {
@@ -1624,7 +2038,7 @@ test_basic_io(unsigned config, hid_t fapl)
vfile2 = -1;
if((vfile2 = H5Fopen(vfilename2, H5F_ACC_RDWR, fapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Open v_dset3 */
if((vdset = H5Dopen2(vfile2, "v_dset3", H5P_DEFAULT)) < 0)
@@ -1650,13 +2064,13 @@ test_basic_io(unsigned config, hid_t fapl)
TEST_ERROR
if((srcdset[1] = H5Dopen2(srcfile[0], "src_dset2%", H5P_DEFAULT)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Close copied virtual file */
if(H5Fclose(vfile2) < 0)
TEST_ERROR
vfile2 = -1;
- } /* end if */
+ }
/* Close */
if(H5Dclose(srcdset[0]) < 0)
@@ -1735,12 +2149,12 @@ test_basic_io(unsigned config, hid_t fapl)
if(config & TEST_IO_DIFFERENT_FILE) {
if((srcfile[0] = H5Fcreate(srcfilename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
else {
srcfile[0] = vfile;
if(H5Iinc_ref(srcfile[0]) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Create source datasets */
if((srcdset[0] = H5Dcreate2(srcfile[0], "%src_dset1", H5T_NATIVE_INT, srcspace[0], H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
@@ -1782,8 +2196,8 @@ test_basic_io(unsigned config, hid_t fapl)
if(H5Fclose(srcfile[0]) < 0)
TEST_ERROR
srcfile[0] = -1;
- } /* end if */
- } /* end if */
+ }
+ }
/* Reopen virtual dataset and file if config option specified */
if(config & TEST_IO_REOPEN_VIRT) {
@@ -1797,7 +2211,7 @@ test_basic_io(unsigned config, hid_t fapl)
TEST_ERROR
if((vdset = H5Dopen2(vfile, "v_dset", H5P_DEFAULT)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Read data through virtual dataset */
HDmemset(rbuf[0], 0, sizeof(rbuf));
@@ -1828,7 +2242,7 @@ test_basic_io(unsigned config, hid_t fapl)
TEST_ERROR
if((srcdset[1] = H5Dopen2(srcfile[0], "src_dset2%", H5P_DEFAULT)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Read data directly from source datasets */
HDmemset(rbuf[0], 0, sizeof(rbuf));
@@ -1923,12 +2337,12 @@ test_basic_io(unsigned config, hid_t fapl)
if(config & TEST_IO_DIFFERENT_FILE) {
if((srcfile[0] = H5Fcreate(srcfilenamepct, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
else {
srcfile[0] = vfile;
if(H5Iinc_ref(srcfile[0]) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Create source datasets */
if((srcdset[0] = H5Dcreate2(srcfile[0], "src_dset1", H5T_NATIVE_INT, srcspace[0], H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
@@ -1964,8 +2378,8 @@ test_basic_io(unsigned config, hid_t fapl)
if(H5Fclose(srcfile[0]) < 0)
TEST_ERROR
srcfile[0] = -1;
- } /* end if */
- } /* end if */
+ }
+ }
/* Reopen virtual dataset and file if config option specified */
if(config & TEST_IO_REOPEN_VIRT) {
@@ -1979,7 +2393,7 @@ test_basic_io(unsigned config, hid_t fapl)
TEST_ERROR
if((vdset = H5Dopen2(vfile, "v_dset", H5P_DEFAULT)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Read first source dataset through virtual dataset */
HDmemset(rbuf[0], 0, sizeof(rbuf));
@@ -2032,7 +2446,7 @@ test_basic_io(unsigned config, hid_t fapl)
TEST_ERROR
if((srcdset[1] = H5Dopen2(srcfile[0], "src_dset2", H5P_DEFAULT)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Read data directly from source datasets */
HDmemset(rbuf[0], 0, sizeof(rbuf));
@@ -2131,12 +2545,12 @@ test_basic_io(unsigned config, hid_t fapl)
if(config & TEST_IO_DIFFERENT_FILE) {
if((srcfile[0] = H5Fcreate(srcfilename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
else {
srcfile[0] = vfile;
if(H5Iinc_ref(srcfile[0]) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Create source datasets */
if((srcdset[0] = H5Dcreate2(srcfile[0], "src_dset1", H5T_NATIVE_INT, srcspace[0], H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
@@ -2164,7 +2578,7 @@ test_basic_io(unsigned config, hid_t fapl)
evbuf[i][j] = buf[2 * i][j];
for(/* j = 13 */; j < 26; j++)
evbuf[i][j] = buf[2 * i + 1][j - 13];
- } /* end for */
+ }
/* Adjust write buffer */
for(i = 0; i < (int)(sizeof(buf) / sizeof(buf[0])); i++)
@@ -2181,7 +2595,7 @@ test_basic_io(unsigned config, hid_t fapl)
evbuf[i + 5][j] = buf[2 * i][j + 13];
for(/* j = 13 */; j < 26; j++)
evbuf[i + 5][j] = buf[2 * i + 1][j];
- } /* end for */
+ }
/* Close srcdsets and srcfile if config option specified */
if(config & TEST_IO_CLOSE_SRC) {
@@ -2196,8 +2610,8 @@ test_basic_io(unsigned config, hid_t fapl)
if(H5Fclose(srcfile[0]) < 0)
TEST_ERROR
srcfile[0] = -1;
- } /* end if */
- } /* end if */
+ }
+ }
/* Reopen virtual dataset and file if config option specified */
if(config & TEST_IO_REOPEN_VIRT) {
@@ -2211,7 +2625,7 @@ test_basic_io(unsigned config, hid_t fapl)
TEST_ERROR
if((vdset = H5Dopen2(vfile, "v_dset", H5P_DEFAULT)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Read data through virtual dataset by hyperslab */
/* Reset rbuf */
@@ -2227,7 +2641,7 @@ test_basic_io(unsigned config, hid_t fapl)
erbuf[i][j] = evbuf[2 * i][j];
for(/* j = 13 */; j < 26; j++)
erbuf[i][j] = evbuf[2 * i + 1][j - 13];
- } /* end for */
+ }
/* Read second slice */
if(H5Dread(vdset, H5T_NATIVE_INT, vspace[1], srcspace[1], H5P_DEFAULT, rbuf[0]) < 0)
@@ -2239,7 +2653,7 @@ test_basic_io(unsigned config, hid_t fapl)
erbuf[i + 5][j] = evbuf[2 * i][j + 13];
for(/* j = 13 */; j < 26; j++)
erbuf[i + 5][j] = evbuf[2 * i + 1][j];
- } /* end for */
+ }
/* Verify read data */
for(i = 0; i < (int)(sizeof(buf) / sizeof(buf[0])); i++)
@@ -2263,7 +2677,7 @@ test_basic_io(unsigned config, hid_t fapl)
evbuf[2 * i][j] = buf[i][j];
for(/* j = 13 */; j < 26; j++)
evbuf[2 * i + 1][j - 13] = buf[i][j];
- } /* end for */
+ }
/* Adjust write buffer */
for(i = 0; i < (int)(sizeof(buf) / sizeof(buf[0])); i++)
@@ -2280,7 +2694,7 @@ test_basic_io(unsigned config, hid_t fapl)
evbuf[2 * i][j + 13] = buf[i + 5][j];
for(/* j = 13 */; j < 26; j++)
evbuf[2 * i + 1][j] = buf[i + 5][j];
- } /* end for */
+ }
/* Reopen srcdsets and srcfile if config option specified */
if(config & TEST_IO_CLOSE_SRC) {
@@ -2291,7 +2705,7 @@ test_basic_io(unsigned config, hid_t fapl)
TEST_ERROR
if((srcdset[1] = H5Dopen2(srcfile[0], "src_dset2", H5P_DEFAULT)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Read data directly from source datasets */
/* Reset rbuf */
@@ -2307,7 +2721,7 @@ test_basic_io(unsigned config, hid_t fapl)
erbuf[2 * i][j] = evbuf[i][j];
for(/* j = 13 */; j < 26; j++)
erbuf[2 * i + 1][j - 13] = evbuf[i][j];
- } /* end for */
+ }
/* Read second dataset */
if(H5Dread(srcdset[1], H5T_NATIVE_INT, srcspace[1], srcspace[1], H5P_DEFAULT, rbuf[0]) < 0)
@@ -2319,7 +2733,7 @@ test_basic_io(unsigned config, hid_t fapl)
erbuf[2 * i][j + 13] = evbuf[i + 5][j];
for(/* j = 13 */; j < 26; j++)
erbuf[2 * i + 1][j] = evbuf[i + 5][j];
- } /* end for */
+ }
/* Verify read data */
for(i = 0; i < (int)(sizeof(buf) / sizeof(buf[0])); i++)
@@ -2439,12 +2853,12 @@ test_basic_io(unsigned config, hid_t fapl)
if(config & TEST_IO_DIFFERENT_FILE) {
if((srcfile[0] = H5Fcreate(srcfilename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
else {
srcfile[0] = vfile;
if(H5Iinc_ref(srcfile[0]) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Create source datasets */
if((srcdset[0] = H5Dcreate2(srcfile[0], "src_dset1", H5T_NATIVE_INT, srcspace[0], H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
@@ -2498,8 +2912,8 @@ test_basic_io(unsigned config, hid_t fapl)
if(H5Fclose(srcfile[0]) < 0)
TEST_ERROR
srcfile[0] = -1;
- } /* end if */
- } /* end if */
+ }
+ }
/* Reopen virtual dataset and file if config option specified */
if(config & TEST_IO_REOPEN_VIRT) {
@@ -2513,7 +2927,7 @@ test_basic_io(unsigned config, hid_t fapl)
TEST_ERROR
if((vdset = H5Dopen2(vfile, "v_dset", H5P_DEFAULT)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Read data through virtual dataset by hyperslab */
/* Reset rbuf */
@@ -2538,7 +2952,7 @@ test_basic_io(unsigned config, hid_t fapl)
for(j = 0; j < 26; j++) {
erbuf[i][j] += (int)(sizeof(buf) / sizeof(buf[0][0]));
erbuf[i + 1][j] -= (int)(sizeof(buf) / sizeof(buf[0][0]));
- } /* end for */
+ }
/* Verify read data */
for(i = 0; i < (int)(sizeof(buf) / sizeof(buf[0])); i++)
@@ -2584,7 +2998,7 @@ test_basic_io(unsigned config, hid_t fapl)
TEST_ERROR
if((srcdset[1] = H5Dopen2(srcfile[0], "src_dset2", H5P_DEFAULT)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Read data directly from source datasets */
/* Reset rbuf */
@@ -2605,7 +3019,7 @@ test_basic_io(unsigned config, hid_t fapl)
for(j = 0; j < 26; j++) {
erbuf[i][j] += (int)(sizeof(buf) / sizeof(buf[0][0]));
erbuf[i + 1][j] -= (int)(sizeof(buf) / sizeof(buf[0][0]));
- } /* end for */
+ }
/* Read second dataset */
if(H5Dread(srcdset[1], H5T_NATIVE_INT, memspace, srcspace[0], H5P_DEFAULT, rbuf[0]) < 0)
@@ -2780,12 +3194,12 @@ test_basic_io(unsigned config, hid_t fapl)
if(config & TEST_IO_DIFFERENT_FILE) {
if((srcfile[0] = H5Fcreate(srcfilename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
else {
srcfile[0] = vfile;
if(H5Iinc_ref(srcfile[0]) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Create source dataset */
if((srcdset[0] = H5Dcreate2(srcfile[0], "src_dset1", H5T_NATIVE_INT, srcspace[0], H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
@@ -2822,8 +3236,8 @@ test_basic_io(unsigned config, hid_t fapl)
if(H5Fclose(srcfile[0]) < 0)
TEST_ERROR
srcfile[0] = -1;
- } /* end if */
- } /* end if */
+ }
+ }
/* Reopen virtual dataset and file if config option specified */
if(config & TEST_IO_REOPEN_VIRT) {
@@ -2837,7 +3251,7 @@ test_basic_io(unsigned config, hid_t fapl)
TEST_ERROR
if((vdset = H5Dopen2(vfile, "v_dset", H5P_DEFAULT)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Read data through virtual dataset */
/* Reset rbuf */
@@ -2943,7 +3357,7 @@ test_basic_io(unsigned config, hid_t fapl)
if((j >= 3) && (j < 6)) {
if(rbuf[i][j] != erbuf[i][j])
TEST_ERROR
- } /* end if */
+ }
else
if(rbuf[i][j] != 0)
TEST_ERROR
@@ -2996,7 +3410,7 @@ test_basic_io(unsigned config, hid_t fapl)
if((j >= 6) && (j < 9)) {
if(rbuf[i][j] != erbuf[i][j])
TEST_ERROR
- } /* end if */
+ }
else
if(rbuf[i][j] != 0)
TEST_ERROR
@@ -3214,7 +3628,7 @@ test_basic_io(unsigned config, hid_t fapl)
TEST_ERROR
if((srcdset[0] = H5Dopen2(srcfile[0], "src_dset1", H5P_DEFAULT)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Read data directly from source dataset */
/* Select hyperslab in memory space */
@@ -3289,32 +3703,19 @@ test_basic_io(unsigned config, hid_t fapl)
error:
H5E_BEGIN_TRY {
- for(i = 0; i < (int)(sizeof(srcdset) / sizeof(srcdset[0])); i++) {
- if(srcdset[i] >= 0)
- (void)H5Dclose(srcdset[i]);
- } /* end for */
- if(vdset >= 0)
- (void)H5Dclose(vdset);
- for(i = 0; i < (int)(sizeof(srcfile) / sizeof(srcfile[0])); i++) {
- if(srcfile[i] >= 0)
- (void)H5Fclose(srcfile[i]);
- } /* end for */
- if(vfile >= 0)
- (void)H5Fclose(vfile);
- if(vfile2 >= 0)
- (void)H5Fclose(vfile2);
- for(i = 0; i < (int)(sizeof(srcspace) / sizeof(srcspace[0])); i++) {
- if(srcspace[i] >= 0)
- (void)H5Sclose(srcspace[i]);
- } /* end for */
- for(i = 0; i < (int)(sizeof(vspace) / sizeof(vspace[0])); i++) {
- if(vspace[i] >= 0)
- (void)H5Sclose(vspace[i]);
- } /* end for */
- if(memspace >= 0)
- (void)H5Sclose(memspace);
- if(dcpl >= 0)
- (void)H5Pclose(dcpl);
+ for(i = 0; i < (int)(sizeof(srcdset) / sizeof(srcdset[0])); i++)
+ H5Dclose(srcdset[i]);
+ H5Dclose(vdset);
+ for(i = 0; i < (int)(sizeof(srcfile) / sizeof(srcfile[0])); i++)
+ H5Fclose(srcfile[i]);
+ H5Fclose(vfile);
+ H5Fclose(vfile2);
+ for(i = 0; i < (int)(sizeof(srcspace) / sizeof(srcspace[0])); i++)
+ H5Sclose(srcspace[i]);
+ for(i = 0; i < (int)(sizeof(vspace) / sizeof(vspace[0])); i++)
+ H5Sclose(vspace[i]);
+ H5Sclose(memspace);
+ H5Pclose(dcpl);
} H5E_END_TRY;
return 1;
@@ -3327,14 +3728,7 @@ error:
* Purpose: Tests VDS with unlimited selections
*
* Return: Success: 0
- *
* Failure: number of errors
- *
- * Programmer: Neil Fortner
- * Thursday, April 30, 2015
- *
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static int
@@ -3447,12 +3841,12 @@ test_unlim(unsigned config, hid_t fapl)
if(config & TEST_IO_DIFFERENT_FILE) {
if((srcfile[0] = H5Fcreate(srcfilename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
else {
srcfile[0] = vfile;
if(H5Iinc_ref(srcfile[0]) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Create source datasets */
if((srcdset[0] = H5Dcreate2(srcfile[0], "src_dset1", H5T_NATIVE_INT, srcspace[0], H5P_DEFAULT, srcdcpl, H5P_DEFAULT)) < 0)
@@ -3517,8 +3911,8 @@ test_unlim(unsigned config, hid_t fapl)
if(H5Fclose(srcfile[0]) < 0)
TEST_ERROR
srcfile[0] = -1;
- } /* end if */
- } /* end if */
+ }
+ }
/* Reopen virtual dataset and file if config option specified */
if(config & TEST_IO_REOPEN_VIRT) {
@@ -3532,7 +3926,7 @@ test_unlim(unsigned config, hid_t fapl)
TEST_ERROR
if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Get VDS space */
if((filespace = H5Dget_space(vdset)) < 0)
@@ -3577,11 +3971,11 @@ test_unlim(unsigned config, hid_t fapl)
if(j >= (int)dims[1]) {
if(rbuf[i][j] != 0)
TEST_ERROR
- } /* end if */
+ }
else
if(rbuf[i][j] != erbuf[i][j])
TEST_ERROR
- } /* end for */
+ }
/* Test H5Pget_virtual_view() */
if(H5Pget_virtual_view(dapl, &virtual_view) < 0)
@@ -3601,7 +3995,7 @@ test_unlim(unsigned config, hid_t fapl)
vfile = -1;
if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0)
TEST_ERROR
@@ -3649,11 +4043,11 @@ test_unlim(unsigned config, hid_t fapl)
if(j >= (int)dims[1]) {
if(rbuf[i][j] != 0)
TEST_ERROR
- } /* end if */
+ }
else
if(rbuf[i][j] != erbuf[i][j])
TEST_ERROR
- } /* end for */
+ }
/* Reopen srcdset[0] and srcfile if config option specified */
if(config & TEST_IO_CLOSE_SRC) {
@@ -3662,7 +4056,7 @@ test_unlim(unsigned config, hid_t fapl)
TEST_ERROR
if((srcdset[0] = H5Dopen2(srcfile[0], "src_dset1", H5P_DEFAULT)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Extend srcdset[0] */
dims[0] = 5;
@@ -3699,8 +4093,8 @@ test_unlim(unsigned config, hid_t fapl)
if(H5Fclose(srcfile[0]) < 0)
TEST_ERROR
srcfile[0] = -1;
- } /* end if */
- } /* end if */
+ }
+ }
/* Reopen virtual dataset and file if config option specified */
if(config & TEST_IO_REOPEN_VIRT) {
@@ -3714,7 +4108,7 @@ test_unlim(unsigned config, hid_t fapl)
TEST_ERROR
if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Get VDS space */
if((filespace = H5Dget_space(vdset)) < 0)
@@ -3761,11 +4155,11 @@ test_unlim(unsigned config, hid_t fapl)
if(j >= (int)dims[1]) {
if(rbuf[i][j] != 0)
TEST_ERROR
- } /* end if */
+ }
else
if(rbuf[i][j] != erbuf[i][j])
TEST_ERROR
- } /* end for */
+ }
/* Close VDS and reopen with view set to H5D_VDS_LAST_AVAILABLE, reopen file
* as well if config option specified */
@@ -3779,7 +4173,7 @@ test_unlim(unsigned config, hid_t fapl)
vfile = -1;
if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0)
TEST_ERROR
@@ -3832,11 +4226,11 @@ test_unlim(unsigned config, hid_t fapl)
if(j >= (int)dims[1]) {
if(rbuf[i][j] != 0)
TEST_ERROR
- } /* end if */
+ }
else
if(rbuf[i][j] != erbuf[i][j])
TEST_ERROR
- } /* end for */
+ }
/* Reopen srcdset[1] and srcfile if config option specified */
if(config & TEST_IO_CLOSE_SRC) {
@@ -3845,7 +4239,7 @@ test_unlim(unsigned config, hid_t fapl)
TEST_ERROR
if((srcdset[1] = H5Dopen2(srcfile[0], "src_dset2", H5P_DEFAULT)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Extend srcdset[1] */
dims[0] = 5;
@@ -3887,8 +4281,8 @@ test_unlim(unsigned config, hid_t fapl)
if(H5Fclose(srcfile[0]) < 0)
TEST_ERROR
srcfile[0] = -1;
- } /* end if */
- } /* end if */
+ }
+ }
/* Reopen virtual dataset and file if config option specified */
if(config & TEST_IO_REOPEN_VIRT) {
@@ -3902,7 +4296,7 @@ test_unlim(unsigned config, hid_t fapl)
TEST_ERROR
if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Get VDS space */
if((filespace = H5Dget_space(vdset)) < 0)
@@ -3964,7 +4358,7 @@ test_unlim(unsigned config, hid_t fapl)
if((i == 4) || (i == 5)) {
if(rbuf[i][j] != erbuf[i][j])
TEST_ERROR
- } /* end if */
+ }
else
if(rbuf[i][j] != 0)
TEST_ERROR
@@ -4029,11 +4423,11 @@ test_unlim(unsigned config, hid_t fapl)
if(j >= (int)dims[1]) {
if(rbuf[i][j] != 0)
TEST_ERROR
- } /* end if */
+ }
else
if(rbuf[i][j] != erbuf[i][j])
TEST_ERROR
- } /* end for */
+ }
/* Shrink to 15 */
dims[1] = 15;
@@ -4060,12 +4454,12 @@ test_unlim(unsigned config, hid_t fapl)
if(j >= (int)dims[1]) {
if(rbuf[i][j] != 0)
TEST_ERROR
- } /* end if */
+ }
else
if(rbuf[i][j] != erbuf[i][j])
TEST_ERROR
- } /* end for */
- } /* end if */
+ }
+ }
/* Close VDS and reopen with view set to H5D_VDS_FIRST_MISSING, reopen file
* as well if config option specified */
@@ -4079,7 +4473,7 @@ test_unlim(unsigned config, hid_t fapl)
vfile = -1;
if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0)
TEST_ERROR
@@ -4127,11 +4521,11 @@ test_unlim(unsigned config, hid_t fapl)
if(j >= (int)dims[1]) {
if(rbuf[i][j] != 0)
TEST_ERROR
- } /* end if */
+ }
else
if(rbuf[i][j] != erbuf[i][j])
TEST_ERROR
- } /* end for */
+ }
/* Now test reopening virtual dataset without calling H5Dget_space, if
* REOPEN_VIRT flag set */
@@ -4166,11 +4560,11 @@ test_unlim(unsigned config, hid_t fapl)
if(j >= (int)dims[1]) {
if(rbuf[i][j] != 0)
TEST_ERROR
- } /* end if */
+ }
else
if(rbuf[i][j] != erbuf[i][j])
TEST_ERROR
- } /* end for */
+ }
/* Now try setting extent manually */
/* Grow to 18 */
@@ -4198,11 +4592,11 @@ test_unlim(unsigned config, hid_t fapl)
if(j >= (int)dims[1]) {
if(rbuf[i][j] != 0)
TEST_ERROR
- } /* end if */
+ }
else
if(rbuf[i][j] != erbuf[i][j])
TEST_ERROR
- } /* end for */
+ }
/* Grow to 20 */
dims[1] = 20;
@@ -4228,7 +4622,7 @@ test_unlim(unsigned config, hid_t fapl)
for(j = 0; j < (int)mdims[1]; j++)
if(rbuf[i][j] != erbuf[i][j])
TEST_ERROR
- } /* end if */
+ }
/* Close */
if(!(config & TEST_IO_CLOSE_SRC)) {
@@ -4241,12 +4635,12 @@ test_unlim(unsigned config, hid_t fapl)
if(H5Fclose(srcfile[0]) < 0)
TEST_ERROR
srcfile[0] = -1;
- } /* end if */
+ }
else if(!(config & TEST_IO_DIFFERENT_FILE)) {
if(H5Fclose(srcfile[0]) < 0)
TEST_ERROR
srcfile[0] = -1;
- } /* end if */
+ }
if(H5Dclose(vdset) < 0)
TEST_ERROR
vdset = -1;
@@ -4322,12 +4716,12 @@ test_unlim(unsigned config, hid_t fapl)
if(config & TEST_IO_DIFFERENT_FILE) {
if((srcfile[0] = H5Fcreate(srcfilename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
else {
srcfile[0] = vfile;
if(H5Iinc_ref(srcfile[0]) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Create source datasets */
if((srcdset[0] = H5Dcreate2(srcfile[0], "src_dset1", H5T_NATIVE_INT, srcspace[0], H5P_DEFAULT, srcdcpl, H5P_DEFAULT)) < 0)
@@ -4392,8 +4786,8 @@ test_unlim(unsigned config, hid_t fapl)
if(H5Fclose(srcfile[0]) < 0)
TEST_ERROR
srcfile[0] = -1;
- } /* end if */
- } /* end if */
+ }
+ }
/* Reopen virtual dataset and file if config option specified */
if(config & TEST_IO_REOPEN_VIRT) {
@@ -4407,7 +4801,7 @@ test_unlim(unsigned config, hid_t fapl)
TEST_ERROR
if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Get VDS space */
if((filespace = H5Dget_space(vdset)) < 0)
@@ -4451,11 +4845,11 @@ test_unlim(unsigned config, hid_t fapl)
if(j >= (int)dims[1]) {
if(rbuf[i][j] != 0)
TEST_ERROR
- } /* end if */
+ }
else
if(rbuf[i][j] != erbuf[i][j])
TEST_ERROR
- } /* end for */
+ }
/* Close VDS and reopen with view set to H5D_VDS_FIRST_MISSING, reopen file
* as well if config option specified */
@@ -4469,7 +4863,7 @@ test_unlim(unsigned config, hid_t fapl)
vfile = -1;
if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0)
TEST_ERROR
@@ -4511,11 +4905,11 @@ test_unlim(unsigned config, hid_t fapl)
if(j >= (int)dims[1]) {
if(rbuf[i][j] != 0)
TEST_ERROR
- } /* end if */
+ }
else
if(rbuf[i][j] != erbuf[i][j])
TEST_ERROR
- } /* end for */
+ }
/* Reopen srcdset[0] and srcfile if config option specified */
if(config & TEST_IO_CLOSE_SRC) {
@@ -4524,7 +4918,7 @@ test_unlim(unsigned config, hid_t fapl)
TEST_ERROR
if((srcdset[0] = H5Dopen2(srcfile[0], "src_dset1", H5P_DEFAULT)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Extend srcdset[0] */
dims[1] = 7;
@@ -4566,8 +4960,8 @@ test_unlim(unsigned config, hid_t fapl)
if(H5Fclose(srcfile[0]) < 0)
TEST_ERROR
srcfile[0] = -1;
- } /* end if */
- } /* end if */
+ }
+ }
/* Reopen virtual dataset and file if config option specified */
if(config & TEST_IO_REOPEN_VIRT) {
@@ -4581,7 +4975,7 @@ test_unlim(unsigned config, hid_t fapl)
TEST_ERROR
if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Get VDS space */
if((filespace = H5Dget_space(vdset)) < 0)
@@ -4627,11 +5021,11 @@ test_unlim(unsigned config, hid_t fapl)
if(j >= (int)dims[1]) {
if(rbuf[i][j] != 0)
TEST_ERROR
- } /* end if */
+ }
else
if(rbuf[i][j] != erbuf[i][j])
TEST_ERROR
- } /* end for */
+ }
/* Close VDS and reopen with view set to H5D_VDS_LAST_AVAILABLE, reopen file
* as well if config option specified */
@@ -4645,7 +5039,7 @@ test_unlim(unsigned config, hid_t fapl)
vfile = -1;
if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0)
TEST_ERROR
@@ -4696,11 +5090,11 @@ test_unlim(unsigned config, hid_t fapl)
if(j >= (int)dims[1]) {
if(rbuf[i][j] != 0)
TEST_ERROR
- } /* end if */
+ }
else
if(rbuf[i][j] != erbuf[i][j])
TEST_ERROR
- } /* end for */
+ }
/* Reopen srcdset[1] and srcfile if config option specified */
if(config & TEST_IO_CLOSE_SRC) {
@@ -4709,7 +5103,7 @@ test_unlim(unsigned config, hid_t fapl)
TEST_ERROR
if((srcdset[1] = H5Dopen2(srcfile[0], "src_dset2", H5P_DEFAULT)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Extend srcdset[1] */
dims[1] = 10;
@@ -4751,8 +5145,8 @@ test_unlim(unsigned config, hid_t fapl)
if(H5Fclose(srcfile[0]) < 0)
TEST_ERROR
srcfile[0] = -1;
- } /* end if */
- } /* end if */
+ }
+ }
/* Reopen virtual dataset and file if config option specified */
if(config & TEST_IO_REOPEN_VIRT) {
@@ -4766,7 +5160,7 @@ test_unlim(unsigned config, hid_t fapl)
TEST_ERROR
if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Get VDS space */
if((filespace = H5Dget_space(vdset)) < 0)
@@ -4828,7 +5222,7 @@ test_unlim(unsigned config, hid_t fapl)
if((i == 4) || (i == 5)) {
if(rbuf[i][j] != erbuf[i][j])
TEST_ERROR
- } /* end if */
+ }
else
if(rbuf[i][j] != 0)
TEST_ERROR
@@ -4845,7 +5239,7 @@ test_unlim(unsigned config, hid_t fapl)
vfile = -1;
if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0)
TEST_ERROR
@@ -4897,11 +5291,11 @@ test_unlim(unsigned config, hid_t fapl)
if(j >= (int)dims[1]) {
if(rbuf[i][j] != 0)
TEST_ERROR
- } /* end if */
+ }
else
if(rbuf[i][j] != erbuf[i][j])
TEST_ERROR
- } /* end for */
+ }
/* Close */
if(!(config & TEST_IO_CLOSE_SRC)) {
@@ -4914,12 +5308,12 @@ test_unlim(unsigned config, hid_t fapl)
if(H5Fclose(srcfile[0]) < 0)
TEST_ERROR
srcfile[0] = -1;
- } /* end if */
+ }
else if(!(config & TEST_IO_DIFFERENT_FILE)) {
if(H5Fclose(srcfile[0]) < 0)
TEST_ERROR
srcfile[0] = -1;
- } /* end if */
+ }
if(H5Dclose(vdset) < 0)
TEST_ERROR
vdset = -1;
@@ -5014,12 +5408,12 @@ test_unlim(unsigned config, hid_t fapl)
if(config & TEST_IO_DIFFERENT_FILE) {
if((srcfile[0] = H5Fcreate(srcfilename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
else {
srcfile[0] = vfile;
if(H5Iinc_ref(srcfile[0]) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Create source datasets */
if((srcdset[0] = H5Dcreate2(srcfile[0], "src_dset1", H5T_NATIVE_INT, srcspace[0], H5P_DEFAULT, srcdcpl, H5P_DEFAULT)) < 0)
@@ -5059,7 +5453,7 @@ test_unlim(unsigned config, hid_t fapl)
for(j = 0; j < 2; j++) {
erbuf[i][6 * j] = buf[i][2 * j];
erbuf[i][(6 * j) + 1] = buf[i][(2 * j) + 1];
- } /* end for */
+ }
/* Adjust write buffer */
for(i = 0; i < (int)mdims[0]; i++)
@@ -5075,7 +5469,7 @@ test_unlim(unsigned config, hid_t fapl)
for(j = 0; j < 2; j++) {
erbuf[i][(6 * j) + 2] = buf[i][2 * j];
erbuf[i][(6 * j) + 3] = buf[i][(2 * j) + 1];
- } /* end for */
+ }
/* Adjust write buffer */
for(i = 0; i < (int)mdims[0]; i++)
@@ -5096,7 +5490,7 @@ test_unlim(unsigned config, hid_t fapl)
for(i = 0; i < 10; i++) {
erbuf[i][4] = buf[i][0];
erbuf[i][5] = buf[i][1];
- } /* end for */
+ }
/* Close srcdsets and srcfile if config option specified */
if(config & TEST_IO_CLOSE_SRC) {
@@ -5114,8 +5508,8 @@ test_unlim(unsigned config, hid_t fapl)
if(H5Fclose(srcfile[0]) < 0)
TEST_ERROR
srcfile[0] = -1;
- } /* end if */
- } /* end if */
+ }
+ }
/* Reopen virtual dataset and file if config option specified */
if(config & TEST_IO_REOPEN_VIRT) {
@@ -5129,7 +5523,7 @@ test_unlim(unsigned config, hid_t fapl)
TEST_ERROR
if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Get VDS space */
if((filespace = H5Dget_space(vdset)) < 0)
@@ -5173,11 +5567,11 @@ test_unlim(unsigned config, hid_t fapl)
if(j >= (int)dims[1]) {
if(rbuf[i][j] != 0)
TEST_ERROR
- } /* end if */
+ }
else
if(rbuf[i][j] != erbuf[i][j])
TEST_ERROR
- } /* end for */
+ }
/* Close VDS and reopen with view set to H5D_VDS_FIRST_MISSING, reopen file
* as well if config option specified */
@@ -5191,7 +5585,7 @@ test_unlim(unsigned config, hid_t fapl)
vfile = -1;
if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0)
TEST_ERROR
@@ -5233,11 +5627,11 @@ test_unlim(unsigned config, hid_t fapl)
if(j >= (int)dims[1]) {
if(rbuf[i][j] != 0)
TEST_ERROR
- } /* end if */
+ }
else
if(rbuf[i][j] != erbuf[i][j])
TEST_ERROR
- } /* end for */
+ }
/* Reopen srcdset[0] and srcfile if config option specified */
if(config & TEST_IO_CLOSE_SRC) {
@@ -5246,7 +5640,7 @@ test_unlim(unsigned config, hid_t fapl)
TEST_ERROR
if((srcdset[0] = H5Dopen2(srcfile[0], "src_dset1", H5P_DEFAULT)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Extend srcdset[0] */
dims[1] = 7;
@@ -5283,8 +5677,8 @@ test_unlim(unsigned config, hid_t fapl)
if(H5Fclose(srcfile[0]) < 0)
TEST_ERROR
srcfile[0] = -1;
- } /* end if */
- } /* end if */
+ }
+ }
/* Reopen virtual dataset and file if config option specified */
if(config & TEST_IO_REOPEN_VIRT) {
@@ -5298,7 +5692,7 @@ test_unlim(unsigned config, hid_t fapl)
TEST_ERROR
if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Get VDS space */
if((filespace = H5Dget_space(vdset)) < 0)
@@ -5343,11 +5737,11 @@ test_unlim(unsigned config, hid_t fapl)
if(j >= (int)dims[1]) {
if(rbuf[i][j] != 0)
TEST_ERROR
- } /* end if */
+ }
else
if(rbuf[i][j] != erbuf[i][j])
TEST_ERROR
- } /* end for */
+ }
/* Close VDS and reopen with view set to H5D_VDS_LAST_AVAILABLE, reopen file
* as well if config option specified */
@@ -5361,7 +5755,7 @@ test_unlim(unsigned config, hid_t fapl)
vfile = -1;
if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0)
TEST_ERROR
@@ -5371,7 +5765,7 @@ test_unlim(unsigned config, hid_t fapl)
erbuf[i][12] = buf[i][0];
erbuf[i][13] = buf[i][1];
erbuf[i][18] = buf[i][2];
- } /* end for */
+ }
/* Get VDS space */
if((filespace = H5Dget_space(vdset)) < 0)
@@ -5415,11 +5809,11 @@ test_unlim(unsigned config, hid_t fapl)
if(j >= (int)dims[1]) {
if(rbuf[i][j] != 0)
TEST_ERROR
- } /* end if */
+ }
else
if(rbuf[i][j] != erbuf[i][j])
TEST_ERROR
- } /* end for */
+ }
/* Reopen srcdset[2] and srcfile if config option specified */
if(config & TEST_IO_CLOSE_SRC) {
@@ -5428,7 +5822,7 @@ test_unlim(unsigned config, hid_t fapl)
TEST_ERROR
if((srcdset[2] = H5Dopen2(srcfile[0], "src_dset3", H5P_DEFAULT)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Extend srcdset[2] */
dims[1] = 5;
@@ -5460,7 +5854,7 @@ test_unlim(unsigned config, hid_t fapl)
erbuf[i][10] = buf[i][0];
erbuf[i][11] = buf[i][1];
erbuf[i][16] = buf[i][2];
- } /* end for */
+ }
/* Close srcdset[2] and srcfile if config option specified */
if(config & TEST_IO_CLOSE_SRC) {
@@ -5472,8 +5866,8 @@ test_unlim(unsigned config, hid_t fapl)
if(H5Fclose(srcfile[0]) < 0)
TEST_ERROR
srcfile[0] = -1;
- } /* end if */
- } /* end if */
+ }
+ }
/* Reopen virtual dataset and file if config option specified */
if(config & TEST_IO_REOPEN_VIRT) {
@@ -5487,7 +5881,7 @@ test_unlim(unsigned config, hid_t fapl)
TEST_ERROR
if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Get VDS space */
if((filespace = H5Dget_space(vdset)) < 0)
@@ -5532,11 +5926,11 @@ test_unlim(unsigned config, hid_t fapl)
if(j >= (int)dims[1]) {
if(rbuf[i][j] != 0)
TEST_ERROR
- } /* end if */
+ }
else
if(rbuf[i][j] != erbuf[i][j])
TEST_ERROR
- } /* end for */
+ }
/* Close VDS and reopen with view set to H5D_VDS_FIRST_MISSING, reopen file
* as well if config option specified */
@@ -5550,7 +5944,7 @@ test_unlim(unsigned config, hid_t fapl)
vfile = -1;
if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0)
TEST_ERROR
@@ -5596,11 +5990,11 @@ test_unlim(unsigned config, hid_t fapl)
if(j >= (int)dims[1]) {
if(rbuf[i][j] != 0)
TEST_ERROR
- } /* end if */
+ }
else
if(rbuf[i][j] != erbuf[i][j])
TEST_ERROR
- } /* end for */
+ }
/* Reopen srcdset[1] and srcfile if config option specified */
if(config & TEST_IO_CLOSE_SRC) {
@@ -5609,7 +6003,7 @@ test_unlim(unsigned config, hid_t fapl)
TEST_ERROR
if((srcdset[1] = H5Dopen2(srcfile[0], "src_dset2", H5P_DEFAULT)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Extend srcdset[1] */
dims[1] = 6;
@@ -5640,7 +6034,7 @@ test_unlim(unsigned config, hid_t fapl)
for(i = 0; i < 10; i++) {
erbuf[i][14] = buf[i][0];
erbuf[i][15] = buf[i][1];
- } /* end for */
+ }
/* Close srcdset[1] and srcfile if config option specified */
if(config & TEST_IO_CLOSE_SRC) {
@@ -5652,8 +6046,8 @@ test_unlim(unsigned config, hid_t fapl)
if(H5Fclose(srcfile[0]) < 0)
TEST_ERROR
srcfile[0] = -1;
- } /* end if */
- } /* end if */
+ }
+ }
/* Reopen virtual dataset and file if config option specified */
if(config & TEST_IO_REOPEN_VIRT) {
@@ -5667,7 +6061,7 @@ test_unlim(unsigned config, hid_t fapl)
TEST_ERROR
if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Get VDS space */
if((filespace = H5Dget_space(vdset)) < 0)
@@ -5711,11 +6105,11 @@ test_unlim(unsigned config, hid_t fapl)
if(j >= (int)dims[1]) {
if(rbuf[i][j] != 0)
TEST_ERROR
- } /* end if */
+ }
else
if(rbuf[i][j] != erbuf[i][j])
TEST_ERROR
- } /* end for */
+ }
/* Close VDS and reopen with view set to H5D_VDS_LAST_AVAILABLE, reopen file
* as well if config option specified */
@@ -5729,7 +6123,7 @@ test_unlim(unsigned config, hid_t fapl)
vfile = -1;
if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0)
TEST_ERROR
@@ -5771,11 +6165,11 @@ test_unlim(unsigned config, hid_t fapl)
if(j >= (int)dims[1]) {
if(rbuf[i][j] != 0)
TEST_ERROR
- } /* end if */
+ }
else
if(rbuf[i][j] != erbuf[i][j])
TEST_ERROR
- } /* end for */
+ }
/* Now just read middle 2 rows */
HDmemset(rbuf[0], 0, sizeof(rbuf));
@@ -5801,11 +6195,11 @@ test_unlim(unsigned config, hid_t fapl)
if(j >= (int)dims[1]) {
if(rbuf[i][j] != 0)
TEST_ERROR
- } /* end if */
+ }
else if((i == 4) || (i == 5)) {
if(rbuf[i][j] != erbuf[i][j])
TEST_ERROR
- } /* end if */
+ }
else
if(rbuf[i][j] != 0)
TEST_ERROR
@@ -5824,12 +6218,12 @@ test_unlim(unsigned config, hid_t fapl)
if(H5Fclose(srcfile[0]) < 0)
TEST_ERROR
srcfile[0] = -1;
- } /* end if */
+ }
else if(!(config & TEST_IO_DIFFERENT_FILE)) {
if(H5Fclose(srcfile[0]) < 0)
TEST_ERROR
srcfile[0] = -1;
- } /* end if */
+ }
if(H5Dclose(vdset) < 0)
TEST_ERROR
vdset = -1;
@@ -5910,12 +6304,12 @@ test_unlim(unsigned config, hid_t fapl)
if(config & TEST_IO_DIFFERENT_FILE) {
if((srcfile[0] = H5Fcreate(srcfilename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
else {
srcfile[0] = vfile;
if(H5Iinc_ref(srcfile[0]) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Create source datasets */
if((srcdset[0] = H5Dcreate2(srcfile[0], "src_dset1", H5T_NATIVE_INT, srcspace[0], H5P_DEFAULT, srcdcpl, H5P_DEFAULT)) < 0)
@@ -5968,8 +6362,8 @@ test_unlim(unsigned config, hid_t fapl)
if(H5Fclose(srcfile[0]) < 0)
TEST_ERROR
srcfile[0] = -1;
- } /* end if */
- } /* end if */
+ }
+ }
/* Reopen virtual dataset and file if config option specified */
if(config & TEST_IO_REOPEN_VIRT) {
@@ -5983,7 +6377,7 @@ test_unlim(unsigned config, hid_t fapl)
TEST_ERROR
if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Get VDS space */
if((filespace = H5Dget_space(vdset)) < 0)
@@ -6029,11 +6423,11 @@ test_unlim(unsigned config, hid_t fapl)
if(j >= (int)dims[1]) {
if(rbuf[i][j] != 0)
TEST_ERROR
- } /* end if */
+ }
else
if(rbuf[i][j] != erbuf[i][j])
TEST_ERROR
- } /* end for */
+ }
/* Close VDS and reopen with view set to H5D_VDS_FIRST_MISSING, reopen file
* as well if config option specified */
@@ -6047,7 +6441,7 @@ test_unlim(unsigned config, hid_t fapl)
vfile = -1;
if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0)
TEST_ERROR
@@ -6089,11 +6483,11 @@ test_unlim(unsigned config, hid_t fapl)
if(j >= (int)dims[1]) {
if(rbuf[i][j] != 0)
TEST_ERROR
- } /* end if */
+ }
else
if(rbuf[i][j] != erbuf[i][j])
TEST_ERROR
- } /* end for */
+ }
/* Reopen srcdset[0] and srcfile if config option specified */
if(config & TEST_IO_CLOSE_SRC) {
@@ -6102,7 +6496,7 @@ test_unlim(unsigned config, hid_t fapl)
TEST_ERROR
if((srcdset[0] = H5Dopen2(srcfile[0], "src_dset1", H5P_DEFAULT)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Extend srcdset[0] */
dims[0] = 5;
@@ -6140,8 +6534,8 @@ test_unlim(unsigned config, hid_t fapl)
if(H5Fclose(srcfile[0]) < 0)
TEST_ERROR
srcfile[0] = -1;
- } /* end if */
- } /* end if */
+ }
+ }
/* Reopen virtual dataset and file if config option specified */
if(config & TEST_IO_REOPEN_VIRT) {
@@ -6155,7 +6549,7 @@ test_unlim(unsigned config, hid_t fapl)
TEST_ERROR
if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Get VDS space */
if((filespace = H5Dget_space(vdset)) < 0)
@@ -6201,11 +6595,11 @@ test_unlim(unsigned config, hid_t fapl)
if(j >= (int)dims[1]) {
if(rbuf[i][j] != 0)
TEST_ERROR
- } /* end if */
+ }
else
if(rbuf[i][j] != erbuf[i][j])
TEST_ERROR
- } /* end for */
+ }
/* Close VDS and reopen with view set to H5D_VDS_LAST_AVAILABLE, reopen file
* as well if config option specified */
@@ -6219,7 +6613,7 @@ test_unlim(unsigned config, hid_t fapl)
vfile = -1;
if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0)
TEST_ERROR
@@ -6267,11 +6661,11 @@ test_unlim(unsigned config, hid_t fapl)
if(j >= (int)dims[1]) {
if(rbuf[i][j] != 0)
TEST_ERROR
- } /* end if */
+ }
else
if(rbuf[i][j] != erbuf[i][j])
TEST_ERROR
- } /* end for */
+ }
/* Close */
if(!(config & TEST_IO_CLOSE_SRC)) {
@@ -6284,12 +6678,12 @@ test_unlim(unsigned config, hid_t fapl)
if(H5Fclose(srcfile[0]) < 0)
TEST_ERROR
srcfile[0] = -1;
- } /* end if */
+ }
else if(!(config & TEST_IO_DIFFERENT_FILE)) {
if(H5Fclose(srcfile[0]) < 0)
TEST_ERROR
srcfile[0] = -1;
- } /* end if */
+ }
if(H5Dclose(vdset) < 0)
TEST_ERROR
vdset = -1;
@@ -6329,36 +6723,21 @@ test_unlim(unsigned config, hid_t fapl)
error:
H5E_BEGIN_TRY {
- for(i = 0; i < (int)(sizeof(srcdset) / sizeof(srcdset[0])); i++) {
- if(srcdset[i] >= 0)
- (void)H5Dclose(srcdset[i]);
- } /* end for */
- if(vdset >= 0)
- (void)H5Dclose(vdset);
- for(i = 0; i < (int)(sizeof(srcfile) / sizeof(srcfile[0])); i++) {
- if(srcfile[i] >= 0)
- (void)H5Fclose(srcfile[i]);
- } /* end for */
- if(vfile >= 0)
- (void)H5Fclose(vfile);
- for(i = 0; i < (int)(sizeof(srcspace) / sizeof(srcspace[0])); i++) {
- if(srcspace[i] >= 0)
- (void)H5Sclose(srcspace[i]);
- } /* end for */
- for(i = 0; i < (int)(sizeof(vspace) / sizeof(vspace[0])); i++) {
- if(vspace[i] >= 0)
- (void)H5Sclose(vspace[i]);
- } /* end for */
- if(filespace >= 0)
- (void)H5Sclose(filespace);
- if(memspace >= 0)
- (void)H5Sclose(memspace);
- if(dcpl >= 0)
- (void)H5Pclose(dcpl);
- if(srcdcpl >= 0)
- (void)H5Pclose(srcdcpl);
- if(dapl >= 0)
- (void)H5Pclose(dapl);
+ for(i = 0; i < (int)(sizeof(srcdset) / sizeof(srcdset[0])); i++)
+ H5Dclose(srcdset[i]);
+ H5Dclose(vdset);
+ for(i = 0; i < (int)(sizeof(srcfile) / sizeof(srcfile[0])); i++)
+ H5Fclose(srcfile[i]);
+ H5Fclose(vfile);
+ for(i = 0; i < (int)(sizeof(srcspace) / sizeof(srcspace[0])); i++)
+ H5Sclose(srcspace[i]);
+ for(i = 0; i < (int)(sizeof(vspace) / sizeof(vspace[0])); i++)
+ H5Sclose(vspace[i]);
+ H5Sclose(filespace);
+ H5Sclose(memspace);
+ H5Pclose(dcpl);
+ H5Pclose(srcdcpl);
+ H5Pclose(dapl);
} H5E_END_TRY;
return 1;
@@ -6372,14 +6751,7 @@ error:
* source dataset resolution
*
* Return: Success: 0
- *
* Failure: number of errors
- *
- * Programmer: Neil Fortner
- * Tuesday, May 26, 2015
- *
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static int
@@ -6485,12 +6857,12 @@ test_printf(unsigned config, hid_t fapl)
if(config & TEST_IO_DIFFERENT_FILE) {
if((srcfile[0] = H5Fcreate(srcfilename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
else {
srcfile[0] = vfile;
if(H5Iinc_ref(srcfile[0]) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Create virtual dataset */
if((vdset = H5Dcreate2(vfile, "v_dset", H5T_NATIVE_INT, vspace[0], H5P_DEFAULT, dcpl, dapl)) < 0)
@@ -6502,7 +6874,7 @@ test_printf(unsigned config, hid_t fapl)
if(H5Fclose(srcfile[0]) < 0)
TEST_ERROR
srcfile[0] = -1;
- } /* end if */
+ }
/* Reopen virtual dataset and file if config option specified */
if(config & TEST_IO_REOPEN_VIRT) {
@@ -6516,7 +6888,7 @@ test_printf(unsigned config, hid_t fapl)
TEST_ERROR
if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Get VDS space */
if((filespace = H5Dget_space(vdset)) < 0)
@@ -6602,8 +6974,8 @@ test_printf(unsigned config, hid_t fapl)
if(H5Fclose(srcfile[0]) < 0)
TEST_ERROR
srcfile[0] = -1;
- } /* end if */
- } /* end if */
+ }
+ }
/* Reopen virtual dataset and file if config option specified */
if(config & TEST_IO_REOPEN_VIRT) {
@@ -6617,7 +6989,7 @@ test_printf(unsigned config, hid_t fapl)
TEST_ERROR
if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Get VDS space */
if((filespace = H5Dget_space(vdset)) < 0)
@@ -6661,11 +7033,11 @@ test_printf(unsigned config, hid_t fapl)
if(j >= (int)dims[1]) {
if(rbuf[i][j] != 0)
TEST_ERROR
- } /* end if */
+ }
else
if(rbuf[i][j] != erbuf[i][j])
TEST_ERROR
- } /* end for */
+ }
/* Reopen srcfile if config option specified */
if((config & TEST_IO_CLOSE_SRC) && (config & TEST_IO_DIFFERENT_FILE))
@@ -6702,8 +7074,8 @@ test_printf(unsigned config, hid_t fapl)
if(H5Fclose(srcfile[0]) < 0)
TEST_ERROR
srcfile[0] = -1;
- } /* end if */
- } /* end if */
+ }
+ }
/* Reopen virtual dataset and file if config option specified */
if(config & TEST_IO_REOPEN_VIRT) {
@@ -6717,7 +7089,7 @@ test_printf(unsigned config, hid_t fapl)
TEST_ERROR
if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Get VDS space */
if((filespace = H5Dget_space(vdset)) < 0)
@@ -6757,11 +7129,11 @@ test_printf(unsigned config, hid_t fapl)
if(j >= (int)dims[1]) {
if(rbuf[i][j] != 0)
TEST_ERROR
- } /* end if */
+ }
else
if(rbuf[i][j] != erbuf[i][j])
TEST_ERROR
- } /* end for */
+ }
/* Now try with different selections */
count[0] = 10;
@@ -6788,12 +7160,12 @@ test_printf(unsigned config, hid_t fapl)
if((j < (int)start[1]) || (j >= (int)(start[1] + count[1]))) {
if(rbuf[i][j] != 0)
TEST_ERROR
- } /* end if */
+ }
else
if(rbuf[i][j] != erbuf[i][j])
TEST_ERROR
- } /* end for */
- } /* end for */
+ }
+ }
start[1] = 0;
/* Now try writing through VDS */
@@ -6829,7 +7201,7 @@ test_printf(unsigned config, hid_t fapl)
TEST_ERROR
if((srcdset[2] = H5Dopen2(srcfile[0], "src_dset2", H5P_DEFAULT)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Read srcdset[0] */
count[0] = 10;
@@ -6931,12 +7303,12 @@ test_printf(unsigned config, hid_t fapl)
if(config & TEST_IO_DIFFERENT_FILE) {
if((srcfile[0] = H5Fcreate(srcfilenamepct, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
else {
srcfile[0] = vfile;
if(H5Iinc_ref(srcfile[0]) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Create virtual dataset */
if((vdset = H5Dcreate2(vfile, "v_dset", H5T_NATIVE_INT, vspace[0], H5P_DEFAULT, dcpl, dapl)) < 0)
@@ -6948,7 +7320,7 @@ test_printf(unsigned config, hid_t fapl)
if(H5Fclose(srcfile[0]) < 0)
TEST_ERROR
srcfile[0] = -1;
- } /* end if */
+ }
/* Reopen virtual dataset and file if config option specified */
if(config & TEST_IO_REOPEN_VIRT) {
@@ -6962,7 +7334,7 @@ test_printf(unsigned config, hid_t fapl)
TEST_ERROR
if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Get VDS space */
if((filespace = H5Dget_space(vdset)) < 0)
@@ -7100,14 +7472,14 @@ test_printf(unsigned config, hid_t fapl)
if(H5Dclose(srcdset[i]) < 0)
TEST_ERROR
srcdset[i] = -1;
- } /* end for */
+ }
if(config & TEST_IO_DIFFERENT_FILE) {
if(H5Fclose(srcfile[0]) < 0)
TEST_ERROR
srcfile[0] = -1;
- } /* end if */
- } /* end if */
+ }
+ }
/* Reopen virtual dataset and file if config option specified */
if(config & TEST_IO_REOPEN_VIRT) {
@@ -7121,7 +7493,7 @@ test_printf(unsigned config, hid_t fapl)
TEST_ERROR
if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Get VDS space */
if((filespace = H5Dget_space(vdset)) < 0)
@@ -7165,11 +7537,11 @@ test_printf(unsigned config, hid_t fapl)
if(j >= (int)dims[1]) {
if(rbuf[i][j] != 0)
TEST_ERROR
- } /* end if */
+ }
else
if(rbuf[i][j] != erbuf[i][j])
TEST_ERROR
- } /* end for */
+ }
/* Test H5Pget_virtual_printf_gap() */
if(H5Pget_virtual_printf_gap(dapl, &gap_size) < 0)
@@ -7189,7 +7561,7 @@ test_printf(unsigned config, hid_t fapl)
vfile = -1;
if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0)
TEST_ERROR
@@ -7241,11 +7613,11 @@ test_printf(unsigned config, hid_t fapl)
if(j >= (int)dims[1]) {
if(rbuf[i][j] != 0)
TEST_ERROR
- } /* end if */
+ }
else
if(rbuf[i][j] != erbuf[i][j])
TEST_ERROR
- } /* end for */
+ }
/* Close VDS and reopen with printf gap set to 2, reopen file as well if
* config option specified */
@@ -7259,7 +7631,7 @@ test_printf(unsigned config, hid_t fapl)
vfile = -1;
if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0)
TEST_ERROR
@@ -7311,11 +7683,11 @@ test_printf(unsigned config, hid_t fapl)
if(j >= (int)dims[1]) {
if(rbuf[i][j] != 0)
TEST_ERROR
- } /* end if */
+ }
else
if(rbuf[i][j] != erbuf[i][j])
TEST_ERROR
- } /* end for */
+ }
/* Close VDS and reopen with printf gap set to 3, reopen file as well if
* config option specified */
@@ -7329,7 +7701,7 @@ test_printf(unsigned config, hid_t fapl)
vfile = -1;
if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0)
TEST_ERROR
@@ -7381,11 +7753,11 @@ test_printf(unsigned config, hid_t fapl)
if(j >= (int)dims[1]) {
if(rbuf[i][j] != 0)
TEST_ERROR
- } /* end if */
+ }
else
if(rbuf[i][j] != erbuf[i][j])
TEST_ERROR
- } /* end for */
+ }
/* Close VDS and reopen with printf gap set to 4, reopen file as well if
* config option specified */
@@ -7399,7 +7771,7 @@ test_printf(unsigned config, hid_t fapl)
vfile = -1;
if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0)
TEST_ERROR
@@ -7451,11 +7823,11 @@ test_printf(unsigned config, hid_t fapl)
if(j >= (int)dims[1]) {
if(rbuf[i][j] != 0)
TEST_ERROR
- } /* end if */
+ }
else
if(rbuf[i][j] != erbuf[i][j])
TEST_ERROR
- } /* end for */
+ }
/* Close VDS and reopen with view set to H5D_VDS_FIRST_MISSING, reopen file
* as well if config option specified */
@@ -7469,7 +7841,7 @@ test_printf(unsigned config, hid_t fapl)
vfile = -1;
if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0)
TEST_ERROR
@@ -7515,11 +7887,11 @@ test_printf(unsigned config, hid_t fapl)
if(j >= (int)dims[1]) {
if(rbuf[i][j] != 0)
TEST_ERROR
- } /* end if */
+ }
else
if(rbuf[i][j] != erbuf[i][j])
TEST_ERROR
- } /* end for */
+ }
/* Reset dapl */
if(H5Pset_virtual_printf_gap(dapl, (hsize_t)0) < 0)
@@ -7533,16 +7905,16 @@ test_printf(unsigned config, hid_t fapl)
if(H5Dclose(srcdset[i]) < 0)
TEST_ERROR
srcdset[i] = -1;
- } /* end for */
+ }
if(H5Fclose(srcfile[0]) < 0)
TEST_ERROR
srcfile[0] = -1;
- } /* end if */
+ }
else if(!(config & TEST_IO_DIFFERENT_FILE)) {
if(H5Fclose(srcfile[0]) < 0)
TEST_ERROR
srcfile[0] = -1;
- } /* end if */
+ }
if(H5Dclose(vdset) < 0)
TEST_ERROR
vdset = -1;
@@ -7615,7 +7987,7 @@ test_printf(unsigned config, hid_t fapl)
TEST_ERROR
if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Get VDS space */
if((filespace = H5Dget_space(vdset)) < 0)
@@ -7681,7 +8053,7 @@ test_printf(unsigned config, hid_t fapl)
if(H5Fclose(srcfile[1]) < 0)
TEST_ERROR
srcfile[1] = -1;
- } /* end if */
+ }
/* Reopen virtual dataset and file if config option specified */
if(config & TEST_IO_REOPEN_VIRT) {
@@ -7695,7 +8067,7 @@ test_printf(unsigned config, hid_t fapl)
TEST_ERROR
if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Get VDS space */
if((filespace = H5Dget_space(vdset)) < 0)
@@ -7739,11 +8111,11 @@ test_printf(unsigned config, hid_t fapl)
if(j >= (int)dims[1]) {
if(rbuf[i][j] != 0)
TEST_ERROR
- } /* end if */
+ }
else
if(rbuf[i][j] != erbuf[i][j])
TEST_ERROR
- } /* end for */
+ }
/* Reopen srcfile[1] if config option specified */
if(config & TEST_IO_CLOSE_SRC)
@@ -7778,7 +8150,7 @@ test_printf(unsigned config, hid_t fapl)
if(H5Fclose(srcfile[1]) < 0)
TEST_ERROR
srcfile[1] = -1;
- } /* end if */
+ }
/* Reopen virtual dataset and file if config option specified */
if(config & TEST_IO_REOPEN_VIRT) {
@@ -7792,7 +8164,7 @@ test_printf(unsigned config, hid_t fapl)
TEST_ERROR
if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Get VDS space */
if((filespace = H5Dget_space(vdset)) < 0)
@@ -7836,11 +8208,11 @@ test_printf(unsigned config, hid_t fapl)
if(j >= (int)dims[1]) {
if(rbuf[i][j] != 0)
TEST_ERROR
- } /* end if */
+ }
else
if(rbuf[i][j] != erbuf[i][j])
TEST_ERROR
- } /* end for */
+ }
/* Close */
if(!(config & TEST_IO_CLOSE_SRC)) {
@@ -7856,7 +8228,7 @@ test_printf(unsigned config, hid_t fapl)
if(H5Fclose(srcfile[1]) < 0)
TEST_ERROR
srcfile[1] = -1;
- } /* end if */
+ }
if(H5Dclose(vdset) < 0)
TEST_ERROR
vdset = -1;
@@ -7926,7 +8298,7 @@ test_printf(unsigned config, hid_t fapl)
TEST_ERROR
if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Get VDS space */
if((filespace = H5Dget_space(vdset)) < 0)
@@ -7992,7 +8364,7 @@ test_printf(unsigned config, hid_t fapl)
if(H5Fclose(srcfile[1]) < 0)
TEST_ERROR
srcfile[1] = -1;
- } /* end if */
+ }
/* Reopen virtual dataset and file if config option specified */
if(config & TEST_IO_REOPEN_VIRT) {
@@ -8006,7 +8378,7 @@ test_printf(unsigned config, hid_t fapl)
TEST_ERROR
if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Get VDS space */
if((filespace = H5Dget_space(vdset)) < 0)
@@ -8050,11 +8422,11 @@ test_printf(unsigned config, hid_t fapl)
if(j >= (int)dims[1]) {
if(rbuf[i][j] != 0)
TEST_ERROR
- } /* end if */
+ }
else
if(rbuf[i][j] != erbuf[i][j])
TEST_ERROR
- } /* end for */
+ }
/* Reopen srcfile[1] if config option specified */
if(config & TEST_IO_CLOSE_SRC)
@@ -8089,7 +8461,7 @@ test_printf(unsigned config, hid_t fapl)
if(H5Fclose(srcfile[1]) < 0)
TEST_ERROR
srcfile[1] = -1;
- } /* end if */
+ }
/* Reopen virtual dataset and file if config option specified */
if(config & TEST_IO_REOPEN_VIRT) {
@@ -8103,7 +8475,7 @@ test_printf(unsigned config, hid_t fapl)
TEST_ERROR
if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Get VDS space */
if((filespace = H5Dget_space(vdset)) < 0)
@@ -8147,11 +8519,11 @@ test_printf(unsigned config, hid_t fapl)
if(j >= (int)dims[1]) {
if(rbuf[i][j] != 0)
TEST_ERROR
- } /* end if */
+ }
else
if(rbuf[i][j] != erbuf[i][j])
TEST_ERROR
- } /* end for */
+ }
/* Close */
if(!(config & TEST_IO_CLOSE_SRC)) {
@@ -8167,7 +8539,7 @@ test_printf(unsigned config, hid_t fapl)
if(H5Fclose(srcfile[1]) < 0)
TEST_ERROR
srcfile[1] = -1;
- } /* end if */
+ }
if(H5Dclose(vdset) < 0)
TEST_ERROR
vdset = -1;
@@ -8180,7 +8552,7 @@ test_printf(unsigned config, hid_t fapl)
if(H5Sclose(vspace[0]) < 0)
TEST_ERROR
vspace[0] = -1;
- } /* end if */
+ }
/*
@@ -8238,12 +8610,12 @@ test_printf(unsigned config, hid_t fapl)
if(config & TEST_IO_DIFFERENT_FILE) {
if((srcfile[0] = H5Fcreate(srcfilename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
else {
srcfile[0] = vfile;
if(H5Iinc_ref(srcfile[0]) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Create virtual dataset */
if((vdset = H5Dcreate2(vfile, "v_dset", H5T_NATIVE_INT, vspace[0], H5P_DEFAULT, dcpl, dapl)) < 0)
@@ -8255,7 +8627,7 @@ test_printf(unsigned config, hid_t fapl)
if(H5Fclose(srcfile[0]) < 0)
TEST_ERROR
srcfile[0] = -1;
- } /* end if */
+ }
/* Reopen virtual dataset and file if config option specified */
if(config & TEST_IO_REOPEN_VIRT) {
@@ -8269,7 +8641,7 @@ test_printf(unsigned config, hid_t fapl)
TEST_ERROR
if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Get VDS space */
if((filespace = H5Dget_space(vdset)) < 0)
@@ -8355,8 +8727,8 @@ test_printf(unsigned config, hid_t fapl)
if(H5Fclose(srcfile[0]) < 0)
TEST_ERROR
srcfile[0] = -1;
- } /* end if */
- } /* end if */
+ }
+ }
/* Reopen virtual dataset and file if config option specified */
if(config & TEST_IO_REOPEN_VIRT) {
@@ -8370,7 +8742,7 @@ test_printf(unsigned config, hid_t fapl)
TEST_ERROR
if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Get VDS space */
if((filespace = H5Dget_space(vdset)) < 0)
@@ -8414,11 +8786,11 @@ test_printf(unsigned config, hid_t fapl)
if(j >= (int)dims[1]) {
if(rbuf[i][j] != 0)
TEST_ERROR
- } /* end if */
+ }
else
if(rbuf[i][j] != erbuf[i][j])
TEST_ERROR
- } /* end for */
+ }
/* Reopen srcfile if config option specified */
if((config & TEST_IO_CLOSE_SRC) && (config & TEST_IO_DIFFERENT_FILE))
@@ -8454,8 +8826,8 @@ test_printf(unsigned config, hid_t fapl)
if(H5Fclose(srcfile[0]) < 0)
TEST_ERROR
srcfile[0] = -1;
- } /* end if */
- } /* end if */
+ }
+ }
/* Reopen virtual dataset and file if config option specified */
if(config & TEST_IO_REOPEN_VIRT) {
@@ -8469,7 +8841,7 @@ test_printf(unsigned config, hid_t fapl)
TEST_ERROR
if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Get VDS space */
if((filespace = H5Dget_space(vdset)) < 0)
@@ -8513,11 +8885,11 @@ test_printf(unsigned config, hid_t fapl)
if(j >= (int)dims[1]) {
if(rbuf[i][j] != 0)
TEST_ERROR
- } /* end if */
+ }
else
if(rbuf[i][j] != erbuf[i][j])
TEST_ERROR
- } /* end for */
+ }
/* Close VDS and reopen with view set to H5D_VDS_FIRST_MISSING, reopen file
* as well if config option specified */
@@ -8531,7 +8903,7 @@ test_printf(unsigned config, hid_t fapl)
vfile = -1;
if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0)
TEST_ERROR
@@ -8578,11 +8950,11 @@ test_printf(unsigned config, hid_t fapl)
if(j >= (int)dims[1]) {
if(rbuf[i][j] != 0)
TEST_ERROR
- } /* end if */
+ }
else
if(rbuf[i][j] != erbuf[i][j])
TEST_ERROR
- } /* end for */
+ }
/* Reopen srcfile if config option specified */
if((config & TEST_IO_CLOSE_SRC) && (config & TEST_IO_DIFFERENT_FILE))
@@ -8618,8 +8990,8 @@ test_printf(unsigned config, hid_t fapl)
if(H5Fclose(srcfile[0]) < 0)
TEST_ERROR
srcfile[0] = -1;
- } /* end if */
- } /* end if */
+ }
+ }
/* Reopen virtual dataset and file if config option specified */
if(config & TEST_IO_REOPEN_VIRT) {
@@ -8633,7 +9005,7 @@ test_printf(unsigned config, hid_t fapl)
TEST_ERROR
if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Get VDS space */
if((filespace = H5Dget_space(vdset)) < 0)
@@ -8677,11 +9049,11 @@ test_printf(unsigned config, hid_t fapl)
if(j >= (int)dims[1]) {
if(rbuf[i][j] != 0)
TEST_ERROR
- } /* end if */
+ }
else
if(rbuf[i][j] != erbuf[i][j])
TEST_ERROR
- } /* end for */
+ }
/* Close VDS and reopen with view set to H5D_VDS_LAST_AVAILABLE, reopen file
* as well if config option specified */
@@ -8695,7 +9067,7 @@ test_printf(unsigned config, hid_t fapl)
vfile = -1;
if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0)
TEST_ERROR
@@ -8742,11 +9114,11 @@ test_printf(unsigned config, hid_t fapl)
if(j >= (int)dims[1]) {
if(rbuf[i][j] != 0)
TEST_ERROR
- } /* end if */
+ }
else
if(rbuf[i][j] != erbuf[i][j])
TEST_ERROR
- } /* end for */
+ }
/* Close VDS and reopen with printf_gap set to 1, reopen file as well if
* config option specified */
@@ -8760,7 +9132,7 @@ test_printf(unsigned config, hid_t fapl)
vfile = -1;
if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0)
TEST_ERROR
@@ -8807,11 +9179,11 @@ test_printf(unsigned config, hid_t fapl)
if(j >= (int)dims[1]) {
if(rbuf[i][j] != 0)
TEST_ERROR
- } /* end if */
+ }
else
if(rbuf[i][j] != erbuf[i][j])
TEST_ERROR
- } /* end for */
+ }
/* Reset dapl */
if(H5Pset_virtual_printf_gap(dapl, (hsize_t)0) < 0)
@@ -8825,16 +9197,16 @@ test_printf(unsigned config, hid_t fapl)
if(H5Dclose(srcdset[i]) < 0)
TEST_ERROR
srcdset[i] = -1;
- } /* end for */
+ }
if(H5Fclose(srcfile[0]) < 0)
TEST_ERROR
srcfile[0] = -1;
- } /* end if */
+ }
else if(!(config & TEST_IO_DIFFERENT_FILE)) {
if(H5Fclose(srcfile[0]) < 0)
TEST_ERROR
srcfile[0] = -1;
- } /* end if */
+ }
if(H5Dclose(vdset) < 0)
TEST_ERROR
vdset = -1;
@@ -8910,12 +9282,12 @@ test_printf(unsigned config, hid_t fapl)
if(config & TEST_IO_DIFFERENT_FILE) {
if((srcfile[0] = H5Fcreate(srcfilename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
else {
srcfile[0] = vfile;
if(H5Iinc_ref(srcfile[0]) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Create virtual dataset */
if((vdset = H5Dcreate2(vfile, "v_dset", H5T_NATIVE_INT, vspace[0], H5P_DEFAULT, dcpl, dapl)) < 0)
@@ -8927,7 +9299,7 @@ test_printf(unsigned config, hid_t fapl)
if(H5Fclose(srcfile[0]) < 0)
TEST_ERROR
srcfile[0] = -1;
- } /* end if */
+ }
/* Reopen virtual dataset and file if config option specified */
if(config & TEST_IO_REOPEN_VIRT) {
@@ -8941,7 +9313,7 @@ test_printf(unsigned config, hid_t fapl)
TEST_ERROR
if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Get VDS space */
if((filespace = H5Dget_space(vdset)) < 0)
@@ -9037,8 +9409,8 @@ test_printf(unsigned config, hid_t fapl)
if(H5Fclose(srcfile[0]) < 0)
TEST_ERROR
srcfile[0] = -1;
- } /* end if */
- } /* end if */
+ }
+ }
/* Reopen virtual dataset and file if config option specified */
if(config & TEST_IO_REOPEN_VIRT) {
@@ -9052,7 +9424,7 @@ test_printf(unsigned config, hid_t fapl)
TEST_ERROR
if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Get VDS space */
if((filespace = H5Dget_space(vdset)) < 0)
@@ -9096,11 +9468,11 @@ test_printf(unsigned config, hid_t fapl)
if(j >= (int)dims[1]) {
if(rbuf[i][j] != 0)
TEST_ERROR
- } /* end if */
+ }
else
if(rbuf[i][j] != erbuf[i][j])
TEST_ERROR
- } /* end for */
+ }
/* Close VDS and reopen with view set to H5D_VDS_FIRST_MISSING, reopen file
* as well if config option specified */
@@ -9114,7 +9486,7 @@ test_printf(unsigned config, hid_t fapl)
vfile = -1;
if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0)
TEST_ERROR
@@ -9161,11 +9533,11 @@ test_printf(unsigned config, hid_t fapl)
if(j >= (int)dims[1]) {
if(rbuf[i][j] != 0)
TEST_ERROR
- } /* end if */
+ }
else
if(rbuf[i][j] != erbuf[i][j])
TEST_ERROR
- } /* end for */
+ }
/* Reopen srcfile if config option specified */
if((config & TEST_IO_CLOSE_SRC) && (config & TEST_IO_DIFFERENT_FILE))
@@ -9205,8 +9577,8 @@ test_printf(unsigned config, hid_t fapl)
if(H5Fclose(srcfile[0]) < 0)
TEST_ERROR
srcfile[0] = -1;
- } /* end if */
- } /* end if */
+ }
+ }
/* Reopen virtual dataset and file if config option specified */
if(config & TEST_IO_REOPEN_VIRT) {
@@ -9220,7 +9592,7 @@ test_printf(unsigned config, hid_t fapl)
TEST_ERROR
if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Get VDS space */
if((filespace = H5Dget_space(vdset)) < 0)
@@ -9264,11 +9636,11 @@ test_printf(unsigned config, hid_t fapl)
if(j >= (int)dims[1]) {
if(rbuf[i][j] != 0)
TEST_ERROR
- } /* end if */
+ }
else
if(rbuf[i][j] != erbuf[i][j])
TEST_ERROR
- } /* end for */
+ }
/* Close VDS and reopen with view set to H5D_VDS_LAST_AVAILABLE, reopen file
* as well if config option specified */
@@ -9282,7 +9654,7 @@ test_printf(unsigned config, hid_t fapl)
vfile = -1;
if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0)
TEST_ERROR
@@ -9328,11 +9700,11 @@ test_printf(unsigned config, hid_t fapl)
if(j >= (int)dims[1]) {
if(rbuf[i][j] != 0)
TEST_ERROR
- } /* end if */
+ }
else
if(rbuf[i][j] != erbuf[i][j])
TEST_ERROR
- } /* end for */
+ }
/* Reopen srcfile if config option specified */
if((config & TEST_IO_CLOSE_SRC) && (config & TEST_IO_DIFFERENT_FILE))
@@ -9369,8 +9741,8 @@ test_printf(unsigned config, hid_t fapl)
if(H5Fclose(srcfile[0]) < 0)
TEST_ERROR
srcfile[0] = -1;
- } /* end if */
- } /* end if */
+ }
+ }
/* Reopen virtual dataset and file if config option specified */
if(config & TEST_IO_REOPEN_VIRT) {
@@ -9384,7 +9756,7 @@ test_printf(unsigned config, hid_t fapl)
TEST_ERROR
if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Get VDS space */
if((filespace = H5Dget_space(vdset)) < 0)
@@ -9428,11 +9800,11 @@ test_printf(unsigned config, hid_t fapl)
if(j >= (int)dims[1]) {
if(rbuf[i][j] != 0)
TEST_ERROR
- } /* end if */
+ }
else
if(rbuf[i][j] != erbuf[i][j])
TEST_ERROR
- } /* end for */
+ }
/* Now test reopening virtual dataset without calling H5Dget_space, if
* REOPEN_VIRT flag set */
@@ -9466,11 +9838,11 @@ test_printf(unsigned config, hid_t fapl)
if(j >= (int)dims[1]) {
if(rbuf[i][j] != 0)
TEST_ERROR
- } /* end if */
+ }
else
if(rbuf[i][j] != erbuf[i][j])
TEST_ERROR
- } /* end for */
+ }
/* Now try setting extent manually */
/* Shrink to 12 */
@@ -9496,11 +9868,11 @@ test_printf(unsigned config, hid_t fapl)
if(j >= (int)dims[1]) {
if(rbuf[i][j] != 0)
TEST_ERROR
- } /* end if */
+ }
else
if(rbuf[i][j] != erbuf[i][j])
TEST_ERROR
- } /* end for */
+ }
/* Shrink to 10 */
dims[1] = 12;
@@ -9525,12 +9897,12 @@ test_printf(unsigned config, hid_t fapl)
if(j >= (int)dims[1]) {
if(rbuf[i][j] != 0)
TEST_ERROR
- } /* end if */
+ }
else
if(rbuf[i][j] != erbuf[i][j])
TEST_ERROR
- } /* end for */
- } /* end if */
+ }
+ }
/* Close VDS and reopen with view set to H5D_VDS_FIRST_MISSING, reopen file
* as well if config option specified */
@@ -9544,7 +9916,7 @@ test_printf(unsigned config, hid_t fapl)
vfile = -1;
if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0)
TEST_ERROR
@@ -9590,11 +9962,11 @@ test_printf(unsigned config, hid_t fapl)
if(j >= (int)dims[1]) {
if(rbuf[i][j] != 0)
TEST_ERROR
- } /* end if */
+ }
else
if(rbuf[i][j] != erbuf[i][j])
TEST_ERROR
- } /* end for */
+ }
/* Now test reopening virtual dataset without calling H5Dget_space, if
* REOPEN_VIRT flag set */
@@ -9628,11 +10000,11 @@ test_printf(unsigned config, hid_t fapl)
if(j >= (int)dims[1]) {
if(rbuf[i][j] != 0)
TEST_ERROR
- } /* end if */
+ }
else
if(rbuf[i][j] != erbuf[i][j])
TEST_ERROR
- } /* end for */
+ }
/* Now try setting extent manually */
/* Grow to 12 */
@@ -9658,11 +10030,11 @@ test_printf(unsigned config, hid_t fapl)
if(j >= (int)dims[1]) {
if(rbuf[i][j] != 0)
TEST_ERROR
- } /* end if */
+ }
else
if(rbuf[i][j] != erbuf[i][j])
TEST_ERROR
- } /* end for */
+ }
/* Grow to 15 */
dims[1] = 15;
@@ -9687,12 +10059,12 @@ test_printf(unsigned config, hid_t fapl)
if(j >= (int)dims[1]) {
if(rbuf[i][j] != 0)
TEST_ERROR
- } /* end if */
+ }
else
if(rbuf[i][j] != erbuf[i][j])
TEST_ERROR
- } /* end for */
- } /* end if */
+ }
+ }
/* Reset dapl */
if(H5Pset_virtual_view(dapl, H5D_VDS_LAST_AVAILABLE) < 0)
@@ -9704,16 +10076,16 @@ test_printf(unsigned config, hid_t fapl)
if(H5Dclose(srcdset[i]) < 0)
TEST_ERROR
srcdset[i] = -1;
- } /* end for */
+ }
if(H5Fclose(srcfile[0]) < 0)
TEST_ERROR
srcfile[0] = -1;
- } /* end if */
+ }
else if(!(config & TEST_IO_DIFFERENT_FILE)) {
if(H5Fclose(srcfile[0]) < 0)
TEST_ERROR
srcfile[0] = -1;
- } /* end if */
+ }
if(H5Dclose(vdset) < 0)
TEST_ERROR
vdset = -1;
@@ -9770,12 +10142,12 @@ test_printf(unsigned config, hid_t fapl)
if(config & TEST_IO_DIFFERENT_FILE) {
if((srcfile[0] = H5Fcreate(srcfilenamepct, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
else {
srcfile[0] = vfile;
if(H5Iinc_ref(srcfile[0]) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Create virtual dataset */
if((vdset = H5Dcreate2(vfile, "v_dset", H5T_NATIVE_INT, vspace[0], H5P_DEFAULT, dcpl, dapl)) < 0)
@@ -9787,7 +10159,7 @@ test_printf(unsigned config, hid_t fapl)
if(H5Fclose(srcfile[0]) < 0)
TEST_ERROR
srcfile[0] = -1;
- } /* end if */
+ }
/* Reopen virtual dataset and file if config option specified */
if(config & TEST_IO_REOPEN_VIRT) {
@@ -9801,7 +10173,7 @@ test_printf(unsigned config, hid_t fapl)
TEST_ERROR
if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Get VDS space */
if((filespace = H5Dget_space(vdset)) < 0)
@@ -9867,8 +10239,8 @@ test_printf(unsigned config, hid_t fapl)
if(H5Fclose(srcfile[0]) < 0)
TEST_ERROR
srcfile[0] = -1;
- } /* end if */
- } /* end if */
+ }
+ }
/* Reopen virtual dataset and file if config option specified */
if(config & TEST_IO_REOPEN_VIRT) {
@@ -9882,7 +10254,7 @@ test_printf(unsigned config, hid_t fapl)
TEST_ERROR
if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Get VDS space */
if((filespace = H5Dget_space(vdset)) < 0)
@@ -9926,11 +10298,11 @@ test_printf(unsigned config, hid_t fapl)
if(j >= (int)dims[1]) {
if(rbuf[i][j] != 0)
TEST_ERROR
- } /* end if */
+ }
else
if(rbuf[i][j] != erbuf[i][j])
TEST_ERROR
- } /* end for */
+ }
/* Close VDS and reopen with printf gap set to 127, reopen file as well if
* config option specified */
@@ -9944,7 +10316,7 @@ test_printf(unsigned config, hid_t fapl)
vfile = -1;
if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0)
TEST_ERROR
@@ -9990,11 +10362,11 @@ test_printf(unsigned config, hid_t fapl)
if(j >= (int)dims[1]) {
if(rbuf[i][j] != 0)
TEST_ERROR
- } /* end if */
+ }
else
if(rbuf[i][j] != erbuf[i][j])
TEST_ERROR
- } /* end for */
+ }
/* Reset dapl */
if(H5Pset_virtual_printf_gap(dapl, (hsize_t)0) < 0)
@@ -10008,12 +10380,12 @@ test_printf(unsigned config, hid_t fapl)
if(H5Fclose(srcfile[0]) < 0)
TEST_ERROR
srcfile[0] = -1;
- } /* end if */
+ }
else if(!(config & TEST_IO_DIFFERENT_FILE)) {
if(H5Fclose(srcfile[0]) < 0)
TEST_ERROR
srcfile[0] = -1;
- } /* end if */
+ }
if(H5Dclose(vdset) < 0)
TEST_ERROR
vdset = -1;
@@ -10044,32 +10416,19 @@ test_printf(unsigned config, hid_t fapl)
error:
H5E_BEGIN_TRY {
- for(i = 0; i < (int)(sizeof(srcdset) / sizeof(srcdset[0])); i++) {
- if(srcdset[i] >= 0)
- (void)H5Dclose(srcdset[i]);
- } /* end for */
- if(vdset >= 0)
- (void)H5Dclose(vdset);
- for(i = 0; i < (int)(sizeof(srcfile) / sizeof(srcfile[0])); i++) {
- if(srcfile[i] >= 0)
- (void)H5Fclose(srcfile[i]);
- } /* end for */
- if(vfile >= 0)
- (void)H5Fclose(vfile);
- if(srcspace >= 0)
- (void)H5Sclose(srcspace);
- for(i = 0; i < (int)(sizeof(vspace) / sizeof(vspace[0])); i++) {
- if(vspace[i] >= 0)
- (void)H5Sclose(vspace[i]);
- } /* end for */
- if(filespace >= 0)
- (void)H5Sclose(filespace);
- if(memspace >= 0)
- (void)H5Sclose(memspace);
- if(dcpl >= 0)
- (void)H5Pclose(dcpl);
- if(dapl >= 0)
- (void)H5Pclose(dapl);
+ for(i = 0; i < (int)(sizeof(srcdset) / sizeof(srcdset[0])); i++)
+ H5Dclose(srcdset[i]);
+ H5Dclose(vdset);
+ for(i = 0; i < (int)(sizeof(srcfile) / sizeof(srcfile[0])); i++)
+ H5Fclose(srcfile[i]);
+ H5Fclose(vfile);
+ H5Sclose(srcspace);
+ for(i = 0; i < (int)(sizeof(vspace) / sizeof(vspace[0])); i++)
+ H5Sclose(vspace[i]);
+ H5Sclose(filespace);
+ H5Sclose(memspace);
+ H5Pclose(dcpl);
+ H5Pclose(dapl);
} H5E_END_TRY;
return 1;
@@ -10083,14 +10442,7 @@ error:
* VDS
*
* Return: Success: 0
- *
* Failure: number of errors
- *
- * Programmer: Neil Fortner
- * Friday, August 14, 2015
- *
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static int
@@ -10212,12 +10564,12 @@ test_all(unsigned config, hid_t fapl)
if(config & TEST_IO_DIFFERENT_FILE) {
if((srcfile = H5Fcreate(srcfilename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
else {
srcfile = vfile;
if(H5Iinc_ref(srcfile) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Create virtual dataset */
if((vdset = H5Dcreate2(vfile, "v_dset", H5T_NATIVE_INT, vspace[0], H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0)
@@ -10229,7 +10581,7 @@ test_all(unsigned config, hid_t fapl)
if(H5Fclose(srcfile) < 0)
TEST_ERROR
srcfile = -1;
- } /* end if */
+ }
/* Reopen virtual dataset and file if config option specified */
if(config & TEST_IO_REOPEN_VIRT) {
@@ -10243,7 +10595,7 @@ test_all(unsigned config, hid_t fapl)
TEST_ERROR
if((vdset = H5Dopen2(vfile, "v_dset", H5P_DEFAULT)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Get VDS space */
if((filespace = H5Dget_space(vdset)) < 0)
@@ -10314,14 +10666,14 @@ test_all(unsigned config, hid_t fapl)
if(H5Dclose(srcdset[i]) < 0)
TEST_ERROR
srcdset[i] = -1;
- } /* end for */
+ }
if(config & TEST_IO_DIFFERENT_FILE) {
if(H5Fclose(srcfile) < 0)
TEST_ERROR
srcfile = -1;
- } /* end if */
- } /* end if */
+ }
+ }
/* Reopen virtual dataset and file if config option specified */
if(config & TEST_IO_REOPEN_VIRT) {
@@ -10335,7 +10687,7 @@ test_all(unsigned config, hid_t fapl)
TEST_ERROR
if((vdset = H5Dopen2(vfile, "v_dset", H5P_DEFAULT)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Get VDS space */
if((filespace = H5Dget_space(vdset)) < 0)
@@ -10381,11 +10733,11 @@ test_all(unsigned config, hid_t fapl)
if((i >= (int)dims[0]) || (j >= (int)dims[1])) {
if(rbuf[i][j] != 0)
TEST_ERROR
- } /* end if */
+ }
else
if(rbuf[i][j] != erbuf[i][j])
TEST_ERROR
- } /* end for */
+ }
/* Reopen srcdset[1] and srcfile if config option specified */
if(config & TEST_IO_CLOSE_SRC) {
@@ -10394,7 +10746,7 @@ test_all(unsigned config, hid_t fapl)
TEST_ERROR
if((srcdset[1] = H5Dopen2(srcfile, "src_dset_unlim", H5P_DEFAULT)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Extend srcdset[1] */
dims[0] = 2;
@@ -10429,8 +10781,8 @@ test_all(unsigned config, hid_t fapl)
if(H5Fclose(srcfile) < 0)
TEST_ERROR
srcfile = -1;
- } /* end if */
- } /* end if */
+ }
+ }
/* Reopen virtual dataset and file if config option specified */
if(config & TEST_IO_REOPEN_VIRT) {
@@ -10444,7 +10796,7 @@ test_all(unsigned config, hid_t fapl)
TEST_ERROR
if((vdset = H5Dopen2(vfile, "v_dset", H5P_DEFAULT)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Get VDS space */
if((filespace = H5Dget_space(vdset)) < 0)
@@ -10490,11 +10842,11 @@ test_all(unsigned config, hid_t fapl)
if((i >= (int)dims[0]) || (j >= (int)dims[1])) {
if(rbuf[i][j] != 0)
TEST_ERROR
- } /* end if */
+ }
else
if(rbuf[i][j] != erbuf[i][j])
TEST_ERROR
- } /* end for */
+ }
/* Reopen srcfile if config option specified */
if((config & TEST_IO_CLOSE_SRC) && (config & TEST_IO_DIFFERENT_FILE))
@@ -10534,8 +10886,8 @@ test_all(unsigned config, hid_t fapl)
if(H5Fclose(srcfile) < 0)
TEST_ERROR
srcfile = -1;
- } /* end if */
- } /* end if */
+ }
+ }
/* Reopen virtual dataset and file if config option specified */
if(config & TEST_IO_REOPEN_VIRT) {
@@ -10549,7 +10901,7 @@ test_all(unsigned config, hid_t fapl)
TEST_ERROR
if((vdset = H5Dopen2(vfile, "v_dset", H5P_DEFAULT)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Get VDS space */
if((filespace = H5Dget_space(vdset)) < 0)
@@ -10595,11 +10947,11 @@ test_all(unsigned config, hid_t fapl)
if((i >= (int)dims[0]) || (j >= (int)dims[1])) {
if(rbuf[i][j] != 0)
TEST_ERROR
- } /* end if */
+ }
else
if(rbuf[i][j] != erbuf[i][j])
TEST_ERROR
- } /* end for */
+ }
/* Reopen srcdset[1] and srcfile if config option specified */
if(config & TEST_IO_CLOSE_SRC) {
@@ -10608,7 +10960,7 @@ test_all(unsigned config, hid_t fapl)
TEST_ERROR
if((srcdset[1] = H5Dopen2(srcfile, "src_dset_unlim", H5P_DEFAULT)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Extend srcdset[1] */
dims[0] = 3;
@@ -10652,8 +11004,8 @@ test_all(unsigned config, hid_t fapl)
if(H5Fclose(srcfile) < 0)
TEST_ERROR
srcfile = -1;
- } /* end if */
- } /* end if */
+ }
+ }
/* Reopen virtual dataset and file if config option specified */
if(config & TEST_IO_REOPEN_VIRT) {
@@ -10667,7 +11019,7 @@ test_all(unsigned config, hid_t fapl)
TEST_ERROR
if((vdset = H5Dopen2(vfile, "v_dset", H5P_DEFAULT)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Get VDS space */
if((filespace = H5Dget_space(vdset)) < 0)
@@ -10713,11 +11065,11 @@ test_all(unsigned config, hid_t fapl)
if((i >= (int)dims[0]) || (j >= (int)dims[1])) {
if(rbuf[i][j] != 0)
TEST_ERROR
- } /* end if */
+ }
else
if(rbuf[i][j] != erbuf[i][j])
TEST_ERROR
- } /* end for */
+ }
/* Reopen srcfile if config option specified */
if((config & TEST_IO_CLOSE_SRC) && (config & TEST_IO_DIFFERENT_FILE))
@@ -10757,8 +11109,8 @@ test_all(unsigned config, hid_t fapl)
if(H5Fclose(srcfile) < 0)
TEST_ERROR
srcfile = -1;
- } /* end if */
- } /* end if */
+ }
+ }
/* Reopen virtual dataset and file if config option specified */
if(config & TEST_IO_REOPEN_VIRT) {
@@ -10772,7 +11124,7 @@ test_all(unsigned config, hid_t fapl)
TEST_ERROR
if((vdset = H5Dopen2(vfile, "v_dset", H5P_DEFAULT)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Get VDS space */
if((filespace = H5Dget_space(vdset)) < 0)
@@ -10818,11 +11170,11 @@ test_all(unsigned config, hid_t fapl)
if((i >= (int)dims[0]) || (j >= (int)dims[1])) {
if(rbuf[i][j] != 0)
TEST_ERROR
- } /* end if */
+ }
else
if(rbuf[i][j] != erbuf[i][j])
TEST_ERROR
- } /* end for */
+ }
/* Reopen srcdset[1] and srcfile if config option specified */
if(config & TEST_IO_CLOSE_SRC) {
@@ -10831,7 +11183,7 @@ test_all(unsigned config, hid_t fapl)
TEST_ERROR
if((srcdset[1] = H5Dopen2(srcfile, "src_dset_unlim", H5P_DEFAULT)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Extend srcdset[1] */
dims[0] = 7;
@@ -10876,8 +11228,8 @@ test_all(unsigned config, hid_t fapl)
if(H5Fclose(srcfile) < 0)
TEST_ERROR
srcfile = -1;
- } /* end if */
- } /* end if */
+ }
+ }
/* Reopen virtual dataset and file if config option specified */
if(config & TEST_IO_REOPEN_VIRT) {
@@ -10891,7 +11243,7 @@ test_all(unsigned config, hid_t fapl)
TEST_ERROR
if((vdset = H5Dopen2(vfile, "v_dset", H5P_DEFAULT)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Get VDS space */
if((filespace = H5Dget_space(vdset)) < 0)
@@ -10937,11 +11289,11 @@ test_all(unsigned config, hid_t fapl)
if(j >= (int)dims[1]) {
if(rbuf[i][j] != 0)
TEST_ERROR
- } /* end if */
+ }
else
if(rbuf[i][j] != erbuf[i][j])
TEST_ERROR
- } /* end for */
+ }
/* Reopen srcfile if config option specified */
if((config & TEST_IO_CLOSE_SRC) && (config & TEST_IO_DIFFERENT_FILE))
@@ -10981,8 +11333,8 @@ test_all(unsigned config, hid_t fapl)
if(H5Fclose(srcfile) < 0)
TEST_ERROR
srcfile = -1;
- } /* end if */
- } /* end if */
+ }
+ }
/* Reopen virtual dataset and file if config option specified */
if(config & TEST_IO_REOPEN_VIRT) {
@@ -10996,7 +11348,7 @@ test_all(unsigned config, hid_t fapl)
TEST_ERROR
if((vdset = H5Dopen2(vfile, "v_dset", H5P_DEFAULT)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Get VDS space */
if((filespace = H5Dget_space(vdset)) < 0)
@@ -11048,16 +11400,16 @@ test_all(unsigned config, hid_t fapl)
if(H5Dclose(srcdset[i]) < 0)
TEST_ERROR
srcdset[i] = -1;
- } /* end for */
+ }
if(H5Fclose(srcfile) < 0)
TEST_ERROR
srcfile = -1;
- } /* end if */
+ }
else if(!(config & TEST_IO_DIFFERENT_FILE)) {
if(H5Fclose(srcfile) < 0)
TEST_ERROR
srcfile = -1;
- } /* end if */
+ }
if(H5Dclose(vdset) < 0)
TEST_ERROR
vdset = -1;
@@ -11068,12 +11420,12 @@ test_all(unsigned config, hid_t fapl)
if(H5Sclose(srcspace[i]) < 0)
TEST_ERROR
srcspace[i] = -1;
- } /* end for */
+ }
for(i = 0; i < (int)(sizeof(vspace) / sizeof(vspace[0])); i++) {
if(H5Sclose(vspace[i]) < 0)
TEST_ERROR
vspace[i] = -1;
- } /* end for */
+ }
if(H5Pclose(dcpl) < 0)
TEST_ERROR
dcpl = -1;
@@ -11089,32 +11441,19 @@ test_all(unsigned config, hid_t fapl)
error:
H5E_BEGIN_TRY {
- for(i = 0; i < (int)(sizeof(srcdset) / sizeof(srcdset[0])); i++) {
- if(srcdset[i] >= 0)
- (void)H5Dclose(srcdset[i]);
- } /* end for */
- if(vdset >= 0)
- (void)H5Dclose(vdset);
- if(srcfile >= 0)
- (void)H5Fclose(srcfile);
- if(vfile >= 0)
- (void)H5Fclose(vfile);
- for(i = 0; i < (int)(sizeof(srcspace) / sizeof(srcspace[0])); i++) {
- if(srcspace[i] >= 0)
- (void)H5Sclose(srcspace[i]);
- } /* end for */
- for(i = 0; i < (int)(sizeof(vspace) / sizeof(vspace[0])); i++) {
- if(vspace[i] >= 0)
- (void)H5Sclose(vspace[i]);
- } /* end for */
- if(filespace >= 0)
- (void)H5Sclose(filespace);
- if(memspace >= 0)
- (void)H5Sclose(memspace);
- if(dcpl >= 0)
- (void)H5Pclose(dcpl);
- if(srcdcpl >= 0)
- (void)H5Pclose(srcdcpl);
+ for(i = 0; i < (int)(sizeof(srcdset) / sizeof(srcdset[0])); i++)
+ H5Dclose(srcdset[i]);
+ H5Dclose(vdset);
+ H5Fclose(srcfile);
+ H5Fclose(vfile);
+ for(i = 0; i < (int)(sizeof(srcspace) / sizeof(srcspace[0])); i++)
+ H5Sclose(srcspace[i]);
+ for(i = 0; i < (int)(sizeof(vspace) / sizeof(vspace[0])); i++)
+ H5Sclose(vspace[i]);
+ H5Sclose(filespace);
+ H5Sclose(memspace);
+ H5Pclose(dcpl);
+ H5Pclose(srcdcpl);
} H5E_END_TRY;
return 1;
@@ -11128,10 +11467,6 @@ error:
*
* Return: Success: 0
* Failure: 1
- *
- * Programmer: Dana Robinson
- * March 2016
- *
*-------------------------------------------------------------------------
*/
static int
@@ -11273,10 +11608,6 @@ test_dapl_values(hid_t fapl_id)
* Purpose: Tests datasets with virtual layout
*
* Return: EXIT_SUCCESS/EXIT_FAILURE
- *
- * Programmer: Neil Fortner
- * Tuesday, February 17, 2015
- *
*-------------------------------------------------------------------------
*/
int
@@ -11299,10 +11630,11 @@ main(void)
for(bit_config = 0; bit_config < TEST_IO_NTESTS; bit_config++) {
printf("Config: %s%s%s\n", bit_config & TEST_IO_CLOSE_SRC ? "closed source dataset, " : "", bit_config & TEST_IO_DIFFERENT_FILE ? "different source file" : "same source file", bit_config & TEST_IO_REOPEN_VIRT ? ", reopen virtual file" : "");
nerrors += test_basic_io(bit_config, fapl);
+ nerrors += test_vds_prefix(bit_config, fapl);
nerrors += test_unlim(bit_config, fapl);
nerrors += test_printf(bit_config, fapl);
nerrors += test_all(bit_config, fapl);
- } /* end for */
+ }
nerrors += test_dapl_values(fapl);
diff --git a/testpar/CMakeLists.txt b/testpar/CMakeLists.txt
index b116d66..997d1a1 100644
--- a/testpar/CMakeLists.txt
+++ b/testpar/CMakeLists.txt
@@ -30,14 +30,20 @@ set (testphdf5_SOURCES
add_executable (testphdf5 ${testphdf5_SOURCES})
TARGET_NAMING (testphdf5 STATIC)
TARGET_C_PROPERTIES (testphdf5 STATIC " " " ")
-target_link_libraries (testphdf5 ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET})
+target_link_libraries (testphdf5 ${HDF5_TEST_LIB_TARGET} PUBLIC ${HDF5_LIB_TARGET})
+if (HDF5_ENABLE_PARALLEL AND MPI_C_FOUND)
+ target_link_libraries (testphdf5 PRIVATE ${MPI_C_LIBRARIES})
+endif ()
set_target_properties (testphdf5 PROPERTIES FOLDER test/par)
MACRO (ADD_H5P_EXE file)
add_executable (${file} ${HDF5_TEST_PAR_SOURCE_DIR}/${file}.c)
TARGET_NAMING (${file} STATIC)
TARGET_C_PROPERTIES (${file} STATIC " " " ")
- target_link_libraries (${file} ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET})
+ target_link_libraries (${file} ${HDF5_TEST_LIB_TARGET} PUBLIC ${HDF5_LIB_TARGET})
+ if (HDF5_ENABLE_PARALLEL AND MPI_C_FOUND)
+ target_link_libraries (${file} PRIVATE ${MPI_C_LIBRARIES})
+ endif ()
set_target_properties (${file} PROPERTIES FOLDER test/par)
ENDMACRO (ADD_H5P_EXE file)
diff --git a/tools/lib/CMakeLists.txt b/tools/lib/CMakeLists.txt
index ade7671..0fc1981 100644
--- a/tools/lib/CMakeLists.txt
+++ b/tools/lib/CMakeLists.txt
@@ -39,7 +39,10 @@ set (H5_TOOLS_LIB_HDRS
add_library (${HDF5_TOOLS_LIB_TARGET} STATIC ${H5_TOOLS_LIB_SOURCES} ${H5_TOOLS_LIB_HDRS})
TARGET_C_PROPERTIES (${HDF5_TOOLS_LIB_TARGET} STATIC " " " ")
-target_link_libraries (${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET})
+target_link_libraries (${HDF5_TOOLS_LIB_TARGET} PUBLIC ${HDF5_LIB_TARGET})
+if (HDF5_ENABLE_PARALLEL AND MPI_C_FOUND)
+ target_link_libraries (${HDF5_TOOLS_LIB_TARGET} PRIVATE ${MPI_C_LIBRARIES})
+endif ()
set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_TOOLS_LIB_TARGET}")
H5_SET_LIB_OPTIONS (${HDF5_TOOLS_LIB_TARGET} ${HDF5_TOOLS_LIB_NAME} STATIC)
set_target_properties (${HDF5_TOOLS_LIB_TARGET} PROPERTIES
@@ -52,7 +55,10 @@ set (install_targets ${HDF5_TOOLS_LIB_TARGET})
if (BUILD_SHARED_LIBS)
add_library (${HDF5_TOOLS_LIBSH_TARGET} SHARED ${H5_TOOLS_LIB_SOURCES} ${H5_TOOLS_LIB_HDRS})
TARGET_C_PROPERTIES (${HDF5_TOOLS_LIBSH_TARGET} SHARED " " " ")
- target_link_libraries (${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_LIBSH_TARGET})
+ target_link_libraries (${HDF5_TOOLS_LIBSH_TARGET} PUBLIC ${HDF5_LIBSH_TARGET})
+ if (HDF5_ENABLE_PARALLEL AND MPI_C_FOUND)
+ target_link_libraries (${HDF5_TOOLS_LIBSH_TARGET} PRIVATE ${MPI_C_LIBRARIES})
+ endif ()
set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_TOOLS_LIBSH_TARGET}")
H5_SET_LIB_OPTIONS (${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_TOOLS_LIB_NAME} SHARED ${HDF5_TOOLS_PACKAGE_SOVERSION})
set_target_properties (${HDF5_TOOLS_LIBSH_TARGET} PROPERTIES
diff --git a/tools/test/h5dump/CMakeTestsVDS.cmake b/tools/test/h5dump/CMakeTestsVDS.cmake
index 3addecf..922e79e 100644
--- a/tools/test/h5dump/CMakeTestsVDS.cmake
+++ b/tools/test/h5dump/CMakeTestsVDS.cmake
@@ -72,6 +72,14 @@
f-3.h5
vds-eiger.h5
)
+ set (HDF5_REFERENCE_PREFIX_VDS
+ 1_vds.h5
+ 2_vds.h5
+ 4_vds.h5
+ 5_vds.h5
+ vds-percival-unlim-maxmin.h5
+ vds-eiger.h5
+ )
set (HDF5_ERROR_REFERENCE_VDS
)
@@ -80,12 +88,21 @@
HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/vds/${vds_h5_file}" "${PROJECT_BINARY_DIR}/testfiles/vds/${fname}" "h5dump_vds_files")
endforeach ()
+ foreach (vds_h5_file ${HDF5_REFERENCE_PREFIX_VDS})
+ get_filename_component(fname "${vds_h5_file}" NAME)
+ HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/vds/${vds_h5_file}" "${PROJECT_BINARY_DIR}/testfiles/vds/prefix/${fname}" "h5dump_vds_files")
+ endforeach ()
foreach (ddl_vds ${HDF5_REFERENCE_VDS})
get_filename_component(fname "${ddl_vds}" NAME)
HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/vds/${ddl_vds}" "${PROJECT_BINARY_DIR}/testfiles/vds/${fname}" "h5dump_vds_files")
endforeach ()
+ foreach (ddl_vds ${HDF5_REFERENCE_VDS})
+ get_filename_component(fname "${ddl_vds}" NAME)
+ HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/vds/${ddl_vds}" "${PROJECT_BINARY_DIR}/testfiles/vds/prefix/${fname}" "h5dump_vds_files")
+ endforeach ()
+
foreach (ddl_vds ${HDF5_ERROR_REFERENCE_VDS})
get_filename_component(fname "${ddl_vds}" NAME)
HDFTEST_COPY_FILE("${PROJECT_SOURCE_DIR}/errfiles/${ddl_vds}" "${PROJECT_BINARY_DIR}/testfiles/vds/${fname}" "h5dump_vds_files")
@@ -134,6 +151,47 @@
endif ()
endmacro ()
+ macro (ADD_H5_VDS_PREFIX_TEST resultfile resultcode)
+ # If using memchecker add tests without using scripts
+ if (HDF5_ENABLE_USING_MEMCHECKER)
+ add_test (NAME H5DUMP_PREFIX-${resultfile} COMMAND $<TARGET_FILE:h5dump> ${ARGN})
+ set_tests_properties (H5DUMP_PREFIX-${resultfile} PROPERTIES
+ ENVIRONMENT "HDF5_VDS_PREFIX=${PROJECT_BINARY_DIR}/testfiles/vds/"
+ WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/vds/prefix"
+ )
+ if (NOT "${resultcode}" STREQUAL "0")
+ set_tests_properties (H5DUMP_PREFIX-${resultfile} PROPERTIES WILL_FAIL "true")
+ endif ()
+ if (NOT "${last_vds_test}" STREQUAL "")
+ set_tests_properties (H5DUMP_PREFIX-${resultfile} PROPERTIES DEPENDS ${last_VDS_test})
+ endif ()
+ else ()
+ # Remove any output file left over from previous test run
+ add_test (
+ NAME H5DUMP_PREFIX-${resultfile}-clear-objects
+ COMMAND ${CMAKE_COMMAND}
+ -E remove
+ ${resultfile}.out
+ ${resultfile}.out.err
+ )
+ set_tests_properties (H5DUMP_PREFIX-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/vds/prefix")
+ add_test (
+ NAME H5DUMP_PREFIX-${resultfile}
+ COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5dump>"
+ -D "TEST_ARGS:STRING=${ARGN}"
+ -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles/vds/prefix"
+ -D "TEST_OUTPUT=${resultfile}.out"
+ -D "TEST_EXPECT=${resultcode}"
+ -D "TEST_REFERENCE=${resultfile}.ddl"
+ -D "TEST_ENV_VAR=HDF5_VDS_PREFIX"
+ -D "TEST_ENV_VALUE=${PROJECT_BINARY_DIR}/testfiles/vds/"
+ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
+ )
+ set_tests_properties (H5DUMP_PREFIX-${resultfile} PROPERTIES DEPENDS H5DUMP_PREFIX-${resultfile}-clear-objects)
+ endif ()
+ endmacro ()
+
macro (ADD_H5_VDS_LAYOUT resultfile resultcode)
# If using memchecker add tests without using scripts
if (HDF5_ENABLE_USING_MEMCHECKER)
@@ -261,3 +319,15 @@
ADD_H5_VDS_LAYOUT (vds_layout-eiger 0 --enable-error-stack vds-eiger.h5)
ADD_H5_VDS_LAYOUT (vds_layout-maxmin 0 --enable-error-stack vds-percival-unlim-maxmin.h5)
endif ()
+
+ # Data read with prefix
+ if (USE_FILTER_DEFLATE)
+ ADD_H5_VDS_PREFIX_TEST (tvds-1 0 --enable-error-stack 1_vds.h5)
+ ADD_H5_VDS_PREFIX_TEST (tvds-2 0 --enable-error-stack 2_vds.h5)
+ ADD_H5_VDS_PREFIX_TEST (tvds-4 0 --enable-error-stack 4_vds.h5)
+ ADD_H5_VDS_PREFIX_TEST (tvds-5 0 --enable-error-stack 5_vds.h5)
+ ADD_H5_VDS_PREFIX_TEST (vds-first 0 --vds-view-first-missing --enable-error-stack vds-percival-unlim-maxmin.h5)
+ ADD_H5_VDS_PREFIX_TEST (vds-gap1 0 -d /VDS-Eiger --vds-gap-size=1 --enable-error-stack vds-eiger.h5)
+ ADD_H5_VDS_PREFIX_TEST (vds-gap2 0 --vds-gap-size=2 --enable-error-stack vds-eiger.h5)
+ endif ()
+
diff --git a/tools/test/h5ls/CMakeTestsVDS.cmake b/tools/test/h5ls/CMakeTestsVDS.cmake
index 5df61bb..2b6f61e 100644
--- a/tools/test/h5ls/CMakeTestsVDS.cmake
+++ b/tools/test/h5ls/CMakeTestsVDS.cmake
@@ -61,6 +61,17 @@
get_filename_component(fname "${listfiles}" NAME)
HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/vds/${listfiles}" "${PROJECT_BINARY_DIR}/testfiles/vds/${fname}" "h5ls_vds_files")
endforeach ()
+
+ foreach (listfiles ${LIST_HDF5_TEST_FILES})
+ get_filename_component(fname "${listfiles}" NAME)
+ HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/vds/${listfiles}" "${PROJECT_BINARY_DIR}/testfiles/vds/prefix/${fname}" "h5ls_vds_files")
+ endforeach ()
+
+ foreach (listfiles ${LIST_OTHER_TEST_FILES})
+ get_filename_component(fname "${listfiles}" NAME)
+ HDFTEST_COPY_FILE("${HDF5_TOOLS_TEST_H5LS_SOURCE_DIR}/vds_prefix/${listfiles}" "${PROJECT_BINARY_DIR}/testfiles/vds/prefix/${fname}" "h5ls_vds_files")
+ endforeach ()
+
add_custom_target(h5ls_vds_files ALL COMMENT "Copying files needed by h5ls_vds tests" DEPENDS ${h5ls_vds_files_list})
##############################################################################
@@ -104,6 +115,46 @@
endif ()
endmacro ()
+ macro (ADD_H5_VDS_PREFIX_TEST resultfile resultcode)
+ # If using memchecker add tests without using scripts
+ if (HDF5_ENABLE_USING_MEMCHECKER)
+ add_test (NAME H5LS_PREFIX-${resultfile} COMMAND $<TARGET_FILE:h5ls> ${ARGN})
+ set_tests_properties (H5LS_PREFIX-${resultfile} PROPERTIES
+ ENVIRONMENT "HDF5_VDS_PREFIX=\${ORIGIN}"
+ WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles"
+ )
+ if ("${resultcode}" STREQUAL "1")
+ set_tests_properties (H5LS_PREFIX-${resultfile} PROPERTIES WILL_FAIL "true")
+ endif ()
+ if (NOT "${last_test}" STREQUAL "")
+ set_tests_properties (H5LS_PREFIX-${resultfile} PROPERTIES DEPENDS ${last_test})
+ endif ()
+ else ()
+ add_test (
+ NAME H5LS_PREFIX-${resultfile}-clear-objects
+ COMMAND ${CMAKE_COMMAND}
+ -E remove
+ ${resultfile}.out
+ ${resultfile}.out.err
+ )
+ set_tests_properties (H5LS_PREFIX-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/vds/prefix")
+ add_test (
+ NAME H5LS_PREFIX-${resultfile}
+ COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5ls>"
+ -D "TEST_ARGS=${ARGN}"
+ -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles"
+ -D "TEST_OUTPUT=vds/prefix/${resultfile}.out"
+ -D "TEST_EXPECT=${resultcode}"
+ -D "TEST_REFERENCE=vds/prefix/${resultfile}.ls"
+ -D "TEST_ENV_VAR=HDF5_VDS_PREFIX"
+ -D "TEST_ENV_VALUE=\${ORIGIN}"
+ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
+ )
+ set_tests_properties (H5LS_PREFIX-${resultfile} PROPERTIES DEPENDS H5LS_PREFIX-${resultfile}-clear-objects)
+ endif ()
+ endmacro ()
+
##############################################################################
##############################################################################
### T H E T E S T S ###
@@ -155,3 +206,10 @@
ADD_H5_VDS_TEST (tvds-4 0 -w80 -v -S 4_vds.h5)
ADD_H5_VDS_TEST (tvds-5 0 -w80 -v -S 5_vds.h5)
+ ADD_H5_VDS_PREFIX_TEST (tvds-1 0 -w80 -v -S vds/prefix/1_vds.h5)
+ ADD_H5_VDS_PREFIX_TEST (tvds-2 0 -w80 -v -S vds/prefix/2_vds.h5)
+ ADD_H5_VDS_PREFIX_TEST (tvds-3_1 0 -w80 -v -S vds/prefix/3_1_vds.h5)
+ ADD_H5_VDS_PREFIX_TEST (tvds-3_2 0 -w80 -v -S vds/prefix/3_2_vds.h5)
+ ADD_H5_VDS_PREFIX_TEST (tvds-4 0 -w80 -v -S vds/prefix/4_vds.h5)
+ ADD_H5_VDS_PREFIX_TEST (tvds-5 0 -w80 -v -S vds/prefix/5_vds.h5)
+
diff --git a/tools/test/h5ls/vds_prefix/tvds-1.ls b/tools/test/h5ls/vds_prefix/tvds-1.ls
new file mode 100644
index 0000000..2830d1a
--- /dev/null
+++ b/tools/test/h5ls/vds_prefix/tvds-1.ls
@@ -0,0 +1,14 @@
+Opened "vds/prefix/1_vds.h5" with sec2 driver.
+vds_dset Dataset {5/Inf, 18/18, 8/8}
+ Location: 1:800
+ Links: 1
+ Maps: {6} Source {
+ 1_a.h5 /source_dset
+ 1_b.h5 /source_dset
+ 1_c.h5 /source_dset
+ 1_d.h5 /source_dset
+ 1_e.h5 /source_dset
+ 1_f.h5 /source_dset
+ }
+ Storage: 2880 logical bytes, 0 allocated bytes
+ Type: 32-bit little-endian integer
diff --git a/tools/test/h5ls/vds_prefix/tvds-2.ls b/tools/test/h5ls/vds_prefix/tvds-2.ls
new file mode 100644
index 0000000..5c6f9d3
--- /dev/null
+++ b/tools/test/h5ls/vds_prefix/tvds-2.ls
@@ -0,0 +1,13 @@
+Opened "vds/prefix/2_vds.h5" with sec2 driver.
+vds_dset Dataset {6/Inf, 8/8, 14/14}
+ Location: 1:800
+ Links: 1
+ Maps: {5} Source {
+ 2_a.h5 /source_dset
+ 2_b.h5 /source_dset
+ 2_c.h5 /source_dset
+ 2_d.h5 /source_dset
+ 2_e.h5 /source_dset
+ }
+ Storage: 2688 logical bytes, 0 allocated bytes
+ Type: 32-bit little-endian integer
diff --git a/tools/test/h5ls/vds_prefix/tvds-3_1.ls b/tools/test/h5ls/vds_prefix/tvds-3_1.ls
new file mode 100644
index 0000000..f4c8e78
--- /dev/null
+++ b/tools/test/h5ls/vds_prefix/tvds-3_1.ls
@@ -0,0 +1,14 @@
+Opened "vds/prefix/3_1_vds.h5" with sec2 driver.
+vds_dset Dataset {5/Inf, 25/25, 8/8}
+ Location: 1:800
+ Links: 1
+ Maps: {6} Source {
+ 1_a.h5 /source_dset
+ 1_b.h5 /source_dset
+ 1_c.h5 /source_dset
+ 1_d.h5 /source_dset
+ 1_e.h5 /source_dset
+ 1_f.h5 /source_dset
+ }
+ Storage: 4000 logical bytes, 0 allocated bytes
+ Type: 32-bit little-endian integer
diff --git a/tools/test/h5ls/vds_prefix/tvds-3_2.ls b/tools/test/h5ls/vds_prefix/tvds-3_2.ls
new file mode 100644
index 0000000..5a7e2d8
--- /dev/null
+++ b/tools/test/h5ls/vds_prefix/tvds-3_2.ls
@@ -0,0 +1,13 @@
+Opened "vds/prefix/3_2_vds.h5" with sec2 driver.
+vds_dset Dataset {6/Inf, 13/13, 19/19}
+ Location: 1:800
+ Links: 1
+ Maps: {5} Source {
+ 2_a.h5 /source_dset
+ 2_b.h5 /source_dset
+ 2_c.h5 /source_dset
+ 2_d.h5 /source_dset
+ 2_e.h5 /source_dset
+ }
+ Storage: 5928 logical bytes, 0 allocated bytes
+ Type: 32-bit little-endian integer
diff --git a/tools/test/h5ls/vds_prefix/tvds-4.ls b/tools/test/h5ls/vds_prefix/tvds-4.ls
new file mode 100644
index 0000000..c22d3a4
--- /dev/null
+++ b/tools/test/h5ls/vds_prefix/tvds-4.ls
@@ -0,0 +1,9 @@
+Opened "vds/prefix/4_vds.h5" with sec2 driver.
+vds_dset Dataset {9/Inf, 4/4, 4/4}
+ Location: 1:800
+ Links: 1
+ Maps: {1} Source {
+ 4_%b.h5 /source_dset
+ }
+ Storage: 576 logical bytes, 0 allocated bytes
+ Type: 32-bit little-endian integer
diff --git a/tools/test/h5ls/vds_prefix/tvds-5.ls b/tools/test/h5ls/vds_prefix/tvds-5.ls
new file mode 100644
index 0000000..efba8dc
--- /dev/null
+++ b/tools/test/h5ls/vds_prefix/tvds-5.ls
@@ -0,0 +1,11 @@
+Opened "vds/prefix/5_vds.h5" with sec2 driver.
+vds_dset Dataset {9/Inf, 4/4, 4/4}
+ Location: 1:800
+ Links: 1
+ Maps: {3} Source {
+ 5_a.h5 /source_dset
+ 5_b.h5 /source_dset
+ 5_c.h5 /source_dset
+ }
+ Storage: 576 logical bytes, 0 allocated bytes
+ Type: 32-bit little-endian integer