From 3c470c9db63424d8a07c1fb789ee8e8c513dd2a6 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Thu, 7 Oct 2010 20:55:21 -0500 Subject: [svn-r19543] Description: Bring r19411:19542 from trunk to revise_chunks branch. Tested on: FreeBSD/32 6.3 (duty) in debug mode FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x, w/C++ & FORTRAN, w/threadsafe, in debug mode Linux/64-amd64 2.6 (amani) w/Intel compilers, w/default API=1.6.x, w/C++ & FORTRAN, in production mode Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN, w/szip filter, w/threadsafe, in production mode Linux/PPC 2.6 (heiwa) w/C++ & FORTRAN, w/threadsafe, in debug mode Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN, in production mode Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in debug mode Mac OS X/32 10.6.4 (amazon) in debug mode Mac OS X/32 10.6.4 (amazon) w/C++ & FORTRAN, w/threadsafe, in production mode Mac OS X/32 10.6.4 (amazon) w/parallel, in debug mode --- CMakeLists.txt | 157 ++- MANIFEST | 4 +- Makefile.am | 2 +- Makefile.in | 22 +- README.txt | 2 +- bin/chkconfigure | 6 +- bin/config.guess | 93 +- c++/Makefile.in | 20 +- c++/examples/Makefile.am | 3 +- c++/examples/Makefile.in | 26 +- c++/examples/run-c++-ex.sh.in | 3 +- c++/src/CMakeLists.txt | 8 +- c++/src/Makefile.in | 22 +- c++/src/h5c++.in | 64 +- c++/test/Makefile.in | 20 +- config/cmake/CTestCustom.cmake | 38 + config/cmake/CTestCustom.ctest | 19 - config/cmake/ConfigureChecks.cmake | 231 ++-- config/cmake/H5pubconf.h.in | 4 + config/cmake/runTest.cmake | 6 +- config/cmake/vfdTest.cmake | 41 + config/cmake/xlatefile.c | 4 +- config/commence.am | 20 +- config/examples.am | 3 +- config/lt_vers.am | 2 +- configure.in | 5 +- examples/Makefile.am | 5 +- examples/Makefile.in | 28 +- examples/run-all-ex.sh | 18 +- examples/run-c-ex.sh.in | 3 +- fortran/Makefile.in | 20 +- fortran/examples/CMakeLists.txt | 8 +- fortran/examples/Makefile.am | 3 +- fortran/examples/Makefile.in | 26 +- fortran/examples/run-fortran-ex.sh.in | 3 +- fortran/src/CMakeLists.txt | 54 +- fortran/src/Makefile.in | 22 +- fortran/src/h5fc.in | 64 +- fortran/test/CMakeLists.txt | 36 +- fortran/test/Makefile.in | 20 +- fortran/testpar/CMakeLists.txt | 8 +- fortran/testpar/Makefile.in | 20 +- hl/Makefile.in | 20 +- hl/c++/Makefile.in | 20 +- hl/c++/examples/Makefile.am | 3 +- hl/c++/examples/Makefile.in | 26 +- hl/c++/examples/run-hlc++-ex.sh.in | 4 +- hl/c++/src/CMakeLists.txt | 8 +- hl/c++/src/Makefile.in | 22 +- hl/c++/test/Makefile.in | 20 +- hl/examples/Makefile.am | 5 +- hl/examples/Makefile.in | 28 +- hl/examples/run-hl-ex.sh | 12 +- hl/examples/run-hlc-ex.sh.in | 3 +- hl/fortran/Makefile.in | 20 +- hl/fortran/examples/Makefile.am | 3 +- hl/fortran/examples/Makefile.in | 26 +- hl/fortran/examples/run-hlfortran-ex.sh.in | 3 +- hl/fortran/src/CMakeLists.txt | 27 +- hl/fortran/src/Makefile.in | 22 +- hl/fortran/test/CMakeLists.txt | 14 + hl/fortran/test/Makefile.in | 20 +- hl/src/CMakeLists.txt | 8 +- hl/src/Makefile.in | 22 +- hl/test/CMakeLists.txt | 27 + hl/test/Makefile.in | 20 +- hl/tools/CMakeLists.txt | 2 +- hl/tools/Makefile.in | 20 +- hl/tools/gif2h5/Makefile.in | 20 +- perform/CMakeLists.txt | 15 + perform/Makefile.in | 20 +- release_docs/CMake.txt | 123 +- release_docs/RELEASE.txt | 26 +- src/CMakeLists.txt | 4 +- src/H5Aint.c | 3 +- src/H5C.c | 2 +- src/H5Dchunk.c | 139 ++- src/H5Dcontig.c | 983 ++++++++------- src/H5Defl.c | 216 ++-- src/H5Dint.c | 2 +- src/H5Dpkg.h | 8 +- src/H5G.c | 16 +- src/H5Gent.c | 85 +- src/H5Glink.c | 5 +- src/H5Gloc.c | 5 +- src/H5Gnode.c | 24 +- src/H5Gobj.c | 29 +- src/H5Goh.c | 2 +- src/H5Gpkg.h | 41 +- src/H5Gprivate.h | 5 - src/H5Groot.c | 9 +- src/H5Gstab.c | 11 +- src/H5Gtraverse.c | 10 +- src/H5L.c | 8 +- src/H5Ocopy.c | 66 +- src/H5Opkg.h | 2 + src/H5Oprivate.h | 3 +- src/H5Oshared.c | 3 +- src/H5Ostab.c | 12 +- src/H5Shyper.c | 1794 +++++++++++++++++----------- src/H5Sselect.c | 4 +- src/H5V.c | 433 ++++++- src/H5Vprivate.h | 11 +- src/H5private.h | 2 +- src/H5public.h | 4 +- src/Makefile.in | 22 +- test/CMakeLists.txt | 110 ++ test/Makefile.in | 20 +- test/dsets.c | 4 +- test/dt_arith.c | 2 +- test/filter_fail.c | 89 +- test/testlibinfo.sh.in | 5 + test/th5s.c | 4 +- test/tselect.c | 218 ++-- testpar/Makefile.in | 20 +- testpar/t_rank_projection.c | 618 +++++++++- tools/Makefile.in | 20 +- tools/h5copy/CMakeLists.txt | 26 +- tools/h5copy/Makefile.in | 20 +- tools/h5diff/CMakeLists.txt | 404 ++++++- tools/h5diff/Makefile.in | 20 +- tools/h5diff/h5diff_common.c | 24 + tools/h5diff/testfiles/h5diff_10.txt | 24 + tools/h5diff/testfiles/h5diff_484.txt | 11 + tools/h5diff/testfiles/h5diff_600.txt | 24 + tools/h5diff/testfiles/h5diff_603.txt | 24 + tools/h5diff/testfiles/h5diff_606.txt | 24 + tools/h5diff/testfiles/h5diff_612.txt | 24 + tools/h5diff/testfiles/h5diff_615.txt | 24 + tools/h5diff/testfiles/h5diff_621.txt | 24 + tools/h5diff/testfiles/h5diff_622.txt | 24 + tools/h5diff/testfiles/h5diff_623.txt | 24 + tools/h5diff/testfiles/h5diff_624.txt | 24 + tools/h5diff/testh5diff.sh | 6 +- tools/h5dump/CMakeLists.txt | 390 +++++- tools/h5dump/Makefile.in | 20 +- tools/h5import/CMakeLists.txt | 18 +- tools/h5import/Makefile.in | 20 +- tools/h5jam/CMakeLists.txt | 2 +- tools/h5jam/Makefile.in | 20 +- tools/h5ls/CMakeLists.txt | 107 +- tools/h5ls/Makefile.in | 20 +- tools/h5repack/CMakeLists.txt | 68 +- tools/h5repack/Makefile.in | 20 +- tools/h5stat/CMakeLists.txt | 37 +- tools/h5stat/Makefile.in | 20 +- tools/lib/CMakeLists.txt | 8 +- tools/lib/Makefile.in | 20 +- tools/lib/h5diff.c | 26 +- tools/misc/CMakeLists.txt | 28 +- tools/misc/Makefile.in | 20 +- tools/misc/h5cc.in | 73 +- vms/src/h5pubconf.h | 6 +- windows/src/H5pubconf.h | 6 +- windows/tools/h5diff/testh5diff.bat | 22 +- windows/tools/h5repack/h5repack.bat | 184 ++- 156 files changed, 6326 insertions(+), 2405 deletions(-) create mode 100755 config/cmake/CTestCustom.cmake delete mode 100755 config/cmake/CTestCustom.ctest create mode 100644 config/cmake/vfdTest.cmake create mode 100644 tools/h5diff/testfiles/h5diff_484.txt diff --git a/CMakeLists.txt b/CMakeLists.txt index b8bfb33..49a4d5f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -222,9 +222,9 @@ INCLUDE (${HDF5_RESOURCES_DIR}/ConfigureChecks.cmake) #----------------------------------------------------------------------------- # Option to use legacy naming for windows libs/programs, default is legacy #----------------------------------------------------------------------------- -IF (WIN32) +IF (WIN32 AND NOT CYGWIN) OPTION (H5_LEGACY_NAMING "Use Legacy Names for Libraries and Programs" ON) -ENDIF (WIN32) +ENDIF (WIN32 AND NOT CYGWIN) #----------------------------------------------------------------------------- # Option to Build Shared/Static libs, default is static @@ -276,6 +276,14 @@ IF (HDF5_ENABLE_COVERAGE) ENDIF (HDF5_ENABLE_COVERAGE) #----------------------------------------------------------------------------- +# Option to indicate using a memory checker +#----------------------------------------------------------------------------- +OPTION (HDF5_ENABLE_USING_MEMCHECKER "Indicate that a memory checker is used" OFF) +IF (HDF5_ENABLE_USING_MEMCHECKER) + SET (H5_USING_MEMCHECKER 1) +ENDIF (HDF5_ENABLE_USING_MEMCHECKER) + +#----------------------------------------------------------------------------- # When building utility executables that generate other (source) files : # we make use of the following variables defined in the root CMakeLists. # Certain systems may add /Debug or /Release to output paths @@ -284,8 +292,10 @@ ENDIF (HDF5_ENABLE_COVERAGE) SET (EXE_EXT "") IF (WIN32) SET (EXE_EXT ".exe") - ADD_DEFINITIONS (-DBIND_TO_CURRENT_VCLIBS_VERSION=1) - ADD_DEFINITIONS (-D_CRT_SECURE_NO_WARNINGS) + IF (NOT CYGWIN) + ADD_DEFINITIONS (-DBIND_TO_CURRENT_VCLIBS_VERSION=1) + ADD_DEFINITIONS (-D_CRT_SECURE_NO_WARNINGS) + ENDIF (NOT CYGWIN) ENDIF (WIN32) SET (MAKE_SYSTEM) @@ -345,9 +355,9 @@ IF (HDF5_DISABLE_COMPILER_WARNINGS) CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /w") ENDIF (MSVC) - IF (WIN32) + IF (WIN32 AND NOT CYGWIN) ADD_DEFINITIONS (-D_CRT_SECURE_NO_WARNINGS) - ENDIF (WIN32) + ENDIF (WIN32 AND NOT CYGWIN) # Borland uses -w- to suppress warnings. IF (BORLAND) SET (HDF5_WARNINGS_BLOCKED 1) @@ -433,20 +443,57 @@ HDF5_SETUP_FILTERS (FLETCHER32) HDF5_SETUP_FILTERS (NBIT) HDF5_SETUP_FILTERS (SCALEOFFSET) +INCLUDE (ExternalProject) +OPTION (HDF5_ALLOW_EXTERNAL_SUPPORT "Allow External Library Building" "NO") + #----------------------------------------------------------------------------- # Option for ZLib support #----------------------------------------------------------------------------- OPTION (HDF5_ENABLE_Z_LIB_SUPPORT "Enable Zlib Filters" OFF) IF (HDF5_ENABLE_Z_LIB_SUPPORT) IF (NOT H5_ZLIB_HEADER) - FIND_PACKAGE (ZLIB REQUIRED) + FIND_PACKAGE (ZLIB) IF (ZLIB_FOUND) SET (H5_HAVE_FILTER_DEFLATE 1) SET (H5_HAVE_ZLIB_H 1) SET (H5_HAVE_LIBZ 1) SET (H5_ZLIB_HEADER "zlib.h") ELSE (ZLIB_FOUND) - MESSAGE (FATAL " ZLib is Required for ZLib support in HDF5") + IF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN") + EXTERNALPROJECT_ADD (ZLIB + SVN_REPOSITORY http://svn.hdfgroup.uiuc.edu/zlib/trunk + # [SVN_REVISION rev] + INSTALL_COMMAND "" + CMAKE_ARGS + -DBUILD_SHARED_LIBS:BOOL=${BUILD_SHARED_LIBS} + ) + EXTERNALPROJECT_GET_PROPERTY (ZLIB BINARY_DIR SOURCE_DIR) + + IF (BUILD_SHARED_LIBS) + SET (ZLIB_LIBRARY + "${BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}/${CMAKE_IMPORT_LIBRARY_PREFIX}zlib1${CMAKE_IMPORT_LIBRARY_SUFFIX}" + ) + ELSE (BUILD_SHARED_LIBS) + SET (ZLIB_LIBRARY + "${BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}/libzlib${CMAKE_STATIC_LIBRARY_SUFFIX}" + ) + ENDIF (BUILD_SHARED_LIBS) + SET (ZLIB_INCLUDE_DIR_GEN + "${BINARY_DIR}" + ) + SET (ZLIB_INCLUDE_DIR + "${SOURCE_DIR}/src" + ) + + SET (ZLIB_FOUND 1) + SET (ZLIB_LIBRARIES ${ZLIB_LIBRARY}) + SET (ZLIB_INCLUDE_DIRS ${ZLIB_INCLUDE_DIR_GEN} ${ZLIB_INCLUDE_DIR}) + SET (H5_HAVE_FILTER_DEFLATE 1) + SET (H5_HAVE_ZLIB_H 1) + SET (H5_HAVE_LIBZ 1) + ELSE (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN") + MESSAGE (FATAL " ZLib is Required for ZLib support in HDF5") + ENDIF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN") ENDIF (ZLIB_FOUND) ELSE (NOT H5_ZLIB_HEADER) # This project is being called from within another and ZLib is already configured @@ -465,29 +512,63 @@ ENDIF (HDF5_ENABLE_Z_LIB_SUPPORT) SET (CMAKE_MODULE_PATH ${HDF5_RESOURCES_DIR} ${CMAKE_MODULE_PATH}) OPTION (HDF5_ENABLE_SZIP_SUPPORT "Use SZip Filter" OFF) IF (HDF5_ENABLE_SZIP_SUPPORT) - FIND_PACKAGE (SZIP REQUIRED) + OPTION (HDF5_ENABLE_SZIP_ENCODING "Use SZip Encoding" OFF) + FIND_PACKAGE (SZIP) IF (SZIP_FOUND) SET (H5_HAVE_FILTER_SZIP 1) SET (H5_HAVE_SZLIB_H 1) SET (H5_HAVE_LIBSZ 1) - SET (LINK_LIBS ${LINK_LIBS} ${SZIP_LIBRARIES}) - INCLUDE_DIRECTORIES (${SZIP_INCLUDE_DIRS}) -# MESSAGE (STATUS "SZIP_INCLUDE_DIRS: ${SZIP_INCLUDE_DIRS}") -# MESSAGE (STATUS "SZIP_INCLUDE_DIR: ${SZIP_INCLUDE_DIR}") - MESSAGE (STATUS "Filter SZIP is ON") - OPTION (HDF5_ENABLE_SZIP_ENCODING "Use SZip Encoding" OFF) - IF (HDF5_ENABLE_SZIP_ENCODING) - SET (H5_HAVE_SZIP_ENCODER 1) - ENDIF (HDF5_ENABLE_SZIP_ENCODING) ELSE (SZIP_FOUND) + IF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN") + EXTERNALPROJECT_ADD (SZIP + SVN_REPOSITORY http://svn.hdfgroup.uiuc.edu/szip/trunk + # [SVN_REVISION rev] + INSTALL_COMMAND "" + CMAKE_ARGS + -DBUILD_SHARED_LIBS:BOOL=${BUILD_SHARED_LIBS} + -DSZIP_ENABLE_ENCODING:BOOL=${HDF5_ENABLE_SZIP_ENCODING} + ) + EXTERNALPROJECT_GET_PROPERTY (SZIP BINARY_DIR SOURCE_DIR) + + + IF (BUILD_SHARED_LIBS) + SET (SZIP_LIBRARY + "${BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}/${CMAKE_IMPORT_LIBRARY_PREFIX}szip${CMAKE_IMPORT_LIBRARY_SUFFIX}" + ) + ELSE (BUILD_SHARED_LIBS) + SET (SZIP_LIBRARY + "${BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}/libszip${CMAKE_STATIC_LIBRARY_SUFFIX}" + ) + ENDIF (BUILD_SHARED_LIBS) + SET (SZIP_INCLUDE_DIR_GEN + "${BINARY_DIR}" + ) + SET (SZIP_INCLUDE_DIR + "${SOURCE_DIR}/src" + ) + + SET (SZIP_FOUND 1) + SET (SZIP_LIBRARIES ${SZIP_LIBRARY}) + SET (SZIP_INCLUDE_DIRS ${SZIP_INCLUDE_DIR_GEN} ${SZIP_INCLUDE_DIR}) + SET (H5_HAVE_FILTER_SZIP 1) + SET (H5_HAVE_SZLIB_H 1) + SET (H5_HAVE_LIBSZ 1) + ELSE (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN") MESSAGE (FATAL_ERROR "SZIP is Required for SZIP support in HDF5") + ENDIF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN") ENDIF (SZIP_FOUND) + SET (LINK_LIBS ${LINK_LIBS} ${SZIP_LIBRARIES}) + INCLUDE_DIRECTORIES (${SZIP_INCLUDE_DIRS}) + MESSAGE (STATUS "Filter SZIP is ON") + IF (HDF5_ENABLE_SZIP_ENCODING) + SET (H5_HAVE_SZIP_ENCODER 1) + ENDIF (HDF5_ENABLE_SZIP_ENCODING) ENDIF (HDF5_ENABLE_SZIP_SUPPORT) #----------------------------------------------------------------------------- # Option for external libraries on windows #----------------------------------------------------------------------------- -IF (WIN32) +IF (WIN32 AND NOT CYGWIN) OPTION (HDF5_PACKAGE_EXTLIBS "CPACK - include external libraries" OFF) IF (BUILD_SHARED_LIBS) FILE (MAKE_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${BLDTYPE}) @@ -498,8 +579,8 @@ IF (WIN32) GET_FILENAME_COMPONENT(ZLIB_BIN_PATH ${ZLIB_LIBRARY} PATH) # MESSAGE (STATUS "ZLIB_BIN_PATH: ${ZLIB_BIN_PATH}") ADD_CUSTOM_TARGET (ZLIB-Release-Copy ALL - COMMAND ${CMAKE_COMMAND} -E copy_if_different ${ZLIB_BIN_PATH}/${ZLIB_DLL_NAME}.dll ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/ - COMMENT "Copying ${ZLIB_BIN_PATH}/${ZLIB_DLL_NAME}.dll to ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/" + COMMAND ${CMAKE_COMMAND} -E copy_if_different ${ZLIB_BIN_PATH}/${ZLIB_DLL_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/ + COMMENT "Copying ${ZLIB_BIN_PATH}/${ZLIB_DLL_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX} to ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/" ) ENDIF (HDF5_ENABLE_Z_LIB_SUPPORT AND ZLIB_FOUND) @@ -509,25 +590,25 @@ IF (WIN32) GET_FILENAME_COMPONENT(SZIP_BIN_PATH ${SZIP_LIBRARY} PATH) # MESSAGE (STATUS "SZIP_BIN_PATH: ${SZIP_BIN_PATH}") ADD_CUSTOM_TARGET (SZIP-Release-Copy ALL - COMMAND ${CMAKE_COMMAND} -E copy_if_different ${SZIP_BIN_PATH}/${SZIP_DLL_NAME}.dll ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/ - COMMENT "Copying ${SZIP_BIN_PATH}/${SZIP_DLL_NAME}.dll to ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/" + COMMAND ${CMAKE_COMMAND} -E copy_if_different ${SZIP_BIN_PATH}/${SZIP_DLL_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/ + COMMENT "Copying ${SZIP_BIN_PATH}/${SZIP_DLL_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX} to ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/" ) ENDIF (HDF5_ENABLE_SZIP_SUPPORT AND SZIP_FOUND) ENDIF (BUILD_SHARED_LIBS) -ENDIF (WIN32) +ENDIF (WIN32 AND NOT CYGWIN) #----------------------------------------------------------------------------- # Option to use threadsafe # Note: Currently CMake only allows configuring of threadsafe on WINDOWS. #----------------------------------------------------------------------------- -IF (WIN32) +IF (WIN32 AND NOT CYGWIN) OPTION (HDF5_ENABLE_THREADSAFE "Enable Threadsafety" OFF) IF (HDF5_ENABLE_THREADSAFE) SET (H5_HAVE_WIN_THREADS 1) SET (H5_HAVE_THREADSAFE 1) ENDIF (HDF5_ENABLE_THREADSAFE) -ENDIF (WIN32) +ENDIF (WIN32 AND NOT CYGWIN) #----------------------------------------------------------------------------- # Option to use PACKED BITS SUPPORT @@ -543,6 +624,15 @@ ENDIF (HDF5_USE_H5DUMP_PACKED_BITS) #----------------------------------------------------------------------------- ADD_SUBDIRECTORY (${HDF5_SOURCE_DIR}/src ${PROJECT_BINARY_DIR}/src) +IF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN") + IF (ZLIB_FOUND) + ADD_DEPENDENCIES (${HDF5_LIB_TARGET} ZLIB) + ENDIF (ZLIB_FOUND) + IF (SZIP_FOUND) + ADD_DEPENDENCIES (${HDF5_LIB_TARGET} SZIP) + ENDIF (SZIP_FOUND) +ENDIF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN") + #----------------------------------------------------------------------------- # Build utility to copy and strip X lines of file #----------------------------------------------------------------------------- @@ -577,6 +667,7 @@ IF (BUILD_TESTING) ENDIF (H5_HAVE_PARALLEL) ENDIF (NOT HDF5_EXTERNALLY_CONFIGURED) INCLUDE (${HDF5_SOURCE_DIR}/CTestConfig.cmake) + CONFIGURE_FILE (${HDF5_RESOURCES_DIR}/CTestCustom.cmake ${HDF5_BINARY_DIR}/CTestCustom.ctest @ONLY) ENDIF (BUILD_TESTING) #----------------------------------------------------------------------------- @@ -664,7 +755,7 @@ IF (NOT HDF5_EXTERNALLY_CONFIGURED) IF (HDF5_PACKAGE_EXTLIBS) IF (HDF5_ENABLE_Z_LIB_SUPPORT AND ZLIB_FOUND) INSTALL ( - FILES ${ZLIB_INCLUDE_DIR}/zconf.h ${ZLIB_INCLUDE_DIR}/zlib.h + FILES ${ZLIB_INCLUDE_DIR_GEN}/zconf.h ${ZLIB_INCLUDE_DIR}/zlib.h DESTINATION ${HDF5_INSTALL_INCLUDE_DIR} COMPONENT headers ) @@ -679,7 +770,7 @@ IF (NOT HDF5_EXTERNALLY_CONFIGURED) GET_FILENAME_COMPONENT(ZLIB_BIN_PATH ${ZLIB_LIBRARY} PATH) # message(STATUS "ZLIB_BIN_PATH: ${ZLIB_BIN_PATH}") INSTALL( - FILES ${ZLIB_BIN_PATH}/${ZLIB_DLL_NAME}.dll + FILES ${ZLIB_BIN_PATH}/${ZLIB_DLL_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX} DESTINATION ${HDF5_INSTALL_BIN_DIR} COMPONENT libraries ) @@ -687,7 +778,7 @@ IF (NOT HDF5_EXTERNALLY_CONFIGURED) ENDIF (HDF5_ENABLE_Z_LIB_SUPPORT AND ZLIB_FOUND) IF (HDF5_ENABLE_SZIP_SUPPORT AND SZIP_FOUND) INSTALL ( - FILES ${SZIP_INCLUDE_DIR}/SZconfig.h ${SZIP_INCLUDE_DIR}/szlib.h ${SZIP_INCLUDE_DIR}/szip_adpt.h ${SZIP_INCLUDE_DIR}/ricehdf.h + FILES ${SZIP_INCLUDE_DIR_GEN}/SZconfig.h ${SZIP_INCLUDE_DIR}/szlib.h ${SZIP_INCLUDE_DIR}/szip_adpt.h ${SZIP_INCLUDE_DIR}/ricehdf.h DESTINATION ${HDF5_INSTALL_INCLUDE_DIR} COMPONENT headers ) @@ -702,7 +793,7 @@ IF (NOT HDF5_EXTERNALLY_CONFIGURED) GET_FILENAME_COMPONENT(SZIP_BIN_PATH ${SZIP_LIBRARY} PATH) # message(STATUS "SZIP_BIN_PATH: ${ZLIB_BIN_PATH}") INSTALL( - FILES ${SZIP_BIN_PATH}/${SZIP_DLL_NAME}.dll + FILES ${SZIP_BIN_PATH}/${SZIP_DLL_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX} DESTINATION ${HDF5_INSTALL_BIN_DIR} COMPONENT libraries ) @@ -717,7 +808,7 @@ ENDIF (NOT HDF5_EXTERNALLY_CONFIGURED) IF (NOT HDF5_EXTERNALLY_CONFIGURED) INSTALL ( EXPORT ${HDF5_EXPORTED_TARGETS} - DESTINATION lib/cmake/hdf5-${HDF5_PACKAGE_VERSION} + DESTINATION ${HDF5_INSTALL_LIB_DIR}/cmake/hdf5-${HDF5_PACKAGE_VERSION} FILE hdf5-targets.cmake ) ENDIF (NOT HDF5_EXTERNALLY_CONFIGURED) @@ -758,7 +849,7 @@ IF (NOT HDF5_EXTERNALLY_CONFIGURED) ) INSTALL ( FILES ${HDF5_BINARY_DIR}/CMakeFiles/hdf5-config.cmake - DESTINATION lib/cmake/hdf5-${HDF5_PACKAGE_VERSION} + DESTINATION ${HDF5_INSTALL_LIB_DIR}/cmake/hdf5-${HDF5_PACKAGE_VERSION} ) ENDIF (NOT HDF5_EXTERNALLY_CONFIGURED) @@ -772,7 +863,7 @@ IF (NOT HDF5_EXTERNALLY_CONFIGURED) ) INSTALL ( FILES ${HDF5_BINARY_DIR}/CMakeFiles/hdf5-config-version.cmake - DESTINATION lib/cmake/hdf5-${HDF5_PACKAGE_VERSION} + DESTINATION ${HDF5_INSTALL_LIB_DIR}/cmake/hdf5-${HDF5_PACKAGE_VERSION} ) ENDIF (NOT HDF5_EXTERNALLY_CONFIGURED) diff --git a/MANIFEST b/MANIFEST index 8483e64..b1f4ee2 100644 --- a/MANIFEST +++ b/MANIFEST @@ -1632,6 +1632,7 @@ ./tools/h5diff/testfiles/h5diff_481.txt ./tools/h5diff/testfiles/h5diff_482.txt ./tools/h5diff/testfiles/h5diff_483.txt +./tools/h5diff/testfiles/h5diff_484.txt ./tools/h5diff/testfiles/h5diff_500.txt ./tools/h5diff/testfiles/h5diff_501.txt ./tools/h5diff/testfiles/h5diff_502.txt @@ -1967,7 +1968,8 @@ ./config/cmake/cacheinit.cmake ./config/cmake/grepTest.cmake ./config/cmake/runTest.cmake -./config/cmake/CTestCustom.ctest +./config/cmake/vfdTest.cmake +./config/cmake/CTestCustom.cmake ./config/cmake/ConfigureChecks.cmake ./CMakeLists.txt ./CTestConfig.cmake diff --git a/Makefile.am b/Makefile.am index 179fb17..640fdcb 100755 --- a/Makefile.am +++ b/Makefile.am @@ -153,7 +153,7 @@ uninstall-doc: # be successfully built installcheck-local: if test -n "${DESTDIR}"; then \ - (cd ${DESTDIR}/$(bindir) && pwd && ./h5redeploy -force); \ + (cd ${DESTDIR}$(bindir) && pwd && ./h5redeploy -force); \ fi @(cd examples && $(MAKE) $(AM_MAKEFLAGS) $@) || exit 1; diff --git a/Makefile.in b/Makefile.in index 79ed47e..74fa836 100644 --- a/Makefile.in +++ b/Makefile.in @@ -375,14 +375,24 @@ LIBH5_HL = $(top_builddir)/hl/src/libhdf5_hl.la LIBH5F_HL = $(top_builddir)/hl/fortran/src/libhdf5hl_fortran.la LIBH5CPP_HL = $(top_builddir)/hl/c++/src/libhdf5_hl_cpp.la +# Note that in svn revision 19400 the '/' after DESTDIR in H5* variables below +# has been removed. According to the official description of DESTDIR by Gnu at +# http://www.gnu.org/prep/standards/html_node/DESTDIR.html, DESTDIR is +# prepended to the normal and complete install path that it precedes for the +# purpose of installing in a temporary directory which is useful for building +# rpms and other packages. The '/' after ${DESTDIR} will be followed by another +# '/' at the beginning of the normal install path. When DESTDIR is empty the +# path then begins with '//', which is incorrect and causes problems at least for +# Cygwin. + # Scripts used to build examples # If only shared libraries have been installed, have h5cc build examples with # shared libraries instead of static libraries -H5CC = $(bindir)/h5cc -H5CC_PP = $(bindir)/h5pcc -H5FC = $(bindir)/h5fc -H5FC_PP = $(bindir)/h5pfc -H5CPP = $(bindir)/h5c++ +H5CC = ${DESTDIR}$(bindir)/h5cc +H5CC_PP = ${DESTDIR}$(bindir)/h5pcc +H5FC = ${DESTDIR}$(bindir)/h5fc +H5FC_PP = ${DESTDIR}$(bindir)/h5pfc +H5CPP = ${DESTDIR}$(bindir)/h5c++ ACLOCAL_AMFLAGS = "-I m4" # The trace script; this is used on source files from the C library to @@ -978,7 +988,7 @@ uninstall-doc: # be successfully built installcheck-local: if test -n "${DESTDIR}"; then \ - (cd ${DESTDIR}/$(bindir) && pwd && ./h5redeploy -force); \ + (cd ${DESTDIR}$(bindir) && pwd && ./h5redeploy -force); \ fi @(cd examples && $(MAKE) $(AM_MAKEFLAGS) $@) || exit 1; diff --git a/README.txt b/README.txt index c5a9fa0..e117db2 100644 --- a/README.txt +++ b/README.txt @@ -1,4 +1,4 @@ -HDF5 version 1.9.75-FA_a5 currently under development +HDF5 version 1.9.76-FA_a5 currently under development Please refer to the release_docs/INSTALL file for installation instructions. ------------------------------------------------------------------------------ diff --git a/bin/chkconfigure b/bin/chkconfigure index f819816..62ca1ca 100755 --- a/bin/chkconfigure +++ b/bin/chkconfigure @@ -18,12 +18,12 @@ # Created Date: 2004/12/07 # -# Configure: should be generated by autoconf version 2.59. -# autoconf: should be of version 2.59. +# Configure: should be generated by autoconf version 2.67. +# autoconf: should be of version 2.67. # variable initialization nerrors=0 -AUTOCONFVERSION=2.65 +AUTOCONFVERSION=2.67 AUTOCONFVERSIONLEAD='Generated by GNU Autoconf' CONFIGUREFILES="configure" diff --git a/bin/config.guess b/bin/config.guess index e3ef63f..f32079a 100755 --- a/bin/config.guess +++ b/bin/config.guess @@ -1,9 +1,10 @@ #! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. +# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 +# Free Software Foundation, Inc. -timestamp='2005-12-13' +timestamp='2008-01-23' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -55,8 +56,8 @@ version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 -Free Software Foundation, Inc. +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, +2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -106,7 +107,7 @@ set_cc_for_build=' trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; : ${TMPDIR=/tmp} ; - { tmp=`(umask 077 && mktemp -d -q "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || + { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; @@ -160,6 +161,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; + sh5el) machine=sh5le-unknown ;; *) machine=${UNAME_MACHINE_ARCH}-unknown ;; esac # The Operating System including object format, if it has switched @@ -206,8 +208,11 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:ekkoBSD:*:*) echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} exit ;; + *:SolidBSD:*:*) + echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} + exit ;; macppc:MirBSD:*:*) - echo powerppc-unknown-mirbsd${UNAME_RELEASE} + echo powerpc-unknown-mirbsd${UNAME_RELEASE} exit ;; *:MirBSD:*:*) echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} @@ -325,7 +330,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; - i86pc:SunOS:5.*:*) + i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:6*:*) @@ -527,7 +532,7 @@ EOF echo rs6000-ibm-aix3.2 fi exit ;; - *:AIX:*:[45]) + *:AIX:*:[456]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 @@ -764,12 +769,19 @@ EOF echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit ;; *:FreeBSD:*:*) - echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` + case ${UNAME_MACHINE} in + pc98) + echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + amd64) + echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + *) + echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + esac exit ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit ;; - i*:MINGW*:*) + *:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; i*:windows32*:*) @@ -779,9 +791,18 @@ EOF i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit ;; - x86:Interix*:[345]*) - echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//' - exit ;; + *:Interix*:[3456]*) + case ${UNAME_MACHINE} in + x86) + echo i586-pc-interix${UNAME_RELEASE} + exit ;; + EM64T | authenticamd) + echo x86_64-unknown-interix${UNAME_RELEASE} + exit ;; + IA64) + echo ia64-unknown-interix${UNAME_RELEASE} + exit ;; + esac ;; [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks exit ;; @@ -815,6 +836,16 @@ EOF echo ${UNAME_MACHINE}-pc-minix exit ;; arm*:Linux:*:*) + eval $set_cc_for_build + if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_EABI__ + then + echo ${UNAME_MACHINE}-unknown-linux-gnu + else + echo ${UNAME_MACHINE}-unknown-linux-gnueabi + fi + exit ;; + avr32*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; cris:Linux:*:*) @@ -851,7 +882,11 @@ EOF #endif #endif EOF - eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '/^CPU/{s: ::g;p;}'`" + eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' + /^CPU/{ + s: ::g + p + }'`" test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } ;; mips64:Linux:*:*) @@ -870,7 +905,11 @@ EOF #endif #endif EOF - eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '/^CPU/{s: ::g;p;}'`" + eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' + /^CPU/{ + s: ::g + p + }'`" test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } ;; or32:Linux:*:*) @@ -925,6 +964,9 @@ EOF x86_64:Linux:*:*) echo x86_64-unknown-linux-gnu exit ;; + xtensa*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; i*86:Linux:*:*) # The BFD linker knows what the default object file format is, so # first see if it will tell us. cd to the root directory to prevent @@ -967,7 +1009,7 @@ EOF LIBC=gnulibc1 # endif #else - #if defined(__INTEL_COMPILER) || defined(__PGI) + #if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC) LIBC=gnu #else LIBC=gnuaout @@ -977,7 +1019,11 @@ EOF LIBC=dietlibc #endif EOF - eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '/^LIBC/{s: ::g;p;}'`" + eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' + /^LIBC/{ + s: ::g + p + }'`" test x"${LIBC}" != x && { echo "${UNAME_MACHINE}-pc-linux-${LIBC}" exit @@ -1179,6 +1225,15 @@ EOF SX-6:SUPER-UX:*:*) echo sx6-nec-superux${UNAME_RELEASE} exit ;; + SX-7:SUPER-UX:*:*) + echo sx7-nec-superux${UNAME_RELEASE} + exit ;; + SX-8:SUPER-UX:*:*) + echo sx8-nec-superux${UNAME_RELEASE} + exit ;; + SX-8R:SUPER-UX:*:*) + echo sx8r-nec-superux${UNAME_RELEASE} + exit ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} exit ;; @@ -1429,9 +1484,9 @@ This script, last modified $timestamp, has failed to recognize the operating system you are using. It is advised that you download the most up to date version of the config scripts from - http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.guess + http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD and - http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.sub + http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD If the version you run ($0) is already up to date, please send the following data and any information you think might be diff --git a/c++/Makefile.in b/c++/Makefile.in index c4af5a4..728a487 100644 --- a/c++/Makefile.in +++ b/c++/Makefile.in @@ -348,14 +348,24 @@ LIBH5_HL = $(top_builddir)/hl/src/libhdf5_hl.la LIBH5F_HL = $(top_builddir)/hl/fortran/src/libhdf5hl_fortran.la LIBH5CPP_HL = $(top_builddir)/hl/c++/src/libhdf5_hl_cpp.la +# Note that in svn revision 19400 the '/' after DESTDIR in H5* variables below +# has been removed. According to the official description of DESTDIR by Gnu at +# http://www.gnu.org/prep/standards/html_node/DESTDIR.html, DESTDIR is +# prepended to the normal and complete install path that it precedes for the +# purpose of installing in a temporary directory which is useful for building +# rpms and other packages. The '/' after ${DESTDIR} will be followed by another +# '/' at the beginning of the normal install path. When DESTDIR is empty the +# path then begins with '//', which is incorrect and causes problems at least for +# Cygwin. + # Scripts used to build examples # If only shared libraries have been installed, have h5cc build examples with # shared libraries instead of static libraries -H5CC = $(bindir)/h5cc -H5CC_PP = $(bindir)/h5pcc -H5FC = $(bindir)/h5fc -H5FC_PP = $(bindir)/h5pfc -H5CPP = $(bindir)/h5c++ +H5CC = ${DESTDIR}$(bindir)/h5cc +H5CC_PP = ${DESTDIR}$(bindir)/h5pcc +H5FC = ${DESTDIR}$(bindir)/h5fc +H5FC_PP = ${DESTDIR}$(bindir)/h5pfc +H5CPP = ${DESTDIR}$(bindir)/h5c++ ACLOCAL_AMFLAGS = "-I m4" # The trace script; this is used on source files from the C library to diff --git a/c++/examples/Makefile.am b/c++/examples/Makefile.am index 8a6a1d6..dc2bc7c 100644 --- a/c++/examples/Makefile.am +++ b/c++/examples/Makefile.am @@ -39,7 +39,8 @@ chunks.chkexe_: extend_ds.chkexe_ CXX_API=yes # Where to install examples -EXAMPLEDIR=${DESTDIR}/$(exec_prefix)/share/hdf5_examples/c++ +# Note: no '/' after DESTDIR. Explanation in commence.am +EXAMPLEDIR=${DESTDIR}$(exec_prefix)/share/hdf5_examples/c++ # How to build programs using h5c++ $(EXTRA_PROG): $(H5CPP) diff --git a/c++/examples/Makefile.in b/c++/examples/Makefile.in index 886a82a..6f56fde 100644 --- a/c++/examples/Makefile.in +++ b/c++/examples/Makefile.in @@ -315,14 +315,24 @@ LIBH5_HL = $(top_builddir)/hl/src/libhdf5_hl.la LIBH5F_HL = $(top_builddir)/hl/fortran/src/libhdf5hl_fortran.la LIBH5CPP_HL = $(top_builddir)/hl/c++/src/libhdf5_hl_cpp.la +# Note that in svn revision 19400 the '/' after DESTDIR in H5* variables below +# has been removed. According to the official description of DESTDIR by Gnu at +# http://www.gnu.org/prep/standards/html_node/DESTDIR.html, DESTDIR is +# prepended to the normal and complete install path that it precedes for the +# purpose of installing in a temporary directory which is useful for building +# rpms and other packages. The '/' after ${DESTDIR} will be followed by another +# '/' at the beginning of the normal install path. When DESTDIR is empty the +# path then begins with '//', which is incorrect and causes problems at least for +# Cygwin. + # Scripts used to build examples # If only shared libraries have been installed, have h5cc build examples with # shared libraries instead of static libraries -H5CC = $(bindir)/h5cc -H5CC_PP = $(bindir)/h5pcc -H5FC = $(bindir)/h5fc -H5FC_PP = $(bindir)/h5pfc -H5CPP = $(bindir)/h5c++ +H5CC = ${DESTDIR}$(bindir)/h5cc +H5CC_PP = ${DESTDIR}$(bindir)/h5pcc +H5FC = ${DESTDIR}$(bindir)/h5fc +H5FC_PP = ${DESTDIR}$(bindir)/h5pfc +H5CPP = ${DESTDIR}$(bindir)/h5c++ ACLOCAL_AMFLAGS = "-I m4" # The trace script; this is used on source files from the C library to @@ -349,7 +359,8 @@ INSTALL_SCRIPT_FILES = run-c++-ex.sh CXX_API = yes # Where to install examples -EXAMPLEDIR = ${DESTDIR}/$(exec_prefix)/share/hdf5_examples/c++ +# Note: no '/' after DESTDIR. Explanation in commence.am +EXAMPLEDIR = ${DESTDIR}$(exec_prefix)/share/hdf5_examples/c++ # Assume that all tests in this directory are examples, and tell # conclude.am when to build them. @@ -617,7 +628,8 @@ uninstall-local: install-examples: $(EXAMPLEDIR) $(INSTALL_FILES) @for f in X $(INSTALL_FILES); do \ if test $$f != X; then \ - (set -x; $(INSTALL) $(srcdir)/$$f $(EXAMPLEDIR)/. || exit 1);\ + (set -x; $(INSTALL) $(srcdir)/$$f $(EXAMPLEDIR)/. || exit 1); \ + chmod a-x $(EXAMPLEDIR)/$$f; \ fi; \ done @for f in X $(INSTALL_SCRIPT_FILES); do \ diff --git a/c++/examples/run-c++-ex.sh.in b/c++/examples/run-c++-ex.sh.in index 79a4ccf..bd7106e 100755 --- a/c++/examples/run-c++-ex.sh.in +++ b/c++/examples/run-c++-ex.sh.in @@ -33,7 +33,8 @@ EXIT_SUCCESS=0 EXIT_FAILURE=1 # Where the tool is installed. -prefix="${prefix:-${DESTDIR}/@prefix@}" +# Note: no '/' after DESTDIR. Explanation in commence.am +prefix="${prefix:-${DESTDIR}@prefix@}" AR="@AR@" RANLIB="@RANLIB@" H5TOOL="h5c++" # The tool name diff --git a/c++/src/CMakeLists.txt b/c++/src/CMakeLists.txt index 4c6dd5f..ffc2da3 100644 --- a/c++/src/CMakeLists.txt +++ b/c++/src/CMakeLists.txt @@ -93,7 +93,7 @@ INSTALL ( FILES ${CPP_HDRS} DESTINATION - include/cpp + ${HDF5_INSTALL_INCLUDE_DIR}/cpp COMPONENT cppheaders ) @@ -107,9 +107,9 @@ IF (HDF5_EXPORTED_TARGETS) ${HDF5_CPP_LIB_TARGET} EXPORT ${HDF5_EXPORTED_TARGETS} - LIBRARY DESTINATION lib COMPONENT cpplibraries - ARCHIVE DESTINATION lib COMPONENT cpplibraries - RUNTIME DESTINATION bin COMPONENT cpplibraries + LIBRARY DESTINATION ${HDF5_INSTALL_LIB_DIR} COMPONENT cpplibraries + ARCHIVE DESTINATION ${HDF5_INSTALL_LIB_DIR} COMPONENT cpplibraries + RUNTIME DESTINATION ${HDF5_INSTALL_BIN_DIR} COMPONENT cpplibraries ) ENDIF (HDF5_EXPORTED_TARGETS) diff --git a/c++/src/Makefile.in b/c++/src/Makefile.in index eadd598..27505d5 100644 --- a/c++/src/Makefile.in +++ b/c++/src/Makefile.in @@ -370,14 +370,24 @@ LIBH5_HL = $(top_builddir)/hl/src/libhdf5_hl.la LIBH5F_HL = $(top_builddir)/hl/fortran/src/libhdf5hl_fortran.la LIBH5CPP_HL = $(top_builddir)/hl/c++/src/libhdf5_hl_cpp.la +# Note that in svn revision 19400 the '/' after DESTDIR in H5* variables below +# has been removed. According to the official description of DESTDIR by Gnu at +# http://www.gnu.org/prep/standards/html_node/DESTDIR.html, DESTDIR is +# prepended to the normal and complete install path that it precedes for the +# purpose of installing in a temporary directory which is useful for building +# rpms and other packages. The '/' after ${DESTDIR} will be followed by another +# '/' at the beginning of the normal install path. When DESTDIR is empty the +# path then begins with '//', which is incorrect and causes problems at least for +# Cygwin. + # Scripts used to build examples # If only shared libraries have been installed, have h5cc build examples with # shared libraries instead of static libraries -H5CC = $(bindir)/h5cc -H5CC_PP = $(bindir)/h5pcc -H5FC = $(bindir)/h5fc -H5FC_PP = $(bindir)/h5pfc -H5CPP = $(bindir)/h5c++ +H5CC = ${DESTDIR}$(bindir)/h5cc +H5CC_PP = ${DESTDIR}$(bindir)/h5pcc +H5FC = ${DESTDIR}$(bindir)/h5fc +H5FC_PP = ${DESTDIR}$(bindir)/h5pfc +H5CPP = ${DESTDIR}$(bindir)/h5c++ ACLOCAL_AMFLAGS = "-I m4" # The trace script; this is used on source files from the C library to @@ -392,7 +402,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 65 +LT_VERS_REVISION = 66 LT_VERS_AGE = 0 # Include src directory diff --git a/c++/src/h5c++.in b/c++/src/h5c++.in index 4e51c94..39d3d2a 100755 --- a/c++/src/h5c++.in +++ b/c++/src/h5c++.in @@ -32,6 +32,25 @@ HL="@HL@" ############################################################################ ## ## +## Things You Can Modify to Override HDF5 Library Build Components: ## +## ## +## (Advanced usage - know what you're doing - you're on your own here.) ## +## The four variables below can be used to insert paths and flags in ## +## CPPFLAGS, CXXFLAGS, LDFLAGS, or LIBS in the h5cc compile line: ## +## $CLINKER $H5BLD_CPPFLAGS $CPPFLAGS $H5BLD_CXXFLAGS $CXXFLAGS ## +## $LDFLAGS $LIBS $clibpath $link_objs $link_args $shared_link ## +## ## +## These settings can be overriden by setting HDF5_CXXFLAGS, ## +## HDF5_CPPFLAGS, HDF5_LDFLAGS, or HDF5_LIBS in the environment. ## +## ## +############################################################################ +CXXFLAGSBASE="" +CPPFLAGSBASE="" +LDFLAGSBASE="" +LIBSBASE="" + +############################################################################ +## ## ## You shouldn't have to modify anything below this line. ## ## ## ############################################################################ @@ -60,13 +79,26 @@ get_output_file="no" SHOW="eval" CXXBASE="@CXX@" CXXLINKERBASE="@CXX@" -CXXFLAGS="@AM_CXXFLAGS@ @CXXFLAGS@" -CPPFLAGS="@AM_CPPFLAGS@ @CPPFLAGS@" -LDFLAGS="@AM_LDFLAGS@ @LDFLAGS@" -LIBS="@LIBS@" + +# CXXFLAGS, CPPFLAGS and LDFLAGS are reserved for use by the script user. +# FLAGS brought from the hdf5 build are put in H5BLD_*FLAGS. + +# User's CPPFLAGS and CXXFLAGS come after their H5BLD counterparts to override +# them. User's LDFLAGS come just before clibpath, user's LIBS come after +# $link_objs and before the hdf5 libraries in $link_args, followed by any +# external library paths and libraries from AM_LDFLAGS, LDFLAGS, AM_LIBS +# or LIBS carried in from the hdf5 build. +H5BLD_CXXFLAGS="@AM_CXXFLAGS@ @CXXFLAGS@" +H5BLD_CPPFLAGS="@AM_CPPFLAGS@ @CPPFLAGS@" +H5BLD_LDFLAGS="@AM_LDFLAGS@ @LDFLAGS@" +H5BLD_LIBS="@LIBS@" CXX="${HDF5_CXX:-$CXXBASE}" CXXLINKER="${HDF5_CLINKER:-$CXXLINKERBASE}" +CXXFLAGS="${HDF5_CXXFLAGS:-$CXXFLAGSBASE}" +CPPFLAGS="${HDF5_CPPFLAGS:-$CPPFLAGSBASE}" +LDFLAGS="${HDF5_LDFLAGS:-$LDFLAGSBASE}" +LIBS="${HDF5_LIBS:-$LIBSBASE}" USE_SHARED_LIB="${HDF5_USE_SHLIB:-no}" @@ -94,6 +126,18 @@ usage() { echo " " echo " HDF5_CXX - use a different C++ compiler" echo " HDF5_CXXLINKER - use a different linker" + echo " You can also add or change paths and flags to the compile line using" + echo " the following environment varibles or by assigning them to their counterparts" + echo " in the 'Things You Can Modify to Override...'" section of $prog_name + echo " " + echo " Variable Current value to be replaced" + echo " HDF5_CPPFLAGS \"$CPPFLAGSBASE\"" + echo " HDF5_CXXFLAGS \"$CXXFLAGSBASE\"" + echo " HDF5_LDFLAGS \"$LDFLAGSBASE\"" + echo " HDF5_LIBS \"$LIBSBASE\"" + echo " " + echo " Note that adding library paths to HDF5_LDFLAGS where another hdf5 version" + echo " is located may link your program with that other hdf5 library version." echo " " exit $EXIT_FAILURE } @@ -244,7 +288,7 @@ if test "x$do_compile" = "xyes"; then compile_args="-c $compile_args" fi - $SHOW $CXX -I$includedir $CPPFLAGS $CXXFLAGS $compile_args + $SHOW $CXX -I$includedir $H5BLD_CPPFLAGS $CPPFLAGS $H5BLD_CXXFLAGS $CXXFLAGS $compile_args status=$? if test "$status" != "0"; then @@ -319,9 +363,15 @@ if test "x$do_link" = "xyes"; then # The LIBS are just a bunch of -l* libraries necessary for the HDF5 # module. It's okay if they're included twice in the compile line. - link_args="$link_args $LIBS" + link_args="$link_args $H5BLD_LDFLAGS $H5BLD_LIBS" + + # User's CPPFLAGS and CXXFLAGS come after their H5BLD counterparts to override + # them. User's LDFLAGS come just before clibpath, user's LIBS come after + # $link_objs and before the hdf5 libraries in $link_args, followed by any + # external library paths and libraries from AM_LDFLAGS, LDFLAGS, AM_LIBS + # or LIBS carried in from the hdf5 build. - $SHOW $CXXLINKER $CPPFLAGS $CXXFLAGS $clibpath $link_objs $link_args $shared_link $LDFLAGS + $SHOW $CXXLINKER $H5BLD_CPPFLAGS $CPPFLAGS $H5BLD_CXXFLAGS $CXXFLAGS $LDFLAGS $clibpath $link_objs $LIBS $link_args $shared_link status=$? fi diff --git a/c++/test/Makefile.in b/c++/test/Makefile.in index b41f44a..5a3f52c 100644 --- a/c++/test/Makefile.in +++ b/c++/test/Makefile.in @@ -337,14 +337,24 @@ LIBH5_HL = $(top_builddir)/hl/src/libhdf5_hl.la LIBH5F_HL = $(top_builddir)/hl/fortran/src/libhdf5hl_fortran.la LIBH5CPP_HL = $(top_builddir)/hl/c++/src/libhdf5_hl_cpp.la +# Note that in svn revision 19400 the '/' after DESTDIR in H5* variables below +# has been removed. According to the official description of DESTDIR by Gnu at +# http://www.gnu.org/prep/standards/html_node/DESTDIR.html, DESTDIR is +# prepended to the normal and complete install path that it precedes for the +# purpose of installing in a temporary directory which is useful for building +# rpms and other packages. The '/' after ${DESTDIR} will be followed by another +# '/' at the beginning of the normal install path. When DESTDIR is empty the +# path then begins with '//', which is incorrect and causes problems at least for +# Cygwin. + # Scripts used to build examples # If only shared libraries have been installed, have h5cc build examples with # shared libraries instead of static libraries -H5CC = $(bindir)/h5cc -H5CC_PP = $(bindir)/h5pcc -H5FC = $(bindir)/h5fc -H5FC_PP = $(bindir)/h5pfc -H5CPP = $(bindir)/h5c++ +H5CC = ${DESTDIR}$(bindir)/h5cc +H5CC_PP = ${DESTDIR}$(bindir)/h5pcc +H5FC = ${DESTDIR}$(bindir)/h5fc +H5FC_PP = ${DESTDIR}$(bindir)/h5pfc +H5CPP = ${DESTDIR}$(bindir)/h5c++ ACLOCAL_AMFLAGS = "-I m4" # The trace script; this is used on source files from the C library to diff --git a/config/cmake/CTestCustom.cmake b/config/cmake/CTestCustom.cmake new file mode 100755 index 0000000..e0a3f3f --- /dev/null +++ b/config/cmake/CTestCustom.cmake @@ -0,0 +1,38 @@ +SET (CTEST_CUSTOM_MAXIMUM_NUMBER_OF_WARNINGS 1500) + +SET (CTEST_CUSTOM_WARNING_EXCEPTION + ${CTEST_CUSTOM_WARNING_EXCEPTION} + "H5detect.c.[0-9]+.[ ]*: warning C4090:" + "testhdf5.h.[0-9]+.[ ]*: warning C4005:" + "POSIX name for this item is deprecated" + "disabling jobserver mode" +) + +SET (CTEST_CUSTOM_MEMCHECK_IGNORE + ${CTEST_CUSTOM_MEMCHECK_IGNORE} + h5test-clear-objects + h5perform-clear-objects + hl_test-clear-objects + hl_fortran_test-clear-objects + H5DIFF-clearall-objects + H5LS-clearall-objects + h5repart_20K-clear-objects + h5repart_5K-clear-objects + h5repart_sec2-clear-objects + H5IMPORT-clear-objects + H5REPACK-clearall-objects + H5COPY-clearall-objects + H5STAT-clearall-objects + H5DUMP-clearall-objects + H5DUMP-clear-out1 + H5DUMP-clear-out3 + H5DUMP-clear-objects + H5DUMP_PACKED_BITS-clearall-objects + H5DUMP-XML-clearall-objects + H5DUMP* + H5DIFF* + H5REPACK* + H5STAT* + H5COPY* + H5LS* +) diff --git a/config/cmake/CTestCustom.ctest b/config/cmake/CTestCustom.ctest deleted file mode 100755 index acb1918..0000000 --- a/config/cmake/CTestCustom.ctest +++ /dev/null @@ -1,19 +0,0 @@ -SET (CTEST_CUSTOM_MAXIMUM_NUMBER_OF_WARNINGS 1500) - -SET (CTEST_CUSTOM_WARNING_EXCEPTION - ${CTEST_CUSTOM_WARNING_EXCEPTION} - "H5detect.c.[0-9]+.[ ]*: warning C4090:" - "testhdf5.h.[0-9]+.[ ]*: warning C4005:" - "POSIX name for this item is deprecated" - "disabling jobserver mode" -) - -SET (CTEST_CUSTOM_MEMCHECK_IGNORE - ${CTEST_CUSTOM_MEMCHECK_IGNORE} - H5DUMP - H5DIFF - H5REPACK - H5STAT - H5COPY - H5LS -) diff --git a/config/cmake/ConfigureChecks.cmake b/config/cmake/ConfigureChecks.cmake index b5b1170..cad3870 100644 --- a/config/cmake/ConfigureChecks.cmake +++ b/config/cmake/ConfigureChecks.cmake @@ -100,21 +100,48 @@ IF (HDF5_ENABLE_CODESTACK) ENDIF (HDF5_ENABLE_CODESTACK) MARK_AS_ADVANCED (HDF5_ENABLE_CODESTACK) -#IF (WIN32) -# SET (DEFAULT_STREAM_VFD OFF) -#ELSE (WIN32) -# SET (DEFAULT_STREAM_VFD ON) -#ENDIF (WIN32) -#OPTION (HDF5_STREAM_VFD "Compile Stream Virtual File Driver support" ${DEFAULT_STREAM_VFD}) OPTION (HDF5_ENABLE_HSIZET "Enable datasets larger than memory" ON) +# ---------------------------------------------------------------------- +# Set the flag to indicate that the machine can handle converting +# floating-point to long long values. +# (This flag should be _unset_ for all machines) +# +# SET (H5_HW_FP_TO_LLONG_NOT_WORKS 0) + +# so far we have no check for this +SET(H5_HAVE_TMPFILE 1) + +#----------------------------------------------------------------------------- +# This MACRO checks IF the symbol exists in the library and IF it +# does, it appends library to the list. +#----------------------------------------------------------------------------- +SET (LINK_LIBS "") +MACRO (CHECK_LIBRARY_EXISTS_CONCAT LIBRARY SYMBOL VARIABLE) + CHECK_LIBRARY_EXISTS ("${LIBRARY};${LINK_LIBS}" ${SYMBOL} "" ${VARIABLE}) + IF (${VARIABLE}) + SET (LINK_LIBS ${LINK_LIBS} ${LIBRARY}) + ENDIF (${VARIABLE}) +ENDMACRO (CHECK_LIBRARY_EXISTS_CONCAT) + +# ---------------------------------------------------------------------- +# WINDOWS Hard code Values +# ---------------------------------------------------------------------- + SET (WINDOWS) IF (WIN32) - IF (NOT UNIX) + IF (NOT UNIX AND NOT CYGWIN) SET (WINDOWS 1) - ENDIF (NOT UNIX) + ENDIF (NOT UNIX AND NOT CYGWIN) ENDIF (WIN32) +#IF (WIN32) +# SET (DEFAULT_STREAM_VFD OFF) +#ELSE (WIN32) +# SET (DEFAULT_STREAM_VFD ON) +#ENDIF (WIN32) +#OPTION (HDF5_STREAM_VFD "Compile Stream Virtual File Driver support" ${DEFAULT_STREAM_VFD}) + # TODO -------------------------------------------------------------------------- # Should the Default Virtual File Driver be compiled? # This is hard-coded now but option should added to match configure @@ -134,36 +161,50 @@ ELSE (WINDOWS) SET (H5_DEFAULT_VFD H5FD_SEC2) ENDIF (WINDOWS) -# ---------------------------------------------------------------------- -# Set the flag to indicate that the machine can handle converting -# floating-point to long long values. -# (This flag should be _unset_ for all machines) -# -# SET (H5_HW_FP_TO_LLONG_NOT_WORKS 0) - -# so far we have no check for this -SET(H5_HAVE_TMPFILE 1) +IF (WINDOWS) + SET (H5_HAVE_IO_H 1) + SET (H5_HAVE_SETJMP_H 1) + SET (H5_HAVE_STDDEF_H 1) + SET (H5_HAVE_SYS_STAT_H 1) + SET (H5_HAVE_SYS_TIMEB_H 1) + SET (H5_HAVE_SYS_TYPES_H 1) + SET (H5_HAVE_WINSOCK_H 1) + SET (H5_HAVE_LIBM 1) + SET (H5_HAVE_STRDUP 1) + SET (H5_HAVE_SYSTEM 1) + SET (H5_HAVE_DIFFTIME 1) + SET (H5_HAVE_LONGJMP 1) + SET (H5_STDC_HEADERS 1) + SET (H5_HAVE_GETHOSTNAME 1) + SET (H5_HAVE_TIMEZONE 1) + SET (H5_HAVE_FUNCTION 1) + SET (H5_LONE_COLON 0) +ENDIF (WINDOWS) #----------------------------------------------------------------------------- -# This MACRO checks IF the symbol exists in the library and IF it -# does, it appends library to the list. -#----------------------------------------------------------------------------- -SET (LINK_LIBS "") -MACRO (CHECK_LIBRARY_EXISTS_CONCAT LIBRARY SYMBOL VARIABLE) - CHECK_LIBRARY_EXISTS ("${LIBRARY};${LINK_LIBS}" ${SYMBOL} "" ${VARIABLE}) - IF (${VARIABLE}) - SET (LINK_LIBS ${LINK_LIBS} ${LIBRARY}) - ENDIF (${VARIABLE}) -ENDMACRO (CHECK_LIBRARY_EXISTS_CONCAT) +# These tests need to be manually SET for windows since there is currently +# something not quite correct with the actual test implementation. This affects +# the 'dt_arith' test and most likely lots of other code +# ---------------------------------------------------------------------------- +IF (WINDOWS) + SET (H5_FP_TO_ULLONG_RIGHT_MAXIMUM "" CACHE INTERNAL "") +ENDIF (WINDOWS) + +# ---------------------------------------------------------------------- +# END of WINDOWS Hard code Values +# ---------------------------------------------------------------------- + +IF (CYGWIN) + SET (H5_HAVE_LSEEK64 0) +ENDIF (CYGWIN) #----------------------------------------------------------------------------- # Check for the math library "m" #----------------------------------------------------------------------------- -IF (WINDOWS) - SET (H5_HAVE_LIBM 1) -ELSE (WINDOWS) +IF (NOT WINDOWS) CHECK_LIBRARY_EXISTS_CONCAT ("m" printf H5_HAVE_LIBM) -ENDIF (WINDOWS) +ENDIF (NOT WINDOWS) + CHECK_LIBRARY_EXISTS_CONCAT ("ws2_32" printf H5_HAVE_LIBWS2_32) CHECK_LIBRARY_EXISTS_CONCAT ("wsock32" printf H5_HAVE_LIBWSOCK32) #CHECK_LIBRARY_EXISTS_CONCAT ("dl" dlopen H5_HAVE_LIBDL) @@ -189,19 +230,6 @@ MACRO (CHECK_INCLUDE_FILE_CONCAT FILE VARIABLE) ENDMACRO (CHECK_INCLUDE_FILE_CONCAT) #----------------------------------------------------------------------------- -# If we are on Windows we know some of the answers to these tests already -#----------------------------------------------------------------------------- -IF (WINDOWS) - SET (H5_HAVE_IO_H 1) - SET (H5_HAVE_SETJMP_H 1) - SET (H5_HAVE_STDDEF_H 1) - SET (H5_HAVE_SYS_STAT_H 1) - SET (H5_HAVE_SYS_TIMEB_H 1) - SET (H5_HAVE_SYS_TYPES_H 1) - SET (H5_HAVE_WINSOCK_H 1) -ENDIF (WINDOWS) - -#----------------------------------------------------------------------------- # Check for the existence of certain header files #----------------------------------------------------------------------------- CHECK_INCLUDE_FILE_CONCAT ("globus/common.h" H5_HAVE_GLOBUS_COMMON_H) @@ -235,9 +263,11 @@ CHECK_INCLUDE_FILE_CONCAT ("memory.h" H5_HAVE_MEMORY_H) CHECK_INCLUDE_FILE_CONCAT ("dlfcn.h" H5_HAVE_DLFCN_H) CHECK_INCLUDE_FILE_CONCAT ("features.h" H5_HAVE_FEATURES_H) CHECK_INCLUDE_FILE_CONCAT ("inttypes.h" H5_HAVE_INTTYPES_H) -CHECK_INCLUDE_FILE_CONCAT ("winsock2.h" H5_HAVE_WINSOCK_H) CHECK_INCLUDE_FILE_CONCAT ("netinet/in.h" H5_HAVE_NETINET_IN_H) +IF (NOT CYGWIN) + CHECK_INCLUDE_FILE_CONCAT ("winsock2.h" H5_HAVE_WINSOCK_H) +ENDIF (NOT CYGWIN) # IF the c compiler found stdint, check the C++ as well. On some systems this # file will be found by C but not C++, only do this test IF the C++ compiler @@ -286,7 +316,6 @@ MACRO (H5_CHECK_TYPE_SIZE type var) ENDMACRO (H5_CHECK_TYPE_SIZE) - H5_CHECK_TYPE_SIZE (char H5_SIZEOF_CHAR) H5_CHECK_TYPE_SIZE (short H5_SIZEOF_SHORT) H5_CHECK_TYPE_SIZE (int H5_SIZEOF_INT) @@ -346,15 +375,7 @@ SET (CMAKE_REQUIRED_LIBRARIES ${LINK_LIBS}) #----------------------------------------------------------------------------- # Check for some functions that are used -IF (WINDOWS) - SET (H5_HAVE_STRDUP 1) - SET (H5_HAVE_SYSTEM 1) - SET (H5_HAVE_DIFFTIME 1) - SET (H5_HAVE_LONGJMP 1) - SET (H5_STDC_HEADERS 1) - SET (H5_HAVE_GETHOSTNAME 1) -ENDIF (WINDOWS) - +# CHECK_FUNCTION_EXISTS (alarm H5_HAVE_ALARM) CHECK_FUNCTION_EXISTS (fork H5_HAVE_FORK) CHECK_FUNCTION_EXISTS (frexpf H5_HAVE_FREXPF) @@ -517,11 +538,7 @@ ENDMACRO (HDF5_FUNCTION_TEST) #----------------------------------------------------------------------------- # Check a bunch of other functions #----------------------------------------------------------------------------- -IF (WINDOWS) - SET (H5_HAVE_TIMEZONE 1) - SET (H5_HAVE_FUNCTION 1) - SET (H5_LONE_COLON 0) -ELSE (WINDOWS) +IF (NOT WINDOWS) FOREACH (test TIME_WITH_SYS_TIME STDC_HEADERS @@ -530,7 +547,7 @@ ELSE (WINDOWS) HAVE_ATTRIBUTE HAVE_FUNCTION HAVE_TM_GMTOFF - HAVE_TIMEZONE +# HAVE_TIMEZONE HAVE_STRUCT_TIMEZONE HAVE_STAT_ST_BLOCKS HAVE_FUNCTION @@ -546,8 +563,12 @@ ELSE (WINDOWS) LONE_COLON ) HDF5_FUNCTION_TEST (${test}) + IF (NOT CYGWIN) + HDF5_FUNCTION_TEST (HAVE_TIMEZONE) +# HDF5_FUNCTION_TEST (HAVE_STAT_ST_BLOCKS) + ENDIF (NOT CYGWIN) ENDFOREACH (test) -ENDIF (WINDOWS) +ENDIF (NOT WINDOWS) #----------------------------------------------------------------------------- # Option to see if GPFS is available on this filesystem --enable-gpfs @@ -594,41 +615,41 @@ ENDIF (INLINE_TEST___inline__) # Check how to print a Long Long integer #----------------------------------------------------------------------------- IF (NOT H5_PRINTF_LL_WIDTH OR H5_PRINTF_LL_WIDTH MATCHES "unknown") - SET (PRINT_LL_FOUND 0) - MESSAGE (STATUS "Checking for appropriate format for 64 bit long:") - FOREACH (HDF5_PRINTF_LL l64 l L q I64 ll) - SET (CURRENT_TEST_DEFINITIONS "-DPRINTF_LL_WIDTH=${HDF5_PRINTF_LL}") - IF (H5_SIZEOF_LONG_LONG) - SET (CURRENT_TEST_DEFINITIONS "${CURRENT_TEST_DEFINITIONS} -DHAVE_LONG_LONG") - ENDIF (H5_SIZEOF_LONG_LONG) - TRY_RUN (HDF5_PRINTF_LL_TEST_RUN HDF5_PRINTF_LL_TEST_COMPILE - ${HDF5_BINARY_DIR}/CMake - ${HDF5_RESOURCES_DIR}/HDF5Tests.c - CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${CURRENT_TEST_DEFINITIONS} - OUTPUT_VARIABLE OUTPUT - ) - IF (HDF5_PRINTF_LL_TEST_COMPILE) - IF (HDF5_PRINTF_LL_TEST_RUN MATCHES 0) - SET (H5_PRINTF_LL_WIDTH "\"${HDF5_PRINTF_LL}\"" CACHE INTERNAL "Width for printf for type `long long' or `__int64', us. `ll") - SET (PRINT_LL_FOUND 1) - ELSE (HDF5_PRINTF_LL_TEST_RUN MATCHES 0) - MESSAGE ("Width with ${HDF5_PRINTF_LL} failed with result: ${HDF5_PRINTF_LL_TEST_RUN}") - ENDIF (HDF5_PRINTF_LL_TEST_RUN MATCHES 0) - ELSE (HDF5_PRINTF_LL_TEST_COMPILE) - FILE (APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log - "Test H5_PRINTF_LL_WIDTH for ${HDF5_PRINTF_LL} failed with the following output:\n ${OUTPUT}\n" - ) - ENDIF (HDF5_PRINTF_LL_TEST_COMPILE) - ENDFOREACH (HDF5_PRINTF_LL) - - IF (PRINT_LL_FOUND) - MESSAGE (STATUS "Checking for apropriate format for 64 bit long: found ${H5_PRINTF_LL_WIDTH}") - ELSE (PRINT_LL_FOUND) - MESSAGE (STATUS "Checking for apropriate format for 64 bit long: not found") - SET (H5_PRINTF_LL_WIDTH "\"unknown\"" CACHE INTERNAL - "Width for printf for type `long long' or `__int64', us. `ll" + SET (PRINT_LL_FOUND 0) + MESSAGE (STATUS "Checking for appropriate format for 64 bit long:") + FOREACH (HDF5_PRINTF_LL l64 l L q I64 ll) + SET (CURRENT_TEST_DEFINITIONS "-DPRINTF_LL_WIDTH=${HDF5_PRINTF_LL}") + IF (H5_SIZEOF_LONG_LONG) + SET (CURRENT_TEST_DEFINITIONS "${CURRENT_TEST_DEFINITIONS} -DHAVE_LONG_LONG") + ENDIF (H5_SIZEOF_LONG_LONG) + TRY_RUN (HDF5_PRINTF_LL_TEST_RUN HDF5_PRINTF_LL_TEST_COMPILE + ${HDF5_BINARY_DIR}/CMake + ${HDF5_RESOURCES_DIR}/HDF5Tests.c + CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${CURRENT_TEST_DEFINITIONS} + OUTPUT_VARIABLE OUTPUT + ) + IF (HDF5_PRINTF_LL_TEST_COMPILE) + IF (HDF5_PRINTF_LL_TEST_RUN MATCHES 0) + SET (H5_PRINTF_LL_WIDTH "\"${HDF5_PRINTF_LL}\"" CACHE INTERNAL "Width for printf for type `long long' or `__int64', us. `ll") + SET (PRINT_LL_FOUND 1) + ELSE (HDF5_PRINTF_LL_TEST_RUN MATCHES 0) + MESSAGE ("Width with ${HDF5_PRINTF_LL} failed with result: ${HDF5_PRINTF_LL_TEST_RUN}") + ENDIF (HDF5_PRINTF_LL_TEST_RUN MATCHES 0) + ELSE (HDF5_PRINTF_LL_TEST_COMPILE) + FILE (APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log + "Test H5_PRINTF_LL_WIDTH for ${HDF5_PRINTF_LL} failed with the following output:\n ${OUTPUT}\n" ) - ENDIF (PRINT_LL_FOUND) + ENDIF (HDF5_PRINTF_LL_TEST_COMPILE) + ENDFOREACH (HDF5_PRINTF_LL) + + IF (PRINT_LL_FOUND) + MESSAGE (STATUS "Checking for apropriate format for 64 bit long: found ${H5_PRINTF_LL_WIDTH}") + ELSE (PRINT_LL_FOUND) + MESSAGE (STATUS "Checking for apropriate format for 64 bit long: not found") + SET (H5_PRINTF_LL_WIDTH "\"unknown\"" CACHE INTERNAL + "Width for printf for type `long long' or `__int64', us. `ll" + ) + ENDIF (PRINT_LL_FOUND) ENDIF (NOT H5_PRINTF_LL_WIDTH OR H5_PRINTF_LL_WIDTH MATCHES "unknown") # ---------------------------------------------------------------------- @@ -645,9 +666,6 @@ SET (H5_CONVERT_DENORMAL_FLOAT 1) IF (HDF5_ENABLE_HSIZET) SET (H5_HAVE_LARGE_HSIZET 1) ENDIF (HDF5_ENABLE_HSIZET) -IF (CYGWIN) - SET (H5_HAVE_LSEEK64 0) -ENDIF (CYGWIN) #----------------------------------------------------------------------------- # Macro to determine the various conversion capabilities @@ -664,7 +682,7 @@ MACRO (H5ConversionTests TEST msg) IF (${TEST}_COMPILE) IF (${TEST}_RUN MATCHES 0) SET (${TEST} 1 CACHE INTERNAL ${msg}) - MESSAGE(STATUS "${msg}... yes") + MESSAGE (STATUS "${msg}... yes") ELSE (${TEST}_RUN MATCHES 0) SET (${TEST} "" CACHE INTERNAL ${msg}) MESSAGE (STATUS "${msg}... no") @@ -821,11 +839,8 @@ H5ConversionTests (H5_LDOUBLE_TO_LLONG_ACCURATE "Checking IF correctly convertin H5ConversionTests (H5_LLONG_TO_LDOUBLE_CORRECT "Checking IF correctly converting (unsigned) long long to long double values") H5ConversionTests (H5_NO_ALIGNMENT_RESTRICTIONS "Checking IF alignment restrictions are strictly enforced") -#----------------------------------------------------------------------------- -# These tests need to be manually SET for windows since there is currently -# something not quite correct with the actual test implementation. This affects -# the 'dt_arith' test and most likely lots of other code -# ---------------------------------------------------------------------------- -IF (WINDOWS) - SET (H5_FP_TO_ULLONG_RIGHT_MAXIMUM "" CACHE INTERNAL "") -ENDIF (WINDOWS) +# Define a macro for Cygwin (on XP only) where the compiler has rounding +# problem converting from unsigned long long to long double */ +IF (CYGWIN) + SET (H5_CYGWIN_ULLONG_TO_LDOUBLE_ROUND_PROBLEM 1) +ENDIF (CYGWIN) \ No newline at end of file diff --git a/config/cmake/H5pubconf.h.in b/config/cmake/H5pubconf.h.in index fdcf6b2..0c2b084 100644 --- a/config/cmake/H5pubconf.h.in +++ b/config/cmake/H5pubconf.h.in @@ -39,6 +39,10 @@ /* Define if C++ compiler recognizes offsetof */ #cmakedefine H5_CXX_HAVE_OFFSETOF @H5_CXX_HAVE_OFFSETOF@ +/* Define a macro for Cygwin (on XP only) where the compiler has rounding + problem converting from unsigned long long to long double */ +#cmakedefine H5_CYGWIN_ULLONG_TO_LDOUBLE_ROUND_PROBLEM @H5_CYGWIN_ULLONG_TO_LDOUBLE_ROUND_PROBLEM@ + /* Define the default virtual file driver to compile */ #cmakedefine H5_DEFAULT_VFD @H5_DEFAULT_VFD@ diff --git a/config/cmake/runTest.cmake b/config/cmake/runTest.cmake index 227ef9b..de69217 100644 --- a/config/cmake/runTest.cmake +++ b/config/cmake/runTest.cmake @@ -50,9 +50,9 @@ IF (TEST_APPEND) FILE (APPEND ${TEST_OUTPUT} "${TEST_APPEND} ${TEST_RESULT}\n") ENDIF (TEST_APPEND) -# if the return value is !=0 bail out +# if the return value is !=${TEST_EXPECT} bail out IF (NOT ${TEST_RESULT} STREQUAL ${TEST_EXPECT}) - MESSAGE ( FATAL_ERROR "Failed: Test program ${TEST_PROGRAM} exited != 0.\n${TEST_ERROR}") + MESSAGE ( FATAL_ERROR "Failed: Test program ${TEST_PROGRAM} exited != ${TEST_EXPECT}.\n${TEST_ERROR}") ENDIF (NOT ${TEST_RESULT} STREQUAL ${TEST_EXPECT}) MESSAGE (STATUS "COMMAND Error: ${TEST_ERROR}") @@ -77,7 +77,7 @@ ENDIF (WIN32 AND NOT MINGW) # now compare the output with the reference EXECUTE_PROCESS ( - COMMAND ${CMAKE_COMMAND} -E compare_files ${TEST_OUTPUT} ${TEST_REFERENCE} + COMMAND ${CMAKE_COMMAND} -E compare_files ${TEST_FOLDER}/${TEST_OUTPUT} ${TEST_FOLDER}/${TEST_REFERENCE} RESULT_VARIABLE TEST_RESULT ) diff --git a/config/cmake/vfdTest.cmake b/config/cmake/vfdTest.cmake new file mode 100644 index 0000000..c0b5fec --- /dev/null +++ b/config/cmake/vfdTest.cmake @@ -0,0 +1,41 @@ +# vfdTest.cmake executes a command and captures the output in a file. Command uses specified VFD. +# Exit status of command can also be compared. + +# arguments checking +IF (NOT TEST_PROGRAM) + MESSAGE (FATAL_ERROR "Require TEST_PROGRAM to be defined") +ENDIF (NOT TEST_PROGRAM) +#IF (NOT TEST_ARGS) +# MESSAGE (STATUS "Require TEST_ARGS to be defined") +#ENDIF (NOT TEST_ARGS) +#IF (NOT TEST_EXPECT) +# MESSAGE (STATUS "Require TEST_EXPECT to be defined") +#ENDIF (NOT TEST_EXPECT) +IF (NOT TEST_FOLDER) + MESSAGE ( FATAL_ERROR "Require TEST_FOLDER to be defined") +ENDIF (NOT TEST_FOLDER) +IF (NOT TEST_VFD) + MESSAGE (FATAL_ERROR "Require TEST_VFD to be defined") +ENDIF (NOT TEST_VFD) + +MESSAGE (STATUS "USING ${TEST_VFD} ON COMMAND: ${TEST_PROGRAM} ${TEST_ARGS}") + +SET (ENV{HDF5_DRIVER} "${TEST_VFD}") +# run the test program, capture the stdout/stderr and the result var +EXECUTE_PROCESS ( + COMMAND ${TEST_PROGRAM} ${TEST_ARGS} + WORKING_DIRECTORY ${TEST_FOLDER} + OUTPUT_VARIABLE TEST_ERROR + ERROR_VARIABLE TEST_ERROR +) + +MESSAGE (STATUS "COMMAND Result: ${TEST_RESULT}") + +# if the return value is !=${TEST_EXPECT} bail out +IF (NOT ${TEST_RESULT} STREQUAL ${TEST_EXPECT}) + MESSAGE ( FATAL_ERROR "Failed: Test program ${TEST_PROGRAM} exited != ${TEST_EXPECT}.\n${TEST_ERROR}") +ENDIF (NOT ${TEST_RESULT} STREQUAL ${TEST_EXPECT}) + +# everything went fine... +MESSAGE ("Passed: The ${TEST_PROGRAM} program used vfd ${TEST_VFD}") + diff --git a/config/cmake/xlatefile.c b/config/cmake/xlatefile.c index c16f573..e220289 100644 --- a/config/cmake/xlatefile.c +++ b/config/cmake/xlatefile.c @@ -9,8 +9,8 @@ int main(int argc, char *argv[]) { FILE *outfile = NULL; char *buffer = NULL; char argbuf[8]; - unsigned int bytes = 0; - unsigned int idx = 0; + size_t bytes = 0; + size_t idx = 0; unsigned int lineidx = 0; unsigned int stripXlines = 3; diff --git a/config/commence.am b/config/commence.am index 815b9a2..c5c27d5 100644 --- a/config/commence.am +++ b/config/commence.am @@ -45,14 +45,24 @@ LIBH5CPP_HL=$(top_builddir)/hl/c++/src/libhdf5_hl_cpp.la # Install directories that automake doesn't know about docdir = $(exec_prefix)/doc +# Note that in svn revision 19400 the '/' after DESTDIR in H5* variables below +# has been removed. According to the official description of DESTDIR by Gnu at +# http://www.gnu.org/prep/standards/html_node/DESTDIR.html, DESTDIR is +# prepended to the normal and complete install path that it precedes for the +# purpose of installing in a temporary directory which is useful for building +# rpms and other packages. The '/' after ${DESTDIR} will be followed by another +# '/' at the beginning of the normal install path. When DESTDIR is empty the +# path then begins with '//', which is incorrect and causes problems at least for +# Cygwin. + # Scripts used to build examples # If only shared libraries have been installed, have h5cc build examples with # shared libraries instead of static libraries -H5CC=$(bindir)/h5cc -H5CC_PP=$(bindir)/h5pcc -H5FC=$(bindir)/h5fc -H5FC_PP=$(bindir)/h5pfc -H5CPP=$(bindir)/h5c++ +H5CC=${DESTDIR}$(bindir)/h5cc +H5CC_PP=${DESTDIR}$(bindir)/h5pcc +H5FC=${DESTDIR}$(bindir)/h5fc +H5FC_PP=${DESTDIR}$(bindir)/h5pfc +H5CPP=${DESTDIR}$(bindir)/h5c++ # H5_CFLAGS holds flags that should be used when building hdf5, diff --git a/config/examples.am b/config/examples.am index 30ea717..244e695 100644 --- a/config/examples.am +++ b/config/examples.am @@ -67,7 +67,8 @@ uninstall-local: install-examples: $(EXAMPLEDIR) $(INSTALL_FILES) @for f in X $(INSTALL_FILES); do \ if test $$f != X; then \ - (set -x; $(INSTALL) $(srcdir)/$$f $(EXAMPLEDIR)/. || exit 1);\ + (set -x; $(INSTALL) $(srcdir)/$$f $(EXAMPLEDIR)/. || exit 1); \ + chmod a-x $(EXAMPLEDIR)/$$f; \ fi; \ done @for f in X $(INSTALL_SCRIPT_FILES); do \ diff --git a/config/lt_vers.am b/config/lt_vers.am index 19b3066..0d5db8d 100644 --- a/config/lt_vers.am +++ b/config/lt_vers.am @@ -17,7 +17,7 @@ # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 65 +LT_VERS_REVISION = 66 LT_VERS_AGE = 0 ## If the API changes *at all*, increment LT_VERS_INTERFACE and diff --git a/configure.in b/configure.in index b799208..2819a55 100644 --- a/configure.in +++ b/configure.in @@ -26,7 +26,7 @@ dnl dnl NOTE: Don't forget to change the version number here when we do a dnl release!!! dnl -AC_INIT([HDF5], [1.9.75-FA_a5], [help@hdfgroup.org]) +AC_INIT([HDF5], [1.9.76-FA_a5], [help@hdfgroup.org]) AC_CONFIG_SRCDIR([src/H5.c]) AM_CONFIG_HEADER([src/H5config.h]) @@ -253,6 +253,9 @@ case $host_os in aix5.*) host_os_novers=aix5.x ;; + aix6.*) + host_os_novers=aix6.x + ;; freebsd*) host_os_novers=freebsd ;; diff --git a/examples/Makefile.am b/examples/Makefile.am index 92830df..8a428ae 100644 --- a/examples/Makefile.am +++ b/examples/Makefile.am @@ -69,8 +69,9 @@ $(EXTLINK_DIRS): CHECK_CLEANFILES+=$(EXTLINK_DIRS) # Example directory -EXAMPLEDIR=${DESTDIR}/$(exec_prefix)/share/hdf5_examples/c -EXAMPLETOPDIR=${DESTDIR}/$(exec_prefix)/share/hdf5_examples +# Note: no '/' after DESTDIR. Explanation in commence.am +EXAMPLEDIR=${DESTDIR}$(exec_prefix)/share/hdf5_examples/c +EXAMPLETOPDIR=${DESTDIR}$(exec_prefix)/share/hdf5_examples # List dependencies for each program. Normally, automake would take # care of this for us, but if we tell automake about the programs it diff --git a/examples/Makefile.in b/examples/Makefile.in index ceabee8..80139b8 100644 --- a/examples/Makefile.in +++ b/examples/Makefile.in @@ -315,14 +315,24 @@ LIBH5_HL = $(top_builddir)/hl/src/libhdf5_hl.la LIBH5F_HL = $(top_builddir)/hl/fortran/src/libhdf5hl_fortran.la LIBH5CPP_HL = $(top_builddir)/hl/c++/src/libhdf5_hl_cpp.la +# Note that in svn revision 19400 the '/' after DESTDIR in H5* variables below +# has been removed. According to the official description of DESTDIR by Gnu at +# http://www.gnu.org/prep/standards/html_node/DESTDIR.html, DESTDIR is +# prepended to the normal and complete install path that it precedes for the +# purpose of installing in a temporary directory which is useful for building +# rpms and other packages. The '/' after ${DESTDIR} will be followed by another +# '/' at the beginning of the normal install path. When DESTDIR is empty the +# path then begins with '//', which is incorrect and causes problems at least for +# Cygwin. + # Scripts used to build examples # If only shared libraries have been installed, have h5cc build examples with # shared libraries instead of static libraries -H5CC = $(bindir)/h5cc -H5CC_PP = $(bindir)/h5pcc -H5FC = $(bindir)/h5fc -H5FC_PP = $(bindir)/h5pfc -H5CPP = $(bindir)/h5c++ +H5CC = ${DESTDIR}$(bindir)/h5cc +H5CC_PP = ${DESTDIR}$(bindir)/h5pcc +H5FC = ${DESTDIR}$(bindir)/h5fc +H5FC_PP = ${DESTDIR}$(bindir)/h5pfc +H5CPP = ${DESTDIR}$(bindir)/h5c++ ACLOCAL_AMFLAGS = "-I m4" # The trace script; this is used on source files from the C library to @@ -360,8 +370,9 @@ INSTALL_TOP_SCRIPT_FILES = run-all-ex.sh EXTLINK_DIRS = red blue u2w # Example directory -EXAMPLEDIR = ${DESTDIR}/$(exec_prefix)/share/hdf5_examples/c -EXAMPLETOPDIR = ${DESTDIR}/$(exec_prefix)/share/hdf5_examples +# Note: no '/' after DESTDIR. Explanation in commence.am +EXAMPLEDIR = ${DESTDIR}$(exec_prefix)/share/hdf5_examples/c +EXAMPLETOPDIR = ${DESTDIR}$(exec_prefix)/share/hdf5_examples # Assume that all tests in this directory are examples, and tell # conclude.am when to build them. @@ -649,7 +660,8 @@ uninstall-local: install-examples: $(EXAMPLEDIR) $(INSTALL_FILES) @for f in X $(INSTALL_FILES); do \ if test $$f != X; then \ - (set -x; $(INSTALL) $(srcdir)/$$f $(EXAMPLEDIR)/. || exit 1);\ + (set -x; $(INSTALL) $(srcdir)/$$f $(EXAMPLEDIR)/. || exit 1); \ + chmod a-x $(EXAMPLEDIR)/$$f; \ fi; \ done @for f in X $(INSTALL_SCRIPT_FILES); do \ diff --git a/examples/run-all-ex.sh b/examples/run-all-ex.sh index e96b86f..6837c7e 100755 --- a/examples/run-all-ex.sh +++ b/examples/run-all-ex.sh @@ -26,12 +26,18 @@ if (echo "Run c examples" && \ (cd c; sh ./run-c-ex.sh) && \ - echo "Run fortran examples" && \ - (cd fortran; sh ./run-fortran-ex.sh) && \ - echo "Run c++ examples" && \ - (cd c++; sh ./run-c++-ex.sh) && \ - echo "Run hl examples." && \ - (cd hl; sh ./run-hl-ex.sh)); then + (if test -d fortran; then + echo "Run fortran examples" + cd fortran; sh ./run-fortran-ex.sh + fi) + (if test -d c++; then + echo "Run c++ examples" + cd c++; sh ./run-c++-ex.sh + fi) + (if test -d hl; then + echo "Run hl examples." + cd hl; sh ./run-hl-ex.sh + fi)); then echo "Done" exit 0 else diff --git a/examples/run-c-ex.sh.in b/examples/run-c-ex.sh.in index 09ff2fc..2bc1cd4 100755 --- a/examples/run-c-ex.sh.in +++ b/examples/run-c-ex.sh.in @@ -32,7 +32,8 @@ EXIT_SUCCESS=0 EXIT_FAILURE=1 # Where the tool is installed. -prefix="${prefix:-${DESTDIR}/@prefix@}" +# Note: no '/' after DESTDIR. Explanation in commence.am +prefix="${prefix:-${DESTDIR}@prefix@}" PARALLEL=@PARALLEL@ # Am I in parallel mode? AR="@AR@" RANLIB="@RANLIB@" diff --git a/fortran/Makefile.in b/fortran/Makefile.in index 715dbab..4e7f208 100644 --- a/fortran/Makefile.in +++ b/fortran/Makefile.in @@ -352,14 +352,24 @@ LIBH5_HL = $(top_builddir)/hl/src/libhdf5_hl.la LIBH5F_HL = $(top_builddir)/hl/fortran/src/libhdf5hl_fortran.la LIBH5CPP_HL = $(top_builddir)/hl/c++/src/libhdf5_hl_cpp.la +# Note that in svn revision 19400 the '/' after DESTDIR in H5* variables below +# has been removed. According to the official description of DESTDIR by Gnu at +# http://www.gnu.org/prep/standards/html_node/DESTDIR.html, DESTDIR is +# prepended to the normal and complete install path that it precedes for the +# purpose of installing in a temporary directory which is useful for building +# rpms and other packages. The '/' after ${DESTDIR} will be followed by another +# '/' at the beginning of the normal install path. When DESTDIR is empty the +# path then begins with '//', which is incorrect and causes problems at least for +# Cygwin. + # Scripts used to build examples # If only shared libraries have been installed, have h5cc build examples with # shared libraries instead of static libraries -H5CC = $(bindir)/h5cc -H5CC_PP = $(bindir)/h5pcc -H5FC = $(bindir)/h5fc -H5FC_PP = $(bindir)/h5pfc -H5CPP = $(bindir)/h5c++ +H5CC = ${DESTDIR}$(bindir)/h5cc +H5CC_PP = ${DESTDIR}$(bindir)/h5pcc +H5FC = ${DESTDIR}$(bindir)/h5fc +H5FC_PP = ${DESTDIR}$(bindir)/h5pfc +H5CPP = ${DESTDIR}$(bindir)/h5c++ ACLOCAL_AMFLAGS = "-I m4" # The trace script; this is used on source files from the C library to diff --git a/fortran/examples/CMakeLists.txt b/fortran/examples/CMakeLists.txt index 04e6303..6fe6cc7 100644 --- a/fortran/examples/CMakeLists.txt +++ b/fortran/examples/CMakeLists.txt @@ -39,12 +39,12 @@ FOREACH (example ${examples}) ADD_EXECUTABLE (f90_ex_${example} ${HDF5_F90_EXAMPLES_SOURCE_DIR}/${example}.f90) H5_NAMING (f90_ex_${example}) TARGET_FORTRAN_WIN_PROPERTIES (f90_ex_${example}) - IF (WIN32) + IF (WIN32 AND NOT CYGWIN) SET_PROPERTY (TARGET f90_ex_${example} APPEND PROPERTY COMPILE_DEFINITIONS HDF5F90_WINDOWS ) - ENDIF (WIN32) + ENDIF (WIN32 AND NOT CYGWIN) TARGET_LINK_LIBRARIES (f90_ex_${example} ${HDF5_F90_LIB_TARGET} ${HDF5_LIB_TARGET} @@ -56,12 +56,12 @@ IF (H5_HAVE_PARALLEL) ADD_EXECUTABLE (f90_ex_ph5example ${HDF5_F90_EXAMPLES_SOURCE_DIR}/ph5example.f90) H5_NAMING (f90_ex_ph5example) TARGET_FORTRAN_WIN_PROPERTIES (f90_ex_ph5example) - IF (WIN32) + IF (WIN32 AND NOT CYGWIN) SET_PROPERTY (TARGET f90_ex_ph5example APPEND PROPERTY COMPILE_DEFINITIONS HDF5F90_WINDOWS ) - ENDIF (WIN32) + ENDIF (WIN32 AND NOT CYGWIN) TARGET_LINK_LIBRARIES (f90_ex_ph5example ${HDF5_F90_LIB_TARGET} ${HDF5_LIB_TARGET} diff --git a/fortran/examples/Makefile.am b/fortran/examples/Makefile.am index f27f7ff..57a8f94 100644 --- a/fortran/examples/Makefile.am +++ b/fortran/examples/Makefile.am @@ -65,7 +65,8 @@ $(EXTRA_PROG): $(H5FC) endif # Tell automake how to install examples -EXAMPLEDIR=${DESTDIR}/$(exec_prefix)/share/hdf5_examples/fortran +# Note: no '/' after DESTDIR. Explanation in commence.am +EXAMPLEDIR=${DESTDIR}$(exec_prefix)/share/hdf5_examples/fortran # List dependencies for each example. Normally, automake would take # care of this for us, but if we tell automake about the programs it diff --git a/fortran/examples/Makefile.in b/fortran/examples/Makefile.in index 1862e2f..5d76c0b 100644 --- a/fortran/examples/Makefile.in +++ b/fortran/examples/Makefile.in @@ -315,14 +315,24 @@ LIBH5_HL = $(top_builddir)/hl/src/libhdf5_hl.la LIBH5F_HL = $(top_builddir)/hl/fortran/src/libhdf5hl_fortran.la LIBH5CPP_HL = $(top_builddir)/hl/c++/src/libhdf5_hl_cpp.la +# Note that in svn revision 19400 the '/' after DESTDIR in H5* variables below +# has been removed. According to the official description of DESTDIR by Gnu at +# http://www.gnu.org/prep/standards/html_node/DESTDIR.html, DESTDIR is +# prepended to the normal and complete install path that it precedes for the +# purpose of installing in a temporary directory which is useful for building +# rpms and other packages. The '/' after ${DESTDIR} will be followed by another +# '/' at the beginning of the normal install path. When DESTDIR is empty the +# path then begins with '//', which is incorrect and causes problems at least for +# Cygwin. + # Scripts used to build examples # If only shared libraries have been installed, have h5cc build examples with # shared libraries instead of static libraries -H5CC = $(bindir)/h5cc -H5CC_PP = $(bindir)/h5pcc -H5FC = $(bindir)/h5fc -H5FC_PP = $(bindir)/h5pfc -H5CPP = $(bindir)/h5c++ +H5CC = ${DESTDIR}$(bindir)/h5cc +H5CC_PP = ${DESTDIR}$(bindir)/h5pcc +H5FC = ${DESTDIR}$(bindir)/h5fc +H5FC_PP = ${DESTDIR}$(bindir)/h5pfc +H5CPP = ${DESTDIR}$(bindir)/h5c++ ACLOCAL_AMFLAGS = "-I m4" # The trace script; this is used on source files from the C library to @@ -360,7 +370,8 @@ INSTALL_SCRIPT_FILES = run-fortran-ex.sh FORTRAN_API = yes # Tell automake how to install examples -EXAMPLEDIR = ${DESTDIR}/$(exec_prefix)/share/hdf5_examples/fortran +# Note: no '/' after DESTDIR. Explanation in commence.am +EXAMPLEDIR = ${DESTDIR}$(exec_prefix)/share/hdf5_examples/fortran # Assume that all tests in this directory are examples, and tell # conclude.am when to build them. @@ -645,7 +656,8 @@ uninstall-local: install-examples: $(EXAMPLEDIR) $(INSTALL_FILES) @for f in X $(INSTALL_FILES); do \ if test $$f != X; then \ - (set -x; $(INSTALL) $(srcdir)/$$f $(EXAMPLEDIR)/. || exit 1);\ + (set -x; $(INSTALL) $(srcdir)/$$f $(EXAMPLEDIR)/. || exit 1); \ + chmod a-x $(EXAMPLEDIR)/$$f; \ fi; \ done @for f in X $(INSTALL_SCRIPT_FILES); do \ diff --git a/fortran/examples/run-fortran-ex.sh.in b/fortran/examples/run-fortran-ex.sh.in index 1564537..b29eaaf 100755 --- a/fortran/examples/run-fortran-ex.sh.in +++ b/fortran/examples/run-fortran-ex.sh.in @@ -33,7 +33,8 @@ EXIT_SUCCESS=0 EXIT_FAILURE=1 # Where the tool is installed. -prefix="${prefix:-${DESTDIR}/@prefix@}" +# Note: no '/' after DESTDIR. Explanation in commence.am +prefix="${prefix:-${DESTDIR}@prefix@}" PARALLEL=@PARALLEL@ # Am I in parallel mode? AR="@AR@" RANLIB="@RANLIB@" diff --git a/fortran/src/CMakeLists.txt b/fortran/src/CMakeLists.txt index c2ca1e6..2af57c1 100644 --- a/fortran/src/CMakeLists.txt +++ b/fortran/src/CMakeLists.txt @@ -25,20 +25,18 @@ ELSE (FORTRAN_HAVE_SIZEOF) ${HDF5_F90_SRC_SOURCE_DIR}/H5test_kind.f90 ) ENDIF (FORTRAN_HAVE_SIZEOF) -IF (WIN32) - IF (MSVC) - IF (BUILD_SHARED_LIBS) - SET_TARGET_PROPERTIES (H5test_FortranHavekind - PROPERTIES - COMPILE_FLAGS "/MT" - ) - ENDIF (BUILD_SHARED_LIBS) +IF (WIN32 AND MSVC) + IF (BUILD_SHARED_LIBS) SET_TARGET_PROPERTIES (H5test_FortranHavekind PROPERTIES - LINK_FLAGS "/SUBSYSTEM:CONSOLE" + COMPILE_FLAGS "/MT" ) - ENDIF (MSVC) -ENDIF (WIN32) + ENDIF (BUILD_SHARED_LIBS) + SET_TARGET_PROPERTIES (H5test_FortranHavekind + PROPERTIES + LINK_FLAGS "/SUBSYSTEM:CONSOLE" + ) +ENDIF (WIN32 AND MSVC) SET_TARGET_PROPERTIES (H5test_FortranHavekind PROPERTIES LINKER_LANGUAGE Fortran) SET (CMD ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}${CFG_INIT}/H5test_FortranHavekind${EXE_EXT}) @@ -53,20 +51,18 @@ ADD_CUSTOM_COMMAND ( ADD_EXECUTABLE (H5fortran_detect ${HDF5_F90_BINARY_DIR}/H5fortran_detect.f90 ) -IF (WIN32) - IF (MSVC) - IF (BUILD_SHARED_LIBS) - SET_TARGET_PROPERTIES (H5fortran_detect - PROPERTIES - COMPILE_FLAGS "/MT" - ) - ENDIF (BUILD_SHARED_LIBS) +IF (WIN32 AND MSVC) + IF (BUILD_SHARED_LIBS) SET_TARGET_PROPERTIES (H5fortran_detect PROPERTIES - LINK_FLAGS "/SUBSYSTEM:CONSOLE" + COMPILE_FLAGS "/MT" ) - ENDIF (MSVC) -ENDIF (WIN32) + ENDIF (BUILD_SHARED_LIBS) + SET_TARGET_PROPERTIES (H5fortran_detect + PROPERTIES + LINK_FLAGS "/SUBSYSTEM:CONSOLE" + ) +ENDIF (WIN32 AND MSVC) SET_TARGET_PROPERTIES (H5test_FortranHavekind PROPERTIES LINKER_LANGUAGE Fortran) SET (CMD ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}${CFG_INIT}/H5fortran_detect${EXE_EXT}) @@ -188,7 +184,7 @@ ENDIF (H5_HAVE_PARALLEL) # Add Main fortran library #----------------------------------------------------------------------------- ADD_LIBRARY (${HDF5_F90_LIB_TARGET} ${LIB_TYPE} ${f90_F_SRCS}) -IF (WIN32) +IF (WIN32 AND NOT CYGWIN) IF (BUILD_SHARED_LIBS) SET_PROPERTY (TARGET ${HDF5_F90_LIB_TARGET} APPEND PROPERTY COMPILE_DEFINITIONS @@ -206,7 +202,7 @@ IF (WIN32) APPEND PROPERTY COMPILE_DEFINITIONS HDF5F90_WINDOWS ) -ENDIF (WIN32) +ENDIF (WIN32 AND NOT CYGWIN) SET_TARGET_PROPERTIES (${HDF5_F90_LIB_TARGET} PROPERTIES LINKER_LANGUAGE Fortran) TARGET_LINK_LIBRARIES (${HDF5_F90_LIB_TARGET} ${HDF5_F90_C_LIB_TARGET} ${HDF5_LIB_TARGET}) SET_GLOBAL_VARIABLE (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_F90_LIB_TARGET}") @@ -223,7 +219,7 @@ INSTALL ( ${HDF5_F90_BINARY_DIR}/H5f90i_gen.h ${HDF5_F90_BINARY_DIR}/H5fortran_types.f90 DESTINATION - include/fortran + ${HDF5_INSTALL_INCLUDE_DIR}/fortran COMPONENT fortheaders ) @@ -232,7 +228,7 @@ INSTALL ( DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/\${BUILD_TYPE}/ DESTINATION - include/fortran + ${HDF5_INSTALL_INCLUDE_DIR}/fortran COMPONENT fortheaders ) @@ -247,8 +243,8 @@ IF (HDF5_EXPORTED_TARGETS) ${HDF5_F90_LIB_TARGET} EXPORT ${HDF5_EXPORTED_TARGETS} - LIBRARY DESTINATION lib COMPONENT fortlibraries - ARCHIVE DESTINATION lib COMPONENT fortlibraries - RUNTIME DESTINATION bin COMPONENT fortlibraries + LIBRARY DESTINATION ${HDF5_INSTALL_LIB_DIR} COMPONENT fortlibraries + ARCHIVE DESTINATION ${HDF5_INSTALL_LIB_DIR} COMPONENT fortlibraries + RUNTIME DESTINATION ${HDF5_INSTALL_BIN_DIR} COMPONENT fortlibraries ) ENDIF (HDF5_EXPORTED_TARGETS) diff --git a/fortran/src/Makefile.in b/fortran/src/Makefile.in index b240a7a..cbb002b 100644 --- a/fortran/src/Makefile.in +++ b/fortran/src/Makefile.in @@ -404,14 +404,24 @@ LIBH5_HL = $(top_builddir)/hl/src/libhdf5_hl.la LIBH5F_HL = $(top_builddir)/hl/fortran/src/libhdf5hl_fortran.la LIBH5CPP_HL = $(top_builddir)/hl/c++/src/libhdf5_hl_cpp.la +# Note that in svn revision 19400 the '/' after DESTDIR in H5* variables below +# has been removed. According to the official description of DESTDIR by Gnu at +# http://www.gnu.org/prep/standards/html_node/DESTDIR.html, DESTDIR is +# prepended to the normal and complete install path that it precedes for the +# purpose of installing in a temporary directory which is useful for building +# rpms and other packages. The '/' after ${DESTDIR} will be followed by another +# '/' at the beginning of the normal install path. When DESTDIR is empty the +# path then begins with '//', which is incorrect and causes problems at least for +# Cygwin. + # Scripts used to build examples # If only shared libraries have been installed, have h5cc build examples with # shared libraries instead of static libraries -H5CC = $(bindir)/h5cc -H5CC_PP = $(bindir)/h5pcc -H5FC = $(bindir)/h5fc -H5FC_PP = $(bindir)/h5pfc -H5CPP = $(bindir)/h5c++ +H5CC = ${DESTDIR}$(bindir)/h5cc +H5CC_PP = ${DESTDIR}$(bindir)/h5pcc +H5FC = ${DESTDIR}$(bindir)/h5fc +H5FC_PP = ${DESTDIR}$(bindir)/h5pfc +H5CPP = ${DESTDIR}$(bindir)/h5c++ ACLOCAL_AMFLAGS = "-I m4" # The trace script; this is used on source files from the C library to @@ -426,7 +436,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 65 +LT_VERS_REVISION = 66 LT_VERS_AGE = 0 # Include src directory in both Fortran and C flags (C compiler is used diff --git a/fortran/src/h5fc.in b/fortran/src/h5fc.in index db44600..9e9409d 100755 --- a/fortran/src/h5fc.in +++ b/fortran/src/h5fc.in @@ -32,6 +32,24 @@ HL="@HL@" ############################################################################ ## ## +## Things You Can Modify to Override HDF5 Library Build Components: ## +## ## +## (Advanced usage - know what you're doing - you're on your own here.) ## +## The three variables below can be used to insert paths and flags in ## +## FFLAGS, LDFLAGS, or LIBS in the h5fc compile line: ## +## $FLINKER $FFLAGS $H5BLD_FFLAGS $F9XSUFFIXFLAG $LDFLAGS $LIBS ## +## $fmodules $link_objs $link_args $shared_link ## +## ## +## These settings can be overriden by setting HDF5_FFLAGS, ## +## HDF5_LDFLAGS, or HDF5_LIBS in the environment. ## +## ## +############################################################################ +FFLAGSBASE="" +LDFLAGSBASE="" +LIBSBASE="" + +############################################################################ +## ## ## You shouldn't have to modify anything below this line. ## ## ## ############################################################################ @@ -58,14 +76,27 @@ get_output_file="no" SHOW="eval" FCBASE="@FC@" FLINKERBASE="@FC@" -FFLAGS="@AM_FCFLAGS@ @FCFLAGS@" + +# FFLAGS and LDFLAGS are reserved for use by the script user. +# FLAGS brought from the hdf5 build are put in H5BLD_*FLAGS. + +# User's FFLAGS come after their H5BLD counterparts to override +# them. User's LDFLAGS come just before clibpath, user's LIBS come after +# $link_objs and before the hdf5 libraries in $link_args, followed by any +# external library paths and libraries from AM_LDFLAGS, LDFLAGS, AM_LIBS +# or LIBS carried in from the hdf5 build. + +H5BLD_FFLAGS="@AM_FCFLAGS@ @FCFLAGS@" F9XMODFLAG="@F9XMODFLAG@" F9XSUFFIXFLAG="@F9XSUFFIXFLAG@" -LDFLAGS="@AM_LDFLAGS@ @LDFLAGS@" -LIBS="@LIBS@" +H5BLD_LDFLAGS="@AM_LDFLAGS@ @LDFLAGS@" +H5BLD_LIBS="@LIBS@" FC="${HDF5_FC:-$FCBASE}" FLINKER="${HDF5_FLINKER:-$FLINKERBASE}" +FFLAGS="${HDF5_FFLAGS:-$FFLAGSBASE}" +LDFLAGS="${HDF5_LDFLAGS:-$LDFLAGSBASE}" +LIBS="${HDF5_LIBS:-$LIBSBASE}" USE_SHARED_LIB="${HDF5_USE_SHLIB:-no}" @@ -92,6 +123,20 @@ usage() { echo " " echo " HDF5_FC - use a different Fortran 90 or 95 compiler" echo " HDF5_FLINKER - use a different linker" + echo " HDF5_USE_SHLIB=[yes|no] - use shared or static version of the HDF5 library" + echo " [default: no]" + echo " " + echo " You can also add or change paths and flags to the compile line using" + echo " the following environment varibles or by assigning them to their counterparts" + echo " in the 'Things You Can Modify to Override...'" section of $prog_name + echo " " + echo " Variable Current value to be replaced" + echo " HDF5_FFLAGS \"$CFLAGSBASE\"" + echo " HDF5_LDFLAGS \"$LDFLAGSBASE\"" + echo " HDF5_LIBS \"$LIBSBASE\"" + echo " " + echo " Note that adding library paths to HDF5_LDFLAGS where another hdf5 version" + echo " is located may link your program with that other hdf5 library version." echo " " exit $EXIT_FAILURE } @@ -228,7 +273,7 @@ if test "x$do_compile" = "xyes"; then fi - $SHOW $FC $FFLAGS ${F9XSUFFIXFLAG} ${fmodules} $compile_args + $SHOW $FC $H5BLD_FFLAGS $FFLAGS ${F9XSUFFIXFLAG} ${fmodules} $compile_args status=$? if test "$status" != "0"; then @@ -297,9 +342,14 @@ if test "x$do_link" = "xyes"; then # The LIBS are just a bunch of -l* libraries necessary for the HDF5 # module. It's okay if they're included twice in the compile line. - link_args="$link_args $LIBS" - - $SHOW $FLINKER $FFLAGS $F9XSUFFIXFLAG $fmodules $link_objs $link_args $shared_link $LDFLAGS + link_args="$link_args $H5BLD_LDFLAGS $H5BLD_LIBS" + + # User's FFLAGS come after their H5BLD counterparts to override + # them. User's LDFLAGS come just before clibpath, user's LIBS come after + # $link_objs and before the hdf5 libraries in $link_args, followed by any + # external library paths and libraries from AM_LDFLAGS, LDFLAGS, AM_LIBS + # or LIBS carried in from the hdf5 build. + $SHOW $FLINKER $FFLAGS $H5BLD_FFLAGS $F9XSUFFIXFLAG $LDFLAGS $fmodules $link_objs $LIBS $link_args $shared_link status=$? fi diff --git a/fortran/test/CMakeLists.txt b/fortran/test/CMakeLists.txt index 7c8c407..a536c2e 100644 --- a/fortran/test/CMakeLists.txt +++ b/fortran/test/CMakeLists.txt @@ -30,7 +30,7 @@ ADD_LIBRARY (${HDF5_F90_TEST_LIB_TARGET} ${LIB_TYPE} tf.f90) ADD_DEPENDENCIES(${HDF5_F90_TEST_LIB_TARGET} ${HDF5_F90_C_TEST_LIB_TARGET} ) -IF (WIN32) +IF (WIN32 AND NOT CYGWIN) IF (BUILD_SHARED_LIBS) SET_PROPERTY (TARGET ${HDF5_F90_TEST_LIB_TARGET} APPEND PROPERTY COMPILE_DEFINITIONS @@ -48,7 +48,7 @@ IF (WIN32) APPEND PROPERTY COMPILE_DEFINITIONS HDF5F90_WINDOWS ) -ENDIF (WIN32) +ENDIF (WIN32 AND NOT CYGWIN) SET_TARGET_PROPERTIES (${HDF5_F90_TEST_LIB_TARGET} PROPERTIES LINKER_LANGUAGE Fortran) TARGET_LINK_LIBRARIES (${HDF5_F90_TEST_LIB_TARGET} ${HDF5_F90_C_TEST_LIB_TARGET}) H5_SET_LIB_OPTIONS (${HDF5_F90_TEST_LIB_TARGET} ${HDF5_F90_TEST_LIB_NAME} ${LIB_TYPE}) @@ -81,11 +81,9 @@ TARGET_LINK_LIBRARIES (testhdf5_fortran ${HDF5_F90_LIB_TARGET} ${HDF5_LIB_TARGET} ) -IF (WIN32) - IF (MSVC) - TARGET_LINK_LIBRARIES (testhdf5_fortran "ws2_32.lib") - ENDIF (MSVC) -ENDIF (WIN32) +IF (WIN32 AND MSVC) + TARGET_LINK_LIBRARIES (testhdf5_fortran "ws2_32.lib") +ENDIF (WIN32 AND MSVC) SET_TARGET_PROPERTIES (testhdf5_fortran PROPERTIES LINKER_LANGUAGE Fortran) ADD_TEST (NAME testhdf5_fortran COMMAND $) @@ -105,11 +103,9 @@ TARGET_LINK_LIBRARIES (testhdf5_fortran_1_8 ${HDF5_F90_LIB_TARGET} ${HDF5_LIB_TARGET} ) -IF (WIN32) - IF (MSVC) - TARGET_LINK_LIBRARIES (testhdf5_fortran_1_8 "ws2_32.lib") - ENDIF (MSVC) -ENDIF (WIN32) +IF (WIN32 AND MSVC) + TARGET_LINK_LIBRARIES (testhdf5_fortran_1_8 "ws2_32.lib") +ENDIF (WIN32 AND MSVC) SET_TARGET_PROPERTIES (testhdf5_fortran_1_8 PROPERTIES LINKER_LANGUAGE Fortran) ADD_TEST (NAME testhdf5_fortran_1_8 COMMAND $) @@ -123,11 +119,9 @@ TARGET_LINK_LIBRARIES (fflush1 ${HDF5_F90_TEST_LIB_TARGET} ${HDF5_LIB_TARGET} ) -IF (WIN32) - IF (MSVC) - TARGET_LINK_LIBRARIES (fflush1 "ws2_32.lib") - ENDIF (MSVC) -ENDIF (WIN32) +IF (WIN32 AND MSVC) + TARGET_LINK_LIBRARIES (fflush1 "ws2_32.lib") +ENDIF (WIN32 AND MSVC) SET_TARGET_PROPERTIES (fflush1 PROPERTIES LINKER_LANGUAGE Fortran) ADD_TEST (NAME fflush1 COMMAND $) @@ -141,11 +135,9 @@ TARGET_LINK_LIBRARIES (fflush2 ${HDF5_F90_LIB_TARGET} ${HDF5_LIB_TARGET} ) -IF (WIN32) - IF (MSVC) - TARGET_LINK_LIBRARIES (fflush2 "ws2_32.lib") - ENDIF (MSVC) -ENDIF (WIN32) +IF (WIN32 AND MSVC) + TARGET_LINK_LIBRARIES (fflush2 "ws2_32.lib") +ENDIF (WIN32 AND MSVC) SET_TARGET_PROPERTIES (fflush2 PROPERTIES LINKER_LANGUAGE Fortran) ADD_TEST (NAME fflush2 COMMAND $) diff --git a/fortran/test/Makefile.in b/fortran/test/Makefile.in index 7b8369b..4c0b03f 100644 --- a/fortran/test/Makefile.in +++ b/fortran/test/Makefile.in @@ -385,14 +385,24 @@ LIBH5_HL = $(top_builddir)/hl/src/libhdf5_hl.la LIBH5F_HL = $(top_builddir)/hl/fortran/src/libhdf5hl_fortran.la LIBH5CPP_HL = $(top_builddir)/hl/c++/src/libhdf5_hl_cpp.la +# Note that in svn revision 19400 the '/' after DESTDIR in H5* variables below +# has been removed. According to the official description of DESTDIR by Gnu at +# http://www.gnu.org/prep/standards/html_node/DESTDIR.html, DESTDIR is +# prepended to the normal and complete install path that it precedes for the +# purpose of installing in a temporary directory which is useful for building +# rpms and other packages. The '/' after ${DESTDIR} will be followed by another +# '/' at the beginning of the normal install path. When DESTDIR is empty the +# path then begins with '//', which is incorrect and causes problems at least for +# Cygwin. + # Scripts used to build examples # If only shared libraries have been installed, have h5cc build examples with # shared libraries instead of static libraries -H5CC = $(bindir)/h5cc -H5CC_PP = $(bindir)/h5pcc -H5FC = $(bindir)/h5fc -H5FC_PP = $(bindir)/h5pfc -H5CPP = $(bindir)/h5c++ +H5CC = ${DESTDIR}$(bindir)/h5cc +H5CC_PP = ${DESTDIR}$(bindir)/h5pcc +H5FC = ${DESTDIR}$(bindir)/h5fc +H5FC_PP = ${DESTDIR}$(bindir)/h5pfc +H5CPP = ${DESTDIR}$(bindir)/h5c++ ACLOCAL_AMFLAGS = "-I m4" # The trace script; this is used on source files from the C library to diff --git a/fortran/testpar/CMakeLists.txt b/fortran/testpar/CMakeLists.txt index 7f702da..edabb35 100644 --- a/fortran/testpar/CMakeLists.txt +++ b/fortran/testpar/CMakeLists.txt @@ -28,11 +28,9 @@ TARGET_LINK_LIBRARIES (parallel_test ${HDF5_F90_LIB_TARGET} ${HDF5_LIB_TARGET} ) -IF (WIN32) - IF (MSVC) - TARGET_LINK_LIBRARIES (parallel_test "ws2_32.lib") - ENDIF (MSVC) -ENDIF (WIN32) +IF (WIN32 AND MSVC) + TARGET_LINK_LIBRARIES (parallel_test "ws2_32.lib") +ENDIF (WIN32 AND MSVC) SET_TARGET_PROPERTIES (parallel_test PROPERTIES LINKER_LANGUAGE Fortran) ADD_TEST (NAME parallel_test COMMAND ${MPIEXEC} ${MPIEXEC_PREFLAGS} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_POSTFLAGS} $) diff --git a/fortran/testpar/Makefile.in b/fortran/testpar/Makefile.in index 7bef605..f2e70b4 100644 --- a/fortran/testpar/Makefile.in +++ b/fortran/testpar/Makefile.in @@ -338,14 +338,24 @@ LIBH5_HL = $(top_builddir)/hl/src/libhdf5_hl.la LIBH5F_HL = $(top_builddir)/hl/fortran/src/libhdf5hl_fortran.la LIBH5CPP_HL = $(top_builddir)/hl/c++/src/libhdf5_hl_cpp.la +# Note that in svn revision 19400 the '/' after DESTDIR in H5* variables below +# has been removed. According to the official description of DESTDIR by Gnu at +# http://www.gnu.org/prep/standards/html_node/DESTDIR.html, DESTDIR is +# prepended to the normal and complete install path that it precedes for the +# purpose of installing in a temporary directory which is useful for building +# rpms and other packages. The '/' after ${DESTDIR} will be followed by another +# '/' at the beginning of the normal install path. When DESTDIR is empty the +# path then begins with '//', which is incorrect and causes problems at least for +# Cygwin. + # Scripts used to build examples # If only shared libraries have been installed, have h5cc build examples with # shared libraries instead of static libraries -H5CC = $(bindir)/h5cc -H5CC_PP = $(bindir)/h5pcc -H5FC = $(bindir)/h5fc -H5FC_PP = $(bindir)/h5pfc -H5CPP = $(bindir)/h5c++ +H5CC = ${DESTDIR}$(bindir)/h5cc +H5CC_PP = ${DESTDIR}$(bindir)/h5pcc +H5FC = ${DESTDIR}$(bindir)/h5fc +H5FC_PP = ${DESTDIR}$(bindir)/h5pfc +H5CPP = ${DESTDIR}$(bindir)/h5c++ ACLOCAL_AMFLAGS = "-I m4" # The trace script; this is used on source files from the C library to diff --git a/hl/Makefile.in b/hl/Makefile.in index 2c607d6..f599f5c 100755 --- a/hl/Makefile.in +++ b/hl/Makefile.in @@ -352,14 +352,24 @@ LIBH5_HL = $(top_builddir)/hl/src/libhdf5_hl.la LIBH5F_HL = $(top_builddir)/hl/fortran/src/libhdf5hl_fortran.la LIBH5CPP_HL = $(top_builddir)/hl/c++/src/libhdf5_hl_cpp.la +# Note that in svn revision 19400 the '/' after DESTDIR in H5* variables below +# has been removed. According to the official description of DESTDIR by Gnu at +# http://www.gnu.org/prep/standards/html_node/DESTDIR.html, DESTDIR is +# prepended to the normal and complete install path that it precedes for the +# purpose of installing in a temporary directory which is useful for building +# rpms and other packages. The '/' after ${DESTDIR} will be followed by another +# '/' at the beginning of the normal install path. When DESTDIR is empty the +# path then begins with '//', which is incorrect and causes problems at least for +# Cygwin. + # Scripts used to build examples # If only shared libraries have been installed, have h5cc build examples with # shared libraries instead of static libraries -H5CC = $(bindir)/h5cc -H5CC_PP = $(bindir)/h5pcc -H5FC = $(bindir)/h5fc -H5FC_PP = $(bindir)/h5pfc -H5CPP = $(bindir)/h5c++ +H5CC = ${DESTDIR}$(bindir)/h5cc +H5CC_PP = ${DESTDIR}$(bindir)/h5pcc +H5FC = ${DESTDIR}$(bindir)/h5fc +H5FC_PP = ${DESTDIR}$(bindir)/h5pfc +H5CPP = ${DESTDIR}$(bindir)/h5c++ ACLOCAL_AMFLAGS = "-I m4" # The trace script; this is used on source files from the C library to diff --git a/hl/c++/Makefile.in b/hl/c++/Makefile.in index af6b481..f0a1d05 100644 --- a/hl/c++/Makefile.in +++ b/hl/c++/Makefile.in @@ -348,14 +348,24 @@ LIBH5_HL = $(top_builddir)/hl/src/libhdf5_hl.la LIBH5F_HL = $(top_builddir)/hl/fortran/src/libhdf5hl_fortran.la LIBH5CPP_HL = $(top_builddir)/hl/c++/src/libhdf5_hl_cpp.la +# Note that in svn revision 19400 the '/' after DESTDIR in H5* variables below +# has been removed. According to the official description of DESTDIR by Gnu at +# http://www.gnu.org/prep/standards/html_node/DESTDIR.html, DESTDIR is +# prepended to the normal and complete install path that it precedes for the +# purpose of installing in a temporary directory which is useful for building +# rpms and other packages. The '/' after ${DESTDIR} will be followed by another +# '/' at the beginning of the normal install path. When DESTDIR is empty the +# path then begins with '//', which is incorrect and causes problems at least for +# Cygwin. + # Scripts used to build examples # If only shared libraries have been installed, have h5cc build examples with # shared libraries instead of static libraries -H5CC = $(bindir)/h5cc -H5CC_PP = $(bindir)/h5pcc -H5FC = $(bindir)/h5fc -H5FC_PP = $(bindir)/h5pfc -H5CPP = $(bindir)/h5c++ +H5CC = ${DESTDIR}$(bindir)/h5cc +H5CC_PP = ${DESTDIR}$(bindir)/h5pcc +H5FC = ${DESTDIR}$(bindir)/h5fc +H5FC_PP = ${DESTDIR}$(bindir)/h5pfc +H5CPP = ${DESTDIR}$(bindir)/h5c++ ACLOCAL_AMFLAGS = "-I m4" # The trace script; this is used on source files from the C library to diff --git a/hl/c++/examples/Makefile.am b/hl/c++/examples/Makefile.am index da1580a..c690a12 100644 --- a/hl/c++/examples/Makefile.am +++ b/hl/c++/examples/Makefile.am @@ -33,7 +33,8 @@ INSTALL_SCRIPT_FILES = run-hlc++-ex.sh CXX_API=yes # Where to install examples -EXAMPLEDIR=${DESTDIR}/$(exec_prefix)/share/hdf5_examples/hl/c++ +# Note: no '/' after DESTDIR. Explanation in commence.am +EXAMPLEDIR=${DESTDIR}$(exec_prefix)/share/hdf5_examples/hl/c++ # How to build programs using h5c++ $(EXTRA_PROG): $(H5CPP) diff --git a/hl/c++/examples/Makefile.in b/hl/c++/examples/Makefile.in index ae60c75..b7d628b 100644 --- a/hl/c++/examples/Makefile.in +++ b/hl/c++/examples/Makefile.in @@ -314,14 +314,24 @@ LIBH5_HL = $(top_builddir)/hl/src/libhdf5_hl.la LIBH5F_HL = $(top_builddir)/hl/fortran/src/libhdf5hl_fortran.la LIBH5CPP_HL = $(top_builddir)/hl/c++/src/libhdf5_hl_cpp.la +# Note that in svn revision 19400 the '/' after DESTDIR in H5* variables below +# has been removed. According to the official description of DESTDIR by Gnu at +# http://www.gnu.org/prep/standards/html_node/DESTDIR.html, DESTDIR is +# prepended to the normal and complete install path that it precedes for the +# purpose of installing in a temporary directory which is useful for building +# rpms and other packages. The '/' after ${DESTDIR} will be followed by another +# '/' at the beginning of the normal install path. When DESTDIR is empty the +# path then begins with '//', which is incorrect and causes problems at least for +# Cygwin. + # Scripts used to build examples # If only shared libraries have been installed, have h5cc build examples with # shared libraries instead of static libraries -H5CC = $(bindir)/h5cc -H5CC_PP = $(bindir)/h5pcc -H5FC = $(bindir)/h5fc -H5FC_PP = $(bindir)/h5pfc -H5CPP = $(bindir)/h5c++ +H5CC = ${DESTDIR}$(bindir)/h5cc +H5CC_PP = ${DESTDIR}$(bindir)/h5pcc +H5FC = ${DESTDIR}$(bindir)/h5fc +H5FC_PP = ${DESTDIR}$(bindir)/h5pfc +H5CPP = ${DESTDIR}$(bindir)/h5c++ ACLOCAL_AMFLAGS = "-I m4" # The trace script; this is used on source files from the C library to @@ -345,7 +355,8 @@ INSTALL_SCRIPT_FILES = run-hlc++-ex.sh CXX_API = yes # Where to install examples -EXAMPLEDIR = ${DESTDIR}/$(exec_prefix)/share/hdf5_examples/hl/c++ +# Note: no '/' after DESTDIR. Explanation in commence.am +EXAMPLEDIR = ${DESTDIR}$(exec_prefix)/share/hdf5_examples/hl/c++ # Assume that all tests in this directory are examples, and tell # conclude.am when to build them. @@ -602,7 +613,8 @@ uninstall-local: install-examples: $(EXAMPLEDIR) $(INSTALL_FILES) @for f in X $(INSTALL_FILES); do \ if test $$f != X; then \ - (set -x; $(INSTALL) $(srcdir)/$$f $(EXAMPLEDIR)/. || exit 1);\ + (set -x; $(INSTALL) $(srcdir)/$$f $(EXAMPLEDIR)/. || exit 1); \ + chmod a-x $(EXAMPLEDIR)/$$f; \ fi; \ done @for f in X $(INSTALL_SCRIPT_FILES); do \ diff --git a/hl/c++/examples/run-hlc++-ex.sh.in b/hl/c++/examples/run-hlc++-ex.sh.in index 4e6b1fb..d43606e 100755 --- a/hl/c++/examples/run-hlc++-ex.sh.in +++ b/hl/c++/examples/run-hlc++-ex.sh.in @@ -31,9 +31,9 @@ # Initializations EXIT_SUCCESS=0 EXIT_FAILURE=1 - # Where the tool is installed. -prefix="${prefix:-${DESTDIR}/@prefix@}" +# Note: no '/' after DESTDIR. Explanation in commence.am +prefix="${prefix:-${DESTDIR}@prefix@}" AR="@AR@" RANLIB="@RANLIB@" H5TOOL="h5c++" # The tool name diff --git a/hl/c++/src/CMakeLists.txt b/hl/c++/src/CMakeLists.txt index afd4cf4..1e765e9 100644 --- a/hl/c++/src/CMakeLists.txt +++ b/hl/c++/src/CMakeLists.txt @@ -26,7 +26,7 @@ INSTALL ( FILES ${HDF5_HL_CPP_HDRS} DESTINATION - include/hl/cpp + ${HDF5_INSTALL_INCLUDE_DIR}/hl/cpp COMPONENT hlcppheaders ) @@ -40,8 +40,8 @@ IF (HDF5_EXPORTED_TARGETS) ${HDF5_HL_CPP_LIB_TARGET} EXPORT ${HDF5_EXPORTED_TARGETS} - LIBRARY DESTINATION lib COMPONENT hlcpplibraries - ARCHIVE DESTINATION lib COMPONENT hlcpplibraries - RUNTIME DESTINATION bin COMPONENT hlcpplibraries + LIBRARY DESTINATION ${HDF5_INSTALL_LIB_DIR} COMPONENT hlcpplibraries + ARCHIVE DESTINATION ${HDF5_INSTALL_LIB_DIR} COMPONENT hlcpplibraries + RUNTIME DESTINATION ${HDF5_INSTALL_BIN_DIR} COMPONENT hlcpplibraries ) ENDIF (HDF5_EXPORTED_TARGETS) diff --git a/hl/c++/src/Makefile.in b/hl/c++/src/Makefile.in index 8251168..e20c7e9 100644 --- a/hl/c++/src/Makefile.in +++ b/hl/c++/src/Makefile.in @@ -360,14 +360,24 @@ LIBH5_HL = $(top_builddir)/hl/src/libhdf5_hl.la LIBH5F_HL = $(top_builddir)/hl/fortran/src/libhdf5hl_fortran.la LIBH5CPP_HL = $(top_builddir)/hl/c++/src/libhdf5_hl_cpp.la +# Note that in svn revision 19400 the '/' after DESTDIR in H5* variables below +# has been removed. According to the official description of DESTDIR by Gnu at +# http://www.gnu.org/prep/standards/html_node/DESTDIR.html, DESTDIR is +# prepended to the normal and complete install path that it precedes for the +# purpose of installing in a temporary directory which is useful for building +# rpms and other packages. The '/' after ${DESTDIR} will be followed by another +# '/' at the beginning of the normal install path. When DESTDIR is empty the +# path then begins with '//', which is incorrect and causes problems at least for +# Cygwin. + # Scripts used to build examples # If only shared libraries have been installed, have h5cc build examples with # shared libraries instead of static libraries -H5CC = $(bindir)/h5cc -H5CC_PP = $(bindir)/h5pcc -H5FC = $(bindir)/h5fc -H5FC_PP = $(bindir)/h5pfc -H5CPP = $(bindir)/h5c++ +H5CC = ${DESTDIR}$(bindir)/h5cc +H5CC_PP = ${DESTDIR}$(bindir)/h5pcc +H5FC = ${DESTDIR}$(bindir)/h5fc +H5FC_PP = ${DESTDIR}$(bindir)/h5pfc +H5CPP = ${DESTDIR}$(bindir)/h5c++ ACLOCAL_AMFLAGS = "-I m4" # The trace script; this is used on source files from the C library to @@ -382,7 +392,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 65 +LT_VERS_REVISION = 66 LT_VERS_AGE = 0 # Include src directory diff --git a/hl/c++/test/Makefile.in b/hl/c++/test/Makefile.in index ef60bd4..3128fe8 100644 --- a/hl/c++/test/Makefile.in +++ b/hl/c++/test/Makefile.in @@ -334,14 +334,24 @@ LIBH5_HL = $(top_builddir)/hl/src/libhdf5_hl.la LIBH5F_HL = $(top_builddir)/hl/fortran/src/libhdf5hl_fortran.la LIBH5CPP_HL = $(top_builddir)/hl/c++/src/libhdf5_hl_cpp.la +# Note that in svn revision 19400 the '/' after DESTDIR in H5* variables below +# has been removed. According to the official description of DESTDIR by Gnu at +# http://www.gnu.org/prep/standards/html_node/DESTDIR.html, DESTDIR is +# prepended to the normal and complete install path that it precedes for the +# purpose of installing in a temporary directory which is useful for building +# rpms and other packages. The '/' after ${DESTDIR} will be followed by another +# '/' at the beginning of the normal install path. When DESTDIR is empty the +# path then begins with '//', which is incorrect and causes problems at least for +# Cygwin. + # Scripts used to build examples # If only shared libraries have been installed, have h5cc build examples with # shared libraries instead of static libraries -H5CC = $(bindir)/h5cc -H5CC_PP = $(bindir)/h5pcc -H5FC = $(bindir)/h5fc -H5FC_PP = $(bindir)/h5pfc -H5CPP = $(bindir)/h5c++ +H5CC = ${DESTDIR}$(bindir)/h5cc +H5CC_PP = ${DESTDIR}$(bindir)/h5pcc +H5FC = ${DESTDIR}$(bindir)/h5fc +H5FC_PP = ${DESTDIR}$(bindir)/h5pfc +H5CPP = ${DESTDIR}$(bindir)/h5c++ ACLOCAL_AMFLAGS = "-I m4" # The trace script; this is used on source files from the C library to diff --git a/hl/examples/Makefile.am b/hl/examples/Makefile.am index 64a29d4..d1f67bc 100644 --- a/hl/examples/Makefile.am +++ b/hl/examples/Makefile.am @@ -26,8 +26,9 @@ if BUILD_PARALLEL_CONDITIONAL endif # Example directory -EXAMPLEDIR=${DESTDIR}/$(exec_prefix)/share/hdf5_examples/hl/c -EXAMPLETOPDIR=${DESTDIR}/$(exec_prefix)/share/hdf5_examples/hl +# Note: no '/' after DESTDIR. Explanation in commence.am +EXAMPLEDIR=${DESTDIR}$(exec_prefix)/share/hdf5_examples/hl/c +EXAMPLETOPDIR=${DESTDIR}$(exec_prefix)/share/hdf5_examples/hl # Example programs. # Don't tell automake about them, because if it knew they were programs, diff --git a/hl/examples/Makefile.in b/hl/examples/Makefile.in index 8e15960..c3fa914 100644 --- a/hl/examples/Makefile.in +++ b/hl/examples/Makefile.in @@ -314,14 +314,24 @@ LIBH5_HL = $(top_builddir)/hl/src/libhdf5_hl.la LIBH5F_HL = $(top_builddir)/hl/fortran/src/libhdf5hl_fortran.la LIBH5CPP_HL = $(top_builddir)/hl/c++/src/libhdf5_hl_cpp.la +# Note that in svn revision 19400 the '/' after DESTDIR in H5* variables below +# has been removed. According to the official description of DESTDIR by Gnu at +# http://www.gnu.org/prep/standards/html_node/DESTDIR.html, DESTDIR is +# prepended to the normal and complete install path that it precedes for the +# purpose of installing in a temporary directory which is useful for building +# rpms and other packages. The '/' after ${DESTDIR} will be followed by another +# '/' at the beginning of the normal install path. When DESTDIR is empty the +# path then begins with '//', which is incorrect and causes problems at least for +# Cygwin. + # Scripts used to build examples # If only shared libraries have been installed, have h5cc build examples with # shared libraries instead of static libraries -H5CC = $(bindir)/h5cc -H5CC_PP = $(bindir)/h5pcc -H5FC = $(bindir)/h5fc -H5FC_PP = $(bindir)/h5pfc -H5CPP = $(bindir)/h5c++ +H5CC = ${DESTDIR}$(bindir)/h5cc +H5CC_PP = ${DESTDIR}$(bindir)/h5pcc +H5FC = ${DESTDIR}$(bindir)/h5fc +H5FC_PP = ${DESTDIR}$(bindir)/h5pfc +H5CPP = ${DESTDIR}$(bindir)/h5c++ ACLOCAL_AMFLAGS = "-I m4" # The trace script; this is used on source files from the C library to @@ -335,8 +345,9 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.h5 @BUILD_PARALLEL_CONDITIONAL_TRUE@TEST_PROG_PARA = # Example directory -EXAMPLEDIR = ${DESTDIR}/$(exec_prefix)/share/hdf5_examples/hl/c -EXAMPLETOPDIR = ${DESTDIR}/$(exec_prefix)/share/hdf5_examples/hl +# Note: no '/' after DESTDIR. Explanation in commence.am +EXAMPLEDIR = ${DESTDIR}$(exec_prefix)/share/hdf5_examples/hl/c +EXAMPLETOPDIR = ${DESTDIR}$(exec_prefix)/share/hdf5_examples/hl # Example programs. # Don't tell automake about them, because if it knew they were programs, @@ -643,7 +654,8 @@ uninstall-local: install-examples: $(EXAMPLEDIR) $(INSTALL_FILES) @for f in X $(INSTALL_FILES); do \ if test $$f != X; then \ - (set -x; $(INSTALL) $(srcdir)/$$f $(EXAMPLEDIR)/. || exit 1);\ + (set -x; $(INSTALL) $(srcdir)/$$f $(EXAMPLEDIR)/. || exit 1); \ + chmod a-x $(EXAMPLEDIR)/$$f; \ fi; \ done @for f in X $(INSTALL_SCRIPT_FILES); do \ diff --git a/hl/examples/run-hl-ex.sh b/hl/examples/run-hl-ex.sh index 0478f76..5fa97c0 100755 --- a/hl/examples/run-hl-ex.sh +++ b/hl/examples/run-hl-ex.sh @@ -25,10 +25,14 @@ if (echo "Run hl c examples" && \ (cd c; sh ./run-hlc-ex.sh) && \ - echo "Run hl fortran examples" && \ - (cd fortran; sh ./run-hlfortran-ex.sh) && \ - echo "Run hl c++ examples" && \ - (cd c++; sh ./run-hlc++-ex.sh)); then + (if test -d fortran; then + echo "Run hl fortran examples" + cd fortran; sh ./run-hlfortran-ex.sh + fi) + (if test -d c++; then + echo "Run hl c++ examples" + cd c++; sh ./run-hlc++-ex.sh + fi)); then echo "Finished running hl examples" exit 0 else diff --git a/hl/examples/run-hlc-ex.sh.in b/hl/examples/run-hlc-ex.sh.in index d66d9e0..86c6276 100755 --- a/hl/examples/run-hlc-ex.sh.in +++ b/hl/examples/run-hlc-ex.sh.in @@ -32,7 +32,8 @@ EXIT_SUCCESS=0 EXIT_FAILURE=1 # Where the tool is installed. -prefix="${prefix:-${DESTDIR}/@prefix@}" +# Note: no '/' after DESTDIR. Explanation in commence.am +prefix="${prefix:-${DESTDIR}@prefix@}" PARALLEL=@PARALLEL@ # Am I in parallel mode? AR="@AR@" RANLIB="@RANLIB@" diff --git a/hl/fortran/Makefile.in b/hl/fortran/Makefile.in index a6632be..cbf948b 100644 --- a/hl/fortran/Makefile.in +++ b/hl/fortran/Makefile.in @@ -352,14 +352,24 @@ LIBH5_HL = $(top_builddir)/hl/src/libhdf5_hl.la LIBH5F_HL = $(top_builddir)/hl/fortran/src/libhdf5hl_fortran.la LIBH5CPP_HL = $(top_builddir)/hl/c++/src/libhdf5_hl_cpp.la +# Note that in svn revision 19400 the '/' after DESTDIR in H5* variables below +# has been removed. According to the official description of DESTDIR by Gnu at +# http://www.gnu.org/prep/standards/html_node/DESTDIR.html, DESTDIR is +# prepended to the normal and complete install path that it precedes for the +# purpose of installing in a temporary directory which is useful for building +# rpms and other packages. The '/' after ${DESTDIR} will be followed by another +# '/' at the beginning of the normal install path. When DESTDIR is empty the +# path then begins with '//', which is incorrect and causes problems at least for +# Cygwin. + # Scripts used to build examples # If only shared libraries have been installed, have h5cc build examples with # shared libraries instead of static libraries -H5CC = $(bindir)/h5cc -H5CC_PP = $(bindir)/h5pcc -H5FC = $(bindir)/h5fc -H5FC_PP = $(bindir)/h5pfc -H5CPP = $(bindir)/h5c++ +H5CC = ${DESTDIR}$(bindir)/h5cc +H5CC_PP = ${DESTDIR}$(bindir)/h5pcc +H5FC = ${DESTDIR}$(bindir)/h5fc +H5FC_PP = ${DESTDIR}$(bindir)/h5pfc +H5CPP = ${DESTDIR}$(bindir)/h5c++ ACLOCAL_AMFLAGS = "-I m4" # The trace script; this is used on source files from the C library to diff --git a/hl/fortran/examples/Makefile.am b/hl/fortran/examples/Makefile.am index acb4a02..7c31fa7 100644 --- a/hl/fortran/examples/Makefile.am +++ b/hl/fortran/examples/Makefile.am @@ -51,7 +51,8 @@ $(EXTRA_PROG): $(H5FC) endif # Tell automake how to install examples -EXAMPLEDIR=${DESTDIR}/$(exec_prefix)/share/hdf5_examples/hl/fortran +# Note: no '/' after DESTDIR. Explanation in commence.am +EXAMPLEDIR=${DESTDIR}$(exec_prefix)/share/hdf5_examples/hl/fortran # List dependencies for each example. Normally, automake would take # care of this for us, but if we tell automake about the programs it diff --git a/hl/fortran/examples/Makefile.in b/hl/fortran/examples/Makefile.in index 6394565..62e02c5 100644 --- a/hl/fortran/examples/Makefile.in +++ b/hl/fortran/examples/Makefile.in @@ -315,14 +315,24 @@ LIBH5_HL = $(top_builddir)/hl/src/libhdf5_hl.la LIBH5F_HL = $(top_builddir)/hl/fortran/src/libhdf5hl_fortran.la LIBH5CPP_HL = $(top_builddir)/hl/c++/src/libhdf5_hl_cpp.la +# Note that in svn revision 19400 the '/' after DESTDIR in H5* variables below +# has been removed. According to the official description of DESTDIR by Gnu at +# http://www.gnu.org/prep/standards/html_node/DESTDIR.html, DESTDIR is +# prepended to the normal and complete install path that it precedes for the +# purpose of installing in a temporary directory which is useful for building +# rpms and other packages. The '/' after ${DESTDIR} will be followed by another +# '/' at the beginning of the normal install path. When DESTDIR is empty the +# path then begins with '//', which is incorrect and causes problems at least for +# Cygwin. + # Scripts used to build examples # If only shared libraries have been installed, have h5cc build examples with # shared libraries instead of static libraries -H5CC = $(bindir)/h5cc -H5CC_PP = $(bindir)/h5pcc -H5FC = $(bindir)/h5fc -H5FC_PP = $(bindir)/h5pfc -H5CPP = $(bindir)/h5c++ +H5CC = ${DESTDIR}$(bindir)/h5cc +H5CC_PP = ${DESTDIR}$(bindir)/h5pcc +H5FC = ${DESTDIR}$(bindir)/h5fc +H5FC_PP = ${DESTDIR}$(bindir)/h5pfc +H5CPP = ${DESTDIR}$(bindir)/h5c++ ACLOCAL_AMFLAGS = "-I m4" # The trace script; this is used on source files from the C library to @@ -353,7 +363,8 @@ INSTALL_SCRIPT_FILES = run-hlfortran-ex.sh FORTRAN_API = yes # Tell automake how to install examples -EXAMPLEDIR = ${DESTDIR}/$(exec_prefix)/share/hdf5_examples/hl/fortran +# Note: no '/' after DESTDIR. Explanation in commence.am +EXAMPLEDIR = ${DESTDIR}$(exec_prefix)/share/hdf5_examples/hl/fortran # Assume that all tests in this directory are examples, and tell # conclude.am when to build them. @@ -605,7 +616,8 @@ uninstall-local: install-examples: $(EXAMPLEDIR) $(INSTALL_FILES) @for f in X $(INSTALL_FILES); do \ if test $$f != X; then \ - (set -x; $(INSTALL) $(srcdir)/$$f $(EXAMPLEDIR)/. || exit 1);\ + (set -x; $(INSTALL) $(srcdir)/$$f $(EXAMPLEDIR)/. || exit 1); \ + chmod a-x $(EXAMPLEDIR)/$$f; \ fi; \ done @for f in X $(INSTALL_SCRIPT_FILES); do \ diff --git a/hl/fortran/examples/run-hlfortran-ex.sh.in b/hl/fortran/examples/run-hlfortran-ex.sh.in index 644a9b7..364b438 100755 --- a/hl/fortran/examples/run-hlfortran-ex.sh.in +++ b/hl/fortran/examples/run-hlfortran-ex.sh.in @@ -33,7 +33,8 @@ EXIT_SUCCESS=0 EXIT_FAILURE=1 # Where the tool is installed. -prefix="${prefix:-${DESTDIR}/@prefix@}" +# Note: no '/' after DESTDIR. Explanation in commence.am +prefix="${prefix:-${DESTDIR}@prefix@}" PARALLEL=@PARALLEL@ # Am I in parallel mode? AR="@AR@" RANLIB="@RANLIB@" diff --git a/hl/fortran/src/CMakeLists.txt b/hl/fortran/src/CMakeLists.txt index f003c49..421fdff 100644 --- a/hl/fortran/src/CMakeLists.txt +++ b/hl/fortran/src/CMakeLists.txt @@ -52,7 +52,7 @@ H5_SET_LIB_OPTIONS (${HDF5_HL_F90_C_LIB_TARGET} ${HDF5_HL_F90_C_LIB_NAME} ${LIB_ ADD_LIBRARY (${HDF5_HL_F90_LIB_TARGET} ${LIB_TYPE} ${HDF5_HL_F90_F_SRCS}) IF (BUILD_SHARED_LIBS) - IF (WIN32) + IF (WIN32 AND NOT CYGWIN) SET_PROPERTY (TARGET ${HDF5_HL_F90_LIB_TARGET} APPEND PROPERTY COMPILE_DEFINITIONS BUILD_HDF5_DLL @@ -64,14 +64,14 @@ IF (BUILD_SHARED_LIBS) LINK_FLAGS "/SUBSYSTEM:CONSOLE /DLL" ) ENDIF (MSVC) - ENDIF (WIN32) + ENDIF (WIN32 AND NOT CYGWIN) ENDIF (BUILD_SHARED_LIBS) -IF (WIN32) +IF (WIN32 AND NOT CYGWIN) SET_PROPERTY (TARGET ${HDF5_HL_F90_LIB_TARGET} APPEND PROPERTY COMPILE_DEFINITIONS HDF5F90_WINDOWS ) -ENDIF (WIN32) +ENDIF (WIN32 AND NOT CYGWIN) SET_TARGET_PROPERTIES (${HDF5_HL_F90_LIB_TARGET} PROPERTIES LINKER_LANGUAGE Fortran) TARGET_LINK_LIBRARIES (${HDF5_HL_F90_LIB_TARGET} ${HDF5_HL_F90_C_LIB_TARGET} @@ -82,6 +82,19 @@ H5_SET_LIB_OPTIONS (${HDF5_HL_F90_LIB_TARGET} ${HDF5_HL_F90_LIB_NAME} ${LIB_TYPE ADD_DEPENDENCIES (${HDF5_HL_F90_LIB_TARGET} ${HDF5_HL_F90_C_LIB_TARGET}) #----------------------------------------------------------------------------- +# Add file(s) to CMake Install +#----------------------------------------------------------------------------- + +INSTALL ( + DIRECTORY + ${CMAKE_Fortran_MODULE_DIRECTORY}/\${BUILD_TYPE}/ + DESTINATION + ${HDF5_INSTALL_INCLUDE_DIR}/fortran + COMPONENT + fortheaders +) + +#----------------------------------------------------------------------------- # Add Target(s) to CMake Install for import into other projects #----------------------------------------------------------------------------- IF (HDF5_EXPORTED_TARGETS) @@ -91,8 +104,8 @@ IF (HDF5_EXPORTED_TARGETS) ${HDF5_HL_F90_LIB_TARGET} EXPORT ${HDF5_EXPORTED_TARGETS} - LIBRARY DESTINATION lib COMPONENT hlfortlibraries - ARCHIVE DESTINATION lib COMPONENT hlfortlibraries - RUNTIME DESTINATION bin COMPONENT hlfortlibraries + LIBRARY DESTINATION ${HDF5_INSTALL_LIB_DIR} COMPONENT hlfortlibraries + ARCHIVE DESTINATION ${HDF5_INSTALL_LIB_DIR} COMPONENT hlfortlibraries + RUNTIME DESTINATION ${HDF5_INSTALL_BIN_DIR} COMPONENT hlfortlibraries ) ENDIF (HDF5_EXPORTED_TARGETS) diff --git a/hl/fortran/src/Makefile.in b/hl/fortran/src/Makefile.in index 7b072ad..cbcfa47 100644 --- a/hl/fortran/src/Makefile.in +++ b/hl/fortran/src/Makefile.in @@ -369,14 +369,24 @@ LIBH5_HL = $(top_builddir)/hl/src/libhdf5_hl.la LIBH5F_HL = $(top_builddir)/hl/fortran/src/libhdf5hl_fortran.la LIBH5CPP_HL = $(top_builddir)/hl/c++/src/libhdf5_hl_cpp.la +# Note that in svn revision 19400 the '/' after DESTDIR in H5* variables below +# has been removed. According to the official description of DESTDIR by Gnu at +# http://www.gnu.org/prep/standards/html_node/DESTDIR.html, DESTDIR is +# prepended to the normal and complete install path that it precedes for the +# purpose of installing in a temporary directory which is useful for building +# rpms and other packages. The '/' after ${DESTDIR} will be followed by another +# '/' at the beginning of the normal install path. When DESTDIR is empty the +# path then begins with '//', which is incorrect and causes problems at least for +# Cygwin. + # Scripts used to build examples # If only shared libraries have been installed, have h5cc build examples with # shared libraries instead of static libraries -H5CC = $(bindir)/h5cc -H5CC_PP = $(bindir)/h5pcc -H5FC = $(bindir)/h5fc -H5FC_PP = $(bindir)/h5pfc -H5CPP = $(bindir)/h5c++ +H5CC = ${DESTDIR}$(bindir)/h5cc +H5CC_PP = ${DESTDIR}$(bindir)/h5pcc +H5FC = ${DESTDIR}$(bindir)/h5fc +H5FC_PP = ${DESTDIR}$(bindir)/h5pfc +H5CPP = ${DESTDIR}$(bindir)/h5c++ ACLOCAL_AMFLAGS = "-I m4" # The trace script; this is used on source files from the C library to @@ -391,7 +401,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 65 +LT_VERS_REVISION = 66 LT_VERS_AGE = 0 INCLUDES = -I$(top_srcdir)/src -I$(top_srcdir)/hl/src -I$(top_builddir)/hl/src \ -I$(top_srcdir)/fortran/src -I$(top_builddir)/fortran/src diff --git a/hl/fortran/test/CMakeLists.txt b/hl/fortran/test/CMakeLists.txt index b4f4075..2968943 100644 --- a/hl/fortran/test/CMakeLists.txt +++ b/hl/fortran/test/CMakeLists.txt @@ -12,6 +12,20 @@ LINK_DIRECTORIES ( ${CMAKE_LIBRARY_OUTPUT_DIRECTORY} ) +# Remove any output file left over from previous test run +ADD_TEST ( + NAME hl_fortran_test-clear-objects + COMMAND ${CMAKE_COMMAND} + -E remove + dsetf1.h5 + dsetf2.h5 + dsetf3.h5 + dsetf4.h5 + dsetf5.h5 + f1image.h5 + f1tab.h5 +) + #-- Adding test for hl_f90_tstlite ADD_EXECUTABLE (hl_f90_tstlite tstlite.f90) H5_NAMING (hl_f90_tstlite) diff --git a/hl/fortran/test/Makefile.in b/hl/fortran/test/Makefile.in index e4fd58f..f81614b 100644 --- a/hl/fortran/test/Makefile.in +++ b/hl/fortran/test/Makefile.in @@ -343,14 +343,24 @@ LIBH5_HL = $(top_builddir)/hl/src/libhdf5_hl.la LIBH5F_HL = $(top_builddir)/hl/fortran/src/libhdf5hl_fortran.la LIBH5CPP_HL = $(top_builddir)/hl/c++/src/libhdf5_hl_cpp.la +# Note that in svn revision 19400 the '/' after DESTDIR in H5* variables below +# has been removed. According to the official description of DESTDIR by Gnu at +# http://www.gnu.org/prep/standards/html_node/DESTDIR.html, DESTDIR is +# prepended to the normal and complete install path that it precedes for the +# purpose of installing in a temporary directory which is useful for building +# rpms and other packages. The '/' after ${DESTDIR} will be followed by another +# '/' at the beginning of the normal install path. When DESTDIR is empty the +# path then begins with '//', which is incorrect and causes problems at least for +# Cygwin. + # Scripts used to build examples # If only shared libraries have been installed, have h5cc build examples with # shared libraries instead of static libraries -H5CC = $(bindir)/h5cc -H5CC_PP = $(bindir)/h5pcc -H5FC = $(bindir)/h5fc -H5FC_PP = $(bindir)/h5pfc -H5CPP = $(bindir)/h5c++ +H5CC = ${DESTDIR}$(bindir)/h5cc +H5CC_PP = ${DESTDIR}$(bindir)/h5pcc +H5FC = ${DESTDIR}$(bindir)/h5fc +H5FC_PP = ${DESTDIR}$(bindir)/h5pfc +H5CPP = ${DESTDIR}$(bindir)/h5c++ ACLOCAL_AMFLAGS = "-I m4" # The trace script; this is used on source files from the C library to diff --git a/hl/src/CMakeLists.txt b/hl/src/CMakeLists.txt index e34936d..11f6273 100644 --- a/hl/src/CMakeLists.txt +++ b/hl/src/CMakeLists.txt @@ -46,7 +46,7 @@ INSTALL ( FILES ${HL_HEADERS} DESTINATION - include + ${HDF5_INSTALL_INCLUDE_DIR} COMPONENT hlheaders ) @@ -60,8 +60,8 @@ IF (HDF5_EXPORTED_TARGETS) ${HDF5_HL_LIB_TARGET} EXPORT ${HDF5_EXPORTED_TARGETS} - LIBRARY DESTINATION lib COMPONENT hllibraries - ARCHIVE DESTINATION lib COMPONENT hllibraries - RUNTIME DESTINATION bin COMPONENT hllibraries + LIBRARY DESTINATION ${HDF5_INSTALL_LIB_DIR} COMPONENT hllibraries + ARCHIVE DESTINATION ${HDF5_INSTALL_LIB_DIR} COMPONENT hllibraries + RUNTIME DESTINATION ${HDF5_INSTALL_BIN_DIR} COMPONENT hllibraries ) ENDIF (HDF5_EXPORTED_TARGETS) diff --git a/hl/src/Makefile.in b/hl/src/Makefile.in index 772bb95..9c0b74c 100644 --- a/hl/src/Makefile.in +++ b/hl/src/Makefile.in @@ -360,14 +360,24 @@ LIBH5_HL = $(top_builddir)/hl/src/libhdf5_hl.la LIBH5F_HL = $(top_builddir)/hl/fortran/src/libhdf5hl_fortran.la LIBH5CPP_HL = $(top_builddir)/hl/c++/src/libhdf5_hl_cpp.la +# Note that in svn revision 19400 the '/' after DESTDIR in H5* variables below +# has been removed. According to the official description of DESTDIR by Gnu at +# http://www.gnu.org/prep/standards/html_node/DESTDIR.html, DESTDIR is +# prepended to the normal and complete install path that it precedes for the +# purpose of installing in a temporary directory which is useful for building +# rpms and other packages. The '/' after ${DESTDIR} will be followed by another +# '/' at the beginning of the normal install path. When DESTDIR is empty the +# path then begins with '//', which is incorrect and causes problems at least for +# Cygwin. + # Scripts used to build examples # If only shared libraries have been installed, have h5cc build examples with # shared libraries instead of static libraries -H5CC = $(bindir)/h5cc -H5CC_PP = $(bindir)/h5pcc -H5FC = $(bindir)/h5fc -H5FC_PP = $(bindir)/h5pfc -H5CPP = $(bindir)/h5c++ +H5CC = ${DESTDIR}$(bindir)/h5cc +H5CC_PP = ${DESTDIR}$(bindir)/h5pcc +H5FC = ${DESTDIR}$(bindir)/h5fc +H5FC_PP = ${DESTDIR}$(bindir)/h5pfc +H5CPP = ${DESTDIR}$(bindir)/h5c++ ACLOCAL_AMFLAGS = "-I m4" # The trace script; this is used on source files from the C library to @@ -382,7 +392,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 65 +LT_VERS_REVISION = 66 LT_VERS_AGE = 0 # This library is our main target. diff --git a/hl/test/CMakeLists.txt b/hl/test/CMakeLists.txt index 182fd14..22568ae 100644 --- a/hl/test/CMakeLists.txt +++ b/hl/test/CMakeLists.txt @@ -48,6 +48,33 @@ MACRO (HL_ADD_TEST hl_name files) ENDFOREACH (h5_file ${HL_REFERENCE_TEST_FILES}) ENDMACRO (HL_ADD_TEST) +# Remove any output file left over from previous test run +ADD_TEST ( + NAME hl_test-clear-objects + COMMAND ${CMAKE_COMMAND} + -E remove + combine_tables1.h5 + combine_tables2.h5 + test_detach.h5 + test_ds1.h5 + test_ds2.h5 + test_ds3.h5 + test_ds4.h5 + test_ds5.h5 + test_ds6.h5 + test_ds7.h5 + test_ds8.h5 + test_ds9.h5 + test_image1.h5 + test_image2.h5 + test_image3.h5 + test_lite1.h5 + test_lite2.h5 + test_packet_compress.h5 + test_packet_table.h5 + test_table.h5 +) + HL_ADD_TEST (test_ds "dsdata.txt;dslat.txt;dslon.txt;test_ds_be.h5;test_ds_le.h5") HL_ADD_TEST (test_image "image8.txt;sepia.pal;earth.pal;image24pixel.txt;image24plane.txt;usa.wri") HL_ADD_TEST (test_lite "dtype_file.txt") diff --git a/hl/test/Makefile.in b/hl/test/Makefile.in index a962e93..831048c 100644 --- a/hl/test/Makefile.in +++ b/hl/test/Makefile.in @@ -364,14 +364,24 @@ LIBH5_HL = $(top_builddir)/hl/src/libhdf5_hl.la LIBH5F_HL = $(top_builddir)/hl/fortran/src/libhdf5hl_fortran.la LIBH5CPP_HL = $(top_builddir)/hl/c++/src/libhdf5_hl_cpp.la +# Note that in svn revision 19400 the '/' after DESTDIR in H5* variables below +# has been removed. According to the official description of DESTDIR by Gnu at +# http://www.gnu.org/prep/standards/html_node/DESTDIR.html, DESTDIR is +# prepended to the normal and complete install path that it precedes for the +# purpose of installing in a temporary directory which is useful for building +# rpms and other packages. The '/' after ${DESTDIR} will be followed by another +# '/' at the beginning of the normal install path. When DESTDIR is empty the +# path then begins with '//', which is incorrect and causes problems at least for +# Cygwin. + # Scripts used to build examples # If only shared libraries have been installed, have h5cc build examples with # shared libraries instead of static libraries -H5CC = $(bindir)/h5cc -H5CC_PP = $(bindir)/h5pcc -H5FC = $(bindir)/h5fc -H5FC_PP = $(bindir)/h5pfc -H5CPP = $(bindir)/h5c++ +H5CC = ${DESTDIR}$(bindir)/h5cc +H5CC_PP = ${DESTDIR}$(bindir)/h5pcc +H5FC = ${DESTDIR}$(bindir)/h5fc +H5FC_PP = ${DESTDIR}$(bindir)/h5pfc +H5CPP = ${DESTDIR}$(bindir)/h5c++ ACLOCAL_AMFLAGS = "-I m4" # The trace script; this is used on source files from the C library to diff --git a/hl/tools/CMakeLists.txt b/hl/tools/CMakeLists.txt index 388b1da..8ed3fab 100644 --- a/hl/tools/CMakeLists.txt +++ b/hl/tools/CMakeLists.txt @@ -54,7 +54,7 @@ INSTALL ( gif2h5 hdf2gif RUNTIME DESTINATION - bin/tools + ${HDF5_INSTALL_BIN_DIR}/tools COMPONENT hltoolsapplications ) diff --git a/hl/tools/Makefile.in b/hl/tools/Makefile.in index cd6b1a9..d0fa11a 100644 --- a/hl/tools/Makefile.in +++ b/hl/tools/Makefile.in @@ -349,14 +349,24 @@ LIBH5_HL = $(top_builddir)/hl/src/libhdf5_hl.la LIBH5F_HL = $(top_builddir)/hl/fortran/src/libhdf5hl_fortran.la LIBH5CPP_HL = $(top_builddir)/hl/c++/src/libhdf5_hl_cpp.la +# Note that in svn revision 19400 the '/' after DESTDIR in H5* variables below +# has been removed. According to the official description of DESTDIR by Gnu at +# http://www.gnu.org/prep/standards/html_node/DESTDIR.html, DESTDIR is +# prepended to the normal and complete install path that it precedes for the +# purpose of installing in a temporary directory which is useful for building +# rpms and other packages. The '/' after ${DESTDIR} will be followed by another +# '/' at the beginning of the normal install path. When DESTDIR is empty the +# path then begins with '//', which is incorrect and causes problems at least for +# Cygwin. + # Scripts used to build examples # If only shared libraries have been installed, have h5cc build examples with # shared libraries instead of static libraries -H5CC = $(bindir)/h5cc -H5CC_PP = $(bindir)/h5pcc -H5FC = $(bindir)/h5fc -H5FC_PP = $(bindir)/h5pfc -H5CPP = $(bindir)/h5c++ +H5CC = ${DESTDIR}$(bindir)/h5cc +H5CC_PP = ${DESTDIR}$(bindir)/h5pcc +H5FC = ${DESTDIR}$(bindir)/h5fc +H5FC_PP = ${DESTDIR}$(bindir)/h5pfc +H5CPP = ${DESTDIR}$(bindir)/h5c++ ACLOCAL_AMFLAGS = "-I m4" # The trace script; this is used on source files from the C library to diff --git a/hl/tools/gif2h5/Makefile.in b/hl/tools/gif2h5/Makefile.in index c19c772..eae6de5 100644 --- a/hl/tools/gif2h5/Makefile.in +++ b/hl/tools/gif2h5/Makefile.in @@ -349,14 +349,24 @@ LIBH5_HL = $(top_builddir)/hl/src/libhdf5_hl.la LIBH5F_HL = $(top_builddir)/hl/fortran/src/libhdf5hl_fortran.la LIBH5CPP_HL = $(top_builddir)/hl/c++/src/libhdf5_hl_cpp.la +# Note that in svn revision 19400 the '/' after DESTDIR in H5* variables below +# has been removed. According to the official description of DESTDIR by Gnu at +# http://www.gnu.org/prep/standards/html_node/DESTDIR.html, DESTDIR is +# prepended to the normal and complete install path that it precedes for the +# purpose of installing in a temporary directory which is useful for building +# rpms and other packages. The '/' after ${DESTDIR} will be followed by another +# '/' at the beginning of the normal install path. When DESTDIR is empty the +# path then begins with '//', which is incorrect and causes problems at least for +# Cygwin. + # Scripts used to build examples # If only shared libraries have been installed, have h5cc build examples with # shared libraries instead of static libraries -H5CC = $(bindir)/h5cc -H5CC_PP = $(bindir)/h5pcc -H5FC = $(bindir)/h5fc -H5FC_PP = $(bindir)/h5pfc -H5CPP = $(bindir)/h5c++ +H5CC = ${DESTDIR}$(bindir)/h5cc +H5CC_PP = ${DESTDIR}$(bindir)/h5pcc +H5FC = ${DESTDIR}$(bindir)/h5fc +H5FC_PP = ${DESTDIR}$(bindir)/h5pfc +H5CPP = ${DESTDIR}$(bindir)/h5c++ ACLOCAL_AMFLAGS = "-I m4" # The trace script; this is used on source files from the C library to diff --git a/perform/CMakeLists.txt b/perform/CMakeLists.txt index 2c0c517..56868d6 100644 --- a/perform/CMakeLists.txt +++ b/perform/CMakeLists.txt @@ -11,6 +11,21 @@ INCLUDE_DIRECTORIES (${HDF5_TOOLS_SRC_DIR}/lib ) # Add Tests #----------------------------------------------------------------------------- +# Remove any output file left over from previous test run +ADD_TEST ( + NAME h5perform-clear-objects + COMMAND ${CMAKE_COMMAND} + -E remove + chunk.h5 + iopipe.h5 + iopipe.raw + x-diag-rd.dat + x-diag-wr.dat + x-rowmaj-rd.dat + x-rowmaj-wr.dat + x-gnuplot +) + #-- Adding test for h5perf_serial SET (h5perf_serial_SRCS ${HDF5_PERFORM_SOURCE_DIR}/sio_timer.c diff --git a/perform/Makefile.in b/perform/Makefile.in index c074f98..e2e05b8 100644 --- a/perform/Makefile.in +++ b/perform/Makefile.in @@ -385,14 +385,24 @@ LIBH5_HL = $(top_builddir)/hl/src/libhdf5_hl.la LIBH5F_HL = $(top_builddir)/hl/fortran/src/libhdf5hl_fortran.la LIBH5CPP_HL = $(top_builddir)/hl/c++/src/libhdf5_hl_cpp.la +# Note that in svn revision 19400 the '/' after DESTDIR in H5* variables below +# has been removed. According to the official description of DESTDIR by Gnu at +# http://www.gnu.org/prep/standards/html_node/DESTDIR.html, DESTDIR is +# prepended to the normal and complete install path that it precedes for the +# purpose of installing in a temporary directory which is useful for building +# rpms and other packages. The '/' after ${DESTDIR} will be followed by another +# '/' at the beginning of the normal install path. When DESTDIR is empty the +# path then begins with '//', which is incorrect and causes problems at least for +# Cygwin. + # Scripts used to build examples # If only shared libraries have been installed, have h5cc build examples with # shared libraries instead of static libraries -H5CC = $(bindir)/h5cc -H5CC_PP = $(bindir)/h5pcc -H5FC = $(bindir)/h5fc -H5FC_PP = $(bindir)/h5pfc -H5CPP = $(bindir)/h5c++ +H5CC = ${DESTDIR}$(bindir)/h5cc +H5CC_PP = ${DESTDIR}$(bindir)/h5pcc +H5FC = ${DESTDIR}$(bindir)/h5fc +H5FC_PP = ${DESTDIR}$(bindir)/h5pfc +H5CPP = ${DESTDIR}$(bindir)/h5c++ ACLOCAL_AMFLAGS = "-I m4" # The trace script; this is used on source files from the C library to diff --git a/release_docs/CMake.txt b/release_docs/CMake.txt index 0e2f707..e9c764e 100755 --- a/release_docs/CMake.txt +++ b/release_docs/CMake.txt @@ -14,10 +14,15 @@ Notes: This short instruction is written for users who want to quickly build all the operating systems supported by CMake. NOTES: - 1. CMake is being introduced in this release as early-access. While - we have attempted to provide error-free files, please understand - that this development with CMake has just began. The CMake - specific files may change before the next release. + 1. CMake use is still experimental. While we have attempted to + provide error-free files, please understand that development + with CMake has just began. The CMake specific files may change + before the next release. + + 2. CMake has been introduced to support development on Windows, however + it should be usuable on any system where CMake is supported. Please + send us any comments on how CMake support can be improved on any + system. ======================================================================== @@ -25,7 +30,7 @@ Notes: This short instruction is written for users who want to quickly build ======================================================================== 1. We suggest you obtain the latest CMake for windows from the Kitware - web site. The HDF5 1.8.x product requires CMake version 2.8.1. + web site. The HDF5 1.8.x product requires CMake version 2.8.2. 2. If you plan to use Zlib or Szip, download the packages and install them in a central location. For example on Windows, create a folder extlibs @@ -46,26 +51,84 @@ Notes: This short instruction is written for users who want to quickly build choose a build directory different then the source directory (for example on Windows, if the source is at c:\MyHDFstuff\hdf5, then use c:\MyHDFstuff\hdf5\build or c:\MyHDFstuff\build\hdf5). + + OPTIONAL: + Users can perform the configuration step without using the visual cmake-gui + program. We use the file cacheinit.cmake in the config/cmake folder for + our testing. This file enables all the basic options and we turn specific + options on or off for testing using the following command line within the build + directory: + + cmake -C /config/cmake/cacheinit.cmake -G "" [-D] + + Where is + * Borland Makefiles + * MSYS Makefiles + * MinGW Makefiles + * NMake Makefiles + * Unix Makefiles + * Visual Studio 10 + * Visual Studio 10 Win64 + * Visual Studio 6 + * Visual Studio 7 + * Visual Studio 7 .NET 2003 + * Visual Studio 8 2005 + * Visual Studio 8 2005 Win64 + * Visual Studio 9 2008 + * Visual Studio 9 2008 Win64 + + is: + * SZIP_INCLUDE_DIR:PATH= + * SZIP_LIBRARY:FILEPATH= + * ZLIB_INCLUDE_DIR:PATH= + * ZLIB_LIBRARY:FILEPATH= + * :BOOL=[ON | OFF] + + is: + # This is the CMakeCache file. + ######################## + # EXTERNAL cache entries + ######################## + SET (BUILD_SHARED_LIBS ON CACHE BOOL "Build Shared Libraries" FORCE) + SET (BUILD_TESTING ON CACHE BOOL "Build HDF5 Unit Testing" FORCE) + SET (HDF5_BUILD_CPP_LIB ON CACHE BOOL "Build HDF5 C++ Library" FORCE) + SET (HDF5_BUILD_EXAMPLES ON CACHE BOOL "Build HDF5 Library Examples" FORCE) + SET (HDF5_BUILD_FORTRAN ON CACHE BOOL "Build FORTRAN support" FORCE) + SET (HDF5_BUILD_HL_LIB ON CACHE BOOL "Build HIGH Level HDF5 Library" FORCE) + SET (HDF5_BUILD_TOOLS ON CACHE BOOL "Build HDF5 Tools" FORCE) + SET (HDF5_DISABLE_COMPILER_WARNINGS OFF CACHE BOOL "Disable compiler warnings" FORCE) + SET (HDF5_ENABLE_HSIZET ON CACHE BOOL "Enable datasets larger than memory" FORCE) + SET (HDF5_ENABLE_PARALLEL OFF CACHE BOOL "Enable parallel build (requires MPI)" FORCE) + SET (HDF5_ENABLE_SZIP_ENCODING ON CACHE BOOL "Use SZip Encoding" FORCE) + SET (HDF5_ENABLE_SZIP_SUPPORT ON CACHE BOOL "Use SZip Filter" FORCE) + SET (HDF5_ENABLE_Z_LIB_SUPPORT ON CACHE BOOL "Enable Zlib Filters" FORCE) + SET (HDF5_USE_H5DUMP_PACKED_BITS ON CACHE BOOL "Use the PACKED BITS feature in h5dump" FORCE) + SET (HDF5_ENABLE_COVERAGE OFF CACHE BOOL "Enable code coverage for Libraries and Programs" FORCE) 2. Configure the cache settings - Click the Configure button. If this is the first time you are - running cmake-gui in this directory, you will be prompted for the - generator you wish to use (for example on Windows, Visual Studio 9 2008). - CMake will read in the CMakeLists.txt files from the source directory and - display options for the HDF5 project. After the first configure you - can adjust the cache settings and/or specify locations of other programs. + 2.1 Click the Configure button. If this is the first time you are + running cmake-gui in this directory, you will be prompted for the + generator you wish to use (for example on Windows, Visual Studio 9 2008). + CMake will read in the CMakeLists.txt files from the source directory and + display options for the HDF5 project. After the first configure you + can adjust the cache settings and/or specify locations of other programs. - Any conflicts or new values will be highlighted by the configure - process in red. Once you are happy with all the settings and there are no - more values in red, click the Generate button to produce the appropriate - build files. + Any conflicts or new values will be highlighted by the configure + process in red. Once you are happy with all the settings and there are no + more values in red, click the Generate button to produce the appropriate + build files. - On Windows, if you are using a Visual Studio generator, the solution and - project files will be created in the build folder. + On Windows, if you are using a Visual Studio generator, the solution and + project files will be created in the build folder. - On linux, if you are using the Unix Makefiles generator, the Makefiles will - be created in the build folder. + On linux, if you are using the Unix Makefiles generator, the Makefiles will + be created in the build folder. + + 2.2 Alternative command line example on Windows in c:\MyHDFstuff\hdf5\build directory: + + cmake -C ../config/cmake/cacheinit.cmake -G "Visual Studio 9 2008" \ + -DHDF5_ENABLE_SZIP_SUPPORT:BOOL=OFF -DHDF5_ENABLE_Z_LIB_SUPPORT:BOOL=OFF .. 3. Build HDF5 @@ -94,12 +157,24 @@ Notes: This short instruction is written for users who want to quickly build NOTE: "-C {Debug | Release}" may be optional on your platform. We recommend choosing either Debug or Release to match the build step on Windows. - + + 5. Packaging HDF5 + + To package the build into a simple installer using the NullSoft installer NSIS + on Windows, or into compressed files (.tar.gz, .sh, .zip), use the CPack tool. + + To pacakage the build, navigate to your build directory and execute; + + cpack -C {Debug | Release} CPackConfig.cmake + + NOTE: We have just introduced the packaging capability and it has not been + extensively tested. Please send us comments on how it can be improved. + 5. The files that support building HDF5 with CMake are all the files in the - config/cmake folder, the CMakeLists.txt files in each source folder, and two - additional files, ConfigureChecks.cmake and CTestConfig.cmake. The - CTestConfig.cmake is specific to the internal testing performed by The HDF - Group. It should be altered for the users installation and needs. + config/cmake folder, the CMakeLists.txt files in each source folder, and + CTestConfig.cmake. CTestConfig.cmake is specific to the internal testing + performed by The HDF Group. It should be altered for the users + installation and needs. 6. More information about using CMake can be found at the KitWare site, www.cmake.org. diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index f3b9898..1c65a15 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -1,4 +1,4 @@ -HDF5 version 1.9.75-FA_a5 currently under development +HDF5 version 1.9.76-FA_a5 currently under development ================================================================================ @@ -248,6 +248,9 @@ Bug Fixes since HDF5-1.8.0 release Library ------- + - Modified library to always cache symbol table information. Libraries + version 1.6.3 have a bug which causes them to require this + information for some operations. (NAF - 2010/09/21 - 1864) - Fixed a bug that could occur when getting information for a new-style group that was previously opened through a file handle that was later closed. (NAF - 2010/09/15) @@ -637,15 +640,22 @@ Platforms Tested Intel(R) C++ Version 8.1 Intel(R) Fortran Compiler Version 8.1 mpich-gm-1.2.5..10-intel-r2 + + Windows XP Visual Studio 2008 w/ Intel Fortran 11.1 + Visual Studio 2010 + Cygwin(1.7.7 native gcc(4.3.4) compiler and gfortran) - Windows XP Visual Studio 2008 w/ Intel Fortran 10.1 - Cygwin(1.7.5 native gcc compiler and gfortran) + Windows XP x64 Visual Studio 2008 w/ Intel Fortran 11.1 + Visual Studio 2010 + Cygwin(1.7.7 native gcc(4.3.4) compiler and gfortran) + + Windows Vista Visual Studio 2008 w/ Intel Fortran 11.1 - Windows XP x64 Visual Studio 2008 w/ Intel Fortran 10.1 + Windows Vista x64 Visual Studio 2008 w/ Intel Fortran 11.1 - Windows Vista Visual Studio 2008 w/ Intel Fortran 10.1 + Windows 7 Visual Studio 2010 - Windows Vista x64 Visual Studio 2008 w/ Intel Fortran 10.1 + Windows 7 x64 Visual Studio 2010 MAC OS 10.5 (Intel) gcc i686-apple-darwin8-gcc-4.0.1 (GCC) 4.0.1 G95 (GCC 4.0.3 (g95 0.91!) Nov 21 2006) @@ -705,8 +715,8 @@ Cray XT3 (not tested for this release) n n n x n Windows XP y y(3) y y n Windows XP x64 y y(3) y y n -Windows Vista y y(3) y y n -Windows Vista x64 y y(3) y y n +Windows Vista y y(3) y y y +Windows Vista x64 y y(3) y y y Mac OS X 10.5 Intel y y y x n FreeBSD 6.2 32-bit y y y x n FreeBSD 6.2 64-bit y y y x n diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index b66c872..92469a3 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -561,10 +561,10 @@ SET (H5_PUBLIC_HEADERS # -------------------------------------------------------------------- # If we are compiling on Windows then add the windows specific files # -------------------------------------------------------------------- -IF (WIN32) +IF (WIN32 AND NOT CYGWIN) SET (common_SRCS ${common_SRCS} ${HDF5_SRC_DIR}/H5FDwindows.c) SET (H5_PUBLIC_HEADERS ${H5_PUBLIC_HEADERS} ${HDF5_SRC_DIR}/H5FDwindows.h) -ENDIF (WIN32) +ENDIF (WIN32 AND NOT CYGWIN) SET (H5_PRIVATE_HEADERS ${HDF5_SRC_DIR}/H5private.h diff --git a/src/H5Aint.c b/src/H5Aint.c index 30d662e..3ffc6d3 100644 --- a/src/H5Aint.c +++ b/src/H5Aint.c @@ -872,7 +872,8 @@ H5A_attr_copy_file(const H5A_t *attr_src, H5F_t *file_dst, hbool_t *recompute_si dst_oloc->file = file_dst; /* Copy the shared object from source to destination */ - if(H5O_copy_header_map(src_oloc, dst_oloc, dxpl_id, cpy_info, FALSE) < 0) + if(H5O_copy_header_map(src_oloc, dst_oloc, dxpl_id, cpy_info, FALSE, + NULL, NULL) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, NULL, "unable to copy object") /* Update shared message info from named datatype info */ diff --git a/src/H5C.c b/src/H5C.c index de45d20..5b7984b 100644 --- a/src/H5C.c +++ b/src/H5C.c @@ -8713,7 +8713,7 @@ H5C_make_space_in_cache(H5F_t * f, #endif /* H5C_COLLECT_CACHE_STATS */ HDassert( ( entries_examined > (2 * initial_list_len) ) || - ( (cache_ptr->pl_size + cache_ptr->min_clean_size) > + ( (cache_ptr->pl_size + cache_ptr->pel_size + cache_ptr->min_clean_size) > cache_ptr->max_cache_size ) || ( ( cache_ptr->clean_index_size + empty_space ) >= cache_ptr->min_clean_size ) ); diff --git a/src/H5Dchunk.c b/src/H5Dchunk.c index 02de7ed..b14d28d 100644 --- a/src/H5Dchunk.c +++ b/src/H5Dchunk.c @@ -163,6 +163,13 @@ typedef struct H5D_chunk_it_ud4_t { unsigned ndims; /* Number of dimensions for chunk/dataset */ } H5D_chunk_it_ud4_t; +/* Callback info for nonexistent readvv operation */ +typedef struct H5D_chunk_readvv_ud_t { + unsigned char *rbuf; /* Read buffer to initialize */ + H5D_t *dset; /* Dataset to operate on */ + hid_t dxpl_id; /* DXPL for operation */ +} H5D_chunk_readvv_ud_t; + /********************/ /* Local Prototypes */ @@ -5635,6 +5642,55 @@ done: /*------------------------------------------------------------------------- + * Function: H5D_nonexistent_readvv_cb + * + * Purpose: Callback operation for performing fill value I/O operation + * on memory buffer. + * + * Note: This algorithm is pretty inefficient about initializing and + * terminating the fill buffer info structure and it would be + * faster to refactor this into a "real" initialization routine, + * and a "vectorized fill" routine. -QAK + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Quincey Koziol + * 30 Sep 2010 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5D_nonexistent_readvv_cb(hsize_t UNUSED dst_off, hsize_t src_off, size_t len, + void *_udata) +{ + H5D_chunk_readvv_ud_t *udata = (H5D_chunk_readvv_ud_t *)_udata; /* User data for H5V_opvv() operator */ + H5D_fill_buf_info_t fb_info; /* Dataset's fill buffer info */ + hbool_t fb_info_init = FALSE; /* Whether the fill value buffer has been initialized */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI_NOINIT(H5D_nonexistent_readvv_cb) + + /* Initialize the fill value buffer */ + if(H5D_fill_init(&fb_info, (udata->rbuf + src_off), NULL, NULL, NULL, NULL, + &udata->dset->shared->dcpl_cache.fill, udata->dset->shared->type, + udata->dset->shared->type_id, (size_t)0, len, udata->dxpl_id) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't initialize fill buffer info") + fb_info_init = TRUE; + + /* Check for VL datatype & fill the buffer with VL datatype fill values */ + if(fb_info.has_vlen_fill_type && H5D_fill_refill_vl(&fb_info, fb_info.elmts_per_buf, udata->dxpl_id) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTCONVERT, FAIL, "can't refill fill value buffer") + +done: + /* Release the fill buffer info, if it's been initialized */ + if(fb_info_init && H5D_fill_term(&fb_info) < 0) + HDONE_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "Can't release fill buffer info") + + FUNC_LEAVE_NOAPI(ret_value) +} /* H5D_nonexistent_readvv_cb() */ + + +/*------------------------------------------------------------------------- * Function: H5D_nonexistent_readvv * * Purpose: When the chunk doesn't exist on disk and the chunk is bigger @@ -5656,82 +5712,35 @@ done: */ static ssize_t H5D_nonexistent_readvv(const H5D_io_info_t *io_info, - size_t chunk_max_nseq, size_t *chunk_curr_seq, size_t chunk_len_arr[], hsize_t chunk_offset_arr[], - size_t mem_max_nseq, size_t *mem_curr_seq, size_t mem_len_arr[], hsize_t mem_offset_arr[]) + size_t chunk_max_nseq, size_t *chunk_curr_seq, size_t chunk_len_arr[], hsize_t chunk_off_arr[], + size_t mem_max_nseq, size_t *mem_curr_seq, size_t mem_len_arr[], hsize_t mem_off_arr[]) { - H5D_t *dset = io_info->dset; /* Local pointer to the dataset info */ - H5D_fill_buf_info_t fb_info; /* Dataset's fill buffer info */ - hbool_t fb_info_init = FALSE; /* Whether the fill value buffer has been initialized */ - ssize_t bytes_processed = 0; /* Eventual return value */ - size_t u, v; /* Local index variables */ - ssize_t ret_value; /* Return value */ + H5D_chunk_readvv_ud_t udata; /* User data for H5V_opvv() operator */ + ssize_t ret_value; /* Return value */ FUNC_ENTER_NOAPI_NOINIT(H5D_nonexistent_readvv) /* Check args */ + HDassert(io_info); + HDassert(chunk_curr_seq); HDassert(chunk_len_arr); - HDassert(chunk_offset_arr); + HDassert(chunk_off_arr); + HDassert(mem_curr_seq); HDassert(mem_len_arr); - HDassert(mem_offset_arr); - - /* Work through all the sequences */ - for(u = *mem_curr_seq, v = *chunk_curr_seq; u < mem_max_nseq && v < chunk_max_nseq; ) { - unsigned char *buf; /* Temporary pointer into read buffer */ - size_t size; /* Size of sequence in bytes */ + HDassert(mem_off_arr); - /* Choose smallest buffer to write */ - if(chunk_len_arr[v] < mem_len_arr[u]) - size = chunk_len_arr[v]; - else - size = mem_len_arr[u]; - - /* Compute offset in memory */ - buf = (unsigned char *)io_info->u.rbuf + mem_offset_arr[u]; - - /* Initialize the fill value buffer */ - if(H5D_fill_init(&fb_info, buf, NULL, NULL, NULL, NULL, - &dset->shared->dcpl_cache.fill, dset->shared->type, - dset->shared->type_id, (size_t)0, size, io_info->dxpl_id) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't initialize fill buffer info") - fb_info_init = TRUE; - - /* Check for VL datatype & fill the buffer with VL datatype fill values */ - if(fb_info.has_vlen_fill_type && H5D_fill_refill_vl(&fb_info, fb_info.elmts_per_buf, io_info->dxpl_id) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTCONVERT, FAIL, "can't refill fill value buffer") - - /* Release the fill buffer info */ - if(H5D_fill_term(&fb_info) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "Can't release fill buffer info") - fb_info_init = FALSE; - - /* Update source information */ - chunk_len_arr[v] -= size; - chunk_offset_arr[v] += size; - if(chunk_len_arr[v] == 0) - v++; - - /* Update destination information */ - mem_len_arr[u] -= size; - mem_offset_arr[u] += size; - if(mem_len_arr[u] == 0) - u++; - - /* Increment number of bytes copied */ - bytes_processed += (ssize_t)size; - } /* end for */ + /* Set up user data for H5V_opvv() */ + udata.rbuf = (unsigned char *)io_info->u.rbuf; + udata.dset = io_info->dset; + udata.dxpl_id = io_info->dxpl_id; - /* Update current sequence vectors */ - *mem_curr_seq = u; - *chunk_curr_seq = v; - - /* Set return value */ - ret_value = bytes_processed; + /* Call generic sequence operation routine */ + if((ret_value = H5V_opvv(chunk_max_nseq, chunk_curr_seq, chunk_len_arr, chunk_off_arr, + mem_max_nseq, mem_curr_seq, mem_len_arr, mem_off_arr, + H5D_nonexistent_readvv_cb, &udata)) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTOPERATE, FAIL, "can't perform vectorized fill value init") done: - /* Release the fill buffer info, if it's been initialized */ - if(fb_info_init && H5D_fill_term(&fb_info) < 0) - HDONE_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "Can't release fill buffer info") - FUNC_LEAVE_NOAPI(ret_value) } /* H5D_nonexistent_readvv() */ diff --git a/src/H5Dcontig.c b/src/H5Dcontig.c index dcc7cdc..9b4f338 100644 --- a/src/H5Dcontig.c +++ b/src/H5Dcontig.c @@ -55,6 +55,40 @@ /* Local Typedefs */ /******************/ +/* Callback info for sieve buffer readvv operation */ +typedef struct H5D_contig_readvv_sieve_ud_t { + H5F_t *file; /* File for dataset */ + H5D_rdcdc_t *dset_contig; /* Cached information about contiguous data */ + const H5D_contig_storage_t *store_contig; /* Contiguous storage info for this I/O operation */ + unsigned char *rbuf; /* Pointer to buffer to fill */ + hid_t dxpl_id; /* DXPL for operation */ +} H5D_contig_readvv_sieve_ud_t; + +/* Callback info for [plain] readvv operation */ +typedef struct H5D_contig_readvv_ud_t { + H5F_t *file; /* File for dataset */ + haddr_t dset_addr; /* Address of dataset */ + unsigned char *rbuf; /* Pointer to buffer to fill */ + hid_t dxpl_id; /* DXPL for operation */ +} H5D_contig_readvv_ud_t; + +/* Callback info for sieve buffer writevv operation */ +typedef struct H5D_contig_writevv_sieve_ud_t { + H5F_t *file; /* File for dataset */ + H5D_rdcdc_t *dset_contig; /* Cached information about contiguous data */ + const H5D_contig_storage_t *store_contig; /* Contiguous storage info for this I/O operation */ + const unsigned char *wbuf; /* Pointer to buffer to write */ + hid_t dxpl_id; /* DXPL for operation */ +} H5D_contig_writevv_sieve_ud_t; + +/* Callback info for [plain] writevv operation */ +typedef struct H5D_contig_writevv_ud_t { + H5F_t *file; /* File for dataset */ + haddr_t dset_addr; /* Address of dataset */ + const unsigned char *wbuf; /* Pointer to buffer to write */ + hid_t dxpl_id; /* DXPL for operation */ +} H5D_contig_writevv_ud_t; + /********************/ /* Local Prototypes */ @@ -65,6 +99,12 @@ static herr_t H5D_contig_construct(H5F_t *f, H5D_t *dset); static herr_t H5D_contig_io_init(const H5D_io_info_t *io_info, const H5D_type_info_t *type_info, hsize_t nelmts, const H5S_t *file_space, const H5S_t *mem_space, H5D_chunk_map_t *cm); +static ssize_t H5D_contig_readvv(const H5D_io_info_t *io_info, + size_t dset_max_nseq, size_t *dset_curr_seq, size_t dset_len_arr[], hsize_t dset_offset_arr[], + size_t mem_max_nseq, size_t *mem_curr_seq, size_t mem_len_arr[], hsize_t mem_offset_arr[]); +static ssize_t H5D_contig_writevv(const H5D_io_info_t *io_info, + size_t dset_max_nseq, size_t *dset_curr_seq, size_t dset_len_arr[], hsize_t dset_offset_arr[], + size_t mem_max_nseq, size_t *mem_curr_seq, size_t mem_len_arr[], hsize_t mem_offset_arr[]); static herr_t H5D_contig_flush(H5D_t *dset, hid_t dxpl_id); /* Helper routines */ @@ -600,573 +640,590 @@ done: /*------------------------------------------------------------------------- - * Function: H5D_contig_readvv + * Function: H5D_contig_readvv_sieve_cb * - * Purpose: Reads some data vectors from a dataset into a buffer. - * The data is contiguous. The address is the start of the dataset, - * relative to the base address for the file and the offsets and - * sequence lengths are in bytes. + * Purpose: Callback operator for H5D_contig_readvv() with sieve buffer. * * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * Friday, May 3, 2001 - * - * Notes: - * Offsets in the sequences must be monotonically increasing + * Thursday, Sept 30, 2010 * *------------------------------------------------------------------------- */ -ssize_t -H5D_contig_readvv(const H5D_io_info_t *io_info, - size_t dset_max_nseq, size_t *dset_curr_seq, size_t dset_len_arr[], hsize_t dset_offset_arr[], - size_t mem_max_nseq, size_t *mem_curr_seq, size_t mem_len_arr[], hsize_t mem_offset_arr[]) +static herr_t +H5D_contig_readvv_sieve_cb(hsize_t dst_off, hsize_t src_off, size_t len, + void *_udata) { - H5F_t *file = io_info->dset->oloc.file; /* File for dataset */ - H5D_rdcdc_t *dset_contig = &(io_info->dset->shared->cache.contig); /* Cached information about contiguous data */ - const H5D_contig_storage_t *store_contig = &(io_info->store->contig); /* Contiguous storage info for this I/O operation */ - unsigned char *buf = (unsigned char *)io_info->u.rbuf; /* Pointer to buffer to fill */ + H5D_contig_readvv_sieve_ud_t *udata = (H5D_contig_readvv_sieve_ud_t *)_udata; /* User data for H5V_opvv() operator */ + H5F_t *file = udata->file; /* File for dataset */ + H5D_rdcdc_t *dset_contig = udata->dset_contig; /* Cached information about contiguous data */ + const H5D_contig_storage_t *store_contig = udata->store_contig; /* Contiguous storage info for this I/O operation */ + unsigned char *buf; /* Pointer to buffer to fill */ haddr_t addr; /* Actual address to read */ - size_t total_size = 0; /* Total size of sequence in bytes */ - size_t size; /* Size of sequence in bytes */ - size_t u; /* Counting variable */ - size_t v; /* Counting variable */ - ssize_t ret_value; /* Return value */ + haddr_t sieve_start = HADDR_UNDEF, sieve_end = HADDR_UNDEF; /* Start & end locations of sieve buffer */ + haddr_t contig_end; /* End locations of block to write */ + size_t sieve_size = (size_t)-1; /* Size of sieve buffer */ + haddr_t rel_eoa; /* Relative end of file address */ + hsize_t max_data; /* Actual maximum size of data to cache */ + herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5D_contig_readvv, FAIL) -#ifdef QAK -HDfprintf(stderr, "%s: dset_max_nseq = %Zu\n", FUNC, dset_max_nseq); -HDfprintf(stderr, "%s: mem_max_nseq = %Zu\n", FUNC, mem_max_nseq); -HDfprintf(stderr, "%s: *dset_curr_seq= %Zu\n", FUNC, *dset_curr_seq); -HDfprintf(stderr, "%s: *mem_curr_seq= %Zu\n", FUNC, *mem_curr_seq); -for(u = 0; u < dset_max_nseq; u++) - HDfprintf(stderr, "%s: dset_len_arr[%Zu] = %Zu, dset_offset_arr[%Zu] = %Hu\n", FUNC, u, dset_len_arr[u], u, dset_offset_arr[u]); -for(u = 0; u < mem_max_nseq; u++) - HDfprintf(stderr, "%s: mem_len_arr[%Zu] = %Zu, mem_offset_arr[%Zu] = %Hu\n", FUNC, u, mem_len_arr[u], u, mem_offset_arr[u]); -#endif /* QAK */ + FUNC_ENTER_NOAPI_NOINIT(H5D_contig_readvv_sieve_cb) - /* Check args */ - HDassert(io_info); - HDassert(io_info->dset); - HDassert(io_info->store); - HDassert(buf); + /* Stash local copies of these value */ + if(dset_contig->sieve_buf != NULL) { + sieve_start = dset_contig->sieve_loc; + sieve_size = dset_contig->sieve_size; + sieve_end = sieve_start + sieve_size; + } /* end if */ - /* Check if data sieving is enabled */ - if(H5F_HAS_FEATURE(file, H5FD_FEAT_DATA_SIEVE)) { - haddr_t sieve_start = HADDR_UNDEF, sieve_end = HADDR_UNDEF; /* Start & end locations of sieve buffer */ - haddr_t contig_end; /* End locations of block to write */ - size_t sieve_size = (size_t)-1; /* size of sieve buffer */ - haddr_t rel_eoa; /* Relative end of file address */ - hsize_t max_data; /* Actual maximum size of data to cache */ - - /* Set offsets in sequence lists */ - u = *dset_curr_seq; - v = *mem_curr_seq; - - /* Stash local copies of these value */ - if(dset_contig->sieve_buf != NULL) { - sieve_start = dset_contig->sieve_loc; - sieve_size = dset_contig->sieve_size; - sieve_end = sieve_start+sieve_size; + /* Compute offset on disk */ + addr = store_contig->dset_addr + dst_off; + + /* Compute offset in memory */ + buf = udata->rbuf + src_off; + + /* Check if the sieve buffer is allocated yet */ + if(NULL == dset_contig->sieve_buf) { + /* Check if we can actually hold the I/O request in the sieve buffer */ + if(len > dset_contig->sieve_buf_size) { + if(H5F_block_read(file, H5FD_MEM_DRAW, addr, len, udata->dxpl_id, buf) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "block read failed") } /* end if */ + else { + /* Allocate room for the data sieve buffer */ + if(NULL == (dset_contig->sieve_buf = H5FL_BLK_MALLOC(sieve_buf, dset_contig->sieve_buf_size))) + HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "memory allocation failed") - /* Works through sequences as fast as possible */ - for(; u < dset_max_nseq && v < mem_max_nseq; ) { - /* Choose smallest buffer to write */ - if(mem_len_arr[v] < dset_len_arr[u]) - size = mem_len_arr[v]; - else - size = dset_len_arr[u]; + /* Determine the new sieve buffer size & location */ + dset_contig->sieve_loc = addr; - /* Compute offset on disk */ - addr = store_contig->dset_addr + dset_offset_arr[u]; + /* Make certain we don't read off the end of the file */ + if(HADDR_UNDEF == (rel_eoa = H5F_get_eoa(file, H5FD_MEM_DRAW))) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "unable to determine file size") - /* Compute offset in memory */ - buf = (unsigned char *)io_info->u.rbuf + mem_offset_arr[v]; + /* Set up the buffer parameters */ + max_data = store_contig->dset_size - dst_off; - /* Check if the sieve buffer is allocated yet */ - if(dset_contig->sieve_buf == NULL) { - /* Check if we can actually hold the I/O request in the sieve buffer */ - if(size>dset_contig->sieve_buf_size) { - if(H5F_block_read(file, H5FD_MEM_DRAW, addr, size, io_info->dxpl_id, buf) < 0) - HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "block read failed") - } /* end if */ - else { - /* Allocate room for the data sieve buffer */ - if (NULL==(dset_contig->sieve_buf=H5FL_BLK_MALLOC(sieve_buf,dset_contig->sieve_buf_size))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed") + /* Compute the size of the sieve buffer */ + H5_ASSIGN_OVERFLOW(dset_contig->sieve_size, MIN3(rel_eoa - dset_contig->sieve_loc, max_data, dset_contig->sieve_buf_size), hsize_t, size_t); - /* Determine the new sieve buffer size & location */ - dset_contig->sieve_loc=addr; + /* Read the new sieve buffer */ + if(H5F_block_read(file, H5FD_MEM_DRAW, dset_contig->sieve_loc, dset_contig->sieve_size, udata->dxpl_id, dset_contig->sieve_buf) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "block read failed") - /* Make certain we don't read off the end of the file */ - if(HADDR_UNDEF == (rel_eoa = H5F_get_eoa(file, H5FD_MEM_DRAW))) - HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, FAIL, "unable to determine file size") + /* Grab the data out of the buffer (must be first piece of data in buffer ) */ + HDmemcpy(buf, dset_contig->sieve_buf, len); - /* Set up the buffer parameters */ - max_data = store_contig->dset_size-dset_offset_arr[u]; + /* Reset sieve buffer dirty flag */ + dset_contig->sieve_dirty = FALSE; - /* Compute the size of the sieve buffer */ - H5_ASSIGN_OVERFLOW(dset_contig->sieve_size, MIN3(rel_eoa-dset_contig->sieve_loc, max_data, dset_contig->sieve_buf_size), hsize_t, size_t); + /* Stash local copies of these value */ + sieve_start = dset_contig->sieve_loc; + sieve_size = dset_contig->sieve_size; + sieve_end = sieve_start+sieve_size; + } /* end else */ + } /* end if */ + else { + /* Compute end of sequence to retrieve */ + contig_end = addr + len - 1; - /* Read the new sieve buffer */ - if(H5F_block_read(file, H5FD_MEM_DRAW, dset_contig->sieve_loc, dset_contig->sieve_size, io_info->dxpl_id, dset_contig->sieve_buf) < 0) - HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "block read failed") + /* If entire read is within the sieve buffer, read it from the buffer */ + if(addr >= sieve_start && contig_end < sieve_end) { + unsigned char *base_sieve_buf = dset_contig->sieve_buf + (addr - sieve_start); - /* Grab the data out of the buffer (must be first piece of data in buffer ) */ - HDmemcpy(buf, dset_contig->sieve_buf, size); + /* Grab the data out of the buffer */ + HDmemcpy(buf, base_sieve_buf, len); + } /* end if */ + /* Entire request is not within this data sieve buffer */ + else { + /* Check if we can actually hold the I/O request in the sieve buffer */ + if(len > dset_contig->sieve_buf_size) { + /* Check for any overlap with the current sieve buffer */ + if((sieve_start >= addr && sieve_start < (contig_end + 1)) + || ((sieve_end - 1) >= addr && (sieve_end - 1) < (contig_end + 1))) { + /* Flush the sieve buffer, if it's dirty */ + if(dset_contig->sieve_dirty) { + /* Write to file */ + if(H5F_block_write(file, H5FD_MEM_DRAW, sieve_start, sieve_size, udata->dxpl_id, dset_contig->sieve_buf) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "block write failed") - /* Reset sieve buffer dirty flag */ - dset_contig->sieve_dirty = 0; + /* Reset sieve buffer dirty flag */ + dset_contig->sieve_dirty = FALSE; + } /* end if */ + } /* end if */ - /* Stash local copies of these value */ - sieve_start = dset_contig->sieve_loc; - sieve_size = dset_contig->sieve_size; - sieve_end = sieve_start+sieve_size; - } /* end else */ + /* Read directly into the user's buffer */ + if(H5F_block_read(file, H5FD_MEM_DRAW, addr, len, udata->dxpl_id, buf) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "block read failed") } /* end if */ + /* Element size fits within the buffer size */ else { - /* Compute end of sequence to retrieve */ - contig_end = addr + size - 1; + /* Flush the sieve buffer if it's dirty */ + if(dset_contig->sieve_dirty) { + /* Write to file */ + if(H5F_block_write(file, H5FD_MEM_DRAW, sieve_start, sieve_size, udata->dxpl_id, dset_contig->sieve_buf) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "block write failed") - /* If entire read is within the sieve buffer, read it from the buffer */ - if(addr>=sieve_start && contig_endsieve_buf+(addr-sieve_start); - - /* Grab the data out of the buffer */ - HDmemcpy(buf, base_sieve_buf, size); + /* Reset sieve buffer dirty flag */ + dset_contig->sieve_dirty = FALSE; } /* end if */ - /* Entire request is not within this data sieve buffer */ - else { - /* Check if we can actually hold the I/O request in the sieve buffer */ - if(size>dset_contig->sieve_buf_size) { - /* Check for any overlap with the current sieve buffer */ - if((sieve_start>=addr && sieve_start<(contig_end+1)) - || ((sieve_end-1)>=addr && (sieve_end-1)<(contig_end+1))) { - /* Flush the sieve buffer, if it's dirty */ - if(dset_contig->sieve_dirty) { - /* Write to file */ - if(H5F_block_write(file, H5FD_MEM_DRAW, sieve_start, sieve_size, io_info->dxpl_id, dset_contig->sieve_buf) < 0) - HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "block write failed") - - /* Reset sieve buffer dirty flag */ - dset_contig->sieve_dirty = 0; - } /* end if */ - } /* end if */ - - /* Read directly into the user's buffer */ - if(H5F_block_read(file, H5FD_MEM_DRAW, addr, size, io_info->dxpl_id, buf) < 0) - HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "block read failed") - } /* end if */ - /* Element size fits within the buffer size */ - else { - /* Flush the sieve buffer if it's dirty */ - if(dset_contig->sieve_dirty) { - /* Write to file */ - if (H5F_block_write(file, H5FD_MEM_DRAW, sieve_start, sieve_size, io_info->dxpl_id, dset_contig->sieve_buf)<0) - HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "block write failed") - /* Reset sieve buffer dirty flag */ - dset_contig->sieve_dirty=0; - } /* end if */ + /* Determine the new sieve buffer size & location */ + dset_contig->sieve_loc = addr; - /* Determine the new sieve buffer size & location */ - dset_contig->sieve_loc=addr; + /* Make certain we don't read off the end of the file */ + if(HADDR_UNDEF == (rel_eoa = H5F_get_eoa(file, H5FD_MEM_DRAW))) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "unable to determine file size") - /* Make certain we don't read off the end of the file */ - if(HADDR_UNDEF == (rel_eoa = H5F_get_eoa(file, H5FD_MEM_DRAW))) - HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, FAIL, "unable to determine file size") + /* Only need this when resizing sieve buffer */ + max_data = store_contig->dset_size - dst_off; - /* Only need this when resizing sieve buffer */ - max_data=store_contig->dset_size-dset_offset_arr[u]; + /* Compute the size of the sieve buffer */ + /* Don't read off the end of the file, don't read past the end of the data element and don't read more than the buffer size */ + H5_ASSIGN_OVERFLOW(dset_contig->sieve_size, MIN3(rel_eoa - dset_contig->sieve_loc, max_data, dset_contig->sieve_buf_size), hsize_t, size_t); - /* Compute the size of the sieve buffer */ - /* Don't read off the end of the file, don't read past the end of the data element and don't read more than the buffer size */ - H5_ASSIGN_OVERFLOW(dset_contig->sieve_size,MIN3(rel_eoa-dset_contig->sieve_loc,max_data,dset_contig->sieve_buf_size),hsize_t,size_t); + /* Update local copies of sieve information */ + sieve_start = dset_contig->sieve_loc; + sieve_size = dset_contig->sieve_size; + sieve_end = sieve_start + sieve_size; - /* Update local copies of sieve information */ - sieve_start=dset_contig->sieve_loc; - sieve_size=dset_contig->sieve_size; - sieve_end=sieve_start+sieve_size; + /* Read the new sieve buffer */ + if(H5F_block_read(file, H5FD_MEM_DRAW, dset_contig->sieve_loc, dset_contig->sieve_size, udata->dxpl_id, dset_contig->sieve_buf) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "block read failed") - /* Read the new sieve buffer */ - if (H5F_block_read(file, H5FD_MEM_DRAW, dset_contig->sieve_loc, dset_contig->sieve_size, io_info->dxpl_id, dset_contig->sieve_buf)<0) - HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "block read failed") - - /* Grab the data out of the buffer (must be first piece of data in buffer ) */ - HDmemcpy(buf, dset_contig->sieve_buf, size); + /* Grab the data out of the buffer (must be first piece of data in buffer ) */ + HDmemcpy(buf, dset_contig->sieve_buf, len); - /* Reset sieve buffer dirty flag */ - dset_contig->sieve_dirty = 0; - } /* end else */ - } /* end else */ + /* Reset sieve buffer dirty flag */ + dset_contig->sieve_dirty = FALSE; } /* end else */ + } /* end else */ + } /* end else */ - /* Update memory information */ - mem_len_arr[v] -= size; - mem_offset_arr[v] += size; - if(mem_len_arr[v] == 0) - v++; - - /* Update file information */ - dset_len_arr[u] -= size; - dset_offset_arr[u] += size; - if(dset_len_arr[u] == 0) - u++; - - /* Increment number of bytes copied */ - total_size += size; - } /* end for */ - } /* end if */ - else { - /* Work through all the sequences */ - for(u = *dset_curr_seq, v = *mem_curr_seq; u < dset_max_nseq && v < mem_max_nseq; ) { - /* Choose smallest buffer to write */ - if(mem_len_arr[v] < dset_len_arr[u]) - size = mem_len_arr[v]; - else - size = dset_len_arr[u]; - - /* Compute offset on disk */ - addr = store_contig->dset_addr + dset_offset_arr[u]; - - /* Compute offset in memory */ - buf = (unsigned char *)io_info->u.rbuf + mem_offset_arr[v]; - - /* Write data */ - if(H5F_block_read(file, H5FD_MEM_DRAW, addr, size, io_info->dxpl_id, buf) < 0) - HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "block write failed") - - /* Update memory information */ - mem_len_arr[v] -= size; - mem_offset_arr[v] += size; - if(mem_len_arr[v] == 0) - v++; - - /* Update file information */ - dset_len_arr[u] -= size; - dset_offset_arr[u] += size; - if(dset_len_arr[u] == 0) - u++; +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5D_contig_readvv_sieve_cb() */ - /* Increment number of bytes copied */ - total_size += size; - } /* end for */ - } /* end else */ + +/*------------------------------------------------------------------------- + * Function: H5D_contig_readvv_cb + * + * Purpose: Callback operator for H5D_contig_readvv() without sieve buffer. + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Quincey Koziol + * Thursday, Sept 30, 2010 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5D_contig_readvv_cb(hsize_t dst_off, hsize_t src_off, size_t len, void *_udata) +{ + H5D_contig_readvv_ud_t *udata = (H5D_contig_readvv_ud_t *)_udata; /* User data for H5V_opvv() operator */ + herr_t ret_value = SUCCEED; /* Return value */ - /* Update current sequence vectors */ - *dset_curr_seq = u; - *mem_curr_seq = v; + FUNC_ENTER_NOAPI_NOINIT(H5D_contig_readvv_cb) - /* Set return value */ - H5_ASSIGN_OVERFLOW(ret_value, total_size, size_t, ssize_t); + /* Write data */ + if(H5F_block_read(udata->file, H5FD_MEM_DRAW, (udata->dset_addr + dst_off), + len, udata->dxpl_id, (udata->rbuf + src_off)) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "block write failed") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_contig_readvv() */ +} /* end H5D_contig_readvv_cb() */ /*------------------------------------------------------------------------- - * Function: H5D_contig_writevv + * Function: H5D_contig_readvv * - * Purpose: Writes some data vectors into a dataset from vectors into a - * buffer. The address is the start of the dataset, + * Purpose: Reads some data vectors from a dataset into a buffer. + * The data is contiguous. The address is the start of the dataset, * relative to the base address for the file and the offsets and * sequence lengths are in bytes. * * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * Friday, May 2, 2003 + * Friday, May 3, 2001 * * Notes: * Offsets in the sequences must be monotonically increasing * *------------------------------------------------------------------------- */ -ssize_t -H5D_contig_writevv(const H5D_io_info_t *io_info, - size_t dset_max_nseq, size_t *dset_curr_seq, size_t dset_len_arr[], hsize_t dset_offset_arr[], - size_t mem_max_nseq, size_t *mem_curr_seq, size_t mem_len_arr[], hsize_t mem_offset_arr[]) +static ssize_t +H5D_contig_readvv(const H5D_io_info_t *io_info, + size_t dset_max_nseq, size_t *dset_curr_seq, size_t dset_len_arr[], hsize_t dset_off_arr[], + size_t mem_max_nseq, size_t *mem_curr_seq, size_t mem_len_arr[], hsize_t mem_off_arr[]) { - H5F_t *file = io_info->dset->oloc.file; /* File for dataset */ - H5D_rdcdc_t *dset_contig = &(io_info->dset->shared->cache.contig); /* Cached information about contiguous data */ - const H5D_contig_storage_t *store_contig = &(io_info->store->contig); /* Contiguous storage info for this I/O operation */ - const unsigned char *buf = (const unsigned char *)io_info->u.wbuf; /* Pointer to buffer to fill */ - haddr_t addr; /* Actual address to read */ - size_t total_size = 0; /* Size of sequence in bytes */ - size_t size; /* Size of sequence in bytes */ - size_t u; /* Counting variable */ - size_t v; /* Counting variable */ ssize_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5D_contig_writevv, FAIL) + FUNC_ENTER_NOAPI_NOINIT(H5D_contig_readvv) /* Check args */ HDassert(io_info); - HDassert(io_info->dset); - HDassert(io_info->store); - HDassert(buf); + HDassert(dset_curr_seq); + HDassert(dset_len_arr); + HDassert(dset_off_arr); + HDassert(mem_curr_seq); + HDassert(mem_len_arr); + HDassert(mem_off_arr); /* Check if data sieving is enabled */ - if(H5F_HAS_FEATURE(file,H5FD_FEAT_DATA_SIEVE)) { - haddr_t sieve_start=HADDR_UNDEF, sieve_end=HADDR_UNDEF; /* Start & end locations of sieve buffer */ - haddr_t contig_end; /* End locations of block to write */ - size_t sieve_size=(size_t)-1; /* size of sieve buffer */ - haddr_t rel_eoa; /* Relative end of file address */ - hsize_t max_data; /* Actual maximum size of data to cache */ - - /* Set offsets in sequence lists */ - u=*dset_curr_seq; - v=*mem_curr_seq; - - /* Stash local copies of these values */ - if(dset_contig->sieve_buf!=NULL) { - sieve_start=dset_contig->sieve_loc; - sieve_size=dset_contig->sieve_size; - sieve_end=sieve_start+sieve_size; + if(H5F_HAS_FEATURE(io_info->dset->oloc.file, H5FD_FEAT_DATA_SIEVE)) { + H5D_contig_readvv_sieve_ud_t udata; /* User data for H5V_opvv() operator */ + + /* Set up user data for H5V_opvv() */ + udata.file = io_info->dset->oloc.file; + udata.dset_contig = &(io_info->dset->shared->cache.contig); + udata.store_contig = &(io_info->store->contig); + udata.rbuf = (unsigned char *)io_info->u.rbuf; + udata.dxpl_id = io_info->dxpl_id; + + /* Call generic sequence operation routine */ + if((ret_value = H5V_opvv(dset_max_nseq, dset_curr_seq, dset_len_arr, dset_off_arr, + mem_max_nseq, mem_curr_seq, mem_len_arr, mem_off_arr, + H5D_contig_readvv_sieve_cb, &udata)) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTOPERATE, FAIL, "can't perform vectorized sieve buffer read") + } /* end if */ + else { + H5D_contig_readvv_ud_t udata; /* User data for H5V_opvv() operator */ + + /* Set up user data for H5V_opvv() */ + udata.file = io_info->dset->oloc.file; + udata.dset_addr = io_info->store->contig.dset_addr; + udata.rbuf = (unsigned char *)io_info->u.rbuf; + udata.dxpl_id = io_info->dxpl_id; + + /* Call generic sequence operation routine */ + if((ret_value = H5V_opvv(dset_max_nseq, dset_curr_seq, dset_len_arr, dset_off_arr, + mem_max_nseq, mem_curr_seq, mem_len_arr, mem_off_arr, + H5D_contig_readvv_cb, &udata)) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTOPERATE, FAIL, "can't perform vectorized read") + } /* end else */ + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5D_contig_readvv() */ + + +/*------------------------------------------------------------------------- + * Function: H5D_contig_writevv_sieve_cb + * + * Purpose: Callback operator for H5D_contig_writevv() with sieve buffer. + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Quincey Koziol + * Thursday, Sept 30, 2010 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5D_contig_writevv_sieve_cb(hsize_t dst_off, hsize_t src_off, size_t len, + void *_udata) +{ + H5D_contig_writevv_sieve_ud_t *udata = (H5D_contig_writevv_sieve_ud_t *)_udata; /* User data for H5V_opvv() operator */ + H5F_t *file = udata->file; /* File for dataset */ + H5D_rdcdc_t *dset_contig = udata->dset_contig; /* Cached information about contiguous data */ + const H5D_contig_storage_t *store_contig = udata->store_contig; /* Contiguous storage info for this I/O operation */ + const unsigned char *buf; /* Pointer to buffer to fill */ + haddr_t addr; /* Actual address to read */ + haddr_t sieve_start = HADDR_UNDEF, sieve_end = HADDR_UNDEF; /* Start & end locations of sieve buffer */ + haddr_t contig_end; /* End locations of block to write */ + size_t sieve_size = (size_t)-1; /* size of sieve buffer */ + haddr_t rel_eoa; /* Relative end of file address */ + hsize_t max_data; /* Actual maximum size of data to cache */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI_NOINIT(H5D_contig_writevv_sieve_cb) + + /* Stash local copies of these values */ + if(dset_contig->sieve_buf != NULL) { + sieve_start = dset_contig->sieve_loc; + sieve_size = dset_contig->sieve_size; + sieve_end = sieve_start + sieve_size; + } /* end if */ + + /* Compute offset on disk */ + addr = store_contig->dset_addr + dst_off; + + /* Compute offset in memory */ + buf = udata->wbuf + src_off; + + /* No data sieve buffer yet, go allocate one */ + if(NULL == dset_contig->sieve_buf) { + /* Check if we can actually hold the I/O request in the sieve buffer */ + if(len > dset_contig->sieve_buf_size) { + if(H5F_block_write(file, H5FD_MEM_DRAW, addr, len, udata->dxpl_id, buf) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "block write failed") } /* end if */ + else { + /* Allocate room for the data sieve buffer */ + if(NULL == (dset_contig->sieve_buf = H5FL_BLK_MALLOC(sieve_buf, dset_contig->sieve_buf_size))) + HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "memory allocation failed") +#ifdef H5_CLEAR_MEMORY +if(dset_contig->sieve_size > len) + HDmemset(dset_contig->sieve_buf + len, 0, (dset_contig->sieve_size - len)); +#endif /* H5_CLEAR_MEMORY */ - /* Works through sequences as fast as possible */ - for(; usieve_loc = addr; + + /* Make certain we don't read off the end of the file */ + if(HADDR_UNDEF == (rel_eoa = H5F_get_eoa(file, H5FD_MEM_DRAW))) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "unable to determine file size") + + /* Set up the buffer parameters */ + max_data = store_contig->dset_size - dst_off; + + /* Compute the size of the sieve buffer */ + H5_ASSIGN_OVERFLOW(dset_contig->sieve_size, MIN3(rel_eoa - dset_contig->sieve_loc, max_data, dset_contig->sieve_buf_size), hsize_t, size_t); + + /* Check if there is any point in reading the data from the file */ + if(dset_contig->sieve_size > len) { + /* Read the new sieve buffer */ + if(H5F_block_read(file, H5FD_MEM_DRAW, dset_contig->sieve_loc, dset_contig->sieve_size, udata->dxpl_id, dset_contig->sieve_buf) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "block read failed") + } /* end if */ - /* Compute offset on disk */ - addr=store_contig->dset_addr+dset_offset_arr[u]; + /* Grab the data out of the buffer (must be first piece of data in buffer ) */ + HDmemcpy(dset_contig->sieve_buf, buf, len); - /* Compute offset in memory */ - buf = (const unsigned char *)io_info->u.wbuf + mem_offset_arr[v]; + /* Set sieve buffer dirty flag */ + dset_contig->sieve_dirty = TRUE; - /* No data sieve buffer yet, go allocate one */ - if(dset_contig->sieve_buf==NULL) { - /* Check if we can actually hold the I/O request in the sieve buffer */ - if(size>dset_contig->sieve_buf_size) { - if(H5F_block_write(file, H5FD_MEM_DRAW, addr, size, io_info->dxpl_id, buf) < 0) - HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "block write failed") + /* Stash local copies of these values */ + sieve_start = dset_contig->sieve_loc; + sieve_size = dset_contig->sieve_size; + sieve_end = sieve_start + sieve_size; + } /* end else */ + } /* end if */ + else { + /* Compute end of sequence to retrieve */ + contig_end = addr + len - 1; + + /* If entire write is within the sieve buffer, write it to the buffer */ + if(addr >= sieve_start && contig_end < sieve_end) { + unsigned char *base_sieve_buf = dset_contig->sieve_buf + (addr - sieve_start); + + /* Put the data into the sieve buffer */ + HDmemcpy(base_sieve_buf, buf, len); + + /* Set sieve buffer dirty flag */ + dset_contig->sieve_dirty = TRUE; + } /* end if */ + /* Entire request is not within this data sieve buffer */ + else { + /* Check if we can actually hold the I/O request in the sieve buffer */ + if(len > dset_contig->sieve_buf_size) { + /* Check for any overlap with the current sieve buffer */ + if((sieve_start >= addr && sieve_start < (contig_end + 1)) + || ((sieve_end - 1) >= addr && (sieve_end - 1) < (contig_end + 1))) { + /* Flush the sieve buffer, if it's dirty */ + if(dset_contig->sieve_dirty) { + /* Write to file */ + if(H5F_block_write(file, H5FD_MEM_DRAW, sieve_start, sieve_size, udata->dxpl_id, dset_contig->sieve_buf) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "block write failed") + + /* Reset sieve buffer dirty flag */ + dset_contig->sieve_dirty = FALSE; + } /* end if */ + + /* Force the sieve buffer to be re-read the next time */ + dset_contig->sieve_loc = HADDR_UNDEF; + dset_contig->sieve_size = 0; } /* end if */ + + /* Write directly from the user's buffer */ + if(H5F_block_write(file, H5FD_MEM_DRAW, addr, len, udata->dxpl_id, buf) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "block write failed") + } /* end if */ + /* Element size fits within the buffer size */ + else { + /* Check if it is possible to (exactly) prepend or append to existing (dirty) sieve buffer */ + if(((addr + len) == sieve_start || addr == sieve_end) && + (len + sieve_size) <= dset_contig->sieve_buf_size && + dset_contig->sieve_dirty) { + /* Prepend to existing sieve buffer */ + if((addr + len) == sieve_start) { + /* Move existing sieve information to correct location */ + HDmemmove(dset_contig->sieve_buf + len, dset_contig->sieve_buf, dset_contig->sieve_size); + + /* Copy in new information (must be first in sieve buffer) */ + HDmemcpy(dset_contig->sieve_buf, buf, len); + + /* Adjust sieve location */ + dset_contig->sieve_loc = addr; + + } /* end if */ + /* Append to existing sieve buffer */ + else { + /* Copy in new information */ + HDmemcpy(dset_contig->sieve_buf + sieve_size, buf, len); + } /* end else */ + + /* Adjust sieve size */ + dset_contig->sieve_size += len; + + /* Update local copies of sieve information */ + sieve_start = dset_contig->sieve_loc; + sieve_size = dset_contig->sieve_size; + sieve_end = sieve_start + sieve_size; + } /* end if */ + /* Can't add the new data onto the existing sieve buffer */ else { - /* Allocate room for the data sieve buffer */ - if(NULL == (dset_contig->sieve_buf = H5FL_BLK_MALLOC(sieve_buf, dset_contig->sieve_buf_size))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed") -#ifdef H5_CLEAR_MEMORY -if(dset_contig->sieve_size > size) - HDmemset(dset_contig->sieve_buf + size, 0, (dset_contig->sieve_size - size)); -#endif /* H5_CLEAR_MEMORY */ + /* Flush the sieve buffer if it's dirty */ + if(dset_contig->sieve_dirty) { + /* Write to file */ + if(H5F_block_write(file, H5FD_MEM_DRAW, sieve_start, sieve_size, udata->dxpl_id, dset_contig->sieve_buf) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "block write failed") + + /* Reset sieve buffer dirty flag */ + dset_contig->sieve_dirty = FALSE; + } /* end if */ /* Determine the new sieve buffer size & location */ - dset_contig->sieve_loc=addr; + dset_contig->sieve_loc = addr; /* Make certain we don't read off the end of the file */ if(HADDR_UNDEF == (rel_eoa = H5F_get_eoa(file, H5FD_MEM_DRAW))) - HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, FAIL, "unable to determine file size") + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "unable to determine file size") - /* Set up the buffer parameters */ - max_data=store_contig->dset_size-dset_offset_arr[u]; + /* Only need this when resizing sieve buffer */ + max_data = store_contig->dset_size - dst_off; /* Compute the size of the sieve buffer */ - H5_ASSIGN_OVERFLOW(dset_contig->sieve_size,MIN3(rel_eoa-dset_contig->sieve_loc,max_data,dset_contig->sieve_buf_size),hsize_t,size_t); - - /* Check if there is any point in reading the data from the file */ - if(dset_contig->sieve_size>size) { - /* Read the new sieve buffer */ - if (H5F_block_read(file, H5FD_MEM_DRAW, dset_contig->sieve_loc, dset_contig->sieve_size, io_info->dxpl_id, dset_contig->sieve_buf)<0) - HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "block read failed") - } /* end if */ - - /* Grab the data out of the buffer (must be first piece of data in buffer ) */ - HDmemcpy(dset_contig->sieve_buf, buf, size); - - /* Set sieve buffer dirty flag */ - dset_contig->sieve_dirty = 1; + /* Don't read off the end of the file, don't read past the end of the data element and don't read more than the buffer size */ + H5_ASSIGN_OVERFLOW(dset_contig->sieve_size, MIN3(rel_eoa - dset_contig->sieve_loc, max_data, dset_contig->sieve_buf_size), hsize_t, size_t); - /* Stash local copies of these values */ + /* Update local copies of sieve information */ sieve_start = dset_contig->sieve_loc; sieve_size = dset_contig->sieve_size; sieve_end = sieve_start + sieve_size; - } /* end else */ - } /* end if */ - else { - /* Compute end of sequence to retrieve */ - contig_end=addr+size-1; - /* If entire write is within the sieve buffer, write it to the buffer */ - if(addr>=sieve_start && contig_endsieve_buf + (addr - sieve_start); + /* Check if there is any point in reading the data from the file */ + if(dset_contig->sieve_size > len) { + /* Read the new sieve buffer */ + if(H5F_block_read(file, H5FD_MEM_DRAW, dset_contig->sieve_loc, dset_contig->sieve_size, udata->dxpl_id, dset_contig->sieve_buf) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "block read failed") + } /* end if */ - /* Put the data into the sieve buffer */ - HDmemcpy(base_sieve_buf, buf, size); + /* Grab the data out of the buffer (must be first piece of data in buffer ) */ + HDmemcpy(dset_contig->sieve_buf, buf, len); /* Set sieve buffer dirty flag */ - dset_contig->sieve_dirty = 1; - } /* end if */ - /* Entire request is not within this data sieve buffer */ - else { - /* Check if we can actually hold the I/O request in the sieve buffer */ - if(size>dset_contig->sieve_buf_size) { - /* Check for any overlap with the current sieve buffer */ - if((sieve_start>=addr && sieve_start<(contig_end+1)) - || ((sieve_end-1)>=addr && (sieve_end-1)<(contig_end+1))) { - /* Flush the sieve buffer, if it's dirty */ - if(dset_contig->sieve_dirty) { - /* Write to file */ - if (H5F_block_write(file, H5FD_MEM_DRAW, sieve_start, sieve_size, io_info->dxpl_id, dset_contig->sieve_buf)<0) - HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "block write failed") - - /* Reset sieve buffer dirty flag */ - dset_contig->sieve_dirty=0; - } /* end if */ - - /* Force the sieve buffer to be re-read the next time */ - dset_contig->sieve_loc=HADDR_UNDEF; - dset_contig->sieve_size=0; - } /* end if */ - - /* Write directly from the user's buffer */ - if(H5F_block_write(file, H5FD_MEM_DRAW, addr, size, io_info->dxpl_id, buf) < 0) - HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "block write failed") - } /* end if */ - /* Element size fits within the buffer size */ - else { - /* Check if it is possible to (exactly) prepend or append to existing (dirty) sieve buffer */ - if(((addr+size)==sieve_start || addr==sieve_end) && - (size+sieve_size)<=dset_contig->sieve_buf_size && - dset_contig->sieve_dirty) { - /* Prepend to existing sieve buffer */ - if((addr + size) == sieve_start) { - /* Move existing sieve information to correct location */ - HDmemmove(dset_contig->sieve_buf + size, dset_contig->sieve_buf, dset_contig->sieve_size); - - /* Copy in new information (must be first in sieve buffer) */ - HDmemcpy(dset_contig->sieve_buf, buf, size); - - /* Adjust sieve location */ - dset_contig->sieve_loc = addr; - - } /* end if */ - /* Append to existing sieve buffer */ - else { - /* Copy in new information */ - HDmemcpy(dset_contig->sieve_buf + sieve_size, buf, size); - } /* end else */ - - /* Adjust sieve size */ - dset_contig->sieve_size += size; - - /* Update local copies of sieve information */ - sieve_start = dset_contig->sieve_loc; - sieve_size = dset_contig->sieve_size; - sieve_end = sieve_start + sieve_size; - } /* end if */ - /* Can't add the new data onto the existing sieve buffer */ - else { - /* Flush the sieve buffer if it's dirty */ - if(dset_contig->sieve_dirty) { - /* Write to file */ - if (H5F_block_write(file, H5FD_MEM_DRAW, sieve_start, sieve_size, io_info->dxpl_id, dset_contig->sieve_buf)<0) - HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "block write failed") - - /* Reset sieve buffer dirty flag */ - dset_contig->sieve_dirty=0; - } /* end if */ - - /* Determine the new sieve buffer size & location */ - dset_contig->sieve_loc=addr; - - /* Make certain we don't read off the end of the file */ - if(HADDR_UNDEF == (rel_eoa = H5F_get_eoa(file, H5FD_MEM_DRAW))) - HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, FAIL, "unable to determine file size") - - /* Only need this when resizing sieve buffer */ - max_data=store_contig->dset_size-dset_offset_arr[u]; - - /* Compute the size of the sieve buffer */ - /* Don't read off the end of the file, don't read past the end of the data element and don't read more than the buffer size */ - H5_ASSIGN_OVERFLOW(dset_contig->sieve_size,MIN3(rel_eoa-dset_contig->sieve_loc,max_data,dset_contig->sieve_buf_size),hsize_t,size_t); - - /* Update local copies of sieve information */ - sieve_start=dset_contig->sieve_loc; - sieve_size=dset_contig->sieve_size; - sieve_end=sieve_start+sieve_size; - - /* Check if there is any point in reading the data from the file */ - if(dset_contig->sieve_size>size) { - /* Read the new sieve buffer */ - if (H5F_block_read(file, H5FD_MEM_DRAW, dset_contig->sieve_loc, dset_contig->sieve_size, io_info->dxpl_id, dset_contig->sieve_buf)<0) - HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "block read failed") - } /* end if */ - - /* Grab the data out of the buffer (must be first piece of data in buffer ) */ - HDmemcpy(dset_contig->sieve_buf, buf, size); - - /* Set sieve buffer dirty flag */ - dset_contig->sieve_dirty = 1; - } /* end else */ - } /* end else */ + dset_contig->sieve_dirty = TRUE; } /* end else */ } /* end else */ + } /* end else */ + } /* end else */ - /* Update memory information */ - mem_len_arr[v] -= size; - mem_offset_arr[v] += size; - if(mem_len_arr[v] == 0) - v++; - - /* Update file information */ - dset_len_arr[u] -= size; - dset_offset_arr[u] += size; - if(dset_len_arr[u] == 0) - u++; - - /* Increment number of bytes copied */ - total_size += size; - } /* end for */ - } /* end if */ - else { - /* Work through all the sequences */ - for(u = *dset_curr_seq, v = *mem_curr_seq; u < dset_max_nseq && v < mem_max_nseq; ) { - /* Choose smallest buffer to write */ - if(mem_len_arr[v] < dset_len_arr[u]) - size = mem_len_arr[v]; - else - size = dset_len_arr[u]; +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5D_contig_writevv_sieve_cb() */ - /* Compute offset on disk */ - addr = store_contig->dset_addr + dset_offset_arr[u]; + +/*------------------------------------------------------------------------- + * Function: H5D_contig_writevv_cb + * + * Purpose: Callback operator for H5D_contig_writevv(). + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Quincey Koziol + * Thursday, Sept 30, 2010 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5D_contig_writevv_cb(hsize_t dst_off, hsize_t src_off, size_t len, void *_udata) +{ + H5D_contig_writevv_ud_t *udata = (H5D_contig_writevv_ud_t *)_udata; /* User data for H5V_opvv() operator */ + herr_t ret_value = SUCCEED; /* Return value */ - /* Compute offset in memory */ - buf = (const unsigned char *)io_info->u.wbuf + mem_offset_arr[v]; + FUNC_ENTER_NOAPI_NOINIT(H5D_contig_writevv_cb) - /* Write data */ - if(H5F_block_write(file, H5FD_MEM_DRAW, addr, size, io_info->dxpl_id, buf) < 0) - HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "block write failed") + /* Write data */ + if(H5F_block_write(udata->file, H5FD_MEM_DRAW, (udata->dset_addr + dst_off), len, udata->dxpl_id, (udata->wbuf + src_off)) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "block write failed") - /* Update memory information */ - mem_len_arr[v] -= size; - mem_offset_arr[v] += size; - if(mem_len_arr[v] == 0) - v++; +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5D_contig_writevv_cb() */ - /* Update file information */ - dset_len_arr[u] -= size; - dset_offset_arr[u] += size; - if(dset_len_arr[u] == 0) - u++; + +/*------------------------------------------------------------------------- + * Function: H5D_contig_writevv + * + * Purpose: Writes some data vectors into a dataset from vectors into a + * buffer. The address is the start of the dataset, + * relative to the base address for the file and the offsets and + * sequence lengths are in bytes. + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Quincey Koziol + * Friday, May 2, 2003 + * + * Notes: + * Offsets in the sequences must be monotonically increasing + * + *------------------------------------------------------------------------- + */ +static ssize_t +H5D_contig_writevv(const H5D_io_info_t *io_info, + size_t dset_max_nseq, size_t *dset_curr_seq, size_t dset_len_arr[], hsize_t dset_off_arr[], + size_t mem_max_nseq, size_t *mem_curr_seq, size_t mem_len_arr[], hsize_t mem_off_arr[]) +{ + ssize_t ret_value; /* Return value (Size of sequence in bytes) */ - /* Increment number of bytes copied */ - total_size += size; - } /* end for */ - } /* end else */ + FUNC_ENTER_NOAPI_NOINIT(H5D_contig_writevv) - /* Update current sequence vectors */ - *dset_curr_seq = u; - *mem_curr_seq = v; + /* Check args */ + HDassert(io_info); + HDassert(dset_curr_seq); + HDassert(dset_len_arr); + HDassert(dset_off_arr); + HDassert(mem_curr_seq); + HDassert(mem_len_arr); + HDassert(mem_off_arr); - /* Set return value */ - H5_ASSIGN_OVERFLOW(ret_value, total_size, size_t, ssize_t); + /* Check if data sieving is enabled */ + if(H5F_HAS_FEATURE(io_info->dset->oloc.file, H5FD_FEAT_DATA_SIEVE)) { + H5D_contig_writevv_sieve_ud_t udata; /* User data for H5V_opvv() operator */ + + /* Set up user data for H5V_opvv() */ + udata.file = io_info->dset->oloc.file; + udata.dset_contig = &(io_info->dset->shared->cache.contig); + udata.store_contig = &(io_info->store->contig); + udata.wbuf = (const unsigned char *)io_info->u.wbuf; + udata.dxpl_id = io_info->dxpl_id; + + /* Call generic sequence operation routine */ + if((ret_value = H5V_opvv(dset_max_nseq, dset_curr_seq, dset_len_arr, dset_off_arr, + mem_max_nseq, mem_curr_seq, mem_len_arr, mem_off_arr, + H5D_contig_writevv_sieve_cb, &udata)) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTOPERATE, FAIL, "can't perform vectorized sieve buffer write") + } /* end if */ + else { + H5D_contig_writevv_ud_t udata; /* User data for H5V_opvv() operator */ + + /* Set up user data for H5V_opvv() */ + udata.file = io_info->dset->oloc.file; + udata.dset_addr = io_info->store->contig.dset_addr; + udata.wbuf = (const unsigned char *)io_info->u.wbuf; + udata.dxpl_id = io_info->dxpl_id; + + /* Call generic sequence operation routine */ + if((ret_value = H5V_opvv(dset_max_nseq, dset_curr_seq, dset_len_arr, dset_off_arr, + mem_max_nseq, mem_curr_seq, mem_len_arr, mem_off_arr, + H5D_contig_writevv_cb, &udata)) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTOPERATE, FAIL, "can't perform vectorized read") + } /* end else */ done: FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5Defl.c b/src/H5Defl.c index b0233d4..bcb47a2 100644 --- a/src/H5Defl.c +++ b/src/H5Defl.c @@ -33,6 +33,7 @@ #include "H5Eprivate.h" /* Error handling */ #include "H5Fprivate.h" /* Files */ #include "H5HLprivate.h" /* Local Heaps */ +#include "H5Vprivate.h" /* Vector and array functions */ /****************/ @@ -44,6 +45,18 @@ /* Local Typedefs */ /******************/ +/* Callback info for readvv operation */ +typedef struct H5D_efl_readvv_ud_t { + const H5O_efl_t *efl; /* Pointer to efl info */ + unsigned char *rbuf; /* Read buffer */ +} H5D_efl_readvv_ud_t; + +/* Callback info for writevv operation */ +typedef struct H5D_efl_writevv_ud_t { + const H5O_efl_t *efl; /* Pointer to efl info */ + const unsigned char *wbuf; /* Write buffer */ +} H5D_efl_writevv_ud_t; + /********************/ /* Local Prototypes */ @@ -398,6 +411,35 @@ done: /*------------------------------------------------------------------------- + * Function: H5D_efl_readvv_cb + * + * Purpose: Callback operator for H5D_efl_readvv(). + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Quincey Koziol + * Thursday, Sept 30, 2010 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5D_efl_readvv_cb(hsize_t dst_off, hsize_t src_off, size_t len, void *_udata) +{ + H5D_efl_readvv_ud_t *udata = (H5D_efl_readvv_ud_t *)_udata; /* User data for H5V_opvv() operator */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI_NOINIT(H5D_efl_readvv_cb) + + /* Read data */ + if(H5D_efl_read(udata->efl, dst_off, len, (udata->rbuf + src_off)) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "EFL read failed") + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5D_efl_readvv_cb() */ + + +/*------------------------------------------------------------------------- * Function: H5D_efl_readvv * * Purpose: Reads data from an external file list. It is an error to @@ -414,68 +456,67 @@ done: */ static ssize_t H5D_efl_readvv(const H5D_io_info_t *io_info, - size_t dset_max_nseq, size_t *dset_curr_seq, size_t dset_len_arr[], hsize_t dset_offset_arr[], - size_t mem_max_nseq, size_t *mem_curr_seq, size_t mem_len_arr[], hsize_t mem_offset_arr[]) + size_t dset_max_nseq, size_t *dset_curr_seq, size_t dset_len_arr[], hsize_t dset_off_arr[], + size_t mem_max_nseq, size_t *mem_curr_seq, size_t mem_len_arr[], hsize_t mem_off_arr[]) { - const H5O_efl_t *efl = &(io_info->store->efl); /* Pointer to efl info */ - unsigned char *buf; /* Pointer to buffer to write */ - haddr_t addr; /* Actual address to read */ - size_t total_size = 0; /* Total size of sequence in bytes */ - size_t size; /* Size of sequence in bytes */ - size_t u; /* Counting variable */ - size_t v; /* Counting variable */ - ssize_t ret_value; /* Return value */ + H5D_efl_readvv_ud_t udata; /* User data for H5V_opvv() operator */ + ssize_t ret_value; /* Return value (Total size of sequence in bytes) */ FUNC_ENTER_NOAPI_NOINIT(H5D_efl_readvv) /* Check args */ - HDassert(efl && efl->nused > 0); + HDassert(io_info); + HDassert(io_info->store->efl.nused > 0); HDassert(io_info->u.rbuf); + HDassert(dset_curr_seq); + HDassert(dset_len_arr); + HDassert(dset_off_arr); + HDassert(mem_curr_seq); + HDassert(mem_len_arr); + HDassert(mem_off_arr); + + /* Set up user data for H5V_opvv() */ + udata.efl = &(io_info->store->efl); + udata.rbuf = (unsigned char *)io_info->u.rbuf; + + /* Call generic sequence operation routine */ + if((ret_value = H5V_opvv(dset_max_nseq, dset_curr_seq, dset_len_arr, dset_off_arr, + mem_max_nseq, mem_curr_seq, mem_len_arr, mem_off_arr, + H5D_efl_readvv_cb, &udata)) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTOPERATE, FAIL, "can't perform vectorized EFL read") - /* Work through all the sequences */ - for(u = *dset_curr_seq, v = *mem_curr_seq; u < dset_max_nseq && v < mem_max_nseq; ) { - /* Choose smallest buffer to write */ - if(mem_len_arr[v] < dset_len_arr[u]) - size = mem_len_arr[v]; - else - size = dset_len_arr[u]; - - /* Compute offset on disk */ - addr = dset_offset_arr[u]; - - /* Compute offset in memory */ - buf = (unsigned char *)io_info->u.rbuf + mem_offset_arr[v]; - - /* Read data */ - if(H5D_efl_read(efl, addr, size, buf) < 0) - HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "block write failed") - - /* Update memory information */ - mem_len_arr[v] -= size; - mem_offset_arr[v] += size; - if(mem_len_arr[v] == 0) - v++; - - /* Update file information */ - dset_len_arr[u] -= size; - dset_offset_arr[u] += size; - if(dset_len_arr[u] == 0) - u++; - - /* Increment number of bytes copied */ - total_size += size; - } /* end for */ +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5D_efl_readvv() */ + + +/*------------------------------------------------------------------------- + * Function: H5D_efl_writevv_cb + * + * Purpose: Callback operator for H5D_efl_writevv(). + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Quincey Koziol + * Thursday, Sept 30, 2010 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5D_efl_writevv_cb(hsize_t dst_off, hsize_t src_off, size_t len, void *_udata) +{ + H5D_efl_writevv_ud_t *udata = (H5D_efl_writevv_ud_t *)_udata; /* User data for H5V_opvv() operator */ + herr_t ret_value = SUCCEED; /* Return value */ - /* Update current sequence vectors */ - *dset_curr_seq = u; - *mem_curr_seq = v; + FUNC_ENTER_NOAPI_NOINIT(H5D_efl_writevv_cb) - /* Set return value */ - H5_ASSIGN_OVERFLOW(ret_value, total_size, size_t, ssize_t); + /* Write data */ + if(H5D_efl_write(udata->efl, dst_off, len, (udata->wbuf + src_off)) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "EFL write failed") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_efl_readvv() */ +} /* end H5D_efl_writevv_cb() */ /*------------------------------------------------------------------------- @@ -495,65 +536,34 @@ done: */ static ssize_t H5D_efl_writevv(const H5D_io_info_t *io_info, - size_t dset_max_nseq, size_t *dset_curr_seq, size_t dset_len_arr[], hsize_t dset_offset_arr[], - size_t mem_max_nseq, size_t *mem_curr_seq, size_t mem_len_arr[], hsize_t mem_offset_arr[]) + size_t dset_max_nseq, size_t *dset_curr_seq, size_t dset_len_arr[], hsize_t dset_off_arr[], + size_t mem_max_nseq, size_t *mem_curr_seq, size_t mem_len_arr[], hsize_t mem_off_arr[]) { - const H5O_efl_t *efl = &(io_info->store->efl); /* Pointer to efl info */ - const unsigned char *buf; /* Pointer to buffer to write */ - haddr_t addr; /* Actual address to read */ - size_t total_size = 0; /* Total size of sequence in bytes */ - size_t size; /* Size of sequence in bytes */ - size_t u; /* Counting variable */ - size_t v; /* Counting variable */ - ssize_t ret_value; /* Return value */ + H5D_efl_writevv_ud_t udata; /* User data for H5V_opvv() operator */ + ssize_t ret_value; /* Return value (Total size of sequence in bytes) */ FUNC_ENTER_NOAPI_NOINIT(H5D_efl_writevv) /* Check args */ - HDassert(efl && efl->nused > 0); + HDassert(io_info); + HDassert(io_info->store->efl.nused > 0); HDassert(io_info->u.wbuf); - - /* Work through all the sequences */ - for(u = *dset_curr_seq, v = *mem_curr_seq; u < dset_max_nseq && v < mem_max_nseq; ) { - /* Choose smallest buffer to write */ - if(mem_len_arr[v] < dset_len_arr[u]) - size = mem_len_arr[v]; - else - size = dset_len_arr[u]; - - /* Compute offset on disk */ - addr = dset_offset_arr[u]; - - /* Compute offset in memory */ - buf = (const unsigned char *)io_info->u.wbuf + mem_offset_arr[v]; - - /* Write data */ - if(H5D_efl_write(efl, addr, size, buf) < 0) - HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "block write failed") - - /* Update memory information */ - mem_len_arr[v] -= size; - mem_offset_arr[v] += size; - if(mem_len_arr[v] == 0) - v++; - - /* Update file information */ - dset_len_arr[u] -= size; - dset_offset_arr[u] += size; - if(dset_len_arr[u] == 0) - u++; - - /* Increment number of bytes copied */ - total_size += size; - } /* end for */ - - /* Update current sequence vectors */ - *dset_curr_seq = u; - *mem_curr_seq = v; - - /* Set return value */ - H5_ASSIGN_OVERFLOW(ret_value, total_size, size_t, ssize_t); - + HDassert(dset_curr_seq); + HDassert(dset_len_arr); + HDassert(dset_off_arr); + HDassert(mem_curr_seq); + HDassert(mem_len_arr); + HDassert(mem_off_arr); + + /* Set up user data for H5V_opvv() */ + udata.efl = &(io_info->store->efl); + udata.wbuf = (const unsigned char *)io_info->u.wbuf; + + /* Call generic sequence operation routine */ + if((ret_value = H5V_opvv(dset_max_nseq, dset_curr_seq, dset_len_arr, dset_off_arr, + mem_max_nseq, mem_curr_seq, mem_len_arr, mem_off_arr, + H5D_efl_writevv_cb, &udata)) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTOPERATE, FAIL, "can't perform vectorized EFL write") done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D_efl_writevv() */ diff --git a/src/H5Dint.c b/src/H5Dint.c index ff53db0..46f15ea 100644 --- a/src/H5Dint.c +++ b/src/H5Dint.c @@ -563,7 +563,7 @@ done: if(ret_value == NULL) if(new_dset != NULL) { if(new_dset->dcpl_id != 0 && H5I_dec_ref(new_dset->dcpl_id) < 0) - HDONE_ERROR(H5E_DATASET, H5E_CANTDEC, FAIL, "can't decrement temporary datatype ID") + HDONE_ERROR(H5E_DATASET, H5E_CANTDEC, NULL, "can't decrement temporary datatype ID") new_dset = H5FL_FREE(H5D_shared_t, new_dset); } /* end if */ diff --git a/src/H5Dpkg.h b/src/H5Dpkg.h index b701908..45e9870 100644 --- a/src/H5Dpkg.h +++ b/src/H5Dpkg.h @@ -423,7 +423,7 @@ typedef struct H5D_rdcdc_t { haddr_t sieve_loc; /* File location (offset) of the data sieve buffer */ size_t sieve_size; /* Size of the data sieve buffer used (in bytes) */ size_t sieve_buf_size; /* Size of the data sieve buffer allocated (in bytes) */ - unsigned sieve_dirty; /* Flag to indicate that the data sieve buffer is dirty */ + hbool_t sieve_dirty; /* Flag to indicate that the data sieve buffer is dirty */ } H5D_rdcdc_t; /* @@ -642,12 +642,6 @@ H5_DLL herr_t H5D_contig_read(H5D_io_info_t *io_info, const H5D_type_info_t *typ H5_DLL herr_t H5D_contig_write(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, hsize_t nelmts, const H5S_t *file_space, const H5S_t *mem_space, H5D_chunk_map_t *fm); -H5_DLL ssize_t H5D_contig_readvv(const H5D_io_info_t *io_info, - size_t dset_max_nseq, size_t *dset_curr_seq, size_t dset_len_arr[], hsize_t dset_offset_arr[], - size_t mem_max_nseq, size_t *mem_curr_seq, size_t mem_len_arr[], hsize_t mem_offset_arr[]); -H5_DLL ssize_t H5D_contig_writevv(const H5D_io_info_t *io_info, - size_t dset_max_nseq, size_t *dset_curr_seq, size_t dset_len_arr[], hsize_t dset_offset_arr[], - size_t mem_max_nseq, size_t *mem_curr_seq, size_t mem_len_arr[], hsize_t mem_offset_arr[]); H5_DLL herr_t H5D_contig_copy(H5F_t *f_src, const H5O_storage_contig_t *storage_src, H5F_t *f_dst, H5O_storage_contig_t *storage_dst, H5T_t *src_dtype, H5O_copy_t *cpy_info, hid_t dxpl_id); diff --git a/src/H5G.c b/src/H5G.c index 0b42324..18e6403 100644 --- a/src/H5G.c +++ b/src/H5G.c @@ -256,6 +256,8 @@ H5G_create_named(const H5G_loc_t *loc, const char *name, hid_t lcpl_id, /* Set up group creation info */ gcrt_info.gcpl_id = gcpl_id; + gcrt_info.cache_type = H5G_NOTHING_CACHED; + HDmemset(&gcrt_info.cache, 0, sizeof(gcrt_info.cache)); /* Set up object creation information */ ocrt_info.obj_type = H5O_TYPE_GROUP; @@ -315,6 +317,7 @@ H5Gcreate_anon(hid_t loc_id, hid_t gcpl_id, hid_t gapl_id) { H5G_loc_t loc; H5G_t *grp = NULL; + H5G_obj_create_t gcrt_info; /* Information for group creation */ hid_t ret_value; FUNC_ENTER_API(H5Gcreate_anon, FAIL) @@ -338,8 +341,13 @@ H5Gcreate_anon(hid_t loc_id, hid_t gcpl_id, hid_t gapl_id) if(TRUE != H5P_isa_class(gapl_id, H5P_GROUP_ACCESS)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not group access property list") + /* Set up group creation info */ + gcrt_info.gcpl_id = gcpl_id; + gcrt_info.cache_type = H5G_NOTHING_CACHED; + HDmemset(&gcrt_info.cache, 0, sizeof(gcrt_info.cache)); + /* Create the new group & get its ID */ - if(NULL == (grp = H5G_create(loc.oloc->file, gcpl_id, H5AC_dxpl_id))) + if(NULL == (grp = H5G_create(loc.oloc->file, &gcrt_info, H5AC_dxpl_id))) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to create group") if((ret_value = H5I_register(H5I_GROUP, grp, TRUE)) < 0) HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register group") @@ -853,7 +861,7 @@ H5G_term_interface(void) *------------------------------------------------------------------------- */ H5G_t * -H5G_create(H5F_t *file, hid_t gcpl_id, hid_t dxpl_id) +H5G_create(H5F_t *file, H5G_obj_create_t *gcrt_info, hid_t dxpl_id) { H5G_t *grp = NULL; /*new group */ unsigned oloc_init = 0; /* Flag to indicate that the group object location was created successfully */ @@ -863,7 +871,7 @@ H5G_create(H5F_t *file, hid_t gcpl_id, hid_t dxpl_id) /* check args */ HDassert(file); - HDassert(gcpl_id != H5P_DEFAULT); + HDassert(gcrt_info->gcpl_id != H5P_DEFAULT); HDassert(dxpl_id != H5P_DEFAULT); /* create an open group */ @@ -873,7 +881,7 @@ H5G_create(H5F_t *file, hid_t gcpl_id, hid_t dxpl_id) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") /* Create the group object header */ - if(H5G_obj_create(file, dxpl_id, gcpl_id, &(grp->oloc)/*out*/) < 0) + if(H5G_obj_create(file, dxpl_id, gcrt_info, &(grp->oloc)/*out*/) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, NULL, "unable to create group object header") oloc_init = 1; /* Indicate that the object location information is valid */ diff --git a/src/H5Gent.c b/src/H5Gent.c index a2e6159..cec788c 100644 --- a/src/H5Gent.c +++ b/src/H5Gent.c @@ -352,7 +352,8 @@ H5G_ent_reset(H5G_entry_t *ent) */ herr_t H5G_ent_convert(H5F_t *f, hid_t dxpl_id, H5HL_t *heap, const char *name, - const H5O_link_t *lnk, H5G_entry_t *ent) + const H5O_link_t *lnk, H5O_type_t obj_type, const void *crt_info, + H5G_entry_t *ent) { size_t name_offset; /* Offset of name in heap */ herr_t ret_value = SUCCEED; /* Return value */ @@ -373,13 +374,91 @@ H5G_ent_convert(H5F_t *f, hid_t dxpl_id, H5HL_t *heap, const char *name, */ name_offset = H5HL_insert(f, dxpl_id, heap, HDstrlen(name) + 1, name); if(0 == name_offset || (size_t)(-1) == name_offset) - HGOTO_ERROR(H5E_SYM, H5E_CANTINSERT, H5B_INS_ERROR, "unable to insert symbol name into heap") + HGOTO_ERROR(H5E_SYM, H5E_CANTINSERT, FAIL, "unable to insert symbol name into heap") ent->name_off = name_offset; /* Build correct information for symbol table entry based on link type */ switch(lnk->type) { case H5L_TYPE_HARD: - ent->type = H5G_NOTHING_CACHED; + if(obj_type == H5O_TYPE_GROUP) { + const H5G_obj_create_t *gcrt_info = (const H5G_obj_create_t *)crt_info; + + ent->type = gcrt_info->cache_type; + if(ent->type != H5G_NOTHING_CACHED) + ent->cache = gcrt_info->cache; +#ifndef NDEBUG + else { + /* Make sure there is no stab message in the target object + */ + H5O_loc_t targ_oloc; /* Location of link target */ + htri_t stab_exists; /* Whether the target symbol table exists */ + + /* Build target object location */ + if(H5O_loc_reset(&targ_oloc) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "unable to initialize target location") + targ_oloc.file = f; + targ_oloc.addr = lnk->u.hard.addr; + + /* Check if a symbol table message exists */ + if((stab_exists = H5O_msg_exists(&targ_oloc, H5O_STAB_ID, + dxpl_id)) < 0) + HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "unable to check for STAB message") + + HDassert(!stab_exists); + } /* end else */ +#endif /* NDEBUG */ + } /* end if */ + else if(obj_type == H5O_TYPE_UNKNOWN){ + /* Try to retrieve symbol table information for caching */ + H5O_loc_t targ_oloc; /* Location of link target */ + H5O_t *oh; /* Link target object header */ + H5O_stab_t stab; /* Link target symbol table */ + htri_t stab_exists; /* Whether the target symbol table exists */ + + /* Build target object location */ + if(H5O_loc_reset(&targ_oloc) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "unable to initialize target location") + targ_oloc.file = f; + targ_oloc.addr = lnk->u.hard.addr; + + /* Get the object header */ + if(NULL == (oh = H5O_protect(&targ_oloc, dxpl_id, H5AC_READ))) + HGOTO_ERROR(H5E_SYM, H5E_CANTPROTECT, FAIL, "unable to protect target object header") + + /* Check if a symbol table message exists */ + if((stab_exists = H5O_msg_exists_oh(oh, H5O_STAB_ID)) < 0) { + if(H5O_unprotect(&targ_oloc, dxpl_id, oh, H5AC__NO_FLAGS_SET) + < 0) + HERROR(H5E_SYM, H5E_CANTUNPROTECT, "unable to release object header"); + HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "unable to check for STAB message") + } /* end if */ + + if(stab_exists) { + /* Read symbol table message */ + if(NULL == H5O_msg_read_oh(f, dxpl_id, oh, H5O_STAB_ID, + &stab)) { + if(H5O_unprotect(&targ_oloc, dxpl_id, oh, + H5AC__NO_FLAGS_SET) < 0) + HERROR(H5E_SYM, H5E_CANTUNPROTECT, "unable to release object header"); + HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "unable to read STAB message") + } /* end if */ + + /* Cache symbol table message */ + ent->type = H5G_CACHED_STAB; + ent->cache.stab.btree_addr = stab.btree_addr; + ent->cache.stab.heap_addr = stab.heap_addr; + } /* end if */ + else + /* No symbol table message, don't cache anything */ + ent->type = H5G_NOTHING_CACHED; + + if(H5O_unprotect(&targ_oloc, dxpl_id, oh, H5AC__NO_FLAGS_SET) + < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTUNPROTECT, FAIL, "unable to release object header") + } /* end else */ + else + ent->type = H5G_NOTHING_CACHED; + ent->header = lnk->u.hard.addr; break; diff --git a/src/H5Glink.c b/src/H5Glink.c index d8e87b3..0049bfd 100644 --- a/src/H5Glink.c +++ b/src/H5Glink.c @@ -491,7 +491,10 @@ H5G_link_copy_file(H5F_t *dst_file, hid_t dxpl_id, const H5O_link_t *_src_lnk, HDassert(H5F_addr_defined(tmp_src_oloc.addr)); /* Copy the shared object from source to destination */ - if(H5O_copy_header_map(&tmp_src_oloc, &new_dst_oloc, dxpl_id, cpy_info, TRUE) < 0) + /* Don't care about obj_type or udata because those are only important + * for old style groups */ + if(H5O_copy_header_map(&tmp_src_oloc, &new_dst_oloc, dxpl_id, cpy_info, + TRUE, NULL, NULL) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, FAIL, "unable to copy object") /* Copy new destination object's information for eventual insertion */ diff --git a/src/H5Gloc.c b/src/H5Gloc.c index d95d705..82b7575 100644 --- a/src/H5Gloc.c +++ b/src/H5Gloc.c @@ -609,7 +609,7 @@ done: */ herr_t H5G_loc_insert(H5G_loc_t *grp_loc, const char *name, H5G_loc_t *obj_loc, - hid_t dxpl_id) + H5O_type_t obj_type, const void *crt_info, hid_t dxpl_id) { H5O_link_t lnk; /* Link for object to insert */ herr_t ret_value = SUCCEED; /* Return value */ @@ -631,7 +631,8 @@ H5G_loc_insert(H5G_loc_t *grp_loc, const char *name, H5G_loc_t *obj_loc, lnk.u.hard.addr = obj_loc->oloc->addr; /* Insert new group into current group's symbol table */ - if(H5G_obj_insert(grp_loc->oloc, name, &lnk, TRUE, dxpl_id) < 0) + if(H5G_obj_insert(grp_loc->oloc, name, &lnk, TRUE, obj_type, crt_info, + dxpl_id) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINSERT, FAIL, "unable to insert object") /* Set the name of the object location */ diff --git a/src/H5Gnode.c b/src/H5Gnode.c index 2b793a9..5a2d736 100644 --- a/src/H5Gnode.c +++ b/src/H5Gnode.c @@ -640,7 +640,8 @@ H5G_node_insert(H5F_t *f, hid_t dxpl_id, haddr_t addr, idx += cmp > 0 ? 1 : 0; /* Convert link information & name to symbol table entry */ - if(H5G_ent_convert(f, dxpl_id, udata->common.heap, udata->common.name, udata->lnk, &ent) < 0) + if(H5G_ent_convert(f, dxpl_id, udata->common.heap, udata->common.name, + udata->lnk, udata->obj_type, udata->crt_info, &ent) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTCONVERT, H5B_INS_ERROR, "unable to convert link") /* Determine where to place entry in node */ @@ -1238,6 +1239,9 @@ H5G_node_copy(H5F_t *f, hid_t dxpl_id, const void UNUSED *_lt_key, haddr_t addr, H5O_link_t lnk; /* Link to insert */ const char *name; /* Name of source object */ H5G_entry_t tmp_src_ent; /* Temperary copy. Change will not affect the cache */ + H5O_type_t obj_type; /* Target object type */ + H5G_copy_file_ud_t *cpy_udata; /* Copy file udata */ + H5G_obj_create_t gcrt_info; /* Group creation info */ /* expand soft link */ if(H5G_CACHED_SLINK == src_ent->type && cpy_info->expand_soft_link) { @@ -1281,15 +1285,27 @@ H5G_node_copy(H5F_t *f, hid_t dxpl_id, const void UNUSED *_lt_key, haddr_t addr, tmp_src_oloc.addr = src_ent->header; /* Copy the shared object from source to destination */ - if(H5O_copy_header_map(&tmp_src_oloc, &new_dst_oloc, dxpl_id, cpy_info, TRUE) < 0) + if(H5O_copy_header_map(&tmp_src_oloc, &new_dst_oloc, dxpl_id, + cpy_info, TRUE, &obj_type, (void **)&cpy_udata) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, H5_ITER_ERROR, "unable to copy object") + /* Set up object creation info for symbol table insertion. Only + * case so far is for inserting old-style groups (for caching stab + * info). */ + if(obj_type == H5O_TYPE_GROUP) { + gcrt_info.gcpl_id = H5P_DEFAULT; + gcrt_info.cache_type = cpy_udata->cache_type; + gcrt_info.cache = cpy_udata->cache; + } /* end if */ + /* Construct link information for eventual insertion */ lnk.type = H5L_TYPE_HARD; lnk.u.hard.addr = new_dst_oloc.addr; } /* ( H5F_addr_defined(src_ent->header)) */ else if(H5G_CACHED_SLINK == src_ent->type) { /* it is a soft link */ + /* Set object type to unknown */ + obj_type = H5O_TYPE_UNKNOWN; /* Construct link information for eventual insertion */ lnk.type = H5L_TYPE_SOFT; @@ -1313,7 +1329,9 @@ H5G_node_copy(H5F_t *f, hid_t dxpl_id, const void UNUSED *_lt_key, haddr_t addr, /* Insert the new object in the destination file's group */ /* (Don't increment the link count - that's already done above for hard links) */ - if(H5G_stab_insert_real(udata->dst_file, udata->dst_stab, name, &lnk, dxpl_id) < 0) + if(H5G_stab_insert_real(udata->dst_file, udata->dst_stab, name, &lnk, + obj_type, (obj_type == H5O_TYPE_GROUP ? &gcrt_info : NULL), + dxpl_id) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, H5_ITER_ERROR, "unable to insert the name") /* Reset metadata tag */ diff --git a/src/H5Gobj.c b/src/H5Gobj.c index 0dcf015..ce11990 100644 --- a/src/H5Gobj.c +++ b/src/H5Gobj.c @@ -126,7 +126,8 @@ static herr_t H5G_obj_remove_update_linfo(H5O_loc_t *oloc, H5O_linfo_t *linfo, *------------------------------------------------------------------------- */ herr_t -H5G_obj_create(H5F_t *f, hid_t dxpl_id, hid_t gcpl_id, H5O_loc_t *oloc/*out*/) +H5G_obj_create(H5F_t *f, hid_t dxpl_id, H5G_obj_create_t *gcrt_info, + H5O_loc_t *oloc/*out*/) { H5P_genplist_t *gc_plist; /* Group creation property list */ H5O_ginfo_t ginfo; /* Group info */ @@ -143,7 +144,7 @@ H5G_obj_create(H5F_t *f, hid_t dxpl_id, hid_t gcpl_id, H5O_loc_t *oloc/*out*/) HDassert(oloc); /* Get the property list */ - if(NULL == (gc_plist = (H5P_genplist_t *)H5I_object(gcpl_id))) + if(NULL == (gc_plist = (H5P_genplist_t *)H5I_object(gcrt_info->gcpl_id))) HGOTO_ERROR(H5E_SYM, H5E_BADTYPE, FAIL, "not a property list") /* Get the group info property */ @@ -159,7 +160,8 @@ H5G_obj_create(H5F_t *f, hid_t dxpl_id, hid_t gcpl_id, H5O_loc_t *oloc/*out*/) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't get group info") /* Call the "real" group creation routine now */ - if(H5G_obj_create_real(f, dxpl_id, &ginfo, &linfo, &pline, gcpl_id, oloc) < 0) + if(H5G_obj_create_real(f, dxpl_id, &ginfo, &linfo, &pline, gcrt_info, oloc) + < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTCREATE, FAIL, "unable to create group") done: @@ -182,11 +184,12 @@ done: */ herr_t H5G_obj_create_real(H5F_t *f, hid_t dxpl_id, const H5O_ginfo_t *ginfo, - const H5O_linfo_t *linfo, const H5O_pline_t *pline, hid_t gcpl_id, - H5O_loc_t *oloc/*out*/) + const H5O_linfo_t *linfo, const H5O_pline_t *pline, + H5G_obj_create_t *gcrt_info, H5O_loc_t *oloc/*out*/) { size_t hdr_size; /* Size of object header to request */ hbool_t use_latest_format; /* Flag indicating the new group format should be used */ + hid_t gcpl_id = gcrt_info->gcpl_id; /* Group creation property list ID */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(H5G_obj_create_real, FAIL) @@ -285,6 +288,11 @@ H5G_obj_create_real(H5F_t *f, hid_t dxpl_id, const H5O_ginfo_t *ginfo, /* The group doesn't currently have a 'stab' message, go create one */ if(H5G_stab_create(oloc, dxpl_id, ginfo, &stab) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to create symbol table") + + /* Cache the symbol table information */ + gcrt_info->cache_type = H5G_CACHED_STAB; + gcrt_info->cache.stab.btree_addr = stab.btree_addr; + gcrt_info->cache.stab.heap_addr = stab.heap_addr; } /* end else */ done: @@ -421,7 +429,8 @@ H5G_obj_stab_to_new_cb(const H5O_link_t *lnk, void *_udata) /* Insert link into group */ /* (Casting away const OK - QAK) */ - if(H5G_obj_insert(udata->grp_oloc, lnk->name, (H5O_link_t *)lnk, FALSE, udata->dxpl_id) < 0) + if(H5G_obj_insert(udata->grp_oloc, lnk->name, (H5O_link_t *)lnk, FALSE, + H5O_TYPE_UNKNOWN, NULL, udata->dxpl_id) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINSERT, H5_ITER_ERROR, "can't insert link into group") done: @@ -448,7 +457,7 @@ done: */ herr_t H5G_obj_insert(const H5O_loc_t *grp_oloc, const char *name, H5O_link_t *obj_lnk, - hbool_t adj_link, hid_t dxpl_id) + hbool_t adj_link, H5O_type_t obj_type, const void *crt_info, hid_t dxpl_id) { H5O_pline_t tmp_pline; /* Pipeline message */ H5O_pline_t *pline = NULL; /* Pointer to pipeline message */ @@ -572,7 +581,8 @@ H5G_obj_insert(const H5O_loc_t *grp_oloc, const char *name, H5O_link_t *obj_lnk, * group is in the "new format" now and the link info should be * set up, etc. */ - if(H5G_obj_insert(grp_oloc, name, obj_lnk, adj_link, dxpl_id) < 0) + if(H5G_obj_insert(grp_oloc, name, obj_lnk, adj_link, obj_type, + crt_info, dxpl_id) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINSERT, FAIL, "unable to insert link into group") /* Done with insertion now */ @@ -585,7 +595,8 @@ H5G_obj_insert(const H5O_loc_t *grp_oloc, const char *name, H5O_link_t *obj_lnk, /* Insert into symbol table or "dense" storage */ if(use_old_format) { /* Insert into symbol table */ - if(H5G_stab_insert(grp_oloc, name, obj_lnk, dxpl_id) < 0) + if(H5G_stab_insert(grp_oloc, name, obj_lnk, obj_type, crt_info, dxpl_id) + < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINSERT, FAIL, "unable to insert entry into symbol table") } /* end if */ else { diff --git a/src/H5Goh.c b/src/H5Goh.c index 4dc569c..fc7a1df 100644 --- a/src/H5Goh.c +++ b/src/H5Goh.c @@ -263,7 +263,7 @@ H5O_group_create(H5F_t *f, void *_crt_info, H5G_loc_t *obj_loc, hid_t dxpl_id) HDassert(obj_loc); /* Create the the group */ - if(NULL == (grp = H5G_create(f, crt_info->gcpl_id, dxpl_id))) + if(NULL == (grp = H5G_create(f, crt_info, dxpl_id))) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, NULL, "unable to create group") /* Set up the new group's location */ diff --git a/src/H5Gpkg.h b/src/H5Gpkg.h index 82aa2e0..f9bc41e 100644 --- a/src/H5Gpkg.h +++ b/src/H5Gpkg.h @@ -200,8 +200,10 @@ typedef struct H5G_bt_common_t { */ typedef struct H5G_bt_ins_t { /* downward */ - H5G_bt_common_t common; /* Common info for B-tree user data (must be first) */ + H5G_bt_common_t common; /* Common info for B-tree user data (must be first) */ const H5O_link_t *lnk; /* Link to insert into table */ + H5O_type_t obj_type; /* Type of object being inserted */ + const void *crt_info; /* Creation info for object being inserted */ } H5G_bt_ins_t; /* @@ -331,10 +333,19 @@ typedef herr_t (*H5G_traverse_t)(H5G_loc_t *grp_loc/*in*/, const char *name, H5G_own_loc_t *own_loc/*out*/); /* Typedef for group creation operation */ -typedef struct { +typedef struct H5G_obj_create_t{ hid_t gcpl_id; /* Group creation property list */ + H5G_cache_type_t cache_type; /* Type of symbol table entry cache */ + H5G_cache_t cache; /* Cached data for symbol table entry */ } H5G_obj_create_t; +/* Callback information for copying groups */ +typedef struct H5G_copy_file_ud_t { + H5O_copy_file_ud_common_t common; /* Shared information (must be first) */ + H5G_cache_type_t cache_type; /* Type of symbol table entry cache */ + H5G_cache_t cache; /* Cached data for symbol table entry */ +} H5G_copy_file_ud_t; + /*****************************/ /* Package Private Variables */ @@ -367,7 +378,8 @@ H5FL_EXTERN(H5G_shared_t); /* * General group routines */ -H5_DLL H5G_t *H5G_create(H5F_t *file, hid_t gcpl_id, hid_t dxpl_id); +H5_DLL H5G_t *H5G_create(H5F_t *file, H5G_obj_create_t *gcrt_info, + hid_t dxpl_id); H5_DLL H5G_t *H5G_create_named(const H5G_loc_t *loc, const char *name, hid_t lcpl_id, hid_t gcpl_id, hid_t gapl_id, hid_t dxpl_id); H5_DLL H5G_t *H5G_open_name(const H5G_loc_t *loc, const char *name, @@ -403,9 +415,11 @@ H5_DLL herr_t H5G_stab_create(H5O_loc_t *grp_oloc, hid_t dxpl_id, const H5O_ginfo_t *ginfo, H5O_stab_t *stab); H5_DLL herr_t H5G_stab_create_components(H5F_t *f, H5O_stab_t *stab, size_t size_hint, hid_t dxpl_id); H5_DLL herr_t H5G_stab_insert(const H5O_loc_t *grp_oloc, const char *name, - H5O_link_t *obj_lnk, hid_t dxpl_id); + H5O_link_t *obj_lnk, H5O_type_t obj_type, const void *crt_info, + hid_t dxpl_id); H5_DLL herr_t H5G_stab_insert_real(H5F_t *f, H5O_stab_t *stab, const char *name, - H5O_link_t *obj_lnk, hid_t dxpl_id); + H5O_link_t *obj_lnk, H5O_type_t obj_type, const void *crt_info, + hid_t dxpl_id); H5_DLL herr_t H5G_stab_delete(H5F_t *f, hid_t dxpl_id, const H5O_stab_t *stab); H5_DLL herr_t H5G_stab_iterate(const H5O_loc_t *oloc, hid_t dxpl_id, H5_iter_order_t order, hsize_t skip, hsize_t *last_lnk, H5G_lib_iterate_t op, void *op_data); @@ -443,7 +457,8 @@ H5_DLL herr_t H5G_ent_decode_vec(const H5F_t *f, const uint8_t **pp, H5_DLL herr_t H5G_ent_encode_vec(const H5F_t *f, uint8_t **pp, const H5G_entry_t *ent, unsigned n); H5_DLL herr_t H5G_ent_convert(H5F_t *f, hid_t dxpl_id, H5HL_t *heap, - const char *name, const H5O_link_t *lnk, H5G_entry_t *ent); + const char *name, const H5O_link_t *lnk, H5O_type_t obj_type, + const void *crt_info, H5G_entry_t *ent); H5_DLL herr_t H5G_ent_debug(const H5G_entry_t *ent, FILE * stream, int indent, int fwidth, const H5HL_t *heap); @@ -539,15 +554,17 @@ H5_DLL H5G_obj_t H5G_dense_get_type_by_idx(H5F_t *f, hid_t dxpl_id, #endif /* H5_NO_DEPRECATED_SYMBOLS */ /* Functions that understand group objects */ -H5_DLL herr_t H5G_obj_create(H5F_t *f, hid_t dxpl_id, hid_t gcpl_id, - H5O_loc_t *oloc/*out*/); -H5_DLL herr_t H5G_obj_create_real(H5F_t *f, hid_t dxpl_id, const H5O_ginfo_t *ginfo, - const H5O_linfo_t *linfo, const H5O_pline_t *pline, hid_t gcpl_id, +H5_DLL herr_t H5G_obj_create(H5F_t *f, hid_t dxpl_id, + H5G_obj_create_t *gcrt_info, H5O_loc_t *oloc/*out*/); +H5_DLL herr_t H5G_obj_create_real(H5F_t *f, hid_t dxpl_id, + const H5O_ginfo_t *ginfo, const H5O_linfo_t *linfo, + const H5O_pline_t *pline, H5G_obj_create_t *gcrt_info, H5O_loc_t *oloc/*out*/); H5_DLL htri_t H5G_obj_get_linfo(const H5O_loc_t *grp_oloc, H5O_linfo_t *linfo, hid_t dxpl_id); H5_DLL herr_t H5G_obj_insert(const H5O_loc_t *grp_oloc, const char *name, - H5O_link_t *obj_lnk, hbool_t adj_link, hid_t dxpl_id); + H5O_link_t *obj_lnk, hbool_t adj_link, H5O_type_t obj_type, + const void *crt_info, hid_t dxpl_id); H5_DLL herr_t H5G_obj_iterate(const H5O_loc_t *grp_oloc, H5_index_t idx_type, H5_iter_order_t order, hsize_t skip, hsize_t *last_lnk, H5G_lib_iterate_t op, void *op_data, hid_t dxpl_id); @@ -576,7 +593,7 @@ H5_DLL H5RS_str_t *H5G_build_fullpath_refstr_str(H5RS_str_t *path_r, const char H5_DLL herr_t H5G_loc_root(H5F_t *f, H5G_loc_t *loc); H5_DLL herr_t H5G_loc_copy(H5G_loc_t *dst, const H5G_loc_t *src, H5_copy_depth_t depth); H5_DLL herr_t H5G_loc_insert(H5G_loc_t *grp_loc, const char *name, - H5G_loc_t *obj_loc, hid_t dxpl_id); + H5G_loc_t *obj_loc, H5O_type_t obj_type, const void *crt_info, hid_t dxpl_id); /* Testing functions */ #ifdef H5G_TESTING diff --git a/src/H5Gprivate.h b/src/H5Gprivate.h index 7b09423..05de2ba 100644 --- a/src/H5Gprivate.h +++ b/src/H5Gprivate.h @@ -141,11 +141,6 @@ typedef struct { H5G_name_t *path; /* Group hierarchy path */ } H5G_loc_t; -/* Callback information for copying groups */ -typedef struct H5G_copy_file_ud_t { - H5O_copy_file_ud_common_t common; /* Shared information (must be first) */ -} H5G_copy_file_ud_t; - typedef struct H5G_t H5G_t; typedef struct H5G_shared_t H5G_shared_t; typedef struct H5G_entry_t H5G_entry_t; diff --git a/src/H5Groot.c b/src/H5Groot.c index f754f29..a79a5dd 100644 --- a/src/H5Groot.c +++ b/src/H5Groot.c @@ -97,6 +97,7 @@ herr_t H5G_mkroot(H5F_t *f, hid_t dxpl_id, hbool_t create_root) { H5G_loc_t root_loc; /* Root location information */ + H5G_obj_create_t gcrt_info; /* Root group object creation info */ htri_t stab_exists = -1; /* Whether the symbol table exists */ hbool_t sblock_dirty = FALSE; /* Whether superblock was dirtied */ hbool_t path_init = FALSE; /* Whether path was initialized */ @@ -140,7 +141,9 @@ H5G_mkroot(H5F_t *f, hid_t dxpl_id, hbool_t create_root) if(create_root) { /* Create root group */ /* (Pass the FCPL which is a sub-class of the group creation property class) */ - if(H5G_obj_create(f, dxpl_id, f->shared->fcpl_id, root_loc.oloc/*out*/) < 0) + gcrt_info.gcpl_id = f->shared->fcpl_id; + gcrt_info.cache_type = H5G_NOTHING_CACHED; + if(H5G_obj_create(f, dxpl_id, &gcrt_info, root_loc.oloc/*out*/) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to create group entry") if(1 != H5O_link(root_loc.oloc, 1, dxpl_id)) HGOTO_ERROR(H5E_SYM, H5E_LINKCOUNT, FAIL, "internal error (wrong link count)") @@ -156,7 +159,9 @@ H5G_mkroot(H5F_t *f, hid_t dxpl_id, hbool_t create_root) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "can't allocate space for symbol table entry") /* Initialize the root group symbol table entry */ - f->shared->sblock->root_ent->type = H5G_NOTHING_CACHED; /* We will cache the stab later */ + f->shared->sblock->root_ent->type = gcrt_info.cache_type; + if(gcrt_info.cache_type != H5G_NOTHING_CACHED) + f->shared->sblock->root_ent->cache = gcrt_info.cache; f->shared->sblock->root_ent->name_off = 0; /* No name (yet) */ f->shared->sblock->root_ent->header = root_loc.oloc->addr; } /* end if */ diff --git a/src/H5Gstab.c b/src/H5Gstab.c index 0566725..7d0ad48 100644 --- a/src/H5Gstab.c +++ b/src/H5Gstab.c @@ -221,7 +221,8 @@ done: */ herr_t H5G_stab_insert_real(H5F_t *f, H5O_stab_t *stab, const char *name, - H5O_link_t *obj_lnk, hid_t dxpl_id) + H5O_link_t *obj_lnk, H5O_type_t obj_type, const void *crt_info, + hid_t dxpl_id) { H5HL_t *heap = NULL; /* Pointer to local heap */ H5G_bt_ins_t udata; /* Data to pass through B-tree */ @@ -243,6 +244,8 @@ H5G_stab_insert_real(H5F_t *f, H5O_stab_t *stab, const char *name, udata.common.name = name; udata.common.heap = heap; udata.lnk = obj_lnk; + udata.obj_type = obj_type; + udata.crt_info = crt_info; /* Insert into symbol table */ if(H5B_insert(f, dxpl_id, H5B_SNODE, stab->btree_addr, &udata) < 0) @@ -273,7 +276,8 @@ done: *------------------------------------------------------------------------- */ herr_t -H5G_stab_insert(const H5O_loc_t *grp_oloc, const char *name, H5O_link_t *obj_lnk, +H5G_stab_insert(const H5O_loc_t *grp_oloc, const char *name, + H5O_link_t *obj_lnk, H5O_type_t obj_type, const void *crt_info, hid_t dxpl_id) { H5O_stab_t stab; /* Symbol table message */ @@ -290,7 +294,8 @@ H5G_stab_insert(const H5O_loc_t *grp_oloc, const char *name, H5O_link_t *obj_lnk if(NULL == H5O_msg_read(grp_oloc, H5O_STAB_ID, &stab, dxpl_id)) HGOTO_ERROR(H5E_SYM, H5E_BADMESG, FAIL, "not a symbol table") - if(H5G_stab_insert_real(grp_oloc->file, &stab, name, obj_lnk, dxpl_id) < 0) + if(H5G_stab_insert_real(grp_oloc->file, &stab, name, obj_lnk, obj_type, + crt_info, dxpl_id) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, H5_ITER_ERROR, "unable to insert the name") done: diff --git a/src/H5Gtraverse.c b/src/H5Gtraverse.c index d8cf0f3..4016068 100644 --- a/src/H5Gtraverse.c +++ b/src/H5Gtraverse.c @@ -735,6 +735,7 @@ H5G_traverse_real(const H5G_loc_t *_loc, const char *name, unsigned target, const H5O_ginfo_t *ginfo; /* Group info settings for new group */ const H5O_linfo_t *linfo; /* Link info settings for new group */ const H5O_pline_t *pline; /* Filter pipeline settings for new group */ + H5G_obj_create_t gcrt_info; /* Group creation info */ /* Check for the parent group having a group info message */ /* (OK if not found) */ @@ -788,11 +789,16 @@ H5G_traverse_real(const H5G_loc_t *_loc, const char *name, unsigned target, /* Create the intermediate group */ /* XXX: Should we allow user to control the group creation params here? -QAK */ - if(H5G_obj_create_real(grp_oloc.file, dxpl_id, ginfo, linfo, pline, H5P_GROUP_CREATE_DEFAULT, obj_loc.oloc/*out*/) < 0) + gcrt_info.gcpl_id = H5P_GROUP_CREATE_DEFAULT; + gcrt_info.cache_type = H5G_NOTHING_CACHED; + HDmemset(&gcrt_info.cache, 0, sizeof(gcrt_info.cache)); + if(H5G_obj_create_real(grp_oloc.file, dxpl_id, ginfo, linfo, + pline, &gcrt_info, obj_loc.oloc/*out*/) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to create group entry") /* Insert new group into current group's symbol table */ - if(H5G_loc_insert(&grp_loc, H5G_comp_g, &obj_loc, dxpl_id) < 0) + if(H5G_loc_insert(&grp_loc, H5G_comp_g, &obj_loc, + H5O_TYPE_GROUP, &gcrt_info, dxpl_id) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINSERT, FAIL, "unable to insert intermediate group") /* Close new group */ diff --git a/src/H5L.c b/src/H5L.c index 42399fb..64e194a 100644 --- a/src/H5L.c +++ b/src/H5L.c @@ -1716,7 +1716,10 @@ H5L_link_cb(H5G_loc_t *grp_loc/*in*/, const char *name, const H5O_link_t UNUSED udata->lnk->name = (char *)name; /* Insert link into group */ - if(H5G_obj_insert(grp_loc->oloc, name, udata->lnk, TRUE, udata->dxpl_id) < 0) + if(H5G_obj_insert(grp_loc->oloc, name, udata->lnk, TRUE, + udata->ocrt_info ? udata->ocrt_info->obj_type : H5O_TYPE_UNKNOWN, + udata->ocrt_info ? udata->ocrt_info->crt_info : NULL, + udata->dxpl_id) < 0) HGOTO_ERROR(H5E_LINK, H5E_CANTINIT, FAIL, "unable to create new link for object") /* Set object's path if it has been passed in and is not set */ @@ -2418,7 +2421,8 @@ H5L_move_dest_cb(H5G_loc_t *grp_loc/*in*/, const char *name, udata->lnk->name = (char *)name; /* Insert the link into the group */ - if(H5G_obj_insert(grp_loc->oloc, name, udata->lnk, TRUE, udata->dxpl_id) < 0) + if(H5G_obj_insert(grp_loc->oloc, name, udata->lnk, TRUE, H5O_TYPE_UNKNOWN, + NULL, udata->dxpl_id) < 0) HGOTO_ERROR(H5E_LINK, H5E_CANTINIT, FAIL, "unable to create new link to object") /* If the link was a user-defined link, call its move callback if it has one */ diff --git a/src/H5Ocopy.c b/src/H5Ocopy.c index 7a10765..1ecd16f 100644 --- a/src/H5Ocopy.c +++ b/src/H5Ocopy.c @@ -66,7 +66,7 @@ static herr_t H5O_copy_free_addrmap_cb(void *item, void *key, void *op_data); static herr_t H5O_copy_header_real(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out */, - hid_t dxpl_id, H5O_copy_t *cpy_info); + hid_t dxpl_id, H5O_copy_t *cpy_info, H5O_type_t *obj_type, void **udata); static herr_t H5O_copy_header(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out */, hid_t dxpl_id, unsigned cpy_option); static herr_t H5O_copy_obj(H5G_loc_t *src_loc, H5G_loc_t *dst_loc, @@ -285,7 +285,7 @@ done: */ static herr_t H5O_copy_header_real(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out */, - hid_t dxpl_id, H5O_copy_t *cpy_info) + hid_t dxpl_id, H5O_copy_t *cpy_info, H5O_type_t *obj_type, void **udata) { H5O_addr_map_t *addr_map = NULL; /* Address mapping of object copied */ H5O_t *oh_src = NULL; /* Object header for source object */ @@ -299,7 +299,7 @@ H5O_copy_header_real(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out */, H5O_mesg_t *mesg_dst; /* Message in source object header */ const H5O_msg_class_t *copy_type; /* Type of message to use for copying */ const H5O_obj_class_t *obj_class = NULL; /* Type of object we are copying */ - void *udata = NULL; /* User data for passing to message callbacks */ + void *cpy_udata = NULL; /* User data for passing to message callbacks */ uint64_t dst_oh_size; /* Total size of the destination OH */ size_t dst_oh_null; /* Size of the null message to add to destination OH */ unsigned dst_oh_gap; /* Size of the gap in chunk #0 of destination OH */ @@ -325,7 +325,7 @@ H5O_copy_header_real(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out */, /* Retrieve user data for particular type of object to copy */ if(obj_class->get_copy_file_udata && - (NULL == (udata = (obj_class->get_copy_file_udata)()))) + (NULL == (cpy_udata = (obj_class->get_copy_file_udata)()))) HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, FAIL, "unable to retrieve copy user data") /* Flush any dirty messages in source object header to update the header chunks */ @@ -404,7 +404,8 @@ H5O_copy_header_real(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out */, H5O_LOAD_NATIVE(oloc_src->file, dxpl_id, 0, oh_src, mesg_src, FAIL) /* Perform "pre copy" operation on message */ - if((copy_type->pre_copy_file)(oloc_src->file, mesg_src->native, &(deleted[mesgno]), cpy_info, udata) < 0) + if((copy_type->pre_copy_file)(oloc_src->file, mesg_src->native, + &(deleted[mesgno]), cpy_info, cpy_udata) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, FAIL, "unable to perform 'pre copy' operation on message") /* Check if the message should be deleted in the destination */ @@ -478,7 +479,7 @@ H5O_copy_header_real(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out */, recompute_size = FALSE; if((mesg_dst->native = H5O_msg_copy_file(copy_type, oloc_src->file, mesg_src->native, oloc_dst->file, - &recompute_size, cpy_info, udata, dxpl_id)) == NULL) + &recompute_size, cpy_info, cpy_udata, dxpl_id)) == NULL) HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, FAIL, "unable to copy object header message") /* Check if new message is shared */ @@ -680,6 +681,8 @@ H5O_copy_header_real(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out */, addr_map->dst_addr = oloc_dst->addr; addr_map->is_locked = TRUE; /* We've locked the object currently */ addr_map->inc_ref_count = 0; /* Start with no additional ref counts to add */ + addr_map->obj_class = obj_class; + addr_map->udata = cpy_udata; /* Insert into skip list */ if(H5SL_insert(cpy_info->map_list, addr_map, &(addr_map->src_obj_pos)) < 0) @@ -742,7 +745,7 @@ H5O_copy_header_real(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out */, if(H5AC_insert_entry(oloc_dst->file, dxpl_id, H5AC_OHDR, oloc_dst->addr, oh_dst, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTINSERT, FAIL, "unable to cache object header") oh_dst = NULL; - + /* Reset metadat tag */ H5_END_TAG(FAIL); @@ -750,6 +753,13 @@ H5O_copy_header_real(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out */, if(H5AC_retag_copied_metadata(oloc_dst->file, oloc_dst->addr) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTTAG, FAIL, "unable to re-tag metadata entries") + /* Set obj_type and udata, if requested */ + if(obj_type) { + HDassert(udata); + *obj_type = obj_class->type; + *udata = cpy_udata; + } /* end if */ + done: /* Free deleted array */ if(deleted) @@ -763,13 +773,6 @@ done: if(ret_value < 0 && oh_dst && H5O_free(oh_dst) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTFREE, FAIL, "unable to destroy object header data") - /* Release user data for particular type of object to copy */ - if(udata) { - HDassert(obj_class); - HDassert(obj_class->free_copy_file_udata); - (obj_class->free_copy_file_udata)(udata); - } /* end if */ - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) } /* end H5O_copy_header_real() */ @@ -789,7 +792,8 @@ done: */ herr_t H5O_copy_header_map(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out */, - hid_t dxpl_id, H5O_copy_t *cpy_info, hbool_t inc_depth) + hid_t dxpl_id, H5O_copy_t *cpy_info, hbool_t inc_depth, + H5O_type_t *obj_type, void **udata) { H5O_addr_map_t *addr_map = NULL; /* Address mapping of object copied */ H5_obj_t src_obj_pos; /* Position of source object */ @@ -823,7 +827,8 @@ H5O_copy_header_map(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out */, cpy_info->curr_depth++; /* Copy object referred to */ - if(H5O_copy_header_real(oloc_src, oloc_dst, dxpl_id, cpy_info) < 0) + if(H5O_copy_header_real(oloc_src, oloc_dst, dxpl_id, cpy_info, obj_type, + udata) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, FAIL, "unable to copy object") /* Check for incrementing the depth of copy */ @@ -840,6 +845,13 @@ H5O_copy_header_map(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out */, /* Object has already been copied, set its address in destination file */ oloc_dst->addr = addr_map->dst_addr; + /* Return saved obj_type and udata, if requested */ + if(obj_type) { + HDassert(udata); + *obj_type = addr_map->obj_class->type; + *udata = addr_map->udata; + } /* end if */ + /* If the object is locked currently (because we are copying a group * hierarchy and this is a link to a group higher in the hierarchy), * increment it's deferred reference count instead of incrementing the @@ -883,12 +895,21 @@ done: REVISION LOG --------------------------------------------------------------------------*/ static herr_t -H5O_copy_free_addrmap_cb(void *item, void UNUSED *key, void UNUSED *op_data) +H5O_copy_free_addrmap_cb(void *_item, void UNUSED *key, void UNUSED *op_data) { + H5O_addr_map_t *item = (H5O_addr_map_t *)_item; + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_copy_free_addrmap_cb) HDassert(item); + /* Release user data for particular type of object */ + if(item->udata) { + HDassert(item->obj_class); + HDassert(item->obj_class->free_copy_file_udata); + (item->obj_class->free_copy_file_udata)(item->udata); + } /* end if */ + /* Release the item */ item = H5FL_FREE(H5O_addr_map_t, item); @@ -947,7 +968,8 @@ H5O_copy_header(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out */, HGOTO_ERROR(H5E_SLIST, H5E_CANTCREATE, FAIL, "cannot make skip list") /* copy the object from the source file to the destination file */ - if(H5O_copy_header_real(oloc_src, oloc_dst, dxpl_id, &cpy_info) < 0) + if(H5O_copy_header_real(oloc_src, oloc_dst, dxpl_id, &cpy_info, NULL, NULL) + < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, FAIL, "unable to copy object") done: @@ -1057,7 +1079,8 @@ H5O_copy_obj_by_ref(H5O_loc_t *src_oloc, hid_t dxpl_id, H5O_loc_t *dst_oloc, HDassert(dst_oloc); /* Perform the copy, or look up existing copy */ - if((ret_value = H5O_copy_header_map(src_oloc, dst_oloc, dxpl_id, cpy_info, FALSE)) < 0) + if((ret_value = H5O_copy_header_map(src_oloc, dst_oloc, dxpl_id, cpy_info, + FALSE, NULL, NULL)) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, FAIL, "unable to copy object") /* Check if a new valid object is copied to the destination */ @@ -1078,6 +1101,11 @@ H5O_copy_obj_by_ref(H5O_loc_t *src_oloc, hid_t dxpl_id, H5O_loc_t *dst_oloc, sprintf(tmp_obj_name, "~obj_pointed_by_%llu", (unsigned long long)dst_oloc->addr); /* Create a link to the newly copied object */ + /* Note: since H5O_copy_header_map actually copied the target object, it + * must exist either in cache or on disk, therefore it is is safe to not + * pass the obj_type and udata fields returned by H5O_copy_header_map. + * This could be changed in the future to slightly improve performance + * --NAF */ if(H5L_link(dst_root_loc, tmp_obj_name, &new_loc, H5P_DEFAULT, H5P_DEFAULT, dxpl_id) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to insert link") diff --git a/src/H5Opkg.h b/src/H5Opkg.h index 6ff20b2..68b70a5 100644 --- a/src/H5Opkg.h +++ b/src/H5Opkg.h @@ -333,6 +333,8 @@ typedef struct H5O_addr_map_t { haddr_t dst_addr; /* Address of object in destination file */ hbool_t is_locked; /* Indicate that the destination object is locked currently */ hsize_t inc_ref_count; /* Number of deferred increments to reference count */ + H5O_obj_class_t *obj_class; /* Object class */ + void *udata; /* Object class copy file udata */ } H5O_addr_map_t; /* Stack of continuation messages to interpret */ diff --git a/src/H5Oprivate.h b/src/H5Oprivate.h index 3d5aa86..0d10fb9 100644 --- a/src/H5Oprivate.h +++ b/src/H5Oprivate.h @@ -792,7 +792,8 @@ H5_DLL herr_t H5O_msg_unlock(const H5O_loc_t *loc, unsigned type_id, hid_t dxpl_ /* Object copying routines */ H5_DLL herr_t H5O_copy_header_map(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out */, - hid_t dxpl_id, H5O_copy_t *cpy_info, hbool_t inc_depth); + hid_t dxpl_id, H5O_copy_t *cpy_info, hbool_t inc_depth, + H5O_type_t *obj_type, void **udata); H5_DLL herr_t H5O_copy_expand_ref(H5F_t *file_src, void *_src_ref, hid_t dxpl_id, H5F_t *file_dst, void *_dst_ref, size_t ref_count, H5R_type_t ref_type, H5O_copy_t *cpy_info); diff --git a/src/H5Oshared.c b/src/H5Oshared.c index ad7e594..68fc4ad 100644 --- a/src/H5Oshared.c +++ b/src/H5Oshared.c @@ -612,7 +612,8 @@ H5O_shared_copy_file(H5F_t UNUSED *file_src, H5F_t *file_dst, dst_oloc.file = file_dst; src_oloc.file = shared_src->file; src_oloc.addr = shared_src->u.loc.oh_addr; - if(H5O_copy_header_map(&src_oloc, &dst_oloc, dxpl_id, cpy_info, FALSE) < 0) + if(H5O_copy_header_map(&src_oloc, &dst_oloc, dxpl_id, cpy_info, FALSE, + NULL, NULL) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, FAIL, "unable to copy object") /* Set up destination message's shared info */ diff --git a/src/H5Ostab.c b/src/H5Ostab.c index 4829e93..e29a856 100644 --- a/src/H5Ostab.c +++ b/src/H5Ostab.c @@ -44,7 +44,7 @@ static size_t H5O_stab_size(const H5F_t *f, hbool_t disable_shared, const void * static herr_t H5O_stab_free(void *_mesg); static herr_t H5O_stab_delete(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, void *_mesg); static void *H5O_stab_copy_file(H5F_t *file_src, void *native_src, - H5F_t *file_dst, hbool_t *recompute_size, H5O_copy_t *cpy_info, void *udata, + H5F_t *file_dst, hbool_t *recompute_size, H5O_copy_t *cpy_info, void *_udata, hid_t dxpl_id); static herr_t H5O_stab_post_copy_file(const H5O_loc_t *src_oloc, const void *mesg_src, H5O_loc_t *dst_oloc, void *mesg_dst, hid_t dxpl_id, H5O_copy_t *cpy_info); @@ -307,11 +307,12 @@ done: */ static void * H5O_stab_copy_file(H5F_t *file_src, void *native_src, H5F_t *file_dst, - hbool_t UNUSED *recompute_size, H5O_copy_t UNUSED *cpy_info, void UNUSED *udata, + hbool_t UNUSED *recompute_size, H5O_copy_t UNUSED *cpy_info, void *_udata, hid_t dxpl_id) { H5O_stab_t *stab_src = (H5O_stab_t *) native_src; H5O_stab_t *stab_dst = NULL; + H5G_copy_file_ud_t *udata = (H5G_copy_file_ud_t *)_udata; size_t size_hint; /* Local heap initial size */ void *ret_value; /* Return value */ @@ -328,7 +329,7 @@ H5O_stab_copy_file(H5F_t *file_src, void *native_src, H5F_t *file_dst, /* Get the old local heap's size and use that as the hint for the new heap */ if(H5HL_get_size(file_src, dxpl_id, stab_src->heap_addr, &size_hint) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGETSIZE, NULL, "can't query local heap size") - + /* Set copy metadata tag */ H5_BEGIN_TAG(dxpl_id, H5AC__COPIED_TAG, NULL); @@ -339,6 +340,11 @@ H5O_stab_copy_file(H5F_t *file_src, void *native_src, H5F_t *file_dst, /* Reset metadata tag */ H5_END_TAG(NULL); + /* Cache stab in udata */ + udata->cache_type = H5G_CACHED_STAB; + udata->cache.stab.btree_addr = stab_dst->btree_addr; + udata->cache.stab.heap_addr = stab_dst->heap_addr; + /* Set return value */ ret_value = stab_dst; diff --git a/src/H5Shyper.c b/src/H5Shyper.c index 628512f..4aa887b 100644 --- a/src/H5Shyper.c +++ b/src/H5Shyper.c @@ -140,7 +140,7 @@ H5FL_DEFINE_STATIC(H5S_hyper_span_info_t); static herr_t H5S_hyper_print_spans_helper(FILE *f, struct H5S_hyper_span_t *span,unsigned depth) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_hyper_print_spans_helper); + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_hyper_print_spans_helper) while(span) { HDfprintf(f,"%s: depth=%u, span=%p, (%d, %d), nelem=%u, pstride=%u\n",FUNC,depth,span,(int)span->low,(int)span->high,(unsigned)span->nelem,(unsigned)span->pstride); @@ -151,30 +151,30 @@ H5S_hyper_print_spans_helper(FILE *f, struct H5S_hyper_span_t *span,unsigned dep span=span->next; } /* end while */ - FUNC_LEAVE_NOAPI(SUCCEED); + FUNC_LEAVE_NOAPI(SUCCEED) } herr_t H5S_hyper_print_spans(FILE *f, const struct H5S_hyper_span_info_t *span_lst) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_hyper_print_spans); + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_hyper_print_spans) if(span_lst!=NULL) { HDfprintf(f,"%s: spans=%p, count=%u, scratch=%p, head=%p\n",FUNC,span_lst,span_lst->count,span_lst->scratch,span_lst->head); H5S_hyper_print_spans_helper(f,span_lst->head,0); } /* end if */ - FUNC_LEAVE_NOAPI(SUCCEED); + FUNC_LEAVE_NOAPI(SUCCEED) } herr_t H5S_space_print_spans(FILE *f, const H5S_t *space) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_space_print_spans); + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_space_print_spans) H5S_hyper_print_spans(f,space->select.sel_info.hslab->span_lst); - FUNC_LEAVE_NOAPI(SUCCEED); + FUNC_LEAVE_NOAPI(SUCCEED) } static herr_t @@ -182,7 +182,7 @@ H5S_hyper_print_diminfo_helper(FILE *f, const char *field, unsigned ndims, const { unsigned u; /* Local index variable */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_hyper_print_diminfo_helper); + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_hyper_print_diminfo_helper) if(dinfo!=NULL) { HDfprintf(f,"%s: %s: start=[",FUNC,field); @@ -201,18 +201,18 @@ H5S_hyper_print_diminfo_helper(FILE *f, const char *field, unsigned ndims, const else HDfprintf(f,"%s: %s==NULL\n",FUNC,field); - FUNC_LEAVE_NOAPI(SUCCEED); + FUNC_LEAVE_NOAPI(SUCCEED) } herr_t H5S_hyper_print_diminfo(FILE *f, const H5S_t *space) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_hyper_print_diminfo); + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_hyper_print_diminfo) H5S_hyper_print_diminfo_helper(f,"opt_diminfo",space->extent.rank,space->select.sel_info.hslab->opt_diminfo); H5S_hyper_print_diminfo_helper(f,"app_diminfo",space->extent.rank,space->select.sel_info.hslab->app_diminfo); - FUNC_LEAVE_NOAPI(SUCCEED); + FUNC_LEAVE_NOAPI(SUCCEED) } #endif /* H5S_HYPER_DEBUG */ @@ -232,8 +232,6 @@ H5S_hyper_print_diminfo(FILE *f, const H5S_t *space) * is used by the H5S_select_shape_same() code to avoid changing * the rank and appearance of the selection. * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t @@ -245,31 +243,31 @@ H5S_hyper_iter_init(H5S_sel_iter_t *iter, const H5S_t *space) unsigned u; /* Index variable */ int i; /* Index variable */ - FUNC_ENTER_NOAPI_NOFUNC(H5S_hyper_iter_init); + FUNC_ENTER_NOAPI_NOFUNC(H5S_hyper_iter_init) /* Check args */ - assert(space && H5S_SEL_HYPERSLABS==H5S_GET_SELECT_TYPE(space)); - assert(iter); + HDassert(space && H5S_SEL_HYPERSLABS == H5S_GET_SELECT_TYPE(space)); + HDassert(iter); /* Initialize the number of points to iterate over */ - iter->elmt_left=space->select.num_elem; - iter->u.hyp.iter_rank=0; + iter->elmt_left = space->select.num_elem; + iter->u.hyp.iter_rank = 0; /* Get the rank of the dataspace */ - rank=space->extent.rank; + rank = space->extent.rank; /* Set the temporary pointer to the dimension information */ - tdiminfo=space->select.sel_info.hslab->opt_diminfo; + tdiminfo = space->select.sel_info.hslab->opt_diminfo; /* Check for the special case of just one H5Sselect_hyperslab call made */ if(space->select.sel_info.hslab->diminfo_valid) { /* Initialize the information needed for regular hyperslab I/O */ const hsize_t *mem_size; /* Temporary pointer to dataspace extent's dimension sizes */ hsize_t acc; /* Accumulator for "flattened" dimension's sizes */ - unsigned cont_dim=0; /* # of contiguous dimensions */ + unsigned cont_dim = 0; /* # of contiguous dimensions */ /* Set the temporary pointer to the dataspace extent's dimension sizes */ - mem_size=space->extent.size; + mem_size = space->extent.size; /* * For a regular hyperslab to be contiguous up to some dimension, it @@ -295,7 +293,7 @@ H5S_hyper_iter_init(H5S_sel_iter_t *iter, const H5S_t *space) } /* end if */ /* Check if the regular selection can be "flattened" */ - if(cont_dim>0) { + if(cont_dim > 0) { unsigned last_dim_flattened = 1; /* Flag to indicate that the last dimension was flattened */ unsigned flat_rank = rank-cont_dim; /* Number of dimensions after flattening */ unsigned curr_dim; /* Current dimension */ @@ -320,7 +318,7 @@ H5S_hyper_iter_init(H5S_sel_iter_t *iter, const H5S_t *space) iter->u.hyp.diminfo[curr_dim].start = tdiminfo[i].start * acc; /* Special case for single block regular selections */ - if(tdiminfo[i].count==1) + if(tdiminfo[i].count == 1) iter->u.hyp.diminfo[curr_dim].stride = 1; else iter->u.hyp.diminfo[curr_dim].stride = tdiminfo[i].stride * acc; @@ -333,7 +331,7 @@ H5S_hyper_iter_init(H5S_sel_iter_t *iter, const H5S_t *space) last_dim_flattened = 0; /* Reset the "accumulator" for possible further dimension flattening */ - acc=1; + acc = 1; } /* end if */ else { /* All other dimensions */ @@ -351,13 +349,13 @@ H5S_hyper_iter_init(H5S_sel_iter_t *iter, const H5S_t *space) } /* end for */ /* Initialize "flattened" iterator offset to initial location and dataspace extent and selection information to correct values */ - for(u=0; uu.hyp.off[u]=iter->u.hyp.diminfo[u].start; + for(u = 0; u < flat_rank; u++) + iter->u.hyp.off[u] = iter->u.hyp.diminfo[u].start; } /* end if */ else { /* Initialize position to initial location */ /* Also make local copy of the regular selection information */ - for(u=0; uu.hyp.diminfo[u].start = tdiminfo[u].start; iter->u.hyp.diminfo[u].stride = tdiminfo[u].stride; @@ -365,51 +363,50 @@ H5S_hyper_iter_init(H5S_sel_iter_t *iter, const H5S_t *space) iter->u.hyp.diminfo[u].block = tdiminfo[u].block; /* Position information */ - iter->u.hyp.off[u]=tdiminfo[u].start; + iter->u.hyp.off[u] = tdiminfo[u].start; } /* end if */ } /* end else */ /* Flag the diminfo information as valid in the iterator */ - iter->u.hyp.diminfo_valid=TRUE; + iter->u.hyp.diminfo_valid = TRUE; /* Initialize irregular region information also (for release) */ - iter->u.hyp.spans=NULL; + iter->u.hyp.spans = NULL; } /* end if */ else { /* Initialize the information needed for non-regular hyperslab I/O */ - assert(space->select.sel_info.hslab->span_lst); + HDassert(space->select.sel_info.hslab->span_lst); /* Make a copy of the span tree to iterate over */ - iter->u.hyp.spans=H5S_hyper_copy_span(space->select.sel_info.hslab->span_lst); + iter->u.hyp.spans = H5S_hyper_copy_span(space->select.sel_info.hslab->span_lst); /* Set the nelem & pstride values according to the element size */ H5S_hyper_span_precompute(iter->u.hyp.spans,iter->elmt_size); /* Initialize the starting span_info's and spans */ - spans=iter->u.hyp.spans; - for(u=0; uu.hyp.spans; + for(u = 0; u < rank; u++) { /* Set the pointers to the initial span in each dimension */ - assert(spans); - assert(spans->head); + HDassert(spans); + HDassert(spans->head); /* Set the pointer to the first span in the list for this node */ iter->u.hyp.span[u] = spans->head; /* Set the initial offset to low bound of span */ - iter->u.hyp.off[u]=iter->u.hyp.span[u]->low; + iter->u.hyp.off[u] = iter->u.hyp.span[u]->low; /* Get the pointer to the next level down */ - spans=spans->head->down; + spans = spans->head->down; } /* end for */ /* Flag the diminfo information as not valid in the iterator */ - iter->u.hyp.diminfo_valid=FALSE; - + iter->u.hyp.diminfo_valid = FALSE; } /* end else */ /* Initialize type of selection iterator */ - iter->type=H5S_sel_iter_hyper; + iter->type = H5S_sel_iter_hyper; - FUNC_LEAVE_NOAPI(SUCCEED); + FUNC_LEAVE_NOAPI(SUCCEED) } /* H5S_hyper_iter_init() */ @@ -431,11 +428,11 @@ H5S_hyper_iter_init(H5S_sel_iter_t *iter, const H5S_t *space) static herr_t H5S_hyper_iter_coords (const H5S_sel_iter_t *iter, hsize_t *coords) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_hyper_iter_coords); + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_hyper_iter_coords) /* Check args */ - assert (iter); - assert (coords); + HDassert(iter); + HDassert(coords); /* Copy the offset of the current point */ @@ -496,7 +493,7 @@ H5S_hyper_iter_coords (const H5S_sel_iter_t *iter, hsize_t *coords) else HDmemcpy(coords, iter->u.hyp.off, sizeof(hsize_t) * iter->rank); - FUNC_LEAVE_NOAPI(SUCCEED); + FUNC_LEAVE_NOAPI(SUCCEED) } /* H5S_hyper_iter_coords() */ @@ -523,12 +520,12 @@ H5S_hyper_iter_block (const H5S_sel_iter_t *iter, hsize_t *start, hsize_t *end) { unsigned u; /* Local index variable */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_hyper_iter_block); + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_hyper_iter_block) /* Check args */ - assert (iter); - assert (start); - assert (end); + HDassert(iter); + HDassert(start); + HDassert(end); /* Copy the offset of the current point */ @@ -550,7 +547,7 @@ H5S_hyper_iter_block (const H5S_sel_iter_t *iter, hsize_t *start, hsize_t *end) end[u]=iter->u.hyp.span[u]->high; } /* end else */ - FUNC_LEAVE_NOAPI(SUCCEED); + FUNC_LEAVE_NOAPI(SUCCEED) } /* H5S_hyper_iter_block() */ @@ -571,12 +568,12 @@ H5S_hyper_iter_block (const H5S_sel_iter_t *iter, hsize_t *start, hsize_t *end) static hsize_t H5S_hyper_iter_nelmts (const H5S_sel_iter_t *iter) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_hyper_iter_nelmts); + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_hyper_iter_nelmts) /* Check args */ - assert (iter); + HDassert(iter); - FUNC_LEAVE_NOAPI(iter->elmt_left); + FUNC_LEAVE_NOAPI(iter->elmt_left) } /* H5S_hyper_iter_nelmts() */ @@ -661,7 +658,7 @@ H5S_hyper_iter_next(H5S_sel_iter_t *iter, size_t nelem) int fast_dim; /* Rank of the fastest changing dimension for the dataspace */ unsigned i; /* Counters */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_hyper_iter_next); + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_hyper_iter_next) /* Check for the special case of just one H5Sselect_hyperslab call made */ /* (i.e. a regular hyperslab selection */ @@ -826,9 +823,9 @@ H5S_hyper_iter_next(H5S_sel_iter_t *iter, size_t nelem) if(curr_dim>=0) { /* Walk back down the iterator positions, reseting them */ while(curr_dimdown); - assert(curr_span->down->head); + HDassert(curr_span); + HDassert(curr_span->down); + HDassert(curr_span->down->head); /* Increment current dimension */ curr_dim++; @@ -844,12 +841,12 @@ H5S_hyper_iter_next(H5S_sel_iter_t *iter, size_t nelem) } /* end while */ /* Verify that the curr_span points to the fastest dim */ - assert(curr_span==ispan[fast_dim]); + HDassert(curr_span==ispan[fast_dim]); } /* end if */ } /* end while */ } /* end else */ - FUNC_LEAVE_NOAPI(SUCCEED); + FUNC_LEAVE_NOAPI(SUCCEED) } /* H5S_hyper_iter_next() */ @@ -876,7 +873,7 @@ H5S_hyper_iter_next_block(H5S_sel_iter_t *iter) int fast_dim; /* Rank of the fastest changing dimension for the dataspace */ unsigned u; /* Counters */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_hyper_iter_next_block); + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_hyper_iter_next_block) /* Check for the special case of just one H5Sselect_hyperslab call made */ /* (i.e. a regular hyperslab selection */ @@ -1012,9 +1009,9 @@ H5S_hyper_iter_next_block(H5S_sel_iter_t *iter) if(curr_dim>=0) { /* Walk back down the iterator positions, reseting them */ while(curr_dimdown); - assert(curr_span->down->head); + HDassert(curr_span); + HDassert(curr_span->down); + HDassert(curr_span->down->head); /* Increment current dimension */ curr_dim++; @@ -1030,11 +1027,11 @@ H5S_hyper_iter_next_block(H5S_sel_iter_t *iter) } /* end while */ /* Verify that the curr_span points to the fastest dim */ - assert(curr_span==ispan[fast_dim]); + HDassert(curr_span == ispan[fast_dim]); } /* end if */ } /* end else */ - FUNC_LEAVE_NOAPI(SUCCEED); + FUNC_LEAVE_NOAPI(SUCCEED) } /* H5S_hyper_iter_next() */ @@ -1058,17 +1055,17 @@ H5S_hyper_iter_next_block(H5S_sel_iter_t *iter) static herr_t H5S_hyper_iter_release (H5S_sel_iter_t *iter) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_hyper_iter_release); + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_hyper_iter_release) /* Check args */ - assert (iter); + HDassert(iter); /* Release the information needed for non-regular hyperslab I/O */ /* Free the copy of the selections span tree */ - if(iter->u.hyp.spans!=NULL) + if(iter->u.hyp.spans != NULL) H5S_hyper_free_span_info(iter->u.hyp.spans); - FUNC_LEAVE_NOAPI(SUCCEED); + FUNC_LEAVE_NOAPI(SUCCEED) } /* H5S_hyper_iter_release() */ @@ -1144,11 +1141,11 @@ static herr_t H5S_hyper_span_precompute_helper (H5S_hyper_span_info_t *spans, size_t elmt_size) { H5S_hyper_span_t *span; /* Hyperslab span */ - herr_t ret_value=SUCCEED; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5S_hyper_span_precompute_helper); + FUNC_ENTER_NOAPI_NOINIT(H5S_hyper_span_precompute_helper) - assert(spans); + HDassert(spans); /* Check if we've already set this down span tree */ if(spans->scratch!=(H5S_hyper_span_info_t *)~((size_t)NULL)) { @@ -1163,7 +1160,7 @@ H5S_hyper_span_precompute_helper (H5S_hyper_span_info_t *spans, size_t elmt_size /* If there are down spans, set their scratch value also */ if(span->down!=NULL) { if(H5S_hyper_span_precompute_helper(span->down,elmt_size)==FAIL) - HGOTO_ERROR(H5E_INTERNAL, H5E_CANTFREE, FAIL, "can't reset hyperslab scratch pointer"); + HGOTO_ERROR(H5E_INTERNAL, H5E_CANTFREE, FAIL, "can't reset hyperslab scratch pointer") } /* end if */ /* Change the nelem & pstride values into bytes */ @@ -1176,7 +1173,7 @@ H5S_hyper_span_precompute_helper (H5S_hyper_span_info_t *spans, size_t elmt_size } /* end if */ done: - FUNC_LEAVE_NOAPI(ret_value); + FUNC_LEAVE_NOAPI(ret_value) } /* H5S_hyper_span_precompute_helper() */ @@ -1422,7 +1419,7 @@ H5S_hyper_cmp_spans (H5S_hyper_span_info_t *span_info1, H5S_hyper_span_info_t *s htri_t nest=FAIL; htri_t ret_value=FAIL; - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_hyper_cmp_spans); + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_hyper_cmp_spans) /* Check for redundant comparison */ if(span_info1==span_info2) @@ -1441,8 +1438,8 @@ H5S_hyper_cmp_spans (H5S_hyper_span_info_t *span_info1, H5S_hyper_span_info_t *s span2=span_info2->head; /* Sanity checking */ - assert(span1); - assert(span2); + HDassert(span1); + HDassert(span2); /* infinite loop which must be broken out of */ while (1) { @@ -1494,7 +1491,7 @@ H5S_hyper_cmp_spans (H5S_hyper_span_info_t *span_info1, H5S_hyper_span_info_t *s } /* end else */ } /* end else */ - FUNC_LEAVE_NOAPI(ret_value); + FUNC_LEAVE_NOAPI(ret_value) } /* H5S_hyper_cmp_spans() */ @@ -1523,9 +1520,9 @@ H5S_hyper_free_span_info (H5S_hyper_span_info_t *span_info) H5S_hyper_span_t *span, *next_span; herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5S_hyper_free_span_info); + FUNC_ENTER_NOAPI_NOINIT(H5S_hyper_free_span_info) - assert(span_info); + HDassert(span_info); /* Decrement the span tree's reference count */ span_info->count--; @@ -1538,7 +1535,7 @@ H5S_hyper_free_span_info (H5S_hyper_span_info_t *span_info) while(span!=NULL) { next_span=span->next; if(H5S_hyper_free_span(span)<0) - HGOTO_ERROR(H5E_INTERNAL, H5E_CANTFREE, FAIL, "failed to release hyperslab span"); + HGOTO_ERROR(H5E_INTERNAL, H5E_CANTFREE, FAIL, "failed to release hyperslab span") span=next_span; } /* end while */ @@ -1547,7 +1544,7 @@ H5S_hyper_free_span_info (H5S_hyper_span_info_t *span_info) } /* end if */ done: - FUNC_LEAVE_NOAPI(ret_value); + FUNC_LEAVE_NOAPI(ret_value) } /* H5S_hyper_free_span_info() */ @@ -1575,21 +1572,21 @@ H5S_hyper_free_span (H5S_hyper_span_t *span) { herr_t ret_value=SUCCEED; - FUNC_ENTER_NOAPI_NOINIT(H5S_hyper_free_span); + FUNC_ENTER_NOAPI_NOINIT(H5S_hyper_free_span) - assert(span); + HDassert(span); /* Decrement the reference count of the 'down spans', freeing them if appropriate */ if(span->down!=NULL) { if(H5S_hyper_free_span_info(span->down)<0) - HGOTO_ERROR(H5E_INTERNAL, H5E_CANTFREE, FAIL, "failed to release hyperslab span tree"); + HGOTO_ERROR(H5E_INTERNAL, H5E_CANTFREE, FAIL, "failed to release hyperslab span tree") } /* end if */ /* Free this span */ span = H5FL_FREE(H5S_hyper_span_t, span); done: - FUNC_LEAVE_NOAPI(ret_value); + FUNC_LEAVE_NOAPI(ret_value) } /* H5S_hyper_free_span() */ @@ -1624,14 +1621,14 @@ H5S_hyper_copy (H5S_t *dst, const H5S_t *src, hbool_t share_selection) const H5S_hyper_sel_t *src_hslab; /* Pointer to source hyperslab info */ herr_t ret_value=SUCCEED; /* return value */ - FUNC_ENTER_NOAPI(H5S_hyper_copy, FAIL); + FUNC_ENTER_NOAPI(H5S_hyper_copy, FAIL) - assert(src); - assert(dst); + HDassert(src); + HDassert(dst); /* Allocate space for the hyperslab selection information */ if(NULL == (dst->select.sel_info.hslab = H5FL_MALLOC(H5S_hyper_sel_t))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab info"); + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab info") /* Set temporary pointers */ dst_hslab=dst->select.sel_info.hslab; @@ -1662,7 +1659,7 @@ H5S_hyper_copy (H5S_t *dst, const H5S_t *src, hbool_t share_selection) } /* end if */ done: - FUNC_LEAVE_NOAPI(ret_value); + FUNC_LEAVE_NOAPI(ret_value) } /* end H5S_hyper_copy() */ @@ -1696,12 +1693,12 @@ H5S_hyper_is_valid_helper (const H5S_hyper_span_info_t *spans, const hssize_t *o htri_t tmp; /* temporary return value */ htri_t ret_value=TRUE; /* return value */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_hyper_is_valid_helper); + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_hyper_is_valid_helper) - assert(spans); - assert(offset); - assert(size); - assert(rankhead; @@ -1728,7 +1725,7 @@ H5S_hyper_is_valid_helper (const H5S_hyper_span_info_t *spans, const hssize_t *o curr=curr->next; } /* end while */ - FUNC_LEAVE_NOAPI(ret_value); + FUNC_LEAVE_NOAPI(ret_value) } /* end H5S_hyper_is_valid_helper() */ @@ -1758,9 +1755,9 @@ H5S_hyper_is_valid (const H5S_t *space) unsigned u; /* Counter */ htri_t ret_value=TRUE; /* return value */ - FUNC_ENTER_NOAPI_NOFUNC(H5S_hyper_is_valid); + FUNC_ENTER_NOAPI_NOFUNC(H5S_hyper_is_valid) - assert(space); + HDassert(space); /* Check for a "regular" hyperslab selection */ if(space->select.sel_info.hslab->diminfo_valid) { @@ -1792,7 +1789,7 @@ H5S_hyper_is_valid (const H5S_t *space) } /* end else */ done: - FUNC_LEAVE_NOAPI(ret_value); + FUNC_LEAVE_NOAPI(ret_value) } /* end H5S_hyper_is_valid() */ @@ -2003,14 +2000,14 @@ H5S_hyper_serialize_helper (const H5S_hyper_span_info_t *spans, hsize_t *start, hsize_t u; /* Index variable */ herr_t ret_value=SUCCEED; /* return value */ - FUNC_ENTER_NOAPI_NOINIT(H5S_hyper_serialize_helper); + FUNC_ENTER_NOAPI_NOINIT(H5S_hyper_serialize_helper) /* Sanity checks */ - assert(spans); - assert(start); - assert(end); - assert(rankhead; @@ -2023,7 +2020,7 @@ H5S_hyper_serialize_helper (const H5S_hyper_span_info_t *spans, hsize_t *start, /* Recurse down to the next dimension */ if(H5S_hyper_serialize_helper(curr->down,start,end,rank+1,buf)<0) - HGOTO_ERROR(H5E_INTERNAL, H5E_CANTFREE, FAIL, "failed to release hyperslab spans"); + HGOTO_ERROR(H5E_INTERNAL, H5E_CANTFREE, FAIL, "failed to release hyperslab spans") } /* end if */ else { /* Encode all the previous dimensions starting & ending points */ @@ -2048,7 +2045,7 @@ H5S_hyper_serialize_helper (const H5S_hyper_span_info_t *spans, hsize_t *start, } /* end while */ done: - FUNC_LEAVE_NOAPI(ret_value); + FUNC_LEAVE_NOAPI(ret_value) } /* H5S_hyper_serialize_helper() */ @@ -2250,17 +2247,17 @@ H5S_hyper_deserialize (H5S_t *space, const uint8_t *buf) unsigned i,j; /* local counting variables */ herr_t ret_value=FAIL; /* return value */ - FUNC_ENTER_NOAPI(H5S_hyper_deserialize, FAIL); + FUNC_ENTER_NOAPI(H5S_hyper_deserialize, FAIL) /* Check args */ - assert(space); - assert(buf); + HDassert(space); + HDassert(buf); /* Deserialize slabs to select */ buf+=16; /* Skip over selection header */ UINT32DECODE(buf,rank); /* decode the rank of the point selection */ if(rank!=space->extent.rank) - HGOTO_ERROR(H5E_DATASPACE, H5E_BADRANGE, FAIL, "rank of pointer does not match dataspace"); + HGOTO_ERROR(H5E_DATASPACE, H5E_BADRANGE, FAIL, "rank of pointer does not match dataspace") UINT32DECODE(buf,num_elem); /* decode the number of points */ /* Set the count & stride for all blocks */ @@ -2285,11 +2282,11 @@ H5S_hyper_deserialize (H5S_t *space, const uint8_t *buf) /* Select or add the hyperslab to the current selection */ if((ret_value=H5S_select_hyperslab(space,(i==0 ? H5S_SELECT_SET : H5S_SELECT_OR),start,stride,count,block))<0) - HGOTO_ERROR(H5E_DATASPACE, H5E_CANTDELETE, FAIL, "can't change selection"); + HGOTO_ERROR(H5E_DATASPACE, H5E_CANTDELETE, FAIL, "can't change selection") } /* end for */ done: - FUNC_LEAVE_NOAPI(ret_value); + FUNC_LEAVE_NOAPI(ret_value) } /* H5S_hyper_deserialize() */ @@ -2355,7 +2352,7 @@ H5S_hyper_span_blocklist(H5S_hyper_span_info_t *spans, hsize_t start[], hsize_t /* Recurse down to the next dimension */ if(H5S_hyper_span_blocklist(curr->down, start, end, (rank + 1), startblock, numblocks, buf) < 0) - HGOTO_ERROR(H5E_INTERNAL, H5E_CANTFREE, FAIL, "failed to release hyperslab spans"); + HGOTO_ERROR(H5E_INTERNAL, H5E_CANTFREE, FAIL, "failed to release hyperslab spans") } /* end if */ else { /* Skip this block if we haven't skipped all the startblocks yet */ @@ -2889,9 +2886,9 @@ H5S_hyper_is_contiguous(const H5S_t *space) unsigned u; /* index variable */ htri_t ret_value = FALSE; /* Return value */ - FUNC_ENTER_NOAPI_NOFUNC(H5S_hyper_is_contiguous); + FUNC_ENTER_NOAPI_NOFUNC(H5S_hyper_is_contiguous) - assert(space); + HDassert(space); /* Check for a "regular" hyperslab selection */ if(space->select.sel_info.hslab->diminfo_valid) { @@ -3044,7 +3041,7 @@ H5S_hyper_is_contiguous(const H5S_t *space) ret_value=TRUE; } /* end else */ - FUNC_LEAVE_NOAPI(ret_value); + FUNC_LEAVE_NOAPI(ret_value) } /* H5S_hyper_is_contiguous() */ @@ -3074,9 +3071,9 @@ H5S_hyper_is_single(const H5S_t *space) unsigned u; /* index variable */ htri_t ret_value=TRUE; /* return value */ - FUNC_ENTER_NOAPI_NOFUNC(H5S_hyper_is_single); + FUNC_ENTER_NOAPI_NOFUNC(H5S_hyper_is_single) - assert(space); + HDassert(space); /* Check for a "single" hyperslab selection */ if(space->select.sel_info.hslab->diminfo_valid) { @@ -3112,7 +3109,7 @@ H5S_hyper_is_single(const H5S_t *space) } /* end else */ done: - FUNC_LEAVE_NOAPI(ret_value); + FUNC_LEAVE_NOAPI(ret_value) } /* H5S_hyper_is_single() */ @@ -3141,10 +3138,10 @@ H5S_hyper_is_regular(const H5S_t *space) { htri_t ret_value; /* return value */ - FUNC_ENTER_NOAPI_NOFUNC(H5S_hyper_is_regular); + FUNC_ENTER_NOAPI_NOFUNC(H5S_hyper_is_regular) /* Check args */ - assert(space); + HDassert(space); /* Only simple check for regular hyperslabs for now... */ if(space->select.sel_info.hslab->diminfo_valid) @@ -3152,7 +3149,7 @@ H5S_hyper_is_regular(const H5S_t *space) else ret_value=FALSE; - FUNC_LEAVE_NOAPI(ret_value); + FUNC_LEAVE_NOAPI(ret_value) } /* H5S_hyper_is_regular() */ @@ -3228,10 +3225,10 @@ done: static herr_t H5S_hyper_recover_span (unsigned *recover, H5S_hyper_span_t **curr_span, H5S_hyper_span_t *next_span) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_hyper_recover_span); + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_hyper_recover_span) - assert(recover); - assert(curr_span); + HDassert(recover); + HDassert(curr_span); /* Check if the span should be recovered */ if(*recover) { @@ -3242,7 +3239,7 @@ H5S_hyper_recover_span (unsigned *recover, H5S_hyper_span_t **curr_span, H5S_hyp /* Set the current span to next span */ *curr_span=next_span; - FUNC_LEAVE_NOAPI(SUCCEED); + FUNC_LEAVE_NOAPI(SUCCEED) } /* H5S_hyper_recover_span() */ @@ -3271,16 +3268,16 @@ H5S_hyper_coord_to_span(unsigned rank, hsize_t *coords) H5S_hyper_span_info_t *down=NULL; /* Pointer to new span tree for next level down */ H5S_hyper_span_t *ret_value=NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5S_hyper_coord_to_span); + FUNC_ENTER_NOAPI_NOINIT(H5S_hyper_coord_to_span) - assert(rank>0); - assert(coords); + HDassert(rank > 0); + HDassert(coords); /* Search for location to insert new element in tree */ if(rank>1) { /* Allocate a span info node */ if((down = H5FL_MALLOC(H5S_hyper_span_info_t))==NULL) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate hyperslab span"); + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate hyperslab span") /* Set the reference count */ down->count=0; @@ -3290,12 +3287,12 @@ H5S_hyper_coord_to_span(unsigned rank, hsize_t *coords) /* Build span tree for coordinates below this one */ if((down->head=H5S_hyper_coord_to_span(rank-1,&coords[1]))==NULL) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate hyperslab span"); + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate hyperslab span") } /* end if */ /* Build span for this coordinate */ if((new_span = H5S_hyper_new_span(coords[0],coords[0],down,NULL))==NULL) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate hyperslab span"); + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate hyperslab span") /* Set return value */ ret_value=new_span; @@ -3306,7 +3303,7 @@ done: H5S_hyper_free_span_info(down); } /* end if */ - FUNC_LEAVE_NOAPI(ret_value); + FUNC_LEAVE_NOAPI(ret_value) } /* H5S_hyper_coord_to_span() */ @@ -3340,11 +3337,11 @@ H5S_hyper_add_span_element_helper(H5S_hyper_span_info_t *span_tree, unsigned ran H5S_hyper_span_t *new_span; /* New span created for element */ herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5S_hyper_add_span_element_helper); + FUNC_ENTER_NOAPI_NOINIT(H5S_hyper_add_span_element_helper) - assert(span_tree); - assert(rank>0); - assert(coords); + HDassert(span_tree); + HDassert(rank > 0); + HDassert(coords); /* Get pointer to last span in span tree */ tspan_info=span_tree; @@ -3352,7 +3349,7 @@ H5S_hyper_add_span_element_helper(H5S_hyper_span_info_t *span_tree, unsigned ran tmp_span=(H5S_hyper_span_t *)span_tree->scratch; else { tmp_span=span_tree->head; - assert(tmp_span); + HDassert(tmp_span); span_tree->scratch=(H5S_hyper_span_info_t *)tmp_span; } /* end else */ @@ -3372,7 +3369,7 @@ H5S_hyper_add_span_element_helper(H5S_hyper_span_info_t *span_tree, unsigned ran tmp_span=(H5S_hyper_span_t *)tspan_info->scratch; else { tmp_span=tspan_info->head; - assert(tmp_span); + HDassert(tmp_span); tspan_info->scratch=(H5S_hyper_span_info_t *)tmp_span; } /* end else */ } /* end while */ @@ -3424,14 +3421,14 @@ H5S_hyper_add_span_element_helper(H5S_hyper_span_info_t *span_tree, unsigned ran /* Make span tree for current coordinates */ if((new_span=H5S_hyper_coord_to_span(rank,coords))==NULL) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span"); + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span") /* Add new span tree as span */ - assert(tmp_span); + HDassert(tmp_span); tmp_span->next=new_span; /* Make scratch pointer point to last span in list */ - assert(tspan_info); + HDassert(tspan_info); tspan_info->scratch=(H5S_hyper_span_info_t *)new_span; /* Set the proper 'pstride' for new span */ @@ -3493,10 +3490,10 @@ H5S_hyper_add_span_element_helper(H5S_hyper_span_info_t *span_tree, unsigned ran } /* end if */ else { if((new_span = H5S_hyper_new_span(coords[0],coords[0],NULL,NULL))==NULL) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span"); + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span") /* Add new span tree as span */ - assert(tmp_span); + HDassert(tmp_span); tmp_span->next=new_span; /* Make scratch pointer point to last span in list */ @@ -3508,7 +3505,7 @@ H5S_hyper_add_span_element_helper(H5S_hyper_span_info_t *span_tree, unsigned ran } /* end else */ done: - FUNC_LEAVE_NOAPI(ret_value); + FUNC_LEAVE_NOAPI(ret_value) } /* H5S_hyper_add_span_element_helper() */ @@ -3652,9 +3649,9 @@ H5S_hyper_convert(H5S_t *space) { herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5S_hyper_convert); + FUNC_ENTER_NOAPI_NOINIT(H5S_hyper_convert) - assert(space); + HDassert(space); /* Check the type of selection */ switch(H5S_GET_SELECT_TYPE(space)) { @@ -3677,7 +3674,7 @@ H5S_hyper_convert(H5S_t *space) /* Convert to hyperslab selection */ if(H5S_select_hyperslab(space,H5S_SELECT_SET,tmp_start,tmp_stride,tmp_count,tmp_block)<0) - HGOTO_ERROR(H5E_DATASPACE, H5E_CANTDELETE, FAIL, "can't convert selection"); + HGOTO_ERROR(H5E_DATASPACE, H5E_CANTDELETE, FAIL, "can't convert selection") } /* end case */ break; @@ -3689,11 +3686,11 @@ H5S_hyper_convert(H5S_t *space) case H5S_SEL_ERROR: /* Selection error */ case H5S_SEL_N: /* Selection count */ default: - HGOTO_ERROR(H5E_ARGS, H5E_UNSUPPORTED, FAIL, "can't convert to span tree selection"); + HGOTO_ERROR(H5E_ARGS, H5E_UNSUPPORTED, FAIL, "can't convert to span tree selection") } /* end switch */ done: - FUNC_LEAVE_NOAPI(ret_value); + FUNC_LEAVE_NOAPI(ret_value) } /* H5S_hyper_convert() */ #ifdef LATER @@ -3724,10 +3721,10 @@ H5S_hyper_intersect_helper (H5S_hyper_span_info_t *spans1, H5S_hyper_span_info_t htri_t status; /* Status from recursive call */ htri_t ret_value=FALSE; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5S_hyper_intersect_helper); + FUNC_ENTER_NOAPI_NOINIT(H5S_hyper_intersect_helper) /* Sanity check */ - assert((spans1 && spans2) || (spans1==NULL && spans2==NULL)); + HDassert((spans1 && spans2) || (spans1 == NULL && spans2 == NULL)); /* "NULL" span trees compare as overlapping */ if(spans1==NULL && spans2==NULL) @@ -3749,7 +3746,7 @@ H5S_hyper_intersect_helper (H5S_hyper_span_info_t *spans1, H5S_hyper_span_info_t else { /* Recursively check spans in next dimension down */ if((status=H5S_hyper_intersect_helper(curr1->down,curr2->down))<0) - HGOTO_ERROR(H5E_DATASPACE, H5E_BADSELECT, FAIL, "can't perform hyperslab intersection check"); + HGOTO_ERROR(H5E_DATASPACE, H5E_BADSELECT, FAIL, "can't perform hyperslab intersection check") /* If there is a span intersection in the down dimensions, the span trees overlap */ if(status==TRUE) @@ -3764,7 +3761,7 @@ H5S_hyper_intersect_helper (H5S_hyper_span_info_t *spans1, H5S_hyper_span_info_t } /* end while */ done: - FUNC_LEAVE_NOAPI(ret_value); + FUNC_LEAVE_NOAPI(ret_value) } /* H5S_hyper_intersect_helper() */ @@ -3791,27 +3788,27 @@ H5S_hyper_intersect (H5S_t *space1, H5S_t *space2) { htri_t ret_value=FAIL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5S_hyper_intersect); + FUNC_ENTER_NOAPI_NOINIT(H5S_hyper_intersect) /* Sanity check */ - assert(space1); - assert(space2); + HDassert(space1); + HDassert(space2); /* Check that the space selections both have span trees */ if(space1->select.sel_info.hslab->span_lst==NULL || space2->select.sel_info.hslab->span_lst==NULL) - HGOTO_ERROR(H5E_DATASPACE, H5E_UNINITIALIZED, FAIL, "dataspace does not have span tree"); + HGOTO_ERROR(H5E_DATASPACE, H5E_UNINITIALIZED, FAIL, "dataspace does not have span tree") /* Check that the dataspaces are both the same rank */ if(space1->extent.rank!=space2->extent.rank) - HGOTO_ERROR(H5E_DATASPACE, H5E_BADRANGE, FAIL, "dataspace ranks don't match"); + HGOTO_ERROR(H5E_DATASPACE, H5E_BADRANGE, FAIL, "dataspace ranks don't match") /* Perform the span-by-span intersection check */ if((ret_value=H5S_hyper_intersect_helper(space1->select.sel_info.hslab->span_lst,space2->select.sel_info.hslab->span_lst))<0) - HGOTO_ERROR(H5E_DATASPACE, H5E_BADSELECT, FAIL, "can't perform hyperslab intersection check"); + HGOTO_ERROR(H5E_DATASPACE, H5E_BADSELECT, FAIL, "can't perform hyperslab intersection check") done: - FUNC_LEAVE_NOAPI(ret_value); + FUNC_LEAVE_NOAPI(ret_value) } /* H5S_hyper_intersect() */ #endif /* LATER */ @@ -3843,12 +3840,12 @@ H5S_hyper_intersect_block_helper (const H5S_hyper_span_info_t *spans, hsize_t *s htri_t status; /* Status from recursive call */ htri_t ret_value=FALSE; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5S_hyper_intersect_block_helper); + FUNC_ENTER_NOAPI_NOINIT(H5S_hyper_intersect_block_helper) /* Sanity check */ - assert(spans); - assert(start); - assert(end); + HDassert(spans); + HDassert(start); + HDassert(end); /* Get the span list for spans in this tree */ curr=spans->head; @@ -3869,7 +3866,7 @@ H5S_hyper_intersect_block_helper (const H5S_hyper_span_info_t *spans, hsize_t *s else { /* Recursively check spans in next dimension down */ if((status=H5S_hyper_intersect_block_helper(curr->down,start+1,end+1))<0) - HGOTO_ERROR(H5E_DATASPACE, H5E_BADSELECT, FAIL, "can't perform hyperslab intersection check"); + HGOTO_ERROR(H5E_DATASPACE, H5E_BADSELECT, FAIL, "can't perform hyperslab intersection check") /* If there is a span intersection in the down dimensions, the span trees overlap */ if(status==TRUE) @@ -3882,7 +3879,7 @@ H5S_hyper_intersect_block_helper (const H5S_hyper_span_info_t *spans, hsize_t *s } /* end while */ done: - FUNC_LEAVE_NOAPI(ret_value); + FUNC_LEAVE_NOAPI(ret_value) } /* H5S_hyper_intersect_block_helper() */ @@ -3910,12 +3907,12 @@ H5S_hyper_intersect_block (H5S_t *space, hsize_t *start, hsize_t *end) { htri_t ret_value=FAIL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5S_hyper_intersect_block); + FUNC_ENTER_NOAPI_NOINIT(H5S_hyper_intersect_block) /* Sanity check */ - assert(space); - assert(start); - assert(end); + HDassert(space); + HDassert(start); + HDassert(end); /* Check for 'all' selection, instead of a hyperslab selection */ /* (Technically, this shouldn't be in the "hyperslab" routines...) */ @@ -3925,14 +3922,14 @@ H5S_hyper_intersect_block (H5S_t *space, hsize_t *start, hsize_t *end) /* Check that the space selection has a span tree */ if(space->select.sel_info.hslab->span_lst==NULL) if(H5S_hyper_generate_spans(space)<0) - HGOTO_ERROR(H5E_DATASPACE, H5E_UNINITIALIZED, FAIL, "dataspace does not have span tree"); + HGOTO_ERROR(H5E_DATASPACE, H5E_UNINITIALIZED, FAIL, "dataspace does not have span tree") /* Perform the span-by-span intersection check */ if((ret_value=H5S_hyper_intersect_block_helper(space->select.sel_info.hslab->span_lst,start,end))<0) - HGOTO_ERROR(H5E_DATASPACE, H5E_BADSELECT, FAIL, "can't perform hyperslab intersection check"); + HGOTO_ERROR(H5E_DATASPACE, H5E_BADSELECT, FAIL, "can't perform hyperslab intersection check") done: - FUNC_LEAVE_NOAPI(ret_value); + FUNC_LEAVE_NOAPI(ret_value) } /* H5S_hyper_intersect_block() */ @@ -3959,11 +3956,11 @@ H5S_hyper_adjust_helper_u (H5S_hyper_span_info_t *spans, const hsize_t *offset) { H5S_hyper_span_t *span; /* Pointer to current span in span tree */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_hyper_adjust_helper_u); + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_hyper_adjust_helper_u) /* Sanity check */ - assert(spans); - assert(offset); + HDassert(spans); + HDassert(offset); /* Check if we've already set this down span tree */ if(spans->scratch!=(H5S_hyper_span_info_t *)~((size_t)NULL)) { @@ -3976,7 +3973,7 @@ H5S_hyper_adjust_helper_u (H5S_hyper_span_info_t *spans, const hsize_t *offset) /* Iterate over the spans in tree */ while(span!=NULL) { /* Adjust span offset */ - assert(span->low>=*offset); + HDassert(span->low>=*offset); span->low-=*offset; span->high-=*offset; @@ -3989,7 +3986,7 @@ H5S_hyper_adjust_helper_u (H5S_hyper_span_info_t *spans, const hsize_t *offset) } /* end while */ } /* end if */ - FUNC_LEAVE_NOAPI(SUCCEED); + FUNC_LEAVE_NOAPI(SUCCEED) } /* H5S_hyper_adjust_helper_u() */ @@ -4017,15 +4014,15 @@ H5S_hyper_adjust_u(H5S_t *space, const hsize_t *offset) unsigned u; /* Local index variable */ herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5S_hyper_adjust_u); + FUNC_ENTER_NOAPI_NOINIT(H5S_hyper_adjust_u) - assert(space); - assert(offset); + HDassert(space); + HDassert(offset); /* Subtract the offset from the "regular" coordinates, if they exist */ if(space->select.sel_info.hslab->diminfo_valid) { for(u=0; uextent.rank; u++) { - assert(space->select.sel_info.hslab->opt_diminfo[u].start>=offset[u]); + HDassert(space->select.sel_info.hslab->opt_diminfo[u].start>=offset[u]); space->select.sel_info.hslab->opt_diminfo[u].start-=offset[u]; } /* end for */ } /* end if */ @@ -4033,14 +4030,14 @@ H5S_hyper_adjust_u(H5S_t *space, const hsize_t *offset) /* Subtract the offset from the span tree coordinates, if they exist */ if(space->select.sel_info.hslab->span_lst) { if(H5S_hyper_adjust_helper_u(space->select.sel_info.hslab->span_lst,offset)<0) - HGOTO_ERROR(H5E_DATASPACE, H5E_BADSELECT, FAIL, "can't perform hyperslab offset adjustment"); + HGOTO_ERROR(H5E_DATASPACE, H5E_BADSELECT, FAIL, "can't perform hyperslab offset adjustment") /* Reset the scratch pointers for the next routine which needs them */ H5S_hyper_span_scratch(space->select.sel_info.hslab->span_lst, NULL); } /* end if */ done: - FUNC_LEAVE_NOAPI(ret_value); + FUNC_LEAVE_NOAPI(ret_value) } /* H5S_hyper_adjust_u() */ @@ -4629,7 +4626,7 @@ H5S_hyper_append_span (H5S_hyper_span_t **prev_span, H5S_hyper_span_info_t ** sp H5S_hyper_span_t *new_span = NULL; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5S_hyper_append_span); + FUNC_ENTER_NOAPI_NOINIT(H5S_hyper_append_span) HDassert(prev_span); HDassert(span_tree); @@ -4638,16 +4635,16 @@ H5S_hyper_append_span (H5S_hyper_span_t **prev_span, H5S_hyper_span_info_t ** sp if(*prev_span==NULL) { /* Allocate new span node to append to list */ if((new_span = H5S_hyper_new_span(low,high,down,next))==NULL) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span"); + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span") /* Make first node in span list */ /* Check that we haven't already allocated a span tree */ - assert(*span_tree==NULL); + HDassert(*span_tree==NULL); /* Allocate a new span_info node */ if((*span_tree = H5FL_MALLOC(H5S_hyper_span_info_t))==NULL) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span"); + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span") /* Set the span tree's basic information */ (*span_tree)->count=1; @@ -4669,7 +4666,7 @@ H5S_hyper_append_span (H5S_hyper_span_t **prev_span, H5S_hyper_span_info_t ** sp else { /* Allocate new span node to append to list */ if((new_span = H5S_hyper_new_span(low,high,down,next))==NULL) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span"); + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span") /* Check if there is actually a down span */ if(new_span->down) { @@ -4753,14 +4750,14 @@ H5S_hyper_clip_spans (H5S_hyper_span_info_t *a_spans, H5S_hyper_span_info_t *b_s unsigned recover_a, recover_b; /* Flags to indicate when to recover temporary spans */ herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5S_hyper_clip_spans); + FUNC_ENTER_NOAPI_NOINIT(H5S_hyper_clip_spans) /* Check args */ - assert (a_spans); - assert (b_spans); - assert (a_not_b); - assert (a_and_b); - assert (b_not_a); + HDassert(a_spans); + HDassert(b_spans); + HDassert(a_not_b); + HDassert(a_and_b); + HDassert(b_not_a); /* Check if both span trees are not defined */ if(a_spans==NULL && b_spans==NULL) { @@ -4773,12 +4770,12 @@ H5S_hyper_clip_spans (H5S_hyper_span_info_t *a_spans, H5S_hyper_span_info_t *b_s *a_not_b=NULL; *a_and_b=NULL; if((*b_not_a=H5S_hyper_copy_span(b_spans))==NULL) - HGOTO_ERROR(H5E_INTERNAL, H5E_CANTCOPY, FAIL, "can't copy hyperslab span tree"); + HGOTO_ERROR(H5E_INTERNAL, H5E_CANTCOPY, FAIL, "can't copy hyperslab span tree") } /* end if */ /* If span 'b' is not defined, but 'a' is, copy 'a' and set the other return span trees to empty */ else if(b_spans==NULL) { if((*a_not_b=H5S_hyper_copy_span(a_spans))==NULL) - HGOTO_ERROR(H5E_INTERNAL, H5E_CANTCOPY, FAIL, "can't copy hyperslab span tree"); + HGOTO_ERROR(H5E_INTERNAL, H5E_CANTCOPY, FAIL, "can't copy hyperslab span tree") *a_and_b=NULL; *b_not_a=NULL; } /* end if */ @@ -4788,7 +4785,7 @@ H5S_hyper_clip_spans (H5S_hyper_span_info_t *a_spans, H5S_hyper_span_info_t *b_s if(H5S_hyper_cmp_spans(a_spans,b_spans)==TRUE) { *a_not_b=NULL; if((*a_and_b=H5S_hyper_copy_span(a_spans))==NULL) - HGOTO_ERROR(H5E_INTERNAL, H5E_CANTCOPY, FAIL, "can't copy hyperslab span tree"); + HGOTO_ERROR(H5E_INTERNAL, H5E_CANTCOPY, FAIL, "can't copy hyperslab span tree") *b_not_a=NULL; } /* end if */ else { @@ -4815,7 +4812,7 @@ H5S_hyper_clip_spans (H5S_hyper_span_info_t *a_spans, H5S_hyper_span_info_t *b_s /* Merge/add span 'a' with/to a_not_b list */ if(H5S_hyper_append_span(&last_a_not_b,a_not_b,span_a->low,span_a->high,span_a->down,NULL)==FAIL) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span"); + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span") /* Advance span 'a', leave span 'b' */ H5S_hyper_recover_span(&recover_a,&span_a,span_a->next); @@ -4830,18 +4827,18 @@ H5S_hyper_clip_spans (H5S_hyper_span_info_t *a_spans, H5S_hyper_span_info_t *b_s /* Merge/add lower part of span 'a' with/to a_not_b list */ if(H5S_hyper_append_span(&last_a_not_b,a_not_b,span_a->low,span_b->low-1,span_a->down,NULL)==FAIL) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span"); + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span") /* Check for overlaps between upper part of span 'a' and lower part of span 'b' */ /* Make certain both spans either have a down span or both don't have one */ - assert((span_a->down!=NULL && span_b->down!=NULL) || (span_a->down==NULL && span_b->down==NULL)); + HDassert((span_a->down != NULL && span_b->down != NULL) || (span_a->down == NULL && span_b->down == NULL)); /* If there are no down spans, just add the overlapping area to the a_and_b list */ if(span_a->down==NULL) { /* Merge/add overlapped part with/to a_and_b list */ if(H5S_hyper_append_span(&last_a_and_b,a_and_b,span_b->low,span_a->high,NULL,NULL)==FAIL) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span"); + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span") } /* end if */ /* If there are down spans, check for the overlap in them and add to each appropriate list */ else { @@ -4852,13 +4849,13 @@ H5S_hyper_clip_spans (H5S_hyper_span_info_t *a_spans, H5S_hyper_span_info_t *b_s /* Check for overlaps in the 'down spans' of span 'a' & 'b' */ if(H5S_hyper_clip_spans(span_a->down,span_b->down,&down_a_not_b,&down_a_and_b,&down_b_not_a)<0) - HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCLIP, FAIL, "can't clip hyperslab information"); + HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCLIP, FAIL, "can't clip hyperslab information") /* Check for additions to the a_not_b list */ if(down_a_not_b!=NULL) { /* Merge/add overlapped part with/to a_not_b list */ if(H5S_hyper_append_span(&last_a_not_b,a_not_b,span_b->low,span_a->high,down_a_not_b,NULL)==FAIL) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span"); + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span") /* Release the down span tree generated */ H5S_hyper_free_span_info(down_a_not_b); @@ -4868,7 +4865,7 @@ H5S_hyper_clip_spans (H5S_hyper_span_info_t *a_spans, H5S_hyper_span_info_t *b_s if(down_a_and_b!=NULL) { /* Merge/add overlapped part with/to a_and_b list */ if(H5S_hyper_append_span(&last_a_and_b,a_and_b,span_b->low,span_a->high,down_a_and_b,NULL)==FAIL) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span"); + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span") /* Release the down span tree generated */ H5S_hyper_free_span_info(down_a_and_b); @@ -4878,7 +4875,7 @@ H5S_hyper_clip_spans (H5S_hyper_span_info_t *a_spans, H5S_hyper_span_info_t *b_s if(down_b_not_a!=NULL) { /* Merge/add overlapped part with/to b_not_a list */ if(H5S_hyper_append_span(&last_b_not_a,b_not_a,span_b->low,span_a->high,down_b_not_a,NULL)==FAIL) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span"); + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span") /* Release the down span tree generated */ H5S_hyper_free_span_info(down_b_not_a); @@ -4891,7 +4888,7 @@ H5S_hyper_clip_spans (H5S_hyper_span_info_t *a_spans, H5S_hyper_span_info_t *b_s if(span_a->highhigh) { /* Allocate new span node for upper part of span 'b' */ if((tmp_span = H5S_hyper_new_span(span_a->high+1,span_b->high,span_b->down,span_b->next))==NULL) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span"); + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span") /* Advance span 'a' */ H5S_hyper_recover_span(&recover_a,&span_a,span_a->next); @@ -4917,18 +4914,18 @@ H5S_hyper_clip_spans (H5S_hyper_span_info_t *a_spans, H5S_hyper_span_info_t *b_s /* Merge/add lower part of span 'a' with/to a_not_b list */ if(H5S_hyper_append_span(&last_a_not_b,a_not_b,span_a->low,span_b->low-1,span_a->down,NULL)==FAIL) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span"); + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span") /* Check for overlaps between middle part of span 'a' and span 'b' */ /* Make certain both spans either have a down span or both don't have one */ - assert((span_a->down!=NULL && span_b->down!=NULL) || (span_a->down==NULL && span_b->down==NULL)); + HDassert((span_a->down != NULL && span_b->down != NULL) || (span_a->down == NULL && span_b->down == NULL)); /* If there are no down spans, just add the overlapping area to the a_and_b list */ if(span_a->down==NULL) { /* Merge/add overlapped part with/to a_and_b list */ if(H5S_hyper_append_span(&last_a_and_b,a_and_b,span_b->low,span_b->high,NULL,NULL)==FAIL) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span"); + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span") } /* end if */ /* If there are down spans, check for the overlap in them and add to each appropriate list */ else { @@ -4939,13 +4936,13 @@ H5S_hyper_clip_spans (H5S_hyper_span_info_t *a_spans, H5S_hyper_span_info_t *b_s /* Check for overlaps in the 'down spans' of span 'a' & 'b' */ if(H5S_hyper_clip_spans(span_a->down,span_b->down,&down_a_not_b,&down_a_and_b,&down_b_not_a)<0) - HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCLIP, FAIL, "can't clip hyperslab information"); + HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCLIP, FAIL, "can't clip hyperslab information") /* Check for additions to the a_not_b list */ if(down_a_not_b!=NULL) { /* Merge/add overlapped part with/to a_not_b list */ if(H5S_hyper_append_span(&last_a_not_b,a_not_b,span_b->low,span_b->high,down_a_not_b,NULL)==FAIL) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span"); + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span") /* Release the down span tree generated */ H5S_hyper_free_span_info(down_a_not_b); @@ -4955,7 +4952,7 @@ H5S_hyper_clip_spans (H5S_hyper_span_info_t *a_spans, H5S_hyper_span_info_t *b_s if(down_a_and_b!=NULL) { /* Merge/add overlapped part with/to a_and_b list */ if(H5S_hyper_append_span(&last_a_and_b,a_and_b,span_b->low,span_b->high,down_a_and_b,NULL)==FAIL) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span"); + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span") /* Release the down span tree generated */ H5S_hyper_free_span_info(down_a_and_b); @@ -4965,7 +4962,7 @@ H5S_hyper_clip_spans (H5S_hyper_span_info_t *a_spans, H5S_hyper_span_info_t *b_s if(down_b_not_a!=NULL) { /* Merge/add overlapped part with/to b_not_a list */ if(H5S_hyper_append_span(&last_b_not_a,b_not_a,span_b->low,span_b->high,down_b_not_a,NULL)==FAIL) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span"); + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span") /* Release the down span tree generated */ H5S_hyper_free_span_info(down_b_not_a); @@ -4976,7 +4973,7 @@ H5S_hyper_clip_spans (H5S_hyper_span_info_t *a_spans, H5S_hyper_span_info_t *b_s /* Allocate new span node for upper part of span 'a' */ if((tmp_span = H5S_hyper_new_span(span_b->high+1,span_a->high,span_a->down,span_a->next))==NULL) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span"); + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span") /* Make upper part of span 'a' the new span 'a' */ H5S_hyper_recover_span(&recover_a,&span_a,tmp_span); @@ -4996,7 +4993,7 @@ H5S_hyper_clip_spans (H5S_hyper_span_info_t *a_spans, H5S_hyper_span_info_t *b_s if(span_a->low>span_b->low) { /* Merge/add lower part of span 'b' with/to b_not_a list */ if(H5S_hyper_append_span(&last_b_not_a,b_not_a,span_b->low,span_a->low-1,span_b->down,NULL)==FAIL) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span"); + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span") } /* end if */ else { /* Keep going, nothing to split off */ @@ -5005,13 +5002,13 @@ H5S_hyper_clip_spans (H5S_hyper_span_info_t *a_spans, H5S_hyper_span_info_t *b_s /* Check for overlaps between span 'a' and midle of span 'b' */ /* Make certain both spans either have a down span or both don't have one */ - assert((span_a->down!=NULL && span_b->down!=NULL) || (span_a->down==NULL && span_b->down==NULL)); + HDassert((span_a->down != NULL && span_b->down != NULL) || (span_a->down == NULL && span_b->down == NULL)); /* If there are no down spans, just add the overlapping area to the a_and_b list */ if(span_a->down==NULL) { /* Merge/add overlapped part with/to a_and_b list */ if(H5S_hyper_append_span(&last_a_and_b,a_and_b,span_a->low,span_a->high,NULL,NULL)==FAIL) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span"); + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span") } /* end if */ /* If there are down spans, check for the overlap in them and add to each appropriate list */ else { @@ -5022,13 +5019,13 @@ H5S_hyper_clip_spans (H5S_hyper_span_info_t *a_spans, H5S_hyper_span_info_t *b_s /* Check for overlaps in the 'down spans' of span 'a' & 'b' */ if(H5S_hyper_clip_spans(span_a->down,span_b->down,&down_a_not_b,&down_a_and_b,&down_b_not_a)<0) - HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCLIP, FAIL, "can't clip hyperslab information"); + HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCLIP, FAIL, "can't clip hyperslab information") /* Check for additions to the a_not_b list */ if(down_a_not_b!=NULL) { /* Merge/add overlapped part with/to a_not_b list */ if(H5S_hyper_append_span(&last_a_not_b,a_not_b,span_a->low,span_a->high,down_a_not_b,NULL)==FAIL) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span"); + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span") /* Release the down span tree generated */ H5S_hyper_free_span_info(down_a_not_b); @@ -5038,7 +5035,7 @@ H5S_hyper_clip_spans (H5S_hyper_span_info_t *a_spans, H5S_hyper_span_info_t *b_s if(down_a_and_b!=NULL) { /* Merge/add overlapped part with/to a_and_b list */ if(H5S_hyper_append_span(&last_a_and_b,a_and_b,span_a->low,span_a->high,down_a_and_b,NULL)==FAIL) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span"); + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span") /* Release the down span tree generated */ H5S_hyper_free_span_info(down_a_and_b); @@ -5048,7 +5045,7 @@ H5S_hyper_clip_spans (H5S_hyper_span_info_t *a_spans, H5S_hyper_span_info_t *b_s if(down_b_not_a!=NULL) { /* Merge/add overlapped part with/to b_not_a list */ if(H5S_hyper_append_span(&last_b_not_a,b_not_a,span_a->low,span_a->high,down_b_not_a,NULL)==FAIL) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span"); + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span") /* Release the down span tree generated */ H5S_hyper_free_span_info(down_b_not_a); @@ -5061,7 +5058,7 @@ H5S_hyper_clip_spans (H5S_hyper_span_info_t *a_spans, H5S_hyper_span_info_t *b_s /* Allocate new span node for upper part of spans 'a' */ if((tmp_span = H5S_hyper_new_span(span_a->high+1,span_b->high,span_b->down,span_b->next))==NULL) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span"); + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span") /* And advance span 'a' */ H5S_hyper_recover_span(&recover_a,&span_a,span_a->next); @@ -5088,7 +5085,7 @@ H5S_hyper_clip_spans (H5S_hyper_span_info_t *a_spans, H5S_hyper_span_info_t *b_s /* Merge/add lower part of span 'b' with/to b_not_a list */ if(H5S_hyper_append_span(&last_b_not_a,b_not_a,span_b->low,span_a->low-1,span_b->down,NULL)==FAIL) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span"); + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span") } /* end if */ else { /* Keep going, nothing to split off */ @@ -5097,13 +5094,13 @@ H5S_hyper_clip_spans (H5S_hyper_span_info_t *a_spans, H5S_hyper_span_info_t *b_s /* Check for overlaps between lower part of span 'a' and upper part of span 'b' */ /* Make certain both spans either have a down span or both don't have one */ - assert((span_a->down!=NULL && span_b->down!=NULL) || (span_a->down==NULL && span_b->down==NULL)); + HDassert((span_a->down != NULL && span_b->down != NULL) || (span_a->down == NULL && span_b->down == NULL)); /* If there are no down spans, just add the overlapping area to the a_and_b list */ if(span_a->down==NULL) { /* Merge/add overlapped part with/to a_and_b list */ if(H5S_hyper_append_span(&last_a_and_b,a_and_b,span_a->low,span_b->high,NULL,NULL)==FAIL) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span"); + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span") } /* end if */ /* If there are down spans, check for the overlap in them and add to each appropriate list */ else { @@ -5114,13 +5111,13 @@ H5S_hyper_clip_spans (H5S_hyper_span_info_t *a_spans, H5S_hyper_span_info_t *b_s /* Check for overlaps in the 'down spans' of span 'a' & 'b' */ if(H5S_hyper_clip_spans(span_a->down,span_b->down,&down_a_not_b,&down_a_and_b,&down_b_not_a)<0) - HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCLIP, FAIL, "can't clip hyperslab information"); + HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCLIP, FAIL, "can't clip hyperslab information") /* Check for additions to the a_not_b list */ if(down_a_not_b!=NULL) { /* Merge/add overlapped part with/to a_not_b list */ if(H5S_hyper_append_span(&last_a_not_b,a_not_b,span_a->low,span_b->high,down_a_not_b,NULL)==FAIL) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span"); + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span") /* Release the down span tree generated */ H5S_hyper_free_span_info(down_a_not_b); @@ -5130,7 +5127,7 @@ H5S_hyper_clip_spans (H5S_hyper_span_info_t *a_spans, H5S_hyper_span_info_t *b_s if(down_a_and_b!=NULL) { /* Merge/add overlapped part with/to a_and_b list */ if(H5S_hyper_append_span(&last_a_and_b,a_and_b,span_a->low,span_b->high,down_a_and_b,NULL)==FAIL) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span"); + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span") /* Release the down span tree generated */ H5S_hyper_free_span_info(down_a_and_b); @@ -5140,7 +5137,7 @@ H5S_hyper_clip_spans (H5S_hyper_span_info_t *a_spans, H5S_hyper_span_info_t *b_s if(down_b_not_a!=NULL) { /* Merge/add overlapped part with/to b_not_a list */ if(H5S_hyper_append_span(&last_b_not_a,b_not_a,span_a->low,span_b->high,down_b_not_a,NULL)==FAIL) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span"); + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span") /* Release the down span tree generated */ H5S_hyper_free_span_info(down_b_not_a); @@ -5151,7 +5148,7 @@ H5S_hyper_clip_spans (H5S_hyper_span_info_t *a_spans, H5S_hyper_span_info_t *b_s /* Allocate new span node for upper part of span 'a' */ if((tmp_span = H5S_hyper_new_span(span_b->high+1,span_a->high,span_a->down,span_a->next))==NULL) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span"); + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span") /* Make upper part of span 'a' into new span 'a' */ H5S_hyper_recover_span(&recover_a,&span_a,tmp_span); @@ -5169,7 +5166,7 @@ H5S_hyper_clip_spans (H5S_hyper_span_info_t *a_spans, H5S_hyper_span_info_t *b_s /* Merge/add span 'b' with/to b_not_a list */ if(H5S_hyper_append_span(&last_b_not_a,b_not_a,span_b->low,span_b->high,span_b->down,NULL)==FAIL) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span"); + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span") /* Advance span 'b', leave span 'a' */ H5S_hyper_recover_span(&recover_b,&span_b,span_b->next); @@ -5183,7 +5180,7 @@ H5S_hyper_clip_spans (H5S_hyper_span_info_t *a_spans, H5S_hyper_span_info_t *b_s /* Merge/add span 'a' with/to a_not_b list */ if(H5S_hyper_append_span(&last_a_not_b,a_not_b,span_a->low,span_a->high,span_a->down,NULL)==FAIL) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span"); + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span") /* Advance to the next 'a' span */ H5S_hyper_recover_span(&recover_a,&span_a,span_a->next); @@ -5196,7 +5193,7 @@ H5S_hyper_clip_spans (H5S_hyper_span_info_t *a_spans, H5S_hyper_span_info_t *b_s /* Merge/add span 'b' with/to b_not_a list */ if(H5S_hyper_append_span(&last_b_not_a,b_not_a,span_b->low,span_b->high,span_b->down,NULL)==FAIL) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span"); + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span") /* Advance to the next 'b' span */ H5S_hyper_recover_span(&recover_b,&span_b,span_b->next); @@ -5206,7 +5203,7 @@ H5S_hyper_clip_spans (H5S_hyper_span_info_t *a_spans, H5S_hyper_span_info_t *b_s } /* end else */ done: - FUNC_LEAVE_NOAPI(ret_value); + FUNC_LEAVE_NOAPI(ret_value) } /* H5S_hyper_clip_spans() */ @@ -5243,10 +5240,10 @@ H5S_hyper_merge_spans_helper (H5S_hyper_span_info_t *a_spans, H5S_hyper_span_inf unsigned recover_a, recover_b; /* Flags to indicate when to recover temporary spans */ H5S_hyper_span_info_t *ret_value; - FUNC_ENTER_NOAPI_NOINIT(H5S_hyper_merge_spans_helper); + FUNC_ENTER_NOAPI_NOINIT(H5S_hyper_merge_spans_helper) /* Make certain both 'a' & 'b' spans have down span trees or neither does */ - assert((a_spans!=NULL && b_spans!=NULL) || (a_spans==NULL && b_spans==NULL)); + HDassert((a_spans != NULL && b_spans != NULL) || (a_spans == NULL && b_spans == NULL)); /* Check if the span trees for the 'a' span and the 'b' span are the same */ if(H5S_hyper_cmp_spans(a_spans,b_spans)==TRUE) { @@ -5255,7 +5252,7 @@ H5S_hyper_merge_spans_helper (H5S_hyper_span_info_t *a_spans, H5S_hyper_span_inf else { /* Copy one of the span trees to return */ if((merged_spans=H5S_hyper_copy_span(a_spans))==NULL) - HGOTO_ERROR(H5E_INTERNAL, H5E_CANTCOPY, NULL, "can't copy hyperslab span tree"); + HGOTO_ERROR(H5E_INTERNAL, H5E_CANTCOPY, NULL, "can't copy hyperslab span tree") } /* end else */ } /* end if */ else { @@ -5278,7 +5275,7 @@ H5S_hyper_merge_spans_helper (H5S_hyper_span_info_t *a_spans, H5S_hyper_span_inf if(span_a->highlow) { /* Merge/add span 'a' with/to the merged spans */ if(H5S_hyper_append_span(&prev_span_merge,&merged_spans,span_a->low,span_a->high,span_a->down,NULL)==FAIL) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate hyperslab span"); + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate hyperslab span") /* Advance span 'a' */ H5S_hyper_recover_span(&recover_a,&span_a,span_a->next); @@ -5293,19 +5290,19 @@ H5S_hyper_merge_spans_helper (H5S_hyper_span_info_t *a_spans, H5S_hyper_span_inf if(H5S_hyper_cmp_spans(span_a->down,span_b->down)==TRUE) { /* Merge/add copy of span 'a' with/to merged spans */ if(H5S_hyper_append_span(&prev_span_merge,&merged_spans,span_a->low,span_a->high,span_a->down,NULL)==FAIL) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate hyperslab span"); + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate hyperslab span") } /* end if */ else { /* Merge/add lower part of span 'a' with/to merged spans */ if(H5S_hyper_append_span(&prev_span_merge,&merged_spans,span_a->low,span_b->low-1,span_a->down,NULL)==FAIL) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate hyperslab span"); + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate hyperslab span") /* Get merged span tree for overlapped section */ tmp_spans=H5S_hyper_merge_spans_helper(span_a->down,span_b->down); /* Merge/add overlapped section to merged spans */ if(H5S_hyper_append_span(&prev_span_merge,&merged_spans,span_b->low,span_a->high,tmp_spans,NULL)==FAIL) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate hyperslab span"); + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate hyperslab span") /* Release merged span tree for overlapped section */ H5S_hyper_free_span_info(tmp_spans); @@ -5317,7 +5314,7 @@ H5S_hyper_merge_spans_helper (H5S_hyper_span_info_t *a_spans, H5S_hyper_span_inf /* Allocate new span node to append to list */ if((tmp_span = H5S_hyper_new_span(span_a->high+1,span_b->high,span_b->down,span_b->next))==NULL) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate hyperslab span"); + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate hyperslab span") /* Advance span 'a' */ H5S_hyper_recover_span(&recover_a,&span_a,span_a->next); @@ -5342,19 +5339,19 @@ H5S_hyper_merge_spans_helper (H5S_hyper_span_info_t *a_spans, H5S_hyper_span_inf if(H5S_hyper_cmp_spans(span_a->down,span_b->down)==TRUE) { /* Merge/add copy of lower & middle parts of span 'a' to merged spans */ if(H5S_hyper_append_span(&prev_span_merge,&merged_spans,span_a->low,span_b->high,span_a->down,NULL)==FAIL) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate hyperslab span"); + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate hyperslab span") } /* end if */ else { /* Merge/add lower part of span 'a' to merged spans */ if(H5S_hyper_append_span(&prev_span_merge,&merged_spans,span_a->low,span_b->low-1,span_a->down,NULL)==FAIL) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate hyperslab span"); + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate hyperslab span") /* Get merged span tree for overlapped section */ tmp_spans=H5S_hyper_merge_spans_helper(span_a->down,span_b->down); /* Merge/add overlapped section to merged spans */ if(H5S_hyper_append_span(&prev_span_merge,&merged_spans,span_b->low,span_b->high,tmp_spans,NULL)==FAIL) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate hyperslab span"); + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate hyperslab span") /* Release merged span tree for overlapped section */ H5S_hyper_free_span_info(tmp_spans); @@ -5364,7 +5361,7 @@ H5S_hyper_merge_spans_helper (H5S_hyper_span_info_t *a_spans, H5S_hyper_span_inf /* Allocate new span node to append to list */ if((tmp_span = H5S_hyper_new_span(span_b->high+1,span_a->high,span_a->down,span_a->next))==NULL) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate hyperslab span"); + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate hyperslab span") /* Set new span 'a' to tmp_span */ H5S_hyper_recover_span(&recover_a,&span_a,tmp_span); @@ -5382,14 +5379,14 @@ H5S_hyper_merge_spans_helper (H5S_hyper_span_info_t *a_spans, H5S_hyper_span_inf if(H5S_hyper_cmp_spans(span_a->down,span_b->down)==TRUE) { /* Merge/add copy of lower & middle parts of span 'b' to merged spans */ if(H5S_hyper_append_span(&prev_span_merge,&merged_spans,span_b->low,span_a->high,span_a->down,NULL)==FAIL) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate hyperslab span"); + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate hyperslab span") } /* end if */ else { /* Check if there is a lower part of span 'b' */ if(span_a->low>span_b->low) { /* Merge/add lower part of span 'b' to merged spans */ if(H5S_hyper_append_span(&prev_span_merge,&merged_spans,span_b->low,span_a->low-1,span_b->down,NULL)==FAIL) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate hyperslab span"); + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate hyperslab span") } /* end if */ else { /* No lower part of span 'b' , keep going... */ @@ -5400,7 +5397,7 @@ H5S_hyper_merge_spans_helper (H5S_hyper_span_info_t *a_spans, H5S_hyper_span_inf /* Merge/add overlapped section to merged spans */ if(H5S_hyper_append_span(&prev_span_merge,&merged_spans,span_a->low,span_a->high,tmp_spans,NULL)==FAIL) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate hyperslab span"); + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate hyperslab span") /* Release merged span tree for overlapped section */ H5S_hyper_free_span_info(tmp_spans); @@ -5412,7 +5409,7 @@ H5S_hyper_merge_spans_helper (H5S_hyper_span_info_t *a_spans, H5S_hyper_span_inf /* Allocate new span node to append to list */ if((tmp_span = H5S_hyper_new_span(span_a->high+1,span_b->high,span_b->down,span_b->next))==NULL) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate hyperslab span"); + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate hyperslab span") /* Advance span 'a' */ H5S_hyper_recover_span(&recover_a,&span_a,span_a->next); @@ -5437,14 +5434,14 @@ H5S_hyper_merge_spans_helper (H5S_hyper_span_info_t *a_spans, H5S_hyper_span_inf if(H5S_hyper_cmp_spans(span_a->down,span_b->down)==TRUE) { /* Merge/add copy of span 'b' to merged spans if so */ if(H5S_hyper_append_span(&prev_span_merge,&merged_spans,span_b->low,span_b->high,span_b->down,NULL)==FAIL) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate hyperslab span"); + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate hyperslab span") } /* end if */ else { /* Check if there is a lower part of span 'b' */ if(span_a->low>span_b->low) { /* Merge/add lower part of span 'b' to merged spans */ if(H5S_hyper_append_span(&prev_span_merge,&merged_spans,span_b->low,span_a->low-1,span_b->down,NULL)==FAIL) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate hyperslab span"); + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate hyperslab span") } /* end if */ else { /* No lower part of span 'b' , keep going... */ @@ -5455,7 +5452,7 @@ H5S_hyper_merge_spans_helper (H5S_hyper_span_info_t *a_spans, H5S_hyper_span_inf /* Merge/add overlapped section to merged spans */ if(H5S_hyper_append_span(&prev_span_merge,&merged_spans,span_a->low,span_b->high,tmp_spans,NULL)==FAIL) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate hyperslab span"); + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate hyperslab span") /* Release merged span tree for overlapped section */ H5S_hyper_free_span_info(tmp_spans); @@ -5465,7 +5462,7 @@ H5S_hyper_merge_spans_helper (H5S_hyper_span_info_t *a_spans, H5S_hyper_span_inf /* Allocate new span node to append to list */ if((tmp_span = H5S_hyper_new_span(span_b->high+1,span_a->high,span_a->down,span_a->next))==NULL) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate hyperslab span"); + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate hyperslab span") /* Set new span 'a' to tmp_span */ H5S_hyper_recover_span(&recover_a,&span_a,tmp_span); @@ -5481,7 +5478,7 @@ H5S_hyper_merge_spans_helper (H5S_hyper_span_info_t *a_spans, H5S_hyper_span_inf else { /* Merge/add span 'b' with the merged spans */ if(H5S_hyper_append_span(&prev_span_merge,&merged_spans,span_b->low,span_b->high,span_b->down,NULL)==FAIL) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate hyperslab span"); + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate hyperslab span") /* Advance span 'b' */ H5S_hyper_recover_span(&recover_b,&span_b,span_b->next); @@ -5493,7 +5490,7 @@ H5S_hyper_merge_spans_helper (H5S_hyper_span_info_t *a_spans, H5S_hyper_span_inf while(span_a!=NULL) { /* Merge/add all 'a' spans into the merged spans */ if(H5S_hyper_append_span(&prev_span_merge,&merged_spans,span_a->low,span_a->high,span_a->down,NULL)==FAIL) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate hyperslab span"); + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate hyperslab span") /* Advance to next 'a' span, until all processed */ H5S_hyper_recover_span(&recover_a,&span_a,span_a->next); @@ -5505,7 +5502,7 @@ H5S_hyper_merge_spans_helper (H5S_hyper_span_info_t *a_spans, H5S_hyper_span_inf while(span_b!=NULL) { /* Merge/add all 'b' spans into the merged spans */ if(H5S_hyper_append_span(&prev_span_merge,&merged_spans,span_b->low,span_b->high,span_b->down,NULL)==FAIL) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate hyperslab span"); + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate hyperslab span") /* Advance to next 'b' span, until all processed */ H5S_hyper_recover_span(&recover_b,&span_b,span_b->next); @@ -5523,7 +5520,7 @@ done: HDONE_ERROR(H5E_INTERNAL, H5E_CANTFREE, NULL, "failed to release merged hyperslab spans") } /* end if */ - FUNC_LEAVE_NOAPI(ret_value); + FUNC_LEAVE_NOAPI(ret_value) } /* H5S_hyper_merge_spans_helper() */ @@ -5555,11 +5552,11 @@ done: static herr_t H5S_hyper_merge_spans (H5S_t *space, H5S_hyper_span_info_t *new_spans, hbool_t can_own) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_hyper_merge_spans); + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_hyper_merge_spans) /* Check args */ - assert (space); - assert (new_spans); + HDassert(space); + HDassert(new_spans); /* If this is the first span tree in the hyperslab selection, just use it */ if(space->select.sel_info.hslab->span_lst==NULL) { @@ -5575,7 +5572,7 @@ H5S_hyper_merge_spans (H5S_t *space, H5S_hyper_span_info_t *new_spans, hbool_t c merged_spans=H5S_hyper_merge_spans_helper(space->select.sel_info.hslab->span_lst, new_spans); /* Sanity checking since we started with some spans, we should still have some after the merge */ - assert(merged_spans); + HDassert(merged_spans); /* Free the previous spans */ H5S_hyper_free_span_info(space->select.sel_info.hslab->span_lst); @@ -5584,7 +5581,7 @@ H5S_hyper_merge_spans (H5S_t *space, H5S_hyper_span_info_t *new_spans, hbool_t c space->select.sel_info.hslab->span_lst=merged_spans; } /* end else */ - FUNC_LEAVE_NOAPI(SUCCEED); + FUNC_LEAVE_NOAPI(SUCCEED) } /* H5S_hyper_merge_spans() */ @@ -5611,7 +5608,7 @@ H5S_hyper_spans_nelem (H5S_hyper_span_info_t *spans) H5S_hyper_span_t *span; /* Hyperslab span */ hsize_t ret_value; - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_hyper_spans_nelem); + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_hyper_spans_nelem) /* Count the number of elements in the span tree */ if(spans==NULL) @@ -5632,7 +5629,7 @@ H5S_hyper_spans_nelem (H5S_hyper_span_info_t *spans) } /* end while */ } /* end else */ - FUNC_LEAVE_NOAPI(ret_value); + FUNC_LEAVE_NOAPI(ret_value) } /* H5S_hyper_spans_nelem() */ @@ -5673,7 +5670,7 @@ H5S_hyper_make_spans(unsigned rank, const hsize_t *start, const hsize_t *stride, unsigned u; /* Counters */ H5S_hyper_span_info_t *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5S_hyper_make_spans); + FUNC_ENTER_NOAPI_NOINIT(H5S_hyper_make_spans) /* Check args */ HDassert(rank > 0); @@ -6004,10 +6001,10 @@ H5S_hyper_generate_spans(H5S_t *space) unsigned u; /* Counter */ herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5S_hyper_generate_spans); + FUNC_ENTER_NOAPI_NOINIT(H5S_hyper_generate_spans) - assert(space); - assert(H5S_GET_SELECT_TYPE(space)==H5S_SEL_HYPERSLABS); + HDassert(space); + HDassert(H5S_GET_SELECT_TYPE(space) == H5S_SEL_HYPERSLABS); /* Get the diminfo */ for(u=0; uextent.rank; u++) { @@ -6019,10 +6016,10 @@ H5S_hyper_generate_spans(H5S_t *space) /* Build the hyperslab information also */ if(H5S_generate_hyperslab (space, H5S_SELECT_SET, tmp_start, tmp_stride, tmp_count, tmp_block)<0) - HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINSERT, FAIL, "can't generate hyperslabs"); + HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINSERT, FAIL, "can't generate hyperslabs") done: - FUNC_LEAVE_NOAPI(ret_value); + FUNC_LEAVE_NOAPI(ret_value) } /* H5S_hyper_generate_spans() */ #ifndef NEW_HYPERSLAB_API @@ -6054,25 +6051,25 @@ H5S_generate_hyperslab (H5S_t *space, H5S_seloper_t op, H5S_hyper_span_info_t *b_not_a=NULL; /* Span tree for hyperslab spans in new span tree and not in old span tree */ herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5S_generate_hyperslab); + FUNC_ENTER_NOAPI_NOINIT(H5S_generate_hyperslab) /* Check args */ - assert(space); - assert(op>H5S_SELECT_NOOP && op H5S_SELECT_NOOP && op < H5S_SELECT_INVALID); + HDassert(start); + HDassert(stride); + HDassert(count); + HDassert(block); /* Generate span tree for new hyperslab information */ if((new_spans=H5S_hyper_make_spans(space->extent.rank,start,stride,count,block))==NULL) - HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINSERT, FAIL, "can't create hyperslab information"); + HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINSERT, FAIL, "can't create hyperslab information") /* Generate list of blocks to add/remove based on selection operation */ if(op==H5S_SELECT_SET) { /* Add new spans to current selection */ if(H5S_hyper_merge_spans(space,new_spans,TRUE)<0) - HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINSERT, FAIL, "can't insert hyperslabs"); + HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINSERT, FAIL, "can't insert hyperslabs") /* Set the number of elements in current selection */ space->select.num_elem=H5S_hyper_spans_nelem(new_spans); @@ -6085,14 +6082,14 @@ H5S_generate_hyperslab (H5S_t *space, H5S_seloper_t op, /* Generate lists of spans which overlap and don't overlap */ if(H5S_hyper_clip_spans(space->select.sel_info.hslab->span_lst,new_spans,&a_not_b,&a_and_b,&b_not_a)<0) - HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCLIP, FAIL, "can't clip hyperslab information"); + HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCLIP, FAIL, "can't clip hyperslab information") switch(op) { case H5S_SELECT_OR: /* Add any new spans from b_not_a to current selection */ if(b_not_a!=NULL) { if(H5S_hyper_merge_spans(space,b_not_a,FALSE)<0) - HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINSERT, FAIL, "can't insert hyperslabs"); + HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINSERT, FAIL, "can't insert hyperslabs") /* Update the number of elements in current selection */ space->select.num_elem+=H5S_hyper_spans_nelem(b_not_a); @@ -6105,7 +6102,7 @@ H5S_generate_hyperslab (H5S_t *space, H5S_seloper_t op, case H5S_SELECT_AND: /* Free the current selection */ if(H5S_hyper_free_span_info(space->select.sel_info.hslab->span_lst)<0) - HGOTO_ERROR(H5E_INTERNAL, H5E_CANTFREE, FAIL, "failed to release hyperslab spans"); + HGOTO_ERROR(H5E_INTERNAL, H5E_CANTFREE, FAIL, "failed to release hyperslab spans") space->select.sel_info.hslab->span_lst=NULL; /* Reset the number of items in selection */ @@ -6114,7 +6111,7 @@ H5S_generate_hyperslab (H5S_t *space, H5S_seloper_t op, /* Check if there are any overlapped selections */ if(a_and_b!=NULL) { if(H5S_hyper_merge_spans(space,a_and_b,TRUE)<0) - HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINSERT, FAIL, "can't insert hyperslabs"); + HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINSERT, FAIL, "can't insert hyperslabs") /* Update the number of elements in current selection */ space->select.num_elem=H5S_hyper_spans_nelem(a_and_b); @@ -6130,7 +6127,7 @@ H5S_generate_hyperslab (H5S_t *space, H5S_seloper_t op, case H5S_SELECT_XOR: /* Free the current selection */ if(H5S_hyper_free_span_info(space->select.sel_info.hslab->span_lst)<0) - HGOTO_ERROR(H5E_INTERNAL, H5E_CANTFREE, FAIL, "failed to release hyperslab spans"); + HGOTO_ERROR(H5E_INTERNAL, H5E_CANTFREE, FAIL, "failed to release hyperslab spans") space->select.sel_info.hslab->span_lst=NULL; /* Reset the number of items in selection */ @@ -6139,7 +6136,7 @@ H5S_generate_hyperslab (H5S_t *space, H5S_seloper_t op, /* Check if there are any non-overlapped selections */ if(a_not_b!=NULL) { if(H5S_hyper_merge_spans(space,a_not_b,FALSE)<0) - HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINSERT, FAIL, "can't insert hyperslabs"); + HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINSERT, FAIL, "can't insert hyperslabs") /* Update the number of elements in current selection */ space->select.num_elem=H5S_hyper_spans_nelem(a_not_b); @@ -6149,7 +6146,7 @@ H5S_generate_hyperslab (H5S_t *space, H5S_seloper_t op, } /* end if */ if(b_not_a!=NULL) { if(H5S_hyper_merge_spans(space,b_not_a,FALSE)<0) - HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINSERT, FAIL, "can't insert hyperslabs"); + HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINSERT, FAIL, "can't insert hyperslabs") /* Update the number of elements in current selection */ space->select.num_elem+=H5S_hyper_spans_nelem(b_not_a); @@ -6162,7 +6159,7 @@ H5S_generate_hyperslab (H5S_t *space, H5S_seloper_t op, case H5S_SELECT_NOTB: /* Free the current selection */ if(H5S_hyper_free_span_info(space->select.sel_info.hslab->span_lst)<0) - HGOTO_ERROR(H5E_INTERNAL, H5E_CANTFREE, FAIL, "failed to release hyperslab spans"); + HGOTO_ERROR(H5E_INTERNAL, H5E_CANTFREE, FAIL, "failed to release hyperslab spans") space->select.sel_info.hslab->span_lst=NULL; /* Reset the number of items in selection */ @@ -6171,7 +6168,7 @@ H5S_generate_hyperslab (H5S_t *space, H5S_seloper_t op, /* Check if there are any non-overlapped selections */ if(a_not_b!=NULL) { if(H5S_hyper_merge_spans(space,a_not_b,TRUE)<0) - HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINSERT, FAIL, "can't insert hyperslabs"); + HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINSERT, FAIL, "can't insert hyperslabs") /* Update the number of elements in current selection */ space->select.num_elem=H5S_hyper_spans_nelem(a_not_b); @@ -6187,7 +6184,7 @@ H5S_generate_hyperslab (H5S_t *space, H5S_seloper_t op, case H5S_SELECT_NOTA: /* Free the current selection */ if(H5S_hyper_free_span_info(space->select.sel_info.hslab->span_lst)<0) - HGOTO_ERROR(H5E_INTERNAL, H5E_CANTFREE, FAIL, "failed to release hyperslab spans"); + HGOTO_ERROR(H5E_INTERNAL, H5E_CANTFREE, FAIL, "failed to release hyperslab spans") space->select.sel_info.hslab->span_lst=NULL; /* Reset the number of items in selection */ @@ -6196,7 +6193,7 @@ H5S_generate_hyperslab (H5S_t *space, H5S_seloper_t op, /* Check if there are any non-overlapped selections */ if(b_not_a!=NULL) { if(H5S_hyper_merge_spans(space,b_not_a,TRUE)<0) - HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINSERT, FAIL, "can't insert hyperslabs"); + HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINSERT, FAIL, "can't insert hyperslabs") /* Update the number of elements in current selection */ space->select.num_elem=H5S_hyper_spans_nelem(b_not_a); @@ -6215,7 +6212,7 @@ H5S_generate_hyperslab (H5S_t *space, H5S_seloper_t op, case H5S_SELECT_PREPEND: case H5S_SELECT_INVALID: default: - HGOTO_ERROR(H5E_ARGS, H5E_UNSUPPORTED, FAIL, "invalid selection operation"); + HGOTO_ERROR(H5E_ARGS, H5E_UNSUPPORTED, FAIL, "invalid selection operation") } /* end switch */ /* Check if the resulting hyperslab span tree is empty */ @@ -6223,11 +6220,11 @@ H5S_generate_hyperslab (H5S_t *space, H5S_seloper_t op, H5S_hyper_span_info_t *spans; /* Empty hyperslab span tree */ /* Sanity check */ - assert(space->select.num_elem==0); + HDassert(space->select.num_elem == 0); /* Allocate a span info node */ if((spans = H5FL_MALLOC(H5S_hyper_span_info_t))==NULL) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span"); + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span") /* Set the reference count */ spans->count=1; @@ -6268,7 +6265,7 @@ done: if(H5S_hyper_free_span_info(new_spans) < 0) HDONE_ERROR(H5E_INTERNAL, H5E_CANTFREE, FAIL, "failed to release temporary hyperslab spans") - FUNC_LEAVE_NOAPI(ret_value); + FUNC_LEAVE_NOAPI(ret_value) } /* end H5S_generate_hyperslab() */ @@ -6300,13 +6297,13 @@ H5S_select_hyperslab (H5S_t *space, H5S_seloper_t op, unsigned u; /* Counters */ herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5S_select_hyperslab, FAIL); + FUNC_ENTER_NOAPI(H5S_select_hyperslab, FAIL) /* Check args */ - assert(space); - assert(start); - assert(count); - assert(op>H5S_SELECT_NOOP && op H5S_SELECT_NOOP && op < H5S_SELECT_INVALID); /* Point to the correct stride values */ if(stride==NULL) @@ -6322,7 +6319,7 @@ H5S_select_hyperslab (H5S_t *space, H5S_seloper_t op, for(u=0; uextent.rank; u++) { /* Check for overlapping hyperslab blocks in new selection. */ if(count[u]>1 && stride[u]block[u]); + HDassert(stride[u] > block[u]); int_stride[u]=stride[u]; } /* end else */ int_count[u]=count[u]; @@ -6408,7 +6405,7 @@ H5S_select_hyperslab (H5S_t *space, H5S_seloper_t op, case H5S_SELECT_PREPEND: case H5S_SELECT_INVALID: default: - HGOTO_ERROR(H5E_ARGS, H5E_UNSUPPORTED, FAIL, "invalid selection operation"); + HGOTO_ERROR(H5E_ARGS, H5E_UNSUPPORTED, FAIL, "invalid selection operation") } /* end switch */ break; @@ -6445,14 +6442,14 @@ H5S_select_hyperslab (H5S_t *space, H5S_seloper_t op, /* Convert to hyperslab selection */ if(H5S_select_hyperslab(space,H5S_SELECT_SET,tmp_start,tmp_stride,tmp_count,tmp_block)<0) - HGOTO_ERROR(H5E_DATASPACE, H5E_CANTDELETE, FAIL, "can't convert selection"); + HGOTO_ERROR(H5E_DATASPACE, H5E_CANTDELETE, FAIL, "can't convert selection") } /* end case */ break; case H5S_SELECT_NOTA: /* Binary "B not A" operation for hyperslabs */ /* Convert to "none" selection */ if(H5S_select_none(space)<0) - HGOTO_ERROR(H5E_DATASPACE, H5E_CANTDELETE, FAIL, "can't convert selection"); + HGOTO_ERROR(H5E_DATASPACE, H5E_CANTDELETE, FAIL, "can't convert selection") HGOTO_DONE(SUCCEED); case H5S_SELECT_NOOP: @@ -6460,7 +6457,7 @@ H5S_select_hyperslab (H5S_t *space, H5S_seloper_t op, case H5S_SELECT_PREPEND: case H5S_SELECT_INVALID: default: - HGOTO_ERROR(H5E_ARGS, H5E_UNSUPPORTED, FAIL, "invalid selection operation"); + HGOTO_ERROR(H5E_ARGS, H5E_UNSUPPORTED, FAIL, "invalid selection operation") } /* end switch */ break; @@ -6476,7 +6473,7 @@ H5S_select_hyperslab (H5S_t *space, H5S_seloper_t op, case H5S_SEL_ERROR: case H5S_SEL_N: default: - HGOTO_ERROR(H5E_ARGS, H5E_UNSUPPORTED, FAIL, "invalid selection operation"); + HGOTO_ERROR(H5E_ARGS, H5E_UNSUPPORTED, FAIL, "invalid selection operation") } /* end switch */ if(op == H5S_SELECT_SET) { @@ -6571,7 +6568,7 @@ H5Sselect_hyperslab(hid_t space_id, H5S_seloper_t op, const hsize_t start[], unsigned u; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Sselect_hyperslab, FAIL); + FUNC_ENTER_API(H5Sselect_hyperslab, FAIL) H5TRACE6("e", "iSs*h*h*h*h", space_id, op, start, stride, count, block); /* Check args */ @@ -6589,15 +6586,15 @@ H5Sselect_hyperslab(hid_t space_id, H5S_seloper_t op, const hsize_t start[], /* Check for 0-sized strides */ for(u=0; uextent.rank; u++) { if(stride[u]==0) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid stride==0 value"); + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid stride==0 value") } /* end for */ } /* end if */ if (H5S_select_hyperslab(space, op, start, stride, count, block)<0) - HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINIT, FAIL, "unable to set hyperslab selection"); + HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINIT, FAIL, "unable to set hyperslab selection") done: - FUNC_LEAVE_API(ret_value); + FUNC_LEAVE_API(ret_value) } /* end H5Sselect_hyperslab() */ #else /* NEW_HYPERSLAB_API */ /* Works */ @@ -6625,18 +6622,18 @@ H5S_operate_hyperslab (H5S_t *result, H5S_hyper_span_info_t *spans1, H5S_seloper H5S_hyper_span_info_t *b_not_a=NULL; /* Span tree for hyperslab spans in new span tree and not in old span tree */ herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5S_operate_hyperslab); + FUNC_ENTER_NOAPI_NOINIT(H5S_operate_hyperslab) /* Check args */ - assert(result); - assert(spans2); - assert(op>H5S_SELECT_NOOP && op H5S_SELECT_NOOP && op < H5S_SELECT_INVALID); /* Just copy the selection from spans2 if we are setting the selection */ /* ('space1' to 'result' aliasing happens at the next layer up) */ if(op==H5S_SELECT_SET) { if(H5S_hyper_merge_spans(result,spans2,can_own_span2)<0) - HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINSERT, FAIL, "can't insert hyperslabs"); + HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINSERT, FAIL, "can't insert hyperslabs") /* Update the number of elements in current selection */ result->select.num_elem=H5S_hyper_spans_nelem(spans2); @@ -6648,11 +6645,11 @@ H5S_operate_hyperslab (H5S_t *result, H5S_hyper_span_info_t *spans1, H5S_seloper else { hbool_t updated_spans = FALSE; /* Whether the spans in the selection were modified */ - assert(spans1); + HDassert(spans1); /* Generate lists of spans which overlap and don't overlap */ if(H5S_hyper_clip_spans(spans1,spans2,&a_not_b,&a_and_b,&b_not_a)<0) - HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCLIP, FAIL, "can't clip hyperslab information"); + HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCLIP, FAIL, "can't clip hyperslab information") /* Switch on the operation */ switch(op) { @@ -6660,7 +6657,7 @@ H5S_operate_hyperslab (H5S_t *result, H5S_hyper_span_info_t *spans1, H5S_seloper /* Copy spans from spans1 to current selection */ if(spans1!=NULL) { if(H5S_hyper_merge_spans(result,spans1,FALSE)<0) - HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINSERT, FAIL, "can't insert hyperslabs"); + HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINSERT, FAIL, "can't insert hyperslabs") /* Update the number of elements in current selection */ result->select.num_elem=H5S_hyper_spans_nelem(spans1); @@ -6669,7 +6666,7 @@ H5S_operate_hyperslab (H5S_t *result, H5S_hyper_span_info_t *spans1, H5S_seloper /* Add any new spans from spans2 to current selection */ if(b_not_a!=NULL) { if(H5S_hyper_merge_spans(result,b_not_a,FALSE)<0) - HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINSERT, FAIL, "can't insert hyperslabs"); + HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINSERT, FAIL, "can't insert hyperslabs") /* Update the number of elements in current selection */ result->select.num_elem+=H5S_hyper_spans_nelem(b_not_a); @@ -6683,7 +6680,7 @@ H5S_operate_hyperslab (H5S_t *result, H5S_hyper_span_info_t *spans1, H5S_seloper /* Check if there are any overlapped selections */ if(a_and_b!=NULL) { if(H5S_hyper_merge_spans(result,a_and_b,TRUE)<0) - HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINSERT, FAIL, "can't insert hyperslabs"); + HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINSERT, FAIL, "can't insert hyperslabs") /* Update the number of elements in current selection */ result->select.num_elem=H5S_hyper_spans_nelem(a_and_b); @@ -6700,7 +6697,7 @@ H5S_operate_hyperslab (H5S_t *result, H5S_hyper_span_info_t *spans1, H5S_seloper /* Check if there are any non-overlapped selections */ if(a_not_b!=NULL) { if(H5S_hyper_merge_spans(result,a_not_b,FALSE)<0) - HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINSERT, FAIL, "can't insert hyperslabs"); + HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINSERT, FAIL, "can't insert hyperslabs") /* Update the number of elements in current selection */ result->select.num_elem=H5S_hyper_spans_nelem(a_not_b); @@ -6710,7 +6707,7 @@ H5S_operate_hyperslab (H5S_t *result, H5S_hyper_span_info_t *spans1, H5S_seloper } /* end if */ if(b_not_a!=NULL) { if(H5S_hyper_merge_spans(result,b_not_a,FALSE)<0) - HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINSERT, FAIL, "can't insert hyperslabs"); + HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINSERT, FAIL, "can't insert hyperslabs") /* Update the number of elements in current selection */ result->select.num_elem+=H5S_hyper_spans_nelem(b_not_a); @@ -6724,7 +6721,7 @@ H5S_operate_hyperslab (H5S_t *result, H5S_hyper_span_info_t *spans1, H5S_seloper /* Check if there are any non-overlapped selections */ if(a_not_b!=NULL) { if(H5S_hyper_merge_spans(result,a_not_b,TRUE)<0) - HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINSERT, FAIL, "can't insert hyperslabs"); + HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINSERT, FAIL, "can't insert hyperslabs") /* Update the number of elements in current selection */ result->select.num_elem=H5S_hyper_spans_nelem(a_not_b); @@ -6741,7 +6738,7 @@ H5S_operate_hyperslab (H5S_t *result, H5S_hyper_span_info_t *spans1, H5S_seloper /* Check if there are any non-overlapped selections */ if(b_not_a!=NULL) { if(H5S_hyper_merge_spans(result,b_not_a,TRUE)<0) - HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINSERT, FAIL, "can't insert hyperslabs"); + HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINSERT, FAIL, "can't insert hyperslabs") /* Update the number of elements in current selection */ result->select.num_elem=H5S_hyper_spans_nelem(b_not_a); @@ -6755,7 +6752,7 @@ H5S_operate_hyperslab (H5S_t *result, H5S_hyper_span_info_t *spans1, H5S_seloper break; default: - HGOTO_ERROR(H5E_ARGS, H5E_UNSUPPORTED, FAIL, "invalid selection operation"); + HGOTO_ERROR(H5E_ARGS, H5E_UNSUPPORTED, FAIL, "invalid selection operation") } /* end switch */ /* Free the hyperslab trees generated from the clipping algorithm */ @@ -6771,11 +6768,11 @@ H5S_operate_hyperslab (H5S_t *result, H5S_hyper_span_info_t *spans1, H5S_seloper H5S_hyper_span_info_t *spans; /* Empty hyperslab span tree */ /* Sanity check */ - assert(result->select.num_elem==0); + HDassert(result->select.num_elem == 0); /* Allocate a span info node */ if((spans = H5FL_MALLOC(H5S_hyper_span_info_t))==NULL) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate hyperslab span"); + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate hyperslab span") /* Set the reference count */ spans->count=1; @@ -6802,7 +6799,7 @@ H5S_operate_hyperslab (H5S_t *result, H5S_hyper_span_info_t *spans1, H5S_seloper } /* end else */ done: - FUNC_LEAVE_NOAPI(ret_value); + FUNC_LEAVE_NOAPI(ret_value) } /* end H5S_operate_hyperslab() */ @@ -6832,19 +6829,19 @@ H5S_generate_hyperslab (H5S_t *space, H5S_seloper_t op, hbool_t span2_owned=FALSE; /* Flag to indicate that span2 was used in H5S_operate_hyperslab() */ herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5S_generate_hyperslab); + FUNC_ENTER_NOAPI_NOINIT(H5S_generate_hyperslab) /* Check args */ - assert(space); - assert(op>H5S_SELECT_NOOP && op H5S_SELECT_NOOP && op < H5S_SELECT_INVALID); + HDassert(start); + HDassert(stride); + HDassert(count); + HDassert(block); /* Generate span tree for new hyperslab information */ if((new_spans=H5S_hyper_make_spans(space->extent.rank,start,stride,count,block))==NULL) - HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINSERT, FAIL, "can't create hyperslab information"); + HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINSERT, FAIL, "can't create hyperslab information") /* Copy the original dataspace */ if(space->select.sel_info.hslab->span_lst!=NULL) { @@ -6855,27 +6852,27 @@ H5S_generate_hyperslab (H5S_t *space, H5S_seloper_t op, /* Reset the other dataspace selection information */ if(H5S_SELECT_RELEASE(space)<0) - HGOTO_ERROR(H5E_DATASPACE, H5E_CANTDELETE, FAIL, "can't release selection"); + HGOTO_ERROR(H5E_DATASPACE, H5E_CANTDELETE, FAIL, "can't release selection") /* Allocate space for the hyperslab selection information */ if((space->select.sel_info.hslab=H5FL_MALLOC(H5S_hyper_sel_t))==NULL) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab info"); + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab info") } /* end if */ /* Combine tmp_space (really space) & new_space, with the result in space */ if(H5S_operate_hyperslab(space,tmp_spans,op,new_spans,TRUE,&span2_owned)<0) - HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCLIP, FAIL, "can't clip hyperslab information"); + HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCLIP, FAIL, "can't clip hyperslab information") done: /* Free temporary data structures */ if(tmp_spans!=NULL) if(H5S_hyper_free_span_info(tmp_spans)<0) - HDONE_ERROR(H5E_INTERNAL, H5E_CANTFREE, FAIL, "failed to release temporary hyperslab spans"); + HDONE_ERROR(H5E_INTERNAL, H5E_CANTFREE, FAIL, "failed to release temporary hyperslab spans") if(new_spans!=NULL && span2_owned==FALSE) if(H5S_hyper_free_span_info(new_spans)<0) - HDONE_ERROR(H5E_INTERNAL, H5E_CANTFREE, FAIL, "failed to release temporary hyperslab spans"); + HDONE_ERROR(H5E_INTERNAL, H5E_CANTFREE, FAIL, "failed to release temporary hyperslab spans") - FUNC_LEAVE_NOAPI(ret_value); + FUNC_LEAVE_NOAPI(ret_value) } /* end H5S_generate_hyperslab() */ @@ -6909,13 +6906,13 @@ H5S_select_hyperslab (H5S_t *space, H5S_seloper_t op, unsigned u; /* Counters */ herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5S_select_hyperslab, FAIL); + FUNC_ENTER_NOAPI(H5S_select_hyperslab, FAIL) /* Check args */ - assert(space); - assert(start); - assert(count); - assert(op>H5S_SELECT_NOOP && op H5S_SELECT_NOOP && op < H5S_SELECT_INVALID); /* Point to the correct stride values */ if(stride==NULL) @@ -6931,7 +6928,7 @@ H5S_select_hyperslab (H5S_t *space, H5S_seloper_t op, for(u=0; uextent.rank; u++) { /* Check for overlapping hyperslab blocks in new selection. */ if(count[u]>1 && stride[u]block[u]); + HDassert(stride[u] > block[u]); int_stride[u]=stride[u]; } /* end else */ int_count[u]=count[u]; @@ -7009,7 +7006,7 @@ H5S_select_hyperslab (H5S_t *space, H5S_seloper_t op, HGOTO_DONE(SUCCEED); /* Selection stays "none" */ default: - HGOTO_ERROR(H5E_ARGS, H5E_UNSUPPORTED, FAIL, "invalid selection operation"); + HGOTO_ERROR(H5E_ARGS, H5E_UNSUPPORTED, FAIL, "invalid selection operation") } /* end switch */ break; @@ -7046,18 +7043,18 @@ H5S_select_hyperslab (H5S_t *space, H5S_seloper_t op, /* Convert to hyperslab selection */ if(H5S_select_hyperslab(space,H5S_SELECT_SET,tmp_start,tmp_stride,tmp_count,tmp_block)<0) - HGOTO_ERROR(H5E_DATASPACE, H5E_CANTDELETE, FAIL, "can't convert selection"); + HGOTO_ERROR(H5E_DATASPACE, H5E_CANTDELETE, FAIL, "can't convert selection") } /* end case */ break; case H5S_SELECT_NOTA: /* Binary "B not A" operation for hyperslabs */ /* Convert to "none" selection */ if(H5S_select_none(space)<0) - HGOTO_ERROR(H5E_DATASPACE, H5E_CANTDELETE, FAIL, "can't convert selection"); + HGOTO_ERROR(H5E_DATASPACE, H5E_CANTDELETE, FAIL, "can't convert selection") HGOTO_DONE(SUCCEED); default: - HGOTO_ERROR(H5E_ARGS, H5E_UNSUPPORTED, FAIL, "invalid selection operation"); + HGOTO_ERROR(H5E_ARGS, H5E_UNSUPPORTED, FAIL, "invalid selection operation") } /* end switch */ break; @@ -7071,18 +7068,18 @@ H5S_select_hyperslab (H5S_t *space, H5S_seloper_t op, /* Else fall through to error */ default: - HGOTO_ERROR(H5E_ARGS, H5E_UNSUPPORTED, FAIL, "invalid selection operation"); + HGOTO_ERROR(H5E_ARGS, H5E_UNSUPPORTED, FAIL, "invalid selection operation") } /* end switch */ if(op==H5S_SELECT_SET) { /* If we are setting a new selection, remove current selection first */ if(H5S_SELECT_RELEASE(space)<0) - HGOTO_ERROR(H5E_DATASPACE, H5E_CANTDELETE, FAIL, "can't release hyperslab"); + HGOTO_ERROR(H5E_DATASPACE, H5E_CANTDELETE, FAIL, "can't release hyperslab") /* Allocate space for the hyperslab selection information */ if((space->select.sel_info.hslab=H5FL_MALLOC(H5S_hyper_sel_t))==NULL) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate hyperslab info"); + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate hyperslab info") /* Save the diminfo */ space->select.num_elem=1; @@ -7108,28 +7105,28 @@ H5S_select_hyperslab (H5S_t *space, H5S_seloper_t op, } /* end if */ else if(op>=H5S_SELECT_OR && op<=H5S_SELECT_NOTA) { /* Sanity check */ - assert(H5S_GET_SELECT_TYPE(space)==H5S_SEL_HYPERSLABS); + HDassert(H5S_GET_SELECT_TYPE(space) == H5S_SEL_HYPERSLABS); /* Check if there's no hyperslab span information currently */ if(space->select.sel_info.hslab->span_lst==NULL) if(H5S_hyper_generate_spans(space)<0) - HGOTO_ERROR(H5E_DATASPACE, H5E_UNINITIALIZED, FAIL, "dataspace does not have span tree"); + HGOTO_ERROR(H5E_DATASPACE, H5E_UNINITIALIZED, FAIL, "dataspace does not have span tree") /* Add in the new hyperslab information */ if(H5S_generate_hyperslab (space, op, start, opt_stride, opt_count, opt_block)<0) - HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINSERT, FAIL, "can't generate hyperslabs"); + HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINSERT, FAIL, "can't generate hyperslabs") /* Indicate that the regular dimensions are no longer valid */ space->select.sel_info.hslab->diminfo_valid=FALSE; } /* end if */ else - HGOTO_ERROR(H5E_ARGS, H5E_UNSUPPORTED, FAIL, "invalid selection operation"); + HGOTO_ERROR(H5E_ARGS, H5E_UNSUPPORTED, FAIL, "invalid selection operation") /* Set selection type */ space->select.type=H5S_sel_hyper; done: - FUNC_LEAVE_NOAPI(ret_value); + FUNC_LEAVE_NOAPI(ret_value) } /* end H5S_select_hyperslab() */ @@ -7166,35 +7163,35 @@ H5Sselect_hyperslab(hid_t space_id, H5S_seloper_t op, const hsize_t start[], H5S_t *space = NULL; /* Dataspace to modify selection of */ herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Sselect_hyperslab, FAIL); + FUNC_ENTER_API(H5Sselect_hyperslab, FAIL) H5TRACE6("e", "iSs*h*h*h*h", space_id, op, start, stride, count, block); /* Check args */ if (NULL == (space=H5I_object_verify(space_id, H5I_DATASPACE))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data space"); + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data space") if (H5S_SCALAR==H5S_GET_EXTENT_TYPE(space)) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "hyperslab doesn't support H5S_SCALAR space"); + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "hyperslab doesn't support H5S_SCALAR space") if (H5S_NULL==H5S_GET_EXTENT_TYPE(space)) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "hyperslab doesn't support H5S_NULL space"); + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "hyperslab doesn't support H5S_NULL space") if(start==NULL || count==NULL) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "hyperslab not specified"); + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "hyperslab not specified") if(!(op>H5S_SELECT_NOOP && opextent.rank; u++) { if(stride[u]==0) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid stride==0 value"); + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid stride==0 value") } /* end for */ } /* end if */ if (H5S_select_hyperslab(space, op, start, stride, count, block)<0) - HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINIT, FAIL, "unable to set hyperslab selection"); + HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINIT, FAIL, "unable to set hyperslab selection") done: - FUNC_LEAVE_API(ret_value); + FUNC_LEAVE_API(ret_value) } /* end H5Sselect_hyperslab() */ @@ -7235,35 +7232,35 @@ H5Scombine_hyperslab(hid_t space_id, H5S_seloper_t op, const hsize_t start[], H5S_t *new_space = NULL; /* New dataspace created */ hid_t ret_value; - FUNC_ENTER_API(H5Scombine_hyperslab, FAIL); + FUNC_ENTER_API(H5Scombine_hyperslab, FAIL) H5TRACE6("i", "iSs*h*h*h*h", space_id, op, start, stride, count, block); /* Check args */ if (NULL == (space=H5I_object_verify(space_id, H5I_DATASPACE))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data space"); + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data space") if(start==NULL || count==NULL) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "hyperslab not specified"); + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "hyperslab not specified") if(!(op>H5S_SELECT_NOOP && opH5S_SELECT_NOOP && op H5S_SELECT_NOOP && op < H5S_SELECT_INVALID); /* Check that the space selections both have span trees */ if(space1->select.sel_info.hslab->span_lst==NULL) if(H5S_hyper_generate_spans(space1)<0) - HGOTO_ERROR(H5E_DATASPACE, H5E_UNINITIALIZED, NULL, "dataspace does not have span tree"); + HGOTO_ERROR(H5E_DATASPACE, H5E_UNINITIALIZED, NULL, "dataspace does not have span tree") if(space2->select.sel_info.hslab->span_lst==NULL) if(H5S_hyper_generate_spans(space2)<0) - HGOTO_ERROR(H5E_DATASPACE, H5E_UNINITIALIZED, NULL, "dataspace does not have span tree"); + HGOTO_ERROR(H5E_DATASPACE, H5E_UNINITIALIZED, NULL, "dataspace does not have span tree") /* Copy the first dataspace */ if (NULL == (new_space = H5S_copy (space1, TRUE, TRUE))) - HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINIT, NULL, "unable to copy data space"); + HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINIT, NULL, "unable to copy data space") /* Free the current selection for the new dataspace */ if(H5S_SELECT_RELEASE(new_space)<0) - HGOTO_ERROR(H5E_DATASPACE, H5E_CANTDELETE, NULL, "can't release selection"); + HGOTO_ERROR(H5E_DATASPACE, H5E_CANTDELETE, NULL, "can't release selection") /* Allocate space for the hyperslab selection information */ if((new_space->select.sel_info.hslab=H5FL_CALLOC(H5S_hyper_sel_t))==NULL) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate hyperslab info"); + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate hyperslab info") /* Combine space1 & space2, with the result in new_space */ if(H5S_operate_hyperslab(new_space,space1->select.sel_info.hslab->span_lst,op,space2->select.sel_info.hslab->span_lst,FALSE,&span2_owned)<0) - HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCLIP, NULL, "can't clip hyperslab information"); + HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCLIP, NULL, "can't clip hyperslab information") /* Set return value */ ret_value=new_space; @@ -7326,7 +7323,7 @@ done: if(ret_value==NULL && new_space!=NULL) H5S_close(new_space); - FUNC_LEAVE_NOAPI(ret_value); + FUNC_LEAVE_NOAPI(ret_value) } /* end H5S_combine_select() */ @@ -7360,38 +7357,38 @@ H5Scombine_select(hid_t space1_id, H5S_seloper_t op, hid_t space2_id) H5S_t *new_space = NULL; /* New Dataspace */ hid_t ret_value; - FUNC_ENTER_API(H5Scombine_select, FAIL); + FUNC_ENTER_API(H5Scombine_select, FAIL) H5TRACE3("i", "iSsi", space1_id, op, space2_id); /* Check args */ if (NULL == (space1=H5I_object_verify(space1_id, H5I_DATASPACE))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data space"); + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data space") if (NULL == (space2=H5I_object_verify(space2_id, H5I_DATASPACE))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data space"); + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data space") if(!(op>H5S_SELECT_NOOP && opextent.rank!=space2->extent.rank) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "dataspaces not same rank"); + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "dataspaces not same rank") /* Check that both dataspaces have hyperslab selections */ if(H5S_GET_SELECT_TYPE(space1)!=H5S_SEL_HYPERSLABS || H5S_GET_SELECT_TYPE(space2)!=H5S_SEL_HYPERSLABS) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "dataspaces don't have hyperslab selections"); + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "dataspaces don't have hyperslab selections") /* Go combine the dataspaces */ if ((new_space=H5S_combine_select(space1, op, space2))==NULL) - HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINIT, FAIL, "unable to create hyperslab selection"); + HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINIT, FAIL, "unable to create hyperslab selection") /* Atomize */ if ((ret_value=H5I_register (H5I_DATASPACE, new_space, TRUE))<0) - HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register dataspace atom"); + HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register dataspace atom") done: if (ret_value<0 && new_space) H5S_close(new_space); - FUNC_LEAVE_API(ret_value); + FUNC_LEAVE_API(ret_value) } /* end H5Scombine_select() */ @@ -7416,20 +7413,20 @@ H5S_select_select (H5S_t *space1, H5S_seloper_t op, H5S_t *space2) hbool_t span2_owned=FALSE; /* Flag to indicate that span2 was used in H5S_operate_hyperslab() */ herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5S_select_select); + FUNC_ENTER_NOAPI_NOINIT(H5S_select_select) /* Check args */ - assert(space1); - assert(space2); - assert(op>H5S_SELECT_NOOP && op H5S_SELECT_NOOP && op < H5S_SELECT_INVALID); /* Check that the space selections both have span trees */ if(space1->select.sel_info.hslab->span_lst==NULL) if(H5S_hyper_generate_spans(space1)<0) - HGOTO_ERROR(H5E_DATASPACE, H5E_UNINITIALIZED, FAIL, "dataspace does not have span tree"); + HGOTO_ERROR(H5E_DATASPACE, H5E_UNINITIALIZED, FAIL, "dataspace does not have span tree") if(space2->select.sel_info.hslab->span_lst==NULL) if(H5S_hyper_generate_spans(space2)<0) - HGOTO_ERROR(H5E_DATASPACE, H5E_UNINITIALIZED, FAIL, "dataspace does not have span tree"); + HGOTO_ERROR(H5E_DATASPACE, H5E_UNINITIALIZED, FAIL, "dataspace does not have span tree") /* Take ownership of the dataspace's hyperslab spans */ /* (These are freed later) */ @@ -7438,21 +7435,21 @@ H5S_select_select (H5S_t *space1, H5S_seloper_t op, H5S_t *space2) /* Reset the other dataspace selection information */ if(H5S_SELECT_RELEASE(space1)<0) - HGOTO_ERROR(H5E_DATASPACE, H5E_CANTDELETE, FAIL, "can't release selection"); + HGOTO_ERROR(H5E_DATASPACE, H5E_CANTDELETE, FAIL, "can't release selection") /* Allocate space for the hyperslab selection information */ if((space1->select.sel_info.hslab=H5FL_CALLOC(H5S_hyper_sel_t))==NULL) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab info"); + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab info") /* Combine tmp_spans (from space1) & spans from space2, with the result in space1 */ if(H5S_operate_hyperslab(space1,tmp_spans,op,space2->select.sel_info.hslab->span_lst,FALSE,&span2_owned)<0) - HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCLIP, FAIL, "can't clip hyperslab information"); + HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCLIP, FAIL, "can't clip hyperslab information") done: if(tmp_spans!=NULL) H5S_hyper_free_span_info(tmp_spans); - FUNC_LEAVE_NOAPI(ret_value); + FUNC_LEAVE_NOAPI(ret_value) } /* end H5S_select_select() */ @@ -7485,31 +7482,31 @@ H5Sselect_select(hid_t space1_id, H5S_seloper_t op, hid_t space2_id) H5S_t *space2; /* Second Dataspace */ herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Sselect_select, FAIL); + FUNC_ENTER_API(H5Sselect_select, FAIL) H5TRACE3("e", "iSsi", space1_id, op, space2_id); /* Check args */ if (NULL == (space1=H5I_object_verify(space1_id, H5I_DATASPACE))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data space"); + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data space") if (NULL == (space2=H5I_object_verify(space2_id, H5I_DATASPACE))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data space"); + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data space") if(!(op>H5S_SELECT_NOOP && opextent.rank!=space2->extent.rank) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "dataspaces not same rank"); + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "dataspaces not same rank") /* Check that both dataspaces have hyperslab selections */ if(H5S_GET_SELECT_TYPE(space1)!=H5S_SEL_HYPERSLABS || H5S_GET_SELECT_TYPE(space2)!=H5S_SEL_HYPERSLABS) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "dataspaces don't have hyperslab selections"); + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "dataspaces don't have hyperslab selections") /* Go refine the first selection */ if (H5S_select_select(space1, op, space2)<0) - HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINIT, FAIL, "unable to modify hyperslab selection"); + HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINIT, FAIL, "unable to modify hyperslab selection") done: - FUNC_LEAVE_API(ret_value); + FUNC_LEAVE_API(ret_value) } /* end H5Sselect_select() */ #endif /* NEW_HYPERSLAB_API */ /* Works */ @@ -7973,10 +7970,10 @@ H5S_hyper_get_seq_list_opt(const H5S_t *space, H5S_sel_iter_t *iter, hsize_t *mem_size; /* Size of the source buffer */ hsize_t slab[H5O_LAYOUT_NDIMS]; /* Hyperslab size */ const hssize_t *sel_off; /* Selection offset in dataspace */ - hsize_t offset[H5O_LAYOUT_NDIMS]; /* Coordinate offset in dataspace */ + hsize_t offset[H5O_LAYOUT_NDIMS]; /* Coordinate offset in dataspace */ hsize_t tmp_count[H5O_LAYOUT_NDIMS];/* Temporary block count */ hsize_t tmp_block[H5O_LAYOUT_NDIMS];/* Temporary block offset */ - hsize_t wrap[H5O_LAYOUT_NDIMS]; /* Bytes to wrap around at the end of a row */ + hsize_t wrap[H5O_LAYOUT_NDIMS]; /* Bytes to wrap around at the end of a row */ hsize_t skip[H5O_LAYOUT_NDIMS]; /* Bytes to skip between blocks */ const H5S_hyper_dim_t *tdiminfo; /* Temporary pointer to diminfo information */ hsize_t fast_dim_start, /* Local copies of fastest changing dimension info */ @@ -7994,15 +7991,14 @@ H5S_hyper_get_seq_list_opt(const H5S_t *space, H5S_sel_iter_t *iter, int temp_dim; /* Temporary rank holder */ hsize_t acc; /* Accumulator */ hsize_t loc; /* Coordinate offset */ - unsigned u; /* Local index variable */ - int i; /* Local index variable */ - size_t curr_seq=0; /* Current sequence being operated on */ + size_t curr_seq = 0; /* Current sequence being operated on */ size_t actual_elem; /* The actual number of elements to count */ size_t actual_bytes;/* The actual number of bytes to copy */ - size_t nelmts; /* Starting number of elements */ size_t io_left; /* The number of elements left in I/O operation */ size_t start_io_left; /* The initial number of elements left in I/O operation */ size_t elem_size; /* Size of each element iterating over */ + unsigned u; /* Local index variable */ + int i; /* Local index variable */ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_hyper_get_seq_list_opt) @@ -8051,251 +8047,118 @@ H5S_hyper_get_seq_list_opt(const H5S_t *space, H5S_sel_iter_t *iter, } /* end for */ /* Calculate the number of elements to sequence through */ - H5_CHECK_OVERFLOW(iter->elmt_left,hsize_t,size_t); - start_io_left=io_left=MIN((size_t)iter->elmt_left,maxelem); - - /* Check if we stopped in the middle of a sequence of elements */ - if((iter->u.hyp.off[fast_dim]-tdiminfo[fast_dim].start)%tdiminfo[fast_dim].stride!=0 || - ((iter->u.hyp.off[fast_dim]!=tdiminfo[fast_dim].start) && tdiminfo[fast_dim].count==1)) { - size_t leftover; /* The number of elements left over from the last sequence */ - - /* Calculate the number of elements left in the sequence */ - if(tdiminfo[fast_dim].count==1) { - H5_ASSIGN_OVERFLOW(leftover, tdiminfo[fast_dim].block-(iter->u.hyp.off[fast_dim]-tdiminfo[fast_dim].start) ,hsize_t,size_t); - } /* end if */ - else { - H5_ASSIGN_OVERFLOW(leftover, tdiminfo[fast_dim].block-((iter->u.hyp.off[fast_dim]-tdiminfo[fast_dim].start)%tdiminfo[fast_dim].stride) ,hsize_t,size_t); - } /* end else */ - - /* Make certain that we don't write too many */ - actual_elem=MIN(leftover,io_left); - - /* Compute the initial buffer offset */ - for(u = 0, loc = 0; u < ndims; u++) - loc += ((hsize_t)((hssize_t)iter->u.hyp.off[u] + sel_off[u])) * slab[u]; - - /* Add a new sequence */ - off[curr_seq] = loc; - H5_ASSIGN_OVERFLOW(len[curr_seq], actual_elem * elem_size, hsize_t, size_t); - - /* Increment sequence count */ - curr_seq++; - - /* Decrement the number of elements left */ - io_left -= actual_elem; - - /* Advance the hyperslab iterator */ - H5S_hyper_iter_next(iter, actual_elem); + H5_CHECK_OVERFLOW(iter->elmt_left, hsize_t, size_t); + io_left = MIN((size_t)iter->elmt_left, maxelem); - /* Decrement the number of elements left in selection */ - iter->elmt_left -= actual_elem; - } /* end if */ + /* Sanity check that there aren't any "remainder" sequences in process */ + HDassert(!((iter->u.hyp.off[fast_dim] - tdiminfo[fast_dim].start) % tdiminfo[fast_dim].stride != 0 || + ((iter->u.hyp.off[fast_dim] != tdiminfo[fast_dim].start) && tdiminfo[fast_dim].count == 1))); - /* Now that we've cleared the "remainder" of the previous fastest dimension - * sequence, we must be at the beginning of a sequence, so use the fancy - * algorithm to compute the offsets and run through as many as possible, - * until the buffer fills up. + /* We've cleared the "remainder" of the previous fastest dimension + * sequence before calling this routine, so we must be at the beginning of + * a sequence. Use the fancy algorithm to compute the offsets and run + * through as many as possible, until the buffer fills up. */ - if(io_left > 0 && curr_seq < maxseq) { /* Just in case the "remainder" above filled the buffer */ - /* Keep the number of elements we started with */ - nelmts = io_left; - - /* Compute the arrays to perform I/O on */ - - /* Copy the location of the point to get */ - /* (Add in the selection offset) */ - for(u = 0; u < ndims; u++) - offset[u] = (hsize_t)((hssize_t)iter->u.hyp.off[u] + sel_off[u]); - - /* Compute the current "counts" for this location */ - for(u = 0; u < ndims; u++) { - if(tdiminfo[u].count == 1) { - tmp_count[u] = 0; - tmp_block[u] = iter->u.hyp.off[u] - tdiminfo[u].start; - } /* end if */ - else { - tmp_count[u] = (iter->u.hyp.off[u] - tdiminfo[u].start) / tdiminfo[u].stride; - tmp_block[u] = (iter->u.hyp.off[u] - tdiminfo[u].start) % tdiminfo[u].stride; - } /* end else */ - } /* end for */ - /* Compute the initial buffer offset */ - for(u = 0, loc = 0; u < ndims; u++) - loc += offset[u] * slab[u]; + /* Keep the number of elements we started with */ + start_io_left = io_left; - /* Set the number of elements to write each time */ - H5_ASSIGN_OVERFLOW(actual_elem,tdiminfo[fast_dim].block,hsize_t,size_t); + /* Compute the arrays to perform I/O on */ - /* Set the number of actual bytes */ - actual_bytes=actual_elem*elem_size; + /* Copy the location of the point to get */ + /* (Add in the selection offset) */ + for(u = 0; u < ndims; u++) + offset[u] = (hsize_t)((hssize_t)iter->u.hyp.off[u] + sel_off[u]); - /* Set local copies of information for the fastest changing dimension */ - fast_dim_start = tdiminfo[fast_dim].start; - fast_dim_stride = tdiminfo[fast_dim].stride; - fast_dim_block = tdiminfo[fast_dim].block; - H5_ASSIGN_OVERFLOW(fast_dim_buf_off, slab[fast_dim] * fast_dim_stride, hsize_t, size_t); - fast_dim_offset = (hsize_t)((hssize_t)fast_dim_start + sel_off[fast_dim]); + /* Compute the current "counts" for this location */ + for(u = 0; u < ndims; u++) { + if(tdiminfo[u].count == 1) { + tmp_count[u] = 0; + tmp_block[u] = iter->u.hyp.off[u] - tdiminfo[u].start; + } /* end if */ + else { + tmp_count[u] = (iter->u.hyp.off[u] - tdiminfo[u].start) / tdiminfo[u].stride; + tmp_block[u] = (iter->u.hyp.off[u] - tdiminfo[u].start) % tdiminfo[u].stride; + } /* end else */ + } /* end for */ - /* Compute the number of blocks which would fit into the buffer */ - H5_CHECK_OVERFLOW(io_left / fast_dim_block, hsize_t, size_t); - tot_blk_count = (size_t)(io_left / fast_dim_block); + /* Compute the initial buffer offset */ + for(u = 0, loc = 0; u < ndims; u++) + loc += offset[u] * slab[u]; - /* Don't go over the maximum number of sequences allowed */ - tot_blk_count = MIN(tot_blk_count, (maxseq - curr_seq)); + /* Set the number of elements to write each time */ + H5_ASSIGN_OVERFLOW(actual_elem, tdiminfo[fast_dim].block, hsize_t, size_t); - /* Compute the amount to wrap at the end of each row */ - for(u = 0; u < ndims; u++) - wrap[u] = (mem_size[u] - (tdiminfo[u].stride * tdiminfo[u].count)) * slab[u]; + /* Set the number of actual bytes */ + actual_bytes = actual_elem * elem_size; - /* Compute the amount to skip between blocks */ - for(u = 0; u < ndims; u++) - skip[u] = (tdiminfo[u].stride - tdiminfo[u].block) * slab[u]; + /* Set local copies of information for the fastest changing dimension */ + fast_dim_start = tdiminfo[fast_dim].start; + fast_dim_stride = tdiminfo[fast_dim].stride; + fast_dim_block = tdiminfo[fast_dim].block; + H5_ASSIGN_OVERFLOW(fast_dim_buf_off, slab[fast_dim] * fast_dim_stride, hsize_t, size_t); + fast_dim_offset = (hsize_t)((hssize_t)fast_dim_start + sel_off[fast_dim]); - /* Check if there is a partial row left (with full blocks) */ - if(tmp_count[fast_dim] > 0) { - /* Get number of blocks in fastest dimension */ - H5_ASSIGN_OVERFLOW(fast_dim_count, tdiminfo[fast_dim].count - tmp_count[fast_dim], hsize_t, size_t); + /* Compute the number of blocks which would fit into the buffer */ + H5_CHECK_OVERFLOW(io_left / fast_dim_block, hsize_t, size_t); + tot_blk_count = (size_t)(io_left / fast_dim_block); - /* Make certain this entire row will fit into buffer */ - fast_dim_count=MIN(fast_dim_count,tot_blk_count); + /* Don't go over the maximum number of sequences allowed */ + tot_blk_count = MIN(tot_blk_count, (maxseq - curr_seq)); - /* Number of blocks to sequence over */ - act_blk_count=fast_dim_count; + /* Compute the amount to wrap at the end of each row */ + for(u = 0; u < ndims; u++) + wrap[u] = (mem_size[u] - (tdiminfo[u].stride * tdiminfo[u].count)) * slab[u]; - /* Loop over all the blocks in the fastest changing dimension */ - while(fast_dim_count>0) { - /* Store the sequence information */ - off[curr_seq]=loc; - len[curr_seq]=actual_bytes; + /* Compute the amount to skip between blocks */ + for(u = 0; u < ndims; u++) + skip[u] = (tdiminfo[u].stride - tdiminfo[u].block) * slab[u]; - /* Increment sequence count */ - curr_seq++; + /* Check if there is a partial row left (with full blocks) */ + if(tmp_count[fast_dim] > 0) { + /* Get number of blocks in fastest dimension */ + H5_ASSIGN_OVERFLOW(fast_dim_count, tdiminfo[fast_dim].count - tmp_count[fast_dim], hsize_t, size_t); - /* Increment information to reflect block just processed */ - loc+=fast_dim_buf_off; + /* Make certain this entire row will fit into buffer */ + fast_dim_count = MIN(fast_dim_count, tot_blk_count); - /* Decrement number of blocks */ - fast_dim_count--; - } /* end while */ + /* Number of blocks to sequence over */ + act_blk_count = fast_dim_count; - /* Decrement number of elements left */ - io_left -= actual_elem*act_blk_count; + /* Loop over all the blocks in the fastest changing dimension */ + while(fast_dim_count > 0) { + /* Store the sequence information */ + off[curr_seq] = loc; + len[curr_seq] = actual_bytes; - /* Decrement number of blocks left */ - tot_blk_count -= act_blk_count; + /* Increment sequence count */ + curr_seq++; /* Increment information to reflect block just processed */ - tmp_count[fast_dim]+=act_blk_count; - - /* Check if we finished the entire row of blocks */ - if(tmp_count[fast_dim]>=tdiminfo[fast_dim].count) { - /* Increment offset in destination buffer */ - loc += wrap[fast_dim]; - - /* Increment information to reflect block just processed */ - offset[fast_dim]=fast_dim_offset; /* reset the offset in the fastest dimension */ - tmp_count[fast_dim]=0; - - /* Increment the offset and count for the other dimensions */ - temp_dim = (int)fast_dim - 1; - while(temp_dim >= 0) { - /* Move to the next row in the curent dimension */ - offset[temp_dim]++; - tmp_block[temp_dim]++; - - /* If this block is still in the range of blocks to output for the dimension, break out of loop */ - if(tmp_block[temp_dim] < tdiminfo[temp_dim].block) - break; - else { - /* Move to the next block in the current dimension */ - offset[temp_dim] += (tdiminfo[temp_dim].stride - tdiminfo[temp_dim].block); - loc += skip[temp_dim]; - tmp_block[temp_dim] = 0; - tmp_count[temp_dim]++; - - /* If this block is still in the range of blocks to output for the dimension, break out of loop */ - if(tmp_count[temp_dim]0) { + /* Decrement number of elements left */ + io_left -= actual_elem * act_blk_count; -#define DUFF_GUTS \ - /* Store the sequence information */ \ - off[curr_seq] = loc; \ - len[curr_seq] = actual_bytes; \ - \ - /* Increment sequence count */ \ - curr_seq++; \ - \ - /* Increment information to reflect block just processed */ \ - loc += fast_dim_buf_off; + /* Decrement number of blocks left */ + tot_blk_count -= act_blk_count; -#ifdef NO_DUFFS_DEVICE - /* Loop over all the blocks in the fastest changing dimension */ - while(fast_dim_count>0) { - DUFF_GUTS - - /* Decrement number of blocks */ - fast_dim_count--; - } /* end while */ -#else /* NO_DUFFS_DEVICE */ - { - size_t duffs_index; /* Counting index for Duff's device */ - - duffs_index = (fast_dim_count + 7) / 8; - switch (fast_dim_count % 8) { - case 0: - do - { - DUFF_GUTS - case 7: - DUFF_GUTS - case 6: - DUFF_GUTS - case 5: - DUFF_GUTS - case 4: - DUFF_GUTS - case 3: - DUFF_GUTS - case 2: - DUFF_GUTS - case 1: - DUFF_GUTS - } while (--duffs_index > 0); - } /* end switch */ - } -#endif /* NO_DUFFS_DEVICE */ -#undef DUFF_GUTS + /* Increment information to reflect block just processed */ + tmp_count[fast_dim] += act_blk_count; + /* Check if we finished the entire row of blocks */ + if(tmp_count[fast_dim] >= tdiminfo[fast_dim].count) { /* Increment offset in destination buffer */ loc += wrap[fast_dim]; + /* Increment information to reflect block just processed */ + offset[fast_dim] = fast_dim_offset; /* reset the offset in the fastest dimension */ + tmp_count[fast_dim] = 0; + /* Increment the offset and count for the other dimensions */ temp_dim = (int)fast_dim - 1; while(temp_dim >= 0) { @@ -8314,7 +8177,7 @@ H5S_hyper_get_seq_list_opt(const H5S_t *space, H5S_sel_iter_t *iter, tmp_count[temp_dim]++; /* If this block is still in the range of blocks to output for the dimension, break out of loop */ - if(tmp_count[temp_dim] 0) { + +#define DUFF_GUTS \ +/* Store the sequence information */ \ +off[curr_seq] = loc; \ +len[curr_seq] = actual_bytes; \ + \ +/* Increment sequence count */ \ +curr_seq++; \ + \ +/* Increment information to reflect block just processed */ \ +loc += fast_dim_buf_off; + +#ifdef NO_DUFFS_DEVICE + /* Loop over all the blocks in the fastest changing dimension */ + while(fast_dim_count > 0) { + DUFF_GUTS + + /* Decrement number of blocks */ + fast_dim_count--; } /* end while */ +#else /* NO_DUFFS_DEVICE */ + { + size_t duffs_index; /* Counting index for Duff's device */ + + duffs_index = (fast_dim_count + 7) / 8; + switch (fast_dim_count % 8) { + case 0: + do + { + DUFF_GUTS + case 7: + DUFF_GUTS + case 6: + DUFF_GUTS + case 5: + DUFF_GUTS + case 4: + DUFF_GUTS + case 3: + DUFF_GUTS + case 2: + DUFF_GUTS + case 1: + DUFF_GUTS + } while (--duffs_index > 0); + } /* end switch */ + } +#endif /* NO_DUFFS_DEVICE */ +#undef DUFF_GUTS - /* Adjust the number of blocks & elements left to transfer */ + /* Increment offset in destination buffer */ + loc += wrap[fast_dim]; - /* Decrement number of elements left */ - H5_CHECK_OVERFLOW(actual_elem * (total_rows * tdiminfo[fast_dim].count), hsize_t, size_t); - io_left -= (size_t)(actual_elem * (total_rows * tdiminfo[fast_dim].count)); + /* Increment the offset and count for the other dimensions */ + temp_dim = (int)fast_dim - 1; + while(temp_dim >= 0) { + /* Move to the next row in the curent dimension */ + offset[temp_dim]++; + tmp_block[temp_dim]++; - /* Decrement number of blocks left */ - H5_CHECK_OVERFLOW( (total_rows*tdiminfo[fast_dim].count) ,hsize_t,size_t); - tot_blk_count -= (size_t)(total_rows*tdiminfo[fast_dim].count); + /* If this block is still in the range of blocks to output for the dimension, break out of loop */ + if(tmp_block[temp_dim] < tdiminfo[temp_dim].block) + break; + else { + /* Move to the next block in the current dimension */ + offset[temp_dim] += (tdiminfo[temp_dim].stride - tdiminfo[temp_dim].block); + loc += skip[temp_dim]; + tmp_block[temp_dim] = 0; + tmp_count[temp_dim]++; - /* Read in partial row of blocks */ - if(io_left>0 && curr_seq0) { - /* Store the sequence information */ - off[curr_seq]=loc; - len[curr_seq]=actual_bytes; + /* Adjust the number of blocks & elements left to transfer */ - /* Increment sequence count */ - curr_seq++; + /* Decrement number of elements left */ + H5_CHECK_OVERFLOW(actual_elem * (total_rows * tdiminfo[fast_dim].count), hsize_t, size_t); + io_left -= (size_t)(actual_elem * (total_rows * tdiminfo[fast_dim].count)); - /* Increment information to reflect block just processed */ - loc+=fast_dim_buf_off; + /* Decrement number of blocks left */ + H5_CHECK_OVERFLOW((total_rows * tdiminfo[fast_dim].count), hsize_t, size_t); + tot_blk_count -= (size_t)(total_rows * tdiminfo[fast_dim].count); - /* Decrement number of blocks */ - fast_dim_count--; - } /* end while */ + /* Read in partial row of blocks */ + if(io_left > 0 && curr_seq < maxseq) { + /* Get remaining number of blocks left to output */ + fast_dim_count = tot_blk_count; - /* Decrement number of elements left */ - io_left -= actual_elem*tot_blk_count; + /* Loop over all the blocks in the fastest changing dimension */ + while(fast_dim_count > 0) { + /* Store the sequence information */ + off[curr_seq] = loc; + len[curr_seq] = actual_bytes; + + /* Increment sequence count */ + curr_seq++; /* Increment information to reflect block just processed */ - offset[fast_dim]+=(fast_dim_stride*tot_blk_count); /* move the offset in the fastest dimension */ + loc += fast_dim_buf_off; + + /* Decrement number of blocks */ + fast_dim_count--; + } /* end while */ + + /* Decrement number of elements left */ + io_left -= actual_elem * tot_blk_count; + + /* Increment information to reflect block just processed */ + offset[fast_dim] += (fast_dim_stride * tot_blk_count); /* move the offset in the fastest dimension */ + + /* Handle any leftover, partial blocks in this row */ + if(io_left > 0 && curr_seq < maxseq) { + actual_elem = io_left; + actual_bytes = actual_elem * elem_size; + + /* Store the sequence information */ + off[curr_seq] = loc; + len[curr_seq] = actual_bytes; + + /* Increment sequence count */ + curr_seq++; + + /* Decrement the number of elements left */ + io_left -= actual_elem; + + /* Increment buffer correctly */ + offset[fast_dim] += actual_elem; + } /* end if */ + + /* don't bother checking slower dimensions */ + HDassert(io_left == 0 || curr_seq == maxseq); + } /* end if */ + + /* Update the iterator */ + + /* Update the iterator with the location we stopped */ + /* (Subtract out the selection offset) */ + for(u = 0; u < ndims; u++) + iter->u.hyp.off[u] = (hsize_t)((hssize_t)offset[u] - sel_off[u]); + + /* Decrement the number of elements left in selection */ + iter->elmt_left -= (start_io_left - io_left); + + /* Increment the number of sequences generated */ + *nseq += curr_seq; + + /* Increment the number of elements used */ + *nelem += start_io_left - io_left; + + FUNC_LEAVE_NOAPI(SUCCEED) +} /* end H5S_hyper_get_seq_list_opt() */ + + +/*-------------------------------------------------------------------------- + NAME + H5S_hyper_get_seq_list_single + PURPOSE + Create a list of offsets & lengths for a selection + USAGE + herr_t H5S_hyper_get_seq_list_single(space, flags, iter, maxseq, maxelem, nseq, nelem, off, len) + H5S_t *space; IN: Dataspace containing selection to use. + unsigned flags; IN: Flags for extra information about operation + H5S_sel_iter_t *iter; IN/OUT: Selection iterator describing last + position of interest in selection. + size_t maxseq; IN: Maximum number of sequences to generate + size_t maxelem; IN: Maximum number of elements to include in the + generated sequences + size_t *nseq; OUT: Actual number of sequences generated + size_t *nelem; OUT: Actual number of elements in sequences generated + hsize_t *off; OUT: Array of offsets + size_t *len; OUT: Array of lengths + RETURNS + Non-negative on success/Negative on failure. + DESCRIPTION + Use the selection in the dataspace to generate a list of byte offsets and + lengths for the region(s) selected. Start/Restart from the position in the + ITER parameter. The number of sequences generated is limited by the MAXSEQ + parameter and the number of sequences actually generated is stored in the + NSEQ parameter. + GLOBAL VARIABLES + COMMENTS, BUGS, ASSUMPTIONS + EXAMPLES + REVISION LOG +--------------------------------------------------------------------------*/ +static herr_t +H5S_hyper_get_seq_list_single(const H5S_t *space, H5S_sel_iter_t *iter, + size_t maxseq, size_t maxelem, size_t *nseq, size_t *nelem, + hsize_t *off, size_t *len) +{ + const H5S_hyper_dim_t *tdiminfo; /* Temporary pointer to diminfo information */ + const hssize_t *sel_off; /* Selection offset in dataspace */ + hsize_t *mem_size; /* Size of the source buffer */ + hsize_t base_offset[H5O_LAYOUT_NDIMS]; /* Base coordinate offset in dataspace */ + hsize_t offset[H5O_LAYOUT_NDIMS]; /* Coordinate offset in dataspace */ + hsize_t slab[H5O_LAYOUT_NDIMS]; /* Hyperslab size */ + hsize_t fast_dim_block; /* Local copies of fastest changing dimension info */ + hsize_t acc; /* Accumulator */ + hsize_t loc; /* Coordinate offset */ + size_t tot_blk_count; /* Total number of blocks left to output */ + size_t elem_size; /* Size of each element iterating over */ + size_t io_left; /* The number of elements left in I/O operation */ + size_t actual_elem; /* The actual number of elements to count */ + unsigned ndims; /* Number of dimensions of dataset */ + unsigned fast_dim; /* Rank of the fastest changing dimension for the dataspace */ + unsigned skip_dim; /* Rank of the dimension to skip along */ + unsigned u; /* Local index variable */ + int i; /* Local index variable */ + + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_hyper_get_seq_list_single) + + /* Check args */ + HDassert(space); + HDassert(iter); + HDassert(maxseq > 0); + HDassert(maxelem > 0); + HDassert(nseq); + HDassert(nelem); + HDassert(off); + HDassert(len); + + /* Set a local copy of the diminfo pointer */ + tdiminfo = iter->u.hyp.diminfo; + + /* Check if this is a "flattened" regular hyperslab selection */ + if(iter->u.hyp.iter_rank != 0 && iter->u.hyp.iter_rank < space->extent.rank) { + /* Set the aliases for a few important dimension ranks */ + ndims = iter->u.hyp.iter_rank; + + /* Set the local copy of the selection offset */ + sel_off = iter->u.hyp.sel_off; + + /* Set up the pointer to the size of the memory space */ + mem_size = iter->u.hyp.size; + } /* end if */ + else { + /* Set the aliases for a few important dimension ranks */ + ndims = space->extent.rank; + + /* Set the local copy of the selection offset */ + sel_off = space->select.offset; - /* Handle any leftover, partial blocks in this row */ - if(io_left>0 && curr_seqextent.size; + } /* end else */ + fast_dim = ndims - 1; - /* Store the sequence information */ - off[curr_seq]=loc; - len[curr_seq]=actual_bytes; + /* initialize row sizes for each dimension */ + elem_size = iter->elmt_size; + for(i = (int)fast_dim, acc = elem_size; i >= 0; i--) { + slab[i] = acc; + acc *= mem_size[i]; + } /* end for */ + + /* Copy the base location of the block */ + /* (Add in the selection offset) */ + for(u = 0; u < ndims; u++) + base_offset[u] = (hsize_t)((hssize_t)tdiminfo[u].start + sel_off[u]); - /* Increment sequence count */ - curr_seq++; + /* Copy the location of the point to get */ + /* (Add in the selection offset) */ + for(u = 0; u < ndims; u++) + offset[u] = (hsize_t)((hssize_t)iter->u.hyp.off[u] + sel_off[u]); - /* Decrement the number of elements left */ - io_left -= actual_elem; + /* Compute the initial buffer offset */ + for(u = 0, loc = 0; u < ndims; u++) + loc += offset[u] * slab[u]; + + /* Set local copies of information for the fastest changing dimension */ + fast_dim_block = tdiminfo[fast_dim].block; + + /* Calculate the number of elements to sequence through */ + H5_CHECK_OVERFLOW(iter->elmt_left, hsize_t, size_t); + io_left = MIN((size_t)iter->elmt_left, maxelem); + + /* Compute the number of blocks which would fit into the buffer */ + H5_CHECK_OVERFLOW(io_left / fast_dim_block, hsize_t, size_t); + tot_blk_count = (size_t)(io_left / fast_dim_block); + + /* Don't go over the maximum number of sequences allowed */ + tot_blk_count = MIN(tot_blk_count, maxseq); + + /* Set the number of elements to write each time */ + H5_ASSIGN_OVERFLOW(actual_elem, fast_dim_block, hsize_t, size_t); + + /* Check for blocks to operate on */ + if(tot_blk_count > 0) { + size_t actual_bytes; /* The actual number of bytes to copy */ + + /* Set the number of actual bytes */ + actual_bytes = actual_elem * elem_size; + + /* Check for 1-dim selection */ + if(0 == fast_dim) { + /* Sanity checks */ + HDassert(1 == tot_blk_count); + HDassert(io_left == actual_elem); + + /* Store the sequence information */ + *off++ = loc; + *len++ = actual_bytes; + } /* end if */ + else { + hsize_t skip_slab; /* Temporary copy of slab[fast_dim - 1] */ + size_t blk_count; /* Total number of blocks left to output */ + + /* Find first dimension w/block >1 */ + skip_dim = fast_dim; + for(i = (int)(fast_dim - 1); i >= 0; i--) + if(tdiminfo[i].block > 1) { + skip_dim = (unsigned)i; + break; + } /* end if */ + skip_slab = slab[skip_dim]; + + /* Check for being able to use fast algorithm for 1-D */ + if(0 == skip_dim) { + /* Create sequences until an entire row can't be used */ + blk_count = tot_blk_count; + while(blk_count > 0) { + /* Store the sequence information */ + *off++ = loc; + *len++ = actual_bytes; + + /* Increment offset in destination buffer */ + loc += skip_slab; + + /* Decrement block count */ + blk_count--; + } /* end while */ - /* Increment buffer correctly */ - offset[fast_dim]+=actual_elem; + /* Move to the next location */ + offset[skip_dim] += tot_blk_count; } /* end if */ + else { + hsize_t tmp_block[H5O_LAYOUT_NDIMS];/* Temporary block offset */ + hsize_t skip[H5O_LAYOUT_NDIMS]; /* Bytes to skip between blocks */ + int temp_dim; /* Temporary rank holder */ + + /* Set the starting block location */ + for(u = 0; u < ndims; u++) + tmp_block[u] = iter->u.hyp.off[u] - tdiminfo[u].start; + + /* Compute the amount to skip between sequences */ + for(u = 0; u < ndims; u++) + skip[u] = (mem_size[u] - tdiminfo[u].block) * slab[u]; + + /* Create sequences until an entire row can't be used */ + blk_count = tot_blk_count; + while(blk_count > 0) { + /* Store the sequence information */ + *off++ = loc; + *len++ = actual_bytes; + + /* Set temporary dimension for advancing offsets */ + temp_dim = (int)skip_dim; - /* don't bother checking slower dimensions */ - assert(io_left==0 || curr_seq==maxseq); + /* Increment offset in destination buffer */ + loc += skip_slab; + + /* Increment the offset and count for the other dimensions */ + while(temp_dim >= 0) { + /* Move to the next row in the curent dimension */ + offset[temp_dim]++; + tmp_block[temp_dim]++; + + /* If this block is still in the range of blocks to output for the dimension, break out of loop */ + if(tmp_block[temp_dim] < tdiminfo[temp_dim].block) + break; + else { + offset[temp_dim] = base_offset[temp_dim]; + loc += skip[temp_dim]; + tmp_block[temp_dim] = 0; + } /* end else */ + + /* Decrement dimension count */ + temp_dim--; + } /* end while */ + + /* Decrement block count */ + blk_count--; + } /* end while */ + } /* end else */ + } /* end else */ + + /* Update the iterator, if there were any blocks used */ + + /* Decrement the number of elements left in selection */ + iter->elmt_left -= tot_blk_count * actual_elem; + + /* Check if there are elements left in iterator */ + if(iter->elmt_left > 0) { + /* Update the iterator with the location we stopped */ + /* (Subtract out the selection offset) */ + for(u = 0; u < ndims; u++) + iter->u.hyp.off[u] = (hsize_t)((hssize_t)offset[u] - sel_off[u]); } /* end if */ - /* Update the iterator */ + /* Increment the number of sequences generated */ + *nseq += tot_blk_count; + + /* Increment the number of elements used */ + *nelem += tot_blk_count * actual_elem; + } /* end if */ + + /* Check for partial block, with room for another sequence */ + if(io_left > (tot_blk_count * actual_elem) && tot_blk_count < maxseq) { + size_t elmt_remainder; /* Elements remaining */ + + /* Compute elements left */ + elmt_remainder = io_left - (tot_blk_count * actual_elem); + HDassert(elmt_remainder < fast_dim_block); + HDassert(elmt_remainder > 0); + + /* Store the sequence information */ + *off++ = loc; + *len++ = elmt_remainder * elem_size; /* Update the iterator with the location we stopped */ - /* (Subtract out the selection offset) */ - for(u = 0; u < ndims; u++) - iter->u.hyp.off[u] = (hsize_t)((hssize_t)offset[u] - sel_off[u]); + iter->u.hyp.off[fast_dim] += (hsize_t)elmt_remainder; /* Decrement the number of elements left in selection */ - iter->elmt_left -= (nelmts - io_left); - } /* end if */ + iter->elmt_left -= elmt_remainder; - /* Set the number of sequences generated */ - *nseq = curr_seq; + /* Increment the number of sequences generated */ + (*nseq)++; - /* Set the number of bytes used */ - *nelem = start_io_left - io_left; + /* Increment the number of elements used */ + *nelem += elmt_remainder; + } /* end if */ + + /* Sanity check */ + HDassert(*nseq > 0); + HDassert(*nelem > 0); FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5S_hyper_get_seq_list_opt() */ +} /* end H5S_hyper_get_seq_list_single() */ /*-------------------------------------------------------------------------- @@ -8451,26 +8698,141 @@ H5S_hyper_get_seq_list(const H5S_t *space, unsigned UNUSED flags, H5S_sel_iter_t { herr_t ret_value; /* return value */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_hyper_get_seq_list); + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_hyper_get_seq_list) /* Check args */ - assert(space); - assert(iter); - assert(maxseq>0); - assert(maxelem>0); - assert(nseq); - assert(nelem); - assert(off); - assert(len); + HDassert(space); + HDassert(iter); + HDassert(iter->elmt_left > 0); + HDassert(maxseq > 0); + HDassert(maxelem > 0); + HDassert(nseq); + HDassert(nelem); + HDassert(off); + HDassert(len); /* Check for the special case of just one H5Sselect_hyperslab call made */ - if(space->select.sel_info.hslab->diminfo_valid) - /* Use optimized call to generate sequence list */ - ret_value=H5S_hyper_get_seq_list_opt(space,iter,maxseq,maxelem,nseq,nelem,off,len); + if(space->select.sel_info.hslab->diminfo_valid) { + const H5S_hyper_dim_t *tdiminfo; /* Temporary pointer to diminfo information */ + const hssize_t *sel_off; /* Selection offset in dataspace */ + hsize_t *mem_size; /* Size of the source buffer */ + unsigned ndims; /* Number of dimensions of dataset */ + unsigned fast_dim; /* Rank of the fastest changing dimension for the dataspace */ + hbool_t single_block; /* Whether the selection is a single block */ + unsigned u; /* Local index variable */ + + /* Set a local copy of the diminfo pointer */ + tdiminfo = iter->u.hyp.diminfo; + + /* Check if this is a "flattened" regular hyperslab selection */ + if(iter->u.hyp.iter_rank != 0 && iter->u.hyp.iter_rank < space->extent.rank) { + /* Set the aliases for a few important dimension ranks */ + ndims = iter->u.hyp.iter_rank; + + /* Set the local copy of the selection offset */ + sel_off = iter->u.hyp.sel_off; + + /* Set up the pointer to the size of the memory space */ + mem_size = iter->u.hyp.size; + } /* end if */ + else { + /* Set the aliases for a few important dimension ranks */ + ndims = space->extent.rank; + + /* Set the local copy of the selection offset */ + sel_off = space->select.offset; + + /* Set up the pointer to the size of the memory space */ + mem_size = space->extent.size; + } /* end else */ + fast_dim = ndims - 1; + + /* Check if we stopped in the middle of a sequence of elements */ + if((iter->u.hyp.off[fast_dim] - tdiminfo[fast_dim].start) % tdiminfo[fast_dim].stride != 0 || + ((iter->u.hyp.off[fast_dim] != tdiminfo[fast_dim].start) && tdiminfo[fast_dim].count == 1)) { + hsize_t slab[H5O_LAYOUT_NDIMS]; /* Hyperslab size */ + hsize_t loc; /* Coordinate offset */ + hsize_t acc; /* Accumulator */ + size_t leftover; /* The number of elements left over from the last sequence */ + size_t actual_elem; /* The actual number of elements to count */ + size_t elem_size; /* Size of each element iterating over */ + int i; /* Local index variable */ + + + /* Calculate the number of elements left in the sequence */ + if(tdiminfo[fast_dim].count == 1) { + H5_ASSIGN_OVERFLOW(leftover, tdiminfo[fast_dim].block - (iter->u.hyp.off[fast_dim] - tdiminfo[fast_dim].start), hsize_t, size_t); + } /* end if */ + else { + H5_ASSIGN_OVERFLOW(leftover, tdiminfo[fast_dim].block - ((iter->u.hyp.off[fast_dim] - tdiminfo[fast_dim].start) % tdiminfo[fast_dim].stride), hsize_t, size_t); + } /* end else */ + + /* Make certain that we don't write too many */ + actual_elem = MIN3(leftover, (size_t)iter->elmt_left, maxelem); + + /* initialize row sizes for each dimension */ + elem_size = iter->elmt_size; + for(i = (int)fast_dim, acc = elem_size; i >= 0; i--) { + slab[i] = acc; + acc *= mem_size[i]; + } /* end for */ + + /* Compute the initial buffer offset */ + for(u = 0, loc = 0; u < ndims; u++) + loc += ((hsize_t)((hssize_t)iter->u.hyp.off[u] + sel_off[u])) * slab[u]; + + /* Add a new sequence */ + off[0] = loc; + H5_ASSIGN_OVERFLOW(len[0], actual_elem * elem_size, hsize_t, size_t); + + /* Increment sequence array locations */ + off++; + len++; + + /* Advance the hyperslab iterator */ + H5S_hyper_iter_next(iter, actual_elem); + + /* Decrement the number of elements left in selection */ + iter->elmt_left -= actual_elem; + + /* Decrement element/sequence limits */ + maxelem -= actual_elem; + maxseq--; + + /* Set the number of sequences generated and elements used */ + *nseq = 1; + *nelem = actual_elem; + + /* Check for using up all the sequences/elements */ + if(0 == iter->elmt_left || 0 == maxelem || 0 == maxseq) + return(SUCCEED); + } /* end if */ + else { + /* Reset the number of sequences generated and elements used */ + *nseq = 0; + *nelem = 0; + } /* end else */ + + /* Check for a single block selected */ + single_block = TRUE; + for(u = 0; u < ndims; u++) + if(1 != tdiminfo[u].count) { + single_block = FALSE; + break; + } /* end if */ + + /* Check for single block selection */ + if(single_block) + /* Use single-block optimized call to generate sequence list */ + ret_value = H5S_hyper_get_seq_list_single(space, iter, maxseq, maxelem, nseq, nelem, off, len); + else + /* Use optimized call to generate sequence list */ + ret_value = H5S_hyper_get_seq_list_opt(space, iter, maxseq, maxelem, nseq, nelem, off, len); + } /* end if */ else /* Call the general sequence generator routine */ - ret_value=H5S_hyper_get_seq_list_gen(space,iter,maxseq,maxelem,nseq,nelem,off,len); + ret_value = H5S_hyper_get_seq_list_gen(space, iter, maxseq, maxelem, nseq, nelem, off, len); - FUNC_LEAVE_NOAPI(ret_value); + FUNC_LEAVE_NOAPI(ret_value) } /* end H5S_hyper_get_seq_list() */ diff --git a/src/H5Sselect.c b/src/H5Sselect.c index 17b7fab..2a0e63f 100644 --- a/src/H5Sselect.c +++ b/src/H5Sselect.c @@ -189,10 +189,10 @@ H5S_select_get_seq_list(const H5S_t *space, unsigned flags, FUNC_ENTER_NOAPI_NOFUNC(H5S_select_get_seq_list) - assert(space); + HDassert(space); /* Call the selection type's get_seq_list function */ - ret_value=(*space->select.type->get_seq_list)(space,flags,iter,maxseq,maxbytes,nseq,nbytes,off,len); + ret_value = (*space->select.type->get_seq_list)(space, flags, iter, maxseq, maxbytes, nseq, nbytes, off, len); FUNC_LEAVE_NOAPI(ret_value) } /* end H5S_select_get_seq_list() */ diff --git a/src/H5V.c b/src/H5V.c index 1efe497..515a2c5 100644 --- a/src/H5V.c +++ b/src/H5V.c @@ -24,6 +24,12 @@ #include "H5Oprivate.h" #include "H5Vprivate.h" +/* Local typedefs */ +typedef struct H5V_memcpy_ud_t { + unsigned char *dst; /* Pointer to destination buffer */ + const unsigned char *src; /* Pointer to source buffer */ +} H5V_memcpy_ud_t; + /* Local macros */ #define H5V_HYPER_NDIMS H5O_LAYOUT_NDIMS @@ -1150,8 +1156,8 @@ done: *------------------------------------------------------------------------- */ herr_t -H5V_array_calc_pre(hsize_t offset, unsigned n, const hsize_t *total_size, - const hsize_t *down, hsize_t *coords) +H5V_array_calc_pre(hsize_t offset, unsigned n, const hsize_t *down, + hsize_t *coords) { unsigned u; /* Local index variable */ @@ -1159,7 +1165,6 @@ H5V_array_calc_pre(hsize_t offset, unsigned n, const hsize_t *total_size, /* Sanity check */ HDassert(n <= H5V_HYPER_NDIMS); - HDassert(total_size); HDassert(coords); /* Compute the coordinates from the offset */ @@ -1210,7 +1215,7 @@ H5V_array_calc(hsize_t offset, unsigned n, const hsize_t *total_size, hsize_t *c HGOTO_ERROR(H5E_INTERNAL, H5E_BADVALUE, FAIL, "can't compute down sizes") /* Compute the coordinates from the offset */ - if(H5V_array_calc_pre(offset, n, total_size, idx, coords) < 0) + if(H5V_array_calc_pre(offset, n, idx, coords) < 0) HGOTO_ERROR(H5E_INTERNAL, H5E_BADVALUE, FAIL, "can't compute coordinates") done: @@ -1356,6 +1361,212 @@ H5V_unswizzle_coords(hsize_t *coords, unsigned unlim_dim) /*------------------------------------------------------------------------- + * Function: H5V_opvv + * + * Purpose: Perform an operation on a source & destination sequences + * of offset/length pairs. Each set of sequnces has an array + * of lengths, an array of offsets, the maximum number of + * sequences and the current sequence to start at in the sequence. + * + * There may be different numbers of bytes in the source and + * destination sequences, the operation stops when either the + * source or destination sequence runs out of information. + * + * Note: The algorithm in this routine is [basically] the same as for + * H5V_memcpyvv(). Changes should be made to both! + * + * Return: Non-negative # of bytes operated on, on success/Negative on failure + * + * Programmer: Quincey Koziol + * Thursday, September 30, 2010 + * + *------------------------------------------------------------------------- + */ +ssize_t +H5V_opvv(size_t dst_max_nseq, size_t *dst_curr_seq, size_t dst_len_arr[], + hsize_t dst_off_arr[], + size_t src_max_nseq, size_t *src_curr_seq, size_t src_len_arr[], + hsize_t src_off_arr[], + H5V_opvv_func_t op, void *op_data) +{ + hsize_t *max_dst_off_ptr, *max_src_off_ptr; /* Pointers to max. source and destination offset locations */ + hsize_t *dst_off_ptr, *src_off_ptr; /* Pointers to source and destination offset arrays */ + size_t *dst_len_ptr, *src_len_ptr; /* Pointers to source and destination length arrays */ + hsize_t tmp_dst_off, tmp_src_off; /* Temporary source and destination offset values */ + size_t tmp_dst_len, tmp_src_len; /* Temporary source and destination length values */ + size_t acc_len; /* Accumulated length of sequences */ + ssize_t ret_value = 0; /* Return value (Total size of sequence in bytes) */ + + FUNC_ENTER_NOAPI(H5V_opvv, FAIL) + + /* Sanity check */ + HDassert(dst_curr_seq); + HDassert(*dst_curr_seq < dst_max_nseq); + HDassert(dst_len_arr); + HDassert(dst_off_arr); + HDassert(src_curr_seq); + HDassert(*src_curr_seq < src_max_nseq); + HDassert(src_len_arr); + HDassert(src_off_arr); + HDassert(op); + + /* Set initial offset & length pointers */ + dst_len_ptr = dst_len_arr + *dst_curr_seq; + dst_off_ptr = dst_off_arr + *dst_curr_seq; + src_len_ptr = src_len_arr + *src_curr_seq; + src_off_ptr = src_off_arr + *src_curr_seq; + + /* Get temporary source & destination sequence offsets & lengths */ + tmp_dst_len = *dst_len_ptr; + tmp_dst_off = *dst_off_ptr; + tmp_src_len = *src_len_ptr; + tmp_src_off = *src_off_ptr; + + /* Compute maximum offset pointer values */ + max_dst_off_ptr = dst_off_arr + dst_max_nseq; + max_src_off_ptr = src_off_arr + src_max_nseq; + +/* Work through the sequences */ +/* (Choose smallest sequence available initially) */ + + /* Source sequence is less than destination sequence */ + if(tmp_src_len < tmp_dst_len) { +src_smaller: + acc_len = 0; + do { + /* Make operator callback */ + if((*op)(tmp_dst_off, tmp_src_off, tmp_src_len, op_data) < 0) + HGOTO_ERROR(H5E_INTERNAL, H5E_CANTOPERATE, FAIL, "can't perform operation") + + /* Accumulate number of bytes copied */ + acc_len += tmp_src_len; + + /* Update destination length */ + tmp_dst_off += tmp_src_len; + tmp_dst_len -= tmp_src_len; + + /* Advance source offset & check for being finished */ + src_off_ptr++; + if(src_off_ptr >= max_src_off_ptr) { + /* Roll accumulated changes into appropriate counters */ + *dst_off_ptr = tmp_dst_off; + *dst_len_ptr = tmp_dst_len; + + /* Done with sequences */ + goto finished; + } /* end if */ + tmp_src_off = *src_off_ptr; + + /* Update source information */ + src_len_ptr++; + tmp_src_len = *src_len_ptr; + } while(tmp_src_len < tmp_dst_len); + + /* Roll accumulated sequence lengths into return value */ + ret_value += (ssize_t)acc_len; + + /* Transition to next state */ + if(tmp_dst_len < tmp_src_len) + goto dst_smaller; + else + goto equal; + } /* end if */ + /* Destination sequence is less than source sequence */ + else if(tmp_dst_len < tmp_src_len) { +dst_smaller: + acc_len = 0; + do { + /* Make operator callback */ + if((*op)(tmp_dst_off, tmp_src_off, tmp_dst_len, op_data) < 0) + HGOTO_ERROR(H5E_INTERNAL, H5E_CANTOPERATE, FAIL, "can't perform operation") + + /* Accumulate number of bytes copied */ + acc_len += tmp_dst_len; + + /* Update source length */ + tmp_src_off += tmp_dst_len; + tmp_src_len -= tmp_dst_len; + + /* Advance destination offset & check for being finished */ + dst_off_ptr++; + if(dst_off_ptr >= max_dst_off_ptr) { + /* Roll accumulated changes into appropriate counters */ + *src_off_ptr = tmp_src_off; + *src_len_ptr = tmp_src_len; + + /* Done with sequences */ + goto finished; + } /* end if */ + tmp_dst_off = *dst_off_ptr; + + /* Update destination information */ + dst_len_ptr++; + tmp_dst_len = *dst_len_ptr; + } while(tmp_dst_len < tmp_src_len); + + /* Roll accumulated sequence lengths into return value */ + ret_value += (ssize_t)acc_len; + + /* Transition to next state */ + if(tmp_src_len < tmp_dst_len) + goto src_smaller; + else + goto equal; + } /* end else-if */ + /* Destination sequence and source sequence are same length */ + else { +equal: + acc_len = 0; + do { + /* Make operator callback */ + if((*op)(tmp_dst_off, tmp_src_off, tmp_dst_len, op_data) < 0) + HGOTO_ERROR(H5E_INTERNAL, H5E_CANTOPERATE, FAIL, "can't perform operation") + + /* Accumulate number of bytes copied */ + acc_len += tmp_dst_len; + + /* Advance source & destination offset & check for being finished */ + src_off_ptr++; + dst_off_ptr++; + if(src_off_ptr >= max_src_off_ptr || dst_off_ptr >= max_dst_off_ptr) + /* Done with sequences */ + goto finished; + tmp_src_off = *src_off_ptr; + tmp_dst_off = *dst_off_ptr; + + /* Update source information */ + src_len_ptr++; + tmp_src_len = *src_len_ptr; + + /* Update destination information */ + dst_len_ptr++; + tmp_dst_len = *dst_len_ptr; + } while(tmp_dst_len == tmp_src_len); + + /* Roll accumulated sequence lengths into return value */ + ret_value += (ssize_t)acc_len; + + /* Transition to next state */ + if(tmp_dst_len < tmp_src_len) + goto dst_smaller; + else + goto src_smaller; + } /* end else */ + +finished: + /* Roll accumulated sequence lengths into return value */ + ret_value += (ssize_t)acc_len; + + /* Update current sequence vectors */ + *dst_curr_seq = (size_t)(dst_off_ptr - dst_off_arr); + *src_curr_seq = (size_t)(src_off_ptr - src_off_arr); + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5V_opvv() */ + + +/*------------------------------------------------------------------------- * Function: H5V_memcpyvv * * Purpose: Given source and destination buffers in memory (SRC & DST) @@ -1368,13 +1579,14 @@ H5V_unswizzle_coords(hsize_t *coords, unsigned unlim_dim) * destination sequences, data copying stops when either the * source or destination buffer runs out of sequence information. * + * Note: The algorithm in this routine is [basically] the same as for + * H5V_opvv(). Changes should be made to both! + * * Return: Non-negative # of bytes copied on success/Negative on failure * * Programmer: Quincey Koziol * Friday, May 2, 2003 * - * Modifications: - * *------------------------------------------------------------------------- */ ssize_t @@ -1385,64 +1597,181 @@ H5V_memcpyvv(void *_dst, { unsigned char *dst; /* Destination buffer pointer */ const unsigned char *src; /* Source buffer pointer */ - size_t total_size=0; /* Total size of sequence in bytes */ - size_t size; /* Size of sequence in bytes */ - size_t u,v; /* Local index variables */ - ssize_t ret_value; /* Return value */ + hsize_t *max_dst_off_ptr, *max_src_off_ptr; /* Pointers to max. source and destination offset locations */ + hsize_t *dst_off_ptr, *src_off_ptr; /* Pointers to source and destination offset arrays */ + size_t *dst_len_ptr, *src_len_ptr; /* Pointers to source and destination length arrays */ + size_t tmp_dst_len; /* Temporary dest. length value */ + size_t tmp_src_len; /* Temporary source length value */ + size_t acc_len; /* Accumulated length of sequences */ + ssize_t ret_value = 0; /* Return value (Total size of sequence in bytes) */ FUNC_ENTER_NOAPI_NOFUNC(H5V_memcpyvv) /* Sanity check */ - assert(_dst); - assert(dst_curr_seq); - assert(*dst_curr_seq= max_src_off_ptr) { + /* Roll accumulated changes into appropriate counters */ + *dst_off_ptr += acc_len; + *dst_len_ptr = tmp_dst_len; + + /* Done with sequences */ + goto finished; + } /* end if */ - /* Compute offset on disk */ - dst=(unsigned char *)_dst+dst_off_arr[u]; + /* Update destination pointer */ + dst += tmp_src_len; - /* Compute offset in memory */ - src=(const unsigned char *)_src+src_off_arr[v]; + /* Update source information */ + src_len_ptr++; + tmp_src_len = *src_len_ptr; + src = (const unsigned char *)_src + *src_off_ptr; + } while(tmp_src_len < tmp_dst_len); - /* Copy data */ - HDmemcpy(dst,src,size); + /* Roll accumulated sequence lengths into return value */ + ret_value += (ssize_t)acc_len; - /* Update source information */ - src_len_arr[v]-=size; - src_off_arr[v]+=size; - if(src_len_arr[v]==0) - v++; + /* Transition to next state */ + if(tmp_dst_len < tmp_src_len) + goto dst_smaller; + else + goto equal; + } /* end if */ + /* Destination sequence is less than source sequence */ + else if(tmp_dst_len < tmp_src_len) { +dst_smaller: + acc_len = 0; + do { + /* Copy data */ + HDmemcpy(dst, src, tmp_dst_len); + + /* Accumulate number of bytes copied */ + acc_len += tmp_dst_len; + + /* Update source length */ + tmp_src_len -= tmp_dst_len; + + /* Advance destination offset & check for being finished */ + dst_off_ptr++; + if(dst_off_ptr >= max_dst_off_ptr) { + /* Roll accumulated changes into appropriate counters */ + *src_off_ptr += acc_len; + *src_len_ptr = tmp_src_len; + + /* Done with sequences */ + goto finished; + } /* end if */ - /* Update destination information */ - dst_len_arr[u]-=size; - dst_off_arr[u]+=size; - if(dst_len_arr[u]==0) - u++; + /* Update source pointer */ + src += tmp_dst_len; - /* Increment number of bytes copied */ - total_size+=size; - } /* end for */ + /* Update destination information */ + dst_len_ptr++; + tmp_dst_len = *dst_len_ptr; + dst = (unsigned char *)_dst + *dst_off_ptr; + } while(tmp_dst_len < tmp_src_len); - /* Update current sequence vectors */ - *dst_curr_seq=u; - *src_curr_seq=v; + /* Roll accumulated sequence lengths into return value */ + ret_value += (ssize_t)acc_len; - /* Set return value */ - H5_ASSIGN_OVERFLOW(ret_value,total_size,size_t,ssize_t); + /* Transition to next state */ + if(tmp_src_len < tmp_dst_len) + goto src_smaller; + else + goto equal; + } /* end else-if */ + /* Destination sequence and source sequence are same length */ + else { +equal: + acc_len = 0; + do { + /* Copy data */ + HDmemcpy(dst, src, tmp_dst_len); + + /* Accumulate number of bytes copied */ + acc_len += tmp_dst_len; + + /* Advance source & destination offset & check for being finished */ + src_off_ptr++; + dst_off_ptr++; + if(src_off_ptr >= max_src_off_ptr || dst_off_ptr >= max_dst_off_ptr) + /* Done with sequences */ + goto finished; + + /* Update source information */ + src_len_ptr++; + tmp_src_len = *src_len_ptr; + src = (const unsigned char *)_src + *src_off_ptr; + + /* Update destination information */ + dst_len_ptr++; + tmp_dst_len = *dst_len_ptr; + dst = (unsigned char *)_dst + *dst_off_ptr; + } while(tmp_dst_len == tmp_src_len); + + /* Roll accumulated sequence lengths into return value */ + ret_value += (ssize_t)acc_len; + + /* Transition to next state */ + if(tmp_dst_len < tmp_src_len) + goto dst_smaller; + else + goto src_smaller; + } /* end else */ + +finished: + /* Roll accumulated sequence lengths into return value */ + ret_value += (ssize_t)acc_len; + + /* Update current sequence vectors */ + *dst_curr_seq = (size_t)(dst_off_ptr - dst_off_arr); + *src_curr_seq = (size_t)(src_off_ptr - src_off_arr); FUNC_LEAVE_NOAPI(ret_value) } /* end H5V_memcpyvv() */ diff --git a/src/H5Vprivate.h b/src/H5Vprivate.h index faa2505..18630d6 100644 --- a/src/H5Vprivate.h +++ b/src/H5Vprivate.h @@ -24,6 +24,10 @@ #include "H5private.h" /* Generic Functions */ #include "H5Eprivate.h" /* Error handling */ +/* Vector-Vector sequence operation callback */ +typedef herr_t (*H5V_opvv_func_t)(hsize_t dst_off, hsize_t src_off, + size_t len, void *udata); + /* Vector comparison functions like Fortran66 comparison operators */ #define H5V_vector_eq_s(N,V1,V2) (H5V_vector_cmp_s (N, V1, V2)==0) #define H5V_vector_lt_s(N,V1,V2) (H5V_vector_cmp_s (N, V1, V2)<0) @@ -83,7 +87,7 @@ H5_DLL hsize_t H5V_array_offset_pre(unsigned n, const hsize_t *acc, const hsize_t *offset); H5_DLL hsize_t H5V_array_offset(unsigned n, const hsize_t *total_size, const hsize_t *offset); -H5_DLL herr_t H5V_array_calc_pre(hsize_t offset, unsigned n, const hsize_t *total_size, +H5_DLL herr_t H5V_array_calc_pre(hsize_t offset, unsigned n, const hsize_t *down, hsize_t *coords); H5_DLL herr_t H5V_array_calc(hsize_t offset, unsigned n, const hsize_t *total_size, hsize_t *coords); @@ -91,6 +95,11 @@ H5_DLL herr_t H5V_chunk_index(unsigned ndims, const hsize_t *coord, const uint32_t *chunk, const hsize_t *down_nchunks, hsize_t *chunk_idx); H5_DLL void H5V_swizzle_coords(hsize_t *coords, unsigned unlim_dim); H5_DLL void H5V_unswizzle_coords(hsize_t *coords, unsigned unlim_dim); +H5_DLL ssize_t H5V_opvv(size_t dst_max_nseq, size_t *dst_curr_seq, size_t dst_len_arr[], + hsize_t dst_off_arr[], + size_t src_max_nseq, size_t *src_curr_seq, size_t src_len_arr[], + hsize_t src_off_arr[], + H5V_opvv_func_t op, void *op_data); H5_DLL ssize_t H5V_memcpyvv(void *_dst, size_t dst_max_nseq, size_t *dst_curr_seq, size_t dst_len_arr[], hsize_t dst_off_arr[], const void *_src, diff --git a/src/H5private.h b/src/H5private.h index d506a59..f13ad84 100644 --- a/src/H5private.h +++ b/src/H5private.h @@ -145,12 +145,12 @@ #ifdef _WIN32 +#define WIN32_LEAN_AND_MEAN /*Exclude rarely-used stuff from Windows headers */ #ifdef H5_HAVE_WINSOCK_H #include #endif -#define WIN32_LEAN_AND_MEAN /*Exclude rarely-used stuff from Windows headers */ #include #include /* For _getcwd() */ diff --git a/src/H5public.h b/src/H5public.h index c92e628..4fc8c7e 100644 --- a/src/H5public.h +++ b/src/H5public.h @@ -75,10 +75,10 @@ extern "C" { /* Version numbers */ #define H5_VERS_MAJOR 1 /* For major interface/format changes */ #define H5_VERS_MINOR 9 /* For minor interface/format changes */ -#define H5_VERS_RELEASE 75 /* For tweaks, bug-fixes, or development */ +#define H5_VERS_RELEASE 76 /* For tweaks, bug-fixes, or development */ #define H5_VERS_SUBRELEASE "FA_a5" /* For pre-releases like snap0 */ /* Empty string for real releases. */ -#define H5_VERS_INFO "HDF5 library version: 1.9.75-FA_a5" /* Full version string */ +#define H5_VERS_INFO "HDF5 library version: 1.9.76-FA_a5" /* Full version string */ #define H5check() H5check_version(H5_VERS_MAJOR,H5_VERS_MINOR, \ H5_VERS_RELEASE) diff --git a/src/Makefile.in b/src/Makefile.in index fddf135..d668dc0 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -425,14 +425,24 @@ LIBH5_HL = $(top_builddir)/hl/src/libhdf5_hl.la LIBH5F_HL = $(top_builddir)/hl/fortran/src/libhdf5hl_fortran.la LIBH5CPP_HL = $(top_builddir)/hl/c++/src/libhdf5_hl_cpp.la +# Note that in svn revision 19400 the '/' after DESTDIR in H5* variables below +# has been removed. According to the official description of DESTDIR by Gnu at +# http://www.gnu.org/prep/standards/html_node/DESTDIR.html, DESTDIR is +# prepended to the normal and complete install path that it precedes for the +# purpose of installing in a temporary directory which is useful for building +# rpms and other packages. The '/' after ${DESTDIR} will be followed by another +# '/' at the beginning of the normal install path. When DESTDIR is empty the +# path then begins with '//', which is incorrect and causes problems at least for +# Cygwin. + # Scripts used to build examples # If only shared libraries have been installed, have h5cc build examples with # shared libraries instead of static libraries -H5CC = $(bindir)/h5cc -H5CC_PP = $(bindir)/h5pcc -H5FC = $(bindir)/h5fc -H5FC_PP = $(bindir)/h5pfc -H5CPP = $(bindir)/h5c++ +H5CC = ${DESTDIR}$(bindir)/h5cc +H5CC_PP = ${DESTDIR}$(bindir)/h5pcc +H5FC = ${DESTDIR}$(bindir)/h5fc +H5FC_PP = ${DESTDIR}$(bindir)/h5pfc +H5CPP = ${DESTDIR}$(bindir)/h5c++ ACLOCAL_AMFLAGS = "-I m4" # The trace script; this is used on source files from the C library to @@ -447,7 +457,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 65 +LT_VERS_REVISION = 66 LT_VERS_AGE = 0 H5detect_CFLAGS = -g $(AM_CFLAGS) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 0bec69f..7e12026 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -168,6 +168,78 @@ MACRO (ADD_H5_TEST file) ADD_TEST (NAME ${file} COMMAND $) ENDMACRO (ADD_H5_TEST file) +# Remove any output file left over from previous test run +ADD_TEST ( + NAME h5test-clear-objects + COMMAND ${CMAKE_COMMAND} + -E remove + cache_test.h5 + coord.h5 + dt_arith1.h5 + dt_arith2.h5 + dtransform.h5 + dtypes4.h5 + dtypes5.h5 + extlinks16A00000.h5 + extlinks16A00001.h5 + extlinks16A00002.h5 + extlinks16B-b.h5 + extlinks16B-g.h5 + extlinks16B-l.h5 + extlinks16B-r.h5 + extlinks16B-s.h5 + extlinks19B00000.h5 + extlinks19B00001.h5 + extlinks19B00002.h5 + extlinks19B00003.h5 + extlinks19B00004.h5 + extlinks19B00005.h5 + extlinks19B00006.h5 + extlinks19B00007.h5 + extlinks19B00008.h5 + extlinks19B00009.h5 + extlinks19B00010.h5 + extlinks19B00011.h5 + extlinks19B00012.h5 + extlinks19B00013.h5 + extlinks19B00014.h5 + extlinks19B00015.h5 + extlinks19B00016.h5 + extlinks19B00017.h5 + extlinks19B00018.h5 + extlinks19B00019.h5 + extlinks19B00020.h5 + extlinks19B00021.h5 + extlinks19B00022.h5 + extlinks19B00023.h5 + extlinks19B00024.h5 + extlinks19B00025.h5 + extlinks19B00026.h5 + extlinks19B00027.h5 + extlinks19B00028.h5 + fheap.h5 + objcopy_ext.h5 + sys_file1 + tattr.h5 + testmeta.h5 + tfile1.h5 + tfile2.h5 + tfile3.h5 + tfile4.h5 + tfile5.h5 + th5o_file + th5s1.h5 + th5s2.h5 + th5s3.h5 + tnullspace.h5 + tselect.h5 + tsohm.h5 + tsohm_dst.h5 + tsohm_src.h5 + tstint1.h5 + tstint2.h5 +) + SET (H5_TESTS lheap ohdr @@ -183,6 +255,7 @@ SET (H5_TESTS dt_arith dtypes cmpd_dset + filter_fail extend external objcopy @@ -270,6 +343,43 @@ TARGET_LINK_LIBRARIES (ttsafe ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) ADD_TEST (NAME ttsafe COMMAND $) +IF (HDF5_TEST_VFD) + + SET (VFD_LIST + sec2 + stdio + core + split + multi + family + ) + + IF (DIRECT_VFD) + SET (VFD_LIST ${VFD_LIST} direct) + ENDIF (DIRECT_VFD) + + MACRO (ADD_VFD_TEST vfdname resultcode) + FOREACH (test ${H5_TESTS}) + ADD_TEST ( + NAME VFD-${vfdname}-${test} + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_VFD:STRING=${vfdname}" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -P "${HDF5_RESOURCES_DIR}/vfdTest.cmake" + ) + ENDFOREACH (test ${H5_TESTS}) + ENDMACRO (ADD_VFD_TEST) + + # Run test with different Virtual File Driver + FOREACH (vfd ${VFD_LIST}) + ADD_VFD_TEST (${vfd} 0) + ENDFOREACH (vfd ${VFD_LIST}) + +ENDIF (HDF5_TEST_VFD) + ############################################################################## ############################################################################## ### T H E G E N E R A T O R S ### diff --git a/test/Makefile.in b/test/Makefile.in index e91de4c..89a2e30 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -682,14 +682,24 @@ LIBH5_HL = $(top_builddir)/hl/src/libhdf5_hl.la LIBH5F_HL = $(top_builddir)/hl/fortran/src/libhdf5hl_fortran.la LIBH5CPP_HL = $(top_builddir)/hl/c++/src/libhdf5_hl_cpp.la +# Note that in svn revision 19400 the '/' after DESTDIR in H5* variables below +# has been removed. According to the official description of DESTDIR by Gnu at +# http://www.gnu.org/prep/standards/html_node/DESTDIR.html, DESTDIR is +# prepended to the normal and complete install path that it precedes for the +# purpose of installing in a temporary directory which is useful for building +# rpms and other packages. The '/' after ${DESTDIR} will be followed by another +# '/' at the beginning of the normal install path. When DESTDIR is empty the +# path then begins with '//', which is incorrect and causes problems at least for +# Cygwin. + # Scripts used to build examples # If only shared libraries have been installed, have h5cc build examples with # shared libraries instead of static libraries -H5CC = $(bindir)/h5cc -H5CC_PP = $(bindir)/h5pcc -H5FC = $(bindir)/h5fc -H5FC_PP = $(bindir)/h5pfc -H5CPP = $(bindir)/h5c++ +H5CC = ${DESTDIR}$(bindir)/h5cc +H5CC_PP = ${DESTDIR}$(bindir)/h5pcc +H5FC = ${DESTDIR}$(bindir)/h5fc +H5FC_PP = ${DESTDIR}$(bindir)/h5pfc +H5CPP = ${DESTDIR}$(bindir)/h5c++ ACLOCAL_AMFLAGS = "-I m4" # The trace script; this is used on source files from the C library to diff --git a/test/dsets.c b/test/dsets.c index 88ffe5d..de4443e 100644 --- a/test/dsets.c +++ b/test/dsets.c @@ -7854,7 +7854,7 @@ test_chunk_fast(hid_t fapl) /* Fill existing elements */ for(u = 0; u < npoints; u++) { /* Compute the coordinate from the linear offset */ - if(H5V_array_calc_pre(u, ndims, dim, down, hs_offset) < 0) FAIL_STACK_ERROR + if(H5V_array_calc_pre(u, ndims, down, hs_offset) < 0) FAIL_STACK_ERROR /* Un-swizzle hyperslab offset in same way as swizzled dimensions */ H5V_unswizzle_coords(hs_offset, unlim_dim); @@ -7979,7 +7979,7 @@ test_chunk_fast(hid_t fapl) /* Read elements */ for(u = 0; u < npoints; u++) { /* Compute the coordinate from the linear offset */ - if(H5V_array_calc_pre(u, ndims, swizzled_dim, down, hs_offset) < 0) FAIL_STACK_ERROR + if(H5V_array_calc_pre(u, ndims, down, hs_offset) < 0) FAIL_STACK_ERROR /* Unswizzle hyperslab offset in same way as swizzled dimensions */ H5V_unswizzle_coords(hs_offset, unlim_dim); diff --git a/test/dt_arith.c b/test/dt_arith.c index 8d4b65b..413f326 100644 --- a/test/dt_arith.c +++ b/test/dt_arith.c @@ -5177,8 +5177,8 @@ run_int_fp_conv(const char *name) static int run_fp_int_conv(const char *name) { -#ifdef H5_FP_TO_INTEGER_OVERFLOW_WORKS int nerrors = 0; +#ifdef H5_FP_TO_INTEGER_OVERFLOW_WORKS int test_values; #ifdef H5_VMS diff --git a/test/filter_fail.c b/test/filter_fail.c index abb25cd..9b46421 100644 --- a/test/filter_fail.c +++ b/test/filter_fail.c @@ -25,13 +25,13 @@ #include "H5srcdir.h" #define DSET_NAME "dset_fail" -#define ONE_MB 1048576 #define H5Z_FILTER_FAIL_TEST 312 #define DIM 10 #define FILTER_CHUNK_DIM 2 const char *FILENAME[] = { - "filter_fail", + "filter_fail_with_cache", + "filter_fail_without_cache", NULL }; @@ -70,9 +70,6 @@ filter_fail(unsigned int flags, size_t cd_nelmts, size_t *buf_size, void **buf) { int *dst = (int*)(*buf); - unsigned int offset; - unsigned int length; - unsigned int value; size_t ret_value = 0; if(flags & H5Z_FLAG_REVERSE) { /* do nothing during read */ @@ -89,7 +86,6 @@ filter_fail(unsigned int flags, size_t cd_nelmts, } } /* end else */ -error: return ret_value; } /* end filter_fail() */ @@ -112,27 +108,30 @@ error: * 25 August 2010 * * Modifications: - * + * Raymond Lu + * 5 Oct 2010 + * Test when the chunk cache is enable and disabled to make + * sure the library behaves properly. *------------------------------------------------------------------------- */ static herr_t -test_filter_write(char *file_name, hid_t my_fapl) +test_filter_write(char *file_name, hid_t my_fapl, hbool_t cache_enabled) { - char filename[1024]; hid_t file = -1; hid_t dataset=-1; /* dataset ID */ hid_t sid=-1; /* dataspace ID */ hid_t dcpl=-1; /* dataset creation property list ID */ hsize_t dims[1]={DIM}; /* dataspace dimension - 10*/ hsize_t chunk_dims[1]={FILTER_CHUNK_DIM}; /* chunk dimension - 2*/ - int nfilters; /* number of filters in DCPL */ - unsigned flags; /* flags for filter */ int points[DIM]; /* Data */ - int rbuf[DIM]; /* Data */ herr_t ret; /* generic return value */ int i; - TESTING("data writing when a mandatory filter fails"); + if(cache_enabled) { + TESTING("data writing when a mandatory filter fails and chunk cache is enabled"); + } else { + TESTING("data writing when a mandatory filter fails and chunk cache is disabled"); + } /* Create file */ if((file = H5Fcreate(file_name, H5F_ACC_TRUNC, H5P_DEFAULT, my_fapl)) < 0) TEST_ERROR @@ -161,24 +160,44 @@ test_filter_write(char *file_name, hid_t my_fapl) for(i = 0; i < DIM; i++) points[i] = i; - /* Write data */ - if(H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, sid, H5P_DEFAULT, points) < 0) TEST_ERROR + /* Write data. If the chunk cache is enabled, H5Dwrite should succeed. If it is + * diabled, H5Dwrite should fail. */ + if(cache_enabled) { + if(H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, sid, H5P_DEFAULT, points) < 0) + TEST_ERROR + } else { + /* Data writing should fail */ + H5E_BEGIN_TRY { + ret = H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, sid, H5P_DEFAULT, points); + } H5E_END_TRY; + if(ret >= 0) { + H5_FAILED(); + puts(" Data writing is supposed to fail because the chunk can't be written to file."); + TEST_ERROR + } + } /* clean up objects used for this test */ if(H5Pclose (dcpl) < 0) TEST_ERROR if(H5Sclose (sid) < 0) TEST_ERROR - /* Dataset closing should fail */ - H5E_BEGIN_TRY { - ret = H5Dclose (dataset); - } H5E_END_TRY; - if(ret >= 0) { - H5_FAILED(); - puts(" Dataset is supposed to fail because the chunk can't be flushed to file."); - TEST_ERROR + /* Close dataset. If the chunk cache is enabled, the flushing of chunks should fail + * during H5Dclose. If it is diabled, H5Dwrite should fail but H5Dclose should succeed. */ + if(cache_enabled) { + H5E_BEGIN_TRY { + ret = H5Dclose (dataset); + } H5E_END_TRY; + if(ret >= 0) { + H5_FAILED(); + puts(" Dataset is supposed to fail because the chunk can't be flushed to file."); + TEST_ERROR + } + } else { + if(H5Dclose (dataset) < 0) + TEST_ERROR } - /* Even though H5Dclose fails, it should release all resources. + /* Even though H5Dclose or H5Dwrite fails, it should release all resources. * So the file should close successfully. */ if(H5Fclose (file) < 0) TEST_ERROR @@ -222,7 +241,6 @@ test_filter_read(char *file_name, hid_t my_fapl) hid_t sid = -1; hid_t mspace = -1; hsize_t dims[1]={DIM}; /* dataspace dimension - 10*/ - hsize_t chunk_dims[1]={FILTER_CHUNK_DIM}; /* chunk dimension - 2*/ int rbuf[DIM]; /* Data */ hsize_t dset_size = 0; /* Dataset storage size */ hsize_t hs_offset[H5S_MAX_RANK]; @@ -346,9 +364,9 @@ int main(void) { hid_t fapl; int mdc_nelmts = 0; - size_t rdcc_nelmts = 521; - size_t rdcc_nbytes = ONE_MB; - double rdcc_w0 = 0.75; + size_t rdcc_nelmts = 0; + size_t rdcc_nbytes = 0; + double rdcc_w0 = 0; char filename[1024]; unsigned nerrors = 0; @@ -357,12 +375,21 @@ int main(void) h5_fixname(FILENAME[0], fapl, filename, sizeof filename); - /* Make sure the chunk cache is used. All values are default. */ + /* The chunk cache is used so that the flushing of data chunks happens + * during H5Dclose. All values are default. */ + nerrors += (test_filter_write(filename, fapl, TRUE) < 0 ? 1 : 0); + nerrors += (test_filter_read(filename, fapl) < 0 ? 1 : 0); + + h5_fixname(FILENAME[1], fapl, filename, sizeof filename); + + /* Disable the chunk cache so that the writing of data chunks happens + * during H5Dwrite. */ if(H5Pset_cache(fapl, mdc_nelmts, rdcc_nelmts, rdcc_nbytes, rdcc_w0) < 0) TEST_ERROR - nerrors += (test_filter_write(filename, fapl) < 0 ? 1 : 0); - nerrors += (test_filter_read(filename, fapl) < 0 ? 1 : 0); + /* Run the test again. */ + nerrors += (test_filter_write(filename, fapl, FALSE) < 0 ? 1 : 0); + nerrors += (test_filter_read(filename, fapl) < 0 ? 1 : 0); h5_cleanup(FILENAME, fapl); diff --git a/test/testlibinfo.sh.in b/test/testlibinfo.sh.in index 97fb59d..5bcd300 100644 --- a/test/testlibinfo.sh.in +++ b/test/testlibinfo.sh.in @@ -84,6 +84,11 @@ case `uname -s` in shlibsuffix=.dylib break ;; + AIX) # AIX .a is already a shared lib + # this is a temporary patch. + shlibsuffix=.a + break + ;; *) # default shlibsuffix=.so break diff --git a/test/th5s.c b/test/th5s.c index ddd61e3..52fbe76 100644 --- a/test/th5s.c +++ b/test/th5s.c @@ -1043,9 +1043,9 @@ test_h5s_chunk(void) dsetID = H5Dopen2(fileID, "coords", H5P_DEFAULT); CHECK(dsetID, FAIL, "H5Dopen2"); - status= H5Dread (dsetID, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT, chunk_data_dbl); + status= H5Dread(dsetID, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT, chunk_data_dbl); CHECK(status, FAIL, "H5Dread"); - status= H5Dread (dsetID, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT, chunk_data_flt); + status= H5Dread(dsetID, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT, chunk_data_flt); CHECK(status, FAIL, "H5Dread"); status = H5Dclose(dsetID); diff --git a/test/tselect.c b/test/tselect.c index 1fa98bf..1041ab3 100644 --- a/test/tselect.c +++ b/test/tselect.c @@ -12870,7 +12870,7 @@ static void test_select_bounds(void) { hid_t sid; /* Dataspace ID */ - const hsize_t dims[SPACE11_RANK] = { SPACE11_DIM1, SPACE11_DIM2 }; /* Dataspace dimensions */ + const hsize_t dims[SPACE11_RANK] = {SPACE11_DIM1, SPACE11_DIM2}; /* Dataspace dimensions */ hsize_t coord[SPACE11_NPOINTS][SPACE11_RANK]; /* Coordinates for point selection */ hsize_t start[SPACE11_RANK]; /* The start of the hyperslab */ hsize_t stride[SPACE11_RANK]; /* The stride between block starts for the hyperslab */ @@ -12889,178 +12889,178 @@ test_select_bounds(void) CHECK(sid, FAIL, "H5Screate_simple"); /* Get bounds for 'all' selection */ - ret = H5Sget_select_bounds(sid,low_bounds,high_bounds); + ret = H5Sget_select_bounds(sid, low_bounds, high_bounds); CHECK(ret, FAIL, "H5Sget_select_bounds"); - VERIFY(low_bounds[0],0,"H5Sget_select_bounds"); - VERIFY(low_bounds[1],0,"H5Sget_select_bounds"); - VERIFY(high_bounds[0],SPACE11_DIM1-1,"H5Sget_select_bounds"); - VERIFY(high_bounds[1],SPACE11_DIM2-1,"H5Sget_select_bounds"); + VERIFY(low_bounds[0], 0, "H5Sget_select_bounds"); + VERIFY(low_bounds[1], 0, "H5Sget_select_bounds"); + VERIFY(high_bounds[0], SPACE11_DIM1 - 1, "H5Sget_select_bounds"); + VERIFY(high_bounds[1], SPACE11_DIM2 - 1, "H5Sget_select_bounds"); /* Set offset for selection */ - offset[0]=1; offset[1]=1; - ret=H5Soffset_simple(sid, offset); + offset[0] = 1; offset[1] = 1; + ret = H5Soffset_simple(sid, offset); CHECK(ret, FAIL, "H5Soffset_simple"); /* Get bounds for 'all' selection with offset (which should be ignored) */ - ret = H5Sget_select_bounds(sid,low_bounds,high_bounds); + ret = H5Sget_select_bounds(sid, low_bounds, high_bounds); CHECK(ret, FAIL, "H5Sget_select_bounds"); - VERIFY(low_bounds[0],0,"H5Sget_select_bounds"); - VERIFY(low_bounds[1],0,"H5Sget_select_bounds"); - VERIFY(high_bounds[0],SPACE11_DIM1-1,"H5Sget_select_bounds"); - VERIFY(high_bounds[1],SPACE11_DIM2-1,"H5Sget_select_bounds"); + VERIFY(low_bounds[0], 0, "H5Sget_select_bounds"); + VERIFY(low_bounds[1], 0, "H5Sget_select_bounds"); + VERIFY(high_bounds[0], SPACE11_DIM1 - 1, "H5Sget_select_bounds"); + VERIFY(high_bounds[1], SPACE11_DIM2 - 1, "H5Sget_select_bounds"); /* Reset offset for selection */ - offset[0]=0; offset[1]=0; - ret=H5Soffset_simple(sid, offset); + offset[0] = 0; offset[1] = 0; + ret = H5Soffset_simple(sid, offset); CHECK(ret, FAIL, "H5Soffset_simple"); /* Set 'none' selection */ - ret=H5Sselect_none(sid); + ret = H5Sselect_none(sid); CHECK(ret, FAIL, "H5Sselect_none"); /* Get bounds for 'none' selection */ H5E_BEGIN_TRY { - ret = H5Sget_select_bounds(sid,low_bounds,high_bounds); - } H5E_END_TRY; - VERIFY(ret, FAIL, "H5Sget_select_bounds"); - + ret = H5Sget_select_bounds(sid, low_bounds, high_bounds); + } H5E_END_TRY; + VERIFY(ret, FAIL, "H5Sget_select_bo unds"); + /* Set point selection */ - coord[0][0]= 3; coord[0][1]= 3; - coord[1][0]= 3; coord[1][1]= 96; - coord[2][0]= 96; coord[2][1]= 3; - coord[3][0]= 96; coord[3][1]= 96; + coord[0][0] = 3; coord[0][1] = 3; + coord[1][0] = 3; coord[1][1] = 96; + coord[2][0] = 96; coord[2][1] = 3; + coord[3][0] = 96; coord[3][1] = 96; ret = H5Sselect_elements(sid, H5S_SELECT_SET, (size_t)SPACE11_NPOINTS, (const hsize_t *)coord); CHECK(ret, FAIL, "H5Sselect_elements"); /* Get bounds for point selection */ - ret = H5Sget_select_bounds(sid,low_bounds,high_bounds); + ret = H5Sget_select_bounds(sid, low_bounds, high_bounds); CHECK(ret, FAIL, "H5Sget_select_bounds"); - VERIFY(low_bounds[0],3,"H5Sget_select_bounds"); - VERIFY(low_bounds[1],3,"H5Sget_select_bounds"); - VERIFY(high_bounds[0],SPACE11_DIM1-4,"H5Sget_select_bounds"); - VERIFY(high_bounds[1],SPACE11_DIM2-4,"H5Sget_select_bounds"); + VERIFY(low_bounds[0], 3, "H5Sget_select_bounds"); + VERIFY(low_bounds[1], 3, "H5Sget_select_bounds"); + VERIFY(high_bounds[0], SPACE11_DIM1 - 4, "H5Sget_select_bounds"); + VERIFY(high_bounds[1], SPACE11_DIM2 - 4, "H5Sget_select_bounds"); /* Set bad offset for selection */ - offset[0]=5; offset[1]=-5; - ret=H5Soffset_simple(sid, offset); + offset[0] = 5; offset[1] = -5; + ret = H5Soffset_simple(sid, offset); CHECK(ret, FAIL, "H5Soffset_simple"); /* Get bounds for hyperslab selection with negative offset */ H5E_BEGIN_TRY { - ret = H5Sget_select_bounds(sid,low_bounds,high_bounds); + ret = H5Sget_select_bounds(sid, low_bounds, high_bounds); } H5E_END_TRY; VERIFY(ret, FAIL, "H5Sget_select_bounds"); /* Set valid offset for selection */ - offset[0]=2; offset[1]=-2; - ret=H5Soffset_simple(sid, offset); + offset[0] = 2; offset[1] = -2; + ret = H5Soffset_simple(sid, offset); CHECK(ret, FAIL, "H5Soffset_simple"); /* Get bounds for point selection with offset */ - ret = H5Sget_select_bounds(sid,low_bounds,high_bounds); + ret = H5Sget_select_bounds(sid, low_bounds, high_bounds); CHECK(ret, FAIL, "H5Sget_select_bounds"); - VERIFY(low_bounds[0],5,"H5Sget_select_bounds"); - VERIFY(low_bounds[1],1,"H5Sget_select_bounds"); - VERIFY(high_bounds[0],SPACE11_DIM1-2,"H5Sget_select_bounds"); - VERIFY(high_bounds[1],SPACE11_DIM2-6,"H5Sget_select_bounds"); + VERIFY(low_bounds[0], 5, "H5Sget_select_bounds"); + VERIFY(low_bounds[1], 1, "H5Sget_select_bounds"); + VERIFY(high_bounds[0], SPACE11_DIM1 - 2, "H5Sget_select_bounds"); + VERIFY(high_bounds[1], SPACE11_DIM2 - 6, "H5Sget_select_bounds"); /* Reset offset for selection */ - offset[0]=0; offset[1]=0; - ret=H5Soffset_simple(sid, offset); + offset[0] = 0; offset[1] = 0; + ret = H5Soffset_simple(sid, offset); CHECK(ret, FAIL, "H5Soffset_simple"); /* Set "regular" hyperslab selection */ - start[0]= 2; start[1]= 2; - stride[0]= 10; stride[1]= 10; - count[0]= 4; count[1]= 4; - block[0]= 5; block[1]= 5; - ret = H5Sselect_hyperslab(sid,H5S_SELECT_SET,start,stride,count,block); + start[0] = 2; start[1] = 2; + stride[0] = 10; stride[1] = 10; + count[0] = 4; count[1] = 4; + block[0] = 5; block[1] = 5; + ret = H5Sselect_hyperslab(sid, H5S_SELECT_SET, start, stride, count, block); CHECK(ret, FAIL, "H5Sselect_hyperslab"); /* Get bounds for hyperslab selection */ - ret = H5Sget_select_bounds(sid,low_bounds,high_bounds); + ret = H5Sget_select_bounds(sid, low_bounds, high_bounds); CHECK(ret, FAIL, "H5Sget_select_bounds"); - VERIFY(low_bounds[0],2,"H5Sget_select_bounds"); - VERIFY(low_bounds[1],2,"H5Sget_select_bounds"); - VERIFY(high_bounds[0],36,"H5Sget_select_bounds"); - VERIFY(high_bounds[1],36,"H5Sget_select_bounds"); + VERIFY(low_bounds[0], 2, "H5Sget_select_bounds"); + VERIFY(low_bounds[1], 2, "H5Sget_select_bounds"); + VERIFY(high_bounds[0], 36, "H5Sget_select_bounds"); + VERIFY(high_bounds[1], 36, "H5Sget_select_bounds"); /* Set bad offset for selection */ - offset[0]=5; offset[1]=-5; - ret=H5Soffset_simple(sid, offset); + offset[0] = 5; offset[1] = -5; + ret = H5Soffset_simple(sid, offset); CHECK(ret, FAIL, "H5Soffset_simple"); /* Get bounds for hyperslab selection with negative offset */ H5E_BEGIN_TRY { - ret = H5Sget_select_bounds(sid,low_bounds,high_bounds); + ret = H5Sget_select_bounds(sid, low_bounds, high_bounds); } H5E_END_TRY; VERIFY(ret, FAIL, "H5Sget_select_bounds"); /* Set valid offset for selection */ - offset[0]=5; offset[1]=-2; - ret=H5Soffset_simple(sid, offset); + offset[0] = 5; offset[1] = -2; + ret = H5Soffset_simple(sid, offset); CHECK(ret, FAIL, "H5Soffset_simple"); /* Get bounds for hyperslab selection with offset */ - ret = H5Sget_select_bounds(sid,low_bounds,high_bounds); + ret = H5Sget_select_bounds(sid, low_bounds, high_bounds); CHECK(ret, FAIL, "H5Sget_select_bounds"); - VERIFY(low_bounds[0],7,"H5Sget_select_bounds"); - VERIFY(low_bounds[1],0,"H5Sget_select_bounds"); - VERIFY(high_bounds[0],41,"H5Sget_select_bounds"); - VERIFY(high_bounds[1],34,"H5Sget_select_bounds"); + VERIFY(low_bounds[0], 7, "H5Sget_select_bounds"); + VERIFY(low_bounds[1], 0, "H5Sget_select_bounds"); + VERIFY(high_bounds[0], 41, "H5Sget_select_bounds"); + VERIFY(high_bounds[1], 34, "H5Sget_select_bounds"); /* Reset offset for selection */ - offset[0]=0; offset[1]=0; - ret=H5Soffset_simple(sid, offset); + offset[0] = 0; offset[1] = 0; + ret = H5Soffset_simple(sid, offset); CHECK(ret, FAIL, "H5Soffset_simple"); /* Make "irregular" hyperslab selection */ - start[0]= 20; start[1]= 20; - stride[0]= 20; stride[1]= 20; - count[0]= 2; count[1]= 2; - block[0]= 10; block[1]= 10; - ret = H5Sselect_hyperslab(sid,H5S_SELECT_OR,start,stride,count,block); + start[0] = 20; start[1] = 20; + stride[0] = 20; stride[1] = 20; + count[0] = 2; count[1] = 2; + block[0] = 10; block[1] = 10; + ret = H5Sselect_hyperslab(sid, H5S_SELECT_OR, start, stride, count, block); CHECK(ret, FAIL, "H5Sselect_hyperslab"); /* Get bounds for hyperslab selection */ - ret = H5Sget_select_bounds(sid,low_bounds,high_bounds); + ret = H5Sget_select_bounds(sid, low_bounds, high_bounds); CHECK(ret, FAIL, "H5Sget_select_bounds"); - VERIFY(low_bounds[0],2,"H5Sget_select_bounds"); - VERIFY(low_bounds[1],2,"H5Sget_select_bounds"); - VERIFY(high_bounds[0],49,"H5Sget_select_bounds"); - VERIFY(high_bounds[1],49,"H5Sget_select_bounds"); + VERIFY(low_bounds[0], 2, "H5Sget_select_bounds"); + VERIFY(low_bounds[1], 2, "H5Sget_select_bounds"); + VERIFY(high_bounds[0], 49, "H5Sget_select_bounds"); + VERIFY(high_bounds[1], 49, "H5Sget_select_bounds"); /* Set bad offset for selection */ - offset[0]=5; offset[1]=-5; - ret=H5Soffset_simple(sid, offset); + offset[0] = 5; offset[1] = -5; + ret = H5Soffset_simple(sid, offset); CHECK(ret, FAIL, "H5Soffset_simple"); /* Get bounds for hyperslab selection with negative offset */ H5E_BEGIN_TRY { - ret = H5Sget_select_bounds(sid,low_bounds,high_bounds); + ret = H5Sget_select_bounds(sid, low_bounds, high_bounds); } H5E_END_TRY; VERIFY(ret, FAIL, "H5Sget_select_bounds"); /* Set valid offset for selection */ - offset[0]=5; offset[1]=-2; - ret=H5Soffset_simple(sid, offset); + offset[0] = 5; offset[1] = -2; + ret = H5Soffset_simple(sid, offset); CHECK(ret, FAIL, "H5Soffset_simple"); /* Get bounds for hyperslab selection with offset */ - ret = H5Sget_select_bounds(sid,low_bounds,high_bounds); + ret = H5Sget_select_bounds(sid, low_bounds, high_bounds); CHECK(ret, FAIL, "H5Sget_select_bounds"); - VERIFY(low_bounds[0],7,"H5Sget_select_bounds"); - VERIFY(low_bounds[1],0,"H5Sget_select_bounds"); - VERIFY(high_bounds[0],54,"H5Sget_select_bounds"); - VERIFY(high_bounds[1],47,"H5Sget_select_bounds"); + VERIFY(low_bounds[0], 7, "H5Sget_select_bounds"); + VERIFY(low_bounds[1], 0, "H5Sget_select_bounds"); + VERIFY(high_bounds[0], 54, "H5Sget_select_bounds"); + VERIFY(high_bounds[1], 47, "H5Sget_select_bounds"); /* Reset offset for selection */ - offset[0]=0; offset[1]=0; - ret=H5Soffset_simple(sid, offset); + offset[0] = 0; offset[1] = 0; + ret = H5Soffset_simple(sid, offset); CHECK(ret, FAIL, "H5Soffset_simple"); /* Close the dataspace */ - ret=H5Sclose (sid); + ret = H5Sclose(sid); CHECK(ret, FAIL, "H5Sclose"); } /* test_select_bounds() */ @@ -13078,18 +13078,18 @@ test_select(void) size_t rdcc_nelmts; /* Raw data number of elements */ size_t rdcc_nbytes; /* Raw data number of bytes */ double rdcc_w0; /* Raw data write percentage */ - hssize_t offset[SPACE7_RANK]={1,1}; /* Offset for testing selection offsets */ + hssize_t offset[SPACE7_RANK] = {1, 1}; /* Offset for testing selection offsets */ herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Selections\n")); /* Create a dataset transfer property list */ - plist_id=H5Pcreate(H5P_DATASET_XFER); + plist_id = H5Pcreate(H5P_DATASET_XFER); CHECK(plist_id, FAIL, "H5Pcreate"); /* test I/O with a very small buffer for reads */ - ret=H5Pset_buffer(plist_id,(size_t)59,NULL,NULL); + ret = H5Pset_buffer(plist_id, (size_t)59, NULL, NULL); CHECK(ret, FAIL, "H5Pset_buffer"); /* These next tests use the same file */ @@ -13106,18 +13106,18 @@ test_select(void) test_select_combo(); /* Test combined hyperslab & element selection code */ test_select_hyper_stride(H5P_DEFAULT); /* Test strided hyperslab selection code */ test_select_hyper_stride(plist_id); /* Test strided hyperslab selection code */ - test_select_hyper_contig(H5T_STD_U16LE,H5P_DEFAULT); /* Test contiguous hyperslab selection code */ - test_select_hyper_contig(H5T_STD_U16LE,plist_id); /* Test contiguous hyperslab selection code */ - test_select_hyper_contig(H5T_STD_U16BE,H5P_DEFAULT); /* Test contiguous hyperslab selection code */ - test_select_hyper_contig(H5T_STD_U16BE,plist_id); /* Test contiguous hyperslab selection code */ - test_select_hyper_contig2(H5T_STD_U16LE,H5P_DEFAULT); /* Test more contiguous hyperslab selection cases */ - test_select_hyper_contig2(H5T_STD_U16LE,plist_id); /* Test more contiguous hyperslab selection cases */ - test_select_hyper_contig2(H5T_STD_U16BE,H5P_DEFAULT); /* Test more contiguous hyperslab selection cases */ - test_select_hyper_contig2(H5T_STD_U16BE,plist_id); /* Test more contiguous hyperslab selection cases */ - test_select_hyper_contig3(H5T_STD_U16LE,H5P_DEFAULT); /* Test yet more contiguous hyperslab selection cases */ - test_select_hyper_contig3(H5T_STD_U16LE,plist_id); /* Test yet more contiguous hyperslab selection cases */ - test_select_hyper_contig3(H5T_STD_U16BE,H5P_DEFAULT); /* Test yet more contiguous hyperslab selection cases */ - test_select_hyper_contig3(H5T_STD_U16BE,plist_id); /* Test yet more contiguous hyperslab selection cases */ + test_select_hyper_contig(H5T_STD_U16LE, H5P_DEFAULT); /* Test contiguous hyperslab selection code */ + test_select_hyper_contig(H5T_STD_U16LE, plist_id); /* Test contiguous hyperslab selection code */ + test_select_hyper_contig(H5T_STD_U16BE, H5P_DEFAULT); /* Test contiguous hyperslab selection code */ + test_select_hyper_contig(H5T_STD_U16BE, plist_id); /* Test contiguous hyperslab selection code */ + test_select_hyper_contig2(H5T_STD_U16LE, H5P_DEFAULT); /* Test more contiguous hyperslab selection cases */ + test_select_hyper_contig2(H5T_STD_U16LE, plist_id); /* Test more contiguous hyperslab selection cases */ + test_select_hyper_contig2(H5T_STD_U16BE, H5P_DEFAULT); /* Test more contiguous hyperslab selection cases */ + test_select_hyper_contig2(H5T_STD_U16BE, plist_id); /* Test more contiguous hyperslab selection cases */ + test_select_hyper_contig3(H5T_STD_U16LE, H5P_DEFAULT); /* Test yet more contiguous hyperslab selection cases */ + test_select_hyper_contig3(H5T_STD_U16LE, plist_id); /* Test yet more contiguous hyperslab selection cases */ + test_select_hyper_contig3(H5T_STD_U16BE, H5P_DEFAULT); /* Test yet more contiguous hyperslab selection cases */ + test_select_hyper_contig3(H5T_STD_U16BE, plist_id); /* Test yet more contiguous hyperslab selection cases */ test_select_hyper_contig_dr(H5T_STD_U16LE, H5P_DEFAULT); test_select_hyper_contig_dr(H5T_STD_U16LE, plist_id); test_select_hyper_contig_dr(H5T_STD_U16BE, H5P_DEFAULT); @@ -13148,32 +13148,32 @@ test_select(void) test_select_hyper_union_random_5d(plist_id); /* Test hyperslab union code for random 5-D hyperslabs */ /* Create a dataset transfer property list */ - fapl=H5Pcreate(H5P_FILE_ACCESS); + fapl = H5Pcreate(H5P_FILE_ACCESS); CHECK(fapl, FAIL, "H5Pcreate"); /* Get the default file access properties for caching */ - ret=H5Pget_cache(fapl,&mdc_nelmts,&rdcc_nelmts,&rdcc_nbytes,&rdcc_w0); + ret = H5Pget_cache(fapl, &mdc_nelmts, &rdcc_nelmts, &rdcc_nbytes, &rdcc_w0); CHECK(ret, FAIL, "H5Pget_cache"); /* Increase the size of the raw data cache */ - rdcc_nbytes=10*1024*1024; + rdcc_nbytes = 10 * 1024 * 1024; /* Set the file access properties for caching */ - ret=H5Pset_cache(fapl,mdc_nelmts,rdcc_nelmts,rdcc_nbytes,rdcc_w0); + ret = H5Pset_cache(fapl, mdc_nelmts, rdcc_nelmts, rdcc_nbytes, rdcc_w0); CHECK(ret, FAIL, "H5Pset_cache"); /* Test reading in a large hyperslab with a chunked dataset */ - test_select_hyper_chunk(fapl,H5P_DEFAULT); + test_select_hyper_chunk(fapl, H5P_DEFAULT); /* Test reading in a large hyperslab with a chunked dataset a small amount at a time */ - test_select_hyper_chunk(fapl,plist_id); + test_select_hyper_chunk(fapl, plist_id); /* Close file access property list */ - ret=H5Pclose(fapl); + ret = H5Pclose(fapl); CHECK(ret, FAIL, "H5Pclose"); /* Close dataset transfer property list */ - ret=H5Pclose(plist_id); + ret = H5Pclose(plist_id); CHECK(ret, FAIL, "H5Pclose"); /* More tests for checking validity of selections */ diff --git a/testpar/Makefile.in b/testpar/Makefile.in index 7ed5215..4d1008c 100644 --- a/testpar/Makefile.in +++ b/testpar/Makefile.in @@ -359,14 +359,24 @@ LIBH5_HL = $(top_builddir)/hl/src/libhdf5_hl.la LIBH5F_HL = $(top_builddir)/hl/fortran/src/libhdf5hl_fortran.la LIBH5CPP_HL = $(top_builddir)/hl/c++/src/libhdf5_hl_cpp.la +# Note that in svn revision 19400 the '/' after DESTDIR in H5* variables below +# has been removed. According to the official description of DESTDIR by Gnu at +# http://www.gnu.org/prep/standards/html_node/DESTDIR.html, DESTDIR is +# prepended to the normal and complete install path that it precedes for the +# purpose of installing in a temporary directory which is useful for building +# rpms and other packages. The '/' after ${DESTDIR} will be followed by another +# '/' at the beginning of the normal install path. When DESTDIR is empty the +# path then begins with '//', which is incorrect and causes problems at least for +# Cygwin. + # Scripts used to build examples # If only shared libraries have been installed, have h5cc build examples with # shared libraries instead of static libraries -H5CC = $(bindir)/h5cc -H5CC_PP = $(bindir)/h5pcc -H5FC = $(bindir)/h5fc -H5FC_PP = $(bindir)/h5pfc -H5CPP = $(bindir)/h5c++ +H5CC = ${DESTDIR}$(bindir)/h5cc +H5CC_PP = ${DESTDIR}$(bindir)/h5pcc +H5FC = ${DESTDIR}$(bindir)/h5fc +H5FC_PP = ${DESTDIR}$(bindir)/h5pfc +H5CPP = ${DESTDIR}$(bindir)/h5c++ ACLOCAL_AMFLAGS = "-I m4" # The trace script; this is used on source files from the C library to diff --git a/testpar/t_rank_projection.c b/testpar/t_rank_projection.c index dd73e49..16d8c53 100644 --- a/testpar/t_rank_projection.c +++ b/testpar/t_rank_projection.c @@ -31,6 +31,57 @@ #include "testphdf5.h" #include "H5Spkg.h" /* Dataspaces */ +/* The following macros are used in the detection of tests that run overlong -- + * so that tests can be ommitted if necessary to get the overall set of tests + * to complete. + * + * Observe that we can't do this if we don't have gettimeofday(), so in that + * case, the macros resolve to the empty string. + */ + +#ifdef H5_HAVE_GETTIMEOFDAY + +#define START_TIMER(time_tests, start_time, vrfy_msg) \ + { \ + int result; \ + if ( time_tests ) { \ + result = HDgettimeofday(&(start_time), NULL); \ + VRFY( (result == 0), (vrfy_msg)); \ + } \ + } + +#define STOP_TIMER_AND_UPDATE(time_tests, end_time, vrfy_msg, times) \ + { \ + int result; \ + long long delta_usecs; \ + if ( time_tests ) { \ + result = HDgettimeofday(&(end_time), NULL); \ + VRFY( (result == 0), (vrfy_msg)); \ + delta_usecs = \ + (1000000 * (timeval_b.tv_sec - timeval_a.tv_sec)) + \ + (timeval_b.tv_usec - timeval_a.tv_usec); \ + HDassert( delta_usecs >= 0L ); \ + (times) += delta_usecs; \ + } \ + } + +#else /* H5_HAVE_GETTIMEOFDAY */ + +#define START_TIMER(time_tests, start_time, vrfy_msg) + +#define STOP_TIMER_AND_UPDATE(time_tests, end_time, vrfy_msg, times) + +#endif /* H5_HAVE_GETTIMEOFDAY */ + +/* On Lustre (and perhaps other parallel file systems?), we have severe + * slow downs if two or more processes attempt to access the same file system + * block. To minimize this problem, we set alignment in the shape same tests + * to the default Lustre block size -- which greatly reduces contention in + * the chunked dataset case. + */ + +#define SHAPE_SAME_TEST_ALIGNMENT ((hsize_t)(4 * 1024 * 1024)) + /*------------------------------------------------------------------------- * Function: contig_hyperslab_dr_pio_test__run_test() @@ -44,6 +95,12 @@ * * Modifications: * + * JRM -- 9/16/10 + * Added express_test parameter. Use it to control whether + * we set up the chunks so that no chunk is shared between + * processes, and also whether we set an alignment when we + * create the test file. + * *------------------------------------------------------------------------- */ @@ -57,7 +114,8 @@ contig_hyperslab_dr_pio_test__run_test(const int test_num, const int small_rank, const int large_rank, const hbool_t use_collective_io, - const hid_t dset_type) + const hid_t dset_type, + const int express_test) { #if CONTIG_HYPERSLAB_DR_PIO_TEST__RUN_TEST__DEBUG const char *fcnName = "contig_hyperslab_dr_pio_test__run_test()"; @@ -260,6 +318,16 @@ contig_hyperslab_dr_pio_test__run_test(const int test_num, acc_tpl = create_faccess_plist(mpi_comm, mpi_info, facc_type, use_gpfs); VRFY((acc_tpl >= 0), "create_faccess_plist() succeeded"); + /* set the alignment -- need it large so that we aren't always hitting the + * the same file system block. Do this only if express_test is greater + * than zero. + */ + if ( express_test > 0 ) { + + ret = H5Pset_alignment(acc_tpl, (hsize_t)0, SHAPE_SAME_TEST_ALIGNMENT); + VRFY((ret != FAIL), "H5Pset_alignment() succeeded"); + } + /* create the file collectively */ fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, acc_tpl); VRFY((fid >= 0), "H5Fcreate succeeded"); @@ -357,7 +425,31 @@ contig_hyperslab_dr_pio_test__run_test(const int test_num, */ if ( chunk_edge_size > 0 ) { - chunk_dims[0] = mpi_size + 1; + /* Under Lustre (and perhaps other parallel file systems?) we get + * locking delays when two or more processes attempt to access the + * same file system block. + * + * To minimize this problem, I have changed chunk_dims[0] + * from (mpi_size + 1) to just when any sort of express test is + * selected. Given the structure of the test, and assuming we + * set the alignment large enough, this avoids the contention + * issue by seeing to it that each chunk is only accessed by one + * process. + * + * One can argue as to whether this is a good thing to do in our + * tests, but for now it is necessary if we want the test to complete + * in a reasonable amount of time. + * + * JRM -- 9/16/10 + */ + if ( express_test == 0 ) { + + chunk_dims[0] = 1; + + } else { + + chunk_dims[0] = 1; + } chunk_dims[1] = chunk_dims[2] = chunk_dims[3] = chunk_dims[4] = chunk_edge_size; @@ -1618,6 +1710,15 @@ contig_hyperslab_dr_pio_test__run_test(const int test_num, * * Modifications: * + * Modified function to take a sample of the run times + * of the different tests, and skip some of them if + * run times are too long. + * + * We need to do this because Lustre runns very slowly + * if two or more processes are banging on the same + * block of memory. + * JRM -- 9/10/10 + * *------------------------------------------------------------------------- */ @@ -1629,39 +1730,218 @@ contig_hyperslab_dr_pio_test(void) int chunk_edge_size = 0; int small_rank; int large_rank; - int use_collective_io; + int skips[4] = {0, 0, 0, 0}; + int skip_counters[4] = {0, 0, 0, 0}; + int tests_skiped[4] = {0, 0, 0, 0}; + int mpi_result; hid_t dset_type = H5T_STD_U32LE; +#ifdef H5_HAVE_GETTIMEOFDAY + hbool_t time_tests = TRUE; + hbool_t display_skips = FALSE; + int local_express_test; + int express_test; + int i; + int samples = 0; + int sample_size = 1; + int mpi_size = -1; + int mpi_rank = -1; + int local_skips[4]; + const int ind_contig_idx = 0; + const int col_contig_idx = 1; + const int ind_chunked_idx = 2; + const int col_chunked_idx = 3; + const int test_types = 4; + long long max_test_time = 3000000; /* for one test */ + long long sample_times[4] = {0, 0, 0, 0}; + struct timeval timeval_a; + struct timeval timeval_b; + + MPI_Comm_size(MPI_COMM_WORLD, &mpi_size); + MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank); +#endif /* H5_HAVE_GETTIMEOFDAY */ + + local_express_test = GetTestExpress(); + + mpi_result = MPI_Allreduce((void *)&local_express_test, + (void *)&express_test, + 1, + MPI_INT, + MPI_MAX, + MPI_COMM_WORLD); + + VRFY((mpi_result == MPI_SUCCESS ), "MPI_Allreduce(0) succeeded"); for ( large_rank = 3; large_rank <= PAR_SS_DR_MAX_RANK; large_rank++ ) { for ( small_rank = 2; small_rank < large_rank; small_rank++ ) { - for ( use_collective_io = 0; - use_collective_io <= 1; - use_collective_io++ ) { + chunk_edge_size = 0; + + /* contiguous data set, independent I/O */ + if ( skip_counters[ind_contig_idx] < skips[ind_contig_idx] ) { + + skip_counters[ind_contig_idx]++; + tests_skiped[ind_contig_idx]++; - chunk_edge_size = 0; + } else { + skip_counters[ind_contig_idx] = 0; + START_TIMER(time_tests, timeval_a, "HDgettimeofday(0) succeeds."); contig_hyperslab_dr_pio_test__run_test(test_num, - edge_size, - chunk_edge_size, - small_rank, - large_rank, - (hbool_t)use_collective_io, - dset_type); - test_num++; - chunk_edge_size = 5; + edge_size, + chunk_edge_size, + small_rank, + large_rank, + FALSE, + dset_type, + express_test); + STOP_TIMER_AND_UPDATE(time_tests, timeval_b, \ + "HDgettimeofday(1) succeeds.", \ + sample_times[col_contig_idx]); + } + test_num++; + + /* contiguous data set, collective I/O */ + if ( skip_counters[col_contig_idx] < skips[col_contig_idx] ) { + + skip_counters[col_contig_idx]++; + tests_skiped[col_contig_idx]++; + + } else { + skip_counters[col_contig_idx] = 0; + START_TIMER(time_tests, timeval_a, "HDgettimeofday(2) succeeds."); contig_hyperslab_dr_pio_test__run_test(test_num, - edge_size, - chunk_edge_size, - small_rank, - large_rank, - (hbool_t)use_collective_io, - dset_type); - test_num++; + edge_size, + chunk_edge_size, + small_rank, + large_rank, + TRUE, + dset_type, + express_test); + STOP_TIMER_AND_UPDATE(time_tests, timeval_b, \ + "HDgettimeofday(3) succeeds.", \ + sample_times[ind_contig_idx]); } + test_num++; + + chunk_edge_size = 5; + + /* chunked data set, independent I/O */ + if ( skip_counters[ind_chunked_idx] < skips[ind_chunked_idx] ) { + + skip_counters[ind_chunked_idx]++; + tests_skiped[ind_chunked_idx]++; + + } else { + skip_counters[ind_chunked_idx] = 0; + START_TIMER(time_tests, timeval_a, "HDgettimeofday(4) succeeds."); + contig_hyperslab_dr_pio_test__run_test(test_num, + edge_size, + chunk_edge_size, + small_rank, + large_rank, + FALSE, + dset_type, + express_test); + STOP_TIMER_AND_UPDATE(time_tests, timeval_b, \ + "HDgettimeofday(5) succeeds.", \ + sample_times[col_chunked_idx]); + } + test_num++; + + /* chunked data set, collective I/O */ + if ( skip_counters[col_chunked_idx] < skips[col_chunked_idx] ) { + + skip_counters[col_chunked_idx]++; + tests_skiped[col_chunked_idx]++; + + } else { + skip_counters[col_chunked_idx] = 0; + START_TIMER(time_tests, timeval_a, "HDgettimeofday(6) succeeds."); + contig_hyperslab_dr_pio_test__run_test(test_num, + edge_size, + chunk_edge_size, + small_rank, + large_rank, + TRUE, + dset_type, + express_test); + STOP_TIMER_AND_UPDATE(time_tests, timeval_b, \ + "HDgettimeofday(7) succeeds.", \ + sample_times[ind_chunked_idx]); + } + test_num++; + +#ifdef H5_HAVE_GETTIMEOFDAY + if ( time_tests ) { + + samples++; + + if ( samples >= sample_size ) { + + int result; + + time_tests = FALSE; + + max_test_time = ((long long)sample_size) * max_test_time; + + for ( i = 0; i < test_types; i++ ) { + + if ( ( express_test == 0 ) || + ( sample_times[i] <= max_test_time ) ) { + + local_skips[i] = 0; + + } else { + + local_skips[i] = (int)(sample_times[i] / max_test_time); + } + } + + /* do an MPI_Allreduce() with the skips vector to ensure that + * all processes agree on its contents. + */ + result = MPI_Allreduce((void *)local_skips, + (void *)skips, + test_types, + MPI_INT, + MPI_MAX, + MPI_COMM_WORLD); + VRFY((result == MPI_SUCCESS ), \ + "MPI_Allreduce(1) succeeded"); + } + } +#endif /* H5_HAVE_GETTIMEOFDAY */ + } } +#ifdef H5_HAVE_GETTIMEOFDAY + if ( ( MAINPROCESS ) && ( display_skips ) ) { + + HDfprintf(stdout, "***********************************\n"); + HDfprintf(stdout, "express_test = %d.\n", express_test); + HDfprintf(stdout, "sample_size = %d, max_test_time = %lld.\n", + sample_size, max_test_time); + HDfprintf(stdout, "sample_times[] = %lld, %lld, %lld, %lld.\n", + sample_times[ind_contig_idx], + sample_times[col_contig_idx], + sample_times[ind_chunked_idx], + sample_times[col_chunked_idx]); + HDfprintf(stdout, "skips[] = %d, %d, %d, %d.\n", + skips[ind_contig_idx], + skips[col_contig_idx], + skips[ind_chunked_idx], + skips[col_chunked_idx]); + HDfprintf(stdout, "tests_skiped[] = %d, %d, %d, %d.\n", + tests_skiped[ind_contig_idx], + tests_skiped[col_contig_idx], + tests_skiped[ind_chunked_idx], + tests_skiped[col_chunked_idx]); + HDfprintf(stdout, "test_num = %d.\n", test_num); + HDfprintf(stdout, "***********************************\n"); + } +#endif /* H5_HAVE_GETTIMEOFDAY */ + return; } /* contig_hyperslab_dr_pio_test() */ @@ -2238,6 +2518,12 @@ checker_board_hyperslab_dr_pio_test__verify_data(uint32_t * buf_ptr, * * Modifications: * + * JRM -- 9/16/10 + * Added the express_test parameter. Use it to control + * whether we set an alignment, and whether we allocate + * chunks such that no two processes will normally touch + * the same chunk. + * *------------------------------------------------------------------------- */ @@ -2252,7 +2538,8 @@ checker_board_hyperslab_dr_pio_test__run_test(const int test_num, const int small_rank, const int large_rank, const hbool_t use_collective_io, - const hid_t dset_type) + const hid_t dset_type, + const int express_test) { #if CHECKER_BOARD_HYPERSLAB_DR_PIO_TEST__RUN_TEST__DEBUG const char *fcnName = "checker_board_hyperslab_dr_pio_test__run_test()"; @@ -2464,6 +2751,16 @@ checker_board_hyperslab_dr_pio_test__run_test(const int test_num, acc_tpl = create_faccess_plist(mpi_comm, mpi_info, facc_type, use_gpfs); VRFY((acc_tpl >= 0), "create_faccess_plist() succeeded"); + /* set the alignment -- need it large so that we aren't always hitting the + * the same file system block. Do this only if express_test is greater + * than zero. + */ + if ( express_test > 0 ) { + + ret = H5Pset_alignment(acc_tpl, (hsize_t)0, SHAPE_SAME_TEST_ALIGNMENT); + VRFY((ret != FAIL), "H5Pset_alignment() succeeded"); + } + /* create the file collectively */ fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, acc_tpl); VRFY((fid >= 0), "H5Fcreate succeeded"); @@ -2569,7 +2866,32 @@ checker_board_hyperslab_dr_pio_test__run_test(const int test_num, */ if ( chunk_edge_size > 0 ) { - chunk_dims[0] = mpi_size + 1; + /* Under Lustre (and perhaps other parallel file systems?) we get + * locking delays when two or more processes attempt to access the + * same file system block. + * + * To minimize this problem, I have changed chunk_dims[0] + * from (mpi_size + 1) to just when any sort of express test is + * selected. Given the structure of the test, and assuming we + * set the alignment large enough, this avoids the contention + * issue by seeing to it that each chunk is only accessed by one + * process. + * + * One can argue as to whether this is a good thing to do in our + * tests, but for now it is necessary if we want the test to complete + * in a reasonable amount of time. + * + * JRM -- 9/16/10 + */ + if ( express_test == 0 ) { + + chunk_dims[0] = 1; + + } else { + + chunk_dims[0] = 1; + } + chunk_dims[1] = chunk_dims[2] = chunk_dims[3] = chunk_dims[4] = chunk_edge_size; @@ -3274,6 +3596,7 @@ int m; ptr_1 = large_ds_buf_1 + stop_index + 1; + for ( n = stop_index + 1; n < large_ds_size; n++ ) { if ( *ptr_1 != 0 ) { @@ -3976,6 +4299,15 @@ int m; * * Modifications: * + * Modified function to take a sample of the run times + * of the different tests, and skip some of them if + * run times are too long. + * + * We need to do this because Lustre runns very slowly + * if two or more processes are banging on the same + * block of memory. + * JRM -- 9/10/10 + * *------------------------------------------------------------------------- */ @@ -3988,48 +4320,238 @@ checker_board_hyperslab_dr_pio_test(void) int chunk_edge_size = 0; int small_rank = 3; int large_rank = 4; - int use_collective_io = 1; + int skips[4] = {0, 0, 0, 0}; + int skip_counters[4] = {0, 0, 0, 0}; + int tests_skiped[4] = {0, 0, 0, 0}; + int mpi_result; hid_t dset_type = H5T_STD_U32LE; +#ifdef H5_HAVE_GETTIMEOFDAY + hbool_t time_tests = TRUE; + hbool_t display_skips = FALSE; + int local_express_test; + int express_test; + int i; + int samples = 0; + int sample_size = 1; + int mpi_size = -1; + int mpi_rank = -1; + int local_skips[4]; + const int ind_contig_idx = 0; + const int col_contig_idx = 1; + const int ind_chunked_idx = 2; + const int col_chunked_idx = 3; + const int test_types = 4; + long long max_test_time = 3000000; /* for one test */ + long long sample_times[4] = {0, 0, 0, 0}; + struct timeval timeval_a; + struct timeval timeval_b; + + MPI_Comm_size(MPI_COMM_WORLD, &mpi_size); + MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank); +#endif /* H5_HAVE_GETTIMEOFDAY */ + + local_express_test = GetTestExpress(); + + mpi_result = MPI_Allreduce((void *)&local_express_test, + (void *)&express_test, + 1, + MPI_INT, + MPI_MAX, + MPI_COMM_WORLD); + + VRFY((mpi_result == MPI_SUCCESS ), "MPI_Allreduce(0) succeeded"); + #if 0 - int DebugWait = 1; + { + int DebugWait = 1; - while (DebugWait) ; + while (DebugWait) ; + } #endif for ( large_rank = 3; large_rank <= PAR_SS_DR_MAX_RANK; large_rank++ ) { for ( small_rank = 2; small_rank < large_rank; small_rank++ ) { - for ( use_collective_io = 0; - use_collective_io <= 1; - use_collective_io++ ) { + chunk_edge_size = 0; + + /* contiguous data set, independent I/O */ + if ( skip_counters[ind_contig_idx] < skips[ind_contig_idx] ) { + + skip_counters[ind_contig_idx]++; + tests_skiped[ind_contig_idx]++; + + } else { + skip_counters[ind_contig_idx] = 0; + START_TIMER(time_tests, timeval_a, "HDgettimeofday(0) succeeds."); - chunk_edge_size = 0; checker_board_hyperslab_dr_pio_test__run_test(test_num, - edge_size, - checker_edge_size, - chunk_edge_size, - small_rank, - large_rank, - (hbool_t)use_collective_io, - dset_type); - test_num++; + edge_size, + checker_edge_size, + chunk_edge_size, + small_rank, + large_rank, + FALSE, + dset_type, + express_test); + STOP_TIMER_AND_UPDATE(time_tests, timeval_b, \ + "HDgettimeofday(1) succeeds.", \ + sample_times[ind_contig_idx]); + + } + test_num++; + + /* contiguous data set, collective I/O */ + if ( skip_counters[col_contig_idx] < skips[col_contig_idx] ) { + + skip_counters[col_contig_idx]++; + tests_skiped[col_contig_idx]++; + + } else { + skip_counters[col_contig_idx] = 0; + START_TIMER(time_tests, timeval_a, "HDgettimeofday(2) succeeds."); - chunk_edge_size = 5; checker_board_hyperslab_dr_pio_test__run_test(test_num, - edge_size, - checker_edge_size, - chunk_edge_size, - small_rank, - large_rank, - (hbool_t)use_collective_io, - dset_type); - test_num++; + edge_size, + checker_edge_size, + chunk_edge_size, + small_rank, + large_rank, + TRUE, + dset_type, + express_test); + STOP_TIMER_AND_UPDATE(time_tests, timeval_b, \ + "HDgettimeofday(3) succeeds.", \ + sample_times[col_contig_idx]); } + test_num++; + + chunk_edge_size = 5; + + /* chunked data set, independent I/O */ + if ( skip_counters[ind_chunked_idx] < skips[ind_chunked_idx] ) { + + skip_counters[ind_chunked_idx]++; + tests_skiped[ind_chunked_idx]++; + + } else { + skip_counters[ind_chunked_idx] = 0; + START_TIMER(time_tests, timeval_a, "HDgettimeofday(4) succeeds."); + + checker_board_hyperslab_dr_pio_test__run_test(test_num, + edge_size, + checker_edge_size, + chunk_edge_size, + small_rank, + large_rank, + FALSE, + dset_type, + express_test); + STOP_TIMER_AND_UPDATE(time_tests, timeval_b, \ + "HDgettimeofday(5) succeeds.", \ + sample_times[ind_chunked_idx]); + + } + test_num++; + + + /* chunked data set, collective I/O */ + if ( skip_counters[col_chunked_idx] < skips[col_chunked_idx] ) { + + skip_counters[col_chunked_idx]++; + tests_skiped[col_chunked_idx]++; + + } else { + skip_counters[col_chunked_idx] = 0; + START_TIMER(time_tests, timeval_a, "HDgettimeofday(6) succeeds."); + + checker_board_hyperslab_dr_pio_test__run_test(test_num, + edge_size, + checker_edge_size, + chunk_edge_size, + small_rank, + large_rank, + TRUE, + dset_type, + express_test); + STOP_TIMER_AND_UPDATE(time_tests, timeval_b, \ + "HDgettimeofday(7) succeeds.", \ + sample_times[col_chunked_idx]); + + } + test_num++; + +#ifdef H5_HAVE_GETTIMEOFDAY + if ( time_tests ) { + + samples++; + + if ( samples >= sample_size ) { + + int result; + + time_tests = FALSE; + + max_test_time = ((long long)sample_size) * max_test_time; + + for ( i = 0; i < test_types; i++ ) { + + if ( ( express_test == 0 ) || + ( sample_times[i] <= max_test_time ) ) { + + local_skips[i] = 0; + + } else { + + local_skips[i] = (int)(sample_times[i] / max_test_time); + } + } + + /* do an MPI_Allreduce() with the skips vector to ensure that + * all processes agree on its contents. + */ + result = MPI_Allreduce((void *)local_skips, + (void *)skips, + test_types, + MPI_INT, + MPI_MAX, + MPI_COMM_WORLD); + VRFY((result == MPI_SUCCESS ), "MPI_Allreduce() succeeded"); + } + } +#endif /* H5_HAVE_GETTIMEOFDAY */ + } } +#ifdef H5_HAVE_GETTIMEOFDAY + if ( ( MAINPROCESS ) && ( display_skips ) ) { + + HDfprintf(stdout, "***********************************\n"); + HDfprintf(stdout, "express test = %d.\n", express_test); + HDfprintf(stdout, "sample_size = %d, max_test_time = %lld.\n", + sample_size, max_test_time); + HDfprintf(stdout, "sample_times[] = %lld, %lld, %lld, %lld.\n", + sample_times[ind_contig_idx], + sample_times[col_contig_idx], + sample_times[ind_chunked_idx], + sample_times[col_chunked_idx]); + HDfprintf(stdout, "skips[] = %d, %d, %d, %d.\n", + skips[ind_contig_idx], + skips[col_contig_idx], + skips[ind_chunked_idx], + skips[col_chunked_idx]); + HDfprintf(stdout, "tests_skiped[] = %d, %d, %d, %d.\n", + tests_skiped[ind_contig_idx], + tests_skiped[col_contig_idx], + tests_skiped[ind_chunked_idx], + tests_skiped[col_chunked_idx]); + HDfprintf(stdout, "test_num = %d.\n", test_num); + HDfprintf(stdout, "***********************************\n"); + } +#endif /* H5_HAVE_GETTIMEOFDAY */ + return; } /* checker_board_hyperslab_dr_pio_test() */ diff --git a/tools/Makefile.in b/tools/Makefile.in index 5d2a203..9e408d4 100644 --- a/tools/Makefile.in +++ b/tools/Makefile.in @@ -349,14 +349,24 @@ LIBH5_HL = $(top_builddir)/hl/src/libhdf5_hl.la LIBH5F_HL = $(top_builddir)/hl/fortran/src/libhdf5hl_fortran.la LIBH5CPP_HL = $(top_builddir)/hl/c++/src/libhdf5_hl_cpp.la +# Note that in svn revision 19400 the '/' after DESTDIR in H5* variables below +# has been removed. According to the official description of DESTDIR by Gnu at +# http://www.gnu.org/prep/standards/html_node/DESTDIR.html, DESTDIR is +# prepended to the normal and complete install path that it precedes for the +# purpose of installing in a temporary directory which is useful for building +# rpms and other packages. The '/' after ${DESTDIR} will be followed by another +# '/' at the beginning of the normal install path. When DESTDIR is empty the +# path then begins with '//', which is incorrect and causes problems at least for +# Cygwin. + # Scripts used to build examples # If only shared libraries have been installed, have h5cc build examples with # shared libraries instead of static libraries -H5CC = $(bindir)/h5cc -H5CC_PP = $(bindir)/h5pcc -H5FC = $(bindir)/h5fc -H5FC_PP = $(bindir)/h5pfc -H5CPP = $(bindir)/h5c++ +H5CC = ${DESTDIR}$(bindir)/h5cc +H5CC_PP = ${DESTDIR}$(bindir)/h5pcc +H5FC = ${DESTDIR}$(bindir)/h5fc +H5FC_PP = ${DESTDIR}$(bindir)/h5pfc +H5CPP = ${DESTDIR}$(bindir)/h5c++ ACLOCAL_AMFLAGS = "-I m4" # The trace script; this is used on source files from the C library to diff --git a/tools/h5copy/CMakeLists.txt b/tools/h5copy/CMakeLists.txt index afdd582..17dd7a5 100644 --- a/tools/h5copy/CMakeLists.txt +++ b/tools/h5copy/CMakeLists.txt @@ -131,15 +131,23 @@ IF (BUILD_TESTING) SET (HDF_EXT_SRC_FILE h5copy_extlinks_src) SET (HDF_EXT_TRG_FILE h5copy_extlinks_trg) -############# COPY OBJECTS ############## - # Remove any output file left over from previous test run ADD_TEST ( - NAME H5COPY-clear-objects + NAME H5COPY-clearall-objects COMMAND ${CMAKE_COMMAND} -E remove ./testfiles/${HDF_FILE1}.out.h5 + ./testfiles/${HDF_FILE1}.out.ls ./testfiles/${HDF_FILE1}.out.out + ./testfiles/${HDF_FILE1}.out.out.err + ./testfiles/${HDF_FILE2}.out.h5 + ./testfiles/${HDF_FILE2}.out.ls + ./testfiles/${HDF_FILE2}.out.out + ./testfiles/${HDF_FILE2}.out.out.err + ./testfiles/${HDF_EXT_SRC_FILE}.out.h5 + ./testfiles/${HDF_EXT_SRC_FILE}.out.ls + ./testfiles/${HDF_EXT_SRC_FILE}.out.out + ./testfiles/${HDF_EXT_SRC_FILE}.out.out.err ) # "Test copying various forms of datasets" @@ -166,17 +174,17 @@ IF (BUILD_TESTING) ADD_H5_TEST (simple_group 0 ${HDF_FILE1} v /grp_dsets/simple /grp_dsets/simple_group) # "Test copying & renaming group" - ADD_H5_TEST (grp_rename 1 ${HDF_FILE1} v grp_dsets grp_rename) + ADD_H5_TEST (grp_rename 0 ${HDF_FILE1} v grp_dsets grp_rename) # "Test copying 'full' group hierarchy into group in destination file" - ADD_H5_TEST (grp_dsets_rename 1 ${HDF_FILE1} v grp_dsets /grp_rename/grp_dsets) + ADD_H5_TEST (grp_dsets_rename 0 ${HDF_FILE1} v grp_dsets /grp_rename/grp_dsets) # "Test copying objects into group hier. that doesn't exist yet in destination file" ADD_H5_TEST (A_B1_simple 0 ${HDF_FILE1} vp simple /A/B1/simple) ADD_H5_TEST (A_B2_simple2 0 ${HDF_FILE1} vp simple /A/B2/simple2) ADD_H5_TEST (C_D_simple 0 ${HDF_FILE1} vp /grp_dsets/simple /C/D/simple) - ADD_H5_TEST (E_F_grp_dsets 1 ${HDF_FILE1} vp /grp_dsets /E/F/grp_dsets) - ADD_H5_TEST (G_H_grp_nested 1 ${HDF_FILE1} vp /grp_nested /G/H/grp_nested) + ADD_H5_TEST (E_F_grp_dsets 0 ${HDF_FILE1} vp /grp_dsets /E/F/grp_dsets) + ADD_H5_TEST (G_H_grp_nested 0 ${HDF_FILE1} vp /grp_nested /G/H/grp_nested) # Verify that the file created above is correct ADD_H5LS_TEST (${HDF_FILE1}) @@ -190,6 +198,7 @@ IF (BUILD_TESTING) -E remove ./testfiles/${HDF_FILE2}.out.h5 ./testfiles/${HDF_FILE2}.out.out + ./testfiles/${HDF_FILE2}.out.out.err ) # "Test copying object and region references" @@ -207,6 +216,7 @@ IF (BUILD_TESTING) -E remove ./testfiles/${HDF_EXT_SRC_FILE}.out.h5 ./testfiles/${HDF_EXT_SRC_FILE}.out.out + ./testfiles/${HDF_EXT_SRC_FILE}.out.out.err ) # "Test copying external link directly without -f ext" @@ -251,7 +261,7 @@ INSTALL ( TARGETS h5copy RUNTIME DESTINATION - bin/tools + ${HDF5_INSTALL_BIN_DIR}/tools COMPONENT toolsapplications ) diff --git a/tools/h5copy/Makefile.in b/tools/h5copy/Makefile.in index 9e382d1..83fb97d 100644 --- a/tools/h5copy/Makefile.in +++ b/tools/h5copy/Makefile.in @@ -341,14 +341,24 @@ LIBH5_HL = $(top_builddir)/hl/src/libhdf5_hl.la LIBH5F_HL = $(top_builddir)/hl/fortran/src/libhdf5hl_fortran.la LIBH5CPP_HL = $(top_builddir)/hl/c++/src/libhdf5_hl_cpp.la +# Note that in svn revision 19400 the '/' after DESTDIR in H5* variables below +# has been removed. According to the official description of DESTDIR by Gnu at +# http://www.gnu.org/prep/standards/html_node/DESTDIR.html, DESTDIR is +# prepended to the normal and complete install path that it precedes for the +# purpose of installing in a temporary directory which is useful for building +# rpms and other packages. The '/' after ${DESTDIR} will be followed by another +# '/' at the beginning of the normal install path. When DESTDIR is empty the +# path then begins with '//', which is incorrect and causes problems at least for +# Cygwin. + # Scripts used to build examples # If only shared libraries have been installed, have h5cc build examples with # shared libraries instead of static libraries -H5CC = $(bindir)/h5cc -H5CC_PP = $(bindir)/h5pcc -H5FC = $(bindir)/h5fc -H5FC_PP = $(bindir)/h5pfc -H5CPP = $(bindir)/h5c++ +H5CC = ${DESTDIR}$(bindir)/h5cc +H5CC_PP = ${DESTDIR}$(bindir)/h5pcc +H5FC = ${DESTDIR}$(bindir)/h5fc +H5FC_PP = ${DESTDIR}$(bindir)/h5pfc +H5CPP = ${DESTDIR}$(bindir)/h5c++ ACLOCAL_AMFLAGS = "-I m4" # The trace script; this is used on source files from the C library to diff --git a/tools/h5diff/CMakeLists.txt b/tools/h5diff/CMakeLists.txt index 924c4ec..a784ae7 100644 --- a/tools/h5diff/CMakeLists.txt +++ b/tools/h5diff/CMakeLists.txt @@ -118,6 +118,7 @@ IF (BUILD_TESTING) h5diff_481.txt h5diff_482.txt h5diff_483.txt + h5diff_484.txt h5diff_50.txt h5diff_51.txt h5diff_52.txt @@ -129,6 +130,7 @@ IF (BUILD_TESTING) h5diff_58.txt h5diff_500.txt h5diff_501.txt + h5diff_502.txt h5diff_503.txt h5diff_504.txt h5diff_505.txt @@ -137,9 +139,14 @@ IF (BUILD_TESTING) h5diff_508.txt h5diff_509.txt h5diff_510.txt + h5diff_511.txt h5diff_512.txt h5diff_513.txt h5diff_514.txt + h5diff_515.txt + h5diff_516.txt + h5diff_517.txt + h5diff_518.txt h5diff_600.txt h5diff_601.txt h5diff_603.txt @@ -206,7 +213,7 @@ IF (BUILD_TESTING) FOREACH (txt_file ${HDF5_REFERENCE_FILES}) SET (txtdest "${PROJECT_BINARY_DIR}/${txt_file}") - #MESSAGE (STATUS " Translating ${txt_file}") + #MESSAGE (STATUS " Copying ${txt_file}") ADD_CUSTOM_COMMAND ( TARGET h5diff POST_BUILD @@ -226,7 +233,7 @@ IF (BUILD_TESTING) ) ENDFOREACH (h5_file ${HDF5_REFERENCE_TEST_FILES}) - IF (WIN32) + IF (WIN32 AND NOT CYGWIN) ADD_CUSTOM_COMMAND ( TARGET h5diff POST_BUILD @@ -240,7 +247,7 @@ IF (BUILD_TESTING) COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_102w.txt ${PROJECT_BINARY_DIR}/h5diff_102.txt ) - ELSE (WIN32) + ELSE (WIN32 AND NOT CYGWIN) ADD_CUSTOM_COMMAND ( TARGET h5diff POST_BUILD @@ -254,7 +261,7 @@ IF (BUILD_TESTING) COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_102.txt ${PROJECT_BINARY_DIR}/h5diff_102.txt ) - ENDIF (WIN32) + ENDIF (WIN32 AND NOT CYGWIN) ############################################################################## ############################################################################## @@ -286,40 +293,314 @@ IF (BUILD_TESTING) # -------------------------------------------------------------------- # test file names # -------------------------------------------------------------------- -SET (FILE1 h5diff_basic1.h5) -SET (FILE2 h5diff_basic2.h5) -SET (FILE3 h5diff_types.h5) -SET (FILE4 h5diff_dtypes.h5) -SET (FILE5 h5diff_attr1.h5) -SET (FILE6 h5diff_attr2.h5) -SET (FILE7 h5diff_dset1.h5) -SET (FILE8 h5diff_dset2.h5) -SET (FILE9 h5diff_hyper1.h5) -SET (FILE10 h5diff_hyper2.h5) -SET (FILE11 h5diff_empty.h5) -SET (FILE12 h5diff_links.h5) -SET (FILE13 h5diff_softlinks.h5) -SET (FILE14 h5diff_linked_softlink.h5) -SET (FILE15 h5diff_extlink_src.h5) -SET (FILE16 h5diff_extlink_trg.h5) -SET (FILE17 h5diff_ext2softlink_src.h5) -SET (FILE18 h5diff_ext2softlink_trg.h5) -SET (DANGLE_LINK_FILE1 h5diff_danglelinks1.h5) -SET (DANGLE_LINK_FILE2 h5diff_danglelinks2.h5) -SET (GRP_RECURSE_FILE1 h5diff_grp_recurse1.h5) -SET (GRP_RECURSE_FILE2 h5diff_grp_recurse2.h5) -# group recursive - same structure via external links through files -SET (GRP_RECURSE1_EXT h5diff_grp_recurse_ext1.h5) -SET (GRP_RECURSE2_EXT1 h5diff_grp_recurse_ext2-1.h5) -SET (GRP_RECURSE2_EXT2 h5diff_grp_recurse_ext2-2.h5) -SET (GRP_RECURSE2_EXT3 h5diff_grp_recurse_ext2-3.h5) -# same structure, same obj name with different value -SET (EXCLUDE_FILE1_1 h5diff_exclude1-1.h5) -SET (EXCLUDE_FILE1_2 h5diff_exclude1-2.h5) -# different structure and obj names -SET (EXCLUDE_FILE2_1 h5diff_exclude2-1.h5) -SET (EXCLUDE_FILE2_2 h5diff_exclude2-2.h5) - + SET (FILE1 h5diff_basic1.h5) + SET (FILE2 h5diff_basic2.h5) + SET (FILE3 h5diff_types.h5) + SET (FILE4 h5diff_dtypes.h5) + SET (FILE5 h5diff_attr1.h5) + SET (FILE6 h5diff_attr2.h5) + SET (FILE7 h5diff_dset1.h5) + SET (FILE8 h5diff_dset2.h5) + SET (FILE9 h5diff_hyper1.h5) + SET (FILE10 h5diff_hyper2.h5) + SET (FILE11 h5diff_empty.h5) + SET (FILE12 h5diff_links.h5) + SET (FILE13 h5diff_softlinks.h5) + SET (FILE14 h5diff_linked_softlink.h5) + SET (FILE15 h5diff_extlink_src.h5) + SET (FILE16 h5diff_extlink_trg.h5) + SET (FILE17 h5diff_ext2softlink_src.h5) + SET (FILE18 h5diff_ext2softlink_trg.h5) + SET (DANGLE_LINK_FILE1 h5diff_danglelinks1.h5) + SET (DANGLE_LINK_FILE2 h5diff_danglelinks2.h5) + SET (GRP_RECURSE_FILE1 h5diff_grp_recurse1.h5) + SET (GRP_RECURSE_FILE2 h5diff_grp_recurse2.h5) + # group recursive - same structure via external links through files + SET (GRP_RECURSE1_EXT h5diff_grp_recurse_ext1.h5) + SET (GRP_RECURSE2_EXT1 h5diff_grp_recurse_ext2-1.h5) + SET (GRP_RECURSE2_EXT2 h5diff_grp_recurse_ext2-2.h5) + SET (GRP_RECURSE2_EXT3 h5diff_grp_recurse_ext2-3.h5) + # same structure, same obj name with different value + SET (EXCLUDE_FILE1_1 h5diff_exclude1-1.h5) + SET (EXCLUDE_FILE1_2 h5diff_exclude1-2.h5) + # different structure and obj names + SET (EXCLUDE_FILE2_1 h5diff_exclude2-1.h5) + SET (EXCLUDE_FILE2_2 h5diff_exclude2-2.h5) + + # Remove any output file left over from previous test run + ADD_TEST ( + NAME H5DIFF-clearall-objects + COMMAND ${CMAKE_COMMAND} + -E remove + h5diff_10.out + h5diff_10.out.err + h5diff_100.out + h5diff_100.out.err + h5diff_101.out + h5diff_101.out.err + h5diff_102.out + h5diff_102.out.err + h5diff_11.out + h5diff_11.out.err + h5diff_12.out + h5diff_12.out.err + h5diff_13.out + h5diff_13.out.err + h5diff_14.out + h5diff_14.out.err + h5diff_15.out + h5diff_15.out.err + h5diff_16_1.out + h5diff_16_1.out.err + h5diff_16_2.out + h5diff_16_2.out.err + h5diff_16_3.out + h5diff_16_3.out.err + h5diff_17.out + h5diff_17.out.err + h5diff_171.out + h5diff_171.out.err + h5diff_172.out + h5diff_172.out.err + h5diff_18_1.out + h5diff_18_1.out.err + h5diff_18.out + h5diff_18.out.err + h5diff_20.out + h5diff_20.out.err + h5diff_200.out + h5diff_200.out.err + h5diff_201.out + h5diff_201.out.err + h5diff_202.out + h5diff_202.out.err + h5diff_203.out + h5diff_203.out.err + h5diff_204.out + h5diff_204.out.err + h5diff_205.out + h5diff_205.out.err + h5diff_206.out + h5diff_206.out.err + h5diff_207.out + h5diff_207.out.err + h5diff_21.out + h5diff_21.out.err + h5diff_22.out + h5diff_22.out.err + h5diff_23.out + h5diff_23.out.err + h5diff_24.out + h5diff_24.out.err + h5diff_25.out + h5diff_25.out.err + h5diff_26.out + h5diff_26.out.err + h5diff_27.out + h5diff_27.out.err + h5diff_28.out + h5diff_28.out.err + h5diff_300.out + h5diff_300.out.err + h5diff_400.out + h5diff_400.out.err + h5diff_401.out + h5diff_401.out.err + h5diff_402.out + h5diff_402.out.err + h5diff_403.out + h5diff_403.out.err + h5diff_404.out + h5diff_404.out.err + h5diff_405.out + h5diff_405.out.err + h5diff_406.out + h5diff_406.out.err + h5diff_407.out + h5diff_407.out.err + h5diff_408.out + h5diff_408.out.err + h5diff_409.out + h5diff_409.out.err + h5diff_410.out + h5diff_410.out.err + h5diff_411.out + h5diff_411.out.err + h5diff_412.out + h5diff_412.out.err + h5diff_413.out + h5diff_413.out.err + h5diff_414.out + h5diff_414.out.err + h5diff_415.out + h5diff_415.out.err + h5diff_416.out + h5diff_416.out.err + h5diff_417.out + h5diff_417.out.err + h5diff_418.out + h5diff_418.out.err + h5diff_419.out + h5diff_419.out.err + h5diff_420.out + h5diff_420.out.err + h5diff_421.out + h5diff_421.out.err + h5diff_422.out + h5diff_422.out.err + h5diff_423.out + h5diff_423.out.err + h5diff_424.out + h5diff_424.out.err + h5diff_425.out + h5diff_425.out.err + h5diff_450.out + h5diff_450.out.err + h5diff_451.out + h5diff_451.out.err + h5diff_452.out + h5diff_452.out.err + h5diff_453.out + h5diff_453.out.err + h5diff_454.out + h5diff_454.out.err + h5diff_455.out + h5diff_455.out.err + h5diff_456.out + h5diff_456.out.err + h5diff_457.out + h5diff_457.out.err + h5diff_458.out + h5diff_458.out.err + h5diff_459.out + h5diff_459.out.err + h5diff_480.out + h5diff_480.out.err + h5diff_481.out + h5diff_481.out.err + h5diff_482.out + h5diff_482.out.err + h5diff_483.out + h5diff_483.out.err + h5diff_484.out + h5diff_484.out.err + h5diff_50.out + h5diff_50.out.err + h5diff_51.out + h5diff_51.out.err + h5diff_52.out + h5diff_52.out.err + h5diff_53.out + h5diff_53.out.err + h5diff_54.out + h5diff_54.out.err + h5diff_55.out + h5diff_55.out.err + h5diff_56.out + h5diff_56.out.err + h5diff_57.out + h5diff_57.out.err + h5diff_58.out + h5diff_58.out.err + h5diff_500.out + h5diff_500.out.err + h5diff_501.out + h5diff_501.out.err + h5diff_502.out + h5diff_502.out.err + h5diff_503.out + h5diff_503.out.err + h5diff_504.out + h5diff_504.out.err + h5diff_505.out + h5diff_505.out.err + h5diff_506.out + h5diff_506.out.err + h5diff_507.out + h5diff_507.out.err + h5diff_508.out + h5diff_508.out.err + h5diff_509.out + h5diff_509.out.err + h5diff_510.out + h5diff_510.out.err + h5diff_511.out + h5diff_511.out.err + h5diff_512.out + h5diff_512.out.err + h5diff_513.out + h5diff_513.out.err + h5diff_514.out + h5diff_514.out.err + h5diff_515.out + h5diff_515.out.err + h5diff_516.out + h5diff_516.out.err + h5diff_517.out + h5diff_517.out.err + h5diff_518.out + h5diff_518.out.err + h5diff_600.out + h5diff_600.out.err + h5diff_601.out + h5diff_601.out.err + h5diff_603.out + h5diff_603.out.err + h5diff_604.out + h5diff_604.out.err + h5diff_605.out + h5diff_605.out.err + h5diff_606.out + h5diff_606.out.err + h5diff_607.out + h5diff_607.out.err + h5diff_608.out + h5diff_608.out.err + h5diff_609.out + h5diff_609.out.err + h5diff_610.out + h5diff_610.out.err + h5diff_612.out + h5diff_612.out.err + h5diff_613.out + h5diff_613.out.err + h5diff_614.out + h5diff_614.out.err + h5diff_615.out + h5diff_615.out.err + h5diff_616.out + h5diff_616.out.err + h5diff_617.out + h5diff_617.out.err + h5diff_618.out + h5diff_618.out.err + h5diff_619.out + h5diff_619.out.err + h5diff_621.out + h5diff_621.out.err + h5diff_622.out + h5diff_622.out.err + h5diff_623.out + h5diff_623.out.err + h5diff_624.out + h5diff_624.out.err + h5diff_625.out + h5diff_625.out.err + h5diff_626.out + h5diff_626.out.err + h5diff_627.out + h5diff_627.out.err + h5diff_628.out + h5diff_628.out.err + h5diff_629.out + h5diff_629.out.err + h5diff_70.out + h5diff_70.out.err + h5diff_80.out + h5diff_80.out.err + h5diff_90.out + h5diff_90.out.err + ) # ############################################################################ # # Common usage @@ -395,7 +676,7 @@ ADD_H5_TEST (h5diff_24 0 -v ${FILE3} ${FILE3} t1 t1) ADD_H5_TEST (h5diff_25 0 -v ${FILE3} ${FILE3} l1 l1) # 2.6 -ADD_H5_TEST (h5diff_26 1 -v ${FILE3} ${FILE3} g1 g2) +ADD_H5_TEST (h5diff_26 0 -v ${FILE3} ${FILE3} g1 g2) # 2.7 ADD_H5_TEST (h5diff_27 1 -v ${FILE3} ${FILE3} t1 t2) @@ -642,7 +923,7 @@ ADD_H5_TEST (h5diff_414 1 --follow-symlinks -v ${FILE14} ${FILE14} /target_group ADD_H5_TEST (h5diff_415 1 --follow-symlinks -v ${FILE14} ${FILE14} /softlink3_to_slink2 /target_group) # linked_softlink_to_group1 vs linked_softlink_to_group2" -ADD_H5_TEST (h5diff_416 1 --follow-symlinks -v ${FILE14} ${FILE14} /softlink3_to_slink2 /softlink4_to_slink2) +ADD_H5_TEST (h5diff_416 0 --follow-symlinks -v ${FILE14} ${FILE14} /softlink3_to_slink2 /softlink4_to_slink2) # non-exist-softlink vs softlink" ADD_H5_TEST (h5diff_417 1 --follow-symlinks -v ${FILE13} ${FILE13} /softlink_noexist /softlink_dset2) @@ -709,37 +990,37 @@ ADD_H5_TEST (h5diff_459 2 --follow-symlinks -v --no-dangling-links ${FILE15} $ # # test for group diff recursivly # ############################################################################## # root -ADD_H5_TEST (h5diff_500 -v ${GRP_RECURSE_FILE1} ${GRP_RECURSE_FILE2} / /) -ADD_H5_TEST (h5diff_501 -v --follow-symlinks ${GRP_RECURSE_FILE1} ${GRP_RECURSE_FILE2} / /) +ADD_H5_TEST (h5diff_500 1 -v ${GRP_RECURSE_FILE1} ${GRP_RECURSE_FILE2} / /) +ADD_H5_TEST (h5diff_501 1 -v --follow-symlinks ${GRP_RECURSE_FILE1} ${GRP_RECURSE_FILE2} / /) # root vs group -ADD_H5_TEST (h5diff_502 -v ${GRP_RECURSE_FILE1} ${GRP_RECURSE_FILE2} / /grp1/grp2/grp3) +ADD_H5_TEST (h5diff_502 1 -v ${GRP_RECURSE_FILE1} ${GRP_RECURSE_FILE2} / /grp1/grp2/grp3) # group vs group (same name and structure) -ADD_H5_TEST (h5diff_503 -v ${GRP_RECURSE_FILE1} ${GRP_RECURSE_FILE2} /grp1 /grp1) +ADD_H5_TEST (h5diff_503 0 -v ${GRP_RECURSE_FILE1} ${GRP_RECURSE_FILE2} /grp1 /grp1) # group vs group (different name and structure) -ADD_H5_TEST (h5diff_504 -v ${GRP_RECURSE_FILE1} ${GRP_RECURSE_FILE2} /grp1/grp2 /grp1/grp2/grp3) +ADD_H5_TEST (h5diff_504 1 -v ${GRP_RECURSE_FILE1} ${GRP_RECURSE_FILE2} /grp1/grp2 /grp1/grp2/grp3) # groups vs soft-link -ADD_H5_TEST (h5diff_505 -v ${GRP_RECURSE_FILE1} ${GRP_RECURSE_FILE2} /grp1 /slink_grp1) -ADD_H5_TEST (h5diff_506 -v --follow-symlinks ${GRP_RECURSE_FILE1} ${GRP_RECURSE_FILE2} /grp1/grp2 /slink_grp2) +ADD_H5_TEST (h5diff_505 0 -v ${GRP_RECURSE_FILE1} ${GRP_RECURSE_FILE2} /grp1 /slink_grp1) +ADD_H5_TEST (h5diff_506 0 -v --follow-symlinks ${GRP_RECURSE_FILE1} ${GRP_RECURSE_FILE2} /grp1/grp2 /slink_grp2) # groups vs ext-link -ADD_H5_TEST (h5diff_507 -v ${GRP_RECURSE_FILE1} ${GRP_RECURSE_FILE2} /grp1 /elink_grp1) -ADD_H5_TEST (h5diff_508 -v --follow-symlinks ${GRP_RECURSE_FILE1} ${GRP_RECURSE_FILE2} /grp1 /elink_grp1) +ADD_H5_TEST (h5diff_507 0 -v ${GRP_RECURSE_FILE1} ${GRP_RECURSE_FILE2} /grp1 /elink_grp1) +ADD_H5_TEST (h5diff_508 0 -v --follow-symlinks ${GRP_RECURSE_FILE1} ${GRP_RECURSE_FILE2} /grp1 /elink_grp1) # soft-link vs ext-link -ADD_H5_TEST (h5diff_509 -v ${GRP_RECURSE_FILE1} ${GRP_RECURSE_FILE2} /slink_grp1 /elink_grp1) -ADD_H5_TEST (h5diff_510 -v --follow-symlinks ${GRP_RECURSE_FILE1} ${GRP_RECURSE_FILE2} /slink_grp1 /elink_grp1) +ADD_H5_TEST (h5diff_509 0 -v ${GRP_RECURSE_FILE1} ${GRP_RECURSE_FILE2} /slink_grp1 /elink_grp1) +ADD_H5_TEST (h5diff_510 0 -v --follow-symlinks ${GRP_RECURSE_FILE1} ${GRP_RECURSE_FILE2} /slink_grp1 /elink_grp1) # circled ext links -ADD_H5_TEST (h5diff_511 -v ${GRP_RECURSE_FILE1} ${GRP_RECURSE_FILE2} /grp10 /grp11) -ADD_H5_TEST (h5diff_512 -v --follow-symlinks ${GRP_RECURSE_FILE1} ${GRP_RECURSE_FILE2} /grp10 /grp11) +ADD_H5_TEST (h5diff_511 1 -v ${GRP_RECURSE_FILE1} ${GRP_RECURSE_FILE2} /grp10 /grp11) +ADD_H5_TEST (h5diff_512 1 -v --follow-symlinks ${GRP_RECURSE_FILE1} ${GRP_RECURSE_FILE2} /grp10 /grp11) # circled soft2ext-link vs soft2ext-link -ADD_H5_TEST (h5diff_513 -v ${GRP_RECURSE_FILE1} ${GRP_RECURSE_FILE2} /slink_grp10 /slink_grp11) -ADD_H5_TEST (h5diff_514 -v --follow-symlinks ${GRP_RECURSE_FILE1} ${GRP_RECURSE_FILE2} /slink_grp10 /slink_grp11) +ADD_H5_TEST (h5diff_513 1 -v ${GRP_RECURSE_FILE1} ${GRP_RECURSE_FILE2} /slink_grp10 /slink_grp11) +ADD_H5_TEST (h5diff_514 1 -v --follow-symlinks ${GRP_RECURSE_FILE1} ${GRP_RECURSE_FILE2} /slink_grp10 /slink_grp11) ############################################################################### # Test for group recursive diff via multi-linked external links @@ -747,11 +1028,11 @@ ADD_H5_TEST (h5diff_514 -v --follow-symlinks ${GRP_RECURSE_FILE1} ${GRP_RECURSE_ # be same with the external links. ############################################################################### # file vs file -ADD_H5_TEST (h5diff_515 -v ${GRP_RECURSE1_EXT} ${GRP_RECURSE2_EXT1}) -ADD_H5_TEST (h5diff_516 -v --follow-symlinks ${GRP_RECURSE1_EXT} ${GRP_RECURSE2_EXT1}) +ADD_H5_TEST (h5diff_515 1 -v ${GRP_RECURSE1_EXT} ${GRP_RECURSE2_EXT1}) +ADD_H5_TEST (h5diff_516 0 -v --follow-symlinks ${GRP_RECURSE1_EXT} ${GRP_RECURSE2_EXT1}) # group vs group -ADD_H5_TEST (h5diff_517 -v ${GRP_RECURSE1_EXT} ${GRP_RECURSE2_EXT1} /g1) -ADD_H5_TEST (h5diff_518 -v --follow-symlinks ${GRP_RECURSE1_EXT} ${GRP_RECURSE2_EXT1} /g1) +ADD_H5_TEST (h5diff_517 1 -v ${GRP_RECURSE1_EXT} ${GRP_RECURSE2_EXT1} /g1) +ADD_H5_TEST (h5diff_518 0 -v --follow-symlinks ${GRP_RECURSE1_EXT} ${GRP_RECURSE2_EXT1} /g1) # ############################################################################## @@ -773,6 +1054,9 @@ ADD_H5_TEST (h5diff_482 0 -v --exclude-path "/group1" --exclude-path "/dset1" ${ # Exclude only some different objects. Expect return - diff ADD_H5_TEST (h5diff_483 1 -v --exclude-path "/group1" ${EXCLUDE_FILE2_1} ${EXCLUDE_FILE2_2}) +# Exclude from group compare +ADD_H5_TEST (h5diff_484 0 -v --exclude-path "/dset3" ${EXCLUDE_FILE1_1} ${EXCLUDE_FILE1_2} /group1) + ENDIF (BUILD_TESTING) @@ -789,7 +1073,7 @@ INSTALL ( TARGETS h5diff RUNTIME DESTINATION - bin/tools + ${HDF5_INSTALL_BIN_DIR}/tools COMPONENT toolsapplications ) diff --git a/tools/h5diff/Makefile.in b/tools/h5diff/Makefile.in index ce3acd9..3bfbf8e 100644 --- a/tools/h5diff/Makefile.in +++ b/tools/h5diff/Makefile.in @@ -348,14 +348,24 @@ LIBH5_HL = $(top_builddir)/hl/src/libhdf5_hl.la LIBH5F_HL = $(top_builddir)/hl/fortran/src/libhdf5hl_fortran.la LIBH5CPP_HL = $(top_builddir)/hl/c++/src/libhdf5_hl_cpp.la +# Note that in svn revision 19400 the '/' after DESTDIR in H5* variables below +# has been removed. According to the official description of DESTDIR by Gnu at +# http://www.gnu.org/prep/standards/html_node/DESTDIR.html, DESTDIR is +# prepended to the normal and complete install path that it precedes for the +# purpose of installing in a temporary directory which is useful for building +# rpms and other packages. The '/' after ${DESTDIR} will be followed by another +# '/' at the beginning of the normal install path. When DESTDIR is empty the +# path then begins with '//', which is incorrect and causes problems at least for +# Cygwin. + # Scripts used to build examples # If only shared libraries have been installed, have h5cc build examples with # shared libraries instead of static libraries -H5CC = $(bindir)/h5cc -H5CC_PP = $(bindir)/h5pcc -H5FC = $(bindir)/h5fc -H5FC_PP = $(bindir)/h5pfc -H5CPP = $(bindir)/h5c++ +H5CC = ${DESTDIR}$(bindir)/h5cc +H5CC_PP = ${DESTDIR}$(bindir)/h5pcc +H5FC = ${DESTDIR}$(bindir)/h5fc +H5FC_PP = ${DESTDIR}$(bindir)/h5pfc +H5CPP = ${DESTDIR}$(bindir)/h5c++ ACLOCAL_AMFLAGS = "-I m4" # The trace script; this is used on source files from the C library to diff --git a/tools/h5diff/h5diff_common.c b/tools/h5diff/h5diff_common.c index a678b2f..84eb49a 100644 --- a/tools/h5diff/h5diff_common.c +++ b/tools/h5diff/h5diff_common.c @@ -453,6 +453,30 @@ void usage(void) printf(" comparing floating point values.\n"); printf(" By default, strict equality is used. Use -p or -d to\n"); printf(" set specific tolerance.\n"); + printf(" --exclude-path \"path\" Exclude the specified path to an object when\n"); + printf(" comparing files or groups. If a group is excluded,\n"); + printf(" all member objects will also be excluded.\n"); + printf(" The specified path is excluded wherever it occurs.\n"); + printf(" This flexibility enables the same option to exclude\n"); + printf(" either objects that exist only in one file or\n"); + printf(" common objects that are known to differ.\n"); + printf("\n"); + printf(" When comparing files, \"path\" is the absolute path to\n"); + printf(" the excluded object; when comparing groups, \"path\" is\n"); + printf(" similar to the relative path from the group to the\n"); + printf(" excluded object. This \"path\" can be taken from the\n"); + printf(" first section of the output of the --verbose option.\n"); + printf(" For example, if you are comparing the group /groupA\n"); + printf(" in two files and you want to exclude\n"); + printf(" /groupA/groupB/groupC in both files, the exclude\n"); + printf(" option would read as follows:\n"); + printf(" --exclude-path \"/groupB/groupC\"\n"); + printf("\n"); + printf(" If there are multiple paths to an object, only the\n"); + printf(" specified path(s) will be excluded; the comparison\n"); + printf(" will include any path not explicitly excluded.\n"); + printf(" This option can be used repeatedly to exclude\n"); + printf(" multiple paths.\n"); printf("\n"); printf(" Modes of output:\n"); diff --git a/tools/h5diff/testfiles/h5diff_10.txt b/tools/h5diff/testfiles/h5diff_10.txt index 224f9bc..4dae480 100644 --- a/tools/h5diff/testfiles/h5diff_10.txt +++ b/tools/h5diff/testfiles/h5diff_10.txt @@ -62,6 +62,30 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] comparing floating point values. By default, strict equality is used. Use -p or -d to set specific tolerance. + --exclude-path "path" Exclude the specified path to an object when + comparing files or groups. If a group is excluded, + all member objects will also be excluded. + The specified path is excluded wherever it occurs. + This flexibility enables the same option to exclude + either objects that exist only in one file or + common objects that are known to differ. + + When comparing files, "path" is the absolute path to + the excluded object; when comparing groups, "path" is + similar to the relative path from the group to the + excluded object. This "path" can be taken from the + first section of the output of the --verbose option. + For example, if you are comparing the group /groupA + in two files and you want to exclude + /groupA/groupB/groupC in both files, the exclude + option would read as follows: + --exclude-path "/groupB/groupC" + + If there are multiple paths to an object, only the + specified path(s) will be excluded; the comparison + will include any path not explicitly excluded. + This option can be used repeatedly to exclude + multiple paths. Modes of output: Default mode: print the number of differences found and where they occured diff --git a/tools/h5diff/testfiles/h5diff_484.txt b/tools/h5diff/testfiles/h5diff_484.txt new file mode 100644 index 0000000..87d9c7c --- /dev/null +++ b/tools/h5diff/testfiles/h5diff_484.txt @@ -0,0 +1,11 @@ + +group1 group2 +--------------------------------------- + x x + x x /dset2 + +group : and +0 differences found +dataset: and +0 differences found +EXIT CODE: 0 diff --git a/tools/h5diff/testfiles/h5diff_600.txt b/tools/h5diff/testfiles/h5diff_600.txt index b096ab5..ea767fc 100644 --- a/tools/h5diff/testfiles/h5diff_600.txt +++ b/tools/h5diff/testfiles/h5diff_600.txt @@ -62,6 +62,30 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] comparing floating point values. By default, strict equality is used. Use -p or -d to set specific tolerance. + --exclude-path "path" Exclude the specified path to an object when + comparing files or groups. If a group is excluded, + all member objects will also be excluded. + The specified path is excluded wherever it occurs. + This flexibility enables the same option to exclude + either objects that exist only in one file or + common objects that are known to differ. + + When comparing files, "path" is the absolute path to + the excluded object; when comparing groups, "path" is + similar to the relative path from the group to the + excluded object. This "path" can be taken from the + first section of the output of the --verbose option. + For example, if you are comparing the group /groupA + in two files and you want to exclude + /groupA/groupB/groupC in both files, the exclude + option would read as follows: + --exclude-path "/groupB/groupC" + + If there are multiple paths to an object, only the + specified path(s) will be excluded; the comparison + will include any path not explicitly excluded. + This option can be used repeatedly to exclude + multiple paths. Modes of output: Default mode: print the number of differences found and where they occured diff --git a/tools/h5diff/testfiles/h5diff_603.txt b/tools/h5diff/testfiles/h5diff_603.txt index 2b37530..1c48c8b 100644 --- a/tools/h5diff/testfiles/h5diff_603.txt +++ b/tools/h5diff/testfiles/h5diff_603.txt @@ -63,6 +63,30 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] comparing floating point values. By default, strict equality is used. Use -p or -d to set specific tolerance. + --exclude-path "path" Exclude the specified path to an object when + comparing files or groups. If a group is excluded, + all member objects will also be excluded. + The specified path is excluded wherever it occurs. + This flexibility enables the same option to exclude + either objects that exist only in one file or + common objects that are known to differ. + + When comparing files, "path" is the absolute path to + the excluded object; when comparing groups, "path" is + similar to the relative path from the group to the + excluded object. This "path" can be taken from the + first section of the output of the --verbose option. + For example, if you are comparing the group /groupA + in two files and you want to exclude + /groupA/groupB/groupC in both files, the exclude + option would read as follows: + --exclude-path "/groupB/groupC" + + If there are multiple paths to an object, only the + specified path(s) will be excluded; the comparison + will include any path not explicitly excluded. + This option can be used repeatedly to exclude + multiple paths. Modes of output: Default mode: print the number of differences found and where they occured diff --git a/tools/h5diff/testfiles/h5diff_606.txt b/tools/h5diff/testfiles/h5diff_606.txt index 63a1d53..8f3bbd6 100644 --- a/tools/h5diff/testfiles/h5diff_606.txt +++ b/tools/h5diff/testfiles/h5diff_606.txt @@ -63,6 +63,30 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] comparing floating point values. By default, strict equality is used. Use -p or -d to set specific tolerance. + --exclude-path "path" Exclude the specified path to an object when + comparing files or groups. If a group is excluded, + all member objects will also be excluded. + The specified path is excluded wherever it occurs. + This flexibility enables the same option to exclude + either objects that exist only in one file or + common objects that are known to differ. + + When comparing files, "path" is the absolute path to + the excluded object; when comparing groups, "path" is + similar to the relative path from the group to the + excluded object. This "path" can be taken from the + first section of the output of the --verbose option. + For example, if you are comparing the group /groupA + in two files and you want to exclude + /groupA/groupB/groupC in both files, the exclude + option would read as follows: + --exclude-path "/groupB/groupC" + + If there are multiple paths to an object, only the + specified path(s) will be excluded; the comparison + will include any path not explicitly excluded. + This option can be used repeatedly to exclude + multiple paths. Modes of output: Default mode: print the number of differences found and where they occured diff --git a/tools/h5diff/testfiles/h5diff_612.txt b/tools/h5diff/testfiles/h5diff_612.txt index 6141495..e348caa 100644 --- a/tools/h5diff/testfiles/h5diff_612.txt +++ b/tools/h5diff/testfiles/h5diff_612.txt @@ -63,6 +63,30 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] comparing floating point values. By default, strict equality is used. Use -p or -d to set specific tolerance. + --exclude-path "path" Exclude the specified path to an object when + comparing files or groups. If a group is excluded, + all member objects will also be excluded. + The specified path is excluded wherever it occurs. + This flexibility enables the same option to exclude + either objects that exist only in one file or + common objects that are known to differ. + + When comparing files, "path" is the absolute path to + the excluded object; when comparing groups, "path" is + similar to the relative path from the group to the + excluded object. This "path" can be taken from the + first section of the output of the --verbose option. + For example, if you are comparing the group /groupA + in two files and you want to exclude + /groupA/groupB/groupC in both files, the exclude + option would read as follows: + --exclude-path "/groupB/groupC" + + If there are multiple paths to an object, only the + specified path(s) will be excluded; the comparison + will include any path not explicitly excluded. + This option can be used repeatedly to exclude + multiple paths. Modes of output: Default mode: print the number of differences found and where they occured diff --git a/tools/h5diff/testfiles/h5diff_615.txt b/tools/h5diff/testfiles/h5diff_615.txt index eaa2078..1bb0eb5 100644 --- a/tools/h5diff/testfiles/h5diff_615.txt +++ b/tools/h5diff/testfiles/h5diff_615.txt @@ -63,6 +63,30 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] comparing floating point values. By default, strict equality is used. Use -p or -d to set specific tolerance. + --exclude-path "path" Exclude the specified path to an object when + comparing files or groups. If a group is excluded, + all member objects will also be excluded. + The specified path is excluded wherever it occurs. + This flexibility enables the same option to exclude + either objects that exist only in one file or + common objects that are known to differ. + + When comparing files, "path" is the absolute path to + the excluded object; when comparing groups, "path" is + similar to the relative path from the group to the + excluded object. This "path" can be taken from the + first section of the output of the --verbose option. + For example, if you are comparing the group /groupA + in two files and you want to exclude + /groupA/groupB/groupC in both files, the exclude + option would read as follows: + --exclude-path "/groupB/groupC" + + If there are multiple paths to an object, only the + specified path(s) will be excluded; the comparison + will include any path not explicitly excluded. + This option can be used repeatedly to exclude + multiple paths. Modes of output: Default mode: print the number of differences found and where they occured diff --git a/tools/h5diff/testfiles/h5diff_621.txt b/tools/h5diff/testfiles/h5diff_621.txt index 8319db9..172cade 100644 --- a/tools/h5diff/testfiles/h5diff_621.txt +++ b/tools/h5diff/testfiles/h5diff_621.txt @@ -63,6 +63,30 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] comparing floating point values. By default, strict equality is used. Use -p or -d to set specific tolerance. + --exclude-path "path" Exclude the specified path to an object when + comparing files or groups. If a group is excluded, + all member objects will also be excluded. + The specified path is excluded wherever it occurs. + This flexibility enables the same option to exclude + either objects that exist only in one file or + common objects that are known to differ. + + When comparing files, "path" is the absolute path to + the excluded object; when comparing groups, "path" is + similar to the relative path from the group to the + excluded object. This "path" can be taken from the + first section of the output of the --verbose option. + For example, if you are comparing the group /groupA + in two files and you want to exclude + /groupA/groupB/groupC in both files, the exclude + option would read as follows: + --exclude-path "/groupB/groupC" + + If there are multiple paths to an object, only the + specified path(s) will be excluded; the comparison + will include any path not explicitly excluded. + This option can be used repeatedly to exclude + multiple paths. Modes of output: Default mode: print the number of differences found and where they occured diff --git a/tools/h5diff/testfiles/h5diff_622.txt b/tools/h5diff/testfiles/h5diff_622.txt index 1ccff92..beb04c5 100644 --- a/tools/h5diff/testfiles/h5diff_622.txt +++ b/tools/h5diff/testfiles/h5diff_622.txt @@ -63,6 +63,30 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] comparing floating point values. By default, strict equality is used. Use -p or -d to set specific tolerance. + --exclude-path "path" Exclude the specified path to an object when + comparing files or groups. If a group is excluded, + all member objects will also be excluded. + The specified path is excluded wherever it occurs. + This flexibility enables the same option to exclude + either objects that exist only in one file or + common objects that are known to differ. + + When comparing files, "path" is the absolute path to + the excluded object; when comparing groups, "path" is + similar to the relative path from the group to the + excluded object. This "path" can be taken from the + first section of the output of the --verbose option. + For example, if you are comparing the group /groupA + in two files and you want to exclude + /groupA/groupB/groupC in both files, the exclude + option would read as follows: + --exclude-path "/groupB/groupC" + + If there are multiple paths to an object, only the + specified path(s) will be excluded; the comparison + will include any path not explicitly excluded. + This option can be used repeatedly to exclude + multiple paths. Modes of output: Default mode: print the number of differences found and where they occured diff --git a/tools/h5diff/testfiles/h5diff_623.txt b/tools/h5diff/testfiles/h5diff_623.txt index 2c15d98..56c0b4c 100644 --- a/tools/h5diff/testfiles/h5diff_623.txt +++ b/tools/h5diff/testfiles/h5diff_623.txt @@ -63,6 +63,30 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] comparing floating point values. By default, strict equality is used. Use -p or -d to set specific tolerance. + --exclude-path "path" Exclude the specified path to an object when + comparing files or groups. If a group is excluded, + all member objects will also be excluded. + The specified path is excluded wherever it occurs. + This flexibility enables the same option to exclude + either objects that exist only in one file or + common objects that are known to differ. + + When comparing files, "path" is the absolute path to + the excluded object; when comparing groups, "path" is + similar to the relative path from the group to the + excluded object. This "path" can be taken from the + first section of the output of the --verbose option. + For example, if you are comparing the group /groupA + in two files and you want to exclude + /groupA/groupB/groupC in both files, the exclude + option would read as follows: + --exclude-path "/groupB/groupC" + + If there are multiple paths to an object, only the + specified path(s) will be excluded; the comparison + will include any path not explicitly excluded. + This option can be used repeatedly to exclude + multiple paths. Modes of output: Default mode: print the number of differences found and where they occured diff --git a/tools/h5diff/testfiles/h5diff_624.txt b/tools/h5diff/testfiles/h5diff_624.txt index 272b9fc..c0a95ed 100644 --- a/tools/h5diff/testfiles/h5diff_624.txt +++ b/tools/h5diff/testfiles/h5diff_624.txt @@ -63,6 +63,30 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] comparing floating point values. By default, strict equality is used. Use -p or -d to set specific tolerance. + --exclude-path "path" Exclude the specified path to an object when + comparing files or groups. If a group is excluded, + all member objects will also be excluded. + The specified path is excluded wherever it occurs. + This flexibility enables the same option to exclude + either objects that exist only in one file or + common objects that are known to differ. + + When comparing files, "path" is the absolute path to + the excluded object; when comparing groups, "path" is + similar to the relative path from the group to the + excluded object. This "path" can be taken from the + first section of the output of the --verbose option. + For example, if you are comparing the group /groupA + in two files and you want to exclude + /groupA/groupB/groupC in both files, the exclude + option would read as follows: + --exclude-path "/groupB/groupC" + + If there are multiple paths to an object, only the + specified path(s) will be excluded; the comparison + will include any path not explicitly excluded. + This option can be used repeatedly to exclude + multiple paths. Modes of output: Default mode: print the number of differences found and where they occured diff --git a/tools/h5diff/testh5diff.sh b/tools/h5diff/testh5diff.sh index df793f0..0696340 100755 --- a/tools/h5diff/testh5diff.sh +++ b/tools/h5diff/testh5diff.sh @@ -56,10 +56,10 @@ FILE19=h5diff_dset_idx1.h5 FILE20=h5diff_dset_idx2.h5 DANGLE_LINK_FILE1=h5diff_danglelinks1.h5 DANGLE_LINK_FILE2=h5diff_danglelinks2.h5 -/* group recursive */ +# group recursive GRP_RECURSE_FILE1=h5diff_grp_recurse1.h5 GRP_RECURSE_FILE2=h5diff_grp_recurse2.h5 -/* group recursive - same structure via external links through files */ +# group recursive - same structure via external links through files GRP_RECURSE1_EXT=h5diff_grp_recurse_ext1.h5 GRP_RECURSE2_EXT1=h5diff_grp_recurse_ext2-1.h5 GRP_RECURSE2_EXT2=h5diff_grp_recurse_ext2-2.h5 @@ -778,6 +778,8 @@ TOOLTEST h5diff_482.txt -v --exclude-path "/group1" --exclude-path "/dset1" $EXC # Exclude only some different objects. Expect return - diff TOOLTEST h5diff_483.txt -v --exclude-path "/group1" $EXCLUDE_FILE2_1 $EXCLUDE_FILE2_2 +# Exclude from group compare +TOOLTEST h5diff_484.txt -v --exclude-path "/dset3" h5diff_exclude1-1.h5 h5diff_exclude1-2.h5 /group1 # ############################################################################## diff --git a/tools/h5dump/CMakeLists.txt b/tools/h5dump/CMakeLists.txt index e64bc48..5458b9d 100644 --- a/tools/h5dump/CMakeLists.txt +++ b/tools/h5dump/CMakeLists.txt @@ -372,17 +372,17 @@ IF (BUILD_TESTING) ARGS -E copy_if_different ${HDF5_TOOLS_SOURCE_DIR}/testfiles/tbin1.ddl ${PROJECT_BINARY_DIR}/tbin1LE.ddl ) - IF (WIN32 AND NOT MINGW) + IF (WIN32 AND NOT CYGWIN) FILE (READ ${HDF5_TOOLS_SRC_DIR}/testfiles/tbinregR.exp TEST_STREAM) FILE (WRITE ${PROJECT_BINARY_DIR}/tbinregR.exp "${TEST_STREAM}") - ELSE (WIN32 AND NOT MINGW) + ELSE (WIN32 AND NOT CYGWIN) ADD_CUSTOM_COMMAND ( TARGET h5dump POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${HDF5_TOOLS_SRC_DIR}/testfiles/tbinregR.exp ${PROJECT_BINARY_DIR}/tbinregR.exp ) - ENDIF (WIN32 AND NOT MINGW) + ENDIF (WIN32 AND NOT CYGWIN) ############################################################################## ############################################################################## @@ -473,6 +473,225 @@ IF (BUILD_TESTING) ############################################################################## ############################################################################## + # Remove any output file left over from previous test run + ADD_TEST ( + NAME H5DUMP-clearall-objects + COMMAND ${CMAKE_COMMAND} + -E remove + tall-1.out + tall-1.out.err + tall-2.out + tall-2.out.err + tall-2A.out + tall-2A.out.err + tall-2B.out + tall-2B.out.err + tall-3.out + tall-3.out.err + tall-4s.out + tall-4s.out.err + tall-5s.out + tall-5s.out.err + tallfilters.out + tallfilters.out.err + tarray1.out + tarray1.out.err + tarray2.out + tarray2.out.err + tarray3.out + tarray3.out.err + tarray4.out + tarray4.out.err + tarray5.out + tarray5.out.err + tarray6.out + tarray6.out.err + tarray7.out + tarray7.out.err + tarray8.out + tarray8.out.err + tattr-1.out + tattr-1.out.err + tattr-2.out + tattr-2.out.err + tattr-3.out + tattr-3.out.err + tattrreg.out + tattrreg.out.err + tattrregR.out + tattrregR.out.err + tbinregR.out + tbinregR.out.err + tbigdims.out + tbigdims.out.err + tboot1.out + tboot1.out.err + tboot2.out + tboot2.out.err + tchar1.out + tchar1.out.err + tchunked.out + tchunked.out.err + tcomp-1.out + tcomp-1.out.err + tcomp-2.out + tcomp-2.out.err + tcomp-3.out + tcomp-3.out.err + tcomp-4.out + tcomp-4.out.err + tcompact.out + tcompact.out.err + tcontents.out + tcontents.out.err + tcontiguos.out + tcontiguos.out.err + tdatareg.out + tdatareg.out.err + tdataregR.out + tdataregR.out.err + tdeflate.out + tdeflate.out.err + tdset-1.out + tdset-1.out.err + tdset-2.out + tdset-2.out.err + tdset-3s.out + tdset-3s.out.err + tempty.out + tempty.out.err + texternal.out + texternal.out.err + textlinksrc.out + textlinksrc.out.err + textlinkfar.out + textlinkfar.out.err + tfamily.out + tfamily.out.err + tfill.out + tfill.out.err + tfletcher32.out + tfletcher32.out.err + tfpformat.out + tfpformat.out.err + tgroup-1.out + tgroup-1.out.err + tgroup-2.out + tgroup-2.out.err + tgrp_comments.out + tgrp_comments.out.err + thlink-1.out + thlink-1.out.err + thlink-2.out + thlink-2.out.err + thlink-3.out + thlink-3.out.err + thlink-4.out + thlink-4.out.err + thlink-5.out + thlink-5.out.err + thyperslab.out + thyperslab.out.err + tindicesno.out + tindicesno.out.err + tindicessub1.out + tindicessub1.out.err + tindicessub2.out + tindicessub2.out.err + tindicessub3.out + tindicessub3.out.err + tindicessub4.out + tindicessub4.out.err + tindicesyes.out + tindicesyes.out.err + tlarge_objname.out + tlarge_objname.out.err + tldouble.out + tldouble.out.err + tlonglinks.out + tlonglinks.out.err + tloop-1.out + tloop-1.out.err + tmulti.out + tmulti.out.err + tnamed_dtype_attr.out + tnamed_dtype_attr.out.err + tnestcomp-1.out + tnestcomp-1.out.err + tnbit.out + tnbit.out.err + tnofilename.out + tnofilename.out.err + tnullspace.out + tnullspace.out.err + tordergr1.out + tordergr1.out.err + tordergr2.out + tordergr2.out.err + tordergr3.out + tordergr3.out.err + tordergr4.out + tordergr4.out.err + tordergr5.out + tordergr5.out.err + torderattr1.out + torderattr1.out.err + torderattr2.out + torderattr2.out.err + torderattr3.out + torderattr3.out.err + torderattr4.out + torderattr4.out.err + tperror.out + tperror.out.err + treference.out + treference.out.err + tsaf.out + tsaf.out.err + tscaleoffset.out + tscaleoffset.out.err + tshuffle.out + tshuffle.out.err + tslink-1.out + tslink-1.out.err + tslink-2.out + tslink-2.out.err + tsplit_file.out + tsplit_file.out.err + tstr-1.out + tstr-1.out.err + tstr-2.out + tstr-2.out.err + tstring.out + tstring.out.err + tstring2.out + tstring2.out.err + tstringe.out + tstringe.out.err + tszip.out + tszip.out.err + tudlink-1.out + tudlink-1.out.err + tudlink-2.out + tudlink-2.out.err + tuserfilter.out + tuserfilter.out.err + tvldtypes1.out + tvldtypes1.out.err + tvldtypes2.out + tvldtypes2.out.err + tvldtypes3.out + tvldtypes3.out.err + tvldtypes4.out + tvldtypes4.out.err + tvldtypes5.out + tvldtypes5.out.err + tvlstr.out + tvlstr.out.err + tvms.out + tvms.out.err + ) + # test for displaying groups ADD_H5_TEST (tgroup-1 0 tgroup.h5) # test for displaying the selected groups @@ -583,11 +802,7 @@ IF (BUILD_TESTING) # test failure handling # Missing file name - IF (${USE_PACKED_BITS}) - ADD_H5_TEST (tnofilename-with-packed-bits 1) - ELSE (${USE_PACKED_BITS}) - ADD_H5_TEST (tnofilename 1) - ENDIF (${USE_PACKED_BITS}) + ADD_H5_TEST (tnofilename 1) # rev. 2004 @@ -774,13 +989,156 @@ IF (BUILD_TESTING) ADD_H5_TEST (textlinksrc 0 textlinksrc.h5) ADD_H5_TEST (textlinkfar 0 textlinkfar.h5) - # test for dataset packed bits - SET (TESTTYPE "TEST") - IF (NOT ${USE_PACKED_BITS}) - SET (TESTTYPE "SKIP") - ENDIF (NOT ${USE_PACKED_BITS}) - ADD_SKIP_H5_TEST (tpackedbits 0 ${TESTTYPE} -d /dset1 -M 0,2 tdset.h5) - ADD_SKIP_H5_TEST (tpackedbits2 0 ${TESTTYPE} -d /dset1 -M 0,2,2,1 tdset.h5) + ####### test for dataset packed bits ###### + IF (HDF5_USE_H5DUMP_PACKED_BITS) + # Remove any output file left over from previous test run + ADD_TEST ( + NAME H5DUMP_PACKED_BITS-clearall-objects + COMMAND ${CMAKE_COMMAND} + -E remove + tpackedbits.out + tpackedbits.out.err + tpackedbits2.out + tpackedbits2.out.err + ) + ADD_H5_TEST (tpackedbits 0 -d /dset1 -M 0,2 tdset.h5) + ADD_H5_TEST (tpackedbits2 0 -d /dset1 -M 0,2,2,1 tdset.h5) + ENDIF (HDF5_USE_H5DUMP_PACKED_BITS) + + # Remove any output file left over from previous test run + ADD_TEST ( + NAME H5DUMP-XML-clearall-objects + COMMAND ${CMAKE_COMMAND} + -E remove + tall.h5.out + tall.h5.out.err + tall-2A.h5.out + tall-2A.h5.out.err + tarray1.h5.out + tarray1.h5.out.err + tarray2.h5.out + tarray2.h5.out.err + tarray3.h5.out + tarray3.h5.out.err + tarray6.h5.out + tarray6.h5.out.err + tarray7.h5.out + tarray7.h5.out.err + tattr.h5.out + tattr.h5.out.err + tbitfields.h5.out + tbitfields.h5.out.err + tcompound.h5.out + tcompound.h5.out.err + tcompound2.h5.out + tcompound2.h5.out.err + tcompound_complex.h5.out + tcompound_complex.h5.out.err + tdatareg.h5.out + tdatareg.h5.out.err + tdset.h5.out + tdset.h5.out.err + tdset2.h5.out + tdset2.h5.out.err + tempty-dtd-2.h5.out + tempty-dtd-2.h5.out.err + tempty-dtd-uri.h5.out + tempty-dtd-uri.h5.out.err + tempty-dtd.h5.out + tempty-dtd.h5.out.err + tempty-nons-2.h5.out + tempty-nons-2.h5.out.err + tempty-nons-uri.h5.out + tempty-nons-uri.h5.out.err + tempty-nons.h5.out + tempty-nons.h5.out.err + tempty-ns-2.h5.out + tempty-ns-2.h5.out.err + tempty-ns.h5.out + tempty-ns.h5.out.err + tempty.h5.out + tempty.h5.out.err + tenum.h5.out + tenum.h5.out.err + textlink.h5.out + textlink.h5.out.err + tfpformat.h5.out + tfpformat.h5.out.err + tgroup.h5.out + tgroup.h5.out.err + thlink.h5.out + thlink.h5.out.err + tloop.h5.out + tloop.h5.out.err + tloop2.h5.out + tloop2.h5.out.err + tmany.h5.out + tmany.h5.out.err + tname-amp.h5.out + tname-amp.h5.out.err + tname-apos.h5.out + tname-apos.h5.out.err + tname-gt.h5.out + tname-gt.h5.out.err + tname-lt.h5.out + tname-lt.h5.out.err + tname-quot.h5.out + tname-quot.h5.out.err + tname-sp.h5.out + tname-sp.h5.out.err + tnamed_dtype_attr.h5.out + tnamed_dtype_attr.h5.out.err + tnestedcomp.h5.out + tnestedcomp.h5.out.err + tnodata.h5.out + tnodata.h5.out.err + tnoname.h5.out + tnoname.h5.out.err + tobjref.h5.out + tobjref.h5.out.err + topaque.h5.out + topaque.h5.out.err + torderattr1.h5.out + torderattr1.h5.out.err + torderattr2.h5.out + torderattr2.h5.out.err + torderattr3.h5.out + torderattr3.h5.out.err + torderattr4.h5.out + torderattr4.h5.out.err + tref-escapes-at.h5.out + tref-escapes-at.h5.out.err + tref-escapes.h5.out + tref-escapes.h5.out.err + tref.h5.out + tref.h5.out.err + tsaf.h5.out + tsaf.h5.out.err + tslink.h5.out + tslink.h5.out.err + tstr.h5.out + tstr.h5.out.err + tstr2.h5.out + tstr2.h5.out.err + tstring.h5.out + tstring.h5.out.err + tstring-at.h5.out + tstring-at.h5.out.err + tudlink.h5.out + tudlink.h5.out.err + tvldtypes1.h5.out + tvldtypes1.h5.out.err + tvldtypes2.h5.out + tvldtypes2.h5.out.err + tvldtypes3.h5.out + tvldtypes3.h5.out.err + tvldtypes4.h5.out + tvldtypes4.h5.out.err + tvldtypes5.h5.out + tvldtypes5.h5.out.err + tvlstr.h5.out + tvlstr.h5.out.err + ) ########## test XML ADD_XML_H5_TEST (tall.h5 0 tall.h5) @@ -885,7 +1243,7 @@ INSTALL ( TARGETS h5dump RUNTIME DESTINATION - bin/tools + ${HDF5_INSTALL_BIN_DIR}/tools COMPONENT toolsapplications ) diff --git a/tools/h5dump/Makefile.in b/tools/h5dump/Makefile.in index 3e76f2d..338e08c 100644 --- a/tools/h5dump/Makefile.in +++ b/tools/h5dump/Makefile.in @@ -346,14 +346,24 @@ LIBH5_HL = $(top_builddir)/hl/src/libhdf5_hl.la LIBH5F_HL = $(top_builddir)/hl/fortran/src/libhdf5hl_fortran.la LIBH5CPP_HL = $(top_builddir)/hl/c++/src/libhdf5_hl_cpp.la +# Note that in svn revision 19400 the '/' after DESTDIR in H5* variables below +# has been removed. According to the official description of DESTDIR by Gnu at +# http://www.gnu.org/prep/standards/html_node/DESTDIR.html, DESTDIR is +# prepended to the normal and complete install path that it precedes for the +# purpose of installing in a temporary directory which is useful for building +# rpms and other packages. The '/' after ${DESTDIR} will be followed by another +# '/' at the beginning of the normal install path. When DESTDIR is empty the +# path then begins with '//', which is incorrect and causes problems at least for +# Cygwin. + # Scripts used to build examples # If only shared libraries have been installed, have h5cc build examples with # shared libraries instead of static libraries -H5CC = $(bindir)/h5cc -H5CC_PP = $(bindir)/h5pcc -H5FC = $(bindir)/h5fc -H5FC_PP = $(bindir)/h5pfc -H5CPP = $(bindir)/h5c++ +H5CC = ${DESTDIR}$(bindir)/h5cc +H5CC_PP = ${DESTDIR}$(bindir)/h5pcc +H5FC = ${DESTDIR}$(bindir)/h5fc +H5FC_PP = ${DESTDIR}$(bindir)/h5pfc +H5CPP = ${DESTDIR}$(bindir)/h5c++ ACLOCAL_AMFLAGS = "-I m4" # The trace script; this is used on source files from the C library to diff --git a/tools/h5import/CMakeLists.txt b/tools/h5import/CMakeLists.txt index 7d937bd..e2015dc 100644 --- a/tools/h5import/CMakeLists.txt +++ b/tools/h5import/CMakeLists.txt @@ -44,6 +44,22 @@ IF (BUILD_TESTING) ############################################################################## ############################################################################## + # Remove any output file left over from previous test run + ADD_TEST ( + NAME H5IMPORT-clear-objects + COMMAND ${CMAKE_COMMAND} + -E remove + binfp64.bin + binin8.bin + binin8w.bin + binin16.bin + binin32.bin + binuin16.bin + binuin32.bin + txtin16.txt + txtin32.txt + ) + ADD_TEST (NAME h5importtest COMMAND $) ENDIF (BUILD_TESTING) @@ -60,7 +76,7 @@ INSTALL ( TARGETS h5import RUNTIME DESTINATION - bin/tools + ${HDF5_INSTALL_BIN_DIR}/tools COMPONENT toolsapplications ) diff --git a/tools/h5import/Makefile.in b/tools/h5import/Makefile.in index fb40139..7c81903 100755 --- a/tools/h5import/Makefile.in +++ b/tools/h5import/Makefile.in @@ -341,14 +341,24 @@ LIBH5_HL = $(top_builddir)/hl/src/libhdf5_hl.la LIBH5F_HL = $(top_builddir)/hl/fortran/src/libhdf5hl_fortran.la LIBH5CPP_HL = $(top_builddir)/hl/c++/src/libhdf5_hl_cpp.la +# Note that in svn revision 19400 the '/' after DESTDIR in H5* variables below +# has been removed. According to the official description of DESTDIR by Gnu at +# http://www.gnu.org/prep/standards/html_node/DESTDIR.html, DESTDIR is +# prepended to the normal and complete install path that it precedes for the +# purpose of installing in a temporary directory which is useful for building +# rpms and other packages. The '/' after ${DESTDIR} will be followed by another +# '/' at the beginning of the normal install path. When DESTDIR is empty the +# path then begins with '//', which is incorrect and causes problems at least for +# Cygwin. + # Scripts used to build examples # If only shared libraries have been installed, have h5cc build examples with # shared libraries instead of static libraries -H5CC = $(bindir)/h5cc -H5CC_PP = $(bindir)/h5pcc -H5FC = $(bindir)/h5fc -H5FC_PP = $(bindir)/h5pfc -H5CPP = $(bindir)/h5c++ +H5CC = ${DESTDIR}$(bindir)/h5cc +H5CC_PP = ${DESTDIR}$(bindir)/h5pcc +H5FC = ${DESTDIR}$(bindir)/h5fc +H5FC_PP = ${DESTDIR}$(bindir)/h5pfc +H5CPP = ${DESTDIR}$(bindir)/h5c++ ACLOCAL_AMFLAGS = "-I m4" # The trace script; this is used on source files from the C library to diff --git a/tools/h5jam/CMakeLists.txt b/tools/h5jam/CMakeLists.txt index 94f2e4b..69b3e75 100644 --- a/tools/h5jam/CMakeLists.txt +++ b/tools/h5jam/CMakeLists.txt @@ -83,7 +83,7 @@ INSTALL ( TARGETS h5jam h5unjam RUNTIME DESTINATION - bin/tools + ${HDF5_INSTALL_BIN_DIR}/tools COMPONENT toolsapplications ) diff --git a/tools/h5jam/Makefile.in b/tools/h5jam/Makefile.in index 2850a08..aac8ece 100644 --- a/tools/h5jam/Makefile.in +++ b/tools/h5jam/Makefile.in @@ -355,14 +355,24 @@ LIBH5_HL = $(top_builddir)/hl/src/libhdf5_hl.la LIBH5F_HL = $(top_builddir)/hl/fortran/src/libhdf5hl_fortran.la LIBH5CPP_HL = $(top_builddir)/hl/c++/src/libhdf5_hl_cpp.la +# Note that in svn revision 19400 the '/' after DESTDIR in H5* variables below +# has been removed. According to the official description of DESTDIR by Gnu at +# http://www.gnu.org/prep/standards/html_node/DESTDIR.html, DESTDIR is +# prepended to the normal and complete install path that it precedes for the +# purpose of installing in a temporary directory which is useful for building +# rpms and other packages. The '/' after ${DESTDIR} will be followed by another +# '/' at the beginning of the normal install path. When DESTDIR is empty the +# path then begins with '//', which is incorrect and causes problems at least for +# Cygwin. + # Scripts used to build examples # If only shared libraries have been installed, have h5cc build examples with # shared libraries instead of static libraries -H5CC = $(bindir)/h5cc -H5CC_PP = $(bindir)/h5pcc -H5FC = $(bindir)/h5fc -H5FC_PP = $(bindir)/h5pfc -H5CPP = $(bindir)/h5c++ +H5CC = ${DESTDIR}$(bindir)/h5cc +H5CC_PP = ${DESTDIR}$(bindir)/h5pcc +H5FC = ${DESTDIR}$(bindir)/h5fc +H5FC_PP = ${DESTDIR}$(bindir)/h5pfc +H5CPP = ${DESTDIR}$(bindir)/h5c++ ACLOCAL_AMFLAGS = "-I m4" # The trace script; this is used on source files from the C library to diff --git a/tools/h5ls/CMakeLists.txt b/tools/h5ls/CMakeLists.txt index ddb0bfe..c81f42b 100644 --- a/tools/h5ls/CMakeLists.txt +++ b/tools/h5ls/CMakeLists.txt @@ -151,6 +151,111 @@ IF (BUILD_TESTING) ############################################################################## ############################################################################## + # Remove any output file left over from previous test run + ADD_TEST ( + NAME H5LS-clearall-objects + COMMAND ${CMAKE_COMMAND} + -E remove + help-1.out + help-1.out.err + help-2.out + help-2.out.err + help-3.out + help-3.out.err + nosuchfile.out + nosuchfile.out.err + tall-1.out + tall-1.out.err + tall-2.out + tall-2.out.err + tarray1.out + tarray1.out.err + tattr2.out + tattr2.out.err + tcomp-1.out + tcomp-1.out.err + tdataregbe.out + tdataregbe.out.err + tdataregle.out + tdataregle.out.err + tdset-1.out + tdset-1.out.err + tempty.out + tempty.out.err + textlink-1.out + textlink-1.out.err + textlinksrc-1.out + textlinksrc-1.out.err + textlinksrc-2.out + textlinksrc-2.out.err + textlinksrc-3.out + textlinksrc-3.out.err + textlinksrc-4.out + textlinksrc-4.out.err + textlinksrc-5.out + textlinksrc-5.out.err + textlinksrc-6.out + textlinksrc-6.out.err + textlinksrc-7.out + textlinksrc-7.out.err + textlinksrc-1-old.out + textlinksrc-1-old.out.err + textlinksrc-2-old.out + textlinksrc-2-old.out.err + textlinksrc-3-old.out + textlinksrc-3-old.out.err + textlinksrc-6-old.out + textlinksrc-6-old.out.err + textlinksrc-7-old.out + textlinksrc-7-old.out.err + tsoftlinks-1.out + tsoftlinks-1.out.err + tsoftlinks-2.out + tsoftlinks-2.out.err + tsoftlinks-3.out + tsoftlinks-3.out.err + tsoftlinks-4.out + tsoftlinks-4.out.err + tsoftlinks-5.out + tsoftlinks-5.out.err + textlinksrc-nodangle-1.out + textlinksrc-nodangle-1.out.err + textlinksrc-nodangle-2.out + textlinksrc-nodangle-2.out.err + tsoftlinks-nodangle-1.out + tsoftlinks-nodangle-1.out.err + thlinks-nodangle-1.out + thlinks-nodangle-1.out.err + tgroup.out + tgroup.out.err + tgroup-1.out + tgroup-1.out.err + tgroup-2.out + tgroup-2.out.err + tgroup-3.out + tgroup-3.out.err + thlink-1.out + thlink-1.out.err + tloop-1.out + tloop-1.out.err + tnestcomp-1.out + tnestcomp-1.out.err + tsaf.out + tsaf.out.err + tslink-1.out + tslink-1.out.err + tstr-1.out + tstr-1.out.err + tudlink-1.out + tudlink-1.out.err + tvldtypes1.out + tvldtypes1.out.err + tvldtypes2le.out + tvldtypes2le.out.err + tvldtypes2be.out + tvldtypes2be.out.err + ) + # test the help syntax ADD_H5_TEST (help-1 0 -w80 -h) ADD_H5_TEST (help-2 0 -w80 --help) @@ -270,7 +375,7 @@ INSTALL ( TARGETS h5ls RUNTIME DESTINATION - bin/tools + ${HDF5_INSTALL_BIN_DIR}/tools COMPONENT toolsapplications ) diff --git a/tools/h5ls/Makefile.in b/tools/h5ls/Makefile.in index 93f8e97..6c3a01a 100644 --- a/tools/h5ls/Makefile.in +++ b/tools/h5ls/Makefile.in @@ -335,14 +335,24 @@ LIBH5_HL = $(top_builddir)/hl/src/libhdf5_hl.la LIBH5F_HL = $(top_builddir)/hl/fortran/src/libhdf5hl_fortran.la LIBH5CPP_HL = $(top_builddir)/hl/c++/src/libhdf5_hl_cpp.la +# Note that in svn revision 19400 the '/' after DESTDIR in H5* variables below +# has been removed. According to the official description of DESTDIR by Gnu at +# http://www.gnu.org/prep/standards/html_node/DESTDIR.html, DESTDIR is +# prepended to the normal and complete install path that it precedes for the +# purpose of installing in a temporary directory which is useful for building +# rpms and other packages. The '/' after ${DESTDIR} will be followed by another +# '/' at the beginning of the normal install path. When DESTDIR is empty the +# path then begins with '//', which is incorrect and causes problems at least for +# Cygwin. + # Scripts used to build examples # If only shared libraries have been installed, have h5cc build examples with # shared libraries instead of static libraries -H5CC = $(bindir)/h5cc -H5CC_PP = $(bindir)/h5pcc -H5FC = $(bindir)/h5fc -H5FC_PP = $(bindir)/h5pfc -H5CPP = $(bindir)/h5c++ +H5CC = ${DESTDIR}$(bindir)/h5cc +H5CC_PP = ${DESTDIR}$(bindir)/h5pcc +H5FC = ${DESTDIR}$(bindir)/h5fc +H5FC_PP = ${DESTDIR}$(bindir)/h5pfc +H5CPP = ${DESTDIR}$(bindir)/h5c++ ACLOCAL_AMFLAGS = "-I m4" # The trace script; this is used on source files from the C library to diff --git a/tools/h5repack/CMakeLists.txt b/tools/h5repack/CMakeLists.txt index be2844d..1fbc503 100644 --- a/tools/h5repack/CMakeLists.txt +++ b/tools/h5repack/CMakeLists.txt @@ -225,6 +225,72 @@ IF (BUILD_TESTING) ############################################################################## ############################################################################## + # Remove any output file left over from previous test run + ADD_TEST ( + NAME H5REPACK-clearall-objects + COMMAND ${CMAKE_COMMAND} + -E remove + h5repack_attr.h5.out + h5repack_attr.h5.out.err + h5repack_deflate.h5.out + h5repack_deflate.h5.out.err + h5repack_early.h5.out + h5repack_early.h5.out.err + h5repack_ext.h5.out + h5repack_ext.h5.out.err + h5repack_fill.h5.out + h5repack_fill.h5.out.err + h5repack_filters.h5.out + h5repack_filters.h5.out.err + h5repack_fletcher.h5.out + h5repack_fletcher.h5.out.err + h5repack_hlink.h5.out + h5repack_hlink.h5.out.err + h5repack_layout.h5.out + h5repack_layout.h5.out.err + h5repack_layout.h5-v.out + h5repack_layout.h5-v.out.err + h5repack_layouto.h5.out + h5repack_layouto.h5.out.err + h5repack_layout2.h5-v.out + h5repack_layout2.h5-v.out.err + h5repack_named_dtypes.h5.out + h5repack_named_dtypes.h5.out.err + h5repack_nbit.h5.out + h5repack_nbit.h5.out.err + h5repack_objs.h5.out + h5repack_objs.h5.out.err + h5repack_refs.h5.out + h5repack_refs.h5.out.err + h5repack_shuffle.h5.out + h5repack_shuffle.h5.out.err + h5repack_soffset.h5.out + h5repack_soffset.h5.out.err + h5repack_szip.h5.out + h5repack_szip.h5.out.err + h5repack_attr_out.h5 + h5repack_deflate_out.h5 + h5repack_early_out.h5 + h5repack_ext_out.h5 + h5repack_fill_out.h5 + h5repack_filters_out.h5 + h5repack_fletcher_out.h5 + h5repack_hlink_out.h5 + h5repack_layout_out.h5 + h5repack_layouto_out.h5 + h5repack_layout2_out.h5 + h5repack_named_dtypes_out.h5 + h5repack_nbit_out.h5 + h5repack_objs_out.h5 + h5repack_refs_out.h5 + h5repack_shuffle_out.h5 + h5repack_soffset_out.h5 + h5repack_szip_out.h5 + h5repack_ub.h5 + h5repack_ub_out.h5 + h5repack_attr_refs_out.h5 + ) + # -------------------------------------------------------------------- # test file names # -------------------------------------------------------------------- @@ -672,7 +738,7 @@ INSTALL ( TARGETS h5repack RUNTIME DESTINATION - bin/tools + ${HDF5_INSTALL_BIN_DIR}/tools COMPONENT toolsapplications ) diff --git a/tools/h5repack/Makefile.in b/tools/h5repack/Makefile.in index 23f5844..b4e6b48 100644 --- a/tools/h5repack/Makefile.in +++ b/tools/h5repack/Makefile.in @@ -355,14 +355,24 @@ LIBH5_HL = $(top_builddir)/hl/src/libhdf5_hl.la LIBH5F_HL = $(top_builddir)/hl/fortran/src/libhdf5hl_fortran.la LIBH5CPP_HL = $(top_builddir)/hl/c++/src/libhdf5_hl_cpp.la +# Note that in svn revision 19400 the '/' after DESTDIR in H5* variables below +# has been removed. According to the official description of DESTDIR by Gnu at +# http://www.gnu.org/prep/standards/html_node/DESTDIR.html, DESTDIR is +# prepended to the normal and complete install path that it precedes for the +# purpose of installing in a temporary directory which is useful for building +# rpms and other packages. The '/' after ${DESTDIR} will be followed by another +# '/' at the beginning of the normal install path. When DESTDIR is empty the +# path then begins with '//', which is incorrect and causes problems at least for +# Cygwin. + # Scripts used to build examples # If only shared libraries have been installed, have h5cc build examples with # shared libraries instead of static libraries -H5CC = $(bindir)/h5cc -H5CC_PP = $(bindir)/h5pcc -H5FC = $(bindir)/h5fc -H5FC_PP = $(bindir)/h5pfc -H5CPP = $(bindir)/h5c++ +H5CC = ${DESTDIR}$(bindir)/h5cc +H5CC_PP = ${DESTDIR}$(bindir)/h5pcc +H5FC = ${DESTDIR}$(bindir)/h5fc +H5FC_PP = ${DESTDIR}$(bindir)/h5pfc +H5CPP = ${DESTDIR}$(bindir)/h5c++ ACLOCAL_AMFLAGS = "-I m4" # The trace script; this is used on source files from the C library to diff --git a/tools/h5stat/CMakeLists.txt b/tools/h5stat/CMakeLists.txt index 1640479..3fa2041 100644 --- a/tools/h5stat/CMakeLists.txt +++ b/tools/h5stat/CMakeLists.txt @@ -109,6 +109,41 @@ IF (BUILD_TESTING) ############################################################################## ############################################################################## + # Remove any output file left over from previous test run + ADD_TEST ( + NAME H5STAT-clearall-objects + COMMAND ${CMAKE_COMMAND} + -E remove + h5stat_help1.out + h5stat_help1.out.err + h5stat_help2.out + h5stat_help2.out.err + h5stat_filters.out + h5stat_filters.out.err + h5stat_filters-file.out + h5stat_filters-file.out.err + h5stat_filters-F.out + h5stat_filters-F.out.err + h5stat_filters-d.out + h5stat_filters-d.out.err + h5stat_filters-g.out + h5stat_filters-g.out.err + h5stat_filters-dT.out + h5stat_filters-dT.out.err + h5stat_filters-UD.out + h5stat_filters-UD.out.err + h5stat_filters-UT.out + h5stat_filters-UT.out.err + h5stat_tsohm.out + h5stat_tsohm.out.err + h5stat_newgrat.out + h5stat_newgrat.out.err + h5stat_newgrat-UG.out + h5stat_newgrat-UG.out.err + h5stat_newgrat-UA.out + h5stat_newgrat-UA.out.err + ) + # Test for help flag ADD_H5_TEST (h5stat_help1 0 -h) ADD_H5_TEST (h5stat_help2 0 --help) @@ -145,7 +180,7 @@ INSTALL ( TARGETS h5stat RUNTIME DESTINATION - bin/tools + ${HDF5_INSTALL_BIN_DIR}/tools COMPONENT toolsapplications ) diff --git a/tools/h5stat/Makefile.in b/tools/h5stat/Makefile.in index 2e259c4..2fe9bc7 100644 --- a/tools/h5stat/Makefile.in +++ b/tools/h5stat/Makefile.in @@ -364,14 +364,24 @@ LIBH5_HL = $(top_builddir)/hl/src/libhdf5_hl.la LIBH5F_HL = $(top_builddir)/hl/fortran/src/libhdf5hl_fortran.la LIBH5CPP_HL = $(top_builddir)/hl/c++/src/libhdf5_hl_cpp.la +# Note that in svn revision 19400 the '/' after DESTDIR in H5* variables below +# has been removed. According to the official description of DESTDIR by Gnu at +# http://www.gnu.org/prep/standards/html_node/DESTDIR.html, DESTDIR is +# prepended to the normal and complete install path that it precedes for the +# purpose of installing in a temporary directory which is useful for building +# rpms and other packages. The '/' after ${DESTDIR} will be followed by another +# '/' at the beginning of the normal install path. When DESTDIR is empty the +# path then begins with '//', which is incorrect and causes problems at least for +# Cygwin. + # Scripts used to build examples # If only shared libraries have been installed, have h5cc build examples with # shared libraries instead of static libraries -H5CC = $(bindir)/h5cc -H5CC_PP = $(bindir)/h5pcc -H5FC = $(bindir)/h5fc -H5FC_PP = $(bindir)/h5pfc -H5CPP = $(bindir)/h5c++ +H5CC = ${DESTDIR}$(bindir)/h5cc +H5CC_PP = ${DESTDIR}$(bindir)/h5pcc +H5FC = ${DESTDIR}$(bindir)/h5fc +H5FC_PP = ${DESTDIR}$(bindir)/h5pfc +H5CPP = ${DESTDIR}$(bindir)/h5c++ ACLOCAL_AMFLAGS = "-I m4" # The trace script; this is used on source files from the C library to diff --git a/tools/lib/CMakeLists.txt b/tools/lib/CMakeLists.txt index 05fd607..879e30e 100644 --- a/tools/lib/CMakeLists.txt +++ b/tools/lib/CMakeLists.txt @@ -55,7 +55,7 @@ INSTALL ( FILES ${H5_TOOLS_LIB_HDRS} DESTINATION - include/tools + ${HDF5_INSTALL_INCLUDE_DIR}/tools COMPONENT toolsheaders ) @@ -84,8 +84,8 @@ IF (HDF5_EXPORTED_TARGETS) ${HDF5_TOOLS_LIB_TARGET} EXPORT ${HDF5_EXPORTED_TARGETS} - LIBRARY DESTINATION lib/tools COMPONENT toolslibraries - ARCHIVE DESTINATION lib/tools COMPONENT toolslibraries - RUNTIME DESTINATION bin/tools COMPONENT toolslibraries + LIBRARY DESTINATION ${HDF5_INSTALL_LIB_DIR}/tools COMPONENT toolslibraries + ARCHIVE DESTINATION ${HDF5_INSTALL_LIB_DIR}/tools COMPONENT toolslibraries + RUNTIME DESTINATION ${HDF5_INSTALL_BIN_DIR}/tools COMPONENT toolslibraries ) ENDIF (HDF5_EXPORTED_TARGETS) diff --git a/tools/lib/Makefile.in b/tools/lib/Makefile.in index 020dab5..5e8ac33 100644 --- a/tools/lib/Makefile.in +++ b/tools/lib/Makefile.in @@ -334,14 +334,24 @@ LIBH5_HL = $(top_builddir)/hl/src/libhdf5_hl.la LIBH5F_HL = $(top_builddir)/hl/fortran/src/libhdf5hl_fortran.la LIBH5CPP_HL = $(top_builddir)/hl/c++/src/libhdf5_hl_cpp.la +# Note that in svn revision 19400 the '/' after DESTDIR in H5* variables below +# has been removed. According to the official description of DESTDIR by Gnu at +# http://www.gnu.org/prep/standards/html_node/DESTDIR.html, DESTDIR is +# prepended to the normal and complete install path that it precedes for the +# purpose of installing in a temporary directory which is useful for building +# rpms and other packages. The '/' after ${DESTDIR} will be followed by another +# '/' at the beginning of the normal install path. When DESTDIR is empty the +# path then begins with '//', which is incorrect and causes problems at least for +# Cygwin. + # Scripts used to build examples # If only shared libraries have been installed, have h5cc build examples with # shared libraries instead of static libraries -H5CC = $(bindir)/h5cc -H5CC_PP = $(bindir)/h5pcc -H5FC = $(bindir)/h5fc -H5FC_PP = $(bindir)/h5pfc -H5CPP = $(bindir)/h5c++ +H5CC = ${DESTDIR}$(bindir)/h5cc +H5CC_PP = ${DESTDIR}$(bindir)/h5pcc +H5FC = ${DESTDIR}$(bindir)/h5fc +H5FC_PP = ${DESTDIR}$(bindir)/h5pfc +H5CPP = ${DESTDIR}$(bindir)/h5c++ ACLOCAL_AMFLAGS = "-I m4" # The trace script; this is used on source files from the C library to diff --git a/tools/lib/h5diff.c b/tools/lib/h5diff.c index d462b45..640a20a 100644 --- a/tools/lib/h5diff.c +++ b/tools/lib/h5diff.c @@ -14,8 +14,8 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include -#include "h5diff.h" #include "H5private.h" +#include "h5diff.h" #include "ph5diff.h" #include "h5tools.h" #include "h5tools_utils.h" @@ -235,7 +235,7 @@ out: * Programmer: Jonathan Kim * Date: Aug 23, 2010 *------------------------------------------------------------------------*/ -static int is_exclude_path (trav_path_t * paths, diff_opt_t *options) +static int is_exclude_path (char * path, h5trav_type_t type, diff_opt_t *options) { struct exclude_path_list * exclude_path_ptr; int ret_cmp; @@ -255,7 +255,7 @@ static int is_exclude_path (trav_path_t * paths, diff_opt_t *options) /* if given object is group, exclude its members as well */ if (exclude_path_ptr->obj_type == H5TRAV_TYPE_GROUP) { - ret_cmp = HDstrncmp(exclude_path_ptr->obj_path, paths->path, + ret_cmp = HDstrncmp(exclude_path_ptr->obj_path, path, strlen(exclude_path_ptr->obj_path)); if (ret_cmp == 0) { @@ -265,7 +265,7 @@ static int is_exclude_path (trav_path_t * paths, diff_opt_t *options) * not under “/grp1xxx/” group. */ len_grp = HDstrlen(exclude_path_ptr->obj_path); - if (paths->path[len_grp] == '/') + if (path[len_grp] == '/') { /* belong to excluded group! */ ret = 1; @@ -276,14 +276,14 @@ static int is_exclude_path (trav_path_t * paths, diff_opt_t *options) /* exclude target is not group, just exclude the object */ else { - ret_cmp = HDstrcmp(exclude_path_ptr->obj_path, paths->path); + ret_cmp = HDstrcmp(exclude_path_ptr->obj_path, path); if (ret_cmp == 0) { /* excluded non-group object */ ret = 1; /* assign type as scan progress, which is sufficient to * determine type for excluding groups from the above if. */ - exclude_path_ptr->obj_type = paths->type; + exclude_path_ptr->obj_type = type; break; /* while */ } } @@ -342,6 +342,8 @@ static void build_match_list (const char *objname1, trav_info_t *info1, const ch unsigned infile[2]; char * path1_lp; char * path2_lp; + h5trav_type_t type1_l; + h5trav_type_t type2_l; int path1_offset = 0; int path2_offset = 0; int cmp; @@ -371,12 +373,14 @@ static void build_match_list (const char *objname1, trav_info_t *info1, const ch path1_lp = (info1->paths[curr1].path) + path1_offset; path2_lp = (info2->paths[curr2].path) + path2_offset; + type1_l = info1->paths[curr1].type; + type2_l = info2->paths[curr2].type; /* criteria is string compare */ cmp = HDstrcmp(path1_lp, path2_lp); if(cmp == 0) { - if(!is_exclude_path(&(info1->paths[curr1]), options)) + if(!is_exclude_path(path1_lp, type1_l, options)) { infile[0] = 1; infile[1] = 1; @@ -387,7 +391,7 @@ static void build_match_list (const char *objname1, trav_info_t *info1, const ch } /* end if */ else if(cmp < 0) { - if(!is_exclude_path(&(info1->paths[curr1]), options)) + if(!is_exclude_path(path1_lp, type1_l, options)) { infile[0] = 1; infile[1] = 0; @@ -397,7 +401,7 @@ static void build_match_list (const char *objname1, trav_info_t *info1, const ch } /* end else-if */ else { - if (!is_exclude_path(&(info2->paths[curr2]), options)) + if (!is_exclude_path(path2_lp, type2_l, options)) { infile[0] = 0; infile[1] = 1; @@ -412,7 +416,7 @@ static void build_match_list (const char *objname1, trav_info_t *info1, const ch infile[1] = 0; while(curr1 < info1->nused) { - if(!is_exclude_path(&(info1->paths[curr1]), options)) + if(!is_exclude_path(path1_lp, type1_l, options)) { path1_lp = (info1->paths[curr1].path) + path1_offset; trav_table_addflags(infile, path1_lp, info1->paths[curr1].type, table); @@ -425,7 +429,7 @@ static void build_match_list (const char *objname1, trav_info_t *info1, const ch infile[1] = 1; while(curr2 < info2->nused) { - if (!is_exclude_path(&(info2->paths[curr2]), options)) + if (!is_exclude_path(path2_lp, type2_l, options)) { path2_lp = (info2->paths[curr2].path) + path2_offset; trav_table_addflags(infile, path2_lp, info2->paths[curr2].type, table); diff --git a/tools/misc/CMakeLists.txt b/tools/misc/CMakeLists.txt index 1726ae1..a1e2e49 100644 --- a/tools/misc/CMakeLists.txt +++ b/tools/misc/CMakeLists.txt @@ -102,10 +102,36 @@ IF (BUILD_TESTING) ############################################################################## ############################################################################## + # Remove any output file left over from previous test run + ADD_TEST ( + NAME h5repart_20K-clear-objects + COMMAND ${CMAKE_COMMAND} + -E remove + fst_family00000.h5 + ) # repartition family member size to 20,000 bytes. ADD_TEST (NAME h5repart_20K COMMAND $ -m 20000 family_file%05d.h5 fst_family%05d.h5) + + # Remove any output file left over from previous test run + ADD_TEST ( + NAME h5repart_5K-clear-objects + COMMAND ${CMAKE_COMMAND} + -E remove + scd_family00000.h5 + scd_family00001.h5 + scd_family00002.h5 + scd_family00003.h5 + ) # repartition family member size to 5 KB. ADD_TEST (NAME h5repart_5K COMMAND $ -m 5k family_file%05d.h5 scd_family%05d.h5) + + # Remove any output file left over from previous test run + ADD_TEST ( + NAME h5repart_sec2-clear-objects + COMMAND ${CMAKE_COMMAND} + -E remove + family_to_sec2.h5 + ) # convert family file to sec2 file of 20,000 bytes ADD_TEST (NAME h5repart_sec2 COMMAND $ -m 20000 -family_to_sec2 family_file%05d.h5 family_to_sec2.h5) @@ -130,7 +156,7 @@ INSTALL ( TARGETS h5debug h5repart RUNTIME DESTINATION - bin/tools + ${HDF5_INSTALL_BIN_DIR}/tools COMPONENT toolsapplications ) diff --git a/tools/misc/Makefile.in b/tools/misc/Makefile.in index 2627ce4..b33d14d 100644 --- a/tools/misc/Makefile.in +++ b/tools/misc/Makefile.in @@ -389,14 +389,24 @@ LIBH5_HL = $(top_builddir)/hl/src/libhdf5_hl.la LIBH5F_HL = $(top_builddir)/hl/fortran/src/libhdf5hl_fortran.la LIBH5CPP_HL = $(top_builddir)/hl/c++/src/libhdf5_hl_cpp.la +# Note that in svn revision 19400 the '/' after DESTDIR in H5* variables below +# has been removed. According to the official description of DESTDIR by Gnu at +# http://www.gnu.org/prep/standards/html_node/DESTDIR.html, DESTDIR is +# prepended to the normal and complete install path that it precedes for the +# purpose of installing in a temporary directory which is useful for building +# rpms and other packages. The '/' after ${DESTDIR} will be followed by another +# '/' at the beginning of the normal install path. When DESTDIR is empty the +# path then begins with '//', which is incorrect and causes problems at least for +# Cygwin. + # Scripts used to build examples # If only shared libraries have been installed, have h5cc build examples with # shared libraries instead of static libraries -H5CC = $(bindir)/h5cc -H5CC_PP = $(bindir)/h5pcc -H5FC = $(bindir)/h5fc -H5FC_PP = $(bindir)/h5pfc -H5CPP = $(bindir)/h5c++ +H5CC = ${DESTDIR}$(bindir)/h5cc +H5CC_PP = ${DESTDIR}$(bindir)/h5pcc +H5FC = ${DESTDIR}$(bindir)/h5fc +H5FC_PP = ${DESTDIR}$(bindir)/h5pfc +H5CPP = ${DESTDIR}$(bindir)/h5c++ ACLOCAL_AMFLAGS = "-I m4" # The trace script; this is used on source files from the C library to diff --git a/tools/misc/h5cc.in b/tools/misc/h5cc.in index c274f3f..a1421a2 100755 --- a/tools/misc/h5cc.in +++ b/tools/misc/h5cc.in @@ -34,6 +34,25 @@ HL="@HL@" ############################################################################ ## ## +## Things You Can Modify to Override HDF5 Library Build Components: ## +## ## +## (Advanced usage - know what you're doing - you're on your own here.) ## +## The four variables below can be used to insert paths and flags in ## +## CPPFLAGS, CFLAGS, LDFLAGS, or LIBS in the h5cc compile line: ## +## $CLINKER $H5BLD_CPPFLAGS $CPPFLAGS $H5BLD_CFLAGS $CFLAGS $LDFLAGS ## +## $LIBS $clibpath $link_objs $link_args $shared_link ## +## ## +## These settings can be overriden by setting HDF5_CFLAGS, ## +## HDF5_CPPFLAGS, HDF5_LDFLAGS, or HDF5_LIBS in the environment. ## +## ## +############################################################################ +CFLAGSBASE="" +CPPFLAGSBASE="" +LDFLAGSBASE="" +LIBSBASE="" + +############################################################################ +## ## ## You shouldn't have to modify anything below this line. ## ## ## ############################################################################ @@ -62,13 +81,26 @@ get_output_file="no" SHOW="eval" CCBASE="@CC@" CLINKERBASE="@CC@" -CFLAGS="@AM_CFLAGS@ @CFLAGS@" -CPPFLAGS="@AM_CPPFLAGS@ @CPPFLAGS@" -LDFLAGS="@AM_LDFLAGS@ @LDFLAGS@" -LIBS="@LIBS@" + +# CFLAGS, CPPFLAGS and LDFLAGS are reserved for use by the script user. +# FLAGS brought from the hdf5 build are put in H5BLD_*FLAGS. + +# User's CPPFLAGS and CFLAGS come after their H5BLD counterparts to override +# them. User's LDFLAGS come just before clibpath, user's LIBS come after +# $link_objs and before the hdf5 libraries in $link_args, followed by any +# external library paths and libraries from AM_LDFLAGS, LDFLAGS, AM_LIBS +# or LIBS carried in from the hdf5 build. +H5BLD_CFLAGS="@AM_CFLAGS@ @CFLAGS@" +H5BLD_CPPFLAGS="@AM_CPPFLAGS@ @CPPFLAGS@" +H5BLD_LDFLAGS="@AM_LDFLAGS@ @LDFLAGS@" +H5BLD_LIBS="@LIBS@" CC="${HDF5_CC:-$CCBASE}" CLINKER="${HDF5_CLINKER:-$CLINKERBASE}" +CFLAGS="${HDF5_CFLAGS:-$CFLAGSBASE}" +CPPFLAGS="${HDF5_CPPFLAGS:-$CPPFLAGSBASE}" +LDFLAGS="${HDF5_LDFLAGS:-$LDFLAGSBASE}" +LIBS="${HDF5_LIBS:-$LIBSBASE}" USE_SHARED_LIB="${HDF5_USE_SHLIB:-no}" @@ -80,6 +112,13 @@ usage() { echo " -echo Show all the shell commands executed" echo " -prefix=DIR Prefix directory to find HDF5 lib/ and include/" echo " subdirectories [default: $prefix]" + # A wonderfully informative "usage" message. + echo "usage: $prog_name [OPTIONS] " + echo " OPTIONS:" + echo " -help This help message." + echo " -echo Show all the shell commands executed" + echo " -prefix=DIR Prefix directory to find HDF5 lib/ and include/" + echo " subdirectories [default: $prefix]" echo " -show Show the commands without executing them" echo " -showconfig Show the HDF5 library configuration summary" echo " -shlib Compile with shared HDF5 libraries" @@ -99,6 +138,19 @@ usage() { echo " HDF5_USE_SHLIB=[yes|no] - use shared or static version of the HDF5 library" echo " [default: no]" echo " " + echo " You can also add or change paths and flags to the compile line using" + echo " the following environment varibles or by assigning them to their counterparts" + echo " in the 'Things You Can Modify to Override...'" section of $prog_name + echo " " + echo " Variable Current value to be replaced" + echo " HDF5_CPPFLAGS \"$CPPFLAGSBASE\"" + echo " HDF5_CFLAGS \"$CFLAGSBASE\"" + echo " HDF5_LDFLAGS \"$LDFLAGSBASE\"" + echo " HDF5_LIBS \"$LIBSBASE\"" + echo " " + echo " Note that adding library paths to HDF5_LDFLAGS where another hdf5 version" + echo " is located may link your program with that other hdf5 library version." + echo " " exit $EXIT_FAILURE } @@ -251,7 +303,7 @@ if test "x$do_compile" = "xyes"; then compile_args="-c $compile_args" fi - $SHOW $CC -I$includedir $CPPFLAGS $CFLAGS $compile_args + $SHOW $CC -I$includedir $H5BLD_CPPFLAGS $CPPFLAGS $H5BLD_CFLAGS $CFLAGS $compile_args status=$? if test "$status" != "0"; then @@ -320,9 +372,14 @@ if test "x$do_link" = "xyes"; then # The LIBS are just a bunch of -l* libraries necessary for the HDF5 # module. It's okay if they're included twice in the compile line. - link_args="$link_args $LIBS" - - $SHOW $CLINKER $CFLAGS $clibpath $link_objs $link_args $shared_link $LDFLAGS + link_args="$link_args $H5BLD_LDFLAGS $H5BLD_LIBS" + + # User's CPPFLAGS and CFLAGS come after their H5BLD counterparts to override + # them. User's LDFLAGS come just before clibpath, user's LIBS come after + # $link_objs and before the hdf5 libraries in $link_args, followed by any + # external library paths and libraries from AM_LDFLAGS, LDFLAGS, AM_LIBS + # or LIBS carried in from the hdf5 build. + $SHOW $CLINKER $H5BLD_CPPFLAGS $CPPFLAGS $H5BLD_CFLAGS $CFLAGS $LDFLAGS $clibpath $link_objs $LIBS $link_args $shared_link status=$? fi diff --git a/vms/src/h5pubconf.h b/vms/src/h5pubconf.h index b9556ac..5a5c8c4 100644 --- a/vms/src/h5pubconf.h +++ b/vms/src/h5pubconf.h @@ -489,13 +489,13 @@ #define H5_PACKAGE_NAME "HDF5" /* Define to the full name and version of this package. */ -#define H5_PACKAGE_STRING "HDF5 1.9.75-FA_a5" +#define H5_PACKAGE_STRING "HDF5 1.9.76-FA_a5" /* Define to the one symbol short name of this package. */ #define H5_PACKAGE_TARNAME "hdf5" /* Define to the version of this package. */ -#define H5_PACKAGE_VERSION "1.9.75-FA_a5" +#define H5_PACKAGE_VERSION "1.9.76-FA_a5" /* Width for printf() for type `long long' or `__int64', use `ll' */ #define H5_PRINTF_LL_WIDTH "ll" @@ -651,7 +651,7 @@ /* #undef H5_USING_MEMCHECKER */ /* Version number of package */ -#define H5_VERSION "1.9.75-FA_a5" +#define H5_VERSION "1.9.76-FA_a5" /* Define if vsnprintf() returns the correct value for formatted strings that don't fit into size allowed */ diff --git a/windows/src/H5pubconf.h b/windows/src/H5pubconf.h index ca1c084..2cc3348 100755 --- a/windows/src/H5pubconf.h +++ b/windows/src/H5pubconf.h @@ -478,13 +478,13 @@ #define H5_PACKAGE_NAME "HDF5" /* Define to the full name and version of this package. */ -#define H5_PACKAGE_STRING "HDF5 1.9.75-FA_a5" +#define H5_PACKAGE_STRING "HDF5 1.9.76-FA_a5" /* Define to the one symbol short name of this package. */ #define H5_PACKAGE_TARNAME "hdf5" /* Define to the version of this package. */ -#define H5_PACKAGE_VERSION "1.9.75-FA_a5" +#define H5_PACKAGE_VERSION "1.9.76-FA_a5" /* Width for printf() for type `long long' or `__int64', use `ll' */ #define H5_PRINTF_LL_WIDTH "I64" @@ -641,7 +641,7 @@ /* #undef H5_USING_MEMCHECKER */ /* Version number of package */ -#define H5_VERSION "1.9.75-FA_a5" +#define H5_VERSION "1.9.76-FA_a5" /* Define if vsnprintf() returns the correct value for formatted strings that don't fit into size allowed */ diff --git a/windows/tools/h5diff/testh5diff.bat b/windows/tools/h5diff/testh5diff.bat index 32fe001..29be753 100644 --- a/windows/tools/h5diff/testh5diff.bat +++ b/windows/tools/h5diff/testh5diff.bat @@ -399,7 +399,9 @@ rem ############################################################################ rem 6.1: Check if non-exist object name is specified call :testing %h5diff% %srcfile1% %srcfile1% nono_obj - call :tooltest h5diff_601.txt %file1% %file1% nono_obj + rem SKIP this test as on Wondows legacy specific + rem call :tooltest h5diff_601.txt %file1% %file1% nono_obj + call :results -SKIP- rem ######################################################################## @@ -823,14 +825,14 @@ rem ############################################################################ rem ############################################################################## - rem # Exclude objects (--exclude-object) + rem # Exclude objects (--exclude-path) rem ############################################################################## rem #------------------------------------------------- rem # Same structure, same names and different value. rem Exclude the object with different value. Expect return - same - call :testing %h5diff% -v --exclude-object /group1/dset3 %srcexclude1_1% %srcexclude1_2% - call :tooltest h5diff_480.txt -v --exclude-object /group1/dset3 %exclude1_1% %exclude1_2% + call :testing %h5diff% -v --exclude-path /group1/dset3 %srcexclude1_1% %srcexclude1_2% + call :tooltest h5diff_480.txt -v --exclude-path /group1/dset3 %exclude1_1% %exclude1_2% rem Verify different by not excluding. Expect return - diff call :testing %h5diff% -v %srcexclude1_1% %srcexclude1_2% @@ -840,12 +842,16 @@ rem ############################################################################ rem # Different structure, different names. rem Exclude all the different objects. Expect return - same - call :testing %h5diff% -v --exclude-object "/group1" --exclude-object "/dset1" %srcexclude2_1% %srcexclude2_2% - call :tooltest h5diff_482.txt -v --exclude-object "/group1" --exclude-object "/dset1" %exclude2_1% %exclude2_2% + call :testing %h5diff% -v --exclude-path "/group1" --exclude-path "/dset1" %srcexclude2_1% %srcexclude2_2% + call :tooltest h5diff_482.txt -v --exclude-path "/group1" --exclude-path "/dset1" %exclude2_1% %exclude2_2% rem Exclude only some different objects. Expect return - diff - call :testing %h5diff% -v --exclude-object "/group1" %srcexclude2_1% %srcexclude2_2% - call :tooltest h5diff_483.txt -v --exclude-object "/group1" %exclude2_1% %exclude2_2% + call :testing %h5diff% -v --exclude-path "/group1" %srcexclude2_1% %srcexclude2_2% + call :tooltest h5diff_483.txt -v --exclude-path "/group1" %exclude2_1% %exclude2_2% + + rem Exclude from group compare + call :testing %h5diff% -v --exclude-path "/dset3" %srcexclude1_1% %srcexclude1_2% /group1 + call :tooltest h5diff_484.txt -v --exclude-path "/dset3" %exclude1_1% %exclude1_2% /group1 rem ####################################################################### diff --git a/windows/tools/h5repack/h5repack.bat b/windows/tools/h5repack/h5repack.bat index 92f5300..7fb426d 100644 --- a/windows/tools/h5repack/h5repack.bat +++ b/windows/tools/h5repack/h5repack.bat @@ -42,6 +42,11 @@ set h5diff=..\h5diff%2\%1\h5diff%2 rem The path of the h5diff tool binary set h5diff_bin=%CD%\%h5diff% +rem The h5dump tool name +set h5dump=..\h5dump%2\%1\h5dump%2 +rem The path of the h5dump tool binary +set h5dump_bin=%CD%\%h5dump% + set h5detectszip=testh5repack_detect_szip%2 set h5detectszip_bin=%CD%\..\testfiles\%h5detectszip%\%1\%h5detectszip% @@ -66,6 +71,7 @@ set file14=h5repack_layouto.h5 set file15=h5repack_named_dtypes.h5 rem located in common testfiles folder set file16=tfamilyPERCENT05d.h5 +set file18=h5repack_layout2.h5 set nerrors=0 @@ -125,7 +131,7 @@ rem :difftest set params=%* %h5diff_bin% -q !params:PERCENT=%%! - if %errorlevel% neq 0 ( + if !errorlevel! neq 0 ( call :verify *FAILED* %* set /a nerrors=!nerrors!+1 ) else ( @@ -137,8 +143,19 @@ rem rem Call h5repack rem + +rem call TOOLTEST_MAIN and delete $output file :tooltest + call :tooltest_main %* + set outfile=%CD%\out.%1 + del /f %outfile% + + exit /b + +rem TOOLTEST main function, doesn't delete $output file +:tooltest_main + rem Run test. set infile=%CD%\testfiles\%1 rem Linux uses a $path variable here, but it is unneccessary, and will @@ -157,17 +174,114 @@ rem ) %h5repack_bin% %params% %infile% %outfile% - if %errorlevel% neq 0 ( + if !errorlevel! neq 0 ( call :testing *FAILED* %* set /a nerrors=!nerrors!+1 ) else ( call :testing PASSED %* call :difftest %infile% %outfile% ) + + exit /b + +rem ------------------------------------------ +rem Verifying layouts of a dataset +:verify_layout_dset + + rem Run test. + set outfile=%CD%\out.%1 + set layoutfile=%CD%\layout.%1 + set dset=%2 + set expectlayout=%3 + + rem --------------------------------- + rem check the layout from a dataset + %h5dump_bin% -d %dset% -pH %outfile% > %layoutfile% + findstr /c:"%expectlayout%" %layoutfile% > nul + if !errorlevel! neq 0 ( + call :verify *FAILED* %* + set /a nerrors=!nerrors!+1 + ) else ( + call :verify PASSED %* + ) + + rem clean up tmp files del /f %outfile% + del /f %layoutfile% exit /b + +rem---------------------------------------- +rem Verifying layouts from entire file +:verify_layout_all + + rem Run test. + set outfile=%CD%\out.%1 + set layoutfile=%CD%\layout.%1 + set expectlayout=%2 + rem --------------------------------- + rem check the layout from a dataset + rem check if the other layouts still exsit + rem if CONTIGUOUS + if "%expectlayout%"=="CONTIGUOUS" ( + %h5dump_bin% -pH %outfile% > %layoutfile% + findstr /c:"COMPACT" %layoutfile% > nul + if !errorlevel! neq 0 ( + findstr /c:"CHUNKED" %layoutfile% > nul + if !errorlevel! equ 0 ( + call :verify *FAILED* %* + set /a nerrors=!nerrors!+1 + ) else ( + call :verify PASSED %* + ) + ) else ( + call :verify *FAILED* %* + set /a nerrors=!nerrors!+1 + ) + ) else ( + rem if COMPACT + if "%expectlayout%"=="COMPACT" ( + %h5dump_bin% -pH %outfile% > %layoutfile% + findstr /c:"CHUNKED" %layoutfile% > nul + if !errorlevel! neq 0 ( + findstr /c:"CONTIGUOUS" %layoutfile% > nul + if !errorlevel! equ 0 ( + call :verify *FAILED* %* + set /a nerrors=!nerrors!+1 + ) else ( + call :verify PASSED %* + ) + ) else ( + call :verify *FAILED* %* + set /a nerrors=!nerrors!+1 + ) + ) else ( + rem if CHUNKED + if "%expectlayout%"=="CHUNKED" ( + %h5dump_bin% -pH %outfile% > %layoutfile% + findstr/c:"CONTIGUOUS" %layoutfile% > nul + if !errorlevel! neq 0 ( + findstr /c:"COMPACT" %layoutfile% > nul + if !errorlevel! equ 0 ( + call :verify *FAILED* %* + set /a nerrors=!nerrors!+1 + ) else ( + call :verify PASSED %* + ) + ) else ( + call :verify *FAILED* %* + set /a nerrors=!nerrors!+1 + ) + ) + ) + ) + + rem clean up tmp files + del /f %outfile% + del /f %layoutfile% + + exit /b rem Call h5repack with old syntax rem @@ -191,7 +305,7 @@ rem ) %h5repack_bin% -i %infile% -o %outfile% %params% - if %errorlevel% neq 0 ( + if !errorlevel! neq 0 ( call :testing *FAILED* %* set /a nerrors=!nerrors!+1 ) else ( @@ -225,7 +339,7 @@ rem ) %h5repack_bin% %params% !infile:PERCENT=%%! !outfile:PERCENT=%%! - if %errorlevel% neq 0 ( + if !errorlevel! neq 0 ( call :testing *FAILED* %* set /a nerrors=!nerrors!+1 ) else ( @@ -245,7 +359,7 @@ rem If we find a better way to test this in the future, we should use it. rem --SJW 9/4/07 :detect_filter findstr /b /i /c:"#define H5_HAVE_FILTER_%1" %h5pubconf% > nul - if %errorlevel% equ 0 ( + if !errorlevel! equ 0 ( set use_filter_%1=yes ) else ( set use_filter_%1=no @@ -558,12 +672,18 @@ rem rem layout options (these files have no filters) rem ######################################################## - call :tooltest %file4% --layout=dset2:CHUNK=20x10 - call :tooltest %file4% -l CHUNK=20x10 - call :tooltest %file4% -l dset2:CONTI - call :tooltest %file4% -l CONTI - call :tooltest %file4% -l dset2:COMPA - call :tooltest %file4% -l COMPA + call :tooltest_main %file4% --layout=dset2:CHUNK=20x10 + call :verify_layout_dset %file4% dset2 CHUNKED + call :tooltest_main %file4% -l CHUNK=20x10 + call :verify_layout_all %file4% CHUNKED + call :tooltest_main %file4% -l dset2:CONTI + call :verify_layout_dset %file4% dset2 CONTIGUOUS + call :tooltest_main %file4% -l CONTI + call :verify_layout_all %file4% CONTIGUOUS + call :tooltest_main %file4% -l dset2:COMPA + call :verify_layout_dset %file4% dset2 COMPACT + call :tooltest_main %file4% -l COMPA + call :verify_layout_all %file4% COMPACT rem ############################################################### @@ -579,15 +699,31 @@ rem set arg7=%file4% -l dset_chunk:COMPA set arg8=%file4% -l dset_chunk:CONTI set arg9=%file4% -l dset_chunk:CHUNK=18x13 - call :tooltest %arg1% - call :tooltest %arg2% - call :tooltest %arg3% - call :tooltest %arg4% - call :tooltest %arg5% - call :tooltest %arg6% - call :tooltest %arg7% - call :tooltest %arg8% - call :tooltest %arg9% + call :tooltest_main %arg1% + call :verify_layout_dset %file4% dset_compact CONTIGUOUS + call :tooltest_main %arg2% + call :verify_layout_dset %file4% dset_compact CHUNKED + call :tooltest_main %arg3% + call :verify_layout_dset %file4% dset_compact COMPACT + call :tooltest_main %arg4% + call :verify_layout_dset %file4% dset_contiguous COMPACT + call :tooltest_main %arg5% + call :verify_layout_dset %file4% dset_contiguous CHUNKED + call :tooltest_main %arg6% + call :verify_layout_dset %file4% dset_contiguous CONTIGUOUS + call :tooltest_main %arg7% + call :verify_layout_dset %file4% dset_chunk COMPACT + call :tooltest_main %arg8% + call :verify_layout_dset %file4% dset_chunk CONTIGUOUS + call :tooltest_main %arg9% + call :verify_layout_dset %file4% dset_chunk CHUNKED + + rem test convert small size dataset ( < 1k) to compact layout without -m + call :tooltest_main %file18% -l contig_small:COMPA + call :verify_layout_dset %file18% contig_small COMPACT + + call :tooltest_main %file18% -l chunked_small_fixed:COMPA + call :verify_layout_dset %file18% chunked_small_fixed COMPACT rem Native option rem Do not use FILE1, as the named dtype will be converted to native, and h5diff will @@ -601,15 +737,17 @@ rem if not "%use_filter_deflate%"=="yes" ( call :skip %arg% ) else ( - call :tooltest %arg% + call :tooltest_main %arg% + call :verify_layout_all %file4% CHUNKED ) rem latest file format with short switches. use FILE4=h5repack_layout.h5 (no filters) set arg=%file4% -l CHUNK=20x10 -f GZIP=1 -m 10 -n -L -c 8 -d 6 -s 8[:dtype] if not "%use_filter_deflate%"=="yes" ( - call :skip %arg% + call :skip %arg% ) else ( - call :tooltest %arg% + call :tooltest_main %arg% + call :verify_layout_all %file4% CHUNKED ) rem several global filters -- cgit v0.12