summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CMakeInstallation.cmake10
-rw-r--r--CMakeLists.txt121
-rw-r--r--COPYING2
-rw-r--r--MANIFEST2
-rw-r--r--c++/CMakeLists.txt6
-rwxr-xr-xconfig/cmake/CTestScript.cmake7
-rw-r--r--config/cmake/ConfigureChecks.cmake17
-rw-r--r--config/cmake/ConversionTests.c167
-rw-r--r--config/cmake/HDF5Macros.cmake4
-rw-r--r--config/cmake/HDFCompilerFlags.cmake4
-rw-r--r--config/cmake/hdf5-config.cmake.in8
-rw-r--r--config/cmake/libhdf5.settings.cmake.in2
-rwxr-xr-xconfig/cmake/scripts/CTestScript.cmake7
-rwxr-xr-xconfig/cmake/scripts/HDF5config.cmake52
-rwxr-xr-xconfig/cmake/scripts/HDF5options.cmake26
-rw-r--r--config/cmake_ext_mod/CheckTypeSize.cmake61
-rw-r--r--config/cmake_ext_mod/ConfigureChecks.cmake28
-rw-r--r--config/cmake_ext_mod/HDFMacros.cmake88
-rw-r--r--config/cmake_ext_mod/HDFTests.c14
-rw-r--r--configure.ac2
-rw-r--r--fortran/CMakeLists.txt8
-rw-r--r--fortran/src/CMakeLists.txt12
-rw-r--r--fortran/src/H5Df.c10
-rw-r--r--fortran/src/H5Gf.c42
-rw-r--r--fortran/src/H5Pf.c10
-rw-r--r--fortran/src/H5Pff.F902
-rw-r--r--fortran/src/H5Rff.F9066
-rw-r--r--fortran/test/CMakeLists.txt6
-rw-r--r--hl/CMakeLists.txt8
-rw-r--r--hl/c++/CMakeLists.txt6
-rw-r--r--hl/fortran/CMakeLists.txt6
-rw-r--r--hl/fortran/src/CMakeLists.txt6
-rw-r--r--hl/fortran/src/H5LTf90proto.h4
-rw-r--r--hl/fortran/src/H5TBfc.c6
-rw-r--r--hl/test/test_ds.c8
-rw-r--r--hl/tools/CMakeLists.txt4
-rw-r--r--hl/tools/h5watch/testh5watch.sh.in2
-rw-r--r--java/CMakeLists.txt6
-rw-r--r--java/examples/CMakeLists.txt8
-rw-r--r--java/src/CMakeLists.txt4
-rw-r--r--java/src/hdf/CMakeLists.txt2
-rw-r--r--release_docs/INSTALL_CMake.txt8
-rw-r--r--release_docs/RELEASE.txt34
-rw-r--r--release_docs/USING_HDF5_CMake.txt225
-rw-r--r--src/CMakeLists.txt18
-rw-r--r--src/H5Aint.c55
-rw-r--r--src/H5Cimage.c5
-rw-r--r--src/H5Dint.c85
-rw-r--r--src/H5Dlayout.c43
-rw-r--r--src/H5Dpkg.h3
-rw-r--r--src/H5F.c30
-rw-r--r--src/H5Fdeprec.c62
-rw-r--r--src/H5Fint.c78
-rw-r--r--src/H5Fpkg.h3
-rw-r--r--src/H5Fprivate.h34
-rw-r--r--src/H5Fpublic.h14
-rw-r--r--src/H5Fquery.c82
-rw-r--r--src/H5Fsuper.c101
-rw-r--r--src/H5Gobj.c21
-rw-r--r--src/H5HFhdr.c8
-rw-r--r--src/H5O.c1
-rw-r--r--src/H5Oattr.c16
-rw-r--r--src/H5Ocopy.c30
-rw-r--r--src/H5Odtype.c29
-rw-r--r--src/H5Ofill.c252
-rw-r--r--src/H5Oint.c62
-rw-r--r--src/H5Olayout.c40
-rw-r--r--src/H5Opkg.h15
-rw-r--r--src/H5Opline.c51
-rw-r--r--src/H5Oprivate.h11
-rw-r--r--src/H5Osdspace.c9
-rw-r--r--src/H5Pfapl.c185
-rw-r--r--src/H5S.c41
-rw-r--r--src/H5Spkg.h3
-rw-r--r--src/H5Sprivate.h2
-rw-r--r--src/H5T.c37
-rw-r--r--src/H5Tcommit.c29
-rw-r--r--src/H5Tpkg.h3
-rw-r--r--src/H5Tprivate.h2
-rw-r--r--src/H5Zscaleoffset.c112
-rw-r--r--src/H5detect.c1040
-rw-r--r--src/H5trace.c1045
-rw-r--r--test/CMakeTests.cmake1
-rw-r--r--test/Makefile.am2
-rw-r--r--test/chunk_info.c1
-rw-r--r--test/dangle.c103
-rw-r--r--test/dsets.c566
-rw-r--r--test/fheap.c27
-rw-r--r--test/gen_bounds.c606
-rw-r--r--test/gen_cross.c45
-rw-r--r--test/genall5.c127
-rw-r--r--test/gheap.c396
-rw-r--r--test/h5test.h5
-rw-r--r--test/hyperslab.c412
-rw-r--r--test/istore.c500
-rw-r--r--test/mf.c8
-rw-r--r--test/objcopy.c1802
-rw-r--r--test/ohdr.c97
-rw-r--r--test/set_extent.c40
-rw-r--r--test/swmr.c1
-rw-r--r--test/tarray.c40
-rw-r--r--test/tattr.c96
-rw-r--r--test/tconfig.c57
-rw-r--r--test/testfiles/plist_files/dapl_32bebin186 -> 199 bytes
-rw-r--r--test/testfiles/plist_files/dapl_32lebin186 -> 199 bytes
-rw-r--r--test/testfiles/plist_files/dapl_64bebin186 -> 199 bytes
-rw-r--r--test/testfiles/plist_files/dapl_64lebin186 -> 199 bytes
-rw-r--r--test/testfiles/plist_files/def_dapl_32bebin181 -> 194 bytes
-rw-r--r--test/testfiles/plist_files/def_dapl_32lebin181 -> 194 bytes
-rw-r--r--test/testfiles/plist_files/def_dapl_64bebin181 -> 194 bytes
-rw-r--r--test/testfiles/plist_files/def_dapl_64lebin181 -> 194 bytes
-rw-r--r--test/testfiles/plist_files/def_fapl_32bebin1520 -> 1711 bytes
-rw-r--r--test/testfiles/plist_files/def_fapl_32lebin1520 -> 1711 bytes
-rw-r--r--test/testfiles/plist_files/def_fapl_64bebin1520 -> 1711 bytes
-rw-r--r--test/testfiles/plist_files/def_fapl_64lebin1520 -> 1711 bytes
-rw-r--r--test/testfiles/plist_files/fapl_32bebin1522 -> 1713 bytes
-rw-r--r--test/testfiles/plist_files/fapl_32lebin1522 -> 1713 bytes
-rw-r--r--test/testfiles/plist_files/fapl_64bebin1522 -> 1713 bytes
-rw-r--r--test/testfiles/plist_files/fapl_64lebin1522 -> 1713 bytes
-rw-r--r--test/testfiles/plist_files/lapl_32bebin1625 -> 1816 bytes
-rw-r--r--test/testfiles/plist_files/lapl_32lebin1625 -> 1816 bytes
-rw-r--r--test/testfiles/plist_files/lapl_64bebin1625 -> 1816 bytes
-rw-r--r--test/testfiles/plist_files/lapl_64lebin1625 -> 1816 bytes
-rw-r--r--test/testhdf5.h27
-rw-r--r--test/tfile.c2585
-rw-r--r--test/tgenprop.c154
-rw-r--r--test/th5o.c191
-rw-r--r--test/th5s.c406
-rw-r--r--test/tid.c273
-rw-r--r--test/titerate.c44
-rw-r--r--test/tmisc.c103
-rw-r--r--test/trefer.c178
-rw-r--r--test/ttime.c14
-rw-r--r--test/ttsafe.h3
-rw-r--r--test/tvlstr.c58
-rw-r--r--test/tvltypes.c137
-rw-r--r--testpar/t_cache.c2745
-rw-r--r--testpar/t_cache_image.c679
-rw-r--r--testpar/t_pflush1.c113
-rw-r--r--testpar/t_pread.c73
-rw-r--r--testpar/t_shapesame.c1706
-rw-r--r--testpar/t_span_tree.c704
-rw-r--r--tools/CMakeLists.txt8
-rw-r--r--tools/lib/h5tools.c22
-rw-r--r--tools/lib/h5tools.h2
-rw-r--r--tools/lib/h5tools_dump.c65
-rw-r--r--tools/src/CMakeLists.txt20
-rw-r--r--tools/src/h5copy/h5copy.c4
-rw-r--r--tools/src/h5diff/h5diff_common.c2
-rw-r--r--tools/src/h5diff/h5diff_main.c2
-rw-r--r--tools/src/h5dump/h5dump.c53
-rw-r--r--tools/src/h5dump/h5dump_ddl.c22
-rw-r--r--tools/src/h5dump/h5dump_xml.c190
-rw-r--r--tools/src/h5import/h5import.c4
-rw-r--r--tools/src/h5repack/h5repack.c2
-rw-r--r--tools/src/h5repack/h5repack.h30
-rw-r--r--tools/src/h5repack/h5repack_copy.c20
-rw-r--r--tools/src/h5repack/h5repack_main.c45
-rw-r--r--tools/test/CMakeLists.txt22
-rw-r--r--tools/test/h5copy/h5copygentest.c2
-rw-r--r--tools/test/h5repack/testfiles/h5repack-help.txt19
-rw-r--r--tools/test/misc/CMakeLists.txt2
-rw-r--r--tools/test/perform/pio_perf.h25
-rw-r--r--tools/test/perform/sio_perf.h1
-rw-r--r--tools/testfiles/h5dump-help.txt4
-rw-r--r--tools/testfiles/pbits/tnofilename-with-packed-bits.ddl4
-rw-r--r--tools/testfiles/pbits/tpbitsIncomplete.ddl4
-rw-r--r--tools/testfiles/pbits/tpbitsLengthExceeded.ddl4
-rw-r--r--tools/testfiles/pbits/tpbitsLengthPositive.ddl4
-rw-r--r--tools/testfiles/pbits/tpbitsMaxExceeded.ddl4
-rw-r--r--tools/testfiles/pbits/tpbitsOffsetExceeded.ddl4
-rw-r--r--tools/testfiles/pbits/tpbitsOffsetNegative.ddl4
172 files changed, 12047 insertions, 8450 deletions
diff --git a/CMakeInstallation.cmake b/CMakeInstallation.cmake
index 8804964..0bfb2cc 100644
--- a/CMakeInstallation.cmake
+++ b/CMakeInstallation.cmake
@@ -41,7 +41,7 @@ if (NOT HDF5_EXTERNALLY_CONFIGURED)
if (HDF5_EXPORTED_TARGETS)
install (
EXPORT ${HDF5_EXPORTED_TARGETS}
- DESTINATION ${HDF5_INSTALL_CMAKE_DIR}
+ DESTINATION ${HDF5_INSTALL_CMAKE_DIR}/hdf5
FILE ${HDF5_PACKAGE}${HDF_PACKAGE_EXT}-targets.cmake
NAMESPACE ${HDF5_PACKAGE}::
COMPONENT configinstall
@@ -84,7 +84,7 @@ set (CURRENT_BUILD_DIR "${CMAKE_CURRENT_BINARY_DIR}" )
configure_package_config_file (
${HDF_RESOURCES_DIR}/hdf5-config.cmake.in
"${HDF5_BINARY_DIR}/${HDF5_PACKAGE}${HDF_PACKAGE_EXT}-config.cmake"
- INSTALL_DESTINATION "${HDF5_INSTALL_CMAKE_DIR}"
+ INSTALL_DESTINATION "${HDF5_INSTALL_CMAKE_DIR}/hdf5"
PATH_VARS INCLUDE_INSTALL_DIR SHARE_INSTALL_DIR CURRENT_BUILD_DIR
INSTALL_PREFIX "${CMAKE_CURRENT_BINARY_DIR}"
)
@@ -98,14 +98,14 @@ set (CURRENT_BUILD_DIR "${CMAKE_INSTALL_PREFIX}" )
configure_package_config_file (
${HDF_RESOURCES_DIR}/hdf5-config.cmake.in
"${HDF5_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/${HDF5_PACKAGE}${HDF_PACKAGE_EXT}-config.cmake"
- INSTALL_DESTINATION "${HDF5_INSTALL_CMAKE_DIR}"
+ INSTALL_DESTINATION "${HDF5_INSTALL_CMAKE_DIR}/hdf5"
PATH_VARS INCLUDE_INSTALL_DIR SHARE_INSTALL_DIR CURRENT_BUILD_DIR
)
if (NOT HDF5_EXTERNALLY_CONFIGURED)
install (
FILES ${HDF5_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/${HDF5_PACKAGE}${HDF_PACKAGE_EXT}-config.cmake
- DESTINATION ${HDF5_INSTALL_CMAKE_DIR}
+ DESTINATION ${HDF5_INSTALL_CMAKE_DIR}/hdf5
COMPONENT configinstall
)
endif ()
@@ -120,7 +120,7 @@ if (NOT HDF5_EXTERNALLY_CONFIGURED)
)
install (
FILES ${HDF5_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/${HDF5_PACKAGE}${HDF_PACKAGE_EXT}-config-version.cmake
- DESTINATION ${HDF5_INSTALL_CMAKE_DIR}
+ DESTINATION ${HDF5_INSTALL_CMAKE_DIR}/hdf5
COMPONENT configinstall
)
endif ()
diff --git a/CMakeLists.txt b/CMakeLists.txt
index ce0aadf..3c7bb38 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -199,51 +199,6 @@ set (HDF5_JAVA_LOGGING_JAR ${HDF5_SOURCE_DIR}/java/lib/slf4j-api-1.7.5.j
set (HDF5_JAVA_LOGGING_NOP_JAR ${HDF5_SOURCE_DIR}/java/lib/ext/slf4j-nop-1.7.5.jar)
set (HDF5_JAVA_LOGGING_SIMPLE_JAR ${HDF5_SOURCE_DIR}/java/lib/ext/slf4j-simple-1.7.5.jar)
-if (APPLE)
- option (HDF5_BUILD_FRAMEWORKS "TRUE to build as frameworks libraries, FALSE to build according to BUILD_SHARED_LIBS" FALSE)
-endif ()
-
-if (NOT HDF5_INSTALL_BIN_DIR)
- set (HDF5_INSTALL_BIN_DIR bin)
-endif ()
-if (NOT HDF5_INSTALL_LIB_DIR)
- if (APPLE)
- if (HDF5_BUILD_FRAMEWORKS)
- set (HDF5_INSTALL_JAR_DIR ../Java)
- else ()
- set (HDF5_INSTALL_JAR_DIR lib)
- endif ()
- set (HDF5_INSTALL_FMWK_DIR ${CMAKE_INSTALL_FRAMEWORK_PREFIX})
- else ()
- set (HDF5_INSTALL_JAR_DIR lib)
- endif ()
- set (HDF5_INSTALL_LIB_DIR lib)
-endif ()
-if (NOT HDF5_INSTALL_INCLUDE_DIR)
- set (HDF5_INSTALL_INCLUDE_DIR include)
-endif ()
-if (NOT HDF5_INSTALL_DATA_DIR)
- if (NOT WIN32)
- if (APPLE)
- if (HDF5_BUILD_FRAMEWORKS)
- set (HDF5_INSTALL_EXTRA_DIR ../SharedSupport)
- else ()
- set (HDF5_INSTALL_EXTRA_DIR share)
- endif ()
- set (HDF5_INSTALL_FWRK_DIR ${CMAKE_INSTALL_FRAMEWORK_PREFIX})
- endif ()
- set (HDF5_INSTALL_DATA_DIR share)
- set (HDF5_INSTALL_CMAKE_DIR share/cmake/hdf5)
- else ()
- set (HDF5_INSTALL_DATA_DIR ".")
- set (HDF5_INSTALL_CMAKE_DIR cmake)
- endif ()
-endif ()
-
-if (DEFINED ADDITIONAL_CMAKE_PREFIX_PATH AND EXISTS "${ADDITIONAL_CMAKE_PREFIX_PATH}")
- set (CMAKE_PREFIX_PATH ${ADDITIONAL_CMAKE_PREFIX_PATH} ${CMAKE_PREFIX_PATH})
-endif ()
-
#-----------------------------------------------------------------------------
# parse the full version number from H5public.h and include in H5_VERS_INFO
#-----------------------------------------------------------------------------
@@ -406,46 +361,15 @@ set (HDF5_PACKAGE_BUGREPORT "help@hdfgroup.org")
# Include some macros for reusable code
#-----------------------------------------------------------------------------
include (${HDF_RESOURCES_EXT_DIR}/HDFMacros.cmake)
-include (${HDF_RESOURCES_EXT_DIR}/HDFLibMacros.cmake)
-include (${HDF_RESOURCES_DIR}/HDF5Macros.cmake)
-SET_HDF_BUILD_TYPE()
+HDF_DIR_PATHS(${HDF5_PACKAGE_NAME})
-#-----------------------------------------------------------------------------
-# Setup output Directories
-#-----------------------------------------------------------------------------
-if (NOT HDF5_EXTERNALLY_CONFIGURED)
- set (CMAKE_RUNTIME_OUTPUT_DIRECTORY
- ${PROJECT_BINARY_DIR}/bin CACHE PATH "Single Directory for all Executables."
- )
- set (CMAKE_LIBRARY_OUTPUT_DIRECTORY
- ${PROJECT_BINARY_DIR}/bin CACHE PATH "Single Directory for all Libraries"
- )
- set (CMAKE_ARCHIVE_OUTPUT_DIRECTORY
- ${PROJECT_BINARY_DIR}/bin CACHE PATH "Single Directory for all static libraries."
- )
- set (CMAKE_Fortran_MODULE_DIRECTORY
- ${PROJECT_BINARY_DIR}/bin CACHE PATH "Single Directory for all fortran modules."
- )
- if (WIN32)
- set (CMAKE_TEST_OUTPUT_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CTEST_CONFIGURATION_TYPE})
- set (CMAKE_PDB_OUTPUT_DIRECTORY
- ${PROJECT_BINARY_DIR}/bin CACHE PATH "Single Directory for all pdb files."
- )
- else ()
- set (CMAKE_TEST_OUTPUT_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CTEST_CONFIGURATION_TYPE})
- endif ()
-else ()
- # if we are externally configured, but the project uses old cmake scripts
- # this may not be set and utilities like H5detect will fail
- if (NOT CMAKE_RUNTIME_OUTPUT_DIRECTORY)
- set (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${EXECUTABLE_OUTPUT_PATH})
- endif ()
-endif ()
+include (${HDF_RESOURCES_EXT_DIR}/HDFLibMacros.cmake)
+include (${HDF_RESOURCES_DIR}/HDF5Macros.cmake)
#-----------------------------------------------------------------------------
# Targets built within this project are exported at Install time for use
-# by other projects using FindHDF5.
+# by other projects.
#-----------------------------------------------------------------------------
if (NOT HDF5_EXPORTED_TARGETS)
set (HDF5_EXPORTED_TARGETS "hdf5-targets")
@@ -604,9 +528,13 @@ endif ()
#-----------------------------------------------------------------------------
# Option to embed library info into executables
#-----------------------------------------------------------------------------
-option (HDF5_ENABLE_EMBEDDED_LIBINFO "embed library info into executables" ON)
-if (HDF5_ENABLE_EMBEDDED_LIBINFO)
- set (H5_HAVE_EMBEDDED_LIBINFO 1)
+if (CMAKE_SYSTEM_NAME STREQUAL "Emscripten")
+ set (H5_HAVE_EMBEDDED_LIBINFO 0)
+else ()
+ option (HDF5_ENABLE_EMBEDDED_LIBINFO "embed library info into executables" ON)
+ if (HDF5_ENABLE_EMBEDDED_LIBINFO)
+ set (H5_HAVE_EMBEDDED_LIBINFO 1)
+ endif ()
endif ()
include (${HDF_RESOURCES_DIR}/HDFCompilerFlags.cmake)
@@ -752,17 +680,17 @@ endif ()
#-----------------------------------------------------------------------------
# Add the HDF5 Library Target to the build
#-----------------------------------------------------------------------------
-add_subdirectory (${HDF5_SOURCE_DIR}/src ${PROJECT_BINARY_DIR}/src)
+add_subdirectory (src)
if (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "GIT" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ")
if (ZLIB_FOUND AND ZLIB_USE_EXTERNAL)
- ADD_DEPENDENCIES (${HDF5_LIB_TARGET} ZLIB)
+ add_dependencies (${HDF5_LIB_TARGET} ZLIB)
if (BUILD_SHARED_LIBS)
add_dependencies (${HDF5_LIBSH_TARGET} ZLIB)
endif ()
endif ()
if (SZIP_FOUND AND SZIP_USE_EXTERNAL)
- ADD_DEPENDENCIES (${HDF5_LIB_TARGET} SZIP)
+ add_dependencies (${HDF5_LIB_TARGET} SZIP)
if (BUILD_SHARED_LIBS)
add_dependencies (${HDF5_LIBSH_TARGET} SZIP)
endif ()
@@ -797,12 +725,11 @@ if (BUILD_TESTING)
if (NOT HDF5_EXTERNALLY_CONFIGURED)
if (EXISTS "${HDF5_SOURCE_DIR}/test" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/test")
- add_subdirectory (${HDF5_SOURCE_DIR}/tools/lib ${PROJECT_BINARY_DIR}/tools/lib)
- add_subdirectory (${HDF5_SOURCE_DIR}/test ${PROJECT_BINARY_DIR}/test)
+ add_subdirectory (test)
endif ()
if (H5_HAVE_PARALLEL)
if (EXISTS "${HDF5_SOURCE_DIR}/testpar" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/testpar")
- add_subdirectory (${HDF5_SOURCE_DIR}/testpar ${PROJECT_BINARY_DIR}/testpar)
+ add_subdirectory (testpar)
endif ()
endif ()
endif ()
@@ -814,7 +741,7 @@ endif ()
if (EXISTS "${HDF5_SOURCE_DIR}/tools" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/tools")
option (HDF5_BUILD_TOOLS "Build HDF5 Tools" ON)
if (HDF5_BUILD_TOOLS)
- add_subdirectory (${HDF5_SOURCE_DIR}/tools ${PROJECT_BINARY_DIR}/tools)
+ add_subdirectory (tools)
endif ()
endif ()
@@ -824,7 +751,7 @@ endif ()
if (EXISTS "${HDF5_SOURCE_DIR}/examples" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/examples")
option (HDF5_BUILD_EXAMPLES "Build HDF5 Library Examples" ON)
if (HDF5_BUILD_EXAMPLES)
- add_subdirectory (${HDF5_SOURCE_DIR}/examples ${PROJECT_BINARY_DIR}/examples)
+ add_subdirectory (examples)
endif ()
endif ()
@@ -835,7 +762,7 @@ if (EXISTS "${HDF5_SOURCE_DIR}/hl" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/hl")
option (HDF5_BUILD_HL_LIB "Build HIGH Level HDF5 Library" ON)
if (HDF5_BUILD_HL_LIB)
set (H5_INCLUDE_HL 1)
- add_subdirectory (${HDF5_SOURCE_DIR}/hl ${PROJECT_BINARY_DIR}/hl)
+ add_subdirectory (hl)
endif ()
endif ()
@@ -884,11 +811,11 @@ if (EXISTS "${HDF5_SOURCE_DIR}/fortran" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/for
#
# set (FCFLAGS "${Fortran_DEFINES}")
- add_subdirectory (${HDF5_SOURCE_DIR}/fortran ${PROJECT_BINARY_DIR}/fortran)
+ add_subdirectory (fortran)
if (HDF5_BUILD_HL_LIB)
if (EXISTS "${HDF5_SOURCE_DIR}/hl/fortran" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/hl/fortran")
#-- Build the High Level Fortran source codes
- add_subdirectory (${HDF5_SOURCE_DIR}/hl/fortran ${PROJECT_BINARY_DIR}/hl/fortran)
+ add_subdirectory (hl/fortran)
endif ()
endif ()
endif ()
@@ -911,11 +838,11 @@ if (EXISTS "${HDF5_SOURCE_DIR}/c++" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/c++")
if (CMAKE_NO_STD_NAMESPACE)
set (H5_NO_STD 1)
endif ()
- add_subdirectory (${HDF5_SOURCE_DIR}/c++ ${PROJECT_BINARY_DIR}/c++)
+ add_subdirectory (c++)
if (HDF5_BUILD_HL_LIB)
if (EXISTS "${HDF5_SOURCE_DIR}/hl/c++" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/hl/c++")
#-- Build the High Level Fortran source codes
- add_subdirectory (${HDF5_SOURCE_DIR}/hl/c++ ${PROJECT_BINARY_DIR}/hl/c++)
+ add_subdirectory (hl/c++)
endif ()
endif ()
endif ()
@@ -937,7 +864,7 @@ endif ()
if (EXISTS "${HDF5_SOURCE_DIR}/java" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/java")
option (HDF5_BUILD_JAVA "Build Java HDF5 Library" OFF)
if (HDF5_BUILD_JAVA)
- add_subdirectory (${HDF5_SOURCE_DIR}/java ${PROJECT_BINARY_DIR}/java)
+ add_subdirectory (java)
endif ()
endif ()
diff --git a/COPYING b/COPYING
index 51cb4e6..c668565 100644
--- a/COPYING
+++ b/COPYING
@@ -99,7 +99,7 @@ and/or accompanying materials:
HDF5 is available with the SZIP compression library but SZIP is not part
of HDF5 and has separate copyright and license terms. See “Szip Compression
-in HDF Products” (www.hdfgroup.org/doc_resource/SZIP/) for further details.
+in HDF Products” (https://support.hdfgroup.org/doc_resource/SZIP/) for further details.
-----------------------------------------------------------------------------
diff --git a/MANIFEST b/MANIFEST
index 2db6d6b..8e79458 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -981,6 +981,7 @@
./test/gen_bad_ohdr.c
./test/gen_bad_compound.c
./test/gen_bogus.c
+./test/gen_bounds.c
./test/gen_cross.c
./test/gen_deflate.c
./test/gen_file_image.c
@@ -3093,7 +3094,6 @@
./config/cmake/userblockTest.cmake
./config/cmake/vfdTest.cmake
-./config/cmake_ext_mod/CheckTypeSize.cmake
./config/cmake_ext_mod/ConfigureChecks.cmake
./config/cmake_ext_mod/CTestCustom.cmake
./config/cmake_ext_mod/FindMPI.cmake
diff --git a/c++/CMakeLists.txt b/c++/CMakeLists.txt
index c9c4815..adbf1a4 100644
--- a/c++/CMakeLists.txt
+++ b/c++/CMakeLists.txt
@@ -27,18 +27,18 @@ if (H5_HAVE_PARALLEL)
add_definitions ("-DMPICH_IGNORE_CXX_SEEK")
endif ()
-add_subdirectory (${HDF5_CPP_SOURCE_DIR}/src ${HDF5_CPP_BINARY_DIR}/src)
+add_subdirectory (src)
#-----------------------------------------------------------------------------
# Build the CPP Examples
#-----------------------------------------------------------------------------
if (HDF5_BUILD_EXAMPLES)
- add_subdirectory (${HDF5_CPP_SOURCE_DIR}/examples ${HDF5_CPP_BINARY_DIR}/examples)
+ add_subdirectory (examples)
endif ()
#-----------------------------------------------------------------------------
# Build the CPP unit tests
#-----------------------------------------------------------------------------
if (BUILD_TESTING)
- add_subdirectory (${HDF5_CPP_SOURCE_DIR}/test ${HDF5_CPP_BINARY_DIR}/test)
+ add_subdirectory (test)
endif ()
diff --git a/config/cmake/CTestScript.cmake b/config/cmake/CTestScript.cmake
index c59b10c..a8b7bbc 100755
--- a/config/cmake/CTestScript.cmake
+++ b/config/cmake/CTestScript.cmake
@@ -63,13 +63,6 @@ if (APPLE)
set (ENV{CC} "${XCODE_CC}")
set (ENV{CXX} "${XCODE_CXX}")
- if (NOT NO_MAC_FORTRAN)
- # Shared fortran is not supported, build static
- set (BUILD_OPTIONS "${BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=OFF -DCMAKE_ANSI_CFLAGS:STRING=-fPIC")
- else ()
- set (BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF5_BUILD_FORTRAN:BOOL=OFF")
- endif ()
-
set (BUILD_OPTIONS "${BUILD_OPTIONS} -DCTEST_USE_LAUNCHERS:BOOL=ON -DCMAKE_BUILD_WITH_INSTALL_RPATH:BOOL=OFF")
endif ()
diff --git a/config/cmake/ConfigureChecks.cmake b/config/cmake/ConfigureChecks.cmake
index 0848e66..7d73c09 100644
--- a/config/cmake/ConfigureChecks.cmake
+++ b/config/cmake/ConfigureChecks.cmake
@@ -179,7 +179,7 @@ endif ()
# Macro to determine the various conversion capabilities
#-----------------------------------------------------------------------------
macro (H5ConversionTests TEST msg)
- if ("${TEST}" MATCHES "^${TEST}$")
+ if (NOT DEFINED ${TEST})
# message (STATUS "===> ${TEST}")
TRY_RUN (${TEST}_RUN ${TEST}_COMPILE
${CMAKE_BINARY_DIR}
@@ -210,21 +210,6 @@ macro (H5ConversionTests TEST msg)
endmacro ()
#-----------------------------------------------------------------------------
-# Macro to make some of the conversion tests easier to write/read
-#-----------------------------------------------------------------------------
-macro (H5MiscConversionTest VAR TEST msg)
- if ("${TEST}" MATCHES "^${TEST}$")
- if (${VAR})
- set (${TEST} 1 CACHE INTERNAL ${msg})
- message (STATUS "${msg}... yes")
- else ()
- set (${TEST} "" CACHE INTERNAL ${msg})
- message (STATUS "${msg}... no")
- endif ()
- endif ()
-endmacro ()
-
-#-----------------------------------------------------------------------------
# Check various conversion capabilities
#-----------------------------------------------------------------------------
diff --git a/config/cmake/ConversionTests.c b/config/cmake/ConversionTests.c
index 082dbd4..002bc88 100644
--- a/config/cmake/ConversionTests.c
+++ b/config/cmake/ConversionTests.c
@@ -9,12 +9,23 @@
* If you do not have access to either file, you may request a copy from *
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
++
+#if defined(__has_attribute)
+#if __has_attribute(no_sanitize)
+#define HDF_NO_UBSAN __attribute__((no_sanitize("undefined")))
+#else
+#define HDF_NO_UBSAN
+#endif
+#else
+#define HDF_NO_UBSAN
+#endif
+
#ifdef H5_LDOUBLE_TO_LONG_SPECIAL_TEST
#include <string.h>
#include <stdlib.h>
-int main(void)
+int main(void) HDF_NO_UBSAN
{
long double ld = 20041683600089727.779961L;
long ll;
@@ -24,44 +35,44 @@ int main(void)
int ret = 1;
if(sizeof(long double) == 16 && sizeof(long) == 8) {
- /*make sure the long double type has 16 bytes in size and
- * 11 bits of exponent. If it is,
- *the bit sequence should be like below. It's not
- *a decent way to check but this info isn't available. */
- memcpy(s, &ld, 16);
- if(s[0]==0x43 && s[1]==0x51 && s[2]==0xcc && s[3]==0xf3 &&
- s[4]==0x85 && s[5]==0xeb && s[6]==0xc8 && s[7]==0xa0 &&
- s[8]==0xbf && s[9]==0xcc && s[10]==0x2a && s[11]==0x3c) {
-
- /* Assign the hexadecimal value of long double type. */
- s[0]=0x43; s[1]=0x51; s[2]=0xcc; s[3]=0xf3;
- s[4]=0x85; s[5]=0xeb; s[6]=0xc8; s[7]=0xa0;
- s[8]=0xbf; s[9]=0xcc; s[10]=0x2a; s[11]=0x3c;
- s[12]=0x3d; s[13]=0x85; s[14]=0x56; s[15]=0x20;
-
- memcpy(&ld, s, 16);
-
- ll = (long)ld;
- memcpy(s2, &ll, 8);
-
- /* The library's algorithm converts it to 0x 00 47 33 ce 17 af 22 82
- * and gets wrong value 20041683600089730 on the IBM Power6 Linux.
- * But the IBM Power6 Linux converts it to 0x00 47 33 ce 17 af 22 7f
- * and gets the correct value 20041683600089727. It uses some special
- * algorithm. We're going to define the macro and skip the test until
- * we can figure out how they do it. */
- if(s2[0]==0x00 && s2[1]==0x47 && s2[2]==0x33 && s2[3]==0xce &&
- s2[4]==0x17 && s2[5]==0xaf && s2[6]==0x22 && s2[7]==0x7f)
- ret = 0;
-
- ull = (unsigned long)ld;
- memcpy(s2, &ull, 8);
-
- /* The unsigned long is the same as signed long. */
- if(s2[0]==0x00 && s2[1]==0x47 && s2[2]==0x33 && s2[3]==0xce &&
- s2[4]==0x17 && s2[5]==0xaf && s2[6]==0x22 && s2[7]==0x7f)
- ret = 0;
- }
+ /*make sure the long double type has 16 bytes in size and
+ * 11 bits of exponent. If it is,
+ *the bit sequence should be like below. It's not
+ *a decent way to check but this info isn't available. */
+ memcpy(s, &ld, 16);
+ if(s[0]==0x43 && s[1]==0x51 && s[2]==0xcc && s[3]==0xf3 &&
+ s[4]==0x85 && s[5]==0xeb && s[6]==0xc8 && s[7]==0xa0 &&
+ s[8]==0xbf && s[9]==0xcc && s[10]==0x2a && s[11]==0x3c) {
+
+ /* Assign the hexadecimal value of long double type. */
+ s[0]=0x43; s[1]=0x51; s[2]=0xcc; s[3]=0xf3;
+ s[4]=0x85; s[5]=0xeb; s[6]=0xc8; s[7]=0xa0;
+ s[8]=0xbf; s[9]=0xcc; s[10]=0x2a; s[11]=0x3c;
+ s[12]=0x3d; s[13]=0x85; s[14]=0x56; s[15]=0x20;
+
+ memcpy(&ld, s, 16);
+
+ ll = (long)ld;
+ memcpy(s2, &ll, 8);
+
+ /* The library's algorithm converts it to 0x 00 47 33 ce 17 af 22 82
+ * and gets wrong value 20041683600089730 on the IBM Power6 Linux.
+ * But the IBM Power6 Linux converts it to 0x00 47 33 ce 17 af 22 7f
+ * and gets the correct value 20041683600089727. It uses some special
+ * algorithm. We're going to define the macro and skip the test until
+ * we can figure out how they do it. */
+ if(s2[0]==0x00 && s2[1]==0x47 && s2[2]==0x33 && s2[3]==0xce &&
+ s2[4]==0x17 && s2[5]==0xaf && s2[6]==0x22 && s2[7]==0x7f)
+ ret = 0;
+
+ ull = (unsigned long)ld;
+ memcpy(s2, &ull, 8);
+
+ /* The unsigned long is the same as signed long. */
+ if(s2[0]==0x00 && s2[1]==0x47 && s2[2]==0x33 && s2[3]==0xce &&
+ s2[4]==0x17 && s2[5]==0xaf && s2[6]==0x22 && s2[7]==0x7f)
+ ret = 0;
+ }
}
done:
@@ -75,7 +86,7 @@ done:
#include <string.h>
#include <stdlib.h>
-int main(void)
+int main(void) HDF_NO_UBSAN
{
long double ld;
long ll;
@@ -86,46 +97,46 @@ int main(void)
/*Determine if long double has 16 byte in size, 11 bit exponent, and
*the bias is 0x3ff */
if(sizeof(long double) == 16) {
- ld = 1.0L;
- memcpy(s, &ld, 16);
- if(s[0]==0x3f && s[1]==0xf0 && s[2]==0x00 && s[3]==0x00 &&
- s[4]==0x00 && s[5]==0x00 && s[6]==0x00 && s[7]==0x00)
- flag = 1;
+ ld = 1.0L;
+ memcpy(s, &ld, 16);
+ if(s[0]==0x3f && s[1]==0xf0 && s[2]==0x00 && s[3]==0x00 &&
+ s[4]==0x00 && s[5]==0x00 && s[6]==0x00 && s[7]==0x00)
+ flag = 1;
}
if(flag==1 && sizeof(long)==8) {
- ll = 0x003fffffffffffffL;
- ld = (long double)ll;
- memcpy(s, &ld, 16);
- /* The library converts the value to 0x434fffffffffffff8000000000000000.
- * In decimal it is 18014398509481982.000000, one value short of the original.
- * The IBM Power6 Linux converts it to 0x4350000000000000bff0000000000000.
- * The value is correct in decimal. It uses some special
- * algorithm. We're going to define the macro and skip the test until
- * we can figure out how they do it. */
- if(s[0]==0x43 && s[1]==0x50 && s[2]==0x00 && s[3]==0x00 &&
- s[4]==0x00 && s[5]==0x00 && s[6]==0x00 && s[7]==0x00 &&
- s[8]==0xbf && s[9]==0xf0 && s[10]==0x00 && s[11]==0x00 &&
- s[12]==0x00 && s[13]==0x00 && s[14]==0x00 && s[15]==0x00)
- ret = 0;
+ ll = 0x003fffffffffffffL;
+ ld = (long double)ll;
+ memcpy(s, &ld, 16);
+ /* The library converts the value to 0x434fffffffffffff8000000000000000.
+ * In decimal it is 18014398509481982.000000, one value short of the original.
+ * The IBM Power6 Linux converts it to 0x4350000000000000bff0000000000000.
+ * The value is correct in decimal. It uses some special
+ * algorithm. We're going to define the macro and skip the test until
+ * we can figure out how they do it. */
+ if(s[0]==0x43 && s[1]==0x50 && s[2]==0x00 && s[3]==0x00 &&
+ s[4]==0x00 && s[5]==0x00 && s[6]==0x00 && s[7]==0x00 &&
+ s[8]==0xbf && s[9]==0xf0 && s[10]==0x00 && s[11]==0x00 &&
+ s[12]==0x00 && s[13]==0x00 && s[14]==0x00 && s[15]==0x00)
+ ret = 0;
}
if(flag==1 && sizeof(unsigned long)==8) {
- ull = 0xffffffffffffffffUL;
- ld = (long double)ull;
- memcpy(s, &ld, 16);
- /* Use a different value from signed long to test. The problem is the same
- * for both long and unsigned long. The value is 18446744073709551615.
- * The library converts the value to 0x43effffffffffffffe000000000000000.
- * In decimal it's 18446744073709548544.000000, very different from the original.
- * The IBM Power6 Linux converts it to 0x43f0000000000000bff0000000000000.
- * The value is correct in decimal. It uses some special
- * algorithm. We're going to define the macro and skip the test until
- * we can figure out how they do it. */
- if(s[0]==0x43 && s[1]==0xf0 && s[2]==0x00 && s[3]==0x00 &&
- s[4]==0x00 && s[5]==0x00 && s[6]==0x00 && s[7]==0x00 &&
- s[8]==0xbf && s[9]==0xf0 && s[10]==0x00 && s[11]==0x00 &&
- s[12]==0x00 && s[13]==0x00 && s[14]==0x00 && s[15]==0x00)
- ret = 0;
+ ull = 0xffffffffffffffffUL;
+ ld = (long double)ull;
+ memcpy(s, &ld, 16);
+ /* Use a different value from signed long to test. The problem is the same
+ * for both long and unsigned long. The value is 18446744073709551615.
+ * The library converts the value to 0x43effffffffffffffe000000000000000.
+ * In decimal it's 18446744073709548544.000000, very different from the original.
+ * The IBM Power6 Linux converts it to 0x43f0000000000000bff0000000000000.
+ * The value is correct in decimal. It uses some special
+ * algorithm. We're going to define the macro and skip the test until
+ * we can figure out how they do it. */
+ if(s[0]==0x43 && s[1]==0xf0 && s[2]==0x00 && s[3]==0x00 &&
+ s[4]==0x00 && s[5]==0x00 && s[6]==0x00 && s[7]==0x00 &&
+ s[8]==0xbf && s[9]==0xf0 && s[10]==0x00 && s[11]==0x00 &&
+ s[12]==0x00 && s[13]==0x00 && s[14]==0x00 && s[15]==0x00)
+ ret = 0;
}
done:
exit(ret);
@@ -138,7 +149,7 @@ done:
#include <string.h>
#include <stdlib.h>
-int main(void)
+int main(void) HDF_NO_UBSAN
{
long double ld = 20041683600089727.779961L;
long long ll;
@@ -181,7 +192,7 @@ done:
#include <string.h>
#include <stdlib.h>
-int main(void)
+int main(void) HDF_NO_UBSAN
{
long double ld;
long long ll;
@@ -243,7 +254,7 @@ int FC_DUMMY_MAIN()
#endif
#endif
int
-main ()
+main () HDF_NO_UBSAN
{
char *chp = "beefs";
diff --git a/config/cmake/HDF5Macros.cmake b/config/cmake/HDF5Macros.cmake
index f08349e..c3dea9a 100644
--- a/config/cmake/HDF5Macros.cmake
+++ b/config/cmake/HDF5Macros.cmake
@@ -17,12 +17,12 @@ macro (H5_SET_LIB_OPTIONS libtarget libname libtype)
if (ARGN)
set (PACKAGE_SOVERSION ${ARGN})
else ()
- set (PACKAGE_SOVERSION ${HDF5_PACKAGE_SOVERSION})
+ set (PACKAGE_SOVERSION ${H5_SOVERS_MAJOR})
endif ()
if (WIN32)
set (LIBHDF_VERSION ${HDF5_PACKAGE_VERSION_MAJOR})
else ()
- set (LIBHDF_VERSION ${HDF5_PACKAGE_VERSION})
+ set (LIBHDF_VERSION ${HDF5_PACKAGE_SOVERSION})
endif ()
set_target_properties (${libtarget} PROPERTIES VERSION ${LIBHDF_VERSION})
if (WIN32)
diff --git a/config/cmake/HDFCompilerFlags.cmake b/config/cmake/HDFCompilerFlags.cmake
index a414cea..56277fa 100644
--- a/config/cmake/HDFCompilerFlags.cmake
+++ b/config/cmake/HDFCompilerFlags.cmake
@@ -49,9 +49,9 @@ if (HDF5_DISABLE_COMPILER_WARNINGS)
if (MSVC)
set (HDF5_WARNINGS_BLOCKED 1)
string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
- set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /w")
+ set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W0")
string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
- set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /w")
+ set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W0")
endif ()
if (WIN32)
add_definitions (-D_CRT_SECURE_NO_WARNINGS)
diff --git a/config/cmake/hdf5-config.cmake.in b/config/cmake/hdf5-config.cmake.in
index 421f693..574f541 100644
--- a/config/cmake/hdf5-config.cmake.in
+++ b/config/cmake/hdf5-config.cmake.in
@@ -105,7 +105,13 @@ set (HDF5_VERSION_MINOR @HDF5_VERSION_MINOR@)
# project which has already built hdf5 as a subproject
#-----------------------------------------------------------------------------
if (NOT TARGET "@HDF5_PACKAGE@")
- include (@PACKAGE_SHARE_INSTALL_DIR@/@HDF5_PACKAGE@@HDF_PACKAGE_EXT@-targets.cmake)
+ if (${HDF5_PACKAGE_NAME}_ENABLE_Z_LIB_SUPPORT AND ${HDF5_PACKAGE_NAME}_PACKAGE_EXTLIBS AND NOT TARGET "zlib")
+ include (@PACKAGE_SHARE_INSTALL_DIR@/@ZLIB_PACKAGE_NAME@/@ZLIB_PACKAGE_NAME@@HDF_PACKAGE_EXT@-targets.cmake)
+ endif ()
+ if (${HDF5_PACKAGE_NAME}_ENABLE_SZIP_SUPPORT AND ${HDF5_PACKAGE_NAME}_PACKAGE_EXTLIBS AND NOT TARGET "szip")
+ include (@PACKAGE_SHARE_INSTALL_DIR@/@SZIP_PACKAGE_NAME@/@SZIP_PACKAGE_NAME@@HDF_PACKAGE_EXT@-targets.cmake)
+ endif ()
+ include (@PACKAGE_SHARE_INSTALL_DIR@/@HDF5_PACKAGE@/@HDF5_PACKAGE@@HDF_PACKAGE_EXT@-targets.cmake)
endif ()
# Handle default component(static) :
diff --git a/config/cmake/libhdf5.settings.cmake.in b/config/cmake/libhdf5.settings.cmake.in
index 28fb876..891e3a7 100644
--- a/config/cmake/libhdf5.settings.cmake.in
+++ b/config/cmake/libhdf5.settings.cmake.in
@@ -13,7 +13,7 @@ General Information:
Compiling Options:
------------------
- Build Mode: @HDF5_BUILD_TYPE@
+ Build Mode: @CMAKE_BUILD_TYPE@
Debugging Symbols: @SYMBOLS@
Asserts: @ASSERTS@
Profiling: @PROFILING@
diff --git a/config/cmake/scripts/CTestScript.cmake b/config/cmake/scripts/CTestScript.cmake
index 3cb9a5e..f826e31 100755
--- a/config/cmake/scripts/CTestScript.cmake
+++ b/config/cmake/scripts/CTestScript.cmake
@@ -64,13 +64,6 @@ if (APPLE)
set (ENV{CC} "${XCODE_CC}")
set (ENV{CXX} "${XCODE_CXX}")
- if (NOT NO_MAC_FORTRAN)
- # Shared fortran is not supported, build static
- set (BUILD_OPTIONS "${BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=OFF -DCMAKE_ANSI_CFLAGS:STRING=-fPIC")
- else ()
- set (BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF5_BUILD_FORTRAN:BOOL=OFF")
- endif ()
-
set (BUILD_OPTIONS "${BUILD_OPTIONS} -DCTEST_USE_LAUNCHERS:BOOL=ON -DCMAKE_BUILD_WITH_INSTALL_RPATH:BOOL=OFF")
endif ()
diff --git a/config/cmake/scripts/HDF5config.cmake b/config/cmake/scripts/HDF5config.cmake
index d32a6bdb..33d7868 100755
--- a/config/cmake/scripts/HDF5config.cmake
+++ b/config/cmake/scripts/HDF5config.cmake
@@ -32,10 +32,6 @@ cmake_minimum_required (VERSION 3.2.2 FATAL_ERROR)
# INSTALLDIR - root folder where hdf5 is installed
# CTEST_CONFIGURATION_TYPE - Release, Debug, etc
# CTEST_SOURCE_NAME - source folder
-# STATIC_ONLY - Build/use static libraries
-# FORTRAN_LIBRARIES - Build/use fortran libraries
-# JAVA_LIBRARIES - Build/use java libraries
-# NO_MAC_FORTRAN - Yes to be SHARED on a Mac
##############################################################################
set (CTEST_SOURCE_VERSION "1.11.2")
@@ -47,10 +43,6 @@ set (CTEST_SOURCE_VERSEXT "")
#INSTALLDIR - HDF5-1.10.0 root folder
#CTEST_CONFIGURATION_TYPE - Release, Debug, RelWithDebInfo
#CTEST_SOURCE_NAME - name of source folder; HDF5-1.10.0
-#STATIC_ONLY - Default is YES
-#FORTRAN_LIBRARIES - Default is NO
-#JAVA_LIBRARIES - Default is NO
-#NO_MAC_FORTRAN - set to TRUE to allow shared libs on a Mac
if (DEFINED CTEST_SCRIPT_ARG)
# transform ctest script arguments of the form
# script.ctest,var1=value1,var2=value2
@@ -70,6 +62,7 @@ endif ()
###################################################################
### Following Line is one of [Release, RelWithDebInfo, Debug] #####
+### (default use command line -C value)
set (CTEST_CONFIGURATION_TYPE "$ENV{CMAKE_CONFIG_TYPE}")
###################################################################
@@ -86,21 +79,6 @@ endif ()
if (NOT DEFINED CTEST_SOURCE_NAME)
set (CTEST_SOURCE_NAME "hdf5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}")
endif ()
-if (NOT DEFINED STATIC_ONLY)
- set (STATICONLYLIBRARIES "YES")
-else ()
- set (STATICONLYLIBRARIES "NO")
-endif ()
-if (NOT DEFINED FORTRAN_LIBRARIES)
- set (FORTRANLIBRARIES "NO")
-else ()
- set(FORTRANLIBRARIES "YES")
-endif ()
-if (NOT DEFINED JAVA_LIBRARIES)
- set (JAVALIBRARIES "NO")
-else ()
- set (JAVALIBRARIES "YES")
-endif ()
set (CTEST_BINARY_NAME "build")
set (CTEST_DASHBOARD_ROOT "${CTEST_SCRIPT_DIRECTORY}")
@@ -212,34 +190,6 @@ set (REPOSITORY_BRANCH "develop")
#set(CTEST_USE_TAR_SOURCE "${CTEST_SOURCE_VERSION}")
###################################################################
-###################################################################
-if (${STATICONLYLIBRARIES})
- set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=OFF")
- ######### Following describes computer ############
- ## following is optional to describe build ##
- set (SITE_BUILDNAME_SUFFIX "STATIC")
-endif ()
-###################################################################
-#### fortran ####
-if (${FORTRANLIBRARIES})
- set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_FORTRAN:BOOL=ON")
- ### enable Fortran 2003 depends on HDF5_BUILD_FORTRAN
- set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_F2003:BOOL=ON")
-else ()
- set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_FORTRAN:BOOL=OFF")
- ### enable Fortran 2003 depends on HDF5_BUILD_FORTRAN
- set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_F2003:BOOL=OFF")
-endif ()
-#### java ####
-if (${JAVALIBRARIES})
- set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_JAVA:BOOL=ON")
-else ()
- set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_JAVA:BOOL=OFF")
-endif ()
-
-### change install prefix
-set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DCMAKE_INSTALL_PREFIX:PATH=${INSTALLDIR}")
-set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DCTEST_CONFIGURATION_TYPE:STRING=$ENV{CMAKE_CONFIG_TYPE}")
###################################################################
diff --git a/config/cmake/scripts/HDF5options.cmake b/config/cmake/scripts/HDF5options.cmake
index b090434..82ab04a 100755
--- a/config/cmake/scripts/HDF5options.cmake
+++ b/config/cmake/scripts/HDF5options.cmake
@@ -21,6 +21,32 @@
#set(CMAKE_GENERATOR_TOOLSET "Intel C++ Compiler 17.0")
#############################################################################################
+#### Only build static libraries ####
+#set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=OFF")
+#### Add PICC option on linux/mac ####
+#set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DCMAKE_ANSI_CFLAGS:STRING=-fPIC")
+
+#############################################################################################
+#### fortran enabled ####
+#set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_FORTRAN:BOOL=ON")
+ ### enable Fortran 2003 depends on HDF5_BUILD_FORTRAN
+#set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_F2003:BOOL=ON")
+#### fortran disabled ####
+set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_FORTRAN:BOOL=OFF")
+ ### enable Fortran 2003 depends on HDF5_BUILD_FORTRAN
+set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_F2003:BOOL=OFF")
+
+#############################################################################################
+#### java enabled ####
+#set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_JAVA:BOOL=ON")
+#### java disabled ####
+set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_JAVA:BOOL=OFF")
+
+#############################################################################################
+### change install prefix (default use INSTALLDIR value)
+set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DCMAKE_INSTALL_PREFIX:PATH=${INSTALLDIR}")
+
+#############################################################################################
#### ext libraries ####
### ext libs from tgz
diff --git a/config/cmake_ext_mod/CheckTypeSize.cmake b/config/cmake_ext_mod/CheckTypeSize.cmake
deleted file mode 100644
index c14c2f2..0000000
--- a/config/cmake_ext_mod/CheckTypeSize.cmake
+++ /dev/null
@@ -1,61 +0,0 @@
-#
-# Copyright by The HDF Group.
-# All rights reserved.
-#
-# This file is part of HDF5. The full HDF5 copyright notice, including
-# terms governing use, modification, and redistribution, is contained in
-# the COPYING file, which can be found at the root of the source code
-# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases.
-# If you do not have access to either file, you may request a copy from
-# help@hdfgroup.org.
-#
-#
-# Check if the type exists and determine size of type. if the type
-# exists, the size will be stored to the variable.
-#
-# CHECK_TYPE_SIZE - macro which checks the size of type
-# VARIABLE - variable to store size if the type exists.
-# HAVE_${VARIABLE} - does the variable exists or not
-#
-
-macro (HDF_CHECK_TYPE_SIZE TYPE VARIABLE)
- set (CMAKE_ALLOW_UNKNOWN_VARIABLE_READ_ACCESS 1)
- if ("HAVE_${VARIABLE}" MATCHES "^HAVE_${VARIABLE}$")
- set (MACRO_CHECK_TYPE_SIZE_FLAGS
- "-DCHECK_TYPE_SIZE_TYPE=\"${TYPE}\" ${CMAKE_REQUIRED_FLAGS}"
- )
- foreach (def HAVE_SYS_TYPES_H HAVE_STDINT_H HAVE_STDDEF_H HAVE_INTTYPES_H)
- if ("${def}")
- set (MACRO_CHECK_TYPE_SIZE_FLAGS "${MACRO_CHECK_TYPE_SIZE_FLAGS} -D${def}")
- endif ()
- endforeach ()
-
- message (STATUS "Check size of ${TYPE}")
- if (CMAKE_REQUIRED_LIBRARIES)
- set (CHECK_TYPE_SIZE_ADD_LIBRARIES
- "-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}"
- )
- endif ()
- try_run (${VARIABLE} HAVE_${VARIABLE}
- ${CMAKE_BINARY_DIR}
- ${HDF_RESOURCES_EXT_DIR}/CheckTypeSize.c
- CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_TYPE_SIZE_FLAGS}
- "${CHECK_TYPE_SIZE_ADD_LIBRARIES}"
- OUTPUT_VARIABLE OUTPUT
- )
- if (HAVE_${VARIABLE})
- message (STATUS "Check size of ${TYPE} - done")
- file (APPEND
- ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeOutput.log
- "Determining size of ${TYPE} passed with the following output:\n${OUTPUT}\n\n"
- )
- else ()
- message (STATUS "Check size of ${TYPE} - failed")
- file (APPEND
- ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log
- "Determining size of ${TYPE} failed with the following output:\n${OUTPUT}\n\n"
- )
- endif ()
- endif ()
- set (CMAKE_ALLOW_UNKNOWN_VARIABLE_READ_ACCESS)
-endmacro ()
diff --git a/config/cmake_ext_mod/ConfigureChecks.cmake b/config/cmake_ext_mod/ConfigureChecks.cmake
index 56d45f9..3797768 100644
--- a/config/cmake_ext_mod/ConfigureChecks.cmake
+++ b/config/cmake_ext_mod/ConfigureChecks.cmake
@@ -12,18 +12,18 @@
#-----------------------------------------------------------------------------
# Include all the necessary files for macros
#-----------------------------------------------------------------------------
-include (${CMAKE_ROOT}/Modules/CheckFunctionExists.cmake)
-include (${CMAKE_ROOT}/Modules/CheckIncludeFile.cmake)
-include (${CMAKE_ROOT}/Modules/CheckIncludeFileCXX.cmake)
-include (${CMAKE_ROOT}/Modules/CheckIncludeFiles.cmake)
-include (${CMAKE_ROOT}/Modules/CheckLibraryExists.cmake)
-include (${CMAKE_ROOT}/Modules/CheckSymbolExists.cmake)
-include (${CMAKE_ROOT}/Modules/CheckTypeSize.cmake)
-include (${CMAKE_ROOT}/Modules/CheckVariableExists.cmake)
-include (${CMAKE_ROOT}/Modules/CheckFortranFunctionExists.cmake)
-include (${CMAKE_ROOT}/Modules/TestBigEndian.cmake)
+include (CheckFunctionExists)
+include (CheckIncludeFile)
+include (CheckIncludeFileCXX)
+include (CheckIncludeFiles)
+include (CheckLibraryExists)
+include (CheckSymbolExists)
+include (CheckTypeSize)
+include (CheckVariableExists)
+include (CheckFortranFunctionExists)
+include (TestBigEndian)
if (CMAKE_CXX_COMPILER AND CMAKE_CXX_COMPILER_LOADED)
- include (${CMAKE_ROOT}/Modules/TestForSTDNamespace.cmake)
+ include (TestForSTDNamespace)
endif ()
#-----------------------------------------------------------------------------
@@ -145,7 +145,7 @@ endif ()
# For other specific tests, use this MACRO.
macro (HDF_FUNCTION_TEST OTHER_TEST)
- if ("${HDF_PREFIX}_${OTHER_TEST}" MATCHES "^${HDF_PREFIX}_${OTHER_TEST}$")
+ if (NOT DEFINED ${HDF_PREFIX}_${OTHER_TEST})
set (MACRO_CHECK_FUNCTION_DEFINITIONS "-D${OTHER_TEST} ${CMAKE_REQUIRED_FLAGS}")
set (OTHER_TEST_ADD_LIBRARIES)
if (CMAKE_REQUIRED_LIBRARIES)
@@ -587,7 +587,7 @@ endif ()
# For other CXX specific tests, use this MACRO.
macro (HDF_CXX_FUNCTION_TEST OTHER_TEST)
- if ("${OTHER_TEST}" MATCHES "^${OTHER_TEST}$")
+ if (NOT DEFINED ${OTHER_TEST})
set (MACRO_CHECK_FUNCTION_DEFINITIONS "-D${OTHER_TEST} ${CMAKE_REQUIRED_FLAGS}")
set (OTHER_TEST_ADD_LIBRARIES)
if (CMAKE_REQUIRED_LIBRARIES)
@@ -656,7 +656,7 @@ endif ()
if (WINDOWS)
if (NOT HDF_NO_IOEO_TEST)
message (STATUS "Checking for InitOnceExecuteOnce:")
- if ("${${HDF_PREFIX}_HAVE_IOEO}" MATCHES "^${${HDF_PREFIX}_HAVE_IOEO}$")
+ if (NOT DEFINED ${${HDF_PREFIX}_HAVE_IOEO})
if (LARGEFILE)
set (CMAKE_REQUIRED_DEFINITIONS
"${CURRENT_TEST_DEFINITIONS} -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE"
diff --git a/config/cmake_ext_mod/HDFMacros.cmake b/config/cmake_ext_mod/HDFMacros.cmake
index 870ff5a..4097ca9 100644
--- a/config/cmake_ext_mod/HDFMacros.cmake
+++ b/config/cmake_ext_mod/HDFMacros.cmake
@@ -124,8 +124,8 @@ macro (HDF_SET_LIB_OPTIONS libtarget libname libtype)
set_target_properties (${libtarget}
PROPERTIES
-# OUTPUT_NAME
-# ${LIB_RELEASE_NAME}$<$<CONFIG:Debug>:${LIB_DEBUG_SUFFIX}>
+ OUTPUT_NAME
+ ${LIB_RELEASE_NAME}
OUTPUT_NAME_DEBUG
${LIB_DEBUG_NAME}
OUTPUT_NAME_RELEASE
@@ -166,7 +166,7 @@ macro (HDF_IMPORT_SET_LIB_OPTIONS libtarget libname libtype libversion)
if (${importtype} MATCHES "IMPORT")
set (importprefix "${CMAKE_STATIC_LIBRARY_PREFIX}")
endif ()
- if (${HDF_CFG_NAME} MATCHES "Debug")
+ if (${CMAKE_BUILD_TYPE} MATCHES "Debug")
set (IMPORT_LIB_NAME ${LIB_DEBUG_NAME})
else ()
set (IMPORT_LIB_NAME ${LIB_RELEASE_NAME})
@@ -331,3 +331,85 @@ macro (HDFTEST_COPY_FILE src dest target)
)
list (APPEND ${target}_list "${dest}")
endmacro ()
+
+macro (HDF_DIR_PATHS package_prefix)
+ if (APPLE)
+ option (${package_prefix}_BUILD_FRAMEWORKS "TRUE to build as frameworks libraries, FALSE to build according to BUILD_SHARED_LIBS" FALSE)
+ endif ()
+
+ if (NOT ${package_prefix}_INSTALL_BIN_DIR)
+ set (${package_prefix}_INSTALL_BIN_DIR bin)
+ endif ()
+ if (NOT ${package_prefix}_INSTALL_LIB_DIR)
+ if (APPLE)
+ if (${package_prefix}_BUILD_FRAMEWORKS)
+ set (${package_prefix}_INSTALL_JAR_DIR ../Java)
+ else ()
+ set (${package_prefix}_INSTALL_JAR_DIR lib)
+ endif ()
+ set (${package_prefix}_INSTALL_FMWK_DIR ${CMAKE_INSTALL_FRAMEWORK_PREFIX})
+ else ()
+ set (${package_prefix}_INSTALL_JAR_DIR lib)
+ endif ()
+ set (${package_prefix}_INSTALL_LIB_DIR lib)
+ endif ()
+ if (NOT ${package_prefix}_INSTALL_INCLUDE_DIR)
+ set (${package_prefix}_INSTALL_INCLUDE_DIR include)
+ endif ()
+ if (NOT ${package_prefix}_INSTALL_DATA_DIR)
+ if (NOT WIN32)
+ if (APPLE)
+ if (${package_prefix}_BUILD_FRAMEWORKS)
+ set (${package_prefix}_INSTALL_EXTRA_DIR ../SharedSupport)
+ else ()
+ set (${package_prefix}_INSTALL_EXTRA_DIR share)
+ endif ()
+ set (${package_prefix}_INSTALL_FWRK_DIR ${CMAKE_INSTALL_FRAMEWORK_PREFIX})
+ endif ()
+ set (${package_prefix}_INSTALL_DATA_DIR share)
+ set (${package_prefix}_INSTALL_CMAKE_DIR share/cmake)
+ else ()
+ set (${package_prefix}_INSTALL_DATA_DIR ".")
+ set (${package_prefix}_INSTALL_CMAKE_DIR cmake)
+ endif ()
+ endif ()
+
+ if (DEFINED ADDITIONAL_CMAKE_PREFIX_PATH AND EXISTS "${ADDITIONAL_CMAKE_PREFIX_PATH}")
+ set (CMAKE_PREFIX_PATH ${ADDITIONAL_CMAKE_PREFIX_PATH} ${CMAKE_PREFIX_PATH})
+ endif ()
+
+ SET_HDF_BUILD_TYPE()
+
+#-----------------------------------------------------------------------------
+# Setup output Directories
+#-----------------------------------------------------------------------------
+ if (NOT ${package_prefix}_EXTERNALLY_CONFIGURED)
+ set (CMAKE_RUNTIME_OUTPUT_DIRECTORY
+ ${PROJECT_BINARY_DIR}/bin CACHE PATH "Single Directory for all Executables."
+ )
+ set (CMAKE_LIBRARY_OUTPUT_DIRECTORY
+ ${PROJECT_BINARY_DIR}/bin CACHE PATH "Single Directory for all Libraries"
+ )
+ set (CMAKE_ARCHIVE_OUTPUT_DIRECTORY
+ ${PROJECT_BINARY_DIR}/bin CACHE PATH "Single Directory for all static libraries."
+ )
+ set (CMAKE_Fortran_MODULE_DIRECTORY
+ ${PROJECT_BINARY_DIR}/bin CACHE PATH "Single Directory for all fortran modules."
+ )
+ if (WIN32)
+ set (CMAKE_TEST_OUTPUT_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CTEST_CONFIGURATION_TYPE})
+ set (CMAKE_PDB_OUTPUT_DIRECTORY
+ ${PROJECT_BINARY_DIR}/bin CACHE PATH "Single Directory for all pdb files."
+ )
+ else ()
+ set (CMAKE_TEST_OUTPUT_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CTEST_CONFIGURATION_TYPE})
+ endif ()
+ else ()
+ # if we are externally configured, but the project uses old cmake scripts
+ # this may not be set and utilities like H5detect will fail
+ if (NOT CMAKE_RUNTIME_OUTPUT_DIRECTORY)
+ set (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${EXECUTABLE_OUTPUT_PATH})
+ endif ()
+ endif ()
+endmacro ()
+
diff --git a/config/cmake_ext_mod/HDFTests.c b/config/cmake_ext_mod/HDFTests.c
index 60ac744..320fd5b 100644
--- a/config/cmake_ext_mod/HDFTests.c
+++ b/config/cmake_ext_mod/HDFTests.c
@@ -222,12 +222,26 @@ SIMPLE_TEST(struct stat sb; sb.st_blocks=0);
#include <stdlib.h>
#include <string.h>
+#if defined(_MSC_VER) && defined(_DEBUG)
+# include <crtdbg.h>
+int DebugReport(int reportType, char* message, int* returnValue)
+{
+ (void)reportType;
+ (void)message;
+ (void)returnValue;
+ return 1; /* no further handling required */
+}
+#endif
+
int main(void)
{
char *llwidthArgs[] = { "I64", "l64", "l", "L", "q", "ll", NULL };
char *s = malloc(128);
char **currentArg = NULL;
LL_TYPE x = (LL_TYPE)1048576 * (LL_TYPE)1048576;
+ #if defined(_MSC_VER) && defined(_DEBUG)
+ _CrtSetReportHook(DebugReport);
+ #endif
for (currentArg = llwidthArgs; *currentArg != NULL; currentArg++)
{
char formatString[64];
diff --git a/configure.ac b/configure.ac
index 6bd650f..98c97cc 100644
--- a/configure.ac
+++ b/configure.ac
@@ -48,7 +48,7 @@ m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) # use silent rules where a
##
## By default, it is enabled. Users can configure with
## --disable-maintainer-mode to prevent running the autotools.
-AM_MAINTAINER_MODE([disable])
+AM_MAINTAINER_MODE([enable])
## ----------------------------------------------------------------------
## Set prefix default (install directory) to a directory in the build area.
diff --git a/fortran/CMakeLists.txt b/fortran/CMakeLists.txt
index 075e1da..a0f92d3 100644
--- a/fortran/CMakeLists.txt
+++ b/fortran/CMakeLists.txt
@@ -10,21 +10,21 @@ endif ()
#-----------------------------------------------------------------------------
# Traverse source subdirectory
#-----------------------------------------------------------------------------
-add_subdirectory (${HDF5_F90_SOURCE_DIR}/src ${HDF5_F90_BINARY_DIR}/src)
+add_subdirectory (src)
#-----------------------------------------------------------------------------
# Build the Fortran Examples
#-----------------------------------------------------------------------------
if (HDF5_BUILD_EXAMPLES)
- add_subdirectory (${HDF5_F90_SOURCE_DIR}/examples ${HDF5_F90_BINARY_DIR}/examples)
+ add_subdirectory (examples)
endif ()
#-----------------------------------------------------------------------------
# Testing
#-----------------------------------------------------------------------------
if (BUILD_TESTING)
- add_subdirectory (${HDF5_F90_SOURCE_DIR}/test ${HDF5_F90_BINARY_DIR}/test)
+ add_subdirectory (test)
if (MPI_Fortran_FOUND)
- add_subdirectory (${HDF5_F90_SOURCE_DIR}/testpar ${HDF5_F90_BINARY_DIR}/testpar)
+ add_subdirectory (testpar)
endif ()
endif ()
diff --git a/fortran/src/CMakeLists.txt b/fortran/src/CMakeLists.txt
index b664c50..5446616 100644
--- a/fortran/src/CMakeLists.txt
+++ b/fortran/src/CMakeLists.txt
@@ -78,22 +78,20 @@ add_executable (H5match_types
${HDF5_F90_BINARY_DIR}/H5fort_type_defines.h
${HDF5_F90_SRC_SOURCE_DIR}/H5match_types.c
)
-set (CMD $<TARGET_FILE:H5match_types>)
add_custom_command (
OUTPUT ${HDF5_F90_BINARY_DIR}/static/H5f90i_gen.h
${HDF5_F90_BINARY_DIR}/static/H5fortran_types.F90
- COMMAND ${CMD}
+ COMMAND $<TARGET_FILE:H5match_types>
WORKING_DIRECTORY ${HDF5_F90_BINARY_DIR}/static
DEPENDS H5match_types
)
set_source_files_properties (${HDF5_F90_BINARY_DIR}/static/H5f90i_gen.h PROPERTIES GENERATED TRUE)
set_source_files_properties (${HDF5_F90_BINARY_DIR}/static/H5fortran_types.F90 PROPERTIES GENERATED TRUE)
if (BUILD_SHARED_LIBS)
- set (CMDSH $<TARGET_FILE:H5match_types>)
add_custom_command (
OUTPUT ${HDF5_F90_BINARY_DIR}/shared/H5f90i_gen.h
${HDF5_F90_BINARY_DIR}/shared/H5fortran_types.F90
- COMMAND ${CMDSH}
+ COMMAND $<TARGET_FILE:H5match_types>
WORKING_DIRECTORY ${HDF5_F90_BINARY_DIR}/shared
DEPENDS H5match_types
)
@@ -171,10 +169,9 @@ set (f90_F_GEN_SOURCES
${HDF5_F90_SRC_SOURCE_DIR}/H5Dff.F90
${HDF5_F90_SRC_SOURCE_DIR}/H5Pff.F90
)
-set (CMD $<TARGET_FILE:H5_buildiface>)
add_custom_command (
OUTPUT ${HDF5_F90_BINARY_DIR}/static/H5_gen.F90
- COMMAND ${CMD}
+ COMMAND $<TARGET_FILE:H5_buildiface>
WORKING_DIRECTORY ${HDF5_F90_BINARY_DIR}/static
DEPENDS ${f90_F_GEN_SOURCES}
COMMENT "Generating the H5_gen.F90 file"
@@ -185,10 +182,9 @@ add_custom_target (H5gen ALL
set_source_files_properties (${HDF5_F90_BINARY_DIR}/static/H5_gen.F90 PROPERTIES GENERATED TRUE)
if (BUILD_SHARED_LIBS)
- set (CMDSH $<TARGET_FILE:H5_buildiface>)
add_custom_command (
OUTPUT ${HDF5_F90_BINARY_DIR}/shared/H5_gen.F90
- COMMAND ${CMDSH}
+ COMMAND $<TARGET_FILE:H5_buildiface>
WORKING_DIRECTORY ${HDF5_F90_BINARY_DIR}/shared
DEPENDS ${f90_F_GEN_SOURCES}
COMMENT "Generating the H5_gen.F90 shared file"
diff --git a/fortran/src/H5Df.c b/fortran/src/H5Df.c
index 588ea9f..14fac6b 100644
--- a/fortran/src/H5Df.c
+++ b/fortran/src/H5Df.c
@@ -567,7 +567,7 @@ DONE:
* dims - one-demnsional array of size 2
* dims[0] = MAXLENGTH
* dims[1] = number of elements of VL type
- * len - array element lenghts
+ * len - array element lengths
* RETURNS
* 0 on success, -1 on failure
* AUTHOR
@@ -641,7 +641,7 @@ DONE:
* dims[1] = number of elements of VL type
* OUTPUTS
* buf - data buffer
- * len - array element lenghts
+ * len - array element lengths
* RETURNS
* 0 on success, -1 on failure
* AUTHOR
@@ -882,7 +882,7 @@ h5dread_vl_string_c( hid_t_f *dset_id , hid_t_f *mem_type_id, hid_t_f *mem_spac
* dims - one-demnsional array of size 2
* dims[0] = MAXLENGTH
* dims[1] = number of elements of VL type
- * len - array element lenghts
+ * len - array element lengths
* RETURNS
* 0 on success, -1 on failure
* AUTHOR
@@ -956,7 +956,7 @@ DONE:
* dims[1] = number of elements of VL type
* OUTPUTS
* buf - data buffer
- * len - array element lenghts
+ * len - array element lengths
* RETURNS
* 0 on success, -1 on failure
* AUTHOR
@@ -1209,7 +1209,7 @@ h5dwrite_f_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id,
* dims[1] = number of elements of VL type
* OUTPUTS
* buf - data buffer
- * len - array element lenghts
+ * len - array element lengths
* RETURNS
* 0 on success, -1 on failure
* AUTHOR
diff --git a/fortran/src/H5Gf.c b/fortran/src/H5Gf.c
index 720bd49..b829b20 100644
--- a/fortran/src/H5Gf.c
+++ b/fortran/src/H5Gf.c
@@ -47,7 +47,7 @@
*/
int_f
h5gcreate_c(hid_t_f *loc_id, _fcd name, int_f *namelen, size_t_f *size_hint,
- hid_t_f *grp_id, hid_t_f *lcpl_id, hid_t_f *gcpl_id, hid_t_f *gapl_id )
+ hid_t_f *grp_id, hid_t_f *lcpl_id, hid_t_f *gcpl_id, hid_t_f *gapl_id )
/******/
{
hid_t c_gcpl_id = -1; /* Group creation property list */
@@ -69,11 +69,11 @@ h5gcreate_c(hid_t_f *loc_id, _fcd name, int_f *namelen, size_t_f *size_hint,
else {
/* Create the group creation property list */
if((c_gcpl_id = H5Pcreate(H5P_GROUP_CREATE)) < 0)
- goto DONE;
+ goto DONE;
/* Set the local heap size hint */
if(H5Pset_local_heap_size_hint(c_gcpl_id, (size_t)*size_hint) < 0)
- goto DONE;
+ goto DONE;
/* Create the group */
c_grp_id = H5Gcreate2((hid_t)*loc_id, c_name, H5P_DEFAULT, c_gcpl_id, H5P_DEFAULT);
@@ -308,9 +308,9 @@ h5gclose_c(hid_t_f *grp_id)
* link_type - link type
* current_name - name of the existing object for hard link,
* anything for the soft link
- * current_namelen - current name lenghth
+ * current_namelen - current name length
* new_name - new name for the object
- * new_namelen - new_name lenghth
+ * new_namelen - new_name length
* RETURNS
* 0 on success, -1 on failure
* AUTHOR
@@ -365,7 +365,7 @@ h5glink_c(hid_t_f *loc_id, int_f *link_type, _fcd current_name,
goto DONE;
break;
/* End of the warnings fix */
-
+
default: /* Unknown/unhandled link type */
goto DONE;
} /* end switch */
@@ -390,12 +390,12 @@ DONE:
* cur_name - name of the existing object for hard link releative
* to cur_loc_id location,
* anything for the soft link
- * current_namelen - current name lenghth
+ * current_namelen - current name length
* link_type - link type
* new_loc_id - location identifier
* new_name - new name for the object releative to the new_loc_id
* location
- * new_namelen - new_name lenghth
+ * new_namelen - new_name length
* RETURNS
* 0 on success, -1 on failure
* AUTHOR
@@ -515,9 +515,9 @@ DONE:
* INPUTS
* loc_id - identifier of file or group
* src_name - name of the original object
- * src_namelen - original name lenghth
+ * src_namelen - original name length
* dst_name - new name for the object
- * dst_namelen - new name lenghth
+ * dst_namelen - new name length
* RETURNS
* 0 on success, -1 on failure
* AUTHOR
@@ -565,10 +565,10 @@ DONE:
* INPUTS
* src_loc_id - identifier of file or group
* src_name - name of the original object relative to src_loc_id
- * src_namelen - original name lenghth
+ * src_namelen - original name length
* dst_loc_id - new location identifier
* dst_name - new name for the object relative to dst_loc_id
- * dst_namelen - new name lenghth
+ * dst_namelen - new name length
* RETURNS
* 0 on success, -1 on failure
* AUTHOR
@@ -617,8 +617,8 @@ DONE:
* INPUTS
* loc_id - identifier of file or group
* name - name of the object that symbolic link points to
- * namelen - the name lenghth
- * size - lenghth of retrurned value
+ * namelen - the name length
+ * size - length of retrurned value
* OUTPUTS
* value - name to be returned
* RETURNS
@@ -681,9 +681,9 @@ DONE:
* INPUTS
* loc_id - identifier of file or group
* name - name of object whose comment is to be set or reset
- * namelen - the name lenghth
+ * namelen - the name length
* comment - the new comment
- * commentlen - new comment lenghth
+ * commentlen - new comment length
* RETURNS
* 0 on success, -1 on failure
* AUTHOR
@@ -732,7 +732,7 @@ DONE:
* INPUTS
* loc_id - identifier of file or group
* name - name of object whose comment is to be set or reset
- * namelen - the name lenghth
+ * namelen - the name length
* bufsize - at most bufsize characters
* comment - the new comment
* RETURNS
@@ -948,8 +948,8 @@ done:
*/
int_f
h5gget_info_by_idx_c(hid_t_f *loc_id, _fcd group_name, size_t_f *group_namelen,
- int_f *index_type, int_f *order, hsize_t_f *n, hid_t_f *lapl_id,
- int_f *storage_type, int_f *nlinks, int_f *max_corder, int_f *mounted )
+ int_f *index_type, int_f *order, hsize_t_f *n, hid_t_f *lapl_id,
+ int_f *storage_type, int_f *nlinks, int_f *max_corder, int_f *mounted )
/******/
{
char *c_group_name = NULL; /* Buffer to hold group name C string */
@@ -965,7 +965,7 @@ h5gget_info_by_idx_c(hid_t_f *loc_id, _fcd group_name, size_t_f *group_namelen,
* Call H5Gget_info_by_idx function.
*/
if(H5Gget_info_by_idx((hid_t)*loc_id,c_group_name, (H5_index_t)*index_type,(H5_iter_order_t)*order,(hsize_t)*n,
- &ginfo, (hid_t)*lapl_id) < 0)
+ &ginfo, (hid_t)*lapl_id) < 0)
HGOTO_DONE(FAIL);
/* Unpack the structure */
@@ -1018,7 +1018,7 @@ h5gget_info_by_idx_c(hid_t_f *loc_id, _fcd group_name, size_t_f *group_namelen,
*/
int_f
h5gget_info_by_name_c(hid_t_f *loc_id, _fcd group_name, size_t_f *group_namelen, hid_t_f *lapl_id,
- int_f *storage_type, int_f *nlinks, int_f *max_corder, int_f *mounted)
+ int_f *storage_type, int_f *nlinks, int_f *max_corder, int_f *mounted)
/******/
{
char *c_group_name = NULL; /* Buffer to hold group name C string */
diff --git a/fortran/src/H5Pf.c b/fortran/src/H5Pf.c
index a114e8b..9fdd19b 100644
--- a/fortran/src/H5Pf.c
+++ b/fortran/src/H5Pf.c
@@ -2638,7 +2638,7 @@ h5pget_hyper_vector_size_c ( hid_t_f *prp_id , size_t_f *size)
* INPUTS
* parent - property list class identifier
* name - name of the new class
- * name_len - lenght of the "name" buffer
+ * name_len - length of the "name" buffer
* OUTPUTS
* class - new class identifier
* RETURNS
@@ -3415,8 +3415,8 @@ h5pset_family_offset_c ( hid_t_f *prp_id , hsize_t_f *offset)
* mem_map - memory mapping array
* memb_fapl - property list for each memory usage type
* memb_name - array with members names
- * len - array with the lenght of each name
- * lenmax - lenght of the name a sdeclared in Fortran
+ * len - array with the length of each name
+ * lenmax - length of the name a sdeclared in Fortran
* flag - flag allowing partila access when one of the files is missing
* RETURNS
* 0 on success, -1 on failure
@@ -3537,12 +3537,12 @@ h5pset_fapl_multi_sc ( hid_t_f *prp_id , int_f *flag)
* Call H5Pget_fapl_multi to set multi file dirver
* INPUTS
* prp_id - file_creation property list identifier
- * lenmax - lenght of the name a sdeclared in Fortran
+ * lenmax - length of the name a sdeclared in Fortran
* OUTPUTS
* memb_map - memory mapping array
* memb_fapl - property list for each memory usage type
* memb_name - array with members names
- * len - array with the lenght of each name
+ * len - array with the length of each name
* flag - flag allowing partila access when one of the files is missing
* RETURNS
* 0 on success, -1 on failure
diff --git a/fortran/src/H5Pff.F90 b/fortran/src/H5Pff.F90
index b69d4d0..178aa80 100644
--- a/fortran/src/H5Pff.F90
+++ b/fortran/src/H5Pff.F90
@@ -5313,7 +5313,7 @@ CONTAINS
!
! expression - buffer to hold transform expression
! hdferr - Error code
-! Success: Actual lenght of the expression
+! Success: Actual length of the expression
! If provided buffer "expression" is
! smaller, than expression will be
! truncated to fit into
diff --git a/fortran/src/H5Rff.F90 b/fortran/src/H5Rff.F90
index 6d6371b..f5a9c6e 100644
--- a/fortran/src/H5Rff.F90
+++ b/fortran/src/H5Rff.F90
@@ -38,7 +38,7 @@
!
!*****
-MODULE H5R
+MODULE H5R
USE, INTRINSIC :: ISO_C_BINDING, ONLY : C_PTR, C_CHAR, C_SIGNED_CHAR
USE H5GLOBAL
@@ -62,7 +62,7 @@ MODULE H5R
END INTERFACE
- TYPE :: hdset_reg_ref_t_f03
+ TYPE :: hdset_reg_ref_t_f03
INTEGER(C_SIGNED_CHAR), DIMENSION(1:H5R_DSET_REG_REF_BUF_SIZE_F) :: ref
END TYPE hdset_reg_ref_t_f03
@@ -165,16 +165,16 @@ CONTAINS
! Retrieves the type of object that an object reference points to.
!
! INPUTS
-! dset_id - identifier of the dataset containing
+! dset_id - identifier of the dataset containing
! reference to the objects
-! ref - reference to open
+! ref - reference to open
! OUTPUTS
-! obj_type - object_type, possible values:
+! obj_type - object_type, possible values:
! H5G_UNKNOWN_F
-! H5G_GROUP_F
+! H5G_GROUP_F
! H5G_DATASET_F
! H5G_TYPE_F
-! hdferr - Returns 0 if successful and -1 if fails
+! hdferr - Returns 0 if successful and -1 if fails
!
! AUTHOR
! Elena Pourmal
@@ -227,17 +227,17 @@ CONTAINS
! Retrieves a dataspace with the specified region selected
!
! INPUTS
-! dset_id - identifier of the dataset containing
+! dset_id - identifier of the dataset containing
! reference to the regions
-! ref - reference to open
+! ref - reference to open
! OUTPUTS
-! space_id - dataspace identifier
-! hdferr - Returns 0 if successful and -1 if fails
+! space_id - dataspace identifier
+! hdferr - Returns 0 if successful and -1 if fails
! AUTHOR
! Elena Pourmal
! August 12, 1999
!
-! HISTORY
+! HISTORY
! Explicit Fortran interfaces were added for
! called C functions (it is needed for Windows
! port). February 28, 2001
@@ -276,16 +276,16 @@ CONTAINS
! h5rget_region_ptr_f
!
! PURPOSE
-! Retrieves a dataspace with the specified region
+! Retrieves a dataspace with the specified region
! selected using pointer
!
! INPUTS
-! dset_id - identifier of the dataset containing
+! dset_id - identifier of the dataset containing
! reference to the regions
-! ref - reference to open
+! ref - reference to open
! OUTPUTS
-! space_id - dataspace identifier
-! hdferr - Returns 0 if successful and -1 if fails
+! space_id - dataspace identifier
+! hdferr - Returns 0 if successful and -1 if fails
! AUTHOR
! M. Scot Breitenfeld
! August 4, 2012
@@ -319,7 +319,7 @@ CONTAINS
! loc_id - location identifier
! name - name of the object at the specified location
! Outputs:
-! ref - reference to the specified object
+! ref - reference to the specified object
! hdferr - returns 0 if successful and -1 if fails
! AUTHOR
! Elena Pourmal
@@ -363,11 +363,11 @@ CONTAINS
! Creates reference to the dataset region
!
! INPUTS
-! loc_id - location identifier
-! name - name of the dataset at the specified location
-! space_id - dataspace identifier that describes selected region
+! loc_id - location identifier
+! name - name of the dataset at the specified location
+! space_id - dataspace identifier that describes selected region
! OUTPUTS
-! ref - reference to the dataset region
+! ref - reference to the dataset region
! hdferr - returns 0 if successful and -1 if fails
! AUTHOR
! Elena Pourmal
@@ -424,12 +424,12 @@ CONTAINS
!
! Inputs:
! loc_id - location identifier
-! name - name of the dataset at the specified location
+! name - name of the dataset at the specified location
! ref_type - type of reference:
! H5R_OBJECT
! H5T_STD_REF_DSETREG
! Outputs:
-! ref - reference created by the function call.
+! ref - reference created by the function call.
! hdferr - returns 0 if successful and -1 if fails.
! OPTIONAL
! space_id - dataspace identifier that describes selected region
@@ -474,7 +474,7 @@ CONTAINS
! Inputs:
! dset_id - identifier of the dataset containing
! reference
-! ref - reference to open
+! ref - reference to open
! Outputs:
! obj_id - object_identifier
! hdferr - returns 0 if successful and -1 if fails
@@ -515,8 +515,8 @@ CONTAINS
!
! Inputs:
! dset_id - identifier of the dataset containing
-! reference to teh regions
-! ref - reference to open
+! reference to the regions
+! ref - reference to open
! Outputs:
! obj_id - dataspace identifier
! hdferr - returns 0 if successful and -1 if fails
@@ -585,7 +585,7 @@ CONTAINS
INTEGER(HID_T), INTENT(OUT) :: ref_obj_id
! Identifier of referenced object
INTEGER, INTENT(OUT) :: hdferr ! Error code
-!*****
+!*****
hdferr = h5rdereference_ptr_c(obj_id, ref_type, ref, ref_obj_id)
END SUBROUTINE h5rdereference_ptr_f
@@ -600,14 +600,14 @@ CONTAINS
!
! Inputs:
! loc_id - Identifier for the file containing the reference or for any object in that file.
-! ref - An object or dataset region reference.
+! ref - An object or dataset region reference.
!
! Outputs:
! name - A name associated with the referenced object or dataset region.
! hdferr - Returns 0 if successful and -1 if fails.
!
! Optional parameters:
-! size - The size of the name buffer, returning 0 (zero) if no name is associated
+! size - The size of the name buffer, returning 0 (zero) if no name is associated
! with the identifier.
!
! AUTHOR
@@ -648,7 +648,7 @@ CONTAINS
!
! Inputs:
! loc_id - Identifier for the file containing the reference or for any object in that file.
-! ref - An object or dataset region reference.
+! ref - An object or dataset region reference.
!
! Outputs:
! name - A name associated with the referenced object or dataset region.
@@ -747,12 +747,12 @@ CONTAINS
! ref - Reference to query.
!
! Outputs:
- ! obj_type - Type of referenced object.
+ ! obj_type - Type of referenced object.
! H5G_UNKNOWN_F
! H5G_GROUP_F
! H5G_DATASET_F
! H5G_TYPE_F
- !
+ !
! hdferr - Returns 0 if successful and -1 if fails.
!
! AUTHOR
diff --git a/fortran/test/CMakeLists.txt b/fortran/test/CMakeLists.txt
index 2990bcc..86f7a12 100644
--- a/fortran/test/CMakeLists.txt
+++ b/fortran/test/CMakeLists.txt
@@ -74,10 +74,9 @@ if (BUILD_SHARED_LIBS)
)
endif ()
-set (CMD $<TARGET_FILE:H5_test_buildiface>)
add_custom_command (
OUTPUT ${HDF5_FORTRAN_TESTS_BINARY_DIR}/static/tf_gen.F90
- COMMAND ${CMD}
+ COMMAND $<TARGET_FILE:H5_test_buildiface>
WORKING_DIRECTORY ${HDF5_FORTRAN_TESTS_BINARY_DIR}/static
DEPENDS H5_test_buildiface
COMMENT "Generating the tf_gen.F90 file"
@@ -88,10 +87,9 @@ add_custom_target (H5testgen ALL
set_source_files_properties (${HDF5_FORTRAN_TESTS_BINARY_DIR}/static/tf_gen.F90 PROPERTIES GENERATED TRUE)
if (BUILD_SHARED_LIBS)
- set (CMDSH $<TARGET_FILE:H5_test_buildiface>)
add_custom_command (
OUTPUT ${HDF5_FORTRAN_TESTS_BINARY_DIR}/shared/tf_gen.F90
- COMMAND ${CMDSH}
+ COMMAND $<TARGET_FILE:H5_test_buildiface>
WORKING_DIRECTORY ${HDF5_FORTRAN_TESTS_BINARY_DIR}/shared
DEPENDS H5_test_buildiface
COMMENT "Generating the tf_gen.F90 shared file"
diff --git a/hl/CMakeLists.txt b/hl/CMakeLists.txt
index a47e023..d80b4f9 100644
--- a/hl/CMakeLists.txt
+++ b/hl/CMakeLists.txt
@@ -12,21 +12,21 @@ add_definitions (${HDF_EXTRA_C_FLAGS})
#-----------------------------------------------------------------------------
INCLUDE_DIRECTORIES (${HDF5_HL_SOURCE_DIR}/src )
-add_subdirectory (${HDF5_HL_SOURCE_DIR}/src ${HDF5_HL_BINARY_DIR}/src)
+add_subdirectory (src)
#-- Build the High level Tools
if (HDF5_BUILD_TOOLS)
- add_subdirectory (${HDF5_HL_SOURCE_DIR}/tools ${HDF5_HL_BINARY_DIR}/tools)
+ add_subdirectory (tools)
endif ()
#-- Add High Level Examples
if (HDF5_BUILD_EXAMPLES)
- add_subdirectory (${HDF5_HL_SOURCE_DIR}/examples ${HDF5_HL_BINARY_DIR}/examples)
+ add_subdirectory (examples)
endif ()
#-- Build the Unit testing if requested
if (NOT HDF5_EXTERNALLY_CONFIGURED)
if (BUILD_TESTING)
- add_subdirectory (${HDF5_HL_SOURCE_DIR}/test ${HDF5_HL_BINARY_DIR}/test)
+ add_subdirectory (test)
endif ()
endif ()
diff --git a/hl/c++/CMakeLists.txt b/hl/c++/CMakeLists.txt
index 91bfa14..9a1d059 100644
--- a/hl/c++/CMakeLists.txt
+++ b/hl/c++/CMakeLists.txt
@@ -4,13 +4,13 @@ PROJECT (HDF5_HL_CPP)
#-----------------------------------------------------------------------------
# Main HL lib is in /src
#-----------------------------------------------------------------------------
-add_subdirectory (${HDF5_HL_CPP_SOURCE_DIR}/src ${HDF5_HL_CPP_BINARY_DIR}/src)
+add_subdirectory (src)
# --------------------------------------------------------------------
# Add in the examples for the Packet Table codes
# --------------------------------------------------------------------
if (HDF5_BUILD_EXAMPLES)
- add_subdirectory (${HDF5_HL_CPP_SOURCE_DIR}/examples ${HDF5_HL_CPP_BINARY_DIR}/examples)
+ add_subdirectory (examples)
endif ()
# --------------------------------------------------------------------
@@ -18,5 +18,5 @@ endif ()
# --------------------------------------------------------------------
if (BUILD_TESTING)
- add_subdirectory (${HDF5_HL_CPP_SOURCE_DIR}/test ${HDF5_HL_CPP_BINARY_DIR}/test)
+ add_subdirectory (test)
endif ()
diff --git a/hl/fortran/CMakeLists.txt b/hl/fortran/CMakeLists.txt
index c651ce9..00d7517 100644
--- a/hl/fortran/CMakeLists.txt
+++ b/hl/fortran/CMakeLists.txt
@@ -4,18 +4,18 @@ PROJECT (HDF5_HL_F90 C CXX Fortran)
#-----------------------------------------------------------------------------
# List Source files
#-----------------------------------------------------------------------------
-add_subdirectory (${HDF5_HL_F90_SOURCE_DIR}/src ${HDF5_HL_F90_BINARY_DIR}/src)
+add_subdirectory (src)
#-----------------------------------------------------------------------------
# Build the HL Fortran Examples
#-----------------------------------------------------------------------------
if (HDF5_BUILD_EXAMPLES)
- add_subdirectory (${HDF5_HL_F90_SOURCE_DIR}/examples ${HDF5_HL_F90_BINARY_DIR}/examples)
+ add_subdirectory (examples)
endif ()
#-----------------------------------------------------------------------------
# Testing
#-----------------------------------------------------------------------------
if (BUILD_TESTING)
- add_subdirectory (${HDF5_HL_F90_SOURCE_DIR}/test ${HDF5_HL_F90_BINARY_DIR}/test)
+ add_subdirectory (test)
endif ()
diff --git a/hl/fortran/src/CMakeLists.txt b/hl/fortran/src/CMakeLists.txt
index b1a639a..5ad441c 100644
--- a/hl/fortran/src/CMakeLists.txt
+++ b/hl/fortran/src/CMakeLists.txt
@@ -109,10 +109,9 @@ set (HDF5_HL_F90_F_BASE_SOURCES
${HDF5_HL_F90_SRC_SOURCE_DIR}/H5IMff.F90
)
-set (CMD $<TARGET_FILE:H5HL_buildiface>)
add_custom_command (
OUTPUT ${HDF5_HL_F90_SRC_BINARY_DIR}/static/H5LTff_gen.F90 ${HDF5_HL_F90_SRC_BINARY_DIR}/H5TBff_gen.F90
- COMMAND ${CMD}
+ COMMAND $<TARGET_FILE:H5HL_buildiface>
WORKING_DIRECTORY ${HDF5_HL_F90_SRC_BINARY_DIR}/static
DEPENDS ${HDF5_HL_F90_F_BASE_SOURCES}
COMMENT "Generating the H5LTff_gen.F90, H5TBff_gen.F90 files"
@@ -126,10 +125,9 @@ set_source_files_properties (
PROPERTIES GENERATED TRUE
)
if (BUILD_SHARED_LIBS)
- set (CMDSH $<TARGET_FILE:H5HL_buildiface>)
add_custom_command (
OUTPUT ${HDF5_HL_F90_SRC_BINARY_DIR}/shared/H5LTff_gen.F90 ${HDF5_HL_F90_SRC_BINARY_DIR}/shared/H5TBff_gen.F90
- COMMAND ${CMD}
+ COMMAND $<TARGET_FILE:H5HL_buildiface>
WORKING_DIRECTORY ${HDF5_HL_F90_SRC_BINARY_DIR}/shared
DEPENDS ${HDF5_HL_F90_F_BASE_SOURCES}
COMMENT "Generating the H5LTff_gen.F90, H5TBff_gen.F90 shared files"
diff --git a/hl/fortran/src/H5LTf90proto.h b/hl/fortran/src/H5LTf90proto.h
index 35b08a1..031db2c 100644
--- a/hl/fortran/src/H5LTf90proto.h
+++ b/hl/fortran/src/H5LTf90proto.h
@@ -303,7 +303,7 @@ h5tbmake_table_c(size_t_f *namelen1,
hid_t_f *field_types,
hsize_t_f *chunk_size,
int_f *compress,
- size_t_f *char_len_field_names, /* field_names lenghts */
+ size_t_f *char_len_field_names, /* field_names lengths */
size_t_f *max_char_size_field_names, /* char len of fields */
_fcd buf); /* field_names */
@@ -334,7 +334,7 @@ h5tbmake_table_ptr_c(size_t_f *namelen1,
hsize_t_f *chunk_size,
void *fill_data,
int_f *compress,
- size_t_f *char_len_field_names, /* field_names lenghts */
+ size_t_f *char_len_field_names, /* field_names lengths */
size_t_f *max_char_size_field_names, /* char len of fields */
char *field_names, /* field_names */
void *data);
diff --git a/hl/fortran/src/H5TBfc.c b/hl/fortran/src/H5TBfc.c
index c0d053f..331f0bc 100644
--- a/hl/fortran/src/H5TBfc.c
+++ b/hl/fortran/src/H5TBfc.c
@@ -38,7 +38,7 @@ int_f
h5tbmake_table_c(size_t_f *namelen1, _fcd name1, hid_t_f *loc_id, size_t_f *namelen, _fcd name,
hsize_t_f *nfields, hsize_t_f *nrecords, size_t_f *type_size, size_t_f *field_offset,
hid_t_f *field_types, hsize_t_f *chunk_size, int_f *compress,
- size_t_f *char_len_field_names, /* field_names lenghts */
+ size_t_f *char_len_field_names, /* field_names lengths */
size_t_f *max_char_size_field_names, /* char len of fields */
char *field_names) /* field_names */
{
@@ -143,7 +143,7 @@ h5tbmake_table_ptr_c(size_t_f *namelen1, _fcd name1, hid_t_f *loc_id, size_t_f *
_fcd name, hsize_t_f *nfields, hsize_t_f *nrecords, size_t_f *type_size,
size_t_f *field_offset, hid_t_f *field_types, hsize_t_f *chunk_size,
void *fill_data, int_f *compress,
- size_t_f *char_len_field_names, /* field_names lenghts */
+ size_t_f *char_len_field_names, /* field_names lengths */
size_t_f *max_char_size_field_names, /* char len of fields */
char *field_names,
void *data) /* field_names */
@@ -638,7 +638,7 @@ done:
int_f
h5tbget_field_info_c(hid_t_f *loc_id, size_t_f *namelen, _fcd name, hsize_t_f *nfields,
size_t_f *field_sizes, size_t_f *field_offsets, size_t_f *type_size,
- size_t_f *namelen2, /* field_names lenghts */
+ size_t_f *namelen2, /* field_names lengths */
size_t_f *lenmax, /* character len max */
_fcd field_names, /* field_names */
size_t_f *maxlen_out)
diff --git a/hl/test/test_ds.c b/hl/test/test_ds.c
index 91f1505..49dc72f 100644
--- a/hl/test/test_ds.c
+++ b/hl/test/test_ds.c
@@ -3080,7 +3080,7 @@ static int test_simple(void)
/*-------------------------------------------------------------------------
- * get the label using a static buffer smaller than the string lenght
+ * get the label using a static buffer smaller than the string length
*-------------------------------------------------------------------------
*/
@@ -3118,7 +3118,7 @@ static int test_simple(void)
*-------------------------------------------------------------------------
*/
- /* get the lenght of the scale name (pass NULL in name) */
+ /* get the length of the scale name (pass NULL in name) */
if((name_len=H5DSget_scale_name(dsid,NULL,(size_t)0)) < 0)
goto out;
@@ -3151,7 +3151,7 @@ static int test_simple(void)
goto out;
/*-------------------------------------------------------------------------
- * get the scale name using a static buffer smaller than the string lenght
+ * get the scale name using a static buffer smaller than the string length
*-------------------------------------------------------------------------
*/
@@ -4925,7 +4925,7 @@ static int test_errors2(void)
hsize_t dimd[2] = {3,3}; /* size of data dataset */
hsize_t dims[1] = {3}; /* size of scale dataset */
char lbuf[255]; /* label buffer */
- ssize_t label_len; /* label lenght */
+ ssize_t label_len; /* label length */
int scale_idx; /* scale index */
int nscales; /* number of scales in DIM */
int count; /* visitor data */
diff --git a/hl/tools/CMakeLists.txt b/hl/tools/CMakeLists.txt
index 9536517..43229e8 100644
--- a/hl/tools/CMakeLists.txt
+++ b/hl/tools/CMakeLists.txt
@@ -1,6 +1,6 @@
cmake_minimum_required (VERSION 3.2.2)
PROJECT (HDF5_HL_TOOLS C CXX)
-add_subdirectory (${HDF5_HL_TOOLS_SOURCE_DIR}/gif2h5 ${HDF5_HL_TOOLS_BINARY_DIR}/gif2h5)
+add_subdirectory (gif2h5)
-add_subdirectory (${HDF5_HL_TOOLS_SOURCE_DIR}/h5watch ${HDF5_HL_TOOLS_BINARY_DIR}/h5watch)
+add_subdirectory (h5watch)
diff --git a/hl/tools/h5watch/testh5watch.sh.in b/hl/tools/h5watch/testh5watch.sh.in
index 7514281..3f8f5ae 100644
--- a/hl/tools/h5watch/testh5watch.sh.in
+++ b/hl/tools/h5watch/testh5watch.sh.in
@@ -44,7 +44,7 @@ GEN_TEST=h5watchgentest # Generate HDF5 file with various datasets
GEN_TEST_BIN=`pwd`/$GEN_TEST # Path of the binary GEN_TEST
WATCHFILE=`pwd`/WATCH.h5 # The HDF5 file generated to test h5watch
TESTFILE=TEST.h5 # The temporary file (a copy of WATCH.h5) used by tests
-TRY_MAX=20 # Try running the test again
+TRY_MAX=30 # Try running the test again
#
# These 3 defines should be the same as the defines in ./extend_dset.c
WRITER_MESSAGE=writer_message # The message file created by the "extend" process
diff --git a/java/CMakeLists.txt b/java/CMakeLists.txt
index 68860be..9a5692f 100644
--- a/java/CMakeLists.txt
+++ b/java/CMakeLists.txt
@@ -36,20 +36,20 @@ set (CMAKE_JAVA_INCLUDE_PATH "")
#-----------------------------------------------------------------------------
# Traverse source subdirectory
#-----------------------------------------------------------------------------
-add_subdirectory (${HDF5_JAVA_SOURCE_DIR}/src ${HDF5_JAVA_BINARY_DIR}/src)
+add_subdirectory (src)
#-----------------------------------------------------------------------------
# Build the Java Examples
#-----------------------------------------------------------------------------
if (HDF5_BUILD_EXAMPLES)
- add_subdirectory (${HDF5_JAVA_SOURCE_DIR}/examples ${HDF5_JAVA_BINARY_DIR}/examples)
+ add_subdirectory (examples)
endif ()
#-----------------------------------------------------------------------------
# Testing
#-----------------------------------------------------------------------------
if (BUILD_TESTING)
- add_subdirectory (${HDF5_JAVA_SOURCE_DIR}/test ${HDF5_JAVA_BINARY_DIR}/test)
+ add_subdirectory (test)
endif ()
#-----------------------------------------------------------------------------
diff --git a/java/examples/CMakeLists.txt b/java/examples/CMakeLists.txt
index a1a7483..3073918 100644
--- a/java/examples/CMakeLists.txt
+++ b/java/examples/CMakeLists.txt
@@ -1,7 +1,7 @@
cmake_minimum_required (VERSION 3.2.2)
PROJECT (HDFJAVA_EXAMPLES)
-add_subdirectory (${HDFJAVA_EXAMPLES_SOURCE_DIR}/datasets datasets)
-add_subdirectory (${HDFJAVA_EXAMPLES_SOURCE_DIR}/datatypes datatypes)
-add_subdirectory (${HDFJAVA_EXAMPLES_SOURCE_DIR}/groups groups)
-add_subdirectory (${HDFJAVA_EXAMPLES_SOURCE_DIR}/intro intro)
+add_subdirectory (datasets)
+add_subdirectory (datatypes)
+add_subdirectory (groups)
+add_subdirectory (intro)
diff --git a/java/src/CMakeLists.txt b/java/src/CMakeLists.txt
index 3f93f39..9bdab4b 100644
--- a/java/src/CMakeLists.txt
+++ b/java/src/CMakeLists.txt
@@ -4,5 +4,5 @@ PROJECT ( HDF5_JAVA_SRC C Java )
#-----------------------------------------------------------------------------
# Traverse source subdirectory
#-----------------------------------------------------------------------------
-add_subdirectory (${HDF5_JAVA_SRC_SOURCE_DIR}/jni ${HDF5_JAVA_SRC_BINARY_DIR}/jni)
-add_subdirectory (${HDF5_JAVA_SRC_SOURCE_DIR}/hdf ${HDF5_JAVA_SRC_BINARY_DIR}/hdf)
+add_subdirectory (jni)
+add_subdirectory (hdf)
diff --git a/java/src/hdf/CMakeLists.txt b/java/src/hdf/CMakeLists.txt
index 84bda53..649f7d0 100644
--- a/java/src/hdf/CMakeLists.txt
+++ b/java/src/hdf/CMakeLists.txt
@@ -1,4 +1,4 @@
cmake_minimum_required (VERSION 3.2.2)
PROJECT (HDF5_JAVA_HDF)
-add_subdirectory (${HDF5_JAVA_HDF_SOURCE_DIR}/hdf5lib hdf5lib)
+add_subdirectory (hdf5lib)
diff --git a/release_docs/INSTALL_CMake.txt b/release_docs/INSTALL_CMake.txt
index f20ca43..8c72685 100644
--- a/release_docs/INSTALL_CMake.txt
+++ b/release_docs/INSTALL_CMake.txt
@@ -664,10 +664,6 @@ cmake_minimum_required (VERSION 3.2.2 FATAL_ERROR)
# INSTALLDIR - root folder where hdf5 is installed
# CTEST_CONFIGURATION_TYPE - Release, Debug, etc
# CTEST_SOURCE_NAME - source folder
-# STATIC_ONLY - Build/use static libraries
-# FORTRAN_LIBRARIES - Build/use fortran libraries
-# JAVA_LIBRARIES - Build/use java libraries
-# NO_MAC_FORTRAN - Yes to be SHARED on a Mac
##############################################################################
set (CTEST_SOURCE_VERSION "1.11.0")
@@ -679,10 +675,6 @@ set (CTEST_SOURCE_VERSEXT "")
#INSTALLDIR - HDF5-1.10.0 root folder
#CTEST_CONFIGURATION_TYPE - Release, Debug, RelWithDebInfo
#CTEST_SOURCE_NAME - name of source folder; HDF5-1.10.0
-#STATIC_ONLY - Default is YES
-#FORTRAN_LIBRARIES - Default is NO
-#JAVA_LIBRARIES - Default is NO
-#NO_MAC_FORTRAN - set to TRUE to allow shared libs on a Mac
if (DEFINED CTEST_SCRIPT_ARG)
# transform ctest script arguments of the form
# script.ctest,var1=value1,var2=value2
diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt
index 3f0ea92..e7186c5 100644
--- a/release_docs/RELEASE.txt
+++ b/release_docs/RELEASE.txt
@@ -236,7 +236,17 @@ Bug Fixes since HDF5-1.10.1 release
-------------
- CMake
- Correct usuage of CMAKE_BUILD_TYPE variable.
+ Update CMake commands configuration.
+
+ A number of improvements were made to the CMake commands. Most
+ changes simplify usage or eliminate unused constructs. Also,
+ some changes support better cross-platform support.
+
+ (ADB - 2018/02/01, HDFFV-10398)
+
+ - CMake
+
+ Correct usage of CMAKE_BUILD_TYPE variable.
The use of the CMAKE_BUILD_TYPE is incorrect for multi-config
generators (Visual Studio and XCode) and is optional for single
@@ -300,6 +310,28 @@ Bug Fixes since HDF5-1.10.1 release
Tools
-----
+ - h5dump
+
+ the tools library will hide the error stack during file open.
+
+ While this is preferable almost always, there are reasons to enable
+ display of the error stack when a tool will not open a file. Adding an
+ optional argument to the --enable-error-stack will provide this use case.
+ As an optional argument it will not affect the operation of the
+ --enable-error-stack. h5dump is the only tool to implement this change.
+
+ (ADB - 2018/02/15, HDFFV-10384)
+
+ - h5dump
+
+ h5dump would output an indented blank line in the filters section.
+
+ h5dump overused the h5tools_simple_prefix function, which is a
+ function intended to account for the data index (x,y,z) option.
+ Removed the function call for header information.
+
+ (ADB - 2018/01/25, HDFFV-10396)
+
- h5repack
h5repack incorrectly searched internal object table for name.
diff --git a/release_docs/USING_HDF5_CMake.txt b/release_docs/USING_HDF5_CMake.txt
index 5993a0f..fc62b75 100644
--- a/release_docs/USING_HDF5_CMake.txt
+++ b/release_docs/USING_HDF5_CMake.txt
@@ -219,129 +219,113 @@ NOTE: this file is available at the HDF web site:
http://www.hdfgroup.org/HDF5/release/cmakebuild.html
HDF5_Examples.cmake
+ HDF5_Examples_options.cmake
Also available at the HDF web site is a CMake application framework template.
You can quickly add files to the framework and execute the script to compile
your application with an installed HDF5 binary.
========================================================================
-ctest
+ctest use of HDF5_Examples.cmake and HDF5_Examples_options.cmake
========================================================================
cmake_minimum_required(VERSION 3.2.2 FATAL_ERROR)
###############################################################################################################
# This script will build and run the examples from a folder
# Execute from a command line:
-# ctest -S HDF5_Examples.cmake,OPTION=VALUE -C Release -V -O test.log
+# ctest -S HDF5_Examples.cmake,OPTION=VALUE -C Release -VV -O test.log
###############################################################################################################
-set (CTEST_CMAKE_GENERATOR "@CMAKE_GENERATOR@")
-set (CTEST_DASHBOARD_ROOT ${CTEST_SCRIPT_DIRECTORY})
+set(CTEST_CMAKE_GENERATOR "@CMAKE_GENERATOR@")
+if("@CMAKE_GENERATOR_TOOLSET@")
+ set(CMAKE_GENERATOR_TOOLSET "@CMAKE_GENERATOR_TOOLSET@")
+endif()
+set(CTEST_DASHBOARD_ROOT ${CTEST_SCRIPT_DIRECTORY})
# handle input parameters to script.
#INSTALLDIR - HDF5 root folder
#CTEST_CONFIGURATION_TYPE - Release, Debug, RelWithDebInfo
-#CTEST_SOURCE_NAME - name of source folder; HDF4Examples
-#STATIC_ONLY - Default is YES
-#FORTRAN_LIBRARIES - Default is NO
-#JAVA_LIBRARIES - Default is NO
-##NO_MAC_FORTRAN - set to TRUE to allow shared libs on a Mac)
-if (DEFINED CTEST_SCRIPT_ARG)
- # transform ctest script arguments of the form
- # script.ctest,var1=value1,var2=value2
- # to variables with the respective names set to the respective values
- string (REPLACE "," ";" script_args "${CTEST_SCRIPT_ARG}")
- foreach (current_var ${script_args})
- if ("${current_var}" MATCHES "^([^=]+)=(.+)$")
- set("${CMAKE_MATCH_1}" "${CMAKE_MATCH_2}")
- endif ()
- endforeach ()
-endif ()
-if (NOT DEFINED INSTALLDIR)
- set (INSTALLDIR "@CMAKE_INSTALL_PREFIX@")
-endif ()
-if (NOT DEFINED CTEST_CONFIGURATION_TYPE)
- set (CTEST_CONFIGURATION_TYPE "Release")
-endif ()
-if (NOT DEFINED CTEST_SOURCE_NAME)
- set (CTEST_SOURCE_NAME "HDF5Examples")
-endif ()
-if (NOT DEFINED STATIC_ONLY)
- set (STATICONLYLIBRARIES "YES")
-else ()
- set (STATICONLYLIBRARIES "NO")
-endif ()
-if (NOT DEFINED FORTRAN_LIBRARIES)
- set (FORTRANLIBRARIES "NO")
-else ()
- set (FORTRANLIBRARIES "YES")
-endif ()
-if (NOT DEFINED JAVA_LIBRARIES)
- set (JAVALIBRARIES "NO")
-else ()
- set (JAVALIBRARIES "YES")
-endif ()
+#CTEST_SOURCE_NAME - name of source folder; HDF5Examples
+if(DEFINED CTEST_SCRIPT_ARG)
+ # transform ctest script arguments of the form
+ # script.ctest,var1=value1,var2=value2
+ # to variables with the respective names set to the respective values
+ string(REPLACE "," ";" script_args "${CTEST_SCRIPT_ARG}")
+ foreach(current_var ${script_args})
+ if("${current_var}" MATCHES "^([^=]+)=(.+)$")
+ set("${CMAKE_MATCH_1}" "${CMAKE_MATCH_2}")
+ endif()
+ endforeach()
+endif()
+
+###################################################################
+### Following Line is one of [Release, RelWithDebInfo, Debug] #####
+set(CTEST_CONFIGURATION_TYPE "$ENV{CMAKE_CONFIG_TYPE}")
+if(NOT DEFINED CTEST_CONFIGURATION_TYPE)
+ set(CTEST_CONFIGURATION_TYPE "Release")
+endif()
+set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DCTEST_CONFIGURATION_TYPE:STRING=${CTEST_CONFIGURATION_TYPE}")
+##################################################################
+
+if(NOT DEFINED INSTALLDIR)
+ set(INSTALLDIR "@CMAKE_INSTALL_PREFIX@")
+endif()
+
+if(NOT DEFINED CTEST_SOURCE_NAME)
+ set(CTEST_SOURCE_NAME "HDF5Examples")
+endif()
+
+if(NOT DEFINED HDF_LOCAL)
+ set(CDASH_LOCAL "NO")
+else()
+ set(CDASH_LOCAL "YES")
+endif()
+if(NOT DEFINED CTEST_SITE)
+ set(CTEST_SITE "local")
+endif()
+if(NOT DEFINED CTEST_BUILD_NAME)
+ set(CTEST_BUILD_NAME "examples")
+endif()
+set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DSITE:STRING=${CTEST_SITE} -DBUILDNAME:STRING=${CTEST_BUILD_NAME}")
#TAR_SOURCE - name of tarfile
-#if (NOT DEFINED TAR_SOURCE)
-# set (CTEST_USE_TAR_SOURCE "HDF5Examples-1.10.1-Source")
-#endif ()
+#if(NOT DEFINED TAR_SOURCE)
+# set(CTEST_USE_TAR_SOURCE "HDF5Examples-1.10.5-Source")
+#endif()
###############################################################################################################
-# Adjust the following SET Commands as needed
-###############################################################################################################
-if (WIN32)
- if (${STATICONLYLIBRARIES})
- set (BUILD_OPTIONS "${BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=OFF")
- endif ()
- set (ENV{HDF5_DIR} "${INSTALLDIR}/cmake")
- set (CTEST_BINARY_NAME ${CTEST_SOURCE_NAME}\\build)
- set (CTEST_SOURCE_DIRECTORY "${CTEST_DASHBOARD_ROOT}\\${CTEST_SOURCE_NAME}")
- set (CTEST_BINARY_DIRECTORY "${CTEST_DASHBOARD_ROOT}\\${CTEST_BINARY_NAME}")
-else (WIN32)
- if (${STATICONLYLIBRARIES})
- set (BUILD_OPTIONS "${BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=OFF -DCMAKE_ANSI_CFLAGS:STRING=-fPIC")
- endif ()
- set (ENV{HDF5_DIR} "${INSTALLDIR}/share/cmake")
- set (ENV{LD_LIBRARY_PATH} "${INSTALLDIR}/lib")
- set (CTEST_BINARY_NAME ${CTEST_SOURCE_NAME}/build)
- set (CTEST_SOURCE_DIRECTORY "${CTEST_DASHBOARD_ROOT}/${CTEST_SOURCE_NAME}")
- set (CTEST_BINARY_DIRECTORY "${CTEST_DASHBOARD_ROOT}/${CTEST_BINARY_NAME}")
-endif(WIN32)
-if (${FORTRANLIBRARIES})
- set (BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF_BUILD_FORTRAN:BOOL=ON")
-else ()
- set (BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF_BUILD_FORTRAN:BOOL=OFF")
-endif ()
-if (${JAVALIBRARIES})
- set (BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF_BUILD_JAVA:BOOL=ON")
-else ()
- set (BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF_BUILD_JAVA:BOOL=OFF")
-endif ()
-set (BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF5_PACKAGE_NAME:STRING=@HDF5_PACKAGE@@HDF_PACKAGE_EXT@")
+if(WIN32)
+ set(SITE_OS_NAME "Windows")
+ set(ENV{HDF5_DIR} "${INSTALLDIR}/cmake")
+ set(CTEST_BINARY_NAME ${CTEST_SOURCE_NAME}\\build)
+ set(CTEST_SOURCE_DIRECTORY "${CTEST_DASHBOARD_ROOT}\\${CTEST_SOURCE_NAME}")
+ set(CTEST_BINARY_DIRECTORY "${CTEST_DASHBOARD_ROOT}\\${CTEST_BINARY_NAME}")
+else()
+ set(ENV{HDF5_DIR} "${INSTALLDIR}/share/cmake")
+ set(ENV{LD_LIBRARY_PATH} "${INSTALLDIR}/lib")
+ set(CTEST_BINARY_NAME ${CTEST_SOURCE_NAME}/build)
+ set(CTEST_SOURCE_DIRECTORY "${CTEST_DASHBOARD_ROOT}/${CTEST_SOURCE_NAME}")
+ set(CTEST_BINARY_DIRECTORY "${CTEST_DASHBOARD_ROOT}/${CTEST_BINARY_NAME}")
+endif()
+if(${CDASH_LOCAL})
+ set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DCDASH_LOCAL:BOOL=ON")
+endif()
+set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_PACKAGE_NAME:STRING=@HDF5_PACKAGE@@HDF_PACKAGE_EXT@")
###############################################################################################################
# For any comments please contact cdashhelp@hdfgroup.org
#
###############################################################################################################
-#-----------------------------------------------------------------------------
-# MAC machines need special option
-#-----------------------------------------------------------------------------
-if (APPLE)
- # Compiler choice
- execute_process (COMMAND xcrun --find cc OUTPUT_VARIABLE XCODE_CC OUTPUT_STRIP_TRAILING_WHITESPACE)
- execute_process (COMMAND xcrun --find c++ OUTPUT_VARIABLE XCODE_CXX OUTPUT_STRIP_TRAILING_WHITESPACE)
- set (ENV{CC} "${XCODE_CC}")
- set (ENV{CXX} "${XCODE_CXX}")
- if (NOT NO_MAC_FORTRAN)
- # Shared fortran is not supported, build static
- set (BUILD_OPTIONS "${BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=OFF -DCMAKE_ANSI_CFLAGS:STRING=-fPIC")
- else ()
- set (BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF_BUILD_FORTRAN:BOOL=OFF")
- endif ()
- set (BUILD_OPTIONS "${BUILD_OPTIONS} -DCTEST_USE_LAUNCHERS:BOOL=ON -DCMAKE_BUILD_WITH_INSTALL_RPATH:BOOL=OFF")
-endif ()
+#############################################################################################
+#### Change default configuration of options in config/cmake/cacheinit.cmake file ###
+#### format for file: set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DXXX:YY=ZZZZ") ###
+#############################################################################################
+if(WIN32)
+ include(${CTEST_SCRIPT_DIRECTORY}\\HDF5_Examples_options.cmake)
+else()
+ include(${CTEST_SCRIPT_DIRECTORY}/HDF5_Examples_options.cmake)
+endif()
#-----------------------------------------------------------------------------
set (CTEST_CMAKE_COMMAND "\"${CMAKE_COMMAND}\"")
@@ -415,6 +399,57 @@ endif ()
#-----------------------------------------------------------------------------
##############################################################################################################
+##############################################################################################################
+#### HDF5_Examples_options.cmake ###
+#### Change default configuration of options in config/cmake/cacheinit.cmake file ###
+##############################################################################################################
+#############################################################################################
+#### Change default configuration of options in config/cmake/cacheinit.cmake file ###
+#### format: set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DXXX:YY=ZZZZ") ###
+#### DEFAULT: ###
+#### BUILD_SHARED_LIBS:BOOL=OFF ###
+#### HDF_BUILD_C:BOOL=ON ###
+#### HDF_BUILD_CXX:BOOL=OFF ###
+#### HDF_BUILD_FORTRAN:BOOL=OFF ###
+#### HDF_BUILD_JAVA:BOOL=OFF ###
+#### BUILD_TESTING:BOOL=OFF ###
+#### HDF_ENABLE_PARALLEL:BOOL=OFF ###
+#### HDF_ENABLE_THREADSAFE:BOOL=OFF ###
+#############################################################################################
+
+### uncomment/comment and change the following lines for other configuration options
+### build with shared libraries
+#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=ON")
+
+#############################################################################################
+#### languages ####
+### disable C builds
+#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF_BUILD_C:BOOL=OFF")
+
+### enable C++ builds
+#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF_BUILD_CXX:BOOL=ON")
+
+### enable Fortran builds
+#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF_BUILD_FORTRAN:BOOL=ON")
+
+### enable JAVA builds
+#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF_BUILD_JAVA:BOOL=ON")
+
+#############################################################################################
+### enable parallel program builds
+#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF_ENABLE_PARALLEL:BOOL=ON")
+
+#############################################################################################
+### enable threadsafe program builds
+#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF_ENABLE_THREADSAFE:BOOL=ON")
+
+#############################################################################################
+### enable test program builds, requires reference files in testfiles subdirectory
+#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DBUILD_TESTING:BOOL=ON")
+#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DCOMPARE_TESTING:BOOL=ON")
+
+#############################################################################################
+
========================================================================
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 0552244..aaedfda 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -852,11 +852,13 @@ TARGET_C_PROPERTIES (H5detect STATIC " " " ")
if (MSVC OR MINGW)
target_link_libraries (H5detect "ws2_32.lib")
endif ()
+if (CMAKE_SYSTEM_NAME STREQUAL "Emscripten")
+ set_property(TARGET H5detect PROPERTY LINK_FLAGS "-O0")
+endif ()
-set (CMD $<TARGET_FILE:H5detect>)
add_custom_command (
OUTPUT ${HDF5_BINARY_DIR}/H5Tinit.c
- COMMAND ${CMD}
+ COMMAND $<TARGET_FILE:H5detect>
ARGS > ${HDF5_BINARY_DIR}/H5Tinit.c
DEPENDS H5detect
)
@@ -866,11 +868,13 @@ TARGET_C_PROPERTIES (H5make_libsettings STATIC " " " ")
if (MSVC OR MINGW)
target_link_libraries (H5make_libsettings "ws2_32.lib")
endif ()
+if (CMAKE_SYSTEM_NAME STREQUAL "Emscripten")
+ set_property(TARGET H5make_libsettings PROPERTY LINK_FLAGS "-O0")
+endif ()
-set (CMD $<TARGET_FILE:H5make_libsettings>)
add_custom_command (
OUTPUT ${HDF5_BINARY_DIR}/H5lib_settings.c
- COMMAND ${CMD}
+ COMMAND $<TARGET_FILE:H5make_libsettings>
ARGS > ${HDF5_BINARY_DIR}/H5lib_settings.c
DEPENDS H5make_libsettings
WORKING_DIRECTORY ${HDF5_BINARY_DIR}
@@ -905,18 +909,16 @@ set (install_targets ${HDF5_LIB_TARGET})
if (BUILD_SHARED_LIBS)
file (MAKE_DIRECTORY "${HDF5_BINARY_DIR}/shared")
- set (CMD $<TARGET_FILE:H5detect>)
add_custom_command (
OUTPUT ${HDF5_BINARY_DIR}/shared/H5Tinit.c
- COMMAND ${CMD}
+ COMMAND $<TARGET_FILE:H5detect>
ARGS > ${HDF5_BINARY_DIR}/shared/H5Tinit.c
DEPENDS H5detect
WORKING_DIRECTORY ${HDF5_BINARY_DIR}/shared
)
- set (CMD $<TARGET_FILE:H5make_libsettings>)
add_custom_command (
OUTPUT ${HDF5_BINARY_DIR}/shared/H5lib_settings.c
- COMMAND ${CMD}
+ COMMAND $<TARGET_FILE:H5make_libsettings>
ARGS > ${HDF5_BINARY_DIR}/shared/H5lib_settings.c
DEPENDS H5make_libsettings
WORKING_DIRECTORY ${HDF5_BINARY_DIR}
diff --git a/src/H5Aint.c b/src/H5Aint.c
index f1dd41e..55c46f6 100644
--- a/src/H5Aint.c
+++ b/src/H5Aint.c
@@ -102,6 +102,12 @@ static herr_t H5A__attr_sort_table(H5A_attr_table_t *atable, H5_index_t idx_type
/* Package Variables */
/*********************/
+/* Format version bounds for attribute */
+const unsigned H5O_attr_ver_bounds[] = {
+ H5O_ATTR_VERSION_1, /* H5F_LIBVER_EARLIEST */
+ H5O_ATTR_VERSION_3, /* H5F_LIBVER_V18 */
+ H5O_ATTR_VERSION_LATEST /* H5F_LIBVER_LATEST */
+};
/*****************************/
/* Library Private Variables */
@@ -209,18 +215,16 @@ H5A_create(const H5G_loc_t *loc, const char *name, const H5T_t *type,
if(H5T_set_loc(attr->shared->dt, loc->oloc->file, H5T_LOC_DISK) < 0)
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, NULL, "invalid datatype location")
- /* Set the latest format for datatype, if requested */
- if(H5F_USE_LATEST_FLAGS(loc->oloc->file, H5F_LATEST_DATATYPE))
- if(H5T_set_latest_version(attr->shared->dt) < 0)
- HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, NULL, "can't set latest version of datatype")
+ /* Set the version for datatype */
+ if(H5T_set_version(loc->oloc->file, attr->shared->dt) < 0)
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, NULL, "can't set version of datatype")
/* Copy the dataspace for the attribute */
attr->shared->ds = H5S_copy(space, FALSE, TRUE);
- /* Set the latest format for dataspace, if requested */
- if(H5F_USE_LATEST_FLAGS(loc->oloc->file, H5F_LATEST_DATASPACE))
- if(H5S_set_latest_version(attr->shared->ds) < 0)
- HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, NULL, "can't set latest version of dataspace")
+ /* Set the version for dataspace */
+ if(H5S_set_version(loc->oloc->file, attr->shared->ds) < 0)
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, NULL, "can't set version of dataspace")
/* Copy the object header information */
if(H5O_loc_copy(&(attr->oloc), loc->oloc, H5_COPY_DEEP) < 0)
@@ -1843,11 +1847,11 @@ done:
* Function: H5A_set_version
*
* Purpose: Sets the correct version to encode attribute with.
- * Chooses the oldest version possible, unless the "use the
- * latest format" flag is set.
+ * Chooses the oldest version possible, unless the
+ * file's low bound indicates otherwise.
*
- * Return: Success: Non-negative
- * Failure: Negative
+ * Return: Success: Non-negative
+ * Failure: Negative
*
* Programmer: Quincey Koziol
* koziol@hdfgroup.org
@@ -1859,8 +1863,8 @@ herr_t
H5A_set_version(const H5F_t *f, H5A_t *attr)
{
hbool_t type_shared, space_shared; /* Flags to indicate that shared messages are used for this attribute */
- hbool_t use_latest_format; /* Flag indicating the latest attribute version support is enabled */
- herr_t ret_value = SUCCEED; /* Return value */
+ uint8_t version; /* Message version */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
@@ -1868,9 +1872,6 @@ H5A_set_version(const H5F_t *f, H5A_t *attr)
HDassert(f);
HDassert(attr);
- /* Get the file's 'use the latest attribute version support' flag */
- use_latest_format = H5F_USE_LATEST_FLAGS(f, H5F_LATEST_ATTRIBUTE);
-
/* Check whether datatype and dataspace are shared */
if(H5O_msg_is_shared(H5O_DTYPE_ID, attr->shared->dt) > 0)
type_shared = TRUE;
@@ -1883,14 +1884,22 @@ H5A_set_version(const H5F_t *f, H5A_t *attr)
space_shared = FALSE;
/* Check which version to encode attribute with */
- if(use_latest_format)
- attr->shared->version = H5O_ATTR_VERSION_LATEST; /* Write out latest attribute version */
- else if(attr->shared->encoding != H5T_CSET_ASCII)
- attr->shared->version = H5O_ATTR_VERSION_3; /* Write version which includes the character encoding */
+ if(attr->shared->encoding != H5T_CSET_ASCII)
+ version = H5O_ATTR_VERSION_3; /* Write version which includes the character encoding */
else if(type_shared || space_shared)
- attr->shared->version = H5O_ATTR_VERSION_2; /* Write out version with flag for indicating shared datatype or dataspace */
+ version = H5O_ATTR_VERSION_2; /* Write out version with flag for indicating shared datatype or dataspace */
else
- attr->shared->version = H5O_ATTR_VERSION_1; /* Write out basic version */
+ version = H5O_ATTR_VERSION_1; /* Write out basic version */
+
+ /* Upgrade to the version indicated by the file's low bound if higher */
+ version = MAX(version, (uint8_t)H5O_attr_ver_bounds[H5F_LOW_BOUND(f)]);
+
+ /* Version bounds check */
+ if(version > H5O_attr_ver_bounds[H5F_HIGH_BOUND(f)])
+ HGOTO_ERROR(H5E_ATTR, H5E_BADRANGE, FAIL, "attribute version out of bounds")
+
+ /* Set the message version */
+ attr->shared->version = version;
done:
FUNC_LEAVE_NOAPI(ret_value)
diff --git a/src/H5Cimage.c b/src/H5Cimage.c
index 53d1712..be2560f 100644
--- a/src/H5Cimage.c
+++ b/src/H5Cimage.c
@@ -1382,9 +1382,12 @@ H5C__prep_image_for_file_close(H5F_t *f, hid_t dxpl_id, hbool_t *image_generated
* Note that under some error conditions, the superblock will be
* undefined in this case as well -- if so, assume that the
* superblock does not support superblock extension messages.
+ * Also verify that the file's high_bound is at least release
+ * 1.10.x, otherwise cancel the request for a cache image
*/
if((NULL == f->shared->sblock) ||
- (f->shared->sblock->super_vers < HDF5_SUPERBLOCK_VERSION_2)) {
+ (f->shared->sblock->super_vers < HDF5_SUPERBLOCK_VERSION_2) ||
+ (f->shared->high_bound < H5F_LIBVER_V110)) {
H5C_cache_image_ctl_t default_image_ctl = H5C__DEFAULT_CACHE_IMAGE_CTL;
cache_ptr->image_ctl = default_image_ctl;
diff --git a/src/H5Dint.c b/src/H5Dint.c
index bfe1497..fc191ff 100644
--- a/src/H5Dint.c
+++ b/src/H5Dint.c
@@ -623,10 +623,10 @@ done:
static herr_t
H5D__init_type(H5F_t *file, const H5D_t *dset, hid_t type_id, const H5T_t *type)
{
- htri_t relocatable; /* Flag whether the type is relocatable */
- htri_t immutable; /* Flag whether the type is immutable */
- hbool_t use_latest_format; /* Flag indicating the 'latest datatype version support' is enabled */
- herr_t ret_value = SUCCEED; /* Return value */
+ htri_t relocatable; /* Flag whether the type is relocatable */
+ htri_t immutable; /* Flag whether the type is immutable */
+ hbool_t use_at_least_v18; /* Flag indicating to use at least v18 format versions */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_STATIC
@@ -643,17 +643,17 @@ H5D__init_type(H5F_t *file, const H5D_t *dset, hid_t type_id, const H5T_t *type)
if((immutable = H5T_is_immutable(type)) < 0)
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "can't check datatype?")
- /* Get the file's 'use the latest datatype version support' flag */
- use_latest_format = H5F_USE_LATEST_FLAGS(file, H5F_LATEST_DATATYPE);
+ /* To use at least v18 format versions or not */
+ use_at_least_v18 = (H5F_LOW_BOUND(file) >= H5F_LIBVER_V18);
/* Copy the datatype if it's a custom datatype or if it'll change when it's location is changed */
- if(!immutable || relocatable || use_latest_format) {
+ if(!immutable || relocatable || use_at_least_v18) {
/* Copy datatype for dataset */
if((dset->shared->type = H5T_copy(type, H5T_COPY_ALL)) == NULL)
HGOTO_ERROR(H5E_DATASET, H5E_CANTCOPY, FAIL, "can't copy datatype")
- /* Convert a datatype (if committed) to a transient type if the committed datatype's file
- location is different from the file location where the dataset will be created */
+ /* Convert a datatype (if committed) to a transient type if the committed datatype's file
+ location is different from the file location where the dataset will be created */
if(H5T_convert_committed_datatype(dset->shared->type, file) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't get shared datatype info")
@@ -661,14 +661,13 @@ H5D__init_type(H5F_t *file, const H5D_t *dset, hid_t type_id, const H5T_t *type)
if(H5T_set_loc(dset->shared->type, file, H5T_LOC_DISK) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't set datatype location")
- /* Set the latest format, if requested */
- if(use_latest_format)
- if(H5T_set_latest_version(dset->shared->type) < 0)
- HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set latest version of datatype")
+ /* Set the version for datatype */
+ if(H5T_set_version(file, dset->shared->type) < 0)
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set version of datatype")
/* Get a datatype ID for the dataset's datatype */
- if((dset->shared->type_id = H5I_register(H5I_DATATYPE, dset->shared->type, FALSE)) < 0)
- HGOTO_ERROR(H5E_DATASET, H5E_CANTREGISTER, FAIL, "unable to register type")
+ if((dset->shared->type_id = H5I_register(H5I_DATATYPE, dset->shared->type, FALSE)) < 0)
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTREGISTER, FAIL, "unable to register type")
} /* end if */
/* Not a custom datatype, just use it directly */
else {
@@ -738,7 +737,6 @@ done:
static herr_t
H5D__init_space(H5F_t *file, const H5D_t *dset, const H5S_t *space)
{
- hbool_t use_latest_format; /* Flag indicating the 'latest dataspace version support' is enabled */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_STATIC
@@ -748,9 +746,6 @@ H5D__init_space(H5F_t *file, const H5D_t *dset, const H5S_t *space)
HDassert(dset);
HDassert(space);
- /* Get the file's 'use the latest dataspace version support' flag */
- use_latest_format = H5F_USE_LATEST_FLAGS(file, H5F_LATEST_DATASPACE);
-
/* Copy dataspace for dataset */
if(NULL == (dset->shared->space = H5S_copy(space, FALSE, TRUE)))
HGOTO_ERROR(H5E_DATASET, H5E_CANTCOPY, FAIL, "can't copy dataspace")
@@ -759,10 +754,9 @@ H5D__init_space(H5F_t *file, const H5D_t *dset, const H5S_t *space)
if(H5D__cache_dataspace_info(dset) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTCOPY, FAIL, "can't cache dataspace info")
- /* Set the latest format, if requested */
- if(use_latest_format)
- if(H5S_set_latest_version(dset->shared->space) < 0)
- HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set latest version of datatype")
+ /* Set the version for dataspace */
+ if(H5S_set_version(file, dset->shared->space) < 0)
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set latest version of datatype")
/* Set the dataset's dataspace to 'all' selection */
if(H5S_select_all(dset->shared->space, TRUE) < 0)
@@ -794,6 +788,7 @@ H5D__update_oh_info(H5F_t *file, hid_t dxpl_id, H5D_t *dset, hid_t dapl_id)
H5D_fill_value_t fill_status; /* Fill value status */
hbool_t fill_changed = FALSE; /* Flag indicating the fill value was changed */
hbool_t layout_init = FALSE; /* Flag to indicate that chunk information was initialized */
+ hbool_t use_at_least_v18; /* Flag indicating to use at least v18 format versions */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_STATIC
@@ -808,6 +803,9 @@ H5D__update_oh_info(H5F_t *file, hid_t dxpl_id, H5D_t *dset, hid_t dapl_id)
type = dset->shared->type;
fill_prop = &dset->shared->dcpl_cache.fill;
+ /* To use at least v18 format versions or not */
+ use_at_least_v18 = (H5F_LOW_BOUND(file) >= H5F_LIBVER_V18);
+
/* Retrieve "defined" status of fill value */
if(H5P_is_fill_value_defined(fill_prop, &fill_status) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't tell if fill value defined")
@@ -886,8 +884,8 @@ H5D__update_oh_info(H5F_t *file, hid_t dxpl_id, H5D_t *dset, hid_t dapl_id)
HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to update new fill value header message")
/* If there is valid information for the old fill value struct, add it */
- /* (only if we aren't trying to write the 'latest fill message version support') */
- if(fill_prop->buf && !(H5F_USE_LATEST_FLAGS(file, H5F_LATEST_FILL_MSG))) {
+ /* (only if we aren't using v18 format versions and above */
+ if(fill_prop->buf && !use_at_least_v18) {
H5O_fill_t old_fill_prop; /* Copy of fill value property, for writing as "old" fill value */
/* Shallow copy the fill value property */
@@ -922,27 +920,27 @@ H5D__update_oh_info(H5F_t *file, hid_t dxpl_id, H5D_t *dset, hid_t dapl_id)
(H5P_exist_plist(dc_plist, H5O_BOGUS_MSG_ID_NAME) > 0) ) {
uint8_t bogus_flags = 0; /* Flags for creating "bogus" message */
- unsigned bogus_id; /* "bogus" ID */
+ unsigned bogus_id; /* "bogus" ID */
- /* Retrieve "bogus" message ID */
+ /* Retrieve "bogus" message ID */
if(H5P_get(dc_plist, H5O_BOGUS_MSG_ID_NAME, &bogus_id) < 0)
- HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get bogus ID options")
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get bogus ID options")
/* Retrieve "bogus" message flags */
if(H5P_get(dc_plist, H5O_BOGUS_MSG_FLAGS_NAME, &bogus_flags) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get bogus message options")
/* Add a "bogus" message (for error testing). */
- if(H5O_bogus_oh(file, dxpl_id, oh, bogus_id, (unsigned)bogus_flags) < 0)
+ if(H5O_bogus_oh(file, dxpl_id, oh, bogus_id, (unsigned)bogus_flags) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to create 'bogus' message")
} /* end if */
}
#endif /* H5O_ENABLE_BOGUS */
/* Add a modification time message, if using older format. */
- /* (If using the latest 'no modification time message' version support, the modification time is part of the object
+ /* (If using v18 format versions and above, the the modification time is part of the object
* header and doesn't use a separate message -QAK)
*/
- if(!(H5F_USE_LATEST_FLAGS(file, H5F_LATEST_NO_MOD_TIME_MSG)))
+ if(!use_at_least_v18)
if(H5O_touch_oh(file, dxpl_id, oh, TRUE) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to update modification time message")
@@ -1174,27 +1172,20 @@ H5D__create(H5F_t *file, hid_t type_id, const H5S_t *space, hid_t dcpl_id,
HGOTO_ERROR(H5E_DATASET, H5E_BADVALUE, NULL, "compact dataset must have early space allocation")
} /* end if */
- /* Set the latest version of the layout, pline & fill messages, if requested */
- if(H5F_USE_LATEST_FLAGS(file, H5F_LATEST_DSET_MSG_FLAGS)) {
- /* Set the latest version for the I/O pipeline message */
- if(H5F_USE_LATEST_FLAGS(file, H5F_LATEST_PLINE_MSG))
- if(H5O_pline_set_latest_version(&new_dset->shared->dcpl_cache.pline) < 0)
+ /* Set the version for the I/O pipeline message */
+ if(H5O_pline_set_version(file, &new_dset->shared->dcpl_cache.pline) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, NULL, "can't set latest version of I/O filter pipeline")
- /* Set the latest version for the fill message */
- if(H5F_USE_LATEST_FLAGS(file, H5F_LATEST_FILL_MSG))
- /* Set the latest version for the fill value message */
- if(H5O_fill_set_latest_version(&new_dset->shared->dcpl_cache.fill) < 0)
+ /* Set the version for the fill message */
+ if(H5O_fill_set_version(file, &new_dset->shared->dcpl_cache.fill) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, NULL, "can't set latest version of fill value")
- /* Set the latest version for the layout message */
- if(H5F_USE_LATEST_FLAGS(file, H5F_LATEST_LAYOUT_MSG))
- /* Set the latest version for the layout message */
- if(H5D__layout_set_latest_version(&new_dset->shared->layout, new_dset->shared->space, &new_dset->shared->dcpl_cache) < 0)
+ /* Set the latest version for the layout message */
+ if(H5D__layout_set_version(file, &new_dset->shared->layout) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, NULL, "can't set latest version of layout")
- } /* end if */
- else if(new_dset->shared->layout.version >= H5O_LAYOUT_VERSION_4) {
- /* Use latest indexing type for layout message version >= 4 */
+
+ if(new_dset->shared->layout.version >= H5O_LAYOUT_VERSION_4) {
+ /* Use latest indexing type for layout message version >= 4 */
if(H5D__layout_set_latest_indexing(&new_dset->shared->layout, new_dset->shared->space, &new_dset->shared->dcpl_cache) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, NULL, "can't set latest indexing")
} /* end if */
diff --git a/src/H5Dlayout.c b/src/H5Dlayout.c
index ec18e86..980b810 100644
--- a/src/H5Dlayout.c
+++ b/src/H5Dlayout.c
@@ -46,6 +46,12 @@
/* Package Variables */
/*********************/
+/* Format version bounds for layout */
+const unsigned H5O_layout_ver_bounds[] = {
+ H5O_LAYOUT_VERSION_1, /* H5F_LIBVER_EARLIEST */
+ H5O_LAYOUT_VERSION_3, /* H5F_LIBVER_V18 */ /* H5O_LAYOUT_VERSION_DEFAULT */
+ H5O_LAYOUT_VERSION_LATEST /* H5F_LIBVER_LATEST */
+};
/*****************************/
/* Library Private Variables */
@@ -57,6 +63,7 @@
/*******************/
+
/*-------------------------------------------------------------------------
* Function: H5D__layout_set_io_ops
@@ -277,49 +284,47 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5D__layout_set_latest_version
+ * Function: H5D__layout_set_version
*
- * Purpose: Set the encoding for a layout to the latest version.
- * Part of the coding in this routine is moved to
- * H5D__layout_set_latest_indexing().
+ * Purpose: Set the version to encode a layout with.
*
* Return: Non-negative on success/Negative on failure
*
- * Programmer: Quincey Koziol
- * Thursday, January 15, 2009
+ * Programmer: Vailin Choi; December 2017
*
*-------------------------------------------------------------------------
*/
herr_t
-H5D__layout_set_latest_version(H5O_layout_t *layout, const H5S_t *space,
- const H5D_dcpl_cache_t *dcpl_cache)
+H5D__layout_set_version(H5F_t *f, H5O_layout_t *layout)
{
- herr_t ret_value = SUCCEED; /* Return value */
+ unsigned version; /* Message version */
+ herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_PACKAGE
+ FUNC_ENTER_NOAPI(FAIL)
/* Sanity check */
HDassert(layout);
- HDassert(space);
- HDassert(dcpl_cache);
+ HDassert(f);
+
+ /* Upgrade to the version indicated by the file's low bound if higher */
+ version = MAX(layout->version, H5O_layout_ver_bounds[H5F_LOW_BOUND(f)]);
- /* Set encoding of layout to latest version */
- layout->version = H5O_LAYOUT_VERSION_LATEST;
+ /* Version bounds check */
+ if(version > H5O_layout_ver_bounds[H5F_HIGH_BOUND(f)])
+ HGOTO_ERROR(H5E_DATASET, H5E_BADRANGE, FAIL, "layout version out of bounds")
- /* Set the latest indexing type for the layout message */
- if(H5D__layout_set_latest_indexing(layout, space, dcpl_cache) < 0)
- HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set latest indexing type")
+ /* Set the message version */
+ layout->version = version;
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5D__layout_set_latest_version() */
+} /* end H5D__layout_set_version() */
/*-------------------------------------------------------------------------
* Function: H5D__layout_set_latest_indexing
*
* Purpose: Set the latest indexing type for a layout message
- * This is moved from H5D_layout_set_latest_version().
*
* Return: Non-negative on success/Negative on failure
*
diff --git a/src/H5Dpkg.h b/src/H5Dpkg.h
index 45f2d3a..78705c7 100644
--- a/src/H5Dpkg.h
+++ b/src/H5Dpkg.h
@@ -562,6 +562,9 @@ H5_DLLVAR const H5D_chunk_ops_t H5D_COPS_BT2[1];
H5_DLLVAR const H5B2_class_t H5D_BT2[1];
H5_DLLVAR const H5B2_class_t H5D_BT2_FILT[1];
+/* Array of versions for Layout */
+H5_DLLVAR const unsigned H5O_layout_ver_bounds[H5F_LIBVER_NBOUNDS];
+
/******************************/
/* Package Private Prototypes */
diff --git a/src/H5F.c b/src/H5F.c
index f435502..8e5f65a 100644
--- a/src/H5F.c
+++ b/src/H5F.c
@@ -1477,7 +1477,8 @@ H5Fstart_swmr_write(hid_t file_id)
if(file->shared->sblock->super_vers < HDF5_SUPERBLOCK_VERSION_3)
HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, FAIL, "file superblock version should be at least 3")
- HDassert((file->shared->latest_flags | H5F_LATEST_LAYOUT_MSG) > 0);
+
+ HDassert((file->shared->low_bound == H5F_LIBVER_V110) && (file->shared->high_bound == H5F_LIBVER_V110));
/* Should not be marked for SWMR writing mode already */
if(file->shared->sblock->status_flags & H5F_SUPER_SWMR_WRITE_ACCESS)
@@ -1740,41 +1741,36 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5Fset_latest_format
+ * Function: H5Fset_libver_bounds
*
- * Purpose: Enable switching the "latest format" flag while a file is open.
+ * Purpose: Set to a different low and high bounds while a file is open.
+ * This public routine is introduced in place of
+ * H5Fset_latest_format() starting release 1.10.2.
+ * See explanation for H5Fset_latest_format() in H5Fdeprec.c.
*
* Return: Non-negative on success/Negative on failure
*-------------------------------------------------------------------------
*/
herr_t
-H5Fset_latest_format(hid_t file_id, hbool_t latest_format)
+H5Fset_libver_bounds(hid_t file_id, H5F_libver_t low, H5F_libver_t high)
{
H5F_t *f; /* File */
- unsigned latest_flags; /* Latest format flags for file */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
- H5TRACE2("e", "ib", file_id, latest_format);
+ H5TRACE3("e", "iFvFv", file_id, low, high);
/* Check args */
if(NULL == (f = (H5F_t *)H5I_object_verify(file_id, H5I_FILE)))
HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, FAIL, "not a file ID")
- /* Check if the value is changing */
- latest_flags = H5F_USE_LATEST_FLAGS(f, H5F_LATEST_ALL_FLAGS);
- if(latest_format != (H5F_LATEST_ALL_FLAGS == latest_flags)) {
- /* Call the flush routine, for this file */
- if(H5F__flush(f, H5AC_ind_read_dxpl_id, H5AC_rawdata_dxpl_id, FALSE) < 0)
- HGOTO_ERROR(H5E_FILE, H5E_CANTFLUSH, FAIL, "unable to flush file's cached information")
-
- /* Toggle the 'latest format' flag */
- H5F_SET_LATEST_FLAGS(f, latest_format ? H5F_LATEST_ALL_FLAGS : 0);
- } /* end if */
+ /* Call private set_libver_bounds function */
+ if(H5F_set_libver_bounds(f, low, high) < 0)
+ HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "cannot set low/high bounds")
done:
FUNC_LEAVE_API(ret_value)
-} /* end H5Fset_latest_format() */
+} /* end H5Fset_libver_bounds() */
/*-------------------------------------------------------------------------
diff --git a/src/H5Fdeprec.c b/src/H5Fdeprec.c
index 03f5df8..a9ffa43 100644
--- a/src/H5Fdeprec.c
+++ b/src/H5Fdeprec.c
@@ -143,5 +143,67 @@ done:
FUNC_LEAVE_API(ret_value)
} /* end H5Fget_info1() */
+
+/*-------------------------------------------------------------------------
+ * Function: H5Fset_latest_format
+ *
+ * Purpose: Enable switching between latest or non-latest format while
+ * a file is open.
+ * This is deprecated starting release 1.10.2 and is modified
+ * to call the private H5F_set_libver_bounds() to set the
+ * bounds.
+ *
+ * Before release 1.10.2, the library supports only two
+ * combinations of low/high bounds:
+ * (earliest, latest)
+ * (latest, latest)
+ * Thus, this public routine does the job in switching
+ * between the two combinations listed above.
+ *
+ * Starting release 1.10.2, we add v18 to the enumerated
+ * define H5F_libver_t and the library supports five combinations
+ * as below:
+ * (earliest, v18)
+ * (earliest, v10)
+ * (v18, v18)
+ * (v18, v10)
+ * (v10, v10)
+ * So we introduce the new public routine H5Fset_libver_bounds()
+ * in place of H5Fset_latest_format().
+ * See also RFC: Setting Bounds for Object Creation in HDF5 1.10.0.
+ *
+ * Return: Non-negative on success/Negative on failure
+ *
+ * Programmer: Vailin Choi; December 2017
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5Fset_latest_format(hid_t file_id, hbool_t latest_format)
+{
+ H5F_t *f; /* File */
+ H5F_libver_t low = H5F_LIBVER_LATEST; /* Low bound */
+ H5F_libver_t high = H5F_LIBVER_LATEST; /* High bound */
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_API(FAIL)
+ H5TRACE2("e", "ib", file_id, latest_format);
+
+ /* Check args */
+ if(NULL == (f = (H5F_t *)H5I_object_verify(file_id, H5I_FILE)))
+ HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, FAIL, "not a file ID")
+
+ /* 'low' and 'high' are both initialized to LATEST.
+ If latest format is not expected, set 'low' to EARLIEST */
+ if(!latest_format)
+ low = H5F_LIBVER_EARLIEST;
+
+ /* Call private set_libver_bounds function to set the bounds */
+ if(H5F_set_libver_bounds(f, low, high) < 0)
+ HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "cannot set low/high bounds")
+
+done:
+ FUNC_LEAVE_API(ret_value)
+} /* end H5Fset_latest_format() */
#endif /* H5_NO_DEPRECATED_SYMBOLS */
diff --git a/src/H5Fint.c b/src/H5Fint.c
index 717d586..135d878 100644
--- a/src/H5Fint.c
+++ b/src/H5Fint.c
@@ -161,10 +161,10 @@ H5F_get_access_plist(H5F_t *f, hbool_t app_ref)
HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't sieve buffer size")
if(H5P_set(new_plist, H5F_ACS_SDATA_BLOCK_SIZE_NAME, &(f->shared->sdata_aggr.alloc_size)) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set 'small data' cache size")
- if(f->shared->latest_flags > 0)
- latest_format = TRUE;
- if(H5P_set(new_plist, H5F_ACS_LATEST_FORMAT_NAME, &latest_format) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set 'latest format' flag")
+ if(H5P_set(new_plist, H5F_ACS_LIBVER_LOW_BOUND_NAME, &f->shared->low_bound) < 0)
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set 'low' bound for library format versions")
+ if(H5P_set(new_plist, H5F_ACS_LIBVER_HIGH_BOUND_NAME, &f->shared->high_bound) < 0)
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set 'high' bound for library format versions")
if(H5P_set(new_plist, H5F_ACS_METADATA_READ_ATTEMPTS_NAME, &(f->shared->read_attempts)) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set 'read attempts ' flag")
if(H5P_set(new_plist, H5F_ACS_OBJECT_FLUSH_CB_NAME, &(f->shared->object_flush)) < 0)
@@ -902,13 +902,10 @@ H5F_new(H5F_file_t *shared, unsigned flags, hid_t fcpl_id, hid_t fapl_id, H5FD_t
HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't get garbage collect reference")
if(H5P_get(plist, H5F_ACS_SIEVE_BUF_SIZE_NAME, &(f->shared->sieve_buf_size)) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't get sieve buffer size")
- if(H5P_get(plist, H5F_ACS_LATEST_FORMAT_NAME, &latest_format) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't get 'latest format' flag")
- /* For latest format or SWMR_WRITE, activate all latest version support */
- if(latest_format)
- f->shared->latest_flags |= H5F_LATEST_ALL_FLAGS;
- else if(H5F_INTENT(f) & H5F_ACC_SWMR_WRITE)
- f->shared->latest_flags |= H5F_LATEST_LAYOUT_MSG;
+ if(H5P_get(plist, H5F_ACS_LIBVER_LOW_BOUND_NAME, &(f->shared->low_bound)) < 0)
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't get 'low' bound for library format versions")
+ if(H5P_get(plist, H5F_ACS_LIBVER_HIGH_BOUND_NAME, &(f->shared->high_bound)) < 0)
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't get 'high' bound for library format versions")
if(H5P_get(plist, H5F_ACS_USE_MDC_LOGGING_NAME, &(f->shared->use_mdc_logging)) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't get 'use mdc logging' flag")
if(H5P_get(plist, H5F_ACS_START_MDC_LOG_ON_ACCESS_NAME, &(f->shared->start_mdc_log_on_access)) < 0)
@@ -2582,7 +2579,39 @@ H5F_set_store_msg_crt_idx(H5F_t *f, hbool_t flag)
FUNC_LEAVE_NOAPI(SUCCEED)
} /* H5F_set_store_msg_crt_idx() */
+/*-------------------------------------------------------------------------
+ * Function: H5F_set_libver_bounds()
+ *
+ * Purpose: Set the file's low and high bound to the input parameters
+ * 'low' and 'high' respectively.
+ * This is done only if the existing setting is different
+ * from the inputs.
+ *
+ * Return: SUCCEED on success, and FAIL on failure.
+ *
+ * Programmer: Vailin Choi; December 2017
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5F_set_libver_bounds(H5F_t * f, H5F_libver_t low, H5F_libver_t high)
+{
+ FUNC_ENTER_NOAPI_NOINIT_NOERR
+ /* Sanity checks */
+ HDassert(f);
+ HDassert(f->shared);
+
+ /* Set the bounds only if the existing setting is different from the inputs */
+ if(f->shared->low_bound != low || f->shared->high_bound != high) {
+ f->shared->low_bound = low;
+ f->shared->high_bound = high;
+ }
+
+ FUNC_LEAVE_NOAPI(SUCCEED)
+} /* H5F_set_libver_bounds() */
+
+
/*-------------------------------------------------------------------------
* Function: H5F_get_file_image
*
@@ -2919,30 +2948,3 @@ H5F_set_coll_md_read(H5F_t *f, H5P_coll_md_read_flag_t cmr)
FUNC_LEAVE_NOAPI_VOID
} /* H5F_set_coll_md_read() */
#endif /* H5_HAVE_PARALLEL */
-
-
-/*-------------------------------------------------------------------------
- * Function: H5F_set_latest_flags
- *
- * Purpose: Set the latest_flags field with a new value.
- *
- * Return: Success: SUCCEED
- * Failure: FAIL
- *-------------------------------------------------------------------------
- */
-herr_t
-H5F_set_latest_flags(H5F_t *f, unsigned flags)
-{
- /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */
- FUNC_ENTER_NOAPI_NOINIT_NOERR
-
- /* Sanity check */
- HDassert(f);
- HDassert(f->shared);
- HDassert(0 == ((~flags) & H5F_LATEST_ALL_FLAGS));
-
- f->shared->latest_flags = flags;
-
- FUNC_LEAVE_NOAPI(SUCCEED)
-} /* H5F_set_latest_flags() */
-
diff --git a/src/H5Fpkg.h b/src/H5Fpkg.h
index b50b4e5..c9aba56 100644
--- a/src/H5Fpkg.h
+++ b/src/H5Fpkg.h
@@ -300,7 +300,8 @@ struct H5F_file_t {
hsize_t threshold; /* Threshold for alignment */
hsize_t alignment; /* Alignment */
unsigned gc_ref; /* Garbage-collect references? */
- unsigned latest_flags; /* The latest version support */
+ H5F_libver_t low_bound; /* The 'low' bound of library format versions */
+ H5F_libver_t high_bound; /* The 'high' bound of library format versions */
hbool_t store_msg_crt_idx; /* Store creation index for object header messages? */
unsigned ncwfs; /* Num entries on cwfs list */
struct H5HG_heap_t **cwfs; /* Global heap cache */
diff --git a/src/H5Fprivate.h b/src/H5Fprivate.h
index 49c5098..856e618 100644
--- a/src/H5Fprivate.h
+++ b/src/H5Fprivate.h
@@ -275,6 +275,8 @@ typedef struct H5F_t H5F_t;
/* If the module using this macro is allowed access to the private variables, access them directly */
#ifdef H5F_MODULE
+#define H5F_LOW_BOUND(F) ((F)->shared->low_bound)
+#define H5F_HIGH_BOUND(F) ((F)->shared->high_bound)
#define H5F_INTENT(F) ((F)->shared->flags)
#define H5F_OPEN_NAME(F) ((F)->open_name)
#define H5F_ACTUAL_NAME(F) ((F)->actual_name)
@@ -311,14 +313,12 @@ typedef struct H5F_t H5F_t;
#define H5F_RDCC_W0(F) ((F)->shared->rdcc_w0)
#define H5F_SIEVE_BUF_SIZE(F) ((F)->shared->sieve_buf_size)
#define H5F_GC_REF(F) ((F)->shared->gc_ref)
-#define H5F_USE_LATEST_FLAGS(F,FL) ((F)->shared->latest_flags & (FL))
#define H5F_STORE_MSG_CRT_IDX(F) ((F)->shared->store_msg_crt_idx)
#define H5F_SET_STORE_MSG_CRT_IDX(F, FL) ((F)->shared->store_msg_crt_idx = (FL))
#define H5F_GRP_BTREE_SHARED(F) ((F)->shared->grp_btree_shared)
#define H5F_SET_GRP_BTREE_SHARED(F, RC) (((F)->shared->grp_btree_shared = (RC)) ? SUCCEED : FAIL)
#define H5F_USE_TMP_SPACE(F) ((F)->shared->fs.use_tmp_space)
#define H5F_IS_TMP_ADDR(F, ADDR) (H5F_addr_le((F)->shared->fs.tmp_addr, (ADDR)))
-#define H5F_SET_LATEST_FLAGS(F, FL) ((F)->shared->latest_flags = (FL))
#ifdef H5_HAVE_PARALLEL
#define H5F_COLL_MD_READ(F) ((F)->coll_md_read)
#endif /* H5_HAVE_PARALLEL */
@@ -332,6 +332,8 @@ typedef struct H5F_t H5F_t;
#define H5F_FIRST_ALLOC_DEALLOC(F) ((F)->shared->first_alloc_dealloc)
#define H5F_EOA_PRE_FSM_FSALLOC(F) ((F)->shared->eoa_pre_fsm_fsalloc)
#else /* H5F_MODULE */
+#define H5F_LOW_BOUND(F) (H5F_get_low_bound(F))
+#define H5F_HIGH_BOUND(F) (H5F_get_high_bound(F))
#define H5F_INTENT(F) (H5F_get_intent(F))
#define H5F_OPEN_NAME(F) (H5F_get_open_name(F))
#define H5F_ACTUAL_NAME(F) (H5F_get_actual_name(F))
@@ -368,14 +370,12 @@ typedef struct H5F_t H5F_t;
#define H5F_RDCC_W0(F) (H5F_rdcc_w0(F))
#define H5F_SIEVE_BUF_SIZE(F) (H5F_sieve_buf_size(F))
#define H5F_GC_REF(F) (H5F_gc_ref(F))
-#define H5F_USE_LATEST_FLAGS(F,FL) (H5F_use_latest_flags(F,FL))
#define H5F_STORE_MSG_CRT_IDX(F) (H5F_store_msg_crt_idx(F))
#define H5F_SET_STORE_MSG_CRT_IDX(F, FL) (H5F_set_store_msg_crt_idx((F), (FL)))
#define H5F_GRP_BTREE_SHARED(F) (H5F_grp_btree_shared(F))
#define H5F_SET_GRP_BTREE_SHARED(F, RC) (H5F_set_grp_btree_shared((F), (RC)))
#define H5F_USE_TMP_SPACE(F) (H5F_use_tmp_space(F))
#define H5F_IS_TMP_ADDR(F, ADDR) (H5F_is_tmp_addr((F), (ADDR)))
-#define H5F_SET_LATEST_FLAGS(F, FL) (H5F_set_latest_flags((F), (FL)))
#ifdef H5_HAVE_PARALLEL
#define H5F_COLL_MD_READ(F) (H5F_coll_md_read(F))
#endif /* H5_HAVE_PARALLEL */
@@ -484,7 +484,8 @@ typedef struct H5F_t H5F_t;
#define H5F_ACS_FAMILY_NEWSIZE_NAME "family_newsize" /* New member size of family driver. (private property only used by h5repart) */
#define H5F_ACS_FAMILY_TO_SEC2_NAME "family_to_sec2" /* Whether to convert family to sec2 driver. (private property only used by h5repart) */
#define H5F_ACS_MULTI_TYPE_NAME "multi_type" /* Data type in multi file driver */
-#define H5F_ACS_LATEST_FORMAT_NAME "latest_format" /* 'Use latest format version' flag */
+#define H5F_ACS_LIBVER_LOW_BOUND_NAME "libver_low_bound" /* 'low' bound of library format versions */
+#define H5F_ACS_LIBVER_HIGH_BOUND_NAME "libver_high_bound" /* 'high' bound of library format versions */
#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 */
@@ -629,23 +630,6 @@ typedef struct H5F_t H5F_t;
#define H5SM_TABLE_MAGIC "SMTB" /* Shared Message Table */
#define H5SM_LIST_MAGIC "SMLI" /* Shared Message List */
-
-/* Latest format will activate the following latest version support */
-/* "latest_flags" in H5F_file_t */
-#define H5F_LATEST_DATATYPE 0x0001
-#define H5F_LATEST_DATASPACE 0x0002
-#define H5F_LATEST_ATTRIBUTE 0x0004
-#define H5F_LATEST_FILL_MSG 0x0008
-#define H5F_LATEST_PLINE_MSG 0x0010
-#define H5F_LATEST_LAYOUT_MSG 0x0020
-#define H5F_LATEST_NO_MOD_TIME_MSG 0x0040
-#define H5F_LATEST_STYLE_GROUP 0x0080
-#define H5F_LATEST_OBJ_HEADER 0x0100
-#define H5F_LATEST_SUPERBLOCK 0x0200
-#define H5F_LATEST_ALL_FLAGS (H5F_LATEST_DATATYPE | H5F_LATEST_DATASPACE | H5F_LATEST_ATTRIBUTE | H5F_LATEST_FILL_MSG | H5F_LATEST_PLINE_MSG | H5F_LATEST_LAYOUT_MSG | H5F_LATEST_NO_MOD_TIME_MSG | H5F_LATEST_STYLE_GROUP | H5F_LATEST_OBJ_HEADER | H5F_LATEST_SUPERBLOCK)
-
-#define H5F_LATEST_DSET_MSG_FLAGS (H5F_LATEST_FILL_MSG | H5F_LATEST_PLINE_MSG | H5F_LATEST_LAYOUT_MSG)
-
/****************************/
/* Library Private Typedefs */
/****************************/
@@ -736,7 +720,9 @@ H5_DLL H5F_t *H5F_open(const char *name, unsigned flags, hid_t fcpl_id,
hid_t fapl_id, hid_t dxpl_id);
H5_DLL herr_t H5F_try_close(H5F_t *f, hbool_t *was_closed/*out*/);
-/* Functions than retrieve values from the file struct */
+/* Functions that retrieve values from the file struct */
+H5_DLL H5F_libver_t H5F_get_low_bound(const H5F_t *f);
+H5_DLL H5F_libver_t H5F_get_high_bound(const H5F_t *f);
H5_DLL unsigned H5F_get_intent(const H5F_t *f);
H5_DLL char *H5F_get_open_name(const H5F_t *f);
H5_DLL char *H5F_get_actual_name(const H5F_t *f);
@@ -783,11 +769,11 @@ H5_DLL unsigned H5F_gc_ref(const H5F_t *f);
H5_DLL unsigned H5F_use_latest_flags(const H5F_t *f, unsigned fl);
H5_DLL hbool_t H5F_store_msg_crt_idx(const H5F_t *f);
H5_DLL herr_t H5F_set_store_msg_crt_idx(H5F_t *f, hbool_t flag);
+H5_DLL herr_t H5F_set_libver_bounds(H5F_t * f, H5F_libver_t low, H5F_libver_t high);
H5_DLL struct H5UC_t *H5F_grp_btree_shared(const H5F_t *f);
H5_DLL herr_t H5F_set_grp_btree_shared(H5F_t *f, struct H5UC_t *rc);
H5_DLL hbool_t H5F_use_tmp_space(const H5F_t *f);
H5_DLL hbool_t H5F_is_tmp_addr(const H5F_t *f, haddr_t addr);
-H5_DLL herr_t H5F_set_latest_flags(H5F_t *f, unsigned flags);
H5_DLL hsize_t H5F_get_alignment(const H5F_t *f);
H5_DLL hsize_t H5F_get_threshold(const H5F_t *f);
#ifdef H5_HAVE_PARALLEL
diff --git a/src/H5Fpublic.h b/src/H5Fpublic.h
index 1594cb2..d333fa7 100644
--- a/src/H5Fpublic.h
+++ b/src/H5Fpublic.h
@@ -173,12 +173,17 @@ typedef struct H5F_sect_info_t {
hsize_t size; /* Size of free space section */
} H5F_sect_info_t;
-/* Library's file format versions */
+/* Library's format versions */
typedef enum H5F_libver_t {
- H5F_LIBVER_EARLIEST, /* Use the earliest possible format for storing objects */
- H5F_LIBVER_LATEST /* Use the latest possible format available for storing objects*/
+ H5F_LIBVER_ERROR = -1,
+ H5F_LIBVER_EARLIEST = 0, /* Use the earliest possible format for storing objects */
+ H5F_LIBVER_V18 = 1, /* Use the latest v18 format for storing objects */
+ H5F_LIBVER_V110 = 2, /* Use the latest v10 format for storing objects */
+ H5F_LIBVER_NBOUNDS
} H5F_libver_t;
+#define H5F_LIBVER_LATEST H5F_LIBVER_V110
+
/* File space handling strategy */
typedef enum H5F_fspace_strategy_t {
H5F_FSPACE_STRATEGY_FSM_AGGR = 0, /* Mechanisms: free-space managers, aggregators, and virtual file drivers */
@@ -255,7 +260,7 @@ H5_DLL herr_t H5Fstart_swmr_write(hid_t file_id);
H5_DLL ssize_t H5Fget_free_sections(hid_t file_id, H5F_mem_t type,
size_t nsects, H5F_sect_info_t *sect_info/*out*/);
H5_DLL herr_t H5Fclear_elink_file_cache(hid_t file_id);
-H5_DLL herr_t H5Fset_latest_format(hid_t file_id, hbool_t latest_format);
+H5_DLL herr_t H5Fset_libver_bounds(hid_t file_id, H5F_libver_t low, H5F_libver_t high);
H5_DLL herr_t H5Fstart_mdc_logging(hid_t file_id);
H5_DLL herr_t H5Fstop_mdc_logging(hid_t file_id);
H5_DLL herr_t H5Fget_mdc_logging_status(hid_t file_id,
@@ -295,6 +300,7 @@ typedef struct H5F_info1_t {
/* Function prototypes */
H5_DLL herr_t H5Fget_info1(hid_t obj_id, H5F_info1_t *finfo);
+H5_DLL herr_t H5Fset_latest_format(hid_t file_id, hbool_t latest_format);
#endif /* H5_NO_DEPRECATED_SYMBOLS */
diff --git a/src/H5Fquery.c b/src/H5Fquery.c
index 4765d00..f7e222e 100644
--- a/src/H5Fquery.c
+++ b/src/H5Fquery.c
@@ -97,6 +97,56 @@ H5F_get_intent(const H5F_t *f)
/*-------------------------------------------------------------------------
+ * Function: H5F_get_low_bound
+ *
+ * Purpose: Quick and dirty routine to retrieve the file's low_bound.
+ * (Mainly added to stop non-file routines from poking about in the
+ * H5F_t data structure)
+ *
+ * Return: low_bound on success/abort on failure (shouldn't fail)
+ *
+ * Programmer: Vailin Choi; June 2016
+ *
+ *-------------------------------------------------------------------------
+ */
+H5F_libver_t
+H5F_get_low_bound(const H5F_t *f)
+{
+ /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */
+ FUNC_ENTER_NOAPI_NOINIT_NOERR
+
+ HDassert(f);
+
+ FUNC_LEAVE_NOAPI(f->shared->low_bound)
+} /* end H5F_get_low_bound() */
+
+
+/*-------------------------------------------------------------------------
+ * Function: H5F_get_high_bound
+ *
+ * Purpose: Quick and dirty routine to retrieve the file's high_bound.
+ * (Mainly added to stop non-file routines from poking about in the
+ * H5F_t data structure)
+ *
+ * Return: high_bound on success/abort on failure (shouldn't fail)
+ *
+ * Programmer: Vailin Choi; June 2016
+ *
+ *-------------------------------------------------------------------------
+ */
+H5F_libver_t
+H5F_get_high_bound(const H5F_t *f)
+{
+ /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */
+ FUNC_ENTER_NOAPI_NOINIT_NOERR
+
+ HDassert(f);
+
+ FUNC_LEAVE_NOAPI(f->shared->high_bound)
+} /* end H5F_get_high_bound() */
+
+
+/*-------------------------------------------------------------------------
* Function: H5F_get_open_name
*
* Purpose: Retrieve the name used to open a file.
@@ -667,9 +717,13 @@ H5F_sieve_buf_size(const H5F_t *f)
* references flag" now that the generic properties are being used
* to store the values.
*
- * Return: Success: The "garbage collect references flag"
- * is returned.
- * Failure: (should not happen)
+ * Return: Success: The "garbage collect references flag" is returned.
+ * Failure: (should not happen)
+ *
+ * Programmer: Quincey Koziol
+ * koziol@ncsa.uiuc.edu
+ * Jul 8 2005
+ *
*-------------------------------------------------------------------------
*/
unsigned
@@ -686,28 +740,6 @@ H5F_gc_ref(const H5F_t *f)
/*-------------------------------------------------------------------------
- * Function: H5F_use_latest_flags
- *
- * Purpose: Retrieve the 'latest version support' for the file.
- *
- * Return: Success: Non-negative, the requested 'version support'
- * Failure: (can't happen)
- *-------------------------------------------------------------------------
- */
-unsigned
-H5F_use_latest_flags(const H5F_t *f, unsigned fl)
-{
- /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */
- FUNC_ENTER_NOAPI_NOINIT_NOERR
-
- HDassert(f);
- HDassert(f->shared);
-
- FUNC_LEAVE_NOAPI(f->shared->latest_flags & (fl))
-} /* end H5F_use_latest_flags() */
-
-
-/*-------------------------------------------------------------------------
* Function: H5F_get_fc_degree
*
* Purpose: Retrieve the 'file close degree' for the file.
diff --git a/src/H5Fsuper.c b/src/H5Fsuper.c
index 0c6f9cd..4250ff0 100644
--- a/src/H5Fsuper.c
+++ b/src/H5Fsuper.c
@@ -59,7 +59,6 @@ static herr_t H5F__update_super_ext_driver_msg(H5F_t *f, hid_t dxpl_id);
/* Package Variables */
/*********************/
-
/*****************************/
/* Library Private Variables */
/*****************************/
@@ -72,6 +71,12 @@ H5FL_DEFINE(H5F_super_t);
/* Local Variables */
/*******************/
+/* Format version bounds for superblock */
+static const unsigned HDF5_superblock_ver_bounds[] = {
+ HDF5_SUPERBLOCK_VERSION_DEF, /* H5F_LIBVER_EARLIEST */
+ HDF5_SUPERBLOCK_VERSION_2, /* H5F_LIBVER_V18 */
+ HDF5_SUPERBLOCK_VERSION_LATEST /* H5F_LIBVER_LATEST */
+};
/*-------------------------------------------------------------------------
@@ -452,13 +457,46 @@ H5F__super_read(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hbool_t initial
if(NULL == (sblock = (H5F_super_t *)H5AC_protect(f, meta_dxpl_id, H5AC_SUPERBLOCK, (haddr_t)0, &udata, rw_flags)))
HGOTO_ERROR(H5E_FILE, H5E_CANTPROTECT, FAIL, "unable to load superblock")
- if(H5F_INTENT(f) & H5F_ACC_SWMR_WRITE)
- if(sblock->super_vers < HDF5_SUPERBLOCK_VERSION_3)
- HGOTO_ERROR(H5E_FILE, H5E_CANTPROTECT, FAIL, "invalid superblock version for SWMR_WRITE")
+ /*
+ * When opening a file with SWMR-write access, the library will first
+ * check to ensure that superblock version 3 is used. Otherwise fail
+ * file open.
+ *
+ * Then the library will upgrade the file's low_bound depending on
+ * superblock version as follows:
+ * --version 0 or 1: no change to low_bound
+ * --version 2: upgrade low_bound to at least V18
+ * --version 3: upgrade low_bound to at least V110
+ *
+ * Upgrading low_bound will give the best format versions available for
+ * that superblock version. Due to the possible upgrade, the fapl returned
+ * from H5Fget_access_plist() might indicate a low_bound higher than what
+ * the user originally set.
+ *
+ * After upgrading low_bound, the library will check to ensure that the
+ * superblock version does not exceed the version allowed by high_bound.
+ * Otherise fail file open.
+ *
+ * For details, please see RFC:Setting Bounds for Object Creation in HDF5 1.10.0.
+ */
+
+ /* Check to ensure that superblock version 3 is used for SWMR-write access */
+ if(H5F_INTENT(f) & H5F_ACC_SWMR_WRITE) {
+ if(sblock->super_vers < HDF5_SUPERBLOCK_VERSION_3)
+ HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, FAIL, "superblock version for SWMR is less than 3")
+ }
- /* Enable all latest version support when file has v3 superblock */
+ /* Upgrade low_bound to at least V18 when encountering version 2 superblock */
+ if(sblock->super_vers == HDF5_SUPERBLOCK_VERSION_2)
+ f->shared->low_bound = MAX(H5F_LIBVER_V18, f->shared->low_bound);
+
+ /* Upgrade low_bound to at least V110 when encountering version 3 superblock */
if(sblock->super_vers >= HDF5_SUPERBLOCK_VERSION_3)
- f->shared->latest_flags |= H5F_LATEST_ALL_FLAGS;
+ f->shared->low_bound = MAX(H5F_LIBVER_V110, f->shared->low_bound);
+
+ /* Version bounds check */
+ if(sblock->super_vers > HDF5_superblock_ver_bounds[f->shared->high_bound])
+ HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, FAIL, "superblock version exceeds high bound")
/* Pin the superblock in the cache */
if(H5AC_pin_protected_entry(sblock) < 0)
@@ -1018,14 +1056,42 @@ H5F__super_init(H5F_t *f, hid_t dxpl_id)
f->shared->fs_page_size == H5F_FILE_SPACE_PAGE_SIZE_DEF))
non_default_fs_settings = TRUE;
- /* Bump superblock version if latest superblock version support is enabled */
- if(H5F_USE_LATEST_FLAGS(f, H5F_LATEST_SUPERBLOCK))
- super_vers = HDF5_SUPERBLOCK_VERSION_LATEST;
- /* Bump superblock version to use version 3 superblock for SWMR writing */
- else if((H5F_INTENT(f) & H5F_ACC_SWMR_WRITE))
+ /*
+ * When creating a file with write access, the library will:
+ * -- set superblock version to 0, 1 or 2 based on feature enabled
+ * -- no change to low_bound
+ * When creating a file with SWMR-write access, the library will:
+ * (See explanation (#) below.)
+ * -- set superblock version to 3
+ * -- upgrade low_bound to at least V110
+ *
+ * Then the library will finalize superblock version to that allowed by
+ * low_bound if that is higher.
+ * Lastly, the library will check to ensure the superblock version does not
+ * exceed the version allowed by high_bound. Otherwise fail file open.
+ *
+ * For details, please see RFC:Setting Bounds for Object Creation in HDF5 1.10.0.
+ *
+ * (#)
+ * Version 3 superblock is introduced in 1.10 for SWMR due to the problem of
+ * the status_flags field in the superblock. The problem is discussed in
+ * jira issue SWMR-79 and also in the RFC: File Format Changes in HDF5 1.10.0.
+ * The file's low_bound is upgraded for SWMR so that the library will
+ * use the best format versions available in 1.10.
+ * Due to the possible upgrade, the fapl returned from H5Fget_access_plist()
+ * might indicate a low_bound higher than what the user originally set.
+ */
+
+ /*
+ * Creating a file with SWMR-write access will
+ * upgrade superblock version and low_bound
+ */
+ if(H5F_INTENT(f) & H5F_ACC_SWMR_WRITE) {
super_vers = HDF5_SUPERBLOCK_VERSION_3;
+ f->shared->low_bound = MAX(H5F_LIBVER_V110, f->shared->low_bound);
+
/* Bump superblock version to create superblock extension for SOHM info */
- else if(f->shared->sohm_nindexes > 0)
+ } else if(f->shared->sohm_nindexes > 0)
super_vers = HDF5_SUPERBLOCK_VERSION_2;
/*
* Bump superblock version to create superblock extension for:
@@ -1043,6 +1109,13 @@ H5F__super_init(H5F_t *f, hid_t dxpl_id)
else if(sblock->btree_k[H5B_CHUNK_ID] != HDF5_BTREE_CHUNK_IK_DEF)
super_vers = HDF5_SUPERBLOCK_VERSION_1;
+ /* Finalize superblock version to that allowed by the file's low bound if higher */
+ super_vers = MAX(super_vers, HDF5_superblock_ver_bounds[f->shared->low_bound]);
+
+ /* Version bounds check */
+ if(super_vers > HDF5_superblock_ver_bounds[f->shared->high_bound])
+ HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, FAIL, "superblock version out of bounds")
+
/* If a newer superblock version is required, set it here */
if(super_vers != HDF5_SUPERBLOCK_VERSION_DEF) {
H5P_genplist_t *c_plist; /* Property list */
@@ -1067,8 +1140,8 @@ H5F__super_init(H5F_t *f, hid_t dxpl_id)
/* Sanity check the userblock size vs. the file's allocation alignment */
if(userblock_size > 0) {
- /* Set up the alignment to use for page or aggr fs */
- hsize_t alignment = H5F_PAGED_AGGR(f) ? f->shared->fs_page_size : f->shared->alignment;
+ /* Set up the alignment to use for page or aggr fs */
+ hsize_t alignment = H5F_PAGED_AGGR(f) ? f->shared->fs_page_size : f->shared->alignment;
if(userblock_size < alignment)
HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, FAIL, "userblock size must be > file object alignment")
diff --git a/src/H5Gobj.c b/src/H5Gobj.c
index d2dc83b..5f9bdc8 100644
--- a/src/H5Gobj.c
+++ b/src/H5Gobj.c
@@ -185,7 +185,7 @@ H5G__obj_create_real(H5F_t *f, hid_t dxpl_id, const H5O_ginfo_t *ginfo,
H5G_obj_create_t *gcrt_info, H5O_loc_t *oloc/*out*/)
{
size_t hdr_size; /* Size of object header to request */
- hbool_t use_latest_format; /* Flag indicating the new group format should be used */
+ hbool_t use_at_least_v18; /* Flag indicating the new group format should be used */
hid_t gcpl_id = gcrt_info->gcpl_id; /* Group creation property list ID */
herr_t ret_value = SUCCEED; /* Return value */
@@ -202,24 +202,23 @@ H5G__obj_create_real(H5F_t *f, hid_t dxpl_id, const H5O_ginfo_t *ginfo,
/* Check for invalid access request */
if(0 == (H5F_INTENT(f) & H5F_ACC_RDWR))
- HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "no write intent on file")
+ HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "no write intent on file")
- /* Check for using the latest version of the group format */
+ /* Check for using the latest version of the group format which is introduced in v18 */
/* (add more checks for creating "new format" groups when needed) */
- if(H5F_USE_LATEST_FLAGS(f, H5F_LATEST_STYLE_GROUP) || linfo->track_corder
- || (pline && pline->nused))
- use_latest_format = TRUE;
+ if((H5F_LOW_BOUND(f) >= H5F_LIBVER_V18) || linfo->track_corder || (pline && pline->nused))
+ use_at_least_v18 = TRUE;
else
- use_latest_format = FALSE;
+ use_at_least_v18 = FALSE;
/* Make certain that the creation order is being tracked if an index is
* going to be built on it.
*/
if(linfo->index_corder && !linfo->track_corder)
- HGOTO_ERROR(H5E_SYM, H5E_BADVALUE, FAIL, "must track creation order to create index for it")
+ HGOTO_ERROR(H5E_SYM, H5E_BADVALUE, FAIL, "must track creation order to create index for it")
/* Check if we should be using the latest version of the group format */
- if(use_latest_format) {
+ if(use_at_least_v18) {
H5O_link_t lnk; /* Temporary link message info for computing message size */
char null_char = '\0'; /* Character for creating null string */
size_t ginfo_size; /* Size of the group info message */
@@ -262,10 +261,10 @@ H5G__obj_create_real(H5F_t *f, hid_t dxpl_id, const H5O_ginfo_t *ginfo,
* incremented if the object is added to the group directed graph.
*/
if(H5O_create(f, dxpl_id, hdr_size, (size_t)1, gcpl_id, oloc/*out*/) < 0)
- HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't create header")
+ HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't create header")
/* Check for format of group to create */
- if(use_latest_format) {
+ if(use_at_least_v18) {
/* Insert link info message */
/* (Casting away const OK - QAK) */
if(H5O_msg_create(oloc, H5O_LINFO_ID, 0, H5O_UPDATE_TIME, (void *)linfo, dxpl_id) < 0)
diff --git a/src/H5HFhdr.c b/src/H5HFhdr.c
index 2f01ce6..89b3b47 100644
--- a/src/H5HFhdr.c
+++ b/src/H5HFhdr.c
@@ -424,11 +424,9 @@ H5HF_hdr_create(H5F_t *f, hid_t dxpl_id, const H5HF_create_t *cparam)
if(NULL == H5O_msg_copy(H5O_PLINE_ID, &(cparam->pline), &(hdr->pline)))
HGOTO_ERROR(H5E_HEAP, H5E_CANTCOPY, HADDR_UNDEF, "can't copy I/O filter pipeline")
- /* Pay attention to the latest version flag for the file */
- if(H5F_USE_LATEST_FLAGS(hdr->f, H5F_LATEST_PLINE_MSG))
- /* Set the latest version for the I/O pipeline message */
- if(H5O_pline_set_latest_version(&(hdr->pline)) < 0)
- HGOTO_ERROR(H5E_HEAP, H5E_CANTSET, HADDR_UNDEF, "can't set latest version of I/O filter pipeline")
+ /* Set the version for the I/O pipeline message */
+ if(H5O_pline_set_version(hdr->f, &(hdr->pline)) < 0)
+ HGOTO_ERROR(H5E_HEAP, H5E_CANTSET, HADDR_UNDEF, "can't set version of I/O filter pipeline")
/* Compute the I/O filters' encoded size */
if(0 == (hdr->filter_len = (unsigned)H5O_msg_raw_size(hdr->f, H5O_PLINE_ID, FALSE, &(hdr->pline))))
diff --git a/src/H5O.c b/src/H5O.c
index cf84b47..109bf99 100644
--- a/src/H5O.c
+++ b/src/H5O.c
@@ -72,7 +72,6 @@
/* Local Variables */
/*******************/
-
/*-------------------------------------------------------------------------
* Function: H5Oopen
diff --git a/src/H5Oattr.c b/src/H5Oattr.c
index cb802ea..773a16b 100644
--- a/src/H5Oattr.c
+++ b/src/H5Oattr.c
@@ -622,14 +622,23 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5O_attr_pre_copy_file(H5F_t H5_ATTR_UNUSED *file_src, const void H5_ATTR_UNUSED *native_src,
+H5O_attr_pre_copy_file(H5F_t H5_ATTR_UNUSED *file_src, const void *native_src,
hbool_t *deleted, const H5O_copy_t *cpy_info, void H5_ATTR_UNUSED *udata)
{
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ const H5A_t *attr_src = (const H5A_t *)native_src; /* Source attribute */
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_NOAPI_NOINIT
/* check args */
HDassert(deleted);
HDassert(cpy_info);
+ HDassert(cpy_info->file_dst);
+
+ /* Check to ensure that the version of the message to be copied does not exceed
+ the message version allowed by the destination file's high bound */
+ if(attr_src->shared->version > H5O_attr_ver_bounds[H5F_HIGH_BOUND(cpy_info->file_dst)])
+ HGOTO_ERROR(H5E_OHDR, H5E_BADRANGE, FAIL, "attribute message version out of bounds")
/* If we are not copying attributes into the destination file, indicate
* that this message should be deleted.
@@ -637,7 +646,8 @@ H5O_attr_pre_copy_file(H5F_t H5_ATTR_UNUSED *file_src, const void H5_ATTR_UNUSED
if(cpy_info->copy_without_attr)
*deleted = TRUE;
- FUNC_LEAVE_NOAPI(SUCCEED)
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
} /* end H5O_attr_pre_copy_file() */
diff --git a/src/H5Ocopy.c b/src/H5Ocopy.c
index aa2a9e0..74c02f4 100644
--- a/src/H5Ocopy.c
+++ b/src/H5Ocopy.c
@@ -415,6 +415,11 @@ H5O_copy_header_real(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out*/,
/* Initialize header information */
oh_dst->version = oh_src->version;
+
+ /* Version bounds check for destination object header */
+ if(oh_dst->version > H5O_obj_ver_bounds[H5F_HIGH_BOUND(oloc_dst->file)])
+ HGOTO_ERROR(H5E_OHDR, H5E_BADRANGE, FAIL, "destination object header version out of bounds")
+
oh_dst->flags = oh_src->flags;
oh_dst->link_msgs_seen = oh_src->link_msgs_seen;
oh_dst->attr_msgs_seen = oh_src->attr_msgs_seen;
@@ -490,6 +495,12 @@ H5O_copy_header_real(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out*/,
/* Decode the message if necessary. */
H5O_LOAD_NATIVE(oloc_src->file, dxpl_id, 0, oh_src, mesg_src, FAIL)
+ /* Save destination file pointer in cpy_info so that it can be used
+ in the pre_copy_file callback to obtain the destination file's
+ high bound. The high bound is used to index into the corresponding
+ message's array of versions for doing version bounds check. */
+ cpy_info->file_dst = oloc_dst->file;
+
/* Perform "pre copy" operation on message */
if((copy_type->pre_copy_file)(oloc_src->file, mesg_src->native,
&(deleted[mesgno]), cpy_info, cpy_udata) < 0)
@@ -871,12 +882,19 @@ done:
HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to release object header")
/* Free destination object header on failure */
- if(ret_value < 0 && oh_dst && !inserted) {
- if(H5O__free(oh_dst) < 0)
- HDONE_ERROR(H5E_OHDR, H5E_CANTFREE, FAIL, "unable to destroy object header data")
- if(H5O_loc_reset(oloc_dst) < 0)
- HDONE_ERROR(H5E_OHDR, H5E_CANTFREE, FAIL, "unable to destroy object header data")
- } /* end if */
+ if(ret_value < 0) {
+ if(oh_dst && !inserted) {
+ if(H5O__free(oh_dst) < 0)
+ HDONE_ERROR(H5E_OHDR, H5E_CANTFREE, FAIL, "unable to destroy object header data")
+ if(H5O_loc_reset(oloc_dst) < 0)
+ HDONE_ERROR(H5E_OHDR, H5E_CANTFREE, FAIL, "unable to destroy object header data")
+ } /* end if */
+
+ if(addr_map == NULL && cpy_udata) {
+ if(obj_class && obj_class->free_copy_file_udata)
+ obj_class->free_copy_file_udata(cpy_udata);
+ } /* end if */
+ }
FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL)
} /* end H5O_copy_header_real() */
diff --git a/src/H5Odtype.c b/src/H5Odtype.c
index a1c24b6..c51e31d 100644
--- a/src/H5Odtype.c
+++ b/src/H5Odtype.c
@@ -15,16 +15,16 @@
#define H5T_FRIEND /*prevent warning from including H5Tpkg */
-#include "H5private.h" /* Generic Functions */
-#include "H5Dprivate.h" /* Datasets */
-#include "H5Eprivate.h" /* Error handling */
-#include "H5Fprivate.h" /* Files */
-#include "H5FLprivate.h" /* Free Lists */
-#include "H5Gprivate.h" /* Groups */
-#include "H5MMprivate.h" /* Memory management */
-#include "H5Opkg.h" /* Object headers */
-#include "H5Tpkg.h" /* Datatypes */
-#include "H5VMprivate.h" /* Vectors and arrays */
+#include "H5private.h" /* Generic Functions */
+#include "H5Dprivate.h" /* Datasets */
+#include "H5Eprivate.h" /* Error handling */
+#include "H5Fprivate.h" /* Files */
+#include "H5FLprivate.h" /* Free Lists */
+#include "H5Gprivate.h" /* Groups */
+#include "H5MMprivate.h" /* Memory management */
+#include "H5Opkg.h" /* Object headers */
+#include "H5Tpkg.h" /* Datatypes */
+#include "H5VMprivate.h" /* Vectors and arrays */
/* PRIVATE PROTOTYPES */
@@ -1516,7 +1516,7 @@ done:
*/
static herr_t
H5O_dtype_pre_copy_file(H5F_t *file_src, const void *mesg_src,
- hbool_t H5_ATTR_UNUSED *deleted, const H5O_copy_t H5_ATTR_UNUSED *cpy_info,
+ hbool_t H5_ATTR_UNUSED *deleted, const H5O_copy_t *cpy_info,
void *_udata)
{
const H5T_t *dt_src = (const H5T_t *)mesg_src; /* Source datatype */
@@ -1528,6 +1528,13 @@ H5O_dtype_pre_copy_file(H5F_t *file_src, const void *mesg_src,
/* check args */
HDassert(file_src);
HDassert(dt_src);
+ HDassert(cpy_info);
+ HDassert(cpy_info->file_dst);
+
+ /* Check to ensure that the version of the message to be copied does not exceed
+ the message version as indicated by the destination file's high bound */
+ if(dt_src->shared->version > H5O_dtype_ver_bounds[H5F_HIGH_BOUND(cpy_info->file_dst)])
+ HGOTO_ERROR(H5E_OHDR, H5E_BADRANGE, FAIL, "datatype message version out of bounds")
/* If the user data is non-NULL, assume we are copying a dataset
* and check if we need to make a copy of the datatype for later in
diff --git a/src/H5Ofill.c b/src/H5Ofill.c
index 5419762..74f69d1 100644
--- a/src/H5Ofill.c
+++ b/src/H5Ofill.c
@@ -21,15 +21,15 @@
#include "H5Omodule.h" /* This source code file is part of the H5O module */
-#include "H5private.h" /* Generic Functions */
-#include "H5Dprivate.h" /* Datasets */
-#include "H5Eprivate.h" /* Error handling */
-#include "H5FLprivate.h" /* Free Lists */
-#include "H5Iprivate.h" /* IDs */
-#include "H5MMprivate.h" /* Memory management */
-#include "H5Opkg.h" /* Object headers */
-#include "H5Pprivate.h" /* Property lists */
-#include "H5Sprivate.h" /* Dataspaces */
+#include "H5private.h" /* Generic Functions */
+#include "H5Dprivate.h" /* Datasets */
+#include "H5Eprivate.h" /* Error handling */
+#include "H5FLprivate.h" /* Free Lists */
+#include "H5Iprivate.h" /* IDs */
+#include "H5MMprivate.h" /* Memory management */
+#include "H5Opkg.h" /* Object headers */
+#include "H5Pprivate.h" /* Property lists */
+#include "H5Sprivate.h" /* Dataspaces */
static void *H5O_fill_old_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh,
@@ -43,6 +43,8 @@ static size_t H5O_fill_new_size(const H5F_t *f, const void *_mesg);
static void *H5O_fill_copy(const void *_mesg, void *_dest);
static herr_t H5O_fill_reset(void *_mesg);
static herr_t H5O_fill_free(void *_mesg);
+static herr_t H5O_fill_pre_copy_file(H5F_t *file_src, const void *mesg_src,
+ hbool_t *deleted, const H5O_copy_t *cpy_info, void *udata);
static herr_t H5O_fill_debug(H5F_t *f, hid_t dxpl_id, const void *_mesg, FILE *stream,
int indent, int fwidth);
@@ -105,52 +107,59 @@ static herr_t H5O_fill_debug(H5F_t *f, hid_t dxpl_id, const void *_mesg, FILE *s
/* This message derives from H5O message class, for old fill value before version 1.5 */
const H5O_msg_class_t H5O_MSG_FILL[1] = {{
- H5O_FILL_ID, /*message id number */
- "fill", /*message name for debugging */
- sizeof(H5O_fill_t), /*native message size */
- H5O_SHARE_IS_SHARABLE|H5O_SHARE_IN_OHDR, /* messages are sharable? */
- H5O_fill_shared_decode, /*decode message */
- H5O_fill_shared_encode, /*encode message */
- H5O_fill_copy, /*copy the native value */
- H5O_fill_shared_size, /*raw message size */
- H5O_fill_reset, /*free internal memory */
- H5O_fill_free, /* free method */
- H5O_fill_shared_delete, /* file delete method */
- H5O_fill_shared_link, /* link method */
- NULL, /* set share method */
- NULL, /*can share method */
- NULL, /* pre copy native value to file */
- H5O_fill_shared_copy_file, /* copy native value to file */
- H5O_fill_shared_post_copy_file, /* post copy native value to file */
- NULL, /* get creation index */
- NULL, /* set creation index */
- H5O_fill_shared_debug /*debug the message */
+ H5O_FILL_ID, /*message id number */
+ "fill", /*message name for debugging */
+ sizeof(H5O_fill_t), /*native message size */
+ H5O_SHARE_IS_SHARABLE|H5O_SHARE_IN_OHDR, /* messages are sharable? */
+ H5O_fill_shared_decode, /*decode message */
+ H5O_fill_shared_encode, /*encode message */
+ H5O_fill_copy, /*copy the native value */
+ H5O_fill_shared_size, /*raw message size */
+ H5O_fill_reset, /*free internal memory */
+ H5O_fill_free, /* free method */
+ H5O_fill_shared_delete, /* file delete method */
+ H5O_fill_shared_link, /* link method */
+ NULL, /* set share method */
+ NULL, /*can share method */
+ H5O_fill_pre_copy_file, /* pre copy native value to file */
+ H5O_fill_shared_copy_file, /* copy native value to file */
+ H5O_fill_shared_post_copy_file, /* post copy native value to file */
+ NULL, /* get creation index */
+ NULL, /* set creation index */
+ H5O_fill_shared_debug /*debug the message */
}};
/* This message derives from H5O message class, for new fill value after version 1.4 */
const H5O_msg_class_t H5O_MSG_FILL_NEW[1] = {{
- H5O_FILL_NEW_ID, /*message id number */
- "fill_new", /*message name for debugging */
- sizeof(H5O_fill_t), /*native message size */
- H5O_SHARE_IS_SHARABLE|H5O_SHARE_IN_OHDR, /* messages are sharable? */
- H5O_fill_new_shared_decode, /*decode message */
- H5O_fill_new_shared_encode, /*encode message */
- H5O_fill_copy, /*copy the native value */
- H5O_fill_new_shared_size, /*raw message size */
- H5O_fill_reset, /*free internal memory */
- H5O_fill_free, /* free method */
- H5O_fill_new_shared_delete, /* file delete method */
- H5O_fill_new_shared_link, /* link method */
- NULL, /* set share method */
- NULL, /*can share method */
- NULL, /* pre copy native value to file */
- H5O_fill_new_shared_copy_file, /* copy native value to file */
- H5O_fill_new_shared_post_copy_file, /* post copy native value to file */
- NULL, /* get creation index */
- NULL, /* set creation index */
- H5O_fill_new_shared_debug /*debug the message */
+ H5O_FILL_NEW_ID, /*message id number */
+ "fill_new", /*message name for debugging */
+ sizeof(H5O_fill_t), /*native message size */
+ H5O_SHARE_IS_SHARABLE|H5O_SHARE_IN_OHDR, /* messages are sharable? */
+ H5O_fill_new_shared_decode, /*decode message */
+ H5O_fill_new_shared_encode, /*encode message */
+ H5O_fill_copy, /*copy the native value */
+ H5O_fill_new_shared_size, /*raw message size */
+ H5O_fill_reset, /*free internal memory */
+ H5O_fill_free, /* free method */
+ H5O_fill_new_shared_delete, /* file delete method */
+ H5O_fill_new_shared_link, /* link method */
+ NULL, /* set share method */
+ NULL, /*can share method */
+ H5O_fill_pre_copy_file, /* pre copy native value to file */
+ H5O_fill_new_shared_copy_file, /* copy native value to file */
+ H5O_fill_new_shared_post_copy_file, /* post copy native value to file */
+ NULL, /* get creation index */
+ NULL, /* set creation index */
+ H5O_fill_new_shared_debug /*debug the message */
}};
+/* Format version bounds for fill value */
+const unsigned H5O_fill_ver_bounds[] = {
+ H5O_FILL_VERSION_1, /* H5F_LIBVER_EARLIEST */
+ H5O_FILL_VERSION_2, /* H5F_LIBVER_V18 */
+ H5O_FILL_VERSION_LATEST /* H5F_LIBVER_LATEST */
+};
+
/* Masks, shift values & flags for fill value message */
#define H5O_FILL_MASK_ALLOC_TIME 0x03
#define H5O_FILL_SHIFT_ALLOC_TIME 0
@@ -171,11 +180,11 @@ H5FL_BLK_EXTERN(type_conv);
* Function: H5O_fill_new_decode
*
* Purpose: Decode a new fill value message. The new fill value
- * message is fill value plus space allocation time and
- * fill value writing time and whether fill value is defined.
+ * message is fill value plus space allocation time and
+ * fill value writing time and whether fill value is defined.
*
- * Return: Success: Ptr to new message in native struct.
- * Failure: NULL
+ * Return: Success: Ptr to new message in native struct.
+ * Failure: NULL
*
* Programmer: Raymond Lu
* Feb 26, 2002
@@ -195,7 +204,7 @@ H5O_fill_new_decode(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t
HDassert(p);
if(NULL == (fill = H5FL_CALLOC(H5O_fill_t)))
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed for fill value message")
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed for fill value message")
/* Version */
fill->version = *p++;
@@ -276,7 +285,7 @@ done:
if(!ret_value && fill) {
if(fill->buf)
H5MM_xfree(fill->buf);
- fill = H5FL_FREE(H5O_fill_t, fill);
+ fill = H5FL_FREE(H5O_fill_t, fill);
} /* end if */
FUNC_LEAVE_NOAPI(ret_value)
@@ -336,7 +345,7 @@ done:
if(!ret_value && fill) {
if(fill->buf)
H5MM_xfree(fill->buf);
- fill = H5FL_FREE(H5O_fill_t, fill);
+ fill = H5FL_FREE(H5O_fill_t, fill);
} /* end if */
FUNC_LEAVE_NOAPI(ret_value)
@@ -347,8 +356,8 @@ done:
* Function: H5O_fill_new_encode
*
* Purpose: Encode a new fill value message. The new fill value
- * message is fill value plus space allocation time and
- * fill value writing time and whether fill value is defined.
+ * message is fill value plus space allocation time and
+ * fill value writing time and whether fill value is defined.
*
* Return: Non-negative on success/Negative on failure
*
@@ -481,7 +490,7 @@ H5O_fill_old_encode(H5F_t H5_ATTR_UNUSED *f, uint8_t *p, const void *_fill)
* whether fill value is defined.
*
* Return: Success: Ptr to _DEST
- * Failure: NULL
+ * Failure: NULL
*
* Programmer: Raymond Lu
* Feb 26, 2002
@@ -491,16 +500,16 @@ H5O_fill_old_encode(H5F_t H5_ATTR_UNUSED *f, uint8_t *p, const void *_fill)
static void *
H5O_fill_copy(const void *_src, void *_dst)
{
- const H5O_fill_t *src = (const H5O_fill_t *)_src;
- H5O_fill_t *dst = (H5O_fill_t *)_dst;
- void *ret_value = NULL; /* Return value */
+ const H5O_fill_t *src = (const H5O_fill_t *)_src;
+ H5O_fill_t *dst = (H5O_fill_t *)_dst;
+ void *ret_value = NULL; /* Return value */
FUNC_ENTER_NOAPI_NOINIT
HDassert(src);
if(!dst && NULL == (dst = H5FL_MALLOC(H5O_fill_t)))
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed for fill message")
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed for fill message")
/* Shallow copy basic fields */
*dst = *src;
@@ -516,9 +525,9 @@ H5O_fill_copy(const void *_src, void *_dst)
/* Copy fill value and its size */
if(src->buf) {
H5_CHECK_OVERFLOW(src->size, ssize_t, size_t);
- if(NULL == (dst->buf = H5MM_malloc((size_t)src->size)))
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed for fill value")
- HDmemcpy(dst->buf, src->buf, (size_t)src->size);
+ if(NULL == (dst->buf = H5MM_malloc((size_t)src->size)))
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed for fill value")
+ HDmemcpy(dst->buf, src->buf, (size_t)src->size);
/* Check for needing to convert/copy fill value */
if(src->type) {
@@ -579,9 +588,9 @@ done:
if(!ret_value && dst) {
if(dst->buf)
H5MM_xfree(dst->buf);
- if(dst->type)
+ if(dst->type)
H5T_close(dst->type);
- if(!_dst)
+ if(!_dst)
dst = H5FL_FREE(H5O_fill_t, dst);
} /* end if */
@@ -593,13 +602,13 @@ done:
* Function: H5O_fill_new_size
*
* Purpose: Returns the size of the raw message in bytes not counting the
- * message type or size fields, but only the data fields. This
- * function doesn't take into account alignment. The new fill
- * value message is fill value plus space allocation time and
- * fill value writing time and whether fill value is defined.
+ * message type or size fields, but only the data fields. This
+ * function doesn't take into account alignment. The new fill
+ * value message is fill value plus space allocation time and
+ * fill value writing time and whether fill value is defined.
*
* Return: Success: Message data size in bytes w/o alignment.
- * Failure: 0
+ * Failure: 0
*
* Programmer: Raymond Lu
* Feb 26, 2002
@@ -609,8 +618,8 @@ done:
static size_t
H5O_fill_new_size(const H5F_t H5_ATTR_UNUSED *f, const void *_fill)
{
- const H5O_fill_t *fill = (const H5O_fill_t *)_fill;
- size_t ret_value = 0; /* Return value */
+ const H5O_fill_t *fill = (const H5O_fill_t *)_fill;
+ size_t ret_value = 0; /* Return value */
FUNC_ENTER_NOAPI_NOINIT_NOERR
@@ -721,8 +730,8 @@ H5O_fill_reset_dyn(H5O_fill_t *fill)
} /* end if */
fill->size = 0;
if(fill->type) {
- H5T_close(fill->type);
- fill->type = NULL;
+ H5T_close(fill->type);
+ fill->type = NULL;
} /* end if */
done:
@@ -792,6 +801,42 @@ H5O_fill_free(void *fill)
/*-------------------------------------------------------------------------
+ * Function: H5O_fill_pre_copy_file
+ *
+ * Purpose: Perform any necessary actions before copying message between
+ * files.
+ *
+ * Return: Success: Non-negative
+ * Failure: Negative
+ *
+ * Programmer: Vailin Choi; Dec 2017
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+H5O_fill_pre_copy_file(H5F_t H5_ATTR_UNUSED *file_src, const void *mesg_src,
+ hbool_t H5_ATTR_UNUSED *deleted, const H5O_copy_t *cpy_info, void H5_ATTR_UNUSED *udata)
+{
+ const H5O_fill_t *fill_src = (const H5O_fill_t *)mesg_src; /* Source fill value */
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_NOAPI_NOINIT
+
+ /* check args */
+ HDassert(cpy_info);
+ HDassert(cpy_info->file_dst);
+
+ /* Check to ensure that the version of the message to be copied does not exceed
+ the message version allowed by the destination file's high bound */
+ if(fill_src->version > H5O_fill_ver_bounds[H5F_HIGH_BOUND(cpy_info->file_dst)])
+ HGOTO_ERROR(H5E_OHDR, H5E_BADRANGE, FAIL, "fill value message version out of bounds")
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5O_fill_pre_copy_file() */
+
+
+/*-------------------------------------------------------------------------
* Function: H5O_fill_debug
*
* Purpose: Prints debugging info for the message.
@@ -883,11 +928,11 @@ H5O_fill_debug(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, const void
"Size:", fill->size);
HDfprintf(stream, "%*s%-*s ", indent, "", fwidth, "Data type:");
if(fill->type) {
- H5T_debug(fill->type, stream);
- fprintf(stream, "\n");
+ H5T_debug(fill->type, stream);
+ HDfprintf(stream, "\n");
} /* end if */
else
- fprintf(stream, "<dataset type>\n");
+ HDfprintf(stream, "<dataset type>\n");
FUNC_LEAVE_NOAPI(SUCCEED)
} /* end H5O_fill_debug() */
@@ -897,9 +942,9 @@ H5O_fill_debug(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, const void
* Function: H5O_fill_convert
*
* Purpose: Convert a fill value from whatever data type it currently has
- * to the specified dataset type. The `type' field of the fill
- * value struct will be set to NULL to indicate that it has the
- * same type as the dataset.
+ * to the specified dataset type. The `type' field of the fill
+ * value struct will be set to NULL to indicate that it has the
+ * same type as the dataset.
*
* Return: Non-negative on success/Negative on failure
*
@@ -925,21 +970,21 @@ H5O_fill_convert(H5O_fill_t *fill, H5T_t *dset_type, hbool_t *fill_changed, hid_
/* No-op cases */
if(!fill->buf || !fill->type || 0 == H5T_cmp(fill->type, dset_type, FALSE)) {
/* Don't need datatype for fill value */
- if(fill->type)
+ if(fill->type)
H5T_close(fill->type);
- fill->type = NULL;
+ fill->type = NULL;
/* Note that the fill value info has changed */
*fill_changed = TRUE;
- HGOTO_DONE(SUCCEED);
+ HGOTO_DONE(SUCCEED);
} /* end if */
/*
* Can we convert between source and destination data types?
*/
if(NULL == (tpath = H5T_path_find(fill->type, dset_type, NULL, NULL, dxpl_id, FALSE)))
- HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, FAIL, "unable to convert between src and dst datatypes")
+ HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, FAIL, "unable to convert between src and dst datatypes")
/* Don't bother doing anything if there will be no actual conversion */
if(!H5T_path_noop(tpath)) {
@@ -997,28 +1042,39 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5O_fill_set_latest_version
+ * Function: H5O_fill_set_version
*
- * Purpose: Set the encoding for a fill value to the latest version.
+ * Purpose: Set the version to encode a fill value with.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Quincey Koziol
- * Tuesday, July 24, 2007
+ * Programmer: Vailin Choi; December 2017
*
*-------------------------------------------------------------------------
*/
herr_t
-H5O_fill_set_latest_version(H5O_fill_t *fill)
+H5O_fill_set_version(H5F_t *f, H5O_fill_t *fill)
{
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ unsigned version; /* Message version */
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_NOAPI(FAIL)
/* Sanity check */
+ HDassert(f);
HDassert(fill);
- /* Set encoding of fill value to latest version */
- fill->version = H5O_FILL_VERSION_LATEST;
+ /* Upgrade to the version indicated by the file's low bound if higher */
+ version = MAX(fill->version, H5O_fill_ver_bounds[H5F_LOW_BOUND(f)]);
- FUNC_LEAVE_NOAPI(SUCCEED)
-} /* end H5O_fill_set_latest_version() */
+ /* Version bounds check */
+ if(version > H5O_fill_ver_bounds[H5F_HIGH_BOUND(f)])
+ HGOTO_ERROR(H5E_OHDR, H5E_BADRANGE, FAIL, "Filter pipeline version out of bounds")
+
+ /* Set the message version */
+ fill->version = version;
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5O_fill_set_version() */
diff --git a/src/H5Oint.c b/src/H5Oint.c
index 6ab5393..08eb28d 100644
--- a/src/H5Oint.c
+++ b/src/H5Oint.c
@@ -131,6 +131,13 @@ const H5O_msg_class_t *const H5O_msg_class_g[] = {
#endif /* H5O_ENABLE_BOGUS */
};
+/* Format version bounds for object header */
+const unsigned H5O_obj_ver_bounds[] = {
+ H5O_VERSION_1, /* H5F_LIBVER_EARLIEST */
+ H5O_VERSION_2, /* H5F_LIBVER_V18 */
+ H5O_VERSION_LATEST /* H5F_LIBVER_LATEST */
+};
+
/* Declare a free list to manage the H5O_t struct */
H5FL_DEFINE(H5O_t);
@@ -203,6 +210,53 @@ H5O__init_package(void)
/*-------------------------------------------------------------------------
+ * Function: H5O_set_version
+ *
+ * Purpose: Sets the correct version to encode the object header.
+ * Chooses the oldest version possible, unless the file's
+ * low bound indicates otherwise.
+ *
+ * Return: Success: Non-negative
+ * Failure: Negative
+ *
+ * Programmer: Vailin Choi; December 2017
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+H5O_set_version(H5F_t *f, H5O_t *oh, uint8_t oh_flags, hbool_t store_msg_crt_idx)
+{
+ uint8_t version; /* Message version */
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_NOAPI(FAIL)
+
+ /* check arguments */
+ HDassert(f);
+ HDassert(oh);
+
+ /* Set the correct version to encode object header with */
+ if(store_msg_crt_idx || (oh_flags & H5O_HDR_ATTR_CRT_ORDER_TRACKED))
+ version = H5O_VERSION_LATEST;
+ else
+ version = H5O_VERSION_1;
+
+ /* Upgrade to the version indicated by the file's low bound if higher */
+ version = MAX(version, (uint8_t)H5O_obj_ver_bounds[H5F_LOW_BOUND(f)]);
+
+ /* Version bounds check */
+ if(version > H5O_obj_ver_bounds[H5F_HIGH_BOUND(f)])
+ HGOTO_ERROR(H5E_OHDR, H5E_BADRANGE, FAIL, "object header version out of bounds")
+
+ /* Set the message version */
+ oh->version = version;
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5O_set_version() */
+
+
+/*-------------------------------------------------------------------------
* Function: H5O_create
*
* Purpose: Creates a new object header. Allocates space for it and
@@ -263,10 +317,10 @@ H5O_create(H5F_t *f, hid_t dxpl_id, size_t size_hint, size_t initial_rc,
/* Initialize file-specific information for object header */
store_msg_crt_idx = H5F_STORE_MSG_CRT_IDX(f);
- if(H5F_USE_LATEST_FLAGS(f, H5F_LATEST_OBJ_HEADER) || store_msg_crt_idx || (oh_flags & H5O_HDR_ATTR_CRT_ORDER_TRACKED))
- oh->version = H5O_VERSION_LATEST;
- else
- oh->version = H5O_VERSION_1;
+
+ if(H5O_set_version(f, oh, oh_flags, store_msg_crt_idx) < 0)
+ HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set version of objecdt header")
+
oh->sizeof_size = H5F_SIZEOF_SIZE(f);
oh->sizeof_addr = H5F_SIZEOF_ADDR(f);
oh->swmr_write = !!(H5F_INTENT(f) & H5F_ACC_SWMR_WRITE);
diff --git a/src/H5Olayout.c b/src/H5Olayout.c
index 838a80f..85d7791 100644
--- a/src/H5Olayout.c
+++ b/src/H5Olayout.c
@@ -47,6 +47,8 @@ static herr_t H5O__layout_reset(void *_mesg);
static herr_t H5O__layout_free(void *_mesg);
static herr_t H5O__layout_delete(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh,
void *_mesg);
+static herr_t H5O__layout_pre_copy_file(H5F_t *file_src, const void *mesg_src,
+ hbool_t *deleted, const H5O_copy_t *cpy_info, void *udata);
static void *H5O__layout_copy_file(H5F_t *file_src, void *mesg_src,
H5F_t *file_dst, hbool_t *recompute_size, unsigned *mesg_flags,
H5O_copy_t *cpy_info, void *udata, hid_t dxpl_id);
@@ -69,7 +71,7 @@ const H5O_msg_class_t H5O_MSG_LAYOUT[1] = {{
NULL, /* link method */
NULL, /* set share method */
NULL, /* can share method */
- NULL, /* pre copy native value to file */
+ H5O__layout_pre_copy_file, /* pre copy native value to file */
H5O__layout_copy_file, /* copy native value to file */
NULL, /* post copy native value to file */
NULL, /* get creation index */
@@ -1045,6 +1047,42 @@ done:
/*-------------------------------------------------------------------------
+ * Function: H5O__layout_pre_copy_file
+ *
+ * Purpose: Perform any necessary actions before copying message between
+ * files.
+ *
+ * Return: Success: Non-negative
+ * Failure: Negative
+ *
+ * Programmer: Vailin Choi; Dec 2017
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+H5O__layout_pre_copy_file(H5F_t H5_ATTR_UNUSED *file_src, const void *mesg_src,
+ hbool_t H5_ATTR_UNUSED *deleted, const H5O_copy_t *cpy_info, void H5_ATTR_UNUSED *udata)
+{
+ const H5O_layout_t *layout_src = (const H5O_layout_t *)mesg_src; /* Source layout */
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_NOAPI_NOINIT
+
+ /* check args */
+ HDassert(cpy_info);
+ HDassert(cpy_info->file_dst);
+
+ /* Check to ensure that the version of the message to be copied does not exceed
+ the message version allowed by the destination file's high bound */
+ if(layout_src->version > H5O_layout_ver_bounds[H5F_HIGH_BOUND(cpy_info->file_dst)])
+ HGOTO_ERROR(H5E_OHDR, H5E_BADRANGE, FAIL, "layout message version out of bounds")
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5O__layout_pre_copy_file() */
+
+
+/*-------------------------------------------------------------------------
* Function: H5O__layout_copy_file
*
* Purpose: Copies a message from _MESG to _DEST in file
diff --git a/src/H5Opkg.h b/src/H5Opkg.h
index 109d273..649ee3b 100644
--- a/src/H5Opkg.h
+++ b/src/H5Opkg.h
@@ -63,8 +63,8 @@
)
#define H5O_ALIGN_OH(O, X) \
H5O_ALIGN_VERS((O)->version, X)
-#define H5O_ALIGN_F(F, X) \
- H5O_ALIGN_VERS((H5F_USE_LATEST_FLAGS(F, H5F_LATEST_OBJ_HEADER) ? H5O_VERSION_LATEST : H5O_VERSION_1), X)
+#define H5O_ALIGN_F(F, X) \
+ H5O_ALIGN_VERS(MAX(H5O_VERSION_1, (uint8_t)H5O_obj_ver_bounds[H5F_LOW_BOUND(F)]), X)
/* Size of checksum (on disk) */
#define H5O_SIZEOF_CHKSUM 4
@@ -136,7 +136,7 @@
#define H5O_SIZEOF_MSGHDR_OH(O) \
H5O_SIZEOF_MSGHDR_VERS((O)->version, (O)->flags & H5O_HDR_ATTR_CRT_ORDER_TRACKED)
#define H5O_SIZEOF_MSGHDR_F(F, C) \
- H5O_SIZEOF_MSGHDR_VERS((H5F_USE_LATEST_FLAGS(F, H5F_LATEST_OBJ_HEADER) || H5F_STORE_MSG_CRT_IDX(F)) ? H5O_VERSION_LATEST : H5O_VERSION_1, (C))
+ H5O_SIZEOF_MSGHDR_VERS(MAX((H5F_STORE_MSG_CRT_IDX(F) ? H5O_VERSION_LATEST : H5O_VERSION_1), (uint8_t)H5O_obj_ver_bounds[H5F_LOW_BOUND(F)]), (C))
/*
* Size of chunk "header" for each chunk
@@ -556,7 +556,6 @@ H5_DLLVAR const H5O_obj_class_t H5O_OBJ_DATASET[1];
/* Datatype Object. (H5O_TYPE_NAMED_DATATYPE - 2) */
H5_DLLVAR const H5O_obj_class_t H5O_OBJ_DATATYPE[1];
-
/* Package-local function prototypes */
H5_DLL herr_t H5O_msg_flush(H5F_t *f, H5O_t *oh, H5O_mesg_t *mesg);
H5_DLL herr_t H5O_flush_msgs(H5F_t *f, H5O_t *oh);
@@ -642,6 +641,14 @@ H5_DLL herr_t H5O_attr_link(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, void *_mesg
H5_DLL herr_t H5O_attr_count_real(H5F_t *f, hid_t dxpl_id, H5O_t *oh,
hsize_t *nattrs);
+/* Arrays of versions for:
+ Object header, Attribute/Fill value/Filter pipeline messages */
+/* Layout/Datatype/Dataspace arrays of versions are in H5Dpkg.h, H5Tpkg.h and H5Spkg.h */
+H5_DLLVAR const unsigned H5O_obj_ver_bounds[H5F_LIBVER_NBOUNDS];
+H5_DLLVAR const unsigned H5O_attr_ver_bounds[H5F_LIBVER_NBOUNDS];
+H5_DLLVAR const unsigned H5O_fill_ver_bounds[H5F_LIBVER_NBOUNDS];
+H5_DLLVAR const unsigned H5O_pline_ver_bounds[H5F_LIBVER_NBOUNDS];
+
/* Testing functions */
#ifdef H5O_TESTING
H5_DLL htri_t H5O_is_attr_empty_test(hid_t oid);
diff --git a/src/H5Opline.c b/src/H5Opline.c
index 2e52dbb..e817f9a 100644
--- a/src/H5Opline.c
+++ b/src/H5Opline.c
@@ -89,6 +89,12 @@ const H5O_msg_class_t H5O_MSG_PLINE[1] = {{
H5O_pline_shared_debug /* debug the message */
}};
+/* Format version bounds for filter pipleline */
+const unsigned H5O_pline_ver_bounds[] = {
+ H5O_PLINE_VERSION_1, /* H5F_LIBVER_EARLIEST */
+ H5O_PLINE_VERSION_2, /* H5F_LIBVER_V18 */
+ H5O_PLINE_VERSION_LATEST /* H5F_LIBVER_LATEST */
+};
/* Declare a free list to manage the H5O_pline_t struct */
H5FL_DEFINE(H5O_pline_t);
@@ -566,16 +572,23 @@ H5O_pline_free(void *mesg)
*/
static herr_t
H5O_pline_pre_copy_file(H5F_t H5_ATTR_UNUSED *file_src, const void *mesg_src,
- hbool_t H5_ATTR_UNUSED *deleted, const H5O_copy_t H5_ATTR_UNUSED *cpy_info, void *_udata)
+ hbool_t H5_ATTR_UNUSED *deleted, const H5O_copy_t *cpy_info, void *_udata)
{
- const H5O_pline_t *pline_src = (const H5O_pline_t *)mesg_src; /* Source datatype */
+ const H5O_pline_t *pline_src = (const H5O_pline_t *)mesg_src; /* Source pline */
H5O_copy_file_ud_common_t *udata = (H5O_copy_file_ud_common_t *)_udata; /* Object copying user data */
- herr_t ret_value = SUCCEED; /* Return value */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI_NOINIT
/* check args */
HDassert(pline_src);
+ HDassert(cpy_info);
+ HDassert(cpy_info->file_dst);
+
+ /* Check to ensure that the version of the message to be copied does not exceed
+ the message version allowed by the destination file's high bound */
+ if(pline_src->version > H5O_pline_ver_bounds[H5F_HIGH_BOUND(cpy_info->file_dst)])
+ HGOTO_ERROR(H5E_OHDR, H5E_BADRANGE, FAIL, "pline message version out of bounds")
/* If the user data is non-NULL, assume we are copying a dataset or group
* and make a copy of the filter pipeline for later in
@@ -664,28 +677,38 @@ H5O_pline_debug(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, const voi
/*-------------------------------------------------------------------------
- * Function: H5O_pline_set_latest_version
+ * Function: H5O_pline_set_version
*
- * Purpose: Set the encoding for a I/O filter pipeline to the latest version.
+ * Purpose: Set the version to encode an I/O filter pipeline with.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Quincey Koziol
- * Tuesday, July 24, 2007
+ * Programmer: Vailin Choi; December 2017
*
*-------------------------------------------------------------------------
*/
herr_t
-H5O_pline_set_latest_version(H5O_pline_t *pline)
+H5O_pline_set_version(H5F_t *f, H5O_pline_t *pline)
{
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ unsigned version; /* Message version */
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_NOAPI(FAIL)
/* Sanity check */
+ HDassert(f);
HDassert(pline);
- /* Set encoding of I/O pipeline to latest version */
- pline->version = H5O_PLINE_VERSION_LATEST;
+ /* Upgrade to the version indicated by the file's low bound if higher */
+ version = MAX(pline->version, H5O_pline_ver_bounds[H5F_LOW_BOUND(f)]);
- FUNC_LEAVE_NOAPI(SUCCEED)
-} /* end H5O_pline_set_latest_version() */
+ /* Version bounds check */
+ if(version > H5O_pline_ver_bounds[H5F_HIGH_BOUND(f)])
+ HGOTO_ERROR(H5E_PLINE, H5E_BADRANGE, FAIL, "Filter pipeline version out of bounds")
+
+ /* Set the message version */
+ pline->version = version;
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5O_pline_set_version() */
diff --git a/src/H5Oprivate.h b/src/H5Oprivate.h
index 4b74d8f..2253bb2 100644
--- a/src/H5Oprivate.h
+++ b/src/H5Oprivate.h
@@ -177,7 +177,12 @@ typedef struct H5O_copy_t {
H5SL_t *dst_dt_list; /* Skip list to hold committed datatypes in dest file */
hbool_t dst_dt_list_complete; /* Whether the destination datatype list is complete (i.e. not only populated with "suggestions" from H5Padd_merge_committed_dtype_path) */
H5O_t *oh_dst; /* The destination object header */
- void *shared_fo; /* The shared pointer for the object */
+ H5F_t *file_dst; /* The destination file pointer */
+ /* This is used in the pre_copy_file callback to obtain
+ the destination file's high bound. The high bound
+ is used to index into the corresponding message's
+ array of versions for doing version bounds check. */
+ void *shared_fo; /* The shared pointer for the src object */
H5O_mcdt_search_cb_t mcdt_cb; /* The callback to invoke before searching the global list of committed datatypes at destination */
void *mcdt_ud; /* User data passed to callback */
} H5O_copy_t;
@@ -967,14 +972,14 @@ H5_DLL hsize_t H5O_efl_total_size(H5O_efl_t *efl);
/* Fill value operators */
H5_DLL herr_t H5O_fill_reset_dyn(H5O_fill_t *fill);
H5_DLL herr_t H5O_fill_convert(H5O_fill_t *fill, H5T_t *type, hbool_t *fill_changed, hid_t dxpl_id);
-H5_DLL herr_t H5O_fill_set_latest_version(H5O_fill_t *fill);
+H5_DLL herr_t H5O_fill_set_version(H5F_t * f, H5O_fill_t *fill);
/* Link operators */
H5_DLL herr_t H5O_link_delete(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh,
void *_mesg);
/* Filter pipeline operators */
-H5_DLL herr_t H5O_pline_set_latest_version(H5O_pline_t *pline);
+H5_DLL herr_t H5O_pline_set_version(H5F_t *f, H5O_pline_t *pline);
/* Shared message operators */
H5_DLL herr_t H5O_set_shared(H5O_shared_t *dst, const H5O_shared_t *src);
diff --git a/src/H5Osdspace.c b/src/H5Osdspace.c
index 3fe5652..12a9bb6 100644
--- a/src/H5Osdspace.c
+++ b/src/H5Osdspace.c
@@ -441,7 +441,7 @@ H5O_sdspace_free(void *mesg)
*/
static herr_t
H5O_sdspace_pre_copy_file(H5F_t H5_ATTR_UNUSED *file_src, const void *mesg_src,
- hbool_t H5_ATTR_UNUSED *deleted, const H5O_copy_t H5_ATTR_UNUSED *cpy_info, void *_udata)
+ hbool_t H5_ATTR_UNUSED *deleted, const H5O_copy_t *cpy_info, void *_udata)
{
const H5S_extent_t *src_space_extent = (const H5S_extent_t *)mesg_src; /* Source dataspace extent */
H5D_copy_file_ud_t *udata = (H5D_copy_file_ud_t *)_udata; /* Dataset copying user data */
@@ -452,6 +452,13 @@ H5O_sdspace_pre_copy_file(H5F_t H5_ATTR_UNUSED *file_src, const void *mesg_src,
/* check args */
HDassert(file_src);
HDassert(src_space_extent);
+ HDassert(cpy_info);
+ HDassert(cpy_info->file_dst);
+
+ /* Check to ensure that the version of the message to be copied does not exceed
+ the message version allowed by the destination file's high bound */
+ if(src_space_extent->version > H5O_sdspace_ver_bounds[H5F_HIGH_BOUND(cpy_info->file_dst)])
+ HGOTO_ERROR(H5E_OHDR, H5E_BADRANGE, FAIL, "dataspace message version out of bounds")
/* If the user data is non-NULL, assume we are copying a dataset
* and make a copy of the dataspace extent for later in the object copying
diff --git a/src/H5Pfapl.c b/src/H5Pfapl.c
index ea9bfb4..7802535 100644
--- a/src/H5Pfapl.c
+++ b/src/H5Pfapl.c
@@ -140,11 +140,19 @@
#define H5F_ACS_MULTI_TYPE_DEF H5FD_MEM_DEFAULT
#define H5F_ACS_MULTI_TYPE_ENC H5P__facc_multi_type_enc
#define H5F_ACS_MULTI_TYPE_DEC H5P__facc_multi_type_dec
-/* Definition for 'use latest format version' flag */
-#define H5F_ACS_LATEST_FORMAT_SIZE sizeof(hbool_t)
-#define H5F_ACS_LATEST_FORMAT_DEF FALSE
-#define H5F_ACS_LATEST_FORMAT_ENC H5P__encode_hbool_t
-#define H5F_ACS_LATEST_FORMAT_DEC H5P__decode_hbool_t
+
+/* Definition for "low" bound of library format versions */
+#define H5F_ACS_LIBVER_LOW_BOUND_SIZE sizeof(H5F_libver_t)
+#define H5F_ACS_LIBVER_LOW_BOUND_DEF H5F_LIBVER_EARLIEST
+#define H5F_ACS_LIBVER_LOW_BOUND_ENC H5P__facc_libver_type_enc
+#define H5F_ACS_LIBVER_LOW_BOUND_DEC H5P__facc_libver_type_dec
+
+/* Definition for "high" bound of library format versions */
+#define H5F_ACS_LIBVER_HIGH_BOUND_SIZE sizeof(H5F_libver_t)
+#define H5F_ACS_LIBVER_HIGH_BOUND_DEF H5F_LIBVER_LATEST
+#define H5F_ACS_LIBVER_HIGH_BOUND_ENC H5P__facc_libver_type_enc
+#define H5F_ACS_LIBVER_HIGH_BOUND_DEC H5P__facc_libver_type_dec
+
/* Definition for whether to query the file descriptor from the core VFD
* instead of the memory address. (Private to library)
*/
@@ -288,6 +296,8 @@ static herr_t H5P__facc_fclose_degree_enc(const void *value, void **_pp, size_t
static herr_t H5P__facc_fclose_degree_dec(const void **pp, void *value);
static herr_t H5P__facc_multi_type_enc(const void *value, void **_pp, size_t *size);
static herr_t H5P__facc_multi_type_dec(const void **_pp, void *value);
+static herr_t H5P__facc_libver_type_enc(const void *value, void **_pp, size_t *size);
+static herr_t H5P__facc_libver_type_dec(const void **_pp, void *value);
/* Metadata cache log location property callbacks */
static herr_t H5P_facc_mdc_log_location_enc(const void *value, void **_pp, size_t *size);
@@ -352,7 +362,10 @@ static const hsize_t H5F_def_family_offset_g = H5F_ACS_FAMILY_OFFSET_DEF;
static const hsize_t H5F_def_family_newsize_g = H5F_ACS_FAMILY_NEWSIZE_DEF; /* Default size of new files for family VFD */
static const hbool_t H5F_def_family_to_sec2_g = H5F_ACS_FAMILY_TO_SEC2_DEF; /* Default ?? for family VFD */
static const H5FD_mem_t H5F_def_mem_type_g = H5F_ACS_MULTI_TYPE_DEF; /* Default file space type for multi VFD */
-static const hbool_t H5F_def_latest_format_g = H5F_ACS_LATEST_FORMAT_DEF; /* Default setting for "use the latest version of the format" flag */
+
+static const H5F_libver_t H5F_def_libver_low_bound_g = H5F_ACS_LIBVER_LOW_BOUND_DEF; /* Default setting for "low" bound of format version */
+static const H5F_libver_t H5F_def_libver_high_bound_g = H5F_ACS_LIBVER_HIGH_BOUND_DEF; /* Default setting for "high" bound of format version */
+
static const hbool_t H5F_def_want_posix_fd_g = H5F_ACS_WANT_POSIX_FD_DEF; /* Default setting for retrieving 'handle' from core VFD */
static const unsigned H5F_def_efc_size_g = H5F_ACS_EFC_SIZE_DEF; /* Default external file cache size */
static const H5FD_file_image_info_t H5F_def_file_image_info_g = H5F_ACS_FILE_IMAGE_INFO_DEF; /* Default file image info and callbacks */
@@ -491,9 +504,15 @@ H5P__facc_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 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,
+ /* Register the 'low' bound of library format versions */
+ if(H5P_register_real(pclass, H5F_ACS_LIBVER_LOW_BOUND_NAME, H5F_ACS_LIBVER_LOW_BOUND_SIZE, &H5F_def_libver_low_bound_g,
+ NULL, NULL, NULL, H5F_ACS_LIBVER_LOW_BOUND_ENC, H5F_ACS_LIBVER_LOW_BOUND_DEC,
+ NULL, NULL, NULL, NULL) < 0)
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class")
+
+ /* Register the 'high' bound of library format versions */
+ if(H5P_register_real(pclass, H5F_ACS_LIBVER_HIGH_BOUND_NAME, H5F_ACS_LIBVER_HIGH_BOUND_SIZE, &H5F_def_libver_high_bound_g,
+ NULL, NULL, NULL, H5F_ACS_LIBVER_HIGH_BOUND_ENC, H5F_ACS_LIBVER_HIGH_BOUND_DEC,
NULL, NULL, NULL, NULL) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class")
@@ -2301,7 +2320,25 @@ 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
+ * Note #3: The enumerated define for H5F_libver_t in 1.10 is:
+ * typedef enum H5F_libver_t {
+ * H5F_LIBVER_ERROR = -1,
+ * H5F_LIBVER_EARLIEST = 0,
+ * H5F_LIBVER_V18 = 1,
+ * H5F_LIBVER_V110 = 2,
+ * H5F_LIBVER_NBOUNDS
+ * } H5F_libver_t;
+ * #define H5F_LIBVER_LATEST H5F_LIBVER_V110
+ *
+ * The library supports five pairs of (low, high) combinations via H5Pset_libver_bounds():
+ * 1) H5F_LIBVER_EARLIEST, H5F_LIBVER_V18
+ * 2) H5F_LIBVER_EARLIEST, H5F_LIBVER_LATEST
+ * 4) H5F_LIBVER_V18, H5F_LIBVER_V18
+ * 4) H5F_LIBVER_V18, H5F_LIBVER_LATEST
+ * 5) H5F_LIBVER_LATEST, H5F_LIBVER_LATEST
+ * See detailed description in the RFC: Setting Bounds for Object Creation in HDF5 1.10.0.
+ *
+ * Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
* Sunday, December 30, 2007
@@ -2309,32 +2346,38 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5Pset_libver_bounds(hid_t plist_id, H5F_libver_t low,
- H5F_libver_t high)
+H5Pset_libver_bounds(hid_t plist_id, H5F_libver_t low, H5F_libver_t high)
{
H5P_genplist_t *plist; /* Property list pointer */
- hbool_t latest; /* Whether to use the latest version or not */
herr_t ret_value = SUCCEED; /* return value */
FUNC_ENTER_API(FAIL)
H5TRACE3("e", "iFvFv", plist_id, low, high);
/* Check args */
- /* (Note that this is _really_ restricted right now, we'll want to loosen
- * this up more as we add features - QAK)
- */
- if(high != H5F_LIBVER_LATEST)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid high library version bound")
+ if(low < 0 || low > H5F_LIBVER_LATEST)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "low bound is not valid")
+
+ if(high < 0 || high > H5F_LIBVER_LATEST)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "high bound is not valid")
+
+ /* (earliest, earliest), (latest, earliest), (v18, earliest) are not valid combinations */
+ if(high == H5F_LIBVER_EARLIEST)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Invalid (low,high) combination of library version bound")
+
+ /* (latest, v18) is not valid combination */
+ if(high < low)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Invalid (low,high) combination of library version bound")
/* Get the plist structure */
if(NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_ACCESS)))
HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
/* Set values */
- latest = (hbool_t)((low == H5F_LIBVER_LATEST) ? TRUE : FALSE);
- if(H5P_set(plist, H5F_ACS_LATEST_FORMAT_NAME, &latest) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set library version bounds")
-
+ if(H5P_set(plist, H5F_ACS_LIBVER_LOW_BOUND_NAME, &low) < 0)
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set low bound for library format versions")
+ if(H5P_set(plist, H5F_ACS_LIBVER_HIGH_BOUND_NAME, &high) < 0)
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set high bound for library format versions")
done:
FUNC_LEAVE_API(ret_value)
} /* end H5Pset_libver_bounds() */
@@ -2343,8 +2386,8 @@ done:
/*-------------------------------------------------------------------------
* Function: H5Pget_libver_bounds
*
- * Purpose: Returns the current settings for the library version format bounds
- * from a file access property list.
+ * 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
*
@@ -2358,7 +2401,6 @@ H5Pget_libver_bounds(hid_t plist_id, H5F_libver_t *low/*out*/,
H5F_libver_t *high/*out*/)
{
H5P_genplist_t *plist; /* Property list pointer */
- hbool_t latest; /* Whether to use the latest version or not */
herr_t ret_value = SUCCEED; /* return value */
FUNC_ENTER_API(FAIL)
@@ -2367,17 +2409,17 @@ H5Pget_libver_bounds(hid_t plist_id, H5F_libver_t *low/*out*/,
/* Get the plist structure */
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 values */
+ if(low) {
+ if(H5P_get(plist, H5F_ACS_LIBVER_LOW_BOUND_NAME, low) < 0)
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get low bound for library format versions")
+ }
- /* Get value */
- if(H5P_get(plist, H5F_ACS_LATEST_FORMAT_NAME, &latest) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get library version bounds")
-
- /* Check for setting values to return */
- /* (Again, this is restricted now, we'll need to open it up later -QAK) */
- if(low)
- *low = latest ? H5F_LIBVER_LATEST : H5F_LIBVER_EARLIEST;
- if(high)
- *high = H5F_LIBVER_LATEST;
+ if(high) {
+ if(H5P_get(plist, H5F_ACS_LIBVER_HIGH_BOUND_NAME, high) < 0)
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get high bound for library format versions")
+ }
done:
FUNC_LEAVE_API(ret_value)
@@ -3793,7 +3835,78 @@ H5P__facc_multi_type_dec(const void **_pp, void *_value)
/*-------------------------------------------------------------------------
- * Function: H5Pset_core_write_tracking
+ * Function: H5P__facc_libver_type_enc
+ *
+ * Purpose: Callback routine which is called whenever the 'low' or
+ * 'high' bound of library format versions property in the
+ * file access property list is encoded.
+ *
+ * Return: Success: Non-negative
+ * Failure: Negative
+ *
+ * Programmer
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+H5P__facc_libver_type_enc(const void *value, void **_pp, size_t *size)
+{
+ const H5F_libver_t *type = (const H5F_libver_t *)value; /* Create local alias for values */
+ uint8_t **pp = (uint8_t **)_pp;
+
+ FUNC_ENTER_STATIC_NOERR
+
+ /* Sanity check */
+ HDassert(type);
+ HDassert(size);
+
+ /* Encode */
+ if(NULL != *pp)
+ *(*pp)++ = (uint8_t)*type;
+
+ /* Size */
+ (*size)++;
+
+ FUNC_LEAVE_NOAPI(SUCCEED)
+} /* end H5P__facc_libver_type_enc() */
+
+
+/*-------------------------------------------------------------------------
+ * Function: H5P__facc_libver_type_dec
+ *
+ * Purpose: Callback routine which is called whenever the 'low' or
+ * 'high' bound of library format versions property in the
+ * file access property list is decoded.
+ *
+ * Return: Success: Non-negative
+ * Failure: Negative
+ *
+ * Programmer:
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+H5P__facc_libver_type_dec(const void **_pp, void *_value)
+{
+ H5F_libver_t *type = (H5F_libver_t *)_value;
+ const uint8_t **pp = (const uint8_t **)_pp;
+
+ FUNC_ENTER_STATIC_NOERR
+
+ /* Sanity checks */
+ HDassert(pp);
+ HDassert(*pp);
+ HDassert(type);
+
+ /* Decode */
+ *type = (H5F_libver_t)*(*pp)++;
+
+ FUNC_LEAVE_NOAPI(SUCCEED)
+} /* end H5P__facc_libver_type_dec() */
+
+
+/*-------------------------------------------------------------------------
+ * Function: H5Pset_core_write_tracking
*
* Purpose: Enables/disables core VFD write tracking and page
* aggregation size.
diff --git a/src/H5S.c b/src/H5S.c
index 9ac40a7..8f3e132 100644
--- a/src/H5S.c
+++ b/src/H5S.c
@@ -57,6 +57,12 @@ static htri_t H5S_is_simple(const H5S_t *sdim);
/* Package initialization variable */
hbool_t H5_PKG_INIT_VAR = FALSE;
+/* Format version bounds for dataspace */
+const unsigned H5O_sdspace_ver_bounds[] = {
+ H5O_SDSPACE_VERSION_1, /* H5F_LIBVER_EARLIEST */
+ H5O_SDSPACE_VERSION_2, /* H5F_LIBVER_V18 */
+ H5O_SDSPACE_VERSION_LATEST /* H5F_LIBVER_LATEST */
+};
/*****************************/
/* Library Private Variables */
@@ -84,6 +90,7 @@ static const H5I_class_t H5I_DATASPACE_CLS[1] = {{
(H5I_free_t)H5S_close /* Callback routine for closing objects of this class */
}};
+
/* Flag indicating "top" of interface has been initialized */
static hbool_t H5S_top_package_initialize_s = FALSE;
@@ -2167,30 +2174,42 @@ H5S_extent_nelem(const H5S_extent_t *ext)
/*-------------------------------------------------------------------------
- * Function: H5S_set_latest_version
+ * Function: H5S_set_version
*
- * Purpose: Set the encoding for a dataspace to the latest version.
+ * Purpose: Set the version to encode a dataspace with.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Quincey Koziol
- * Tuesday, July 24, 2007
+ * Programmer: Vailin Choi; December 2017
*
*-------------------------------------------------------------------------
*/
herr_t
-H5S_set_latest_version(H5S_t *ds)
+H5S_set_version(H5F_t *f, H5S_t *ds)
{
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ unsigned version; /* Message version */
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_NOAPI(FAIL)
/* Sanity check */
+ HDassert(f);
HDassert(ds);
- /* Set encoding of extent to latest version */
- ds->extent.version = H5O_SDSPACE_VERSION_LATEST;
+ /* Upgrade to the version indicated by the file's low bound if higher */
+ version = MAX(ds->extent.version, H5O_sdspace_ver_bounds[H5F_LOW_BOUND(f)]);
+
+ /* Version bounds check */
+ if(version > H5O_sdspace_ver_bounds[H5F_HIGH_BOUND(f)])
+ HGOTO_ERROR(H5E_DATASET, H5E_BADRANGE, FAIL, "Dataspace version out of bounds")
+
+ /* Set the message version */
+ ds->extent.version = version;
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
- FUNC_LEAVE_NOAPI(SUCCEED)
-} /* end H5S_set_latest_version() */
+} /* end H5S_set_version() */
#ifndef H5_NO_DEPRECATED_SYMBOLS
diff --git a/src/H5Spkg.h b/src/H5Spkg.h
index 315af29..5312ce7 100644
--- a/src/H5Spkg.h
+++ b/src/H5Spkg.h
@@ -262,6 +262,9 @@ H5_DLLVAR const H5S_select_class_t H5S_sel_none[1];
*/
H5_DLLVAR const H5S_select_class_t H5S_sel_point[1];
+/* Array of versions for Dataspace */
+H5_DLLVAR const unsigned H5O_sdspace_ver_bounds[H5F_LIBVER_NBOUNDS];
+
/* Extent functions */
H5_DLL herr_t H5S_extent_release(H5S_extent_t *extent);
H5_DLL herr_t H5S_extent_copy_real(H5S_extent_t *dst, const H5S_extent_t *src,
diff --git a/src/H5Sprivate.h b/src/H5Sprivate.h
index f125035..bb84ebd 100644
--- a/src/H5Sprivate.h
+++ b/src/H5Sprivate.h
@@ -219,7 +219,7 @@ H5_DLL herr_t H5S_set_extent_simple(H5S_t *space, unsigned rank,
H5_DLL H5S_t *H5S_create(H5S_class_t type);
H5_DLL H5S_t *H5S_create_simple(unsigned rank, const hsize_t dims[/*rank*/],
const hsize_t maxdims[/*rank*/]);
-H5_DLL herr_t H5S_set_latest_version(H5S_t *ds);
+H5_DLL herr_t H5S_set_version(H5F_t *f, H5S_t *ds);
H5_DLL herr_t H5S_encode(H5S_t *obj, unsigned char **p, size_t *nalloc);
H5_DLL H5S_t *H5S_decode(const unsigned char **p);
H5_DLL herr_t H5S_debug(H5F_t *f, hid_t dxpl_id, const void *_mesg, FILE *stream,
diff --git a/src/H5T.c b/src/H5T.c
index a525cd5..eca0132 100644
--- a/src/H5T.c
+++ b/src/H5T.c
@@ -510,6 +510,12 @@ double H5T_NATIVE_DOUBLE_NEG_INF_g = (double)0.0f;
H5FL_DEFINE(H5T_t);
H5FL_DEFINE(H5T_shared_t);
+/* Format version bounds for datatype */
+const unsigned H5O_dtype_ver_bounds[] = {
+ H5O_DTYPE_VERSION_1, /* H5F_LIBVER_EARLIEST */
+ H5O_DTYPE_VERSION_3, /* H5F_LIBVER_V18 */
+ H5O_DTYPE_VERSION_LATEST /* H5F_LIBVER_LATEST */
+};
/*******************/
/* Local Variables */
@@ -539,6 +545,7 @@ static const H5I_class_t H5I_DATATYPE_CLS[1] = {{
(H5I_free_t)H5T_close /* Callback routine for closing objects of this class */
}};
+
/* Flag indicating "top" of interface has been initialized */
static hbool_t H5T_top_package_initialize_s = FALSE;
@@ -5403,34 +5410,44 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5T_set_latest_version
+ * Function: H5T_set_version
*
- * Purpose: Set the encoding for a datatype to the latest version.
+ * Purpose: Set the encoding for a datatype to the version indicated by
+ * the file's low bound if that is higher than the datatype's
+ * version.
*
* Return: Non-negative on success/Negative on failure
*
- * Programmer: Quincey Koziol
- * Thursday, July 19, 2007
+ * Programmer: Vailin Choi; December 2017
*
*-------------------------------------------------------------------------
*/
herr_t
-H5T_set_latest_version(H5T_t *dt)
+H5T_set_version(H5F_t *f, H5T_t *dt)
{
- herr_t ret_value = SUCCEED; /* Return value */
+ unsigned vers; /* The version */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
/* Sanity check */
+ HDassert(f);
HDassert(dt);
- /* Upgrade the format version for the datatype to the latest */
- if(H5T__upgrade_version(dt, H5O_DTYPE_VERSION_LATEST) < 0)
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTSET, FAIL, "can't upgrade datatype encoding")
+ vers = H5O_dtype_ver_bounds[H5F_LOW_BOUND(f)];
+ if(vers > dt->shared->version) {
+ /* Upgrade the format version for the datatype */
+ if(H5T__upgrade_version(dt, vers) < 0)
+ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTSET, FAIL, "can't upgrade datatype encoding")
+ }
+
+ /* Version bounds check */
+ if(dt->shared->version > H5O_dtype_ver_bounds[H5F_HIGH_BOUND(f)])
+ HGOTO_ERROR(H5E_DATATYPE, H5E_BADRANGE, FAIL, "Datatype version out of bounds")
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5T_set_latest_version() */
+} /* end H5T_set_version() */
/*-------------------------------------------------------------------------
diff --git a/src/H5Tcommit.c b/src/H5Tcommit.c
index 30fbeeb..cd0597c 100644
--- a/src/H5Tcommit.c
+++ b/src/H5Tcommit.c
@@ -328,9 +328,9 @@ H5T__commit(H5F_t *file, H5T_t *type, hid_t tcpl_id, hid_t dxpl_id)
* a named type should always succeed.
*/
if(H5T_STATE_NAMED == type->shared->state || H5T_STATE_OPEN == type->shared->state)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "datatype is already committed")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "datatype is already committed")
if(H5T_STATE_IMMUTABLE == type->shared->state)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "datatype is immutable")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "datatype is immutable")
/* Check for a "sensible" datatype to store on disk */
if(H5T_is_sensible(type) <= 0)
@@ -344,15 +344,14 @@ H5T__commit(H5F_t *file, H5T_t *type, hid_t tcpl_id, hid_t dxpl_id)
/* Reset datatype location and path */
if(H5O_loc_reset(&temp_oloc) < 0)
- HGOTO_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "unable to initialize location")
+ HGOTO_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "unable to initialize location")
if(H5G_name_reset(&temp_path) < 0)
- HGOTO_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "unable to initialize path")
+ HGOTO_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "unable to initialize path")
loc_init = TRUE;
- /* Set the latest format, if requested */
- if(H5F_USE_LATEST_FLAGS(file, H5F_LATEST_DATATYPE))
- if(H5T_set_latest_version(type) < 0)
- HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set latest version of datatype")
+ /* Set the version for datatype */
+ if(H5T_set_version(file, type) < 0)
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set version of datatype")
/* Calculate message size infomation, for creating object header */
dtype_size = H5O_msg_size_f(file, tcpl_id, H5O_DTYPE_ID, type, (size_t)0);
@@ -363,15 +362,15 @@ H5T__commit(H5F_t *file, H5T_t *type, hid_t tcpl_id, hid_t dxpl_id)
* type message and then give the object header a name.
*/
if(H5O_create(file, dxpl_id, dtype_size, (size_t)1, tcpl_id, &temp_oloc) < 0)
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to create datatype object header")
+ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to create datatype object header")
if(H5O_msg_create(&temp_oloc, H5O_DTYPE_ID, H5O_MSG_FLAG_CONSTANT | H5O_MSG_FLAG_DONTSHARE, H5O_UPDATE_TIME, type, dxpl_id) < 0)
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to update type header message")
+ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to update type header message")
/* Copy the new object header's location into the datatype, taking ownership of it */
if(H5O_loc_copy(&(type->oloc), &temp_oloc, H5_COPY_SHALLOW) < 0)
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to copy datatype location")
+ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to copy datatype location")
if(H5G_name_copy(&(type->path), &temp_path, H5_COPY_SHALLOW) < 0)
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to copy datatype location")
+ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to copy datatype location")
loc_init = FALSE;
/* Set the shared info fields */
@@ -400,12 +399,12 @@ done:
if((type->shared->state == H5T_STATE_TRANSIENT || type->shared->state == H5T_STATE_RDONLY) && (type->sh_loc.type == H5O_SHARE_TYPE_COMMITTED)) {
if(H5O_dec_rc_by_loc(&(type->oloc), dxpl_id) < 0)
HDONE_ERROR(H5E_DATATYPE, H5E_CANTDEC, FAIL, "unable to decrement refcount on newly created object")
- if(H5O_close(&(type->oloc), NULL) < 0)
+ if(H5O_close(&(type->oloc), NULL) < 0)
HDONE_ERROR(H5E_DATATYPE, H5E_CLOSEERROR, FAIL, "unable to release object header")
if(H5O_delete(file, dxpl_id, type->sh_loc.u.loc.oh_addr) < 0)
HDONE_ERROR(H5E_DATATYPE, H5E_CANTDELETE, FAIL, "unable to delete object header")
- type->sh_loc.type = H5O_SHARE_TYPE_UNSHARED;
- } /* end if */
+ type->sh_loc.type = H5O_SHARE_TYPE_UNSHARED;
+ } /* end if */
} /* end if */
FUNC_LEAVE_NOAPI(ret_value)
diff --git a/src/H5Tpkg.h b/src/H5Tpkg.h
index d075127..f05c021 100644
--- a/src/H5Tpkg.h
+++ b/src/H5Tpkg.h
@@ -332,6 +332,9 @@ typedef struct {
/* Typedef for datatype iteration operations */
typedef herr_t (*H5T_operator_t)(H5T_t *dt, void *op_data/*in,out*/);
+/* Array of versions for Datatype */
+H5_DLLVAR const unsigned H5O_dtype_ver_bounds[H5F_LIBVER_NBOUNDS];
+
/*
* Alignment information for native types. A value of N indicates that the
* data must be aligned on an address ADDR such that 0 == ADDR mod N. When
diff --git a/src/H5Tprivate.h b/src/H5Tprivate.h
index 9171e1e..5272361 100644
--- a/src/H5Tprivate.h
+++ b/src/H5Tprivate.h
@@ -136,7 +136,7 @@ H5_DLL herr_t H5T_vlen_get_alloc_info(hid_t dxpl_id, H5T_vlen_alloc_info_t **vl_
H5_DLL htri_t H5T_set_loc(H5T_t *dt, H5F_t *f, H5T_loc_t loc);
H5_DLL htri_t H5T_is_sensible(const H5T_t *dt);
H5_DLL uint32_t H5T_hash(H5F_t * file, const H5T_t *dt);
-H5_DLL herr_t H5T_set_latest_version(H5T_t *dt);
+H5_DLL herr_t H5T_set_version(H5F_t *f, H5T_t *dt);
H5_DLL herr_t H5T_patch_file(H5T_t *dt, H5F_t *f);
H5_DLL herr_t H5T_patch_vlen_file(H5T_t *dt, H5F_t *f);
H5_DLL htri_t H5T_is_variable_str(const H5T_t *dt);
diff --git a/src/H5Zscaleoffset.c b/src/H5Zscaleoffset.c
index b86d785..58bcf8b 100644
--- a/src/H5Zscaleoffset.c
+++ b/src/H5Zscaleoffset.c
@@ -13,16 +13,16 @@
#include "H5Zmodule.h" /* This source code file is part of the H5Z module */
-#include "H5private.h" /* Generic Functions */
-#include "H5ACprivate.h" /* Metadata cache */
-#include "H5Eprivate.h" /* Error handling */
-#include "H5Iprivate.h" /* IDs */
-#include "H5MMprivate.h" /* Memory management */
+#include "H5private.h" /* Generic Functions */
+#include "H5ACprivate.h" /* Metadata cache */
+#include "H5Eprivate.h" /* Error handling */
+#include "H5Iprivate.h" /* IDs */
+#include "H5MMprivate.h" /* Memory management */
#include "H5Pprivate.h" /* Property lists */
#include "H5Oprivate.h" /* Object headers */
-#include "H5Sprivate.h" /* Dataspaces */
-#include "H5Tprivate.h" /* Datatypes */
-#include "H5Zpkg.h" /* Data filters */
+#include "H5Sprivate.h" /* Dataspaces */
+#include "H5Tprivate.h" /* Datatypes */
+#include "H5Zpkg.h" /* Data filters */
/* Struct of parameters needed for compressing/decompressing one atomic datatype */
typedef struct {
@@ -78,13 +78,13 @@ static void H5Z_scaleoffset_compress(unsigned char *data, unsigned d_nelmts, uns
/* This message derives from H5Z */
H5Z_class2_t H5Z_SCALEOFFSET[1] = {{
H5Z_CLASS_T_VERS, /* H5Z_class_t version */
- H5Z_FILTER_SCALEOFFSET, /* Filter id number */
+ H5Z_FILTER_SCALEOFFSET, /* Filter id number */
1, /* Assume encoder present: check before registering */
1, /* decoder_present flag (set to true) */
- "scaleoffset", /* Filter name for debugging */
- H5Z_can_apply_scaleoffset, /* The "can apply" callback */
+ "scaleoffset", /* Filter name for debugging */
+ H5Z_can_apply_scaleoffset, /* The "can apply" callback */
H5Z_set_local_scaleoffset, /* The "set local" callback */
- H5Z_filter_scaleoffset, /* The actual filter function */
+ H5Z_filter_scaleoffset, /* The actual filter function */
}};
/* Local macros */
@@ -665,15 +665,15 @@ H5Z_class2_t H5Z_SCALEOFFSET[1] = {{
H5Z_scaleoffset_modify_4(i, type, pow_fun, buf, d_nelmts, min, D_val) \
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5Z_can_apply_scaleoffset
+ * Function: H5Z_can_apply_scaleoffset
*
- * Purpose: Check the parameters for scaleoffset compression for
+ * Purpose: Check the parameters for scaleoffset compression for
* validity and whether they fit a particular dataset.
*
- * Return: Success: Non-negative
- * Failure: Negative
+ * Return: Success: Non-negative
+ * Failure: Negative
*
* Programmer: Xiaowen Wu
* Friday, February 4, 2005
@@ -685,7 +685,7 @@ H5Z_class2_t H5Z_SCALEOFFSET[1] = {{
static htri_t
H5Z_can_apply_scaleoffset(hid_t H5_ATTR_UNUSED dcpl_id, hid_t type_id, hid_t H5_ATTR_UNUSED space_id)
{
- const H5T_t *type; /* Datatype */
+ const H5T_t *type; /* Datatype */
H5T_class_t dtype_class; /* Datatype's class */
H5T_order_t dtype_order; /* Datatype's endianness order */
htri_t ret_value = TRUE; /* Return value */
@@ -694,20 +694,20 @@ H5Z_can_apply_scaleoffset(hid_t H5_ATTR_UNUSED dcpl_id, hid_t type_id, hid_t H5_
/* Get datatype */
if(NULL == (type = (H5T_t *)H5I_object_verify(type_id, H5I_DATATYPE)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype")
/* Get datatype's class, for checking the "datatype class" */
if((dtype_class = H5T_get_class(type, TRUE)) == H5T_NO_CLASS)
- HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "bad datatype class")
+ HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "bad datatype class")
/* Get datatype's size, for checking the "datatype size" */
if(H5T_get_size(type) == 0)
- HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "bad datatype size")
+ HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "bad datatype size")
if(dtype_class == H5T_INTEGER || dtype_class == H5T_FLOAT) {
/* Get datatype's endianness order */
if((dtype_order = H5T_get_order(type)) == H5T_ORDER_ERROR)
- HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "can't retrieve datatype endianness order")
+ HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "can't retrieve datatype endianness order")
/* Range check datatype's endianness order */
if(dtype_order != H5T_ORDER_LE && dtype_order != H5T_ORDER_BE)
@@ -719,17 +719,17 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5Z_can_apply_scaleoffset() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5Z_scaleoffset_get_type
+ * Function: H5Z_scaleoffset_get_type
*
- * Purpose: Get the specific integer type based on datatype size and sign
+ * Purpose: Get the specific integer type based on datatype size and sign
* or floating-point type based on size
*
- * Return: Success: id number of integer type
- * Failure: 0
+ * Return: Success: id number of integer type
+ * Failure: 0
*
- * Programmer: Xiaowen Wu
+ * Programmer: Xiaowen Wu
* Wednesday, April 13, 2005
*
* Modifications:
@@ -784,14 +784,14 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5Z_scaleoffset_set_parms_fillval
+ * Function: H5Z_scaleoffset_set_parms_fillval
*
- * Purpose: Get the fill value of the dataset and store in cd_values[]
+ * Purpose: Get the fill value of the dataset and store in cd_values[]
*
- * Return: Success: Non-negative
- * Failure: Negative
+ * Return: Success: Non-negative
+ * Failure: Negative
*
* Programmer: Xiaowen Wu
* Monday, March 7, 2005
@@ -836,17 +836,17 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5Z_scaleoffset_set_parms_fillval() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5Z_set_local_scaleoffset
+ * Function: H5Z_set_local_scaleoffset
*
- * Purpose: Set the "local" dataset parameters for scaleoffset
+ * Purpose: Set the "local" dataset parameters for scaleoffset
* compression.
*
- * Return: Success: Non-negative
- * Failure: Negative
+ * Return: Success: Non-negative
+ * Failure: Negative
*
- * Programmer: Xiaowen Wu
+ * Programmer: Xiaowen Wu
* Friday, February 4, 2005
*
* Modifications:
@@ -857,8 +857,8 @@ static herr_t
H5Z_set_local_scaleoffset(hid_t dcpl_id, hid_t type_id, hid_t space_id)
{
H5P_genplist_t *dcpl_plist; /* Property list pointer */
- H5T_t *type; /* Datatype */
- const H5S_t *ds; /* Dataspace */
+ H5T_t *type; /* Datatype */
+ const H5S_t *ds; /* Dataspace */
unsigned flags; /* Filter flags */
size_t cd_nelmts = H5Z_SCALEOFFSET_USER_NPARMS; /* Number of filter parameters */
unsigned cd_values[H5Z_SCALEOFFSET_TOTAL_NPARMS]; /* Filter parameters */
@@ -879,14 +879,14 @@ H5Z_set_local_scaleoffset(hid_t dcpl_id, hid_t type_id, hid_t space_id)
/* Get datatype */
if(NULL == (type = (H5T_t *)H5I_object_verify(type_id, H5I_DATATYPE)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype")
/* Initialize the parameters to a known state */
HDmemset(cd_values, 0, sizeof(cd_values));
/* Get the filter's current parameters */
if(H5P_get_filter_by_id(dcpl_plist, H5Z_FILTER_SCALEOFFSET, &flags, &cd_nelmts, cd_values, (size_t)0, NULL, NULL) < 0)
- HGOTO_ERROR(H5E_PLINE, H5E_CANTGET, FAIL, "can't get scaleoffset parameters")
+ HGOTO_ERROR(H5E_PLINE, H5E_CANTGET, FAIL, "can't get scaleoffset parameters")
/* Get dataspace */
if(NULL == (ds = (H5S_t *)H5I_object_verify(space_id, H5I_DATASPACE)))
@@ -930,7 +930,7 @@ H5Z_set_local_scaleoffset(hid_t dcpl_id, hid_t type_id, hid_t space_id)
/* Get datatype's size */
if((dtype_size = H5T_get_size(type)) == 0)
- HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "bad datatype size")
+ HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "bad datatype size")
/* Set "local" parameter for datatype size */
H5_CHECK_OVERFLOW(dtype_size, size_t, unsigned);
@@ -1008,23 +1008,23 @@ H5Z_set_local_scaleoffset(hid_t dcpl_id, hid_t type_id, hid_t space_id)
/* Modify the filter's parameters for this dataset */
if(H5P_modify_filter(dcpl_plist, H5Z_FILTER_SCALEOFFSET, flags, (size_t)H5Z_SCALEOFFSET_TOTAL_NPARMS, cd_values) < 0)
- HGOTO_ERROR(H5E_PLINE, H5E_CANTSET, FAIL, "can't set local scaleoffset parameters")
+ HGOTO_ERROR(H5E_PLINE, H5E_CANTSET, FAIL, "can't set local scaleoffset parameters")
done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5Z_set_local_scaleoffset() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5Z_filter_scaleoffset
+ * Function: H5Z_filter_scaleoffset
*
- * Purpose: Implement an I/O filter for storing packed integer
+ * Purpose: Implement an I/O filter for storing packed integer
* data using scale and offset method.
*
- * Return: Success: Size of buffer filtered
- * Failure: 0
+ * Return: Success: Size of buffer filtered
+ * Failure: 0
*
- * Programmer: Xiaowen Wu
+ * Programmer: Xiaowen Wu
* Monday, February 7, 2005
*
* Modifications:
@@ -1051,13 +1051,13 @@ H5Z_filter_scaleoffset(unsigned flags, size_t cd_nelmts, const unsigned cd_value
unsigned char *outbuf = NULL; /* pointer to new output buffer */
unsigned buf_offset = 21; /* buffer offset because of parameters stored in file */
unsigned i; /* index */
- parms_atomic p; /* paramters needed for compress/decompress functions */
+ parms_atomic p; /* parameters needed for compress/decompress functions */
FUNC_ENTER_NOAPI_NOINIT
/* check arguments */
if(cd_nelmts != H5Z_SCALEOFFSET_TOTAL_NPARMS)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, 0, "invalid scaleoffset number of paramters")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, 0, "invalid scaleoffset number of parameters")
/* Check if memory byte order matches dataset datatype byte order */
switch(H5T_native_order_g) {
@@ -1107,7 +1107,7 @@ H5Z_filter_scaleoffset(unsigned flags, size_t cd_nelmts, const unsigned cd_value
/* if scale_factor is less than 0 for integer, library will reset it to 0
* in this case, library will calculate the minimum-bits
*/
- if(scale_factor < 0) scale_factor = 0;
+ if(scale_factor < 0) scale_factor = 0;
}
/* fixed-minimum-bits method is not implemented and is forbidden */
@@ -1128,7 +1128,7 @@ H5Z_filter_scaleoffset(unsigned flags, size_t cd_nelmts, const unsigned cd_value
minbits = (uint32_t)scale_factor;
}
- /* prepare paramters to pass to compress/decompress functions */
+ /* prepare parameters to pass to compress/decompress functions */
p.size = cd_values[H5Z_SCALEOFFSET_PARM_SIZE];
p.mem_order = H5T_native_order_g;
@@ -1310,7 +1310,7 @@ done:
* atomic datatype is treated on byte basis
*/
-
+
/* change byte order of input buffer either from little-endian to big-endian
* or from big-endian to little-endian 2/21/2005
*/
diff --git a/src/H5detect.c b/src/H5detect.c
index 75a1dba..ff163cf 100644
--- a/src/H5detect.c
+++ b/src/H5detect.c
@@ -27,23 +27,23 @@ static const char *FileHeader = "\n\
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *";
/*
*
- * Created: H5detect.c
- * 10 Aug 1997
- * Robb Matzke
+ * Created: H5detect.c
+ * 10 Aug 1997
+ * Robb Matzke
*
- * Purpose: This code was borrowed heavily from the `detect.c'
- * program in the AIO distribution from Lawrence
- * Livermore National Laboratory.
+ * Purpose: This code was borrowed heavily from the `detect.c'
+ * program in the AIO distribution from Lawrence
+ * Livermore National Laboratory.
*
- * Detects machine byte order and floating point
- * format and generates a C source file (H5Tinit.c)
- * to describe those paramters.
+ * Detects machine byte order and floating point
+ * format and generates a C source file (H5Tinit.c)
+ * to describe those parameters.
*
* Assumptions: We have an ANSI compiler. We're on a Unix like
- * system or configure has detected those Unix
- * features which aren't available. We're not
- * running on a Vax or other machine with mixed
- * endianess.
+ * system or configure has detected those Unix
+ * features which aren't available. We're not
+ * running on a Vax or other machine with mixed
+ * endianess.
*
* Modifications:
*
@@ -54,9 +54,19 @@ static const char *FileHeader = "\n\
#include "H5Tpublic.h"
#include "H5Rpublic.h"
+#if defined(__has_attribute)
+#if __has_attribute(no_sanitize)
+#define HDF_NO_UBSAN __attribute__((no_sanitize("undefined")))
+#else
+#define HDF_NO_UBSAN
+#endif
+#else
+#define HDF_NO_UBSAN
+#endif
+
#define MAXDETECT 64
-/* The ALIGNMENT test code may generate the SIGBUS, SIGSEGV, or SIGILL signals.
+/* The ALIGNMENT test code may generate the SIGBUS, SIGSEGV, or SIGILL signals.
* We use setjmp/longjmp in the signal handlers for recovery. But setjmp/longjmp
* do not necessary restore the signal blocking status while sigsetjmp/siglongjmp
* do. If sigsetjmp/siglongjmp are not supported, need to use sigprocmask to
@@ -65,20 +75,20 @@ static const char *FileHeader = "\n\
/* Define H5SETJMP/H5LONGJMP depending on if sigsetjmp/siglongjmp are */
/* supported. */
#if defined(H5_HAVE_SIGSETJMP) && defined(H5_HAVE_SIGLONGJMP)
-/* Always save blocked signals to be restore by siglongjmp. */
-#define H5JMP_BUF sigjmp_buf
-#define H5SETJMP(buf) HDsigsetjmp(buf, 1)
-#define H5LONGJMP(buf, val) HDsiglongjmp(buf, val)
-#define H5HAVE_SIGJMP /* sigsetjmp/siglongjmp are supported. */
+/* Always save blocked signals to be restored by siglongjmp. */
+#define H5JMP_BUF sigjmp_buf
+#define H5SETJMP(buf) HDsigsetjmp(buf, 1)
+#define H5LONGJMP(buf, val) HDsiglongjmp(buf, val)
+#define H5HAVE_SIGJMP /* sigsetjmp/siglongjmp are supported. */
#elif defined(H5_HAVE_LONGJMP)
-#define H5JMP_BUF jmp_buf
-#define H5SETJMP(buf) HDsetjmp(buf)
-#define H5LONGJMP(buf, val) HDlongjmp(buf, val)
+#define H5JMP_BUF jmp_buf
+#define H5SETJMP(buf) HDsetjmp(buf)
+#define H5LONGJMP(buf, val) HDlongjmp(buf, val)
#endif
/* ALIGNMENT and signal-handling status codes */
-#define STA_NoALIGNMENT 0x0001 /* No ALIGNMENT Test */
-#define STA_NoHandlerVerify 0x0002 /* No signal handler Tests */
+#define STA_NoALIGNMENT 0x0001 /* No ALIGNMENT Test */
+#define STA_NoHandlerVerify 0x0002 /* No signal handler Tests */
/*
@@ -133,11 +143,11 @@ static void detect_C99_integers32(void);
static void detect_C99_integers64(void);
static void detect_alignments(void);
static unsigned int align_g[] = {1, 2, 4, 8, 16};
-static int align_status_g = 0; /* ALIGNMENT Signal Status */
-static int sigbus_handler_called_g = 0; /* how many times called */
+static int align_status_g = 0; /* ALIGNMENT Signal Status */
+static int sigbus_handler_called_g = 0; /* how many times called */
static int sigsegv_handler_called_g = 0;/* how many times called */
-static int sigill_handler_called_g = 0; /* how many times called */
-static int signal_handler_tested_g = 0; /* how many times tested */
+static int sigill_handler_called_g = 0; /* how many times called */
+static int signal_handler_tested_g = 0; /* how many times tested */
#if defined(H5SETJMP) && defined(H5_HAVE_SIGNAL)
static int verify_signal_handlers(int signum, void (*handler)(int));
#endif
@@ -145,16 +155,16 @@ static int verify_signal_handlers(int signum, void (*handler)(int));
static H5JMP_BUF jbuf_g;
#endif
-
+
/*-------------------------------------------------------------------------
- * Function: precision
+ * Function: precision
*
- * Purpose: Determine the precision and offset.
+ * Purpose: Determine the precision and offset.
*
- * Return: void
+ * Return: void
*
- * Programmer: Robb Matzke
- * Thursday, June 18, 1998
+ * Programmer: Robb Matzke
+ * Thursday, June 18, 1998
*
* Modifications:
*
@@ -167,7 +177,7 @@ precision (detected_t *d)
if (0 == d->msize) {
/*
- * An integer. The permutation can have negative values at the
+ * An integer. The permutation can have negative values at the
* beginning or end which represent padding of bytes. We must adjust
* the precision and offset accordingly.
*/
@@ -201,36 +211,36 @@ precision (detected_t *d)
}
}
-
+
/*-------------------------------------------------------------------------
- * Function: DETECT_I/DETECT_BYTE
+ * Function: DETECT_I/DETECT_BYTE
*
- * Purpose: These macro takes a type like `int' and a base name like
- * `nati' and detects the byte order. The VAR is used to
- * construct the names of the C variables defined.
+ * Purpose: These macro takes a type like `int' and a base name like
+ * `nati' and detects the byte order. The VAR is used to
+ * construct the names of the C variables defined.
*
* DETECT_I is used for types that are larger than one byte,
* DETECT_BYTE is used for types that are exactly one byte.
*
- * Return: void
+ * Return: void
*
- * Programmer: Robb Matzke
- * matzke@llnl.gov
- * Jun 12 1996
+ * Programmer: Robb Matzke
+ * matzke@llnl.gov
+ * Jun 12 1996
*
* Modifications:
*
- * Robb Matzke, 4 Nov 1996
- * The INFO.perm now contains `-1' for bytes that aren't used and
- * are always zero. This happens on the Cray for `short' where
- * sizeof(short) is 8, but only the low-order 4 bytes are ever used.
+ * Robb Matzke, 4 Nov 1996
+ * The INFO.perm now contains `-1' for bytes that aren't used and
+ * are always zero. This happens on the Cray for `short' where
+ * sizeof(short) is 8, but only the low-order 4 bytes are ever used.
*
- * Robb Matzke, 4 Nov 1996
- * Added a `padding' field to indicate how many zero bytes appear to
- * the left (N) or right (-N) of the value.
+ * Robb Matzke, 4 Nov 1996
+ * Added a `padding' field to indicate how many zero bytes appear to
+ * the left (N) or right (-N) of the value.
*
- * Robb Matzke, 5 Nov 1996
- * Removed HFILE and CFILE arguments.
+ * Robb Matzke, 5 Nov 1996
+ * Removed HFILE and CFILE arguments.
*
* Neil Fortner, 6 Sep 2013
* Split macro into DETECT_I and DETECT_BYTE macros, extracted
@@ -273,27 +283,27 @@ precision (detected_t *d)
DETECT_I_BYTE_CORE(TYPE,VAR,INFO,int) \
}
-#define DETECT_I(TYPE,VAR,INFO) { \
+#define DETECT_I(TYPE,VAR,INFO) { \
HDcompile_assert(sizeof(TYPE) > 1); \
\
DETECT_I_BYTE_CORE(TYPE,VAR,INFO,TYPE) \
}
-
+
/*-------------------------------------------------------------------------
- * Function: DETECT_F
+ * Function: DETECT_F
*
- * Purpose: This macro takes a floating point type like `double' and
- * a base name like `natd' and detects byte order, mantissa
- * location, exponent location, sign bit location, presence or
- * absence of implicit mantissa bit, and exponent bias and
- * initializes a detected_t structure with those properties.
+ * Purpose: This macro takes a floating point type like `double' and
+ * a base name like `natd' and detects byte order, mantissa
+ * location, exponent location, sign bit location, presence or
+ * absence of implicit mantissa bit, and exponent bias and
+ * initializes a detected_t structure with those properties.
*
- * Return: void
+ * Return: void
*
- * Programmer: Robb Matzke
- * matzke@llnl.gov
- * Jun 12 1996
+ * Programmer: Robb Matzke
+ * matzke@llnl.gov
+ * Jun 12 1996
*
*-------------------------------------------------------------------------
*/
@@ -383,31 +393,31 @@ precision (detected_t *d)
} \
}
-
+
/*-------------------------------------------------------------------------
- * Function: DETECT_M
+ * Function: DETECT_M
*
- * Purpose: This macro takes only miscellaneous structures or pointer
+ * Purpose: This macro takes only miscellaneous structures or pointer
* (pointer, hvl_t, hobj_ref_t, hdset_reg_ref_t). It
- * constructs the names and decides the alignment in structure.
+ * constructs the names and decides the alignment in structure.
*
- * Return: void
+ * Return: void
*
- * Programmer: Raymond Lu
- * slu@ncsa.uiuc.edu
- * Dec 9, 2002
+ * Programmer: Raymond Lu
+ * slu@ncsa.uiuc.edu
+ * Dec 9, 2002
*
* Modifications:
*
*-------------------------------------------------------------------------
*/
-#define DETECT_M(TYPE,VAR,INFO) { \
- INFO.name = #VAR; \
- COMP_ALIGNMENT(TYPE, INFO.comp_align); \
+#define DETECT_M(TYPE,VAR,INFO) { \
+ INFO.name = #VAR; \
+ COMP_ALIGNMENT(TYPE, INFO.comp_align); \
}
/* Detect alignment for C structure */
-#define COMP_ALIGNMENT(TYPE,COMP_ALIGN) { \
+#define COMP_ALIGNMENT(TYPE,COMP_ALIGN) { \
struct { \
char c; \
TYPE x; \
@@ -417,67 +427,67 @@ precision (detected_t *d)
}
#if defined(H5SETJMP) && defined(H5_HAVE_SIGNAL)
-#define ALIGNMENT(TYPE,INFO) { \
- char *volatile _buf = NULL; \
- TYPE _val = 1, _val2; \
- volatile size_t _ano = 0; \
- void (*_handler)(int) = HDsignal(SIGBUS, sigbus_handler); \
- void (*_handler2)(int) = HDsignal(SIGSEGV, sigsegv_handler);\
- void (*_handler3)(int) = HDsignal(SIGILL, sigill_handler); \
- \
- _buf = (char*)HDmalloc(sizeof(TYPE) + align_g[NELMTS(align_g) - 1]); \
- if(H5SETJMP(jbuf_g)) _ano++; \
- if(_ano < NELMTS(align_g)) { \
- *((TYPE*)(_buf+align_g[_ano])) = _val; /*possible SIGBUS or SEGSEGV*/ \
- _val2 = *((TYPE*)(_buf+align_g[_ano])); /*possible SIGBUS or SEGSEGV*/\
- /* Cray Check: This section helps detect alignment on Cray's */ \
+#define ALIGNMENT(TYPE,INFO) { \
+ char *volatile _buf = NULL; \
+ TYPE _val = 1, _val2; \
+ volatile size_t _ano = 0; \
+ void (*_handler)(int) = HDsignal(SIGBUS, sigbus_handler); \
+ void (*_handler2)(int) = HDsignal(SIGSEGV, sigsegv_handler);\
+ void (*_handler3)(int) = HDsignal(SIGILL, sigill_handler); \
+ \
+ _buf = (char*)HDmalloc(sizeof(TYPE) + align_g[NELMTS(align_g) - 1]); \
+ if(H5SETJMP(jbuf_g)) _ano++; \
+ if(_ano < NELMTS(align_g)) { \
+ *((TYPE*)(_buf+align_g[_ano])) = _val; /*possible SIGBUS or SEGSEGV*/ \
+ _val2 = *((TYPE*)(_buf+align_g[_ano])); /*possible SIGBUS or SEGSEGV*/\
+ /* Cray Check: This section helps detect alignment on Cray's */ \
/* vector machines (like the SV1) which mask off */ \
- /* pointer values when pointing to non-word aligned */ \
- /* locations with pointers that are supposed to be */ \
- /* word aligned. -QAK */ \
- HDmemset(_buf, 0xff, sizeof(TYPE)+align_g[NELMTS(align_g)-1]); \
+ /* pointer values when pointing to non-word aligned */ \
+ /* locations with pointers that are supposed to be */ \
+ /* word aligned. -QAK */ \
+ HDmemset(_buf, 0xff, sizeof(TYPE)+align_g[NELMTS(align_g)-1]); \
/*How to handle VAX types?*/ \
- if(INFO.perm[0]) /* Big-Endian */ \
- HDmemcpy(_buf+align_g[_ano]+(INFO.size-((INFO.offset+INFO.precision)/8)),((char *)&_val)+(INFO.size-((INFO.offset+INFO.precision)/8)),(size_t)(INFO.precision/8)); \
- else /* Little-Endian */ \
- HDmemcpy(_buf+align_g[_ano]+(INFO.offset/8),((char *)&_val)+(INFO.offset/8),(size_t)(INFO.precision/8)); \
- _val2 = *((TYPE*)(_buf+align_g[_ano])); \
- H5_GCC_DIAG_OFF(float-equal) \
- if(_val!=_val2) \
- H5LONGJMP(jbuf_g, 1); \
- H5_GCC_DIAG_ON(float-equal) \
- /* End Cray Check */ \
- (INFO.align)=align_g[_ano]; \
- } else { \
- (INFO.align)=0; \
- fprintf(stderr, "unable to calculate alignment for %s\n", #TYPE); \
- } \
- HDfree(_buf); \
- HDsignal(SIGBUS, _handler); /*restore original handler*/ \
- HDsignal(SIGSEGV, _handler2); /*restore original handler*/ \
- HDsignal(SIGILL, _handler3); /*restore original handler*/ \
+ if(INFO.perm[0]) /* Big-Endian */ \
+ HDmemcpy(_buf+align_g[_ano]+(INFO.size-((INFO.offset+INFO.precision)/8)),((char *)&_val)+(INFO.size-((INFO.offset+INFO.precision)/8)),(size_t)(INFO.precision/8)); \
+ else /* Little-Endian */ \
+ HDmemcpy(_buf+align_g[_ano]+(INFO.offset/8),((char *)&_val)+(INFO.offset/8),(size_t)(INFO.precision/8)); \
+ _val2 = *((TYPE*)(_buf+align_g[_ano])); \
+ H5_GCC_DIAG_OFF(float-equal) \
+ if(_val!=_val2) \
+ H5LONGJMP(jbuf_g, 1); \
+ H5_GCC_DIAG_ON(float-equal) \
+ /* End Cray Check */ \
+ (INFO.align)=align_g[_ano]; \
+ } else { \
+ (INFO.align)=0; \
+ fprintf(stderr, "unable to calculate alignment for %s\n", #TYPE); \
+ } \
+ HDfree(_buf); \
+ HDsignal(SIGBUS, _handler); /*restore original handler*/ \
+ HDsignal(SIGSEGV, _handler2); /*restore original handler*/ \
+ HDsignal(SIGILL, _handler3); /*restore original handler*/ \
}
#else
-#define ALIGNMENT(TYPE,INFO) { \
- align_status_g |= STA_NoALIGNMENT; \
- (INFO.align)=0; \
+#define ALIGNMENT(TYPE,INFO) { \
+ align_status_g |= STA_NoALIGNMENT; \
+ (INFO.align)=0; \
}
#endif
-
+
#if defined(H5LONGJMP) && defined(H5_HAVE_SIGNAL)
/*-------------------------------------------------------------------------
- * Function: sigsegv_handler
+ * Function: sigsegv_handler
*
- * Purpose: Handler for SIGSEGV. We use signal() instead of sigaction()
- * because it's more portable to non-Posix systems. Although
- * it's not nearly as nice to work with, it does the job for
- * this simple stuff.
+ * Purpose: Handler for SIGSEGV. We use signal() instead of sigaction()
+ * because it's more portable to non-Posix systems. Although
+ * it's not nearly as nice to work with, it does the job for
+ * this simple stuff.
*
- * Return: Returns via H5LONGJMP to jbuf_g.
+ * Return: Returns via H5LONGJMP to jbuf_g.
*
- * Programmer: Robb Matzke
- * Thursday, March 18, 1999
+ * Programmer: Robb Matzke
+ * Thursday, March 18, 1999
*
* Modifications:
*
@@ -502,20 +512,20 @@ sigsegv_handler(int H5_ATTR_UNUSED signo)
}
#endif
-
+
#if defined(H5LONGJMP) && defined(H5_HAVE_SIGNAL)
/*-------------------------------------------------------------------------
- * Function: sigbus_handler
+ * Function: sigbus_handler
*
- * Purpose: Handler for SIGBUS. We use signal() instead of sigaction()
- * because it's more portable to non-Posix systems. Although
- * it's not nearly as nice to work with, it does the job for
- * this simple stuff.
+ * Purpose: Handler for SIGBUS. We use signal() instead of sigaction()
+ * because it's more portable to non-Posix systems. Although
+ * it's not nearly as nice to work with, it does the job for
+ * this simple stuff.
*
- * Return: Returns via H5LONGJMP to jbuf_g.
+ * Return: Returns via H5LONGJMP to jbuf_g.
*
- * Programmer: Robb Matzke
- * Thursday, March 18, 1999
+ * Programmer: Robb Matzke
+ * Thursday, March 18, 1999
*
* Modifications:
*
@@ -540,20 +550,20 @@ sigbus_handler(int H5_ATTR_UNUSED signo)
}
#endif
-
+
#if defined(H5LONGJMP) && defined(H5_HAVE_SIGNAL)
/*-------------------------------------------------------------------------
- * Function: sigill_handler
+ * Function: sigill_handler
*
- * Purpose: Handler for SIGILL. We use signal() instead of sigaction()
- * because it's more portable to non-Posix systems. Although
- * it's not nearly as nice to work with, it does the job for
- * this simple stuff.
+ * Purpose: Handler for SIGILL. We use signal() instead of sigaction()
+ * because it's more portable to non-Posix systems. Although
+ * it's not nearly as nice to work with, it does the job for
+ * this simple stuff.
*
- * Return: Returns via H5LONGJMP to jbuf_g.
+ * Return: Returns via H5LONGJMP to jbuf_g.
*
- * Programmer: Raymond Lu
- * 28 October 2013
+ * Programmer: Raymond Lu
+ * 28 October 2013
*
*-------------------------------------------------------------------------
*/
@@ -576,17 +586,17 @@ sigill_handler(int H5_ATTR_UNUSED signo)
}
#endif
-
+
/*-------------------------------------------------------------------------
- * Function: print_results
+ * Function: print_results
*
- * Purpose: Prints information about the detected data types.
+ * Purpose: Prints information about the detected data types.
*
- * Return: void
+ * Return: void
*
- * Programmer: Robb Matzke
- * matzke@llnl.gov
- * Jun 14, 1996
+ * Programmer: Robb Matzke
+ * matzke@llnl.gov
+ * Jun 14, 1996
*
* Modifications:
*
@@ -596,7 +606,7 @@ static void
print_results(int nd, detected_t *d, int na, malign_t *misc_align)
{
int byte_order=0; /*byte order of data types*/
- int i, j;
+ int i, j;
/* Include files */
printf("\
@@ -610,11 +620,11 @@ print_results(int nd, detected_t *d, int na, malign_t *misc_align)
/***********/\n\
/* Headers */\n\
/***********/\n\
-#include \"H5private.h\" /* Generic Functions */\n\
-#include \"H5Eprivate.h\" /* Error handling */\n\
-#include \"H5FLprivate.h\" /* Free Lists */\n\
-#include \"H5Iprivate.h\" /* IDs */\n\
-#include \"H5Tpkg.h\" /* Datatypes */\n\
+#include \"H5private.h\" /* Generic Functions */\n\
+#include \"H5Eprivate.h\" /* Error handling */\n\
+#include \"H5FLprivate.h\" /* Free Lists */\n\
+#include \"H5Iprivate.h\" /* IDs */\n\
+#include \"H5Tpkg.h\" /* Datatypes */\n\
\n\
\n\
/****************/\n\
@@ -663,15 +673,15 @@ print_results(int nd, detected_t *d, int na, malign_t *misc_align)
printf("\n\
\n\
/*-------------------------------------------------------------------------\n\
- * Function: H5T__init_native\n\
+ * Function: H5T__init_native\n\
*\n\
- * Purpose: Initialize pre-defined native datatypes from code generated\n\
+ * Purpose: Initialize pre-defined native datatypes from code generated\n\
* during the library configuration by H5detect.\n\
*\n\
- * Return: Success: non-negative\n\
- * Failure: negative\n\
+ * Return: Success: non-negative\n\
+ * Failure: negative\n\
*\n\
- * Programmer: Robb Matzke\n\
+ * Programmer: Robb Matzke\n\
* Wednesday, December 16, 1998\n\
*\n\
*-------------------------------------------------------------------------\n\
@@ -679,8 +689,8 @@ print_results(int nd, detected_t *d, int na, malign_t *misc_align)
herr_t\n\
H5T__init_native(void)\n\
{\n\
- H5T_t *dt = NULL;\n\
- herr_t ret_value = SUCCEED;\n\
+ H5T_t *dt = NULL;\n\
+ herr_t ret_value = SUCCEED;\n\
\n\
FUNC_ENTER_PACKAGE\n");
@@ -702,20 +712,20 @@ H5T__init_native(void)\n\
}
}
- /* Print a comment to describe this section of definitions. */
- printf("\n /*\n");
- iprint(d+i);
- printf(" */\n");
+ /* Print a comment to describe this section of definitions. */
+ printf("\n /*\n");
+ iprint(d+i);
+ printf(" */\n");
- /* The part common to fixed and floating types */
- printf("\
+ /* The part common to fixed and floating types */
+ printf("\
if(NULL == (dt = H5T__alloc()))\n\
HGOTO_ERROR(H5E_DATATYPE, H5E_NOSPACE, FAIL, \"datatype allocation failed\")\n\
dt->shared->state = H5T_STATE_IMMUTABLE;\n\
dt->shared->type = H5T_%s;\n\
dt->shared->size = %d;\n",
- d[i].msize ? "FLOAT" : "INTEGER",/*class */
- d[i].size); /*size */
+ d[i].msize ? "FLOAT" : "INTEGER",/*class */
+ d[i].size); /*size */
if(byte_order==-1)
printf("\
@@ -732,18 +742,18 @@ H5T__init_native(void)\n\
dt->shared->u.atomic.prec = %d;\n\
dt->shared->u.atomic.lsb_pad = H5T_PAD_ZERO;\n\
dt->shared->u.atomic.msb_pad = H5T_PAD_ZERO;\n",
- d[i].offset, /*offset */
- d[i].precision); /*precision */
+ d[i].offset, /*offset */
+ d[i].precision); /*precision */
/*HDassert((d[i].perm[0]>0)==(byte_order>0));*/ /* Double-check that byte-order doesn't change */
- if (0 == d[i].msize) {
- /* The part unique to fixed point types */
- printf("\
+ if (0 == d[i].msize) {
+ /* The part unique to fixed point types */
+ printf("\
dt->shared->u.atomic.u.i.sign = H5T_SGN_%s;\n",
- d[i].sign ? "2" : "NONE");
- } else {
- /* The part unique to floating point types */
- printf("\
+ d[i].sign ? "2" : "NONE");
+ } else {
+ /* The part unique to floating point types */
+ printf("\
dt->shared->u.atomic.u.f.sign = %d;\n\
dt->shared->u.atomic.u.f.epos = %d;\n\
dt->shared->u.atomic.u.f.esize = %d;\n\
@@ -752,22 +762,22 @@ H5T__init_native(void)\n\
dt->shared->u.atomic.u.f.msize = %d;\n\
dt->shared->u.atomic.u.f.norm = H5T_NORM_%s;\n\
dt->shared->u.atomic.u.f.pad = H5T_PAD_ZERO;\n",
- d[i].sign, /*sign location */
- d[i].epos, /*exponent loc */
- d[i].esize, /*exponent size */
- (unsigned long)(d[i].bias), /*exponent bias */
- d[i].mpos, /*mantissa loc */
- d[i].msize, /*mantissa size */
- d[i].imp ? "IMPLIED" : "NONE"); /*normalization */
- }
-
- /* Atomize the type */
- printf("\
+ d[i].sign, /*sign location */
+ d[i].epos, /*exponent loc */
+ d[i].esize, /*exponent size */
+ (unsigned long)(d[i].bias), /*exponent bias */
+ d[i].mpos, /*mantissa loc */
+ d[i].msize, /*mantissa size */
+ d[i].imp ? "IMPLIED" : "NONE"); /*normalization */
+ }
+
+ /* Atomize the type */
+ printf("\
if((H5T_NATIVE_%s_g = H5I_register(H5I_DATATYPE, dt, FALSE)) < 0)\n\
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, \"can't register ID for built-in datatype\")\n",
- d[i].varname);
- printf(" H5T_NATIVE_%s_ALIGN_g = %lu;\n",
- d[i].varname, (unsigned long)(d[i].align));
+ d[i].varname);
+ printf(" H5T_NATIVE_%s_ALIGN_g = %lu;\n",
+ d[i].varname, (unsigned long)(d[i].align));
/* Variables for alignment of compound datatype */
if(!HDstrcmp(d[i].varname, "SCHAR") || !HDstrcmp(d[i].varname, "SHORT") ||
@@ -809,69 +819,69 @@ done:\n\
/* Print the ALIGNMENT and signal-handling status as comments */
printf("\n"
- "/****************************************/\n"
- "/* ALIGNMENT and signal-handling status */\n"
- "/****************************************/\n");
+ "/****************************************/\n"
+ "/* ALIGNMENT and signal-handling status */\n"
+ "/****************************************/\n");
if (align_status_g & STA_NoALIGNMENT)
- printf("/* ALIGNAMENT test is not available */\n");
+ printf("/* ALIGNAMENT test is not available */\n");
if (align_status_g & STA_NoHandlerVerify)
- printf("/* Signal handlers verify test is not available */\n");
+ printf("/* Signal handlers verify test is not available */\n");
/* The following is available in H5pubconf.h. Printing them here for */
/* convenience. */
#ifdef H5_HAVE_SIGNAL
- printf("/* Signal() support: yes */\n");
+ printf("/* Signal() support: yes */\n");
#else
- printf("/* Signal() support: no */\n");
+ printf("/* Signal() support: no */\n");
#endif
#ifdef H5_HAVE_SETJMP
- printf("/* setjmp() support: yes */\n");
+ printf("/* setjmp() support: yes */\n");
#else
- printf("/* setjmp() support: no */\n");
+ printf("/* setjmp() support: no */\n");
#endif
#ifdef H5_HAVE_LONGJMP
- printf("/* longjmp() support: yes */\n");
+ printf("/* longjmp() support: yes */\n");
#else
- printf("/* longjmp() support: no */\n");
+ printf("/* longjmp() support: no */\n");
#endif
#ifdef H5_HAVE_SIGSETJMP
- printf("/* sigsetjmp() support: yes */\n");
+ printf("/* sigsetjmp() support: yes */\n");
#else
- printf("/* sigsetjmp() support: no */\n");
+ printf("/* sigsetjmp() support: no */\n");
#endif
#ifdef H5_HAVE_SIGLONGJMP
- printf("/* siglongjmp() support: yes */\n");
+ printf("/* siglongjmp() support: yes */\n");
#else
- printf("/* siglongjmp() support: no */\n");
+ printf("/* siglongjmp() support: no */\n");
#endif
#ifdef H5_HAVE_SIGPROCMASK
- printf("/* sigprocmask() support: yes */\n");
+ printf("/* sigprocmask() support: yes */\n");
#else
- printf("/* sigprocmask() support: no */\n");
+ printf("/* sigprocmask() support: no */\n");
#endif
/* Print the statics of signal handlers called for debugging */
printf("\n"
- "/******************************/\n"
- "/* signal handlers statistics */\n"
- "/******************************/\n");
+ "/******************************/\n"
+ "/* signal handlers statistics */\n"
+ "/******************************/\n");
printf("/* signal_handlers tested: %d times */\n", signal_handler_tested_g);
printf("/* sigbus_handler called: %d times */\n", sigbus_handler_called_g);
printf("/* sigsegv_handler called: %d times */\n", sigsegv_handler_called_g);
printf("/* sigill_handler called: %d times */\n", sigill_handler_called_g);
} /* end print_results() */
-
+
/*-------------------------------------------------------------------------
- * Function: iprint
+ * Function: iprint
*
- * Purpose: Prints information about the fields of a floating point
- * format.
+ * Purpose: Prints information about the fields of a floating point
+ * format.
*
- * Return: void
+ * Return: void
*
- * Programmer: Robb Matzke
- * matzke@llnl.gov
- * Jun 13, 1996
+ * Programmer: Robb Matzke
+ * matzke@llnl.gov
+ * Jun 13, 1996
*
* Modifications:
*
@@ -945,22 +955,22 @@ iprint(detected_t *d)
}
-
+
/*-------------------------------------------------------------------------
- * Function: byte_cmp
+ * Function: byte_cmp
*
- * Purpose: Compares two chunks of memory A and B and returns the
- * byte index into those arrays of the first byte that
- * differs between A and B. Ignores differences where the
+ * Purpose: Compares two chunks of memory A and B and returns the
+ * byte index into those arrays of the first byte that
+ * differs between A and B. Ignores differences where the
* corresponding bit in pad_mask is set to 0.
*
- * Return: Success: Index of differing byte.
+ * Return: Success: Index of differing byte.
*
- * Failure: -1 if all bytes are the same.
+ * Failure: -1 if all bytes are the same.
*
- * Programmer: Robb Matzke
- * matzke@llnl.gov
- * Jun 12, 1996
+ * Programmer: Robb Matzke
+ * matzke@llnl.gov
+ * Jun 12, 1996
*
* Modifications:
*
@@ -980,17 +990,17 @@ byte_cmp(int n, const void *_a, const void *_b, const unsigned char *pad_mask)
return -1;
}
-
+
/*-------------------------------------------------------------------------
- * Function: bit_cmp
+ * Function: bit_cmp
*
- * Purpose: Compares two bit vectors and returns the index for the
- * first bit that differs between the two vectors. The
- * size of the vector is NBYTES. PERM is a mapping from
- * actual order to little endian. Ignores differences where
+ * Purpose: Compares two bit vectors and returns the index for the
+ * first bit that differs between the two vectors. The
+ * size of the vector is NBYTES. PERM is a mapping from
+ * actual order to little endian. Ignores differences where
* the corresponding bit in pad_mask is set to 0.
*
- * Return: Index of first differing bit.
+ * Return: Index of first differing bit.
*
*-------------------------------------------------------------------------
*/
@@ -1021,23 +1031,23 @@ bit_cmp(unsigned int nbytes, int *perm, void *_a, void *_b,
return 0;
}
-
+
/*-------------------------------------------------------------------------
- * Function: fix_order
+ * Function: fix_order
*
- * Purpose: Given an array PERM with elements FIRST through LAST
- * initialized with zero origin byte numbers, this function
- * creates a permutation vector that maps the actual order
- * of a floating point number to little-endian.
+ * Purpose: Given an array PERM with elements FIRST through LAST
+ * initialized with zero origin byte numbers, this function
+ * creates a permutation vector that maps the actual order
+ * of a floating point number to little-endian.
*
- * This function assumes that the mantissa byte ordering
- * implies the total ordering.
+ * This function assumes that the mantissa byte ordering
+ * implies the total ordering.
*
- * Return: void
+ * Return: void
*
- * Programmer: Robb Matzke
- * matzke@llnl.gov
- * Jun 13, 1996
+ * Programmer: Robb Matzke
+ * matzke@llnl.gov
+ * Jun 13, 1996
*
* Modifications:
*
@@ -1046,81 +1056,81 @@ bit_cmp(unsigned int nbytes, int *perm, void *_a, void *_b,
static void
fix_order(int n, int last, int *perm, const char **mesg)
{
- int i;
+ int i;
if (last > 1) {
- /*
- * We have at least three points to consider.
- */
- if (perm[last] < perm[last - 1] && perm[last - 1] < perm[last - 2]) {
- /*
- * Little endian.
- */
- if (mesg) *mesg = "Little-endian";
- for (i = 0; i < n; i++) perm[i] = i;
-
- } else if (perm[last] > perm[last-1] && perm[last-1] > perm[last-2]) {
- /*
- * Big endian.
- */
- if (mesg) *mesg = "Big-endian";
- for (i = 0; i < n; i++) perm[i] = (n - 1) - i;
-
- } else {
- /*
- * Bi-endian machines like VAX.
+ /*
+ * We have at least three points to consider.
+ */
+ if (perm[last] < perm[last - 1] && perm[last - 1] < perm[last - 2]) {
+ /*
+ * Little endian.
+ */
+ if (mesg) *mesg = "Little-endian";
+ for (i = 0; i < n; i++) perm[i] = i;
+
+ } else if (perm[last] > perm[last-1] && perm[last-1] > perm[last-2]) {
+ /*
+ * Big endian.
+ */
+ if (mesg) *mesg = "Big-endian";
+ for (i = 0; i < n; i++) perm[i] = (n - 1) - i;
+
+ } else {
+ /*
+ * Bi-endian machines like VAX.
* (NOTE: This is not an actual determination of the VAX-endianess.
* It could have some other endianess and fall into this
* case - JKM & QAK)
- */
- HDassert(0 == n % 2);
- if (mesg) *mesg = "VAX";
- for (i = 0; i < n; i += 2) {
- perm[i] = (n - 2) - i;
- perm[i + 1] = (n - 1) - i;
- }
- }
+ */
+ HDassert(0 == n % 2);
+ if (mesg) *mesg = "VAX";
+ for (i = 0; i < n; i += 2) {
+ perm[i] = (n - 2) - i;
+ perm[i + 1] = (n - 1) - i;
+ }
+ }
} else {
- fprintf(stderr,
- "Failed to detect byte order of %d-byte floating point.\n", n);
- HDexit(1);
+ fprintf(stderr,
+ "Failed to detect byte order of %d-byte floating point.\n", n);
+ HDexit(1);
}
}
-
+
/*-------------------------------------------------------------------------
- * Function: imp_bit
+ * Function: imp_bit
*
- * Purpose: Looks for an implicit bit in the mantissa. The value
- * of _A should be 1.0 and the value of _B should be 0.5.
- * Some floating-point formats discard the most significant
- * bit of the mantissa after normalizing since it will always
- * be a one (except for 0.0). If this is true for the native
- * floating point values stored in _A and _B then the function
- * returns non-zero.
+ * Purpose: Looks for an implicit bit in the mantissa. The value
+ * of _A should be 1.0 and the value of _B should be 0.5.
+ * Some floating-point formats discard the most significant
+ * bit of the mantissa after normalizing since it will always
+ * be a one (except for 0.0). If this is true for the native
+ * floating point values stored in _A and _B then the function
+ * returns non-zero.
*
- * This function assumes that the exponent occupies higher
- * order bits than the mantissa and that the most significant
- * bit of the mantissa is next to the least signficant bit
- * of the exponent.
+ * This function assumes that the exponent occupies higher
+ * order bits than the mantissa and that the most significant
+ * bit of the mantissa is next to the least signficant bit
+ * of the exponent.
*
*
- * Return: Success: Non-zero if the most significant bit
- * of the mantissa is discarded (ie, the
- * mantissa has an implicit `one' as the
- * most significant bit). Otherwise,
- * returns zero.
+ * Return: Success: Non-zero if the most significant bit
+ * of the mantissa is discarded (ie, the
+ * mantissa has an implicit `one' as the
+ * most significant bit). Otherwise,
+ * returns zero.
*
- * Failure: exit(1)
+ * Failure: exit(1)
*
- * Programmer: Robb Matzke
- * matzke@llnl.gov
- * Jun 13, 1996
+ * Programmer: Robb Matzke
+ * matzke@llnl.gov
+ * Jun 13, 1996
*
* Modifications:
*
- * Robb Matzke, 6 Nov 1996
- * Fixed a bug that occurs with non-implicit architectures.
+ * Robb Matzke, 6 Nov 1996
+ * Fixed a bug that occurs with non-implicit architectures.
*
*-------------------------------------------------------------------------
*/
@@ -1150,26 +1160,26 @@ imp_bit(unsigned int n, int *perm, void *_a, void *_b, const unsigned char *pad_
return (a[perm[major]] >> minor) & 0x01 ? 0 : 1;
}
-
+
/*-------------------------------------------------------------------------
- * Function: find_bias
+ * Function: find_bias
*
- * Purpose: Determines the bias of the exponent. This function should
- * be called with _A having a value of `1'.
+ * Purpose: Determines the bias of the exponent. This function should
+ * be called with _A having a value of `1'.
*
- * Return: Success: The exponent bias.
+ * Return: Success: The exponent bias.
*
- * Failure:
+ * Failure:
*
- * Programmer: Robb Matzke
- * matzke@llnl.gov
- * Jun 13, 1996
+ * Programmer: Robb Matzke
+ * matzke@llnl.gov
+ * Jun 13, 1996
*
* Modifications:
*
- * Robb Matzke, 6 Nov 1996
- * Fixed a bug with non-implicit architectures returning the
- * wrong exponent bias.
+ * Robb Matzke, 6 Nov 1996
+ * Fixed a bug with non-implicit architectures returning the
+ * wrong exponent bias.
*
*-------------------------------------------------------------------------
*/
@@ -1193,17 +1203,17 @@ find_bias(unsigned int epos, unsigned int esize, int *perm, void *_a)
return bias;
}
-
+
/*-------------------------------------------------------------------------
- * Function: print_header
+ * Function: print_header
*
- * Purpose: Prints the C file header for the generated file.
+ * Purpose: Prints the C file header for the generated file.
*
- * Return: void
+ * Return: void
*
- * Programmer: Robb Matzke
- * matzke@llnl.gov
- * Mar 12 1997
+ * Programmer: Robb Matzke
+ * matzke@llnl.gov
+ * Mar 12 1997
*
* Modifications:
*
@@ -1213,22 +1223,22 @@ static void
print_header(void)
{
- time_t now = HDtime(NULL);
- struct tm *tm = HDlocaltime(&now);
- char real_name[30];
- char host_name[256];
- int i;
- const char *s;
+ time_t now = HDtime(NULL);
+ struct tm *tm = HDlocaltime(&now);
+ char real_name[30];
+ char host_name[256];
+ int i;
+ const char *s;
#ifdef H5_HAVE_GETPWUID
- struct passwd *pwd = NULL;
+ struct passwd *pwd = NULL;
#else
- int pwd = 1;
+ int pwd = 1;
#endif
- static const char *month_name[] =
+ static const char *month_name[] =
{
- "Jan", "Feb", "Mar", "Apr", "May", "Jun",
- "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"};
- static const char *purpose = "\
+ "Jan", "Feb", "Mar", "Apr", "May", "Jun",
+ "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"};
+ static const char *purpose = "\
This machine-generated source code contains\n\
information about the various integer and\n\
floating point numeric formats found on this\n\
@@ -1240,7 +1250,7 @@ Each of the numeric formats listed below are\n\
printed from most significant bit to least\n\
significant bit even though the actual bytes\n\
might be stored in a different order in\n\
-memory. The integers above each binary byte\n\
+memory. The integers above each binary byte\n\
indicate the relative order of the bytes in\n\
memory; little-endian machines have\n\
decreasing numbers while big-endian machines\n\
@@ -1251,8 +1261,8 @@ letters with `S' for the mantissa sign bit,\n\
`M' for the mantissa magnitude, and `E' for\n\
the exponent. The exponent has an associated\n\
bias which can be subtracted to find the\n\
-true exponent. The radix point is assumed\n\
-to be before the first `M' bit. Any bit\n\
+true exponent. The radix point is assumed\n\
+to be before the first `M' bit. Any bit\n\
of a floating-point value not falling into one\n\
of these categories is printed as a question\n\
mark. Bits of integer types are printed as\n\
@@ -1271,20 +1281,20 @@ bit.\n";
*/
#ifdef H5_HAVE_GETPWUID
{
- size_t n;
- char *comma;
- if ((pwd = HDgetpwuid(HDgetuid()))) {
- if ((comma = HDstrchr(pwd->pw_gecos, ','))) {
- n = MIN(sizeof(real_name)-1, (unsigned)(comma-pwd->pw_gecos));
- HDstrncpy(real_name, pwd->pw_gecos, n);
- real_name[n] = '\0';
- } else {
- HDstrncpy(real_name, pwd->pw_gecos, sizeof(real_name));
- real_name[sizeof(real_name) - 1] = '\0';
- }
- } else {
- real_name[0] = '\0';
- }
+ size_t n;
+ char *comma;
+ if ((pwd = HDgetpwuid(HDgetuid()))) {
+ if ((comma = HDstrchr(pwd->pw_gecos, ','))) {
+ n = MIN(sizeof(real_name)-1, (unsigned)(comma-pwd->pw_gecos));
+ HDstrncpy(real_name, pwd->pw_gecos, n);
+ real_name[n] = '\0';
+ } else {
+ HDstrncpy(real_name, pwd->pw_gecos, sizeof(real_name));
+ real_name[sizeof(real_name) - 1] = '\0';
+ }
+ } else {
+ real_name[0] = '\0';
+ }
}
#else
real_name[0] = '\0';
@@ -1295,7 +1305,7 @@ bit.\n";
*/
#ifdef H5_HAVE_GETHOSTNAME
if (HDgethostname(host_name, sizeof(host_name)) < 0) {
- host_name[0] = '\0';
+ host_name[0] = '\0';
}
#else
host_name[0] = '\0';
@@ -1305,24 +1315,24 @@ bit.\n";
* The file header: warning, copyright notice, build information.
*/
printf("/* Generated automatically by H5detect -- do not edit */\n\n\n");
- HDputs(FileHeader); /*the copyright notice--see top of this file */
+ HDputs(FileHeader); /*the copyright notice--see top of this file */
printf(" *\n * Created:\t\t%s %2d, %4d\n",
- month_name[tm->tm_mon], tm->tm_mday, 1900 + tm->tm_year);
+ month_name[tm->tm_mon], tm->tm_mday, 1900 + tm->tm_year);
if (pwd || real_name[0] || host_name[0]) {
- printf(" *\t\t\t");
- if (real_name[0]) printf("%s <", real_name);
+ printf(" *\t\t\t");
+ if (real_name[0]) printf("%s <", real_name);
#ifdef H5_HAVE_GETPWUID
- if (pwd) HDfputs(pwd->pw_name, stdout);
+ if (pwd) HDfputs(pwd->pw_name, stdout);
#endif
- if (host_name[0]) printf("@%s", host_name);
- if (real_name[0]) printf(">");
- HDputchar('\n');
+ if (host_name[0]) printf("@%s", host_name);
+ if (real_name[0]) printf(">");
+ HDputchar('\n');
}
printf(" *\n * Purpose:\t\t");
for (s = purpose; *s; s++) {
- HDputchar(*s);
- if ('\n' == *s && s[1]) printf(" *\t\t\t");
+ HDputchar(*s);
+ if ('\n' == *s && s[1]) printf(" *\t\t\t");
}
printf(" *\n * Modifications:\n *\n");
@@ -1335,84 +1345,84 @@ bit.\n";
}
-
+
/*-------------------------------------------------------------------------
- * Function: detect_C89_integers
+ * Function: detect_C89_integers
*
- * Purpose: Detect C89 integer types
+ * Purpose: Detect C89 integer types
*
- * Return: void
+ * Return: void
*
- * Programmer: Albert Cheng
- * 2004/05/20
+ * Programmer: Albert Cheng
+ * 2004/05/20
*
* Modifications:
*
*-------------------------------------------------------------------------
*/
static void
-detect_C89_integers(void)
+detect_C89_integers(void) HDF_NO_UBSAN
{
- DETECT_BYTE(signed char, SCHAR, d_g[nd_g]); nd_g++;
- DETECT_BYTE(unsigned char, UCHAR, d_g[nd_g]); nd_g++;
- DETECT_I(short, SHORT, d_g[nd_g]); nd_g++;
- DETECT_I(unsigned short, USHORT, d_g[nd_g]); nd_g++;
- DETECT_I(int, INT, d_g[nd_g]); nd_g++;
- DETECT_I(unsigned int, UINT, d_g[nd_g]); nd_g++;
- DETECT_I(long, LONG, d_g[nd_g]); nd_g++;
- DETECT_I(unsigned long, ULONG, d_g[nd_g]); nd_g++;
+ DETECT_BYTE(signed char, SCHAR, d_g[nd_g]); nd_g++;
+ DETECT_BYTE(unsigned char, UCHAR, d_g[nd_g]); nd_g++;
+ DETECT_I(short, SHORT, d_g[nd_g]); nd_g++;
+ DETECT_I(unsigned short, USHORT, d_g[nd_g]); nd_g++;
+ DETECT_I(int, INT, d_g[nd_g]); nd_g++;
+ DETECT_I(unsigned int, UINT, d_g[nd_g]); nd_g++;
+ DETECT_I(long, LONG, d_g[nd_g]); nd_g++;
+ DETECT_I(unsigned long, ULONG, d_g[nd_g]); nd_g++;
}
-
+
/*-------------------------------------------------------------------------
- * Function: detect_C89_floats
+ * Function: detect_C89_floats
*
- * Purpose: Detect C89 floating point types
+ * Purpose: Detect C89 floating point types
*
- * Return: void
+ * Return: void
*
- * Programmer: Albert Cheng
- * 2004/05/20
+ * Programmer: Albert Cheng
+ * 2004/05/20
*
* Modifications:
*
*-------------------------------------------------------------------------
*/
static void
-detect_C89_floats(void)
+detect_C89_floats(void) HDF_NO_UBSAN
{
DETECT_F(float, FLOAT, d_g[nd_g]); nd_g++;
DETECT_F(double, DOUBLE, d_g[nd_g]); nd_g++;
}
-
+
/*-------------------------------------------------------------------------
- * Function: detect_C99_integers8
+ * Function: detect_C99_integers8
*
- * Purpose: Detect C99 8 bit integer types
+ * Purpose: Detect C99 8 bit integer types
*
- * Return: void
+ * Return: void
*
- * Programmer: Albert Cheng
- * 2004/05/20
+ * Programmer: Albert Cheng
+ * 2004/05/20
*
* Modifications:
*
*-------------------------------------------------------------------------
*/
static void
-detect_C99_integers8(void)
+detect_C99_integers8(void) HDF_NO_UBSAN
{
#if H5_SIZEOF_INT8_T>0
#if H5_SIZEOF_INT8_T==1
DETECT_BYTE(int8_t, INT8, d_g[nd_g]); nd_g++;
#else
- DETECT_I(int8_t, INT8, d_g[nd_g]); nd_g++;
+ DETECT_I(int8_t, INT8, d_g[nd_g]); nd_g++;
#endif
#endif
#if H5_SIZEOF_UINT8_T>0
#if H5_SIZEOF_UINT8_T==1
- DETECT_BYTE(uint8_t, UINT8, d_g[nd_g]); nd_g++;
+ DETECT_BYTE(uint8_t, UINT8, d_g[nd_g]); nd_g++;
#else
DETECT_I(uint8_t, UINT8, d_g[nd_g]); nd_g++;
#endif
@@ -1421,147 +1431,147 @@ detect_C99_integers8(void)
#if H5_SIZEOF_INT_LEAST8_T==1
DETECT_BYTE(int_least8_t, INT_LEAST8, d_g[nd_g]); nd_g++;
#else
- DETECT_I(int_least8_t, INT_LEAST8, d_g[nd_g]); nd_g++;
+ DETECT_I(int_least8_t, INT_LEAST8, d_g[nd_g]); nd_g++;
#endif
#endif
#if H5_SIZEOF_UINT_LEAST8_T>0
#if H5_SIZEOF_UINT_LEAST8_T==1
DETECT_BYTE(uint_least8_t, UINT_LEAST8, d_g[nd_g]); nd_g++;
#else
- DETECT_I(uint_least8_t, UINT_LEAST8, d_g[nd_g]); nd_g++;
+ DETECT_I(uint_least8_t, UINT_LEAST8, d_g[nd_g]); nd_g++;
#endif
#endif
#if H5_SIZEOF_INT_FAST8_T>0
#if H5_SIZEOF_INT_FAST8_T==1
DETECT_BYTE(int_fast8_t, INT_FAST8, d_g[nd_g]); nd_g++;
#else
- DETECT_I(int_fast8_t, INT_FAST8, d_g[nd_g]); nd_g++;
+ DETECT_I(int_fast8_t, INT_FAST8, d_g[nd_g]); nd_g++;
#endif
#endif
#if H5_SIZEOF_UINT_FAST8_T>0
#if H5_SIZEOF_UINT_FAST8_T==1
- DETECT_BYTE(uint_fast8_t, UINT_FAST8, d_g[nd_g]); nd_g++;
+ DETECT_BYTE(uint_fast8_t, UINT_FAST8, d_g[nd_g]); nd_g++;
#else
DETECT_I(uint_fast8_t, UINT_FAST8, d_g[nd_g]); nd_g++;
#endif
#endif
}
-
+
/*-------------------------------------------------------------------------
- * Function: detect_C99_integers16
+ * Function: detect_C99_integers16
*
- * Purpose: Detect C99 16 bit integer types
+ * Purpose: Detect C99 16 bit integer types
*
- * Return: void
+ * Return: void
*
- * Programmer: Albert Cheng
- * 2004/05/20
+ * Programmer: Albert Cheng
+ * 2004/05/20
*
* Modifications:
*
*-------------------------------------------------------------------------
*/
static void
-detect_C99_integers16(void)
+detect_C99_integers16(void) HDF_NO_UBSAN
{
#if H5_SIZEOF_INT16_T>0
- DETECT_I(int16_t, INT16, d_g[nd_g]); nd_g++;
+ DETECT_I(int16_t, INT16, d_g[nd_g]); nd_g++;
#endif
#if H5_SIZEOF_UINT16_T>0
- DETECT_I(uint16_t, UINT16, d_g[nd_g]); nd_g++;
+ DETECT_I(uint16_t, UINT16, d_g[nd_g]); nd_g++;
#endif
#if H5_SIZEOF_INT_LEAST16_T>0
- DETECT_I(int_least16_t, INT_LEAST16, d_g[nd_g]); nd_g++;
+ DETECT_I(int_least16_t, INT_LEAST16, d_g[nd_g]); nd_g++;
#endif
#if H5_SIZEOF_UINT_LEAST16_T>0
- DETECT_I(uint_least16_t, UINT_LEAST16, d_g[nd_g]); nd_g++;
+ DETECT_I(uint_least16_t, UINT_LEAST16, d_g[nd_g]); nd_g++;
#endif
#if H5_SIZEOF_INT_FAST16_T>0
- DETECT_I(int_fast16_t, INT_FAST16, d_g[nd_g]); nd_g++;
+ DETECT_I(int_fast16_t, INT_FAST16, d_g[nd_g]); nd_g++;
#endif
#if H5_SIZEOF_UINT_FAST16_T>0
- DETECT_I(uint_fast16_t, UINT_FAST16, d_g[nd_g]); nd_g++;
+ DETECT_I(uint_fast16_t, UINT_FAST16, d_g[nd_g]); nd_g++;
#endif
}
-
+
/*-------------------------------------------------------------------------
- * Function: detect_C99_integers32
+ * Function: detect_C99_integers32
*
- * Purpose: Detect C99 32 bit integer types
+ * Purpose: Detect C99 32 bit integer types
*
- * Return: void
+ * Return: void
*
- * Programmer: Albert Cheng
- * 2004/05/20
+ * Programmer: Albert Cheng
+ * 2004/05/20
*
* Modifications:
*
*-------------------------------------------------------------------------
*/
static void
-detect_C99_integers32(void)
+detect_C99_integers32(void) HDF_NO_UBSAN
{
#if H5_SIZEOF_INT32_T>0
- DETECT_I(int32_t, INT32, d_g[nd_g]); nd_g++;
+ DETECT_I(int32_t, INT32, d_g[nd_g]); nd_g++;
#endif
#if H5_SIZEOF_UINT32_T>0
- DETECT_I(uint32_t, UINT32, d_g[nd_g]); nd_g++;
+ DETECT_I(uint32_t, UINT32, d_g[nd_g]); nd_g++;
#endif
#if H5_SIZEOF_INT_LEAST32_T>0
- DETECT_I(int_least32_t, INT_LEAST32, d_g[nd_g]); nd_g++;
+ DETECT_I(int_least32_t, INT_LEAST32, d_g[nd_g]); nd_g++;
#endif
#if H5_SIZEOF_UINT_LEAST32_T>0
- DETECT_I(uint_least32_t, UINT_LEAST32, d_g[nd_g]); nd_g++;
+ DETECT_I(uint_least32_t, UINT_LEAST32, d_g[nd_g]); nd_g++;
#endif
#if H5_SIZEOF_INT_FAST32_T>0
- DETECT_I(int_fast32_t, INT_FAST32, d_g[nd_g]); nd_g++;
+ DETECT_I(int_fast32_t, INT_FAST32, d_g[nd_g]); nd_g++;
#endif
#if H5_SIZEOF_UINT_FAST32_T>0
- DETECT_I(uint_fast32_t, UINT_FAST32, d_g[nd_g]); nd_g++;
+ DETECT_I(uint_fast32_t, UINT_FAST32, d_g[nd_g]); nd_g++;
#endif
}
-
+
/*-------------------------------------------------------------------------
- * Function: detect_C99_integers64
+ * Function: detect_C99_integers64
*
- * Purpose: Detect C99 64 bit integer types
+ * Purpose: Detect C99 64 bit integer types
*
- * Return: void
+ * Return: void
*
- * Programmer: Albert Cheng
- * 2004/05/20
+ * Programmer: Albert Cheng
+ * 2004/05/20
*
* Modifications:
*
*-------------------------------------------------------------------------
*/
static void
-detect_C99_integers64(void)
+detect_C99_integers64(void) HDF_NO_UBSAN
{
#if H5_SIZEOF_INT64_T>0
- DETECT_I(int64_t, INT64, d_g[nd_g]); nd_g++;
+ DETECT_I(int64_t, INT64, d_g[nd_g]); nd_g++;
#endif
#if H5_SIZEOF_UINT64_T>0
- DETECT_I(uint64_t, UINT64, d_g[nd_g]); nd_g++;
+ DETECT_I(uint64_t, UINT64, d_g[nd_g]); nd_g++;
#endif
#if H5_SIZEOF_INT_LEAST64_T>0
- DETECT_I(int_least64_t, INT_LEAST64, d_g[nd_g]); nd_g++;
+ DETECT_I(int_least64_t, INT_LEAST64, d_g[nd_g]); nd_g++;
#endif
#if H5_SIZEOF_UINT_LEAST64_T>0
- DETECT_I(uint_least64_t, UINT_LEAST64, d_g[nd_g]); nd_g++;
+ DETECT_I(uint_least64_t, UINT_LEAST64, d_g[nd_g]); nd_g++;
#endif
#if H5_SIZEOF_INT_FAST64_T>0
- DETECT_I(int_fast64_t, INT_FAST64, d_g[nd_g]); nd_g++;
+ DETECT_I(int_fast64_t, INT_FAST64, d_g[nd_g]); nd_g++;
#endif
#if H5_SIZEOF_UINT_FAST64_T>0
- DETECT_I(uint_fast64_t, UINT_FAST64, d_g[nd_g]); nd_g++;
+ DETECT_I(uint_fast64_t, UINT_FAST64, d_g[nd_g]); nd_g++;
#endif
#if H5_SIZEOF_LONG_LONG>0
- DETECT_I(long long, LLONG, d_g[nd_g]); nd_g++;
+ DETECT_I(long long, LLONG, d_g[nd_g]); nd_g++;
DETECT_I(unsigned long long, ULLONG, d_g[nd_g]); nd_g++;
#else
/*
@@ -1569,28 +1579,28 @@ detect_C99_integers64(void)
* so we'll just make H5T_NATIVE_LLONG the same as H5T_NATIVE_LONG since
* `long long' is probably equivalent to `long' here anyway.
*/
- DETECT_I(long, LLONG, d_g[nd_g]); nd_g++;
- DETECT_I(unsigned long, ULLONG, d_g[nd_g]); nd_g++;
+ DETECT_I(long, LLONG, d_g[nd_g]); nd_g++;
+ DETECT_I(unsigned long, ULLONG, d_g[nd_g]); nd_g++;
#endif
}
-
+
/*-------------------------------------------------------------------------
- * Function: detect_C99_integers
+ * Function: detect_C99_integers
*
- * Purpose: Detect C99 integer types
+ * Purpose: Detect C99 integer types
*
- * Return: void
+ * Return: void
*
- * Programmer: Albert Cheng
- * 2004/05/20
+ * Programmer: Albert Cheng
+ * 2004/05/20
*
* Modifications:
*
*-------------------------------------------------------------------------
*/
static void
-detect_C99_integers(void)
+detect_C99_integers(void) HDF_NO_UBSAN
{
/* break it down to more subroutines so that each module subroutine */
/* is smaller and takes less time to compile with optimization on. */
@@ -1600,23 +1610,23 @@ detect_C99_integers(void)
detect_C99_integers64();
}
-
+
/*-------------------------------------------------------------------------
- * Function: detect_C99_floats
+ * Function: detect_C99_floats
*
- * Purpose: Detect C99 floating point types
+ * Purpose: Detect C99 floating point types
*
- * Return: void
+ * Return: void
*
- * Programmer: Albert Cheng
- * 2004/05/20
+ * Programmer: Albert Cheng
+ * 2004/05/20
*
* Modifications:
*
*-------------------------------------------------------------------------
*/
static void
-detect_C99_floats(void)
+detect_C99_floats(void) HDF_NO_UBSAN
{
#if H5_SIZEOF_DOUBLE == H5_SIZEOF_LONG_DOUBLE
/*
@@ -1625,29 +1635,29 @@ detect_C99_floats(void)
* some systems and `long double' is probably the same as `double' here
* anyway.
*/
- DETECT_F(double, LDOUBLE, d_g[nd_g]); nd_g++;
+ DETECT_F(double, LDOUBLE, d_g[nd_g]); nd_g++;
#elif H5_SIZEOF_LONG_DOUBLE !=0
- DETECT_F(long double, LDOUBLE, d_g[nd_g]); nd_g++;
+ DETECT_F(long double, LDOUBLE, d_g[nd_g]); nd_g++;
#endif
}
-
+
/*-------------------------------------------------------------------------
- * Function: detect_alignments
+ * Function: detect_alignments
*
- * Purpose: Detect structure alignments
+ * Purpose: Detect structure alignments
*
- * Return: void
+ * Return: void
*
- * Programmer: Albert Cheng
- * 2004/05/20
+ * Programmer: Albert Cheng
+ * 2004/05/20
*
* Modifications:
*
*-------------------------------------------------------------------------
*/
static void
-detect_alignments(void)
+detect_alignments(void) HDF_NO_UBSAN
{
/* Detect structure alignment for pointers, hvl_t, hobj_ref_t, hdset_reg_ref_t */
DETECT_M(void *, POINTER, m_g[na_g]); na_g++;
@@ -1656,7 +1666,7 @@ detect_alignments(void)
DETECT_M(hdset_reg_ref_t, HDSETREGREF, m_g[na_g]); na_g++;
}
-
+
#if defined(H5SETJMP) && defined(H5_HAVE_SIGNAL)
/* Verify the signal handler for signal signum works correctly multiple times.
* One possible cause of failure is that the signal handling is blocked or
@@ -1664,64 +1674,70 @@ detect_alignments(void)
* Return 0 for success, -1 for failure.
*/
static int verify_signal_handlers(int signum, void (*handler)(int))
-{
- void (*save_handler)(int) = HDsignal(signum, handler);
+{
+#if defined(__has_feature)
+#if __has_feature(address_sanitizer) || __has_feature(thread_sanitizer)
+ /* Under the address and thread sanitizers, don't raise any signals. */
+ return 0;
+#endif
+#endif
+ void (*save_handler)(int) = HDsignal(signum, handler);
volatile int i, val;
int ntries=5;
volatile int nfailures=0;
volatile int nsuccesses=0;
-
- for (i=0;i<ntries; i++){
- val=H5SETJMP(jbuf_g);
- if (val==0)
- {
- /* send self the signal to trigger the handler */
- signal_handler_tested_g++;
- HDraise(signum);
- /* Should not reach here. Record error. */
- nfailures++;
- }else{
- if (val==signum){
- /* return from signum handler. Record a sucess. */
- nsuccesses++;
- }else{
- fprintf(stderr, "Unknown return value (%d) from H5SETJMP",
- val);
- nfailures++;
- }
- }
- }
+
+ for (i=0;i<ntries; i++){
+ val=H5SETJMP(jbuf_g);
+ if (val==0)
+ {
+ /* send self the signal to trigger the handler */
+ signal_handler_tested_g++;
+ HDraise(signum);
+ /* Should not reach here. Record error. */
+ nfailures++;
+ }else{
+ if (val==signum){
+ /* return from signum handler. Record a sucess. */
+ nsuccesses++;
+ }else{
+ fprintf(stderr, "Unknown return value (%d) from H5SETJMP",
+ val);
+ nfailures++;
+ }
+ }
+ }
/* restore save handler, check results and report failures */
HDsignal(signum, save_handler);
if (nfailures>0 || nsuccesses != ntries){
- fprintf(stderr, "verify_signal_handlers for signal %d did %d tries. "
- "Found %d failures and %d successes\n",
- signum, ntries, nfailures, nsuccesses);
- return(-1);
+ fprintf(stderr, "verify_signal_handlers for signal %d did %d tries. "
+ "Found %d failures and %d successes\n",
+ signum, ntries, nfailures, nsuccesses);
+ return(-1);
}else{
- /* all succeeded */
- return(0);
+ /* all succeeded */
+ return(0);
}
-}
+}
#endif
-
+
/*-------------------------------------------------------------------------
- * Function: main
+ * Function: main
*
- * Purpose: Main entry point.
+ * Purpose: Main entry point.
*
- * Return: Success: exit(0)
+ * Return: Success: exit(0)
*
- * Failure: exit(1)
+ * Failure: exit(1)
*
- * Programmer: Robb Matzke
- * matzke@llnl.gov
- * Jun 12, 1996
+ * Programmer: Robb Matzke
+ * matzke@llnl.gov
+ * Jun 12, 1996
*
* Modifications:
- * Albert Cheng, 2004/05/20
- * Some compilers, e.g., Intel C v7.0, took a long time to compile
+ * Albert Cheng, 2004/05/20
+ * Some compilers, e.g., Intel C v7.0, took a long time to compile
* with optimization when a module routine contains many code lines.
* Divide up all those types detections macros into subroutines, both
* to avoid the compiler optimization error and cleaner codes.
@@ -1729,7 +1745,7 @@ static int verify_signal_handlers(int signum, void (*handler)(int))
*-------------------------------------------------------------------------
*/
int
-main(void)
+main(void) HDF_NO_UBSAN
{
#if defined(H5_HAVE_SETSYSINFO) && defined(SSI_NVPAIRS)
@@ -1738,12 +1754,12 @@ main(void)
* Make sure unaligned access generates SIGBUS and doesn't print warning
* messages so that we can detect alignment constraints on the DEC Alpha.
*/
- int nvpairs[2];
+ int nvpairs[2];
nvpairs[0] = SSIN_UACPROC;
nvpairs[1] = UAC_NOPRINT | UAC_SIGBUS;
if (setsysinfo(SSI_NVPAIRS, nvpairs, 1, 0, 0)<0) {
- fprintf(stderr, "H5detect: unable to turn off UAC handling: %s\n",
- HDstrerror(errno));
+ fprintf(stderr, "H5detect: unable to turn off UAC handling: %s\n",
+ HDstrerror(errno));
}
#endif
#endif
diff --git a/src/H5trace.c b/src/H5trace.c
index 7bc2724..32e05a7 100644
--- a/src/H5trace.c
+++ b/src/H5trace.c
@@ -174,26 +174,26 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
if(H5_debug_g.ttimes) {
char tmp[128];
- sprintf(tmp, "%.6f", event_time.etime-first_time.etime);
- fprintf(out, " %*s ", (int)HDstrlen(tmp), "");
+ HDsprintf(tmp, "%.6f", event_time.etime-first_time.etime);
+ HDfprintf(out, " %*s ", (int)HDstrlen(tmp), "");
} /* end if */
for(i = 0; i < current_depth; i++)
HDfputc('+', out);
- fprintf(out, "%*s%s = ", 2*current_depth, "", func);
+ HDfprintf(out, "%*s%s = ", 2*current_depth, "", func);
} /* end if */
else {
/* Continue current line with return value */
- fprintf(out, " = ");
+ HDfprintf(out, " = ");
} /* end else */
} /* end if */
else {
if(current_depth>last_call_depth)
HDfputs(" = <delayed>\n", out);
if(H5_debug_g.ttimes)
- fprintf(out, "@%.6f ", event_time.etime - first_time.etime);
+ HDfprintf(out, "@%.6f ", event_time.etime - first_time.etime);
for(i = 0; i < current_depth; i++)
HDfputc('+', out);
- fprintf(out, "%*s%s(", 2*current_depth, "", func);
+ HDfprintf(out, "%*s%s(", 2*current_depth, "", func);
} /* end else */
/* Clear array sizes */
@@ -235,7 +235,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
buf[MIN((int)sizeof(buf) - 1, n)] = '\0';
argname = buf;
} /* end if */
- fprintf(out, "%s%s=", argno?", ":"", argname);
+ HDfprintf(out, "%s%s=", argno?", ":"", argname);
} /* end if */
else
argname = "";
@@ -247,9 +247,9 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 'a':
if(ptr) {
if(vp)
- fprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%lx", (unsigned long)vp);
else
- fprintf(out, "NULL");
+ HDfprintf(out, "NULL");
} /* end if */
else {
haddr_t addr = va_arg(ap, haddr_t);
@@ -261,33 +261,33 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 'b':
if(ptr) {
if(vp)
- fprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%lx", (unsigned long)vp);
else
- fprintf(out, "NULL");
+ HDfprintf(out, "NULL");
} /* end if */
else {
/* Can't pass hbool_t to va_arg() */
hbool_t bool_var = (hbool_t)va_arg(ap, int);
if(TRUE == bool_var)
- fprintf(out, "TRUE");
+ HDfprintf(out, "TRUE");
else if(!bool_var)
- fprintf(out, "FALSE");
+ HDfprintf(out, "FALSE");
else
- fprintf(out, "TRUE(%u)", (unsigned)bool_var);
+ HDfprintf(out, "TRUE(%u)", (unsigned)bool_var);
}
break;
case 'd':
if(ptr) {
if(vp)
- fprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%lx", (unsigned long)vp);
else
- fprintf(out, "NULL");
+ HDfprintf(out, "NULL");
} /* end if */
else {
double dbl = va_arg(ap, double);
- fprintf(out, "%g", dbl);
+ HDfprintf(out, "%g", dbl);
} /* end else */
break;
@@ -296,36 +296,36 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 'a':
if(ptr) {
if(vp)
- fprintf (out, "0x%lx", (unsigned long)vp);
+ HDfprintf (out, "0x%lx", (unsigned long)vp);
else
- fprintf(out, "NULL");
+ HDfprintf(out, "NULL");
} /* end if */
else {
H5D_alloc_time_t alloc_time = (H5D_alloc_time_t)va_arg(ap, int);
switch(alloc_time) {
case H5D_ALLOC_TIME_ERROR:
- fprintf(out, "H5D_ALLOC_TIME_ERROR");
+ HDfprintf(out, "H5D_ALLOC_TIME_ERROR");
break;
case H5D_ALLOC_TIME_DEFAULT:
- fprintf(out, "H5D_ALLOC_TIME_DEFAULT");
+ HDfprintf(out, "H5D_ALLOC_TIME_DEFAULT");
break;
case H5D_ALLOC_TIME_EARLY:
- fprintf(out, "H5D_ALLOC_TIME_EARLY");
+ HDfprintf(out, "H5D_ALLOC_TIME_EARLY");
break;
case H5D_ALLOC_TIME_LATE:
- fprintf(out, "H5D_ALLOC_TIME_LATE");
+ HDfprintf(out, "H5D_ALLOC_TIME_LATE");
break;
case H5D_ALLOC_TIME_INCR:
- fprintf(out, "H5D_ALLOC_TIME_INCR");
+ HDfprintf(out, "H5D_ALLOC_TIME_INCR");
break;
default:
- fprintf(out, "%ld", (long)alloc_time);
+ HDfprintf(out, "%ld", (long)alloc_time);
break;
} /* end switch */
} /* end else */
@@ -334,24 +334,24 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 'c':
if(ptr) {
if(vp)
- fprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%lx", (unsigned long)vp);
else
- fprintf(out, "NULL");
+ HDfprintf(out, "NULL");
} /* end if */
else {
H5FD_mpio_collective_opt_t opt = (H5FD_mpio_collective_opt_t)va_arg(ap, int);
switch(opt) {
case H5FD_MPIO_COLLECTIVE_IO:
- fprintf(out, "H5FD_MPIO_COLLECTIVE_IO");
+ HDfprintf(out, "H5FD_MPIO_COLLECTIVE_IO");
break;
case H5FD_MPIO_INDIVIDUAL_IO:
- fprintf(out, "H5FD_MPIO_INDIVIDUAL_IO");
+ HDfprintf(out, "H5FD_MPIO_INDIVIDUAL_IO");
break;
default:
- fprintf(out, "%ld", (long)opt);
+ HDfprintf(out, "%ld", (long)opt);
break;
} /* end switch */
} /* end else */
@@ -360,32 +360,32 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 'f':
if(ptr) {
if(vp)
- fprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%lx", (unsigned long)vp);
else
- fprintf(out, "NULL");
+ HDfprintf(out, "NULL");
} /* end if */
else {
H5D_fill_time_t fill_time = (H5D_fill_time_t)va_arg(ap, int);
switch(fill_time) {
case H5D_FILL_TIME_ERROR:
- fprintf(out, "H5D_FILL_TIME_ERROR");
+ HDfprintf(out, "H5D_FILL_TIME_ERROR");
break;
case H5D_FILL_TIME_ALLOC:
- fprintf(out, "H5D_FILL_TIME_ALLOC");
+ HDfprintf(out, "H5D_FILL_TIME_ALLOC");
break;
case H5D_FILL_TIME_NEVER:
- fprintf(out, "H5D_FILL_TIME_NEVER");
+ HDfprintf(out, "H5D_FILL_TIME_NEVER");
break;
case H5D_FILL_TIME_IFSET:
- fprintf(out, "H5D_FILL_TIME_IFSET");
+ HDfprintf(out, "H5D_FILL_TIME_IFSET");
break;
default:
- fprintf(out, "%ld", (long)fill_time);
+ HDfprintf(out, "%ld", (long)fill_time);
break;
} /* end switch */
} /* end else */
@@ -394,32 +394,32 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 'F':
if(ptr) {
if(vp)
- fprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%lx", (unsigned long)vp);
else
- fprintf(out, "NULL");
+ HDfprintf(out, "NULL");
} /* end if */
else {
H5D_fill_value_t fill_value = (H5D_fill_value_t)va_arg(ap, int);
switch(fill_value) {
case H5D_FILL_VALUE_ERROR:
- fprintf(out, "H5D_FILL_VALUE_ERROR");
+ HDfprintf(out, "H5D_FILL_VALUE_ERROR");
break;
case H5D_FILL_VALUE_UNDEFINED:
- fprintf(out, "H5D_FILL_VALUE_UNDEFINED");
+ HDfprintf(out, "H5D_FILL_VALUE_UNDEFINED");
break;
case H5D_FILL_VALUE_DEFAULT:
- fprintf(out, "H5D_FILL_VALUE_DEFAULT");
+ HDfprintf(out, "H5D_FILL_VALUE_DEFAULT");
break;
case H5D_FILL_VALUE_USER_DEFINED:
- fprintf(out, "H5D_FILL_VALUE_USER_DEFINED");
+ HDfprintf(out, "H5D_FILL_VALUE_USER_DEFINED");
break;
default:
- fprintf(out, "%ld", (long)fill_value);
+ HDfprintf(out, "%ld", (long)fill_value);
break;
} /* end switch */
} /* end else */
@@ -428,28 +428,28 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 'h':
if(ptr) {
if(vp)
- fprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%lx", (unsigned long)vp);
else
- fprintf(out, "NULL");
+ HDfprintf(out, "NULL");
} /* end if */
else {
H5FD_mpio_chunk_opt_t opt = (H5FD_mpio_chunk_opt_t)va_arg(ap, int);
switch(opt) {
case H5FD_MPIO_CHUNK_DEFAULT:
- fprintf(out, "H5FD_MPIO_CHUNK_DEFAULT");
+ HDfprintf(out, "H5FD_MPIO_CHUNK_DEFAULT");
break;
case H5FD_MPIO_CHUNK_ONE_IO:
- fprintf(out, "H5FD_MPIO_CHUNK_ONE_IO");
+ HDfprintf(out, "H5FD_MPIO_CHUNK_ONE_IO");
break;
case H5FD_MPIO_CHUNK_MULTI_IO:
- fprintf(out, "H5FD_MPIO_CHUNK_MULTI_IO");
+ HDfprintf(out, "H5FD_MPIO_CHUNK_MULTI_IO");
break;
default:
- fprintf(out, "%ld", (long)opt);
+ HDfprintf(out, "%ld", (long)opt);
break;
} /* end switch */
} /* end else */
@@ -458,36 +458,36 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 'i':
if(ptr) {
if(vp)
- fprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%lx", (unsigned long)vp);
else
- fprintf(out, "NULL");
+ HDfprintf(out, "NULL");
} /* end if */
else {
H5D_mpio_actual_io_mode_t actual_io_mode = (H5D_mpio_actual_io_mode_t)va_arg(ap, int);
switch(actual_io_mode) {
case H5D_MPIO_NO_COLLECTIVE:
- fprintf(out, "H5D_MPIO_NO_COLLECTIVE");
+ HDfprintf(out, "H5D_MPIO_NO_COLLECTIVE");
break;
case H5D_MPIO_CHUNK_INDEPENDENT:
- fprintf(out, "H5D_MPIO_CHUNK_INDEPENDENT");
+ HDfprintf(out, "H5D_MPIO_CHUNK_INDEPENDENT");
break;
case H5D_MPIO_CHUNK_COLLECTIVE:
- fprintf(out, "H5D_MPIO_CHUNK_COLLECTIVE");
+ HDfprintf(out, "H5D_MPIO_CHUNK_COLLECTIVE");
break;
case H5D_MPIO_CHUNK_MIXED:
- fprintf(out, "H5D_MPIO_CHUNK_MIXED");
+ HDfprintf(out, "H5D_MPIO_CHUNK_MIXED");
break;
case H5D_MPIO_CONTIGUOUS_COLLECTIVE:
- fprintf(out, "H5D_MPIO_CONTIGUOUS_COLLECTIVE");
+ HDfprintf(out, "H5D_MPIO_CONTIGUOUS_COLLECTIVE");
break;
default:
- fprintf(out, "%ld", (long)actual_io_mode);
+ HDfprintf(out, "%ld", (long)actual_io_mode);
break;
} /* end switch */
} /* end else */
@@ -496,44 +496,44 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 'k':
if(ptr) {
if(vp)
- fprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%lx", (unsigned long)vp);
else
- fprintf(out, "NULL");
+ HDfprintf(out, "NULL");
} /* end if */
else {
H5D_chunk_index_t idx = (H5D_chunk_index_t)va_arg(ap, int);
switch(idx) {
case H5D_CHUNK_IDX_BTREE:
- fprintf(out, "H5D_CHUNK_IDX_BTREE");
+ HDfprintf(out, "H5D_CHUNK_IDX_BTREE");
break;
case H5D_CHUNK_IDX_NONE:
- fprintf(out, "H5D_CHUNK_IDX_NONE");
+ HDfprintf(out, "H5D_CHUNK_IDX_NONE");
break;
case H5D_CHUNK_IDX_FARRAY:
- fprintf(out, "H5D_CHUNK_IDX_FARRAY");
+ HDfprintf(out, "H5D_CHUNK_IDX_FARRAY");
break;
case H5D_CHUNK_IDX_EARRAY:
- fprintf(out, "H5D_CHUNK_IDX_EARRAY");
+ HDfprintf(out, "H5D_CHUNK_IDX_EARRAY");
break;
case H5D_CHUNK_IDX_BT2:
- fprintf(out, "H5D_CHUNK_IDX_BT2");
+ HDfprintf(out, "H5D_CHUNK_IDX_BT2");
break;
case H5D_CHUNK_IDX_SINGLE:
- fprintf(out, "H5D_CHUNK_IDX_SINGLE");
+ HDfprintf(out, "H5D_CHUNK_IDX_SINGLE");
break;
case H5D_CHUNK_IDX_NTYPES:
- fprintf(out, "ERROR: H5D_CHUNK_IDX_NTYPES (invalid value)");
+ HDfprintf(out, "ERROR: H5D_CHUNK_IDX_NTYPES (invalid value)");
break;
default:
- fprintf(out, "UNKNOWN VALUE: %ld", (long)idx);
+ HDfprintf(out, "UNKNOWN VALUE: %ld", (long)idx);
break;
} /* end switch */
} /* end else */
@@ -542,40 +542,40 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 'l':
if(ptr) {
if(vp)
- fprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%lx", (unsigned long)vp);
else
- fprintf(out, "NULL");
+ HDfprintf(out, "NULL");
} /* end if */
else {
H5D_layout_t layout = (H5D_layout_t)va_arg(ap, int);
switch(layout) {
case H5D_LAYOUT_ERROR:
- fprintf(out, "H5D_LAYOUT_ERROR");
+ HDfprintf(out, "H5D_LAYOUT_ERROR");
break;
case H5D_COMPACT:
- fprintf(out, "H5D_COMPACT");
+ HDfprintf(out, "H5D_COMPACT");
break;
case H5D_CONTIGUOUS:
- fprintf(out, "H5D_CONTIGUOUS");
+ HDfprintf(out, "H5D_CONTIGUOUS");
break;
case H5D_CHUNKED:
- fprintf(out, "H5D_CHUNKED");
+ HDfprintf(out, "H5D_CHUNKED");
break;
case H5D_VIRTUAL:
- fprintf(out, "H5D_VIRTUAL");
+ HDfprintf(out, "H5D_VIRTUAL");
break;
case H5D_NLAYOUTS:
- fprintf(out, "H5D_NLAYOUTS");
+ HDfprintf(out, "H5D_NLAYOUTS");
break;
default:
- fprintf(out, "%ld", (long)layout);
+ HDfprintf(out, "%ld", (long)layout);
break;
} /* end switch */
} /* end else */
@@ -584,9 +584,9 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 'n':
if(ptr) {
if(vp)
- fprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%lx", (unsigned long)vp);
else
- fprintf(out, "NULL");
+ HDfprintf(out, "NULL");
} /* end if */
else {
H5D_mpio_no_collective_cause_t nocol_cause_mode = (H5D_mpio_no_collective_cause_t)va_arg(ap, int);
@@ -594,65 +594,65 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
/* Check for all bit-flags which might be set */
if(nocol_cause_mode & H5D_MPIO_COLLECTIVE) {
- fprintf(out, "H5D_MPIO_COLLECTIVE");
+ HDfprintf(out, "H5D_MPIO_COLLECTIVE");
flag_already_displayed = TRUE;
} /* end if */
if(nocol_cause_mode & H5D_MPIO_SET_INDEPENDENT) {
- fprintf(out, "%sH5D_MPIO_SET_INDEPENDENT", flag_already_displayed ? " | " : "");
+ HDfprintf(out, "%sH5D_MPIO_SET_INDEPENDENT", flag_already_displayed ? " | " : "");
flag_already_displayed = TRUE;
} /* end if */
if(nocol_cause_mode & H5D_MPIO_DATATYPE_CONVERSION) {
- fprintf(out, "%sH5D_MPIO_DATATYPE_CONVERSION", flag_already_displayed ? " | " : "");
+ HDfprintf(out, "%sH5D_MPIO_DATATYPE_CONVERSION", flag_already_displayed ? " | " : "");
flag_already_displayed = TRUE;
} /* end if */
if(nocol_cause_mode & H5D_MPIO_DATA_TRANSFORMS) {
- fprintf(out, "%sH5D_MPIO_DATA_TRANSFORMS", flag_already_displayed ? " | " : "");
+ HDfprintf(out, "%sH5D_MPIO_DATA_TRANSFORMS", flag_already_displayed ? " | " : "");
flag_already_displayed = TRUE;
} /* end if */
if(nocol_cause_mode & H5D_MPIO_MPI_OPT_TYPES_ENV_VAR_DISABLED) {
- fprintf(out, "%sH5D_MPIO_MPI_OPT_TYPES_ENV_VAR_DISABLED", flag_already_displayed ? " | " : "");
+ HDfprintf(out, "%sH5D_MPIO_MPI_OPT_TYPES_ENV_VAR_DISABLED", flag_already_displayed ? " | " : "");
flag_already_displayed = TRUE;
} /* end if */
if(nocol_cause_mode & H5D_MPIO_NOT_SIMPLE_OR_SCALAR_DATASPACES) {
- fprintf(out, "%sH5D_MPIO_NOT_SIMPLE_OR_SCALAR_DATASPACES", flag_already_displayed ? " | " : "");
+ HDfprintf(out, "%sH5D_MPIO_NOT_SIMPLE_OR_SCALAR_DATASPACES", flag_already_displayed ? " | " : "");
flag_already_displayed = TRUE;
} /* end if */
if(nocol_cause_mode & H5D_MPIO_NOT_CONTIGUOUS_OR_CHUNKED_DATASET) {
- fprintf(out, "%sH5D_MPIO_NOT_CONTIGUOUS_OR_CHUNKED_DATASET", flag_already_displayed ? " | " : "");
+ HDfprintf(out, "%sH5D_MPIO_NOT_CONTIGUOUS_OR_CHUNKED_DATASET", flag_already_displayed ? " | " : "");
flag_already_displayed = TRUE;
} /* end if */
/* Display '<none>' if there's no flags set */
if(!flag_already_displayed)
- fprintf(out, "<none>");
+ HDfprintf(out, "<none>");
} /* end else */
break;
case 'o':
if(ptr) {
if(vp)
- fprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%lx", (unsigned long)vp);
else
- fprintf(out, "NULL");
+ HDfprintf(out, "NULL");
} /* end if */
else {
H5D_mpio_actual_chunk_opt_mode_t chunk_opt_mode = (H5D_mpio_actual_chunk_opt_mode_t)va_arg(ap, int);
switch(chunk_opt_mode) {
case H5D_MPIO_NO_CHUNK_OPTIMIZATION:
- fprintf(out, "H5D_MPIO_NO_CHUNK_OPTIMIZATION");
+ HDfprintf(out, "H5D_MPIO_NO_CHUNK_OPTIMIZATION");
break;
case H5D_MPIO_LINK_CHUNK:
- fprintf(out, "H5D_MPIO_LINK_CHUNK");
+ HDfprintf(out, "H5D_MPIO_LINK_CHUNK");
break;
case H5D_MPIO_MULTI_CHUNK:
- fprintf(out, "H5D_MPIO_MULTI_CHUNK");
+ HDfprintf(out, "H5D_MPIO_MULTI_CHUNK");
break;
default:
- fprintf(out, "%ld", (long)chunk_opt_mode);
+ HDfprintf(out, "%ld", (long)chunk_opt_mode);
break;
} /* end switch */
} /* end else */
@@ -661,32 +661,32 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 's':
if(ptr) {
if(vp)
- fprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%lx", (unsigned long)vp);
else
- fprintf(out, "NULL");
+ HDfprintf(out, "NULL");
} /* end if */
else {
H5D_space_status_t space_status = (H5D_space_status_t)va_arg(ap, int);
switch(space_status) {
case H5D_SPACE_STATUS_NOT_ALLOCATED:
- fprintf(out, "H5D_SPACE_STATUS_NOT_ALLOCATED");
+ HDfprintf(out, "H5D_SPACE_STATUS_NOT_ALLOCATED");
break;
case H5D_SPACE_STATUS_PART_ALLOCATED:
- fprintf(out, "H5D_SPACE_STATUS_PART_ALLOCATED");
+ HDfprintf(out, "H5D_SPACE_STATUS_PART_ALLOCATED");
break;
case H5D_SPACE_STATUS_ALLOCATED:
- fprintf(out, "H5D_SPACE_STATUS_ALLOCATED");
+ HDfprintf(out, "H5D_SPACE_STATUS_ALLOCATED");
break;
case H5D_SPACE_STATUS_ERROR:
- fprintf(out, "H5D_SPACE_STATUS_ERROR");
+ HDfprintf(out, "H5D_SPACE_STATUS_ERROR");
break;
default:
- fprintf(out, "%ld", (long)space_status);
+ HDfprintf(out, "%ld", (long)space_status);
break;
} /* end switch */
} /* end else */
@@ -695,24 +695,24 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 't':
if(ptr) {
if(vp)
- fprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%lx", (unsigned long)vp);
else
- fprintf(out, "NULL");
+ HDfprintf(out, "NULL");
} /* end if */
else {
H5FD_mpio_xfer_t transfer = (H5FD_mpio_xfer_t)va_arg(ap, int);
switch(transfer) {
case H5FD_MPIO_INDEPENDENT:
- fprintf(out, "H5FD_MPIO_INDEPENDENT");
+ HDfprintf(out, "H5FD_MPIO_INDEPENDENT");
break;
case H5FD_MPIO_COLLECTIVE:
- fprintf(out, "H5FD_MPIO_COLLECTIVE");
+ HDfprintf(out, "H5FD_MPIO_COLLECTIVE");
break;
default:
- fprintf(out, "%ld", (long)transfer);
+ HDfprintf(out, "%ld", (long)transfer);
break;
} /* end switch */
} /* end else */
@@ -721,35 +721,35 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 'v':
if(ptr) {
if(vp)
- fprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%lx", (unsigned long)vp);
else
- fprintf(out, "NULL");
+ HDfprintf(out, "NULL");
} /* end if */
else {
H5D_vds_view_t view = (H5D_vds_view_t)va_arg(ap, int);
switch(view) {
case H5D_VDS_ERROR:
- fprintf(out, "H5D_VDS_ERROR");
+ HDfprintf(out, "H5D_VDS_ERROR");
break;
case H5D_VDS_FIRST_MISSING:
- fprintf(out, "H5D_VDS_FIRST_MISSING");
+ HDfprintf(out, "H5D_VDS_FIRST_MISSING");
break;
case H5D_VDS_LAST_AVAILABLE:
- fprintf(out, "H5D_VDS_LAST_AVAILABLE");
+ HDfprintf(out, "H5D_VDS_LAST_AVAILABLE");
break;
default:
- fprintf(out, "%ld", (long)view);
+ HDfprintf(out, "%ld", (long)view);
break;
} /* end switch */
} /* end else */
break;
default:
- fprintf (out, "BADTYPE(D%c)", type[1]);
+ HDfprintf (out, "BADTYPE(D%c)", type[1]);
goto error;
} /* end switch */
break;
@@ -757,17 +757,17 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 'e':
if(ptr) {
if(vp)
- fprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%lx", (unsigned long)vp);
else
- fprintf(out, "NULL");
+ HDfprintf(out, "NULL");
} /* end if */
else {
herr_t status = va_arg(ap, herr_t);
if(status >= 0)
- fprintf(out, "SUCCEED");
+ HDfprintf(out, "SUCCEED");
else
- fprintf(out, "FAIL");
+ HDfprintf(out, "FAIL");
} /* end else */
break;
@@ -776,24 +776,24 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 'd':
if(ptr) {
if(vp)
- fprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%lx", (unsigned long)vp);
else
- fprintf(out, "NULL");
+ HDfprintf(out, "NULL");
} /* end if */
else {
H5E_direction_t direction = (H5E_direction_t)va_arg(ap, int);
switch(direction) {
case H5E_WALK_UPWARD:
- fprintf(out, "H5E_WALK_UPWARD");
+ HDfprintf(out, "H5E_WALK_UPWARD");
break;
case H5E_WALK_DOWNWARD:
- fprintf(out, "H5E_WALK_DOWNWARD");
+ HDfprintf(out, "H5E_WALK_DOWNWARD");
break;
default:
- fprintf(out, "%ld", (long)direction);
+ HDfprintf(out, "%ld", (long)direction);
break;
} /* end switch */
} /* end else */
@@ -802,45 +802,45 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 'e':
if(ptr) {
if(vp)
- fprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%lx", (unsigned long)vp);
else
- fprintf(out, "NULL");
+ HDfprintf(out, "NULL");
} /* end if */
else {
H5E_error2_t *error = va_arg(ap, H5E_error2_t *);
- fprintf(out, "0x%lx", (unsigned long)error);
+ HDfprintf(out, "0x%lx", (unsigned long)error);
} /* end else */
break;
case 't':
if(ptr) {
if(vp)
- fprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%lx", (unsigned long)vp);
else
- fprintf(out, "NULL");
+ HDfprintf(out, "NULL");
} /* end if */
else {
H5E_type_t etype = (H5E_type_t)va_arg(ap, int);
switch(etype) {
case H5E_MAJOR:
- fprintf(out, "H5E_MAJOR");
+ HDfprintf(out, "H5E_MAJOR");
break;
case H5E_MINOR:
- fprintf(out, "H5E_MINOR");
+ HDfprintf(out, "H5E_MINOR");
break;
default:
- fprintf(out, "%ld", (long)etype);
+ HDfprintf(out, "%ld", (long)etype);
break;
} /* end switch */
} /* end else */
break;
default:
- fprintf(out, "BADTYPE(E%c)", type[1]);
+ HDfprintf(out, "BADTYPE(E%c)", type[1]);
goto error;
} /* end switch */
break;
@@ -850,32 +850,32 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 'd':
if(ptr) {
if(vp)
- fprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%lx", (unsigned long)vp);
else
- fprintf(out, "NULL");
+ HDfprintf(out, "NULL");
} /* end if */
else {
H5F_close_degree_t degree = (H5F_close_degree_t)va_arg(ap, int);
switch(degree) {
case H5F_CLOSE_DEFAULT:
- fprintf(out, "H5F_CLOSE_DEFAULT");
+ HDfprintf(out, "H5F_CLOSE_DEFAULT");
break;
case H5F_CLOSE_WEAK:
- fprintf(out, "H5F_CLOSE_WEAK");
+ HDfprintf(out, "H5F_CLOSE_WEAK");
break;
case H5F_CLOSE_SEMI:
- fprintf(out, "H5F_CLOSE_SEMI");
+ HDfprintf(out, "H5F_CLOSE_SEMI");
break;
case H5F_CLOSE_STRONG:
- fprintf(out, "H5F_CLOSE_STRONG");
+ HDfprintf(out, "H5F_CLOSE_STRONG");
break;
default:
- fprintf(out, "%ld", (long)degree);
+ HDfprintf(out, "%ld", (long)degree);
break;
} /* end switch */
} /* end else */
@@ -884,33 +884,33 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 'f':
if(ptr) {
if(vp)
- fprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%lx", (unsigned long)vp);
else
- fprintf(out, "NULL");
+ HDfprintf(out, "NULL");
} /* end if */
else {
H5F_fspace_strategy_t fs_strategy = (H5F_fspace_strategy_t)va_arg(ap, int);
switch(fs_strategy) {
case H5F_FSPACE_STRATEGY_FSM_AGGR:
- fprintf(out, "H5F_FSPACE_STRATEGY_FSM_AGGR");
+ HDfprintf(out, "H5F_FSPACE_STRATEGY_FSM_AGGR");
break;
case H5F_FSPACE_STRATEGY_PAGE:
- fprintf(out, "H5F_FSPACE_STRATEGY_PAGE");
+ HDfprintf(out, "H5F_FSPACE_STRATEGY_PAGE");
break;
case H5F_FSPACE_STRATEGY_AGGR:
- fprintf(out, "H5F_FSPACE_STRATEGY_AGGR");
+ HDfprintf(out, "H5F_FSPACE_STRATEGY_AGGR");
break;
case H5F_FSPACE_STRATEGY_NONE:
- fprintf(out, "H5F_FSPACE_STRATEGY_NONE");
+ HDfprintf(out, "H5F_FSPACE_STRATEGY_NONE");
break;
case H5F_FSPACE_STRATEGY_NTYPES:
default:
- fprintf(out, "%ld", (long)fs_strategy);
+ HDfprintf(out, "%ld", (long)fs_strategy);
break;
} /* end switch */
} /* end else */
@@ -919,49 +919,49 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 'm':
if(ptr) {
if(vp)
- fprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%lx", (unsigned long)vp);
else
- fprintf(out, "NULL");
+ HDfprintf(out, "NULL");
} /* end if */
else {
H5F_mem_t mem_type = (H5F_mem_t)va_arg(ap, int);
switch(mem_type) {
case H5FD_MEM_NOLIST:
- fprintf(out, "H5FD_MEM_NOLIST");
+ HDfprintf(out, "H5FD_MEM_NOLIST");
break;
case H5FD_MEM_DEFAULT:
- fprintf(out, "H5FD_MEM_DEFAULT");
+ HDfprintf(out, "H5FD_MEM_DEFAULT");
break;
case H5FD_MEM_SUPER:
- fprintf(out, "H5FD_MEM_SUPER");
+ HDfprintf(out, "H5FD_MEM_SUPER");
break;
case H5FD_MEM_BTREE:
- fprintf(out, "H5FD_MEM_BTREE");
+ HDfprintf(out, "H5FD_MEM_BTREE");
break;
case H5FD_MEM_DRAW:
- fprintf(out, "H5FD_MEM_DRAW");
+ HDfprintf(out, "H5FD_MEM_DRAW");
break;
case H5FD_MEM_GHEAP:
- fprintf(out, "H5FD_MEM_GHEAP");
+ HDfprintf(out, "H5FD_MEM_GHEAP");
break;
case H5FD_MEM_LHEAP:
- fprintf(out, "H5FD_MEM_LHEAP");
+ HDfprintf(out, "H5FD_MEM_LHEAP");
break;
case H5FD_MEM_OHDR:
- fprintf(out, "H5FD_MEM_OHDR");
+ HDfprintf(out, "H5FD_MEM_OHDR");
break;
case H5FD_MEM_NTYPES:
default:
- fprintf(out, "%ld", (long)mem_type);
+ HDfprintf(out, "%ld", (long)mem_type);
break;
} /* end switch */
} /* end else */
@@ -970,24 +970,24 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 's':
if(ptr) {
if(vp)
- fprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%lx", (unsigned long)vp);
else
- fprintf(out, "NULL");
+ HDfprintf(out, "NULL");
} /* end if */
else {
H5F_scope_t scope = (H5F_scope_t)va_arg(ap, int);
switch(scope) {
case H5F_SCOPE_LOCAL:
- fprintf(out, "H5F_SCOPE_LOCAL");
+ HDfprintf(out, "H5F_SCOPE_LOCAL");
break;
case H5F_SCOPE_GLOBAL:
- fprintf(out, "H5F_SCOPE_GLOBAL");
+ HDfprintf(out, "H5F_SCOPE_GLOBAL");
break;
default:
- fprintf(out, "%ld", (long)scope);
+ HDfprintf(out, "%ld", (long)scope);
break;
} /* end switch */
} /* end else */
@@ -996,40 +996,47 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 't':
if(ptr) {
if(vp)
- fprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%lx", (unsigned long)vp);
else
- fprintf(out, "NULL");
+ HDfprintf(out, "NULL");
} /* end if */
break;
case 'v':
if(ptr) {
if(vp)
- fprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%lx", (unsigned long)vp);
else
- fprintf(out, "NULL");
+ HDfprintf(out, "NULL");
} /* end if */
else {
H5F_libver_t libver_vers = (H5F_libver_t)va_arg(ap, int);
switch(libver_vers) {
case H5F_LIBVER_EARLIEST:
- fprintf(out, "H5F_LIBVER_EARLIEST");
+ HDfprintf(out, "H5F_LIBVER_EARLIEST");
break;
- case H5F_LIBVER_LATEST:
- fprintf(out, "H5F_LIBVER_LATEST");
+ case H5F_LIBVER_V18:
+ HDfprintf(out, "H5F_LIBVER_V18");
break;
+ case H5F_LIBVER_V110:
+ HDcompile_assert(H5F_LIBVER_LATEST == H5F_LIBVER_V110);
+ HDfprintf(out, "H5F_LIBVER_LATEST");
+ break;
+
+ case H5F_LIBVER_ERROR:
+ case H5F_LIBVER_NBOUNDS:
default:
- fprintf(out, "%ld", (long)libver_vers);
+ HDfprintf(out, "%ld", (long)libver_vers);
break;
} /* end switch */
} /* end else */
break;
default:
- fprintf(out, "BADTYPE(F%c)", type[1]);
+ HDfprintf(out, "BADTYPE(F%c)", type[1]);
goto error;
} /* end switch */
break;
@@ -1040,46 +1047,46 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 'o':
if(ptr) {
if(vp)
- fprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%lx", (unsigned long)vp);
else
- fprintf(out, "NULL");
+ HDfprintf(out, "NULL");
} /* end if */
else {
H5G_obj_t obj_type = (H5G_obj_t)va_arg(ap, int);
switch(obj_type) {
case H5G_UNKNOWN:
- fprintf(out, "H5G_UNKNOWN");
+ HDfprintf(out, "H5G_UNKNOWN");
break;
case H5G_GROUP:
- fprintf(out, "H5G_GROUP");
+ HDfprintf(out, "H5G_GROUP");
break;
case H5G_DATASET:
- fprintf(out, "H5G_DATASET");
+ HDfprintf(out, "H5G_DATASET");
break;
case H5G_TYPE:
- fprintf(out, "H5G_TYPE");
+ HDfprintf(out, "H5G_TYPE");
break;
case H5G_LINK:
- fprintf(out, "H5G_LINK");
+ HDfprintf(out, "H5G_LINK");
break;
case H5G_UDLINK:
- fprintf(out, "H5G_UDLINK");
+ HDfprintf(out, "H5G_UDLINK");
break;
case H5G_RESERVED_5:
case H5G_RESERVED_6:
case H5G_RESERVED_7:
- fprintf(out, "H5G_RESERVED(%ld)", (long)obj_type);
+ HDfprintf(out, "H5G_RESERVED(%ld)", (long)obj_type);
break;
default:
- fprintf(out, "%ld", (long)obj_type);
+ HDfprintf(out, "%ld", (long)obj_type);
break;
} /* end switch */
} /* end else */
@@ -1088,20 +1095,20 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 's':
if(ptr) {
if(vp)
- fprintf (out, "0x%lx", (unsigned long)vp);
+ HDfprintf (out, "0x%lx", (unsigned long)vp);
else
- fprintf(out, "NULL");
+ HDfprintf(out, "NULL");
} /* end if */
else {
H5G_stat_t *statbuf = va_arg(ap, H5G_stat_t*);
- fprintf(out, "0x%lx", (unsigned long)statbuf);
+ HDfprintf(out, "0x%lx", (unsigned long)statbuf);
}
break;
#endif /* H5_NO_DEPRECATED_SYMBOLS */
default:
- fprintf(out, "BADTYPE(G%c)", type[1]);
+ HDfprintf(out, "BADTYPE(G%c)", type[1]);
goto error;
}
break;
@@ -1109,22 +1116,22 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 'h':
if(ptr) {
if(vp) {
- fprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%lx", (unsigned long)vp);
if(asize_idx >= 0 && asize[asize_idx] >= 0) {
hsize_t *p = (hsize_t *)vp;
- fprintf(out, " {");
+ HDfprintf(out, " {");
for(i = 0; i < asize[asize_idx]; i++) {
if(H5S_UNLIMITED == p[i])
HDfprintf(out, "%sH5S_UNLIMITED", (i ? ", " : ""));
else
HDfprintf(out, "%s%Hu", (i ? ", " : ""), p[i]);
} /* end for */
- fprintf(out, "}");
+ HDfprintf(out, "}");
} /* end if */
} /* end if */
else
- fprintf(out, "NULL");
+ HDfprintf(out, "NULL");
} /* end if */
else {
hsize_t hsize = va_arg(ap, hsize_t);
@@ -1143,18 +1150,18 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 's':
if(ptr) {
if(vp) {
- fprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%lx", (unsigned long)vp);
if(asize_idx >= 0 && asize[asize_idx] >= 0) {
hssize_t *p = (hssize_t *)vp;
- fprintf(out, " {");
+ HDfprintf(out, " {");
for(i = 0; i < asize[asize_idx]; i++)
HDfprintf(out, "%s%Hd", (i ? ", " : ""), p[i]);
- fprintf(out, "}");
+ HDfprintf(out, "}");
} /* end if */
} /* end if */
else
- fprintf(out, "NULL");
+ HDfprintf(out, "NULL");
} /* end if */
else {
hssize_t hssize = va_arg(ap, hssize_t);
@@ -1165,7 +1172,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
break;
default:
- fprintf (out, "BADTYPE(H%c)", type[1]);
+ HDfprintf (out, "BADTYPE(H%c)", type[1]);
goto error;
} /* end switch */
break;
@@ -1173,130 +1180,130 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 'i':
if(ptr) {
if(vp)
- fprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%lx", (unsigned long)vp);
else
- fprintf(out, "NULL");
+ HDfprintf(out, "NULL");
} /* end if */
else {
hid_t obj = va_arg(ap, hid_t);
if(H5P_DEFAULT == obj)
- fprintf(out, "H5P_DEFAULT");
+ HDfprintf(out, "H5P_DEFAULT");
else if(obj < 0)
- fprintf(out, "FAIL");
+ HDfprintf(out, "FAIL");
else {
switch(H5I_TYPE(obj)) { /* Use internal H5I macro instead of function call */
case H5I_UNINIT:
- fprintf(out, "%ld (uninit - error)", (long)obj);
+ HDfprintf(out, "%ld (uninit - error)", (long)obj);
break;
case H5I_BADID:
- fprintf(out, "%ld (error)", (long)obj);
+ HDfprintf(out, "%ld (error)", (long)obj);
break;
case H5I_FILE:
- fprintf(out, "%ld (file)", (long)obj);
+ HDfprintf(out, "%ld (file)", (long)obj);
break;
case H5I_GROUP:
- fprintf(out, "%ld (group)", (long)obj);
+ HDfprintf(out, "%ld (group)", (long)obj);
break;
case H5I_DATATYPE:
if(obj == H5T_NATIVE_SCHAR_g)
- fprintf(out, "H5T_NATIVE_SCHAR");
+ HDfprintf(out, "H5T_NATIVE_SCHAR");
else if(obj == H5T_NATIVE_UCHAR_g)
- fprintf(out, "H5T_NATIVE_UCHAR");
+ HDfprintf(out, "H5T_NATIVE_UCHAR");
else if(obj == H5T_NATIVE_SHORT_g)
- fprintf(out, "H5T_NATIVE_SHORT");
+ HDfprintf(out, "H5T_NATIVE_SHORT");
else if(obj == H5T_NATIVE_USHORT_g)
- fprintf(out, "H5T_NATIVE_USHORT");
+ HDfprintf(out, "H5T_NATIVE_USHORT");
else if(obj == H5T_NATIVE_INT_g)
- fprintf(out, "H5T_NATIVE_INT");
+ HDfprintf(out, "H5T_NATIVE_INT");
else if(obj == H5T_NATIVE_UINT_g)
- fprintf(out, "H5T_NATIVE_UINT");
+ HDfprintf(out, "H5T_NATIVE_UINT");
else if(obj == H5T_NATIVE_LONG_g)
- fprintf(out, "H5T_NATIVE_LONG");
+ HDfprintf(out, "H5T_NATIVE_LONG");
else if(obj == H5T_NATIVE_ULONG_g)
- fprintf(out, "H5T_NATIVE_ULONG");
+ HDfprintf(out, "H5T_NATIVE_ULONG");
else if(obj == H5T_NATIVE_LLONG_g)
- fprintf(out, "H5T_NATIVE_LLONG");
+ HDfprintf(out, "H5T_NATIVE_LLONG");
else if(obj == H5T_NATIVE_ULLONG_g)
- fprintf(out, "H5T_NATIVE_ULLONG");
+ HDfprintf(out, "H5T_NATIVE_ULLONG");
else if(obj == H5T_NATIVE_FLOAT_g)
- fprintf(out, "H5T_NATIVE_FLOAT");
+ HDfprintf(out, "H5T_NATIVE_FLOAT");
else if(obj == H5T_NATIVE_DOUBLE_g)
- fprintf(out, "H5T_NATIVE_DOUBLE");
+ HDfprintf(out, "H5T_NATIVE_DOUBLE");
#if H5_SIZEOF_LONG_DOUBLE !=0
else if(obj == H5T_NATIVE_LDOUBLE_g)
- fprintf(out, "H5T_NATIVE_LDOUBLE");
+ HDfprintf(out, "H5T_NATIVE_LDOUBLE");
#endif
else if(obj == H5T_IEEE_F32BE_g)
- fprintf(out, "H5T_IEEE_F32BE");
+ HDfprintf(out, "H5T_IEEE_F32BE");
else if(obj == H5T_IEEE_F32LE_g)
- fprintf(out, "H5T_IEEE_F32LE");
+ HDfprintf(out, "H5T_IEEE_F32LE");
else if(obj == H5T_IEEE_F64BE_g)
- fprintf(out, "H5T_IEEE_F64BE");
+ HDfprintf(out, "H5T_IEEE_F64BE");
else if(obj == H5T_IEEE_F64LE_g)
- fprintf(out, "H5T_IEEE_F64LE");
+ HDfprintf(out, "H5T_IEEE_F64LE");
else if(obj == H5T_STD_I8BE_g)
- fprintf(out, "H5T_STD_I8BE");
+ HDfprintf(out, "H5T_STD_I8BE");
else if(obj == H5T_STD_I8LE_g)
- fprintf(out, "H5T_STD_I8LE");
+ HDfprintf(out, "H5T_STD_I8LE");
else if(obj == H5T_STD_I16BE_g)
- fprintf(out, "H5T_STD_I16BE");
+ HDfprintf(out, "H5T_STD_I16BE");
else if(obj == H5T_STD_I16LE_g)
- fprintf(out, "H5T_STD_I16LE");
+ HDfprintf(out, "H5T_STD_I16LE");
else if(obj == H5T_STD_I32BE_g)
- fprintf(out, "H5T_STD_I32BE");
+ HDfprintf(out, "H5T_STD_I32BE");
else if(obj == H5T_STD_I32LE_g)
- fprintf(out, "H5T_STD_I32LE");
+ HDfprintf(out, "H5T_STD_I32LE");
else if(obj == H5T_STD_I64BE_g)
- fprintf(out, "H5T_STD_I64BE");
+ HDfprintf(out, "H5T_STD_I64BE");
else if(obj == H5T_STD_I64LE_g)
- fprintf(out, "H5T_STD_I64LE");
+ HDfprintf(out, "H5T_STD_I64LE");
else if(obj == H5T_STD_U8BE_g)
- fprintf(out, "H5T_STD_U8BE");
+ HDfprintf(out, "H5T_STD_U8BE");
else if(obj == H5T_STD_U8LE_g)
- fprintf(out, "H5T_STD_U8LE");
+ HDfprintf(out, "H5T_STD_U8LE");
else if(obj == H5T_STD_U16BE_g)
- fprintf(out, "H5T_STD_U16BE");
+ HDfprintf(out, "H5T_STD_U16BE");
else if(obj == H5T_STD_U16LE_g)
- fprintf(out, "H5T_STD_U16LE");
+ HDfprintf(out, "H5T_STD_U16LE");
else if(obj == H5T_STD_U32BE_g)
- fprintf(out, "H5T_STD_U32BE");
+ HDfprintf(out, "H5T_STD_U32BE");
else if(obj == H5T_STD_U32LE_g)
- fprintf(out, "H5T_STD_U32LE");
+ HDfprintf(out, "H5T_STD_U32LE");
else if(obj == H5T_STD_U64BE_g)
- fprintf(out, "H5T_STD_U64BE");
+ HDfprintf(out, "H5T_STD_U64BE");
else if(obj == H5T_STD_U64LE_g)
- fprintf(out, "H5T_STD_U64LE");
+ HDfprintf(out, "H5T_STD_U64LE");
else if(obj == H5T_STD_B8BE_g)
- fprintf(out, "H5T_STD_B8BE");
+ HDfprintf(out, "H5T_STD_B8BE");
else if(obj == H5T_STD_B8LE_g)
- fprintf(out, "H5T_STD_B8LE");
+ HDfprintf(out, "H5T_STD_B8LE");
else if(obj == H5T_STD_B16BE_g)
- fprintf(out, "H5T_STD_B16BE");
+ HDfprintf(out, "H5T_STD_B16BE");
else if(obj == H5T_STD_B16LE_g)
- fprintf(out, "H5T_STD_B16LE");
+ HDfprintf(out, "H5T_STD_B16LE");
else if(obj == H5T_STD_B32BE_g)
- fprintf(out, "H5T_STD_B32BE");
+ HDfprintf(out, "H5T_STD_B32BE");
else if(obj == H5T_STD_B32LE_g)
- fprintf(out, "H5T_STD_B32LE");
+ HDfprintf(out, "H5T_STD_B32LE");
else if(obj == H5T_STD_B64BE_g)
- fprintf(out, "H5T_STD_B64BE");
+ HDfprintf(out, "H5T_STD_B64BE");
else if(obj == H5T_STD_B64LE_g)
- fprintf(out, "H5T_STD_B64LE");
+ HDfprintf(out, "H5T_STD_B64LE");
else if(obj == H5T_C_S1_g)
- fprintf(out, "H5T_C_S1");
+ HDfprintf(out, "H5T_C_S1");
else if(obj == H5T_FORTRAN_S1_g)
- fprintf(out, "H5T_FORTRAN_S1");
+ HDfprintf(out, "H5T_FORTRAN_S1");
else
- fprintf(out, "%ld (dtype)", (long)obj);
+ HDfprintf(out, "%ld (dtype)", (long)obj);
break;
case H5I_DATASPACE:
- fprintf(out, "%ld (dspace)", (long)obj);
+ HDfprintf(out, "%ld (dspace)", (long)obj);
/* Save the rank of simple data spaces for arrays */
/* This may generate recursive call to the library... -QAK */
{
@@ -1309,47 +1316,47 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
break;
case H5I_DATASET:
- fprintf(out, "%ld (dset)", (long)obj);
+ HDfprintf(out, "%ld (dset)", (long)obj);
break;
case H5I_ATTR:
- fprintf(out, "%ld (attr)", (long)obj);
+ HDfprintf(out, "%ld (attr)", (long)obj);
break;
case H5I_REFERENCE:
- fprintf(out, "%ld (reference)", (long)obj);
+ HDfprintf(out, "%ld (reference)", (long)obj);
break;
case H5I_VFL:
- fprintf(out, "%ld (file driver)", (long)obj);
+ HDfprintf(out, "%ld (file driver)", (long)obj);
break;
case H5I_GENPROP_CLS:
- fprintf(out, "%ld (genprop class)", (long)obj);
+ HDfprintf(out, "%ld (genprop class)", (long)obj);
break;
case H5I_GENPROP_LST:
- fprintf(out, "%ld (genprop list)", (long)obj);
+ HDfprintf(out, "%ld (genprop list)", (long)obj);
break;
case H5I_ERROR_CLASS:
- fprintf(out, "%ld (err class)", (long)obj);
+ HDfprintf(out, "%ld (err class)", (long)obj);
break;
case H5I_ERROR_MSG:
- fprintf(out, "%ld (err msg)", (long)obj);
+ HDfprintf(out, "%ld (err msg)", (long)obj);
break;
case H5I_ERROR_STACK:
- fprintf(out, "%ld (err stack)", (long)obj);
+ HDfprintf(out, "%ld (err stack)", (long)obj);
break;
case H5I_NTYPES:
- fprintf (out, "%ld (ntypes - error)", (long)obj);
+ HDfprintf (out, "%ld (ntypes - error)", (long)obj);
break;
default:
- fprintf(out, "%ld (unknown class)", (long)obj);
+ HDfprintf(out, "%ld (unknown class)", (long)obj);
break;
} /* end switch */
} /* end else */
@@ -1361,32 +1368,32 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 'i':
if(ptr) {
if(vp)
- fprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%lx", (unsigned long)vp);
else
- fprintf(out, "NULL");
+ HDfprintf(out, "NULL");
} /* end if */
else {
H5_index_t idx_type = (H5_index_t)va_arg(ap, int);
switch(idx_type) {
case H5_INDEX_UNKNOWN:
- fprintf(out, "H5_INDEX_UNKNOWN");
+ HDfprintf(out, "H5_INDEX_UNKNOWN");
break;
case H5_INDEX_NAME:
- fprintf(out, "H5_INDEX_NAME");
+ HDfprintf(out, "H5_INDEX_NAME");
break;
case H5_INDEX_CRT_ORDER:
- fprintf(out, "H5_INDEX_CRT_ORDER");
+ HDfprintf(out, "H5_INDEX_CRT_ORDER");
break;
case H5_INDEX_N:
- fprintf(out, "H5_INDEX_N");
+ HDfprintf(out, "H5_INDEX_N");
break;
default:
- fprintf(out, "%ld", (long)idx_type);
+ HDfprintf(out, "%ld", (long)idx_type);
break;
} /* end switch */
} /* end else */
@@ -1395,36 +1402,36 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 'o':
if(ptr) {
if(vp)
- fprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%lx", (unsigned long)vp);
else
- fprintf(out, "NULL");
+ HDfprintf(out, "NULL");
} /* end if */
else {
H5_iter_order_t order = (H5_iter_order_t)va_arg(ap, int);
switch(order) {
case H5_ITER_UNKNOWN:
- fprintf(out, "H5_ITER_UNKNOWN");
+ HDfprintf(out, "H5_ITER_UNKNOWN");
break;
case H5_ITER_INC:
- fprintf(out, "H5_ITER_INC");
+ HDfprintf(out, "H5_ITER_INC");
break;
case H5_ITER_DEC:
- fprintf(out, "H5_ITER_DEC");
+ HDfprintf(out, "H5_ITER_DEC");
break;
case H5_ITER_NATIVE:
- fprintf(out, "H5_ITER_NATIVE");
+ HDfprintf(out, "H5_ITER_NATIVE");
break;
case H5_ITER_N:
- fprintf(out, "H5_ITER_N");
+ HDfprintf(out, "H5_ITER_N");
break;
default:
- fprintf(out, "%ld", (long)order);
+ HDfprintf(out, "%ld", (long)order);
break;
} /* end switch */
} /* end else */
@@ -1433,23 +1440,23 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 's':
if(ptr) {
if(vp) {
- fprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%lx", (unsigned long)vp);
if(asize_idx >= 0 && asize[asize_idx] >= 0) {
int *p = (int*)vp;
- fprintf(out, " {");
+ HDfprintf(out, " {");
for(i = 0; i < asize[asize_idx]; i++)
- fprintf(out, "%s%d", (i ? ", " : ""), p[i]);
- fprintf(out, "}");
+ HDfprintf(out, "%s%d", (i ? ", " : ""), p[i]);
+ HDfprintf(out, "}");
} /* end if */
} /* end if */
else
- fprintf(out, "NULL");
+ HDfprintf(out, "NULL");
} /* end if */
else {
int is = va_arg(ap, int);
- fprintf (out, "%d", is);
+ HDfprintf (out, "%d", is);
asize[argno] = is;
} /* end else */
break;
@@ -1457,80 +1464,80 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 't':
if(ptr) {
if(vp)
- fprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%lx", (unsigned long)vp);
else
- fprintf(out, "NULL");
+ HDfprintf(out, "NULL");
} /* end if */
else {
H5I_type_t id_type = (H5I_type_t)va_arg(ap, int);
switch (id_type) {
case H5I_UNINIT:
- fprintf(out, "H5I_UNINIT");
+ HDfprintf(out, "H5I_UNINIT");
break;
case H5I_BADID:
- fprintf(out, "H5I_BADID");
+ HDfprintf(out, "H5I_BADID");
break;
case H5I_FILE:
- fprintf(out, "H5I_FILE");
+ HDfprintf(out, "H5I_FILE");
break;
case H5I_GROUP:
- fprintf(out, "H5I_GROUP");
+ HDfprintf(out, "H5I_GROUP");
break;
case H5I_DATATYPE:
- fprintf(out, "H5I_DATATYPE");
+ HDfprintf(out, "H5I_DATATYPE");
break;
case H5I_DATASPACE:
- fprintf(out, "H5I_DATASPACE");
+ HDfprintf(out, "H5I_DATASPACE");
break;
case H5I_DATASET:
- fprintf(out, "H5I_DATASET");
+ HDfprintf(out, "H5I_DATASET");
break;
case H5I_ATTR:
- fprintf(out, "H5I_ATTR");
+ HDfprintf(out, "H5I_ATTR");
break;
case H5I_REFERENCE:
- fprintf(out, "H5I_REFERENCE");
+ HDfprintf(out, "H5I_REFERENCE");
break;
case H5I_VFL:
- fprintf(out, "H5I_VFL");
+ HDfprintf(out, "H5I_VFL");
break;
case H5I_GENPROP_CLS:
- fprintf(out, "H5I_GENPROP_CLS");
+ HDfprintf(out, "H5I_GENPROP_CLS");
break;
case H5I_GENPROP_LST:
- fprintf(out, "H5I_GENPROP_LST");
+ HDfprintf(out, "H5I_GENPROP_LST");
break;
case H5I_ERROR_CLASS:
- fprintf(out, "H5I_ERROR_CLASS");
+ HDfprintf(out, "H5I_ERROR_CLASS");
break;
case H5I_ERROR_MSG:
- fprintf(out, "H5I_ERROR_MSG");
+ HDfprintf(out, "H5I_ERROR_MSG");
break;
case H5I_ERROR_STACK:
- fprintf(out, "H5I_ERROR_STACK");
+ HDfprintf(out, "H5I_ERROR_STACK");
break;
case H5I_NTYPES:
- fprintf(out, "H5I_NTYPES");
+ HDfprintf(out, "H5I_NTYPES");
break;
default:
- fprintf(out, "%ld", (long)id_type);
+ HDfprintf(out, "%ld", (long)id_type);
break;
} /* end switch */
} /* end else */
@@ -1539,29 +1546,29 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 'u':
if(ptr) {
if(vp) {
- fprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%lx", (unsigned long)vp);
if(asize_idx >= 0 && asize[asize_idx] >= 0) {
unsigned *p = (unsigned*)vp;
- fprintf(out, " {");
+ HDfprintf(out, " {");
for(i = 0; i < asize[asize_idx]; i++)
HDfprintf(out, "%s%u", i?", ":"", p[i]);
- fprintf(out, "}");
+ HDfprintf(out, "}");
} /* end if */
} /* end if */
else
- fprintf(out, "NULL");
+ HDfprintf(out, "NULL");
} /* end if */
else {
unsigned iu = va_arg(ap, unsigned);
- fprintf(out, "%u", iu);
+ HDfprintf(out, "%u", iu);
asize[argno] = iu;
} /* end else */
break;
default:
- fprintf (out, "BADTYPE(I%c)", type[1]);
+ HDfprintf (out, "BADTYPE(I%c)", type[1]);
goto error;
} /* end switch */
break;
@@ -1571,43 +1578,43 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 'l':
if(ptr) {
if(vp)
- fprintf (out, "0x%lx", (unsigned long)vp);
+ HDfprintf (out, "0x%lx", (unsigned long)vp);
else
- fprintf(out, "NULL");
+ HDfprintf(out, "NULL");
} /* end if */
else {
H5L_type_t link_type = (H5L_type_t)va_arg(ap, int);
switch(link_type) {
case H5L_TYPE_ERROR:
- fprintf(out, "H5L_TYPE_ERROR");
+ HDfprintf(out, "H5L_TYPE_ERROR");
break;
case H5L_TYPE_HARD:
- fprintf(out, "H5L_TYPE_HARD");
+ HDfprintf(out, "H5L_TYPE_HARD");
break;
case H5L_TYPE_SOFT:
- fprintf(out, "H5L_TYPE_SOFT");
+ HDfprintf(out, "H5L_TYPE_SOFT");
break;
case H5L_TYPE_EXTERNAL:
- fprintf(out, "H5L_TYPE_EXTERNAL");
+ HDfprintf(out, "H5L_TYPE_EXTERNAL");
break;
case H5L_TYPE_MAX:
- fprintf(out, "H5L_TYPE_MAX");
+ HDfprintf(out, "H5L_TYPE_MAX");
break;
default:
- fprintf(out, "%ld", (long)link_type);
+ HDfprintf(out, "%ld", (long)link_type);
break;
} /* end switch */
} /* end else */
break;
default:
- fprintf(out, "BADTYPE(G%c)", type[1]);
+ HDfprintf(out, "BADTYPE(G%c)", type[1]);
goto error;
} /* end switch */
break;
@@ -1617,15 +1624,15 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 'c':
if(ptr) {
if(vp)
- fprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%lx", (unsigned long)vp);
else
- fprintf(out, "NULL");
+ HDfprintf(out, "NULL");
} /* end if */
#ifdef H5_HAVE_PARALLEL
else {
MPI_Comm comm = va_arg(ap, MPI_Comm);
- fprintf(out, "%ld", (long)comm);
+ HDfprintf(out, "%ld", (long)comm);
} /* end else */
#endif /* H5_HAVE_PARALLEL */
break;
@@ -1633,15 +1640,15 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 'i':
if(ptr) {
if(vp)
- fprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%lx", (unsigned long)vp);
else
- fprintf(out, "NULL");
+ HDfprintf(out, "NULL");
} /* end if */
#ifdef H5_HAVE_PARALLEL
else {
MPI_Info info = va_arg(ap, MPI_Info);
- fprintf(out, "%ld", (long)info);
+ HDfprintf(out, "%ld", (long)info);
} /* end else */
#endif /* H5_HAVE_PARALLEL */
break;
@@ -1649,52 +1656,52 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 't':
if(ptr) {
if(vp)
- fprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%lx", (unsigned long)vp);
else
- fprintf(out, "NULL");
+ HDfprintf(out, "NULL");
} /* end if */
else {
H5FD_mem_t mt = (H5FD_mem_t)va_arg(ap, int);
switch(mt) {
case H5FD_MEM_NOLIST:
- fprintf(out, "H5FD_MEM_NOLIST");
+ HDfprintf(out, "H5FD_MEM_NOLIST");
break;
case H5FD_MEM_DEFAULT:
- fprintf(out, "H5FD_MEM_DEFAULT");
+ HDfprintf(out, "H5FD_MEM_DEFAULT");
break;
case H5FD_MEM_SUPER:
- fprintf(out, "H5FD_MEM_SUPER");
+ HDfprintf(out, "H5FD_MEM_SUPER");
break;
case H5FD_MEM_BTREE:
- fprintf(out, "H5FD_MEM_BTREE");
+ HDfprintf(out, "H5FD_MEM_BTREE");
break;
case H5FD_MEM_DRAW:
- fprintf(out, "H5FD_MEM_DRAW");
+ HDfprintf(out, "H5FD_MEM_DRAW");
break;
case H5FD_MEM_GHEAP:
- fprintf(out, "H5FD_MEM_GHEAP");
+ HDfprintf(out, "H5FD_MEM_GHEAP");
break;
case H5FD_MEM_LHEAP:
- fprintf(out, "H5FD_MEM_LHEAP");
+ HDfprintf(out, "H5FD_MEM_LHEAP");
break;
case H5FD_MEM_OHDR:
- fprintf(out, "H5FD_MEM_OHDR");
+ HDfprintf(out, "H5FD_MEM_OHDR");
break;
case H5FD_MEM_NTYPES:
- fprintf(out, "H5FD_MEM_NTYPES");
+ HDfprintf(out, "H5FD_MEM_NTYPES");
break;
default:
- fprintf(out, "%ld", (long)mt);
+ HDfprintf(out, "%ld", (long)mt);
break;
} /* end switch */
} /* end else */
@@ -1708,14 +1715,14 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 'o':
if(ptr) {
if(vp)
- fprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%lx", (unsigned long)vp);
else
- fprintf(out, "NULL");
+ HDfprintf(out, "NULL");
} /* end if */
else {
off_t offset = va_arg(ap, off_t);
- fprintf (out, "%ld", (long)offset);
+ HDfprintf (out, "%ld", (long)offset);
} /* end else */
break;
@@ -1724,43 +1731,43 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 't':
if(ptr) {
if(vp)
- fprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%lx", (unsigned long)vp);
else
- fprintf(out, "NULL");
+ HDfprintf(out, "NULL");
} /* end if */
else {
H5O_type_t objtype = (H5O_type_t)va_arg(ap, int);
switch(objtype) {
case H5O_TYPE_UNKNOWN:
- fprintf(out, "H5O_TYPE_UNKNOWN");
+ HDfprintf(out, "H5O_TYPE_UNKNOWN");
break;
case H5O_TYPE_GROUP:
- fprintf(out, "H5O_TYPE_GROUP");
+ HDfprintf(out, "H5O_TYPE_GROUP");
break;
case H5O_TYPE_DATASET:
- fprintf(out, "H5O_TYPE_DATASET");
+ HDfprintf(out, "H5O_TYPE_DATASET");
break;
case H5O_TYPE_NAMED_DATATYPE:
- fprintf(out, "H5O_TYPE_NAMED_DATATYPE");
+ HDfprintf(out, "H5O_TYPE_NAMED_DATATYPE");
break;
case H5O_TYPE_NTYPES:
- fprintf(out, "H5O_TYPE_TYPES");
+ HDfprintf(out, "H5O_TYPE_TYPES");
break;
default:
- fprintf(out, "BADTYPE(%ld)", (long)objtype);
+ HDfprintf(out, "BADTYPE(%ld)", (long)objtype);
break;
} /* end switch */
} /* end else */
break;
default:
- fprintf(out, "BADTYPE(S%c)", type[1]);
+ HDfprintf(out, "BADTYPE(S%c)", type[1]);
goto error;
} /* end switch */
break;
@@ -1768,9 +1775,9 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 'p':
if(ptr) {
if(vp)
- fprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%lx", (unsigned long)vp);
else
- fprintf(out, "NULL");
+ HDfprintf(out, "NULL");
} /* end if */
else {
hid_t pclass_id = va_arg(ap, hid_t);
@@ -1781,20 +1788,20 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
/* (This may generate recursive call to the library... -QAK) */
if(NULL != (pclass = (H5P_genclass_t *)H5I_object(pclass_id)) &&
NULL != (class_name = H5P_get_class_name(pclass))) {
- fprintf(out, "%s", class_name);
+ HDfprintf(out, "%s", class_name);
H5MM_xfree(class_name);
} /* end if */
else
- fprintf(out, "%ld", (long)pclass_id);
+ HDfprintf(out, "%ld", (long)pclass_id);
} /* end else */
break;
case 'r':
if(ptr) {
if(vp)
- fprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%lx", (unsigned long)vp);
else
- fprintf(out, "NULL");
+ HDfprintf(out, "NULL");
} /* end if */
else {
hobj_ref_t ref = va_arg(ap, hobj_ref_t);
@@ -1808,39 +1815,39 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 't':
if(ptr) {
if(vp)
- fprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%lx", (unsigned long)vp);
else
- fprintf(out, "NULL");
+ HDfprintf(out, "NULL");
} /* end if */
else {
H5R_type_t reftype = (H5R_type_t)va_arg(ap, int);
switch(reftype) {
case H5R_BADTYPE:
- fprintf(out, "H5R_BADTYPE");
+ HDfprintf(out, "H5R_BADTYPE");
break;
case H5R_OBJECT:
- fprintf(out, "H5R_OBJECT");
+ HDfprintf(out, "H5R_OBJECT");
break;
case H5R_DATASET_REGION:
- fprintf(out, "H5R_DATASET_REGION");
+ HDfprintf(out, "H5R_DATASET_REGION");
break;
case H5R_MAXTYPE:
- fprintf(out, "H5R_MAXTYPE");
+ HDfprintf(out, "H5R_MAXTYPE");
break;
default:
- fprintf(out, "BADTYPE(%ld)", (long)reftype);
+ HDfprintf(out, "BADTYPE(%ld)", (long)reftype);
break;
} /* end switch */
} /* end else */
break;
default:
- fprintf(out, "BADTYPE(S%c)", type[1]);
+ HDfprintf(out, "BADTYPE(S%c)", type[1]);
goto error;
}
break;
@@ -1850,32 +1857,32 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 'c':
if(ptr) {
if(vp)
- fprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%lx", (unsigned long)vp);
else
- fprintf(out, "NULL");
+ HDfprintf(out, "NULL");
} /* end if */
else {
H5S_class_t cls = (H5S_class_t)va_arg(ap, int);
switch(cls) {
case H5S_NO_CLASS:
- fprintf(out, "H5S_NO_CLASS");
+ HDfprintf(out, "H5S_NO_CLASS");
break;
case H5S_SCALAR:
- fprintf(out, "H5S_SCALAR");
+ HDfprintf(out, "H5S_SCALAR");
break;
case H5S_SIMPLE:
- fprintf(out, "H5S_SIMPLE");
+ HDfprintf(out, "H5S_SIMPLE");
break;
case H5S_NULL:
- fprintf(out, "H5S_NULL");
+ HDfprintf(out, "H5S_NULL");
break;
default:
- fprintf(out, "%ld", (long)cls);
+ HDfprintf(out, "%ld", (long)cls);
break;
} /* end switch */
} /* end else */
@@ -1884,56 +1891,56 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 's':
if(ptr) {
if(vp)
- fprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%lx", (unsigned long)vp);
else
- fprintf(out, "NULL");
+ HDfprintf(out, "NULL");
} /* end if */
else {
H5S_seloper_t so = (H5S_seloper_t)va_arg(ap, int);
switch(so) {
case H5S_SELECT_NOOP:
- fprintf(out, "H5S_NOOP");
+ HDfprintf(out, "H5S_NOOP");
break;
case H5S_SELECT_SET:
- fprintf(out, "H5S_SELECT_SET");
+ HDfprintf(out, "H5S_SELECT_SET");
break;
case H5S_SELECT_OR:
- fprintf(out, "H5S_SELECT_OR");
+ HDfprintf(out, "H5S_SELECT_OR");
break;
case H5S_SELECT_AND:
- fprintf(out, "H5S_SELECT_AND");
+ HDfprintf(out, "H5S_SELECT_AND");
break;
case H5S_SELECT_XOR:
- fprintf(out, "H5S_SELECT_XOR");
+ HDfprintf(out, "H5S_SELECT_XOR");
break;
case H5S_SELECT_NOTB:
- fprintf(out, "H5S_SELECT_NOTB");
+ HDfprintf(out, "H5S_SELECT_NOTB");
break;
case H5S_SELECT_NOTA:
- fprintf(out, "H5S_SELECT_NOTA");
+ HDfprintf(out, "H5S_SELECT_NOTA");
break;
case H5S_SELECT_APPEND:
- fprintf(out, "H5S_SELECT_APPEND");
+ HDfprintf(out, "H5S_SELECT_APPEND");
break;
case H5S_SELECT_PREPEND:
- fprintf(out, "H5S_SELECT_PREPEND");
+ HDfprintf(out, "H5S_SELECT_PREPEND");
break;
case H5S_SELECT_INVALID:
- fprintf(out, "H5S_SELECT_INVALID");
+ HDfprintf(out, "H5S_SELECT_INVALID");
break;
default:
- fprintf(out, "%ld", (long)so);
+ HDfprintf(out, "%ld", (long)so);
break;
} /* end switch */
} /* end else */
@@ -1942,47 +1949,47 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 't':
if(ptr) {
if(vp)
- fprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%lx", (unsigned long)vp);
else
- fprintf(out, "NULL");
+ HDfprintf(out, "NULL");
} /* end if */
else {
H5S_sel_type st = (H5S_sel_type)va_arg(ap, int);
switch(st) {
case H5S_SEL_ERROR:
- fprintf(out, "H5S_SEL_ERROR");
+ HDfprintf(out, "H5S_SEL_ERROR");
break;
case H5S_SEL_NONE:
- fprintf(out, "H5S_SEL_NONE");
+ HDfprintf(out, "H5S_SEL_NONE");
break;
case H5S_SEL_POINTS:
- fprintf(out, "H5S_SEL_POINTS");
+ HDfprintf(out, "H5S_SEL_POINTS");
break;
case H5S_SEL_HYPERSLABS:
- fprintf(out, "H5S_SEL_HYPERSLABS");
+ HDfprintf(out, "H5S_SEL_HYPERSLABS");
break;
case H5S_SEL_ALL:
- fprintf(out, "H5S_SEL_ALL");
+ HDfprintf(out, "H5S_SEL_ALL");
break;
case H5S_SEL_N:
- fprintf(out, "H5S_SEL_N");
+ HDfprintf(out, "H5S_SEL_N");
break;
default:
- fprintf(out, "%ld", (long)st);
+ HDfprintf(out, "%ld", (long)st);
break;
} /* end switch */
} /* end else */
break;
default:
- fprintf(out, "BADTYPE(S%c)", type[1]);
+ HDfprintf(out, "BADTYPE(S%c)", type[1]);
goto error;
} /* end switch */
break;
@@ -1990,14 +1997,14 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 's':
if(ptr) {
if(vp)
- fprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%lx", (unsigned long)vp);
else
- fprintf(out, "NULL");
+ HDfprintf(out, "NULL");
} /* end if */
else {
const char *str = va_arg(ap, const char *);
- fprintf(out, "\"%s\"", str);
+ HDfprintf(out, "\"%s\"", str);
} /* end else */
break;
@@ -2006,24 +2013,24 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 'c':
if(ptr) {
if(vp)
- fprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%lx", (unsigned long)vp);
else
- fprintf(out, "NULL");
+ HDfprintf(out, "NULL");
} /* end if */
else {
H5T_cset_t cset = (H5T_cset_t)va_arg(ap, int);
switch(cset) {
case H5T_CSET_ERROR:
- fprintf(out, "H5T_CSET_ERROR");
+ HDfprintf(out, "H5T_CSET_ERROR");
break;
case H5T_CSET_ASCII:
- fprintf(out, "H5T_CSET_ASCII");
+ HDfprintf(out, "H5T_CSET_ASCII");
break;
case H5T_CSET_UTF8:
- fprintf(out, "H5T_CSET_UTF8");
+ HDfprintf(out, "H5T_CSET_UTF8");
break;
case H5T_CSET_RESERVED_2:
@@ -2040,11 +2047,11 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case H5T_CSET_RESERVED_13:
case H5T_CSET_RESERVED_14:
case H5T_CSET_RESERVED_15:
- fprintf(out, "H5T_CSET_RESERVED_%ld", (long)cset);
+ HDfprintf(out, "H5T_CSET_RESERVED_%ld", (long)cset);
break;
default:
- fprintf(out, "%ld", (long)cset);
+ HDfprintf(out, "%ld", (long)cset);
break;
} /* end switch */
} /* end else */
@@ -2053,28 +2060,28 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 'd':
if(ptr) {
if(vp)
- fprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%lx", (unsigned long)vp);
else
- fprintf(out, "NULL");
+ HDfprintf(out, "NULL");
} /* end if */
else {
H5T_direction_t direct = (H5T_direction_t)va_arg(ap, int);
switch(direct) {
case H5T_DIR_DEFAULT:
- fprintf(out, "H5T_DIR_DEFAULT");
+ HDfprintf(out, "H5T_DIR_DEFAULT");
break;
case H5T_DIR_ASCEND:
- fprintf(out, "H5T_DIR_ASCEND");
+ HDfprintf(out, "H5T_DIR_ASCEND");
break;
case H5T_DIR_DESCEND:
- fprintf(out, "H5T_DIR_DESCEND");
+ HDfprintf(out, "H5T_DIR_DESCEND");
break;
default:
- fprintf(out, "%ld", (long)direct);
+ HDfprintf(out, "%ld", (long)direct);
break;
} /* end switch */
} /* end else */
@@ -2083,28 +2090,28 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 'e':
if(ptr) {
if(vp)
- fprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%lx", (unsigned long)vp);
else
- fprintf(out, "NULL");
+ HDfprintf(out, "NULL");
} /* end if */
else {
H5T_pers_t pers = (H5T_pers_t)va_arg(ap, int);
switch(pers) {
case H5T_PERS_DONTCARE:
- fprintf(out, "H5T_PERS_DONTCARE");
+ HDfprintf(out, "H5T_PERS_DONTCARE");
break;
case H5T_PERS_SOFT:
- fprintf(out, "H5T_PERS_SOFT");
+ HDfprintf(out, "H5T_PERS_SOFT");
break;
case H5T_PERS_HARD:
- fprintf(out, "H5T_PERS_HARD");
+ HDfprintf(out, "H5T_PERS_HARD");
break;
default:
- fprintf(out, "%ld", (long)pers);
+ HDfprintf(out, "%ld", (long)pers);
break;
} /* end switch */
} /* end else */
@@ -2113,32 +2120,32 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 'n':
if(ptr) {
if(vp)
- fprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%lx", (unsigned long)vp);
else
- fprintf(out, "NULL");
+ HDfprintf(out, "NULL");
} /* end if */
else {
H5T_norm_t norm = (H5T_norm_t)va_arg(ap, int);
switch(norm) {
case H5T_NORM_ERROR:
- fprintf(out, "H5T_NORM_ERROR");
+ HDfprintf(out, "H5T_NORM_ERROR");
break;
case H5T_NORM_IMPLIED:
- fprintf(out, "H5T_NORM_IMPLIED");
+ HDfprintf(out, "H5T_NORM_IMPLIED");
break;
case H5T_NORM_MSBSET:
- fprintf(out, "H5T_NORM_MSBSET");
+ HDfprintf(out, "H5T_NORM_MSBSET");
break;
case H5T_NORM_NONE:
- fprintf(out, "H5T_NORM_NONE");
+ HDfprintf(out, "H5T_NORM_NONE");
break;
default:
- fprintf(out, "%ld", (long)norm);
+ HDfprintf(out, "%ld", (long)norm);
break;
} /* end switch */
} /* end else */
@@ -2147,40 +2154,40 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 'o':
if(ptr) {
if(vp)
- fprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%lx", (unsigned long)vp);
else
- fprintf(out, "NULL");
+ HDfprintf(out, "NULL");
} /* end if */
else {
H5T_order_t order = (H5T_order_t)va_arg(ap, int);
switch(order) {
case H5T_ORDER_ERROR:
- fprintf(out, "H5T_ORDER_ERROR");
+ HDfprintf(out, "H5T_ORDER_ERROR");
break;
case H5T_ORDER_LE:
- fprintf(out, "H5T_ORDER_LE");
+ HDfprintf(out, "H5T_ORDER_LE");
break;
case H5T_ORDER_BE:
- fprintf(out, "H5T_ORDER_BE");
+ HDfprintf(out, "H5T_ORDER_BE");
break;
case H5T_ORDER_VAX:
- fprintf(out, "H5T_ORDER_VAX");
+ HDfprintf(out, "H5T_ORDER_VAX");
break;
case H5T_ORDER_MIXED:
- fprintf(out, "H5T_ORDER_MIXED");
+ HDfprintf(out, "H5T_ORDER_MIXED");
break;
case H5T_ORDER_NONE:
- fprintf(out, "H5T_ORDER_NONE");
+ HDfprintf(out, "H5T_ORDER_NONE");
break;
default:
- fprintf(out, "%ld", (long)order);
+ HDfprintf(out, "%ld", (long)order);
break;
} /* end switch */
} /* end else */
@@ -2189,36 +2196,36 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 'p':
if(ptr) {
if(vp)
- fprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%lx", (unsigned long)vp);
else
- fprintf(out, "NULL");
+ HDfprintf(out, "NULL");
} /* end if */
else {
H5T_pad_t pad = (H5T_pad_t)va_arg(ap, int);
switch(pad) {
case H5T_PAD_ERROR:
- fprintf(out, "H5T_PAD_ERROR");
+ HDfprintf(out, "H5T_PAD_ERROR");
break;
case H5T_PAD_ZERO:
- fprintf(out, "H5T_PAD_ZERO");
+ HDfprintf(out, "H5T_PAD_ZERO");
break;
case H5T_PAD_ONE:
- fprintf(out, "H5T_PAD_ONE");
+ HDfprintf(out, "H5T_PAD_ONE");
break;
case H5T_PAD_BACKGROUND:
- fprintf(out, "H5T_PAD_BACKGROUND");
+ HDfprintf(out, "H5T_PAD_BACKGROUND");
break;
case H5T_NPAD:
- fprintf(out, "H5T_NPAD");
+ HDfprintf(out, "H5T_NPAD");
break;
default:
- fprintf(out, "%ld", (long)pad);
+ HDfprintf(out, "%ld", (long)pad);
break;
} /* end switch */
} /* end else */
@@ -2227,32 +2234,32 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 's':
if(ptr) {
if(vp)
- fprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%lx", (unsigned long)vp);
else
- fprintf(out, "NULL");
+ HDfprintf(out, "NULL");
} /* end if */
else {
H5T_sign_t sign = (H5T_sign_t)va_arg(ap, int);
switch(sign) {
case H5T_SGN_ERROR:
- fprintf(out, "H5T_SGN_ERROR");
+ HDfprintf(out, "H5T_SGN_ERROR");
break;
case H5T_SGN_NONE:
- fprintf(out, "H5T_SGN_NONE");
+ HDfprintf(out, "H5T_SGN_NONE");
break;
case H5T_SGN_2:
- fprintf(out, "H5T_SGN_2");
+ HDfprintf(out, "H5T_SGN_2");
break;
case H5T_NSGN:
- fprintf(out, "H5T_NSGN");
+ HDfprintf(out, "H5T_NSGN");
break;
default:
- fprintf(out, "%ld", (long)sign);
+ HDfprintf(out, "%ld", (long)sign);
break;
} /* end switch */
} /* end else */
@@ -2261,68 +2268,68 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 't':
if(ptr) {
if(vp)
- fprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%lx", (unsigned long)vp);
else
- fprintf(out, "NULL");
+ HDfprintf(out, "NULL");
} /* end if */
else {
H5T_class_t type_class = (H5T_class_t)va_arg(ap, int);
switch(type_class) {
case H5T_NO_CLASS:
- fprintf(out, "H5T_NO_CLASS");
+ HDfprintf(out, "H5T_NO_CLASS");
break;
case H5T_INTEGER:
- fprintf(out, "H5T_INTEGER");
+ HDfprintf(out, "H5T_INTEGER");
break;
case H5T_FLOAT:
- fprintf(out, "H5T_FLOAT");
+ HDfprintf(out, "H5T_FLOAT");
break;
case H5T_TIME:
- fprintf(out, "H5T_TIME");
+ HDfprintf(out, "H5T_TIME");
break;
case H5T_STRING:
- fprintf(out, "H5T_STRING");
+ HDfprintf(out, "H5T_STRING");
break;
case H5T_BITFIELD:
- fprintf(out, "H5T_BITFIELD");
+ HDfprintf(out, "H5T_BITFIELD");
break;
case H5T_OPAQUE:
- fprintf(out, "H5T_OPAQUE");
+ HDfprintf(out, "H5T_OPAQUE");
break;
case H5T_COMPOUND:
- fprintf(out, "H5T_COMPOUND");
+ HDfprintf(out, "H5T_COMPOUND");
break;
case H5T_REFERENCE:
- fprintf(out, "H5T_REFERENCE");
+ HDfprintf(out, "H5T_REFERENCE");
break;
case H5T_ENUM:
- fprintf(out, "H5T_ENUM");
+ HDfprintf(out, "H5T_ENUM");
break;
case H5T_VLEN:
- fprintf(out, "H5T_VLEN");
+ HDfprintf(out, "H5T_VLEN");
break;
case H5T_ARRAY:
- fprintf(out, "H5T_ARRAY");
+ HDfprintf(out, "H5T_ARRAY");
break;
case H5T_NCLASSES:
- fprintf(out, "H5T_NCLASSES");
+ HDfprintf(out, "H5T_NCLASSES");
break;
default:
- fprintf(out, "%ld", (long)type_class);
+ HDfprintf(out, "%ld", (long)type_class);
break;
} /* end switch */
} /* end else */
@@ -2331,28 +2338,28 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 'z':
if(ptr) {
if(vp)
- fprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%lx", (unsigned long)vp);
else
- fprintf(out, "NULL");
+ HDfprintf(out, "NULL");
} /* end if */
else {
H5T_str_t str = (H5T_str_t)va_arg(ap, int);
switch(str) {
case H5T_STR_ERROR:
- fprintf(out, "H5T_STR_ERROR");
+ HDfprintf(out, "H5T_STR_ERROR");
break;
case H5T_STR_NULLTERM:
- fprintf(out, "H5T_STR_NULLTERM");
+ HDfprintf(out, "H5T_STR_NULLTERM");
break;
case H5T_STR_NULLPAD:
- fprintf(out, "H5T_STR_NULLPAD");
+ HDfprintf(out, "H5T_STR_NULLPAD");
break;
case H5T_STR_SPACEPAD:
- fprintf(out, "H5T_STR_SPACEPAD");
+ HDfprintf(out, "H5T_STR_SPACEPAD");
break;
case H5T_STR_RESERVED_3:
@@ -2368,18 +2375,18 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case H5T_STR_RESERVED_13:
case H5T_STR_RESERVED_14:
case H5T_STR_RESERVED_15:
- fprintf(out, "H5T_STR_RESERVED(%ld)",(long)str);
+ HDfprintf(out, "H5T_STR_RESERVED(%ld)",(long)str);
break;
default:
- fprintf(out, "%ld", (long)str);
+ HDfprintf(out, "%ld", (long)str);
break;
} /* end switch */
} /* end else */
break;
default:
- fprintf (out, "BADTYPE(T%c)", type[1]);
+ HDfprintf (out, "BADTYPE(T%c)", type[1]);
goto error;
} /* end switch */
break;
@@ -2387,19 +2394,19 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 't':
if(ptr) {
if(vp)
- fprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%lx", (unsigned long)vp);
else
- fprintf(out, "NULL");
+ HDfprintf(out, "NULL");
} /* end if */
else {
htri_t tri_var = va_arg (ap, htri_t);
if(tri_var>0)
- fprintf (out, "TRUE");
+ HDfprintf (out, "TRUE");
else if(!tri_var)
- fprintf (out, "FALSE");
+ HDfprintf (out, "FALSE");
else
- fprintf(out, "FAIL(%d)", (int)tri_var);
+ HDfprintf(out, "FAIL(%d)", (int)tri_var);
} /* end else */
break;
@@ -2408,23 +2415,23 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 'l':
if(ptr) {
if(vp) {
- fprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%lx", (unsigned long)vp);
if(asize_idx >= 0 && asize[asize_idx] >= 0) {
unsigned long *p = (unsigned long *)vp;
- fprintf(out, " {");
+ HDfprintf(out, " {");
for(i = 0; i < asize[asize_idx]; i++)
HDfprintf(out, "%s%lu", i?", ":"", p[i]);
- fprintf(out, "}");
+ HDfprintf(out, "}");
} /* end if */
} /* end if */
else
- fprintf(out, "NULL");
+ HDfprintf(out, "NULL");
} /* end if */
else {
unsigned long iul = va_arg(ap, unsigned long);
- fprintf(out, "%lu", iul);
+ HDfprintf(out, "%lu", iul);
asize[argno] = (hssize_t)iul;
} /* end else */
break;
@@ -2432,29 +2439,29 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 'L':
if(ptr) {
if(vp) {
- fprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%lx", (unsigned long)vp);
if(asize_idx >= 0 && asize[asize_idx] >= 0) {
unsigned long long *p = (unsigned long long *)vp;
- fprintf(out, " {");
+ HDfprintf(out, " {");
for(i = 0; i < asize[asize_idx]; i++)
HDfprintf(out, "%s%llu", i?", ":"", p[i]);
- fprintf(out, "}");
+ HDfprintf(out, "}");
} /* end if */
} /* end if */
else
- fprintf(out, "NULL");
+ HDfprintf(out, "NULL");
} /* end if */
else {
unsigned long long iull = va_arg(ap, unsigned long long);
- fprintf(out, "%llu", iull);
+ HDfprintf(out, "%llu", iull);
asize[argno] = (hssize_t)iull;
} /* end else */
break;
default:
- fprintf (out, "BADTYPE(U%c)", type[1]);
+ HDfprintf (out, "BADTYPE(U%c)", type[1]);
goto error;
} /* end switch */
break;
@@ -2462,48 +2469,48 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 'x':
if(ptr) {
if(vp) {
- fprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%lx", (unsigned long)vp);
if(asize_idx >= 0 && asize[asize_idx] >= 0) {
void **p = (void**)vp;
- fprintf(out, " {");
+ HDfprintf(out, " {");
for(i = 0; i < asize[asize_idx]; i++) {
if(p[i])
- fprintf(out, "%s0x%lx", (i ? ", " : ""), (unsigned long)(p[i]));
+ HDfprintf(out, "%s0x%lx", (i ? ", " : ""), (unsigned long)(p[i]));
else
- fprintf(out, "%sNULL", (i ? ", " : ""));
+ HDfprintf(out, "%sNULL", (i ? ", " : ""));
} /* end for */
- fprintf(out, "}");
+ HDfprintf(out, "}");
} /* end if */
} /* end if */
else
- fprintf(out, "NULL");
+ HDfprintf(out, "NULL");
} /* end if */
else {
vp = va_arg (ap, void *);
if(vp)
- fprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%lx", (unsigned long)vp);
else
- fprintf(out, "NULL");
+ HDfprintf(out, "NULL");
} /* end else */
break;
case 'z':
if(ptr) {
if(vp) {
- fprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%lx", (unsigned long)vp);
if(asize_idx >= 0 && asize[asize_idx] >= 0) {
size_t *p = (size_t *)vp;
- fprintf(out, " {");
+ HDfprintf(out, " {");
for(i = 0; i < asize[asize_idx]; i++)
HDfprintf(out, "%s%Zu", (i ? ", " : ""), p[i]);
- fprintf(out, "}");
+ HDfprintf(out, "}");
} /* end if */
} /* end if */
else
- fprintf(out, "NULL");
+ HDfprintf(out, "NULL");
} /* end if */
else {
size_t size = va_arg(ap, size_t);
@@ -2518,28 +2525,28 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 'a':
if(ptr) {
if(vp)
- fprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%lx", (unsigned long)vp);
else
- fprintf(out, "NULL");
+ HDfprintf(out, "NULL");
} /* end if */
else {
H5Z_SO_scale_type_t scale_type = (H5Z_SO_scale_type_t)va_arg(ap, int);
switch(scale_type) {
case H5Z_SO_FLOAT_DSCALE:
- fprintf(out, "H5Z_SO_FLOAT_DSCALE");
+ HDfprintf(out, "H5Z_SO_FLOAT_DSCALE");
break;
case H5Z_SO_FLOAT_ESCALE:
- fprintf(out, "H5Z_SO_FLOAT_ESCALE");
+ HDfprintf(out, "H5Z_SO_FLOAT_ESCALE");
break;
case H5Z_SO_INT:
- fprintf(out, "H5Z_SO_INT");
+ HDfprintf(out, "H5Z_SO_INT");
break;
default:
- fprintf(out, "%ld", (long)scale_type);
+ HDfprintf(out, "%ld", (long)scale_type);
break;
} /* end switch */
} /* end else */
@@ -2548,68 +2555,68 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 'c':
if(ptr) {
if(vp)
- fprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%lx", (unsigned long)vp);
else
- fprintf(out, "NULL");
+ HDfprintf(out, "NULL");
} /* end if */
else {
H5Z_class2_t *filter = va_arg(ap, H5Z_class2_t*);
- fprintf(out, "0x%lx", (unsigned long)filter);
+ HDfprintf(out, "0x%lx", (unsigned long)filter);
} /* end else */
break;
case 'e':
if(ptr) {
if(vp)
- fprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%lx", (unsigned long)vp);
else
- fprintf(out, "NULL");
+ HDfprintf(out, "NULL");
} /* end if */
else {
H5Z_EDC_t edc = (H5Z_EDC_t)va_arg(ap, int);
if(H5Z_DISABLE_EDC == edc)
- fprintf(out, "H5Z_DISABLE_EDC");
+ HDfprintf(out, "H5Z_DISABLE_EDC");
else if (H5Z_ENABLE_EDC == edc)
- fprintf(out, "H5Z_ENABLE_EDC");
+ HDfprintf(out, "H5Z_ENABLE_EDC");
else
- fprintf(out, "%ld", (long)edc);
+ HDfprintf(out, "%ld", (long)edc);
} /* end else */
break;
case 'f':
if(ptr) {
if(vp)
- fprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%lx", (unsigned long)vp);
else
- fprintf(out, "NULL");
+ HDfprintf(out, "NULL");
} /* end if */
else {
H5Z_filter_t id = va_arg(ap, H5Z_filter_t);
if(H5Z_FILTER_DEFLATE == id)
- fprintf(out, "H5Z_FILTER_DEFLATE");
+ HDfprintf(out, "H5Z_FILTER_DEFLATE");
else
- fprintf(out, "%ld", (long)id);
+ HDfprintf(out, "%ld", (long)id);
} /* end else */
break;
case 's':
if(ptr) {
if(vp) {
- fprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%lx", (unsigned long)vp);
if(asize_idx >= 0 && asize[asize_idx] >= 0) {
ssize_t *p = (ssize_t *)vp;
- fprintf(out, " {");
+ HDfprintf(out, " {");
for(i = 0; i < asize[asize_idx]; i++)
HDfprintf(out, "%s%Zd", (i ? ", " : ""), p[i]);
- fprintf(out, "}");
+ HDfprintf(out, "}");
} /* end if */
} /* end if */
else
- fprintf(out, "NULL");
+ HDfprintf(out, "NULL");
} /* end if */
else {
ssize_t ssize = va_arg(ap, ssize_t);
@@ -2620,32 +2627,32 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
break;
default:
- fprintf(out, "BADTYPE(Z%c)", type[1]);
+ HDfprintf(out, "BADTYPE(Z%c)", type[1]);
goto error;
} /* end switch */
break;
default:
if(HDisupper(type[0]))
- fprintf(out, "BADTYPE(%c%c)", type[0], type[1]);
+ HDfprintf(out, "BADTYPE(%c%c)", type[0], type[1]);
else
- fprintf(out, "BADTYPE(%c)", type[0]);
+ HDfprintf(out, "BADTYPE(%c)", type[0]);
goto error;
} /* end switch */
} /* end for */
/* Display event time for return */
if(returning && H5_debug_g.ttimes)
- fprintf(out, " @%.6f [dt=%.6f]", (event_time.etime - first_time.etime),
+ HDfprintf(out, " @%.6f [dt=%.6f]", (event_time.etime - first_time.etime),
(event_time.etime - *returning));
error:
va_end(ap);
if(returning)
- fprintf(out, ";\n");
+ HDfprintf(out, ";\n");
else {
last_call_depth = current_depth++;
- fprintf (out, ")");
+ HDfprintf (out, ")");
} /* end else */
HDfflush(out);
diff --git a/test/CMakeTests.cmake b/test/CMakeTests.cmake
index e6b364c..06bbd06 100644
--- a/test/CMakeTests.cmake
+++ b/test/CMakeTests.cmake
@@ -1355,6 +1355,7 @@ if (HDF5_BUILD_GENERATORS)
gen_bad_offset
gen_bad_ohdr
gen_bogus
+ gen_bounds
gen_cross
gen_deflate
gen_filters
diff --git a/test/Makefile.am b/test/Makefile.am
index efdc1ca..ab81f50 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -95,7 +95,7 @@ endif
BUILD_ALL_PROGS=gen_bad_ohdr gen_bogus gen_cross gen_deflate gen_filters gen_new_array \
gen_new_fill gen_new_group gen_new_mtime gen_new_super gen_noencoder \
gen_nullspace gen_udlinks space_overflow gen_filespace gen_specmetaread \
- gen_sizes_lheap gen_file_image gen_plist gen_bad_offset
+ gen_sizes_lheap gen_file_image gen_plist gen_bad_offset gen_bounds
if BUILD_ALL_CONDITIONAL
noinst_PROGRAMS=$(BUILD_ALL_PROGS)
diff --git a/test/chunk_info.c b/test/chunk_info.c
index 1f19963..e3006cc 100644
--- a/test/chunk_info.c
+++ b/test/chunk_info.c
@@ -21,7 +21,6 @@
*/
-#include "hdf5.h"
#include "h5test.h"
#define PRINT_DATA
diff --git a/test/dangle.c b/test/dangle.c
index 1717d12..75e9c84 100644
--- a/test/dangle.c
+++ b/test/dangle.c
@@ -15,10 +15,9 @@
* Programmer: Quincey Koziol <koziol@ncsa.uiuc.edu>
* Tuesday, May 13, 2003
*
- * Purpose: Test dangling IDs
+ * Purpose: Test dangling IDs
*/
#include "h5test.h"
-#include "H5private.h"
const char *FILENAME[] = {
"dangle",
@@ -32,17 +31,17 @@ const char *FILENAME[] = {
#define TYPENAME "Type"
#define ATTRNAME "Attribute"
-
+
/*-------------------------------------------------------------------------
- * Function: test_dangle_dataset
+ * Function: test_dangle_dataset
*
- * Purpose: Check for dangling dataset IDs causing problems on library
+ * Purpose: Check for dangling dataset IDs causing problems on library
* shutdown
*
- * Return: Success: zero
- * Failure: non-zero
+ * Return: Success: zero
+ * Failure: non-zero
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Tuesday, May 13, 2003
*
* Modifications:
@@ -52,7 +51,7 @@ const char *FILENAME[] = {
static int
test_dangle_dataset(H5F_close_degree_t degree)
{
- char filename[1024];
+ char filename[1024];
hid_t fid; /* File ID */
hid_t fapl; /* File access property list */
hid_t dsid; /* Dataset ID */
@@ -128,17 +127,17 @@ error:
return 1;
}
-
+
/*-------------------------------------------------------------------------
- * Function: test_dangle_group
+ * Function: test_dangle_group
*
- * Purpose: Check for dangling group IDs causing problems on library
+ * Purpose: Check for dangling group IDs causing problems on library
* shutdown
*
- * Return: Success: zero
- * Failure: non-zero
+ * Return: Success: zero
+ * Failure: non-zero
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Tuesday, May 13, 2003
*
* Modifications:
@@ -148,7 +147,7 @@ error:
static int
test_dangle_group(H5F_close_degree_t degree)
{
- char filename[1024];
+ char filename[1024];
hid_t fid; /* File ID */
hid_t fapl; /* File access property list */
hid_t gid; /* Group ID */
@@ -219,17 +218,17 @@ error:
return 1;
}
-
+
/*-------------------------------------------------------------------------
- * Function: test_dangle_datatype1
+ * Function: test_dangle_datatype1
*
- * Purpose: Check for dangling datatype IDs causing problems on library
+ * Purpose: Check for dangling datatype IDs causing problems on library
* shutdown
*
- * Return: Success: zero
- * Failure: non-zero
+ * Return: Success: zero
+ * Failure: non-zero
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Tuesday, May 13, 2003
*
* Modifications:
@@ -239,7 +238,7 @@ error:
static int
test_dangle_datatype1(H5F_close_degree_t degree)
{
- char filename[1024];
+ char filename[1024];
hid_t fid; /* File ID */
hid_t fapl; /* File access property list */
hid_t tid; /* Datatype ID */
@@ -315,17 +314,17 @@ error:
return 1;
}
-
+
/*-------------------------------------------------------------------------
- * Function: test_dangle_datatype2
+ * Function: test_dangle_datatype2
*
- * Purpose: Check for dangling datatype IDs causing problems on library
+ * Purpose: Check for dangling datatype IDs causing problems on library
* shutdown
*
- * Return: Success: zero
- * Failure: non-zero
+ * Return: Success: zero
+ * Failure: non-zero
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Thursday, August 25, 2005
*
* Modifications:
@@ -335,7 +334,7 @@ error:
static int
test_dangle_datatype2(H5F_close_degree_t degree)
{
- char filename[1024];
+ char filename[1024];
hid_t fid; /* File ID */
hid_t fapl; /* File access property list */
hid_t did; /* Dataset ID */
@@ -402,17 +401,17 @@ error:
return 1;
}
-
+
/*-------------------------------------------------------------------------
- * Function: test_dangle_attribute
+ * Function: test_dangle_attribute
*
- * Purpose: Check for dangling attribute IDs causing problems on library
+ * Purpose: Check for dangling attribute IDs causing problems on library
* shutdown
*
- * Return: Success: zero
- * Failure: non-zero
+ * Return: Success: zero
+ * Failure: non-zero
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Wednesday, June 18, 2003
*
* Modifications:
@@ -422,7 +421,7 @@ error:
static int
test_dangle_attribute(H5F_close_degree_t degree)
{
- char filename[1024];
+ char filename[1024];
hid_t fid; /* File ID */
hid_t fapl; /* File access property list */
hid_t dsid; /* Dataset ID */
@@ -509,17 +508,17 @@ error:
return 1;
}
-
+
/*-------------------------------------------------------------------------
- * Function: test_dangle_force
+ * Function: test_dangle_force
*
- * Purpose: Shut down all danging IDs with generic file & ID routines,
+ * Purpose: Shut down all danging IDs with generic file & ID routines,
* instead of letting library shut then down.
*
- * Return: Success: zero
- * Failure: non-zero
+ * Return: Success: zero
+ * Failure: non-zero
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Friday, October 29, 2010
*
*-------------------------------------------------------------------------
@@ -527,7 +526,7 @@ error:
static int
test_dangle_force(void)
{
- char filename[1024];
+ char filename[1024];
hid_t fid; /* File ID */
hid_t gid, gid2; /* Group IDs */
hid_t dsid, dsid2; /* Dataset IDs */
@@ -625,7 +624,7 @@ test_dangle_force(void)
/* Release object ID array */
HDfree(objs);
-
+
PASSED();
return 0;
@@ -635,16 +634,16 @@ error:
return 1;
}
-
+
/*-------------------------------------------------------------------------
- * Function: main
+ * Function: main
*
- * Purpose: Executes dangling ID tests
+ * Purpose: Executes dangling ID tests
*
- * Return: Success: zero
- * Failure: non-zero
+ * Return: Success: zero
+ * Failure: non-zero
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Tuesday, May 13, 2003
*
* Modifications:
@@ -654,7 +653,7 @@ error:
int
main(void)
{
- int nerrors=0;
+ int nerrors=0;
/* Run tests w/weak file close */
puts("Testing dangling objects with weak file close:");
diff --git a/test/dsets.c b/test/dsets.c
index 0fff2d1..17cf23c 100644
--- a/test/dsets.c
+++ b/test/dsets.c
@@ -24,8 +24,30 @@
#define H5Z_FRIEND /*suppress error about including H5Zpkg */
-#include "h5test.h"
+#include "testhdf5.h"
#include "H5srcdir.h"
+
+#include "H5Bprivate.h"
+#include "H5Iprivate.h"
+#include "H5Pprivate.h"
+
+#define H5F_FRIEND /*suppress error about including H5Fpkg */
+#define H5F_TESTING
+#include "H5Fpkg.h" /* File access */
+
+#define H5S_FRIEND /*suppress error about including H5Spkg */
+#include "H5Spkg.h" /* Dataspace */
+
+#define H5T_FRIEND /*suppress error about including H5Tpkg */
+#include "H5Tpkg.h" /* Datatype */
+
+#define H5A_FRIEND /*suppress error about including H5Apkg */
+#include "H5Apkg.h" /* Attributes */
+
+/* Use in version bound test */
+#define H5O_FRIEND /*suppress error about including H5Opkg */
+#include "H5Opkg.h" /* Object headers */
+
#include "H5Dpkg.h"
#include "H5FDpkg.h"
#include "H5VMprivate.h"
@@ -60,8 +82,10 @@ const char *FILENAME[] = {
"storage_size", /* 22 */
"dls_01_strings", /* 23 */
"power2up", /* 24 */
+ "version_bounds", /* 25 */
NULL
};
+
#define FILENAME_BUF_SIZE 1024
#define KB 1024
@@ -291,7 +315,7 @@ const H5Z_class2_t H5Z_COUNT[1] = {{
filter_count, /* The actual filter function */
}};
-
+
/*-------------------------------------------------------------------------
* Function: filter_count
*
@@ -316,7 +340,7 @@ filter_count(unsigned int flags, size_t H5_ATTR_UNUSED cd_nelmts,
return nbytes;
}
-
+
/*-------------------------------------------------------------------------
* Function: test_create
*
@@ -463,7 +487,7 @@ test_create(hid_t file)
return -1;
}
-
+
/*-------------------------------------------------------------------------
* Function: test_simple_io
*
@@ -599,7 +623,7 @@ error:
return -1;
}
-
+
/*-------------------------------------------------------------------------
* Function: test_userblock_offset
*
@@ -705,7 +729,7 @@ error:
return -1;
}
-
+
/*-------------------------------------------------------------------------
* Function: test_compact_io
*
@@ -722,10 +746,15 @@ static herr_t
test_compact_io(hid_t fapl)
{
hid_t file, dataset, space, plist;
+ hid_t verfile = -1, new_fapl = -1;
hsize_t dims[2];
int wbuf[16][8], rbuf[16][8];
char filename[FILENAME_BUF_SIZE];
+ H5F_libver_t low, high; /* File format bounds */
+ H5F_t *fp; /* Internal file pointer */
+ H5D_t *dsetp; /* Internal dataset pointer */
int i, j, n;
+ herr_t ret; /* Generic return value */
TESTING("compact dataset I/O");
@@ -764,8 +793,6 @@ test_compact_io(hid_t fapl)
if(H5Dget_offset(dataset)!=HADDR_UNDEF) TEST_ERROR
/* Close file */
- if(H5Sclose(space) < 0) TEST_ERROR
- if(H5Pclose(plist) < 0) TEST_ERROR
if(H5Dclose(dataset) < 0) TEST_ERROR
if(H5Fclose(file) < 0) TEST_ERROR
@@ -789,19 +816,113 @@ test_compact_io(hid_t fapl)
printf(" wbuf[%d][%d]=%d\n", i, j, wbuf[i][j]);
printf(" rbuf[%d][%d]=%d\n", i, j, rbuf[i][j]);
goto error;
- } /* end if */
+ } /* end */
if(H5Dclose(dataset) < 0) TEST_ERROR
if(H5Fclose(file) < 0) TEST_ERROR
- PASSED();
- return 0;
+ /**************************************
+ * Additional test for version bounds *
+ **************************************/
+
+ /* Create a copy of file access property list */
+ if((new_fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) TEST_ERROR
+
+ /* Loop through all the combinations of low/high library format bounds,
+ skipping invalid combinations.
+ - Create a file, create and write a compact dataset, and verify its data
+ - Verify the dataset's layout and fill message versions */
+ for(low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; low++) {
+ for(high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; high++) {
+
+ /* Set version bounds */
+ H5E_BEGIN_TRY {
+ ret = H5Pset_libver_bounds(new_fapl, low, high);
+ } H5E_END_TRY;
+
+ if (ret < 0) /* Invalid low/high combinations */
+ continue;
+
+ /* Create a file */
+ h5_fixname(FILENAME[25], new_fapl, filename, sizeof filename);
+ if((verfile = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, new_fapl)) < 0)
+ TEST_ERROR
+
+ /* Create the compact dataset */
+ dataset = H5Dcreate2(verfile, DSET_DEFAULT_NAME, H5T_NATIVE_INT, space, H5P_DEFAULT, plist, H5P_DEFAULT);
+ if(dataset < 0) TEST_ERROR
+
+ /* Write the same data as of DSET_COMPACT_IO_NAME */
+ if(H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, wbuf) < 0)
+ TEST_ERROR
+
+ /* Close DSET_DEFAULT_NAME, then reopen it to read and verify
+ the data */
+ if(H5Dclose(dataset) < 0) TEST_ERROR
+ if((dataset = H5Dopen2(verfile, DSET_DEFAULT_NAME, H5P_DEFAULT)) < 0)
+ TEST_ERROR
+ if(H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rbuf) < 0)
+ TEST_ERROR
+
+ /* Check that the values read are the same as the values written */
+ for(i = 0; i < 16; i++)
+ for(j = 0; j < 8; j++)
+ if(rbuf[i][j] != wbuf[i][j]) {
+ H5_FAILED();
+ printf(" Read different values than written.\n");
+ printf(" At index %d,%d\n", i, j);
+ printf(" wbuf[%d][%d]=%d\n", i, j, wbuf[i][j]);
+ printf(" rbuf[%d][%d]=%d\n", i, j, rbuf[i][j]);
+ goto error;
+ } /* end */
+
+ /* Get the internal file pointer */
+ if((fp = (H5F_t *)H5I_object(verfile)) == NULL) TEST_ERROR
+
+ /* Get the internal dataset pointer */
+ if((dsetp = (H5D_t *)H5I_object(dataset)) == NULL) TEST_ERROR
+
+ /* Verify the dataset's layout and fill message versions */
+ if(fp->shared->low_bound == H5F_LIBVER_EARLIEST) {
+ VERIFY(dsetp->shared->layout.version, H5O_LAYOUT_VERSION_DEFAULT, "layout_ver_bounds");
+ VERIFY(dsetp->shared->dcpl_cache.fill.version, H5O_FILL_VERSION_2, "fill_ver_bounds");
+ } else {
+ VERIFY(dsetp->shared->layout.version, H5O_layout_ver_bounds[fp->shared->low_bound], "layout_ver_bounds");
+ VERIFY(dsetp->shared->dcpl_cache.fill.version, H5O_fill_ver_bounds[fp->shared->low_bound], "fill_ver_bounds");
+ }
+
+ /* Close the dataset and delete from the file */
+ if(H5Dclose(dataset) < 0) TEST_ERROR
+ if(H5Ldelete(verfile, DSET_DEFAULT_NAME, H5P_DEFAULT) < 0)
+ TEST_ERROR
+
+ /* Close the file */
+ if(H5Fclose(verfile) < 0) TEST_ERROR
+
+ } /* end for high */
+ } /* end for low */
+
+ if(H5Pclose(new_fapl) < 0) TEST_ERROR
+ if(H5Sclose(space) < 0) TEST_ERROR
+ if(H5Pclose(plist) < 0) TEST_ERROR
+
+ PASSED();
+ return 0;
error:
- return -1;
+ H5E_BEGIN_TRY {
+ H5Sclose(space);
+ H5Pclose(plist);
+ H5Pclose(new_fapl);
+ H5Dclose(dataset);
+ H5Fclose(file);
+ H5Fclose(verfile);
+ } H5E_END_TRY;
+
+ return -1;
}
-
+
/*-------------------------------------------------------------------------
* Function: test_max_compact
*
@@ -954,7 +1075,7 @@ error:
return -1;
} /* end test_max_compact() */
-
+
/*-------------------------------------------------------------------------
* Function: test_layout_extend
*
@@ -1077,7 +1198,7 @@ error:
return -1;
} /* end test_layout_extend() */
-
+
/*-------------------------------------------------------------------------
* Function: test_conv_buffer
*
@@ -1216,7 +1337,7 @@ error:
return -1;
}
-
+
/*-------------------------------------------------------------------------
* Function: test_tconv
*
@@ -1311,7 +1432,7 @@ const H5Z_class2_t H5Z_BOGUS[1] = {{
filter_bogus, /* The actual filter function */
}};
-
+
/*-------------------------------------------------------------------------
* Function: can_apply_bogus
*
@@ -1333,7 +1454,7 @@ can_apply_bogus(hid_t H5_ATTR_UNUSED dcpl_id, hid_t type_id, hid_t H5_ATTR_UNUSE
return -1;
}
-
+
/*-------------------------------------------------------------------------
* Function: filter_bogus
*
@@ -1351,7 +1472,7 @@ filter_bogus(unsigned int H5_ATTR_UNUSED flags, size_t H5_ATTR_UNUSED cd_nelmts,
return nbytes;
}
-
+
/*-------------------------------------------------------------------------
* Function: set_local_bogus2
*
@@ -1397,7 +1518,7 @@ set_local_bogus2(hid_t dcpl_id, hid_t type_id, hid_t H5_ATTR_UNUSED space_id)
return(SUCCEED);
} /* end set_local_bogus2() */
-
+
/*-------------------------------------------------------------------------
* Function: filter_bogus2
*
@@ -1451,7 +1572,7 @@ filter_bogus2(unsigned int flags, size_t cd_nelmts,
return(nbytes);
}
-
+
/*-------------------------------------------------------------------------
* Function: filter_bogus3
*
@@ -1480,7 +1601,7 @@ const H5Z_class2_t H5Z_CORRUPT[1] = {{
filter_corrupt, /* The actual filter function */
}};
-
+
/*-------------------------------------------------------------------------
* Function: filter_corrupt
*
@@ -1539,7 +1660,7 @@ error:
return ret_value;
} /* end filter_corrupt() */
-
+
/*-------------------------------------------------------------------------
* Function: filter_cb_cont
*
@@ -1558,7 +1679,7 @@ filter_cb_cont(H5Z_filter_t filter, void H5_ATTR_UNUSED *buf, size_t H5_ATTR_UNU
return H5Z_CB_FAIL;
}
-
+
/*-------------------------------------------------------------------------
* Function: filter_cb_fail
*
@@ -1577,7 +1698,7 @@ filter_cb_fail(H5Z_filter_t filter, void H5_ATTR_UNUSED *buf, size_t H5_ATTR_UNU
return H5Z_CB_CONT;
}
-
+
/*-------------------------------------------------------------------------
* Function: test_filter_internal
*
@@ -2388,7 +2509,7 @@ error:
return -1;
}
-
+
/*-------------------------------------------------------------------------
* Function: test_missing_filter
*
@@ -2716,7 +2837,7 @@ error:
return -1;
}
-
+
/*-------------------------------------------------------------------------
* Function: test_nbit_int
*
@@ -2834,7 +2955,7 @@ error:
return -1;
}
-
+
/*-------------------------------------------------------------------------
* Function: test_nbit_float
*
@@ -2952,7 +3073,7 @@ error:
return -1;
}
-
+
/*-------------------------------------------------------------------------
* Function: test_nbit_double
*
@@ -3084,7 +3205,7 @@ error:
return -1;
}
-
+
/*-------------------------------------------------------------------------
* Function: test_nbit_array
*
@@ -3211,7 +3332,7 @@ error:
return -1;
}
-
+
/*-------------------------------------------------------------------------
* Function: test_nbit_compound
*
@@ -3428,7 +3549,7 @@ error:
return -1;
}
-
+
/*-------------------------------------------------------------------------
* Function: test_nbit_compound_2
*
@@ -3773,7 +3894,7 @@ error:
return -1;
}
-
+
/*-------------------------------------------------------------------------
* Function: test_nbit_compound_3
*
@@ -3953,7 +4074,7 @@ error:
return -1;
}
-
+
/*-------------------------------------------------------------------------
* Function: test_nbit_int_size
*
@@ -4120,7 +4241,7 @@ error:
return -1;
}
-
+
/*-------------------------------------------------------------------------
* Function: test_nbit_flt_size
*
@@ -4316,7 +4437,7 @@ test_nbit_flt_size(hid_t file)
error:
return -1;
}
-
+
/*-------------------------------------------------------------------------
* Function: test_scaleoffset_int
*
@@ -4428,7 +4549,7 @@ error:
return -1;
}
-
+
/*-------------------------------------------------------------------------
* Function: test_scaleoffset_int_2
*
@@ -4556,7 +4677,7 @@ error:
return -1;
}
-
+
/*-------------------------------------------------------------------------
* Function: test_scaleoffset_float
*
@@ -4669,7 +4790,7 @@ error:
return -1;
}
-
+
/*-------------------------------------------------------------------------
* Function: test_scaleoffset_float_2
*
@@ -4798,7 +4919,7 @@ error:
return -1;
}
-
+
/*-------------------------------------------------------------------------
* Function: test_scaleoffset_double
*
@@ -4911,7 +5032,7 @@ error:
return -1;
}
-
+
/*-------------------------------------------------------------------------
* Function: test_scaleoffset_double_2
*
@@ -5041,20 +5162,20 @@ error:
return -1;
}
-
+
/*-------------------------------------------------------------------------
* Function: test_multiopen
*
- * Purpose: Tests that a bug no longer exists. If a dataset is opened
- * twice and one of the handles is used to extend the dataset,
- * then the other handle should return the new size when
- * queried.
+ * Purpose: Tests that a bug no longer exists. If a dataset is opened
+ * twice and one of the handles is used to extend the dataset,
+ * then the other handle should return the new size when
+ * queried.
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: -1
+ * Failure: -1
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Tuesday, June 9, 1998
*
*-------------------------------------------------------------------------
@@ -5062,10 +5183,10 @@ error:
static herr_t
test_multiopen (hid_t file)
{
- hid_t dcpl = -1, space = -1, dset1 = -1, dset2 = -1;
- hsize_t cur_size[1] = {10};
- static hsize_t max_size[1] = {H5S_UNLIMITED};
- hsize_t tmp_size[1];
+ hid_t dcpl = -1, space = -1, dset1 = -1, dset2 = -1;
+ hsize_t cur_size[1] = {10};
+ hsize_t tmp_size[1];
+ static hsize_t max_size[1] = {H5S_UNLIMITED};
TESTING("multi-open with extending");
@@ -5085,9 +5206,9 @@ test_multiopen (hid_t file)
if((space = H5Dget_space(dset2)) < 0) goto error;
if(H5Sget_simple_extent_dims(space, tmp_size, NULL) < 0) goto error;
if(cur_size[0] != tmp_size[0]) {
- H5_FAILED();
- printf(" Got %d instead of %d!\n", (int)tmp_size[0], (int)cur_size[0]);
- goto error;
+ H5_FAILED();
+ printf(" Got %d instead of %d!\n", (int)tmp_size[0], (int)cur_size[0]);
+ goto error;
} /* end if */
if(H5Dclose(dset1) < 0) goto error;
@@ -5108,7 +5229,7 @@ test_multiopen (hid_t file)
return -1;
}
-
+
/*-------------------------------------------------------------------------
* Function: test_types
*
@@ -5215,7 +5336,7 @@ const H5Z_class2_t H5Z_CAN_APPLY_TEST[1] = {{
filter_bogus, /* The actual filter function */
}};
-
+
/*-------------------------------------------------------------------------
* Function: test_can_apply
*
@@ -5396,7 +5517,7 @@ const H5Z_class2_t H5Z_CAN_APPLY_TEST2[1] = {{
filter_bogus3, /* The actual filter function */
}};
-
+
/*-------------------------------------------------------------------------
* Function: test_can_apply2
*
@@ -5545,7 +5666,7 @@ error:
} /* end test_can_apply2() */
-
+
/*-------------------------------------------------------------------------
* Function: test_can_apply_szip
*
@@ -5750,7 +5871,7 @@ const H5Z_class2_t H5Z_SET_LOCAL_TEST[1] = {{
filter_bogus2, /* The actual filter function */
}};
-
+
/*-------------------------------------------------------------------------
* Function: test_set_local
*
@@ -6015,7 +6136,7 @@ error:
return -1;
} /* end test_set_local() */
-
+
/*-------------------------------------------------------------------------
* Function: test_compare_dcpl
*
@@ -6100,7 +6221,7 @@ error:
return -1;
} /* end test_compare_dcpl() */
-
+
/*-------------------------------------------------------------------------
* Function: test_copy_dcpl
*
@@ -6232,7 +6353,7 @@ error:
return -1;
} /* end test_copy_dcpl() */
-
+
/*-------------------------------------------------------------------------
* Function: test_filter_delete
*
@@ -6359,7 +6480,7 @@ error:
} /* end test_filter_delete() */
-
+
/*-------------------------------------------------------------------------
* Function: auxread_fdata
*
@@ -6443,7 +6564,7 @@ error:
return -1;
}
-
+
/*-------------------------------------------------------------------------
* Function: test_filters_endianess
*
@@ -6513,7 +6634,7 @@ error:
return -1;
} /* end test_filters_endianess() */
-
+
/*-------------------------------------------------------------------------
* Function: test_zero_dims
*
@@ -6677,7 +6798,7 @@ error:
return -1;
} /* end test_zero_dims() */
-
+
/*-------------------------------------------------------------------------
* Function: test_missing_chunk
*
@@ -6869,7 +6990,7 @@ error:
return -1;
} /* end test_missing_chunk() */
-
+
/*-------------------------------------------------------------------------
* Function: test_random_chunks_real
*
@@ -7237,7 +7358,7 @@ error:
return -1;
} /* end test_random_chunks_real() */
-
+
/*-------------------------------------------------------------------------
* Function: test_random_chunks
*
@@ -7297,7 +7418,7 @@ const H5Z_class1_t H5Z_DEPREC[1] = {{
filter_bogus, /* The actual filter function */
}};
-
+
/*-------------------------------------------------------------------------
* Function: test_deprec
*
@@ -7488,7 +7609,7 @@ test_deprec(hid_t file)
} /* end test_deprec() */
#endif /* H5_NO_DEPRECATED_SYMBOLS */
-
+
/*-------------------------------------------------------------------------
* Function: test_huge_chunks
*
@@ -7600,7 +7721,7 @@ error:
return -1;
} /* end test_huge_chunks() */
-
+
/*-------------------------------------------------------------------------
* Function: test_chunk_cache
*
@@ -7808,7 +7929,7 @@ error:
return -1;
} /* end test_chunk_cache() */
-
+
/*-------------------------------------------------------------------------
* Function: test_big_chunks_bypass_cache
*
@@ -8101,7 +8222,7 @@ error:
return -1;
} /* end test_big_chunks_bypass_cache() */
-
+
/*-------------------------------------------------------------------------
* Function: test_chunk_fast
*
@@ -8448,7 +8569,7 @@ error:
return -1;
} /* end test_chunk_fast() */
-
+
/*-------------------------------------------------------------------------
* Function: test_reopen_chunk_fast
*
@@ -8571,7 +8692,7 @@ error:
return -1;
} /* end test_reopen_chunk_fast() */
-
+
/*-------------------------------------------------------------------------
* Function: test_chunk_fast_bug1
*
@@ -8693,7 +8814,7 @@ const H5Z_class2_t H5Z_EXPAND[1] = {{
/* Global "expansion factor" for filter_expand() routine */
static size_t filter_expand_factor_g = 0;
-
+
/*-------------------------------------------------------------------------
* Function: filter_expand
*
@@ -8742,7 +8863,7 @@ filter_expand(unsigned int flags, size_t H5_ATTR_UNUSED cd_nelmts,
return ret_value;
} /* end filter_expand() */
-
+
/*-------------------------------------------------------------------------
* Function: test_chunk_expand
*
@@ -9138,7 +9259,7 @@ error:
return -1;
} /* end test_chunk_expand() */
-
+
/*-------------------------------------------------------------------------
* Function: test_fixed_array
*
@@ -9557,7 +9678,7 @@ error:
return -1;
} /* end test_fixed_array() */
-
+
/*-------------------------------------------------------------------------
* Function: test_single_chunk
*
@@ -9790,6 +9911,7 @@ test_single_chunk(hid_t fapl)
} /* end for */
#endif /* H5_HAVE_FILTER_DEFLATE */
+
/* Release buffers */
HDfree(wbuf);
HDfree(rbuf);
@@ -9820,7 +9942,7 @@ error:
return -1;
} /* end test_single_chunk() */
-
+
/*-------------------------------------------------------------------------
*
* test_idx_compatible():
@@ -10033,7 +10155,7 @@ error:
return -1;
} /* test_unfiltered_edge_chunks */
-
+
/*-------------------------------------------------------------------------
* Function: test_large_chunk_shrink
*
@@ -10148,11 +10270,11 @@ error:
return -1;
} /* end test_large_chunk_shrink() */
-
+
/*-------------------------------------------------------------------------
* Function: test_zero_dim_dset
*
- * Purpose: Tests support for reading a 1D chunled dataset with
+ * Purpose: Tests support for reading a 1D chunked dataset with
* dimension size = 0.
*
* Return: Success: 0
@@ -10173,40 +10295,59 @@ test_zero_dim_dset(hid_t fapl)
hid_t dsid = -1; /* Dataset ID */
hsize_t dim, chunk_dim; /* Dataset and chunk dimensions */
int data[1];
+ H5F_libver_t low, high; /* File format bounds */
+ herr_t ret; /* Generic return value */
- TESTING("shrinking large chunk");
+ TESTING("chunked dataset with zero dimension");
- h5_fixname(FILENAME[16], fapl, filename, sizeof filename);
+ /* Loop through all the combinations of low/high library format bounds,
+ skipping invalid combination, and verify support for reading a 1D
+ chunked dataset with dimension size = 0 */
+ for(low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; low++) {
+ for(high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; high++) {
- /* Create file */
- if((fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) FAIL_STACK_ERROR
+ /* Set version bounds before opening the file */
+ H5E_BEGIN_TRY {
+ ret = H5Pset_libver_bounds(fapl, low, high);
+ } H5E_END_TRY;
- /* Create dataset creation property list */
- if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) FAIL_STACK_ERROR
+ if (ret < 0) /* Invalid low/high combinations */
+ continue;
- /* Set 1 chunk size */
- chunk_dim = 1;
- if(H5Pset_chunk(dcpl, 1, &chunk_dim) < 0) FAIL_STACK_ERROR
+ h5_fixname(FILENAME[16], fapl, filename, sizeof filename);
- /* Create 1D dataspace with 0 dim size */
- dim = 0;
- if((sid = H5Screate_simple(1, &dim, NULL)) < 0) FAIL_STACK_ERROR
+ /* Create file */
+ if((fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) FAIL_STACK_ERROR
- /* Create chunked dataset */
- if((dsid = H5Dcreate2(fid, "dset", H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0)
- FAIL_STACK_ERROR
+ /* Create dataset creation property list */
+ if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) FAIL_STACK_ERROR
- /* write 0 elements from dataset */
- if(H5Dwrite(dsid, H5T_NATIVE_INT, sid, sid, H5P_DEFAULT, data) < 0) FAIL_STACK_ERROR
+ /* Set 1 chunk size */
+ chunk_dim = 1;
+ if(H5Pset_chunk(dcpl, 1, &chunk_dim) < 0) FAIL_STACK_ERROR
- /* Read 0 elements from dataset */
- if(H5Dread(dsid, H5T_NATIVE_INT, sid, sid, H5P_DEFAULT, data) < 0) FAIL_STACK_ERROR
+ /* Create 1D dataspace with 0 dim size */
+ dim = 0;
+ if((sid = H5Screate_simple(1, &dim, NULL)) < 0) FAIL_STACK_ERROR
- /* Close everything */
- if(H5Sclose(sid) < 0) FAIL_STACK_ERROR
- if(H5Dclose(dsid) < 0) FAIL_STACK_ERROR
- if(H5Pclose(dcpl) < 0) FAIL_STACK_ERROR
- if(H5Fclose(fid) < 0) FAIL_STACK_ERROR
+ /* Create chunked dataset */
+ if((dsid = H5Dcreate2(fid, "dset", H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
+
+ /* write 0 elements from dataset */
+ if(H5Dwrite(dsid, H5T_NATIVE_INT, sid, sid, H5P_DEFAULT, data) < 0) FAIL_STACK_ERROR
+
+ /* Read 0 elements from dataset */
+ if(H5Dread(dsid, H5T_NATIVE_INT, sid, sid, H5P_DEFAULT, data) < 0) FAIL_STACK_ERROR
+
+ /* Close everything */
+ if(H5Sclose(sid) < 0) FAIL_STACK_ERROR
+ if(H5Dclose(dsid) < 0) FAIL_STACK_ERROR
+ if(H5Pclose(dcpl) < 0) FAIL_STACK_ERROR
+ if(H5Fclose(fid) < 0) FAIL_STACK_ERROR
+
+ } /* end for high */
+ } /* end for low */
PASSED();
@@ -10222,7 +10363,7 @@ error:
return -1;
} /* end test_zero_dim_dset() */
-
+
/*-------------------------------------------------------------------------
* Function: test_swmr_non_latest
*
@@ -10471,7 +10612,7 @@ error:
return -1;
} /* test_swmr_non_latest() */
-
+
/*-------------------------------------------------------------------------
* Function: test_earray_hdr_fd
*
@@ -10591,7 +10732,7 @@ error:
return -1;
} /* test_earray_hdr_fd() */
-
+
/*-------------------------------------------------------------------------
* Function: test_farray_hdr_fd
*
@@ -10711,7 +10852,7 @@ error:
return -1;
} /* test_farray_hdr_fd() */
-
+
/*-------------------------------------------------------------------------
* Function: test_bt2_hdr_fd
*
@@ -10831,7 +10972,7 @@ error:
return -1;
} /* test_bt2_hdr_fd() */
-
+
/*-------------------------------------------------------------------------
* Function: test_storage_size
*
@@ -11225,7 +11366,7 @@ error:
return -1;
} /* end test_storage_size() */
-
+
/*-------------------------------------------------------------------------
* Function: test_power2up
*
@@ -11316,7 +11457,7 @@ error:
return -1;
} /* end test_power2up() */
-
+
/*-------------------------------------------------------------------------
* Function: test_scatter
*
@@ -11634,7 +11775,7 @@ error:
return -1;
} /* end test_scatter() */
-
+
/*-------------------------------------------------------------------------
* Function: test_gather
*
@@ -11996,7 +12137,7 @@ error:
return -1;
} /* end test_gather() */
-
+
/*-------------------------------------------------------------------------
* Function: test_scatter_error
*
@@ -12199,7 +12340,7 @@ error:
return -1;
} /* end test_scatter_error() */
-
+
/*-------------------------------------------------------------------------
* Function: test_gather_error
*
@@ -12726,36 +12867,188 @@ error:
return -1;
} /* test_compact_open_close_dirty() */
-
+
/*-------------------------------------------------------------------------
- * Function: main
+ * Function: test_versionbounds
*
- * Purpose: Tests the dataset interface (H5D)
+ * Purpose: Tests various format versions.
+ * (Currently, only virtual dataset feature)
*
- * Return: Success: exit(EXIT_SUCCESS)
+ * Return: Success: 0
+ * Failure: -1
+ * Description:
+ * This function attempts to create a virtual dataset in all
+ * valid combinations of low/high library format bounds. Creation
+ * of virtual dataset should only succeed in H5F_LIBVER_V110.
+ * -BMR, January 2018
*
- * Failure: exit(EXIT_FAILURE)
+ *-------------------------------------------------------------------------
+ */
+#define VDS_FNAME1 "virtual_file1"
+#define VDS_FNAME2 "virtual_file2"
+#define SRC_FNAME "source_file"
+#define SRC_DSET "src_dset"
+#define V_DSET "v_dset"
+static herr_t
+test_versionbounds()
+{
+ hid_t fapl = -1;
+ hid_t srcfile = -1; /* Files with source dsets */
+ hid_t vfile = -1; /* File with virtual dset */
+ hid_t dcpl = -1; /* Dataset creation property list */
+ hid_t srcspace = -1; /* Source dataspaces */
+ hid_t vspace = -1; /* Virtual dset dataspaces */
+ hid_t srcdset = -1; /* Source datset */
+ hid_t vdset = -1; /* Virtual dataset */
+ hid_t null_dspace = -1; /* Data space of H5S_NULL */
+ hsize_t dims[1] = {3}; /* Data space current size */
+ char srcfilename[FILENAME_BUF_SIZE];
+ char vfilename1[FILENAME_BUF_SIZE];
+ char vfilename2[FILENAME_BUF_SIZE];
+ H5F_libver_t low, high; /* File format bounds */
+ herr_t ret; /* Generic return value */
+
+ TESTING("version bounds of datasets");
+
+ /* Create a copy of file access property list */
+ if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) TEST_ERROR
+
+ h5_fixname(VDS_FNAME1, fapl, vfilename1, sizeof vfilename1);
+ h5_fixname(VDS_FNAME2, fapl, vfilename2, sizeof vfilename2);
+ h5_fixname(SRC_FNAME, fapl, srcfilename, sizeof srcfilename);
+
+ /* Create DCPL */
+ if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0)
+ TEST_ERROR
+
+ /* Clear virtual layout in DCPL */
+ if(H5Pset_layout(dcpl, H5D_VIRTUAL) < 0)
+ TEST_ERROR
+
+ /* Create source dataspace */
+ if((srcspace = H5Screate_simple(1, dims, NULL)) < 0)
+ TEST_ERROR
+
+ /* Create virtual dataspace */
+ if((vspace = H5Screate_simple(1, dims, NULL)) < 0)
+ TEST_ERROR
+
+ /* Add virtual layout mapping */
+ if(H5Pset_virtual(dcpl, vspace, srcfilename, SRC_DSET, srcspace) < 0)
+ TEST_ERROR
+
+ /* Loop through all the combinations of low/high library format bounds */
+ /* Create a source file and a dataset in it. Create a virtual file and
+ virtual dataset. Creation of virtual dataset should only succeed in
+ H5F_LIBVER_V110 */
+ for(low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; low++) {
+ for(high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; high++) {
+
+ /* Set version bounds, skip for invalid low/high combination */
+ H5E_BEGIN_TRY {
+ ret = H5Pset_libver_bounds(fapl, low, high);
+ } H5E_END_TRY;
+
+ if (ret < 0) /* Invalid low/high combinations */
+ continue;
+
+ /* Create a source file and dataset */
+ if((srcfile = H5Fcreate(srcfilename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
+ TEST_ERROR
+ if((srcdset = H5Dcreate2(srcfile, SRC_DSET, H5T_NATIVE_INT, srcspace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ TEST_ERROR
+
+ /* Create a virtual file */
+ if((vfile = H5Fcreate(vfilename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
+ TEST_ERROR
+
+ /* Create the virtual dataset */
+ H5E_BEGIN_TRY {
+ vdset = H5Dcreate2(vfile, V_DSET, H5T_NATIVE_INT, vspace, H5P_DEFAULT, dcpl, H5P_DEFAULT);
+ } H5E_END_TRY;
+
+ if (vdset > 0) /* dataset created successfully */
+ {
+ /* Virtual dataset is only available starting in V110 */
+ VERIFY(high, H5F_LIBVER_V110, "virtual dataset");
+
+ if(H5Dclose(vdset) < 0) TEST_ERROR
+ vdset = -1;
+ }
+
+ /* Close virtual file */
+ if(H5Fclose(vfile) < 0) TEST_ERROR
+ vfile = -1;
+
+ /* Close srcdset and srcfile */
+ if(H5Dclose(srcdset) < 0) TEST_ERROR
+ srcdset = -1;
+
+ if(H5Fclose(srcfile) < 0) TEST_ERROR
+ srcfile = -1;
+
+ } /* for high */
+ } /* for low */
+
+ /* Close dataspaces and properties */
+ if(H5Sclose(srcspace) < 0)
+ TEST_ERROR
+ srcspace = -1;
+ if(H5Sclose(vspace) < 0)
+ TEST_ERROR
+ vspace = -1;
+ if(H5Pclose(fapl) < 0)
+ TEST_ERROR
+ fapl = -1;
+ if(H5Pclose(dcpl) < 0)
+ TEST_ERROR
+ dcpl = -1;
+ PASSED();
+ return 0;
+
+ error:
+ H5E_BEGIN_TRY {
+ H5Sclose(srcspace);
+ H5Sclose(vspace);
+ H5Pclose(dcpl);
+ H5Pclose(fapl);
+ H5Dclose(srcdset);
+ H5Dclose(vdset);
+ H5Fclose(srcfile);
+ H5Fclose(vfile);
+ } H5E_END_TRY;
+ return -1;
+} /* test_versionbounds() */
+
+
+/*-------------------------------------------------------------------------
+ * Function: main
*
- * Programmer: Robb Matzke
- * Tuesday, December 9, 1997
+ * Purpose: Tests the dataset interface (H5D)
+ *
+ * Return: Success: exit(EXIT_SUCCESS)
+ * Failure: exit(EXIT_FAILURE)
+ *
+ * Programmer: Robb Matzke
+ * Tuesday, December 9, 1997
*
*-------------------------------------------------------------------------
*/
int
main(void)
{
- char filename[FILENAME_BUF_SIZE];
- hid_t file, grp, fapl, fapl2;
- hid_t fcpl = -1, fcpl2 = -1;
+ char filename[FILENAME_BUF_SIZE];
+ hid_t file, grp, fapl, fapl2;
+ hid_t fcpl = -1, fcpl2 = -1;
unsigned new_format;
unsigned paged;
- int mdc_nelmts;
- size_t rdcc_nelmts;
- size_t rdcc_nbytes;
- double rdcc_w0;
- int nerrors = 0;
+ int mdc_nelmts;
+ size_t rdcc_nelmts;
+ size_t rdcc_nbytes;
+ double rdcc_w0;
+ int nerrors = 0;
const char *envval;
- hbool_t contig_addr_vfd; /* Whether VFD used has a contigous address space */
+ hbool_t contig_addr_vfd; /* Whether VFD used has a contigous address space */
/* Don't run this test using certain file drivers */
envval = HDgetenv("HDF5_DRIVER");
@@ -12924,6 +13217,9 @@ main(void)
nerrors += (test_scatter_error() < 0 ? 1 : 0);
nerrors += (test_gather_error() < 0 ? 1 : 0);
+ /* Tests version bounds using its own file */
+ nerrors += (test_versionbounds() < 0 ? 1 : 0);
+
/* Run misc tests */
nerrors += dls_01_main();
diff --git a/test/fheap.c b/test/fheap.c
index 6c3a8ac..1be952f 100644
--- a/test/fheap.c
+++ b/test/fheap.c
@@ -16458,6 +16458,33 @@ main(void)
if(H5Pset_file_space_strategy(fcpl, H5F_FSPACE_STRATEGY_FSM_AGGR, TRUE, (hsize_t)1) < 0)
TEST_ERROR
fapl = def_fapl;
+ /* This is a fix for the daily test failure from the checkin for libver bounds. */
+ /*
+ * Many tests failed the file size check when comparing (a) and (b) as below:
+ * --Create a file and close the file. Got the initial file size (a).
+ * --Reopen the file, perform fractal heap operations, and close the file.
+ * Got the file size (b).
+ * The cause for the file size differences:
+ * When the file is initially created with persisting free-space and with
+ * (earliest, latest) libver bounds, the file will have version 2 superblock
+ * due to non-default free-space handling. As the low bound is earliest,
+ * the library uses version 1 object header when creating the superblock
+ * extension message.
+ * When the file is reopened with the same libver bounds, the file's low
+ * bound is upgraded to v18 because the file has version 2 superblock.
+ * When the library creates the superblock extension message on file close,
+ * the library uses version 2 object header for the superblock extension
+ * message since the low bound is v18.
+ * This leads to the discrepancy in file sizes as the file is persisting
+ * free-space and there is object header version differences.
+ * The fix:
+ * Set libver bounds in fapl to (v18, latest) so that the file created in the
+ * test routines will have low bound set to v18. This will cause the
+ * library to use version 2 object header for the superblock extension
+ * message.
+ */
+ if(H5Pset_libver_bounds(fapl, H5F_LIBVER_V18, H5F_LIBVER_LATEST) < 0)
+ TEST_ERROR
break;
case 2:
if(H5Pset_file_space_strategy(fcpl, H5F_FSPACE_STRATEGY_PAGE, FALSE, (hsize_t)1) < 0)
diff --git a/test/gen_bounds.c b/test/gen_bounds.c
new file mode 100644
index 0000000..9702176
--- /dev/null
+++ b/test/gen_bounds.c
@@ -0,0 +1,606 @@
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * Copyright by The HDF Group. *
+ * Copyright by the Board of Trustees of the University of Illinois. *
+ * All rights reserved. *
+ * *
+ * This file is part of HDF5. The full HDF5 copyright notice, including *
+ * terms governing use, modification, and redistribution, is contained in *
+ * the COPYING file, which can be found at the root of the source code *
+ * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. *
+ * If you do not have access to either file, you may request a copy from *
+ * help@hdfgroup.org. *
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
+/*
+ * Purpose: This program is to generate HDF5 data files used to test
+ * version bounds.
+ *
+ * Description
+ * ===========
+ * gen_bounds.c will generate the following files:
+ * - bounds_earliest_latest.h5
+ * - bounds_earliest_v18.h5
+ * - bounds_latest_latest.h5
+ * - bounds_v18_latest.h5
+ * - bounds_v18_v18.h5
+ * These files are copied to 1.6 and 1.8 libraries for verifying
+ * that they can or cannot read particular file format.
+ */
+
+#include "h5test.h"
+
+/***********************************************************************
+ * gen_earliest_latest() creates file "bounds_earliest_latest.h5"
+ *
+ * File contents:
+ * - Version 0 superblock (default)
+ * - A chunked dataset with layout version 3, "DS_chunked_layout_3". (default)
+ * - A chunked dataset with layout version 4, "DS_chunked_layout_4". (H5Pset_chunk_opts)
+ *
+ * Return: SUCCEED/FAIL
+ *
+ ***********************************************************************/
+
+/* File names for different file format */
+#define FILENAME_E_L "bounds_earliest_latest.h5"
+#define FILENAME_E_18 "bounds_earliest_v18.h5"
+#define FILENAME_L_L "bounds_latest_latest.h5"
+#define FILENAME_18_L "bounds_v18_latest.h5"
+#define FILENAME_18_18 "bounds_v18_v18.h5"
+
+/* 2-D dataset with fixed dimensions */
+#define RANK 2
+#define DIM1 100
+#define DIM2 200
+#define CHK_DIM1 50
+#define CHK_DIM2 50
+
+static herr_t gen_earliest_latest(void)
+{
+ hid_t fid = -1; /* File ID */
+ hid_t fapl = -1; /* File access property list ID */
+ hid_t fcpl = -1; /* File creation property list ID */
+ hid_t dcpl = -1; /* Dataset creation property list ID */
+ hid_t space = -1; /* Dataspace ID */
+ hid_t dset = -1; /* Dataset ID */
+ float *buf = NULL; /* Buffer for writing data */
+ float *bufp = NULL; /* Pointer to data buffer */
+ hsize_t dims[RANK] = {DIM1, DIM2}; /* Dimensions */
+ hsize_t chunk_dims[RANK] = {CHK_DIM1, CHK_DIM2}; /* Dimensions of chunk */
+ int i, j;
+ herr_t ret = SUCCEED; /* Generic return value */
+
+ /* Create file creation property list */
+ if((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0) TEST_ERROR;
+
+ /* Create file access property list */
+ if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) TEST_ERROR;
+
+ /* Set the "use the earliest/latest version of the format" bounds
+ for creating objects in the file */
+ if(H5Pset_libver_bounds(fapl, H5F_LIBVER_EARLIEST, H5F_LIBVER_LATEST) < 0)
+ TEST_ERROR;
+
+ /* Create file */
+ if((fid = H5Fcreate(FILENAME_E_L, H5F_ACC_TRUNC, fcpl, fapl)) <0)
+ TEST_ERROR;
+
+ /* Close file property lists */
+ if(H5Pclose(fapl) < 0) TEST_ERROR;
+ if(H5Pclose(fcpl) < 0) TEST_ERROR;
+
+ /*
+ * Add a chunked dataset with layout version 3 (default)
+ */
+ buf = (float *)HDmalloc((size_t)DIM1 * (size_t)DIM2 * sizeof(float));
+ if (buf == NULL) TEST_ERROR;
+
+ /* Fill sample data */
+ bufp = buf;
+ for (i = 0; i < DIM1; i++)
+ for (j = 0; j < DIM2; j++)
+ *bufp = 100.0F;
+
+ /* Create the dataspace */
+ if((space = H5Screate_simple(RANK, dims, NULL)) < 0) TEST_ERROR;
+
+ /* Create the dataset creation property list */
+ if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) TEST_ERROR;
+
+ /* Set up for chunked data */
+ if(H5Pset_chunk(dcpl, 2, chunk_dims) < 0) TEST_ERROR;
+
+ /* Create and write the dataset */
+ dset = H5Dcreate2(fid, "DS_chunked_layout_3", H5T_NATIVE_FLOAT, space, H5P_DEFAULT, dcpl, H5P_DEFAULT);
+ if (dset < 0) TEST_ERROR;
+
+ ret = H5Dwrite(dset, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf);
+ if (ret < 0) TEST_ERROR;
+
+ /* Close property list and dataset, will reuse dataspace */
+ if(H5Pclose(dcpl) < 0) TEST_ERROR;
+ if(H5Dclose(dset) < 0) TEST_ERROR;
+
+ /*
+ * Add a chunked dataset with layout version 4 (H5Pset_chunk_opts)
+ */
+
+ /* Create the dataset creation property list */
+ if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) TEST_ERROR;
+
+ /* Set up for chunked data */
+ if(H5Pset_chunk(dcpl, 2, chunk_dims) < 0) TEST_ERROR;
+
+ /* Disable partial chunk filters, triggers layout version 4 */
+ if(H5Pset_chunk_opts(dcpl, H5D_CHUNK_DONT_FILTER_PARTIAL_CHUNKS) < 0)
+ TEST_ERROR;
+
+ /* Create and write the dataset */
+ dset = H5Dcreate2(fid, "DS_chunked_layout_4", H5T_NATIVE_FLOAT, space, H5P_DEFAULT, dcpl, H5P_DEFAULT);
+ if (dset < 0) TEST_ERROR;
+ ret = H5Dwrite(dset, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf);
+ if (ret < 0) TEST_ERROR;
+
+ /* Release allocated buffer */
+ HDfree(buf);
+ bufp = buf = NULL;
+
+ /* Close everything */
+ if(H5Pclose(dcpl) < 0) TEST_ERROR;
+ if(H5Dclose(dset) < 0) TEST_ERROR;
+ if(H5Sclose(space) < 0) TEST_ERROR;
+ if(H5Fclose(fid) < 0) TEST_ERROR;
+
+ return SUCCEED;
+
+error:
+ H5E_BEGIN_TRY {
+ H5Dclose(dset);
+ H5Sclose(space);
+ H5Pclose(dcpl);
+ H5Pclose(fcpl);
+ H5Pclose(fapl);
+ H5Fclose(fid);
+ HDfree(buf);
+ } H5E_END_TRY;
+ return FAIL;
+} /* gen_earliest_latest */
+
+/***********************************************************************
+ * gen_earliest_v18() creates file "bounds_earliest_v18.h5"
+ *
+ * File contents:
+ * - Version 0 superblock (default)
+ * - A chunked dataset with layout version 3, "DS_chunked_layout_3". (default)
+ *
+ * Return: SUCCEED/FAIL
+ *
+ ***********************************************************************/
+static herr_t gen_earliest_v18(void)
+{
+ hid_t fid = -1; /* File ID */
+ hid_t fapl = -1; /* File access property list ID */
+ hid_t fcpl = -1; /* File creation property list ID */
+ hid_t dcpl = -1; /* Dataset creation property list ID */
+ hid_t space = -1; /* Dataspace ID */
+ hid_t dset = -1; /* Dataset ID */
+ float *buf = NULL; /* Buffer for writing data */
+ float *bufp = NULL; /* Pointer to data buffer */
+ hsize_t dims[RANK] = {DIM1, DIM2}; /* Dimensions */
+ hsize_t chunk_dims[RANK] = {CHK_DIM1, CHK_DIM2}; /* Dimensions of chunk */
+ int i, j;
+ herr_t ret = SUCCEED; /* Generic return value */
+
+ /* Create file creation property list */
+ if((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0) TEST_ERROR;
+
+ /* Create file access property list */
+ if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) TEST_ERROR;
+
+ /* Set the "use the earliest/v18 version of the format" bounds
+ for creating objects in the file */
+ if(H5Pset_libver_bounds(fapl, H5F_LIBVER_EARLIEST, H5F_LIBVER_V18) < 0)
+ TEST_ERROR;
+
+ /* Create file */
+ if((fid = H5Fcreate(FILENAME_E_18, H5F_ACC_TRUNC, fcpl, fapl)) <0)
+ TEST_ERROR;
+
+ /* Close file property lists */
+ if(H5Pclose(fapl) < 0) TEST_ERROR;
+ if(H5Pclose(fcpl) < 0) TEST_ERROR;
+
+ /*
+ * Add a chunked dataset with layout version 3 (default)
+ */
+
+ buf = (float *)HDmalloc((size_t)DIM1 * (size_t)DIM2 * sizeof(float));
+ if (buf == NULL) TEST_ERROR;
+
+ /* Fill sample data */
+ bufp = buf;
+ for (i = 0; i < DIM1; i++)
+ for (j = 0; j < DIM2; j++)
+ *bufp = 100.0F;
+
+ /* Create the dataspace */
+ if((space = H5Screate_simple(RANK, dims, NULL)) < 0) TEST_ERROR;
+
+ /* Create the dataset creation property list */
+ if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) TEST_ERROR;
+
+ /* Set up for chunked data */
+ if(H5Pset_chunk(dcpl, 2, chunk_dims) < 0) TEST_ERROR;
+
+ /* Create and write the dataset */
+ dset = H5Dcreate2(fid, "DS_chunked_layout_3", H5T_NATIVE_FLOAT, space, H5P_DEFAULT, dcpl, H5P_DEFAULT);
+ if (dset < 0) TEST_ERROR;
+
+ ret = H5Dwrite(dset, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf);
+ if (ret < 0) TEST_ERROR;
+
+ /* Release allocated buffer */
+ HDfree(buf);
+ bufp = buf = NULL;
+
+ /* Close everything */
+ if(H5Pclose(dcpl) < 0) TEST_ERROR;
+ if(H5Dclose(dset) < 0) TEST_ERROR;
+ if(H5Sclose(space) < 0) TEST_ERROR;
+ if(H5Fclose(fid) < 0) TEST_ERROR;
+
+ return SUCCEED;
+
+error:
+ H5E_BEGIN_TRY {
+ H5Dclose(dset);
+ H5Sclose(space);
+ H5Pclose(dcpl);
+ H5Pclose(fcpl);
+ H5Pclose(fapl);
+ H5Fclose(fid);
+ HDfree(buf);
+ } H5E_END_TRY;
+ return FAIL;
+} /* gen_earliest_v18 */
+
+/***********************************************************************
+ * gen_latest_latest() creates file "bounds_latest_latest.h5"
+ *
+ * File contents:
+ * - Version 3 superblock (triggered by H5Fcreate with H5F_ACC_SWMR_WRITE)
+ * - A chunked dataset with layout version 4, "DS_chunked_layout_4". (H5Pset_chunk_opts)
+ *
+ * NOTE: As of Feb 2018, latest is 1.10.
+ *
+ * Return: SUCCEED/FAIL
+ *
+ ***********************************************************************/
+static herr_t gen_latest_latest(void)
+{
+ hid_t fid = -1; /* File ID */
+ hid_t dcpl = -1; /* Dataset creation property list ID */
+ hid_t space = -1; /* Dataspace ID */
+ hid_t dset = -1; /* Dataset ID */
+ float *buf = NULL; /* Buffer for writing data */
+ float *bufp = NULL; /* Pointer to data buffer */
+ hsize_t dims[RANK] = {DIM1, DIM2}; /* Dimensions */
+ hsize_t chunk_dims[RANK] = {CHK_DIM1, CHK_DIM2}; /* Dimensions of chunk */
+ int i, j;
+ herr_t ret = SUCCEED; /* Generic return value */
+
+ /* Create file with H5F_ACC_SWMR_WRITE, triggers version 3 superblock */
+ fid = H5Fcreate(FILENAME_L_L, H5F_ACC_SWMR_WRITE, H5P_DEFAULT, H5P_DEFAULT);
+ if (fid < 0) TEST_ERROR;
+
+ /*
+ * Add a chunked dataset with layout version 4 (H5Pset_chunk_opts)
+ */
+
+ buf = (float *)HDmalloc((size_t)DIM1 * (size_t)DIM2 * sizeof(float));
+ if (buf == NULL) TEST_ERROR;
+
+ /* Fill sample data */
+ bufp = buf;
+ for (i = 0; i < DIM1; i++)
+ for (j = 0; j < DIM2; j++)
+ *bufp = 100.0F;
+
+ /* Create the dataspace */
+ if((space = H5Screate_simple(RANK, dims, NULL)) < 0) TEST_ERROR;
+
+ /* Create the dataset creation property list */
+ if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) TEST_ERROR;
+
+ /* Set up for chunked data */
+ if(H5Pset_chunk(dcpl, 2, chunk_dims) < 0) TEST_ERROR;
+
+ /* Disable partial chunk filters, triggers layout version 4 */
+ if(H5Pset_chunk_opts(dcpl, H5D_CHUNK_DONT_FILTER_PARTIAL_CHUNKS) < 0)
+ TEST_ERROR;
+
+ /* Create and write the dataset */
+ dset = H5Dcreate2(fid, "DS_chunked_layout_4", H5T_NATIVE_FLOAT, space, H5P_DEFAULT, dcpl, H5P_DEFAULT);
+ if (dset < 0) TEST_ERROR;
+ ret = H5Dwrite(dset, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf);
+ if (ret < 0) TEST_ERROR;
+
+ /* Release allocated buffer */
+ HDfree(buf);
+ bufp = buf = NULL;
+
+ /* Close everything */
+ if(H5Pclose(dcpl) < 0) TEST_ERROR;
+ if(H5Dclose(dset) < 0) TEST_ERROR;
+ if(H5Sclose(space) < 0) TEST_ERROR;
+ if(H5Fclose(fid) < 0) TEST_ERROR;
+
+ return SUCCEED;
+
+error:
+ H5E_BEGIN_TRY {
+ H5Dclose(dset);
+ H5Sclose(space);
+ H5Pclose(dcpl);
+ H5Fclose(fid);
+ HDfree(buf);
+ } H5E_END_TRY;
+ return FAIL;
+} /* gen_latest_latest */
+
+/***********************************************************************
+ * gen_v18_latest() creates file "bounds_v18_latest.h5"
+ *
+ * File contents:
+ * - Version 2 superblock
+ * - A chunked dataset with layout version 3, "DS_chunked_layout_3". (default)
+ *
+ * Return: SUCCEED/FAIL
+ *
+ ***********************************************************************/
+static herr_t gen_v18_latest(void)
+{
+ hid_t fid = -1; /* File ID */
+ hid_t fapl = -1; /* File access property list ID */
+ hid_t fcpl = -1; /* File creation property list ID */
+ hid_t dcpl = -1; /* Dataset creation property list ID */
+ hid_t space = -1; /* Dataspace ID */
+ hid_t dset = -1; /* Dataset ID */
+ float *buf = NULL; /* Buffer for writing data */
+ float *bufp = NULL; /* Pointer to data buffer */
+ hsize_t dims[RANK] = {DIM1, DIM2}; /* Dimensions */
+ hsize_t chunk_dims[RANK] = {CHK_DIM1, CHK_DIM2}; /* Dimensions of chunk */
+ int i, j;
+ herr_t ret = SUCCEED; /* Generic return value */
+
+ /* Create file creation property list */
+ if((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0) TEST_ERROR;
+
+ /* Create file access property list */
+ if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) TEST_ERROR;
+
+ /* Set the "use the v18/latest version of the format" bounds
+ for creating objects in the file, also trigger version 2 superblock */
+ if(H5Pset_libver_bounds(fapl, H5F_LIBVER_V18, H5F_LIBVER_LATEST) < 0)
+ TEST_ERROR;
+
+ /* Create file */
+ if((fid = H5Fcreate(FILENAME_18_L, H5F_ACC_TRUNC, fcpl, fapl)) <0)
+ TEST_ERROR;
+
+ /* Close file property lists */
+ if(H5Pclose(fapl) < 0) TEST_ERROR;
+ if(H5Pclose(fcpl) < 0) TEST_ERROR;
+
+ /*
+ * Add a chunked dataset with layout version 3 (default)
+ */
+
+ buf = (float *)HDmalloc((size_t)DIM1 * (size_t)DIM2 * sizeof(float));
+ if (buf == NULL) TEST_ERROR;
+
+ /* Fill sample data */
+ bufp = buf;
+ for (i = 0; i < DIM1; i++)
+ for (j = 0; j < DIM2; j++)
+ *bufp = 100.0F;
+
+ /* Create the dataspace */
+ if((space = H5Screate_simple(RANK, dims, NULL)) < 0) TEST_ERROR;
+
+ /* Create the dataset creation property list */
+ if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) TEST_ERROR;
+
+ /* Set up for chunked data */
+ if(H5Pset_chunk(dcpl, 2, chunk_dims) < 0) TEST_ERROR;
+
+ /* Create and write the dataset */
+ dset = H5Dcreate2(fid, "DS_chunked_layout_3", H5T_NATIVE_FLOAT, space, H5P_DEFAULT, dcpl, H5P_DEFAULT);
+ if (dset < 0) TEST_ERROR;
+ ret = H5Dwrite(dset, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf);
+ if (ret < 0) TEST_ERROR;
+
+ /* Release allocated buffer */
+ HDfree(buf);
+ bufp = buf = NULL;
+
+ /* Close property list and dataset, will reuse dataspace */
+ if(H5Pclose(dcpl) < 0) TEST_ERROR;
+ if(H5Dclose(dset) < 0) TEST_ERROR;
+ if(H5Sclose(space) < 0) TEST_ERROR;
+ if(H5Fclose(fid) < 0) TEST_ERROR;
+
+ return SUCCEED;
+
+error:
+ H5E_BEGIN_TRY {
+ H5Dclose(dset);
+ H5Sclose(space);
+ H5Pclose(dcpl);
+ H5Pclose(fcpl);
+ H5Pclose(fapl);
+ H5Fclose(fid);
+ HDfree(buf);
+ } H5E_END_TRY;
+ return FAIL;
+} /* gen_v18_latest */
+
+/***********************************************************************
+ * gen_v18_v18() creates file "bounds_v18_v18.h5"
+ *
+ * File contents:
+ * - Version 2 superblock (H5Pset_libver_bounds(v18, v18)
+ * - A chunked dataset with layout version 3, "DS_chunked_layout_3". (default)
+ * - A chunked dataset with layout version 4, "DS_chunked_layout_4". (H5Pset_chunk_opts)
+ *
+ * Return: SUCCEED/FAIL
+ *
+ ***********************************************************************/
+static herr_t gen_v18_v18(void)
+{
+ hid_t fid = -1; /* File ID */
+ hid_t fapl = -1; /* File access property list ID */
+ hid_t fcpl = -1; /* File creation property list ID */
+ hid_t dcpl = -1; /* Dataset creation property list ID */
+ hid_t space = -1; /* Dataspace ID */
+ hid_t dset = -1; /* Dataset ID */
+ float *buf = NULL; /* Buffer for writing data */
+ float *bufp = NULL; /* Pointer to data buffer */
+ hsize_t dims[RANK] = {DIM1, DIM2}; /* Dimensions */
+ hsize_t chunk_dims[RANK] = {CHK_DIM1, CHK_DIM2}; /* Dimensions of chunk */
+ int i, j;
+ herr_t ret = SUCCEED; /* Generic return value */
+
+ /* Create file creation property list */
+ if((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0) TEST_ERROR;
+
+ /* Create file access property list */
+ if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) TEST_ERROR;
+
+ /* Set the "use the v18 version of the format" bounds
+ for creating objects in the file */
+ if(H5Pset_libver_bounds(fapl, H5F_LIBVER_V18, H5F_LIBVER_V18) < 0)
+ TEST_ERROR;
+
+ /* Create file */
+ if((fid = H5Fcreate(FILENAME_18_18, H5F_ACC_TRUNC, fcpl, fapl)) <0)
+ TEST_ERROR;
+
+ /* Close file property lists */
+ if(H5Pclose(fapl) < 0) TEST_ERROR;
+ if(H5Pclose(fcpl) < 0) TEST_ERROR;
+
+ /*
+ * Add a chunked dataset with layout version 3 (default)
+ */
+
+ buf = (float *)HDmalloc((size_t)DIM1 * (size_t)DIM2 * sizeof(float));
+ if (buf == NULL) TEST_ERROR;
+
+ /* Fill sample data */
+ bufp = buf;
+ for (i = 0; i < DIM1; i++)
+ for (j = 0; j < DIM2; j++)
+ *bufp = 100.0F;
+
+ /* Create the dataspace */
+ if((space = H5Screate_simple(RANK, dims, NULL)) < 0) TEST_ERROR;
+
+ /* Create the dataset creation property list */
+ if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) TEST_ERROR;
+
+ /* Set up for chunked data */
+ if(H5Pset_chunk(dcpl, 2, chunk_dims) < 0) TEST_ERROR;
+
+ /* Create and write the dataset */
+ dset = H5Dcreate2(fid, "DS_chunked_layout_3", H5T_NATIVE_FLOAT, space, H5P_DEFAULT, dcpl, H5P_DEFAULT);
+ if (dset < 0) TEST_ERROR;
+ ret = H5Dwrite(dset, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf);
+ if (ret < 0) TEST_ERROR;
+
+ /* Close property list and dataset, will reuse dataspace */
+ if(H5Pclose(dcpl) < 0) TEST_ERROR;
+ if(H5Dclose(dset) < 0) TEST_ERROR;
+
+ /* Close the file, then reopen it with the latest version */
+ if(H5Fclose(fid) < 0) TEST_ERROR;
+
+ /* Create file access property list */
+ if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) TEST_ERROR;
+
+ /* Set the "use the v18/latest version of the format" bounds
+ for creating a layout version 4 object in the file */
+ if(H5Pset_libver_bounds(fapl, H5F_LIBVER_V18, H5F_LIBVER_LATEST) < 0)
+ TEST_ERROR;
+
+ if((fid = H5Fopen(FILENAME_18_18, H5F_ACC_RDWR, fapl)) < 0)
+ TEST_ERROR;
+
+ /*
+ * Add a chunked dataset with layout version 4 (H5Pset_chunk_opts)
+ */
+
+ /* Create the dataset creation property list */
+ if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) TEST_ERROR;
+
+ /* Set up for chunked data */
+ if(H5Pset_chunk(dcpl, 2, chunk_dims) < 0) TEST_ERROR;
+
+ /* Disable partial chunk filters */
+ if(H5Pset_chunk_opts(dcpl, H5D_CHUNK_DONT_FILTER_PARTIAL_CHUNKS) < 0)
+ TEST_ERROR;
+
+ /* Create and write the dataset */
+ dset = H5Dcreate2(fid, "DS_chunked_layout_4", H5T_NATIVE_FLOAT, space, H5P_DEFAULT, dcpl, H5P_DEFAULT);
+ if (dset < 0) TEST_ERROR;
+ ret = H5Dwrite(dset, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf);
+ if (ret < 0) TEST_ERROR;
+
+ /* Release allocated buffer */
+ HDfree(buf);
+ bufp = buf = NULL;
+
+ /* Close everything */
+ if(H5Pclose(dcpl) < 0) TEST_ERROR;
+ if(H5Pclose(fapl) < 0) TEST_ERROR;
+ if(H5Dclose(dset) < 0) TEST_ERROR;
+ if(H5Sclose(space) < 0) TEST_ERROR;
+ if(H5Fclose(fid) < 0) TEST_ERROR;
+ return SUCCEED;
+
+error:
+ H5E_BEGIN_TRY {
+ H5Dclose(dset);
+ H5Sclose(space);
+ H5Pclose(dcpl);
+ H5Pclose(fcpl);
+ H5Pclose(fapl);
+ H5Fclose(fid);
+ HDfree(buf);
+ } H5E_END_TRY;
+ return FAIL;
+} /* gen_v18_v18 */
+
+int main(void)
+{
+ /* Generate file bounds_earliest_latest.h5 */
+ if (gen_earliest_latest() < 0) TEST_ERROR;
+
+ /* Generate file bounds_earliest_v18.h5 */
+ if (gen_earliest_v18() < 0) TEST_ERROR;
+
+ /* Generate file bounds_latest_latest.h5 */
+ if (gen_latest_latest() < 0) TEST_ERROR;
+
+ /* Generate file bounds_v18_latest.h5 */
+ if (gen_v18_latest() < 0) TEST_ERROR;
+
+ /* Generate file bounds_v18_v18.h5 */
+ if (gen_v18_v18() < 0) TEST_ERROR;
+
+ return EXIT_SUCCESS;
+
+error:
+ return EXIT_FAILURE;
+}
+
diff --git a/test/gen_cross.c b/test/gen_cross.c
index cf3fc35..f7a1938 100644
--- a/test/gen_cross.c
+++ b/test/gen_cross.c
@@ -26,7 +26,6 @@
* worth keeping around for now.
*/
-#include <stdio.h>
#include "h5test.h"
#define H5FILE_NAME "data.h5"
@@ -79,7 +78,7 @@ int create_szip_dsets_float(hid_t fid, hid_t fsid, hid_t msid);
int create_shuffle_dsets_float(hid_t fid, hid_t fsid, hid_t msid);
int create_nbit_dsets_float(hid_t fid, hid_t fsid, hid_t msid);
-
+
/*-------------------------------------------------------------------------
* Function: create_normal_dset
*
@@ -108,8 +107,8 @@ create_normal_dset(hid_t fid, hid_t fsid, hid_t msid)
* Data and output buffer initialization.
*/
for (j = 0; j < NX; j++) {
- for (i = 0; i < NY; i++)
- data[j][i] = ((float)(i + j + 1)) / 3;
+ for (i = 0; i < NY; i++)
+ data[j][i] = ((float)(i + j + 1)) / 3;
}
/*
* 1/3 2/3 3/3 4/3 5/3 6/3
@@ -143,7 +142,7 @@ create_normal_dset(hid_t fid, hid_t fsid, hid_t msid)
if(H5Dwrite(dataset, H5T_NATIVE_FLOAT, msid, fsid, H5P_DEFAULT, data) < 0)
TEST_ERROR
- /*
+ /*
* Close dataset
*/
if(H5Dclose(dataset) < 0)
@@ -163,7 +162,7 @@ create_normal_dset(hid_t fid, hid_t fsid, hid_t msid)
if(H5Dwrite(dataset, H5T_NATIVE_FLOAT, msid, fsid, H5P_DEFAULT, data) < 0)
TEST_ERROR
- /*
+ /*
* Close dataset
*/
if(H5Dclose(dataset) < 0)
@@ -186,7 +185,7 @@ error:
return -1;
}
-
+
/*-------------------------------------------------------------------------
* Function: create_scale_offset_dsets_float
*
@@ -277,7 +276,7 @@ error:
return -1;
}
-
+
/*-------------------------------------------------------------------------
* Function: create_scale_offset_dsets_double
*
@@ -307,8 +306,8 @@ create_scale_offset_dsets_double(hid_t fid, hid_t fsid, hid_t msid)
* Data and output buffer initialization.
*/
for (j = 0; j < NX; j++) {
- for (i = 0; i < NY; i++)
- data[j][i] = ((double)(i + j + 1))/3;
+ for (i = 0; i < NY; i++)
+ data[j][i] = ((double)(i + j + 1))/3;
}
/*
@@ -368,7 +367,7 @@ error:
return -1;
}
-
+
/*-------------------------------------------------------------------------
* Function: create_scale_offset_dset_char
*
@@ -467,7 +466,7 @@ error:
return -1;
}
-
+
/*-------------------------------------------------------------------------
* Function: create_scale_offset_dset_short
*
@@ -566,7 +565,7 @@ error:
return -1;
}
-
+
/*-------------------------------------------------------------------------
* Function: create_scale_offset_dset_int
*
@@ -596,8 +595,8 @@ create_scale_offset_dsets_int(hid_t fid, hid_t fsid, hid_t msid)
* Data and output buffer initialization.
*/
for (j = 0; j < NX; j++) {
- for (i = 0; i < NY; i++)
- data[j][i] = i + j;
+ for (i = 0; i < NY; i++)
+ data[j][i] = i + j;
}
/*
* 0 1 2 3 4 5
@@ -665,7 +664,7 @@ error:
return -1;
}
-
+
/*-------------------------------------------------------------------------
* Function: create_scale_offset_dset_long_long
*
@@ -765,7 +764,7 @@ error:
return -1;
}
-
+
/*-------------------------------------------------------------------------
* Function: create_fletcher_dsets_float
*
@@ -856,7 +855,7 @@ error:
return -1;
}
-
+
/*-------------------------------------------------------------------------
* Function: create_deflate_dsets_float
*
@@ -957,7 +956,7 @@ error:
}
#ifdef H5_HAVE_FILTER_SZIP
-
+
/*-------------------------------------------------------------------------
* Function: create_szip_dsets_float
*
@@ -1049,7 +1048,7 @@ error:
}
#endif /* H5_HAVE_FILTER_SZIP */
-
+
/*-------------------------------------------------------------------------
* Function: create_shuffle_dsets_float
*
@@ -1140,7 +1139,7 @@ error:
return -1;
}
-
+
/*-------------------------------------------------------------------------
* Function: create_nbit_dsets_float
*
@@ -1225,7 +1224,7 @@ create_nbit_dsets_float(hid_t fid, hid_t fsid, hid_t msid)
TEST_ERROR
/* Now create a dataset with a big-endian type */
- if(H5Tset_order(datatype, H5T_ORDER_BE) < 0)
+ if(H5Tset_order(datatype, H5T_ORDER_BE) < 0)
TEST_ERROR
if((dataset = H5Dcreate2(fid, DATASETNAME23, datatype, fsid,
H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0)
@@ -1252,7 +1251,7 @@ error:
return -1;
}
-
+
/*-------------------------------------------------------------------------
* Function: main
*
diff --git a/test/genall5.c b/test/genall5.c
index a48f14b..e3a9c96 100644
--- a/test/genall5.c
+++ b/test/genall5.c
@@ -1248,29 +1248,55 @@ void
os_grp_0(hid_t fid, const char *group_name)
{
hid_t gid = -1;
+ hid_t fapl = -1;
+ H5F_libver_t low, high;
+
herr_t ret;
- if ( pass ) { /* turn file format latest off */
+ if ( pass ) { /* get the file's file access property list */
- ret = H5Fset_latest_format(fid, FALSE);
+ fapl = H5Fget_access_plist(fid);
+ if ( fapl <= 0 ) {
- if ( ret < 0 ) {
+ pass = FALSE;
+ failure_mssg = "os_grp_0: H5Fget_access_plist() failed.";
+ }
+ HDassert(fapl > 0);
+ }
+
+ if ( pass ) { /* get low and high bounds from fapl */
- pass = FALSE;
- failure_mssg = "os_grp_0: H5Fset_latest_format() failed(1).";
- }
+ ret = H5Pget_libver_bounds(fapl, &low, &high);
+ if ( ret < 0 ) {
+
+ pass = FALSE;
+ failure_mssg = "os_grp_0: H5Pget_libver_bounds() failed(1).";
+ }
HDassert(ret >= 0);
}
+ if ( pass ) { /* turn file format latest off */
+
+ if(low >= H5F_LIBVER_V18) {
+ ret = H5Fset_libver_bounds(fid, H5F_LIBVER_EARLIEST, high);
+ if ( ret < 0 ) {
+
+ pass = FALSE;
+ failure_mssg = "os_grp_0: H5Fset_libver_bounds() failed(1).";
+ }
+ HDassert(ret >= 0);
+ }
+ }
+
if ( pass ) {
gid = H5Gcreate2(fid, group_name, H5P_DEFAULT, H5P_DEFAULT,
H5P_DEFAULT);
if ( gid <= 0 ) {
- pass = FALSE;
- failure_mssg = "os_grp_0: H5Gcreate2() failed.";
- }
+ pass = FALSE;
+ failure_mssg = "os_grp_0: H5Gcreate2() failed.";
+ }
HDassert(gid > 0);
}
@@ -1278,24 +1304,25 @@ os_grp_0(hid_t fid, const char *group_name)
ret = H5Gclose(gid);
- if ( ret < 0 ) {
+ if ( ret < 0 ) {
- pass = FALSE;
- failure_mssg = "os_grp_0: H5Gclose() failed.";
- }
+ pass = FALSE;
+ failure_mssg = "os_grp_0: H5Gclose() failed.";
+ }
HDassert(ret >= 0);
}
- if ( pass ) { /* turn file format latest on */
+ if ( pass ) { /* restore low and high bounds */
- ret = H5Fset_latest_format(fid, TRUE);
-
- if ( ret < 0 ) {
+ if(low >= H5F_LIBVER_V18) {
+ ret = H5Fset_libver_bounds(fid, low, high);
+ if ( ret < 0 ) {
- pass = FALSE;
- failure_mssg = "os_grp_0: H5Fset_latest_format() failed(2).";
- }
- HDassert(ret >= 0);
+ pass = FALSE;
+ failure_mssg = "os_grp_0: H5Fset_libver_bounds() failed(1).";
+ }
+ HDassert(ret >= 0);
+ }
}
return;
@@ -1462,28 +1489,53 @@ os_grp_n(hid_t fid, const char *group_name, int proc_num, unsigned nlinks)
{
hid_t gid = -1;
unsigned u;
+ hid_t fapl = -1;
+ H5F_libver_t low, high;
herr_t ret;
- if ( pass ) { /* turn file format latest off */
+ if ( pass ) { /* get the file's file access property list */
- ret = H5Fset_latest_format(fid, FALSE);
+ fapl = H5Fget_access_plist(fid);
+ if ( fapl <= 0 ) {
- if ( ret < 0 ) {
+ pass = FALSE;
+ failure_mssg = "os_grp_n: H5Fget_access_plist() failed.";
+ }
+ HDassert(fapl > 0);
+ }
- pass = FALSE;
- failure_mssg = "os_grp_n: H5Fset_latest_format() failed(1).";
- }
+ if ( pass ) { /* get low and high bounds from fapl */
+
+ ret = H5Pget_libver_bounds(fapl, &low, &high);
+ if ( ret < 0 ) {
+
+ pass = FALSE;
+ failure_mssg = "os_grp_0: H5Pget_libver_bounds() failed(1).";
+ }
HDassert(ret >= 0);
}
+ if ( pass ) { /* turn file format latest off */
+
+ if(low >= H5F_LIBVER_V18) {
+ ret = H5Fset_libver_bounds(fid, H5F_LIBVER_EARLIEST, high);
+ if ( ret < 0 ) {
+
+ pass = FALSE;
+ failure_mssg = "os_grp_0: H5Fset_libver_bounds() failed(1).";
+ }
+ HDassert(ret >= 0);
+ }
+ }
+
if ( pass ) {
gid = H5Gcreate2(fid, group_name, H5P_DEFAULT, H5P_DEFAULT,
H5P_DEFAULT);
if ( gid <= 0 ) {
- pass = FALSE;
- failure_mssg = "os_grp_n: H5Gcreate2() failed.";
+ pass = FALSE;
+ failure_mssg = "os_grp_n: H5Gcreate2() failed.";
}
HDassert(gid > 0);
}
@@ -1538,16 +1590,17 @@ os_grp_n(hid_t fid, const char *group_name, int proc_num, unsigned nlinks)
assert(ret >= 0);
}
- if ( pass ) { /* turn file format latest on */
-
- ret = H5Fset_latest_format(fid, TRUE);
+ if ( pass ) { /* restore low and high bounds */
- if ( ret < 0 ) {
+ if(low >= H5F_LIBVER_V18) {
+ ret = H5Fset_libver_bounds(fid, low, high);
+ if ( ret < 0 ) {
- pass = FALSE;
- failure_mssg = "os_grp_n: H5Fset_latest_format() failed(2).";
- }
- HDassert(ret >= 0);
+ pass = FALSE;
+ failure_mssg = "os_grp_n: H5Fset_libver_bounds() failed(2).";
+ }
+ HDassert(ret >= 0);
+ }
}
return;
diff --git a/test/gheap.c b/test/gheap.c
index 7564afa..110255b 100644
--- a/test/gheap.c
+++ b/test/gheap.c
@@ -15,14 +15,12 @@
* Programmer: Robb Matzke <matzke@llnl.gov>
* Tuesday, March 31, 1998
*
- * Purpose: Tests the global heap. The global heap is the set of all
- * collections but the collections are not related to one
- * another by anything that appears in the file format.
+ * Purpose: Tests the global heap. The global heap is the set of all
+ * collections but the collections are not related to one
+ * another by anything that appears in the file format.
*/
#include "h5test.h"
-#include "H5private.h"
#include "H5ACprivate.h"
-#include "H5Eprivate.h"
#include "H5Fprivate.h"
#include "H5Gprivate.h"
#include "H5HGprivate.h"
@@ -56,18 +54,18 @@ const char *FILENAME[] = {
NULL
};
-
+
/*-------------------------------------------------------------------------
- * Function: test_1
+ * Function: test_1
*
- * Purpose: Writes a sequence of objects to the global heap where each
- * object is larger than the one before.
+ * Purpose: Writes a sequence of objects to the global heap where each
+ * object is larger than the one before.
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: number of errors
+ * Failure: number of errors
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Tuesday, March 31, 1998
*
* Modifications:
@@ -77,16 +75,16 @@ const char *FILENAME[] = {
static int
test_1 (hid_t fapl)
{
- hid_t file = -1;
- H5F_t *f = NULL;
- H5HG_t *obj = NULL;
- uint8_t out[GHEAP_TEST_NOBJS];
- uint8_t in[GHEAP_TEST_NOBJS];
- size_t u;
- size_t size;
- herr_t status;
- int nerrors = 0;
- char filename[1024];
+ hid_t file = -1;
+ H5F_t *f = NULL;
+ H5HG_t *obj = NULL;
+ uint8_t out[GHEAP_TEST_NOBJS];
+ uint8_t in[GHEAP_TEST_NOBJS];
+ size_t u;
+ size_t size;
+ herr_t status;
+ int nerrors = 0;
+ char filename[1024];
TESTING("monotonically increasing lengths");
@@ -97,11 +95,11 @@ test_1 (hid_t fapl)
/* Open a clean file */
h5_fixname(FILENAME[0], fapl, filename, sizeof filename);
if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
- goto error;
+ goto error;
if(NULL == (f = (H5F_t *)H5I_object(file))) {
- H5_FAILED();
- puts(" Unable to create file");
- goto error;
+ H5_FAILED();
+ puts(" Unable to create file");
+ goto error;
}
/*
@@ -110,37 +108,37 @@ test_1 (hid_t fapl)
* be monotonically increasing.
*/
for(u = 0; u < GHEAP_TEST_NOBJS; u++) {
- size = u + 1;
- HDmemset(out, (int)('A' + u % 26), size);
- H5Eclear2(H5E_DEFAULT);
- status = H5HG_insert(f, H5AC_ind_read_dxpl_id, size, out, obj + u);
- if(status < 0) {
- H5_FAILED();
- puts(" Unable to insert object into global heap");
- nerrors++;
- } else if(u && H5F_addr_gt(obj[u - 1].addr, obj[u].addr)) {
- H5_FAILED();
- puts(" Collection addresses are not monotonically increasing");
- nerrors++;
- }
+ size = u + 1;
+ HDmemset(out, (int)('A' + u % 26), size);
+ H5Eclear2(H5E_DEFAULT);
+ status = H5HG_insert(f, H5AC_ind_read_dxpl_id, size, out, obj + u);
+ if(status < 0) {
+ H5_FAILED();
+ puts(" Unable to insert object into global heap");
+ nerrors++;
+ } else if(u && H5F_addr_gt(obj[u - 1].addr, obj[u].addr)) {
+ H5_FAILED();
+ puts(" Collection addresses are not monotonically increasing");
+ nerrors++;
+ }
}
/*
* Now try to read each object back.
*/
for(u = 0; u < GHEAP_TEST_NOBJS; u++) {
- size = u + 1;
- HDmemset(out, (int)('A' + u % 26), size);
- H5Eclear2(H5E_DEFAULT);
- if(NULL == H5HG_read(f, H5AC_ind_read_dxpl_id, obj + u, in, NULL)) {
- H5_FAILED();
- puts(" Unable to read object");
- nerrors++;
- } else if(HDmemcmp(in, out, size)) {
- H5_FAILED();
- puts(" Value read doesn't match value written");
- nerrors++;
- }
+ size = u + 1;
+ HDmemset(out, (int)('A' + u % 26), size);
+ H5Eclear2(H5E_DEFAULT);
+ if(NULL == H5HG_read(f, H5AC_ind_read_dxpl_id, obj + u, in, NULL)) {
+ H5_FAILED();
+ puts(" Unable to read object");
+ nerrors++;
+ } else if(HDmemcmp(in, out, size)) {
+ H5_FAILED();
+ puts(" Value read doesn't match value written");
+ nerrors++;
+ }
}
/* Release buffer */
@@ -155,25 +153,25 @@ test_1 (hid_t fapl)
error:
H5E_BEGIN_TRY {
- H5Fclose(file);
+ H5Fclose(file);
} H5E_END_TRY;
if(obj)
HDfree(obj);
return MAX(1, nerrors);
}
-
+
/*-------------------------------------------------------------------------
- * Function: test_2
+ * Function: test_2
*
- * Purpose: Writes a sequence of objects to the global heap where each
- * object is smaller than the one before.
+ * Purpose: Writes a sequence of objects to the global heap where each
+ * object is smaller than the one before.
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: number of errors
+ * Failure: number of errors
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Tuesday, March 31, 1998
*
* Modifications:
@@ -183,15 +181,15 @@ error:
static int
test_2 (hid_t fapl)
{
- hid_t file = -1;
- H5F_t *f = NULL;
- H5HG_t *obj = NULL;
- uint8_t out[GHEAP_TEST_NOBJS];
- uint8_t in[GHEAP_TEST_NOBJS];
- size_t u;
- size_t size;
- int nerrors = 0;
- char filename[1024];
+ hid_t file = -1;
+ H5F_t *f = NULL;
+ H5HG_t *obj = NULL;
+ uint8_t out[GHEAP_TEST_NOBJS];
+ uint8_t in[GHEAP_TEST_NOBJS];
+ size_t u;
+ size_t size;
+ int nerrors = 0;
+ char filename[1024];
TESTING("monotonically decreasing lengths");
@@ -202,43 +200,43 @@ test_2 (hid_t fapl)
/* Open a clean file */
h5_fixname(FILENAME[1], fapl, filename, sizeof filename);
if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
- goto error;
+ goto error;
if(NULL == (f = (H5F_t *)H5I_object(file))) {
- H5_FAILED();
- puts(" Unable to create file");
- goto error;
+ H5_FAILED();
+ puts(" Unable to create file");
+ goto error;
}
/*
* Write the objects, monotonically decreasing in length.
*/
for(u = 0; u < GHEAP_TEST_NOBJS; u++) {
- size = GHEAP_TEST_NOBJS - u;
- HDmemset(out, (int)('A' + u % 26), size);
- H5Eclear2(H5E_DEFAULT);
- if (H5HG_insert (f, H5AC_ind_read_dxpl_id, size, out, obj + u) < 0) {
- H5_FAILED();
- puts(" Unable to insert object into global heap");
- nerrors++;
- }
+ size = GHEAP_TEST_NOBJS - u;
+ HDmemset(out, (int)('A' + u % 26), size);
+ H5Eclear2(H5E_DEFAULT);
+ if (H5HG_insert (f, H5AC_ind_read_dxpl_id, size, out, obj + u) < 0) {
+ H5_FAILED();
+ puts(" Unable to insert object into global heap");
+ nerrors++;
+ }
}
/*
* Now try to read each object back.
*/
for(u = 0; u < GHEAP_TEST_NOBJS; u++) {
- size = GHEAP_TEST_NOBJS - u;
- HDmemset(out, (int)('A' + u % 26), size);
- H5Eclear2(H5E_DEFAULT);
- if (NULL==H5HG_read (f, H5AC_ind_read_dxpl_id, obj + u, in, NULL)) {
- H5_FAILED();
- puts(" Unable to read object");
- nerrors++;
- } else if (memcmp (in, out, size)) {
- H5_FAILED();
- puts(" Value read doesn't match value written");
- nerrors++;
- }
+ size = GHEAP_TEST_NOBJS - u;
+ HDmemset(out, (int)('A' + u % 26), size);
+ H5Eclear2(H5E_DEFAULT);
+ if (NULL==H5HG_read (f, H5AC_ind_read_dxpl_id, obj + u, in, NULL)) {
+ H5_FAILED();
+ puts(" Unable to read object");
+ nerrors++;
+ } else if (memcmp (in, out, size)) {
+ H5_FAILED();
+ puts(" Value read doesn't match value written");
+ nerrors++;
+ }
}
/* Release buffer */
@@ -253,25 +251,25 @@ test_2 (hid_t fapl)
error:
H5E_BEGIN_TRY {
- H5Fclose(file);
+ H5Fclose(file);
} H5E_END_TRY;
if(obj)
HDfree(obj);
return MAX(1, nerrors);
}
-
+
/*-------------------------------------------------------------------------
- * Function: test_3
+ * Function: test_3
*
- * Purpose: Creates a few global heap objects and then removes them all.
- * The collection should also be removed.
+ * Purpose: Creates a few global heap objects and then removes them all.
+ * The collection should also be removed.
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: number of errors
+ * Failure: number of errors
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Tuesday, March 31, 1998
*
* Modifications:
@@ -281,15 +279,15 @@ test_2 (hid_t fapl)
static int
test_3 (hid_t fapl)
{
- hid_t file = -1;
- H5F_t *f = NULL;
- H5HG_t *obj = NULL;
- uint8_t out[GHEAP_TEST_NOBJS];
- size_t u;
- size_t size;
- herr_t status;
- int nerrors = 0;
- char filename[1024];
+ hid_t file = -1;
+ H5F_t *f = NULL;
+ H5HG_t *obj = NULL;
+ uint8_t out[GHEAP_TEST_NOBJS];
+ size_t u;
+ size_t size;
+ herr_t status;
+ int nerrors = 0;
+ char filename[1024];
TESTING("complete object removal");
@@ -300,34 +298,34 @@ test_3 (hid_t fapl)
/* Open a clean file */
h5_fixname(FILENAME[2], fapl, filename, sizeof filename);
if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
- goto error;
+ goto error;
if(NULL == (f = (H5F_t *)H5I_object(file))) {
- H5_FAILED();
- puts(" Unable to create file");
- goto error;
+ H5_FAILED();
+ puts(" Unable to create file");
+ goto error;
}
/* Create some stuff */
for(u = 0; u < GHEAP_TEST_NOBJS; u++) {
- size = u % 30 + 100;
- HDmemset(out, (int)('A' + u % 26), size);
- H5Eclear2(H5E_DEFAULT);
- status = H5HG_insert (f, H5AC_ind_read_dxpl_id, size, out, obj + u);
- if (status<0) {
- H5_FAILED();
- puts(" Unable to insert object into global heap");
- nerrors++;
- }
+ size = u % 30 + 100;
+ HDmemset(out, (int)('A' + u % 26), size);
+ H5Eclear2(H5E_DEFAULT);
+ status = H5HG_insert (f, H5AC_ind_read_dxpl_id, size, out, obj + u);
+ if (status<0) {
+ H5_FAILED();
+ puts(" Unable to insert object into global heap");
+ nerrors++;
+ }
}
/* Remove everything */
for(u = 0; u < GHEAP_TEST_NOBJS; u++) {
- status = H5HG_remove (f, H5AC_ind_read_dxpl_id, obj + u);
- if (status<0) {
- H5_FAILED();
- puts(" Unable to remove object");
- nerrors++;
- }
+ status = H5HG_remove (f, H5AC_ind_read_dxpl_id, obj + u);
+ if (status<0) {
+ H5_FAILED();
+ puts(" Unable to remove object");
+ nerrors++;
+ }
}
/* Release buffer */
@@ -342,26 +340,26 @@ test_3 (hid_t fapl)
error:
H5E_BEGIN_TRY {
- H5Fclose(file);
+ H5Fclose(file);
} H5E_END_TRY;
if(obj)
HDfree(obj);
return MAX(1, nerrors);
}
-
+
/*-------------------------------------------------------------------------
- * Function: test_4
+ * Function: test_4
*
- * Purpose: Tests the H5HG_remove() feature by writing lots of objects
- * and occassionally removing some. When we're done they're all
- * removed.
+ * Purpose: Tests the H5HG_remove() feature by writing lots of objects
+ * and occassionally removing some. When we're done they're all
+ * removed.
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: number of errors
+ * Failure: number of errors
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Tuesday, March 31, 1998
*
* Modifications:
@@ -371,15 +369,15 @@ test_3 (hid_t fapl)
static int
test_4 (hid_t fapl)
{
- hid_t file = -1;
- H5F_t *f = NULL;
- H5HG_t *obj = NULL;
- uint8_t out[GHEAP_TEST_NOBJS];
- size_t u;
- size_t size;
- herr_t status;
- int nerrors = 0;
- char filename[1024];
+ hid_t file = -1;
+ H5F_t *f = NULL;
+ H5HG_t *obj = NULL;
+ uint8_t out[GHEAP_TEST_NOBJS];
+ size_t u;
+ size_t size;
+ herr_t status;
+ int nerrors = 0;
+ char filename[1024];
TESTING("partial object removal");
@@ -390,40 +388,40 @@ test_4 (hid_t fapl)
/* Open a clean file */
h5_fixname(FILENAME[3], fapl, filename, sizeof filename);
if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
- goto error;
+ goto error;
if(NULL == (f = (H5F_t *)H5I_object(file))) {
- H5_FAILED();
- puts(" Unable to create file");
- goto error;
+ H5_FAILED();
+ puts(" Unable to create file");
+ goto error;
}
for(u = 0; u < GHEAP_TEST_NOBJS; u++) {
- /* Insert */
- size = u % 30 + 100;
- HDmemset(out, (int)('A' + u % 26), size);
- H5Eclear2(H5E_DEFAULT);
- status = H5HG_insert (f, H5AC_ind_read_dxpl_id, size, out, obj + u);
- if (status<0) {
- H5_FAILED();
- puts(" Unable to insert object into global heap");
- nerrors++;
- }
-
- /*
- * Remove every third one beginning with the second, but after the
- * next one has already been inserted. That is, insert A, B, C;
- * remove B, insert D, E, F; remove E; etc.
- */
- if(1 == (u % 3)) {
- H5Eclear2(H5E_DEFAULT);
- status = H5HG_remove (f, H5AC_ind_read_dxpl_id, obj + u - 1);
- if (status<0) {
- H5_FAILED();
- puts(" Unable to remove object");
- nerrors++;
- }
- HDmemset(obj + u - 1, 0, sizeof *obj);
- }
+ /* Insert */
+ size = u % 30 + 100;
+ HDmemset(out, (int)('A' + u % 26), size);
+ H5Eclear2(H5E_DEFAULT);
+ status = H5HG_insert (f, H5AC_ind_read_dxpl_id, size, out, obj + u);
+ if (status<0) {
+ H5_FAILED();
+ puts(" Unable to insert object into global heap");
+ nerrors++;
+ }
+
+ /*
+ * Remove every third one beginning with the second, but after the
+ * next one has already been inserted. That is, insert A, B, C;
+ * remove B, insert D, E, F; remove E; etc.
+ */
+ if(1 == (u % 3)) {
+ H5Eclear2(H5E_DEFAULT);
+ status = H5HG_remove (f, H5AC_ind_read_dxpl_id, obj + u - 1);
+ if (status<0) {
+ H5_FAILED();
+ puts(" Unable to remove object");
+ nerrors++;
+ }
+ HDmemset(obj + u - 1, 0, sizeof *obj);
+ }
}
/* Release buffer */
@@ -438,27 +436,27 @@ test_4 (hid_t fapl)
error:
H5E_BEGIN_TRY {
- H5Fclose(file);
+ H5Fclose(file);
} H5E_END_TRY;
if(obj)
HDfree(obj);
return MAX(1, nerrors);
}
-
+
/*-------------------------------------------------------------------------
- * Function: test_ooo_indices
+ * Function: test_ooo_indices
*
- * Purpose: Tests that indices can be stored out of order. This can
+ * Purpose: Tests that indices can be stored out of order. This can
* happen when the indices "wrap around" due to many
* insertions and deletions (for example, from rewriting a
* VL dataset).
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: number of errors
+ * Failure: number of errors
*
- * Programmer: Neil Fortner
+ * Programmer: Neil Fortner
* Monday, October 26, 2009
*
* Modifications:
@@ -468,13 +466,13 @@ test_4 (hid_t fapl)
static int
test_ooo_indices(hid_t fapl)
{
- hid_t file = -1;
- H5F_t *f = NULL;
- unsigned i, j;
- H5HG_t *obj = NULL;
- herr_t status;
- int nerrors=0;
- char filename[1024];
+ hid_t file = -1;
+ H5F_t *f = NULL;
+ unsigned i, j;
+ H5HG_t *obj = NULL;
+ herr_t status;
+ int nerrors=0;
+ char filename[1024];
TESTING("out of order indices");
@@ -552,24 +550,24 @@ test_ooo_indices(hid_t fapl)
error:
H5E_BEGIN_TRY {
- H5Fclose(file);
+ H5Fclose(file);
} H5E_END_TRY;
if(obj)
HDfree(obj);
return MAX(1, nerrors);
} /* end test_ooo_indices */
-
+
/*-------------------------------------------------------------------------
- * Function: main
+ * Function: main
*
- * Purpose: Tests global heap.
+ * Purpose: Tests global heap.
*
- * Return: Success: zero
+ * Return: Success: zero
*
- * Failure: non-zero
+ * Failure: non-zero
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Tuesday, March 31, 1998
*
* Modifications:
@@ -579,8 +577,8 @@ test_ooo_indices(hid_t fapl)
int
main (void)
{
- int nerrors=0;
- hid_t fapl;
+ int nerrors=0;
+ hid_t fapl;
h5_reset();
fapl = h5_fileaccess();
diff --git a/test/h5test.h b/test/h5test.h
index ce5c64d..8e87192 100644
--- a/test/h5test.h
+++ b/test/h5test.h
@@ -20,8 +20,13 @@
#ifndef _H5TEST_H
#define _H5TEST_H
+/*
+ * Include required headers. This file tests internal library functions,
+ * so we include the private headers here.
+ */
#include "hdf5.h"
#include "H5private.h"
+#include "H5Eprivate.h"
/*
* Predefined test verbosity levels.
diff --git a/test/hyperslab.c b/test/hyperslab.c
index c28d872..feb96bd 100644
--- a/test/hyperslab.c
+++ b/test/hyperslab.c
@@ -11,110 +11,108 @@
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-/* Programmer: Robb Matzke <matzke@llnl.gov>
- * Friday, October 10, 1997
+/* Programmer: Robb Matzke <matzke@llnl.gov>
+ * Friday, October 10, 1997
*
- * Purpose: Hyperslab operations are rather complex, so this file
- * attempts to test them extensively so we can be relatively
- * sure they really work. We only test 1d, 2d, and 3d cases
- * because testing general dimensionalities would require us to
- * rewrite much of the hyperslab stuff.
+ * Purpose: Hyperslab operations are rather complex, so this file
+ * attempts to test them extensively so we can be relatively
+ * sure they really work. We only test 1d, 2d, and 3d cases
+ * because testing general dimensionalities would require us to
+ * rewrite much of the hyperslab stuff.
*/
#include "h5test.h"
-#include "H5private.h"
-#include "H5Eprivate.h"
#include "H5VMprivate.h"
-#define TEST_SMALL 0x0001
-#define TEST_MEDIUM 0x0002
+#define TEST_SMALL 0x0001
+#define TEST_MEDIUM 0x0002
-#define VARIABLE_SRC 0
-#define VARIABLE_DST 1
-#define VARIABLE_BOTH 2
+#define VARIABLE_SRC 0
+#define VARIABLE_DST 1
+#define VARIABLE_BOTH 2
#define ARRAY_FILL_SIZE 4
#define ARRAY_OFFSET_NDIMS 3
-
+
/*-------------------------------------------------------------------------
- * Function: init_full
+ * Function: init_full
*
- * Purpose: Initialize full array.
+ * Purpose: Initialize full array.
*
- * Return: void
+ * Return: void
*
- * Programmer: Robb Matzke
- * Friday, October 10, 1997
+ * Programmer: Robb Matzke
+ * Friday, October 10, 1997
*
*-------------------------------------------------------------------------
*/
static unsigned
init_full(uint8_t *array, size_t nx, size_t ny, size_t nz)
{
- uint8_t acc = 128;
- unsigned total = 0;
- size_t i, j, k;
+ uint8_t acc = 128;
+ unsigned total = 0;
+ size_t i, j, k;
for(i = 0; i < nx; i++)
- for(j = 0; j < ny; j++)
- for(k = 0; k < nz; k++) {
- total += acc;
- *array = acc;
- acc++;
- array++;
- } /* end for */
+ for(j = 0; j < ny; j++)
+ for(k = 0; k < nz; k++) {
+ total += acc;
+ *array = acc;
+ acc++;
+ array++;
+ } /* end for */
return total;
} /* end init_full() */
-
+
/*-------------------------------------------------------------------------
- * Function: print_array
+ * Function: print_array
*
- * Purpose: Prints the values in an array
+ * Purpose: Prints the values in an array
*
- * Return: void
+ * Return: void
*
- * Programmer: Robb Matzke
- * Friday, October 10, 1997
+ * Programmer: Robb Matzke
+ * Friday, October 10, 1997
*
*-------------------------------------------------------------------------
*/
static void
print_array(uint8_t *array, size_t nx, size_t ny, size_t nz)
{
- size_t i, j, k;
+ size_t i, j, k;
for(i = 0; i < nx; i++) {
- if(nz > 1)
- printf("i=%lu:\n", (unsigned long)i);
- else
- printf("%03lu:", (unsigned long)i);
-
- for(j = 0; j < ny; j++) {
- if(nz > 1)
- printf("%03lu:", (unsigned long)j);
- for(k = 0; k < nz; k++)
- printf(" %3d", *array++);
- if(nz > 1)
- printf("\n");
- } /* end for */
- printf("\n");
+ if(nz > 1)
+ printf("i=%lu:\n", (unsigned long)i);
+ else
+ printf("%03lu:", (unsigned long)i);
+
+ for(j = 0; j < ny; j++) {
+ if(nz > 1)
+ printf("%03lu:", (unsigned long)j);
+ for(k = 0; k < nz; k++)
+ printf(" %3d", *array++);
+ if(nz > 1)
+ printf("\n");
+ } /* end for */
+ printf("\n");
} /* end for */
} /* end print_array() */
-
+
/*-------------------------------------------------------------------------
- * Function: print_ref
+ * Function: print_ref
*
- * Purpose: Prints the reference value
+ * Purpose: Prints the reference value
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure:
+ * Failure:
*
- * Programmer: Robb Matzke
- * Friday, October 10, 1997
+ * Programmer: Robb Matzke
+ * Friday, October 10, 1997
*
*-------------------------------------------------------------------------
*/
@@ -131,37 +129,37 @@ print_ref(size_t nx, size_t ny, size_t nz)
} /* end if */
} /* end print_ref() */
-
+
/*-------------------------------------------------------------------------
- * Function: test_fill
+ * Function: test_fill
*
- * Purpose: Tests the H5VM_hyper_fill() function.
+ * Purpose: Tests the H5VM_hyper_fill() function.
*
- * Return: Success: SUCCEED
+ * Return: Success: SUCCEED
*
- * Failure: FAIL
+ * Failure: FAIL
*
- * Programmer: Robb Matzke
- * Saturday, October 11, 1997
+ * Programmer: Robb Matzke
+ * Saturday, October 11, 1997
*
*-------------------------------------------------------------------------
*/
static herr_t
test_fill(size_t nx, size_t ny, size_t nz,
- size_t di, size_t dj, size_t dk,
- size_t ddx, size_t ddy, size_t ddz)
+ size_t di, size_t dj, size_t dk,
+ size_t ddx, size_t ddy, size_t ddz)
{
- uint8_t *dst = NULL; /*destination array */
- hsize_t hs_size[3]; /*hyperslab size */
- hsize_t dst_size[3]; /*destination total size */
+ uint8_t *dst = NULL; /*destination array */
+ hsize_t hs_size[3]; /*hyperslab size */
+ hsize_t dst_size[3]; /*destination total size */
hsize_t dst_offset[3]; /*offset of hyperslab in dest */
- unsigned ref_value; /*reference value */
- unsigned acc; /*accumulator */
- size_t i, j, k, dx, dy, dz; /*counters */
+ unsigned ref_value; /*reference value */
+ unsigned acc; /*accumulator */
+ size_t i, j, k, dx, dy, dz; /*counters */
size_t u, v, w;
- unsigned ndims; /*hyperslab dimensionality */
- char dim[64], s[256]; /*temp string */
- unsigned fill_value; /*fill value */
+ unsigned ndims; /*hyperslab dimensionality */
+ char dim[64], s[256]; /*temp string */
+ unsigned fill_value; /*fill value */
/*
* Dimensionality.
@@ -190,7 +188,7 @@ test_fill(size_t nx, size_t ny, size_t nz,
/* Allocate array */
if(NULL == (dst = (uint8_t *)HDcalloc((size_t)1, nx * ny * nz)))
TEST_ERROR
-
+
init_full(dst, nx, ny, nz);
for(i = 0; i < nx; i += di) {
@@ -279,52 +277,52 @@ error:
return FAIL;
} /* end test_fill() */
-
+
/*-------------------------------------------------------------------------
- * Function: test_copy
+ * Function: test_copy
*
- * Purpose: Tests H5VM_hyper_copy().
+ * Purpose: Tests H5VM_hyper_copy().
*
- * The NX, NY, and NZ arguments are the size for the source and
- * destination arrays. You may pass zero for NZ or for NY and
- * NZ to test the 2-d and 1-d cases respectively.
+ * The NX, NY, and NZ arguments are the size for the source and
+ * destination arrays. You may pass zero for NZ or for NY and
+ * NZ to test the 2-d and 1-d cases respectively.
*
- * A hyperslab is copied from/to (depending on MODE) various
- * places in SRC and DST beginning at 0,0,0 and increasing
- * location by DI,DJ,DK in the x, y, and z directions.
+ * A hyperslab is copied from/to (depending on MODE) various
+ * places in SRC and DST beginning at 0,0,0 and increasing
+ * location by DI,DJ,DK in the x, y, and z directions.
*
- * For each hyperslab location, various sizes of hyperslabs are
- * tried beginning with 1x1x1 and increasing the size in each
- * dimension by DDX,DDY,DDZ.
+ * For each hyperslab location, various sizes of hyperslabs are
+ * tried beginning with 1x1x1 and increasing the size in each
+ * dimension by DDX,DDY,DDZ.
*
- * Return: Success: SUCCEED
+ * Return: Success: SUCCEED
*
- * Failure: FAIL
+ * Failure: FAIL
*
- * Programmer: Robb Matzke
- * Friday, October 10, 1997
+ * Programmer: Robb Matzke
+ * Friday, October 10, 1997
*
*-------------------------------------------------------------------------
*/
static herr_t
test_copy(int mode,
- size_t nx, size_t ny, size_t nz,
- size_t di, size_t dj, size_t dk,
- size_t ddx, size_t ddy, size_t ddz)
+ size_t nx, size_t ny, size_t nz,
+ size_t di, size_t dj, size_t dk,
+ size_t ddx, size_t ddy, size_t ddz)
{
- uint8_t *src = NULL; /*source array */
- uint8_t *dst = NULL; /*destination array */
- hsize_t hs_size[3]; /*hyperslab size */
- hsize_t dst_size[3]; /*destination total size */
- hsize_t src_size[3]; /*source total size */
- hsize_t dst_offset[3]; /*offset of hyperslab in dest */
+ uint8_t *src = NULL; /*source array */
+ uint8_t *dst = NULL; /*destination array */
+ hsize_t hs_size[3]; /*hyperslab size */
+ hsize_t dst_size[3]; /*destination total size */
+ hsize_t src_size[3]; /*source total size */
+ hsize_t dst_offset[3]; /*offset of hyperslab in dest */
hsize_t src_offset[3]; /*offset of hyperslab in source */
- unsigned ref_value; /*reference value */
- unsigned acc; /*accumulator */
- hsize_t i, j, k, dx, dy, dz; /*counters */
+ unsigned ref_value; /*reference value */
+ unsigned acc; /*accumulator */
+ hsize_t i, j, k, dx, dy, dz; /*counters */
hsize_t u, v, w;
- unsigned ndims; /*hyperslab dimensionality */
- char dim[64], s[256]; /*temp string */
+ unsigned ndims; /*hyperslab dimensionality */
+ char dim[64], s[256]; /*temp string */
const char *sub;
/*
@@ -493,7 +491,7 @@ test_copy(int mode,
(unsigned long)dy,
(unsigned long)dz);
print_ref(nx, ny, nz);
- printf("\n Destination array is:\n");
+ printf("\n Destination array is:\n");
print_array(dst, nx, ny, nz);
} /* end if */
goto error;
@@ -535,7 +533,7 @@ test_copy(int mode,
(unsigned long)dy,
(unsigned long)dz);
print_ref(nx, ny, nz);
- printf("\n Destination array is:\n");
+ printf("\n Destination array is:\n");
print_array(dst, nx, ny, nz);
} /* end if */
goto error;
@@ -563,38 +561,38 @@ error:
return FAIL;
} /* end test_copy() */
-
+
/*-------------------------------------------------------------------------
- * Function: test_multifill
+ * Function: test_multifill
*
- * Purpose: Tests the H5VM_stride_copy() function by using it to fill a
- * hyperslab by replicating a multi-byte sequence. This might
- * be useful to initialize an array of structs with a default
- * struct value, or to initialize an array of floating-point
- * values with a default bit-pattern.
+ * Purpose: Tests the H5VM_stride_copy() function by using it to fill a
+ * hyperslab by replicating a multi-byte sequence. This might
+ * be useful to initialize an array of structs with a default
+ * struct value, or to initialize an array of floating-point
+ * values with a default bit-pattern.
*
- * Return: Success: SUCCEED
+ * Return: Success: SUCCEED
*
- * Failure: FAIL
+ * Failure: FAIL
*
- * Programmer: Robb Matzke
- * Saturday, October 11, 1997
+ * Programmer: Robb Matzke
+ * Saturday, October 11, 1997
*
*-------------------------------------------------------------------------
*/
static herr_t
test_multifill(size_t nx)
{
- hsize_t size;
- hsize_t src_stride;
- hsize_t dst_stride;
- char s[64];
+ hsize_t size;
+ hsize_t src_stride;
+ hsize_t dst_stride;
+ char s[64];
struct a_struct {
int left;
double mid;
int right;
} fill, *src = NULL, *dst = NULL;
- hsize_t i, j;
+ hsize_t i, j;
printf("%-70s", "Testing multi-byte fill value");
fflush(stdout);
@@ -615,7 +613,7 @@ test_multifill(size_t nx)
} /* end for */
/*
- * Describe the fill value. The zero stride says to read the same thing
+ * Describe the fill value. The zero stride says to read the same thing
* over and over again.
*/
fill.left = 55555555;
@@ -684,32 +682,32 @@ error:
return FAIL;
} /* end test_multifill() */
-
+
/*-------------------------------------------------------------------------
- * Function: test_endian
+ * Function: test_endian
*
- * Purpose: Tests the H5VM_stride_copy() function by using it to copy an
- * array of integers and swap the byte ordering from little
- * endian to big endian or vice versa depending on the hardware.
+ * Purpose: Tests the H5VM_stride_copy() function by using it to copy an
+ * array of integers and swap the byte ordering from little
+ * endian to big endian or vice versa depending on the hardware.
*
- * Return: Success: SUCCEED
+ * Return: Success: SUCCEED
*
- * Failure: FAIL
+ * Failure: FAIL
*
- * Programmer: Robb Matzke
- * Saturday, October 11, 1997
+ * Programmer: Robb Matzke
+ * Saturday, October 11, 1997
*
*-------------------------------------------------------------------------
*/
static herr_t
test_endian(size_t nx)
{
- uint8_t *src = NULL; /*source array */
- uint8_t *dst = NULL; /*destination array */
- hssize_t src_stride[2]; /*source strides */
- hssize_t dst_stride[2]; /*destination strides */
- hsize_t size[2]; /*size vector */
- hsize_t i, j;
+ uint8_t *src = NULL; /*source array */
+ uint8_t *dst = NULL; /*destination array */
+ hssize_t src_stride[2]; /*source strides */
+ hssize_t dst_stride[2]; /*destination strides */
+ hsize_t size[2]; /*size vector */
+ hsize_t i, j;
printf("%-70s", "Testing endian conversion by stride");
fflush(stdout);
@@ -747,7 +745,7 @@ test_endian(size_t nx)
printf(" i=%lu, j=%lu\n", (unsigned long)i, (unsigned long)j);
printf(" Source array is:\n");
print_array(src, nx, (size_t)4, (size_t)1);
- printf("\n Result is:\n");
+ printf("\n Result is:\n");
print_array(dst, nx, (size_t)4, (size_t)1);
} /* end if */
goto error;
@@ -771,31 +769,31 @@ error:
return FAIL;
} /* end test_endian() */
-
+
/*-------------------------------------------------------------------------
- * Function: test_transpose
+ * Function: test_transpose
*
- * Purpose: Copy a 2d array from here to there and transpose the elements
- * as it's copied.
+ * Purpose: Copy a 2d array from here to there and transpose the elements
+ * as it's copied.
*
- * Return: Success: SUCCEED
+ * Return: Success: SUCCEED
*
- * Failure: FAIL
+ * Failure: FAIL
*
- * Programmer: Robb Matzke
- * Saturday, October 11, 1997
+ * Programmer: Robb Matzke
+ * Saturday, October 11, 1997
*
*-------------------------------------------------------------------------
*/
static herr_t
test_transpose(size_t nx, size_t ny)
{
- int *src = NULL;
- int *dst = NULL;
- hsize_t src_stride[2], dst_stride[2];
- hsize_t size[2];
- char s[256];
- hsize_t i, j;
+ int *src = NULL;
+ int *dst = NULL;
+ hsize_t src_stride[2], dst_stride[2];
+ hsize_t size[2];
+ char s[256];
+ hsize_t i, j;
sprintf(s, "Testing 2d transpose by stride %4lux%-lud", (unsigned long)nx,
(unsigned long)ny);
@@ -843,7 +841,7 @@ test_transpose(size_t nx, size_t ny)
printf(" %6d", src[i * ny + j]);
printf("\n");
} /* end for */
- printf("\n Destination is:\n");
+ printf("\n Destination is:\n");
for (i = 0; i < ny; i++) {
printf("%3lu:", (unsigned long)i);
for(j = 0; j < nx; j++)
@@ -872,35 +870,35 @@ error:
return FAIL;
} /* end test_transpose() */
-
+
/*-------------------------------------------------------------------------
- * Function: test_sub_super
+ * Function: test_sub_super
*
- * Purpose: Tests H5VM_stride_copy() to reduce the resolution of an image
- * by copying half the pixels in the X and Y directions. Then
- * we use the small image and duplicate every pixel to result in
- * a 2x2 square.
+ * Purpose: Tests H5VM_stride_copy() to reduce the resolution of an image
+ * by copying half the pixels in the X and Y directions. Then
+ * we use the small image and duplicate every pixel to result in
+ * a 2x2 square.
*
- * Return: Success: SUCCEED
+ * Return: Success: SUCCEED
*
- * Failure: FAIL
+ * Failure: FAIL
*
- * Programmer: Robb Matzke
- * Monday, October 13, 1997
+ * Programmer: Robb Matzke
+ * Monday, October 13, 1997
*
*-------------------------------------------------------------------------
*/
static herr_t
test_sub_super(size_t nx, size_t ny)
{
- uint8_t *full = NULL; /*original image */
- uint8_t *half = NULL; /*image at 1/2 resolution */
- uint8_t *twice = NULL; /*2x2 pixels */
- hsize_t src_stride[4]; /*source stride info */
- hsize_t dst_stride[4]; /*destination stride info */
- hsize_t size[4]; /*number of sample points */
- hsize_t i, j;
- char s[256];
+ uint8_t *full = NULL; /*original image */
+ uint8_t *half = NULL; /*image at 1/2 resolution */
+ uint8_t *twice = NULL; /*2x2 pixels */
+ hsize_t src_stride[4]; /*source stride info */
+ hsize_t dst_stride[4]; /*destination stride info */
+ hsize_t size[4]; /*number of sample points */
+ hsize_t i, j;
+ char s[256];
sprintf(s, "Testing image sampling %4lux%-4lu to %4lux%-4lu ",
(unsigned long)(2 * nx), (unsigned long)(2 * ny),
@@ -942,7 +940,7 @@ test_sub_super(size_t nx, size_t ny)
(unsigned long)i, (unsigned long)j);
printf(" full is:\n");
print_array(full, 2 * nx, 2 * ny, (size_t)1);
- printf("\n half is:\n");
+ printf("\n half is:\n");
print_array(half, nx, ny, (size_t)1);
} /* end if */
goto error;
@@ -1005,7 +1003,7 @@ test_sub_super(size_t nx, size_t ny)
AT();
printf(" %s\n Half is:\n", s);
print_array(half, nx, ny, (size_t)1);
- printf("\n Twice is:\n");
+ printf("\n Twice is:\n");
print_array(twice, 2 * nx, 2 * ny, (size_t)1);
} /* end if */
goto error;
@@ -1032,20 +1030,20 @@ error:
return FAIL;
} /* test_sub_super() */
-
+
/*-------------------------------------------------------------------------
- * Function: test_array_fill
+ * Function: test_array_fill
*
- * Purpose: Tests H5VM_array_fill routine by copying a multibyte value
+ * Purpose: Tests H5VM_array_fill routine by copying a multibyte value
* (an array of ints, in our case) into all the elements of an
* array.
*
- * Return: Success: SUCCEED
+ * Return: Success: SUCCEED
*
- * Failure: FAIL
+ * Failure: FAIL
*
- * Programmer: Quincey Koziol
- * Monday, April 21, 2003
+ * Programmer: Quincey Koziol
+ * Monday, April 21, 2003
*
*-------------------------------------------------------------------------
*/
@@ -1054,8 +1052,8 @@ test_array_fill(size_t lo, size_t hi)
{
int *dst = NULL; /* Destination */
int src[ARRAY_FILL_SIZE]; /* Source to duplicate */
- size_t u, v, w; /* Local index variables */
- char s[256];
+ size_t u, v, w; /* Local index variables */
+ char s[256];
sprintf(s, "array filling %4lu-%-4lu elements", (unsigned long)lo,(unsigned long)hi);
TESTING(s);
@@ -1093,20 +1091,20 @@ error:
return FAIL;
} /* end test_array_fill() */
-
+
/*-------------------------------------------------------------------------
- * Function: test_array_offset_n_calc
+ * Function: test_array_offset_n_calc
*
- * Purpose: Tests H5VM_array_offset and H5VM_array_calc routines by comparing
+ * Purpose: Tests H5VM_array_offset and H5VM_array_calc routines by comparing
* computed array offsets against calculated ones and then going
* back to the coordinates from the offset and checking those.
*
- * Return: Success: SUCCEED
+ * Return: Success: SUCCEED
*
- * Failure: FAIL
+ * Failure: FAIL
*
- * Programmer: Quincey Koziol
- * Monday, April 21, 2003
+ * Programmer: Quincey Koziol
+ * Monday, April 21, 2003
*
*-------------------------------------------------------------------------
*/
@@ -1116,11 +1114,11 @@ test_array_offset_n_calc(size_t n, size_t x, size_t y, size_t z)
hsize_t *a = NULL;
hsize_t *temp_a; /* Array for stored calculated offsets */
hsize_t off; /* Offset in array */
- size_t u, v, w; /* Local index variables */
+ size_t u, v, w; /* Local index variables */
hsize_t dims[ARRAY_OFFSET_NDIMS]; /* X, Y & X coordinates of array to check */
hsize_t coords[ARRAY_OFFSET_NDIMS]; /* X, Y & X coordinates to check offset of */
hsize_t new_coords[ARRAY_OFFSET_NDIMS]; /* X, Y & X coordinates of offset */
- char s[256];
+ char s[256];
sprintf(s, "array offset %4lux%4lux%4lu elements", (unsigned long)z,(unsigned long)y,(unsigned long)x);
TESTING(s);
@@ -1178,29 +1176,29 @@ error:
return FAIL;
} /* end test_array_offset_n_calc() */
-
+
/*-------------------------------------------------------------------------
- * Function: main
+ * Function: main
*
- * Purpose: Test various hyperslab operations. Give the words
- * `small' and/or `medium' on the command line or only `small'
- * is assumed.
+ * Purpose: Test various hyperslab operations. Give the words
+ * `small' and/or `medium' on the command line or only `small'
+ * is assumed.
*
- * Return: Success: exit(EXIT_SUCCESS)
+ * Return: Success: exit(EXIT_SUCCESS)
*
- * Failure: exit(EXIT_FAILURE)
+ * Failure: exit(EXIT_FAILURE)
*
- * Programmer: Robb Matzke
- * Friday, October 10, 1997
+ * Programmer: Robb Matzke
+ * Friday, October 10, 1997
*
*-------------------------------------------------------------------------
*/
int
main(int argc, char *argv[])
{
- herr_t status;
- int nerrors = 0;
- unsigned size_of_test;
+ herr_t status;
+ int nerrors = 0;
+ unsigned size_of_test;
/* Parse arguments or assume `small' & `medium' */
if(1 == argc)
diff --git a/test/istore.c b/test/istore.c
index c401e87..f100fe4 100644
--- a/test/istore.c
+++ b/test/istore.c
@@ -11,24 +11,22 @@
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-/* Programmer: Robb Matzke <matzke@llnl.gov>
- * Wednesday, October 15, 1997
+/* Programmer: Robb Matzke <matzke@llnl.gov>
+ * Wednesday, October 15, 1997
*
- * Purpose: Tests various aspects of indexed raw data storage.
+ * Purpose: Tests various aspects of indexed raw data storage.
*/
-#define H5F_FRIEND /*suppress error about including H5Fpkg */
+#define H5F_FRIEND /*suppress error about including H5Fpkg */
#include "h5test.h"
-#include "H5private.h"
+
#include "H5Dprivate.h"
-#include "H5Eprivate.h"
#include "H5Iprivate.h"
#include "H5Pprivate.h"
#include "H5Fpkg.h"
#include "H5Gprivate.h"
#include "H5Oprivate.h"
-#include "H5Pprivate.h"
#include "H5VMprivate.h"
const char *FILENAME[] = {
@@ -37,9 +35,9 @@ const char *FILENAME[] = {
};
-#define TEST_SMALL 0x0001
-#define TEST_MEDIUM 0x0002
-#define TEST_LARGE 0x0004
+#define TEST_SMALL 0x0001
+#define TEST_MEDIUM 0x0002
+#define TEST_LARGE 0x0004
/* The datatype of the dataset operated on by this test */
#define TEST_DATATYPE H5T_NATIVE_UCHAR
@@ -50,19 +48,19 @@ const char *FILENAME[] = {
hsize_t chunk_dims[H5O_LAYOUT_NDIMS];
hsize_t zero[H5O_LAYOUT_NDIMS];
-
+
/*-------------------------------------------------------------------------
- * Function: is_sparse
+ * Function: is_sparse
*
- * Purpose: Determines if the file system of the current working
- * directory supports holes.
+ * Purpose: Determines if the file system of the current working
+ * directory supports holes.
*
- * Return: Success: Non-zero if holes are supported; zero
- * otherwise.
+ * Return: Success: Non-zero if holes are supported; zero
+ * otherwise.
*
- * Failure: zero
+ * Failure: zero
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Wednesday, July 15, 1998
*
*-------------------------------------------------------------------------
@@ -70,8 +68,8 @@ hsize_t zero[H5O_LAYOUT_NDIMS];
static int
is_sparse(void)
{
- int fd;
- h5_stat_t sb;
+ int fd;
+ h5_stat_t sb;
if ((fd = HDopen("x.h5", O_RDWR|O_TRUNC|O_CREAT, H5_POSIX_CREATE_MODE_RW)) < 0) return 0;
if (HDlseek(fd, (off_t)(1024*1024), SEEK_SET)!=1024*1024) return 0;
@@ -86,16 +84,16 @@ is_sparse(void)
#endif
}
-
+
/*-------------------------------------------------------------------------
- * Function: print_array
+ * Function: print_array
*
- * Purpose: Prints the values in an array
+ * Purpose: Prints the values in an array
*
- * Return: void
+ * Return: void
*
- * Programmer: Robb Matzke
- * Friday, October 10, 1997
+ * Programmer: Robb Matzke
+ * Friday, October 10, 1997
*
* Modifications:
*
@@ -104,41 +102,41 @@ is_sparse(void)
static void
print_array(uint8_t *array, size_t nx, size_t ny, size_t nz)
{
- size_t i, j, k;
+ size_t i, j, k;
for (i = 0; i < nx; i++) {
- if (nz > 1) {
- fprintf(stderr,"i=%lu:\n", (unsigned long)i);
- } else {
- fprintf(stderr,"%03lu:", (unsigned long)i);
- }
-
- for (j = 0; j < ny; j++) {
- if (nz > 1)
- fprintf(stderr,"%03lu:", (unsigned long)j);
- for (k = 0; k < nz; k++) {
- fprintf(stderr," %3d", *array++);
- }
- if (nz > 1)
- fprintf(stderr,"\n");
- }
- fprintf(stderr,"\n");
+ if (nz > 1) {
+ fprintf(stderr,"i=%lu:\n", (unsigned long)i);
+ } else {
+ fprintf(stderr,"%03lu:", (unsigned long)i);
+ }
+
+ for (j = 0; j < ny; j++) {
+ if (nz > 1)
+ fprintf(stderr,"%03lu:", (unsigned long)j);
+ for (k = 0; k < nz; k++) {
+ fprintf(stderr," %3d", *array++);
+ }
+ if (nz > 1)
+ fprintf(stderr,"\n");
+ }
+ fprintf(stderr,"\n");
}
}
-
+
/*-------------------------------------------------------------------------
- * Function: new_object
+ * Function: new_object
*
- * Purpose: Creates a new object that refers to a indexed storage of raw
- * data. No raw data is stored.
+ * Purpose: Creates a new object that refers to a indexed storage of raw
+ * data. No raw data is stored.
*
- * Return: Success: ID of dataset
+ * Return: Success: ID of dataset
*
- * Failure: -1
+ * Failure: -1
*
- * Programmer: Robb Matzke
- * Wednesday, October 15, 1997
+ * Programmer: Robb Matzke
+ * Wednesday, October 15, 1997
*
* Modifications:
* Converted to use datasets instead of directly messing with
@@ -182,19 +180,19 @@ error:
return -1;
}
-
+
/*-------------------------------------------------------------------------
- * Function: test_create
+ * Function: test_create
*
- * Purpose: Creates a named object that refers to indexed storage of raw
- * data. No raw data is stored.
+ * Purpose: Creates a named object that refers to indexed storage of raw
+ * data. No raw data is stored.
*
- * Return: Success: SUCCEED
+ * Return: Success: SUCCEED
*
- * Failure: FAIL
+ * Failure: FAIL
*
- * Programmer: Robb Matzke
- * Wednesday, October 15, 1997
+ * Programmer: Robb Matzke
+ * Wednesday, October 15, 1997
*
* Modifications:
*
@@ -217,9 +215,9 @@ test_create(hid_t f, const char *prefix)
dims[u] = my_chunk_dims[u] = 2;
/* Create chunked dataset of this dimensionality */
- HDsnprintf(name, sizeof name, "%s_%02u", prefix, u);
- if ((dataset=new_object(f, name, (int)u, dims, my_chunk_dims)) < 0)
- return FAIL;
+ HDsnprintf(name, sizeof name, "%s_%02u", prefix, u);
+ if ((dataset=new_object(f, name, (int)u, dims, my_chunk_dims)) < 0)
+ return FAIL;
/* Close dataset created */
if(H5Dclose(dataset) < 0)
@@ -230,20 +228,20 @@ test_create(hid_t f, const char *prefix)
return SUCCEED;
}
-
+
/*-------------------------------------------------------------------------
- * Function: test_extend
+ * Function: test_extend
*
- * Purpose: Creates an empty object and then writes to it in such a way
- * as to always extend the object's domain without creating
- * holes and without causing the object to become concave.
+ * Purpose: Creates an empty object and then writes to it in such a way
+ * as to always extend the object's domain without creating
+ * holes and without causing the object to become concave.
*
- * Return: Success: SUCCEED
+ * Return: Success: SUCCEED
*
- * Failure: FAIL
+ * Failure: FAIL
*
- * Programmer: Robb Matzke
- * Wednesday, October 15, 1997
+ * Programmer: Robb Matzke
+ * Wednesday, October 15, 1997
*
* Modifications:
*
@@ -251,35 +249,35 @@ test_create(hid_t f, const char *prefix)
*/
static herr_t
test_extend(hid_t f, const char *prefix,
- size_t nx, size_t ny, size_t nz)
+ size_t nx, size_t ny, size_t nz)
{
hid_t dataset; /* Dataset ID */
hid_t fspace; /* Dataset's file dataspace */
hid_t mspace; /* Dataset's memory dataspace */
- size_t i, j, k, ctr;
- int ndims;
- uint8_t *buf = NULL, *check = NULL, *whole = NULL;
- char dims[64], s[256], name[256];
- hsize_t offset[3];
- hsize_t max_corner[3];
- hsize_t size[3];
- hsize_t whole_size[3];
- hsize_t nelmts;
+ size_t i, j, k, ctr;
+ int ndims;
+ uint8_t *buf = NULL, *check = NULL, *whole = NULL;
+ char dims[64], s[256], name[256];
+ hsize_t offset[3];
+ hsize_t max_corner[3];
+ hsize_t size[3];
+ hsize_t whole_size[3];
+ hsize_t nelmts;
if (!nz) {
- if (!ny) {
- ndims = 1;
- ny = nz = 1;
- sprintf(dims, "%lu", (unsigned long) nx);
- } else {
- ndims = 2;
- nz = 1;
- sprintf(dims, "%lux%lu", (unsigned long) nx, (unsigned long) ny);
- }
+ if (!ny) {
+ ndims = 1;
+ ny = nz = 1;
+ sprintf(dims, "%lu", (unsigned long) nx);
} else {
- ndims = 3;
- sprintf(dims, "%lux%lux%lu",
- (unsigned long) nx, (unsigned long) ny, (unsigned long) nz);
+ ndims = 2;
+ nz = 1;
+ sprintf(dims, "%lux%lu", (unsigned long) nx, (unsigned long) ny);
+ }
+ } else {
+ ndims = 3;
+ sprintf(dims, "%lux%lux%lu",
+ (unsigned long) nx, (unsigned long) ny, (unsigned long) nz);
}
sprintf(s, "istore extend: %s", dims);
@@ -298,57 +296,57 @@ test_extend(hid_t f, const char *prefix,
/* Build the new empty object */
sprintf(name, "%s_%s", prefix, dims);
if ((dataset=new_object(f, name, ndims, whole_size, whole_size)) < 0) {
- fprintf(stderr," Cannot create %u-d object `%s'\n", ndims, name);
- goto error;
+ fprintf(stderr," Cannot create %u-d object `%s'\n", ndims, name);
+ goto error;
}
/* Get dataset's dataspace */
if((fspace=H5Dget_space(dataset)) < 0) TEST_ERROR;
for (ctr = 0;
- H5VM_vector_lt_u((unsigned)ndims, max_corner, whole_size);
- ctr++) {
-
- /* Size and location */
- if (0 == ctr) {
- offset[0] = offset[1] = offset[2] = 0;
- size[0] = size[1] = size[2] = 1;
- nelmts = 1;
- } else {
- for (i=0, nelmts=1; i<(size_t)ndims; i++) {
- if (ctr % (size_t)ndims == i) {
- offset[i] = max_corner[i];
- size[i] = MIN(1, whole_size[i] - offset[i]);
- } else {
- offset[i] = 0;
- size[i] = max_corner[i];
- }
- nelmts *= size[i];
- }
- }
+ H5VM_vector_lt_u((unsigned)ndims, max_corner, whole_size);
+ ctr++) {
+
+ /* Size and location */
+ if (0 == ctr) {
+ offset[0] = offset[1] = offset[2] = 0;
+ size[0] = size[1] = size[2] = 1;
+ nelmts = 1;
+ } else {
+ for (i=0, nelmts=1; i<(size_t)ndims; i++) {
+ if (ctr % (size_t)ndims == i) {
+ offset[i] = max_corner[i];
+ size[i] = MIN(1, whole_size[i] - offset[i]);
+ } else {
+ offset[i] = 0;
+ size[i] = max_corner[i];
+ }
+ nelmts *= size[i];
+ }
+ }
#if 0
- if (0 == ctr)
- fprintf(stderr,"\n");
- fprintf(stderr," Insert: ctr=%lu, corner=(%ld", (unsigned long)ctr, (long)offset[0]);
- if (ndims > 1)
- fprintf(stderr,",%ld", (long)offset[1]);
- if (ndims > 2)
- fprintf(stderr,",%ld", (long)offset[2]);
- fprintf(stderr,"), size=(%lu", (unsigned long)size[0]);
- if (ndims > 1)
- fprintf(stderr,",%lu", (unsigned long)size[1]);
- if (ndims > 2)
- fprintf(stderr,",%lu", (unsigned long)size[2]);
- fprintf(stderr,"), %lu element%s", (unsigned long)nelmts, 1 == nelmts ? "" : "s");
- if (0 == nelmts)
- fprintf(stderr," *SKIPPED*");
- fprintf(stderr,"\n");
+ if (0 == ctr)
+ fprintf(stderr,"\n");
+ fprintf(stderr," Insert: ctr=%lu, corner=(%ld", (unsigned long)ctr, (long)offset[0]);
+ if (ndims > 1)
+ fprintf(stderr,",%ld", (long)offset[1]);
+ if (ndims > 2)
+ fprintf(stderr,",%ld", (long)offset[2]);
+ fprintf(stderr,"), size=(%lu", (unsigned long)size[0]);
+ if (ndims > 1)
+ fprintf(stderr,",%lu", (unsigned long)size[1]);
+ if (ndims > 2)
+ fprintf(stderr,",%lu", (unsigned long)size[2]);
+ fprintf(stderr,"), %lu element%s", (unsigned long)nelmts, 1 == nelmts ? "" : "s");
+ if (0 == nelmts)
+ fprintf(stderr," *SKIPPED*");
+ fprintf(stderr,"\n");
#endif
- /* Fill the source array */
- if (0 == nelmts) continue;
- HDmemset(buf, (signed)(128+ctr), (size_t)nelmts);
+ /* Fill the source array */
+ if (0 == nelmts) continue;
+ HDmemset(buf, (signed)(128+ctr), (size_t)nelmts);
/* Create dataspace for selection in memory */
if((mspace=H5Screate_simple(1,&nelmts,NULL)) < 0) TEST_ERROR;
@@ -356,72 +354,72 @@ test_extend(hid_t f, const char *prefix,
/* Select region in file dataspace */
if(H5Sselect_hyperslab(fspace,H5S_SELECT_SET,offset,NULL,size,NULL) < 0) TEST_ERROR;
- /* Write to disk */
- if (H5Dwrite(dataset, TEST_DATATYPE, mspace, fspace, H5P_DEFAULT, buf) < 0) {
- H5_FAILED();
- fprintf(stderr," Write failed: ctr=%lu\n", (unsigned long)ctr);
- goto error;
- }
-
- /* Read from disk */
- HDmemset(check, 0xff, (size_t)nelmts);
- if (H5Dread(dataset, TEST_DATATYPE, mspace, fspace, H5P_DEFAULT, check) < 0) {
- H5_FAILED();
- fprintf(stderr," Read failed: ctr=%lu\n", (unsigned long)ctr);
- goto error;
- }
- if (HDmemcmp(buf, check, (size_t)nelmts)) {
- H5_FAILED();
- fprintf(stderr," Read check failed: ctr=%lu\n", (unsigned long)ctr);
- fprintf(stderr," Wrote:\n");
- print_array(buf, (size_t)size[0], (size_t)size[1],
- (size_t)size[2]);
- fprintf(stderr," Read:\n");
- print_array(check, (size_t)size[0], (size_t)size[1],
- (size_t)size[2]);
- goto error;
- }
+ /* Write to disk */
+ if (H5Dwrite(dataset, TEST_DATATYPE, mspace, fspace, H5P_DEFAULT, buf) < 0) {
+ H5_FAILED();
+ fprintf(stderr," Write failed: ctr=%lu\n", (unsigned long)ctr);
+ goto error;
+ }
+
+ /* Read from disk */
+ HDmemset(check, 0xff, (size_t)nelmts);
+ if (H5Dread(dataset, TEST_DATATYPE, mspace, fspace, H5P_DEFAULT, check) < 0) {
+ H5_FAILED();
+ fprintf(stderr," Read failed: ctr=%lu\n", (unsigned long)ctr);
+ goto error;
+ }
+ if (HDmemcmp(buf, check, (size_t)nelmts)) {
+ H5_FAILED();
+ fprintf(stderr," Read check failed: ctr=%lu\n", (unsigned long)ctr);
+ fprintf(stderr," Wrote:\n");
+ print_array(buf, (size_t)size[0], (size_t)size[1],
+ (size_t)size[2]);
+ fprintf(stderr," Read:\n");
+ print_array(check, (size_t)size[0], (size_t)size[1],
+ (size_t)size[2]);
+ goto error;
+ }
/* Close memory dataspace */
if(H5Sclose(mspace) < 0) TEST_ERROR;
- /* Write to `whole' buffer for later checking */
- H5VM_hyper_copy((unsigned)ndims, size,
- whole_size, offset, whole, /*dst*/
- size, H5VM_ZERO, buf); /*src*/
+ /* Write to `whole' buffer for later checking */
+ H5VM_hyper_copy((unsigned)ndims, size,
+ whole_size, offset, whole, /*dst*/
+ size, H5VM_ZERO, buf); /*src*/
- /* Update max corner */
- for (i=0; i<(size_t)ndims; i++)
- max_corner[i] = MAX(max_corner[i], offset[i]+size[i]);
+ /* Update max corner */
+ for (i=0; i<(size_t)ndims; i++)
+ max_corner[i] = MAX(max_corner[i], offset[i]+size[i]);
}
/* Now read the entire array back out and check it */
HDmemset(buf, 0xff, nx * ny * nz);
if (H5Dread(dataset, TEST_DATATYPE, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) {
- H5_FAILED();
- fprintf(stderr," Read failed for whole array.\n");
- goto error;
+ H5_FAILED();
+ fprintf(stderr," Read failed for whole array.\n");
+ goto error;
}
for (i=0; i<nx; i++) {
- for (j=0; j<ny; j++) {
- for (k=0; k<nz; k++) {
- if (whole[i*ny*nz + j*nz + k] != buf[i*ny*nz + j*nz + k]) {
- H5_FAILED();
- fprintf(stderr," Check failed at i=%lu", (unsigned long)i);
- if (ndims > 1) {
- fprintf(stderr,", j=%lu", (unsigned long)j);
- }
- if (ndims > 2) {
- fprintf(stderr,", k=%lu", (unsigned long)k);
- }
- fprintf(stderr,"\n Check array is:\n");
- print_array(whole, nx, ny, nz);
- fprintf(stderr," Value read is:\n");
- print_array(buf, nx, ny, nz);
- goto error;
- }
- }
- }
+ for (j=0; j<ny; j++) {
+ for (k=0; k<nz; k++) {
+ if (whole[i*ny*nz + j*nz + k] != buf[i*ny*nz + j*nz + k]) {
+ H5_FAILED();
+ fprintf(stderr," Check failed at i=%lu", (unsigned long)i);
+ if (ndims > 1) {
+ fprintf(stderr,", j=%lu", (unsigned long)j);
+ }
+ if (ndims > 2) {
+ fprintf(stderr,", k=%lu", (unsigned long)k);
+ }
+ fprintf(stderr,"\n Check array is:\n");
+ print_array(whole, nx, ny, nz);
+ fprintf(stderr," Value read is:\n");
+ print_array(buf, nx, ny, nz);
+ goto error;
+ }
+ }
+ }
}
/* Close dataset's dataspace */
@@ -445,19 +443,19 @@ error:
return FAIL;
}
-
+
/*-------------------------------------------------------------------------
- * Function: test_sparse
+ * Function: test_sparse
*
- * Purpose: Creates a sparse matrix consisting of NBLOCKS randomly placed
- * blocks each of size NX,NY,NZ.
+ * Purpose: Creates a sparse matrix consisting of NBLOCKS randomly placed
+ * blocks each of size NX,NY,NZ.
*
- * Return: Success: SUCCEED
+ * Return: Success: SUCCEED
*
- * Failure: FAIL
+ * Failure: FAIL
*
- * Programmer: Robb Matzke
- * Wednesday, October 22, 1997
+ * Programmer: Robb Matzke
+ * Wednesday, October 22, 1997
*
* Modifications:
*
@@ -465,34 +463,34 @@ error:
*/
static herr_t
test_sparse(hid_t f, const char *prefix, size_t nblocks,
- size_t nx, size_t ny, size_t nz, int skip_test)
+ size_t nx, size_t ny, size_t nz, int skip_test)
{
hid_t dataset; /* Dataset ID */
hid_t fspace; /* Dataset's file dataspace */
hid_t mspace; /* Dataset's memory dataspace */
- int ndims;
- hsize_t ctr;
- char dims[64], s[256], name[256];
- hsize_t offset[3];
- hsize_t size[3], total = 0;
- uint8_t *buf = NULL;
- hsize_t whole_size[3]; /* Size of dataset's dataspace */
+ int ndims;
+ hsize_t ctr;
+ char dims[64], s[256], name[256];
+ hsize_t offset[3];
+ hsize_t size[3], total = 0;
+ uint8_t *buf = NULL;
+ hsize_t whole_size[3]; /* Size of dataset's dataspace */
size_t u; /* Local index variable */
if (!nz) {
- if (!ny) {
- ndims = 1;
- ny = nz = 1;
- sprintf(dims, "%lu", (unsigned long) nx);
- } else {
- ndims = 2;
- nz = 1;
- sprintf(dims, "%lux%lu", (unsigned long) nx, (unsigned long) ny);
- }
+ if (!ny) {
+ ndims = 1;
+ ny = nz = 1;
+ sprintf(dims, "%lu", (unsigned long) nx);
} else {
- ndims = 3;
- sprintf(dims, "%lux%lux%lu",
- (unsigned long) nx, (unsigned long) ny, (unsigned long) nz);
+ ndims = 2;
+ nz = 1;
+ sprintf(dims, "%lux%lu", (unsigned long) nx, (unsigned long) ny);
+ }
+ } else {
+ ndims = 3;
+ sprintf(dims, "%lux%lux%lu",
+ (unsigned long) nx, (unsigned long) ny, (unsigned long) nz);
}
sprintf(s, "istore sparse: %s", dims);
@@ -516,8 +514,8 @@ test_sparse(hid_t f, const char *prefix, size_t nblocks,
/* Build the new empty object */
sprintf(name, "%s_%s", prefix, dims);
if ((dataset=new_object(f, name, ndims, whole_size, chunk_dims)) < 0) {
- printf(" Cannot create %u-d object `%s'\n", ndims, name);
- goto error;
+ printf(" Cannot create %u-d object `%s'\n", ndims, name);
+ goto error;
}
/* Get dataset's dataspace */
@@ -534,29 +532,29 @@ test_sparse(hid_t f, const char *prefix, size_t nblocks,
/* Select region in file dataspace */
if(H5Sselect_hyperslab(fspace,H5S_SELECT_SET,offset,NULL,size,NULL) < 0) TEST_ERROR;
- /* write to disk */
- if (H5Dwrite(dataset, TEST_DATATYPE, mspace, fspace, H5P_DEFAULT, buf) < 0) {
- H5_FAILED();
- printf(" Write failed: ctr=%lu\n", (unsigned long)ctr);
- printf(" offset=(%lu", (unsigned long) (offset[0]));
- if (ndims > 1)
- printf(",%lu", (unsigned long) (offset[1]));
- if (ndims > 2)
- printf(",%lu", (unsigned long) (offset[2]));
- printf("), size=(%lu", (unsigned long) (size[0]));
- if (ndims > 1)
- printf(",%lu", (unsigned long) (size[1]));
- if (ndims > 2)
- printf(",%lu", (unsigned long) (size[2]));
- printf(")\n");
- goto error;
- }
- total += nx * ny * nz;
+ /* write to disk */
+ if (H5Dwrite(dataset, TEST_DATATYPE, mspace, fspace, H5P_DEFAULT, buf) < 0) {
+ H5_FAILED();
+ printf(" Write failed: ctr=%lu\n", (unsigned long)ctr);
+ printf(" offset=(%lu", (unsigned long) (offset[0]));
+ if (ndims > 1)
+ printf(",%lu", (unsigned long) (offset[1]));
+ if (ndims > 2)
+ printf(",%lu", (unsigned long) (offset[2]));
+ printf("), size=(%lu", (unsigned long) (size[0]));
+ if (ndims > 1)
+ printf(",%lu", (unsigned long) (size[1]));
+ if (ndims > 2)
+ printf(",%lu", (unsigned long) (size[2]));
+ printf(")\n");
+ goto error;
+ }
+ total += nx * ny * nz;
#if 0
- HDfprintf(stderr,"ctr: ctr=%Zu, total=%Zu\n", ctr, total);
+ HDfprintf(stderr,"ctr: ctr=%Zu, total=%Zu\n", ctr, total);
#endif
- /* We don't test reading yet.... */
+ /* We don't test reading yet.... */
}
/* Close memory dataspace */
@@ -577,18 +575,18 @@ error:
return FAIL;
}
-
+
/*-------------------------------------------------------------------------
- * Function: main
+ * Function: main
*
- * Purpose: Tests indexed storage stuff.
+ * Purpose: Tests indexed storage stuff.
*
- * Return: Success: exit(EXIT_SUCCESS)
+ * Return: Success: exit(EXIT_SUCCESS)
*
- * Failure: exit(EXIT_FAILURE)
+ * Failure: exit(EXIT_FAILURE)
*
- * Programmer: Robb Matzke
- * Wednesday, October 15, 1997
+ * Programmer: Robb Matzke
+ * Wednesday, October 15, 1997
*
* Modifications:
*
@@ -597,12 +595,12 @@ error:
int
main(int argc, char *argv[])
{
- hid_t fapl=-1, file=-1, fcpl=-1;
- herr_t status;
- int nerrors = 0;
- unsigned size_of_test;
+ hid_t fapl=-1, file=-1, fcpl=-1;
+ herr_t status;
+ int nerrors = 0;
+ unsigned size_of_test;
unsigned u; /* Local index variable */
- char filename[1024];
+ char filename[1024];
int skip_test = 0;
int has_sparse_support = 0;
@@ -610,7 +608,7 @@ main(int argc, char *argv[])
if (1 == argc) {
size_of_test = TEST_SMALL | TEST_MEDIUM | TEST_LARGE;
} else {
- int i;
+ int i;
for (i = 1, size_of_test = 0; i < argc; i++) {
if (!strcmp(argv[i], "small")) {
size_of_test |= TEST_SMALL;
diff --git a/test/mf.c b/test/mf.c
index fea5ee2..35dfab3 100644
--- a/test/mf.c
+++ b/test/mf.c
@@ -6920,6 +6920,7 @@ test_mf_fs_gone(const char *env_h5_drvr, hid_t fapl, hbool_t new_format)
H5FD_mem_t type; /* File allocation type */
H5FS_stat_t fs_stat; /* Information for free-space manager */
haddr_t addr1, addr2, addr3, addr4; /* File address for H5FD_MEM_SUPER */
+ haddr_t addrx;
H5FD_mem_t fs_type;
hbool_t contig_addr_vfd;
hbool_t ran_H5MF_tidy_self_referential_fsm_hack = FALSE;
@@ -7054,6 +7055,12 @@ test_mf_fs_gone(const char *env_h5_drvr, hid_t fapl, hbool_t new_format)
if(H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr4, (hsize_t)TBLOCK_SIZE4) < 0)
FAIL_STACK_ERROR
+ if(!new_format) {
+ /* Need to take up this space so that the free-space manager will go away */
+ if(HADDR_UNDEF == (addrx = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)103)))
+ FAIL_STACK_ERROR
+ }
+
/* The H5FD_MEM_SUPER free-space manager will go away at H5MF_close() */
if(H5Fclose(file) < 0)
FAIL_STACK_ERROR
@@ -7065,7 +7072,6 @@ test_mf_fs_gone(const char *env_h5_drvr, hid_t fapl, hbool_t new_format)
/* Get a pointer to the internal file object */
if(NULL == (f = (H5F_t *)H5I_object(file)))
FAIL_STACK_ERROR
-
/* Verify that the H5FD_MEM_SUPER free-space manager is not there */
if(H5F_addr_defined(f->shared->fs_addr[fs_type]))
TEST_ERROR
diff --git a/test/objcopy.c b/test/objcopy.c
index 216d111..5d9d426 100644
--- a/test/objcopy.c
+++ b/test/objcopy.c
@@ -12,38 +12,54 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: Peter X. Cao
- * May 01, 2005
+ * Programmer: Peter X. Cao
+ * May 01, 2005
*
- * Purpose: Test H5Ocopy().
+ * Purpose: Test H5Ocopy().
*/
#include "testhdf5.h"
#include "H5srcdir.h"
+#include "H5Bprivate.h"
+#include "H5Iprivate.h"
+#include "H5Pprivate.h"
+
+#define H5F_FRIEND /*suppress error about including H5Fpkg */
+#define H5F_TESTING
+#include "H5Fpkg.h" /* File access */
+
/*
* This file needs to access private information from the H5S package.
* This file also needs to access the dataspace testing code.
*/
-#define H5S_FRIEND /*suppress error about including H5Spkg */
+#define H5S_FRIEND /*suppress error about including H5Spkg */
#define H5S_TESTING
-#include "H5Spkg.h" /* Dataspaces */
+#include "H5Spkg.h" /* Dataspaces */
/*
* This file needs to access private information from the H5P package.
* This file also needs to access the property list testing code.
*/
-#define H5P_FRIEND /*suppress error about including H5Ppkg */
+#define H5P_FRIEND /*suppress error about including H5Ppkg */
#define H5P_TESTING
-#include "H5Ppkg.h" /* Property Lists */
+#include "H5Ppkg.h" /* Property Lists */
/*
* This file needs to access private information from the H5D package.
* This file also needs to access the dataset testing code.
*/
-#define H5D_FRIEND /*suppress error about including H5Dpkg */
+#define H5D_FRIEND /*suppress error about including H5Dpkg */
#define H5D_TESTING
-#include "H5Dpkg.h" /* Datasets */
+#include "H5Dpkg.h" /* Datasets */
+
+/*
+ * This file needs to access private information from the H5O package.
+ * This file also needs to access the dataspace testing code.
+ */
+#define H5O_FRIEND /*suppress error about including H5Opkg */
+#define H5O_TESTING
+#include "H5Opkg.h" /* Object header */
const char *FILENAME[] = {
@@ -51,6 +67,8 @@ const char *FILENAME[] = {
"objcopy_dst",
"objcopy_ext",
"objcopy_src2",
+ "verbound_src",
+ "verbound_dst",
NULL
};
@@ -64,76 +82,77 @@ const char *FILENAME[] = {
#define CONFIG_DENSE 16
#define MAX_CONFIGURATION 31
-#define FILE_EXT "objcopy_ext.dat"
+#define FILE_EXT "objcopy_ext.dat"
/* The fill_old.h5 is generated from gen_old_fill.c in HDF5 'test' directory
* for version 1.4(after 1.4.3). To get this data file, simply compile
* gen_old_fill.c with HDF5 library (before v1.5) and run it. */
#define FILE_OLD_LAYOUT "fill_old.h5"
-#define NAME_DATATYPE_SIMPLE "H5T_NATIVE_INT"
-#define NAME_DATATYPE_SIMPLE2 "H5T_NATIVE_INT-2"
-#define NAME_DATATYPE_VL "vlen of int"
-#define NAME_DATATYPE_VL_VL "vlen of vlen of int"
-#define NAME_DATASET_SIMPLE "dataset_simple"
+#define NAME_DATATYPE_SIMPLE "H5T_NATIVE_INT"
+#define NAME_DATATYPE_SIMPLE2 "H5T_NATIVE_INT-2"
+#define NAME_DATATYPE_VL "vlen of int"
+#define NAME_DATATYPE_VL_VL "vlen of vlen of int"
+#define NAME_DATASET_SIMPLE "dataset_simple"
#define NAME_DATASET_SIMPLE2 "dataset_simple_copy"
#define NAME_DATASET_SIMPLE3 "dataset_simple_another_copy"
-#define NAME_DATASET_COMPOUND "dataset_compound"
-#define NAME_DATASET_CHUNKED "dataset_chunked"
-#define NAME_DATASET_CHUNKED_SINGLE "dataset_chunked_single"
-#define NAME_DATASET_CHUNKED2 "dataset_chunked2"
-#define NAME_DATASET_CHUNKED2_SINGLE "dataset_chunked2_single"
-#define NAME_DATASET_CHUNKED3 "dataset_chunked3"
-#define NAME_DATASET_CHUNKED3_SINGLE "dataset_chunked3_single"
-#define NAME_DATASET_CHUNKED4 "dataset_chunked4"
-#define NAME_DATASET_CHUNKED4_SINGLE "dataset_chunked4_single"
-#define NAME_DATASET_COMPACT "dataset_compact"
-#define NAME_DATASET_EXTERNAL "dataset_ext"
-#define NAME_DATASET_NAMED_DTYPE "dataset_named_dtype"
-#define NAME_DATASET_NAMED_DTYPE2 "dataset_named_dtype2"
-#define NAME_DATASET_MULTI_OHDR "dataset_multi_ohdr"
-#define NAME_DATASET_MULTI_OHDR2 "dataset_multi_ohdr2"
-#define NAME_DATASET_VL "dataset_vl"
-#define NAME_DATASET_VL2 "dataset_vl2"
-#define NAME_DATASET_VL_VL "dataset_vl_vl"
-#define NAME_DATASET_VL_VL2 "dataset_vl_vl2"
-#define NAME_DATASET_CMPD_VL "dataset_cmpd_vl"
-#define NAME_DATASET_SUB_SUB "/g0/g00/g000/dataset_simple"
-#define NAME_GROUP_UNCOPIED "/uncopied"
-#define NAME_GROUP_EMPTY "/empty"
-#define NAME_GROUP_TOP "/g0"
+#define NAME_DATASET_COMPOUND "dataset_compound"
+#define NAME_DATASET_CHUNKED "dataset_chunked"
+#define NAME_DATASET_CHUNKED_SINGLE "dataset_chunked_single"
+#define NAME_DATASET_CHUNKED2 "dataset_chunked2"
+#define NAME_DATASET_CHUNKED2_SINGLE "dataset_chunked2_single"
+#define NAME_DATASET_CHUNKED3 "dataset_chunked3"
+#define NAME_DATASET_CHUNKED3_SINGLE "dataset_chunked3_single"
+#define NAME_DATASET_CHUNKED4 "dataset_chunked4"
+#define NAME_DATASET_CHUNKED4_SINGLE "dataset_chunked4_single"
+#define NAME_DATASET_COMPACT "dataset_compact"
+#define NAME_DATASET_EXTERNAL "dataset_ext"
+#define NAME_DATASET_NAMED_DTYPE "dataset_named_dtype"
+#define NAME_DATASET_NAMED_DTYPE2 "dataset_named_dtype2"
+#define NAME_DATASET_MULTI_OHDR "dataset_multi_ohdr"
+#define NAME_DATASET_MULTI_OHDR2 "dataset_multi_ohdr2"
+#define NAME_DATASET_VL "dataset_vl"
+#define NAME_DATASET_VL2 "dataset_vl2"
+#define NAME_DATASET_VL_VL "dataset_vl_vl"
+#define NAME_DATASET_VL_VL2 "dataset_vl_vl2"
+#define NAME_DATASET_CMPD_VL "dataset_cmpd_vl"
+#define NAME_DATASET_SUB_SUB "/g0/g00/g000/dataset_simple"
+#define NAME_GROUP_UNCOPIED "/uncopied"
+#define NAME_GROUP_EMPTY "/empty"
+#define NAME_GROUP_TOP "/g0"
#define NAME_GROUP_TOP2 "/g1"
#define NAME_GROUP_TOP3 "/g2"
#define NAME_GROUP_TOP4 "/g3"
-#define NAME_GROUP_SUB "/g0/g00"
-#define NAME_GROUP_SUB_2 "/g0/g01"
-#define NAME_GROUP_SUB_SUB "/g0/g00/g000"
-#define NAME_GROUP_SUB_SUB2 "g000"
-#define NAME_GROUP_DATASET "/g0/dataset_simple"
-#define NAME_GROUP_LINK "/g_links"
-#define NAME_GROUP_LINK2 "/g_links2"
-#define NAME_GROUP_LOOP "g_loop"
-#define NAME_GROUP_LOOP2 "g_loop2"
-#define NAME_GROUP_LOOP3 "g_loop3"
-#define NAME_GROUP_REF "ref_grp"
-#define NAME_LINK_DATASET "/g_links/dataset_simple"
-#define NAME_LINK_HARD "/g_links/hard_link_to_dataset_simple"
-#define NAME_LINK_SOFT "/g_links/soft_link_to_dataset_simple"
-#define NAME_LINK_SOFT2 "/g_links2/soft_link_to_dataset_simple"
-#define NAME_LINK_EXTERN "/g_links/external_link_to_dataset_simple"
+#define NAME_GROUP_SUB "/g0/g00"
+#define NAME_GROUP_SUB_2 "/g0/g01"
+#define NAME_GROUP_SUB_SUB "/g0/g00/g000"
+#define NAME_GROUP_SUB_SUB2 "g000"
+#define NAME_GROUP_DATASET "/g0/dataset_simple"
+#define NAME_GROUP_LINK "/g_links"
+#define NAME_GROUP_LINK2 "/g_links2"
+#define NAME_GROUP_LOOP "g_loop"
+#define NAME_GROUP_LOOP2 "g_loop2"
+#define NAME_GROUP_LOOP3 "g_loop3"
+#define NAME_GROUP_REF "ref_grp"
+#define NAME_LINK_DATASET "/g_links/dataset_simple"
+#define NAME_LINK_HARD "/g_links/hard_link_to_dataset_simple"
+#define NAME_LINK_SOFT "/g_links/soft_link_to_dataset_simple"
+#define NAME_LINK_SOFT2 "/g_links2/soft_link_to_dataset_simple"
+#define NAME_LINK_EXTERN "/g_links/external_link_to_dataset_simple"
#define NAME_LINK_EXTERN2 "/g_links2/external_link_to_dataset_simple"
-#define NAME_LINK_SOFT_DANGLE "/g_links/soft_link_to_nowhere"
-#define NAME_LINK_SOFT_DANGLE2 "/g_links2/soft_link_to_nowhere"
+#define NAME_LINK_SOFT_DANGLE "/g_links/soft_link_to_nowhere"
+#define NAME_LINK_SOFT_DANGLE2 "/g_links2/soft_link_to_nowhere"
#define NAME_LINK_EXTERN_DANGLE "/g_links/external_link_to_nowhere"
#define NAME_LINK_EXTERN_DANGLE2 "/g_links2/external_link_to_nowhere"
-#define NAME_OLD_FORMAT "/dset1"
+#define NAME_OLD_FORMAT "/dset1"
+#define NAME_DSET_NULL "DSET_NULL"
#define NAME_BUF_SIZE 1024
#define ATTR_NAME_LEN 80
#define DIM_SIZE_1 12
#define DIM_SIZE_2 6
-#define MAX_DIM_SIZE_1 100
-#define MAX_DIM_SIZE_2 80
+#define MAX_DIM_SIZE_1 100
+#define MAX_DIM_SIZE_2 80
#define CHUNK_SIZE_1 5 /* Not an even fraction of dimension sizes, so we test copying partial chunks */
#define CHUNK_SIZE_2 5
#define NUM_SUB_GROUPS 20
@@ -160,7 +179,7 @@ static int
compare_datasets(hid_t did, hid_t did2, hid_t pid, const void *wbuf);
static int
compare_groups(hid_t gid, hid_t gid2, hid_t pid, int depth, unsigned copy_flags);
-static int
+static int
compare_idx_type(hid_t fapl, hid_t did, H5D_chunk_index_t new_type, H5D_chunk_index_t old_type);
static int
@@ -170,7 +189,7 @@ attach_attribute_compound_vlstr(hid_t loc_id);
static int
compare_attribute_compound_vlstr(hid_t loc, hid_t loc2);
-
+
/*-------------------------------------------------------------------------
* Function: addr_insert
*
@@ -204,7 +223,7 @@ addr_insert(H5O_info_t *oi)
idtab_g.obj[n] = oi->addr;
} /* end addr_insert() */
-
+
/*-------------------------------------------------------------------------
* Function: addr_lookup
*
@@ -233,7 +252,7 @@ addr_lookup(H5O_info_t *oi)
return FALSE;
} /* end addr_lookup() */
-
+
/*-------------------------------------------------------------------------
* Function: addr_reset
*
@@ -255,7 +274,7 @@ addr_reset(void)
idtab_g.nalloc = idtab_g.nobjs = 0;
} /* end addr_reset() */
-
+
/*-------------------------------------------------------------------------
* Function: attach_ref_attr
*
@@ -316,7 +335,7 @@ error:
return(-1);
}
-
+
/*-------------------------------------------------------------------------
* Function: attach_reg_ref_attr
*
@@ -393,7 +412,7 @@ error:
return(-1);
}
-
+
/*-------------------------------------------------------------------------
* Function: create_reg_ref_dataset
*
@@ -488,7 +507,7 @@ error:
return(-1);
}
-
+
/*-------------------------------------------------------------------------
* Function: attach_attribute_vl
*
@@ -550,13 +569,13 @@ done:
} /* end of attach_attribute_vl */
-
+
/*-------------------------------------------------------------------------
* Function: test_copy_attach_attributes
*
* Purpose: Attach NUM_ATTRIBUTES attributes to the object to be copied
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
* Programmer: Peter Cao
* Friday, September 30, 2005
@@ -624,13 +643,13 @@ done:
return ret_value;
}
-
+
/*-------------------------------------------------------------------------
* Function: test_copy_attach_paired_attributes
*
* Purpose: Attach NUM_ATTRIBUTES attributes to a pair of objects to be copied
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
* Tuesday, November 1, 2005
@@ -693,7 +712,7 @@ done:
return -1;
} /* end test_copy_attach_paired_attributes() */
-
+
/*-------------------------------------------------------------------------
* Function: compare_attribute
*
@@ -824,18 +843,18 @@ error:
return FALSE;
} /* end compare_attribute() */
-
+
/*-------------------------------------------------------------------------
* Function: compare_std_attributes
*
* Purpose: Compare "standard" attributes on two objects to check that they are equal
*
- * Return: TRUE if objects have same attributes/FALSE if they are different
+ * Return: TRUE if objects have same attributes/FALSE if they are different
*
* Programmer: Quincey Koziol
* Monday, October 31, 2005
*
- * Note: This isn't very general, the attributes are assumed to be
+ * Note: This isn't very general, the attributes are assumed to be
* those written in test_copy_attach_attributes().
*
* Modifier: Peter Cao
@@ -896,19 +915,19 @@ compare_std_attributes(hid_t oid, hid_t oid2, hid_t pid)
error:
H5E_BEGIN_TRY {
- H5Aclose(aid2);
- H5Aclose(aid);
+ H5Aclose(aid2);
+ H5Aclose(aid);
} H5E_END_TRY;
return FALSE;
} /* end compare_std_attributes() */
-
+
/*-------------------------------------------------------------------------
* Function: compare_data
*
* Purpose: Compare two buffers of data to check that they are equal
*
- * Return: TRUE if buffer are equal/FALSE if they are different
+ * Return: TRUE if buffer are equal/FALSE if they are different
*
* Programmer: Quincey Koziol
* Monday, November 21, 2005
@@ -1169,13 +1188,13 @@ error:
return FALSE;
} /* end compare_data() */
-
+
/*-------------------------------------------------------------------------
* Function: compare_datasets
*
* Purpose: Compare two datasets to check that they are equal
*
- * Return: TRUE if datasets are equal/FALSE if they are different
+ * Return: TRUE if datasets are equal/FALSE if they are different
*
* Programmer: Quincey Koziol
* Tuesday, October 25, 2005
@@ -1332,23 +1351,23 @@ error:
HDfree(rbuf);
if(rbuf2)
HDfree(rbuf2);
- H5Pclose(dcpl2);
- H5Pclose(dcpl);
- H5Sclose(sid2);
- H5Sclose(sid);
- H5Tclose(tid2);
- H5Tclose(tid);
+ H5Pclose(dcpl2);
+ H5Pclose(dcpl);
+ H5Sclose(sid2);
+ H5Sclose(sid);
+ H5Tclose(tid2);
+ H5Tclose(tid);
} H5E_END_TRY;
return FALSE;
} /* end compare_datasets() */
-
+
/*-------------------------------------------------------------------------
* Function: compare_groups
*
* Purpose: Compare two groups to check that they are "equal"
*
- * Return: TRUE if group are equal/FALSE if they are different
+ * Return: TRUE if group are equal/FALSE if they are different
*
* Programmer: Quincey Koziol
* Monday, October 31, 2005
@@ -1498,48 +1517,48 @@ error:
return FALSE;
} /* end compare_groups() */
-
+
/*-------------------------------------------------------------------------
* Function: compare_idx_type
*
* Purpose: If using new format, the index array type should be NEW_TYPE
- * If not, the index array type should be OLD_TYPE
+ * If not, the index array type should be OLD_TYPE
*
- * Return: TRUE if the index type retrieved for the dataset DID is
- * as expected
- * FALSE if not
+ * Return: TRUE if the index type retrieved for the dataset DID is
+ * as expected
+ * FALSE if not
*
* Programmer: Vailin Choi; August 2009
*
*-------------------------------------------------------------------------
*/
-static int
+static int
compare_idx_type(hid_t fapl, hid_t did, H5D_chunk_index_t new_type, H5D_chunk_index_t old_type)
{
H5D_chunk_index_t idx_type; /* Dataset chunk index type */
H5F_libver_t low; /* File format low bound */
/* Get the chunk index type */
- if(H5D__layout_idx_type_test(did, &idx_type) < 0)
- FAIL_STACK_ERROR
+ if(H5D__layout_idx_type_test(did, &idx_type) < 0)
+ FAIL_STACK_ERROR
/* Check if we are using the latest version of the format */
- if(H5Pget_libver_bounds(fapl, &low, NULL) < 0)
- FAIL_STACK_ERROR
+ if(H5Pget_libver_bounds(fapl, &low, NULL) < 0)
+ FAIL_STACK_ERROR
/* Verify index type */
if(low == H5F_LIBVER_LATEST) {
- if(idx_type != new_type)
- TEST_ERROR
- } else if(idx_type != old_type)
- TEST_ERROR
+ if(idx_type != new_type)
+ TEST_ERROR
+ } else if(idx_type != old_type)
+ TEST_ERROR
return TRUE;
error:
return FALSE;
} /* compare_idx_type() */
-
+
/*-------------------------------------------------------------------------
* Function: test_copy_named_datatype
*
@@ -1560,8 +1579,8 @@ test_copy_named_datatype(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t d
{
hid_t fid_src = -1, fid_dst = -1; /* File IDs */
hid_t tid = -1, tid2 = -1; /* Datatype IDs */
- char src_filename[NAME_BUF_SIZE];
- char dst_filename[NAME_BUF_SIZE];
+ char src_filename[NAME_BUF_SIZE];
+ char dst_filename[NAME_BUF_SIZE];
TESTING("H5Ocopy(): named datatype");
@@ -1626,15 +1645,15 @@ test_copy_named_datatype(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t d
error:
H5E_BEGIN_TRY {
- H5Tclose(tid2);
- H5Tclose(tid);
- H5Fclose(fid_dst);
- H5Fclose(fid_src);
+ H5Tclose(tid2);
+ H5Tclose(tid);
+ H5Fclose(fid_dst);
+ H5Fclose(fid_src);
} H5E_END_TRY;
return 1;
} /* end test_copy_named_datatype */
-
+
/*-------------------------------------------------------------------------
* Function: test_copy_named_datatype_vl
*
@@ -1653,8 +1672,8 @@ test_copy_named_datatype_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_
{
hid_t fid_src = -1, fid_dst = -1; /* File IDs */
hid_t tid = -1, tid2 = -1; /* Datatype IDs */
- char src_filename[NAME_BUF_SIZE];
- char dst_filename[NAME_BUF_SIZE];
+ char src_filename[NAME_BUF_SIZE];
+ char dst_filename[NAME_BUF_SIZE];
TESTING("H5Ocopy(): named vlen datatype");
@@ -1719,15 +1738,15 @@ test_copy_named_datatype_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_
error:
H5E_BEGIN_TRY {
- H5Tclose(tid2);
- H5Tclose(tid);
- H5Fclose(fid_dst);
- H5Fclose(fid_src);
+ H5Tclose(tid2);
+ H5Tclose(tid);
+ H5Fclose(fid_dst);
+ H5Fclose(fid_src);
} H5E_END_TRY;
return 1;
} /* end test_copy_named_datatype_vl */
-
+
/*-------------------------------------------------------------------------
* Function: test_copy_named_datatype_vl_vl
*
@@ -1746,8 +1765,8 @@ test_copy_named_datatype_vl_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, h
{
hid_t fid_src = -1, fid_dst = -1; /* File IDs */
hid_t tid = -1, tid2 = -1; /* Datatype IDs */
- char src_filename[NAME_BUF_SIZE];
- char dst_filename[NAME_BUF_SIZE];
+ char src_filename[NAME_BUF_SIZE];
+ char dst_filename[NAME_BUF_SIZE];
TESTING("H5Ocopy(): named nested vlen datatype");
@@ -1818,15 +1837,15 @@ test_copy_named_datatype_vl_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, h
error:
H5E_BEGIN_TRY {
- H5Tclose(tid2);
- H5Tclose(tid);
- H5Fclose(fid_dst);
- H5Fclose(fid_src);
+ H5Tclose(tid2);
+ H5Tclose(tid);
+ H5Fclose(fid_dst);
+ H5Fclose(fid_src);
} H5E_END_TRY;
return 1;
} /* end test_copy_named_datatype_vl_vl */
-
+
/*-------------------------------------------------------------------------
* Function: test_copy_named_datatype_attr_self
*
@@ -1969,7 +1988,7 @@ error:
return 1;
} /* end test_copy_named_datatype_attr_self */
-
+
/*-------------------------------------------------------------------------
* Function: test_copy_dataset_simple
*
@@ -2078,16 +2097,194 @@ test_copy_dataset_simple(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t d
error:
H5E_BEGIN_TRY {
- H5Dclose(did2);
- H5Dclose(did);
- H5Sclose(sid);
- H5Fclose(fid_dst);
- H5Fclose(fid_src);
+ H5Dclose(did2);
+ H5Dclose(did);
+ H5Sclose(sid);
+ H5Fclose(fid_dst);
+ H5Fclose(fid_src);
} H5E_END_TRY;
return 1;
} /* end test_copy_dataset_simple */
-
+
+/*-------------------------------------------------------------------------
+ * Function: test_copy_dataset_versionbounds
+ *
+ * Purpose: Verify copying dataset works as expected in various version
+ * bound combination.
+ *
+ * Description:
+ * Create a simple dataset in SRC file using default versions.
+ * For each valid version bound combination, create a DST file,
+ * and attempt to copy the SRC dataset to the DST file.
+ * When copying fails, verify that the failure is a result of
+ * the invalid bounds, that is, DST has lower bounds than SRC.
+ *
+ * Return: Success: 0
+ * Failure: 1
+ *
+ *-------------------------------------------------------------------------
+ */
+static int
+test_copy_dataset_versionbounds(hid_t fcpl_src, hid_t fapl_src)
+{
+ hid_t fid_src = -1, fid_dst = -1; /* Source and destination file IDs */
+ hid_t fapl_dst = -1; /* File access plist for dest file */
+ hid_t sid = -1; /* Dataspace ID */
+ hid_t did_src = -1, did_dst = -1; /* Source and destination dataset IDs */
+ int buf[DIM_SIZE_1][DIM_SIZE_2]; /* Buffer for writing data */
+ hsize_t dim2d[2]; /* Dataset dimensions */
+ char src_fname[NAME_BUF_SIZE]; /* Name of source file */
+ char dst_fname[NAME_BUF_SIZE]; /* Name of destination file */
+ H5F_libver_t low, high; /* File format bounds */
+ H5F_libver_t low_src, high_src; /* Source file format bounds */
+ unsigned srcdset_fillversion; /* Fill version of source dataset */
+ hbool_t valid_high = FALSE; /* TRUE if high bound is valid */
+ int i, j; /* Local index variables */
+ H5D_t *dsetp = NULL; /* Pointer to internal dset structure */
+ herr_t ret; /* Generic return value */
+
+ TESTING("H5Ocopy(): simple dataset with version bounds");
+
+ /* Initialize write buffer */
+ for (i=0; i<DIM_SIZE_1; i++)
+ for (j=0; j<DIM_SIZE_2; j++)
+ buf[i][j] = 10000 + 100*i+j;
+
+ /* Create a file access property list for destination file */
+ if ((fapl_dst = H5Pcreate(H5P_FILE_ACCESS)) < 0) TEST_ERROR
+
+ /* Initialize the filenames */
+ h5_fixname(FILENAME[4], fapl_src, src_fname, sizeof src_fname);
+ h5_fixname(FILENAME[5], fapl_dst, dst_fname, sizeof dst_fname);
+
+ /* Reset file address checking info */
+ addr_reset();
+
+ /* Create source file */
+ fid_src = H5Fcreate(src_fname, H5F_ACC_TRUNC, fcpl_src, fapl_src);
+ if (fid_src < 0) TEST_ERROR
+
+ /* Set dataspace dimensions */
+ dim2d[0] = DIM_SIZE_1;
+ dim2d[1] = DIM_SIZE_2;
+
+ /* Create 2D dataspace */
+ if((sid = H5Screate_simple(2, dim2d, NULL)) < 0) TEST_ERROR
+
+ /* Create 2D int dataset in SRC file */
+ did_src = H5Dcreate2(fid_src, NAME_DATASET_SIMPLE, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ if (did_src < 0) TEST_ERROR
+
+ /* Write data into SRC file */
+ ret = H5Dwrite(did_src, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf);
+ if (ret < 0) TEST_ERROR
+
+ /* Get the internal dset ptr to get the fill version for verifying later */
+ if ((dsetp = (H5D_t *)H5I_object(did_src)) == NULL) TEST_ERROR
+ srcdset_fillversion = dsetp->shared->dcpl_cache.fill.version;
+
+ /* Close dataspace */
+ if(H5Sclose(sid) < 0) TEST_ERROR
+
+ /* Close the dataset */
+ if(H5Dclose(did_src) < 0) TEST_ERROR
+
+ /* Close the SRC file */
+ if(H5Fclose(fid_src) < 0) TEST_ERROR
+
+ /* Open the source file with read-only */
+ fid_src = H5Fopen(src_fname, H5F_ACC_RDONLY, fapl_src);
+ if (fid_src < 0) TEST_ERROR
+
+ /* Loop through all the combinations of low/high library format bounds,
+ skipping invalid combinations. Create a destination file and copy the
+ source dataset to it, then verify */
+ for(low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; low++) {
+ for(high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; high++) {
+
+ /* Set version bounds */
+ H5E_BEGIN_TRY {
+ ret = H5Pset_libver_bounds(fapl_dst, low, high);
+ } H5E_END_TRY;
+
+ if (ret < 0) /* Invalid low/high combinations */
+ continue;
+
+ /* Create destination file */
+ fid_dst = H5Fcreate(dst_fname, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_dst);
+ if (fid_dst < 0) TEST_ERROR
+
+ /* Create an uncopied object in destination file so that addresses
+ in source and destination files aren't the same */
+ if(H5Gclose(H5Gcreate2(fid_dst, NAME_GROUP_UNCOPIED, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
+
+ /* Try to copy the dataset */
+ H5E_BEGIN_TRY {
+ ret = H5Ocopy(fid_src, NAME_DATASET_SIMPLE, fid_dst, NAME_DATASET_SIMPLE, H5P_DEFAULT, H5P_DEFAULT);
+ } H5E_END_TRY;
+
+ /* If copy failed, check if the failure is expected */
+ if (ret < 0)
+ {
+ /* Failure is valid if fill version of source dataset is
+ greater than destination */
+ if (srcdset_fillversion <= H5O_fill_ver_bounds[high])
+ TEST_ERROR
+
+ /* Close the DST file before continue */
+ if(H5Fclose(fid_dst) < 0) TEST_ERROR
+ continue;
+ }
+
+ /* Close the DST file */
+ if(H5Fclose(fid_dst) < 0) TEST_ERROR
+
+ /* Open destination file */
+ fid_dst = H5Fopen(dst_fname, H5F_ACC_RDWR, fapl_dst);
+ if (fid_dst < 0) TEST_ERROR
+
+ /* Open the datasets to compare */
+ did_src = H5Dopen2(fid_src, NAME_DATASET_SIMPLE, H5P_DEFAULT);
+ if (did_src < 0) TEST_ERROR
+ did_dst = H5Dopen2(fid_dst, NAME_DATASET_SIMPLE, H5P_DEFAULT);
+ if (did_dst < 0) TEST_ERROR
+
+ /* Check if the datasets are equal */
+ if (compare_datasets(did_src, did_dst, H5P_DEFAULT, buf) != TRUE)
+ TEST_ERROR
+
+ /* Close the datasets */
+ if(H5Dclose(did_dst) < 0) TEST_ERROR
+ if(H5Dclose(did_src) < 0) TEST_ERROR
+
+ /* Close the DST file */
+ if(H5Fclose(fid_dst) < 0) TEST_ERROR
+
+ } /* for high */
+ } /* for low */
+
+ /* Close property list and source file */
+ if (H5Pclose(fapl_dst) < 0) TEST_ERROR
+ if (H5Fclose(fid_src) < 0) TEST_ERROR
+
+ PASSED();
+ return 0;
+
+error:
+ H5E_BEGIN_TRY {
+ H5Dclose(did_dst);
+ H5Dclose(did_src);
+ H5Sclose(sid);
+ H5Pclose(fapl_dst);
+ H5Fclose(fid_dst);
+ H5Fclose(fid_src);
+ } H5E_END_TRY;
+
+ return 1;
+} /* end test_copy_dataset_versionbounds */
+
+
/*-------------------------------------------------------------------------
* Function: test_copy_dataset_simple_samefile
*
@@ -2185,22 +2382,22 @@ test_copy_dataset_simple_samefile(hid_t fcpl, hid_t fapl)
error:
H5E_BEGIN_TRY {
- H5Dclose(did2);
- H5Dclose(did);
- H5Sclose(sid);
- H5Fclose(fid);
+ H5Dclose(did2);
+ H5Dclose(did);
+ H5Sclose(sid);
+ H5Fclose(fid);
} H5E_END_TRY;
return 1;
} /* end test_copy_dataset_simple_samefile */
-
+
/*-------------------------------------------------------------------------
* Function: test_copy_dataset_simple_empty
*
* Purpose: Create a simple dataset in SRC file and copy it to DST file
* (Note: dataset has no data)
*
- * Note: The parameter "test_open" is added to test for H5Ocopy when
+ * Note: The parameter "test_open" is added to test for H5Ocopy when
* the dataset is open in the file (HDFFV-7853).
*
* Return: Success: 0
@@ -2303,16 +2500,16 @@ test_copy_dataset_simple_empty(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, h
error:
H5E_BEGIN_TRY {
- H5Dclose(did2);
- H5Dclose(did);
- H5Sclose(sid);
- H5Fclose(fid_dst);
- H5Fclose(fid_src);
+ H5Dclose(did2);
+ H5Dclose(did);
+ H5Sclose(sid);
+ H5Fclose(fid_dst);
+ H5Fclose(fid_src);
} H5E_END_TRY;
return 1;
} /* end test_copy_dataset_simple_empty */
-
+
/*-------------------------------------------------------------------------
* Function: test_copy_dataset_compound
*
@@ -2434,17 +2631,17 @@ test_copy_dataset_compound(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t
error:
H5E_BEGIN_TRY {
- H5Dclose(did2);
- H5Dclose(did);
- H5Tclose(tid);
- H5Sclose(sid);
- H5Fclose(fid_dst);
- H5Fclose(fid_src);
+ H5Dclose(did2);
+ H5Dclose(did);
+ H5Tclose(tid);
+ H5Sclose(sid);
+ H5Fclose(fid_dst);
+ H5Fclose(fid_src);
} H5E_END_TRY;
return 1;
} /* end test_copy_dataset_compound */
-
+
/*-------------------------------------------------------------------------
* Function: test_copy_dataset_chunked
*
@@ -2526,10 +2723,10 @@ test_copy_dataset_chunked(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t
/* close the dataset */
if(H5Dclose(did) < 0) TEST_ERROR
- /*
+ /*
* Create 1-D dataset: chunked, non-filterd, with data
- * dims=max dims=chunk dims
- * H5D_ALLOC_TIME_INC (default)
+ * dims=max dims=chunk dims
+ * H5D_ALLOC_TIME_INC (default)
*/
/* create 1-D dataspace */
if((sid = H5Screate_simple(1, dim1d, dim1d)) < 0) TEST_ERROR
@@ -2601,9 +2798,9 @@ test_copy_dataset_chunked(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t
/* close the dataset */
if(H5Dclose(did) < 0) TEST_ERROR
- /*
+ /*
* Create 2-D dataset: chunked, non-filterd, with data, dims=chunk dims,
- * H5D_ALLOC_TIME_INC (default)
+ * H5D_ALLOC_TIME_INC (default)
*/
/* create 2-D dataspace */
@@ -2625,9 +2822,9 @@ test_copy_dataset_chunked(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t
/* close the dataset */
if(H5Dclose(did) < 0) TEST_ERROR
- /*
+ /*
* Create 2-D dataset: chunked, non-filterd, with data, dims=chunk dims,
- * H5D_ALLOC_TIME_EARLY
+ * H5D_ALLOC_TIME_EARLY
*/
if(H5Pset_alloc_time(pid, H5D_ALLOC_TIME_EARLY) < 0) TEST_ERROR
@@ -2649,9 +2846,9 @@ test_copy_dataset_chunked(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t
/* close chunk plist */
if(H5Pclose(pid) < 0) TEST_ERROR
- /*
+ /*
* Create 2-D dataset: chunked, non-filterd, with data, dims=max dims=chunk dims,
- * H5D_ALLOC_TIME_LATE
+ * H5D_ALLOC_TIME_LATE
*/
/* create 2-D dataspace */
if((sid = H5Screate_simple(2, dim2d, dim2d)) < 0) TEST_ERROR
@@ -2710,7 +2907,7 @@ test_copy_dataset_chunked(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t
/* Check if the array index type is correct */
if(compare_idx_type(src_fapl, did2, H5D_CHUNK_IDX_EARRAY, H5D_CHUNK_IDX_BTREE) != TRUE)
- TEST_ERROR
+ TEST_ERROR
/* Check if the datasets are equal */
if(compare_datasets(did, did2, H5P_DEFAULT, buf1d) != TRUE) TEST_ERROR
@@ -2730,7 +2927,7 @@ test_copy_dataset_chunked(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t
/* Check if the array index type is correct */
if(compare_idx_type(src_fapl, did2, H5D_CHUNK_IDX_SINGLE, H5D_CHUNK_IDX_BTREE) != TRUE)
- TEST_ERROR
+ TEST_ERROR
/* Check if the datasets are equal */
if(compare_datasets(did, did2, H5P_DEFAULT, buf1d) != TRUE) TEST_ERROR
@@ -2749,7 +2946,7 @@ test_copy_dataset_chunked(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t
/* Check if the array index type is correct */
if(compare_idx_type(src_fapl, did2, H5D_CHUNK_IDX_FARRAY, H5D_CHUNK_IDX_BTREE) != TRUE)
- TEST_ERROR
+ TEST_ERROR
/* Check if the datasets are equal */
if(compare_datasets(did, did2, H5P_DEFAULT, buf2d) != TRUE) TEST_ERROR
@@ -2769,7 +2966,7 @@ test_copy_dataset_chunked(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t
/* Check if the array index type is correct */
if(compare_idx_type(src_fapl, did2, H5D_CHUNK_IDX_NONE, H5D_CHUNK_IDX_BTREE) != TRUE)
- TEST_ERROR
+ TEST_ERROR
/* Check if the datasets are equal */
if(compare_datasets(did, did2, H5P_DEFAULT, buf2d) != TRUE) TEST_ERROR
@@ -2788,7 +2985,7 @@ test_copy_dataset_chunked(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t
/* Check if the array index type is correct */
if(compare_idx_type(src_fapl, did2, H5D_CHUNK_IDX_SINGLE, H5D_CHUNK_IDX_BTREE) != TRUE)
- TEST_ERROR
+ TEST_ERROR
/* Check if the datasets are equal */
if(compare_datasets(did, did2, H5P_DEFAULT, buf2d) != TRUE) TEST_ERROR
@@ -2807,7 +3004,7 @@ test_copy_dataset_chunked(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t
/* Check if the array index type is correct */
if(compare_idx_type(src_fapl, did2, H5D_CHUNK_IDX_SINGLE, H5D_CHUNK_IDX_BTREE) != TRUE)
- TEST_ERROR
+ TEST_ERROR
/* Check if the datasets are equal */
if(compare_datasets(did, did2, H5P_DEFAULT, buf2d) != TRUE) TEST_ERROR
@@ -2826,7 +3023,7 @@ test_copy_dataset_chunked(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t
/* Check if the array index type is correct */
if(compare_idx_type(src_fapl, did2, H5D_CHUNK_IDX_SINGLE, H5D_CHUNK_IDX_BTREE) != TRUE)
- TEST_ERROR
+ TEST_ERROR
/* Check if the datasets are equal */
if(compare_datasets(did, did2, H5P_DEFAULT, buf2d) != TRUE) TEST_ERROR
@@ -2848,17 +3045,17 @@ test_copy_dataset_chunked(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t
error:
H5E_BEGIN_TRY {
- H5Dclose(did2);
- H5Dclose(did);
- H5Pclose(pid);
- H5Sclose(sid);
- H5Fclose(fid_dst);
- H5Fclose(fid_src);
+ H5Dclose(did2);
+ H5Dclose(did);
+ H5Pclose(pid);
+ H5Sclose(sid);
+ H5Fclose(fid_dst);
+ H5Fclose(fid_src);
} H5E_END_TRY;
return 1;
} /* end test_copy_dataset_chunked */
-
+
/*-------------------------------------------------------------------------
* Function: test_copy_dataset_chunked_empty
*
@@ -2926,9 +3123,9 @@ test_copy_dataset_chunked_empty(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl,
/* close the dataset */
if(H5Dclose(did) < 0) TEST_ERROR
- /*
+ /*
* create 1-D dataset: chunked, empty, non-filtered,
- * dims=max dims=chunk dims, H5D_ALLOC_TIME_INC(default)
+ * dims=max dims=chunk dims, H5D_ALLOC_TIME_INC(default)
*/
/* Set 1-D dataspace dimensions */
@@ -2996,9 +3193,9 @@ test_copy_dataset_chunked_empty(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl,
if(H5Dclose(did) < 0) TEST_ERROR
- /*
+ /*
* create 2-D dataset: chunked, empty, non-filtered,
- * dims=chunk dims, H5D_ALLOC_TIME_INC (default)
+ * dims=chunk dims, H5D_ALLOC_TIME_INC (default)
*/
/* Set 2-D dataspace dimensions */
@@ -3021,9 +3218,9 @@ test_copy_dataset_chunked_empty(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl,
/* close the dataset */
if(H5Dclose(did) < 0) TEST_ERROR
- /*
+ /*
* create 2-D dataset: chunked, empty, non-filtered, dims=chunk dims
- * H5D_ALLOC_TIME_EARLY
+ * H5D_ALLOC_TIME_EARLY
*/
/* Set allocation time to early */
if(H5Pset_alloc_time(pid, H5D_ALLOC_TIME_EARLY) < 0) TEST_ERROR
@@ -3043,9 +3240,9 @@ test_copy_dataset_chunked_empty(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl,
/* close the dataset */
if(H5Dclose(did) < 0) TEST_ERROR
- /*
- * create 2-D dataset: chunked, empty, non-filtered,
- * dims=max dims=chunk dims, H5D_ALLOC_TIME_LATE
+ /*
+ * create 2-D dataset: chunked, empty, non-filtered,
+ * dims=max dims=chunk dims, H5D_ALLOC_TIME_LATE
*/
/* Set 2-D dataspace dimensions */
@@ -3107,7 +3304,7 @@ test_copy_dataset_chunked_empty(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl,
/* Check if the array index type is correct */
if(compare_idx_type(src_fapl, did2, H5D_CHUNK_IDX_EARRAY, H5D_CHUNK_IDX_BTREE) != TRUE)
- TEST_ERROR
+ TEST_ERROR
/* Check if the datasets are equal */
if(compare_datasets(did, did2, H5P_DEFAULT, NULL) != TRUE) TEST_ERROR
@@ -3126,7 +3323,7 @@ test_copy_dataset_chunked_empty(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl,
/* Check if the array index type is correct */
if(compare_idx_type(src_fapl, did2, H5D_CHUNK_IDX_SINGLE, H5D_CHUNK_IDX_BTREE) != TRUE)
- TEST_ERROR
+ TEST_ERROR
/* Check if the datasets are equal */
if(compare_datasets(did, did2, H5P_DEFAULT, NULL) != TRUE) TEST_ERROR
@@ -3145,7 +3342,7 @@ test_copy_dataset_chunked_empty(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl,
/* Check if the array index type is correct */
if(compare_idx_type(src_fapl, did2, H5D_CHUNK_IDX_FARRAY, H5D_CHUNK_IDX_BTREE) != TRUE)
- TEST_ERROR
+ TEST_ERROR
/* Check if the datasets are equal */
if(compare_datasets(did, did2, H5P_DEFAULT, NULL) != TRUE) TEST_ERROR
@@ -3164,7 +3361,7 @@ test_copy_dataset_chunked_empty(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl,
/* Check if the array index type is correct */
if(compare_idx_type(src_fapl, did2, H5D_CHUNK_IDX_SINGLE, H5D_CHUNK_IDX_BTREE) != TRUE)
- TEST_ERROR
+ TEST_ERROR
/* Check if the datasets are equal */
if(compare_datasets(did, did2, H5P_DEFAULT, NULL) != TRUE) TEST_ERROR
@@ -3184,7 +3381,7 @@ test_copy_dataset_chunked_empty(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl,
/* Check if the array index type is correct */
if(compare_idx_type(src_fapl, did2, H5D_CHUNK_IDX_NONE, H5D_CHUNK_IDX_BTREE) != TRUE)
- TEST_ERROR
+ TEST_ERROR
/* Check if the datasets are equal */
if(compare_datasets(did, did2, H5P_DEFAULT, NULL) != TRUE) TEST_ERROR
@@ -3204,7 +3401,7 @@ test_copy_dataset_chunked_empty(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl,
/* Check if the array index type is correct */
if(compare_idx_type(src_fapl, did2, H5D_CHUNK_IDX_SINGLE, H5D_CHUNK_IDX_BTREE) != TRUE)
- TEST_ERROR
+ TEST_ERROR
/* Check if the datasets are equal */
if(compare_datasets(did, did2, H5P_DEFAULT, NULL) != TRUE) TEST_ERROR
@@ -3223,7 +3420,7 @@ test_copy_dataset_chunked_empty(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl,
/* Check if the array index type is correct */
if(compare_idx_type(src_fapl, did2, H5D_CHUNK_IDX_SINGLE, H5D_CHUNK_IDX_BTREE) != TRUE)
- TEST_ERROR
+ TEST_ERROR
/* Check if the datasets are equal */
if(compare_datasets(did, did2, H5P_DEFAULT, NULL) != TRUE) TEST_ERROR
@@ -3245,17 +3442,17 @@ test_copy_dataset_chunked_empty(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl,
error:
H5E_BEGIN_TRY {
- H5Dclose(did2);
- H5Dclose(did);
- H5Pclose(pid);
- H5Sclose(sid);
- H5Fclose(fid_dst);
- H5Fclose(fid_src);
+ H5Dclose(did2);
+ H5Dclose(did);
+ H5Pclose(pid);
+ H5Sclose(sid);
+ H5Fclose(fid_dst);
+ H5Fclose(fid_src);
} H5E_END_TRY;
return 1;
} /* end test_copy_dataset_chunked_empty */
-
+
/*-------------------------------------------------------------------------
* Function: test_copy_dataset_chunked_sparse
*
@@ -3479,7 +3676,7 @@ test_copy_dataset_chunked_sparse(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl,
/* Check if the array index type is correct */
if(compare_idx_type(src_fapl, did2, H5D_CHUNK_IDX_EARRAY, H5D_CHUNK_IDX_BTREE) != TRUE)
- TEST_ERROR
+ TEST_ERROR
/* Check if the datasets are equal */
if(compare_datasets(did, did2, H5P_DEFAULT, NULL) != TRUE) TEST_ERROR
@@ -3499,7 +3696,7 @@ test_copy_dataset_chunked_sparse(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl,
/* Check if the array index type is correct */
if(compare_idx_type(src_fapl, did2, H5D_CHUNK_IDX_BT2, H5D_CHUNK_IDX_BTREE) != TRUE)
- TEST_ERROR
+ TEST_ERROR
/* Check if the datasets are equal */
if(compare_datasets(did, did2, H5P_DEFAULT, NULL) != TRUE) TEST_ERROR
@@ -3519,7 +3716,7 @@ test_copy_dataset_chunked_sparse(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl,
/* Check if the array index type is correct */
if(compare_idx_type(src_fapl, did2, H5D_CHUNK_IDX_NONE, H5D_CHUNK_IDX_BTREE) != TRUE)
- TEST_ERROR
+ TEST_ERROR
/* Check if the datasets are equal */
if(compare_datasets(did, did2, H5P_DEFAULT, NULL) != TRUE) TEST_ERROR
@@ -3539,7 +3736,7 @@ test_copy_dataset_chunked_sparse(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl,
/* Check if the array index type is correct */
if(compare_idx_type(src_fapl, did2, H5D_CHUNK_IDX_NONE, H5D_CHUNK_IDX_BTREE) != TRUE)
- TEST_ERROR
+ TEST_ERROR
/* Check if the datasets are equal */
if(compare_datasets(did, did2, H5P_DEFAULT, NULL) != TRUE) TEST_ERROR
@@ -3562,17 +3759,17 @@ test_copy_dataset_chunked_sparse(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl,
error:
H5E_BEGIN_TRY {
- H5Dclose(did2);
- H5Dclose(did);
- H5Pclose(pid);
- H5Sclose(sid);
- H5Fclose(fid_dst);
- H5Fclose(fid_src);
+ H5Dclose(did2);
+ H5Dclose(did);
+ H5Pclose(pid);
+ H5Sclose(sid);
+ H5Fclose(fid_dst);
+ H5Fclose(fid_src);
} H5E_END_TRY;
return 1;
} /* end test_copy_dataset_chunked_sparse */
-
+
/*-------------------------------------------------------------------------
* Function: test_copy_dataset_compressed
*
@@ -3669,9 +3866,9 @@ test_copy_dataset_compressed(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid
/* close the dataset */
if(H5Dclose(did) < 0) TEST_ERROR
- /*
+ /*
* create 2-D dataset: chunked, filtered, with data
- * dims=max dims=chunk dims, H5D_ALLOC_TIME_INC(default)
+ * dims=max dims=chunk dims, H5D_ALLOC_TIME_INC(default)
*/
/* create dataspace */
if((sid = H5Screate_simple(2, dim2d, dim2d)) < 0) TEST_ERROR
@@ -3693,9 +3890,9 @@ test_copy_dataset_compressed(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid
/* close the dataset */
if(H5Dclose(did) < 0) TEST_ERROR
- /*
+ /*
* create 2-D dataset: chunked, filtered, with data
- * dims=chunk dims, H5D_ALLOC_TIME_EARLY
+ * dims=chunk dims, H5D_ALLOC_TIME_EARLY
*/
/* create dataspace */
if((sid = H5Screate_simple(2, dim2d, NULL)) < 0) TEST_ERROR
@@ -3721,9 +3918,9 @@ test_copy_dataset_compressed(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid
/* close the dataset */
if(H5Dclose(did) < 0) TEST_ERROR
- /*
+ /*
* create 2-D dataset: chunked, filtered, with data
- * dims=chunk dims, H5D_ALLOC_TIME_LATE
+ * dims=chunk dims, H5D_ALLOC_TIME_LATE
*/
/* create dataspace */
if((sid = H5Screate_simple(2, dim2d, NULL)) < 0) TEST_ERROR
@@ -3788,7 +3985,7 @@ test_copy_dataset_compressed(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid
if((did2 = H5Dopen2(fid_dst, NAME_DATASET_CHUNKED, H5P_DEFAULT)) < 0) TEST_ERROR
if(compare_idx_type(src_fapl, did2, H5D_CHUNK_IDX_FARRAY, H5D_CHUNK_IDX_BTREE) != TRUE)
- TEST_ERROR
+ TEST_ERROR
/* Check if the datasets are equal */
if(compare_datasets(did, did2, H5P_DEFAULT, NULL) != TRUE) TEST_ERROR
@@ -3807,7 +4004,7 @@ test_copy_dataset_compressed(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid
if((did2 = H5Dopen2(fid_dst, NAME_DATASET_CHUNKED2, H5P_DEFAULT)) < 0) TEST_ERROR
if(compare_idx_type(src_fapl, did2, H5D_CHUNK_IDX_FARRAY, H5D_CHUNK_IDX_BTREE) != TRUE)
- TEST_ERROR
+ TEST_ERROR
/* Check if the datasets are equal */
if(compare_datasets(did, did2, H5P_DEFAULT, NULL) != TRUE) TEST_ERROR
@@ -3825,7 +4022,7 @@ test_copy_dataset_compressed(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid
if((did2 = H5Dopen2(fid_dst, NAME_DATASET_CHUNKED2_SINGLE, H5P_DEFAULT)) < 0) TEST_ERROR
if(compare_idx_type(src_fapl, did2, H5D_CHUNK_IDX_SINGLE, H5D_CHUNK_IDX_BTREE) != TRUE)
- TEST_ERROR
+ TEST_ERROR
/* Check if the datasets are equal */
if(compare_datasets(did, did2, H5P_DEFAULT, NULL) != TRUE) TEST_ERROR
@@ -3843,7 +4040,7 @@ test_copy_dataset_compressed(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid
if((did2 = H5Dopen2(fid_dst, NAME_DATASET_CHUNKED3_SINGLE, H5P_DEFAULT)) < 0) TEST_ERROR
if(compare_idx_type(src_fapl, did2, H5D_CHUNK_IDX_SINGLE, H5D_CHUNK_IDX_BTREE) != TRUE)
- TEST_ERROR
+ TEST_ERROR
/* Check if the datasets are equal */
if(compare_datasets(did, did2, H5P_DEFAULT, NULL) != TRUE) TEST_ERROR
@@ -3861,7 +4058,7 @@ test_copy_dataset_compressed(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid
if((did2 = H5Dopen2(fid_dst, NAME_DATASET_CHUNKED4_SINGLE, H5P_DEFAULT)) < 0) TEST_ERROR
if(compare_idx_type(src_fapl, did2, H5D_CHUNK_IDX_SINGLE, H5D_CHUNK_IDX_BTREE) != TRUE)
- TEST_ERROR
+ TEST_ERROR
/* Check if the datasets are equal */
if(compare_datasets(did, did2, H5P_DEFAULT, NULL) != TRUE) TEST_ERROR
@@ -3885,24 +4082,24 @@ test_copy_dataset_compressed(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid
#ifdef H5_HAVE_FILTER_DEFLATE
error:
H5E_BEGIN_TRY {
- H5Dclose(did2);
- H5Dclose(did);
- H5Pclose(pid);
- H5Sclose(sid);
- H5Fclose(fid_dst);
- H5Fclose(fid_src);
+ H5Dclose(did2);
+ H5Dclose(did);
+ H5Pclose(pid);
+ H5Sclose(sid);
+ H5Fclose(fid_dst);
+ H5Fclose(fid_src);
} H5E_END_TRY;
return 1;
#endif /* H5_HAVE_FILTER_DEFLATE */
} /* end test_copy_dataset_compressed */
-
+
/*-------------------------------------------------------------------------
* Function: test_copy_dataset_no_edge_filt
*
* Purpose: Create a compressed, chunked dataset in SRC file and copy it to DST file
*
- * Note: The parameter "test_open" is added to test for H5Ocopy when
+ * Note: The parameter "test_open" is added to test for H5Ocopy when
* the dataset is open in the file (HDFFV-7853).
*
* Return: Success: 0
@@ -4053,13 +4250,13 @@ error:
#endif /* H5_HAVE_FILTER_DEFLATE */
} /* end test_copy_dataset_no_edge_filt */
-
+
/*-------------------------------------------------------------------------
* Function: test_copy_dataset_compact
*
* Purpose: Create a compact dataset in SRC file and copy it to DST file
*
- * Note: The parameter "test_open" is added to test for H5Ocopy when
+ * Note: The parameter "test_open" is added to test for H5Ocopy when
* the dataset is open in the file (HDFFV-7853).
*
* Return: Success: 0
@@ -4179,17 +4376,17 @@ test_copy_dataset_compact(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t
error:
H5E_BEGIN_TRY {
- H5Dclose(did2);
- H5Dclose(did);
- H5Pclose(pid);
- H5Sclose(sid);
- H5Fclose(fid_dst);
- H5Fclose(fid_src);
+ H5Dclose(did2);
+ H5Dclose(did);
+ H5Pclose(pid);
+ H5Sclose(sid);
+ H5Fclose(fid_dst);
+ H5Fclose(fid_src);
} H5E_END_TRY;
return 1;
} /* end test_copy_dataset_compact */
-
+
/*-------------------------------------------------------------------------
* Function: test_copy_dataset_external
*
@@ -4306,17 +4503,17 @@ test_copy_dataset_external(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t
error:
H5E_BEGIN_TRY {
- H5Dclose(did2);
- H5Dclose(did);
- H5Pclose(pid);
- H5Sclose(sid);
- H5Fclose(fid_dst);
- H5Fclose(fid_src);
+ H5Dclose(did2);
+ H5Dclose(did);
+ H5Pclose(pid);
+ H5Sclose(sid);
+ H5Fclose(fid_dst);
+ H5Fclose(fid_src);
} H5E_END_TRY;
return 1;
} /* end test_copy_dataset_external */
-
+
/*-------------------------------------------------------------------------
* Function: test_copy_dataset_named_dtype
*
@@ -4427,17 +4624,17 @@ test_copy_dataset_named_dtype(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hi
error:
H5E_BEGIN_TRY {
- H5Dclose(did2);
- H5Dclose(did);
- H5Tclose(tid);
- H5Sclose(sid);
- H5Fclose(fid_dst);
- H5Fclose(fid_src);
+ H5Dclose(did2);
+ H5Dclose(did);
+ H5Tclose(tid);
+ H5Sclose(sid);
+ H5Fclose(fid_dst);
+ H5Fclose(fid_src);
} H5E_END_TRY;
return 1;
} /* end test_copy_dataset_named_dtype */
-
+
/*-------------------------------------------------------------------------
* Function: test_copy_dataset_named_dtype_hier
*
@@ -4564,18 +4761,18 @@ test_copy_dataset_named_dtype_hier(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fap
error:
H5E_BEGIN_TRY {
- H5Dclose(did);
- H5Tclose(tid);
- H5Sclose(sid);
- H5Gclose(gid2);
- H5Gclose(gid);
- H5Fclose(fid_dst);
- H5Fclose(fid_src);
+ H5Dclose(did);
+ H5Tclose(tid);
+ H5Sclose(sid);
+ H5Gclose(gid2);
+ H5Gclose(gid);
+ H5Fclose(fid_dst);
+ H5Fclose(fid_src);
} H5E_END_TRY;
return 1;
} /* end test_copy_dataset_named_dtype_hier */
-
+
/*-------------------------------------------------------------------------
* Function: test_copy_dataset_named_dtype_hier_outside
*
@@ -4703,18 +4900,18 @@ test_copy_dataset_named_dtype_hier_outside(hid_t fcpl_src, hid_t fcpl_dst, hid_t
error:
H5E_BEGIN_TRY {
- H5Dclose(did);
- H5Tclose(tid);
- H5Sclose(sid);
- H5Gclose(gid2);
- H5Gclose(gid);
- H5Fclose(fid_dst);
- H5Fclose(fid_src);
+ H5Dclose(did);
+ H5Tclose(tid);
+ H5Sclose(sid);
+ H5Gclose(gid2);
+ H5Gclose(gid);
+ H5Fclose(fid_dst);
+ H5Fclose(fid_src);
} H5E_END_TRY;
return 1;
} /* end test_copy_dataset_named_dtype_hier_outside */
-
+
/*-------------------------------------------------------------------------
* Function: test_copy_dataset_multi_ohdr_chunks
*
@@ -4825,7 +5022,7 @@ test_copy_dataset_multi_ohdr_chunks(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fa
/* close the second dataset */
if(H5Dclose(did2) < 0) TEST_ERROR
- } else
+ } else
/* open the group for copy */
if((gid = H5Gopen2(fid_src, NAME_GROUP_TOP, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
@@ -4852,18 +5049,18 @@ test_copy_dataset_multi_ohdr_chunks(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fa
error:
H5E_BEGIN_TRY {
- H5Dclose(did2);
- H5Dclose(did);
- H5Sclose(sid);
- H5Gclose(gid2);
- H5Gclose(gid);
- H5Fclose(fid_dst);
- H5Fclose(fid_src);
+ H5Dclose(did2);
+ H5Dclose(did);
+ H5Sclose(sid);
+ H5Gclose(gid2);
+ H5Gclose(gid);
+ H5Fclose(fid_dst);
+ H5Fclose(fid_src);
} H5E_END_TRY;
return 1;
} /* end test_copy_dataset_multi_ohdr_chunks */
-
+
/*-------------------------------------------------------------------------
* Function: test_copy_dataset_attr_named_dtype
*
@@ -4993,19 +5190,19 @@ test_copy_dataset_attr_named_dtype(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fap
error:
H5E_BEGIN_TRY {
- H5Dclose(did2);
- H5Dclose(did);
- H5Tclose(tid);
- H5Sclose(sid);
- H5Gclose(gid2);
- H5Gclose(gid);
- H5Fclose(fid_dst);
- H5Fclose(fid_src);
+ H5Dclose(did2);
+ H5Dclose(did);
+ H5Tclose(tid);
+ H5Sclose(sid);
+ H5Gclose(gid2);
+ H5Gclose(gid);
+ H5Fclose(fid_dst);
+ H5Fclose(fid_src);
} H5E_END_TRY;
return 1;
} /* end test_copy_dataset_attr_named_dtype */
-
+
/*-------------------------------------------------------------------------
* Function: test_copy_dataset_contig_vl
*
@@ -5129,19 +5326,19 @@ test_copy_dataset_contig_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_
error:
H5E_BEGIN_TRY {
- H5Dclose(did2);
- H5Dclose(did);
+ H5Dclose(did2);
+ H5Dclose(did);
H5Dvlen_reclaim(tid, sid, H5P_DEFAULT, buf);
- H5Pclose(dxpl_id);
- H5Tclose(tid);
- H5Sclose(sid);
- H5Fclose(fid_dst);
- H5Fclose(fid_src);
+ H5Pclose(dxpl_id);
+ H5Tclose(tid);
+ H5Sclose(sid);
+ H5Fclose(fid_dst);
+ H5Fclose(fid_src);
} H5E_END_TRY;
return 1;
} /* end test_copy_dataset_contig_vl */
-
+
/*-------------------------------------------------------------------------
* Function: test_copy_dataset_chunked_vl
*
@@ -5312,20 +5509,20 @@ test_copy_dataset_chunked_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid
error:
H5E_BEGIN_TRY {
- H5Dclose(did2);
- H5Dclose(did);
+ H5Dclose(did2);
+ H5Dclose(did);
H5Dvlen_reclaim(tid, sid, H5P_DEFAULT, buf);
- H5Pclose(dxpl_id);
- H5Pclose(pid);
- H5Tclose(tid);
- H5Sclose(sid);
- H5Fclose(fid_dst);
- H5Fclose(fid_src);
+ H5Pclose(dxpl_id);
+ H5Pclose(pid);
+ H5Tclose(tid);
+ H5Sclose(sid);
+ H5Fclose(fid_dst);
+ H5Fclose(fid_src);
} H5E_END_TRY;
return 1;
} /* end test_copy_dataset_chunked_vl */
-
+
/*-------------------------------------------------------------------------
* Function: test_copy_dataset_compact_vl
*
@@ -5457,19 +5654,19 @@ test_copy_dataset_compact_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid
error:
H5E_BEGIN_TRY {
- H5Dclose(did2);
- H5Dclose(did);
+ H5Dclose(did2);
+ H5Dclose(did);
H5Dvlen_reclaim(tid, sid, H5P_DEFAULT, buf);
- H5Pclose(dxpl_id);
- H5Tclose(tid);
- H5Sclose(sid);
- H5Fclose(fid_dst);
- H5Fclose(fid_src);
+ H5Pclose(dxpl_id);
+ H5Tclose(tid);
+ H5Sclose(sid);
+ H5Fclose(fid_dst);
+ H5Fclose(fid_src);
} H5E_END_TRY;
return 1;
} /* end test_copy_dataset_compact_vl */
-
+
/*-------------------------------------------------------------------------
* Function: test_copy_attribute_vl
*
@@ -5575,11 +5772,11 @@ error:
H5E_BEGIN_TRY {
H5Aclose(aid2);
H5Aclose(aid);
- H5Dclose(did2);
- H5Dclose(did);
- H5Sclose(sid);
- H5Fclose(fid_dst);
- H5Fclose(fid_src);
+ H5Dclose(did2);
+ H5Dclose(did);
+ H5Sclose(sid);
+ H5Fclose(fid_dst);
+ H5Fclose(fid_src);
} H5E_END_TRY;
return 1;
} /* end test_copy_dataset_simple_empty */
@@ -5598,18 +5795,18 @@ error:
static int
attach_attribute_compound_vlstr(hid_t loc_id)
{
- hid_t aid = -1; /* Attribute ID */
- hid_t sid = -1; /* Dataspace ID */
- hid_t tid = -1; /* Datatype ID */
- hid_t vl_str_tid = -1; /* Variable length string datatype ID */
- hid_t cmpd_tid = -1; /* Compound datatype ID */
- hsize_t dim1 = 1; /* Dimension size */
- typedef struct { /* Compound structure for the attribute */
+ hid_t aid = -1; /* Attribute ID */
+ hid_t sid = -1; /* Dataspace ID */
+ hid_t tid = -1; /* Datatype ID */
+ hid_t vl_str_tid = -1; /* Variable length string datatype ID */
+ hid_t cmpd_tid = -1; /* Compound datatype ID */
+ hsize_t dim1 = 1; /* Dimension size */
+ typedef struct { /* Compound structure for the attribute */
int i;
char *v;
} s1;
s1 buf; /* Buffer */
- int ret_value = -1; /* Return value */
+ int ret_value = -1; /* Return value */
/* Create dataspace */
if((sid = H5Screate_simple(1, &dim1, NULL)) < 0 )
@@ -5663,7 +5860,7 @@ done:
* Function: compare_attribute_compound_vlstr
*
* Purpose: Compare data of the attributes attached to the two objects.
- * The attribute is a compound datatype with a variable length string.
+ * The attribute is a compound datatype with a variable length string.
*
* Return: Non-negative on success/Negative on failure
*
@@ -5674,46 +5871,46 @@ done:
static int
compare_attribute_compound_vlstr(hid_t loc, hid_t loc2)
{
- hid_t aid = -1, aid2 = -1; /* Attribute IDs */
- hid_t tid = -1, tid2 = -1; /* Datatype IDs */
- typedef struct { /* Compound structure for the attribute */
- int i;
- char *v;
+ hid_t aid = -1, aid2 = -1; /* Attribute IDs */
+ hid_t tid = -1, tid2 = -1; /* Datatype IDs */
+ typedef struct { /* Compound structure for the attribute */
+ int i;
+ char *v;
} s1;
- s1 rbuf; /* Buffer for data read */
- s1 rbuf2; /* Buffer for data read */
-
+ s1 rbuf; /* Buffer for data read */
+ s1 rbuf2; /* Buffer for data read */
+
/* Open the attributes attached to the objects */
if((aid = H5Aopen_by_idx(loc, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC, (hsize_t)0, H5P_DEFAULT, H5P_DEFAULT)) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
if((aid2 = H5Aopen_by_idx(loc2, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC, (hsize_t)0, H5P_DEFAULT, H5P_DEFAULT)) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
/* Get the attributes' datatypes */
- if((tid = H5Aget_type(aid)) < 0)
- FAIL_STACK_ERROR
+ if((tid = H5Aget_type(aid)) < 0)
+ FAIL_STACK_ERROR
if((tid2 = H5Aget_type(aid2)) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
/* Read the attributes */
if(H5Aread(aid, tid, &rbuf) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
if(H5Aread(aid2, tid2, &rbuf2) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
/* Compare the attributes' data */
if(rbuf.i != rbuf2.i)
- FAIL_STACK_ERROR
- if(HDstrlen(rbuf.v) != HDstrlen(rbuf2.v))
- FAIL_STACK_ERROR
- if(HDmemcmp(rbuf.v, rbuf2.v, HDstrlen(rbuf.v)))
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
+ if(HDstrlen(rbuf.v) != HDstrlen(rbuf2.v))
+ FAIL_STACK_ERROR
+ if(HDmemcmp(rbuf.v, rbuf2.v, HDstrlen(rbuf.v)))
+ FAIL_STACK_ERROR
/* Close the attributes */
if(H5Aclose(aid) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
if(H5Aclose(aid2) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
return TRUE;
error:
@@ -5731,15 +5928,15 @@ error:
* Function: test_copy_attribute_compound_vlstr
*
* Purpose: Create a simple dataset and a group in SRC file.
- * Both has an attribute with a compound datatype consisting
+ * Both has an attribute with a compound datatype consisting
* of a variable length string
* Copy the dataset and the group to DST file
- * This is for HDFFV-7991
+ * This is for HDFFV-7991
*
* Return: Success: 0
* Failure: number of errors
*
- * Programmer:
+ * Programmer:
*
*-------------------------------------------------------------------------
*/
@@ -5750,10 +5947,10 @@ test_copy_attribute_compound_vlstr(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fap
hid_t sid = -1; /* Dataspace ID */
hid_t did = -1, did2 = -1; /* Dataset IDs */
hid_t aid = -1, aid2 = -1; /* Attribute IDs */
- hid_t gid = -1, gid2 = -1; /* Group IDs */
+ hid_t gid = -1, gid2 = -1; /* Group IDs */
hsize_t dim2d[2]; /* Dataset dimensions */
- char src_filename[NAME_BUF_SIZE]; /* Source file name */
- char dst_filename[NAME_BUF_SIZE]; /* Destination file name */
+ char src_filename[NAME_BUF_SIZE]; /* Source file name */
+ char dst_filename[NAME_BUF_SIZE]; /* Destination file name */
TESTING("H5Ocopy(): attribute with compound datatype consisting of variable length string");
@@ -5766,7 +5963,7 @@ test_copy_attribute_compound_vlstr(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fap
/* create source file */
if((fid_src = H5Fcreate(src_filename, H5F_ACC_TRUNC, fcpl_src, src_fapl)) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
/* set dataspace dimensions */
dim2d[0] = DIM_SIZE_1;
@@ -5774,103 +5971,103 @@ test_copy_attribute_compound_vlstr(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fap
/* create 2D dataspace */
if((sid = H5Screate_simple(2, dim2d, NULL)) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
/* create 2D int dataset at SRC file */
if((did = H5Dcreate2(fid_src, NAME_DATASET_SIMPLE, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
/* close dataspace */
if(H5Sclose(sid) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
/* attach an attribute to the dataset */
if(attach_attribute_compound_vlstr(did) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
/* close the dataset */
if(H5Dclose(did) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
/* create a group */
if((gid = H5Gcreate2(fid_src, NAME_GROUP_EMPTY, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
/* attach attribute to the group */
if(attach_attribute_compound_vlstr(gid) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
/* close the group */
if(H5Gclose(gid) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
/* close the SRC file */
if(H5Fclose(fid_src) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
/* open the source file with read-only */
if((fid_src = H5Fopen(src_filename, H5F_ACC_RDONLY, src_fapl)) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
/* create destination file */
if((fid_dst = H5Fcreate(dst_filename, H5F_ACC_TRUNC, fcpl_dst, dst_fapl)) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
/* Create an uncopied object in destination file so that addresses in source and destination files aren't the same */
if(H5Gclose(H5Gcreate2(fid_dst, NAME_GROUP_UNCOPIED, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
/* copy the dataset from SRC to DST */
if(H5Ocopy(fid_src, NAME_DATASET_SIMPLE, fid_dst, NAME_DATASET_SIMPLE, H5P_DEFAULT, H5P_DEFAULT) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
/* open the src dataset */
if((did = H5Dopen2(fid_src, NAME_DATASET_SIMPLE, H5P_DEFAULT)) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
/* open the destination dataset */
if((did2 = H5Dopen2(fid_dst, NAME_DATASET_SIMPLE, H5P_DEFAULT)) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
/* compare the data of the attributes attached to the two datasets */
if(compare_attribute_compound_vlstr(did, did2) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
/* close the datasets */
if(H5Dclose(did2) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
if(H5Dclose(did) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
/* Copy the group */
if(H5Ocopy(fid_src, NAME_GROUP_EMPTY, fid_dst, NAME_GROUP_EMPTY, H5P_DEFAULT, H5P_DEFAULT) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
/* Open the src group */
if((gid = H5Gopen2(fid_src, NAME_GROUP_EMPTY, H5P_DEFAULT)) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
/* Open the destination group */
if((gid2 = H5Gopen2(fid_dst, NAME_GROUP_EMPTY, H5P_DEFAULT)) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
/* compare the data of the attributes attached to the two groups */
if(compare_attribute_compound_vlstr(gid, gid2) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
/* close the groups */
- if(H5Gclose(gid) < 0)
- FAIL_STACK_ERROR
- if(H5Gclose(gid2) < 0)
- FAIL_STACK_ERROR
+ if(H5Gclose(gid) < 0)
+ FAIL_STACK_ERROR
+ if(H5Gclose(gid2) < 0)
+ FAIL_STACK_ERROR
/* close the SRC file */
if(H5Fclose(fid_src) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
/* close the DST file */
if(H5Fclose(fid_dst) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
PASSED();
return 0;
@@ -5879,18 +6076,18 @@ error:
H5E_BEGIN_TRY {
H5Aclose(aid2);
H5Aclose(aid);
- H5Dclose(did2);
- H5Dclose(did);
- H5Gclose(gid);
- H5Gclose(gid2);
- H5Sclose(sid);
- H5Fclose(fid_dst);
- H5Fclose(fid_src);
+ H5Dclose(did2);
+ H5Dclose(did);
+ H5Gclose(gid);
+ H5Gclose(gid2);
+ H5Sclose(sid);
+ H5Fclose(fid_dst);
+ H5Fclose(fid_src);
} H5E_END_TRY;
return 1;
} /* end test_copy_attribute_compound_vlstr() */
-
+
/*-------------------------------------------------------------------------
* Function: test_copy_dataset_compressed_vl
*
@@ -6034,21 +6231,21 @@ test_copy_dataset_compressed_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl,
#ifdef H5_HAVE_FILTER_DEFLATE
error:
H5E_BEGIN_TRY {
- H5Dclose(did2);
- H5Dclose(did);
- H5Pclose(pid);
+ H5Dclose(did2);
+ H5Dclose(did);
+ H5Pclose(pid);
H5Dvlen_reclaim(tid, sid, H5P_DEFAULT, buf);
- H5Pclose(dxpl_id);
- H5Tclose(tid);
- H5Sclose(sid);
- H5Fclose(fid_dst);
- H5Fclose(fid_src);
+ H5Pclose(dxpl_id);
+ H5Tclose(tid);
+ H5Sclose(sid);
+ H5Fclose(fid_dst);
+ H5Fclose(fid_src);
} H5E_END_TRY;
return 1;
#endif /* H5_HAVE_FILTER_DEFLATE */
} /* end test_copy_dataset_compressed_vl */
-
+
/*-------------------------------------------------------------------------
* Function: test_copy_group_empty
*
@@ -6135,15 +6332,15 @@ test_copy_group_empty(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_
error:
H5E_BEGIN_TRY {
- H5Gclose(gid2);
- H5Gclose(gid);
- H5Fclose(fid_dst);
- H5Fclose(fid_src);
+ H5Gclose(gid2);
+ H5Gclose(gid);
+ H5Fclose(fid_dst);
+ H5Fclose(fid_src);
} H5E_END_TRY;
return 1;
} /* end test_copy_group_empty */
-
+
/*-------------------------------------------------------------------------
* Function: test_copy_root_group
*
@@ -6276,7 +6473,7 @@ error:
return 1;
} /* end test_copy_root_group */
-
+
/*-------------------------------------------------------------------------
* Function: test_copy_group
*
@@ -6399,18 +6596,18 @@ test_copy_group(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fapl)
error:
H5E_BEGIN_TRY {
- H5Sclose(sid);
- H5Dclose(did);
- H5Gclose(gid_sub);
- H5Gclose(gid2);
- H5Gclose(gid);
- H5Fclose(fid_dst);
- H5Fclose(fid_src);
+ H5Sclose(sid);
+ H5Dclose(did);
+ H5Gclose(gid_sub);
+ H5Gclose(gid2);
+ H5Gclose(gid);
+ H5Fclose(fid_dst);
+ H5Fclose(fid_src);
} H5E_END_TRY;
return 1;
} /* end test_copy_group */
-
+
/*-------------------------------------------------------------------------
* Function: test_copy_group_deep
*
@@ -6541,18 +6738,18 @@ test_copy_group_deep(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_f
error:
H5E_BEGIN_TRY {
- H5Sclose(sid);
- H5Dclose(did);
- H5Gclose(gid_sub);
- H5Gclose(gid2);
- H5Gclose(gid);
- H5Fclose(fid_dst);
- H5Fclose(fid_src);
+ H5Sclose(sid);
+ H5Dclose(did);
+ H5Gclose(gid_sub);
+ H5Gclose(gid2);
+ H5Gclose(gid);
+ H5Fclose(fid_dst);
+ H5Fclose(fid_src);
} H5E_END_TRY;
return 1;
} /* end test_copy_group_deep */
-
+
/*-------------------------------------------------------------------------
* Function: test_copy_group_loop
*
@@ -6652,17 +6849,17 @@ test_copy_group_loop(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_f
error:
H5E_BEGIN_TRY {
- H5Gclose(gid_sub2);
- H5Gclose(gid_sub);
- H5Gclose(gid2);
- H5Gclose(gid);
- H5Fclose(fid_dst);
- H5Fclose(fid_src);
+ H5Gclose(gid_sub2);
+ H5Gclose(gid_sub);
+ H5Gclose(gid2);
+ H5Gclose(gid);
+ H5Fclose(fid_dst);
+ H5Fclose(fid_src);
} H5E_END_TRY;
return 1;
} /* end test_copy_group_loop */
-
+
/*-------------------------------------------------------------------------
* Function: test_copy_group_wide_loop
*
@@ -6781,17 +6978,17 @@ test_copy_group_wide_loop(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t
error:
H5E_BEGIN_TRY {
- H5Gclose(gid_sub2);
- H5Gclose(gid_sub);
- H5Gclose(gid2);
- H5Gclose(gid);
- H5Fclose(fid_dst);
- H5Fclose(fid_src);
+ H5Gclose(gid_sub2);
+ H5Gclose(gid_sub);
+ H5Gclose(gid2);
+ H5Gclose(gid);
+ H5Fclose(fid_dst);
+ H5Fclose(fid_src);
} H5E_END_TRY;
return 1;
} /* end test_copy_group_wide_loop */
-
+
/*-------------------------------------------------------------------------
* Function: test_copy_group_links
*
@@ -7039,20 +7236,20 @@ test_copy_group_links(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_
error:
H5E_BEGIN_TRY {
- H5Sclose(sid);
- H5Dclose(did2);
- H5Dclose(did);
- H5Gclose(gid2);
- H5Gclose(gid);
- H5Fclose(fid_ext);
- H5Fclose(fid_dst);
- H5Fclose(fid_src);
- H5Pclose(plid);
+ H5Sclose(sid);
+ H5Dclose(did2);
+ H5Dclose(did);
+ H5Gclose(gid2);
+ H5Gclose(gid);
+ H5Fclose(fid_ext);
+ H5Fclose(fid_dst);
+ H5Fclose(fid_src);
+ H5Pclose(plid);
} H5E_END_TRY;
return 1;
} /* end test_copy_group_links */
-
+
/*-------------------------------------------------------------------------
* Function: test_copy_soft_link
*
@@ -7178,17 +7375,17 @@ test_copy_soft_link(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fa
error:
H5E_BEGIN_TRY {
- H5Sclose(sid);
- H5Dclose(did2);
- H5Dclose(did);
- H5Gclose(gid);
- H5Fclose(fid_dst);
- H5Fclose(fid_src);
+ H5Sclose(sid);
+ H5Dclose(did2);
+ H5Dclose(did);
+ H5Gclose(gid);
+ H5Fclose(fid_dst);
+ H5Fclose(fid_src);
} H5E_END_TRY;
return 1;
} /* end test_copy_soft_link */
-
+
/*-------------------------------------------------------------------------
* Function: test_copy_ext_link
*
@@ -7312,17 +7509,17 @@ test_copy_ext_link(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fap
error:
H5E_BEGIN_TRY {
- H5Sclose(sid);
- H5Dclose(did2);
- H5Dclose(did);
- H5Gclose(gid);
- H5Fclose(fid_dst);
- H5Fclose(fid_src);
+ H5Sclose(sid);
+ H5Dclose(did2);
+ H5Dclose(did);
+ H5Gclose(gid);
+ H5Fclose(fid_dst);
+ H5Fclose(fid_src);
} H5E_END_TRY;
return 1;
} /* end test_copy_ext_link */
-
+
/*-------------------------------------------------------------------------
* Function: test_copy_exist
*
@@ -7422,15 +7619,15 @@ test_copy_exist(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fapl)
error:
H5E_BEGIN_TRY {
- H5Dclose(did);
- H5Sclose(sid);
- H5Fclose(fid_dst);
- H5Fclose(fid_src);
+ H5Dclose(did);
+ H5Sclose(sid);
+ H5Fclose(fid_dst);
+ H5Fclose(fid_src);
} H5E_END_TRY;
return 1;
} /* end test_copy_exist */
-
+
/*-------------------------------------------------------------------------
* Function: test_copy_path
*
@@ -7556,17 +7753,17 @@ test_copy_path(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fapl)
error:
H5E_BEGIN_TRY {
- H5Dclose(did2);
- H5Dclose(did);
- H5Sclose(sid);
- H5Gclose(gid);
- H5Fclose(fid_dst);
- H5Fclose(fid_src);
+ H5Dclose(did2);
+ H5Dclose(did);
+ H5Sclose(sid);
+ H5Gclose(gid);
+ H5Fclose(fid_dst);
+ H5Fclose(fid_src);
} H5E_END_TRY;
return 1;
} /* end test_copy_path */
-
+
/*-------------------------------------------------------------------------
* Function: test_copy_same_file_named_datatype
*
@@ -7628,21 +7825,21 @@ test_copy_same_file_named_datatype(hid_t fcpl_src, hid_t fapl)
error:
H5E_BEGIN_TRY {
- H5Tclose(tid2);
- H5Tclose(tid);
- H5Fclose(fid);
+ H5Tclose(tid2);
+ H5Tclose(tid);
+ H5Fclose(fid);
} H5E_END_TRY;
return 1;
} /* end test_copy_same_file_named_datatype */
-
+
/*-------------------------------------------------------------------------
* Function: test_copy_old_layout
*
* Purpose: Copy dataset that uses the "old" layout version (pre version 3)
* format.
*
- * Note: This test uses the "fill_old.h5" file for convenience, since it
+ * Note: This test uses the "fill_old.h5" file for convenience, since it
* has a dataset with the old layout format.
*
* Return: Success: 0
@@ -7718,15 +7915,15 @@ test_copy_old_layout(hid_t fcpl_dst, hid_t fapl, hbool_t test_open)
error:
H5E_BEGIN_TRY {
- H5Dclose(did2);
- H5Dclose(did);
- H5Fclose(fid_dst);
- H5Fclose(fid_src);
+ H5Dclose(did2);
+ H5Dclose(did);
+ H5Fclose(fid_dst);
+ H5Fclose(fid_src);
} H5E_END_TRY;
return 1;
} /* end test_copy_old_layout */
-
+
/*-------------------------------------------------------------------------
* Function: test_copy_dataset_compact_named_vl
*
@@ -7867,21 +8064,21 @@ test_copy_dataset_compact_named_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fap
error:
H5E_BEGIN_TRY {
- H5Pclose(pid);
- H5Dclose(did2);
- H5Dclose(did);
+ H5Pclose(pid);
+ H5Dclose(did2);
+ H5Dclose(did);
H5Dvlen_reclaim(tid_copy, sid, H5P_DEFAULT, buf);
- H5Pclose(dxpl_id);
- H5Tclose(tid);
- H5Tclose(tid_copy);
- H5Sclose(sid);
- H5Fclose(fid_dst);
- H5Fclose(fid_src);
+ H5Pclose(dxpl_id);
+ H5Tclose(tid);
+ H5Tclose(tid_copy);
+ H5Sclose(sid);
+ H5Fclose(fid_dst);
+ H5Fclose(fid_src);
} H5E_END_TRY;
return 1;
} /* end test_copy_dataset_compact_named_vl */
-
+
/*-------------------------------------------------------------------------
* Function: test_copy_dataset_contig_named_vl
*
@@ -8014,27 +8211,27 @@ test_copy_dataset_contig_named_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl
error:
H5E_BEGIN_TRY {
- H5Dclose(did2);
- H5Dclose(did);
+ H5Dclose(did2);
+ H5Dclose(did);
H5Dvlen_reclaim(tid_copy, sid, H5P_DEFAULT, buf);
- H5Pclose(dxpl_id);
- H5Tclose(tid);
- H5Tclose(tid_copy);
- H5Sclose(sid);
- H5Fclose(fid_dst);
- H5Fclose(fid_src);
+ H5Pclose(dxpl_id);
+ H5Tclose(tid);
+ H5Tclose(tid_copy);
+ H5Sclose(sid);
+ H5Fclose(fid_dst);
+ H5Fclose(fid_src);
} H5E_END_TRY;
return 1;
} /* end test_copy_dataset_contig_named_vl */
-
+
/*-------------------------------------------------------------------------
* Function: test_copy_dataset_chunked_named_vl
*
* Purpose: Create a dataset that uses a named variable length datatype
* in SRC file and copy it to DST file
*
- * Note: The parameter "test_open" is added to test for H5Ocopy when
+ * Note: The parameter "test_open" is added to test for H5Ocopy when
* the dataset is open in the file (HDFFV-7853).
*
* Return: Success: 0
@@ -8181,21 +8378,21 @@ test_copy_dataset_chunked_named_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fap
error:
H5E_BEGIN_TRY {
- H5Pclose(pid);
- H5Dclose(did2);
- H5Dclose(did);
+ H5Pclose(pid);
+ H5Dclose(did2);
+ H5Dclose(did);
H5Dvlen_reclaim(tid_copy, sid, H5P_DEFAULT, buf);
- H5Pclose(dxpl_id);
- H5Tclose(tid);
- H5Tclose(tid_copy);
- H5Sclose(sid);
- H5Fclose(fid_dst);
- H5Fclose(fid_src);
+ H5Pclose(dxpl_id);
+ H5Tclose(tid);
+ H5Tclose(tid_copy);
+ H5Sclose(sid);
+ H5Fclose(fid_dst);
+ H5Fclose(fid_src);
} H5E_END_TRY;
return 1;
} /* end test_copy_dataset_chunked_named_vl */
-
+
/*-------------------------------------------------------------------------
* Function: test_copy_dataset_compressed_named_vl
*
@@ -8338,21 +8535,21 @@ test_copy_dataset_compressed_named_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_
error:
H5E_BEGIN_TRY {
- H5Pclose(pid);
- H5Dclose(did2);
- H5Dclose(did);
+ H5Pclose(pid);
+ H5Dclose(did2);
+ H5Dclose(did);
H5Dvlen_reclaim(tid_copy, sid, H5P_DEFAULT, buf);
- H5Pclose(dxpl_id);
- H5Tclose(tid);
- H5Tclose(tid_copy);
- H5Sclose(sid);
- H5Fclose(fid_dst);
- H5Fclose(fid_src);
+ H5Pclose(dxpl_id);
+ H5Tclose(tid);
+ H5Tclose(tid_copy);
+ H5Sclose(sid);
+ H5Fclose(fid_dst);
+ H5Fclose(fid_src);
} H5E_END_TRY;
return 1;
} /* end test_copy_dataset_compressed_named_vl */
-
+
/*-------------------------------------------------------------------------
* Function: test_copy_dataset_compact_vl_vl
*
@@ -8501,28 +8698,28 @@ test_copy_dataset_compact_vl_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl,
error:
H5E_BEGIN_TRY {
- H5Dclose(did2);
- H5Dclose(did);
+ H5Dclose(did2);
+ H5Dclose(did);
H5Dvlen_reclaim(tid2, sid, H5P_DEFAULT, buf);
- H5Pclose(dxpl_id);
- H5Pclose(pid);
- H5Tclose(tid);
- H5Tclose(tid2);
- H5Sclose(sid);
- H5Fclose(fid_dst);
- H5Fclose(fid_src);
+ H5Pclose(dxpl_id);
+ H5Pclose(pid);
+ H5Tclose(tid);
+ H5Tclose(tid2);
+ H5Sclose(sid);
+ H5Fclose(fid_dst);
+ H5Fclose(fid_src);
} H5E_END_TRY;
return 1;
} /* end test_copy_dataset_compact_vl_vl */
-
+
/*-------------------------------------------------------------------------
* Function: test_copy_dataset_contig_vl_vl
*
* Purpose: Create a compact dataset w/nested VLEN datatype
* in SRC file and copy it to DST file
*
- * Note: The parameter "test_open" is added to test for H5Ocopy when
+ * Note: The parameter "test_open" is added to test for H5Ocopy when
* the dataset is open in the file (HDFFV-7853).
*
* Return: Success: 0
@@ -8674,21 +8871,21 @@ test_copy_dataset_contig_vl_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, h
error:
H5E_BEGIN_TRY {
- H5Dclose(did2);
- H5Dclose(did);
+ H5Dclose(did2);
+ H5Dclose(did);
H5Dvlen_reclaim(tid2, sid, H5P_DEFAULT, buf);
- H5Pclose(dxpl_id);
- H5Pclose(pid);
- H5Tclose(tid);
- H5Tclose(tid2);
- H5Sclose(sid);
- H5Fclose(fid_dst);
- H5Fclose(fid_src);
+ H5Pclose(dxpl_id);
+ H5Pclose(pid);
+ H5Tclose(tid);
+ H5Tclose(tid2);
+ H5Sclose(sid);
+ H5Fclose(fid_dst);
+ H5Fclose(fid_src);
} H5E_END_TRY;
return 1;
} /* end test_copy_dataset_contig_vl_vl */
-
+
/*-------------------------------------------------------------------------
* Function: test_copy_dataset_chunked_vl_vl
*
@@ -8707,7 +8904,7 @@ static int
test_copy_dataset_chunked_vl_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fapl)
{
hid_t fid_src = -1, fid_dst = -1; /* File IDs */
- hid_t tid = -1, tid2=-1; /* Datatype ID */
+ hid_t tid = -1, tid2=-1; /* Datatype ID */
hid_t sid = -1; /* Dataspace ID */
hid_t pid = -1; /* Dataset creation property list ID */
hid_t did = -1, did2 = -1; /* Dataset IDs */
@@ -8875,28 +9072,28 @@ test_copy_dataset_chunked_vl_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl,
error:
H5E_BEGIN_TRY {
- H5Pclose(pid);
- H5Dclose(did2);
- H5Dclose(did);
+ H5Pclose(pid);
+ H5Dclose(did2);
+ H5Dclose(did);
H5Dvlen_reclaim(tid2, sid, H5P_DEFAULT, buf);
- H5Pclose(dxpl_id);
- H5Tclose(tid);
- H5Tclose(tid2);
- H5Sclose(sid);
- H5Fclose(fid_dst);
- H5Fclose(fid_src);
+ H5Pclose(dxpl_id);
+ H5Tclose(tid);
+ H5Tclose(tid2);
+ H5Sclose(sid);
+ H5Fclose(fid_dst);
+ H5Fclose(fid_src);
} H5E_END_TRY;
return 1;
} /* end test_copy_dataset_chunked_vl_vl */
-
+
/*-------------------------------------------------------------------------
* Function: test_copy_dataset_compressed_vl_vl
*
* Purpose: Create a dataset that uses a named variable length datatype
* in SRC file and copy it to DST file
*
- * Note: The parameter "test_open" is added to test for H5Ocopy when
+ * Note: The parameter "test_open" is added to test for H5Ocopy when
* the dataset is open in the file (HDFFV-7853).
*
* Return: Success: 0
@@ -8998,7 +9195,7 @@ test_copy_dataset_compressed_vl_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fap
/* open the source file with read-only */
if((fid_src = H5Fopen(src_filename, H5F_ACC_RDONLY, src_fapl)) < 0) TEST_ERROR
}
-
+
/* create destination file */
if((fid_dst = H5Fcreate(dst_filename, H5F_ACC_TRUNC, fcpl_dst, dst_fapl)) < 0) TEST_ERROR
@@ -9051,16 +9248,16 @@ test_copy_dataset_compressed_vl_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fap
error:
H5E_BEGIN_TRY {
- H5Pclose(pid);
- H5Dclose(did2);
- H5Dclose(did);
+ H5Pclose(pid);
+ H5Dclose(did2);
+ H5Dclose(did);
H5Dvlen_reclaim(tid2, sid, H5P_DEFAULT, buf);
- H5Pclose(dxpl_id);
- H5Tclose(tid);
- H5Tclose(tid2);
- H5Sclose(sid);
- H5Fclose(fid_dst);
- H5Fclose(fid_src);
+ H5Pclose(dxpl_id);
+ H5Tclose(tid);
+ H5Tclose(tid2);
+ H5Sclose(sid);
+ H5Fclose(fid_dst);
+ H5Fclose(fid_src);
} H5E_END_TRY;
return 1;
} /* end test_copy_dataset_compressed_vl_vl */
@@ -9074,7 +9271,7 @@ typedef struct cmpd_vl_t {
double c;
} cmpd_vl_t;
-
+
/*-------------------------------------------------------------------------
* Function: test_copy_dataset_contig_cmpd_vl
*
@@ -9207,20 +9404,20 @@ test_copy_dataset_contig_cmpd_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl,
error:
H5E_BEGIN_TRY {
- H5Dclose(did2);
- H5Dclose(did);
+ H5Dclose(did2);
+ H5Dclose(did);
H5Dvlen_reclaim(tid, sid, H5P_DEFAULT, buf);
H5Pclose(dxpl_id);
H5Tclose(tid2);
- H5Tclose(tid);
- H5Sclose(sid);
- H5Fclose(fid_dst);
- H5Fclose(fid_src);
+ H5Tclose(tid);
+ H5Sclose(sid);
+ H5Fclose(fid_dst);
+ H5Fclose(fid_src);
} H5E_END_TRY;
return 1;
} /* end test_copy_dataset_contig_cmpd_vl */
-
+
/*-------------------------------------------------------------------------
* Function: test_copy_dataset_chunked_cmpd_vl
*
@@ -9360,21 +9557,21 @@ test_copy_dataset_chunked_cmpd_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl
error:
H5E_BEGIN_TRY {
- H5Dclose(did2);
- H5Dclose(did);
+ H5Dclose(did2);
+ H5Dclose(did);
H5Dvlen_reclaim(tid, sid, H5P_DEFAULT, buf);
H5Pclose(dxpl_id);
H5Pclose(pid);
H5Tclose(tid2);
- H5Tclose(tid);
- H5Sclose(sid);
- H5Fclose(fid_dst);
- H5Fclose(fid_src);
+ H5Tclose(tid);
+ H5Sclose(sid);
+ H5Fclose(fid_dst);
+ H5Fclose(fid_src);
} H5E_END_TRY;
return 1;
} /* end test_copy_dataset_chunked_cmpd_vl */
-
+
/*-------------------------------------------------------------------------
* Function: test_copy_dataset_compact_cmpd_vl
*
@@ -9513,21 +9710,21 @@ test_copy_dataset_compact_cmpd_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl
error:
H5E_BEGIN_TRY {
- H5Dclose(did2);
- H5Dclose(did);
+ H5Dclose(did2);
+ H5Dclose(did);
H5Dvlen_reclaim(tid, sid, H5P_DEFAULT, buf);
- H5Pclose(dxpl_id);
- H5Pclose(pid);
+ H5Pclose(dxpl_id);
+ H5Pclose(pid);
H5Tclose(tid2);
- H5Tclose(tid);
- H5Sclose(sid);
- H5Fclose(fid_dst);
- H5Fclose(fid_src);
+ H5Tclose(tid);
+ H5Sclose(sid);
+ H5Fclose(fid_dst);
+ H5Fclose(fid_src);
} H5E_END_TRY;
return 1;
} /* end test_copy_dataset_compact_cmpd_vl */
-
+
/*-------------------------------------------------------------------------
* Function: test_copy_null_ref
*
@@ -9689,7 +9886,7 @@ error:
return 1;
} /* end test_copy_null_ref */
-
+
/*-------------------------------------------------------------------------
* Function: test_copy_null_ref_open
*
@@ -9872,7 +10069,7 @@ error:
return 1;
} /* end test_copy_null_ref_open */
-
+
/*-------------------------------------------------------------------------
* Function: test_copy_attr_crt_order
*
@@ -9994,7 +10191,7 @@ error:
return 1;
} /* end test_copy_attr_crt_order */
-
+
/*-------------------------------------------------------------------------
* Function: test_copy_committed_datatype_merge
*
@@ -10231,7 +10428,7 @@ error:
return 1;
} /* end test_copy_committed_datatype_merge */
-
+
/*-------------------------------------------------------------------------
* Function: test_copy_committed_datatype_merge_same_file
*
@@ -10503,7 +10700,7 @@ error:
} /* end test_copy_committed_datatype_merge_same_file */
-
+
/*-------------------------------------------------------------------------
* Function: test_copy_committed_dt_merge_sugg
*
@@ -10732,7 +10929,7 @@ error:
return 1;
} /* end test_copy_committed_dt_merge_sugg */
-
+
/*-------------------------------------------------------------------------
* Function: test_copy_committed_dt_merge_attr
*
@@ -10925,27 +11122,27 @@ error:
#define ROOT_NDT_INT "root_ndt_int"
#define GROUP_NDT_SHORT "group_ndt_short"
-#define SRC_GRP "src_grp"
-#define DST_GRP "dst_grp"
-#define DST_GRP2 "dst_grp2"
+#define SRC_GRP "src_grp"
+#define DST_GRP "dst_grp"
+#define DST_GRP2 "dst_grp2"
-#define SRC_NDT_SHORT "src_ndt_short"
-#define SRC_NDT_INT "src_ndt_int"
-#define SRC_NDT_INT2 "src_ndt_int2"
-#define SRC_NDT_FLOAT "src_ndt_float"
-#define SRC_NDT_DOUBLE "src_ndt_double"
+#define SRC_NDT_SHORT "src_ndt_short"
+#define SRC_NDT_INT "src_ndt_int"
+#define SRC_NDT_INT2 "src_ndt_int2"
+#define SRC_NDT_FLOAT "src_ndt_float"
+#define SRC_NDT_DOUBLE "src_ndt_double"
-#define DST_NDT_SHORT "dst_ndt_short"
-#define DST_NDT_INT "dst_ndt_int"
-#define DST_NDT_FLOAT "dst_ndt_float"
-#define DST_NDT_DOUBLE "dst_ndt_double"
+#define DST_NDT_SHORT "dst_ndt_short"
+#define DST_NDT_INT "dst_ndt_int"
+#define DST_NDT_FLOAT "dst_ndt_float"
+#define DST_NDT_DOUBLE "dst_ndt_double"
-#define SRC_NDT_DSET "src_ndt_dset"
-#define SRC_NDT_DSET2 "src_ndt_dset2"
-#define SRC_NDT_DSET3 "src_ndt_dset3"
+#define SRC_NDT_DSET "src_ndt_dset"
+#define SRC_NDT_DSET2 "src_ndt_dset2"
+#define SRC_NDT_DSET3 "src_ndt_dset3"
-#define SRC_DSET "src_dset"
-#define SRC_DSET1 "src_dset1"
+#define SRC_DSET "src_dset"
+#define SRC_DSET1 "src_dset1"
#define SRC_ATTR "src_attr"
@@ -10954,21 +11151,21 @@ error:
#define DST_ATTR "dst_attr"
#define DST_ATTR2 "dst_attr2"
-
+
/*-------------------------------------------------------------------------
* Function: test_copy_cdt_hier_merge
*
* Purpose: Tests the "merge committed datatypes" feature of H5Ocopy:
- * SRC file:
- * Create committed datatypes at / and /g0
- * Create datasets with native type and committed datatypes at /g0
- * DST file:
- * Create attributes with anonymous committed datatypes at /uncopied
+ * SRC file:
+ * Create committed datatypes at / and /g0
+ * Create datasets with native type and committed datatypes at /g0
+ * DST file:
+ * Create attributes with anonymous committed datatypes at /uncopied
*
- * Copy / at SRC to DST
- * Copy /g0 at SRC to DST
- * Copy the datasets in /g0 at SRC to DST /uncopied
- * Verify that committed datatypes are copied and merged correctly
+ * Copy / at SRC to DST
+ * Copy /g0 at SRC to DST
+ * Copy the datasets in /g0 at SRC to DST /uncopied
+ * Verify that committed datatypes are copied and merged correctly
*
* Return: Success: 0
* Failure: number of errors
@@ -10984,19 +11181,19 @@ test_copy_cdt_hier_merge(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t d
hid_t tid = -1; /* Datatype ID */
hid_t sid = -1; /* Dataspace ID */
hid_t did = -1; /* Dataset ID */
- hid_t gid = -1; /* Group IDs */
- hid_t f_tid = -1; /* Datatype ID for root group */
- hid_t g_tid = -1; /* Datatype ID for group */
- hid_t anon_tid = -1; /* Anonymous datatype */
- hid_t aid = -1; /* Attribute ID */
+ hid_t gid = -1; /* Group IDs */
+ hid_t f_tid = -1; /* Datatype ID for root group */
+ hid_t g_tid = -1; /* Datatype ID for group */
+ hid_t anon_tid = -1; /* Anonymous datatype */
+ hid_t aid = -1; /* Attribute ID */
hid_t ocpypl_id = -1; /* Object copy plist ID */
- int i; /* Local index variable */
- hsize_t dim1d[1]; /* dimension sizes */
- int buf[DIM_SIZE_1]; /* Buffer for data */
- haddr_t exp_addr_int, exp_addr_short; /* Expected object addresses */
+ int i; /* Local index variable */
+ hsize_t dim1d[1]; /* dimension sizes */
+ int buf[DIM_SIZE_1]; /* Buffer for data */
+ haddr_t exp_addr_int, exp_addr_short; /* Expected object addresses */
H5O_info_t oinfo; /* Object info */
- char src_filename[NAME_BUF_SIZE]; /* Source file name */
- char dst_filename[NAME_BUF_SIZE]; /* Destination file name */
+ char src_filename[NAME_BUF_SIZE]; /* Source file name */
+ char dst_filename[NAME_BUF_SIZE]; /* Destination file name */
if(reopen)
TESTING("H5Ocopy(): hier. of committed datatypes and merging with reopen")
@@ -11014,8 +11211,8 @@ test_copy_cdt_hier_merge(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t d
/* Reset file address checking info */
addr_reset();
- /*
- * Populate source file
+ /*
+ * Populate source file
*/
if((fid_src = H5Fcreate(src_filename, H5F_ACC_TRUNC, fcpl_src, src_fapl)) < 0) TEST_ERROR
@@ -11073,8 +11270,8 @@ test_copy_cdt_hier_merge(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t d
/* close the SRC file */
if(H5Fclose(fid_src) < 0) TEST_ERROR
- /*
- * Populate destination file
+ /*
+ * Populate destination file
*/
if((fid_dst = H5Fcreate(dst_filename, H5F_ACC_TRUNC, fcpl_dst, dst_fapl)) < 0) TEST_ERROR
@@ -11087,7 +11284,7 @@ test_copy_cdt_hier_merge(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t d
/* create attribute of anon ndt (short) in /uncopied */
if((aid = H5Acreate2(gid, DST_ATTR_ANON_SHORT, anon_tid, sid, H5P_DEFAULT, H5P_DEFAULT)) < 0)
- TEST_ERROR
+ TEST_ERROR
/* close the attribute */
if(H5Aclose(aid) < 0) TEST_ERROR
@@ -11101,7 +11298,7 @@ test_copy_cdt_hier_merge(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t d
/* create attribute of anon ndt (int) in /uncopied */
if((aid = H5Acreate2(gid, DST_ATTR_ANON_INT, anon_tid, sid, H5P_DEFAULT, H5P_DEFAULT)) < 0)
- TEST_ERROR
+ TEST_ERROR
/* close the attribute */
if(H5Aclose(aid) < 0) TEST_ERROR
@@ -11262,17 +11459,17 @@ test_copy_cdt_hier_merge(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t d
error:
H5E_BEGIN_TRY {
- H5Tclose(tid);
- H5Tclose(f_tid);
- H5Tclose(g_tid);
- H5Tclose(anon_tid);
- H5Pclose(ocpypl_id);
- H5Aclose(aid);
- H5Dclose(did);
- H5Sclose(sid);
- H5Gclose(gid);
- H5Fclose(fid_dst);
- H5Fclose(fid_src);
+ H5Tclose(tid);
+ H5Tclose(f_tid);
+ H5Tclose(g_tid);
+ H5Tclose(anon_tid);
+ H5Pclose(ocpypl_id);
+ H5Aclose(aid);
+ H5Dclose(did);
+ H5Sclose(sid);
+ H5Gclose(gid);
+ H5Fclose(fid_dst);
+ H5Fclose(fid_src);
} H5E_END_TRY;
return 1;
} /* end test_copy_cdt_hier_merge */
@@ -11282,22 +11479,22 @@ error:
* Function: test_copy_cdt_merge_cdt
*
* Purpose: Tests the "merge committed datatypes" feature of H5Ocopy:
- * SRC file:
- * Create committed datatype (short)
- * Create committed datatype (float)
- * Create committed datatype (int), with attribute of ndt int
- * Create committed datatype (double), with attribute of anon ndt short
- * DST file:
- * Create committed datatype (int)
- * Create committed datatype (float), with attribute of native int
- * Create committed datatype (double), with attribute of anon ndt short
- *
- * Copy / at SRC to DST
- * Verify that committed datatypes are copied and merged correctly
- *
- * NOTE:
- * Comparison of attributes are not implemented yet.
- * Further tests will be added in the future.
+ * SRC file:
+ * Create committed datatype (short)
+ * Create committed datatype (float)
+ * Create committed datatype (int), with attribute of ndt int
+ * Create committed datatype (double), with attribute of anon ndt short
+ * DST file:
+ * Create committed datatype (int)
+ * Create committed datatype (float), with attribute of native int
+ * Create committed datatype (double), with attribute of anon ndt short
+ *
+ * Copy / at SRC to DST
+ * Verify that committed datatypes are copied and merged correctly
+ *
+ * NOTE:
+ * Comparison of attributes are not implemented yet.
+ * Further tests will be added in the future.
*
* Return: Success: 0
* Failure: number of errors
@@ -11312,15 +11509,15 @@ test_copy_cdt_merge_cdt(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t ds
hid_t fid_src = -1, fid_dst = -1; /* File IDs */
hid_t tid1 = -1, tid2 = -1; /* Datatype IDs */
hid_t tid3 = -1, tid4 = -1; /* Datatype IDs */
- hid_t tid5 = -1, tid = -1; /* Datatype IDs */
+ hid_t tid5 = -1, tid = -1; /* Datatype IDs */
hid_t sid = -1; /* Dataspace ID */
- hid_t aid = -1; /* Attribute ID */
+ hid_t aid = -1; /* Attribute ID */
hid_t ocpypl_id = -1; /* Object copy plist ID */
- hsize_t dim1d[1]; /* dimension sizes */
+ hsize_t dim1d[1]; /* dimension sizes */
H5O_info_t oinfo; /* Object info */
- haddr_t exp_addr; /* Expected object addresses */
- char src_filename[NAME_BUF_SIZE]; /* Source file name */
- char dst_filename[NAME_BUF_SIZE]; /* Destination file name */
+ haddr_t exp_addr; /* Expected object addresses */
+ char src_filename[NAME_BUF_SIZE]; /* Source file name */
+ char dst_filename[NAME_BUF_SIZE]; /* Destination file name */
if(reopen)
TESTING("H5Ocopy(): merging various committed datatypes with reopen")
@@ -11334,8 +11531,8 @@ test_copy_cdt_merge_cdt(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t ds
/* Reset file address checking info */
addr_reset();
- /*
- * Populate source file
+ /*
+ * Populate source file
*/
if((fid_src = H5Fcreate(src_filename, H5F_ACC_TRUNC, fcpl_src, src_fapl)) < 0) TEST_ERROR
@@ -11385,8 +11582,8 @@ test_copy_cdt_merge_cdt(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t ds
/* close the SRC file */
if(H5Fclose(fid_src) < 0) TEST_ERROR
- /*
- * Populate destination file
+ /*
+ * Populate destination file
*/
if((fid_dst = H5Fcreate(dst_filename, H5F_ACC_TRUNC, fcpl_dst, dst_fapl)) < 0) TEST_ERROR
@@ -11441,8 +11638,8 @@ test_copy_cdt_merge_cdt(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t ds
/* copy everything in SRC to DST */
if(H5Ocopy(fid_src, "/", fid_dst, SRC_ROOT_GROUP, ocpypl_id, H5P_DEFAULT) < 0) TEST_ERROR
- /*
- * Verification
+ /*
+ * Verification
*/
/* get address of committed datatype: /src_root/src_ndt_double */
if((tid = H5Topen2(fid_dst, "/" SRC_ROOT_GROUP "/" SRC_NDT_DOUBLE, H5P_DEFAULT)) < 0) TEST_ERROR
@@ -11506,29 +11703,29 @@ test_copy_cdt_merge_cdt(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t ds
error:
H5E_BEGIN_TRY {
- H5Pclose(ocpypl_id);
- H5Tclose(tid);
- H5Tclose(tid1);
- H5Tclose(tid2);
- H5Tclose(tid3);
- H5Tclose(tid4);
- H5Tclose(tid5);
- H5Aclose(aid);
- H5Sclose(sid);
- H5Fclose(fid_dst);
- H5Fclose(fid_src);
+ H5Pclose(ocpypl_id);
+ H5Tclose(tid);
+ H5Tclose(tid1);
+ H5Tclose(tid2);
+ H5Tclose(tid3);
+ H5Tclose(tid4);
+ H5Tclose(tid5);
+ H5Aclose(aid);
+ H5Sclose(sid);
+ H5Fclose(fid_dst);
+ H5Fclose(fid_src);
} H5E_END_TRY;
return 1;
} /* end test_copy_cdt_merge_cdt */
-
+
/*-------------------------------------------------------------------------
* Function: test_copy_cdt_merge_suggs
*
* Purpose: Tests the suggested searching paths feature (H5Padd_merge_committed_dtype_path)
- * is correctly applied in merging the committed datatypes.
- *
+ * is correctly applied in merging the committed datatypes.
+ *
* Return: Success: 0
* Failure: number of errors
*
@@ -11597,7 +11794,7 @@ test_copy_cdt_merge_suggs(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl,
if(H5Fclose(fid_dst) < 0) TEST_ERROR
/*
- * Test 1
+ * Test 1
*/
/* open the source file with read-only */
if((fid_src = H5Fopen(src_filename, H5F_ACC_RDONLY, src_fapl)) < 0) TEST_ERROR
@@ -11633,8 +11830,8 @@ test_copy_cdt_merge_suggs(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl,
/* close the DST file */
if(H5Fclose(fid_dst) < 0) TEST_ERROR
- /*
- * Test 2
+ /*
+ * Test 2
*/
/* open destination file */
if((fid_dst = H5Fopen(dst_filename, H5F_ACC_RDWR, dst_fapl)) < 0) TEST_ERROR
@@ -11666,14 +11863,14 @@ test_copy_cdt_merge_suggs(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl,
/* close the DST file */
if(H5Fclose(fid_dst) < 0) TEST_ERROR
- /*
- * Test 3
+ /*
+ * Test 3
*/
/* open destination file */
if((fid_dst = H5Fopen(dst_filename, H5F_ACC_RDWR, dst_fapl)) < 0) TEST_ERROR
/* remove "/uncopied/src_ndt_int" from DST file */
- if(H5Ldelete(fid_dst, NAME_GROUP_UNCOPIED "/" SRC_NDT_INT, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Ldelete(fid_dst, NAME_GROUP_UNCOPIED "/" SRC_NDT_INT, H5P_DEFAULT) < 0) TEST_ERROR
/* copy "/src_ndt_int" from SRC file to "/uncopied/src_ndt_int" at DST file */
/* use default ocpypl_id -- without merging and suggestion */
@@ -11682,7 +11879,7 @@ test_copy_cdt_merge_suggs(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl,
/* copy "/src_ndt_int" from SRC file to "/src_ndt_int2" at DST file */
/* copy with merging and search suggestion: "/uncopied/src_ndt_int" */
if(H5Ocopy(fid_src, SRC_NDT_INT, fid_dst, SRC_NDT_INT2, ocpypl_id, H5P_DEFAULT) < 0) TEST_ERROR
-
+
if(reopen) {
/* Reopen file */
if(H5Fclose(fid_dst) < 0) TEST_ERROR
@@ -11704,8 +11901,8 @@ test_copy_cdt_merge_suggs(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl,
/* close the DST file */
if(H5Fclose(fid_dst) < 0) TEST_ERROR
- /*
- * Test 4
+ /*
+ * Test 4
*/
/* open destination file */
if((fid_dst = H5Fopen(dst_filename, H5F_ACC_RDWR, dst_fapl)) < 0) TEST_ERROR
@@ -11757,13 +11954,13 @@ error:
return 1;
} /* end test_copy_cdt_merge_suggs */
-
+
/*-------------------------------------------------------------------------
* Function: test_copy_cdt_merge_dset_suggs
*
* Purpose: Tests the suggested searching paths feature (H5Padd_merge_committed_dtype_path)
- * is correctly applied in merging the committed datatypes of datasets.
- *
+ * is correctly applied in merging the committed datatypes of datasets.
+ *
* Return: Success: 0
* Failure: number of errors
*
@@ -11858,7 +12055,7 @@ test_copy_cdt_merge_dset_suggs(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl,
if(H5Sclose(sid) < 0) TEST_ERROR
/*
- * Test 1
+ * Test 1
*/
/* open the source file with read-only */
if((fid_src = H5Fopen(src_filename, H5F_ACC_RDONLY, src_fapl)) < 0) TEST_ERROR
@@ -11896,8 +12093,8 @@ test_copy_cdt_merge_dset_suggs(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl,
/* close the DST file */
if(H5Fclose(fid_dst) < 0) TEST_ERROR
- /*
- * Test 2
+ /*
+ * Test 2
*/
/* open destination file */
if((fid_dst = H5Fopen(dst_filename, H5F_ACC_RDWR, dst_fapl)) < 0) TEST_ERROR
@@ -11933,14 +12130,14 @@ test_copy_cdt_merge_dset_suggs(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl,
/* close the DST file */
if(H5Fclose(fid_dst) < 0) TEST_ERROR
- /*
- * Test 3
+ /*
+ * Test 3
*/
/* open destination file */
if((fid_dst = H5Fopen(dst_filename, H5F_ACC_RDWR, dst_fapl)) < 0) TEST_ERROR
/* remove "/uncopied/src_ndt_dset" */
- if(H5Ldelete(fid_dst, NAME_GROUP_UNCOPIED "/" SRC_NDT_DSET, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Ldelete(fid_dst, NAME_GROUP_UNCOPIED "/" SRC_NDT_DSET, H5P_DEFAULT) < 0) TEST_ERROR
/* copy "src_ndt_dset" from SRC file to "/uncopied/src_ndt_dset" at DST file */
/* use default ocpypl_id -- without merging and suggestion */
@@ -11949,7 +12146,7 @@ test_copy_cdt_merge_dset_suggs(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl,
/* copy "src_ndt_dset" from SRC file to "/src_ndt_dset2" at DST file */
/* use merging and suggested searching path: "/uncopied/src_ndt_dset" */
if(H5Ocopy(fid_src, SRC_NDT_DSET, fid_dst, SRC_NDT_DSET2, ocpypl_id, H5P_DEFAULT) < 0) TEST_ERROR
-
+
if(reopen) {
/* Reopen file */
if(H5Fclose(fid_dst) < 0) TEST_ERROR
@@ -11975,8 +12172,8 @@ test_copy_cdt_merge_dset_suggs(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl,
/* close the DST file */
if(H5Fclose(fid_dst) < 0) TEST_ERROR
- /*
- * Test 4
+ /*
+ * Test 4
*/
/* open destination file */
if((fid_dst = H5Fopen(dst_filename, H5F_ACC_RDWR, dst_fapl)) < 0) TEST_ERROR
@@ -12034,12 +12231,12 @@ error:
return 1;
} /* end test_copy_cdt_merge_dset_suggs */
-
+
/*-------------------------------------------------------------------------
* Function: test_copy_cdt_merge_all_suggs
*
* Purpose: Tests the merging committed datatype + search suggestion feature.
- *
+ *
* Return: Success: 0
* Failure: number of errors
*
@@ -12058,8 +12255,8 @@ test_copy_cdt_merge_all_suggs(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl,
hid_t aid = -1; /* Attribute ID */
hid_t did = -1; /* Dataset ID */
hid_t exp_did = -1; /* Dataset ID */
- hid_t tid_short = -1; /* Datatype ID */
- hid_t exp_tid = -1; /* Expected datatype ID */
+ hid_t tid_short = -1; /* Datatype ID */
+ hid_t exp_tid = -1; /* Expected datatype ID */
hid_t ocpypl_id = -1; /* Object copy plist ID */
hsize_t dim1d[1]; /* Dataset dimensions */
char src_filename[NAME_BUF_SIZE];
@@ -12115,7 +12312,7 @@ test_copy_cdt_merge_all_suggs(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl,
/* create third dataset in group */
if((did = H5Dcreate2(gid, SRC_DSET, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
-
+
/* get datatype */
if((tid_short = H5Topen2(fid_src, "/" SRC_GRP "/" SRC_NDT_SHORT, H5P_DEFAULT)) < 0) TEST_ERROR
@@ -12244,7 +12441,7 @@ test_copy_cdt_merge_all_suggs(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl,
/* close the DST file */
if(H5Fclose(fid_dst) < 0) TEST_ERROR
- /*
+ /*
* Test 1
*/
/* open the source file with read-only */
@@ -12285,7 +12482,7 @@ test_copy_cdt_merge_all_suggs(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl,
if(H5Fclose(fid_dst) < 0) TEST_ERROR
- /*
+ /*
* Test 2
*/
if((fid_dst = H5Fopen(dst_filename, H5F_ACC_RDWR, dst_fapl)) < 0) TEST_ERROR
@@ -12322,7 +12519,7 @@ test_copy_cdt_merge_all_suggs(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl,
/* close the DST file */
if(H5Fclose(fid_dst) < 0) TEST_ERROR
- /*
+ /*
* Test 3
*/
if((fid_dst = H5Fopen(dst_filename, H5F_ACC_RDWR, dst_fapl)) < 0) TEST_ERROR
@@ -12357,7 +12554,7 @@ test_copy_cdt_merge_all_suggs(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl,
/* close the DST file */
if(H5Fclose(fid_dst) < 0) TEST_ERROR
- /*
+ /*
* Test 4
*/
if((fid_dst = H5Fopen(dst_filename, H5F_ACC_RDWR, dst_fapl)) < 0) TEST_ERROR
@@ -12410,7 +12607,7 @@ test_copy_cdt_merge_all_suggs(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl,
/* close the DST file */
if(H5Fclose(fid_dst) < 0) TEST_ERROR
- /*
+ /*
* Test 5
*/
/* open destination file */
@@ -12448,7 +12645,7 @@ test_copy_cdt_merge_all_suggs(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl,
/* close the DST file */
if(H5Fclose(fid_dst) < 0) TEST_ERROR
- /*
+ /*
* Test 6
*/
/* open destination file */
@@ -12509,7 +12706,7 @@ error:
return 1;
} /* end test_copy_cdt_merge_all_suggs */
-
+
/*-------------------------------------------------------------------------
* Function: test_copy_set_mcdt_search_cb
*
@@ -12694,7 +12891,7 @@ test_copy_set_mcdt_search_cb(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl,
/* Continue the global search */
if(H5Pset_mcdt_search_cb(ocpypl_id, mcdt_search_cb, &cb_udata) < 0)
- TEST_ERROR
+ TEST_ERROR
/* open destination file */
if((fid_dst = H5Fopen(dst_filename, H5F_ACC_RDWR, dst_fapl)) < 0) TEST_ERROR
@@ -12729,7 +12926,7 @@ test_copy_set_mcdt_search_cb(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl,
if(H5Fclose(fid_dst) < 0) TEST_ERROR
- /*
+ /*
* Stop the search, default action is to create an anonymous committed datatype
*/
cb_udata.search_action = H5O_MCDT_SEARCH_STOP;
@@ -12865,7 +13062,7 @@ error:
return 1;
} /* end test_copy_set_mcdt_search_cb */
-
+
/*-------------------------------------------------------------------------
* Function: test_copy_set_get_mcdt_cb
*
@@ -12911,10 +13108,10 @@ test_copy_set_get_mcdt_search_cb(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl,
int buf[DIM_SIZE_1]; /* Buffer for writing data */
char src_filename[NAME_BUF_SIZE];
char dst_filename[NAME_BUF_SIZE];
- H5O_mcdt_search_cb_t mcdt_cb = NULL; /* The callback function */
- H5O_mcdt_search_ret_t mcdt_udataA; /* User data for callback */
- H5O_mcdt_search_ret_t mcdt_udataB; /* User data for callback */
- H5O_mcdt_search_ret_t *mcdt_udata_p = NULL; /* Pointer to user data for callback */
+ H5O_mcdt_search_cb_t mcdt_cb = NULL; /* The callback function */
+ H5O_mcdt_search_ret_t mcdt_udataA; /* User data for callback */
+ H5O_mcdt_search_ret_t mcdt_udataB; /* User data for callback */
+ H5O_mcdt_search_ret_t *mcdt_udata_p = NULL; /* Pointer to user data for callback */
if(reopen)
TESTING("H5Ocopy(): H5Pset/get_mcdt_search_cb and reopen")
@@ -13044,7 +13241,7 @@ test_copy_set_get_mcdt_search_cb(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl,
/* Continue the global search */
if(H5Pset_mcdt_search_cb(ocpypl_id, mcdt_search_cbA, &mcdt_udataA) < 0)
- TEST_ERROR
+ TEST_ERROR
/* open the destination file */
if((fid_dst = H5Fopen(dst_filename, H5F_ACC_RDWR, dst_fapl)) < 0) TEST_ERROR
@@ -13077,7 +13274,7 @@ test_copy_set_get_mcdt_search_cb(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl,
mcdt_udataB = H5O_MCDT_SEARCH_STOP;
if(H5Pset_mcdt_search_cb(ocpypl_id, mcdt_search_cbA, &mcdt_udataB) < 0)
- TEST_ERROR
+ TEST_ERROR
/* open destination file */
if((fid_dst = H5Fopen(dst_filename, H5F_ACC_RDWR, dst_fapl)) < 0) TEST_ERROR
@@ -13107,7 +13304,7 @@ test_copy_set_get_mcdt_search_cb(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl,
if(H5Pfree_merge_committed_dtype_paths(ocpypl_id) < 0) TEST_ERROR
if(H5Pset_mcdt_search_cb(ocpypl_id, mcdt_search_cbB, &mcdt_udataB) < 0)
- TEST_ERROR
+ TEST_ERROR
/* open destination file */
if((fid_dst = H5Fopen(dst_filename, H5F_ACC_RDWR, dst_fapl)) < 0) TEST_ERROR
@@ -13160,7 +13357,7 @@ error:
return 1;
} /* end test_copy_set_get_mcdt_search_cb */
-
+
/*-------------------------------------------------------------------------
* Function: test_copy_iterate
*
@@ -13258,7 +13455,7 @@ error:
return 1;
} /* end test_copy_iterate */
-
+
/*-------------------------------------------------------------------------
* Function: test_copy_option
*
@@ -13283,7 +13480,7 @@ test_copy_option(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fapl,
hid_t did = -1; /* Dataset ID */
hid_t gid=-1, gid2=-1, gid_ref=-1; /* Group IDs */
hid_t gid_sub=-1, gid_sub_sub=-1; /* Sub-group ID */
- hid_t pid=-1, lcpl_id=-1; /* Property IDs */
+ hid_t pid=-1, lcpl_id=-1; /* Property IDs */
unsigned cpy_flags; /* Object copy flags */
int depth = -1; /* Copy depth */
hsize_t dim2d[2];
@@ -13536,51 +13733,51 @@ error:
H5E_BEGIN_TRY {
H5Pclose(lcpl_id);
H5Pclose(pid);
- H5Sclose(sid);
- H5Dclose(did);
- H5Gclose(gid_ref);
- H5Gclose(gid_sub);
- H5Gclose(gid2);
- H5Gclose(gid);
- H5Fclose(fid_dst);
- H5Fclose(fid_src);
- H5Fclose(fid_ext);
+ H5Sclose(sid);
+ H5Dclose(did);
+ H5Gclose(gid_ref);
+ H5Gclose(gid_sub);
+ H5Gclose(gid2);
+ H5Gclose(gid);
+ H5Fclose(fid_dst);
+ H5Fclose(fid_src);
+ H5Fclose(fid_ext);
} H5E_END_TRY;
return 1;
} /* end test_copy_option */
-
+
/*-------------------------------------------------------------------------
* Function: test_copy_dataset_open
*
* Purpose: To ensure that H5Ocopy() copies data of opened dataset correctly.
- * This is for bug fix HDFFV-7853.
- *
- * Test Case 1:
- * Create a dataset with attributes in SRC file
- * Copy the opened dataset to another location in the same file
- * Copy the opened dataset to DST file
- * Close the dataset
- *
- * Test Case 2:
- * Reopen the dataset, write new data to the dataset
- * Copy the opened dataset to another location in the same file
- * Copy the opened dataset to to DST file
- * Close the dataset
- *
- * Test Case 3:
- * Create a committed datatype
- * Create a dataset with the committed datatype in SRC file
- * Open the committed datatype
- * Copy the opened dataset (with the opened committed datatype) to another location in the same file
- * Copy the opened dataset (with the opened committed datatype) to DST file
- * Close the dataset and the committed datatype
- *
- * Test Case 4:
- * Create a group with attributes, create a dataset in the group
- * Copy the opened group (together with the opened dataset) to another location in the same file
- * Copy the opened group (together with the opened dataset) to DST file
- * Close the group and the dataset
+ * This is for bug fix HDFFV-7853.
+ *
+ * Test Case 1:
+ * Create a dataset with attributes in SRC file
+ * Copy the opened dataset to another location in the same file
+ * Copy the opened dataset to DST file
+ * Close the dataset
+ *
+ * Test Case 2:
+ * Reopen the dataset, write new data to the dataset
+ * Copy the opened dataset to another location in the same file
+ * Copy the opened dataset to to DST file
+ * Close the dataset
+ *
+ * Test Case 3:
+ * Create a committed datatype
+ * Create a dataset with the committed datatype in SRC file
+ * Open the committed datatype
+ * Copy the opened dataset (with the opened committed datatype) to another location in the same file
+ * Copy the opened dataset (with the opened committed datatype) to DST file
+ * Close the dataset and the committed datatype
+ *
+ * Test Case 4:
+ * Create a group with attributes, create a dataset in the group
+ * Copy the opened group (together with the opened dataset) to another location in the same file
+ * Copy the opened group (together with the opened dataset) to DST file
+ * Close the group and the dataset
*
* Return: Success: 0
* Failure: number of errors
@@ -13658,16 +13855,16 @@ test_copy_dataset_open(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst
/* write data to the dataset */
if(H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) TEST_ERROR
if(H5Dwrite(did2, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) TEST_ERROR
-
+
/* attach attributes to the dataset */
if(test_copy_attach_attributes(did, H5T_NATIVE_INT) < 0) TEST_ERROR
if(test_copy_attach_attributes(did2, H5T_NATIVE_INT) < 0) TEST_ERROR
- /*
- * Test case 1
+ /*
+ * Test case 1
*/
- /*
+ /*
* Copy within the same file
*/
/* copy the opened dataset to another location in SRC file */
@@ -13686,7 +13883,7 @@ test_copy_dataset_open(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst
if(H5Dclose(did3) < 0) TEST_ERROR
if(H5Dclose(did4) < 0) TEST_ERROR
- /*
+ /*
* Copy to another file
*/
/* copy the opened dataset from SRC to DST */
@@ -13709,8 +13906,8 @@ test_copy_dataset_open(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst
if(H5Dclose(did) < 0) TEST_ERROR
if(H5Dclose(did2) < 0) TEST_ERROR
- /*
- * Test case 2
+ /*
+ * Test case 2
*/
/* reopen the dataset in SRC file */
if((did = H5Dopen2(fid_src, NAME_DATASET_SIMPLE, H5P_DEFAULT)) < 0) TEST_ERROR
@@ -13720,7 +13917,7 @@ test_copy_dataset_open(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst
if(H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, newbuf) < 0) TEST_ERROR
if(H5Dwrite(did2, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, newbuf) < 0) TEST_ERROR
- /*
+ /*
* Copy within the same file
*/
/* copy the opened dataset to another location in SRC file */
@@ -13738,7 +13935,7 @@ test_copy_dataset_open(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst
/* close the copied dataset in SRC file */
if(H5Dclose(did3) < 0) TEST_ERROR
if(H5Dclose(did4) < 0) TEST_ERROR
- /*
+ /*
* Copy to another file
*/
/* copy the opened dataset from SRC to DST */
@@ -13761,8 +13958,8 @@ test_copy_dataset_open(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst
if(H5Dclose(did) < 0) TEST_ERROR
if(H5Dclose(did2) < 0) TEST_ERROR
- /*
- * Test case 3
+ /*
+ * Test case 3
*/
/* make a copy of the datatype */
@@ -13783,7 +13980,7 @@ test_copy_dataset_open(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst
/* write data to the dataset */
if(H5Dwrite(did, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) TEST_ERROR
- /*
+ /*
* Copy within the same file
*/
/* copy the opened dataset (with the opened committed datatype) to another location in SRC file */
@@ -13798,7 +13995,7 @@ test_copy_dataset_open(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst
/* close the copied dataset in SRC file */
if(H5Dclose(did2) < 0) TEST_ERROR
- /*
+ /*
* Copy to another file
*/
/* copy the opened dataset (with the opened committed datatype) from SRC to DST */
@@ -13819,8 +14016,8 @@ test_copy_dataset_open(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst
/* close the committed datatype at SRC file */
if(H5Tclose(tid) < 0) TEST_ERROR
- /*
- * Test case 4
+ /*
+ * Test case 4
*/
/* create a group in SRC file */
if((gid = H5Gcreate2(fid_src, NAME_GROUP_TOP, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
@@ -13833,7 +14030,7 @@ test_copy_dataset_open(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst
/* write data to the dataset */
if(H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) TEST_ERROR
- /*
+ /*
* Copy within the same file
*/
/* copy the opened group (together with opened dataset) to another location in SRC file */
@@ -13848,7 +14045,7 @@ test_copy_dataset_open(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst
/* close the DST dataset */
if(H5Gclose(gid2) < 0) TEST_ERROR
- /*
+ /*
* Copy to another file
*/
/* copy the opened group (together with opened dataset) to DST file */
@@ -13883,20 +14080,20 @@ test_copy_dataset_open(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst
error:
H5E_BEGIN_TRY {
- H5Dclose(did);
- H5Dclose(did2);
- H5Sclose(sid);
- H5Gclose(gid);
- H5Gclose(gid2);
- H5Fclose(fid_dst);
- H5Fclose(fid_src);
+ H5Dclose(did);
+ H5Dclose(did2);
+ H5Sclose(sid);
+ H5Gclose(gid);
+ H5Gclose(gid2);
+ H5Fclose(fid_dst);
+ H5Fclose(fid_src);
} H5E_END_TRY;
return 1;
} /* end test_copy_dataset_open */
-
+
/*-------------------------------------------------------------------------
- * Function: main
+ * Function: main
*
* Purpose: Test H5Ocopy()
*
@@ -13917,11 +14114,11 @@ int
main(void)
{
int nerrors = 0;
- hid_t fapl, fapl2;
+ hid_t fapl, fapl2;
hid_t fcpl_shared, ocpl;
unsigned max_compact, min_dense;
int configuration; /* Configuration of tests. */
- int ExpressMode;
+ int ExpressMode;
hbool_t same_file; /* Whether to run tests that only use one file */
/* Setup */
@@ -13999,7 +14196,7 @@ main(void)
}
} /* end if */
else {
- puts("Testing with oldest file format for source file:");
+ puts("Testing with oldest file format for source file:");
src_fapl = fapl;
num_attributes_g = 4;
} /* end else */
@@ -14017,6 +14214,7 @@ main(void)
/* The tests... */
nerrors += test_copy_dataset_simple(fcpl_src, fcpl_dst, src_fapl, dst_fapl);
+ nerrors += test_copy_dataset_versionbounds(fcpl_src, src_fapl);
nerrors += test_copy_dataset_simple_samefile(fcpl_src, src_fapl);
/* Test with dataset opened in the file or not */
diff --git a/test/ohdr.c b/test/ohdr.c
index 3915b38..e886bf9 100644
--- a/test/ohdr.c
+++ b/test/ohdr.c
@@ -738,49 +738,100 @@ error:
return FAIL;
} /* test_unknown() */
+#define STR_EARLIEST "earliest"
+#define STR_V18 "v18"
+#define STR_LATEST "latest"
+char *version_string(H5F_libver_t libver)
+{
+ char *str = NULL;
+
+ str = (char *) HDmalloc(20);
+ if (str == NULL)
+ {
+ fprintf(stderr, "Allocation failed\n");
+ exit(1);
+ }
+
+ switch(libver) {
+ case H5F_LIBVER_EARLIEST:
+ strcpy(str, STR_EARLIEST);
+ break;
+
+ case H5F_LIBVER_V18:
+ strcpy(str, STR_V18);
+ break;
+
+ case H5F_LIBVER_V110:
+ HDassert(H5F_LIBVER_LATEST == H5F_LIBVER_V110);
+ strcpy(str, STR_LATEST);
+ break;
+
+ case H5F_LIBVER_ERROR:
+ case H5F_LIBVER_NBOUNDS:
+ default:
+ sprintf(str, "%ld", (long)libver);
+ break;
+ } /* end switch */
+
+ /* Return the formed version bound string */
+ return(str);
+} /* end of version_string */
+
/*-------------------------------------------------------------------------
* Function: main
*
* Purpose: Exercise private object header behavior and routines
*
- * Return: Success: 0
- * Failure: 1
+ * Return: Success: 0
+ * Failure: 1
*
* Programmer: Robb Matzke
* Tuesday, November 24, 1998
*
+ * Modification:
+ * - Added loop of combinations of low/high library format bounds
+ * (BMR, Feb 2018)
+ *
*-------------------------------------------------------------------------
*/
int
main(void)
{
- hid_t fapl = -1, file = -1;
- H5F_t *f = NULL;
- char filename[1024];
- H5O_hdr_info_t hdr_info; /* Object info */
- H5O_loc_t oh_loc; /* Object header locations */
- time_t time_new, ro;
- int i; /* Local index variable */
- unsigned b; /* Index for "new format" loop */
- herr_t ret; /* Generic return value */
+ hid_t fapl = -1;
+ hid_t file = -1;
+ H5F_t *f = NULL;
+ char filename[1024];
+ H5O_hdr_info_t hdr_info; /* Object info */
+ H5O_loc_t oh_loc; /* Object header locations */
+ H5F_libver_t low, high; /* File format bounds */
+ time_t time_new, ro;
+ unsigned b; /* Index for "new format" loop */
+ char msg[80]; /* Message for file format version */
+ int i; /* Local index variable */
+ herr_t ret; /* Generic return value */
/* Reset library */
h5_reset();
fapl = h5_fileaccess();
h5_fixname(FILENAME[0], fapl, filename, sizeof filename);
- /* Loop over old & new formats */
- for(b = FALSE; b <= TRUE; b++) {
- /* Display info about testing */
- if(b)
- HDputs("Using new file format:");
- else
- HDputs("Using default file format:");
+ /* Loop through all the combinations of low/high library format bounds */
+ for(low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; low++) {
+ for(high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; high++) {
- /* Set the format to use for the file */
- if(H5Pset_libver_bounds(fapl, (b ? H5F_LIBVER_LATEST : H5F_LIBVER_EARLIEST), H5F_LIBVER_LATEST) < 0)
- FAIL_STACK_ERROR
+ /* Set version bounds before opening the file */
+ H5E_BEGIN_TRY {
+ ret = H5Pset_libver_bounds(fapl, low, high);
+ } H5E_END_TRY;
+
+ if (ret < 0) /* Invalid low/high combinations */
+ continue;
+
+ /* Display info about testing */
+ sprintf(msg, "Using file format version: (%s, %s)", version_string(low),
+ version_string(high));
+ HDputs(msg);
/* test on object continuation block */
if(test_cont(filename, fapl) < 0)
@@ -977,7 +1028,9 @@ main(void)
/* Test object header creation metadata cache issues */
if(test_ohdr_cache(filename, fapl) < 0)
TEST_ERROR
- } /* end for */
+
+ } /* high */
+ } /* low */
/* Verify symbol table messages are cached */
if(h5_verify_cached_stabs(FILENAME, fapl) < 0) TEST_ERROR
diff --git a/test/set_extent.c b/test/set_extent.c
index b9536e5..5d11819 100644
--- a/test/set_extent.c
+++ b/test/set_extent.c
@@ -427,20 +427,50 @@ error:
*/
static int do_layouts( hid_t fapl )
{
+ hid_t new_fapl = -1;
+ H5F_libver_t low, high; /* Low and high bounds */
+ herr_t ret; /* Generic return value */
- TESTING("storage layout use");
+ TESTING("storage layout use - tested with all low/high library format bounds");
+ /* Loop through all the combinations of low/high library format bounds */
+ for(low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; low++) {
+ for(high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; high++) {
- if (test_layouts( H5D_COMPACT, fapl ) < 0)
- goto error;
+ /* Copy plist to use locally to avoid modifying the original */
+ new_fapl = H5Pcopy(fapl);
- if (test_layouts( H5D_CONTIGUOUS, fapl ) < 0)
- goto error;
+ /* Set version bounds */
+ H5E_BEGIN_TRY {
+ ret = H5Pset_libver_bounds(new_fapl, low, high);
+ } H5E_END_TRY;
+
+ if (ret < 0) /* Invalid low/high combinations */
+ {
+ if (H5Pclose(new_fapl) < 0)
+ goto error;
+ continue;
+ }
+
+ if (test_layouts( H5D_COMPACT, new_fapl ) < 0)
+ goto error;
+
+ if (test_layouts( H5D_CONTIGUOUS, new_fapl ) < 0)
+ goto error;
+
+ if (H5Pclose(new_fapl) < 0)
+ goto error;
+ } /* end for high */
+ } /* end for low */
PASSED();
return 0;
error:
+ H5E_BEGIN_TRY
+ {
+ H5Pclose(new_fapl);
+ } H5E_END_TRY;
return -1;
}
diff --git a/test/swmr.c b/test/swmr.c
index 3b1bd09..0b352e2 100644
--- a/test/swmr.c
+++ b/test/swmr.c
@@ -24,7 +24,6 @@
*
*************************************************************/
-#include "hdf5.h"
#include "h5test.h"
#include "H5Iprivate.h"
diff --git a/test/tarray.c b/test/tarray.c
index b2e0ee7..99f7bf8 100644
--- a/test/tarray.c
+++ b/test/tarray.c
@@ -13,7 +13,7 @@
/***********************************************************
*
-* Test program: tarray
+* Test program: tarray
*
* Test the Array Datatype functionality
*
@@ -22,13 +22,11 @@
#include "testhdf5.h"
#include "H5srcdir.h"
-#include "hdf5.h"
-
#define FILENAME "tarray1.h5"
#define TESTFILE "tarrold.h5"
/* 1-D array datatype */
-#define ARRAY1_RANK 1
+#define ARRAY1_RANK 1
#define ARRAY1_DIM1 4
/* 3-D array datatype */
@@ -67,7 +65,7 @@ typedef struct
void *test_array_alloc_custom(size_t size, void *info);
void test_array_free_custom(void *mem, void *info);
-
+
/*-------------------------------------------------------------------------
* Function: test_array_atomic_1d
*
@@ -191,7 +189,7 @@ test_array_atomic_1d(void)
CHECK(ret, FAIL, "H5Fclose");
} /* end test_array_atomic_1d() */
-
+
/*-------------------------------------------------------------------------
* Function: test_array_funcs
*
@@ -254,7 +252,7 @@ test_array_funcs(void)
CHECK(ret, FAIL, "H5Tclose");
} /* end test_array_funcs() */
-
+
/*-------------------------------------------------------------------------
* Function: test_array_atomic_3d
*
@@ -383,7 +381,7 @@ test_array_atomic_3d(void)
} /* end test_array_atomic_3d() */
-
+
/*-------------------------------------------------------------------------
* Function: test_array_array_atomic
*
@@ -542,7 +540,7 @@ test_array_array_atomic(void)
CHECK(ret, FAIL, "H5Fclose");
} /* end test_array_array_atomic() */
-
+
/*-------------------------------------------------------------------------
* Function: test_array_compound_atomic
*
@@ -749,7 +747,7 @@ test_array_compound_atomic(void)
CHECK(ret, FAIL, "H5Fclose");
} /* end test_array_compound_atomic() */
-
+
/*-------------------------------------------------------------------------
* Function: test_array_compound_array
*
@@ -1008,7 +1006,7 @@ test_array_compound_array(void)
** allocated.
**
****************************************************************/
-
+
/*-------------------------------------------------------------------------
* Function: test_array_alloc_custom
*
@@ -1047,7 +1045,7 @@ test_array_alloc_custom(size_t size, void *info)
return ret_value;
} /* end test_array_alloc_custom() */
-
+
/*-------------------------------------------------------------------------
* Function: test_array_free_custom
*
@@ -1083,7 +1081,7 @@ test_array_free_custom(void *_mem, void *info)
return;
} /* end test_array_free_custom() */
-
+
/*-------------------------------------------------------------------------
* Function: test_array_vlen_atomic
*
@@ -1298,7 +1296,7 @@ test_array_vlen_atomic(void)
} /* end test_array_vlen_atomic() */
-
+
/*-------------------------------------------------------------------------
* Function: test_array_vlen_array
*
@@ -1553,7 +1551,7 @@ test_array_vlen_array(void)
} /* end test_array_vlen_array() */
-
+
/*-------------------------------------------------------------------------
* Function: test_array_bkg
*
@@ -1582,9 +1580,9 @@ test_array_bkg(void)
unsigned ndims[3] = {1,1,1};
typedef struct {
- int a[ALEN];
- float b[ALEN];
- double c[ALEN];
+ int a[ALEN];
+ float b[ALEN];
+ double c[ALEN];
} CmpField;
CmpField cf[LENGTH];
@@ -1857,7 +1855,7 @@ test_array_bkg(void)
HDfree(dtsinfo);
} /* end test_array_bkg() */
-
+
/*-------------------------------------------------------------------------
* Function: test_compat
*
@@ -2152,7 +2150,7 @@ test_compat(void)
} /* end test_compat() */
-
+
/*-------------------------------------------------------------------------
* Function: test_array
*
@@ -2185,7 +2183,7 @@ test_array(void)
} /* end test_array() */
-
+
/*-------------------------------------------------------------------------
* Function: cleanup_array
*
diff --git a/test/tattr.c b/test/tattr.c
index 2d333e9..525898d 100644
--- a/test/tattr.c
+++ b/test/tattr.c
@@ -20,8 +20,6 @@
*************************************************************/
#include "testhdf5.h"
-#include "h5test.h"
-#include "hdf5.h"
/*
* This file needs to access private information from the H5O package.
@@ -153,7 +151,7 @@ static herr_t attr_op1(hid_t loc_id, const char *name, const H5A_info_t *ainfo,
void *op_data);
-
+
/****************************************************************
**
** test_attr_basic_write(): Test basic H5A (attribute) code.
@@ -393,7 +391,7 @@ test_attr_basic_write(hid_t fapl)
CHECK(ret, FAIL, "H5Fclose");
} /* test_attr_basic_write() */
-
+
/****************************************************************
**
** test_attr_basic_read(): Test basic H5A (attribute) code.
@@ -484,7 +482,7 @@ test_attr_basic_read(hid_t fapl)
CHECK(ret, FAIL, "H5Fclose");
} /* test_attr_basic_read() */
-
+
/****************************************************************
**
** test_attr_flush(): Test H5A (attribute) code for performing
@@ -551,7 +549,7 @@ test_attr_flush(hid_t fapl)
CHECK(ret, FAIL, "H5Fclose");
} /* test_attr_flush() */
-
+
/****************************************************************
**
** test_attr_plist(): Test Attribute Creation Property Lists
@@ -664,7 +662,7 @@ test_attr_plist(hid_t fapl)
CHECK(ret, FAIL, "H5Fclose");
} /* test_attr_plist() */
-
+
/****************************************************************
**
** test_attr_compound_write(): Test H5A (attribute) code.
@@ -753,7 +751,7 @@ test_attr_compound_write(hid_t fapl)
CHECK(ret, FAIL, "H5Fclose");
} /* test_attr_compound_write() */
-
+
/****************************************************************
**
** test_attr_compound_read(): Test basic H5A (attribute) code.
@@ -903,7 +901,7 @@ test_attr_compound_read(hid_t fapl)
CHECK(ret, FAIL, "H5Fclose");
} /* test_attr_compound_read() */
-
+
/****************************************************************
**
** test_attr_scalar_write(): Test scalar H5A (attribute) writing code.
@@ -969,7 +967,7 @@ test_attr_scalar_write(hid_t fapl)
CHECK(ret, FAIL, "H5Fclose");
} /* test_attr_scalar_write() */
-
+
/****************************************************************
**
** test_attr_scalar_read(): Test scalar H5A (attribute) reading code.
@@ -1040,7 +1038,7 @@ test_attr_scalar_read(hid_t fapl)
CHECK(ret, FAIL, "H5Fclose");
} /* test_attr_scalar_read() */
-
+
/****************************************************************
**
** test_attr_mult_write(): Test basic H5A (attribute) code.
@@ -1161,7 +1159,7 @@ test_attr_mult_write(hid_t fapl)
CHECK(ret, FAIL, "H5Fclose");
} /* test_attr_mult_write() */
-
+
/****************************************************************
**
** test_attr_mult_read(): Test basic H5A (attribute) code.
@@ -1383,7 +1381,7 @@ test_attr_mult_read(hid_t fapl)
CHECK(ret, FAIL, "H5Fclose");
} /* test_attr_mult_read() */
-
+
/****************************************************************
**
** attr_op1(): Attribute operator
@@ -1423,7 +1421,7 @@ attr_op1(hid_t H5_ATTR_UNUSED loc_id, const char *name, const H5A_info_t H5_ATTR
return(ret);
} /* end attr_op1() */
-
+
/****************************************************************
**
** test_attr_iterate(): Test H5A (attribute) iterator code.
@@ -1495,7 +1493,7 @@ test_attr_iterate(hid_t fapl)
CHECK(ret, FAIL, "H5Fclose");
} /* test_attr_iterate() */
-
+
/****************************************************************
**
** test_attr_delete(): Test H5A (attribute) code for deleting objects.
@@ -1615,7 +1613,7 @@ test_attr_delete(hid_t fapl)
CHECK(ret, FAIL, "H5Fclose");
} /* test_attr_delete() */
-
+
/****************************************************************
**
** test_attr_dtype_shared(): Test H5A (attribute) code for using
@@ -1792,7 +1790,7 @@ test_attr_dtype_shared(hid_t fapl)
VERIFY(filesize, empty_filesize, "h5_get_file_size");
} /* test_attr_dtype_shared() */
-
+
/****************************************************************
**
** test_attr_duplicate_ids(): Test operations with more than
@@ -2037,7 +2035,7 @@ test_attr_duplicate_ids(hid_t fapl)
CHECK(ret, FAIL, "H5Fclose");
} /* test_attr_duplicate_ids() */
-
+
/****************************************************************
**
** test_attr_dense_verify(): Test basic H5A (attribute) code.
@@ -2107,7 +2105,7 @@ test_attr_dense_verify(hid_t loc_id, unsigned max_attr)
return(-1);
} /* test_attr_dense_verify() */
-
+
/****************************************************************
**
** test_attr_dense_create(): Test basic H5A (attribute) code.
@@ -2238,7 +2236,7 @@ test_attr_dense_create(hid_t fcpl, hid_t fapl)
VERIFY(filesize, empty_filesize, "h5_get_file_size");
} /* test_attr_dense_create() */
-
+
/****************************************************************
**
** test_attr_dense_open(): Test basic H5A (attribute) code.
@@ -2377,7 +2375,7 @@ test_attr_dense_open(hid_t fcpl, hid_t fapl)
VERIFY(filesize, empty_filesize, "h5_get_file_size");
} /* test_attr_dense_open() */
-
+
/****************************************************************
**
** test_attr_dense_delete(): Test basic H5A (attribute) code.
@@ -2555,7 +2553,7 @@ test_attr_dense_delete(hid_t fcpl, hid_t fapl)
VERIFY(filesize, empty_filesize, "h5_get_file_size");
} /* test_attr_dense_delete() */
-
+
/****************************************************************
**
** test_attr_dense_rename(): Test basic H5A (attribute) code.
@@ -2714,7 +2712,7 @@ test_attr_dense_rename(hid_t fcpl, hid_t fapl)
VERIFY(filesize, empty_filesize, "h5_get_file_size");
} /* test_attr_dense_rename() */
-
+
/****************************************************************
**
** test_attr_dense_unlink(): Test basic H5A (attribute) code.
@@ -2844,7 +2842,7 @@ test_attr_dense_unlink(hid_t fcpl, hid_t fapl)
VERIFY(filesize, empty_filesize, "h5_get_file_size");
} /* test_attr_dense_unlink() */
-
+
/****************************************************************
**
** test_attr_dense_limits(): Test basic H5A (attribute) code.
@@ -3009,7 +3007,7 @@ test_attr_dense_limits(hid_t fcpl, hid_t fapl)
VERIFY(filesize, empty_filesize, "h5_get_file_size");
} /* test_attr_dense_limits() */
-
+
/****************************************************************
**
** test_attr_dense_dup_ids(): Test operations with multiple ID
@@ -3532,7 +3530,7 @@ test_attr_dense_dup_ids(hid_t fcpl, hid_t fapl)
CHECK(ret, FAIL, "H5Fclose");
} /* test_attr_dense_dup_ids() */
-
+
/****************************************************************
**
** test_attr_big(): Test basic H5A (attribute) code.
@@ -3802,7 +3800,7 @@ test_attr_big(hid_t fcpl, hid_t fapl)
VERIFY(filesize, empty_filesize, "h5_get_file_size");
} /* test_attr_big() */
-
+
/****************************************************************
**
** test_attr_null_space(): Test basic H5A (attribute) code.
@@ -4020,7 +4018,7 @@ test_attr_null_space(hid_t fcpl, hid_t fapl)
VERIFY(filesize, empty_filesize, "h5_get_file_size");
} /* test_attr_null_space() */
-
+
/****************************************************************
**
** test_attr_deprec(): Test basic H5A (attribute) code.
@@ -4129,7 +4127,7 @@ test_attr_deprec(hid_t fcpl, hid_t fapl)
#endif /* H5_NO_DEPRECATED_SYMBOLS */
} /* test_attr_deprec() */
-
+
/****************************************************************
**
** test_attr_many(): Test basic H5A (attribute) code.
@@ -4258,7 +4256,7 @@ test_attr_many(hbool_t new_format, hid_t fcpl, hid_t fapl)
CHECK(ret, FAIL, "H5Sclose");
} /* test_attr_many() */
-
+
/****************************************************************
**
** test_attr_corder_create_empty(): Test basic H5A (attribute) code.
@@ -4374,7 +4372,7 @@ test_attr_corder_create_basic(hid_t fcpl, hid_t fapl)
CHECK(ret, FAIL, "H5Fclose");
} /* test_attr_corder_create_basic() */
-
+
/****************************************************************
**
** test_attr_corder_create_compact(): Test basic H5A (attribute) code.
@@ -4572,7 +4570,7 @@ test_attr_corder_create_compact(hid_t fcpl, hid_t fapl)
CHECK(ret, FAIL, "H5Fclose");
} /* test_attr_corder_create_compact() */
-
+
/****************************************************************
**
** test_attr_corder_create_dense(): Test basic H5A (attribute) code.
@@ -4799,7 +4797,7 @@ test_attr_corder_create_dense(hid_t fcpl, hid_t fapl)
CHECK(ret, FAIL, "H5Fclose");
} /* test_attr_corder_create_dense() */
-
+
/****************************************************************
**
** test_attr_corder_create_reopen(): Test basic H5A (attribute) code.
@@ -4907,7 +4905,7 @@ test_attr_corder_create_reopen(hid_t fcpl, hid_t fapl)
CHECK(ret, FAIL, "H5Sclose");
} /* test_attr_corder_create_reopen() */
-
+
/****************************************************************
**
** test_attr_corder_transition(): Test basic H5A (attribute) code.
@@ -5313,7 +5311,7 @@ test_attr_corder_transition(hid_t fcpl, hid_t fapl)
CHECK(ret, FAIL, "H5Sclose");
} /* test_attr_corder_transition() */
-
+
/****************************************************************
**
** test_attr_corder_delete(): Test basic H5A (attribute) code.
@@ -5514,7 +5512,7 @@ test_attr_corder_delete(hid_t fcpl, hid_t fapl)
CHECK(ret, FAIL, "H5Sclose");
} /* test_attr_corder_delete() */
-
+
/*-------------------------------------------------------------------------
* Function: attr_info_by_idx_check
*
@@ -5661,7 +5659,7 @@ attr_info_by_idx_check(hid_t obj_id, const char *attrname, hsize_t n,
return(-1);
} /* end attr_info_by_idx_check() */
-
+
/****************************************************************
**
** test_attr_info_by_idx(): Test basic H5A (attribute) code.
@@ -5871,7 +5869,7 @@ test_attr_info_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl)
CHECK(ret, FAIL, "H5Sclose");
} /* test_attr_info_by_idx() */
-
+
/****************************************************************
**
** test_attr_delete_by_idx(): Test basic H5A (attribute) code.
@@ -6403,7 +6401,7 @@ test_attr_delete_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl)
CHECK(ret, FAIL, "H5Sclose");
} /* test_attr_delete_by_idx() */
-
+
/****************************************************************
**
** attr_iterate2_cb(): Revised attribute operator
@@ -6477,7 +6475,7 @@ HDfprintf(stderr, "op_data->curr = %Hd\n", op_data->curr);
} /* end attr_iterate2_cb() */
#ifndef H5_NO_DEPRECATED_SYMBOLS
-
+
/****************************************************************
**
** attr_iterate1_cb(): Attribute operator
@@ -6490,7 +6488,7 @@ attr_iterate1_cb(hid_t loc_id, const char *attr_name, void *_op_data)
} /* end attr_iterate1_cb() */
#endif /* H5_NO_DEPRECATED_SYMBOLS */
-
+
/*-------------------------------------------------------------------------
* Function: attr_iterate2_fail_cb
*
@@ -6512,7 +6510,7 @@ attr_iterate2_fail_cb(hid_t H5_ATTR_UNUSED group_id, const char H5_ATTR_UNUSED *
return(H5_ITER_ERROR);
} /* end attr_iterate2_fail_cb() */
-
+
/*-------------------------------------------------------------------------
* Function: attr_iterate_check
*
@@ -6812,7 +6810,7 @@ attr_iterate_check(hid_t fid, const char *dsetname, hid_t obj_id,
return(-1);
} /* end attr_iterate_check() */
-
+
/****************************************************************
**
** test_attr_iterate2(): Test basic H5A (attribute) code.
@@ -7116,7 +7114,7 @@ test_attr_iterate2(hbool_t new_format, hid_t fcpl, hid_t fapl)
HDfree(visited);
} /* test_attr_iterate2() */
-
+
/*-------------------------------------------------------------------------
* Function: attr_open_by_idx_check
*
@@ -7176,7 +7174,7 @@ attr_open_by_idx_check(hid_t obj_id, H5_index_t idx_type, H5_iter_order_t order,
return(-1);
} /* end attr_open_by_idx_check() */
-
+
/****************************************************************
**
** test_attr_open_by_idx(): Test basic H5A (attribute) code.
@@ -7438,7 +7436,7 @@ test_attr_open_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl)
CHECK(ret, FAIL, "H5Sclose");
} /* test_attr_open_by_idx() */
-
+
/*-------------------------------------------------------------------------
* Function: attr_open_check
*
@@ -7524,7 +7522,7 @@ attr_open_check(hid_t fid, const char *dsetname, hid_t obj_id,
return(-1);
} /* end attr_open_check() */
-
+
/****************************************************************
**
** test_attr_open_by_name(): Test basic H5A (attribute) code.
@@ -7779,7 +7777,7 @@ test_attr_open_by_name(hbool_t new_format, hid_t fcpl, hid_t fapl)
CHECK(ret, FAIL, "H5Sclose");
} /* test_attr_open_by_name() */
-
+
/****************************************************************
**
** test_attr_create_by_name(): Test basic H5A (attribute) code.
@@ -10866,7 +10864,7 @@ test_attr(void)
CHECK(ret, FAIL, "H5Pclose");
} /* test_attr() */
-
+
/*-------------------------------------------------------------------------
* Function: cleanup_attr
*
diff --git a/test/tconfig.c b/test/tconfig.c
index a9f3378..b652ca4 100644
--- a/test/tconfig.c
+++ b/test/tconfig.c
@@ -19,7 +19,6 @@
*
*************************************************************/
-#include "hdf5.h"
#include "testhdf5.h"
/* macros definitions */
@@ -40,22 +39,22 @@
/* Needs this extra step so that we can print the macro name. */
#define vrfy_macrosize(type, macro, macroname) \
if (sizeof(type) != macro) \
- TestErrPrintf("Error: sizeof(%s) is %zu but %s is %d\n", \
- #type, sizeof(type), macroname, (int)macro);
+ TestErrPrintf("Error: sizeof(%s) is %zu but %s is %d\n", \
+ #type, sizeof(type), macroname, (int)macro);
/* local routine prototypes */
void test_config_ctypes(void);
void test_exit_definitions(void);
-
+
/*-------------------------------------------------------------------------
- * Function: test_configure
+ * Function: test_configure
*
- * Purpose: Main configure definitions testing routine
+ * Purpose: Main configure definitions testing routine
*
- * Return: none (error is fed back via global variable num_errs)
+ * Return: none (error is fed back via global variable num_errs)
*
- * Programmer: Albert Cheng
+ * Programmer: Albert Cheng
* September 25, 2001
*
*-------------------------------------------------------------------------
@@ -69,15 +68,15 @@ test_configure(void)
test_exit_definitions();
}
-
+
/*-------------------------------------------------------------------------
- * Function: cleanup_configure
+ * Function: cleanup_configure
*
- * Purpose: Cleanup temporary test files
+ * Purpose: Cleanup temporary test files
*
- * Return: none
+ * Return: none
*
- * Programmer: Albert Cheng
+ * Programmer: Albert Cheng
* September 25, 2001
*
* Modifications:
@@ -90,20 +89,20 @@ cleanup_configure(void)
/* no file to clean */
}
-
+
/*-------------------------------------------------------------------------
- * Function: test_config_ctypes
+ * Function: test_config_ctypes
*
- * Purpose: test C language data type sizes
+ * Purpose: test C language data type sizes
*
- * Return: none (error is fed back via global variable num_errs)
+ * Return: none (error is fed back via global variable num_errs)
*
- * Programmer: Albert Cheng
+ * Programmer: Albert Cheng
* September 25, 2001
*
* Modifications:
- * Albert Cheng, 2004/10/14
- * Verified both signed and unsigned int types.
+ * Albert Cheng, 2004/10/14
+ * Verified both signed and unsigned int types.
*
*-------------------------------------------------------------------------
*/
@@ -201,15 +200,15 @@ test_config_ctypes(void)
}
-
+
/*-------------------------------------------------------------------------
- * Function: test_exit_definitions
+ * Function: test_exit_definitions
*
- * Purpose: test the exit macros values
+ * Purpose: test the exit macros values
*
- * Return: none (error is fed back via global variable num_errs)
+ * Return: none (error is fed back via global variable num_errs)
*
- * Programmer: Albert Cheng
+ * Programmer: Albert Cheng
* October 12, 2009
*
* Modifications:
@@ -222,9 +221,9 @@ test_exit_definitions(void)
/* Verify the EXIT_SUCCESS and EXIT_FAILURE are 0 and 1 respectively. */
/* This should be true for POSIX compliant systems. */
if (EXIT_SUCCESS != 0) \
- TestErrPrintf("Error: EXIT_SUCCESS is %d, should be %d\n", \
- EXIT_SUCCESS, 0);
+ TestErrPrintf("Error: EXIT_SUCCESS is %d, should be %d\n", \
+ EXIT_SUCCESS, 0);
if (EXIT_FAILURE != 1) \
- TestErrPrintf("Error: EXIT_FAILURE is %d, should be %d\n", \
- EXIT_FAILURE, 1);
+ TestErrPrintf("Error: EXIT_FAILURE is %d, should be %d\n", \
+ EXIT_FAILURE, 1);
}
diff --git a/test/testfiles/plist_files/dapl_32be b/test/testfiles/plist_files/dapl_32be
index 4dedda2..8dcf239 100644
--- a/test/testfiles/plist_files/dapl_32be
+++ b/test/testfiles/plist_files/dapl_32be
Binary files differ
diff --git a/test/testfiles/plist_files/dapl_32le b/test/testfiles/plist_files/dapl_32le
index 4dedda2..8dcf239 100644
--- a/test/testfiles/plist_files/dapl_32le
+++ b/test/testfiles/plist_files/dapl_32le
Binary files differ
diff --git a/test/testfiles/plist_files/dapl_64be b/test/testfiles/plist_files/dapl_64be
index 4dedda2..8dcf239 100644
--- a/test/testfiles/plist_files/dapl_64be
+++ b/test/testfiles/plist_files/dapl_64be
Binary files differ
diff --git a/test/testfiles/plist_files/dapl_64le b/test/testfiles/plist_files/dapl_64le
index 4dedda2..8dcf239 100644
--- a/test/testfiles/plist_files/dapl_64le
+++ b/test/testfiles/plist_files/dapl_64le
Binary files differ
diff --git a/test/testfiles/plist_files/def_dapl_32be b/test/testfiles/plist_files/def_dapl_32be
index 3df7289..880eae5 100644
--- a/test/testfiles/plist_files/def_dapl_32be
+++ b/test/testfiles/plist_files/def_dapl_32be
Binary files differ
diff --git a/test/testfiles/plist_files/def_dapl_32le b/test/testfiles/plist_files/def_dapl_32le
index 3df7289..880eae5 100644
--- a/test/testfiles/plist_files/def_dapl_32le
+++ b/test/testfiles/plist_files/def_dapl_32le
Binary files differ
diff --git a/test/testfiles/plist_files/def_dapl_64be b/test/testfiles/plist_files/def_dapl_64be
index 3df7289..880eae5 100644
--- a/test/testfiles/plist_files/def_dapl_64be
+++ b/test/testfiles/plist_files/def_dapl_64be
Binary files differ
diff --git a/test/testfiles/plist_files/def_dapl_64le b/test/testfiles/plist_files/def_dapl_64le
index 3df7289..880eae5 100644
--- a/test/testfiles/plist_files/def_dapl_64le
+++ b/test/testfiles/plist_files/def_dapl_64le
Binary files differ
diff --git a/test/testfiles/plist_files/def_fapl_32be b/test/testfiles/plist_files/def_fapl_32be
index 3b35501..6e94011 100644
--- a/test/testfiles/plist_files/def_fapl_32be
+++ b/test/testfiles/plist_files/def_fapl_32be
Binary files differ
diff --git a/test/testfiles/plist_files/def_fapl_32le b/test/testfiles/plist_files/def_fapl_32le
index 3b35501..6e94011 100644
--- a/test/testfiles/plist_files/def_fapl_32le
+++ b/test/testfiles/plist_files/def_fapl_32le
Binary files differ
diff --git a/test/testfiles/plist_files/def_fapl_64be b/test/testfiles/plist_files/def_fapl_64be
index 3b35501..6e94011 100644
--- a/test/testfiles/plist_files/def_fapl_64be
+++ b/test/testfiles/plist_files/def_fapl_64be
Binary files differ
diff --git a/test/testfiles/plist_files/def_fapl_64le b/test/testfiles/plist_files/def_fapl_64le
index 3b35501..6e94011 100644
--- a/test/testfiles/plist_files/def_fapl_64le
+++ b/test/testfiles/plist_files/def_fapl_64le
Binary files differ
diff --git a/test/testfiles/plist_files/fapl_32be b/test/testfiles/plist_files/fapl_32be
index 43e5e67..237b291 100644
--- a/test/testfiles/plist_files/fapl_32be
+++ b/test/testfiles/plist_files/fapl_32be
Binary files differ
diff --git a/test/testfiles/plist_files/fapl_32le b/test/testfiles/plist_files/fapl_32le
index 43e5e67..237b291 100644
--- a/test/testfiles/plist_files/fapl_32le
+++ b/test/testfiles/plist_files/fapl_32le
Binary files differ
diff --git a/test/testfiles/plist_files/fapl_64be b/test/testfiles/plist_files/fapl_64be
index 43e5e67..237b291 100644
--- a/test/testfiles/plist_files/fapl_64be
+++ b/test/testfiles/plist_files/fapl_64be
Binary files differ
diff --git a/test/testfiles/plist_files/fapl_64le b/test/testfiles/plist_files/fapl_64le
index 43e5e67..237b291 100644
--- a/test/testfiles/plist_files/fapl_64le
+++ b/test/testfiles/plist_files/fapl_64le
Binary files differ
diff --git a/test/testfiles/plist_files/lapl_32be b/test/testfiles/plist_files/lapl_32be
index f3e9865..9d81759 100644
--- a/test/testfiles/plist_files/lapl_32be
+++ b/test/testfiles/plist_files/lapl_32be
Binary files differ
diff --git a/test/testfiles/plist_files/lapl_32le b/test/testfiles/plist_files/lapl_32le
index f3e9865..9d81759 100644
--- a/test/testfiles/plist_files/lapl_32le
+++ b/test/testfiles/plist_files/lapl_32le
Binary files differ
diff --git a/test/testfiles/plist_files/lapl_64be b/test/testfiles/plist_files/lapl_64be
index f3e9865..9d81759 100644
--- a/test/testfiles/plist_files/lapl_64be
+++ b/test/testfiles/plist_files/lapl_64be
Binary files differ
diff --git a/test/testfiles/plist_files/lapl_64le b/test/testfiles/plist_files/lapl_64le
index f3e9865..9d81759 100644
--- a/test/testfiles/plist_files/lapl_64le
+++ b/test/testfiles/plist_files/lapl_64le
Binary files differ
diff --git a/test/testhdf5.h b/test/testhdf5.h
index 127c687..1f3f6a0 100644
--- a/test/testhdf5.h
+++ b/test/testhdf5.h
@@ -18,13 +18,6 @@
#ifndef TESTHDF5_H
#define TESTHDF5_H
-/*
- * Include required headers. This file tests internal library functions,
- * so we include the private headers here.
- */
-#include "H5private.h"
-#include "H5Eprivate.h"
-
/* Include generic testing header also */
#include "h5test.h"
@@ -204,12 +197,12 @@ void test_vlstrings(void);
void test_iterate(void);
void test_array(void);
void test_genprop(void);
-void test_configure(void);
-void test_misc(void);
-void test_ids(void);
-void test_skiplist(void);
-void test_sohm(void);
-void test_unicode(void);
+void test_configure(void);
+void test_misc(void);
+void test_ids(void);
+void test_skiplist(void);
+void test_sohm(void);
+void test_unicode(void);
/* Prototypes for the cleanup routines */
void cleanup_metadata(void);
@@ -227,10 +220,10 @@ void cleanup_vlstrings(void);
void cleanup_iterate(void);
void cleanup_array(void);
void cleanup_genprop(void);
-void cleanup_configure(void);
-void cleanup_sohm(void);
-void cleanup_misc(void);
-void cleanup_unicode(void);
+void cleanup_configure(void);
+void cleanup_sohm(void);
+void cleanup_misc(void);
+void cleanup_unicode(void);
#ifdef __cplusplus
}
diff --git a/test/tfile.c b/test/tfile.c
index 80ba4da..de1f362 100644
--- a/test/tfile.c
+++ b/test/tfile.c
@@ -13,26 +13,41 @@
/***********************************************************
*
-* Test program: tfile
+* Test program: tfile
*
* Test the low-level file I/O features.
*
*************************************************************/
-#include "hdf5.h"
#include "testhdf5.h"
#include "H5srcdir.h"
#include "H5Bprivate.h"
+#include "H5Iprivate.h"
#include "H5Pprivate.h"
/*
* This file needs to access private information from the H5F package.
* This file also needs to access the file testing code.
*/
-#define H5F_FRIEND /*suppress error about including H5Fpkg */
+#define H5F_FRIEND /*suppress error about including H5Fpkg */
#define H5F_TESTING
-#include "H5Fpkg.h" /* File access */
+#include "H5Fpkg.h" /* File access */
+
+#define H5D_FRIEND /*suppress error about including H5Dpkg */
+#include "H5Dpkg.h" /* Dataset access */
+
+#define H5S_FRIEND /*suppress error about including H5Spkg */
+#include "H5Spkg.h" /* Dataspace */
+
+#define H5T_FRIEND /*suppress error about including H5Tpkg */
+#include "H5Tpkg.h" /* Datatype */
+
+#define H5A_FRIEND /*suppress error about including H5Apkg */
+#include "H5Apkg.h" /* Attributes */
+
+#define H5O_FRIEND /*suppress error about including H5Opkg */
+#include "H5Opkg.h" /* Object headers */
#define BAD_USERBLOCK_SIZE1 (hsize_t)1
#define BAD_USERBLOCK_SIZE2 (hsize_t)2
@@ -43,46 +58,46 @@
#define BAD_USERBLOCK_SIZE7 (hsize_t)6144
#define F1_USERBLOCK_SIZE (hsize_t)0
-#define F1_OFFSET_SIZE sizeof(haddr_t)
-#define F1_LENGTH_SIZE sizeof(hsize_t)
-#define F1_SYM_LEAF_K 4
-#define F1_SYM_INTERN_K 16
-#define FILE1 "tfile1.h5"
-#define SFILE1 "sys_file1"
+#define F1_OFFSET_SIZE sizeof(haddr_t)
+#define F1_LENGTH_SIZE sizeof(hsize_t)
+#define F1_SYM_LEAF_K 4
+#define F1_SYM_INTERN_K 16
+#define FILE1 "tfile1.h5"
+#define SFILE1 "sys_file1"
#define REOPEN_FILE "tfile_reopen.h5"
#define REOPEN_DSET "dset"
#define F2_USERBLOCK_SIZE (hsize_t)512
-#define F2_OFFSET_SIZE 8
-#define F2_LENGTH_SIZE 8
-#define F2_SYM_LEAF_K 8
-#define F2_SYM_INTERN_K 32
+#define F2_OFFSET_SIZE 8
+#define F2_LENGTH_SIZE 8
+#define F2_SYM_LEAF_K 8
+#define F2_SYM_INTERN_K 32
#define F2_RANK 2
#define F2_DIM0 4
#define F2_DIM1 6
#define F2_DSET "dset"
-#define FILE2 "tfile2.h5"
+#define FILE2 "tfile2.h5"
#define F3_USERBLOCK_SIZE (hsize_t)0
-#define F3_OFFSET_SIZE F2_OFFSET_SIZE
-#define F3_LENGTH_SIZE F2_LENGTH_SIZE
-#define F3_SYM_LEAF_K F2_SYM_LEAF_K
-#define F3_SYM_INTERN_K F2_SYM_INTERN_K
-#define FILE3 "tfile3.h5"
+#define F3_OFFSET_SIZE F2_OFFSET_SIZE
+#define F3_LENGTH_SIZE F2_LENGTH_SIZE
+#define F3_SYM_LEAF_K F2_SYM_LEAF_K
+#define F3_SYM_INTERN_K F2_SYM_INTERN_K
+#define FILE3 "tfile3.h5"
#define GRP_NAME "/group"
#define DSET_NAME "dataset"
#define ATTR_NAME "attr"
#define TYPE_NAME "type"
-#define FILE4 "tfile4.h5"
+#define FILE4 "tfile4.h5"
#define OBJ_ID_COUNT_0 0
#define OBJ_ID_COUNT_1 1
#define OBJ_ID_COUNT_2 2
#define OBJ_ID_COUNT_3 3
#define OBJ_ID_COUNT_4 4
-#define OBJ_ID_COUNT_6 6
+#define OBJ_ID_COUNT_6 6
#define OBJ_ID_COUNT_8 8
#define GROUP1 "Group1"
@@ -112,22 +127,22 @@
#define FSP_SIZE1G 1024*1024*1024 /* File space page size */
/* Declaration for test_libver_macros2() */
-#define FILE6 "tfile6.h5" /* Test file */
+#define FILE6 "tfile6.h5" /* Test file */
/* Declaration for test_get_obj_ids() */
-#define FILE7 "tfile7.h5" /* Test file */
-#define NGROUPS 2
-#define NDSETS 4
+#define FILE7 "tfile7.h5" /* Test file */
+#define NGROUPS 2
+#define NDSETS 4
/* Files created under 1.6 branch and 1.8 branch--used in test_filespace_compatible() */
-const char *OLD_FILENAME[] = {
- "filespace_1_6.h5", /* 1.6 HDF5 file */
- "filespace_1_8.h5" /* 1.8 HDF5 file */
+const char *OLD_FILENAME[] = {
+ "filespace_1_6.h5", /* 1.6 HDF5 file */
+ "filespace_1_8.h5" /* 1.8 HDF5 file */
};
/* Files created in 1.10.0 release --used in test_filespace_1.10.0_compatible() */
/* These files are copied from release 1.10.0 tools/h5format_convert/testfiles */
-const char *OLD_1_10_0_FILENAME[] = {
+const char *OLD_1_10_0_FILENAME[] = {
"h5fc_ext1_i.h5", /* 0 */
"h5fc_ext1_f.h5", /* 1 */
"h5fc_ext2_if.h5", /* 2 */
@@ -151,6 +166,25 @@ const char *FILESPACE_NAME[] = {
NULL
};
+/* Local test function declarations for version bounds */
+static void test_libver_bounds_low_high(void);
+static void test_libver_bounds_super(hid_t fapl);
+static void test_libver_bounds_super_create(hid_t fapl, hid_t fcpl, htri_t is_swmr);
+static void test_libver_bounds_super_open(hid_t fapl, hid_t fcpl, htri_t is_swmr);
+static void test_libver_bounds_obj(hid_t fapl);
+static void test_libver_bounds_dataset(hid_t fapl);
+static void test_libver_bounds_dataspace(hid_t fapl);
+static void test_libver_bounds_datatype(hid_t fapl);
+static void test_libver_bounds_datatype_check(hid_t fapl, hid_t tid);
+static void test_libver_bounds_attributes(hid_t fapl);
+
+#define FILE8 "tfile8.h5" /* Test file */
+
+#define DSET_NULL "DSET_NULL"
+#define DSET "DSET"
+#define DSETA "DSETA"
+#define DSETB "DSETB"
+#define DSETC "DSETC"
static void
create_objects(hid_t, hid_t, hid_t *, hid_t *, hid_t *, hid_t *);
@@ -172,14 +206,14 @@ static void test_rw_noupdate(void);
static void
test_file_create(void)
{
- hid_t fid1, fid2, fid3; /* HDF5 File IDs */
- hid_t tmpl1, tmpl2; /*file creation templates */
- hsize_t ublock; /*sizeof userblock */
- size_t parm; /*file-creation parameters */
- size_t parm2; /*file-creation parameters */
- unsigned iparm;
- unsigned iparm2;
- herr_t ret; /*generic return value */
+ hid_t fid1, fid2, fid3; /* HDF5 File IDs */
+ hid_t tmpl1, tmpl2; /*file creation templates */
+ hsize_t ublock; /*sizeof userblock */
+ size_t parm; /*file-creation parameters */
+ size_t parm2; /*file-creation parameters */
+ unsigned iparm;
+ unsigned iparm2;
+ herr_t ret; /*generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing Low-Level File Creation I/O\n"));
@@ -431,7 +465,7 @@ test_file_create(void)
/* Close third file */
ret = H5Fclose(fid3);
CHECK(ret, FAIL, "H5Fclose");
-} /* test_file_create() */
+} /* test_file_create() */
/****************************************************************
**
@@ -441,17 +475,17 @@ test_file_create(void)
static void
test_file_open(void)
{
- hid_t fid1, fid2; /*HDF5 File IDs */
+ hid_t fid1, fid2; /*HDF5 File IDs */
hid_t did; /*dataset ID */
hid_t fapl_id; /*file access property list ID */
- hid_t tmpl1; /*file creation templates */
- hsize_t ublock; /*sizeof user block */
- size_t parm; /*file-creation parameters */
- size_t parm2; /*file-creation parameters */
- unsigned iparm;
- unsigned iparm2;
- unsigned intent;
- herr_t ret; /*generic return value */
+ hid_t tmpl1; /*file creation templates */
+ hsize_t ublock; /*sizeof user block */
+ size_t parm; /*file-creation parameters */
+ size_t parm2; /*file-creation parameters */
+ unsigned iparm;
+ unsigned iparm2;
+ unsigned intent;
+ herr_t ret; /*generic return value */
/*
* Test single file open
@@ -615,7 +649,7 @@ test_file_close(void)
{
hid_t fid1, fid2;
hid_t fapl_id, access_id;
- hid_t dataset_id, group_id1, group_id2, group_id3;
+ hid_t dataset_id, group_id1, group_id2, group_id3;
H5F_close_degree_t fc_degree;
herr_t ret;
@@ -805,7 +839,7 @@ test_file_close(void)
/* Create more new files and test object count and ID list functions */
test_obj_count_and_id(fid1, fid2, dataset_id, group_id1,
- group_id2, group_id3);
+ group_id2, group_id3);
/* Close first open */
ret = H5Fclose(fid1);
@@ -861,22 +895,22 @@ test_file_close(void)
CHECK(ret, FAIL, "H5Pget_fclose_degree");
switch(fc_degree) {
- case H5F_CLOSE_STRONG:
- /* Close first open */
- ret = H5Fclose(fid1);
- CHECK(ret, FAIL, "H5Fclose");
- /* Close second open */
- ret = H5Fclose(fid2);
- CHECK(ret, FAIL, "H5Fclose");
- break;
- case H5F_CLOSE_SEMI:
+ case H5F_CLOSE_STRONG:
+ /* Close first open */
+ ret = H5Fclose(fid1);
+ CHECK(ret, FAIL, "H5Fclose");
+ /* Close second open */
+ ret = H5Fclose(fid2);
+ CHECK(ret, FAIL, "H5Fclose");
+ break;
+ case H5F_CLOSE_SEMI:
/* Close first open */
ret = H5Fclose(fid1);
CHECK(ret, FAIL, "H5Fclose");
- ret = H5Dclose(dataset_id);
+ ret = H5Dclose(dataset_id);
CHECK(ret, FAIL, "H5Dclose");
ret = H5Gclose(group_id1);
- CHECK(ret, FAIL, "H5Gclose");
+ CHECK(ret, FAIL, "H5Gclose");
ret = H5Gclose(group_id2);
CHECK(ret, FAIL, "H5Gclose");
ret = H5Gclose(group_id3);
@@ -884,8 +918,8 @@ test_file_close(void)
/* Close second open */
ret = H5Fclose(fid2);
CHECK(ret, FAIL, "H5Fclose");
- break;
- case H5F_CLOSE_WEAK:
+ break;
+ case H5F_CLOSE_WEAK:
/* Close first open */
ret = H5Fclose(fid1);
CHECK(ret, FAIL, "H5Fclose");
@@ -900,7 +934,7 @@ test_file_close(void)
CHECK(ret, FAIL, "H5Gclose");
ret = H5Gclose(group_id3);
CHECK(ret, FAIL, "H5Gclose");
- break;
+ break;
case H5F_CLOSE_DEFAULT:
default:
CHECK(fc_degree, H5F_CLOSE_DEFAULT, "H5Pget_fclose_degree");
@@ -922,10 +956,10 @@ test_file_close(void)
****************************************************************/
static void
create_objects(hid_t fid1, hid_t fid2, hid_t *ret_did, hid_t *ret_gid1,
- hid_t *ret_gid2, hid_t *ret_gid3)
+ hid_t *ret_gid2, hid_t *ret_gid3)
{
- ssize_t oid_count;
- herr_t ret;
+ ssize_t oid_count;
+ herr_t ret;
/* Check reference counts of file IDs and opened object IDs.
* The verification is hard-coded. If in any case, this testing
@@ -1027,7 +1061,7 @@ create_objects(hid_t fid1, hid_t fid2, hid_t *ret_did, hid_t *ret_gid1,
/****************************************************************
**
** test_get_obj_ids(): Test the bug and the fix for Jira 8528.
-** H5Fget_obj_ids overfilled the list of
+** H5Fget_obj_ids overfilled the list of
** object IDs by one. This is an enhancement
** for test_obj_count_and_id().
**
@@ -1074,14 +1108,14 @@ test_get_obj_ids(void)
oid_list = (hid_t *)HDcalloc((size_t)oid_list_size, sizeof(hid_t));
CHECK_PTR(oid_list, "HDcalloc");
- /* Call the public function H5F_get_obj_ids to use H5F_get_objects. User reported having problem here.
- * that the returned size (ret_count) from H5Fget_obj_ids is one greater than the size passed in
+ /* Call the public function H5F_get_obj_ids to use H5F_get_objects. User reported having problem here.
+ * that the returned size (ret_count) from H5Fget_obj_ids is one greater than the size passed in
* (oid_list_size) */
ret_count = H5Fget_obj_ids(fid, H5F_OBJ_ALL, (size_t)oid_list_size, oid_list);
CHECK(ret_count, FAIL, "H5Fget_obj_ids");
VERIFY(ret_count, oid_list_size, "H5Fget_obj_count");
- /* Close all object IDs on the list except the file ID. The first ID is supposed to be file ID according
+ /* Close all object IDs on the list except the file ID. The first ID is supposed to be file ID according
* to the library design */
for(i = 0; i< ret_count; i++) {
if(fid != oid_list[i]) {
@@ -1096,7 +1130,7 @@ test_get_obj_ids(void)
CHECK(oid_count, FAIL, "H5Fget_obj_count");
VERIFY(oid_count, NGROUPS + 2, "H5Fget_obj_count");
- /* Get the IDs of the left opend objects */
+ /* Get the IDs of the left opend objects */
ret_count = H5Fget_obj_ids(fid, H5F_OBJ_ALL, (size_t)oid_list_size, oid_list);
CHECK(ret_count, FAIL, "H5Fget_obj_ids");
VERIFY(ret_count, oid_list_size, "H5Fget_obj_count");
@@ -1108,14 +1142,14 @@ test_get_obj_ids(void)
CHECK(ret, FAIL, "H5Oclose");
}
}
-
+
H5Sclose(filespace);
H5Fclose(fid);
HDfree(oid_list);
- /* Reopen the file to check whether H5Fget_obj_count and H5Fget_obj_ids still works
- * when the file is closed first */
+ /* Reopen the file to check whether H5Fget_obj_count and H5Fget_obj_ids still works
+ * when the file is closed first */
fid = H5Fopen(FILE7, H5F_ACC_RDONLY, H5P_DEFAULT);
CHECK(fid, FAIL, "H5Fopen");
@@ -1158,7 +1192,7 @@ static void
test_get_file_id(void)
{
hid_t fid, fid2, fid3;
- hid_t datatype_id, dataset_id, dataspace_id, group_id, attr_id;
+ hid_t datatype_id, dataset_id, dataspace_id, group_id, attr_id;
hid_t plist;
hsize_t dims[F2_RANK];
unsigned intent;
@@ -1316,7 +1350,7 @@ check_file_id(hid_t fid, hid_t object_id)
****************************************************************/
static void
test_obj_count_and_id(hid_t fid1, hid_t fid2, hid_t did, hid_t gid1,
- hid_t gid2, hid_t gid3)
+ hid_t gid2, hid_t gid3)
{
hid_t fid3, fid4;
ssize_t oid_count, ret_count;
@@ -1357,7 +1391,7 @@ test_obj_count_and_id(hid_t fid1, hid_t fid2, hid_t did, hid_t gid1,
oid_count = H5Fget_obj_count((hid_t)H5F_OBJ_ALL, H5F_OBJ_ALL);
CHECK(oid_count, FAIL, "H5Fget_obj_count");
VERIFY(oid_count, OBJ_ID_COUNT_8, "H5Fget_obj_count");
-
+
if(oid_count > 0) {
hid_t *oid_list;
@@ -1365,8 +1399,8 @@ test_obj_count_and_id(hid_t fid1, hid_t fid2, hid_t did, hid_t gid1,
if(oid_list != NULL) {
int i;
- ret_count = H5Fget_obj_ids((hid_t)H5F_OBJ_ALL, H5F_OBJ_ALL, (size_t)oid_count, oid_list);
- CHECK(ret_count, FAIL, "H5Fget_obj_ids");
+ ret_count = H5Fget_obj_ids((hid_t)H5F_OBJ_ALL, H5F_OBJ_ALL, (size_t)oid_count, oid_list);
+ CHECK(ret_count, FAIL, "H5Fget_obj_ids");
for(i = 0; i < oid_count; i++) {
H5I_type_t id_type;
@@ -1480,11 +1514,11 @@ test_file_perm(void)
/****************************************************************
**
** test_file_perm2(): low-level file test routine.
-** This test verifies that no object can be created in a
+** This test verifies that no object can be created in a
** file that is opened for read-only.
**
*****************************************************************/
-static void
+static void
test_file_perm2(void)
{
hid_t file; /* File opened with read-write permission */
@@ -1494,7 +1528,7 @@ test_file_perm2(void)
hid_t dset; /* Dataset ID */
hid_t type; /* Datatype ID */
hid_t attr; /* Attribute ID */
- herr_t ret;
+ herr_t ret;
/* Output message about test being performed */
MESSAGE(5, ("Testing Low-Level File Permissions again\n"));
@@ -2086,35 +2120,35 @@ test_file_double_dataset_open(void)
/****************************************************************
**
** test_file_double_file_dataset_open():
-** This test checks multi-opens of files & datasets:
-** It simulates the multi-thread test program from DLS
-** which exposes the file pointer segmentation fault failure.
-** NOTE: The order on when the files and datasets are open/close
-** is important.
+** This test checks multi-opens of files & datasets:
+** It simulates the multi-thread test program from DLS
+** which exposes the file pointer segmentation fault failure.
+** NOTE: The order on when the files and datasets are open/close
+** is important.
**
*****************************************************************/
static void
test_file_double_file_dataset_open(hbool_t new_format)
{
- hid_t fapl = -1; /* File access property list */
- hid_t dcpl = -1; /* Dataset creation property list */
- hid_t fid1 = -1, fid2 = -1; /* File IDs */
- hid_t did1 = -1, did2 = -1; /* Dataset IDs */
- hid_t sid1 = -1, sid2 = -1; /* Dataspace IDs */
- hid_t tid1 = -1, tid2 = -1; /* Datatype IDs */
- hsize_t dims[1] = {5}, dims2[2] = {1, 4}; /* Dimension sizes */
- hsize_t e_ext_dims[1] = {7}; /* Expanded dimension sizes */
- hsize_t s_ext_dims[1] = {3}; /* Shrunk dimension sizes */
- hsize_t max_dims0[1] = {8}; /* Maximum dimension sizes */
- hsize_t max_dims1[1] = {H5S_UNLIMITED}; /* Maximum dimesion sizes for extensible array index */
- hsize_t max_dims2[2] = {H5S_UNLIMITED, H5S_UNLIMITED}; /* Maximum dimension sizes for v2 B-tree index */
- hsize_t chunks[1] = {2}, chunks2[2] = {4, 5}; /* Chunk dimension sizes */
+ hid_t fapl = -1; /* File access property list */
+ hid_t dcpl = -1; /* Dataset creation property list */
+ hid_t fid1 = -1, fid2 = -1; /* File IDs */
+ hid_t did1 = -1, did2 = -1; /* Dataset IDs */
+ hid_t sid1 = -1, sid2 = -1; /* Dataspace IDs */
+ hid_t tid1 = -1, tid2 = -1; /* Datatype IDs */
+ hsize_t dims[1] = {5}, dims2[2] = {1, 4}; /* Dimension sizes */
+ hsize_t e_ext_dims[1] = {7}; /* Expanded dimension sizes */
+ hsize_t s_ext_dims[1] = {3}; /* Shrunk dimension sizes */
+ hsize_t max_dims0[1] = {8}; /* Maximum dimension sizes */
+ hsize_t max_dims1[1] = {H5S_UNLIMITED}; /* Maximum dimesion sizes for extensible array index */
+ hsize_t max_dims2[2] = {H5S_UNLIMITED, H5S_UNLIMITED}; /* Maximum dimension sizes for v2 B-tree index */
+ hsize_t chunks[1] = {2}, chunks2[2] = {4, 5}; /* Chunk dimension sizes */
hsize_t size; /* File size */
- const char* data[] = {"String 1", "String 2", "String 3", "String 4", "String 5"}; /* Input Data */
- const char* e_data[] = {"String 1", "String 2", "String 3", "String 4", "String 5", "String 6", "String 7"}; /* Input Data */
- char* buffer[5]; /* Output buffer */
- int wbuf[4] = {1, 2, 3, 4}; /* Input data */
- herr_t ret; /* Generic return value */
+ const char* data[] = {"String 1", "String 2", "String 3", "String 4", "String 5"}; /* Input Data */
+ const char* e_data[] = {"String 1", "String 2", "String 3", "String 4", "String 5", "String 6", "String 7"}; /* Input Data */
+ char* buffer[5]; /* Output buffer */
+ int wbuf[4] = {1, 2, 3, 4}; /* Input data */
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing double file and dataset open/close\n"));
@@ -2135,7 +2169,7 @@ test_file_double_file_dataset_open(hbool_t new_format)
/* Create a chunked dataset with fixed array indexing */
sid1 = H5Screate_simple(1, dims, max_dims0);
- CHECK(sid1, FAIL, "H5Screate");
+ CHECK(sid1, FAIL, "H5Screate_simple");
tid1 = H5Tcopy(H5T_C_S1);
CHECK(tid1, FAIL, "H5Tcopy");
ret = H5Tset_size(tid1, H5T_VARIABLE);
@@ -2161,7 +2195,7 @@ test_file_double_file_dataset_open(hbool_t new_format)
/* Create a chunked dataset with extensible array indexing */
sid1 = H5Screate_simple(1, dims, max_dims1);
- CHECK(sid1, FAIL, "H5Screate");
+ CHECK(sid1, FAIL, "H5Screate_simple");
tid1 = H5Tcopy(H5T_C_S1);
CHECK(tid1, FAIL, "H5Tcopy");
ret = H5Tset_size(tid1, H5T_VARIABLE);
@@ -2190,7 +2224,7 @@ test_file_double_file_dataset_open(hbool_t new_format)
/* Create a chunked dataset with v2 btree indexing */
sid2 = H5Screate_simple(2, dims2, max_dims2);
- CHECK(sid2, FAIL, "H5Screate");
+ CHECK(sid2, FAIL, "H5Screate_simple");
dcpl = H5Pcreate(H5P_DATASET_CREATE);
CHECK(dcpl, FAIL, "H5Pcreate");
@@ -2217,8 +2251,8 @@ test_file_double_file_dataset_open(hbool_t new_format)
ret = H5Fclose(fid1);
CHECK(ret, FAIL, "H5Fclose");
- /*
- * Scenario 1
+ /*
+ * Scenario 1
*/
/* First file open */
@@ -2273,8 +2307,8 @@ test_file_double_file_dataset_open(hbool_t new_format)
ret = H5Tclose(tid2);
CHECK(ret, FAIL, "H5Tclose");
- /*
- * Scenario 2
+ /*
+ * Scenario 2
*/
/* First file open */
@@ -2338,7 +2372,7 @@ test_file_double_file_dataset_open(hbool_t new_format)
ret = H5Tclose(tid2);
CHECK(ret, FAIL, "H5Tclose");
- /*
+ /*
* Scenario 3
*/
@@ -2382,10 +2416,10 @@ test_file_double_file_dataset_open(hbool_t new_format)
ret = H5Fclose(fid2);
CHECK(ret, FAIL, "H5Fclose");
- /*
+ /*
* Scenario 4
* --trigger H5AC_protect: Assertion `f->shared' failed
- * from second call to H5Dset_extent->...H5D__earray_idx_remove->H5EA_get...H5EA__iblock_protect...H5AC_protect
+ * from second call to H5Dset_extent->...H5D__earray_idx_remove->H5EA_get...H5EA__iblock_protect...H5AC_protect
*/
/* First file open */
fid1 = H5Fopen(FILE1, H5F_ACC_RDWR, H5P_DEFAULT);
@@ -2694,9 +2728,9 @@ cal_chksum(const char *file, uint32_t *chksum)
** This test checks to ensure that opening and closing a file
** with read/write permissions does not write anything to the
** file if the file does not change.
-** Due to the implementation of file locking (status_flags in
-** the superblock is used), this test is changed to use checksum
-** instead of timestamp to verify the file is not changed.
+** Due to the implementation of file locking (status_flags in
+** the superblock is used), this test is changed to use checksum
+** instead of timestamp to verify the file is not changed.
**
** Programmer: Vailin Choi; July 2013
**
@@ -2705,8 +2739,8 @@ static void
test_rw_noupdate(void)
{
herr_t ret; /* Generic return value */
- hid_t fid; /* File ID */
- uint32_t chksum1, chksum2; /* Checksum value */
+ hid_t fid; /* File ID */
+ uint32_t chksum1, chksum2; /* Checksum value */
/* Output message about test being performed */
MESSAGE(5, ("Testing to verify that nothing is written if nothing is changed.\n"));
@@ -3095,8 +3129,8 @@ test_userblock_alignment(void)
** test_userblock_alignment_paged(): low-level file test routine.
** This test checks to ensure that files with both a userblock and
** alignment interact properly:
-** -- alignment via H5Pset_alignment
-** -- alignment via paged aggregation
+** -- alignment via H5Pset_alignment
+** -- alignment via paged aggregation
**
** Programmer: Vailin Choi; March 2013
**
@@ -3112,14 +3146,14 @@ test_userblock_alignment_paged(void)
/* Output message about test being performed */
MESSAGE(5, ("Testing interaction between userblock and alignment (via paged aggregation and H5Pset_alignment)\n"));
- /*
+ /*
* Case 1:
* Userblock size = 0
* Alignment in use = 4096
* Strategy = H5F_FILE_SPACE_PAGE; fsp_size = alignment = 4096
* Outcome:
- * Should succeed:
- * userblock is 0 and alignment != 0
+ * Should succeed:
+ * userblock is 0 and alignment != 0
*/
/* Create file creation property list with user block */
fcpl = H5Pcreate(H5P_FILE_CREATE);
@@ -3150,14 +3184,14 @@ test_userblock_alignment_paged(void)
ret = H5Pclose(fapl);
CHECK(ret, FAIL, "H5Pclose");
- /*
+ /*
* Case 2a:
* Userblock size = 1024
* Alignment in use = 512
- * Strategy = H5F_FILE_SPACE_PAGE; fsp_size = alignment = 512
+ * Strategy = H5F_FILE_SPACE_PAGE; fsp_size = alignment = 512
* H5Pset_alignment() is 3
* Outcome:
- * Should succeed:
+ * Should succeed:
* userblock (1024) is integral mult. of alignment (512)
*/
/* Create file creation property list with user block */
@@ -3186,16 +3220,16 @@ test_userblock_alignment_paged(void)
ret = H5Pclose(fapl);
CHECK(ret, FAIL, "H5Pclose");
- /*
+ /*
* Case 2b:
* Userblock size = 1024
* Alignment in use = 3
- * Strategy = H5F_FILE_SPACE_AGGR; fsp_size = 512
- * (via default file creation property)
+ * Strategy = H5F_FILE_SPACE_AGGR; fsp_size = 512
+ * (via default file creation property)
* H5Pset_alignment() is 3
* Outcome:
- * Should fail at file creation:
- * userblock (1024) is non-integral mult. of alignment (3)
+ * Should fail at file creation:
+ * userblock (1024) is non-integral mult. of alignment (3)
*/
/* Create file creation property list with user block */
fcpl = H5Pcreate(H5P_FILE_CREATE);
@@ -3222,15 +3256,15 @@ test_userblock_alignment_paged(void)
ret = H5Pclose(fapl);
CHECK(ret, FAIL, "H5Pclose");
- /*
+ /*
* Case 3a:
* Userblock size = 512
* Alignment in use = 512
- * Strategy is H5F_FILE_SPACE_PAGE; fsp_size = alignment = 512
+ * Strategy is H5F_FILE_SPACE_PAGE; fsp_size = alignment = 512
* H5Pset_alignment() is 3
* Outcome:
- * Should succeed:
- * userblock (512) is equal to alignment (512)
+ * Should succeed:
+ * userblock (512) is equal to alignment (512)
*/
/* Create file creation property list with user block */
fcpl = H5Pcreate(H5P_FILE_CREATE);
@@ -3260,15 +3294,15 @@ test_userblock_alignment_paged(void)
ret = H5Pclose(fapl);
CHECK(ret, FAIL, "H5Pclose");
- /*
+ /*
* Case 3b:
* Userblock size = 512
* Alignment in use = 3
- * Strategy is H5F_FILE_SPACE_NONE; fsp_size = 512
+ * Strategy is H5F_FILE_SPACE_NONE; fsp_size = 512
* H5Pset_alignment() is 3
* Outcome:
- * Should fail at file creation:
- * userblock (512) is non-integral mult. of alignment (3)
+ * Should fail at file creation:
+ * userblock (512) is non-integral mult. of alignment (3)
*/
/* Create file creation property list with user block */
fcpl = H5Pcreate(H5P_FILE_CREATE);
@@ -3298,15 +3332,15 @@ test_userblock_alignment_paged(void)
ret = H5Pclose(fapl);
CHECK(ret, FAIL, "H5Pclose");
- /*
+ /*
* Case 4a:
* Userblock size = 1024
* Alignment in use = 1023
* Strategy is H5F_FILE_SPACE_PAGE; fsp_size = alignment = 1023
* H5Pset_alignment() is 16
* Outcome:
- * Should fail at file creation:
- * userblock (1024) is non-integral multiple of alignment (1023)
+ * Should fail at file creation:
+ * userblock (1024) is non-integral multiple of alignment (1023)
*/
/* Create file creation property list with user block */
fcpl = H5Pcreate(H5P_FILE_CREATE);
@@ -3336,15 +3370,15 @@ test_userblock_alignment_paged(void)
ret = H5Pclose(fapl);
CHECK(ret, FAIL, "H5Pclose");
- /*
+ /*
* Case 4b:
* Userblock size = 1024
* Alignment in use = 16
* Strategy is H5F_FILE_SPACE_FSM_AGGR; fsp_size = 1023
* H5Pset_alignment() is 16
* Outcome:
- * Should succeed:
- * userblock (512) is integral multiple of alignment (16)
+ * Should succeed:
+ * userblock (512) is integral multiple of alignment (16)
*/
/* Create file creation property list with user block */
fcpl = H5Pcreate(H5P_FILE_CREATE);
@@ -3374,15 +3408,15 @@ test_userblock_alignment_paged(void)
ret = H5Pclose(fapl);
CHECK(ret, FAIL, "H5Pclose");
- /*
+ /*
* Case 5a:
* Userblock size = 512
* Alignment in use = 1024
* Strategy is H5F_FILE_SPACE_PAGE; fsp_size = alignment = 1024
* H5Pset_alignment() is 16
* Outcome:
- * Should fail at file creation:
- * userblock (512) is less than alignment (1024)
+ * Should fail at file creation:
+ * userblock (512) is less than alignment (1024)
*/
/* Create file creation property list with user block */
fcpl = H5Pcreate(H5P_FILE_CREATE);
@@ -3412,7 +3446,7 @@ test_userblock_alignment_paged(void)
ret = H5Pclose(fapl);
CHECK(ret, FAIL, "H5Pclose");
- /*
+ /*
* Case 5b:
* Userblock size = 512
* Alignment in use = 16
@@ -3420,7 +3454,7 @@ test_userblock_alignment_paged(void)
* H5Pset_alignment() is 16
* Outcome:
* Should succed:
- * userblock (512) is integral multiple of alignment (16)
+ * userblock (512) is integral multiple of alignment (16)
*/
/* Create file creation property list with user block */
fcpl = H5Pcreate(H5P_FILE_CREATE);
@@ -3450,16 +3484,16 @@ test_userblock_alignment_paged(void)
ret = H5Pclose(fapl);
CHECK(ret, FAIL, "H5Pclose");
- /*
+ /*
* Case 6:
* Userblock size = 512
* Alignment in use = 512
* Strategy is H5F_FILE_SPACE_PAGE; fsp_size = alignment = 512
* H5Pset_alignment() is 3
- * Reopen the file; H5Pset_alignment() is 1024
+ * Reopen the file; H5Pset_alignment() is 1024
* Outcome:
* Should succed:
- * Userblock (512) is the same as alignment (512);
+ * Userblock (512) is the same as alignment (512);
* The H5Pset_alignment() calls have no effect
*/
/* Create file creation property list with user block */
@@ -3503,19 +3537,19 @@ test_userblock_alignment_paged(void)
/****************************************************************
**
** test_filespace_info():
-** Verify the following public routines retrieve and set file space
-** information correctly:
-** (1) H5Pget/set_file_space_strategy():
-** Retrieve and set file space strategy, persisting free-space,
-** and free-space section threshold as specified
-** (2) H5Pget/set_file_space_page_size():
-** Retrieve and set the page size for paged aggregation
+** Verify the following public routines retrieve and set file space
+** information correctly:
+** (1) H5Pget/set_file_space_strategy():
+** Retrieve and set file space strategy, persisting free-space,
+** and free-space section threshold as specified
+** (2) H5Pget/set_file_space_page_size():
+** Retrieve and set the page size for paged aggregation
**
****************************************************************/
static void
test_filespace_info(const char *env_h5_drvr)
{
- hid_t fid; /* File IDs */
+ hid_t fid; /* File IDs */
hid_t fapl, new_fapl; /* File access property lists */
hid_t fcpl, fcpl1, fcpl2; /* File creation property lists */
H5F_fspace_strategy_t strategy; /* File space strategy */
@@ -3528,7 +3562,7 @@ test_filespace_info(const char *env_h5_drvr)
hsize_t fsp_size; /* File space page size */
char filename[FILENAME_LEN]; /* Filename to use */
hbool_t contig_addr_vfd; /* Whether VFD used has a contigous address space */
- herr_t ret; /* Return value */
+ herr_t ret; /* Return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing file creation public routines: H5Pget/set_file_space_strategy & H5Pget/set_file_space_page_size\n"));
@@ -3546,14 +3580,14 @@ test_filespace_info(const char *env_h5_drvr)
ret = H5Pset_libver_bounds(new_fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST);
CHECK(ret, FAIL, "H5Pset_libver_bounds");
- /*
+ /*
* Case (1)
* Check file space information from a default file creation property list.
* Values expected:
- * strategy--H5F_FILE_SPACE_AGGR
- * persist--FALSE
- * threshold--1
- * file space page size--4096
+ * strategy--H5F_FILE_SPACE_AGGR
+ * persist--FALSE
+ * threshold--1
+ * file space page size--4096
*/
/* Create file creation property list template */
fcpl = H5Pcreate(H5P_FILE_CREATE);
@@ -3576,7 +3610,7 @@ test_filespace_info(const char *env_h5_drvr)
/* Close property list */
H5Pclose(fcpl);
- /*
+ /*
* Case (2)
* File space page size has a minimum size of 512.
* Setting value less than 512 will return an error;
@@ -3625,14 +3659,14 @@ test_filespace_info(const char *env_h5_drvr)
/* Close property list */
H5Pclose(fcpl);
- /*
+ /*
* Case (3)
* Check file space information when creating a file with default properties.
* Values expected:
- * strategy--H5F_FILE_SPACE_AGGR
- * persist--FALSE
- * threshold--1
- * file space page size--4096
+ * strategy--H5F_FILE_SPACE_AGGR
+ * persist--FALSE
+ * threshold--1
+ * file space page size--4096
*/
/* Create a file with default file creation and access property lists */
fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
@@ -3662,15 +3696,15 @@ test_filespace_info(const char *env_h5_drvr)
ret = H5Pclose(fcpl1);
CHECK(ret, FAIL, "H5Pclose");
- /*
+ /*
* Case (4)
* Check file space information when creating a file with the
* latest library format and default properties.
* Values expected:
- * strategy--H5F_FILE_SPACE_AGGR
- * persist--FALSE
- * threshold--1
- * file space page size--4096
+ * strategy--H5F_FILE_SPACE_AGGR
+ * persist--FALSE
+ * threshold--1
+ * file space page size--4096
*/
/* Create a file with the latest library format */
fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, new_fapl);
@@ -3700,21 +3734,21 @@ test_filespace_info(const char *env_h5_drvr)
ret = H5Pclose(fcpl1);
CHECK(ret, FAIL, "H5Pclose");
- /*
+ /*
* Case (5)
* Check file space information with the following combinations:
- * Create file with --
- * New or old format
- * Persist or not persist free-space
- * Different sizes for free-space section threshold (0 to 10)
- * The four file space strategies:
- * H5F_FSPACE_STRATEGY_FSM_AGGR, H5F_FSPACE_STRATEGY_PAGE,
+ * Create file with --
+ * New or old format
+ * Persist or not persist free-space
+ * Different sizes for free-space section threshold (0 to 10)
+ * The four file space strategies:
+ * H5F_FSPACE_STRATEGY_FSM_AGGR, H5F_FSPACE_STRATEGY_PAGE,
* H5F_FSPACE_STRATEGY_AGGR, H5F_FSPACE_STRATEGY_NONE
- * File space page size: set to 512
- *
+ * File space page size: set to 512
+ *
*/
for(new_format = FALSE; new_format <= TRUE; new_format++) {
- hid_t my_fapl;
+ hid_t my_fapl;
/* Set the FAPL for the type of format */
if(new_format) {
@@ -3748,7 +3782,7 @@ test_filespace_info(const char *env_h5_drvr)
ret = H5Pset_file_space_page_size(fcpl, FSP_SIZE512);
CHECK(ret, FAIL, "H5Pset_file_space_strategy");
-
+
/* Retrieve file space information */
ret = H5Pget_file_space_strategy(fcpl, &strategy, &persist, &threshold);
CHECK(ret, FAIL, "H5Pget_file_space_strategy");
@@ -3907,13 +3941,13 @@ error:
** returned by the public routine H5Fget_freespace().
**
** Modifications:
-** Vailin Choi; July 2012
-** Remove datasets in reverse order so that all file spaces are shrunk.
-** (A change due to H5FD_FLMAP_DICHOTOMY.)
+** Vailin Choi; July 2012
+** Remove datasets in reverse order so that all file spaces are shrunk.
+** (A change due to H5FD_FLMAP_DICHOTOMY.)
**
-** Vailin Choi; Dec 2012
-** Add changes due to paged aggregation via new format:
-** the amount of freespace is different.
+** Vailin Choi; Dec 2012
+** Add changes due to paged aggregation via new format:
+** the amount of freespace is different.
**
*****************************************************************/
static void
@@ -4053,9 +4087,9 @@ test_file_freespace(const char *env_h5_drvr)
/* Check that there is the right amount of free space in the file */
free_space = H5Fget_freespace(file);
CHECK(free_space, FAIL, "H5Fget_freespace");
- if(new_format)
+ if(new_format)
VERIFY(free_space, expected_fs_del, "H5Fget_freespace");
- else
+ else
VERIFY(free_space, expected_fs_del, "H5Fget_freespace");
/* Close file */
@@ -4079,7 +4113,7 @@ test_file_freespace(const char *env_h5_drvr)
**
** test_sects_freespace():
** This routine checks free-space section information for the
-** file as returned by the public routine H5Fget_free_sections().
+** file as returned by the public routine H5Fget_free_sections().
**
*****************************************************************/
static void
@@ -4101,9 +4135,9 @@ test_sects_freespace(const char *env_h5_drvr, hbool_t new_format)
H5F_sect_info_t all_sect_info[15]; /* Array to hold free-space information for all types of data */
H5F_sect_info_t meta_sect_info[15]; /* Array to hold free-space information for metadata */
H5F_sect_info_t raw_sect_info[15]; /* Array to hold free-space information for raw data */
- hsize_t total = 0; /* sum of the free-space section sizes */
+ hsize_t total = 0; /* sum of the free-space section sizes */
hsize_t tmp_tot = 0; /* Sum of the free-space section sizes */
- hsize_t last_size; /* Size of last free-space section */
+ hsize_t last_size; /* Size of last free-space section */
hsize_t dims[1]; /* Dimension sizes */
unsigned u; /* Local index variable */
H5FD_mem_t type;
@@ -4142,7 +4176,7 @@ test_sects_freespace(const char *env_h5_drvr, hbool_t new_format)
} else {
ret = H5Pset_file_space_strategy(fcpl, H5F_FSPACE_STRATEGY_FSM_AGGR, TRUE, (hsize_t)1);
CHECK(ret, FAIL, "H5Pget_file_space_strategy");
- }
+ }
/* Create the file */
file = H5Fcreate(filename, H5F_ACC_TRUNC, fcpl, fapl);
@@ -4266,7 +4300,7 @@ test_sects_freespace(const char *env_h5_drvr, hbool_t new_format)
HDmemset(meta_sect_info, 0, sizeof(meta_sect_info));
if(multi_vfd) {
- hssize_t ntmp;
+ hssize_t ntmp;
for(type = H5FD_MEM_SUPER; type < H5FD_MEM_NTYPES; H5_INC_ENUM(H5FD_mem_t, type)) {
if(type == H5FD_MEM_DRAW || type == H5FD_MEM_GHEAP)
@@ -4318,7 +4352,7 @@ test_sects_freespace(const char *env_h5_drvr, hbool_t new_format)
CHECK(fcpl, FAIL, "H5Pclose");
h5_clean_files(FILESPACE_NAME, fapl);
- }
+ }
} /* end test_sects_freespace() */
@@ -4326,29 +4360,29 @@ test_sects_freespace(const char *env_h5_drvr, hbool_t new_format)
/****************************************************************
**
** test_filespace_compatible():
-** Verify that the trunk with the latest file space management
-** can open, read and modify 1.6 HDF5 file and 1.8 HDF5 file.
-** Also verify the correct file space handling information
-** and the amount of free space.
+** Verify that the trunk with the latest file space management
+** can open, read and modify 1.6 HDF5 file and 1.8 HDF5 file.
+** Also verify the correct file space handling information
+** and the amount of free space.
**
****************************************************************/
static void
test_filespace_compatible(void)
{
int fd_old = (-1), fd_new = (-1); /* File descriptors for copying data */
- hid_t fid = -1; /* File id */
- hid_t did = -1; /* Dataset id */
- hid_t fcpl; /* File creation property list template */
- int check[100]; /* Temporary buffer for verifying dataset data */
- int rdbuf[100]; /* Temporary buffer for reading in dataset data */
- uint8_t buf[READ_OLD_BUFSIZE]; /* temporary buffer for reading */
- ssize_t nread; /* Number of bytes read in */
- unsigned i, j; /* Local index variable */
- hssize_t free_space; /* Amount of free-space in the file */
- hbool_t persist; /* Persist free-space or not */
- hsize_t threshold; /* Free-space section threshold */
- H5F_fspace_strategy_t strategy; /* File space handling strategy */
- herr_t ret; /* Return value */
+ hid_t fid = -1; /* File id */
+ hid_t did = -1; /* Dataset id */
+ hid_t fcpl; /* File creation property list template */
+ int check[100]; /* Temporary buffer for verifying dataset data */
+ int rdbuf[100]; /* Temporary buffer for reading in dataset data */
+ uint8_t buf[READ_OLD_BUFSIZE]; /* temporary buffer for reading */
+ ssize_t nread; /* Number of bytes read in */
+ unsigned i, j; /* Local index variable */
+ hssize_t free_space; /* Amount of free-space in the file */
+ hbool_t persist; /* Persist free-space or not */
+ hsize_t threshold; /* Free-space section threshold */
+ H5F_fspace_strategy_t strategy; /* File space handling strategy */
+ herr_t ret; /* Return value */
/* Output message about test being performed */
MESSAGE(5, ("File space compatibility testing for 1.6 and 1.8 files\n"));
@@ -4357,31 +4391,31 @@ test_filespace_compatible(void)
const char *filename = H5_get_srcdir_filename(OLD_FILENAME[j]); /* Corrected test file name */
/* Open and copy the test file into a temporary file */
- fd_old = HDopen(filename, O_RDONLY);
- CHECK(fd_old, FAIL, "HDopen");
- fd_new = HDopen(FILE5, O_RDWR|O_CREAT|O_TRUNC, H5_POSIX_CREATE_MODE_RW);
- CHECK(fd_new, FAIL, "HDopen");
+ fd_old = HDopen(filename, O_RDONLY);
+ CHECK(fd_old, FAIL, "HDopen");
+ fd_new = HDopen(FILE5, O_RDWR|O_CREAT|O_TRUNC, H5_POSIX_CREATE_MODE_RW);
+ CHECK(fd_new, FAIL, "HDopen");
- /* Copy data */
+ /* Copy data */
while((nread = HDread(fd_old, buf, (size_t)READ_OLD_BUFSIZE)) > 0) {
ssize_t write_err = HDwrite(fd_new, buf, (size_t)nread);
CHECK(write_err, -1, "HDwrite");
} /* end while */
- /* Close the files */
- ret = HDclose(fd_old);
- CHECK(ret, FAIL, "HDclose");
- ret = HDclose(fd_new);
- CHECK(ret, FAIL, "HDclose");
+ /* Close the files */
+ ret = HDclose(fd_old);
+ CHECK(ret, FAIL, "HDclose");
+ ret = HDclose(fd_new);
+ CHECK(ret, FAIL, "HDclose");
/* Open the temporary test file */
- fid = H5Fopen(FILE5, H5F_ACC_RDWR, H5P_DEFAULT);
- CHECK(fid, FAIL, "H5Fopen");
+ fid = H5Fopen(FILE5, H5F_ACC_RDWR, H5P_DEFAULT);
+ CHECK(fid, FAIL, "H5Fopen");
- /* There should not be any free space in the file */
- free_space = H5Fget_freespace(fid);
- CHECK(free_space, FAIL, "H5Fget_freespace");
- VERIFY(free_space, (hssize_t)0, "H5Fget_freespace");
+ /* There should not be any free space in the file */
+ free_space = H5Fget_freespace(fid);
+ CHECK(free_space, FAIL, "H5Fget_freespace");
+ VERIFY(free_space, (hssize_t)0, "H5Fget_freespace");
/* Get the file's file creation property list */
fcpl = H5Fget_create_plist(fid);
@@ -4398,27 +4432,27 @@ test_filespace_compatible(void)
VERIFY(persist, FALSE, "H5Pget_file_space_strategy");
VERIFY(threshold, 1, "H5Pget_file_space_strategy");
- /* Generate raw data */
- for(i = 0; i < 100; i++)
- check[i] = (int)i;
+ /* Generate raw data */
+ for(i = 0; i < 100; i++)
+ check[i] = (int)i;
- /* Open and read the dataset */
- did = H5Dopen2(fid, DSETNAME, H5P_DEFAULT);
- CHECK(did, FAIL, "H5Dopen");
- ret = H5Dread(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, &rdbuf);
- CHECK(ret, FAIL, "H5Dread");
+ /* Open and read the dataset */
+ did = H5Dopen2(fid, DSETNAME, H5P_DEFAULT);
+ CHECK(did, FAIL, "H5Dopen");
+ ret = H5Dread(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, &rdbuf);
+ CHECK(ret, FAIL, "H5Dread");
- /* Verify the data read is correct */
- for(i = 0; i < 100; i++)
- VERIFY(rdbuf[i], check[i], "test_compatible");
+ /* Verify the data read is correct */
+ for(i = 0; i < 100; i++)
+ VERIFY(rdbuf[i], check[i], "test_compatible");
- /* Close the dataset */
- ret = H5Dclose(did);
- CHECK(ret, FAIL, "H5Dclose");
+ /* Close the dataset */
+ ret = H5Dclose(did);
+ CHECK(ret, FAIL, "H5Dclose");
- /* Remove the dataset */
- ret = H5Ldelete(fid, DSETNAME, H5P_DEFAULT);
- CHECK(ret, FAIL, "H5Ldelete");
+ /* Remove the dataset */
+ ret = H5Ldelete(fid, DSETNAME, H5P_DEFAULT);
+ CHECK(ret, FAIL, "H5Ldelete");
/* Close the plist */
ret = H5Pclose(fcpl);
@@ -4428,30 +4462,30 @@ test_filespace_compatible(void)
ret = H5Fclose(fid);
CHECK(ret, FAIL, "H5Fclose");
- /* Re-Open the file */
- fid = H5Fopen(FILE5, H5F_ACC_RDONLY, H5P_DEFAULT);
- CHECK(fid, FAIL, "H5Fopen");
+ /* Re-Open the file */
+ fid = H5Fopen(FILE5, H5F_ACC_RDONLY, H5P_DEFAULT);
+ CHECK(fid, FAIL, "H5Fopen");
- /* The dataset should not be there */
- did = H5Dopen2(fid, DSETNAME, H5P_DEFAULT);
- VERIFY(did, FAIL, "H5Dopen");
+ /* The dataset should not be there */
+ did = H5Dopen2(fid, DSETNAME, H5P_DEFAULT);
+ VERIFY(did, FAIL, "H5Dopen");
- /* There should not be any free space in the file */
- free_space = H5Fget_freespace(fid);
- CHECK(free_space, FAIL, "H5Fget_freespace");
- VERIFY(free_space, (hssize_t)0, "H5Fget_freespace");
+ /* There should not be any free space in the file */
+ free_space = H5Fget_freespace(fid);
+ CHECK(free_space, FAIL, "H5Fget_freespace");
+ VERIFY(free_space, (hssize_t)0, "H5Fget_freespace");
- /* Close the file */
- ret = H5Fclose(fid);
- CHECK(ret, FAIL, "H5Fclose");
+ /* Close the file */
+ ret = H5Fclose(fid);
+ CHECK(ret, FAIL, "H5Fclose");
} /* end for */
} /* test_filespace_compatible */
/****************************************************************
**
** test_filespace_1.10.0_compatible():
-** Verify that the latest file space management can open, read and
-** modify 1.10.0 HDF5 files :
+** Verify that the latest file space management can open, read and
+** modify 1.10.0 HDF5 files :
** h5fc_ext1_i.h5: H5F_FILE_SPACE_ALL, default threshold; has superblock extension but no fsinfo message
** h5fc_ext1_f.h5: H5F_FILE_SPACE_ALL_PERSIST, default threshold; has superblock extension with fsinfo message
** h5fc_ext2_if.h5: H5F_FILE_SPACE_ALL, non-default threshold; has superblock extension with fsinfo message
@@ -4465,16 +4499,16 @@ static void
test_filespace_1_10_0_compatible(void)
{
hid_t fid = -1; /* File id */
- hid_t did = -1; /* Dataset id */
+ hid_t did = -1; /* Dataset id */
hid_t fcpl; /* File creation property list */
- hbool_t persist; /* Persist free-space or not */
- hsize_t threshold; /* Free-space section threshold */
+ hbool_t persist; /* Persist free-space or not */
+ hsize_t threshold; /* Free-space section threshold */
H5F_fspace_strategy_t strategy; /* File space handling strategy */
- int wbuf[24]; /* Buffer for dataset data */
- int rdbuf[24]; /* Buffer for dataset data */
+ int wbuf[24]; /* Buffer for dataset data */
+ int rdbuf[24]; /* Buffer for dataset data */
int status; /* Status from copying the existing file */
unsigned i, j; /* Local index variable */
- herr_t ret; /* Return value */
+ herr_t ret; /* Return value */
/* Output message about test being performed */
MESSAGE(5, ("File space compatibility testing for 1.10.0 files\n"));
@@ -4482,7 +4516,7 @@ test_filespace_1_10_0_compatible(void)
for(j = 0; j < NELMTS(OLD_1_10_0_FILENAME); j++) {
/* Make a copy of the test file */
status = h5_make_local_copy(OLD_1_10_0_FILENAME[j], FILE5);
- CHECK(status, FAIL, "h5_make_local_copy");
+ CHECK(status, FAIL, "h5_make_local_copy");
/* Open the temporary test file */
fid = H5Fopen(FILE5, H5F_ACC_RDWR, H5P_DEFAULT);
@@ -4516,7 +4550,7 @@ test_filespace_1_10_0_compatible(void)
/* Close the dataset */
ret = H5Dclose(did);
CHECK(ret, FAIL, "H5Dclose");
- break;
+ break;
case 1:
VERIFY(strategy, H5F_FSPACE_STRATEGY_FSM_AGGR, "H5Pget_file_space_strategy");
@@ -4537,7 +4571,7 @@ test_filespace_1_10_0_compatible(void)
/* Close the dataset */
ret = H5Dclose(did);
CHECK(ret, FAIL, "H5Dclose");
- break;
+ break;
case 2:
VERIFY(strategy, H5F_FSPACE_STRATEGY_FSM_AGGR, "H5Pget_file_space_strategy");
@@ -4558,7 +4592,7 @@ test_filespace_1_10_0_compatible(void)
/* Close the dataset */
ret = H5Dclose(did);
CHECK(ret, FAIL, "H5Dclose");
- break;
+ break;
case 3:
VERIFY(strategy, H5F_FSPACE_STRATEGY_NONE, "H5Pget_file_space_strategy");
@@ -4579,7 +4613,7 @@ test_filespace_1_10_0_compatible(void)
/* Close the dataset */
ret = H5Dclose(did);
CHECK(ret, FAIL, "H5Dclose");
- break;
+ break;
case 4:
VERIFY(strategy, H5F_FSPACE_STRATEGY_AGGR, "H5Pget_file_space_strategy");
@@ -4600,7 +4634,7 @@ test_filespace_1_10_0_compatible(void)
/* Close the dataset */
ret = H5Dclose(did);
CHECK(ret, FAIL, "H5Dclose");
- break;
+ break;
case 5:
VERIFY(strategy, H5F_FSPACE_STRATEGY_FSM_AGGR, "H5Pget_file_space_strategy");
VERIFY(persist, H5F_FREE_SPACE_PERSIST_DEF, "H5Pget_file_space_strategy");
@@ -4620,10 +4654,10 @@ test_filespace_1_10_0_compatible(void)
/* Close the dataset */
ret = H5Dclose(did);
CHECK(ret, FAIL, "H5Dclose");
- break;
+ break;
default:
- break;
+ break;
}
/* Close the plist */
@@ -4654,7 +4688,7 @@ test_filespace_1_10_0_compatible(void)
/* Close the dataset */
ret = H5Dclose(did);
CHECK(ret, FAIL, "H5Dclose");
- break;
+ break;
case 1:
/* Open and read the dataset */
@@ -4671,7 +4705,7 @@ test_filespace_1_10_0_compatible(void)
/* Close the dataset */
ret = H5Dclose(did);
CHECK(ret, FAIL, "H5Dclose");
- break;
+ break;
case 2:
/* Open and read the dataset */
@@ -4688,7 +4722,7 @@ test_filespace_1_10_0_compatible(void)
/* Close the dataset */
ret = H5Dclose(did);
CHECK(ret, FAIL, "H5Dclose");
- break;
+ break;
case 3:
/* Open and read the dataset */
@@ -4705,7 +4739,7 @@ test_filespace_1_10_0_compatible(void)
/* Close the dataset */
ret = H5Dclose(did);
CHECK(ret, FAIL, "H5Dclose");
- break;
+ break;
case 4:
@@ -4723,7 +4757,7 @@ test_filespace_1_10_0_compatible(void)
/* Close the dataset */
ret = H5Dclose(did);
CHECK(ret, FAIL, "H5Dclose");
- break;
+ break;
case 5:
@@ -4741,10 +4775,10 @@ test_filespace_1_10_0_compatible(void)
/* Close the dataset */
ret = H5Dclose(did);
CHECK(ret, FAIL, "H5Dclose");
- break;
+ break;
default:
- break;
+ break;
}
/* Close the file */
@@ -4757,36 +4791,36 @@ test_filespace_1_10_0_compatible(void)
/****************************************************************
**
** test_filespace_round_compatible():
-** Verify that the trunk can open, read and modify these files--
-** 1) They are initially created (via gen_filespace.c) in the trunk
-** with combinations of file space strategies, default/non-default
-** threshold, and file spacing paging enabled/disbled.
-** The library creates the file space info message with
-** "mark if unknown" in these files.
-** 2) They are copied to the 1.8 branch, and are opened/read/modified
-** there via test_filespace_compatible() in test/tfile.c.
-** The 1.8 library marks the file space info message as "unknown"
-** in these files.
-** 3) They are then copied back from the 1.8 branch to the trunk for
-** compatibility testing via this routine.
-** 4) Upon encountering the file space info message which is marked
-** as "unknown", the library will use the default file space management
-** from then on: non-persistent free-space managers, default threshold,
-** and non-paging file space.
+** Verify that the trunk can open, read and modify these files--
+** 1) They are initially created (via gen_filespace.c) in the trunk
+** with combinations of file space strategies, default/non-default
+** threshold, and file spacing paging enabled/disbled.
+** The library creates the file space info message with
+** "mark if unknown" in these files.
+** 2) They are copied to the 1.8 branch, and are opened/read/modified
+** there via test_filespace_compatible() in test/tfile.c.
+** The 1.8 library marks the file space info message as "unknown"
+** in these files.
+** 3) They are then copied back from the 1.8 branch to the trunk for
+** compatibility testing via this routine.
+** 4) Upon encountering the file space info message which is marked
+** as "unknown", the library will use the default file space management
+** from then on: non-persistent free-space managers, default threshold,
+** and non-paging file space.
**
****************************************************************/
static void
test_filespace_round_compatible(void)
{
- hid_t fid = -1; /* File id */
- hid_t fcpl = -1; /* File creation property list ID */
- unsigned j; /* Local index variable */
- H5F_fspace_strategy_t strategy; /* File space strategy */
- hbool_t persist; /* Persist free-space or not */
- hsize_t threshold; /* Free-space section threshold */
- hssize_t free_space; /* Amount of free space in the file */
+ hid_t fid = -1; /* File id */
+ hid_t fcpl = -1; /* File creation property list ID */
+ unsigned j; /* Local index variable */
+ H5F_fspace_strategy_t strategy; /* File space strategy */
+ hbool_t persist; /* Persist free-space or not */
+ hsize_t threshold; /* Free-space section threshold */
+ hssize_t free_space; /* Amount of free space in the file */
int status; /* Status from copying the existing file */
- herr_t ret; /* Return value */
+ herr_t ret; /* Return value */
/* Output message about test being performed */
MESSAGE(5, ("File space compatibility testing for files from trunk to 1_8 to trunk\n"));
@@ -4794,31 +4828,31 @@ test_filespace_round_compatible(void)
for(j = 0; j < NELMTS(FSPACE_FILENAMES); j++) {
/* Make a copy of the test file */
status = h5_make_local_copy(FSPACE_FILENAMES[j], FILE5);
- CHECK(status, FAIL, "h5_make_local_copy");
-
- /* Open the temporary test file */
- fid = H5Fopen(FILE5, H5F_ACC_RDWR, H5P_DEFAULT);
- CHECK(fid, FAIL, "H5Fopen");
-
- /* Get the file's creation property list */
- fcpl = H5Fget_create_plist(fid);
- CHECK(fcpl, FAIL, "H5Fget_create_plist");
-
- ret = H5Pget_file_space_strategy(fcpl, &strategy, &persist, &threshold);
- CHECK(ret, FAIL, "H5Pget_file_space_strategy");
- VERIFY(strategy, H5F_FSPACE_STRATEGY_FSM_AGGR, "H5Pget_file_space_strategy");
- VERIFY(persist, FALSE, "H5Pget_file_space_strategy");
- VERIFY(threshold, 1, "H5Pget_file_space_strategy");
-
- /* There should not be any free space in the file */
- free_space = H5Fget_freespace(fid);
- CHECK(free_space, FAIL, "H5Fget_freespace");
- VERIFY(free_space, (hssize_t)0, "H5Fget_freespace");
-
- /* Closing */
- ret = H5Fclose(fid);
- ret = H5Pclose(fcpl);
- CHECK(ret, FAIL, "H5Fclose");
+ CHECK(status, FAIL, "h5_make_local_copy");
+
+ /* Open the temporary test file */
+ fid = H5Fopen(FILE5, H5F_ACC_RDWR, H5P_DEFAULT);
+ CHECK(fid, FAIL, "H5Fopen");
+
+ /* Get the file's creation property list */
+ fcpl = H5Fget_create_plist(fid);
+ CHECK(fcpl, FAIL, "H5Fget_create_plist");
+
+ ret = H5Pget_file_space_strategy(fcpl, &strategy, &persist, &threshold);
+ CHECK(ret, FAIL, "H5Pget_file_space_strategy");
+ VERIFY(strategy, H5F_FSPACE_STRATEGY_FSM_AGGR, "H5Pget_file_space_strategy");
+ VERIFY(persist, FALSE, "H5Pget_file_space_strategy");
+ VERIFY(threshold, 1, "H5Pget_file_space_strategy");
+
+ /* There should not be any free space in the file */
+ free_space = H5Fget_freespace(fid);
+ CHECK(free_space, FAIL, "H5Fget_freespace");
+ VERIFY(free_space, (hssize_t)0, "H5Fget_freespace");
+
+ /* Closing */
+ ret = H5Fclose(fid);
+ ret = H5Pclose(fcpl);
+ CHECK(ret, FAIL, "H5Fclose");
} /* end for */
} /* test_filespace_round_compatible */
@@ -4884,8 +4918,8 @@ test_libver_bounds_real(H5F_libver_t libver_create, unsigned oh_vers_create,
CHECK(group, FAIL, "H5Gcreate");
ret = H5Oget_info(group, &oinfo);
- CHECK(ret, FAIL, "H5Oget_info_by_name");
- VERIFY(oinfo.hdr.version, oh_vers_mod, "H5Oget_info_by_name");
+ CHECK(ret, FAIL, "H5Oget_info");
+ VERIFY(oinfo.hdr.version, oh_vers_mod, "H5Oget_info");
ret = H5Gclose(group);
CHECK(ret, FAIL, "H5Gclose");
@@ -4918,6 +4952,134 @@ test_libver_bounds_real(H5F_libver_t libver_create, unsigned oh_vers_create,
CHECK(ret, FAIL, "H5Pclose");
} /* end test_libver_bounds_real() */
+
+/*-------------------------------------------------------------------------
+ * Function: test_libver_bounds_open
+ *
+ * Purpose: Tests opening latest file with various low/high bounds.
+ *
+ * Return: Success: 0
+ * Failure: number of errors
+ *
+ *-------------------------------------------------------------------------
+ */
+#define VERBFNAME "tverbounds_dspace.h5"
+#define VERBDSNAME "dataset 1"
+#define SPACE1_DIM1 3
+static int
+test_libver_bounds_open(void)
+{
+ hid_t file = -1; /* File ID */
+ hid_t space = -1; /* Dataspace ID */
+ hid_t dset = -1; /* Dataset ID */
+ hid_t fapl = -1; /* File access property list ID */
+ hid_t new_fapl = -1;/* File access property list ID for reopened file */
+ hid_t dcpl = -1; /* Dataset creation property list ID */
+ hsize_t dim[1] = {SPACE1_DIM1}; /* Dataset dimensions */
+ H5F_libver_t low, high; /* File format bounds */
+ hsize_t chunk_dim[1] = {SPACE1_DIM1}; /* Chunk dimensions */
+ herr_t ret; /* Generic return value */
+
+ /* Output message about test being performed */
+ MESSAGE(5, ("Testing Opening File in Various Version Bounds\n"));
+
+ /* Create a file access property list */
+ fapl = H5Pcreate(H5P_FILE_ACCESS);
+ CHECK(fapl, FAIL, "H5Pcreate");
+
+ /* Create dataspace */
+ space = H5Screate_simple(1, dim, NULL);
+ CHECK(space, FAIL, "H5Screate_simple");
+
+ /* Create a dataset creation property list */
+ dcpl = H5Pcreate(H5P_DATASET_CREATE);
+ CHECK(dcpl, FAIL, "H5Pcreate");
+
+ /* Create and set chunk plist */
+ ret = H5Pset_chunk(dcpl, 1, chunk_dim);
+ CHECK(ret, FAIL, "H5Pset_chunk");
+ ret = H5Pset_deflate(dcpl, 9);
+ CHECK(ret, FAIL, "H5Pset_deflate");
+ ret = H5Pset_chunk_opts(dcpl, H5D_CHUNK_DONT_FILTER_PARTIAL_CHUNKS);
+ CHECK(ret, FAIL, "H5Pset_chunk_opts");
+
+ /* Create a file with (LATEST, LATEST) bounds, create a layout version 4
+ dataset, then close the file */
+
+ /* Set version bounds to (LATEST, LATEST) */
+ low = H5F_LIBVER_LATEST;
+ high = H5F_LIBVER_LATEST;
+ ret = H5Pset_libver_bounds(fapl, low, high);
+ CHECK(ret, FAIL, "H5Pset_libver_bounds");
+
+ /* Create the file */
+ file = H5Fcreate(VERBFNAME, H5F_ACC_TRUNC, H5P_DEFAULT, fapl);
+ CHECK(file, FAIL, "H5Fcreate");
+
+ /* Create dataset */
+ dset = H5Dcreate2(file, VERBDSNAME, H5T_NATIVE_INT, space, H5P_DEFAULT, dcpl, H5P_DEFAULT);
+ CHECK(dset, FAIL, "H5Dcreate2");
+
+ /* Close dataset and file */
+ ret = H5Dclose(dset);
+ CHECK(ret, FAIL, "H5Dclose");
+ ret = H5Fclose(file);
+ CHECK(ret, FAIL, "H5Fclose");
+
+ /* Attempt to open latest file with (earliest, v18), should fail */
+ ret = H5Pset_libver_bounds(fapl, H5F_LIBVER_EARLIEST, H5F_LIBVER_V18);
+ H5E_BEGIN_TRY {
+ file = H5Fopen(VERBFNAME, H5F_ACC_RDONLY, fapl);
+ } H5E_END_TRY;
+ VERIFY(file, FAIL, "Attempted to open latest file with earliest version");
+
+ /* Attempt to open latest file with (v18, v18), should fail */
+ ret = H5Pset_libver_bounds(fapl, H5F_LIBVER_V18, H5F_LIBVER_V18);
+ H5E_BEGIN_TRY {
+ file = H5Fopen(VERBFNAME, H5F_ACC_RDONLY, fapl);
+ } H5E_END_TRY;
+ VERIFY(file, FAIL, "Attempted to open latest file with v18 bounds");
+
+ /* Opening VERBFNAME in these combination should succeed.
+ For each low bound, verify that it is upgraded properly */
+ high = H5F_LIBVER_LATEST;
+ for (low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; low++)
+ {
+ H5F_libver_t new_low = H5F_LIBVER_EARLIEST;
+
+ /* Set version bounds for opening file */
+ ret = H5Pset_libver_bounds(fapl, low, high);
+ CHECK(ret, FAIL, "H5Pset_libver_bounds");
+
+ /* Open the file */
+ file = H5Fopen(VERBFNAME, H5F_ACC_RDONLY, fapl);
+ CHECK(file, FAIL, "H5Fopen");
+
+ /* Get the new file access property */
+ new_fapl = H5Fget_access_plist(file);
+ CHECK(new_fapl, FAIL, "H5Fget_access_plist");
+
+ /* Get new low bound and verify that it has been upgraded properly */
+ ret = H5Pget_libver_bounds(new_fapl, &new_low, NULL);
+ CHECK(ret, FAIL, "H5Pget_libver_bounds");
+ VERIFY(new_low, H5F_LIBVER_LATEST, "Low bound should be upgraded to H5F_LIBVER_LATEST");
+
+ ret = H5Pclose(new_fapl);
+ CHECK(ret, FAIL, "H5Pclose");
+ ret = H5Fclose(file);
+ CHECK(ret, FAIL, "H5Fclose");
+ } /* for low */
+
+ /* Close dataspace and property lists */
+ ret = H5Sclose(space);
+ CHECK(ret, FAIL, "H5Sclose");
+ ret = H5Pclose(dcpl);
+ CHECK(ret, FAIL, "H5Pclose");
+ ret = H5Pclose(fapl);
+ CHECK(ret, FAIL, "H5Pclose");
+} /* end test_libver_bounds_open() */
+
+
/****************************************************************
**
** test_libver_bounds():
@@ -4935,12 +5097,1724 @@ test_libver_bounds(void)
/* Run the tests */
test_libver_bounds_real(H5F_LIBVER_EARLIEST, 1, H5F_LIBVER_LATEST, 2);
test_libver_bounds_real(H5F_LIBVER_LATEST, 2, H5F_LIBVER_EARLIEST, 2);
+ test_libver_bounds_open();
} /* end test_libver_bounds() */
+/**************************************************************************************
+**
+** test_libver_bounds_low_high():
+** Tests to verify that format versions are correct with the following five
+** pairs of low/high version bounds set in fapl via H5Pset_libver_bounds():
+** (1) (earliest, v18)
+** (2) (earliest, v110)
+** (3) (v18, v18)
+** (4) (v18, v110)
+** (5) (v110, v110)
+**
+** For each pair of setting in fapl, verify format versions with the following
+** six tests:
+** (1) test_libver_bounds_super(fapl): superblock versions
+** (2) test_libver_bounds_obj(fapl): object header versions
+** (3) test_libver_bounds_dataset(fapl): message versions associated with dataset
+** (4) test_libver_bounds_dataspace(fapl): dataspace message versions
+** (5) test_libver_bounds_datatype(fapl): datatype message versions
+** (6) test_libver_bounds_attributes(fapl): attribute message versions
+**
+**************************************************************************************/
+static void
+test_libver_bounds_low_high(void)
+{
+ hid_t fapl = -1; /* File access property list */
+ H5F_libver_t low, high; /* Low and high bounds */
+ herr_t ret; /* The return value */
+
+ /* Output message about test being performed */
+ MESSAGE(5, ("Testing setting (low, high) format version bounds\n"));
+
+ /* Create a file access property list */
+ fapl = H5Pcreate(H5P_FILE_ACCESS);
+ CHECK(fapl, FAIL, "H5Pcreate");
+
+ /* Loop through all the combinations of low/high version bounds */
+ for(low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; low++)
+ for(high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; high++) {
+
+ H5E_BEGIN_TRY {
+ /* Set the low/high version bounds */
+ ret = H5Pset_libver_bounds(fapl, low, high);
+ } H5E_END_TRY;
+
+ /* Should fail: invalid combinations */
+ if(high == H5F_LIBVER_EARLIEST) {
+ VERIFY(ret, FAIL, "H5Pset_libver_bounds");
+ continue;
+ }
+
+ /* Should fail: invalid combinations */
+ if(high < low) {
+ VERIFY(ret, FAIL, "H5Pset_libver_bounds");
+ continue;
+ }
+
+ /* All other combinations are valid and should succeed */
+ VERIFY(ret, SUCCEED, "H5Pset_libver_bounds");
+
+ /* Tests to verify version bounds */
+ test_libver_bounds_super(fapl);
+ test_libver_bounds_obj(fapl);
+ test_libver_bounds_dataset(fapl);
+ test_libver_bounds_dataspace(fapl);
+ test_libver_bounds_datatype(fapl);
+ test_libver_bounds_attributes(fapl);
+ }
+
+ ret = H5Pclose(fapl);
+ CHECK(ret, FAIL, "H5Pclose");
+
+} /* end test_libver_bounds_low_high() */
+
+
+/***********************************************************************
+**
+** test_libver_bounds_super():
+** Verify superblock version with the following two tests:
+** (1) test_libver_bounds_super_create():
+** --when creating a file with the input fapl and the fcpl
+** that has the following feature enabled:
+** (A) default fcpl
+** (B) fcpl with v1-btee K value enabled
+** (C) fcpl with shared messages enabled
+** (D) fcpl with persistent free-space manager enabled
+**
+** (2) test_libver_bounds_super_open():
+** --when opening a file which is created with the input fapl
+** and the fcpl setting as #A to #D above.
+**
+** These two tests are run with or without SWMR file access.
+**
+*************************************************************************/
+static void
+test_libver_bounds_super(hid_t fapl)
+{
+ hid_t fcpl = -1; /* File creation property list */
+ herr_t ret; /* The return value */
+
+ /* Create a default fcpl: #A */
+ /* This will result in superblock version 0 */
+ fcpl = H5Pcreate(H5P_FILE_CREATE);
+ CHECK(fcpl, FAIL, "H5Pcreate");
+
+ /* Verify superblock version when creating a file with input fapl,
+ fcpl #A and with/without SWMR access */
+ test_libver_bounds_super_create(fapl, fcpl, TRUE);
+ test_libver_bounds_super_create(fapl, fcpl, FALSE);
+
+ /* Verify superblock version when opening a file which is created
+ with input fapl, fcpl #A and with/without SWMR access */
+ test_libver_bounds_super_open(fapl, fcpl, TRUE);
+ test_libver_bounds_super_open(fapl, fcpl, FALSE);
+
+ /* Close the fcpl */
+ ret = H5Pclose(fcpl);
+ CHECK(ret, FAIL, "H5Pclose");
+
+ /* Create a fcpl with v1-btree K value enabled: #B */
+ /* This will result in superblock version 1 */
+ fcpl = H5Pcreate(H5P_FILE_CREATE);
+ CHECK(fcpl, FAIL, "H5Pcreate");
+ ret = H5Pset_istore_k(fcpl, 64);
+ CHECK(ret, FAIL, "H5Pset_istore_k");
+
+ /* Verify superblock version when creating a file with input fapl,
+ fcpl #B and with/without SWMR access */
+ test_libver_bounds_super_create(fapl, fcpl, TRUE);
+ test_libver_bounds_super_create(fapl, fcpl, FALSE);
+
+ /* Verify superblock version when opening a file which is created
+ with input fapl, fcpl #B and with/without SWMR access */
+ test_libver_bounds_super_open(fapl, fcpl, TRUE);
+ test_libver_bounds_super_open(fapl, fcpl, FALSE);
+
+ /* Close the fcpl */
+ ret = H5Pclose(fcpl);
+ CHECK(ret, FAIL, "H5Pclose");
+
+ /* Create a fcpl with shared messages enabled: #C */
+ /* This will result in superblock version 2 */
+ fcpl = H5Pcreate(H5P_FILE_CREATE);
+ CHECK(fcpl, FAIL, "H5Pcreate");
+ ret = H5Pset_shared_mesg_nindexes(fcpl, 1);
+ CHECK(ret, FAIL, "H5Pset_shared_mesg_nindexes");
+ ret = H5Pset_shared_mesg_index(fcpl, 0, H5O_SHMESG_ATTR_FLAG, 2);
+ CHECK(ret, FAIL, "H5Pset_shared_mesg_index");
+
+ /* Verify superblock version when creating a file with input fapl,
+ fcpl #C and with/without SWMR access */
+ test_libver_bounds_super_create(fapl, fcpl, TRUE);
+ test_libver_bounds_super_create(fapl, fcpl, FALSE);
+
+ /* Verify superblock version when opening a file which is created
+ with input fapl, fcpl #C and with/without SWMR access */
+ test_libver_bounds_super_open(fapl, fcpl, TRUE);
+ test_libver_bounds_super_open(fapl, fcpl, FALSE);
+
+ /* Close the fcpl */
+ ret = H5Pclose(fcpl);
+ CHECK(ret, FAIL, "H5Pclose");
+
+ /* Create a fcpl with persistent free-space manager enabled: #D */
+ /* This will result in superblock version 2 */
+ fcpl = H5Pcreate(H5P_FILE_CREATE);
+ CHECK(fcpl, FAIL, "H5Pcreate");
+ ret = H5Pset_file_space_strategy(fcpl, H5F_FSPACE_STRATEGY_FSM_AGGR, 1, (hsize_t)1);
+ CHECK(ret, FAIL, "H5Pset_file_space");
+
+ /* Verify superblock version when creating a file with input fapl,
+ fcpl #D and with/without SWMR access */
+ test_libver_bounds_super_create(fapl, fcpl, TRUE);
+ test_libver_bounds_super_create(fapl, fcpl, FALSE);
+
+ /* Verify superblock version when opening a file which is created
+ with input fapl, fcpl #D and with/without SWMR access */
+ test_libver_bounds_super_open(fapl, fcpl, TRUE);
+ test_libver_bounds_super_open(fapl, fcpl, FALSE);
+
+ /* Close the fcpl */
+ ret = H5Pclose(fcpl);
+ CHECK(ret, FAIL, "H5Pclose");
+
+} /* end test_libver_bounds_super() */
+
+
+/**************************************************************************************************
+**
+** test_libver_bounds_super_create():
+** Verify the following when the file is created with the input fapl, fcpl, and
+** with/without SWMR access:
+** (a) the superblock version #
+** (b) the file's low bound setting
+** (c) fail or succeed in creating the file
+**
+** For file creation, the bounds setting in fapl, the feature enabled in fcpl,
+** and with/without SWMR file access will determine the results for #a to #c.
+**
+** The first row for the following two tables is the 5 pairs of low/high bounds setting
+** in the input fapl. The next three rows list the expected results for #a to #c.
+** "-->" indicates "upgrade to"
+**
+** Creating a file with write access
+** --------------------------------------------------------------------------------
+** | (earliest, v18) | (earliest, v110) | (v18, v18) | (v18, v110) | (v110, v110) |
+** |______________________________________________________________________________|
+** Superblock version | vers 0, 1, 2 | vers 0, 1, 2 | vers 2 | vers 2 | vers 3 |
+** |------------------------------------------------------------------------------|
+** File's low bound | no change |
+** |------------------------------------------------------------------------------|
+** File creation | succeed |
+** |______________________________________________________________________________|
+**
+** Creating a file with SWMR-write access
+** --------------------------------------------------------------------------------
+** | (earliest, v18) | (earliest, v110) | (v18, v18) | (v18, v110) | (v110, v110) |
+** |______________________________________________________________________________|
+** Superblock version | -- | vers 3 | -- | vers 3 | vers 3 |
+** |------------------------------------------------------------------------------|
+** File's low bound | -- | ->v110 | -- | ->v110 | no change |
+** |------------------------------------------------------------------------------|
+** File creation | fail | succeed | fail | succeed | succed |
+** |______________________________________________________________________________|
+**
+******************************************************************************************************/
+static void
+test_libver_bounds_super_create(hid_t fapl, hid_t fcpl, htri_t is_swmr)
+{
+ hid_t fid = -1; /* File ID */
+ H5F_t *f = NULL; /* Internal file pointer */
+ H5F_libver_t low, high; /* Low and high bounds */
+ hbool_t ok; /* The result is ok or not */
+ herr_t ret; /* The return value */
+
+ /* Try to create the file */
+ H5E_BEGIN_TRY {
+ fid = H5Fcreate(FILE8, H5F_ACC_TRUNC | (is_swmr ? H5F_ACC_SWMR_WRITE : 0), fcpl, fapl);
+ } H5E_END_TRY;
+
+ /* Get the internal file pointer if the create succeeds */
+ if((ok = fid >= 0)) {
+ f = (H5F_t *)H5I_object(fid);
+ CHECK(f, NULL, "H5I_object");
+ }
+
+ /* Retrieve the low/high bounds */
+ ret = H5Pget_libver_bounds(fapl, &low, &high);
+ CHECK(ret, FAIL, "H5Pget_libver_bounds");
+
+ if(is_swmr) { /* SWMR is enabled */
+
+ if(high == H5F_LIBVER_LATEST) { /* Should succeed */
+ VERIFY(ok, TRUE, "H5Fcreate");
+ VERIFY(HDF5_SUPERBLOCK_VERSION_3, f->shared->sblock->super_vers, "HDF5_superblock_ver_bounds");
+ VERIFY(H5F_LIBVER_V110, f->shared->low_bound, "HDF5_superblock_ver_bounds");
+
+ } else /* Should fail */
+ VERIFY(ok, FALSE, "H5Fcreate");
+
+ } else { /* Should succeed */
+ VERIFY(ok, TRUE, "H5Fcreate");
+ VERIFY(low, f->shared->low_bound, "HDF5_superblock_ver_bounds");
+
+ switch(low) {
+ case H5F_LIBVER_EARLIEST:
+ ok = (f->shared->sblock->super_vers == 0 ||
+ f->shared->sblock->super_vers == 1 ||
+ f->shared->sblock->super_vers == 2);
+ VERIFY(ok, TRUE, "HDF5_superblock_ver_bounds");
+ break;
+
+ case H5F_LIBVER_V18:
+ ok = (f->shared->sblock->super_vers == 2);
+ VERIFY(ok, TRUE, "HDF5_superblock_ver_bounds");
+ break;
+
+ case H5F_LIBVER_V110:
+ ok = (f->shared->sblock->super_vers == 3);
+ VERIFY(ok, TRUE, "HDF5_superblock_ver_bounds");
+ break;
+
+ case H5F_LIBVER_ERROR:
+ case H5F_LIBVER_NBOUNDS:
+ default:
+ ERROR("H5Pget_libver_bounds");
+
+ } /* end switch */
+ }
+
+ if(ok) { /* Close the file */
+ ret = H5Fclose(fid);
+ CHECK(ret, FAIL, "H5Fclose");
+ }
+
+} /* end test_libver_bounds_super_create() */
+
+/**************************************************************************************************
+**
+** test_libver_bounds_super_open():
+** Verify the following when opening a file which is created with the input fapl, fcpl,
+** and with/without SWMR access:
+** (a) the file's low bound setting
+** (b) fail or succeed in opening the file
+**
+** (1) Create a file with the input fapl, fcpl and with/without SWMR access
+** (2) Close the file
+** (3) Reopen the file with a new fapl that is set to the 5 pairs of low/high bounds
+** in a for loop. For each pair of setting in the new fapl:
+** --Verify the expected results for #a and #b above.
+** --Close the file.
+**
+** For file open, the file's superblock version, the low/high bounds setting in fapl,
+** and with/without SWMR file access will determine the results for #a and #b.
+**
+** The first row for the following tables is the 5 pairs of low/high bounds setting
+** in the input fapl. The next two rows list the expected results for #a and #b.
+** "-->" indicates "upgrade to"
+**
+** Opening a file with write access
+**
+** Superblock version 0, 1
+** --------------------------------------------------------------------------------
+** | (earliest, v18) | (earliest, v110) | (v18, v18) | (v18, v110) | (v110, v110) |
+** |______________________________________________________________________________|
+** File's low bound | no change |
+** |------------------------------------------------------------------------------|
+** File open | succeed |
+** |______________________________________________________________________________|
+**
+**
+** Superblock version 2
+** --------------------------------------------------------------------------------
+** | (earliest, v18) | (earliest, v110) | (v18, v18) | (v18, v110) | (v110, v110) |
+** |______________________________________________________________________________|
+** File's low bound | -->v18 | no change |
+** |------------------------------------------------------------------------------|
+** File open | succeed |
+** |______________________________________________________________________________|
+**
+** Superblock version 3
+** --------------------------------------------------------------------------------
+** | (earliest, v18) | (earliest, v110) | (v18, v18) | (v18, v110) | (v110, v110) |
+** |______________________________________________________________________________|
+** File's low bound | -- | -->v110 | -- | -->v110 | no change |
+** |------------------------------------------------------------------------------|
+** File open | fail | succeed | fail | succeed | succeed |
+** |______________________________________________________________________________|
+**
+**
+**
+** Opening a file with SWMR-write access
+**
+** Superblock version 0, 1, 2
+** -------------------------------------------------------------------------------
+** | (earliest, v18) | (earliest, v10) | (v18, v18) | (v18, v110) | (v110, v110) |
+** |_____________________________________________________________________________|
+** File's low bound | ----
+** |-----------------------------------------------------------------------------|
+** File open | fail
+** |_____________________________________________________________________________|
+**
+**
+** Superblock version 3
+** -------------------------------------------------------------------------------
+** | (earliest, v18) | (earliest, v10) | (v18, v18) | (v18, v110) | (v110, v110) |
+** |_____________________________________________________________________________|
+** File's low bound | -- | -->v110 | -- | -->v110 | no change |
+** |-----------------------------------------------------------------------------|
+** File open | fail | succeed | fail | succeed | succeed |
+** |_____________________________________________________________________________|
+**
+**
+******************************************************************************************************/
+static void
+test_libver_bounds_super_open(hid_t fapl, hid_t fcpl, htri_t is_swmr)
+{
+ hid_t fid = -1; /* File ID */
+ H5F_t *f = NULL; /* Internal file pointer */
+ hid_t new_fapl = -1; /* File access property list */
+ unsigned super_vers; /* Superblock version */
+ H5F_libver_t low, high; /* Low and high bounds */
+ hbool_t ok; /* The result is ok or not */
+ herr_t ret; /* Return value */
+
+ /* Create the file with the input fcpl and fapl */
+ fid = H5Fcreate(FILE8, H5F_ACC_TRUNC, fcpl, fapl);
+ CHECK(fid, FAIL, "H5Fcreate");
+
+ /* Get the internal file pointer */
+ f = (H5F_t *)H5I_object(fid);
+ CHECK(f, NULL, "H5I_object");
+
+ /* The file's superblock version */
+ super_vers = f->shared->sblock->super_vers;
+
+ /* Close the file */
+ ret = H5Fclose(fid);
+ CHECK(ret, FAIL, "H5Fclose");
+
+ /* Create a default file access property list */
+ new_fapl = H5Pcreate(H5P_FILE_ACCESS);
+ CHECK(new_fapl, FAIL, "H5Pcreate");
+
+ /* Loop through all the combinations of low/high bounds in new_fapl */
+ for(low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; low++) {
+ for(high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; high++) {
+ H5E_BEGIN_TRY {
+ ret = H5Pset_libver_bounds(new_fapl, low, high);
+ } H5E_END_TRY;
+
+ /* Invalid combinations */
+ if (ret < 0)
+ continue;
+
+ /* Open the file with or without SWMR access */
+ H5E_BEGIN_TRY {
+ fid = H5Fopen(FILE8, H5F_ACC_RDWR | (is_swmr ? H5F_ACC_SWMR_WRITE : 0), new_fapl);
+ } H5E_END_TRY;
+
+ /* Get the internal file pointer if the open succeeds */
+ if((ok = fid >= 0)) {
+ f = (H5F_t *)H5I_object(fid);
+ CHECK(f, NULL, "H5I_object");
+ }
+
+ /* Verify the file open succeeds or fails */
+ switch(super_vers) {
+ case 3:
+ if(high == H5F_LIBVER_LATEST) {
+ /* Should succeed */
+ VERIFY(ok, TRUE, "H5Fopen");
+ VERIFY(H5F_LIBVER_V110, f->shared->low_bound, "HDF5_superblock_ver_bounds");
+
+ /* Close the file */
+ ret = H5Fclose(fid);
+ CHECK(ret, FAIL, "H5Fclose");
+ } else /* Should fail */
+ VERIFY(ok, FALSE, "H5Fopen");
+ break;
+
+ case 2:
+ if(is_swmr) /* Should fail */
+ VERIFY(ok, FALSE, "H5Fopen");
+ else { /* Should succeed */
+ VERIFY(ok, TRUE, "H5Fopen");
+
+ ok = f->shared->low_bound >= H5F_LIBVER_V18;
+ VERIFY(ok, TRUE, "HDF5_superblock_ver_bounds");
+
+ /* Close the file */
+ ret = H5Fclose(fid);
+ CHECK(ret, FAIL, "H5Fclose");
+ }
+ break;
+
+ case 1:
+ case 0:
+ if(is_swmr) /* Should fail */
+ VERIFY(ok, FALSE, "H5Fopen");
+ else { /* Should succeed */
+ VERIFY(ok, TRUE, "H5Fopen");
+ VERIFY(low, f->shared->low_bound, "HDF5_superblock_ver_bounds");
+
+ ret = H5Fclose(fid);
+ CHECK(ret, FAIL, "H5Fclose");
+ }
+ break;
+
+ default:
+ break;
+ } /* end switch */
+ } /* end for */
+ } /* end for */
+
+ /* Close the file access property list */
+ ret = H5Pclose(new_fapl);
+ CHECK(ret, FAIL, "H5Pclose");
+
+} /* end test_libver_bounds_super_open() */
+
+/****************************************************************
+**
+** test_libver_bounds_obj():
+** Verify object header versions:
+**
+** (a) Create a file with:
+** --the input fapl
+** --a fcpl that has shared message enabled
+** Verify the root group's object header version.
+** Close the file.
+**
+** (b) Create another file with:
+** --the input fapl
+** --a default fcpl
+** Verify the root group's object header version.
+** Close the file.
+**
+** (c) Reopen the same file in (b) with a new fapl.
+** The new fapl is set to the 5 pairs of low/high
+** bounds in a "for" loop. For each setting in fapl:
+** --Create a group in the file
+** --Verify the group's object header version
+** --Close and delete the group
+** --Close the file
+**
+****************************************************************/
+static void
+test_libver_bounds_obj(hid_t fapl)
+{
+ hid_t fid = -1; /* File ID */
+ hid_t gid = -1; /* Group ID */
+ hid_t fcpl = -1; /* File creation property list */
+ hid_t new_fapl = -1; /* File access property list */
+ H5F_t *f = NULL; /* Internal file pointer */
+ H5F_libver_t low, high; /* Low and high bounds */
+ H5O_info_t oinfo; /* Object info */
+ H5G_info_t ginfo; /* Group info */
+ herr_t ret; /* Return value */
+
+ /* Retrieve the low/high bounds from the input fapl */
+ ret = H5Pget_libver_bounds(fapl, &low, &high);
+ CHECK(ret, FAIL, "H5Pget_libver_bounds");
+
+ /* Create a default file creation property list */
+ fcpl = H5Pcreate(H5P_FILE_CREATE);
+ CHECK(fcpl, FAIL, "H5Pcreate");
+
+ /* Enable shared message in the fcpl */
+ /* This will result in a version 2 object header */
+ ret = H5Pset_shared_mesg_nindexes(fcpl, 1);
+ CHECK(ret, FAIL, "H5Pset_shared_mesg_nindexes");
+ ret = H5Pset_shared_mesg_index(fcpl, 0, H5O_SHMESG_ATTR_FLAG, 2);
+ CHECK(ret, FAIL, "H5Pset_shared_mesg_index");
+
+ /* Create the file with the fcpl and the input fapl */
+ fid = H5Fcreate(FILE8, H5F_ACC_TRUNC, fcpl, fapl);
+ CHECK(fid, FAIL, "H5Fcreate");
+
+ /* Get root group's object info */
+ ret = H5Oget_info_by_name(fid, "/", &oinfo, H5P_DEFAULT);
+ CHECK(ret, FAIL, "H5Oget_info_by_name");
+
+ /* Verify object header version is 2 because shared message is enabled */
+ VERIFY(oinfo.hdr.version, H5O_VERSION_2, "H5O_obj_ver_bounds");
+
+ /* Close the file */
+ ret = H5Fclose(fid);
+ CHECK(ret, FAIL, "H5Fclose");
+
+ /* Close the file creation property list */
+ ret = H5Pclose(fcpl);
+ CHECK(ret, FAIL, "H5Pclose");
+
+ /* Create a file with the default fcpl and input fapl */
+ fid = H5Fcreate(FILE8, H5F_ACC_TRUNC, H5P_DEFAULT, fapl);
+ CHECK(fid, FAIL, "H5Fcreate");
+
+ /* Get root group's object info */
+ ret = H5Oget_info_by_name(fid, "/", &oinfo, H5P_DEFAULT);
+ CHECK(ret, FAIL, "H5Oget_info_by_name");
+
+ /* Verify object header version is as indicated by low_bound */
+ VERIFY(oinfo.hdr.version, H5O_obj_ver_bounds[low], "H5O_obj_ver_bounds");
+
+ /* Close the file */
+ ret = H5Fclose(fid);
+ CHECK(ret, FAIL, "H5Fclose");
+
+ /* Create a new default file access property list which
+ is used to open the file in the "for" loop */
+ new_fapl = H5Pcreate(H5P_FILE_ACCESS);
+ CHECK(new_fapl, FAIL, "H5Pcreate");
+
+ /* Loop through all the combinations of low/high bounds in new_fapl */
+ /* Open the file with the fapl; create a group and verify the
+ object header version, then delete the group and close the file.*/
+ for(low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; low++) {
+ for(high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; high++) {
+ H5E_BEGIN_TRY {
+ ret = H5Pset_libver_bounds(new_fapl, low, high);
+ } H5E_END_TRY;
+
+ if (ret < 0) /* Invalid combinations */
+ continue;
+
+ /* Open the file */
+ H5E_BEGIN_TRY {
+ fid = H5Fopen(FILE8, H5F_ACC_RDWR, new_fapl);
+ } H5E_END_TRY;
+
+ if(fid >=0 ) { /* The file open succeeds */
+
+ /* Get the internal file pointer */
+ f = (H5F_t *)H5I_object(fid);
+ CHECK(f, NULL, "H5I_object");
+
+ /* Create a group in the file */
+ gid = H5Gcreate2(fid, GRP_NAME, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(gid, FAIL, "H5Gcreate2");
+
+ /* Get group information */
+ ret = H5Gget_info(gid, &ginfo);
+ CHECK(ret, FAIL, "H5Gget_info");
+
+ /* Verify group storage type */
+ if(f->shared->low_bound >= H5F_LIBVER_V18)
+ /* Links in group are stored in object header */
+ VERIFY(ginfo.storage_type, H5G_STORAGE_TYPE_COMPACT, "H5Gget_info");
+ else
+ /* Links in group are stored with a "symbol table" */
+ VERIFY(ginfo.storage_type, H5G_STORAGE_TYPE_SYMBOL_TABLE, "H5Gget_info");
+
+ /* Get object header information */
+ ret = H5Oget_info_by_name(gid, GRP_NAME, &oinfo, H5P_DEFAULT);
+ CHECK(ret, FAIL, "H5Oget_info_by_name");
+
+ /* Verify object header version as indicated by low_bound */
+ VERIFY(oinfo.hdr.version, H5O_obj_ver_bounds[f->shared->low_bound], "H5O_obj_ver_bounds");
+
+ /* Close the group */
+ ret = H5Gclose(gid);
+ CHECK(ret, FAIL, "H5Gclose");
+
+ /* Delete the group */
+ ret = H5Ldelete(fid, GRP_NAME, H5P_DEFAULT);
+ CHECK(ret, FAIL, "H5Ldelete");
+
+ /* Close the file */
+ ret = H5Fclose(fid);
+ CHECK(ret, FAIL, "H5Fclose");
+
+ } /* end if */
+ } /* end for */
+ } /* end for */
+
+ /* Close the file access property list */
+ ret = H5Pclose(new_fapl);
+ CHECK(ret, FAIL, "H5Pclose");
+
+} /* end test_libver_bounds_obj() */
+
+/****************************************************************
+**
+** test_libver_bounds_dataset():
+** Verify message versions associated with datasets:
+**
+** (a) Create a file with default fcpl and the input fapl.
+** Create the following two datasets:
+** --A contiguous dataset
+** --A chunked dataset with "no filter edge chunks"
+** For both datasets, verify the versions for the layout,
+** fill value and filter pipeline messages.
+** Close the file.
+**
+** (b) Create a new fapl that is set to the 5 pairs of low/high
+** bounds in a "for" loop. For each pair of setting in the
+** new fapl:
+** --Open the same file in (a) with the fapl
+** --Create a chunked dataset with 2 unlimited
+** dimensions
+** --Verify the versions for the layout, fill value
+** and filter pipeline messages
+** --Close and delete the dataset
+** --Close the file
+**
+****************************************************************/
+static void
+test_libver_bounds_dataset(hid_t fapl)
+{
+ hid_t fid = -1; /* File ID */
+ hid_t new_fapl = -1; /* File access property list */
+ hid_t did = -1; /* Dataset ID */
+ hid_t sid = -1; /* Dataspace ID */
+ hid_t dcpl = -1; /* Dataset creation property list */
+ H5D_t *dset = NULL; /* Internal dataset pointer */
+ H5F_t *f = NULL; /* Internal file pointer */
+ H5F_libver_t low, high; /* Low and high bounds */
+ herr_t ret; /* Return value */
+ hsize_t fix_dims2[2] = {10, 4}; /* Dimension sizes */
+ hsize_t fix_chunks2[2] = {4, 3}; /* Chunk dimension sizes */
+ hsize_t dims2[2] = {1, 4}; /* Dimension sizes */
+ hsize_t max_dims2[2] = {H5S_UNLIMITED, H5S_UNLIMITED}; /* Maximum dimension sizes */
+ hsize_t chunks2[2] = {4, 5}; /* Chunk dimension sizes */
+
+ /* Retrieve the low/high bounds from the input fapl */
+ ret = H5Pget_libver_bounds(fapl, &low, &high);
+ CHECK(ret, FAIL, "H5Pget_libver_bounds");
+
+ /* Create the file with the input fapl */
+ fid = H5Fcreate(FILE8, H5F_ACC_TRUNC, H5P_DEFAULT, fapl);
+ CHECK(fid, FAIL, "H5Fcreate");
+
+ /* Create the dataspace */
+ sid = H5Screate(H5S_SCALAR);
+ CHECK(sid, FAIL, "H5Screate");
+
+ /* Create a contiguous dataset */
+ did = H5Dcreate2(fid, DSETA, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(did, FAIL, "H5Dcreate");
+
+ /* Get the internal dataset pointer */
+ dset = (H5D_t *)H5I_object(did);
+ CHECK(dset, NULL, "H5I_object");
+
+ /* Verify version for layout and fill value messages */
+ if(low == H5F_LIBVER_EARLIEST) {
+ /* For layout message: the earliest version the library will set is 3 */
+ /* For fill value message: the earliest version the library will set is 2 */
+ VERIFY(dset->shared->layout.version, H5O_LAYOUT_VERSION_DEFAULT, "H5O_layout_ver_bounds");
+ VERIFY(dset->shared->dcpl_cache.fill.version, H5O_FILL_VERSION_2, "H5O_fill_ver_bounds");
+ } else {
+ VERIFY(dset->shared->layout.version, H5O_layout_ver_bounds[low], "H5O_layout_ver_bounds");
+ VERIFY(dset->shared->dcpl_cache.fill.version, H5O_fill_ver_bounds[low], "H5O_fill_ver_bounds");
+ }
+
+ /* Verify filter pipleline message version */
+ VERIFY(dset->shared->dcpl_cache.pline.version, H5O_pline_ver_bounds[low], "H5O_pline_ver_bounds");
+
+ /* Close the dataset */
+ ret = H5Dclose(did);
+ CHECK(ret, FAIL, "H5Dclose");
+
+ /* Close the dataspace */
+ ret = H5Sclose(sid);
+ CHECK(ret, FAIL, "H5Sclose");
+
+ /* Set up dataspace and dcpl for creating a chunked dataset
+ with "no filter edge chunks" enabled.
+ This will result in a version 4 layout message */
+ sid = H5Screate_simple(2, fix_dims2, NULL);
+ CHECK(sid, FAIL, "H5Screate_simple");
+ dcpl = H5Pcreate(H5P_DATASET_CREATE);
+ CHECK(dcpl, FAIL, "H5Pcreate");
+ ret = H5Pset_chunk(dcpl, 2, fix_chunks2);
+ CHECK(ret, FAIL, "H5Pset_chunk");
+ ret = H5Pset_chunk_opts(dcpl, H5D_CHUNK_DONT_FILTER_PARTIAL_CHUNKS);
+ CHECK(ret, FAIL, "H5Pset_chunk_opts");
+
+ /* Create the chunked dataset */
+ H5E_BEGIN_TRY {
+ did = H5Dcreate2(fid, DSETB, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT);
+ } H5E_END_TRY;
+
+ if(did >= 0) {
+
+ /* Get the internal dataset pointer */
+ dset = (H5D_t *)H5I_object(did);
+ CHECK(dset, NULL, "H5I_object");
+
+ /* Verify layout message version and chunk indexing type */
+ VERIFY(dset->shared->layout.version, H5O_LAYOUT_VERSION_4, "H5O_layout_ver_bounds");
+ VERIFY(dset->shared->layout.u.chunk.idx_type, H5D_CHUNK_IDX_FARRAY, "chunk_index_type");
+
+ /* Close the dataset */
+ ret = H5Dclose(did);
+ CHECK(ret, FAIL, "H5Dclose");
+ }
+
+ /* Close the file */
+ ret = H5Fclose(fid);
+ CHECK(ret, FAIL, "H5Fclose");
+
+ /* Close the dataspace */
+ ret = H5Sclose(sid);
+ CHECK(ret, FAIL, "H5Sclose");
+
+ /* Close the datset creation property list */
+ ret = H5Pclose(dcpl);
+ CHECK(ret, FAIL, "H5Pclose");
+
+ /* Create a default file access property list which is used
+ to open the file in the 'for' loop */
+ new_fapl = H5Pcreate(H5P_FILE_ACCESS);
+ CHECK(new_fapl, FAIL, "H5Pcreate");
+
+ /* Set up dataspace and dcpl for creating a chunked dataset with
+ 2 unlimited dimensions in the 'for' loop */
+ sid = H5Screate_simple(2, dims2, max_dims2);
+ CHECK(sid, FAIL, "H5Screate_simple");
+ dcpl = H5Pcreate(H5P_DATASET_CREATE);
+ CHECK(dcpl, FAIL, "H5Pcreate");
+ ret = H5Pset_chunk(dcpl, 2, chunks2);
+ CHECK(ret, FAIL, "H5Pset_chunk");
+
+ /* Loop through all the combinations of low/high bounds in new_fapl */
+ /* Open the file with the fapl and create the chunked dataset */
+ /* Verify the dataset's layout, fill value and filter pipleline message versions */
+ for(low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; low++) {
+ for(high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; high++) {
+ H5E_BEGIN_TRY {
+ ret = H5Pset_libver_bounds(new_fapl, low, high);
+ } H5E_END_TRY;
+
+ if (ret < 0) /* Invalid low/high combinations */
+ continue;
+
+ /* Open the file */
+ H5E_BEGIN_TRY {
+ fid = H5Fopen(FILE8, H5F_ACC_RDWR, new_fapl);
+ } H5E_END_TRY;
+
+ if(fid >=0 ) { /* The file open succeeds */
+
+ /* Get the internal file pointer */
+ f = (H5F_t *)H5I_object(fid);
+ CHECK(f, NULL, "H5I_object");
+
+ /* Create the chunked dataset */
+ did = H5Dcreate2(fid, DSETC, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT);
+ CHECK(did, FAIL, "H5Dcreate2");
+
+ /* Get the internal file pointer */
+ dset = (H5D_t *)H5I_object(did);
+ CHECK(dset, NULL, "H5I_object");
+
+ /* Verify the dataset's layout, fill value and filter pipeline message versions */
+ /* Also verify the chunk indexing type */
+ if(f->shared->low_bound == H5F_LIBVER_EARLIEST) {
+ /* For layout message: the earliest version the library will set is 3 */
+ /* For fill value message: the earliest version the library will set is 2 */
+ VERIFY(dset->shared->layout.version, H5O_LAYOUT_VERSION_DEFAULT, "H5O_layout_ver_bounds");
+ VERIFY(dset->shared->dcpl_cache.fill.version, H5O_FILL_VERSION_2, "H5O_fill_ver_bounds");
+ } else {
+ VERIFY(dset->shared->layout.version, H5O_layout_ver_bounds[f->shared->low_bound], "H5O_layout_ver_bounds");
+ VERIFY(dset->shared->dcpl_cache.fill.version, H5O_fill_ver_bounds[f->shared->low_bound], "H5O_fill_ver_bounds");
+ }
+
+ /* Verify the filter pipeline message version */
+ VERIFY(dset->shared->dcpl_cache.pline.version, H5O_pline_ver_bounds[f->shared->low_bound], "H5O_pline_ver_bounds");
+
+ /* Verify the dataset's chunk indexing type */
+ if(dset->shared->layout.version == H5O_LAYOUT_VERSION_LATEST)
+ VERIFY(dset->shared->layout.u.chunk.idx_type, H5D_CHUNK_IDX_BT2, "chunk_index_type");
+ else
+ VERIFY(dset->shared->layout.u.chunk.idx_type, H5D_CHUNK_IDX_BTREE, "chunk_index_type");
+
+ /* Close the dataset */
+ ret = H5Dclose(did);
+ CHECK(ret, FAIL, "H5Dclose");
+
+ /* Delete the dataset */
+ ret = H5Ldelete(fid, DSETC, H5P_DEFAULT);
+ CHECK(ret, FAIL, "H5Ldelete");
+
+ /* Close the file */
+ ret = H5Fclose(fid);
+ CHECK(ret, FAIL, "H5Fclose");
+
+ } /* end if */
+ } /* end for */
+ } /* end for */
+
+ /* Close the file access property list */
+ ret = H5Pclose(new_fapl);
+ CHECK(ret, FAIL, "H5Pclose");
+
+ /* Close the dataspace */
+ ret = H5Sclose(sid);
+ CHECK(ret, FAIL, "H5Sclose");
+
+ /* Close the dataset creation property list */
+ ret = H5Pclose(dcpl);
+ CHECK(ret, FAIL, "H5Pclose");
+
+} /* end test_libver_bounds_dataset() */
+
+/****************************************************************
+**
+** test_libver_bounds_dataspace():
+** Verify dataspace message versions:
+**
+** (a) Create a file with default fcpl and the input fapl.
+** Create the following two datasets:
+** --A dataset with scalar dataspace
+** --A dataset with null dataspace
+** For both datasets, verify the dataspace message versions.
+** Close the file.
+**
+** (b) Create a new fapl that is set to the 5 pairs of low/high
+** bounds in a "for" loop. For each pair of setting in the
+** new fapl:
+** --Open the same file in (a) with the fapl
+** --Create a chunked dataset, a compact dataset and
+** a contigous dataset
+** --Verify the dataspace message version for these
+** three datasets
+** --Delete the three datasets and the dataspaces
+** --Close the file
+**
+****************************************************************/
+static void
+test_libver_bounds_dataspace(hid_t fapl)
+{
+ hid_t fid = -1; /* File ID */
+ hid_t new_fapl = -1; /* File access property list */
+ hid_t did = -1, did_null = -1; /* Dataset IDs */
+ hid_t did_compact = -1, did_contig = -1; /* Dataset IDs */
+ hid_t sid = -1, sid_null = -1; /* Dataspace IDs */
+ hid_t sid_compact = -1, sid_contig = -1; /* Dataspace IDs */
+ hid_t dcpl = -1; /* Dataset creation property list */
+ hid_t dcpl_compact = -1, dcpl_contig = -1; /* Dataset creation property lists */
+ H5S_t *space = NULL, *space_null = NULL; /* Internal dataspace pointers */
+ H5F_t *f = NULL; /* Internal file pointer */
+ H5F_libver_t low, high; /* Low and high bounds */
+ hsize_t dims[1] = {1}; /* Dimension sizes */
+ hsize_t dims2[2] = {5, 4}; /* Dimension sizes */
+ hsize_t max_dims[1] = {H5S_UNLIMITED}; /* Maximum dimension sizes */
+ hsize_t chunks[1] = {4}; /* Chunk dimension sizes */
+ herr_t ret; /* Return value */
+
+ /* Retrieve the low/high bounds from the input fapl */
+ ret = H5Pget_libver_bounds(fapl, &low, &high);
+ CHECK(ret, FAIL, "H5Pget_libver_bounds");
+
+ /* Create the file with the input fapl */
+ fid = H5Fcreate(FILE8, H5F_ACC_TRUNC, H5P_DEFAULT, fapl);
+ CHECK(fid, FAIL, "H5Fcreate");
+
+ /* Create scalar dataspace */
+ sid = H5Screate(H5S_SCALAR);
+ CHECK(sid, FAIL, "H5Screate");
+
+ /* Create a dataset with the scalar dataspace */
+ did = H5Dcreate2(fid, DSET, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(did, FAIL, "H5Dcreate");
+
+ /* Get the internal dataspace pointer */
+ sid = H5Dget_space(did);
+ CHECK(sid, FAIL, "H5Dget_space");
+ space = (H5S_t *)H5I_object(sid);
+ CHECK(space, NULL, "H5I_object");
+
+ /* Verify the dataspace version */
+ VERIFY(space->extent.version, H5O_sdspace_ver_bounds[low], "H5O_sdspace_ver_bounds");
+
+ /* Create null dataspace */
+ sid_null = H5Screate(H5S_NULL);
+ CHECK(sid_null, FAIL, "H5Screate");
+
+ /* Create a dataset with the null dataspace */
+ did_null = H5Dcreate2(fid, DSET_NULL, H5T_NATIVE_INT, sid_null, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(did_null, FAIL, "H5Dcreate");
+
+ /* Get the internal dataspace pointer */
+ sid_null = H5Dget_space(did_null);
+ CHECK(sid_null, FAIL, "H5Dget_space");
+ space_null = (H5S_t *)H5I_object(sid_null);
+ CHECK(space_null, NULL, "H5I_object");
+
+ /* Verify the dataspace version */
+ VERIFY(space_null->extent.version, H5O_SDSPACE_VERSION_2, "H5O_sdspace_ver_bounds");
+
+ /* Close the datasets */
+ ret = H5Dclose(did);
+ CHECK(ret, FAIL, "H5Dclose");
+ ret = H5Dclose(did_null);
+ CHECK(ret, FAIL, "H5Dclose");
+
+ /* Close the dataspaces */
+ ret = H5Sclose(sid);
+ CHECK(ret, FAIL, "H5Sclose");
+ ret = H5Sclose(sid_null);
+ CHECK(ret, FAIL, "H5Sclose");
+
+ /* Close the file */
+ ret = H5Fclose(fid);
+ CHECK(ret, FAIL, "H5Fclose");
+
+ /* Create a default file access property list which is used
+ to open the file in the 'for' loop */
+ new_fapl = H5Pcreate(H5P_FILE_ACCESS);
+ CHECK(new_fapl, FAIL, "H5Pcreate");
+
+ /* Set up dataspace and dcpl for creating a chunked dataset */
+ sid = H5Screate_simple(1, dims, max_dims);
+ CHECK(sid, FAIL, "H5Screate_simple");
+ dcpl = H5Pcreate(H5P_DATASET_CREATE);
+ CHECK(dcpl, FAIL, "H5Pcreate");
+ ret = H5Pset_chunk(dcpl, 1, chunks);
+ CHECK(ret, FAIL, "H5Pset_chunk");
+
+ /* Set up dataspace and dcpl for creating a compact dataset */
+ sid_compact = H5Screate_simple(1, dims, NULL);
+ CHECK(sid_compact, FAIL, "H5Screate_simple");
+ dcpl_compact = H5Pcreate(H5P_DATASET_CREATE);
+ CHECK(dcpl_compact, FAIL, "H5Pcreate");
+ ret = H5Pset_layout(dcpl_compact, H5D_COMPACT);
+ CHECK(ret, FAIL, "H5Pset_layout");
+
+ /* Set up dataspace and dcpl for creating a contiguous dataset */
+ sid_contig = H5Screate_simple(2, dims2, NULL);
+ CHECK(sid_contig, FAIL, "H5Screate_simple");
+ dcpl_contig = H5Pcreate(H5P_DATASET_CREATE);
+ CHECK(dcpl_contig, FAIL, "H5Pcreate");
+ ret = H5Pset_layout(dcpl_contig, H5D_CONTIGUOUS);
+ CHECK(ret, FAIL, "H5Pset_layout");
+
+ /* Loop through all the combinations of low/high bounds in new_fapl */
+ /* Open the file and create the chunked/compact/contiguous datasets */
+ /* Verify the dataspace message version for the three datasets */
+ for(low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; low++) {
+ for(high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; high++) {
+ hid_t tmp_sid, tmp_sid_compact, tmp_sid_contig; /* Dataspace IDs */
+ H5S_t *tmp_space, *tmp_space_compact, *tmp_space_contig; /* Internal dataspace pointers */
+
+ H5E_BEGIN_TRY {
+ ret = H5Pset_libver_bounds(new_fapl, low, high);
+ } H5E_END_TRY;
+
+ if (ret < 0) /* Invalid low/high combinations */
+ continue;
+
+ /* Open the file */
+ H5E_BEGIN_TRY {
+ fid = H5Fopen(FILE8, H5F_ACC_RDWR, new_fapl);
+ } H5E_END_TRY;
+
+ if(fid >=0 ) { /* The file open succeeds */
+
+ /* Get the internal file pointer */
+ f = (H5F_t *)H5I_object(fid);
+ CHECK(f, NULL, "H5I_object");
+
+ /* Create the chunked dataset */
+ did = H5Dcreate2(fid, DSETA, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT);
+ CHECK(did, FAIL, "H5Dcreate2");
+
+ /* Get the internal dataspace pointer for the chunked dataset */
+ tmp_sid = H5Dget_space(did);
+ CHECK(tmp_sid, FAIL, "H5Dget_space");
+ tmp_space = (H5S_t *)H5I_object(tmp_sid);
+ CHECK(tmp_space, NULL, "H5I_object");
+
+ /* Create the compact dataset */
+ did_compact = H5Dcreate2(fid, DSETB, H5T_NATIVE_INT, sid_compact, H5P_DEFAULT, dcpl_compact, H5P_DEFAULT);
+ CHECK(did_compact, FAIL, "H5Dcreate2");
+
+ /* Get the internal dataspace pointer for the compact dataset */
+ tmp_sid_compact = H5Dget_space(did_compact);
+ CHECK(tmp_sid_compact, FAIL, "H5Dget_space");
+ tmp_space_compact = (H5S_t *)H5I_object(tmp_sid_compact);
+ CHECK(tmp_space_compact, NULL, "H5I_object");
+
+ /* Create the contiguous dataset */
+ did_contig = H5Dcreate2(fid, DSETC, H5T_NATIVE_INT, sid_contig, H5P_DEFAULT, dcpl_contig, H5P_DEFAULT);
+ CHECK(did_contig, FAIL, "H5Dcreate2");
+
+ /* Get the internal dataspace pointer for the contiguous dataset */
+ tmp_sid_contig = H5Dget_space(did_contig);
+ CHECK(tmp_sid_contig, FAIL, "H5Dget_space");
+ tmp_space_contig = (H5S_t *)H5I_object(tmp_sid_contig);
+ CHECK(tmp_space_contig, NULL, "H5I_object");
+
+ /* Verify versions for the three dataspaces */
+ VERIFY(tmp_space->extent.version, H5O_sdspace_ver_bounds[f->shared->low_bound], "H5O_sdspace_ver_bounds");
+ VERIFY(tmp_space_compact->extent.version, H5O_sdspace_ver_bounds[f->shared->low_bound], "H5O_sdspace_ver_bounds");
+ VERIFY(tmp_space_contig->extent.version, H5O_sdspace_ver_bounds[f->shared->low_bound], "H5O_sdspace_ver_bounds");
+
+ /* Close the three datasets */
+ ret = H5Dclose(did);
+ CHECK(ret, FAIL, "H5Dclose");
+ ret = H5Dclose(did_compact);
+ CHECK(ret, FAIL, "H5Dclose");
+ ret = H5Dclose(did_contig);
+ CHECK(ret, FAIL, "H5Dclose");
+
+ /* Close the three dataspaces */
+ ret = H5Sclose(tmp_sid);
+ CHECK(ret, FAIL, "H5Sclose");
+ ret = H5Sclose(tmp_sid_compact);
+ CHECK(ret, FAIL, "H5Sclose");
+ ret = H5Sclose(tmp_sid_contig);
+ CHECK(ret, FAIL, "H5Sclose");
+
+ /* Delete the three datasets */
+ ret = H5Ldelete(fid, DSETA, H5P_DEFAULT);
+ CHECK(ret, FAIL, "H5Ldelete");
+ ret = H5Ldelete(fid, DSETB, H5P_DEFAULT);
+ CHECK(ret, FAIL, "H5Ldelete");
+ ret = H5Ldelete(fid, DSETC, H5P_DEFAULT);
+ CHECK(ret, FAIL, "H5Ldelete");
+
+ /* Close the file */
+ ret = H5Fclose(fid);
+ CHECK(ret, FAIL, "H5Fclose");
+
+ } /* end if */
+ } /* end for */
+ } /* end for */
+
+ /* Close the file access property list */
+ ret = H5Pclose(new_fapl);
+ CHECK(ret, FAIL, "H5Pclose");
+
+ /* Close the three dataspaces */
+ ret = H5Sclose(sid);
+ CHECK(ret, FAIL, "H5Sclose");
+ ret = H5Sclose(sid_compact);
+ CHECK(ret, FAIL, "H5Sclose");
+ ret = H5Sclose(sid_contig);
+ CHECK(ret, FAIL, "H5Sclose");
+
+ /* Close the three dataset creation property lists */
+ ret = H5Pclose(dcpl);
+ CHECK(ret, FAIL, "H5Pclose");
+ ret = H5Pclose(dcpl_compact);
+ CHECK(ret, FAIL, "H5Pclose");
+ ret = H5Pclose(dcpl_contig);
+ CHECK(ret, FAIL, "H5Pclose");
+
+} /* end test_libver_bounds_dataspace() */
+
+
+/****************************************************************
+**
+** test_libver_bounds_datatype():
+** Verify the datatype message version:
+**
+** (a) Create the following datatypes:
+** 1) integer
+** 2) enum
+** 3) array
+** 4) compound
+** 5) vlen
+** (b) Call test_libver_bounds_datatype_check() for each
+** datatype in (a) to verify the datatype message version.
+**
+****************************************************************/
+static void
+test_libver_bounds_datatype(hid_t fapl)
+{
+ hid_t tid = -1, tid_enum = -1, tid_array = -1; /* Datatype IDs */
+ hid_t tid_compound = -1, tid_vlen = -1; /* Datatype IDs */
+ int enum_value; /* Value for enum datatype */
+ typedef struct s1 { /* Data structure for compound datatype */
+ char c;
+ int i;
+ } s1;
+ hsize_t dims[1] = {1}; /* Dimension sizes */
+ herr_t ret; /* Return value */
+
+ /* Create integer datatype */
+ tid = H5Tcopy(H5T_NATIVE_INT);
+
+ /* Verify datatype message version */
+ test_libver_bounds_datatype_check(fapl, tid);
+
+ /* Create enum datatype */
+ tid_enum = H5Tenum_create(tid);
+ enum_value = 0;
+ H5Tenum_insert(tid_enum, "val1", &enum_value);
+ enum_value = 1;
+ H5Tenum_insert(tid_enum, "val2", &enum_value);
+
+ /* Verify datatype message version */
+ test_libver_bounds_datatype_check(fapl, tid_enum);
+
+ /* Create array datatype */
+ tid_array = H5Tarray_create2(tid, 1, dims);
+
+ /* Verify datatype message version */
+ test_libver_bounds_datatype_check(fapl, tid_array);
+
+ /* Create compound datatype */
+ tid_compound = H5Tcreate(H5T_COMPOUND, sizeof(s1));
+ H5Tinsert(tid_compound, "c", HOFFSET(s1, c), H5T_STD_U8LE);
+ H5Tinsert(tid_compound, "i", HOFFSET(s1, i), H5T_NATIVE_INT);
+
+ /* Verify datatype message version */
+ test_libver_bounds_datatype_check(fapl, tid_compound);
+
+ /* Create vlen datatype */
+ tid_vlen = H5Tvlen_create(tid);
+
+ /* Verify datatype message version */
+ test_libver_bounds_datatype_check(fapl, tid_vlen);
+
+ /* Close the datatypes */
+ ret = H5Tclose(tid);
+ CHECK(ret, FAIL, "H5Tclose");
+
+ ret = H5Tclose(tid_enum);
+ CHECK(ret, FAIL, "H5Tclose");
+
+ ret = H5Tclose(tid_array);
+ CHECK(ret, FAIL, "H5Tclose");
+
+ ret = H5Tclose(tid_compound);
+ CHECK(ret, FAIL, "H5Tclose");
+
+ ret = H5Tclose(tid_vlen);
+ CHECK(ret, FAIL, "H5Tclose");
+
+} /* end test_libver_bounds_datatype() */
+
+/****************************************************************
+**
+** test_libver_bounds_datatype_check():
+** Helper routine called by test_libver_bounds_datatype()
+** to verify the datatype message version for the input tid:
+**
+** (a) Create a file with default fcpl and the input fapl.
+** Create a contiguous dataset with the input tid.
+** Verify the datatype message version.
+** Create a committed datatype of string to be
+** used later.
+** Close the file.
+**
+** (b) Create a new fapl that is set to the 5 pairs of low/high
+** bounds in a "for" loop. For each pair of setting in
+** the new fapl:
+** --Open the same file in (a) with the fapl
+** --Verify the message version for the committed
+** datatype created earlier
+** --Create a chunked dataset with the input tid
+** --Verify the datatype message version
+** --Close and delete the dataset
+** --Close the file
+**
+****************************************************************/
+static void
+test_libver_bounds_datatype_check(hid_t fapl, hid_t tid)
+{
+ hid_t fid = -1; /* File ID */
+ hid_t new_fapl = -1; /* File acess property list */
+ hid_t dcpl = -1; /* Dataset creation property list */
+ hid_t dtid = -1; /* Datatype ID for the dataset */
+ hid_t str_tid = -1; /* String datatype ID */
+ hid_t did = -1; /* Dataset ID */
+ hid_t sid = -1; /* Dataspace ID */
+ hsize_t dims[1] = {1}; /* Dimension sizes */
+ hsize_t dims2[2] = {5, 4}; /* Dimension sizes */
+ hsize_t max_dims2[2] = {H5S_UNLIMITED, H5S_UNLIMITED}; /* Maximum dimension sizes */
+ hsize_t chunks[2] = {2, 3}; /* Chunk dimension sizes */
+ H5T_t *dtype = NULL; /* Internal datatype pointer */
+ H5T_t *str_dtype = NULL; /* Internal datatype pointer for the string datatype */
+ H5F_t *f = NULL; /* Internal file pointer */
+ H5F_libver_t low, high; /* Low and high bounds */
+ herr_t ret; /* Return value */
+
+ /* Retrieve the low/high version bounds from the input fapl */
+ ret = H5Pget_libver_bounds(fapl, &low, &high);
+ CHECK(ret, FAIL, "H5Pget_libver_bounds");
+
+ /* Create the file with the input fapl */
+ fid = H5Fcreate(FILE8, H5F_ACC_TRUNC, H5P_DEFAULT, fapl);
+ CHECK(fid, FAIL, "H5Fcreate");
+
+ /* Create a committed datatype of string which will be used
+ later inside the 'for' loop */
+ str_tid = H5Tcopy(H5T_C_S1);
+ CHECK(str_tid, FAIL, "H5Tcopy");
+ ret = H5Tset_size(str_tid, (size_t)10);
+ CHECK(ret, FAIL, "H5Tset_size");
+ ret = H5Tcommit2(fid, "datatype", str_tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(ret, FAIL, "H5Tcommit2");
+ ret = H5Tclose(str_tid);
+ CHECK(ret, FAIL, "H5Tclose");
+
+ /* Create dataspace */
+ sid = H5Screate_simple(1, dims, NULL);
+ CHECK(sid, FAIL, "H5Screate_simple");
+
+ /* Create a dataset with the input tid */
+ did = H5Dcreate2(fid, DSET1, tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(did, FAIL, "H5Dcreate2");
+
+ /* Get the dataset's datatype */
+ dtid = H5Dget_type(did);
+ CHECK(dtid, FAIL, "H5Dget_type");
+
+ /* Get the internal datatype pointer */
+ dtype = (H5T_t *)H5I_object(dtid);
+ CHECK(dtype, NULL, "H5I_object");
+
+ /* Verify the datatype message version */
+ /* H5T_COMPOUND, H5T_ENUM, H5T_ARRAY:
+ * --the library will set version according to low_bound
+ * --H5T_ARRAY: the earliest version the library will set is 2
+ * H5T_INTEGER, H5T_FLOAT, H5T_TIME, H5T_STRING, H5T_BITFIELD, H5T_OPAQUE, H5T_REFERENCE:
+ * --the library will only use basic version
+ */
+
+ if(dtype->shared->type == H5T_COMPOUND ||
+ dtype->shared->type == H5T_ENUM ||
+ dtype->shared->type == H5T_ARRAY) {
+ if(dtype->shared->type == H5T_ARRAY && low == H5F_LIBVER_EARLIEST)
+ VERIFY(dtype->shared->version, H5O_DTYPE_VERSION_2, "H5O_dtype_ver_bounds");
+ else
+ VERIFY(dtype->shared->version, H5O_dtype_ver_bounds[low], "H5O_dtype_ver_bounds");
+ } else
+ VERIFY(dtype->shared->version, H5O_dtype_ver_bounds[H5F_LIBVER_EARLIEST], "H5O_dtype_ver_bounds");
+
+ /* Close the dataset */
+ ret = H5Dclose(did);
+ CHECK(ret, FAIL, "H5Dclose");
+
+ /* Close the dataspace */
+ ret = H5Sclose(sid);
+ CHECK(ret, FAIL, "H5Dclose");
+
+ /* Close the datatype */
+ ret = H5Tclose(dtid);
+ CHECK(ret, FAIL, "H5Fclose");
+
+ /* Close the file */
+ ret = H5Fclose(fid);
+ CHECK(ret, FAIL, "H5Fclose");
+
+ /* Create a default file access property list */
+ new_fapl = H5Pcreate(H5P_FILE_ACCESS);
+ CHECK(new_fapl, FAIL, "H5Pcreate");
+
+ /* Set up dataspace and dcpl for creating a chunked dataset */
+ sid = H5Screate_simple(2, dims2, max_dims2);
+ CHECK(sid, FAIL, "H5Screate_simple");
+ dcpl = H5Pcreate(H5P_DATASET_CREATE);
+ CHECK(dcpl, FAIL, "H5Pcreate");
+ ret = H5Pset_chunk(dcpl, 2, chunks);
+ CHECK(ret, FAIL, "H5Pset_chunk");
+
+ /* Loop through all the combinations of low/high bounds */
+ /* Open the file and create the chunked dataset with the input tid */
+ /* Verify the dataset's datatype message version */
+ /* Also verify the committed atatype message version */
+ for(low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; low++) {
+ for(high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; high++) {
+ H5E_BEGIN_TRY {
+ ret = H5Pset_libver_bounds(new_fapl, low, high);
+ } H5E_END_TRY;
+
+ if (ret < 0) /* Invalid low/high combinations */
+ continue;
+
+ /* Open the file */
+ H5E_BEGIN_TRY {
+ fid = H5Fopen(FILE8, H5F_ACC_RDWR, new_fapl);
+ } H5E_END_TRY;
+
+ if(fid >= 0 ) { /* The file open succeeds */
+
+ /* Get the internal file pointer */
+ f = (H5F_t *)H5I_object(fid);
+ CHECK(f, NULL, "H5I_object");
+
+ /* Open the committed datatype */
+ str_tid = H5Topen2(fid, "datatype", H5P_DEFAULT);
+ CHECK(str_tid, FAIL, "H5Topen2");
+ str_dtype = (H5T_t *)H5I_object(str_tid);
+ CHECK(str_dtype, NULL, "H5I_object");
+
+ /* Verify the committed datatype message version */
+ VERIFY(str_dtype->shared->version, H5O_dtype_ver_bounds[H5F_LIBVER_EARLIEST], "H5O_dtype_ver_bounds");
+
+ /* Close the committed datatype */
+ ret = H5Tclose(str_tid);
+ CHECK(ret, FAIL, "H5Tclose");
+
+
+ /* Create the chunked dataset */
+ did = H5Dcreate2(fid, DSETNAME, tid, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT);
+ CHECK(did, FAIL, "H5Dcreate2");
+
+ /* Get the dataset's datatype */
+ dtid = H5Dget_type(did);
+ CHECK(dtid, FAIL, "H5Dget_type");
+
+ /* Get the internal datatype pointer */
+ dtype = (H5T_t *)H5I_object(dtid);
+ CHECK(dtype, NULL, "H5I_object");
+
+ /* Verify the dataset's datatype message version */
+ /* H5T_COMPOUND, H5T_ENUM, H5T_ARRAY:
+ * --the library will set version according to low_bound
+ * --H5T_ARRAY: the earliest version the library will set is 2
+ * H5T_INTEGER, H5T_FLOAT, H5T_TIME, H5T_STRING, H5T_BITFIELD, H5T_OPAQUE, H5T_REFERENCE:
+ * --the library will only use basic version
+ */
+ if(dtype->shared->type == H5T_COMPOUND ||
+ dtype->shared->type == H5T_ENUM ||
+ dtype->shared->type == H5T_ARRAY) {
+ if(dtype->shared->type == H5T_ARRAY &&
+ f->shared->low_bound == H5F_LIBVER_EARLIEST)
+ VERIFY(dtype->shared->version, H5O_DTYPE_VERSION_2, "H5O_dtype_ver_bounds");
+ else
+ VERIFY(dtype->shared->version, H5O_dtype_ver_bounds[f->shared->low_bound], "H5O_dtype_ver_bounds");
+ } else
+ VERIFY(dtype->shared->version, H5O_dtype_ver_bounds[H5F_LIBVER_EARLIEST], "H5O_dtype_ver_bounds");
+
+ /* Close the dataset */
+ ret = H5Dclose(did);
+ CHECK(ret, FAIL, "H5Dclose");
+
+ /* Close the dataset's datatype */
+ ret = H5Tclose(dtid);
+ CHECK(ret, FAIL, "H5Tclose");
+
+ /* Delete the dataset */
+ ret = H5Ldelete(fid, DSETNAME, H5P_DEFAULT);
+ CHECK(ret, FAIL, "H5Ldelete");
+
+ /* Close the file */
+ ret = H5Fclose(fid);
+ CHECK(ret, FAIL, "H5Fclose");
+
+ } /* end if */
+ } /* end for */
+ } /* end for */
+
+ /* Close the file access property list */
+ ret = H5Pclose(new_fapl);
+ CHECK(ret, FAIL, "H5Pclose");
+
+ /* Close the dataspace */
+ ret = H5Sclose(sid);
+ CHECK(ret, FAIL, "H5Sclose");
+
+ /* Close the dataset creation property list */
+ ret = H5Pclose(dcpl);
+ CHECK(ret, FAIL, "H5Pclose");
+
+} /* end test_libver_bounds_datatype_check() */
+
+/****************************************************************
+**
+** test_libver_bounds_attributes():
+** Verify the attribute message versions:
+**
+** (a) Create a file with default fcpl and the input fapl.
+** Create a group and attach the following three attributes
+** to the group:
+** (1) Attribute with a committed datatype
+** (2) Attribute with integer type
+** (3) Attribute with character encoding set
+** Verify the three attributes' message versions.
+** Close the file.
+**
+** (b) Create a fcpl that has shared datatype message enabled.
+** Create a file with the fcpl and the input fapl.
+** Create a group and attach an attribute with shared
+** integer type to the group.
+** Verify the attribute message version.
+** Close the file
+**
+** (b) Create a new fapl that is set to the 5 pairs of low/high
+** bounds in a "for" loop. For each pair of setting in
+** the new fapl:
+** --Open the same file in (b) with the fapl
+** --Open the group and attach an attribute with integer
+** type to the group
+** --Verify the attribute message version
+** --Delete the attribute
+** --Close the group and the file
+**
+****************************************************************/
+static void
+test_libver_bounds_attributes(hid_t fapl)
+{
+ hid_t fid = -1; /* File ID */
+ hid_t fcpl = -1; /* File creation property list */
+ hid_t new_fapl = -1; /* File access property list */
+ hid_t tid = -1; /* Datatype ID */
+ hid_t gid = -1; /* Group ID */
+ hid_t sid = -1; /* Dataspace ID */
+ hid_t aid = -1; /* Attribute ID */
+ hid_t attr_cpl = -1; /* Attribute creation property list */
+ H5A_t *attr = NULL; /* Internal attribute pointer */
+ H5F_t *f = NULL; /* Internal file pointer */
+ H5F_libver_t low, high; /* Low and high bounds */
+ herr_t ret; /* Return value */
+
+ /* Retrieve the low/high bounds from the input fapl */
+ ret = H5Pget_libver_bounds(fapl, &low, &high);
+ CHECK(ret, FAIL, "H5Pget_libver_bounds");
+
+ /* Create the file */
+ fid = H5Fcreate(FILE8, H5F_ACC_TRUNC, H5P_DEFAULT, fapl);
+ CHECK(fid, FAIL, "H5Fcreate");
+
+ /* Integer datatpye */
+ tid = H5Tcopy(H5T_NATIVE_INT);
+ CHECK(tid, FAIL, "H5Tcopy");
+
+ /* Create a committed datatype */
+ ret = H5Tcommit2(fid, "datatype", tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(ret, FAIL, "H5Tcommit2");
+
+ /* Create dataspace */
+ sid = H5Screate(H5S_SCALAR);
+ CHECK(sid, FAIL, "H5Screate");
+
+ /* Create a group */
+ gid = H5Gcreate2(fid, GRP_NAME, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(gid, FAIL, "H5Gcreate2");
+
+ /* Attach an attribute to the group with the committed datatype */
+ aid = H5Acreate2(gid, "attr1", tid, sid, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(aid, FAIL, "H5Acreate2");
+
+ /* Get the internal attribute pointer */
+ attr = (H5A_t *)H5I_object(aid);
+ CHECK(attr, NULL, "H5I_object");
+
+ /* Verify the attribute version */
+ if(low == H5F_LIBVER_EARLIEST)
+ /* The earliest version the library can set for an attribute with committed datatype is 2 */
+ VERIFY(attr->shared->version, H5O_ATTR_VERSION_2, "H5O_attr_ver_bounds");
+ else
+ VERIFY(attr->shared->version, H5O_attr_ver_bounds[low], "H5O_attr_ver_bounds");
+
+ /* Close the attribute */
+ ret = H5Aclose(aid);
+ CHECK(ret, FAIL, "H5Aclose");
+
+ /* Create an attribute to the group with integer type */
+ aid = H5Acreate2(gid, "attr2", H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(aid, FAIL, "H5Acreate2");
+
+ /* Get the internal attribute pointer */
+ attr = (H5A_t *)H5I_object(aid);
+ CHECK(attr, NULL, "H5I_object");
+
+ /* Verify attribute version */
+ VERIFY(attr->shared->version, H5O_attr_ver_bounds[low], "H5O_attr_ver_bounds");
+
+ /* Close the attribute */
+ ret = H5Aclose(aid);
+ CHECK(ret, FAIL, "H5Aclose");
+
+ /* Enable character encoding in attribute creation property list */
+ attr_cpl = H5Pcreate(H5P_ATTRIBUTE_CREATE);
+ CHECK(attr_cpl, FAIL, "H5Pcreate");
+ ret = H5Pset_char_encoding(attr_cpl, H5T_CSET_UTF8);
+ CHECK(ret, FAIL, "H5Pset_char_encoding");
+
+ /* Attach an attribute to the group with character encoding set */
+ aid = H5Acreate2(gid, "attr3", H5T_NATIVE_INT, sid, attr_cpl, H5P_DEFAULT);
+ CHECK(aid, FAIL, "H5Acreate2");
+
+ /* Get internal attribute pointer */
+ attr = (H5A_t *)H5I_object(aid);
+ CHECK(attr, NULL, "H5I_object");
+
+ /* Verify attribute version */
+ if(low == H5F_LIBVER_EARLIEST)
+ /* The earliest version the library can set for an attribute with character encoding is 3 */
+ VERIFY(attr->shared->version, H5O_ATTR_VERSION_3, "H5O_attr_ver_bounds");
+ else
+ VERIFY(attr->shared->version, H5O_attr_ver_bounds[low], "H5O_attr_ver_bounds");
+
+ /* Close the attribute */
+ ret = H5Aclose(aid);
+ CHECK(ret, FAIL, "H5Aclose");
+
+ /* Close the attribute creation property list */
+ ret = H5Pclose(attr_cpl);
+ CHECK(ret, FAIL, "H5Pclose");
+
+ /* Close the group */
+ ret = H5Gclose(gid);
+ CHECK(ret, FAIL, "H5Gclose");
+
+ /* Close the dataspace */
+ ret = H5Sclose(sid);
+ CHECK(ret, FAIL, "H5Sclose");
+
+ /* Close the datatype */
+ ret = H5Tclose(tid);
+ CHECK(ret, FAIL, "H5Tclose");
+
+ /* Close the file */
+ ret = H5Fclose(fid);
+ CHECK(ret, FAIL, "H5Fclose");
+
+ /* Create a copy of the file creation property list */
+ fcpl = H5Pcreate(H5P_FILE_CREATE);
+ CHECK(fcpl, FAIL, "H5Pcreate");
+
+ /* Enable shared datatype message */
+ ret = H5Pset_shared_mesg_nindexes(fcpl, 1);
+ CHECK(ret, FAIL, "H5Pset_shared_mesg_nindexes");
+ ret = H5Pset_shared_mesg_index(fcpl, 0, H5O_SHMESG_DTYPE_FLAG, 2);
+ CHECK(ret, FAIL, "H5Pset_shared_mesg_index");
+
+ /* Create the file with shared datatype message enabled */
+ fid = H5Fcreate(FILE8, H5F_ACC_TRUNC, fcpl, fapl);
+ CHECK(fid, FAIL, "H5Fcreate");
+
+ /* Create an integer datatye */
+ tid = H5Tcopy(H5T_NATIVE_INT);
+ CHECK(tid, FAIL, "H5Tcopy");
+
+ /* Create dataspace */
+ sid = H5Screate(H5S_SCALAR);
+ CHECK(sid, FAIL, "H5Screate");
+
+ /* Create a group */
+ gid = H5Gcreate2(fid, GRP_NAME, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(gid, FAIL, "H5Gcreate2");
+
+ /* Attach an attribute to the group with shared integer datatype */
+ aid = H5Acreate2(gid, ATTR_NAME, tid, sid, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(aid, FAIL, "H5Acreate2");
+
+ /* Get the internal attribute pointer */
+ attr = (H5A_t *)H5I_object(aid);
+ CHECK(attr, NULL, "H5I_object");
+
+ /* Verify the attribute version */
+ if(low == H5F_LIBVER_EARLIEST)
+ /* The earliest version the library can set for an attribute with shared datatype is 2 */
+ VERIFY(attr->shared->version, H5O_ATTR_VERSION_2, "H5O_attr_ver_bounds");
+ else
+ VERIFY(attr->shared->version, H5O_attr_ver_bounds[low], "H5O_attr_ver_bounds");
+
+ /* Close the attribute */
+ ret = H5Aclose(aid);
+ CHECK(ret, FAIL, "H5Aclose");
+
+ /* Close the group */
+ ret = H5Gclose(gid);
+ CHECK(ret, FAIL, "H5Gclose");
+
+ /* Close the dataspace */
+ ret = H5Sclose(sid);
+ CHECK(ret, FAIL, "H5Sclose");
+
+ /* Close the datatype */
+ ret = H5Tclose(tid);
+ CHECK(ret, FAIL, "H5Tclose");
+
+ /* Close the file */
+ ret = H5Fclose(fid);
+ CHECK(ret, FAIL, "H5Fclose");
+
+ /* Create a default file access property list */
+ new_fapl = H5Pcreate(H5P_FILE_ACCESS);
+ CHECK(new_fapl, FAIL, "H5Pcreate");
+
+ /* Create a scalar dataspace to be used later for the attribute */
+ sid = H5Screate(H5S_SCALAR);
+ CHECK(sid, FAIL, "H5Screate");
+
+ /* Loop through all the combinations of low/high bounds */
+ /* Open the file and group and attach an attribute to the group */
+ /* Verify the attribute version */
+ for(low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; low++) {
+ for(high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; high++) {
+ H5E_BEGIN_TRY {
+ ret = H5Pset_libver_bounds(new_fapl, low, high);
+ } H5E_END_TRY;
+
+ if(ret < 0) /* Invalid low/high combinations */
+ continue;
+
+ /* Open the file */
+ H5E_BEGIN_TRY {
+ fid = H5Fopen(FILE8, H5F_ACC_RDWR, new_fapl);
+ } H5E_END_TRY;
+
+ if(fid >=0 ) { /* The file open succeeds */
+
+ /* Get the internal file pointer */
+ f = (H5F_t *)H5I_object(fid);
+ CHECK(f, NULL, "H5I_object");
+
+ /* Open the group */
+ gid = H5Gopen2(fid, GRP_NAME, H5P_DEFAULT);
+ CHECK(gid, FAIL, "H5Gopen2");
+
+ /* Attach an attribute to the group */
+ aid = H5Acreate2(gid, "attr1", H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(aid, FAIL, "H5Acreate2");
+
+ /* Get the internal attribute pointer */
+ attr = (H5A_t *)H5I_object(aid);
+ CHECK(attr, NULL, "H5I_object");
+
+ /* Verify the attribute message version */
+ VERIFY(attr->shared->version, H5O_attr_ver_bounds[f->shared->low_bound], "H5O_attr_ver_bounds");
+
+ /* Close the attribute */
+ ret = H5Aclose(aid);
+ CHECK(ret, FAIL, "H5Aclose");
+
+ /* Delete the attribute */
+ ret = H5Adelete(gid, "attr1");
+ CHECK(ret, FAIL, "H5Adelete");
+
+ /* Close the group */
+ ret = H5Gclose(gid);
+ CHECK(ret, FAIL, "H5Gclose");
+
+ /* Close the file */
+ ret = H5Fclose(fid);
+ CHECK(ret, FAIL, "H5Fclose");
+
+ } /* end if */
+ } /* end for */
+ } /* end for */
+
+ /* Close the file access property list */
+ ret = H5Pclose(new_fapl);
+ CHECK(ret, FAIL, "H5Pclose");
+
+ /* Close the dataspace */
+ ret = H5Sclose(sid);
+ CHECK(ret, FAIL, "H5Sclose");
+
+} /* end test_libver_bounds_attributes() */
+
/****************************************************************
**
** test_libver_macros():
-** Verify that H5_VERSION_GE and H5_VERSION_LE work correactly.
+** Verify that H5_VERSION_GE and H5_VERSION_LE work correactly.
**
****************************************************************/
static void
@@ -4989,7 +6863,7 @@ test_libver_macros(void)
/****************************************************************
**
** test_libver_macros2():
-** Verify that H5_VERSION_GE works correactly and show how
+** Verify that H5_VERSION_GE works correactly and show how
** to use it.
**
****************************************************************/
@@ -5022,9 +6896,9 @@ test_libver_macros2(void)
ret = H5Gclose(grp);
CHECK(ret, FAIL, "H5Gclose");
- /*
+ /*
* Delete the group using different function based on the library version.
- * And verify the action.
+ * And verify the action.
*/
#if H5_VERSION_GE(1,8,0)
ret = H5Ldelete(file, "Group", H5P_DEFAULT);
@@ -5053,7 +6927,7 @@ test_libver_macros2(void)
/****************************************************************
**
** test_deprec():
-** Test deprecated functionality.
+** Test deprecated functionality.
**
****************************************************************/
#ifndef H5_NO_DEPRECATED_SYMBOLS
@@ -5069,7 +6943,7 @@ test_deprec(void)
unsigned freelist; /* Free list version # */
unsigned stab; /* Symbol table entry version # */
unsigned shhdr; /* Shared object header version # */
- H5F_info1_t finfo; /* global information about file */
+ H5F_info1_t finfo; /* global information about file */
herr_t ret; /* Generic return value */
/* Output message about test being performed */
@@ -5285,7 +7159,7 @@ test_deprec(void)
void
test_file(void)
{
- const char *env_h5_drvr; /* File Driver value from environment */
+ const char *env_h5_drvr; /* File Driver value from environment */
/* Output message about test being performed */
MESSAGE(5, ("Testing Low-Level File I/O\n"));
@@ -5333,6 +7207,7 @@ test_file(void)
test_filespace_round_compatible(); /* Testing file space compatibility for files from trunk to 1_8 to trunk */
test_filespace_1_10_0_compatible(); /* Testing file space compatibility for files from release 1.10.0 */
test_libver_bounds(); /* Test compatibility for file space management */
+ test_libver_bounds_low_high();
test_libver_macros(); /* Test the macros for library version comparison */
test_libver_macros2(); /* Test the macros for library version comparison */
#ifndef H5_NO_DEPRECATED_SYMBOLS
@@ -5340,15 +7215,15 @@ test_file(void)
#endif /* H5_NO_DEPRECATED_SYMBOLS */
} /* test_file() */
-
+
/*-------------------------------------------------------------------------
- * Function: cleanup_file
+ * Function: cleanup_file
*
- * Purpose: Cleanup temporary test files
+ * Purpose: Cleanup temporary test files
*
- * Return: none
+ * Return: none
*
- * Programmer: Albert Cheng
+ * Programmer: Albert Cheng
* July 2, 1998
*
* Modifications:
diff --git a/test/tgenprop.c b/test/tgenprop.c
index 0e6b5c9..5031846 100644
--- a/test/tgenprop.c
+++ b/test/tgenprop.c
@@ -13,21 +13,21 @@
/***********************************************************
*
-* Test program: tgenprop
+* Test program: tgenprop
*
* Test the Generic Property functionality
*
*************************************************************/
-#define H5P_FRIEND /*suppress error about including H5Ppkg */
+#define H5P_FRIEND /*suppress error about including H5Ppkg */
/* Define this macro to indicate that the testing APIs should be available */
#define H5P_TESTING
#include "testhdf5.h"
-#include "hdf5.h"
+
#include "H5Dprivate.h" /* For Dataset creation property list names */
-#include "H5Ppkg.h" /* Generic Properties */
+#include "H5Ppkg.h" /* Generic Properties */
#define FILENAME "tgenprop.h5"
@@ -80,11 +80,11 @@ typedef struct count_data_t {
static void
test_genprop_basic_class(void)
{
- hid_t cid1; /* Generic Property class ID */
- hid_t cid2; /* Generic Property class ID */
- hid_t cid3; /* Generic Property class ID */
+ hid_t cid1; /* Generic Property class ID */
+ hid_t cid2; /* Generic Property class ID */
+ hid_t cid3; /* Generic Property class ID */
char *name; /* Name of class */
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing Basic Generic Property List Class Creation Functionality\n"));
@@ -169,10 +169,10 @@ test_genprop_basic_class(void)
static void
test_genprop_basic_class_prop(void)
{
- hid_t cid1; /* Generic Property class ID */
- size_t size; /* Size of property */
- size_t nprops; /* Number of properties in class */
- herr_t ret; /* Generic return value */
+ hid_t cid1; /* Generic Property class ID */
+ size_t size; /* Size of property */
+ size_t nprops; /* Number of properties in class */
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing Basic Generic Property List Class Properties Functionality\n"));
@@ -311,8 +311,8 @@ test_genprop_iter1(hid_t H5_ATTR_UNUSED id, const char *name,
static void
test_genprop_class_iter(void)
{
- hid_t cid1; /* Generic Property class ID */
- size_t nprops; /* Number of properties in class */
+ hid_t cid1; /* Generic Property class ID */
+ size_t nprops; /* Number of properties in class */
int idx; /* Index to start iteration at */
struct { /* Struct for iterations */
int iter_count;
@@ -323,7 +323,7 @@ test_genprop_class_iter(void)
PROP2_NAME,
PROP3_NAME,
PROP4_NAME};
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing Basic Generic Property List Class Property Iteration Functionality\n"));
@@ -417,17 +417,17 @@ test_genprop_cls_cls_cb1(hid_t list_id, void *create_data)
static void
test_genprop_class_callback(void)
{
- hid_t cid1; /* Generic Property class ID */
- hid_t cid2; /* Generic Property class ID */
- hid_t lid1; /* Generic Property list ID */
- hid_t lid2; /* Generic Property list ID */
- hid_t lid3; /* Generic Property list ID */
- size_t nprops; /* Number of properties in class */
+ hid_t cid1; /* Generic Property class ID */
+ hid_t cid2; /* Generic Property class ID */
+ hid_t lid1; /* Generic Property list ID */
+ hid_t lid2; /* Generic Property list ID */
+ hid_t lid3; /* Generic Property list ID */
+ size_t nprops; /* Number of properties in class */
struct { /* Struct for callbacks */
int count;
hid_t id;
} crt_cb_struct, cpy_cb_struct, cls_cb_struct;
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing Basic Generic Property List Class Callback Functionality\n"));
@@ -596,14 +596,14 @@ test_genprop_class_callback(void)
static void
test_genprop_basic_list(void)
{
- hid_t cid1; /* Generic Property class ID */
- hid_t cid2; /* Generic Property class ID */
- hid_t lid1; /* Generic Property list ID */
- size_t nprops; /* Number of properties */
- size_t size; /* Size of property */
+ hid_t cid1; /* Generic Property class ID */
+ hid_t cid2; /* Generic Property class ID */
+ hid_t lid1; /* Generic Property list ID */
+ size_t nprops; /* Number of properties */
+ size_t size; /* Size of property */
int prop1_value; /* Value for property #1 */
float prop2_value; /* Value for property #2 */
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing Basic Generic Property List Creation Functionality\n"));
@@ -678,8 +678,8 @@ test_genprop_basic_list(void)
CHECK_I(ret, "H5Pget");
/* Verify the floating-poing value in this way to avoid compiler warning. */
if(!H5_FLT_ABS_EQUAL(prop2_value,*PROP2_DEF_VALUE))
- printf("*** UNEXPECTED VALUE from %s should be %f, but is %f at line %4d in %s\n",
- "H5Pget", (double)*PROP2_DEF_VALUE, (double)prop2_value, (int)__LINE__, __FILE__);
+ printf("*** UNEXPECTED VALUE from %s should be %f, but is %f at line %4d in %s\n",
+ "H5Pget", (double)*PROP2_DEF_VALUE, (double)prop2_value, (int)__LINE__, __FILE__);
/* Close list */
@@ -702,14 +702,14 @@ test_genprop_basic_list(void)
static void
test_genprop_basic_list_prop(void)
{
- hid_t cid1; /* Generic Property class ID */
- hid_t lid1; /* Generic Property list ID */
- size_t nprops; /* Number of properties */
+ hid_t cid1; /* Generic Property class ID */
+ hid_t lid1; /* Generic Property list ID */
+ size_t nprops; /* Number of properties */
int prop1_value; /* Value for property #1 */
float prop2_value; /* Value for property #2 */
char prop3_value[10];/* Property #3 value */
double prop4_value; /* Property #4 value */
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing Basic Generic Property List Property Functionality\n"));
@@ -770,8 +770,8 @@ test_genprop_basic_list_prop(void)
CHECK_I(ret, "H5Pget");
/* Verify the floating-poing value in this way to avoid compiler warning. */
if(!H5_FLT_ABS_EQUAL(prop2_value,*PROP2_DEF_VALUE))
- printf("*** UNEXPECTED VALUE from %s should be %f, but is %f at line %4d in %s\n",
- "H5Pget", (double)*PROP2_DEF_VALUE, (double)prop2_value, (int)__LINE__, __FILE__);
+ printf("*** UNEXPECTED VALUE from %s should be %f, but is %f at line %4d in %s\n",
+ "H5Pget", (double)*PROP2_DEF_VALUE, (double)prop2_value, (int)__LINE__, __FILE__);
/* Check values of temporary properties (set with regular values) */
@@ -783,8 +783,8 @@ test_genprop_basic_list_prop(void)
CHECK_I(ret, "H5Pget");
/* Verify the floating-poing value in this way to avoid compiler warning. */
if(!H5_DBL_ABS_EQUAL(prop4_value, *PROP4_DEF_VALUE))
- printf("*** UNEXPECTED VALUE from %s should be %f, but is %f at line %4d in %s\n",
- "H5Pget", *PROP4_DEF_VALUE, prop4_value, (int)__LINE__, __FILE__);
+ printf("*** UNEXPECTED VALUE from %s should be %f, but is %f at line %4d in %s\n",
+ "H5Pget", *PROP4_DEF_VALUE, prop4_value, (int)__LINE__, __FILE__);
/* Delete permanent property */
ret = H5Premove(lid1, PROP2_NAME);
@@ -820,8 +820,8 @@ test_genprop_basic_list_prop(void)
CHECK_I(ret, "H5Pget");
/* Verify the floating-poing value in this way to avoid compiler warning. */
if(!H5_DBL_ABS_EQUAL(prop4_value, *PROP4_DEF_VALUE))
- printf("*** UNEXPECTED VALUE from %s should be %f, but is %f at line %4d in %s\n",
- "H5Pget", *PROP4_DEF_VALUE, prop4_value, (int)__LINE__, __FILE__);
+ printf("*** UNEXPECTED VALUE from %s should be %f, but is %f at line %4d in %s\n",
+ "H5Pget", *PROP4_DEF_VALUE, prop4_value, (int)__LINE__, __FILE__);
/* Close list */
ret = H5Pclose(lid1);
@@ -856,9 +856,9 @@ test_genprop_iter2(hid_t H5_ATTR_UNUSED id, const char *name,
static void
test_genprop_list_iter(void)
{
- hid_t cid1; /* Generic Property class ID */
- hid_t lid1; /* Generic Property list ID */
- size_t nprops; /* Number of properties */
+ hid_t cid1; /* Generic Property class ID */
+ hid_t lid1; /* Generic Property list ID */
+ size_t nprops; /* Number of properties */
int idx; /* Index to start iteration at */
struct { /* Struct for iterations */
int iter_count;
@@ -870,7 +870,7 @@ test_genprop_list_iter(void)
PROP1_NAME,
PROP2_NAME
};
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing Generic Property List Iteration Functionality\n"));
@@ -1144,10 +1144,10 @@ test_genprop_prop_del_cb2(hid_t plist_id, const char *name, size_t size, void *v
static void
test_genprop_list_callback(void)
{
- hid_t cid1; /* Generic Property class ID */
- hid_t lid1; /* Generic Property list ID */
- hid_t lid2; /* 2nd Generic Property list ID */
- size_t nprops; /* Number of properties in class */
+ hid_t cid1; /* Generic Property class ID */
+ hid_t lid1; /* Generic Property list ID */
+ hid_t lid2; /* 2nd Generic Property list ID */
+ size_t nprops; /* Number of properties in class */
int prop1_value; /* Value for property #1 */
int prop1_new_value=20; /* Property #1 new value */
float prop2_value; /* Value for property #2 */
@@ -1158,7 +1158,7 @@ test_genprop_list_callback(void)
int count;
hid_t id;
} cop_cb_struct;
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing Basic Generic Property List Property Callback Functionality\n"));
@@ -1225,8 +1225,8 @@ test_genprop_list_callback(void)
CHECK_I(ret, "H5Pget");
/* Verify the floating-poing value in this way to avoid compiler warning. */
if(!H5_FLT_ABS_EQUAL(prop2_value,*PROP2_DEF_VALUE))
- printf("*** UNEXPECTED VALUE from %s should be %f, but is %f at line %4d in %s\n",
- "H5Pget", (double)*PROP2_DEF_VALUE, (double)prop2_value, (int)__LINE__, __FILE__);
+ printf("*** UNEXPECTED VALUE from %s should be %f, but is %f at line %4d in %s\n",
+ "H5Pget", (double)*PROP2_DEF_VALUE, (double)prop2_value, (int)__LINE__, __FILE__);
/* Check values of temporary properties (set with regular values) */
ret = H5Pget(lid1, PROP3_NAME,&prop3_value);
@@ -1240,8 +1240,8 @@ test_genprop_list_callback(void)
CHECK_I(ret, "H5Pget");
/* Verify the floating-poing value in this way to avoid compiler warning. */
if(!H5_DBL_ABS_EQUAL(prop4_value, *PROP4_DEF_VALUE))
- printf("*** UNEXPECTED VALUE from %s should be %f, but is %f at line %4d in %s\n",
- "H5Pget", *PROP4_DEF_VALUE, prop4_value, (int)__LINE__, __FILE__);
+ printf("*** UNEXPECTED VALUE from %s should be %f, but is %f at line %4d in %s\n",
+ "H5Pget", *PROP4_DEF_VALUE, prop4_value, (int)__LINE__, __FILE__);
/* Verify get callback information for properties tracked */
VERIFY(prop1_cb_info.get_count, 1, "H5Pget");
@@ -1373,7 +1373,7 @@ test_genprop_list_addprop(void)
hid_t sid; /* Dataspace ID */
hid_t pid; /* Property List ID */
int prop1_value; /* Value for property #1 */
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
/* Create file */
fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
@@ -1448,7 +1448,7 @@ test_genprop_class_addprop(void)
hid_t cid; /* Property Class ID */
hid_t pid; /* Property List ID */
int prop1_value; /* Value for property #1 */
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
/* Create file */
fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
@@ -1570,7 +1570,7 @@ static void
test_genprop_list_add_remove_prop(void)
{
hid_t pid; /* Property List ID */
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
/* Create a dataset creation property list */
pid = H5Pcreate(H5P_DATASET_CREATE);
@@ -1607,11 +1607,11 @@ test_genprop_list_add_remove_prop(void)
static void
test_genprop_equal(void)
{
- hid_t cid1; /* Generic Property class ID */
- hid_t lid1; /* Generic Property list ID */
- hid_t lid2; /* Generic Property list ID */
+ hid_t cid1; /* Generic Property class ID */
+ hid_t lid1; /* Generic Property list ID */
+ hid_t lid2; /* Generic Property list ID */
int prop1_new_value = 20; /* Property #1 new value */
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing Basic Generic Property List Equal Functionality\n"));
@@ -1756,11 +1756,11 @@ test_genprop_equal(void)
static void
test_genprop_path(void)
{
- hid_t cid1; /* Generic Property class ID */
- hid_t cid2; /* Generic Property class ID */
- hid_t cid3; /* Generic Property class ID */
+ hid_t cid1; /* Generic Property class ID */
+ hid_t cid2; /* Generic Property class ID */
+ hid_t cid3; /* Generic Property class ID */
char *path; /* Class path */
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing Generic Property List Class Path Functionality\n"));
@@ -1828,10 +1828,10 @@ test_genprop_path(void)
static void
test_genprop_refcount(void)
{
- hid_t cid1; /* Generic Property class ID */
- hid_t lid1; /* Generic Property class ID */
+ hid_t cid1; /* Generic Property class ID */
+ hid_t lid1; /* Generic Property class ID */
char *name; /* Name of class */
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing Generic Property List Reference Count Functionality\n"));
@@ -1901,10 +1901,10 @@ test_genprop_refcount(void)
static void
test_genprop_deprec_class(void)
{
- hid_t cid1; /* Generic Property class ID */
- size_t size; /* Size of property */
- size_t nprops; /* Number of properties in class */
- herr_t ret; /* Generic return value */
+ hid_t cid1; /* Generic Property class ID */
+ size_t size; /* Size of property */
+ size_t nprops; /* Number of properties in class */
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing Deprecated Generic Property List Functions\n"));
@@ -2034,7 +2034,7 @@ test_genprop_deprec_list(void)
hid_t sid; /* Dataspace ID */
hid_t pid; /* Property List ID */
int prop1_value; /* Value for property #1 */
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
/* Create file */
fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
@@ -2130,15 +2130,15 @@ test_genprop(void)
} /* test_genprop() */
-
+
/*-------------------------------------------------------------------------
- * Function: cleanup_genprop
+ * Function: cleanup_genprop
*
- * Purpose: Cleanup temporary test files
+ * Purpose: Cleanup temporary test files
*
- * Return: none
+ * Return: none
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* June 8, 1999
*
* Modifications:
diff --git a/test/th5o.c b/test/th5o.c
index 144ea4c..00d706c 100644
--- a/test/th5o.c
+++ b/test/th5o.c
@@ -774,7 +774,7 @@ test_h5o_link(void)
hid_t lcpl_id=-1;
hsize_t dims[2] = {TEST6_DIM1, TEST6_DIM2};
htri_t committed; /* Whether the named datatype is committed */
- unsigned new_format; /* Whether to use the new format or not */
+ H5F_libver_t low, high; /* File format bounds */
int *wdata;
int *rdata;
int i, n;
@@ -801,98 +801,103 @@ test_h5o_link(void)
ret = H5Pset_create_intermediate_group(lcpl_id, TRUE);
CHECK(ret, FAIL, "H5Pset_create_intermediate_group");
- /* Loop over using new group format */
- for(new_format = FALSE; new_format <= TRUE; new_format++) {
-
- /* Make a FAPL that uses the "use the latest version of the format" bounds */
- fapl_id = H5Pcreate(H5P_FILE_ACCESS);
- CHECK(fapl_id, FAIL, "H5Pcreate");
-
- /* Set the "use the latest version of the format" bounds for creating objects in the file */
- ret = H5Pset_libver_bounds(fapl_id, (new_format ? H5F_LIBVER_LATEST : H5F_LIBVER_EARLIEST), H5F_LIBVER_LATEST);
- CHECK(ret, FAIL, "H5Pset_libver_bounds");
-
- /* Create a new HDF5 file */
- file_id = H5Fcreate(TEST_FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id);
- CHECK(file_id, FAIL, "H5Fcreate");
-
- /* Close the FAPL */
- ret = H5Pclose(fapl_id);
- CHECK(ret, FAIL, "H5Pclose");
-
-
- /* Create and commit a datatype with no name */
- type_id = H5Tcopy(H5T_NATIVE_INT);
- CHECK(type_id, FAIL, "H5Fcreate");
- ret = H5Tcommit_anon(file_id, type_id, H5P_DEFAULT, H5P_DEFAULT);
- CHECK(ret, FAIL, "H5Tcommit_anon");
- committed = H5Tcommitted(type_id);
- VERIFY(committed, TRUE, "H5Tcommitted");
-
- /* Create a dataset with no name using the committed datatype*/
- dset_id = H5Dcreate_anon(file_id, type_id, space_id, H5P_DEFAULT, H5P_DEFAULT);
- CHECK(dset_id, FAIL, "H5Dcreate_anon");
-
- /* Verify that we can write to and read from the dataset */
-
- /* Write the data to the dataset */
- ret = H5Dwrite(dset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata);
- CHECK(ret, FAIL, "H5Dwrite");
-
- /* Read the data back */
- ret = H5Dread(dset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rdata);
- CHECK(ret, FAIL, "H5Dread");
-
- /* Verify the data */
- for(i = 0; i < (TEST6_DIM1 * TEST6_DIM2); i++)
- VERIFY(wdata[i], rdata[i], "H5Dread");
-
- /* Create a group with no name*/
- group_id = H5Gcreate_anon(file_id, H5P_DEFAULT, H5P_DEFAULT);
- CHECK(group_id, FAIL, "H5Gcreate_anon");
-
- /* Link nameless datatype into nameless group */
- ret = H5Olink(type_id, group_id, "datatype", H5P_DEFAULT, H5P_DEFAULT);
- CHECK(ret, FAIL, "H5Olink");
-
- /* Link nameless dataset into nameless group with intermediate group */
- ret = H5Olink(dset_id, group_id, "inter_group/dataset", lcpl_id, H5P_DEFAULT);
- CHECK(ret, FAIL, "H5Olink");
-
- /* Close IDs for dataset and datatype */
- ret = H5Dclose(dset_id);
- CHECK(ret, FAIL, "H5Dclose");
- ret = H5Tclose(type_id);
- CHECK(ret, FAIL, "H5Tclose");
-
- /* Re-open datatype using new link */
- type_id = H5Topen2(group_id, "datatype", H5P_DEFAULT);
- CHECK(type_id, FAIL, "H5Topen2");
-
- /* Link nameless group to root group and close the group ID*/
- ret = H5Olink(group_id, file_id, "/group", H5P_DEFAULT, H5P_DEFAULT);
- CHECK(ret, FAIL, "H5Olink");
- ret = H5Gclose(group_id);
- CHECK(ret, FAIL, "H5Gclose");
-
- /* Open dataset through root group and verify its data */
- dset_id = H5Dopen2(file_id, "/group/inter_group/dataset", H5P_DEFAULT);
- CHECK(dset_id, FAIL, "H5Dopen2");
-
- /* Read data from dataset */
- ret = H5Dread(dset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rdata);
- CHECK(ret, FAIL, "H5Dread");
- for(i = 0; i < (TEST6_DIM1 * TEST6_DIM2); i++)
- VERIFY(wdata[i], rdata[i], "H5Dread");
-
- /* Close open IDs */
- ret = H5Dclose(dset_id);
- CHECK(ret, FAIL, "H5Dclose");
- ret = H5Tclose(type_id);
- CHECK(ret, FAIL, "H5Tclose");
- ret = H5Fclose(file_id);
- CHECK(ret, FAIL, "H5Fclose");
- } /* end for */
+ /* Create a file access property list */
+ fapl_id = H5Pcreate(H5P_FILE_ACCESS);
+ CHECK(fapl_id, FAIL, "H5Pcreate");
+
+ /* Loop through all the combinations of low/high library format bounds */
+ for(low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; low++) {
+ for(high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; high++) {
+
+ /* Set version bounds */
+ H5E_BEGIN_TRY {
+ ret = H5Pset_libver_bounds(fapl_id, low, high);
+ } H5E_END_TRY;
+
+ if (ret < 0) /* Invalid low/high combinations */
+ continue;
+
+ /* Create a new HDF5 file */
+ file_id = H5Fcreate(TEST_FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id);
+ CHECK(file_id, FAIL, "H5Fcreate");
+
+ /* Close the FAPL */
+ ret = H5Pclose(fapl_id);
+ CHECK(ret, FAIL, "H5Pclose");
+
+ /* Create and commit a datatype with no name */
+ type_id = H5Tcopy(H5T_NATIVE_INT);
+ CHECK(type_id, FAIL, "H5Fcreate");
+ ret = H5Tcommit_anon(file_id, type_id, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(ret, FAIL, "H5Tcommit_anon");
+ committed = H5Tcommitted(type_id);
+ VERIFY(committed, TRUE, "H5Tcommitted");
+
+ /* Create a dataset with no name using the committed datatype*/
+ dset_id = H5Dcreate_anon(file_id, type_id, space_id, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(dset_id, FAIL, "H5Dcreate_anon");
+
+ /* Verify that we can write to and read from the dataset */
+
+ /* Write the data to the dataset */
+ ret = H5Dwrite(dset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata);
+ CHECK(ret, FAIL, "H5Dwrite");
+
+ /* Read the data back */
+ ret = H5Dread(dset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rdata);
+ CHECK(ret, FAIL, "H5Dread");
+
+ /* Verify the data */
+ for(i = 0; i < (TEST6_DIM1 * TEST6_DIM2); i++)
+ VERIFY(wdata[i], rdata[i], "H5Dread");
+
+ /* Create a group with no name*/
+ group_id = H5Gcreate_anon(file_id, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(group_id, FAIL, "H5Gcreate_anon");
+
+ /* Link nameless datatype into nameless group */
+ ret = H5Olink(type_id, group_id, "datatype", H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(ret, FAIL, "H5Olink");
+
+ /* Link nameless dataset into nameless group with intermediate group */
+ ret = H5Olink(dset_id, group_id, "inter_group/dataset", lcpl_id, H5P_DEFAULT);
+ CHECK(ret, FAIL, "H5Olink");
+
+ /* Close IDs for dataset and datatype */
+ ret = H5Dclose(dset_id);
+ CHECK(ret, FAIL, "H5Dclose");
+ ret = H5Tclose(type_id);
+ CHECK(ret, FAIL, "H5Tclose");
+
+ /* Re-open datatype using new link */
+ type_id = H5Topen2(group_id, "datatype", H5P_DEFAULT);
+ CHECK(type_id, FAIL, "H5Topen2");
+
+ /* Link nameless group to root group and close the group ID*/
+ ret = H5Olink(group_id, file_id, "/group", H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(ret, FAIL, "H5Olink");
+ ret = H5Gclose(group_id);
+ CHECK(ret, FAIL, "H5Gclose");
+
+ /* Open dataset through root group and verify its data */
+ dset_id = H5Dopen2(file_id, "/group/inter_group/dataset", H5P_DEFAULT);
+ CHECK(dset_id, FAIL, "H5Dopen2");
+
+ /* Read data from dataset */
+ ret = H5Dread(dset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rdata);
+ CHECK(ret, FAIL, "H5Dread");
+ for(i = 0; i < (TEST6_DIM1 * TEST6_DIM2); i++)
+ VERIFY(wdata[i], rdata[i], "H5Dread");
+
+ /* Close open IDs */
+ ret = H5Dclose(dset_id);
+ CHECK(ret, FAIL, "H5Dclose");
+ ret = H5Tclose(type_id);
+ CHECK(ret, FAIL, "H5Tclose");
+ ret = H5Fclose(file_id);
+ CHECK(ret, FAIL, "H5Fclose");
+ } /* for high */
+ } /* for low */
/* Close remaining IDs */
ret = H5Sclose(space_id);
diff --git a/test/th5s.c b/test/th5s.c
index c63320a..0b0a2e7 100644
--- a/test/th5s.c
+++ b/test/th5s.c
@@ -13,7 +13,7 @@
/***********************************************************
*
-* Test program: th5s
+* Test program: th5s
*
* Test the dataspace functionality
*
@@ -22,7 +22,25 @@
#include "testhdf5.h"
#include "H5srcdir.h"
-#include "H5private.h"
+#include "H5Bprivate.h"
+#include "H5Iprivate.h"
+#include "H5Pprivate.h"
+
+/*
+ * This file needs to access private information from the H5S package.
+ * This file also needs to access the dataspace testing code.
+ */
+#define H5S_FRIEND /*suppress error about including H5Spkg */
+#include "H5Spkg.h" /* Dataspaces */
+
+/*
+ * This file needs to access private information from the H5O package.
+ * This file also needs to access the dataspace testing code.
+ */
+#define H5O_FRIEND /*suppress error about including H5Opkg */
+#define H5O_TESTING
+#include "H5Opkg.h" /* Object header */
+
#include "H5Bprivate.h"
#include "H5Sprivate.h"
#include "H5Pprivate.h"
@@ -43,31 +61,31 @@
#define EXTFILE_NAME "ext_file"
/* 3-D dataset with fixed dimensions */
-#define SPACE1_RANK 3
-#define SPACE1_DIM1 3
-#define SPACE1_DIM2 15
-#define SPACE1_DIM3 13
+#define SPACE1_RANK 3
+#define SPACE1_DIM1 3
+#define SPACE1_DIM2 15
+#define SPACE1_DIM3 13
/* 4-D dataset with one unlimited dimension */
-#define SPACE2_RANK 4
-#define SPACE2_DIM1 0
-#define SPACE2_DIM2 15
-#define SPACE2_DIM3 13
-#define SPACE2_DIM4 23
-#define SPACE2_MAX1 H5S_UNLIMITED
-#define SPACE2_MAX2 15
-#define SPACE2_MAX3 13
-#define SPACE2_MAX4 23
+#define SPACE2_RANK 4
+#define SPACE2_DIM1 0
+#define SPACE2_DIM2 15
+#define SPACE2_DIM3 13
+#define SPACE2_DIM4 23
+#define SPACE2_MAX1 H5S_UNLIMITED
+#define SPACE2_MAX2 15
+#define SPACE2_MAX3 13
+#define SPACE2_MAX4 23
/* Scalar dataset with simple datatype */
-#define SPACE3_RANK 0
+#define SPACE3_RANK 0
unsigned space3_data=65;
/* Scalar dataset with compound datatype */
-#define SPACE4_FIELDNAME1 "c1"
-#define SPACE4_FIELDNAME2 "u"
-#define SPACE4_FIELDNAME3 "f"
-#define SPACE4_FIELDNAME4 "c2"
+#define SPACE4_FIELDNAME1 "c1"
+#define SPACE4_FIELDNAME2 "u"
+#define SPACE4_FIELDNAME3 "f"
+#define SPACE4_FIELDNAME4 "c2"
size_t space4_field1_off=0;
size_t space4_field2_off=0;
size_t space4_field3_off=0;
@@ -87,21 +105,21 @@ struct space4_struct {
static void
test_h5s_basic(void)
{
- hid_t fid1; /* HDF5 File IDs */
- hid_t sid1, sid2; /* Dataspace ID */
- hid_t dset1; /* Dataset ID */
+ hid_t fid1; /* HDF5 File IDs */
+ hid_t sid1, sid2; /* Dataspace ID */
+ hid_t dset1; /* Dataset ID */
hid_t aid1; /* Attribute ID */
- int rank; /* Logical rank of dataspace */
- hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3};
- hsize_t dims2[] = {SPACE2_DIM1, SPACE2_DIM2, SPACE2_DIM3,
- SPACE2_DIM4};
- hsize_t dims3[H5S_MAX_RANK+1];
- hsize_t max2[] = {SPACE2_MAX1, SPACE2_MAX2, SPACE2_MAX3,
- SPACE2_MAX4};
- hsize_t tdims[4]; /* Dimension array to test with */
- hsize_t tmax[4];
- hssize_t n; /* Number of dataspace elements */
- herr_t ret; /* Generic return value */
+ int rank; /* Logical rank of dataspace */
+ hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3};
+ hsize_t dims2[] = {SPACE2_DIM1, SPACE2_DIM2, SPACE2_DIM3,
+ SPACE2_DIM4};
+ hsize_t dims3[H5S_MAX_RANK+1];
+ hsize_t max2[] = {SPACE2_MAX1, SPACE2_MAX2, SPACE2_MAX3,
+ SPACE2_MAX4};
+ hsize_t tdims[4]; /* Dimension array to test with */
+ hsize_t tmax[4];
+ hssize_t n; /* Number of dataspace elements */
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing Dataspace Manipulation\n"));
@@ -112,7 +130,7 @@ test_h5s_basic(void)
n = H5Sget_simple_extent_npoints(sid1);
CHECK(n, FAIL, "H5Sget_simple_extent_npoints");
VERIFY(n, SPACE1_DIM1 * SPACE1_DIM2 * SPACE1_DIM3,
- "H5Sget_simple_extent_npoints");
+ "H5Sget_simple_extent_npoints");
rank = H5Sget_simple_extent_ndims(sid1);
CHECK(rank, FAIL, "H5Sget_simple_extent_ndims");
@@ -121,7 +139,7 @@ test_h5s_basic(void)
rank = H5Sget_simple_extent_dims(sid1, tdims, NULL);
CHECK(rank, FAIL, "H5Sget_simple_extent_dims");
VERIFY(HDmemcmp(tdims, dims1, SPACE1_RANK * sizeof(hsize_t)), 0,
- "H5Sget_simple_extent_dims");
+ "H5Sget_simple_extent_dims");
sid2 = H5Screate_simple(SPACE2_RANK, dims2, max2);
CHECK(sid2, FAIL, "H5Screate_simple");
@@ -129,7 +147,7 @@ test_h5s_basic(void)
n = H5Sget_simple_extent_npoints(sid2);
CHECK(n, FAIL, "H5Sget_simple_extent_npoints");
VERIFY(n, SPACE2_DIM1 * SPACE2_DIM2 * SPACE2_DIM3 * SPACE2_DIM4,
- "H5Sget_simple_extent_npoints");
+ "H5Sget_simple_extent_npoints");
rank = H5Sget_simple_extent_ndims(sid2);
CHECK(rank, FAIL, "H5Sget_simple_extent_ndims");
@@ -138,9 +156,9 @@ test_h5s_basic(void)
rank = H5Sget_simple_extent_dims(sid2, tdims, tmax);
CHECK(rank, FAIL, "H5Sget_simple_extent_dims");
VERIFY(HDmemcmp(tdims, dims2, SPACE2_RANK * sizeof(hsize_t)), 0,
- "H5Sget_simple_extent_dims");
+ "H5Sget_simple_extent_dims");
VERIFY(HDmemcmp(tmax, max2, SPACE2_RANK * sizeof(hsize_t)), 0,
- "H5Sget_simple_extent_dims");
+ "H5Sget_simple_extent_dims");
/* Change max dims to be equal to the dimensions */
ret = H5Sset_extent_simple(sid1, SPACE1_RANK, dims1, NULL);
@@ -148,9 +166,9 @@ test_h5s_basic(void)
rank = H5Sget_simple_extent_dims(sid1, tdims, tmax);
CHECK(rank, FAIL, "H5Sget_simple_extent_dims");
VERIFY(HDmemcmp(tdims, dims1, SPACE1_RANK * sizeof(hsize_t)), 0,
- "H5Sget_simple_extent_dims");
+ "H5Sget_simple_extent_dims");
VERIFY(HDmemcmp(tmax, dims1, SPACE1_RANK * sizeof(hsize_t)), 0,
- "H5Sget_simple_extent_dims");
+ "H5Sget_simple_extent_dims");
ret = H5Sclose(sid1);
CHECK(ret, FAIL, "H5Sclose");
@@ -163,7 +181,7 @@ test_h5s_basic(void)
* dimensions.
*/
H5E_BEGIN_TRY {
- sid1 = H5Screate_simple(H5S_MAX_RANK+1, dims3, NULL);
+ sid1 = H5Screate_simple(H5S_MAX_RANK+1, dims3, NULL);
} H5E_END_TRY;
VERIFY(sid1, FAIL, "H5Screate_simple");
@@ -286,7 +304,7 @@ test_h5s_basic(void)
CHECK(ret, FAIL, "H5Sclose");
ret = H5Fclose(fid1);
CHECK(ret, FAIL, "H5Fclose");
-} /* test_h5s_basic() */
+} /* test_h5s_basic() */
/****************************************************************
**
@@ -346,16 +364,16 @@ test_h5s_null(void)
hsize_t start[1]={0};
hsize_t count[1]={0};
- ret = H5Sselect_hyperslab(sid, H5S_SELECT_SET, start, NULL, count, NULL);
+ ret = H5Sselect_hyperslab(sid, H5S_SELECT_SET, start, NULL, count, NULL);
} H5E_END_TRY;
VERIFY(ret, FAIL, "H5Sselect_hyperslab");
/* Check to be sure we can't set a point selection on a null dataspace */
H5E_BEGIN_TRY {
- hsize_t coord[1][1]; /* Coordinates for point selection */
+ hsize_t coord[1][1]; /* Coordinates for point selection */
coord[0][0]=0;
- ret = H5Sselect_elements(sid, H5S_SELECT_SET, (size_t)1, (const hsize_t *)coord);
+ ret = H5Sselect_elements(sid, H5S_SELECT_SET, (size_t)1, (const hsize_t *)coord);
} H5E_END_TRY;
VERIFY(ret, FAIL, "H5Sselect_elements");
@@ -516,18 +534,18 @@ test_h5s_null(void)
static void
test_h5s_zero_dim(void)
{
- hid_t fid1; /* HDF5 File IDs */
- hid_t sid1, attr_sid; /* Dataspace ID */
- hid_t sid_chunk; /* Dataspace ID for chunked dataset */
- hid_t dset1; /* Dataset ID */
+ hid_t fid1; /* HDF5 File IDs */
+ hid_t sid1, attr_sid; /* Dataspace ID */
+ hid_t sid_chunk; /* Dataspace ID for chunked dataset */
+ hid_t dset1; /* Dataset ID */
hid_t plist_id; /* Dataset creation property list */
hid_t attr; /* Attribute ID */
- int rank; /* Logical rank of dataspace */
- hsize_t dims1[] = {0, SPACE1_DIM2, SPACE1_DIM3};
- hsize_t max_dims[] = {SPACE1_DIM1+1, SPACE1_DIM2, SPACE1_DIM3};
- hsize_t extend_dims[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3};
+ int rank; /* Logical rank of dataspace */
+ hsize_t dims1[] = {0, SPACE1_DIM2, SPACE1_DIM3};
+ hsize_t max_dims[] = {SPACE1_DIM1+1, SPACE1_DIM2, SPACE1_DIM3};
+ hsize_t extend_dims[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3};
hsize_t chunk_dims[] = {SPACE1_DIM1, SPACE1_DIM2/3, SPACE1_DIM3};
- hsize_t tdims[SPACE1_RANK]; /* Dimension array to test with */
+ hsize_t tdims[SPACE1_RANK]; /* Dimension array to test with */
int wdata[SPACE1_DIM2][SPACE1_DIM3];
int rdata[SPACE1_DIM2][SPACE1_DIM3];
short wdata_short[SPACE1_DIM2][SPACE1_DIM3];
@@ -537,12 +555,12 @@ test_h5s_zero_dim(void)
int val = 3;
hsize_t start[] = {0, 0, 0};
hsize_t count[] = {3, 15, 13};
- hsize_t coord[1][3]; /* Coordinates for point selection */
+ hsize_t coord[1][3]; /* Coordinates for point selection */
hssize_t nelem; /* Number of elements */
H5S_sel_type sel_type; /* Type of selection currently */
H5S_class_t stype; /* dataspace type */
H5D_alloc_time_t alloc_time; /* Space allocation time */
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
unsigned int i, j, k;
/* Output message about test being performed */
@@ -618,8 +636,8 @@ test_h5s_zero_dim(void)
CHECK(sid_chunk, FAIL, "H5Screate_simple");
/*============================================
- * Make sure we can use 0-dimension to create
- * contiguous, chunked, compact, and external
+ * Make sure we can use 0-dimension to create
+ * contiguous, chunked, compact, and external
* datasets, and also attribute.
*============================================
*/
@@ -683,7 +701,7 @@ test_h5s_zero_dim(void)
}
}
- /* Select a hyperslab beyond its current dimension sizes, then try to write
+ /* Select a hyperslab beyond its current dimension sizes, then try to write
* the data. It should fail. */
ret = H5Sselect_hyperslab(sid1, H5S_SELECT_SET, start, NULL, count, NULL);
CHECK(ret, FAIL, "H5Sselect_hyperslab");
@@ -697,7 +715,7 @@ test_h5s_zero_dim(void)
ret = H5Sselect_none(sid1);
CHECK(ret, FAIL, "H5Sselect_none");
- /* Select a point beyond the dimension size, then try to write the data.
+ /* Select a point beyond the dimension size, then try to write the data.
* It should fail. */
coord[0][0]=2; coord[0][1]=5; coord[0][2]=3;
ret = H5Sselect_elements(sid1, H5S_SELECT_SET, (size_t)1, (const hsize_t *)coord);
@@ -749,8 +767,8 @@ test_h5s_zero_dim(void)
}
}
- /* Now extend the dataset to SPACE1_DIM1*SPACE1_DIM2*SPACE1_DIM3 and make sure
- * we can write data to it */
+ /* Now extend the dataset to SPACE1_DIM1*SPACE1_DIM2*SPACE1_DIM3 and make sure
+ * we can write data to it */
extend_dims[0] = SPACE1_DIM1;
ret = H5Dset_extent(dset1, extend_dims);
CHECK(ret, FAIL, "H5Dset_extent");
@@ -950,10 +968,10 @@ test_h5s_zero_dim(void)
CHECK(ret, FAIL, "H5Aclose");
/*===============================================================
- * Extend the dimension to make it a normal dataspace (3x15x13).
- * Verify that data can be written to and read from the chunked
- * dataset now.
- *===============================================================
+ * Extend the dimension to make it a normal dataspace (3x15x13).
+ * Verify that data can be written to and read from the chunked
+ * dataset now.
+ *===============================================================
*/
dims1[0]=SPACE1_DIM1;
ret = H5Sset_extent_simple(sid_chunk,SPACE1_RANK,dims1,max_dims);
@@ -1154,14 +1172,14 @@ test_h5s_zero_dim(void)
static void
test_h5s_encode(void)
{
- hid_t sid1, sid2, sid3; /* Dataspace ID */
+ hid_t sid1, sid2, sid3; /* Dataspace ID */
hid_t decoded_sid1, decoded_sid2, decoded_sid3;
- int rank; /* Logical rank of dataspace */
- hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3};
+ int rank; /* Logical rank of dataspace */
+ hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3};
size_t sbuf_size=0, null_size=0, scalar_size=0;
unsigned char *sbuf=NULL, *null_sbuf=NULL, *scalar_buf=NULL;
- hsize_t tdims[4]; /* Dimension array to test with */
- hssize_t n; /* Number of dataspace elements */
+ hsize_t tdims[4]; /* Dimension array to test with */
+ hssize_t n; /* Number of dataspace elements */
hsize_t start[] = {0, 0, 0};
hsize_t stride[] = {2, 5, 3};
hsize_t count[] = {2, 2, 2};
@@ -1169,8 +1187,8 @@ test_h5s_encode(void)
H5S_sel_type sel_type;
H5S_class_t space_type;
hssize_t nblocks;
- hid_t ret_id; /* Generic hid_t return value */
- herr_t ret; /* Generic return value */
+ hid_t ret_id; /* Generic hid_t return value */
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing Dataspace Encoding and Decoding\n"));
@@ -1194,7 +1212,7 @@ test_h5s_encode(void)
/* Try decoding bogus buffer */
H5E_BEGIN_TRY {
- ret_id = H5Sdecode(sbuf);
+ ret_id = H5Sdecode(sbuf);
} H5E_END_TRY;
VERIFY(ret_id, FAIL, "H5Sdecode");
@@ -1209,7 +1227,7 @@ test_h5s_encode(void)
n = H5Sget_simple_extent_npoints(decoded_sid1);
CHECK(n, FAIL, "H5Sget_simple_extent_npoints");
VERIFY(n, SPACE1_DIM1 * SPACE1_DIM2 * SPACE1_DIM3,
- "H5Sget_simple_extent_npoints");
+ "H5Sget_simple_extent_npoints");
rank = H5Sget_simple_extent_ndims(decoded_sid1);
CHECK(rank, FAIL, "H5Sget_simple_extent_ndims");
@@ -1218,7 +1236,7 @@ test_h5s_encode(void)
rank = H5Sget_simple_extent_dims(decoded_sid1, tdims, NULL);
CHECK(rank, FAIL, "H5Sget_simple_extent_dims");
VERIFY(HDmemcmp(tdims, dims1, SPACE1_RANK * sizeof(hsize_t)), 0,
- "H5Sget_simple_extent_dims");
+ "H5Sget_simple_extent_dims");
/* Verify hyperslabe selection */
sel_type = H5Sget_select_type(decoded_sid1);
@@ -1308,7 +1326,7 @@ test_h5s_encode(void)
HDfree(sbuf);
HDfree(null_sbuf);
HDfree(scalar_buf);
-} /* test_h5s_encode() */
+} /* test_h5s_encode() */
/****************************************************************
**
@@ -1318,14 +1336,14 @@ test_h5s_encode(void)
static void
test_h5s_scalar_write(void)
{
- hid_t fid1; /* HDF5 File IDs */
- hid_t dataset; /* Dataset ID */
- hid_t sid1; /* Dataspace ID */
- int rank; /* Logical rank of dataspace */
- hsize_t tdims[4]; /* Dimension array to test with */
- hssize_t n; /* Number of dataspace elements */
+ hid_t fid1; /* HDF5 File IDs */
+ hid_t dataset; /* Dataset ID */
+ hid_t sid1; /* Dataspace ID */
+ int rank; /* Logical rank of dataspace */
+ hsize_t tdims[4]; /* Dimension array to test with */
+ hssize_t n; /* Number of dataspace elements */
H5S_class_t ext_type; /* Extent type */
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing Scalar Dataspace Manipulation during Writing\n"));
@@ -1377,7 +1395,7 @@ test_h5s_scalar_write(void)
/* Close file */
ret = H5Fclose(fid1);
CHECK(ret, FAIL, "H5Fclose");
-} /* test_h5s_scalar_write() */
+} /* test_h5s_scalar_write() */
/****************************************************************
**
@@ -1387,14 +1405,14 @@ test_h5s_scalar_write(void)
static void
test_h5s_scalar_read(void)
{
- hid_t fid1; /* HDF5 File IDs */
- hid_t dataset; /* Dataset ID */
- hid_t sid1; /* Dataspace ID */
- int rank; /* Logical rank of dataspace */
- hsize_t tdims[4]; /* Dimension array to test with */
- hssize_t n; /* Number of dataspace elements */
- unsigned rdata; /* Scalar data read in */
- herr_t ret; /* Generic return value */
+ hid_t fid1; /* HDF5 File IDs */
+ hid_t dataset; /* Dataset ID */
+ hid_t sid1; /* Dataspace ID */
+ int rank; /* Logical rank of dataspace */
+ hsize_t tdims[4]; /* Dimension array to test with */
+ hssize_t n; /* Number of dataspace elements */
+ unsigned rdata; /* Scalar data read in */
+ herr_t ret; /* Generic return value */
H5S_class_t ext_type; /* Extent type */
/* Output message about test being performed */
@@ -1441,7 +1459,7 @@ test_h5s_scalar_read(void)
/* Close file */
ret = H5Fclose(fid1);
CHECK(ret, FAIL, "H5Fclose");
-} /* test_h5s_scalar_read() */
+} /* test_h5s_scalar_read() */
/****************************************************************
**
@@ -1452,14 +1470,14 @@ test_h5s_scalar_read(void)
static void
test_h5s_compound_scalar_write(void)
{
- hid_t fid1; /* HDF5 File IDs */
- hid_t dataset; /* Dataset ID */
- hid_t tid1; /* Attribute datatype ID */
- hid_t sid1; /* Dataspace ID */
- int rank; /* Logical rank of dataspace */
- hsize_t tdims[4]; /* Dimension array to test with */
- hssize_t n; /* Number of dataspace elements */
- herr_t ret; /* Generic return value */
+ hid_t fid1; /* HDF5 File IDs */
+ hid_t dataset; /* Dataset ID */
+ hid_t tid1; /* Attribute datatype ID */
+ hid_t sid1; /* Dataspace ID */
+ int rank; /* Logical rank of dataspace */
+ hsize_t tdims[4]; /* Dimension array to test with */
+ hssize_t n; /* Number of dataspace elements */
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing Scalar Dataspace Manipulation for Writing Compound Datatypes\n"));
@@ -1473,19 +1491,19 @@ test_h5s_compound_scalar_write(void)
CHECK(tid1, FAIL, "H5Tcreate");
space4_field1_off=HOFFSET(struct space4_struct, c1);
ret = H5Tinsert(tid1, SPACE4_FIELDNAME1, space4_field1_off,
- H5T_NATIVE_SCHAR);
+ H5T_NATIVE_SCHAR);
CHECK(ret, FAIL, "H5Tinsert");
space4_field2_off=HOFFSET(struct space4_struct, u);
ret = H5Tinsert(tid1, SPACE4_FIELDNAME2, space4_field2_off,
- H5T_NATIVE_UINT);
+ H5T_NATIVE_UINT);
CHECK(ret, FAIL, "H5Tinsert");
space4_field3_off=HOFFSET(struct space4_struct, f);
ret = H5Tinsert(tid1, SPACE4_FIELDNAME3, space4_field3_off,
- H5T_NATIVE_FLOAT);
+ H5T_NATIVE_FLOAT);
CHECK(ret, FAIL, "H5Tinsert");
space4_field4_off=HOFFSET(struct space4_struct, c2);
ret = H5Tinsert(tid1, SPACE4_FIELDNAME4, space4_field4_off,
- H5T_NATIVE_SCHAR);
+ H5T_NATIVE_SCHAR);
CHECK(ret, FAIL, "H5Tinsert");
/* Create scalar dataspace */
@@ -1525,7 +1543,7 @@ test_h5s_compound_scalar_write(void)
/* Close file */
ret = H5Fclose(fid1);
CHECK(ret, FAIL, "H5Fclose");
-} /* test_h5s_compound_scalar_write() */
+} /* test_h5s_compound_scalar_write() */
/****************************************************************
**
@@ -1536,15 +1554,15 @@ test_h5s_compound_scalar_write(void)
static void
test_h5s_compound_scalar_read(void)
{
- hid_t fid1; /* HDF5 File IDs */
- hid_t dataset; /* Dataset ID */
- hid_t sid1; /* Dataspace ID */
- hid_t type; /* Datatype */
- int rank; /* Logical rank of dataspace */
- hsize_t tdims[4]; /* Dimension array to test with */
- hssize_t n; /* Number of dataspace elements */
- struct space4_struct rdata; /* Scalar data read in */
- herr_t ret; /* Generic return value */
+ hid_t fid1; /* HDF5 File IDs */
+ hid_t dataset; /* Dataset ID */
+ hid_t sid1; /* Dataspace ID */
+ hid_t type; /* Datatype */
+ int rank; /* Logical rank of dataspace */
+ hsize_t tdims[4]; /* Dimension array to test with */
+ hssize_t n; /* Number of dataspace elements */
+ struct space4_struct rdata; /* Scalar data read in */
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing Scalar Dataspace Manipulation for Reading Compound Datatypes\n"));
@@ -1598,7 +1616,7 @@ test_h5s_compound_scalar_read(void)
/* Close file */
ret = H5Fclose(fid1);
CHECK(ret, FAIL, "H5Fclose");
-} /* test_h5s_compound_scalar_read() */
+} /* test_h5s_compound_scalar_read() */
/* Data arrays for chunk test */
double chunk_data_dbl[50000][3];
@@ -2364,6 +2382,130 @@ test_h5s_bug1(void)
CHECK(ret, FAIL, "H5Sclose");
} /* test_h5s_bug1() */
+
+/*-------------------------------------------------------------------------
+ * Function: test_versionbounds
+ *
+ * Purpose: Tests version bounds with dataspace.
+ *
+ * Description:
+ * This function creates a file with lower bounds then later
+ * reopens it with higher bounds to show that the dataspace
+ * version is upgraded appropriately.
+ *
+ * Return: Success: 0
+ * Failure: number of errors
+ *
+ *-------------------------------------------------------------------------
+ */
+#define VERBFNAME "tverbounds_dspace.h5"
+#define BASIC_DSET "Basic Dataset"
+#define LATEST_DSET "Latest Dataset"
+static void
+test_versionbounds(void)
+{
+ hid_t file = -1; /* File ID */
+ hid_t space = -1; /* Dataspace ID */
+ hid_t dset = -1; /* Dataset ID */
+ hid_t fapl = -1; /* File access property list ID */
+ hid_t dset_space = -1; /* Retrieved dataset's dataspace ID */
+ hsize_t dim[1]; /* Dataset dimensions */
+ H5F_libver_t low, high; /* File format bounds */
+ H5S_t *spacep = NULL; /* Pointer to internal dataspace */
+ herr_t ret = 0; /* Generic return value */
+
+ /* Output message about test being performed */
+ MESSAGE(5, ("Testing Version Bounds\n"));
+
+ /* Create a file access property list */
+ fapl = H5Pcreate(H5P_FILE_ACCESS);
+ CHECK(fapl, FAIL, "H5Pcreate");
+
+ /* Create dataspace */
+ dim[0] = 10;
+ space = H5Screate_simple(1, dim, NULL);
+ CHECK(space, FAIL, "H5Screate");
+
+ /* Its version should be H5O_SDSPACE_VERSION_1 */
+ spacep = (H5S_t *)H5I_object(space);
+ CHECK(spacep, NULL, "H5I_object");
+ VERIFY(spacep->extent.version, H5O_SDSPACE_VERSION_1, "basic dataspace version bound");
+
+ /* Set high bound to V18 */
+ low = H5F_LIBVER_EARLIEST;
+ high = H5F_LIBVER_V18;
+ ret = H5Pset_libver_bounds(fapl, low, high);
+ CHECK(ret, FAIL, "H5Pset_libver_bounds");
+
+ /* Create the file */
+ file = H5Fcreate(VERBFNAME, H5F_ACC_TRUNC, H5P_DEFAULT, fapl);
+ CHECK(file, FAIL, "H5Fcreate");
+
+ /* Create a basic dataset */
+ dset = H5Dcreate2(file, BASIC_DSET, H5T_NATIVE_INT, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ if (dset > 0) /* dataset created successfully */
+ {
+ /* Get the internal dataspace pointer */
+ dset_space = H5Dget_space(dset);
+ CHECK(dset_space, FAIL, "H5Dget_space");
+ spacep = (H5S_t *)H5I_object(dset_space);
+ CHECK(spacep, NULL, "H5I_object");
+
+ /* Dataspace version should remain as H5O_SDSPACE_VERSION_1 */
+ VERIFY(spacep->extent.version, H5O_SDSPACE_VERSION_1, "basic dataspace version bound");
+
+ /* Close dataspace */
+ ret = H5Sclose(dset_space);
+ CHECK(ret, FAIL, "H5Sclose");
+ }
+
+ /* Close basic dataset and the file */
+ ret = H5Dclose(dset);
+ CHECK(ret, FAIL, "H5Dclose");
+ ret = H5Fclose(file);
+ CHECK(ret, FAIL, "H5Fclose");
+
+ /* Set low and high bounds to latest to trigger the increment of the
+ dataspace version */
+ low = H5F_LIBVER_LATEST;
+ high = H5F_LIBVER_LATEST;
+ ret = H5Pset_libver_bounds(fapl, low, high);
+ CHECK(ret, FAIL, "H5Pset_libver_bounds");
+
+ /* Reopen the file with new version bounds, LATEST/LATEST */
+ file = H5Fopen(VERBFNAME, H5F_ACC_RDWR, fapl);
+
+ /* Create another dataset using the same dspace as the previous dataset */
+ dset = H5Dcreate2(file, LATEST_DSET, H5T_NATIVE_INT, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(dset, FAIL, "H5Dcreate2");
+
+ /* Dataset created successfully. Verify that dataspace version has been
+ upgraded per the low bound */
+
+ /* Get the internal dataspace pointer */
+ dset_space = H5Dget_space(dset);
+ CHECK(dset_space, FAIL, "H5Dget_space");
+ spacep = (H5S_t *)H5I_object(dset_space);
+ CHECK(spacep, NULL, "H5I_object");
+
+ /* Verify the dataspace version */
+ VERIFY(spacep->extent.version, H5O_sdspace_ver_bounds[low], "upgraded dataspace version");
+
+ /* Close everything */
+ ret = H5Sclose(dset_space);
+ CHECK(ret, FAIL, "H5Sclose");
+ ret = H5Dclose(dset);
+ CHECK(ret, FAIL, "H5Dclose");
+
+ ret = H5Sclose(space);
+ CHECK(ret, FAIL, "H5Sclose");
+ ret = H5Pclose(fapl);
+ CHECK(ret, FAIL, "H5Pclose");
+ ret = H5Fclose(file);
+ CHECK(ret, FAIL, "H5Fclose");
+} /* end test_versionbounds() */
+
+
/****************************************************************
**
** test_h5s(): Main H5S (dataspace) testing routine.
@@ -2375,33 +2517,34 @@ test_h5s(void)
/* Output message about test being performed */
MESSAGE(5, ("Testing Dataspaces\n"));
- test_h5s_basic(); /* Test basic H5S code */
- test_h5s_null(); /* Test Null dataspace H5S code */
+ test_h5s_basic(); /* Test basic H5S code */
+ test_h5s_null(); /* Test Null dataspace H5S code */
test_h5s_zero_dim(); /* Test dataspace with zero dimension size */
test_h5s_encode(); /* Test encoding and decoding */
- test_h5s_scalar_write(); /* Test scalar H5S writing code */
- test_h5s_scalar_read(); /* Test scalar H5S reading code */
+ test_h5s_scalar_write(); /* Test scalar H5S writing code */
+ test_h5s_scalar_read(); /* Test scalar H5S reading code */
- test_h5s_compound_scalar_write(); /* Test compound datatype scalar H5S writing code */
- test_h5s_compound_scalar_read(); /* Test compound datatype scalar H5S reading code */
+ test_h5s_compound_scalar_write(); /* Test compound datatype scalar H5S writing code */
+ test_h5s_compound_scalar_read(); /* Test compound datatype scalar H5S reading code */
/* This test was added later to exercise a bug in chunked I/O */
- test_h5s_chunk(); /* Exercise bug fix for chunked I/O */
+ test_h5s_chunk(); /* Exercise bug fix for chunked I/O */
- test_h5s_extent_equal(); /* Test extent comparison code */
+ test_h5s_extent_equal(); /* Test extent comparison code */
test_h5s_extent_copy(); /* Test extent copy code */
test_h5s_bug1(); /* Test bug in offset initialization */
+ test_versionbounds(); /* Test version bounds with dataspace */
} /* test_h5s() */
-
+
/*-------------------------------------------------------------------------
- * Function: cleanup_h5s
+ * Function: cleanup_h5s
*
- * Purpose: Cleanup temporary test files
+ * Purpose: Cleanup temporary test files
*
- * Return: none
+ * Return: none
*
- * Programmer: Albert Cheng
+ * Programmer: Albert Cheng
* July 2, 1998
*
* Modifications:
@@ -2415,4 +2558,5 @@ cleanup_h5s(void)
remove(NULLFILE);
remove(BASICFILE);
remove(ZEROFILE);
+ remove(VERBFNAME);
}
diff --git a/test/tid.c b/test/tid.c
index 7d6757f..ba8af03 100644
--- a/test/tid.c
+++ b/test/tid.c
@@ -14,10 +14,9 @@
/* Test user-created identifiers (hid_t's) and identifier types. */
#include "testhdf5.h"
-#include "hdf5.h"
/* Include H5Ipkg.h to calculate max number of groups */
-#define H5I_FRIEND /*suppress error about including H5Ipkg */
+#define H5I_FRIEND /*suppress error about including H5Ipkg */
#include "H5Ipkg.h"
/* Test basic functionality of registering and deleting types and IDs */
@@ -238,97 +237,97 @@ out:
}
- /* A dummy search function for the next test */
+ /* A dummy search function for the next test */
static int test_search_func(void H5_ATTR_UNUSED * ptr1, void H5_ATTR_UNUSED * ptr2) { return 0; }
- /* Ensure that public functions cannot access "predefined" ID types */
+ /* Ensure that public functions cannot access "predefined" ID types */
static int id_predefined_test(void )
{
- void * testObj;
- hid_t testID;
- hid_t typeID = H5I_INVALID_HID;
- void * testPtr;
- herr_t testErr;
+ void * testObj;
+ hid_t testID;
+ hid_t typeID = H5I_INVALID_HID;
+ void * testPtr;
+ herr_t testErr;
- testObj = HDmalloc(sizeof(int));
+ testObj = HDmalloc(sizeof(int));
- /* Try to perform illegal functions on various predefined types */
- H5E_BEGIN_TRY
- testID = H5Iregister(H5I_FILE, testObj);
- H5E_END_TRY
+ /* Try to perform illegal functions on various predefined types */
+ H5E_BEGIN_TRY
+ testID = H5Iregister(H5I_FILE, testObj);
+ H5E_END_TRY
- VERIFY(testID, H5I_INVALID_HID, "H5Iregister");
- if(testID != H5I_INVALID_HID)
- goto out;
+ VERIFY(testID, H5I_INVALID_HID, "H5Iregister");
+ if(testID != H5I_INVALID_HID)
+ goto out;
- H5E_BEGIN_TRY
- testPtr = H5Isearch(H5I_GENPROP_LST, (H5I_search_func_t) test_search_func, testObj);
- H5E_END_TRY
+ H5E_BEGIN_TRY
+ testPtr = H5Isearch(H5I_GENPROP_LST, (H5I_search_func_t) test_search_func, testObj);
+ H5E_END_TRY
- CHECK_PTR_NULL(testPtr, "H5Isearch");
- if(testPtr != NULL)
- goto out;
+ CHECK_PTR_NULL(testPtr, "H5Isearch");
+ if(testPtr != NULL)
+ goto out;
- H5E_BEGIN_TRY
- testErr = H5Inmembers(H5I_ERROR_STACK, NULL);
- H5E_END_TRY
+ H5E_BEGIN_TRY
+ testErr = H5Inmembers(H5I_ERROR_STACK, NULL);
+ H5E_END_TRY
- VERIFY(testErr, -1, "H5Inmembers");
- if(testErr != -1)
- goto out;
+ VERIFY(testErr, -1, "H5Inmembers");
+ if(testErr != -1)
+ goto out;
- H5E_BEGIN_TRY
- testErr = H5Iclear_type(H5I_FILE, 0);
- H5E_END_TRY
+ H5E_BEGIN_TRY
+ testErr = H5Iclear_type(H5I_FILE, 0);
+ H5E_END_TRY
- VERIFY((testErr >= 0), 0, "H5Iclear_type");
- if(testErr >= 0)
- goto out;
+ VERIFY((testErr >= 0), 0, "H5Iclear_type");
+ if(testErr >= 0)
+ goto out;
- H5E_BEGIN_TRY
- testErr = H5Idestroy_type(H5I_DATASET);
- H5E_END_TRY
+ H5E_BEGIN_TRY
+ testErr = H5Idestroy_type(H5I_DATASET);
+ H5E_END_TRY
- VERIFY((testErr >= 0), 0, "H5Idestroy_type");
- if(testErr >= 0)
- goto out;
+ VERIFY((testErr >= 0), 0, "H5Idestroy_type");
+ if(testErr >= 0)
+ goto out;
- /* Create a datatype ID and try to perform illegal functions on it */
- typeID = H5Tcreate(H5T_OPAQUE, (size_t)42);
- CHECK(typeID, H5I_INVALID_HID, "H5Tcreate");
- if(typeID == H5I_INVALID_HID)
- goto out;
+ /* Create a datatype ID and try to perform illegal functions on it */
+ typeID = H5Tcreate(H5T_OPAQUE, (size_t)42);
+ CHECK(typeID, H5I_INVALID_HID, "H5Tcreate");
+ if(typeID == H5I_INVALID_HID)
+ goto out;
- H5E_BEGIN_TRY
- testPtr = H5Iremove_verify(typeID, H5I_DATATYPE);
- H5E_END_TRY
+ H5E_BEGIN_TRY
+ testPtr = H5Iremove_verify(typeID, H5I_DATATYPE);
+ H5E_END_TRY
- CHECK_PTR_NULL(testPtr, "H5Iremove_verify");
- if(testPtr != NULL)
- goto out;
+ CHECK_PTR_NULL(testPtr, "H5Iremove_verify");
+ if(testPtr != NULL)
+ goto out;
- H5E_BEGIN_TRY
- testPtr = H5Iobject_verify(typeID, H5I_DATATYPE);
- H5E_END_TRY
+ H5E_BEGIN_TRY
+ testPtr = H5Iobject_verify(typeID, H5I_DATATYPE);
+ H5E_END_TRY
- CHECK_PTR_NULL(testPtr, "H5Iobject_verify");
- if(testPtr != NULL)
- goto out;
+ CHECK_PTR_NULL(testPtr, "H5Iobject_verify");
+ if(testPtr != NULL)
+ goto out;
- H5Tclose(typeID);
+ H5Tclose(typeID);
- /* testObj was never registered as an atom, so it will not be
+ /* testObj was never registered as an atom, so it will not be
* automatically freed. */
- HDfree(testObj);
- return 0;
+ HDfree(testObj);
+ return 0;
out:
- if(typeID != H5I_INVALID_HID)
- H5Tclose(typeID);
+ if(typeID != H5I_INVALID_HID)
+ H5Tclose(typeID);
if(testObj != NULL)
- HDfree(testObj);
+ HDfree(testObj);
- return -1;
+ return -1;
}
@@ -444,12 +443,12 @@ static int test_get_type(void)
out:
if(dtype != H5I_INVALID_HID)
- H5Tclose(dtype);
+ H5Tclose(dtype);
return -1;
}
- /* Test boundary cases with lots of types */
+ /* Test boundary cases with lots of types */
/* Type IDs range from H5I_NTYPES to H5I_MAX_NUM_TYPES. The system will assign */
/* IDs in sequential order until H5I_MAX_NUM_TYPES IDs have been given out, at which */
@@ -459,78 +458,78 @@ out:
/* to low values successfully, ensure that an error is thrown when all possible */
/* type IDs are taken, then ensure that deleting types frees up their IDs. */
/* Note that this test depends on the implementation of IDs, so may break */
-/* if the implementation changes. */
+/* if the implementation changes. */
/* Also note that if someone else registered a user-defined type and forgot to */
/* destroy it, this test will mysteriously fail (because it will expect there to */
/* be one more "free" type ID than there is). */
/* H5I_NTYPES is defined in h5public.h, H5I_MAX_NUM_TYPES is defined in h5pkg.h */
static int test_id_type_list(void)
{
- H5I_type_t startType; /* The first type ID we were assigned in this test */
- H5I_type_t currentType;
- H5I_type_t testType;
- int i; /* Just a counter variable */
-
- startType = H5Iregister_type((size_t)8, 0, (H5I_free_t) free );
- CHECK(startType, H5I_BADID, "H5Iregister_type");
- if(startType == H5I_BADID)
- goto out;
-
- /* Sanity check */
- if(startType >= H5I_MAX_NUM_TYPES || startType < H5I_NTYPES)
- {
- /* Error condition, throw an error */
- CHECK(1, 1, "H5Iregister_type");
- goto out;
- }
- /* Create types up to H5I_MAX_NUM_TYPES */
- for(i = startType + 1; i < H5I_MAX_NUM_TYPES; i++)
- {
- currentType = H5Iregister_type((size_t)8, 0, (H5I_free_t) free );
- CHECK(currentType, H5I_BADID, "H5Iregister_type");
- if(currentType == H5I_BADID)
- goto out;
- }
-
- /* Wrap around to low type ID numbers */
- for(i = H5I_NTYPES; i < startType; i++)
- {
- currentType = H5Iregister_type((size_t)8, 0, (H5I_free_t) free );
- CHECK(currentType, H5I_BADID, "H5Iregister_type");
- if(currentType == H5I_BADID)
- goto out;
- }
-
- /* There should be no room at the inn for a new ID type*/
- H5E_BEGIN_TRY
- testType = H5Iregister_type((size_t)8, 0, (H5I_free_t) free );
- H5E_END_TRY
-
- VERIFY(testType, H5I_BADID, "H5Iregister_type");
- if(testType != H5I_BADID)
- goto out;
-
- /* Now delete a type and try to insert again */
- H5Idestroy_type(H5I_NTYPES);
- testType = H5Iregister_type((size_t)8, 0, (H5I_free_t) free );
-
- VERIFY(testType, H5I_NTYPES, "H5Iregister_type");
- if(testType != H5I_NTYPES)
- goto out;
-
- /* Cleanup. Destroy all types. */
- for(i = H5I_NTYPES; i < H5I_MAX_NUM_TYPES; i++)
- H5Idestroy_type((H5I_type_t) i);
-
- return 0;
+ H5I_type_t startType; /* The first type ID we were assigned in this test */
+ H5I_type_t currentType;
+ H5I_type_t testType;
+ int i; /* Just a counter variable */
+
+ startType = H5Iregister_type((size_t)8, 0, (H5I_free_t) free );
+ CHECK(startType, H5I_BADID, "H5Iregister_type");
+ if(startType == H5I_BADID)
+ goto out;
+
+ /* Sanity check */
+ if(startType >= H5I_MAX_NUM_TYPES || startType < H5I_NTYPES)
+ {
+ /* Error condition, throw an error */
+ CHECK(1, 1, "H5Iregister_type");
+ goto out;
+ }
+ /* Create types up to H5I_MAX_NUM_TYPES */
+ for(i = startType + 1; i < H5I_MAX_NUM_TYPES; i++)
+ {
+ currentType = H5Iregister_type((size_t)8, 0, (H5I_free_t) free );
+ CHECK(currentType, H5I_BADID, "H5Iregister_type");
+ if(currentType == H5I_BADID)
+ goto out;
+ }
+
+ /* Wrap around to low type ID numbers */
+ for(i = H5I_NTYPES; i < startType; i++)
+ {
+ currentType = H5Iregister_type((size_t)8, 0, (H5I_free_t) free );
+ CHECK(currentType, H5I_BADID, "H5Iregister_type");
+ if(currentType == H5I_BADID)
+ goto out;
+ }
+
+ /* There should be no room at the inn for a new ID type*/
+ H5E_BEGIN_TRY
+ testType = H5Iregister_type((size_t)8, 0, (H5I_free_t) free );
+ H5E_END_TRY
+
+ VERIFY(testType, H5I_BADID, "H5Iregister_type");
+ if(testType != H5I_BADID)
+ goto out;
+
+ /* Now delete a type and try to insert again */
+ H5Idestroy_type(H5I_NTYPES);
+ testType = H5Iregister_type((size_t)8, 0, (H5I_free_t) free );
+
+ VERIFY(testType, H5I_NTYPES, "H5Iregister_type");
+ if(testType != H5I_NTYPES)
+ goto out;
+
+ /* Cleanup. Destroy all types. */
+ for(i = H5I_NTYPES; i < H5I_MAX_NUM_TYPES; i++)
+ H5Idestroy_type((H5I_type_t) i);
+
+ return 0;
out:
/* Cleanup. For simplicity, just destroy all types and ignore errors. */
- H5E_BEGIN_TRY
- for(i = H5I_NTYPES; i < H5I_MAX_NUM_TYPES; i++)
- H5Idestroy_type((H5I_type_t) i);
- H5E_END_TRY
- return -1;
+ H5E_BEGIN_TRY
+ for(i = H5I_NTYPES; i < H5I_MAX_NUM_TYPES; i++)
+ H5Idestroy_type((H5I_type_t) i);
+ H5E_END_TRY
+ return -1;
}
/* Test removing ids in callback for H5Iclear_type */
@@ -733,11 +732,11 @@ void test_ids(void)
/* Set the random # seed */
HDsrandom((unsigned)HDtime(NULL));
- if (basic_id_test() < 0) TestErrPrintf("Basic ID test failed\n");
- if (id_predefined_test() < 0) TestErrPrintf("Predefined ID type test failed\n");
- if (test_is_valid() < 0) TestErrPrintf("H5Iis_valid test failed\n");
- if (test_get_type() < 0) TestErrPrintf("H5Iget_type test failed\n");
- if (test_id_type_list() < 0) TestErrPrintf("ID type list test failed\n");
- if (test_remove_clear_type() < 0) TestErrPrintf("ID remove during H5Iclear_type test failed\n");
+ if (basic_id_test() < 0) TestErrPrintf("Basic ID test failed\n");
+ if (id_predefined_test() < 0) TestErrPrintf("Predefined ID type test failed\n");
+ if (test_is_valid() < 0) TestErrPrintf("H5Iis_valid test failed\n");
+ if (test_get_type() < 0) TestErrPrintf("H5Iget_type test failed\n");
+ if (test_id_type_list() < 0) TestErrPrintf("ID type list test failed\n");
+ if (test_remove_clear_type() < 0) TestErrPrintf("ID remove during H5Iclear_type test failed\n");
}
diff --git a/test/titerate.c b/test/titerate.c
index 231bd2e..82c26eb 100644
--- a/test/titerate.c
+++ b/test/titerate.c
@@ -13,7 +13,7 @@
/***********************************************************
*
-* Test program: titerate
+* Test program: titerate
*
* Test the Group & Attribute functionality
*
@@ -21,8 +21,6 @@
#include "testhdf5.h"
-#include "hdf5.h"
-
#define DATAFILE "titerate.h5"
/* Number of datasets for group iteration test */
@@ -38,8 +36,8 @@
#define NAMELEN 80
/* 1-D dataset with fixed dimensions */
-#define SPACE1_RANK 1
-#define SPACE1_DIM1 4
+#define SPACE1_RANK 1
+#define SPACE1_DIM1 4
typedef enum {
RET_ZERO,
@@ -131,7 +129,7 @@ test_iter_group(hid_t fapl, hbool_t new_format)
char dataset_name[NAMELEN]; /* dataset name */
iter_info info; /* Custom iteration information */
H5G_info_t ginfo; /* Buffer for querying object's info */
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing Group Iteration Functionality\n"));
@@ -390,7 +388,7 @@ static void test_iter_attr(hid_t fapl, hbool_t new_format)
char name[NAMELEN]; /* temporary name buffer */
char *anames[NATTR]; /* Names of the attributes created */
iter_info info; /* Custom iteration information */
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing Attribute Iteration Functionality\n"));
@@ -545,7 +543,7 @@ liter_cb2(hid_t loc_id, const char *name, const H5L_info_t H5_ATTR_UNUSED *link_
{
const iter_info *test_info = (const iter_info *)opdata;
H5O_info_t oinfo;
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
if(HDstrcmp(name, test_info->name)) {
TestErrPrintf("name = '%s', test_info = '%s'\n", name, test_info->name);
@@ -575,13 +573,13 @@ liter_cb2(hid_t loc_id, const char *name, const H5L_info_t H5_ATTR_UNUSED *link_
static void
test_iter_group_large(hid_t fapl)
{
- hid_t file; /* HDF5 File IDs */
- hid_t dataset; /* Dataset ID */
- hid_t group; /* Group ID */
- hid_t sid; /* Dataspace ID */
- hid_t tid; /* Datatype ID */
- hsize_t dims[] = {SPACE1_DIM1};
- herr_t ret; /* Generic return value */
+ hid_t file; /* HDF5 File IDs */
+ hid_t dataset; /* Dataset ID */
+ hid_t group; /* Group ID */
+ hid_t sid; /* Dataspace ID */
+ hid_t tid; /* Datatype ID */
+ hsize_t dims[] = {SPACE1_DIM1};
+ herr_t ret; /* Generic return value */
char gname[20]; /* Temporary group name */
iter_info *names; /* Names of objects in the root group */
iter_info *curr_name; /* Pointer to the current name in the root group */
@@ -711,7 +709,7 @@ static void test_grp_memb_funcs(hid_t fapl)
char dataset_name[NAMELEN]; /* dataset name */
ssize_t name_len; /* Length of object's name */
H5G_info_t ginfo; /* Buffer for querying object's info */
- herr_t ret = SUCCEED; /* Generic return value */
+ herr_t ret = SUCCEED; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing Group Member Information Functionality\n"));
@@ -851,7 +849,7 @@ static void test_links(hid_t fapl)
hid_t gid, gid1;
H5G_info_t ginfo; /* Buffer for querying object's info */
hsize_t i;
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing Soft and Hard Link Iteration Functionality\n"));
@@ -927,7 +925,7 @@ test_iterate(void)
{
hid_t fapl, fapl2; /* File access property lists */
unsigned new_format; /* Whether to use the new format or not */
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing Iteration Operations\n"));
@@ -960,15 +958,15 @@ test_iterate(void)
CHECK(ret, FAIL, "H5Pclose");
} /* test_iterate() */
-
+
/*-------------------------------------------------------------------------
- * Function: cleanup_iterate
+ * Function: cleanup_iterate
*
- * Purpose: Cleanup temporary test files
+ * Purpose: Cleanup temporary test files
*
- * Return: none
+ * Return: none
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* April 5, 2000
*
* Modifications:
diff --git a/test/tmisc.c b/test/tmisc.c
index f0e595b..4a77b51 100644
--- a/test/tmisc.c
+++ b/test/tmisc.c
@@ -21,12 +21,11 @@
*
*************************************************************/
-#define H5D_FRIEND /*suppress error about including H5Dpkg */
+#define H5D_FRIEND /*suppress error about including H5Dpkg */
/* Define this macro to indicate that the testing APIs should be available */
#define H5D_TESTING
-#include "hdf5.h"
#include "testhdf5.h"
#include "H5srcdir.h"
#include "H5Dpkg.h" /* Datasets */
@@ -1816,11 +1815,11 @@ test_misc11(void)
unsigned sym_ik; /* Symbol table B-tree initial 'K' value */
unsigned istore_ik; /* Indexed storage B-tree initial 'K' value */
unsigned sym_lk; /* Symbol table B-tree leaf 'K' value */
- unsigned nindexes; /* Shared message number of indexes */
+ unsigned nindexes; /* Shared message number of indexes */
H5F_info2_t finfo; /* global information about file */
H5F_fspace_strategy_t strategy; /* File space strategy */
- hsize_t threshold; /* Free-space section threshold */
- hbool_t persist; /* To persist free-space or not */
+ hsize_t threshold; /* Free-space section threshold */
+ hbool_t persist; /* To persist free-space or not */
herr_t ret; /* Generic return value */
/* Output message about test being performed */
@@ -1859,7 +1858,7 @@ test_misc11(void)
/* This should fail as (32770*2) will exceed ^16 - 2 bytes for storing btree entries */
H5E_BEGIN_TRY {
- ret=H5Pset_sym_k(fcpl, 32770, 0);
+ ret=H5Pset_sym_k(fcpl, 32770, 0);
} H5E_END_TRY;
VERIFY(ret, FAIL, "H5Pset_sym_k");
@@ -1868,7 +1867,7 @@ test_misc11(void)
/* This should fail as (32770*2) will exceed ^16 - 2 bytes for storing btree entries */
H5E_BEGIN_TRY {
- ret=H5Pset_istore_k(fcpl, 32770);
+ ret=H5Pset_istore_k(fcpl, 32770);
} H5E_END_TRY;
VERIFY(ret, FAIL, "H5Pset_istore_k");
@@ -1980,19 +1979,19 @@ test_misc12(void)
"las palabras del que murio en la cruz."
};
char *rdata [MISC12_SPACE1_DIM1+MISC12_APPEND_SIZE]; /* Information read in */
- hid_t fid1;
- hid_t dataset;
- hid_t sid1, space, memspace;
- hid_t tid1, cparms;
- hsize_t dims1[] = {MISC12_SPACE1_DIM1};
- hsize_t dimsn[] = {MISC12_APPEND_SIZE};
- hsize_t maxdims1[1] = {H5S_UNLIMITED};
- hsize_t chkdims1[1] = {MISC12_CHUNK_SIZE};
+ hid_t fid1;
+ hid_t dataset;
+ hid_t sid1, space, memspace;
+ hid_t tid1, cparms;
+ hsize_t dims1[] = {MISC12_SPACE1_DIM1};
+ hsize_t dimsn[] = {MISC12_APPEND_SIZE};
+ hsize_t maxdims1[1] = {H5S_UNLIMITED};
+ hsize_t chkdims1[1] = {MISC12_CHUNK_SIZE};
hsize_t newsize[1] = {MISC12_SPACE1_DIM1+MISC12_APPEND_SIZE};
- hsize_t offset[1] = {MISC12_SPACE1_DIM1};
+ hsize_t offset[1] = {MISC12_SPACE1_DIM1};
hsize_t count[1] = {MISC12_APPEND_SIZE};
int i; /* counting variable */
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing VL-type in chunked dataset\n"));
@@ -2746,10 +2745,10 @@ test_misc16(void)
herr_t ret; /* Generic return value */
char wdata[MISC16_SPACE_DIM][MISC16_STR_SIZE];
char rdata[MISC16_SPACE_DIM][MISC16_STR_SIZE]; /* Information read in */
- hid_t dataset; /* Dataset ID */
- hid_t sid; /* Dataspace ID */
- hid_t tid; /* Datatype ID */
- hsize_t dims[] = {MISC16_SPACE_DIM};
+ hid_t dataset; /* Dataset ID */
+ hid_t sid; /* Dataspace ID */
+ hid_t tid; /* Datatype ID */
+ hsize_t dims[] = {MISC16_SPACE_DIM};
int i;
/* Initialize the data */
@@ -2831,10 +2830,10 @@ test_misc17(void)
herr_t ret; /* Generic return value */
char wdata[MISC17_SPACE_DIM1][MISC17_SPACE_DIM2];
char rdata[MISC17_SPACE_DIM1][MISC17_SPACE_DIM2]; /* Information read in */
- hid_t dataset; /* Dataset ID */
- hid_t sid; /* Dataspace ID */
- hid_t tid; /* Datatype ID */
- hsize_t dims[] = {MISC17_SPACE_DIM1, MISC17_SPACE_DIM2};
+ hid_t dataset; /* Dataset ID */
+ hid_t sid; /* Dataspace ID */
+ hid_t tid; /* Datatype ID */
+ hsize_t dims[] = {MISC17_SPACE_DIM1, MISC17_SPACE_DIM2};
int i;
/* Initialize the data */
@@ -3798,13 +3797,13 @@ test_misc22(void)
/* compute the correct PPB that should be set by SZIP */
if(offsets[k] == 0)
- correct = prec[j];
+ correct = prec[j];
else
correct = H5Tget_size(idts[i]) * 8;
if(correct > 24) {
- if(correct <= 32)
+ if(correct <= 32)
correct = 32;
- else if(correct <= 64)
+ else if(correct <= 64)
correct = 64;
} /* end if */
@@ -4757,7 +4756,7 @@ test_misc25b(void)
CHECK(ret, FAIL, "H5Fclose");
} /* end test_misc25b() */
-
+
/****************************************************************
**
** test_misc25c(): Exercise another null object header message merge bug.
@@ -4891,7 +4890,7 @@ test_misc25c(void)
CHECK(ret, FAIL, "H5Fclose");
} /* end test_misc25c() */
-
+
/****************************************************************
**
** test_misc26(): Regression test: ensure that copying filter
@@ -4977,7 +4976,7 @@ test_misc26(void)
CHECK_I(ret, "H5Pclose");
}
-
+
/****************************************************************
**
** test_misc27(): Ensure that objects with incorrect # of object
@@ -5022,7 +5021,7 @@ test_misc27(void)
CHECK(ret, FAIL, "H5Fclose");
} /* end test_misc27() */
-
+
/****************************************************************
**
** test_misc28(): Ensure that the dataset chunk cache will hold
@@ -5199,7 +5198,7 @@ test_misc28(void)
CHECK_I(ret, "H5Pclose");
} /* end test_misc28() */
-
+
/****************************************************************
**
** test_misc29(): Ensure that speculative metadata reads don't
@@ -5239,7 +5238,7 @@ test_misc30_get_info_cb(hid_t loc_id, const char *name, const H5L_info_t H5_ATTR
{
H5O_info_t object_info;
- return H5Oget_info_by_name(loc_id, name, &object_info, H5P_DEFAULT);
+ return H5Oget_info_by_name(loc_id, name, &object_info, H5P_DEFAULT);
}
static int
@@ -5248,7 +5247,7 @@ test_misc30_get_info(hid_t loc_id)
return H5Literate(loc_id, H5_INDEX_NAME, H5_ITER_INC, NULL, test_misc30_get_info_cb, NULL);
}
-
+
/****************************************************************
**
** test_misc30(): Exercise local heap code that loads prefix
@@ -5280,15 +5279,15 @@ test_misc30(void)
CHECK(ret, FAIL, "H5Gclose");
ret = H5Fclose(fid);
CHECK(ret, FAIL, "H5Fclose");
-
+
for(i = 0; i < 20; i++) {
char gname[32];
fid = H5Fopen(MISC30_FILE, H5F_ACC_RDWR, H5P_DEFAULT);
CHECK(fid, FAIL, "H5Fopen");
-
+
if(get_info) {
- ret = test_misc30_get_info(fid);
+ ret = test_misc30_get_info(fid);
CHECK(ret, FAIL, "test_misc30_get_info");
}
@@ -5300,20 +5299,20 @@ test_misc30(void)
CHECK(ret, FAIL, "H5Gclose");
ret = H5Fclose(fid);
CHECK(ret, FAIL, "H5Fclose");
- }
-
+ }
+
fid = H5Fopen(MISC30_FILE, H5F_ACC_RDONLY, H5P_DEFAULT);
CHECK(fid, FAIL, "H5Fopen");
ret = H5Fget_filesize(fid, &file_size[get_info]);
CHECK(fid, FAIL, "H5Fget_filesize");
ret = H5Fclose(fid);
CHECK(ret, FAIL, "H5Fclose");
- }
-
+ }
+
VERIFY(file_size[0], file_size[1], "test_misc30");
} /* end test_misc30() */
-
+
/****************************************************************
**
** test_misc31(): Test reentering library through deprecated
@@ -5404,14 +5403,14 @@ test_misc31(void)
CHECK(ret, FAIL, "H5Fclose");
ret = H5Tclose(dtype_id);
CHECK(ret, FAIL, "H5Tclose");
-
+
#else /* H5_NO_DEPRECATED_SYMBOLS */
/* Output message about test being skipped */
MESSAGE(5, (" ...Skipped"));
#endif /* H5_NO_DEPRECATED_SYMBOLS */
} /* end test_misc31() */
-
+
/****************************************************************
*
* test_misc32(): Simple test of filter memory allocation
@@ -5475,7 +5474,7 @@ test_misc32(void)
resized = H5resize_memory(NULL, 0);
CHECK_PTR_NULL(resized, "H5resize_memory"); /*BAD*/
#endif /* NDEBUG */
-
+
} /* end test_misc32() */
/****************************************************************
@@ -5585,7 +5584,7 @@ test_misc34(void)
} /* end test_misc34() */
-
+
/****************************************************************
**
** test_misc(): Main misc. test routine.
@@ -5638,15 +5637,15 @@ test_misc(void)
} /* test_misc() */
-
+
/*-------------------------------------------------------------------------
- * Function: cleanup_misc
+ * Function: cleanup_misc
*
- * Purpose: Cleanup temporary test files
+ * Purpose: Cleanup temporary test files
*
- * Return: none
+ * Return: none
*
- * Programmer: Albert Cheng
+ * Programmer: Albert Cheng
* July 2, 1998
*
* Modifications:
diff --git a/test/trefer.c b/test/trefer.c
index 05c0130..7cbb77f 100644
--- a/test/trefer.c
+++ b/test/trefer.c
@@ -13,7 +13,7 @@
/***********************************************************
*
-* Test program: trefer
+* Test program: trefer
*
* Test the Reference functionality
*
@@ -21,24 +21,22 @@
#include "testhdf5.h"
-#include "hdf5.h"
-
#define FILE1 "trefer1.h5"
-#define FILE2 "trefer2.h5"
-#define FILE3 "trefer3.h5"
+#define FILE2 "trefer2.h5"
+#define FILE3 "trefer3.h5"
/* 1-D dataset with fixed dimensions */
-#define SPACE1_RANK 1
-#define SPACE1_DIM1 4
+#define SPACE1_RANK 1
+#define SPACE1_DIM1 4
/* 2-D dataset with fixed dimensions */
-#define SPACE2_RANK 2
-#define SPACE2_DIM1 10
-#define SPACE2_DIM2 10
+#define SPACE2_RANK 2
+#define SPACE2_DIM1 10
+#define SPACE2_DIM2 10
/* Larger 1-D dataset with fixed dimensions */
-#define SPACE3_RANK 1
-#define SPACE3_DIM1 100
+#define SPACE3_RANK 1
+#define SPACE3_DIM1 100
/* Element selection information */
#define POINT1_NPOINTS 10
@@ -81,7 +79,7 @@ test_reference_params(void)
unsigned *tu32; /* Temporary pointer to uint32 data */
int i; /* counting variables */
const char *write_comment = "Foo!"; /* Comments for group */
- hid_t ret_id; /* Generic hid_t return value */
+ hid_t ret_id; /* Generic hid_t return value */
ssize_t name_size; /* Size of reference name */
herr_t ret; /* Generic return value */
@@ -104,7 +102,7 @@ test_reference_params(void)
/* Create dataset access property list */
dapl_id = H5Pcreate(H5P_DATASET_ACCESS);
CHECK(dapl_id, FAIL, "H5Pcreate");
-
+
/* Create a group */
group = H5Gcreate2(fid1, "Group1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
CHECK(group, FAIL, "H5Gcreate2");
@@ -247,13 +245,13 @@ test_reference_params(void)
static void
test_reference_obj(void)
{
- hid_t fid1; /* HDF5 File IDs */
- hid_t dataset, /* Dataset ID */
+ hid_t fid1; /* HDF5 File IDs */
+ hid_t dataset, /* Dataset ID */
dset2; /* Dereferenced dataset ID */
- hid_t group; /* Group ID */
- hid_t sid1; /* Dataspace ID */
- hid_t tid1; /* Datatype ID */
- hsize_t dims1[] = {SPACE1_DIM1};
+ hid_t group; /* Group ID */
+ hid_t sid1; /* Dataspace ID */
+ hid_t tid1; /* Datatype ID */
+ hsize_t dims1[] = {SPACE1_DIM1};
hid_t dapl_id; /* Dataset access property list */
hobj_ref_t *wbuf, /* buffer to write to disk */
*rbuf, /* buffer read from disk */
@@ -265,7 +263,7 @@ test_reference_obj(void)
char read_comment[10];
H5O_type_t obj_type; /* Object type */
ssize_t size; /* Comment length */
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing Object Reference Functions\n"));
@@ -286,7 +284,7 @@ test_reference_obj(void)
/* Create dataset access property list */
dapl_id = H5Pcreate(H5P_DATASET_ACCESS);
CHECK(dapl_id, FAIL, "H5Pcreate");
-
+
/* Create a group */
group = H5Gcreate2(fid1, "Group1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
CHECK(group, FAIL, "H5Gcreate2");
@@ -496,23 +494,23 @@ test_reference_obj(void)
static void
test_reference_region(void)
{
- hid_t fid1; /* HDF5 File IDs */
- hid_t dset1, /* Dataset ID */
- dset2; /* Dereferenced dataset ID */
- hid_t sid1, /* Dataspace ID #1 */
- sid2; /* Dataspace ID #2 */
+ hid_t fid1; /* HDF5 File IDs */
+ hid_t dset1, /* Dataset ID */
+ dset2; /* Dereferenced dataset ID */
+ hid_t sid1, /* Dataspace ID #1 */
+ sid2; /* Dataspace ID #2 */
hid_t dapl_id; /* Dataset access property list */
- hsize_t dims1[] = {SPACE1_DIM1},
- dims2[] = {SPACE2_DIM1, SPACE2_DIM2};
- hsize_t start[SPACE2_RANK]; /* Starting location of hyperslab */
- hsize_t stride[SPACE2_RANK]; /* Stride of hyperslab */
- hsize_t count[SPACE2_RANK]; /* Element count of hyperslab */
- hsize_t block[SPACE2_RANK]; /* Block size of hyperslab */
- hsize_t coord1[POINT1_NPOINTS][SPACE2_RANK]; /* Coordinates for point selection */
- hsize_t * coords; /* Coordinate buffer */
- hsize_t low[SPACE2_RANK]; /* Selection bounds */
- hsize_t high[SPACE2_RANK]; /* Selection bounds */
- hdset_reg_ref_t *wbuf, /* buffer to write to disk */
+ hsize_t dims1[] = {SPACE1_DIM1},
+ dims2[] = {SPACE2_DIM1, SPACE2_DIM2};
+ hsize_t start[SPACE2_RANK]; /* Starting location of hyperslab */
+ hsize_t stride[SPACE2_RANK]; /* Stride of hyperslab */
+ hsize_t count[SPACE2_RANK]; /* Element count of hyperslab */
+ hsize_t block[SPACE2_RANK]; /* Block size of hyperslab */
+ hsize_t coord1[POINT1_NPOINTS][SPACE2_RANK]; /* Coordinates for point selection */
+ hsize_t * coords; /* Coordinate buffer */
+ hsize_t low[SPACE2_RANK]; /* Selection bounds */
+ hsize_t high[SPACE2_RANK]; /* Selection bounds */
+ hdset_reg_ref_t *wbuf, /* buffer to write to disk */
*rbuf; /* buffer read from disk */
hdset_reg_ref_t nvrbuf[3]={{0},{101},{255}}; /* buffer with non-valid refs */
uint8_t *dwbuf, /* Buffer for writing numeric data to disk */
@@ -522,7 +520,7 @@ test_reference_region(void)
int i, j; /* counting variables */
hssize_t hssize_ret; /* hssize_t return value */
htri_t tri_ret; /* htri_t return value */
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
haddr_t addr = HADDR_UNDEF; /* test for undefined reference */
hid_t dset_NA; /* Dataset id for undefined reference */
hid_t space_NA; /* Dataspace id for undefined reference */
@@ -550,7 +548,7 @@ test_reference_region(void)
/* Create dataset access property list */
dapl_id = H5Pcreate(H5P_DATASET_ACCESS);
CHECK(dapl_id, FAIL, "H5Pcreate");
-
+
/* Create a dataset */
dset2 = H5Dcreate2(fid1, "Dataset2", H5T_STD_U8LE, sid2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
CHECK(dset2, FAIL, "H5Dcreate2");
@@ -659,7 +657,7 @@ test_reference_region(void)
/* Close and release resources for undefined region reference tests */
ret = H5Dclose(dset_NA);
CHECK(ret, FAIL, "H5Dclose");
- ret = H5Sclose(space_NA);
+ ret = H5Sclose(space_NA);
CHECK(ret, FAIL, "H5Sclose");
/* Close disk dataspace */
@@ -682,10 +680,10 @@ test_reference_region(void)
fid1 = H5Fopen(FILE2, H5F_ACC_RDWR, H5P_DEFAULT);
CHECK(fid1, FAIL, "H5Fopen");
- /*
- * Start the test of an undefined reference
+ /*
+ * Start the test of an undefined reference
*/
-
+
/* Open the dataset of the undefined references */
dset_NA = H5Dopen2(fid1, "DS_NA", H5P_DEFAULT);
CHECK(dset_NA, FAIL, "H5Dopen2");
@@ -693,28 +691,28 @@ test_reference_region(void)
/* Read the data */
ret = H5Dread(dset_NA, H5T_STD_REF_DSETREG, H5S_ALL, H5S_ALL, H5P_DEFAULT, rdata_NA);
CHECK(ret, FAIL, "H5Dread");
-
+
/*
* Dereference an undefined reference (should fail)
*/
H5E_BEGIN_TRY {
dset2 = H5Rdereference2(dset_NA, H5P_DEFAULT, H5R_DATASET_REGION, &rdata_NA[0]);
- } H5E_END_TRY;
- VERIFY(dset2, FAIL, "H5Rdereference2");
+ } H5E_END_TRY;
+ VERIFY(dset2, FAIL, "H5Rdereference2");
/* Close and release resources. */
ret = H5Dclose(dset_NA);
CHECK(ret, FAIL, "H5Dclose");
- /* This close should fail since H5Rdereference2 never created
+ /* This close should fail since H5Rdereference2 never created
* the id of the referenced object. */
H5E_BEGIN_TRY {
ret = H5Dclose(dset2);
- } H5E_END_TRY;
- VERIFY(ret, FAIL, "H5Dclose");
+ } H5E_END_TRY;
+ VERIFY(ret, FAIL, "H5Dclose");
- /*
- * End the test of an undefined reference
+ /*
+ * End the test of an undefined reference
*/
/* Open the dataset */
@@ -893,22 +891,22 @@ test_reference_region(void)
static void
test_reference_region_1D(void)
{
- hid_t fid1; /* HDF5 File IDs */
- hid_t dset1, /* Dataset ID */
+ hid_t fid1; /* HDF5 File IDs */
+ hid_t dset1, /* Dataset ID */
dset3; /* Dereferenced dataset ID */
- hid_t sid1, /* Dataspace ID #1 */
- sid3; /* Dataspace ID #3 */
+ hid_t sid1, /* Dataspace ID #1 */
+ sid3; /* Dataspace ID #3 */
hid_t dapl_id; /* Dataset access property list */
- hsize_t dims1[] = {SPACE1_DIM1},
- dims3[] = {SPACE3_DIM1};
- hsize_t start[SPACE3_RANK]; /* Starting location of hyperslab */
- hsize_t stride[SPACE3_RANK]; /* Stride of hyperslab */
- hsize_t count[SPACE3_RANK]; /* Element count of hyperslab */
- hsize_t block[SPACE3_RANK]; /* Block size of hyperslab */
- hsize_t coord1[POINT1_NPOINTS][SPACE3_RANK]; /* Coordinates for point selection */
+ hsize_t dims1[] = {SPACE1_DIM1},
+ dims3[] = {SPACE3_DIM1};
+ hsize_t start[SPACE3_RANK]; /* Starting location of hyperslab */
+ hsize_t stride[SPACE3_RANK]; /* Stride of hyperslab */
+ hsize_t count[SPACE3_RANK]; /* Element count of hyperslab */
+ hsize_t block[SPACE3_RANK]; /* Block size of hyperslab */
+ hsize_t coord1[POINT1_NPOINTS][SPACE3_RANK]; /* Coordinates for point selection */
hsize_t * coords; /* Coordinate buffer */
- hsize_t low[SPACE3_RANK]; /* Selection bounds */
- hsize_t high[SPACE3_RANK]; /* Selection bounds */
+ hsize_t low[SPACE3_RANK]; /* Selection bounds */
+ hsize_t high[SPACE3_RANK]; /* Selection bounds */
hdset_reg_ref_t *wbuf, /* buffer to write to disk */
*rbuf; /* buffer read from disk */
uint8_t *dwbuf, /* Buffer for writing numeric data to disk */
@@ -916,7 +914,7 @@ test_reference_region_1D(void)
uint8_t *tu8; /* Temporary pointer to uint8 data */
H5O_type_t obj_type; /* Object type */
int i; /* counting variables */
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing 1-D Dataset Region Reference Functions\n"));
@@ -938,7 +936,7 @@ test_reference_region_1D(void)
/* Create dataset access property list */
dapl_id = H5Pcreate(H5P_DATASET_ACCESS);
CHECK(dapl_id, FAIL, "H5Pcreate");
-
+
/* Create a dataset */
dset3 = H5Dcreate2(fid1, "Dataset2", H5T_STD_U8LE, sid3, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
CHECK(dset3, FAIL, "H5Dcreate2");
@@ -1178,14 +1176,14 @@ test_reference_region_1D(void)
static void
test_reference_obj_deleted(void)
{
- hid_t fid1; /* HDF5 File IDs */
- hid_t dataset, /* Dataset ID */
+ hid_t fid1; /* HDF5 File IDs */
+ hid_t dataset, /* Dataset ID */
dset2; /* Dereferenced dataset ID */
- hid_t sid1; /* Dataspace ID */
+ hid_t sid1; /* Dataspace ID */
hobj_ref_t oref; /* Object Reference to test */
H5O_type_t obj_type; /* Object type */
- haddr_t addr = HADDR_UNDEF; /* test for undefined reference */
- herr_t ret; /* Generic return value */
+ haddr_t addr = HADDR_UNDEF; /* test for undefined reference */
+ herr_t ret; /* Generic return value */
/* Create file */
fid1 = H5Fcreate(FILE3, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
@@ -1444,25 +1442,25 @@ test_reference_group(void)
static void
test_reference_compat(void)
{
- hid_t fid1; /* HDF5 File IDs */
- hid_t dataset, dset2; /* Dataset ID */
- hid_t group, group2; /* Group ID */
- hid_t sid1, /* Dataspace IDs */
+ hid_t fid1; /* HDF5 File IDs */
+ hid_t dataset, dset2; /* Dataset ID */
+ hid_t group, group2; /* Group ID */
+ hid_t sid1, /* Dataspace IDs */
sid2;
- hid_t tid1, tid2; /* Datatype ID */
- hsize_t dims1[] = {SPACE1_DIM1},
- dims2[] = {SPACE2_DIM1, SPACE2_DIM2};
- hsize_t start[SPACE2_RANK]; /* Starting location of hyperslab */
- hsize_t stride[SPACE2_RANK]; /* Stride of hyperslab */
- hsize_t count[SPACE2_RANK]; /* Element count of hyperslab */
- hsize_t block[SPACE2_RANK]; /* Block size of hyperslab */
- hsize_t coord1[POINT1_NPOINTS][SPACE2_RANK]; /* Coordinates for point selection */
+ hid_t tid1, tid2; /* Datatype ID */
+ hsize_t dims1[] = {SPACE1_DIM1},
+ dims2[] = {SPACE2_DIM1, SPACE2_DIM2};
+ hsize_t start[SPACE2_RANK]; /* Starting location of hyperslab */
+ hsize_t stride[SPACE2_RANK]; /* Stride of hyperslab */
+ hsize_t count[SPACE2_RANK]; /* Element count of hyperslab */
+ hsize_t block[SPACE2_RANK]; /* Block size of hyperslab */
+ hsize_t coord1[POINT1_NPOINTS][SPACE2_RANK]; /* Coordinates for point selection */
hobj_ref_t *wbuf_obj, /* Buffer to write to disk */
*rbuf_obj; /* Buffer read from disk */
hdset_reg_ref_t *wbuf_reg, /* Buffer to write to disk */
*rbuf_reg; /* Buffer read from disk */
H5G_obj_t obj_type; /* Object type */
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing Deprecated Object Reference Functions\n"));
@@ -1750,15 +1748,15 @@ test_reference(void)
} /* test_reference() */
-
+
/*-------------------------------------------------------------------------
- * Function: cleanup_reference
+ * Function: cleanup_reference
*
- * Purpose: Cleanup temporary test files
+ * Purpose: Cleanup temporary test files
*
- * Return: none
+ * Return: none
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* September 8, 1998
*
* Modifications:
diff --git a/test/ttime.c b/test/ttime.c
index 2eb2117..48c9ba8 100644
--- a/test/ttime.c
+++ b/test/ttime.c
@@ -13,7 +13,7 @@
/***********************************************************
*
-* Test program: ttime
+* Test program: ttime
*
* Test the Time Datatype functionality
*
@@ -21,8 +21,6 @@
#include "testhdf5.h"
-#include "hdf5.h"
-
#define DATAFILE "ttime.h5"
#ifdef NOT_YET
#define DATASETNAME "Dataset"
@@ -215,15 +213,15 @@ test_time(void)
} /* test_time() */
-
+
/*-------------------------------------------------------------------------
- * Function: cleanup_time
+ * Function: cleanup_time
*
- * Purpose: Cleanup temporary test files
+ * Purpose: Cleanup temporary test files
*
- * Return: none
+ * Return: none
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* October 19, 2000
*
* Modifications:
diff --git a/test/ttsafe.h b/test/ttsafe.h
index 6cf449f..c29fadc 100644
--- a/test/ttsafe.h
+++ b/test/ttsafe.h
@@ -22,9 +22,6 @@
* Include required headers. This file tests internal library functions,
* so we include the private headers here.
*/
-#include "hdf5.h"
-#include "H5private.h"
-#include "H5Eprivate.h"
#include "testhdf5.h"
diff --git a/test/tvlstr.c b/test/tvlstr.c
index 7b520f2..3315d68 100644
--- a/test/tvlstr.c
+++ b/test/tvlstr.c
@@ -13,7 +13,7 @@
/***********************************************************
*
-* Test program: tvlstr
+* Test program: tvlstr
*
* Test the Variable-Length String functionality
*
@@ -21,14 +21,12 @@
#include "testhdf5.h"
-#include "hdf5.h"
-
#define DATAFILE "tvlstr.h5"
#define DATAFILE2 "tvlstr2.h5"
/* 1-D dataset with fixed dimensions */
-#define SPACE1_RANK 1
-#define SPACE1_DIM1 4
+#define SPACE1_RANK 1
+#define SPACE1_DIM1 4
#define VLSTR_TYPE "vl_string_type"
@@ -115,17 +113,17 @@ test_vlstrings_basic(void)
char *rdata[SPACE1_DIM1]; /* Information read in */
char *wdata2;
hid_t dataspace, dataset2;
- hid_t fid1; /* HDF5 File IDs */
- hid_t dataset; /* Dataset ID */
- hid_t sid1; /* Dataspace ID */
- hid_t tid1; /* Datatype ID */
+ hid_t fid1; /* HDF5 File IDs */
+ hid_t dataset; /* Dataset ID */
+ hid_t sid1; /* Dataspace ID */
+ hid_t tid1; /* Datatype ID */
hid_t xfer_pid; /* Dataset transfer property list ID */
- hsize_t dims1[] = {SPACE1_DIM1};
+ hsize_t dims1[] = {SPACE1_DIM1};
hsize_t size; /* Number of bytes which will be used */
unsigned i; /* counting variable */
size_t str_used; /* String data in memory */
size_t mem_used=0; /* Memory used during allocation */
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing Basic VL String Functionality\n"));
@@ -247,14 +245,14 @@ test_vlstrings_special(void)
const char *wdata2[SPACE1_DIM1] = {NULL, NULL, NULL, NULL};
char *rdata[SPACE1_DIM1]; /* Information read in */
char *fill; /* Fill value */
- hid_t fid1; /* HDF5 File IDs */
- hid_t dataset; /* Dataset ID */
- hid_t sid1; /* Dataspace ID */
- hid_t tid1; /* Datatype ID */
- hid_t dcpl; /* Dataset creation property list ID */
- hsize_t dims1[] = {SPACE1_DIM1};
+ hid_t fid1; /* HDF5 File IDs */
+ hid_t dataset; /* Dataset ID */
+ hid_t sid1; /* Dataspace ID */
+ hid_t tid1; /* Datatype ID */
+ hid_t dcpl; /* Dataset creation property list ID */
+ hsize_t dims1[] = {SPACE1_DIM1};
unsigned i; /* counting variable */
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing Special VL Strings\n"));
@@ -477,14 +475,14 @@ test_compact_vlstring(void)
{
const char *wdata[SPACE1_DIM1] = {"one", "two", "three", "four"};
char *rdata[SPACE1_DIM1]; /* Information read in */
- hid_t fid1; /* HDF5 File IDs */
- hid_t dataset; /* Dataset ID */
- hid_t sid1; /* Dataspace ID */
- hid_t tid1; /* Datatype ID */
- hid_t plist; /* Dataset creation property list */
- hsize_t dims1[] = {SPACE1_DIM1};
+ hid_t fid1; /* HDF5 File IDs */
+ hid_t dataset; /* Dataset ID */
+ hid_t sid1; /* Dataspace ID */
+ hid_t tid1; /* Datatype ID */
+ hid_t plist; /* Dataset creation property list */
+ hsize_t dims1[] = {SPACE1_DIM1};
unsigned i; /* counting variable */
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing VL Strings in compact dataset\n"));
@@ -873,15 +871,15 @@ test_vlstrings(void)
test_vl_rewrite();
} /* test_vlstrings() */
-
+
/*-------------------------------------------------------------------------
- * Function: cleanup_vlstrings
+ * Function: cleanup_vlstrings
*
- * Purpose: Cleanup temporary test files
+ * Purpose: Cleanup temporary test files
*
- * Return: none
+ * Return: none
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* September 10, 1999
*
* Modifications:
diff --git a/test/tvltypes.c b/test/tvltypes.c
index 0c4cb9d..e5a3d34 100644
--- a/test/tvltypes.c
+++ b/test/tvltypes.c
@@ -13,7 +13,7 @@
/***********************************************************
*
-* Test program: tvltypes
+* Test program: tvltypes
*
* Test the Variable-Length Datatype functionality
*
@@ -21,24 +21,23 @@
#include "testhdf5.h"
-#include "hdf5.h"
#include "H5Dprivate.h"
#define FILENAME "tvltypes.h5"
/* 1-D dataset with fixed dimensions */
-#define SPACE1_RANK 1
+#define SPACE1_RANK 1
#define SPACE1_DIM1 4
/* 1-D dataset with fixed dimensions */
-#define SPACE3_RANK 1
+#define SPACE3_RANK 1
#define SPACE3_DIM1 128
#define L1_INCM 16
#define L2_INCM 8
#define L3_INCM 3
/* 1-D dataset with fixed dimensions */
-#define SPACE4_RANK 1
+#define SPACE4_RANK 1
#define SPACE4_DIM_SMALL 128
#define SPACE4_DIM_LARGE (H5D_TEMP_BUF_SIZE / 64)
@@ -104,7 +103,7 @@ static void
test_vltypes_dataset_create(void)
{
hid_t fid1; /* HDF5 File IDs */
- hid_t dcpl; /* Dataset Property list */
+ hid_t dcpl; /* Dataset Property list */
hid_t dataset; /* Dataset ID */
hsize_t dims1[] = {SPACE1_DIM1};
hid_t sid1; /* Dataspace ID */
@@ -136,7 +135,7 @@ test_vltypes_dataset_create(void)
/* Create a dataset, supposed to fail */
H5E_BEGIN_TRY {
- dataset = H5Dcreate2(fid1, "Dataset1", tid1, sid1, H5P_DEFAULT, dcpl, H5P_DEFAULT);
+ dataset = H5Dcreate2(fid1, "Dataset1", tid1, sid1, H5P_DEFAULT, dcpl, H5P_DEFAULT);
} H5E_END_TRY;
VERIFY(dataset, FAIL, "H5Dcreate2");
@@ -230,18 +229,18 @@ test_vltypes_vlen_atomic(void)
hvl_t wdata2[SPACE1_DIM1]; /* Information to write */
hvl_t rdata[SPACE1_DIM1]; /* Information read in */
hvl_t fill; /* Fill value */
- hid_t fid1; /* HDF5 File IDs */
- hid_t dataset; /* Dataset ID */
- hid_t sid1; /* Dataspace ID */
+ hid_t fid1; /* HDF5 File IDs */
+ hid_t dataset; /* Dataset ID */
+ hid_t sid1; /* Dataspace ID */
hid_t sid2; /* ID of bad dataspace (no extent set) */
- hid_t tid1; /* Datatype ID */
+ hid_t tid1; /* Datatype ID */
hid_t dcpl_pid; /* Dataset creation property list ID */
hid_t xfer_pid; /* Dataset transfer property list ID */
hsize_t dims1[] = {SPACE1_DIM1};
hsize_t size; /* Number of bytes which will be used */
unsigned i,j; /* counting variables */
size_t mem_used=0; /* Memory used during allocation */
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing Basic Atomic VL Datatype Functionality\n"));
@@ -556,7 +555,7 @@ rewrite_vltypes_vlen_atomic(void)
hsize_t size; /* Number of bytes which will be used */
unsigned i,j; /* counting variables */
size_t mem_used=0; /* Memory used during allocation */
- unsigned increment=4;
+ unsigned increment=4;
herr_t ret; /* Generic return value */
/* Output message about test being performed */
@@ -709,16 +708,16 @@ test_vltypes_vlen_compound(void)
} s1;
hvl_t wdata[SPACE1_DIM1]; /* Information to write */
hvl_t rdata[SPACE1_DIM1]; /* Information read in */
- hid_t fid1; /* HDF5 File IDs */
- hid_t dataset; /* Dataset ID */
- hid_t sid1; /* Dataspace ID */
- hid_t tid1, tid2; /* Datatype IDs */
+ hid_t fid1; /* HDF5 File IDs */
+ hid_t dataset; /* Dataset ID */
+ hid_t sid1; /* Dataspace ID */
+ hid_t tid1, tid2; /* Datatype IDs */
hid_t xfer_pid; /* Dataset transfer property list ID */
- hsize_t dims1[] = {SPACE1_DIM1};
+ hsize_t dims1[] = {SPACE1_DIM1};
hsize_t size; /* Number of bytes which will be used */
unsigned i,j; /* counting variables */
size_t mem_used=0; /* Memory used during allocation */
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing Basic Compound VL Datatype Functionality\n"));
@@ -863,7 +862,7 @@ rewrite_vltypes_vlen_compound(void)
hsize_t size; /* Number of bytes which will be used */
unsigned i,j; /* counting variables */
size_t mem_used=0; /* Memory used during allocation */
- unsigned increment=4;
+ unsigned increment=4;
herr_t ret; /* Generic return value */
/* Output message about test being performed */
@@ -1001,14 +1000,14 @@ test_vltypes_compound_vlen_vlen(void)
} s1;
s1 *wdata; /* data to write */
s1 *rdata; /* data to read */
- hid_t fid1; /* HDF5 File IDs */
- hid_t dataset; /* Dataset ID */
- hid_t sid1; /* Dataspace ID */
- hid_t tid1, tid2, tid3; /* Datatype IDs */
- hsize_t dims1[] = {SPACE3_DIM1};
+ hid_t fid1; /* HDF5 File IDs */
+ hid_t dataset; /* Dataset ID */
+ hid_t sid1; /* Dataspace ID */
+ hid_t tid1, tid2, tid3; /* Datatype IDs */
+ hsize_t dims1[] = {SPACE3_DIM1};
unsigned i,j,k; /* counting variables */
hvl_t *t1, *t2; /* Temporary pointer to VL information */
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing Compound Datatypes with VL Atomic Datatype Component Functionality\n"));
@@ -1182,21 +1181,21 @@ test_vltypes_compound_vlstr(void)
s1 wdata2[SPACE1_DIM1]; /* data to write */
s1 rdata[SPACE1_DIM1]; /* data to read */
s1 rdata2[SPACE1_DIM1]; /* data to read */
- char str[64] = "a\0";
- hid_t fid1; /* HDF5 File IDs */
- hid_t dataset, dset2; /* Dataset ID */
- hid_t sid1, sid2, filespace, filespace2; /* Dataspace ID */
- hid_t tid1, tid2, tid3, tid4, tid5; /* Datatype IDs */
- hid_t cparms;
- hsize_t dims1[] = {SPACE1_DIM1};
- hsize_t chunk_dims[] = {SPACE1_DIM1/2};
- hsize_t maxdims[] = {H5S_UNLIMITED};
- hsize_t size[] = {SPACE1_DIM1};
- hsize_t offset[] = {0};
+ char str[64] = "a\0";
+ hid_t fid1; /* HDF5 File IDs */
+ hid_t dataset, dset2; /* Dataset ID */
+ hid_t sid1, sid2, filespace, filespace2; /* Dataspace ID */
+ hid_t tid1, tid2, tid3, tid4, tid5; /* Datatype IDs */
+ hid_t cparms;
+ hsize_t dims1[] = {SPACE1_DIM1};
+ hsize_t chunk_dims[] = {SPACE1_DIM1/2};
+ hsize_t maxdims[] = {H5S_UNLIMITED};
+ hsize_t size[] = {SPACE1_DIM1};
+ hsize_t offset[] = {0};
unsigned i,j; /* counting variables */
s2 *t1, *t2; /* Temporary pointer to VL information */
- int val;
- herr_t ret; /* Generic return value */
+ int val;
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing VL Datatype of Compound Datatype with VL String Functionality\n"));
@@ -1374,10 +1373,10 @@ test_vltypes_compound_vlstr(void)
wdata2[i].v.p=(s2*)HDmalloc((i+1)*sizeof(s2));
wdata2[i].v.len=i+1;
for(t1=(s2*)(wdata2[i].v).p, j=0; j<i+1; j++, t1++) {
- strcat(str, "pp");
- t1->string = (char*)HDmalloc(strlen(str)*sizeof(char)+1);
+ strcat(str, "pp");
+ t1->string = (char*)HDmalloc(strlen(str)*sizeof(char)+1);
strcpy(t1->string, str);
- t1->color = green;
+ t1->color = green;
}
} /* end for */
@@ -1467,17 +1466,17 @@ test_vltypes_compound_vlen_atomic(void)
s1 wdata[SPACE1_DIM1]; /* Information to write */
s1 rdata[SPACE1_DIM1]; /* Information read in */
s1 fill; /* Fill value */
- hid_t fid1; /* HDF5 File IDs */
- hid_t dataset; /* Dataset ID */
- hid_t sid1; /* Dataspace ID */
- hid_t tid1, tid2; /* Datatype IDs */
+ hid_t fid1; /* HDF5 File IDs */
+ hid_t dataset; /* Dataset ID */
+ hid_t sid1; /* Dataspace ID */
+ hid_t tid1, tid2; /* Datatype IDs */
hid_t xfer_pid; /* Dataset transfer property list ID */
hid_t dcpl_pid; /* Dataset creation property list ID */
- hsize_t dims1[] = {SPACE1_DIM1};
+ hsize_t dims1[] = {SPACE1_DIM1};
hsize_t size; /* Number of bytes which will be used */
unsigned i,j; /* counting variables */
size_t mem_used=0; /* Memory used during allocation */
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing Compound Datatypes with VL Atomic Datatype Component Functionality\n"));
@@ -1671,9 +1670,9 @@ test_vltypes_compound_vlen_atomic(void)
/****************************************************************
**
** rewrite_vltypes_compound_vlen_atomic(): Check memory leak for
-** basic VL datatype code.
+** basic VL datatype code.
** Check memory leak for compound datatypes with VL datatypes
-** of atomic datatypes.
+** of atomic datatypes.
**
****************************************************************/
static void
@@ -1694,7 +1693,7 @@ rewrite_vltypes_compound_vlen_atomic(void)
hsize_t size; /* Number of bytes which will be used */
unsigned i,j; /* counting variables */
size_t mem_used=0; /* Memory used during allocation */
- unsigned increment=4;
+ unsigned increment=4;
herr_t ret; /* Generic return value */
/* Output message about test being performed */
@@ -1855,16 +1854,16 @@ test_vltypes_vlen_vlen_atomic(void)
hvl_t wdata[SPACE1_DIM1]; /* Information to write */
hvl_t rdata[SPACE1_DIM1]; /* Information read in */
hvl_t *t1, *t2; /* Temporary pointer to VL information */
- hid_t fid1; /* HDF5 File IDs */
- hid_t dataset; /* Dataset ID */
- hid_t sid1; /* Dataspace ID */
- hid_t tid1, tid2; /* Datatype IDs */
+ hid_t fid1; /* HDF5 File IDs */
+ hid_t dataset; /* Dataset ID */
+ hid_t sid1; /* Dataspace ID */
+ hid_t tid1, tid2; /* Datatype IDs */
hid_t xfer_pid; /* Dataset transfer property list ID */
- hsize_t dims1[] = {SPACE1_DIM1};
+ hsize_t dims1[] = {SPACE1_DIM1};
hsize_t size; /* Number of bytes which will be used */
unsigned i,j,k; /* counting variables */
size_t mem_used=0; /* Memory used during allocation */
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing VL Datatypes with VL Atomic Datatype Component Functionality\n"));
@@ -2049,12 +2048,12 @@ rewrite_longer_vltypes_vlen_vlen_atomic(void)
hid_t fid1; /* HDF5 File IDs */
hid_t dataset; /* Dataset ID */
hid_t sid1; /* Dataspace ID */
- hid_t tid2; /* Datatype IDs */
+ hid_t tid2; /* Datatype IDs */
hid_t xfer_pid; /* Dataset transfer property list ID */
hsize_t size; /* Number of bytes which will be used */
unsigned i,j,k; /* counting variables */
size_t mem_used=0; /* Memory used during allocation */
- unsigned increment=1;
+ unsigned increment=1;
herr_t ret; /* Generic return value */
/* Output message about test being performed */
@@ -3171,15 +3170,15 @@ test_vltypes(void)
/* These next tests use the same file */
test_vltypes_dataset_create(); /* Check dataset of VL when fill value
- * won't be rewritten to it.*/
+ * won't be rewritten to it.*/
test_vltypes_funcs(); /* Test functions with VL types */
test_vltypes_vlen_atomic(); /* Test VL atomic datatypes */
- rewrite_vltypes_vlen_atomic(); /* Check VL memory leak */
+ rewrite_vltypes_vlen_atomic(); /* Check VL memory leak */
test_vltypes_vlen_compound(); /* Test VL compound datatypes */
- rewrite_vltypes_vlen_compound(); /* Check VL memory leak */
+ rewrite_vltypes_vlen_compound(); /* Check VL memory leak */
test_vltypes_compound_vlen_atomic(); /* Test compound datatypes with VL atomic components */
- rewrite_vltypes_compound_vlen_atomic();/* Check VL memory leak */
- test_vltypes_vlen_vlen_atomic(); /* Test VL datatype with VL atomic components */
+ rewrite_vltypes_compound_vlen_atomic();/* Check VL memory leak */
+ test_vltypes_vlen_vlen_atomic(); /* Test VL datatype with VL atomic components */
rewrite_longer_vltypes_vlen_vlen_atomic(); /*overwrite with VL data of longer sequence*/
rewrite_shorter_vltypes_vlen_vlen_atomic(); /*overwrite with VL data of shorted sequence*/
test_vltypes_compound_vlen_vlen();/* Test compound datatypes with VL atomic components */
@@ -3187,15 +3186,15 @@ test_vltypes(void)
test_vltypes_fill_value(); /* Test fill value for VL data */
} /* test_vltypes() */
-
+
/*-------------------------------------------------------------------------
- * Function: cleanup_vltypes
+ * Function: cleanup_vltypes
*
- * Purpose: Cleanup temporary test files
+ * Purpose: Cleanup temporary test files
*
- * Return: none
+ * Return: none
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* June 8, 1999
*
* Modifications:
diff --git a/testpar/t_cache.c b/testpar/t_cache.c
index 700e993..5768e35 100644
--- a/testpar/t_cache.c
+++ b/testpar/t_cache.c
@@ -16,12 +16,11 @@
*
*/
-#include "h5test.h"
#include "testpar.h"
-#define H5AC_FRIEND /*suppress error about including H5ACpkg */
-#define H5C_FRIEND /*suppress error about including H5Cpkg */
-#define H5F_FRIEND /*suppress error about including H5Fpkg */
+#define H5AC_FRIEND /*suppress error about including H5ACpkg */
+#define H5C_FRIEND /*suppress error about including H5Cpkg */
+#define H5F_FRIEND /*suppress error about including H5Fpkg */
#include "H5ACpkg.h"
#include "H5Cpkg.h"
@@ -33,9 +32,9 @@
#define BASE_ADDR (haddr_t)1024
-int nerrors = 0;
-int failures = 0;
-hbool_t verbose = TRUE; /* used to control error messages */
+int nerrors = 0;
+int failures = 0;
+hbool_t verbose = TRUE; /* used to control error messages */
#define NFILENAME 2
#define PARATESTFILE filenames[0]
@@ -45,23 +44,23 @@ const char *FILENAME[NFILENAME]={"CacheTestDummy", NULL};
#endif /* !PATH_MAX */
char filenames[NFILENAME][PATH_MAX];
hid_t fapl; /* file access property list */
-haddr_t max_addr = 0; /* used to store the end of
- * the address space used by
- * the data array (see below).
- */
-hbool_t callbacks_verbose = FALSE; /* flag used to control whether
- * the callback functions are in
- * verbose mode.
- */
+haddr_t max_addr = 0; /* used to store the end of
+ * the address space used by
+ * the data array (see below).
+ */
+hbool_t callbacks_verbose = FALSE; /* flag used to control whether
+ * the callback functions are in
+ * verbose mode.
+ */
-int world_mpi_size = -1;
-int world_mpi_rank = -1;
-int world_server_mpi_rank = -1;
-MPI_Comm world_mpi_comm = MPI_COMM_NULL;
-int file_mpi_size = -1;
-int file_mpi_rank = -1;
-MPI_Comm file_mpi_comm = MPI_COMM_NULL;
+int world_mpi_size = -1;
+int world_mpi_rank = -1;
+int world_server_mpi_rank = -1;
+MPI_Comm world_mpi_comm = MPI_COMM_NULL;
+int file_mpi_size = -1;
+int file_mpi_rank = -1;
+MPI_Comm file_mpi_comm = MPI_COMM_NULL;
/* the following globals are used to maintain rudementary statistics
@@ -74,67 +73,67 @@ long datum_destroys = 0;
long datum_flushes = 0;
long datum_pinned_flushes = 0;
long datum_loads = 0;
-long global_pins = 0;
-long global_dirty_pins = 0;
-long local_pins = 0;
+long global_pins = 0;
+long global_dirty_pins = 0;
+long local_pins = 0;
/* the following fields are used by the server process only */
-int total_reads = 0;
+int total_reads = 0;
int total_writes = 0;
/*****************************************************************************
* struct datum
*
- * Instances of struct datum are used to store information on entries
- * that may be loaded into the cache. The individual fields are
- * discussed below:
+ * Instances of struct datum are used to store information on entries
+ * that may be loaded into the cache. The individual fields are
+ * discussed below:
*
- * header: Instance of H5C_cache_entry_t used by the for its data.
- * This field is only used on the file processes, not on the
- * server process.
+ * header: Instance of H5C_cache_entry_t used by the for its data.
+ * This field is only used on the file processes, not on the
+ * server process.
*
- * This field MUST be the first entry in this structure.
+ * This field MUST be the first entry in this structure.
*
- * base_addr: Base address of the entry.
+ * base_addr: Base address of the entry.
*
- * len: Length of the entry.
+ * len: Length of the entry.
*
- * local_len: Length of the entry according to the cache. This
- * value must be positive, and may not be larger than len.
+ * local_len: Length of the entry according to the cache. This
+ * value must be positive, and may not be larger than len.
*
- * The field exists to allow us change the sizes of entries
- * in the cache without upsetting the server. This value
- * is only used locally, and is never sent to the server.
+ * The field exists to allow us change the sizes of entries
+ * in the cache without upsetting the server. This value
+ * is only used locally, and is never sent to the server.
*
- * ver: Version number of the entry. This number is initialize
- * to zero, and incremented each time the entry is modified.
+ * ver: Version number of the entry. This number is initialize
+ * to zero, and incremented each time the entry is modified.
*
- * dirty: Boolean flag indicating whether the entry is dirty.
+ * dirty: Boolean flag indicating whether the entry is dirty.
*
- * For current purposes, an entry is clean until it is
- * modified, and dirty until written to the server (cache
- * on process 0) or until it is marked clean (all other
- * caches).
+ * For current purposes, an entry is clean until it is
+ * modified, and dirty until written to the server (cache
+ * on process 0) or until it is marked clean (all other
+ * caches).
*
- * valid: Boolean flag indicating whether the entry contains
- * valid data. Attempts to read an entry whose valid
- * flag is not set should trigger an error.
+ * valid: Boolean flag indicating whether the entry contains
+ * valid data. Attempts to read an entry whose valid
+ * flag is not set should trigger an error.
*
- * locked: Boolean flag that is set to true iff the entry is in
- * the cache and locked.
+ * locked: Boolean flag that is set to true iff the entry is in
+ * the cache and locked.
*
- * global_pinned: Boolean flag that is set to true iff the entry has
- * been pinned collectively in all caches. Since writes must
- * be collective across all processes, only entries pinned
- * in this fashion may be marked dirty.
+ * global_pinned: Boolean flag that is set to true iff the entry has
+ * been pinned collectively in all caches. Since writes must
+ * be collective across all processes, only entries pinned
+ * in this fashion may be marked dirty.
*
- * local_pinned: Boolean flag that is set to true iff the entry
- * has been pinned in the local cache, but probably not all
- * caches. Such pins will typically not be consistant across
- * processes, and thus cannot be marked as dirty unless they
- * happen to overlap some collective operation.
+ * local_pinned: Boolean flag that is set to true iff the entry
+ * has been pinned in the local cache, but probably not all
+ * caches. Such pins will typically not be consistant across
+ * processes, and thus cannot be marked as dirty unless they
+ * happen to overlap some collective operation.
*
* cleared: Boolean flag that is set to true whenever the entry is
* dirty, and is cleared via a call to datum_notify with the
@@ -143,61 +142,61 @@ int total_writes = 0;
* flushed: Boolean flag that is set to true whenever the entry is
* dirty, and is flushed by the metadata cache.
*
- * reads: Integer field used to maintain a count of the number of
- * times this entry has been read from the server since
- * the last time the read and write counts were reset.
+ * reads: Integer field used to maintain a count of the number of
+ * times this entry has been read from the server since
+ * the last time the read and write counts were reset.
*
- * writes: Integer field used to maintain a count of the number of
- * times this entry has been written to the server since
- * the last time the read and write counts were reset.
+ * writes: Integer field used to maintain a count of the number of
+ * times this entry has been written to the server since
+ * the last time the read and write counts were reset.
*
- * index: Index of this instance of datum in the data_index[] array
- * discussed below.
+ * index: Index of this instance of datum in the data_index[] array
+ * discussed below.
*
- * aux_ptr: Pointer to the instance of H5AC_aux_t associated with the
- * instance of the metadata cache within which this entry
- * resides. This field was added to allow us to pass this
- * value to the notify callback from the serialize callback.
- * It should be NULL when not in use.
+ * aux_ptr: Pointer to the instance of H5AC_aux_t associated with the
+ * instance of the metadata cache within which this entry
+ * resides. This field was added to allow us to pass this
+ * value to the notify callback from the serialize callback.
+ * It should be NULL when not in use.
*
*****************************************************************************/
struct datum
{
- H5C_cache_entry_t header;
- haddr_t base_addr;
- size_t len;
- size_t local_len;
- int ver;
- hbool_t dirty;
- hbool_t valid;
- hbool_t locked;
- hbool_t global_pinned;
- hbool_t local_pinned;
- hbool_t cleared;
+ H5C_cache_entry_t header;
+ haddr_t base_addr;
+ size_t len;
+ size_t local_len;
+ int ver;
+ hbool_t dirty;
+ hbool_t valid;
+ hbool_t locked;
+ hbool_t global_pinned;
+ hbool_t local_pinned;
+ hbool_t cleared;
hbool_t flushed;
- int reads;
- int writes;
- int index;
+ int reads;
+ int writes;
+ int index;
struct H5AC_aux_t * aux_ptr;
};
/*****************************************************************************
* data array
*
- * The data array is an array of instances of datum of size
- * NUM_DATA_ENTRIES that is used to track the particulars of all
- * the entries that may be loaded into the cache.
+ * The data array is an array of instances of datum of size
+ * NUM_DATA_ENTRIES that is used to track the particulars of all
+ * the entries that may be loaded into the cache.
*
- * It exists on all processes, although the master copy is maintained
- * by the server process. If the cache is performing correctly, all
- * versions should be effectively identical. By that I mean that
- * the data received from the server should always match that in
- * the local version of the data array.
+ * It exists on all processes, although the master copy is maintained
+ * by the server process. If the cache is performing correctly, all
+ * versions should be effectively identical. By that I mean that
+ * the data received from the server should always match that in
+ * the local version of the data array.
*
*****************************************************************************/
-#define NUM_DATA_ENTRIES 100000
+#define NUM_DATA_ENTRIES 100000
struct datum data[NUM_DATA_ENTRIES];
@@ -216,10 +215,10 @@ struct datum data[NUM_DATA_ENTRIES];
* Further, this value must be consistant across all processes.
*/
-#define STD_VIRT_NUM_DATA_ENTRIES NUM_DATA_ENTRIES
-#define EXPRESS_VIRT_NUM_DATA_ENTRIES (NUM_DATA_ENTRIES / 10)
+#define STD_VIRT_NUM_DATA_ENTRIES NUM_DATA_ENTRIES
+#define EXPRESS_VIRT_NUM_DATA_ENTRIES (NUM_DATA_ENTRIES / 10)
/* Use a smaller test size to avoid creating huge MPE logfiles. */
-#define MPE_VIRT_NUM_DATA_ENTIES (NUM_DATA_ENTRIES / 100)
+#define MPE_VIRT_NUM_DATA_ENTIES (NUM_DATA_ENTRIES / 100)
int virt_num_data_entries = NUM_DATA_ENTRIES;
@@ -227,14 +226,14 @@ int virt_num_data_entries = NUM_DATA_ENTRIES;
/*****************************************************************************
* data_index array
*
- * The data_index array is an array of integer used to maintain a list
- * of instances of datum in the data array in increasing base_addr order.
+ * The data_index array is an array of integer used to maintain a list
+ * of instances of datum in the data array in increasing base_addr order.
*
- * This array is necessary, as move operations can swap the values
- * of the base_addr fields of two instances of datum. Without this
- * array, we would no longer be able to use a binary search on a sorted
- * list to find the indexes of instances of datum given the values of
- * their base_addr fields.
+ * This array is necessary, as move operations can swap the values
+ * of the base_addr fields of two instances of datum. Without this
+ * array, we would no longer be able to use a binary search on a sorted
+ * list to find the indexes of instances of datum given the values of
+ * their base_addr fields.
*
*****************************************************************************/
@@ -243,99 +242,99 @@ int data_index[NUM_DATA_ENTRIES];
/*****************************************************************************
* The following two #defines are used to control code that is in turn used
- * to force "POSIX" semantics on the server process used to simulate metadata
- * reads and writes. Without some such mechanism, the test code contains
+ * to force "POSIX" semantics on the server process used to simulate metadata
+ * reads and writes. Without some such mechanism, the test code contains
* race conditions that will frequently cause spurious failures.
*
* When set to TRUE, DO_WRITE_REQ_ACK forces the server to send an ack after
- * each write request, and the client to wait until the ack is received
+ * each write request, and the client to wait until the ack is received
* before proceeding. This was my first solution to the problem, and at
* first glance, it would seem to have a lot of unnecessary overhead.
*
* In an attempt to reduce the overhead, I implemented a second solution
- * in which no acks are sent after writes. Instead, the metadata cache is
- * provided with a callback function to call after each sequence of writes.
- * This callback simply causes the client to send the server process a
+ * in which no acks are sent after writes. Instead, the metadata cache is
+ * provided with a callback function to call after each sequence of writes.
+ * This callback simply causes the client to send the server process a
* "sync" message and and await an ack in reply.
*
- * Strangely, at least on Phoenix, the first solution runs faster by a
- * rather large margin. However, I can imagine this changing with
+ * Strangely, at least on Phoenix, the first solution runs faster by a
+ * rather large margin. However, I can imagine this changing with
* different OS's and MPI implementatins.
*
- * Thus I have left code supporting the second solution in place.
+ * Thus I have left code supporting the second solution in place.
*
- * Note that while one of these two #defines must be set to TRUE, there
- * should never be any need to set both of them to TRUE (although the
+ * Note that while one of these two #defines must be set to TRUE, there
+ * should never be any need to set both of them to TRUE (although the
* tests will still function with this setting).
*****************************************************************************/
-#define DO_WRITE_REQ_ACK TRUE
-#define DO_SYNC_AFTER_WRITE FALSE
+#define DO_WRITE_REQ_ACK TRUE
+#define DO_SYNC_AFTER_WRITE FALSE
/*****************************************************************************
* struct mssg
*
- * The mssg structure is used as a generic container for messages to
- * and from the server. Not all fields are used in all cases.
+ * The mssg structure is used as a generic container for messages to
+ * and from the server. Not all fields are used in all cases.
*
- * req: Integer field containing the type of the message.
+ * req: Integer field containing the type of the message.
*
- * src: World communicator MPI rank of the sending process.
+ * src: World communicator MPI rank of the sending process.
*
- * dest: World communicator MPI rank of the destination process.
+ * dest: World communicator MPI rank of the destination process.
*
- * mssg_num: Serial number assigned to the message by the sender.
+ * mssg_num: Serial number assigned to the message by the sender.
*
- * base_addr: Base address of a datum. Not used in all mssgs.
+ * base_addr: Base address of a datum. Not used in all mssgs.
*
- * len: Length of a datum (in bytes). Not used in all mssgs.
+ * len: Length of a datum (in bytes). Not used in all mssgs.
*
- * ver: Version number of a datum. Not used in all mssgs.
+ * ver: Version number of a datum. Not used in all mssgs.
*
- * count: Reported number of total/entry reads/writes. Not used
- * in all mssgs.
+ * count: Reported number of total/entry reads/writes. Not used
+ * in all mssgs.
*
- * magic: Magic number for error detection. Must be set to
- * MSSG_MAGIC.
+ * magic: Magic number for error detection. Must be set to
+ * MSSG_MAGIC.
*
*****************************************************************************/
-#define WRITE_REQ_CODE 0
-#define WRITE_REQ_ACK_CODE 1
-#define READ_REQ_CODE 2
-#define READ_REQ_REPLY_CODE 3
-#define SYNC_REQ_CODE 4
-#define SYNC_ACK_CODE 5
-#define REQ_TTL_WRITES_CODE 6
-#define REQ_TTL_WRITES_RPLY_CODE 7
-#define REQ_TTL_READS_CODE 8
-#define REQ_TTL_READS_RPLY_CODE 9
-#define REQ_ENTRY_WRITES_CODE 10
-#define REQ_ENTRY_WRITES_RPLY_CODE 11
-#define REQ_ENTRY_READS_CODE 12
-#define REQ_ENTRY_READS_RPLY_CODE 13
-#define REQ_RW_COUNT_RESET_CODE 14
-#define REQ_RW_COUNT_RESET_RPLY_CODE 15
-#define DONE_REQ_CODE 16
-#define MAX_REQ_CODE 16
-
-#define MSSG_MAGIC 0x1248
+#define WRITE_REQ_CODE 0
+#define WRITE_REQ_ACK_CODE 1
+#define READ_REQ_CODE 2
+#define READ_REQ_REPLY_CODE 3
+#define SYNC_REQ_CODE 4
+#define SYNC_ACK_CODE 5
+#define REQ_TTL_WRITES_CODE 6
+#define REQ_TTL_WRITES_RPLY_CODE 7
+#define REQ_TTL_READS_CODE 8
+#define REQ_TTL_READS_RPLY_CODE 9
+#define REQ_ENTRY_WRITES_CODE 10
+#define REQ_ENTRY_WRITES_RPLY_CODE 11
+#define REQ_ENTRY_READS_CODE 12
+#define REQ_ENTRY_READS_RPLY_CODE 13
+#define REQ_RW_COUNT_RESET_CODE 14
+#define REQ_RW_COUNT_RESET_RPLY_CODE 15
+#define DONE_REQ_CODE 16
+#define MAX_REQ_CODE 16
+
+#define MSSG_MAGIC 0x1248
struct mssg_t
{
- int req;
- int src;
- int dest;
- long int mssg_num;
- haddr_t base_addr;
- unsigned len;
- int ver;
- unsigned count;
- unsigned magic;
+ int req;
+ int src;
+ int dest;
+ long int mssg_num;
+ haddr_t base_addr;
+ unsigned len;
+ int ver;
+ unsigned count;
+ unsigned magic;
};
-MPI_Datatype mpi_mssg_t; /* for MPI derived type created from mssg */
+MPI_Datatype mpi_mssg_t; /* for MPI derived type created from mssg */
/*****************************************************************************/
@@ -409,24 +408,24 @@ static herr_t datum_notify(H5C_notify_action_t action, void *thing);
static herr_t datum_free_icr(void * thing);
/* Masquerade as object header entries to the cache */
-#define DATUM_ENTRY_TYPE H5AC_OHDR_ID
+#define DATUM_ENTRY_TYPE H5AC_OHDR_ID
-#define NUMBER_OF_ENTRY_TYPES 1
+#define NUMBER_OF_ENTRY_TYPES 1
/* Note the use of the H5AC__CLASS_SKIP_READS and H5AC__CLASS_SKIP_WRITES
* flags. As a result of these flags, the metadata cache does no file I/O
* on metadata of the datum type.
*
- * Instead, this test uses a server process to keep track of who has
+ * Instead, this test uses a server process to keep track of who has
* written and read what, and to verify that there are no messages from
* the past / future.
*
- * In the callbacks for the version 2 cache, this activity was hidden in
+ * In the callbacks for the version 2 cache, this activity was hidden in
* the load and flush callbacks. However, now we handle this function in
* notify callbacks for the after load and after flush events.
*
- * JRM -- 1/13/15
+ * JRM -- 1/13/15
*/
const H5C_class_t types[NUMBER_OF_ENTRY_TYPES] =
{
@@ -474,9 +473,9 @@ static void pin_protected_entry(int32_t idx, hbool_t global);
static void move_entry(H5F_t * file_ptr, int32_t old_idx, int32_t new_idx);
static hbool_t reset_server_counts(void);
static void resize_entry(int32_t idx, size_t new_size);
-static hbool_t setup_cache_for_test(hid_t * fid_ptr,
+static hbool_t setup_cache_for_test(hid_t * fid_ptr,
H5F_t ** file_ptr_ptr,
- H5C_t ** cache_ptr_ptr,
+ H5C_t ** cache_ptr_ptr,
int metadata_write_strategy);
static void setup_rand(void);
static hbool_t take_down_cache(hid_t fid, H5C_t * cache_ptr);
@@ -550,17 +549,17 @@ print_stats(void)
/*****************************************************************************
*
- * Function: reset_stats()
+ * Function: reset_stats()
*
- * Purpose: Reset the rudementary stats maintained by t_cache.
+ * Purpose: Reset the rudementary stats maintained by t_cache.
*
- * Return: void
+ * Return: void
*
- * Programmer: JRM -- 4/17/06
+ * Programmer: JRM -- 4/17/06
*
* Modifications:
*
- * None.
+ * None.
*
*****************************************************************************/
@@ -573,9 +572,9 @@ reset_stats(void)
datum_flushes = 0;
datum_pinned_flushes = 0;
datum_loads = 0;
- global_pins = 0;
- global_dirty_pins = 0;
- local_pins = 0;
+ global_pins = 0;
+ global_dirty_pins = 0;
+ local_pins = 0;
return;
@@ -588,20 +587,20 @@ reset_stats(void)
/*****************************************************************************
*
- * Function: set_up_file_communicator()
+ * Function: set_up_file_communicator()
*
- * Purpose: Create the MPI communicator used to open a HDF5 file with.
- * In passing, also initialize the file_mpi... globals.
+ * Purpose: Create the MPI communicator used to open a HDF5 file with.
+ * In passing, also initialize the file_mpi... globals.
*
- * Return: Success: TRUE
+ * Return: Success: TRUE
*
- * Failure: FALSE
+ * Failure: FALSE
*
- * Programmer: JRM -- 11/16/05
+ * Programmer: JRM -- 11/16/05
*
* Modifications:
*
- * None.
+ * None.
*
*****************************************************************************/
@@ -623,7 +622,7 @@ set_up_file_communicator(void)
nerrors++;
success = FALSE;
- if ( verbose ) {
+ if ( verbose ) {
fprintf(stdout,
"%d:%s: MPI_Comm_group() failed with error %d.\n",
world_mpi_rank, FUNC, mpi_result);
@@ -740,16 +739,16 @@ set_up_file_communicator(void)
/*****************************************************************************
*
- * Function: addr_to_datum_index()
+ * Function: addr_to_datum_index()
*
- * Purpose: Given the base address of a datum, find and return its index
- * in the data array.
+ * Purpose: Given the base address of a datum, find and return its index
+ * in the data array.
*
- * Return: Success: index of target datum.
+ * Return: Success: index of target datum.
*
- * Failure: -1.
+ * Failure: -1.
*
- * Programmer: JRM -- 12/20/05
+ * Programmer: JRM -- 12/20/05
*
*****************************************************************************/
static int
@@ -787,16 +786,16 @@ addr_to_datum_index(haddr_t base_addr)
/*****************************************************************************
*
- * Function: init_data()
+ * Function: init_data()
*
- * Purpose: Initialize the data array, from which cache entries are
- * loaded.
+ * Purpose: Initialize the data array, from which cache entries are
+ * loaded.
*
- * Return: Success: TRUE
+ * Return: Success: TRUE
*
- * Failure: FALSE
+ * Failure: FALSE
*
- * Programmer: JRM -- 12/20/05
+ * Programmer: JRM -- 12/20/05
*
*****************************************************************************/
static void
@@ -831,14 +830,14 @@ init_data(void)
data[i].dirty = FALSE;
data[i].valid = FALSE;
data[i].locked = FALSE;
- data[i].global_pinned = FALSE;
- data[i].local_pinned = FALSE;
- data[i].cleared = FALSE;
+ data[i].global_pinned = FALSE;
+ data[i].local_pinned = FALSE;
+ data[i].cleared = FALSE;
data[i].flushed = FALSE;
data[i].reads = 0;
data[i].writes = 0;
- data[i].index = i;
- data[i].aux_ptr = NULL;
+ data[i].index = i;
+ data[i].aux_ptr = NULL;
data_index[i] = i;
@@ -862,22 +861,22 @@ init_data(void)
/*****************************************************************************
*
- * Function: do_express_test()
+ * Function: do_express_test()
*
- * Purpose: Do an MPI_Allreduce to obtain the maximum value returned
- * by GetTestExpress() across all processes. Return this
- * value.
+ * Purpose: Do an MPI_Allreduce to obtain the maximum value returned
+ * by GetTestExpress() across all processes. Return this
+ * value.
*
- * Envirmoment variables can be different across different
- * processes. This function ensures that all processes agree
- * on whether to do an express test.
+ * Envirmoment variables can be different across different
+ * processes. This function ensures that all processes agree
+ * on whether to do an express test.
*
- * Return: Success: Maximum of the values returned by
- * GetTestExpress() across all processes.
+ * Return: Success: Maximum of the values returned by
+ * GetTestExpress() across all processes.
*
- * Failure: -1
+ * Failure: -1
*
- * Programmer: JRM -- 4/25/06
+ * Programmer: JRM -- 4/25/06
*
*****************************************************************************/
static int
@@ -913,19 +912,19 @@ do_express_test(void)
/*****************************************************************************
*
- * Function: do_sync()
+ * Function: do_sync()
*
- * Purpose: Ensure that all messages sent by this process have been
- * processed before proceeding.
+ * Purpose: Ensure that all messages sent by this process have been
+ * processed before proceeding.
*
- * Do this by exchanging sync req / sync ack messages with
- * the server.
+ * Do this by exchanging sync req / sync ack messages with
+ * the server.
*
- * Do nothing if nerrors is greater than zero.
+ * Do nothing if nerrors is greater than zero.
*
- * Return: void
+ * Return: void
*
- * Programmer: JRM -- 5/10/06
+ * Programmer: JRM -- 5/10/06
*
*****************************************************************************/
static void
@@ -937,7 +936,7 @@ do_sync(void)
if ( nerrors <= 0 ) {
/* compose the message */
- mssg.req = SYNC_REQ_CODE;
+ mssg.req = SYNC_REQ_CODE;
mssg.src = world_mpi_rank;
mssg.dest = world_server_mpi_rank;
mssg.mssg_num = -1; /* set by send function */
@@ -947,10 +946,10 @@ do_sync(void)
mssg.count = 0;
mssg.magic = MSSG_MAGIC;
- if ( ! send_mssg(&mssg, FALSE) ) {
+ if ( ! send_mssg(&mssg, FALSE) ) {
- nerrors++;
- if ( verbose ) {
+ nerrors++;
+ if ( verbose ) {
HDfprintf(stdout, "%d:%s: send_mssg() failed.\n",
world_mpi_rank, FUNC);
}
@@ -959,24 +958,24 @@ do_sync(void)
if ( nerrors <= 0 ) {
- if ( ! recv_mssg(&mssg, SYNC_ACK_CODE) ) {
+ if ( ! recv_mssg(&mssg, SYNC_ACK_CODE) ) {
nerrors++;
if ( verbose ) {
HDfprintf(stdout, "%d:%s: recv_mssg() failed.\n",
world_mpi_rank, FUNC);
}
- } else if ( ( mssg.req != SYNC_ACK_CODE ) ||
+ } else if ( ( mssg.req != SYNC_ACK_CODE ) ||
( mssg.src != world_server_mpi_rank ) ||
( mssg.dest != world_mpi_rank ) ||
- ( mssg.magic != MSSG_MAGIC ) ) {
+ ( mssg.magic != MSSG_MAGIC ) ) {
nerrors++;
- if ( verbose ) {
+ if ( verbose ) {
HDfprintf(stdout, "%d:%s: Bad data in sync ack.\n",
world_mpi_rank, FUNC);
}
- }
+ }
}
return;
@@ -986,17 +985,17 @@ do_sync(void)
/*****************************************************************************
*
- * Function: get_max_nerrors()
+ * Function: get_max_nerrors()
*
- * Purpose: Do an MPI_Allreduce to obtain the maximum value of nerrors
- * across all processes. Return this value.
+ * Purpose: Do an MPI_Allreduce to obtain the maximum value of nerrors
+ * across all processes. Return this value.
*
- * Return: Success: Maximum of the nerrors global variables across
- * all processes.
+ * Return: Success: Maximum of the nerrors global variables across
+ * all processes.
*
- * Failure: -1
+ * Failure: -1
*
- * Programmer: JRM -- 1/3/06
+ * Programmer: JRM -- 1/3/06
*
*****************************************************************************/
static int
@@ -1033,29 +1032,29 @@ get_max_nerrors(void)
/*****************************************************************************
*
- * Function: recv_mssg()
+ * Function: recv_mssg()
*
- * Purpose: Receive a message from any process in the provided instance
- * of struct mssg.
+ * Purpose: Receive a message from any process in the provided instance
+ * of struct mssg.
*
- * Return: Success: TRUE
+ * Return: Success: TRUE
*
- * Failure: FALSE
+ * Failure: FALSE
*
- * Programmer: JRM -- 12/22/05
+ * Programmer: JRM -- 12/22/05
*
* Modifications:
*
- * JRM -- 5/10/06
- * Added mssg_tag_offset parameter and supporting code.
+ * JRM -- 5/10/06
+ * Added mssg_tag_offset parameter and supporting code.
*
*****************************************************************************/
-#define CACHE_TEST_TAG 99 /* different from any used by the library */
+#define CACHE_TEST_TAG 99 /* different from any used by the library */
static hbool_t
recv_mssg(struct mssg_t *mssg_ptr,
- int mssg_tag_offset)
+ int mssg_tag_offset)
{
hbool_t success = TRUE;
int mssg_tag = CACHE_TEST_TAG;
@@ -1117,28 +1116,28 @@ recv_mssg(struct mssg_t *mssg_ptr,
/*****************************************************************************
*
- * Function: send_mssg()
+ * Function: send_mssg()
*
- * Purpose: Send the provided instance of mssg to the indicated target.
+ * Purpose: Send the provided instance of mssg to the indicated target.
*
- * Note that all source and destination ranks are in the
- * global communicator.
+ * Note that all source and destination ranks are in the
+ * global communicator.
*
- * Return: Success: TRUE
+ * Return: Success: TRUE
*
- * Failure: FALSE
+ * Failure: FALSE
*
- * Programmer: JRM -- 12/22/05
+ * Programmer: JRM -- 12/22/05
*
* Modifications:
*
- * JRM -- 5/10/06
- * Added the add_req_to_tag parameter and supporting code.
+ * JRM -- 5/10/06
+ * Added the add_req_to_tag parameter and supporting code.
*
*****************************************************************************/
static hbool_t
send_mssg(struct mssg_t *mssg_ptr,
- hbool_t add_req_to_tag)
+ hbool_t add_req_to_tag)
{
hbool_t success = TRUE;
int mssg_tag = CACHE_TEST_TAG;
@@ -1166,10 +1165,10 @@ send_mssg(struct mssg_t *mssg_ptr,
mssg_ptr->mssg_num = mssg_num++;
- if ( add_req_to_tag ) {
+ if ( add_req_to_tag ) {
- mssg_tag += mssg_ptr->req;
- }
+ mssg_tag += mssg_ptr->req;
+ }
result = MPI_Send((void *)mssg_ptr, 1, mpi_mssg_t,
mssg_ptr->dest, mssg_tag, world_mpi_comm);
@@ -1189,19 +1188,19 @@ send_mssg(struct mssg_t *mssg_ptr,
} /* send_mssg() */
-
+
/*****************************************************************************
*
- * Function: setup_derived_types()
+ * Function: setup_derived_types()
*
- * Purpose: Set up the derived types used by the test bed. At present,
- * only the mpi_mssg derived type is needed.
+ * Purpose: Set up the derived types used by the test bed. At present,
+ * only the mpi_mssg derived type is needed.
*
- * Return: Success: TRUE
+ * Return: Success: TRUE
*
- * Failure: FALSE
+ * Failure: FALSE
*
- * Programmer: JRM -- 12/22/05
+ * Programmer: JRM -- 12/22/05
*
*****************************************************************************/
static hbool_t
@@ -1278,19 +1277,19 @@ setup_derived_types(void)
} /* setup_derived_types */
-
+
/*****************************************************************************
*
- * Function: takedown_derived_types()
+ * Function: takedown_derived_types()
*
- * Purpose: take down the derived types used by the test bed. At present,
- * only the mpi_mssg derived type is needed.
+ * Purpose: take down the derived types used by the test bed. At present,
+ * only the mpi_mssg derived type is needed.
*
- * Return: Success: TRUE
+ * Return: Success: TRUE
*
- * Failure: FALSE
+ * Failure: FALSE
*
- * Programmer: JRM -- 12/22/05
+ * Programmer: JRM -- 12/22/05
*
*****************************************************************************/
static hbool_t
@@ -1322,16 +1321,16 @@ takedown_derived_types(void)
/*****************************************************************************
*
- * Function: reset_server_counters()
+ * Function: reset_server_counters()
*
- * Purpose: Reset the counters maintained by the server, doing a
- * sanity check in passing.
+ * Purpose: Reset the counters maintained by the server, doing a
+ * sanity check in passing.
*
- * Return: Success: TRUE
+ * Return: Success: TRUE
*
- * Failure: FALSE
+ * Failure: FALSE
*
- * Programmer: JRM -- 5/5/10
+ * Programmer: JRM -- 5/5/10
*
*****************************************************************************/
static hbool_t
@@ -1363,7 +1362,7 @@ reset_server_counters(void)
nerrors++;
if ( verbose ) {
HDfprintf(stdout, "%d:%s: actual/total reads mismatch (%ld/%ld).\n",
- world_mpi_rank, FUNC,
+ world_mpi_rank, FUNC,
actual_total_reads, total_reads);
}
}
@@ -1374,7 +1373,7 @@ reset_server_counters(void)
nerrors++;
if ( verbose ) {
HDfprintf(stdout, "%d:%s: actual/total writes mismatch (%ld/%ld).\n",
- world_mpi_rank, FUNC,
+ world_mpi_rank, FUNC,
actual_total_writes, total_writes);
}
}
@@ -1389,25 +1388,25 @@ reset_server_counters(void)
/*****************************************************************************
*
- * Function: server_main()
+ * Function: server_main()
*
- * Purpose: Main function for the server process. This process exists
- * to provide an independant view of the data array.
+ * Purpose: Main function for the server process. This process exists
+ * to provide an independant view of the data array.
*
- * The function handles request from the other processes in
- * the test until the count of done messages received equals
- * the number of client processes.
+ * The function handles request from the other processes in
+ * the test until the count of done messages received equals
+ * the number of client processes.
*
- * Return: Success: TRUE
+ * Return: Success: TRUE
*
- * Failure: FALSE
+ * Failure: FALSE
*
- * Programmer: JRM -- 12/22/05
+ * Programmer: JRM -- 12/22/05
*
* Modifications:
*
- * JRM -- 5/10/06
- * Updated for sync message.
+ * JRM -- 5/10/06
+ * Updated for sync message.
*
*****************************************************************************/
static hbool_t
@@ -1437,98 +1436,98 @@ server_main(void)
switch ( mssg.req )
{
- case WRITE_REQ_CODE:
- success = serve_write_request(&mssg);
- break;
+ case WRITE_REQ_CODE:
+ success = serve_write_request(&mssg);
+ break;
- case WRITE_REQ_ACK_CODE:
+ case WRITE_REQ_ACK_CODE:
success = FALSE;
if(verbose)
HDfprintf(stdout, "%s: Received write ack?!?.\n", FUNC);
- break;
+ break;
- case READ_REQ_CODE:
+ case READ_REQ_CODE:
success = serve_read_request(&mssg);
- break;
+ break;
- case READ_REQ_REPLY_CODE:
+ case READ_REQ_REPLY_CODE:
success = FALSE;
if(verbose)
HDfprintf(stdout, "%s: Received read req reply?!?.\n", FUNC);
- break;
+ break;
- case SYNC_REQ_CODE:
+ case SYNC_REQ_CODE:
success = serve_sync_request(&mssg);
- break;
+ break;
- case SYNC_ACK_CODE:
+ case SYNC_ACK_CODE:
success = FALSE;
if(verbose)
HDfprintf(stdout, "%s: Received sync ack?!?.\n", FUNC);
- break;
+ break;
- case REQ_TTL_WRITES_CODE:
- success = serve_total_writes_request(&mssg);
- break;
+ case REQ_TTL_WRITES_CODE:
+ success = serve_total_writes_request(&mssg);
+ break;
- case REQ_TTL_WRITES_RPLY_CODE:
+ case REQ_TTL_WRITES_RPLY_CODE:
success = FALSE;
if(verbose)
HDfprintf(stdout, "%s: Received total writes reply?!?.\n", FUNC);
- break;
+ break;
- case REQ_TTL_READS_CODE:
- success = serve_total_reads_request(&mssg);
- break;
+ case REQ_TTL_READS_CODE:
+ success = serve_total_reads_request(&mssg);
+ break;
- case REQ_TTL_READS_RPLY_CODE:
+ case REQ_TTL_READS_RPLY_CODE:
success = FALSE;
if(verbose)
HDfprintf(stdout, "%s: Received total reads reply?!?.\n", FUNC);
- break;
+ break;
- case REQ_ENTRY_WRITES_CODE:
- success = serve_entry_writes_request(&mssg);
- break;
+ case REQ_ENTRY_WRITES_CODE:
+ success = serve_entry_writes_request(&mssg);
+ break;
- case REQ_ENTRY_WRITES_RPLY_CODE:
+ case REQ_ENTRY_WRITES_RPLY_CODE:
success = FALSE;
if(verbose)
HDfprintf(stdout, "%s: Received entry writes reply?!?.\n", FUNC);
- break;
+ break;
- case REQ_ENTRY_READS_CODE:
- success = serve_entry_reads_request(&mssg);
- break;
+ case REQ_ENTRY_READS_CODE:
+ success = serve_entry_reads_request(&mssg);
+ break;
- case REQ_ENTRY_READS_RPLY_CODE:
+ case REQ_ENTRY_READS_RPLY_CODE:
success = FALSE;
if(verbose)
HDfprintf(stdout, "%s: Received entry reads reply?!?.\n", FUNC);
- break;
+ break;
- case REQ_RW_COUNT_RESET_CODE:
- success = serve_rw_count_reset_request(&mssg);
- break;
+ case REQ_RW_COUNT_RESET_CODE:
+ success = serve_rw_count_reset_request(&mssg);
+ break;
- case REQ_RW_COUNT_RESET_RPLY_CODE:
+ case REQ_RW_COUNT_RESET_RPLY_CODE:
success = FALSE;
if(verbose)
HDfprintf(stdout, "%s: Received RW count reset reply?!?.\n", FUNC);
- break;
+ break;
- case DONE_REQ_CODE:
- done_count++;
- if(done_count >= file_mpi_size)
- done = TRUE;
- break;
+ case DONE_REQ_CODE:
+ done_count++;
+ if(done_count >= file_mpi_size)
+ done = TRUE;
+ break;
- default:
+ default:
nerrors++;
success = FALSE;
if(verbose)
- HDfprintf(stdout, "%d:%s: Unknown request code.\n", world_mpi_rank, FUNC);
- break;
+ HDfprintf(stdout, "%d:%s: Unknown request code.\n", world_mpi_rank, FUNC);
+ break;
}
}
}
@@ -1537,23 +1536,23 @@ server_main(void)
} /* server_main() */
-
+
/*****************************************************************************
*
- * Function: serve_read_request()
+ * Function: serve_read_request()
*
- * Purpose: Serve a read request.
+ * Purpose: Serve a read request.
*
- * The function accepts a pointer to an instance of struct
- * mssg_t as input. If all sanity checks pass, it sends
- * a copy of the indicated datum from the data array to
- * the requesting process.
+ * The function accepts a pointer to an instance of struct
+ * mssg_t as input. If all sanity checks pass, it sends
+ * a copy of the indicated datum from the data array to
+ * the requesting process.
*
- * Return: Success: TRUE
+ * Return: Success: TRUE
*
- * Failure: FALSE
+ * Failure: FALSE
*
- * Programmer: JRM -- 12/22/05
+ * Programmer: JRM -- 12/22/05
*
*****************************************************************************/
static hbool_t
@@ -1609,8 +1608,8 @@ serve_read_request(struct mssg_t * mssg_ptr)
"%d:%s: proc %d read invalid entry. idx/base_addr = %d/%a.\n",
world_mpi_rank, FUNC,
mssg_ptr->src,
- target_index,
- data[target_index].base_addr);
+ target_index,
+ data[target_index].base_addr);
}
} else {
@@ -1622,11 +1621,11 @@ serve_read_request(struct mssg_t * mssg_ptr)
reply.base_addr = data[target_index].base_addr;
reply.len = data[target_index].len;
reply.ver = data[target_index].ver;
- reply.count = 0;
+ reply.count = 0;
reply.magic = MSSG_MAGIC;
- /* and update the counters */
- total_reads++;
+ /* and update the counters */
+ total_reads++;
(data[target_index].reads)++;
}
}
@@ -1641,7 +1640,7 @@ serve_read_request(struct mssg_t * mssg_ptr)
if ( success ) {
HDfprintf(stdout, "%d read 0x%llx. len = %d. ver = %d.\n",
- (int)(mssg_ptr->src),
+ (int)(mssg_ptr->src),
(long long)(data[target_index].base_addr),
(int)(data[target_index].len),
(int)(data[target_index].ver));
@@ -1649,38 +1648,38 @@ serve_read_request(struct mssg_t * mssg_ptr)
} else {
HDfprintf(stdout, "%d read 0x%llx FAILED. len = %d. ver = %d.\n",
- (int)(mssg_ptr->src),
+ (int)(mssg_ptr->src),
(long long)(data[target_index].base_addr),
(int)(data[target_index].len),
(int)(data[target_index].ver));
}
- }
+ }
return(success);
} /* serve_read_request() */
-
+
/*****************************************************************************
*
- * Function: serve_sync_request()
+ * Function: serve_sync_request()
*
- * Purpose: Serve a sync request.
+ * Purpose: Serve a sync request.
*
- * The function accepts a pointer to an instance of struct
- * mssg_t as input. If all sanity checks pass, it sends a
- * sync ack to the requesting process.
+ * The function accepts a pointer to an instance of struct
+ * mssg_t as input. If all sanity checks pass, it sends a
+ * sync ack to the requesting process.
*
- * This service exist to allow the sending process to ensure
- * that all previous messages have been processed before
- * proceeding.
+ * This service exist to allow the sending process to ensure
+ * that all previous messages have been processed before
+ * proceeding.
*
- * Return: Success: TRUE
+ * Return: Success: TRUE
*
- * Failure: FALSE
+ * Failure: FALSE
*
- * Programmer: JRM -- 5/10/06
+ * Programmer: JRM -- 5/10/06
*
*****************************************************************************/
static hbool_t
@@ -1712,7 +1711,7 @@ serve_sync_request(struct mssg_t * mssg_ptr)
reply.base_addr = 0;
reply.len = 0;
reply.ver = 0;
- reply.count = 0;
+ reply.count = 0;
reply.magic = MSSG_MAGIC;
}
@@ -1732,29 +1731,29 @@ serve_sync_request(struct mssg_t * mssg_ptr)
HDfprintf(stdout, "%d sync FAILED.\n", (int)(mssg_ptr->src));
}
- }
+ }
return(success);
} /* serve_sync_request() */
-
+
/*****************************************************************************
*
- * Function: serve_write_request()
+ * Function: serve_write_request()
*
- * Purpose: Serve a write request.
+ * Purpose: Serve a write request.
*
- * The function accepts a pointer to an instance of struct
- * mssg_t as input. If all sanity checks pass, it updates
- * the version number of the target data array entry as
- * specified in the message.
+ * The function accepts a pointer to an instance of struct
+ * mssg_t as input. If all sanity checks pass, it updates
+ * the version number of the target data array entry as
+ * specified in the message.
*
- * Return: Success: TRUE
+ * Return: Success: TRUE
*
- * Failure: FALSE
+ * Failure: FALSE
*
- * Programmer: JRM -- 12/21/05
+ * Programmer: JRM -- 12/21/05
*
*****************************************************************************/
static hbool_t
@@ -1812,7 +1811,7 @@ serve_write_request(struct mssg_t * mssg_ptr)
new_ver_num = mssg_ptr->ver;
/* this check should catch duplicate writes */
- if ( new_ver_num <= data[target_index].ver ) {
+ if ( new_ver_num <= data[target_index].ver ) {
nerrors++;
success = FALSE;
@@ -1826,12 +1825,12 @@ serve_write_request(struct mssg_t * mssg_ptr)
if ( success ) {
- /* process the write */
+ /* process the write */
data[target_index].ver = new_ver_num;
data[target_index].valid = TRUE;
/* and update the counters */
- total_writes++;
+ total_writes++;
(data[target_index].writes)++;
#if DO_WRITE_REQ_ACK
@@ -1847,7 +1846,7 @@ serve_write_request(struct mssg_t * mssg_ptr)
reply.count = 0;
reply.magic = MSSG_MAGIC;
- /* and send it */
+ /* and send it */
success = send_mssg(&reply, TRUE);
#endif /* DO_WRITE_REQ_ACK */
@@ -1859,7 +1858,7 @@ serve_write_request(struct mssg_t * mssg_ptr)
if ( success ) {
HDfprintf(stdout, "%d write 0x%llx. len = %d. ver = %d.\n",
- (int)(mssg_ptr->src),
+ (int)(mssg_ptr->src),
(long long)(data[target_index].base_addr),
(int)(data[target_index].len),
(int)(data[target_index].ver));
@@ -1867,36 +1866,36 @@ serve_write_request(struct mssg_t * mssg_ptr)
} else {
HDfprintf(stdout, "%d write 0x%llx FAILED. len = %d. ver = %d.\n",
- (int)(mssg_ptr->src),
+ (int)(mssg_ptr->src),
(long long)(data[target_index].base_addr),
(int)(data[target_index].len),
(int)(data[target_index].ver));
}
- }
+ }
return(success);
} /* serve_write_request() */
-
+
/*****************************************************************************
*
- * Function: serve_total_writes_request()
+ * Function: serve_total_writes_request()
*
- * Purpose: Serve a request for the total number of writes recorded since
- * the last reset.
+ * Purpose: Serve a request for the total number of writes recorded since
+ * the last reset.
*
- * The function accepts a pointer to an instance of struct
- * mssg_t as input. If all sanity checks pass, it sends
- * the current value of the total_writes global variable to
- * the requesting process.
+ * The function accepts a pointer to an instance of struct
+ * mssg_t as input. If all sanity checks pass, it sends
+ * the current value of the total_writes global variable to
+ * the requesting process.
*
- * Return: Success: TRUE
+ * Return: Success: TRUE
*
- * Failure: FALSE
+ * Failure: FALSE
*
- * Programmer: JRM -- 5/5/10
+ * Programmer: JRM -- 5/5/10
*
*****************************************************************************/
static hbool_t
@@ -1942,40 +1941,40 @@ serve_total_writes_request(struct mssg_t * mssg_ptr)
if ( success ) {
HDfprintf(stdout, "%d request total writes %ld.\n",
- (int)(mssg_ptr->src),
+ (int)(mssg_ptr->src),
total_writes);
} else {
HDfprintf(stdout, "%d request total writes %ld -- FAILED.\n",
- (int)(mssg_ptr->src),
+ (int)(mssg_ptr->src),
total_writes);
}
- }
+ }
return(success);
} /* serve_total_writes_request() */
-
+
/*****************************************************************************
*
- * Function: serve_total_reads_request()
+ * Function: serve_total_reads_request()
*
- * Purpose: Serve a request for the total number of reads recorded since
- * the last reset.
+ * Purpose: Serve a request for the total number of reads recorded since
+ * the last reset.
*
- * The function accepts a pointer to an instance of struct
- * mssg_t as input. If all sanity checks pass, it sends
- * the current value of the total_reads global variable to
- * the requesting process.
+ * The function accepts a pointer to an instance of struct
+ * mssg_t as input. If all sanity checks pass, it sends
+ * the current value of the total_reads global variable to
+ * the requesting process.
*
- * Return: Success: TRUE
+ * Return: Success: TRUE
*
- * Failure: FALSE
+ * Failure: FALSE
*
- * Programmer: JRM -- 5/5/10
+ * Programmer: JRM -- 5/5/10
*
*****************************************************************************/
static hbool_t
@@ -2021,40 +2020,40 @@ serve_total_reads_request(struct mssg_t * mssg_ptr)
if ( success ) {
HDfprintf(stdout, "%d request total reads %ld.\n",
- (int)(mssg_ptr->src),
+ (int)(mssg_ptr->src),
total_reads);
} else {
HDfprintf(stdout, "%d request total reads %ld -- FAILED.\n",
- (int)(mssg_ptr->src),
+ (int)(mssg_ptr->src),
total_reads);
}
- }
+ }
return(success);
} /* serve_total_reads_request() */
-
+
/*****************************************************************************
*
- * Function: serve_entry_writes_request()
+ * Function: serve_entry_writes_request()
*
- * Purpose: Serve an entry writes request.
+ * Purpose: Serve an entry writes request.
*
- * The function accepts a pointer to an instance of struct
- * mssg_t as input. If all sanity checks pass, it sends
- * the number of times that the indicated datum has been
- * written since the last counter reset to the requesting
- * process.
+ * The function accepts a pointer to an instance of struct
+ * mssg_t as input. If all sanity checks pass, it sends
+ * the number of times that the indicated datum has been
+ * written since the last counter reset to the requesting
+ * process.
*
- * Return: Success: TRUE
+ * Return: Success: TRUE
*
- * Failure: FALSE
+ * Failure: FALSE
*
- * Programmer: JRM -- 5/5/10
+ * Programmer: JRM -- 5/5/10
*
*****************************************************************************/
static hbool_t
@@ -2101,7 +2100,7 @@ serve_entry_writes_request(struct mssg_t * mssg_ptr)
reply.base_addr = target_addr;
reply.len = 0;
reply.ver = 0;
- reply.count = data[target_index].writes;
+ reply.count = data[target_index].writes;
reply.magic = MSSG_MAGIC;
}
}
@@ -2116,42 +2115,42 @@ serve_entry_writes_request(struct mssg_t * mssg_ptr)
if ( success ) {
HDfprintf(stdout, "%d request entry 0x%llx writes = %ld.\n",
- (int)(mssg_ptr->src),
+ (int)(mssg_ptr->src),
(long long)(data[target_index].base_addr),
(long)(data[target_index].writes));
} else {
HDfprintf(stdout, "%d request entry 0x%llx writes = %ld FAILED.\n",
- (int)(mssg_ptr->src),
+ (int)(mssg_ptr->src),
(long long)(data[target_index].base_addr),
(long)(data[target_index].writes));
}
- }
+ }
return(success);
} /* serve_entry_writes_request() */
-
+
/*****************************************************************************
*
- * Function: serve_entry_reads_request()
+ * Function: serve_entry_reads_request()
*
- * Purpose: Serve an entry reads request.
+ * Purpose: Serve an entry reads request.
*
- * The function accepts a pointer to an instance of struct
- * mssg_t as input. If all sanity checks pass, it sends
- * the number of times that the indicated datum has been
- * read since the last counter reset to the requesting
- * process.
+ * The function accepts a pointer to an instance of struct
+ * mssg_t as input. If all sanity checks pass, it sends
+ * the number of times that the indicated datum has been
+ * read since the last counter reset to the requesting
+ * process.
*
- * Return: Success: TRUE
+ * Return: Success: TRUE
*
- * Failure: FALSE
+ * Failure: FALSE
*
- * Programmer: JRM -- 5/5/10
+ * Programmer: JRM -- 5/5/10
*
*****************************************************************************/
static hbool_t
@@ -2198,7 +2197,7 @@ serve_entry_reads_request(struct mssg_t * mssg_ptr)
reply.base_addr = target_addr;
reply.len = 0;
reply.ver = 0;
- reply.count = (long)(data[target_index].reads);
+ reply.count = (long)(data[target_index].reads);
reply.magic = MSSG_MAGIC;
}
}
@@ -2213,41 +2212,41 @@ serve_entry_reads_request(struct mssg_t * mssg_ptr)
if ( success ) {
HDfprintf(stdout, "%d request entry 0x%llx reads = %ld.\n",
- (int)(mssg_ptr->src),
+ (int)(mssg_ptr->src),
(long long)(data[target_index].base_addr),
(long)(data[target_index].reads));
} else {
HDfprintf(stdout, "%d request entry 0x%llx reads = %ld FAILED.\n",
- (int)(mssg_ptr->src),
+ (int)(mssg_ptr->src),
(long long)(data[target_index].base_addr),
(long)(data[target_index].reads));
}
- }
+ }
return(success);
} /* serve_entry_reads_request() */
-
+
/*****************************************************************************
*
- * Function: serve_rw_count_reset_request()
+ * Function: serve_rw_count_reset_request()
*
- * Purpose: Serve read/write count reset request.
+ * Purpose: Serve read/write count reset request.
*
- * The function accepts a pointer to an instance of struct
- * mssg_t as input. If all sanity checks pass, it resets the
- * read/write counters, and sends a confirmation message to
- * the calling process.
+ * The function accepts a pointer to an instance of struct
+ * mssg_t as input. If all sanity checks pass, it resets the
+ * read/write counters, and sends a confirmation message to
+ * the calling process.
*
- * Return: Success: TRUE
+ * Return: Success: TRUE
*
- * Failure: FALSE
+ * Failure: FALSE
*
- * Programmer: JRM -- 5/5/10
+ * Programmer: JRM -- 5/5/10
*
*****************************************************************************/
static hbool_t
@@ -2272,7 +2271,7 @@ serve_rw_count_reset_request(struct mssg_t * mssg_ptr)
if ( success ) {
success = reset_server_counters();
- }
+ }
if ( success ) {
@@ -2306,7 +2305,7 @@ serve_rw_count_reset_request(struct mssg_t * mssg_ptr)
(int)(mssg_ptr->src));
}
- }
+ }
return(success);
@@ -2317,15 +2316,15 @@ serve_rw_count_reset_request(struct mssg_t * mssg_ptr)
/**************************** Call back functions ****************************/
/*****************************************************************************/
-
+
/*-------------------------------------------------------------------------
- * Function: datum_get_initial_load_size
+ * Function: datum_get_initial_load_size
*
- * Purpose: Query the image size for an entry before deserializing it
+ * Purpose: Query the image size for an entry before deserializing it
*
- * Return: SUCCEED
+ * Return: SUCCEED
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* 5/18/10
*
*-------------------------------------------------------------------------
@@ -2355,9 +2354,9 @@ datum_get_initial_load_size(void *udata_ptr, size_t *image_len_ptr)
if ( callbacks_verbose ) {
HDfprintf(stdout,
- "%d: get_initial_load_size() idx = %d, addr = %ld, len = %d.\n",
+ "%d: get_initial_load_size() idx = %d, addr = %ld, len = %d.\n",
world_mpi_rank, idx, (long)addr, (int)entry_ptr->local_len);
- fflush(stdout);
+ fflush(stdout);
}
/* Set image length size */
@@ -2366,15 +2365,15 @@ datum_get_initial_load_size(void *udata_ptr, size_t *image_len_ptr)
return(SUCCEED);
} /* get_initial_load_size() */
-
+
/*-------------------------------------------------------------------------
- * Function: datum_deserialize
+ * Function: datum_deserialize
*
- * Purpose: deserialize the entry.
+ * Purpose: deserialize the entry.
*
- * Return: void * (pointer to the in core representation of the entry)
+ * Return: void * (pointer to the in core representation of the entry)
*
- * Programmer: John Mainzer
+ * Programmer: John Mainzer
* 9/20/07
*
*-------------------------------------------------------------------------
@@ -2409,10 +2408,10 @@ datum_deserialize(const void * image_ptr,
if ( callbacks_verbose ) {
HDfprintf(stdout,
- "%d: deserialize() idx = %d, addr = %ld, len = %d, is_dirty = %d.\n",
- world_mpi_rank, idx, (long)addr, (int)len,
- (int)(entry_ptr->header.is_dirty));
- fflush(stdout);
+ "%d: deserialize() idx = %d, addr = %ld, len = %d, is_dirty = %d.\n",
+ world_mpi_rank, idx, (long)addr, (int)len,
+ (int)(entry_ptr->header.is_dirty));
+ fflush(stdout);
}
*dirty_ptr = FALSE;
@@ -2427,18 +2426,18 @@ datum_deserialize(const void * image_ptr,
} /* deserialize() */
-
+
/*-------------------------------------------------------------------------
- * Function: datum_image_len
+ * Function: datum_image_len
*
- * Purpose: Return the real (and possibly reduced) length of the image.
- * The helper functions verify that the correct version of
- * deserialize is being called, and then call deserialize
- * proper.
+ * Purpose: Return the real (and possibly reduced) length of the image.
+ * The helper functions verify that the correct version of
+ * deserialize is being called, and then call deserialize
+ * proper.
*
- * Return: SUCCEED
+ * Return: SUCCEED
*
- * Programmer: John Mainzer
+ * Programmer: John Mainzer
* 9/19/07
*
*-------------------------------------------------------------------------
@@ -2465,10 +2464,10 @@ datum_image_len(const void *thing, size_t *image_len)
if(callbacks_verbose) {
HDfprintf(stdout,
- "%d: image_len() idx = %d, addr = %ld, len = %d.\n",
- world_mpi_rank, idx, (long)(entry_ptr->base_addr),
- (int)(entry_ptr->local_len));
- fflush(stdout);
+ "%d: image_len() idx = %d, addr = %ld, len = %d.\n",
+ world_mpi_rank, idx, (long)(entry_ptr->base_addr),
+ (int)(entry_ptr->local_len));
+ fflush(stdout);
}
HDassert( entry_ptr->header.addr == entry_ptr->base_addr );
@@ -2478,15 +2477,15 @@ datum_image_len(const void *thing, size_t *image_len)
return(SUCCEED);
} /* datum_image_len() */
-
+
/*-------------------------------------------------------------------------
- * Function: datum_serialize
+ * Function: datum_serialize
*
- * Purpose: Serialize the supplied entry.
+ * Purpose: Serialize the supplied entry.
*
- * Return: SUCCEED if successful, FAIL otherwise.
+ * Return: SUCCEED if successful, FAIL otherwise.
*
- * Programmer: John Mainzer
+ * Programmer: John Mainzer
* 10/30/07
*
*-------------------------------------------------------------------------
@@ -2511,11 +2510,11 @@ datum_serialize(const H5F_t *f,
HDassert( f );
HDassert( f->shared );
HDassert( f->shared->cache );
-
+
cache_ptr = f->shared->cache;
HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC );
- HDassert( cache_ptr->aux_ptr );
+ HDassert( cache_ptr->aux_ptr );
aux_ptr = (H5AC_aux_t *)(f->shared->cache->aux_ptr);
@@ -2534,9 +2533,9 @@ datum_serialize(const H5F_t *f,
if ( callbacks_verbose ) {
HDfprintf(stdout,
- "%d: serialize() idx = %d, addr = %ld, len = %d.\n",
- world_mpi_rank, idx, (long)entry_ptr->header.addr, (int)len);
- fflush(stdout);
+ "%d: serialize() idx = %d, addr = %ld, len = %d.\n",
+ world_mpi_rank, idx, (long)entry_ptr->header.addr, (int)len);
+ fflush(stdout);
}
HDassert( entry_ptr->header.addr == entry_ptr->base_addr );
@@ -2557,16 +2556,16 @@ datum_serialize(const H5F_t *f,
} /* datum_serialize() */
-
+
/*-------------------------------------------------------------------------
- * Function: datum_notify
+ * Function: datum_notify
*
- * Purpose: Do the communication with the server we used to do in the
- * flush and load callbacks in the version 2 cache.
+ * Purpose: Do the communication with the server we used to do in the
+ * flush and load callbacks in the version 2 cache.
*
- * Return: SUCCEED
+ * Return: SUCCEED
*
- * Programmer: John Mainzer
+ * Programmer: John Mainzer
* 1/12/15
*
*-------------------------------------------------------------------------
@@ -2596,7 +2595,7 @@ datum_notify(H5C_notify_action_t action, void *thing)
HDfprintf(stdout,
"%d: notify() action = %d, idx = %d, addr = %ld.\n",
- world_mpi_rank, (int) action, idx,
+ world_mpi_rank, (int) action, idx,
(long)entry_ptr->header.addr);
fflush(stdout);
}
@@ -2685,62 +2684,62 @@ datum_notify(H5C_notify_action_t action, void *thing)
}
#if 0 /* This has been useful debugging code -- keep it for now. */
- if ( mssg.req != READ_REQ_REPLY_CODE ) {
+ if ( mssg.req != READ_REQ_REPLY_CODE ) {
- HDfprintf(stdout,
+ HDfprintf(stdout,
"%d:%s: mssg.req != READ_REQ_REPLY_CODE.\n",
- world_mpi_rank, FUNC);
- HDfprintf(stdout, "%d:%s: mssg.req = %d.\n",
- world_mpi_rank, FUNC, (int)(mssg.req));
- }
+ world_mpi_rank, FUNC);
+ HDfprintf(stdout, "%d:%s: mssg.req = %d.\n",
+ world_mpi_rank, FUNC, (int)(mssg.req));
+ }
- if ( mssg.src != world_server_mpi_rank ) {
+ if ( mssg.src != world_server_mpi_rank ) {
- HDfprintf(stdout,
+ HDfprintf(stdout,
"%d:%s: mssg.src != world_server_mpi_rank.\n",
- world_mpi_rank, FUNC);
- }
+ world_mpi_rank, FUNC);
+ }
- if ( mssg.dest != world_mpi_rank ) {
+ if ( mssg.dest != world_mpi_rank ) {
- HDfprintf(stdout,
+ HDfprintf(stdout,
"%d:%s: mssg.dest != world_mpi_rank.\n",
- world_mpi_rank, FUNC);
+ world_mpi_rank, FUNC);
}
- if ( mssg.base_addr != entry_ptr->base_addr ) {
+ if ( mssg.base_addr != entry_ptr->base_addr ) {
- HDfprintf(stdout,
- "%d:%s: mssg.base_addr != entry_ptr->base_addr.\n",
- world_mpi_rank, FUNC);
- HDfprintf(stdout, "%d:%s: mssg.base_addr = %a.\n",
- world_mpi_rank, FUNC, mssg.base_addr);
- HDfprintf(stdout,
+ HDfprintf(stdout,
+ "%d:%s: mssg.base_addr != entry_ptr->base_addr.\n",
+ world_mpi_rank, FUNC);
+ HDfprintf(stdout, "%d:%s: mssg.base_addr = %a.\n",
+ world_mpi_rank, FUNC, mssg.base_addr);
+ HDfprintf(stdout,
"%d:%s: entry_ptr->base_addr = %a.\n",
- world_mpi_rank, FUNC,
+ world_mpi_rank, FUNC,
entry_ptr->base_addr);
}
- if ( mssg.len != entry_ptr->len ) {
+ if ( mssg.len != entry_ptr->len ) {
- HDfprintf(stdout,
+ HDfprintf(stdout,
"%d:%s: mssg.len != entry_ptr->len.\n",
- world_mpi_rank, FUNC);
- HDfprintf(stdout, "%d:%s: mssg.len = %a.\n",
- world_mpi_rank, FUNC, mssg.len);
+ world_mpi_rank, FUNC);
+ HDfprintf(stdout, "%d:%s: mssg.len = %a.\n",
+ world_mpi_rank, FUNC, mssg.len);
}
- if ( mssg.ver < entry_ptr->ver ) {
+ if ( mssg.ver < entry_ptr->ver ) {
- HDfprintf(stdout,
+ HDfprintf(stdout,
"%d:%s: mssg.ver < entry_ptr->ver.\n",
- world_mpi_rank, FUNC);
+ world_mpi_rank, FUNC);
}
- if ( mssg.magic != MSSG_MAGIC ) {
+ if ( mssg.magic != MSSG_MAGIC ) {
- HDfprintf(stdout, "%d:%s: mssg.magic != MSSG_MAGIC.\n",
- world_mpi_rank, FUNC);
+ HDfprintf(stdout, "%d:%s: mssg.magic != MSSG_MAGIC.\n",
+ world_mpi_rank, FUNC);
}
#endif /* JRM */
@@ -2753,7 +2752,7 @@ datum_notify(H5C_notify_action_t action, void *thing)
}
break;
- case H5C_NOTIFY_ACTION_AFTER_FLUSH:
+ case H5C_NOTIFY_ACTION_AFTER_FLUSH:
if ( callbacks_verbose ) {
HDfprintf(stdout,
@@ -2767,11 +2766,11 @@ datum_notify(H5C_notify_action_t action, void *thing)
aux_ptr = entry_ptr->aux_ptr;
entry_ptr->aux_ptr = NULL;
- HDassert(entry_ptr->header.is_dirty); /* JRM */
+ HDassert(entry_ptr->header.is_dirty); /* JRM */
- if ( ( file_mpi_rank != 0 ) &&
+ if ( ( file_mpi_rank != 0 ) &&
( entry_ptr->dirty ) &&
- ( aux_ptr->metadata_write_strategy ==
+ ( aux_ptr->metadata_write_strategy ==
H5AC_METADATA_WRITE_STRATEGY__PROCESS_0_ONLY ) ) {
ret_value = FAIL;
@@ -2784,8 +2783,8 @@ datum_notify(H5C_notify_action_t action, void *thing)
if ( entry_ptr->header.is_dirty ) {
- was_dirty = TRUE; /* so we will receive the ack
- * if requested
+ was_dirty = TRUE; /* so we will receive the ack
+ * if requested
*/
/* compose the message */
@@ -2811,7 +2810,7 @@ datum_notify(H5C_notify_action_t action, void *thing)
else
{
entry_ptr->dirty = FALSE;
- entry_ptr->flushed = TRUE;
+ entry_ptr->flushed = TRUE;
}
}
}
@@ -2839,7 +2838,7 @@ datum_notify(H5C_notify_action_t action, void *thing)
nerrors++;
ret_value = FAIL;
if ( verbose ) {
- HDfprintf(stdout,
+ HDfprintf(stdout,
"%d:%s: Bad data in write req ack.\n",
world_mpi_rank, FUNC);
}
@@ -2855,7 +2854,7 @@ datum_notify(H5C_notify_action_t action, void *thing)
datum_pinned_flushes++;
HDassert(entry_ptr->global_pinned || entry_ptr->local_pinned);
}
- break;
+ break;
case H5AC_NOTIFY_ACTION_BEFORE_EVICT:
if ( callbacks_verbose ) {
@@ -2950,33 +2949,33 @@ datum_notify(H5C_notify_action_t action, void *thing)
/* do nothing */
break;
- default:
+ default:
nerrors++;
ret_value = FAIL;
if ( verbose ) {
HDfprintf(stdout, "%d:%s: Unknown notify action.\n",
world_mpi_rank, FUNC);
}
- break;
+ break;
}
return(ret_value);
} /* datum_notify() */
-
+
/*-------------------------------------------------------------------------
- * Function: datum_free_icr
+ * Function: datum_free_icr
*
- * Purpose: Nominally, this callback is supposed to free the
- * in core representation of the entry.
+ * Purpose: Nominally, this callback is supposed to free the
+ * in core representation of the entry.
*
- * In the context of this test bed, we use it to do
- * do all the processing we used to do on a destroy.
+ * In the context of this test bed, we use it to do
+ * do all the processing we used to do on a destroy.
*
- * Return: SUCCEED
+ * Return: SUCCEED
*
- * Programmer: John Mainzer
+ * Programmer: John Mainzer
* 9/19/07
*
*-------------------------------------------------------------------------
@@ -3001,9 +3000,9 @@ datum_free_icr(void * thing)
if ( callbacks_verbose ) {
HDfprintf(stdout,
- "%d: free_icr() idx = %d, dirty = %d.\n",
- world_mpi_rank, idx, (int)(entry_ptr->dirty));
- fflush(stdout);
+ "%d: free_icr() idx = %d, dirty = %d.\n",
+ world_mpi_rank, idx, (int)(entry_ptr->dirty));
+ fflush(stdout);
}
HDassert( entry_ptr->header.addr == entry_ptr->base_addr );
@@ -3020,7 +3019,7 @@ datum_free_icr(void * thing)
return(SUCCEED);
} /* datum_free_icr() */
-
+
/*****************************************************************************/
/************************** test utility functions ***************************/
/*****************************************************************************/
@@ -3029,9 +3028,9 @@ datum_free_icr(void * thing)
* Function: expunge_entry()
*
* Purpose: Expunge the entry indicated by the type and index, mark it
- * as clean, and don't increment its version number.
+ * as clean, and don't increment its version number.
*
- * Do nothing if nerrors is non-zero on entry.
+ * Do nothing if nerrors is non-zero on entry.
*
* Return: void
*
@@ -3062,36 +3061,36 @@ expunge_entry(H5F_t * file_ptr,
if ( nerrors == 0 ) {
result = H5AC_expunge_entry(file_ptr, (hid_t)-1, &(types[0]),
- entry_ptr->header.addr, H5AC__NO_FLAGS_SET);
+ entry_ptr->header.addr, H5AC__NO_FLAGS_SET);
if ( result < 0 ) {
nerrors++;
if ( verbose ) {
- HDfprintf(stdout, "%d:%s: Error in H5AC_expunge_entry().\n",
- world_mpi_rank, FUNC);
+ HDfprintf(stdout, "%d:%s: Error in H5AC_expunge_entry().\n",
+ world_mpi_rank, FUNC);
}
}
HDassert( ((entry_ptr->header).type)->id == DATUM_ENTRY_TYPE );
- HDassert( ! ((entry_ptr->header).is_dirty) );
+ HDassert( ! ((entry_ptr->header).is_dirty) );
- result = H5C_get_entry_status(file_ptr, entry_ptr->base_addr,
- NULL, &in_cache, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+ result = H5C_get_entry_status(file_ptr, entry_ptr->base_addr,
+ NULL, &in_cache, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
- if ( result < 0 ) {
+ if ( result < 0 ) {
nerrors++;
if ( verbose ) {
- HDfprintf(stdout, "%d:%s: Error in H5C_get_entry_status().\n",
- world_mpi_rank, FUNC);
+ HDfprintf(stdout, "%d:%s: Error in H5C_get_entry_status().\n",
+ world_mpi_rank, FUNC);
}
} else if ( in_cache ) {
nerrors++;
if ( verbose ) {
- HDfprintf(stdout, "%d:%s: Expunged entry still in cache?!?\n",
- world_mpi_rank, FUNC);
+ HDfprintf(stdout, "%d:%s: Expunged entry still in cache?!?\n",
+ world_mpi_rank, FUNC);
}
}
}
@@ -3100,14 +3099,14 @@ expunge_entry(H5F_t * file_ptr,
} /* expunge_entry() */
-
+
/*****************************************************************************
* Function: insert_entry()
*
* Purpose: Insert the entry indicated by the type and index, mark it
- * as dirty, and increment its version number.
+ * as dirty, and increment its version number.
*
- * Do nothing if nerrors is non-zero on entry.
+ * Do nothing if nerrors is non-zero on entry.
*
* Return: void
*
@@ -3158,33 +3157,33 @@ insert_entry(H5C_t * cache_ptr,
nerrors++;
if ( verbose ) {
- HDfprintf(stdout, "%d:%s: Error in H5AC_insert_entry().\n",
- world_mpi_rank, FUNC);
+ HDfprintf(stdout, "%d:%s: Error in H5AC_insert_entry().\n",
+ world_mpi_rank, FUNC);
}
}
if ( ! (entry_ptr->header.is_dirty) ) {
- /* it is possible that we just exceeded the dirty bytes
- * threshold, triggering a write of the newly inserted
- * entry. Test for this, and only flag an error if this
- * is not the case.
- */
+ /* it is possible that we just exceeded the dirty bytes
+ * threshold, triggering a write of the newly inserted
+ * entry. Test for this, and only flag an error if this
+ * is not the case.
+ */
- struct H5AC_aux_t * aux_ptr;
+ struct H5AC_aux_t * aux_ptr;
- aux_ptr = ((H5AC_aux_t *)(cache_ptr->aux_ptr));
+ aux_ptr = ((H5AC_aux_t *)(cache_ptr->aux_ptr));
- if ( ! ( ( aux_ptr != NULL ) &&
- ( aux_ptr->magic == H5AC__H5AC_AUX_T_MAGIC ) &&
- ( aux_ptr->dirty_bytes == 0 ) ) ) {
+ if ( ! ( ( aux_ptr != NULL ) &&
+ ( aux_ptr->magic == H5AC__H5AC_AUX_T_MAGIC ) &&
+ ( aux_ptr->dirty_bytes == 0 ) ) ) {
nerrors++;
if ( verbose ) {
- HDfprintf(stdout, "%d:%s: data[%d].header.is_dirty = %d.\n",
- world_mpi_rank, FUNC, idx,
+ HDfprintf(stdout, "%d:%s: data[%d].header.is_dirty = %d.\n",
+ world_mpi_rank, FUNC, idx,
(int)(data[idx].header.is_dirty));
- }
+ }
}
}
@@ -3192,7 +3191,7 @@ insert_entry(H5C_t * cache_ptr,
HDassert( entry_ptr->header.is_pinned );
entry_ptr->global_pinned = TRUE;
- global_pins++;
+ global_pins++;
} else {
@@ -3209,7 +3208,7 @@ insert_entry(H5C_t * cache_ptr,
} /* insert_entry() */
-
+
/*****************************************************************************
* Function: local_pin_and_unpin_random_entries()
*
@@ -3228,8 +3227,8 @@ static void
local_pin_and_unpin_random_entries(H5F_t * file_ptr,
int min_idx,
int max_idx,
- int min_count,
- int max_count)
+ int min_count,
+ int max_count)
{
if ( nerrors == 0 ) {
@@ -3244,40 +3243,40 @@ local_pin_and_unpin_random_entries(H5F_t * file_ptr,
HDassert( min_idx < max_idx );
HDassert( max_idx < NUM_DATA_ENTRIES );
HDassert( max_idx < virt_num_data_entries );
- HDassert( 0 <= min_count );
- HDassert( min_count < max_count );
+ HDassert( 0 <= min_count );
+ HDassert( min_count < max_count );
- count = (HDrand() % (max_count - min_count)) + min_count;
+ count = (HDrand() % (max_count - min_count)) + min_count;
- HDassert( min_count <= count );
- HDassert( count <= max_count );
+ HDassert( min_count <= count );
+ HDassert( count <= max_count );
- for ( i = 0; i < count; i++ )
- {
+ for ( i = 0; i < count; i++ )
+ {
local_pin_random_entry(file_ptr, min_idx, max_idx);
- }
+ }
- count = (HDrand() % (max_count - min_count)) + min_count;
+ count = (HDrand() % (max_count - min_count)) + min_count;
- HDassert( min_count <= count );
- HDassert( count <= max_count );
+ HDassert( min_count <= count );
+ HDassert( count <= max_count );
i = 0;
- idx = 0;
+ idx = 0;
- while ( ( i < count ) && ( idx >= 0 ) )
- {
- via_unprotect = ( (((unsigned)i) & 0x0001) == 0 );
- idx = local_unpin_next_pinned_entry(file_ptr, idx, via_unprotect);
- i++;
- }
+ while ( ( i < count ) && ( idx >= 0 ) )
+ {
+ via_unprotect = ( (((unsigned)i) & 0x0001) == 0 );
+ idx = local_unpin_next_pinned_entry(file_ptr, idx, via_unprotect);
+ i++;
+ }
}
return;
} /* local_pin_and_unpin_random_entries() */
-
+
/*****************************************************************************
* Function: local_pin_random_entry()
*
@@ -3309,13 +3308,13 @@ local_pin_random_entry(H5F_t * file_ptr,
HDassert( max_idx < NUM_DATA_ENTRIES );
HDassert( max_idx < virt_num_data_entries );
- do
- {
- idx = (HDrand() % (max_idx - min_idx)) + min_idx;
+ do
+ {
+ idx = (HDrand() % (max_idx - min_idx)) + min_idx;
HDassert( min_idx <= idx );
HDassert( idx <= max_idx );
- }
- while ( data[idx].global_pinned || data[idx].local_pinned );
+ }
+ while ( data[idx].global_pinned || data[idx].local_pinned );
pin_entry(file_ptr, idx, FALSE, FALSE);
}
@@ -3324,7 +3323,7 @@ local_pin_random_entry(H5F_t * file_ptr,
} /* local_pin_random_entry() */
-
+
/*****************************************************************************
* Function: local_unpin_all_entries()
*
@@ -3340,7 +3339,7 @@ local_pin_random_entry(H5F_t * file_ptr,
*****************************************************************************/
static void
local_unpin_all_entries(H5F_t * file_ptr,
- hbool_t via_unprotect)
+ hbool_t via_unprotect)
{
if ( nerrors == 0 ) {
@@ -3349,25 +3348,25 @@ local_unpin_all_entries(H5F_t * file_ptr,
HDassert( file_ptr );
- idx = 0;
+ idx = 0;
- while ( idx >= 0 )
- {
- idx = local_unpin_next_pinned_entry(file_ptr,
- idx, via_unprotect);
- }
+ while ( idx >= 0 )
+ {
+ idx = local_unpin_next_pinned_entry(file_ptr,
+ idx, via_unprotect);
+ }
}
return;
} /* local_unpin_all_entries() */
-
+
/*****************************************************************************
* Function: local_unpin_next_pinned_entry()
*
* Purpose: Find the next locally pinned entry after the specified
- * starting point, and unpin it.
+ * starting point, and unpin it.
*
* Do nothing if nerrors is non-zero on entry.
*
@@ -3382,7 +3381,7 @@ local_unpin_all_entries(H5F_t * file_ptr,
static int
local_unpin_next_pinned_entry(H5F_t * file_ptr,
int start_idx,
- hbool_t via_unprotect)
+ hbool_t via_unprotect)
{
int i = 0;
int idx = -1;
@@ -3394,39 +3393,39 @@ local_unpin_next_pinned_entry(H5F_t * file_ptr,
HDassert( start_idx < NUM_DATA_ENTRIES );
HDassert( start_idx < virt_num_data_entries );
- idx = start_idx;
+ idx = start_idx;
- while ( ( i < virt_num_data_entries ) &&
- ( ! ( data[idx].local_pinned ) ) )
- {
- i++;
- idx++;
- if ( idx >= virt_num_data_entries ) {
- idx = 0;
- }
- }
+ while ( ( i < virt_num_data_entries ) &&
+ ( ! ( data[idx].local_pinned ) ) )
+ {
+ i++;
+ idx++;
+ if ( idx >= virt_num_data_entries ) {
+ idx = 0;
+ }
+ }
- if ( data[idx].local_pinned ) {
+ if ( data[idx].local_pinned ) {
- unpin_entry(file_ptr, idx, FALSE, FALSE, via_unprotect);
+ unpin_entry(file_ptr, idx, FALSE, FALSE, via_unprotect);
- } else {
+ } else {
- idx = -1;
- }
+ idx = -1;
+ }
}
return(idx);
} /* local_unpin_next_pinned_entry() */
-
+
/*****************************************************************************
* Function: lock_and_unlock_random_entries()
*
* Purpose: Obtain a random number in the closed interval [min_count,
- * max_count]. Then protect and unprotect that number of
- * random entries.
+ * max_count]. Then protect and unprotect that number of
+ * random entries.
*
* Do nothing if nerrors is non-zero on entry.
*
@@ -3467,12 +3466,12 @@ lock_and_unlock_random_entries(H5F_t * file_ptr,
} /* lock_and_unlock_random_entries() */
-
+
/*****************************************************************************
* Function: lock_and_unlock_random_entry()
*
* Purpose: Protect and then unprotect a random entry with index in
- * the data[] array in the close interval [min_idx, max_idx].
+ * the data[] array in the close interval [min_idx, max_idx].
*
* Do nothing if nerrors is non-zero on entry.
*
@@ -3502,15 +3501,15 @@ lock_and_unlock_random_entry(H5F_t * file_ptr,
HDassert( min_idx <= idx );
HDassert( idx <= max_idx );
- lock_entry(file_ptr, idx);
- unlock_entry(file_ptr, idx, H5AC__NO_FLAGS_SET);
+ lock_entry(file_ptr, idx);
+ unlock_entry(file_ptr, idx, H5AC__NO_FLAGS_SET);
}
return;
} /* lock_and_unlock_random_entry() */
-
+
/*****************************************************************************
* Function: lock_entry()
*
@@ -3525,9 +3524,9 @@ lock_and_unlock_random_entry(H5F_t * file_ptr,
*
* Modifications:
*
- * JRM -- 7/11/06
- * Modified asserts to handle the new local_len field in
- * datum.
+ * JRM -- 7/11/06
+ * Modified asserts to handle the new local_len field in
+ * datum.
*
*****************************************************************************/
static void
@@ -3544,30 +3543,30 @@ lock_entry(H5F_t * file_ptr,
entry_ptr = &(data[idx]);
- HDassert( ! (entry_ptr->locked) );
+ HDassert( ! (entry_ptr->locked) );
- cache_entry_ptr = (H5C_cache_entry_t *)H5AC_protect(file_ptr,
+ cache_entry_ptr = (H5C_cache_entry_t *)H5AC_protect(file_ptr,
H5AC_ind_read_dxpl_id,
&(types[0]), entry_ptr->base_addr,
- &entry_ptr->base_addr,
+ &entry_ptr->base_addr,
H5AC__NO_FLAGS_SET);
if ( ( cache_entry_ptr != (void *)(&(entry_ptr->header)) ) ||
( entry_ptr->header.type != &(types[0]) ) ||
( ( entry_ptr->len != entry_ptr->header.size ) &&
- ( entry_ptr->local_len != entry_ptr->header.size ) ) ||
+ ( entry_ptr->local_len != entry_ptr->header.size ) ) ||
( entry_ptr->base_addr != entry_ptr->header.addr ) ) {
nerrors++;
if ( verbose ) {
- HDfprintf(stdout, "%d:%s: error in H5AC_protect().\n",
- world_mpi_rank, FUNC);
+ HDfprintf(stdout, "%d:%s: error in H5AC_protect().\n",
+ world_mpi_rank, FUNC);
}
} else {
- entry_ptr->locked = TRUE;
+ entry_ptr->locked = TRUE;
- }
+ }
HDassert( ((entry_ptr->header).type)->id == DATUM_ENTRY_TYPE );
}
@@ -3604,33 +3603,33 @@ mark_entry_dirty(int32_t idx)
entry_ptr = &(data[idx]);
HDassert ( entry_ptr->locked || entry_ptr->global_pinned );
- HDassert ( ! (entry_ptr->local_pinned) );
+ HDassert ( ! (entry_ptr->local_pinned) );
(entry_ptr->ver)++;
entry_ptr->dirty = TRUE;
- result = H5AC_mark_entry_dirty( (void *)entry_ptr);
+ result = H5AC_mark_entry_dirty( (void *)entry_ptr);
if ( result < 0 ) {
nerrors++;
if ( verbose ) {
- HDfprintf(stdout,
+ HDfprintf(stdout,
"%d:%s: error in H5AC_mark_entry_dirty().\n",
world_mpi_rank, FUNC);
}
}
- else if ( ! ( entry_ptr->locked ) )
- {
- global_dirty_pins++;
- }
+ else if ( ! ( entry_ptr->locked ) )
+ {
+ global_dirty_pins++;
+ }
}
return;
} /* mark_entry_dirty() */
-
+
/*****************************************************************************
* Function: pin_entry()
*
@@ -3647,8 +3646,8 @@ mark_entry_dirty(int32_t idx)
static void
pin_entry(H5F_t * file_ptr,
int32_t idx,
- hbool_t global,
- hbool_t dirty)
+ hbool_t global,
+ hbool_t dirty)
{
unsigned int flags = H5AC__PIN_ENTRY_FLAG;
struct datum * entry_ptr;
@@ -3661,35 +3660,35 @@ pin_entry(H5F_t * file_ptr,
entry_ptr = &(data[idx]);
- HDassert ( ! (entry_ptr->global_pinned) );
- HDassert ( ! (entry_ptr->local_pinned) );
- HDassert ( ! ( dirty && ( ! global ) ) );
+ HDassert ( ! (entry_ptr->global_pinned) );
+ HDassert ( ! (entry_ptr->local_pinned) );
+ HDassert ( ! ( dirty && ( ! global ) ) );
- lock_entry(file_ptr, idx);
+ lock_entry(file_ptr, idx);
- if ( dirty ) {
+ if ( dirty ) {
- flags |= H5AC__DIRTIED_FLAG;
- }
+ flags |= H5AC__DIRTIED_FLAG;
+ }
- unlock_entry(file_ptr, idx, flags);
+ unlock_entry(file_ptr, idx, flags);
HDassert( (entry_ptr->header).is_pinned );
- HDassert( ( ! dirty ) || ( (entry_ptr->header).is_dirty ) );
+ HDassert( ( ! dirty ) || ( (entry_ptr->header).is_dirty ) );
- if ( global ) {
+ if ( global ) {
- entry_ptr->global_pinned = TRUE;
+ entry_ptr->global_pinned = TRUE;
- global_pins++;
+ global_pins++;
- } else {
+ } else {
- entry_ptr->local_pinned = TRUE;
+ entry_ptr->local_pinned = TRUE;
- local_pins++;
+ local_pins++;
- }
+ }
}
return;
@@ -3697,14 +3696,14 @@ pin_entry(H5F_t * file_ptr,
} /* pin_entry() */
#ifdef H5_METADATA_TRACE_FILE
-
+
/*****************************************************************************
* Function: pin_protected_entry()
*
* Purpose: Insert the entry indicated by the type and index, mark it
- * as dirty, and increment its version number.
+ * as dirty, and increment its version number.
*
- * Do nothing if nerrors is non-zero on entry.
+ * Do nothing if nerrors is non-zero on entry.
*
* Return: void
*
@@ -3714,7 +3713,7 @@ pin_entry(H5F_t * file_ptr,
*****************************************************************************/
static void
pin_protected_entry(int32_t idx,
- hbool_t global)
+ hbool_t global)
{
herr_t result;
struct datum * entry_ptr;
@@ -3728,36 +3727,36 @@ pin_protected_entry(int32_t idx,
if ( nerrors == 0 ) {
- result = H5AC_pin_protected_entry((void *)entry_ptr);
+ result = H5AC_pin_protected_entry((void *)entry_ptr);
if ( ( result < 0 ) ||
( entry_ptr->header.type != &(types[0]) ) ||
( ( entry_ptr->len != entry_ptr->header.size ) &&
- ( entry_ptr->local_len != entry_ptr->header.size ) )||
+ ( entry_ptr->local_len != entry_ptr->header.size ) )||
( entry_ptr->base_addr != entry_ptr->header.addr ) ||
- ( ! ( (entry_ptr->header).is_pinned ) ) ) {
+ ( ! ( (entry_ptr->header).is_pinned ) ) ) {
nerrors++;
if ( verbose ) {
- HDfprintf(stdout,
- "%d:%s: Error in H5AC_pin_protected entry().\n",
- world_mpi_rank, FUNC);
+ HDfprintf(stdout,
+ "%d:%s: Error in H5AC_pin_protected entry().\n",
+ world_mpi_rank, FUNC);
}
}
if ( global ) {
- entry_ptr->global_pinned = TRUE;
+ entry_ptr->global_pinned = TRUE;
- global_pins++;
+ global_pins++;
- } else {
+ } else {
- entry_ptr->local_pinned = TRUE;
+ entry_ptr->local_pinned = TRUE;
- local_pins++;
+ local_pins++;
- }
+ }
HDassert( ((entry_ptr->header).type)->id == DATUM_ENTRY_TYPE );
}
@@ -3767,16 +3766,16 @@ pin_protected_entry(int32_t idx,
} /* pin_protected_entry() */
#endif /* H5_METADATA_TRACE_FILE */
-
+
/*****************************************************************************
* Function: move_entry()
*
* Purpose: Move the entry indicated old_idx to the entry indicated
- * by new_idex. Touch up the data array so that flush will
- * not choke.
+ * by new_idex. Touch up the data array so that flush will
+ * not choke.
*
- * Do nothing if nerrors isn't zero, or if old_idx equals
- * new_idx.
+ * Do nothing if nerrors isn't zero, or if old_idx equals
+ * new_idx.
*
* Return: void
*
@@ -3790,8 +3789,8 @@ move_entry(H5F_t * file_ptr,
int32_t new_idx)
{
herr_t result;
- int tmp;
- size_t tmp_len;
+ int tmp;
+ size_t tmp_len;
haddr_t old_addr = HADDR_UNDEF;
haddr_t new_addr = HADDR_UNDEF;
struct datum * old_entry_ptr;
@@ -3819,12 +3818,12 @@ move_entry(H5F_t * file_ptr,
/* Moving will mark the entry dirty if it is not already */
old_entry_ptr->dirty = TRUE;
- /* touch up versions, base_addrs, and data_index. Do this
- * now as it is possible that the rename will trigger a
+ /* touch up versions, base_addrs, and data_index. Do this
+ * now as it is possible that the rename will trigger a
* sync point.
*/
if(old_entry_ptr->ver < new_entry_ptr->ver)
- old_entry_ptr->ver = new_entry_ptr->ver;
+ old_entry_ptr->ver = new_entry_ptr->ver;
else
(old_entry_ptr->ver)++;
@@ -3838,11 +3837,11 @@ move_entry(H5F_t * file_ptr,
old_entry_ptr->index = new_entry_ptr->index;
new_entry_ptr->index = tmp;
- if(old_entry_ptr->local_len != new_entry_ptr->local_len) {
- tmp_len = old_entry_ptr->local_len;
- old_entry_ptr->local_len = new_entry_ptr->local_len;
- new_entry_ptr->local_len = tmp_len;
- } /* end if */
+ if(old_entry_ptr->local_len != new_entry_ptr->local_len) {
+ tmp_len = old_entry_ptr->local_len;
+ old_entry_ptr->local_len = new_entry_ptr->local_len;
+ new_entry_ptr->local_len = tmp_len;
+ } /* end if */
result = H5AC_move_entry(file_ptr, &(types[0]), old_addr, new_addr, H5AC_ind_read_dxpl_id);
@@ -3850,8 +3849,8 @@ move_entry(H5F_t * file_ptr,
nerrors++;
if ( verbose ) {
- HDfprintf(stdout, "%d:%s: H5AC_move_entry() failed.\n",
- world_mpi_rank, FUNC);
+ HDfprintf(stdout, "%d:%s: H5AC_move_entry() failed.\n",
+ world_mpi_rank, FUNC);
}
} else {
@@ -3860,27 +3859,27 @@ move_entry(H5F_t * file_ptr,
if ( ! (old_entry_ptr->header.is_dirty) ) {
- /* it is possible that we just exceeded the dirty bytes
- * threshold, triggering a write of the newly inserted
- * entry. Test for this, and only flag an error if this
- * is not the case.
- */
+ /* it is possible that we just exceeded the dirty bytes
+ * threshold, triggering a write of the newly inserted
+ * entry. Test for this, and only flag an error if this
+ * is not the case.
+ */
- struct H5AC_aux_t * aux_ptr;
+ struct H5AC_aux_t * aux_ptr;
- aux_ptr = ((H5AC_aux_t *)(file_ptr->shared->cache->aux_ptr));
+ aux_ptr = ((H5AC_aux_t *)(file_ptr->shared->cache->aux_ptr));
- if ( ! ( ( aux_ptr != NULL ) &&
- ( aux_ptr->magic == H5AC__H5AC_AUX_T_MAGIC ) &&
- ( aux_ptr->dirty_bytes == 0 ) ) ) {
+ if ( ! ( ( aux_ptr != NULL ) &&
+ ( aux_ptr->magic == H5AC__H5AC_AUX_T_MAGIC ) &&
+ ( aux_ptr->dirty_bytes == 0 ) ) ) {
nerrors++;
if ( verbose ) {
- HDfprintf(stdout,
+ HDfprintf(stdout,
"%d:%s: data[%d].header.is_dirty = %d.\n",
- world_mpi_rank, FUNC, new_idx,
+ world_mpi_rank, FUNC, new_idx,
(int)(data[new_idx].header.is_dirty));
- }
+ }
}
} else {
@@ -3891,19 +3890,19 @@ move_entry(H5F_t * file_ptr,
} /* move_entry() */
-
+
/*****************************************************************************
*
- * Function: reset_server_counts()
+ * Function: reset_server_counts()
*
- * Purpose: Send a message to the server process requesting it to reset
- * its counters. Await confirmation message.
+ * Purpose: Send a message to the server process requesting it to reset
+ * its counters. Await confirmation message.
*
- * Return: Success: TRUE
+ * Return: Success: TRUE
*
- * Failure: FALSE
+ * Failure: FALSE
*
- * Programmer: JRM -- 5/6/10
+ * Programmer: JRM -- 5/6/10
*
*****************************************************************************/
static hbool_t
@@ -3958,7 +3957,7 @@ reset_server_counts(void)
nerrors++;
success = FALSE;
if ( verbose ) {
- HDfprintf(stdout,
+ HDfprintf(stdout,
"%d:%s: Bad data in req r/w counter reset reply.\n",
world_mpi_rank, FUNC);
}
@@ -3969,15 +3968,15 @@ reset_server_counts(void)
} /* reset_server_counts() */
-
+
/*****************************************************************************
* Function: resize_entry()
*
* Purpose: Resize the pinned entry indicated by idx to the new_size.
- * Note that new_size must be greater than 0, and must be
- * less than or equal to the original size of the entry.
+ * Note that new_size must be greater than 0, and must be
+ * less than or equal to the original size of the entry.
*
- * Do nothing if nerrors isn't zero.
+ * Do nothing if nerrors isn't zero.
*
* Return: void
*
@@ -3987,7 +3986,7 @@ reset_server_counts(void)
*****************************************************************************/
static void
resize_entry(int32_t idx,
- size_t new_size)
+ size_t new_size)
{
herr_t result;
struct datum * entry_ptr;
@@ -4001,21 +4000,21 @@ resize_entry(int32_t idx,
HDassert( ((entry_ptr->header).type)->id == DATUM_ENTRY_TYPE );
HDassert( !(entry_ptr->locked) );
- HDassert( ( entry_ptr->global_pinned ) &&
- ( ! entry_ptr->local_pinned ) );
- HDassert( ( entry_ptr->header.size == entry_ptr->len ) ||
- ( entry_ptr->header.size == entry_ptr->local_len ) );
- HDassert( new_size > 0 );
- HDassert( new_size <= entry_ptr->len );
+ HDassert( ( entry_ptr->global_pinned ) &&
+ ( ! entry_ptr->local_pinned ) );
+ HDassert( ( entry_ptr->header.size == entry_ptr->len ) ||
+ ( entry_ptr->header.size == entry_ptr->local_len ) );
+ HDassert( new_size > 0 );
+ HDassert( new_size <= entry_ptr->len );
- result = H5AC_resize_entry((void *)entry_ptr, new_size);
+ result = H5AC_resize_entry((void *)entry_ptr, new_size);
if ( result < 0 ) {
nerrors++;
if ( verbose ) {
- HDfprintf(stdout, "%d:%s: H5AC_resize_entry() failed.\n",
- world_mpi_rank, FUNC);
+ HDfprintf(stdout, "%d:%s: H5AC_resize_entry() failed.\n",
+ world_mpi_rank, FUNC);
}
} else {
@@ -4025,7 +4024,7 @@ resize_entry(int32_t idx,
HDassert( entry_ptr->header.size == new_size );
entry_ptr->dirty = TRUE;
- entry_ptr->local_len = new_size;
+ entry_ptr->local_len = new_size;
/* touch up version. */
@@ -4037,24 +4036,24 @@ resize_entry(int32_t idx,
} /* resize_entry() */
-
+
/*****************************************************************************
*
- * Function: setup_cache_for_test()
+ * Function: setup_cache_for_test()
*
- * Purpose: Setup the parallel cache for a test, and return the file id
- * and a pointer to the cache's internal data structures.
+ * Purpose: Setup the parallel cache for a test, and return the file id
+ * and a pointer to the cache's internal data structures.
*
- * To do this, we must create a file, flush it (so that we
- * don't have to worry about entries in the metadata cache),
- * look up the address of the metadata cache, and then instruct
- * the cache to omit sanity checks on dxpl IDs.
+ * To do this, we must create a file, flush it (so that we
+ * don't have to worry about entries in the metadata cache),
+ * look up the address of the metadata cache, and then instruct
+ * the cache to omit sanity checks on dxpl IDs.
*
- * Return: Success: TRUE
+ * Return: Success: TRUE
*
- * Failure: FALSE
+ * Failure: FALSE
*
- * Programmer: JRM -- 1/4/06
+ * Programmer: JRM -- 1/4/06
*
*****************************************************************************/
static hbool_t
@@ -4081,13 +4080,13 @@ setup_cache_for_test(hid_t * fid_ptr,
if ( fid < 0 ) {
nerrors++;
if ( verbose ) {
- HDfprintf(stdout, "%d:%s: H5Fcreate() failed.\n",
+ HDfprintf(stdout, "%d:%s: H5Fcreate() failed.\n",
world_mpi_rank, FUNC);
}
} else if ( H5Fflush(fid, H5F_SCOPE_GLOBAL) < 0 ) {
nerrors++;
if ( verbose ) {
- HDfprintf(stdout, "%d:%s: H5Fflush() failed.\n",
+ HDfprintf(stdout, "%d:%s: H5Fflush() failed.\n",
world_mpi_rank, FUNC);
}
} else {
@@ -4097,7 +4096,7 @@ setup_cache_for_test(hid_t * fid_ptr,
if ( file_ptr == NULL ) {
nerrors++;
if ( verbose ) {
- HDfprintf(stdout, "%d:%s: Can't get file_ptr.\n",
+ HDfprintf(stdout, "%d:%s: Can't get file_ptr.\n",
world_mpi_rank, FUNC);
}
} else {
@@ -4107,13 +4106,13 @@ setup_cache_for_test(hid_t * fid_ptr,
if ( cache_ptr == NULL ) {
nerrors++;
if ( verbose ) {
- HDfprintf(stdout, "%d:%s: Can't get cache_ptr.\n",
+ HDfprintf(stdout, "%d:%s: Can't get cache_ptr.\n",
world_mpi_rank, FUNC);
}
} else if ( cache_ptr->magic != H5C__H5C_T_MAGIC ) {
nerrors++;
if ( verbose ) {
- HDfprintf(stdout, "%d:%s: Bad cache_ptr magic.\n",
+ HDfprintf(stdout, "%d:%s: Bad cache_ptr magic.\n",
world_mpi_rank, FUNC);
}
} else {
@@ -4132,7 +4131,7 @@ setup_cache_for_test(hid_t * fid_ptr,
if ( H5AC_get_cache_auto_resize_config(cache_ptr, &config)
!= SUCCEED ) {
- HDfprintf(stdout,
+ HDfprintf(stdout,
"%d:%s: H5AC_get_cache_auto_resize_config(1) failed.\n",
world_mpi_rank, FUNC);
@@ -4142,9 +4141,9 @@ setup_cache_for_test(hid_t * fid_ptr,
config.metadata_write_strategy = metadata_write_strategy;
if ( H5AC_set_cache_auto_resize_config(cache_ptr, &config)
- != SUCCEED ) {
+ != SUCCEED ) {
- HDfprintf(stdout,
+ HDfprintf(stdout,
"%d:%s: H5AC_set_cache_auto_resize_config() failed.\n",
world_mpi_rank, FUNC);
@@ -4167,15 +4166,15 @@ setup_cache_for_test(hid_t * fid_ptr,
nerrors++;
if ( verbose ) {
- HDfprintf(stdout, "%d:%s: cache_ptr->aux_ptr == NULL.\n",
+ HDfprintf(stdout, "%d:%s: cache_ptr->aux_ptr == NULL.\n",
world_mpi_rank, FUNC);
}
- } else if ( ((H5AC_aux_t *)(cache_ptr->aux_ptr))->magic !=
+ } else if ( ((H5AC_aux_t *)(cache_ptr->aux_ptr))->magic !=
H5AC__H5AC_AUX_T_MAGIC ) {
nerrors++;
if ( verbose ) {
- HDfprintf(stdout,
+ HDfprintf(stdout,
"%d:%s: cache_ptr->aux_ptr->magic != H5AC__H5AC_AUX_T_MAGIC.\n",
world_mpi_rank, FUNC);
}
@@ -4184,14 +4183,14 @@ setup_cache_for_test(hid_t * fid_ptr,
nerrors++;
if ( verbose ) {
- HDfprintf(stdout,
+ HDfprintf(stdout,
"%d:%s: bad cache_ptr->aux_ptr->metadata_write_strategy\n",
world_mpi_rank, FUNC);
}
}
}
- /* also verify that the expected metadata write strategy is reported
+ /* also verify that the expected metadata write strategy is reported
* when we get the current configuration.
*/
@@ -4202,25 +4201,25 @@ setup_cache_for_test(hid_t * fid_ptr,
if ( H5AC_get_cache_auto_resize_config(cache_ptr, &test_config)
!= SUCCEED ) {
- HDfprintf(stdout,
+ HDfprintf(stdout,
"%d:%s: H5AC_get_cache_auto_resize_config(2) failed.\n",
world_mpi_rank, FUNC);
- } else if ( test_config.metadata_write_strategy !=
+ } else if ( test_config.metadata_write_strategy !=
metadata_write_strategy ) {
nerrors++;
if ( verbose ) {
- HDfprintf(stdout,
+ HDfprintf(stdout,
"%d:%s: unexpected metadata_write_strategy.\n",
world_mpi_rank, FUNC);
}
}
}
- /* allocate space for test entries -- do this before we set the
+ /* allocate space for test entries -- do this before we set the
* sync point done callback as it will dirty the superblock, requiring
* another flush. If the sync point done callback is set, this will
* cause a spurious failure.
@@ -4233,10 +4232,10 @@ setup_cache_for_test(hid_t * fid_ptr,
if ( actual_base_addr == HADDR_UNDEF ) {
success = FALSE;
- nerrors++;
+ nerrors++;
if ( verbose ) {
- HDfprintf(stdout, "%d:%s: H5MF_alloc() failed.\n",
+ HDfprintf(stdout, "%d:%s: H5MF_alloc() failed.\n",
world_mpi_rank, FUNC);
}
@@ -4247,10 +4246,10 @@ setup_cache_for_test(hid_t * fid_ptr,
* if the size of the superblock is increase.
*/
success = FALSE;
- nerrors++;
+ nerrors++;
if ( verbose ) {
- HDfprintf(stdout, "%d:%s: actual_base_addr > BASE_ADDR.\n",
+ HDfprintf(stdout, "%d:%s: actual_base_addr > BASE_ADDR.\n",
world_mpi_rank, FUNC);
}
}
@@ -4263,7 +4262,7 @@ setup_cache_for_test(hid_t * fid_ptr,
if ( H5Fflush(fid, H5F_SCOPE_GLOBAL) < 0 ) {
nerrors++;
if ( verbose ) {
- HDfprintf(stdout, "%d:%s: second H5Fflush() failed.\n",
+ HDfprintf(stdout, "%d:%s: second H5Fflush() failed.\n",
world_mpi_rank, FUNC);
}
}
@@ -4273,62 +4272,62 @@ setup_cache_for_test(hid_t * fid_ptr,
if ( success ) {
- if ( H5AC__set_write_done_callback(cache_ptr, do_sync) != SUCCEED ) {
+ if ( H5AC__set_write_done_callback(cache_ptr, do_sync) != SUCCEED ) {
nerrors++;
if ( verbose ) {
- HDfprintf(stdout,
- "%d:%s: H5C_set_write_done_callback failed.\n",
+ HDfprintf(stdout,
+ "%d:%s: H5C_set_write_done_callback failed.\n",
world_mpi_rank, FUNC);
}
- }
+ }
}
#endif /* DO_SYNC_AFTER_WRITE */
if ( success ) {
- if ( H5AC__set_sync_point_done_callback(cache_ptr, verify_writes) != SUCCEED ) {
+ if ( H5AC__set_sync_point_done_callback(cache_ptr, verify_writes) != SUCCEED ) {
nerrors++;
if ( verbose ) {
- HDfprintf(stdout,
- "%d:%s: H5AC__set_sync_point_done_callback failed.\n",
+ HDfprintf(stdout,
+ "%d:%s: H5AC__set_sync_point_done_callback failed.\n",
world_mpi_rank, FUNC);
}
- }
+ }
}
return(success);
} /* setup_cache_for_test() */
-
+
/*****************************************************************************
*
- * Function: verify_writes()
+ * Function: verify_writes()
*
- * Purpose: Verify that the indicated entries have been written exactly
- * once each, and that the indicated total number of writes
- * has been processed by the server process. Flag an error if
- * discrepency is noted. Finally reset the counters maintained
- * by the server process.
+ * Purpose: Verify that the indicated entries have been written exactly
+ * once each, and that the indicated total number of writes
+ * has been processed by the server process. Flag an error if
+ * discrepency is noted. Finally reset the counters maintained
+ * by the server process.
*
- * This function should only be called by the metadata cache
- * as the "sync point done" function, as it must do some
- * synchronization to avoid false positives.
+ * This function should only be called by the metadata cache
+ * as the "sync point done" function, as it must do some
+ * synchronization to avoid false positives.
*
- * Note that at present, this function does not allow for the
- * case in which one or more of the indicated entries should
- * have been written more than once since the last time the
- * server process's counters were reset. That is fine for now,
- * as with the current metadata write strategies, no entry
- * should be written more than once per sync point. If this
- * changes this limitation will have to be revisited.
+ * Note that at present, this function does not allow for the
+ * case in which one or more of the indicated entries should
+ * have been written more than once since the last time the
+ * server process's counters were reset. That is fine for now,
+ * as with the current metadata write strategies, no entry
+ * should be written more than once per sync point. If this
+ * changes this limitation will have to be revisited.
*
- * Return: void.
+ * Return: void.
*
- * Programmer: JRM -- 5/9/10
+ * Programmer: JRM -- 5/9/10
*
*****************************************************************************/
static void
@@ -4404,7 +4403,7 @@ verify_writes(unsigned num_writes, haddr_t *written_entries_tbl)
}
/* final barrier to ensure that all processes think that the server
- * counters have been reset before we leave the sync point. This
+ * counters have been reset before we leave the sync point. This
* barrier is probaby not necessary at this point in time (5/9/10),
* but I can think of at least one likely change to the metadata write
* strategies that will require it -- hence its insertion now.
@@ -4426,24 +4425,24 @@ verify_writes(unsigned num_writes, haddr_t *written_entries_tbl)
} /* verify_writes() */
-
+
/*****************************************************************************
*
- * Function: setup_rand()
+ * Function: setup_rand()
*
- * Purpose: Use gettimeofday() to obtain a seed for rand(), print the
- * seed to stdout, and then pass it to srand().
+ * Purpose: Use gettimeofday() to obtain a seed for rand(), print the
+ * seed to stdout, and then pass it to srand().
*
- * Increment nerrors if any errors are detected.
+ * Increment nerrors if any errors are detected.
*
- * Return: void.
+ * Return: void.
*
- * Programmer: JRM -- 1/12/06
+ * Programmer: JRM -- 1/12/06
*
* Modifications:
*
- * JRM -- 5/9/06
- * Modified function to facilitate setting predefined seeds.
+ * JRM -- 5/9/06
+ * Modified function to facilitate setting predefined seeds.
*
*****************************************************************************/
static void
@@ -4458,13 +4457,13 @@ setup_rand(void)
if ( ( use_predefined_seeds ) &&
( world_mpi_size == num_predefined_seeds ) ) {
- HDassert( world_mpi_rank >= 0 );
- HDassert( world_mpi_rank < world_mpi_size );
+ HDassert( world_mpi_rank >= 0 );
+ HDassert( world_mpi_rank < world_mpi_size );
seed = predefined_seeds[world_mpi_rank];
- HDfprintf(stdout, "%d:%s: predefined_seed = %d.\n",
+ HDfprintf(stdout, "%d:%s: predefined_seed = %d.\n",
world_mpi_rank, FUNC, seed);
- fflush(stdout);
+ fflush(stdout);
HDsrand(seed);
} else {
@@ -4473,7 +4472,7 @@ setup_rand(void)
nerrors++;
if ( verbose ) {
- HDfprintf(stdout, "%d:%s: gettimeofday() failed.\n",
+ HDfprintf(stdout, "%d:%s: gettimeofday() failed.\n",
world_mpi_rank, FUNC);
}
} else {
@@ -4491,21 +4490,21 @@ setup_rand(void)
} /* setup_rand() */
-
+
/*****************************************************************************
*
- * Function: take_down_cache()
+ * Function: take_down_cache()
*
- * Purpose: Take down the parallel cache after a test.
+ * Purpose: Take down the parallel cache after a test.
*
- * To do this, we must close the file, and delete if if
- * possible.
+ * To do this, we must close the file, and delete if if
+ * possible.
*
- * Return: Success: TRUE
+ * Return: Success: TRUE
*
- * Failure: FALSE
+ * Failure: FALSE
*
- * Programmer: JRM -- 1/4/06
+ * Programmer: JRM -- 1/4/06
*
*****************************************************************************/
static hbool_t
@@ -4513,7 +4512,7 @@ take_down_cache(hid_t fid, H5C_t * cache_ptr)
{
hbool_t success = TRUE; /* will set to FALSE if appropriate. */
- /* flush the file -- this should write out any remaining test
+ /* flush the file -- this should write out any remaining test
* entries in the cache.
*/
if ( ( success ) && ( H5Fflush(fid, H5F_SCOPE_GLOBAL) < 0 ) ) {
@@ -4526,7 +4525,7 @@ take_down_cache(hid_t fid, H5C_t * cache_ptr)
}
}
- /* Now reset the sync point done callback. Must do this as with
+ /* Now reset the sync point done callback. Must do this as with
* the SWMR mods, the cache will do additional I/O on file close
* un-related to the test entries, and thereby corrupt our counts
* of entry writes.
@@ -4557,7 +4556,7 @@ take_down_cache(hid_t fid, H5C_t * cache_ptr)
world_mpi_rank, FUNC);
}
- }
+ }
if ( success ) {
@@ -4574,11 +4573,11 @@ take_down_cache(hid_t fid, H5C_t * cache_ptr)
}
} else {
- /* verify that there have been no further writes of test
+ /* verify that there have been no further writes of test
* entries during the close
*/
success = verify_total_writes(0);
-
+
}
}
@@ -4586,19 +4585,19 @@ take_down_cache(hid_t fid, H5C_t * cache_ptr)
} /* take_down_cache() */
-
+
/*****************************************************************************
* Function: verify_entry_reads
*
- * Purpose: Query the server to determine the number of times the
- * indicated entry has been read since the last time the
- * server counters were reset.
+ * Purpose: Query the server to determine the number of times the
+ * indicated entry has been read since the last time the
+ * server counters were reset.
*
- * Return TRUE if successful, and if the supplied expected
- * number of reads matches the number of reads reported by
- * the server process.
+ * Return TRUE if successful, and if the supplied expected
+ * number of reads matches the number of reads reported by
+ * the server process.
*
- * Return FALSE and flag an error otherwise.
+ * Return FALSE and flag an error otherwise.
*
* Return: TRUE if successful, FALSE otherwise.
*
@@ -4681,31 +4680,31 @@ verify_entry_reads(haddr_t addr,
nerrors++;
success = FALSE;
if ( verbose ) {
- HDfprintf(stdout,
+ HDfprintf(stdout,
"%d:%s: rep/exp entry 0x%llx reads mismatch (%ld/%ld).\n",
world_mpi_rank, FUNC, (long long)addr,
reported_entry_reads, expected_entry_reads);
}
- }
+ }
}
return(success);
} /* verify_entry_reads() */
-
+
/*****************************************************************************
* Function: verify_entry_writes
*
- * Purpose: Query the server to determine the number of times the
- * indicated entry has been written since the last time the
- * server counters were reset.
+ * Purpose: Query the server to determine the number of times the
+ * indicated entry has been written since the last time the
+ * server counters were reset.
*
- * Return TRUE if successful, and if the supplied expected
- * number of reads matches the number of reads reported by
- * the server process.
+ * Return TRUE if successful, and if the supplied expected
+ * number of reads matches the number of reads reported by
+ * the server process.
*
- * Return FALSE and flag an error otherwise.
+ * Return FALSE and flag an error otherwise.
*
* Return: TRUE if successful, FALSE otherwise.
*
@@ -4788,36 +4787,36 @@ verify_entry_writes(haddr_t addr,
nerrors++;
success = FALSE;
if ( verbose ) {
- HDfprintf(stdout,
+ HDfprintf(stdout,
"%d:%s: rep/exp entry 0x%llx writes mismatch (%ld/%ld).\n",
world_mpi_rank, FUNC, (long long)addr,
reported_entry_writes, expected_entry_writes);
}
- }
+ }
}
return(success);
} /* verify_entry_writes() */
-
+
/*****************************************************************************
*
- * Function: verify_total_reads()
+ * Function: verify_total_reads()
*
- * Purpose: Query the server to obtain the total reads since the last
- * server counter reset, and compare this value with the supplied
- * expected value.
+ * Purpose: Query the server to obtain the total reads since the last
+ * server counter reset, and compare this value with the supplied
+ * expected value.
*
- * If the values match, return TRUE.
+ * If the values match, return TRUE.
*
- * If the values don't match, flag an error and return FALSE.
+ * If the values don't match, flag an error and return FALSE.
*
- * Return: Success: TRUE
+ * Return: Success: TRUE
*
- * Failure: FALSE
+ * Failure: FALSE
*
- * Programmer: JRM -- 5/6/10
+ * Programmer: JRM -- 5/6/10
*
*****************************************************************************/
static hbool_t
@@ -4888,9 +4887,9 @@ verify_total_reads(int expected_total_reads)
nerrors++;
success = FALSE;
if ( verbose ) {
- HDfprintf(stdout,
+ HDfprintf(stdout,
"%d:%s: reported/expected total reads mismatch (%ld/%ld).\n",
- world_mpi_rank, FUNC,
+ world_mpi_rank, FUNC,
reported_total_reads, expected_total_reads);
}
@@ -4901,24 +4900,24 @@ verify_total_reads(int expected_total_reads)
} /* verify_total_reads() */
-
+
/*****************************************************************************
*
- * Function: verify_total_writes()
+ * Function: verify_total_writes()
*
- * Purpose: Query the server to obtain the total writes since the last
- * server counter reset, and compare this value with the supplied
- * expected value.
+ * Purpose: Query the server to obtain the total writes since the last
+ * server counter reset, and compare this value with the supplied
+ * expected value.
*
- * If the values match, return TRUE.
+ * If the values match, return TRUE.
*
- * If the values don't match, flag an error and return FALSE.
+ * If the values don't match, flag an error and return FALSE.
*
- * Return: Success: TRUE
+ * Return: Success: TRUE
*
- * Failure: FALSE
+ * Failure: FALSE
*
- * Programmer: JRM -- 5/6/10
+ * Programmer: JRM -- 5/6/10
*
*****************************************************************************/
static hbool_t
@@ -4989,9 +4988,9 @@ verify_total_writes(unsigned expected_total_writes)
nerrors++;
success = FALSE;
if ( verbose ) {
- HDfprintf(stdout,
+ HDfprintf(stdout,
"%d:%s: reported/expected total writes mismatch (%u/%u).\n",
- world_mpi_rank, FUNC,
+ world_mpi_rank, FUNC,
reported_total_writes, expected_total_writes);
}
}
@@ -5001,7 +5000,7 @@ verify_total_writes(unsigned expected_total_writes)
} /* verify_total_writes() */
-
+
/*****************************************************************************
* Function: unlock_entry()
*
@@ -5016,8 +5015,8 @@ verify_total_writes(unsigned expected_total_writes)
*
* Modifications:
*
- * 7/11/06
- * Updated for the new local_len field in datum.
+ * 7/11/06
+ * Updated for the new local_len field in datum.
*
*****************************************************************************/
static void
@@ -5037,7 +5036,7 @@ unlock_entry(H5F_t * file_ptr,
entry_ptr = &(data[idx]);
- HDassert( entry_ptr->locked );
+ HDassert( entry_ptr->locked );
dirtied = ((flags & H5AC__DIRTIED_FLAG) == H5AC__DIRTIED_FLAG );
@@ -5053,7 +5052,7 @@ unlock_entry(H5F_t * file_ptr,
if ( ( result < 0 ) ||
( entry_ptr->header.type != &(types[0]) ) ||
( ( entry_ptr->len != entry_ptr->header.size ) &&
- ( entry_ptr->local_len != entry_ptr->header.size ) ) ||
+ ( entry_ptr->local_len != entry_ptr->header.size ) ) ||
( entry_ptr->base_addr != entry_ptr->header.addr ) ) {
nerrors++;
@@ -5065,7 +5064,7 @@ unlock_entry(H5F_t * file_ptr,
entry_ptr->locked = FALSE;
- }
+ }
HDassert( ((entry_ptr->header).type)->id == DATUM_ENTRY_TYPE );
@@ -5086,7 +5085,7 @@ unlock_entry(H5F_t * file_ptr,
} /* unlock_entry() */
-
+
/*****************************************************************************
* Function: unpin_entry()
*
@@ -5101,8 +5100,8 @@ unlock_entry(H5F_t * file_ptr,
*
* Modifications:
*
- * JRM -- 8/15/06
- * Added assertion that entry is pinned on entry.
+ * JRM -- 8/15/06
+ * Added assertion that entry is pinned on entry.
*
*****************************************************************************/
static void
@@ -5124,54 +5123,54 @@ unpin_entry(H5F_t * file_ptr,
entry_ptr = &(data[idx]);
- HDassert( (entry_ptr->header).is_pinned );
- HDassert ( ! ( entry_ptr->global_pinned && entry_ptr->local_pinned) );
- HDassert ( ( global && entry_ptr->global_pinned ) ||
- ( ! global && entry_ptr->local_pinned ) );
- HDassert ( ! ( dirty && ( ! global ) ) );
+ HDassert( (entry_ptr->header).is_pinned );
+ HDassert ( ! ( entry_ptr->global_pinned && entry_ptr->local_pinned) );
+ HDassert ( ( global && entry_ptr->global_pinned ) ||
+ ( ! global && entry_ptr->local_pinned ) );
+ HDassert ( ! ( dirty && ( ! global ) ) );
- if ( via_unprotect ) {
+ if ( via_unprotect ) {
- lock_entry(file_ptr, idx);
+ lock_entry(file_ptr, idx);
- if ( dirty ) {
+ if ( dirty ) {
- flags |= H5AC__DIRTIED_FLAG;
- }
+ flags |= H5AC__DIRTIED_FLAG;
+ }
- unlock_entry(file_ptr, idx, flags);
+ unlock_entry(file_ptr, idx, flags);
- } else {
+ } else {
- if ( dirty ) {
+ if ( dirty ) {
- mark_entry_dirty(idx);
+ mark_entry_dirty(idx);
- }
+ }
- result = H5AC_unpin_entry(entry_ptr);
+ result = H5AC_unpin_entry(entry_ptr);
- if ( result < 0 ) {
+ if ( result < 0 ) {
nerrors++;
if ( verbose ) {
HDfprintf(stdout, "%d:%s: error in H5AC_unpin_entry().\n",
- world_mpi_rank, FUNC);
+ world_mpi_rank, FUNC);
}
- }
- }
+ }
+ }
HDassert( ! ((entry_ptr->header).is_pinned) );
- if ( global ) {
+ if ( global ) {
- entry_ptr->global_pinned = FALSE;
+ entry_ptr->global_pinned = FALSE;
- } else {
+ } else {
- entry_ptr->local_pinned = FALSE;
+ entry_ptr->local_pinned = FALSE;
- }
+ }
}
return;
@@ -5183,18 +5182,18 @@ unpin_entry(H5F_t * file_ptr,
/****************************** test functions *******************************/
/*****************************************************************************/
-
+
/*****************************************************************************
*
- * Function: server_smoke_check()
+ * Function: server_smoke_check()
*
- * Purpose: Quick smoke check for the server process.
+ * Purpose: Quick smoke check for the server process.
*
- * Return: Success: TRUE
+ * Return: Success: TRUE
*
- * Failure: FALSE
+ * Failure: FALSE
*
- * Programmer: JRM -- 12/21/05
+ * Programmer: JRM -- 12/21/05
*
*****************************************************************************/
static hbool_t
@@ -5215,12 +5214,12 @@ server_smoke_check(void)
if ( world_mpi_rank == world_server_mpi_rank ) {
- if ( ! server_main() ) {
+ if ( ! server_main() ) {
/* some error occured in the server -- report failure */
nerrors++;
if ( verbose ) {
- HDfprintf(stdout, "%d:%s: server_main() failed.\n",
+ HDfprintf(stdout, "%d:%s: server_main() failed.\n",
world_mpi_rank, FUNC);
}
}
@@ -5286,9 +5285,9 @@ server_smoke_check(void)
#endif /* DO_WRITE_REQ_ACK */
- do_sync();
+ do_sync();
- /* barrier to allow all writes to complete */
+ /* barrier to allow all writes to complete */
if ( MPI_SUCCESS != MPI_Barrier(file_mpi_comm) ) {
success = FALSE;
@@ -5303,12 +5302,12 @@ server_smoke_check(void)
if ( success ) {
success = verify_entry_writes(data[world_mpi_rank].base_addr, 1);
- }
+ }
if ( success ) {
success = verify_entry_reads(data[world_mpi_rank].base_addr, 0);
- }
+ }
if ( success ) {
@@ -5320,7 +5319,7 @@ server_smoke_check(void)
success = verify_total_reads(0);
}
- /* barrier to allow all writes to complete */
+ /* barrier to allow all writes to complete */
if ( MPI_SUCCESS != MPI_Barrier(file_mpi_comm) ) {
success = FALSE;
@@ -5392,7 +5391,7 @@ server_smoke_check(void)
}
}
- /* barrier to allow all writes to complete */
+ /* barrier to allow all writes to complete */
if ( MPI_SUCCESS != MPI_Barrier(file_mpi_comm) ) {
success = FALSE;
@@ -5407,12 +5406,12 @@ server_smoke_check(void)
if ( success ) {
success = verify_entry_writes(data[world_mpi_rank].base_addr, 1);
- }
+ }
if ( success ) {
success = verify_entry_reads(data[world_mpi_rank].base_addr, 1);
- }
+ }
if ( success ) {
@@ -5456,12 +5455,12 @@ server_smoke_check(void)
if ( success ) {
success = verify_entry_writes(data[world_mpi_rank].base_addr, 0);
- }
+ }
if ( success ) {
success = verify_entry_reads(data[world_mpi_rank].base_addr, 0);
- }
+ }
if ( success ) {
@@ -5514,9 +5513,9 @@ server_smoke_check(void)
if ( world_mpi_rank == 0 ) {
- if ( max_nerrors == 0 ) {
+ if ( max_nerrors == 0 ) {
- PASSED();
+ PASSED();
} else {
@@ -5531,18 +5530,18 @@ server_smoke_check(void)
} /* server_smoke_check() */
-
+
/*****************************************************************************
*
- * Function: smoke_check_1()
+ * Function: smoke_check_1()
*
- * Purpose: First smoke check for the parallel cache.
+ * Purpose: First smoke check for the parallel cache.
*
- * Return: Success: TRUE
+ * Return: Success: TRUE
*
- * Failure: FALSE
+ * Failure: FALSE
*
- * Programmer: JRM -- 1/4/06
+ * Programmer: JRM -- 1/4/06
*
*****************************************************************************/
static hbool_t
@@ -5558,23 +5557,23 @@ smoke_check_1(int metadata_write_strategy)
switch ( metadata_write_strategy ) {
- case H5AC_METADATA_WRITE_STRATEGY__PROCESS_0_ONLY:
+ case H5AC_METADATA_WRITE_STRATEGY__PROCESS_0_ONLY:
if ( world_mpi_rank == 0 ) {
- TESTING("smoke check #1 -- process 0 only md write strategy");
+ TESTING("smoke check #1 -- process 0 only md write strategy");
}
- break;
+ break;
- case H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED:
+ case H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED:
if ( world_mpi_rank == 0 ) {
- TESTING("smoke check #1 -- distributed md write strategy");
+ TESTING("smoke check #1 -- distributed md write strategy");
}
- break;
+ break;
default:
if ( world_mpi_rank == 0 ) {
- TESTING("smoke check #1 -- unknown md write strategy");
+ TESTING("smoke check #1 -- unknown md write strategy");
}
- break;
+ break;
}
nerrors = 0;
@@ -5583,12 +5582,12 @@ smoke_check_1(int metadata_write_strategy)
if ( world_mpi_rank == world_server_mpi_rank ) {
- if ( ! server_main() ) {
+ if ( ! server_main() ) {
/* some error occured in the server -- report failure */
nerrors++;
if ( verbose ) {
- HDfprintf(stdout, "%d:%s: server_main() failed.\n",
+ HDfprintf(stdout, "%d:%s: server_main() failed.\n",
world_mpi_rank, FUNC);
}
}
@@ -5602,7 +5601,7 @@ smoke_check_1(int metadata_write_strategy)
fid = -1;
cache_ptr = NULL;
if ( verbose ) {
- HDfprintf(stdout, "%d:%s: setup_cache_for_test() failed.\n",
+ HDfprintf(stdout, "%d:%s: setup_cache_for_test() failed.\n",
world_mpi_rank, FUNC);
}
}
@@ -5614,24 +5613,24 @@ smoke_check_1(int metadata_write_strategy)
for ( i = (virt_num_data_entries / 2) - 1; i >= 0; i-- )
{
- lock_entry(file_ptr, i);
- unlock_entry(file_ptr, i, H5AC__NO_FLAGS_SET);
+ lock_entry(file_ptr, i);
+ unlock_entry(file_ptr, i, H5AC__NO_FLAGS_SET);
}
/* Move the first half of the entries... */
for ( i = 0; i < (virt_num_data_entries / 2); i++ )
{
- lock_entry(file_ptr, i);
- unlock_entry(file_ptr, i, H5AC__NO_FLAGS_SET);
- move_entry(file_ptr, i, (i + (virt_num_data_entries / 2)));
+ lock_entry(file_ptr, i);
+ unlock_entry(file_ptr, i, H5AC__NO_FLAGS_SET);
+ move_entry(file_ptr, i, (i + (virt_num_data_entries / 2)));
}
/* ...and then move them back. */
for ( i = (virt_num_data_entries / 2) - 1; i >= 0; i-- )
{
- lock_entry(file_ptr, i);
- unlock_entry(file_ptr, i, H5AC__NO_FLAGS_SET);
- move_entry(file_ptr, i, (i + (virt_num_data_entries / 2)));
+ lock_entry(file_ptr, i);
+ unlock_entry(file_ptr, i, H5AC__NO_FLAGS_SET);
+ move_entry(file_ptr, i, (i + (virt_num_data_entries / 2)));
}
if ( fid >= 0 ) {
@@ -5640,7 +5639,7 @@ smoke_check_1(int metadata_write_strategy)
nerrors++;
if ( verbose ) {
- HDfprintf(stdout, "%d:%s: take_down_cache() failed.\n",
+ HDfprintf(stdout, "%d:%s: take_down_cache() failed.\n",
world_mpi_rank, FUNC);
}
}
@@ -5686,9 +5685,9 @@ smoke_check_1(int metadata_write_strategy)
if ( world_mpi_rank == 0 ) {
- if ( max_nerrors == 0 ) {
+ if ( max_nerrors == 0 ) {
- PASSED();
+ PASSED();
} else {
@@ -5703,21 +5702,21 @@ smoke_check_1(int metadata_write_strategy)
} /* smoke_check_1() */
-
+
/*****************************************************************************
*
- * Function: smoke_check_2()
+ * Function: smoke_check_2()
*
- * Purpose: Second smoke check for the parallel cache.
+ * Purpose: Second smoke check for the parallel cache.
*
- * Introduce random reads, but keep all processes with roughly
- * the same work load.
+ * Introduce random reads, but keep all processes with roughly
+ * the same work load.
*
- * Return: Success: TRUE
+ * Return: Success: TRUE
*
- * Failure: FALSE
+ * Failure: FALSE
*
- * Programmer: JRM -- 1/12/06
+ * Programmer: JRM -- 1/12/06
*
*****************************************************************************/
static hbool_t
@@ -5733,23 +5732,23 @@ smoke_check_2(int metadata_write_strategy)
switch ( metadata_write_strategy ) {
- case H5AC_METADATA_WRITE_STRATEGY__PROCESS_0_ONLY:
+ case H5AC_METADATA_WRITE_STRATEGY__PROCESS_0_ONLY:
if ( world_mpi_rank == 0 ) {
- TESTING("smoke check #2 -- process 0 only md write strategy");
+ TESTING("smoke check #2 -- process 0 only md write strategy");
}
- break;
+ break;
- case H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED:
+ case H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED:
if ( world_mpi_rank == 0 ) {
- TESTING("smoke check #2 -- distributed md write strategy");
+ TESTING("smoke check #2 -- distributed md write strategy");
}
- break;
+ break;
default:
if ( world_mpi_rank == 0 ) {
- TESTING("smoke check #2 -- unknown md write strategy");
+ TESTING("smoke check #2 -- unknown md write strategy");
}
- break;
+ break;
}
nerrors = 0;
@@ -5758,12 +5757,12 @@ smoke_check_2(int metadata_write_strategy)
if ( world_mpi_rank == world_server_mpi_rank ) {
- if ( ! server_main() ) {
+ if ( ! server_main() ) {
/* some error occured in the server -- report failure */
nerrors++;
if ( verbose ) {
- HDfprintf(stdout, "%d:%s: server_main() failed.\n",
+ HDfprintf(stdout, "%d:%s: server_main() failed.\n",
world_mpi_rank, FUNC);
}
}
@@ -5777,7 +5776,7 @@ smoke_check_2(int metadata_write_strategy)
fid = -1;
cache_ptr = NULL;
if ( verbose ) {
- HDfprintf(stdout, "%d:%s: setup_cache_for_test() failed.\n",
+ HDfprintf(stdout, "%d:%s: setup_cache_for_test() failed.\n",
world_mpi_rank, FUNC);
}
}
@@ -5788,73 +5787,73 @@ smoke_check_2(int metadata_write_strategy)
if ( i > 100 ) {
- lock_and_unlock_random_entries(file_ptr, (i - 100), i, 0, 10);
+ lock_and_unlock_random_entries(file_ptr, (i - 100), i, 0, 10);
}
}
- for ( i = 0; i < (virt_num_data_entries / 2); i+=61 )
- {
- /* Make sure we don't step on any locally pinned entries */
- if ( data[i].local_pinned ) {
- unpin_entry(file_ptr, i, FALSE, FALSE, FALSE);
- }
+ for ( i = 0; i < (virt_num_data_entries / 2); i+=61 )
+ {
+ /* Make sure we don't step on any locally pinned entries */
+ if ( data[i].local_pinned ) {
+ unpin_entry(file_ptr, i, FALSE, FALSE, FALSE);
+ }
- pin_entry(file_ptr, i, TRUE, FALSE);
- }
+ pin_entry(file_ptr, i, TRUE, FALSE);
+ }
for ( i = (virt_num_data_entries / 2) - 1; i >= 0; i-=2 )
{
- lock_entry(file_ptr, i);
- unlock_entry(file_ptr, i, H5AC__NO_FLAGS_SET);
- lock_and_unlock_random_entries(file_ptr, 0,
- (virt_num_data_entries / 20),
- 0, 100);
- local_pin_and_unpin_random_entries(file_ptr, 0,
- (virt_num_data_entries / 4),
- 0, 3);
+ lock_entry(file_ptr, i);
+ unlock_entry(file_ptr, i, H5AC__NO_FLAGS_SET);
+ lock_and_unlock_random_entries(file_ptr, 0,
+ (virt_num_data_entries / 20),
+ 0, 100);
+ local_pin_and_unpin_random_entries(file_ptr, 0,
+ (virt_num_data_entries / 4),
+ 0, 3);
}
for ( i = 0; i < (virt_num_data_entries / 2); i+=2 )
{
- lock_entry(file_ptr, i);
- unlock_entry(file_ptr, i, H5AC__DIRTIED_FLAG);
- lock_and_unlock_random_entries(file_ptr, 0,
- (virt_num_data_entries / 10),
- 0, 100);
+ lock_entry(file_ptr, i);
+ unlock_entry(file_ptr, i, H5AC__DIRTIED_FLAG);
+ lock_and_unlock_random_entries(file_ptr, 0,
+ (virt_num_data_entries / 10),
+ 0, 100);
}
- /* we can't move pinned entries, so release any local pins now. */
- local_unpin_all_entries(file_ptr, FALSE);
+ /* we can't move pinned entries, so release any local pins now. */
+ local_unpin_all_entries(file_ptr, FALSE);
/* Move the first half of the entries... */
for ( i = 0; i < (virt_num_data_entries / 2); i++ )
{
- lock_entry(file_ptr, i);
- unlock_entry(file_ptr, i, H5AC__NO_FLAGS_SET);
- move_entry(file_ptr, i, (i + (virt_num_data_entries / 2)));
- lock_and_unlock_random_entries(file_ptr, 0,
- ((virt_num_data_entries / 50) - 1),
+ lock_entry(file_ptr, i);
+ unlock_entry(file_ptr, i, H5AC__NO_FLAGS_SET);
+ move_entry(file_ptr, i, (i + (virt_num_data_entries / 2)));
+ lock_and_unlock_random_entries(file_ptr, 0,
+ ((virt_num_data_entries / 50) - 1),
0, 100);
}
/* ...and then move them back. */
for ( i = (virt_num_data_entries / 2) - 1; i >= 0; i-- )
{
- lock_entry(file_ptr, i);
- unlock_entry(file_ptr, i, H5AC__DIRTIED_FLAG);
- move_entry(file_ptr, i, (i + (virt_num_data_entries / 2)));
- lock_and_unlock_random_entries(file_ptr, 0,
- (virt_num_data_entries / 100),
- 0, 100);
+ lock_entry(file_ptr, i);
+ unlock_entry(file_ptr, i, H5AC__DIRTIED_FLAG);
+ move_entry(file_ptr, i, (i + (virt_num_data_entries / 2)));
+ lock_and_unlock_random_entries(file_ptr, 0,
+ (virt_num_data_entries / 100),
+ 0, 100);
}
- for ( i = 0; i < (virt_num_data_entries / 2); i+=61 )
- {
- hbool_t via_unprotect = ( (((unsigned)i) & 0x01) == 0 );
- hbool_t dirty = ( (((unsigned)i) & 0x02) == 0 );
+ for ( i = 0; i < (virt_num_data_entries / 2); i+=61 )
+ {
+ hbool_t via_unprotect = ( (((unsigned)i) & 0x01) == 0 );
+ hbool_t dirty = ( (((unsigned)i) & 0x02) == 0 );
- unpin_entry(file_ptr, i, TRUE, dirty, via_unprotect);
- }
+ unpin_entry(file_ptr, i, TRUE, dirty, via_unprotect);
+ }
if ( fid >= 0 ) {
@@ -5862,7 +5861,7 @@ smoke_check_2(int metadata_write_strategy)
nerrors++;
if ( verbose ) {
- HDfprintf(stdout, "%d:%s: take_down_cache() failed.\n",
+ HDfprintf(stdout, "%d:%s: take_down_cache() failed.\n",
world_mpi_rank, FUNC);
}
}
@@ -5908,9 +5907,9 @@ smoke_check_2(int metadata_write_strategy)
if ( world_mpi_rank == 0 ) {
- if ( max_nerrors == 0 ) {
+ if ( max_nerrors == 0 ) {
- PASSED();
+ PASSED();
} else {
@@ -5925,24 +5924,24 @@ smoke_check_2(int metadata_write_strategy)
} /* smoke_check_2() */
-
+
/*****************************************************************************
*
- * Function: smoke_check_3()
+ * Function: smoke_check_3()
*
- * Purpose: Third smoke check for the parallel cache.
+ * Purpose: Third smoke check for the parallel cache.
*
- * Use random reads to vary the loads on the diffferent
- * processors. Also force different cache size adjustments.
+ * Use random reads to vary the loads on the diffferent
+ * processors. Also force different cache size adjustments.
*
- * In this test, load process 0 heavily, and the other
- * processes lightly.
+ * In this test, load process 0 heavily, and the other
+ * processes lightly.
*
- * Return: Success: TRUE
+ * Return: Success: TRUE
*
- * Failure: FALSE
+ * Failure: FALSE
*
- * Programmer: JRM -- 1/13/06
+ * Programmer: JRM -- 1/13/06
*
*****************************************************************************/
static hbool_t
@@ -5962,23 +5961,23 @@ smoke_check_3(int metadata_write_strategy)
switch ( metadata_write_strategy ) {
- case H5AC_METADATA_WRITE_STRATEGY__PROCESS_0_ONLY:
+ case H5AC_METADATA_WRITE_STRATEGY__PROCESS_0_ONLY:
if ( world_mpi_rank == 0 ) {
- TESTING("smoke check #3 -- process 0 only md write strategy");
+ TESTING("smoke check #3 -- process 0 only md write strategy");
}
- break;
+ break;
- case H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED:
+ case H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED:
if ( world_mpi_rank == 0 ) {
- TESTING("smoke check #3 -- distributed md write strategy");
+ TESTING("smoke check #3 -- distributed md write strategy");
}
- break;
+ break;
default:
if ( world_mpi_rank == 0 ) {
- TESTING("smoke check #3 -- unknown md write strategy");
+ TESTING("smoke check #3 -- unknown md write strategy");
}
- break;
+ break;
}
nerrors = 0;
@@ -5987,12 +5986,12 @@ smoke_check_3(int metadata_write_strategy)
if ( world_mpi_rank == world_server_mpi_rank ) {
- if ( ! server_main() ) {
+ if ( ! server_main() ) {
/* some error occured in the server -- report failure */
nerrors++;
if ( verbose ) {
- HDfprintf(stdout, "%d:%s: server_main() failed.\n",
+ HDfprintf(stdout, "%d:%s: server_main() failed.\n",
world_mpi_rank, FUNC);
}
}
@@ -6006,7 +6005,7 @@ smoke_check_3(int metadata_write_strategy)
fid = -1;
cache_ptr = NULL;
if ( verbose ) {
- HDfprintf(stdout, "%d:%s: setup_cache_for_test() failed.\n",
+ HDfprintf(stdout, "%d:%s: setup_cache_for_test() failed.\n",
world_mpi_rank, FUNC);
}
}
@@ -6020,7 +6019,7 @@ smoke_check_3(int metadata_write_strategy)
if ( i > 100 ) {
- lock_and_unlock_random_entries(file_ptr, (i - 100), i,
+ lock_and_unlock_random_entries(file_ptr, (i - 100), i,
min_count, max_count);
}
}
@@ -6030,48 +6029,48 @@ smoke_check_3(int metadata_write_strategy)
max_count = min_count + 50;
for ( i = (virt_num_data_entries / 4);
- i < (virt_num_data_entries / 2);
- i++ )
+ i < (virt_num_data_entries / 2);
+ i++ )
{
insert_entry(cache_ptr, file_ptr, i, H5AC__NO_FLAGS_SET);
- if ( i % 59 == 0 ) {
+ if ( i % 59 == 0 ) {
- hbool_t dirty = ( (i % 2) == 0);
+ hbool_t dirty = ( (i % 2) == 0);
- if ( data[i].local_pinned ) {
- unpin_entry(file_ptr, i, FALSE, FALSE, FALSE);
- }
+ if ( data[i].local_pinned ) {
+ unpin_entry(file_ptr, i, FALSE, FALSE, FALSE);
+ }
- pin_entry(file_ptr, i, TRUE, dirty);
+ pin_entry(file_ptr, i, TRUE, dirty);
- HDassert( !dirty || data[i].header.is_dirty );
- HDassert( data[i].header.is_pinned );
- HDassert( data[i].global_pinned );
- HDassert( ! data[i].local_pinned );
- }
+ HDassert( !dirty || data[i].header.is_dirty );
+ HDassert( data[i].header.is_pinned );
+ HDassert( data[i].global_pinned );
+ HDassert( ! data[i].local_pinned );
+ }
if ( i > 100 ) {
- lock_and_unlock_random_entries(file_ptr, (i - 100), i,
+ lock_and_unlock_random_entries(file_ptr, (i - 100), i,
min_count, max_count);
}
- local_pin_and_unpin_random_entries(file_ptr, 0,
+ local_pin_and_unpin_random_entries(file_ptr, 0,
virt_num_data_entries / 4,
- 0, (file_mpi_rank + 2));
+ 0, (file_mpi_rank + 2));
- }
+ }
- /* flush the file to be sure that we have no problems flushing
- * pinned entries
- */
+ /* flush the file to be sure that we have no problems flushing
+ * pinned entries
+ */
if ( H5Fflush(fid, H5F_SCOPE_GLOBAL) < 0 ) {
nerrors++;
if ( verbose ) {
- HDfprintf(stdout, "%d:%s: H5Fflush() failed.\n",
+ HDfprintf(stdout, "%d:%s: H5Fflush() failed.\n",
world_mpi_rank, FUNC);
}
}
@@ -6087,27 +6086,27 @@ smoke_check_3(int metadata_write_strategy)
for ( i = (virt_num_data_entries / 2) - 1; i >= 0; i-- )
{
- if ( ( i >= (virt_num_data_entries / 4) ) && ( i % 59 == 0 ) ) {
+ if ( ( i >= (virt_num_data_entries / 4) ) && ( i % 59 == 0 ) ) {
hbool_t via_unprotect = ( (((unsigned)i) & 0x02) == 0 );
- hbool_t dirty = ( (((unsigned)i) & 0x04) == 0 );
-
- HDassert( data[i].global_pinned );
- HDassert( ! data[i].local_pinned );
-
- unpin_entry(file_ptr, i, TRUE, dirty,
- via_unprotect);
- }
- if ( i % 2 == 0 ) {
-
- lock_entry(file_ptr, i);
- unlock_entry(file_ptr, i, H5AC__NO_FLAGS_SET);
- local_pin_and_unpin_random_entries(file_ptr, 0,
- virt_num_data_entries / 2,
- 0, 2);
- lock_and_unlock_random_entries(file_ptr,
+ hbool_t dirty = ( (((unsigned)i) & 0x04) == 0 );
+
+ HDassert( data[i].global_pinned );
+ HDassert( ! data[i].local_pinned );
+
+ unpin_entry(file_ptr, i, TRUE, dirty,
+ via_unprotect);
+ }
+ if ( i % 2 == 0 ) {
+
+ lock_entry(file_ptr, i);
+ unlock_entry(file_ptr, i, H5AC__NO_FLAGS_SET);
+ local_pin_and_unpin_random_entries(file_ptr, 0,
+ virt_num_data_entries / 2,
+ 0, 2);
+ lock_and_unlock_random_entries(file_ptr,
min_idx, max_idx, 0, 100);
- }
+ }
}
min_idx = 0;
@@ -6120,9 +6119,9 @@ smoke_check_3(int metadata_write_strategy)
for ( i = 0; i < (virt_num_data_entries / 2); i+=2 )
{
- lock_entry(file_ptr, i);
- unlock_entry(file_ptr, i, H5AC__DIRTIED_FLAG);
- lock_and_unlock_random_entries(file_ptr,
+ lock_entry(file_ptr, i);
+ unlock_entry(file_ptr, i, H5AC__DIRTIED_FLAG);
+ lock_and_unlock_random_entries(file_ptr,
min_idx, max_idx, 0, 100);
}
@@ -6135,22 +6134,22 @@ smoke_check_3(int metadata_write_strategy)
/* move the first half of the entries... */
for ( i = 0; i < (virt_num_data_entries / 2); i++ )
{
- lock_entry(file_ptr, i);
- unlock_entry(file_ptr, i, H5AC__NO_FLAGS_SET);
- move_entry(file_ptr, i, (i + (virt_num_data_entries / 2)));
- lock_and_unlock_random_entries(file_ptr, 0,
- (virt_num_data_entries / 20),
+ lock_entry(file_ptr, i);
+ unlock_entry(file_ptr, i, H5AC__NO_FLAGS_SET);
+ move_entry(file_ptr, i, (i + (virt_num_data_entries / 2)));
+ lock_and_unlock_random_entries(file_ptr, 0,
+ (virt_num_data_entries / 20),
min_count, max_count);
}
/* ...and then move them back. */
for ( i = (virt_num_data_entries / 2) - 1; i >= 0; i-- )
{
- lock_entry(file_ptr, i);
- unlock_entry(file_ptr, i, H5AC__DIRTIED_FLAG);
- move_entry(file_ptr, i, (i + (virt_num_data_entries / 2)));
- lock_and_unlock_random_entries(file_ptr, 0,
- (virt_num_data_entries / 40),
+ lock_entry(file_ptr, i);
+ unlock_entry(file_ptr, i, H5AC__DIRTIED_FLAG);
+ move_entry(file_ptr, i, (i + (virt_num_data_entries / 2)));
+ lock_and_unlock_random_entries(file_ptr, 0,
+ (virt_num_data_entries / 40),
min_count, max_count);
}
@@ -6162,16 +6161,16 @@ smoke_check_3(int metadata_write_strategy)
for ( i = 0; i < (virt_num_data_entries / 2); i+=2 )
{
- local_pin_and_unpin_random_entries(file_ptr, 0,
- (virt_num_data_entries / 2),
- 0, 5);
+ local_pin_and_unpin_random_entries(file_ptr, 0,
+ (virt_num_data_entries / 2),
+ 0, 5);
- lock_entry(file_ptr, i);
- unlock_entry(file_ptr, i, H5AC__DIRTIED_FLAG);
+ lock_entry(file_ptr, i);
+ unlock_entry(file_ptr, i, H5AC__DIRTIED_FLAG);
if ( i > 100 ) {
- lock_and_unlock_random_entries(file_ptr, (i - 100), i,
+ lock_and_unlock_random_entries(file_ptr, (i - 100), i,
min_count, max_count);
}
}
@@ -6185,7 +6184,7 @@ smoke_check_3(int metadata_write_strategy)
nerrors++;
if ( verbose ) {
- HDfprintf(stdout, "%d:%s: take_down_cache() failed.\n",
+ HDfprintf(stdout, "%d:%s: take_down_cache() failed.\n",
world_mpi_rank, FUNC);
}
}
@@ -6232,9 +6231,9 @@ smoke_check_3(int metadata_write_strategy)
if ( world_mpi_rank == 0 ) {
- if ( max_nerrors == 0 ) {
+ if ( max_nerrors == 0 ) {
- PASSED();
+ PASSED();
} else {
@@ -6249,24 +6248,24 @@ smoke_check_3(int metadata_write_strategy)
} /* smoke_check_3() */
-
+
/*****************************************************************************
*
- * Function: smoke_check_4()
+ * Function: smoke_check_4()
*
- * Purpose: Fourth smoke check for the parallel cache.
+ * Purpose: Fourth smoke check for the parallel cache.
*
- * Use random reads to vary the loads on the diffferent
- * processors. Also force different cache size adjustments.
+ * Use random reads to vary the loads on the diffferent
+ * processors. Also force different cache size adjustments.
*
- * In this test, load process 0 lightly, and the other
- * processes heavily.
+ * In this test, load process 0 lightly, and the other
+ * processes heavily.
*
- * Return: Success: TRUE
+ * Return: Success: TRUE
*
- * Failure: FALSE
+ * Failure: FALSE
*
- * Programmer: JRM -- 1/13/06
+ * Programmer: JRM -- 1/13/06
*
*****************************************************************************/
static hbool_t
@@ -6286,23 +6285,23 @@ smoke_check_4(int metadata_write_strategy)
switch ( metadata_write_strategy ) {
- case H5AC_METADATA_WRITE_STRATEGY__PROCESS_0_ONLY:
+ case H5AC_METADATA_WRITE_STRATEGY__PROCESS_0_ONLY:
if ( world_mpi_rank == 0 ) {
- TESTING("smoke check #4 -- process 0 only md write strategy");
+ TESTING("smoke check #4 -- process 0 only md write strategy");
}
- break;
+ break;
- case H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED:
+ case H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED:
if ( world_mpi_rank == 0 ) {
- TESTING("smoke check #4 -- distributed md write strategy");
+ TESTING("smoke check #4 -- distributed md write strategy");
}
- break;
+ break;
default:
if ( world_mpi_rank == 0 ) {
- TESTING("smoke check #4 -- unknown md write strategy");
+ TESTING("smoke check #4 -- unknown md write strategy");
}
- break;
+ break;
}
nerrors = 0;
@@ -6311,12 +6310,12 @@ smoke_check_4(int metadata_write_strategy)
if ( world_mpi_rank == world_server_mpi_rank ) {
- if ( ! server_main() ) {
+ if ( ! server_main() ) {
/* some error occured in the server -- report failure */
nerrors++;
if ( verbose ) {
- HDfprintf(stdout, "%d:%s: server_main() failed.\n",
+ HDfprintf(stdout, "%d:%s: server_main() failed.\n",
world_mpi_rank, FUNC);
}
}
@@ -6330,7 +6329,7 @@ smoke_check_4(int metadata_write_strategy)
fid = -1;
cache_ptr = NULL;
if ( verbose ) {
- HDfprintf(stdout, "%d:%s: setup_cache_for_test() failed.\n",
+ HDfprintf(stdout, "%d:%s: setup_cache_for_test() failed.\n",
world_mpi_rank, FUNC);
}
}
@@ -6345,7 +6344,7 @@ smoke_check_4(int metadata_write_strategy)
if ( i > 100 ) {
- lock_and_unlock_random_entries(file_ptr, (i - 100), i,
+ lock_and_unlock_random_entries(file_ptr, (i - 100), i,
min_count, max_count);
}
}
@@ -6354,23 +6353,23 @@ smoke_check_4(int metadata_write_strategy)
max_count = min_count + 100;
for ( i = (virt_num_data_entries / 4);
- i < (virt_num_data_entries / 2);
- i++ )
+ i < (virt_num_data_entries / 2);
+ i++ )
{
- if ( i % 2 == 0 ) {
+ if ( i % 2 == 0 ) {
insert_entry(cache_ptr, file_ptr, i, H5AC__NO_FLAGS_SET);
- } else {
+ } else {
- /* Insert some entries pinned, and then unpin them
- * immediately. We have tested pinned entries elsewhere,
- * so it should be sufficient to verify that the
- * entries are in fact pinned (which unpin_entry() should do).
- */
+ /* Insert some entries pinned, and then unpin them
+ * immediately. We have tested pinned entries elsewhere,
+ * so it should be sufficient to verify that the
+ * entries are in fact pinned (which unpin_entry() should do).
+ */
insert_entry(cache_ptr, file_ptr, i, H5C__PIN_ENTRY_FLAG);
unpin_entry(file_ptr, i, TRUE, FALSE, FALSE);
- }
+ }
if ( i % 59 == 0 ) {
@@ -6390,19 +6389,19 @@ smoke_check_4(int metadata_write_strategy)
if ( i > 100 ) {
- lock_and_unlock_random_entries(file_ptr, (i - 100), i,
+ lock_and_unlock_random_entries(file_ptr, (i - 100), i,
min_count, max_count);
}
local_pin_and_unpin_random_entries(file_ptr, 0,
- (virt_num_data_entries / 4),
+ (virt_num_data_entries / 4),
0, (file_mpi_rank + 2));
}
/* flush the file to be sure that we have no problems flushing
- * pinned entries
- */
+ * pinned entries
+ */
if ( H5Fflush(fid, H5F_SCOPE_GLOBAL) < 0 ) {
nerrors++;
if ( verbose ) {
@@ -6429,13 +6428,13 @@ smoke_check_4(int metadata_write_strategy)
unpin_entry(file_ptr, i, TRUE, dirty, via_unprotect);
}
- if ( i % 2 == 0 ) {
+ if ( i % 2 == 0 ) {
- lock_entry(file_ptr, i);
- unlock_entry(file_ptr, i, H5AC__NO_FLAGS_SET);
- lock_and_unlock_random_entries(file_ptr,
+ lock_entry(file_ptr, i);
+ unlock_entry(file_ptr, i, H5AC__NO_FLAGS_SET);
+ lock_and_unlock_random_entries(file_ptr,
min_idx, max_idx, 0, 100);
- }
+ }
}
min_idx = 0;
@@ -6444,14 +6443,14 @@ smoke_check_4(int metadata_write_strategy)
for ( i = 0; i < (virt_num_data_entries / 2); i+=2 )
{
- lock_entry(file_ptr, i);
- unlock_entry(file_ptr, i, H5AC__DIRTIED_FLAG);
- lock_and_unlock_random_entries(file_ptr,
+ lock_entry(file_ptr, i);
+ unlock_entry(file_ptr, i, H5AC__DIRTIED_FLAG);
+ lock_and_unlock_random_entries(file_ptr,
min_idx, max_idx, 0, 100);
}
- /* we can't move pinned entries, so release any local pins now. */
- local_unpin_all_entries(file_ptr, FALSE);
+ /* we can't move pinned entries, so release any local pins now. */
+ local_unpin_all_entries(file_ptr, FALSE);
min_count = 10 * (file_mpi_rank % 4);
max_count = min_count + 100;
@@ -6459,22 +6458,22 @@ smoke_check_4(int metadata_write_strategy)
/* move the first half of the entries... */
for ( i = 0; i < (virt_num_data_entries / 2); i++ )
{
- lock_entry(file_ptr, i);
- unlock_entry(file_ptr, i, H5AC__NO_FLAGS_SET);
- move_entry(file_ptr, i, (i + (virt_num_data_entries / 2)));
- lock_and_unlock_random_entries(file_ptr, 0,
- (virt_num_data_entries / 20),
+ lock_entry(file_ptr, i);
+ unlock_entry(file_ptr, i, H5AC__NO_FLAGS_SET);
+ move_entry(file_ptr, i, (i + (virt_num_data_entries / 2)));
+ lock_and_unlock_random_entries(file_ptr, 0,
+ (virt_num_data_entries / 20),
min_count, max_count);
}
/* ...and then move them back. */
for ( i = (virt_num_data_entries / 2) - 1; i >= 0; i-- )
{
- lock_entry(file_ptr, i);
- unlock_entry(file_ptr, i, H5AC__DIRTIED_FLAG);
- move_entry(file_ptr, i, (i + (virt_num_data_entries / 2)));
- lock_and_unlock_random_entries(file_ptr, 0,
- (virt_num_data_entries / 40),
+ lock_entry(file_ptr, i);
+ unlock_entry(file_ptr, i, H5AC__DIRTIED_FLAG);
+ move_entry(file_ptr, i, (i + (virt_num_data_entries / 2)));
+ lock_and_unlock_random_entries(file_ptr, 0,
+ (virt_num_data_entries / 40),
min_count, max_count);
}
@@ -6486,12 +6485,12 @@ smoke_check_4(int metadata_write_strategy)
for ( i = 0; i < (virt_num_data_entries / 2); i+=2 )
{
- lock_entry(file_ptr, i);
- unlock_entry(file_ptr, i, H5AC__DIRTIED_FLAG);
+ lock_entry(file_ptr, i);
+ unlock_entry(file_ptr, i, H5AC__DIRTIED_FLAG);
if ( i > 100 ) {
- lock_and_unlock_random_entries(file_ptr, (i - 100), i,
+ lock_and_unlock_random_entries(file_ptr, (i - 100), i,
min_count, max_count);
}
}
@@ -6502,7 +6501,7 @@ smoke_check_4(int metadata_write_strategy)
nerrors++;
if ( verbose ) {
- HDfprintf(stdout, "%d:%s: take_down_cache() failed.\n",
+ HDfprintf(stdout, "%d:%s: take_down_cache() failed.\n",
world_mpi_rank, FUNC);
}
}
@@ -6549,9 +6548,9 @@ smoke_check_4(int metadata_write_strategy)
if ( world_mpi_rank == 0 ) {
- if ( max_nerrors == 0 ) {
+ if ( max_nerrors == 0 ) {
- PASSED();
+ PASSED();
} else {
@@ -6566,19 +6565,19 @@ smoke_check_4(int metadata_write_strategy)
} /* smoke_check_4() */
-
+
/*****************************************************************************
*
- * Function: smoke_check_5()
+ * Function: smoke_check_5()
*
- * Purpose: Similar to smoke check 1, but modified to verify that
- * H5AC_mark_entry_dirty() works in the parallel case.
+ * Purpose: Similar to smoke check 1, but modified to verify that
+ * H5AC_mark_entry_dirty() works in the parallel case.
*
- * Return: Success: TRUE
+ * Return: Success: TRUE
*
- * Failure: FALSE
+ * Failure: FALSE
*
- * Programmer: JRM -- 5/18/06
+ * Programmer: JRM -- 5/18/06
*
*****************************************************************************/
static hbool_t
@@ -6594,23 +6593,23 @@ smoke_check_5(int metadata_write_strategy)
switch ( metadata_write_strategy ) {
- case H5AC_METADATA_WRITE_STRATEGY__PROCESS_0_ONLY:
+ case H5AC_METADATA_WRITE_STRATEGY__PROCESS_0_ONLY:
if ( world_mpi_rank == 0 ) {
- TESTING("smoke check #5 -- process 0 only md write strategy");
+ TESTING("smoke check #5 -- process 0 only md write strategy");
}
- break;
+ break;
- case H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED:
+ case H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED:
if ( world_mpi_rank == 0 ) {
- TESTING("smoke check #5 -- distributed md write strategy");
+ TESTING("smoke check #5 -- distributed md write strategy");
}
- break;
+ break;
default:
if ( world_mpi_rank == 0 ) {
- TESTING("smoke check #5 -- unknown md write strategy");
+ TESTING("smoke check #5 -- unknown md write strategy");
}
- break;
+ break;
}
@@ -6620,12 +6619,12 @@ smoke_check_5(int metadata_write_strategy)
if ( world_mpi_rank == world_server_mpi_rank ) {
- if ( ! server_main() ) {
+ if ( ! server_main() ) {
/* some error occured in the server -- report failure */
nerrors++;
if ( verbose ) {
- HDfprintf(stdout, "%d:%s: server_main() failed.\n",
+ HDfprintf(stdout, "%d:%s: server_main() failed.\n",
world_mpi_rank, FUNC);
}
}
@@ -6640,7 +6639,7 @@ smoke_check_5(int metadata_write_strategy)
fid = -1;
cache_ptr = NULL;
if ( verbose ) {
- HDfprintf(stdout, "%d:%s: setup_cache_for_test() failed.\n",
+ HDfprintf(stdout, "%d:%s: setup_cache_for_test() failed.\n",
world_mpi_rank, FUNC);
}
}
@@ -6650,60 +6649,60 @@ smoke_check_5(int metadata_write_strategy)
insert_entry(cache_ptr, file_ptr, i, H5AC__NO_FLAGS_SET);
}
- /* flush the file so we can lock known clean entries. */
+ /* flush the file so we can lock known clean entries. */
if ( H5Fflush(fid, H5F_SCOPE_GLOBAL) < 0 ) {
nerrors++;
if ( verbose ) {
- HDfprintf(stdout, "%d:%s: H5Fflush() failed.\n",
+ HDfprintf(stdout, "%d:%s: H5Fflush() failed.\n",
world_mpi_rank, FUNC);
}
}
for ( i = 0; i < (virt_num_data_entries / 4); i++ )
{
- lock_entry(file_ptr, i);
+ lock_entry(file_ptr, i);
- if ( i % 2 == 0 )
- {
- mark_entry_dirty(i);
- }
+ if ( i % 2 == 0 )
+ {
+ mark_entry_dirty(i);
+ }
- unlock_entry(file_ptr, i, H5AC__NO_FLAGS_SET);
+ unlock_entry(file_ptr, i, H5AC__NO_FLAGS_SET);
- if ( i % 2 == 1 )
- {
- if ( i % 4 == 1 ) {
+ if ( i % 2 == 1 )
+ {
+ if ( i % 4 == 1 ) {
- lock_entry(file_ptr, i);
- unlock_entry(file_ptr, i, H5AC__DIRTIED_FLAG);
- }
+ lock_entry(file_ptr, i);
+ unlock_entry(file_ptr, i, H5AC__DIRTIED_FLAG);
+ }
- expunge_entry(file_ptr, i);
- }
+ expunge_entry(file_ptr, i);
+ }
}
for ( i = (virt_num_data_entries / 2) - 1;
i >= (virt_num_data_entries / 4);
- i-- )
+ i-- )
{
- pin_entry(file_ptr, i, TRUE, FALSE);
+ pin_entry(file_ptr, i, TRUE, FALSE);
- if ( i % 2 == 0 )
- {
- if ( i % 8 <= 4 ) {
+ if ( i % 2 == 0 )
+ {
+ if ( i % 8 <= 4 ) {
- resize_entry(i, data[i].len / 2);
- }
+ resize_entry(i, data[i].len / 2);
+ }
mark_entry_dirty(i);
- if ( i % 8 <= 4 ) {
+ if ( i % 8 <= 4 ) {
- resize_entry(i, data[i].len);
- }
- }
+ resize_entry(i, data[i].len);
+ }
+ }
- unpin_entry(file_ptr, i, TRUE, FALSE, FALSE);
+ unpin_entry(file_ptr, i, TRUE, FALSE, FALSE);
}
if ( fid >= 0 ) {
@@ -6712,7 +6711,7 @@ smoke_check_5(int metadata_write_strategy)
nerrors++;
if ( verbose ) {
- HDfprintf(stdout, "%d:%s: take_down_cache() failed.\n",
+ HDfprintf(stdout, "%d:%s: take_down_cache() failed.\n",
world_mpi_rank, FUNC);
}
}
@@ -6758,9 +6757,9 @@ smoke_check_5(int metadata_write_strategy)
if ( world_mpi_rank == 0 ) {
- if ( max_nerrors == 0 ) {
+ if ( max_nerrors == 0 ) {
- PASSED();
+ PASSED();
} else {
@@ -6775,10 +6774,10 @@ smoke_check_5(int metadata_write_strategy)
} /* smoke_check_5() */
-
+
/*****************************************************************************
*
- * Function: trace_file_check()
+ * Function: trace_file_check()
*
* Purpose: A basic test of the trace file capability. In essence,
* we invoke all operations that generate trace file output,
@@ -6808,11 +6807,11 @@ smoke_check_5(int metadata_write_strategy)
*
* This test is skipped if H5_METADATA_TRACE_FILE is undefined.
*
- * Return: Success: TRUE
+ * Return: Success: TRUE
*
- * Failure: FALSE
+ * Failure: FALSE
*
- * Programmer: JRM -- 6/13/06
+ * Programmer: JRM -- 6/13/06
*
*****************************************************************************/
static hbool_t
@@ -6897,25 +6896,25 @@ trace_file_check(int metadata_write_strategy)
switch ( metadata_write_strategy ) {
- case H5AC_METADATA_WRITE_STRATEGY__PROCESS_0_ONLY:
+ case H5AC_METADATA_WRITE_STRATEGY__PROCESS_0_ONLY:
#ifdef H5_METADATA_TRACE_FILE
expected_output = &expected_output_0;
#endif /* H5_METADATA_TRACE_FILE */
if ( world_mpi_rank == 0 ) {
- TESTING(
- "trace file collection -- process 0 only md write strategy");
+ TESTING(
+ "trace file collection -- process 0 only md write strategy");
}
- break;
+ break;
- case H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED:
+ case H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED:
#ifdef H5_METADATA_TRACE_FILE
expected_output = &expected_output_1;
#endif /* H5_METADATA_TRACE_FILE */
if ( world_mpi_rank == 0 ) {
- TESTING(
- "trace file collection -- distributed md write strategy");
+ TESTING(
+ "trace file collection -- distributed md write strategy");
}
- break;
+ break;
default:
#ifdef H5_METADATA_TRACE_FILE
@@ -6925,9 +6924,9 @@ trace_file_check(int metadata_write_strategy)
expected_output = &expected_output_0;
#endif /* H5_METADATA_TRACE_FILE */
if ( world_mpi_rank == 0 ) {
- TESTING("trace file collection -- unknown md write strategy");
+ TESTING("trace file collection -- unknown md write strategy");
}
- break;
+ break;
}
#ifdef H5_METADATA_TRACE_FILE
@@ -6938,12 +6937,12 @@ trace_file_check(int metadata_write_strategy)
if ( world_mpi_rank == world_server_mpi_rank ) {
- if ( ! server_main() ) {
+ if ( ! server_main() ) {
/* some error occured in the server -- report failure */
nerrors++;
if ( verbose ) {
- HDfprintf(stdout, "%d:%s: server_main() failed.\n",
+ HDfprintf(stdout, "%d:%s: server_main() failed.\n",
world_mpi_rank, FUNC);
}
}
@@ -6958,7 +6957,7 @@ trace_file_check(int metadata_write_strategy)
fid = -1;
cache_ptr = NULL;
if ( verbose ) {
- HDfprintf(stdout, "%d:%s: setup_cache_for_test() failed.\n",
+ HDfprintf(stdout, "%d:%s: setup_cache_for_test() failed.\n",
world_mpi_rank, FUNC);
}
}
@@ -6970,58 +6969,58 @@ trace_file_check(int metadata_write_strategy)
if ( H5AC_get_cache_auto_resize_config(cache_ptr, &config)
!= SUCCEED ) {
- nerrors++;
- HDfprintf(stdout,
+ nerrors++;
+ HDfprintf(stdout,
"%d:%s: H5AC_get_cache_auto_resize_config() failed.\n",
world_mpi_rank, FUNC);
} else {
config.open_trace_file = TRUE;
- strcpy(config.trace_file_name, "t_cache_trace.txt");
+ strcpy(config.trace_file_name, "t_cache_trace.txt");
if ( H5AC_set_cache_auto_resize_config(cache_ptr, &config)
- != SUCCEED ) {
+ != SUCCEED ) {
- nerrors++;
- HDfprintf(stdout,
+ nerrors++;
+ HDfprintf(stdout,
"%d:%s: H5AC_set_cache_auto_resize_config() failed.\n",
world_mpi_rank, FUNC);
}
}
}
- insert_entry(cache_ptr, file_ptr, 0, H5AC__NO_FLAGS_SET);
- insert_entry(cache_ptr, file_ptr, 1, H5AC__NO_FLAGS_SET);
- insert_entry(cache_ptr, file_ptr, 2, H5AC__NO_FLAGS_SET);
- insert_entry(cache_ptr, file_ptr, 3, H5AC__NO_FLAGS_SET);
+ insert_entry(cache_ptr, file_ptr, 0, H5AC__NO_FLAGS_SET);
+ insert_entry(cache_ptr, file_ptr, 1, H5AC__NO_FLAGS_SET);
+ insert_entry(cache_ptr, file_ptr, 2, H5AC__NO_FLAGS_SET);
+ insert_entry(cache_ptr, file_ptr, 3, H5AC__NO_FLAGS_SET);
- lock_entry(file_ptr, 0);
- mark_entry_dirty(0);
- unlock_entry(file_ptr, 0, H5AC__NO_FLAGS_SET);
+ lock_entry(file_ptr, 0);
+ mark_entry_dirty(0);
+ unlock_entry(file_ptr, 0, H5AC__NO_FLAGS_SET);
- lock_entry(file_ptr, 1);
+ lock_entry(file_ptr, 1);
pin_protected_entry(1, TRUE);
- unlock_entry(file_ptr, 1, H5AC__NO_FLAGS_SET);
+ unlock_entry(file_ptr, 1, H5AC__NO_FLAGS_SET);
unpin_entry(file_ptr, 1, TRUE, FALSE, FALSE);
expunge_entry(file_ptr, 1);
- lock_entry(file_ptr, 2);
+ lock_entry(file_ptr, 2);
pin_protected_entry(2, TRUE);
- unlock_entry(file_ptr, 2, H5AC__NO_FLAGS_SET);
- mark_entry_dirty(2);
+ unlock_entry(file_ptr, 2, H5AC__NO_FLAGS_SET);
+ mark_entry_dirty(2);
resize_entry(2, data[2].len / 2);
resize_entry(2, data[2].len);
unpin_entry(file_ptr, 2, TRUE, FALSE, FALSE);
- move_entry(file_ptr, 0, 20);
- move_entry(file_ptr, 0, 20);
+ move_entry(file_ptr, 0, 20);
+ move_entry(file_ptr, 0, 20);
if ( H5Fflush(fid, H5F_SCOPE_GLOBAL) < 0 ) {
nerrors++;
if ( verbose ) {
- HDfprintf(stdout, "%d:%s: H5Fflush() failed.\n",
+ HDfprintf(stdout, "%d:%s: H5Fflush() failed.\n",
world_mpi_rank, FUNC);
}
}
@@ -7033,8 +7032,8 @@ trace_file_check(int metadata_write_strategy)
if ( H5AC_get_cache_auto_resize_config(cache_ptr, &config)
!= SUCCEED ) {
- nerrors++;
- HDfprintf(stdout,
+ nerrors++;
+ HDfprintf(stdout,
"%d:%s: H5AC_get_cache_auto_resize_config() failed.\n",
world_mpi_rank, FUNC);
@@ -7042,13 +7041,13 @@ trace_file_check(int metadata_write_strategy)
config.open_trace_file = FALSE;
config.close_trace_file = TRUE;
- config.trace_file_name[0] = '\0';
+ config.trace_file_name[0] = '\0';
if ( H5AC_set_cache_auto_resize_config(cache_ptr, &config)
- != SUCCEED ) {
+ != SUCCEED ) {
- nerrors++;
- HDfprintf(stdout,
+ nerrors++;
+ HDfprintf(stdout,
"%d:%s: H5AC_set_cache_auto_resize_config() failed.\n",
world_mpi_rank, FUNC);
}
@@ -7061,7 +7060,7 @@ trace_file_check(int metadata_write_strategy)
nerrors++;
if ( verbose ) {
- HDfprintf(stdout, "%d:%s: take_down_cache() failed.\n",
+ HDfprintf(stdout, "%d:%s: take_down_cache() failed.\n",
world_mpi_rank, FUNC);
}
}
@@ -7104,10 +7103,10 @@ trace_file_check(int metadata_write_strategy)
if ( nerrors == 0 ) {
- sprintf(trace_file_name, "t_cache_trace.txt.%d",
- (int)file_mpi_rank);
+ sprintf(trace_file_name, "t_cache_trace.txt.%d",
+ (int)file_mpi_rank);
- if ( (trace_file_ptr = HDfopen(trace_file_name, "r")) == NULL ) {
+ if ( (trace_file_ptr = HDfopen(trace_file_name, "r")) == NULL ) {
nerrors++;
if ( verbose ) {
@@ -7115,59 +7114,59 @@ trace_file_check(int metadata_write_strategy)
world_mpi_rank, FUNC);
}
}
- }
+ }
- i = 0;
- while ( ( nerrors == 0 ) && ( ! done ) )
- {
- if ( (*expected_output)[i] == NULL ) {
+ i = 0;
+ while ( ( nerrors == 0 ) && ( ! done ) )
+ {
+ if ( (*expected_output)[i] == NULL ) {
- expected_line_len = 0;
+ expected_line_len = 0;
- } else {
+ } else {
- expected_line_len = HDstrlen((*expected_output)[i]);
- }
+ expected_line_len = HDstrlen((*expected_output)[i]);
+ }
- if ( HDfgets(buffer, 255, trace_file_ptr) != NULL ) {
+ if ( HDfgets(buffer, 255, trace_file_ptr) != NULL ) {
- actual_line_len = strlen(buffer);
+ actual_line_len = strlen(buffer);
- } else {
+ } else {
- actual_line_len = 0;
- }
+ actual_line_len = 0;
+ }
- if ( ( actual_line_len == 0 ) && ( expected_line_len == 0 ) ) {
+ if ( ( actual_line_len == 0 ) && ( expected_line_len == 0 ) ) {
- done = TRUE;
+ done = TRUE;
- } else if ( ( actual_line_len != expected_line_len ) ||
- ( HDstrcmp(buffer, (*expected_output)[i]) != 0 ) ) {
+ } else if ( ( actual_line_len != expected_line_len ) ||
+ ( HDstrcmp(buffer, (*expected_output)[i]) != 0 ) ) {
- nerrors++;
+ nerrors++;
if ( verbose ) {
HDfprintf(stdout,
- "%d:%s: Unexpected data in trace file line %d.\n",
+ "%d:%s: Unexpected data in trace file line %d.\n",
world_mpi_rank, FUNC, i);
- HDfprintf(stdout, "%d:%s: expected = \"%s\" %d\n",
- world_mpi_rank, FUNC, (*expected_output)[i],
- expected_line_len);
- HDfprintf(stdout, "%d:%s: actual = \"%s\" %d\n",
- world_mpi_rank, FUNC, buffer,
- actual_line_len);
+ HDfprintf(stdout, "%d:%s: expected = \"%s\" %d\n",
+ world_mpi_rank, FUNC, (*expected_output)[i],
+ expected_line_len);
+ HDfprintf(stdout, "%d:%s: actual = \"%s\" %d\n",
+ world_mpi_rank, FUNC, buffer,
+ actual_line_len);
}
- } else {
- i++;
- }
- }
+ } else {
+ i++;
+ }
+ }
- if ( trace_file_ptr != NULL ) {
+ if ( trace_file_ptr != NULL ) {
- HDfclose(trace_file_ptr);
- trace_file_ptr = NULL;
+ HDfclose(trace_file_ptr);
+ trace_file_ptr = NULL;
#if 1
- HDremove(trace_file_name);
+ HDremove(trace_file_name);
#endif
}
}
@@ -7176,9 +7175,9 @@ trace_file_check(int metadata_write_strategy)
if ( world_mpi_rank == 0 ) {
- if ( max_nerrors == 0 ) {
+ if ( max_nerrors == 0 ) {
- PASSED();
+ PASSED();
} else {
@@ -7204,18 +7203,18 @@ trace_file_check(int metadata_write_strategy)
} /* trace_file_check() */
-
+
/*****************************************************************************
*
- * Function: smoke_check_6()
+ * Function: smoke_check_6()
*
- * Purpose: Sixth smoke check for the parallel cache.
+ * Purpose: Sixth smoke check for the parallel cache.
*
- * Return: Success: TRUE
+ * Return: Success: TRUE
*
- * Failure: FALSE
+ * Failure: FALSE
*
- * Programmer: JRM -- 1/13/06
+ * Programmer: JRM -- 1/13/06
*
*****************************************************************************/
static hbool_t
@@ -7231,23 +7230,23 @@ smoke_check_6(int metadata_write_strategy)
switch ( metadata_write_strategy ) {
- case H5AC_METADATA_WRITE_STRATEGY__PROCESS_0_ONLY:
+ case H5AC_METADATA_WRITE_STRATEGY__PROCESS_0_ONLY:
if ( world_mpi_rank == 0 ) {
- TESTING("smoke check #6 -- process 0 only md write strategy");
+ TESTING("smoke check #6 -- process 0 only md write strategy");
}
- break;
+ break;
- case H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED:
+ case H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED:
if ( world_mpi_rank == 0 ) {
- TESTING("smoke check #6 -- distributed md write strategy");
+ TESTING("smoke check #6 -- distributed md write strategy");
}
- break;
+ break;
default:
if ( world_mpi_rank == 0 ) {
- TESTING("smoke check #6 -- unknown md write strategy");
+ TESTING("smoke check #6 -- unknown md write strategy");
}
- break;
+ break;
}
nerrors = 0;
@@ -7256,12 +7255,12 @@ smoke_check_6(int metadata_write_strategy)
if ( world_mpi_rank == world_server_mpi_rank ) {
- if ( ! server_main() ) {
+ if ( ! server_main() ) {
/* some error occured in the server -- report failure */
nerrors++;
if ( verbose ) {
- HDfprintf(stdout, "%d:%s: server_main() failed.\n",
+ HDfprintf(stdout, "%d:%s: server_main() failed.\n",
world_mpi_rank, FUNC);
}
}
@@ -7277,7 +7276,7 @@ smoke_check_6(int metadata_write_strategy)
fid = -1;
cache_ptr = NULL;
if ( verbose ) {
- HDfprintf(stdout, "%d:%s: setup_cache_for_test() failed.\n",
+ HDfprintf(stdout, "%d:%s: setup_cache_for_test() failed.\n",
world_mpi_rank, FUNC);
}
}
@@ -7327,11 +7326,11 @@ smoke_check_6(int metadata_write_strategy)
HDassert(cache_ptr->max_cache_size*0.8 > cache_ptr->coll_list_size);
}
- /* flush the file */
+ /* flush the file */
if ( H5Fflush(fid, H5F_SCOPE_GLOBAL) < 0 ) {
nerrors++;
if ( verbose ) {
- HDfprintf(stdout, "%d:%s: H5Fflush() failed.\n",
+ HDfprintf(stdout, "%d:%s: H5Fflush() failed.\n",
world_mpi_rank, FUNC);
}
}
@@ -7343,7 +7342,7 @@ smoke_check_6(int metadata_write_strategy)
struct datum * entry_ptr;
entry_ptr = &(data[i]);
- lock_entry(file_ptr, i);
+ lock_entry(file_ptr, i);
if(TRUE != entry_ptr->header.coll_access) {
nerrors++;
@@ -7364,7 +7363,7 @@ smoke_check_6(int metadata_write_strategy)
struct datum * entry_ptr;
entry_ptr = &(data[i]);
- lock_entry(file_ptr, i);
+ lock_entry(file_ptr, i);
if(FALSE != entry_ptr->header.coll_access) {
nerrors++;
@@ -7389,7 +7388,7 @@ smoke_check_6(int metadata_write_strategy)
nerrors++;
if ( verbose ) {
- HDfprintf(stdout, "%d:%s: take_down_cache() failed.\n",
+ HDfprintf(stdout, "%d:%s: take_down_cache() failed.\n",
world_mpi_rank, FUNC);
}
}
@@ -7437,9 +7436,9 @@ smoke_check_6(int metadata_write_strategy)
if ( world_mpi_rank == 0 ) {
- if ( max_nerrors == 0 ) {
+ if ( max_nerrors == 0 ) {
- PASSED();
+ PASSED();
} else {
@@ -7454,18 +7453,18 @@ smoke_check_6(int metadata_write_strategy)
} /* smoke_check_6() */
-
+
/*****************************************************************************
*
- * Function: main()
+ * Function: main()
*
- * Purpose: Main function for the parallel cache test.
+ * Purpose: Main function for the parallel cache test.
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: 1
+ * Failure: 1
*
- * Programmer: JRM -- 12/23/05
+ * Programmer: JRM -- 12/23/05
*
*****************************************************************************/
int
@@ -7492,7 +7491,7 @@ main(int argc, char **argv)
* calls. By then, MPI calls may not work.
*/
if (H5dont_atexit() < 0){
- printf("%d:Failed to turn off atexit processing. Continue.\n",
+ printf("%d:Failed to turn off atexit processing. Continue.\n",
mpi_rank);
};
H5open();
@@ -7503,32 +7502,32 @@ main(int argc, char **argv)
#endif /* JRM */
if ( express_test ) {
- virt_num_data_entries = EXPRESS_VIRT_NUM_DATA_ENTRIES;
+ virt_num_data_entries = EXPRESS_VIRT_NUM_DATA_ENTRIES;
} else {
- virt_num_data_entries = STD_VIRT_NUM_DATA_ENTRIES;
+ virt_num_data_entries = STD_VIRT_NUM_DATA_ENTRIES;
}
#ifdef H5_HAVE_MPE
- if ( MAINPROCESS ) { printf(" Tests compiled for MPE.\n"); }
+ if ( MAINPROCESS ) { printf(" Tests compiled for MPE.\n"); }
virt_num_data_entries = MPE_VIRT_NUM_DATA_ENTIES;
#endif /* H5_HAVE_MPE */
if (MAINPROCESS){
- printf("===================================\n");
- printf("Parallel metadata cache tests\n");
- printf(" mpi_size = %d\n", mpi_size);
- printf(" express_test = %d\n", express_test);
- printf("===================================\n");
+ printf("===================================\n");
+ printf("Parallel metadata cache tests\n");
+ printf(" mpi_size = %d\n", mpi_size);
+ printf(" express_test = %d\n", express_test);
+ printf("===================================\n");
}
if ( mpi_size < 3 ) {
if ( MAINPROCESS ) {
- printf(" Need at least 3 processes. Exiting.\n");
+ printf(" Need at least 3 processes. Exiting.\n");
}
goto finish;
}
@@ -7547,8 +7546,8 @@ main(int argc, char **argv)
/* setup file access property list with the world communicator */
if ( FAIL == (fapl = H5Pcreate(H5P_FILE_ACCESS)) ) {
nerrors++;
- if ( verbose ) {
- HDfprintf(stdout, "%d:%s: H5Pcreate() failed 1.\n",
+ if ( verbose ) {
+ HDfprintf(stdout, "%d:%s: H5Pcreate() failed 1.\n",
world_mpi_rank, FUNC);
}
}
@@ -7580,8 +7579,8 @@ main(int argc, char **argv)
/* close the fapl before we set it up again */
if ( H5Pclose(fapl) < 0 ) {
nerrors++;
- if ( verbose ) {
- HDfprintf(stdout, "%d:%s: H5Pclose() failed.\n",
+ if ( verbose ) {
+ HDfprintf(stdout, "%d:%s: H5Pclose() failed.\n",
world_mpi_rank, FUNC);
}
}
@@ -7591,9 +7590,9 @@ main(int argc, char **argv)
/* setup file access property list */
if ( FAIL == (fapl = H5Pcreate(H5P_FILE_ACCESS)) ) {
- nerrors++;
- if ( verbose ) {
- HDfprintf(stdout, "%d:%s: H5Pcreate() failed 2.\n",
+ nerrors++;
+ if ( verbose ) {
+ HDfprintf(stdout, "%d:%s: H5Pcreate() failed 2.\n",
world_mpi_rank, FUNC);
}
}
@@ -7601,8 +7600,8 @@ main(int argc, char **argv)
if ( H5Pset_fapl_mpio(fapl, file_mpi_comm, MPI_INFO_NULL) < 0 ) {
nerrors++;
- if ( verbose ) {
- HDfprintf(stdout, "%d:%s: H5Pset_fapl_mpio() failed 2.\n",
+ if ( verbose ) {
+ HDfprintf(stdout, "%d:%s: H5Pset_fapl_mpio() failed 2.\n",
world_mpi_rank, FUNC);
}
}
@@ -7620,7 +7619,7 @@ main(int argc, char **argv)
HDfprintf(stdout, "Errors in test initialization. Exiting.\n");
}
- goto finish;
+ goto finish;
}
/* run the tests */
@@ -7673,16 +7672,16 @@ finish:
* and exit.
*/
MPI_Barrier(MPI_COMM_WORLD);
- if (MAINPROCESS){ /* only process 0 reports */
- printf("===================================\n");
- if (failures){
- printf("***metadata cache tests detected %d failures***\n",
+ if (MAINPROCESS){ /* only process 0 reports */
+ printf("===================================\n");
+ if (failures){
+ printf("***metadata cache tests detected %d failures***\n",
failures);
- }
- else{
- printf("metadata cache tests finished with no failures\n");
- }
- printf("===================================\n");
+ }
+ else{
+ printf("metadata cache tests finished with no failures\n");
+ }
+ printf("===================================\n");
}
takedown_derived_types();
diff --git a/testpar/t_cache_image.c b/testpar/t_cache_image.c
index 524a63f..7fe0020 100644
--- a/testpar/t_cache_image.c
+++ b/testpar/t_cache_image.c
@@ -14,12 +14,11 @@
/* Programmer: John Mainzer
* 7/13/15
*
- * This file contains tests specific to the cache image
- * feature implemented in H5C.c
+ * This file contains tests specific to the cache image
+ * feature implemented in H5C.c
*/
-#include "h5test.h"
#include "testphdf5.h"
-#include "testpar.h"
+
#include "cache_common.h"
#include "genall5.h"
@@ -28,7 +27,7 @@
#define DSET_SIZE (40 * CHUNK_SIZE)
#define MAX_NUM_DSETS 256
#define PAR_NUM_DSETS 32
-#define PAGE_SIZE (4 * 1024)
+#define PAGE_SIZE (4 * 1024)
#define PB_SIZE (64 * PAGE_SIZE)
/* global variable declarations: */
@@ -59,8 +58,8 @@ static void open_hdf5_file(const hbool_t create_file,
hid_t * file_id_ptr,
H5F_t ** file_ptr_ptr,
H5C_t ** cache_ptr_ptr,
- MPI_Comm comm,
- MPI_Info info,
+ MPI_Comm comm,
+ MPI_Info info,
int l_facc_type,
const hbool_t all_coll_metadata_ops,
const hbool_t coll_metadata_write,
@@ -70,11 +69,11 @@ static void verify_data_sets(hid_t file_id, int min_dset, int max_dset);
/* local test function declarations */
-static hbool_t parse_flags(int argc, char * argv[], hbool_t * setup_ptr,
+static hbool_t parse_flags(int argc, char * argv[], hbool_t * setup_ptr,
hbool_t * ici_ptr, int * file_idx_ptr, int * mpi_size_ptr, hbool_t display);
static void usage(void);
static unsigned construct_test_file(int test_file_index);
-static void par_create_dataset(int dset_num, hid_t file_id, int mpi_rank,
+static void par_create_dataset(int dset_num, hid_t file_id, int mpi_rank,
int mpi_size);
static void par_delete_dataset(int dset_num, hid_t file_id, int mpi_rank);
static void par_verify_dataset(int dset_num, hid_t file_id, int mpi_rank);
@@ -83,15 +82,15 @@ static hbool_t serial_insert_cache_image(int file_name_idx, int mpi_size);
static void serial_verify_dataset(int dset_num, hid_t file_id, int mpi_size);
/* top level test function declarations */
-static unsigned verify_cache_image_RO(int file_name_id,
+static unsigned verify_cache_image_RO(int file_name_id,
int md_write_strat, int mpi_rank);
-static unsigned verify_cache_image_RW(int file_name_id,
+static unsigned verify_cache_image_RW(int file_name_id,
int md_write_strat, int mpi_rank);
-static hbool_t smoke_check_1(MPI_Comm mpi_comm, MPI_Info mpi_info,
+static hbool_t smoke_check_1(MPI_Comm mpi_comm, MPI_Info mpi_info,
int mpi_rank, int mpi_size);
-
+
/****************************************************************************/
/***************************** Utility Functions ****************************/
/****************************************************************************/
@@ -99,52 +98,52 @@ static hbool_t smoke_check_1(MPI_Comm mpi_comm, MPI_Info mpi_info,
/*-------------------------------------------------------------------------
* Function: construct_test_file()
*
- * Purpose: This function attempts to mimic the typical "poor man's
- * parallel use case in which the file is passed between
- * processes, each of which open the file, write some data,
- * close the file, and then pass control on to the next
- * process.
+ * Purpose: This function attempts to mimic the typical "poor man's
+ * parallel use case in which the file is passed between
+ * processes, each of which open the file, write some data,
+ * close the file, and then pass control on to the next
+ * process.
*
- * In this case, we create one group for each process, and
- * populate it with a "zoo" of HDF5 objects selected to
- * (ideally) exercise all HDF5 on disk data structures.
+ * In this case, we create one group for each process, and
+ * populate it with a "zoo" of HDF5 objects selected to
+ * (ideally) exercise all HDF5 on disk data structures.
*
- * The end result is a test file used verify that PHDF5
- * can open a file with a cache image.
+ * The end result is a test file used verify that PHDF5
+ * can open a file with a cache image.
*
- * Cycle of operation
+ * Cycle of operation
*
- * 1) Create a HDF5 file with the cache image FAPL entry.
+ * 1) Create a HDF5 file with the cache image FAPL entry.
*
- * Verify that the cache is informed of the cache image
- * FAPL entry.
+ * Verify that the cache is informed of the cache image
+ * FAPL entry.
*
- * Set all cache image flags, forcing full functionality.
+ * Set all cache image flags, forcing full functionality.
*
- * 2) Create a data set in the file.
+ * 2) Create a data set in the file.
*
- * 3) Close the file.
+ * 3) Close the file.
*
- * 4) Open the file.
+ * 4) Open the file.
*
- * Verify that the metadata cache is instructed to load
+ * Verify that the metadata cache is instructed to load
* the metadata cache image.
*
- * 5) Create a data set in the file.
+ * 5) Create a data set in the file.
*
- * 6) Close the file. If enough datasets have been created
+ * 6) Close the file. If enough datasets have been created
* goto 7. Otherwise return to 4.
*
- * 7) Open the file R/O.
+ * 7) Open the file R/O.
*
* Verify that the file contains a metadata cache image
* superblock extension message.
- *
- * 8) Verify all data sets.
*
- * Verify that the cache image has been loaded.
+ * 8) Verify all data sets.
*
- * 9) close the file.
+ * Verify that the cache image has been loaded.
+ *
+ * 9) close the file.
*
* Return: void
*
@@ -153,7 +152,7 @@ static hbool_t smoke_check_1(MPI_Comm mpi_comm, MPI_Info mpi_info,
*
* Modifications:
*
- * None.
+ * None.
*
*-------------------------------------------------------------------------
*/
@@ -175,7 +174,7 @@ construct_test_file(int test_file_index)
pass = TRUE;
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
@@ -184,7 +183,7 @@ construct_test_file(int test_file_index)
HDassert(FILENAMES[test_file_index]);
- if ( h5_fixname(FILENAMES[test_file_index], H5P_DEFAULT,
+ if ( h5_fixname(FILENAMES[test_file_index], H5P_DEFAULT,
filename, sizeof(filename))
== NULL ) {
@@ -193,13 +192,13 @@ construct_test_file(int test_file_index)
}
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
- /* 1) Create a HDF5 file with the cache image FAPL entry.
+ /* 1) Create a HDF5 file with the cache image FAPL entry.
*
- * Verify that the cache is informed of the cache image FAPL entry.
+ * Verify that the cache is informed of the cache image FAPL entry.
*
* Set flags forcing full function of the cache image feature.
*/
@@ -210,7 +209,7 @@ construct_test_file(int test_file_index)
/* mdci_sbem_expected */ FALSE,
/* read_only */ FALSE,
/* set_mdci_fapl */ TRUE,
- /* config_fsm */ TRUE,
+ /* config_fsm */ TRUE,
/* enable_page_buffer */ FALSE,
/* hdf_file_name */ filename,
/* cache_image_flags */ H5C_CI__ALL_FLAGS,
@@ -225,7 +224,7 @@ construct_test_file(int test_file_index)
/* md_write_strat */ 0);
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
@@ -247,7 +246,7 @@ construct_test_file(int test_file_index)
}
#endif /* H5C_COLLECT_CACHE_STATS */
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
@@ -263,7 +262,7 @@ construct_test_file(int test_file_index)
}
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
@@ -282,7 +281,7 @@ construct_test_file(int test_file_index)
/* mdci_sbem_expected */ TRUE,
/* read_only */ FALSE,
/* set_mdci_fapl */ TRUE,
- /* config_fsm */ FALSE,
+ /* config_fsm */ FALSE,
/* enable_page_buffer */ FALSE,
/* hdf_file_name */ filename,
/* cache_image_flags */ H5C_CI__ALL_FLAGS,
@@ -356,7 +355,7 @@ construct_test_file(int test_file_index)
/* mdci_sbem_expected */ TRUE,
/* read_only */ TRUE,
/* set_mdci_fapl */ FALSE,
- /* config_fsm */ FALSE,
+ /* config_fsm */ FALSE,
/* enable_page_buffer */ FALSE,
/* hdf_file_name */ filename,
/* cache_image_flags */ H5C_CI__ALL_FLAGS,
@@ -375,7 +374,7 @@ construct_test_file(int test_file_index)
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
- /* 8) Open and close all data sets.
+ /* 8) Open and close all data sets.
*
* Verify that the cache image has been loaded.
*/
@@ -414,15 +413,15 @@ construct_test_file(int test_file_index)
} /* construct_test_file() */
-
+
/*-------------------------------------------------------------------------
* Function: create_data_sets()
*
* Purpose: If pass is TRUE on entry, create the specified data sets
- * in the indicated file.
+ * in the indicated file.
*
- * Data sets and their contents must be well know, as we
- * will verify that they contain the expected data later.
+ * Data sets and their contents must be well know, as we
+ * will verify that they contain the expected data later.
*
* On failure, set pass to FALSE, and set failure_mssg
* to point to an appropriate failure message.
@@ -436,15 +435,15 @@ construct_test_file(int test_file_index)
*
* Modifications:
*
- * Added min_dset and max_dset parameters and supporting
- * code. This allows the caller to specify a range of
- * datasets to create.
- * JRM -- 8/20/15
+ * Added min_dset and max_dset parameters and supporting
+ * code. This allows the caller to specify a range of
+ * datasets to create.
+ * JRM -- 8/20/15
*
*-------------------------------------------------------------------------
*/
-static void
+static void
create_data_sets(hid_t file_id, int min_dset, int max_dset)
{
const char * fcn_name = "create_data_sets()";
@@ -666,8 +665,8 @@ create_data_sets(hid_t file_id, int min_dset, int max_dset)
/* read the chunk from file */
if ( pass ) {
- status = H5Dread(dataset_ids[m], H5T_NATIVE_INT,
- memspace_id, filespace_ids[m],
+ status = H5Dread(dataset_ids[m], H5T_NATIVE_INT,
+ memspace_id, filespace_ids[m],
H5P_DEFAULT, data_chunk);
if ( status < 0 ) {
@@ -692,7 +691,7 @@ create_data_sets(hid_t file_id, int min_dset, int max_dset)
valid_chunk = FALSE;
- if ( verbose ) {
+ if ( verbose ) {
HDfprintf(stdout,
"data_chunk[%0d][%0d] = %0d, expect %0d.\n",
@@ -702,7 +701,7 @@ create_data_sets(hid_t file_id, int min_dset, int max_dset)
HDfprintf(stdout,
"m = %d, i = %d, j = %d, k = %d, l = %d\n",
m, i, j, k, l);
- }
+ }
}
}
}
@@ -712,12 +711,12 @@ create_data_sets(hid_t file_id, int min_dset, int max_dset)
pass = FALSE;
failure_mssg = "slab validation failed.";
- if ( verbose ) {
+ if ( verbose ) {
- fprintf(stdout,
+ fprintf(stdout,
"Chunk (%0d, %0d) in /dset%03d is invalid.\n",
i, j, m);
- }
+ }
}
}
m++;
@@ -768,16 +767,16 @@ create_data_sets(hid_t file_id, int min_dset, int max_dset)
} /* create_data_sets() */
-
+
/*-------------------------------------------------------------------------
* Function: delete_data_sets()
*
- * Purpose: If pass is TRUE on entry, verify and then delete the
- * dataset(s) indicated by min_dset and max_dset in the
- * indicated file.
+ * Purpose: If pass is TRUE on entry, verify and then delete the
+ * dataset(s) indicated by min_dset and max_dset in the
+ * indicated file.
*
- * Data sets and their contents must be well know, as we
- * will verify that they contain the expected data later.
+ * Data sets and their contents must be well know, as we
+ * will verify that they contain the expected data later.
*
* On failure, set pass to FALSE, and set failure_mssg
* to point to an appropriate failure message.
@@ -792,17 +791,17 @@ create_data_sets(hid_t file_id, int min_dset, int max_dset)
* Modifications:
*
* None.
- * JRM -- 8/20/15
+ * JRM -- 8/20/15
*
*-------------------------------------------------------------------------
*/
-#if 0
+#if 0
/* this code will be needed to test full support of cache image
* in parallel -- keep it around against that day.
*
* -- JRM
*/
-static void
+static void
delete_data_sets(hid_t file_id, int min_dset, int max_dset)
{
const char * fcn_name = "delete_data_sets()";
@@ -833,11 +832,11 @@ delete_data_sets(hid_t file_id, int min_dset, int max_dset)
{
sprintf(dset_name, "/dset%03d", i);
- if ( H5Ldelete(file_id, dset_name, H5P_DEFAULT) < 0) {
+ if ( H5Ldelete(file_id, dset_name, H5P_DEFAULT) < 0) {
pass = FALSE;
failure_mssg = "H5Ldelete() failed.";
- }
+ }
i++;
}
@@ -850,32 +849,32 @@ delete_data_sets(hid_t file_id, int min_dset, int max_dset)
} /* delete_data_sets() */
#endif
-
+
/*-------------------------------------------------------------------------
* Function: open_hdf5_file()
*
- * Purpose: If pass is true on entry, create or open the specified HDF5
- * and test to see if it has a metadata cache image superblock
- * extension message.
+ * Purpose: If pass is true on entry, create or open the specified HDF5
+ * and test to see if it has a metadata cache image superblock
+ * extension message.
*
- * Set pass to FALSE and issue a suitable failure
- * message if either the file contains a metadata cache image
- * superblock extension and mdci_sbem_expected is TRUE, or
- * vise versa.
+ * Set pass to FALSE and issue a suitable failure
+ * message if either the file contains a metadata cache image
+ * superblock extension and mdci_sbem_expected is TRUE, or
+ * vise versa.
*
- * If mdci_sbem_expected is TRUE, also verify that the metadata
- * cache has been advised of this.
+ * If mdci_sbem_expected is TRUE, also verify that the metadata
+ * cache has been advised of this.
*
- * If read_only is TRUE, open the file read only. Otherwise
- * open the file read/write.
+ * If read_only is TRUE, open the file read only. Otherwise
+ * open the file read/write.
*
- * If set_mdci_fapl is TRUE, set the metadata cache image
- * FAPL entry when opening the file, and verify that the
- * metadata cache is notified.
+ * If set_mdci_fapl is TRUE, set the metadata cache image
+ * FAPL entry when opening the file, and verify that the
+ * metadata cache is notified.
*
- * If config_fsm is TRUE, setup the persistant free space
- * manager. Note that this flag may only be set if
- * create_file is also TRUE.
+ * If config_fsm is TRUE, setup the persistant free space
+ * manager. Note that this flag may only be set if
+ * create_file is also TRUE.
*
* Return pointers to the cache data structure and file data
* structures.
@@ -893,10 +892,10 @@ delete_data_sets(hid_t file_id, int min_dset, int max_dset)
* Modifications:
*
* Modified function to handle parallel file creates / opens.
- *
+ *
* JRM -- 2/1/17
*
- * Modified function to handle
+ * Modified function to handle
*
*-------------------------------------------------------------------------
*/
@@ -904,17 +903,17 @@ delete_data_sets(hid_t file_id, int min_dset, int max_dset)
static void
open_hdf5_file(const hbool_t create_file,
const hbool_t mdci_sbem_expected,
- const hbool_t read_only,
- const hbool_t set_mdci_fapl,
- const hbool_t config_fsm,
+ const hbool_t read_only,
+ const hbool_t set_mdci_fapl,
+ const hbool_t config_fsm,
const hbool_t enable_page_buffer,
- const char * hdf_file_name,
+ const char * hdf_file_name,
const unsigned cache_image_flags,
hid_t * file_id_ptr,
H5F_t ** file_ptr_ptr,
H5C_t ** cache_ptr_ptr,
- MPI_Comm comm,
- MPI_Info info,
+ MPI_Comm comm,
+ MPI_Info info,
int l_facc_type,
const hbool_t all_coll_metadata_ops,
const hbool_t coll_metadata_write,
@@ -941,8 +940,8 @@ open_hdf5_file(const hbool_t create_file,
if ( pass )
{
- /* opening the file both read only and with a cache image
- * requested is a contradiction. We resolve it by ignoring
+ /* opening the file both read only and with a cache image
+ * requested is a contradiction. We resolve it by ignoring
* the cache image request silently.
*/
if ( ( create_file && mdci_sbem_expected ) ||
@@ -969,7 +968,7 @@ open_hdf5_file(const hbool_t create_file,
}
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
/* create a file access propertly list. */
@@ -984,13 +983,13 @@ open_hdf5_file(const hbool_t create_file,
}
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
/* call H5Pset_libver_bounds() on the fapl_id */
if ( pass ) {
- if ( H5Pset_libver_bounds(fapl_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST)
+ if ( H5Pset_libver_bounds(fapl_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST)
< 0 ) {
pass = FALSE;
@@ -998,7 +997,7 @@ open_hdf5_file(const hbool_t create_file,
}
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
/* get metadata cache image config -- verify that it is the default */
@@ -1016,7 +1015,7 @@ open_hdf5_file(const hbool_t create_file,
H5AC__CURR_CACHE_IMAGE_CONFIG_VERSION ) ||
( cache_image_config.generate_image != FALSE ) ||
( cache_image_config.save_resize_status != FALSE ) ||
- ( cache_image_config.entry_ageout !=
+ ( cache_image_config.entry_ageout !=
H5AC__CACHE_IMAGE__ENTRY_AGEOUT__NONE ) ) {
pass = FALSE;
@@ -1024,7 +1023,7 @@ open_hdf5_file(const hbool_t create_file,
}
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
/* set metadata cache image fapl entry if indicated */
@@ -1044,24 +1043,24 @@ open_hdf5_file(const hbool_t create_file,
}
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
/* setup the persistant free space manager if indicated */
if ( ( pass ) && ( config_fsm ) ) {
- fcpl_id = H5Pcreate(H5P_FILE_CREATE);
+ fcpl_id = H5Pcreate(H5P_FILE_CREATE);
- if ( fcpl_id <= 0 ) {
+ if ( fcpl_id <= 0 ) {
- pass = FALSE;
- failure_mssg = "H5Pcreate(H5P_FILE_CREATE) failed.";
- }
+ pass = FALSE;
+ failure_mssg = "H5Pcreate(H5P_FILE_CREATE) failed.";
+ }
}
if ( ( pass ) && ( config_fsm ) ) {
- if ( H5Pset_file_space_strategy(fcpl_id, H5F_FSPACE_STRATEGY_PAGE,
+ if ( H5Pset_file_space_strategy(fcpl_id, H5F_FSPACE_STRATEGY_PAGE,
TRUE, (hsize_t)1) == FAIL ) {
pass = FALSE;
failure_mssg = "H5Pset_file_space_strategy() failed.\n";
@@ -1077,7 +1076,7 @@ open_hdf5_file(const hbool_t create_file,
}
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
/* setup the page buffer if indicated */
@@ -1087,10 +1086,10 @@ open_hdf5_file(const hbool_t create_file,
pass = FALSE;
failure_mssg = "H5Pset_page_buffer_size() failed.\n";
- }
+ }
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
@@ -1098,13 +1097,13 @@ open_hdf5_file(const hbool_t create_file,
/* set Parallel access with communicator */
if ( H5Pset_fapl_mpio(fapl_id, comm, info) < 0 ) {
-
+
pass = FALSE;
failure_mssg = "H5Pset_fapl_mpio() failed.\n";
}
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
if ( ( pass ) && ( l_facc_type == FACC_MPIO ) ) {
@@ -1116,7 +1115,7 @@ open_hdf5_file(const hbool_t create_file,
}
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
if ( ( pass ) && ( l_facc_type == FACC_MPIO ) ) {
@@ -1128,7 +1127,7 @@ open_hdf5_file(const hbool_t create_file,
}
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
if ( ( pass ) && ( l_facc_type == FACC_MPIO ) ) {
@@ -1137,7 +1136,7 @@ open_hdf5_file(const hbool_t create_file,
H5AC_cache_config_t mdc_config;
mdc_config.version = H5C__CURR_AUTO_SIZE_CTL_VER;
-
+
if ( H5Pget_mdc_config(fapl_id, &mdc_config) < 0 ) {
pass = FALSE;
@@ -1153,7 +1152,7 @@ open_hdf5_file(const hbool_t create_file,
}
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
/* open the file */
@@ -1161,13 +1160,13 @@ open_hdf5_file(const hbool_t create_file,
if ( create_file ) {
- if ( fcpl_id != -1 )
+ if ( fcpl_id != -1 )
- file_id = H5Fcreate(hdf_file_name, H5F_ACC_TRUNC,
- fcpl_id, fapl_id);
- else
+ file_id = H5Fcreate(hdf_file_name, H5F_ACC_TRUNC,
+ fcpl_id, fapl_id);
+ else
- file_id = H5Fcreate(hdf_file_name, H5F_ACC_TRUNC,
+ file_id = H5Fcreate(hdf_file_name, H5F_ACC_TRUNC,
H5P_DEFAULT, fapl_id);
} else {
@@ -1202,7 +1201,7 @@ open_hdf5_file(const hbool_t create_file,
}
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
/* get a pointer to the files internal data structure and then
@@ -1221,12 +1220,12 @@ open_hdf5_file(const hbool_t create_file,
}
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
- /* verify expected page buffer status. At present, page buffering
- * must be disabled in parallel -- hopefully this will change in the
+ /* verify expected page buffer status. At present, page buffering
+ * must be disabled in parallel -- hopefully this will change in the
* future.
*/
if ( pass ) {
@@ -1245,7 +1244,7 @@ open_hdf5_file(const hbool_t create_file,
}
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
@@ -1265,7 +1264,7 @@ open_hdf5_file(const hbool_t create_file,
}
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
@@ -1273,26 +1272,26 @@ open_hdf5_file(const hbool_t create_file,
if ( set_mdci_fapl ) {
- if ( read_only ) {
+ if ( read_only ) {
- if ( ( image_ctl.version !=
+ if ( ( image_ctl.version !=
H5AC__CURR_CACHE_IMAGE_CONFIG_VERSION ) ||
( image_ctl.generate_image != FALSE ) ||
( image_ctl.save_resize_status != FALSE ) ||
- ( image_ctl.entry_ageout !=
+ ( image_ctl.entry_ageout !=
H5AC__CACHE_IMAGE__ENTRY_AGEOUT__NONE ) ||
( image_ctl.flags != H5C_CI__ALL_FLAGS ) ) {
pass = FALSE;
failure_mssg = "Unexpected image_ctl values(1).\n";
}
- } else {
+ } else {
- if ( ( image_ctl.version !=
+ if ( ( image_ctl.version !=
H5AC__CURR_CACHE_IMAGE_CONFIG_VERSION ) ||
- ( image_ctl.generate_image != TRUE ) ||
+ ( image_ctl.generate_image != TRUE ) ||
( image_ctl.save_resize_status != FALSE ) ||
- ( image_ctl.entry_ageout !=
+ ( image_ctl.entry_ageout !=
H5AC__CACHE_IMAGE__ENTRY_AGEOUT__NONE ) ||
( image_ctl.flags != H5C_CI__ALL_FLAGS ) ) {
@@ -1302,11 +1301,11 @@ open_hdf5_file(const hbool_t create_file,
}
} else {
- if ( ( image_ctl.version !=
+ if ( ( image_ctl.version !=
H5AC__CURR_CACHE_IMAGE_CONFIG_VERSION ) ||
( image_ctl.generate_image != FALSE ) ||
( image_ctl.save_resize_status != FALSE ) ||
- ( image_ctl.entry_ageout !=
+ ( image_ctl.entry_ageout !=
H5AC__CACHE_IMAGE__ENTRY_AGEOUT__NONE ) ||
( image_ctl.flags != H5C_CI__ALL_FLAGS ) ) {
@@ -1316,7 +1315,7 @@ open_hdf5_file(const hbool_t create_file,
}
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
if ( ( pass ) && ( set_mdci_fapl ) ) {
@@ -1330,7 +1329,7 @@ open_hdf5_file(const hbool_t create_file,
}
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
if ( pass ) {
@@ -1359,19 +1358,19 @@ open_hdf5_file(const hbool_t create_file,
pass = FALSE;
failure_mssg = "mdci sb extension message not present?\n";
}
- }
+ }
} else {
- if ( ( cache_ptr->load_image == TRUE ) ||
+ if ( ( cache_ptr->load_image == TRUE ) ||
( cache_ptr->delete_image == TRUE ) ) {
pass = FALSE;
failure_mssg = "mdci sb extension message present?\n";
- }
+ }
}
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
if ( pass ) {
@@ -1382,11 +1381,11 @@ open_hdf5_file(const hbool_t create_file,
}
if ( show_progress ) {
- HDfprintf(stdout, "%s: cp = %d, pass = %d -- exiting.\n",
+ HDfprintf(stdout, "%s: cp = %d, pass = %d -- exiting.\n",
fcn_name, cp++, pass);
if ( ! pass )
- HDfprintf(stdout, "%s: failure_mssg = %s\n",
+ HDfprintf(stdout, "%s: failure_mssg = %s\n",
fcn_name, failure_mssg);
}
@@ -1394,11 +1393,11 @@ open_hdf5_file(const hbool_t create_file,
} /* open_hdf5_file() */
-
+
/*-------------------------------------------------------------------------
* Function: par_create_dataset()
*
- * Purpose: Collectively create a chunked dataset, and fill it with
+ * Purpose: Collectively create a chunked dataset, and fill it with
* known values.
*
* On failure, set pass to FALSE, and set failure_mssg
@@ -1469,7 +1468,7 @@ par_create_dataset(int dset_num,
}
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
/* set the dataset creation plist to specify that the raw data is
@@ -1487,7 +1486,7 @@ par_create_dataset(int dset_num,
}
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
if ( pass ) {
@@ -1503,7 +1502,7 @@ par_create_dataset(int dset_num,
}
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
/* create the dataset */
@@ -1520,7 +1519,7 @@ par_create_dataset(int dset_num,
}
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
/* get the file space ID */
@@ -1535,7 +1534,7 @@ par_create_dataset(int dset_num,
}
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
/* create the mem space to be used to read and write chunks */
@@ -1553,7 +1552,7 @@ par_create_dataset(int dset_num,
}
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
/* select in memory hyperslab */
@@ -1575,7 +1574,7 @@ par_create_dataset(int dset_num,
}
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
/* setup the DXPL for collective I/O */
@@ -1590,7 +1589,7 @@ par_create_dataset(int dset_num,
}
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
if ( pass ) {
@@ -1602,7 +1601,7 @@ par_create_dataset(int dset_num,
}
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
/* initialize the dataset with collective writes */
@@ -1613,8 +1612,8 @@ par_create_dataset(int dset_num,
while ( ( pass ) && ( j < DSET_SIZE ) )
{
- if ( show_progress )
- HDfprintf(stdout, "%s: cp = %d.0, pass = %d.\n",
+ if ( show_progress )
+ HDfprintf(stdout, "%s: cp = %d.0, pass = %d.\n",
fcn_name, cp, pass);
/* initialize the slab */
@@ -1628,8 +1627,8 @@ par_create_dataset(int dset_num,
}
}
- if ( show_progress )
- HDfprintf(stdout, "%s: cp = %d.1, pass = %d.\n",
+ if ( show_progress )
+ HDfprintf(stdout, "%s: cp = %d.1, pass = %d.\n",
fcn_name, cp, pass);
/* select on disk hyperslab */
@@ -1637,7 +1636,7 @@ par_create_dataset(int dset_num,
offset[1] = (hsize_t)i;
offset[2] = (hsize_t)j;
a_size[0] = (hsize_t)1; /* size of hyperslab */
- a_size[1] = CHUNK_SIZE;
+ a_size[1] = CHUNK_SIZE;
a_size[2] = CHUNK_SIZE;
status = H5Sselect_hyperslab(filespace_id, H5S_SELECT_SET,
offset, NULL, a_size, NULL);
@@ -1648,8 +1647,8 @@ par_create_dataset(int dset_num,
failure_mssg = "disk H5Sselect_hyperslab() failed.";
}
- if ( show_progress )
- HDfprintf(stdout, "%s: cp = %d.2, pass = %d.\n",
+ if ( show_progress )
+ HDfprintf(stdout, "%s: cp = %d.2, pass = %d.\n",
fcn_name, cp, pass);
/* write the chunk to file */
@@ -1662,8 +1661,8 @@ par_create_dataset(int dset_num,
failure_mssg = "H5Dwrite() failed.";
}
- if ( show_progress )
- HDfprintf(stdout, "%s: cp = %d.3, pass = %d.\n",
+ if ( show_progress )
+ HDfprintf(stdout, "%s: cp = %d.3, pass = %d.\n",
fcn_name, cp, pass);
j += CHUNK_SIZE;
@@ -1673,7 +1672,7 @@ par_create_dataset(int dset_num,
}
cp++;
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
/* read data from data sets and validate it */
@@ -1762,7 +1761,7 @@ par_create_dataset(int dset_num,
i += CHUNK_SIZE;
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
/* close the data space */
@@ -1807,14 +1806,14 @@ par_create_dataset(int dset_num,
failure_mssg = "H5Pclose(dxpl) failed.";
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
return;
} /* par_create_dataset() */
-
+
/*-------------------------------------------------------------------------
* Function: par_delete_dataset()
*
@@ -1862,7 +1861,7 @@ par_delete_dataset(int dset_num,
par_verify_dataset(dset_num, file_id, mpi_rank);
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
/* delete the target dataset */
@@ -1875,21 +1874,21 @@ par_delete_dataset(int dset_num,
}
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
return;
} /* par_delete_dataset() */
-
+
/*-------------------------------------------------------------------------
* Function: par_insert_cache_image()
*
* Purpose: Insert a cache image in the supplied file.
*
- * At present, cache image is not enabled in the parallel
- * so we have to insert the cache image with a serial
+ * At present, cache image is not enabled in the parallel
+ * so we have to insert the cache image with a serial
* process. Do this via a fork and an execv from process 0.
* All processes wait until the child process completes, and
* then return.
@@ -1935,22 +1934,22 @@ par_insert_cache_image(int file_name_idx, int mpi_rank, int mpi_size )
/* fun and games to shutup the compiler */
char param0[32] = "t_cache_image";
char param1[32] = "ici";
- char * child_argv[] = {param0,
- param1,
- file_name_idx_str,
- mpi_size_str,
+ char * child_argv[] = {param0,
+ param1,
+ file_name_idx_str,
+ mpi_size_str,
NULL};
/* we may need to play with the path here */
if ( execv("t_cache_image", child_argv) == -1 ) {
- HDfprintf(stdout,
+ HDfprintf(stdout,
"execl() of ici process failed. errno = %d(%s)\n",
errno, strerror(errno));
exit(1);
}
- } else if ( child_pid != -1 ) {
+ } else if ( child_pid != -1 ) {
/* this is the parent process -- wait until child is done */
if ( -1 == waitpid(child_pid, &child_status, WUNTRACED)) {
@@ -1973,7 +1972,7 @@ par_insert_cache_image(int file_name_idx, int mpi_rank, int mpi_size )
}
} else { /* fork failed */
- HDfprintf(stdout,
+ HDfprintf(stdout,
"can't create process to insert cache image.\n");
pass = FALSE;
}
@@ -1982,8 +1981,8 @@ par_insert_cache_image(int file_name_idx, int mpi_rank, int mpi_size )
if ( pass ) {
- /* make sure insertion of the cache image is complete
- * before proceeding
+ /* make sure insertion of the cache image is complete
+ * before proceeding
*/
MPI_Barrier(MPI_COMM_WORLD);
}
@@ -1992,7 +1991,7 @@ par_insert_cache_image(int file_name_idx, int mpi_rank, int mpi_size )
} /* par_insert_cache_image() */
-
+
/*-------------------------------------------------------------------------
* Function: par_verify_dataset()
*
@@ -2072,7 +2071,7 @@ par_verify_dataset(int dset_num,
}
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
/* create the mem space to be used to read */
@@ -2090,7 +2089,7 @@ par_verify_dataset(int dset_num,
}
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
/* select in memory hyperslab */
@@ -2112,7 +2111,7 @@ par_verify_dataset(int dset_num,
}
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
/* setup the DXPL for collective I/O */
@@ -2127,7 +2126,7 @@ par_verify_dataset(int dset_num,
}
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
if ( pass ) {
@@ -2139,7 +2138,7 @@ par_verify_dataset(int dset_num,
}
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
/* read data from data sets and validate it */
@@ -2228,7 +2227,7 @@ par_verify_dataset(int dset_num,
i += CHUNK_SIZE;
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
/* close the file space */
@@ -2259,23 +2258,23 @@ par_verify_dataset(int dset_num,
failure_mssg = "H5Pclose(dxpl) failed.";
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
return;
} /* par_verify_dataset() */
-
+
/*-------------------------------------------------------------------------
* Function: serial_insert_cache_image()
*
* Purpose: Insert a cache image in the supplied file.
*
- * To populate the cache image, validate the contents
- * of the file before closing.
+ * To populate the cache image, validate the contents
+ * of the file before closing.
*
- * On failure, print an appropriate error message and
+ * On failure, print an appropriate error message and
* return FALSE.
*
* Return: TRUE if succussful, FALSE otherwise.
@@ -2329,7 +2328,7 @@ serial_insert_cache_image(int file_name_idx, int mpi_size )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
- /* 2) Open the PHDF5 file with the cache image FAPL entry.
+ /* 2) Open the PHDF5 file with the cache image FAPL entry.
*/
if ( pass ) {
@@ -2388,7 +2387,7 @@ serial_insert_cache_image(int file_name_idx, int mpi_size )
} /* serial_insert_cache_image() */
-
+
/*-------------------------------------------------------------------------
* Function: serial_verify_dataset()
*
@@ -2464,7 +2463,7 @@ serial_verify_dataset(int dset_num,
}
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
/* create the mem space to be used to read */
@@ -2482,7 +2481,7 @@ serial_verify_dataset(int dset_num,
}
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
/* select in memory hyperslab */
@@ -2504,7 +2503,7 @@ serial_verify_dataset(int dset_num,
}
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
@@ -2601,7 +2600,7 @@ serial_verify_dataset(int dset_num,
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
/* close the file space */
@@ -2625,18 +2624,18 @@ serial_verify_dataset(int dset_num,
failure_mssg = "H5Sclose(memspace_id) failed.";
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
return;
} /* serial_verify_dataset() */
-
+
/*-------------------------------------------------------------------------
* Function: parse_flags
*
- * Purpose: Parse the flags passed to this program, and load the
+ * Purpose: Parse the flags passed to this program, and load the
* values into the supplied field.
*
* Return: Success: 1
@@ -2648,7 +2647,7 @@ serial_verify_dataset(int dset_num,
*-------------------------------------------------------------------------
*/
static hbool_t
-parse_flags(int argc, char * argv[], hbool_t * setup_ptr,
+parse_flags(int argc, char * argv[], hbool_t * setup_ptr,
hbool_t * ici_ptr, int * file_idx_ptr, int * mpi_size_ptr, hbool_t display)
{
const char * fcn_name = "parse_flags()";
@@ -2669,7 +2668,7 @@ parse_flags(int argc, char * argv[], hbool_t * setup_ptr,
}
- if ( ( success ) &&
+ if ( ( success ) &&
( ( argc != 1 ) && ( argc != 2 ) && ( argc != 4 ) ) ) {
success = FALSE;
@@ -2716,7 +2715,7 @@ parse_flags(int argc, char * argv[], hbool_t * setup_ptr,
else if ( *ici_ptr )
- HDfprintf(stdout, "t_cache_image ici %d %d\n",
+ HDfprintf(stdout, "t_cache_image ici %d %d\n",
*file_idx_ptr, *mpi_size_ptr);
else
@@ -2728,7 +2727,7 @@ parse_flags(int argc, char * argv[], hbool_t * setup_ptr,
} /* parse_flags() */
-
+
/*-------------------------------------------------------------------------
* Function: usage
*
@@ -2738,7 +2737,7 @@ parse_flags(int argc, char * argv[], hbool_t * setup_ptr,
* Return: void
*
* Programmer: John Mainzer
- * 4/28/11
+ * 4/28/11
*
* Modifications:
*
@@ -2792,17 +2791,17 @@ usage(void)
return;
} /* usage() */
-
+
/*-------------------------------------------------------------------------
* Function: verify_data_sets()
*
- * Purpose: If pass is TRUE on entry, verify that the data sets in the
- * file exist and contain the expected data.
+ * Purpose: If pass is TRUE on entry, verify that the data sets in the
+ * file exist and contain the expected data.
*
- * Note that these data sets were created by
- * create_data_sets() above. Thus any changes in that
- * function must be reflected in this function, and
- * vise-versa.
+ * Note that these data sets were created by
+ * create_data_sets() above. Thus any changes in that
+ * function must be reflected in this function, and
+ * vise-versa.
*
* On failure, set pass to FALSE, and set failure_mssg
* to point to an appropriate failure message.
@@ -2816,15 +2815,15 @@ usage(void)
*
* Modifications:
*
- * Added min_dset and max_dset parameters and supporting
- * code. This allows the caller to specify a range of
- * datasets to verify.
- * JRM -- 8/20/15
+ * Added min_dset and max_dset parameters and supporting
+ * code. This allows the caller to specify a range of
+ * datasets to verify.
+ * JRM -- 8/20/15
*
*-------------------------------------------------------------------------
*/
-static void
+static void
verify_data_sets(hid_t file_id, int min_dset, int max_dset)
{
const char * fcn_name = "verify_data_sets()";
@@ -2952,8 +2951,8 @@ verify_data_sets(hid_t file_id, int min_dset, int max_dset)
/* read the chunk from file */
if ( pass ) {
- status = H5Dread(dataset_ids[m], H5T_NATIVE_INT,
- memspace_id, filespace_ids[m],
+ status = H5Dread(dataset_ids[m], H5T_NATIVE_INT,
+ memspace_id, filespace_ids[m],
H5P_DEFAULT, data_chunk);
if ( status < 0 ) {
@@ -2978,8 +2977,8 @@ verify_data_sets(hid_t file_id, int min_dset, int max_dset)
valid_chunk = FALSE;
- if ( verbose ) {
-
+ if ( verbose ) {
+
HDfprintf(stdout,
"data_chunk[%0d][%0d] = %0d, expect %0d.\n",
k, l, data_chunk[k][l],
@@ -2988,7 +2987,7 @@ verify_data_sets(hid_t file_id, int min_dset, int max_dset)
HDfprintf(stdout,
"m = %d, i = %d, j = %d, k = %d, l = %d\n",
m, i, j, k, l);
- }
+ }
}
}
}
@@ -2998,12 +2997,12 @@ verify_data_sets(hid_t file_id, int min_dset, int max_dset)
pass = FALSE;
failure_mssg = "slab validation failed.";
- if ( verbose ) {
+ if ( verbose ) {
- fprintf(stdout,
+ fprintf(stdout,
"Chunk (%0d, %0d) in /dset%03d is invalid.\n",
i, j, m);
- }
+ }
}
}
m++;
@@ -3054,7 +3053,7 @@ verify_data_sets(hid_t file_id, int min_dset, int max_dset)
} /* verify_data_sets() */
-
+
/****************************************************************************/
/******************************* Test Functions *****************************/
/****************************************************************************/
@@ -3062,21 +3061,21 @@ verify_data_sets(hid_t file_id, int min_dset, int max_dset)
/*-------------------------------------------------------------------------
* Function: verify_cache_image_RO()
*
- * Purpose: Verify that a HDF5 file containing a cache image is
- * opened R/O and read correctly by PHDF5 with the specified
+ * Purpose: Verify that a HDF5 file containing a cache image is
+ * opened R/O and read correctly by PHDF5 with the specified
* metadata write strategy.
- *
+ *
* Basic cycle of operation is as follows:
*
- * 1) Open the test file created at the beginning of this
- * test read only.
+ * 1) Open the test file created at the beginning of this
+ * test read only.
*
- * Verify that the file contains a cache image.
+ * Verify that the file contains a cache image.
*
- * Verify that only process 0 reads the cache image.
+ * Verify that only process 0 reads the cache image.
*
- * Verify that all other processes receive the cache
- * image block from process 0.
+ * Verify that all other processes receive the cache
+ * image block from process 0.
*
* 2) Verify that the file contains the expected data.
*
@@ -3096,7 +3095,7 @@ verify_data_sets(hid_t file_id, int min_dset, int max_dset)
*
* Modifications:
*
- * None.
+ * None.
*
*-------------------------------------------------------------------------
*/
@@ -3135,14 +3134,14 @@ verify_cache_image_RO(int file_name_id, int md_write_strat, int mpi_rank)
show_progress = ( ( show_progress ) && ( mpi_rank == 0 ) );
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
/* setup the file name */
if ( pass ) {
- if ( h5_fixname(FILENAMES[file_name_id], H5P_DEFAULT,
+ if ( h5_fixname(FILENAMES[file_name_id], H5P_DEFAULT,
filename, sizeof(filename)) == NULL ) {
pass = FALSE;
@@ -3150,7 +3149,7 @@ verify_cache_image_RO(int file_name_id, int md_write_strat, int mpi_rank)
}
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
@@ -3165,7 +3164,7 @@ verify_cache_image_RO(int file_name_id, int md_write_strat, int mpi_rank)
/* mdci_sbem_expected */ TRUE,
/* read_only */ TRUE,
/* set_mdci_fapl */ FALSE,
- /* config_fsm */ FALSE,
+ /* config_fsm */ FALSE,
/* enable_page_buffer */ FALSE,
/* hdf_file_name */ filename,
/* cache_image_flags */ H5C_CI__ALL_FLAGS,
@@ -3180,15 +3179,15 @@ verify_cache_image_RO(int file_name_id, int md_write_strat, int mpi_rank)
/* md_write_strat */ md_write_strat);
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
- /* 2) Verify that the file contains the expected data.
+ /* 2) Verify that the file contains the expected data.
*
* Verify that only process 0 reads the cache image.
*
- * Verify that all other processes receive the cache
+ * Verify that all other processes receive the cache
* image block from process 0.
*/
@@ -3210,14 +3209,14 @@ verify_cache_image_RO(int file_name_id, int md_write_strat, int mpi_rank)
}
#endif /* H5C_COLLECT_CACHE_STATS */
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
- /* Verify that all other processes receive the cache image block
+ /* Verify that all other processes receive the cache image block
* from process 0.
- *
- * Since we have alread verified that only process 0 has read the
- * image, it is sufficient to verify that the image was loaded on
+ *
+ * Since we have alread verified that only process 0 has read the
+ * image, it is sufficient to verify that the image was loaded on
* all processes.
*/
#if H5C_COLLECT_CACHE_STATS
@@ -3231,12 +3230,12 @@ verify_cache_image_RO(int file_name_id, int md_write_strat, int mpi_rank)
}
#endif /* H5C_COLLECT_CACHE_STATS */
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
/* 3) Close the file. */
-
+
if ( pass ) {
if ( H5Fclose(file_id) < 0 ) {
@@ -3247,7 +3246,7 @@ verify_cache_image_RO(int file_name_id, int md_write_strat, int mpi_rank)
}
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
@@ -3259,7 +3258,7 @@ verify_cache_image_RO(int file_name_id, int md_write_strat, int mpi_rank)
/* mdci_sbem_expected */ TRUE,
/* read_only */ TRUE,
/* set_mdci_fapl */ FALSE,
- /* config_fsm */ FALSE,
+ /* config_fsm */ FALSE,
/* enable_page_buffer */ FALSE,
/* hdf_file_name */ filename,
/* cache_image_flags */ H5C_CI__ALL_FLAGS,
@@ -3274,12 +3273,12 @@ verify_cache_image_RO(int file_name_id, int md_write_strat, int mpi_rank)
/* md_write_strat */ md_write_strat);
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
/* 5) Verify that the file contains the expected data. */
-
+
if ( pass ) {
verify_data_sets(file_id, 0, MAX_NUM_DSETS - 1);
@@ -3298,7 +3297,7 @@ verify_cache_image_RO(int file_name_id, int md_write_strat, int mpi_rank)
/* 6) Close the file. */
-
+
if ( pass ) {
if ( H5Fclose(file_id) < 0 ) {
@@ -3309,7 +3308,7 @@ verify_cache_image_RO(int file_name_id, int md_write_strat, int mpi_rank)
}
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
@@ -3324,7 +3323,7 @@ verify_cache_image_RO(int file_name_id, int md_write_strat, int mpi_rank)
H5_FAILED();
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: failure_mssg = \"%s\"\n", failure_mssg);
}
}
@@ -3334,32 +3333,32 @@ verify_cache_image_RO(int file_name_id, int md_write_strat, int mpi_rank)
} /* verify_cache_image_RO() */
-
+
/*-------------------------------------------------------------------------
* Function: verify_cache_image_RW()
*
- * Purpose: Verify that a HDF5 file containing a cache image is
- * opened and read correctly by PHDF5 with the specified
+ * Purpose: Verify that a HDF5 file containing a cache image is
+ * opened and read correctly by PHDF5 with the specified
* metadata write strategy.
- *
+ *
* Basic cycle of operation is as follows:
*
- * 1) Open the test file created at the beginning of this
- * test.
+ * 1) Open the test file created at the beginning of this
+ * test.
*
- * Verify that the file contains a cache image.
+ * Verify that the file contains a cache image.
*
* 2) Verify that the file contains the expected data.
*
- * Verify that only process 0 reads the cache image.
+ * Verify that only process 0 reads the cache image.
*
- * Verify that all other processes receive the cache
- * image block from process 0.
+ * Verify that all other processes receive the cache
+ * image block from process 0.
*
*
* 3) Close the file.
*
- * 4) Open the file, and verify that it doesn't contain
+ * 4) Open the file, and verify that it doesn't contain
* a cache image.
*
* 5) Verify that the file contains the expected data.
@@ -3375,7 +3374,7 @@ verify_cache_image_RO(int file_name_id, int md_write_strat, int mpi_rank)
*
* Modifications:
*
- * None.
+ * None.
*
*-------------------------------------------------------------------------
*/
@@ -3414,14 +3413,14 @@ verify_cache_image_RW(int file_name_id, int md_write_strat, int mpi_rank)
show_progress = ( ( show_progress ) && ( mpi_rank == 0 ) );
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
/* setup the file name */
if ( pass ) {
- if ( h5_fixname(FILENAMES[file_name_id], H5P_DEFAULT,
+ if ( h5_fixname(FILENAMES[file_name_id], H5P_DEFAULT,
filename, sizeof(filename)) == NULL ) {
pass = FALSE;
@@ -3429,7 +3428,7 @@ verify_cache_image_RW(int file_name_id, int md_write_strat, int mpi_rank)
}
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
@@ -3439,7 +3438,7 @@ verify_cache_image_RW(int file_name_id, int md_write_strat, int mpi_rank)
*
* Verify that only process 0 reads the cache image.
*
- * Verify that all other processes receive the cache
+ * Verify that all other processes receive the cache
* image block from process 0.
*/
@@ -3449,7 +3448,7 @@ verify_cache_image_RW(int file_name_id, int md_write_strat, int mpi_rank)
/* mdci_sbem_expected */ TRUE,
/* read_only */ FALSE,
/* set_mdci_fapl */ FALSE,
- /* config_fsm */ FALSE,
+ /* config_fsm */ FALSE,
/* enable_page_buffer */ FALSE,
/* hdf_file_name */ filename,
/* cache_image_flags */ H5C_CI__ALL_FLAGS,
@@ -3464,7 +3463,7 @@ verify_cache_image_RW(int file_name_id, int md_write_strat, int mpi_rank)
/* md_write_strat */ md_write_strat);
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
@@ -3472,7 +3471,7 @@ verify_cache_image_RW(int file_name_id, int md_write_strat, int mpi_rank)
*
* Verify that only process 0 reads the cache image.
*
- * Verify that all other processes receive the cache
+ * Verify that all other processes receive the cache
* image block from process 0.
*/
if ( pass ) {
@@ -3493,14 +3492,14 @@ verify_cache_image_RW(int file_name_id, int md_write_strat, int mpi_rank)
}
#endif /* H5C_COLLECT_CACHE_STATS */
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
- /* Verify that all other processes receive the cache image block
+ /* Verify that all other processes receive the cache image block
* from process 0.
- *
- * Since we have alread verified that only process 0 has read the
- * image, it is sufficient to verify that the image was loaded on
+ *
+ * Since we have alread verified that only process 0 has read the
+ * image, it is sufficient to verify that the image was loaded on
* all processes.
*/
#if H5C_COLLECT_CACHE_STATS
@@ -3514,12 +3513,12 @@ verify_cache_image_RW(int file_name_id, int md_write_strat, int mpi_rank)
}
#endif /* H5C_COLLECT_CACHE_STATS */
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
/* 3) Close the file. */
-
+
if ( pass ) {
if ( H5Fclose(file_id) < 0 ) {
@@ -3530,7 +3529,7 @@ verify_cache_image_RW(int file_name_id, int md_write_strat, int mpi_rank)
}
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
@@ -3542,7 +3541,7 @@ verify_cache_image_RW(int file_name_id, int md_write_strat, int mpi_rank)
/* mdci_sbem_expected */ FALSE,
/* read_only */ FALSE,
/* set_mdci_fapl */ FALSE,
- /* config_fsm */ FALSE,
+ /* config_fsm */ FALSE,
/* enable_page_buffer */ FALSE,
/* hdf_file_name */ filename,
/* cache_image_flags */ H5C_CI__ALL_FLAGS,
@@ -3557,12 +3556,12 @@ verify_cache_image_RW(int file_name_id, int md_write_strat, int mpi_rank)
/* md_write_strat */ md_write_strat);
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
/* 5) Verify that the file contains the expected data. */
-
+
if ( pass ) {
verify_data_sets(file_id, 0, MAX_NUM_DSETS - 1);
@@ -3581,7 +3580,7 @@ verify_cache_image_RW(int file_name_id, int md_write_strat, int mpi_rank)
/* 6) Close the file. */
-
+
if ( pass ) {
if ( H5Fclose(file_id) < 0 ) {
@@ -3592,7 +3591,7 @@ verify_cache_image_RW(int file_name_id, int md_write_strat, int mpi_rank)
}
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
@@ -3622,7 +3621,7 @@ verify_cache_image_RW(int file_name_id, int md_write_strat, int mpi_rank)
H5_FAILED();
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: failure_mssg = \"%s\"\n", failure_mssg);
}
}
@@ -3632,20 +3631,20 @@ verify_cache_image_RW(int file_name_id, int md_write_strat, int mpi_rank)
} /* verify_cache_imageRW() */
-
+
/*****************************************************************************
*
* Function: smoke_check_1()
*
- * Purpose: Initial smoke check to verify correct behaviour of cache
+ * Purpose: Initial smoke check to verify correct behaviour of cache
* image in combination with parallel.
- *
+ *
* As cache image is currently disabled in the parallel case,
* we construct a test file in parallel, verify it in serial
* and generate a cache image in passing, and then verify
* it again in parallel.
*
- * In passing, also verify that page buffering is silently
+ * In passing, also verify that page buffering is silently
* disabled in the parallel case. Needless to say, this part
* of the test will have to be re-worked when and if page
* buffering is supported in parallel.
@@ -3700,7 +3699,7 @@ smoke_check_1(MPI_Comm mpi_comm, MPI_Info mpi_info, int mpi_rank, int mpi_size)
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
- /* 1) Create a PHDF5 file without the cache image FAPL entry.
+ /* 1) Create a PHDF5 file without the cache image FAPL entry.
*
* Verify that a cache image is not requested
*/
@@ -3807,11 +3806,11 @@ smoke_check_1(MPI_Comm mpi_comm, MPI_Info mpi_info, int mpi_rank, int mpi_size)
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
- /* 7) Verify the datasets in the file backwards
+ /* 7) Verify the datasets in the file backwards
*
* Verify that only process 0 reads the cache image.
*
- * Verify that all other processes receive the cache
+ * Verify that all other processes receive the cache
* image block from process 0.
*/
@@ -3841,11 +3840,11 @@ smoke_check_1(MPI_Comm mpi_comm, MPI_Info mpi_info, int mpi_rank, int mpi_size)
if ( ( mpi_rank == 0 ) && ( show_progress ) )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
- /* Verify that all other processes receive the cache image block
+ /* Verify that all other processes receive the cache image block
* from process 0.
- *
- * Since we have alread verified that only process 0 has read the
- * image, it is sufficient to verify that the image was loaded on
+ *
+ * Since we have alread verified that only process 0 has read the
+ * image, it is sufficient to verify that the image was loaded on
* all processes.
*/
#if H5C_COLLECT_CACHE_STATS
@@ -3906,11 +3905,11 @@ smoke_check_1(MPI_Comm mpi_comm, MPI_Info mpi_info, int mpi_rank, int mpi_size)
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
- /* 10) Verify the datasets in the file
+ /* 10) Verify the datasets in the file
*
* Verify that only process 0 reads the cache image.
*
- * Verify that all other processes receive the cache
+ * Verify that all other processes receive the cache
* image block from process 0.
*/
@@ -3940,11 +3939,11 @@ smoke_check_1(MPI_Comm mpi_comm, MPI_Info mpi_info, int mpi_rank, int mpi_size)
if ( ( mpi_rank == 0 ) && ( show_progress ) )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
- /* Verify that all other processes receive the cache image block
+ /* Verify that all other processes receive the cache image block
* from process 0.
- *
- * Since we have alread verified that only process 0 has read the
- * image, it is sufficient to verify that the image was loaded on
+ *
+ * Since we have alread verified that only process 0 has read the
+ * image, it is sufficient to verify that the image was loaded on
* all processes.
*/
#if H5C_COLLECT_CACHE_STATS
@@ -4047,28 +4046,28 @@ smoke_check_1(MPI_Comm mpi_comm, MPI_Info mpi_info, int mpi_rank, int mpi_size)
H5_FAILED();
- HDfprintf(stdout, "%s: failure_mssg = \"%s\"\n",
+ HDfprintf(stdout, "%s: failure_mssg = \"%s\"\n",
fcn_name, failure_mssg);
}
}
return !pass;
-
+
} /* smoke_check_1() */
-
+
/*-------------------------------------------------------------------------
* Function: main
*
* Purpose: Run parallel tests on the cache image feature.
- *
- * At present, cache image is disabled in parallel, and
- * thus these tests are restructed to verifying that a
+ *
+ * At present, cache image is disabled in parallel, and
+ * thus these tests are restructed to verifying that a
* file with a cache image can be opened in the parallel
- * case, and verifying that instructions to create a
+ * case, and verifying that instructions to create a
* cache image are ignored in the parallel case.
*
- * WARNING: This test uses fork() and execve(), and
+ * WARNING: This test uses fork() and execve(), and
* therefore will not run on Windows.
*
* Return: Success: 0
@@ -4106,14 +4105,14 @@ main(int argc, char **argv)
HDfflush(stdout);
i = 0;
- while ( ( FILENAMES[i] != NULL ) && ( i < TEST_FILES_TO_CONSTRUCT ) ) {
+ while ( ( FILENAMES[i] != NULL ) && ( i < TEST_FILES_TO_CONSTRUCT ) ) {
HDfprintf(stdout, " writing %s ... ", FILENAMES[i]);
HDfflush(stdout);
construct_test_file(i);
if ( pass ) {
-
+
printf("done.\n");
HDfflush(stdout);
@@ -4194,13 +4193,13 @@ main(int argc, char **argv)
/* we may need to play with the path here */
if ( execv("t_cache_image", child_argv) == -1 ) {
- HDfprintf(stdout,
+ HDfprintf(stdout,
"execl() of setup process failed. errno = %d(%s)\n",
errno, strerror(errno));
exit(1);
}
- } else if ( child_pid != -1 ) {
+ } else if ( child_pid != -1 ) {
/* this is the parent process -- wait until child is done */
if ( -1 == waitpid(child_pid, &child_status, WUNTRACED)) {
@@ -4216,7 +4215,7 @@ main(int argc, char **argv)
} else {
- HDfprintf(stdout,
+ HDfprintf(stdout,
"testfile construction complete -- proceeding with tests.\n");
}
} else { /* fork failed */
@@ -4229,14 +4228,14 @@ main(int argc, char **argv)
MPI_Barrier(MPI_COMM_WORLD);
- nerrs += verify_cache_image_RO(0,
+ nerrs += verify_cache_image_RO(0,
H5AC_METADATA_WRITE_STRATEGY__PROCESS_0_ONLY, mpi_rank);
#if 1
- nerrs += verify_cache_image_RO(1,
+ nerrs += verify_cache_image_RO(1,
H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED, mpi_rank);
- nerrs += verify_cache_image_RW(0,
+ nerrs += verify_cache_image_RW(0,
H5AC_METADATA_WRITE_STRATEGY__PROCESS_0_ONLY, mpi_rank);
- nerrs += verify_cache_image_RW(1,
+ nerrs += verify_cache_image_RW(1,
H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED, mpi_rank);
nerrs += smoke_check_1(comm, info, mpi_rank, mpi_size);
#endif
diff --git a/testpar/t_pflush1.c b/testpar/t_pflush1.c
index 0782f3d..4677bfe 100644
--- a/testpar/t_pflush1.c
+++ b/testpar/t_pflush1.c
@@ -15,13 +15,12 @@
* Programmer: Leon Arber <larber@uiuc.edu>
* Sept. 28, 2006.
*
- * Purpose: This is the first half of a two-part test that makes sure
- * that a file can be read after a parallel application crashes as long
- * as the file was flushed first. We simulate a crash by
- * calling _exit(0) since this doesn't flush HDF5 caches but
- * still exits with success.
+ * Purpose: This is the first half of a two-part test that makes sure
+ * that a file can be read after a parallel application crashes as long
+ * as the file was flushed first. We simulate a crash by
+ * calling _exit(0) since this doesn't flush HDF5 caches but
+ * still exits with success.
*/
-#include <mpi.h>
#include "h5test.h"
const char *FILENAME[] = {
@@ -30,18 +29,18 @@ const char *FILENAME[] = {
NULL
};
-static double the_data[100][100];
+static double the_data[100][100];
/*-------------------------------------------------------------------------
- * Function: create_file
+ * Function: create_file
*
- * Purpose: Creates file used in part 1 of the test
+ * Purpose: Creates file used in part 1 of the test
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: 1
+ * Failure: 1
*
- * Programmer: Leon Arber
+ * Programmer: Leon Arber
* Sept. 26, 2006
*
* Modifications:
@@ -51,10 +50,10 @@ static double the_data[100][100];
static hid_t
create_file(char* name, hid_t fapl)
{
- hid_t file, dcpl, space, dset, groups, grp, plist;
- hsize_t ds_size[2] = {100, 100};
- hsize_t ch_size[2] = {5, 5};
- hsize_t i, j;
+ hid_t file, dcpl, space, dset, groups, grp, plist;
+ hsize_t ds_size[2] = {100, 100};
+ hsize_t ch_size[2] = {5, 5};
+ hsize_t i, j;
@@ -65,7 +64,7 @@ create_file(char* name, hid_t fapl)
if(H5Pset_chunk(dcpl, 2, ch_size) < 0) goto error;
if((space = H5Screate_simple(2, ds_size, NULL)) < 0) goto error;
if((dset = H5Dcreate2(file, "dset", H5T_NATIVE_FLOAT, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
- goto error;
+ goto error;
plist = H5Pcreate(H5P_DATASET_XFER);
H5Pset_dxpl_mpio(plist, H5FD_MPIO_COLLECTIVE);
@@ -73,22 +72,22 @@ create_file(char* name, hid_t fapl)
/* Write some data */
for(i = 0; i < ds_size[0]; i++) {
- /*
- * The extra cast in the following statement is a bug workaround
- * for the Win32 version 5.0 compiler.
- * 1998-11-06 ptl
- */
- for(j = 0; j < ds_size[1]; j++)
- the_data[i][j] = (double)(hssize_t)i/(hssize_t)(j+1);
+ /*
+ * The extra cast in the following statement is a bug workaround
+ * for the Win32 version 5.0 compiler.
+ * 1998-11-06 ptl
+ */
+ for(j = 0; j < ds_size[1]; j++)
+ the_data[i][j] = (double)(hssize_t)i/(hssize_t)(j+1);
}
if(H5Dwrite(dset, H5T_NATIVE_DOUBLE, space, space, plist, the_data) < 0) goto error;
/* Create some groups */
if((groups = H5Gcreate2(file, "some_groups", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto error;
for(i = 0; i < 100; i++) {
- sprintf(name, "grp%02u", (unsigned)i);
- if((grp = H5Gcreate2(groups, name, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto error;
- if(H5Gclose(grp) < 0) goto error;
+ sprintf(name, "grp%02u", (unsigned)i);
+ if((grp = H5Gcreate2(groups, name, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto error;
+ if(H5Gclose(grp) < 0) goto error;
}
return file;
@@ -98,20 +97,20 @@ error:
}
/*-------------------------------------------------------------------------
- * Function: main
+ * Function: main
*
- * Purpose: Part 1 of a two-part H5Fflush() test.
+ * Purpose: Part 1 of a two-part H5Fflush() test.
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: 1
+ * Failure: 1
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Friday, October 23, 1998
*
* Modifications:
- * Leon Arber
- * Sept. 26, 2006, expand test to check for failure if H5Fflush is not called.
+ * Leon Arber
+ * Sept. 26, 2006, expand test to check for failure if H5Fflush is not called.
*
*
*-------------------------------------------------------------------------
@@ -120,8 +119,8 @@ int
main(int argc, char* argv[])
{
hid_t file1, file2, fapl;
- MPI_File *mpifh_p = NULL;
- char name[1024];
+ MPI_File *mpifh_p = NULL;
+ char name[1024];
const char *envval = NULL;
int mpi_size, mpi_rank;
MPI_Comm comm = MPI_COMM_WORLD;
@@ -135,26 +134,26 @@ main(int argc, char* argv[])
H5Pset_fapl_mpio(fapl, comm, info);
if(mpi_rank == 0)
- TESTING("H5Fflush (part1)");
+ TESTING("H5Fflush (part1)");
envval = HDgetenv("HDF5_DRIVER");
if(envval == NULL)
envval = "nomatch";
if(HDstrcmp(envval, "split")) {
- /* Create the file */
- h5_fixname(FILENAME[0], fapl, name, sizeof name);
- file1 = create_file(name, fapl);
- /* Flush and exit without closing the library */
- if(H5Fflush(file1, H5F_SCOPE_GLOBAL) < 0) goto error;
+ /* Create the file */
+ h5_fixname(FILENAME[0], fapl, name, sizeof name);
+ file1 = create_file(name, fapl);
+ /* Flush and exit without closing the library */
+ if(H5Fflush(file1, H5F_SCOPE_GLOBAL) < 0) goto error;
- /* Create the other file which will not be flushed */
- h5_fixname(FILENAME[1], fapl, name, sizeof name);
- file2 = create_file(name, fapl);
+ /* Create the other file which will not be flushed */
+ h5_fixname(FILENAME[1], fapl, name, sizeof name);
+ file2 = create_file(name, fapl);
- if(mpi_rank == 0)
- PASSED();
- fflush(stdout);
- fflush(stderr);
+ if(mpi_rank == 0)
+ PASSED();
+ fflush(stdout);
+ fflush(stderr);
} /* end if */
else {
SKIPPED();
@@ -171,21 +170,21 @@ main(int argc, char* argv[])
/* close file1 */
if(H5Fget_vfd_handle(file1, fapl, (void **)&mpifh_p) < 0) {
- printf("H5Fget_vfd_handle for file1 failed\n");
- goto error;
+ printf("H5Fget_vfd_handle for file1 failed\n");
+ goto error;
} /* end if */
if(MPI_File_close(mpifh_p) != MPI_SUCCESS) {
- printf("MPI_File_close for file1 failed\n");
- goto error;
+ printf("MPI_File_close for file1 failed\n");
+ goto error;
} /* end if */
/* close file2 */
if(H5Fget_vfd_handle(file2, fapl, (void **)&mpifh_p) < 0) {
- printf("H5Fget_vfd_handle for file2 failed\n");
- goto error;
+ printf("H5Fget_vfd_handle for file2 failed\n");
+ goto error;
} /* end if */
if(MPI_File_close(mpifh_p) != MPI_SUCCESS) {
- printf("MPI_File_close for file2 failed\n");
- goto error;
+ printf("MPI_File_close for file2 failed\n");
+ goto error;
} /* end if */
fflush(stdout);
diff --git a/testpar/t_pread.c b/testpar/t_pread.c
index a527503..aac5bee 100644
--- a/testpar/t_pread.c
+++ b/testpar/t_pread.c
@@ -16,7 +16,6 @@
*
*/
-#include "h5test.h"
#include "testpar.h"
/* The collection of files is included below to aid
@@ -42,7 +41,7 @@ const char *FILENAMES[NFILENAME + 1]={"t_pread_data_file",
#define COUNT 1000
hbool_t pass = true;
-static const char *random_hdf5_text =
+static const char *random_hdf5_text =
"Now is the time for all first-time-users of HDF5 to read their \
manual or go thru the tutorials!\n\
While you\'re at it, now is also the time to read up on MPI-IO.";
@@ -58,7 +57,7 @@ static int test_parallel_read(MPI_Comm comm, int mpi_rank, int group);
static char *test_argv0 = NULL;
extern char *dirname(char *path); /* Avoids additional includes */
-
+
/*-------------------------------------------------------------------------
* Function: generate_test_file
*
@@ -79,7 +78,7 @@ extern char *dirname(char *path); /* Avoids additional includes */
* In the overall scheme of running the test, we'll call
* this function twice: first as a collection of all MPI
* processes and then a second time with the processes split
- * more or less in half. Each sub group will operate
+ * more or less in half. Each sub group will operate
* collectively on their assigned file. This split into
* subgroups validates that parallel groups can successfully
* open and read data independantly from the other parallel
@@ -93,7 +92,7 @@ extern char *dirname(char *path); /* Avoids additional includes */
* 10/1/17
*
* Modifications:
- *
+ *
*-------------------------------------------------------------------------
*/
static int
@@ -110,14 +109,14 @@ generate_test_file( MPI_Comm comm, int mpi_rank, int group_id )
int group_size;
int group_rank;
int local_failure = 0;
- int global_failures = 0;
+ int global_failures = 0;
hsize_t count = COUNT;
hsize_t i;
hsize_t offset;
hsize_t dims[1] = {0};
hid_t file_id = -1;
- hid_t memspace = -1;
- hid_t filespace = -1;
+ hid_t memspace = -1;
+ hid_t filespace = -1;
hid_t fapl_id = -1;
hid_t dxpl_id = -1;
hid_t dset_id = -1;
@@ -153,7 +152,7 @@ generate_test_file( MPI_Comm comm, int mpi_rank, int group_id )
if ( pass ) {
if ( comm == MPI_COMM_WORLD ) { /* Test 1 */
file_index = 0;
- }
+ }
else if ( group_id == 0 ) { /* Test 2 group 0 */
file_index = 3;
}
@@ -161,8 +160,8 @@ generate_test_file( MPI_Comm comm, int mpi_rank, int group_id )
file_index = 6;
}
- /* The 'group_filename' is just a temp variable and
- * is used to call into the h5_fixname function. No
+ /* The 'group_filename' is just a temp variable and
+ * is used to call into the h5_fixname function. No
* need to worry that we reassign it for each file!
*/
group_filename = FILENAMES[file_index];
@@ -234,9 +233,9 @@ generate_test_file( MPI_Comm comm, int mpi_rank, int group_id )
}
}
- /* create the data file */
+ /* create the data file */
if ( pass ) {
- if ( (file_id = H5Fcreate(data_filename, H5F_ACC_TRUNC,
+ if ( (file_id = H5Fcreate(data_filename, H5F_ACC_TRUNC,
H5P_DEFAULT, fapl_id)) < 0 ) {
pass = FALSE;
failure_mssg = "H5Fcreate() failed.\n";
@@ -276,7 +275,7 @@ generate_test_file( MPI_Comm comm, int mpi_rank, int group_id )
if ( pass ) {
offset = (hsize_t)group_rank * (hsize_t)COUNT;
- if ( (H5Sselect_hyperslab(filespace, H5S_SELECT_SET, &offset,
+ if ( (H5Sselect_hyperslab(filespace, H5S_SELECT_SET, &offset,
NULL, &count, NULL)) < 0 ) {
pass = FALSE;
failure_mssg = "H5Sselect_hyperslab() failed.\n";
@@ -284,8 +283,8 @@ generate_test_file( MPI_Comm comm, int mpi_rank, int group_id )
}
if ( pass ) {
- if ( (dset_id = H5Dcreate2(file_id, "dataset0", H5T_NATIVE_FLOAT,
- filespace, H5P_DEFAULT, H5P_DEFAULT,
+ if ( (dset_id = H5Dcreate2(file_id, "dataset0", H5T_NATIVE_FLOAT,
+ filespace, H5P_DEFAULT, H5P_DEFAULT,
H5P_DEFAULT)) < 0 ) {
pass = false;
failure_mssg = "H5Dcreate2() failed.\n";
@@ -293,7 +292,7 @@ generate_test_file( MPI_Comm comm, int mpi_rank, int group_id )
}
if ( pass ) {
- if ( (H5Dwrite(dset_id, H5T_NATIVE_FLOAT, memspace,
+ if ( (H5Dwrite(dset_id, H5T_NATIVE_FLOAT, memspace,
filespace, dxpl_id, data_slice)) < 0 ) {
pass = false;
failure_mssg = "H5Dwrite() failed.\n";
@@ -344,15 +343,15 @@ generate_test_file( MPI_Comm comm, int mpi_rank, int group_id )
}
/* Add a userblock to the head of the datafile.
- * We will use this to for a functional test of the
+ * We will use this to for a functional test of the
* file open optimization. This is superblock
* relocation is done by the rank 0 process associated
* with the communicator being used. For test 1, we
* utilize MPI_COMM_WORLD, so group_rank 0 is the
* same as mpi_rank 0. For test 2 which utilizes
* two groups resulting from an MPI_Comm_split, we
- * will have parallel groups and hence two
- * group_rank(0) processes. Each parallel group
+ * will have parallel groups and hence two
+ * group_rank(0) processes. Each parallel group
* will create a unique file with different text
* headers and different data.
*
@@ -361,7 +360,7 @@ generate_test_file( MPI_Comm comm, int mpi_rank, int group_id )
if ( group_rank == 0 ) {
const char *text_to_write;
- size_t bytes_to_write;
+ size_t bytes_to_write;
if (group_id == 0)
text_to_write = random_hdf5_text;
@@ -406,7 +405,7 @@ generate_test_file( MPI_Comm comm, int mpi_rank, int group_id )
* if h5jam is co-located here. Otherwise, the autotools
* put things into directories, hence the relative path.
*/
- if (test_argv0 != NULL) {
+ if (test_argv0 != NULL) {
HDstrncpy(exe_path, test_argv0, sizeof(exe_path));
if ( (exe_dirname = (char *)dirname(exe_path)) != NULL) {
HDsprintf(cmd, "%s/h5jam", exe_dirname);
@@ -430,13 +429,13 @@ generate_test_file( MPI_Comm comm, int mpi_rank, int group_id )
}
/* collect results from other processes.
- * Only overwrite the failure message if no preveious error
+ * Only overwrite the failure message if no preveious error
* has been detected
*/
local_failure = ( pass ? 0 : 1 );
/* This is a global all reduce (NOT group specific) */
- if ( MPI_Allreduce(&local_failure, &global_failures, 1,
+ if ( MPI_Allreduce(&local_failure, &global_failures, 1,
MPI_INT, MPI_SUM, MPI_COMM_WORLD) != MPI_SUCCESS ) {
if ( pass ) {
pass = FALSE;
@@ -468,7 +467,7 @@ generate_test_file( MPI_Comm comm, int mpi_rank, int group_id )
} /* generate_test_file() */
-
+
/*-------------------------------------------------------------------------
* Function: test_parallel_read
*
@@ -511,7 +510,7 @@ test_parallel_read(MPI_Comm comm, int mpi_rank, int group_id)
const char *group_filename = NULL;
char reloc_data_filename[FILENAME_BUF_SIZE];
int local_failure = 0;
- int global_failures = 0;
+ int global_failures = 0;
int group_size;
int group_rank;
hid_t fapl_id = -1;
@@ -597,7 +596,7 @@ test_parallel_read(MPI_Comm comm, int mpi_rank, int group_id)
/* open the file -- should have user block, exercising the optimization */
if ( pass ) {
- if ( (file_id = H5Fopen(reloc_data_filename,
+ if ( (file_id = H5Fopen(reloc_data_filename,
H5F_ACC_RDONLY, fapl_id)) < 0 ) {
pass = FALSE;
failure_mssg = "H5Fopen() failed\n";
@@ -631,7 +630,7 @@ test_parallel_read(MPI_Comm comm, int mpi_rank, int group_id)
if ( pass ) {
offset = (hsize_t)group_rank * count;
- if ( (H5Sselect_hyperslab(filespace, H5S_SELECT_SET,
+ if ( (H5Sselect_hyperslab(filespace, H5S_SELECT_SET,
&offset, NULL, &count, NULL)) < 0 ) {
pass = FALSE;
failure_mssg = "H5Sselect_hyperslab() failed\n";
@@ -640,14 +639,14 @@ test_parallel_read(MPI_Comm comm, int mpi_rank, int group_id)
/* read this processes section of the data */
if ( pass ) {
- if ( (H5Dread(dset_id, H5T_NATIVE_FLOAT, memspace,
+ if ( (H5Dread(dset_id, H5T_NATIVE_FLOAT, memspace,
filespace, H5P_DEFAULT, data_slice)) < 0 ) {
pass = FALSE;
failure_mssg = "H5Dread() failed\n";
}
}
-
- /* verify the data */
+
+ /* verify the data */
if ( pass ) {
nextValue = (float)((hsize_t)mpi_rank * count);
i = 0;
@@ -708,7 +707,7 @@ test_parallel_read(MPI_Comm comm, int mpi_rank, int group_id)
*/
local_failure = ( pass ? 0 : 1 );
- if ( MPI_Allreduce( &local_failure, &global_failures, 1,
+ if ( MPI_Allreduce( &local_failure, &global_failures, 1,
MPI_INT, MPI_SUM, MPI_COMM_WORLD) != MPI_SUCCESS ) {
if ( pass ) {
pass = FALSE;
@@ -739,11 +738,11 @@ test_parallel_read(MPI_Comm comm, int mpi_rank, int group_id)
}
- return( ! pass );
+ return( ! pass );
} /* test_parallel_read() */
-
+
/*-------------------------------------------------------------------------
* Function: main
*
@@ -830,7 +829,7 @@ main( int argc, char **argv)
/* ------ Create two (2) MPI groups ------
*
- * We split MPI_COMM_WORLD into 2 more or less equal sized
+ * We split MPI_COMM_WORLD into 2 more or less equal sized
* groups. The resulting communicators will be used to generate
* two HDF files which in turn will be opened in parallel and the
* contents verified in the second read test below.
@@ -858,7 +857,7 @@ main( int argc, char **argv)
}
goto finish;
}
-
+
/* We generate the file used for test 2 */
nerrs += generate_test_file( group_comm, mpi_rank, which_group );
@@ -917,7 +916,7 @@ finish:
HDfprintf(stdout, "===================================\n");
if ( nerrs > 0 ) {
-
+
HDfprintf(stdout, "***%s detected %d failures***\n", header, nerrs);
}
else {
diff --git a/testpar/t_shapesame.c b/testpar/t_shapesame.c
index 1052a69..e695bfc 100644
--- a/testpar/t_shapesame.c
+++ b/testpar/t_shapesame.c
@@ -12,7 +12,7 @@
/*
This program will test independant and collective reads and writes between
- selections of different rank that non-the-less are deemed as having the
+ selections of different rank that non-the-less are deemed as having the
same shape by H5Sselect_shape_same().
*/
@@ -22,8 +22,6 @@
#define H5S_TESTING
-#include "hdf5.h"
-#include "H5private.h"
#include "testphdf5.h"
#include "H5Spkg.h" /* Dataspaces */
@@ -31,24 +29,24 @@
/* On Lustre (and perhaps other parallel file systems?), we have severe
* slow downs if two or more processes attempt to access the same file system
* block. To minimize this problem, we set alignment in the shape same tests
- * to the default Lustre block size -- which greatly reduces contention in
+ * to the default Lustre block size -- which greatly reduces contention in
* the chunked dataset case.
*/
-#define SHAPE_SAME_TEST_ALIGNMENT ((hsize_t)(4 * 1024 * 1024))
+#define SHAPE_SAME_TEST_ALIGNMENT ((hsize_t)(4 * 1024 * 1024))
-#define PAR_SS_DR_MAX_RANK 5 /* must update code if this changes */
+#define PAR_SS_DR_MAX_RANK 5 /* must update code if this changes */
struct hs_dr_pio_test_vars_t
{
- int mpi_size;
+ int mpi_size;
int mpi_rank;
MPI_Comm mpi_comm;
- MPI_Info mpi_info;
+ MPI_Info mpi_info;
int test_num;
int edge_size;
- int checker_edge_size;
+ int checker_edge_size;
int chunk_edge_size;
int small_rank;
int large_rank;
@@ -64,13 +62,13 @@ struct hs_dr_pio_test_vars_t
int small_ds_offset;
int large_ds_offset;
hid_t fid; /* HDF5 file ID */
- hid_t xfer_plist;
+ hid_t xfer_plist;
hid_t full_mem_small_ds_sid;
hid_t full_file_small_ds_sid;
hid_t mem_small_ds_sid;
hid_t file_small_ds_sid_0;
hid_t file_small_ds_sid_1;
- hid_t small_ds_slice_sid;
+ hid_t small_ds_slice_sid;
hid_t full_mem_large_ds_sid;
hid_t full_file_large_ds_sid;
hid_t mem_large_ds_sid;
@@ -78,7 +76,7 @@ struct hs_dr_pio_test_vars_t
hid_t file_large_ds_sid_1;
hid_t file_large_ds_process_slice_sid;
hid_t mem_large_ds_process_slice_sid;
- hid_t large_ds_slice_sid;
+ hid_t large_ds_slice_sid;
hid_t small_dataset; /* Dataset ID */
hid_t large_dataset; /* Dataset ID */
size_t small_ds_size;
@@ -96,25 +94,25 @@ struct hs_dr_pio_test_vars_t
hsize_t * count_ptr;
hsize_t * block_ptr;
int skips;
- int max_skips;
- int64_t total_tests;
- int64_t tests_run;
- int64_t tests_skipped;
+ int max_skips;
+ int64_t total_tests;
+ int64_t tests_run;
+ int64_t tests_skipped;
};
/*-------------------------------------------------------------------------
- * Function: hs_dr_pio_test__setup()
+ * Function: hs_dr_pio_test__setup()
*
- * Purpose: Do setup for tests of I/O to/from hyperslab selections of
- * different rank in the parallel case.
+ * Purpose: Do setup for tests of I/O to/from hyperslab selections of
+ * different rank in the parallel case.
*
- * Return: void
+ * Return: void
*
- * Programmer: JRM -- 8/9/11
+ * Programmer: JRM -- 8/9/11
*
* Modifications:
*
- * None.
+ * None.
*
*-------------------------------------------------------------------------
*/
@@ -133,21 +131,21 @@ hs_dr_pio_test__setup(const int test_num,
const int express_test,
struct hs_dr_pio_test_vars_t * tv_ptr)
{
-#if CONTIG_HS_DR_PIO_TEST__SETUP__DEBUG
+#if CONTIG_HS_DR_PIO_TEST__SETUP__DEBUG
const char *fcnName = "hs_dr_pio_test__setup()";
#endif /* CONTIG_HS_DR_PIO_TEST__SETUP__DEBUG */
const char *filename;
- hbool_t mis_match = FALSE;
- int i;
+ hbool_t mis_match = FALSE;
+ int i;
int mrc;
- int mpi_rank; /* needed by the VRFY macro */
- uint32_t expected_value;
+ int mpi_rank; /* needed by the VRFY macro */
+ uint32_t expected_value;
uint32_t * ptr_0;
uint32_t * ptr_1;
- hid_t acc_tpl; /* File access templates */
+ hid_t acc_tpl; /* File access templates */
hid_t small_ds_dcpl_id = H5P_DEFAULT;
hid_t large_ds_dcpl_id = H5P_DEFAULT;
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
HDassert( edge_size >= 6 );
HDassert( edge_size >= chunk_edge_size );
@@ -219,7 +217,7 @@ hs_dr_pio_test__setup(const int test_num,
tv_ptr->small_ds_buf_2 = (uint32_t *)HDmalloc(sizeof(uint32_t) * tv_ptr->small_ds_size);
VRFY((tv_ptr->small_ds_buf_2 != NULL), "malloc of small_ds_buf_2 succeeded");
- tv_ptr->small_ds_slice_buf =
+ tv_ptr->small_ds_slice_buf =
(uint32_t *)HDmalloc(sizeof(uint32_t) * tv_ptr->small_ds_slice_size);
VRFY((tv_ptr->small_ds_slice_buf != NULL), "malloc of small_ds_slice_buf succeeded");
@@ -232,7 +230,7 @@ hs_dr_pio_test__setup(const int test_num,
tv_ptr->large_ds_buf_2 = (uint32_t *)HDmalloc(sizeof(uint32_t) * tv_ptr->large_ds_size);
VRFY((tv_ptr->large_ds_buf_2 != NULL), "malloc of large_ds_buf_2 succeeded");
- tv_ptr->large_ds_slice_buf =
+ tv_ptr->large_ds_slice_buf =
(uint32_t *)HDmalloc(sizeof(uint32_t) * tv_ptr->large_ds_slice_size);
VRFY((tv_ptr->large_ds_slice_buf != NULL), "malloc of large_ds_slice_buf succeeded");
@@ -256,21 +254,21 @@ hs_dr_pio_test__setup(const int test_num,
filename = (const char *)GetTestParameters();
HDassert( filename != NULL );
-#if CONTIG_HS_DR_PIO_TEST__SETUP__DEBUG
+#if CONTIG_HS_DR_PIO_TEST__SETUP__DEBUG
if ( MAINPROCESS ) {
HDfprintf(stdout, "%d: test num = %d.\n", tv_ptr->mpi_rank, tv_ptr->test_num);
HDfprintf(stdout, "%d: mpi_size = %d.\n", tv_ptr->mpi_rank, tv_ptr->mpi_size);
- HDfprintf(stdout,
+ HDfprintf(stdout,
"%d: small/large rank = %d/%d, use_collective_io = %d.\n",
- tv_ptr->mpi_rank, tv_ptr->small_rank, tv_ptr->large_rank,
+ tv_ptr->mpi_rank, tv_ptr->small_rank, tv_ptr->large_rank,
(int)use_collective_io);
HDfprintf(stdout, "%d: edge_size = %d, chunk_edge_size = %d.\n",
tv_ptr->mpi_rank, tv_ptr->edge_size, tv_ptr->chunk_edge_size);
HDfprintf(stdout, "%d: checker_edge_size = %d.\n",
tv_ptr->mpi_rank, tv_ptr->checker_edge_size);
HDfprintf(stdout, "%d: small_ds_size = %d, large_ds_size = %d.\n",
- tv_ptr->mpi_rank, (int)(tv_ptr->small_ds_size),
+ tv_ptr->mpi_rank, (int)(tv_ptr->small_ds_size),
(int)(tv_ptr->large_ds_size));
HDfprintf(stdout, "%d: filename = %s.\n", tv_ptr->mpi_rank, filename);
}
@@ -305,78 +303,78 @@ hs_dr_pio_test__setup(const int test_num,
/* setup dims: */
tv_ptr->dims[0] = (hsize_t)(tv_ptr->mpi_size + 1);
- tv_ptr->dims[1] = tv_ptr->dims[2] =
+ tv_ptr->dims[1] = tv_ptr->dims[2] =
tv_ptr->dims[3] = tv_ptr->dims[4] = (hsize_t)(tv_ptr->edge_size);
/* Create small ds dataspaces */
- tv_ptr->full_mem_small_ds_sid =
+ tv_ptr->full_mem_small_ds_sid =
H5Screate_simple(tv_ptr->small_rank, tv_ptr->dims, NULL);
- VRFY((tv_ptr->full_mem_small_ds_sid != 0),
+ VRFY((tv_ptr->full_mem_small_ds_sid != 0),
"H5Screate_simple() full_mem_small_ds_sid succeeded");
- tv_ptr->full_file_small_ds_sid =
+ tv_ptr->full_file_small_ds_sid =
H5Screate_simple(tv_ptr->small_rank, tv_ptr->dims, NULL);
- VRFY((tv_ptr->full_file_small_ds_sid != 0),
+ VRFY((tv_ptr->full_file_small_ds_sid != 0),
"H5Screate_simple() full_file_small_ds_sid succeeded");
tv_ptr->mem_small_ds_sid = H5Screate_simple(tv_ptr->small_rank, tv_ptr->dims, NULL);
- VRFY((tv_ptr->mem_small_ds_sid != 0),
+ VRFY((tv_ptr->mem_small_ds_sid != 0),
"H5Screate_simple() mem_small_ds_sid succeeded");
tv_ptr->file_small_ds_sid_0 = H5Screate_simple(tv_ptr->small_rank, tv_ptr->dims, NULL);
- VRFY((tv_ptr->file_small_ds_sid_0 != 0),
+ VRFY((tv_ptr->file_small_ds_sid_0 != 0),
"H5Screate_simple() file_small_ds_sid_0 succeeded");
/* used by checker board tests only */
tv_ptr->file_small_ds_sid_1 = H5Screate_simple(tv_ptr->small_rank, tv_ptr->dims, NULL);
- VRFY((tv_ptr->file_small_ds_sid_1 != 0),
+ VRFY((tv_ptr->file_small_ds_sid_1 != 0),
"H5Screate_simple() file_small_ds_sid_1 succeeded");
- tv_ptr->small_ds_slice_sid =
+ tv_ptr->small_ds_slice_sid =
H5Screate_simple(tv_ptr->small_rank - 1, &(tv_ptr->dims[1]), NULL);
- VRFY((tv_ptr->small_ds_slice_sid != 0),
+ VRFY((tv_ptr->small_ds_slice_sid != 0),
"H5Screate_simple() small_ds_slice_sid succeeded");
/* Create large ds dataspaces */
- tv_ptr->full_mem_large_ds_sid =
+ tv_ptr->full_mem_large_ds_sid =
H5Screate_simple(tv_ptr->large_rank, tv_ptr->dims, NULL);
- VRFY((tv_ptr->full_mem_large_ds_sid != 0),
+ VRFY((tv_ptr->full_mem_large_ds_sid != 0),
"H5Screate_simple() full_mem_large_ds_sid succeeded");
- tv_ptr->full_file_large_ds_sid =
+ tv_ptr->full_file_large_ds_sid =
H5Screate_simple(tv_ptr->large_rank, tv_ptr->dims, NULL);
- VRFY((tv_ptr->full_file_large_ds_sid != FAIL),
+ VRFY((tv_ptr->full_file_large_ds_sid != FAIL),
"H5Screate_simple() full_file_large_ds_sid succeeded");
tv_ptr->mem_large_ds_sid = H5Screate_simple(tv_ptr->large_rank, tv_ptr->dims, NULL);
- VRFY((tv_ptr->mem_large_ds_sid != FAIL),
+ VRFY((tv_ptr->mem_large_ds_sid != FAIL),
"H5Screate_simple() mem_large_ds_sid succeeded");
tv_ptr->file_large_ds_sid_0 = H5Screate_simple(tv_ptr->large_rank, tv_ptr->dims, NULL);
- VRFY((tv_ptr->file_large_ds_sid_0 != FAIL),
+ VRFY((tv_ptr->file_large_ds_sid_0 != FAIL),
"H5Screate_simple() file_large_ds_sid_0 succeeded");
/* used by checker board tests only */
tv_ptr->file_large_ds_sid_1 = H5Screate_simple(tv_ptr->large_rank, tv_ptr->dims, NULL);
- VRFY((tv_ptr->file_large_ds_sid_1 != FAIL),
+ VRFY((tv_ptr->file_large_ds_sid_1 != FAIL),
"H5Screate_simple() file_large_ds_sid_1 succeeded");
- tv_ptr->mem_large_ds_process_slice_sid =
+ tv_ptr->mem_large_ds_process_slice_sid =
H5Screate_simple(tv_ptr->large_rank, tv_ptr->dims, NULL);
- VRFY((tv_ptr->mem_large_ds_process_slice_sid != FAIL),
+ VRFY((tv_ptr->mem_large_ds_process_slice_sid != FAIL),
"H5Screate_simple() mem_large_ds_process_slice_sid succeeded");
- tv_ptr->file_large_ds_process_slice_sid =
+ tv_ptr->file_large_ds_process_slice_sid =
H5Screate_simple(tv_ptr->large_rank, tv_ptr->dims, NULL);
- VRFY((tv_ptr->file_large_ds_process_slice_sid != FAIL),
+ VRFY((tv_ptr->file_large_ds_process_slice_sid != FAIL),
"H5Screate_simple() file_large_ds_process_slice_sid succeeded");
- tv_ptr->large_ds_slice_sid =
+ tv_ptr->large_ds_slice_sid =
H5Screate_simple(tv_ptr->large_rank - 1, &(tv_ptr->dims[1]), NULL);
- VRFY((tv_ptr->large_ds_slice_sid != 0),
+ VRFY((tv_ptr->large_ds_slice_sid != 0),
"H5Screate_simple() large_ds_slice_sid succeeded");
@@ -386,18 +384,18 @@ hs_dr_pio_test__setup(const int test_num,
*/
if ( tv_ptr->chunk_edge_size > 0 ) {
- /* Under Lustre (and perhaps other parallel file systems?) we get
- * locking delays when two or more processes attempt to access the
+ /* Under Lustre (and perhaps other parallel file systems?) we get
+ * locking delays when two or more processes attempt to access the
* same file system block.
*
- * To minimize this problem, I have changed chunk_dims[0]
+ * To minimize this problem, I have changed chunk_dims[0]
* from (mpi_size + 1) to just when any sort of express test is
- * selected. Given the structure of the test, and assuming we
- * set the alignment large enough, this avoids the contention
- * issue by seeing to it that each chunk is only accessed by one
+ * selected. Given the structure of the test, and assuming we
+ * set the alignment large enough, this avoids the contention
+ * issue by seeing to it that each chunk is only accessed by one
* process.
*
- * One can argue as to whether this is a good thing to do in our
+ * One can argue as to whether this is a good thing to do in our
* tests, but for now it is necessary if we want the test to complete
* in a reasonable amount of time.
*
@@ -411,8 +409,8 @@ hs_dr_pio_test__setup(const int test_num,
tv_ptr->chunk_dims[0] = 1;
}
- tv_ptr->chunk_dims[1] = tv_ptr->chunk_dims[2] =
- tv_ptr->chunk_dims[3] =
+ tv_ptr->chunk_dims[1] = tv_ptr->chunk_dims[2] =
+ tv_ptr->chunk_dims[3] =
tv_ptr->chunk_dims[4] = (hsize_t)(tv_ptr->chunk_edge_size);
small_ds_dcpl_id = H5Pcreate(H5P_DATASET_CREATE);
@@ -511,7 +509,7 @@ hs_dr_pio_test__setup(const int test_num,
/* write the initial value of the small data set to file */
- ret = H5Dwrite(tv_ptr->small_dataset, tv_ptr->dset_type, tv_ptr->mem_small_ds_sid,
+ ret = H5Dwrite(tv_ptr->small_dataset, tv_ptr->dset_type, tv_ptr->mem_small_ds_sid,
tv_ptr->file_small_ds_sid_0, tv_ptr->xfer_plist, tv_ptr->small_ds_buf_0);
VRFY((ret >= 0), "H5Dwrite() small_dataset initial write succeeded");
@@ -524,8 +522,8 @@ hs_dr_pio_test__setup(const int test_num,
VRFY((mrc==MPI_SUCCESS), "Sync after small dataset writes");
}
- /* read the small data set back to verify that it contains the
- * expected data. Note that each process reads in the entire
+ /* read the small data set back to verify that it contains the
+ * expected data. Note that each process reads in the entire
* data set and verifies it.
*/
ret = H5Dread(tv_ptr->small_dataset,
@@ -574,7 +572,7 @@ hs_dr_pio_test__setup(const int test_num,
tv_ptr->count,
tv_ptr->block);
VRFY((ret >= 0), "H5Sselect_hyperslab(file_large_ds_sid_0, set) suceeded");
-
+
/* In passing, setup the process slice data spaces as well */
ret = H5Sselect_hyperslab(tv_ptr->mem_large_ds_process_slice_sid,
@@ -583,7 +581,7 @@ hs_dr_pio_test__setup(const int test_num,
tv_ptr->stride,
tv_ptr->count,
tv_ptr->block);
- VRFY((ret >= 0),
+ VRFY((ret >= 0),
"H5Sselect_hyperslab(mem_large_ds_process_slice_sid, set) suceeded");
ret = H5Sselect_hyperslab(tv_ptr->file_large_ds_process_slice_sid,
@@ -592,7 +590,7 @@ hs_dr_pio_test__setup(const int test_num,
tv_ptr->stride,
tv_ptr->count,
tv_ptr->block);
- VRFY((ret >= 0),
+ VRFY((ret >= 0),
"H5Sselect_hyperslab(file_large_ds_process_slice_sid, set) suceeded");
if ( MAINPROCESS ) { /* add an additional slice to the selections */
@@ -618,8 +616,8 @@ hs_dr_pio_test__setup(const int test_num,
/* write the initial value of the large data set to file */
- ret = H5Dwrite(tv_ptr->large_dataset, tv_ptr->dset_type,
- tv_ptr->mem_large_ds_sid, tv_ptr->file_large_ds_sid_0,
+ ret = H5Dwrite(tv_ptr->large_dataset, tv_ptr->dset_type,
+ tv_ptr->mem_large_ds_sid, tv_ptr->file_large_ds_sid_0,
tv_ptr->xfer_plist, tv_ptr->large_ds_buf_0);
if ( ret < 0 ) H5Eprint2(H5E_DEFAULT, stderr);
VRFY((ret >= 0), "H5Dwrite() large_dataset initial write succeeded");
@@ -633,8 +631,8 @@ hs_dr_pio_test__setup(const int test_num,
}
- /* read the large data set back to verify that it contains the
- * expected data. Note that each process reads in the entire
+ /* read the large data set back to verify that it contains the
+ * expected data. Note that each process reads in the entire
* data set.
*/
ret = H5Dread(tv_ptr->large_dataset,
@@ -678,18 +676,18 @@ hs_dr_pio_test__setup(const int test_num,
/*-------------------------------------------------------------------------
- * Function: hs_dr_pio_test__takedown()
+ * Function: hs_dr_pio_test__takedown()
*
- * Purpose: Do takedown after tests of I/O to/from hyperslab selections
- * of different rank in the parallel case.
+ * Purpose: Do takedown after tests of I/O to/from hyperslab selections
+ * of different rank in the parallel case.
*
- * Return: void
+ * Return: void
*
- * Programmer: JRM -- 9/18/09
+ * Programmer: JRM -- 9/18/09
*
* Modifications:
*
- * None.
+ * None.
*
*-------------------------------------------------------------------------
*/
@@ -699,11 +697,11 @@ hs_dr_pio_test__setup(const int test_num,
static void
hs_dr_pio_test__takedown( struct hs_dr_pio_test_vars_t * tv_ptr)
{
-#if HS_DR_PIO_TEST__TAKEDOWN__DEBUG
+#if HS_DR_PIO_TEST__TAKEDOWN__DEBUG
const char *fcnName = "hs_dr_pio_test__takedown()";
#endif /* HS_DR_PIO_TEST__TAKEDOWN__DEBUG */
- int mpi_rank; /* needed by the VRFY macro */
- herr_t ret; /* Generic return value */
+ int mpi_rank; /* needed by the VRFY macro */
+ herr_t ret; /* Generic return value */
/* initialize the local copy of mpi_rank */
mpi_rank = tv_ptr->mpi_rank;
@@ -787,27 +785,27 @@ hs_dr_pio_test__takedown( struct hs_dr_pio_test_vars_t * tv_ptr)
/*-------------------------------------------------------------------------
- * Function: contig_hs_dr_pio_test__d2m_l2s()
+ * Function: contig_hs_dr_pio_test__d2m_l2s()
*
- * Purpose: Part one of a series of tests of I/O to/from hyperslab
- * selections of different rank in the parallel.
+ * Purpose: Part one of a series of tests of I/O to/from hyperslab
+ * selections of different rank in the parallel.
*
- * Verify that we can read from disk correctly using
- * selections of different rank that H5S_select_shape_same()
- * views as being of the same shape.
+ * Verify that we can read from disk correctly using
+ * selections of different rank that H5S_select_shape_same()
+ * views as being of the same shape.
*
- * In this function, we test this by reading small_rank - 1
- * slices from the on disk large cube, and verifying that the
- * data read is correct. Verify that H5S_select_shape_same()
- * returns true on the memory and file selections.
+ * In this function, we test this by reading small_rank - 1
+ * slices from the on disk large cube, and verifying that the
+ * data read is correct. Verify that H5S_select_shape_same()
+ * returns true on the memory and file selections.
*
- * Return: void
+ * Return: void
*
- * Programmer: JRM -- 9/10/11
+ * Programmer: JRM -- 9/10/11
*
* Modifications:
*
- * None.
+ * None.
*
*-------------------------------------------------------------------------
*/
@@ -817,24 +815,24 @@ hs_dr_pio_test__takedown( struct hs_dr_pio_test_vars_t * tv_ptr)
static void
contig_hs_dr_pio_test__d2m_l2s(struct hs_dr_pio_test_vars_t * tv_ptr)
{
-#if CONTIG_HS_DR_PIO_TEST__D2M_L2S__DEBUG
+#if CONTIG_HS_DR_PIO_TEST__D2M_L2S__DEBUG
const char *fcnName = "contig_hs_dr_pio_test__run_test()";
#endif /* CONTIG_HS_DR_PIO_TEST__D2M_L2S__DEBUG */
- hbool_t mis_match = FALSE;
- int i, j, k, l;
- size_t n;
- int mpi_rank; /* needed by the VRFY macro */
- uint32_t expected_value;
+ hbool_t mis_match = FALSE;
+ int i, j, k, l;
+ size_t n;
+ int mpi_rank; /* needed by the VRFY macro */
+ uint32_t expected_value;
uint32_t * ptr_1;
htri_t check; /* Shape comparison return value */
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
/* initialize the local copy of mpi_rank */
mpi_rank = tv_ptr->mpi_rank;
- /* We have already done a H5Sselect_all() on the data space
- * small_ds_slice_sid in the initialization phase, so no need to
+ /* We have already done a H5Sselect_all() on the data space
+ * small_ds_slice_sid in the initialization phase, so no need to
* call H5Sselect_all() again.
*/
@@ -859,16 +857,16 @@ contig_hs_dr_pio_test__d2m_l2s(struct hs_dr_pio_test_vars_t * tv_ptr)
/* zero out the buffer we will be reading into */
HDmemset(tv_ptr->small_ds_slice_buf, 0, sizeof(uint32_t) * tv_ptr->small_ds_slice_size);
-#if CONTIG_HS_DR_PIO_TEST__D2M_L2S__DEBUG
- HDfprintf(stdout,
+#if CONTIG_HS_DR_PIO_TEST__D2M_L2S__DEBUG
+ HDfprintf(stdout,
"%s reading slices from big cube on disk into small cube slice.\n",
fcnName);
#endif /* CONTIG_HS_DR_PIO_TEST__D2M_L2S__DEBUG */
/* in serial versions of this test, we loop through all the dimensions
- * of the large data set. However, in the parallel version, each
+ * of the large data set. However, in the parallel version, each
* process only works with that slice of the large cube indicated
- * by its rank -- hence we set the most slowly changing index to
+ * by its rank -- hence we set the most slowly changing index to
* mpi_rank, and don't itterate over it.
*/
@@ -881,9 +879,9 @@ contig_hs_dr_pio_test__d2m_l2s(struct hs_dr_pio_test_vars_t * tv_ptr)
i = 0;
}
- /* since large_rank is at most PAR_SS_DR_MAX_RANK, no need to
+ /* since large_rank is at most PAR_SS_DR_MAX_RANK, no need to
* loop over it -- either we are setting i to mpi_rank, or
- * we are setting it to zero. It will not change during the
+ * we are setting it to zero. It will not change during the
* test.
*/
@@ -907,7 +905,7 @@ contig_hs_dr_pio_test__d2m_l2s(struct hs_dr_pio_test_vars_t * tv_ptr)
}
do {
- /* since small rank >= 2 and large_rank > small_rank, we
+ /* since small rank >= 2 and large_rank > small_rank, we
* have large_rank >= 3. Since PAR_SS_DR_MAX_RANK == 5
* (baring major re-orgaization), this gives us:
*
@@ -921,14 +919,14 @@ contig_hs_dr_pio_test__d2m_l2s(struct hs_dr_pio_test_vars_t * tv_ptr)
do {
if ( (tv_ptr->skips)++ < tv_ptr->max_skips ) { /* skip the test */
- (tv_ptr->tests_skipped)++;
+ (tv_ptr->tests_skipped)++;
} else { /* run the test */
tv_ptr->skips = 0; /* reset the skips counter */
- /* we know that small_rank - 1 >= 1 and that
- * large_rank > small_rank by the assertions at the head
+ /* we know that small_rank - 1 >= 1 and that
+ * large_rank > small_rank by the assertions at the head
* of this function. Thus no need for another inner loop.
*/
tv_ptr->start[0] = (hsize_t)i;
@@ -943,7 +941,7 @@ contig_hs_dr_pio_test__d2m_l2s(struct hs_dr_pio_test_vars_t * tv_ptr)
tv_ptr->stride_ptr,
tv_ptr->count_ptr,
tv_ptr->block_ptr);
- VRFY((ret != FAIL),
+ VRFY((ret != FAIL),
"H5Sselect_hyperslab(file_large_cube_sid) succeeded");
@@ -956,11 +954,11 @@ contig_hs_dr_pio_test__d2m_l2s(struct hs_dr_pio_test_vars_t * tv_ptr)
/* Read selection from disk */
-#if CONTIG_HS_DR_PIO_TEST__D2M_L2S__DEBUG
- HDfprintf(stdout, "%s:%d: start = %d %d %d %d %d.\n",
- fcnName, (int)(tv_ptr->mpi_rank),
- (int)(tv_ptr->start[0]), (int)(tv_ptr->start[1]),
- (int)(tv_ptr->start[2]), (int)(tv_ptr->start[3]),
+#if CONTIG_HS_DR_PIO_TEST__D2M_L2S__DEBUG
+ HDfprintf(stdout, "%s:%d: start = %d %d %d %d %d.\n",
+ fcnName, (int)(tv_ptr->mpi_rank),
+ (int)(tv_ptr->start[0]), (int)(tv_ptr->start[1]),
+ (int)(tv_ptr->start[2]), (int)(tv_ptr->start[3]),
(int)(tv_ptr->start[4]));
HDfprintf(stdout, "%s slice/file extent dims = %d/%d.\n",
fcnName,
@@ -981,7 +979,7 @@ contig_hs_dr_pio_test__d2m_l2s(struct hs_dr_pio_test_vars_t * tv_ptr)
mis_match = FALSE;
ptr_1 = tv_ptr->small_ds_slice_buf;
expected_value = (uint32_t)(
- (i * tv_ptr->edge_size * tv_ptr->edge_size *
+ (i * tv_ptr->edge_size * tv_ptr->edge_size *
tv_ptr->edge_size * tv_ptr->edge_size) +
(j * tv_ptr->edge_size * tv_ptr->edge_size * tv_ptr->edge_size) +
(k * tv_ptr->edge_size * tv_ptr->edge_size) +
@@ -1000,10 +998,10 @@ contig_hs_dr_pio_test__d2m_l2s(struct hs_dr_pio_test_vars_t * tv_ptr)
expected_value++;
}
- VRFY((mis_match == FALSE),
+ VRFY((mis_match == FALSE),
"small slice read from large ds data good.");
- (tv_ptr->tests_run)++;
+ (tv_ptr->tests_run)++;
}
l++;
@@ -1028,27 +1026,27 @@ contig_hs_dr_pio_test__d2m_l2s(struct hs_dr_pio_test_vars_t * tv_ptr)
/*-------------------------------------------------------------------------
- * Function: contig_hs_dr_pio_test__d2m_s2l()
+ * Function: contig_hs_dr_pio_test__d2m_s2l()
*
- * Purpose: Part two of a series of tests of I/O to/from hyperslab
- * selections of different rank in the parallel.
+ * Purpose: Part two of a series of tests of I/O to/from hyperslab
+ * selections of different rank in the parallel.
*
- * Verify that we can read from disk correctly using
- * selections of different rank that H5S_select_shape_same()
- * views as being of the same shape.
+ * Verify that we can read from disk correctly using
+ * selections of different rank that H5S_select_shape_same()
+ * views as being of the same shape.
*
- * In this function, we test this by reading slices of the
- * on disk small data set into slices through the in memory
- * large data set, and verify that the correct data (and
- * only the correct data) is read.
+ * In this function, we test this by reading slices of the
+ * on disk small data set into slices through the in memory
+ * large data set, and verify that the correct data (and
+ * only the correct data) is read.
*
- * Return: void
+ * Return: void
*
- * Programmer: JRM -- 8/10/11
+ * Programmer: JRM -- 8/10/11
*
* Modifications:
*
- * None.
+ * None.
*
*-------------------------------------------------------------------------
*/
@@ -1058,25 +1056,25 @@ contig_hs_dr_pio_test__d2m_l2s(struct hs_dr_pio_test_vars_t * tv_ptr)
static void
contig_hs_dr_pio_test__d2m_s2l(struct hs_dr_pio_test_vars_t * tv_ptr)
{
-#if CONTIG_HS_DR_PIO_TEST__D2M_S2L__DEBUG
+#if CONTIG_HS_DR_PIO_TEST__D2M_S2L__DEBUG
const char *fcnName = "contig_hs_dr_pio_test__d2m_s2l()";
#endif /* CONTIG_HS_DR_PIO_TEST__D2M_S2L__DEBUG */
- hbool_t mis_match = FALSE;
- int i, j, k, l;
- size_t n;
- int mpi_rank; /* needed by the VRFY macro */
+ hbool_t mis_match = FALSE;
+ int i, j, k, l;
+ size_t n;
+ int mpi_rank; /* needed by the VRFY macro */
size_t start_index;
size_t stop_index;
- uint32_t expected_value;
+ uint32_t expected_value;
uint32_t * ptr_1;
htri_t check; /* Shape comparison return value */
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
/* initialize the local copy of mpi_rank */
mpi_rank = tv_ptr->mpi_rank;
- /* Read slices of the on disk small data set into slices
- * through the in memory large data set, and verify that the correct
+ /* Read slices of the on disk small data set into slices
+ * through the in memory large data set, and verify that the correct
* data (and only the correct data) is read.
*/
@@ -1102,8 +1100,8 @@ contig_hs_dr_pio_test__d2m_s2l(struct hs_dr_pio_test_vars_t * tv_ptr)
VRFY((ret >= 0), "H5Sselect_hyperslab(file_small_ds_sid_0, set) suceeded");
-#if CONTIG_HS_DR_PIO_TEST__D2M_S2L__DEBUG
- HDfprintf(stdout,
+#if CONTIG_HS_DR_PIO_TEST__D2M_S2L__DEBUG
+ HDfprintf(stdout,
"%s reading slices of on disk small data set into slices of big data set.\n",
fcnName);
#endif /* CONTIG_HS_DR_PIO_TEST__D2M_S2L__DEBUG */
@@ -1131,11 +1129,11 @@ contig_hs_dr_pio_test__d2m_s2l(struct hs_dr_pio_test_vars_t * tv_ptr)
/* in serial versions of this test, we loop through all the dimensions
- * of the large data set that don't appear in the small data set.
+ * of the large data set that don't appear in the small data set.
*
- * However, in the parallel version, each process only works with that
- * slice of the large (and small) data set indicated by its rank -- hence
- * we set the most slowly changing index to mpi_rank, and don't itterate
+ * However, in the parallel version, each process only works with that
+ * slice of the large (and small) data set indicated by its rank -- hence
+ * we set the most slowly changing index to mpi_rank, and don't itterate
* over it.
*/
@@ -1149,9 +1147,9 @@ contig_hs_dr_pio_test__d2m_s2l(struct hs_dr_pio_test_vars_t * tv_ptr)
i = 0;
}
- /* since large_rank is at most PAR_SS_DR_MAX_RANK, no need to
+ /* since large_rank is at most PAR_SS_DR_MAX_RANK, no need to
* loop over it -- either we are setting i to mpi_rank, or
- * we are setting it to zero. It will not change during the
+ * we are setting it to zero. It will not change during the
* test.
*/
@@ -1175,7 +1173,7 @@ contig_hs_dr_pio_test__d2m_s2l(struct hs_dr_pio_test_vars_t * tv_ptr)
}
do {
- /* since small rank >= 2 and large_rank > small_rank, we
+ /* since small rank >= 2 and large_rank > small_rank, we
* have large_rank >= 3. Since PAR_SS_DR_MAX_RANK == 5
* (baring major re-orgaization), this gives us:
*
@@ -1211,7 +1209,7 @@ contig_hs_dr_pio_test__d2m_s2l(struct hs_dr_pio_test_vars_t * tv_ptr)
tv_ptr->stride_ptr,
tv_ptr->count_ptr,
tv_ptr->block_ptr);
- VRFY((ret != FAIL),
+ VRFY((ret != FAIL),
"H5Sselect_hyperslab(mem_large_ds_sid) succeeded");
@@ -1224,11 +1222,11 @@ contig_hs_dr_pio_test__d2m_s2l(struct hs_dr_pio_test_vars_t * tv_ptr)
/* Read selection from disk */
-#if CONTIG_HS_DR_PIO_TEST__D2M_S2L__DEBUG
- HDfprintf(stdout, "%s:%d: start = %d %d %d %d %d.\n",
- fcnName, (int)(tv_ptr->mpi_rank),
- (int)(tv_ptr->start[0]), (int)(tv_ptr->start[1]),
- (int)(tv_ptr->start[2]), (int)(tv_ptr->start[3]),
+#if CONTIG_HS_DR_PIO_TEST__D2M_S2L__DEBUG
+ HDfprintf(stdout, "%s:%d: start = %d %d %d %d %d.\n",
+ fcnName, (int)(tv_ptr->mpi_rank),
+ (int)(tv_ptr->start[0]), (int)(tv_ptr->start[1]),
+ (int)(tv_ptr->start[2]), (int)(tv_ptr->start[3]),
(int)(tv_ptr->start[4]));
HDfprintf(stdout, "%s:%d: mem/file extent dims = %d/%d.\n",
fcnName, tv_ptr->mpi_rank,
@@ -1250,7 +1248,7 @@ contig_hs_dr_pio_test__d2m_s2l(struct hs_dr_pio_test_vars_t * tv_ptr)
expected_value = (uint32_t)
((size_t)(tv_ptr->mpi_rank) * tv_ptr->small_ds_slice_size);
start_index = (size_t)(
- (i * tv_ptr->edge_size * tv_ptr->edge_size *
+ (i * tv_ptr->edge_size * tv_ptr->edge_size *
tv_ptr->edge_size * tv_ptr->edge_size) +
(j * tv_ptr->edge_size * tv_ptr->edge_size * tv_ptr->edge_size) +
(k * tv_ptr->edge_size * tv_ptr->edge_size) +
@@ -1283,7 +1281,7 @@ contig_hs_dr_pio_test__d2m_s2l(struct hs_dr_pio_test_vars_t * tv_ptr)
ptr_1++;
}
- VRFY((mis_match == FALSE),
+ VRFY((mis_match == FALSE),
"small slice read from large ds data good.");
(tv_ptr->tests_run)++;
@@ -1311,29 +1309,29 @@ contig_hs_dr_pio_test__d2m_s2l(struct hs_dr_pio_test_vars_t * tv_ptr)
/*-------------------------------------------------------------------------
- * Function: contig_hs_dr_pio_test__m2d_l2s()
+ * Function: contig_hs_dr_pio_test__m2d_l2s()
*
- * Purpose: Part three of a series of tests of I/O to/from hyperslab
- * selections of different rank in the parallel.
+ * Purpose: Part three of a series of tests of I/O to/from hyperslab
+ * selections of different rank in the parallel.
*
- * Verify that we can write from memory to file using
- * selections of different rank that H5S_select_shape_same()
- * views as being of the same shape.
+ * Verify that we can write from memory to file using
+ * selections of different rank that H5S_select_shape_same()
+ * views as being of the same shape.
*
- * Do this by writing small_rank - 1 dimensional slices from
- * the in memory large data set to the on disk small cube
- * dataset. After each write, read the slice of the small
- * dataset back from disk, and verify that it contains
- * the expected data. Verify that H5S_select_shape_same()
- * returns true on the memory and file selections.
+ * Do this by writing small_rank - 1 dimensional slices from
+ * the in memory large data set to the on disk small cube
+ * dataset. After each write, read the slice of the small
+ * dataset back from disk, and verify that it contains
+ * the expected data. Verify that H5S_select_shape_same()
+ * returns true on the memory and file selections.
*
- * Return: void
+ * Return: void
*
- * Programmer: JRM -- 8/10/11
+ * Programmer: JRM -- 8/10/11
*
* Modifications:
*
- * None.
+ * None.
*
*-------------------------------------------------------------------------
*/
@@ -1343,19 +1341,19 @@ contig_hs_dr_pio_test__d2m_s2l(struct hs_dr_pio_test_vars_t * tv_ptr)
static void
contig_hs_dr_pio_test__m2d_l2s(struct hs_dr_pio_test_vars_t * tv_ptr)
{
-#if CONTIG_HS_DR_PIO_TEST__M2D_L2S__DEBUG
+#if CONTIG_HS_DR_PIO_TEST__M2D_L2S__DEBUG
const char *fcnName = "contig_hs_dr_pio_test__m2d_l2s()";
#endif /* CONTIG_HS_DR_PIO_TEST__M2D_L2S__DEBUG */
- hbool_t mis_match = FALSE;
- int i, j, k, l;
- size_t n;
- int mpi_rank; /* needed by the VRFY macro */
+ hbool_t mis_match = FALSE;
+ int i, j, k, l;
+ size_t n;
+ int mpi_rank; /* needed by the VRFY macro */
size_t start_index;
size_t stop_index;
- uint32_t expected_value;
+ uint32_t expected_value;
uint32_t * ptr_1;
htri_t check; /* Shape comparison return value */
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
/* initialize the local copy of mpi_rank */
mpi_rank = tv_ptr->mpi_rank;
@@ -1365,10 +1363,10 @@ contig_hs_dr_pio_test__m2d_l2s(struct hs_dr_pio_test_vars_t * tv_ptr)
* from memory to file using selections of different rank that
* H5S_select_shape_same() views as being of the same shape.
*
- * Start by writing small_rank - 1 dimensional slices from the in memory large
- * data set to the on disk small cube dataset. After each write, read the
- * slice of the small dataset back from disk, and verify that it contains
- * the expected data. Verify that H5S_select_shape_same() returns true on
+ * Start by writing small_rank - 1 dimensional slices from the in memory large
+ * data set to the on disk small cube dataset. After each write, read the
+ * slice of the small dataset back from disk, and verify that it contains
+ * the expected data. Verify that H5S_select_shape_same() returns true on
* the memory and file selections.
*/
@@ -1424,18 +1422,18 @@ contig_hs_dr_pio_test__m2d_l2s(struct hs_dr_pio_test_vars_t * tv_ptr)
HDmemset(tv_ptr->small_ds_buf_1, 0, sizeof(uint32_t) * tv_ptr->small_ds_size);
-#if CONTIG_HS_DR_PIO_TEST__M2D_L2S__DEBUG
- HDfprintf(stdout,
+#if CONTIG_HS_DR_PIO_TEST__M2D_L2S__DEBUG
+ HDfprintf(stdout,
"%s writing slices from big ds to slices of small ds on disk.\n",
fcnName);
#endif /* CONTIG_HS_DR_PIO_TEST__M2D_L2S__DEBUG */
/* in serial versions of this test, we loop through all the dimensions
- * of the large data set that don't appear in the small data set.
+ * of the large data set that don't appear in the small data set.
*
- * However, in the parallel version, each process only works with that
- * slice of the large (and small) data set indicated by its rank -- hence
- * we set the most slowly changing index to mpi_rank, and don't itterate
+ * However, in the parallel version, each process only works with that
+ * slice of the large (and small) data set indicated by its rank -- hence
+ * we set the most slowly changing index to mpi_rank, and don't itterate
* over it.
*/
@@ -1449,9 +1447,9 @@ contig_hs_dr_pio_test__m2d_l2s(struct hs_dr_pio_test_vars_t * tv_ptr)
i = 0;
}
- /* since large_rank is at most PAR_SS_DR_MAX_RANK, no need to
+ /* since large_rank is at most PAR_SS_DR_MAX_RANK, no need to
* loop over it -- either we are setting i to mpi_rank, or
- * we are setting it to zero. It will not change during the
+ * we are setting it to zero. It will not change during the
* test.
*/
@@ -1476,7 +1474,7 @@ contig_hs_dr_pio_test__m2d_l2s(struct hs_dr_pio_test_vars_t * tv_ptr)
}
do {
- /* since small rank >= 2 and large_rank > small_rank, we
+ /* since small rank >= 2 and large_rank > small_rank, we
* have large_rank >= 3. Since PAR_SS_DR_MAX_RANK == 5
* (baring major re-orgaization), this gives us:
*
@@ -1525,7 +1523,7 @@ contig_hs_dr_pio_test__m2d_l2s(struct hs_dr_pio_test_vars_t * tv_ptr)
tv_ptr->stride_ptr,
tv_ptr->count_ptr,
tv_ptr->block_ptr);
- VRFY((ret >= 0),
+ VRFY((ret >= 0),
"H5Sselect_hyperslab() mem_large_ds_sid succeeded.");
@@ -1538,13 +1536,13 @@ contig_hs_dr_pio_test__m2d_l2s(struct hs_dr_pio_test_vars_t * tv_ptr)
VRFY((check == TRUE), "H5S_select_shape_same_test passed.");
- /* write the slice from the in memory large data set to the
+ /* write the slice from the in memory large data set to the
* slice of the on disk small dataset. */
-#if CONTIG_HS_DR_PIO_TEST__M2D_L2S__DEBUG
- HDfprintf(stdout, "%s:%d: start = %d %d %d %d %d.\n",
+#if CONTIG_HS_DR_PIO_TEST__M2D_L2S__DEBUG
+ HDfprintf(stdout, "%s:%d: start = %d %d %d %d %d.\n",
fcnName, (int)(tv_ptr->mpi_rank),
- (int)(tv_ptr->start[0]), (int)(tv_ptr->start[1]),
- (int)(tv_ptr->start[2]), (int)(tv_ptr->start[3]),
+ (int)(tv_ptr->start[0]), (int)(tv_ptr->start[1]),
+ (int)(tv_ptr->start[2]), (int)(tv_ptr->start[3]),
(int)(tv_ptr->start[4]));
HDfprintf(stdout, "%s:%d: mem/file extent dims = %d/%d.\n",
fcnName, tv_ptr->mpi_rank,
@@ -1576,7 +1574,7 @@ contig_hs_dr_pio_test__m2d_l2s(struct hs_dr_pio_test_vars_t * tv_ptr)
ptr_1 = tv_ptr->small_ds_buf_1;
expected_value = (uint32_t)(
- (i * tv_ptr->edge_size * tv_ptr->edge_size *
+ (i * tv_ptr->edge_size * tv_ptr->edge_size *
tv_ptr->edge_size * tv_ptr->edge_size) +
(j * tv_ptr->edge_size * tv_ptr->edge_size * tv_ptr->edge_size) +
(k * tv_ptr->edge_size * tv_ptr->edge_size) +
@@ -1611,7 +1609,7 @@ contig_hs_dr_pio_test__m2d_l2s(struct hs_dr_pio_test_vars_t * tv_ptr)
ptr_1++;
}
- VRFY((mis_match == FALSE),
+ VRFY((mis_match == FALSE),
"small slice write from large ds data good.");
(tv_ptr->tests_run)++;
@@ -1639,31 +1637,31 @@ contig_hs_dr_pio_test__m2d_l2s(struct hs_dr_pio_test_vars_t * tv_ptr)
/*-------------------------------------------------------------------------
- * Function: contig_hs_dr_pio_test__m2d_s2l()
+ * Function: contig_hs_dr_pio_test__m2d_s2l()
*
- * Purpose: Part four of a series of tests of I/O to/from hyperslab
- * selections of different rank in the parallel.
+ * Purpose: Part four of a series of tests of I/O to/from hyperslab
+ * selections of different rank in the parallel.
*
- * Verify that we can write from memory to file using
- * selections of different rank that H5S_select_shape_same()
- * views as being of the same shape.
+ * Verify that we can write from memory to file using
+ * selections of different rank that H5S_select_shape_same()
+ * views as being of the same shape.
*
- * Do this by writing the contents of the process's slice of
- * the in memory small data set to slices of the on disk
- * large data set. After each write, read the process's
- * slice of the large data set back into memory, and verify
- * that it contains the expected data.
+ * Do this by writing the contents of the process's slice of
+ * the in memory small data set to slices of the on disk
+ * large data set. After each write, read the process's
+ * slice of the large data set back into memory, and verify
+ * that it contains the expected data.
*
- * Verify that H5S_select_shape_same() returns true on the
- * memory and file selections.
+ * Verify that H5S_select_shape_same() returns true on the
+ * memory and file selections.
*
- * Return: void
+ * Return: void
*
- * Programmer: JRM -- 8/10/11
+ * Programmer: JRM -- 8/10/11
*
* Modifications:
*
- * None
+ * None
*
*-------------------------------------------------------------------------
*/
@@ -1673,32 +1671,32 @@ contig_hs_dr_pio_test__m2d_l2s(struct hs_dr_pio_test_vars_t * tv_ptr)
static void
contig_hs_dr_pio_test__m2d_s2l(struct hs_dr_pio_test_vars_t * tv_ptr)
{
-#if CONTIG_HS_DR_PIO_TEST__M2D_S2L__DEBUG
+#if CONTIG_HS_DR_PIO_TEST__M2D_S2L__DEBUG
const char *fcnName = "contig_hs_dr_pio_test__m2d_s2l()";
#endif /* CONTIG_HS_DR_PIO_TEST__M2D_S2L__DEBUG */
- hbool_t mis_match = FALSE;
- int i, j, k, l;
- size_t n;
- int mpi_rank; /* needed by the VRFY macro */
+ hbool_t mis_match = FALSE;
+ int i, j, k, l;
+ size_t n;
+ int mpi_rank; /* needed by the VRFY macro */
size_t start_index;
size_t stop_index;
- uint32_t expected_value;
+ uint32_t expected_value;
uint32_t * ptr_1;
htri_t check; /* Shape comparison return value */
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
/* initialize the local copy of mpi_rank */
mpi_rank = tv_ptr->mpi_rank;
- /* Now write the contents of the process's slice of the in memory
- * small data set to slices of the on disk large data set. After
+ /* Now write the contents of the process's slice of the in memory
+ * small data set to slices of the on disk large data set. After
* each write, read the process's slice of the large data set back
- * into memory, and verify that it contains the expected data.
- * Verify that H5S_select_shape_same() returns true on the memory
+ * into memory, and verify that it contains the expected data.
+ * Verify that H5S_select_shape_same() returns true on the memory
* and file selections.
*/
- /* select the slice of the in memory small data set associated with
+ /* select the slice of the in memory small data set associated with
* the process's mpi rank.
*/
tv_ptr->start[0] = (hsize_t)(tv_ptr->mpi_rank);
@@ -1745,8 +1743,8 @@ contig_hs_dr_pio_test__m2d_s2l(struct hs_dr_pio_test_vars_t * tv_ptr)
/* zero out the in memory large ds */
HDmemset(tv_ptr->large_ds_buf_1, 0, sizeof(uint32_t) * tv_ptr->large_ds_size);
-#if CONTIG_HS_DR_PIO_TEST__M2D_S2L__DEBUG
- HDfprintf(stdout,
+#if CONTIG_HS_DR_PIO_TEST__M2D_S2L__DEBUG
+ HDfprintf(stdout,
"%s writing process slices of small ds to slices of large ds on disk.\n",
fcnName);
#endif /* CONTIG_HS_DR_PIO_TEST__M2D_S2L__DEBUG */
@@ -1760,9 +1758,9 @@ contig_hs_dr_pio_test__m2d_s2l(struct hs_dr_pio_test_vars_t * tv_ptr)
i = 0;
}
- /* since large_rank is at most PAR_SS_DR_MAX_RANK, no need to
+ /* since large_rank is at most PAR_SS_DR_MAX_RANK, no need to
* loop over it -- either we are setting i to mpi_rank, or
- * we are setting it to zero. It will not change during the
+ * we are setting it to zero. It will not change during the
* test.
*/
@@ -1786,7 +1784,7 @@ contig_hs_dr_pio_test__m2d_s2l(struct hs_dr_pio_test_vars_t * tv_ptr)
}
do {
- /* since small rank >= 2 and large_rank > small_rank, we
+ /* since small rank >= 2 and large_rank > small_rank, we
* have large_rank >= 3. Since PAR_SS_DR_MAX_RANK == 5
* (baring major re-orgaization), this gives us:
*
@@ -1802,18 +1800,18 @@ contig_hs_dr_pio_test__m2d_s2l(struct hs_dr_pio_test_vars_t * tv_ptr)
(tv_ptr->tests_skipped)++;
-#if CONTIG_HS_DR_PIO_TEST__M2D_S2L__DEBUG
+#if CONTIG_HS_DR_PIO_TEST__M2D_S2L__DEBUG
tv_ptr->start[0] = (hsize_t)i;
tv_ptr->start[1] = (hsize_t)j;
tv_ptr->start[2] = (hsize_t)k;
tv_ptr->start[3] = (hsize_t)l;
tv_ptr->start[4] = 0;
- HDfprintf(stdout,
- "%s:%d: skipping test with start = %d %d %d %d %d.\n",
+ HDfprintf(stdout,
+ "%s:%d: skipping test with start = %d %d %d %d %d.\n",
fcnName, (int)(tv_ptr->mpi_rank),
- (int)(tv_ptr->start[0]), (int)(tv_ptr->start[1]),
- (int)(tv_ptr->start[2]), (int)(tv_ptr->start[3]),
+ (int)(tv_ptr->start[0]), (int)(tv_ptr->start[1]),
+ (int)(tv_ptr->start[2]), (int)(tv_ptr->start[3]),
(int)(tv_ptr->start[4]));
HDfprintf(stdout, "%s:%d: mem/file extent dims = %d/%d.\n",
fcnName, tv_ptr->mpi_rank,
@@ -1857,7 +1855,7 @@ contig_hs_dr_pio_test__m2d_s2l(struct hs_dr_pio_test_vars_t * tv_ptr)
tv_ptr->stride_ptr,
tv_ptr->count_ptr,
tv_ptr->block_ptr);
- VRFY((ret != FAIL),
+ VRFY((ret != FAIL),
"H5Sselect_hyperslab() target large ds slice succeeded");
@@ -1871,14 +1869,14 @@ contig_hs_dr_pio_test__m2d_s2l(struct hs_dr_pio_test_vars_t * tv_ptr)
VRFY((check == TRUE), "H5S_select_shape_same_test passed");
- /* write the small data set slice from memory to the
- * target slice of the disk data set
+ /* write the small data set slice from memory to the
+ * target slice of the disk data set
*/
-#if CONTIG_HS_DR_PIO_TEST__M2D_S2L__DEBUG
- HDfprintf(stdout, "%s:%d: start = %d %d %d %d %d.\n",
+#if CONTIG_HS_DR_PIO_TEST__M2D_S2L__DEBUG
+ HDfprintf(stdout, "%s:%d: start = %d %d %d %d %d.\n",
fcnName, (int)(tv_ptr->mpi_rank),
- (int)(tv_ptr->start[0]), (int)(tv_ptr->start[1]),
- (int)(tv_ptr->start[2]), (int)(tv_ptr->start[3]),
+ (int)(tv_ptr->start[0]), (int)(tv_ptr->start[1]),
+ (int)(tv_ptr->start[2]), (int)(tv_ptr->start[3]),
(int)(tv_ptr->start[4]));
HDfprintf(stdout, "%s:%d: mem/file extent dims = %d/%d.\n",
fcnName, tv_ptr->mpi_rank,
@@ -1891,11 +1889,11 @@ contig_hs_dr_pio_test__m2d_s2l(struct hs_dr_pio_test_vars_t * tv_ptr)
tv_ptr->file_large_ds_sid_0,
tv_ptr->xfer_plist,
tv_ptr->small_ds_buf_0);
- VRFY((ret != FAIL),
+ VRFY((ret != FAIL),
"H5Dwrite of small ds slice to large ds succeeded");
- /* read this processes slice on the on disk large
+ /* read this processes slice on the on disk large
* data set into memory.
*/
@@ -1905,7 +1903,7 @@ contig_hs_dr_pio_test__m2d_s2l(struct hs_dr_pio_test_vars_t * tv_ptr)
tv_ptr->file_large_ds_process_slice_sid,
tv_ptr->xfer_plist,
tv_ptr->large_ds_buf_1);
- VRFY((ret != FAIL),
+ VRFY((ret != FAIL),
"H5Dread() of process slice of large ds succeeded");
@@ -1914,12 +1912,12 @@ contig_hs_dr_pio_test__m2d_s2l(struct hs_dr_pio_test_vars_t * tv_ptr)
*/
ptr_1 = tv_ptr->large_ds_buf_1;
expected_value = (uint32_t)
- ((size_t)(tv_ptr->mpi_rank) * tv_ptr->small_ds_slice_size);
+ ((size_t)(tv_ptr->mpi_rank) * tv_ptr->small_ds_slice_size);
start_index = (size_t)
- ((i * tv_ptr->edge_size * tv_ptr->edge_size *
+ ((i * tv_ptr->edge_size * tv_ptr->edge_size *
tv_ptr->edge_size * tv_ptr->edge_size) +
- (j * tv_ptr->edge_size * tv_ptr->edge_size *
+ (j * tv_ptr->edge_size * tv_ptr->edge_size *
tv_ptr->edge_size) +
(k * tv_ptr->edge_size * tv_ptr->edge_size) +
(l * tv_ptr->edge_size));
@@ -1951,7 +1949,7 @@ contig_hs_dr_pio_test__m2d_s2l(struct hs_dr_pio_test_vars_t * tv_ptr)
ptr_1++;
}
- VRFY((mis_match == FALSE),
+ VRFY((mis_match == FALSE),
"small ds slice write to large ds slice data good.");
(tv_ptr->tests_run)++;
@@ -1979,29 +1977,29 @@ contig_hs_dr_pio_test__m2d_s2l(struct hs_dr_pio_test_vars_t * tv_ptr)
/*-------------------------------------------------------------------------
- * Function: contig_hs_dr_pio_test__run_test()
+ * Function: contig_hs_dr_pio_test__run_test()
*
- * Purpose: Test I/O to/from hyperslab selections of different rank in
- * the parallel.
+ * Purpose: Test I/O to/from hyperslab selections of different rank in
+ * the parallel.
*
- * Return: void
+ * Return: void
*
- * Programmer: JRM -- 9/18/09
+ * Programmer: JRM -- 9/18/09
*
* Modifications:
*
- * JRM -- 9/16/10
- * Added express_test parameter. Use it to control whether
- * we set up the chunks so that no chunk is shared between
- * processes, and also whether we set an alignment when we
- * create the test file.
+ * JRM -- 9/16/10
+ * Added express_test parameter. Use it to control whether
+ * we set up the chunks so that no chunk is shared between
+ * processes, and also whether we set an alignment when we
+ * create the test file.
*
- * JRM -- 8/11/11
- * Refactored function heavily & broke it into six functions.
- * Added the skips_ptr, max_skips, total_tests_ptr,
- * tests_run_ptr, and tests_skiped_ptr parameters to support
- * skipping portions of the test according to the express
- * test value.
+ * JRM -- 8/11/11
+ * Refactored function heavily & broke it into six functions.
+ * Added the skips_ptr, max_skips, total_tests_ptr,
+ * tests_run_ptr, and tests_skiped_ptr parameters to support
+ * skipping portions of the test according to the express
+ * test value.
*
*-------------------------------------------------------------------------
*/
@@ -2023,13 +2021,13 @@ contig_hs_dr_pio_test__run_test(const int test_num,
int64_t * tests_run_ptr,
int64_t * tests_skipped_ptr)
{
-#if CONTIG_HS_DR_PIO_TEST__RUN_TEST__DEBUG
+#if CONTIG_HS_DR_PIO_TEST__RUN_TEST__DEBUG
const char *fcnName = "contig_hs_dr_pio_test__run_test()";
#endif /* CONTIG_HS_DR_PIO_TEST__RUN_TEST__DEBUG */
- int mpi_rank;
- struct hs_dr_pio_test_vars_t test_vars =
+ int mpi_rank;
+ struct hs_dr_pio_test_vars_t test_vars =
{
- /* int mpi_size = */ -1,
+ /* int mpi_size = */ -1,
/* int mpi_rank = */ -1,
/* MPI_Comm mpi_comm = */ MPI_COMM_NULL,
/* MPI_Inf mpi_info = */ MPI_INFO_NULL,
@@ -2045,7 +2043,7 @@ contig_hs_dr_pio_test__run_test(const int test_num,
/* uint32_t * small_ds_buf_2 = */ NULL,
/* uint32_t * small_ds_slice_buf = */ NULL,
/* uint32_t * large_ds_buf_0 = */ NULL,
- /* uint32_t * large_ds_buf_1 = */ NULL,
+ /* uint32_t * large_ds_buf_1 = */ NULL,
/* uint32_t * large_ds_buf_2 = */ NULL,
/* uint32_t * large_ds_slice_buf = */ NULL,
/* int small_ds_offset = */ -1,
@@ -2082,8 +2080,8 @@ contig_hs_dr_pio_test__run_test(const int test_num,
/* hsize_t * stride_ptr = */ NULL,
/* hsize_t * count_ptr = */ NULL,
/* hsize_t * block_ptr = */ NULL,
- /* int skips = */ 0,
- /* int max_skips = */ 0,
+ /* int skips = */ 0,
+ /* int max_skips = */ 0,
/* int64_t total_tests = */ 0,
/* int64_t tests_run = */ 0,
/* int64_t tests_skipped = */ 0
@@ -2101,7 +2099,7 @@ contig_hs_dr_pio_test__run_test(const int test_num,
tv_ptr->skips = *skips_ptr;
tv_ptr->max_skips = max_skips;
-#if CONTIG_HS_DR_PIO_TEST__RUN_TEST__DEBUG
+#if CONTIG_HS_DR_PIO_TEST__RUN_TEST__DEBUG
if ( MAINPROCESS ) {
HDfprintf(stdout, "test %d: small rank = %d, large rank = %d.\n",
test_num, small_rank, large_rank);
@@ -2113,12 +2111,12 @@ contig_hs_dr_pio_test__run_test(const int test_num,
* of different rank that H5S_select_shape_same() views as being of the
* same shape.
*
- * Start by reading small_rank - 1 dimensional slice from the on disk
- * large cube, and verifying that the data read is correct. Verify that
+ * Start by reading small_rank - 1 dimensional slice from the on disk
+ * large cube, and verifying that the data read is correct. Verify that
* H5S_select_shape_same() returns true on the memory and file selections.
*/
-#if CONTIG_HS_DR_PIO_TEST__RUN_TEST__DEBUG
+#if CONTIG_HS_DR_PIO_TEST__RUN_TEST__DEBUG
if ( MAINPROCESS ) {
HDfprintf(stdout, "test %d: running contig_hs_dr_pio_test__d2m_l2s.\n", test_num);
}
@@ -2126,12 +2124,12 @@ contig_hs_dr_pio_test__run_test(const int test_num,
contig_hs_dr_pio_test__d2m_l2s(tv_ptr);
- /* Second, read slices of the on disk small data set into slices
- * through the in memory large data set, and verify that the correct
+ /* Second, read slices of the on disk small data set into slices
+ * through the in memory large data set, and verify that the correct
* data (and only the correct data) is read.
*/
-#if CONTIG_HS_DR_PIO_TEST__RUN_TEST__DEBUG
+#if CONTIG_HS_DR_PIO_TEST__RUN_TEST__DEBUG
if ( MAINPROCESS ) {
HDfprintf(stdout, "test %d: running contig_hs_dr_pio_test__d2m_s2l.\n", test_num);
}
@@ -2144,13 +2142,13 @@ contig_hs_dr_pio_test__run_test(const int test_num,
* H5S_select_shape_same() views as being of the same shape.
*
* Start by writing small_rank - 1 D slices from the in memory large data
- * set to the on disk small cube dataset. After each write, read the
- * slice of the small dataset back from disk, and verify that it contains
- * the expected data. Verify that H5S_select_shape_same() returns true on
+ * set to the on disk small cube dataset. After each write, read the
+ * slice of the small dataset back from disk, and verify that it contains
+ * the expected data. Verify that H5S_select_shape_same() returns true on
* the memory and file selections.
*/
-#if CONTIG_HS_DR_PIO_TEST__RUN_TEST__DEBUG
+#if CONTIG_HS_DR_PIO_TEST__RUN_TEST__DEBUG
if ( MAINPROCESS ) {
HDfprintf(stdout, "test %d: running contig_hs_dr_pio_test__m2d_l2s.\n", test_num);
}
@@ -2158,25 +2156,25 @@ contig_hs_dr_pio_test__run_test(const int test_num,
contig_hs_dr_pio_test__m2d_l2s(tv_ptr);
- /* Now write the contents of the process's slice of the in memory
- * small data set to slices of the on disk large data set. After
+ /* Now write the contents of the process's slice of the in memory
+ * small data set to slices of the on disk large data set. After
* each write, read the process's slice of the large data set back
- * into memory, and verify that it contains the expected data.
- * Verify that H5S_select_shape_same() returns true on the memory
+ * into memory, and verify that it contains the expected data.
+ * Verify that H5S_select_shape_same() returns true on the memory
* and file selections.
*/
-#if CONTIG_HS_DR_PIO_TEST__RUN_TEST__DEBUG
+#if CONTIG_HS_DR_PIO_TEST__RUN_TEST__DEBUG
if ( MAINPROCESS ) {
HDfprintf(stdout, "test %d: running contig_hs_dr_pio_test__m2d_s2l.\n", test_num);
}
#endif /* CONTIG_HS_DR_PIO_TEST__RUN_TEST__DEBUG */
contig_hs_dr_pio_test__m2d_s2l(tv_ptr);
-#if CONTIG_HS_DR_PIO_TEST__RUN_TEST__DEBUG
+#if CONTIG_HS_DR_PIO_TEST__RUN_TEST__DEBUG
if ( MAINPROCESS ) {
- HDfprintf(stdout,
- "test %d: Subtests complete -- tests run/skipped/total = %lld/%lld/%lld.\n",
+ HDfprintf(stdout,
+ "test %d: Subtests complete -- tests run/skipped/total = %lld/%lld/%lld.\n",
test_num, (long long)(tv_ptr->tests_run), (long long)(tv_ptr->tests_skipped),
(long long)(tv_ptr->total_tests));
}
@@ -2184,7 +2182,7 @@ contig_hs_dr_pio_test__run_test(const int test_num,
hs_dr_pio_test__takedown(tv_ptr);
-#if CONTIG_HS_DR_PIO_TEST__RUN_TEST__DEBUG
+#if CONTIG_HS_DR_PIO_TEST__RUN_TEST__DEBUG
if ( MAINPROCESS ) {
HDfprintf(stdout, "test %d: Takedown complete.\n", test_num);
}
@@ -2201,28 +2199,28 @@ contig_hs_dr_pio_test__run_test(const int test_num,
/*-------------------------------------------------------------------------
- * Function: contig_hs_dr_pio_test(ShapeSameTestMethods sstest_type)
+ * Function: contig_hs_dr_pio_test(ShapeSameTestMethods sstest_type)
*
- * Purpose: Test I/O to/from hyperslab selections of different rank in
- * the parallel case.
+ * Purpose: Test I/O to/from hyperslab selections of different rank in
+ * the parallel case.
*
- * Return: void
+ * Return: void
*
- * Programmer: JRM -- 9/18/09
+ * Programmer: JRM -- 9/18/09
*
* Modifications:
*
- * Modified function to take a sample of the run times
- * of the different tests, and skip some of them if
- * run times are too long.
+ * Modified function to take a sample of the run times
+ * of the different tests, and skip some of them if
+ * run times are too long.
*
- * We need to do this because Lustre runns very slowly
- * if two or more processes are banging on the same
- * block of memory.
- * JRM -- 9/10/10
+ * We need to do this because Lustre runns very slowly
+ * if two or more processes are banging on the same
+ * block of memory.
+ * JRM -- 9/10/10
* Break this one big test into 4 smaller tests according
* to {independent,collective}x{contigous,chunked} datasets.
- * AKC -- 2010/01/14
+ * AKC -- 2010/01/14
*
*-------------------------------------------------------------------------
*/
@@ -2236,23 +2234,23 @@ contig_hs_dr_pio_test(ShapeSameTestMethods sstest_type)
int local_express_test;
int mpi_rank = -1;
int mpi_size;
- int test_num = 0;
- int edge_size;
- int chunk_edge_size = 0;
- int small_rank;
- int large_rank;
- int mpi_result;
- int skips = 0;
- int max_skips = 0;
- /* The following table list the number of sub-tests skipped between
- * each test that is actually executed as a function of the express
+ int test_num = 0;
+ int edge_size;
+ int chunk_edge_size = 0;
+ int small_rank;
+ int large_rank;
+ int mpi_result;
+ int skips = 0;
+ int max_skips = 0;
+ /* The following table list the number of sub-tests skipped between
+ * each test that is actually executed as a function of the express
* test level. Note that any value in excess of 4880 will cause all
* sub tests to be skipped.
*/
int max_skips_tbl[4] = {0, 4, 64, 1024};
- hid_t dset_type = H5T_NATIVE_UINT;
- int64_t total_tests = 0;
- int64_t tests_run = 0;
+ hid_t dset_type = H5T_NATIVE_UINT;
+ int64_t total_tests = 0;
+ int64_t tests_run = 0;
int64_t tests_skipped = 0;
HDcompile_assert(sizeof(uint32_t) == sizeof(unsigned));
@@ -2295,7 +2293,7 @@ contig_hs_dr_pio_test(ShapeSameTestMethods sstest_type)
chunk_edge_size,
small_rank,
large_rank,
- FALSE,
+ FALSE,
dset_type,
express_test,
&skips,
@@ -2316,7 +2314,7 @@ contig_hs_dr_pio_test(ShapeSameTestMethods sstest_type)
chunk_edge_size,
small_rank,
large_rank,
- TRUE,
+ TRUE,
dset_type,
express_test,
&skips,
@@ -2337,7 +2335,7 @@ contig_hs_dr_pio_test(ShapeSameTestMethods sstest_type)
chunk_edge_size,
small_rank,
large_rank,
- FALSE,
+ FALSE,
dset_type,
express_test,
&skips,
@@ -2358,7 +2356,7 @@ contig_hs_dr_pio_test(ShapeSameTestMethods sstest_type)
chunk_edge_size,
small_rank,
large_rank,
- TRUE,
+ TRUE,
dset_type,
express_test,
&skips,
@@ -2377,7 +2375,7 @@ contig_hs_dr_pio_test(ShapeSameTestMethods sstest_type)
} /* end of switch(sstest_type) */
#if CONTIG_HS_DR_PIO_TEST__DEBUG
if ( ( MAINPROCESS ) && ( tests_skipped > 0 ) ) {
- HDfprintf(stdout, " run/skipped/total = %lld/%lld/%lld.\n",
+ HDfprintf(stdout, " run/skipped/total = %lld/%lld/%lld.\n",
tests_run, tests_skipped, total_tests);
}
#endif /* CONTIG_HS_DR_PIO_TEST__DEBUG */
@@ -2385,7 +2383,7 @@ contig_hs_dr_pio_test(ShapeSameTestMethods sstest_type)
}
if ( ( MAINPROCESS ) && ( tests_skipped > 0 ) ) {
- HDfprintf(stdout, " %lld of %lld subtests skipped to expedite testing.\n",
+ HDfprintf(stdout, " %lld of %lld subtests skipped to expedite testing.\n",
tests_skipped, total_tests);
}
@@ -2396,24 +2394,24 @@ contig_hs_dr_pio_test(ShapeSameTestMethods sstest_type)
/****************************************************************
**
-** ckrbrd_hs_dr_pio_test__slct_ckrbrd():
-** Given a data space of tgt_rank, and dimensions:
+** ckrbrd_hs_dr_pio_test__slct_ckrbrd():
+** Given a data space of tgt_rank, and dimensions:
**
-** (mpi_size + 1), edge_size, ... , edge_size
+** (mpi_size + 1), edge_size, ... , edge_size
**
-** edge_size, and a checker_edge_size, select a checker
-** board selection of a sel_rank (sel_rank < tgt_rank)
-** dimensional slice through the data space parallel to the
+** edge_size, and a checker_edge_size, select a checker
+** board selection of a sel_rank (sel_rank < tgt_rank)
+** dimensional slice through the data space parallel to the
** sel_rank fastest changing indicies, with origin (in the
-** higher indicies) as indicated by the start array.
+** higher indicies) as indicated by the start array.
**
-** Note that this function, like all its relatives, is
-** hard coded to presume a maximum data space rank of 5.
-** While this maximum is declared as a constant, increasing
-** it will require extensive coding in addition to changing
+** Note that this function, like all its relatives, is
+** hard coded to presume a maximum data space rank of 5.
+** While this maximum is declared as a constant, increasing
+** it will require extensive coding in addition to changing
** the value of the constant.
**
-** JRM -- 10/8/09
+** JRM -- 10/8/09
**
****************************************************************/
@@ -2428,22 +2426,22 @@ ckrbrd_hs_dr_pio_test__slct_ckrbrd(const int mpi_rank,
const int sel_rank,
hsize_t sel_start[])
{
-#if CKRBRD_HS_DR_PIO_TEST__SELECT_CHECKER_BOARD__DEBUG
- const char * fcnName = "ckrbrd_hs_dr_pio_test__slct_ckrbrd():";
-#endif
- hbool_t first_selection = TRUE;
+#if CKRBRD_HS_DR_PIO_TEST__SELECT_CHECKER_BOARD__DEBUG
+ const char * fcnName = "ckrbrd_hs_dr_pio_test__slct_ckrbrd():";
+#endif
+ hbool_t first_selection = TRUE;
int i, j, k, l, m;
- int n_cube_offset;
- int sel_offset;
- const int test_max_rank = PAR_SS_DR_MAX_RANK; /* must update code if */
+ int n_cube_offset;
+ int sel_offset;
+ const int test_max_rank = PAR_SS_DR_MAX_RANK; /* must update code if */
/* this changes */
- hsize_t base_count;
+ hsize_t base_count;
hsize_t offset_count;
- hsize_t start[PAR_SS_DR_MAX_RANK];
- hsize_t stride[PAR_SS_DR_MAX_RANK];
- hsize_t count[PAR_SS_DR_MAX_RANK];
- hsize_t block[PAR_SS_DR_MAX_RANK];
- herr_t ret; /* Generic return value */
+ hsize_t start[PAR_SS_DR_MAX_RANK];
+ hsize_t stride[PAR_SS_DR_MAX_RANK];
+ hsize_t count[PAR_SS_DR_MAX_RANK];
+ hsize_t block[PAR_SS_DR_MAX_RANK];
+ herr_t ret; /* Generic return value */
HDassert( edge_size >= 6 );
HDassert( 0 < checker_edge_size );
@@ -2460,14 +2458,14 @@ ckrbrd_hs_dr_pio_test__slct_ckrbrd(const int mpi_rank,
HDassert( n_cube_offset >= 0 );
HDassert( n_cube_offset <= sel_offset );
-#if CKRBRD_HS_DR_PIO_TEST__SELECT_CHECKER_BOARD__DEBUG
+#if CKRBRD_HS_DR_PIO_TEST__SELECT_CHECKER_BOARD__DEBUG
HDfprintf(stdout, "%s:%d: edge_size/checker_edge_size = %d/%d\n",
fcnName, mpi_rank, edge_size, checker_edge_size);
- HDfprintf(stdout, "%s:%d: sel_rank/sel_offset = %d/%d.\n",
+ HDfprintf(stdout, "%s:%d: sel_rank/sel_offset = %d/%d.\n",
fcnName, mpi_rank, sel_rank, sel_offset);
- HDfprintf(stdout, "%s:%d: tgt_rank/n_cube_offset = %d/%d.\n",
+ HDfprintf(stdout, "%s:%d: tgt_rank/n_cube_offset = %d/%d.\n",
fcnName, mpi_rank, tgt_rank, n_cube_offset);
-#endif /* CKRBRD_HS_DR_PIO_TEST__SELECT_CHECKER_BOARD__DEBUG */
+#endif /* CKRBRD_HS_DR_PIO_TEST__SELECT_CHECKER_BOARD__DEBUG */
/* First, compute the base count (which assumes start == 0
* for the associated offset) and offset_count (which
@@ -2497,7 +2495,7 @@ ckrbrd_hs_dr_pio_test__slct_ckrbrd(const int mpi_rank,
}
/* Now set up the stride and block arrays, and portions of the start
- * and count arrays that will not be altered during the selection of
+ * and count arrays that will not be altered during the selection of
* the checker board.
*/
i = 0;
@@ -2529,7 +2527,7 @@ ckrbrd_hs_dr_pio_test__slct_ckrbrd(const int mpi_rank,
i++;
}
-
+
i = 0;
do {
if ( 0 >= sel_offset ) {
@@ -2548,7 +2546,7 @@ ckrbrd_hs_dr_pio_test__slct_ckrbrd(const int mpi_rank,
}
j = 0;
- do {
+ do {
if ( 1 >= sel_offset ) {
if ( j == 0 ) {
@@ -2617,62 +2615,62 @@ ckrbrd_hs_dr_pio_test__slct_ckrbrd(const int mpi_rank,
if ( ((i + j + k + l + m) % 2) == 0 ) {
-#if CKRBRD_HS_DR_PIO_TEST__SELECT_CHECKER_BOARD__DEBUG
- HDfprintf(stdout, "%s%d: *** first_selection = %d ***\n",
+#if CKRBRD_HS_DR_PIO_TEST__SELECT_CHECKER_BOARD__DEBUG
+ HDfprintf(stdout, "%s%d: *** first_selection = %d ***\n",
fcnName, mpi_rank, (int)first_selection);
HDfprintf(stdout, "%s:%d: i/j/k/l/m = %d/%d/%d/%d/%d\n",
fcnName, mpi_rank, i, j, k, l, m);
- HDfprintf(stdout,
- "%s:%d: start = %d %d %d %d %d.\n",
- fcnName, mpi_rank, (int)start[0], (int)start[1],
+ HDfprintf(stdout,
+ "%s:%d: start = %d %d %d %d %d.\n",
+ fcnName, mpi_rank, (int)start[0], (int)start[1],
(int)start[2], (int)start[3], (int)start[4]);
- HDfprintf(stdout,
- "%s:%d: stride = %d %d %d %d %d.\n",
- fcnName, mpi_rank, (int)stride[0], (int)stride[1],
+ HDfprintf(stdout,
+ "%s:%d: stride = %d %d %d %d %d.\n",
+ fcnName, mpi_rank, (int)stride[0], (int)stride[1],
(int)stride[2], (int)stride[3], (int)stride[4]);
- HDfprintf(stdout,
- "%s:%d: count = %d %d %d %d %d.\n",
- fcnName, mpi_rank, (int)count[0], (int)count[1],
+ HDfprintf(stdout,
+ "%s:%d: count = %d %d %d %d %d.\n",
+ fcnName, mpi_rank, (int)count[0], (int)count[1],
(int)count[2], (int)count[3], (int)count[4]);
- HDfprintf(stdout,
- "%s:%d: block = %d %d %d %d %d.\n",
- fcnName, mpi_rank, (int)block[0], (int)block[1],
+ HDfprintf(stdout,
+ "%s:%d: block = %d %d %d %d %d.\n",
+ fcnName, mpi_rank, (int)block[0], (int)block[1],
(int)block[2], (int)block[3], (int)block[4]);
- HDfprintf(stdout, "%s:%d: n-cube extent dims = %d.\n",
+ HDfprintf(stdout, "%s:%d: n-cube extent dims = %d.\n",
fcnName, mpi_rank,
H5Sget_simple_extent_ndims(tgt_sid));
- HDfprintf(stdout, "%s:%d: selection rank = %d.\n",
+ HDfprintf(stdout, "%s:%d: selection rank = %d.\n",
fcnName, mpi_rank, sel_rank);
#endif
if ( first_selection ) {
- first_selection = FALSE;
+ first_selection = FALSE;
ret = H5Sselect_hyperslab
(
- tgt_sid,
+ tgt_sid,
H5S_SELECT_SET,
- &(start[n_cube_offset]),
- &(stride[n_cube_offset]),
- &(count[n_cube_offset]),
+ &(start[n_cube_offset]),
+ &(stride[n_cube_offset]),
+ &(count[n_cube_offset]),
&(block[n_cube_offset])
);
-
+
VRFY((ret != FAIL), "H5Sselect_hyperslab(SET) succeeded");
} else {
ret = H5Sselect_hyperslab
(
- tgt_sid,
+ tgt_sid,
H5S_SELECT_OR,
- &(start[n_cube_offset]),
- &(stride[n_cube_offset]),
- &(count[n_cube_offset]),
+ &(start[n_cube_offset]),
+ &(stride[n_cube_offset]),
+ &(count[n_cube_offset]),
&(block[n_cube_offset])
);
-
+
VRFY((ret != FAIL), "H5Sselect_hyperslab(OR) succeeded");
}
@@ -2704,7 +2702,7 @@ ckrbrd_hs_dr_pio_test__slct_ckrbrd(const int mpi_rank,
} while ( ( i <= 1 ) &&
( 0 >= sel_offset ) );
-#if CKRBRD_HS_DR_PIO_TEST__SELECT_CHECKER_BOARD__DEBUG
+#if CKRBRD_HS_DR_PIO_TEST__SELECT_CHECKER_BOARD__DEBUG
HDfprintf(stdout, "%s%d: H5Sget_select_npoints(tgt_sid) = %d.\n",
fcnName, mpi_rank, (int)H5Sget_select_npoints(tgt_sid));
#endif /* CKRBRD_HS_DR_PIO_TEST__SELECT_CHECKER_BOARD__DEBUG */
@@ -2724,7 +2722,7 @@ ckrbrd_hs_dr_pio_test__slct_ckrbrd(const int mpi_rank,
VRFY((ret != FAIL), "H5Sselect_hyperslab(AND) succeeded");
-#if CKRBRD_HS_DR_PIO_TEST__SELECT_CHECKER_BOARD__DEBUG
+#if CKRBRD_HS_DR_PIO_TEST__SELECT_CHECKER_BOARD__DEBUG
HDfprintf(stdout, "%s%d: H5Sget_select_npoints(tgt_sid) = %d.\n",
fcnName, mpi_rank, (int)H5Sget_select_npoints(tgt_sid));
HDfprintf(stdout, "%s%d: done.\n", fcnName, mpi_rank);
@@ -2737,57 +2735,57 @@ ckrbrd_hs_dr_pio_test__slct_ckrbrd(const int mpi_rank,
/****************************************************************
**
-** ckrbrd_hs_dr_pio_test__verify_data():
+** ckrbrd_hs_dr_pio_test__verify_data():
**
-** Examine the supplied buffer to see if it contains the
-** expected data. Return TRUE if it does, and FALSE
+** Examine the supplied buffer to see if it contains the
+** expected data. Return TRUE if it does, and FALSE
** otherwise.
**
-** The supplied buffer is presumed to this process's slice
-** of the target data set. Each such slice will be an
-** n-cube of rank (rank -1) and the supplied edge_size with
-** origin (mpi_rank, 0, ... , 0) in the target data set.
+** The supplied buffer is presumed to this process's slice
+** of the target data set. Each such slice will be an
+** n-cube of rank (rank -1) and the supplied edge_size with
+** origin (mpi_rank, 0, ... , 0) in the target data set.
**
-** Further, the buffer is presumed to be the result of reading
-** or writing a checker board selection of an m (1 <= m <
+** Further, the buffer is presumed to be the result of reading
+** or writing a checker board selection of an m (1 <= m <
** rank) dimensional slice through this processes slice
-** of the target data set. Also, this slice must be parallel
-** to the fastest changing indicies.
+** of the target data set. Also, this slice must be parallel
+** to the fastest changing indicies.
**
-** It is further presumed that the buffer was zeroed before
-** the read/write, and that the full target data set (i.e.
-** the buffer/data set for all processes) was initialized
-** with the natural numbers listed in order from the origin
-** along the fastest changing axis.
+** It is further presumed that the buffer was zeroed before
+** the read/write, and that the full target data set (i.e.
+** the buffer/data set for all processes) was initialized
+** with the natural numbers listed in order from the origin
+** along the fastest changing axis.
**
** Thus for a 20x10x10 dataset, the value stored in location
-** (x, y, z) (assuming that z is the fastest changing index
-** and x the slowest) is assumed to be:
+** (x, y, z) (assuming that z is the fastest changing index
+** and x the slowest) is assumed to be:
**
-** (10 * 10 * x) + (10 * y) + z
+** (10 * 10 * x) + (10 * y) + z
**
-** Further, supposing that this is process 10, this process's
-** slice of the dataset would be a 10 x 10 2-cube with origin
-** (10, 0, 0) in the data set, and would be initialize (prior
-** to the checkerboard selection) as follows:
+** Further, supposing that this is process 10, this process's
+** slice of the dataset would be a 10 x 10 2-cube with origin
+** (10, 0, 0) in the data set, and would be initialize (prior
+** to the checkerboard selection) as follows:
**
-** 1000, 1001, 1002, ... 1008, 1009
-** 1010, 1011, 1012, ... 1018, 1019
-** . . . . .
-** . . . . .
-** . . . . .
-** 1090, 1091, 1092, ... 1098, 1099
+** 1000, 1001, 1002, ... 1008, 1009
+** 1010, 1011, 1012, ... 1018, 1019
+** . . . . .
+** . . . . .
+** . . . . .
+** 1090, 1091, 1092, ... 1098, 1099
**
-** In the case of a read from the processors slice of another
-** data set of different rank, the values expected will have
-** to be adjusted accordingly. This is done via the
-** first_expected_val parameter.
+** In the case of a read from the processors slice of another
+** data set of different rank, the values expected will have
+** to be adjusted accordingly. This is done via the
+** first_expected_val parameter.
**
-** Finally, the function presumes that the first element
-** of the buffer resides either at the origin of either
-** a selected or an unselected checker. (Translation:
-** if partial checkers appear in the buffer, they will
-** intersect the edges of the n-cube oposite the origin.)
+** Finally, the function presumes that the first element
+** of the buffer resides either at the origin of either
+** a selected or an unselected checker. (Translation:
+** if partial checkers appear in the buffer, they will
+** intersect the edges of the n-cube oposite the origin.)
**
****************************************************************/
@@ -2802,7 +2800,7 @@ ckrbrd_hs_dr_pio_test__verify_data(uint32_t * buf_ptr,
hbool_t buf_starts_in_checker)
{
#if CKRBRD_HS_DR_PIO_TEST__VERIFY_DATA__DEBUG
- const char * fcnName = "ckrbrd_hs_dr_pio_test__verify_data():";
+ const char * fcnName = "ckrbrd_hs_dr_pio_test__verify_data():";
#endif
hbool_t good_data = TRUE;
hbool_t in_checker;
@@ -2821,9 +2819,9 @@ ckrbrd_hs_dr_pio_test__verify_data(uint32_t * buf_ptr,
HDassert( checker_edge_size <= edge_size );
HDassert( test_max_rank <= PAR_SS_DR_MAX_RANK );
-#if CKRBRD_HS_DR_PIO_TEST__VERIFY_DATA__DEBUG
+#if CKRBRD_HS_DR_PIO_TEST__VERIFY_DATA__DEBUG
- int mpi_rank;
+ int mpi_rank;
MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank);
HDfprintf(stdout, "%s mpi_rank = %d.\n", fcnName, mpi_rank);
@@ -2875,7 +2873,7 @@ ckrbrd_hs_dr_pio_test__verify_data(uint32_t * buf_ptr,
y = 0;
start_in_checker[3] = start_in_checker[2];
do
- {
+ {
if ( y >= checker_edge_size ) {
start_in_checker[3] = ! start_in_checker[3];
@@ -2884,13 +2882,13 @@ ckrbrd_hs_dr_pio_test__verify_data(uint32_t * buf_ptr,
m = 0;
z = 0;
-#if CKRBRD_HS_DR_PIO_TEST__VERIFY_DATA__DEBUG
+#if CKRBRD_HS_DR_PIO_TEST__VERIFY_DATA__DEBUG
HDfprintf(stdout, "%d, %d, %d, %d, %d:", i, j, k, l, m);
#endif
in_checker = start_in_checker[3];
do
{
-#if CKRBRD_HS_DR_PIO_TEST__VERIFY_DATA__DEBUG
+#if CKRBRD_HS_DR_PIO_TEST__VERIFY_DATA__DEBUG
HDfprintf(stdout, " %d", (int)(*val_ptr));
#endif
if ( z >= checker_edge_size ) {
@@ -2898,21 +2896,21 @@ ckrbrd_hs_dr_pio_test__verify_data(uint32_t * buf_ptr,
in_checker = ! in_checker;
z = 0;
}
-
+
if ( in_checker ) {
-
+
if ( *val_ptr != expected_value ) {
good_data = FALSE;
}
-
+
/* zero out buffer for re-use */
*val_ptr = 0;
} else if ( *val_ptr != 0 ) {
good_data = FALSE;
-
+
/* zero out buffer for re-use */
*val_ptr = 0;
@@ -2922,10 +2920,10 @@ ckrbrd_hs_dr_pio_test__verify_data(uint32_t * buf_ptr,
expected_value++;
m++;
z++;
-
+
} while ( ( rank >= (test_max_rank - 4) ) &&
( m < edge_size ) );
-#if CKRBRD_HS_DR_PIO_TEST__VERIFY_DATA__DEBUG
+#if CKRBRD_HS_DR_PIO_TEST__VERIFY_DATA__DEBUG
HDfprintf(stdout, "\n");
#endif
l++;
@@ -2951,28 +2949,28 @@ ckrbrd_hs_dr_pio_test__verify_data(uint32_t * buf_ptr,
/*-------------------------------------------------------------------------
- * Function: ckrbrd_hs_dr_pio_test__d2m_l2s()
+ * Function: ckrbrd_hs_dr_pio_test__d2m_l2s()
*
- * Purpose: Part one of a series of tests of I/O to/from hyperslab
- * selections of different rank in the parallel.
+ * Purpose: Part one of a series of tests of I/O to/from hyperslab
+ * selections of different rank in the parallel.
*
- * Verify that we can read from disk correctly using checker
- * board selections of different rank that
+ * Verify that we can read from disk correctly using checker
+ * board selections of different rank that
* H5S_select_shape_same() views as being of the same shape.
*
- * In this function, we test this by reading small_rank - 1
- * checker board slices from the on disk large cube, and
- * verifying that the data read is correct. Verify that
- * H5S_select_shape_same() returns true on the memory and
- * file selections.
+ * In this function, we test this by reading small_rank - 1
+ * checker board slices from the on disk large cube, and
+ * verifying that the data read is correct. Verify that
+ * H5S_select_shape_same() returns true on the memory and
+ * file selections.
*
- * Return: void
+ * Return: void
*
- * Programmer: JRM -- 9/15/11
+ * Programmer: JRM -- 9/15/11
*
* Modifications:
*
- * None.
+ * None.
*
*-------------------------------------------------------------------------
*/
@@ -2982,17 +2980,17 @@ ckrbrd_hs_dr_pio_test__verify_data(uint32_t * buf_ptr,
static void
ckrbrd_hs_dr_pio_test__d2m_l2s(struct hs_dr_pio_test_vars_t * tv_ptr)
{
-#if CHECKER_BOARD_HS_DR_PIO_TEST__D2M_L2S__DEBUG
+#if CHECKER_BOARD_HS_DR_PIO_TEST__D2M_L2S__DEBUG
const char *fcnName = "ckrbrd_hs_dr_pio_test__d2m_l2s()";
uint32_t * ptr_0;
#endif /* CHECKER_BOARD_HS_DR_PIO_TEST__D2M_L2S__DEBUG */
- hbool_t data_ok = FALSE;
- int i, j, k, l;
- uint32_t expected_value;
- int mpi_rank; /* needed by VRFY */
+ hbool_t data_ok = FALSE;
+ int i, j, k, l;
+ uint32_t expected_value;
+ int mpi_rank; /* needed by VRFY */
hsize_t sel_start[PAR_SS_DR_MAX_RANK];
htri_t check; /* Shape comparison return value */
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
/* initialize the local copy of mpi_rank */
mpi_rank = tv_ptr->mpi_rank;
@@ -3002,9 +3000,9 @@ ckrbrd_hs_dr_pio_test__d2m_l2s(struct hs_dr_pio_test_vars_t * tv_ptr)
* of different rank that H5S_select_shape_same() views as being of the
* same shape.
*
- * Start by reading a (small_rank - 1)-D checker board slice from this
- * processes slice of the on disk large data set, and verifying that the
- * data read is correct. Verify that H5S_select_shape_same() returns
+ * Start by reading a (small_rank - 1)-D checker board slice from this
+ * processes slice of the on disk large data set, and verifying that the
+ * data read is correct. Verify that H5S_select_shape_same() returns
* true on the memory and file selections.
*
* The first step is to set up the needed checker board selection in the
@@ -3025,7 +3023,7 @@ ckrbrd_hs_dr_pio_test__d2m_l2s(struct hs_dr_pio_test_vars_t * tv_ptr)
/* zero out the buffer we will be reading into */
HDmemset(tv_ptr->small_ds_slice_buf, 0, sizeof(uint32_t) * tv_ptr->small_ds_slice_size);
-#if CHECKER_BOARD_HS_DR_PIO_TEST__D2M_L2S__DEBUG
+#if CHECKER_BOARD_HS_DR_PIO_TEST__D2M_L2S__DEBUG
HDfprintf(stdout, "%s:%d: initial small_ds_slice_buf = ",
fcnName, tv_ptr->mpi_rank);
ptr_0 = tv_ptr->small_ds_slice_buf;
@@ -3034,7 +3032,7 @@ ckrbrd_hs_dr_pio_test__d2m_l2s(struct hs_dr_pio_test_vars_t * tv_ptr)
ptr_0++;
}
HDfprintf(stdout, "\n");
-#endif /* CHECKER_BOARD_HS_DR_PIO_TEST__D2M_L2S__DEBUG */
+#endif /* CHECKER_BOARD_HS_DR_PIO_TEST__D2M_L2S__DEBUG */
/* set up start, stride, count, and block -- note that we will
* change start[] so as to read slices of the large cube.
@@ -3054,15 +3052,15 @@ ckrbrd_hs_dr_pio_test__d2m_l2s(struct hs_dr_pio_test_vars_t * tv_ptr)
}
}
-#if CHECKER_BOARD_HS_DR_PIO_TEST__D2M_L2S__DEBUG
- HDfprintf(stdout,
+#if CHECKER_BOARD_HS_DR_PIO_TEST__D2M_L2S__DEBUG
+ HDfprintf(stdout,
"%s:%d: reading slice from big ds on disk into small ds slice.\n",
fcnName, tv_ptr->mpi_rank);
-#endif /* CHECKER_BOARD_HS_DR_PIO_TEST__D2M_L2S__DEBUG */
+#endif /* CHECKER_BOARD_HS_DR_PIO_TEST__D2M_L2S__DEBUG */
/* in serial versions of this test, we loop through all the dimensions
- * of the large data set. However, in the parallel version, each
+ * of the large data set. However, in the parallel version, each
* process only works with that slice of the large cube indicated
- * by its rank -- hence we set the most slowly changing index to
+ * by its rank -- hence we set the most slowly changing index to
* mpi_rank, and don't itterate over it.
*/
@@ -3075,9 +3073,9 @@ ckrbrd_hs_dr_pio_test__d2m_l2s(struct hs_dr_pio_test_vars_t * tv_ptr)
i = 0;
}
- /* since large_rank is at most PAR_SS_DR_MAX_RANK, no need to
+ /* since large_rank is at most PAR_SS_DR_MAX_RANK, no need to
* loop over it -- either we are setting i to mpi_rank, or
- * we are setting it to zero. It will not change during the
+ * we are setting it to zero. It will not change during the
* test.
*/
@@ -3101,7 +3099,7 @@ ckrbrd_hs_dr_pio_test__d2m_l2s(struct hs_dr_pio_test_vars_t * tv_ptr)
}
do {
- /* since small rank >= 2 and large_rank > small_rank, we
+ /* since small rank >= 2 and large_rank > small_rank, we
* have large_rank >= 3. Since PAR_SS_DR_MAX_RANK == 5
* (baring major re-orgaization), this gives us:
*
@@ -3121,8 +3119,8 @@ ckrbrd_hs_dr_pio_test__d2m_l2s(struct hs_dr_pio_test_vars_t * tv_ptr)
tv_ptr->skips = 0; /* reset the skips counter */
- /* we know that small_rank - 1 >= 1 and that
- * large_rank > small_rank by the assertions at the head
+ /* we know that small_rank - 1 >= 1 and that
+ * large_rank > small_rank by the assertions at the head
* of this function. Thus no need for another inner loop.
*/
tv_ptr->start[0] = (hsize_t)i;
@@ -3157,15 +3155,15 @@ ckrbrd_hs_dr_pio_test__d2m_l2s(struct hs_dr_pio_test_vars_t * tv_ptr)
/* Read selection from disk */
-#if CHECKER_BOARD_HS_DR_PIO_TEST__D2M_L2S__DEBUG
+#if CHECKER_BOARD_HS_DR_PIO_TEST__D2M_L2S__DEBUG
HDfprintf(stdout, "%s:%d: start = %d %d %d %d %d.\n", fcnName,
- tv_ptr->mpi_rank, tv_ptr->start[0], tv_ptr->start[1],
+ tv_ptr->mpi_rank, tv_ptr->start[0], tv_ptr->start[1],
tv_ptr->start[2], tv_ptr->start[3], tv_ptr->start[4]);
HDfprintf(stdout, "%s slice/file extent dims = %d/%d.\n",
fcnName,
H5Sget_simple_extent_ndims(tv_ptr->small_ds_slice_sid),
H5Sget_simple_extent_ndims(tv_ptr->file_large_ds_sid_0));
-#endif /* CHECKER_BOARD_HS_DR_PIO_TEST__D2M_L2S__DEBUG */
+#endif /* CHECKER_BOARD_HS_DR_PIO_TEST__D2M_L2S__DEBUG */
ret = H5Dread(tv_ptr->large_dataset,
H5T_NATIVE_UINT32,
@@ -3175,15 +3173,15 @@ ckrbrd_hs_dr_pio_test__d2m_l2s(struct hs_dr_pio_test_vars_t * tv_ptr)
tv_ptr->small_ds_slice_buf);
VRFY((ret >= 0), "H5Dread() slice from large ds succeeded.");
-#if CHECKER_BOARD_HS_DR_PIO_TEST__D2M_L2S__DEBUG
- HDfprintf(stdout, "%s:%d: H5Dread() returns.\n",
+#if CHECKER_BOARD_HS_DR_PIO_TEST__D2M_L2S__DEBUG
+ HDfprintf(stdout, "%s:%d: H5Dread() returns.\n",
fcnName, tv_ptr->mpi_rank);
#endif /* CHECKER_BOARD_HS_DR_PIO_TEST__D2M_L2S__DEBUG */
/* verify that expected data is retrieved */
expected_value = (uint32_t)
- ((i * tv_ptr->edge_size * tv_ptr->edge_size *
+ ((i * tv_ptr->edge_size * tv_ptr->edge_size *
tv_ptr->edge_size * tv_ptr->edge_size) +
(j * tv_ptr->edge_size * tv_ptr->edge_size * tv_ptr->edge_size) +
(k * tv_ptr->edge_size * tv_ptr->edge_size) +
@@ -3199,7 +3197,7 @@ ckrbrd_hs_dr_pio_test__d2m_l2s(struct hs_dr_pio_test_vars_t * tv_ptr)
(hbool_t)TRUE
);
- VRFY((data_ok == TRUE),
+ VRFY((data_ok == TRUE),
"small slice read from large ds data good.");
(tv_ptr->tests_run)++;
@@ -3227,27 +3225,27 @@ ckrbrd_hs_dr_pio_test__d2m_l2s(struct hs_dr_pio_test_vars_t * tv_ptr)
/*-------------------------------------------------------------------------
- * Function: ckrbrd_hs_dr_pio_test__d2m_s2l()
+ * Function: ckrbrd_hs_dr_pio_test__d2m_s2l()
*
- * Purpose: Part two of a series of tests of I/O to/from hyperslab
- * selections of different rank in the parallel.
+ * Purpose: Part two of a series of tests of I/O to/from hyperslab
+ * selections of different rank in the parallel.
*
- * Verify that we can read from disk correctly using
- * selections of different rank that H5S_select_shape_same()
- * views as being of the same shape.
+ * Verify that we can read from disk correctly using
+ * selections of different rank that H5S_select_shape_same()
+ * views as being of the same shape.
*
- * In this function, we test this by reading checker board
- * slices of the on disk small data set into slices through
- * the in memory large data set, and verify that the correct
- * data (and only the correct data) is read.
+ * In this function, we test this by reading checker board
+ * slices of the on disk small data set into slices through
+ * the in memory large data set, and verify that the correct
+ * data (and only the correct data) is read.
*
- * Return: void
+ * Return: void
*
- * Programmer: JRM -- 8/15/11
+ * Programmer: JRM -- 8/15/11
*
* Modifications:
*
- * None.
+ * None.
*
*-------------------------------------------------------------------------
*/
@@ -3257,27 +3255,27 @@ ckrbrd_hs_dr_pio_test__d2m_l2s(struct hs_dr_pio_test_vars_t * tv_ptr)
static void
ckrbrd_hs_dr_pio_test__d2m_s2l(struct hs_dr_pio_test_vars_t * tv_ptr)
{
-#if CHECKER_BOARD_HS_DR_PIO_TEST__D2M_S2L__DEBUG
+#if CHECKER_BOARD_HS_DR_PIO_TEST__D2M_S2L__DEBUG
const char *fcnName = "ckrbrd_hs_dr_pio_test__d2m_s2l()";
#endif /* CHECKER_BOARD_HS_DR_PIO_TEST__D2M_S2L__DEBUG */
- hbool_t data_ok = FALSE;
- int i, j, k, l;
+ hbool_t data_ok = FALSE;
+ int i, j, k, l;
size_t u;
size_t start_index;
size_t stop_index;
- uint32_t expected_value;
+ uint32_t expected_value;
uint32_t * ptr_1;
- int mpi_rank; /* needed by VRFY */
+ int mpi_rank; /* needed by VRFY */
hsize_t sel_start[PAR_SS_DR_MAX_RANK];
htri_t check; /* Shape comparison return value */
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
/* initialize the local copy of mpi_rank */
mpi_rank = tv_ptr->mpi_rank;
- /* similarly, read slices of the on disk small data set into slices
- * through the in memory large data set, and verify that the correct
+ /* similarly, read slices of the on disk small data set into slices
+ * through the in memory large data set, and verify that the correct
* data (and only the correct data) is read.
*/
@@ -3292,8 +3290,8 @@ ckrbrd_hs_dr_pio_test__d2m_s2l(struct hs_dr_pio_test_vars_t * tv_ptr)
tv_ptr->small_rank - 1,
sel_start);
-#if CHECKER_BOARD_HS_DR_PIO_TEST__D2M_S2L__DEBUG
- HDfprintf(stdout,
+#if CHECKER_BOARD_HS_DR_PIO_TEST__D2M_S2L__DEBUG
+ HDfprintf(stdout,
"%s reading slices of on disk small data set into slices of big data set.\n",
fcnName);
#endif /* CHECKER_BOARD_HS_DR_PIO_TEST__D2M_S2L__DEBUG */
@@ -3303,7 +3301,7 @@ ckrbrd_hs_dr_pio_test__d2m_s2l(struct hs_dr_pio_test_vars_t * tv_ptr)
/* set up start, stride, count, and block -- note that we will
* change start[] so as to read the slice of the small data set
- * into different slices of the process slice of the large data
+ * into different slices of the process slice of the large data
* set.
*/
for ( i = 0; i < PAR_SS_DR_MAX_RANK; i++ ) {
@@ -3322,11 +3320,11 @@ ckrbrd_hs_dr_pio_test__d2m_s2l(struct hs_dr_pio_test_vars_t * tv_ptr)
}
/* in serial versions of this test, we loop through all the dimensions
- * of the large data set that don't appear in the small data set.
+ * of the large data set that don't appear in the small data set.
*
- * However, in the parallel version, each process only works with that
- * slice of the large (and small) data set indicated by its rank -- hence
- * we set the most slowly changing index to mpi_rank, and don't itterate
+ * However, in the parallel version, each process only works with that
+ * slice of the large (and small) data set indicated by its rank -- hence
+ * we set the most slowly changing index to mpi_rank, and don't itterate
* over it.
*/
@@ -3340,9 +3338,9 @@ ckrbrd_hs_dr_pio_test__d2m_s2l(struct hs_dr_pio_test_vars_t * tv_ptr)
i = 0;
}
- /* since large_rank is at most PAR_SS_DR_MAX_RANK, no need to
+ /* since large_rank is at most PAR_SS_DR_MAX_RANK, no need to
* loop over it -- either we are setting i to mpi_rank, or
- * we are setting it to zero. It will not change during the
+ * we are setting it to zero. It will not change during the
* test.
*/
@@ -3366,7 +3364,7 @@ ckrbrd_hs_dr_pio_test__d2m_s2l(struct hs_dr_pio_test_vars_t * tv_ptr)
}
do {
- /* since small rank >= 2 and large_rank > small_rank, we
+ /* since small rank >= 2 and large_rank > small_rank, we
* have large_rank >= 3. Since PAR_SS_DR_MAX_RANK == 5
* (baring major re-orgaization), this gives us:
*
@@ -3423,11 +3421,11 @@ ckrbrd_hs_dr_pio_test__d2m_s2l(struct hs_dr_pio_test_vars_t * tv_ptr)
/* Read selection from disk */
-#if CHECKER_BOARD_HS_DR_PIO_TEST__D2M_S2L__DEBUG
- HDfprintf(stdout, "%s:%d: start = %d %d %d %d %d.\n",
- fcnName, tv_ptr->mpi_rank,
- tv_ptr->start[0], tv_ptr->start[1], tv_ptr->start[2],
- tv_ptr->start[3], tv_ptr->start[4]);
+#if CHECKER_BOARD_HS_DR_PIO_TEST__D2M_S2L__DEBUG
+ HDfprintf(stdout, "%s:%d: start = %d %d %d %d %d.\n",
+ fcnName, tv_ptr->mpi_rank,
+ tv_ptr->start[0], tv_ptr->start[1], tv_ptr->start[2],
+ tv_ptr->start[3], tv_ptr->start[4]);
HDfprintf(stdout, "%s:%d: mem/file extent dims = %d/%d.\n",
fcnName, tv_ptr->mpi_rank,
H5Sget_simple_extent_ndims(tv_ptr->large_ds_slice_sid),
@@ -3446,21 +3444,21 @@ ckrbrd_hs_dr_pio_test__d2m_s2l(struct hs_dr_pio_test_vars_t * tv_ptr)
*/
data_ok = TRUE;
ptr_1 = tv_ptr->large_ds_buf_1;
- expected_value =
+ expected_value =
(uint32_t)((size_t)(tv_ptr->mpi_rank) * tv_ptr->small_ds_slice_size);
start_index = (size_t)(
- (i * tv_ptr->edge_size * tv_ptr->edge_size *
+ (i * tv_ptr->edge_size * tv_ptr->edge_size *
tv_ptr->edge_size * tv_ptr->edge_size) +
(j * tv_ptr->edge_size * tv_ptr->edge_size * tv_ptr->edge_size) +
(k * tv_ptr->edge_size * tv_ptr->edge_size) +
(l * tv_ptr->edge_size));
stop_index = start_index + tv_ptr->small_ds_slice_size - 1;
-#if CHECKER_BOARD_HS_DR_PIO_TEST__D2M_S2L__DEBUG
+#if CHECKER_BOARD_HS_DR_PIO_TEST__D2M_S2L__DEBUG
{
int m, n;
- HDfprintf(stdout, "%s:%d: expected_value = %d.\n",
+ HDfprintf(stdout, "%s:%d: expected_value = %d.\n",
fcnName, tv_ptr->mpi_rank, expected_value);
HDfprintf(stdout, "%s:%d: start/stop index = %d/%d.\n",
fcnName, tv_ptr->mpi_rank, start_index, stop_index);
@@ -3495,7 +3493,7 @@ ckrbrd_hs_dr_pio_test__d2m_s2l(struct hs_dr_pio_test_vars_t * tv_ptr)
ptr_1++;
}
- VRFY((data_ok == TRUE),
+ VRFY((data_ok == TRUE),
"slice read from small to large ds data good(1).");
data_ok = ckrbrd_hs_dr_pio_test__verify_data
@@ -3508,7 +3506,7 @@ ckrbrd_hs_dr_pio_test__d2m_s2l(struct hs_dr_pio_test_vars_t * tv_ptr)
(hbool_t)TRUE
);
- VRFY((data_ok == TRUE),
+ VRFY((data_ok == TRUE),
"slice read from small to large ds data good(2).");
@@ -3527,7 +3525,7 @@ ckrbrd_hs_dr_pio_test__d2m_s2l(struct hs_dr_pio_test_vars_t * tv_ptr)
ptr_1++;
}
- VRFY((data_ok == TRUE),
+ VRFY((data_ok == TRUE),
"slice read from small to large ds data good(3).");
(tv_ptr->tests_run)++;
@@ -3555,31 +3553,31 @@ ckrbrd_hs_dr_pio_test__d2m_s2l(struct hs_dr_pio_test_vars_t * tv_ptr)
/*-------------------------------------------------------------------------
- * Function: ckrbrd_hs_dr_pio_test__m2d_l2s()
+ * Function: ckrbrd_hs_dr_pio_test__m2d_l2s()
*
- * Purpose: Part three of a series of tests of I/O to/from checker
- * board hyperslab selections of different rank in the
- * parallel.
+ * Purpose: Part three of a series of tests of I/O to/from checker
+ * board hyperslab selections of different rank in the
+ * parallel.
*
- * Verify that we can write from memory to file using checker
- * board selections of different rank that
- * H5S_select_shape_same() views as being of the same shape.
+ * Verify that we can write from memory to file using checker
+ * board selections of different rank that
+ * H5S_select_shape_same() views as being of the same shape.
*
- * Do this by writing small_rank - 1 dimensional checker
- * board slices from the in memory large data set to the on
- * disk small cube dataset. After each write, read the
- * slice of the small dataset back from disk, and verify
- * that it contains the expected data. Verify that
- * H5S_select_shape_same() returns true on the memory and
- * file selections.
+ * Do this by writing small_rank - 1 dimensional checker
+ * board slices from the in memory large data set to the on
+ * disk small cube dataset. After each write, read the
+ * slice of the small dataset back from disk, and verify
+ * that it contains the expected data. Verify that
+ * H5S_select_shape_same() returns true on the memory and
+ * file selections.
*
- * Return: void
+ * Return: void
*
- * Programmer: JRM -- 8/15/11
+ * Programmer: JRM -- 8/15/11
*
* Modifications:
*
- * None.
+ * None.
*
*-------------------------------------------------------------------------
*/
@@ -3589,21 +3587,21 @@ ckrbrd_hs_dr_pio_test__d2m_s2l(struct hs_dr_pio_test_vars_t * tv_ptr)
static void
ckrbrd_hs_dr_pio_test__m2d_l2s(struct hs_dr_pio_test_vars_t * tv_ptr)
{
-#if CHECKER_BOARD_HS_DR_PIO_TEST__M2D_L2S__DEBUG
+#if CHECKER_BOARD_HS_DR_PIO_TEST__M2D_L2S__DEBUG
const char *fcnName = "ckrbrd_hs_dr_pio_test__m2d_l2s()";
#endif /* CHECKER_BOARD_HS_DR_PIO_TEST__M2D_L2S__DEBUG */
- hbool_t data_ok = FALSE;
- hbool_t mis_match = FALSE;
- int i, j, k, l;
+ hbool_t data_ok = FALSE;
+ hbool_t mis_match = FALSE;
+ int i, j, k, l;
size_t u;
size_t start_index;
size_t stop_index;
- uint32_t expected_value;
+ uint32_t expected_value;
uint32_t * ptr_1;
- int mpi_rank; /* needed by VRFY */
+ int mpi_rank; /* needed by VRFY */
hsize_t sel_start[PAR_SS_DR_MAX_RANK];
htri_t check; /* Shape comparison return value */
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
/* initialize the local copy of mpi_rank */
mpi_rank = tv_ptr->mpi_rank;
@@ -3614,9 +3612,9 @@ ckrbrd_hs_dr_pio_test__m2d_l2s(struct hs_dr_pio_test_vars_t * tv_ptr)
* H5S_select_shape_same() views as being of the same shape.
*
* Start by writing small_rank - 1 D slices from the in memory large data
- * set to the on disk small dataset. After each write, read the slice of
- * the small dataset back from disk, and verify that it contains the
- * expected data. Verify that H5S_select_shape_same() returns true on
+ * set to the on disk small dataset. After each write, read the slice of
+ * the small dataset back from disk, and verify that it contains the
+ * expected data. Verify that H5S_select_shape_same() returns true on
* the memory and file selections.
*/
@@ -3684,18 +3682,18 @@ ckrbrd_hs_dr_pio_test__m2d_l2s(struct hs_dr_pio_test_vars_t * tv_ptr)
HDmemset(tv_ptr->small_ds_buf_1, 0, sizeof(uint32_t) * tv_ptr->small_ds_size);
-#if CHECKER_BOARD_HS_DR_PIO_TEST__M2D_L2S__DEBUG
- HDfprintf(stdout,
+#if CHECKER_BOARD_HS_DR_PIO_TEST__M2D_L2S__DEBUG
+ HDfprintf(stdout,
"%s writing checker boards selections of slices from big ds to slices of small ds on disk.\n",
fcnName);
#endif /* CHECKER_BOARD_HS_DR_PIO_TEST__M2D_L2S__DEBUG */
/* in serial versions of this test, we loop through all the dimensions
- * of the large data set that don't appear in the small data set.
+ * of the large data set that don't appear in the small data set.
*
- * However, in the parallel version, each process only works with that
- * slice of the large (and small) data set indicated by its rank -- hence
- * we set the most slowly changing index to mpi_rank, and don't itterate
+ * However, in the parallel version, each process only works with that
+ * slice of the large (and small) data set indicated by its rank -- hence
+ * we set the most slowly changing index to mpi_rank, and don't itterate
* over it.
*/
@@ -3709,9 +3707,9 @@ ckrbrd_hs_dr_pio_test__m2d_l2s(struct hs_dr_pio_test_vars_t * tv_ptr)
i = 0;
}
- /* since large_rank is at most PAR_SS_DR_MAX_RANK, no need to
+ /* since large_rank is at most PAR_SS_DR_MAX_RANK, no need to
* loop over it -- either we are setting i to mpi_rank, or
- * we are setting it to zero. It will not change during the
+ * we are setting it to zero. It will not change during the
* test.
*/
@@ -3736,7 +3734,7 @@ ckrbrd_hs_dr_pio_test__m2d_l2s(struct hs_dr_pio_test_vars_t * tv_ptr)
}
do {
- /* since small rank >= 2 and large_rank > small_rank, we
+ /* since small rank >= 2 and large_rank > small_rank, we
* have large_rank >= 3. Since PAR_SS_DR_MAX_RANK == 5
* (baring major re-orgaization), this gives us:
*
@@ -3760,7 +3758,7 @@ ckrbrd_hs_dr_pio_test__m2d_l2s(struct hs_dr_pio_test_vars_t * tv_ptr)
* by the assertions at the head of this function. Thus no
* need for another inner loop.
*/
-
+
/* zero out this rank's slice of the on disk small data set */
ret = H5Dwrite(tv_ptr->small_dataset,
H5T_NATIVE_UINT32,
@@ -3769,7 +3767,7 @@ ckrbrd_hs_dr_pio_test__m2d_l2s(struct hs_dr_pio_test_vars_t * tv_ptr)
tv_ptr->xfer_plist,
tv_ptr->small_ds_buf_2);
VRFY((ret >= 0), "H5Dwrite() zero slice to small ds succeeded.");
-
+
/* select the portion of the in memory large cube from which we
* are going to write data.
*/
@@ -3778,13 +3776,13 @@ ckrbrd_hs_dr_pio_test__m2d_l2s(struct hs_dr_pio_test_vars_t * tv_ptr)
tv_ptr->start[2] = (hsize_t)k;
tv_ptr->start[3] = (hsize_t)l;
tv_ptr->start[4] = 0;
-
+
HDassert((tv_ptr->start[0] == 0)||(0 < tv_ptr->small_ds_offset + 1));
HDassert((tv_ptr->start[1] == 0)||(1 < tv_ptr->small_ds_offset + 1));
HDassert((tv_ptr->start[2] == 0)||(2 < tv_ptr->small_ds_offset + 1));
HDassert((tv_ptr->start[3] == 0)||(3 < tv_ptr->small_ds_offset + 1));
HDassert((tv_ptr->start[4] == 0)||(4 < tv_ptr->small_ds_offset + 1));
-
+
ckrbrd_hs_dr_pio_test__slct_ckrbrd
(
tv_ptr->mpi_rank,
@@ -3795,26 +3793,26 @@ ckrbrd_hs_dr_pio_test__m2d_l2s(struct hs_dr_pio_test_vars_t * tv_ptr)
tv_ptr->small_rank - 1,
tv_ptr->start
);
-
-
+
+
/* verify that H5S_select_shape_same() reports the in
- * memory checkerboard selection of the slice through the
+ * memory checkerboard selection of the slice through the
* large dataset and the checkerboard selection of the process
* slice of the small data set as having the same shape.
*/
check = H5S_select_shape_same_test(tv_ptr->file_small_ds_sid_1,
tv_ptr->mem_large_ds_sid);
VRFY((check == TRUE), "H5S_select_shape_same_test passed.");
-
-
- /* write the checker board selection of the slice from the in
- * memory large data set to the slice of the on disk small
- * dataset.
+
+
+ /* write the checker board selection of the slice from the in
+ * memory large data set to the slice of the on disk small
+ * dataset.
*/
-#if CHECKER_BOARD_HS_DR_PIO_TEST__M2D_L2S__DEBUG
- HDfprintf(stdout, "%s:%d: start = %d %d %d %d %d.\n",
+#if CHECKER_BOARD_HS_DR_PIO_TEST__M2D_L2S__DEBUG
+ HDfprintf(stdout, "%s:%d: start = %d %d %d %d %d.\n",
fcnName, tv_ptr->mpi_rank,
- tv_ptr->start[0], tv_ptr->start[1], tv_ptr->start[2],
+ tv_ptr->start[0], tv_ptr->start[1], tv_ptr->start[2],
tv_ptr->start[3], tv_ptr->start[4]);
HDfprintf(stdout, "%s:%d: mem/file extent dims = %d/%d.\n",
fcnName, tv_ptr->mpi_rank,
@@ -3828,8 +3826,8 @@ ckrbrd_hs_dr_pio_test__m2d_l2s(struct hs_dr_pio_test_vars_t * tv_ptr)
tv_ptr->xfer_plist,
tv_ptr->large_ds_buf_0);
VRFY((ret >= 0), "H5Dwrite() slice to large ds succeeded.");
-
-
+
+
/* read the on disk process slice of the small dataset into memory */
ret = H5Dread(tv_ptr->small_dataset,
H5T_NATIVE_UINT32,
@@ -3838,30 +3836,30 @@ ckrbrd_hs_dr_pio_test__m2d_l2s(struct hs_dr_pio_test_vars_t * tv_ptr)
tv_ptr->xfer_plist,
tv_ptr->small_ds_buf_1);
VRFY((ret >= 0), "H5Dread() slice from small ds succeeded.");
-
-
+
+
/* verify that expected data is retrieved */
-
+
mis_match = FALSE;
-
+
expected_value = (uint32_t)(
- (i * tv_ptr->edge_size * tv_ptr->edge_size *
+ (i * tv_ptr->edge_size * tv_ptr->edge_size *
tv_ptr->edge_size * tv_ptr->edge_size) +
(j * tv_ptr->edge_size * tv_ptr->edge_size * tv_ptr->edge_size) +
(k * tv_ptr->edge_size * tv_ptr->edge_size) +
(l * tv_ptr->edge_size));
-
+
start_index = (size_t)(tv_ptr->mpi_rank) * tv_ptr->small_ds_slice_size;
stop_index = start_index + tv_ptr->small_ds_slice_size - 1;
-
+
HDassert( start_index < stop_index );
HDassert( stop_index <= tv_ptr->small_ds_size );
-
+
data_ok = TRUE;
-
+
ptr_1 = tv_ptr->small_ds_buf_1;
for ( u = 0; u < start_index; u++, ptr_1++ ) {
-
+
if ( *ptr_1 != 0 ) {
data_ok = FALSE;
@@ -3890,7 +3888,7 @@ ckrbrd_hs_dr_pio_test__m2d_l2s(struct hs_dr_pio_test_vars_t * tv_ptr)
}
}
- VRFY((data_ok == TRUE),
+ VRFY((data_ok == TRUE),
"large slice write slice to small slice data good.");
(tv_ptr->tests_run)++;
@@ -3918,31 +3916,31 @@ ckrbrd_hs_dr_pio_test__m2d_l2s(struct hs_dr_pio_test_vars_t * tv_ptr)
/*-------------------------------------------------------------------------
- * Function: ckrbrd_hs_dr_pio_test__m2d_s2l()
+ * Function: ckrbrd_hs_dr_pio_test__m2d_s2l()
*
- * Purpose: Part four of a series of tests of I/O to/from checker
- * board hyperslab selections of different rank in the parallel.
+ * Purpose: Part four of a series of tests of I/O to/from checker
+ * board hyperslab selections of different rank in the parallel.
*
- * Verify that we can write from memory to file using
- * selections of different rank that H5S_select_shape_same()
- * views as being of the same shape.
+ * Verify that we can write from memory to file using
+ * selections of different rank that H5S_select_shape_same()
+ * views as being of the same shape.
*
- * Do this by writing checker board selections of the contents
- * of the process's slice of the in memory small data set to
- * slices of the on disk large data set. After each write,
- * read the process's slice of the large data set back into
- * memory, and verify that it contains the expected data.
+ * Do this by writing checker board selections of the contents
+ * of the process's slice of the in memory small data set to
+ * slices of the on disk large data set. After each write,
+ * read the process's slice of the large data set back into
+ * memory, and verify that it contains the expected data.
*
- * Verify that H5S_select_shape_same() returns true on the
- * memory and file selections.
+ * Verify that H5S_select_shape_same() returns true on the
+ * memory and file selections.
*
- * Return: void
+ * Return: void
*
- * Programmer: JRM -- 8/15/11
+ * Programmer: JRM -- 8/15/11
*
* Modifications:
*
- * None
+ * None
*
*-------------------------------------------------------------------------
*/
@@ -3952,31 +3950,31 @@ ckrbrd_hs_dr_pio_test__m2d_l2s(struct hs_dr_pio_test_vars_t * tv_ptr)
static void
ckrbrd_hs_dr_pio_test__m2d_s2l(struct hs_dr_pio_test_vars_t * tv_ptr)
{
-#if CHECKER_BOARD_HS_DR_PIO_TEST__M2D_S2L__DEBUG
+#if CHECKER_BOARD_HS_DR_PIO_TEST__M2D_S2L__DEBUG
const char *fcnName = "ckrbrd_hs_dr_pio_test__m2d_s2l()";
#endif /* CONTIG_HS_DR_PIO_TEST__M2D_S2L__DEBUG */
- hbool_t data_ok = FALSE;
- hbool_t mis_match = FALSE;
- int i, j, k, l;
+ hbool_t data_ok = FALSE;
+ hbool_t mis_match = FALSE;
+ int i, j, k, l;
size_t u;
size_t start_index;
size_t stop_index;
- uint32_t expected_value;
+ uint32_t expected_value;
uint32_t * ptr_1;
- int mpi_rank; /* needed by VRFY */
+ int mpi_rank; /* needed by VRFY */
hsize_t sel_start[PAR_SS_DR_MAX_RANK];
htri_t check; /* Shape comparison return value */
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
/* initialize the local copy of mpi_rank */
mpi_rank = tv_ptr->mpi_rank;
- /* Now write the contents of the process's slice of the in memory
- * small data set to slices of the on disk large data set. After
+ /* Now write the contents of the process's slice of the in memory
+ * small data set to slices of the on disk large data set. After
* each write, read the process's slice of the large data set back
- * into memory, and verify that it contains the expected data.
- * Verify that H5S_select_shape_same() returns true on the memory
+ * into memory, and verify that it contains the expected data.
+ * Verify that H5S_select_shape_same() returns true on the memory
* and file selections.
*/
@@ -4009,7 +4007,7 @@ ckrbrd_hs_dr_pio_test__m2d_s2l(struct hs_dr_pio_test_vars_t * tv_ptr)
tv_ptr->block);
VRFY((ret >= 0), "H5Sselect_hyperslab(tv_ptr->mem_large_ds_sid, set) suceeded");
- /* setup a checkerboard selection of the slice of the in memory small
+ /* setup a checkerboard selection of the slice of the in memory small
* data set associated with the process's mpi rank.
*/
@@ -4025,7 +4023,7 @@ ckrbrd_hs_dr_pio_test__m2d_s2l(struct hs_dr_pio_test_vars_t * tv_ptr)
sel_start);
/* set up start, stride, count, and block -- note that we will
- * change start[] so as to write checkerboard selections of slices
+ * change start[] so as to write checkerboard selections of slices
* of the small data set to slices of the large data set.
*/
for ( i = 0; i < PAR_SS_DR_MAX_RANK; i++ ) {
@@ -4047,7 +4045,7 @@ ckrbrd_hs_dr_pio_test__m2d_s2l(struct hs_dr_pio_test_vars_t * tv_ptr)
HDmemset(tv_ptr->large_ds_buf_1, 0, sizeof(uint32_t) * tv_ptr->large_ds_size);
#if CHECKER_BOARD_HS_DR_PIO_TEST__M2D_S2L__DEBUG
- HDfprintf(stdout,
+ HDfprintf(stdout,
"%s writing process checkerboard selections of slices of small ds to process slices of large ds on disk.\n",
fcnName);
#endif /* CHECKER_BOARD_HS_DR_PIO_TEST__M2D_S2L__DEBUG */
@@ -4061,9 +4059,9 @@ ckrbrd_hs_dr_pio_test__m2d_s2l(struct hs_dr_pio_test_vars_t * tv_ptr)
i = 0;
}
- /* since large_rank is at most PAR_SS_DR_MAX_RANK, no need to
+ /* since large_rank is at most PAR_SS_DR_MAX_RANK, no need to
* loop over it -- either we are setting i to mpi_rank, or
- * we are setting it to zero. It will not change during the
+ * we are setting it to zero. It will not change during the
* test.
*/
@@ -4087,7 +4085,7 @@ ckrbrd_hs_dr_pio_test__m2d_s2l(struct hs_dr_pio_test_vars_t * tv_ptr)
}
do {
- /* since small rank >= 2 and large_rank > small_rank, we
+ /* since small rank >= 2 and large_rank > small_rank, we
* have large_rank >= 3. Since PAR_SS_DR_MAX_RANK == 5
* (baring major re-orgaization), this gives us:
*
@@ -4162,13 +4160,13 @@ ckrbrd_hs_dr_pio_test__m2d_s2l(struct hs_dr_pio_test_vars_t * tv_ptr)
VRFY((check == TRUE), "H5S_select_shape_same_test passed");
- /* write the small data set slice from memory to the
- * target slice of the disk data set
+ /* write the small data set slice from memory to the
+ * target slice of the disk data set
*/
-#if CHECKER_BOARD_HS_DR_PIO_TEST__M2D_S2L__DEBUG
- HDfprintf(stdout, "%s:%d: start = %d %d %d %d %d.\n",
+#if CHECKER_BOARD_HS_DR_PIO_TEST__M2D_S2L__DEBUG
+ HDfprintf(stdout, "%s:%d: start = %d %d %d %d %d.\n",
fcnName, tv_ptr->mpi_rank,
- tv_ptr->start[0], tv_ptr->start[1], tv_ptr->start[2],
+ tv_ptr->start[0], tv_ptr->start[1], tv_ptr->start[2],
tv_ptr->start[3], tv_ptr->start[4]);
HDfprintf(stdout, "%s:%d: mem/file extent dims = %d/%d.\n",
fcnName, tv_ptr->mpi_rank,
@@ -4181,11 +4179,11 @@ ckrbrd_hs_dr_pio_test__m2d_s2l(struct hs_dr_pio_test_vars_t * tv_ptr)
tv_ptr->file_large_ds_sid_1,
tv_ptr->xfer_plist,
tv_ptr->small_ds_buf_0);
- VRFY((ret != FAIL),
+ VRFY((ret != FAIL),
"H5Dwrite of small ds slice to large ds succeeded");
- /* read this processes slice on the on disk large
+ /* read this processes slice on the on disk large
* data set into memory.
*/
@@ -4195,18 +4193,18 @@ ckrbrd_hs_dr_pio_test__m2d_s2l(struct hs_dr_pio_test_vars_t * tv_ptr)
tv_ptr->file_large_ds_sid_0,
tv_ptr->xfer_plist,
tv_ptr->large_ds_buf_1);
- VRFY((ret != FAIL),
+ VRFY((ret != FAIL),
"H5Dread() of process slice of large ds succeeded");
/* verify that the expected data and only the
* expected data was read.
*/
- expected_value =
+ expected_value =
(uint32_t)((size_t)(tv_ptr->mpi_rank) * tv_ptr->small_ds_slice_size);
start_index = (size_t)
- ((i * tv_ptr->edge_size * tv_ptr->edge_size *
+ ((i * tv_ptr->edge_size * tv_ptr->edge_size *
tv_ptr->edge_size * tv_ptr->edge_size) +
(j * tv_ptr->edge_size * tv_ptr->edge_size * tv_ptr->edge_size) +
(k * tv_ptr->edge_size * tv_ptr->edge_size) +
@@ -4252,7 +4250,7 @@ ckrbrd_hs_dr_pio_test__m2d_s2l(struct hs_dr_pio_test_vars_t * tv_ptr)
}
}
- VRFY((data_ok == TRUE),
+ VRFY((data_ok == TRUE),
"small ds cb slice write to large ds slice data good.");
(tv_ptr->tests_run)++;
@@ -4280,22 +4278,22 @@ ckrbrd_hs_dr_pio_test__m2d_s2l(struct hs_dr_pio_test_vars_t * tv_ptr)
/*-------------------------------------------------------------------------
- * Function: ckrbrd_hs_dr_pio_test__run_test()
+ * Function: ckrbrd_hs_dr_pio_test__run_test()
*
- * Purpose: Test I/O to/from checkerboard selections of hyperslabs of
- * different rank in the parallel.
+ * Purpose: Test I/O to/from checkerboard selections of hyperslabs of
+ * different rank in the parallel.
*
- * Return: void
+ * Return: void
*
- * Programmer: JRM -- 10/10/09
+ * Programmer: JRM -- 10/10/09
*
* Modifications:
*
- * JRM -- 9/16/10
- * Added the express_test parameter. Use it to control
- * whether we set an alignment, and whether we allocate
- * chunks such that no two processes will normally touch
- * the same chunk.
+ * JRM -- 9/16/10
+ * Added the express_test parameter. Use it to control
+ * whether we set an alignment, and whether we allocate
+ * chunks such that no two processes will normally touch
+ * the same chunk.
*
*-------------------------------------------------------------------------
*/
@@ -4322,10 +4320,10 @@ ckrbrd_hs_dr_pio_test__run_test(const int test_num,
#if CKRBRD_HS_DR_PIO_TEST__RUN_TEST__DEBUG
const char *fcnName = "ckrbrd_hs_dr_pio_test__run_test()";
#endif /* CKRBRD_HS_DR_PIO_TEST__RUN_TEST__DEBUG */
- int mpi_rank; /* needed by VRFY */
- struct hs_dr_pio_test_vars_t test_vars =
+ int mpi_rank; /* needed by VRFY */
+ struct hs_dr_pio_test_vars_t test_vars =
{
- /* int mpi_size = */ -1,
+ /* int mpi_size = */ -1,
/* int mpi_rank = */ -1,
/* MPI_Comm mpi_comm = */ MPI_COMM_NULL,
/* MPI_Inf mpi_info = */ MPI_INFO_NULL,
@@ -4341,7 +4339,7 @@ ckrbrd_hs_dr_pio_test__run_test(const int test_num,
/* uint32_t * small_ds_buf_2 = */ NULL,
/* uint32_t * small_ds_slice_buf = */ NULL,
/* uint32_t * large_ds_buf_0 = */ NULL,
- /* uint32_t * large_ds_buf_1 = */ NULL,
+ /* uint32_t * large_ds_buf_1 = */ NULL,
/* uint32_t * large_ds_buf_2 = */ NULL,
/* uint32_t * large_ds_slice_buf = */ NULL,
/* int small_ds_offset = */ -1,
@@ -4378,17 +4376,17 @@ ckrbrd_hs_dr_pio_test__run_test(const int test_num,
/* hsize_t * stride_ptr = */ NULL,
/* hsize_t * count_ptr = */ NULL,
/* hsize_t * block_ptr = */ NULL,
- /* int skips = */ 0,
- /* int max_skips = */ 0,
+ /* int skips = */ 0,
+ /* int max_skips = */ 0,
/* int64_t total_tests = */ 0,
/* int64_t tests_run = */ 0,
/* int64_t tests_skipped = */ 0
};
struct hs_dr_pio_test_vars_t * tv_ptr = &test_vars;
- hs_dr_pio_test__setup(test_num, edge_size, checker_edge_size,
- chunk_edge_size, small_rank, large_rank,
- use_collective_io, dset_type, express_test,
+ hs_dr_pio_test__setup(test_num, edge_size, checker_edge_size,
+ chunk_edge_size, small_rank, large_rank,
+ use_collective_io, dset_type, express_test,
tv_ptr);
@@ -4414,9 +4412,9 @@ ckrbrd_hs_dr_pio_test__run_test(const int test_num,
* of different rank that H5S_select_shape_same() views as being of the
* same shape.
*
- * Start by reading a (small_rank - 1)-D slice from this processes slice
- * of the on disk large data set, and verifying that the data read is
- * correct. Verify that H5S_select_shape_same() returns true on the
+ * Start by reading a (small_rank - 1)-D slice from this processes slice
+ * of the on disk large data set, and verifying that the data read is
+ * correct. Verify that H5S_select_shape_same() returns true on the
* memory and file selections.
*
* The first step is to set up the needed checker board selection in the
@@ -4426,8 +4424,8 @@ ckrbrd_hs_dr_pio_test__run_test(const int test_num,
ckrbrd_hs_dr_pio_test__d2m_l2s(tv_ptr);
- /* similarly, read slices of the on disk small data set into slices
- * through the in memory large data set, and verify that the correct
+ /* similarly, read slices of the on disk small data set into slices
+ * through the in memory large data set, and verify that the correct
* data (and only the correct data) is read.
*/
@@ -4439,20 +4437,20 @@ ckrbrd_hs_dr_pio_test__run_test(const int test_num,
* H5S_select_shape_same() views as being of the same shape.
*
* Start by writing small_rank - 1 D slices from the in memory large data
- * set to the on disk small dataset. After each write, read the slice of
- * the small dataset back from disk, and verify that it contains the
- * expected data. Verify that H5S_select_shape_same() returns true on
+ * set to the on disk small dataset. After each write, read the slice of
+ * the small dataset back from disk, and verify that it contains the
+ * expected data. Verify that H5S_select_shape_same() returns true on
* the memory and file selections.
*/
ckrbrd_hs_dr_pio_test__m2d_l2s(tv_ptr);
- /* Now write the contents of the process's slice of the in memory
- * small data set to slices of the on disk large data set. After
+ /* Now write the contents of the process's slice of the in memory
+ * small data set to slices of the on disk large data set. After
* each write, read the process's slice of the large data set back
- * into memory, and verify that it contains the expected data.
- * Verify that H5S_select_shape_same() returns true on the memory
+ * into memory, and verify that it contains the expected data.
+ * Verify that H5S_select_shape_same() returns true on the memory
* and file selections.
*/
@@ -4461,8 +4459,8 @@ ckrbrd_hs_dr_pio_test__run_test(const int test_num,
#if CKRBRD_HS_DR_PIO_TEST__RUN_TEST__DEBUG
if ( MAINPROCESS ) {
- HDfprintf(stdout,
- "test %d: Subtests complete -- tests run/skipped/total = %lld/%lld/%lld.\n",
+ HDfprintf(stdout,
+ "test %d: Subtests complete -- tests run/skipped/total = %lld/%lld/%lld.\n",
test_num, (long long)(tv_ptr->tests_run), (long long)(tv_ptr->tests_skipped),
(long long)(tv_ptr->total_tests));
}
@@ -4487,28 +4485,28 @@ ckrbrd_hs_dr_pio_test__run_test(const int test_num,
/*-------------------------------------------------------------------------
- * Function: ckrbrd_hs_dr_pio_test()
+ * Function: ckrbrd_hs_dr_pio_test()
*
- * Purpose: Test I/O to/from hyperslab selections of different rank in
- * the parallel case.
+ * Purpose: Test I/O to/from hyperslab selections of different rank in
+ * the parallel case.
*
- * Return: void
+ * Return: void
*
- * Programmer: JRM -- 9/18/09
+ * Programmer: JRM -- 9/18/09
*
* Modifications:
*
- * Modified function to take a sample of the run times
- * of the different tests, and skip some of them if
- * run times are too long.
+ * Modified function to take a sample of the run times
+ * of the different tests, and skip some of them if
+ * run times are too long.
*
- * We need to do this because Lustre runns very slowly
- * if two or more processes are banging on the same
- * block of memory.
- * JRM -- 9/10/10
- * Break this one big test into 4 smaller tests according
- * to {independent,collective}x{contigous,chunked} datasets.
- * AKC -- 2010/01/17
+ * We need to do this because Lustre runns very slowly
+ * if two or more processes are banging on the same
+ * block of memory.
+ * JRM -- 9/10/10
+ * Break this one big test into 4 smaller tests according
+ * to {independent,collective}x{contigous,chunked} datasets.
+ * AKC -- 2010/01/17
*
*-------------------------------------------------------------------------
*/
@@ -4518,16 +4516,16 @@ ckrbrd_hs_dr_pio_test(ShapeSameTestMethods sstest_type)
{
int express_test;
int local_express_test;
- int mpi_size = -1;
+ int mpi_size = -1;
int mpi_rank = -1;
- int test_num = 0;
- int edge_size;
+ int test_num = 0;
+ int edge_size;
int checker_edge_size = 3;
- int chunk_edge_size = 0;
- int small_rank = 3;
- int large_rank = 4;
- int mpi_result;
- hid_t dset_type = H5T_NATIVE_UINT;
+ int chunk_edge_size = 0;
+ int small_rank = 3;
+ int large_rank = 4;
+ int mpi_result;
+ hid_t dset_type = H5T_NATIVE_UINT;
int skips = 0;
int max_skips = 0;
/* The following table list the number of sub-tests skipped between
@@ -4566,13 +4564,13 @@ ckrbrd_hs_dr_pio_test(ShapeSameTestMethods sstest_type)
max_skips = max_skips_tbl[local_express_test];
}
-#if 0
+#if 0
{
int DebugWait = 1;
-
+
while (DebugWait) ;
}
-#endif
+#endif
for ( large_rank = 3; large_rank <= PAR_SS_DR_MAX_RANK; large_rank++ ) {
@@ -4702,15 +4700,15 @@ int dim0;
int dim1;
int chunkdim0;
int chunkdim1;
-int nerrors = 0; /* errors count */
-int ndatasets = 300; /* number of datasets to create*/
+int nerrors = 0; /* errors count */
+int ndatasets = 300; /* number of datasets to create*/
int ngroups = 512; /* number of groups to create in root
* group. */
-int facc_type = FACC_MPIO; /*Test file access type */
+int facc_type = FACC_MPIO; /*Test file access type */
int dxfer_coll_type = DXFER_COLLECTIVE_IO;
-H5E_auto2_t old_func; /* previous error handler */
-void *old_client_data; /* previous error handler arg.*/
+H5E_auto2_t old_func; /* previous error handler */
+void *old_client_data; /* previous error handler arg.*/
/* other option flags */
@@ -4722,10 +4720,10 @@ void *old_client_data; /* previous error handler arg.*/
#define NFILENAME 2
#define PARATESTFILE filenames[0]
const char *FILENAME[NFILENAME]={
- "ShapeSameTest",
- NULL};
-char filenames[NFILENAME][PATH_MAX];
-hid_t fapl; /* file access property list */
+ "ShapeSameTest",
+ NULL};
+char filenames[NFILENAME][PATH_MAX];
+hid_t fapl; /* file access property list */
#ifdef USE_PAUSE
/* pause the process for a moment to allow debugger to attach if desired. */
@@ -4738,7 +4736,7 @@ void pause_proc(void)
{
int pid;
- h5_stat_t statbuf;
+ h5_stat_t statbuf;
char greenlight[] = "go";
int maxloop = 10;
int loops = 0;
@@ -4755,15 +4753,15 @@ void pause_proc(void)
MPI_Get_processor_name(mpi_name, &mpi_namelen);
if (MAINPROCESS)
- while ((HDstat(greenlight, &statbuf) == -1) && loops < maxloop){
- if (!loops++){
- printf("Proc %d (%*s, %d): to debug, attach %d\n",
- mpi_rank, mpi_namelen, mpi_name, pid, pid);
- }
- printf("waiting(%ds) for file %s ...\n", time_int, greenlight);
- fflush(stdout);
+ while ((HDstat(greenlight, &statbuf) == -1) && loops < maxloop){
+ if (!loops++){
+ printf("Proc %d (%*s, %d): to debug, attach %d\n",
+ mpi_rank, mpi_namelen, mpi_name, pid, pid);
+ }
+ printf("waiting(%ds) for file %s ...\n", time_int, greenlight);
+ fflush(stdout);
HDsleep(time_int);
- }
+ }
MPI_Barrier(MPI_COMM_WORLD);
}
@@ -4775,7 +4773,7 @@ int MPI_Init(int *argc, char ***argv)
pause_proc();
return (ret_code);
}
-#endif /* USE_PAUSE */
+#endif /* USE_PAUSE */
/*
@@ -4785,15 +4783,15 @@ static void
usage(void)
{
printf(" [-r] [-w] [-m<n_datasets>] [-n<n_groups>] "
- "[-o] [-f <prefix>] [-d <dim0> <dim1>]\n");
+ "[-o] [-f <prefix>] [-d <dim0> <dim1>]\n");
printf("\t-m<n_datasets>"
- "\tset number of datasets for the multiple dataset test\n");
+ "\tset number of datasets for the multiple dataset test\n");
printf("\t-n<n_groups>"
"\tset number of groups for the multiple group test\n");
printf("\t-f <prefix>\tfilename prefix\n");
printf("\t-2\t\tuse Split-file together with MPIO\n");
printf("\t-d <factor0> <factor1>\tdataset dimensions factors. Defaults (%d,%d)\n",
- ROW_FACTOR, COL_FACTOR);
+ ROW_FACTOR, COL_FACTOR);
printf("\t-c <dim0> <dim1>\tdataset chunk dimensions. Defaults (dim0/10,dim1/10)\n");
printf("\n");
}
@@ -4805,7 +4803,7 @@ usage(void)
static int
parse_options(int argc, char **argv)
{
- int mpi_size, mpi_rank; /* mpi variables */
+ int mpi_size, mpi_rank; /* mpi variables */
MPI_Comm_size(MPI_COMM_WORLD, &mpi_size);
MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank);
@@ -4816,107 +4814,107 @@ parse_options(int argc, char **argv)
chunkdim1 = (dim1+9)/10;
while (--argc){
- if (**(++argv) != '-'){
- break;
- }else{
- switch(*(*argv+1)){
- case 'm': ndatasets = atoi((*argv+1)+1);
- if (ndatasets < 0){
- nerrors++;
- return(1);
- }
- break;
- case 'n': ngroups = atoi((*argv+1)+1);
- if (ngroups < 0){
+ if (**(++argv) != '-'){
+ break;
+ }else{
+ switch(*(*argv+1)){
+ case 'm': ndatasets = atoi((*argv+1)+1);
+ if (ndatasets < 0){
+ nerrors++;
+ return(1);
+ }
+ break;
+ case 'n': ngroups = atoi((*argv+1)+1);
+ if (ngroups < 0){
nerrors++;
return(1);
- }
+ }
break;
- case 'f': if (--argc < 1) {
- nerrors++;
- return(1);
- }
- if (**(++argv) == '-') {
- nerrors++;
- return(1);
- }
- paraprefix = *argv;
- break;
- case 'i': /* Collective MPI-IO access with independent IO */
- dxfer_coll_type = DXFER_INDEPENDENT_IO;
- break;
- case '2': /* Use the split-file driver with MPIO access */
- /* Can use $HDF5_METAPREFIX to define the */
- /* meta-file-prefix. */
- facc_type = FACC_MPIO | FACC_SPLIT;
- break;
- case 'd': /* dimensizes */
- if (--argc < 2){
- nerrors++;
- return(1);
- }
- dim0 = atoi(*(++argv))*mpi_size;
- argc--;
- dim1 = atoi(*(++argv))*mpi_size;
- /* set default chunkdim sizes too */
- chunkdim0 = (dim0+9)/10;
- chunkdim1 = (dim1+9)/10;
- break;
- case 'c': /* chunk dimensions */
- if (--argc < 2){
- nerrors++;
- return(1);
- }
- chunkdim0 = atoi(*(++argv));
- argc--;
- chunkdim1 = atoi(*(++argv));
- break;
- case 'h': /* print help message--return with nerrors set */
- return(1);
- default: printf("Illegal option(%s)\n", *argv);
- nerrors++;
- return(1);
- }
- }
+ case 'f': if (--argc < 1) {
+ nerrors++;
+ return(1);
+ }
+ if (**(++argv) == '-') {
+ nerrors++;
+ return(1);
+ }
+ paraprefix = *argv;
+ break;
+ case 'i': /* Collective MPI-IO access with independent IO */
+ dxfer_coll_type = DXFER_INDEPENDENT_IO;
+ break;
+ case '2': /* Use the split-file driver with MPIO access */
+ /* Can use $HDF5_METAPREFIX to define the */
+ /* meta-file-prefix. */
+ facc_type = FACC_MPIO | FACC_SPLIT;
+ break;
+ case 'd': /* dimensizes */
+ if (--argc < 2){
+ nerrors++;
+ return(1);
+ }
+ dim0 = atoi(*(++argv))*mpi_size;
+ argc--;
+ dim1 = atoi(*(++argv))*mpi_size;
+ /* set default chunkdim sizes too */
+ chunkdim0 = (dim0+9)/10;
+ chunkdim1 = (dim1+9)/10;
+ break;
+ case 'c': /* chunk dimensions */
+ if (--argc < 2){
+ nerrors++;
+ return(1);
+ }
+ chunkdim0 = atoi(*(++argv));
+ argc--;
+ chunkdim1 = atoi(*(++argv));
+ break;
+ case 'h': /* print help message--return with nerrors set */
+ return(1);
+ default: printf("Illegal option(%s)\n", *argv);
+ nerrors++;
+ return(1);
+ }
+ }
} /*while*/
/* check validity of dimension and chunk sizes */
if (dim0 <= 0 || dim1 <= 0){
- printf("Illegal dim sizes (%d, %d)\n", dim0, dim1);
- nerrors++;
- return(1);
+ printf("Illegal dim sizes (%d, %d)\n", dim0, dim1);
+ nerrors++;
+ return(1);
}
if (chunkdim0 <= 0 || chunkdim1 <= 0){
- printf("Illegal chunkdim sizes (%d, %d)\n", chunkdim0, chunkdim1);
- nerrors++;
- return(1);
+ printf("Illegal chunkdim sizes (%d, %d)\n", chunkdim0, chunkdim1);
+ nerrors++;
+ return(1);
}
/* Make sure datasets can be divided into equal portions by the processes */
if ((dim0 % mpi_size) || (dim1 % mpi_size)){
- if (MAINPROCESS)
- printf("dim0(%d) and dim1(%d) must be multiples of processes(%d)\n",
- dim0, dim1, mpi_size);
- nerrors++;
- return(1);
+ if (MAINPROCESS)
+ printf("dim0(%d) and dim1(%d) must be multiples of processes(%d)\n",
+ dim0, dim1, mpi_size);
+ nerrors++;
+ return(1);
}
/* compose the test filenames */
{
- int i, n;
-
- n = sizeof(FILENAME)/sizeof(FILENAME[0]) - 1; /* exclude the NULL */
-
- for (i=0; i < n; i++)
- if (h5_fixname(FILENAME[i],fapl,filenames[i],sizeof(filenames[i]))
- == NULL){
- printf("h5_fixname failed\n");
- nerrors++;
- return(1);
- }
- printf("Test filenames are:\n");
- for (i=0; i < n; i++)
- printf(" %s\n", filenames[i]);
+ int i, n;
+
+ n = sizeof(FILENAME)/sizeof(FILENAME[0]) - 1; /* exclude the NULL */
+
+ for (i=0; i < n; i++)
+ if (h5_fixname(FILENAME[i],fapl,filenames[i],sizeof(filenames[i]))
+ == NULL){
+ printf("h5_fixname failed\n");
+ nerrors++;
+ return(1);
+ }
+ printf("Test filenames are:\n");
+ for (i=0; i < n; i++)
+ printf(" %s\n", filenames[i]);
}
return(0);
@@ -4931,7 +4929,7 @@ create_faccess_plist(MPI_Comm comm, MPI_Info info, int l_facc_type)
{
hid_t ret_pl = -1;
herr_t ret; /* generic return value */
- int mpi_rank; /* mpi variables */
+ int mpi_rank; /* mpi variables */
/* need the rank for error checking macros */
MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank);
@@ -4940,36 +4938,36 @@ create_faccess_plist(MPI_Comm comm, MPI_Info info, int l_facc_type)
VRFY((ret_pl >= 0), "H5P_FILE_ACCESS");
if (l_facc_type == FACC_DEFAULT)
- return (ret_pl);
+ return (ret_pl);
if (l_facc_type == FACC_MPIO){
- /* set Parallel access with communicator */
- ret = H5Pset_fapl_mpio(ret_pl, comm, info);
- VRFY((ret >= 0), "");
+ /* set Parallel access with communicator */
+ ret = H5Pset_fapl_mpio(ret_pl, comm, info);
+ VRFY((ret >= 0), "");
ret = H5Pset_all_coll_metadata_ops(ret_pl, TRUE);
- VRFY((ret >= 0), "");
+ VRFY((ret >= 0), "");
ret = H5Pset_coll_metadata_write(ret_pl, TRUE);
- VRFY((ret >= 0), "");
- return(ret_pl);
+ VRFY((ret >= 0), "");
+ return(ret_pl);
}
if (l_facc_type == (FACC_MPIO | FACC_SPLIT)){
- hid_t mpio_pl;
-
- mpio_pl = H5Pcreate (H5P_FILE_ACCESS);
- VRFY((mpio_pl >= 0), "");
- /* set Parallel access with communicator */
- ret = H5Pset_fapl_mpio(mpio_pl, comm, info);
- VRFY((ret >= 0), "");
-
- /* setup file access template */
- ret_pl = H5Pcreate (H5P_FILE_ACCESS);
- VRFY((ret_pl >= 0), "");
- /* set Parallel access with communicator */
- ret = H5Pset_fapl_split(ret_pl, ".meta", mpio_pl, ".raw", mpio_pl);
- VRFY((ret >= 0), "H5Pset_fapl_split succeeded");
- H5Pclose(mpio_pl);
- return(ret_pl);
+ hid_t mpio_pl;
+
+ mpio_pl = H5Pcreate (H5P_FILE_ACCESS);
+ VRFY((mpio_pl >= 0), "");
+ /* set Parallel access with communicator */
+ ret = H5Pset_fapl_mpio(mpio_pl, comm, info);
+ VRFY((ret >= 0), "");
+
+ /* setup file access template */
+ ret_pl = H5Pcreate (H5P_FILE_ACCESS);
+ VRFY((ret_pl >= 0), "");
+ /* set Parallel access with communicator */
+ ret = H5Pset_fapl_split(ret_pl, ".meta", mpio_pl, ".raw", mpio_pl);
+ VRFY((ret >= 0), "H5Pset_fapl_split succeeded");
+ H5Pclose(mpio_pl);
+ return(ret_pl);
}
/* unknown file access types */
@@ -5037,7 +5035,7 @@ sschecker4(void)
int main(int argc, char **argv)
{
- int mpi_size, mpi_rank; /* mpi variables */
+ int mpi_size, mpi_rank; /* mpi variables */
#ifndef H5_HAVE_WIN32_API
/* Un-buffer the stdout and stderr */
@@ -5053,10 +5051,10 @@ int main(int argc, char **argv)
dim1 = COL_FACTOR*mpi_size;
if (MAINPROCESS){
- printf("===================================\n");
- printf("Shape Same Tests Start\n");
- printf(" express_test = %d.\n", GetTestExpress());
- printf("===================================\n");
+ printf("===================================\n");
+ printf("Shape Same Tests Start\n");
+ printf(" express_test = %d.\n", GetTestExpress());
+ printf("===================================\n");
}
/* Attempt to turn off atexit post processing so that in case errors
@@ -5065,7 +5063,7 @@ int main(int argc, char **argv)
* calls. By then, MPI calls may not work.
*/
if (H5dont_atexit() < 0){
- printf("%d: Failed to turn off atexit processing. Continue.\n", mpi_rank);
+ printf("%d: Failed to turn off atexit processing. Continue.\n", mpi_rank);
};
H5open();
h5_show_hostname();
@@ -5075,23 +5073,23 @@ int main(int argc, char **argv)
/* Shape Same tests using contigous hyperslab */
AddTest("sscontig1", sscontig1, NULL,
- "Cntg hslab, ind IO, cntg dsets", PARATESTFILE);
+ "Cntg hslab, ind IO, cntg dsets", PARATESTFILE);
AddTest("sscontig2", sscontig2, NULL,
- "Cntg hslab, col IO, cntg dsets", PARATESTFILE);
+ "Cntg hslab, col IO, cntg dsets", PARATESTFILE);
AddTest("sscontig3", sscontig3, NULL,
- "Cntg hslab, ind IO, chnk dsets", PARATESTFILE);
+ "Cntg hslab, ind IO, chnk dsets", PARATESTFILE);
AddTest("sscontig4", sscontig4, NULL,
- "Cntg hslab, col IO, chnk dsets", PARATESTFILE);
+ "Cntg hslab, col IO, chnk dsets", PARATESTFILE);
/* Shape Same tests using checker board hyperslab */
AddTest("sschecker1", sschecker1, NULL,
- "Check hslab, ind IO, cntg dsets", PARATESTFILE);
+ "Check hslab, ind IO, cntg dsets", PARATESTFILE);
AddTest("sschecker2", sschecker2, NULL,
- "Check hslab, col IO, cntg dsets", PARATESTFILE);
+ "Check hslab, col IO, cntg dsets", PARATESTFILE);
AddTest("sschecker3", sschecker3, NULL,
- "Check hslab, ind IO, chnk dsets", PARATESTFILE);
+ "Check hslab, ind IO, chnk dsets", PARATESTFILE);
AddTest("sschecker4", sschecker4, NULL,
- "Check hslab, col IO, chnk dsets", PARATESTFILE);
+ "Check hslab, col IO, chnk dsets", PARATESTFILE);
/* Display testing information */
TestInfo(argv[0]);
@@ -5104,9 +5102,9 @@ int main(int argc, char **argv)
TestParseCmdLine(argc, argv);
if (dxfer_coll_type == DXFER_INDEPENDENT_IO && MAINPROCESS){
- printf("===================================\n"
- " Using Independent I/O with file set view to replace collective I/O \n"
- "===================================\n");
+ printf("===================================\n"
+ " Using Independent I/O with file set view to replace collective I/O \n"
+ "===================================\n");
}
@@ -5131,16 +5129,16 @@ int main(int argc, char **argv)
{
int temp;
MPI_Allreduce(&nerrors, &temp, 1, MPI_INT, MPI_MAX, MPI_COMM_WORLD);
- nerrors=temp;
+ nerrors=temp;
}
- if (MAINPROCESS){ /* only process 0 reports */
- printf("===================================\n");
- if (nerrors)
- printf("***Shape Same tests detected %d errors***\n", nerrors);
- else
- printf("Shape Same tests finished with no errors\n");
- printf("===================================\n");
+ if (MAINPROCESS){ /* only process 0 reports */
+ printf("===================================\n");
+ if (nerrors)
+ printf("***Shape Same tests detected %d errors***\n", nerrors);
+ else
+ printf("Shape Same tests finished with no errors\n");
+ printf("===================================\n");
}
/* close HDF5 library */
diff --git a/testpar/t_span_tree.c b/testpar/t_span_tree.c
index a42df95..20bc4ac 100644
--- a/testpar/t_span_tree.c
+++ b/testpar/t_span_tree.c
@@ -23,17 +23,15 @@
2) We will read two datasets with the same hyperslab selection settings,
1. independent read to read independent output,
independent read to read collecive output,
- Compare the result,
- If the result is the same, then collective write succeeds.
+ Compare the result,
+ If the result is the same, then collective write succeeds.
2. collective read to read independent output,
independent read to read independent output,
- Compare the result,
- If the result is the same, then collective read succeeds.
+ Compare the result,
+ If the result is the same, then collective read succeeds.
*/
-#include "hdf5.h"
-#include "H5private.h"
#include "testphdf5.h"
@@ -42,17 +40,17 @@ static void coll_read_test(int chunk_factor);
/*-------------------------------------------------------------------------
- * Function: coll_irregular_cont_write
+ * Function: coll_irregular_cont_write
*
- * Purpose: Wrapper to test the collectively irregular hyperslab write in
+ * Purpose: Wrapper to test the collectively irregular hyperslab write in
contiguous storage
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: -1
+ * Failure: -1
*
- * Programmer: Unknown
- * Dec 2nd, 2004
+ * Programmer: Unknown
+ * Dec 2nd, 2004
*
* Modifications:
*
@@ -69,17 +67,17 @@ coll_irregular_cont_write(void)
/*-------------------------------------------------------------------------
- * Function: coll_irregular_cont_read
+ * Function: coll_irregular_cont_read
*
- * Purpose: Wrapper to test the collectively irregular hyperslab read in
+ * Purpose: Wrapper to test the collectively irregular hyperslab read in
contiguous storage
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: -1
+ * Failure: -1
*
- * Programmer: Unknown
- * Dec 2nd, 2004
+ * Programmer: Unknown
+ * Dec 2nd, 2004
*
* Modifications:
*
@@ -95,17 +93,17 @@ coll_irregular_cont_read(void)
/*-------------------------------------------------------------------------
- * Function: coll_irregular_simple_chunk_write
+ * Function: coll_irregular_simple_chunk_write
*
- * Purpose: Wrapper to test the collectively irregular hyperslab write in
+ * Purpose: Wrapper to test the collectively irregular hyperslab write in
chunk storage(1 chunk)
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: -1
+ * Failure: -1
*
- * Programmer: Unknown
- * Dec 2nd, 2004
+ * Programmer: Unknown
+ * Dec 2nd, 2004
*
* Modifications:
*
@@ -122,17 +120,17 @@ coll_irregular_simple_chunk_write(void)
/*-------------------------------------------------------------------------
- * Function: coll_irregular_simple_chunk_read
+ * Function: coll_irregular_simple_chunk_read
*
- * Purpose: Wrapper to test the collectively irregular hyperslab read in chunk
+ * Purpose: Wrapper to test the collectively irregular hyperslab read in chunk
storage(1 chunk)
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: -1
+ * Failure: -1
*
- * Programmer: Unknown
- * Dec 2nd, 2004
+ * Programmer: Unknown
+ * Dec 2nd, 2004
*
* Modifications:
*
@@ -147,17 +145,17 @@ coll_irregular_simple_chunk_read(void)
}
/*-------------------------------------------------------------------------
- * Function: coll_irregular_complex_chunk_write
+ * Function: coll_irregular_complex_chunk_write
*
- * Purpose: Wrapper to test the collectively irregular hyperslab write in chunk
+ * Purpose: Wrapper to test the collectively irregular hyperslab write in chunk
storage(4 chunks)
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: -1
+ * Failure: -1
*
- * Programmer: Unknown
- * Dec 2nd, 2004
+ * Programmer: Unknown
+ * Dec 2nd, 2004
*
* Modifications:
*
@@ -174,17 +172,17 @@ coll_irregular_complex_chunk_write(void)
/*-------------------------------------------------------------------------
- * Function: coll_irregular_complex_chunk_read
+ * Function: coll_irregular_complex_chunk_read
*
- * Purpose: Wrapper to test the collectively irregular hyperslab read in chunk
+ * Purpose: Wrapper to test the collectively irregular hyperslab read in chunk
storage(1 chunk)
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: -1
+ * Failure: -1
*
- * Programmer: Unknown
- * Dec 2nd, 2004
+ * Programmer: Unknown
+ * Dec 2nd, 2004
*
* Modifications:
*
@@ -200,18 +198,18 @@ coll_irregular_complex_chunk_read(void)
/*-------------------------------------------------------------------------
- * Function: coll_write_test
+ * Function: coll_write_test
*
- * Purpose: To test the collectively irregular hyperslab write in chunk
+ * Purpose: To test the collectively irregular hyperslab write in chunk
storage
* Input: number of chunks on each dimension
if number is equal to 0, contiguous storage
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: -1
+ * Failure: -1
*
- * Programmer: Unknown
- * Dec 2nd, 2004
+ * Programmer: Unknown
+ * Dec 2nd, 2004
*
* Modifications: Oct 18th, 2005
*
@@ -229,14 +227,14 @@ void coll_write_test(int chunk_factor)
#if 0
hsize_t mdim1[] = {MSPACE1_DIM}; /* Dimension size of the first dataset
- (in memory) */
+ (in memory) */
hsize_t fsdim[] = {FSPACE_DIM1, FSPACE_DIM2}; /* Dimension sizes of the dataset
(on disk) */
hsize_t mdim[] = {MSPACE_DIM1, MSPACE_DIM2}; /* Dimension sizes of the
- dataset in memory when we
- read selection from the
- dataset on the disk */
+ dataset in memory when we
+ read selection from the
+ dataset on the disk */
#endif
hsize_t start[2]; /* Start of hyperslab */
@@ -252,7 +250,7 @@ void coll_write_test(int chunk_factor)
#if 0
int matrix_out[MSPACE_DIM1][MSPACE_DIM2];
int matrix_out1[MSPACE_DIM1][MSPACE_DIM2]; /* Buffer to read from the
- dataset */
+ dataset */
int vector[MSPACE1_DIM];
#endif
@@ -616,12 +614,12 @@ void coll_write_test(int chunk_factor)
*/
ret = H5Dread(datasetc, H5T_NATIVE_INT, mspaceid, fspaceid,
- H5P_DEFAULT, matrix_out);
+ H5P_DEFAULT, matrix_out);
VRFY((ret >= 0),"H5D independent read succeed");
ret = H5Dread(dataseti, H5T_NATIVE_INT, mspaceid, fspaceid,
- H5P_DEFAULT, matrix_out1);
+ H5P_DEFAULT, matrix_out1);
VRFY((ret >= 0),"H5D independent read succeed");
ret = 0;
@@ -668,18 +666,18 @@ void coll_write_test(int chunk_factor)
}
/*-------------------------------------------------------------------------
- * Function: coll_read_test
+ * Function: coll_read_test
*
- * Purpose: To test the collectively irregular hyperslab read in chunk
+ * Purpose: To test the collectively irregular hyperslab read in chunk
storage
* Input: number of chunks on each dimension
if number is equal to 0, contiguous storage
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: -1
+ * Failure: -1
*
- * Programmer: Unknown
- * Dec 2nd, 2004
+ * Programmer: Unknown
+ * Dec 2nd, 2004
*
* Modifications: Oct 18th, 2005
* Note: This test must be used with the correpsonding
@@ -699,9 +697,9 @@ coll_read_test(int chunk_factor)
/* Dimension sizes of the dataset (on disk) */
#if 0
hsize_t mdim[] = {MSPACE_DIM1, MSPACE_DIM2}; /* Dimension sizes of the
- dataset in memory when we
- read selection from the
- dataset on the disk */
+ dataset in memory when we
+ read selection from the
+ dataset on the disk */
#endif
hsize_t mdim[2];
@@ -718,7 +716,7 @@ coll_read_test(int chunk_factor)
#if 0
int matrix_out[MSPACE_DIM1][MSPACE_DIM2];
int matrix_out1[MSPACE_DIM1][MSPACE_DIM2]; /* Buffer to read from the
- dataset */
+ dataset */
#endif
int mpi_size,mpi_rank;
@@ -882,7 +880,7 @@ coll_read_test(int chunk_factor)
/* Collective read */
ret = H5Dread(dataseti, H5T_NATIVE_INT, mspaceid, fspaceid1,
- dxfer_plist, matrix_out);
+ dxfer_plist, matrix_out);
VRFY((ret >= 0),"H5D collecive read succeed");
ret = H5Pclose(dxfer_plist);
@@ -890,7 +888,7 @@ coll_read_test(int chunk_factor)
/* Independent read */
ret = H5Dread(dataseti, H5T_NATIVE_INT, mspaceid, fspaceid1,
- H5P_DEFAULT, matrix_out1);
+ H5P_DEFAULT, matrix_out1);
VRFY((ret >= 0),"H5D independent read succeed");
ret = 0;
@@ -933,30 +931,30 @@ coll_read_test(int chunk_factor)
/****************************************************************
**
-** lower_dim_size_comp_test__select_checker_board():
+** lower_dim_size_comp_test__select_checker_board():
**
-** Given a data space of tgt_rank, and dimensions:
+** Given a data space of tgt_rank, and dimensions:
**
-** (mpi_size + 1), edge_size, ... , edge_size
+** (mpi_size + 1), edge_size, ... , edge_size
**
-** edge_size, and a checker_edge_size, select a checker
-** board selection of a sel_rank (sel_rank < tgt_rank)
-** dimensional slice through the data space parallel to the
+** edge_size, and a checker_edge_size, select a checker
+** board selection of a sel_rank (sel_rank < tgt_rank)
+** dimensional slice through the data space parallel to the
** sel_rank fastest changing indicies, with origin (in the
-** higher indicies) as indicated by the start array.
+** higher indicies) as indicated by the start array.
**
-** Note that this function, is hard coded to presume a
-** maximum data space rank of 5.
+** Note that this function, is hard coded to presume a
+** maximum data space rank of 5.
**
-** While this maximum is declared as a constant, increasing
-** it will require extensive coding in addition to changing
+** While this maximum is declared as a constant, increasing
+** it will require extensive coding in addition to changing
** the value of the constant.
**
-** JRM -- 11/11/09
+** JRM -- 11/11/09
**
****************************************************************/
-#define LDSCT_DS_RANK 5
+#define LDSCT_DS_RANK 5
#define LOWER_DIM_SIZE_COMP_TEST_DEBUG_TARGET_RANK 0
#define LOWER_DIM_SIZE_COMP_TEST__SELECT_CHECKER_BOARD__DEBUG 0
@@ -971,32 +969,32 @@ lower_dim_size_comp_test__select_checker_board(
const int sel_rank,
hsize_t sel_start[])
{
-#if LOWER_DIM_SIZE_COMP_TEST__SELECT_CHECKER_BOARD__DEBUG
- const char * fcnName =
- "lower_dim_size_comp_test__select_checker_board():";
-#endif
- hbool_t first_selection = TRUE;
+#if LOWER_DIM_SIZE_COMP_TEST__SELECT_CHECKER_BOARD__DEBUG
+ const char * fcnName =
+ "lower_dim_size_comp_test__select_checker_board():";
+#endif
+ hbool_t first_selection = TRUE;
int i, j, k, l, m;
- int ds_offset;
- int sel_offset;
- const int test_max_rank = LDSCT_DS_RANK; /* must update code if */
+ int ds_offset;
+ int sel_offset;
+ const int test_max_rank = LDSCT_DS_RANK; /* must update code if */
/* this changes */
- hsize_t base_count;
+ hsize_t base_count;
hsize_t offset_count;
- hsize_t start[LDSCT_DS_RANK];
- hsize_t stride[LDSCT_DS_RANK];
- hsize_t count[LDSCT_DS_RANK];
- hsize_t block[LDSCT_DS_RANK];
- herr_t ret; /* Generic return value */
+ hsize_t start[LDSCT_DS_RANK];
+ hsize_t stride[LDSCT_DS_RANK];
+ hsize_t count[LDSCT_DS_RANK];
+ hsize_t block[LDSCT_DS_RANK];
+ herr_t ret; /* Generic return value */
-#if LOWER_DIM_SIZE_COMP_TEST__SELECT_CHECKER_BOARD__DEBUG
+#if LOWER_DIM_SIZE_COMP_TEST__SELECT_CHECKER_BOARD__DEBUG
if ( mpi_rank == LOWER_DIM_SIZE_COMP_TEST_DEBUG_TARGET_RANK ) {
- HDfprintf(stdout,
+ HDfprintf(stdout,
"%s:%d: dims/checker_edge_size = %d %d %d %d %d / %d\n",
fcnName, mpi_rank, (int)dims[0], (int)dims[1], (int)dims[2],
(int)dims[3], (int)dims[4], checker_edge_size);
}
-#endif /* LOWER_DIM_SIZE_COMP_TEST__SELECT_CHECKER_BOARD__DEBUG */
+#endif /* LOWER_DIM_SIZE_COMP_TEST__SELECT_CHECKER_BOARD__DEBUG */
HDassert( 0 < checker_edge_size );
HDassert( 0 < sel_rank );
@@ -1014,14 +1012,14 @@ lower_dim_size_comp_test__select_checker_board(
HDassert( (hsize_t)checker_edge_size <= dims[sel_offset] );
HDassert( dims[sel_offset] == 10 );
-#if LOWER_DIM_SIZE_COMP_TEST__SELECT_CHECKER_BOARD__DEBUG
+#if LOWER_DIM_SIZE_COMP_TEST__SELECT_CHECKER_BOARD__DEBUG
if ( mpi_rank == LOWER_DIM_SIZE_COMP_TEST_DEBUG_TARGET_RANK ) {
- HDfprintf(stdout, "%s:%d: sel_rank/sel_offset = %d/%d.\n",
+ HDfprintf(stdout, "%s:%d: sel_rank/sel_offset = %d/%d.\n",
fcnName, mpi_rank, sel_rank, sel_offset);
- HDfprintf(stdout, "%s:%d: tgt_rank/ds_offset = %d/%d.\n",
+ HDfprintf(stdout, "%s:%d: tgt_rank/ds_offset = %d/%d.\n",
fcnName, mpi_rank, tgt_rank, ds_offset);
}
-#endif /* LOWER_DIM_SIZE_COMP_TEST__SELECT_CHECKER_BOARD__DEBUG */
+#endif /* LOWER_DIM_SIZE_COMP_TEST__SELECT_CHECKER_BOARD__DEBUG */
/* First, compute the base count (which assumes start == 0
* for the associated offset) and offset_count (which
@@ -1043,25 +1041,25 @@ lower_dim_size_comp_test__select_checker_board(
base_count++;
}
- offset_count =
- (hsize_t)((dims[sel_offset] - (hsize_t)checker_edge_size) /
+ offset_count =
+ (hsize_t)((dims[sel_offset] - (hsize_t)checker_edge_size) /
((hsize_t)(checker_edge_size * 2)));
- if ( ((dims[sel_rank] - (hsize_t)checker_edge_size) %
+ if ( ((dims[sel_rank] - (hsize_t)checker_edge_size) %
((hsize_t)(checker_edge_size * 2))) > 0 ) {
offset_count++;
}
-#if LOWER_DIM_SIZE_COMP_TEST__SELECT_CHECKER_BOARD__DEBUG
+#if LOWER_DIM_SIZE_COMP_TEST__SELECT_CHECKER_BOARD__DEBUG
if ( mpi_rank == LOWER_DIM_SIZE_COMP_TEST_DEBUG_TARGET_RANK ) {
- HDfprintf(stdout, "%s:%d: base_count/offset_count = %d/%d.\n",
+ HDfprintf(stdout, "%s:%d: base_count/offset_count = %d/%d.\n",
fcnName, mpi_rank, base_count, offset_count);
}
-#endif /* LOWER_DIM_SIZE_COMP_TEST__SELECT_CHECKER_BOARD__DEBUG */
+#endif /* LOWER_DIM_SIZE_COMP_TEST__SELECT_CHECKER_BOARD__DEBUG */
/* Now set up the stride and block arrays, and portions of the start
- * and count arrays that will not be altered during the selection of
+ * and count arrays that will not be altered during the selection of
* the checker board.
*/
i = 0;
@@ -1093,7 +1091,7 @@ lower_dim_size_comp_test__select_checker_board(
i++;
}
-
+
i = 0;
do {
if ( 0 >= sel_offset ) {
@@ -1112,7 +1110,7 @@ lower_dim_size_comp_test__select_checker_board(
}
j = 0;
- do {
+ do {
if ( 1 >= sel_offset ) {
if ( j == 0 ) {
@@ -1181,78 +1179,78 @@ lower_dim_size_comp_test__select_checker_board(
if ( ((i + j + k + l + m) % 2) == 0 ) {
-#if LOWER_DIM_SIZE_COMP_TEST__SELECT_CHECKER_BOARD__DEBUG
- if ( mpi_rank ==
+#if LOWER_DIM_SIZE_COMP_TEST__SELECT_CHECKER_BOARD__DEBUG
+ if ( mpi_rank ==
LOWER_DIM_SIZE_COMP_TEST_DEBUG_TARGET_RANK ) {
- HDfprintf(stdout,
- "%s%d: *** first_selection = %d ***\n",
+ HDfprintf(stdout,
+ "%s%d: *** first_selection = %d ***\n",
fcnName, mpi_rank, (int)first_selection);
- HDfprintf(stdout,
+ HDfprintf(stdout,
"%s:%d: i/j/k/l/m = %d/%d/%d/%d/%d\n",
fcnName, mpi_rank, i, j, k, l, m);
- HDfprintf(stdout,
- "%s:%d: start = %d %d %d %d %d.\n",
- fcnName, mpi_rank,
- (int)start[0], (int)start[1],
- (int)start[2], (int)start[3],
+ HDfprintf(stdout,
+ "%s:%d: start = %d %d %d %d %d.\n",
+ fcnName, mpi_rank,
+ (int)start[0], (int)start[1],
+ (int)start[2], (int)start[3],
(int)start[4]);
- HDfprintf(stdout,
- "%s:%d: stride = %d %d %d %d %d.\n",
- fcnName, mpi_rank,
- (int)stride[0], (int)stride[1],
- (int)stride[2], (int)stride[3],
+ HDfprintf(stdout,
+ "%s:%d: stride = %d %d %d %d %d.\n",
+ fcnName, mpi_rank,
+ (int)stride[0], (int)stride[1],
+ (int)stride[2], (int)stride[3],
(int)stride[4]);
- HDfprintf(stdout,
- "%s:%d: count = %d %d %d %d %d.\n",
- fcnName, mpi_rank,
- (int)count[0], (int)count[1],
- (int)count[2], (int)count[3],
+ HDfprintf(stdout,
+ "%s:%d: count = %d %d %d %d %d.\n",
+ fcnName, mpi_rank,
+ (int)count[0], (int)count[1],
+ (int)count[2], (int)count[3],
(int)count[4]);
- HDfprintf(stdout,
- "%s:%d: block = %d %d %d %d %d.\n",
- fcnName, mpi_rank,
- (int)block[0], (int)block[1],
- (int)block[2], (int)block[3],
+ HDfprintf(stdout,
+ "%s:%d: block = %d %d %d %d %d.\n",
+ fcnName, mpi_rank,
+ (int)block[0], (int)block[1],
+ (int)block[2], (int)block[3],
(int)block[4]);
- HDfprintf(stdout,
- "%s:%d: n-cube extent dims = %d.\n",
+ HDfprintf(stdout,
+ "%s:%d: n-cube extent dims = %d.\n",
fcnName, mpi_rank,
H5Sget_simple_extent_ndims(tgt_sid));
- HDfprintf(stdout,
- "%s:%d: selection rank = %d.\n",
+ HDfprintf(stdout,
+ "%s:%d: selection rank = %d.\n",
fcnName, mpi_rank, sel_rank);
}
#endif
if ( first_selection ) {
- first_selection = FALSE;
+ first_selection = FALSE;
ret = H5Sselect_hyperslab
(
- tgt_sid,
+ tgt_sid,
H5S_SELECT_SET,
- &(start[ds_offset]),
- &(stride[ds_offset]),
- &(count[ds_offset]),
+ &(start[ds_offset]),
+ &(stride[ds_offset]),
+ &(count[ds_offset]),
&(block[ds_offset])
);
-
+
VRFY((ret != FAIL), "H5Sselect_hyperslab(SET) succeeded");
} else {
ret = H5Sselect_hyperslab
(
- tgt_sid,
+ tgt_sid,
H5S_SELECT_OR,
- &(start[ds_offset]),
- &(stride[ds_offset]),
- &(count[ds_offset]),
+ &(start[ds_offset]),
+ &(stride[ds_offset]),
+ &(count[ds_offset]),
&(block[ds_offset])
);
-
+
VRFY((ret != FAIL), "H5Sselect_hyperslab(OR) succeeded");
}
@@ -1284,7 +1282,7 @@ lower_dim_size_comp_test__select_checker_board(
} while ( ( i <= 1 ) &&
( 0 >= sel_offset ) );
-#if LOWER_DIM_SIZE_COMP_TEST__SELECT_CHECKER_BOARD__DEBUG
+#if LOWER_DIM_SIZE_COMP_TEST__SELECT_CHECKER_BOARD__DEBUG
if ( mpi_rank == LOWER_DIM_SIZE_COMP_TEST_DEBUG_TARGET_RANK ) {
HDfprintf(stdout, "%s%d: H5Sget_select_npoints(tgt_sid) = %d.\n",
fcnName, mpi_rank, (int)H5Sget_select_npoints(tgt_sid));
@@ -1306,7 +1304,7 @@ lower_dim_size_comp_test__select_checker_board(
VRFY((ret != FAIL), "H5Sselect_hyperslab(AND) succeeded");
-#if LOWER_DIM_SIZE_COMP_TEST__SELECT_CHECKER_BOARD__DEBUG
+#if LOWER_DIM_SIZE_COMP_TEST__SELECT_CHECKER_BOARD__DEBUG
if ( mpi_rank == LOWER_DIM_SIZE_COMP_TEST_DEBUG_TARGET_RANK ) {
HDfprintf(stdout, "%s%d: H5Sget_select_npoints(tgt_sid) = %d.\n",
fcnName, mpi_rank, (int)H5Sget_select_npoints(tgt_sid));
@@ -1321,57 +1319,57 @@ lower_dim_size_comp_test__select_checker_board(
/****************************************************************
**
-** lower_dim_size_comp_test__verify_data():
+** lower_dim_size_comp_test__verify_data():
**
-** Examine the supplied buffer to see if it contains the
-** expected data. Return TRUE if it does, and FALSE
+** Examine the supplied buffer to see if it contains the
+** expected data. Return TRUE if it does, and FALSE
** otherwise.
**
-** The supplied buffer is presumed to this process's slice
-** of the target data set. Each such slice will be an
-** n-cube of rank (rank -1) and the supplied edge_size with
-** origin (mpi_rank, 0, ... , 0) in the target data set.
+** The supplied buffer is presumed to this process's slice
+** of the target data set. Each such slice will be an
+** n-cube of rank (rank -1) and the supplied edge_size with
+** origin (mpi_rank, 0, ... , 0) in the target data set.
**
-** Further, the buffer is presumed to be the result of reading
-** or writing a checker board selection of an m (1 <= m <
+** Further, the buffer is presumed to be the result of reading
+** or writing a checker board selection of an m (1 <= m <
** rank) dimensional slice through this processes slice
-** of the target data set. Also, this slice must be parallel
-** to the fastest changing indicies.
+** of the target data set. Also, this slice must be parallel
+** to the fastest changing indicies.
**
-** It is further presumed that the buffer was zeroed before
-** the read/write, and that the full target data set (i.e.
-** the buffer/data set for all processes) was initialized
-** with the natural numbers listed in order from the origin
-** along the fastest changing axis.
+** It is further presumed that the buffer was zeroed before
+** the read/write, and that the full target data set (i.e.
+** the buffer/data set for all processes) was initialized
+** with the natural numbers listed in order from the origin
+** along the fastest changing axis.
**
** Thus for a 20x10x10 dataset, the value stored in location
-** (x, y, z) (assuming that z is the fastest changing index
-** and x the slowest) is assumed to be:
+** (x, y, z) (assuming that z is the fastest changing index
+** and x the slowest) is assumed to be:
**
-** (10 * 10 * x) + (10 * y) + z
+** (10 * 10 * x) + (10 * y) + z
**
-** Further, supposing that this is process 10, this process's
-** slice of the dataset would be a 10 x 10 2-cube with origin
-** (10, 0, 0) in the data set, and would be initialize (prior
-** to the checkerboard selection) as follows:
+** Further, supposing that this is process 10, this process's
+** slice of the dataset would be a 10 x 10 2-cube with origin
+** (10, 0, 0) in the data set, and would be initialize (prior
+** to the checkerboard selection) as follows:
**
-** 1000, 1001, 1002, ... 1008, 1009
-** 1010, 1011, 1012, ... 1018, 1019
-** . . . . .
-** . . . . .
-** . . . . .
-** 1090, 1091, 1092, ... 1098, 1099
+** 1000, 1001, 1002, ... 1008, 1009
+** 1010, 1011, 1012, ... 1018, 1019
+** . . . . .
+** . . . . .
+** . . . . .
+** 1090, 1091, 1092, ... 1098, 1099
**
-** In the case of a read from the processors slice of another
-** data set of different rank, the values expected will have
-** to be adjusted accordingly. This is done via the
-** first_expected_val parameter.
+** In the case of a read from the processors slice of another
+** data set of different rank, the values expected will have
+** to be adjusted accordingly. This is done via the
+** first_expected_val parameter.
**
-** Finally, the function presumes that the first element
-** of the buffer resides either at the origin of either
-** a selected or an unselected checker. (Translation:
-** if partial checkers appear in the buffer, they will
-** intersect the edges of the n-cube oposite the origin.)
+** Finally, the function presumes that the first element
+** of the buffer resides either at the origin of either
+** a selected or an unselected checker. (Translation:
+** if partial checkers appear in the buffer, they will
+** intersect the edges of the n-cube oposite the origin.)
**
****************************************************************/
@@ -1379,7 +1377,7 @@ lower_dim_size_comp_test__select_checker_board(
static hbool_t
lower_dim_size_comp_test__verify_data(uint32_t * buf_ptr,
-#if LOWER_DIM_SIZE_COMP_TEST__VERIFY_DATA__DEBUG
+#if LOWER_DIM_SIZE_COMP_TEST__VERIFY_DATA__DEBUG
const int mpi_rank,
#endif /* LOWER_DIM_SIZE_COMP_TEST__VERIFY_DATA__DEBUG */
const int rank,
@@ -1389,8 +1387,8 @@ lower_dim_size_comp_test__verify_data(uint32_t * buf_ptr,
hbool_t buf_starts_in_checker)
{
#if LOWER_DIM_SIZE_COMP_TEST__VERIFY_DATA__DEBUG
- const char * fcnName =
- "lower_dim_size_comp_test__verify_data():";
+ const char * fcnName =
+ "lower_dim_size_comp_test__verify_data():";
#endif
hbool_t good_data = TRUE;
hbool_t in_checker;
@@ -1409,16 +1407,16 @@ lower_dim_size_comp_test__verify_data(uint32_t * buf_ptr,
HDassert( checker_edge_size <= edge_size );
HDassert( test_max_rank <= LDSCT_DS_RANK );
-#if LOWER_DIM_SIZE_COMP_TEST__VERIFY_DATA__DEBUG
+#if LOWER_DIM_SIZE_COMP_TEST__VERIFY_DATA__DEBUG
if ( mpi_rank == LOWER_DIM_SIZE_COMP_TEST_DEBUG_TARGET_RANK ) {
HDfprintf(stdout, "%s mpi_rank = %d.\n", fcnName, mpi_rank);
HDfprintf(stdout, "%s rank = %d.\n", fcnName, rank);
HDfprintf(stdout, "%s edge_size = %d.\n", fcnName, edge_size);
- HDfprintf(stdout, "%s checker_edge_size = %d.\n",
+ HDfprintf(stdout, "%s checker_edge_size = %d.\n",
fcnName, checker_edge_size);
- HDfprintf(stdout, "%s first_expected_val = %d.\n",
+ HDfprintf(stdout, "%s first_expected_val = %d.\n",
fcnName, (int)first_expected_val);
- HDfprintf(stdout, "%s starts_in_checker = %d.\n",
+ HDfprintf(stdout, "%s starts_in_checker = %d.\n",
fcnName, (int)buf_starts_in_checker);
}
#endif
@@ -1463,7 +1461,7 @@ lower_dim_size_comp_test__verify_data(uint32_t * buf_ptr,
y = 0;
start_in_checker[3] = start_in_checker[2];
do
- {
+ {
if ( y >= checker_edge_size ) {
start_in_checker[3] = ! start_in_checker[3];
@@ -1472,8 +1470,8 @@ lower_dim_size_comp_test__verify_data(uint32_t * buf_ptr,
m = 0;
z = 0;
-#if LOWER_DIM_SIZE_COMP_TEST__VERIFY_DATA__DEBUG
- if ( mpi_rank ==
+#if LOWER_DIM_SIZE_COMP_TEST__VERIFY_DATA__DEBUG
+ if ( mpi_rank ==
LOWER_DIM_SIZE_COMP_TEST_DEBUG_TARGET_RANK ) {
HDfprintf(stdout, "%d, %d, %d, %d, %d:", i, j, k, l, m);
}
@@ -1481,8 +1479,8 @@ lower_dim_size_comp_test__verify_data(uint32_t * buf_ptr,
in_checker = start_in_checker[3];
do
{
-#if LOWER_DIM_SIZE_COMP_TEST__VERIFY_DATA__DEBUG
- if ( mpi_rank ==
+#if LOWER_DIM_SIZE_COMP_TEST__VERIFY_DATA__DEBUG
+ if ( mpi_rank ==
LOWER_DIM_SIZE_COMP_TEST_DEBUG_TARGET_RANK ) {
HDfprintf(stdout, " %d", (int)(*val_ptr));
}
@@ -1492,21 +1490,21 @@ lower_dim_size_comp_test__verify_data(uint32_t * buf_ptr,
in_checker = ! in_checker;
z = 0;
}
-
+
if ( in_checker ) {
-
+
if ( *val_ptr != expected_value ) {
good_data = FALSE;
}
-
+
/* zero out buffer for re-use */
*val_ptr = 0;
} else if ( *val_ptr != 0 ) {
good_data = FALSE;
-
+
/* zero out buffer for re-use */
*val_ptr = 0;
@@ -1516,11 +1514,11 @@ lower_dim_size_comp_test__verify_data(uint32_t * buf_ptr,
expected_value++;
m++;
z++;
-
+
} while ( ( rank >= (test_max_rank - 4) ) &&
( m < edge_size ) );
-#if LOWER_DIM_SIZE_COMP_TEST__VERIFY_DATA__DEBUG
- if ( mpi_rank ==
+#if LOWER_DIM_SIZE_COMP_TEST__VERIFY_DATA__DEBUG
+ if ( mpi_rank ==
LOWER_DIM_SIZE_COMP_TEST_DEBUG_TARGET_RANK ) {
HDfprintf(stdout, "\n");
}
@@ -1548,22 +1546,22 @@ lower_dim_size_comp_test__verify_data(uint32_t * buf_ptr,
/*-------------------------------------------------------------------------
- * Function: lower_dim_size_comp_test__run_test()
+ * Function: lower_dim_size_comp_test__run_test()
*
- * Purpose: Verify that a bug in the computation of the size of the
- * lower dimensions of a data space in H5S_obtain_datatype()
- * has been corrected.
+ * Purpose: Verify that a bug in the computation of the size of the
+ * lower dimensions of a data space in H5S_obtain_datatype()
+ * has been corrected.
*
- * Return: void
+ * Return: void
*
- * Programmer: JRM -- 11/11/09
+ * Programmer: JRM -- 11/11/09
*
* Modifications:
*
*-------------------------------------------------------------------------
*/
-#define LDSCT_DS_RANK 5
+#define LDSCT_DS_RANK 5
#define LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG 0
static void
@@ -1571,21 +1569,21 @@ lower_dim_size_comp_test__run_test(const int chunk_edge_size,
const hbool_t use_collective_io,
const hid_t dset_type)
{
-#if LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG
+#if LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG
const char *fcnName = "lower_dim_size_comp_test__run_test()";
- int rank;
- hsize_t dims[32];
- hsize_t max_dims[32];
+ int rank;
+ hsize_t dims[32];
+ hsize_t max_dims[32];
#endif /* LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG */
const char *filename;
- hbool_t data_ok = FALSE;
- hbool_t mis_match = FALSE;
+ hbool_t data_ok = FALSE;
+ hbool_t mis_match = FALSE;
int i;
int start_index;
int stop_index;
- int mrc;
- int mpi_rank;
- int mpi_size;
+ int mrc;
+ int mpi_rank;
+ int mpi_size;
MPI_Comm mpi_comm = MPI_COMM_NULL;
MPI_Info mpi_info = MPI_INFO_NULL;
hid_t fid; /* HDF5 file ID */
@@ -1635,7 +1633,7 @@ lower_dim_size_comp_test__run_test(const int chunk_edge_size,
mpi_comm = MPI_COMM_WORLD;
mpi_info = MPI_INFO_NULL;
-#if LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG
+#if LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG
if ( mpi_rank == LOWER_DIM_SIZE_COMP_TEST_DEBUG_TARGET_RANK ) {
HDfprintf(stdout, "%s:%d: chunk_edge_size = %d.\n",
fcnName, mpi_rank, (int)chunk_edge_size);
@@ -1650,13 +1648,13 @@ lower_dim_size_comp_test__run_test(const int chunk_edge_size,
large_ds_size = (size_t)((mpi_size + 1) * 10 * 10 * 10 * 10);
large_ds_slice_size = (size_t) (10 * 10 * 10 * 10);
-#if LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG
+#if LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG
if ( mpi_rank == LOWER_DIM_SIZE_COMP_TEST_DEBUG_TARGET_RANK ) {
HDfprintf(stdout, "%s:%d: small ds size / slice size = %d / %d.\n",
- fcnName, mpi_rank,
+ fcnName, mpi_rank,
(int)small_ds_size, (int)small_ds_slice_size);
HDfprintf(stdout, "%s:%d: large ds size / slice size = %d / %d.\n",
- fcnName, mpi_rank,
+ fcnName, mpi_rank,
(int)large_ds_size, (int)large_ds_slice_size);
}
#endif /* LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG */
@@ -1739,7 +1737,7 @@ lower_dim_size_comp_test__run_test(const int chunk_edge_size,
large_dims[3] = 10;
large_dims[4] = 10;
-#if LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG
+#if LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG
if ( mpi_rank == LOWER_DIM_SIZE_COMP_TEST_DEBUG_TARGET_RANK ) {
HDfprintf(stdout, "%s:%d: small_dims[] = %d %d %d %d %d\n",
fcnName, mpi_rank, (int)small_dims[0], (int)small_dims[1],
@@ -1748,41 +1746,41 @@ lower_dim_size_comp_test__run_test(const int chunk_edge_size,
fcnName, mpi_rank, (int)large_dims[0], (int)large_dims[1],
(int)large_dims[2], (int)large_dims[3], (int)large_dims[4]);
}
-#endif
+#endif
/* create data spaces */
full_mem_small_ds_sid = H5Screate_simple(5, small_dims, NULL);
- VRFY((full_mem_small_ds_sid != 0),
+ VRFY((full_mem_small_ds_sid != 0),
"H5Screate_simple() full_mem_small_ds_sid succeeded");
full_file_small_ds_sid = H5Screate_simple(5, small_dims, NULL);
- VRFY((full_file_small_ds_sid != 0),
+ VRFY((full_file_small_ds_sid != 0),
"H5Screate_simple() full_file_small_ds_sid succeeded");
mem_small_ds_sid = H5Screate_simple(5, small_dims, NULL);
- VRFY((mem_small_ds_sid != 0),
+ VRFY((mem_small_ds_sid != 0),
"H5Screate_simple() mem_small_ds_sid succeeded");
file_small_ds_sid = H5Screate_simple(5, small_dims, NULL);
- VRFY((file_small_ds_sid != 0),
+ VRFY((file_small_ds_sid != 0),
"H5Screate_simple() file_small_ds_sid succeeded");
full_mem_large_ds_sid = H5Screate_simple(5, large_dims, NULL);
- VRFY((full_mem_large_ds_sid != 0),
+ VRFY((full_mem_large_ds_sid != 0),
"H5Screate_simple() full_mem_large_ds_sid succeeded");
full_file_large_ds_sid = H5Screate_simple(5, large_dims, NULL);
- VRFY((full_file_large_ds_sid != 0),
+ VRFY((full_file_large_ds_sid != 0),
"H5Screate_simple() full_file_large_ds_sid succeeded");
mem_large_ds_sid = H5Screate_simple(5, large_dims, NULL);
- VRFY((mem_large_ds_sid != 0),
+ VRFY((mem_large_ds_sid != 0),
"H5Screate_simple() mem_large_ds_sid succeeded");
file_large_ds_sid = H5Screate_simple(5, large_dims, NULL);
- VRFY((file_large_ds_sid != 0),
+ VRFY((file_large_ds_sid != 0),
"H5Screate_simple() file_large_ds_sid succeeded");
@@ -1812,14 +1810,14 @@ lower_dim_size_comp_test__run_test(const int chunk_edge_size,
small_chunk_dims[1] = small_chunk_dims[2] = (hsize_t)1;
small_chunk_dims[3] = small_chunk_dims[4] = (hsize_t)chunk_edge_size;
-#if LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG
+#if LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG
if ( mpi_rank == LOWER_DIM_SIZE_COMP_TEST_DEBUG_TARGET_RANK ) {
HDfprintf(stdout, "%s:%d: small chunk dims[] = %d %d %d %d %d\n",
- fcnName, mpi_rank, (int)small_chunk_dims[0],
- (int)small_chunk_dims[1], (int)small_chunk_dims[2],
+ fcnName, mpi_rank, (int)small_chunk_dims[0],
+ (int)small_chunk_dims[1], (int)small_chunk_dims[2],
(int)small_chunk_dims[3], (int)small_chunk_dims[4]);
}
-#endif
+#endif
small_ds_dcpl_id = H5Pcreate(H5P_DATASET_CREATE);
VRFY((ret != FAIL), "H5Pcreate() small_ds_dcpl_id succeeded");
@@ -1831,18 +1829,18 @@ lower_dim_size_comp_test__run_test(const int chunk_edge_size,
VRFY((ret != FAIL), "H5Pset_chunk() small_ds_dcpl_id succeeded");
large_chunk_dims[0] = (hsize_t)(1);
- large_chunk_dims[1] = large_chunk_dims[2] =
- large_chunk_dims[3] = large_chunk_dims[4] = (hsize_t)chunk_edge_size;
+ large_chunk_dims[1] = large_chunk_dims[2] =
+ large_chunk_dims[3] = large_chunk_dims[4] = (hsize_t)chunk_edge_size;
-#if LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG
+#if LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG
if ( mpi_rank == LOWER_DIM_SIZE_COMP_TEST_DEBUG_TARGET_RANK ) {
HDfprintf(stdout, "%s:%d: large chunk dims[] = %d %d %d %d %d\n",
- fcnName, mpi_rank, (int)large_chunk_dims[0],
- (int)large_chunk_dims[1], (int)large_chunk_dims[2],
+ fcnName, mpi_rank, (int)large_chunk_dims[0],
+ (int)large_chunk_dims[1], (int)large_chunk_dims[2],
(int)large_chunk_dims[3], (int)large_chunk_dims[4]);
}
-#endif
+#endif
large_ds_dcpl_id = H5Pcreate(H5P_DATASET_CREATE);
VRFY((ret != FAIL), "H5Pcreate() large_ds_dcpl_id succeeded");
@@ -1868,11 +1866,11 @@ lower_dim_size_comp_test__run_test(const int chunk_edge_size,
large_ds_dcpl_id, H5P_DEFAULT);
VRFY((ret >= 0), "H5Dcreate2() large_dataset succeeded");
-#if LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG
+#if LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG
if ( mpi_rank == LOWER_DIM_SIZE_COMP_TEST_DEBUG_TARGET_RANK ) {
- HDfprintf(stdout,
- "%s:%d: small/large ds id = %d / %d.\n",
- fcnName, mpi_rank, (int)small_dataset,
+ HDfprintf(stdout,
+ "%s:%d: small/large ds id = %d / %d.\n",
+ fcnName, mpi_rank, (int)small_dataset,
(int)large_dataset);
}
#endif /* LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG */
@@ -1906,10 +1904,10 @@ lower_dim_size_comp_test__run_test(const int chunk_edge_size,
block[0] = block[1] = block[2] = 1;
block[3] = block[4] = 10;
-#if LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG
+#if LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG
if ( mpi_rank == LOWER_DIM_SIZE_COMP_TEST_DEBUG_TARGET_RANK ) {
- HDfprintf(stdout,
- "%s:%d: settings for small data set initialization.\n",
+ HDfprintf(stdout,
+ "%s:%d: settings for small data set initialization.\n",
fcnName, mpi_rank);
HDfprintf(stdout, "%s:%d: start[] = %d %d %d %d %d\n",
fcnName, mpi_rank, (int)start[0], (int)start[1],
@@ -1947,10 +1945,10 @@ lower_dim_size_comp_test__run_test(const int chunk_edge_size,
start[0] = 0;
-#if LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG
+#if LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG
if ( mpi_rank == LOWER_DIM_SIZE_COMP_TEST_DEBUG_TARGET_RANK ) {
- HDfprintf(stdout,
- "%s:%d: added settings for main process.\n",
+ HDfprintf(stdout,
+ "%s:%d: added settings for main process.\n",
fcnName, mpi_rank);
HDfprintf(stdout, "%s:%d: start[] = %d %d %d %d %d\n",
fcnName, mpi_rank, (int)start[0], (int)start[1],
@@ -1992,23 +1990,23 @@ lower_dim_size_comp_test__run_test(const int chunk_edge_size,
/* write the initial value of the small data set to file */
-#if LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG
+#if LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG
if ( mpi_rank == LOWER_DIM_SIZE_COMP_TEST_DEBUG_TARGET_RANK ) {
HDfprintf(stdout, "%s:%d: writing init value of small ds to file.\n",
fcnName, mpi_rank);
}
#endif /* LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG */
- ret = H5Dwrite(small_dataset,
- dset_type,
- mem_small_ds_sid,
+ ret = H5Dwrite(small_dataset,
+ dset_type,
+ mem_small_ds_sid,
file_small_ds_sid,
- xfer_plist,
+ xfer_plist,
small_ds_buf_0);
VRFY((ret >= 0), "H5Dwrite() small_dataset initial write succeeded");
- /* read the small data set back to verify that it contains the
- * expected data. Note that each process reads in the entire
+ /* read the small data set back to verify that it contains the
+ * expected data. Note that each process reads in the entire
* data set and verifies it.
*/
ret = H5Dread(small_dataset,
@@ -2061,10 +2059,10 @@ lower_dim_size_comp_test__run_test(const int chunk_edge_size,
block[0] = (hsize_t)1;
block[1] = block[2] = block[3] = block[4] = (hsize_t)10;
-#if LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG
+#if LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG
if ( mpi_rank == LOWER_DIM_SIZE_COMP_TEST_DEBUG_TARGET_RANK ) {
- HDfprintf(stdout,
- "%s:%d: settings for large data set initialization.\n",
+ HDfprintf(stdout,
+ "%s:%d: settings for large data set initialization.\n",
fcnName, mpi_rank);
HDfprintf(stdout, "%s:%d: start[] = %d %d %d %d %d\n",
fcnName, mpi_rank, (int)start[0], (int)start[1],
@@ -2097,15 +2095,15 @@ lower_dim_size_comp_test__run_test(const int chunk_edge_size,
block);
VRFY((ret >= 0), "H5Sselect_hyperslab(file_large_ds_sid, set) suceeded");
-#if LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG
+#if LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG
if ( mpi_rank == LOWER_DIM_SIZE_COMP_TEST_DEBUG_TARGET_RANK ) {
- HDfprintf(stdout,
+ HDfprintf(stdout,
"%s%d: H5Sget_select_npoints(mem_large_ds_sid) = %d.\n",
- fcnName, mpi_rank,
+ fcnName, mpi_rank,
(int)H5Sget_select_npoints(mem_large_ds_sid));
- HDfprintf(stdout,
+ HDfprintf(stdout,
"%s%d: H5Sget_select_npoints(file_large_ds_sid) = %d.\n",
- fcnName, mpi_rank,
+ fcnName, mpi_rank,
(int)H5Sget_select_npoints(file_large_ds_sid));
}
#endif /* LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG */
@@ -2114,10 +2112,10 @@ lower_dim_size_comp_test__run_test(const int chunk_edge_size,
start[0] = (hsize_t)0;
-#if LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG
+#if LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG
if ( mpi_rank == LOWER_DIM_SIZE_COMP_TEST_DEBUG_TARGET_RANK ) {
- HDfprintf(stdout,
- "%s:%d: added settings for main process.\n",
+ HDfprintf(stdout,
+ "%s:%d: added settings for main process.\n",
fcnName, mpi_rank);
HDfprintf(stdout, "%s:%d: start[] = %d %d %d %d %d\n",
fcnName, mpi_rank, (int)start[0], (int)start[1],
@@ -2150,15 +2148,15 @@ lower_dim_size_comp_test__run_test(const int chunk_edge_size,
block);
VRFY((ret>= 0), "H5Sselect_hyperslab(file_large_ds_sid, or) suceeded");
-#if LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG
+#if LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG
if ( mpi_rank == LOWER_DIM_SIZE_COMP_TEST_DEBUG_TARGET_RANK ) {
- HDfprintf(stdout,
+ HDfprintf(stdout,
"%s%d: H5Sget_select_npoints(mem_large_ds_sid) = %d.\n",
- fcnName, mpi_rank,
+ fcnName, mpi_rank,
(int)H5Sget_select_npoints(mem_large_ds_sid));
- HDfprintf(stdout,
+ HDfprintf(stdout,
"%s%d: H5Sget_select_npoints(file_large_ds_sid) = %d.\n",
- fcnName, mpi_rank,
+ fcnName, mpi_rank,
(int)H5Sget_select_npoints(file_large_ds_sid));
}
#endif /* LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG */
@@ -2183,19 +2181,19 @@ lower_dim_size_comp_test__run_test(const int chunk_edge_size,
start, stride, count, block);
VRFY((ret != FAIL),"H5Sselect_hyperslab(file_large_ds_sid, and) succeeded");
-#if LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG
- if ( mpi_rank == LOWER_DIM_SIZE_COMP_TEST_DEBUG_TARGET_RANK ) {
+#if LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG
+ if ( mpi_rank == LOWER_DIM_SIZE_COMP_TEST_DEBUG_TARGET_RANK ) {
rank = H5Sget_simple_extent_dims(mem_large_ds_sid, dims, max_dims);
- HDfprintf(stdout,
+ HDfprintf(stdout,
"%s:%d: mem_large_ds_sid dims[%d] = %d %d %d %d %d\n",
- fcnName, mpi_rank, rank, (int)dims[0], (int)dims[1],
+ fcnName, mpi_rank, rank, (int)dims[0], (int)dims[1],
(int)dims[2], (int)dims[3], (int)dims[4]);
rank = H5Sget_simple_extent_dims(file_large_ds_sid, dims, max_dims);
- HDfprintf(stdout,
+ HDfprintf(stdout,
"%s:%d: file_large_ds_sid dims[%d] = %d %d %d %d %d\n",
- fcnName, mpi_rank, rank, (int)dims[0], (int)dims[1],
+ fcnName, mpi_rank, rank, (int)dims[0], (int)dims[1],
(int)dims[2], (int)dims[3], (int)dims[4]);
}
#endif /* LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG */
@@ -2208,26 +2206,26 @@ lower_dim_size_comp_test__run_test(const int chunk_edge_size,
/* write the initial value of the large data set to file */
-#if LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG
- if ( mpi_rank == LOWER_DIM_SIZE_COMP_TEST_DEBUG_TARGET_RANK ) {
+#if LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG
+ if ( mpi_rank == LOWER_DIM_SIZE_COMP_TEST_DEBUG_TARGET_RANK ) {
HDfprintf(stdout, "%s:%d: writing init value of large ds to file.\n",
fcnName, mpi_rank);
- HDfprintf(stdout,
+ HDfprintf(stdout,
"%s:%d: large_dataset = %d.\n",
- fcnName, mpi_rank,
+ fcnName, mpi_rank,
(int)large_dataset);
- HDfprintf(stdout,
+ HDfprintf(stdout,
"%s:%d: mem_large_ds_sid = %d, file_large_ds_sid = %d.\n",
- fcnName, mpi_rank,
+ fcnName, mpi_rank,
(int)mem_large_ds_sid, (int)file_large_ds_sid);
}
#endif /* LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG */
- ret = H5Dwrite(large_dataset,
- dset_type,
- mem_large_ds_sid,
+ ret = H5Dwrite(large_dataset,
+ dset_type,
+ mem_large_ds_sid,
file_large_ds_sid,
- xfer_plist,
+ xfer_plist,
large_ds_buf_0);
if ( ret < 0 ) H5Eprint2(H5E_DEFAULT, stderr);
@@ -2238,8 +2236,8 @@ lower_dim_size_comp_test__run_test(const int chunk_edge_size,
mrc = MPI_Barrier(MPI_COMM_WORLD);
VRFY((mrc==MPI_SUCCESS), "Sync after large dataset writes");
- /* read the large data set back to verify that it contains the
- * expected data. Note that each process reads in the entire
+ /* read the large data set back to verify that it contains the
+ * expected data. Note that each process reads in the entire
* data set.
*/
ret = H5Dread(large_dataset,
@@ -2278,13 +2276,13 @@ lower_dim_size_comp_test__run_test(const int chunk_edge_size,
/***********************************/
- /* read a checkerboard selection of the process slice of the
- * small on disk data set into the process slice of the large
+ /* read a checkerboard selection of the process slice of the
+ * small on disk data set into the process slice of the large
* in memory data set, and verify the data read.
*/
small_sel_start[0] = (hsize_t)(mpi_rank + 1);
- small_sel_start[1] = small_sel_start[2] =
+ small_sel_start[1] = small_sel_start[2] =
small_sel_start[3] = small_sel_start[4] = 0;
lower_dim_size_comp_test__select_checker_board(mpi_rank,
@@ -2296,9 +2294,9 @@ lower_dim_size_comp_test__run_test(const int chunk_edge_size,
small_sel_start);
expected_value = (uint32_t)
- ((small_sel_start[0] * small_dims[1] * small_dims[2] *
+ ((small_sel_start[0] * small_dims[1] * small_dims[2] *
small_dims[3] * small_dims[4]) +
- (small_sel_start[1] * small_dims[2] * small_dims[3] *
+ (small_sel_start[1] * small_dims[2] * small_dims[3] *
small_dims[4]) +
(small_sel_start[2] * small_dims[3] * small_dims[4]) +
(small_sel_start[3] * small_dims[4]) +
@@ -2335,7 +2333,7 @@ lower_dim_size_comp_test__run_test(const int chunk_edge_size,
VRFY((ret >= 0), "H5Sread() slice from small ds succeeded.");
-#if LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG
+#if LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG
if ( mpi_rank == LOWER_DIM_SIZE_COMP_TEST_DEBUG_TARGET_RANK ) {
HDfprintf(stdout, "%s:%d: H5Dread() returns.\n", fcnName, mpi_rank);
}
@@ -2345,9 +2343,9 @@ lower_dim_size_comp_test__run_test(const int chunk_edge_size,
data_ok = TRUE;
- start_index = (int)((large_sel_start[0] * large_dims[1] * large_dims[2] *
+ start_index = (int)((large_sel_start[0] * large_dims[1] * large_dims[2] *
large_dims[3] * large_dims[4]) +
- (large_sel_start[1] * large_dims[2] * large_dims[3] *
+ (large_sel_start[1] * large_dims[2] * large_dims[3] *
large_dims[4]) +
(large_sel_start[2] * large_dims[3] * large_dims[4]) +
(large_sel_start[3] * large_dims[4]) +
@@ -2409,13 +2407,13 @@ lower_dim_size_comp_test__run_test(const int chunk_edge_size,
- /* read a checkerboard selection of a slice of the process slice of
- * the large on disk data set into the process slice of the small
+ /* read a checkerboard selection of a slice of the process slice of
+ * the large on disk data set into the process slice of the small
* in memory data set, and verify the data read.
*/
small_sel_start[0] = (hsize_t)(mpi_rank + 1);
- small_sel_start[1] = small_sel_start[2] =
+ small_sel_start[1] = small_sel_start[2] =
small_sel_start[3] = small_sel_start[4] = 0;
lower_dim_size_comp_test__select_checker_board(mpi_rank,
@@ -2456,7 +2454,7 @@ lower_dim_size_comp_test__run_test(const int chunk_edge_size,
VRFY((ret >= 0), "H5Sread() slice from large ds succeeded.");
-#if LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG
+#if LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG
if ( mpi_rank == LOWER_DIM_SIZE_COMP_TEST_DEBUG_TARGET_RANK ) {
HDfprintf(stdout, "%s:%d: H5Dread() returns.\n", fcnName, mpi_rank);
}
@@ -2467,9 +2465,9 @@ lower_dim_size_comp_test__run_test(const int chunk_edge_size,
data_ok = TRUE;
expected_value = (uint32_t)
- ((large_sel_start[0] * large_dims[1] * large_dims[2] *
+ ((large_sel_start[0] * large_dims[1] * large_dims[2] *
large_dims[3] * large_dims[4]) +
- (large_sel_start[1] * large_dims[2] * large_dims[3] *
+ (large_sel_start[1] * large_dims[2] * large_dims[3] *
large_dims[4]) +
(large_sel_start[2] * large_dims[3] * large_dims[4]) +
(large_sel_start[3] * large_dims[4]) +
@@ -2522,7 +2520,7 @@ lower_dim_size_comp_test__run_test(const int chunk_edge_size,
#if LOWER_DIM_SIZE_COMP_TEST__VERIFY_DATA__DEBUG
if ( mpi_rank == LOWER_DIM_SIZE_COMP_TEST_DEBUG_TARGET_RANK ) {
- HDfprintf(stdout, "%s:%d: unexpected value at index %d: %d.\n",
+ HDfprintf(stdout, "%s:%d: unexpected value at index %d: %d.\n",
fcnName, mpi_rank, (int)i, (int)(*ptr_1));
}
#endif /* LOWER_DIM_SIZE_COMP_TEST__VERIFY_DATA__DEBUG */
@@ -2590,15 +2588,15 @@ lower_dim_size_comp_test__run_test(const int chunk_edge_size,
/*-------------------------------------------------------------------------
- * Function: lower_dim_size_comp_test()
+ * Function: lower_dim_size_comp_test()
*
- * Purpose: Test to see if an error in the computation of the size
- * of the lower dimensions in H5S_obtain_datatype() has
- * been corrected.
+ * Purpose: Test to see if an error in the computation of the size
+ * of the lower dimensions in H5S_obtain_datatype() has
+ * been corrected.
*
- * Return: void
+ * Return: void
*
- * Programmer: JRM -- 11/11/09
+ * Programmer: JRM -- 11/11/09
*
* Modifications:
*
@@ -2609,15 +2607,15 @@ void
lower_dim_size_comp_test(void)
{
/* const char *fcnName = "lower_dim_size_comp_test()"; */
- int chunk_edge_size = 0;
- int use_collective_io = 1;
- hid_t dset_type = H5T_NATIVE_UINT;
+ int chunk_edge_size = 0;
+ int use_collective_io = 1;
+ hid_t dset_type = H5T_NATIVE_UINT;
#if 0
HDsleep(60);
#endif
HDcompile_assert(sizeof(uint32_t) == sizeof(unsigned));
- for ( use_collective_io = (hbool_t)0;
- (int)use_collective_io <= 1;
+ for ( use_collective_io = (hbool_t)0;
+ (int)use_collective_io <= 1;
(hbool_t)(use_collective_io++) ) {
chunk_edge_size = 0;
@@ -2638,37 +2636,37 @@ lower_dim_size_comp_test(void)
/*-------------------------------------------------------------------------
- * Function: link_chunk_collective_io_test()
+ * Function: link_chunk_collective_io_test()
*
- * Purpose: Test to verify that an error in MPI type management in
- * H5D_link_chunk_collective_io() has been corrected.
- * In this bug, we used to free MPI types regardless of
- * whether they were basic or derived.
+ * Purpose: Test to verify that an error in MPI type management in
+ * H5D_link_chunk_collective_io() has been corrected.
+ * In this bug, we used to free MPI types regardless of
+ * whether they were basic or derived.
*
- * This test is based on a bug report kindly provided by
- * Rob Latham of the MPICH team and ANL.
+ * This test is based on a bug report kindly provided by
+ * Rob Latham of the MPICH team and ANL.
*
- * The basic thrust of the test is to cause a process
- * to participate in a collective I/O in which it:
+ * The basic thrust of the test is to cause a process
+ * to participate in a collective I/O in which it:
*
- * 1) Reads or writes exactly one chunk,
+ * 1) Reads or writes exactly one chunk,
*
- * 2) Has no in memory buffer for any other chunk.
+ * 2) Has no in memory buffer for any other chunk.
*
- * The test differers from Rob Latham's bug report in
- * that is runs with an arbitrary number of proceeses,
- * and uses a 1 dimensional dataset.
+ * The test differers from Rob Latham's bug report in
+ * that is runs with an arbitrary number of proceeses,
+ * and uses a 1 dimensional dataset.
*
- * Return: void
+ * Return: void
*
- * Programmer: JRM -- 12/16/09
+ * Programmer: JRM -- 12/16/09
*
* Modifications:
*
*-------------------------------------------------------------------------
*/
-#define LINK_CHUNK_COLLECTIVE_IO_TEST_CHUNK_SIZE 16
+#define LINK_CHUNK_COLLECTIVE_IO_TEST_CHUNK_SIZE 16
void
link_chunk_collective_io_test(void)
@@ -2676,8 +2674,8 @@ link_chunk_collective_io_test(void)
/* const char *fcnName = "link_chunk_collective_io_test()"; */
const char *filename;
hbool_t mis_match = FALSE;
- int i;
- int mrc;
+ int i;
+ int mrc;
int mpi_rank;
int mpi_size;
MPI_Comm mpi_comm = MPI_COMM_WORLD;
@@ -2767,8 +2765,8 @@ link_chunk_collective_io_test(void)
for ( i = 0; i < LINK_CHUNK_COLLECTIVE_IO_TEST_CHUNK_SIZE; i++ ) {
local_data_written[i] = expected_value;
- local_data_read[i] = 0.0;
- expected_value += 1.0;
+ local_data_read[i] = 0.0;
+ expected_value += 1.0;
}
/* select the file and mem spaces */
@@ -2794,15 +2792,15 @@ link_chunk_collective_io_test(void)
VRFY((ret >= 0), "H5Pset_dxpl_mpio succeeded");
/* write the data set */
- ret = H5Dwrite(dset_id,
- H5T_NATIVE_DOUBLE,
- write_mem_ds_sid,
+ ret = H5Dwrite(dset_id,
+ H5T_NATIVE_DOUBLE,
+ write_mem_ds_sid,
file_ds_sid,
- xfer_plist,
+ xfer_plist,
local_data_written);
VRFY((ret >= 0), "H5Dwrite() dataset initial write succeeded");
-
+
/* sync with the other processes before checking data */
mrc = MPI_Barrier(MPI_COMM_WORLD);
VRFY((mrc==MPI_SUCCESS), "Sync after dataset write");
@@ -2830,7 +2828,7 @@ link_chunk_collective_io_test(void)
if ( diff >= 0.001 ) {
mis_match = TRUE;
- }
+ }
}
VRFY( (mis_match == FALSE), "dataset data good.");
diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt
index 4b3b3d5..41a9fdc 100644
--- a/tools/CMakeLists.txt
+++ b/tools/CMakeLists.txt
@@ -9,9 +9,7 @@ add_definitions (${HDF_EXTRA_C_FLAGS})
# --------------------------------------------------------------------
# If testing was NOT enabled, then we need to build the tools library
# --------------------------------------------------------------------
-if (NOT BUILD_TESTING)
- add_subdirectory (${HDF5_TOOLS_SOURCE_DIR}/lib)
-endif ()
+add_subdirectory (lib)
#-----------------------------------------------------------------------------
# Setup include Directories
@@ -19,9 +17,9 @@ endif ()
INCLUDE_DIRECTORIES (${HDF5_TOOLS_SOURCE_DIR}/lib)
#-- Add the test sources
-add_subdirectory (${HDF5_TOOLS_SOURCE_DIR}/src)
+add_subdirectory (src)
#-- Add the tests
if (BUILD_TESTING)
- add_subdirectory (${HDF5_TOOLS_SOURCE_DIR}/test)
+ add_subdirectory (test)
endif ()
diff --git a/tools/lib/h5tools.c b/tools/lib/h5tools.c
index 89cb524..11888bc 100644
--- a/tools/lib/h5tools.c
+++ b/tools/lib/h5tools.c
@@ -43,7 +43,7 @@ unsigned packed_bits_num; /* number of packed bits to display */
unsigned packed_data_offset; /* offset of packed bits to display */
unsigned packed_data_length; /* length of packed bits to display */
unsigned long long packed_data_mask; /* mask in which packed bits to display */
-int enable_error_stack= FALSE; /* re-enable error stack */
+int enable_error_stack = 0; /* re-enable error stack; disable=0 enable=1 */
/* sort parameters */
H5_index_t sort_by = H5_INDEX_NAME; /*sort_by [creation_order | name] */
@@ -548,9 +548,15 @@ h5tools_fopen(const char *fname, unsigned flags, hid_t fapl, const char *driver,
if ((my_fapl = h5tools_get_fapl(fapl, driver, &drivernum)) < 0)
goto done;
- H5E_BEGIN_TRY {
+ /* allow error stack display if enable-error-stack has optional arg number */
+ if (enable_error_stack > 1) {
fid = H5Fopen(fname, flags, my_fapl);
- } H5E_END_TRY;
+ }
+ else {
+ H5E_BEGIN_TRY {
+ fid = H5Fopen(fname, flags, my_fapl);
+ } H5E_END_TRY;
+ }
if (fid == FAIL)
goto done;
@@ -563,9 +569,15 @@ h5tools_fopen(const char *fname, unsigned flags, hid_t fapl, const char *driver,
if((my_fapl = h5tools_get_fapl(fapl, drivernames[drivernum], NULL)) < 0)
goto done;
- H5E_BEGIN_TRY {
+ /* allow error stack display if enable-error-stack has optional arg number */
+ if (enable_error_stack > 1) {
fid = H5Fopen(fname, flags, my_fapl);
- } H5E_END_TRY;
+ }
+ else {
+ H5E_BEGIN_TRY {
+ fid = H5Fopen(fname, flags, my_fapl);
+ } H5E_END_TRY;
+ }
if (fid != FAIL)
break;
diff --git a/tools/lib/h5tools.h b/tools/lib/h5tools.h
index 6383df5..c360230 100644
--- a/tools/lib/h5tools.h
+++ b/tools/lib/h5tools.h
@@ -573,7 +573,7 @@ H5TOOLS_DLLVAR H5_index_t sort_by; /*sort_by [creation_order | name] *
H5TOOLS_DLLVAR H5_iter_order_t sort_order; /*sort_order [ascending | descending] */
/* things to display or which are set via command line parameters */
-H5TOOLS_DLLVAR int enable_error_stack; /* re-enable error stack */
+H5TOOLS_DLLVAR int enable_error_stack; /* re-enable error stack; disable=0 enable=1 */
/* Strings for output */
#define H5_TOOLS_GROUP "GROUP"
diff --git a/tools/lib/h5tools_dump.c b/tools/lib/h5tools_dump.c
index ed7d38a..38ace81 100644
--- a/tools/lib/h5tools_dump.c
+++ b/tools/lib/h5tools_dump.c
@@ -2080,7 +2080,6 @@ h5tools_print_datatype(FILE *stream, h5tools_str_t *buffer, const h5tool_format_
ctx->indent_level++;
ctx->need_prefix = TRUE;
- h5tools_simple_prefix(stream, info, ctx, (hsize_t)0, 0);
h5tools_str_reset(buffer);
@@ -2091,7 +2090,6 @@ h5tools_print_datatype(FILE *stream, h5tools_str_t *buffer, const h5tool_format_
h5tools_render_element(stream, info, ctx, buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0);
ctx->need_prefix = TRUE;
- h5tools_simple_prefix(stream, info, ctx, (hsize_t)0, 0);
h5tools_str_reset(buffer);
@@ -2131,7 +2129,6 @@ h5tools_print_datatype(FILE *stream, h5tools_str_t *buffer, const h5tool_format_
h5tools_render_element(stream, info, ctx, buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0);
ctx->need_prefix = TRUE;
- h5tools_simple_prefix(stream, info, ctx, (hsize_t)0, 0);
h5tools_str_reset(buffer);
@@ -2170,7 +2167,6 @@ h5tools_print_datatype(FILE *stream, h5tools_str_t *buffer, const h5tool_format_
h5tools_render_element(stream, info, ctx, buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0);
ctx->need_prefix = TRUE;
- h5tools_simple_prefix(stream, info, ctx, (hsize_t)0, 0);
h5tools_str_reset(buffer);
@@ -2245,7 +2241,6 @@ h5tools_print_datatype(FILE *stream, h5tools_str_t *buffer, const h5tool_format_
ctx->indent_level--;
ctx->need_prefix = TRUE;
- h5tools_simple_prefix(stream, info, ctx, (hsize_t)0, 0);
h5tools_str_reset(buffer);
if(H5Tclose(str_type) < 0)
@@ -2288,7 +2283,6 @@ h5tools_print_datatype(FILE *stream, h5tools_str_t *buffer, const h5tool_format_
H5E_THROW(FAIL, H5E_tools_min_id_g, "H5Tget_tag failed");
ctx->need_prefix = TRUE;
- h5tools_simple_prefix(stream, info, ctx, (hsize_t)0, 0);
h5tools_str_reset(buffer);
h5tools_str_append(buffer, "OPAQUE_TAG \"%s\";", ttag);
@@ -2299,7 +2293,6 @@ h5tools_print_datatype(FILE *stream, h5tools_str_t *buffer, const h5tool_format_
ctx->indent_level--;
ctx->need_prefix = TRUE;
- h5tools_simple_prefix(stream, info, ctx, (hsize_t)0, 0);
h5tools_str_reset(buffer);
h5tools_str_append(buffer, "%s", h5tools_dump_header_format->structblockend);
@@ -2318,7 +2311,6 @@ h5tools_print_datatype(FILE *stream, h5tools_str_t *buffer, const h5tool_format_
mname = H5Tget_member_name(type, i);
if((mtype = H5Tget_member_type(type, i)) >= 0) {
ctx->need_prefix = TRUE;
- h5tools_simple_prefix(stream, info, ctx, (hsize_t)0, 0);
h5tools_str_reset(buffer);
h5tools_print_datatype(stream, buffer, info, ctx, mtype, TRUE);
@@ -2335,7 +2327,6 @@ h5tools_print_datatype(FILE *stream, h5tools_str_t *buffer, const h5tool_format_
ctx->indent_level--;
ctx->need_prefix = TRUE;
- h5tools_simple_prefix(stream, info, ctx, (hsize_t)0, 0);
h5tools_str_reset(buffer);
h5tools_str_append(buffer, "%s", h5tools_dump_header_format->structblockend);
@@ -2360,7 +2351,6 @@ h5tools_print_datatype(FILE *stream, h5tools_str_t *buffer, const h5tool_format_
ctx->indent_level++;
ctx->need_prefix = TRUE;
- h5tools_simple_prefix(stream, info, ctx, (hsize_t)0, 0);
h5tools_str_reset(buffer);
h5tools_print_datatype(stream, buffer, info, ctx, super, TRUE);
@@ -2376,7 +2366,6 @@ h5tools_print_datatype(FILE *stream, h5tools_str_t *buffer, const h5tool_format_
ctx->indent_level--;
ctx->need_prefix = TRUE;
- h5tools_simple_prefix(stream, info, ctx, (hsize_t)0, 0);
h5tools_str_reset(buffer);
h5tools_str_append(buffer, "%s", h5tools_dump_header_format->enumblockend);
@@ -2792,7 +2781,6 @@ h5tools_dump_oid(FILE *stream, const h5tool_format_t *info,
ncols = info->line_ncols;
ctx->need_prefix = TRUE;
- h5tools_simple_prefix(stream, info, ctx, curr_pos, 0);
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "%s %s %d %s", OBJID, BEGIN, oid, END);
@@ -2820,7 +2808,6 @@ h5tools_print_virtual_selection(hid_t vspace,
switch(H5Sget_select_type(vspace)) {
case H5S_SEL_NONE: /* Nothing selected */
ctx->need_prefix = TRUE;
- h5tools_simple_prefix(stream, info, ctx, *curr_pos, 0);
h5tools_str_reset(buffer);
h5tools_str_append(buffer, "%s", VDS_NONE);
@@ -2833,7 +2820,6 @@ h5tools_print_virtual_selection(hid_t vspace,
break;
case H5S_SEL_HYPERSLABS: /* "New-style" hyperslab selection defined */
ctx->need_prefix = TRUE;
- h5tools_simple_prefix(stream, info, ctx, *curr_pos, 0);
h5tools_str_reset(buffer);
if (H5Sis_regular_hyperslab(vspace)) {
@@ -2856,14 +2842,12 @@ h5tools_print_virtual_selection(hid_t vspace,
}
h5tools_render_element(stream, info, ctx, buffer, curr_pos, (size_t) ncols, (hsize_t) 0, (hsize_t) 0);
ctx->need_prefix = TRUE;
- h5tools_simple_prefix(stream, info, ctx, *curr_pos, 0);
h5tools_str_reset(buffer);
h5tools_str_append(buffer, "%s", h5tools_dump_header_format->virtualselectionblockend);
break;
case H5S_SEL_ALL: /* Entire extent selected */
ctx->need_prefix = TRUE;
- h5tools_simple_prefix(stream, info, ctx, *curr_pos, 0);
h5tools_str_reset(buffer);
h5tools_str_append(buffer, "%s", VDS_ALL);
@@ -2956,7 +2940,6 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info,
*-------------------------------------------------------------------------
*/
ctx->need_prefix = TRUE;
- h5tools_simple_prefix(stream, info, ctx, curr_pos, 0);
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "%s %s", STORAGE_LAYOUT, BEGIN);
@@ -2967,7 +2950,6 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info,
case H5D_CHUNKED:
ctx->indent_level++;
ctx->need_prefix = TRUE;
- h5tools_simple_prefix(stream, info, ctx, curr_pos, 0);
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "%s ", CHUNKED);
@@ -2980,7 +2962,6 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info,
h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t) ncols, (hsize_t) 0, (hsize_t) 0);
ctx->need_prefix = TRUE;
- h5tools_simple_prefix(stream, info, ctx, curr_pos, 0);
h5tools_str_reset(&buffer);
@@ -3036,14 +3017,12 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info,
case H5D_COMPACT:
ctx->indent_level++;
ctx->need_prefix = TRUE;
- h5tools_simple_prefix(stream, info, ctx, curr_pos, 0);
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "%s", COMPACT);
h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t) ncols, (hsize_t) 0, (hsize_t) 0);
ctx->need_prefix = TRUE;
- h5tools_simple_prefix(stream, info, ctx, curr_pos, 0);
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "SIZE " HSIZE_T_FORMAT, storage_size);
@@ -3063,14 +3042,12 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info,
ctx->indent_level++;
if (next) {
ctx->need_prefix = TRUE;
- h5tools_simple_prefix(stream, info, ctx, curr_pos, 0);
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "%s", CONTIGUOUS);
h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t) ncols, (hsize_t) 0, (hsize_t) 0);
ctx->need_prefix = TRUE;
- h5tools_simple_prefix(stream, info, ctx, curr_pos, 0);
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "%s %s", EXTERNAL, BEGIN);
@@ -3081,7 +3058,6 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info,
H5Pget_external(dcpl_id, j, sizeof(name), name, &offset, &size);
ctx->need_prefix = TRUE;
- h5tools_simple_prefix(stream, info, ctx, curr_pos, 0);
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "FILENAME %s SIZE " HSIZE_T_FORMAT, name, size);
@@ -3091,7 +3067,6 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info,
ctx->indent_level--;
ctx->need_prefix = TRUE;
- h5tools_simple_prefix(stream, info, ctx, curr_pos, 0);
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "%s", END);
@@ -3101,21 +3076,18 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info,
haddr_t ioffset;
ctx->need_prefix = TRUE;
- h5tools_simple_prefix(stream, info, ctx, curr_pos, 0);
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "%s", CONTIGUOUS);
h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t) ncols, (hsize_t) 0, (hsize_t) 0);
ctx->need_prefix = TRUE;
- h5tools_simple_prefix(stream, info, ctx, curr_pos, 0);
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer,"SIZE " HSIZE_T_FORMAT, storage_size);
h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t) ncols, (hsize_t) 0, (hsize_t) 0);
ctx->need_prefix = TRUE;
- h5tools_simple_prefix(stream, info, ctx, curr_pos, 0);
h5tools_str_reset(&buffer);
ioffset = H5Dget_offset(obj_id);
@@ -3143,7 +3115,6 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info,
hid_t virtual_srcspace = H5Pget_virtual_srcspace(dcpl_id, next);
ctx->need_prefix = TRUE;
- h5tools_simple_prefix(stream, info, ctx, curr_pos, 0);
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "%s %ld %s ", VDS_MAPPING, next, BEGIN);
@@ -3152,7 +3123,6 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info,
ctx->indent_level++;
ctx->need_prefix = TRUE;
- h5tools_simple_prefix(stream, info, ctx, curr_pos, 0);
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "%s %s", VDS_VIRTUAL, BEGIN);
@@ -3165,14 +3135,12 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info,
ctx->indent_level--;
ctx->need_prefix = TRUE;
- h5tools_simple_prefix(stream, info, ctx, curr_pos, 0);
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "%s", END);
h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t) ncols, (hsize_t) 0, (hsize_t) 0);
ctx->need_prefix = TRUE;
- h5tools_simple_prefix(stream, info, ctx, curr_pos, 0);
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "%s %s", VDS_SOURCE, BEGIN);
@@ -3190,7 +3158,6 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info,
H5Pget_virtual_dsetname(dcpl_id, next, dsetname, sizeof(dsetname));
ctx->need_prefix = TRUE;
- h5tools_simple_prefix(stream, info, ctx, curr_pos, 0);
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "%s %s", VDS_SRC_FILE, h5tools_dump_header_format->virtualfilenamebegin);
@@ -3199,7 +3166,6 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info,
h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t) ncols, (hsize_t) 0, (hsize_t) 0);
ctx->need_prefix = TRUE;
- h5tools_simple_prefix(stream, info, ctx, curr_pos, 0);
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "%s %s", VDS_SRC_DATASET, h5tools_dump_header_format->virtualdatasetnamebegin);
@@ -3212,7 +3178,6 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info,
ctx->indent_level--;
ctx->need_prefix = TRUE;
- h5tools_simple_prefix(stream, info, ctx, curr_pos, 0);
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "%s", END);
@@ -3221,7 +3186,6 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info,
ctx->indent_level--;
ctx->need_prefix = TRUE;
- h5tools_simple_prefix(stream, info, ctx, curr_pos, 0);
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "%s", END);
@@ -3241,7 +3205,6 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info,
}/*switch*/
ctx->need_prefix = TRUE;
- h5tools_simple_prefix(stream, info, ctx, curr_pos, 0);
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "%s", END);
@@ -3253,7 +3216,6 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info,
*/
if (H5D_VIRTUAL != stl) {
ctx->need_prefix = TRUE;
- h5tools_simple_prefix(stream, info, ctx, curr_pos, 0);
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "%s %s", FILTERS, BEGIN);
@@ -3271,7 +3233,6 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info,
continue; /* nothing to print for invalid filter */
ctx->need_prefix = TRUE;
- h5tools_simple_prefix(stream, info, ctx, curr_pos, 0);
h5tools_str_reset(&buffer);
switch(filtn) {
@@ -3297,14 +3258,12 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info,
ctx->indent_level++;
ctx->need_prefix = TRUE;
- h5tools_simple_prefix(stream, info, ctx, curr_pos, 0);
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "PIXELS_PER_BLOCK %d", szip_pixels_per_block);
h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0);
ctx->need_prefix = TRUE;
- h5tools_simple_prefix(stream, info, ctx, curr_pos, 0);
h5tools_str_reset(&buffer);
if(szip_options_mask & H5_SZIP_CHIP_OPTION_MASK)
@@ -3314,7 +3273,6 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info,
h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0);
ctx->need_prefix = TRUE;
- h5tools_simple_prefix(stream, info, ctx, curr_pos, 0);
h5tools_str_reset(&buffer);
if(szip_options_mask & H5_SZIP_EC_OPTION_MASK)
@@ -3324,7 +3282,6 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info,
h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0);
ctx->need_prefix = TRUE;
- h5tools_simple_prefix(stream, info, ctx, curr_pos, 0);
h5tools_str_reset(&buffer);
if(szip_options_mask & H5_SZIP_LSB_OPTION_MASK)
@@ -3335,7 +3292,6 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info,
if(szip_options_mask & H5_SZIP_RAW_OPTION_MASK) {
ctx->need_prefix = TRUE;
- h5tools_simple_prefix(stream, info, ctx, curr_pos, 0);
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "HEADER %s", "RAW");
@@ -3345,7 +3301,6 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info,
ctx->indent_level--;
ctx->need_prefix = TRUE;
- h5tools_simple_prefix(stream, info, ctx, curr_pos, 0);
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "%s", END);
@@ -3366,7 +3321,6 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info,
ctx->indent_level++;
ctx->need_prefix = TRUE;
- h5tools_simple_prefix(stream, info, ctx, curr_pos, 0);
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "FILTER_ID %d", filtn);
@@ -3374,7 +3328,6 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info,
if(f_name[0] != '\0') {
ctx->need_prefix = TRUE;
- h5tools_simple_prefix(stream, info, ctx, curr_pos, 0);
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "COMMENT %s", f_name);
@@ -3382,7 +3335,6 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info,
}
if (cd_nelmts) {
ctx->need_prefix = TRUE;
- h5tools_simple_prefix(stream, info, ctx, curr_pos, 0);
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "%s %s ","PARAMS", BEGIN);
@@ -3394,7 +3346,6 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info,
ctx->indent_level--;
ctx->need_prefix = TRUE;
- h5tools_simple_prefix(stream, info, ctx, curr_pos, 0);
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "%s",END);
@@ -3406,7 +3357,6 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info,
else {
ctx->need_prefix = TRUE;
- h5tools_simple_prefix(stream, info, ctx, curr_pos, 0);
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "NONE");
@@ -3415,7 +3365,6 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info,
ctx->indent_level--;
ctx->need_prefix = TRUE;
- h5tools_simple_prefix(stream, info, ctx, curr_pos, 0);
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "%s",END);
@@ -3427,7 +3376,6 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info,
*-------------------------------------------------------------------------
*/
ctx->need_prefix = TRUE;
- h5tools_simple_prefix(stream, info, ctx, curr_pos, 0);
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "%s %s", FILLVALUE, BEGIN);
@@ -3436,7 +3384,6 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info,
ctx->indent_level++;
ctx->need_prefix = TRUE;
- h5tools_simple_prefix(stream, info, ctx, curr_pos, 0);
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "FILL_TIME ");
@@ -3460,7 +3407,6 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info,
h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0);
ctx->need_prefix = TRUE;
- h5tools_simple_prefix(stream, info, ctx, curr_pos, 0);
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "%s ", "VALUE ");
@@ -3486,7 +3432,6 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info,
ctx->indent_level--;
ctx->need_prefix = TRUE;
- h5tools_simple_prefix(stream, info, ctx, curr_pos, 0);
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "%s", END);
@@ -3498,7 +3443,6 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info,
*/
if (H5D_VIRTUAL != stl) {
ctx->need_prefix = TRUE;
- h5tools_simple_prefix(stream, info, ctx, curr_pos, 0);
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "ALLOCATION_TIME %s", BEGIN);
@@ -3507,7 +3451,6 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info,
ctx->indent_level++;
ctx->need_prefix = TRUE;
- h5tools_simple_prefix(stream, info, ctx, curr_pos, 0);
h5tools_str_reset(&buffer);
H5Pget_alloc_time(dcpl_id, &at);
@@ -3532,7 +3475,6 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info,
ctx->indent_level--;
ctx->need_prefix = TRUE;
- h5tools_simple_prefix(stream, info, ctx, curr_pos, 0);
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "%s", END);
@@ -3626,7 +3568,6 @@ h5tools_dump_attribute(FILE *stream, const h5tool_format_t *info,
ncols = info->line_ncols;
ctx->need_prefix = TRUE;
- h5tools_simple_prefix(stream, info, ctx, curr_pos, 0);
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "%s \"%s\" %s",
@@ -3663,7 +3604,6 @@ h5tools_dump_attribute(FILE *stream, const h5tool_format_t *info,
}
ctx->need_prefix = TRUE;
- h5tools_simple_prefix(stream, info, ctx, (hsize_t)0, 0);
h5tools_str_reset(&buffer);
@@ -3782,7 +3722,6 @@ h5tools_dump_subsetting_header(FILE *stream, const h5tool_format_t *info,
ncols = info->line_ncols;
ctx->need_prefix = TRUE;
- h5tools_simple_prefix(stream, info, ctx, (hsize_t)0, 0);
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "%s %s", h5tools_dump_header_format->subsettingbegin, h5tools_dump_header_format->subsettingblockbegin);
@@ -3791,7 +3730,6 @@ h5tools_dump_subsetting_header(FILE *stream, const h5tool_format_t *info,
ctx->indent_level++;
ctx->need_prefix = TRUE;
- h5tools_simple_prefix(stream, info, ctx, (hsize_t)0, 0);
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "%s %s ", h5tools_dump_header_format->startbegin, h5tools_dump_header_format->startblockbegin);
@@ -3800,7 +3738,6 @@ h5tools_dump_subsetting_header(FILE *stream, const h5tool_format_t *info,
h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0);
ctx->need_prefix = TRUE;
- h5tools_simple_prefix(stream, info, ctx, (hsize_t)0, 0);
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "%s %s ", h5tools_dump_header_format->stridebegin, h5tools_dump_header_format->strideblockbegin);
@@ -3809,7 +3746,6 @@ h5tools_dump_subsetting_header(FILE *stream, const h5tool_format_t *info,
h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0);
ctx->need_prefix = TRUE;
- h5tools_simple_prefix(stream, info, ctx, (hsize_t)0, 0);
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "%s %s ", h5tools_dump_header_format->countbegin, h5tools_dump_header_format->countblockbegin);
@@ -3823,7 +3759,6 @@ h5tools_dump_subsetting_header(FILE *stream, const h5tool_format_t *info,
h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0);
ctx->need_prefix = TRUE;
- h5tools_simple_prefix(stream, info, ctx, (hsize_t)0, 0);
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "%s %s ", h5tools_dump_header_format->blockbegin, h5tools_dump_header_format->blockblockbegin);
diff --git a/tools/src/CMakeLists.txt b/tools/src/CMakeLists.txt
index 37680dd..24e682a 100644
--- a/tools/src/CMakeLists.txt
+++ b/tools/src/CMakeLists.txt
@@ -7,31 +7,31 @@ PROJECT (HDF5_TOOLS_SRC)
add_definitions (${HDF_EXTRA_C_FLAGS})
#-- Add the h5diff and test executables
-add_subdirectory (${HDF5_TOOLS_SRC_SOURCE_DIR}/h5diff)
+add_subdirectory (h5diff)
#-- Add the h5ls executable
-add_subdirectory (${HDF5_TOOLS_SRC_SOURCE_DIR}/h5ls)
+add_subdirectory (h5ls)
#-- Misc Executables
-add_subdirectory (${HDF5_TOOLS_SRC_SOURCE_DIR}/misc)
+add_subdirectory (misc)
#-- Add the h5import and test executables
-add_subdirectory (${HDF5_TOOLS_SRC_SOURCE_DIR}/h5import)
+add_subdirectory (h5import)
#-- h5Repack executables
-add_subdirectory (${HDF5_TOOLS_SRC_SOURCE_DIR}/h5repack)
+add_subdirectory (h5repack)
#-- Add the h5dump and test executables
-add_subdirectory (${HDF5_TOOLS_SRC_SOURCE_DIR}/h5jam)
+add_subdirectory (h5jam)
#-- Add the h5copy and test executables
-add_subdirectory (${HDF5_TOOLS_SRC_SOURCE_DIR}/h5copy)
+add_subdirectory (h5copy)
#-- Add the h5stat and test executables
-add_subdirectory (${HDF5_TOOLS_SRC_SOURCE_DIR}/h5stat)
+add_subdirectory (h5stat)
#-- Add the h5dump and test executables
-add_subdirectory (${HDF5_TOOLS_SRC_SOURCE_DIR}/h5dump)
+add_subdirectory (h5dump)
#-- Add the h5format_convert and test executables
-add_subdirectory (${HDF5_TOOLS_SRC_SOURCE_DIR}/h5format_convert)
+add_subdirectory (h5format_convert)
diff --git a/tools/src/h5copy/h5copy.c b/tools/src/h5copy/h5copy.c
index 1d15d12..1800810 100644
--- a/tools/src/h5copy/h5copy.c
+++ b/tools/src/h5copy/h5copy.c
@@ -293,7 +293,7 @@ main (int argc, const char *argv[])
break;
case 'E':
- enable_error_stack = TRUE;
+ enable_error_stack = 1;
break;
default:
@@ -330,7 +330,7 @@ main (int argc, const char *argv[])
leave(EXIT_FAILURE);
}
- if (enable_error_stack) {
+ if (enable_error_stack > 0) {
H5Eset_auto2(H5E_DEFAULT, func, edata);
H5Eset_auto2(H5tools_ERR_STACK_g, tools_func, tools_edata);
}
diff --git a/tools/src/h5diff/h5diff_common.c b/tools/src/h5diff/h5diff_common.c
index ce5df78..8f09c81 100644
--- a/tools/src/h5diff/h5diff_common.c
+++ b/tools/src/h5diff/h5diff_common.c
@@ -178,7 +178,7 @@ void parse_command_line(int argc,
break;
case 'S':
- enable_error_stack = TRUE;
+ enable_error_stack = 1;
break;
case 'E':
diff --git a/tools/src/h5diff/h5diff_main.c b/tools/src/h5diff/h5diff_main.c
index ad488a4..c5a0cbf 100644
--- a/tools/src/h5diff/h5diff_main.c
+++ b/tools/src/h5diff/h5diff_main.c
@@ -100,7 +100,7 @@ int main(int argc, const char *argv[])
*/
parse_command_line(argc, argv, &fname1, &fname2, &objname1, &objname2, &opts);
- if (enable_error_stack) {
+ if (enable_error_stack > 0) {
H5Eset_auto2(H5E_DEFAULT, func, edata);
H5Eset_auto2(H5tools_ERR_STACK_g, tools_func, tools_edata);
}
diff --git a/tools/src/h5dump/h5dump.c b/tools/src/h5dump/h5dump.c
index b90d60f..25e4858 100644
--- a/tools/src/h5dump/h5dump.c
+++ b/tools/src/h5dump/h5dump.c
@@ -67,7 +67,7 @@ struct handler_t {
*/
/* The following initialization makes use of C language cancatenating */
/* "xxx" "yyy" into "xxxyyy". */
-static const char *s_opts = "hn*peyBHirVa:c:d:f:g:k:l:t:w:xD:uX:o*b*F:s:S:A*q:z:m:RECM:O*N:vG:";
+static const char *s_opts = "hn*peyBHirVa:c:d:f:g:k:l:t:w:xD:uX:o*b*F:s:S:A*q:z:m:RE*CM:O*N:vG:";
static struct long_options l_opts[] = {
{ "help", no_arg, 'h' },
{ "hel", no_arg, 'h' },
@@ -181,7 +181,7 @@ static struct long_options l_opts[] = {
{ "sort_order", require_arg, 'z' },
{ "format", require_arg, 'm' },
{ "region", no_arg, 'R' },
- { "enable-error-stack", no_arg, 'E' },
+ { "enable-error-stack", optional_arg, 'E' },
{ "packed-bits", require_arg, 'M' },
{ "no-compact-subset", no_arg, 'C' },
{ "ddl", optional_arg, 'O' },
@@ -191,7 +191,7 @@ static struct long_options l_opts[] = {
{ NULL, 0, '\0' }
};
-
+
/*-------------------------------------------------------------------------
* Function: leave
*
@@ -214,7 +214,7 @@ leave(int ret)
HDexit(ret);
}
-
+
/*-------------------------------------------------------------------------
* Function: usage
*
@@ -273,8 +273,8 @@ usage(const char *prog)
PRINTVALSTREAM(rawoutstream, " -m T, --format=T Set the floating point output format\n");
PRINTVALSTREAM(rawoutstream, " -q Q, --sort_by=Q Sort groups and attributes by index Q\n");
PRINTVALSTREAM(rawoutstream, " -z Z, --sort_order=Z Sort groups and attributes by order Z\n");
- PRINTVALSTREAM(rawoutstream, " --enable-error-stack Prints messages from the HDF5 error stack as they\n");
- PRINTVALSTREAM(rawoutstream, " occur.\n");
+ PRINTVALSTREAM(rawoutstream, " --enable-error-stack Prints messages from the HDF5 error stack as they occur.\n");
+ PRINTVALSTREAM(rawoutstream, " Optional value 2 also prints file open errors.\n");
PRINTVALSTREAM(rawoutstream, " --no-compact-subset Disable compact form of subsetting and allow the use\n");
PRINTVALSTREAM(rawoutstream, " of \"[\" in dataset names.\n");
PRINTVALSTREAM(rawoutstream, " -w N, --width=N Set the number of columns of output. A value of 0 (zero)\n");
@@ -366,7 +366,7 @@ usage(const char *prog)
PRINTVALSTREAM(rawoutstream, "\n");
}
-
+
/*-------------------------------------------------------------------------
* Function: table_list_add
*
@@ -419,7 +419,7 @@ table_list_add(hid_t oid, unsigned long file_no)
return((ssize_t) idx);
} /* end table_list_add() */
-
+
/*-------------------------------------------------------------------------
* Function: table_list_visited
*
@@ -449,7 +449,7 @@ table_list_visited(unsigned long file_no)
return(-1);
} /* end table_list_visited() */
-
+
/*-------------------------------------------------------------------------
* Function: table_list_free
*
@@ -817,7 +817,7 @@ parse_mask_list(const char *h_list)
}
}
-
+
/*-------------------------------------------------------------------------
* Function: free_handler
*
@@ -865,7 +865,7 @@ free_handler(struct handler_t *hand, int len)
}
}
-
+
/*-------------------------------------------------------------------------
* Function: parse_command_line
*
@@ -920,9 +920,8 @@ parse_start:
case 'n':
display_fi = TRUE;
last_was_dset = FALSE;
- if ( opt_arg != NULL) {
+ if (opt_arg != NULL)
h5trav_set_verbose(HDatoi(opt_arg));
- }
break;
case 'p':
display_dcpl = TRUE;
@@ -939,8 +938,9 @@ parse_start:
last_was_dset = FALSE;
break;
case 'A':
- if ( opt_arg != NULL) {
- if(0 == HDatoi(opt_arg)) include_attrs = FALSE;
+ if (opt_arg != NULL) {
+ if(0 == HDatoi(opt_arg))
+ include_attrs = FALSE;
}
else {
display_data = FALSE;
@@ -1059,7 +1059,7 @@ parse_start:
break;
case 'o':
- if ( bin_output ) {
+ if (bin_output) {
if (h5tools_set_data_output_file(opt_arg, 1) < 0) {
usage(h5tools_getprogname());
goto error;
@@ -1086,8 +1086,8 @@ parse_start:
break;
case 'b':
- if ( opt_arg != NULL) {
- if ( ( bin_form = set_binary_form(opt_arg)) < 0) {
+ if (opt_arg != NULL) {
+ if ((bin_form = set_binary_form(opt_arg)) < 0) {
/* failed to set binary form */
usage(h5tools_getprogname());
goto error;
@@ -1106,7 +1106,7 @@ parse_start:
break;
case 'q':
- if ( ( sort_by = set_sort_by(opt_arg)) < 0) {
+ if ((sort_by = set_sort_by(opt_arg)) < 0) {
/* failed to set "sort by" form */
usage(h5tools_getprogname());
goto error;
@@ -1114,7 +1114,7 @@ parse_start:
break;
case 'z':
- if ( ( sort_order = set_sort_order(opt_arg)) < 0) {
+ if ((sort_order = set_sort_order(opt_arg)) < 0) {
/* failed to set "sort order" form */
usage(h5tools_getprogname());
goto error;
@@ -1268,7 +1268,10 @@ end_collect:
/** end subsetting parameters **/
case 'E':
- enable_error_stack = TRUE;
+ if (opt_arg != NULL)
+ enable_error_stack = HDatoi(opt_arg);
+ else
+ enable_error_stack = 1;
break;
case 'C':
disable_compact_subset = TRUE;
@@ -1306,7 +1309,7 @@ error:
return hand;
}
-
+
/*-------------------------------------------------------------------------
* Function: main
*
@@ -1388,7 +1391,7 @@ main(int argc, const char *argv[])
goto done;
}
- if (enable_error_stack) {
+ if (enable_error_stack > 0) {
H5Eset_auto2(H5E_DEFAULT, func, edata);
H5Eset_auto2(H5tools_ERR_STACK_g, tools_func, tools_edata);
}
@@ -1764,7 +1767,7 @@ h5_fileaccess(void)
return fapl;
}
-
+
/*-------------------------------------------------------------------------
* Function: init_prefix
*
@@ -1785,7 +1788,7 @@ init_prefix(char **prfx, size_t prfx_len)
error_msg("unable to allocate prefix buffer\n");
}
-
+
/*-------------------------------------------------------------------------
* Function: add_prefix
*
diff --git a/tools/src/h5dump/h5dump_ddl.c b/tools/src/h5dump/h5dump_ddl.c
index eecd113..6646626 100644
--- a/tools/src/h5dump/h5dump_ddl.c
+++ b/tools/src/h5dump/h5dump_ddl.c
@@ -155,7 +155,7 @@ dump_attr_cb(hid_t oid, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED *
return ret;
}
-
+
/*-------------------------------------------------------------------------
* Function: dump_all_cb
*
@@ -291,7 +291,6 @@ dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void H5_ATTR
ctx.indent_level++;
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -303,7 +302,6 @@ dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void H5_ATTR
error_msg("internal error (file %s:line %d)\n", __FILE__, __LINE__);
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -327,7 +325,6 @@ dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void H5_ATTR
}
else if(found_obj->displayed) {
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -348,7 +345,6 @@ dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void H5_ATTR
ctx.indent_level--;
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -436,7 +432,6 @@ dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void H5_ATTR
/* print the value of a soft link */
/* Standard DDL: no modification */
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -447,7 +442,6 @@ dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void H5_ATTR
ctx.indent_level--;
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -472,7 +466,6 @@ dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void H5_ATTR
}
else {
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -501,7 +494,6 @@ dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void H5_ATTR
ctx.indent_level++;
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -509,7 +501,6 @@ dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void H5_ATTR
h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0);
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -522,7 +513,6 @@ dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void H5_ATTR
} /* end else */
} /* end else */
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -544,7 +534,6 @@ dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void H5_ATTR
case H5L_TYPE_HARD:
default:
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -556,7 +545,6 @@ dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void H5_ATTR
ctx.indent_level++;
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "LINKCLASS %d", linfo->type);
@@ -565,7 +553,6 @@ dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void H5_ATTR
ctx.indent_level--;
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
if(HDstrlen(h5tools_dump_header_format->udlinkblockend)) {
@@ -926,7 +913,6 @@ dump_group(hid_t gid, const char *name)
ctx.indent_level--;
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -1169,7 +1155,7 @@ dump_data(hid_t obj_id, int obj_data, struct subset_t *sset, int display_index)
h5tools_dump_data(rawoutstream, outputformat, &ctx, obj_id, print_dataset, sset, display_index, display_char);
}
-
+
/*-------------------------------------------------------------------------
* Function: dump_fcpl
*
@@ -1614,7 +1600,6 @@ handle_attributes(hid_t fid, const char *attr, void H5_ATTR_UNUSED * data, int H
HDmemset(&buffer, 0, sizeof(h5tools_str_t));
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -1626,7 +1611,6 @@ handle_attributes(hid_t fid, const char *attr, void H5_ATTR_UNUSED * data, int H
error_msg("unable to open object \"%s\"\n", obj_name);
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
if(HDstrlen(h5tools_dump_header_format->attributeblockend)) {
@@ -2081,7 +2065,7 @@ handle_datatypes(hid_t fid, const char *type, void H5_ATTR_UNUSED * data, int pe
}
}
-
+
/*-------------------------------------------------------------------------
* Function: dump_extlink
*
diff --git a/tools/src/h5dump/h5dump_xml.c b/tools/src/h5dump/h5dump_xml.c
index a83ec08..4e13df3 100644
--- a/tools/src/h5dump/h5dump_xml.c
+++ b/tools/src/h5dump/h5dump_xml.c
@@ -231,7 +231,6 @@ xml_dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void H5_
ctx.indent_level++;
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -243,7 +242,6 @@ xml_dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void H5_
error_msg("internal error (file %s:line %d)\n", __FILE__, __LINE__);
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -278,7 +276,6 @@ xml_dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void H5_
xml_name_to_XID(prefix, parentxid, (int)sizeof(parentxid), 1);
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -298,7 +295,6 @@ xml_dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void H5_
ctx.indent_level++;
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -310,7 +306,6 @@ xml_dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void H5_
ctx.indent_level--;
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -405,7 +400,6 @@ xml_dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void H5_
if (res == 0) {
/* target obj found */
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -427,7 +421,6 @@ xml_dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void H5_
else {
/* dangling link -- omit from xml attributes */
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -492,7 +485,6 @@ xml_dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void H5_
xml_name_to_XID(prefix, parentxid, (int)sizeof(parentxid), 1);
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -539,7 +531,6 @@ xml_dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void H5_
xml_name_to_XID(prefix, parentxid, (int)sizeof(parentxid), 1);
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -905,7 +896,6 @@ xml_print_datatype(hid_t type, unsigned in_group)
as it's name. */
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -918,7 +908,6 @@ xml_print_datatype(hid_t type, unsigned in_group)
char *t_objname = xml_escape_the_name(found_obj->objname);
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -931,7 +920,6 @@ xml_print_datatype(hid_t type, unsigned in_group)
}
else {
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -944,7 +932,6 @@ xml_print_datatype(hid_t type, unsigned in_group)
switch (H5Tget_class(type)) {
case H5T_INTEGER:
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -957,7 +944,6 @@ xml_print_datatype(hid_t type, unsigned in_group)
sgn = H5Tget_sign(type);
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -1002,7 +988,6 @@ xml_print_datatype(hid_t type, unsigned in_group)
ctx.indent_level--;
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -1018,7 +1003,6 @@ xml_print_datatype(hid_t type, unsigned in_group)
ord = H5Tget_order(type);
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -1027,7 +1011,6 @@ xml_print_datatype(hid_t type, unsigned in_group)
ctx.indent_level++;
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -1061,7 +1044,6 @@ xml_print_datatype(hid_t type, unsigned in_group)
ctx.indent_level--;
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -1071,7 +1053,6 @@ xml_print_datatype(hid_t type, unsigned in_group)
case H5T_TIME:
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -1080,7 +1061,6 @@ xml_print_datatype(hid_t type, unsigned in_group)
ctx.indent_level++;
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -1090,7 +1070,6 @@ xml_print_datatype(hid_t type, unsigned in_group)
ctx.indent_level--;
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -1106,7 +1085,6 @@ xml_print_datatype(hid_t type, unsigned in_group)
is_vlstr = H5Tis_variable_str(type);
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -1116,7 +1094,6 @@ xml_print_datatype(hid_t type, unsigned in_group)
ctx.indent_level++;
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -1144,7 +1121,6 @@ xml_print_datatype(hid_t type, unsigned in_group)
ctx.indent_level--;
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -1157,7 +1133,6 @@ xml_print_datatype(hid_t type, unsigned in_group)
ord = H5Tget_order(type);
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -1166,7 +1141,6 @@ xml_print_datatype(hid_t type, unsigned in_group)
ctx.indent_level++;
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -1193,7 +1167,6 @@ xml_print_datatype(hid_t type, unsigned in_group)
ctx.indent_level--;
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -1205,7 +1178,6 @@ xml_print_datatype(hid_t type, unsigned in_group)
/* <hdf5:OpaqueType Tag="tag" Size="bytes" /> */
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -1215,7 +1187,6 @@ xml_print_datatype(hid_t type, unsigned in_group)
mname = H5Tget_tag(type);
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -1227,7 +1198,6 @@ xml_print_datatype(hid_t type, unsigned in_group)
ctx.indent_level--;
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -1242,7 +1212,6 @@ xml_print_datatype(hid_t type, unsigned in_group)
nmembers = (unsigned)H5Tget_nmembers(type);
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -1262,7 +1231,6 @@ xml_print_datatype(hid_t type, unsigned in_group)
t_fname = xml_escape_the_name(mname);
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -1275,7 +1243,6 @@ xml_print_datatype(hid_t type, unsigned in_group)
ctx.indent_level++;
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -1288,7 +1255,6 @@ xml_print_datatype(hid_t type, unsigned in_group)
ctx.indent_level--;
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -1298,7 +1264,6 @@ xml_print_datatype(hid_t type, unsigned in_group)
ctx.indent_level--;
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -1309,7 +1274,6 @@ xml_print_datatype(hid_t type, unsigned in_group)
ctx.indent_level--;
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -1319,7 +1283,6 @@ xml_print_datatype(hid_t type, unsigned in_group)
case H5T_REFERENCE:
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -1329,7 +1292,6 @@ xml_print_datatype(hid_t type, unsigned in_group)
/* Only Object references supported at this time */
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -1338,7 +1300,6 @@ xml_print_datatype(hid_t type, unsigned in_group)
ctx.indent_level++;
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -1347,7 +1308,6 @@ xml_print_datatype(hid_t type, unsigned in_group)
ctx.indent_level--;
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -1356,7 +1316,6 @@ xml_print_datatype(hid_t type, unsigned in_group)
ctx.indent_level--;
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -1369,7 +1328,6 @@ xml_print_datatype(hid_t type, unsigned in_group)
nmembs = H5Tget_nmembers(type);
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -1379,7 +1337,6 @@ xml_print_datatype(hid_t type, unsigned in_group)
ctx.indent_level++;
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -1388,7 +1345,6 @@ xml_print_datatype(hid_t type, unsigned in_group)
xml_print_enum(type);
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -1398,7 +1354,6 @@ xml_print_datatype(hid_t type, unsigned in_group)
ctx.indent_level--;
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -1408,7 +1363,6 @@ xml_print_datatype(hid_t type, unsigned in_group)
case H5T_VLEN:
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -1419,7 +1373,6 @@ xml_print_datatype(hid_t type, unsigned in_group)
ctx.indent_level++;
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -1432,7 +1385,6 @@ xml_print_datatype(hid_t type, unsigned in_group)
ctx.indent_level--;
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -1442,7 +1394,6 @@ xml_print_datatype(hid_t type, unsigned in_group)
ctx.indent_level--;
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -1458,7 +1409,6 @@ xml_print_datatype(hid_t type, unsigned in_group)
/* Print lead-in */
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -1474,7 +1424,6 @@ xml_print_datatype(hid_t type, unsigned in_group)
ctx.indent_level++;
for (i = 0; i < ndims; i++) {
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -1487,7 +1436,6 @@ xml_print_datatype(hid_t type, unsigned in_group)
ctx.indent_level++;
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -1500,7 +1448,6 @@ xml_print_datatype(hid_t type, unsigned in_group)
ctx.indent_level--;
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -1510,7 +1457,6 @@ xml_print_datatype(hid_t type, unsigned in_group)
ctx.indent_level--;
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -1524,7 +1470,6 @@ xml_print_datatype(hid_t type, unsigned in_group)
case H5T_NCLASSES:
default:
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -1606,7 +1551,6 @@ xml_dump_datatype(hid_t type)
*/
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -1619,7 +1563,6 @@ xml_dump_datatype(hid_t type)
char *t_objname = xml_escape_the_name(found_obj->objname);
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -1632,7 +1575,6 @@ xml_dump_datatype(hid_t type)
}
else {
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -1642,7 +1584,6 @@ xml_dump_datatype(hid_t type)
}
else {
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -1655,7 +1596,6 @@ xml_dump_datatype(hid_t type)
dump_indent -= COL;
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -1720,7 +1660,6 @@ xml_dump_dataspace(hid_t space)
ctx.indent_level++;
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -1733,7 +1672,6 @@ xml_dump_dataspace(hid_t space)
/* scalar dataspace (just a tag, no XML attrs. defined */
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -1746,7 +1684,6 @@ xml_dump_dataspace(hid_t space)
/* <hdf5:SimpleDataspace Ndims="nd"> */
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -1758,7 +1695,6 @@ xml_dump_dataspace(hid_t space)
for (i = 0; i < ndims; i++) {
if (maxsize[i] == H5S_UNLIMITED) {
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -1768,7 +1704,6 @@ xml_dump_dataspace(hid_t space)
}
else if (maxsize[i] == (hsize_t) 0) {
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -1778,7 +1713,6 @@ xml_dump_dataspace(hid_t space)
}
else {
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -1790,7 +1724,6 @@ xml_dump_dataspace(hid_t space)
ctx.indent_level--;
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -1805,7 +1738,6 @@ xml_dump_dataspace(hid_t space)
ctx.need_prefix = TRUE;
h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
-
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "<%sNullDataspace />",xmlnsprefix);
@@ -1817,7 +1749,6 @@ xml_dump_dataspace(hid_t space)
case H5S_NO_CLASS:
default:
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -1828,7 +1759,6 @@ xml_dump_dataspace(hid_t space)
ctx.indent_level--;
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -1899,7 +1829,6 @@ xml_dump_data(hid_t obj_id, int obj_data, struct subset_t H5_ATTR_UNUSED * sset,
outputformat = &string_dataformat;
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -1909,7 +1838,6 @@ xml_dump_data(hid_t obj_id, int obj_data, struct subset_t H5_ATTR_UNUSED * sset,
ctx.indent_level++;
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -2005,7 +1933,6 @@ xml_dump_data(hid_t obj_id, int obj_data, struct subset_t H5_ATTR_UNUSED * sset,
ctx.indent_level++;
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -2031,7 +1958,6 @@ xml_dump_data(hid_t obj_id, int obj_data, struct subset_t H5_ATTR_UNUSED * sset,
ctx.indent_level--;
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -2092,7 +2018,6 @@ xml_dump_attr(hid_t attr, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED
outputformat = &string_dataformat;
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -2128,7 +2053,6 @@ xml_dump_attr(hid_t attr, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED
dump_indent += COL;
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -2136,7 +2060,6 @@ xml_dump_attr(hid_t attr, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED
h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0);
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -2144,7 +2067,6 @@ xml_dump_attr(hid_t attr, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED
h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0);
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -2152,7 +2074,6 @@ xml_dump_attr(hid_t attr, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED
h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0);
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -2160,7 +2081,6 @@ xml_dump_attr(hid_t attr, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED
h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0);
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -2173,7 +2093,6 @@ xml_dump_attr(hid_t attr, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED
case H5T_COMPOUND:
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -2184,7 +2103,6 @@ xml_dump_attr(hid_t attr, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED
case H5T_REFERENCE:
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -2192,7 +2110,6 @@ xml_dump_attr(hid_t attr, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED
h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0);
if (!H5Tequal(type, H5T_STD_REF_OBJ)) {
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -2200,7 +2117,6 @@ xml_dump_attr(hid_t attr, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED
h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0);
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -2209,7 +2125,6 @@ xml_dump_attr(hid_t attr, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED
}
else {
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -2219,7 +2134,6 @@ xml_dump_attr(hid_t attr, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED
xml_print_refs(attr_id, ATTRIBUTE_DATA);
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -2228,7 +2142,6 @@ xml_dump_attr(hid_t attr, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED
}
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -2238,7 +2151,6 @@ xml_dump_attr(hid_t attr, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED
case H5T_VLEN:
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -2251,7 +2163,6 @@ xml_dump_attr(hid_t attr, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED
case H5T_NCLASSES:
default:
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -2259,7 +2170,6 @@ xml_dump_attr(hid_t attr, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED
h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0);
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -2267,7 +2177,6 @@ xml_dump_attr(hid_t attr, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED
h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0);
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -2275,7 +2184,6 @@ xml_dump_attr(hid_t attr, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED
h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0);
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -2288,7 +2196,6 @@ xml_dump_attr(hid_t attr, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED
/* The case of an attribute never yet written ??
* Or dataspace is H5S_NULL. */
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -2298,7 +2205,6 @@ xml_dump_attr(hid_t attr, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED
ctx.indent_level++;
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -2308,7 +2214,6 @@ xml_dump_attr(hid_t attr, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED
ctx.indent_level--;
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -2323,7 +2228,6 @@ xml_dump_attr(hid_t attr, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED
H5Aclose(attr_id);
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -2338,7 +2242,6 @@ xml_dump_attr(hid_t attr, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED
ctx.indent_level++;
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -2348,7 +2251,6 @@ xml_dump_attr(hid_t attr, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED
ctx.indent_level--;
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -2435,7 +2337,6 @@ xml_dump_named_datatype(hid_t type, const char *name)
*/
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -2450,7 +2351,6 @@ xml_dump_named_datatype(hid_t type, const char *name)
H5O_info_t oinfo; /* Object info */
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -2487,7 +2387,6 @@ xml_dump_named_datatype(hid_t type, const char *name)
xml_name_to_XID(found_obj->objname, pointerxid, (int)sizeof(pointerxid), 1);
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -2497,7 +2396,6 @@ xml_dump_named_datatype(hid_t type, const char *name)
ctx.indent_level--;
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -2515,7 +2413,6 @@ xml_dump_named_datatype(hid_t type, const char *name)
dump_indent += COL;
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -2529,7 +2426,6 @@ xml_dump_named_datatype(hid_t type, const char *name)
dump_indent -= COL;
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -2540,7 +2436,6 @@ xml_dump_named_datatype(hid_t type, const char *name)
dump_indent -= COL;
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -2680,7 +2575,6 @@ xml_dump_group(hid_t gid, const char *name)
xml_name_to_XID("/", grpxid, 100, 1);
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -2695,7 +2589,6 @@ xml_dump_group(hid_t gid, const char *name)
xml_name_to_XID(par, parentxid, 100, 1);
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -2715,7 +2608,6 @@ xml_dump_group(hid_t gid, const char *name)
xml_name_to_XID(par, parentxid, 100, 1);
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -2739,7 +2631,6 @@ xml_dump_group(hid_t gid, const char *name)
xml_name_to_XID("/", grpxid, 100, 1);
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -2755,7 +2646,6 @@ xml_dump_group(hid_t gid, const char *name)
xml_name_to_XID(par, parentxid, 100, 1);
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -2825,7 +2715,6 @@ xml_dump_group(hid_t gid, const char *name)
char *parentxid = (char *)HDmalloc((size_t)100);
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -2898,7 +2787,6 @@ xml_dump_group(hid_t gid, const char *name)
}
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -3025,7 +2913,6 @@ xml_print_refs(hid_t did, int source)
if (!path) {
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -3036,7 +2923,6 @@ xml_print_refs(hid_t did, int source)
char *t_path = xml_escape_the_string(path, -1);
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -3182,7 +3068,6 @@ xml_print_strs(hid_t did, int source)
if (!onestring) {
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -3290,7 +3175,6 @@ check_filters(hid_t dcpl)
if (filter == H5Z_FILTER_DEFLATE) {
ctx.indent_level++;
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -3309,7 +3193,6 @@ check_filters(hid_t dcpl)
else if (filter == H5Z_FILTER_FLETCHER32) {
ctx.indent_level++;
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -3320,7 +3203,6 @@ check_filters(hid_t dcpl)
else if (filter == H5Z_FILTER_SHUFFLE) {
ctx.indent_level++;
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -3332,7 +3214,6 @@ check_filters(hid_t dcpl)
ctx.indent_level++;
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -3426,7 +3307,6 @@ xml_dump_fill_value(hid_t dcpl, hid_t type)
dump_indent += COL;
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -3444,7 +3324,6 @@ xml_dump_fill_value(hid_t dcpl, hid_t type)
const char * path = lookup_ref_path(*(hobj_ref_t *) buf);
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -3452,7 +3331,6 @@ xml_dump_fill_value(hid_t dcpl, hid_t type)
h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0);
if (!path) {
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -3463,7 +3341,6 @@ xml_dump_fill_value(hid_t dcpl, hid_t type)
char *t_path = xml_escape_the_string(path, -1);
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -3473,7 +3350,6 @@ xml_dump_fill_value(hid_t dcpl, hid_t type)
}
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -3483,7 +3359,6 @@ xml_dump_fill_value(hid_t dcpl, hid_t type)
else if (H5Tget_class(type) == H5T_STRING) {
/* ????? */
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -3491,7 +3366,6 @@ xml_dump_fill_value(hid_t dcpl, hid_t type)
h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0);
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -3503,7 +3377,6 @@ xml_dump_fill_value(hid_t dcpl, hid_t type)
switch (H5Tget_class(type)) {
case H5T_INTEGER:
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -3519,7 +3392,6 @@ xml_dump_fill_value(hid_t dcpl, hid_t type)
h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0);
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -3528,7 +3400,6 @@ xml_dump_fill_value(hid_t dcpl, hid_t type)
break;
case H5T_FLOAT:
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -3544,7 +3415,6 @@ xml_dump_fill_value(hid_t dcpl, hid_t type)
h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0);
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -3554,7 +3424,6 @@ xml_dump_fill_value(hid_t dcpl, hid_t type)
case H5T_BITFIELD:
case H5T_OPAQUE:
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -3576,7 +3445,6 @@ xml_dump_fill_value(hid_t dcpl, hid_t type)
h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0);
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -3585,7 +3453,6 @@ xml_dump_fill_value(hid_t dcpl, hid_t type)
break;
case H5T_ENUM:
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -3603,7 +3470,6 @@ xml_dump_fill_value(hid_t dcpl, hid_t type)
if(name)
H5free_memory(name);
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -3612,7 +3478,6 @@ xml_dump_fill_value(hid_t dcpl, hid_t type)
break;
case H5T_ARRAY:
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -3620,7 +3485,6 @@ xml_dump_fill_value(hid_t dcpl, hid_t type)
h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0);
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -3629,7 +3493,6 @@ xml_dump_fill_value(hid_t dcpl, hid_t type)
break;
case H5T_TIME:
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -3637,7 +3500,6 @@ xml_dump_fill_value(hid_t dcpl, hid_t type)
h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0);
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -3646,7 +3508,6 @@ xml_dump_fill_value(hid_t dcpl, hid_t type)
break;
case H5T_COMPOUND:
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -3654,7 +3515,6 @@ xml_dump_fill_value(hid_t dcpl, hid_t type)
h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0);
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -3663,7 +3523,6 @@ xml_dump_fill_value(hid_t dcpl, hid_t type)
break;
case H5T_VLEN:
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -3671,7 +3530,6 @@ xml_dump_fill_value(hid_t dcpl, hid_t type)
h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0);
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -3684,7 +3542,6 @@ xml_dump_fill_value(hid_t dcpl, hid_t type)
case H5T_REFERENCE:
default:
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -3692,7 +3549,6 @@ xml_dump_fill_value(hid_t dcpl, hid_t type)
h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0);
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -3706,7 +3562,6 @@ xml_dump_fill_value(hid_t dcpl, hid_t type)
dump_indent -= COL;
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -3793,7 +3648,6 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t H5_ATTR_UNUSED * s
xml_name_to_XID(prefix, pstr, 100, 1);
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -3828,7 +3682,6 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t H5_ATTR_UNUSED * s
dump_indent += COL;
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -3838,7 +3691,6 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t H5_ATTR_UNUSED * s
dump_indent += COL;
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -3853,7 +3705,6 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t H5_ATTR_UNUSED * s
for (i = 0; i < ndims; i++) {
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -3862,7 +3713,6 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t H5_ATTR_UNUSED * s
}
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -3876,7 +3726,6 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t H5_ATTR_UNUSED * s
dump_indent -= COL;
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -3887,7 +3736,6 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t H5_ATTR_UNUSED * s
dump_indent -= COL;
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -3897,7 +3745,6 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t H5_ATTR_UNUSED * s
dump_indent -= COL;
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -3912,7 +3759,6 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t H5_ATTR_UNUSED * s
ctx.indent_level++;
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -3921,7 +3767,6 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t H5_ATTR_UNUSED * s
ctx.indent_level++;
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -3930,7 +3775,6 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t H5_ATTR_UNUSED * s
ctx.indent_level--;
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -3942,7 +3786,6 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t H5_ATTR_UNUSED * s
ctx.indent_level++;
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -3951,7 +3794,6 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t H5_ATTR_UNUSED * s
ctx.indent_level++;
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -3960,7 +3802,6 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t H5_ATTR_UNUSED * s
ctx.indent_level--;
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -3976,7 +3817,6 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t H5_ATTR_UNUSED * s
dump_indent += COL;
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -4025,7 +3865,6 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t H5_ATTR_UNUSED * s
dump_indent += COL;
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -4037,7 +3876,6 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t H5_ATTR_UNUSED * s
ctx.indent_level++;
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -4050,7 +3888,6 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t H5_ATTR_UNUSED * s
}
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -4061,7 +3898,6 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t H5_ATTR_UNUSED * s
dump_indent -= COL;
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -4114,7 +3950,6 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t H5_ATTR_UNUSED * s
ctx.indent_level++;
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -4122,7 +3957,6 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t H5_ATTR_UNUSED * s
h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0);
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -4130,7 +3964,6 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t H5_ATTR_UNUSED * s
h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0);
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -4138,7 +3971,6 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t H5_ATTR_UNUSED * s
h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0);
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -4150,7 +3982,6 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t H5_ATTR_UNUSED * s
case H5T_COMPOUND:
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -4166,7 +3997,6 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t H5_ATTR_UNUSED * s
case H5T_REFERENCE:
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -4174,7 +4004,6 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t H5_ATTR_UNUSED * s
h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0);
if (!H5Tequal(type, H5T_STD_REF_OBJ)) {
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -4182,7 +4011,6 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t H5_ATTR_UNUSED * s
h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0);
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -4191,7 +4019,6 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t H5_ATTR_UNUSED * s
}
else {
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -4201,7 +4028,6 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t H5_ATTR_UNUSED * s
xml_print_refs(did, DATASET_DATA);
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -4210,7 +4036,6 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t H5_ATTR_UNUSED * s
}
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -4222,7 +4047,6 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t H5_ATTR_UNUSED * s
ctx.indent_level--;
dump_indent -= COL;
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -4241,7 +4065,6 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t H5_ATTR_UNUSED * s
case H5T_NCLASSES:
default:
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -4249,7 +4072,6 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t H5_ATTR_UNUSED * s
h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0);
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -4257,7 +4079,6 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t H5_ATTR_UNUSED * s
h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0);
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -4265,7 +4086,6 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t H5_ATTR_UNUSED * s
h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0);
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -4279,7 +4099,6 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t H5_ATTR_UNUSED * s
ctx.indent_level++;
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -4288,7 +4107,6 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t H5_ATTR_UNUSED * s
ctx.indent_level++;
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -4297,7 +4115,6 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t H5_ATTR_UNUSED * s
ctx.indent_level--;
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -4311,7 +4128,6 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t H5_ATTR_UNUSED * s
H5Pclose(dcpl);
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -4377,7 +4193,6 @@ xml_print_enum(hid_t type)
super = H5Tget_super(type);
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -4387,7 +4202,6 @@ xml_print_enum(hid_t type)
xml_print_datatype(super,0);
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -4438,7 +4252,6 @@ xml_print_enum(hid_t type)
char *t_name = xml_escape_the_name(name[i]);
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -4456,7 +4269,6 @@ xml_print_enum(hid_t type)
ctx.indent_level--;
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -4464,7 +4276,6 @@ xml_print_enum(hid_t type)
h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0);
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -4494,7 +4305,6 @@ xml_print_enum(hid_t type)
ctx.indent_level--;
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
diff --git a/tools/src/h5import/h5import.c b/tools/src/h5import/h5import.c
index 36a8c21..76e78af 100644
--- a/tools/src/h5import/h5import.c
+++ b/tools/src/h5import/h5import.c
@@ -1405,7 +1405,7 @@ static int processConfigurationFile(char *infile, struct Input *in)
const char *err14a = "COMPRESSION-PARAM keyword appears twice in %s.\n";
const char *err14b = "Error in retrieving the compression parameter from %s.\n";
const char *err15a = "EXTERNAL-STORAGE keyword appears twice in %s.\n";
- const char *err15b = "Error in retrieving the external storage paramters from %s.\n";
+ const char *err15b = "Error in retrieving the external storage parameters from %s.\n";
const char *err16a = "MAXIMUM-DIMENSIONS keyword appears twice in %s.\n";
const char *err16b = "MAXIMUM-DIMENSIONS cannot appear before DIMENSION-SIZES are provided.\n";
const char *err16c = "Error in retrieving the maximum dimension sizes from %s.\n";
@@ -3690,7 +3690,7 @@ static int getCompressionParameter(struct Input *in, FILE *strm)
{
/* currently supports only GZIP */
/* can be extended by adding more values to COMPRESSION-TYPE and */
- /* handling the paramters here by adding more cases */
+ /* handling the parameters here by adding more cases */
int ival;
const char *err1 = "Unable to get integer value.\n";
diff --git a/tools/src/h5repack/h5repack.c b/tools/src/h5repack/h5repack.c
index c98575c..e7f4aae 100644
--- a/tools/src/h5repack/h5repack.c
+++ b/tools/src/h5repack/h5repack.c
@@ -75,6 +75,8 @@ h5repack_init(pack_opt_t *options, int verbose, hbool_t latest)
options->verbose = verbose;
options->latest = latest;
options->layout_g = H5D_LAYOUT_ERROR;
+ options->low_bound = H5F_LIBVER_EARLIEST;
+ options->high_bound = H5F_LIBVER_LATEST;
for (n = 0; n < H5_REPACK_MAX_NFILTERS; n++) {
options->filter_g[n].filtn = -1;
diff --git a/tools/src/h5repack/h5repack.h b/tools/src/h5repack/h5repack.h
index 0252768..a0e0387 100644
--- a/tools/src/h5repack/h5repack.h
+++ b/tools/src/h5repack/h5repack.h
@@ -101,21 +101,23 @@ typedef struct {
/* all the above, ready to go to the hrepack call */
typedef struct {
- pack_opttbl_t *op_tbl; /*table with all -c and -f options */
- int all_layout; /*apply the layout to all objects */
- int all_filter; /*apply the filter to all objects */
+ pack_opttbl_t *op_tbl; /*table with all -c and -f options */
+ int all_layout; /*apply the layout to all objects */
+ int all_filter; /*apply the filter to all objects */
filter_info_t filter_g[H5_REPACK_MAX_NFILTERS]; /*global filter array for the ALL case */
- int n_filter_g; /*number of global filters */
- chunk_info_t chunk_g; /*global chunk INFO for the ALL case */
- H5D_layout_t layout_g; /*global layout information for the ALL case */
- int verbose; /*verbose mode */
- hsize_t min_comp; /*minimum size to compress, in bytes */
- int use_native; /*use a native type in write */
- hbool_t latest; /*pack file with the latest file format */
- int grp_compact; /* Set the maximum number of links to store as header messages in the group */
- int grp_indexed; /* Set the minimum number of links to store in the indexed format */
- int msg_size[8]; /* Minimum size of shared messages: dataspace,
- datatype, fill value, filter pipleline, attribute */
+ int n_filter_g; /*number of global filters */
+ chunk_info_t chunk_g; /*global chunk INFO for the ALL case */
+ H5D_layout_t layout_g; /*global layout information for the ALL case */
+ int verbose; /*verbose mode */
+ hsize_t min_comp; /*minimum size to compress, in bytes */
+ int use_native; /*use a native type in write */
+ hbool_t latest; /*pack file with the latest file format */
+ H5F_libver_t low_bound; /* The file's low bound as in H5Fset_libver_bounds() */
+ H5F_libver_t high_bound; /* The file's high bound as in H5Fset_libver_bounds() */
+ int grp_compact; /* Set the maximum number of links to store as header messages in the group */
+ int grp_indexed; /* Set the minimum number of links to store in the indexed format */
+ int msg_size[8]; /* Minimum size of shared messages: dataspace,
+ datatype, fill value, filter pipleline, attribute */
const char *ublock_filename; /* user block file name */
hsize_t ublock_size; /* user block size */
hsize_t meta_block_size; /* metadata aggregation block size (for H5Pset_meta_block_size) */
diff --git a/tools/src/h5repack/h5repack_copy.c b/tools/src/h5repack/h5repack_copy.c
index e205fba..b279cf9 100644
--- a/tools/src/h5repack/h5repack_copy.c
+++ b/tools/src/h5repack/h5repack_copy.c
@@ -142,8 +142,18 @@ int copy_objects(const char* fnamein, const char* fnameout, pack_opt_t *options)
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pclose failed to close property list");
}
+ if(options->latest)
+ options->low_bound = options->high_bound = H5F_LIBVER_LATEST;
+ /* Create file access property list */
+ if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0)
+ HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pcreate failed to create file access property list");
+
+ /* It can be default, latest or other settings by users */
+ if(H5Pset_libver_bounds(fapl, options->low_bound, options->high_bound) < 0)
+ HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pset_libver_bounds failed to set format version bounds");
+
/* Check if we need to create a non-default file creation property list */
- if (options->latest || ub_size > 0) {
+ if (options->low_bound >= H5F_LIBVER_V18 || ub_size > 0) {
/* Create file creation property list */
if ((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0)
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pcreate failed to create a file creation property list");
@@ -152,7 +162,7 @@ int copy_objects(const char* fnamein, const char* fnameout, pack_opt_t *options)
if (H5Pset_userblock(fcpl, ub_size) < 0)
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pset_userblock failed to set non-default userblock size");
- if (options->latest) {
+ if (options->low_bound >= H5F_LIBVER_V18) {
unsigned i = 0, nindex = 0, mesg_type_flags[5], min_mesg_sizes[5];
/* Adjust group creation parameters for root group */
@@ -203,12 +213,6 @@ int copy_objects(const char* fnamein, const char* fnameout, pack_opt_t *options)
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pset_shared_mesg_index failed to configure the specified shared object header message index");
} /* if (nindex>0) */
- /* Create file access property list */
- if ((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0)
- HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pcreate failed to create file access property list");
-
- if (H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0)
- HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pset_libver_bounds failed to set property for using latest version of the format");
} /* end if */
} /* end if */
#if defined (H5REPACK_DEBUG_USER_BLOCK)
diff --git a/tools/src/h5repack/h5repack_main.c b/tools/src/h5repack/h5repack_main.c
index d34c394..8f0178f 100644
--- a/tools/src/h5repack/h5repack_main.c
+++ b/tools/src/h5repack/h5repack_main.c
@@ -31,7 +31,7 @@ const char *outfile = NULL;
* Command-line options: The user can specify short or long-named
* parameters.
*/
-static const char *s_opts = "hVvf:l:m:e:nLc:d:s:u:b:M:t:a:i:o:S:P:T:G:q:z:E";
+static const char *s_opts = "hVvf:l:m:e:nLj:k:c:d:s:u:b:M:t:a:i:o:S:P:T:G:q:z:E";
static struct long_options l_opts[] = {
{ "help", no_arg, 'h' },
{ "version", no_arg, 'V' },
@@ -42,6 +42,8 @@ static struct long_options l_opts[] = {
{ "file", require_arg, 'e' },
{ "native", no_arg, 'n' },
{ "latest", no_arg, 'L' },
+ { "low", require_arg, 'j' },
+ { "high", require_arg, 'k' },
{ "compact", require_arg, 'c' },
{ "indexed", require_arg, 'd' },
{ "ssize", require_arg, 's' },
@@ -81,7 +83,13 @@ static void usage(const char *prog) {
PRINTVALSTREAM(rawoutstream, " -v, --verbose Verbose mode, print object information\n");
PRINTVALSTREAM(rawoutstream, " -V, --version Print version number and exit\n");
PRINTVALSTREAM(rawoutstream, " -n, --native Use a native HDF5 type when repacking\n");
+ PRINTVALSTREAM(rawoutstream, " --enable-error-stack Prints messages from the HDF5 error stack as they occur\n");
PRINTVALSTREAM(rawoutstream, " -L, --latest Use latest version of file format\n");
+ PRINTVALSTREAM(rawoutstream, " This option will take precedence over the -j and -k options\n");
+ PRINTVALSTREAM(rawoutstream, " --low=BOUND The low bound for library release versions to use when creating\n");
+ PRINTVALSTREAM(rawoutstream, " objects in the file (default is H5F_LIBVER_EARLIEST)\n");
+ PRINTVALSTREAM(rawoutstream, " --high=BOUND The high bound for library release versions to use when creating\n");
+ PRINTVALSTREAM(rawoutstream, " objects in the file (default is H5F_LIBVER_LATEST)\n");
PRINTVALSTREAM(rawoutstream, " -c L1, --compact=L1 Maximum number of links in header messages\n");
PRINTVALSTREAM(rawoutstream, " -d L2, --indexed=L2 Minimum number of links in the indexed format\n");
PRINTVALSTREAM(rawoutstream, " -s S[:F], --ssize=S[:F] Shared object header message minimum size\n");
@@ -114,8 +122,12 @@ static void usage(const char *prog) {
PRINTVALSTREAM(rawoutstream, " F - is the shared object header message type, any of <dspace|dtype|fill|\n");
PRINTVALSTREAM(rawoutstream, " pline|attr>. If F is not specified, S applies to all messages\n");
PRINTVALSTREAM(rawoutstream, "\n");
- PRINTVALSTREAM(rawoutstream, " --enable-error-stack Prints messages from the HDF5 error stack as they\n");
- PRINTVALSTREAM(rawoutstream, " occur.\n");
+ PRINTVALSTREAM(rawoutstream, " BOUND is an integer indicating the library release versions to use when creating\n");
+ PRINTVALSTREAM(rawoutstream, " objects in the file (see H5Pset_libver_bounds()):\n");
+ PRINTVALSTREAM(rawoutstream, " 0: This is H5F_LIBVER_EARLIEST in H5F_libver_t struct\n");
+ PRINTVALSTREAM(rawoutstream, " 1: This is H5F_LIBVER_V18 in H5F_libver_t struct\n");
+ PRINTVALSTREAM(rawoutstream, " 2: This is H5F_LIBVER_V110 in H5F_libver_t struct\n");
+ PRINTVALSTREAM(rawoutstream, " (H5F_LIBVER_LATEST is aliased to H5F_LIBVER_V110 for this release\n");
PRINTVALSTREAM(rawoutstream, "\n");
PRINTVALSTREAM(rawoutstream, " FS_STRATEGY is a string indicating the file space strategy used:\n");
PRINTVALSTREAM(rawoutstream, " FSM_AGGR:\n");
@@ -205,6 +217,11 @@ static void usage(const char *prog) {
PRINTVALSTREAM(rawoutstream, " Using latest file format with maximum compact group size of 10 and\n");
PRINTVALSTREAM(rawoutstream, " and minimum shared datatype size of 20\n");
PRINTVALSTREAM(rawoutstream, "\n");
+ PRINTVALSTREAM(rawoutstream, "5) h5repack --low=0 --high=1 file1 file2\n");
+ PRINTVALSTREAM(rawoutstream, "\n");
+ PRINTVALSTREAM(rawoutstream, " Set low=H5F_LIBVER_EARLIEST and high=H5F_LIBVER_V18 via H5Pset_libver_bounds() when\n");
+ PRINTVALSTREAM(rawoutstream, " creating the repacked file: file2\n");
+ PRINTVALSTREAM(rawoutstream, "\n");
PRINTVALSTREAM(rawoutstream, "5) h5repack -f SHUF -f GZIP=1 file1 file2\n");
PRINTVALSTREAM(rawoutstream, "\n");
PRINTVALSTREAM(rawoutstream, " Add both filters SHUF and GZIP in this order to all datasets\n");
@@ -500,6 +517,22 @@ int parse_command_line(int argc, const char **argv, pack_opt_t* options)
options->latest = TRUE;
break;
+ case 'j':
+ options->low_bound = (H5F_libver_t)HDatoi(opt_arg);
+ if(options->low_bound < H5F_LIBVER_EARLIEST || options->low_bound > H5F_LIBVER_LATEST) {
+ error_msg("in parsing low bound\n");
+ goto done;
+ }
+ break;
+
+ case 'k':
+ options->high_bound = (H5F_libver_t)HDatoi(opt_arg);
+ if(options->high_bound < H5F_LIBVER_EARLIEST || options->high_bound > H5F_LIBVER_LATEST) {
+ error_msg("in parsing high bound\n");
+ goto done;
+ }
+ break;
+
case 'c':
options->grp_compact = HDatoi( opt_arg );
if (options->grp_compact > 0)
@@ -634,8 +667,8 @@ int parse_command_line(int argc, const char **argv, pack_opt_t* options)
break;
case 'E':
- enable_error_stack = TRUE;
- break;
+ enable_error_stack = 1;
+ break;
default:
break;
@@ -727,7 +760,7 @@ int main(int argc, const char **argv)
}
}
- if (enable_error_stack) {
+ if (enable_error_stack > 0) {
H5Eset_auto2(H5E_DEFAULT, func, edata);
H5Eset_auto2(H5tools_ERR_STACK_g, tools_func, tools_edata);
}
diff --git a/tools/test/CMakeLists.txt b/tools/test/CMakeLists.txt
index a7dd11f..6877bfc 100644
--- a/tools/test/CMakeLists.txt
+++ b/tools/test/CMakeLists.txt
@@ -7,34 +7,34 @@ PROJECT (HDF5_TOOLS_TEST)
add_definitions (${HDF_EXTRA_C_FLAGS})
#-- Add the h5diff tests
-add_subdirectory (${HDF5_TOOLS_TEST_SOURCE_DIR}/h5diff)
+add_subdirectory (h5diff)
#-- Add the h5ls tests
-add_subdirectory (${HDF5_TOOLS_TEST_SOURCE_DIR}/h5ls)
+add_subdirectory (h5ls)
#-- Misc tests
-add_subdirectory (${HDF5_TOOLS_TEST_SOURCE_DIR}/misc)
+add_subdirectory (misc)
#-- Add the h5import tests
-add_subdirectory (${HDF5_TOOLS_TEST_SOURCE_DIR}/h5import)
+add_subdirectory (h5import)
#-- h5Repack tests
-add_subdirectory (${HDF5_TOOLS_TEST_SOURCE_DIR}/h5repack)
+add_subdirectory (h5repack)
#-- Add the h5jam tests
-add_subdirectory (${HDF5_TOOLS_TEST_SOURCE_DIR}/h5jam)
+add_subdirectory (h5jam)
#-- Add the h5copy tests
-add_subdirectory (${HDF5_TOOLS_TEST_SOURCE_DIR}/h5copy)
+add_subdirectory (h5copy)
#-- Add the h5stat tests
-add_subdirectory (${HDF5_TOOLS_TEST_SOURCE_DIR}/h5stat)
+add_subdirectory (h5stat)
#-- Add the h5dump tests
-add_subdirectory (${HDF5_TOOLS_TEST_SOURCE_DIR}/h5dump)
+add_subdirectory (h5dump)
#-- Add the h5format_convert and test executables
-add_subdirectory (${HDF5_TOOLS_TEST_SOURCE_DIR}/h5format_convert)
+add_subdirectory (h5format_convert)
#-- Add the perform tests
-add_subdirectory (${HDF5_TOOLS_TEST_SOURCE_DIR}/perform)
+add_subdirectory (perform)
diff --git a/tools/test/h5copy/h5copygentest.c b/tools/test/h5copy/h5copygentest.c
index 35f9132..9f5d916 100644
--- a/tools/test/h5copy/h5copygentest.c
+++ b/tools/test/h5copy/h5copygentest.c
@@ -225,7 +225,7 @@ static void gent_compressed(hid_t loc_id)
/*-------------------------------------------------------------------------
* Function: gent_named_vl
*
- * Purpose: Generate a variable lenght named datatype for a dataset in
+ * Purpose: Generate a variable length named datatype for a dataset in
LOC_ID
*
*-------------------------------------------------------------------------
diff --git a/tools/test/h5repack/testfiles/h5repack-help.txt b/tools/test/h5repack/testfiles/h5repack-help.txt
index 1ff5b73..0eef0f5 100644
--- a/tools/test/h5repack/testfiles/h5repack-help.txt
+++ b/tools/test/h5repack/testfiles/h5repack-help.txt
@@ -6,7 +6,13 @@ usage: h5repack [OPTIONS] file1 file2
-v, --verbose Verbose mode, print object information
-V, --version Print version number and exit
-n, --native Use a native HDF5 type when repacking
+ --enable-error-stack Prints messages from the HDF5 error stack as they occur
-L, --latest Use latest version of file format
+ This option will take precedence over the -j and -k options
+ --low=BOUND The low bound for library release versions to use when creating
+ objects in the file (default is H5F_LIBVER_EARLIEST)
+ --high=BOUND The high bound for library release versions to use when creating
+ objects in the file (default is H5F_LIBVER_LATEST)
-c L1, --compact=L1 Maximum number of links in header messages
-d L2, --indexed=L2 Minimum number of links in the indexed format
-s S[:F], --ssize=S[:F] Shared object header message minimum size
@@ -39,8 +45,12 @@ usage: h5repack [OPTIONS] file1 file2
F - is the shared object header message type, any of <dspace|dtype|fill|
pline|attr>. If F is not specified, S applies to all messages
- --enable-error-stack Prints messages from the HDF5 error stack as they
- occur.
+ BOUND is an integer indicating the library release versions to use when creating
+ objects in the file (see H5Pset_libver_bounds()):
+ 0: This is H5F_LIBVER_EARLIEST in H5F_libver_t struct
+ 1: This is H5F_LIBVER_V18 in H5F_libver_t struct
+ 2: This is H5F_LIBVER_V110 in H5F_libver_t struct
+ (H5F_LIBVER_LATEST is aliased to H5F_LIBVER_V110 for this release
FS_STRATEGY is a string indicating the file space strategy used:
FSM_AGGR:
@@ -130,6 +140,11 @@ Examples of use:
Using latest file format with maximum compact group size of 10 and
and minimum shared datatype size of 20
+5) h5repack --low=0 --high=1 file1 file2
+
+ Set low=H5F_LIBVER_EARLIEST and high=H5F_LIBVER_V18 via H5Pset_libver_bounds() when
+ creating the repacked file: file2
+
5) h5repack -f SHUF -f GZIP=1 file1 file2
Add both filters SHUF and GZIP in this order to all datasets
diff --git a/tools/test/misc/CMakeLists.txt b/tools/test/misc/CMakeLists.txt
index 48bc8ab..c014fad 100644
--- a/tools/test/misc/CMakeLists.txt
+++ b/tools/test/misc/CMakeLists.txt
@@ -22,7 +22,7 @@ INCLUDE_DIRECTORIES (${HDF5_TOOLS_DIR}/lib)
set_target_properties (h5clear_gentest PROPERTIES FOLDER tools)
#add_test (NAME H5CLEAR-h5clear_gentest COMMAND $<TARGET_FILE:h5clear_gentest>)
- add_subdirectory (${HDF5_TOOLS_TEST_MISC_SOURCE_DIR}/vds)
+ add_subdirectory (vds)
endif ()
diff --git a/tools/test/perform/pio_perf.h b/tools/test/perform/pio_perf.h
index b595c90..7605f20 100644
--- a/tools/test/perform/pio_perf.h
+++ b/tools/test/perform/pio_perf.h
@@ -15,7 +15,6 @@
#include "io_timer.h"
#ifndef STANDALONE
-#include "H5private.h"
#include "h5test.h"
#include "h5tools.h"
#include "h5tools_utils.h"
@@ -36,22 +35,22 @@ typedef enum iotype_ {
} iotype;
typedef struct parameters_ {
- iotype io_type; /* The type of IO test to perform */
- int num_procs; /* Maximum number of processes to use */
- long num_files; /* Number of files to create */
- long num_dsets; /* Number of datasets to create */
- off_t num_bytes; /* Number of bytes in each dset */
+ iotype io_type; /* The type of IO test to perform */
+ int num_procs; /* Maximum number of processes to use */
+ long num_files; /* Number of files to create */
+ long num_dsets; /* Number of datasets to create */
+ off_t num_bytes; /* Number of bytes in each dset */
int num_iters; /* Number of times to loop doing the IO */
- size_t buf_size; /* Buffer size */
- size_t blk_size; /* Block size */
+ size_t buf_size; /* Buffer size */
+ size_t blk_size; /* Block size */
unsigned interleaved; /* Interleaved vs. contiguous blocks */
unsigned collective; /* Collective vs. independent I/O */
unsigned dim2d; /* 1D vs. 2D */
- hsize_t h5_align; /* HDF5 object alignment */
- hsize_t h5_thresh; /* HDF5 object alignment threshold */
- int h5_use_chunks; /* Make HDF5 dataset chunked */
- int h5_write_only; /* Perform the write tests only */
- int verify; /* Verify data correctness */
+ hsize_t h5_align; /* HDF5 object alignment */
+ hsize_t h5_thresh; /* HDF5 object alignment threshold */
+ int h5_use_chunks; /* Make HDF5 dataset chunked */
+ int h5_write_only; /* Perform the write tests only */
+ int verify; /* Verify data correctness */
} parameters;
typedef struct results_ {
diff --git a/tools/test/perform/sio_perf.h b/tools/test/perform/sio_perf.h
index 366b791..83caf54 100644
--- a/tools/test/perform/sio_perf.h
+++ b/tools/test/perform/sio_perf.h
@@ -15,7 +15,6 @@
#include "io_timer.h"
#ifndef STANDALONE
-#include "H5private.h"
#include "h5test.h"
#include "h5tools.h"
#include "h5tools_utils.h"
diff --git a/tools/testfiles/h5dump-help.txt b/tools/testfiles/h5dump-help.txt
index fe22a1b..19de76f 100644
--- a/tools/testfiles/h5dump-help.txt
+++ b/tools/testfiles/h5dump-help.txt
@@ -44,8 +44,8 @@ usage: h5dump [OPTIONS] files
-m T, --format=T Set the floating point output format
-q Q, --sort_by=Q Sort groups and attributes by index Q
-z Z, --sort_order=Z Sort groups and attributes by order Z
- --enable-error-stack Prints messages from the HDF5 error stack as they
- occur.
+ --enable-error-stack Prints messages from the HDF5 error stack as they occur.
+ Optional value 2 also prints file open errors.
--no-compact-subset Disable compact form of subsetting and allow the use
of "[" in dataset names.
-w N, --width=N Set the number of columns of output. A value of 0 (zero)
diff --git a/tools/testfiles/pbits/tnofilename-with-packed-bits.ddl b/tools/testfiles/pbits/tnofilename-with-packed-bits.ddl
index 767cbbf..0a3beb0 100644
--- a/tools/testfiles/pbits/tnofilename-with-packed-bits.ddl
+++ b/tools/testfiles/pbits/tnofilename-with-packed-bits.ddl
@@ -44,8 +44,8 @@ usage: h5dump [OPTIONS] files
-m T, --format=T Set the floating point output format
-q Q, --sort_by=Q Sort groups and attributes by index Q
-z Z, --sort_order=Z Sort groups and attributes by order Z
- --enable-error-stack Prints messages from the HDF5 error stack as they
- occur.
+ --enable-error-stack Prints messages from the HDF5 error stack as they occur.
+ Optional value 2 also prints file open errors.
--no-compact-subset Disable compact form of subsetting and allow the use
of "[" in dataset names.
-w N, --width=N Set the number of columns of output. A value of 0 (zero)
diff --git a/tools/testfiles/pbits/tpbitsIncomplete.ddl b/tools/testfiles/pbits/tpbitsIncomplete.ddl
index d791b41..b353065 100644
--- a/tools/testfiles/pbits/tpbitsIncomplete.ddl
+++ b/tools/testfiles/pbits/tpbitsIncomplete.ddl
@@ -44,8 +44,8 @@ usage: h5dump [OPTIONS] files
-m T, --format=T Set the floating point output format
-q Q, --sort_by=Q Sort groups and attributes by index Q
-z Z, --sort_order=Z Sort groups and attributes by order Z
- --enable-error-stack Prints messages from the HDF5 error stack as they
- occur.
+ --enable-error-stack Prints messages from the HDF5 error stack as they occur.
+ Optional value 2 also prints file open errors.
--no-compact-subset Disable compact form of subsetting and allow the use
of "[" in dataset names.
-w N, --width=N Set the number of columns of output. A value of 0 (zero)
diff --git a/tools/testfiles/pbits/tpbitsLengthExceeded.ddl b/tools/testfiles/pbits/tpbitsLengthExceeded.ddl
index 5235aa7..ffe0da9 100644
--- a/tools/testfiles/pbits/tpbitsLengthExceeded.ddl
+++ b/tools/testfiles/pbits/tpbitsLengthExceeded.ddl
@@ -44,8 +44,8 @@ usage: h5dump [OPTIONS] files
-m T, --format=T Set the floating point output format
-q Q, --sort_by=Q Sort groups and attributes by index Q
-z Z, --sort_order=Z Sort groups and attributes by order Z
- --enable-error-stack Prints messages from the HDF5 error stack as they
- occur.
+ --enable-error-stack Prints messages from the HDF5 error stack as they occur.
+ Optional value 2 also prints file open errors.
--no-compact-subset Disable compact form of subsetting and allow the use
of "[" in dataset names.
-w N, --width=N Set the number of columns of output. A value of 0 (zero)
diff --git a/tools/testfiles/pbits/tpbitsLengthPositive.ddl b/tools/testfiles/pbits/tpbitsLengthPositive.ddl
index 697bff8..4502143 100644
--- a/tools/testfiles/pbits/tpbitsLengthPositive.ddl
+++ b/tools/testfiles/pbits/tpbitsLengthPositive.ddl
@@ -44,8 +44,8 @@ usage: h5dump [OPTIONS] files
-m T, --format=T Set the floating point output format
-q Q, --sort_by=Q Sort groups and attributes by index Q
-z Z, --sort_order=Z Sort groups and attributes by order Z
- --enable-error-stack Prints messages from the HDF5 error stack as they
- occur.
+ --enable-error-stack Prints messages from the HDF5 error stack as they occur.
+ Optional value 2 also prints file open errors.
--no-compact-subset Disable compact form of subsetting and allow the use
of "[" in dataset names.
-w N, --width=N Set the number of columns of output. A value of 0 (zero)
diff --git a/tools/testfiles/pbits/tpbitsMaxExceeded.ddl b/tools/testfiles/pbits/tpbitsMaxExceeded.ddl
index 900c0b5..011f6c9 100644
--- a/tools/testfiles/pbits/tpbitsMaxExceeded.ddl
+++ b/tools/testfiles/pbits/tpbitsMaxExceeded.ddl
@@ -44,8 +44,8 @@ usage: h5dump [OPTIONS] files
-m T, --format=T Set the floating point output format
-q Q, --sort_by=Q Sort groups and attributes by index Q
-z Z, --sort_order=Z Sort groups and attributes by order Z
- --enable-error-stack Prints messages from the HDF5 error stack as they
- occur.
+ --enable-error-stack Prints messages from the HDF5 error stack as they occur.
+ Optional value 2 also prints file open errors.
--no-compact-subset Disable compact form of subsetting and allow the use
of "[" in dataset names.
-w N, --width=N Set the number of columns of output. A value of 0 (zero)
diff --git a/tools/testfiles/pbits/tpbitsOffsetExceeded.ddl b/tools/testfiles/pbits/tpbitsOffsetExceeded.ddl
index 65123d0..857fe62 100644
--- a/tools/testfiles/pbits/tpbitsOffsetExceeded.ddl
+++ b/tools/testfiles/pbits/tpbitsOffsetExceeded.ddl
@@ -44,8 +44,8 @@ usage: h5dump [OPTIONS] files
-m T, --format=T Set the floating point output format
-q Q, --sort_by=Q Sort groups and attributes by index Q
-z Z, --sort_order=Z Sort groups and attributes by order Z
- --enable-error-stack Prints messages from the HDF5 error stack as they
- occur.
+ --enable-error-stack Prints messages from the HDF5 error stack as they occur.
+ Optional value 2 also prints file open errors.
--no-compact-subset Disable compact form of subsetting and allow the use
of "[" in dataset names.
-w N, --width=N Set the number of columns of output. A value of 0 (zero)
diff --git a/tools/testfiles/pbits/tpbitsOffsetNegative.ddl b/tools/testfiles/pbits/tpbitsOffsetNegative.ddl
index d352e34..9ac1160 100644
--- a/tools/testfiles/pbits/tpbitsOffsetNegative.ddl
+++ b/tools/testfiles/pbits/tpbitsOffsetNegative.ddl
@@ -44,8 +44,8 @@ usage: h5dump [OPTIONS] files
-m T, --format=T Set the floating point output format
-q Q, --sort_by=Q Sort groups and attributes by index Q
-z Z, --sort_order=Z Sort groups and attributes by order Z
- --enable-error-stack Prints messages from the HDF5 error stack as they
- occur.
+ --enable-error-stack Prints messages from the HDF5 error stack as they occur.
+ Optional value 2 also prints file open errors.
--no-compact-subset Disable compact form of subsetting and allow the use
of "[" in dataset names.
-w N, --width=N Set the number of columns of output. A value of 0 (zero)