summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CMakeInstallation.cmake1
-rw-r--r--CMakeLists.txt7
-rw-r--r--MANIFEST4
-rwxr-xr-xREADME.txt2
-rwxr-xr-xbin/release4
-rw-r--r--c++/examples/run-c++-ex.sh.in2
-rw-r--r--c++/src/cpp_doc_config2
-rw-r--r--config/cmake/HDF518_Examples.cmake.in2
-rw-r--r--config/cmake/HDF5UseFortran.cmake147
-rw-r--r--config/cmake/HDF5_Examples.cmake.in4
-rw-r--r--config/cmake/HDFCompilerFlags.cmake150
-rwxr-xr-xconfig/cmake/scripts/HDF5config.cmake4
-rwxr-xr-xconfig/cmake/scripts/HDF5options.cmake22
-rw-r--r--config/cmake_ext_mod/ConfigureChecks.cmake48
-rw-r--r--config/cmake_ext_mod/HDFLibMacros.cmake9
-rw-r--r--config/cmake_ext_mod/HDFMacros.cmake24
-rw-r--r--config/intel.cmake10
-rwxr-xr-xconfigure22
-rw-r--r--configure.ac2
-rw-r--r--examples/run-c-ex.sh.in2
-rw-r--r--fortran/examples/run-fortran-ex.sh.in2
-rw-r--r--fortran/src/H5config_f.inc.cmake36
-rw-r--r--fortran/test/tH5F.F902
-rw-r--r--hl/c++/examples/run-hlc++-ex.sh.in2
-rw-r--r--hl/examples/run-hlc-ex.sh.in2
-rw-r--r--hl/fortran/examples/run-hlfortran-ex.sh.in2
-rw-r--r--hl/src/H5DS.c106
-rw-r--r--hl/test/test_ds.c112
-rw-r--r--hl/test/test_lite.c86
-rw-r--r--java/examples/datasets/JavaDatasetExample.sh.in45
-rw-r--r--java/examples/datatypes/JavaDatatypeExample.sh.in43
-rw-r--r--java/examples/groups/JavaGroupExample.sh.in70
-rw-r--r--java/examples/intro/JavaIntroExample.sh.in43
-rw-r--r--java/src/hdf/hdf5lib/H5.java4
-rw-r--r--java/src/hdf/overview.html2
-rw-r--r--java/src/jni/CMakeLists.txt14
-rw-r--r--java/src/jni/h5Imp.c1
-rw-r--r--java/src/jni/h5aImp.c22
-rw-r--r--java/src/jni/h5dImp.c21
-rw-r--r--java/src/jni/h5eImp.c18
-rw-r--r--java/src/jni/h5fImp.c7
-rw-r--r--java/src/jni/h5gImp.c1
-rw-r--r--java/src/jni/h5iImp.c1
-rw-r--r--java/src/jni/h5lImp.c29
-rw-r--r--java/src/jni/h5oImp.c21
-rw-r--r--java/src/jni/h5pImp.c34
-rw-r--r--java/src/jni/h5plImp.c1
-rw-r--r--java/src/jni/h5rImp.c1
-rw-r--r--java/src/jni/h5sImp.c7
-rw-r--r--java/src/jni/h5tImp.c1
-rw-r--r--java/src/jni/h5util.c11
-rw-r--r--java/test/TestH5.java4
-rw-r--r--java/test/TestH5E.java18
-rw-r--r--java/test/TestH5Edefault.java43
-rw-r--r--java/test/junit.sh.in38
-rw-r--r--release_docs/HISTORY-1_10.txt668
-rwxr-xr-xrelease_docs/INSTALL112
-rw-r--r--release_docs/INSTALL_CMake.txt80
-rwxr-xr-xrelease_docs/INSTALL_Cygwin.txt12
-rw-r--r--release_docs/INSTALL_Warnings.txt474
-rwxr-xr-xrelease_docs/RELEASE.txt452
-rw-r--r--release_docs/USING_CMake_Examples.txt2
-rw-r--r--src/CMakeLists.txt101
-rw-r--r--src/H5Dmpio.c18
-rw-r--r--src/H5MF.c2
-rw-r--r--src/H5detect.c961
-rw-r--r--src/H5make_libsettings.c252
-rw-r--r--src/H5public.h4
-rw-r--r--test/CMakeLists.txt2
-rw-r--r--test/CMakeTests.cmake66
-rw-r--r--test/Makefile.am10
-rw-r--r--test/Makefile.in10
-rw-r--r--test/cache_logging.c12
-rw-r--r--test/genall5.c3208
-rw-r--r--test/ohdr.c4
-rw-r--r--test/tmisc.c2
-rw-r--r--test/tunicode.c6
-rw-r--r--test/tvltypes.c22
-rw-r--r--test/vfd.c22
-rw-r--r--testpar/CMakeLists.txt1
-rw-r--r--testpar/Makefile.am2
-rw-r--r--testpar/Makefile.in6
-rw-r--r--testpar/t_cache.c2
-rw-r--r--testpar/t_coll_md_read.c199
-rw-r--r--testpar/t_dset.c1050
-rw-r--r--testpar/testphdf5.c3
-rw-r--r--testpar/testphdf5.h1
-rw-r--r--tools/CMakeLists.txt3
-rw-r--r--tools/lib/h5tools_utils.h2
-rw-r--r--tools/src/h5diff/h5diff_common.c6
-rw-r--r--tools/src/h5dump/h5dump.c2
-rw-r--r--tools/src/h5format_convert/h5format_convert.c164
-rw-r--r--tools/src/h5import/h5import.c302
-rw-r--r--tools/src/h5jam/h5jam.c30
-rw-r--r--tools/src/h5stat/h5stat.c88
-rw-r--r--tools/src/misc/h5debug.c2
-rw-r--r--tools/test/h5copy/CMakeTests.cmake3
-rw-r--r--tools/test/h5dump/CMakeTests.cmake3
-rw-r--r--tools/test/h5dump/CMakeTestsXML.cmake3
-rw-r--r--tools/test/h5import/CMakeTests.cmake3
-rw-r--r--tools/test/h5import/h5importtest.c4
-rw-r--r--tools/test/h5repack/CMakeTests.cmake24
-rw-r--r--tools/test/h5repack/testfiles/h5repack_layout.h5-plugin_version_test.ddl14
-rw-r--r--tools/test/perform/perf.c70
104 files changed, 5301 insertions, 4506 deletions
diff --git a/CMakeInstallation.cmake b/CMakeInstallation.cmake
index 622f0cf..2339049 100644
--- a/CMakeInstallation.cmake
+++ b/CMakeInstallation.cmake
@@ -215,6 +215,7 @@ if (NOT HDF5_EXTERNALLY_CONFIGURED)
if (HDF5_PACK_INSTALL_DOCS)
set (release_files
${release_files}
+ ${HDF5_SOURCE_DIR}/release_docs/INSTALL_Warnings.txt
${HDF5_SOURCE_DIR}/release_docs/INSTALL_CMake.txt
${HDF5_SOURCE_DIR}/release_docs/HISTORY-1_8.txt
${HDF5_SOURCE_DIR}/release_docs/INSTALL
diff --git a/CMakeLists.txt b/CMakeLists.txt
index a99ba33..24bb83d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -46,6 +46,9 @@ endif ()
# dependencies of the HDF5 libs may be 'incomplete', add additional
# dependencies to this variable so that external projects pick them up
#
+#option (HDF5_EXTERNAL_LIB_PREFIX "Use prefix for custom library naming." "")
+set (HDF5_EXTERNAL_LIB_PREFIX "" CACHE STRING "Use prefix for custom library naming.")
+mark_as_advanced (HDF5_EXTERNAL_LIB_PREFIX)
# HDF5_EXTERNAL_LIB_PREFIX :
# If the parent project needs to install hdf libraries, but avoid
# name conflicts with system versions, then a prefix may be added
@@ -548,11 +551,11 @@ else ()
endif ()
include (${HDF_RESOURCES_DIR}/HDFCompilerFlags.cmake)
+set (CMAKE_MODULE_PATH ${HDF_RESOURCES_DIR} ${HDF_RESOURCES_EXT_DIR} ${CMAKE_MODULE_PATH})
#-----------------------------------------------------------------------------
# Option to Enable MPI Parallel
#-----------------------------------------------------------------------------
-set (CMAKE_MODULE_PATH ${HDF_RESOURCES_DIR} ${HDF_RESOURCES_EXT_DIR} ${CMAKE_MODULE_PATH})
option (HDF5_ENABLE_PARALLEL "Enable parallel build (requires MPI)" OFF)
if (HDF5_ENABLE_PARALLEL)
find_package(MPI REQUIRED)
@@ -586,7 +589,7 @@ if (HDF5_ENABLE_PARALLEL)
set (LARGE_PARALLEL_IO OFF)
endif ()
else ()
- message (STATUS "Parallel libraries not found")
+ message (FATAL_ERROR "Parallel libraries not found")
endif ()
endif ()
diff --git a/MANIFEST b/MANIFEST
index bc18d67..11611d6 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -445,6 +445,7 @@
./release_docs/INSTALL_CMake.txt
./release_docs/INSTALL_Cygwin.txt
./release_docs/INSTALL_parallel
+./release_docs/INSTALL_Warnings.txt
./release_docs/INSTALL_Windows.txt
./release_docs/RELEASE.txt
./release_docs/USING_HDF5_CMake.txt
@@ -1247,6 +1248,7 @@
./testpar/t_cache_image.c
./testpar/t_chunk_alloc.c
./testpar/t_coll_chunk.c
+./testpar/t_coll_md_read.c
./testpar/t_dset.c
./testpar/t_file.c
./testpar/t_file_image.c
@@ -3144,6 +3146,8 @@
./java/lib/ext/slf4j-simple-1.7.25.jar
# CMake-specific Files
+./config/intel.cmake
+
./config/cmake/cacheinit.cmake
./config/cmake/CMakeFindJavaCommon.cmake
./config/cmake/ConversionTests.c
diff --git a/README.txt b/README.txt
index 899ba95..0415e2a 100755
--- a/README.txt
+++ b/README.txt
@@ -1,4 +1,4 @@
-HDF5 version 1.10.3 released on 2018-08-21
+HDF5 version 1.10.4 released on 2018-10-05
------------------------------------------------------------------------------
Please refer to the release_docs/INSTALL file for installation instructions.
diff --git a/bin/release b/bin/release
index afdbb51..e43be17 100755
--- a/bin/release
+++ b/bin/release
@@ -225,7 +225,7 @@ tar2cmakezip()
# step 3: add SZIP.tar.gz, ZLib.tar.gz and cmake files
cp /mnt/scr1/pre-release/hdf5/CMake/SZip.tar.gz $cmziptmpsubdir
cp /mnt/scr1/pre-release/hdf5/CMake/ZLib.tar.gz $cmziptmpsubdir
- cp /mnt/scr1/pre-release/hdf5/CMake/HDF5Examples-1.10.8-Source.tar.gz $cmziptmpsubdir
+ cp /mnt/scr1/pre-release/hdf5/CMake/HDF5Examples-1.10.10-Source.tar.gz $cmziptmpsubdir
cp $cmziptmpsubdir/$version/config/cmake/scripts/CTestScript.cmake $cmziptmpsubdir
cp $cmziptmpsubdir/$version/config/cmake/scripts/HDF5config.cmake $cmziptmpsubdir
cp $cmziptmpsubdir/$version/config/cmake/scripts/HDF5options.cmake $cmziptmpsubdir
@@ -320,7 +320,7 @@ tar2cmaketgz()
# step 3: add SZIP.tar.gz, ZLib.tar.gz and cmake files
cp /mnt/scr1/pre-release/hdf5/CMake/SZip.tar.gz $cmgztmpsubdir
cp /mnt/scr1/pre-release/hdf5/CMake/ZLib.tar.gz $cmgztmpsubdir
- cp /mnt/scr1/pre-release/hdf5/CMake/HDF5Examples-1.10.8-Source.tar.gz $cmgztmpsubdir
+ cp /mnt/scr1/pre-release/hdf5/CMake/HDF5Examples-1.10.10-Source.tar.gz $cmgztmpsubdir
cp $cmgztmpsubdir/$version/config/cmake/scripts/CTestScript.cmake $cmgztmpsubdir
cp $cmgztmpsubdir/$version/config/cmake/scripts/HDF5config.cmake $cmgztmpsubdir
cp $cmgztmpsubdir/$version/config/cmake/scripts/HDF5options.cmake $cmgztmpsubdir
diff --git a/c++/examples/run-c++-ex.sh.in b/c++/examples/run-c++-ex.sh.in
index f0d3e93..d975924 100644
--- a/c++/examples/run-c++-ex.sh.in
+++ b/c++/examples/run-c++-ex.sh.in
@@ -32,7 +32,7 @@ EXIT_FAILURE=1
# Where the tool is installed.
# default is relative path to installed location of the tools
-prefix="${prefix:-@prefix@}"
+prefix="${prefix:-../../..}"
AR="@AR@"
RANLIB="@RANLIB@"
H5TOOL="h5c++" # The tool name
diff --git a/c++/src/cpp_doc_config b/c++/src/cpp_doc_config
index 8477986..0fdd91c 100644
--- a/c++/src/cpp_doc_config
+++ b/c++/src/cpp_doc_config
@@ -38,7 +38,7 @@ PROJECT_NAME =
# could be handy for archiving the generated documentation or if some version
# control system is used.
-PROJECT_NUMBER = "1.10.3"
+PROJECT_NUMBER = "1.10.4"
# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a
diff --git a/config/cmake/HDF518_Examples.cmake.in b/config/cmake/HDF518_Examples.cmake.in
index 1f4f479..ba79ef2 100644
--- a/config/cmake/HDF518_Examples.cmake.in
+++ b/config/cmake/HDF518_Examples.cmake.in
@@ -48,7 +48,7 @@ set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DCTEST_CONFIGURATION_TYPE:STRING=${
##################################################################
if(NOT DEFINED INSTALLDIR)
- set(INSTALLDIR "@CMAKE_INSTALL_PREFIX@")
+ set(INSTALLDIR "C:/Program Files/HDF_Group/@HDF5_PACKAGE_NAME@/@HDF5_PACKAGE_VERSION@")
endif()
if(NOT DEFINED CTEST_SOURCE_NAME)
diff --git a/config/cmake/HDF5UseFortran.cmake b/config/cmake/HDF5UseFortran.cmake
index 1f66bad..157befd 100644
--- a/config/cmake/HDF5UseFortran.cmake
+++ b/config/cmake/HDF5UseFortran.cmake
@@ -31,69 +31,53 @@ endif ()
# The provided CMake Fortran macros don't provide a general compile/run function
# so this one is used.
#-----------------------------------------------------------------------------
-macro (FORTRAN_RUN FUNCTION CODE RUN_RESULT_VAR1 COMPILE_RESULT_VAR RETURN)
-#
-# if (NOT DEFINED ${RUN_RESULT_VAR})
- message (STATUS "Detecting Fortran ${FUNCTION}")
- if (CMAKE_REQUIRED_LIBRARIES)
- set (CHECK_FUNCTION_EXISTS_ADD_LIBRARIES
- "-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}")
- else ()
- set (CHECK_FUNCTION_EXISTS_ADD_LIBRARIES)
- endif ()
+macro (FORTRAN_RUN FUNCTION_NAME SOURCE_CODE RUN_RESULT_VAR1 COMPILE_RESULT_VAR1 RETURN_VAR)
+ message (STATUS "Detecting Fortran ${FUNCTION_NAME}")
file (WRITE
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testFortranCompiler1.f90
- "${CODE}"
+ "${SOURCE_CODE}"
)
TRY_RUN (RUN_RESULT_VAR COMPILE_RESULT_VAR
${CMAKE_BINARY_DIR}
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testFortranCompiler1.f90
- CMAKE_FLAGS "${CHECK_FUNCTION_EXISTS_ADD_LIBRARIES}"
- RUN_OUTPUT_VARIABLE OUTPUT
+ LINK_LIBRARIES "${CMAKE_REQUIRED_LIBRARIES}"
)
- set(${RETURN} ${OUTPUT})
-
- #message ( "Test result1 ${RETURN} ")
- #message ( "Test result3 ${RESULT} ")
- #message ( "Test result2 ${CMAKE_MATCH_0} ")
- #message ( "Test result4 ${CMAKE_MATCH_1} ")
- #message ( "* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ")
- #message ( "Test result2 ${COMPILE_RESULT_VAR} ")
- #message ( "* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ")
- #message ( "Test result1 ${RUN_RESULT_VAR} ")
- #message ( "* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ")
-
if (${COMPILE_RESULT_VAR})
+ set(${RETURN_VAR} ${RUN_RESULT_VAR})
if (${RUN_RESULT_VAR} MATCHES 0)
- message (STATUS "Testing Fortran ${FUNCTION} - OK")
+ message (STATUS "Testing Fortran ${FUNCTION_NAME} - OK")
file (APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
- "Determining if the Fortran ${FUNCTION} exists passed with the following output:\n"
- "${OUTPUT}\n\n"
+ "Determining if the Fortran ${FUNCTION_NAME} exists passed\n"
)
else ()
- message (STATUS "Testing Fortran ${FUNCTION} - Fail")
+ message (STATUS "Testing Fortran ${FUNCTION_NAME} - Fail")
file (APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
- "Determining if the Fortran ${FUNCTION} exists failed with the following output:\n"
- "${OUTPUT}\n\n")
+ "Determining if the Fortran ${FUNCTION_NAME} exists failed: ${RUN_RESULT_VAR}\n"
+ )
endif ()
+ else ()
+ message (STATUS "Compiling Fortran ${FUNCTION_NAME} - Fail")
+ file (APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
+ "Determining if the Fortran ${FUNCTION_NAME} compiles failed: ${COMPILE_RESULT_VAR}\n"
+ )
+ set(${RETURN_VAR} ${COMPILE_RESULT_VAR})
endif ()
-# endif ()
endmacro ()
# Read source line beginning at the line matching Input:"START" and ending at the line matching Input:"END"
-macro (READ_SOURCE START END RETURN)
- file (READ "${HDF5_SOURCE_DIR}/m4/aclocal_fc.f90" CODE)
- string (REGEX MATCH "${START}[\\\t\\\n\\\r[].+]*${END}" CODE ${CODE})
- set (RETURN "${CODE}")
+macro (READ_SOURCE SOURCE_START SOURCE_END RETURN_VAR)
+ file (READ "${HDF5_SOURCE_DIR}/m4/aclocal_fc.f90" SOURCE_CODE)
+ string (REGEX MATCH "${SOURCE_START}[\\\t\\\n\\\r[].+]*${SOURCE_END}" SOURCE_CODE ${SOURCE_CODE})
+ set (RETURN_VAR "${SOURCE_CODE}")
endmacro ()
#-----------------------------------------------------------------------------
# Check to see C_LONG_DOUBLE is available
-READ_SOURCE("PROGRAM PROG_FC_HAVE_C_LONG_DOUBLE" "END PROGRAM PROG_FC_HAVE_C_LONG_DOUBLE" CODE)
+READ_SOURCE("PROGRAM PROG_FC_HAVE_C_LONG_DOUBLE" "END PROGRAM PROG_FC_HAVE_C_LONG_DOUBLE" SOURCE_CODE)
CHECK_FORTRAN_FEATURE(c_long_double
- "${CODE}"
+ "${SOURCE_CODE}"
FORTRAN_HAVE_C_LONG_DOUBLE
)
@@ -105,9 +89,9 @@ endif ()
# Check to see C_LONG_DOUBLE is different from C_DOUBLE
-READ_SOURCE("MODULE type_mod" "END PROGRAM PROG_FC_C_LONG_DOUBLE_EQ_C_DOUBLE" CODE)
+READ_SOURCE("MODULE type_mod" "END PROGRAM PROG_FC_C_LONG_DOUBLE_EQ_C_DOUBLE" SOURCE_CODE)
CHECK_FORTRAN_FEATURE(c_long_double
- "${CODE}"
+ "${SOURCE_CODE}"
FORTRAN_C_LONG_DOUBLE_IS_UNIQUE
)
if (${FORTRAN_C_LONG_DOUBLE_IS_UNIQUE})
@@ -133,12 +117,12 @@ endif ()
# Determine the available KINDs for REALs and INTEGERs
#-----------------------------------------------------------------------------
-READ_SOURCE ("PROGRAM FC_AVAIL_KINDS" "END PROGRAM FC_AVAIL_KINDS" CODE)
+READ_SOURCE ("PROGRAM FC_AVAIL_KINDS" "END PROGRAM FC_AVAIL_KINDS" SOURCE_CODE)
FORTRAN_RUN ("REAL and INTEGER KINDs"
- "${CODE}"
- XX
- YY
- PROG_OUTPUT
+ "${SOURCE_CODE}"
+ XX
+ YY
+ PROG_RESULT
)
# dnl The output from the above program will be:
# dnl -- LINE 1 -- valid integer kinds (comma seperated list)
@@ -197,15 +181,18 @@ foreach (KIND ${VAR} )
USE ISO_C_BINDING
IMPLICIT NONE
INTEGER (KIND=${KIND}) a
- WRITE(*,'(I0)') ${FC_SIZEOF_A}
+ OPEN(8,FILE='pac_validIntKinds.out',FORM='formatted')
+ WRITE(8,'(I0)') ${FC_SIZEOF_A}
+ CLOSE(8)
END
"
)
FORTRAN_RUN("INTEGER KIND SIZEOF" ${PROG_SRC}
- XX
- YY
- PROG_OUTPUT1
+ XX
+ YY
+ PROG_RESULT1
)
+ file (READ "${CMAKE_BINARY_DIR}/pac_validIntKinds.out" PROG_OUTPUT1)
string (REGEX REPLACE "\n" "" PROG_OUTPUT1 "${PROG_OUTPUT1}")
set (pack_int_sizeof "${pack_int_sizeof} ${PROG_OUTPUT1},")
endforeach ()
@@ -241,15 +228,18 @@ foreach (KIND ${VAR} )
USE ISO_C_BINDING
IMPLICIT NONE
REAL (KIND=${KIND}) a
- WRITE(*,'(I0)') ${FC_SIZEOF_A}
+ OPEN(8,FILE='pac_validRealKinds.out',FORM='formatted')
+ WRITE(8,'(I0)') ${FC_SIZEOF_A}
+ CLOSE(8)
END
"
)
FORTRAN_RUN ("REAL KIND SIZEOF" ${PROG_SRC}
- XX
- YY
- PROG_OUTPUT1
+ XX
+ YY
+ PROG_RESULT1
)
+ file (READ "${CMAKE_BINARY_DIR}/pac_validRealKinds.out" PROG_OUTPUT1)
string (REGEX REPLACE "\n" "" PROG_OUTPUT1 "${PROG_OUTPUT1}")
set (pack_real_sizeof "${pack_real_sizeof} ${PROG_OUTPUT1},")
endforeach ()
@@ -288,18 +278,21 @@ FORTRAN_RUN ("SIZEOF NATIVE KINDs"
INTEGER a
REAL b
DOUBLE PRECISION c
- WRITE(*,*) ${FC_SIZEOF_A}
- WRITE(*,*) kind(a)
- WRITE(*,*) ${FC_SIZEOF_B}
- WRITE(*,*) kind(b)
- WRITE(*,*) ${FC_SIZEOF_C}
- WRITE(*,*) kind(c)
+ OPEN(8,FILE='pac_sizeof_native_kinds.out',FORM='formatted')
+ WRITE(8,*) ${FC_SIZEOF_A}
+ WRITE(8,*) kind(a)
+ WRITE(8,*) ${FC_SIZEOF_B}
+ WRITE(8,*) kind(b)
+ WRITE(8,*) ${FC_SIZEOF_C}
+ WRITE(8,*) kind(c)
+ CLOSE(8)
END
"
- XX
- YY
- PROG_OUTPUT
-)
+ XX
+ YY
+ PROG_RESULT
+ )
+ file (READ "${CMAKE_BINARY_DIR}/pac_sizeof_native_kinds.out" PROG_OUTPUT)
# dnl The output from the above program will be:
# dnl -- LINE 1 -- sizeof INTEGER
# dnl -- LINE 2 -- kind of INTEGER
@@ -372,8 +365,8 @@ ENABLE_LANGUAGE (C)
# The provided CMake C macros don't provide a general compile/run function
# so this one is used.
#-----------------------------------------------------------------------------
-macro (C_RUN FUNCTION CODE RETURN)
- message (STATUS "Detecting C ${FUNCTION}")
+macro (C_RUN FUNCTION_NAME SOURCE_CODE RETURN_VAR)
+ message (STATUS "Detecting C ${FUNCTION_NAME}")
if (CMAKE_REQUIRED_LIBRARIES)
set (CHECK_FUNCTION_EXISTS_ADD_LIBRARIES
"-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}")
@@ -382,16 +375,16 @@ macro (C_RUN FUNCTION CODE RETURN)
endif ()
file (WRITE
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testCCompiler1.c
- ${CODE}
+ ${SOURCE_CODE}
)
TRY_RUN (RUN_RESULT_VAR COMPILE_RESULT_VAR
${CMAKE_BINARY_DIR}
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testCCompiler1.c
CMAKE_FLAGS "${CHECK_FUNCTION_EXISTS_ADD_LIBRARIES}"
- RUN_OUTPUT_VARIABLE OUTPUT
+ RUN_OUTPUT_VARIABLE OUTPUT_VAR
)
- set (${RETURN} ${OUTPUT})
+ set (${RETURN_VAR} ${OUTPUT_VAR})
#message ( "* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ")
#message ( "Test COMPILE_RESULT_VAR ${COMPILE_RESULT_VAR} ")
@@ -401,21 +394,21 @@ macro (C_RUN FUNCTION CODE RETURN)
if (${COMPILE_RESULT_VAR})
if (${RUN_RESULT_VAR} MATCHES 1)
- set (${RUN_RESULT_VAR} 1 CACHE INTERNAL "Have C function ${FUNCTION}")
- message (STATUS "Testing C ${FUNCTION} - OK")
+ set (${RUN_RESULT_VAR} 1 CACHE INTERNAL "Have C function ${FUNCTION_NAME}")
+ message (STATUS "Testing C ${FUNCTION_NAME} - OK")
file (APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
- "Determining if the C ${FUNCTION} exists passed with the following output:\n"
- "${OUTPUT}\n\n"
+ "Determining if the C ${FUNCTION_NAME} exists passed with the following output:\n"
+ "${OUTPUT_VAR}\n\n"
)
else ()
- message (STATUS "Testing C ${FUNCTION} - Fail")
- set (${RUN_RESULT_VAR} 0 CACHE INTERNAL "Have C function ${FUNCTION}")
+ message (STATUS "Testing C ${FUNCTION_NAME} - Fail")
+ set (${RUN_RESULT_VAR} 0 CACHE INTERNAL "Have C function ${FUNCTION_NAME}")
file (APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
- "Determining if the C ${FUNCTION} exists failed with the following output:\n"
- "${OUTPUT}\n\n")
+ "Determining if the C ${FUNCTION_NAME} exists failed with the following output:\n"
+ "${OUTPUT_VAR}\n\n")
endif ()
else ()
- message (FATAL_ERROR "Compilation of C ${FUNCTION} - Failed")
+ message (FATAL_ERROR "Compilation of C ${FUNCTION_NAME} - Failed")
endif ()
endmacro ()
diff --git a/config/cmake/HDF5_Examples.cmake.in b/config/cmake/HDF5_Examples.cmake.in
index eb57685..d30f2ab 100644
--- a/config/cmake/HDF5_Examples.cmake.in
+++ b/config/cmake/HDF5_Examples.cmake.in
@@ -48,7 +48,7 @@ set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DCTEST_CONFIGURATION_TYPE:STRING=${
##################################################################
if(NOT DEFINED INSTALLDIR)
- set(INSTALLDIR "@CMAKE_INSTALL_PREFIX@")
+ set(INSTALLDIR "C:/Program Files/HDF_Group/@HDF5_PACKAGE_NAME@/@HDF5_PACKAGE_VERSION@")
endif()
if(NOT DEFINED CTEST_SOURCE_NAME)
@@ -70,7 +70,7 @@ set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DSITE:STRING=${CTEST_SITE} -DBUILDN
#TAR_SOURCE - name of tarfile
#if(NOT DEFINED TAR_SOURCE)
-# set(CTEST_USE_TAR_SOURCE "HDF5Examples-1.10.5-Source")
+# set(CTEST_USE_TAR_SOURCE "HDF5Examples-1.10.10-Source")
#endif()
###############################################################################################################
diff --git a/config/cmake/HDFCompilerFlags.cmake b/config/cmake/HDFCompilerFlags.cmake
index 214afa0..93ebc3c 100644
--- a/config/cmake/HDFCompilerFlags.cmake
+++ b/config/cmake/HDFCompilerFlags.cmake
@@ -9,6 +9,8 @@
# If you do not have access to either file, you may request a copy from
# help@hdfgroup.org.
#
+
+message (STATUS "Warnings Configuration:")
#-----------------------------------------------------------------------------
# Compiler specific flags : Shouldn't there be compiler tests for these
#-----------------------------------------------------------------------------
@@ -22,7 +24,7 @@ if (CMAKE_COMPILER_IS_GNUCC)
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Og -ftrapv -fno-common")
endif ()
else ()
- if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 5.0)
+ if (CMAKE_C_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 5.0)
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fstdarg-opt")
endif ()
endif ()
@@ -34,7 +36,7 @@ if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED)
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Og -ftrapv -fno-common")
endif ()
else ()
- if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0)
+ if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0)
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fstdarg-opt")
endif ()
endif ()
@@ -45,6 +47,7 @@ endif ()
#-----------------------------------------------------------------------------
option (HDF5_DISABLE_COMPILER_WARNINGS "Disable compiler warnings" OFF)
if (HDF5_DISABLE_COMPILER_WARNINGS)
+ message (STATUS "....Compiler warnings are suppressed")
# MSVC uses /w to suppress warnings. It also complains if another
# warning level is given, so remove it.
if (MSVC)
@@ -79,83 +82,80 @@ endif ()
# break into groups (from the config/gnu-flags file)
#-----------------------------------------------------------------------------
if (NOT MSVC AND CMAKE_COMPILER_IS_GNUCC)
- if (NOT ${CMAKE_SYSTEM_NAME} MATCHES "SunOS")
- set (CMAKE_C_FLAGS_5 "${CMAKE_C_FLAGS_5} -Wcast-qual")
- set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wundef -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-align -Wwrite-strings -Wconversion -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wnested-externs")
- else ()
+ if (${CMAKE_SYSTEM_NAME} MATCHES "SunOS")
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -erroff=%none -DBSD_COMP")
+ else ()
+ # General flags
+ #
+ # Note that some of the flags listed here really should be developer
+ # flags (listed in a separate variable, below) but we put them here
+ # because they are not raised by the current code and we'd like to
+ # know if they do start showing up.
+ #
+ # NOTE: Don't add -Wpadded here since we can't/won't fix the (many)
+ # warnings that are emitted. If you need it, add it at configure time.
+ if (CMAKE_C_COMPILER_ID STREQUAL "Intel")
+ set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wcheck -Wall")
+ set (H5_CFLAGS0 "${H5_CFLAGS0} -Wcomment -Wdeprecated -Wmain -Wmissing-declarations -Wmissing-prototypes -Wp64 -Wpointer-arith")
+ set (H5_CFLAGS0 "${H5_CFLAGS0} -Wreturn-type -Wstrict-prototypes -Wuninitialized")
+ set (H5_CFLAGS0 "${H5_CFLAGS0} -Wunknown-pragmas -Wunused-function -Wunused-variable")
+ # this is just a failsafe
+ set (H5_CFLAGS0 "${H5_CFLAGS0} -finline-functions")
+ if(NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 18.0)
+ set (H5_CFLAGS0 "${H5_CFLAGS0} -Wextra-tokens -Wformat -Wformat-security -Wic-pointer -Wshadow")
+ set (H5_CFLAGS0 "${H5_CFLAGS0} -Wsign-compare -Wtrigraphs -Wwrite-strings")
+ endif()
+ elseif (CMAKE_C_COMPILER_ID STREQUAL "GNU")
+ set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pedantic -Wall -Wextra")
+ set (H5_CFLAGS0 "${H5_CFLAGS0} -Wbad-function-cast -Wc++-compat -Wcast-align")
+ set (H5_CFLAGS0 "${H5_CFLAGS0} -Wcast-qual -Wconversion -Wdeclaration-after-statement -Wdisabled-optimization -Wfloat-equal")
+ set (H5_CFLAGS0 "${H5_CFLAGS0} -Wformat=2 -Winit-self -Winvalid-pch -Wmissing-declarations -Wmissing-include-dirs")
+ set (H5_CFLAGS0 "${H5_CFLAGS0} -Wmissing-prototypes -Wnested-externs -Wold-style-definition -Wpacked -Wpointer-arith")
+ set (H5_CFLAGS0 "${H5_CFLAGS0} -Wredundant-decls -Wshadow -Wstrict-prototypes -Wswitch-default -Wswitch-enum")
+ set (H5_CFLAGS0 "${H5_CFLAGS0} -Wundef -Wunused-macros -Wunsafe-loop-optimizations -Wwrite-strings")
+ # gcc automatically inlines based on the optimization level
+ # this is just a failsafe
+ set (H5_CFLAGS0 "${H5_CFLAGS0} -finline-functions")
+ endif ()
endif ()
#-----------------------------------------------------------------------------
# Option to allow the user to enable developer warnings
+ # Developer warnings (suggestions from gcc, not code problems)
#-----------------------------------------------------------------------------
option (HDF5_ENABLE_DEV_WARNINGS "Enable HDF5 developer group warnings" OFF)
if (HDF5_ENABLE_DEV_WARNINGS)
- set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Winline -Waggregate-return")
+ message (STATUS "....HDF5 developer group warnings are enabled")
+ if (CMAKE_C_COMPILER_ID STREQUAL "Intel")
+ set (H5_CFLAGS0 "${H5_CFLAGS0} -Winline -Wreorder -Wport -Wstrict-aliasing")
+ elseif (CMAKE_C_COMPILER_ID STREQUAL "GNU")
+ set (H5_CFLAGS0 "${H5_CFLAGS0} -Winline -Waggregate-return -Wmissing-format-attribute -Wmissing-noreturn")
+ endif ()
else ()
- set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unused-parameter -Wno-inline -Wno-aggregate-return")
+ if (CMAKE_C_COMPILER_ID STREQUAL "GNU")
+ set (H5_CFLAGS0 "${H5_CFLAGS0} -Wno-inline -Wno-aggregate-return -Wno-missing-format-attribute -Wno-missing-noreturn")
+ endif ()
endif ()
- # Append warning flags
- # Don't use the '-Wtraditional' flag, we're way past having K&R C code
- # set (H5_CFLAGS "${H5_CFLAGS} -Wtraditional")
- # Don't use the '-Wtraditional-conversion' flag, there's too many warnings
- # from GCC's assert macro
- # set (H5_CFLAGS "${H5_CFLAGS} -Wtraditional-conversion")
- # Append warning flags from gcc-3* case
- # (don't use -Wpadded flag for normal builds, many of the warnings its
- # issuing can't be fixed and they are making it hard to detect other,
- # more important warnings)
- #set (H5_CFLAGS "${H5_CFLAGS} -Wfloat-equal -Wmissing-format-attribute -Wpadded")
- set (H5_CFLAGS1 "${H5_CFLAGS1} -Wfloat-equal -Wmissing-format-attribute")
+ if (CMAKE_C_COMPILER_ID STREQUAL "GNU")
+ # Append warning flags that only gcc 4.3+ knows about
+ #
+ # Technically, variable-length arrays are part of the C99 standard, but
+ # we should approach them a bit cautiously... -QAK
+ set (H5_CFLAGS1 "${H5_CFLAGS1} -Wlogical-op -Wlarger-than=2048 -Wvla")
- # Append warning flags from gcc-3.2* case
- set (H5_CFLAGS1 "${H5_CFLAGS1} -Wpacked -Wdisabled-optimization")
- if (HDF5_ENABLE_DEV_WARNINGS)
- set (H5_CFLAGS1 "${H5_CFLAGS1} -Wmissing-noreturn")
- else ()
- set (H5_CFLAGS1 "${H5_CFLAGS1} -Wno-missing-noreturn")
+ # Append more extra warning flags that only gcc 4.4+ know about
+ set (H5_CFLAGS1 "${H5_CFLAGS1} -Wsync-nand -Wframe-larger-than=16384 -Wpacked-bitfield-compat")
endif ()
- # Enable more format checking flags, beyond the basic -Wformat included
- # in -Wall
- set (H5_CFLAGS1_5 "${H5_CFLAGS1_5} -Wformat=2")
-
- # Append warning flags from gcc-3.3* case
- set (H5_CFLAGS1 "${H5_CFLAGS1} -Wendif-labels")
-
- # Append warning flags from gcc-3.4* case
- set (H5_CFLAGS1 "${H5_CFLAGS1} -Wdeclaration-after-statement -Wold-style-definition -Winvalid-pch")
-
- # Append more extra warning flags that only gcc4.0+ know about
- set (H5_CFLAGS2 "${H5_CFLAGS2} -Wvariadic-macros -Winit-self -Wmissing-include-dirs -Wswitch-default -Wswitch-enum -Wunused-macros")
-
- # Append more extra warning flags that only gcc 4.1+ know about
- set (H5_CFLAGS2_5 "${H5_CFLAGS2_5} -Wunsafe-loop-optimizations")
- set (H5_CFLAGS2 "${H5_CFLAGS2} -Wc++-compat")
-
- # Append more extra warning flags that only gcc 4.2+ know about
- set (H5_CFLAGS2_5 "${H5_CFLAGS2_5} -Wstrict-overflow")
- set (H5_CFLAGS2 "${H5_CFLAGS2} -Wno-strict-overflow")
-
- # Append more extra warning flags that only gcc 4.3+ know about
- #
- # Technically, variable-length arrays are part of the C99 standard, but
- # we should approach them a bit cautiously... -QAK
- set (H5_CFLAGS2 "${H5_CFLAGS2} -Wlogical-op -Wlarger-than=2048 -Wvla")
-
- # Append more extra warning flags that only gcc 4.4+ know about
- set (H5_CFLAGS2 "${H5_CFLAGS2} -Wsync-nand -Wframe-larger-than=16384 -Wpacked-bitfield-compat")
-
# Append more extra warning flags that only gcc 4.5+ know about
- if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.5)
- set (H5_CFLAGS2_5 "${H5_CFLAGS2_5} -Wstrict-overflow=5 -Wjump-misses-init -Wunsuffixed-float-constants")
- set (H5_CFLAGS2 "${H5_CFLAGS2} -Wjump-misses-init -Wunsuffixed-float-constants")
+ if (CMAKE_C_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.5)
+ set (H5_CFLAGS1 "${H5_CFLAGS1} -Wstrict-overflow=5 -Wjump-misses-init -Wunsuffixed-float-constants")
endif ()
# Append more extra warning flags that only gcc 4.6+ know about
- if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.6)
+ if (CMAKE_C_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.6)
set (H5_CFLAGS2 "${H5_CFLAGS2} -Wdouble-promotion -Wtrampolines")
if (HDF5_ENABLE_DEV_WARNINGS)
set (H5_CFLAGS2 "${H5_CFLAGS2} -Wsuggest-attribute=const")
@@ -164,14 +164,8 @@ if (NOT MSVC AND CMAKE_COMPILER_IS_GNUCC)
endif ()
endif ()
- # The "unreachable code" warning appears to be reliable now...
- # (this warning was removed in gcc 4.5+)
- if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.7)
- set (H5_CFLAGS2 "${H5_CFLAGS2} -Wunreachable-code")
- endif ()
-
# Append more extra warning flags that only gcc 4.7+ know about
- if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.7)
+ if (CMAKE_C_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.7)
set (H5_CFLAGS2 "${H5_CFLAGS2} -Wstack-usage=8192 -Wvector-operation-performance")
if (HDF5_ENABLE_DEV_WARNINGS)
set (H5_CFLAGS2 "${H5_CFLAGS2} -Wsuggest-attribute=pure -Wsuggest-attribute=noreturn")
@@ -181,7 +175,7 @@ if (NOT MSVC AND CMAKE_COMPILER_IS_GNUCC)
endif ()
# Append more extra warning flags that only gcc 4.8+ know about
- if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.8)
+ if (CMAKE_C_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.8)
if (HDF5_ENABLE_DEV_WARNINGS)
set (H5_CFLAGS2 "${H5_CFLAGS2} -Wsuggest-attribute=format")
else ()
@@ -190,19 +184,17 @@ if (NOT MSVC AND CMAKE_COMPILER_IS_GNUCC)
endif ()
# Append more extra warning flags that only gcc 4.9+ know about
- if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.9)
- set (H5_CFLAGS2 "${H5_CFLAGS2} -Wdate-time -Wopenmp-simd")
+ if (CMAKE_C_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.9)
+ set (H5_CFLAGS2 "${H5_CFLAGS2} -Wdate-time")
endif ()
- # (There was no release of gcc 5.0)
-
# Append more extra warning flags that only gcc 5.1+ know about
- if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 5.1)
+ if (CMAKE_C_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 5.1)
set (H5_CFLAGS3 "${H5_CFLAGS3} -Warray-bounds=2 -Wc99-c11-compat")
endif ()
# Append more extra warning flags that only gcc 6.x+ know about
- if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 6.0)
+ if (CMAKE_C_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 6.0)
set (H5_CFLAGS4 "${H5_CFLAGS4} -Wnull-dereference -Wunused-const-variable -Wduplicated-cond -Whsa")
endif ()
@@ -213,6 +205,7 @@ endif ()
#-----------------------------------------------------------------------------
option (HDF5_ENABLE_ALL_WARNINGS "Enable all warnings" OFF)
if (HDF5_ENABLE_ALL_WARNINGS)
+ message (STATUS "....All Warnings are enabled")
if (MSVC)
if (HDF5_ENABLE_DEV_WARNINGS)
string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
@@ -231,7 +224,7 @@ if (HDF5_ENABLE_ALL_WARNINGS)
endif ()
else ()
if (CMAKE_COMPILER_IS_GNUCC)
- set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -pedantic ${H5_CFLAGS1} ${H5_CFLAGS2}")
+ set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${H5_CFLAGS0} ${H5_CFLAGS1} ${H5_CFLAGS2}")
endif ()
endif ()
endif ()
@@ -241,6 +234,7 @@ endif ()
#-----------------------------------------------------------------------------
option (HDF5_ENABLE_GROUPZERO_WARNINGS "Enable group zero warnings" OFF)
if (HDF5_ENABLE_GROUPZERO_WARNINGS)
+ message (STATUS "....Group Zero warnings are enabled")
if (MSVC)
string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W1")
@@ -250,7 +244,7 @@ if (HDF5_ENABLE_GROUPZERO_WARNINGS)
endif ()
else ()
if (CMAKE_COMPILER_IS_GNUCC)
- set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -pedantic")
+ set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${H5_CFLAGS0}")
endif ()
endif ()
endif ()
@@ -260,6 +254,7 @@ endif ()
#-----------------------------------------------------------------------------
option (HDF5_ENABLE_GROUPONE_WARNINGS "Enable group one warnings" OFF)
if (HDF5_ENABLE_GROUPONE_WARNINGS)
+ message (STATUS "....Group One warnings are enabled")
if (MSVC)
string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W2")
@@ -277,6 +272,7 @@ endif ()
#-----------------------------------------------------------------------------
option (HDF5_ENABLE_GROUPTWO_WARNINGS "Enable group two warnings" OFF)
if (HDF5_ENABLE_GROUPTWO_WARNINGS)
+ message (STATUS "....Group Two warnings are enabled")
if (MSVC)
string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W3")
@@ -294,6 +290,7 @@ endif ()
#-----------------------------------------------------------------------------
option (HDF5_ENABLE_GROUPTHREE_WARNINGS "Enable group three warnings" OFF)
if (HDF5_ENABLE_GROUPTHREE_WARNINGS)
+ message (STATUS "....Group Three warnings are enabled")
if (MSVC)
string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W4")
@@ -311,6 +308,7 @@ endif ()
#-----------------------------------------------------------------------------
option (HDF5_ENABLE_GROUPFOUR_WARNINGS "Enable group four warnings" OFF)
if (HDF5_ENABLE_GROUPFOUR_WARNINGS)
+ message (STATUS "....Group Four warnings are enabled")
if (NOT MSVC)
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${H5_CFLAGS4}")
endif ()
diff --git a/config/cmake/scripts/HDF5config.cmake b/config/cmake/scripts/HDF5config.cmake
index 067e753..b6c8f56 100755
--- a/config/cmake/scripts/HDF5config.cmake
+++ b/config/cmake/scripts/HDF5config.cmake
@@ -34,7 +34,7 @@ cmake_minimum_required (VERSION 3.10)
# CTEST_SOURCE_NAME - source folder
##############################################################################
-set (CTEST_SOURCE_VERSION "1.10.3")
+set (CTEST_SOURCE_VERSION "1.10.4")
set (CTEST_SOURCE_VERSEXT "")
##############################################################################
@@ -184,7 +184,7 @@ set (MODEL "Experimental")
##### Following controls source update #####
#set (LOCAL_UPDATE "TRUE")
set (REPOSITORY_URL "https://git@bitbucket.hdfgroup.org/scm/hdffv/hdf5.git")
-set (REPOSITORY_BRANCH "hdf5_1_10_3")
+set (REPOSITORY_BRANCH "hdf5_1_10_4")
#uncomment to use a compressed source file: *.tar on linux or mac *.zip on windows
#set(CTEST_USE_TAR_SOURCE "${CTEST_SOURCE_VERSION}")
diff --git a/config/cmake/scripts/HDF5options.cmake b/config/cmake/scripts/HDF5options.cmake
index c5f08ed..80a28d3 100755
--- a/config/cmake/scripts/HDF5options.cmake
+++ b/config/cmake/scripts/HDF5options.cmake
@@ -67,6 +67,23 @@ set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ALLOW_EXTERNAL_SUPPORT:STRING
#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_PACK_EXAMPLES:BOOL=ON -DHDF5_EXAMPLES_COMPRESSED:STRING=HDF5Examples-1.10.9-Source.tar.gz -DHDF5_EXAMPLES_COMPRESSED_DIR:PATH=${CTEST_SCRIPT_DIRECTORY}")
#############################################################################################
+### enable parallel builds
+
+#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_PARALLEL:BOOL=ON")
+#set(ADD_BUILD_OPTIONS “${ADD_BUILD_OPTIONS} -DHDF5_BUILD_CPP_LIB:BOOL=OFF”)
+#set(ADD_BUILD_OPTIONS “${ADD_BUILD_OPTIONS} -DHDF5_BUILD_JAVA:BOOL=OFF”)
+#set(ADD_BUILD_OPTIONS “${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_THREADSAFE:BOOL=OFF”)
+
+#############################################################################################
+### enable thread-safety builds
+
+#set(ADD_BUILD_OPTIONS “${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_THREADSAFE:BOOL=ON”)
+#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_PARALLEL:BOOL=OFF")
+#set(ADD_BUILD_OPTIONS “${ADD_BUILD_OPTIONS} -DHDF5_BUILD_CPP_LIB:BOOL=OFF”)
+#set(ADD_BUILD_OPTIONS “${ADD_BUILD_OPTIONS} -DHDF5_BUILD_FORTRAN:BOOL=OFF”)
+#set(ADD_BUILD_OPTIONS “${ADD_BUILD_OPTIONS} -DHDF5_BUILD_HL_LIB:BOOL=OFF”)
+
+#############################################################################################
### disable test program builds
#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DBUILD_TESTING:BOOL=OFF")
@@ -79,3 +96,8 @@ set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ALLOW_EXTERNAL_SUPPORT:STRING
set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_PACKAGE_EXTLIBS:BOOL=ON")
#############################################################################################
+### use a toolchain file
+
+#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DCMAKE_TOOLCHAIN_FILE:STRING=config/intel.cmake")
+
+#############################################################################################
diff --git a/config/cmake_ext_mod/ConfigureChecks.cmake b/config/cmake_ext_mod/ConfigureChecks.cmake
index 9be30f7..4204511 100644
--- a/config/cmake_ext_mod/ConfigureChecks.cmake
+++ b/config/cmake_ext_mod/ConfigureChecks.cmake
@@ -142,10 +142,6 @@ endif ()
macro (HDF_FUNCTION_TEST 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)
- set (OTHER_TEST_ADD_LIBRARIES "-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}")
- endif ()
foreach (def
HAVE_SYS_TIME_H
@@ -168,8 +164,8 @@ macro (HDF_FUNCTION_TEST OTHER_TEST)
TRY_COMPILE (${OTHER_TEST}
${CMAKE_BINARY_DIR}
${HDF_RESOURCES_EXT_DIR}/HDFTests.c
- CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_FUNCTION_DEFINITIONS}
- "${OTHER_TEST_ADD_LIBRARIES}"
+ COMPILE_DEFINITIONS "${MACRO_CHECK_FUNCTION_DEFINITIONS}"
+ LINK_LIBRARIES "${CMAKE_REQUIRED_LIBRARIES}"
OUTPUT_VARIABLE OUTPUT
)
if (${OTHER_TEST})
@@ -282,8 +278,7 @@ if (NOT WINDOWS)
TRY_RUN (TEST_LFS_WORKS_RUN TEST_LFS_WORKS_COMPILE
${CMAKE_BINARY_DIR}
${HDF_RESOURCES_EXT_DIR}/HDFTests.c
- CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=-DTEST_LFS_WORKS
- OUTPUT_VARIABLE OUTPUT
+ COMPILE_DEFINITIONS "-DTEST_LFS_WORKS"
)
# The LARGEFILE definitions were from the transition period
@@ -300,14 +295,14 @@ if (NOT WINDOWS)
set (TEST_LFS_WORKS "" CACHE INTERNAL ${msg})
message (STATUS "${msg}... no")
file (APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
- "Test TEST_LFS_WORKS Run failed with the following output and exit code:\n ${OUTPUT}\n"
+ "Test TEST_LFS_WORKS Run failed with the following exit code:\n ${TEST_LFS_WORKS_RUN}\n"
)
endif ()
else ()
set (TEST_LFS_WORKS "" CACHE INTERNAL ${msg})
message (STATUS "${msg}... no")
file (APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
- "Test TEST_LFS_WORKS Compile failed with the following output:\n ${OUTPUT}\n"
+ "Test TEST_LFS_WORKS Compile failed\n"
)
endif ()
endif ()
@@ -574,30 +569,21 @@ if (WINDOWS)
"${CURRENT_TEST_DEFINITIONS} -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE"
)
endif ()
- set (MACRO_CHECK_FUNCTION_DEFINITIONS
- "-DHAVE_IOEO ${CMAKE_REQUIRED_FLAGS}")
- if (CMAKE_REQUIRED_LIBRARIES)
- set (CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES
- "-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}")
- else ()
- set (CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES)
- endif ()
+ set (MACRO_CHECK_FUNCTION_DEFINITIONS "-DHAVE_IOEO ${CMAKE_REQUIRED_FLAGS}")
if (CMAKE_REQUIRED_INCLUDES)
- set (CHECK_C_SOURCE_COMPILES_ADD_INCLUDES
- "-DINCLUDE_DIRECTORIES:STRING=${CMAKE_REQUIRED_INCLUDES}")
+ set (CHECK_C_SOURCE_COMPILES_ADD_INCLUDES "-DINCLUDE_DIRECTORIES:STRING=${CMAKE_REQUIRED_INCLUDES}")
else ()
set (CHECK_C_SOURCE_COMPILES_ADD_INCLUDES)
endif ()
TRY_RUN(HAVE_IOEO_EXITCODE HAVE_IOEO_COMPILED
- ${CMAKE_BINARY_DIR}
- ${HDF_RESOURCES_EXT_DIR}/HDFTests.c
- COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS}
- CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_FUNCTION_DEFINITIONS}
- -DCMAKE_SKIP_RPATH:BOOL=${CMAKE_SKIP_RPATH}
- "${CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES}"
- "${CHECK_C_SOURCE_COMPILES_ADD_INCLUDES}"
- COMPILE_OUTPUT_VARIABLE OUTPUT)
+ ${CMAKE_BINARY_DIR}
+ ${HDF_RESOURCES_EXT_DIR}/HDFTests.c
+ COMPILE_DEFINITIONS "${CMAKE_REQUIRED_DEFINITIONS} ${MACRO_CHECK_FUNCTION_DEFINITIONS}"
+ LINK_LIBRARIES "${CMAKE_REQUIRED_LIBRARIES}"
+ CMAKE_FLAGS "${CHECK_C_SOURCE_COMPILES_ADD_INCLUDES} -DCMAKE_SKIP_RPATH:BOOL=${CMAKE_SKIP_RPATH}"
+ COMPILE_OUTPUT_VARIABLE OUTPUT
+ )
# if it did not compile make the return value fail code of 1
if (NOT HAVE_IOEO_COMPILED)
set (HAVE_IOEO_EXITCODE 1)
@@ -648,8 +634,8 @@ if (NOT ${HDF_PREFIX}_PRINTF_LL_WIDTH OR ${HDF_PREFIX}_PRINTF_LL_WIDTH MATCHES "
TRY_RUN (${HDF_PREFIX}_PRINTF_LL_TEST_RUN ${HDF_PREFIX}_PRINTF_LL_TEST_COMPILE
${CMAKE_BINARY_DIR}
${HDF_RESOURCES_EXT_DIR}/HDFTests.c
- CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${CURRENT_TEST_DEFINITIONS}
- OUTPUT_VARIABLE OUTPUT
+ COMPILE_DEFINITIONS "${CURRENT_TEST_DEFINITIONS}"
+ RUN_OUTPUT_VARIABLE OUTPUT
)
if (${HDF_PREFIX}_PRINTF_LL_TEST_COMPILE)
if (${HDF_PREFIX}_PRINTF_LL_TEST_RUN MATCHES 0)
@@ -661,7 +647,7 @@ if (NOT ${HDF_PREFIX}_PRINTF_LL_WIDTH OR ${HDF_PREFIX}_PRINTF_LL_WIDTH MATCHES "
endif ()
else ()
file (APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log
- "Test ${HDF_PREFIX}_PRINTF_LL_WIDTH failed with the following output:\n ${OUTPUT}\n"
+ "Test ${HDF_PREFIX}_PRINTF_LL_WIDTH failed\n"
)
endif ()
diff --git a/config/cmake_ext_mod/HDFLibMacros.cmake b/config/cmake_ext_mod/HDFLibMacros.cmake
index 54e408b..8a37af3 100644
--- a/config/cmake_ext_mod/HDFLibMacros.cmake
+++ b/config/cmake_ext_mod/HDFLibMacros.cmake
@@ -30,6 +30,7 @@ macro (EXTERNAL_JPEG_LIBRARY compress_type jpeg_pic)
-DCMAKE_ARCHIVE_OUTPUT_DIRECTORY:PATH=${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}
-DCMAKE_PDB_OUTPUT_DIRECTORY:PATH=${CMAKE_PDB_OUTPUT_DIRECTORY}
-DCMAKE_ANSI_CFLAGS:STRING=${jpeg_pic}
+ -DCMAKE_TOOLCHAIN_FILE:STRING=${CMAKE_TOOLCHAIN_FILE}
)
elseif (${compress_type} MATCHES "GIT")
EXTERNALPROJECT_ADD (JPEG
@@ -47,6 +48,7 @@ macro (EXTERNAL_JPEG_LIBRARY compress_type jpeg_pic)
-DCMAKE_ARCHIVE_OUTPUT_DIRECTORY:PATH=${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}
-DCMAKE_PDB_OUTPUT_DIRECTORY:PATH=${CMAKE_PDB_OUTPUT_DIRECTORY}
-DCMAKE_ANSI_CFLAGS:STRING=${jpeg_pic}
+ -DCMAKE_TOOLCHAIN_FILE:STRING=${CMAKE_TOOLCHAIN_FILE}
)
elseif (${compress_type} MATCHES "TGZ")
EXTERNALPROJECT_ADD (JPEG
@@ -64,6 +66,7 @@ macro (EXTERNAL_JPEG_LIBRARY compress_type jpeg_pic)
-DCMAKE_ARCHIVE_OUTPUT_DIRECTORY:PATH=${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}
-DCMAKE_PDB_OUTPUT_DIRECTORY:PATH=${CMAKE_PDB_OUTPUT_DIRECTORY}
-DCMAKE_ANSI_CFLAGS:STRING=${jpeg_pic}
+ -DCMAKE_TOOLCHAIN_FILE:STRING=${CMAKE_TOOLCHAIN_FILE}
)
endif ()
externalproject_get_property (JPEG BINARY_DIR SOURCE_DIR)
@@ -121,6 +124,7 @@ macro (EXTERNAL_SZIP_LIBRARY compress_type encoding)
-DCMAKE_PDB_OUTPUT_DIRECTORY:PATH=${CMAKE_PDB_OUTPUT_DIRECTORY}
-DCMAKE_ANSI_CFLAGS:STRING=${CMAKE_ANSI_CFLAGS}
-DSZIP_ENABLE_ENCODING:BOOL=${encoding}
+ -DCMAKE_TOOLCHAIN_FILE:STRING=${CMAKE_TOOLCHAIN_FILE}
)
elseif (${compress_type} MATCHES "GIT")
EXTERNALPROJECT_ADD (SZIP
@@ -139,6 +143,7 @@ macro (EXTERNAL_SZIP_LIBRARY compress_type encoding)
-DCMAKE_PDB_OUTPUT_DIRECTORY:PATH=${CMAKE_PDB_OUTPUT_DIRECTORY}
-DCMAKE_ANSI_CFLAGS:STRING=${CMAKE_ANSI_CFLAGS}
-DSZIP_ENABLE_ENCODING:BOOL=${encoding}
+ -DCMAKE_TOOLCHAIN_FILE:STRING=${CMAKE_TOOLCHAIN_FILE}
)
elseif (${compress_type} MATCHES "TGZ")
EXTERNALPROJECT_ADD (SZIP
@@ -157,6 +162,7 @@ macro (EXTERNAL_SZIP_LIBRARY compress_type encoding)
-DCMAKE_PDB_OUTPUT_DIRECTORY:PATH=${CMAKE_PDB_OUTPUT_DIRECTORY}
-DCMAKE_ANSI_CFLAGS:STRING=${CMAKE_ANSI_CFLAGS}
-DSZIP_ENABLE_ENCODING:BOOL=${encoding}
+ -DCMAKE_TOOLCHAIN_FILE:STRING=${CMAKE_TOOLCHAIN_FILE}
)
endif ()
externalproject_get_property (SZIP BINARY_DIR SOURCE_DIR)
@@ -213,6 +219,7 @@ macro (EXTERNAL_ZLIB_LIBRARY compress_type)
-DCMAKE_ARCHIVE_OUTPUT_DIRECTORY:PATH=${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}
-DCMAKE_PDB_OUTPUT_DIRECTORY:PATH=${CMAKE_PDB_OUTPUT_DIRECTORY}
-DCMAKE_ANSI_CFLAGS:STRING=${CMAKE_ANSI_CFLAGS}
+ -DCMAKE_TOOLCHAIN_FILE:STRING=${CMAKE_TOOLCHAIN_FILE}
)
elseif (${compress_type} MATCHES "GIT")
EXTERNALPROJECT_ADD (ZLIB
@@ -230,6 +237,7 @@ macro (EXTERNAL_ZLIB_LIBRARY compress_type)
-DCMAKE_ARCHIVE_OUTPUT_DIRECTORY:PATH=${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}
-DCMAKE_PDB_OUTPUT_DIRECTORY:PATH=${CMAKE_PDB_OUTPUT_DIRECTORY}
-DCMAKE_ANSI_CFLAGS:STRING=${CMAKE_ANSI_CFLAGS}
+ -DCMAKE_TOOLCHAIN_FILE:STRING=${CMAKE_TOOLCHAIN_FILE}
)
elseif (${compress_type} MATCHES "TGZ")
EXTERNALPROJECT_ADD (ZLIB
@@ -247,6 +255,7 @@ macro (EXTERNAL_ZLIB_LIBRARY compress_type)
-DCMAKE_ARCHIVE_OUTPUT_DIRECTORY:PATH=${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}
-DCMAKE_PDB_OUTPUT_DIRECTORY:PATH=${CMAKE_PDB_OUTPUT_DIRECTORY}
-DCMAKE_ANSI_CFLAGS:STRING=${CMAKE_ANSI_CFLAGS}
+ -DCMAKE_TOOLCHAIN_FILE:STRING=${CMAKE_TOOLCHAIN_FILE}
)
endif ()
externalproject_get_property (ZLIB BINARY_DIR SOURCE_DIR)
diff --git a/config/cmake_ext_mod/HDFMacros.cmake b/config/cmake_ext_mod/HDFMacros.cmake
index 791fe2e..147ae2f 100644
--- a/config/cmake_ext_mod/HDFMacros.cmake
+++ b/config/cmake_ext_mod/HDFMacros.cmake
@@ -280,7 +280,7 @@ macro (HDF_README_PROPERTIES target_fortran)
endif ()
elseif (APPLE)
set (BINARY_EXAMPLE_ENDING "tar.gz")
- set (BINARY_INSTALL_ENDING "dmg")
+ set (BINARY_INSTALL_ENDING "sh") # if packaging changes - use dmg
set (BINARY_PLATFORM "${BINARY_PLATFORM} ${CMAKE_SYSTEM_VERSION} ${CMAKE_SYSTEM_PROCESSOR}")
set (BINARY_PLATFORM "${BINARY_PLATFORM}, using ${CMAKE_C_COMPILER_ID} C ${CMAKE_C_COMPILER_VERSION}")
else ()
@@ -358,6 +358,21 @@ macro (HDF_DIR_PATHS package_prefix)
endif ()
endif ()
+ set (CMAKE_SKIP_BUILD_RPATH FALSE)
+ set (CMAKE_INSTALL_RPATH_USE_LINK_PATH FALSE)
+ set (CMAKE_BUILD_WITH_INSTALL_RPATH ON)
+ if (APPLE)
+ set (CMAKE_INSTALL_NAME_DIR "@rpath")
+ set (CMAKE_INSTALL_RPATH
+ "@executable_path/../${${package_prefix}_INSTALL_LIB_DIR}"
+ "@executable_path/"
+ "@loader_path/../${${package_prefix}_INSTALL_LIB_DIR}"
+ "@loader_path/"
+ )
+ else ()
+ set (CMAKE_INSTALL_RPATH "\$ORIGIN/../${${package_prefix}_INSTALL_LIB_DIR}:\$ORIGIN/")
+ 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 ()
@@ -380,13 +395,14 @@ macro (HDF_DIR_PATHS package_prefix)
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})
+ get_property(_isMultiConfig GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
+ if(_isMultiConfig)
+ set (CMAKE_TEST_OUTPUT_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_BUILD_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})
+ set (CMAKE_TEST_OUTPUT_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
endif ()
else ()
# if we are externally configured, but the project uses old cmake scripts
diff --git a/config/intel.cmake b/config/intel.cmake
new file mode 100644
index 0000000..f1a5734
--- /dev/null
+++ b/config/intel.cmake
@@ -0,0 +1,10 @@
+# Uncomment the following to use cross-compiling
+#set(CMAKE_SYSTEM_NAME Linux)
+set(CMAKE_COMPILER_VENDOR "intel")
+
+set(CMAKE_C_COMPILER icc)
+set(CMAKE_CXX_COMPILER icpc)
+set(CMAKE_Fortran_COMPILER ifort)
+
+# the following is used if cross-compiling
+set(CMAKE_CROSSCOMPILING_EMULATOR "")
diff --git a/configure b/configure
index e767bc9..23c268b 100755
--- a/configure
+++ b/configure
@@ -1,7 +1,7 @@
#! /bin/sh
# From configure.ac Id: configure.ac 22697 2012-08-19 14:35:47Z hdftest .
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for HDF5 1.10.3.
+# Generated by GNU Autoconf 2.69 for HDF5 1.10.4.
#
# Report bugs to <help@hdfgroup.org>.
#
@@ -591,8 +591,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='HDF5'
PACKAGE_TARNAME='hdf5'
-PACKAGE_VERSION='1.10.3'
-PACKAGE_STRING='HDF5 1.10.3'
+PACKAGE_VERSION='1.10.4'
+PACKAGE_STRING='HDF5 1.10.4'
PACKAGE_BUGREPORT='help@hdfgroup.org'
PACKAGE_URL=''
@@ -1529,7 +1529,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures HDF5 1.10.3 to adapt to many kinds of systems.
+\`configure' configures HDF5 1.10.4 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1599,7 +1599,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of HDF5 1.10.3:";;
+ short | recursive ) echo "Configuration of HDF5 1.10.4:";;
esac
cat <<\_ACEOF
@@ -1856,7 +1856,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-HDF5 configure 1.10.3
+HDF5 configure 1.10.4
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
@@ -2771,7 +2771,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by HDF5 $as_me 1.10.3, which was
+It was created by HDF5 $as_me 1.10.4, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
@@ -3643,7 +3643,7 @@ fi
# Define the identity of the package.
PACKAGE='hdf5'
- VERSION='1.10.3'
+ VERSION='1.10.4'
cat >>confdefs.h <<_ACEOF
@@ -31332,7 +31332,7 @@ Usage: $0 [OPTIONS]
Report bugs to <bug-libtool@gnu.org>."
lt_cl_version="\
-HDF5 config.lt 1.10.3
+HDF5 config.lt 1.10.4
configured by $0, generated by GNU Autoconf 2.69.
Copyright (C) 2011 Free Software Foundation, Inc.
@@ -33380,7 +33380,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by HDF5 $as_me 1.10.3, which was
+This file was extended by HDF5 $as_me 1.10.4, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -33446,7 +33446,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
-HDF5 config.status 1.10.3
+HDF5 config.status 1.10.4
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
diff --git a/configure.ac b/configure.ac
index c3e6aee..3f06676 100644
--- a/configure.ac
+++ b/configure.ac
@@ -24,7 +24,7 @@ AC_PREREQ([2.69])
## NOTE: Do not forget to change the version number here when we do a
## release!!!
##
-AC_INIT([HDF5], [1.10.3], [help@hdfgroup.org])
+AC_INIT([HDF5], [1.10.4], [help@hdfgroup.org])
AC_CONFIG_SRCDIR([src/H5.c])
AC_CONFIG_HEADERS([src/H5config.h])
diff --git a/examples/run-c-ex.sh.in b/examples/run-c-ex.sh.in
index 4d5d594..209cdd7 100644
--- a/examples/run-c-ex.sh.in
+++ b/examples/run-c-ex.sh.in
@@ -31,7 +31,7 @@ EXIT_FAILURE=1
# Where the tool is installed.
# default is relative path to installed location of the tools
-prefix="${prefix:-@prefix@}"
+prefix="${prefix:-../../..}"
PARALLEL=@PARALLEL@ # Am I in parallel mode?
AR="@AR@"
RANLIB="@RANLIB@"
diff --git a/fortran/examples/run-fortran-ex.sh.in b/fortran/examples/run-fortran-ex.sh.in
index cace1ae..da0c357 100644
--- a/fortran/examples/run-fortran-ex.sh.in
+++ b/fortran/examples/run-fortran-ex.sh.in
@@ -32,7 +32,7 @@ EXIT_FAILURE=1
# Where the tool is installed.
# default is relative path to installed location of the tools
-prefix="${prefix:-@prefix@}"
+prefix="${prefix:-../../..}"
PARALLEL=@PARALLEL@ # Am I in parallel mode?
AR="@AR@"
RANLIB="@RANLIB@"
diff --git a/fortran/src/H5config_f.inc.cmake b/fortran/src/H5config_f.inc.cmake
index b8d5355..aa3d135 100644
--- a/fortran/src/H5config_f.inc.cmake
+++ b/fortran/src/H5config_f.inc.cmake
@@ -12,16 +12,19 @@
! fortran/src/H5config_f.inc. Generated from fortran/src/H5config_f.inc.in by configure
! Define if we have parallel support
-#cmakedefine H5_HAVE_PARALLEL @H5_HAVE_PARALLEL@
+#cmakedefine01 H5_HAVE_PARALLEL @H5_HAVE_PARALLEL@
+#if H5_HAVE_PARALLEL == 0
+#undef H5_HAVE_PARALLEL
+#endif
! Define if the intrinsic function STORAGE_SIZE exists
-#cmakedefine H5_FORTRAN_HAVE_STORAGE_SIZE @H5_FORTRAN_HAVE_STORAGE_SIZE@
+#define H5_FORTRAN_HAVE_STORAGE_SIZE @H5_FORTRAN_HAVE_STORAGE_SIZE@
! Define if the intrinsic function SIZEOF exists
-#cmakedefine H5_FORTRAN_HAVE_SIZEOF @H5_FORTRAN_HAVE_SIZEOF@
+#define H5_FORTRAN_HAVE_SIZEOF @H5_FORTRAN_HAVE_SIZEOF@
! Define if the intrinsic function C_SIZEOF exists
-#cmakedefine H5_FORTRAN_HAVE_C_SIZEOF @H5_FORTRAN_HAVE_C_SIZEOF@
+#define H5_FORTRAN_HAVE_C_SIZEOF @H5_FORTRAN_HAVE_C_SIZEOF@
! Define if the intrinsic C_LONG_DOUBLE exists
#define H5_FORTRAN_HAVE_C_LONG_DOUBLE @H5_FORTRAN_HAVE_C_LONG_DOUBLE@
@@ -30,41 +33,40 @@
#define H5_FORTRAN_C_LONG_DOUBLE_IS_UNIQUE @H5_FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@
! Define if the intrinsic module ISO_FORTRAN_ENV exists
-#cmakedefine H5_HAVE_ISO_FORTRAN_ENV @H5_HAVE_ISO_FORTRAN_ENV@
-
+#define H5_HAVE_ISO_FORTRAN_ENV @H5_HAVE_ISO_FORTRAN_ENV@
! should this be ${HDF_PREFIX} instead of H5 MSB
-#cmakedefine H5_SIZEOF_DOUBLE @H5_SIZEOF_DOUBLE@
+#define H5_SIZEOF_DOUBLE @H5_SIZEOF_DOUBLE@
! should this be ${HDF_PREFIX} instead of H5 MSB
-#cmakedefine H5_SIZEOF_LONG_DOUBLE @H5_SIZEOF_LONG_DOUBLE@
+#define H5_SIZEOF_LONG_DOUBLE @H5_SIZEOF_LONG_DOUBLE@
! Define the maximum decimal precision for reals
-#cmakedefine H5_PAC_FC_MAX_REAL_PRECISION @H5_PAC_FC_MAX_REAL_PRECISION@
+#define H5_PAC_FC_MAX_REAL_PRECISION @H5_PAC_FC_MAX_REAL_PRECISION@
! If C has quad precision
-#cmakedefine H5_HAVE_FLOAT128 @H5_HAVE_FLOAT128@
+#define H5_HAVE_FLOAT128 @H5_HAVE_FLOAT128@
! Define if INTEGER*16 is available
#define H5_HAVE_Fortran_INTEGER_SIZEOF_16 @H5_HAVE_Fortran_INTEGER_SIZEOF_16@
! Maximum decimal precision for C
-#cmakedefine H5_PAC_C_MAX_REAL_PRECISION @H5_PAC_C_MAX_REAL_PRECISION@
+#define H5_PAC_C_MAX_REAL_PRECISION @H5_PAC_C_MAX_REAL_PRECISION@
! number of valid REAL KINDs
-#cmakedefine H5_H5CONFIG_F_NUM_RKIND @H5_H5CONFIG_F_NUM_RKIND@
+#define H5_H5CONFIG_F_NUM_RKIND @H5_H5CONFIG_F_NUM_RKIND@
! valid REAL KINDs (need to have a matching C counter-part)
-#cmakedefine H5_H5CONFIG_F_RKIND @H5_H5CONFIG_F_RKIND@
+#define H5_H5CONFIG_F_RKIND @H5_H5CONFIG_F_RKIND@
! valid REAL KINDs (need to have a matching C counter-part)
-#cmakedefine H5_H5CONFIG_F_RKIND_SIZEOF @H5_H5CONFIG_F_RKIND_SIZEOF@
+#define H5_H5CONFIG_F_RKIND_SIZEOF @H5_H5CONFIG_F_RKIND_SIZEOF@
! number of valid INTEGER KINDs
-#cmakedefine H5_H5CONFIG_F_NUM_IKIND @H5_H5CONFIG_F_NUM_IKIND@
+#define H5_H5CONFIG_F_NUM_IKIND @H5_H5CONFIG_F_NUM_IKIND@
! valid INTEGER KINDs (need to have a matching C counter-part)
-#cmakedefine H5_H5CONFIG_F_IKIND @H5_H5CONFIG_F_IKIND@
+#define H5_H5CONFIG_F_IKIND @H5_H5CONFIG_F_IKIND@
! Fortran compiler id
-#cmakedefine H5_Fortran_COMPILER_ID @Fortran_COMPILER_ID@
+#define H5_Fortran_COMPILER_ID @CMAKE_Fortran_COMPILER_ID@
diff --git a/fortran/test/tH5F.F90 b/fortran/test/tH5F.F90
index 72920f2..ee386dd 100644
--- a/fortran/test/tH5F.F90
+++ b/fortran/test/tH5F.F90
@@ -30,8 +30,6 @@
! access the dataset from the second file as a member of a group
! in the first file.
-
-
MODULE TH5F
CONTAINS
diff --git a/hl/c++/examples/run-hlc++-ex.sh.in b/hl/c++/examples/run-hlc++-ex.sh.in
index 9539724..eb688a1 100644
--- a/hl/c++/examples/run-hlc++-ex.sh.in
+++ b/hl/c++/examples/run-hlc++-ex.sh.in
@@ -31,7 +31,7 @@ EXIT_SUCCESS=0
EXIT_FAILURE=1
# Where the tool is installed.
# default is relative path to installed location of the tools
-prefix="${prefix:-@prefix@}"
+prefix="${prefix:-../../../..}"
AR="@AR@"
RANLIB="@RANLIB@"
H5TOOL="h5c++" # The tool name
diff --git a/hl/examples/run-hlc-ex.sh.in b/hl/examples/run-hlc-ex.sh.in
index b12955f..f51b165 100644
--- a/hl/examples/run-hlc-ex.sh.in
+++ b/hl/examples/run-hlc-ex.sh.in
@@ -31,7 +31,7 @@ EXIT_FAILURE=1
# Where the tool is installed.
# default is relative path to installed location of the tools
-prefix="${prefix:-@prefix@}"
+prefix="${prefix:-../../../..}"
PARALLEL=@PARALLEL@ # Am I in parallel mode?
AR="@AR@"
RANLIB="@RANLIB@"
diff --git a/hl/fortran/examples/run-hlfortran-ex.sh.in b/hl/fortran/examples/run-hlfortran-ex.sh.in
index c8f41f8..5f12ef0 100644
--- a/hl/fortran/examples/run-hlfortran-ex.sh.in
+++ b/hl/fortran/examples/run-hlfortran-ex.sh.in
@@ -32,7 +32,7 @@ EXIT_FAILURE=1
# Where the tool is installed.
# default is relative path to installed location of the tools
-prefix="${prefix:-@prefix@}"
+prefix="${prefix:-../../../..}"
PARALLEL=@PARALLEL@ # Am I in parallel mode?
AR="@AR@"
RANLIB="@RANLIB@"
diff --git a/hl/src/H5DS.c b/hl/src/H5DS.c
index d86cc98..067992f 100644
--- a/hl/src/H5DS.c
+++ b/hl/src/H5DS.c
@@ -241,7 +241,7 @@ herr_t H5DSattach_scale(hid_t did,
if (has_dimlist == 0)
{
- dims[0] = (hsize_t)rank;
+ dims[0] = (hsize_t)rank;
/* space for the attribute */
if((sid = H5Screate_simple(1, dims, NULL)) < 0)
@@ -556,9 +556,9 @@ out:
*
* Date: December 20, 2004
*
-* Comments:
+* Comments:
*
-* Modifications: Function didn't delete DIMENSION_LIST attribute, when
+* Modifications: Function didn't delete DIMENSION_LIST attribute, when
* all dimension scales were detached from a dataset; added.
* 2010/05/13 EIP
*
@@ -706,24 +706,24 @@ herr_t H5DSdetach_scale(hid_t did,
/* same object, reset */
if(dsid_oi.fileno == tmp_oi.fileno && dsid_oi.addr == tmp_oi.addr)
{
- /* If there are more than one reference in the VL element
+ /* If there are more than one reference in the VL element
and the reference we found is not the last one,
copy the last one to replace the found one since the order
- of the references doesn't matter according to the spec;
- reduce the size of the VL element by 1;
- if the length of the element becomes 0, free the pointer
+ of the references doesn't matter according to the spec;
+ reduce the size of the VL element by 1;
+ if the length of the element becomes 0, free the pointer
and reset to NULL */
size_t len = buf[idx].len;
- if(j < len - 1)
- ((hobj_ref_t *)buf[idx].p)[j] = ((hobj_ref_t *)buf[idx].p)[len-1];
+ if(j < len - 1)
+ ((hobj_ref_t *)buf[idx].p)[j] = ((hobj_ref_t *)buf[idx].p)[len-1];
len = --buf[idx].len;
if(len == 0) {
- HDfree(buf[idx].p);
+ HDfree(buf[idx].p);
buf[idx].p = NULL;
}
- /* Since a reference to a dim. scale can be inserted only once,
+ /* Since a reference to a dim. scale can be inserted only once,
we do not need to continue the search if it is found */
found_ds = 1;
break;
@@ -736,16 +736,16 @@ herr_t H5DSdetach_scale(hid_t did,
goto out;
/* Write the attribute, but check first, if we have any scales left,
- because if not, we should delete the attribute according to the spec */
+ because if not, we should delete the attribute according to the spec */
for(i = 0; i < rank; i++) {
if(buf[i].len > 0) {
have_ds = 1;
- break;
+ break;
}
}
- if(have_ds) {
+ if(have_ds) {
if(H5Awrite(aid, tid, buf) < 0)
- goto out;
+ goto out;
}
else {
if(H5Adelete(did, DIMENSION_LIST) < 0)
@@ -1123,7 +1123,7 @@ htri_t H5DSis_attached(hid_t did,
if (dsbuf == NULL)
goto out;
- if (H5Aread(aid,ntid,dsbuf) < 0)
+ if (H5Aread(aid,ntid,dsbuf) < 0)
goto out;
/*-------------------------------------------------------------------------
@@ -1445,7 +1445,7 @@ herr_t H5DSset_label(hid_t did, unsigned int idx, const char *label)
if (H5I_DATASET != it)
return FAIL;
- if (label == NULL)
+ if (label == NULL)
return FAIL;
/* get dataset space */
@@ -1502,7 +1502,7 @@ herr_t H5DSset_label(hid_t did, unsigned int idx, const char *label)
goto out;
for (i = 0; i < (unsigned int) rank; i++)
- u.const_buf[i] = NULL;
+ u.const_buf[i] = NULL;
/* store the label information in the required index */
u.const_buf[idx] = label;
@@ -1532,7 +1532,7 @@ herr_t H5DSset_label(hid_t did, unsigned int idx, const char *label)
else
{
-
+
if ((aid = H5Aopen(did, DIMENSION_LABELS, H5P_DEFAULT)) < 0)
goto out;
@@ -1541,7 +1541,7 @@ herr_t H5DSset_label(hid_t did, unsigned int idx, const char *label)
/* allocate and initialize */
u.buf = (char **) HDmalloc((size_t) rank * sizeof(char *));
-
+
if (u.buf == NULL)
goto out;
@@ -1626,7 +1626,7 @@ out:
* Comments:
*
* Modifications:
-* JIRA HDFFV-7673: Added a check to see if the label name exists,
+* JIRA HDFFV-7673: Added a check to see if the label name exists,
* if not then returns zero. July 30, 2011. MSB
*
*-------------------------------------------------------------------------
@@ -1714,26 +1714,26 @@ ssize_t H5DSget_label(hid_t did, unsigned int idx, char *label, size_t size)
if (buf[idx] != NULL)
{
/* get the real string length */
- nbytes = strlen(buf[idx]);
+ nbytes = HDstrlen(buf[idx]);
- /* compute the string length which will fit into the user's buffer */
- copy_len = MIN(size-1, nbytes);
+ /* compute the string length which will fit into the user's buffer */
+ copy_len = MIN(size-1, nbytes);
- /* copy all/some of the name */
- if (label)
- {
- memcpy(label, buf[idx], copy_len);
-
- /* terminate the string */
- label[copy_len] = '\0';
- }
+ /* copy all/some of the name */
+ if (label)
+ {
+ HDmemcpy(label, buf[idx], copy_len);
+
+ /* terminate the string */
+ label[copy_len] = '\0';
+ }
}
/* free all the ptr's from the H5Aread() */
for (i = 0; i < rank; i++)
{
if (buf[i])
- HDfree(buf[i]);
+ HDfree(buf[i]);
}
/* close */
@@ -1867,7 +1867,7 @@ ssize_t H5DSget_scale_name(hid_t did,
/* copy all/some of the name */
if (name) {
- memcpy(name, buf, copy_len);
+ HDmemcpy(name, buf, copy_len);
/* terminate the string */
name[copy_len]='\0';
@@ -1951,33 +1951,33 @@ htri_t H5DSis_scale(hid_t did)
if((tid = H5Aget_type(aid)) < 0)
goto out;
- /* check to make sure attribute is a string */
- if(H5T_STRING != H5Tget_class(tid))
- goto out;
+ /* check to make sure attribute is a string */
+ if(H5T_STRING != H5Tget_class(tid))
+ goto out;
- /* check to make sure string is null-terminated */
- if(H5T_STR_NULLTERM != H5Tget_strpad(tid))
- goto out;
+ /* check to make sure string is null-terminated */
+ if(H5T_STR_NULLTERM != H5Tget_strpad(tid))
+ goto out;
- /* allocate buffer large enough to hold string */
- if((storage_size = H5Aget_storage_size(aid)) == 0)
- goto out;
+ /* allocate buffer large enough to hold string */
+ if((storage_size = H5Aget_storage_size(aid)) == 0)
+ goto out;
- buf = (char*)HDmalloc( (size_t)storage_size * sizeof(char) + 1);
- if(buf == NULL)
- goto out;
+ buf = (char*)HDmalloc( (size_t)storage_size * sizeof(char) + 1);
+ if(buf == NULL)
+ goto out;
- /* Read the attribute */
+ /* Read the attribute */
if(H5Aread(aid, tid, buf) < 0)
- goto out;
+ goto out;
- /* compare strings */
+ /* compare strings */
if(HDstrncmp(buf, DIMENSION_SCALE_CLASS, MIN(HDstrlen(DIMENSION_SCALE_CLASS),HDstrlen(buf)))==0)
is_ds = 1;
else
is_ds = 0;
- HDfree(buf);
+ HDfree(buf);
if(H5Tclose(tid) < 0)
goto out;
@@ -2236,8 +2236,8 @@ out:
static
hid_t H5DS_get_REFLIST_type(void)
{
- hid_t ntid_t = -1;
-
+ hid_t ntid_t = -1;
+
/* Build native type that corresponds to compound datatype
used to store ds_list_t structure in the REFERENCE_LIST
attribute */
@@ -2257,5 +2257,5 @@ out:
H5Tclose(ntid_t);
} H5E_END_TRY;
return FAIL;
-}
+}
diff --git a/hl/test/test_ds.c b/hl/test/test_ds.c
index 49dc72f..95178fc 100644
--- a/hl/test/test_ds.c
+++ b/hl/test/test_ds.c
@@ -186,11 +186,11 @@ int main(void)
if(nerrors) goto error;
- printf("All dimension scales tests passed.\n");
+ HDprintf("All dimension scales tests passed.\n");
return 0;
error:
- printf("***** %d DIMENSION SCALES TEST%s FAILED! *****\n",nerrors, 1 == nerrors ? "" : "S");
+ HDprintf("***** %d DIMENSION SCALES TEST%s FAILED! *****\n",nerrors, 1 == nerrors ? "" : "S");
return 1;
}
@@ -1110,7 +1110,7 @@ herr_t test_cmp_scalename(hid_t fid, hid_t did, const char *name, const char *sc
if((dsid = H5Dopen2(fid, name, H5P_DEFAULT)) >= 0) {
if(H5DSis_attached(did, dsid, idx) == 1) {
if((name_len=H5DSget_scale_name(dsid,NULL,(size_t)0)) > 0) {
- name_out = (char*)HDmalloc(((size_t)name_len+1) * sizeof (char));
+ name_out = (char*)HDmalloc(((size_t)name_len+1) * sizeof (char));
if(name_out != NULL) {
if(H5DSget_scale_name(dsid, name_out, (size_t)name_len+1) >= 0) {
if(HDstrncmp(scalename, name_out, (size_t)name_len)==0) {
@@ -1156,7 +1156,7 @@ static int test_detachscales(void)
sprintf(dname,"D%d", i);
if(H5LTmake_dataset_int(fid, dname, rank3, dims, buf) < 0)
goto out;
- }
+ }
/* create datasets and make them dim. scales */
for (i=0; i < 4; i++) {
@@ -1164,11 +1164,11 @@ static int test_detachscales(void)
if(H5LTmake_dataset_int(fid, dname, rank1, dims, buf) < 0)
goto out;
}
- /* attach scales to the first dataset; first dimension will have
+ /* attach scales to the first dataset; first dimension will have
two scales attached */
if((did = H5Dopen2(fid, "D0", H5P_DEFAULT)) >= 0) {
for (i=0; i<4; i++) {
- sprintf(dname, "DS%d", i);
+ HDsprintf(dname, "DS%d", i);
if((dsid = H5Dopen2(fid, dname, H5P_DEFAULT)) < 0)
goto out;
if(H5DSattach_scale(did, dsid, (unsigned int) i%3) < 0)
@@ -1185,7 +1185,7 @@ static int test_detachscales(void)
/* attach scales to the second dataset */
if((did = H5Dopen2(fid, "D1", H5P_DEFAULT)) >= 0) {
for (i=0; i<3; i++) {
- sprintf(dname, "DS%d", i);
+ HDsprintf(dname, "DS%d", i);
if((dsid = H5Dopen2(fid, dname, H5P_DEFAULT)) < 0)
goto out;
if(H5DSattach_scale(did, dsid, (unsigned int) i) < 0)
@@ -1206,20 +1206,20 @@ static int test_detachscales(void)
goto out;
for (i=0; i<2; i++) {
- sprintf(dname, "D%d", i);
+ HDsprintf(dname, "D%d", i);
if((did = H5Dopen2(fid, dname, H5P_DEFAULT)) < 0)
goto out;
if(H5DSdetach_scale(did, dsid, (unsigned int)0) < 0)
goto out;
if(H5Dclose(did) < 0)
goto out;
- }
+ }
/* Check that attribute "REFERENCE_LIST" doesn't exist anymore */
if(H5Aexists(dsid, REFERENCE_LIST)!= 0)
goto out;
if(H5Dclose(dsid) < 0)
goto out;
- /* Check that DS3 is the only dim. scale attached to the first
+ /* Check that DS3 is the only dim. scale attached to the first
dimension of D0 */
if((did = H5Dopen2(fid, "D0", H5P_DEFAULT)) < 0)
goto out;
@@ -1232,11 +1232,11 @@ static int test_detachscales(void)
if(H5Dclose(dsid) < 0)
goto out;
- /* Detach the rest of the scales DS3, DS1, DS2 from D0 and make
+ /* Detach the rest of the scales DS3, DS1, DS2 from D0 and make
sure that attribute "DIMENSION_LIST" doesn't exist anymore */
if((did = H5Dopen2(fid, "D0", H5P_DEFAULT)) >= 0) {
for (i=1; i<4; i++) {
- sprintf(dname, "DS%d", i);
+ HDsprintf(dname, "DS%d", i);
if((dsid = H5Dopen2(fid, dname, H5P_DEFAULT)) < 0)
goto out;
if(H5DSdetach_scale(did, dsid, (unsigned int) i%3) < 0)
@@ -1253,7 +1253,7 @@ static int test_detachscales(void)
else
goto out;
-
+
PASSED();
H5Fclose(fid);
@@ -2873,10 +2873,10 @@ static int test_simple(void)
if((sid = H5Screate_simple(rank,dims,NULL)) < 0)
goto out;
for(i = 0; i < 5; i++) {
- sprintf(dname,"dset_%d",i);
+ HDsprintf(dname,"dset_%d",i);
if((did = H5Dcreate2(gid, dname, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
goto out;
- sprintf(sname,"ds_%d",i);
+ HDsprintf(sname,"ds_%d",i);
if((dsid = H5Dcreate2(gid, sname, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
goto out;
if(H5DSset_scale(dsid,"scale") < 0)
@@ -2893,11 +2893,11 @@ static int test_simple(void)
*/
for(i = 0; i < 5; i++) {
- sprintf(dname, "dset_%d", i);
+ HDsprintf(dname, "dset_%d", i);
if((did = H5Dopen2(gid, dname, H5P_DEFAULT)) < 0)
goto out;
for(j = 0; j < 5; j++) {
- sprintf(sname, "ds_%d", j);
+ HDsprintf(sname, "ds_%d", j);
if((dsid = H5Dopen2(gid, sname, H5P_DEFAULT)) < 0)
goto out;
if(H5DSattach_scale(did, dsid, DIM0) < 0)
@@ -2915,7 +2915,7 @@ static int test_simple(void)
*/
for(i = 0; i < 5; i++) {
- sprintf(dname, "dset_%d", i);
+ HDsprintf(dname, "dset_%d", i);
if((did = H5Dopen2(gid, dname, H5P_DEFAULT)) < 0)
goto out;
for(j = 0; j < 5; j++) {
@@ -2938,7 +2938,7 @@ static int test_simple(void)
*/
for(i=0; i<5; i++) {
- sprintf(dname,"dset_%d",i);
+ HDsprintf(dname,"dset_%d",i);
if((did = H5Dopen2(gid,dname, H5P_DEFAULT)) < 0)
goto out;
for(j=0; j<5; j++) {
@@ -3541,7 +3541,7 @@ static herr_t read_scale(hid_t dset, unsigned dim, hid_t scale_id, void *visitor
for(i=0; i<nelmts; i++) {
if(buf[i] != data[i]) {
- printf("read and write buffers differ\n");
+ HDprintf("read and write buffers differ\n");
goto out;
}
}
@@ -5014,7 +5014,7 @@ static int test_errors2(void)
goto out;
if ((label_len=H5DSget_label(did,0,NULL,0)) < 0)
goto out;
- if ( label_len != strlen("label") )
+ if ( label_len != HDstrlen("label") )
goto out;
if (H5DSget_label(did,0,lbuf,sizeof(lbuf)) < 0)
goto out;
@@ -5134,83 +5134,83 @@ static int test_attach_detach(void)
if((dcpl_id = H5Pcreate(H5P_DATASET_CREATE)) < 0)
goto out;
-
- if((sid = H5Screate_simple(1, dims, dims)) < 0)
+
+ if((sid = H5Screate_simple(1, dims, dims)) < 0)
goto out;
if((dsid = H5Dcreate2(gid, DS_3_NAME, H5T_IEEE_F32BE, sid,
H5P_DEFAULT, dcpl_id, H5P_DEFAULT)) < 0)
goto out;
- if(H5Sclose(sid) < 0)
+ if(H5Sclose(sid) < 0)
goto out;
- if(H5Pclose(dcpl_id) < 0)
+ if(H5Pclose(dcpl_id) < 0)
goto out;
- if(H5DSset_scale(dsid, DS_3_NAME) < 0)
+ if(H5DSset_scale(dsid, DS_3_NAME) < 0)
goto out;
/* Create a variable that uses this dimension scale. */
- if((sid = H5Screate_simple(DIM1, dims, dims)) < 0)
+ if((sid = H5Screate_simple(DIM1, dims, dims)) < 0)
goto out;
if((var1_id = H5Dcreate2(gid, DS_31_NAME, H5T_NATIVE_FLOAT, sid,
- H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
goto out;
- if(H5Sclose(sid) < 0)
+ if(H5Sclose(sid) < 0)
goto out;
- if(H5DSattach_scale(var1_id, dsid, 0) < 0)
+ if(H5DSattach_scale(var1_id, dsid, 0) < 0)
goto out;
/* Create another variable that uses this dimension scale. */
- if((dcpl_id = H5Pcreate(H5P_DATASET_CREATE)) < 0)
+ if((dcpl_id = H5Pcreate(H5P_DATASET_CREATE)) < 0)
goto out;
- if(H5Pset_attr_creation_order(dcpl_id, H5P_CRT_ORDER_TRACKED | H5P_CRT_ORDER_INDEXED) < 0)
+ if(H5Pset_attr_creation_order(dcpl_id, H5P_CRT_ORDER_TRACKED | H5P_CRT_ORDER_INDEXED) < 0)
goto out;
- if((sid = H5Screate_simple(DIM1, dims, dims)) < 0)
+ if((sid = H5Screate_simple(DIM1, dims, dims)) < 0)
goto out;
if((var2_id = H5Dcreate2(gid, DS_32_NAME, H5T_NATIVE_FLOAT, sid,
- H5P_DEFAULT, H5P_DEFAULT,H5P_DEFAULT)) < 0)
+ H5P_DEFAULT, H5P_DEFAULT,H5P_DEFAULT)) < 0)
goto out;
- if(H5Pclose(dcpl_id) < 0)
+ if(H5Pclose(dcpl_id) < 0)
goto out;
- if(H5Sclose(sid) < 0)
+ if(H5Sclose(sid) < 0)
goto out;
/* Create 3rd variable that uses this dimension scale. */
- if((dcpl_id = H5Pcreate(H5P_DATASET_CREATE)) < 0)
+ if((dcpl_id = H5Pcreate(H5P_DATASET_CREATE)) < 0)
goto out;
- if(H5Pset_attr_creation_order(dcpl_id, H5P_CRT_ORDER_TRACKED | H5P_CRT_ORDER_INDEXED) < 0)
+ if(H5Pset_attr_creation_order(dcpl_id, H5P_CRT_ORDER_TRACKED | H5P_CRT_ORDER_INDEXED) < 0)
goto out;
- if((sid = H5Screate_simple(DIM1, dims, dims)) < 0)
+ if((sid = H5Screate_simple(DIM1, dims, dims)) < 0)
goto out;
if((var3_id = H5Dcreate2(gid, DS_33_NAME, H5T_NATIVE_FLOAT, sid,
- H5P_DEFAULT, H5P_DEFAULT,H5P_DEFAULT)) < 0)
+ H5P_DEFAULT, H5P_DEFAULT,H5P_DEFAULT)) < 0)
goto out;
- if(H5Pclose(dcpl_id) < 0)
+ if(H5Pclose(dcpl_id) < 0)
goto out;
- if(H5Sclose(sid) < 0)
+ if(H5Sclose(sid) < 0)
goto out;
-
+
/* Attached var2 scale */
- if(H5DSattach_scale(var2_id, dsid, 0) < 0)
+ if(H5DSattach_scale(var2_id, dsid, 0) < 0)
goto out;
/* Detach the var2 scale */
- if(H5DSdetach_scale(var2_id, dsid, 0) < 0)
+ if(H5DSdetach_scale(var2_id, dsid, 0) < 0)
goto out;
/* Check if in correct state of detached and attached */
@@ -5220,7 +5220,7 @@ static int test_attach_detach(void)
goto out;
/* Detach the var1 scale */
- if(H5DSdetach_scale(var1_id, dsid, 0) < 0)
+ if(H5DSdetach_scale(var1_id, dsid, 0) < 0)
goto out;
/* Check if in correct state of detached and attached */
@@ -5231,10 +5231,10 @@ static int test_attach_detach(void)
/* Attach the DS again and remove them in the opposite order */
- if(H5DSattach_scale(var1_id, dsid, 0) < 0)
+ if(H5DSattach_scale(var1_id, dsid, 0) < 0)
goto out;
- if(H5DSattach_scale(var2_id, dsid, 0) < 0)
+ if(H5DSattach_scale(var2_id, dsid, 0) < 0)
goto out;
/* Detach the var1 scale */
@@ -5262,13 +5262,13 @@ static int test_attach_detach(void)
* Attach Three DS and remove the middle one first
*****************************************************/
- if(H5DSattach_scale(var1_id, dsid, 0) < 0)
+ if(H5DSattach_scale(var1_id, dsid, 0) < 0)
goto out;
- if(H5DSattach_scale(var2_id, dsid, 0) < 0)
+ if(H5DSattach_scale(var2_id, dsid, 0) < 0)
goto out;
- if(H5DSattach_scale(var3_id, dsid, 0) < 0)
+ if(H5DSattach_scale(var3_id, dsid, 0) < 0)
goto out;
@@ -5314,15 +5314,15 @@ static int test_attach_detach(void)
*-------------------------------------------------------------------------
*/
- if(H5Dclose(var1_id) < 0)
+ if(H5Dclose(var1_id) < 0)
goto out;
- if(H5Dclose(var2_id) < 0)
+ if(H5Dclose(var2_id) < 0)
goto out;
- if(H5Dclose(var3_id) < 0)
+ if(H5Dclose(var3_id) < 0)
goto out;
- if(H5Dclose(dsid) < 0)
+ if(H5Dclose(dsid) < 0)
goto out;
- if(H5Gclose(gid) < 0)
+ if(H5Gclose(gid) < 0)
goto out;
if(H5Fclose(fid) < 0)
goto out;
diff --git a/hl/test/test_lite.c b/hl/test/test_lite.c
index 763fdb5..51ab72b 100644
--- a/hl/test/test_lite.c
+++ b/hl/test/test_lite.c
@@ -1050,7 +1050,7 @@ static herr_t make_attributes( hid_t loc_id, const char* obj_name )
HDfree( dims_out );
return -1;
}
-
+
for (i = 0; i < rank_out; i++) {
if ( dims_out[i] != 5 ) {
HDfree( dims_out );
@@ -1152,7 +1152,7 @@ static int test_fps(void)
if(H5LTdtype_to_text(dtype, NULL, H5LT_DDL, &str_len)<0)
goto out;
-
+
if(NULL==(dt_str = (char*)HDcalloc(str_len, sizeof(char))))
goto out;
if(H5LTdtype_to_text(dtype, dt_str, H5LT_DDL, &str_len)<0) {
@@ -1228,7 +1228,7 @@ static int test_strings(void)
goto out;
}
if(HDstrcmp(dt_str, "H5T_STRING {\n STRSIZE 13;\n STRPAD H5T_STR_NULLTERM;\n CSET H5T_CSET_ASCII;\n CTYPE H5T_C_S1;\n }")) {
- printf("dt=\n%s\n", dt_str);
+ HDprintf("dt=\n%s\n", dt_str);
HDfree(dt_str);
goto out;
}
@@ -1260,7 +1260,7 @@ static int test_strings(void)
goto out;
}
if(HDstrcmp(dt_str, "H5T_STRING {\n STRSIZE H5T_VARIABLE;\n STRPAD H5T_STR_NULLPAD;\n CSET H5T_CSET_ASCII;\n CTYPE H5T_C_S1;\n }")) {
- printf("dt=\n%s\n", dt_str);
+ HDprintf("dt=\n%s\n", dt_str);
HDfree(dt_str);
goto out;
}
@@ -1270,13 +1270,13 @@ static int test_strings(void)
str_len = str_len + 10;
if(NULL==(dt_str = (char*)HDcalloc(str_len, sizeof(char))))
goto out;
-
+
if(H5LTdtype_to_text(dtype, dt_str, H5LT_DDL, &str_len)<0) {
HDfree(dt_str);
goto out;
}
if(HDstrncmp(dt_str, "H5T_STRING {\n STRSIZE H5T_VARIABLE;\n STRPAD H5T_STR_NULLPAD;\n CSET H5T_CSET_ASCII;\n CTYPE H5T_C_S1;\n }", str_len-1)) {
- printf("dt=\n%s\n", dt_str);
+ HDprintf("dt=\n%s\n", dt_str);
HDfree(dt_str);
goto out;
}
@@ -1292,10 +1292,10 @@ static int test_strings(void)
goto out;
}
/* check the truncated string */
- if(strlen(dt_str) != str_len-1) goto out;
- str_len = strlen(dt_str);
+ if(HDstrlen(dt_str) != str_len-1) goto out;
+ str_len = HDstrlen(dt_str);
if(HDstrncmp(dt_str, "H5T_STRING {\n STRSIZE H5T_VARIABLE;\n STRPAD H5T_STR_NULLPAD;\n CSET H5T_CSET_ASCII;\n CTYPE H5T_C_S1;\n }", str_len)) {
- printf("dt=\n%s\n", dt_str);
+ HDprintf("dt=\n%s\n", dt_str);
HDfree(dt_str);
goto out;
}
@@ -1352,7 +1352,7 @@ static int test_opaques(void)
goto out;
}
if(HDstrcmp(dt_str, "H5T_OPAQUE {\n OPQ_SIZE 19;\n OPQ_TAG \"This is a tag for opaque type\";\n }")) {
- printf("dt=\n%s\n", dt_str);
+ HDprintf("dt=\n%s\n", dt_str);
HDfree(dt_str);
goto out;
}
@@ -1428,7 +1428,7 @@ static int test_enums(void)
}
if(HDstrcmp(dt_str, "H5T_ENUM {\n H5T_STD_I32LE;\n \"RED\" 5;\n \"GREEN\" 6;\n \"BLUE\" 7;\n \"WHITE\" 8;\n }")) {
- printf("dt=\n%s\n", dt_str);
+ HDprintf("dt=\n%s\n", dt_str);
HDfree(dt_str);
goto out;
}
@@ -1469,16 +1469,16 @@ static int test_variables(void)
if(H5Tis_variable_str(dtype))
goto out;
-
+
if(H5Tclose(dtype)<0)
goto out;
-
+
if((dtype = H5LTtext_to_dtype("H5T_VLEN { H5T_VLEN { H5T_STD_I32BE } }", H5LT_DDL))<0)
goto out;
-
+
if(H5Tis_variable_str(dtype))
goto out;
-
+
if(H5LTdtype_to_text(dtype, NULL, H5LT_DDL, &str_len)<0)
goto out;
if(NULL==(dt_str = (char*)HDcalloc(str_len, sizeof(char))))
@@ -1488,15 +1488,15 @@ static int test_variables(void)
goto out;
}
if(HDstrcmp(dt_str, "H5T_VLEN {\n H5T_VLEN {\n H5T_STD_I32BE\n }\n }")) {
- printf("dt=\n%s\n", dt_str);
+ HDprintf("dt=\n%s\n", dt_str);
HDfree(dt_str);
goto out;
}
HDfree(dt_str);
-
+
if(H5Tclose(dtype)<0)
goto out;
-
+
PASSED();
return 0;
@@ -1547,7 +1547,7 @@ static int test_arrays(void)
goto out;
}
if(HDstrcmp(dt_str, "H5T_ARRAY {\n [5][7][13] H5T_ARRAY {\n [17][19] H5T_COMPOUND {\n H5T_STD_I8BE \"arr_compound_1\" : 0;\n H5T_STD_I32BE \"arr_compound_2\" : 1;\n }\n }\n }")) {
- printf("dt=\n%s\n", dt_str);
+ HDprintf("dt=\n%s\n", dt_str);
HDfree(dt_str);
goto out;
}
@@ -1603,7 +1603,7 @@ static int test_compounds(void)
goto out;
}
if(HDstrcmp(dt_str, "H5T_COMPOUND {\n H5T_STD_I16BE \"one_field\" : 2;\n H5T_STD_U8LE \"two_field\" : 6;\n }")) {
- printf("dt=\n%s\n", dt_str);
+ HDprintf("dt=\n%s\n", dt_str);
HDfree(dt_str);
goto out;
}
@@ -1637,7 +1637,7 @@ out:
}
/*-------------------------------------------------------------------------
-* subroutine for test_text_dtype(): test_compound_bug(). Test case for
+* subroutine for test_text_dtype(): test_compound_bug(). Test case for
* issue 7701.
*-------------------------------------------------------------------------
*/
@@ -1770,7 +1770,7 @@ static int test_complicated_compound(void)
/* Open input file */
fp = HDfopen(filename, "r");
if(fp == NULL) {
- printf( "Could not find file %s. Try set $srcdir \n", filename);
+ HDprintf( "Could not find file %s. Try set $srcdir \n", filename);
goto out;
}
@@ -1881,9 +1881,9 @@ static int test_valid_path(void)
hid_t file_id, group;
htri_t path_valid;
const char *data_string_in = "test";
-
+
TESTING("H5LTpath_valid");
-
+
/* Create a new file using default properties. */
/**************************************************************
@@ -1908,11 +1908,11 @@ static int test_valid_path(void)
* |
* |
* | --- Gcyc (soft link to /G1)
- * / \
- * / \
- * G5 \
+ * / \
+ * / \
+ * G5 \
* (soft link G6 (external link /G1 in FILENAME4)
- * to /G2)
+ * to /G2)
*
****************************************************************/
@@ -1941,7 +1941,7 @@ static int test_valid_path(void)
*/
if(H5LTmake_dataset_string(group, "/G2/DS4", data_string_in)<0)
goto out;
-
+
/*
* Create a soft link
*/
@@ -2023,9 +2023,9 @@ static int test_valid_path(void)
* |
* |
* |
- * G1
+ * G1
* / \
- * / \
+ * / \
* DS1 G2
* (dangled soft link to /G1/G20)
*
@@ -2056,13 +2056,13 @@ static int test_valid_path(void)
goto out;
H5Fclose(file_id);
-
+
/* Open input file */
if((file_id = H5Fopen(FILE_NAME3,H5F_ACC_RDONLY, H5P_DEFAULT))<0)
goto out;
/**************************************
- * CHECK ABSOLUTE PATHS
+ * CHECK ABSOLUTE PATHS
**************************************/
if( (path_valid = H5LTpath_valid(file_id, "/", TRUE)) != TRUE) {
@@ -2076,7 +2076,7 @@ static int test_valid_path(void)
if( (path_valid = H5LTpath_valid(file_id, "/G1", TRUE)) != TRUE) {
goto out;
}
-
+
if((path_valid = H5LTpath_valid(file_id, "/G1/DS1", TRUE)) != TRUE)
goto out;
@@ -2094,7 +2094,7 @@ static int test_valid_path(void)
if( (path_valid = H5LTpath_valid(file_id, "/G1/G2/Gcyc/DS1", TRUE)) != TRUE)
goto out;
-
+
if( (path_valid = H5LTpath_valid(file_id, "/G2", TRUE)) != TRUE)
goto out;
@@ -2114,14 +2114,14 @@ static int test_valid_path(void)
/* check soft links */
if( (path_valid = H5LTpath_valid(file_id, "/G1/G2/G5/DS4", TRUE)) != TRUE)
goto out;
-
+
/**************************************
- * CHECK RELATIVE PATHS
+ * CHECK RELATIVE PATHS
***************************************/
if( (group = H5Gopen2(file_id, "/", H5P_DEFAULT)) < 0)
goto out;
-
+
if( (path_valid = H5LTpath_valid(group, "/", TRUE)) != TRUE) {
goto out;
}
@@ -2156,22 +2156,22 @@ static int test_valid_path(void)
goto out;
if( (path_valid = H5LTpath_valid(group, "G2/G5", TRUE)) != TRUE)
- goto out;
+ goto out;
/* Check the "./" case */
if( (path_valid = H5LTpath_valid(group, "./DS3", TRUE)) != TRUE)
goto out;
if( (path_valid = H5LTpath_valid(group, "./G2/G5", TRUE)) != TRUE)
- goto out;
+ goto out;
/* Should fail, does not exist */
if( (path_valid = H5LTpath_valid(group, "./G2/G20", FALSE)) == TRUE)
- goto out;
+ goto out;
/* Should fail, does not exist */
if( (path_valid = H5LTpath_valid(group, "./G2/G20", TRUE)) == TRUE)
- goto out;
+ goto out;
if(H5Gclose(group)<0)
goto out;
@@ -2220,7 +2220,7 @@ static int test_valid_path(void)
PASSED();
return 0;
- out:
+ out:
H5_FAILED();
return -1;
}
diff --git a/java/examples/datasets/JavaDatasetExample.sh.in b/java/examples/datasets/JavaDatasetExample.sh.in
index cb16d45..f5c63cd 100644
--- a/java/examples/datasets/JavaDatasetExample.sh.in
+++ b/java/examples/datasets/JavaDatasetExample.sh.in
@@ -52,12 +52,14 @@ test -d $BLDLIBDIR || mkdir -p $BLDLIBDIR
# Comment '#' without space can be used.
# --------------------------------------------------------------------
LIST_LIBRARY_FILES="
-$HDFLIB_HOME/slf4j-api-1.7.25.jar
-$HDFLIB_HOME/ext/slf4j-simple-1.7.25.jar
$top_builddir/src/.libs/libhdf5.*
$top_builddir/java/src/jni/.libs/libhdf5_java.*
$top_builddir/java/src/$JARFILE
"
+LIST_JAR_TESTFILES="
+$HDFLIB_HOME/slf4j-api-1.7.25.jar
+$HDFLIB_HOME/ext/slf4j-simple-1.7.25.jar
+"
LIST_DATA_FILES="
$HDFTEST_HOME/../testfiles/examples.datasets.H5Ex_D_Alloc.txt
$HDFTEST_HOME/../testfiles/examples.datasets.H5Ex_D_Checksum.txt
@@ -83,6 +85,7 @@ $HDFTEST_HOME/../testfiles/examples.datasets.H5Ex_D_Soint.txt
# copy files from source dirs to test dir
#
COPY_LIBFILES="$LIST_LIBRARY_FILES"
+COPY_JARTESTFILES="$LIST_JAR_TESTFILES"
COPY_LIBFILES_TO_BLDLIBDIR()
{
@@ -110,6 +113,30 @@ COPY_LIBFILES_TO_BLDLIBDIR()
fi
fi
done
+ # copy jar files. Used -f to make sure get a new copy
+ for tstfile in $COPY_JARTESTFILES
+ do
+ # ignore '#' comment
+ echo $tstfile | tr -d ' ' | grep '^#' > /dev/null
+ RET=$?
+ if [ $RET -eq 1 ]; then
+ # skip cp if srcdir is same as destdir
+ # this occurs when build/test performed in source dir and
+ # make cp fail
+ SDIR=`$DIRNAME $tstfile`
+ INODE_SDIR=`$LS -i -d $SDIR | $AWK -F' ' '{print $1}'`
+ INODE_DDIR=`$LS -i -d $BLDLIBDIR | $AWK -F' ' '{print $1}'`
+ if [ "$INODE_SDIR" != "$INODE_DDIR" ]; then
+ $CP -f $tstfile $BLDLIBDIR
+ if [ $? -ne 0 ]; then
+ echo "Error: FAILED to copy $tstfile ."
+
+ # Comment out this to CREATE expected file
+ exit $EXIT_FAILURE
+ fi
+ fi
+ fi
+ done
}
CLEAN_LIBFILES_AND_BLDLIBDIR()
@@ -117,11 +144,14 @@ CLEAN_LIBFILES_AND_BLDLIBDIR()
# skip rm if srcdir is same as destdir
# this occurs when build/test performed in source dir and
# make cp fail
- SDIR=`$DIRNAME $HDFLIB_HOME/slf4j-api-1.7.25.jar`
+ SDIR=$HDFLIB_HOME
INODE_SDIR=`$LS -i -d $SDIR | $AWK -F' ' '{print $1}'`
INODE_DDIR=`$LS -i -d $BLDLIBDIR | $AWK -F' ' '{print $1}'`
if [ "$INODE_SDIR" != "$INODE_DDIR" ]; then
- $RM $BLDLIBDIR
+ for tstfile in $COPY_JARTESTFILES
+ do
+ $RM $BLDLIBDIR/tstfile
+ done
fi
}
@@ -215,14 +245,9 @@ if $TEST -z "$LD_LIBRARY_PATH" ; then
fi
case $os_name in
- Darwin)
- DYLD_LIBRARY_PATH=$BLDLIBDIR:$DYLD_LIBRARY_PATH
- export DYLD_LIBRARY_PATH
- LD_LIBRARY_PATH=$DYLD_LIBRARY_PATH
- ;;
*)
LD_LIBRARY_PATH=$BLDLIBDIR:$LD_LIBRARY_PATH
- ;;
+ ;;
esac
export LD_LIBRARY_PATH
diff --git a/java/examples/datatypes/JavaDatatypeExample.sh.in b/java/examples/datatypes/JavaDatatypeExample.sh.in
index 033442a..447512a 100644
--- a/java/examples/datatypes/JavaDatatypeExample.sh.in
+++ b/java/examples/datatypes/JavaDatatypeExample.sh.in
@@ -49,12 +49,14 @@ test -d $BLDLIBDIR || mkdir -p $BLDLIBDIR
# Comment '#' without space can be used.
# --------------------------------------------------------------------
LIST_LIBRARY_FILES="
-$HDFLIB_HOME/slf4j-api-1.7.25.jar
-$HDFLIB_HOME/ext/slf4j-simple-1.7.25.jar
$top_builddir/src/.libs/libhdf5.*
$top_builddir/java/src/jni/.libs/libhdf5_java.*
$top_builddir/java/src/$JARFILE
"
+LIST_JAR_TESTFILES="
+$HDFLIB_HOME/slf4j-api-1.7.25.jar
+$HDFLIB_HOME/ext/slf4j-simple-1.7.25.jar
+"
LIST_DATA_FILES="
$HDFTEST_HOME/../testfiles/examples.datatypes.H5Ex_T_Array.txt
$HDFTEST_HOME/../testfiles/examples.datatypes.H5Ex_T_ArrayAttribute.txt
@@ -80,6 +82,7 @@ $HDFTEST_HOME/../testfiles/examples.datatypes.H5Ex_T_VLString.txt
# copy files from source dirs to test dir
#
COPY_LIBFILES="$LIST_LIBRARY_FILES"
+COPY_JARTESTFILES="$LIST_JAR_TESTFILES"
COPY_LIBFILES_TO_BLDLIBDIR()
{
@@ -107,6 +110,30 @@ COPY_LIBFILES_TO_BLDLIBDIR()
fi
fi
done
+ # copy jar files. Used -f to make sure get a new copy
+ for tstfile in $COPY_JARTESTFILES
+ do
+ # ignore '#' comment
+ echo $tstfile | tr -d ' ' | grep '^#' > /dev/null
+ RET=$?
+ if [ $RET -eq 1 ]; then
+ # skip cp if srcdir is same as destdir
+ # this occurs when build/test performed in source dir and
+ # make cp fail
+ SDIR=`$DIRNAME $tstfile`
+ INODE_SDIR=`$LS -i -d $SDIR | $AWK -F' ' '{print $1}'`
+ INODE_DDIR=`$LS -i -d $BLDLIBDIR | $AWK -F' ' '{print $1}'`
+ if [ "$INODE_SDIR" != "$INODE_DDIR" ]; then
+ $CP -f $tstfile $BLDLIBDIR
+ if [ $? -ne 0 ]; then
+ echo "Error: FAILED to copy $tstfile ."
+
+ # Comment out this to CREATE expected file
+ exit $EXIT_FAILURE
+ fi
+ fi
+ fi
+ done
}
CLEAN_LIBFILES_AND_BLDLIBDIR()
@@ -114,11 +141,14 @@ CLEAN_LIBFILES_AND_BLDLIBDIR()
# skip rm if srcdir is same as destdir
# this occurs when build/test performed in source dir and
# make cp fail
- SDIR=`$DIRNAME $HDFLIB_HOME/slf4j-api-1.7.25.jar`
+ SDIR=$HDFLIB_HOME
INODE_SDIR=`$LS -i -d $SDIR | $AWK -F' ' '{print $1}'`
INODE_DDIR=`$LS -i -d $BLDLIBDIR | $AWK -F' ' '{print $1}'`
if [ "$INODE_SDIR" != "$INODE_DDIR" ]; then
- $RM $BLDLIBDIR
+ for tstfile in $COPY_JARTESTFILES
+ do
+ $RM $BLDLIBDIR/tstfile
+ done
fi
}
@@ -211,11 +241,6 @@ if $TEST -z "$LD_LIBRARY_PATH" ; then
fi
case $os_name in
- Darwin)
- DYLD_LIBRARY_PATH=$BLDLIBDIR:$DYLD_LIBRARY_PATH
- export DYLD_LIBRARY_PATH
- LD_LIBRARY_PATH=$DYLD_LIBRARY_PATH
- ;;
*)
LD_LIBRARY_PATH=$BLDLIBDIR:$LD_LIBRARY_PATH
;;
diff --git a/java/examples/groups/JavaGroupExample.sh.in b/java/examples/groups/JavaGroupExample.sh.in
index 36df02e..9d4673f 100644
--- a/java/examples/groups/JavaGroupExample.sh.in
+++ b/java/examples/groups/JavaGroupExample.sh.in
@@ -34,13 +34,13 @@ nerrors=0
# where the libs exist
HDFLIB_HOME="$top_srcdir/java/lib"
BLDLIBDIR="$top_builddir/hdf5/lib"
-BLDREFDIR="./groups"
+BLDITERDIR="./groups"
BLDDIR="."
HDFTEST_HOME="$top_srcdir/java/examples/groups"
JARFILE=jar@PACKAGE_TARNAME@-@PACKAGE_VERSION@.jar
TESTJARFILE=jar@PACKAGE_TARNAME@groups.jar
test -d $BLDLIBDIR || mkdir -p $BLDLIBDIR
-test -d $BLDREFDIR || mkdir -p $BLDREFDIR
+test -d $BLDITERDIR || mkdir -p $BLDITERDIR
######################################################################
# library files
@@ -51,13 +51,15 @@ test -d $BLDREFDIR || mkdir -p $BLDREFDIR
# Comment '#' without space can be used.
# --------------------------------------------------------------------
LIST_LIBRARY_FILES="
-$HDFLIB_HOME/slf4j-api-1.7.25.jar
-$HDFLIB_HOME/ext/slf4j-simple-1.7.25.jar
$top_builddir/src/.libs/libhdf5.*
$top_builddir/java/src/jni/.libs/libhdf5_java.*
$top_builddir/java/src/$JARFILE
"
-LIST_REF_FILES="
+LIST_JAR_TESTFILES="
+$HDFLIB_HOME/slf4j-api-1.7.25.jar
+$HDFLIB_HOME/ext/slf4j-simple-1.7.25.jar
+"
+LIST_ITER_FILES="
$HDFTEST_HOME/h5ex_g_iterate.h5
$HDFTEST_HOME/h5ex_g_visit.h5
"
@@ -75,6 +77,7 @@ $HDFTEST_HOME/../testfiles/examples.groups.H5Ex_G_Visit.txt
# copy files from source dirs to test dir
#
COPY_LIBFILES="$LIST_LIBRARY_FILES"
+COPY_JARTESTFILES="$LIST_JAR_TESTFILES"
COPY_LIBFILES_TO_BLDLIBDIR()
{
@@ -102,6 +105,30 @@ COPY_LIBFILES_TO_BLDLIBDIR()
fi
fi
done
+ # copy jar files. Used -f to make sure get a new copy
+ for tstfile in $COPY_JARTESTFILES
+ do
+ # ignore '#' comment
+ echo $tstfile | tr -d ' ' | grep '^#' > /dev/null
+ RET=$?
+ if [ $RET -eq 1 ]; then
+ # skip cp if srcdir is same as destdir
+ # this occurs when build/test performed in source dir and
+ # make cp fail
+ SDIR=`$DIRNAME $tstfile`
+ INODE_SDIR=`$LS -i -d $SDIR | $AWK -F' ' '{print $1}'`
+ INODE_DDIR=`$LS -i -d $BLDLIBDIR | $AWK -F' ' '{print $1}'`
+ if [ "$INODE_SDIR" != "$INODE_DDIR" ]; then
+ $CP -f $tstfile $BLDLIBDIR
+ if [ $? -ne 0 ]; then
+ echo "Error: FAILED to copy $tstfile ."
+
+ # Comment out this to CREATE expected file
+ exit $EXIT_FAILURE
+ fi
+ fi
+ fi
+ done
}
CLEAN_LIBFILES_AND_BLDLIBDIR()
@@ -109,11 +136,14 @@ CLEAN_LIBFILES_AND_BLDLIBDIR()
# skip rm if srcdir is same as destdir
# this occurs when build/test performed in source dir and
# make cp fail
- SDIR=`$DIRNAME $HDFLIB_HOME/slf4j-api-1.7.25.jar`
+ SDIR=$HDFLIB_HOME
INODE_SDIR=`$LS -i -d $SDIR | $AWK -F' ' '{print $1}'`
INODE_DDIR=`$LS -i -d $BLDLIBDIR | $AWK -F' ' '{print $1}'`
if [ "$INODE_SDIR" != "$INODE_DDIR" ]; then
- $RM $BLDLIBDIR
+ for tstfile in $COPY_JARTESTFILES
+ do
+ $RM $BLDLIBDIR/tstfile
+ done
fi
}
@@ -152,6 +182,7 @@ CLEAN_DATAFILES_AND_BLDDIR()
$RM $BLDDIR/examples.groups.H5Ex_G_*.txt
$RM $BLDDIR/H5Ex_G_*.out
$RM $BLDDIR/H5Ex_G_*.h5
+ $RM $BLDDIR/h5ex_g_*.h5
SDIR=`$DIRNAME $tstfile`
INODE_SDIR=`$LS -i -d $SDIR | $AWK -F' ' '{print $1}'`
INODE_DDIR=`$LS -i -d $BLDDIR | $AWK -F' ' '{print $1}'`
@@ -161,12 +192,12 @@ CLEAN_DATAFILES_AND_BLDDIR()
fi
}
-COPY_REFFILES="$LIST_REF_FILES"
+COPY_ITERFILES="$LIST_ITER_FILES"
-COPY_REFFILES_TO_BLDREFDIR()
+COPY_ITERFILES_TO_BLDITERDIR()
{
# copy test files. Used -f to make sure get a new copy
- for tstfile in $COPY_REFFILES
+ for tstfile in $COPY_ITERFILES
do
# ignore '#' comment
echo $tstfile | tr -d ' ' | grep '^#' > /dev/null
@@ -177,9 +208,9 @@ COPY_REFFILES_TO_BLDREFDIR()
# make cp fail
SDIR=`$DIRNAME $tstfile`
INODE_SDIR=`$LS -i -d $SDIR | $AWK -F' ' '{print $1}'`
- INODE_DDIR=`$LS -i -d $BLDREFDIR | $AWK -F' ' '{print $1}'`
+ INODE_DDIR=`$LS -i -d $BLDITERDIR | $AWK -F' ' '{print $1}'`
if [ "$INODE_SDIR" != "$INODE_DDIR" ]; then
- $CP -f $tstfile $BLDREFDIR
+ $CP -f $tstfile $BLDITERDIR
if [ $? -ne 0 ]; then
echo "Error: FAILED to copy $tstfile ."
@@ -191,16 +222,16 @@ COPY_REFFILES_TO_BLDREFDIR()
done
}
-CLEAN_REFFILES_AND_BLDREFDIR()
+CLEAN_ITERFILES_AND_BLDITERDIR()
{
# skip rm if srcdir is same as destdir
# this occurs when build/test performed in source dir and
# make cp fail
SDIR=`$DIRNAME $HDFTEST_HOME/h5ex_g_iterate.h5`
INODE_SDIR=`$LS -i -d $SDIR | $AWK -F' ' '{print $1}'`
- INODE_DDIR=`$LS -i -d $BLDREFDIR | $AWK -F' ' '{print $1}'`
+ INODE_DDIR=`$LS -i -d $BLDITERDIR | $AWK -F' ' '{print $1}'`
if [ "$INODE_SDIR" != "$INODE_DDIR" ]; then
- $RM $BLDREFDIR
+ $RM $BLDITERDIR
fi
}
@@ -223,7 +254,7 @@ JAVAEXEFLAGS=@H5_JAVAFLAGS@
# prepare for test
COPY_LIBFILES_TO_BLDLIBDIR
COPY_DATAFILES_TO_BLDDIR
-COPY_REFFILES_TO_BLDREFDIR
+COPY_ITERFILES_TO_BLDITERDIR
CPATH=".:"$BLDLIBDIR"/"$JARFILE":"$BLDLIBDIR"/slf4j-api-1.7.25.jar:"$BLDLIBDIR"/slf4j-simple-1.7.25.jar:"$TESTJARFILE""
@@ -257,11 +288,6 @@ if $TEST -z "$LD_LIBRARY_PATH" ; then
fi
case $os_name in
- Darwin)
- DYLD_LIBRARY_PATH=$BLDLIBDIR:$DYLD_LIBRARY_PATH
- export DYLD_LIBRARY_PATH
- LD_LIBRARY_PATH=$DYLD_LIBRARY_PATH
- ;;
*)
LD_LIBRARY_PATH=$BLDLIBDIR:$LD_LIBRARY_PATH
;;
@@ -340,9 +366,9 @@ else
fi
# Clean up temporary files/directories
+CLEAN_ITERFILES_AND_BLDITERDIR
CLEAN_LIBFILES_AND_BLDLIBDIR
CLEAN_DATAFILES_AND_BLDDIR
-CLEAN_REFFILES_AND_BLDREFDIR
# Report test results and exit
if test $nerrors -eq 0 ; then
diff --git a/java/examples/intro/JavaIntroExample.sh.in b/java/examples/intro/JavaIntroExample.sh.in
index 077146d..1886485 100644
--- a/java/examples/intro/JavaIntroExample.sh.in
+++ b/java/examples/intro/JavaIntroExample.sh.in
@@ -49,12 +49,14 @@ test -d $BLDLIBDIR || mkdir -p $BLDLIBDIR
# Comment '#' without space can be used.
# --------------------------------------------------------------------
LIST_LIBRARY_FILES="
-$HDFLIB_HOME/slf4j-api-1.7.25.jar
-$HDFLIB_HOME/ext/slf4j-simple-1.7.25.jar
$top_builddir/src/.libs/libhdf5.*
$top_builddir/java/src/jni/.libs/libhdf5_java.*
$top_builddir/java/src/$JARFILE
"
+LIST_JAR_TESTFILES="
+$HDFLIB_HOME/slf4j-api-1.7.25.jar
+$HDFLIB_HOME/ext/slf4j-simple-1.7.25.jar
+"
LIST_DATA_FILES="
$HDFTEST_HOME/../testfiles/examples.intro.H5_CreateDataset.txt
$HDFTEST_HOME/../testfiles/examples.intro.H5_CreateAttribute.txt
@@ -69,6 +71,7 @@ $HDFTEST_HOME/../testfiles/examples.intro.H5_ReadWrite.txt
# copy files from source dirs to test dir
#
COPY_LIBFILES="$LIST_LIBRARY_FILES"
+COPY_JARTESTFILES="$LIST_JAR_TESTFILES"
COPY_LIBFILES_TO_BLDLIBDIR()
{
@@ -96,6 +99,30 @@ COPY_LIBFILES_TO_BLDLIBDIR()
fi
fi
done
+ # copy jar files. Used -f to make sure get a new copy
+ for tstfile in $COPY_JARTESTFILES
+ do
+ # ignore '#' comment
+ echo $tstfile | tr -d ' ' | grep '^#' > /dev/null
+ RET=$?
+ if [ $RET -eq 1 ]; then
+ # skip cp if srcdir is same as destdir
+ # this occurs when build/test performed in source dir and
+ # make cp fail
+ SDIR=`$DIRNAME $tstfile`
+ INODE_SDIR=`$LS -i -d $SDIR | $AWK -F' ' '{print $1}'`
+ INODE_DDIR=`$LS -i -d $BLDLIBDIR | $AWK -F' ' '{print $1}'`
+ if [ "$INODE_SDIR" != "$INODE_DDIR" ]; then
+ $CP -f $tstfile $BLDLIBDIR
+ if [ $? -ne 0 ]; then
+ echo "Error: FAILED to copy $tstfile ."
+
+ # Comment out this to CREATE expected file
+ exit $EXIT_FAILURE
+ fi
+ fi
+ fi
+ done
}
CLEAN_LIBFILES_AND_BLDLIBDIR()
@@ -103,11 +130,14 @@ CLEAN_LIBFILES_AND_BLDLIBDIR()
# skip rm if srcdir is same as destdir
# this occurs when build/test performed in source dir and
# make cp fail
- SDIR=`$DIRNAME $HDFLIB_HOME/slf4j-api-1.7.25.jar`
+ SDIR=$HDFLIB_HOME
INODE_SDIR=`$LS -i -d $SDIR | $AWK -F' ' '{print $1}'`
INODE_DDIR=`$LS -i -d $BLDLIBDIR | $AWK -F' ' '{print $1}'`
if [ "$INODE_SDIR" != "$INODE_DDIR" ]; then
- $RM $BLDLIBDIR
+ for tstfile in $COPY_JARTESTFILES
+ do
+ $RM $BLDLIBDIR/tstfile
+ done
fi
}
@@ -200,11 +230,6 @@ if $TEST -z "$LD_LIBRARY_PATH" ; then
fi
case $os_name in
- Darwin)
- DYLD_LIBRARY_PATH=$BLDLIBDIR:$DYLD_LIBRARY_PATH
- export DYLD_LIBRARY_PATH
- LD_LIBRARY_PATH=$DYLD_LIBRARY_PATH
- ;;
*)
LD_LIBRARY_PATH=$BLDLIBDIR:$LD_LIBRARY_PATH
;;
diff --git a/java/src/hdf/hdf5lib/H5.java b/java/src/hdf/hdf5lib/H5.java
index 9c62538..d8df814 100644
--- a/java/src/hdf/hdf5lib/H5.java
+++ b/java/src/hdf/hdf5lib/H5.java
@@ -214,7 +214,7 @@ import hdf.hdf5lib.structs.H5O_info_t;
* exception handlers to print out the HDF-5 error stack.
* <hr>
*
- * @version HDF5 1.10.3 <BR>
+ * @version HDF5 1.10.4 <BR>
* <b>See also: <a href ="./hdf.hdf5lib.HDFArray.html"> hdf.hdf5lib.HDFArray</a> </b><BR>
* <a href ="./hdf.hdf5lib.HDF5Constants.html"> hdf.hdf5lib.HDF5Constants</a><BR>
* <a href ="./hdf.hdf5lib.HDF5CDataTypes.html"> hdf.hdf5lib.HDF5CDataTypes</a><BR>
@@ -237,7 +237,7 @@ public class H5 implements java.io.Serializable {
*
* Make sure to update the versions number when a different library is used.
*/
- public final static int LIB_VERSION[] = { 1, 10, 3 };
+ public final static int LIB_VERSION[] = { 1, 10, 4 };
public final static String H5PATH_PROPERTY_KEY = "hdf.hdf5lib.H5.hdf5lib";
diff --git a/java/src/hdf/overview.html b/java/src/hdf/overview.html
index 52dabf7..edb1b76 100644
--- a/java/src/hdf/overview.html
+++ b/java/src/hdf/overview.html
@@ -12,7 +12,7 @@ of the unsupported functions have C function pointers, which is not currently
implemented in JHI5.</p>
<table style="width:71%;text-align:center;background-color:#dbeaf5" border="1">
-<caption>Java HD5 Interface (JHI5)</caption>
+<caption>Java HDF5 Interface (JHI5)</caption>
<tr>
<td style="text-align:center;">
Note: The JHI5 does not support HDF4 or earlier.
diff --git a/java/src/jni/CMakeLists.txt b/java/src/jni/CMakeLists.txt
index a0228e1..7b95e0b 100644
--- a/java/src/jni/CMakeLists.txt
+++ b/java/src/jni/CMakeLists.txt
@@ -50,22 +50,10 @@ set (CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE ON)
add_library (${HDF5_JAVA_JNI_LIB_TARGET} SHARED ${HDF5_JAVA_JNI_CSRCS} ${HDF5_JAVA_JNI_CHDRS})
target_include_directories(${HDF5_JAVA_JNI_LIB_TARGET} PRIVATE ${HDF5_BINARY_DIR} ${HDF5_JAVA_JNI_SOURCE_DIR})
TARGET_C_PROPERTIES (${HDF5_JAVA_JNI_LIB_TARGET} SHARED)
-target_link_libraries (${HDF5_JAVA_JNI_LIB_TARGET} PUBLIC ${HDF5_LIB_TARGET})
+target_link_libraries (${HDF5_JAVA_JNI_LIB_TARGET} PUBLIC ${HDF5_LIBSH_TARGET})
set_target_properties (${HDF5_JAVA_JNI_LIB_TARGET} PROPERTIES FOLDER libraries/jni)
SET_GLOBAL_VARIABLE (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_JAVA_JNI_LIB_TARGET}")
H5_SET_LIB_OPTIONS (${HDF5_JAVA_JNI_LIB_TARGET} ${HDF5_JAVA_JNI_LIB_NAME} SHARED "JAVA")
-if (WIN32)
- get_filename_component (HDF5_JAVA_JNI_DLL_NAME ${HDF5_JAVA_JNI_LIB_TARGET} NAME_WE)
- set (HDF5_JAVA_JNI_DLL_NAME "${HDF5_JAVA_JNI_DLL_NAME}$<$<CONFIG:Debug>:_D>")
- # message (STATUS "HDF5_JAVA_JNI_DLL_NAME: ${HDF5_JAVA_JNI_DLL_NAME}")
- if (BUILD_TESTING)
- add_custom_target (HDF5_JAVA_JNI-Test-Copy ALL
- COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/${HDF5_JAVA_JNI_DLL_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${HDF5_JAVA_JNI_DLL_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}
- COMMENT "Copying ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/${HDF5_JAVA_JNI_DLL_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX} to ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/"
- )
- add_dependencies (HDF5_JAVA_JNI-Test-Copy ${HDF5_JAVA_JNI_LIB_TARGET})
- endif ()
-endif ()
#-----------------------------------------------------------------------------
# Add Target(s) to CMake Install for import into other projects
diff --git a/java/src/jni/h5Imp.c b/java/src/jni/h5Imp.c
index 2eeb075..1ad6b17 100644
--- a/java/src/jni/h5Imp.c
+++ b/java/src/jni/h5Imp.c
@@ -36,7 +36,6 @@ extern "C" {
#include "h5Imp.h"
extern JavaVM *jvm;
-extern jobject visit_callback;
/*
* Class: hdf_hdf5lib_H5
diff --git a/java/src/jni/h5aImp.c b/java/src/jni/h5aImp.c
index c0dc182..aba2240 100644
--- a/java/src/jni/h5aImp.c
+++ b/java/src/jni/h5aImp.c
@@ -29,7 +29,11 @@ extern "C" {
#include "h5aImp.h"
extern JavaVM *jvm;
-extern jobject visit_callback;
+
+typedef struct _cb_wrapper {
+ jobject visit_callback;
+ jobject op_data;
+} cb_wrapper;
#ifdef __cplusplus
#define CBENVPTR (cbenv)
@@ -53,7 +57,8 @@ static herr_t H5AwriteVL_asstr (JNIEnv *env, hid_t attr_id, hid_t mem_id, jobjec
static herr_t H5AwriteVL_str (JNIEnv *env, hid_t attr_id, hid_t mem_id, jobjectArray buf);
static herr_t H5AreadVL_asstr (JNIEnv *env, hid_t attr_id, hid_t mem_id, jobjectArray buf);
static herr_t H5AreadVL_str (JNIEnv *env, hid_t attr_id, hid_t mem_id, jobjectArray buf);
-static herr_t H5A_iterate_cb(hid_t g_id, const char *name, const H5A_info_t *info, void *op_data);
+
+static herr_t H5A_iterate_cb(hid_t g_id, const char *name, const H5A_info_t *info, void *cb_data);
/*
@@ -1138,7 +1143,7 @@ Java_hdf_hdf5lib_H5__1H5Aget_1create_1plist
static herr_t
H5A_iterate_cb
- (hid_t g_id, const char *name, const H5A_info_t *info, void *op_data) {
+ (hid_t g_id, const char *name, const H5A_info_t *info, void *cb_data) {
JNIEnv *cbenv;
jint status = -1;
jclass cls;
@@ -1147,6 +1152,9 @@ H5A_iterate_cb
jmethodID constructor;
jvalue args[4];
jobject cb_info_t = NULL;
+ cb_wrapper *wrapper = (cb_wrapper *)cb_data;
+ void *op_data = (void *)wrapper->op_data;
+ jobject visit_callback = wrapper->visit_callback;
if(JVMPTR->AttachCurrentThread(JVMPAR2 (void**)&cbenv, NULL) == 0) {
cls = CBENVPTR->GetObjectClass(CBENVPAR visit_callback);
@@ -1195,14 +1203,14 @@ Java_hdf_hdf5lib_H5_H5Aiterate
hsize_t start_idx = (hsize_t)idx;
herr_t status = -1;
+ cb_wrapper wrapper = {callback_op, op_data};
ENVPTR->GetJavaVM(ENVPAR &jvm);
- visit_callback = callback_op;
if ((op_data == NULL) || (callback_op == NULL)) {
h5nullArgument(env, "H5Literate_by_name: op_data or callback_op is NULL");
} /* end if */
else {
- status = H5Aiterate2((hid_t)grp_id, (H5_index_t)idx_type, (H5_iter_order_t)order, (hsize_t*)&start_idx, (H5A_operator2_t)H5A_iterate_cb, (void*)op_data);
+ status = H5Aiterate2((hid_t)grp_id, (H5_index_t)idx_type, (H5_iter_order_t)order, (hsize_t*)&start_idx, (H5A_operator2_t)H5A_iterate_cb, (void*)&wrapper);
if (status < 0)
h5libraryError(env);
@@ -1224,9 +1232,9 @@ Java_hdf_hdf5lib_H5_H5Aiterate_1by_1name
const char *lName;
hsize_t start_idx = (hsize_t)idx;
herr_t status = -1;
+ cb_wrapper wrapper = {callback_op, op_data};
ENVPTR->GetJavaVM(ENVPAR &jvm);
- visit_callback = callback_op;
if ((op_data == NULL) || (callback_op == NULL)) {
h5nullArgument(env, "H5Literate_by_name: op_data or callback_op is NULL");
@@ -1234,7 +1242,7 @@ Java_hdf_hdf5lib_H5_H5Aiterate_1by_1name
else {
PIN_JAVA_STRING(name, lName);
if (lName != NULL) {
- status = H5Aiterate_by_name((hid_t)grp_id, lName, (H5_index_t)idx_type, (H5_iter_order_t)order, (hsize_t*)&start_idx, (H5A_operator2_t)H5A_iterate_cb, (void*)op_data, (hid_t)access_id);
+ status = H5Aiterate_by_name((hid_t)grp_id, lName, (H5_index_t)idx_type, (H5_iter_order_t)order, (hsize_t*)&start_idx, (H5A_operator2_t)H5A_iterate_cb, (void*)&wrapper, (hid_t)access_id);
UNPIN_JAVA_STRING(name, lName);
diff --git a/java/src/jni/h5dImp.c b/java/src/jni/h5dImp.c
index 205e9fb..652c873 100644
--- a/java/src/jni/h5dImp.c
+++ b/java/src/jni/h5dImp.c
@@ -30,7 +30,11 @@ extern "C" {
#include "h5dImp.h"
extern JavaVM *jvm;
-extern jobject visit_callback;
+
+typedef struct _cb_wrapper {
+ jobject visit_callback;
+ jobject op_data;
+} cb_wrapper;
#ifdef __cplusplus
#ifdef _WINDOWS
@@ -1105,7 +1109,7 @@ Java_hdf_hdf5lib_H5_H5Dwrite_1string
const char *utf8 = ENVPTR->GetStringUTFChars(ENVPAR obj, 0);
if (utf8) {
- strncpy(&c_buf[i * str_len], utf8, str_len);
+ HDstrncpy(&c_buf[i * str_len], utf8, str_len);
} /* end if */
ENVPTR->ReleaseStringUTFChars(ENVPAR obj, utf8);
@@ -1362,13 +1366,9 @@ Java_hdf_hdf5lib_H5_H5DwriteVL
isVlenStr = 1; /* strings created by H5Tvlen_create(H5T_C_S1) */
}
if (isStr == 0 || isComplex>0 || isVlenStr) {
- h5unimplemented(env, "H5DwriteVL: VL types, which are not string type, not implemented");
- status = -1;
-#ifdef notdef
status = H5DwriteVL_asstr(env, (hid_t)dataset_id, (hid_t)mem_type_id,
(hid_t)mem_space_id, (hid_t)file_space_id,
(hid_t)xfer_plist_id, buf);
-#endif
}
else if (isStr > 0) {
status = H5DwriteVL_str(env, (hid_t)dataset_id, (hid_t)mem_type_id,
@@ -1892,7 +1892,7 @@ Java_hdf_hdf5lib_H5_H5Dset_1extent
static herr_t
H5D_iterate_cb
- (void* elem, hid_t elem_id, unsigned ndim, const hsize_t *point, void *op_data) {
+ (void* elem, hid_t elem_id, unsigned ndim, const hsize_t *point, void *cb_data) {
JNIEnv *cbenv;
jint status;
jclass cls;
@@ -1900,6 +1900,9 @@ H5D_iterate_cb
jbyteArray elemArray;
jlongArray pointArray;
jsize size;
+ cb_wrapper *wrapper = (cb_wrapper *)cb_data;
+ void *op_data = (void *)wrapper->op_data;
+ jobject visit_callback = wrapper->visit_callback;
if(JVMPTR->AttachCurrentThread(JVMPAR2 (void**)&cbenv, NULL) != 0) {
JVMPTR->DetachCurrentThread(JVMPAR);
@@ -1962,9 +1965,9 @@ Java_hdf_hdf5lib_H5_H5Diterate
herr_t status = -1;
jboolean isCopy;
jbyte *buffP;
+ cb_wrapper wrapper = {callback_op, op_data};
ENVPTR->GetJavaVM(ENVPAR &jvm);
- visit_callback = callback_op;
if (op_data == NULL) {
h5nullArgument(env, "H5Diterate: op_data is NULL");
@@ -1981,7 +1984,7 @@ Java_hdf_hdf5lib_H5_H5Diterate
h5JNIFatalError(env, "H5Diterate: buf not pinned");
} /* end if */
else {
- status = H5Diterate((void*)buffP, (hid_t)buf_type, (hid_t)space, (H5D_operator_t)H5D_iterate_cb, (void*)op_data);
+ status = H5Diterate((void*)buffP, (hid_t)buf_type, (hid_t)space, (H5D_operator_t)H5D_iterate_cb, (void*)&wrapper);
if (status < 0) {
ENVPTR->ReleaseByteArrayElements(ENVPAR buf, buffP, JNI_ABORT);
diff --git a/java/src/jni/h5eImp.c b/java/src/jni/h5eImp.c
index 10a02b0..9c80461 100644
--- a/java/src/jni/h5eImp.c
+++ b/java/src/jni/h5eImp.c
@@ -40,7 +40,11 @@ extern "C" {
#include "h5eImp.h"
extern JavaVM *jvm;
-extern jobject visit_callback;
+
+typedef struct _cb_wrapper {
+ jobject visit_callback;
+ jobject op_data;
+} cb_wrapper;
#ifdef __cplusplus
#define CBENVPTR (cbenv)
@@ -60,7 +64,7 @@ extern jobject visit_callback;
/* Local Prototypes */
/********************/
-static herr_t H5E_walk_cb(int nindx, const H5E_error2_t *info, void *op_data);
+static herr_t H5E_walk_cb(int nindx, const H5E_error2_t *info, void *cb_data);
/*
* Class: hdf_hdf5lib_H5
@@ -475,7 +479,7 @@ Java_hdf_hdf5lib_H5_H5Eget_1num
static herr_t
H5E_walk_cb
- (int nindx, const H5E_error2_t *info, void *op_data)
+ (int nindx, const H5E_error2_t *info, void *cb_data)
{
JNIEnv *cbenv;
jint status = -1;
@@ -485,6 +489,9 @@ H5E_walk_cb
jmethodID constructor;
jvalue args[7];
jobject cb_info_t = NULL;
+ cb_wrapper *wrapper = (cb_wrapper *)cb_data;
+ void *op_data = (void *)wrapper->op_data;
+ jobject visit_callback = wrapper->visit_callback;
if(JVMPTR->AttachCurrentThread(JVMPAR2 (void**)&cbenv, NULL) == 0) {
cls = CBENVPTR->GetObjectClass(CBENVPAR visit_callback);
@@ -532,13 +539,14 @@ JNIEXPORT void JNICALL
Java_hdf_hdf5lib_H5_H5Ewalk2
(JNIEnv *env, jclass cls, jlong stk_id, jlong direction, jobject callback_op, jobject op_data)
{
+ cb_wrapper wrapper = {callback_op, op_data};
+
ENVPTR->GetJavaVM(ENVPAR &jvm);
- visit_callback = callback_op;
if ((op_data == NULL) || (callback_op == NULL)) {
h5nullArgument(env, "H5Ewalk2: op_data or callback_op is NULL");
} /* end if */
- else if (H5Ewalk2(stk_id, (H5E_direction_t)direction, (H5E_walk2_t)H5E_walk_cb, (void*)op_data) < 0)
+ else if (H5Ewalk2(stk_id, (H5E_direction_t)direction, (H5E_walk2_t)H5E_walk_cb, (void*)&wrapper) < 0)
h5libraryError(env);
} /* end iJava_hdf_hdf5lib_H5_H5Ewalk2f */
diff --git a/java/src/jni/h5fImp.c b/java/src/jni/h5fImp.c
index 8cf5252..9d68290 100644
--- a/java/src/jni/h5fImp.c
+++ b/java/src/jni/h5fImp.c
@@ -29,7 +29,6 @@ extern "C" {
#include "h5util.h"
extern JavaVM *jvm;
-extern jobject visit_callback;
/*
* Class: hdf_hdf5lib_H5
@@ -541,7 +540,7 @@ Java_hdf_hdf5lib_H5_H5Fclear_1elink_1file_1cache
*/
JNIEXPORT void JNICALL
Java_hdf_hdf5lib_H5_H5Fstart_1swmr_1write
- (JNIEnv *env, jclass cls, jlong file_id)
+ (JNIEnv *env, jclass cls, jlong file_id)
{
if (H5Fstart_swmr_write((hid_t)file_id) < 0)
h5libraryError(env);
@@ -554,7 +553,7 @@ Java_hdf_hdf5lib_H5_H5Fstart_1swmr_1write
*/
JNIEXPORT void JNICALL
Java_hdf_hdf5lib_H5_H5Fstart_1mdc_1logging
- (JNIEnv *env, jclass cls, jlong file_id)
+ (JNIEnv *env, jclass cls, jlong file_id)
{
if (H5Fstart_mdc_logging((hid_t)file_id) < 0)
h5libraryError(env);
@@ -580,7 +579,7 @@ Java_hdf_hdf5lib_H5_H5Fstop_1mdc_1logging
*/
JNIEXPORT void JNICALL
Java_hdf_hdf5lib_H5_H5Fget_1mdc_1logging_1status
- (JNIEnv *env, jclass cls, jlong file_id, jbooleanArray mdc_logging_status)
+ (JNIEnv *env, jclass cls, jlong file_id, jbooleanArray mdc_logging_status)
{
hbool_t is_enabled;
hbool_t is_currently_logging;
diff --git a/java/src/jni/h5gImp.c b/java/src/jni/h5gImp.c
index 41ec382..42c042a 100644
--- a/java/src/jni/h5gImp.c
+++ b/java/src/jni/h5gImp.c
@@ -30,7 +30,6 @@ extern "C" {
#include "h5gImp.h"
extern JavaVM *jvm;
-extern jobject visit_callback;
/*
* Class: hdf_hdf5lib_H5
diff --git a/java/src/jni/h5iImp.c b/java/src/jni/h5iImp.c
index 47574ca..b8bd1cd 100644
--- a/java/src/jni/h5iImp.c
+++ b/java/src/jni/h5iImp.c
@@ -28,7 +28,6 @@ extern "C" {
#include "h5iImp.h"
extern JavaVM *jvm;
-extern jobject visit_callback;
/*
* Class: hdf_hdf5lib_H5
diff --git a/java/src/jni/h5lImp.c b/java/src/jni/h5lImp.c
index f1734fd..e1ec3bd 100644
--- a/java/src/jni/h5lImp.c
+++ b/java/src/jni/h5lImp.c
@@ -28,13 +28,17 @@ extern "C" {
#include "h5lImp.h"
extern JavaVM *jvm;
-extern jobject visit_callback;
+
+typedef struct _cb_wrapper {
+ jobject visit_callback;
+ jobject op_data;
+} cb_wrapper;
/********************/
/* Local Prototypes */
/********************/
-static herr_t H5L_iterate_cb(hid_t g_id, const char *name, const H5L_info_t *info, void *op_data);
+static herr_t H5L_iterate_cb(hid_t g_id, const char *name, const H5L_info_t *info, void *cb_data);
/*
* Class: hdf_hdf5lib_H5
@@ -541,7 +545,7 @@ Java_hdf_hdf5lib_H5_H5Lmove
static herr_t
H5L_iterate_cb
- (hid_t g_id, const char *name, const H5L_info_t *info, void *op_data)
+ (hid_t g_id, const char *name, const H5L_info_t *info, void *cb_data)
{
JNIEnv *cbenv;
jint status;
@@ -551,6 +555,9 @@ H5L_iterate_cb
jmethodID constructor;
jvalue args[5];
jobject cb_info_t = NULL;
+ cb_wrapper *wrapper = (cb_wrapper *)cb_data;
+ void *op_data = (void *)wrapper->op_data;
+ jobject visit_callback = wrapper->visit_callback;
if(JVMPTR->AttachCurrentThread(JVMPAR2 (void**)&cbenv, NULL) == 0) {
cls = CBENVPTR->GetObjectClass(CBENVPAR visit_callback);
@@ -600,15 +607,15 @@ Java_hdf_hdf5lib_H5_H5Lvisit
jobject callback_op, jobject op_data)
{
herr_t status = -1;
+ cb_wrapper wrapper = {callback_op, op_data};
ENVPTR->GetJavaVM(ENVPAR &jvm);
- visit_callback = callback_op;
if ((op_data == NULL) || (callback_op == NULL)) {
h5nullArgument(env, "H5Lvisit: op_data or callback_op is NULL");
} /* end if */
else {
- status = H5Lvisit((hid_t)grp_id, (H5_index_t)idx_type, (H5_iter_order_t)order, (H5L_iterate_t)H5L_iterate_cb, (void*)op_data);
+ status = H5Lvisit((hid_t)grp_id, (H5_index_t)idx_type, (H5_iter_order_t)order, (H5L_iterate_t)H5L_iterate_cb, (void*)&wrapper);
if (status < 0)
h5libraryError(env);
} /* end else */
@@ -628,9 +635,9 @@ Java_hdf_hdf5lib_H5_H5Lvisit_1by_1name
{
herr_t status = -1;
const char *lName;
+ cb_wrapper wrapper = {callback_op, op_data};
ENVPTR->GetJavaVM(ENVPAR &jvm);
- visit_callback = callback_op;
if ((op_data == NULL) || (callback_op == NULL)) {
h5nullArgument(env, "H5Lvisit_by_name: op_data or callback_op is NULL");
@@ -638,7 +645,7 @@ Java_hdf_hdf5lib_H5_H5Lvisit_1by_1name
else {
PIN_JAVA_STRING(name, lName);
if (lName != NULL) {
- status = H5Lvisit_by_name((hid_t)grp_id, lName, (H5_index_t)idx_type, (H5_iter_order_t)order, (H5L_iterate_t)H5L_iterate_cb, (void*)op_data, (hid_t)access_id);
+ status = H5Lvisit_by_name((hid_t)grp_id, lName, (H5_index_t)idx_type, (H5_iter_order_t)order, (H5L_iterate_t)H5L_iterate_cb, (void*)&wrapper, (hid_t)access_id);
UNPIN_JAVA_STRING(name, lName);
@@ -662,15 +669,15 @@ Java_hdf_hdf5lib_H5_H5Literate
{
hsize_t start_idx = (hsize_t)idx;
herr_t status = -1;
+ cb_wrapper wrapper = {callback_op, op_data};
ENVPTR->GetJavaVM(ENVPAR &jvm);
- visit_callback = callback_op;
if ((op_data == NULL) || (callback_op == NULL)) {
h5nullArgument(env, "H5Literate: op_data or callback_op is NULL");
} /* end if */
else {
- status = H5Literate((hid_t)grp_id, (H5_index_t)idx_type, (H5_iter_order_t)order, (hsize_t*)&start_idx, (H5L_iterate_t)H5L_iterate_cb, (void*)op_data);
+ status = H5Literate((hid_t)grp_id, (H5_index_t)idx_type, (H5_iter_order_t)order, (hsize_t*)&start_idx, (H5L_iterate_t)H5L_iterate_cb, (void*)&wrapper);
if (status < 0)
h5libraryError(env);
@@ -694,7 +701,7 @@ Java_hdf_hdf5lib_H5_H5Literate_1by_1name
const char *lName;
ENVPTR->GetJavaVM(ENVPAR &jvm);
- visit_callback = callback_op;
+ cb_wrapper wrapper = {callback_op, op_data};
if ((op_data == NULL) || (callback_op == NULL)) {
h5nullArgument(env, "H5Literate_by_name: op_data or callback_op is NULL");
@@ -702,7 +709,7 @@ Java_hdf_hdf5lib_H5_H5Literate_1by_1name
else {
PIN_JAVA_STRING(name, lName);
if (lName != NULL) {
- status = H5Literate_by_name((hid_t)grp_id, lName, (H5_index_t)idx_type, (H5_iter_order_t)order, (hsize_t*)&start_idx, (H5L_iterate_t)H5L_iterate_cb, (void*)op_data, (hid_t)access_id);
+ status = H5Literate_by_name((hid_t)grp_id, lName, (H5_index_t)idx_type, (H5_iter_order_t)order, (hsize_t*)&start_idx, (H5L_iterate_t)H5L_iterate_cb, (void*)&wrapper, (hid_t)access_id);
UNPIN_JAVA_STRING(name, lName);
diff --git a/java/src/jni/h5oImp.c b/java/src/jni/h5oImp.c
index 6093e46..1de505a 100644
--- a/java/src/jni/h5oImp.c
+++ b/java/src/jni/h5oImp.c
@@ -27,13 +27,17 @@ extern "C" {
#include "h5oImp.h"
extern JavaVM *jvm;
-extern jobject visit_callback;
+
+typedef struct _cb_wrapper {
+ jobject visit_callback;
+ jobject op_data;
+} cb_wrapper;
/********************/
/* Local Prototypes */
/********************/
-static herr_t H5O_iterate_cb(hid_t g_id, const char *name, const H5O_info_t *info, void *op_data);
+static herr_t H5O_iterate_cb(hid_t g_id, const char *name, const H5O_info_t *info, void *cb_data);
/*
* Class: hdf_hdf5lib_H5
@@ -330,7 +334,7 @@ Java_hdf_hdf5lib_H5_H5Olink
static herr_t
H5O_iterate_cb
- (hid_t g_id, const char *name, const H5O_info_t *info, void *op_data)
+ (hid_t g_id, const char *name, const H5O_info_t *info, void *cb_data)
{
JNIEnv *cbenv;
jint status = -1;
@@ -343,6 +347,9 @@ H5O_iterate_cb
jobject ihinfobuf1;
jobject ihinfobuf2;
jobject cb_info_t = NULL;
+ cb_wrapper *wrapper = (cb_wrapper *)cb_data;
+ void *op_data = (void *)wrapper->op_data;
+ jobject visit_callback = wrapper->visit_callback;
if(JVMPTR->AttachCurrentThread(JVMPAR2 (void**)&cbenv, NULL) != 0) {
/* printf("JNI H5O_iterate_cb error: AttachCurrentThread failed\n"); */
@@ -448,9 +455,9 @@ Java_hdf_hdf5lib_H5_H5Ovisit
jobject callback_op, jobject op_data, jint fields)
{
herr_t status = -1;
+ cb_wrapper wrapper = {callback_op, op_data};
ENVPTR->GetJavaVM(ENVPAR &jvm);
- visit_callback = callback_op;
if (op_data == NULL) {
h5nullArgument(env, "H5Ovisit: op_data is NULL");
@@ -459,7 +466,7 @@ Java_hdf_hdf5lib_H5_H5Ovisit
h5nullArgument(env, "H5Ovisit: callback_op is NULL");
} /* end if */
else {
- status = H5Ovisit2((hid_t)grp_id, (H5_index_t)idx_type, (H5_iter_order_t)order, (H5O_iterate_t)H5O_iterate_cb, (void*)op_data, (unsigned)fields);
+ status = H5Ovisit2((hid_t)grp_id, (H5_index_t)idx_type, (H5_iter_order_t)order, (H5O_iterate_t)H5O_iterate_cb, (void*)&wrapper, (unsigned)fields);
if (status < 0)
h5libraryError(env);
@@ -480,9 +487,9 @@ Java_hdf_hdf5lib_H5_H5Ovisit_1by_1name
{
herr_t status = -1;
const char *lName;
+ cb_wrapper wrapper = {callback_op, op_data};
ENVPTR->GetJavaVM(ENVPAR &jvm);
- visit_callback = callback_op;
if (op_data == NULL) {
h5nullArgument(env, "H5Ovisit_by_name: op_data is NULL");
@@ -495,7 +502,7 @@ Java_hdf_hdf5lib_H5_H5Ovisit_1by_1name
else {
PIN_JAVA_STRING(name, lName);
if (lName != NULL) {
- status = H5Ovisit_by_name2((hid_t)grp_id, lName, (H5_index_t)idx_type, (H5_iter_order_t)order, (H5O_iterate_t)H5O_iterate_cb, (void*)op_data, (unsigned)fields, (hid_t)access_id);
+ status = H5Ovisit_by_name2((hid_t)grp_id, lName, (H5_index_t)idx_type, (H5_iter_order_t)order, (H5O_iterate_t)H5O_iterate_cb, (void*)&wrapper, (unsigned)fields, (hid_t)access_id);
UNPIN_JAVA_STRING(name, lName);
diff --git a/java/src/jni/h5pImp.c b/java/src/jni/h5pImp.c
index 3ff7436..52008ce 100644
--- a/java/src/jni/h5pImp.c
+++ b/java/src/jni/h5pImp.c
@@ -27,7 +27,6 @@ extern "C" {
#include "h5pImp.h"
extern JavaVM *jvm;
-extern jobject visit_callback;
extern jobject copy_callback;
extern jobject close_callback;
extern jobject create_callback;
@@ -36,6 +35,11 @@ extern jobject get_callback;
extern jobject set_callback;
extern jobject delete_callback;
+typedef struct _cb_wrapper {
+ jobject visit_callback;
+ jobject op_data;
+} cb_wrapper;
+
/********************/
/* Local Prototypes */
/********************/
@@ -52,7 +56,7 @@ static herr_t H5P_prp_get_func_cb(hid_t prop_id, const char *name, size_t size,
static herr_t H5P_prp_set_func_cb(hid_t prop_id, const char *name, size_t size, void *value);
static herr_t H5P_prp_delete_func_cb(hid_t prop_id, const char *name, size_t size, void *value);
-static herr_t H5P_iterate_cb(hid_t prop_id, const char *name, void *op_data);
+static herr_t H5P_iterate_cb(hid_t prop_id, const char *name, void *cb_data);
/*
* Class: hdf_hdf5lib_H5
@@ -3877,7 +3881,7 @@ Java_hdf_hdf5lib_H5_H5Pset_1fapl_1multi
const char *utf8 = ENVPTR->GetStringUTFChars(ENVPAR obj, 0);
if (utf8) {
- member_name[i] = (char*)HDmalloc(strlen(utf8) + 1);
+ member_name[i] = (char*)HDmalloc(HDstrlen(utf8) + 1);
if (member_name[i]) {
strcpy(member_name[i], utf8);
} /* end if */
@@ -4185,7 +4189,7 @@ Java_hdf_hdf5lib_H5_H5Pset_1mdc_1config
h5JNIFatalError(env, "H5Pset_mdc_config: out of memory trace_file_name");
return;
} /* end if */
- strncpy(cacheinfo.trace_file_name, str, 1025);
+ HDstrncpy(cacheinfo.trace_file_name, str, 1025);
ENVPTR->ReleaseStringUTFChars(ENVPAR j_str, str);
if(ENVPTR->ExceptionOccurred(ENVONLY)) {
h5JNIFatalError(env, "H5Pset_mdc_config: loading trace_file_name failed");
@@ -5042,7 +5046,7 @@ H5P_cls_copy_cb
} /* end if */
JVMPTR->DetachCurrentThread(JVMPAR);
return (herr_t)status;
-} /* end H5P_cls_ccopy_cb */
+} /* end H5P_cls_copy_cb */
static herr_t
H5P_cls_close_cb
@@ -5158,13 +5162,16 @@ Java_hdf_hdf5lib_H5_H5Pget_1mdc_1log_1options
static herr_t
H5D_append_cb
- (hid_t dataset_id, hsize_t *cur_dims, void *op_data)
+ (hid_t dataset_id, hsize_t *cur_dims, void *cb_data)
{
JNIEnv *cbenv;
jint status = -1;
jclass cls;
jmethodID mid;
jlongArray cur_dimsArray;
+ cb_wrapper *wrapper = (cb_wrapper *)cb_data;
+ void *op_data = (void *)wrapper->op_data;
+ jobject visit_callback = wrapper->visit_callback;
if(JVMPTR->AttachCurrentThread(JVMPAR2 (void**)&cbenv, NULL) != 0) {
JVMPTR->DetachCurrentThread(JVMPAR);
@@ -5199,9 +5206,9 @@ Java_hdf_hdf5lib_H5_H5Pset_1append_1flush
(JNIEnv *env, jclass clss, jlong plist_id, jint ndims, jlongArray boundary, jobject callback_op, jobject op_data)
{
herr_t status = -1;
+ cb_wrapper wrapper = {callback_op, op_data};
ENVPTR->GetJavaVM(ENVPAR &jvm);
- visit_callback = callback_op;
if (op_data == NULL) {
h5nullArgument(env, "H5Pset_append_flush: op_data is NULL");
@@ -5210,7 +5217,7 @@ Java_hdf_hdf5lib_H5_H5Pset_1append_1flush
h5nullArgument(env, "H5Pset_append_flush: callback_op is NULL");
} /* end if */
else {
- status = H5Pset_append_flush((hid_t)plist_id, (unsigned)ndims, (const hsize_t*)boundary, (H5D_append_cb_t)H5D_append_cb, (void*)op_data);
+ status = H5Pset_append_flush((hid_t)plist_id, (unsigned)ndims, (const hsize_t*)boundary, (H5D_append_cb_t)H5D_append_cb, (void*)&wrapper);
if (status < 0)
h5libraryError(env);
@@ -5603,13 +5610,16 @@ Java_hdf_hdf5lib_H5_H5Pinsert2
static herr_t
H5P_iterate_cb
- (hid_t prop_id, const char *name, void *op_data)
+ (hid_t prop_id, const char *name, void *cb_data)
{
JNIEnv *cbenv;
jint status = -1;
jclass cls;
jmethodID mid;
jstring str;
+ cb_wrapper *wrapper = (cb_wrapper *)cb_data;
+ void *op_data = (void *)wrapper->op_data;
+ jobject visit_callback = wrapper->visit_callback;
/* fprintf(stderr, "\nJNI H5P_iterate_cb entered\n"); fflush(stderr); */
if(JVMPTR->AttachCurrentThread(JVMPAR2 (void**)&cbenv, NULL) != 0) {
@@ -5656,9 +5666,9 @@ Java_hdf_hdf5lib_H5_H5Piterate
herr_t status = -1;
jint *theArray = NULL;
jboolean isCopy;
+ cb_wrapper wrapper = {callback_op, op_data};
ENVPTR->GetJavaVM(ENVPAR &jvm);
- visit_callback = callback_op;
if (op_data == NULL) {
h5nullArgument(env, "H5Piterate: op_data is NULL");
@@ -5668,7 +5678,7 @@ Java_hdf_hdf5lib_H5_H5Piterate
} /* end else if */
else {
if (idx == NULL) {
- status = H5Piterate((hid_t)prop_id, NULL, (H5P_iterate_t)H5P_iterate_cb, (void*)op_data);
+ status = H5Piterate((hid_t)prop_id, NULL, (H5P_iterate_t)H5P_iterate_cb, (void*)&wrapper);
} /* end if */
else {
theArray = (jint *)ENVPTR->GetIntArrayElements(ENVPAR idx, &isCopy);
@@ -5676,7 +5686,7 @@ Java_hdf_hdf5lib_H5_H5Piterate
h5JNIFatalError(env, "H5Piterate: idx not pinned");
} /* end if */
else
- status = H5Piterate((hid_t)prop_id, (int*)&theArray[0], (H5P_iterate_t)H5P_iterate_cb, (void*)op_data);
+ status = H5Piterate((hid_t)prop_id, (int*)&theArray[0], (H5P_iterate_t)H5P_iterate_cb, (void*)&wrapper);
} /* end else */
if (status < 0) {
diff --git a/java/src/jni/h5plImp.c b/java/src/jni/h5plImp.c
index ffd5b7a..d551120 100644
--- a/java/src/jni/h5plImp.c
+++ b/java/src/jni/h5plImp.c
@@ -27,7 +27,6 @@ extern "C" {
#include "h5plImp.h"
extern JavaVM *jvm;
-extern jobject visit_callback;
/*
* Class: hdf_hdf5lib_H5
diff --git a/java/src/jni/h5rImp.c b/java/src/jni/h5rImp.c
index b250550..5f2b86d 100644
--- a/java/src/jni/h5rImp.c
+++ b/java/src/jni/h5rImp.c
@@ -27,7 +27,6 @@ extern "C" {
#include "h5rImp.h"
extern JavaVM *jvm;
-extern jobject visit_callback;
/*
diff --git a/java/src/jni/h5sImp.c b/java/src/jni/h5sImp.c
index 10f69eb..65cdd7b 100644
--- a/java/src/jni/h5sImp.c
+++ b/java/src/jni/h5sImp.c
@@ -27,7 +27,6 @@ extern "C" {
#include "h5sImp.h"
extern JavaVM *jvm;
-extern jobject visit_callback;
/*
* Class: hdf_hdf5lib_H5
@@ -572,7 +571,7 @@ Java_hdf_hdf5lib_H5_H5Sset_1extent_1simple
h5JNIFatalError(env, "H5Pset_simple_extent: dims not pinned");
return -1;
} /* end if */
- sa = lp = (hsize_t *) malloc((size_t)rank * sizeof(hsize_t));
+ sa = lp = (hsize_t *) HDmalloc((size_t)rank * sizeof(hsize_t));
if (sa == NULL) {
ENVPTR->ReleaseLongArrayElements(ENVPAR dims, dimsP, JNI_ABORT);
h5JNIFatalError(env, "H5Sset_simple_extent: dims not converted to hsize_t");
@@ -1018,7 +1017,7 @@ Java_hdf_hdf5lib_H5_H5Sget_1select_1hyper_1blocklist
h5JNIFatalError(env, "H5Sget_select_hyper_blocklist: buf not pinned");
} /* end if */
else {
- ba = (hsize_t *) malloc((size_t)nb * 2 * (size_t)rank * sizeof(hsize_t));
+ ba = (hsize_t *) HDmalloc((size_t)nb * 2 * (size_t)rank * sizeof(hsize_t));
if (ba == NULL) {
ENVPTR->ReleaseLongArrayElements(ENVPAR buf, bufP, JNI_ABORT);
h5JNIFatalError(env, "H5Screate-simple: buffer not converted to hsize_t");
@@ -1136,7 +1135,7 @@ Java_hdf_hdf5lib_H5_H5Sget_1select_1bounds
return -1;
} /* end if */
rank = (int) ENVPTR->GetArrayLength(ENVPAR start);
- strt = (hsize_t *)malloc((size_t)rank * sizeof(hsize_t));
+ strt = (hsize_t *)HDmalloc((size_t)rank * sizeof(hsize_t));
if (strt == NULL) {
ENVPTR->ReleaseLongArrayElements(ENVPAR start, startP, JNI_ABORT);
h5JNIFatalError(env, "H5Sget_select_bounds: start not converted to hsize_t");
diff --git a/java/src/jni/h5tImp.c b/java/src/jni/h5tImp.c
index 7b4af56..307f1a5 100644
--- a/java/src/jni/h5tImp.c
+++ b/java/src/jni/h5tImp.c
@@ -30,7 +30,6 @@ extern "C" {
#include "h5tImp.h"
extern JavaVM *jvm;
-extern jobject visit_callback;
/*
* Class: hdf_hdf5lib_H5
diff --git a/java/src/jni/h5util.c b/java/src/jni/h5util.c
index 33dca7f..fd34ba1 100644
--- a/java/src/jni/h5util.c
+++ b/java/src/jni/h5util.c
@@ -33,7 +33,6 @@ hsize_t H5TOOLS_BUFSIZE = (32 * 1024 * 1024); /* 32 MB */
int H5TOOLS_TEXT_BLOCK = 16; /* Number of elements on a line in a text export file */
JavaVM *jvm;
-jobject visit_callback;
jobject copy_callback;
jobject close_callback;
jobject create_callback;
@@ -1769,7 +1768,7 @@ h5str_render_bin_output
if (H5Tis_variable_str(tid)) {
s = *(char**) mem;
if (s != NULL)
- size = strlen(s);
+ size = HDstrlen(s);
}
else {
s = (char *) mem;
@@ -2130,11 +2129,11 @@ render_bin_output_region_data_points
ret_value = -1;
HDfree(dims1);
- } /* end if((dims1 = (hsize_t *) malloc(sizeof(hsize_t) * ndims)) != NULL) */
+ } /* end if((dims1 = (hsize_t *) HDmalloc(sizeof(hsize_t) * ndims)) != NULL) */
else
ret_value = -1;
HDfree(region_buf);
- } /* end if((region_buf = malloc(type_size * (size_t)npoints)) != NULL) */
+ } /* end if((region_buf = HDmalloc(type_size * (size_t)npoints)) != NULL) */
else
ret_value = -1;
@@ -2437,7 +2436,7 @@ Java_hdf_hdf5lib_H5_H5AreadComplex
H5Tclose(p_type);
n = ENVPTR->GetArrayLength(ENVPAR buf);
- rdata = (char *)malloc((size_t)n * size);
+ rdata = (char *)HDmalloc((size_t)n * size);
if (rdata == NULL) {
h5JNIFatalError(env, "H5AreadComplex: failed to allocate buff for read");
} /* end if */
@@ -2953,7 +2952,7 @@ obj_info_all
if (retVal < 0) {
*(datainfo->otype+datainfo->count) = -1;
*(datainfo->ltype+datainfo->count) = -1;
- *(datainfo->objname+datainfo->count) = (char *)HDmalloc(strlen(name)+1);
+ *(datainfo->objname+datainfo->count) = (char *)HDmalloc(HDstrlen(name)+1);
HDstrcpy(*(datainfo->objname+datainfo->count), name);
*(datainfo->objno+datainfo->count) = (unsigned long)-1;
} /* end if */
diff --git a/java/test/TestH5.java b/java/test/TestH5.java
index 154390d..8fe4a56 100644
--- a/java/test/TestH5.java
+++ b/java/test/TestH5.java
@@ -162,7 +162,7 @@ public class TestH5 {
*/
@Test
public void testH5get_libversion() {
- int libversion[] = { 1, 10, 3 };
+ int libversion[] = { 1, 10, 4 };
try {
H5.H5get_libversion(libversion);
@@ -184,7 +184,7 @@ public class TestH5 {
*/
@Test
public void testH5check_version() {
- int majnum = 1, minnum = 10, relnum = 3;
+ int majnum = 1, minnum = 10, relnum = 4;
try {
H5.H5check_version(majnum, minnum, relnum);
diff --git a/java/test/TestH5E.java b/java/test/TestH5E.java
index 656069a..59ff50e 100644
--- a/java/test/TestH5E.java
+++ b/java/test/TestH5E.java
@@ -37,6 +37,10 @@ import org.junit.rules.TestName;
public class TestH5E {
@Rule public TestName testname = new TestName();
+
+ public static final int ERRSTACK_CNT = 4;
+ public static final int ERRSTACK_MTY_CNT = 0;
+
long hdf_java_classid = -1;
long current_stackid = -1;
@@ -158,7 +162,7 @@ public class TestH5E {
fail("H5.H5Epop: " + err);
}
- assertTrue("H5.H5Epop #:" + num_msg, num_msg == 0);
+ assertTrue("H5.H5Epop #:" + num_msg, num_msg == TestH5E.ERRSTACK_MTY_CNT);
try {
num_msg = H5.H5Eget_num(current_stackid);
@@ -168,7 +172,7 @@ public class TestH5E {
fail("H5.H5Epop: " + err);
}
- assertTrue("H5.H5Epop #:" + num_msg, num_msg == 4);
+ assertTrue("H5.H5Epop #:" + num_msg, num_msg == TestH5E.ERRSTACK_CNT);
try {
H5.H5Epop(current_stackid, 1);
@@ -186,7 +190,7 @@ public class TestH5E {
fail("H5.H5Epop: " + err);
}
- assertTrue("H5.H5Epop", num_msg == 3);
+ assertTrue("H5.H5Epop", num_msg == TestH5E.ERRSTACK_CNT - 1);
}
@Test
@@ -227,7 +231,7 @@ public class TestH5E {
try {
num_msg = H5.H5Eget_num(estack_id);
- assertTrue("testH5Epush #:" + num_msg, num_msg == 0);
+ assertTrue("testH5Epush #:" + num_msg, num_msg == TestH5E.ERRSTACK_MTY_CNT);
}
catch (Throwable err) {
err.printStackTrace();
@@ -238,7 +242,7 @@ public class TestH5E {
try {
num_msg = H5.H5Eget_num(estack_id);
- assertTrue("testH5Epush #:" + num_msg, num_msg == 1);
+ assertTrue("testH5Epush #:" + num_msg, num_msg == TestH5E.ERRSTACK_MTY_CNT + 1);
}
catch (Throwable err) {
err.printStackTrace();
@@ -314,7 +318,7 @@ public class TestH5E {
err.printStackTrace();
fail("testH5Ewalk:H5Eget_num " + err);
}
- assertTrue("testH5Ewalk #:" + num_msg, num_msg == 4);
+ assertTrue("testH5Ewalk #:" + num_msg, num_msg == TestH5E.ERRSTACK_CNT);
try {
H5.H5Ewalk2(current_stackid, HDF5Constants.H5E_WALK_UPWARD, walk_cb, walk_data);
@@ -324,7 +328,7 @@ public class TestH5E {
fail("testH5Ewalk:H5Ewalk2 " + err);
}
assertFalse("testH5Ewalk:H5Ewalk2 ",((H5E_walk_data)walk_data).walkdata.isEmpty());
- assertTrue("testH5Ewalk:H5Ewalk2 "+((H5E_walk_data)walk_data).walkdata.size(),((H5E_walk_data)walk_data).walkdata.size()==4);
+ assertTrue("testH5Ewalk:H5Ewalk2 "+((H5E_walk_data)walk_data).walkdata.size(),((H5E_walk_data)walk_data).walkdata.size()==TestH5E.ERRSTACK_CNT);
}
}
diff --git a/java/test/TestH5Edefault.java b/java/test/TestH5Edefault.java
index 5324d3a..a3057c6 100644
--- a/java/test/TestH5Edefault.java
+++ b/java/test/TestH5Edefault.java
@@ -29,6 +29,9 @@ import org.junit.rules.TestName;
public class TestH5Edefault {
@Rule public TestName testname = new TestName();
+ public static final int ERRSTACK_CNT = 4;
+ public static final int ERRSTACK_MTY_CNT = 0;
+
@Before
public void H5Eset_default_stack() {
assertTrue("H5 open ids is 0",H5.getOpenIDCount()==0);
@@ -91,7 +94,7 @@ public class TestH5Edefault {
err.printStackTrace();
fail("H5.H5Eget_current_stack: " + err);
}
- assertTrue("H5.H5Eget_current_stack: get_num #:" + num_msg_default, num_msg_default == 4);
+ assertTrue("H5.H5Eget_current_stack: get_num #:" + num_msg_default, num_msg_default == TestH5Edefault.ERRSTACK_CNT);
//Save a copy of the current stack and clears the current stack
try {
@@ -122,7 +125,7 @@ public class TestH5Edefault {
err.printStackTrace();
fail("H5.H5Eget_current_stack: " + err);
}
- assertTrue("H5.H5Eget_current_stack: get_num #:" + num_msg, num_msg == 4);
+ assertTrue("H5.H5Eget_current_stack: get_num #:" + num_msg, num_msg == TestH5Edefault.ERRSTACK_CNT);
try {
H5.H5Eclose_stack(stack_id);
@@ -153,7 +156,7 @@ public class TestH5Edefault {
err.printStackTrace();
fail("H5.H5Eget_current_stack: " + err);
}
- assertTrue("H5.H5Eget_current_stack: get_num #:" + num_msg_default, num_msg_default == 4);
+ assertTrue("H5.H5Eget_current_stack: get_num #:" + num_msg_default, num_msg_default == TestH5Edefault.ERRSTACK_CNT);
//Save a copy of the current stack and clears the current stack
try {
@@ -174,7 +177,7 @@ public class TestH5Edefault {
err.printStackTrace();
fail("H5.H5Eget_current_stack: " + err);
}
- assertTrue("H5.H5Eget_current_stack: get_num #:" + num_msg_default, num_msg_default == 0);
+ assertTrue("H5.H5Eget_current_stack: get_num #:" + num_msg_default, num_msg_default == TestH5Edefault.ERRSTACK_MTY_CNT);
//Verify the copy has the correct number of messages
try {
@@ -184,7 +187,7 @@ public class TestH5Edefault {
err.printStackTrace();
fail("H5.H5Eget_current_stack: " + err);
}
- assertTrue("H5.H5Eget_current_stack: get_num #:" + num_msg, num_msg == 4);
+ assertTrue("H5.H5Eget_current_stack: get_num #:" + num_msg, num_msg == TestH5Edefault.ERRSTACK_CNT);
//Generate errors on default stack
try {
@@ -202,7 +205,7 @@ public class TestH5Edefault {
err.printStackTrace();
fail("H5.H5Eget_current_stack: " + err);
}
- assertTrue("H5.H5Eget_current_stack: get_num #:" + num_msg_default, num_msg_default == 4);
+ assertTrue("H5.H5Eget_current_stack: get_num #:" + num_msg_default, num_msg_default == TestH5Edefault.ERRSTACK_CNT);
//Remove one message from the current stack
try {
@@ -213,7 +216,7 @@ public class TestH5Edefault {
err.printStackTrace();
fail("H5.H5Eget_current_stack: " + err);
}
- assertTrue("H5.H5Eget_current_stack: pop #:" + num_msg_default, num_msg_default == 3);
+ assertTrue("H5.H5Eget_current_stack: pop #:" + num_msg_default, num_msg_default == TestH5Edefault.ERRSTACK_CNT - 1);
//Verify the copy still has the correct number of messages
try {
@@ -223,7 +226,7 @@ public class TestH5Edefault {
err.printStackTrace();
fail("H5.H5Eget_current_stack: " + err);
}
- assertTrue("H5.H5Eget_current_stack: get_num #:" + num_msg, num_msg == 4);
+ assertTrue("H5.H5Eget_current_stack: get_num #:" + num_msg, num_msg == TestH5Edefault.ERRSTACK_CNT);
}
@Test(expected = IllegalArgumentException.class)
@@ -293,7 +296,7 @@ public class TestH5Edefault {
err.printStackTrace();
fail("H5.H5Eset_current_stack: " + err);
}
- assertTrue("H5.H5Eset_current_stack: get_num #:" + num_msg, num_msg == 4);
+ assertTrue("H5.H5Eset_current_stack: get_num #:" + num_msg, num_msg == TestH5Edefault.ERRSTACK_CNT);
//Save a copy of the current stack
try {
@@ -314,7 +317,7 @@ public class TestH5Edefault {
err.printStackTrace();
fail("H5.H5Eset_current_stack: " + err);
}
- assertTrue("H5.H5Eset_current_stack: get_num #:" + num_msg, num_msg == 4);
+ assertTrue("H5.H5Eset_current_stack: get_num #:" + num_msg, num_msg == TestH5Edefault.ERRSTACK_CNT);
//Generate errors on default stack
try {
@@ -332,7 +335,7 @@ public class TestH5Edefault {
err.printStackTrace();
fail("H5.H5Eget_current_stack: " + err);
}
- assertTrue("H5.H5Eset_current_stack: get_num #:" + num_msg, num_msg == 4);
+ assertTrue("H5.H5Eset_current_stack: get_num #:" + num_msg, num_msg == TestH5Edefault.ERRSTACK_CNT);
//Remove one message from the current stack
try {
@@ -343,7 +346,7 @@ public class TestH5Edefault {
err.printStackTrace();
fail("H5.H5Eset_current_stack: " + err);
}
- assertTrue("H5.H5Eset_current_stack: pop #:" + num_msg, num_msg == 3);
+ assertTrue("H5.H5Eset_current_stack: pop #:" + num_msg, num_msg == TestH5Edefault.ERRSTACK_CNT - 1);
//Verify the copy still has the correct number of messages
try {
@@ -353,7 +356,7 @@ public class TestH5Edefault {
err.printStackTrace();
fail("H5.H5Eset_current_stack: " + err);
}
- assertTrue("H5.H5Eset_current_stack: get_num #:" + num_msg, num_msg == 4);
+ assertTrue("H5.H5Eset_current_stack: get_num #:" + num_msg, num_msg == TestH5Edefault.ERRSTACK_CNT);
try {
H5.H5Eset_current_stack(stack_id);
@@ -363,7 +366,7 @@ public class TestH5Edefault {
err.printStackTrace();
fail("H5.H5Eset_current_stack: " + err);
}
- assertTrue("H5.H5Eset_current_stack: get_num - " + num_msg, num_msg == 4);
+ assertTrue("H5.H5Eset_current_stack: get_num - " + num_msg, num_msg == TestH5Edefault.ERRSTACK_CNT);
}
@Test(expected = IllegalArgumentException.class)
@@ -386,7 +389,7 @@ public class TestH5Edefault {
err.printStackTrace();
fail("H5.H5Epop: " + err);
}
- assertTrue("H5.H5Epop before #:" + num_msg, num_msg == 4);
+ assertTrue("H5.H5Epop before #:" + num_msg, num_msg == TestH5Edefault.ERRSTACK_CNT);
try {
H5.H5Epop(HDF5Constants.H5E_DEFAULT, 1);
num_msg = H5.H5Eget_num(HDF5Constants.H5E_DEFAULT);
@@ -395,7 +398,7 @@ public class TestH5Edefault {
err.printStackTrace();
fail("H5.H5Epop: " + err);
}
- assertTrue("H5.H5Epop after #:" + num_msg, num_msg == 3);
+ assertTrue("H5.H5Epop after #:" + num_msg, num_msg == TestH5Edefault.ERRSTACK_CNT - 1);
}
@Test(expected = IllegalArgumentException.class)
@@ -471,7 +474,7 @@ public class TestH5Edefault {
err.printStackTrace();
fail("H5.H5Eclear2_with_msg: " + err);
}
- assertTrue("H5.H5Eclear2_with_msg before #:" + num_msg, num_msg == 4);
+ assertTrue("H5.H5Eclear2_with_msg before #:" + num_msg, num_msg == TestH5Edefault.ERRSTACK_CNT);
try {
H5.H5Eclear2(HDF5Constants.H5E_DEFAULT);
num_msg = H5.H5Eget_num(HDF5Constants.H5E_DEFAULT);
@@ -480,7 +483,7 @@ public class TestH5Edefault {
err.printStackTrace();
fail("H5.H5Eclear2_with_msg: " + err);
}
- assertTrue("H5.H5Eclear2_with_msg after #:" + num_msg, num_msg == 0);
+ assertTrue("H5.H5Eclear2_with_msg after #:" + num_msg, num_msg == TestH5Edefault.ERRSTACK_MTY_CNT);
}
@Test(expected = IllegalArgumentException.class)
@@ -516,7 +519,7 @@ public class TestH5Edefault {
err.printStackTrace();
fail("H5.H5Eget_num: " + err);
}
- assertTrue("H5.H5Eget_num #:" + num_msg, num_msg == 0);
+ assertTrue("H5.H5Eget_num #:" + num_msg, num_msg == TestH5Edefault.ERRSTACK_MTY_CNT);
}
@Test
@@ -534,7 +537,7 @@ public class TestH5Edefault {
err.printStackTrace();
fail("H5.H5Eget_num_with_msg: " + err);
}
- assertTrue("H5.H5Eget_num_with_msg #:" + num_msg, num_msg > 0);
+ assertTrue("H5.H5Eget_num_with_msg #:" + num_msg, num_msg > TestH5Edefault.ERRSTACK_MTY_CNT);
}
}
diff --git a/java/test/junit.sh.in b/java/test/junit.sh.in
index 5d69bee..02d0147 100644
--- a/java/test/junit.sh.in
+++ b/java/test/junit.sh.in
@@ -59,11 +59,13 @@ LIST_LIBRARY_FILES="
$top_builddir/src/.libs/libhdf5.*
$top_builddir/java/src/jni/.libs/libhdf5_java.*
"
-LIST_JAR_FILES="
+LIST_JAR_TESTFILES="
$HDFLIB_HOME/hamcrest-core.jar
$HDFLIB_HOME/junit.jar
$HDFLIB_HOME/slf4j-api-1.7.25.jar
$HDFLIB_HOME/ext/slf4j-simple-1.7.25.jar
+"
+LIST_JAR_FILES="
$top_builddir/java/src/$JARFILE
"
LIST_DATA_FILES="
@@ -109,6 +111,7 @@ $HDFTEST_HOME/testfiles/JUnit-TestH5Giterate.txt
# copy files from source dirs to test dir
#
COPY_LIBFILES="$LIST_LIBRARY_FILES"
+COPY_JARTESTFILES="$LIST_JAR_TESTFILES"
COPY_JARFILES="$LIST_JAR_FILES"
COPY_LIBFILES_TO_BLDLIBDIR()
@@ -138,6 +141,29 @@ COPY_LIBFILES_TO_BLDLIBDIR()
fi
done
# copy jar files. Used -f to make sure get a new copy
+ for tstfile in $COPY_JARTESTFILES
+ do
+ # ignore '#' comment
+ echo $tstfile | tr -d ' ' | grep '^#' > /dev/null
+ RET=$?
+ if [ $RET -eq 1 ]; then
+ # skip cp if srcdir is same as destdir
+ # this occurs when build/test performed in source dir and
+ # make cp fail
+ SDIR=`$DIRNAME $tstfile`
+ INODE_SDIR=`$LS -i -d $SDIR | $AWK -F' ' '{print $1}'`
+ INODE_DDIR=`$LS -i -d $BLDLIBDIR | $AWK -F' ' '{print $1}'`
+ if [ "$INODE_SDIR" != "$INODE_DDIR" ]; then
+ $CP -f $tstfile $BLDLIBDIR
+ if [ $? -ne 0 ]; then
+ echo "Error: FAILED to copy $tstfile ."
+
+ # Comment out this to CREATE expected file
+ exit $EXIT_FAILURE
+ fi
+ fi
+ fi
+ done
for tstfile in $COPY_JARFILES
do
# ignore '#' comment
@@ -172,7 +198,10 @@ CLEAN_LIBFILES_AND_BLDLIBDIR()
INODE_SDIR=`$LS -i -d $SDIR | $AWK -F' ' '{print $1}'`
INODE_DDIR=`$LS -i -d $BLDLIBDIR | $AWK -F' ' '{print $1}'`
if [ "$INODE_SDIR" != "$INODE_DDIR" ]; then
- $RM $BLDLIBDIR
+ for tstfile in $COPY_JARTESTFILES
+ do
+ $RM $BLDLIBDIR/tstfile
+ done
fi
}
@@ -281,11 +310,6 @@ if $TEST -z "$LD_LIBRARY_PATH" ; then
fi
case $os_name in
- Darwin)
- DYLD_LIBRARY_PATH=$BLDLIBDIR:$DYLD_LIBRARY_PATH
- export DYLD_LIBRARY_PATH
- LD_LIBRARY_PATH=$DYLD_LIBRARY_PATH
- ;;
*)
LD_LIBRARY_PATH=$BLDLIBDIR:$LD_LIBRARY_PATH
;;
diff --git a/release_docs/HISTORY-1_10.txt b/release_docs/HISTORY-1_10.txt
index 9887a54..4344482 100644
--- a/release_docs/HISTORY-1_10.txt
+++ b/release_docs/HISTORY-1_10.txt
@@ -3,6 +3,7 @@ HDF5 History
This file contains development history of the HDF5 1.10 branch
+05. Release Information for hdf5-1.10.3
04. Release Information for hdf5-1.10.2
03. Release Information for hdf5-1.10.1
02. Release Information for hdf5-1.10.0-patch1
@@ -10,6 +11,673 @@ This file contains development history of the HDF5 1.10 branch
[Search on the string '%%%%' for section breaks of each release.]
+%%%%1.10.3%%%%
+
+HDF5 version 1.10.3 released on 2018-08-21
+================================================================================
+
+
+INTRODUCTION
+
+This document describes the differences between this release and the previous
+HDF5 release. It contains information on the platforms tested and known
+problems in this release. For more details check the HISTORY*.txt files in the
+HDF5 source.
+
+Note that documentation in the links below will be updated at the time of each
+final release.
+
+Links to HDF5 documentation can be found on The HDF5 web page:
+
+ https://portal.hdfgroup.org/display/HDF5/HDF5
+
+The official HDF5 releases can be obtained from:
+
+ https://www.hdfgroup.org/downloads/hdf5/
+
+Changes from Release to Release and New Features in the HDF5-1.10.x release series
+can be found at:
+
+ https://portal.hdfgroup.org/display/HDF5/HDF5+Application+Developer%27s+Guide
+
+If you have any questions or comments, please send them to the HDF Help Desk:
+
+ help@hdfgroup.org
+
+
+CONTENTS
+
+- New Features
+- Bug Fixes since HDF5-1.10.2
+- Supported Platforms
+- Tested Configuration Features Summary
+- More Tested Platforms
+- Known Problems
+- CMake vs. Autotools installations
+
+
+New Features
+============
+
+ Library
+ -------
+ - Moved the H5DOread/write_chunk() API calls to H5Dread/write_chunk()
+
+ The functionality of the direct chunk I/O calls in the high-level
+ library has been moved to the H5D package in the main library. This
+ will allow using those functions without building the high-level
+ library. The parameters and functionality of the H5D calls are
+ identical to the H5DO calls.
+
+ The original H5DO high-level API calls have been retained, though
+ they are now just wrappers for the H5D calls. They are marked as
+ deprecated and are only available when the library is built with
+ deprecated functions. New code should use the H5D calls for this
+ reason.
+
+ As a part of this work, the following symbols from H5Dpublic.h are no
+ longer used:
+
+ H5D_XFER_DIRECT_CHUNK_WRITE_FLAG_NAME
+ H5D_XFER_DIRECT_CHUNK_WRITE_FILTERS_NAME
+ H5D_XFER_DIRECT_CHUNK_WRITE_OFFSET_NAME
+ H5D_XFER_DIRECT_CHUNK_WRITE_DATASIZE_NAME
+ H5D_XFER_DIRECT_CHUNK_READ_FLAG_NAME
+ H5D_XFER_DIRECT_CHUNK_READ_OFFSET_NAME
+ H5D_XFER_DIRECT_CHUNK_READ_FILTERS_NAME
+
+ And properties with these names are no longer stored in the dataset
+ transfer property lists. The symbols are still defined in H5Dpublic.h,
+ but only when the library is built with deprecated symbols.
+
+ (DER - 2018/05/04)
+
+ Configuration:
+ -------------
+ - Add missing USE_110_API_DEFAULT option.
+
+ Option USE_110_API_DEFAULT sets the default version of
+ versioned APIs. The bin/makevers perl script did not set
+ the maxidx variable correctly when the 1.10 branch was
+ created. This caused the versioning process to always use
+ the latest version of any API.
+
+ (ADB - 2018/08/17, HDFFV-10552)
+
+ - Added configuration checks for the following MPI functions:
+
+ MPI_Mprobe - Used for the Parallel Compression feature
+ MPI_Imrecv - Used for the Parallel Compression feature
+
+ MPI_Get_elements_x - Used for the "big Parallel I/O" feature
+ MPI_Type_size_x - Used for the "big Parallel I/O" feature
+
+ (JTH - 2018/08/02, HDFFV-10512)
+
+ - Added section to the libhdf5.settings file to indicate
+ the status of the Parallel Compression and "big Parallel I/O"
+ features.
+
+ (JTH - 2018/08/02, HDFFV-10512)
+
+ - Add option to execute swmr shell scripts from CMake.
+
+ Option TEST_SHELL_SCRIPTS redirects processing into a
+ separate ShellTests.cmake file for UNIX types. The tests
+ execute the shell scripts if a SH program is found.
+
+ (ADB - 2018/07/16)
+
+
+ C++ Library:
+ ------------
+ - New wrappers
+
+ Added the following items:
+
+ + Class DSetAccPropList for the dataset access property list.
+
+ + Wrapper for H5Dget_access_plist to class DataSet
+ // Gets the access property list of this dataset.
+ DSetAccPropList getAccessPlist() const;
+
+ + Wrappers for H5Pset_chunk_cache and H5Pget_chunk_cache to class DSetAccPropList
+ // Sets the raw data chunk cache parameters.
+ void setChunkCache(size_t rdcc_nslots, size_t rdcc_nbytes, double rdcc_w0)
+
+ // Retrieves the raw data chunk cache parameters.
+ void getChunkCache(size_t &rdcc_nslots, size_t &rdcc_nbytes, double &rdcc_w0)
+
+ + New operator!= to class DataType (HDFFV-10472)
+ // Determines whether two datatypes are not the same.
+ bool operator!=(const DataType& compared_type)
+
+ + Wrappers for H5Oget_info2, H5Oget_info_by_name2, and H5Oget_info_by_idx2
+ (HDFFV-10458)
+
+ // Retrieves information about an HDF5 object.
+ void getObjinfo(H5O_info_t& objinfo, unsigned fields = H5O_INFO_BASIC) const;
+
+ // Retrieves information about an HDF5 object, given its name.
+ void getObjinfo(const char* name, H5O_info_t& objinfo,
+ unsigned fields = H5O_INFO_BASIC,
+ const LinkAccPropList& lapl = LinkAccPropList::DEFAULT) const;
+ void getObjinfo(const H5std_string& name, H5O_info_t& objinfo,
+ unsigned fields = H5O_INFO_BASIC,
+ const LinkAccPropList& lapl = LinkAccPropList::DEFAULT) const;
+
+ // Retrieves information about an HDF5 object, given its index.
+ void getObjinfo(const char* grp_name, H5_index_t idx_type,
+ H5_iter_order_t order, hsize_t idx, H5O_info_t& objinfo,
+ unsigned fields = H5O_INFO_BASIC,
+ const LinkAccPropList& lapl = LinkAccPropList::DEFAULT) const;
+ void getObjinfo(const H5std_string& grp_name, H5_index_t idx_type,
+ H5_iter_order_t order, hsize_t idx, H5O_info_t& objinfo,
+ unsigned fields = H5O_INFO_BASIC,
+ const LinkAccPropList& lapl = LinkAccPropList::DEFAULT) const;
+
+ (BMR - 2018/07/22, HDFFV-10150, HDFFV-10458, HDFFV-1047)
+
+
+ Java Library:
+ ----------------
+ - Java HDFLibraryException class
+
+ Change parent class from Exception to RuntimeException.
+
+ (ADB - 2018/07/30, HDFFV-10534)
+
+ - JNI Read and Write
+
+ Refactored variable-length functions, H5DreadVL and H5AreadVL,
+ to correct dataset and attribute reads. New write functions,
+ H5DwriteVL and H5AwriteVL, are under construction.
+
+ (ADB - 2018/06/02, HDFFV-10519)
+
+
+Bug Fixes since HDF5-1.10.2 release
+==================================
+
+ Library
+ -------
+ - Performance issue with H5Oget_info
+
+ H5Oget_info family of routines retrieves information for an object such
+ as object type, access time, number of attributes, and storage space etc.
+ Retrieving all such information regardless is an overkill and causes
+ performance issue when doing so for many objects.
+
+ Add an additional parameter "fields" to the the H5Oget_info family of routines
+ indicating the type of information to be retrieved. The same is done to
+ the H5Ovisit family of routines which recursively visits an object
+ returning object information in a callback function. Both sets of routines
+ are versioned and the corresponding compatibility macros are added.
+
+ The version 2 names of the two sets of routines are:
+ (1) H5Oget_info2, H5Oget_info_by_idx2, H5Oget_info_by_name2
+ (2) H5Ovisit2, H5Ovisit_by_name2
+
+ (VC - 2018/08/15, HDFFV-10180)
+
+ - Test failure due to metadata size in test/vds.c
+
+ The size of metadata from test_api_get_ex_dcpl() in test/vds.c is not as expected
+ because the latest format should be used when encoding the layout for VDS.
+
+ Set the latest format in a temporary fapl and pass the setting to the routines that
+ encode the dataset selection for VDS.
+
+ (VC - 2018/08/14 HDFFV-10469)
+
+ - Java HDF5LibraryException class
+
+ The error minor and major values would be lost after the
+ constructor executed.
+
+ Created two local class variables to hold the values obtained during
+ execution of the constructor. Refactored the class functions to retrieve
+ the class values rather then calling the native functions.
+ The native functions were renamed and called only during execution
+ of the constructor.
+ Added error checking to calling class constructors in JNI classes.
+
+ (ADB - 2018/08/06, HDFFV-10544)
+
+ - Added checks of the defined MPI_VERSION to guard against usage of
+ MPI-3 functions in the Parallel Compression and "big Parallel I/O"
+ features when HDF5 is built with MPI-2. Previously, the configure
+ step would pass but the build itself would fail when it could not
+ locate the MPI-3 functions used.
+
+ As a result of these new checks, HDF5 can again be built with MPI-2,
+ but the Parallel Compression feature will be disabled as it relies
+ on the MPI-3 functions used.
+
+ (JTH - 2018/08/02, HDFFV-10512)
+
+ - User's patches: CVEs
+
+ The following patches have been applied:
+
+ CVE-2018-11202 - NULL pointer dereference was discovered in
+ H5S_hyper_make_spans in H5Shyper.c (HDFFV-10476)
+ https://security-tracker.debian.org/tracker/CVE-2018-11202
+ https://cve.mitre.org/cgi-bin/cvename.cgi?name=3DCVE-2018-11202
+
+ CVE-2018-11203 - A division by zero was discovered in
+ H5D__btree_decode_key in H5Dbtree.c (HDFFV-10477)
+ https://security-tracker.debian.org/tracker/CVE-2018-11203
+ https://cve.mitre.org/cgi-bin/cvename.cgi?name=3DCVE-2018-11203
+
+ CVE-2018-11204 - A NULL pointer dereference was discovered in
+ H5O__chunk_deserialize in H5Ocache.c (HDFFV-10478)
+ https://security-tracker.debian.org/tracker/CVE-2018-11204
+ https://cve.mitre.org/cgi-bin/cvename.cgi?name=3DCVE-2018-11204
+
+ CVE-2018-11206 - An out of bound read was discovered in
+ H5O_fill_new_decode and H5O_fill_old_decode in H5Ofill.c
+ (HDFFV-10480)
+ https://security-tracker.debian.org/tracker/CVE-2018-11206
+ https://cve.mitre.org/cgi-bin/cvename.cgi?name=3DCVE-2018-11206
+
+ CVE-2018-11207 - A division by zero was discovered in
+ H5D__chunk_init in H5Dchunk.c (HDFFV-10481)
+ https://security-tracker.debian.org/tracker/CVE-2018-11207
+ https://cve.mitre.org/cgi-bin/cvename.cgi?name=3DCVE-2018-11207
+
+ (BMR - 2018/7/22, PR#s: 1134 and 1139,
+ HDFFV-10476, HDFFV-10477, HDFFV-10478, HDFFV-10480, HDFFV-10481)
+
+ - H5Adelete
+
+ H5Adelete failed when deleting the last "large" attribute that
+ is stored densely via fractal heap/v2 b-tree.
+
+ After removing the attribute, update the ainfo message. If the
+ number of attributes goes to zero, remove the message.
+
+ (VC - 2018/07/20, HDFFV-9277)
+
+ - A bug was discovered in the parallel library which caused partial
+ parallel reads of filtered datasets to return incorrect data. The
+ library used the incorrect dataspace for each chunk read, causing
+ the selection used in each chunk to be wrong.
+
+ The bug was not caught during testing because all of the current
+ tests which do parallel reads of filtered data read all of the data
+ using an H5S_ALL selection. Several tests were added which exercise
+ partial parallel reads.
+
+ (JTH - 2018/07/16, HDFFV-10467)
+
+ - A bug was discovered in the parallel library which caused parallel
+ writes of filtered datasets to trigger an assertion failure in the
+ file free space manager.
+
+ This occurred when the filter used caused chunks to repeatedly shrink
+ and grow over the course of several dataset writes. The previous chunk
+ information, such as the size of the chunk and the offset in the file,
+ was being cached and not updated after each write, causing the next write
+ to the chunk to retrieve the incorrect cached information and run into
+ issues when reallocating space in the file for the chunk.
+
+ (JTH - 2018/07/16, HDFFV-10509)
+
+ - A bug was discovered in the parallel library which caused the
+ H5D__mpio_array_gatherv() function to allocate too much memory.
+
+ When the function is called with the 'allgather' parameter set
+ to a non-true value, the function will receive data from all MPI
+ ranks and gather it to the single rank specied by the 'root'
+ parameter. However, the bug in the function caused memory for
+ the received data to be allocated on all MPI ranks, not just the
+ singular rank specified as the receiver. In some circumstances,
+ this would cause an application to fail due to the large amounts
+ of memory being allocated.
+
+ (JTH - 2018/07/16, HDFFV-10467)
+
+ - Error checks in h5stat and when decoding messages
+
+ h5stat exited with seg fault/core dumped when
+ errors are encountered in the internal library.
+
+ Add error checks and --enable-error-stack option to h5stat.
+ Add range checks when decoding messages: old fill value, old
+ layout and refcount.
+
+ (VC - 2018/07/11, HDFFV-10333)
+
+ - If an HDF5 file contains a malformed compound datatype with a
+ suitably large offset, the type conversion code can run off
+ the end of the type conversion buffer, causing a segmentation
+ fault.
+
+ This issue was reported to The HDF Group as issue #CVE-2017-17507.
+
+ NOTE: The HDF5 C library cannot produce such a file. This condition
+ should only occur in a corrupt (or deliberately altered) file
+ or a file created by third-party software.
+
+ THE HDF GROUP WILL NOT FIX THIS BUG AT THIS TIME
+
+ Fixing this problem would involve updating the publicly visible
+ H5T_conv_t function pointer typedef and versioning the API calls
+ which use it. We normally only modify the public API during
+ major releases, so this bug will not be fixed at this time.
+
+ (DER - 2018/02/26, HDFFV-10356)
+
+
+ Configuration
+ -------------
+ - Applied patches to address Cywin build issues
+
+ There were three issues for Cygwin builds:
+ - Shared libs were not built.
+ - The -std=c99 flag caused a SIG_SETMASK undeclared error.
+ - Undefined errors when buildbing test shared libraries.
+
+ Patches to address these issues were received and incorporated in this version.
+
+ (LRK - 2018/07/18, HDFFV-10475)
+
+ - The --enable-debug/production configure flags are listed as 'deprecated'
+ when they should really be listed as 'removed'.
+
+ In the autotools overhaul several years ago, we removed these flags and
+ implemented a new --enable-build-mode= flag. This was done because we
+ changed the semantics of the modes and didn't want users to silently
+ be exposed to them. The newer system is also more flexible and us to
+ add other modes (like 'clean').
+
+ The --enable-debug/production flags are now listed as removed.
+
+ (DER - 2018/05/31, HDFFV-10505)
+
+ - Moved the location of gcc attribute.
+
+ The gcc attribute(no_sanitize), named as the macro HDF_NO_UBSAN,
+ was located after the function name. Builds with GCC 7 did not
+ indicate any problem, but GCC 8 issued errors. Moved the
+ attribute before the function name, as required.
+
+ (ADB - 2018/05/22, HDFFV-10473)
+
+ - Reworked java test suite into individual JUnit tests.
+
+ Testing the whole suite of java unit tests in a single JUnit run
+ made it difficult to determine actual failures when tests would fail.
+ Running each file set of tests individually, allows individual failures
+ to be diagnosed easier. A side benefit is that tests for optional components
+ of the library can be disabled if not configured.
+
+ (ADB - 2018/05/16, HDFFV-9739)
+
+ - Converted CMake global commands ADD_DEFINITIONS and INCLUDE_DIRECTORIES
+ to use target_* type commands. This change modernizes the CMake usage
+ in the HDF5 library.
+
+ In addition, there is the intention to convert to generator expressions,
+ where possible. The exception is Fortran FLAGS on Windows Visual Studio.
+ The HDF macros TARGET_C_PROPERTIES and TARGET_FORTRAN_PROPERTIES have
+ been removed with this change in usage.
+
+ The additional language (C++ and Fortran) checks have also been localized
+ to only be checked when that language is enabled.
+
+ (ADB - 2018/05/08)
+
+
+ Performance
+ -------------
+ - Revamped internal use of DXPLs, improving performance
+
+ (QAK - 2018/05/20)
+
+
+ Fortran
+ --------
+ - Fixed issue with h5fget_obj_count_f and using a file id of H5F_OBJ_ALL_F not
+ returning the correct count.
+
+ (MSB - 2018/5/15, HDFFV-10405)
+
+
+ C++ APIs
+ --------
+ - Adding default arguments to existing functions
+
+ Added the following items:
+ + Two more property list arguments are added to H5Location::createDataSet:
+ const DSetAccPropList& dapl = DSetAccPropList::DEFAULT
+ const LinkCreatPropList& lcpl = LinkCreatPropList::DEFAULT
+
+ + One more property list argument is added to H5Location::openDataSet:
+ const DSetAccPropList& dapl = DSetAccPropList::DEFAULT
+
+ (BMR - 2018/07/21, PR# 1146)
+
+ - Improvement C++ documentation
+
+ Replaced the table in main page of the C++ documentation from mht to htm format
+ for portability.
+
+ (BMR - 2018/07/17, PR# 1141)
+
+
+Supported Platforms
+===================
+
+ Linux 2.6.32-696.16.1.el6.ppc64 gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-18)
+ #1 SMP ppc64 GNU/Linux g++ (GCC) 4.4.7 20120313 (Red Hat 4.4.7-18)
+ (ostrich) GNU Fortran (GCC) 4.4.7 20120313 (Red Hat 4.4.7-18)
+ IBM XL C/C++ V13.1
+ IBM XL Fortran V15.1
+
+ Linux 3.10.0-327.10.1.el7 GNU C (gcc), Fortran (gfortran), C++ (g++)
+ #1 SMP x86_64 GNU/Linux compilers:
+ (kituo/moohan) Version 4.8.5 20150623 (Red Hat 4.8.5-4)
+ Version 4.9.3, Version 5.2.0
+ Intel(R) C (icc), C++ (icpc), Fortran (icc)
+ compilers:
+ Version 17.0.0.098 Build 20160721
+ MPICH 3.1.4 compiled with GCC 4.9.3
+
+ SunOS 5.11 32- and 64-bit Sun C 5.12 SunOS_sparc
+ (emu) Sun Fortran 95 8.6 SunOS_sparc
+ Sun C++ 5.12 SunOS_sparc
+
+ Windows 7 Visual Studio 2015 w/ Intel Fortran 16 (cmake)
+
+ Windows 7 x64 Visual Studio 2012 w/ Intel Fortran 15 (cmake)
+ Visual Studio 2013 w/ Intel Fortran 15 (cmake)
+ Visual Studio 2015 w/ Intel Fortran 16 (cmake)
+ Visual Studio 2015 w/ Intel C, Fortran 2017 (cmake)
+ Visual Studio 2015 w/ MSMPI 8 (cmake)
+
+ Windows 10 Visual Studio 2015 w/ Intel Fortran 18 (cmake)
+
+ Windows 10 x64 Visual Studio 2015 w/ Intel Fortran 18 (cmake)
+ Visual Studio 2017 w/ Intel Fortran 18 (cmake)
+
+ Mac OS X Yosemite 10.10.5 Apple clang/clang++ version 6.1 from Xcode 7.0
+ 64-bit gfortran GNU Fortran (GCC) 4.9.2
+ (osx1010dev/osx1010test) Intel icc/icpc/ifort version 15.0.3
+
+ Mac OS X El Capitan 10.11.6 Apple clang/clang++ version 7.3.0 from Xcode 7.3
+ 64-bit gfortran GNU Fortran (GCC) 5.2.0
+ (osx1011dev/osx1011test) Intel icc/icpc/ifort version 16.0.2
+
+ Mac OS Sierra 10.12.6 Apple LLVM version 8.1.0 (clang/clang++-802.0.42)
+ 64-bit gfortran GNU Fortran (GCC) 7.1.0
+ (swallow/kite) Intel icc/icpc/ifort version 17.0.2
+
+Tested Configuration Features Summary
+=====================================
+
+ In the tables below
+ y = tested
+ n = not tested in this release
+ C = Cluster
+ W = Workstation
+ x = not working in this release
+ dna = does not apply
+ ( ) = footnote appears below second table
+ <blank> = testing incomplete on this feature or platform
+
+Platform C F90/ F90 C++ zlib SZIP
+ parallel F2003 parallel
+Solaris2.11 32-bit n y/y n y y y
+Solaris2.11 64-bit n y/n n y y y
+Windows 7 y y/y n y y y
+Windows 7 x64 y y/y y y y y
+Windows 7 Cygwin n y/n n y y y
+Windows 7 x64 Cygwin n y/n n y y y
+Windows 10 y y/y n y y y
+Windows 10 x64 y y/y n y y y
+Mac OS X Mavericks 10.9.5 64-bit n y/y n y y y
+Mac OS X Yosemite 10.10.5 64-bit n y/y n y y y
+Mac OS X El Capitan 10.11.6 64-bit n y/y n y y y
+Mac OS Sierra 10.12.6 64-bit n y/y n y y y
+CentOS 7.2 Linux 2.6.32 x86_64 PGI n y/y n y y y
+CentOS 7.2 Linux 2.6.32 x86_64 GNU y y/y y y y y
+CentOS 7.2 Linux 2.6.32 x86_64 Intel n y/y n y y y
+Linux 2.6.32-573.18.1.el6.ppc64 n y/y n y y y
+
+
+Platform Shared Shared Shared Thread-
+ C libs F90 libs C++ libs safe
+Solaris2.11 32-bit y y y y
+Solaris2.11 64-bit y y y y
+Windows 7 y y y y
+Windows 7 x64 y y y y
+Windows 7 Cygwin n n n y
+Windows 7 x64 Cygwin n n n y
+Windows 10 y y y y
+Windows 10 x64 y y y y
+Mac OS X Mavericks 10.9.5 64-bit y n y y
+Mac OS X Yosemite 10.10.5 64-bit y n y y
+Mac OS X El Capitan 10.11.6 64-bit y n y y
+Mac OS Sierra 10.12.6 64-bit y n y y
+CentOS 7.2 Linux 2.6.32 x86_64 PGI y y y n
+CentOS 7.2 Linux 2.6.32 x86_64 GNU y y y y
+CentOS 7.2 Linux 2.6.32 x86_64 Intel y y y n
+Linux 2.6.32-573.18.1.el6.ppc64 y y y n
+
+Compiler versions for each platform are listed in the preceding
+"Supported Platforms" table.
+
+
+More Tested Platforms
+=====================
+The following platforms are not supported but have been tested for this release.
+
+ Linux 2.6.32-573.22.1.el6 GNU C (gcc), Fortran (gfortran), C++ (g++)
+ #1 SMP x86_64 GNU/Linux compilers:
+ (mayll/platypus) Version 4.4.7 20120313
+ Version 4.9.3, 5.3.0, 6.2.0
+ PGI C, Fortran, C++ for 64-bit target on
+ x86-64;
+ Version 17.10-0
+ Intel(R) C (icc), C++ (icpc), Fortran (icc)
+ compilers:
+ Version 17.0.4.196 Build 20170411
+ MPICH 3.1.4 compiled with GCC 4.9.3
+
+ Linux 3.10.0-327.18.2.el7 GNU C (gcc) and C++ (g++) compilers
+ #1 SMP x86_64 GNU/Linux Version 4.8.5 20150623 (Red Hat 4.8.5-4)
+ (jelly) with NAG Fortran Compiler Release 6.1(Tozai)
+ GCC Version 7.1.0
+ OpenMPI 3.0.0-GCC-7.2.0-2.29,
+ 3.1.0-GCC-7.2.0-2.29
+ Intel(R) C (icc) and C++ (icpc) compilers
+ Version 17.0.0.098 Build 20160721
+ with NAG Fortran Compiler Release 6.1(Tozai)
+
+ Linux 3.10.0-327.10.1.el7 MPICH 3.2 compiled with GCC 5.3.0
+ #1 SMP x86_64 GNU/Linux
+ (moohan)
+
+ Linux 2.6.32-573.18.1.el6.ppc64 MPICH mpich 3.1.4 compiled with
+ #1 SMP ppc64 GNU/Linux IBM XL C/C++ for Linux, V13.1
+ (ostrich) and IBM XL Fortran for Linux, V15.1
+
+ Debian 8.4 3.16.0-4-amd64 #1 SMP Debian 3.16.36-1 x86_64 GNU/Linux
+ gcc, g++ (Debian 4.9.2-10) 4.9.2
+ GNU Fortran (Debian 4.9.2-10) 4.9.2
+ (cmake and autotools)
+
+ Fedora 24 4.7.2-201.fc24.x86_64 #1 SMP x86_64 x86_64 x86_64 GNU/Linux
+ gcc, g++ (GCC) 6.1.1 20160621
+ (Red Hat 6.1.1-3)
+ GNU Fortran (GCC) 6.1.1 20160621
+ (Red Hat 6.1.1-3)
+ (cmake and autotools)
+
+ Ubuntu 16.04.1 4.4.0-38-generic #57-Ubuntu SMP x86_64 GNU/Linux
+ gcc, g++ (Ubuntu 5.4.0-6ubuntu1~16.04.2)
+ 5.4.0 20160609
+ GNU Fortran (Ubuntu 5.4.0-6ubuntu1~16.04.2)
+ 5.4.0 20160609
+ (cmake and autotools)
+
+
+Known Problems
+==============
+
+ At present, metadata cache images may not be generated by parallel
+ applications. Parallel applications can read files with metadata cache
+ images, but since this is a collective operation, a deadlock is possible
+ if one or more processes do not participate.
+
+ Three tests fail with OpenMPI 3.0.0/GCC-7.2.0-2.29:
+ testphdf5 (ecdsetw, selnone, cchunk1, cchunk3, cchunk4, and actualio)
+ t_shapesame (sscontig2)
+ t_pflush1/fails on exit
+ The first two tests fail attempting collective writes.
+
+ Known problems in previous releases can be found in the HISTORY*.txt files
+ in the HDF5 source. Please report any new problems found to
+ help@hdfgroup.org.
+
+
+CMake vs. Autotools installations
+=================================
+While both build systems produce similar results, there are differences.
+Each system produces the same set of folders on linux (only CMake works
+on standard Windows); bin, include, lib and share. Autotools places the
+COPYING and RELEASE.txt file in the root folder, CMake places them in
+the share folder.
+
+The bin folder contains the tools and the build scripts. Additionally, CMake
+creates dynamic versions of the tools with the suffix "-shared". Autotools
+installs one set of tools depending on the "--enable-shared" configuration
+option.
+ build scripts
+ -------------
+ Autotools: h5c++, h5cc, h5fc
+ CMake: h5c++, h5cc, h5hlc++, h5hlcc
+
+The include folder holds the header files and the fortran mod files. CMake
+places the fortran mod files into separate shared and static subfolders,
+while Autotools places one set of mod files into the include folder. Because
+CMake produces a tools library, the header files for tools will appear in
+the include folder.
+
+The lib folder contains the library files, and CMake adds the pkgconfig
+subfolder with the hdf5*.pc files used by the bin/build scripts created by
+the CMake build. CMake separates the C interface code from the fortran code by
+creating C-stub libraries for each Fortran library. In addition, only CMake
+installs the tools library. The names of the szip libraries are different
+between the build systems.
+
+The share folder will have the most differences because CMake builds include
+a number of CMake specific files for support of CMake's find_package and support
+for the HDF5 Examples CMake project.
+
+
%%%%1.10.2%%%%
HDF5 version 1.10.2 released on 2018-03-29
diff --git a/release_docs/INSTALL b/release_docs/INSTALL
index baad559..5c54698 100755
--- a/release_docs/INSTALL
+++ b/release_docs/INSTALL
@@ -2,11 +2,11 @@
Instructions for the Installation of HDF5 Software
==================================================
-This file provides instructions for installing the HDF5 software.
+This file provides instructions for installing the HDF5 software.
For help with installing, questions can be posted to the HDF Forum or sent to the HDF Helpdesk:
- HDF Forum: https://forum.hdfgroup.org/
+ HDF Forum: https://forum.hdfgroup.org/
HDF Helpdesk: https://portal.hdfgroup.org/display/support/The+HDF+Help+Desk
CONTENTS
@@ -52,8 +52,8 @@ CONTENTS
1. Obtaining HDF5
The latest supported public release of HDF5 is available from
- https://www.hdfgroup.org/downloads/hdf5/. For Unix and UNIX-like
- platforms, it is available in tar format compressed with gzip.
+ https://www.hdfgroup.org/downloads/hdf5/. For Unix and UNIX-like
+ platforms, it is available in tar format compressed with gzip.
For Microsoft Windows, it is in ZIP format.
@@ -77,14 +77,14 @@ CONTENTS
$ tar zxf hdf5-X.Y.Z.tar.gz
<configure_flags> above refers to the configure flags appropriate
- to your installation. For example, to install HDF5 with the
- Fortran and C++ interfaces and with SZIP compression, the
+ to your installation. For example, to install HDF5 with the
+ Fortran and C++ interfaces and with SZIP compression, the
configure line might read as follows:
-
+
$ ./configure --prefix=/usr/local/hdf5 --enable-fortran \
--enable-cxx --with-szlib=PATH_TO_SZIP
- In this case, PATH_TO_SZIP would be replaced with the path to the
+ In this case, PATH_TO_SZIP would be replaced with the path to the
installed location of the SZIP library.
2.1. Windows
@@ -101,7 +101,7 @@ CONTENTS
3. HDF5 dependencies
3.1. Zlib
- The HDF5 library includes a predefined compression filter that
+ The HDF5 library includes a predefined compression filter that
uses the "deflate" method for chunked datasets. If zlib-1.1.2 or
later is found, HDF5 will use it. Otherwise, HDF5's predefined
compression method will degenerate to a no-op; the compression
@@ -122,17 +122,17 @@ CONTENTS
include the Szip library with the encoder enabled. These can be found
here:
- https://www.hdfgroup.org/downloads/hdf5/
+ https://www.hdfgroup.org/downloads/hdf5/
To configure the HDF5 library with the Szip compression filter, use
the '--with-szlib=/PATH_TO_SZIP' flag. For more information, see
section 4.3.7, "Specifying other libraries and headers."
Please notice that if HDF5 configure cannot find a valid Szip library,
- configure will not fail; in this case, the compression filter will
+ configure will not fail; in this case, the compression filter will
not be available to the applications.
- To check if Szip compression was successfully configured in,
+ To check if Szip compression was successfully configured in,
check the "I/O filters (external):" line in the configure output,
summary section, printed to the standard output.
@@ -188,7 +188,7 @@ CONTENTS
detects various features of the host system and creates the
Makefiles. On most systems it should be sufficient to say:
- $ ./configure
+ $ ./configure
Or
$ sh configure
@@ -218,15 +218,15 @@ CONTENTS
before the library and executables are built.
HDF5 can be installed into a different location than the prefix
- specified at configure time; see section 4.6, "Installing HDF5,"
+ specified at configure time; see section 4.6, "Installing HDF5,"
for more details.
4.3.2. Using an alternate C compiler
By default, configure will look for the C compiler by trying
`gcc' and `cc'. However, if the environment variable "CC" is set
- then its value is used as the C compiler. For instance, one would
- use the following line to specify the native C compiler on a system
- that also has the GNU gcc compiler (users of csh and derivatives
+ then its value is used as the C compiler. For instance, one would
+ use the following line to specify the native C compiler on a system
+ that also has the GNU gcc compiler (users of csh and derivatives
will need to prefix the commands below with `env'):
$ CC=cc ./configure
@@ -257,7 +257,7 @@ CONTENTS
$ ./configure --enable-fortran
$ ./configure --enable-cxx
$ ./configure --enable-java
-
+
Configuration will halt if a working Fortran 90 or 95 compiler or
C++ compiler is not found. Currently, the Fortran configure tests
for these compilers in order: f90, pgf90, f95. To use an
@@ -267,7 +267,7 @@ CONTENTS
4.3.5. Specifying other programs
- The build system has been tuned for use with GNU make but also
+ The build system has been tuned for use with GNU make but also
works with other versions of make. If the `make' command runs a
non-GNU version but a GNU version is available under a different
name (perhaps `gmake'), then HDF5 can be configured to use it by
@@ -286,8 +286,8 @@ CONTENTS
during `make install' (described below) with a BSD-compatible
install program detected automatically by configure. If none is
found, the shell script bin/install-sh is used. Configure does not
- check that the install script actually works; if a bad install is
- detected on your system (e.g., on the ASCI blue machine as of
+ check that the install script actually works; if a bad install is
+ detected on your system (e.g., on the ASCI blue machine as of
March 2, 1999) you have two choices:
1. Copy the bin/install-sh program to your $HOME/bin
@@ -310,11 +310,11 @@ CONTENTS
LDFLAGS=-L/home/robb/lib \
./configure
- HDF5 uses the zlib library to support the HDF5 deflate
- data compression filter. Configure searches the standard places
- (plus those specified above with the CPPFLAGS and LDFLAGS variables)
- for the zlib headers and library. The search can be disabled by
- specifying `--without-zlib' or alternate directories can be specified
+ HDF5 uses the zlib library to support the HDF5 deflate
+ data compression filter. Configure searches the standard places
+ (plus those specified above with the CPPFLAGS and LDFLAGS variables)
+ for the zlib headers and library. The search can be disabled by
+ specifying `--without-zlib' or alternate directories can be specified
with `--with-zlib=INCDIR,LIBDIR' or through the CPPFLAGS and LDFLAGS
variables:
@@ -324,8 +324,8 @@ CONTENTS
LDFLAGS=-L/usr/unsup/lib \
./configure
- HDF5 includes Szip as a predefined compression method (see 3.2).
- To enable Szip compression, the HDF5 library must be configured
+ HDF5 includes Szip as a predefined compression method (see 3.2).
+ To enable Szip compression, the HDF5 library must be configured
and built using the Szip library:
$ ./configure --with-szlib=/Szip_Install_Directory
@@ -350,10 +350,10 @@ CONTENTS
The library can be compiled to provide symbolic debugging support
so it can be debugged with gdb, dbx, ddd, etc., or it can be
compiled with various optimizations. To compile for symbolic
- debugging (the default for snapshots), say
- `--enable-build-mode=production'; to compile with optimizations
- (the default for supported public releases),
- say `--enable-build-mode=production'. On some systems the
+ debugging (the default for snapshots), say
+ `--enable-build-mode=production'; to compile with optimizations
+ (the default for supported public releases),
+ say `--enable-build-mode=production'. On some systems the
library can also be compiled for profiling with gprof by saying
`--enable-production=profile'.
@@ -362,13 +362,13 @@ CONTENTS
$ ./configure --enable-production=profile #for use with gprof
Regardless of whether support for symbolic debugging is enabled,
- the library can also perform runtime debugging of certain packages
- (such as type conversion execution times and extensive invariant
- condition checking). To enable this debugging, supply a
- comma-separated list of package names to the `--enable-internal-debug'
- switch.
+ the library can also perform runtime debugging of certain packages
+ (such as type conversion execution times and extensive invariant
+ condition checking). To enable this debugging, supply a
+ comma-separated list of package names to the `--enable-internal-debug'
+ switch.
- Debugging can be disabled by saying `--disable-internal-debug'.
+ Debugging can be disabled by saying `--disable-internal-debug'.
The default debugging level for snapshots is a subset of the
available packages; the default for supported releases is no
debugging (debugging can incur a significant runtime penalty).
@@ -378,10 +378,10 @@ CONTENTS
$ ./configure --enable-internal-debug=all #debug all packages
$ ./configure --disable-internal-debug #no debugging
- HDF5 can also print a trace of all API function calls, their
+ HDF5 can also print a trace of all API function calls, their
arguments, and the return values. To enable or disable the
ability to trace the API say `--enable-trace' (the default for
- snapthots) or `--disable-trace' (the default for public releases).
+ snapthots) or `--disable-trace' (the default for public releases).
The tracing must also be enabled at runtime to see any output.
4.3.9. Parallel versus serial library
@@ -389,25 +389,39 @@ CONTENTS
parallelism on a distributed multi-processor system. Read the
file INSTALL_parallel for detailed information.
+ The threadsafe, C++ and Java interfaces are not compatible
+ with the parallel option.
+ Unless --enable-unsupported has been specified on the configure line,
+ the following options must be disabled:
+ --enable-threadsafe, --enable-cxx, --enable-java
+
+
4.3.10. Threadsafe capability
The HDF5 library can be configured to be thread-safe (on a very
large scale) with the `--enable-threadsafe' flag to the configure
script. Some platforms may also require the '-with-pthread=INC,LIB'
(or '--with-pthread=DIR') flag to the configure script.
- For further information, see:
+ For further information, see:
https://portal.hdfgroup.org/display/knowledge/Questions+about+thread-safety+and+concurrent+access
+ The high-level, C++, Fortran and Java interfaces are not compatible
+ with the thread-safety option because the lock is not hoisted
+ into the higher-level API calls.
+ Unless --enable-unsupported has been specified on the configure line,
+ the following options must be disabled:
+ --enable-hl, --enable-cxx, --enable-fortran, --enable-java
+
4.3.11. Backward compatibility
The 1.10 version of the HDF5 library can be configured to operate
- identically to the v1.8 library with the
+ identically to the v1.8 library with the
--with-default-api-version=v18
- configure flag, or identically to the v1.6 library with the
+ configure flag, or identically to the v1.6 library with the
--with-default-api-version=v16
configure flag. This allows existing code to be compiled with the
- v1.10 library without requiring immediate changes to the application
- source code. For additional configuration options and other details,
+ v1.10 library without requiring immediate changes to the application
+ source code. For additional configuration options and other details,
see "API Compatibility Macros":
https://portal.hdfgroup.org/display/HDF5/API+Compatibility+Macros
@@ -487,7 +501,7 @@ CONTENTS
$ make install prefix=NEW_DIR
- where NEW_DIR is the new directory where you wish to install HDF5.
+ where NEW_DIR is the new directory where you wish to install HDF5.
If you do not use the deploy script, you should run h5redeploy in
NEW_DIR/bin directory. This utility will fix the h5cc, h5fc and
h5c++ scripts to reflect the new NEW_DIR location.
@@ -510,7 +524,7 @@ CONTENTS
The configuration information:
./src/H5pubconf.h
-
+
The support programs that are useful are:
./tools/h5ls/h5ls (list file contents)
./tools/h5dump/h5dump (dump file contents)
@@ -518,12 +532,12 @@ CONTENTS
./tools/misc/h5debug (low-level file debugging)
./tools/h5import/h5import (imports data to HDF5 file)
./tools/h5diff/h5diff (compares two HDF5 files)
- ./tools/gifconv/h52gif (HDF5 to GIF converter)
+ ./tools/gifconv/h52gif (HDF5 to GIF converter)
./tools/gifconv/gif2h5 (GIF to HDF5 converter)
5. Using the Library
-
+
For information on using HDF5 see the documentation, tutorials and examples
found here:
diff --git a/release_docs/INSTALL_CMake.txt b/release_docs/INSTALL_CMake.txt
index 3a69022..edd876a 100644
--- a/release_docs/INSTALL_CMake.txt
+++ b/release_docs/INSTALL_CMake.txt
@@ -12,6 +12,7 @@ Section IV: Further considerations
Section V: Options for building HDF5 Libraries with CMake command line
Section VI: CMake option defaults for HDF5
Section VII: User Defined Options for HDF5 Libraries with CMake
+Section VIII: User Defined Compile Flags for HDF5 Libraries with CMake
************************************************************************
@@ -274,9 +275,14 @@ IV. Further considerations
packages there. Add the following CMake options:
-DZLIB_LIBRARY:FILEPATH=some_location/lib/zlib.lib
-DZLIB_INCLUDE_DIR:PATH=some_location/include
+ -DZLIB_USE_EXTERNAL:BOOL=OFF
-DSZIP_LIBRARY:FILEPATH=some_location/lib/szlib.lib
-DSZIP_INCLUDE_DIR:PATH=some_location/include
+ -DSZIP_USE_EXTERNAL:BOOL=OFF
where "some_location" is the full path to the extlibs folder.
+ Also the appropriate environment variable must be set;
+ set(ENV{ZLIB_ROOT} "some_location")
+ set(ENV{SZIP_ROOT} "some_location")
B. Use source packages from an GIT server by adding the following CMake
options:
@@ -318,6 +324,34 @@ IV. Further considerations
-DHDF5_ENABLE_SZIP_SUPPORT:BOOL=OFF -DHDF5_ENABLE_Z_LIB_SUPPORT:BOOL=OFF \
-DCMAKE_BUILD_TYPE:STRING=Release ..
+ 6. CMake uses a toolchain of utilities to compile, link libraries and
+ create archives, and other tasks to drive the build. The toolchain
+ utilities available are determined by the languages enabled. In normal
+ builds, CMake automatically determines the toolchain for host builds
+ based on system introspection and defaults. In cross-compiling
+ scenarios, a toolchain file may be specified with information about
+ compiler and utility paths.
+ Variables and Properties
+ Several variables relate to the language components of a toolchain which
+ are enabled. CMAKE_<LANG>_COMPILER is the full path to the compiler used
+ for <LANG>. CMAKE_<LANG>_COMPILER_ID is the identifier used by CMake for
+ the compiler and CMAKE_<LANG>_COMPILER_VERSION is the version of the compiler.
+
+ The CMAKE_<LANG>_FLAGS variables and the configuration-specific equivalents
+ contain flags that will be added to the compile command when compiling a
+ file of a particular language.
+
+ As the linker is invoked by the compiler driver, CMake needs a way to
+ determine which compiler to use to invoke the linker. This is calculated
+ by the LANGUAGE of source files in the target, and in the case of static
+ libraries, the language of the dependent libraries. The choice CMake makes
+ may be overridden with the LINKER_LANGUAGE target property.
+
+ See the CMake help for more information on using toolchain files.
+
+ To use a toolchain file with the supplied cmake scripts, see the
+ HDF5options.cmake file under the toolchain section.
+
Notes: CMake and HDF5
1. Using CMake for building and using HDF5 is under active development.
@@ -491,7 +525,7 @@ These five steps are described in detail below.
Release and build the solution.
3.2.1 The external libraries (zlib and szip) can be configured
- to allow building the libraries by downloading from an GIT repository.
+ to allow building the libraries by downloading from a GIT repository.
The option is 'HDF5_ALLOW_EXTERNAL_SUPPORT'; by adding the following
configuration option:
-DHDF5_ALLOW_EXTERNAL_SUPPORT:STRING="GIT"
@@ -508,7 +542,7 @@ These five steps are described in detail below.
adding the following configuration option:
-DHDF5_ALLOW_EXTERNAL_SUPPORT:STRING="TGZ"
- The options to control the SVN URL (config/cmake/cacheinit.cmake
+ The options to control the TGZ URL (config/cmake/cacheinit.cmake
file) are:
ZLIB_TGZ_NAME:STRING="zlib_src.ext"
SZIP_TGZ_NAME:STRING="szip_src.ext"
@@ -590,6 +624,7 @@ HDF5_BUILD_TOOLS "Build HDF5 Tools" ON
---------------- HDF5 Advanced Options ---------------------
ALLOW_UNSUPPORTED "Allow unsupported combinations of configure options" OFF
+HDF5_EXTERNAL_LIB_PREFIX "Use prefix for custom library naming." ""
HDF5_DISABLE_COMPILER_WARNINGS "Disable compiler warnings" OFF
HDF5_ENABLE_ALL_WARNINGS "Enable all warnings" OFF
HDF5_ENABLE_CODESTACK "Enable the function stack tracing (for developer debugging)." OFF
@@ -618,7 +653,8 @@ HDF_TEST_EXPRESS "Control testing framework (0-3)"
HDF5_TEST_VFD "Execute tests with different VFDs" OFF
HDF5_USE_16_API_DEFAULT "Use the HDF5 1.6.x API by default" OFF
HDF5_USE_18_API_DEFAULT "Use the HDF5 1.8.x API by default" OFF
-HDF5_USE_110_API_DEFAULT "Use the HDF5 1.10.x API by default" ON
+HDF5_USE_110_API_DEFAULT "Use the HDF5 1.10.x API by default" OFF
+HDF5_USE_112_API_DEFAULT "Use the HDF5 1.12.x API by default" ON
HDF5_USE_FOLDERS "Enable folder grouping of projects in IDEs." ON
HDF5_WANT_DATA_ACCURACY "IF data accuracy is guaranteed during data conversions" ON
HDF5_WANT_DCONV_EXCEPTION "exception handling functions is checked during data conversions" ON
@@ -650,6 +686,20 @@ NOTE:
flag is not available on windows and some modern linux systems will
ignore the flag.
+ ---------------- Unsupported Library Options ---------------------
+ The threadsafe, C++ and Java interfaces are not compatible
+ with the HDF5_ENABLE_PARALLEL option.
+ Unless ALLOW_UNSUPPORTED has been specified,
+ the following options must be disabled:
+ HDF5_ENABLE_THREADSAFE, HDF5_BUILD_CPP_LIB, HDF5_BUILD_JAVA
+
+ The high-level, C++, Fortran and Java interfaces are not compatible
+ with the HDF5_ENABLE_THREADSAFE option because the lock is not hoisted
+ into the higher-level API calls.
+ Unless ALLOW_UNSUPPORTED has been specified,
+ the following options must be disabled:
+ HDF5_BUILD_HL_LIB, HDF5_BUILD_CPP_LIB, HDF5_BUILD_FORTRAN, HDF5_BUILD_JAVA
+
========================================================================
VII. User Defined Options for HDF5 Libraries with CMake
@@ -664,6 +714,30 @@ Copy the contents of the file, both macro and option, into the
UserMacros.cmake file. Then enable the option to the CMake configuration,
build and test process.
+
+========================================================================
+VIII. User Defined Compile Flags for HDF5 Libraries with CMake
+========================================================================
+
+Custom compiler flags can be added by defining the CMAKE_C_FLAGS and
+CMAKE_CXX_FLAGS variables.
+Using a cmake script:
+ set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O2")
+Defined on the configure line:
+ cmake -G "Visual Studio 12 2013" -DCMAKE_C_FLAGS:STRING=-O2 ..
+
+Debug symbols are enabled with configuration selections Debug or RelWithDebInfo.
+The difference between Debug and RelWithDebInfo configurations is that
+RelWithDebInfo optimizes the code similar to Release. It produces fully optimized
+code, but also creates the symbol table and the debug metadata to give the
+debugger input to map the execution back to the original code.
+RelwithDebInfo configuration should not affect the performance when the code
+is run without a debugger attached.
+
+The HDF5_ENABLE_COVERAGE option will add "-g -O0 -fprofile-arcs -ftest-coverage"
+to CMAKE_C_FLAGS.
+
+
========================================================================
For further assistance, send email to help@hdfgroup.org
========================================================================
diff --git a/release_docs/INSTALL_Cygwin.txt b/release_docs/INSTALL_Cygwin.txt
index ddffcf1..74f494c 100755
--- a/release_docs/INSTALL_Cygwin.txt
+++ b/release_docs/INSTALL_Cygwin.txt
@@ -66,12 +66,11 @@ Preconditions:
2.2.2 Szip
The HDF5 library has a predefined compression filter that uses
the extended-Rice lossless compression algorithm for chunked
- datatsets. For more information about Szip compression and
- license terms see
- http://hdfgroup.org/HDF5/doc_resource/SZIP/index.html.
+ datatsets. For more information on Szip compression, license terms,
+ and obtaining the Szip source code, see:
+
+ https://portal.hdfgroup.org/display/HDF5/Szip+Compression+in+HDF+Products
- The latest supported public release of SZIP is available from
- ftp://ftp.hdfgroup.org/lib-external/szip/2.1.
2.3 Additional Utilities
@@ -266,4 +265,5 @@ Build, Test and Install HDF5 on Cygwin
-----------------------------------------------------------------------
-Need Further assistance, email help@hdfgroup.org
+ HDF Forum: https://forum.hdfgroup.org/
+ HDF Helpdesk: https://portal.hdfgroup.org/display/support/The+HDF+Help+Desk
diff --git a/release_docs/INSTALL_Warnings.txt b/release_docs/INSTALL_Warnings.txt
new file mode 100644
index 0000000..5fde45f
--- /dev/null
+++ b/release_docs/INSTALL_Warnings.txt
@@ -0,0 +1,474 @@
+***********************************************************************
+* COMPILER WARNINGS OPTIONS
+***********************************************************************
+
+ Table of Contents
+
+Section I: Managing Warnings
+Section II: Default Warnings
+Section III: All Warnings
+Section IV: Group 0 Warnings
+Section V: Group 1 Warnings
+Section VI: Group 2 Warnings
+Section VII: Group 3 Warnings
+Section VIII: Group 4 Warnings
+Section IX: Disable Warnings
+
+************************************************************************
+
+
+========================================================================
+I. Managing Warnings
+========================================================================
+Compiler warnings are managed by setting the compiler flags variables.
+
+Autotools uses the H5_CFLAGS and H5_CXXFLAGS, both variables set the flags nearly
+ identical, along with H5_FCFLAGS for Fortran. Autotools uses the type
+ and version of the compiler to determine which warning flags are used.
+ However, there is an option, enable-developer-warnings, to enable extra
+ flags for developers.
+
+CMake uses the CMAKE_C_FLAGS and CMAKE_CXX_FLAGS, both sets are nearly
+ identical, along with CMAKE_Fortran_FLAGS for Fortran. CMake has a
+ minimum set of flags for GNU type compilers and for MSVC compilers. In
+ addition, CMake breaks the list of flags into groups. The groups for
+ GNU are roughly associated with the version of the compiler, while
+ the MSVC groups are associated with the warning levels for the
+ Microsoft compilers. The CMake option for enabling extra developer
+ warnings is HDF5_ENABLE_DEV_WARNINGS.
+
+Custom settings can be used by setting;
+ Environment variables H5_CFLAGS and H5_CXXFLAGS for Autotools
+ CMake defines CMAKE_C_FLAGS and CMAKE_CXX_FLAGS for CMake
+
+
+========================================================================
+II. Default Warnings
+========================================================================
+
+--------------------------------------------------
+Autotools UNIX warnings added to H5_CFLAGS
+--------------------------------------------------
+ -std=c99
+
+ the following warning switches should not raise warnings by the current code
+ -pedantic
+ -Wall
+ -Wextra
+ -Wbad-function-cast
+ -Wc++-compat
+ -Wcast-align
+ -Wcast-qual
+ -Wconversion
+ -Wdeclaration-after-statement
+ -Wdisabled-optimization
+ -Wfloat-equal
+ -Wformat=2
+ -Winit-self
+ -Winvalid-pch
+ -Wmissing-declarations
+ -Wmissing-include-dirs
+ -Wmissing-prototypes
+ -Wnested-externs
+ -Wold-style-definition
+ -Wpacked
+ -Wpointer-arith
+ -Wredundant-decls
+ -Wshadow
+ -Wstrict-prototypes
+ -Wswitch-default
+ -Wswitch-enum
+ -Wundef
+ -Wunused-macros
+ -Wunsafe-loop-optimizations
+ -Wwrite-strings
+
+ enable-developer-warnings=ON
+ -Winline
+ -Waggregate-return
+ -Wmissing-format-attribute
+ -Wmissing-noreturn
+ enable-developer-warnings=OFF
+ -Wno-inline
+ -Wno-aggregate-return
+ -Wno-missing-format-attribute
+ -Wno-missing-noreturn
+
+IF GCC <= 4.3
+ -Wno-long-long
+ -Wvolatile-register-var
+ -Wstrict-overflow
+
+IF GCC <= 4.4
+ -Wno-long-long
+ -Wvolatile-register-var
+ -Wstrict-overflow
+ -Wlogical-op
+ -Wvla
+
+IF GCC <= 4.5
+ -Wno-long-long
+ -Wvolatile-register-var
+ -Wstrict-overflow
+ -Wlogical-op
+ -Wvla
+ -Wlarger-than=2048
+ -Wsync-nand
+ -Wframe-larger-than=16384
+ -Wpacked-bitfield-compat
+
+IF GCC <= 4.6
+ -Wno-long-long
+ -Wlogical-op
+ -Wvla
+ -Wlarger-than=2048
+ -Wsync-nand
+ -Wframe-larger-than=16384
+ -Wpacked-bitfield-compat
+ -Wstrict-aliasing
+ -Wstrict-overflow=5
+ -Wjump-misses-init
+ -Wunsuffixed-float-constants
+
+IF GCC <= 4.7
+ -Wno-long-long
+ -Wlogical-op
+ -Wvla
+ -Wlarger-than=2048
+ -Wsync-nand
+ -Wframe-larger-than=16384
+ -Wpacked-bitfield-compat
+ -Wstrict-aliasing
+ -Wstrict-overflow=5
+ -Wjump-misses-init
+ -Wunsuffixed-float-constants
+ -Wdouble-promotion
+ -Wtrampolines
+ enable-developer-warnings=ON:
+ -Wsuggest-attribute=const
+ enable-developer-warnings=OFF:
+ -Wno-suggest-attribute=const
+
+IF GCC <= 4.8
+ -Wlogical-op
+ -Wvla
+ -Wlarger-than=2048
+ -Wsync-nand
+ -Wframe-larger-than=16384
+ -Wpacked-bitfield-compat
+ -Wstrict-overflow=5
+ -Wjump-misses-init
+ -Wunsuffixed-float-constants
+ -Wdouble-promotion
+ -Wtrampolines
+ -Wstack-usage=8192
+ -Wvector-operation-performance
+ enable-developer-warnings=ON:
+ -Wsuggest-attribute=const
+ -Wsuggest-attribute=pure
+ -Wsuggest-attribute=noreturn
+ enable-developer-warnings=OFF:
+ -Wno-suggest-attribute=const
+ -Wno-suggest-attribute=pure
+ -Wno-suggest-attribute=noreturn
+
+IF GCC <= 4.9
+ -Wlogical-op
+ -Wvla
+ -Wlarger-than=2048
+ -Wsync-nand
+ -Wframe-larger-than=16384
+ -Wpacked-bitfield-compat
+ -Wstrict-overflow=5
+ -Wjump-misses-init
+ -Wdouble-promotion
+ -Wtrampolines
+ -Wstack-usage=8192
+ -Wvector-operation-performance
+ enable-developer-warnings=ON:
+ -Wsuggest-attribute=const
+ -Wsuggest-attribute=pure
+ -Wsuggest-attribute=noreturn
+ -Wsuggest-attribute=format
+ enable-developer-warnings=OFF:
+ -Wno-suggest-attribute=const
+ -Wno-suggest-attribute=pure
+ -Wno-suggest-attribute=noreturn
+ -Wno-suggest-attribute=format
+
+IF GCC < 5
+ -Wlogical-op
+ -Wvla
+ -Wlarger-than=2048
+ -Wsync-nand
+ -Wframe-larger-than=16384
+ -Wpacked-bitfield-compat
+ -Wstrict-overflow=5
+ -Wjump-misses-init
+ -Wunsuffixed-float-constants
+ -Wdouble-promotion
+ -Wtrampolines
+ -Wstack-usage=8192
+ -Wvector-operation-performance
+ -Wdate-time
+ enable-developer-warnings=ON:
+ -Wsuggest-attribute=const
+ -Wsuggest-attribute=pure
+ -Wsuggest-attribute=noreturn
+ -Wsuggest-attribute=format
+ enable-developer-warnings=OFF:
+ -Wno-suggest-attribute=const
+ -Wno-suggest-attribute=pure
+ -Wno-suggest-attribute=noreturn
+ -Wno-suggest-attribute=format
+
+IF GCC < 6
+ -Wlogical-op
+ -Wvla
+ -Wlarger-than=2048
+ -Wsync-nand
+ -Wframe-larger-than=16384
+ -Wpacked-bitfield-compat
+ -Wstrict-overflow=5
+ -Wjump-misses-init
+ -Wunsuffixed-float-constants
+ -Wdouble-promotion
+ -Wtrampolines
+ -Wstack-usage=8192
+ -Wvector-operation-performance
+ -Wdate-time
+ -Warray-bounds=2
+ -Wc99-c11-compat
+ enable-developer-warnings=ON:
+ -Wsuggest-attribute=const
+ -Wsuggest-attribute=pure
+ -Wsuggest-attribute=noreturn
+ -Wsuggest-attribute=format
+ enable-developer-warnings=OFF:
+ -Wno-suggest-attribute=const
+ -Wno-suggest-attribute=pure
+ -Wno-suggest-attribute=noreturn
+ -Wno-suggest-attribute=format
+
+IF GCC < 7
+ -Wlogical-op
+ -Wvla
+ -Wlarger-than=2048
+ -Wsync-nand
+ -Wframe-larger-than=16384
+ -Wpacked-bitfield-compat
+ -Wstrict-overflow=5
+ -Wjump-misses-init
+ -Wunsuffixed-float-constants
+ -Wdouble-promotion
+ -Wtrampolines
+ -Wstack-usage=8192
+ -Wvector-operation-performance
+ -Wdate-time
+ -Warray-bounds=2
+ -Wc99-c11-compat
+ -Wnull-dereference
+ -Wunused-const-variable
+ -Wduplicated-cond -Whsa
+ enable-developer-warnings=ON:
+ -Wsuggest-attribute=const
+ -Wsuggest-attribute=pure
+ -Wsuggest-attribute=noreturn
+ -Wsuggest-attribute=format
+ enable-developer-warnings=OFF:
+ -Wno-suggest-attribute=const
+ -Wno-suggest-attribute=pure
+ -Wno-suggest-attribute=noreturn
+ -Wno-suggest-attribute=format
+
+
+--------------------------------------------
+CMake warnings added to CMAKE_C_FLAGS
+--------------------------------------------
+
+IF GNU GCC
+ -pedantic
+ -Wall
+ -Wextra
+ -Wbad-function-cast
+ -Wc++-compat
+ -Wcast-align
+ -Wcast-qual
+ -Wconversion
+ -Wdeclaration-after-statement
+ -Wdisabled-optimization
+ -Wfloat-equal
+ -Wformat=2
+ -Winit-self
+ -Winvalid-pch
+ -Wmissing-declarations
+ -Wmissing-include-dirs
+ -Wmissing-prototypes
+ -Wnested-externs
+ -Wold-style-definition
+ -Wpacked
+ -Wpointer-arith
+ -Wredundant-decls
+ -Wshadow
+ -Wstrict-prototypes
+ -Wswitch-default
+ -Wswitch-enum
+ -Wundef
+ -Wunused-macros
+ -Wunsafe-loop-optimizations
+ -Wwrite-strings
+
+ -fmessage-length=0
+ HDF5_ENABLE_DEV_WARNINGS=ON
+ -Winline
+ -Waggregate-return
+ HDF5_ENABLE_DEV_WARNINGS=OFF
+ -Wno-unused-parameter
+ -Wno-inline
+ -Wno-aggregate-return
+
+
+========================================================================
+III. All Warnings in CMake
+========================================================================
+
+Default: HDF5_ENABLE_DEV_WARNINGS:BOOL=OFF
+ For Visual Studio:
+ /W3
+
+HDF5_ENABLE_ALL_WARNINGS:BOOL=ON
+ For Visual Studio:
+ /Wall
+ /wd4668
+
+ For GNU GCC
+ Group 0 flags
+ Group 1 flags
+ Group 2 flags
+
+
+========================================================================
+IV. Group 0 Warnings in CMake
+========================================================================
+
+Default: HDF5_ENABLE_GROUPZERO_WARNINGS:BOOL=OFF
+
+HDF5_ENABLE_GROUPZERO_WARNINGS:BOOL=ON
+ For Visual Studio
+ /W1
+
+ For GNU GCC
+ Default Warnings
+
+
+========================================================================
+V. Group 1 Warnings in CMake
+========================================================================
+
+Default: HDF5_ENABLE_GROUPONE_WARNINGS:BOOL=OFF
+
+HDF5_ENABLE_GROUPONE_WARNINGS:BOOL=ON
+ For Visual Studio
+ /W2
+
+ For GNU GCC
+ IF GCC >= 4.3
+ -Wlogical-op
+ -Wvla
+ -Wlarger-than=2048
+ IF GCC >= 4.4
+ -Wsync-nand
+ -Wframe-larger-than=16384
+ -Wpacked-bitfield-compat
+ IF GCC >= 4.5
+ -Wstrict-overflow=5
+ -Wjump-misses-init
+ -Wunsuffixed-float-constants
+
+
+========================================================================
+VI. Group 2 Warnings in CMake
+========================================================================
+
+Default: HDF5_ENABLE_GROUPTWO_WARNINGS:BOOL=OFF
+
+HDF5_ENABLE_GROUPTWO_WARNINGS:BOOL=ON
+ For Visual Studio
+ /W3
+
+ For GNU GCC
+ IF GCC >= 4.6
+ -Wdouble-promotion
+ -Wtrampolines
+ enable-developer-warnings=ON:
+ -Wsuggest-attribute=const
+ enable-developer-warnings=OFF:
+ -Wno-suggest-attribute=const
+ IF GCC >= 4.7
+ -Wstack-usage=8192
+ -Wvector-operation-performance
+ enable-developer-warnings=ON:
+ -Wsuggest-attribute=pure
+ -Wsuggest-attribute=noreturn
+ enable-developer-warnings=OFF:
+ -Wno-suggest-attribute=pure
+ -Wno-suggest-attribute=noreturn
+ IF GCC >= 4.8
+ enable-developer-warnings=ON:
+ -Wsuggest-attribute=format
+ enable-developer-warnings=OFF:
+ -Wno-suggest-attribute=format
+ IF GCC >= 4.8
+ -Wdate-time
+
+
+========================================================================
+VII. Group 3 Warnings in CMake
+========================================================================
+
+Default: HDF5_ENABLE_GROUPTHREE_WARNINGS:BOOL=OFF
+
+HDF5_ENABLE_GROUPTHREE_WARNINGS:BOOL=ON
+ For Visual Studio
+ /W4
+
+ For GNU GCC
+ IF GCC >= 5.1
+ -Warray-bounds=2
+ -Wc99-c11-compat
+
+
+========================================================================
+VIII. Group 4 Warnings in CMake
+========================================================================
+
+Default: HDF5_ENABLE_GROUPFOUR_WARNINGS:BOOL=OFF
+
+HDF5_ENABLE_GROUPFOUR_WARNINGS:BOOL=ON
+ For GNU GCC
+ IF GCC >= 6.0
+ -Wnull-dereference
+ -Wunused-const-variable
+ -Wduplicated-cond
+ -Whsa
+
+
+========================================================================
+IX. Disable Warnings in CMake
+========================================================================
+
+Default: HDF5_DISABLE_COMPILER_WARNINGS:BOOL=OFF
+
+HDF5_DISABLE_COMPILER_WARNINGS:BOOL=ON
+ For Visual Studio
+ HDF5_WARNINGS_BLOCKED:BOOL=ON
+ /W0
+
+ For GNU GCC
+ -w
+
+
+========================================================================
+For further assistance, send email to help@hdfgroup.org
+========================================================================
+
diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt
index 8f3c434..7def78e 100755
--- a/release_docs/RELEASE.txt
+++ b/release_docs/RELEASE.txt
@@ -1,4 +1,4 @@
-HDF5 version 1.10.3 released on 2018-08-21
+HDF5 version 1.10.4 released on 2018-10-05
================================================================================
@@ -32,8 +32,7 @@ If you have any questions or comments, please send them to the HDF Help Desk:
CONTENTS
-- New Features
-- Bug Fixes since HDF5-1.10.2
+- Bug Fixes since HDF5-1.10.3
- Supported Platforms
- Tested Configuration Features Summary
- More Tested Platforms
@@ -44,128 +43,99 @@ CONTENTS
New Features
============
- Library
- -------
- - Moved the H5DOread/write_chunk() API calls to H5Dread/write_chunk()
-
- The functionality of the direct chunk I/O calls in the high-level
- library has been moved to the H5D package in the main library. This
- will allow using those functions without building the high-level
- library. The parameters and functionality of the H5D calls are
- identical to the H5DO calls.
-
- The original H5DO high-level API calls have been retained, though
- they are now just wrappers for the H5D calls. They are marked as
- deprecated and are only available when the library is built with
- deprecated functions. New code should use the H5D calls for this
- reason.
-
- As a part of this work, the following symbols from H5Dpublic.h are no
- longer used:
-
- H5D_XFER_DIRECT_CHUNK_WRITE_FLAG_NAME
- H5D_XFER_DIRECT_CHUNK_WRITE_FILTERS_NAME
- H5D_XFER_DIRECT_CHUNK_WRITE_OFFSET_NAME
- H5D_XFER_DIRECT_CHUNK_WRITE_DATASIZE_NAME
- H5D_XFER_DIRECT_CHUNK_READ_FLAG_NAME
- H5D_XFER_DIRECT_CHUNK_READ_OFFSET_NAME
- H5D_XFER_DIRECT_CHUNK_READ_FILTERS_NAME
-
- And properties with these names are no longer stored in the dataset
- transfer property lists. The symbols are still defined in H5Dpublic.h,
- but only when the library is built with deprecated symbols.
-
- (DER - 2018/05/04)
-
Configuration:
-------------
- - Add missing USE_110_API_DEFAULT option.
+ - Add toolchain and cross-compile support
- Option USE_110_API_DEFAULT sets the default version of
- versioned APIs. The bin/makevers perl script did not set
- the maxidx variable correctly when the 1.10 branch was
- created. This caused the versioning process to always use
- the latest version of any API.
+ Added info on using a toolchain file to INSTALL_CMAKE.txt. A
+ toolchain file is also used in cross-compiling, which requires
+ CMAKE_CROSSCOMPILING_EMULATOR to be set. To help with cross-compiling
+ the fortran configure process, the HDF5UseFortran.cmake file macros
+ were improved. Fixed a Fortran configure file issue that incorrectly
+ used #cmakedefine instead of #define.
- (ADB - 2018/08/17, HDFFV-10552)
+ (ADB - 2018/10/04, HDFFV-10594)
- - Added configuration checks for the following MPI functions:
+ - Add warning flags for Intel compilers
- MPI_Mprobe - Used for the Parallel Compression feature
- MPI_Imrecv - Used for the Parallel Compression feature
+ Identified Intel compiler specific warnings flags that should be used
+ instead of GNU flags.
- MPI_Get_elements_x - Used for the "big Parallel I/O" feature
- MPI_Type_size_x - Used for the "big Parallel I/O" feature
+ (ADB - 2018/10/04, TRILABS-21)
- (JTH - 2018/08/02, HDFFV-10512)
+ - Add default rpath to targets
- - Added section to the libhdf5.settings file to indicate
- the status of the Parallel Compression and "big Parallel I/O"
- features.
+ Default rpaths should be set in shared executables and
+ libraries to allow the use of loading dependent libraries
+ without requiring LD_LIBRARY_PATH to be set. The default
+ path should be relative using @rpath on osx and $ORIGIN
+ on linux. Windows is not affected.
- (JTH - 2018/08/02, HDFFV-10512)
+ (ADB - 2018/09/26, HDFFV-10594)
- - Add option to execute swmr shell scripts from CMake.
-
- Option TEST_SHELL_SCRIPTS redirects processing into a
- separate ShellTests.cmake file for UNIX types. The tests
- execute the shell scripts if a SH program is found.
+ Library:
+ --------
+ - Allow pre-generated H5Tinit.c and H5make_libsettings.c to be used.
- (ADB - 2018/07/16)
+ Rather than always running H5detect and generating H5Tinit.c and
+ H5make_libsettings.c, supply a location for those files.
+ (ADB - 2018/09/18, HDFFV-10332)
- C++ Library:
- ------------
- - New wrappers
- Added the following items:
+Bug Fixes since HDF5-1.10.3 release
+==================================
- + Class DSetAccPropList for the dataset access property list.
+ Library
+ -------
+ - Allow H5detect and H5make_libsettings to take a file as an argument.
- + Wrapper for H5Dget_access_plist to class DataSet
- // Gets the access property list of this dataset.
- DSetAccPropList getAccessPlist() const;
+ Rather than only writing to stdout, add a command argument to name
+ the file that H5detect and H5make_libsettings will use for output.
+ Without an argument, stdout is still used, so backwards compatibility
+ is maintained.
- + Wrappers for H5Pset_chunk_cache and H5Pget_chunk_cache to class DSetAccPropList
- // Sets the raw data chunk cache parameters.
- void setChunkCache(size_t rdcc_nslots, size_t rdcc_nbytes, double rdcc_w0)
+ (ADB - 2018/09/05, HDFFV-9059)
- // Retrieves the raw data chunk cache parameters.
- void getChunkCache(size_t &rdcc_nslots, size_t &rdcc_nbytes, double &rdcc_w0)
+ - A bug was discovered in the parallel library where an application
+ would hang if a collective read/write of a chunked dataset occurred
+ when collective metadata reads were enabled and some of the ranks
+ had no selection in the dataset's dataspace. The ranks which had no
+ selection in the dataset's dataspace called H5D__chunk_addrmap() to
+ retrieve the lowest chunk address in the dataset. This is because we
+ require reads/writes to be performed in strictly non-decreasing order
+ of chunk address in the file.
- + New operator!= to class DataType (HDFFV-10472)
- // Determines whether two datatypes are not the same.
- bool operator!=(const DataType& compared_type)
+ When the chunk index used was a version 1 or 2 B-tree, these
+ non-participating ranks would issue a collective MPI_Bcast() call
+ that the participating ranks would not issue, causing the hang. Since
+ the non-participating ranks are not actually reading/writing anything,
+ the H5D__chunk_addrmap() call can be safely removed and the address used
+ for the read/write can be set to an arbitrary number (0 was chosen).
- + Wrappers for H5Oget_info2, H5Oget_info_by_name2, and H5Oget_info_by_idx2
- (HDFFV-10458)
+ (JTH - 2018/08/25, HDFFV-10501)
- // Retrieves information about an HDF5 object.
- void getObjinfo(H5O_info_t& objinfo, unsigned fields = H5O_INFO_BASIC) const;
+ Java Library:
+ ----------------
+ - JNI native library dependencies
+
+ The build for the hdf5_java native library used the wrong
+ hdf5 target library for CMake builds. Correcting the hdf5_java
+ library to build with the shared hdf5 library required testing
+ paths to change also.
- // Retrieves information about an HDF5 object, given its name.
- void getObjinfo(const char* name, H5O_info_t& objinfo,
- unsigned fields = H5O_INFO_BASIC,
- const LinkAccPropList& lapl = LinkAccPropList::DEFAULT) const;
- void getObjinfo(const H5std_string& name, H5O_info_t& objinfo,
- unsigned fields = H5O_INFO_BASIC,
- const LinkAccPropList& lapl = LinkAccPropList::DEFAULT) const;
+ (ADB - 2018/08/31, HDFFV-10568)
- // Retrieves information about an HDF5 object, given its index.
- void getObjinfo(const char* grp_name, H5_index_t idx_type,
- H5_iter_order_t order, hsize_t idx, H5O_info_t& objinfo,
- unsigned fields = H5O_INFO_BASIC,
- const LinkAccPropList& lapl = LinkAccPropList::DEFAULT) const;
- void getObjinfo(const H5std_string& grp_name, H5_index_t idx_type,
- H5_iter_order_t order, hsize_t idx, H5O_info_t& objinfo,
- unsigned fields = H5O_INFO_BASIC,
- const LinkAccPropList& lapl = LinkAccPropList::DEFAULT) const;
+ - Java iterator callbacks
- (BMR - 2018/07/22, HDFFV-10150, HDFFV-10458, HDFFV-1047)
+ Change global callback object to a small stack structure in order
+ to fix a runtime crash. This crash was discovered when iterating
+ through a file with nested group members. The global variable
+ visit_callback is overwritten when recursion starts. When recursion
+ completes, visit_callback will be pointing to the wrong callback method.
+ (ADB - 2018/08/15, HDFFV-10536)
- Java Library:
- ----------------
- Java HDFLibraryException class
Change parent class from Exception to RuntimeException.
@@ -181,277 +151,6 @@ New Features
(ADB - 2018/06/02, HDFFV-10519)
-Bug Fixes since HDF5-1.10.2 release
-==================================
-
- Library
- -------
- - Performance issue with H5Oget_info
-
- H5Oget_info family of routines retrieves information for an object such
- as object type, access time, number of attributes, and storage space etc.
- Retrieving all such information regardless is an overkill and causes
- performance issue when doing so for many objects.
-
- Add an additional parameter "fields" to the the H5Oget_info family of routines
- indicating the type of information to be retrieved. The same is done to
- the H5Ovisit family of routines which recursively visits an object
- returning object information in a callback function. Both sets of routines
- are versioned and the corresponding compatibility macros are added.
-
- The version 2 names of the two sets of routines are:
- (1) H5Oget_info2, H5Oget_info_by_idx2, H5Oget_info_by_name2
- (2) H5Ovisit2, H5Ovisit_by_name2
-
- (VC - 2018/08/15, HDFFV-10180)
-
- - Test failure due to metadata size in test/vds.c
-
- The size of metadata from test_api_get_ex_dcpl() in test/vds.c is not as expected
- because the latest format should be used when encoding the layout for VDS.
-
- Set the latest format in a temporary fapl and pass the setting to the routines that
- encode the dataset selection for VDS.
-
- (VC - 2018/08/14 HDFFV-10469)
-
- - Java HDF5LibraryException class
-
- The error minor and major values would be lost after the
- constructor executed.
-
- Created two local class variables to hold the values obtained during
- execution of the constructor. Refactored the class functions to retrieve
- the class values rather then calling the native functions.
- The native functions were renamed and called only during execution
- of the constructor.
- Added error checking to calling class constructors in JNI classes.
-
- (ADB - 2018/08/06, HDFFV-10544)
-
- - Added checks of the defined MPI_VERSION to guard against usage of
- MPI-3 functions in the Parallel Compression and "big Parallel I/O"
- features when HDF5 is built with MPI-2. Previously, the configure
- step would pass but the build itself would fail when it could not
- locate the MPI-3 functions used.
-
- As a result of these new checks, HDF5 can again be built with MPI-2,
- but the Parallel Compression feature will be disabled as it relies
- on the MPI-3 functions used.
-
- (JTH - 2018/08/02, HDFFV-10512)
-
- - User's patches: CVEs
-
- The following patches have been applied:
-
- CVE-2018-11202 - NULL pointer dereference was discovered in
- H5S_hyper_make_spans in H5Shyper.c (HDFFV-10476)
- https://security-tracker.debian.org/tracker/CVE-2018-11202
- https://cve.mitre.org/cgi-bin/cvename.cgi?name=3DCVE-2018-11202
-
- CVE-2018-11203 - A division by zero was discovered in
- H5D__btree_decode_key in H5Dbtree.c (HDFFV-10477)
- https://security-tracker.debian.org/tracker/CVE-2018-11203
- https://cve.mitre.org/cgi-bin/cvename.cgi?name=3DCVE-2018-11203
-
- CVE-2018-11204 - A NULL pointer dereference was discovered in
- H5O__chunk_deserialize in H5Ocache.c (HDFFV-10478)
- https://security-tracker.debian.org/tracker/CVE-2018-11204
- https://cve.mitre.org/cgi-bin/cvename.cgi?name=3DCVE-2018-11204
-
- CVE-2018-11206 - An out of bound read was discovered in
- H5O_fill_new_decode and H5O_fill_old_decode in H5Ofill.c
- (HDFFV-10480)
- https://security-tracker.debian.org/tracker/CVE-2018-11206
- https://cve.mitre.org/cgi-bin/cvename.cgi?name=3DCVE-2018-11206
-
- CVE-2018-11207 - A division by zero was discovered in
- H5D__chunk_init in H5Dchunk.c (HDFFV-10481)
- https://security-tracker.debian.org/tracker/CVE-2018-11207
- https://cve.mitre.org/cgi-bin/cvename.cgi?name=3DCVE-2018-11207
-
- (BMR - 2018/7/22, PR#s: 1134 and 1139,
- HDFFV-10476, HDFFV-10477, HDFFV-10478, HDFFV-10480, HDFFV-10481)
-
- - H5Adelete
-
- H5Adelete failed when deleting the last "large" attribute that
- is stored densely via fractal heap/v2 b-tree.
-
- After removing the attribute, update the ainfo message. If the
- number of attributes goes to zero, remove the message.
-
- (VC - 2018/07/20, HDFFV-9277)
-
- - A bug was discovered in the parallel library which caused partial
- parallel reads of filtered datasets to return incorrect data. The
- library used the incorrect dataspace for each chunk read, causing
- the selection used in each chunk to be wrong.
-
- The bug was not caught during testing because all of the current
- tests which do parallel reads of filtered data read all of the data
- using an H5S_ALL selection. Several tests were added which exercise
- partial parallel reads.
-
- (JTH - 2018/07/16, HDFFV-10467)
-
- - A bug was discovered in the parallel library which caused parallel
- writes of filtered datasets to trigger an assertion failure in the
- file free space manager.
-
- This occurred when the filter used caused chunks to repeatedly shrink
- and grow over the course of several dataset writes. The previous chunk
- information, such as the size of the chunk and the offset in the file,
- was being cached and not updated after each write, causing the next write
- to the chunk to retrieve the incorrect cached information and run into
- issues when reallocating space in the file for the chunk.
-
- (JTH - 2018/07/16, HDFFV-10509)
-
- - A bug was discovered in the parallel library which caused the
- H5D__mpio_array_gatherv() function to allocate too much memory.
-
- When the function is called with the 'allgather' parameter set
- to a non-true value, the function will receive data from all MPI
- ranks and gather it to the single rank specied by the 'root'
- parameter. However, the bug in the function caused memory for
- the received data to be allocated on all MPI ranks, not just the
- singular rank specified as the receiver. In some circumstances,
- this would cause an application to fail due to the large amounts
- of memory being allocated.
-
- (JTH - 2018/07/16, HDFFV-10467)
-
- - Error checks in h5stat and when decoding messages
-
- h5stat exited with seg fault/core dumped when
- errors are encountered in the internal library.
-
- Add error checks and --enable-error-stack option to h5stat.
- Add range checks when decoding messages: old fill value, old
- layout and refcount.
-
- (VC - 2018/07/11, HDFFV-10333)
-
- - If an HDF5 file contains a malformed compound datatype with a
- suitably large offset, the type conversion code can run off
- the end of the type conversion buffer, causing a segmentation
- fault.
-
- This issue was reported to The HDF Group as issue #CVE-2017-17507.
-
- NOTE: The HDF5 C library cannot produce such a file. This condition
- should only occur in a corrupt (or deliberately altered) file
- or a file created by third-party software.
-
- THE HDF GROUP WILL NOT FIX THIS BUG AT THIS TIME
-
- Fixing this problem would involve updating the publicly visible
- H5T_conv_t function pointer typedef and versioning the API calls
- which use it. We normally only modify the public API during
- major releases, so this bug will not be fixed at this time.
-
- (DER - 2018/02/26, HDFFV-10356)
-
-
- Configuration
- -------------
- - Applied patches to address Cywin build issues
-
- There were three issues for Cygwin builds:
- - Shared libs were not built.
- - The -std=c99 flag caused a SIG_SETMASK undeclared error.
- - Undefined errors when buildbing test shared libraries.
-
- Patches to address these issues were received and incorporated in this version.
-
- (LRK - 2018/07/18, HDFFV-10475)
-
- - The --enable-debug/production configure flags are listed as 'deprecated'
- when they should really be listed as 'removed'.
-
- In the autotools overhaul several years ago, we removed these flags and
- implemented a new --enable-build-mode= flag. This was done because we
- changed the semantics of the modes and didn't want users to silently
- be exposed to them. The newer system is also more flexible and us to
- add other modes (like 'clean').
-
- The --enable-debug/production flags are now listed as removed.
-
- (DER - 2018/05/31, HDFFV-10505)
-
- - Moved the location of gcc attribute.
-
- The gcc attribute(no_sanitize), named as the macro HDF_NO_UBSAN,
- was located after the function name. Builds with GCC 7 did not
- indicate any problem, but GCC 8 issued errors. Moved the
- attribute before the function name, as required.
-
- (ADB - 2018/05/22, HDFFV-10473)
-
- - Reworked java test suite into individual JUnit tests.
-
- Testing the whole suite of java unit tests in a single JUnit run
- made it difficult to determine actual failures when tests would fail.
- Running each file set of tests individually, allows individual failures
- to be diagnosed easier. A side benefit is that tests for optional components
- of the library can be disabled if not configured.
-
- (ADB - 2018/05/16, HDFFV-9739)
-
- - Converted CMake global commands ADD_DEFINITIONS and INCLUDE_DIRECTORIES
- to use target_* type commands. This change modernizes the CMake usage
- in the HDF5 library.
-
- In addition, there is the intention to convert to generator expressions,
- where possible. The exception is Fortran FLAGS on Windows Visual Studio.
- The HDF macros TARGET_C_PROPERTIES and TARGET_FORTRAN_PROPERTIES have
- been removed with this change in usage.
-
- The additional language (C++ and Fortran) checks have also been localized
- to only be checked when that language is enabled.
-
- (ADB - 2018/05/08)
-
-
- Performance
- -------------
- - Revamped internal use of DXPLs, improving performance
-
- (QAK - 2018/05/20)
-
-
- Fortran
- --------
- - Fixed issue with h5fget_obj_count_f and using a file id of H5F_OBJ_ALL_F not
- returning the correct count.
-
- (MSB - 2018/5/15, HDFFV-10405)
-
-
- C++ APIs
- --------
- - Adding default arguments to existing functions
-
- Added the following items:
- + Two more property list arguments are added to H5Location::createDataSet:
- const DSetAccPropList& dapl = DSetAccPropList::DEFAULT
- const LinkCreatPropList& lcpl = LinkCreatPropList::DEFAULT
-
- + One more property list argument is added to H5Location::openDataSet:
- const DSetAccPropList& dapl = DSetAccPropList::DEFAULT
-
- (BMR - 2018/07/21, PR# 1146)
-
- - Improvement C++ documentation
-
- Replaced the table in main page of the C++ documentation from mht to htm format
- for portability.
-
- (BMR - 2018/07/17, PR# 1141)
-
-
Supported Platforms
===================
@@ -497,7 +196,8 @@ Supported Platforms
Mac OS Sierra 10.12.6 Apple LLVM version 8.1.0 (clang/clang++-802.0.42)
64-bit gfortran GNU Fortran (GCC) 7.1.0
- (swallow/kite) Intel icc/icpc/ifort version 17.0.2
+ (kite) Intel icc/icpc/ifort version 17.0.2
+
Tested Configuration Features Summary
=====================================
@@ -526,9 +226,9 @@ Mac OS X Mavericks 10.9.5 64-bit n y/y n y y y
Mac OS X Yosemite 10.10.5 64-bit n y/y n y y y
Mac OS X El Capitan 10.11.6 64-bit n y/y n y y y
Mac OS Sierra 10.12.6 64-bit n y/y n y y y
-CentOS 7.2 Linux 2.6.32 x86_64 PGI n y/y n y y y
-CentOS 7.2 Linux 2.6.32 x86_64 GNU y y/y y y y y
-CentOS 7.2 Linux 2.6.32 x86_64 Intel n y/y n y y y
+CentOS 7.2 Linux 3.10.0 x86_64 PGI n y/y n y y y
+CentOS 7.2 Linux 3.10.0 x86_64 GNU y y/y y y y y
+CentOS 7.2 Linux 3.10.0 x86_64 Intel n y/y n y y y
Linux 2.6.32-573.18.1.el6.ppc64 n y/y n y y y
@@ -546,9 +246,9 @@ Mac OS X Mavericks 10.9.5 64-bit y n y y
Mac OS X Yosemite 10.10.5 64-bit y n y y
Mac OS X El Capitan 10.11.6 64-bit y n y y
Mac OS Sierra 10.12.6 64-bit y n y y
-CentOS 7.2 Linux 2.6.32 x86_64 PGI y y y n
-CentOS 7.2 Linux 2.6.32 x86_64 GNU y y y y
-CentOS 7.2 Linux 2.6.32 x86_64 Intel y y y n
+CentOS 7.2 Linux 3.10.0 x86_64 PGI y y y n
+CentOS 7.2 Linux 3.10.0 x86_64 GNU y y y y
+CentOS 7.2 Linux 3.10.0 x86_64 Intel y y y n
Linux 2.6.32-573.18.1.el6.ppc64 y y y n
Compiler versions for each platform are listed in the preceding
diff --git a/release_docs/USING_CMake_Examples.txt b/release_docs/USING_CMake_Examples.txt
index 6f744d9..d5fae39 100644
--- a/release_docs/USING_CMake_Examples.txt
+++ b/release_docs/USING_CMake_Examples.txt
@@ -46,7 +46,7 @@ Default installation process:
Copy HDF5_Examples.cmake to this directory.
The default source folder is defined as "HDF5Examples". It can be changed
with the CTEST_SOURCE_NAME script option.
- The default installation folder is defined as "@CMAKE_INSTALL_PREFIX@".
+ The default installation folder is defined for the platform.
It can be changed with the INSTALLDIR script option.
(Note: Windows has issues with spaces and paths -The path will need to
be set correctly.)
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 3c5526f..3370c99 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -853,24 +853,62 @@ endif ()
# Setup the H5detect utility which generates H5Tinit with platform
# specific type checks inside
#-----------------------------------------------------------------------------
-add_executable (H5detect ${HDF5_SRC_DIR}/H5detect.c)
-target_include_directories(H5detect PRIVATE "${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
-target_compile_definitions(H5detect PUBLIC ${HDF_EXTRA_C_FLAGS} ${HDF_EXTRA_FLAGS})
-TARGET_C_PROPERTIES (H5detect STATIC)
-target_link_libraries (H5detect
- PRIVATE "$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_LIBRARIES}>" $<$<PLATFORM_ID:Windows>:ws2_32.lib>
- INTERFACE $<$<PLATFORM_ID:Emscripten>:"-O0">
-)
+option (HDF5_USE_PREGEN "Use pre-generated Files" OFF)
+if (HDF5_USE_PREGEN)
+ set (HDF5_GENERATED_SOURCE_DIR ${HDF5_USE_PREGEN_DIR})
+else ()
+ set (HDF5_GENERATED_SOURCE_DIR ${HDF5_BINARY_DIR})
+endif ()
-add_custom_command (
- OUTPUT ${HDF5_BINARY_DIR}/H5Tinit.c
- COMMAND $<TARGET_FILE:H5detect>
- ARGS > ${HDF5_BINARY_DIR}/H5Tinit.c
- DEPENDS H5detect
-)
+if (BUILD_SHARED_LIBS)
+ file (MAKE_DIRECTORY "${HDF5_BINARY_DIR}/shared")
+endif ()
+
+if (NOT EXISTS ${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.c)
+ add_executable (H5detect ${HDF5_SRC_DIR}/H5detect.c)
+ target_include_directories(H5detect PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+ target_compile_definitions(H5detect PUBLIC ${HDF_EXTRA_C_FLAGS} ${HDF_EXTRA_FLAGS})
+ TARGET_C_PROPERTIES (H5detect STATIC)
+ target_link_libraries (H5detect
+ PRIVATE "$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_LIBRARIES}>" $<$<PLATFORM_ID:Windows>:ws2_32.lib>
+ INTERFACE $<$<PLATFORM_ID:Emscripten>:"-O0">
+ )
+
+ add_custom_command (
+ OUTPUT ${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.c
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR}$<TARGET_FILE:H5detect>
+ ARGS ${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.c
+ DEPENDS H5detect
+ WORKING_DIRECTORY ${HDF5_GENERATED_SOURCE_DIR}
+ )
+ if (BUILD_SHARED_LIBS)
+ if (NOT EXISTS ${HDF5_GENERATED_SOURCE_DIR}/shared/H5Tinit.c)
+ add_custom_command (
+ OUTPUT ${HDF5_GENERATED_SOURCE_DIR}/shared/H5Tinit.c
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR}$<TARGET_FILE:H5detect>
+ ARGS ${HDF5_GENERATED_SOURCE_DIR}/shared/H5Tinit.c
+ DEPENDS H5detect
+ WORKING_DIRECTORY ${HDF5_GENERATED_SOURCE_DIR}/shared
+ )
+ else ()
+ set_source_files_properties (${HDF5_GENERATED_SOURCE_DIR}/shared/H5Tinit.c PROPERTIES GENERATED TRUE)
+ endif ()
+ endif ()
+else ()
+ set_source_files_properties (${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.c PROPERTIES GENERATED TRUE)
+ if (BUILD_SHARED_LIBS)
+ add_custom_command (
+ OUTPUT ${HDF5_GENERATED_SOURCE_DIR}/shared/H5Tinit.c
+ COMMAND ${CMAKE_COMMAND}
+ ARGS -E copy_if_different "${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.c" "${HDF5_GENERATED_SOURCE_DIR}/shared/H5Tinit.c"
+ DEPENDS ${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.c
+ )
+ set_source_files_properties (${HDF5_GENERATED_SOURCE_DIR}/shared/H5Tinit.c PROPERTIES GENERATED TRUE)
+ endif ()
+endif ()
add_executable (H5make_libsettings ${HDF5_SRC_DIR}/H5make_libsettings.c)
-target_include_directories(H5make_libsettings PRIVATE "${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+target_include_directories(H5make_libsettings PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
target_compile_definitions(H5make_libsettings PUBLIC ${HDF_EXTRA_C_FLAGS} ${HDF_EXTRA_FLAGS})
TARGET_C_PROPERTIES (H5make_libsettings STATIC)
target_link_libraries (H5make_libsettings
@@ -880,11 +918,20 @@ target_link_libraries (H5make_libsettings
add_custom_command (
OUTPUT ${HDF5_BINARY_DIR}/H5lib_settings.c
- COMMAND $<TARGET_FILE:H5make_libsettings>
- ARGS > ${HDF5_BINARY_DIR}/H5lib_settings.c
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR}$<TARGET_FILE:H5make_libsettings>
+ ARGS ${HDF5_BINARY_DIR}/H5lib_settings.c
DEPENDS H5make_libsettings
WORKING_DIRECTORY ${HDF5_BINARY_DIR}
)
+if (BUILD_SHARED_LIBS)
+ add_custom_command (
+ OUTPUT ${HDF5_BINARY_DIR}/shared/H5lib_settings.c
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR}$<TARGET_FILE:H5make_libsettings>
+ ARGS ${HDF5_BINARY_DIR}/shared/H5lib_settings.c
+ DEPENDS H5make_libsettings
+ WORKING_DIRECTORY ${HDF5_BINARY_DIR}
+ )
+endif ()
## all_packages="AC,B,B2,D,F,FA,FL,FS,HL,I,O,S,ST,T,Z"
#all_packages="AC,B2,CX,D,F,HL,I,O,S,ST,T,Z"
@@ -893,7 +940,7 @@ option (HDF5_ENABLE_DEBUG_APIS "Turn on extra debug output in all packages" OFF)
#-----------------------------------------------------------------------------
# Add H5Tinit source to build - generated by H5detect/CMake at configure time
#-----------------------------------------------------------------------------
-set (gen_SRCS ${HDF5_BINARY_DIR}/H5Tinit.c ${HDF5_BINARY_DIR}/H5lib_settings.c)
+set (gen_SRCS ${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.c ${HDF5_BINARY_DIR}/H5lib_settings.c)
add_library (${HDF5_LIB_TARGET} STATIC ${common_SRCS} ${gen_SRCS} ${H5_PUBLIC_HEADERS} ${H5_PRIVATE_HEADERS} ${H5_GENERATED_HEADERS})
target_include_directories(${HDF5_LIB_TARGET}
@@ -921,22 +968,8 @@ set_target_properties (${HDF5_LIB_TARGET} PROPERTIES FOLDER libraries)
set (install_targets ${HDF5_LIB_TARGET})
if (BUILD_SHARED_LIBS)
- file (MAKE_DIRECTORY "${HDF5_BINARY_DIR}/shared")
- add_custom_command (
- OUTPUT ${HDF5_BINARY_DIR}/shared/H5Tinit.c
- COMMAND $<TARGET_FILE:H5detect>
- ARGS > ${HDF5_BINARY_DIR}/shared/H5Tinit.c
- DEPENDS H5detect
- WORKING_DIRECTORY ${HDF5_BINARY_DIR}/shared
- )
- add_custom_command (
- OUTPUT ${HDF5_BINARY_DIR}/shared/H5lib_settings.c
- COMMAND $<TARGET_FILE:H5make_libsettings>
- ARGS > ${HDF5_BINARY_DIR}/shared/H5lib_settings.c
- DEPENDS H5make_libsettings
- WORKING_DIRECTORY ${HDF5_BINARY_DIR}
- )
- set (shared_gen_SRCS ${HDF5_BINARY_DIR}/shared/H5Tinit.c ${HDF5_BINARY_DIR}/shared/H5lib_settings.c)
+ set (shared_gen_SRCS ${HDF5_GENERATED_SOURCE_DIR}/shared/H5Tinit.c ${HDF5_BINARY_DIR}/shared/H5lib_settings.c)
+
add_library (${HDF5_LIBSH_TARGET} SHARED ${common_SRCS} ${shared_gen_SRCS} ${H5_PUBLIC_HEADERS} ${H5_PRIVATE_HEADERS} ${H5_GENERATED_HEADERS})
target_include_directories(${HDF5_LIBSH_TARGET}
PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>"
diff --git a/src/H5Dmpio.c b/src/H5Dmpio.c
index 9bffd8b..a669593 100644
--- a/src/H5Dmpio.c
+++ b/src/H5Dmpio.c
@@ -925,7 +925,6 @@ H5D__link_chunk_collective_io(H5D_io_info_t *io_info, const H5D_type_info_t *typ
hbool_t chunk_final_ftype_is_derived = FALSE;
H5D_storage_t ctg_store; /* Storage info for "fake" contiguous dataset */
size_t total_chunks;
- haddr_t *total_chunk_addr_array = NULL;
MPI_Datatype *chunk_mtype = NULL;
MPI_Datatype *chunk_ftype = NULL;
MPI_Aint *chunk_disp_array = NULL;
@@ -1146,20 +1145,7 @@ if(H5DEBUG(D))
mpi_buf_count = (hsize_t)1;
} /* end if */
else { /* no selection at all for this process */
- /* Allocate chunking information */
- if(NULL == (total_chunk_addr_array = (haddr_t *)H5MM_malloc(sizeof(haddr_t) * total_chunks)))
- HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate total chunk address arraybuffer")
-
- /* Retrieve chunk address map */
- if(H5D__chunk_addrmap(io_info, total_chunk_addr_array) < 0)
- HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get chunk address")
-
- /* Get chunk with lowest address */
- ctg_store.contig.dset_addr = HADDR_MAX;
- for(u = 0; u < total_chunks; u++)
- if(total_chunk_addr_array[u] < ctg_store.contig.dset_addr)
- ctg_store.contig.dset_addr = total_chunk_addr_array[u];
- HDassert(ctg_store.contig.dset_addr != HADDR_MAX);
+ ctg_store.contig.dset_addr = 0;
/* Set the MPI datatype */
chunk_final_ftype = MPI_BYTE;
@@ -1187,8 +1173,6 @@ if(H5DEBUG(D))
HDfprintf(H5DEBUG(D),"before freeing memory inside H5D_link_collective_io ret_value = %d\n", ret_value);
#endif
/* Release resources */
- if(total_chunk_addr_array)
- H5MM_xfree(total_chunk_addr_array);
if(chunk_addr_info_array)
H5MM_xfree(chunk_addr_info_array);
if(chunk_mtype)
diff --git a/src/H5MF.c b/src/H5MF.c
index cef9de8..65b27db 100644
--- a/src/H5MF.c
+++ b/src/H5MF.c
@@ -3296,7 +3296,7 @@ H5MF_settle_meta_data_fsm(H5F_t *f, hbool_t *fsm_settled)
/* ******************* PROBLEM: ********************
*
- * If the file has an alignement other than 1, and if
+ * If the file has an alignment other than 1, and if
* the EOA is not a multiple of this alignment, allocating space
* for the section via the VFD info has the potential of generating
* a fragment that will be added to the free space manager. This
diff --git a/src/H5detect.c b/src/H5detect.c
index 2d33a3d..4424009 100644
--- a/src/H5detect.c
+++ b/src/H5detect.c
@@ -26,11 +26,6 @@ static const char *FileHeader = "\n\
* help@hdfgroup.org. *\n\
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *";
/*
- *
- * 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.
@@ -44,9 +39,6 @@ static const char *FileHeader = "\n\
* features which aren't available. We're not
* running on a Vax or other machine with mixed
* endianness.
- *
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
#undef NDEBUG
@@ -117,6 +109,8 @@ typedef struct malign_t {
unsigned int comp_align; /* alignment for structure */
} malign_t;
+FILE *rawoutstream = NULL;
+
/* global variables types detection code */
H5_GCC_DIAG_OFF(larger-than=)
static detected_t d_g[MAXDETECT];
@@ -143,9 +137,9 @@ 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 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 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 */
#if defined(H5SETJMP) && defined(H5_HAVE_SIGNAL)
@@ -156,18 +150,13 @@ static H5JMP_BUF jbuf_g;
#endif
+
/*-------------------------------------------------------------------------
* Function: precision
*
- * Purpose: Determine the precision and offset.
- *
- * Return: void
- *
- * Programmer: Robb Matzke
- * Thursday, June 18, 1998
- *
- * Modifications:
+ * Purpose: Determine the precision and offset.
*
+ * Return: void
*-------------------------------------------------------------------------
*/
static void
@@ -175,21 +164,22 @@ precision (detected_t *d)
{
unsigned int n;
- if (0 == d->msize) {
+ if(0 == d->msize) {
/*
* 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.
*/
- if (d->perm[0] < 0) {
+ if(d->perm[0] < 0) {
/*
* Lower addresses are padded.
*/
- for (n = 0; n < d->size && d->perm[n] < 0; n++)
+ for(n = 0; n < d->size && d->perm[n] < 0; n++)
/*void*/;
d->precision = 8 * (d->size - n);
d->offset = 0;
- } else if (d->perm[d->size - 1] < 0) {
+ }
+ else if(d->perm[d->size - 1] < 0) {
/*
* Higher addresses are padded.
*/
@@ -197,36 +187,34 @@ precision (detected_t *d)
/*void*/;
d->precision = 8 * (d->size - n);
d->offset = 8 * n;
- } else {
+ }
+ else {
/*
* No padding.
*/
d->precision = 8 * d->size;
d->offset = 0;
}
- } else {
+ }
+ else {
/* A floating point */
d->offset = MIN3(d->mpos, d->epos, d->sign);
d->precision = d->msize + d->esize + 1;
}
}
-
+
/*-------------------------------------------------------------------------
* 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
- *
- * Programmer: Robb Matzke
- * matzke@llnl.gov
- * Jun 12 1996
+ * Return: void
*
* Modifications:
*
@@ -244,7 +232,7 @@ precision (detected_t *d)
*
* Neil Fortner, 6 Sep 2013
* Split macro into DETECT_I and DETECT_BYTE macros, extracted
- * common cod einto DETECT_I_BYTE_CORE. This was done to remove
+ * common code into DETECT_I_BYTE_CORE. This was done to remove
* "will never be executed" warnings.
*
*-------------------------------------------------------------------------
@@ -289,22 +277,15 @@ precision (detected_t *d)
DETECT_I_BYTE_CORE(TYPE,VAR,INFO,TYPE) \
}
-
+
/*-------------------------------------------------------------------------
* 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.
- *
- * Return: void
- *
- * Programmer: Robb Matzke
- * matzke@llnl.gov
- * Jun 12 1996
- *
+ * 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.
*-------------------------------------------------------------------------
*/
#define DETECT_F(TYPE,VAR,INFO) { \
@@ -393,22 +374,15 @@ precision (detected_t *d)
} \
}
-
+
/*-------------------------------------------------------------------------
* 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.
- *
- * Return: void
- *
- * Programmer: Raymond Lu
- * slu@ncsa.uiuc.edu
- * Dec 9, 2002
- *
- * Modifications:
+ * constructs the names and decides the alignment in structure.
*
+ * Return: void
*-------------------------------------------------------------------------
*/
#define DETECT_M(TYPE,VAR,INFO) { \
@@ -438,29 +412,29 @@ precision (detected_t *d)
_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 */ \
+ *((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]); \
- /*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]; \
+ /* 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); \
+ fprintf(stderr, "unable to calculate alignment for %s\n", #TYPE); \
} \
HDfree(_buf); \
HDsignal(SIGBUS, _handler); /*restore original handler*/ \
@@ -476,21 +450,16 @@ precision (detected_t *d)
#if defined(H5LONGJMP) && defined(H5_HAVE_SIGNAL)
+
/*-------------------------------------------------------------------------
* 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.
- *
- * Return: Returns via H5LONGJMP to jbuf_g.
- *
- * Programmer: Robb Matzke
- * Thursday, March 18, 1999
- *
- * Modifications:
+ * 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.
*-------------------------------------------------------------------------
*/
static void
@@ -514,21 +483,16 @@ sigsegv_handler(int H5_ATTR_UNUSED signo)
#if defined(H5LONGJMP) && defined(H5_HAVE_SIGNAL)
+
/*-------------------------------------------------------------------------
* 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.
- *
- * Return: Returns via H5LONGJMP to jbuf_g.
- *
- * Programmer: Robb Matzke
- * Thursday, March 18, 1999
- *
- * Modifications:
+ * 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.
*-------------------------------------------------------------------------
*/
static void
@@ -552,19 +516,16 @@ sigbus_handler(int H5_ATTR_UNUSED signo)
#if defined(H5LONGJMP) && defined(H5_HAVE_SIGNAL)
+
/*-------------------------------------------------------------------------
* 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.
- *
- * Return: Returns via H5LONGJMP to jbuf_g.
- *
- * Programmer: Raymond Lu
- * 28 October 2013
+ * 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.
*-------------------------------------------------------------------------
*/
static void
@@ -586,20 +547,13 @@ sigill_handler(int H5_ATTR_UNUSED signo)
}
#endif
-
+
/*-------------------------------------------------------------------------
* Function: print_results
*
- * Purpose: Prints information about the detected data types.
- *
- * Return: void
- *
- * Programmer: Robb Matzke
- * matzke@llnl.gov
- * Jun 14, 1996
- *
- * Modifications:
+ * Purpose: Prints information about the detected data types.
*
+ * Return: void
*-------------------------------------------------------------------------
*/
static void
@@ -609,7 +563,7 @@ print_results(int nd, detected_t *d, int na, malign_t *misc_align)
int i, j;
/* Include files */
- printf("\
+ fprintf(rawoutstream, "\
/****************/\n\
/* Module Setup */\n\
/****************/\n\
@@ -662,7 +616,7 @@ print_results(int nd, detected_t *d, int na, malign_t *misc_align)
/*********************/\n\
\n\
\n");
- printf("\n\
+ fprintf(rawoutstream, "\n\
/*******************/\n\
/* Local Variables */\n\
/*******************/\n\
@@ -670,7 +624,7 @@ print_results(int nd, detected_t *d, int na, malign_t *misc_align)
/* The interface initialization function */
- printf("\n\
+ fprintf(rawoutstream, "\n\
\n\
/*-------------------------------------------------------------------------\n\
* Function: H5T__init_native\n\
@@ -713,12 +667,12 @@ H5T__init_native(void)\n\
}
/* Print a comment to describe this section of definitions. */
- printf("\n /*\n");
+ fprintf(rawoutstream, "\n /*\n");
iprint(d+i);
- printf(" */\n");
+ fprintf(rawoutstream, " */\n");
/* The part common to fixed and floating types */
- printf("\
+ fprintf(rawoutstream, "\
if(NULL == (dt = H5T__alloc()))\n\
HGOTO_ERROR(H5E_DATATYPE, H5E_NOSPACE, FAIL, \"datatype allocation failed\")\n\
dt->shared->state = H5T_STATE_IMMUTABLE;\n\
@@ -728,16 +682,16 @@ H5T__init_native(void)\n\
d[i].size); /*size */
if(byte_order==-1)
- printf("\
+ fprintf(rawoutstream, "\
dt->shared->u.atomic.order = H5T_ORDER_VAX;\n");
else if(byte_order==0)
- printf("\
+ fprintf(rawoutstream, "\
dt->shared->u.atomic.order = H5T_ORDER_LE;\n");
else
- printf("\
+ fprintf(rawoutstream, "\
dt->shared->u.atomic.order = H5T_ORDER_BE;\n");
- printf("\
+ fprintf(rawoutstream, "\
dt->shared->u.atomic.offset = %d;\n\
dt->shared->u.atomic.prec = %d;\n\
dt->shared->u.atomic.lsb_pad = H5T_PAD_ZERO;\n\
@@ -746,14 +700,15 @@ H5T__init_native(void)\n\
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) {
+ if(0 == d[i].msize) {
/* The part unique to fixed point types */
- printf("\
+ fprintf(rawoutstream, "\
dt->shared->u.atomic.u.i.sign = H5T_SGN_%s;\n",
d[i].sign ? "2" : "NONE");
- } else {
+ }
+ else {
/* The part unique to floating point types */
- printf("\
+ fprintf(rawoutstream, "\
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\
@@ -772,11 +727,11 @@ H5T__init_native(void)\n\
}
/* Atomize the type */
- printf("\
+ fprintf(rawoutstream, "\
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",
+ fprintf(rawoutstream, " H5T_NATIVE_%s_ALIGN_g = %lu;\n",
d[i].varname, (unsigned long)(d[i].align));
/* Variables for alignment of compound datatype */
@@ -784,28 +739,29 @@ H5T__init_native(void)\n\
!HDstrcmp(d[i].varname, "INT") || !HDstrcmp(d[i].varname, "LONG") ||
!HDstrcmp(d[i].varname, "LLONG") || !HDstrcmp(d[i].varname, "FLOAT") ||
!HDstrcmp(d[i].varname, "DOUBLE") || !HDstrcmp(d[i].varname, "LDOUBLE")) {
- printf(" H5T_NATIVE_%s_COMP_ALIGN_g = %lu;\n",
+ fprintf(rawoutstream, " H5T_NATIVE_%s_COMP_ALIGN_g = %lu;\n",
d[i].varname, (unsigned long)(d[i].comp_align));
}
}
/* Consider VAX a little-endian machine */
if(byte_order==0 || byte_order==-1) {
- printf("\n\
+ fprintf(rawoutstream, "\n\
/* Set the native order for this machine */\n\
H5T_native_order_g = H5T_ORDER_%s;\n", "LE");
- } else {
- printf("\n\
+ }
+ else {
+ fprintf(rawoutstream, "\n\
/* Set the native order for this machine */\n\
H5T_native_order_g = H5T_ORDER_%s;\n", "BE");
}
/* Structure alignment for pointers, hvl_t, hobj_ref_t, hdset_reg_ref_t */
- printf("\n /* Structure alignment for pointers, hvl_t, hobj_ref_t, hdset_reg_ref_t */\n");
+ fprintf(rawoutstream, "\n /* Structure alignment for pointers, hvl_t, hobj_ref_t, hdset_reg_ref_t */\n");
for(j=0; j<na; j++)
- printf(" H5T_%s_COMP_ALIGN_g = %lu;\n", misc_align[j].name, (unsigned long)(misc_align[j].comp_align));
+ fprintf(rawoutstream, " H5T_%s_COMP_ALIGN_g = %lu;\n", misc_align[j].name, (unsigned long)(misc_align[j].comp_align));
- printf("\
+ fprintf(rawoutstream, "\
\n\
done:\n\
if(ret_value < 0) {\n\
@@ -818,73 +774,66 @@ done:\n\
FUNC_LEAVE_NOAPI(ret_value);\n} /* end H5T__init_native() */\n");
/* Print the ALIGNMENT and signal-handling status as comments */
- printf("\n"
+ fprintf(rawoutstream, "\n"
"/****************************************/\n"
"/* ALIGNMENT and signal-handling status */\n"
"/****************************************/\n");
if (align_status_g & STA_NoALIGNMENT)
- printf("/* ALIGNAMENT test is not available */\n");
+ fprintf(rawoutstream, "/* ALIGNAMENT test is not available */\n");
if (align_status_g & STA_NoHandlerVerify)
- printf("/* Signal handlers verify test is not available */\n");
+ fprintf(rawoutstream, "/* 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");
+ fprintf(rawoutstream, "/* Signal() support: yes */\n");
#else
- printf("/* Signal() support: no */\n");
+ fprintf(rawoutstream, "/* Signal() support: no */\n");
#endif
#ifdef H5_HAVE_SETJMP
- printf("/* setjmp() support: yes */\n");
+ fprintf(rawoutstream, "/* setjmp() support: yes */\n");
#else
- printf("/* setjmp() support: no */\n");
+ fprintf(rawoutstream, "/* setjmp() support: no */\n");
#endif
#ifdef H5_HAVE_LONGJMP
- printf("/* longjmp() support: yes */\n");
+ fprintf(rawoutstream, "/* longjmp() support: yes */\n");
#else
- printf("/* longjmp() support: no */\n");
+ fprintf(rawoutstream, "/* longjmp() support: no */\n");
#endif
#ifdef H5_HAVE_SIGSETJMP
- printf("/* sigsetjmp() support: yes */\n");
+ fprintf(rawoutstream, "/* sigsetjmp() support: yes */\n");
#else
- printf("/* sigsetjmp() support: no */\n");
+ fprintf(rawoutstream, "/* sigsetjmp() support: no */\n");
#endif
#ifdef H5_HAVE_SIGLONGJMP
- printf("/* siglongjmp() support: yes */\n");
+ fprintf(rawoutstream, "/* siglongjmp() support: yes */\n");
#else
- printf("/* siglongjmp() support: no */\n");
+ fprintf(rawoutstream, "/* siglongjmp() support: no */\n");
#endif
#ifdef H5_HAVE_SIGPROCMASK
- printf("/* sigprocmask() support: yes */\n");
+ fprintf(rawoutstream, "/* sigprocmask() support: yes */\n");
#else
- printf("/* sigprocmask() support: no */\n");
+ fprintf(rawoutstream, "/* sigprocmask() support: no */\n");
#endif
/* Print the statics of signal handlers called for debugging */
- printf("\n"
+ fprintf(rawoutstream, "\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);
+ fprintf(rawoutstream, "/* signal_handlers tested: %d times */\n", signal_handler_tested_g);
+ fprintf(rawoutstream, "/* sigbus_handler called: %d times */\n", sigbus_handler_called_g);
+ fprintf(rawoutstream, "/* sigsegv_handler called: %d times */\n", sigsegv_handler_called_g);
+ fprintf(rawoutstream, "/* sigill_handler called: %d times */\n", sigill_handler_called_g);
} /* end print_results() */
-
+
/*-------------------------------------------------------------------------
* Function: iprint
*
- * Purpose: Prints information about the fields of a floating point
- * format.
- *
- * Return: void
- *
- * Programmer: Robb Matzke
- * matzke@llnl.gov
- * Jun 13, 1996
- *
- * Modifications:
+ * Purpose: Prints information about the fields of a floating point format.
*
+ * Return: void
+
*-------------------------------------------------------------------------
*/
static void
@@ -892,88 +841,92 @@ iprint(detected_t *d)
{
unsigned int pass;
- for (pass = (d->size - 1) / 4; ; --pass) {
+ for(pass = (d->size - 1) / 4; ; --pass) {
unsigned int i, k;
/*
* Print the byte ordering above the bit fields.
*/
- printf(" * ");
- for (i = MIN(pass * 4 + 3, d->size - 1); i >= pass * 4; --i) {
- printf("%4d", d->perm[i]);
- if (i > pass * 4) HDfputs(" ", stdout);
- if (!i) break;
+ fprintf(rawoutstream, " * ");
+ for(i = MIN(pass * 4 + 3, d->size - 1); i >= pass * 4; --i) {
+ fprintf(rawoutstream, "%4d", d->perm[i]);
+ if(i > pass * 4)
+ HDfputs(" ", stdout);
+ if(!i)
+ break;
}
/*
* Print the bit fields
*/
- printf("\n * ");
- for (i = MIN(pass * 4 + 3, d->size - 1), k = MIN(pass * 32 + 31,
+ fprintf(rawoutstream, "\n * ");
+ for(i = MIN(pass * 4 + 3, d->size - 1), k = MIN(pass * 32 + 31,
8 * d->size - 1); i >= pass * 4; --i) {
unsigned int j;
- for (j = 8; j > 0; --j) {
- if (k == d->sign && d->msize) {
- HDputchar('S');
- } else if (k >= d->epos && k < d->epos + d->esize) {
- HDputchar('E');
- } else if (k >= d->mpos && k < d->mpos + d->msize) {
- HDputchar('M');
- } else if (d->msize) {
- HDputchar('?'); /*unknown floating point bit */
- } else if (d->sign) {
- HDputchar('I');
- } else {
- HDputchar('U');
+ for(j = 8; j > 0; --j) {
+ if(k == d->sign && d->msize) {
+ HDfputc('S', rawoutstream);
+ }
+ else if(k >= d->epos && k < d->epos + d->esize) {
+ HDfputc('E', rawoutstream);
+ }
+ else if(k >= d->mpos && k < d->mpos + d->msize) {
+ HDfputc('M', rawoutstream);
+ }
+ else if(d->msize) {
+ HDfputc('?', rawoutstream); /*unknown floating point bit */
+ }
+ else if(d->sign) {
+ HDfputc('I', rawoutstream);
+ }
+ else {
+ HDfputc('U', rawoutstream);
}
--k;
}
- if (i > pass * 4) HDputchar(' ');
- if (!i) break;
+ if(i > pass * 4)
+ HDfputc(' ', rawoutstream);
+ if(!i)
+ break;
}
- HDputchar('\n');
- if (!pass) break;
+ HDfputc('\n', rawoutstream);
+ if(!pass)
+ break;
}
/*
* Is there an implicit bit in the mantissa.
*/
- if (d->msize) {
- printf(" * Implicit bit? %s\n", d->imp ? "yes" : "no");
+ if(d->msize) {
+ fprintf(rawoutstream, " * Implicit bit? %s\n", d->imp ? "yes" : "no");
}
/*
* Alignment
*/
- if (0 == d->align) {
- printf(" * Alignment: NOT CALCULATED\n");
- } else if (1 == d->align) {
- printf(" * Alignment: none\n");
- } else {
- printf(" * Alignment: %lu\n", (unsigned long) (d->align));
+ if(0 == d->align) {
+ fprintf(rawoutstream, " * Alignment: NOT CALCULATED\n");
+ }
+ else if(1 == d->align) {
+ fprintf(rawoutstream, " * Alignment: none\n");
+ }
+ else {
+ fprintf(rawoutstream, " * Alignment: %lu\n", (unsigned long) (d->align));
}
}
-
+
/*-------------------------------------------------------------------------
* 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.
- *
- * Failure: -1 if all bytes are the same.
- *
- * Programmer: Robb Matzke
- * matzke@llnl.gov
- * Jun 12, 1996
- *
- * Modifications:
- *
+ * Return: Success: Index of differing byte.
+ * Failure: -1 if all bytes are the same.
*-------------------------------------------------------------------------
*/
static int
@@ -990,17 +943,17 @@ byte_cmp(int n, const void *_a, const void *_b, const unsigned char *pad_mask)
return -1;
}
-
+
/*-------------------------------------------------------------------------
* 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.
*
*-------------------------------------------------------------------------
*/
@@ -1013,14 +966,14 @@ bit_cmp(unsigned int nbytes, int *perm, void *_a, void *_b,
unsigned char *b = (unsigned char *) _b;
unsigned char aa, bb;
- for (i = 0; i < nbytes; i++) {
+ for(i = 0; i < nbytes; i++) {
HDassert(perm[i] < (int) nbytes);
- if ((aa = (unsigned char) (a[perm[i]] & pad_mask[perm[i]]))
+ if((aa = (unsigned char) (a[perm[i]] & pad_mask[perm[i]]))
!= (bb = (unsigned char) (b[perm[i]] & pad_mask[perm[i]]))) {
unsigned int j;
- for (j = 0; j < 8; j++, aa >>= 1, bb >>= 1) {
- if ((aa & 1) != (bb & 1)) return i * 8 + j;
+ for(j = 0; j < 8; j++, aa >>= 1, bb >>= 1) {
+ if((aa & 1) != (bb & 1)) return i * 8 + j;
}
fprintf(stderr, "INTERNAL ERROR");
HDabort();
@@ -1031,26 +984,19 @@ bit_cmp(unsigned int nbytes, int *perm, void *_a, void *_b,
return 0;
}
-
+
/*-------------------------------------------------------------------------
* 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.
- *
- * This function assumes that the mantissa byte ordering
- * implies the total ordering.
- *
- * Return: void
+ * 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.
*
- * Programmer: Robb Matzke
- * matzke@llnl.gov
- * Jun 13, 1996
- *
- * Modifications:
+ * This function assumes that the mantissa byte ordering
+ * implies the total ordering.
*
+ * Return: void
*-------------------------------------------------------------------------
*/
static void
@@ -1058,79 +1004,79 @@ fix_order(int n, int last, int *perm, const char **mesg)
{
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]) {
+ if(last > 1) {
/*
- * Little endian.
- */
- if (mesg) *mesg = "Little-endian";
- for (i = 0; i < n; i++) perm[i] = i;
+ * 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 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.
+ }
+ else {
+ /*
+ * Bi-endian machines like VAX.
* (NOTE: This is not an actual determination of the VAX-endianness.
* It could have some other endianness 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);
+ else {
+ fprintf(stderr,
+ "Failed to detect byte order of %d-byte floating point.\n", n);
+ HDexit(1);
}
}
-
+
/*-------------------------------------------------------------------------
* 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 significant 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 significant 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)
- *
- * Programmer: Robb Matzke
- * matzke@llnl.gov
- * Jun 13, 1996
- *
- * Modifications:
- *
- * Robb Matzke, 6 Nov 1996
- * Fixed a bug that occurs with non-implicit architectures.
+ * Failure: 1
*
*-------------------------------------------------------------------------
*/
@@ -1160,26 +1106,14 @@ 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
- *
- * Purpose: Determines the bias of the exponent. This function should
- * be called with _A having a value of `1'.
+ * Function: find_bias
*
- * Return: Success: The exponent bias.
+ * Purpose: Determines the bias of the exponent. This function should
+ * be called with _A having a value of `1'.
*
- * Failure:
- *
- * 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.
+ * Return: The exponent bias.
*
*-------------------------------------------------------------------------
*/
@@ -1190,7 +1124,7 @@ find_bias(unsigned int epos, unsigned int esize, int *perm, void *_a)
unsigned char mask;
unsigned int b, shift = 0, nbits, bias = 0;
- while (esize > 0) {
+ while(esize > 0) {
nbits = MIN(esize, (8 - epos % 8));
mask = (unsigned char) ((1 << nbits) - 1);
b = (unsigned int) (a[perm[epos / 8]] >> (epos % 8)) & mask;
@@ -1203,34 +1137,27 @@ find_bias(unsigned int epos, unsigned int esize, int *perm, void *_a)
return bias;
}
-
+
/*-------------------------------------------------------------------------
* Function: print_header
*
- * Purpose: Prints the C file header for the generated file.
- *
- * Return: void
- *
- * Programmer: Robb Matzke
- * matzke@llnl.gov
- * Mar 12 1997
- *
- * Modifications:
+ * Purpose: Prints the C file header for the generated file.
*
+ * Return: void
*-------------------------------------------------------------------------
*/
static void
print_header(void)
{
- time_t now = HDtime(NULL);
- struct tm *tm = HDlocaltime(&now);
- char real_name[30];
- char host_name[256];
+ time_t now = HDtime(NULL);
+ struct tm *tm = HDlocaltime(&now);
+ char real_name[30];
+ char host_name[256];
int i;
- const char *s;
+ const char *s;
#ifdef H5_HAVE_GETPWUID
- struct passwd *pwd = NULL;
+ struct passwd *pwd = NULL;
#else
int pwd = 1;
#endif
@@ -1281,20 +1208,21 @@ 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';
+ 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';
}
#else
real_name[0] = '\0';
@@ -1304,8 +1232,8 @@ bit.\n";
* The FQDM of this host or the empty string.
*/
#ifdef H5_HAVE_GETHOSTNAME
- if (HDgethostname(host_name, sizeof(host_name)) < 0) {
- host_name[0] = '\0';
+ if(HDgethostname(host_name, sizeof(host_name)) < 0) {
+ host_name[0] = '\0';
}
#else
host_name[0] = '\0';
@@ -1314,78 +1242,71 @@ 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 */
+ fprintf(rawoutstream, "/* Generated automatically by H5detect -- do not edit */\n\n\n");
+ HDfputs(FileHeader, rawoutstream); /*the copyright notice--see top of this file */
- printf(" *\n * Created:\t\t%s %2d, %4d\n",
+ fprintf(rawoutstream, " *\n * Created:\t\t%s %2d, %4d\n",
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);
+ if(pwd || real_name[0] || host_name[0]) {
+ fprintf(rawoutstream, " *\t\t\t");
+ if(real_name[0])
+ fprintf(rawoutstream, "%s <", real_name);
#ifdef H5_HAVE_GETPWUID
- if (pwd) HDfputs(pwd->pw_name, stdout);
+ if(pwd) HDfputs(pwd->pw_name, rawoutstream);
#endif
- if (host_name[0]) printf("@%s", host_name);
- if (real_name[0]) printf(">");
- HDputchar('\n');
+ if(host_name[0])
+ fprintf(rawoutstream, "@%s", host_name);
+ if(real_name[0])
+ fprintf(rawoutstream, ">");
+ HDfputc('\n', rawoutstream);
}
- printf(" *\n * Purpose:\t\t");
- for (s = purpose; *s; s++) {
- HDputchar(*s);
- if ('\n' == *s && s[1]) printf(" *\t\t\t");
+ fprintf(rawoutstream, " *\n * Purpose:\t\t");
+ for(s = purpose; *s; s++) {
+ HDfputc(*s, rawoutstream);
+ if('\n' == *s && s[1])
+ fprintf(rawoutstream, " *\t\t\t");
}
- printf(" *\n * Modifications:\n *\n");
- printf(" *\tDO NOT MAKE MODIFICATIONS TO THIS FILE!\n");
- printf(" *\tIt was generated by code in `H5detect.c'.\n");
+ fprintf(rawoutstream, " *\n * Modifications:\n *\n");
+ fprintf(rawoutstream, " *\tDO NOT MAKE MODIFICATIONS TO THIS FILE!\n");
+ fprintf(rawoutstream, " *\tIt was generated by code in `H5detect.c'.\n");
- printf(" *\n *");
- for (i = 0; i < 73; i++) HDputchar('-');
- printf("\n */\n\n");
+ fprintf(rawoutstream, " *\n *");
+ for(i = 0; i < 73; i++)
+ HDfputc('-', rawoutstream);
+ fprintf(rawoutstream, "\n */\n\n");
}
-
+
/*-------------------------------------------------------------------------
* Function: detect_C89_integers
*
- * Purpose: Detect C89 integer types
- *
- * Return: void
- *
- * Programmer: Albert Cheng
- * 2004/05/20
- *
- * Modifications:
+ * Purpose: Detect C89 integer types
*
+ * Return: void
*-------------------------------------------------------------------------
*/
static void HDF_NO_UBSAN
detect_C89_integers(void)
{
- 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
*
- * Purpose: Detect C89 floating point types
- *
- * Return: void
- *
- * Programmer: Albert Cheng
- * 2004/05/20
- *
- * Modifications:
+ * Purpose: Detect C89 floating point types
*
+ * Return: void
*-------------------------------------------------------------------------
*/
static void HDF_NO_UBSAN
@@ -1395,19 +1316,13 @@ detect_C89_floats(void)
DETECT_F(double, DOUBLE, d_g[nd_g]); nd_g++;
}
-
+
/*-------------------------------------------------------------------------
* Function: detect_C99_integers8
*
- * Purpose: Detect C99 8 bit integer types
- *
- * Return: void
- *
- * Programmer: Albert Cheng
- * 2004/05/20
- *
- * Modifications:
+ * Purpose: Detect C99 8 bit integer types
*
+ * Return: void
*-------------------------------------------------------------------------
*/
static void HDF_NO_UBSAN
@@ -1415,61 +1330,55 @@ detect_C99_integers8(void)
{
#if H5_SIZEOF_INT8_T>0
#if H5_SIZEOF_INT8_T==1
- DETECT_BYTE(int8_t, INT8, d_g[nd_g]); nd_g++;
+ 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++;
+ DETECT_I(uint8_t, UINT8, d_g[nd_g]); nd_g++;
#endif
#endif
#if H5_SIZEOF_INT_LEAST8_T>0
#if H5_SIZEOF_INT_LEAST8_T==1
- DETECT_BYTE(int_least8_t, INT_LEAST8, d_g[nd_g]); nd_g++;
+ 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++;
+ 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++;
+ 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++;
#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++;
+ DETECT_I(uint_fast8_t, UINT_FAST8, d_g[nd_g]); nd_g++;
#endif
#endif
}
-
+
/*-------------------------------------------------------------------------
* Function: detect_C99_integers16
*
- * Purpose: Detect C99 16 bit integer types
- *
- * Return: void
- *
- * Programmer: Albert Cheng
- * 2004/05/20
- *
- * Modifications:
+ * Purpose: Detect C99 16 bit integer types
*
+ * Return: void
*-------------------------------------------------------------------------
*/
static void HDF_NO_UBSAN
@@ -1479,35 +1388,29 @@ detect_C99_integers16(void)
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
*
- * Purpose: Detect C99 32 bit integer types
- *
- * Return: void
- *
- * Programmer: Albert Cheng
- * 2004/05/20
- *
- * Modifications:
+ * Purpose: Detect C99 32 bit integer types
*
+ * Return: void
*-------------------------------------------------------------------------
*/
static void HDF_NO_UBSAN
@@ -1517,34 +1420,29 @@ detect_C99_integers32(void)
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
*
- * Purpose: Detect C99 64 bit integer types
+ * Purpose: Detect C99 64 bit integer types
*
- * Return: void
- *
- * Programmer: Albert Cheng
- * 2004/05/20
- *
- * Modifications:
+ * Return: void
*
*-------------------------------------------------------------------------
*/
@@ -1555,24 +1453,24 @@ detect_C99_integers64(void)
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(unsigned long long, ULLONG, d_g[nd_g]); nd_g++;
+ DETECT_I(unsigned long long, ULLONG, d_g[nd_g]); nd_g++;
#else
/*
* This architecture doesn't support an integer type larger than `long'
@@ -1580,23 +1478,17 @@ detect_C99_integers64(void)
* `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(unsigned long, ULLONG, d_g[nd_g]); nd_g++;
#endif
}
-
+
/*-------------------------------------------------------------------------
* Function: detect_C99_integers
*
- * Purpose: Detect C99 integer types
- *
- * Return: void
- *
- * Programmer: Albert Cheng
- * 2004/05/20
- *
- * Modifications:
+ * Purpose: Detect C99 integer types
*
+ * Return: void
*-------------------------------------------------------------------------
*/
static void HDF_NO_UBSAN
@@ -1610,19 +1502,13 @@ detect_C99_integers(void)
detect_C99_integers64();
}
-
+
/*-------------------------------------------------------------------------
* Function: detect_C99_floats
*
- * Purpose: Detect C99 floating point types
- *
- * Return: void
- *
- * Programmer: Albert Cheng
- * 2004/05/20
- *
- * Modifications:
+ * Purpose: Detect C99 floating point types
*
+ * Return: void
*-------------------------------------------------------------------------
*/
static void HDF_NO_UBSAN
@@ -1641,19 +1527,13 @@ detect_C99_floats(void)
#endif
}
-
+
/*-------------------------------------------------------------------------
* Function: detect_alignments
*
- * Purpose: Detect structure alignments
- *
- * Return: void
- *
- * Programmer: Albert Cheng
- * 2004/05/20
- *
- * Modifications:
+ * Purpose: Detect structure alignments
*
+ * Return: void
*-------------------------------------------------------------------------
*/
static void HDF_NO_UBSAN
@@ -1685,60 +1565,54 @@ static int verify_signal_handlers(int signum, void (*handler)(int))
#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++;
+ 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++;
+ }
}
- }
}
/* 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);
- }else{
- /* all succeeded */
- return(0);
+ 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;
+ }
+ else {
+ /* all succeeded */
+ return 0;
}
}
#endif
-
+
/*-------------------------------------------------------------------------
* Function: main
*
- * Purpose: Main entry point.
- *
- * Return: Success: exit(0)
+ * Purpose: Main entry point.
*
- * Failure: exit(1)
- *
- * Programmer: Robb Matzke
- * matzke@llnl.gov
- * Jun 12, 1996
+ * Return: Success: EXIT_SUCCESS
*
* Modifications:
- * 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
@@ -1747,8 +1621,23 @@ static int verify_signal_handlers(int signum, void (*handler)(int))
*-------------------------------------------------------------------------
*/
int HDF_NO_UBSAN
-main(void)
+main(int argc, char *argv[])
{
+ char *fname = NULL;
+ FILE *f; /* temporary holding place for the stream pointer
+ * so that rawoutstream is changed only when succeeded */
+
+ if(argc > 1)
+ fname = argv[1];
+
+ /* First check if filename is string "NULL" */
+ if(fname != NULL) {
+ /* binary output */
+ if((f = HDfopen(fname, "w")) != NULL)
+ rawoutstream = f;
+ }
+ if(!rawoutstream)
+ rawoutstream = stdout;
#if defined(H5_HAVE_SETSYSINFO) && defined(SSI_NVPAIRS)
#if defined(UAC_NOPRINT) && defined(UAC_SIGBUS)
@@ -1759,8 +1648,8 @@ main(void)
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",
+ if(setsysinfo(SSI_NVPAIRS, nvpairs, 1, 0, 0)<0) {
+ fprintf(stderr, "H5detect: unable to turn off UAC handling: %s\n",
HDstrerror(errno));
}
#endif
@@ -1768,15 +1657,15 @@ main(void)
#if defined(H5SETJMP) && defined(H5_HAVE_SIGNAL)
/* verify the SIGBUS and SIGSEGV handlers work properly */
- if (verify_signal_handlers(SIGBUS, sigbus_handler) != 0) {
+ if(verify_signal_handlers(SIGBUS, sigbus_handler) != 0) {
fprintf(stderr, "Signal handler %s for signal %d failed\n",
"sigbus_handler", SIGBUS);
}
- if (verify_signal_handlers(SIGSEGV, sigsegv_handler) != 0) {
+ if(verify_signal_handlers(SIGSEGV, sigsegv_handler) != 0) {
fprintf(stderr, "Signal handler %s for signal %d failed\n",
"sigsegv_handler", SIGSEGV);
}
- if (verify_signal_handlers(SIGILL, sigill_handler) != 0) {
+ if(verify_signal_handlers(SIGILL, sigill_handler) != 0) {
fprintf(stderr, "Signal handler %s for signal %d failed\n",
"sigill_handler", SIGILL);
}
@@ -1803,5 +1692,13 @@ main(void)
print_results (nd_g, d_g, na_g, m_g);
- return 0;
+ if(rawoutstream && rawoutstream != stdout) {
+ if(HDfclose(rawoutstream))
+ fprintf(stderr, "closing rawoutstream");
+ else
+ rawoutstream = NULL;
+ }
+
+ return EXIT_SUCCESS;
}
+
diff --git a/src/H5make_libsettings.c b/src/H5make_libsettings.c
index 1892806..da7c8d9 100644
--- a/src/H5make_libsettings.c
+++ b/src/H5make_libsettings.c
@@ -26,13 +26,8 @@ static const char *FileHeader = "\n\
* help@hdfgroup.org. *\n\
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *";
/*
- *
- * Created: H5make_libsettings.c
- * 17 Mar 2010
- * Quincey Koziol
- *
- * Purpose: Generate the H5libsettings.c file from the
- * libhdf5.settings file.
+ * Purpose: Generate the H5libsettings.c file from the
+ * libhdf5.settings file.
*
*-------------------------------------------------------------------------
*/
@@ -43,33 +38,31 @@ static const char *FileHeader = "\n\
#define LIBSETTINGSFNAME "libhdf5.settings"
+FILE *rawoutstream = NULL;
+
/*-------------------------------------------------------------------------
- * Function: insert_libhdf5_settings
- *
- * Purpose: insert the contents of libhdf5.settings into a file
- * represented by flibinfo.
- * Make it an empty string if H5_HAVE_EMBEDDED_LIBINFO is not
- * defined, i.e., not enabled.
+ * Function: insert_libhdf5_settings
*
- * Return: void
- *
- * Programmer: Albert Cheng
- * Apr 20, 2009
+ * Purpose: insert the contents of libhdf5.settings into a file
+ * represented by flibinfo.
+ * Make it an empty string if H5_HAVE_EMBEDDED_LIBINFO is not
+ * defined, i.e., not enabled.
*
+ * Return: void
*-------------------------------------------------------------------------
*/
static void
insert_libhdf5_settings(FILE *flibinfo)
{
#ifdef H5_HAVE_EMBEDDED_LIBINFO
- FILE *fsettings; /* for files libhdf5.settings */
+ FILE *fsettings; /* for files libhdf5.settings */
int inchar;
- int bol = 0; /* indicates the beginning of a new line */
+ int bol = 0; /* indicates the beginning of a new line */
if(NULL == (fsettings = HDfopen(LIBSETTINGSFNAME, "r"))) {
HDperror(LIBSETTINGSFNAME);
- HDexit(1);
+ HDexit(EXIT_FAILURE);
} /* end if */
/* print variable definition and the string */
@@ -77,33 +70,33 @@ insert_libhdf5_settings(FILE *flibinfo)
fprintf(flibinfo, "char H5libhdf5_settings[]=\n");
bol++;
while(EOF != (inchar = HDgetc(fsettings))) {
- if(bol) {
- /* Start a new line */
- fprintf(flibinfo, "\t\"");
- bol = 0;
- } /* end if */
- if(inchar == '\n') {
- /* end of a line */
- fprintf(flibinfo, "\\n\"\n");
- bol++;
+ if(bol) {
+ /* Start a new line */
+ fprintf(flibinfo, "\t\"");
+ bol = 0;
+ } /* end if */
+ if(inchar == '\n') {
+ /* end of a line */
+ fprintf(flibinfo, "\\n\"\n");
+ bol++;
} /* end if */
- else
- HDputc(inchar, flibinfo);
+ else
+ HDputc(inchar, flibinfo);
} /* end while */
if(HDfeof(fsettings)) {
- /* wrap up */
- if(!bol)
- /* EOF found without a new line */
- fprintf(flibinfo, "\\n\"\n");
- fprintf(flibinfo, ";\n\n");
+ /* wrap up */
+ if(!bol)
+ /* EOF found without a new line */
+ fprintf(flibinfo, "\\n\"\n");
+ fprintf(flibinfo, ";\n\n");
} /* end if */
else {
- fprintf(stderr, "Read errors encountered with %s\n", LIBSETTINGSFNAME);
- HDexit(1);
+ fprintf(stderr, "Read errors encountered with %s\n", LIBSETTINGSFNAME);
+ HDexit(EXIT_FAILURE);
} /* end else */
if(0 != HDfclose(fsettings)) {
- HDperror(LIBSETTINGSFNAME);
- HDexit(1);
+ HDperror(LIBSETTINGSFNAME);
+ HDexit(EXIT_FAILURE);
} /* end if */
#else
/* print variable definition and an empty string */
@@ -114,59 +107,50 @@ insert_libhdf5_settings(FILE *flibinfo)
/*-------------------------------------------------------------------------
- * Function: make_libinfo
- *
- * Purpose: Create the embedded library information definition.
- * This sets up for a potential extension that the declaration
- * is printed to a file different from stdout.
- *
- * Return: void
+ * Function: make_libinfo
*
- * Programmer: Albert Cheng
- * Sep 15, 2009
+ * Purpose: Create the embedded library information definition.
+ * This sets up for a potential extension that the declaration
+ * is printed to a file different from stdout.
*
+ * Return: void
*-------------------------------------------------------------------------
*/
static void
make_libinfo(void)
{
/* print variable definition and then the string as a macro. */
- insert_libhdf5_settings(stdout);
+ insert_libhdf5_settings(rawoutstream);
}
/*-------------------------------------------------------------------------
- * Function: print_header
+ * Function: print_header
*
- * Purpose: Prints the header for the generated file.
- *
- * Return: void
- *
- * Programmer: Robb Matzke
- * matzke@llnl.gov
- * Mar 12 1997
+ * Purpose: Prints the header for the generated file.
*
+ * Return: void
*-------------------------------------------------------------------------
*/
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 library build configuration\n";
@@ -175,22 +159,22 @@ information about the library build configuration\n";
*/
#ifdef H5_HAVE_GETPWUID
{
- size_t n;
- char *comma;
+ 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';
- } /* end if */
+ 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';
+ } /* end if */
else {
- HDstrncpy(real_name, pwd->pw_gecos, sizeof(real_name));
- real_name[sizeof(real_name) - 1] = '\0';
- } /* end else */
- } /* end if */
+ HDstrncpy(real_name, pwd->pw_gecos, sizeof(real_name));
+ real_name[sizeof(real_name) - 1] = '\0';
+ } /* end else */
+ } /* end if */
else
- real_name[0] = '\0';
+ real_name[0] = '\0';
}
#else
real_name[0] = '\0';
@@ -201,7 +185,7 @@ information about the library build configuration\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';
#endif
@@ -209,54 +193,49 @@ information about the library build configuration\n";
/*
* The file header: warning, copyright notice, build information.
*/
- printf("/* Generated automatically by H5make_libsettings -- do not edit */\n\n\n");
- HDputs(FileHeader); /*the copyright notice--see top of this file */
+ fprintf(rawoutstream, "/* Generated automatically by H5make_libsettings -- do not edit */\n\n\n");
+ HDfputs(FileHeader, rawoutstream); /*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);
+ fprintf(rawoutstream, " *\n * Created:\t\t%s %2d, %4d\n",
+ 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);
+ fprintf(rawoutstream, " *\t\t\t");
+ if(real_name[0])
+ fprintf(rawoutstream, "%s <", real_name);
#ifdef H5_HAVE_GETPWUID
- if(pwd)
- HDfputs(pwd->pw_name, stdout);
+ if(pwd)
+ HDfputs(pwd->pw_name, rawoutstream);
#endif
- if(host_name[0])
- printf("@%s", host_name);
- if(real_name[0])
- printf(">");
- HDputchar('\n');
+ if(host_name[0])
+ fprintf(rawoutstream, "@%s", host_name);
+ if(real_name[0])
+ fprintf(rawoutstream, ">");
+ HDfputc('\n', rawoutstream);
} /* end if */
- printf(" *\n * Purpose:\t\t");
+ fprintf(rawoutstream, " *\n * Purpose:\t\t");
for(s = purpose; *s; s++) {
- HDputchar(*s);
- if('\n' == *s && s[1])
- printf(" *\t\t\t");
+ HDfputc(*s, rawoutstream);
+ if('\n' == *s && s[1])
+ fprintf(rawoutstream, " *\t\t\t");
} /* end for */
- printf(" *\n * Modifications:\n *\n");
- printf(" *\tDO NOT MAKE MODIFICATIONS TO THIS FILE!\n");
- printf(" *\tIt was generated by code in `H5make_libsettings.c'.\n");
+ fprintf(rawoutstream, " *\n * Modifications:\n *\n");
+ fprintf(rawoutstream, " *\tDO NOT MAKE MODIFICATIONS TO THIS FILE!\n");
+ fprintf(rawoutstream, " *\tIt was generated by code in `H5make_libsettings.c'.\n");
- printf(" *\n *");
+ fprintf(rawoutstream, " *\n *");
for(i = 0; i < 73; i++)
- HDputchar('-');
- printf("\n */\n\n");
+ HDfputc('-', rawoutstream);
+ fprintf(rawoutstream, "\n */\n\n");
}
/*-------------------------------------------------------------------------
- * Function: print_footer
+ * Function: print_footer
*
- * Purpose: Prints the file footer for the generated file.
- *
- * Return: void
- *
- * Programmer: Quincey Koziol
- * koziol@hdfgroup.org
- * Mar 31 2010
+ * Purpose: Prints the file footer for the generated file.
*
+ * Return: void
*-------------------------------------------------------------------------
*/
static void
@@ -267,22 +246,33 @@ print_footer(void)
/*-------------------------------------------------------------------------
- * Function: main
- *
- * Purpose: Main entry point.
- *
- * Return: Success: exit(0)
+ * Function: main
*
- * Failure: exit(1)
- *
- * Programmer: Albert Cheng
- * 2010/4/1
+ * Purpose: Main entry point.
*
+ * Return: Success: EXIT_SUCCESS
*-------------------------------------------------------------------------
*/
int
-main(void)
+main(int argc, char *argv[])
{
+ char *fname = NULL;
+ FILE *f; /* temporary holding place for the stream pointer
+ * so that rawoutstream is changed only when succeeded
+ */
+
+ if(argc > 1)
+ fname = argv[1];
+
+ /* First check if filename is string "NULL" */
+ if(fname != NULL) {
+ /* binary output */
+ if((f = HDfopen(fname, "w")) != NULL)
+ rawoutstream = f;
+ }
+ if(!rawoutstream)
+ rawoutstream = stdout;
+
print_header();
/* Generate embedded library information variable definition */
@@ -290,5 +280,13 @@ main(void)
print_footer();
- HDexit(0);
+ if(rawoutstream && rawoutstream != stdout) {
+ if(HDfclose(rawoutstream))
+ fprintf(stderr, "closing rawoutstream");
+ else
+ rawoutstream = NULL;
+ }
+
+ HDexit(EXIT_SUCCESS);
}
+
diff --git a/src/H5public.h b/src/H5public.h
index faacd42..83966de 100644
--- a/src/H5public.h
+++ b/src/H5public.h
@@ -93,10 +93,10 @@ extern "C" {
/* Version numbers */
#define H5_VERS_MAJOR 1 /* For major interface/format changes */
#define H5_VERS_MINOR 10 /* For minor interface/format changes */
-#define H5_VERS_RELEASE 3 /* For tweaks, bug-fixes, or development */
+#define H5_VERS_RELEASE 4 /* For tweaks, bug-fixes, or development */
#define H5_VERS_SUBRELEASE "" /* For pre-releases like snap0 */
/* Empty string for real releases. */
-#define H5_VERS_INFO "HDF5 library version: 1.10.3" /* Full version string */
+#define H5_VERS_INFO "HDF5 library version: 1.10.4" /* Full version string */
#define H5check() H5check_version(H5_VERS_MAJOR,H5_VERS_MINOR, \
H5_VERS_RELEASE)
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index 517a620..c8119fe 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -224,7 +224,7 @@ set (H5_TESTS
ntypes
dangle
dtransform
- reserved
+ # reserved disabled
cross_read
freespace
mf
diff --git a/test/CMakeTests.cmake b/test/CMakeTests.cmake
index cc6ebb8..8838c34 100644
--- a/test/CMakeTests.cmake
+++ b/test/CMakeTests.cmake
@@ -439,14 +439,6 @@ set (test_CLEANFILES
tvlstr.h5
tvlstr2.h5
twriteorder.dat
- flush.h5
- flush-swmr.h5
- noflush.h5
- noflush-swmr.h5
- flush_extend.h5
- flush_extend-swmr.h5
- noflush_extend.h5
- noflush_extend-swmr.h5
enum1.h5
titerate.h5
ttsafe.h5
@@ -551,6 +543,8 @@ set (H5TEST_SEPARATE_TESTS
testhdf5
cache
cache_image
+ flush1
+ flush2
)
foreach (test ${H5_TESTS})
if (NOT ${test} IN_LIST H5TEST_SEPARATE_TESTS)
@@ -587,7 +581,6 @@ foreach (test ${H5_TESTS})
endif ()
endforeach ()
-set_tests_properties (H5TEST-flush2 PROPERTIES DEPENDS H5TEST-flush1)
set_tests_properties (H5TEST-fheap PROPERTIES TIMEOUT 1800)
set_tests_properties (H5TEST-big PROPERTIES TIMEOUT 1800)
set_tests_properties (H5TEST-btree2 PROPERTIES TIMEOUT 1800)
@@ -630,7 +623,6 @@ if (BUILD_SHARED_LIBS)
endif ()
endforeach ()
- set_tests_properties (H5TEST-shared-flush2 PROPERTIES DEPENDS H5TEST-shared-flush1)
set_tests_properties (H5TEST-shared-fheap PROPERTIES TIMEOUT 1800)
set_tests_properties (H5TEST-shared-big PROPERTIES TIMEOUT 1800)
set_tests_properties (H5TEST-shared-btree2 PROPERTIES TIMEOUT 1800)
@@ -720,6 +712,54 @@ if (BUILD_SHARED_LIBS)
endif ()
endif ()
+#-- Adding test for flush1/2
+add_test (NAME H5TEST-clear-flush-objects
+ COMMAND ${CMAKE_COMMAND}
+ -E remove
+ flush.h5
+ flush-swmr.h5
+ noflush.h5
+ noflush-swmr.h5
+ flush_extend.h5
+ flush_extend-swmr.h5
+ noflush_extend.h5
+ noflush_extend-swmr.h5
+ WORKING_DIRECTORY
+ ${HDF5_TEST_BINARY_DIR}/H5TEST
+)
+if (HDF5_ENABLE_USING_MEMCHECKER)
+ add_test (NAME H5TEST-flush1 COMMAND $<TARGET_FILE:flush1>)
+else ()
+ add_test (NAME H5TEST-flush1 COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:flush1>"
+ -D "TEST_ARGS:STRING="
+ -D "TEST_EXPECT=0"
+ -D "TEST_SKIP_COMPARE=TRUE"
+ -D "TEST_OUTPUT=flush1.txt"
+ -D "TEST_FOLDER=${HDF5_TEST_BINARY_DIR}/H5TEST"
+ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
+ )
+endif ()
+set_tests_properties (H5TEST-flush1 PROPERTIES
+ DEPENDS H5TEST-clear-flush-objects
+ ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST;HDF5TestExpress=${HDF_TEST_EXPRESS}"
+ WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST
+)
+if (HDF5_ENABLE_USING_MEMCHECKER)
+ add_test (NAME H5TEST-flush2 COMMAND $<TARGET_FILE:flush2>)
+else ()
+ add_test (NAME H5TEST-flush2 COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:flush2>"
+ -D "TEST_ARGS:STRING="
+ -D "TEST_EXPECT=0"
+ -D "TEST_SKIP_COMPARE=TRUE"
+ -D "TEST_OUTPUT=flush2.txt"
+ -D "TEST_FOLDER=${HDF5_TEST_BINARY_DIR}/H5TEST"
+ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
+ )
+endif ()
+set_tests_properties (H5TEST-flush2 PROPERTIES DEPENDS H5TEST-flush1)
+
#-- Adding test for tcheck_version
add_test (NAME H5TEST-tcheck_version-major COMMAND $<TARGET_FILE:tcheck_version> "-tM")
set_tests_properties (H5TEST-tcheck_version-major PROPERTIES
@@ -826,9 +866,10 @@ add_test (NAME H5TEST-clear-error_test-objects
set_tests_properties (H5TEST-clear-error_test-objects PROPERTIES FIXTURES_SETUP error_test_clear_objects)
if (HDF5_USE_16_API_DEFAULT)
add_test (
- NAME H5TEST-error_test-SKIPPED
+ NAME H5TEST-error_test
COMMAND ${CMAKE_COMMAND} -E echo "SKIP $<TARGET_FILE:error_test>"
)
+ set_property(TEST H5TEST-error_test PROPERTY DISABLED)
else ()
add_test (NAME H5TEST-error_test COMMAND "${CMAKE_COMMAND}"
-D "TEST_PROGRAM=$<TARGET_FILE:error_test>"
@@ -925,9 +966,10 @@ if (BUILD_SHARED_LIBS)
set_tests_properties (H5TEST-shared-clear-error_test-objects PROPERTIES FIXTURES_SETUP shared_error_test_clear_objects)
if (HDF5_USE_16_API_DEFAULT)
add_test (
- NAME H5TEST-shared-error_test-SKIPPED
+ NAME H5TEST-shared-error_test
COMMAND ${CMAKE_COMMAND} -E echo "SKIP $<TARGET_FILE:error_test-shared>"
)
+ set_property(TEST H5TEST-shared-error_test PROPERTY DISABLED)
else ()
add_test (NAME H5TEST-shared-error_test COMMAND "${CMAKE_COMMAND}"
-D "TEST_PROGRAM=$<TARGET_FILE:error_test-shared>"
diff --git a/test/Makefile.am b/test/Makefile.am
index b9aa3fb..d4db6d0 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -56,11 +56,11 @@ TEST_PROG= testhdf5 \
evict_on_close farray earray btree2 fheap \
pool accum hyperslab istore bittests dt_arith page_buffer \
dtypes dsets cmpd_dset filter_fail extend direct_chunk external efc \
- objcopy links unlink twriteorder big mtime fillval mount \
- flush1 flush2 app_ref enum set_extent ttsafe enc_dec_plist \
- enc_dec_plist_cross_platform getname vfd ntypes dangle dtransform \
- reserved cross_read freespace mf vds file_image unregister \
- cache_logging cork swmr
+ objcopy links unlink twriteorder big mtime fillval mount \
+ flush1 flush2 app_ref enum set_extent ttsafe enc_dec_plist \
+ enc_dec_plist_cross_platform getname vfd ntypes dangle dtransform \
+ reserved cross_read freespace mf vds file_image unregister \
+ cache_logging cork swmr
# List programs to be built when testing here.
# error_test and err_compat are built at the same time as the other tests, but executed by testerror.sh.
diff --git a/test/Makefile.in b/test/Makefile.in
index 2462866..7e6bde1 100644
--- a/test/Makefile.in
+++ b/test/Makefile.in
@@ -1429,11 +1429,11 @@ TEST_PROG = testhdf5 \
evict_on_close farray earray btree2 fheap \
pool accum hyperslab istore bittests dt_arith page_buffer \
dtypes dsets cmpd_dset filter_fail extend direct_chunk external efc \
- objcopy links unlink twriteorder big mtime fillval mount \
- flush1 flush2 app_ref enum set_extent ttsafe enc_dec_plist \
- enc_dec_plist_cross_platform getname vfd ntypes dangle dtransform \
- reserved cross_read freespace mf vds file_image unregister \
- cache_logging cork swmr
+ objcopy links unlink twriteorder big mtime fillval mount \
+ flush1 flush2 app_ref enum set_extent ttsafe enc_dec_plist \
+ enc_dec_plist_cross_platform getname vfd ntypes dangle dtransform \
+ reserved cross_read freespace mf vds file_image unregister \
+ cache_logging cork swmr
# These programs generate test files for the tests. They don't need to be
diff --git a/test/cache_logging.c b/test/cache_logging.c
index b4ed53b..1eb9d41 100644
--- a/test/cache_logging.c
+++ b/test/cache_logging.c
@@ -65,16 +65,16 @@ test_logging_api(void)
start_on_access_out = TRUE;
location = NULL;
size = 999;
- if(H5Pget_mdc_log_options(fapl, &is_enabled_out, location, &size,
+ if(H5Pget_mdc_log_options(fapl, &is_enabled_out, location, &size,
&start_on_access_out) < 0)
TEST_ERROR;
- if(size != strlen(LOG_LOCATION) + 1)
+ if(size != HDstrlen(LOG_LOCATION) + 1)
TEST_ERROR;
/* Check to make sure that the property list getter works */
if(NULL == (location = (char *)HDcalloc(size, sizeof(char))))
TEST_ERROR;
- if(H5Pget_mdc_log_options(fapl, &is_enabled_out, location, &size,
+ if(H5Pget_mdc_log_options(fapl, &is_enabled_out, location, &size,
&start_on_access_out) < 0)
TEST_ERROR;
if((is_enabled != is_enabled_out)
@@ -159,17 +159,17 @@ main(void)
/* Reset library */
h5_reset();
- printf("Testing basic metadata cache logging functionality.\n");
+ HDprintf("Testing basic metadata cache logging functionality.\n");
nerrors += test_logging_api();
if(nerrors) {
- printf("***** %d Metadata cache logging TEST%s FAILED! *****\n",
+ HDprintf("***** %d Metadata cache logging TEST%s FAILED! *****\n",
nerrors, nerrors > 1 ? "S" : "");
return 1;
}
- printf("All Metadata Cache Logging tests passed.\n");
+ HDprintf("All Metadata Cache Logging tests passed.\n");
return 0;
}
diff --git a/test/genall5.c b/test/genall5.c
index 37bab7a..4cc0a2d 100644
--- a/test/genall5.c
+++ b/test/genall5.c
@@ -12,11 +12,11 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* Programmer: John Mainzer
- * 9/23/15
+ * 9/23/15
*
- * This file contains a heavily edited and functionaly reduce
- * version of the test code first written by Quincey in a file
- * of the same name.
+ * This file contains a heavily edited and functionaly reduce
+ * version of the test code first written by Quincey in a file
+ * of the same name.
*/
#include "cache_common.h"
@@ -32,7 +32,7 @@
* Function: ns_grp_0
*
* Purpose: Create an empty "new style" group at the specified location
- * in the specified file.
+ * in the specified file.
*
* If pass is false on entry, do nothing.
*
@@ -48,70 +48,59 @@
*/
void
-ns_grp_0(hid_t fid, const char *group_name)
-{
+ns_grp_0(hid_t fid, const char *group_name) {
hid_t gid = -1;
hid_t gcpl = -1;
herr_t ret;
- if ( pass ) {
-
+ if (pass) {
gcpl = H5Pcreate(H5P_GROUP_CREATE);
- if ( gcpl <= 0 ) {
-
- pass = FALSE;
- failure_mssg = "ns_grp_0: H5Pcreate() failed";
- }
- assert(gcpl > 0);
+ if (gcpl <= 0) {
+ pass = FALSE;
+ failure_mssg = "ns_grp_0: H5Pcreate() failed";
+ }
+ HDassert(gcpl > 0);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Pset_link_creation_order(gcpl, H5P_CRT_ORDER_TRACKED);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "ns_grp_0: H5Pset_link_creation_order() failed";
- }
- assert(ret >= 0);
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "ns_grp_0: H5Pset_link_creation_order() failed";
+ }
+ HDassert(ret >= 0);
}
- if ( pass ) {
-
+ if (pass) {
gid = H5Gcreate2(fid, group_name, H5P_DEFAULT, gcpl, H5P_DEFAULT);
- if ( gid <= 0 ) {
-
- pass = FALSE;
- failure_mssg = "ns_grp_0: H5Gcreate2() failed";
+ if (gid <= 0) {
+ pass = FALSE;
+ failure_mssg = "ns_grp_0: H5Gcreate2() failed";
}
- assert(gid > 0);
+ HDassert(gid > 0);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Pclose(gcpl);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "ns_grp_0: H5Pclose(gcpl) failed";
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "ns_grp_0: H5Pclose(gcpl) failed";
}
- assert(ret >= 0);
+ HDassert(ret >= 0);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Gclose(gid);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "ns_grp_0: H5Gclose(gid) failed";
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "ns_grp_0: H5Gclose(gid) failed";
}
- assert(ret >= 0);
+ HDassert(ret >= 0);
}
return;
@@ -138,97 +127,81 @@ ns_grp_0(hid_t fid, const char *group_name)
*-------------------------------------------------------------------------
*/
-void vrfy_ns_grp_0(hid_t fid, const char *group_name)
-{
+void vrfy_ns_grp_0(hid_t fid, const char *group_name) {
hid_t gid = -1;
hid_t gcpl = -1;
H5G_info_t grp_info;
unsigned crt_order_flags = 0;
herr_t ret;
- if ( pass ) {
-
+ if (pass) {
gid = H5Gopen2(fid, group_name, H5P_DEFAULT);
- if ( gid <= 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ns_grp_0: H5Gopen2() failed";
+ if (gid <= 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ns_grp_0: H5Gopen2() failed";
}
HDassert(gid > 0);
}
- if ( pass ) {
-
+ if (pass) {
gcpl = H5Gget_create_plist(gid);
- if ( gcpl <= 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ns_grp_0: H5Gget_create_plist() failed";
+ if (gcpl <= 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ns_grp_0: H5Gget_create_plist() failed";
}
HDassert(gcpl > 0);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Pget_link_creation_order(gcpl, &crt_order_flags);
- if ( gcpl <= 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ns_grp_0: H5Pget_link_creation_order() failed";
+ if (gcpl <= 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ns_grp_0: H5Pget_link_creation_order() failed";
}
- else if ( H5P_CRT_ORDER_TRACKED != crt_order_flags ) {
-
- pass = FALSE;
- failure_mssg =
- "vrfy_ns_grp_0: H5P_CRT_ORDER_TRACKED != crt_order_flags";
+ else if ( H5P_CRT_ORDER_TRACKED != crt_order_flags) {
+ pass = FALSE;
+ failure_mssg =
+ "vrfy_ns_grp_0: H5P_CRT_ORDER_TRACKED != crt_order_flags";
}
HDassert(ret >= 0);
HDassert(H5P_CRT_ORDER_TRACKED == crt_order_flags);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Pclose(gcpl);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ns_grp_0: H5Pclose() failed";
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ns_grp_0: H5Pclose() failed";
}
HDassert(ret >= 0);
}
- if ( pass ) {
-
- memset(&grp_info, 0, sizeof(grp_info));
+ if (pass) {
+ HDmemset(&grp_info, 0, sizeof(grp_info));
ret = H5Gget_info(gid, &grp_info);
- if ( ret < 0 ) {
-
+ if (ret < 0) {
pass = FALSE;
failure_mssg = "vrfy_ns_grp_0: H5Gget_info() failed";
}
- else if ( H5G_STORAGE_TYPE_COMPACT != grp_info.storage_type ) {
-
+ else if (H5G_STORAGE_TYPE_COMPACT != grp_info.storage_type) {
pass = FALSE;
- failure_mssg =
- "vrfy_ns_grp_0: H5G_STORAGE_TYPE_COMPACT != grp_info.storage_type";
+ failure_mssg =
+ "vrfy_ns_grp_0: H5G_STORAGE_TYPE_COMPACT != grp_info.storage_type";
}
- else if ( 0 != grp_info.nlinks ) {
-
+ else if (0 != grp_info.nlinks) {
pass = FALSE;
failure_mssg = "vrfy_ns_grp_0: 0 != grp_info.nlinks";
}
- else if ( 0 != grp_info.max_corder ) {
-
+ else if (0 != grp_info.max_corder) {
pass = FALSE;
failure_mssg = "vrfy_ns_grp_0: 0 != grp_info.max_corder";
}
- else if ( FALSE != grp_info.mounted ) {
-
+ else if ( FALSE != grp_info.mounted) {
pass = FALSE;
failure_mssg = "vrfy_ns_grp_0: FALSE != grp_info.mounted";
}
@@ -240,12 +213,10 @@ void vrfy_ns_grp_0(hid_t fid, const char *group_name)
HDassert(false == grp_info.mounted);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Gclose(gid);
- if ( ret < 0 ) {
-
+ if (ret < 0) {
pass = FALSE;
failure_mssg = "vrfy_ns_grp_0: H5Gclose() failed";
}
@@ -253,15 +224,14 @@ void vrfy_ns_grp_0(hid_t fid, const char *group_name)
}
return;
-
} /* vrfy_ns_grp_0() */
/*-------------------------------------------------------------------------
* Function: ns_grp_c
*
- * Purpose: Create a compact "new style" group, with 'nlinks'
- * soft/hard/external links in it in the specified file.
+ * Purpose: Create a compact "new style" group, with 'nlinks'
+ * soft/hard/external links in it in the specified file.
*
* If pass is false on entry, do nothing.
*
@@ -276,68 +246,57 @@ void vrfy_ns_grp_0(hid_t fid, const char *group_name)
*-------------------------------------------------------------------------
*/
-void
-ns_grp_c(hid_t fid, const char *group_name, unsigned nlinks)
-{
+void
+ns_grp_c(hid_t fid, const char *group_name, unsigned nlinks) {
hid_t gid = -1;
hid_t gcpl = -1;
unsigned max_compact;
unsigned u;
herr_t ret;
- if ( pass ) {
-
+ if (pass) {
gcpl = H5Pcreate(H5P_GROUP_CREATE);
- if ( gcpl <= 0 ) {
-
+ if (gcpl <= 0) {
pass = FALSE;
failure_mssg = "ns_grp_c: H5Pcreate(H5P_GROUP_CREATE) failed";
}
HDassert(gcpl > 0);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Pset_link_creation_order(gcpl, H5P_CRT_ORDER_TRACKED);
- if ( ret < 0 ) {
-
+ if (ret < 0) {
pass = FALSE;
failure_mssg = "ns_grp_c: H5Pset_link_creation_order() failed";
}
HDassert(ret >= 0);
}
- if ( pass ) {
-
+ if (pass) {
gid = H5Gcreate2(fid, group_name, H5P_DEFAULT, gcpl, H5P_DEFAULT);
- if ( gid <= 0 ) {
-
+ if (gid <= 0) {
pass = FALSE;
failure_mssg = "ns_grp_c: H5Gcreate2() failed";
}
HDassert(gid > 0);
}
- if ( pass ) {
-
+ if (pass) {
max_compact = 0;
ret = H5Pget_link_phase_change(gcpl, &max_compact, NULL);
- if ( ret < 0 ) {
-
+ if (ret < 0) {
pass = FALSE;
failure_mssg = "ns_grp_c: H5Pget_link_phase_change() failed";
}
- else if ( nlinks <= 0 ) {
-
+ else if (nlinks <= 0) {
pass = FALSE;
failure_mssg = "ns_grp_c: nlinks <= 0";
}
- else if ( nlinks >= max_compact ) {
-
+ else if (nlinks >= max_compact) {
pass = FALSE;
failure_mssg = "ns_grp_c: nlinks >= max_compact";
}
@@ -348,72 +307,59 @@ ns_grp_c(hid_t fid, const char *group_name, unsigned nlinks)
}
u = 0;
- while ( ( pass ) && ( u < nlinks ) ) {
-
+ while ((pass) && (u < nlinks)) {
char linkname[16];
- sprintf(linkname, "%u", u);
-
- if(0 == (u % 3)) {
-
- ret = H5Lcreate_soft(group_name, gid, linkname, H5P_DEFAULT,
- H5P_DEFAULT);
+ HDsprintf(linkname, "%u", u);
- if ( ret < 0 ) {
+ if (0 == (u % 3)) {
+ ret = H5Lcreate_soft(group_name, gid, linkname, H5P_DEFAULT, H5P_DEFAULT);
+ if (ret < 0) {
pass = FALSE;
failure_mssg = "ns_grp_c: H5Lcreate_soft() failed";
}
HDassert(ret >= 0);
} /* end if */
- else if(1 == (u % 3)) {
-
- ret = H5Lcreate_hard(fid, "/", gid, linkname, H5P_DEFAULT,
- H5P_DEFAULT);
-
- if ( ret < 0 ) {
+ else if (1 == (u % 3)) {
+ ret = H5Lcreate_hard(fid, "/", gid, linkname, H5P_DEFAULT,
+ H5P_DEFAULT);
+ if (ret < 0) {
pass = FALSE;
failure_mssg = "ns_grp_c: H5Lcreate_hard() failed";
}
HDassert(ret >= 0);
} /* end else-if */
else {
-
HDassert(2 == (u % 3));
- ret = H5Lcreate_external("external.h5", "/ext", gid, linkname,
- H5P_DEFAULT, H5P_DEFAULT);
-
- if ( ret < 0 ) {
+ ret = H5Lcreate_external("external.h5", "/ext", gid, linkname,
+ H5P_DEFAULT, H5P_DEFAULT);
+ if (ret < 0) {
pass = FALSE;
failure_mssg = "ns_grp_c: H5Lcreate_external() failed";
}
HDassert(ret >= 0);
} /* end else */
- u++;
-
+ u++;
} /* end while() */
- if ( pass ) {
-
+ if (pass) {
ret = H5Pclose(gcpl);
- if ( ret < 0 ) {
-
+ if (ret < 0) {
pass = FALSE;
failure_mssg = "ns_grp_c: H5Pclose(gcpl) failed";
}
HDassert(ret >= 0);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Gclose(gid);
- if ( ret < 0 ) {
-
+ if (ret < 0) {
pass = FALSE;
failure_mssg = "ns_grp_c: H5Gclose(gid) failed";
}
@@ -428,8 +374,8 @@ ns_grp_c(hid_t fid, const char *group_name, unsigned nlinks)
/*-------------------------------------------------------------------------
* Function: vrfy_ns_grp_c
*
- * Purpose: Verify a compact "new style" group, with 'nlinks'
- * soft/hard/external links in it in the specified file.
+ * Purpose: Verify a compact "new style" group, with 'nlinks'
+ * soft/hard/external links in it in the specified file.
*
* If pass is false on entry, do nothing.
*
@@ -445,8 +391,7 @@ ns_grp_c(hid_t fid, const char *group_name, unsigned nlinks)
*/
void
-vrfy_ns_grp_c(hid_t fid, const char *group_name, unsigned nlinks)
-{
+vrfy_ns_grp_c(hid_t fid, const char *group_name, unsigned nlinks) {
hid_t gid = -1;
hid_t gcpl = -1;
H5G_info_t grp_info;
@@ -454,89 +399,73 @@ vrfy_ns_grp_c(hid_t fid, const char *group_name, unsigned nlinks)
unsigned u;
herr_t ret;
- if ( pass ) {
-
+ if (pass) {
gid = H5Gopen2(fid, group_name, H5P_DEFAULT);
- if ( gid <= 0 ) {
-
+ if (gid <= 0) {
pass = FALSE;
failure_mssg = "vrfy_ns_grp_c: H5Gopen2() failed";
}
HDassert(gid > 0);
}
- if ( pass ) {
-
+ if (pass) {
gcpl = H5Gget_create_plist(gid);
- if ( gcpl <= 0 ) {
-
+ if (gcpl <= 0) {
pass = FALSE;
failure_mssg = "vrfy_ns_grp_c: H5Gget_create_plist(gid) failed";
}
- assert(gcpl > 0);
+ HDassert(gcpl > 0);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Pget_link_creation_order(gcpl, &crt_order_flags);
- if ( ret < 0 ) {
-
+ if (ret < 0) {
pass = FALSE;
failure_mssg = "vrfy_ns_grp_c: H5Pget_link_creation_order() failed";
}
- else if ( H5P_CRT_ORDER_TRACKED != crt_order_flags ) {
-
+ else if ( H5P_CRT_ORDER_TRACKED != crt_order_flags) {
pass = FALSE;
- failure_mssg =
- "vrfy_ns_grp_c: H5P_CRT_ORDER_TRACKED != crt_order_flags";
+ failure_mssg = "vrfy_ns_grp_c: H5P_CRT_ORDER_TRACKED != crt_order_flags";
}
HDassert(ret >= 0);
HDassert(H5P_CRT_ORDER_TRACKED == crt_order_flags);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Pclose(gcpl);
- if ( ret < 0 ) {
-
+ if (ret < 0) {
pass = FALSE;
failure_mssg = "vrfy_ns_grp_c: H5Pclose() failed";
}
HDassert(ret >= 0);
}
- if ( pass ) {
-
- memset(&grp_info, 0, sizeof(grp_info));
+ if (pass) {
+ HDmemset(&grp_info, 0, sizeof(grp_info));
ret = H5Gget_info(gid, &grp_info);
- if ( ret < 0 ) {
-
+ if (ret < 0) {
pass = FALSE;
failure_mssg = "vrfy_ns_grp_c: H5Gget_info() failed";
}
- else if ( H5G_STORAGE_TYPE_COMPACT != grp_info.storage_type ) {
-
+ else if (H5G_STORAGE_TYPE_COMPACT != grp_info.storage_type) {
pass = FALSE;
- failure_mssg =
- "vrfy_ns_grp_c: H5G_STORAGE_TYPE_COMPACT != grp_info.storage_type";
+ failure_mssg =
+ "vrfy_ns_grp_c: H5G_STORAGE_TYPE_COMPACT != grp_info.storage_type";
}
- else if ( nlinks != grp_info.nlinks ) {
-
+ else if (nlinks != grp_info.nlinks) {
pass = FALSE;
failure_mssg = "vrfy_ns_grp_c: nlinks != grp_info.nlinks";
}
- else if ( nlinks != grp_info.max_corder ) {
-
+ else if (nlinks != grp_info.max_corder) {
pass = FALSE;
failure_mssg = "vrfy_ns_grp_c: nlinks != grp_info.max_corder";
}
- else if ( FALSE != grp_info.mounted ) {
-
+ else if ( FALSE != grp_info.mounted) {
pass = FALSE;
failure_mssg = "vrfy_ns_grp_c: FALSE != grp_info.mounted";
}
@@ -549,42 +478,36 @@ vrfy_ns_grp_c(hid_t fid, const char *group_name, unsigned nlinks)
}
u = 0;
- while ( ( pass ) && ( u < nlinks ) ) {
-
+ while ((pass) && (u < nlinks)) {
H5L_info_t lnk_info;
char linkname[16];
htri_t link_exists;
- sprintf(linkname, "%u", u);
+ HDsprintf(linkname, "%u", u);
link_exists = H5Lexists(gid, linkname, H5P_DEFAULT);
- if ( link_exists < 0 ) {
-
+ if (link_exists < 0) {
pass = FALSE;
failure_mssg = "vrfy_ns_grp_c: H5Lexists() failed";
}
HDassert(link_exists >= 0);
- memset(&lnk_info, 0, sizeof(grp_info));
+ HDmemset(&lnk_info, 0, sizeof(grp_info));
ret = H5Lget_info(gid, linkname, &lnk_info, H5P_DEFAULT);
- if ( ret < 0 ) {
-
+ if (ret < 0) {
pass = FALSE;
failure_mssg = "vrfy_ns_grp_c: H5Lget_info() failed";
}
- else if ( TRUE != lnk_info.corder_valid ) {
-
+ else if ( TRUE != lnk_info.corder_valid) {
pass = FALSE;
failure_mssg = "vrfy_ns_grp_c: TRUE != lnk_info.corder_valid";
}
- else if ( u != lnk_info.corder ) {
-
+ else if (u != lnk_info.corder) {
pass = FALSE;
failure_mssg = "vrfy_ns_grp_c: u != lnk_info.corder";
}
- else if ( H5T_CSET_ASCII != lnk_info.cset ) {
-
+ else if (H5T_CSET_ASCII != lnk_info.cset) {
pass = FALSE;
failure_mssg = "vrfy_ns_grp_c: H5T_CSET_ASCII != lnk_info.cset";
}
@@ -593,75 +516,62 @@ vrfy_ns_grp_c(hid_t fid, const char *group_name, unsigned nlinks)
HDassert(u == lnk_info.corder);
HDassert(H5T_CSET_ASCII == lnk_info.cset);
- if ( 0 == (u % 3) ) {
-
+ if (0 == (u % 3)) {
char *slinkval;
- if ( H5L_TYPE_SOFT != lnk_info.type ) {
-
+ if (H5L_TYPE_SOFT != lnk_info.type) {
pass = FALSE;
failure_mssg = "vrfy_ns_grp_c: H5L_TYPE_SOFT != lnk_info.type";
}
- else if ( (strlen(group_name) + 1) != lnk_info.u.val_size ) {
-
+ else if ((HDstrlen(group_name) + 1) != lnk_info.u.val_size) {
pass = FALSE;
- failure_mssg =
- "vrfy_ns_grp_c: (strlen(group_name) + 1) != lnk_info.u.val_size";
+ failure_mssg = "vrfy_ns_grp_c: (HDstrlen(group_name) + 1) != lnk_info.u.val_size";
}
HDassert(H5L_TYPE_SOFT == lnk_info.type);
- HDassert((strlen(group_name) + 1) == lnk_info.u.val_size);
+ HDassert((HDstrlen(group_name) + 1) == lnk_info.u.val_size);
- slinkval = (char *)malloc(lnk_info.u.val_size);
-
- if ( ! slinkval ) {
+ slinkval = (char *) HDmalloc(lnk_info.u.val_size);
+ if (!slinkval) {
pass = FALSE;
- failure_mssg = "vrfy_ns_grp_c: malloc of slinkval failed";
+ failure_mssg = "vrfy_ns_grp_c: HDmalloc of slinkval failed";
}
HDassert(slinkval);
- ret = H5Lget_val(gid, linkname, slinkval, lnk_info.u.val_size,
- H5P_DEFAULT);
- if ( ret < 0 ) {
-
+ ret = H5Lget_val(gid, linkname, slinkval, lnk_info.u.val_size,
+ H5P_DEFAULT);
+ if (ret < 0) {
pass = FALSE;
failure_mssg = "vrfy_ns_grp_c: H5Lget_val() failed";
}
- else if ( 0 != strcmp(slinkval, group_name) ) {
-
+ else if (0 != HDstrcmp(slinkval, group_name)) {
pass = FALSE;
- failure_mssg =
- "vrfy_ns_grp_c: 0 != strcmp(slinkval, group_name)";
+ failure_mssg = "vrfy_ns_grp_c: 0 != HDstrcmp(slinkval, group_name)";
}
HDassert(ret >= 0);
- HDassert(0 == strcmp(slinkval, group_name));
+ HDassert(0 == HDstrcmp(slinkval, group_name));
- free(slinkval);
+ HDfree(slinkval);
} /* end if */
- else if(1 == (u % 3)) {
-
+ else if (1 == (u % 3)) {
H5O_info_t root_oinfo;
- if ( H5L_TYPE_HARD != lnk_info.type ) {
-
+ if (H5L_TYPE_HARD != lnk_info.type) {
pass = FALSE;
failure_mssg = "vrfy_ns_grp_c: H5L_TYPE_HARD != lnk_info.type";
}
HDassert(H5L_TYPE_HARD == lnk_info.type);
- memset(&root_oinfo, 0, sizeof(root_oinfo));
+ HDmemset(&root_oinfo, 0, sizeof(root_oinfo));
ret = H5Oget_info2(fid, &root_oinfo, H5O_INFO_BASIC);
- if ( ret < 0 ) {
-
+ if (ret < 0) {
pass = FALSE;
failure_mssg = "vrfy_ns_grp_c: H5Oget_info() failed.";
}
- else if ( root_oinfo.addr != lnk_info.u.address ) {
-
+ else if (root_oinfo.addr != lnk_info.u.address) {
pass = FALSE;
- failure_mssg =
- "vrfy_ns_grp_c: root_oinfo.addr != lnk_info.u.address";
+ failure_mssg = "vrfy_ns_grp_c: root_oinfo.addr != lnk_info.u.address";
}
HDassert(ret >= 0);
HDassert(root_oinfo.addr == lnk_info.u.address);
@@ -673,83 +583,70 @@ vrfy_ns_grp_c(hid_t fid, const char *group_name, unsigned nlinks)
HDassert(2 == (u % 3));
- if ( H5L_TYPE_EXTERNAL != lnk_info.type ) {
-
+ if (H5L_TYPE_EXTERNAL != lnk_info.type) {
pass = FALSE;
- failure_mssg =
- "vrfy_ns_grp_c: H5L_TYPE_EXTERNAL != lnk_info.type";
+ failure_mssg = "vrfy_ns_grp_c: H5L_TYPE_EXTERNAL != lnk_info.type";
}
HDassert(H5L_TYPE_EXTERNAL == lnk_info.type);
- elinkval = malloc(lnk_info.u.val_size);
-
- if ( ! elinkval ) {
+ elinkval = HDmalloc(lnk_info.u.val_size);
+ if (!elinkval) {
pass = FALSE;
- failure_mssg = "vrfy_ns_grp_c: malloc of elinkval failed.";
+ failure_mssg = "vrfy_ns_grp_c: HDmalloc of elinkval failed.";
}
HDassert(elinkval);
- ret = H5Lget_val(gid, linkname, elinkval, lnk_info.u.val_size,
- H5P_DEFAULT);
- if ( ret < 0 ) {
-
+ ret = H5Lget_val(gid, linkname, elinkval, lnk_info.u.val_size,
+ H5P_DEFAULT);
+ if (ret < 0) {
pass = FALSE;
failure_mssg = "vrfy_ns_grp_c: H5Lget_val() failed.";
}
HDassert(ret >= 0);
- ret = H5Lunpack_elink_val(elinkval, lnk_info.u.val_size,
- NULL, &file, &path);
- if ( ret < 0 ) {
-
+ ret = H5Lunpack_elink_val(elinkval, lnk_info.u.val_size, NULL, &file, &path);
+ if (ret < 0) {
pass = FALSE;
failure_mssg = "vrfy_ns_grp_c: H5Lunpack_elink_val() failed.";
}
- else if ( 0 != strcmp(file, "external.h5") ) {
-
+ else if (0 != HDstrcmp(file, "external.h5")) {
pass = FALSE;
- failure_mssg =
- "vrfy_ns_grp_c: 0 != strcmp(file, \"external.h5\")";
+ failure_mssg = "vrfy_ns_grp_c: 0 != HDstrcmp(file, \"external.h5\")";
}
- else if ( 0 != strcmp(path, "/ext") ) {
-
+ else if (0 != HDstrcmp(path, "/ext")) {
pass = FALSE;
- failure_mssg = "vrfy_ns_grp_c: 0 != strcmp(path, \"/ext\")";
+ failure_mssg = "vrfy_ns_grp_c: 0 != HDstrcmp(path, \"/ext\")";
}
HDassert(ret >= 0);
- HDassert(0 == strcmp(file, "external.h5"));
- HDassert(0 == strcmp(path, "/ext"));
+ HDassert(0 == HDstrcmp(file, "external.h5"));
+ HDassert(0 == HDstrcmp(path, "/ext"));
- free(elinkval);
+ HDfree(elinkval);
} /* end else */
- u++;
-
+ u++;
} /* end while */
- if ( pass ) {
-
+ if (pass) {
ret = H5Gclose(gid);
- if ( ret < 0 ) {
-
+ if (ret < 0) {
pass = FALSE;
failure_mssg = "vrfy_ns_grp_c: H5Gclose() failed.";
}
- assert(ret >= 0);
+ HDassert(ret >= 0);
}
return;
-
} /* vrfy_ns_grp_c() */
/*-------------------------------------------------------------------------
* Function: ns_grp_d
*
- * Purpose: Create a dense "new style" group, with 'nlinks'
- * (soft/hard/external) links in it in the specified file.
+ * Purpose: Create a dense "new style" group, with 'nlinks'
+ * (soft/hard/external) links in it in the specified file.
*
* If pass is false on entry, do nothing.
*
@@ -765,153 +662,130 @@ vrfy_ns_grp_c(hid_t fid, const char *group_name, unsigned nlinks)
*/
void
-ns_grp_d(hid_t fid, const char *group_name, unsigned nlinks)
-{
+ns_grp_d(hid_t fid, const char *group_name, unsigned nlinks) {
hid_t gid = -1;
hid_t gcpl = -1;
unsigned max_compact;
unsigned u;
herr_t ret;
- if ( pass ) {
-
+ if (pass) {
gcpl = H5Pcreate(H5P_GROUP_CREATE);
- if ( gcpl <= 0 ) {
-
- pass = FALSE;
- failure_mssg = "ns_grp_d: H5Pcreate() failed.";
- }
+ if (gcpl <= 0) {
+ pass = FALSE;
+ failure_mssg = "ns_grp_d: H5Pcreate() failed.";
+ }
HDassert(gcpl > 0);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Pset_link_creation_order(gcpl, H5P_CRT_ORDER_TRACKED);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "ns_grp_d: H5Pset_link_creation_order() failed.";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "ns_grp_d: H5Pset_link_creation_order() failed.";
+ }
HDassert(ret >= 0);
}
- if ( pass ) {
-
+ if (pass) {
gid = H5Gcreate2(fid, group_name, H5P_DEFAULT, gcpl, H5P_DEFAULT);
- if ( gid <= 0 ) {
-
- pass = FALSE;
- failure_mssg = "ns_grp_d: H5Gcreate2() failed.";
- }
+ if (gid <= 0) {
+ pass = FALSE;
+ failure_mssg = "ns_grp_d: H5Gcreate2() failed.";
+ }
HDassert(gid > 0);
}
- if ( pass ) {
-
+ if (pass) {
max_compact = 0;
ret = H5Pget_link_phase_change(gcpl, &max_compact, NULL);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "ns_grp_d: H5Pget_link_phase_change() failed.";
- }
- else if ( nlinks <= max_compact ) {
-
- pass = FALSE;
- failure_mssg = "ns_grp_d: nlinks <= max_compact";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "ns_grp_d: H5Pget_link_phase_change() failed.";
+ }
+ else if (nlinks <= max_compact) {
+ pass = FALSE;
+ failure_mssg = "ns_grp_d: nlinks <= max_compact";
+ }
HDassert(ret >= 0);
HDassert(nlinks > max_compact);
}
u = 0;
- while ( ( pass ) && ( u < nlinks ) ) {
-
+ while ((pass) && (u < nlinks)) {
char linkname[16];
- sprintf(linkname, "%u", u);
-
- if(0 == (u % 3)) {
+ HDsprintf(linkname, "%u", u);
- ret = H5Lcreate_soft(group_name, gid, linkname,
- H5P_DEFAULT, H5P_DEFAULT);
+ if (0 == (u % 3)) {
+ ret = H5Lcreate_soft(group_name, gid, linkname,
+ H5P_DEFAULT, H5P_DEFAULT);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "ns_grp_d: H5Lcreate_soft() failed.";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "ns_grp_d: H5Lcreate_soft() failed.";
+ }
HDassert(ret >= 0);
} /* end if */
- else if(1 == (u % 3)) {
-
- ret = H5Lcreate_hard(fid, "/", gid, linkname,
- H5P_DEFAULT, H5P_DEFAULT);
+ else if (1 == (u % 3)) {
+ ret = H5Lcreate_hard(fid, "/", gid, linkname,
+ H5P_DEFAULT, H5P_DEFAULT);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "ns_grp_d: H5Lcreate_hard() failed.";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "ns_grp_d: H5Lcreate_hard() failed.";
+ }
HDassert(ret >= 0);
} /* end else-if */
else {
-
HDassert(2 == (u % 3));
- ret = H5Lcreate_external("external.h5", "/ext", gid, linkname,
- H5P_DEFAULT, H5P_DEFAULT);
+ ret = H5Lcreate_external("external.h5", "/ext", gid, linkname,
+ H5P_DEFAULT, H5P_DEFAULT);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "ns_grp_d: H5Lcreate_external() failed.";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "ns_grp_d: H5Lcreate_external() failed.";
+ }
HDassert(ret >= 0);
} /* end else */
u++;
-
} /* end while */
- if ( pass ) {
-
+ if (pass) {
ret = H5Pclose(gcpl);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "ns_grp_d: H5Pclose() failed.";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "ns_grp_d: H5Pclose() failed.";
+ }
HDassert(ret >= 0);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Gclose(gid);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "ns_grp_d: H5Gclose() failed.";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "ns_grp_d: H5Gclose() failed.";
+ }
HDassert(ret >= 0);
}
return;
-
} /* ns_grp_d() */
/*-------------------------------------------------------------------------
* Function: vrfy_ns_grp_d
*
- * Purpose: Verify a dense "new style" group, with 'nlinks'
- * soft/hard/external links in it in the specified file.
+ * Purpose: Verify a dense "new style" group, with 'nlinks'
+ * soft/hard/external links in it in the specified file.
*
* If pass is false on entry, do nothing.
*
@@ -928,8 +802,7 @@ ns_grp_d(hid_t fid, const char *group_name, unsigned nlinks)
void
-vrfy_ns_grp_d(hid_t fid, const char *group_name, unsigned nlinks)
-{
+vrfy_ns_grp_d(hid_t fid, const char *group_name, unsigned nlinks) {
hid_t gid = -1;
hid_t gcpl = -1;
H5G_info_t grp_info;
@@ -937,93 +810,75 @@ vrfy_ns_grp_d(hid_t fid, const char *group_name, unsigned nlinks)
unsigned u;
herr_t ret;
- if ( pass ) {
-
+ if (pass) {
gid = H5Gopen2(fid, group_name, H5P_DEFAULT);
- if ( gid <= 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ns_grp_d: H5Gopen2() failed.";
+ if (gid <= 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ns_grp_d: H5Gopen2() failed.";
}
HDassert(gid > 0);
}
- if ( pass ) {
-
+ if (pass) {
gcpl = H5Gget_create_plist(gid);
- if ( gcpl <= 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ns_grp_d: H5Gget_create_plist() failed.";
+ if (gcpl <= 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ns_grp_d: H5Gget_create_plist() failed.";
}
- assert(gcpl > 0);
+ HDassert(gcpl > 0);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Pget_link_creation_order(gcpl, &crt_order_flags);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg =
- "vrfy_ns_grp_d: H5Pget_link_creation_order() failed.";
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ns_grp_d: H5Pget_link_creation_order() failed.";
}
- else if ( H5P_CRT_ORDER_TRACKED != crt_order_flags ) {
-
- pass = FALSE;
- failure_mssg =
- "vrfy_ns_grp_d: H5P_CRT_ORDER_TRACKED != crt_order_flags";
+ else if (H5P_CRT_ORDER_TRACKED != crt_order_flags) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ns_grp_d: H5P_CRT_ORDER_TRACKED != crt_order_flags";
}
HDassert(ret >= 0);
HDassert(H5P_CRT_ORDER_TRACKED == crt_order_flags);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Pclose(gcpl);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ns_grp_d: H5Pclose() failed.";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ns_grp_d: H5Pclose() failed.";
+ }
HDassert(ret >= 0);
}
- if ( pass ) {
-
- memset(&grp_info, 0, sizeof(grp_info));
+ if (pass) {
+ HDmemset(&grp_info, 0, sizeof(grp_info));
ret = H5Gget_info(gid, &grp_info);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ns_grp_d: H5Gget_info() failed.";
- }
- else if ( H5G_STORAGE_TYPE_DENSE != grp_info.storage_type ) {
-
- pass = FALSE;
- failure_mssg =
- "vrfy_ns_grp_d: H5G_STORAGE_TYPE_DENSE != grp_info.storage_type";
- }
- else if ( nlinks != grp_info.nlinks ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ns_grp_d: nlinks != grp_info.nlinks";
- }
- else if ( nlinks != grp_info.max_corder ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ns_grp_d: nlinks != grp_info.max_corder";
- }
- else if ( FALSE != grp_info.mounted ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ns_grp_d: FALSE != grp_info.mounted";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ns_grp_d: H5Gget_info() failed.";
+ }
+ else if (H5G_STORAGE_TYPE_DENSE != grp_info.storage_type) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ns_grp_d: H5G_STORAGE_TYPE_DENSE != grp_info.storage_type";
+ }
+ else if (nlinks != grp_info.nlinks) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ns_grp_d: nlinks != grp_info.nlinks";
+ }
+ else if (nlinks != grp_info.max_corder) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ns_grp_d: nlinks != grp_info.max_corder";
+ }
+ else if ( FALSE != grp_info.mounted) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ns_grp_d: FALSE != grp_info.mounted";
+ }
HDassert(ret >= 0);
HDassert(H5G_STORAGE_TYPE_DENSE == grp_info.storage_type);
HDassert(nlinks == grp_info.nlinks);
@@ -1032,116 +887,100 @@ vrfy_ns_grp_d(hid_t fid, const char *group_name, unsigned nlinks)
}
u = 0;
- while ( ( pass ) && ( u < nlinks ) ) {
-
+ while ((pass) && (u < nlinks)) {
H5L_info_t lnk_info;
char linkname[16];
htri_t link_exists;
- sprintf(linkname, "%u", u);
+ HDsprintf(linkname, "%u", u);
link_exists = H5Lexists(gid, linkname, H5P_DEFAULT);
- if ( link_exists < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ns_grp_d: H5Lexists() failed.";
- }
+ if (link_exists < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ns_grp_d: H5Lexists() failed.";
+ }
HDassert(link_exists >= 0);
- memset(&lnk_info, 0, sizeof(grp_info));
+ HDmemset(&lnk_info, 0, sizeof(grp_info));
ret = H5Lget_info(gid, linkname, &lnk_info, H5P_DEFAULT);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ns_grp_d: H5Lget_info() failed.";
- }
- else if ( TRUE != lnk_info.corder_valid ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ns_grp_d: TRUE != lnk_info.corder_valid";
- }
- else if ( u != lnk_info.corder ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ns_grp_d: u != lnk_info.corder";
- }
- else if ( H5T_CSET_ASCII != lnk_info.cset ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ns_grp_d: H5T_CSET_ASCII != lnk_info.cset";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ns_grp_d: H5Lget_info() failed.";
+ }
+ else if (TRUE != lnk_info.corder_valid) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ns_grp_d: TRUE != lnk_info.corder_valid";
+ }
+ else if (u != lnk_info.corder) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ns_grp_d: u != lnk_info.corder";
+ }
+ else if (H5T_CSET_ASCII != lnk_info.cset) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ns_grp_d: H5T_CSET_ASCII != lnk_info.cset";
+ }
HDassert(ret >= 0);
HDassert(true == lnk_info.corder_valid);
HDassert(u == lnk_info.corder);
HDassert(H5T_CSET_ASCII == lnk_info.cset);
- if(0 == (u % 3)) {
+ if (0 == (u % 3)) {
char *slinkval;
- if ( H5L_TYPE_SOFT != lnk_info.type ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ns_grp_d: H5L_TYPE_SOFT != lnk_info.type";
- }
- else if ( (strlen(group_name) + 1) != lnk_info.u.val_size ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ns_grp_d: H5L_TYPE_SOFT != lnk_info.type";
- }
+ if (H5L_TYPE_SOFT != lnk_info.type) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ns_grp_d: H5L_TYPE_SOFT != lnk_info.type";
+ }
+ else if ((HDstrlen(group_name) + 1) != lnk_info.u.val_size) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ns_grp_d: H5L_TYPE_SOFT != lnk_info.type";
+ }
HDassert(H5L_TYPE_SOFT == lnk_info.type);
- HDassert((strlen(group_name) + 1) == lnk_info.u.val_size);
-
- slinkval = (char *)malloc(lnk_info.u.val_size);
+ HDassert((HDstrlen(group_name) + 1) == lnk_info.u.val_size);
- if ( ! slinkval ) {
+ slinkval = (char *) HDmalloc(lnk_info.u.val_size);
- pass = FALSE;
- failure_mssg = "vrfy_ns_grp_d: malloc of slinkval failed";
- }
+ if (!slinkval) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ns_grp_d: HDmalloc of slinkval failed";
+ }
HDassert(slinkval);
- ret = H5Lget_val(gid, linkname, slinkval, lnk_info.u.val_size,
- H5P_DEFAULT);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ns_grp_d: H5Lget_val() failed";
- }
- else if ( 0 != strcmp(slinkval, group_name) ) {
-
- pass = FALSE;
- failure_mssg =
- "vrfy_ns_grp_d: 0 != strcmp(slinkval, group_name)";
- }
+ ret = H5Lget_val(gid, linkname, slinkval, lnk_info.u.val_size,
+ H5P_DEFAULT);
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ns_grp_d: H5Lget_val() failed";
+ }
+ else if (0 != HDstrcmp(slinkval, group_name)) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ns_grp_d: 0 != HDstrcmp(slinkval, group_name)";
+ }
HDassert(ret >= 0);
- HDassert(0 == strcmp(slinkval, group_name));
+ HDassert(0 == HDstrcmp(slinkval, group_name));
- free(slinkval);
+ HDfree(slinkval);
} /* end if */
- else if(1 == (u % 3)) {
+ else if (1 == (u % 3)) {
H5O_info_t root_oinfo;
- if ( H5L_TYPE_HARD != lnk_info.type ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ns_grp_d: H5L_TYPE_HARD != lnk_info.type";
- }
+ if (H5L_TYPE_HARD != lnk_info.type) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ns_grp_d: H5L_TYPE_HARD != lnk_info.type";
+ }
HDassert(H5L_TYPE_HARD == lnk_info.type);
- memset(&root_oinfo, 0, sizeof(root_oinfo));
+ HDmemset(&root_oinfo, 0, sizeof(root_oinfo));
ret = H5Oget_info2(fid, &root_oinfo, H5O_INFO_BASIC);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ns_grp_d: H5Oget_info() failed.";
- }
- else if ( root_oinfo.addr != lnk_info.u.address ) {
-
- pass = FALSE;
- failure_mssg =
- "vrfy_ns_grp_d: root_oinfo.addr != lnk_info.u.address";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ns_grp_d: H5Oget_info() failed.";
+ }
+ else if (root_oinfo.addr != lnk_info.u.address) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ns_grp_d: root_oinfo.addr != lnk_info.u.address";
+ }
HDassert(ret >= 0);
HDassert(root_oinfo.addr == lnk_info.u.address);
} /* end else-if */
@@ -1152,72 +991,58 @@ vrfy_ns_grp_d(hid_t fid, const char *group_name, unsigned nlinks)
HDassert(2 == (u % 3));
- if ( H5L_TYPE_EXTERNAL != lnk_info.type ) {
-
- pass = FALSE;
- failure_mssg =
- "vrfy_ns_grp_d: H5L_TYPE_EXTERNAL != lnk_info.type";
- }
+ if (H5L_TYPE_EXTERNAL != lnk_info.type) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ns_grp_d: H5L_TYPE_EXTERNAL != lnk_info.type";
+ }
HDassert(H5L_TYPE_EXTERNAL == lnk_info.type);
- elinkval = malloc(lnk_info.u.val_size);
+ elinkval = HDmalloc(lnk_info.u.val_size);
- if ( ! elinkval ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ns_grp_d: malloc of elinkval failed.";
- }
+ if (!elinkval) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ns_grp_d: HDmalloc of elinkval failed.";
+ }
HDassert(elinkval);
- ret = H5Lget_val(gid, linkname, elinkval, lnk_info.u.val_size,
- H5P_DEFAULT);
- if ( ret < 0 ) {
-
- pass = FALSE;
+ ret = H5Lget_val(gid, linkname, elinkval, lnk_info.u.val_size,
+ H5P_DEFAULT);
+ if (ret < 0) {
+ pass = FALSE;
failure_mssg = "vrfy_ns_grp_d: H5Lget_val failed.";
}
HDassert(ret >= 0);
- ret = H5Lunpack_elink_val(elinkval, lnk_info.u.val_size, NULL,
- &file, &path);
- if ( ret < 0 ) {
-
- pass = FALSE;
+ ret = H5Lunpack_elink_val(elinkval, lnk_info.u.val_size, NULL, &file, &path);
+ if (ret < 0) {
+ pass = FALSE;
failure_mssg = "vrfy_ns_grp_d: H5Lunpack_elink_val failed.";
}
- else if ( 0 != strcmp(file, "external.h5") ) {
-
- pass = FALSE;
- failure_mssg =
- "vrfy_ns_grp_d: 0 != strcmp(file, \"external.h5\").";
+ else if (0 != HDstrcmp(file, "external.h5")) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ns_grp_d: 0 != HDstrcmp(file, \"external.h5\").";
+ }
+ else if (0 != HDstrcmp(path, "/ext")) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ns_grp_d: 0 != HDstrcmp(path, \"/ext\")";
}
- else if ( 0 != strcmp(path, "/ext") ) {
-
- pass = FALSE;
- failure_mssg =
- "vrfy_ns_grp_d: 0 != strcmp(path, \"/ext\")";
- }
HDassert(ret >= 0);
- HDassert(0 == strcmp(file, "external.h5"));
- HDassert(0 == strcmp(path, "/ext"));
-
- free(elinkval);
+ HDassert(0 == HDstrcmp(file, "external.h5"));
+ HDassert(0 == HDstrcmp(path, "/ext"));
+ HDfree(elinkval);
} /* end else */
- u++;
-
+ u++;
} /* end while() */
- if ( pass ) {
-
+ if (pass) {
ret = H5Gclose(gid);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ns_grp_d: H5Gclose() failed.";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ns_grp_d: H5Gclose() failed.";
+ }
HDassert(ret >= 0);
}
@@ -1254,21 +1079,17 @@ os_grp_0(hid_t fid, const char *group_name)
herr_t ret;
if ( pass ) { /* get the file's file access property list */
-
fapl = H5Fget_access_plist(fid);
if ( fapl <= 0 ) {
-
pass = FALSE;
failure_mssg = "os_grp_0: H5Fget_access_plist() failed.";
}
HDassert(fapl > 0);
}
-
- if ( pass ) { /* get low and high bounds from fapl */
+ 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).";
}
@@ -1276,11 +1097,9 @@ os_grp_0(hid_t fid, const char *group_name)
}
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).";
}
@@ -1289,11 +1108,8 @@ os_grp_0(hid_t fid, const char *group_name)
}
if ( pass ) {
-
- gid = H5Gcreate2(fid, group_name, H5P_DEFAULT, H5P_DEFAULT,
- H5P_DEFAULT);
+ gid = H5Gcreate2(fid, group_name, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if ( gid <= 0 ) {
-
pass = FALSE;
failure_mssg = "os_grp_0: H5Gcreate2() failed.";
}
@@ -1301,11 +1117,9 @@ os_grp_0(hid_t fid, const char *group_name)
}
if ( pass ) {
-
ret = H5Gclose(gid);
if ( ret < 0 ) {
-
pass = FALSE;
failure_mssg = "os_grp_0: H5Gclose() failed.";
}
@@ -1313,11 +1127,9 @@ os_grp_0(hid_t fid, const char *group_name)
}
if ( pass ) { /* restore low and high bounds */
-
if(low >= H5F_LIBVER_V18) {
ret = H5Fset_libver_bounds(fid, low, high);
if ( ret < 0 ) {
-
pass = FALSE;
failure_mssg = "os_grp_0: H5Fset_libver_bounds() failed(1).";
}
@@ -1326,7 +1138,6 @@ os_grp_0(hid_t fid, const char *group_name)
}
return;
-
} /* os_grp_0() */
@@ -1349,98 +1160,83 @@ os_grp_0(hid_t fid, const char *group_name)
*/
void
-vrfy_os_grp_0(hid_t fid, const char *group_name)
-{
+vrfy_os_grp_0(hid_t fid, const char *group_name) {
hid_t gid = -1;
hid_t gcpl = -1;
H5G_info_t grp_info;
unsigned crt_order_flags = 0;
herr_t ret;
- if ( pass ) {
-
+ if (pass) {
gid = H5Gopen2(fid, group_name, H5P_DEFAULT);
- if ( gid <= 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_os_grp_0: H5Gopen2() failed.";
- }
+ if (gid <= 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_os_grp_0: H5Gopen2() failed.";
+ }
HDassert(gid > 0);
}
- if ( pass ) {
-
+ if (pass) {
gcpl = H5Gget_create_plist(gid);
- if ( gcpl <= 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_os_grp_0: H5Gget_create_plist() failed.";
- }
+ if (gcpl <= 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_os_grp_0: H5Gget_create_plist() failed.";
+ }
HDassert(gcpl > 0);
}
- if ( pass ) {
+ if (pass) {
ret = H5Pget_link_creation_order(gcpl, &crt_order_flags);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_os_grp_0: H5Pget_link_creation_order() failed";
- }
- else if ( 0 != crt_order_flags ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_os_grp_0: 0 != crt_order_flags";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_os_grp_0: H5Pget_link_creation_order() failed";
+ }
+ else if (0 != crt_order_flags) {
+ pass = FALSE;
+ failure_mssg = "vrfy_os_grp_0: 0 != crt_order_flags";
+ }
HDassert(ret >= 0);
HDassert(0 == crt_order_flags);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Pclose(gcpl);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_os_grp_0: H5Pclose() failed.";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_os_grp_0: H5Pclose() failed.";
+ }
HDassert(ret >= 0);
}
- if ( pass ) {
-
- memset(&grp_info, 0, sizeof(grp_info));
+ if (pass) {
+ HDmemset(&grp_info, 0, sizeof(grp_info));
ret = H5Gget_info(gid, &grp_info);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_os_grp_0: H5Gget_info() failed.";
- }
- else if ( H5G_STORAGE_TYPE_SYMBOL_TABLE != grp_info.storage_type ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_os_grp_0: H5G_STORAGE_TYPE_SYMBOL_TABLE != grp_info.storage_type";
- }
- else if ( 0 != grp_info.nlinks ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_os_grp_0: 0 != grp_info.nlinks";
- }
- else if ( 0 != grp_info.max_corder ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_os_grp_0: 0 != grp_info.max_corder";
- }
- else if ( FALSE != grp_info.mounted ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_os_grp_0: FALSE != grp_info.mounted";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_os_grp_0: H5Gget_info() failed.";
+ }
+ else if (H5G_STORAGE_TYPE_SYMBOL_TABLE != grp_info.storage_type) {
+ pass = FALSE;
+ failure_mssg = "vrfy_os_grp_0: H5G_STORAGE_TYPE_SYMBOL_TABLE != grp_info.storage_type";
+ }
+ else if (0 != grp_info.nlinks) {
+ pass = FALSE;
+ failure_mssg = "vrfy_os_grp_0: 0 != grp_info.nlinks";
+ }
+ else if (0 != grp_info.max_corder) {
+ pass = FALSE;
+ failure_mssg = "vrfy_os_grp_0: 0 != grp_info.max_corder";
+ }
+ else if ( FALSE != grp_info.mounted) {
+ pass = FALSE;
+ failure_mssg = "vrfy_os_grp_0: FALSE != grp_info.mounted";
+ }
HDassert(ret >= 0);
HDassert(H5G_STORAGE_TYPE_SYMBOL_TABLE == grp_info.storage_type);
HDassert(0 == grp_info.nlinks);
@@ -1448,28 +1244,25 @@ vrfy_os_grp_0(hid_t fid, const char *group_name)
HDassert(false == grp_info.mounted);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Gclose(gid);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_os_grp_0: H5Gclose() failed.";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_os_grp_0: H5Gclose() failed.";
+ }
HDassert(ret >= 0);
}
return;
-
} /* vrfy_os_grp_0() */
/*-------------------------------------------------------------------------
* Function: os_grp_n
*
- * Purpose: Create an "old style" group, with 'nlinks' soft/hard
- * links in it.
+ * Purpose: Create an "old style" group, with 'nlinks' soft/hard
+ * links in it.
*
* If pass is false on entry, do nothing.
*
@@ -1484,7 +1277,7 @@ vrfy_os_grp_0(hid_t fid, const char *group_name)
*-------------------------------------------------------------------------
*/
-void
+void
os_grp_n(hid_t fid, const char *group_name, int proc_num, unsigned nlinks)
{
hid_t gid = -1;
@@ -1494,10 +1287,8 @@ os_grp_n(hid_t fid, const char *group_name, int proc_num, unsigned nlinks)
herr_t ret;
if ( pass ) { /* get the file's file access property list */
-
fapl = H5Fget_access_plist(fid);
if ( fapl <= 0 ) {
-
pass = FALSE;
failure_mssg = "os_grp_n: H5Fget_access_plist() failed.";
}
@@ -1505,10 +1296,8 @@ os_grp_n(hid_t fid, const char *group_name, int proc_num, unsigned nlinks)
}
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).";
}
@@ -1516,11 +1305,9 @@ os_grp_n(hid_t fid, const char *group_name, int proc_num, unsigned nlinks)
}
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).";
}
@@ -1529,11 +1316,8 @@ os_grp_n(hid_t fid, const char *group_name, int proc_num, unsigned nlinks)
}
if ( pass ) {
-
- gid = H5Gcreate2(fid, group_name, H5P_DEFAULT, H5P_DEFAULT,
- H5P_DEFAULT);
+ gid = H5Gcreate2(fid, group_name, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if ( gid <= 0 ) {
-
pass = FALSE;
failure_mssg = "os_grp_n: H5Gcreate2() failed.";
}
@@ -1544,58 +1328,46 @@ os_grp_n(hid_t fid, const char *group_name, int proc_num, unsigned nlinks)
u = 0;
while ( ( pass ) && ( u < nlinks ) ) {
-
char linkname[32];
- sprintf(linkname, "ln%d_%u", proc_num, u);
+ HDsprintf(linkname, "ln%d_%u", proc_num, u);
if(0 == (u % 2)) {
-
- ret = H5Lcreate_soft(group_name, gid, linkname, H5P_DEFAULT,
- H5P_DEFAULT);
+ ret = H5Lcreate_soft(group_name, gid, linkname, H5P_DEFAULT, H5P_DEFAULT);
if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "os_grp_n: H5Lcreate_soft() failed.";
+ pass = FALSE;
+ failure_mssg = "os_grp_n: H5Lcreate_soft() failed.";
}
HDassert(ret >= 0);
} /* end if */
else {
-
HDassert(1 == (u % 2));
- ret = H5Lcreate_hard(fid, "/", gid, linkname, H5P_DEFAULT,
- H5P_DEFAULT);
+ ret = H5Lcreate_hard(fid, "/", gid, linkname, H5P_DEFAULT, H5P_DEFAULT);
if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "os_grp_n: H5Lcreate_hard() failed.";
+ pass = FALSE;
+ failure_mssg = "os_grp_n: H5Lcreate_hard() failed.";
}
HDassert(ret >= 0);
} /* end else */
- u++;
-
+ u++;
} /* end while */
if ( pass ) {
-
ret = H5Gclose(gid);
if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "os_grp_n: H5Gclose() failed.";
+ pass = FALSE;
+ failure_mssg = "os_grp_n: H5Gclose() failed.";
}
- assert(ret >= 0);
+ HDassert(ret >= 0);
}
if ( pass ) { /* restore low and high bounds */
-
if(low >= H5F_LIBVER_V18) {
ret = H5Fset_libver_bounds(fid, low, high);
if ( ret < 0 ) {
-
pass = FALSE;
failure_mssg = "os_grp_n: H5Fset_libver_bounds() failed(2).";
}
@@ -1626,8 +1398,8 @@ os_grp_n(hid_t fid, const char *group_name, int proc_num, unsigned nlinks)
*-------------------------------------------------------------------------
*/
void
-vrfy_os_grp_n(hid_t fid, const char *group_name, int proc_num, unsigned nlinks)
-{
+vrfy_os_grp_n(hid_t fid, const char *group_name, int proc_num,
+ unsigned nlinks) {
hid_t gid = -1;
hid_t gcpl = -1;
H5G_info_t grp_info;
@@ -1635,92 +1407,76 @@ vrfy_os_grp_n(hid_t fid, const char *group_name, int proc_num, unsigned nlinks)
unsigned u;
herr_t ret;
- if ( pass ) {
-
+ if (pass) {
gid = H5Gopen2(fid, group_name, H5P_DEFAULT);
- if ( gid <= 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_os_grp_n: H5Gopen2() failed";
- }
+ if (gid <= 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_os_grp_n: H5Gopen2() failed";
+ }
HDassert(gid > 0);
}
- if ( pass ) {
-
+ if (pass) {
gcpl = H5Gget_create_plist(gid);
- if ( gcpl <= 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_os_grp_n: H5Gget_create_plist() failed";
- }
+ if (gcpl <= 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_os_grp_n: H5Gget_create_plist() failed";
+ }
HDassert(gcpl > 0);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Pget_link_creation_order(gcpl, &crt_order_flags);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_os_grp_n: H5Pget_link_creation_order";
- }
- else if ( 0 != crt_order_flags ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_os_grp_n: 0 != crt_order_flags";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_os_grp_n: H5Pget_link_creation_order";
+ }
+ else if (0 != crt_order_flags) {
+ pass = FALSE;
+ failure_mssg = "vrfy_os_grp_n: 0 != crt_order_flags";
+ }
HDassert(ret >= 0);
HDassert(0 == crt_order_flags);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Pclose(gcpl);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_os_grp_n: H5Pclose() failed";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_os_grp_n: H5Pclose() failed";
+ }
HDassert(ret >= 0);
}
- if ( pass ) {
-
- memset(&grp_info, 0, sizeof(grp_info));
+ if (pass) {
+ HDmemset(&grp_info, 0, sizeof(grp_info));
ret = H5Gget_info(gid, &grp_info);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_os_grp_n: H5Gget_info() failed";
- }
- else if ( H5G_STORAGE_TYPE_SYMBOL_TABLE != grp_info.storage_type ) {
-
- pass = FALSE;
- failure_mssg =
- "vrfy_os_grp_n: H5G_STORAGE_TYPE_SYMBOL_TABLE != grp_info.storage_type";
- }
- else if ( nlinks != grp_info.nlinks ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_os_grp_n: nlinks != grp_info.nlinks";
- }
- else if ( 0 != grp_info.max_corder ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_os_grp_n: 0 != grp_info.max_corder";
- }
- else if ( FALSE != grp_info.mounted ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_os_grp_n: FALSE != grp_info.mounted";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_os_grp_n: H5Gget_info() failed";
+ }
+ else if (H5G_STORAGE_TYPE_SYMBOL_TABLE != grp_info.storage_type) {
+ pass = FALSE;
+ failure_mssg = "vrfy_os_grp_n: H5G_STORAGE_TYPE_SYMBOL_TABLE != grp_info.storage_type";
+ }
+ else if (nlinks != grp_info.nlinks) {
+ pass = FALSE;
+ failure_mssg = "vrfy_os_grp_n: nlinks != grp_info.nlinks";
+ }
+ else if (0 != grp_info.max_corder) {
+ pass = FALSE;
+ failure_mssg = "vrfy_os_grp_n: 0 != grp_info.max_corder";
+ }
+ else if ( FALSE != grp_info.mounted) {
+ pass = FALSE;
+ failure_mssg = "vrfy_os_grp_n: FALSE != grp_info.mounted";
+ }
HDassert(ret >= 0);
HDassert(H5G_STORAGE_TYPE_SYMBOL_TABLE == grp_info.storage_type);
HDassert(nlinks == grp_info.nlinks);
@@ -1729,137 +1485,117 @@ vrfy_os_grp_n(hid_t fid, const char *group_name, int proc_num, unsigned nlinks)
}
u = 0;
- while ( ( pass ) && ( u < nlinks ) ) {
-
+ while ((pass) && (u < nlinks)) {
H5L_info_t lnk_info;
char linkname[32];
htri_t link_exists;
- sprintf(linkname, "ln%d_%u", proc_num, u);
+ HDsprintf(linkname, "ln%d_%u", proc_num, u);
link_exists = H5Lexists(gid, linkname, H5P_DEFAULT);
- if ( link_exists < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_os_grp_n: H5Lexists() failed";
+ if (link_exists < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_os_grp_n: H5Lexists() failed";
}
HDassert(link_exists >= 0);
- memset(&lnk_info, 0, sizeof(grp_info));
+ HDmemset(&lnk_info, 0, sizeof(grp_info));
ret = H5Lget_info(gid, linkname, &lnk_info, H5P_DEFAULT);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_os_grp_n: H5Lget_info() failed";
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_os_grp_n: H5Lget_info() failed";
}
- else if ( FALSE != lnk_info.corder_valid ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_os_grp_n: FALSE != lnk_info.corder_valid";
+ else if ( FALSE != lnk_info.corder_valid) {
+ pass = FALSE;
+ failure_mssg = "vrfy_os_grp_n: FALSE != lnk_info.corder_valid";
}
- else if ( H5T_CSET_ASCII != lnk_info.cset ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_os_grp_n: H5T_CSET_ASCII != lnk_info.cset";
+ else if (H5T_CSET_ASCII != lnk_info.cset) {
+ pass = FALSE;
+ failure_mssg = "vrfy_os_grp_n: H5T_CSET_ASCII != lnk_info.cset";
}
HDassert(ret >= 0);
HDassert(false == lnk_info.corder_valid);
HDassert(H5T_CSET_ASCII == lnk_info.cset);
- if(0 == (u % 2)) {
+ if (0 == (u % 2)) {
char *slinkval;
- if ( H5L_TYPE_SOFT != lnk_info.type ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_os_grp_n: H5L_TYPE_SOFT != lnk_info.type";
+ if (H5L_TYPE_SOFT != lnk_info.type) {
+ pass = FALSE;
+ failure_mssg = "vrfy_os_grp_n: H5L_TYPE_SOFT != lnk_info.type";
}
- else if ( (strlen(group_name) + 1) != lnk_info.u.val_size ) {
-
- pass = FALSE;
- failure_mssg =
- "vrfy_os_grp_n: (strlen(group_name) + 1) != lnk_info.u.val_size";
+ else if ((HDstrlen(group_name) + 1) != lnk_info.u.val_size) {
+ pass = FALSE;
+ failure_mssg = "vrfy_os_grp_n: (HDstrlen(group_name) + 1) != lnk_info.u.val_size";
}
HDassert(H5L_TYPE_SOFT == lnk_info.type);
- HDassert((strlen(group_name) + 1) == lnk_info.u.val_size);
-
- slinkval = (char *)malloc(lnk_info.u.val_size);
+ HDassert((HDstrlen(group_name) + 1) == lnk_info.u.val_size);
- if ( ! slinkval ) {
+ slinkval = (char *) HDmalloc(lnk_info.u.val_size);
- pass = FALSE;
- failure_mssg = "vrfy_os_grp_n: malloc of slinkval failed";
+ if (!slinkval) {
+ pass = FALSE;
+ failure_mssg = "vrfy_os_grp_n: HDmalloc of slinkval failed";
}
HDassert(slinkval);
- ret = H5Lget_val(gid, linkname, slinkval, lnk_info.u.val_size,
- H5P_DEFAULT);
-
- if ( ret < 0 ) {
+ ret = H5Lget_val(gid, linkname, slinkval, lnk_info.u.val_size,
+ H5P_DEFAULT);
- pass = FALSE;
- failure_mssg = "vrfy_os_grp_n: H5Lget_val() failed";
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_os_grp_n: H5Lget_val() failed";
}
- else if ( 0 != strcmp(slinkval, group_name) ) {
-
- pass = FALSE;
- failure_mssg =
- "vrfy_os_grp_n: 0 != strcmp(slinkval, group_name)";
+ else if (0 != HDstrcmp(slinkval, group_name)) {
+ pass = FALSE;
+ failure_mssg = "vrfy_os_grp_n: 0 != HDstrcmp(slinkval, group_name)";
}
HDassert(ret >= 0);
- HDassert(0 == strcmp(slinkval, group_name));
+ HDassert(0 == HDstrcmp(slinkval, group_name));
- free(slinkval);
+ HDfree(slinkval);
} /* end if */
else {
H5O_info_t root_oinfo;
HDassert(1 == (u % 2));
- if ( H5L_TYPE_HARD != lnk_info.type ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_os_grp_n: H5L_TYPE_HARD != lnk_info.type";
+ if (H5L_TYPE_HARD != lnk_info.type) {
+ pass = FALSE;
+ failure_mssg = "vrfy_os_grp_n: H5L_TYPE_HARD != lnk_info.type";
}
HDassert(H5L_TYPE_HARD == lnk_info.type);
- memset(&root_oinfo, 0, sizeof(root_oinfo));
+ HDmemset(&root_oinfo, 0, sizeof(root_oinfo));
ret = H5Oget_info2(fid, &root_oinfo, H5O_INFO_BASIC);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_os_grp_n: H5Oget_info() failed.";
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_os_grp_n: H5Oget_info() failed.";
}
- else if ( root_oinfo.addr != lnk_info.u.address ) {
-
- pass = FALSE;
- failure_mssg =
- "vrfy_os_grp_n: root_oinfo.addr != lnk_info.u.address";
+ else if (root_oinfo.addr != lnk_info.u.address) {
+ pass = FALSE;
+ failure_mssg = "vrfy_os_grp_n: root_oinfo.addr != lnk_info.u.address";
}
HDassert(ret >= 0);
HDassert(root_oinfo.addr == lnk_info.u.address);
} /* end else */
- u++;
-
+ u++;
} /* end while */
- if ( pass ) {
-
+ if (pass) {
ret = H5Gclose(gid);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_os_grp_n: H5Gclose() failed.";
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_os_grp_n: H5Gclose() failed.";
}
HDassert(ret >= 0);
}
return;
-
} /* vrfy_os_grp_n() */
@@ -1867,8 +1603,8 @@ vrfy_os_grp_n(hid_t fid, const char *group_name, int proc_num, unsigned nlinks)
* Function: ds_ctg_i
*
* Purpose: Create a contiguous dataset w/int datatype. Write data
- * to the data set or not as indicated by the write_data
- * parameter.
+ * to the data set or not as indicated by the write_data
+ * parameter.
*
* If pass is false on entry, do nothing.
*
@@ -1882,106 +1618,91 @@ vrfy_os_grp_n(hid_t fid, const char *group_name, int proc_num, unsigned nlinks)
*
*-------------------------------------------------------------------------
*/
-void
-ds_ctg_i(hid_t fid, const char *dset_name, hbool_t write_data)
-{
+void
+ds_ctg_i(hid_t fid, const char *dset_name, hbool_t write_data) {
int *wdata = NULL;
unsigned u;
hid_t dsid = -1;
hid_t sid = -1;
- hsize_t dims[1] = {DSET_DIMS};
+ hsize_t dims[1] = { DSET_DIMS };
herr_t ret;
- if ( pass ) {
-
+ if (pass) {
sid = H5Screate_simple(1, dims, NULL);
- if ( sid <= 0 ) {
-
- pass = FALSE;
- failure_mssg = "ds_ctg_i: H5Screate_simple() failed";
+ if (sid <= 0) {
+ pass = FALSE;
+ failure_mssg = "ds_ctg_i: H5Screate_simple() failed";
}
HDassert(sid > 0);
}
- if ( pass ) {
-
- dsid = H5Dcreate2(fid, dset_name, H5T_NATIVE_INT, sid, H5P_DEFAULT,
- H5P_DEFAULT, H5P_DEFAULT);
+ if (pass) {
+ dsid = H5Dcreate2(fid, dset_name, H5T_NATIVE_INT, sid, H5P_DEFAULT,
+ H5P_DEFAULT, H5P_DEFAULT);
- if ( dsid <= 0 ) {
-
- pass = FALSE;
- failure_mssg = "ds_ctg_i: H5Dcreate2() failed";
+ if (dsid <= 0) {
+ pass = FALSE;
+ failure_mssg = "ds_ctg_i: H5Dcreate2() failed";
}
HDassert(dsid > 0);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Sclose(sid);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "ds_ctg_i: H5Sclose() failed";
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "ds_ctg_i: H5Sclose() failed";
}
HDassert(ret >= 0);
}
- if ( ( pass ) && ( write_data ) ) {
-
- wdata = (int *)malloc(sizeof(int) * DSET_DIMS);
-
- if ( ! wdata ) {
+ if ((pass) && (write_data)) {
+ wdata = (int *) HDmalloc(sizeof(int) * DSET_DIMS);
- pass = FALSE;
- failure_mssg = "ds_ctg_i: malloc of wdata failed.";
+ if (!wdata) {
+ pass = FALSE;
+ failure_mssg = "ds_ctg_i: HDmalloc of wdata failed.";
}
HDassert(wdata);
}
- if ( ( pass ) && ( write_data ) ) {
-
- for(u = 0; u < DSET_DIMS; u++)
-
- wdata[u] = (int)u;
-
- ret = H5Dwrite(dsid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL,
- H5P_DEFAULT, wdata);
+ if ((pass) && (write_data)) {
+ for (u = 0; u < DSET_DIMS; u++)
+ wdata[u] = (int) u;
- if ( ret < 0 ) {
+ ret = H5Dwrite(dsid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL,
+ H5P_DEFAULT, wdata);
- pass = FALSE;
- failure_mssg = "ds_ctg_i: H5Dwrite() failed.";
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "ds_ctg_i: H5Dwrite() failed.";
}
HDassert(ret >= 0);
- free(wdata);
- }
-
- if ( pass ) {
+ HDfree(wdata);
+ }
+ if (pass) {
ret = H5Dclose(dsid);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "ds_ctg_i: H5Dclose() failed";
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "ds_ctg_i: H5Dclose() failed";
}
HDassert(ret >= 0);
}
return;
-
} /* ds_ctg_i */
/*-------------------------------------------------------------------------
* Function: vrfy_ds_ctg_i
*
- * Purpose: Validate a contiguous datasets w/int datatypes. Validate
- * data if indicated via the write_data parameter.
+ * Purpose: Validate a contiguous datasets w/int datatypes. Validate
+ * data if indicated via the write_data parameter.
*
* If pass is false on entry, do nothing.
*
@@ -1995,9 +1716,8 @@ ds_ctg_i(hid_t fid, const char *dset_name, hbool_t write_data)
*
*-------------------------------------------------------------------------
*/
-void
-vrfy_ds_ctg_i(hid_t fid, const char *dset_name, hbool_t write_data)
-{
+void
+vrfy_ds_ctg_i(hid_t fid, const char *dset_name, hbool_t write_data) {
int *rdata = NULL;
unsigned u;
hid_t dsid = -1;
@@ -2011,225 +1731,187 @@ vrfy_ds_ctg_i(hid_t fid, const char *dset_name, hbool_t write_data)
htri_t type_equal;
herr_t ret;
- if ( pass ) {
-
+ if (pass) {
dsid = H5Dopen2(fid, dset_name, H5P_DEFAULT);
- if ( dsid <= 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_i: H5Dopen2() failed.";
- }
+ if (dsid <= 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_i: H5Dopen2() failed.";
+ }
HDassert(dsid > 0);
}
- if ( pass ) {
-
+ if (pass) {
sid = H5Dget_space(dsid);
- if ( sid <= 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_i: H5Dget_space() failed.";
- }
+ if (sid <= 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_i: H5Dget_space() failed.";
+ }
HDassert(sid > 0);
}
- if ( pass ) {
-
+ if (pass) {
ndims = H5Sget_simple_extent_ndims(sid);
- if ( 1 != ndims ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_i: 1 != ndims";
- }
+ if (1 != ndims) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_i: 1 != ndims";
+ }
HDassert(1 == ndims);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Sget_simple_extent_dims(sid, dims, max_dims);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_i: H5Sget_simple_extent_dims() failed";
- }
- else if ( DSET_DIMS != dims[0] ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_i: DSET_DIMS != dims[0]";
- }
- else if ( DSET_DIMS != max_dims[0] ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_i: DSET_DIMS != max_dims[0]";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_i: H5Sget_simple_extent_dims() failed";
+ }
+ else if ( DSET_DIMS != dims[0]) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_i: DSET_DIMS != dims[0]";
+ }
+ else if ( DSET_DIMS != max_dims[0]) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_i: DSET_DIMS != max_dims[0]";
+ }
HDassert(ret >= 0);
HDassert(DSET_DIMS == dims[0]);
HDassert(DSET_DIMS == max_dims[0]);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Sclose(sid);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_i: H5Sclose() failed.";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_i: H5Sclose() failed.";
+ }
HDassert(ret >= 0);
}
- if ( pass ) {
-
+ if (pass) {
tid = H5Dget_type(dsid);
- if ( tid <= 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_i: H5Dget_type() failed.";
- }
+ if (tid <= 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_i: H5Dget_type() failed.";
+ }
HDassert(tid > 0);
}
- if ( pass ) {
-
+ if (pass) {
type_equal = H5Tequal(tid, H5T_NATIVE_INT);
- if ( 1 != type_equal ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_i: type not H5T_NATIVE_INT";
- }
+ if (1 != type_equal) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_i: type not H5T_NATIVE_INT";
+ }
HDassert(1 == type_equal);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Tclose(tid);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_i: H5Tclose() failed.";
- }
- assert(ret >= 0);
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_i: H5Tclose() failed.";
+ }
+ HDassert(ret >= 0);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Dget_space_status(dsid, &allocation);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_i: H5Dget_space_status() failed.";
- }
- else if ( write_data && ( allocation != H5D_SPACE_STATUS_ALLOCATED ) ) {
-
- pass = FALSE;
- failure_mssg =
- "vrfy_ds_ctg_i: write_data && allocation != H5D_SPACE_STATUS_ALLOCATED";
- }
- else if ( !write_data &&
- ( allocation != H5D_SPACE_STATUS_NOT_ALLOCATED ) ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_i: !write_data && allocation != H5D_SPACE_STATUS_NOT_ALLOCATED";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_i: H5Dget_space_status() failed.";
+ }
+ else if (write_data && (allocation != H5D_SPACE_STATUS_ALLOCATED)) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_i: write_data && allocation != H5D_SPACE_STATUS_ALLOCATED";
+ }
+ else if (!write_data
+ && (allocation != H5D_SPACE_STATUS_NOT_ALLOCATED)) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_i: !write_data && allocation != H5D_SPACE_STATUS_NOT_ALLOCATED";
+ }
HDassert(ret >= 0);
- HDassert((write_data && allocation == H5D_SPACE_STATUS_ALLOCATED) ||
- (!write_data && allocation == H5D_SPACE_STATUS_NOT_ALLOCATED));
+ HDassert((write_data && allocation == H5D_SPACE_STATUS_ALLOCATED)
+ || (!write_data && allocation == H5D_SPACE_STATUS_NOT_ALLOCATED));
}
- if ( pass ) {
-
+ if (pass) {
dcpl = H5Dget_create_plist(dsid);
- if ( dcpl <= 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_i: H5Dget_create_plist() failed.";
- }
+ if (dcpl <= 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_i: H5Dget_create_plist() failed.";
+ }
HDassert(dcpl > 0);
}
- if ( pass ) {
-
+ if (pass) {
layout = H5Pget_layout(dcpl);
- if ( H5D_CONTIGUOUS != layout ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_i: H5D_CONTIGUOUS != layout";
- }
+ if (H5D_CONTIGUOUS != layout) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_i: H5D_CONTIGUOUS != layout";
+ }
HDassert(H5D_CONTIGUOUS == layout);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Pclose(dcpl);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_i: H5Pclose() failed.";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_i: H5Pclose() failed.";
+ }
HDassert(ret >= 0);
}
- if ( ( pass ) && ( write_data ) ) {
-
- rdata = (int *)malloc(sizeof(int) * DSET_DIMS);
+ if ((pass) && (write_data)) {
+ rdata = (int *) HDmalloc(sizeof(int) * DSET_DIMS);
- if ( ! rdata ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_i: malloc of rdata failed.";
- }
+ if (!rdata) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_i: HDmalloc of rdata failed.";
+ }
HDassert(rdata);
}
- if ( ( pass ) && ( write_data ) ) {
-
- ret = H5Dread(dsid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL,
- H5P_DEFAULT, rdata);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_i: H5Dread() failed.";
- }
+ if ((pass) && (write_data)) {
+ ret = H5Dread(dsid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL,
+ H5P_DEFAULT, rdata);
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_i: H5Dread() failed.";
+ }
HDassert(ret >= 0);
}
- if ( ( pass ) && ( write_data ) ) {
-
- for(u = 0; u < DSET_DIMS; u++) {
-
- if ( (int)u != rdata[u] ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_i: u != rdata[u].";
- break;
- }
- HDassert((int)u == rdata[u]);
- }
+ if ((pass) && (write_data)) {
+ for (u = 0; u < DSET_DIMS; u++) {
+ if ((int) u != rdata[u]) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_i: u != rdata[u].";
+ break;
+ }
+ HDassert((int )u == rdata[u]);
+ }
- free(rdata);
+ HDfree(rdata);
} /* end if */
- if ( pass ) {
-
+ if (pass) {
ret = H5Dclose(dsid);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_i: H5Dclose() failed";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_i: H5Dclose() failed";
+ }
HDassert(ret >= 0);
}
@@ -2242,8 +1924,8 @@ vrfy_ds_ctg_i(hid_t fid, const char *dset_name, hbool_t write_data)
* Function: ds_chk_i
*
* Purpose: Create a chunked dataset w/int datatype. Write data
- * to the data set or not as indicated by the write_data
- * parameter.
+ * to the data set or not as indicated by the write_data
+ * parameter.
*
* If pass is false on entry, do nothing.
*
@@ -2257,142 +1939,121 @@ vrfy_ds_ctg_i(hid_t fid, const char *dset_name, hbool_t write_data)
*
*-------------------------------------------------------------------------
*/
-void
-ds_chk_i(hid_t fid, const char *dset_name, hbool_t write_data)
-{
+void
+ds_chk_i(hid_t fid, const char *dset_name, hbool_t write_data) {
int *wdata = NULL;
unsigned u;
hid_t dsid = -1;
hid_t dcpl = -1;
hid_t sid = -1;
- hsize_t dims[1] = {DSET_DIMS};
- hsize_t chunk_dims[1] = {DSET_CHUNK_DIMS};
+ hsize_t dims[1] = { DSET_DIMS };
+ hsize_t chunk_dims[1] = { DSET_CHUNK_DIMS };
herr_t ret;
- if ( pass ) {
-
+ if (pass) {
sid = H5Screate_simple(1, dims, NULL);
- if ( sid <= 0 ) {
-
- pass = FALSE;
- failure_mssg = "ds_chk_i: H5Screate_simple() failed.";
- }
+ if (sid <= 0) {
+ pass = FALSE;
+ failure_mssg = "ds_chk_i: H5Screate_simple() failed.";
+ }
HDassert(sid > 0);
}
- if ( pass ) {
-
+ if (pass) {
dcpl = H5Pcreate(H5P_DATASET_CREATE);
- if ( dcpl <= 0 ) {
-
- pass = FALSE;
- failure_mssg = "ds_chk_i: H5Pcreate() failed.";
- }
+ if (dcpl <= 0) {
+ pass = FALSE;
+ failure_mssg = "ds_chk_i: H5Pcreate() failed.";
+ }
HDassert(dcpl > 0);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Pset_chunk(dcpl, 1, chunk_dims);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "ds_chk_i: H5Pset_chunk() failed.";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "ds_chk_i: H5Pset_chunk() failed.";
+ }
HDassert(ret >= 0);
}
- if ( pass ) {
-
- dsid = H5Dcreate2(fid, dset_name, H5T_NATIVE_INT, sid,
- H5P_DEFAULT, dcpl, H5P_DEFAULT);
+ if (pass) {
+ dsid = H5Dcreate2(fid, dset_name, H5T_NATIVE_INT, sid,
+ H5P_DEFAULT, dcpl, H5P_DEFAULT);
- if ( dsid <= 0 ) {
-
- pass = FALSE;
- failure_mssg = "ds_chk_i: H5Dcreate2() failed";
- }
+ if (dsid <= 0) {
+ pass = FALSE;
+ failure_mssg = "ds_chk_i: H5Dcreate2() failed";
+ }
HDassert(dsid > 0);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Pclose(dcpl);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "ds_chk_i: H5Pclose() failed.";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "ds_chk_i: H5Pclose() failed.";
+ }
HDassert(ret >= 0);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Sclose(sid);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "ds_chk_i: H5Sclose() failed.";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "ds_chk_i: H5Sclose() failed.";
+ }
HDassert(ret >= 0);
}
- if ( ( pass ) && ( write_data ) ) {
-
- wdata = (int *)malloc(sizeof(int) * DSET_DIMS);
+ if ((pass) && (write_data)) {
+ wdata = (int *) HDmalloc(sizeof(int) * DSET_DIMS);
- if ( ! wdata ) {
-
- pass = FALSE;
- failure_mssg = "ds_chk_i: malloc of wdata failed.";
- }
+ if (!wdata) {
+ pass = FALSE;
+ failure_mssg = "ds_chk_i: HDmalloc of wdata failed.";
+ }
HDassert(wdata);
}
- if ( ( pass ) && ( write_data ) ) {
-
- for(u = 0; u < DSET_DIMS; u++)
- wdata[u] = (int)u;
+ if ((pass) && (write_data)) {
+ for (u = 0; u < DSET_DIMS; u++)
+ wdata[u] = (int) u;
- ret = H5Dwrite(dsid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL,
- H5P_DEFAULT, wdata);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "ds_chk_i: H5Dwrite() failed.";
- }
+ ret = H5Dwrite(dsid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL,
+ H5P_DEFAULT, wdata);
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "ds_chk_i: H5Dwrite() failed.";
+ }
HDassert(ret >= 0);
-
- free(wdata);
+ HDfree(wdata);
} /* end if */
- if ( pass ) {
-
+ if (pass) {
ret = H5Dclose(dsid);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "ds_chk_i: H5Dclose() failed.";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "ds_chk_i: H5Dclose() failed.";
+ }
HDassert(ret >= 0);
}
return;
-
} /* ds_chk_i */
/*-------------------------------------------------------------------------
* Function: vrfy_ds_chk_i
*
- * Purpose: Validate a chunked datasets w/int datatypes. Validate
- * data if indicated via the write_data parameter.
+ * Purpose: Validate a chunked datasets w/int datatypes. Validate
+ * data if indicated via the write_data parameter.
*
* If pass is false on entry, do nothing.
*
@@ -2406,9 +2067,8 @@ ds_chk_i(hid_t fid, const char *dset_name, hbool_t write_data)
*
*-------------------------------------------------------------------------
*/
-void
-vrfy_ds_chk_i(hid_t fid, const char *dset_name, hbool_t write_data)
-{
+void
+vrfy_ds_chk_i(hid_t fid, const char *dset_name, hbool_t write_data) {
int *rdata = NULL;
unsigned u;
hid_t dsid = -1;
@@ -2422,249 +2082,204 @@ vrfy_ds_chk_i(hid_t fid, const char *dset_name, hbool_t write_data)
htri_t type_equal;
herr_t ret;
- if ( pass ) {
-
+ if (pass) {
dsid = H5Dopen2(fid, dset_name, H5P_DEFAULT);
- if ( dsid <= 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_chk_i: H5Dopen2() failed.";
- }
+ if (dsid <= 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_chk_i: H5Dopen2() failed.";
+ }
HDassert(dsid > 0);
}
- if ( pass ) {
-
+ if (pass) {
sid = H5Dget_space(dsid);
- if ( sid <= 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_chk_i: H5Dget_space() failed.";
- }
+ if (sid <= 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_chk_i: H5Dget_space() failed.";
+ }
HDassert(sid > 0);
}
- if ( pass ) {
-
+ if (pass) {
ndims = H5Sget_simple_extent_ndims(sid);
- if ( 1 != ndims ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_chk_i: 1 != ndims";
- }
+ if (1 != ndims) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_chk_i: 1 != ndims";
+ }
HDassert(1 == ndims);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Sget_simple_extent_dims(sid, dims, max_dims);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_chk_i: H5Sget_simple_extent_dims() failed";
- }
- else if ( DSET_DIMS != dims[0] ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_chk_i: DSET_DIMS != dims[0]";
- }
- else if ( DSET_DIMS != max_dims[0] ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_chk_i: DSET_DIMS != max_dims[0]";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_chk_i: H5Sget_simple_extent_dims() failed";
+ }
+ else if ( DSET_DIMS != dims[0]) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_chk_i: DSET_DIMS != dims[0]";
+ }
+ else if ( DSET_DIMS != max_dims[0]) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_chk_i: DSET_DIMS != max_dims[0]";
+ }
HDassert(ret >= 0);
HDassert(DSET_DIMS == dims[0]);
HDassert(DSET_DIMS == max_dims[0]);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Sclose(sid);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_chk_i: H5Sclose() failed.";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_chk_i: H5Sclose() failed.";
+ }
HDassert(ret >= 0);
}
- if ( pass ) {
-
+ if (pass) {
tid = H5Dget_type(dsid);
- if ( tid <= 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_chk_i: H5Dget_type() failed.";
- }
+ if (tid <= 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_chk_i: H5Dget_type() failed.";
+ }
HDassert(tid > 0);
}
- if ( pass ) {
-
+ if (pass) {
type_equal = H5Tequal(tid, H5T_NATIVE_INT);
- if ( 1 != type_equal ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_chk_i: tid != H5T_NATIVE_INT";
- }
+ if (1 != type_equal) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_chk_i: tid != H5T_NATIVE_INT";
+ }
HDassert(1 == type_equal);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Tclose(tid);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_chk_i: H5Tclose() failed.";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_chk_i: H5Tclose() failed.";
+ }
HDassert(ret >= 0);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Dget_space_status(dsid, &allocation);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_chk_i: H5Dget_space_status() failed.";
- }
- else if ( write_data && ( allocation != H5D_SPACE_STATUS_ALLOCATED ) ) {
-
- pass = FALSE;
- failure_mssg =
- "vrfy_ds_chk_i: write_data && allocation != H5D_SPACE_STATUS_ALLOCATED";
- }
- else if ( !write_data &&
- ( allocation != H5D_SPACE_STATUS_NOT_ALLOCATED ) ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_chk_i: !write_data && allocation != H5D_SPACE_STATUS_NOT_ALLOCATED";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_chk_i: H5Dget_space_status() failed.";
+ }
+ else if (write_data && (allocation != H5D_SPACE_STATUS_ALLOCATED)) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_chk_i: write_data && allocation != H5D_SPACE_STATUS_ALLOCATED";
+ }
+ else if (!write_data && (allocation != H5D_SPACE_STATUS_NOT_ALLOCATED)) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_chk_i: !write_data && allocation != H5D_SPACE_STATUS_NOT_ALLOCATED";
+ }
HDassert(ret >= 0);
- HDassert((write_data && allocation == H5D_SPACE_STATUS_ALLOCATED) ||
- (!write_data && allocation == H5D_SPACE_STATUS_NOT_ALLOCATED));
+ HDassert((write_data && allocation == H5D_SPACE_STATUS_ALLOCATED)
+ || (!write_data && allocation == H5D_SPACE_STATUS_NOT_ALLOCATED));
}
- if ( pass ) {
-
+ if (pass) {
dcpl = H5Dget_create_plist(dsid);
- if ( dcpl <= 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_chk_i: H5Dget_create_plist() failed.";
- }
+ if (dcpl <= 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_chk_i: H5Dget_create_plist() failed.";
+ }
HDassert(dcpl > 0);
}
- if ( pass ) {
-
+ if (pass) {
layout = H5Pget_layout(dcpl);
- if ( H5D_CHUNKED != layout ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_chk_i: H5D_CHUNKED != layout";
- }
+ if (H5D_CHUNKED != layout) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_chk_i: H5D_CHUNKED != layout";
+ }
HDassert(H5D_CHUNKED == layout);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Pget_chunk(dcpl, 1, chunk_dims);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_chk_i: H5Pget_chunk";
- }
- else if ( DSET_CHUNK_DIMS != chunk_dims[0] ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_chk_i: ";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_chk_i: H5Pget_chunk";
+ }
+ else if ( DSET_CHUNK_DIMS != chunk_dims[0]) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_chk_i: ";
+ }
HDassert(ret >= 0);
HDassert(DSET_CHUNK_DIMS == chunk_dims[0]);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Pclose(dcpl);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_chk_i: H5Pclose() failed.";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_chk_i: H5Pclose() failed.";
+ }
HDassert(ret >= 0);
}
- if ( ( pass ) && ( write_data ) ) {
-
- rdata = (int *)malloc(sizeof(int) * DSET_DIMS);
+ if ((pass) && (write_data)) {
+ rdata = (int *) HDmalloc(sizeof(int) * DSET_DIMS);
- if ( ! rdata ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_chk_i: malloc of rdata failed.";
- }
+ if (!rdata) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_chk_i: HDmalloc of rdata failed.";
+ }
HDassert(rdata);
}
- if ( ( pass ) && ( write_data ) ) {
-
- ret = H5Dread(dsid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT,
- rdata);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_chk_i: H5Dread() failed.";
- }
+ if ((pass) && (write_data)) {
+ ret = H5Dread(dsid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rdata);
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_chk_i: H5Dread() failed.";
+ }
HDassert(ret >= 0);
}
- if ( ( pass ) && ( write_data ) ) {
-
- for(u = 0; u < DSET_DIMS; u++) {
-
- if ( (int)u != rdata[u] ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_chk_i: u != rdata[u]";
- break;
- }
- HDassert((int)u == rdata[u]);
+ if ((pass) && (write_data)) {
+ for (u = 0; u < DSET_DIMS; u++) {
+ if ((int) u != rdata[u]) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_chk_i: u != rdata[u]";
+ break;
+ }
+ HDassert((int )u == rdata[u]);
}
- free(rdata);
+ HDfree(rdata);
} /* end if */
-
- if ( pass ) {
-
+ if (pass) {
ret = H5Dclose(dsid);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_chk_i: H5Dclose() failed.";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_chk_i: H5Dclose() failed.";
+ }
HDassert(ret >= 0);
}
return;
-
} /* vrfy_ds_chk_i() */
@@ -2672,8 +2287,8 @@ vrfy_ds_chk_i(hid_t fid, const char *dset_name, hbool_t write_data)
* Function: ds_cpt_i
*
* Purpose: Create a compact dataset w/int datatype. Write data
- * to the data set or not as indicated by the write_data
- * parameter.
+ * to the data set or not as indicated by the write_data
+ * parameter.
*
* If pass is false on entry, do nothing.
*
@@ -2687,129 +2302,110 @@ vrfy_ds_chk_i(hid_t fid, const char *dset_name, hbool_t write_data)
*
*-------------------------------------------------------------------------
*/
-void
-ds_cpt_i(hid_t fid, const char *dset_name, hbool_t write_data)
-{
+void
+ds_cpt_i(hid_t fid, const char *dset_name, hbool_t write_data) {
int *wdata = NULL;
unsigned u;
hid_t dsid = -1;
hid_t dcpl = -1;
hid_t sid = -1;
- hsize_t dims[1] = {DSET_COMPACT_DIMS};
+ hsize_t dims[1] = { DSET_COMPACT_DIMS };
herr_t ret;
- if ( pass ) {
-
+ if (pass) {
sid = H5Screate_simple(1, dims, NULL);
- if ( sid <= 0 ) {
-
- pass = FALSE;
- failure_mssg = "ds_cpt_i: H5Screate_simple() failed.";
- }
+ if (sid <= 0) {
+ pass = FALSE;
+ failure_mssg = "ds_cpt_i: H5Screate_simple() failed.";
+ }
HDassert(sid > 0);
}
- if ( pass ) {
-
+ if (pass) {
dcpl = H5Pcreate(H5P_DATASET_CREATE);
- if ( dcpl <= 0 ) {
-
- pass = FALSE;
- failure_mssg = "ds_cpt_i: H5Pcreate() failed.";
- }
+ if (dcpl <= 0) {
+ pass = FALSE;
+ failure_mssg = "ds_cpt_i: H5Pcreate() failed.";
+ }
HDassert(dcpl > 0);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Pset_layout(dcpl, H5D_COMPACT);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "ds_cpt_i: H5Pset_layout() failed.";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "ds_cpt_i: H5Pset_layout() failed.";
+ }
HDassert(ret >= 0);
}
- if ( pass ) {
-
- dsid = H5Dcreate2(fid, dset_name, H5T_NATIVE_INT, sid,
- H5P_DEFAULT, dcpl, H5P_DEFAULT);
+ if (pass) {
+ dsid = H5Dcreate2(fid, dset_name, H5T_NATIVE_INT, sid,
+ H5P_DEFAULT, dcpl, H5P_DEFAULT);
- if ( dsid <= 0 ) {
-
- pass = FALSE;
- failure_mssg = "ds_cpt_i: H5Dcreate2() failed.";
- }
+ if (dsid <= 0) {
+ pass = FALSE;
+ failure_mssg = "ds_cpt_i: H5Dcreate2() failed.";
+ }
HDassert(dsid > 0);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Pclose(dcpl);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "ds_cpt_i: H5Pclose() failed.";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "ds_cpt_i: H5Pclose() failed.";
+ }
HDassert(ret >= 0);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Sclose(sid);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "ds_cpt_i: H5Sclose() failed.";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "ds_cpt_i: H5Sclose() failed.";
+ }
HDassert(ret >= 0);
}
- if ( ( pass ) && ( write_data ) ) {
-
- wdata = (int *)malloc(sizeof(int) * DSET_COMPACT_DIMS);
+ if ((pass) && (write_data)) {
+ wdata = (int *) HDmalloc(sizeof(int) * DSET_COMPACT_DIMS);
- if ( ! wdata ) {
-
- pass = FALSE;
- failure_mssg = "ds_cpt_i: malloc of wdata failed.";
- }
+ if (!wdata) {
+ pass = FALSE;
+ failure_mssg = "ds_cpt_i: HDmalloc of wdata failed.";
+ }
HDassert(wdata);
}
- if ( ( pass ) && ( write_data ) ) {
-
- for(u = 0; u < DSET_COMPACT_DIMS; u++)
- wdata[u] = (int)u;
+ if ((pass) && (write_data)) {
+ for (u = 0; u < DSET_COMPACT_DIMS; u++)
+ wdata[u] = (int) u;
- ret = H5Dwrite(dsid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL,
- H5P_DEFAULT, wdata);
+ ret = H5Dwrite(dsid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL,
+ H5P_DEFAULT, wdata);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "ds_cpt_i: H5Dwrite() failed.";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "ds_cpt_i: H5Dwrite() failed.";
+ }
HDassert(ret >= 0);
- free(wdata);
+ HDfree(wdata);
} /* end if */
- if ( pass ) {
-
+ if (pass) {
ret = H5Dclose(dsid);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "ds_cpt_i: H5Dclose() failed.";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "ds_cpt_i: H5Dclose() failed.";
+ }
HDassert(ret >= 0);
}
@@ -2821,8 +2417,8 @@ ds_cpt_i(hid_t fid, const char *dset_name, hbool_t write_data)
/*-------------------------------------------------------------------------
* Function: vrfy_ds_cpt_i
*
- * Purpose: Validate a compact datasets w/int datatypes. Validate
- * data if indicated via the write_data parameter.
+ * Purpose: Validate a compact datasets w/int datatypes. Validate
+ * data if indicated via the write_data parameter.
*
* If pass is false on entry, do nothing.
*
@@ -2836,9 +2432,8 @@ ds_cpt_i(hid_t fid, const char *dset_name, hbool_t write_data)
*
*-------------------------------------------------------------------------
*/
-void
-vrfy_ds_cpt_i(hid_t fid, const char *dset_name, hbool_t write_data)
-{
+void
+vrfy_ds_cpt_i(hid_t fid, const char *dset_name, hbool_t write_data) {
int *rdata = NULL;
unsigned u;
hid_t dsid = -1;
@@ -2852,232 +2447,195 @@ vrfy_ds_cpt_i(hid_t fid, const char *dset_name, hbool_t write_data)
htri_t type_equal;
herr_t ret;
- if ( pass ) {
-
+ if (pass) {
dsid = H5Dopen2(fid, dset_name, H5P_DEFAULT);
- if ( dsid <= 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_cpt_i: H5Dopen2() failed.";
- }
+ if (dsid <= 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_cpt_i: H5Dopen2() failed.";
+ }
HDassert(dsid > 0);
}
- if ( pass ) {
-
+ if (pass) {
sid = H5Dget_space(dsid);
- if ( sid <= 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_cpt_i: H5Dget_space() failed.";
- }
+ if (sid <= 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_cpt_i: H5Dget_space() failed.";
+ }
HDassert(sid > 0);
}
- if ( pass ) {
-
+ if (pass) {
ndims = H5Sget_simple_extent_ndims(sid);
- if ( 1 != ndims ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_cpt_i: 1 != ndims";
- }
+ if (1 != ndims) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_cpt_i: 1 != ndims";
+ }
HDassert(1 == ndims);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Sget_simple_extent_dims(sid, dims, max_dims);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_cpt_i: H5Sget_simple_extent_dims() failed";
- }
- else if ( DSET_COMPACT_DIMS != dims[0] ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_cpt_i: DSET_COMPACT_DIMS != dims[0]";
- }
- else if ( DSET_COMPACT_DIMS != max_dims[0] ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_cpt_i: DSET_COMPACT_DIMS != max_dims[0]";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_cpt_i: H5Sget_simple_extent_dims() failed";
+ }
+ else if ( DSET_COMPACT_DIMS != dims[0]) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_cpt_i: DSET_COMPACT_DIMS != dims[0]";
+ }
+ else if ( DSET_COMPACT_DIMS != max_dims[0]) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_cpt_i: DSET_COMPACT_DIMS != max_dims[0]";
+ }
HDassert(ret >= 0);
HDassert(DSET_COMPACT_DIMS == dims[0]);
HDassert(DSET_COMPACT_DIMS == max_dims[0]);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Sclose(sid);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_cpt_i: H5Sclose() failed.";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_cpt_i: H5Sclose() failed.";
+ }
HDassert(ret >= 0);
}
- if ( pass ) {
-
+ if (pass) {
tid = H5Dget_type(dsid);
- if ( tid <= 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_cpt_i: H5Dget_type() failed.";
- }
+ if (tid <= 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_cpt_i: H5Dget_type() failed.";
+ }
HDassert(tid > 0);
}
- if ( pass ) {
-
+ if (pass) {
type_equal = H5Tequal(tid, H5T_NATIVE_INT);
- if ( 1 != type_equal ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_cpt_i: type != H5T_NATIVE_INT";
- }
+ if (1 != type_equal) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_cpt_i: type != H5T_NATIVE_INT";
+ }
HDassert(1 == type_equal);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Tclose(tid);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_cpt_i: H5Tclose() failed.";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_cpt_i: H5Tclose() failed.";
+ }
HDassert(ret >= 0);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Dget_space_status(dsid, &allocation);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_cpt_i: H5Dget_space_status() failed.";
- }
- else if ( H5D_SPACE_STATUS_ALLOCATED != allocation ) {
-
- pass = FALSE;
- failure_mssg =
- "vrfy_ds_cpt_i: H5D_SPACE_STATUS_ALLOCATED != allocation";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_cpt_i: H5Dget_space_status() failed.";
+ }
+ else if (H5D_SPACE_STATUS_ALLOCATED != allocation) {
+ pass = FALSE;
+ failure_mssg =
+ "vrfy_ds_cpt_i: H5D_SPACE_STATUS_ALLOCATED != allocation";
+ }
HDassert(ret >= 0);
HDassert(H5D_SPACE_STATUS_ALLOCATED == allocation);
}
- if ( pass ) {
-
+ if (pass) {
dcpl = H5Dget_create_plist(dsid);
- if ( dcpl <= 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_cpt_i: H5Dget_create_plist() failed.";
- }
+ if (dcpl <= 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_cpt_i: H5Dget_create_plist() failed.";
+ }
HDassert(dcpl > 0);
}
- if ( pass ) {
-
+ if (pass) {
layout = H5Pget_layout(dcpl);
- if ( H5D_COMPACT != layout ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_cpt_i: H5D_COMPACT != layout";
- }
+ if (H5D_COMPACT != layout) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_cpt_i: H5D_COMPACT != layout";
+ }
HDassert(H5D_COMPACT == layout);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Pclose(dcpl);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_cpt_i: H5Pclose() failed.";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_cpt_i: H5Pclose() failed.";
+ }
HDassert(ret >= 0);
- }
-
- if ( ( pass ) && ( write_data ) ) {
-
- rdata = (int *)malloc(sizeof(int) * DSET_COMPACT_DIMS);
+ }
- if ( ! rdata ) {
+ if ((pass) && (write_data)) {
+ rdata = (int *) HDmalloc(sizeof(int) * DSET_COMPACT_DIMS);
- pass = FALSE;
- failure_mssg = "vrfy_ds_cpt_i: malloc of rdata failed.";
- }
+ if (!rdata) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_cpt_i: HDmalloc of rdata failed.";
+ }
HDassert(rdata);
}
- if ( ( pass ) && ( write_data ) ) {
-
- ret = H5Dread(dsid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL,
- H5P_DEFAULT, rdata);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_cpt_i: H5Dread() failed.";
- }
+ if ((pass) && (write_data)) {
+ ret = H5Dread(dsid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL,
+ H5P_DEFAULT, rdata);
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_cpt_i: H5Dread() failed.";
+ }
HDassert(ret >= 0);
}
- if ( ( pass ) && ( write_data ) ) {
-
- for(u = 0; u < DSET_COMPACT_DIMS; u++) {
-
- if ( (int)u != rdata[u] ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_cpt_i: (int)u != rdata[u]";
- break;
- }
- HDassert((int)u == rdata[u]);
+ if ((pass) && (write_data)) {
+ for (u = 0; u < DSET_COMPACT_DIMS; u++) {
+ if ((int) u != rdata[u]) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_cpt_i: (int)u != rdata[u]";
+ break;
+ }
+ HDassert((int )u == rdata[u]);
}
- free(rdata);
+ HDfree(rdata);
} /* end if */
- if ( pass ) {
-
+ if (pass) {
ret = H5Dclose(dsid);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_cpt_i: H5Dclose() failed.";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_cpt_i: H5Dclose() failed.";
+ }
HDassert(ret >= 0);
}
return;
-
} /* vrfy_ds_cpt_i() */
/*-------------------------------------------------------------------------
* Function: ds_ctg_v
*
- * Purpose: Create a contiguous dataset w/variable-length datatype.
- * Write data to the data set or not as indicated by the
- * write_data parameter.
+ * Purpose: Create a contiguous dataset w/variable-length datatype.
+ * Write data to the data set or not as indicated by the
+ * write_data parameter.
*
* If pass is false on entry, do nothing.
*
@@ -3091,166 +2649,142 @@ vrfy_ds_cpt_i(hid_t fid, const char *dset_name, hbool_t write_data)
*
*-------------------------------------------------------------------------
*/
-void
-ds_ctg_v(hid_t fid, const char *dset_name, hbool_t write_data)
-{
+void
+ds_ctg_v(hid_t fid, const char *dset_name, hbool_t write_data) {
hid_t dsid = -1;
hid_t sid = -1;
hid_t tid = -1;
- hsize_t dims[1] = {DSET_SMALL_DIMS};
+ hsize_t dims[1] = { DSET_SMALL_DIMS };
herr_t ret;
hvl_t *wdata = NULL;
unsigned u;
- if ( pass ) {
-
+ if (pass) {
sid = H5Screate_simple(1, dims, NULL);
- if ( sid <= 0 ) {
-
- pass = FALSE;
- failure_mssg = "ds_ctg_v: H5Screate_simple";
- }
+ if (sid <= 0) {
+ pass = FALSE;
+ failure_mssg = "ds_ctg_v: H5Screate_simple";
+ }
HDassert(sid > 0);
}
- if ( pass ) {
-
+ if (pass) {
tid = H5Tvlen_create(H5T_NATIVE_INT);
- if ( tid <= 0 ) {
-
- pass = FALSE;
- failure_mssg = "ds_ctg_v: H5Tvlen_create() failed.";
- }
+ if (tid <= 0) {
+ pass = FALSE;
+ failure_mssg = "ds_ctg_v: H5Tvlen_create() failed.";
+ }
HDassert(tid > 0);
}
- if ( pass ) {
-
- dsid = H5Dcreate2(fid, dset_name, tid, sid, H5P_DEFAULT,
- H5P_DEFAULT, H5P_DEFAULT);
+ if (pass) {
+ dsid = H5Dcreate2(fid, dset_name, tid, sid, H5P_DEFAULT,
+ H5P_DEFAULT, H5P_DEFAULT);
- if ( dsid <= 0 ) {
-
- pass = FALSE;
- failure_mssg = "ds_ctg_v: H5Dcreate2() failed.";
- }
+ if (dsid <= 0) {
+ pass = FALSE;
+ failure_mssg = "ds_ctg_v: H5Dcreate2() failed.";
+ }
HDassert(dsid > 0);
}
- if ( ( pass ) && ( write_data ) ) {
-
- wdata = (hvl_t *)malloc(sizeof(hvl_t) * DSET_SMALL_DIMS);
+ if ((pass) && (write_data)) {
+ wdata = (hvl_t *) HDmalloc(sizeof(hvl_t) * DSET_SMALL_DIMS);
- if ( ! wdata ) {
-
- pass = FALSE;
- failure_mssg = "ds_ctg_v: malloc of wdata failed.";
- }
+ if (!wdata) {
+ pass = FALSE;
+ failure_mssg = "ds_ctg_v: HDmalloc of wdata failed.";
+ }
HDassert(wdata);
}
- if ( ( pass ) && ( write_data ) ) {
-
- for(u = 0; u < DSET_SMALL_DIMS; u++) {
-
+ if ((pass) && (write_data)) {
+ for (u = 0; u < DSET_SMALL_DIMS; u++) {
int *tdata;
unsigned len;
unsigned v;
len = (u % 10) + 1;
- tdata = (int *)malloc(sizeof(int) * len);
-
- if ( !tdata ) {
+ tdata = (int *) HDmalloc(sizeof(int) * len);
- pass = FALSE;
- failure_mssg = "ds_ctg_v: malloc of tdata failed.";
- break;
- }
+ if (!tdata) {
+ pass = FALSE;
+ failure_mssg = "ds_ctg_v: HDmalloc of tdata failed.";
+ break;
+ }
HDassert(tdata);
- for(v = 0; v < len; v++)
- tdata[v] = (int)(u + v);
+ for (v = 0; v < len; v++)
+ tdata[v] = (int) (u + v);
- wdata[u].len = len;
- wdata[u].p = tdata;
+ wdata[u].len = len;
+ wdata[u].p = tdata;
} /* end for */
}
- if ( ( pass ) && ( write_data ) ) {
-
+ if ((pass) && (write_data)) {
ret = H5Dwrite(dsid, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "ds_ctg_v: H5Dwrite() failed.";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "ds_ctg_v: H5Dwrite() failed.";
+ }
HDassert(ret >= 0);
}
- if ( ( pass ) && ( write_data ) ) {
-
+ if ((pass) && (write_data)) {
ret = H5Dvlen_reclaim(tid, sid, H5P_DEFAULT, wdata);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "ds_ctg_v: H5Dvlen_reclaim() failed.";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "ds_ctg_v: H5Dvlen_reclaim() failed.";
+ }
HDassert(ret >= 0);
- free(wdata);
-
+ HDfree(wdata);
} /* end if */
- if ( pass ) {
-
+ if (pass) {
ret = H5Sclose(sid);
- if ( sid < 0 ) {
-
- pass = FALSE;
- failure_mssg = "ds_ctg_v: H5Sclose() failed.";
- }
+ if (sid < 0) {
+ pass = FALSE;
+ failure_mssg = "ds_ctg_v: H5Sclose() failed.";
+ }
HDassert(ret >= 0);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Tclose(tid);
- if ( tid < 0 ) {
-
- pass = FALSE;
- failure_mssg = "ds_ctg_v: H5Tclose() failed.";
- }
+ if (tid < 0) {
+ pass = FALSE;
+ failure_mssg = "ds_ctg_v: H5Tclose() failed.";
+ }
HDassert(ret >= 0);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Dclose(dsid);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "ds_ctg_v: H5Dclose() failed.";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "ds_ctg_v: H5Dclose() failed.";
+ }
HDassert(ret >= 0);
}
return;
-
} /* ds_ctg_v() */
/*-------------------------------------------------------------------------
* Function: vrfy_ds_ctg_v
*
- * Purpose: Validate a contiguous datasets w/variable-length datatypes.
- * Validate data if indicated via the write_data parameter.
+ * Purpose: Validate a contiguous datasets w/variable-length datatypes.
+ * Validate data if indicated via the write_data parameter.
*
* If pass is false on entry, do nothing.
*
@@ -3264,9 +2798,8 @@ ds_ctg_v(hid_t fid, const char *dset_name, hbool_t write_data)
*
*-------------------------------------------------------------------------
*/
-void
-vrfy_ds_ctg_v(hid_t fid, const char *dset_name, hbool_t write_data)
-{
+void
+vrfy_ds_ctg_v(hid_t fid, const char *dset_name, hbool_t write_data) {
hid_t dsid = -1;
hid_t sid = -1;
hid_t tid = -1;
@@ -3281,283 +2814,240 @@ vrfy_ds_ctg_v(hid_t fid, const char *dset_name, hbool_t write_data)
unsigned u;
herr_t ret;
- if ( pass ) {
-
+ if (pass) {
dsid = H5Dopen2(fid, dset_name, H5P_DEFAULT);
- if ( dsid <= 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_v: H5Dopen2() failed.";
- }
+ if (dsid <= 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_v: H5Dopen2() failed.";
+ }
HDassert(dsid > 0);
}
- if ( pass ) {
-
+ if (pass) {
sid = H5Dget_space(dsid);
- if ( sid <= 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_v: H5Dget_space() failed";
- }
+ if (sid <= 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_v: H5Dget_space() failed";
+ }
HDassert(sid > 0);
}
- if ( pass ) {
-
+ if (pass) {
ndims = H5Sget_simple_extent_ndims(sid);
- if ( 1 != ndims ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_v: 1 != ndims";
- }
+ if (1 != ndims) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_v: 1 != ndims";
+ }
HDassert(1 == ndims);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Sget_simple_extent_dims(sid, dims, max_dims);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_v: H5Sget_simple_extent_dims() failed.";
- }
- else if ( DSET_SMALL_DIMS != dims[0] ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_v: DSET_SMALL_DIMS != dims[0]";
- }
- else if ( DSET_SMALL_DIMS != max_dims[0] ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_v: DSET_SMALL_DIMS != max_dims[0]";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_v: H5Sget_simple_extent_dims() failed.";
+ }
+ else if ( DSET_SMALL_DIMS != dims[0]) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_v: DSET_SMALL_DIMS != dims[0]";
+ }
+ else if ( DSET_SMALL_DIMS != max_dims[0]) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_v: DSET_SMALL_DIMS != max_dims[0]";
+ }
HDassert(ret >= 0);
HDassert(DSET_SMALL_DIMS == dims[0]);
HDassert(DSET_SMALL_DIMS == max_dims[0]);
}
- if ( pass ) {
-
+ if (pass) {
tid = H5Dget_type(dsid);
- if ( tid <= 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_v: H5Dget_type() failed.";
- }
+ if (tid <= 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_v: H5Dget_type() failed.";
+ }
HDassert(tid > 0);
}
- if ( pass ) {
-
+ if (pass) {
tmp_tid = H5Tvlen_create(H5T_NATIVE_INT);
- if ( tmp_tid <= 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_v: H5Tvlen_create() failed.";
- }
+ if (tmp_tid <= 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_v: H5Tvlen_create() failed.";
+ }
HDassert(tmp_tid > 0);
}
- if ( pass ) {
-
+ if (pass) {
type_equal = H5Tequal(tid, tmp_tid);
- if ( 1 != type_equal ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_v: type != vlen H5T_NATIVE_INT";
- }
+ if (1 != type_equal) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_v: type != vlen H5T_NATIVE_INT";
+ }
HDassert(1 == type_equal);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Tclose(tmp_tid);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_v: H5Tclose() failed.";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_v: H5Tclose() failed.";
+ }
HDassert(ret >= 0);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Dget_space_status(dsid, &allocation);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_v: H5Dget_space_status() failed";
- }
- else if ( write_data && (allocation != H5D_SPACE_STATUS_ALLOCATED) ) {
-
- pass = FALSE;
- failure_mssg =
- "vrfy_ds_ctg_v: write_data && allocation != H5D_SPACE_STATUS_ALLOCATED";
- }
- else if ( !write_data &&
- ( allocation != H5D_SPACE_STATUS_NOT_ALLOCATED ) ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_v: !write_data && allocation != H5D_SPACE_STATUS_NOT_ALLOCATED";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_v: H5Dget_space_status() failed";
+ }
+ else if (write_data && (allocation != H5D_SPACE_STATUS_ALLOCATED)) {
+ pass = FALSE;
+ failure_mssg =
+ "vrfy_ds_ctg_v: write_data && allocation != H5D_SPACE_STATUS_ALLOCATED";
+ }
+ else if (!write_data
+ && (allocation != H5D_SPACE_STATUS_NOT_ALLOCATED)) {
+ pass = FALSE;
+ failure_mssg =
+ "vrfy_ds_ctg_v: !write_data && allocation != H5D_SPACE_STATUS_NOT_ALLOCATED";
+ }
HDassert(ret >= 0);
- HDassert((write_data && allocation == H5D_SPACE_STATUS_ALLOCATED) ||
- (!write_data && allocation == H5D_SPACE_STATUS_NOT_ALLOCATED));
+ HDassert((write_data && allocation == H5D_SPACE_STATUS_ALLOCATED)
+ || (!write_data && allocation == H5D_SPACE_STATUS_NOT_ALLOCATED));
}
- if ( pass ) {
-
+ if (pass) {
dcpl = H5Dget_create_plist(dsid);
- if ( dcpl <= 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_v: H5Dget_create_plist() failed.";
- }
+ if (dcpl <= 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_v: H5Dget_create_plist() failed.";
+ }
HDassert(dcpl > 0);
}
- if ( pass ) {
-
+ if (pass) {
layout = H5Pget_layout(dcpl);
- if ( H5D_CONTIGUOUS != layout ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_v: H5D_CONTIGUOUS != layout";
- }
+ if (H5D_CONTIGUOUS != layout) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_v: H5D_CONTIGUOUS != layout";
+ }
HDassert(H5D_CONTIGUOUS == layout);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Pclose(dcpl);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_v: H5Pclose() failed.";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_v: H5Pclose() failed.";
+ }
HDassert(ret >= 0);
}
- if ( ( pass ) && ( write_data ) ) {
+ if ((pass) && (write_data)) {
+ rdata = (hvl_t *) HDmalloc(sizeof(hvl_t) * DSET_SMALL_DIMS);
- rdata = (hvl_t *)malloc(sizeof(hvl_t) * DSET_SMALL_DIMS);
-
- if ( !rdata ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_v: malloc of rdata failed.";
- }
+ if (!rdata) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_v: HDmalloc of rdata failed.";
+ }
HDassert(rdata);
}
- if ( ( pass ) && ( write_data ) ) {
-
+ if ((pass) && (write_data)) {
ret = H5Dread(dsid, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, rdata);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_v: H5Dread() failed.";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_v: H5Dread() failed.";
+ }
HDassert(ret >= 0);
}
- if ( ( pass ) && ( write_data ) ) {
-
- for(u = 0; u < DSET_SMALL_DIMS; u++) {
+ if ((pass) && (write_data)) {
+ for (u = 0; u < DSET_SMALL_DIMS; u++) {
unsigned len;
unsigned v;
- len = (unsigned)rdata[u].len;
- for(v = 0; v < len; v++) {
- int *tdata = (int *)rdata[u].p;
-
- if ( !tdata ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_v: !tdata";
- break;
- }
- else if ( (int)(u + v) != tdata[v] ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_v: (int)(u + v) != tdata[v]";
- break;
- }
+ len = (unsigned) rdata[u].len;
+ for (v = 0; v < len; v++) {
+ int *tdata = (int *) rdata[u].p;
+
+ if (!tdata) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_v: !tdata";
+ break;
+ }
+ else if ((int) (u + v) != tdata[v]) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_v: (int)(u + v) != tdata[v]";
+ break;
+ }
HDassert(tdata);
- HDassert((int)(u + v) == tdata[v]);
+ HDassert((int )(u + v) == tdata[v]);
} /* end for */
} /* end for */
}
- if ( ( pass ) && ( write_data ) ) {
-
+ if ((pass) && (write_data)) {
ret = H5Dvlen_reclaim(tid, sid, H5P_DEFAULT, rdata);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_v: H5Dvlen_reclaim() failed.";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_v: H5Dvlen_reclaim() failed.";
+ }
HDassert(ret >= 0);
- free(rdata);
+ HDfree(rdata);
} /* end if */
- if ( pass ) {
-
+ if (pass) {
ret = H5Sclose(sid);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_v: H5Sclose() failed.";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_v: H5Sclose() failed.";
+ }
HDassert(ret >= 0);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Tclose(tid);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_v: H5Tclose() failed.";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_v: H5Tclose() failed.";
+ }
HDassert(ret >= 0);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Dclose(dsid);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_v: H5Dclose() failed.";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_v: H5Dclose() failed.";
+ }
HDassert(ret >= 0);
}
return;
-
} /* vrfy_ds_ctg_v() */
-
+
/*-------------------------------------------------------------------------
* Function: create_zoo
*
@@ -3596,203 +3086,202 @@ create_zoo(hid_t fid, const char *base_path, int proc_num)
/* Add & verify an empty "new style" group */
if ( pass ) {
- sprintf(full_path, "%s/A", base_path);
- HDassert(strlen(full_path) < 1024);
+ HDsprintf(full_path, "%s/A", base_path);
+ HDassert(HDstrlen(full_path) < 1024);
ns_grp_0(fid, full_path);
}
if ( pass ) {
- sprintf(full_path, "%s/A", base_path);
- HDassert(strlen(full_path) < 1024);
+ HDsprintf(full_path, "%s/A", base_path);
+ HDassert(HDstrlen(full_path) < 1024);
vrfy_ns_grp_0(fid, full_path);
}
/* Add & verify a compact "new style" group (3 link messages) */
if ( pass ) {
- sprintf(full_path, "%s/B", base_path);
- HDassert(strlen(full_path) < 1024);
+ HDsprintf(full_path, "%s/B", base_path);
+ HDassert(HDstrlen(full_path) < 1024);
ns_grp_c(fid, full_path, 3);
}
if ( pass ) {
- sprintf(full_path, "%s/B", base_path);
- HDassert(strlen(full_path) < 1024);
+ HDsprintf(full_path, "%s/B", base_path);
+ HDassert(HDstrlen(full_path) < 1024);
vrfy_ns_grp_c(fid, full_path, 3);
}
- /* Add & verify a dense "new style" group (w/300 links, in v2 B-tree &
+ /* Add & verify a dense "new style" group (w/300 links, in v2 B-tree &
* fractal heap)
*/
if ( pass ) {
- sprintf(full_path, "%s/C", base_path);
- HDassert(strlen(full_path) < 1024);
+ HDsprintf(full_path, "%s/C", base_path);
+ HDassert(HDstrlen(full_path) < 1024);
ns_grp_d(fid, full_path, 300);
}
if ( pass ) {
- sprintf(full_path, "%s/C", base_path);
- HDassert(strlen(full_path) < 1024);
+ HDsprintf(full_path, "%s/C", base_path);
+ HDassert(HDstrlen(full_path) < 1024);
vrfy_ns_grp_d(fid, full_path, 300);
}
/* Add & verify an empty "old style" group to file */
if ( pass ) {
- sprintf(full_path, "%s/D", base_path);
- HDassert(strlen(full_path) < 1024);
+ HDsprintf(full_path, "%s/D", base_path);
+ HDassert(HDstrlen(full_path) < 1024);
os_grp_0(fid, full_path);
}
if ( pass ) {
- sprintf(full_path, "%s/D", base_path);
- HDassert(strlen(full_path) < 1024);
+ HDsprintf(full_path, "%s/D", base_path);
+ HDassert(HDstrlen(full_path) < 1024);
vrfy_os_grp_0(fid, full_path);
}
- /* Add & verify an "old style" group (w/300 links, in v1 B-tree &
- * local heap) to file
+ /* Add & verify an "old style" group (w/300 links, in v1 B-tree &
+ * local heap) to file
*/
if ( pass ) {
- sprintf(full_path, "%s/E", base_path);
- HDassert(strlen(full_path) < 1024);
+ HDsprintf(full_path, "%s/E", base_path);
+ HDassert(HDstrlen(full_path) < 1024);
os_grp_n(fid, full_path, proc_num, 300);
}
if ( pass ) {
- sprintf(full_path, "%s/E", base_path);
- HDassert(strlen(full_path) < 1024);
+ HDsprintf(full_path, "%s/E", base_path);
+ HDassert(HDstrlen(full_path) < 1024);
vrfy_os_grp_n(fid, full_path, proc_num, 300);
}
- /* Add & verify a contiguous dataset w/integer datatype (but no data)
- * to file
+ /* Add & verify a contiguous dataset w/integer datatype (but no data)
+ * to file
*/
if ( pass ) {
- sprintf(full_path, "%s/F", base_path);
- HDassert(strlen(full_path) < 1024);
+ HDsprintf(full_path, "%s/F", base_path);
+ HDassert(HDstrlen(full_path) < 1024);
ds_ctg_i(fid, full_path, FALSE);
}
if ( pass ) {
- sprintf(full_path, "%s/F", base_path);
- HDassert(strlen(full_path) < 1024);
+ HDsprintf(full_path, "%s/F", base_path);
+ HDassert(HDstrlen(full_path) < 1024);
vrfy_ds_ctg_i(fid, full_path, FALSE);
}
- /* Add & verify a contiguous dataset w/integer datatype (with data)
- * to file
+ /* Add & verify a contiguous dataset w/integer datatype (with data)
+ * to file
*/
if ( pass ) {
- sprintf(full_path, "%s/G", base_path);
- HDassert(strlen(full_path) < 1024);
+ HDsprintf(full_path, "%s/G", base_path);
+ HDassert(HDstrlen(full_path) < 1024);
ds_ctg_i(fid, full_path, TRUE);
}
if ( pass ) {
- sprintf(full_path, "%s/G", base_path);
- HDassert(strlen(full_path) < 1024);
+ HDsprintf(full_path, "%s/G", base_path);
+ HDassert(HDstrlen(full_path) < 1024);
vrfy_ds_ctg_i(fid, full_path, TRUE);
}
- /* Add & verify a chunked dataset w/integer datatype (but no data)
- * to file
+ /* Add & verify a chunked dataset w/integer datatype (but no data)
+ * to file
*/
if ( pass ) {
- sprintf(full_path, "%s/H", base_path);
- HDassert(strlen(full_path) < 1024);
+ HDsprintf(full_path, "%s/H", base_path);
+ HDassert(HDstrlen(full_path) < 1024);
ds_chk_i(fid, full_path, FALSE);
}
if ( pass ) {
- sprintf(full_path, "%s/H", base_path);
- HDassert(strlen(full_path) < 1024);
+ HDsprintf(full_path, "%s/H", base_path);
+ HDassert(HDstrlen(full_path) < 1024);
vrfy_ds_chk_i(fid, full_path, FALSE);
}
- /* Add & verify a chunked dataset w/integer datatype (and data)
- * to file
+ /* Add & verify a chunked dataset w/integer datatype (and data)
+ * to file
*/
if ( pass ) {
- sprintf(full_path, "%s/I", base_path);
- HDassert(strlen(full_path) < 1024);
+ HDsprintf(full_path, "%s/I", base_path);
+ HDassert(HDstrlen(full_path) < 1024);
ds_chk_i(fid, full_path, TRUE);
}
if ( pass ) {
- sprintf(full_path, "%s/I", base_path);
- HDassert(strlen(full_path) < 1024);
+ HDsprintf(full_path, "%s/I", base_path);
+ HDassert(HDstrlen(full_path) < 1024);
vrfy_ds_chk_i(fid, full_path, TRUE);
}
- /* Add & verify a compact dataset w/integer datatype (but no data)
- * to file
+ /* Add & verify a compact dataset w/integer datatype (but no data)
+ * to file
*/
if ( pass ) {
- sprintf(full_path, "%s/J", base_path);
- HDassert(strlen(full_path) < 1024);
+ HDsprintf(full_path, "%s/J", base_path);
+ HDassert(HDstrlen(full_path) < 1024);
ds_cpt_i(fid, full_path, FALSE);
}
if ( pass ) {
- sprintf(full_path, "%s/J", base_path);
- HDassert(strlen(full_path) < 1024);
+ HDsprintf(full_path, "%s/J", base_path);
+ HDassert(HDstrlen(full_path) < 1024);
vrfy_ds_cpt_i(fid, full_path, FALSE);
}
- /* Add & verify a compact dataset w/integer datatype (and data)
- * to file
+ /* Add & verify a compact dataset w/integer datatype (and data)
+ * to file
*/
if ( pass ) {
- sprintf(full_path, "%s/K", base_path);
- HDassert(strlen(full_path) < 1024);
+ HDsprintf(full_path, "%s/K", base_path);
+ HDassert(HDstrlen(full_path) < 1024);
ds_cpt_i(fid, full_path, TRUE);
}
if ( pass ) {
- sprintf(full_path, "%s/K", base_path);
- HDassert(strlen(full_path) < 1024);
+ HDsprintf(full_path, "%s/K", base_path);
+ HDassert(HDstrlen(full_path) < 1024);
vrfy_ds_cpt_i(fid, full_path, TRUE);
}
- /* Add & verify a contiguous dataset w/variable-length datatype
- * (but no data) to file
+ /* Add & verify a contiguous dataset w/variable-length datatype
+ * (but no data) to file
*/
if ( pass ) {
- sprintf(full_path, "%s/L", base_path);
- HDassert(strlen(full_path) < 1024);
+ HDsprintf(full_path, "%s/L", base_path);
+ HDassert(HDstrlen(full_path) < 1024);
ds_ctg_v(fid, full_path, FALSE);
}
if ( pass ) {
- sprintf(full_path, "%s/L", base_path);
- HDassert(strlen(full_path) < 1024);
+ HDsprintf(full_path, "%s/L", base_path);
+ HDassert(HDstrlen(full_path) < 1024);
vrfy_ds_ctg_v(fid, full_path, FALSE);
}
- /* Add & verify a contiguous dataset w/variable-length datatype
- * (and data) to file
+ /* Add & verify a contiguous dataset w/variable-length datatype
+ * (and data) to file
*/
if ( pass ) {
- sprintf(full_path, "%s/M", base_path);
- HDassert(strlen(full_path) < 1024);
+ HDsprintf(full_path, "%s/M", base_path);
+ HDassert(HDstrlen(full_path) < 1024);
ds_ctg_v(fid, full_path, TRUE);
}
if ( pass ) {
- sprintf(full_path, "%s/M", base_path);
- HDassert(strlen(full_path) < 1024);
+ HDsprintf(full_path, "%s/M", base_path);
+ HDassert(HDstrlen(full_path) < 1024);
vrfy_ds_ctg_v(fid, full_path, TRUE);
}
return;
-
} /* create_zoo() */
-
+
/*-------------------------------------------------------------------------
* Function: validate_zoo
*
- * Purpose: Given the path to a group in which a "zoo" has been
- * constructed, validate the objects in the "zoo".
+ * Purpose: Given the path to a group in which a "zoo" has been
+ * constructed, validate the objects in the "zoo".
*
* If pass is false on entry, do nothing.
*
@@ -3824,116 +3313,115 @@ validate_zoo(hid_t fid, const char *base_path, int proc_num)
/* validate an empty "new style" group */
if ( pass ) {
- sprintf(full_path, "%s/A", base_path);
- HDassert(strlen(full_path) < 1024);
+ HDsprintf(full_path, "%s/A", base_path);
+ HDassert(HDstrlen(full_path) < 1024);
vrfy_ns_grp_0(fid, full_path);
}
/* validate a compact "new style" group (3 link messages) */
if ( pass ) {
- sprintf(full_path, "%s/B", base_path);
- HDassert(strlen(full_path) < 1024);
+ HDsprintf(full_path, "%s/B", base_path);
+ HDassert(HDstrlen(full_path) < 1024);
vrfy_ns_grp_c(fid, full_path, 3);
}
- /* validate a dense "new style" group (w/300 links, in v2 B-tree &
+ /* validate a dense "new style" group (w/300 links, in v2 B-tree &
* fractal heap)
*/
if ( pass ) {
- sprintf(full_path, "%s/C", base_path);
- HDassert(strlen(full_path) < 1024);
+ HDsprintf(full_path, "%s/C", base_path);
+ HDassert(HDstrlen(full_path) < 1024);
vrfy_ns_grp_d(fid, full_path, 300);
}
/* validate an empty "old style" group in file */
if ( pass ) {
- sprintf(full_path, "%s/D", base_path);
- HDassert(strlen(full_path) < 1024);
+ HDsprintf(full_path, "%s/D", base_path);
+ HDassert(HDstrlen(full_path) < 1024);
vrfy_os_grp_0(fid, full_path);
}
- /* validate an "old style" group (w/300 links, in v1 B-tree &
+ /* validate an "old style" group (w/300 links, in v1 B-tree &
* local heap)
*/
if ( pass ) {
- sprintf(full_path, "%s/E", base_path);
- HDassert(strlen(full_path) < 1024);
+ HDsprintf(full_path, "%s/E", base_path);
+ HDassert(HDstrlen(full_path) < 1024);
vrfy_os_grp_n(fid, full_path, proc_num, 300);
}
- /* validate a contiguous dataset w/integer datatype (but no data)
- * in file.
+ /* validate a contiguous dataset w/integer datatype (but no data)
+ * in file.
*/
if ( pass ) {
- sprintf(full_path, "%s/F", base_path);
- HDassert(strlen(full_path) < 1024);
+ HDsprintf(full_path, "%s/F", base_path);
+ HDassert(HDstrlen(full_path) < 1024);
vrfy_ds_ctg_i(fid, full_path, FALSE);
}
- /* validate a contiguous dataset w/integer datatype (with data)
- * in file.
+ /* validate a contiguous dataset w/integer datatype (with data)
+ * in file.
*/
if ( pass ) {
- sprintf(full_path, "%s/G", base_path);
- HDassert(strlen(full_path) < 1024);
+ HDsprintf(full_path, "%s/G", base_path);
+ HDassert(HDstrlen(full_path) < 1024);
vrfy_ds_ctg_i(fid, full_path, TRUE);
}
- /* validate a chunked dataset w/integer datatype (but no data)
- * in file
+ /* validate a chunked dataset w/integer datatype (but no data)
+ * in file
*/
if ( pass ) {
- sprintf(full_path, "%s/H", base_path);
- HDassert(strlen(full_path) < 1024);
+ HDsprintf(full_path, "%s/H", base_path);
+ HDassert(HDstrlen(full_path) < 1024);
vrfy_ds_chk_i(fid, full_path, FALSE);
}
- /* validate a chunked dataset w/integer datatype (and data)
- * in file
+ /* validate a chunked dataset w/integer datatype (and data)
+ * in file
*/
if ( pass ) {
- sprintf(full_path, "%s/I", base_path);
- HDassert(strlen(full_path) < 1024);
+ HDsprintf(full_path, "%s/I", base_path);
+ HDassert(HDstrlen(full_path) < 1024);
vrfy_ds_chk_i(fid, full_path, TRUE);
}
- /* Validate a compact dataset w/integer datatype (but no data)
- * in file
+ /* Validate a compact dataset w/integer datatype (but no data)
+ * in file
*/
if ( pass ) {
- sprintf(full_path, "%s/J", base_path);
- HDassert(strlen(full_path) < 1024);
+ HDsprintf(full_path, "%s/J", base_path);
+ HDassert(HDstrlen(full_path) < 1024);
vrfy_ds_cpt_i(fid, full_path, FALSE);
}
- /* validate a compact dataset w/integer datatype (and data)
- * in file
+ /* validate a compact dataset w/integer datatype (and data)
+ * in file
*/
if ( pass ) {
- sprintf(full_path, "%s/K", base_path);
- HDassert(strlen(full_path) < 1024);
+ HDsprintf(full_path, "%s/K", base_path);
+ HDassert(HDstrlen(full_path) < 1024);
vrfy_ds_cpt_i(fid, full_path, TRUE);
}
- /* validate a contiguous dataset w/variable-length datatype
- * (but no data) to file
+ /* validate a contiguous dataset w/variable-length datatype
+ * (but no data) to file
*/
if ( pass ) {
- sprintf(full_path, "%s/L", base_path);
- HDassert(strlen(full_path) < 1024);
+ HDsprintf(full_path, "%s/L", base_path);
+ HDassert(HDstrlen(full_path) < 1024);
vrfy_ds_ctg_v(fid, full_path, FALSE);
}
- /* validate a contiguous dataset w/variable-length datatype
- * (and data) to file
+ /* validate a contiguous dataset w/variable-length datatype
+ * (and data) to file
*/
if ( pass ) {
- sprintf(full_path, "%s/M", base_path);
- HDassert(strlen(full_path) < 1024);
+ HDsprintf(full_path, "%s/M", base_path);
+ HDassert(HDstrlen(full_path) < 1024);
vrfy_ds_ctg_v(fid, full_path, TRUE);
}
return;
-
} /* validate_zoo() */
diff --git a/test/ohdr.c b/test/ohdr.c
index 146245f..669b1e0 100644
--- a/test/ohdr.c
+++ b/test/ohdr.c
@@ -470,8 +470,8 @@ test_unknown(unsigned bogus_id, char *filename, hid_t fapl)
/* create a different name for a local copy of the data file to be
opened with rd/wr file permissions in case build and test are
done in the source directory. */
- HDstrncpy(testfile, FILE_BOGUS, strlen(FILE_BOGUS));
- testfile[strlen(FILE_BOGUS)]='\0';
+ HDstrncpy(testfile, FILE_BOGUS, HDstrlen(FILE_BOGUS));
+ testfile[HDstrlen(FILE_BOGUS)]='\0';
HDstrncat(testfile, ".copy", 5);
/* Make a copy of the data file from svn. */
diff --git a/test/tmisc.c b/test/tmisc.c
index 1e62302..22e1aad 100644
--- a/test/tmisc.c
+++ b/test/tmisc.c
@@ -2272,7 +2272,7 @@ misc13_insert_user_block(const char *old_name, const char *new_name, const char
CHECK_PTR(user_block, "HDcalloc");
/* Copy in the user block data */
- HDmemcpy(user_block, str, strlen(str));
+ HDmemcpy(user_block, str, HDstrlen(str));
/* Open the new file */
new_fp = HDfopen(new_name,"wb");
diff --git a/test/tunicode.c b/test/tunicode.c
index 85f5af0..e0e1f24 100644
--- a/test/tunicode.c
+++ b/test/tunicode.c
@@ -164,7 +164,7 @@ void test_strpad(hid_t H5_ATTR_UNUSED fid, const char *string)
/* Fill the buffer with two copies of the UTF-8 string, each with a
* terminating NULL. It will look like "abcdefg\0abcdefg\0". */
strncpy(buf, new_string, big_len);
- strncpy(&buf[big_len], new_string, big_len);
+ HDstrncpy(&buf[big_len], new_string, big_len);
ret = H5Tconvert(src_type, dst_type, (size_t)2, buf, NULL, H5P_DEFAULT);
CHECK(ret, FAIL, "H5Tconvert");
@@ -226,8 +226,8 @@ void test_strpad(hid_t H5_ATTR_UNUSED fid, const char *string)
/* Fill the buffer with two copies of the UTF-8 string.
* It will look like "abcdefghabcdefgh". */
- strncpy(buf, new_string, big_len);
- strncpy(&buf[big_len], new_string, big_len);
+ HDstrncpy(buf, new_string, big_len);
+ HDstrncpy(&buf[big_len], new_string, big_len);
ret = H5Tconvert(src_type, dst_type, (size_t)2, buf, NULL, H5P_DEFAULT);
CHECK(ret, FAIL, "H5Tconvert");
diff --git a/test/tvltypes.c b/test/tvltypes.c
index e5a3d34..91ef0c2 100644
--- a/test/tvltypes.c
+++ b/test/tvltypes.c
@@ -467,7 +467,7 @@ test_vltypes_vlen_atomic(void)
/* Try to call H5Dvlen_get_buf with bad dataspace */
H5E_BEGIN_TRY {
- ret = H5Dvlen_get_buf_size(dataset, tid1, sid2, &size);
+ ret = H5Dvlen_get_buf_size(dataset, tid1, sid2, &size);
} H5E_END_TRY
VERIFY(ret, FAIL, "H5Dvlen_get_buf_size");
@@ -499,7 +499,7 @@ test_vltypes_vlen_atomic(void)
/* Try to reclaim read data using "bad" dataspace with no extent
* Should fail */
H5E_BEGIN_TRY {
- ret=H5Dvlen_reclaim(tid1,sid2,xfer_pid,rdata);
+ ret=H5Dvlen_reclaim(tid1,sid2,xfer_pid,rdata);
} H5E_END_TRY
VERIFY(ret, FAIL, "H5Dvlen_reclaim");
@@ -1205,9 +1205,9 @@ test_vltypes_compound_vlstr(void)
wdata[i].v.p=(s2*)HDmalloc((i+L3_INCM)*sizeof(s2));
wdata[i].v.len=i+L3_INCM;
for(t1=(s2 *)((wdata[i].v).p), j=0; j<(i+L3_INCM); j++, t1++) {
- strcat(str, "m");
- t1->string = (char*)HDmalloc(strlen(str)*sizeof(char)+1);
- strcpy(t1->string, str);
+ HDstrcat(str, "m");
+ t1->string = (char*)HDmalloc(HDstrlen(str)*sizeof(char)+1);
+ HDstrcpy(t1->string, str);
/*t1->color = red;*/
t1->color = blue;
}
@@ -1348,7 +1348,7 @@ test_vltypes_compound_vlstr(void)
} /* end if */
for(t1=(s2 *)(wdata[i].v.p), t2=(s2 *)(rdata[i].v.p), j=0; j<rdata[i].v.len; j++, t1++, t2++) {
- if( strcmp(t1->string, t2->string) ) {
+ if( HDstrcmp(t1->string, t2->string) ) {
TestErrPrintf("VL data values don't match!, t1->string=%s, t2->string=%s\n",t1->string, t2->string);
continue;
} /* end if */
@@ -1368,14 +1368,14 @@ test_vltypes_compound_vlstr(void)
CHECK(ret, FAIL, "H5Dvlen_reclaim");
/* Use this part for new data */
- strcpy(str, "bbbbbbbb\0");
+ HDstrcpy(str, "bbbbbbbb\0");
for(i=0; i<SPACE1_DIM1; i++) {
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);
- strcpy(t1->string, str);
+ HDstrcat(str, "pp");
+ t1->string = (char*)HDmalloc(HDstrlen(str)*sizeof(char)+1);
+ HDstrcpy(t1->string, str);
t1->color = green;
}
} /* end for */
@@ -1406,7 +1406,7 @@ test_vltypes_compound_vlstr(void)
} /* end if */
for(t1=(s2 *)(wdata2[i].v.p), t2=(s2 *)(rdata2[i].v.p), j=0; j<rdata2[i].v.len; j++, t1++, t2++) {
- if( strcmp(t1->string, t2->string) ) {
+ if( HDstrcmp(t1->string, t2->string) ) {
TestErrPrintf("VL data values don't match!, t1->string=%s, t2->string=%s\n",t1->string, t2->string);
continue;
} /* end if */
diff --git a/test/vfd.c b/test/vfd.c
index 5d5ebfc..dfc5047 100644
--- a/test/vfd.c
+++ b/test/vfd.c
@@ -149,7 +149,7 @@ test_sec2(void)
/* There is no garantee the size of metadata in file is constant.
* Just try to check if it's reasonable.
- *
+ *
* Currently it should be around 2 KB.
*/
if(H5Fget_filesize(fid, &file_size) < 0)
@@ -258,7 +258,7 @@ test_core(void)
| H5FD_FEAT_ACCUMULATE_METADATA
| H5FD_FEAT_DATA_SIEVE
| H5FD_FEAT_AGGREGATE_SMALLDATA
- | H5FD_FEAT_ALLOW_FILE_IMAGE
+ | H5FD_FEAT_ALLOW_FILE_IMAGE
| H5FD_FEAT_CAN_USE_FILE_IMAGE_CALLBACKS))
TEST_ERROR
@@ -341,7 +341,7 @@ test_core(void)
/* There is no garantee the size of metadata in file is constant.
* Just try to check if it's reasonable.
- *
+ *
* TODO: Needs justification of why is this is a reasonable size.
*/
if(H5Fget_filesize(fid, &file_size) < 0)
@@ -379,7 +379,7 @@ test_core(void)
for(i = 0; i < CORE_DSET_DIM1; i++)
for(j = 0; j < CORE_DSET_DIM2; j++)
*pw++ = val++;
- HDmemset(data_r, 0, DSET1_DIM1 * DSET1_DIM2 * sizeof(int));
+ HDmemset(data_r, 0, DSET1_DIM1 * DSET1_DIM2 * sizeof(int));
/* Create the dataspace */
dims[0] = CORE_DSET_DIM1;
@@ -469,7 +469,7 @@ test_core(void)
TEST_ERROR;
/* Read the data back from the dataset */
- HDmemset(data_r, 0, DSET1_DIM1 * DSET1_DIM2 * sizeof(int));
+ HDmemset(data_r, 0, DSET1_DIM1 * DSET1_DIM2 * sizeof(int));
if(H5Dread(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, data_r) < 0)
TEST_ERROR;
@@ -488,7 +488,7 @@ test_core(void)
/* Check file size API.
* There is no garantee the size of metadata in file is constant.
* Just try to check if it's reasonable.
- *
+ *
* TODO: Needs justification of why is this is a reasonable size.
*/
if(H5Fget_filesize(fid, &file_size) < 0)
@@ -1330,7 +1330,7 @@ test_multi(void)
if((atype = H5Tcopy(H5T_C_S1)) < 0)
TEST_ERROR;
- if(H5Tset_size(atype, strlen(meta) + 1) < 0)
+ if(H5Tset_size(atype, HDstrlen(meta) + 1) < 0)
TEST_ERROR;
if(H5Tset_strpad(atype, H5T_STR_NULLTERM) < 0)
@@ -1385,7 +1385,7 @@ error:
* Purpose: Tests the backward compatibility for MULTI driver.
* See if we can open files created with v1.6 library.
* The source file was created by the test/file_handle.c
- * of the v1.6 library. This test verifies the fix for
+ * of the v1.6 library. This test verifies the fix for
* Issue 2598. In v1.6 library, there was EOA for the whole
* MULTI file saved in the super block. We took it out in
* v1.8 library because it's meaningless for the MULTI file.
@@ -1446,7 +1446,7 @@ test_multi_compat(void)
h5_fixname(FILENAME[9], fapl, newname, sizeof newname);
- /* Make copy for the data file in the build directory, to protect the
+ /* Make copy for the data file in the build directory, to protect the
* original file in the source directory */
sprintf(filename_s, "%s-%c.h5", MULTI_COMPAT_BASENAME, 's');
sprintf(newname_s, "%s-%c.h5", FILENAME[9], 's');
@@ -1483,7 +1483,7 @@ test_multi_compat(void)
if(H5Fclose(file) < 0)
TEST_ERROR;
- /* Reopen the file for adding another dataset. The new EOA for metadata file
+ /* Reopen the file for adding another dataset. The new EOA for metadata file
* should be written to the file */
if((file=H5Fopen(newname, H5F_ACC_RDWR, fapl)) < 0)
TEST_ERROR;
@@ -1510,7 +1510,7 @@ test_multi_compat(void)
if(H5Fclose(file) < 0)
TEST_ERROR;
- /* Reopen the file for read only again. Verify the library can handle
+ /* Reopen the file for read only again. Verify the library can handle
* the EOA correctly */
if((file=H5Fopen(newname, H5F_ACC_RDONLY, fapl)) < 0)
TEST_ERROR;
diff --git a/testpar/CMakeLists.txt b/testpar/CMakeLists.txt
index c08a69e..0b3cbe3 100644
--- a/testpar/CMakeLists.txt
+++ b/testpar/CMakeLists.txt
@@ -17,6 +17,7 @@ set (testphdf5_SOURCES
${HDF5_TEST_PAR_SOURCE_DIR}/t_chunk_alloc.c
${HDF5_TEST_PAR_SOURCE_DIR}/t_filter_read.c
${HDF5_TEST_PAR_SOURCE_DIR}/t_prop.c
+ ${HDF5_TEST_PAR_SOURCE_DIR}/t_coll_md_read.c
)
#-- Adding test for testhdf5
diff --git a/testpar/Makefile.am b/testpar/Makefile.am
index 5c7cb26..7262ca6 100644
--- a/testpar/Makefile.am
+++ b/testpar/Makefile.am
@@ -29,7 +29,7 @@ check_PROGRAMS = $(TEST_PROG_PARA)
testphdf5_SOURCES=testphdf5.c t_dset.c t_file.c t_file_image.c t_mdset.c \
t_ph5basic.c t_coll_chunk.c t_span_tree.c t_chunk_alloc.c t_filter_read.c \
- t_prop.c
+ t_prop.c t_coll_md_read.c
# The tests all depend on the hdf5 library and the test library
LDADD = $(LIBH5TEST) $(LIBHDF5)
diff --git a/testpar/Makefile.in b/testpar/Makefile.in
index 04ad045..5688cd7 100644
--- a/testpar/Makefile.in
+++ b/testpar/Makefile.in
@@ -193,7 +193,8 @@ am_testphdf5_OBJECTS = testphdf5.$(OBJEXT) t_dset.$(OBJEXT) \
t_file.$(OBJEXT) t_file_image.$(OBJEXT) t_mdset.$(OBJEXT) \
t_ph5basic.$(OBJEXT) t_coll_chunk.$(OBJEXT) \
t_span_tree.$(OBJEXT) t_chunk_alloc.$(OBJEXT) \
- t_filter_read.$(OBJEXT) t_prop.$(OBJEXT)
+ t_filter_read.$(OBJEXT) t_prop.$(OBJEXT) \
+ t_coll_md_read.$(OBJEXT)
testphdf5_OBJECTS = $(am_testphdf5_OBJECTS)
testphdf5_LDADD = $(LDADD)
testphdf5_DEPENDENCIES = $(LIBH5TEST) $(LIBHDF5)
@@ -802,7 +803,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2 MPItest.h5 \
TEST_PROG_PARA = t_mpi t_bigio testphdf5 t_cache t_cache_image t_pflush1 t_pflush2 t_pread t_pshutdown t_prestart t_init_term t_shapesame t_filters_parallel
testphdf5_SOURCES = testphdf5.c t_dset.c t_file.c t_file_image.c t_mdset.c \
t_ph5basic.c t_coll_chunk.c t_span_tree.c t_chunk_alloc.c t_filter_read.c \
- t_prop.c
+ t_prop.c t_coll_md_read.c
# The tests all depend on the hdf5 library and the test library
@@ -935,6 +936,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t_cache_image.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t_chunk_alloc.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t_coll_chunk.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t_coll_md_read.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t_dset.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t_file.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t_file_image.Po@am__quote@
diff --git a/testpar/t_cache.c b/testpar/t_cache.c
index caa578e..c27fc23 100644
--- a/testpar/t_cache.c
+++ b/testpar/t_cache.c
@@ -7134,7 +7134,7 @@ trace_file_check(int metadata_write_strategy)
if ( HDfgets(buffer, 255, trace_file_ptr) != NULL ) {
- actual_line_len = strlen(buffer);
+ actual_line_len = HDstrlen(buffer);
} else {
diff --git a/testpar/t_coll_md_read.c b/testpar/t_coll_md_read.c
new file mode 100644
index 0000000..f945d2b
--- /dev/null
+++ b/testpar/t_coll_md_read.c
@@ -0,0 +1,199 @@
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * 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. *
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
+/*
+ * A test suite to test HDF5's collective metadata read capabilities, as enabled
+ * by making a call to H5Pset_all_coll_metadata_ops().
+ */
+
+#include "testphdf5.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+/*
+ * Define the non-participating process as the "last"
+ * rank to avoid any weirdness potentially caused by
+ * an if (mpi_rank == 0) check.
+ */
+#define PARTIAL_NO_SELECTION_NO_SEL_PROCESS (mpi_rank == mpi_size - 1)
+#define PARTIAL_NO_SELECTION_DATASET_NAME "partial_no_selection_dset"
+#define PARTIAL_NO_SELECTION_DATASET_NDIMS 2
+#define PARTIAL_NO_SELECTION_Y_DIM_SCALE 5
+#define PARTIAL_NO_SELECTION_X_DIM_SCALE 5
+
+/*
+ * A test for issue HDFFV-10501. A parallel hang was reported which occurred
+ * in linked-chunk I/O when collective metadata reads are enabled and some ranks
+ * do not have any selection in a dataset's dataspace, while others do. The ranks
+ * which have no selection during the read/write operation called H5D__chunk_addrmap()
+ * to retrieve the lowest chunk address, since we require that the read/write be done
+ * in strictly non-decreasing order of chunk address. For version 1 and 2 B-trees,
+ * this caused the non-participating ranks to issue a collective MPI_Bcast() call
+ * which the other ranks did not issue, thus causing a hang.
+ *
+ * However, since these ranks are not actually reading/writing anything, this call
+ * can simply be removed and the address used for the read/write can be set to an
+ * arbitrary number (0 was chosen).
+ */
+void test_partial_no_selection_coll_md_read(void)
+{
+ const char *filename;
+ hsize_t *dataset_dims = NULL;
+ hsize_t max_dataset_dims[PARTIAL_NO_SELECTION_DATASET_NDIMS];
+ hsize_t sel_dims[1];
+ hsize_t chunk_dims[PARTIAL_NO_SELECTION_DATASET_NDIMS] = { PARTIAL_NO_SELECTION_Y_DIM_SCALE, PARTIAL_NO_SELECTION_X_DIM_SCALE };
+ hsize_t start[PARTIAL_NO_SELECTION_DATASET_NDIMS];
+ hsize_t stride[PARTIAL_NO_SELECTION_DATASET_NDIMS];
+ hsize_t count[PARTIAL_NO_SELECTION_DATASET_NDIMS];
+ hsize_t block[PARTIAL_NO_SELECTION_DATASET_NDIMS];
+ hid_t file_id = -1;
+ hid_t fapl_id = -1;
+ hid_t dset_id = -1;
+ hid_t dcpl_id = -1;
+ hid_t dxpl_id = -1;
+ hid_t fspace_id = -1;
+ hid_t mspace_id = -1;
+ int mpi_rank, mpi_size;
+ void *data = NULL;
+ void *read_buf = NULL;
+
+ MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank);
+ MPI_Comm_size(MPI_COMM_WORLD, &mpi_size);
+
+ filename = GetTestParameters();
+
+ fapl_id = create_faccess_plist(MPI_COMM_WORLD, MPI_INFO_NULL, facc_type);
+ VRFY((fapl_id >= 0), "create_faccess_plist succeeded");
+
+ /*
+ * Even though the testphdf5 framework currently sets collective metadata reads
+ * on the FAPL, we call it here just to be sure this is futureproof, since
+ * demonstrating this issue relies upon it.
+ */
+ VRFY((H5Pset_all_coll_metadata_ops(fapl_id, true) >= 0), "Set collective metadata reads succeeded");
+
+ file_id = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id);
+ VRFY((file_id >= 0), "H5Fcreate succeeded");
+
+ dataset_dims = malloc(PARTIAL_NO_SELECTION_DATASET_NDIMS * sizeof(*dataset_dims));
+ VRFY((dataset_dims != NULL), "malloc succeeded");
+
+ dataset_dims[0] = PARTIAL_NO_SELECTION_Y_DIM_SCALE * mpi_size;
+ dataset_dims[1] = PARTIAL_NO_SELECTION_X_DIM_SCALE * mpi_size;
+ max_dataset_dims[0] = H5S_UNLIMITED;
+ max_dataset_dims[1] = H5S_UNLIMITED;
+
+ fspace_id = H5Screate_simple(PARTIAL_NO_SELECTION_DATASET_NDIMS, dataset_dims, max_dataset_dims);
+ VRFY((fspace_id >= 0), "H5Screate_simple succeeded");
+
+ /*
+ * Set up chunking on the dataset in order to reproduce the problem.
+ */
+ dcpl_id = H5Pcreate(H5P_DATASET_CREATE);
+ VRFY((dcpl_id >= 0), "H5Pcreate succeeded");
+
+ VRFY((H5Pset_chunk(dcpl_id, PARTIAL_NO_SELECTION_DATASET_NDIMS, chunk_dims) >= 0), "H5Pset_chunk succeeded");
+
+ dset_id = H5Dcreate2(file_id, PARTIAL_NO_SELECTION_DATASET_NAME, H5T_NATIVE_INT, fspace_id, H5P_DEFAULT, dcpl_id, H5P_DEFAULT);
+ VRFY((dset_id >= 0), "H5Dcreate2 succeeded");
+
+ /*
+ * Setup hyperslab selection to split the dataset among the ranks.
+ *
+ * The ranks will write rows across the dataset.
+ */
+ start[0] = PARTIAL_NO_SELECTION_Y_DIM_SCALE * mpi_rank;
+ start[1] = 0;
+ stride[0] = PARTIAL_NO_SELECTION_Y_DIM_SCALE;
+ stride[1] = PARTIAL_NO_SELECTION_X_DIM_SCALE;
+ count[0] = 1;
+ count[1] = mpi_size;
+ block[0] = PARTIAL_NO_SELECTION_Y_DIM_SCALE;
+ block[1] = PARTIAL_NO_SELECTION_X_DIM_SCALE;
+
+ VRFY((H5Sselect_hyperslab(fspace_id, H5S_SELECT_SET, start, stride, count, block) >= 0), "H5Sselect_hyperslab succeeded");
+
+ sel_dims[0] = count[1] * (PARTIAL_NO_SELECTION_Y_DIM_SCALE * PARTIAL_NO_SELECTION_X_DIM_SCALE);
+
+ mspace_id = H5Screate_simple(1, sel_dims, NULL);
+ VRFY((mspace_id >= 0), "H5Screate_simple succeeded");
+
+ data = calloc(1, count[1] * (PARTIAL_NO_SELECTION_Y_DIM_SCALE * PARTIAL_NO_SELECTION_X_DIM_SCALE) * sizeof(int));
+ VRFY((data != NULL), "calloc succeeded");
+
+ dxpl_id = H5Pcreate(H5P_DATASET_XFER);
+ VRFY((dxpl_id >= 0), "H5Pcreate succeeded");
+
+ /*
+ * Enable collective access for the data transfer.
+ */
+ VRFY((H5Pset_dxpl_mpio(dxpl_id, H5FD_MPIO_COLLECTIVE) >= 0), "H5Pset_dxpl_mpio succeeded");
+
+ VRFY((H5Dwrite(dset_id, H5T_NATIVE_INT, mspace_id, fspace_id, dxpl_id, data) >= 0), "H5Dwrite succeeded");
+
+ VRFY((H5Fflush(file_id, H5F_SCOPE_GLOBAL) >= 0), "H5Fflush succeeded");
+
+ /*
+ * Ensure that linked-chunk I/O is performed since this is
+ * the particular code path where the issue lies and we don't
+ * want the library doing multi-chunk I/O behind our backs.
+ */
+ VRFY((H5Pset_dxpl_mpio_chunk_opt(dxpl_id, H5FD_MPIO_CHUNK_ONE_IO) >= 0), "H5Pset_dxpl_mpio_chunk_opt succeeded");
+
+ read_buf = malloc(count[1] * (PARTIAL_NO_SELECTION_Y_DIM_SCALE * PARTIAL_NO_SELECTION_X_DIM_SCALE) * sizeof(int));
+ VRFY((read_buf != NULL), "malloc succeeded");
+
+ /*
+ * Make sure to call H5Sselect_none() on the non-participating process.
+ */
+ if (PARTIAL_NO_SELECTION_NO_SEL_PROCESS) {
+ VRFY((H5Sselect_none(fspace_id) >= 0), "H5Sselect_none succeeded");
+ VRFY((H5Sselect_none(mspace_id) >= 0), "H5Sselect_none succeeded");
+ }
+
+ /*
+ * Finally have each rank read their section of data back from the dataset.
+ */
+ VRFY((H5Dread(dset_id, H5T_NATIVE_INT, mspace_id, fspace_id, dxpl_id, read_buf) >= 0), "H5Dread succeeded");
+
+ /*
+ * Check data integrity just to be sure.
+ */
+ if (!PARTIAL_NO_SELECTION_NO_SEL_PROCESS) {
+ VRFY((!memcmp(data, read_buf, count[1] * (PARTIAL_NO_SELECTION_Y_DIM_SCALE * PARTIAL_NO_SELECTION_X_DIM_SCALE) * sizeof(int))), "memcmp succeeded");
+ }
+
+ if (dataset_dims) {
+ free(dataset_dims);
+ dataset_dims = NULL;
+ }
+
+ if (data) {
+ free(data);
+ data = NULL;
+ }
+
+ if (read_buf) {
+ free(read_buf);
+ read_buf = NULL;
+ }
+
+ VRFY((H5Sclose(fspace_id) >= 0), "H5Sclose succeeded");
+ VRFY((H5Sclose(mspace_id) >= 0), "H5Sclose succeeded");
+ VRFY((H5Pclose(dcpl_id) >= 0), "H5Pclose succeeded");
+ VRFY((H5Pclose(dxpl_id) >= 0), "H5Pclose succeeded");
+ VRFY((H5Dclose(dset_id) >= 0), "H5Dclose succeeded");
+ VRFY((H5Pclose(fapl_id) >= 0), "H5Pclose succeeded");
+ VRFY((H5Fclose(file_id) >= 0), "H5Fclose succeeded");
+}
diff --git a/testpar/t_dset.c b/testpar/t_dset.c
index b315772..281d027 100644
--- a/testpar/t_dset.c
+++ b/testpar/t_dset.c
@@ -36,83 +36,91 @@
* Setup the dimensions of the hyperslab.
* Two modes--by rows or by columns.
* Assume dimension rank is 2.
- * BYROW divide into slabs of rows
- * BYCOL divide into blocks of columns
- * ZROW same as BYROW except process 0 gets 0 rows
- * ZCOL same as BYCOL except process 0 gets 0 columns
+ * BYROW divide into slabs of rows
+ * BYCOL divide into blocks of columns
+ * ZROW same as BYROW except process 0 gets 0 rows
+ * ZCOL same as BYCOL except process 0 gets 0 columns
*/
static void
slab_set(int mpi_rank, int mpi_size, hsize_t start[], hsize_t count[],
- hsize_t stride[], hsize_t block[], int mode)
+ hsize_t stride[], hsize_t block[], int mode)
{
- switch (mode){
+ switch (mode) {
case BYROW:
- /* Each process takes a slabs of rows. */
- block[0] = dim0/mpi_size;
- block[1] = dim1;
- stride[0] = block[0];
- stride[1] = block[1];
- count[0] = 1;
- count[1] = 1;
- start[0] = mpi_rank*block[0];
- start[1] = 0;
-if(VERBOSE_MED) printf("slab_set BYROW\n");
- break;
+ /* Each process takes a slabs of rows. */
+ block[0] = dim0 / mpi_size;
+ block[1] = dim1;
+ stride[0] = block[0];
+ stride[1] = block[1];
+ count[0] = 1;
+ count[1] = 1;
+ start[0] = mpi_rank * block[0];
+ start[1] = 0;
+ if (VERBOSE_MED)
+ HDprintf("slab_set BYROW\n");
+ break;
case BYCOL:
- /* Each process takes a block of columns. */
- block[0] = dim0;
- block[1] = dim1/mpi_size;
- stride[0] = block[0];
- stride[1] = block[1];
- count[0] = 1;
- count[1] = 1;
- start[0] = 0;
- start[1] = mpi_rank*block[1];
-if(VERBOSE_MED) printf("slab_set BYCOL\n");
- break;
+ /* Each process takes a block of columns. */
+ block[0] = dim0;
+ block[1] = dim1 / mpi_size;
+ stride[0] = block[0];
+ stride[1] = block[1];
+ count[0] = 1;
+ count[1] = 1;
+ start[0] = 0;
+ start[1] = mpi_rank * block[1];
+ if (VERBOSE_MED)
+ HDprintf("slab_set BYCOL\n");
+ break;
case ZROW:
- /* Similar to BYROW except process 0 gets 0 row */
- block[0] = (mpi_rank ? dim0/mpi_size : 0);
- block[1] = dim1;
- stride[0] = (mpi_rank ? block[0] : 1); /* avoid setting stride to 0 */
- stride[1] = block[1];
- count[0] = 1;
- count[1] = 1;
- start[0] = (mpi_rank? mpi_rank*block[0] : 0);
- start[1] = 0;
-if(VERBOSE_MED) printf("slab_set ZROW\n");
- break;
+ /* Similar to BYROW except process 0 gets 0 row */
+ block[0] = (mpi_rank ? dim0 / mpi_size : 0);
+ block[1] = dim1;
+ stride[0] = (mpi_rank ? block[0] : 1); /* avoid setting stride to 0 */
+ stride[1] = block[1];
+ count[0] = 1;
+ count[1] = 1;
+ start[0] = (mpi_rank ? mpi_rank * block[0] : 0);
+ start[1] = 0;
+ if (VERBOSE_MED)
+ HDprintf("slab_set ZROW\n");
+ break;
case ZCOL:
- /* Similar to BYCOL except process 0 gets 0 column */
- block[0] = dim0;
- block[1] = (mpi_rank ? dim1/mpi_size : 0);
- stride[0] = block[0];
- stride[1] = (mpi_rank ? block[1] : 1); /* avoid setting stride to 0 */
- count[0] = 1;
- count[1] = 1;
- start[0] = 0;
- start[1] = (mpi_rank? mpi_rank*block[1] : 0);
-if(VERBOSE_MED) printf("slab_set ZCOL\n");
- break;
+ /* Similar to BYCOL except process 0 gets 0 column */
+ block[0] = dim0;
+ block[1] = (mpi_rank ? dim1 / mpi_size : 0);
+ stride[0] = block[0];
+ stride[1] = (mpi_rank ? block[1] : 1); /* avoid setting stride to 0 */
+ count[0] = 1;
+ count[1] = 1;
+ start[0] = 0;
+ start[1] = (mpi_rank ? mpi_rank * block[1] : 0);
+ if (VERBOSE_MED)
+ HDprintf("slab_set ZCOL\n");
+ break;
default:
- /* Unknown mode. Set it to cover the whole dataset. */
- printf("unknown slab_set mode (%d)\n", mode);
- block[0] = dim0;
- block[1] = dim1;
- stride[0] = block[0];
- stride[1] = block[1];
- count[0] = 1;
- count[1] = 1;
- start[0] = 0;
- start[1] = 0;
-if(VERBOSE_MED) printf("slab_set wholeset\n");
- break;
+ /* Unknown mode. Set it to cover the whole dataset. */
+ HDprintf("unknown slab_set mode (%d)\n", mode);
+ block[0] = dim0;
+ block[1] = dim1;
+ stride[0] = block[0];
+ stride[1] = block[1];
+ count[0] = 1;
+ count[1] = 1;
+ start[0] = 0;
+ start[1] = 0;
+ if (VERBOSE_MED)
+ HDprintf("slab_set wholeset\n");
+ break;
}
-if(VERBOSE_MED){
- printf("start[]=(%lu,%lu), count[]=(%lu,%lu), stride[]=(%lu,%lu), block[]=(%lu,%lu), total datapoints=%lu\n",
- (unsigned long)start[0], (unsigned long)start[1], (unsigned long)count[0], (unsigned long)count[1],
- (unsigned long)stride[0], (unsigned long)stride[1], (unsigned long)block[0], (unsigned long)block[1],
- (unsigned long)(block[0]*block[1]*count[0]*count[1]));
+ if (VERBOSE_MED) {
+ HDprintf(
+ "start[]=(%lu,%lu), count[]=(%lu,%lu), stride[]=(%lu,%lu), block[]=(%lu,%lu), total datapoints=%lu\n",
+ (unsigned long) start[0], (unsigned long) start[1],
+ (unsigned long) count[0], (unsigned long) count[1],
+ (unsigned long) stride[0], (unsigned long) stride[1],
+ (unsigned long) block[0], (unsigned long) block[1],
+ (unsigned long) (block[0] * block[1] * count[0] * count[1]));
}
}
@@ -123,7 +131,7 @@ void point_set(hsize_t start[],
hsize_t count[],
hsize_t stride[],
hsize_t block[],
- size_t num_points,
+ size_t num_points,
hsize_t coords[],
int order)
{
@@ -153,13 +161,13 @@ void point_set(hsize_t start[],
}
if(VERBOSE_MED) {
- printf("start[]=(%lu, %lu), count[]=(%lu, %lu), stride[]=(%lu, %lu), block[]=(%lu, %lu), total datapoints=%lu\n",
+ HDprintf("start[]=(%lu, %lu), count[]=(%lu, %lu), stride[]=(%lu, %lu), block[]=(%lu, %lu), total datapoints=%lu\n",
(unsigned long)start[0], (unsigned long)start[1], (unsigned long)count[0], (unsigned long)count[1],
(unsigned long)stride[0], (unsigned long)stride[1], (unsigned long)block[0], (unsigned long)block[1],
(unsigned long)(block[0] * block[1] * count[0] * count[1]));
k = 0;
for(i = 0; i < num_points ; i++) {
- printf("(%d, %d)\n", (int)coords[k], (int)coords[k + 1]);
+ HDprintf("(%d, %d)\n", (int)coords[k], (int)coords[k + 1]);
k += 2;
}
}
@@ -177,10 +185,10 @@ dataset_fill(hsize_t start[], hsize_t block[], DATATYPE * dataset)
/* put some trivial data in the data_array */
for (i=0; i < block[0]; i++){
- for (j=0; j < block[1]; j++){
- *dataptr = (DATATYPE)((i+start[0])*100 + (j+start[1]+1));
- dataptr++;
- }
+ for (j=0; j < block[1]; j++){
+ *dataptr = (DATATYPE)((i+start[0])*100 + (j+start[1]+1));
+ dataptr++;
+ }
}
}
@@ -195,19 +203,19 @@ dataset_print(hsize_t start[], hsize_t block[], DATATYPE * dataset)
hsize_t i, j;
/* print the column heading */
- printf("%-8s", "Cols:");
+ HDprintf("%-8s", "Cols:");
for (j=0; j < block[1]; j++){
- printf("%3lu ", (unsigned long)(start[1]+j));
+ HDprintf("%3lu ", (unsigned long)(start[1]+j));
}
- printf("\n");
+ HDprintf("\n");
/* print the slab data */
for (i=0; i < block[0]; i++){
- printf("Row %2lu: ", (unsigned long)(i+start[0]));
- for (j=0; j < block[1]; j++){
- printf("%03d ", *dataptr++);
- }
- printf("\n");
+ HDprintf("Row %2lu: ", (unsigned long)(i+start[0]));
+ for (j=0; j < block[1]; j++){
+ HDprintf("%03d ", *dataptr++);
+ }
+ HDprintf("\n");
}
}
@@ -223,35 +231,35 @@ dataset_vrfy(hsize_t start[], hsize_t count[], hsize_t stride[], hsize_t block[]
/* print it if VERBOSE_MED */
if(VERBOSE_MED) {
- printf("dataset_vrfy dumping:::\n");
- printf("start(%lu, %lu), count(%lu, %lu), stride(%lu, %lu), block(%lu, %lu)\n",
- (unsigned long)start[0], (unsigned long)start[1], (unsigned long)count[0], (unsigned long)count[1],
- (unsigned long)stride[0], (unsigned long)stride[1], (unsigned long)block[0], (unsigned long)block[1]);
- printf("original values:\n");
- dataset_print(start, block, original);
- printf("compared values:\n");
- dataset_print(start, block, dataset);
+ HDprintf("dataset_vrfy dumping:::\n");
+ HDprintf("start(%lu, %lu), count(%lu, %lu), stride(%lu, %lu), block(%lu, %lu)\n",
+ (unsigned long)start[0], (unsigned long)start[1], (unsigned long)count[0], (unsigned long)count[1],
+ (unsigned long)stride[0], (unsigned long)stride[1], (unsigned long)block[0], (unsigned long)block[1]);
+ HDprintf("original values:\n");
+ dataset_print(start, block, original);
+ HDprintf("compared values:\n");
+ dataset_print(start, block, dataset);
}
vrfyerrs = 0;
for (i=0; i < block[0]; i++){
- for (j=0; j < block[1]; j++){
- if(*dataset != *original){
- if(vrfyerrs++ < MAX_ERR_REPORT || VERBOSE_MED){
- printf("Dataset Verify failed at [%lu][%lu](row %lu, col %lu): expect %d, got %d\n",
- (unsigned long)i, (unsigned long)j,
- (unsigned long)(i+start[0]), (unsigned long)(j+start[1]),
- *(original), *(dataset));
- }
- dataset++;
- original++;
- }
- }
+ for (j=0; j < block[1]; j++){
+ if(*dataset != *original){
+ if(vrfyerrs++ < MAX_ERR_REPORT || VERBOSE_MED){
+ HDprintf("Dataset Verify failed at [%lu][%lu](row %lu, col %lu): expect %d, got %d\n",
+ (unsigned long)i, (unsigned long)j,
+ (unsigned long)(i+start[0]), (unsigned long)(j+start[1]),
+ *(original), *(dataset));
+ }
+ dataset++;
+ original++;
+ }
+ }
}
if(vrfyerrs > MAX_ERR_REPORT && !VERBOSE_MED)
- printf("[more errors ...]\n");
+ HDprintf("[more errors ...]\n");
if(vrfyerrs)
- printf("%d errors found in dataset_vrfy\n", vrfyerrs);
+ HDprintf("%d errors found in dataset_vrfy\n", vrfyerrs);
return(vrfyerrs);
}
@@ -272,20 +280,20 @@ void
dataset_writeInd(void)
{
hid_t fid; /* HDF5 file ID */
- hid_t acc_tpl; /* File access templates */
- hid_t sid; /* Dataspace ID */
- hid_t file_dataspace; /* File dataspace ID */
- hid_t mem_dataspace; /* memory dataspace ID */
- hid_t dataset1, dataset2; /* Dataset ID */
- hsize_t dims[RANK]; /* dataset dim sizes */
- DATATYPE *data_array1 = NULL; /* data buffer */
+ hid_t acc_tpl; /* File access templates */
+ hid_t sid; /* Dataspace ID */
+ hid_t file_dataspace; /* File dataspace ID */
+ hid_t mem_dataspace; /* memory dataspace ID */
+ hid_t dataset1, dataset2; /* Dataset ID */
+ hsize_t dims[RANK]; /* dataset dim sizes */
+ DATATYPE *data_array1 = NULL; /* data buffer */
const char *filename;
- hsize_t start[RANK]; /* for hyperslab setting */
- hsize_t count[RANK], stride[RANK]; /* for hyperslab setting */
- hsize_t block[RANK]; /* for hyperslab setting */
+ hsize_t start[RANK]; /* for hyperslab setting */
+ hsize_t count[RANK], stride[RANK]; /* for hyperslab setting */
+ hsize_t block[RANK]; /* for hyperslab setting */
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
int mpi_size, mpi_rank;
MPI_Comm comm = MPI_COMM_WORLD;
@@ -293,7 +301,7 @@ dataset_writeInd(void)
filename = GetTestParameters();
if(VERBOSE_MED)
- printf("Independent write test on file %s\n", filename);
+ HDprintf("Independent write test on file %s\n", filename);
/* set up MPI parameters */
MPI_Comm_size(MPI_COMM_WORLD,&mpi_size);
@@ -332,12 +340,12 @@ dataset_writeInd(void)
/* create a dataset collectively */
dataset1 = H5Dcreate2(fid, DATASETNAME1, H5T_NATIVE_INT, sid,
- H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
VRFY((dataset1 >= 0), "H5Dcreate2 succeeded");
/* create another dataset collectively */
dataset2 = H5Dcreate2(fid, DATASETNAME2, H5T_NATIVE_INT, sid,
- H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
VRFY((dataset2 >= 0), "H5Dcreate2 succeeded");
@@ -366,28 +374,28 @@ dataset_writeInd(void)
/* write data independently */
ret = H5Dwrite(dataset1, H5T_NATIVE_INT, mem_dataspace, file_dataspace,
- H5P_DEFAULT, data_array1);
+ H5P_DEFAULT, data_array1);
VRFY((ret >= 0), "H5Dwrite dataset1 succeeded");
/* write data independently */
ret = H5Dwrite(dataset2, H5T_NATIVE_INT, mem_dataspace, file_dataspace,
- H5P_DEFAULT, data_array1);
+ H5P_DEFAULT, data_array1);
VRFY((ret >= 0), "H5Dwrite dataset2 succeeded");
/* setup dimensions again to write with zero rows for process 0 */
if(VERBOSE_MED)
- printf("writeInd by some with zero row\n");
+ HDprintf("writeInd by some with zero row\n");
slab_set(mpi_rank, mpi_size, start, count, stride, block, ZROW);
ret = H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block);
VRFY((ret >= 0), "H5Sset_hyperslab succeeded");
/* need to make mem_dataspace to match for process 0 */
if(MAINPROCESS){
- ret = H5Sselect_hyperslab(mem_dataspace, H5S_SELECT_SET, start, stride, count, block);
- VRFY((ret >= 0), "H5Sset_hyperslab mem_dataspace succeeded");
+ ret = H5Sselect_hyperslab(mem_dataspace, H5S_SELECT_SET, start, stride, count, block);
+ VRFY((ret >= 0), "H5Sset_hyperslab mem_dataspace succeeded");
}
MESG("writeInd by some with zero row");
if((mpi_rank/2)*2 != mpi_rank){
ret = H5Dwrite(dataset1, H5T_NATIVE_INT, mem_dataspace, file_dataspace,
- H5P_DEFAULT, data_array1);
+ H5P_DEFAULT, data_array1);
VRFY((ret >= 0), "H5Dwrite dataset1 by ZROW succeeded");
}
#ifdef BARRIER_CHECKS
@@ -418,19 +426,19 @@ void
dataset_readInd(void)
{
hid_t fid; /* HDF5 file ID */
- hid_t acc_tpl; /* File access templates */
- hid_t file_dataspace; /* File dataspace ID */
- hid_t mem_dataspace; /* memory dataspace ID */
- hid_t dataset1, dataset2; /* Dataset ID */
- DATATYPE *data_array1 = NULL; /* data buffer */
- DATATYPE *data_origin1 = NULL; /* expected data buffer */
+ hid_t acc_tpl; /* File access templates */
+ hid_t file_dataspace; /* File dataspace ID */
+ hid_t mem_dataspace; /* memory dataspace ID */
+ hid_t dataset1, dataset2; /* Dataset ID */
+ DATATYPE *data_array1 = NULL; /* data buffer */
+ DATATYPE *data_origin1 = NULL; /* expected data buffer */
const char *filename;
- hsize_t start[RANK]; /* for hyperslab setting */
- hsize_t count[RANK], stride[RANK]; /* for hyperslab setting */
- hsize_t block[RANK]; /* for hyperslab setting */
+ hsize_t start[RANK]; /* for hyperslab setting */
+ hsize_t count[RANK], stride[RANK]; /* for hyperslab setting */
+ hsize_t block[RANK]; /* for hyperslab setting */
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
int mpi_size, mpi_rank;
MPI_Comm comm = MPI_COMM_WORLD;
@@ -438,7 +446,7 @@ dataset_readInd(void)
filename = GetTestParameters();
if(VERBOSE_MED)
- printf("Independent read test on file %s\n", filename);
+ HDprintf("Independent read test on file %s\n", filename);
/* set up MPI parameters */
MPI_Comm_size(MPI_COMM_WORLD,&mpi_size);
@@ -489,7 +497,7 @@ dataset_readInd(void)
/* read data independently */
ret = H5Dread(dataset1, H5T_NATIVE_INT, mem_dataspace, file_dataspace,
- H5P_DEFAULT, data_array1);
+ H5P_DEFAULT, data_array1);
VRFY((ret >= 0), "");
/* verify the read data with original expected data */
@@ -498,7 +506,7 @@ dataset_readInd(void)
/* read data independently */
ret = H5Dread(dataset2, H5T_NATIVE_INT, mem_dataspace, file_dataspace,
- H5P_DEFAULT, data_array1);
+ H5P_DEFAULT, data_array1);
VRFY((ret >= 0), "");
/* verify the read data with original expected data */
@@ -540,28 +548,28 @@ void
dataset_writeAll(void)
{
hid_t fid; /* HDF5 file ID */
- hid_t acc_tpl; /* File access templates */
- hid_t xfer_plist; /* Dataset transfer properties list */
- hid_t sid; /* Dataspace ID */
- hid_t file_dataspace; /* File dataspace ID */
- hid_t mem_dataspace; /* memory dataspace ID */
+ hid_t acc_tpl; /* File access templates */
+ hid_t xfer_plist; /* Dataset transfer properties list */
+ hid_t sid; /* Dataspace ID */
+ hid_t file_dataspace; /* File dataspace ID */
+ hid_t mem_dataspace; /* memory dataspace ID */
hid_t dataset1, dataset2, dataset3, dataset4; /* Dataset ID */
hid_t dataset5, dataset6, dataset7; /* Dataset ID */
- hid_t datatype; /* Datatype ID */
- hsize_t dims[RANK]; /* dataset dim sizes */
- DATATYPE *data_array1 = NULL; /* data buffer */
+ hid_t datatype; /* Datatype ID */
+ hsize_t dims[RANK]; /* dataset dim sizes */
+ DATATYPE *data_array1 = NULL; /* data buffer */
const char *filename;
- hsize_t start[RANK]; /* for hyperslab setting */
- hsize_t count[RANK], stride[RANK]; /* for hyperslab setting */
- hsize_t block[RANK]; /* for hyperslab setting */
+ hsize_t start[RANK]; /* for hyperslab setting */
+ hsize_t count[RANK], stride[RANK]; /* for hyperslab setting */
+ hsize_t block[RANK]; /* for hyperslab setting */
size_t num_points; /* for point selection */
hsize_t *coords = NULL; /* for point selection */
hsize_t current_dims; /* for point selection */
int i;
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
int mpi_size, mpi_rank;
MPI_Comm comm = MPI_COMM_WORLD;
@@ -569,7 +577,7 @@ dataset_writeAll(void)
filename = GetTestParameters();
if(VERBOSE_MED)
- printf("Collective write test on file %s\n", filename);
+ HDprintf("Collective write test on file %s\n", filename);
/* set up MPI parameters */
MPI_Comm_size(MPI_COMM_WORLD,&mpi_size);
@@ -669,8 +677,8 @@ dataset_writeAll(void)
dataset_fill(start, block, data_array1);
MESG("data_array initialized");
if(VERBOSE_MED){
- MESG("data_array created");
- dataset_print(start, block, data_array1);
+ MESG("data_array created");
+ dataset_print(start, block, data_array1);
}
/* set up the collective transfer properties list */
@@ -687,23 +695,23 @@ dataset_writeAll(void)
/* write data collectively */
MESG("writeAll by Row");
ret = H5Dwrite(dataset1, H5T_NATIVE_INT, mem_dataspace, file_dataspace,
- xfer_plist, data_array1);
+ xfer_plist, data_array1);
VRFY((ret >= 0), "H5Dwrite dataset1 succeeded");
/* setup dimensions again to writeAll with zero rows for process 0 */
if(VERBOSE_MED)
- printf("writeAll by some with zero row\n");
+ HDprintf("writeAll by some with zero row\n");
slab_set(mpi_rank, mpi_size, start, count, stride, block, ZROW);
ret = H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block);
VRFY((ret >= 0), "H5Sset_hyperslab succeeded");
/* need to make mem_dataspace to match for process 0 */
if(MAINPROCESS){
- ret = H5Sselect_hyperslab(mem_dataspace, H5S_SELECT_SET, start, stride, count, block);
- VRFY((ret >= 0), "H5Sset_hyperslab mem_dataspace succeeded");
+ ret = H5Sselect_hyperslab(mem_dataspace, H5S_SELECT_SET, start, stride, count, block);
+ VRFY((ret >= 0), "H5Sset_hyperslab mem_dataspace succeeded");
}
MESG("writeAll by some with zero row");
ret = H5Dwrite(dataset1, H5T_NATIVE_INT, mem_dataspace, file_dataspace,
- xfer_plist, data_array1);
+ xfer_plist, data_array1);
VRFY((ret >= 0), "H5Dwrite dataset1 by ZROW succeeded");
/* release all temporary handles. */
@@ -720,8 +728,8 @@ dataset_writeAll(void)
dataset_fill(start, block, data_array1);
MESG("data_array initialized");
if(VERBOSE_MED){
- MESG("data_array created");
- dataset_print(start, block, data_array1);
+ MESG("data_array created");
+ dataset_print(start, block, data_array1);
}
/* create a file dataspace independently */
@@ -738,8 +746,8 @@ dataset_writeAll(void)
dataset_fill(start, block, data_array1);
MESG("data_array initialized");
if(VERBOSE_MED){
- MESG("data_array created");
- dataset_print(start, block, data_array1);
+ MESG("data_array created");
+ dataset_print(start, block, data_array1);
}
/* set up the collective transfer properties list */
@@ -755,23 +763,23 @@ dataset_writeAll(void)
/* write data independently */
ret = H5Dwrite(dataset2, H5T_NATIVE_INT, mem_dataspace, file_dataspace,
- xfer_plist, data_array1);
+ xfer_plist, data_array1);
VRFY((ret >= 0), "H5Dwrite dataset2 succeeded");
/* setup dimensions again to writeAll with zero columns for process 0 */
if(VERBOSE_MED)
- printf("writeAll by some with zero col\n");
+ HDprintf("writeAll by some with zero col\n");
slab_set(mpi_rank, mpi_size, start, count, stride, block, ZCOL);
ret = H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block);
VRFY((ret >= 0), "H5Sset_hyperslab succeeded");
/* need to make mem_dataspace to match for process 0 */
if(MAINPROCESS){
- ret = H5Sselect_hyperslab(mem_dataspace, H5S_SELECT_SET, start, stride, count, block);
- VRFY((ret >= 0), "H5Sset_hyperslab mem_dataspace succeeded");
+ ret = H5Sselect_hyperslab(mem_dataspace, H5S_SELECT_SET, start, stride, count, block);
+ VRFY((ret >= 0), "H5Sset_hyperslab mem_dataspace succeeded");
}
MESG("writeAll by some with zero col");
ret = H5Dwrite(dataset1, H5T_NATIVE_INT, mem_dataspace, file_dataspace,
- xfer_plist, data_array1);
+ xfer_plist, data_array1);
VRFY((ret >= 0), "H5Dwrite dataset1 by ZCOL succeeded");
/* release all temporary handles. */
@@ -789,8 +797,8 @@ dataset_writeAll(void)
file_dataspace = H5Dget_space (dataset3);
VRFY((file_dataspace >= 0), "H5Dget_space succeeded");
if(MAINPROCESS) {
- ret = H5Sselect_none(file_dataspace);
- VRFY((ret >= 0), "H5Sselect_none file_dataspace succeeded");
+ ret = H5Sselect_none(file_dataspace);
+ VRFY((ret >= 0), "H5Sselect_none file_dataspace succeeded");
} /* end if */
else {
ret = H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block);
@@ -801,16 +809,16 @@ dataset_writeAll(void)
mem_dataspace = H5Screate_simple (RANK, block, NULL);
VRFY((mem_dataspace >= 0), "");
if(MAINPROCESS) {
- ret = H5Sselect_none(mem_dataspace);
- VRFY((ret >= 0), "H5Sselect_none mem_dataspace succeeded");
+ ret = H5Sselect_none(mem_dataspace);
+ VRFY((ret >= 0), "H5Sselect_none mem_dataspace succeeded");
} /* end if */
/* fill the local slab with some trivial data */
dataset_fill(start, block, data_array1);
MESG("data_array initialized");
if(VERBOSE_MED) {
- MESG("data_array created");
- dataset_print(start, block, data_array1);
+ MESG("data_array created");
+ dataset_print(start, block, data_array1);
} /* end if */
/* set up the collective transfer properties list */
@@ -827,13 +835,13 @@ dataset_writeAll(void)
/* write data collectively */
MESG("writeAll with none");
ret = H5Dwrite(dataset3, H5T_NATIVE_INT, mem_dataspace, file_dataspace,
- xfer_plist, data_array1);
+ xfer_plist, data_array1);
VRFY((ret >= 0), "H5Dwrite dataset3 succeeded");
/* write data collectively (with datatype conversion) */
MESG("writeAll with none");
ret = H5Dwrite(dataset3, H5T_NATIVE_UCHAR, mem_dataspace, file_dataspace,
- xfer_plist, data_array1);
+ xfer_plist, data_array1);
VRFY((ret >= 0), "H5Dwrite dataset3 succeeded");
/* release all temporary handles. */
@@ -850,8 +858,8 @@ dataset_writeAll(void)
file_dataspace = H5Dget_space (dataset4);
VRFY((file_dataspace >= 0), "H5Dget_space succeeded");
if(MAINPROCESS) {
- ret = H5Sselect_none(file_dataspace);
- VRFY((ret >= 0), "H5Sselect_all file_dataspace succeeded");
+ ret = H5Sselect_none(file_dataspace);
+ VRFY((ret >= 0), "H5Sselect_all file_dataspace succeeded");
} /* end if */
else {
ret = H5Sselect_all(file_dataspace);
@@ -862,8 +870,8 @@ dataset_writeAll(void)
mem_dataspace = H5Screate(H5S_SCALAR);
VRFY((mem_dataspace >= 0), "");
if(MAINPROCESS) {
- ret = H5Sselect_none(mem_dataspace);
- VRFY((ret >= 0), "H5Sselect_all mem_dataspace succeeded");
+ ret = H5Sselect_none(mem_dataspace);
+ VRFY((ret >= 0), "H5Sselect_all mem_dataspace succeeded");
} /* end if */
else {
ret = H5Sselect_all(mem_dataspace);
@@ -874,8 +882,8 @@ dataset_writeAll(void)
dataset_fill(start, block, data_array1);
MESG("data_array initialized");
if(VERBOSE_MED) {
- MESG("data_array created");
- dataset_print(start, block, data_array1);
+ MESG("data_array created");
+ dataset_print(start, block, data_array1);
} /* end if */
/* set up the collective transfer properties list */
@@ -891,13 +899,13 @@ dataset_writeAll(void)
/* write data collectively */
MESG("writeAll with scalar dataspace");
ret = H5Dwrite(dataset4, H5T_NATIVE_INT, mem_dataspace, file_dataspace,
- xfer_plist, data_array1);
+ xfer_plist, data_array1);
VRFY((ret >= 0), "H5Dwrite dataset4 succeeded");
/* write data collectively (with datatype conversion) */
MESG("writeAll with scalar dataspace");
ret = H5Dwrite(dataset4, H5T_NATIVE_UCHAR, mem_dataspace, file_dataspace,
- xfer_plist, data_array1);
+ xfer_plist, data_array1);
VRFY((ret >= 0), "H5Dwrite dataset4 succeeded");
/* release all temporary handles. */
@@ -907,7 +915,7 @@ dataset_writeAll(void)
if(data_array1) free(data_array1);
- data_array1 = (DATATYPE *)malloc(dim0*dim1*sizeof(DATATYPE));
+ data_array1 = (DATATYPE *)HDmalloc(dim0*dim1*sizeof(DATATYPE));
VRFY((data_array1 != NULL), "data_array1 malloc succeeded");
block[0] = 1;
@@ -922,15 +930,15 @@ dataset_writeAll(void)
dataset_fill(start, block, data_array1);
MESG("data_array initialized");
if(VERBOSE_MED){
- MESG("data_array created");
- dataset_print(start, block, data_array1);
+ MESG("data_array created");
+ dataset_print(start, block, data_array1);
}
/* Dataset5: point selection in File - Hyperslab selection in Memory*/
/* create a file dataspace independently */
point_set (start, count, stride, block, num_points, coords, OUT_OF_ORDER);
file_dataspace = H5Dget_space (dataset5);
- VRFY((file_dataspace >= 0), "H5Dget_space succeeded");
+ VRFY((file_dataspace >= 0), "H5Dget_space succeeded");
ret = H5Sselect_elements(file_dataspace, H5S_SELECT_SET, num_points, coords);
VRFY((ret >= 0), "H5Sselect_elements succeeded");
@@ -1005,7 +1013,7 @@ dataset_writeAll(void)
start[1] = 0;
point_set (start, count, stride, block, num_points, coords, IN_ORDER);
file_dataspace = H5Dget_space (dataset7);
- VRFY((file_dataspace >= 0), "H5Dget_space succeeded");
+ VRFY((file_dataspace >= 0), "H5Dget_space succeeded");
ret = H5Sselect_elements(file_dataspace, H5S_SELECT_SET, num_points, coords);
VRFY((ret >= 0), "H5Sselect_elements succeeded");
@@ -1075,25 +1083,25 @@ void
dataset_readAll(void)
{
hid_t fid; /* HDF5 file ID */
- hid_t acc_tpl; /* File access templates */
- hid_t xfer_plist; /* Dataset transfer properties list */
- hid_t file_dataspace; /* File dataspace ID */
- hid_t mem_dataspace; /* memory dataspace ID */
+ hid_t acc_tpl; /* File access templates */
+ hid_t xfer_plist; /* Dataset transfer properties list */
+ hid_t file_dataspace; /* File dataspace ID */
+ hid_t mem_dataspace; /* memory dataspace ID */
hid_t dataset1, dataset2, dataset5, dataset6, dataset7; /* Dataset ID */
- DATATYPE *data_array1 = NULL; /* data buffer */
- DATATYPE *data_origin1 = NULL; /* expected data buffer */
+ DATATYPE *data_array1 = NULL; /* data buffer */
+ DATATYPE *data_origin1 = NULL; /* expected data buffer */
const char *filename;
- hsize_t start[RANK]; /* for hyperslab setting */
- hsize_t count[RANK], stride[RANK]; /* for hyperslab setting */
- hsize_t block[RANK]; /* for hyperslab setting */
+ hsize_t start[RANK]; /* for hyperslab setting */
+ hsize_t count[RANK], stride[RANK]; /* for hyperslab setting */
+ hsize_t block[RANK]; /* for hyperslab setting */
size_t num_points; /* for point selection */
hsize_t *coords = NULL; /* for point selection */
hsize_t current_dims; /* for point selection */
int i,j,k;
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
int mpi_size, mpi_rank;
MPI_Comm comm = MPI_COMM_WORLD;
@@ -1101,7 +1109,7 @@ dataset_readAll(void)
filename = GetTestParameters();
if(VERBOSE_MED)
- printf("Collective read test on file %s\n", filename);
+ HDprintf("Collective read test on file %s\n", filename);
/* set up MPI parameters */
MPI_Comm_size(MPI_COMM_WORLD,&mpi_size);
@@ -1174,8 +1182,8 @@ dataset_readAll(void)
dataset_fill(start, block, data_origin1);
MESG("data_array initialized");
if(VERBOSE_MED){
- MESG("data_array created");
- dataset_print(start, block, data_origin1);
+ MESG("data_array created");
+ dataset_print(start, block, data_origin1);
}
/* set up the collective transfer properties list */
@@ -1191,7 +1199,7 @@ dataset_readAll(void)
/* read data collectively */
ret = H5Dread(dataset1, H5T_NATIVE_INT, mem_dataspace, file_dataspace,
- xfer_plist, data_array1);
+ xfer_plist, data_array1);
VRFY((ret >= 0), "H5Dread dataset1 succeeded");
/* verify the read data with original expected data */
@@ -1200,18 +1208,18 @@ dataset_readAll(void)
/* setup dimensions again to readAll with zero columns for process 0 */
if(VERBOSE_MED)
- printf("readAll by some with zero col\n");
+ HDprintf("readAll by some with zero col\n");
slab_set(mpi_rank, mpi_size, start, count, stride, block, ZCOL);
ret = H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block);
VRFY((ret >= 0), "H5Sset_hyperslab succeeded");
/* need to make mem_dataspace to match for process 0 */
if(MAINPROCESS){
- ret = H5Sselect_hyperslab(mem_dataspace, H5S_SELECT_SET, start, stride, count, block);
- VRFY((ret >= 0), "H5Sset_hyperslab mem_dataspace succeeded");
+ ret = H5Sselect_hyperslab(mem_dataspace, H5S_SELECT_SET, start, stride, count, block);
+ VRFY((ret >= 0), "H5Sset_hyperslab mem_dataspace succeeded");
}
MESG("readAll by some with zero col");
ret = H5Dread(dataset1, H5T_NATIVE_INT, mem_dataspace, file_dataspace,
- xfer_plist, data_array1);
+ xfer_plist, data_array1);
VRFY((ret >= 0), "H5Dread dataset1 by ZCOL succeeded");
/* verify the read data with original expected data */
@@ -1242,8 +1250,8 @@ dataset_readAll(void)
dataset_fill(start, block, data_origin1);
MESG("data_array initialized");
if(VERBOSE_MED){
- MESG("data_array created");
- dataset_print(start, block, data_origin1);
+ MESG("data_array created");
+ dataset_print(start, block, data_origin1);
}
/* set up the collective transfer properties list */
@@ -1259,7 +1267,7 @@ dataset_readAll(void)
/* read data collectively */
ret = H5Dread(dataset2, H5T_NATIVE_INT, mem_dataspace, file_dataspace,
- xfer_plist, data_array1);
+ xfer_plist, data_array1);
VRFY((ret >= 0), "H5Dread dataset2 succeeded");
/* verify the read data with original expected data */
@@ -1268,18 +1276,18 @@ dataset_readAll(void)
/* setup dimensions again to readAll with zero rows for process 0 */
if(VERBOSE_MED)
- printf("readAll by some with zero row\n");
+ HDprintf("readAll by some with zero row\n");
slab_set(mpi_rank, mpi_size, start, count, stride, block, ZROW);
ret = H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block);
VRFY((ret >= 0), "H5Sset_hyperslab succeeded");
/* need to make mem_dataspace to match for process 0 */
if(MAINPROCESS){
- ret = H5Sselect_hyperslab(mem_dataspace, H5S_SELECT_SET, start, stride, count, block);
- VRFY((ret >= 0), "H5Sset_hyperslab mem_dataspace succeeded");
+ ret = H5Sselect_hyperslab(mem_dataspace, H5S_SELECT_SET, start, stride, count, block);
+ VRFY((ret >= 0), "H5Sset_hyperslab mem_dataspace succeeded");
}
MESG("readAll by some with zero row");
ret = H5Dread(dataset1, H5T_NATIVE_INT, mem_dataspace, file_dataspace,
- xfer_plist, data_array1);
+ xfer_plist, data_array1);
VRFY((ret >= 0), "H5Dread dataset1 by ZROW succeeded");
/* verify the read data with original expected data */
@@ -1293,9 +1301,9 @@ dataset_readAll(void)
if(data_array1) free(data_array1);
if(data_origin1) free(data_origin1);
- data_array1 = (DATATYPE *)malloc(dim0*dim1*sizeof(DATATYPE));
+ data_array1 = (DATATYPE *)HDmalloc(dim0*dim1*sizeof(DATATYPE));
VRFY((data_array1 != NULL), "data_array1 malloc succeeded");
- data_origin1 = (DATATYPE *)malloc(dim0*dim1*sizeof(DATATYPE));
+ data_origin1 = (DATATYPE *)HDmalloc(dim0*dim1*sizeof(DATATYPE));
VRFY((data_origin1 != NULL), "data_origin1 malloc succeeded");
block[0] = 1;
@@ -1310,8 +1318,8 @@ dataset_readAll(void)
dataset_fill(start, block, data_origin1);
MESG("data_array initialized");
if(VERBOSE_MED){
- MESG("data_array created");
- dataset_print(start, block, data_origin1);
+ MESG("data_array created");
+ dataset_print(start, block, data_origin1);
}
/* Dataset5: point selection in memory - Hyperslab selection in file*/
@@ -1344,7 +1352,7 @@ dataset_readAll(void)
xfer_plist, data_array1);
VRFY((ret >= 0), "H5Dread dataset5 succeeded");
-
+
ret = dataset_vrfy(start, count, stride, block, data_array1, data_origin1);
if(ret) nerrors++;
@@ -1355,7 +1363,7 @@ dataset_readAll(void)
if(data_array1) free(data_array1);
- data_array1 = (DATATYPE *)malloc(dim0*dim1*sizeof(DATATYPE));
+ data_array1 = (DATATYPE *)HDmalloc(dim0*dim1*sizeof(DATATYPE));
VRFY((data_array1 != NULL), "data_array1 malloc succeeded");
/* Dataset6: point selection in File - Point selection in Memory*/
@@ -1400,7 +1408,7 @@ dataset_readAll(void)
H5Pclose(xfer_plist);
if(data_array1) free(data_array1);
- data_array1 = (DATATYPE *)malloc(dim0*dim1*sizeof(DATATYPE));
+ data_array1 = (DATATYPE *)HDmalloc(dim0*dim1*sizeof(DATATYPE));
VRFY((data_array1 != NULL), "data_array1 malloc succeeded");
/* Dataset7: point selection in memory - All selection in file*/
@@ -1488,25 +1496,25 @@ void
extend_writeInd(void)
{
hid_t fid; /* HDF5 file ID */
- hid_t acc_tpl; /* File access templates */
- hid_t sid; /* Dataspace ID */
- hid_t file_dataspace; /* File dataspace ID */
- hid_t mem_dataspace; /* memory dataspace ID */
- hid_t dataset1, dataset2; /* Dataset ID */
+ hid_t acc_tpl; /* File access templates */
+ hid_t sid; /* Dataspace ID */
+ hid_t file_dataspace; /* File dataspace ID */
+ hid_t mem_dataspace; /* memory dataspace ID */
+ hid_t dataset1, dataset2; /* Dataset ID */
const char *filename;
- hsize_t dims[RANK]; /* dataset dim sizes */
+ hsize_t dims[RANK]; /* dataset dim sizes */
hsize_t max_dims[RANK] =
- {H5S_UNLIMITED, H5S_UNLIMITED}; /* dataset maximum dim sizes */
- DATATYPE *data_array1 = NULL; /* data buffer */
- hsize_t chunk_dims[RANK]; /* chunk sizes */
- hid_t dataset_pl; /* dataset create prop. list */
+ {H5S_UNLIMITED, H5S_UNLIMITED}; /* dataset maximum dim sizes */
+ DATATYPE *data_array1 = NULL; /* data buffer */
+ hsize_t chunk_dims[RANK]; /* chunk sizes */
+ hid_t dataset_pl; /* dataset create prop. list */
- hsize_t start[RANK]; /* for hyperslab setting */
- hsize_t count[RANK]; /* for hyperslab setting */
- hsize_t stride[RANK]; /* for hyperslab setting */
- hsize_t block[RANK]; /* for hyperslab setting */
+ hsize_t start[RANK]; /* for hyperslab setting */
+ hsize_t count[RANK]; /* for hyperslab setting */
+ hsize_t stride[RANK]; /* for hyperslab setting */
+ hsize_t block[RANK]; /* for hyperslab setting */
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
int mpi_size, mpi_rank;
MPI_Comm comm = MPI_COMM_WORLD;
@@ -1514,7 +1522,7 @@ extend_writeInd(void)
filename = GetTestParameters();
if(VERBOSE_MED)
- printf("Extend independent write test on file %s\n", filename);
+ HDprintf("Extend independent write test on file %s\n", filename);
/* set up MPI parameters */
MPI_Comm_size(MPI_COMM_WORLD,&mpi_size);
@@ -1567,7 +1575,7 @@ extend_writeInd(void)
/* set up dataset storage chunk sizes and creation property list */
if(VERBOSE_MED)
- printf("chunks[]=%lu,%lu\n", (unsigned long)chunk_dims[0], (unsigned long)chunk_dims[1]);
+ HDprintf("chunks[]=%lu,%lu\n", (unsigned long)chunk_dims[0], (unsigned long)chunk_dims[1]);
dataset_pl = H5Pcreate(H5P_DATASET_CREATE);
VRFY((dataset_pl >= 0), "H5Pcreate succeeded");
ret = H5Pset_chunk(dataset_pl, RANK, chunk_dims);
@@ -1603,8 +1611,8 @@ extend_writeInd(void)
dataset_fill(start, block, data_array1);
MESG("data_array initialized");
if(VERBOSE_MED) {
- MESG("data_array created");
- dataset_print(start, block, data_array1);
+ MESG("data_array created");
+ dataset_print(start, block, data_array1);
}
/* create a memory dataspace independently */
@@ -1625,7 +1633,7 @@ extend_writeInd(void)
/* write data independently */
ret = H5Dwrite(dataset1, H5T_NATIVE_INT, mem_dataspace, file_dataspace,
- H5P_DEFAULT, data_array1);
+ H5P_DEFAULT, data_array1);
VRFY((ret >= 0), "H5Dwrite succeeded");
/* release resource */
@@ -1643,8 +1651,8 @@ extend_writeInd(void)
dataset_fill(start, block, data_array1);
MESG("data_array initialized");
if(VERBOSE_MED){
- MESG("data_array created");
- dataset_print(start, block, data_array1);
+ MESG("data_array created");
+ dataset_print(start, block, data_array1);
}
/* create a memory dataspace independently */
@@ -1664,7 +1672,7 @@ extend_writeInd(void)
/* write data independently. Should fail. */
ret = H5Dwrite(dataset2, H5T_NATIVE_INT, mem_dataspace, file_dataspace,
- H5P_DEFAULT, data_array1);
+ H5P_DEFAULT, data_array1);
VRFY((ret < 0), "H5Dwrite failed as expected");
/* restore auto error reporting */
@@ -1685,7 +1693,7 @@ extend_writeInd(void)
/* write data independently */
ret = H5Dwrite(dataset2, H5T_NATIVE_INT, mem_dataspace, file_dataspace,
- H5P_DEFAULT, data_array1);
+ H5P_DEFAULT, data_array1);
VRFY((ret >= 0), "H5Dwrite succeeded");
/* release resource */
@@ -1719,25 +1727,25 @@ extend_writeInd2(void)
{
const char *filename;
hid_t fid; /* HDF5 file ID */
- hid_t fapl; /* File access templates */
- hid_t fs; /* File dataspace ID */
- hid_t ms; /* Memory dataspace ID */
- hid_t dataset; /* Dataset ID */
- hsize_t orig_size=10; /* Original dataset dim size */
- hsize_t new_size=20; /* Extended dataset dim size */
+ hid_t fapl; /* File access templates */
+ hid_t fs; /* File dataspace ID */
+ hid_t ms; /* Memory dataspace ID */
+ hid_t dataset; /* Dataset ID */
+ hsize_t orig_size=10; /* Original dataset dim size */
+ hsize_t new_size=20; /* Extended dataset dim size */
hsize_t one=1;
- hsize_t max_size = H5S_UNLIMITED; /* dataset maximum dim size */
- hsize_t chunk_size = 16384; /* chunk size */
- hid_t dcpl; /* dataset create prop. list */
+ hsize_t max_size = H5S_UNLIMITED; /* dataset maximum dim size */
+ hsize_t chunk_size = 16384; /* chunk size */
+ hid_t dcpl; /* dataset create prop. list */
int written[10], /* Data to write */
retrieved[10]; /* Data read in */
int mpi_size, mpi_rank; /* MPI settings */
int i; /* Local index variable */
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
filename = GetTestParameters();
if(VERBOSE_MED)
- printf("Extend independent write test #2 on file %s\n", filename);
+ HDprintf("Extend independent write test #2 on file %s\n", filename);
/* set up MPI parameters */
MPI_Comm_size(MPI_COMM_WORLD,&mpi_size);
@@ -1794,10 +1802,10 @@ extend_writeInd2(void)
written[i] = i;
MESG("data array initialized");
if(VERBOSE_MED) {
- MESG("writing at offset zero: ");
+ MESG("writing at offset zero: ");
for(i = 0; i < (int)orig_size; i++)
- printf("%s%d", i?", ":"", written[i]);
- printf("\n");
+ HDprintf("%s%d", i?", ":"", written[i]);
+ HDprintf("\n");
}
ret = H5Dwrite(dataset, H5T_NATIVE_INT, ms, fs, H5P_DEFAULT, written);
VRFY((ret >= 0), "H5Dwrite succeeded");
@@ -1809,15 +1817,15 @@ extend_writeInd2(void)
VRFY((ret >= 0), "H5Dread succeeded");
for (i=0; i<(int)orig_size; i++)
if(written[i]!=retrieved[i]) {
- printf("Line #%d: written!=retrieved: written[%d]=%d, retrieved[%d]=%d\n",__LINE__,
+ HDprintf("Line #%d: written!=retrieved: written[%d]=%d, retrieved[%d]=%d\n",__LINE__,
i,written[i], i,retrieved[i]);
nerrors++;
}
if(VERBOSE_MED){
- MESG("read at offset zero: ");
+ MESG("read at offset zero: ");
for (i=0; i<(int)orig_size; i++)
- printf("%s%d", i?", ":"", retrieved[i]);
- printf("\n");
+ HDprintf("%s%d", i?", ":"", retrieved[i]);
+ HDprintf("\n");
}
/* -------------------------
@@ -1837,10 +1845,10 @@ extend_writeInd2(void)
written[i] = orig_size + i;
MESG("data array re-initialized");
if(VERBOSE_MED) {
- MESG("writing at offset 10: ");
+ MESG("writing at offset 10: ");
for (i=0; i<(int)orig_size; i++)
- printf("%s%d", i?", ":"", written[i]);
- printf("\n");
+ HDprintf("%s%d", i?", ":"", written[i]);
+ HDprintf("\n");
}
ret = H5Sselect_hyperslab(fs, H5S_SELECT_SET, &orig_size, NULL, &one, &orig_size);
VRFY((ret >= 0), "H5Sselect_hyperslab succeeded");
@@ -1854,15 +1862,15 @@ extend_writeInd2(void)
VRFY((ret >= 0), "H5Dread succeeded");
for (i=0; i<(int)orig_size; i++)
if(written[i]!=retrieved[i]) {
- printf("Line #%d: written!=retrieved: written[%d]=%d, retrieved[%d]=%d\n",__LINE__,
+ HDprintf("Line #%d: written!=retrieved: written[%d]=%d, retrieved[%d]=%d\n",__LINE__,
i,written[i], i,retrieved[i]);
nerrors++;
}
if(VERBOSE_MED){
- MESG("read at offset 10: ");
+ MESG("read at offset 10: ");
for (i=0; i<(int)orig_size; i++)
- printf("%s%d", i?", ":"", retrieved[i]);
- printf("\n");
+ HDprintf("%s%d", i?", ":"", retrieved[i]);
+ HDprintf("\n");
}
@@ -1879,22 +1887,22 @@ extend_writeInd2(void)
void
extend_readInd(void)
{
- hid_t fid; /* HDF5 file ID */
- hid_t acc_tpl; /* File access templates */
- hid_t file_dataspace; /* File dataspace ID */
- hid_t mem_dataspace; /* memory dataspace ID */
- hid_t dataset1, dataset2; /* Dataset ID */
- hsize_t dims[RANK]; /* dataset dim sizes */
- DATATYPE *data_array1 = NULL; /* data buffer */
- DATATYPE *data_array2 = NULL; /* data buffer */
- DATATYPE *data_origin1 = NULL; /* expected data buffer */
+ hid_t fid; /* HDF5 file ID */
+ hid_t acc_tpl; /* File access templates */
+ hid_t file_dataspace; /* File dataspace ID */
+ hid_t mem_dataspace; /* memory dataspace ID */
+ hid_t dataset1, dataset2; /* Dataset ID */
+ hsize_t dims[RANK]; /* dataset dim sizes */
+ DATATYPE *data_array1 = NULL; /* data buffer */
+ DATATYPE *data_array2 = NULL; /* data buffer */
+ DATATYPE *data_origin1 = NULL; /* expected data buffer */
const char *filename;
- hsize_t start[RANK]; /* for hyperslab setting */
- hsize_t count[RANK], stride[RANK]; /* for hyperslab setting */
- hsize_t block[RANK]; /* for hyperslab setting */
+ hsize_t start[RANK]; /* for hyperslab setting */
+ hsize_t count[RANK], stride[RANK]; /* for hyperslab setting */
+ hsize_t block[RANK]; /* for hyperslab setting */
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
int mpi_size, mpi_rank;
MPI_Comm comm = MPI_COMM_WORLD;
@@ -1902,7 +1910,7 @@ extend_readInd(void)
filename = GetTestParameters();
if(VERBOSE_MED)
- printf("Extend independent read test on file %s\n", filename);
+ HDprintf("Extend independent read test on file %s\n", filename);
/* set up MPI parameters */
MPI_Comm_size(MPI_COMM_WORLD,&mpi_size);
@@ -1974,13 +1982,13 @@ extend_readInd(void)
/* fill dataset with test data */
dataset_fill(start, block, data_origin1);
if(VERBOSE_MED){
- MESG("data_array created");
- dataset_print(start, block, data_array1);
+ MESG("data_array created");
+ dataset_print(start, block, data_array1);
}
/* read data independently */
ret = H5Dread(dataset1, H5T_NATIVE_INT, mem_dataspace, file_dataspace,
- H5P_DEFAULT, data_array1);
+ H5P_DEFAULT, data_array1);
VRFY((ret >= 0), "H5Dread succeeded");
/* verify the read data with original expected data */
@@ -2009,13 +2017,13 @@ extend_readInd(void)
/* fill dataset with test data */
dataset_fill(start, block, data_origin1);
if(VERBOSE_MED){
- MESG("data_array created");
- dataset_print(start, block, data_array1);
+ MESG("data_array created");
+ dataset_print(start, block, data_array1);
}
/* read data independently */
ret = H5Dread(dataset2, H5T_NATIVE_INT, mem_dataspace, file_dataspace,
- H5P_DEFAULT, data_array1);
+ H5P_DEFAULT, data_array1);
VRFY((ret >= 0), "H5Dread succeeded");
/* verify the read data with original expected data */
@@ -2058,26 +2066,26 @@ void
extend_writeAll(void)
{
hid_t fid; /* HDF5 file ID */
- hid_t acc_tpl; /* File access templates */
- hid_t xfer_plist; /* Dataset transfer properties list */
- hid_t sid; /* Dataspace ID */
- hid_t file_dataspace; /* File dataspace ID */
- hid_t mem_dataspace; /* memory dataspace ID */
- hid_t dataset1, dataset2; /* Dataset ID */
+ hid_t acc_tpl; /* File access templates */
+ hid_t xfer_plist; /* Dataset transfer properties list */
+ hid_t sid; /* Dataspace ID */
+ hid_t file_dataspace; /* File dataspace ID */
+ hid_t mem_dataspace; /* memory dataspace ID */
+ hid_t dataset1, dataset2; /* Dataset ID */
const char *filename;
- hsize_t dims[RANK]; /* dataset dim sizes */
+ hsize_t dims[RANK]; /* dataset dim sizes */
hsize_t max_dims[RANK] =
- {H5S_UNLIMITED, H5S_UNLIMITED}; /* dataset maximum dim sizes */
- DATATYPE *data_array1 = NULL; /* data buffer */
- hsize_t chunk_dims[RANK]; /* chunk sizes */
- hid_t dataset_pl; /* dataset create prop. list */
+ {H5S_UNLIMITED, H5S_UNLIMITED}; /* dataset maximum dim sizes */
+ DATATYPE *data_array1 = NULL; /* data buffer */
+ hsize_t chunk_dims[RANK]; /* chunk sizes */
+ hid_t dataset_pl; /* dataset create prop. list */
- hsize_t start[RANK]; /* for hyperslab setting */
- hsize_t count[RANK]; /* for hyperslab setting */
- hsize_t stride[RANK]; /* for hyperslab setting */
- hsize_t block[RANK]; /* for hyperslab setting */
+ hsize_t start[RANK]; /* for hyperslab setting */
+ hsize_t count[RANK]; /* for hyperslab setting */
+ hsize_t stride[RANK]; /* for hyperslab setting */
+ hsize_t block[RANK]; /* for hyperslab setting */
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
int mpi_size, mpi_rank;
MPI_Comm comm = MPI_COMM_WORLD;
@@ -2085,7 +2093,7 @@ extend_writeAll(void)
filename = GetTestParameters();
if(VERBOSE_MED)
- printf("Extend independent write test on file %s\n", filename);
+ HDprintf("Extend independent write test on file %s\n", filename);
/* set up MPI parameters */
MPI_Comm_size(MPI_COMM_WORLD,&mpi_size);
@@ -2138,7 +2146,7 @@ extend_writeAll(void)
/* set up dataset storage chunk sizes and creation property list */
if(VERBOSE_MED)
- printf("chunks[]=%lu,%lu\n", (unsigned long)chunk_dims[0], (unsigned long)chunk_dims[1]);
+ HDprintf("chunks[]=%lu,%lu\n", (unsigned long)chunk_dims[0], (unsigned long)chunk_dims[1]);
dataset_pl = H5Pcreate(H5P_DATASET_CREATE);
VRFY((dataset_pl >= 0), "H5Pcreate succeeded");
ret = H5Pset_chunk(dataset_pl, RANK, chunk_dims);
@@ -2174,8 +2182,8 @@ extend_writeAll(void)
dataset_fill(start, block, data_array1);
MESG("data_array initialized");
if(VERBOSE_MED) {
- MESG("data_array created");
- dataset_print(start, block, data_array1);
+ MESG("data_array created");
+ dataset_print(start, block, data_array1);
}
/* create a memory dataspace independently */
@@ -2207,7 +2215,7 @@ extend_writeAll(void)
/* write data collectively */
ret = H5Dwrite(dataset1, H5T_NATIVE_INT, mem_dataspace, file_dataspace,
- xfer_plist, data_array1);
+ xfer_plist, data_array1);
VRFY((ret >= 0), "H5Dwrite succeeded");
/* release resource */
@@ -2226,8 +2234,8 @@ extend_writeAll(void)
dataset_fill(start, block, data_array1);
MESG("data_array initialized");
if(VERBOSE_MED){
- MESG("data_array created");
- dataset_print(start, block, data_array1);
+ MESG("data_array created");
+ dataset_print(start, block, data_array1);
}
/* create a memory dataspace independently */
@@ -2258,7 +2266,7 @@ extend_writeAll(void)
/* write data independently. Should fail. */
ret = H5Dwrite(dataset2, H5T_NATIVE_INT, mem_dataspace, file_dataspace,
- xfer_plist, data_array1);
+ xfer_plist, data_array1);
VRFY((ret < 0), "H5Dwrite failed as expected");
/* restore auto error reporting */
@@ -2279,7 +2287,7 @@ extend_writeAll(void)
/* write data independently */
ret = H5Dwrite(dataset2, H5T_NATIVE_INT, mem_dataspace, file_dataspace,
- xfer_plist, data_array1);
+ xfer_plist, data_array1);
VRFY((ret >= 0), "H5Dwrite succeeded");
/* release resource */
@@ -2308,23 +2316,23 @@ extend_writeAll(void)
void
extend_readAll(void)
{
- hid_t fid; /* HDF5 file ID */
- hid_t acc_tpl; /* File access templates */
- hid_t xfer_plist; /* Dataset transfer properties list */
- hid_t file_dataspace; /* File dataspace ID */
- hid_t mem_dataspace; /* memory dataspace ID */
- hid_t dataset1, dataset2; /* Dataset ID */
+ hid_t fid; /* HDF5 file ID */
+ hid_t acc_tpl; /* File access templates */
+ hid_t xfer_plist; /* Dataset transfer properties list */
+ hid_t file_dataspace; /* File dataspace ID */
+ hid_t mem_dataspace; /* memory dataspace ID */
+ hid_t dataset1, dataset2; /* Dataset ID */
const char *filename;
- hsize_t dims[RANK]; /* dataset dim sizes */
- DATATYPE *data_array1 = NULL; /* data buffer */
- DATATYPE *data_array2 = NULL; /* data buffer */
- DATATYPE *data_origin1 = NULL; /* expected data buffer */
+ hsize_t dims[RANK]; /* dataset dim sizes */
+ DATATYPE *data_array1 = NULL; /* data buffer */
+ DATATYPE *data_array2 = NULL; /* data buffer */
+ DATATYPE *data_origin1 = NULL; /* expected data buffer */
- hsize_t start[RANK]; /* for hyperslab setting */
- hsize_t count[RANK], stride[RANK]; /* for hyperslab setting */
- hsize_t block[RANK]; /* for hyperslab setting */
+ hsize_t start[RANK]; /* for hyperslab setting */
+ hsize_t count[RANK], stride[RANK]; /* for hyperslab setting */
+ hsize_t block[RANK]; /* for hyperslab setting */
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
int mpi_size, mpi_rank;
MPI_Comm comm = MPI_COMM_WORLD;
@@ -2332,7 +2340,7 @@ extend_readAll(void)
filename = GetTestParameters();
if(VERBOSE_MED)
- printf("Extend independent read test on file %s\n", filename);
+ HDprintf("Extend independent read test on file %s\n", filename);
/* set up MPI parameters */
MPI_Comm_size(MPI_COMM_WORLD,&mpi_size);
@@ -2404,8 +2412,8 @@ extend_readAll(void)
/* fill dataset with test data */
dataset_fill(start, block, data_origin1);
if(VERBOSE_MED){
- MESG("data_array created");
- dataset_print(start, block, data_array1);
+ MESG("data_array created");
+ dataset_print(start, block, data_array1);
}
/* set up the collective transfer properties list */
@@ -2421,7 +2429,7 @@ extend_readAll(void)
/* read data collectively */
ret = H5Dread(dataset1, H5T_NATIVE_INT, mem_dataspace, file_dataspace,
- xfer_plist, data_array1);
+ xfer_plist, data_array1);
VRFY((ret >= 0), "H5Dread succeeded");
/* verify the read data with original expected data */
@@ -2451,8 +2459,8 @@ extend_readAll(void)
/* fill dataset with test data */
dataset_fill(start, block, data_origin1);
if(VERBOSE_MED){
- MESG("data_array created");
- dataset_print(start, block, data_array1);
+ MESG("data_array created");
+ dataset_print(start, block, data_array1);
}
/* set up the collective transfer properties list */
@@ -2468,7 +2476,7 @@ extend_readAll(void)
/* read data collectively */
ret = H5Dread(dataset2, H5T_NATIVE_INT, mem_dataspace, file_dataspace,
- xfer_plist, data_array1);
+ xfer_plist, data_array1);
VRFY((ret >= 0), "H5Dread succeeded");
/* verify the read data with original expected data */
@@ -2505,27 +2513,27 @@ void
compress_readAll(void)
{
hid_t fid; /* HDF5 file ID */
- hid_t acc_tpl; /* File access templates */
+ hid_t acc_tpl; /* File access templates */
hid_t dcpl; /* Dataset creation property list */
- hid_t xfer_plist; /* Dataset transfer properties list */
- hid_t dataspace; /* Dataspace ID */
- hid_t dataset; /* Dataset ID */
+ hid_t xfer_plist; /* Dataset transfer properties list */
+ hid_t dataspace; /* Dataspace ID */
+ hid_t dataset; /* Dataset ID */
int rank=1; /* Dataspace rank */
hsize_t dim=dim0; /* Dataspace dimensions */
unsigned u; /* Local index variable */
unsigned chunk_opts; /* Chunk options */
unsigned disable_partial_chunk_filters; /* Whether filters are disabled on partial chunks */
- DATATYPE *data_read = NULL; /* data buffer */
+ DATATYPE *data_read = NULL; /* data buffer */
DATATYPE *data_orig = NULL; /* expected data buffer */
const char *filename;
MPI_Comm comm = MPI_COMM_WORLD;
MPI_Info info = MPI_INFO_NULL;
int mpi_size, mpi_rank;
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
filename = GetTestParameters();
if(VERBOSE_MED)
- printf("Collective chunked dataset read test on file %s\n", filename);
+ HDprintf("Collective chunked dataset read test on file %s\n", filename);
/* Retrieve MPI parameters */
MPI_Comm_size(comm,&mpi_size);
@@ -2646,7 +2654,7 @@ compress_readAll(void)
/* Verify data read */
for(u=0; u<dim; u++)
if(data_orig[u]!=data_read[u]) {
- printf("Line #%d: written!=retrieved: data_orig[%u]=%d, data_read[%u]=%d\n",__LINE__,
+ HDprintf("Line #%d: written!=retrieved: data_orig[%u]=%d, data_read[%u]=%d\n",__LINE__,
(unsigned)u,data_orig[u],(unsigned)u,data_read[u]);
nerrors++;
}
@@ -2687,26 +2695,26 @@ void
none_selection_chunk(void)
{
hid_t fid; /* HDF5 file ID */
- hid_t acc_tpl; /* File access templates */
- hid_t xfer_plist; /* Dataset transfer properties list */
- hid_t sid; /* Dataspace ID */
- hid_t file_dataspace; /* File dataspace ID */
- hid_t mem_dataspace; /* memory dataspace ID */
- hid_t dataset1, dataset2; /* Dataset ID */
+ hid_t acc_tpl; /* File access templates */
+ hid_t xfer_plist; /* Dataset transfer properties list */
+ hid_t sid; /* Dataspace ID */
+ hid_t file_dataspace; /* File dataspace ID */
+ hid_t mem_dataspace; /* memory dataspace ID */
+ hid_t dataset1, dataset2; /* Dataset ID */
const char *filename;
- hsize_t dims[RANK]; /* dataset dim sizes */
- DATATYPE *data_origin = NULL; /* data buffer */
- DATATYPE *data_array = NULL; /* data buffer */
- hsize_t chunk_dims[RANK]; /* chunk sizes */
- hid_t dataset_pl; /* dataset create prop. list */
-
- hsize_t start[RANK]; /* for hyperslab setting */
- hsize_t count[RANK]; /* for hyperslab setting */
- hsize_t stride[RANK]; /* for hyperslab setting */
- hsize_t block[RANK]; /* for hyperslab setting */
- hsize_t mstart[RANK]; /* for data buffer in memory */
-
- herr_t ret; /* Generic return value */
+ hsize_t dims[RANK]; /* dataset dim sizes */
+ DATATYPE *data_origin = NULL; /* data buffer */
+ DATATYPE *data_array = NULL; /* data buffer */
+ hsize_t chunk_dims[RANK]; /* chunk sizes */
+ hid_t dataset_pl; /* dataset create prop. list */
+
+ hsize_t start[RANK]; /* for hyperslab setting */
+ hsize_t count[RANK]; /* for hyperslab setting */
+ hsize_t stride[RANK]; /* for hyperslab setting */
+ hsize_t block[RANK]; /* for hyperslab setting */
+ hsize_t mstart[RANK]; /* for data buffer in memory */
+
+ herr_t ret; /* Generic return value */
int mpi_size, mpi_rank;
MPI_Comm comm = MPI_COMM_WORLD;
@@ -2714,7 +2722,7 @@ none_selection_chunk(void)
filename = GetTestParameters();
if(VERBOSE_MED)
- printf("Extend independent write test on file %s\n", filename);
+ HDprintf("Extend independent write test on file %s\n", filename);
/* set up MPI parameters */
MPI_Comm_size(MPI_COMM_WORLD,&mpi_size);
@@ -2745,7 +2753,7 @@ none_selection_chunk(void)
/* set up dataset storage chunk sizes and creation property list */
if(VERBOSE_MED)
- printf("chunks[]=%lu,%lu\n", (unsigned long)chunk_dims[0], (unsigned long)chunk_dims[1]);
+ HDprintf("chunks[]=%lu,%lu\n", (unsigned long)chunk_dims[0], (unsigned long)chunk_dims[1]);
dataset_pl = H5Pcreate(H5P_DATASET_CREATE);
VRFY((dataset_pl >= 0), "H5Pcreate succeeded");
ret = H5Pset_chunk(dataset_pl, RANK, chunk_dims);
@@ -2789,8 +2797,8 @@ none_selection_chunk(void)
dataset_fill(mstart, block, data_origin);
MESG("data_array initialized");
if(VERBOSE_MED){
- MESG("data_array created");
- dataset_print(mstart, block, data_origin);
+ MESG("data_array created");
+ dataset_print(mstart, block, data_origin);
}
}
@@ -2824,12 +2832,12 @@ none_selection_chunk(void)
/* write data collectively */
ret = H5Dwrite(dataset1, H5T_NATIVE_INT, mem_dataspace, file_dataspace,
- xfer_plist, data_origin);
+ xfer_plist, data_origin);
VRFY((ret >= 0), "H5Dwrite succeeded");
/* read data independently */
ret = H5Dread(dataset1, H5T_NATIVE_INT, mem_dataspace, file_dataspace,
- H5P_DEFAULT, data_array);
+ H5P_DEFAULT, data_array);
VRFY((ret >= 0), "");
/* verify the read data with original expected data */
@@ -2846,12 +2854,12 @@ none_selection_chunk(void)
/* write data collectively */
ret = H5Dwrite(dataset2, H5T_NATIVE_INT, mem_dataspace, file_dataspace,
- xfer_plist, data_origin);
+ xfer_plist, data_origin);
VRFY((ret >= 0), "H5Dwrite succeeded");
/* read data independently */
ret = H5Dread(dataset2, H5T_NATIVE_INT, mem_dataspace, file_dataspace,
- H5P_DEFAULT, data_array);
+ H5P_DEFAULT, data_array);
VRFY((ret >= 0), "");
/* verify the read data with original expected data */
@@ -2883,20 +2891,20 @@ none_selection_chunk(void)
if(data_array) HDfree(data_array);
}
-
+
/* Function: test_actual_io_mode
*
- * Purpose: tests one specific case of collective I/O and checks that the
+ * Purpose: tests one specific case of collective I/O and checks that the
* actual_chunk_opt_mode property and the actual_io_mode
* properties in the DXPL have the correct values.
*
* Input: selection_mode: changes the way processes select data from the space, as well
* as some dxpl flags to get collective I/O to break in different ways.
- *
+ *
* The relevant I/O function and expected response for each mode:
* TEST_ACTUAL_IO_MULTI_CHUNK_IND:
* H5D_mpi_chunk_collective_io, each process reports independent I/O
- *
+ *
* TEST_ACTUAL_IO_MULTI_CHUNK_COL:
* H5D_mpi_chunk_collective_io, each process reports collective I/O
*
@@ -2908,7 +2916,7 @@ none_selection_chunk(void)
* collective, the rest report independent I/O
*
* TEST_ACTUAL_IO_DIRECT_MULTI_CHUNK_IND:
- * Same test TEST_ACTUAL_IO_MULTI_CHUNK_IND.
+ * Same test TEST_ACTUAL_IO_MULTI_CHUNK_IND.
* Set directly go to multi-chunk-io without num threshold calc.
* TEST_ACTUAL_IO_DIRECT_MULTI_CHUNK_COL:
* Same test TEST_ACTUAL_IO_MULTI_CHUNK_COL.
@@ -2933,20 +2941,20 @@ none_selection_chunk(void)
*
* Note: DIRECT_MULTI_CHUNK_MIX and DIRECT_MULTI_CHUNK_MIX_DISAGREE
* is not needed as they are covered by DIRECT_CHUNK_MIX and
- * MULTI_CHUNK_MIX_DISAGREE cases. _DIRECT_ cases are only for testing
+ * MULTI_CHUNK_MIX_DISAGREE cases. _DIRECT_ cases are only for testing
* path way to multi-chunk-io by H5FD_MPIO_CHUNK_MULTI_IO insted of num-threshold.
*
* Modification:
- * - Refctore to remove multi-chunk-without-opimization test and update for
- * testing direct to multi-chunk-io
+ * - Refctore to remove multi-chunk-without-opimization test and update for
+ * testing direct to multi-chunk-io
* Programmer: Jonathan Kim
* Date: 2012-10-10
*
- *
+ *
* Programmer: Jacob Gruber
* Date: 2011-04-06
*/
-static void
+static void
test_actual_io_mode(int selection_mode) {
H5D_mpio_actual_chunk_opt_mode_t actual_chunk_opt_mode_write = -1;
H5D_mpio_actual_chunk_opt_mode_t actual_chunk_opt_mode_read = -1;
@@ -2960,7 +2968,7 @@ test_actual_io_mode(int selection_mode) {
hbool_t multi_chunk_io;
hbool_t is_chunked;
hbool_t is_collective;
- int mpi_size = -1;
+ int mpi_size = -1;
int mpi_rank = -1;
int length;
int * buffer;
@@ -2985,12 +2993,12 @@ test_actual_io_mode(int selection_mode) {
hsize_t block[RANK];
char message[256];
herr_t ret;
-
+
/* Set up some flags to make some future if statements slightly more readable */
direct_multi_chunk_io = (
selection_mode == TEST_ACTUAL_IO_DIRECT_MULTI_CHUNK_IND ||
selection_mode == TEST_ACTUAL_IO_DIRECT_MULTI_CHUNK_COL );
-
+
/* Note: RESET performs the same tests as MULTI_CHUNK_MIX_DISAGREE and then
* tests independent I/O
*/
@@ -3000,11 +3008,11 @@ test_actual_io_mode(int selection_mode) {
selection_mode == TEST_ACTUAL_IO_MULTI_CHUNK_MIX ||
selection_mode == TEST_ACTUAL_IO_MULTI_CHUNK_MIX_DISAGREE ||
selection_mode == TEST_ACTUAL_IO_RESET );
-
+
is_chunked = (
selection_mode != TEST_ACTUAL_IO_CONTIGUOUS &&
selection_mode != TEST_ACTUAL_IO_NO_COLLECTIVE);
-
+
is_collective = selection_mode != TEST_ACTUAL_IO_NO_COLLECTIVE;
/* Set up MPI parameters */
@@ -3012,7 +3020,7 @@ test_actual_io_mode(int selection_mode) {
MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank);
MPI_Barrier(MPI_COMM_WORLD);
-
+
HDassert(mpi_size >= 1);
mpi_comm = MPI_COMM_WORLD;
@@ -3029,7 +3037,7 @@ test_actual_io_mode(int selection_mode) {
fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl);
VRFY((fid >= 0), "H5Fcreate succeeded");
- /* Create the basic Space */
+ /* Create the basic Space */
dims[0] = dim0;
dims[1] = dim1;
sid = H5Screate_simple (RANK, dims, NULL);
@@ -3057,10 +3065,10 @@ test_actual_io_mode(int selection_mode) {
file_space = H5Dget_space(dataset);
VRFY((file_space >= 0), "H5Dget_space succeeded");
- /* Choose a selection method based on the type of I/O we want to occur,
+ /* Choose a selection method based on the type of I/O we want to occur,
* and also set up some selection-dependeent test info. */
switch(selection_mode) {
-
+
/* Independent I/O with optimization */
case TEST_ACTUAL_IO_MULTI_CHUNK_IND:
case TEST_ACTUAL_IO_DIRECT_MULTI_CHUNK_IND:
@@ -3069,7 +3077,7 @@ test_actual_io_mode(int selection_mode) {
* independent.
*/
slab_set(mpi_rank, mpi_size, start, count, stride, block, BYROW);
-
+
test_name = "Multi Chunk - Independent";
actual_chunk_opt_mode_expected = H5D_MPIO_MULTI_CHUNK;
actual_io_mode_expected = H5D_MPIO_CHUNK_INDEPENDENT;
@@ -3083,7 +3091,7 @@ test_actual_io_mode(int selection_mode) {
* selections to each chunk, the operation is purely collective.
*/
slab_set(mpi_rank, mpi_size, start, count, stride, block, BYCOL);
-
+
test_name = "Multi Chunk - Collective";
actual_chunk_opt_mode_expected = H5D_MPIO_MULTI_CHUNK;
if(mpi_size > 1)
@@ -3091,7 +3099,7 @@ test_actual_io_mode(int selection_mode) {
else
actual_io_mode_expected = H5D_MPIO_CHUNK_INDEPENDENT;
break;
-
+
/* Mixed I/O with optimization */
case TEST_ACTUAL_IO_MULTI_CHUNK_MIX:
/* A chunk will be assigned collective I/O only if it is selected by each
@@ -3102,7 +3110,7 @@ test_actual_io_mode(int selection_mode) {
* assigned independent I/O. Each process will access one chunk collectively
* and at least one chunk independently, reporting mixed I/O.
*/
-
+
if(mpi_rank == 0) {
/* Select the first column */
slab_set(mpi_rank, mpi_size, start, count, stride, block, BYCOL);
@@ -3117,7 +3125,7 @@ test_actual_io_mode(int selection_mode) {
start[0] = 0;
start[1] = mpi_rank*block[1];
}
-
+
test_name = "Multi Chunk - Mixed";
actual_chunk_opt_mode_expected = H5D_MPIO_MULTI_CHUNK;
actual_io_mode_expected = H5D_MPIO_CHUNK_MIXED;
@@ -3127,7 +3135,7 @@ test_actual_io_mode(int selection_mode) {
* performed. To acheive this, we have RESET perform collective I/O (which would change
* the values from the defaults) followed by independent I/O (which should report the
* default values). RESET doesn't need to have a unique selection, so we reuse
- * MULTI_CHUMK_MIX_DISAGREE, which was chosen because it is a complex case that works
+ * MULTI_CHUMK_MIX_DISAGREE, which was chosen because it is a complex case that works
* on all builds. The independent section of RESET can be found at the end of this function.
*/
case TEST_ACTUAL_IO_RESET:
@@ -3136,7 +3144,7 @@ test_actual_io_mode(int selection_mode) {
case TEST_ACTUAL_IO_MULTI_CHUNK_MIX_DISAGREE:
/* A chunk will be assigned collective I/O only if it is selected by each
* process. To get mixed I/O with disagreement, assign process n to the
- * first chunk and the nth chunk. The first chunk, selected by all, is
+ * first chunk and the nth chunk. The first chunk, selected by all, is
* assgigned collective I/O, while each other process gets independent I/O.
* Since the root process with only access the first chunk, it will report
* collective I/O. The subsequent processes will access the first chunk
@@ -3158,13 +3166,13 @@ test_actual_io_mode(int selection_mode) {
start[0] = 0;
start[1] = mpi_rank*block[1];
}
-
+
/* If the testname was not already set by the RESET case */
if (selection_mode == TEST_ACTUAL_IO_RESET)
test_name = "RESET";
else
test_name = "Multi Chunk - Mixed (Disagreement)";
-
+
actual_chunk_opt_mode_expected = H5D_MPIO_MULTI_CHUNK;
if(mpi_size > 1) {
if(mpi_rank == 0)
@@ -3174,14 +3182,14 @@ test_actual_io_mode(int selection_mode) {
}
else
actual_io_mode_expected = H5D_MPIO_CHUNK_INDEPENDENT;
-
- break;
+
+ break;
/* Linked Chunk I/O */
- case TEST_ACTUAL_IO_LINK_CHUNK:
+ case TEST_ACTUAL_IO_LINK_CHUNK:
/* Nothing special; link chunk I/O is forced in the dxpl settings. */
slab_set(mpi_rank, mpi_size, start, count, stride, block, BYROW);
-
+
test_name = "Link Chunk";
actual_chunk_opt_mode_expected = H5D_MPIO_LINK_CHUNK;
actual_io_mode_expected = H5D_MPIO_CHUNK_COLLECTIVE;
@@ -3192,7 +3200,7 @@ test_actual_io_mode(int selection_mode) {
/* A non overlapping, regular selection in a contiguous dataset leads to
* collective I/O */
slab_set(mpi_rank, mpi_size, start, count, stride, block, BYROW);
-
+
test_name = "Contiguous";
actual_chunk_opt_mode_expected = H5D_MPIO_NO_CHUNK_OPTIMIZATION;
actual_io_mode_expected = H5D_MPIO_CONTIGUOUS_COLLECTIVE;
@@ -3200,7 +3208,7 @@ test_actual_io_mode(int selection_mode) {
case TEST_ACTUAL_IO_NO_COLLECTIVE:
slab_set(mpi_rank, mpi_size, start, count, stride, block, BYROW);
-
+
test_name = "Independent";
actual_chunk_opt_mode_expected = H5D_MPIO_NO_CHUNK_OPTIMIZATION;
actual_io_mode_expected = H5D_MPIO_NO_COLLECTIVE;
@@ -3215,13 +3223,13 @@ test_actual_io_mode(int selection_mode) {
ret = H5Sselect_hyperslab(file_space, H5S_SELECT_SET, start, stride, count, block);
VRFY((ret >= 0), "H5Sset_hyperslab succeeded");
-
+
/* Create a memory dataspace mirroring the dataset and select the same hyperslab
- * as in the file space.
+ * as in the file space.
*/
mem_space = H5Screate_simple (RANK, dims, NULL);
VRFY((mem_space >= 0), "mem_space created");
-
+
ret = H5Sselect_hyperslab(mem_space, H5S_SELECT_SET, start, stride, count, block);
VRFY((ret >= 0), "H5Sset_hyperslab succeeded");
@@ -3230,22 +3238,22 @@ test_actual_io_mode(int selection_mode) {
/* Allocate and initialize the buffer */
buffer = (int *)HDmalloc(sizeof(int) * length);
- VRFY((buffer != NULL), "HDmalloc of buffer succeeded");
- for(i = 0; i < length; i++)
+ VRFY((buffer != NULL), "HDmalloc of buffer succeeded");
+ for(i = 0; i < length; i++)
buffer[i] = i;
/* Set up the dxpl for the write */
dxpl_write = H5Pcreate(H5P_DATASET_XFER);
VRFY((dxpl_write >= 0), "H5Pcreate(H5P_DATASET_XFER) succeeded");
-
+
/* Set collective I/O properties in the dxpl. */
if(is_collective) {
/* Request collective I/O */
ret = H5Pset_dxpl_mpio(dxpl_write, H5FD_MPIO_COLLECTIVE);
VRFY((ret >= 0), "H5Pset_dxpl_mpio succeeded");
-
- /* Set the threshold number of processes per chunk to twice mpi_size.
- * This will prevent the threshold from ever being met, thus forcing
+
+ /* Set the threshold number of processes per chunk to twice mpi_size.
+ * This will prevent the threshold from ever being met, thus forcing
* multi chunk io instead of link chunk io.
* This is via deault.
*/
@@ -3283,12 +3291,12 @@ test_actual_io_mode(int selection_mode) {
ret = H5Pget_mpio_actual_chunk_opt_mode(dxpl_write, &actual_chunk_opt_mode_write);
VRFY((ret >= 0), "retriving actual chunk opt mode succeeded" );
-
+
/* Read */
ret = H5Dread(dataset, data_type, mem_space, file_space, dxpl_read, buffer);
if(ret < 0) H5Eprint2(H5E_DEFAULT, stdout);
VRFY((ret >= 0), "H5Dread() dataset multichunk read succeeded");
-
+
/* Retreive Actual io values */
ret = H5Pget_mpio_actual_io_mode(dxpl_read, &actual_io_mode_read);
VRFY((ret >= 0), "retriving actual io mode succeeded" );
@@ -3304,9 +3312,9 @@ test_actual_io_mode(int selection_mode) {
/* Test values */
if(actual_chunk_opt_mode_expected != (H5D_mpio_actual_chunk_opt_mode_t) -1 && actual_io_mode_expected != (H5D_mpio_actual_io_mode_t) -1) {
- sprintf(message, "Actual Chunk Opt Mode has the correct value for %s.\n",test_name);
+ HDsprintf(message, "Actual Chunk Opt Mode has the correct value for %s.\n",test_name);
VRFY((actual_chunk_opt_mode_write == actual_chunk_opt_mode_expected), message);
- sprintf(message, "Actual IO Mode has the correct value for %s.\n",test_name);
+ HDsprintf(message, "Actual IO Mode has the correct value for %s.\n",test_name);
VRFY((actual_io_mode_write == actual_io_mode_expected), message);
} else {
HDfprintf(stderr, "%s %d -> (%d,%d)\n", test_name, mpi_rank,
@@ -3338,7 +3346,7 @@ test_actual_io_mode(int selection_mode) {
"actual_chunk_opt_mode has correct value for reset write (independent)");
VRFY(actual_io_mode_write == H5D_MPIO_NO_COLLECTIVE,
"actual_io_mode has correct value for reset write (independent)");
-
+
/* Read */
ret = H5Dread(dataset, data_type, H5S_ALL, H5S_ALL, dxpl_read, buffer);
VRFY((ret >= 0), "H5Dwrite() dataset multichunk write succeeded");
@@ -3348,7 +3356,7 @@ test_actual_io_mode(int selection_mode) {
VRFY( (ret >= 0), "retriving actual io mode succeeded" );
ret = H5Pget_mpio_actual_chunk_opt_mode(dxpl_read, &actual_chunk_opt_mode_read);
VRFY( (ret >= 0), "retriving actual chunk opt mode succeeded" );
-
+
VRFY(actual_chunk_opt_mode_read == H5D_MPIO_NO_CHUNK_OPTIMIZATION,
"actual_chunk_opt_mode has correct value for reset read (independent)");
VRFY(actual_io_mode_read == H5D_MPIO_NO_COLLECTIVE,
@@ -3370,10 +3378,10 @@ test_actual_io_mode(int selection_mode) {
return;
}
-
+
/* Function: actual_io_mode_tests
*
- * Purpose: Tests all possible cases of the actual_io_mode property.
+ * Purpose: Tests all possible cases of the actual_io_mode property.
*
* Programmer: Jacob Gruber
* Date: 2011-04-06
@@ -3384,10 +3392,10 @@ actual_io_mode_tests(void) {
int mpi_rank = -1;
MPI_Comm_size(MPI_COMM_WORLD, &mpi_size);
MPI_Comm_size(MPI_COMM_WORLD, &mpi_rank);
-
+
test_actual_io_mode(TEST_ACTUAL_IO_NO_COLLECTIVE);
-
- /*
+
+ /*
* Test multi-chunk-io via proc_num threshold
*/
test_actual_io_mode(TEST_ACTUAL_IO_MULTI_CHUNK_IND);
@@ -3398,10 +3406,10 @@ actual_io_mode_tests(void) {
test_actual_io_mode(TEST_ACTUAL_IO_MULTI_CHUNK_MIX);
else
HDfprintf(stdout, "Multi Chunk Mixed test requires 3 proceses minimum\n");
-
+
test_actual_io_mode(TEST_ACTUAL_IO_MULTI_CHUNK_MIX_DISAGREE);
- /*
+ /*
* Test multi-chunk-io via setting direct property
*/
test_actual_io_mode(TEST_ACTUAL_IO_DIRECT_MULTI_CHUNK_IND);
@@ -3409,31 +3417,31 @@ actual_io_mode_tests(void) {
test_actual_io_mode(TEST_ACTUAL_IO_LINK_CHUNK);
test_actual_io_mode(TEST_ACTUAL_IO_CONTIGUOUS);
-
+
test_actual_io_mode(TEST_ACTUAL_IO_RESET);
return;
}
-/*
+/*
* Function: test_no_collective_cause_mode
*
- * Purpose:
- * tests cases for broken collective I/O and checks that the
+ * Purpose:
+ * tests cases for broken collective I/O and checks that the
* H5Pget_mpio_no_collective_cause properties in the DXPL have the correct values.
*
- * Input:
+ * Input:
* selection_mode: various mode to cause broken collective I/O
* Note: Originally, each TEST case is supposed to be used alone.
* After some discussion, this is updated to take multiple TEST cases
- * with '|'. However there is no error check for any of combined
+ * with '|'. However there is no error check for any of combined
* test cases, so a tester is responsible to understand and feed
* proper combination of TESTs if needed.
*
- *
+ *
* TEST_COLLECTIVE:
* Test for regular collective I/O without cause of breaking.
* Just to test normal behavior.
- *
+ *
* TEST_SET_INDEPENDENT:
* Test for Independent I/O as the cause of breaking collective I/O.
*
@@ -3445,7 +3453,7 @@ actual_io_mode_tests(void) {
*
* TEST_NOT_SIMPLE_OR_SCALAR_DATASPACES:
* Test for NULL dataspace as the cause of breaking collective I/O.
- *
+ *
* TEST_NOT_CONTIGUOUS_OR_CHUNKED_DATASET_COMPACT:
* Test for Compact layout as the cause of breaking collective I/O.
*
@@ -3454,17 +3462,17 @@ actual_io_mode_tests(void) {
*
* TEST_FILTERS:
* Test for using filter (checksum) as the cause of breaking collective I/O.
- * Note: TEST_FILTERS mode will not work until H5Dcreate and H5write is supported for mpio and filter feature. Use test_no_collective_cause_mode_filter() function instead.
+ * Note: TEST_FILTERS mode will not work until H5Dcreate and H5write is supported for mpio and filter feature. Use test_no_collective_cause_mode_filter() function instead.
+ *
*
- *
* Programmer: Jonathan Kim
* Date: Aug, 2012
*/
#define DSET_NOCOLCAUSE "nocolcause"
#define NELM 2
#define FILE_EXTERNAL "nocolcause_extern.data"
-static void
-test_no_collective_cause_mode(int selection_mode)
+static void
+test_no_collective_cause_mode(int selection_mode)
{
uint32_t no_collective_cause_local_write = 0;
uint32_t no_collective_cause_local_read = 0;
@@ -3478,7 +3486,7 @@ test_no_collective_cause_mode(int selection_mode)
const char * test_name;
hbool_t is_chunked=1;
hbool_t is_independent=0;
- int mpi_size = -1;
+ int mpi_size = -1;
int mpi_rank = -1;
int length;
int * buffer;
@@ -3502,7 +3510,7 @@ test_no_collective_cause_mode(int selection_mode)
H5Z_filter_t filter_info;
#endif /* LATER */
/* set to global value as default */
- int l_facc_type = facc_type;
+ int l_facc_type = facc_type;
char message[256];
/* Set up MPI parameters */
@@ -3564,7 +3572,7 @@ test_no_collective_cause_mode(int selection_mode)
sid = H5Screate_simple (RANK, dims, NULL);
VRFY((sid >= 0), "H5Screate_simple succeeded");
}
-
+
filename = (const char *)GetTestParameters();
HDassert(filename != NULL);
@@ -3589,20 +3597,19 @@ test_no_collective_cause_mode(int selection_mode)
/* Create the dataset */
- dataset = H5Dcreate2(fid, "nocolcause", data_type, sid, H5P_DEFAULT,
- dcpl, H5P_DEFAULT);
+ dataset = H5Dcreate2(fid, "nocolcause", data_type, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT);
VRFY((dataset >= 0), "H5Dcreate2() dataset succeeded");
- /*
- * Set expected causes and some tweaks based on the type of test
+ /*
+ * Set expected causes and some tweaks based on the type of test
*/
if (selection_mode & TEST_DATATYPE_CONVERSION) {
test_name = "Broken Collective I/O - Datatype Conversion";
no_collective_cause_local_expected |= H5D_MPIO_DATATYPE_CONVERSION;
no_collective_cause_global_expected |= H5D_MPIO_DATATYPE_CONVERSION;
/* set different sign to trigger type conversion */
- data_type = H5T_NATIVE_UINT;
+ data_type = H5T_NATIVE_UINT;
}
if (selection_mode & TEST_DATA_TRANSFORMS) {
@@ -3667,14 +3674,14 @@ test_no_collective_cause_mode(int selection_mode)
/* Allocate and initialize the buffer */
buffer = (int *)HDmalloc(sizeof(int) * length);
- VRFY((buffer != NULL), "HDmalloc of buffer succeeded");
- for(i = 0; i < length; i++)
+ VRFY((buffer != NULL), "HDmalloc of buffer succeeded");
+ for(i = 0; i < length; i++)
buffer[i] = i;
/* Set up the dxpl for the write */
dxpl_write = H5Pcreate(H5P_DATASET_XFER);
VRFY((dxpl_write >= 0), "H5Pcreate(H5P_DATASET_XFER) succeeded");
-
+
if(is_independent) {
/* Set Independent I/O */
ret = H5Pset_dxpl_mpio(dxpl_write, H5FD_MPIO_INDEPENDENT);
@@ -3684,17 +3691,17 @@ test_no_collective_cause_mode(int selection_mode)
/* Set Collective I/O */
ret = H5Pset_dxpl_mpio(dxpl_write, H5FD_MPIO_COLLECTIVE);
VRFY((ret >= 0), "H5Pset_dxpl_mpio succeeded");
-
+
}
if (selection_mode & TEST_DATA_TRANSFORMS) {
- ret = H5Pset_data_transform (dxpl_write, "x+1");
+ ret = H5Pset_data_transform (dxpl_write, "x+1");
VRFY((ret >= 0), "H5Pset_data_transform succeeded");
}
/*---------------------
* Test Write access
- *---------------------*/
+ *---------------------*/
/* Write */
ret = H5Dwrite(dataset, data_type, mem_space, file_space, dxpl_write, buffer);
@@ -3709,7 +3716,7 @@ test_no_collective_cause_mode(int selection_mode)
/*---------------------
* Test Read access
- *---------------------*/
+ *---------------------*/
/* Make a copy of the dxpl to test the read operation */
dxpl_read = H5Pcopy(dxpl_write);
@@ -3720,7 +3727,7 @@ test_no_collective_cause_mode(int selection_mode)
if(ret < 0) H5Eprint2(H5E_DEFAULT, stdout);
VRFY((ret >= 0), "H5Dread() dataset multichunk read succeeded");
-
+
/* Get the cause of broken collective I/O */
ret = H5Pget_mpio_no_collective_cause (dxpl_read, &no_collective_cause_local_read, &no_collective_cause_global_read);
VRFY((ret >= 0), "retriving no collective cause succeeded" );
@@ -3730,13 +3737,13 @@ test_no_collective_cause_mode(int selection_mode)
"reading and writing are the same for local cause of Broken Collective I/O");
VRFY((no_collective_cause_global_read == no_collective_cause_global_write),
"reading and writing are the same for global cause of Broken Collective I/O");
-
+
/* Test values */
- memset (message, 0, sizeof (message));
- sprintf(message, "Local cause of Broken Collective I/O has the correct value for %s.\n",test_name);
+ HDmemset (message, 0, sizeof (message));
+ HDsprintf(message, "Local cause of Broken Collective I/O has the correct value for %s.\n",test_name);
VRFY((no_collective_cause_local_write == no_collective_cause_local_expected), message);
- memset (message, 0, sizeof (message));
- sprintf(message, "Global cause of Broken Collective I/O has the correct value for %s.\n",test_name);
+ HDmemset (message, 0, sizeof (message));
+ HDsprintf(message, "Global cause of Broken Collective I/O has the correct value for %s.\n",test_name);
VRFY((no_collective_cause_global_write == no_collective_cause_global_expected), message);
/* Release some resources */
@@ -3768,28 +3775,28 @@ test_no_collective_cause_mode(int selection_mode)
}
-/*
+/*
* Function: test_no_collective_cause_mode_filter
*
- * Purpose:
- * Test specific for using filter as a caus of broken collective I/O and
+ * Purpose:
+ * Test specific for using filter as a caus of broken collective I/O and
* checks that the H5Pget_mpio_no_collective_cause properties in the DXPL
* have the correct values.
*
- * NOTE:
- * This is a temporary function.
+ * NOTE:
+ * This is a temporary function.
* test_no_collective_cause_mode(TEST_FILTERS) will replace this when
* H5Dcreate and H5write support for mpio and filter feature.
*
- * Input:
+ * Input:
* TEST_FILTERS_READ:
* Test for using filter (checksum) as the cause of breaking collective I/O.
- *
+ *
* Programmer: Jonathan Kim
* Date: Aug, 2012
*/
-static void
-test_no_collective_cause_mode_filter(int selection_mode)
+static void
+test_no_collective_cause_mode_filter(int selection_mode)
{
uint32_t no_collective_cause_local_read = 0;
uint32_t no_collective_cause_local_expected = 0;
@@ -3799,7 +3806,7 @@ test_no_collective_cause_mode_filter(int selection_mode)
const char * filename;
const char * test_name;
hbool_t is_chunked=1;
- int mpi_size = -1;
+ int mpi_size = -1;
int mpi_rank = -1;
int length;
int * buffer;
@@ -3829,7 +3836,7 @@ test_no_collective_cause_mode_filter(int selection_mode)
MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank);
MPI_Barrier(MPI_COMM_WORLD);
-
+
HDassert(mpi_size >= 1);
mpi_comm = MPI_COMM_WORLD;
@@ -3855,12 +3862,12 @@ test_no_collective_cause_mode_filter(int selection_mode)
VRFY(0, "Unexpected mode, only test for TEST_FILTERS_READ.");
}
- /* Create the basic Space */
+ /* Create the basic Space */
dims[0] = dim0;
dims[1] = dim1;
sid = H5Screate_simple (RANK, dims, NULL);
VRFY((sid >= 0), "H5Screate_simple succeeded");
-
+
filename = (const char *)GetTestParameters();
HDassert(filename != NULL);
@@ -3883,8 +3890,7 @@ test_no_collective_cause_mode_filter(int selection_mode)
/* Create the dataset */
- dataset = H5Dcreate2(fid, DSET_NOCOLCAUSE, data_type, sid, H5P_DEFAULT,
- dcpl, H5P_DEFAULT);
+ dataset = H5Dcreate2(fid, DSET_NOCOLCAUSE, data_type, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT);
VRFY((dataset >= 0), "H5Dcreate2() dataset succeeded");
#ifdef LATER /* fletcher32 */
@@ -3907,16 +3913,16 @@ test_no_collective_cause_mode_filter(int selection_mode)
/* Allocate and initialize the buffer */
buffer = (int *)HDmalloc(sizeof(int) * length);
- VRFY((buffer != NULL), "HDmalloc of buffer succeeded");
- for(i = 0; i < length; i++)
+ VRFY((buffer != NULL), "HDmalloc of buffer succeeded");
+ for(i = 0; i < length; i++)
buffer[i] = i;
/* Set up the dxpl for the write */
dxpl = H5Pcreate(H5P_DATASET_XFER);
VRFY((dxpl >= 0), "H5Pcreate(H5P_DATASET_XFER) succeeded");
-
+
if (selection_mode == TEST_FILTERS_READ) {
- /* To test read in collective I/O mode , write in independent mode
+ /* To test read in collective I/O mode , write in independent mode
* because write fails with mpio + filter */
ret = H5Pset_dxpl_mpio(dxpl, H5FD_MPIO_INDEPENDENT);
VRFY((ret >= 0), "H5Pset_dxpl_mpio succeeded");
@@ -3926,7 +3932,7 @@ test_no_collective_cause_mode_filter(int selection_mode)
ret = H5Pset_dxpl_mpio(dxpl, H5FD_MPIO_COLLECTIVE);
VRFY((ret >= 0), "H5Pset_dxpl_mpio succeeded");
}
-
+
/* Write */
ret = H5Dwrite(dataset, data_type, mem_space, file_space, dxpl, buffer);
@@ -3967,17 +3973,17 @@ test_no_collective_cause_mode_filter(int selection_mode)
if(ret < 0) H5Eprint2(H5E_DEFAULT, stdout);
VRFY((ret >= 0), "H5Dread() dataset multichunk read succeeded");
-
+
/* Get the cause of broken collective I/O */
ret = H5Pget_mpio_no_collective_cause (dxpl, &no_collective_cause_local_read, &no_collective_cause_global_read);
VRFY((ret >= 0), "retriving no collective cause succeeded" );
/* Test values */
- memset (message, 0, sizeof (message));
- sprintf(message, "Local cause of Broken Collective I/O has the correct value for %s.\n",test_name);
+ HDmemset (message, 0, sizeof (message));
+ HDsprintf(message, "Local cause of Broken Collective I/O has the correct value for %s.\n",test_name);
VRFY((no_collective_cause_local_read == (uint32_t)no_collective_cause_local_expected), message);
- memset (message, 0, sizeof (message));
- sprintf(message, "Global cause of Broken Collective I/O has the correct value for %s.\n",test_name);
+ HDmemset (message, 0, sizeof (message));
+ HDsprintf(message, "Global cause of Broken Collective I/O has the correct value for %s.\n",test_name);
VRFY((no_collective_cause_global_read == (uint32_t)no_collective_cause_global_expected), message);
/* Release some resources */
@@ -4003,16 +4009,16 @@ test_no_collective_cause_mode_filter(int selection_mode)
/* Function: no_collective_cause_tests
*
- * Purpose: Tests cases for broken collective IO.
+ * Purpose: Tests cases for broken collective IO.
*
* Programmer: Jonathan Kim
* Date: Aug, 2012
*/
-void
-no_collective_cause_tests(void)
+void
+no_collective_cause_tests(void)
{
- /*
- * Test individual cause
+ /*
+ * Test individual cause
*/
test_no_collective_cause_mode (TEST_COLLECTIVE);
test_no_collective_cause_mode (TEST_SET_INDEPENDENT);
@@ -4022,15 +4028,15 @@ no_collective_cause_tests(void)
test_no_collective_cause_mode (TEST_NOT_CONTIGUOUS_OR_CHUNKED_DATASET_COMPACT);
test_no_collective_cause_mode (TEST_NOT_CONTIGUOUS_OR_CHUNKED_DATASET_EXTERNAL);
#ifdef LATER /* fletcher32 */
- /* TODO: use this instead of below TEST_FILTERS_READ when H5Dcreate and
+ /* TODO: use this instead of below TEST_FILTERS_READ when H5Dcreate and
* H5Dwrite is ready for mpio + filter feature.
*/
/* test_no_collective_cause_mode (TEST_FILTERS); */
test_no_collective_cause_mode_filter (TEST_FILTERS_READ);
-#endif /* LATER */
+#endif /* LATER */
- /*
- * Test combined causes
+ /*
+ * Test combined causes
*/
test_no_collective_cause_mode (TEST_NOT_CONTIGUOUS_OR_CHUNKED_DATASET_EXTERNAL | TEST_DATATYPE_CONVERSION);
test_no_collective_cause_mode (TEST_DATATYPE_CONVERSION | TEST_DATA_TRANSFORMS);
@@ -4054,22 +4060,22 @@ void
dataset_atomicity(void)
{
hid_t fid; /* HDF5 file ID */
- hid_t acc_tpl; /* File access templates */
- hid_t sid; /* Dataspace ID */
- hid_t dataset1; /* Dataset IDs */
- hsize_t dims[RANK]; /* dataset dim sizes */
- int *write_buf = NULL; /* data buffer */
- int *read_buf = NULL; /* data buffer */
+ hid_t acc_tpl; /* File access templates */
+ hid_t sid; /* Dataspace ID */
+ hid_t dataset1; /* Dataset IDs */
+ hsize_t dims[RANK]; /* dataset dim sizes */
+ int *write_buf = NULL; /* data buffer */
+ int *read_buf = NULL; /* data buffer */
int buf_size;
hid_t dataset2;
- hid_t file_dataspace; /* File dataspace ID */
- hid_t mem_dataspace; /* Memory dataspace ID */
+ hid_t file_dataspace; /* File dataspace ID */
+ hid_t mem_dataspace; /* Memory dataspace ID */
hsize_t start[RANK];
hsize_t stride[RANK];
hsize_t count[RANK];
hsize_t block[RANK];
const char *filename;
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
int mpi_size, mpi_rank;
int i, j, k;
hbool_t atomicity = FALSE;
@@ -4079,11 +4085,11 @@ dataset_atomicity(void)
dim0 = 64; dim1 = 32;
filename = GetTestParameters();
if (facc_type != FACC_MPIO) {
- printf("Atomicity tests will not work without the MPIO VFD\n");
+ HDprintf("Atomicity tests will not work without the MPIO VFD\n");
return;
}
if(VERBOSE_MED)
- printf("atomic writes to file %s\n", filename);
+ HDprintf("atomic writes to file %s\n", filename);
/* set up MPI parameters */
MPI_Comm_size(MPI_COMM_WORLD,&mpi_size);
@@ -4134,7 +4140,7 @@ dataset_atomicity(void)
H5P_DEFAULT, write_buf);
VRFY((ret >= 0), "H5Dwrite dataset2 succeeded");
}
-
+
ret = H5Dclose(dataset1);
VRFY((ret >= 0), "H5Dclose succeeded");
ret = H5Dclose(dataset2);
@@ -4149,8 +4155,8 @@ dataset_atomicity(void)
/* make sure setting atomicity fails on a serial file ID */
/* file locking allows only one file open (serial) for writing */
if(MAINPROCESS){
- fid=H5Fopen(filename,H5F_ACC_RDWR,H5P_DEFAULT);
- VRFY((fid >= 0), "H5Fopen succeeed");
+ fid=H5Fopen(filename,H5F_ACC_RDWR,H5P_DEFAULT);
+ VRFY((fid >= 0), "H5Fopen succeeed");
}
/* should fail */
@@ -4158,8 +4164,8 @@ dataset_atomicity(void)
VRFY((ret == FAIL), "H5Fset_mpi_atomicity failed");
if(MAINPROCESS){
- ret = H5Fclose(fid);
- VRFY((ret >= 0), "H5Fclose succeeded");
+ ret = H5Fclose(fid);
+ VRFY((ret >= 0), "H5Fclose succeeded");
}
MPI_Barrier (comm);
@@ -4215,23 +4221,23 @@ dataset_atomicity(void)
if(VERBOSE_MED) {
i=0;j=0;k=0;
for (i=0 ; i<dim0 ; i++) {
- printf ("\n");
+ HDprintf ("\n");
for (j=0 ; j<dim1 ; j++)
- printf ("%d ", read_buf[k++]);
+ HDprintf ("%d ", read_buf[k++]);
}
}
/* The processes that read the dataset must either read all values
as 0 (read happened before process 0 wrote to dataset 1), or 5
(read happened after process 0 wrote to dataset 1) */
- if (0 != mpi_rank) {
+ if (0 != mpi_rank) {
int compare = read_buf[0];
- VRFY((compare == 0 || compare == 5),
+ VRFY((compare == 0 || compare == 5),
"Atomicity Test Failed Process %d: Value read should be 0 or 5\n");
for (i=1; i<buf_size; i++) {
if (read_buf[i] != compare) {
- printf("Atomicity Test Failed Process %d: read_buf[%d] is %d, should be %d\n", mpi_rank, i, read_buf[i], compare);
+ HDprintf("Atomicity Test Failed Process %d: read_buf[%d] is %d, should be %d\n", mpi_rank, i, read_buf[i], compare);
nerrors ++;
}
}
@@ -4313,17 +4319,17 @@ dataset_atomicity(void)
if (mpi_rank == 1) {
i=0;j=0;k=0;
for (i=0 ; i<dim0 ; i++) {
- printf ("\n");
+ HDprintf ("\n");
for (j=0 ; j<dim1 ; j++)
- printf ("%d ", read_buf[k++]);
+ HDprintf ("%d ", read_buf[k++]);
}
- printf ("\n");
+ HDprintf ("\n");
}
}
/* The processes that read the dataset must either read all values
as 5 (read happened after process 0 wrote to dataset 1) */
- if (0 != mpi_rank) {
+ if (0 != mpi_rank) {
int compare;
i=0;j=0;k=0;
@@ -4347,7 +4353,7 @@ dataset_atomicity(void)
continue;
}
else if (compare != read_buf[k]) {
- printf("Atomicity Test Failed Process %d: read_buf[%d] is %d, should be %d\n", mpi_rank, k, read_buf[k], compare);
+ HDprintf("Atomicity Test Failed Process %d: read_buf[%d] is %d, should be %d\n", mpi_rank, k, read_buf[k], compare);
nerrors++;
}
k ++;
@@ -4378,8 +4384,8 @@ dataset_atomicity(void)
* Programmer: Quincey Koziol
* Date: April, 2013
*/
-void
-test_dense_attr(void)
+void
+test_dense_attr(void)
{
int mpi_size, mpi_rank;
hid_t fpid, fid;
@@ -4417,7 +4423,7 @@ test_dense_attr(void)
status = H5Pclose(gpid);
VRFY((status >= 0), "H5Pclose succeeded");
- atFileSpace = H5Screate_simple(1, atDims, NULL);
+ atFileSpace = H5Screate_simple(1, atDims, NULL);
VRFY((atFileSpace > 0), "H5Screate_simple succeeded");
atid = H5Acreate2(gid, "bar", H5T_STD_U64LE, atFileSpace, H5P_DEFAULT, H5P_DEFAULT);
VRFY((atid > 0), "H5Acreate succeeded");
diff --git a/testpar/testphdf5.c b/testpar/testphdf5.c
index 87d9056..69b66ae 100644
--- a/testpar/testphdf5.c
+++ b/testpar/testphdf5.c
@@ -547,6 +547,9 @@ int main(int argc, char **argv)
AddTest("denseattr", test_dense_attr, NULL,
"Store Dense Attributes", PARATESTFILE);
+ AddTest("noselcollmdread", test_partial_no_selection_coll_md_read, NULL,
+ "Collective Metadata read with some ranks having no selection", PARATESTFILE);
+
/* Display testing information */
TestInfo(argv[0]);
diff --git a/testpar/testphdf5.h b/testpar/testphdf5.h
index 322cb9b..176574e 100644
--- a/testpar/testphdf5.h
+++ b/testpar/testphdf5.h
@@ -294,6 +294,7 @@ void file_image_daisy_chain_test(void);
void compress_readAll(void);
#endif /* H5_HAVE_FILTER_DEFLATE */
void test_dense_attr(void);
+void test_partial_no_selection_coll_md_read(void);
/* commonly used prototypes */
hid_t create_faccess_plist(MPI_Comm comm, MPI_Info info, int l_facc_type);
diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt
index 7d41c8f..400039e 100644
--- a/tools/CMakeLists.txt
+++ b/tools/CMakeLists.txt
@@ -1,9 +1,6 @@
cmake_minimum_required (VERSION 3.10)
project (HDF5_TOOLS C)
-# --------------------------------------------------------------------
-# If testing was NOT enabled, then we need to build the tools library
-# --------------------------------------------------------------------
add_subdirectory (lib)
#-- Add the test sources
diff --git a/tools/lib/h5tools_utils.h b/tools/lib/h5tools_utils.h
index a31ba3a..4c2bf1e 100644
--- a/tools/lib/h5tools_utils.h
+++ b/tools/lib/h5tools_utils.h
@@ -157,7 +157,7 @@ typedef struct {
/* obtain link info from H5tools_get_symlink_info() */
typedef struct {
H5O_type_t trg_type; /* OUT: target type */
- char *trg_path; /* OUT: target obj path. This must be freed
+ char *trg_path; /* OUT: target obj path. This must be freed
* when used with H5tools_get_symlink_info() */
haddr_t objno; /* OUT: target object address */
unsigned long fileno; /* OUT: File number that target object is located in */
diff --git a/tools/src/h5diff/h5diff_common.c b/tools/src/h5diff/h5diff_common.c
index 8f09c81..0c1521e 100644
--- a/tools/src/h5diff/h5diff_common.c
+++ b/tools/src/h5diff/h5diff_common.c
@@ -350,7 +350,7 @@ check_n_input( const char *str )
unsigned i;
char c;
- for (i = 0; i < strlen(str); i++) {
+ for (i = 0; i < HDstrlen(str); i++) {
c = str[i];
if (i == 0) {
if (c < 49 || c > 57) /* ascii values between 1 and 9 */
@@ -387,7 +387,7 @@ check_p_input( const char *str )
the atof return value on a hexadecimal input is different
on some systems; we do a character check for this
*/
- if (strlen(str) > 2 && str[0] == '0' && str[1] == 'x')
+ if (HDstrlen(str) > 2 && str[0] == '0' && str[1] == 'x')
return -1;
x = atof(str);
@@ -421,7 +421,7 @@ check_d_input( const char *str )
the atof return value on a hexadecimal input is different
on some systems; we do a character check for this
*/
- if (strlen(str) > 2 && str[0] == '0' && str[1] == 'x')
+ if (HDstrlen(str) > 2 && str[0] == '0' && str[1] == 'x')
return -1;
x = atof(str);
diff --git a/tools/src/h5dump/h5dump.c b/tools/src/h5dump/h5dump.c
index a5f0369..b9e37e8 100644
--- a/tools/src/h5dump/h5dump.c
+++ b/tools/src/h5dump/h5dump.c
@@ -65,7 +65,7 @@ struct handler_t {
* parameters. The long-named ones can be partially spelled. When
* adding more, make sure that they don't clash with each other.
*/
-/* The following initialization makes use of C language cancatenating */
+/* The following initialization makes use of C language concatenating */
/* "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:RE*CM:O*N:vG:";
static struct long_options l_opts[] = {
diff --git a/tools/src/h5format_convert/h5format_convert.c b/tools/src/h5format_convert/h5format_convert.c
index 0fc0289..b9ed9ce 100644
--- a/tools/src/h5format_convert/h5format_convert.c
+++ b/tools/src/h5format_convert/h5format_convert.c
@@ -226,81 +226,84 @@ convert(hid_t fid, const char *dname)
/* Open the dataset */
if((did = H5Dopen2(fid, dname, H5P_DEFAULT)) < 0) {
- error_msg("unable to open dataset \"%s\"\n", dname);
- h5tools_setstatus(EXIT_FAILURE);
- goto error;
-
- } else if(verbose_g)
- HDfprintf(stdout, "Open the dataset\n");
+ error_msg("unable to open dataset \"%s\"\n", dname);
+ h5tools_setstatus(EXIT_FAILURE);
+ goto error;
+ }
+ else if(verbose_g)
+ HDfprintf(stdout, "Open the dataset\n");
/* Get the dataset's creation property list */
if((dcpl = H5Dget_create_plist(did)) < 0) {
- error_msg("unable to get the dataset creation property list\n");
- h5tools_setstatus(EXIT_FAILURE);
- goto error;
+ error_msg("unable to get the dataset creation property list\n");
+ h5tools_setstatus(EXIT_FAILURE);
+ goto error;
}
/* Get the dataset's layout */
if((layout_type = H5Pget_layout(dcpl)) < 0) {
- error_msg("unable to get the dataset layout type\n");
- h5tools_setstatus(EXIT_FAILURE);
- goto error;
-
- } else if(verbose_g)
- HDfprintf(stdout, "Retrieve the dataset's layout\n");
+ error_msg("unable to get the dataset layout type\n");
+ h5tools_setstatus(EXIT_FAILURE);
+ goto error;
+ }
+ else if(verbose_g)
+ HDfprintf(stdout, "Retrieve the dataset's layout\n");
switch(layout_type) {
- case H5D_CHUNKED:
- if(verbose_g)
- HDfprintf(stdout, "Dataset is a chunked dataset\n");
-
- /* Get the dataset's chunk indexing type */
- if(H5Dget_chunk_index_type(did, &idx_type) < 0) {
- error_msg("unable to get the chunk indexing type for \"%s\"\n", dname);
- h5tools_setstatus(EXIT_FAILURE);
- goto error;
- } else if(verbose_g)
- HDfprintf(stdout, "Retrieve the dataset's chunk indexing type\n");
+ case H5D_CHUNKED:
+ if(verbose_g)
+ HDfprintf(stdout, "Dataset is a chunked dataset\n");
+
+ /* Get the dataset's chunk indexing type */
+ if(H5Dget_chunk_index_type(did, &idx_type) < 0) {
+ error_msg("unable to get the chunk indexing type for \"%s\"\n", dname);
+ h5tools_setstatus(EXIT_FAILURE);
+ goto error;
+ }
+ else if(verbose_g)
+ HDfprintf(stdout, "Retrieve the dataset's chunk indexing type\n");
+
+ if(idx_type == H5D_CHUNK_IDX_BTREE) {
+ if(verbose_g)
+ HDfprintf(stdout, "Dataset's chunk indexing type is already version 1 B-tree: no further action\n");
+ h5tools_setstatus(EXIT_SUCCESS);
+ goto done;
+ }
+ else if (verbose_g)
+ HDfprintf(stdout, "Dataset's chunk indexing type is not version 1 B-tree\n");
- if(idx_type == H5D_CHUNK_IDX_BTREE) {
- if(verbose_g)
- HDfprintf(stdout, "Dataset's chunk indexing type is already version 1 B-tree: no further action\n");
- h5tools_setstatus(EXIT_SUCCESS);
- goto done;
- } else if (verbose_g)
- HDfprintf(stdout, "Dataset's chunk indexing type is not version 1 B-tree\n");
break;
- case H5D_CONTIGUOUS:
- if(verbose_g)
- HDfprintf(stdout, "Dataset is a contiguous dataset: downgrade layout version as needed\n");
- break;
+ case H5D_CONTIGUOUS:
+ if(verbose_g)
+ HDfprintf(stdout, "Dataset is a contiguous dataset: downgrade layout version as needed\n");
+ break;
- case H5D_COMPACT:
- if(verbose_g)
- HDfprintf(stdout, "Dataset is a compact dataset: downgrade layout version as needed\n");
- break;
+ case H5D_COMPACT:
+ if(verbose_g)
+ HDfprintf(stdout, "Dataset is a compact dataset: downgrade layout version as needed\n");
+ break;
- case H5D_VIRTUAL:
- if(verbose_g)
- HDfprintf(stdout, "No further action for virtual dataset\n");
- goto done;
+ case H5D_VIRTUAL:
+ if(verbose_g)
+ HDfprintf(stdout, "No further action for virtual dataset\n");
+ goto done;
- case H5D_NLAYOUTS:
- case H5D_LAYOUT_ERROR:
- default:
- error_msg("unknown layout type for \"%s\"\n", dname);
- h5tools_setstatus(EXIT_FAILURE);
- goto error;
+ case H5D_NLAYOUTS:
+ case H5D_LAYOUT_ERROR:
+ default:
+ error_msg("unknown layout type for \"%s\"\n", dname);
+ h5tools_setstatus(EXIT_FAILURE);
+ goto error;
} /* end switch */
/* No further action if it is a noop */
if(noop_g) {
- if(verbose_g)
- HDfprintf(stdout, "Not converting the dataset\n");
- h5tools_setstatus(EXIT_SUCCESS);
- goto done;
+ if(verbose_g)
+ HDfprintf(stdout, "Not converting the dataset\n");
+ h5tools_setstatus(EXIT_SUCCESS);
+ goto done;
}
if(verbose_g)
@@ -308,51 +311,54 @@ convert(hid_t fid, const char *dname)
/* Downgrade the dataset */
if(H5Dformat_convert(did) < 0) {
- error_msg("unable to downgrade dataset \"%s\"\n", dname);
- h5tools_setstatus(EXIT_FAILURE);
- goto error;
- } else if(verbose_g)
- HDfprintf(stdout, "Done\n");
+ error_msg("unable to downgrade dataset \"%s\"\n", dname);
+ h5tools_setstatus(EXIT_FAILURE);
+ goto error;
+ }
+ else if(verbose_g)
+ HDfprintf(stdout, "Done\n");
done:
/* Close the dataset */
if(H5Dclose(did) < 0) {
error_msg("unable to close dataset \"%s\"\n", dname);
h5tools_setstatus(EXIT_FAILURE);
- goto error;
- } else if(verbose_g)
- HDfprintf(stdout, "Close the dataset\n");
+ goto error;
+ }
+ else if(verbose_g)
+ HDfprintf(stdout, "Close the dataset\n");
/* Close the dataset creation property list */
if(H5Pclose(dcpl) < 0) {
error_msg("unable to close dataset creation property list\n");
h5tools_setstatus(EXIT_FAILURE);
- goto error;
- } else if(verbose_g)
- printf("Close the dataset creation property list\n");
+ goto error;
+ }
+ else if(verbose_g)
+ HDprintf("Close the dataset creation property list\n");
- return(0);
+ return 0;
error:
if(verbose_g)
- HDfprintf(stdout, "Error encountered\n");
+ HDfprintf(stdout, "Error encountered\n");
H5E_BEGIN_TRY {
H5Pclose(dcpl);
H5Dclose(did);
} H5E_END_TRY;
- return(-1);
+ return -1;
} /* convert() */
/*-------------------------------------------------------------------------
- * Function: convert_dsets_cb()
+ * Function: convert_dsets_cb()
*
- * Purpose: The callback routine from the traversal to convert the
- * chunk indexing type of the dataset object.
+ * Purpose: The callback routine from the traversal to convert the
+ * chunk indexing type of the dataset object.
*
- * Return: Success: 0
- * Failure: 1
+ * Return: Success: 0
+ * Failure: -1
*-------------------------------------------------------------------------
*/
static int
@@ -363,11 +369,11 @@ convert_dsets_cb(const char *path, const H5O_info_t *oi, const char *already_vis
/* If the object has already been seen then just return */
if(NULL == already_visited) {
if(oi->type == H5O_TYPE_DATASET) {
- if(verbose_g)
- HDfprintf(stdout, "Going to process dataset:%s...\n", path);
- if(convert(fid, path) < 0)
- goto error;
- } /* end if */
+ if(verbose_g)
+ HDfprintf(stdout, "Going to process dataset:%s...\n", path);
+ if(convert(fid, path) < 0)
+ goto error;
+ } /* end if */
} /* end if */
return 0;
diff --git a/tools/src/h5import/h5import.c b/tools/src/h5import/h5import.c
index 76e78af..3b64a0e 100644
--- a/tools/src/h5import/h5import.c
+++ b/tools/src/h5import/h5import.c
@@ -494,7 +494,7 @@ static int readIntegerData(FILE *strm, struct Input *in)
return (-1);
}
#ifdef H5DEBUGIMPORT
- printf("readIntegerData %d (0x%.8X)\n", *in08, *in08);
+ HDprintf("readIntegerData %d (0x%.8X)\n", *in08, *in08);
#endif
}
break;
@@ -531,7 +531,7 @@ static int readIntegerData(FILE *strm, struct Input *in)
*/
*in16 = temp16;
#ifdef H5DEBUGIMPORT
- printf("readIntegerData %d (0x%.8X)\n", *in16, temp16);
+ HDprintf("readIntegerData %d (0x%.8X)\n", *in16, temp16);
#endif
}
break;
@@ -567,7 +567,7 @@ static int readIntegerData(FILE *strm, struct Input *in)
*/
*in32 = temp32;
#ifdef H5DEBUGIMPORT
- printf("readIntegerData %d (0x%.8X = 0x%.8X)\n", *in32, *in32, temp32);
+ HDprintf("readIntegerData %d (0x%.8X = 0x%.8X)\n", *in32, *in32, temp32);
#endif
}
break;
@@ -605,7 +605,7 @@ static int readIntegerData(FILE *strm, struct Input *in)
*/
*in64 = temp64;
#ifdef H5DEBUGIMPORT
- printf("readIntegerData %d (0x%.8X)\n", *in64, temp64);
+ HDprintf("readIntegerData %d (0x%.8X)\n", *in64, temp64);
#endif
}
break;
@@ -701,7 +701,7 @@ static int readUIntegerData(FILE *strm, struct Input *in)
*/
*in16 = temp16;
#ifdef H5DEBUGIMPORT
- printf("readUIntegerData %d (0x%.4X = 0x%.4X)\n", *in16, *in16, temp16);
+ HDprintf("readUIntegerData %d (0x%.4X = 0x%.4X)\n", *in16, *in16, temp16);
#endif
}
break;
@@ -737,7 +737,7 @@ static int readUIntegerData(FILE *strm, struct Input *in)
*/
*in32 = temp32;
#ifdef H5DEBUGIMPORT
- printf("readUIntegerData %d (0x%.8X = 0x%.8X)\n", *in32, *in32, temp32);
+ HDprintf("readUIntegerData %d (0x%.8X = 0x%.8X)\n", *in32, *in32, temp32);
#endif
}
break;
@@ -775,7 +775,7 @@ static int readUIntegerData(FILE *strm, struct Input *in)
*/
*in64 = temp64;
#ifdef H5DEBUGIMPORT
- printf("readUIntegerData %ld (0x%.8X = 0x%.8X)\n", *in64, *in64, temp64);
+ HDprintf("readUIntegerData %ld (0x%.8X = 0x%.8X)\n", *in64, *in64, temp64);
#endif
}
break;
@@ -855,7 +855,7 @@ static int readFloatData(FILE *strm, struct Input *in)
*/
*bfp32 = temp32;
#ifdef H5DEBUGIMPORT
- printf("readFloatData %ld (0x%.8X = 0x%.8X)\n", *bfp32, *bfp32, temp32);
+ HDprintf("readFloatData %ld (0x%.8X = 0x%.8X)\n", *bfp32, *bfp32, temp32);
#endif
}
break;
@@ -907,7 +907,7 @@ static int readFloatData(FILE *strm, struct Input *in)
*/
*bfp64 = temp64;
#ifdef H5DEBUGIMPORT
- printf("readFloatData %ld (0x%.16lX)\n", *bfp64, temp64);
+ HDprintf("readFloatData %ld (0x%.16lX)\n", *bfp64, temp64);
#endif
}
break;
@@ -1099,7 +1099,7 @@ static int processStrHDFData(FILE *strm, struct Input *in, hid_t file_id)
*-------------------------------------------------------------------------
*/
#ifdef H5DEBUGIMPORT
- printf("processStrHDFData DATATYPE STRING\n");
+ HDprintf("processStrHDFData DATATYPE STRING\n");
#endif
if ((type_id = H5Tcopy(H5T_C_S1)) < 0)
@@ -1136,7 +1136,7 @@ static int processStrHDFData(FILE *strm, struct Input *in, hid_t file_id)
}
H5E_END_TRY;
#ifdef H5DEBUGIMPORT
- printf("processStrHDFData DATATYPE STRING groups created\n");
+ HDprintf("processStrHDFData DATATYPE STRING groups created\n");
#endif
if ((space_id = H5Screate_simple(in->rank, in->sizeOfDimension, NULL)) < 0)
@@ -1149,7 +1149,7 @@ static int processStrHDFData(FILE *strm, struct Input *in, hid_t file_id)
goto out;
#ifdef H5DEBUGIMPORT
- printf("processStrHDFData DATATYPE STRING ready to process strings\n");
+ HDprintf("processStrHDFData DATATYPE STRING ready to process strings\n");
#endif
line = 0;
j = 0;
@@ -1159,36 +1159,36 @@ static int processStrHDFData(FILE *strm, struct Input *in, hid_t file_id)
str2 = NULL;
str3 = NULL;
#ifdef H5DEBUGIMPORT
- printf("processStrHDFData DATATYPE STRING[%llu]={%s}\n", (unsigned long long)line, str1);
+ HDprintf("processStrHDFData DATATYPE STRING[%llu]={%s}\n", (unsigned long long)line, str1);
#endif
/* process string to remove the first and last quote char */
str2 = strchr(str1, '"');
if (str2 != NULL) {
#ifdef H5DEBUGIMPORT
- printf("processStrHDFData DATATYPE STRING len:%d for {%s}\n", strlen(str2), str2);
+ HDprintf("processStrHDFData DATATYPE STRING len:%d for {%s}\n", HDstrlen(str2), str2);
#endif
str2++;
#ifdef H5DEBUGIMPORT
- printf("processStrHDFData DATATYPE STRING len:%d for {%s}\n", strlen(str2), str2);
+ HDprintf("processStrHDFData DATATYPE STRING len:%d for {%s}\n", HDstrlen(str2), str2);
#endif
str3 = strrchr(str2, '"');
if (str3 != NULL) {
#ifdef H5DEBUGIMPORT
- printf("processStrHDFData DATATYPE STRING len:%d for {%s}\n", strlen(str3), str3);
+ HDprintf("processStrHDFData DATATYPE STRING len:%d for {%s}\n", HDstrlen(str3), str3);
#endif
*str3 = '\0';
#ifdef H5DEBUGIMPORT
- printf("processStrHDFData DATATYPE STRING len:%d for {%s}\n", strlen(str2), str2);
+ HDprintf("processStrHDFData DATATYPE STRING len:%d for {%s}\n", HDstrlen(str2), str2);
#endif
- if(strlen(str2) > 0) {
+ if(HDstrlen(str2) > 0) {
hid_t fspace_id;
hsize_t start[1];
hsize_t count[1] = { 1 };
#ifdef H5DEBUGIMPORT
- printf("processStrHDFData DATATYPE STRING[%llu] store %s\n", (unsigned long long)line, str2);
+ HDprintf("processStrHDFData DATATYPE STRING[%llu] store %s\n", (unsigned long long)line, str2);
#endif
if ((fspace_id = H5Dget_space(dset_id)) < 0)
goto out;
@@ -1210,7 +1210,7 @@ static int processStrHDFData(FILE *strm, struct Input *in, hid_t file_id)
j++;
}
#ifdef H5DEBUGIMPORT
- printf("processStrHDFData DATATYPE STRING eof reached\n");
+ HDprintf("processStrHDFData DATATYPE STRING eof reached\n");
#endif
/* close */
@@ -1223,7 +1223,7 @@ static int processStrHDFData(FILE *strm, struct Input *in, hid_t file_id)
out:
#ifdef H5DEBUGIMPORT
- printf("processStrHDFData DATATYPE STRING error exit\n");
+ HDprintf("processStrHDFData DATATYPE STRING error exit\n");
#endif
/* disable error reporting */
H5E_BEGIN_TRY
@@ -1437,7 +1437,7 @@ static int processConfigurationFile(char *infile, struct Input *in)
}
in->inputByteOrder = kindex;
#ifdef H5DEBUGIMPORT
- printf("h5dump inputByteOrder %d\n", in->inputByteOrder);
+ HDprintf("h5dump inputByteOrder %d\n", in->inputByteOrder);
#endif
in->inputArchitecture = 0; /* default to NATIVE */
@@ -1450,7 +1450,7 @@ static int processConfigurationFile(char *infile, struct Input *in)
if((scanret == 1) && !HDstrcmp("HDF5", key)) {
#ifdef H5DEBUGIMPORT
int pndx;
- printf("\nh5dump file\n");
+ HDprintf("\nh5dump file\n");
#endif
in->h5dumpInput = 1;
scanret = fscanf(strm, "%s", temp); /* filename */
@@ -1459,7 +1459,7 @@ static int processConfigurationFile(char *infile, struct Input *in)
while (scanret == 1) {
if(!HDstrcmp("DATASET", key)) { /* PATH */
#ifdef H5DEBUGIMPORT
- printf("h5dump DATASET key\n");
+ HDprintf("h5dump DATASET key\n");
#endif
if (in->configOptionVector[PATH] == 1) {
(void) HDfprintf(stderr, err3a, infile);
@@ -1470,7 +1470,7 @@ static int processConfigurationFile(char *infile, struct Input *in)
goto error;
}
#ifdef H5DEBUGIMPORT
- printf("h5dump DATASET %s found\n", temp);
+ HDprintf("h5dump DATASET %s found\n", temp);
#endif
if (parsePathInfo(&in->path, temp) == -1) {
(void) HDfprintf(stderr, err3b, infile);
@@ -1479,12 +1479,12 @@ static int processConfigurationFile(char *infile, struct Input *in)
in->configOptionVector[PATH] = 1;
scanret = fscanf(strm, "%s", temp); /* start bracket */
#ifdef H5DEBUGIMPORT
- printf("h5dump DATASET %s found\n", temp);
+ HDprintf("h5dump DATASET %s found\n", temp);
#endif
} /* if(!HDstrcmp("DATASET", key)) PATH */
else if(!HDstrcmp("DATATYPE", key)) { /* INPUT-CLASS */
#ifdef H5DEBUGIMPORT
- printf("h5dump DATATYPE key\n");
+ HDprintf("h5dump DATATYPE key\n");
#endif
if (in->configOptionVector[INPUT_CLASS] == 1) {
(void) HDfprintf(stderr, err4a, infile);
@@ -1496,14 +1496,14 @@ static int processConfigurationFile(char *infile, struct Input *in)
goto error;
}
#ifdef H5DEBUGIMPORT
- printf("h5dump DATATYPE %s found\n", temp);
+ HDprintf("h5dump DATATYPE %s found\n", temp);
#endif
if ((kindex = getInputClassType(in, temp)) == -1) {
(void) HDfprintf(stderr, err4b, infile);
goto error;
}
#ifdef H5DEBUGIMPORT
- printf("h5dump DATATYPE type %d inputClass\n", in->inputClass);
+ HDprintf("h5dump DATATYPE type %d inputClass\n", in->inputClass);
#endif
in->configOptionVector[INPUT_CLASS] = 1;
@@ -1519,21 +1519,21 @@ static int processConfigurationFile(char *infile, struct Input *in)
in->outputClass = 2;
}
#ifdef H5DEBUGIMPORT
- printf("h5dump DATATYPE type %d outputClass\n", in->outputClass);
+ HDprintf("h5dump DATATYPE type %d outputClass\n", in->outputClass);
#endif
if(in->inputClass == 5) { /* STRING */
int get_next_prop = 1;
in->outputClass = -1;
#ifdef H5DEBUGIMPORT
- printf("h5dump DATATYPE STRING found\n");
+ HDprintf("h5dump DATATYPE STRING found\n");
#endif
if (fscanf(strm, "%s", temp) != 1) { /* start bracket */
(void) HDfprintf(stderr, "%s", err18);
goto error;
}
#ifdef H5DEBUGIMPORT
- printf("h5dump DATATYPE STRING %s found\n", temp);
+ HDprintf("h5dump DATATYPE STRING %s found\n", temp);
#endif
if (fscanf(strm, "%s", temp) != 1) { /* string properties */
(void) HDfprintf(stderr, "%s", err18);
@@ -1546,7 +1546,7 @@ static int processConfigurationFile(char *infile, struct Input *in)
goto error;
}
#ifdef H5DEBUGIMPORT
- printf("h5dump DATATYPE STRING STRSIZE %s found\n", temp);
+ HDprintf("h5dump DATATYPE STRING STRSIZE %s found\n", temp);
#endif
if (HDstrcmp("H5T_VARIABLE;", temp)) {
char *more = temp;
@@ -1556,7 +1556,7 @@ static int processConfigurationFile(char *infile, struct Input *in)
goto error;
}
#ifdef H5DEBUGIMPORT
- printf("h5dump DATATYPE STRING %d InputSize\n", in->inputSize);
+ HDprintf("h5dump DATATYPE STRING %d InputSize\n", in->inputSize);
#endif
}
}
@@ -1566,7 +1566,7 @@ static int processConfigurationFile(char *infile, struct Input *in)
goto error;
}
#ifdef H5DEBUGIMPORT
- printf("h5dump DATATYPE STRING STRPAD %s found\n", temp);
+ HDprintf("h5dump DATATYPE STRING STRPAD %s found\n", temp);
#endif
}
else if(!HDstrcmp("CSET", key)) { /* CSET */
@@ -1575,7 +1575,7 @@ static int processConfigurationFile(char *infile, struct Input *in)
goto error;
}
#ifdef H5DEBUGIMPORT
- printf("h5dump DATATYPE STRING CSET %s found\n", temp);
+ HDprintf("h5dump DATATYPE STRING CSET %s found\n", temp);
#endif
}
@@ -1585,7 +1585,7 @@ static int processConfigurationFile(char *infile, struct Input *in)
goto error;
}
#ifdef H5DEBUGIMPORT
- printf("h5dump DATATYPE STRING CTYPE %s found\n", temp);
+ HDprintf("h5dump DATATYPE STRING CTYPE %s found\n", temp);
#endif
} /* if(!HDstrcmp("CSET", key)) */
if (fscanf(strm, "%s", temp) != 1) {
@@ -1593,7 +1593,7 @@ static int processConfigurationFile(char *infile, struct Input *in)
goto error;
}
#ifdef H5DEBUGIMPORT
- printf("h5dump DATATYPE STRING %s found\n", temp);
+ HDprintf("h5dump DATATYPE STRING %s found\n", temp);
#endif
if(!HDstrcmp("}", temp)) { /* end bracket */
get_next_prop = 0;
@@ -1605,7 +1605,7 @@ static int processConfigurationFile(char *infile, struct Input *in)
hsize_t temp_dims[MAX_NUM_DIMENSION];
#ifdef H5DEBUGIMPORT
- printf("h5dump DATASPACE key\n");
+ HDprintf("h5dump DATASPACE key\n");
#endif
if (fscanf(strm, "%s", temp) != 1) {
(void) HDfprintf(stderr, "%s", err18);
@@ -1621,21 +1621,21 @@ static int processConfigurationFile(char *infile, struct Input *in)
else if(!HDstrcmp("SIMPLE", temp)) { /* SIMPLE */
int icount = 0;
#ifdef H5DEBUGIMPORT
- printf("h5dump DATASPACE SIMPLE found\n");
+ HDprintf("h5dump DATASPACE SIMPLE found\n");
#endif
if (fscanf(strm, "%s", temp) != 1) { /* start bracket */
(void) HDfprintf(stderr, err6b, infile);
goto error;
}
#ifdef H5DEBUGIMPORT
- printf("h5dump DATASPACE SIMPLE %s found\n", temp);
+ HDprintf("h5dump DATASPACE SIMPLE %s found\n", temp);
#endif
if (fscanf(strm, "%s", temp) != 1) { /* start paren */
(void) HDfprintf(stderr, err6b, infile);
goto error;
}
#ifdef H5DEBUGIMPORT
- printf("h5dump DATASPACE SIMPLE %s found\n", temp);
+ HDprintf("h5dump DATASPACE SIMPLE %s found\n", temp);
#endif
if(!HDstrcmp("(", temp)) { /* start paren */
int get_next_dim = 1;
@@ -1646,7 +1646,7 @@ static int processConfigurationFile(char *infile, struct Input *in)
goto error;
}
#ifdef H5DEBUGIMPORT
- printf("h5dump DATASPACE SIMPLE %s found\n", temp);
+ HDprintf("h5dump DATASPACE SIMPLE %s found\n", temp);
#endif
while (get_next_dim) {
char *more = temp;
@@ -1656,7 +1656,7 @@ static int processConfigurationFile(char *infile, struct Input *in)
goto error;
}
#ifdef H5DEBUGIMPORT
- printf("h5dump DATASPACE SIMPLE %s found\n", temp);
+ HDprintf("h5dump DATASPACE SIMPLE %s found\n", temp);
#endif
if(!HDstrcmp(")", temp)) { /* end paren */
in->rank = ++icount;
@@ -1676,17 +1676,17 @@ static int processConfigurationFile(char *infile, struct Input *in)
goto error;
}
#ifdef H5DEBUGIMPORT
- printf("h5dump DATASPACE SIMPLE %ld rank\n", in->rank);
+ HDprintf("h5dump DATASPACE SIMPLE %ld rank\n", in->rank);
#endif
for (i = 0; i < in->rank; i++) {
in->sizeOfDimension[i] = temp_dims[i];
}
#ifdef H5DEBUGIMPORT
- printf("h5dump DATASPACE SIMPLE dims[%ld]:", in->rank);
+ HDprintf("h5dump DATASPACE SIMPLE dims[%ld]:", in->rank);
for (pndx = 0; pndx < in->rank; pndx++) {
- printf(" %ld", in->sizeOfDimension[pndx]);
+ HDprintf(" %ld", in->sizeOfDimension[pndx]);
}
- printf("\n");
+ HDprintf("\n");
#endif
in->configOptionVector[DIM] = 1;
} /* if(!HDstrcmp("(", key)) start paren */
@@ -1699,7 +1699,7 @@ static int processConfigurationFile(char *infile, struct Input *in)
goto error;
}
#ifdef H5DEBUGIMPORT
- printf("h5dump DATASPACE SIMPLE %s found\n", temp);
+ HDprintf("h5dump DATASPACE SIMPLE %s found\n", temp);
#endif
if(!HDstrcmp("/", temp)) { /* / max dims */
if ((in->maxsizeOfDimension = (hsize_t *) HDmalloc ((size_t) in->rank * sizeof(hsize_t))) == NULL) {
@@ -1710,25 +1710,25 @@ static int processConfigurationFile(char *infile, struct Input *in)
goto error;
}
#ifdef H5DEBUGIMPORT
- printf("h5dump DATASPACE SIMPLE %s found\n", temp);
+ HDprintf("h5dump DATASPACE SIMPLE %s found\n", temp);
#endif
if(!HDstrcmp("(", temp)) { /* start paren */
int get_next_dim = 1;
int i = 0;
#ifdef H5DEBUGIMPORT
- printf("h5dump DATASPACE SIMPLE process max dim values\n");
+ HDprintf("h5dump DATASPACE SIMPLE process max dim values\n");
#endif
if (fscanf(strm, "%s", temp) != 1) { /* max dim with optional comma */
(void) HDfprintf(stderr, err16c, infile);
goto error;
}
#ifdef H5DEBUGIMPORT
- printf("h5dump DATASPACE SIMPLE %s found\n", temp);
+ HDprintf("h5dump DATASPACE SIMPLE %s found\n", temp);
#endif
while (get_next_dim) {
#ifdef H5DEBUGIMPORT
- printf("h5dump DATASPACE SIMPLE get max dim value\n");
+ HDprintf("h5dump DATASPACE SIMPLE get max dim value\n");
#endif
if(!HDstrcmp("H5S_UNLIMITED", temp) || !HDstrcmp("H5S_UNLIMITED,", temp)) { /* unlimited */
in->maxsizeOfDimension[i] = H5S_UNLIMITED;
@@ -1743,7 +1743,7 @@ static int processConfigurationFile(char *infile, struct Input *in)
goto error;
}
#ifdef H5DEBUGIMPORT
- printf("h5dump DATASPACE SIMPLE %s found\n", temp);
+ HDprintf("h5dump DATASPACE SIMPLE %s found\n", temp);
#endif
if(!HDstrcmp(")", temp)) { /* end paren */
get_next_dim = 0;
@@ -1757,12 +1757,12 @@ static int processConfigurationFile(char *infile, struct Input *in)
}
} /* while (get_next_dim) */
#ifdef H5DEBUGIMPORT
- printf("h5dump DATASPACE SIMPLE maxdims[%ld]:", in->rank);
+ HDprintf("h5dump DATASPACE SIMPLE maxdims[%ld]:", in->rank);
for (pndx = 0; pndx < in->rank; pndx++) {
- printf(" %ld", in->maxsizeOfDimension[pndx]);
+ HDprintf(" %ld", in->maxsizeOfDimension[pndx]);
}
- printf("\n");
- printf("h5dump DATASPACE SIMPLE get max dim finished\n");
+ HDprintf("\n");
+ HDprintf("h5dump DATASPACE SIMPLE get max dim finished\n");
#endif
} /* if(!HDstrcmp("(", key)) start paren */
else {
@@ -1771,7 +1771,7 @@ static int processConfigurationFile(char *infile, struct Input *in)
}
scanret = fscanf(strm, "%s", temp); /* end bracket */
#ifdef H5DEBUGIMPORT
- printf("h5dump DATASPACE SIMPLE %s found\n", temp);
+ HDprintf("h5dump DATASPACE SIMPLE %s found\n", temp);
#endif
} /* if(!HDstrcmp("/", key)) max dims separator */
} /* else if(!HDstrcmp("SIMPLE", key)) */
@@ -1782,21 +1782,21 @@ static int processConfigurationFile(char *infile, struct Input *in)
} /* else if(!HDstrcmp("DATASPACE", key)) RANK and DIMENSIONS */
else if(!HDstrcmp("STORAGE_LAYOUT", key)) { /* CHUNKED-DIMENSION-SIZES */
#ifdef H5DEBUGIMPORT
- printf("h5dump STORAGE_LAYOUT key\n");
+ HDprintf("h5dump STORAGE_LAYOUT key\n");
#endif
if (fscanf(strm, "%s", temp) != 1) { /* start bracket */
(void) HDfprintf(stderr, err6b, infile);
goto error;
}
#ifdef H5DEBUGIMPORT
- printf("h5dump STORAGE_LAYOUT %s found\n", temp);
+ HDprintf("h5dump STORAGE_LAYOUT %s found\n", temp);
#endif
if (fscanf(strm, "%s", temp) != 1) { /* CHUNKED */
(void) HDfprintf(stderr, err6b, infile);
goto error;
}
#ifdef H5DEBUGIMPORT
- printf("h5dump STORAGE_LAYOUT %s found\n", temp);
+ HDprintf("h5dump STORAGE_LAYOUT %s found\n", temp);
#endif
if(!HDstrcmp("CHUNKED", temp)) { /* CHUNKED */
if ((in->sizeOfChunk = (hsize_t *) HDmalloc ((size_t) in->rank * sizeof(hsize_t))) == NULL) {
@@ -1808,7 +1808,7 @@ static int processConfigurationFile(char *infile, struct Input *in)
goto error;
}
#ifdef H5DEBUGIMPORT
- printf("h5dump STORAGE_LAYOUT CHUNKED %s found\n", temp);
+ HDprintf("h5dump STORAGE_LAYOUT CHUNKED %s found\n", temp);
#endif
if(!HDstrcmp("(", temp)) { /* start paren */
int get_next_dim = 1;
@@ -1819,7 +1819,7 @@ static int processConfigurationFile(char *infile, struct Input *in)
goto error;
}
#ifdef H5DEBUGIMPORT
- printf("h5dump STORAGE_LAYOUT CHUNKED %s found\n", temp);
+ HDprintf("h5dump STORAGE_LAYOUT CHUNKED %s found\n", temp);
#endif
while (get_next_dim) {
char *more = temp;
@@ -1829,7 +1829,7 @@ static int processConfigurationFile(char *infile, struct Input *in)
goto error;
}
#ifdef H5DEBUGIMPORT
- printf("h5dump STORAGE_LAYOUT CHUNKED %s found\n", temp);
+ HDprintf("h5dump STORAGE_LAYOUT CHUNKED %s found\n", temp);
#endif
if(!HDstrcmp(")", temp)) { /* end paren */
in->configOptionVector[RANK] = 1;
@@ -1844,11 +1844,11 @@ static int processConfigurationFile(char *infile, struct Input *in)
}
} /* while (get_next_dim) */
#ifdef H5DEBUGIMPORT
- printf("h5dump STORAGE_LAYOUT CHUNKED dims [%ld]:", in->rank);
+ HDprintf("h5dump STORAGE_LAYOUT CHUNKED dims [%ld]:", in->rank);
for (pndx = 0; pndx < in->rank; pndx++) {
- printf(" %ld", in->sizeOfChunk[pndx]);
+ HDprintf(" %ld", in->sizeOfChunk[pndx]);
}
- printf("\n");
+ HDprintf("\n");
#endif
in->configOptionVector[DIM] = 1;
} /* if(!HDstrcmp("(", key)) start paren */
@@ -1861,7 +1861,7 @@ static int processConfigurationFile(char *infile, struct Input *in)
goto error;
}
#ifdef H5DEBUGIMPORT
- printf("h5dump STORAGE_LAYOUT CHUNKED %s found\n", temp);
+ HDprintf("h5dump STORAGE_LAYOUT CHUNKED %s found\n", temp);
#endif
if(!HDstrcmp("SIZE", temp)) { /* SIZE */
if (fscanf(strm, "%d", (&ival)) != 1) {
@@ -1869,7 +1869,7 @@ static int processConfigurationFile(char *infile, struct Input *in)
goto error;
}
#ifdef H5DEBUGIMPORT
- printf("h5dump STORAGE_LAYOUT CHUNKED SIZE %d found\n", ival);
+ HDprintf("h5dump STORAGE_LAYOUT CHUNKED SIZE %d found\n", ival);
#endif
}
while (HDstrcmp("}", temp)) {
@@ -1878,7 +1878,7 @@ static int processConfigurationFile(char *infile, struct Input *in)
goto error;
}
#ifdef H5DEBUGIMPORT
- printf("h5dump STORAGE_LAYOUT CHUNKED %s found\n", temp);
+ HDprintf("h5dump STORAGE_LAYOUT CHUNKED %s found\n", temp);
#endif
}
in->configOptionVector[CHUNK] = 1;
@@ -1886,53 +1886,53 @@ static int processConfigurationFile(char *infile, struct Input *in)
} /* else if(!HDstrcmp("STORAGE_LAYOUT", key)) CHUNKED-DIMENSION-SIZES */
else if(!HDstrcmp("FILTERS", key)) { /* FILTERS */
#ifdef H5DEBUGIMPORT
- printf("h5dump FILTERS key\n");
+ HDprintf("h5dump FILTERS key\n");
#endif
if (fscanf(strm, "%s", temp) != 1) { /* start bracket */
(void) HDfprintf(stderr, err6b, infile);
goto error;
}
#ifdef H5DEBUGIMPORT
- printf("h5dump FILTERS %s found\n", temp);
+ HDprintf("h5dump FILTERS %s found\n", temp);
#endif
if (fscanf(strm, "%s", temp) != 1) {
(void) HDfprintf(stderr, err6b, infile);
goto error;
}
#ifdef H5DEBUGIMPORT
- printf("h5dump FILTERS %s found\n", temp);
+ HDprintf("h5dump FILTERS %s found\n", temp);
#endif
if(!HDstrcmp("COMPRESSION", temp)) { /* COMPRESSION */
#ifdef H5DEBUGIMPORT
- printf("h5dump FILTERS COMPRESSION found\n");
+ HDprintf("h5dump FILTERS COMPRESSION found\n");
#endif
if (fscanf(strm, "%s", temp) != 1) { /* DEFLATE */
(void) HDfprintf(stderr, "%s", err18);
goto error;
}
#ifdef H5DEBUGIMPORT
- printf("h5dump FILTERS COMPRESSION %s found\n", temp);
+ HDprintf("h5dump FILTERS COMPRESSION %s found\n", temp);
#endif
if (fscanf(strm, "%s", temp) != 1) { /* bgin bracket */
(void) HDfprintf(stderr, "%s", err18);
goto error;
}
#ifdef H5DEBUGIMPORT
- printf("h5dump FILTERS COMPRESSION %s found\n", temp);
+ HDprintf("h5dump FILTERS COMPRESSION %s found\n", temp);
#endif
if (fscanf(strm, "%s", temp) != 1) { /* LEVEL */
(void) HDfprintf(stderr, "%s", err18);
goto error;
}
#ifdef H5DEBUGIMPORT
- printf("h5dump FILTERS COMPRESSION %s found\n", temp);
+ HDprintf("h5dump FILTERS COMPRESSION %s found\n", temp);
#endif
if (fscanf(strm, "%d", (&ival)) != 1) {
(void) HDfprintf(stderr, "%s", err19);
goto error;
}
#ifdef H5DEBUGIMPORT
- printf("h5dump FILTERS COMPRESSION LEVEL %d found\n", ival);
+ HDprintf("h5dump FILTERS COMPRESSION LEVEL %d found\n", ival);
#endif
in->compressionParam = ival;
if (fscanf(strm, "%s", temp) != 1) { /* end bracket */
@@ -1940,20 +1940,20 @@ static int processConfigurationFile(char *infile, struct Input *in)
goto error;
}
#ifdef H5DEBUGIMPORT
- printf("h5dump FILTERS COMPRESSION %s found\n", temp);
+ HDprintf("h5dump FILTERS COMPRESSION %s found\n", temp);
#endif
in->compressionType = 0; /* ONLY GZIP supported */
in->configOptionVector[COMPRESS] = 1;
}
else if(!HDstrcmp("CONTIGUOUS", temp)) { /* CONTIGUOUS */
#ifdef H5DEBUGIMPORT
- printf("h5dump FILTERS CONTIGUOUS found\n");
+ HDprintf("h5dump FILTERS CONTIGUOUS found\n");
#endif
in->configOptionVector[COMPRESS] = 0;
}
else if(!HDstrcmp("NONE", temp)) { /* NONE */
#ifdef H5DEBUGIMPORT
- printf("h5dump FILTERS NONE found\n");
+ HDprintf("h5dump FILTERS NONE found\n");
#endif
in->configOptionVector[COMPRESS] = 0;
}
@@ -1962,28 +1962,28 @@ static int processConfigurationFile(char *infile, struct Input *in)
goto error;
}
#ifdef H5DEBUGIMPORT
- printf("h5dump FILTERS %s found\n", temp);
+ HDprintf("h5dump FILTERS %s found\n", temp);
#endif
}
else if(!HDstrcmp("SUBSET", key)) { /* reduce dimensions */
hsize_t temp_dims[MAX_NUM_DIMENSION];
int get_next_prop = 1;
#ifdef H5DEBUGIMPORT
- printf("h5dump SUBSET key\n");
+ HDprintf("h5dump SUBSET key\n");
#endif
if (fscanf(strm, "%s", temp) != 1) { /* start bracket */
(void) HDfprintf(stderr, err20, infile);
goto error;
}
#ifdef H5DEBUGIMPORT
- printf("h5dump SUBSET %s found\n", temp);
+ HDprintf("h5dump SUBSET %s found\n", temp);
#endif
if (fscanf(strm, "%s", temp) != 1) { /* SUBSET keyword */
(void) HDfprintf(stderr, "%s", err18);
goto error;
}
#ifdef H5DEBUGIMPORT
- printf("h5dump SUBSET %s found\n", temp);
+ HDprintf("h5dump SUBSET %s found\n", temp);
#endif
while (get_next_prop) {
if(!HDstrcmp("COUNT", temp)) { /* COUNT */
@@ -1993,7 +1993,7 @@ static int processConfigurationFile(char *infile, struct Input *in)
goto error;
}
#ifdef H5DEBUGIMPORT
- printf("h5dump SUBSET %s found\n", temp);
+ HDprintf("h5dump SUBSET %s found\n", temp);
#endif
if(!HDstrcmp("(", temp)) { /* start paren */
int get_next_dim = 1;
@@ -2004,7 +2004,7 @@ static int processConfigurationFile(char *infile, struct Input *in)
goto error;
}
#ifdef H5DEBUGIMPORT
- printf("h5dump SUBSET COUNT [%s] found\n", temp);
+ HDprintf("h5dump SUBSET COUNT [%s] found\n", temp);
#endif
while (get_next_dim) {
char *more = temp;
@@ -2014,7 +2014,7 @@ static int processConfigurationFile(char *infile, struct Input *in)
goto error;
}
#ifdef H5DEBUGIMPORT
- printf("h5dump SUBSET COUNT %s found\n", temp);
+ HDprintf("h5dump SUBSET COUNT %s found\n", temp);
#endif
if(!HDstrcmp(");", temp)) { /* end paren */
in->rank = ++icount;
@@ -2033,11 +2033,11 @@ static int processConfigurationFile(char *infile, struct Input *in)
in->sizeOfDimension[i] = temp_dims[i];
}
#ifdef H5DEBUGIMPORT
- printf("h5dump SUBSET COUNT dims: [%d]", in->rank);
+ HDprintf("h5dump SUBSET COUNT dims: [%d]", in->rank);
for (pndx = 0; pndx < in->rank; pndx++) {
- printf(" %ld", in->sizeOfDimension[pndx]);
+ HDprintf(" %ld", in->sizeOfDimension[pndx]);
}
- printf("\n");
+ HDprintf("\n");
#endif
in->configOptionVector[DIM] = 1;
} /* if(!HDstrcmp("(", key)) start paren */
@@ -2049,7 +2049,7 @@ static int processConfigurationFile(char *infile, struct Input *in)
goto error;
}
#ifdef H5DEBUGIMPORT
- printf("h5dump SUBSET %s found\n", temp);
+ HDprintf("h5dump SUBSET %s found\n", temp);
#endif
if(!HDstrcmp("(", temp)) { /* start paren */
int get_next_dim = 1;
@@ -2060,7 +2060,7 @@ static int processConfigurationFile(char *infile, struct Input *in)
goto error;
}
#ifdef H5DEBUGIMPORT
- printf("h5dump SUBSET BLOCK [%s] found\n", temp);
+ HDprintf("h5dump SUBSET BLOCK [%s] found\n", temp);
#endif
while (get_next_dim) {
char *more = temp;
@@ -2070,7 +2070,7 @@ static int processConfigurationFile(char *infile, struct Input *in)
goto error;
}
#ifdef H5DEBUGIMPORT
- printf("h5dump SUBSET BLOCK %s found\n", temp);
+ HDprintf("h5dump SUBSET BLOCK %s found\n", temp);
#endif
if(!HDstrcmp(");", temp)) { /* end paren */
in->rank = ++icount;
@@ -2089,11 +2089,11 @@ static int processConfigurationFile(char *infile, struct Input *in)
in->sizeOfDimension[i] = in->sizeOfDimension[i] * temp_dims[i];
}
#ifdef H5DEBUGIMPORT
- printf("h5dump SUBSET BLOCK dims: [%d]", in->rank);
+ HDprintf("h5dump SUBSET BLOCK dims: [%d]", in->rank);
for (pndx = 0; pndx < in->rank; pndx++) {
- printf(" %ld", in->sizeOfDimension[pndx]);
+ HDprintf(" %ld", in->sizeOfDimension[pndx]);
}
- printf("\n");
+ HDprintf("\n");
#endif
in->configOptionVector[DIM] = 1;
} /* if(!HDstrcmp("(", key)) start paren */
@@ -2103,7 +2103,7 @@ static int processConfigurationFile(char *infile, struct Input *in)
goto error;
}
#ifdef H5DEBUGIMPORT
- printf("h5dump SUBSET %s found\n", temp);
+ HDprintf("h5dump SUBSET %s found\n", temp);
#endif
if(!HDstrcmp("}", temp)) { /* end bracket */
get_next_prop = 0;
@@ -2112,7 +2112,7 @@ static int processConfigurationFile(char *infile, struct Input *in)
} /* else if(!HDstrcmp("SUBSET", key)) */
else if(!HDstrcmp("DATA", key)) { /* FINSHED */
#ifdef H5DEBUGIMPORT
- printf("h5dump DATA key\n");
+ HDprintf("h5dump DATA key\n");
#endif
scanret = 0;
break;
@@ -2120,32 +2120,32 @@ static int processConfigurationFile(char *infile, struct Input *in)
scanret = fscanf(strm, "%s", key);
}
#ifdef H5DEBUGIMPORT
- printf("h5dump path");
+ HDprintf("h5dump path");
for (pndx = 0; pndx < in->path.count; pndx++) {
- printf(" : %s", in->path.group[pndx]);
- }
- printf("\n");
- printf("h5dump inputClass=%d\n", in->inputClass);
- printf("h5dump inputSize=%d\n", in->inputSize);
- printf("h5dump inputArchitecture=%d\n", in->inputArchitecture);
- printf("h5dump inputByteOrder=%d\n", in->inputByteOrder);
- printf("h5dump rank=%d\n", in->rank);
- printf("h5dump outputClass=%d\n", in->outputClass);
- printf("h5dump outputSize=%d\n", in->outputSize);
- printf("h5dump outputArchitecture=%d\n", in->outputArchitecture);
- printf("h5dump outputByteOrder=%d\n", in->outputByteOrder);
- printf("h5dump compressionType=%d\n", in->compressionType);
- printf("h5dump compressionParam=%d\n", in->compressionParam);
- printf("h5dump externFilename=%s\n", in->externFilename);
- printf("h5dump sizeOfDimensions:\n");
+ HDprintf(" : %s", in->path.group[pndx]);
+ }
+ HDprintf("\n");
+ HDprintf("h5dump inputClass=%d\n", in->inputClass);
+ HDprintf("h5dump inputSize=%d\n", in->inputSize);
+ HDprintf("h5dump inputArchitecture=%d\n", in->inputArchitecture);
+ HDprintf("h5dump inputByteOrder=%d\n", in->inputByteOrder);
+ HDprintf("h5dump rank=%d\n", in->rank);
+ HDprintf("h5dump outputClass=%d\n", in->outputClass);
+ HDprintf("h5dump outputSize=%d\n", in->outputSize);
+ HDprintf("h5dump outputArchitecture=%d\n", in->outputArchitecture);
+ HDprintf("h5dump outputByteOrder=%d\n", in->outputByteOrder);
+ HDprintf("h5dump compressionType=%d\n", in->compressionType);
+ HDprintf("h5dump compressionParam=%d\n", in->compressionParam);
+ HDprintf("h5dump externFilename=%s\n", in->externFilename);
+ HDprintf("h5dump sizeOfDimensions:\n");
for (pndx = 0; pndx < in->rank; pndx++) {
- printf(" %ld\n", in->sizeOfDimension[pndx]);
+ HDprintf(" %ld\n", in->sizeOfDimension[pndx]);
}
#endif
}
else {
#ifdef H5DEBUGIMPORT
- printf("original option keyword parsing\n");
+ HDprintf("original option keyword parsing\n");
#endif
while (scanret == 1) {
if ((kindex = mapKeywordToIndex(key)) == -1) {
@@ -2655,7 +2655,7 @@ static int getInputClassType(struct Input *in, char * buffer)
}
in->outputByteOrder = kindex;
#ifdef H5DEBUGIMPORT
- printf("h5dump inputByteOrder %d\n", in->inputByteOrder);
+ HDprintf("h5dump inputByteOrder %d\n", in->inputByteOrder);
#endif
kindex = 4;
@@ -2676,7 +2676,7 @@ static int getInputClassType(struct Input *in, char * buffer)
}
in->outputByteOrder = kindex;
#ifdef H5DEBUGIMPORT
- printf("h5dump inputByteOrder %d\n", in->inputByteOrder);
+ HDprintf("h5dump inputByteOrder %d\n", in->inputByteOrder);
#endif
kindex = 4;
@@ -2697,7 +2697,7 @@ static int getInputClassType(struct Input *in, char * buffer)
}
in->outputByteOrder = kindex;
#ifdef H5DEBUGIMPORT
- printf("h5dump inputByteOrder %d\n", in->inputByteOrder);
+ HDprintf("h5dump inputByteOrder %d\n", in->inputByteOrder);
#endif
kindex = 4;
@@ -2718,7 +2718,7 @@ static int getInputClassType(struct Input *in, char * buffer)
}
in->outputByteOrder = kindex;
#ifdef H5DEBUGIMPORT
- printf("h5dump inputByteOrder %d\n", in->inputByteOrder);
+ HDprintf("h5dump inputByteOrder %d\n", in->inputByteOrder);
#endif
kindex = 4;
@@ -2739,7 +2739,7 @@ static int getInputClassType(struct Input *in, char * buffer)
}
in->outputByteOrder = kindex;
#ifdef H5DEBUGIMPORT
- printf("h5dump inputByteOrder %d\n", in->inputByteOrder);
+ HDprintf("h5dump inputByteOrder %d\n", in->inputByteOrder);
#endif
kindex = 4;
@@ -2760,7 +2760,7 @@ static int getInputClassType(struct Input *in, char * buffer)
}
in->outputByteOrder = kindex;
#ifdef H5DEBUGIMPORT
- printf("h5dump inputByteOrder %d\n", in->inputByteOrder);
+ HDprintf("h5dump inputByteOrder %d\n", in->inputByteOrder);
#endif
kindex = 4;
@@ -2781,7 +2781,7 @@ static int getInputClassType(struct Input *in, char * buffer)
}
in->outputByteOrder = kindex;
#ifdef H5DEBUGIMPORT
- printf("h5dump inputByteOrder %d\n", in->inputByteOrder);
+ HDprintf("h5dump inputByteOrder %d\n", in->inputByteOrder);
#endif
kindex = 4;
@@ -2802,7 +2802,7 @@ static int getInputClassType(struct Input *in, char * buffer)
}
in->outputByteOrder = kindex;
#ifdef H5DEBUGIMPORT
- printf("h5dump inputByteOrder %d\n", in->inputByteOrder);
+ HDprintf("h5dump inputByteOrder %d\n", in->inputByteOrder);
#endif
kindex = 4;
@@ -2823,7 +2823,7 @@ static int getInputClassType(struct Input *in, char * buffer)
}
in->outputByteOrder = kindex;
#ifdef H5DEBUGIMPORT
- printf("h5dump inputByteOrder %d\n", in->inputByteOrder);
+ HDprintf("h5dump inputByteOrder %d\n", in->inputByteOrder);
#endif
kindex = 7;
@@ -2844,7 +2844,7 @@ static int getInputClassType(struct Input *in, char * buffer)
}
in->outputByteOrder = kindex;
#ifdef H5DEBUGIMPORT
- printf("h5dump inputByteOrder %d\n", in->inputByteOrder);
+ HDprintf("h5dump inputByteOrder %d\n", in->inputByteOrder);
#endif
kindex = 7;
@@ -2865,7 +2865,7 @@ static int getInputClassType(struct Input *in, char * buffer)
}
in->outputByteOrder = kindex;
#ifdef H5DEBUGIMPORT
- printf("h5dump inputByteOrder %d\n", in->inputByteOrder);
+ HDprintf("h5dump inputByteOrder %d\n", in->inputByteOrder);
#endif
kindex = 7;
@@ -2886,7 +2886,7 @@ static int getInputClassType(struct Input *in, char * buffer)
}
in->outputByteOrder = kindex;
#ifdef H5DEBUGIMPORT
- printf("h5dump inputByteOrder %d\n", in->inputByteOrder);
+ HDprintf("h5dump inputByteOrder %d\n", in->inputByteOrder);
#endif
kindex = 7;
@@ -2907,7 +2907,7 @@ static int getInputClassType(struct Input *in, char * buffer)
}
in->outputByteOrder = kindex;
#ifdef H5DEBUGIMPORT
- printf("h5dump inputByteOrder %d\n", in->inputByteOrder);
+ HDprintf("h5dump inputByteOrder %d\n", in->inputByteOrder);
#endif
kindex = 7;
@@ -2928,7 +2928,7 @@ static int getInputClassType(struct Input *in, char * buffer)
}
in->outputByteOrder = kindex;
#ifdef H5DEBUGIMPORT
- printf("h5dump inputByteOrder %d\n", in->inputByteOrder);
+ HDprintf("h5dump inputByteOrder %d\n", in->inputByteOrder);
#endif
kindex = 7;
@@ -2949,7 +2949,7 @@ static int getInputClassType(struct Input *in, char * buffer)
}
in->outputByteOrder = kindex;
#ifdef H5DEBUGIMPORT
- printf("h5dump inputByteOrder %d\n", in->inputByteOrder);
+ HDprintf("h5dump inputByteOrder %d\n", in->inputByteOrder);
#endif
kindex = 7;
@@ -2970,7 +2970,7 @@ static int getInputClassType(struct Input *in, char * buffer)
}
in->outputByteOrder = kindex;
#ifdef H5DEBUGIMPORT
- printf("h5dump inputByteOrder %d\n", in->inputByteOrder);
+ HDprintf("h5dump inputByteOrder %d\n", in->inputByteOrder);
#endif
kindex = 7;
@@ -3111,7 +3111,7 @@ static int getInputClassType(struct Input *in, char * buffer)
}
in->outputByteOrder = kindex;
#ifdef H5DEBUGIMPORT
- printf("h5dump inputByteOrder %d\n", in->inputByteOrder);
+ HDprintf("h5dump inputByteOrder %d\n", in->inputByteOrder);
#endif
kindex = 3;
@@ -3132,7 +3132,7 @@ static int getInputClassType(struct Input *in, char * buffer)
}
in->outputByteOrder = kindex;
#ifdef H5DEBUGIMPORT
- printf("h5dump inputByteOrder %d\n", in->inputByteOrder);
+ HDprintf("h5dump inputByteOrder %d\n", in->inputByteOrder);
#endif
kindex = 3;
@@ -3153,7 +3153,7 @@ static int getInputClassType(struct Input *in, char * buffer)
}
in->outputByteOrder = kindex;
#ifdef H5DEBUGIMPORT
- printf("h5dump inputByteOrder %d\n", in->inputByteOrder);
+ HDprintf("h5dump inputByteOrder %d\n", in->inputByteOrder);
#endif
kindex = 3;
@@ -3174,7 +3174,7 @@ static int getInputClassType(struct Input *in, char * buffer)
}
in->outputByteOrder = kindex;
#ifdef H5DEBUGIMPORT
- printf("h5dump inputByteOrder %d\n", in->inputByteOrder);
+ HDprintf("h5dump inputByteOrder %d\n", in->inputByteOrder);
#endif
kindex = 3;
@@ -3250,7 +3250,7 @@ static int getInputClassType(struct Input *in, char * buffer)
}
in->outputByteOrder = kindex;
#ifdef H5DEBUGIMPORT
- printf("h5dump inputByteOrder %d\n", in->inputByteOrder);
+ HDprintf("h5dump inputByteOrder %d\n", in->inputByteOrder);
#endif
kindex = -1;
@@ -3269,7 +3269,7 @@ static int getInputClassType(struct Input *in, char * buffer)
}
in->outputByteOrder = kindex;
#ifdef H5DEBUGIMPORT
- printf("h5dump inputByteOrder %d\n", in->inputByteOrder);
+ HDprintf("h5dump inputByteOrder %d\n", in->inputByteOrder);
#endif
kindex = -1;
@@ -3288,7 +3288,7 @@ static int getInputClassType(struct Input *in, char * buffer)
}
in->outputByteOrder = kindex;
#ifdef H5DEBUGIMPORT
- printf("h5dump inputByteOrder %d\n", in->inputByteOrder);
+ HDprintf("h5dump inputByteOrder %d\n", in->inputByteOrder);
#endif
kindex = -1;
@@ -3307,7 +3307,7 @@ static int getInputClassType(struct Input *in, char * buffer)
}
in->outputByteOrder = kindex;
#ifdef H5DEBUGIMPORT
- printf("h5dump inputByteOrder %d\n", in->inputByteOrder);
+ HDprintf("h5dump inputByteOrder %d\n", in->inputByteOrder);
#endif
kindex = -1;
@@ -3326,7 +3326,7 @@ static int getInputClassType(struct Input *in, char * buffer)
}
in->outputByteOrder = kindex;
#ifdef H5DEBUGIMPORT
- printf("h5dump inputByteOrder %d\n", in->inputByteOrder);
+ HDprintf("h5dump inputByteOrder %d\n", in->inputByteOrder);
#endif
kindex = -1;
@@ -3345,7 +3345,7 @@ static int getInputClassType(struct Input *in, char * buffer)
}
in->outputByteOrder = kindex;
#ifdef H5DEBUGIMPORT
- printf("h5dump inputByteOrder %d\n", in->inputByteOrder);
+ HDprintf("h5dump inputByteOrder %d\n", in->inputByteOrder);
#endif
kindex = -1;
@@ -3364,7 +3364,7 @@ static int getInputClassType(struct Input *in, char * buffer)
}
in->outputByteOrder = kindex;
#ifdef H5DEBUGIMPORT
- printf("h5dump inputByteOrder %d\n", in->inputByteOrder);
+ HDprintf("h5dump inputByteOrder %d\n", in->inputByteOrder);
#endif
kindex = -1;
@@ -3383,7 +3383,7 @@ static int getInputClassType(struct Input *in, char * buffer)
}
in->outputByteOrder = kindex;
#ifdef H5DEBUGIMPORT
- printf("h5dump inputByteOrder %d\n", in->inputByteOrder);
+ HDprintf("h5dump inputByteOrder %d\n", in->inputByteOrder);
#endif
kindex = -1;
@@ -3422,9 +3422,9 @@ static int getInputClassType(struct Input *in, char * buffer)
if (in->configOptionVector[OUTPUT_SIZE] == 0)
in->outputSize = in->inputSize;
#ifdef H5DEBUGIMPORT
- printf("h5dump DATATYPE InClass %d inputSize\n", in->inputSize);
- printf("h5dump DATATYPE InClass %d outputSize\n", in->outputSize);
- printf("h5dump DATATYPE InClass %d outputArchitecture\n", in->outputArchitecture);
+ HDprintf("h5dump DATATYPE InClass %d inputSize\n", in->inputSize);
+ HDprintf("h5dump DATATYPE InClass %d outputSize\n", in->outputSize);
+ HDprintf("h5dump DATATYPE InClass %d outputArchitecture\n", in->outputArchitecture);
#endif
in->inputClass = kindex;
@@ -4631,7 +4631,7 @@ static int process(struct Options *opt)
intype = createInputDataType(in);
outtype = createOutputDataType(in);
#ifdef H5DEBUGIMPORT
- printf("process intype %ld outtype %ld\n", intype, outtype);
+ HDprintf("process intype %ld outtype %ld\n", intype, outtype);
#endif
/* create property list */
diff --git a/tools/src/h5jam/h5jam.c b/tools/src/h5jam/h5jam.c
index 01ba4af..4f3e7a4 100644
--- a/tools/src/h5jam/h5jam.c
+++ b/tools/src/h5jam/h5jam.c
@@ -221,7 +221,7 @@ main (int argc, const char *argv[])
/* Initialize h5tools lib */
h5tools_init();
- parse_command_line (argc, argv);
+ parse_command_line(argc, argv);
if (ub_file == NULL) {
/* no user block */
@@ -252,21 +252,21 @@ main (int argc, const char *argv[])
leave (EXIT_FAILURE);
}
- ifile = H5Fopen (input_file, H5F_ACC_RDONLY, H5P_DEFAULT);
+ ifile = H5Fopen(input_file, H5F_ACC_RDONLY, H5P_DEFAULT);
if (ifile < 0) {
error_msg("Can't open input HDF5 file \"%s\"\n", input_file);
leave (EXIT_FAILURE);
}
- plist = H5Fget_create_plist (ifile);
+ plist = H5Fget_create_plist(ifile);
if (plist < 0) {
error_msg("Can't get file creation plist for file \"%s\"\n", input_file);
H5Fclose(ifile);
leave (EXIT_FAILURE);
}
- status = H5Pget_userblock (plist, &usize);
+ status = H5Pget_userblock(plist, &usize);
if (status < 0) {
error_msg("Can't get user block for file \"%s\"\n", input_file);
H5Pclose(plist);
@@ -330,7 +330,7 @@ main (int argc, const char *argv[])
}
}
- newubsize = compute_user_block_size ((hsize_t) fsize);
+ newubsize = compute_user_block_size((hsize_t) fsize);
startub = usize;
@@ -345,22 +345,22 @@ main (int argc, const char *argv[])
else {
/* add new ub to current ublock, pad to new offset */
newubsize += usize;
- newubsize = compute_user_block_size ((hsize_t) newubsize);
+ newubsize = compute_user_block_size((hsize_t) newubsize);
}
}
/* copy the HDF5 from starting at usize to starting at newubsize:
* makes room at 'from' for new ub */
/* if no current ub, usize is 0 */
- copy_some_to_file (h5fid, ofid, usize, newubsize, (ssize_t) (h5fsize - usize));
+ copy_some_to_file(h5fid, ofid, usize, newubsize, (ssize_t) (h5fsize - usize));
/* copy the old ub to the beginning of the new file */
if (!do_clobber) {
- where = copy_some_to_file (h5fid, ofid, (hsize_t) 0, (hsize_t) 0, (ssize_t) usize);
+ where = copy_some_to_file(h5fid, ofid, (hsize_t) 0, (hsize_t) 0, (ssize_t) usize);
}
/* copy the new ub to the end of the ub */
- where = copy_some_to_file (ufid, ofid, (hsize_t) 0, startub, (ssize_t) - 1);
+ where = copy_some_to_file(ufid, ofid, (hsize_t) 0, startub, (ssize_t) - 1);
/* pad the ub */
if(write_pad(ofid, where, &where) < 0) {
@@ -372,18 +372,18 @@ main (int argc, const char *argv[])
} /* end if */
if(ub_file)
- HDfree (ub_file);
+ HDfree(ub_file);
if(input_file)
- HDfree (input_file);
+ HDfree(input_file);
if(output_file)
- HDfree (output_file);
+ HDfree(output_file);
if(ufid >= 0)
- HDclose (ufid);
+ HDclose(ufid);
if(h5fid >= 0)
- HDclose (h5fid);
+ HDclose(h5fid);
if(ofid >= 0)
- HDclose (ofid);
+ HDclose(ofid);
return h5tools_getstatus();
}
diff --git a/tools/src/h5stat/h5stat.c b/tools/src/h5stat/h5stat.c
index ff67cf1..dc1dc4a 100644
--- a/tools/src/h5stat/h5stat.c
+++ b/tools/src/h5stat/h5stat.c
@@ -24,11 +24,11 @@
/* Parameters to control statistics gathered */
/* Default threshold for small groups/datasets/attributes */
-#define DEF_SIZE_SMALL_GROUPS 10
-#define DEF_SIZE_SMALL_DSETS 10
-#define DEF_SIZE_SMALL_ATTRS 10
+#define DEF_SIZE_SMALL_GROUPS 10
+#define DEF_SIZE_SMALL_DSETS 10
+#define DEF_SIZE_SMALL_ATTRS 10
-#define SIZE_SMALL_SECTS 10
+#define SIZE_SMALL_SECTS 10
#define H5_NFILTERS_IMPL 8 /* Number of currently implemented filters + one to
accommodate for user-define filters + one
@@ -74,7 +74,7 @@ typedef struct iter_t {
ohdr_info_t group_ohdr_info; /* Object header information for groups */
hsize_t max_attrs; /* Maximum attributes from a group */
- unsigned long *num_small_attrs; /* Size of small attributes tracked */
+ unsigned long *num_small_attrs; /* Size of small attributes tracked */
unsigned attr_nbins; /* Number of bins for attribute counts */
unsigned long *attr_bins; /* Pointer to array of bins for attribute counts */
@@ -83,7 +83,7 @@ typedef struct iter_t {
hsize_t max_dset_dims; /* Maximum dimension size of dataset */
unsigned long *small_dset_dims; /* Size of dimensions of small datasets tracked */
unsigned long dset_layouts[H5D_NLAYOUTS]; /* Type of storage for each dataset */
- unsigned long dset_comptype[H5_NFILTERS_IMPL]; /* Number of currently implemented filters */
+ unsigned long dset_comptype[H5_NFILTERS_IMPL]; /* Number of currently implemented filters */
unsigned long dset_ntypes; /* Number of diff. dataset datatypes found */
dtype_info_t *dset_type_info; /* Pointer to dataset datatype information found */
unsigned dset_dim_nbins; /* Number of bins for dataset dimensions */
@@ -103,9 +103,9 @@ typedef struct iter_t {
hsize_t super_ext_size; /* superblock extension size */
hsize_t ublk_size; /* user block size (if exists) */
H5F_fspace_strategy_t fs_strategy; /* File space management strategy */
- hbool_t fs_persist; /* Free-space persist or not */
+ hbool_t fs_persist; /* Free-space persist or not */
hsize_t fs_threshold; /* Free-space section threshold */
- hsize_t fsp_size; /* File space page size */
+ hsize_t fsp_size; /* File space page size */
hsize_t free_space; /* Amount of freespace in the file */
hsize_t free_hdr; /* Size of free space manager metadata in the file */
unsigned long num_small_sects[SIZE_SMALL_SECTS]; /* Size of small free-space sections */
@@ -136,9 +136,9 @@ static int display_dset_metadata = FALSE; /* display file space info f
static int display_object = FALSE; /* not implemented yet */
/* Initialize threshold for small groups/datasets/attributes */
-static int sgroups_threshold = DEF_SIZE_SMALL_GROUPS;
-static int sdsets_threshold = DEF_SIZE_SMALL_DSETS;
-static int sattrs_threshold = DEF_SIZE_SMALL_ATTRS;
+static int sgroups_threshold = DEF_SIZE_SMALL_GROUPS;
+static int sdsets_threshold = DEF_SIZE_SMALL_DSETS;
+static int sattrs_threshold = DEF_SIZE_SMALL_ATTRS;
/* a structure for handling the order command-line parameters come in */
struct handler_t {
@@ -257,7 +257,7 @@ leave(int ret)
}
-
+
/*-------------------------------------------------------------------------
* Function: usage
*
@@ -297,7 +297,7 @@ static void usage(const char *prog)
HDfprintf(stdout, " --enable-error-stack Prints messages from the HDF5 error stack as they occur\n");
}
-
+
/*-------------------------------------------------------------------------
* Function: ceil_log10
*
@@ -324,7 +324,7 @@ ceil_log10(unsigned long x)
return ret;
} /* ceil_log10() */
-
+
/*-------------------------------------------------------------------------
* Function: attribute_stats
*
@@ -374,7 +374,7 @@ attribute_stats(iter_t *iter, const H5O_info_t *oi)
return 0;
} /* end attribute_stats() */
-
+
/*-------------------------------------------------------------------------
* Function: group_stats
*
@@ -456,7 +456,7 @@ done:
return ret_value;
} /* end group_stats() */
-
+
/*-------------------------------------------------------------------------
* Function: dataset_stats
*
@@ -648,7 +648,7 @@ done:
return ret_value;
} /* end dataset_stats() */
-
+
/*-------------------------------------------------------------------------
* Function: datatype_stats
*
@@ -680,7 +680,7 @@ done:
return ret_value;
} /* end datatype_stats() */
-
+
/*-------------------------------------------------------------------------
* Function: obj_stats
*
@@ -736,7 +736,7 @@ done:
return ret_value;
} /* end obj_stats() */
-
+
/*-------------------------------------------------------------------------
* Function: lnk_stats
*
@@ -834,7 +834,7 @@ freespace_stats(hid_t fid, iter_t *iter)
return 0;
} /* end freespace_stats() */
-
+
/*-------------------------------------------------------------------------
* Function: hand_free
*
@@ -863,7 +863,7 @@ hand_free(struct handler_t *hand)
} /* end if */
} /* end hand_free() */
-
+
/*-------------------------------------------------------------------------
* Function: parse_command_line
*
@@ -1041,7 +1041,7 @@ error:
return -1;
}
-
+
/*-------------------------------------------------------------------------
* Function: iter_free
*
@@ -1106,7 +1106,7 @@ iter_free(iter_t *iter)
} /* end if */
} /* end iter_free() */
-
+
/*-------------------------------------------------------------------------
* Function: print_file_info
*
@@ -1138,7 +1138,7 @@ print_file_info(const iter_t *iter)
return 0;
} /* print_file_info() */
-
+
/*-------------------------------------------------------------------------
* Function: print_file_metadata
*
@@ -1198,7 +1198,7 @@ print_file_metadata(const iter_t *iter)
return 0;
} /* print_file_metadata() */
-
+
/*-------------------------------------------------------------------------
* Function: print_group_info
*
@@ -1255,7 +1255,7 @@ print_group_info(const iter_t *iter)
return 0;
} /* print_group_info() */
-
+
/*-------------------------------------------------------------------------
* Function: print_group_metadata
*
@@ -1282,7 +1282,7 @@ print_group_metadata(const iter_t *iter)
return 0;
} /* print_group_metadata() */
-
+
/*-------------------------------------------------------------------------
* Function: print_dataset_info
*
@@ -1369,7 +1369,7 @@ print_dataset_info(const iter_t *iter)
return 0;
} /* print_dataset_info() */
-
+
/*-------------------------------------------------------------------------
* Function: print_dataset_metadata
*
@@ -1398,7 +1398,7 @@ print_dset_metadata(const iter_t *iter)
return 0;
} /* print_dset_metadata() */
-
+
/*-------------------------------------------------------------------------
* Function: print_dset_dtype_meta
*
@@ -1439,7 +1439,7 @@ print_dset_dtype_meta(const iter_t *iter)
return 0;
} /* print_dset_dtype_meta() */
-
+
/*-------------------------------------------------------------------------
* Function: print_attr_info
*
@@ -1488,7 +1488,7 @@ print_attr_info(const iter_t *iter)
return 0;
} /* print_attr_info() */
-
+
/*-------------------------------------------------------------------------
* Function: print_freespace_info
*
@@ -1538,7 +1538,7 @@ print_freespace_info(const iter_t *iter)
return 0;
} /* print_freespace_info() */
-
+
/*-------------------------------------------------------------------------
* Function: print_storage_summary
*
@@ -1602,7 +1602,7 @@ print_storage_summary(const iter_t *iter)
return 0;
} /* print_storage_summary() */
-
+
/*-------------------------------------------------------------------------
* Function: print_file_statistics
*
@@ -1649,7 +1649,7 @@ print_file_statistics(const iter_t *iter)
if(display_summary) print_storage_summary(iter);
} /* print_file_statistics() */
-
+
/*-------------------------------------------------------------------------
* Function: print_object_statistics
*
@@ -1672,7 +1672,7 @@ print_object_statistics(const char *name)
printf("Object name %s\n", name);
} /* print_object_statistics() */
-
+
/*-------------------------------------------------------------------------
* Function: print_statistics
*
@@ -1698,7 +1698,7 @@ print_statistics(const char *name, const iter_t *iter)
print_file_statistics(iter);
} /* print_statistics() */
-
+
/*-------------------------------------------------------------------------
* Function: main
*
@@ -1733,7 +1733,7 @@ main(int argc, const char *argv[])
/* Disable tools error reporting */
H5Eget_auto2(H5tools_ERR_STACK_g, &tools_func, &tools_edata);
H5Eset_auto2(H5tools_ERR_STACK_g, NULL, NULL);
-
+
HDmemset(&iter, 0, sizeof(iter));
if(parse_command_line(argc, argv, &hand) < 0)
@@ -1780,15 +1780,15 @@ main(int argc, const char *argv[])
iter.free_hdr = finfo.free.meta_size;
} /* end else */
- iter.num_small_groups = (unsigned long *)HDcalloc((size_t)sgroups_threshold, sizeof(unsigned long));
- iter.num_small_attrs = (unsigned long *)HDcalloc((size_t)(sattrs_threshold+1), sizeof(unsigned long));
- iter.small_dset_dims = (unsigned long *)HDcalloc((size_t)sdsets_threshold, sizeof(unsigned long));
+ iter.num_small_groups = (unsigned long *)HDcalloc((size_t)sgroups_threshold, sizeof(unsigned long));
+ iter.num_small_attrs = (unsigned long *)HDcalloc((size_t)(sattrs_threshold+1), sizeof(unsigned long));
+ iter.small_dset_dims = (unsigned long *)HDcalloc((size_t)sdsets_threshold, sizeof(unsigned long));
- if(iter.num_small_groups == NULL || iter.num_small_attrs == NULL || iter.small_dset_dims == NULL) {
- error_msg("Unable to allocate memory for tracking small groups/datasets/attributes\n");
+ if(iter.num_small_groups == NULL || iter.num_small_attrs == NULL || iter.small_dset_dims == NULL) {
+ error_msg("Unable to allocate memory for tracking small groups/datasets/attributes\n");
h5tools_setstatus(EXIT_FAILURE);
- goto done;
- }
+ goto done;
+ }
if((fcpl = H5Fget_create_plist(fid)) < 0)
warn_msg("Unable to retrieve file creation property\n");
diff --git a/tools/src/misc/h5debug.c b/tools/src/misc/h5debug.c
index b66e7ce..088e6e9 100644
--- a/tools/src/misc/h5debug.c
+++ b/tools/src/misc/h5debug.c
@@ -346,7 +346,7 @@ main(int argc, char *argv[])
/*
* Debug a global heap collection.
*/
- status = H5HG_debug (f, addr, stdout, 0, VCOL);
+ status = H5HG_debug(f, addr, stdout, 0, VCOL);
} else if(!HDmemcmp(sig, H5G_NODE_MAGIC, (size_t)H5_SIZEOF_MAGIC)) {
/*
diff --git a/tools/test/h5copy/CMakeTests.cmake b/tools/test/h5copy/CMakeTests.cmake
index 1bdefa6..924ade1 100644
--- a/tools/test/h5copy/CMakeTests.cmake
+++ b/tools/test/h5copy/CMakeTests.cmake
@@ -128,9 +128,10 @@
macro (ADD_SKIP_H5_TEST testname skipresultfile)
if (NOT HDF5_ENABLE_USING_MEMCHECKER)
add_test (
- NAME H5COPY-${testname}-${skipresultfile}-SKIPPED
+ NAME H5COPY-${testname}-${skipresultfile}
COMMAND ${CMAKE_COMMAND} -E echo "SKIP ${testname}-${skipresultfile} ${ARGN}"
)
+ set_property(TEST H5COPY-${testname}-${skipresultfile} PROPERTY DISABLED)
endif ()
endmacro ()
diff --git a/tools/test/h5dump/CMakeTests.cmake b/tools/test/h5dump/CMakeTests.cmake
index 57df850..f74ee50 100644
--- a/tools/test/h5dump/CMakeTests.cmake
+++ b/tools/test/h5dump/CMakeTests.cmake
@@ -439,9 +439,10 @@
if ("${testtype}" STREQUAL "SKIP")
if (NOT HDF5_ENABLE_USING_MEMCHECKER)
add_test (
- NAME H5DUMP-${skipresultfile}-SKIPPED
+ NAME H5DUMP-${skipresultfile}
COMMAND ${CMAKE_COMMAND} -E echo "SKIP ${skipresultfile} ${ARGN}"
)
+ set_property(TEST H5DUMP-${skipresultfile} PROPERTY DISABLED)
endif ()
else ()
ADD_H5_TEST (${skipresultfile} ${skipresultcode} ${ARGN})
diff --git a/tools/test/h5dump/CMakeTestsXML.cmake b/tools/test/h5dump/CMakeTestsXML.cmake
index 9c68e5f..de87d2f 100644
--- a/tools/test/h5dump/CMakeTestsXML.cmake
+++ b/tools/test/h5dump/CMakeTestsXML.cmake
@@ -164,9 +164,10 @@
if ("${testtype}" STREQUAL "SKIP")
if (NOT HDF5_ENABLE_USING_MEMCHECKER)
add_test (
- NAME H5DUMP_XML-${skipresultfile}-SKIPPED
+ NAME H5DUMP_XML-${skipresultfile}
COMMAND ${CMAKE_COMMAND} -E echo "SKIP ${skipresultfile}.xml --xml ${ARGN}"
)
+ set_property(TEST H5DUMP_XML-${skipresultfile} PROPERTY DISABLED)
endif ()
else ()
ADD_XML_H5_TEST (${skipresultfile} ${skipresultcode} ${ARGN})
diff --git a/tools/test/h5import/CMakeTests.cmake b/tools/test/h5import/CMakeTests.cmake
index 3c65b0b..7d76fba 100644
--- a/tools/test/h5import/CMakeTests.cmake
+++ b/tools/test/h5import/CMakeTests.cmake
@@ -283,9 +283,10 @@
macro (ADD_H5_SKIP_DUMPTEST testname datasetname testfile)
if (NOT HDF5_ENABLE_USING_MEMCHECKER)
add_test (
- NAME H5IMPORT-DUMP-${testname}-SKIPPED
+ NAME H5IMPORT-DUMP-${testname}
COMMAND ${CMAKE_COMMAND} -E echo "SKIP ${testname} ${datasetname} ${testfile} --- DEFLATE filter not available"
)
+ set_property(TEST H5IMPORT-DUMP-${testname} PROPERTY DISABLED)
endif ()
endmacro ()
diff --git a/tools/test/h5import/h5importtest.c b/tools/test/h5import/h5importtest.c
index 489bc01..bbb67b6 100644
--- a/tools/test/h5import/h5importtest.c
+++ b/tools/test/h5import/h5importtest.c
@@ -71,9 +71,9 @@ main(void)
volatile uint32_t ibyte=0x01234567;
/* 0 for big endian, 1 for little endian. */
if ((*((uint8_t*)(&ibyte))) == 0x67)
- strncpy(machine_order, "LE", 2);
+ HDstrncpy(machine_order, "LE", 2);
else
- strncpy(machine_order, "BE", 2);
+ HDstrncpy(machine_order, "BE", 2);
/*
diff --git a/tools/test/h5repack/CMakeTests.cmake b/tools/test/h5repack/CMakeTests.cmake
index f40c0b1..a063e19 100644
--- a/tools/test/h5repack/CMakeTests.cmake
+++ b/tools/test/h5repack/CMakeTests.cmake
@@ -229,9 +229,10 @@
if ("${testtype}" STREQUAL "SKIP")
if (NOT HDF5_ENABLE_USING_MEMCHECKER)
add_test (
- NAME H5REPACK_OLD-${testname}-SKIPPED
+ NAME H5REPACK_OLD-${testname}
COMMAND ${CMAKE_COMMAND} -E echo "SKIP ${ARGN} -i ${PROJECT_BINARY_DIR}/testfiles/${testfile} -o ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile}"
)
+ set_property(TEST H5REPACK_OLD-${testname} PROPERTY DISABLED)
endif ()
else ()
add_test (
@@ -260,9 +261,10 @@
if ("${testtype}" STREQUAL "SKIP")
if (NOT HDF5_ENABLE_USING_MEMCHECKER)
add_test (
- NAME H5REPACK-${testname}-SKIPPED
+ NAME H5REPACK-${testname}
COMMAND ${CMAKE_COMMAND} -E echo "SKIP ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile}"
)
+ set_property(TEST H5REPACK-${testname} PROPERTY DISABLED)
endif ()
else ()
add_test (
@@ -291,9 +293,10 @@
if ("${testtype}" STREQUAL "SKIP")
if (NOT HDF5_ENABLE_USING_MEMCHECKER)
add_test (
- NAME H5REPACK_CMP-${testname}-SKIPPED
+ NAME H5REPACK_CMP-${testname}
COMMAND ${CMAKE_COMMAND} -E echo "SKIP ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${resultfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${resultfile}"
)
+ set_property(TEST H5REPACK_CMP-${testname} PROPERTY DISABLED)
endif ()
else ()
# If using memchecker add tests without using scripts
@@ -338,9 +341,10 @@
if ("${testtype}" STREQUAL "SKIP")
if (NOT HDF5_ENABLE_USING_MEMCHECKER)
add_test (
- NAME H5REPACK_MASK-${testname}-SKIPPED
+ NAME H5REPACK_MASK-${testname}
COMMAND ${CMAKE_COMMAND} -E echo "SKIP ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${resultfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${resultfile}"
)
+ set_property(TEST H5REPACK_MASK-${testname} PROPERTY DISABLED)
endif ()
else ()
# If using memchecker add tests without using scripts
@@ -385,9 +389,10 @@
if ("${testtype}" STREQUAL "SKIP")
if (NOT HDF5_ENABLE_USING_MEMCHECKER)
add_test (
- NAME H5REPACK_DMP-${testname}-SKIPPED
+ NAME H5REPACK_DMP-${testname}
COMMAND ${CMAKE_COMMAND} -E echo "SKIP ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${resultfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${resultfile}"
)
+ set_property(TEST H5REPACK_DMP-${testname} PROPERTY DISABLED)
endif ()
else ()
add_test (
@@ -427,9 +432,10 @@
if ("${testtype}" STREQUAL "SKIP")
if (NOT HDF5_ENABLE_USING_MEMCHECKER)
add_test (
- NAME H5REPACK_STAT-${testname}-SKIPPED
+ NAME H5REPACK_STAT-${testname}
COMMAND ${CMAKE_COMMAND} -E echo "SKIP ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${resultfile} ${PROJECT_BINARY_DIR}/testfiles/out-${statarg}.${resultfile}"
)
+ set_property(TEST H5REPACK_STAT-${testname} PROPERTY DISABLED)
endif ()
else ()
add_test (
@@ -469,9 +475,10 @@
if ("${testtype}" STREQUAL "SKIP")
if (NOT HDF5_ENABLE_USING_MEMCHECKER)
add_test (
- NAME H5REPACK_VERIFY_LAYOUT-${testname}-SKIPPED
+ NAME H5REPACK_VERIFY_LAYOUT-${testname}
COMMAND ${CMAKE_COMMAND} -E echo "SKIP -d ${testdset} -pH ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${resultfile}"
)
+ set_property(TEST H5REPACK_VERIFY_LAYOUT-${testname} PROPERTY DISABLED)
endif ()
else ()
if (NOT HDF5_ENABLE_USING_MEMCHECKER)
@@ -542,9 +549,10 @@
if ("${testtype}" STREQUAL "SKIP")
if (NOT HDF5_ENABLE_USING_MEMCHECKER)
add_test (
- NAME H5REPACK_VERIFY_LAYOUT_VDS-${testname}-SKIPPED
+ NAME H5REPACK_VERIFY_LAYOUT_VDS-${testname}
COMMAND ${CMAKE_COMMAND} -E echo "SKIP -d ${testdset} -pH ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${resultfile}"
)
+ set_property(TEST H5REPACK_VERIFY_LAYOUT_VDS-${testname} PROPERTY DISABLED)
endif ()
else ()
if (NOT HDF5_ENABLE_USING_MEMCHECKER)
diff --git a/tools/test/h5repack/testfiles/h5repack_layout.h5-plugin_version_test.ddl b/tools/test/h5repack/testfiles/h5repack_layout.h5-plugin_version_test.ddl
index 0a68791..55bf8fe 100644
--- a/tools/test/h5repack/testfiles/h5repack_layout.h5-plugin_version_test.ddl
+++ b/tools/test/h5repack/testfiles/h5repack_layout.h5-plugin_version_test.ddl
@@ -11,7 +11,7 @@ GROUP "/" {
USER_DEFINED_FILTER {
FILTER_ID 260
COMMENT dynlib4
- PARAMS { 9 1 10 3 }
+ PARAMS { 9 1 10 4 }
}
}
FILLVALUE {
@@ -33,7 +33,7 @@ GROUP "/" {
USER_DEFINED_FILTER {
FILTER_ID 260
COMMENT dynlib4
- PARAMS { 9 1 10 3 }
+ PARAMS { 9 1 10 4 }
}
}
FILLVALUE {
@@ -55,7 +55,7 @@ GROUP "/" {
USER_DEFINED_FILTER {
FILTER_ID 260
COMMENT dynlib4
- PARAMS { 9 1 10 3 }
+ PARAMS { 9 1 10 4 }
}
}
FILLVALUE {
@@ -77,7 +77,7 @@ GROUP "/" {
USER_DEFINED_FILTER {
FILTER_ID 260
COMMENT dynlib4
- PARAMS { 9 1 10 3 }
+ PARAMS { 9 1 10 4 }
}
}
FILLVALUE {
@@ -99,7 +99,7 @@ GROUP "/" {
USER_DEFINED_FILTER {
FILTER_ID 260
COMMENT dynlib4
- PARAMS { 9 1 10 3 }
+ PARAMS { 9 1 10 4 }
}
}
FILLVALUE {
@@ -121,7 +121,7 @@ GROUP "/" {
USER_DEFINED_FILTER {
FILTER_ID 260
COMMENT dynlib4
- PARAMS { 9 1 10 3 }
+ PARAMS { 9 1 10 4 }
}
}
FILLVALUE {
@@ -143,7 +143,7 @@ GROUP "/" {
USER_DEFINED_FILTER {
FILTER_ID 260
COMMENT dynlib4
- PARAMS { 9 1 10 3 }
+ PARAMS { 9 1 10 4 }
}
}
FILLVALUE {
diff --git a/tools/test/perform/perf.c b/tools/test/perform/perf.c
index b421328..c6e62d5 100644
--- a/tools/test/perform/perf.c
+++ b/tools/test/perform/perf.c
@@ -63,13 +63,13 @@
#define H5FATAL 1
#define VRFY(val, mesg, fatal) do { \
if (!val) { \
- printf("Proc %d: ", mynod); \
+ printf("Proc %d: ", mynod); \
printf("*** Assertion failed (%s) at line %4d in %s\n", \
mesg, (int)__LINE__, __FILE__); \
- if (fatal){ \
+ if (fatal){ \
fflush(stdout); \
goto die_jar_jar_die; \
- } \
+ } \
} \
} while(0)
#define RANK 1
@@ -180,38 +180,38 @@ int main(int argc, char **argv)
/* setup file access template with parallel IO access. */
if (opt_split_vfd){
- hid_t mpio_pl;
-
- mpio_pl = H5Pcreate (H5P_FILE_ACCESS);
- VRFY((acc_tpl >= 0), "", H5FATAL);
- ret = H5Pset_fapl_mpio(mpio_pl, MPI_COMM_WORLD, MPI_INFO_NULL);
- VRFY((ret >= 0), "", H5FATAL);
-
- /* set optional allocation alignment */
- if (opt_alignment*opt_threshold != 1){
- ret = H5Pset_alignment(acc_tpl, opt_threshold, opt_alignment );
- VRFY((ret >= 0), "H5Pset_alignment succeeded", !H5FATAL);
- }
-
- /* setup file access template */
- acc_tpl = H5Pcreate (H5P_FILE_ACCESS);
- VRFY((acc_tpl >= 0), "", H5FATAL);
- ret = H5Pset_fapl_split(acc_tpl, meta_ext, mpio_pl, raw_ext, mpio_pl);
- VRFY((ret >= 0), "H5Pset_fapl_split succeeded", H5FATAL);
- ret = H5Pclose(mpio_pl);
- VRFY((ret >= 0), "H5Pclose mpio_pl succeeded", H5FATAL);
+ hid_t mpio_pl;
+
+ mpio_pl = H5Pcreate (H5P_FILE_ACCESS);
+ VRFY((acc_tpl >= 0), "", H5FATAL);
+ ret = H5Pset_fapl_mpio(mpio_pl, MPI_COMM_WORLD, MPI_INFO_NULL);
+ VRFY((ret >= 0), "", H5FATAL);
+
+ /* set optional allocation alignment */
+ if (opt_alignment*opt_threshold != 1){
+ ret = H5Pset_alignment(acc_tpl, opt_threshold, opt_alignment );
+ VRFY((ret >= 0), "H5Pset_alignment succeeded", !H5FATAL);
+ }
+
+ /* setup file access template */
+ acc_tpl = H5Pcreate (H5P_FILE_ACCESS);
+ VRFY((acc_tpl >= 0), "", H5FATAL);
+ ret = H5Pset_fapl_split(acc_tpl, meta_ext, mpio_pl, raw_ext, mpio_pl);
+ VRFY((ret >= 0), "H5Pset_fapl_split succeeded", H5FATAL);
+ ret = H5Pclose(mpio_pl);
+ VRFY((ret >= 0), "H5Pclose mpio_pl succeeded", H5FATAL);
}else{
- /* setup file access template */
- acc_tpl = H5Pcreate (H5P_FILE_ACCESS);
- VRFY((acc_tpl >= 0), "", H5FATAL);
- ret = H5Pset_fapl_mpio(acc_tpl, MPI_COMM_WORLD, MPI_INFO_NULL);
- VRFY((ret >= 0), "", H5FATAL);
-
- /* set optional allocation alignment */
- if (opt_alignment*opt_threshold != 1){
- ret = H5Pset_alignment(acc_tpl, opt_threshold, opt_alignment );
- VRFY((ret >= 0), "H5Pset_alignment succeeded", !H5FATAL);
- }
+ /* setup file access template */
+ acc_tpl = H5Pcreate (H5P_FILE_ACCESS);
+ VRFY((acc_tpl >= 0), "", H5FATAL);
+ ret = H5Pset_fapl_mpio(acc_tpl, MPI_COMM_WORLD, MPI_INFO_NULL);
+ VRFY((ret >= 0), "", H5FATAL);
+
+ /* set optional allocation alignment */
+ if (opt_alignment*opt_threshold != 1){
+ ret = H5Pset_alignment(acc_tpl, opt_threshold, opt_alignment );
+ VRFY((ret >= 0), "H5Pset_alignment succeeded", !H5FATAL);
+ }
}
h5_fixname_no_suffix(FILENAME[0], acc_tpl, filename, sizeof filename);
@@ -225,7 +225,7 @@ int main(int argc, char **argv)
sid = H5Screate_simple(RANK, dims, NULL);
VRFY((sid >= 0), "H5Screate_simple succeeded", H5FATAL);
dataset = H5Dcreate2(fid, "Dataset1", H5T_NATIVE_CHAR, sid,
- H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
VRFY((dataset >= 0), "H5Dcreate2 succeeded", H5FATAL);
/* create the memory dataspace and the file dataspace */