diff options
author | Vishwanath Venkatesan <vish@hdfgroup.org> | 2013-07-08 23:19:55 (GMT) |
---|---|---|
committer | Vishwanath Venkatesan <vish@hdfgroup.org> | 2013-07-08 23:19:55 (GMT) |
commit | f9dd3bf81e4fd1b5867c4bf89e6fbf2a99147e34 (patch) | |
tree | d745e007234ce9b378e5f955683d6c748dbc8634 | |
parent | a1c0fdfeeea366fbf321efe9575d4c8072e58a56 (diff) | |
parent | e74f49bdc142517aab4ab2e6823edef186895971 (diff) | |
download | hdf5-f9dd3bf81e4fd1b5867c4bf89e6fbf2a99147e34.zip hdf5-f9dd3bf81e4fd1b5867c4bf89e6fbf2a99147e34.tar.gz hdf5-f9dd3bf81e4fd1b5867c4bf89e6fbf2a99147e34.tar.bz2 |
[svn-r23874] Changes merged with hdf5_ff branch.
Still Dset close is a concern.
297 files changed, 13953 insertions, 8862 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 2c39e3a..5aa5dd7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -190,7 +190,7 @@ STRING (REGEX REPLACE ".*LT_VERS_REVISION[ \t]+=[ \t]+([0-9]*).*$" "\\1" H5_SOVERS_MINOR ${_lt_vers_am_contents}) STRING (REGEX REPLACE ".*LT_VERS_AGE[ \t]+=[ \t]+([0-9]*).*$" "\\1" H5_SOVERS_RELEASE ${_lt_vers_am_contents}) -MESSAGE (STATUS "SOVERSION: ${H5_SOVERS_MAJOR}.${H5_SOVERS_MINOR}.${H5_SOVERS_RELEASE}") +MESSAGE (STATUS "SOVERSION: ${H5_SOVERS_MAJOR}.${H5_SOVERS_RELEASE}.${H5_SOVERS_MINOR}") #----------------------------------------------------------------------------- # Basic HDF5 stuff here @@ -205,7 +205,7 @@ IF (NOT "${H5_VERS_SUBRELEASE}" STREQUAL "") ELSE (NOT "${H5_VERS_SUBRELEASE}" STREQUAL "") SET (HDF5_PACKAGE_VERSION_STRING "${HDF5_PACKAGE_VERSION}") ENDIF (NOT "${H5_VERS_SUBRELEASE}" STREQUAL "") -SET (HDF5_PACKAGE_SOVERSION "${H5_SOVERS_MAJOR}.${H5_SOVERS_MINOR}.${H5_SOVERS_RELEASE}") +SET (HDF5_PACKAGE_SOVERSION "${H5_SOVERS_MAJOR}.${H5_SOVERS_RELEASE}.${H5_SOVERS_MINOR}") SET (HDF5_PACKAGE_STRING "${HDF5_PACKAGE_NAME} ${HDF5_PACKAGE_VERSION_STRING}") SET (HDF5_PACKAGE_TARNAME "${HDF5_PACKAGE}${HDF_PACKAGE_EXT}") SET (HDF5_PACKAGE_URL "http://www.hdfgroup.org") @@ -351,6 +351,8 @@ ENDIF (WIN32) IF (MSVC) SET (CMAKE_MFC_FLAG 0) + SET (WIN_COMPILE_FLAGS "") + SET (WIN_LINK_FLAGS "") ENDIF (MSVC) SET (MAKE_SYSTEM) @@ -454,6 +456,155 @@ IF (HDF5_DISABLE_COMPILER_WARNINGS) ENDIF (HDF5_DISABLE_COMPILER_WARNINGS) #----------------------------------------------------------------------------- +# CDash is configured to only allow 3000 warnings, so +# break into groups (from the config/gnu-flags file) +#----------------------------------------------------------------------------- +IF (NOT MSVC) + # Append warning flags + # Don't use the '-Wtraditional' flag, we're way past having K&R C code + # SET (H5_CFLAGS "${H5_CFLAGS} -Wtraditional") + # Don't use the '-Wtraditional-conversion' flag, there's too many warnings + # from GCC's assert macro + # SET (H5_CFLAGS "${H5_CFLAGS} -Wtraditional-conversion") + + # Append warning flags from gcc-3* case + # (don't use -Wpadded flag for normal builds, many of the warnings its + # issuing can't be fixed and they are making it hard to detect other, + # more important warnings) + #SET (H5_CFLAGS "${H5_CFLAGS} -Wfloat-equal -Wmissing-format-attribute -Wpadded") + SET (H5_CFLAGS1 "${H5_CFLAGS1} -Wfloat-equal -Wmissing-format-attribute") + + # Append warning flags from gcc-3.2* case + SET (H5_CFLAGS1 "${H5_CFLAGS1} -Wmissing-noreturn -Wpacked -Wdisabled-optimization") + + # Enable more format checking flags, beyond the basic -Wformat included + # in -Wall + SET (H5_CFLAGS1 "${H5_CFLAGS1} -Wformat=2") + + # The "unreachable code" warning appears to be reliable now... + # (this warning was removed in gcc 4.5+) + #SET (H5_CFLAGS "${H5_CFLAGS} -Wunreachable-code") + + # Append warning flags from gcc-3.3* case + SET (H5_CFLAGS1 "${H5_CFLAGS1} -Wendif-labels") + + # Append warning flags from gcc-3.4* case + SET (H5_CFLAGS2 "${H5_CFLAGS2} -Wdeclaration-after-statement -Wold-style-definition -Winvalid-pch") + + # Append more extra warning flags that only gcc4.0+ know about + SET (H5_CFLAGS2 "${H5_CFLAGS2} -Wvariadic-macros -Winit-self -Wmissing-include-dirs -Wswitch-default -Wswitch-enum -Wunused-macros") + + # Append more extra warning flags that only gcc 4.1+ know about + SET (H5_CFLAGS3 "${H5_CFLAGS3} -Wunsafe-loop-optimizations -Wc++-compat") + + # Append more extra warning flags that only gcc 4.2+ know about + SET (H5_CFLAGS3 "${H5_CFLAGS3} -Wstrict-overflow") + + # Append more extra warning flags that only gcc 4.3+ know about + # + # Technically, variable-length arrays are part of the C99 standard, but + # we should approach them a bit cautiously... -QAK + SET (H5_CFLAGS3 "${H5_CFLAGS3} -Wlogical-op -Wlarger-than=2048 -Wvla") + + # Append more extra warning flags that only gcc 4.4+ know about + SET (H5_CFLAGS3 "${H5_CFLAGS4} -Wsync-nand -Wframe-larger-than=16384 -Wpacked-bitfield-compat") + + # Append more extra warning flags that only gcc 4.5+ know about + SET (H5_CFLAGS4 "${H5_CFLAGS4} -Wstrict-overflow=5 -Wjump-misses-init -Wunsuffixed-float-constants") + + # Append more extra warning flags that only gcc 4.6+ know about + SET (H5_CFLAGS4 "${H5_CFLAGS5} -Wdouble-promotion -Wsuggest-attribute=const -Wtrampolines") + + # Append more extra warning flags that only gcc 4.7+ know about + SET (H5_CFLAGS4 "${H5_CFLAGS5} -Wstack-usage=8192 -Wvector-operation-performance -Wsuggest-attribute=pure -Wsuggest-attribute=noreturn") +ENDIF (NOT MSVC) + +#----------------------------------------------------------------------------- +# Option to allow the user to enable all warnings +#----------------------------------------------------------------------------- +OPTION (HDF5_ENABLE_ALL_WARNINGS "Enable all warnings" OFF) +IF (HDF5_ENABLE_ALL_WARNINGS) + IF (MSVC) + STRING (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") + SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /Wall") + STRING (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Wall") + ELSE (MSVC) + SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -pedantic ${H5_CFLAGS1} ${H5_CFLAGS2} ${H5_CFLAGS3} ${H5_CFLAGS4}") + ENDIF (MSVC) +ENDIF (HDF5_ENABLE_ALL_WARNINGS) + +#----------------------------------------------------------------------------- +# Option to allow the user to enable warnings by groups +#----------------------------------------------------------------------------- +OPTION (HDF5_ENABLE_GROUPZERO_WARNINGS "Enable group zero warnings" OFF) +IF (HDF5_ENABLE_GROUPZERO_WARNINGS) + IF (MSVC) + STRING (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") + SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W1") + STRING (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W1") + ELSE (MSVC) + SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -pedantic") + ENDIF (MSVC) +ENDIF (HDF5_ENABLE_GROUPZERO_WARNINGS) + +#----------------------------------------------------------------------------- +# Option to allow the user to enable warnings by groups +#----------------------------------------------------------------------------- +OPTION (HDF5_ENABLE_GROUPONE_WARNINGS "Enable group one warnings" OFF) +IF (HDF5_ENABLE_GROUPONE_WARNINGS) + IF (MSVC) + STRING (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") + SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W2") + STRING (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W2") + ELSE (MSVC) + SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${H5_CFLAGS1}") + ENDIF (MSVC) +ENDIF (HDF5_ENABLE_GROUPONE_WARNINGS) + +#----------------------------------------------------------------------------- +# Option to allow the user to enable warnings by groups +#----------------------------------------------------------------------------- +OPTION (HDF5_ENABLE_GROUPTWO_WARNINGS "Enable group two warnings" OFF) +IF (HDF5_ENABLE_GROUPTWO_WARNINGS) + IF (MSVC) + STRING (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") + SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W3") + STRING (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W3") + ELSE (MSVC) + SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${H5_CFLAGS2}") + ENDIF (MSVC) +ENDIF (HDF5_ENABLE_GROUPTWO_WARNINGS) + +#----------------------------------------------------------------------------- +# Option to allow the user to enable warnings by groups +#----------------------------------------------------------------------------- +OPTION (HDF5_ENABLE_GROUPTHREE_WARNINGS "Enable group three warnings" OFF) +IF (HDF5_ENABLE_GROUPTHREE_WARNINGS) + IF (MSVC) + STRING (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") + SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W4") + STRING (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4") + ELSE (MSVC) + SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${H5_CFLAGS3}") + ENDIF (MSVC) +ENDIF (HDF5_ENABLE_GROUPTHREE_WARNINGS) + +#----------------------------------------------------------------------------- +# Option to allow the user to enable warnings by groups +#----------------------------------------------------------------------------- +OPTION (HDF5_ENABLE_GROUPFOUR_WARNINGS "Enable group four warnings" OFF) +IF (HDF5_ENABLE_GROUPFOUR_WARNINGS) + IF (NOT MSVC) + SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${H5_CFLAGS4}") + ENDIF (NOT MSVC) +ENDIF (HDF5_ENABLE_GROUPFOUR_WARNINGS) + +#----------------------------------------------------------------------------- # This is in here to help some of the GCC based IDES like Eclipse # and code blocks parse the compiler errors and warnings better. #----------------------------------------------------------------------------- @@ -487,6 +638,8 @@ IF (HDF5_ENABLE_PARALLEL) # Used by Fortran + MPI CHECK_SYMBOL_EXISTS (MPI_Comm_c2f "${MPI_C_INCLUDE_PATH}/mpi.h" H5_HAVE_MPI_MULTI_LANG_Comm) CHECK_SYMBOL_EXISTS (MPI_Info_c2f "${MPI_C_INCLUDE_PATH}/mpi.h" H5_HAVE_MPI_MULTI_LANG_Info) + ELSE (MPI_C_FOUND) + MESSAGE (STATUS "Parallel libraries not found") ENDIF (MPI_C_FOUND) ENDIF (HDF5_ENABLE_PARALLEL) @@ -554,6 +707,11 @@ IF (HDF5_USE_18_API_DEFAULT) ENDIF (HDF5_USE_18_API_DEFAULT) #----------------------------------------------------------------------------- +# Include user macros +#----------------------------------------------------------------------------- +INCLUDE (UserMacros.cmake) + +#----------------------------------------------------------------------------- # Options for HDF5 Filters #----------------------------------------------------------------------------- MACRO (HDF5_SETUP_FILTERS FILTER) @@ -571,12 +729,10 @@ HDF5_SETUP_FILTERS (NBIT) HDF5_SETUP_FILTERS (SCALEOFFSET) INCLUDE (ExternalProject) -OPTION (HDF5_ALLOW_EXTERNAL_SUPPORT "Allow External Library Building" "NO") -OPTION (ZLIB_USE_EXTERNAL "Use External Library Building for ZLIB" 0) -OPTION (SZIP_USE_EXTERNAL "Use External Library Building for SZIP" 0) +OPTION (HDF5_ALLOW_EXTERNAL_SUPPORT "Allow External Library Building (NO SVN TGZ)" "NO") IF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") - SET (ZLIB_USE_EXTERNAL 1) - SET (SZIP_USE_EXTERNAL 1) + OPTION (ZLIB_USE_EXTERNAL "Use External Library Building for ZLIB" 1) + OPTION (SZIP_USE_EXTERNAL "Use External Library Building for SZIP" 1) IF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN") SET (ZLIB_URL ${ZLIB_SVN_URL}) SET (SZIP_URL ${SZIP_SVN_URL}) @@ -586,6 +742,9 @@ IF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MAT ENDIF (NOT TGZ_PATH) SET (ZLIB_URL ${TGZ_PATH}/${ZLIB_TGZ_NAME}) SET (SZIP_URL ${TGZ_PATH}/${SZIP_TGZ_NAME}) + ELSE (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN") + SET (ZLIB_USE_EXTERNAL 0) + SET (SZIP_USE_EXTERNAL 0) ENDIF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN") ENDIF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") @@ -995,40 +1154,51 @@ IF (NOT HDF5_EXTERNALLY_CONFIGURED) FILES ${HDF5_SOURCE_DIR}/ACKNOWLEDGMENTS ${HDF5_SOURCE_DIR}/COPYING - ${HDF5_SOURCE_DIR}/README.txt DESTINATION ${HDF5_INSTALL_DATA_DIR} COMPONENT hdfdocuments ) IF (EXISTS "${HDF5_SOURCE_DIR}/release_docs" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/release_docs") SET (release_files - ${HDF5_SOURCE_DIR}/release_docs/CMake.txt - ${HDF5_SOURCE_DIR}/release_docs/USING_CMake.txt + ${HDF5_SOURCE_DIR}/release_docs/USING_HDF5_CMake.txt ${HDF5_SOURCE_DIR}/release_docs/COPYING - ${HDF5_SOURCE_DIR}/release_docs/HISTORY-1_9.txt - ${HDF5_SOURCE_DIR}/release_docs/INSTALL ${HDF5_SOURCE_DIR}/release_docs/RELEASE.txt ) IF (WIN32 AND NOT CYGWIN) SET (release_files ${release_files} - ${HDF5_SOURCE_DIR}/release_docs/INSTALL_Windows.txt - ) - ELSE (WIN32 AND NOT CYGWIN) - SET (release_files - ${release_files} - ${HDF5_SOURCE_DIR}/release_docs/INSTALL_Cygwin.txt - ${HDF5_SOURCE_DIR}/release_docs/INSTALL_VMS.txt + ${HDF5_SOURCE_DIR}/release_docs/USING_HDF5_VS.txt ) ENDIF (WIN32 AND NOT CYGWIN) - IF (HDF5_ENABLE_PARALLEL) + IF (HDF5_PACK_INSTALL_DOCS) SET (release_files ${release_files} - ${HDF5_SOURCE_DIR}/release_docs/INSTALL_parallel + ${HDF5_SOURCE_DIR}/release_docs/INSTALL_CMake.txt + ${HDF5_SOURCE_DIR}/release_docs/HISTORY-1_8.txt + ${HDF5_SOURCE_DIR}/release_docs/INSTALL ) - ENDIF (HDF5_ENABLE_PARALLEL) + IF (WIN32) + IF (NOT CYGWIN) + SET (release_files + ${release_files} + ${HDF5_SOURCE_DIR}/release_docs/INSTALL_Windows.txt + ) + ELSE (NOT CYGWIN) + SET (release_files + ${release_files} + ${HDF5_SOURCE_DIR}/release_docs/INSTALL_Cygwin.txt + ) + ENDIF (NOT CYGWIN) + ENDIF (WIN32) + IF (HDF5_ENABLE_PARALLEL) + SET (release_files + ${release_files} + ${HDF5_SOURCE_DIR}/release_docs/INSTALL_parallel + ) + ENDIF (HDF5_ENABLE_PARALLEL) + ENDIF (HDF5_PACK_INSTALL_DOCS) INSTALL ( FILES ${release_files} - DESTINATION ${HDF5_INSTALL_DATA_DIR}/release_docs + DESTINATION ${HDF5_INSTALL_DATA_DIR} COMPONENT hdfdocuments ) ENDIF (EXISTS "${HDF5_SOURCE_DIR}/release_docs" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/release_docs") @@ -530,19 +530,18 @@ ./perform/sio_timer.h ./perform/zip_perf.c -./release_docs/CMake.txt +./release_docs/INSTALL_CMake.txt ./release_docs/COPYING ./release_docs/HISTORY-1_0-1_8_0_rc3.txt ./release_docs/HISTORY-1_9.txt ./release_docs/INSTALL ./release_docs/INSTALL_Cygwin.txt -./release_docs/INSTALL_MinGW.txt ./release_docs/INSTALL_parallel ./release_docs/INSTALL_VMS.txt ./release_docs/INSTALL_Windows.txt ./release_docs/RELEASE.txt -./release_docs/USING_CMake.txt -./release_docs/USING_Windows.txt +./release_docs/USING_HDF5_CMake.txt +./release_docs/USING_HDF5_VS.txt ./src/.indent.pro _DO_NOT_DISTRIBUTE_ ./src/hdf5.lnt _DO_NOT_DISTRIBUTE_ @@ -854,6 +853,9 @@ ./src/H5Ppublic.h ./src/H5Pstrcpl.c ./src/H5Ptest.c +./src/H5PL.c +./src/H5PLprivate.h +./src/H5PLextern.h ./src/H5R.c ./src/H5Rdeprec.c ./src/H5Rpkg.h @@ -970,6 +972,9 @@ ./test/dt_arith.c ./test/dtypes.c ./test/dtransform.c +./test/dynlib1.c +./test/dynlib2.c +./test/dynlib3.c ./test/earray.c ./test/efc.c ./test/enc_dec_plist.c @@ -997,29 +1002,31 @@ ./test/filter_fail.c ./test/flush1.c ./test/flush2.c -./test/gen_bad_ohdr.c _DO_NOT_DISTRIBUTE_ -./test/gen_bad_compound.c _DO_NOT_DISTRIBUTE_ -./test/gen_bogus.c _DO_NOT_DISTRIBUTE_ -./test/gen_cross.c _DO_NOT_DISTRIBUTE_ -./test/gen_deflate.c _DO_NOT_DISTRIBUTE_ -./test/gen_file_image.c _DO_NOT_DISTRIBUTE_ -./test/gen_filespace.c _DO_NOT_DISTRIBUTE_ -./test/gen_mergemsg.c _DO_NOT_DISTRIBUTE_ -./test/gen_new_array.c _DO_NOT_DISTRIBUTE_ -./test/gen_new_fill.c _DO_NOT_DISTRIBUTE_ -./test/gen_new_group.c _DO_NOT_DISTRIBUTE_ -./test/gen_new_mtime.c _DO_NOT_DISTRIBUTE_ -./test/gen_new_super.c _DO_NOT_DISTRIBUTE_ -./test/gen_noencoder.c _DO_NOT_DISTRIBUTE_ -./test/gen_nullspace.c _DO_NOT_DISTRIBUTE_ -./test/gen_old_array.c _DO_NOT_DISTRIBUTE_ -./test/gen_old_group.c _DO_NOT_DISTRIBUTE_ -./test/gen_old_layout.c _DO_NOT_DISTRIBUTE_ -./test/gen_old_mtime.c _DO_NOT_DISTRIBUTE_ -./test/gen_plist.c _DO_NOT_DISTRIBUTE_ -./test/gen_sizes_lheap.c _DO_NOT_DISTRIBUTE_ -./test/gen_specmetaread.c _DO_NOT_DISTRIBUTE_ -./test/gen_udlinks.c _DO_NOT_DISTRIBUTE_ +# ====distribute this for now. See HDFFV-8236==== +./test/gen_bad_ohdr.c +./test/gen_bad_compound.c +./test/gen_bogus.c +./test/gen_cross.c +./test/gen_deflate.c +./test/gen_file_image.c +./test/gen_filespace.c +./test/gen_mergemsg.c +./test/gen_new_array.c +./test/gen_new_fill.c +./test/gen_new_group.c +./test/gen_new_mtime.c +./test/gen_new_super.c +./test/gen_noencoder.c +./test/gen_nullspace.c +./test/gen_old_array.c +./test/gen_old_group.c +./test/gen_old_layout.c +./test/gen_old_mtime.c +./test/gen_plist.c +./test/gen_sizes_lheap.c +./test/gen_specmetaread.c +./test/gen_udlinks.c +# ====end distribute this for now. See HDFFV-8236==== ./test/getname.c ./test/gheap.c ./test/group_old.h5 @@ -1042,10 +1049,13 @@ ./test/ntypes.c ./test/ohdr.c ./test/objcopy.c +./test/plugin.c ./test/reserved.c ./test/pool.c ./test/set_extent.c -./test/space_overflow.c _DO_NOT_DISTRIBUTE_ +# ====distribute this for now. See HDFFV-8236==== +./test/space_overflow.c +# ====end distribute this for now. See HDFFV-8236==== ./test/specmetaread.h5 ./test/stab.c ./test/tarray.c @@ -1064,6 +1074,7 @@ ./test/testhdf5.c ./test/testhdf5.h ./test/testlibinfo.sh.in +./test/test_plugin.sh.in ./test/testmeta.c ./test/tfile.c ./test/tgenprop.c @@ -1096,6 +1107,7 @@ ./test/tvlstr.c ./test/tvltypes.c ./test/unlink.c +./test/unregister.c ./test/vfd.c ./test/test_filters_le.h5 ./test/test_filters_be.h5 @@ -1511,6 +1523,8 @@ ./tools/testfiles/topaque.h5 ./tools/testfiles/trawdatafile.ddl ./tools/testfiles/trawdatafile.exp +./tools/testfiles/trawssetfile.ddl +./tools/testfiles/trawssetfile.exp ./tools/testfiles/tsaf.ddl ./tools/testfiles/tsaf.h5 ./tools/testfiles/tscalarattrintsize.ddl @@ -1551,6 +1565,7 @@ ./tools/testfiles/tudlink-2.ddl ./tools/testfiles/tattr2.h5 ./tools/testfiles/tall-2A.ddl +./tools/testfiles/tall-2A0.ddl ./tools/testfiles/tall-2B.ddl ./tools/testfiles/tattrcontents1.ddl ./tools/testfiles/tattrcontents2.ddl @@ -1610,6 +1625,7 @@ ./tools/h5dump/errfiles/filter_fail.err ./tools/h5dump/errfiles/tall-1.err ./tools/h5dump/errfiles/tall-2A.err +./tools/h5dump/errfiles/tall-2A0.err ./tools/h5dump/errfiles/tall-2B.err ./tools/h5dump/errfiles/tarray1_big.err ./tools/h5dump/errfiles/tattr-3.err @@ -2394,8 +2410,12 @@ ./config/cmake/NSIS.template.in ./config/cmake/NSIS.InstallOptions.ini.in +# CMake-specific User Files +./config/cmake/UserMacros/Windows_MT.cmake + ./CMakeLists.txt ./CTestConfig.cmake +./UserMacros.cmake ./c++/CMakeLists.txt ./c++/examples/CMakeLists.txt ./c++/src/CMakeLists.txt @@ -1,4 +1,4 @@ -HDF5 version 1.9.149 currently under development +HDF5 version 1.9.156 currently under development Please refer to the release_docs/INSTALL file for installation instructions. ------------------------------------------------------------------------------ diff --git a/UserMacros.cmake b/UserMacros.cmake new file mode 100644 index 0000000..d7d3ef9 --- /dev/null +++ b/UserMacros.cmake @@ -0,0 +1,17 @@ +######################################################## +# Include file for user options +######################################################## + +#----------------------------------------------------------------------------- +# Option to Build with User Defined Values +#----------------------------------------------------------------------------- +MACRO (MACRO_USER_DEFINED_LIBS) + SET (USER_DEFINED_VALUE "FALSE") +ENDMACRO (MACRO_USER_DEFINED_LIBS) + +#------------------------------------------------------------------------------- +OPTION (BUILD_USER_DEFINED_LIBS "Build With User Defined Values" OFF) +IF (BUILD_USER_DEFINED_LIBS) + MACRO_USER_DEFINED_LIBS () +ENDIF (BUILD_USER_DEFINED_LIBS) +
\ No newline at end of file diff --git a/bin/checkapi b/bin/checkapi index d21863b..b4a08e8 100755 --- a/bin/checkapi +++ b/bin/checkapi @@ -17,33 +17,51 @@ require 5.003; # Purpose: insures that API functions aren't called internally. # Usage: checkapi H5*.c -my $comment = 0; -while (<>) { +my $filename = ""; +my $lastname = ""; - # Remove comments within the line. - s/\/\*.*?\*\///g; +if(<>) { + while (<>) { + if($ARGV =~ /\//) { + ($filename) = ($ARGV =~ /^.*\/([A-Za-z0-9_]*)\.c$/); + } else { + ($filename) = ($ARGV =~ /([A-Za-z0-9_]*)\.c$/); + } - # Process comment begin and end tokens on this line. - $comment-- if /\*\//; # count comment ends - next if $comment; # skip line if in comment - $comment++ if /\/\*/; # count comment starts - s/(.*)\/\*.*/$1/; # remove comments that begin on this line + if($filename =~ /H5FDmulti|H5FDstdio/) { + if($filename ne $lastname) { + print "$ARGV is exempt from checking\n"; + $lastname = $filename; + } + } else { + # Get rid of comments by removing the inside part. + s|/\*.*?\*/||g; + if ($in_comment) { + if (/\*\//) { + s|.*?\*/||; + $in_comment = 0; + } else { + $_="\n"; + } + } elsif (m|/\*|) { + s|/\*.*||; + $in_comment = 1; + } - # Remove character strings - s/\\.//g; # remove escaped characters - s/\".*?\"//g; # remove string constants + # Remove character strings + s/\\.//g; # remove escaped characters + s/\".*?\"//g; # remove string constants - # Disregard the following hits - next if /^H5/; - next if /^\#/; - next if /FUNC_ENTER(_NOINIT)*/; + # Disregard the following hits + next if /^H5/; + next if /^\#/; + next if /FUNC_ENTER(_NOINIT)*/; - next unless /(H5[A-Z]{1,2}[a-z]\w*)/; - print "$ARGV:$.: $1\n"; -} continue { - if (eof) { - print "$ARGV:$.: bad comment nesting\n" if $comment; - $comment = 0; - close ARGV; # reset line number - } + next unless /(H5[A-Z]{1,2}[a-z]\w*)/; + print "$ARGV:$.: $1\n"; + } + } continue { + close ARGV if eof; # reset line number + } } + diff --git a/bin/checkposix b/bin/checkposix index b295d7d..e3617e5 100755 --- a/bin/checkposix +++ b/bin/checkposix @@ -27,60 +27,93 @@ require 5.003; # use `next-error' (usually bound to M-`) to find each name # violation. -while (<>) { - - # Get rid of comments by removing the inside part. - s|/\*.*?\*/||g; - if ($in_comment) { - if (/\*\//) { - s|.*?\*/||; - $in_comment = 0; - } else { - $_="\n"; - } - } elsif (m|/\*|) { - s|/\*.*||; - $in_comment = 1; - } - - # Get rid of string constants if they begin and end on this line. - s/([\'\"])([^\1]|\\\1)*?\1/$1$1/g; - - # Get rid of preprocessor directives - s/^\#.*//; - - # Now find all function calls on this line - while (($name)=/\b([a-gi-z_A-GI-Z]\w*)\s*\(/) { - $_ = $'; - - # Ignore C statements that look sort of like function - # calls. - next if $name =~ /^(if|for|return|sizeof|switch|while|void)$/; - - # Ignore things that get misdetected because of the simplified - # parsing that takes place here. - next if $name =~ /^int$/; - - # These are really HDF5 functions/macros even though they don't - # start with `h' or `H'. - next if $name =~ /^FUNC_(ENTER|LEAVE)(_INIT)?$/; - next if $name =~ /^U?INT(8|16|32|64)(ENCODE|DECODE)$/; - next if $name =~ /^(MIN3?|MAX3?|NELMTS|BOUND|CONSTR)$/; - next if $name =~ /^IS_H5FD_MPIO$/; - next if $name =~ /^addr_defined$/; - - # These functions/macros are exempt. - next if $name =~ /^(assert|main|[fs]?printf|va_(start|arg|end))$/; - - # These are MPI function calls. Ignore them. - next if $name =~ /^MPI_/; - - # These are POSIX threads function calls. Ignore them. - next if $name =~ /^pthread_/; - - print "$ARGV:$.: $name\n"; - } - -} continue { - close ARGV if eof; +if(<>) { + if($ARGV =~ /\//) { + ($filename) = ($ARGV =~ /^.*\/([A-Za-z0-9_]*)\.c$/); + } else { + ($filename) = ($ARGV =~ /([A-Za-z0-9_]*)\.c$/); + } + + if($filename =~ /H5FDmulti|H5FDstdio/) { + print "$ARGV is exempt from using Standard library macro wrappers\n"; + } else { + while (<>) { + + # Get rid of comments by removing the inside part. + s|/\*.*?\*/||g; + if ($in_comment) { + if (/\*\//) { + s|.*?\*/||; + $in_comment = 0; + } else { + $_="\n"; + } + } elsif (m|/\*|) { + s|/\*.*||; + $in_comment = 1; + } + + # Get rid of string constants if they begin and end on this line. + s/([\'\"])([^\1]|\\\1)*?\1/$1$1/g; + + # Get rid of preprocessor directives + s/^\#.*//; + + # Skip callbacks invoked as methods in a struct + next if $_ =~ /\b(\)?->|\.)\(?([a-z_A-Z]\w*)\s*\(/; + + # Now find all function calls on this line which don't start with 'H' + while (($name)=/\b([a-z_A-GI-Z]\w*)\s*\(/) { + $_ = $'; + + # Ignore C statements that look sort of like function + # calls. + next if $name =~ /^(if|for|offsetof|return|sizeof|switch|while|void)$/; + + # Ignore things that get misdetected because of the simplified + # parsing that takes place here. + next if $name =~ /^(int|herr_t|_term_interface)$/; + + # These are really HDF5 functions/macros even though they don't + # start with `h' or `H'. + next if $name =~ /^FUNC_(ENTER|LEAVE)(_(NO)?API|_PACKAGE|_STATIC)?(_NOFS|_NOCLEAR|_NOINIT)?(_NOFUNC|_TAG)?$/; + next if $name =~ /^(BEGIN|END)_FUNC$/; + next if $name =~ /^U?INT(8|16|32|64)(ENCODE|DECODE)(_VAR)?$/; + next if $name =~ /^CI_(PRINT_STATS|INC_SRC|INC_DST)$/; + next if $name =~ /^(ABS|ADDR_OVERFLOW|ALL_MEMBERS|BOUND|CONSTR|DETECT_[I|F|M]|DOWN)$/; + next if $name =~ /^(MIN3?|MAX3?|NELMTS|POWER_OF_TWO|REGION_OVERFLOW)$/; + next if $name =~ /^(UNIQUE_MEMBERS)$/; + next if $name =~ /^(IS_H5FD_MPIO|IS_H5FD_MPIPOSIX)$/; + next if $name =~ /^addr_defined$/; + + # These functions/macros are exempt. + next if $name =~ /^(main|[fs]?printf|va_(start|arg|end))$/; + + # These are Windows system calls. Ignore them. + next if $name =~ /^(_get_osfhandle|GetFileInformationByHandle|SetFilePointer|GetLastError|SetEndOfFile)$/; + next if $name =~ /^(FindNextFile|FindClose|_tzset|Wgettimeofday|GetSystemTimeAsFileTime|Wgetlogin|GetUserName)$/; + + # These are GPFS function calls. Ignore them. + next if $name =~ /^gpfs_fcntl$/; + + # These are MPI function calls. Ignore them. + next if $name =~ /^(MPI_|MPE_)/; + + # These are POSIX threads function calls. Ignore them. + next if $name =~ /^pthread_/; + + # These are Windows threads function calls. Ignore them. + next if $name =~ /^(_beginthread|(Initialize|Enter|Leave)CriticalSection|TlsAlloc)$/; + + # These are zlib & szlib function calls. Ignore them. + next if $name =~ /^(inflate|SZ_)/; + next if $name =~ /^compress2$/; + + print "$ARGV:$.: $name\n"; + } + + } continue { + close ARGV if eof; # reset line number + } + } } diff --git a/c++/examples/CMakeLists.txt b/c++/examples/CMakeLists.txt index f45251b..dd8e45d 100644 --- a/c++/examples/CMakeLists.txt +++ b/c++/examples/CMakeLists.txt @@ -23,6 +23,7 @@ SET (examples FOREACH (example ${examples}) ADD_EXECUTABLE (cpp_ex_${example} ${HDF5_CPP_EXAMPLES_SOURCE_DIR}/${example}.cpp) TARGET_NAMING (cpp_ex_${example} ${LIB_TYPE}) + TARGET_C_PROPERTIES (cpp_ex_${example} " " " ") TARGET_LINK_LIBRARIES (cpp_ex_${example} ${HDF5_CPP_LIB_TARGET} ${HDF5_LIB_TARGET}) SET_TARGET_PROPERTIES (cpp_ex_${example} PROPERTIES FOLDER examples/cpp) ENDFOREACH (example ${examples}) diff --git a/c++/src/CMakeLists.txt b/c++/src/CMakeLists.txt index fea68cd..e7ae371 100644 --- a/c++/src/CMakeLists.txt +++ b/c++/src/CMakeLists.txt @@ -84,6 +84,7 @@ SET (CPP_HDRS ) ADD_LIBRARY (${HDF5_CPP_LIB_TARGET} ${LIB_TYPE} ${CPP_SRCS} ${CPP_HDRS}) +TARGET_C_PROPERTIES (${HDF5_CPP_LIB_TARGET} " " " ") TARGET_LINK_LIBRARIES (${HDF5_CPP_LIB_TARGET} ${HDF5_LIB_TARGET}) SET_GLOBAL_VARIABLE (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_CPP_LIB_TARGET}") H5_SET_LIB_OPTIONS (${HDF5_CPP_LIB_TARGET} ${HDF5_CPP_LIB_NAME} ${LIB_TYPE}) @@ -96,7 +97,7 @@ INSTALL ( FILES ${CPP_HDRS} DESTINATION - ${HDF5_INSTALL_INCLUDE_DIR}/cpp + ${HDF5_INSTALL_INCLUDE_DIR} COMPONENT cppheaders ) diff --git a/c++/src/H5DxferProp.h b/c++/src/H5DxferProp.h index 66216d8..bf481c3 100644 --- a/c++/src/H5DxferProp.h +++ b/c++/src/H5DxferProp.h @@ -66,12 +66,6 @@ class H5_DLLCPP DSetMemXferPropList : public PropList { void getVlenMemManager( H5MM_allocate_t& alloc, void** alloc_info, H5MM_free_t& free, void** free_info ) const; - // Sets the data transfer property list for the multi-file driver. - void setMulti(const hid_t *memb_dxpl); - - // Returns multi-file data transfer property list information. - void getMulti(hid_t *memb_dxpl); - // Sets the size of a contiguous block reserved for small data. void setSmallDataBlockSize(hsize_t size); @@ -109,3 +103,4 @@ class H5_DLLCPP DSetMemXferPropList : public PropList { } #endif #endif + diff --git a/c++/src/Makefile.in b/c++/src/Makefile.in index 018a4a3..5977e99 100644 --- a/c++/src/Makefile.in +++ b/c++/src/Makefile.in @@ -475,7 +475,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 = 139 +LT_VERS_REVISION = 146 LT_VERS_AGE = 0 # Include src directory diff --git a/c++/src/h5c++.in b/c++/src/h5c++.in index 0f17cf1..4c86c6a 100644 --- a/c++/src/h5c++.in +++ b/c++/src/h5c++.in @@ -122,8 +122,9 @@ usage() { 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" - echo " -noshlib Compile with static HDF5 libraries [default]" + echo " -shlib Compile with shared HDF5 libraries [default when built with" + echo " disable-static]" + echo " -noshlib Compile with static HDF5 libraries [default when static available]" echo " " echo " <compile line> - the normal compile line options for your compiler." echo " $prog_name uses the same compiler you used to compile" @@ -334,20 +335,6 @@ if test "x$do_link" = "xyes"; then if test -n "$flag"; then shared_link="${flag}${libdir}" - # Any libraries in LDFLAGS or H5BLD_LDFLAGS also should have rpaths embedded - # in the executables created by h5cc (reduces need for LD_LIBRARY_PATH). - if test -n "$LDFLAGS"; then - for entry in $LDFLAGS; do - extdir=`echo $entry | sed '/^-L/ s/^-L//'` - shared_link="${shared_link} ${flag}${extdir}" - done - fi - if test -n "$H5BLD_LDFLAGS"; then - for entry in $H5BLD_LDFLAGS; do - extdir=`echo $entry | sed '/^-L/ s/^-L//'` - shared_link="${shared_link} ${flag}${extdir}" - done - fi fi if test "x$USE_SHARED_LIB" != "xyes"; then diff --git a/c++/test/CMakeLists.txt b/c++/test/CMakeLists.txt index 124edb9..b31185e 100644 --- a/c++/test/CMakeLists.txt +++ b/c++/test/CMakeLists.txt @@ -37,6 +37,7 @@ INCLUDE_DIRECTORIES (${HDF5_TEST_SRC_DIR} ) ADD_EXECUTABLE (cpp_testhdf5 ${CPP_TEST_SRCS} ) TARGET_NAMING (cpp_testhdf5 ${LIB_TYPE}) +TARGET_C_PROPERTIES (cpp_testhdf5 " " " ") TARGET_LINK_LIBRARIES (cpp_testhdf5 ${HDF5_CPP_LIB_TARGET} ${HDF5_LIB_TARGET} diff --git a/config/cmake/CTestCustom.cmake b/config/cmake/CTestCustom.cmake index ec7b10e..c16f9a6 100755..100644 --- a/config/cmake/CTestCustom.cmake +++ b/config/cmake/CTestCustom.cmake @@ -1,19 +1,19 @@ -SET (CTEST_CUSTOM_MAXIMUM_NUMBER_OF_WARNINGS 1500) +SET (CTEST_CUSTOM_MAXIMUM_NUMBER_OF_WARNINGS 3000) SET (CTEST_CUSTOM_WARNING_EXCEPTION ${CTEST_CUSTOM_WARNING_EXCEPTION} - "H5detect.c.[0-9]+.[ \t]*:[ \t]*warning C4090:" - "H5detect.c.[0-9]+.[ \t]*:[ \t]*warning:[ \t]*passing argument" - "H5detect.c[0-9 \t:]*warning:[ \t]*passing argument" - "note.*expected.*void.*but argument is of type.*volatile" - "H5Tconv.c[0-9 \t:]*warning:[ \t]*comparison is always false due to limited range of data type" - "H5Ztrans.c.[0-9]+.[ \t]*:[ \t]*warning C4244" - "SZIP.src.*:[ \t]*warning" - "POSIX name for this item is deprecated" +# "H5detect.c.[0-9]+.[ \t]*:[ \t]*warning C4090:" +# "H5detect.c.[0-9]+.[ \t]*:[ \t]*warning:[ \t]*passing argument" +# "H5detect.c[0-9 \t:]*warning:[ \t]*passing argument" +# "note.*expected.*void.*but argument is of type.*volatile" +# "H5Tconv.c[0-9 \t:]*warning:[ \t]*comparison is always false due to limited range of data type" +# "H5Ztrans.c.[0-9]+.[ \t]*:[ \t]*warning C4244" +# "SZIP.src.*:[ \t]*warning" +# "POSIX name for this item is deprecated" "disabling jobserver mode" "config.cmake.xlatefile.c" - "warning.*implicit declaration of function" - "note: expanded from macro" +# "warning.*implicit declaration of function" +# "note: expanded from macro" # "fpp:[ \t]*warning:[ \t]*cannot remove H5_DEBUG_API - not a predefined macro" ) diff --git a/config/cmake/ConfigureChecks.cmake b/config/cmake/ConfigureChecks.cmake index 55a7f58..78fcd7a 100644 --- a/config/cmake/ConfigureChecks.cmake +++ b/config/cmake/ConfigureChecks.cmake @@ -184,14 +184,14 @@ IF (WINDOWS) ENDIF (MINGW) SET (H5_HAVE_LIBWS2_32 1) SET (H5_HAVE_LIBWSOCK32 1) -ENDIF (WINDOWS) -#----------------------------------------------------------------------------- -# 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 -# ---------------------------------------------------------------------------- -SET (H5_FP_TO_ULLONG_RIGHT_MAXIMUM "" CACHE INTERNAL "") + #----------------------------------------------------------------------------- + # 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 + # ---------------------------------------------------------------------------- + SET (H5_FP_TO_ULLONG_RIGHT_MAXIMUM "" CACHE INTERNAL "") +ENDIF (WINDOWS) # ---------------------------------------------------------------------- # END of WINDOWS Hard code Values @@ -206,6 +206,7 @@ ENDIF (CYGWIN) #----------------------------------------------------------------------------- IF (NOT WINDOWS) CHECK_LIBRARY_EXISTS_CONCAT ("m" ceil H5_HAVE_LIBM) + CHECK_LIBRARY_EXISTS_CONCAT ("dl" dlopen H5_HAVE_LIBDL) CHECK_LIBRARY_EXISTS_CONCAT ("ws2_32" WSAStartup H5_HAVE_LIBWS2_32) CHECK_LIBRARY_EXISTS_CONCAT ("wsock32" gethostbyname H5_HAVE_LIBWSOCK32) ENDIF (NOT WINDOWS) @@ -368,6 +369,7 @@ CHECK_INCLUDE_FILE_CONCAT ("sys/types.h" H5_HAVE_SYS_TYPES_H) CHECK_INCLUDE_FILE_CONCAT ("stddef.h" H5_HAVE_STDDEF_H) CHECK_INCLUDE_FILE_CONCAT ("setjmp.h" H5_HAVE_SETJMP_H) CHECK_INCLUDE_FILE_CONCAT ("features.h" H5_HAVE_FEATURES_H) +CHECK_INCLUDE_FILE_CONCAT ("dirent.h" H5_HAVE_DIRENT_H) CHECK_INCLUDE_FILE_CONCAT ("stdint.h" H5_HAVE_STDINT_H) # IF the c compiler found stdint, check the C++ as well. On some systems this @@ -1028,7 +1030,9 @@ H5MiscConversionTest (H5_SIZEOF_LONG_DOUBLE H5_LDOUBLE_TO_INTEGER_ACCURATE "chec # integers except 'unsigned long long'. Other HP-UX systems are unknown # yet. (1/8/05 - SLU) # -H5ConversionTests (H5_LDOUBLE_TO_INTEGER_WORKS "Checking IF converting from long double to integers works") +IF (NOT MSVC) + H5ConversionTests (H5_LDOUBLE_TO_INTEGER_WORKS "Checking IF converting from long double to integers works") +ENDIF (NOT MSVC) # ----------------------------------------------------------------------- # Set flag to indicate that the machine can handle conversion from # integers to long double. (This flag should be set "yes" for all @@ -1102,7 +1106,9 @@ ENDIF (H5_LLONG_TO_FP_CAST_WORKS MATCHES ^H5_LLONG_TO_FP_CAST_WORKS$) # where the last 2 bytes of mantissa are lost when compiler tries to do # the conversion, and Cygwin where compiler doesn't do rounding correctly.) # -H5ConversionTests (H5_ULLONG_TO_LDOUBLE_PRECISION "Checking IF converting unsigned long long to long double with precision") +IF (NOT MSVC) + H5ConversionTests (H5_ULLONG_TO_LDOUBLE_PRECISION "Checking IF converting unsigned long long to long double with precision") +ENDIF (NOT MSVC) # ---------------------------------------------------------------------- # Set the flag to indicate that the machine can handle overflow converting # all floating-point to all integer types. diff --git a/config/cmake/H5pubconf.h.in b/config/cmake/H5pubconf.h.in index d365026..14d48fb 100644 --- a/config/cmake/H5pubconf.h.in +++ b/config/cmake/H5pubconf.h.in @@ -127,6 +127,9 @@ /* Define if the direct I/O virtual file driver should be compiled */ #cmakedefine H5_HAVE_DIRECT @H5_HAVE_DIRECT@ +/* Define to 1 if you have the <dirent.h> header file. */ +#cmakedefine H5_HAVE_DIRENT_H @H5_HAVE_DIRENT_H@ + /* Define to 1 if you have the <dlfcn.h> header file. */ #cmakedefine H5_HAVE_DLFCN_H @H5_HAVE_DLFCN_H@ @@ -233,6 +236,9 @@ /* Define to 1 if you have the <io.h> header file. */ #cmakedefine H5_HAVE_IO_H @H5_HAVE_IO_H@ +/* Define to 1 if you have the `dl' library (-ldl). */ +#cmakedefine H5_HAVE_LIBDL @H5_HAVE_LIBDL@ + /* Define to 1 if you have the `dmalloc' library (-ldmalloc). */ #cmakedefine H5_HAVE_LIBDMALLOC @H5_HAVE_LIBDMALLOC@ diff --git a/config/cmake/HDFMacros.cmake b/config/cmake/HDFMacros.cmake index 099b97f..b0788f2 100644 --- a/config/cmake/HDFMacros.cmake +++ b/config/cmake/HDFMacros.cmake @@ -121,20 +121,67 @@ MACRO (HDF_SET_LIB_OPTIONS libtarget libname libtype) ENDMACRO (HDF_SET_LIB_OPTIONS) #------------------------------------------------------------------------------- -MACRO (TARGET_FORTRAN_WIN_PROPERTIES forttarget addlinkflags) - IF (WIN32 AND MSVC) +MACRO (TARGET_C_PROPERTIES wintarget addcompileflags addlinkflags) + IF (MSVC) + TARGET_MSVC_PROPERTIES (${wintarget} "${addcompileflags} ${WIN_COMPILE_FLAGS}" "${addlinkflags} ${WIN_LINK_FLAGS}") + ELSE (MSVC) + IF (BUILD_SHARED_LIBS) + SET_TARGET_PROPERTIES (${wintarget} + PROPERTIES + COMPILE_FLAGS "${addcompileflags}" + LINK_FLAGS "${addlinkflags}" + ) + ELSE (BUILD_SHARED_LIBS) + SET_TARGET_PROPERTIES (${wintarget} + PROPERTIES + COMPILE_FLAGS "${addcompileflags}" + LINK_FLAGS "${addlinkflags}" + ) + ENDIF (BUILD_SHARED_LIBS) + ENDIF (MSVC) +ENDMACRO (TARGET_C_PROPERTIES) + +#------------------------------------------------------------------------------- +MACRO (TARGET_MSVC_PROPERTIES wintarget addcompileflags addlinkflags) + IF (MSVC) + IF (BUILD_SHARED_LIBS) + SET_TARGET_PROPERTIES (${wintarget} + PROPERTIES + COMPILE_FLAGS "${addcompileflags}" + LINK_FLAGS "${addlinkflags}" + ) + ELSE (BUILD_SHARED_LIBS) + SET_TARGET_PROPERTIES (${wintarget} + PROPERTIES + COMPILE_FLAGS "${addcompileflags}" + LINK_FLAGS "${addlinkflags}" + ) + ENDIF (BUILD_SHARED_LIBS) + ENDIF (MSVC) +ENDMACRO (TARGET_MSVC_PROPERTIES) + +#------------------------------------------------------------------------------- +MACRO (TARGET_FORTRAN_PROPERTIES forttarget addcompileflags addlinkflags) + IF (WIN32) + TARGET_FORTRAN_WIN_PROPERTIES (${forttarget} "${addcompileflags} ${WIN_COMPILE_FLAGS}" "${addlinkflags} ${WIN_LINK_FLAGS}") + ENDIF (WIN32) +ENDMACRO (TARGET_FORTRAN_PROPERTIES) + +#------------------------------------------------------------------------------- +MACRO (TARGET_FORTRAN_WIN_PROPERTIES forttarget addcompileflags addlinkflags) + IF (MSVC) IF (BUILD_SHARED_LIBS) SET_TARGET_PROPERTIES (${forttarget} PROPERTIES - COMPILE_FLAGS "/dll" + COMPILE_FLAGS "/dll ${addcompileflags}" LINK_FLAGS "/SUBSYSTEM:CONSOLE ${addlinkflags}" ) ELSE (BUILD_SHARED_LIBS) SET_TARGET_PROPERTIES (${forttarget} PROPERTIES - COMPILE_FLAGS "/MD" + COMPILE_FLAGS "${addcompileflags}" LINK_FLAGS "/SUBSYSTEM:CONSOLE ${addlinkflags}" ) ENDIF (BUILD_SHARED_LIBS) - ENDIF (WIN32 AND MSVC) + ENDIF (MSVC) ENDMACRO (TARGET_FORTRAN_WIN_PROPERTIES) diff --git a/config/cmake/UserMacros/Windows_MT.cmake b/config/cmake/UserMacros/Windows_MT.cmake new file mode 100644 index 0000000..9be5404 --- /dev/null +++ b/config/cmake/UserMacros/Windows_MT.cmake @@ -0,0 +1,39 @@ +######################################################## +# Include file for user options +######################################################## + +# To use this option, copy both the macro and option code +# into the root UserMacros.cmake file. + +#----------------------------------------------------------------------------- +# Option to Build with Static CRT libraries on Windows +#------------------------------------------------------------------------------- +MACRO (TARGET_STATIC_CRT_FLAGS) + IF (MSVC AND NOT BUILD_SHARED_LIBS) + FOREACH (flag_var + CMAKE_C_FLAGS CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE + CMAKE_C_FLAGS_MINSIZEREL CMAKE_C_FLAGS_RELWITHDEBINFO + CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE + CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO) + IF (${flag_var} MATCHES "/MD") + STRING (REGEX REPLACE "/MD" "/MT" ${flag_var} "${${flag_var}}") + ENDIF (${flag_var} MATCHES "/MD") + ENDFOREACH (flag_var) + FOREACH (flag_var + CMAKE_Fortran_FLAGS CMAKE_Fortran_FLAGS_DEBUG CMAKE_Fortran_FLAGS_RELEASE + CMAKE_Fortran_FLAGS_MINSIZEREL CMAKE_Fortran_FLAGS_RELWITHDEBINFO) + IF (${flag_var} MATCHES "/libs:dll") + STRING (REGEX REPLACE "/libs:dll" "/libs:static" ${flag_var} "${${flag_var}}") + ENDIF (${flag_var} MATCHES "/libs:dll") + ENDFOREACH (flag_var) + SET (WIN_COMPILE_FLAGS "") + SET (WIN_LINK_FLAGS "/NODEFAULTLIB:MSVCRT") + ENDIF (MSVC AND NOT BUILD_SHARED_LIBS) +ENDMACRO (TARGET_STATIC_CRT_FLAGS) + +#----------------------------------------------------------------------------- +OPTION (BUILD_STATIC_CRT_LIBS "Build With Static CRT Libraries" OFF) +IF (BUILD_STATIC_CRT_LIBS) + TARGET_STATIC_CRT_FLAGS () +ENDIF (BUILD_STATIC_CRT_LIBS) +
\ No newline at end of file diff --git a/config/cmake/cacheinit.cmake b/config/cmake/cacheinit.cmake index d45ef9e..43ba754 100755..100644 --- a/config/cmake/cacheinit.cmake +++ b/config/cmake/cacheinit.cmake @@ -62,7 +62,8 @@ SET (HDF5_PACKAGE_EXTLIBS OFF CACHE BOOL "(WINDOWS)CPACK - include external libr SET (HDF5_NO_PACKAGES OFF CACHE BOOL "CPACK - Disable packaging" FORCE)
-SET (HDF5_ALLOW_EXTERNAL_SUPPORT "NO" CACHE STRING "Allow External Library Building" FORCE)
+SET (HDF5_ALLOW_EXTERNAL_SUPPORT "NO" CACHE STRING "Allow External Library Building (NO SVN TGZ)" FORCE)
+SET_PROPERTY(CACHE HDF5_ALLOW_EXTERNAL_SUPPORT PROPERTY STRINGS NO SVN TGZ)
SET (ZLIB_SVN_URL "http://svn.hdfgroup.uiuc.edu/zlib/trunk" CACHE STRING "Use ZLib from HDF repository" FORCE)
diff --git a/config/cmake/hdf5-config.cmake.build.in b/config/cmake/hdf5-config.cmake.build.in index 881985e..fbe97ac 100644 --- a/config/cmake/hdf5-config.cmake.build.in +++ b/config/cmake/hdf5-config.cmake.build.in @@ -18,9 +18,17 @@ SET (HDF5_ENABLE_SZIP_ENCODING @HDF5_ENABLE_SZIP_ENCODING@) SET (HDF5_BUILD_SHARED_LIBS @BUILD_SHARED_LIBS@)
#-----------------------------------------------------------------------------
+# Dependencies
+#-----------------------------------------------------------------------------
+IF(HDF5_ENABLE_PARALLEL)
+ SET(HDF5_MPI_C_INCLUDE_PATH "@MPI_C_INCLUDE_PATH@")
+ SET(HDF5_MPI_C_LIBRARIES "@MPI_C_LIBRARIES@")
+ENDIF(HDF5_ENABLE_PARALLEL)
+
+#-----------------------------------------------------------------------------
# Directories
#-----------------------------------------------------------------------------
-SET (HDF5_INCLUDE_DIR "@HDF5_INCLUDES_BUILD_TIME@")
+SET (HDF5_INCLUDE_DIR "@HDF5_INCLUDES_BUILD_TIME@" "${HDF5_MPI_C_INCLUDE_PATH}" )
IF (HDF5_BUILD_FORTRAN)
SET (HDF5_INCLUDE_DIR_FORTRAN "@CMAKE_Fortran_MODULE_DIRECTORY@" )
diff --git a/config/cmake/hdf5-config.cmake.install.in b/config/cmake/hdf5-config.cmake.install.in index 6b90496..9c5a5a1 100644 --- a/config/cmake/hdf5-config.cmake.install.in +++ b/config/cmake/hdf5-config.cmake.install.in @@ -24,9 +24,17 @@ SET (HDF5_BUILD_SHARED_LIBS @BUILD_SHARED_LIBS@) SET (HDF5_PACKAGE_EXTLIBS @HDF5_PACKAGE_EXTLIBS@)
#-----------------------------------------------------------------------------
+# Dependencies
+#-----------------------------------------------------------------------------
+IF(HDF5_ENABLE_PARALLEL)
+ SET(HDF5_MPI_C_INCLUDE_PATH "@MPI_C_INCLUDE_PATH@")
+ SET(HDF5_MPI_C_LIBRARIES "@MPI_C_LIBRARIES@")
+ENDIF(HDF5_ENABLE_PARALLEL)
+
+#-----------------------------------------------------------------------------
# Directories
#-----------------------------------------------------------------------------
-SET (HDF5_INCLUDE_DIR "${_IMPORT_PREFIX}/include" )
+SET (HDF5_INCLUDE_DIR "${_IMPORT_PREFIX}/include" "${HDF5_MPI_C_INCLUDE_PATH}" )
IF (HDF5_BUILD_FORTRAN)
SET (HDF5_INCLUDE_DIR_FORTRAN "${_IMPORT_PREFIX}/include/fortran" )
diff --git a/config/cmake/mccacheinit.cmake b/config/cmake/mccacheinit.cmake index 8ca3879..8ca3879 100755..100644 --- a/config/cmake/mccacheinit.cmake +++ b/config/cmake/mccacheinit.cmake diff --git a/config/gnu-flags b/config/gnu-flags index 40aa1da..a79cc72 100644 --- a/config/gnu-flags +++ b/config/gnu-flags @@ -186,10 +186,10 @@ esac # the information from the previous version and adding modifications to that. case "$cc_vendor-$cc_version" in -# Closer to the gcc 4.8 release, we should check for additional flags to +# Closer to the gcc 4.9 release, we should check for additional flags to # include and break it out into it's own section, like the other versions # below. -QAK - gcc-4.[78]*) + gcc-4.[89]*) # Replace -ansi flag with -std=c99 flag H5_CFLAGS="`echo $H5_CFLAGS | sed -e 's/-ansi/-std=c99/g'`" @@ -252,7 +252,81 @@ case "$cc_vendor-$cc_version" in H5_CFLAGS="$H5_CFLAGS -Wdouble-promotion -Wsuggest-attribute=const -Wtrampolines" # Append more extra warning flags that only gcc 4.7+ know about - H5_CFLAGS="$H5_CFLAGS -Wstack-usage=8192 -Wvector-operation-performance" + H5_CFLAGS="$H5_CFLAGS -Wstack-usage=8192 -Wvector-operation-performance -Wsuggest-attribute=pure -Wsuggest-attribute=noreturn" + + # Append more extra warning flags that only gcc 4.8+ know about + H5_CFLAGS="$H5_CFLAGS -Wsuggest-attribute=format" + + # Try out the new "stack protector" feature in gcc 4.1 + # (Strictly speaking this isn't really a "warning" flag, so it's added to + # the debugging flags) + #DEBUG_CFLAGS="$DEBUG_CFLAGS -Wstack-protector -fstack-protector-all" + ;; + + gcc-4.7*) + # Replace -ansi flag with -std=c99 flag + H5_CFLAGS="`echo $H5_CFLAGS | sed -e 's/-ansi/-std=c99/g'`" + + # Append warning flags + # Don't use the '-Wtraditional' flag, we're way past having K&R C code + # H5_CFLAGS="$H5_CFLAGS -Wtraditional" + # Don't use the '-Wtraditional-conversion' flag, there's too many warnings + # from GCC's assert macro + # H5_CFLAGS="$H5_CFLAGS -Wtraditional-conversion" + + # Append warning flags from gcc-3* case + # (don't use -Wpadded flag for normal builds, many of the warnings its + # issuing can't be fixed and they are making it hard to detect other, + # more important warnings) + #H5_CFLAGS="$H5_CFLAGS -Wfloat-equal -Wmissing-format-attribute -Wpadded" + H5_CFLAGS="$H5_CFLAGS -Wfloat-equal -Wmissing-format-attribute" + + # Append warning flags from gcc-3.2* case + H5_CFLAGS="$H5_CFLAGS -Wmissing-noreturn -Wpacked -Wdisabled-optimization" + + # Enable more format checking flags, beyond the basic -Wformat included + # in -Wall + H5_CFLAGS="$H5_CFLAGS -Wformat=2" + + # The "unreachable code" warning appears to be reliable now... + # (this warning was removed in gcc 4.5+) + #H5_CFLAGS="$H5_CFLAGS -Wunreachable-code" + + # Append warning flags from gcc-3.3* case + H5_CFLAGS="$H5_CFLAGS -Wendif-labels" + + # Append warning flags from gcc-3.4* case + H5_CFLAGS="$H5_CFLAGS -Wdeclaration-after-statement -Wold-style-definition -Winvalid-pch" + + # Replace old -W flag with new -Wextra flag + H5_CFLAGS="`echo $H5_CFLAGS | sed -e 's/-W\ /-Wextra\ /g'`" + + # Append more extra warning flags that only gcc4.0+ know about + H5_CFLAGS="$H5_CFLAGS -Wvariadic-macros -Winit-self -Wmissing-include-dirs -Wswitch-default -Wswitch-enum -Wunused-macros" + + # Append more extra warning flags that only gcc 4.1+ know about + H5_CFLAGS="$H5_CFLAGS -Wunsafe-loop-optimizations -Wc++-compat" + + # Append more extra warning flags that only gcc 4.2+ know about + H5_CFLAGS="$H5_CFLAGS -Wstrict-overflow" + + # Append more extra warning flags that only gcc 4.3+ know about + # + # Technically, variable-length arrays are part of the C99 standard, but + # we should approach them a bit cautiously... -QAK + H5_CFLAGS="$H5_CFLAGS -Wlogical-op -Wlarger-than=2048 -Wvla" + + # Append more extra warning flags that only gcc 4.4+ know about + H5_CFLAGS="$H5_CFLAGS -Wsync-nand -Wframe-larger-than=16384 -Wpacked-bitfield-compat" + + # Append more extra warning flags that only gcc 4.5+ know about + H5_CFLAGS="$H5_CFLAGS -Wstrict-overflow=5 -Wjump-misses-init -Wunsuffixed-float-constants" + + # Append more extra warning flags that only gcc 4.6+ know about + H5_CFLAGS="$H5_CFLAGS -Wdouble-promotion -Wsuggest-attribute=const -Wtrampolines" + + # Append more extra warning flags that only gcc 4.7+ know about + H5_CFLAGS="$H5_CFLAGS -Wstack-usage=8192 -Wvector-operation-performance -Wsuggest-attribute=pure -Wsuggest-attribute=noreturn" # Try out the new "stack protector" feature in gcc 4.1 # (Strictly speaking this isn't really a "warning" flag, so it's added to @@ -260,9 +334,6 @@ case "$cc_vendor-$cc_version" in #DEBUG_CFLAGS="$DEBUG_CFLAGS -Wstack-protector -fstack-protector-all" ;; -# Closer to the gcc 4.7 release, we should check for additional flags to -# include and break it out into it's own section, like the other versions -# below. -QAK gcc-4.6*) # Replace -ansi flag with -std=c99 flag H5_CFLAGS="`echo $H5_CFLAGS | sed -e 's/-ansi/-std=c99/g'`" diff --git a/config/lt_vers.am b/config/lt_vers.am index 8df77f3..c3ec683 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 = 139 +LT_VERS_REVISION = 146 LT_VERS_AGE = 0 ## If the API changes *at all*, increment LT_VERS_INTERFACE and @@ -1,7 +1,7 @@ #! /bin/sh # From configure.ac Id: configure.ac 22697 2012-08-19 14:35:47Z hdftest . # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for HDF5 1.9.149. +# Generated by GNU Autoconf 2.69 for HDF5 1.9.156. # # Report bugs to <help@hdfgroup.org>. # @@ -591,8 +591,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='HDF5' PACKAGE_TARNAME='hdf5' -PACKAGE_VERSION='1.9.149' -PACKAGE_STRING='HDF5 1.9.149' +PACKAGE_VERSION='1.9.156' +PACKAGE_STRING='HDF5 1.9.156' PACKAGE_BUGREPORT='help@hdfgroup.org' PACKAGE_URL='' @@ -638,6 +638,8 @@ ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS LIBOBJS +HAVE_SHARED_CONDITIONAL_FALSE +HAVE_SHARED_CONDITIONAL_TRUE SETX SEARCH BUILD_HDF5_HL_CONDITIONAL_FALSE @@ -1502,7 +1504,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures HDF5 1.9.149 to adapt to many kinds of systems. +\`configure' configures HDF5 1.9.156 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1572,7 +1574,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of HDF5 1.9.149:";; + short | recursive ) echo "Configuration of HDF5 1.9.156:";; esac cat <<\_ACEOF @@ -1780,7 +1782,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -HDF5 configure 1.9.149 +HDF5 configure 1.9.156 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2874,7 +2876,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by HDF5 $as_me 1.9.149, which was +It was created by HDF5 $as_me 1.9.156, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -3706,7 +3708,7 @@ fi # Define the identity of the package. PACKAGE='hdf5' - VERSION='1.9.149' + VERSION='1.9.156' cat >>confdefs.h <<_ACEOF @@ -5275,6 +5277,7 @@ if test "X$HDF_FORTRAN" = "Xyes"; then ## General Fortran flags ## Only add FFLAGS to FCFLAGS if it's set. if test "x$FFLAGS" != "x" ; then + AM_FCFLAGS="${AM_FCFLAGS} ${FFLAGS}" FCFLAGS="${FCFLAGS} ${FFLAGS}" fi @@ -22279,7 +22282,7 @@ $as_echo "user-defined" >&6; } esac ## ---------------------------------------------------------------------- -## Check for system libraries. +## Check for system libraries. "dl" stands for dynamically loaded library ## { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ceil in -lm" >&5 $as_echo_n "checking for ceil in -lm... " >&6; } @@ -22334,6 +22337,59 @@ _ACEOF fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 +$as_echo_n "checking for dlopen in -ldl... " >&6; } +if ${ac_cv_lib_dl_dlopen+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +#ifdef FC_DUMMY_MAIN +#ifndef FC_DUMMY_MAIN_EQ_F77 +# ifdef __cplusplus + extern "C" +# endif + int FC_DUMMY_MAIN() { return 1; } +#endif +#endif +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dl_dlopen=yes +else + ac_cv_lib_dl_dlopen=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 +$as_echo "$ac_cv_lib_dl_dlopen" >&6; } +if test "x$ac_cv_lib_dl_dlopen" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBDL 1 +_ACEOF + + LIBS="-ldl $LIBS" + +fi + if test "`uname`" = "SunOS" -o "`uname -sr`" = "HP-UX B.11.00"; then ## ...for Solaris @@ -22760,6 +22816,18 @@ fi done +for ac_header in dirent.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "dirent.h" "ac_cv_header_dirent_h" "$ac_includes_default" +if test "x$ac_cv_header_dirent_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_DIRENT_H 1 +_ACEOF + +fi + +done + for ac_header in stdint.h do : ac_fn_c_check_header_mongrel "$LINENO" "stdint.h" "ac_cv_header_stdint_h" "$ac_includes_default" @@ -26306,7 +26374,7 @@ if test "x$ac_cv_header_szlib_h" = xyes; then : _ACEOF HAVE_SZLIB_H="yes" else - CPPFLAGS="$saved_CPPFLAGS"; AM_CPPFLAGS="$saved_AM_CPPFLAGS" unset HAVE_SZIP + CPPFLAGS="$saved_CPPFLAGS"; AM_CPPFLAGS="$saved_AM_CPPFLAGS" unset HAVE_SZLIB fi done @@ -26591,7 +26659,7 @@ fi done - if test "x$HAVE_DMALLOC" = "xyes"; then + if test "x$HAVE_PTHREAD" = "xyes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_self in -lpthread" >&5 $as_echo_n "checking for pthread_self in -lpthread... " >&6; } if ${ac_cv_lib_pthread_pthread_self+:} false; then : @@ -26715,7 +26783,7 @@ done fi - if test "x$HAVE_DMALLOC" = "xyes"; then + if test "x$HAVE_PTHREAD" = "xyes"; then if test -n "$pthread_lib"; then saved_LDFLAGS="$LDFLAGS" saved_AM_LDFLAGS="$AM_LDFLAGS" @@ -31666,8 +31734,8 @@ fi ## Enable strict file format checks ## -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Whether to perform strict file format checks" >&5 -$as_echo_n "checking Whether to perform strict file format checks... " >&6; }; +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to perform strict file format checks" >&5 +$as_echo_n "checking whether to perform strict file format checks... " >&6; }; # Check whether --enable-strict-format-checks was given. if test "${enable_strict_format_checks+set}" = set; then : enableval=$enable_strict_format_checks; STRICT_CHECKS=$enableval @@ -31703,8 +31771,8 @@ esac ## ---------------------------------------------------------------------- ## Enable embedded library information ## -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Whether to have library information embedded in the executables" >&5 -$as_echo_n "checking Whether to have library information embedded in the executables... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to have library information embedded in the executables" >&5 +$as_echo_n "checking whether to have library information embedded in the executables... " >&6; } # Check whether --enable-embedded-libinfo was given. if test "${enable_embedded_libinfo+set}" = set; then : enableval=$enable_embedded_libinfo; enable_embedded_libinfo=$enableval @@ -31900,227 +31968,18 @@ if test -n "$TESTPARALLEL"; then FORTRAN_PARALLEL_MAKE=fortran/$TESTPARALLEL/Makefile fi fi - -ac_config_files="$ac_config_files src/libhdf5.settings Makefile src/Makefile test/Makefile test/testcheck_version.sh test/testerror.sh test/H5srcdir_str.h test/testlibinfo.sh test/testlinks_env.sh testpar/Makefile testpar/testph5.sh perform/Makefile tools/Makefile tools/h5dump/Makefile tools/h5dump/testh5dump.sh tools/h5dump/testh5dumppbits.sh tools/h5dump/testh5dumpxml.sh tools/h5ls/testh5ls.sh tools/h5import/Makefile tools/h5import/h5importtestutil.sh tools/h5diff/Makefile tools/h5diff/testh5diff.sh tools/h5diff/testph5diff.sh tools/h5jam/Makefile tools/h5jam/testh5jam.sh tools/h5repack/Makefile tools/h5repack/h5repack.sh tools/h5ls/Makefile tools/h5copy/Makefile tools/h5copy/testh5copy.sh tools/lib/Makefile tools/misc/Makefile tools/misc/h5cc tools/misc/testh5mkgrp.sh tools/misc/testh5repart.sh tools/h5stat/testh5stat.sh tools/h5stat/Makefile examples/Makefile examples/run-c-ex.sh examples/testh5cc.sh c++/Makefile c++/src/Makefile c++/src/h5c++ c++/test/Makefile c++/test/H5srcdir_str.h c++/examples/Makefile c++/examples/run-c++-ex.sh c++/examples/testh5c++.sh fortran/Makefile fortran/src/h5fc fortran/src/Makefile fortran/test/Makefile fortran/testpar/Makefile fortran/examples/Makefile fortran/examples/run-fortran-ex.sh fortran/examples/testh5fc.sh hl/Makefile hl/src/Makefile hl/test/Makefile hl/test/H5srcdir_str.h hl/tools/Makefile hl/tools/gif2h5/Makefile hl/tools/gif2h5/h52giftest.sh hl/examples/Makefile hl/examples/run-hlc-ex.sh hl/c++/Makefile hl/c++/src/Makefile hl/c++/test/Makefile hl/c++/examples/Makefile hl/c++/examples/run-hlc++-ex.sh hl/fortran/Makefile hl/fortran/src/Makefile hl/fortran/test/Makefile hl/fortran/examples/Makefile hl/fortran/examples/run-hlfortran-ex.sh" - - -cat >confcache <<\_ACEOF -# This file is a shell script that caches the results of configure -# tests run on this system so they can be shared between configure -# scripts and configure runs, see configure's option --config-cache. -# It is not useful on other systems. If it contains results you don't -# want to keep, you may remove or edit it. -# -# config.status only pays attention to the cache file if you give it -# the --recheck option to rerun configure. -# -# `ac_cv_env_foo' variables (set or unset) will be overridden when -# loading this file, other *unset* `ac_cv_foo' will be assigned the -# following values. - -_ACEOF - -# The following way of writing the cache mishandles newlines in values, -# but we know of no workaround that is simple, portable, and efficient. -# So, we kill variables containing newlines. -# Ultrix sh set writes to stderr and can't be redirected directly, -# and sets the high bit in the cache file unless we assign to the vars. -( - for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do - eval ac_val=\$$ac_var - case $ac_val in #( - *${as_nl}*) - case $ac_var in #( - *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 -$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; - esac - case $ac_var in #( - _ | IFS | as_nl) ;; #( - BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( - *) { eval $ac_var=; unset $ac_var;} ;; - esac ;; - esac - done - - (set) 2>&1 | - case $as_nl`(ac_space=' '; set) 2>&1` in #( - *${as_nl}ac_space=\ *) - # `set' does not quote correctly, so add quotes: double-quote - # substitution turns \\\\ into \\, and sed turns \\ into \. - sed -n \ - "s/'/'\\\\''/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" - ;; #( - *) - # `set' quotes correctly as required by POSIX, so do not add quotes. - sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" - ;; - esac | - sort -) | - sed ' - /^ac_cv_env_/b end - t clear - :clear - s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ - t end - s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ - :end' >>confcache -if diff "$cache_file" confcache >/dev/null 2>&1; then :; else - if test -w "$cache_file"; then - if test "x$cache_file" != "x/dev/null"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 -$as_echo "$as_me: updating cache $cache_file" >&6;} - if test ! -f "$cache_file" || test -h "$cache_file"; then - cat confcache >"$cache_file" - else - case $cache_file in #( - */* | ?:*) - mv -f confcache "$cache_file"$$ && - mv -f "$cache_file"$$ "$cache_file" ;; #( - *) - mv -f confcache "$cache_file" ;; - esac - fi - fi - else - { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 -$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} - fi -fi -rm -f confcache - -test "x$prefix" = xNONE && prefix=$ac_default_prefix -# Let make expand exec_prefix. -test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' - -DEFS=-DHAVE_CONFIG_H - -ac_libobjs= -ac_ltlibobjs= -U= -for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue - # 1. Remove the extension, and $U if already installed. - ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' - ac_i=`$as_echo "$ac_i" | sed "$ac_script"` - # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR - # will be set to the directory where LIBOBJS objects are built. - as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" - as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' -done -LIBOBJS=$ac_libobjs - -LTLIBOBJS=$ac_ltlibobjs - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 -$as_echo_n "checking that generated files are newer than configure... " >&6; } - if test -n "$am_sleep_pid"; then - # Hide warnings about reused PIDs. - wait $am_sleep_pid 2>/dev/null - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5 -$as_echo "done" >&6; } - if test -n "$EXEEXT"; then - am__EXEEXT_TRUE= - am__EXEEXT_FALSE='#' -else - am__EXEEXT_TRUE='#' - am__EXEEXT_FALSE= -fi - -if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then - as_fn_error $? "conditional \"MAINTAINER_MODE\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then - as_fn_error $? "conditional \"AMDEP\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then - as_fn_error $? "conditional \"am__fastdepCC\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${FORTRAN_HAVE_SIZEOF_TRUE}" && test -z "${FORTRAN_HAVE_SIZEOF_FALSE}"; then - as_fn_error $? "conditional \"FORTRAN_HAVE_SIZEOF\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${FORTRAN_2003_CONDITIONAL_F_TRUE}" && test -z "${FORTRAN_2003_CONDITIONAL_F_FALSE}"; then - as_fn_error $? "conditional \"FORTRAN_2003_CONDITIONAL_F\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${FORTRAN_DEFAULT_REALisDBLE_F_TRUE}" && test -z "${FORTRAN_DEFAULT_REALisDBLE_F_FALSE}"; then - as_fn_error $? "conditional \"FORTRAN_DEFAULT_REALisDBLE_F\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then - as_fn_error $? "conditional \"am__fastdepCXX\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${FORTRAN_SHARED_CONDITIONAL_TRUE}" && test -z "${FORTRAN_SHARED_CONDITIONAL_FALSE}"; then - as_fn_error $? "conditional \"FORTRAN_SHARED_CONDITIONAL\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${CXX_SHARED_CONDITIONAL_TRUE}" && test -z "${CXX_SHARED_CONDITIONAL_FALSE}"; then - as_fn_error $? "conditional \"CXX_SHARED_CONDITIONAL\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi - -if test -z "${BUILD_SHARED_SZIP_CONDITIONAL_TRUE}" && test -z "${BUILD_SHARED_SZIP_CONDITIONAL_FALSE}"; then - as_fn_error $? "conditional \"BUILD_SHARED_SZIP_CONDITIONAL\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${BUILD_EFF_CONDITIONAL_TRUE}" && test -z "${BUILD_EFF_CONDITIONAL_FALSE}"; then - as_fn_error $? "conditional \"BUILD_EFF_CONDITIONAL\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${DIRECT_VFD_CONDITIONAL_TRUE}" && test -z "${DIRECT_VFD_CONDITIONAL_FALSE}"; then - as_fn_error $? "conditional \"DIRECT_VFD_CONDITIONAL\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${BUILD_ALL_CONDITIONAL_TRUE}" && test -z "${BUILD_ALL_CONDITIONAL_FALSE}"; then - as_fn_error $? "conditional \"BUILD_ALL_CONDITIONAL\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${BUILD_CXX_CONDITIONAL_TRUE}" && test -z "${BUILD_CXX_CONDITIONAL_FALSE}"; then - as_fn_error $? "conditional \"BUILD_CXX_CONDITIONAL\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${BUILD_PARALLEL_CONDITIONAL_TRUE}" && test -z "${BUILD_PARALLEL_CONDITIONAL_FALSE}"; then - as_fn_error $? "conditional \"BUILD_PARALLEL_CONDITIONAL\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${BUILD_FORTRAN_CONDITIONAL_TRUE}" && test -z "${BUILD_FORTRAN_CONDITIONAL_FALSE}"; then - as_fn_error $? "conditional \"BUILD_FORTRAN_CONDITIONAL\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${BUILD_HDF5_HL_CONDITIONAL_TRUE}" && test -z "${BUILD_HDF5_HL_CONDITIONAL_FALSE}"; then - as_fn_error $? "conditional \"BUILD_HDF5_HL_CONDITIONAL\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi - -: "${CONFIG_STATUS=./config.status}" -ac_write_fail=0 -ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files $CONFIG_STATUS" -{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 -$as_echo "$as_me: creating $CONFIG_STATUS" >&6;} +: ${CONFIG_LT=./config.lt} +{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_LT" >&5 +$as_echo "$as_me: creating $CONFIG_LT" >&6;} as_write_fail=0 -cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 +cat >"$CONFIG_LT" <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. -# Run this file to recreate the current configuration. -# Compiler output produced by configure, useful for debugging -# configure, is in config.log if it exists. - -debug=false -ac_cs_recheck=false -ac_cs_silent=false - +# Run this file to recreate a libtool stub with the current configuration. SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF -cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 +cat >>"$CONFIG_LT" <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## @@ -32484,203 +32343,71 @@ as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 -## ----------------------------------- ## -## Main body of $CONFIG_STATUS script. ## -## ----------------------------------- ## +## --------------------------------- ## +## Main body of "$CONFIG_LT" script. ## +## --------------------------------- ## _ASEOF -test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -# Save the log message, to keep $0 and so on meaningful, and to -# report actual input values of CONFIG_FILES etc. instead of their -# values after options handling. -ac_log=" -This file was extended by HDF5 $as_me 1.9.149, which was -generated by GNU Autoconf 2.69. Invocation command line was - - CONFIG_FILES = $CONFIG_FILES - CONFIG_HEADERS = $CONFIG_HEADERS - CONFIG_LINKS = $CONFIG_LINKS - CONFIG_COMMANDS = $CONFIG_COMMANDS - $ $0 $@ - -on `(hostname || uname -n) 2>/dev/null | sed 1q` -" - -_ACEOF - -case $ac_config_files in *" -"*) set x $ac_config_files; shift; ac_config_files=$*;; -esac - -case $ac_config_headers in *" -"*) set x $ac_config_headers; shift; ac_config_headers=$*;; -esac - - -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -# Files that config.status was made for. -config_files="$ac_config_files" -config_headers="$ac_config_headers" -config_commands="$ac_config_commands" - -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -ac_cs_usage="\ -\`$as_me' instantiates files and other configuration actions -from templates according to the current configuration. Unless the files -and actions are specified as TAGs, all are instantiated by default. - -Usage: $0 [OPTION]... [TAG]... - - -h, --help print this help, then exit - -V, --version print version number and configuration settings, then exit - --config print configuration, then exit - -q, --quiet, --silent - do not print progress messages - -d, --debug don't remove temporary files - --recheck update $as_me by reconfiguring in the same conditions - --file=FILE[:TEMPLATE] - instantiate the configuration file FILE - --header=FILE[:TEMPLATE] - instantiate the configuration header FILE +test $as_write_fail = 0 && chmod +x "$CONFIG_LT" -Configuration files: -$config_files +cat >>"$CONFIG_LT" <<\_LTEOF +lt_cl_silent=false +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX +} >&5 -Configuration headers: -$config_headers +lt_cl_help="\ +\`$as_me' creates a local libtool stub from the current configuration, +for use in further configure time tests before the real libtool is +generated. -Configuration commands: -$config_commands +Usage: $0 [OPTIONS] -Report bugs to <help@hdfgroup.org>." + -h, --help print this help, then exit + -V, --version print version number, then exit + -q, --quiet do not print progress messages + -d, --debug don't remove temporary files -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" -ac_cs_version="\\ -HDF5 config.status 1.9.149 -configured by $0, generated by GNU Autoconf 2.69, - with options \\"\$ac_cs_config\\" +Report bugs to <bug-libtool@gnu.org>." -Copyright (C) 2012 Free Software Foundation, Inc. -This config.status script is free software; the Free Software Foundation -gives unlimited permission to copy, distribute and modify it." +lt_cl_version="\ +HDF5 config.lt 1.9.156 +configured by $0, generated by GNU Autoconf 2.69. -ac_pwd='$ac_pwd' -srcdir='$srcdir' -INSTALL='$INSTALL' -MKDIR_P='$MKDIR_P' -AWK='$AWK' -test -n "\$AWK" || AWK=awk -_ACEOF +Copyright (C) 2011 Free Software Foundation, Inc. +This config.lt script is free software; the Free Software Foundation +gives unlimited permision to copy, distribute and modify it." -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -# The default lists apply if the user does not specify any file. -ac_need_defaults=: while test $# != 0 do case $1 in - --*=?*) - ac_option=`expr "X$1" : 'X\([^=]*\)='` - ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` - ac_shift=: - ;; - --*=) - ac_option=`expr "X$1" : 'X\([^=]*\)='` - ac_optarg= - ac_shift=: - ;; - *) - ac_option=$1 - ac_optarg=$2 - ac_shift=shift - ;; - esac - - case $ac_option in - # Handling of the options. - -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) - ac_cs_recheck=: ;; - --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) - $as_echo "$ac_cs_version"; exit ;; - --config | --confi | --conf | --con | --co | --c ) - $as_echo "$ac_cs_config"; exit ;; - --debug | --debu | --deb | --de | --d | -d ) - debug=: ;; - --file | --fil | --fi | --f ) - $ac_shift - case $ac_optarg in - *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; - '') as_fn_error $? "missing file argument" ;; - esac - as_fn_append CONFIG_FILES " '$ac_optarg'" - ac_need_defaults=false;; - --header | --heade | --head | --hea ) - $ac_shift - case $ac_optarg in - *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; - esac - as_fn_append CONFIG_HEADERS " '$ac_optarg'" - ac_need_defaults=false;; - --he | --h) - # Conflict between --help and --header - as_fn_error $? "ambiguous option: \`$1' -Try \`$0 --help' for more information.";; - --help | --hel | -h ) - $as_echo "$ac_cs_usage"; exit ;; - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil | --si | --s) - ac_cs_silent=: ;; - - # This is an error. - -*) as_fn_error $? "unrecognized option: \`$1' -Try \`$0 --help' for more information." ;; + --version | --v* | -V ) + echo "$lt_cl_version"; exit 0 ;; + --help | --h* | -h ) + echo "$lt_cl_help"; exit 0 ;; + --debug | --d* | -d ) + debug=: ;; + --quiet | --q* | --silent | --s* | -q ) + lt_cl_silent=: ;; - *) as_fn_append ac_config_targets " $1" - ac_need_defaults=false ;; + -*) as_fn_error $? "unrecognized option: $1 +Try \`$0 --help' for more information." "$LINENO" 5 ;; + *) as_fn_error $? "unrecognized argument: $1 +Try \`$0 --help' for more information." "$LINENO" 5 ;; esac shift done -ac_configure_extra_args= - -if $ac_cs_silent; then +if $lt_cl_silent; then exec 6>/dev/null - ac_configure_extra_args="$ac_configure_extra_args --silent" fi +_LTEOF -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -if \$ac_cs_recheck; then - set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion - shift - \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 - CONFIG_SHELL='$SHELL' - export CONFIG_SHELL - exec "\$@" -fi - -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -exec 5>>config.log -{ - echo - sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX -## Running $as_me. ## -_ASBOX - $as_echo "$ac_log" -} >&5 - -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -# -# INIT-COMMANDS -# -AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" +cat >>"$CONFIG_LT" <<_LTEOF # The HP-UX ksh and POSIX shell print the target directory to stdout @@ -33144,801 +32871,13 @@ fi +_LTEOF -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 - -# Handling of arguments. -for ac_config_target in $ac_config_targets -do - case $ac_config_target in - "src/H5config.h") CONFIG_HEADERS="$CONFIG_HEADERS src/H5config.h" ;; - "pubconf") CONFIG_COMMANDS="$CONFIG_COMMANDS pubconf" ;; - "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; - "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; - "src/libhdf5.settings") CONFIG_FILES="$CONFIG_FILES src/libhdf5.settings" ;; - "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; - "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; - "test/Makefile") CONFIG_FILES="$CONFIG_FILES test/Makefile" ;; - "test/testcheck_version.sh") CONFIG_FILES="$CONFIG_FILES test/testcheck_version.sh" ;; - "test/testerror.sh") CONFIG_FILES="$CONFIG_FILES test/testerror.sh" ;; - "test/H5srcdir_str.h") CONFIG_FILES="$CONFIG_FILES test/H5srcdir_str.h" ;; - "test/testlibinfo.sh") CONFIG_FILES="$CONFIG_FILES test/testlibinfo.sh" ;; - "test/testlinks_env.sh") CONFIG_FILES="$CONFIG_FILES test/testlinks_env.sh" ;; - "testpar/Makefile") CONFIG_FILES="$CONFIG_FILES testpar/Makefile" ;; - "testpar/testph5.sh") CONFIG_FILES="$CONFIG_FILES testpar/testph5.sh" ;; - "perform/Makefile") CONFIG_FILES="$CONFIG_FILES perform/Makefile" ;; - "tools/Makefile") CONFIG_FILES="$CONFIG_FILES tools/Makefile" ;; - "tools/h5dump/Makefile") CONFIG_FILES="$CONFIG_FILES tools/h5dump/Makefile" ;; - "tools/h5dump/testh5dump.sh") CONFIG_FILES="$CONFIG_FILES tools/h5dump/testh5dump.sh" ;; - "tools/h5dump/testh5dumppbits.sh") CONFIG_FILES="$CONFIG_FILES tools/h5dump/testh5dumppbits.sh" ;; - "tools/h5dump/testh5dumpxml.sh") CONFIG_FILES="$CONFIG_FILES tools/h5dump/testh5dumpxml.sh" ;; - "tools/h5ls/testh5ls.sh") CONFIG_FILES="$CONFIG_FILES tools/h5ls/testh5ls.sh" ;; - "tools/h5import/Makefile") CONFIG_FILES="$CONFIG_FILES tools/h5import/Makefile" ;; - "tools/h5import/h5importtestutil.sh") CONFIG_FILES="$CONFIG_FILES tools/h5import/h5importtestutil.sh" ;; - "tools/h5diff/Makefile") CONFIG_FILES="$CONFIG_FILES tools/h5diff/Makefile" ;; - "tools/h5diff/testh5diff.sh") CONFIG_FILES="$CONFIG_FILES tools/h5diff/testh5diff.sh" ;; - "tools/h5diff/testph5diff.sh") CONFIG_FILES="$CONFIG_FILES tools/h5diff/testph5diff.sh" ;; - "tools/h5jam/Makefile") CONFIG_FILES="$CONFIG_FILES tools/h5jam/Makefile" ;; - "tools/h5jam/testh5jam.sh") CONFIG_FILES="$CONFIG_FILES tools/h5jam/testh5jam.sh" ;; - "tools/h5repack/Makefile") CONFIG_FILES="$CONFIG_FILES tools/h5repack/Makefile" ;; - "tools/h5repack/h5repack.sh") CONFIG_FILES="$CONFIG_FILES tools/h5repack/h5repack.sh" ;; - "tools/h5ls/Makefile") CONFIG_FILES="$CONFIG_FILES tools/h5ls/Makefile" ;; - "tools/h5copy/Makefile") CONFIG_FILES="$CONFIG_FILES tools/h5copy/Makefile" ;; - "tools/h5copy/testh5copy.sh") CONFIG_FILES="$CONFIG_FILES tools/h5copy/testh5copy.sh" ;; - "tools/lib/Makefile") CONFIG_FILES="$CONFIG_FILES tools/lib/Makefile" ;; - "tools/misc/Makefile") CONFIG_FILES="$CONFIG_FILES tools/misc/Makefile" ;; - "tools/misc/h5cc") CONFIG_FILES="$CONFIG_FILES tools/misc/h5cc" ;; - "tools/misc/testh5mkgrp.sh") CONFIG_FILES="$CONFIG_FILES tools/misc/testh5mkgrp.sh" ;; - "tools/misc/testh5repart.sh") CONFIG_FILES="$CONFIG_FILES tools/misc/testh5repart.sh" ;; - "tools/h5stat/testh5stat.sh") CONFIG_FILES="$CONFIG_FILES tools/h5stat/testh5stat.sh" ;; - "tools/h5stat/Makefile") CONFIG_FILES="$CONFIG_FILES tools/h5stat/Makefile" ;; - "examples/Makefile") CONFIG_FILES="$CONFIG_FILES examples/Makefile" ;; - "examples/run-c-ex.sh") CONFIG_FILES="$CONFIG_FILES examples/run-c-ex.sh" ;; - "examples/testh5cc.sh") CONFIG_FILES="$CONFIG_FILES examples/testh5cc.sh" ;; - "c++/Makefile") CONFIG_FILES="$CONFIG_FILES c++/Makefile" ;; - "c++/src/Makefile") CONFIG_FILES="$CONFIG_FILES c++/src/Makefile" ;; - "c++/src/h5c++") CONFIG_FILES="$CONFIG_FILES c++/src/h5c++" ;; - "c++/test/Makefile") CONFIG_FILES="$CONFIG_FILES c++/test/Makefile" ;; - "c++/test/H5srcdir_str.h") CONFIG_FILES="$CONFIG_FILES c++/test/H5srcdir_str.h" ;; - "c++/examples/Makefile") CONFIG_FILES="$CONFIG_FILES c++/examples/Makefile" ;; - "c++/examples/run-c++-ex.sh") CONFIG_FILES="$CONFIG_FILES c++/examples/run-c++-ex.sh" ;; - "c++/examples/testh5c++.sh") CONFIG_FILES="$CONFIG_FILES c++/examples/testh5c++.sh" ;; - "fortran/Makefile") CONFIG_FILES="$CONFIG_FILES fortran/Makefile" ;; - "fortran/src/h5fc") CONFIG_FILES="$CONFIG_FILES fortran/src/h5fc" ;; - "fortran/src/Makefile") CONFIG_FILES="$CONFIG_FILES fortran/src/Makefile" ;; - "fortran/test/Makefile") CONFIG_FILES="$CONFIG_FILES fortran/test/Makefile" ;; - "fortran/testpar/Makefile") CONFIG_FILES="$CONFIG_FILES fortran/testpar/Makefile" ;; - "fortran/examples/Makefile") CONFIG_FILES="$CONFIG_FILES fortran/examples/Makefile" ;; - "fortran/examples/run-fortran-ex.sh") CONFIG_FILES="$CONFIG_FILES fortran/examples/run-fortran-ex.sh" ;; - "fortran/examples/testh5fc.sh") CONFIG_FILES="$CONFIG_FILES fortran/examples/testh5fc.sh" ;; - "hl/Makefile") CONFIG_FILES="$CONFIG_FILES hl/Makefile" ;; - "hl/src/Makefile") CONFIG_FILES="$CONFIG_FILES hl/src/Makefile" ;; - "hl/test/Makefile") CONFIG_FILES="$CONFIG_FILES hl/test/Makefile" ;; - "hl/test/H5srcdir_str.h") CONFIG_FILES="$CONFIG_FILES hl/test/H5srcdir_str.h" ;; - "hl/tools/Makefile") CONFIG_FILES="$CONFIG_FILES hl/tools/Makefile" ;; - "hl/tools/gif2h5/Makefile") CONFIG_FILES="$CONFIG_FILES hl/tools/gif2h5/Makefile" ;; - "hl/tools/gif2h5/h52giftest.sh") CONFIG_FILES="$CONFIG_FILES hl/tools/gif2h5/h52giftest.sh" ;; - "hl/examples/Makefile") CONFIG_FILES="$CONFIG_FILES hl/examples/Makefile" ;; - "hl/examples/run-hlc-ex.sh") CONFIG_FILES="$CONFIG_FILES hl/examples/run-hlc-ex.sh" ;; - "hl/c++/Makefile") CONFIG_FILES="$CONFIG_FILES hl/c++/Makefile" ;; - "hl/c++/src/Makefile") CONFIG_FILES="$CONFIG_FILES hl/c++/src/Makefile" ;; - "hl/c++/test/Makefile") CONFIG_FILES="$CONFIG_FILES hl/c++/test/Makefile" ;; - "hl/c++/examples/Makefile") CONFIG_FILES="$CONFIG_FILES hl/c++/examples/Makefile" ;; - "hl/c++/examples/run-hlc++-ex.sh") CONFIG_FILES="$CONFIG_FILES hl/c++/examples/run-hlc++-ex.sh" ;; - "hl/fortran/Makefile") CONFIG_FILES="$CONFIG_FILES hl/fortran/Makefile" ;; - "hl/fortran/src/Makefile") CONFIG_FILES="$CONFIG_FILES hl/fortran/src/Makefile" ;; - "hl/fortran/test/Makefile") CONFIG_FILES="$CONFIG_FILES hl/fortran/test/Makefile" ;; - "hl/fortran/examples/Makefile") CONFIG_FILES="$CONFIG_FILES hl/fortran/examples/Makefile" ;; - "hl/fortran/examples/run-hlfortran-ex.sh") CONFIG_FILES="$CONFIG_FILES hl/fortran/examples/run-hlfortran-ex.sh" ;; - - *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; - esac -done - - -# If the user did not use the arguments to specify the items to instantiate, -# then the envvar interface is used. Set only those that are not. -# We use the long form for the default assignment because of an extremely -# bizarre bug on SunOS 4.1.3. -if $ac_need_defaults; then - test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files - test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers - test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands -fi - -# Have a temporary directory for convenience. Make it in the build tree -# simply because there is no reason against having it here, and in addition, -# creating and moving files from /tmp can sometimes cause problems. -# Hook for its removal unless debugging. -# Note that there is a small window in which the directory will not be cleaned: -# after its creation but before its name has been assigned to `$tmp'. -$debug || -{ - tmp= ac_tmp= - trap 'exit_status=$? - : "${ac_tmp:=$tmp}" - { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status -' 0 - trap 'as_fn_exit 1' 1 2 13 15 -} -# Create a (secure) tmp directory for tmp files. - -{ - tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && - test -d "$tmp" -} || -{ - tmp=./conf$$-$RANDOM - (umask 077 && mkdir "$tmp") -} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 -ac_tmp=$tmp - -# Set up the scripts for CONFIG_FILES section. -# No need to generate them if there are no CONFIG_FILES. -# This happens for instance with `./config.status config.h'. -if test -n "$CONFIG_FILES"; then - - -ac_cr=`echo X | tr X '\015'` -# On cygwin, bash can eat \r inside `` if the user requested igncr. -# But we know of no other shell where ac_cr would be empty at this -# point, so we can use a bashism as a fallback. -if test "x$ac_cr" = x; then - eval ac_cr=\$\'\\r\' -fi -ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null` -if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then - ac_cs_awk_cr='\\r' -else - ac_cs_awk_cr=$ac_cr -fi - -echo 'BEGIN {' >"$ac_tmp/subs1.awk" && -_ACEOF - - -{ - echo "cat >conf$$subs.awk <<_ACEOF" && - echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && - echo "_ACEOF" -} >conf$$subs.sh || - as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 -ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` -ac_delim='%!_!# ' -for ac_last_try in false false false false false :; do - . ./conf$$subs.sh || - as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 - - ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` - if test $ac_delim_n = $ac_delim_num; then - break - elif $ac_last_try; then - as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 - else - ac_delim="$ac_delim!$ac_delim _$ac_delim!! " - fi -done -rm -f conf$$subs.sh - -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && -_ACEOF -sed -n ' -h -s/^/S["/; s/!.*/"]=/ -p -g -s/^[^!]*!// -:repl -t repl -s/'"$ac_delim"'$// -t delim -:nl -h -s/\(.\{148\}\)..*/\1/ -t more1 -s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ -p -n -b repl -:more1 -s/["\\]/\\&/g; s/^/"/; s/$/"\\/ -p -g -s/.\{148\}// -t nl -:delim -h -s/\(.\{148\}\)..*/\1/ -t more2 -s/["\\]/\\&/g; s/^/"/; s/$/"/ -p -b -:more2 -s/["\\]/\\&/g; s/^/"/; s/$/"\\/ -p -g -s/.\{148\}// -t delim -' <conf$$subs.awk | sed ' -/^[^""]/{ - N - s/\n// -} -' >>$CONFIG_STATUS || ac_write_fail=1 -rm -f conf$$subs.awk -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -_ACAWK -cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && - for (key in S) S_is_set[key] = 1 - FS = "" - -} -{ - line = $ 0 - nfields = split(line, field, "@") - substed = 0 - len = length(field[1]) - for (i = 2; i < nfields; i++) { - key = field[i] - keylen = length(key) - if (S_is_set[key]) { - value = S[key] - line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) - len += length(value) + length(field[++i]) - substed = 1 - } else - len += 1 + keylen - } - - print line -} - -_ACAWK -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then - sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" -else - cat -fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ - || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 -_ACEOF - -# VPATH may cause trouble with some makes, so we remove sole $(srcdir), -# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and -# trailing colons and then remove the whole line if VPATH becomes empty -# (actually we leave an empty line to preserve line numbers). -if test "x$srcdir" = x.; then - ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ -h -s/// -s/^/:/ -s/[ ]*$/:/ -s/:\$(srcdir):/:/g -s/:\${srcdir}:/:/g -s/:@srcdir@:/:/g -s/^:*// -s/:*$// -x -s/\(=[ ]*\).*/\1/ -G -s/\n// -s/^[^=]*=[ ]*$// -}' -fi - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -fi # test -n "$CONFIG_FILES" - -# Set up the scripts for CONFIG_HEADERS section. -# No need to generate them if there are no CONFIG_HEADERS. -# This happens for instance with `./config.status Makefile'. -if test -n "$CONFIG_HEADERS"; then -cat >"$ac_tmp/defines.awk" <<\_ACAWK || -BEGIN { -_ACEOF - -# Transform confdefs.h into an awk script `defines.awk', embedded as -# here-document in config.status, that substitutes the proper values into -# config.h.in to produce config.h. - -# Create a delimiter string that does not exist in confdefs.h, to ease -# handling of long lines. -ac_delim='%!_!# ' -for ac_last_try in false false :; do - ac_tt=`sed -n "/$ac_delim/p" confdefs.h` - if test -z "$ac_tt"; then - break - elif $ac_last_try; then - as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 - else - ac_delim="$ac_delim!$ac_delim _$ac_delim!! " - fi -done - -# For the awk script, D is an array of macro values keyed by name, -# likewise P contains macro parameters if any. Preserve backslash -# newline sequences. - -ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* -sed -n ' -s/.\{148\}/&'"$ac_delim"'/g -t rset -:rset -s/^[ ]*#[ ]*define[ ][ ]*/ / -t def -d -:def -s/\\$// -t bsnl -s/["\\]/\\&/g -s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ -D["\1"]=" \3"/p -s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p -d -:bsnl -s/["\\]/\\&/g -s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ -D["\1"]=" \3\\\\\\n"\\/p -t cont -s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p -t cont -d -:cont -n -s/.\{148\}/&'"$ac_delim"'/g -t clear -:clear -s/\\$// -t bsnlc -s/["\\]/\\&/g; s/^/"/; s/$/"/p -d -:bsnlc -s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p -b cont -' <confdefs.h | sed ' -s/'"$ac_delim"'/"\\\ -"/g' >>$CONFIG_STATUS || ac_write_fail=1 - -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 - for (key in D) D_is_set[key] = 1 - FS = "" -} -/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { - line = \$ 0 - split(line, arg, " ") - if (arg[1] == "#") { - defundef = arg[2] - mac1 = arg[3] - } else { - defundef = substr(arg[1], 2) - mac1 = arg[2] - } - split(mac1, mac2, "(") #) - macro = mac2[1] - prefix = substr(line, 1, index(line, defundef) - 1) - if (D_is_set[macro]) { - # Preserve the white space surrounding the "#". - print prefix "define", macro P[macro] D[macro] - next - } else { - # Replace #undef with comments. This is necessary, for example, - # in the case of _POSIX_SOURCE, which is predefined and required - # on some systems where configure will not decide to define it. - if (defundef == "undef") { - print "/*", prefix defundef, macro, "*/" - next - } - } -} -{ print } -_ACAWK -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 - as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 -fi # test -n "$CONFIG_HEADERS" - - -eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" -shift -for ac_tag -do - case $ac_tag in - :[FHLC]) ac_mode=$ac_tag; continue;; - esac - case $ac_mode$ac_tag in - :[FHL]*:*);; - :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; - :[FH]-) ac_tag=-:-;; - :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; - esac - ac_save_IFS=$IFS - IFS=: - set x $ac_tag - IFS=$ac_save_IFS - shift - ac_file=$1 - shift - - case $ac_mode in - :L) ac_source=$1;; - :[FH]) - ac_file_inputs= - for ac_f - do - case $ac_f in - -) ac_f="$ac_tmp/stdin";; - *) # Look for the file first in the build tree, then in the source tree - # (if the path is not absolute). The absolute path cannot be DOS-style, - # because $ac_f cannot contain `:'. - test -f "$ac_f" || - case $ac_f in - [\\/$]*) false;; - *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; - esac || - as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; - esac - case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac - as_fn_append ac_file_inputs " '$ac_f'" - done - - # Let's still pretend it is `configure' which instantiates (i.e., don't - # use $as_me), people would be surprised to read: - # /* config.h. Generated by config.status. */ - configure_input='Generated from '` - $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' - `' by configure.' - if test x"$ac_file" != x-; then - configure_input="$ac_file. $configure_input" - { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 -$as_echo "$as_me: creating $ac_file" >&6;} - fi - # Neutralize special characters interpreted by sed in replacement strings. - case $configure_input in #( - *\&* | *\|* | *\\* ) - ac_sed_conf_input=`$as_echo "$configure_input" | - sed 's/[\\\\&|]/\\\\&/g'`;; #( - *) ac_sed_conf_input=$configure_input;; - esac - - case $ac_tag in - *:-:* | *:-) cat >"$ac_tmp/stdin" \ - || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; - esac - ;; - esac - - ac_dir=`$as_dirname -- "$ac_file" || -$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$ac_file" : 'X\(//\)[^/]' \| \ - X"$ac_file" : 'X\(//\)$' \| \ - X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$ac_file" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - as_dir="$ac_dir"; as_fn_mkdir_p - ac_builddir=. - -case "$ac_dir" in -.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; -*) - ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` - # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` - case $ac_top_builddir_sub in - "") ac_top_builddir_sub=. ac_top_build_prefix= ;; - *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; - esac ;; -esac -ac_abs_top_builddir=$ac_pwd -ac_abs_builddir=$ac_pwd$ac_dir_suffix -# for backward compatibility: -ac_top_builddir=$ac_top_build_prefix - -case $srcdir in - .) # We are building in place. - ac_srcdir=. - ac_top_srcdir=$ac_top_builddir_sub - ac_abs_top_srcdir=$ac_pwd ;; - [\\/]* | ?:[\\/]* ) # Absolute name. - ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir - ac_abs_top_srcdir=$srcdir ;; - *) # Relative name. - ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_build_prefix$srcdir - ac_abs_top_srcdir=$ac_pwd/$srcdir ;; -esac -ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix - - - case $ac_mode in - :F) - # - # CONFIG_FILE - # - - case $INSTALL in - [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; - *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; - esac - ac_MKDIR_P=$MKDIR_P - case $MKDIR_P in - [\\/$]* | ?:[\\/]* ) ;; - */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; - esac -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -# If the template does not know about datarootdir, expand it. -# FIXME: This hack should be removed a few years after 2.60. -ac_datarootdir_hack=; ac_datarootdir_seen= -ac_sed_dataroot=' -/datarootdir/ { - p - q -} -/@datadir@/p -/@docdir@/p -/@infodir@/p -/@localedir@/p -/@mandir@/p' -case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in -*datarootdir*) ac_datarootdir_seen=yes;; -*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 -$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 - ac_datarootdir_hack=' - s&@datadir@&$datadir&g - s&@docdir@&$docdir&g - s&@infodir@&$infodir&g - s&@localedir@&$localedir&g - s&@mandir@&$mandir&g - s&\\\${datarootdir}&$datarootdir&g' ;; -esac -_ACEOF - -# Neutralize VPATH when `$srcdir' = `.'. -# Shell code in configure.ac might set extrasub. -# FIXME: do we really want to maintain this feature? -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -ac_sed_extra="$ac_vpsub -$extrasub -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -:t -/@[a-zA-Z_][a-zA-Z_0-9]*@/!b -s|@configure_input@|$ac_sed_conf_input|;t t -s&@top_builddir@&$ac_top_builddir_sub&;t t -s&@top_build_prefix@&$ac_top_build_prefix&;t t -s&@srcdir@&$ac_srcdir&;t t -s&@abs_srcdir@&$ac_abs_srcdir&;t t -s&@top_srcdir@&$ac_top_srcdir&;t t -s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t -s&@builddir@&$ac_builddir&;t t -s&@abs_builddir@&$ac_abs_builddir&;t t -s&@abs_top_builddir@&$ac_abs_top_builddir&;t t -s&@INSTALL@&$ac_INSTALL&;t t -s&@MKDIR_P@&$ac_MKDIR_P&;t t -$ac_datarootdir_hack -" -eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ - >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 - -test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && - { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && - { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ - "$ac_tmp/out"`; test -z "$ac_out"; } && - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' -which seems to be undefined. Please make sure it is defined" >&5 -$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' -which seems to be undefined. Please make sure it is defined" >&2;} - - rm -f "$ac_tmp/stdin" - case $ac_file in - -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; - *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; - esac \ - || as_fn_error $? "could not create $ac_file" "$LINENO" 5 - ;; - :H) - # - # CONFIG_HEADER - # - if test x"$ac_file" != x-; then - { - $as_echo "/* $configure_input */" \ - && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" - } >"$ac_tmp/config.h" \ - || as_fn_error $? "could not create $ac_file" "$LINENO" 5 - if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then - { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 -$as_echo "$as_me: $ac_file is unchanged" >&6;} - else - rm -f "$ac_file" - mv "$ac_tmp/config.h" "$ac_file" \ - || as_fn_error $? "could not create $ac_file" "$LINENO" 5 - fi - else - $as_echo "/* $configure_input */" \ - && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ - || as_fn_error $? "could not create -" "$LINENO" 5 - fi -# Compute "$ac_file"'s index in $config_headers. -_am_arg="$ac_file" -_am_stamp_count=1 -for _am_header in $config_headers :; do - case $_am_header in - $_am_arg | $_am_arg:* ) - break ;; - * ) - _am_stamp_count=`expr $_am_stamp_count + 1` ;; - esac -done -echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || -$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$_am_arg" : 'X\(//\)[^/]' \| \ - X"$_am_arg" : 'X\(//\)$' \| \ - X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$_am_arg" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'`/stamp-h$_am_stamp_count - ;; - - :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 -$as_echo "$as_me: executing $ac_file commands" >&6;} - ;; - esac +cat >>"$CONFIG_LT" <<\_LTEOF +{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $ofile" >&5 +$as_echo "$as_me: creating $ofile" >&6;} - case $ac_file$ac_mode in - "pubconf":C) - echo "creating src/H5pubconf.h" - sed 's/#define /#define H5_/' <src/H5config.h |\ - sed 's/#undef /#undef H5_/' >pubconf - if test ! -f src/H5pubconf.h; then - /bin/mv -f pubconf src/H5pubconf.h - elif (diff pubconf src/H5pubconf.h >/dev/null); then - rm -f pubconf - echo "src/H5pubconf.h is unchanged" - else - /bin/mv -f pubconf src/H5pubconf.h - fi - echo "Post process src/libhdf5.settings" - sed '/^#/d' < src/libhdf5.settings > libhdf5.settings.TMP - cp libhdf5.settings.TMP src/libhdf5.settings - rm -f libhdf5.settings.TMP - ;; - "depfiles":C) test x"$AMDEP_TRUE" != x"" || { - # Autoconf 2.62 quotes --file arguments for eval, but not when files - # are listed without --file. Let's play safe and only enable the eval - # if we detect the quoting. - case $CONFIG_FILES in - *\'*) eval set x "$CONFIG_FILES" ;; - *) set x $CONFIG_FILES ;; - esac - shift - for mf - do - # Strip MF so we end up with the name of the file. - mf=`echo "$mf" | sed -e 's/:.*$//'` - # Check whether this is an Automake generated Makefile or not. - # We used to match only the files named 'Makefile.in', but - # some people rename them; so instead we look at the file content. - # Grep'ing the first line is not enough: some people post-process - # each Makefile.in and add a new line on top of each file to say so. - # Grep'ing the whole file is not good either: AIX grep has a line - # limit of 2048, but all sed's we know have understand at least 4000. - if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then - dirpart=`$as_dirname -- "$mf" || -$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$mf" : 'X\(//\)[^/]' \| \ - X"$mf" : 'X\(//\)$' \| \ - X"$mf" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$mf" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - else - continue - fi - # Extract the definition of DEPDIR, am__include, and am__quote - # from the Makefile without running 'make'. - DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` - test -z "$DEPDIR" && continue - am__include=`sed -n 's/^am__include = //p' < "$mf"` - test -z "am__include" && continue - am__quote=`sed -n 's/^am__quote = //p' < "$mf"` - # Find all dependency output files, they are included files with - # $(DEPDIR) in their names. We invoke sed twice because it is the - # simplest approach to changing $(DEPDIR) to its actual value in the - # expansion. - for file in `sed -n " - s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ - sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do - # Make sure the directory exists. - test -f "$dirpart/$file" && continue - fdir=`$as_dirname -- "$file" || -$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$file" : 'X\(//\)[^/]' \| \ - X"$file" : 'X\(//\)$' \| \ - X"$file" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$file" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - as_dir=$dirpart/$fdir; as_fn_mkdir_p - # echo "creating $dirpart/$file" - echo '# dummy' > "$dirpart/$file" - done - done -} - ;; - "libtool":C) - # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then @@ -34889,57 +33828,312 @@ compiler_lib_search_path=$lt_compiler_lib_search_path_FC # ### END LIBTOOL TAG CONFIG: FC _LT_EOF - ;; - esac -done # for ac_tag +as_fn_exit 0 +_LTEOF +chmod +x "$CONFIG_LT" +# configure is writing to config.log, but config.lt does its own redirection, +# appending to config.log, which fails on DOS, as config.log is still kept +# open by configure. Here we exec the FD to /dev/null, effectively closing +# config.log, so it can be properly (re)opened and appended to by config.lt. +lt_cl_success=: +test "$silent" = yes && + lt_config_lt_args="$lt_config_lt_args --quiet" +exec 5>/dev/null +$SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false +exec 5>>config.log +$lt_cl_success || as_fn_exit 1 + +no_create=$saved_no_create + +## Then the stamp2 file for H5config.h +touch ./config/stamp2 + +## Finally the makefiles +test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 + +## Post processing to patch up some deficiencies in libtool +case $host_os in + linux* | freebsd* ) + ## If gcc is not used, need to set $wl to use "-Wl," + if $CC -v 2>&1 | grep '^gcc' > /dev/null ; then + : using gcc + else + echo 'fixing $wl in' $ofile +ed - $ofile <<EOF 2> /dev/null +g/^wl=""/s//wl="-Wl,"/ +w +q +EOF + fi + ;; +esac + +## Are we compiling static libraries, shared libraries, or both? This +## is only used for the libhdf5.settings file. We can't just look at +## $enable_static and $enable_shared because if they're yes the ltconfig +## might have decided that one or the other is simply not possible. +## Therefore we have to ask the generated `libtool' shell script +## which 'features' it has enabled. +if (./libtool --features | grep '^enable shared libraries' > /dev/null); then + enable_shared=yes +else + enable_shared=no +fi + +if (./libtool --features | grep '^enable static libraries' > /dev/null); then + enable_static=yes +else + enable_static=no +fi + +if test "X$enable_static" = "Xyes" && test "X$enable_shared" = "Xyes"; then + STATIC_SHARED="static, shared" +elif test "X$enable_static" = "Xyes"; then + STATIC_SHARED="static" +elif test "X$enable_shared" = "Xyes"; then + STATIC_SHARED="shared" +else + STATIC_SHARED="none" +fi + +## ---------------------------------------------------------------------- +## Set a macro if shared library is enabled. +## + if test "X$enable_shared" = "Xyes"; then + HAVE_SHARED_CONDITIONAL_TRUE= + HAVE_SHARED_CONDITIONAL_FALSE='#' +else + HAVE_SHARED_CONDITIONAL_TRUE='#' + HAVE_SHARED_CONDITIONAL_FALSE= +fi + + +ac_config_files="$ac_config_files src/libhdf5.settings Makefile src/Makefile test/Makefile test/testcheck_version.sh test/testerror.sh test/H5srcdir_str.h test/testlibinfo.sh test/testlinks_env.sh test/test_plugin.sh testpar/Makefile testpar/testph5.sh perform/Makefile tools/Makefile tools/h5dump/Makefile tools/h5dump/testh5dump.sh tools/h5dump/testh5dumppbits.sh tools/h5dump/testh5dumpxml.sh tools/h5ls/testh5ls.sh tools/h5import/Makefile tools/h5import/h5importtestutil.sh tools/h5diff/Makefile tools/h5diff/testh5diff.sh tools/h5diff/testph5diff.sh tools/h5jam/Makefile tools/h5jam/testh5jam.sh tools/h5repack/Makefile tools/h5repack/h5repack.sh tools/h5ls/Makefile tools/h5copy/Makefile tools/h5copy/testh5copy.sh tools/lib/Makefile tools/misc/Makefile tools/misc/h5cc tools/misc/testh5mkgrp.sh tools/misc/testh5repart.sh tools/h5stat/testh5stat.sh tools/h5stat/Makefile examples/Makefile examples/run-c-ex.sh examples/testh5cc.sh c++/Makefile c++/src/Makefile c++/src/h5c++ c++/test/Makefile c++/test/H5srcdir_str.h c++/examples/Makefile c++/examples/run-c++-ex.sh c++/examples/testh5c++.sh fortran/Makefile fortran/src/h5fc fortran/src/Makefile fortran/test/Makefile fortran/testpar/Makefile fortran/examples/Makefile fortran/examples/run-fortran-ex.sh fortran/examples/testh5fc.sh hl/Makefile hl/src/Makefile hl/test/Makefile hl/test/H5srcdir_str.h hl/tools/Makefile hl/tools/gif2h5/Makefile hl/tools/gif2h5/h52giftest.sh hl/examples/Makefile hl/examples/run-hlc-ex.sh hl/c++/Makefile hl/c++/src/Makefile hl/c++/test/Makefile hl/c++/examples/Makefile hl/c++/examples/run-hlc++-ex.sh hl/fortran/Makefile hl/fortran/src/Makefile hl/fortran/test/Makefile hl/fortran/examples/Makefile hl/fortran/examples/run-hlfortran-ex.sh" + + +cat >confcache <<\_ACEOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs, see configure's option --config-cache. +# It is not useful on other systems. If it contains results you don't +# want to keep, you may remove or edit it. +# +# config.status only pays attention to the cache file if you give it +# the --recheck option to rerun configure. +# +# `ac_cv_env_foo' variables (set or unset) will be overridden when +# loading this file, other *unset* `ac_cv_foo' will be assigned the +# following values. -as_fn_exit 0 _ACEOF -ac_clean_files=$ac_clean_files_save -test $ac_write_fail = 0 || - as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, we kill variables containing newlines. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +( + for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + + (set) 2>&1 | + case $as_nl`(ac_space=' '; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + # `set' does not quote correctly, so add quotes: double-quote + # substitution turns \\\\ into \\, and sed turns \\ into \. + sed -n \ + "s/'/'\\\\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" + ;; #( + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) | + sed ' + /^ac_cv_env_/b end + t clear + :clear + s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + t end + s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + :end' >>confcache +if diff "$cache_file" confcache >/dev/null 2>&1; then :; else + if test -w "$cache_file"; then + if test "x$cache_file" != "x/dev/null"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 +$as_echo "$as_me: updating cache $cache_file" >&6;} + if test ! -f "$cache_file" || test -h "$cache_file"; then + cat confcache >"$cache_file" + else + case $cache_file in #( + */* | ?:*) + mv -f confcache "$cache_file"$$ && + mv -f "$cache_file"$$ "$cache_file" ;; #( + *) + mv -f confcache "$cache_file" ;; + esac + fi + fi + else + { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 +$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} + fi +fi +rm -f confcache +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' -# configure is writing to config.log, and then calls config.status. -# config.status does its own redirection, appending to config.log. -# Unfortunately, on DOS this fails, as config.log is still kept open -# by configure, so config.status won't be able to write to it; its -# output is simply discarded. So we exec the FD to /dev/null, -# effectively closing config.log, so it can be properly (re)opened and -# appended to by config.status. When coming back to configure, we -# need to make the FD available again. -if test "$no_create" != yes; then - ac_cs_success=: - ac_config_status_args= - test "$silent" = yes && - ac_config_status_args="$ac_config_status_args --quiet" - exec 5>/dev/null - $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false - exec 5>>config.log - # Use ||, not &&, to avoid exiting from the if with $? = 1, which - # would make configure fail if this is the last instruction. - $ac_cs_success || as_fn_exit 1 +DEFS=-DHAVE_CONFIG_H + +ac_libobjs= +ac_ltlibobjs= +U= +for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue + # 1. Remove the extension, and $U if already installed. + ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' + ac_i=`$as_echo "$ac_i" | sed "$ac_script"` + # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR + # will be set to the directory where LIBOBJS objects are built. + as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" + as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' +done +LIBOBJS=$ac_libobjs + +LTLIBOBJS=$ac_ltlibobjs + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 +$as_echo_n "checking that generated files are newer than configure... " >&6; } + if test -n "$am_sleep_pid"; then + # Hide warnings about reused PIDs. + wait $am_sleep_pid 2>/dev/null + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5 +$as_echo "done" >&6; } + if test -n "$EXEEXT"; then + am__EXEEXT_TRUE= + am__EXEEXT_FALSE='#' +else + am__EXEEXT_TRUE='#' + am__EXEEXT_FALSE= fi -if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 -$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} + +if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then + as_fn_error $? "conditional \"MAINTAINER_MODE\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then + as_fn_error $? "conditional \"AMDEP\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then + as_fn_error $? "conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${FORTRAN_HAVE_SIZEOF_TRUE}" && test -z "${FORTRAN_HAVE_SIZEOF_FALSE}"; then + as_fn_error $? "conditional \"FORTRAN_HAVE_SIZEOF\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${FORTRAN_2003_CONDITIONAL_F_TRUE}" && test -z "${FORTRAN_2003_CONDITIONAL_F_FALSE}"; then + as_fn_error $? "conditional \"FORTRAN_2003_CONDITIONAL_F\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${FORTRAN_DEFAULT_REALisDBLE_F_TRUE}" && test -z "${FORTRAN_DEFAULT_REALisDBLE_F_FALSE}"; then + as_fn_error $? "conditional \"FORTRAN_DEFAULT_REALisDBLE_F\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then + as_fn_error $? "conditional \"am__fastdepCXX\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${FORTRAN_SHARED_CONDITIONAL_TRUE}" && test -z "${FORTRAN_SHARED_CONDITIONAL_FALSE}"; then + as_fn_error $? "conditional \"FORTRAN_SHARED_CONDITIONAL\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${CXX_SHARED_CONDITIONAL_TRUE}" && test -z "${CXX_SHARED_CONDITIONAL_FALSE}"; then + as_fn_error $? "conditional \"CXX_SHARED_CONDITIONAL\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi -: ${CONFIG_LT=./config.lt} -{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_LT" >&5 -$as_echo "$as_me: creating $CONFIG_LT" >&6;} +if test -z "${BUILD_SHARED_SZIP_CONDITIONAL_TRUE}" && test -z "${BUILD_SHARED_SZIP_CONDITIONAL_FALSE}"; then + as_fn_error $? "conditional \"BUILD_SHARED_SZIP_CONDITIONAL\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${BUILD_EFF_CONDITIONAL_TRUE}" && test -z "${BUILD_EFF_CONDITIONAL_FALSE}"; then + as_fn_error $? "conditional \"BUILD_EFF_CONDITIONAL\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${DIRECT_VFD_CONDITIONAL_TRUE}" && test -z "${DIRECT_VFD_CONDITIONAL_FALSE}"; then + as_fn_error $? "conditional \"DIRECT_VFD_CONDITIONAL\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${BUILD_ALL_CONDITIONAL_TRUE}" && test -z "${BUILD_ALL_CONDITIONAL_FALSE}"; then + as_fn_error $? "conditional \"BUILD_ALL_CONDITIONAL\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${BUILD_CXX_CONDITIONAL_TRUE}" && test -z "${BUILD_CXX_CONDITIONAL_FALSE}"; then + as_fn_error $? "conditional \"BUILD_CXX_CONDITIONAL\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${BUILD_PARALLEL_CONDITIONAL_TRUE}" && test -z "${BUILD_PARALLEL_CONDITIONAL_FALSE}"; then + as_fn_error $? "conditional \"BUILD_PARALLEL_CONDITIONAL\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${BUILD_FORTRAN_CONDITIONAL_TRUE}" && test -z "${BUILD_FORTRAN_CONDITIONAL_FALSE}"; then + as_fn_error $? "conditional \"BUILD_FORTRAN_CONDITIONAL\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${BUILD_HDF5_HL_CONDITIONAL_TRUE}" && test -z "${BUILD_HDF5_HL_CONDITIONAL_FALSE}"; then + as_fn_error $? "conditional \"BUILD_HDF5_HL_CONDITIONAL\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HAVE_SHARED_CONDITIONAL_TRUE}" && test -z "${HAVE_SHARED_CONDITIONAL_FALSE}"; then + as_fn_error $? "conditional \"HAVE_SHARED_CONDITIONAL\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi + +: "${CONFIG_STATUS=./config.status}" +ac_write_fail=0 +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files $CONFIG_STATUS" +{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 +$as_echo "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 -cat >"$CONFIG_LT" <<_ASEOF || as_write_fail=1 +cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. -# Run this file to recreate a libtool stub with the current configuration. +# Run this file to recreate the current configuration. +# Compiler output produced by configure, useful for debugging +# configure, is in config.log if it exists. + +debug=false +ac_cs_recheck=false +ac_cs_silent=false + SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF -cat >>"$CONFIG_LT" <<\_ASEOF || as_write_fail=1 +cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## @@ -35303,71 +34497,203 @@ as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 -## --------------------------------- ## -## Main body of "$CONFIG_LT" script. ## -## --------------------------------- ## +## ----------------------------------- ## +## Main body of $CONFIG_STATUS script. ## +## ----------------------------------- ## _ASEOF -test $as_write_fail = 0 && chmod +x "$CONFIG_LT" +test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 -cat >>"$CONFIG_LT" <<\_LTEOF -lt_cl_silent=false -exec 5>>config.log -{ - echo - sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX -## Running $as_me. ## -_ASBOX -} >&5 +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# Save the log message, to keep $0 and so on meaningful, and to +# report actual input values of CONFIG_FILES etc. instead of their +# values after options handling. +ac_log=" +This file was extended by HDF5 $as_me 1.9.156, which was +generated by GNU Autoconf 2.69. Invocation command line was -lt_cl_help="\ -\`$as_me' creates a local libtool stub from the current configuration, -for use in further configure time tests before the real libtool is -generated. + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + $ $0 $@ -Usage: $0 [OPTIONS] +on `(hostname || uname -n) 2>/dev/null | sed 1q` +" - -h, --help print this help, then exit - -V, --version print version number, then exit - -q, --quiet do not print progress messages - -d, --debug don't remove temporary files +_ACEOF -Report bugs to <bug-libtool@gnu.org>." +case $ac_config_files in *" +"*) set x $ac_config_files; shift; ac_config_files=$*;; +esac -lt_cl_version="\ -HDF5 config.lt 1.9.149 -configured by $0, generated by GNU Autoconf 2.69. +case $ac_config_headers in *" +"*) set x $ac_config_headers; shift; ac_config_headers=$*;; +esac -Copyright (C) 2011 Free Software Foundation, Inc. -This config.lt script is free software; the Free Software Foundation -gives unlimited permision to copy, distribute and modify it." +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# Files that config.status was made for. +config_files="$ac_config_files" +config_headers="$ac_config_headers" +config_commands="$ac_config_commands" + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +ac_cs_usage="\ +\`$as_me' instantiates files and other configuration actions +from templates according to the current configuration. Unless the files +and actions are specified as TAGs, all are instantiated by default. + +Usage: $0 [OPTION]... [TAG]... + + -h, --help print this help, then exit + -V, --version print version number and configuration settings, then exit + --config print configuration, then exit + -q, --quiet, --silent + do not print progress messages + -d, --debug don't remove temporary files + --recheck update $as_me by reconfiguring in the same conditions + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + --header=FILE[:TEMPLATE] + instantiate the configuration header FILE + +Configuration files: +$config_files + +Configuration headers: +$config_headers + +Configuration commands: +$config_commands + +Report bugs to <help@hdfgroup.org>." + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" +ac_cs_version="\\ +HDF5 config.status 1.9.156 +configured by $0, generated by GNU Autoconf 2.69, + with options \\"\$ac_cs_config\\" + +Copyright (C) 2012 Free Software Foundation, Inc. +This config.status script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it." + +ac_pwd='$ac_pwd' +srcdir='$srcdir' +INSTALL='$INSTALL' +MKDIR_P='$MKDIR_P' +AWK='$AWK' +test -n "\$AWK" || AWK=awk +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# The default lists apply if the user does not specify any file. +ac_need_defaults=: while test $# != 0 do case $1 in - --version | --v* | -V ) - echo "$lt_cl_version"; exit 0 ;; - --help | --h* | -h ) - echo "$lt_cl_help"; exit 0 ;; - --debug | --d* | -d ) - debug=: ;; - --quiet | --q* | --silent | --s* | -q ) - lt_cl_silent=: ;; + --*=?*) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` + ac_shift=: + ;; + --*=) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg= + ac_shift=: + ;; + *) + ac_option=$1 + ac_optarg=$2 + ac_shift=shift + ;; + esac - -*) as_fn_error $? "unrecognized option: $1 -Try \`$0 --help' for more information." "$LINENO" 5 ;; + case $ac_option in + # Handling of the options. + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + ac_cs_recheck=: ;; + --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) + $as_echo "$ac_cs_version"; exit ;; + --config | --confi | --conf | --con | --co | --c ) + $as_echo "$ac_cs_config"; exit ;; + --debug | --debu | --deb | --de | --d | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + '') as_fn_error $? "missing file argument" ;; + esac + as_fn_append CONFIG_FILES " '$ac_optarg'" + ac_need_defaults=false;; + --header | --heade | --head | --hea ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + as_fn_append CONFIG_HEADERS " '$ac_optarg'" + ac_need_defaults=false;; + --he | --h) + # Conflict between --help and --header + as_fn_error $? "ambiguous option: \`$1' +Try \`$0 --help' for more information.";; + --help | --hel | -h ) + $as_echo "$ac_cs_usage"; exit ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil | --si | --s) + ac_cs_silent=: ;; + + # This is an error. + -*) as_fn_error $? "unrecognized option: \`$1' +Try \`$0 --help' for more information." ;; + + *) as_fn_append ac_config_targets " $1" + ac_need_defaults=false ;; - *) as_fn_error $? "unrecognized argument: $1 -Try \`$0 --help' for more information." "$LINENO" 5 ;; esac shift done -if $lt_cl_silent; then +ac_configure_extra_args= + +if $ac_cs_silent; then exec 6>/dev/null + ac_configure_extra_args="$ac_configure_extra_args --silent" fi -_LTEOF -cat >>"$CONFIG_LT" <<_LTEOF +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +if \$ac_cs_recheck; then + set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + shift + \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 + CONFIG_SHELL='$SHELL' + export CONFIG_SHELL + exec "\$@" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX + $as_echo "$ac_log" +} >&5 + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# +# INIT-COMMANDS +# +AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" # The HP-UX ksh and POSIX shell print the target directory to stdout @@ -35832,13 +35158,802 @@ fi ac_aux_dir='$ac_aux_dir' -_LTEOF -cat >>"$CONFIG_LT" <<\_LTEOF -{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $ofile" >&5 -$as_echo "$as_me: creating $ofile" >&6;} +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + +# Handling of arguments. +for ac_config_target in $ac_config_targets +do + case $ac_config_target in + "src/H5config.h") CONFIG_HEADERS="$CONFIG_HEADERS src/H5config.h" ;; + "pubconf") CONFIG_COMMANDS="$CONFIG_COMMANDS pubconf" ;; + "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; + "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; + "src/libhdf5.settings") CONFIG_FILES="$CONFIG_FILES src/libhdf5.settings" ;; + "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; + "test/Makefile") CONFIG_FILES="$CONFIG_FILES test/Makefile" ;; + "test/testcheck_version.sh") CONFIG_FILES="$CONFIG_FILES test/testcheck_version.sh" ;; + "test/testerror.sh") CONFIG_FILES="$CONFIG_FILES test/testerror.sh" ;; + "test/H5srcdir_str.h") CONFIG_FILES="$CONFIG_FILES test/H5srcdir_str.h" ;; + "test/testlibinfo.sh") CONFIG_FILES="$CONFIG_FILES test/testlibinfo.sh" ;; + "test/testlinks_env.sh") CONFIG_FILES="$CONFIG_FILES test/testlinks_env.sh" ;; + "test/test_plugin.sh") CONFIG_FILES="$CONFIG_FILES test/test_plugin.sh" ;; + "testpar/Makefile") CONFIG_FILES="$CONFIG_FILES testpar/Makefile" ;; + "testpar/testph5.sh") CONFIG_FILES="$CONFIG_FILES testpar/testph5.sh" ;; + "perform/Makefile") CONFIG_FILES="$CONFIG_FILES perform/Makefile" ;; + "tools/Makefile") CONFIG_FILES="$CONFIG_FILES tools/Makefile" ;; + "tools/h5dump/Makefile") CONFIG_FILES="$CONFIG_FILES tools/h5dump/Makefile" ;; + "tools/h5dump/testh5dump.sh") CONFIG_FILES="$CONFIG_FILES tools/h5dump/testh5dump.sh" ;; + "tools/h5dump/testh5dumppbits.sh") CONFIG_FILES="$CONFIG_FILES tools/h5dump/testh5dumppbits.sh" ;; + "tools/h5dump/testh5dumpxml.sh") CONFIG_FILES="$CONFIG_FILES tools/h5dump/testh5dumpxml.sh" ;; + "tools/h5ls/testh5ls.sh") CONFIG_FILES="$CONFIG_FILES tools/h5ls/testh5ls.sh" ;; + "tools/h5import/Makefile") CONFIG_FILES="$CONFIG_FILES tools/h5import/Makefile" ;; + "tools/h5import/h5importtestutil.sh") CONFIG_FILES="$CONFIG_FILES tools/h5import/h5importtestutil.sh" ;; + "tools/h5diff/Makefile") CONFIG_FILES="$CONFIG_FILES tools/h5diff/Makefile" ;; + "tools/h5diff/testh5diff.sh") CONFIG_FILES="$CONFIG_FILES tools/h5diff/testh5diff.sh" ;; + "tools/h5diff/testph5diff.sh") CONFIG_FILES="$CONFIG_FILES tools/h5diff/testph5diff.sh" ;; + "tools/h5jam/Makefile") CONFIG_FILES="$CONFIG_FILES tools/h5jam/Makefile" ;; + "tools/h5jam/testh5jam.sh") CONFIG_FILES="$CONFIG_FILES tools/h5jam/testh5jam.sh" ;; + "tools/h5repack/Makefile") CONFIG_FILES="$CONFIG_FILES tools/h5repack/Makefile" ;; + "tools/h5repack/h5repack.sh") CONFIG_FILES="$CONFIG_FILES tools/h5repack/h5repack.sh" ;; + "tools/h5ls/Makefile") CONFIG_FILES="$CONFIG_FILES tools/h5ls/Makefile" ;; + "tools/h5copy/Makefile") CONFIG_FILES="$CONFIG_FILES tools/h5copy/Makefile" ;; + "tools/h5copy/testh5copy.sh") CONFIG_FILES="$CONFIG_FILES tools/h5copy/testh5copy.sh" ;; + "tools/lib/Makefile") CONFIG_FILES="$CONFIG_FILES tools/lib/Makefile" ;; + "tools/misc/Makefile") CONFIG_FILES="$CONFIG_FILES tools/misc/Makefile" ;; + "tools/misc/h5cc") CONFIG_FILES="$CONFIG_FILES tools/misc/h5cc" ;; + "tools/misc/testh5mkgrp.sh") CONFIG_FILES="$CONFIG_FILES tools/misc/testh5mkgrp.sh" ;; + "tools/misc/testh5repart.sh") CONFIG_FILES="$CONFIG_FILES tools/misc/testh5repart.sh" ;; + "tools/h5stat/testh5stat.sh") CONFIG_FILES="$CONFIG_FILES tools/h5stat/testh5stat.sh" ;; + "tools/h5stat/Makefile") CONFIG_FILES="$CONFIG_FILES tools/h5stat/Makefile" ;; + "examples/Makefile") CONFIG_FILES="$CONFIG_FILES examples/Makefile" ;; + "examples/run-c-ex.sh") CONFIG_FILES="$CONFIG_FILES examples/run-c-ex.sh" ;; + "examples/testh5cc.sh") CONFIG_FILES="$CONFIG_FILES examples/testh5cc.sh" ;; + "c++/Makefile") CONFIG_FILES="$CONFIG_FILES c++/Makefile" ;; + "c++/src/Makefile") CONFIG_FILES="$CONFIG_FILES c++/src/Makefile" ;; + "c++/src/h5c++") CONFIG_FILES="$CONFIG_FILES c++/src/h5c++" ;; + "c++/test/Makefile") CONFIG_FILES="$CONFIG_FILES c++/test/Makefile" ;; + "c++/test/H5srcdir_str.h") CONFIG_FILES="$CONFIG_FILES c++/test/H5srcdir_str.h" ;; + "c++/examples/Makefile") CONFIG_FILES="$CONFIG_FILES c++/examples/Makefile" ;; + "c++/examples/run-c++-ex.sh") CONFIG_FILES="$CONFIG_FILES c++/examples/run-c++-ex.sh" ;; + "c++/examples/testh5c++.sh") CONFIG_FILES="$CONFIG_FILES c++/examples/testh5c++.sh" ;; + "fortran/Makefile") CONFIG_FILES="$CONFIG_FILES fortran/Makefile" ;; + "fortran/src/h5fc") CONFIG_FILES="$CONFIG_FILES fortran/src/h5fc" ;; + "fortran/src/Makefile") CONFIG_FILES="$CONFIG_FILES fortran/src/Makefile" ;; + "fortran/test/Makefile") CONFIG_FILES="$CONFIG_FILES fortran/test/Makefile" ;; + "fortran/testpar/Makefile") CONFIG_FILES="$CONFIG_FILES fortran/testpar/Makefile" ;; + "fortran/examples/Makefile") CONFIG_FILES="$CONFIG_FILES fortran/examples/Makefile" ;; + "fortran/examples/run-fortran-ex.sh") CONFIG_FILES="$CONFIG_FILES fortran/examples/run-fortran-ex.sh" ;; + "fortran/examples/testh5fc.sh") CONFIG_FILES="$CONFIG_FILES fortran/examples/testh5fc.sh" ;; + "hl/Makefile") CONFIG_FILES="$CONFIG_FILES hl/Makefile" ;; + "hl/src/Makefile") CONFIG_FILES="$CONFIG_FILES hl/src/Makefile" ;; + "hl/test/Makefile") CONFIG_FILES="$CONFIG_FILES hl/test/Makefile" ;; + "hl/test/H5srcdir_str.h") CONFIG_FILES="$CONFIG_FILES hl/test/H5srcdir_str.h" ;; + "hl/tools/Makefile") CONFIG_FILES="$CONFIG_FILES hl/tools/Makefile" ;; + "hl/tools/gif2h5/Makefile") CONFIG_FILES="$CONFIG_FILES hl/tools/gif2h5/Makefile" ;; + "hl/tools/gif2h5/h52giftest.sh") CONFIG_FILES="$CONFIG_FILES hl/tools/gif2h5/h52giftest.sh" ;; + "hl/examples/Makefile") CONFIG_FILES="$CONFIG_FILES hl/examples/Makefile" ;; + "hl/examples/run-hlc-ex.sh") CONFIG_FILES="$CONFIG_FILES hl/examples/run-hlc-ex.sh" ;; + "hl/c++/Makefile") CONFIG_FILES="$CONFIG_FILES hl/c++/Makefile" ;; + "hl/c++/src/Makefile") CONFIG_FILES="$CONFIG_FILES hl/c++/src/Makefile" ;; + "hl/c++/test/Makefile") CONFIG_FILES="$CONFIG_FILES hl/c++/test/Makefile" ;; + "hl/c++/examples/Makefile") CONFIG_FILES="$CONFIG_FILES hl/c++/examples/Makefile" ;; + "hl/c++/examples/run-hlc++-ex.sh") CONFIG_FILES="$CONFIG_FILES hl/c++/examples/run-hlc++-ex.sh" ;; + "hl/fortran/Makefile") CONFIG_FILES="$CONFIG_FILES hl/fortran/Makefile" ;; + "hl/fortran/src/Makefile") CONFIG_FILES="$CONFIG_FILES hl/fortran/src/Makefile" ;; + "hl/fortran/test/Makefile") CONFIG_FILES="$CONFIG_FILES hl/fortran/test/Makefile" ;; + "hl/fortran/examples/Makefile") CONFIG_FILES="$CONFIG_FILES hl/fortran/examples/Makefile" ;; + "hl/fortran/examples/run-hlfortran-ex.sh") CONFIG_FILES="$CONFIG_FILES hl/fortran/examples/run-hlfortran-ex.sh" ;; + + *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; + esac +done + + +# If the user did not use the arguments to specify the items to instantiate, +# then the envvar interface is used. Set only those that are not. +# We use the long form for the default assignment because of an extremely +# bizarre bug on SunOS 4.1.3. +if $ac_need_defaults; then + test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files + test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers + test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands +fi + +# Have a temporary directory for convenience. Make it in the build tree +# simply because there is no reason against having it here, and in addition, +# creating and moving files from /tmp can sometimes cause problems. +# Hook for its removal unless debugging. +# Note that there is a small window in which the directory will not be cleaned: +# after its creation but before its name has been assigned to `$tmp'. +$debug || +{ + tmp= ac_tmp= + trap 'exit_status=$? + : "${ac_tmp:=$tmp}" + { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status +' 0 + trap 'as_fn_exit 1' 1 2 13 15 +} +# Create a (secure) tmp directory for tmp files. + +{ + tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && + test -d "$tmp" +} || +{ + tmp=./conf$$-$RANDOM + (umask 077 && mkdir "$tmp") +} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 +ac_tmp=$tmp + +# Set up the scripts for CONFIG_FILES section. +# No need to generate them if there are no CONFIG_FILES. +# This happens for instance with `./config.status config.h'. +if test -n "$CONFIG_FILES"; then + + +ac_cr=`echo X | tr X '\015'` +# On cygwin, bash can eat \r inside `` if the user requested igncr. +# But we know of no other shell where ac_cr would be empty at this +# point, so we can use a bashism as a fallback. +if test "x$ac_cr" = x; then + eval ac_cr=\$\'\\r\' +fi +ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null` +if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then + ac_cs_awk_cr='\\r' +else + ac_cs_awk_cr=$ac_cr +fi + +echo 'BEGIN {' >"$ac_tmp/subs1.awk" && +_ACEOF + + +{ + echo "cat >conf$$subs.awk <<_ACEOF" && + echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && + echo "_ACEOF" +} >conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 +ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` +ac_delim='%!_!# ' +for ac_last_try in false false false false false :; do + . ./conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + + ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` + if test $ac_delim_n = $ac_delim_num; then + break + elif $ac_last_try; then + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done +rm -f conf$$subs.sh + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && +_ACEOF +sed -n ' +h +s/^/S["/; s/!.*/"]=/ +p +g +s/^[^!]*!// +:repl +t repl +s/'"$ac_delim"'$// +t delim +:nl +h +s/\(.\{148\}\)..*/\1/ +t more1 +s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ +p +n +b repl +:more1 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t nl +:delim +h +s/\(.\{148\}\)..*/\1/ +t more2 +s/["\\]/\\&/g; s/^/"/; s/$/"/ +p +b +:more2 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t delim +' <conf$$subs.awk | sed ' +/^[^""]/{ + N + s/\n// +} +' >>$CONFIG_STATUS || ac_write_fail=1 +rm -f conf$$subs.awk +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +_ACAWK +cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && + for (key in S) S_is_set[key] = 1 + FS = "" + +} +{ + line = $ 0 + nfields = split(line, field, "@") + substed = 0 + len = length(field[1]) + for (i = 2; i < nfields; i++) { + key = field[i] + keylen = length(key) + if (S_is_set[key]) { + value = S[key] + line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) + len += length(value) + length(field[++i]) + substed = 1 + } else + len += 1 + keylen + } + + print line +} + +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then + sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" +else + cat +fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ + || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 +_ACEOF + +# VPATH may cause trouble with some makes, so we remove sole $(srcdir), +# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ +h +s/// +s/^/:/ +s/[ ]*$/:/ +s/:\$(srcdir):/:/g +s/:\${srcdir}:/:/g +s/:@srcdir@:/:/g +s/^:*// +s/:*$// +x +s/\(=[ ]*\).*/\1/ +G +s/\n// +s/^[^=]*=[ ]*$// +}' +fi + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +fi # test -n "$CONFIG_FILES" + +# Set up the scripts for CONFIG_HEADERS section. +# No need to generate them if there are no CONFIG_HEADERS. +# This happens for instance with `./config.status Makefile'. +if test -n "$CONFIG_HEADERS"; then +cat >"$ac_tmp/defines.awk" <<\_ACAWK || +BEGIN { +_ACEOF + +# Transform confdefs.h into an awk script `defines.awk', embedded as +# here-document in config.status, that substitutes the proper values into +# config.h.in to produce config.h. + +# Create a delimiter string that does not exist in confdefs.h, to ease +# handling of long lines. +ac_delim='%!_!# ' +for ac_last_try in false false :; do + ac_tt=`sed -n "/$ac_delim/p" confdefs.h` + if test -z "$ac_tt"; then + break + elif $ac_last_try; then + as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done + +# For the awk script, D is an array of macro values keyed by name, +# likewise P contains macro parameters if any. Preserve backslash +# newline sequences. + +ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* +sed -n ' +s/.\{148\}/&'"$ac_delim"'/g +t rset +:rset +s/^[ ]*#[ ]*define[ ][ ]*/ / +t def +d +:def +s/\\$// +t bsnl +s/["\\]/\\&/g +s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ +D["\1"]=" \3"/p +s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p +d +:bsnl +s/["\\]/\\&/g +s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ +D["\1"]=" \3\\\\\\n"\\/p +t cont +s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p +t cont +d +:cont +n +s/.\{148\}/&'"$ac_delim"'/g +t clear +:clear +s/\\$// +t bsnlc +s/["\\]/\\&/g; s/^/"/; s/$/"/p +d +:bsnlc +s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p +b cont +' <confdefs.h | sed ' +s/'"$ac_delim"'/"\\\ +"/g' >>$CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + for (key in D) D_is_set[key] = 1 + FS = "" +} +/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { + line = \$ 0 + split(line, arg, " ") + if (arg[1] == "#") { + defundef = arg[2] + mac1 = arg[3] + } else { + defundef = substr(arg[1], 2) + mac1 = arg[2] + } + split(mac1, mac2, "(") #) + macro = mac2[1] + prefix = substr(line, 1, index(line, defundef) - 1) + if (D_is_set[macro]) { + # Preserve the white space surrounding the "#". + print prefix "define", macro P[macro] D[macro] + next + } else { + # Replace #undef with comments. This is necessary, for example, + # in the case of _POSIX_SOURCE, which is predefined and required + # on some systems where configure will not decide to define it. + if (defundef == "undef") { + print "/*", prefix defundef, macro, "*/" + next + } + } +} +{ print } +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 +fi # test -n "$CONFIG_HEADERS" + + +eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" +shift +for ac_tag +do + case $ac_tag in + :[FHLC]) ac_mode=$ac_tag; continue;; + esac + case $ac_mode$ac_tag in + :[FHL]*:*);; + :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; + :[FH]-) ac_tag=-:-;; + :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; + esac + ac_save_IFS=$IFS + IFS=: + set x $ac_tag + IFS=$ac_save_IFS + shift + ac_file=$1 + shift + + case $ac_mode in + :L) ac_source=$1;; + :[FH]) + ac_file_inputs= + for ac_f + do + case $ac_f in + -) ac_f="$ac_tmp/stdin";; + *) # Look for the file first in the build tree, then in the source tree + # (if the path is not absolute). The absolute path cannot be DOS-style, + # because $ac_f cannot contain `:'. + test -f "$ac_f" || + case $ac_f in + [\\/$]*) false;; + *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; + esac || + as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; + esac + case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac + as_fn_append ac_file_inputs " '$ac_f'" + done + + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + configure_input='Generated from '` + $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' + `' by configure.' + if test x"$ac_file" != x-; then + configure_input="$ac_file. $configure_input" + { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 +$as_echo "$as_me: creating $ac_file" >&6;} + fi + # Neutralize special characters interpreted by sed in replacement strings. + case $configure_input in #( + *\&* | *\|* | *\\* ) + ac_sed_conf_input=`$as_echo "$configure_input" | + sed 's/[\\\\&|]/\\\\&/g'`;; #( + *) ac_sed_conf_input=$configure_input;; + esac + + case $ac_tag in + *:-:* | *:-) cat >"$ac_tmp/stdin" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; + esac + ;; + esac + + ac_dir=`$as_dirname -- "$ac_file" || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + as_dir="$ac_dir"; as_fn_mkdir_p + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + + case $ac_mode in + :F) + # + # CONFIG_FILE + # + + case $INSTALL in + [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; + *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; + esac + ac_MKDIR_P=$MKDIR_P + case $MKDIR_P in + [\\/$]* | ?:[\\/]* ) ;; + */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; + esac +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# If the template does not know about datarootdir, expand it. +# FIXME: This hack should be removed a few years after 2.60. +ac_datarootdir_hack=; ac_datarootdir_seen= +ac_sed_dataroot=' +/datarootdir/ { + p + q +} +/@datadir@/p +/@docdir@/p +/@infodir@/p +/@localedir@/p +/@mandir@/p' +case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in +*datarootdir*) ac_datarootdir_seen=yes;; +*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + ac_datarootdir_hack=' + s&@datadir@&$datadir&g + s&@docdir@&$docdir&g + s&@infodir@&$infodir&g + s&@localedir@&$localedir&g + s&@mandir@&$mandir&g + s&\\\${datarootdir}&$datarootdir&g' ;; +esac +_ACEOF + +# Neutralize VPATH when `$srcdir' = `.'. +# Shell code in configure.ac might set extrasub. +# FIXME: do we really want to maintain this feature? +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_sed_extra="$ac_vpsub +$extrasub +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s|@configure_input@|$ac_sed_conf_input|;t t +s&@top_builddir@&$ac_top_builddir_sub&;t t +s&@top_build_prefix@&$ac_top_build_prefix&;t t +s&@srcdir@&$ac_srcdir&;t t +s&@abs_srcdir@&$ac_abs_srcdir&;t t +s&@top_srcdir@&$ac_top_srcdir&;t t +s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t +s&@builddir@&$ac_builddir&;t t +s&@abs_builddir@&$ac_abs_builddir&;t t +s&@abs_top_builddir@&$ac_abs_top_builddir&;t t +s&@INSTALL@&$ac_INSTALL&;t t +s&@MKDIR_P@&$ac_MKDIR_P&;t t +$ac_datarootdir_hack +" +eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ + >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + +test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && + { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ + "$ac_tmp/out"`; test -z "$ac_out"; } && + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&5 +$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&2;} + + rm -f "$ac_tmp/stdin" + case $ac_file in + -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; + *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; + esac \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + ;; + :H) + # + # CONFIG_HEADER + # + if test x"$ac_file" != x-; then + { + $as_echo "/* $configure_input */" \ + && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" + } >"$ac_tmp/config.h" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then + { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 +$as_echo "$as_me: $ac_file is unchanged" >&6;} + else + rm -f "$ac_file" + mv "$ac_tmp/config.h" "$ac_file" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + fi + else + $as_echo "/* $configure_input */" \ + && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ + || as_fn_error $? "could not create -" "$LINENO" 5 + fi +# Compute "$ac_file"'s index in $config_headers. +_am_arg="$ac_file" +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $_am_arg | $_am_arg:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || +$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$_am_arg" : 'X\(//\)[^/]' \| \ + X"$_am_arg" : 'X\(//\)$' \| \ + X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$_am_arg" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'`/stamp-h$_am_stamp_count + ;; + + :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 +$as_echo "$as_me: executing $ac_file commands" >&6;} + ;; + esac + case $ac_file$ac_mode in + "pubconf":C) + echo "creating src/H5pubconf.h" + sed 's/#define /#define H5_/' <src/H5config.h |\ + sed 's/#undef /#undef H5_/' >pubconf + if test ! -f src/H5pubconf.h; then + /bin/mv -f pubconf src/H5pubconf.h + elif (diff pubconf src/H5pubconf.h >/dev/null); then + rm -f pubconf + echo "src/H5pubconf.h is unchanged" + else + /bin/mv -f pubconf src/H5pubconf.h + fi + echo "Post process src/libhdf5.settings" + sed '/^#/d' < src/libhdf5.settings > libhdf5.settings.TMP + cp libhdf5.settings.TMP src/libhdf5.settings + rm -f libhdf5.settings.TMP + ;; + "depfiles":C) test x"$AMDEP_TRUE" != x"" || { + # Autoconf 2.62 quotes --file arguments for eval, but not when files + # are listed without --file. Let's play safe and only enable the eval + # if we detect the quoting. + case $CONFIG_FILES in + *\'*) eval set x "$CONFIG_FILES" ;; + *) set x $CONFIG_FILES ;; + esac + shift + for mf + do + # Strip MF so we end up with the name of the file. + mf=`echo "$mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile or not. + # We used to match only the files named 'Makefile.in', but + # some people rename them; so instead we look at the file content. + # Grep'ing the first line is not enough: some people post-process + # each Makefile.in and add a new line on top of each file to say so. + # Grep'ing the whole file is not good either: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then + dirpart=`$as_dirname -- "$mf" || +$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$mf" : 'X\(//\)[^/]' \| \ + X"$mf" : 'X\(//\)$' \| \ + X"$mf" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$mf" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + else + continue + fi + # Extract the definition of DEPDIR, am__include, and am__quote + # from the Makefile without running 'make'. + DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` + test -z "$DEPDIR" && continue + am__include=`sed -n 's/^am__include = //p' < "$mf"` + test -z "am__include" && continue + am__quote=`sed -n 's/^am__quote = //p' < "$mf"` + # Find all dependency output files, they are included files with + # $(DEPDIR) in their names. We invoke sed twice because it is the + # simplest approach to changing $(DEPDIR) to its actual value in the + # expansion. + for file in `sed -n " + s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`$as_dirname -- "$file" || +$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$file" : 'X\(//\)[^/]' \| \ + X"$file" : 'X\(//\)$' \| \ + X"$file" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + as_dir=$dirpart/$fdir; as_fn_mkdir_p + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done + done +} + ;; + "libtool":C) + # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then @@ -36789,75 +36904,45 @@ compiler_lib_search_path=$lt_compiler_lib_search_path_FC # ### END LIBTOOL TAG CONFIG: FC _LT_EOF + ;; -as_fn_exit 0 -_LTEOF -chmod +x "$CONFIG_LT" - -# configure is writing to config.log, but config.lt does its own redirection, -# appending to config.log, which fails on DOS, as config.log is still kept -# open by configure. Here we exec the FD to /dev/null, effectively closing -# config.log, so it can be properly (re)opened and appended to by config.lt. -lt_cl_success=: -test "$silent" = yes && - lt_config_lt_args="$lt_config_lt_args --quiet" -exec 5>/dev/null -$SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false -exec 5>>config.log -$lt_cl_success || as_fn_exit 1 + esac +done # for ac_tag -no_create=$saved_no_create -## Then the stamp2 file for H5config.h -touch ./config/stamp2 +as_fn_exit 0 +_ACEOF +ac_clean_files=$ac_clean_files_save -## Finally the makefiles -test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 +test $ac_write_fail = 0 || + as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 -## Post processing to patch up some deficiencies in libtool -case $host_os in - linux* | freebsd* ) - ## If gcc is not used, need to set $wl to use "-Wl," - if $CC -v 2>&1 | grep '^gcc' > /dev/null ; then - : using gcc - else - echo 'fixing $wl in' $ofile -ed - $ofile <<EOF 2> /dev/null -g/^wl=""/s//wl="-Wl,"/ -w -q -EOF - fi - ;; -esac -## Are we compiling static libraries, shared libraries, or both? This -## is only used for the libhdf5.settings file. We can't just look at -## $enable_static and $enable_shared because if they're yes the ltconfig -## might have decided that one or the other is simply not possible. -## Therefore we have to ask the generated `libtool' shell script -## which 'features' it has enabled. -if (./libtool --features | grep '^enable shared libraries' > /dev/null); then - enable_shared=yes -else - enable_shared=no +# configure is writing to config.log, and then calls config.status. +# config.status does its own redirection, appending to config.log. +# Unfortunately, on DOS this fails, as config.log is still kept open +# by configure, so config.status won't be able to write to it; its +# output is simply discarded. So we exec the FD to /dev/null, +# effectively closing config.log, so it can be properly (re)opened and +# appended to by config.status. When coming back to configure, we +# need to make the FD available again. +if test "$no_create" != yes; then + ac_cs_success=: + ac_config_status_args= + test "$silent" = yes && + ac_config_status_args="$ac_config_status_args --quiet" + exec 5>/dev/null + $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false + exec 5>>config.log + # Use ||, not &&, to avoid exiting from the if with $? = 1, which + # would make configure fail if this is the last instruction. + $ac_cs_success || as_fn_exit 1 fi - -if (./libtool --features | grep '^enable static libraries' > /dev/null); then - enable_static=yes -else - enable_static=no +if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 +$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi -if test "X$enable_static" = "Xyes" && test "X$enable_shared" = "Xyes"; then - STATIC_SHARED="static, shared" -elif test "X$enable_static" = "Xyes"; then - STATIC_SHARED="static" -elif test "X$enable_shared" = "Xyes"; then - STATIC_SHARED="shared" -else - STATIC_SHARED="none" -fi chmod 755 tools/misc/h5cc diff --git a/configure.ac b/configure.ac index 25f9efd..811ee69 100644 --- a/configure.ac +++ b/configure.ac @@ -26,7 +26,7 @@ AC_PREREQ([2.69]) ## NOTE: Do not forget to change the version number here when we do a ## release!!! ## -AC_INIT([HDF5], [1.9.149], [help@hdfgroup.org]) +AC_INIT([HDF5], [1.9.156], [help@hdfgroup.org]) AC_CONFIG_SRCDIR([src/H5.c]) AC_CONFIG_HEADER([src/H5config.h]) @@ -437,6 +437,7 @@ if test "X$HDF_FORTRAN" = "Xyes"; then ## General Fortran flags ## Only add FFLAGS to FCFLAGS if it's set. if test "x$FFLAGS" != "x" ; then + AM_FCFLAGS="${AM_FCFLAGS} ${FFLAGS}" FCFLAGS="${FCFLAGS} ${FFLAGS}" fi @@ -1244,9 +1245,10 @@ case "X-$enable_production" in esac ## ---------------------------------------------------------------------- -## Check for system libraries. +## Check for system libraries. "dl" stands for dynamically loaded library ## AC_CHECK_LIB([m], [ceil]) +AC_CHECK_LIB([dl], [dlopen]) if test "`uname`" = "SunOS" -o "`uname -sr`" = "HP-UX B.11.00"; then ## ...for Solaris @@ -1276,6 +1278,7 @@ AC_CHECK_FUNCS([clock_gettime],[have_clock_gettime="yes"],[have_clock_gettime="n AC_CHECK_HEADERS([sys/resource.h sys/time.h unistd.h sys/ioctl.h sys/stat.h]) AC_CHECK_HEADERS([sys/socket.h sys/types.h]) AC_CHECK_HEADERS([stddef.h setjmp.h features.h]) +AC_CHECK_HEADERS([dirent.h]) AC_CHECK_HEADERS([stdint.h], [C9x=yes]) ## Darwin @@ -2001,7 +2004,7 @@ case $withval in AC_CHECK_HEADERS([szlib.h], [HAVE_SZLIB_H="yes"], - [CPPFLAGS="$saved_CPPFLAGS"; AM_CPPFLAGS="$saved_AM_CPPFLAGS"] [unset HAVE_SZIP]) + [CPPFLAGS="$saved_CPPFLAGS"; AM_CPPFLAGS="$saved_AM_CPPFLAGS"] [unset HAVE_SZLIB]) if test -n "$szlib_lib"; then LDFLAGS="$LDFLAGS -L$szlib_lib" @@ -2095,7 +2098,7 @@ AC_ARG_WITH([pthread], case "$withval" in yes) AC_CHECK_HEADERS([pthread.h],, [unset HAVE_PTHREAD]) - if test "x$HAVE_DMALLOC" = "xyes"; then + if test "x$HAVE_PTHREAD" = "xyes"; then AC_CHECK_LIB([pthread], [pthread_self],, [unset HAVE_PTHREAD]) fi ;; @@ -2137,7 +2140,7 @@ case "$withval" in AC_CHECK_HEADERS([pthread.h],, [unset HAVE_PTHREAD]) fi - if test "x$HAVE_DMALLOC" = "xyes"; then + if test "x$HAVE_PTHREAD" = "xyes"; then if test -n "$pthread_lib"; then saved_LDFLAGS="$LDFLAGS" saved_AM_LDFLAGS="$AM_LDFLAGS" @@ -4463,7 +4466,7 @@ fi ## Enable strict file format checks ## AC_SUBST([STRICT_FORMAT_CHECKS]) -AC_MSG_CHECKING([Whether to perform strict file format checks]); +AC_MSG_CHECKING([whether to perform strict file format checks]); AC_ARG_ENABLE([strict-format-checks], [AS_HELP_STRING([--enable-strict-format-checks], [Enable strict file format checks, default=yes if @@ -4496,7 +4499,7 @@ esac ## ---------------------------------------------------------------------- ## Enable embedded library information ## -AC_MSG_CHECKING([Whether to have library information embedded in the executables]) +AC_MSG_CHECKING([whether to have library information embedded in the executables]) AC_ARG_ENABLE([embedded-libinfo], [AS_HELP_STRING([--enable-embedded-libinfo], [Enable embedded library information [default=yes]])], @@ -4623,6 +4626,64 @@ if test -n "$TESTPARALLEL"; then FORTRAN_PARALLEL_MAKE=fortran/$TESTPARALLEL/Makefile fi fi +LT_OUTPUT +no_create=$saved_no_create + +## Then the stamp2 file for H5config.h +touch ./config/stamp2 + +## Finally the makefiles +test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 + +## Post processing to patch up some deficiencies in libtool +case $host_os in + linux* | freebsd* ) + ## If gcc is not used, need to set $wl to use "-Wl," + if $CC -v 2>&1 | grep '^gcc' > /dev/null ; then + : using gcc + else + echo 'fixing $wl in' $ofile +ed - $ofile <<EOF 2> /dev/null +g/^wl=""/s//wl="-Wl,"/ +w +q +EOF + fi + ;; +esac + +## Are we compiling static libraries, shared libraries, or both? This +## is only used for the libhdf5.settings file. We can't just look at +## $enable_static and $enable_shared because if they're yes the ltconfig +## might have decided that one or the other is simply not possible. +## Therefore we have to ask the generated `libtool' shell script +## which 'features' it has enabled. +if (./libtool --features | grep '^enable shared libraries' > /dev/null); then + enable_shared=yes +else + enable_shared=no +fi + +if (./libtool --features | grep '^enable static libraries' > /dev/null); then + enable_static=yes +else + enable_static=no +fi + +if test "X$enable_static" = "Xyes" && test "X$enable_shared" = "Xyes"; then + STATIC_SHARED="static, shared" +elif test "X$enable_static" = "Xyes"; then + STATIC_SHARED="static" +elif test "X$enable_shared" = "Xyes"; then + STATIC_SHARED="shared" +else + STATIC_SHARED="none" +fi + +## ---------------------------------------------------------------------- +## Set a macro if shared library is enabled. +## +AM_CONDITIONAL([HAVE_SHARED_CONDITIONAL], [test "X$enable_shared" = "Xyes"]) AC_CONFIG_FILES([src/libhdf5.settings Makefile @@ -4633,6 +4694,7 @@ AC_CONFIG_FILES([src/libhdf5.settings test/H5srcdir_str.h test/testlibinfo.sh test/testlinks_env.sh + test/test_plugin.sh testpar/Makefile testpar/testph5.sh perform/Makefile @@ -4701,59 +4763,6 @@ AC_CONFIG_FILES([src/libhdf5.settings hl/fortran/examples/run-hlfortran-ex.sh]) AC_OUTPUT -LT_OUTPUT -no_create=$saved_no_create - -## Then the stamp2 file for H5config.h -touch ./config/stamp2 - -## Finally the makefiles -test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 - -## Post processing to patch up some deficiencies in libtool -case $host_os in - linux* | freebsd* ) - ## If gcc is not used, need to set $wl to use "-Wl," - if $CC -v 2>&1 | grep '^gcc' > /dev/null ; then - : using gcc - else - echo 'fixing $wl in' $ofile -ed - $ofile <<EOF 2> /dev/null -g/^wl=""/s//wl="-Wl,"/ -w -q -EOF - fi - ;; -esac - -## Are we compiling static libraries, shared libraries, or both? This -## is only used for the libhdf5.settings file. We can't just look at -## $enable_static and $enable_shared because if they're yes the ltconfig -## might have decided that one or the other is simply not possible. -## Therefore we have to ask the generated `libtool' shell script -## which 'features' it has enabled. -if (./libtool --features | grep '^enable shared libraries' > /dev/null); then - enable_shared=yes -else - enable_shared=no -fi - -if (./libtool --features | grep '^enable static libraries' > /dev/null); then - enable_static=yes -else - enable_static=no -fi - -if test "X$enable_static" = "Xyes" && test "X$enable_shared" = "Xyes"; then - STATIC_SHARED="static, shared" -elif test "X$enable_static" = "Xyes"; then - STATIC_SHARED="static" -elif test "X$enable_shared" = "Xyes"; then - STATIC_SHARED="shared" -else - STATIC_SHARED="none" -fi chmod 755 tools/misc/h5cc diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index bd96062..2940c74 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -40,6 +40,7 @@ SET (examples FOREACH (example ${examples}) ADD_EXECUTABLE (${example} ${HDF5_EXAMPLES_SOURCE_DIR}/${example}.c) TARGET_NAMING (${example} ${LIB_TYPE}) + TARGET_C_PROPERTIES (${example} " " " ") TARGET_LINK_LIBRARIES (${example} ${HDF5_LIB_TARGET}) SET_TARGET_PROPERTIES (${example} PROPERTIES FOLDER examples) ENDFOREACH (example ${examples}) @@ -47,6 +48,7 @@ ENDFOREACH (example ${examples}) IF (H5_HAVE_PARALLEL) ADD_EXECUTABLE (ph5example ${HDF5_EXAMPLES_SOURCE_DIR}/ph5example.c) TARGET_NAMING (ph5example ${LIB_TYPE}) + TARGET_C_PROPERTIES (ph5example " " " ") TARGET_LINK_LIBRARIES (ph5example ${HDF5_LIB_TARGET}) SET_TARGET_PROPERTIES (ph5example PROPERTIES FOLDER examples) ENDIF (H5_HAVE_PARALLEL) diff --git a/examples/h5_external_log_native_vol.c b/examples/h5_external_log_native_vol.c index 024a115..a61fdac 100644 --- a/examples/h5_external_log_native_vol.c +++ b/examples/h5_external_log_native_vol.c @@ -2,7 +2,6 @@ #include <stdio.h>
#include <stdlib.h>
#include <assert.h>
-#include "mpi.h"
#include "hdf5.h"
#define LOG 502
@@ -58,6 +57,7 @@ static const H5VL_class_t H5VL_log_g = { NULL, //H5VL_log_attr_open, /* open */
NULL, //H5VL_log_attr_read, /* read */
NULL, //H5VL_log_attr_write, /* write */
+ NULL, //H5VL_log_attr_iterate,
NULL, //H5VL_log_attr_get, /* get */
NULL, //H5VL_log_attr_remove, /* remove */
NULL //H5VL_log_attr_close /* close */
@@ -66,6 +66,7 @@ static const H5VL_class_t H5VL_log_g = { H5VL_log_datatype_commit, /* commit */
H5VL_log_datatype_open, /* open */
H5VL_log_datatype_get_binary, /* get_size */
+ NULL,//H5VL_log_datatype_get
H5VL_log_datatype_close /* close */
},
{ /* dataset_cls */
@@ -162,8 +163,6 @@ int main(int argc, char **argv) { char name[25];
static hsize_t ds_size[2] = {10, 20};
- MPI_Init(&argc, &argv);
-
under_fapl = H5Pcreate (H5P_FILE_ACCESS);
H5Pset_fapl_native(under_fapl);
vol_id = H5VLregister (&H5VL_log_g);
@@ -184,7 +183,7 @@ int main(int argc, char **argv) { printf ("DT COMMIT name = %s %d\n", name, len);
H5Tclose(int_id);
- int_id = H5Topen(file_id, "int", H5P_DEFAULT);
+ int_id = H5Topen2(file_id, "int", H5P_DEFAULT);
len = H5VLget_plugin_name(int_id, name, 50);
printf ("DT OPEN name = %s %d\n", name, len);
H5Tclose(int_id);
@@ -205,7 +204,7 @@ int main(int argc, char **argv) { space = H5Screate_simple (2, ds_size, ds_size);
sprintf(fullpath,"%s/%s",group_name,dataset_name);
- datasetId = H5Dcreate(file_id,fullpath,H5T_NATIVE_INT,dataspaceId,H5P_DEFAULT,H5P_DEFAULT,H5P_DEFAULT);
+ datasetId = H5Dcreate2(file_id,fullpath,H5T_NATIVE_INT,dataspaceId,H5P_DEFAULT,H5P_DEFAULT,H5P_DEFAULT);
H5Sclose(dataspaceId);
len = H5VLget_plugin_name(datasetId, name, 50);
@@ -245,7 +244,6 @@ int main(int argc, char **argv) { H5Pclose(under_fapl);
H5VLunregister (vol_id);
- MPI_Finalize();
return 0;
}
diff --git a/examples/test_client.c b/examples/test_client.c index 0d46e0c..74abac2 100644 --- a/examples/test_client.c +++ b/examples/test_client.c @@ -251,7 +251,7 @@ int main(int argc, char **argv) { the data in the buffer is in BE byte order. Type conversion will
happen at the server when we detect that the dataset type is of
LE order and the datatype here is in BE order. */
- ret = H5Dwrite_ff(did3, H5T_STD_I32BE, dataspaceId, dataspaceId, H5P_DEFAULT, data3,
+ ret = H5Dwrite_ff(did3, H5T_STD_I16BE, dataspaceId, dataspaceId, H5P_DEFAULT, data3,
0, event_q);
assert(ret == 0);
@@ -457,9 +457,7 @@ int main(int argc, char **argv) { for(i=0;i<nelem;++i)
fprintf(stderr, "%d ",r_data[i]);
fprintf(stderr, "\n");
-
fprintf(stderr, "Checksum Receieved = %u Checksum Computed = %u (Should be Equal)\n", read1_cs, cs);
- assert(read1_cs == cs);
/* Print the data that has been read with an injected fault,
This should print the array similar to the previous one, but with the
@@ -468,8 +466,9 @@ int main(int argc, char **argv) { for(i=0;i<nelem;++i)
fprintf(stderr, "%d ",r2_data[i]);
fprintf(stderr, "\n");
-
fprintf(stderr, "Checksum Receieved = %u Checksum Computed = %u (Should NOT be Equal)\n", read2_cs, cs);
+
+ assert(read1_cs == cs);
assert(read2_cs != cs);
fprintf(stderr, "\n*****************************************************************************************************************\n");
@@ -627,8 +626,8 @@ int main(int argc, char **argv) { fprintf(stderr, "Close all open objects then Wait for events in EQ\n");
fprintf(stderr, "*****************************************************************************************************************\n");
- assert(H5Aclose(aid2) == 0);
assert(H5Tclose(int_id) == 0);
+ assert(H5Aclose(aid2) == 0);
assert(H5Gclose(gid1) == 0);
assert(H5Fclose(file_id) == 0);
diff --git a/examples/test_client_acg.c b/examples/test_client_acg.c index c4b2340..c22517f 100644 --- a/examples/test_client_acg.c +++ b/examples/test_client_acg.c @@ -68,6 +68,81 @@ int main(int argc, char **argv) { file_id = H5Fcreate_ff(file_name, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id, event_q);
assert(file_id);
+#if 0
+ {
+ int r_data[60], r2_data[60];
+ hid_t did1;
+ unsigned read1_cs, read2_cs, cs=448091133;
+
+
+ /* create a dataspace. This is a local Bookeeping operation that
+ does not touch the file */
+ dim = 60;
+ sid = H5Screate_simple(1, &dim, NULL);
+
+ did1 = H5Dcreate_ff(file_id,"D1",H5T_STD_I32LE,sid,
+ H5P_DEFAULT,H5P_DEFAULT,H5P_DEFAULT, 0, event_q);
+ assert(did1);
+
+ dxpl_id = H5Pcreate (H5P_DATASET_XFER);
+ H5Pset_dxpl_checksum_ptr(dxpl_id, &read1_cs);
+ ret = H5Dread_ff(did1, H5T_STD_I32LE, sid, sid, dxpl_id, r_data,
+ 0, event_q);
+ assert(ret == 0);
+ H5Pclose(dxpl_id);
+
+ /*
+ if(H5EQpop(event_q, &req1) < 0)
+ exit(1);
+ assert(H5AOtest(req1, &status1) == 0);
+ (status1 == H5AO_PENDING) ? fprintf(stderr, "Read is still pending\n") : fprintf(stderr, "Read has completed\n");
+ */
+
+ dxpl_id = H5Pcreate (H5P_DATASET_XFER);
+ H5Pset_dxpl_inject_corruption(dxpl_id, 1);
+ H5Pset_dxpl_checksum_ptr(dxpl_id, &read2_cs);
+ ret = H5Dread_ff(did1, H5T_STD_I32LE, sid, sid, dxpl_id, r2_data,
+ 0, event_q);
+ assert(ret == 0);
+ H5Pclose(dxpl_id);
+
+ if(H5EQpop(event_q, &req1) < 0)
+ exit(1);
+ assert(H5AOtest(req1, &status1) == 0);
+ (status1 == H5AO_PENDING) ? fprintf(stderr, "Read is still pending\n") : fprintf(stderr, "Read has completed\n");
+
+ if(H5AO_PENDING == status1) {
+ assert(H5AOwait(req1, &status1) == 0);
+ assert (status1);
+ }
+ else
+ assert(H5AO_SUCCEEDED == status1);
+
+ assert(H5Dclose_ff(did1, event_q) == 0);
+ assert(H5Fclose_ff(file_id, event_q) == 0);
+
+ H5EQwait(event_q, &num_requests, &status);
+
+ fprintf(stderr, "Printing After Waiting ");
+ for(i=0;i<60;++i)
+ fprintf(stderr, "%d ",r_data[i]);
+ fprintf(stderr, "\n");
+ fprintf(stderr, "Checksum Receieved = %u Checksum Computed = %u (Should be Equal)\n", read1_cs, cs);
+
+ fprintf(stderr, "Printing Corrupted Data ");
+ for(i=0;i<60;++i)
+ fprintf(stderr, "%d ",r2_data[i]);
+ fprintf(stderr, "\n");
+ fprintf(stderr, "Checksum Receieved = %u Checksum Computed = %u (Should NOT be Equal)\n", read2_cs, cs);
+
+ assert(read1_cs == cs);
+ assert(read2_cs != cs);
+
+ H5Sclose(sid);
+ }
+#endif
+
+#if 1
/* Create 1-D dataspace */
dim = 0;
max_dim = H5S_UNLIMITED;
@@ -146,6 +221,7 @@ int main(int argc, char **argv) { for(u = 0; u < 60; u++)
if(read_elem[u] != write_elem[u])
return 1;
+#endif
fprintf(stderr, "\n*****************************************************************************************************************\n");
fprintf(stderr, "Finalize EFF stack\n");
diff --git a/fortran/examples/CMakeLists.txt b/fortran/examples/CMakeLists.txt index 0536183..e514a6e 100644 --- a/fortran/examples/CMakeLists.txt +++ b/fortran/examples/CMakeLists.txt @@ -41,7 +41,7 @@ SET (F2003_examples FOREACH (example ${examples}) ADD_EXECUTABLE (f90_ex_${example} ${HDF5_F90_EXAMPLES_SOURCE_DIR}/${example}.f90) TARGET_NAMING (f90_ex_${example} ${LIB_TYPE}) - TARGET_FORTRAN_WIN_PROPERTIES (f90_ex_${example} "") + TARGET_FORTRAN_PROPERTIES (f90_ex_${example} " " " ") IF (WIN32 AND NOT CYGWIN) SET_PROPERTY (TARGET f90_ex_${example} APPEND PROPERTY COMPILE_DEFINITIONS @@ -69,7 +69,7 @@ IF (HDF5_ENABLE_F2003) FOREACH (example ${F2003_examples}) ADD_EXECUTABLE (f03_ex_${example} ${HDF5_F90_EXAMPLES_SOURCE_DIR}/${example}.f90) TARGET_NAMING (f03_ex_${example} ${LIB_TYPE}) - TARGET_FORTRAN_WIN_PROPERTIES (f03_ex_${example} "") + TARGET_FORTRAN_PROPERTIES (f03_ex_${example} " " " ") IF (WIN32 AND NOT CYGWIN) SET_PROPERTY (TARGET f03_ex_${example} APPEND PROPERTY COMPILE_DEFINITIONS HDF5F90_WINDOWS @@ -95,7 +95,7 @@ ENDIF (HDF5_ENABLE_F2003) IF (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) ADD_EXECUTABLE (f90_ex_ph5example ${HDF5_F90_EXAMPLES_SOURCE_DIR}/ph5example.f90) TARGET_NAMING (f90_ex_ph5example ${LIB_TYPE}) - TARGET_FORTRAN_WIN_PROPERTIES (f90_ex_ph5example "") + TARGET_FORTRAN_PROPERTIES (f90_ex_ph5example " " " ") IF (WIN32 AND NOT CYGWIN) SET_PROPERTY (TARGET f90_ex_ph5example APPEND PROPERTY COMPILE_DEFINITIONS diff --git a/fortran/src/CMakeLists.txt b/fortran/src/CMakeLists.txt index c41916a..5d8c2d5 100644 --- a/fortran/src/CMakeLists.txt +++ b/fortran/src/CMakeLists.txt @@ -133,6 +133,7 @@ SET (f90CStub_C_HDRS ) ADD_LIBRARY (${HDF5_F90_C_LIB_TARGET} ${LIB_TYPE} ${f90CStub_C_SRCS} ${f90CStub_C_HDRS}) +TARGET_C_PROPERTIES (${HDF5_F90_C_LIB_TARGET} " " " ") TARGET_LINK_LIBRARIES (${HDF5_F90_C_LIB_TARGET} ${HDF5_LIB_TARGET} ${LINK_LIBS}) SET_GLOBAL_VARIABLE (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_F90_C_LIB_TARGET}") H5_SET_LIB_OPTIONS (${HDF5_F90_C_LIB_TARGET} ${HDF5_F90_C_LIB_NAME} ${LIB_TYPE}) @@ -233,7 +234,7 @@ IF (WIN32 AND NOT CYGWIN) HDF5F90_WINDOWS ) ENDIF (WIN32 AND NOT CYGWIN) -TARGET_FORTRAN_WIN_PROPERTIES (${HDF5_F90_LIB_TARGET} ${SHARED_LINK_FLAGS}) +TARGET_FORTRAN_PROPERTIES (${HDF5_F90_LIB_TARGET} " " ${SHARED_LINK_FLAGS}) 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}) IF (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) @@ -254,7 +255,7 @@ INSTALL ( ${HDF5_F90_BINARY_DIR}/H5f90i_gen.h ${HDF5_F90_BINARY_DIR}/H5fortran_types.f90 DESTINATION - ${HDF5_INSTALL_INCLUDE_DIR}/fortran + ${HDF5_INSTALL_INCLUDE_DIR} COMPONENT fortheaders ) @@ -264,7 +265,7 @@ IF (WIN32 AND NOT CYGWIN) DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/\${BUILD_TYPE}/ DESTINATION - ${HDF5_INSTALL_INCLUDE_DIR}/fortran + ${HDF5_INSTALL_INCLUDE_DIR} COMPONENT fortheaders ) @@ -273,7 +274,7 @@ ELSE (WIN32 AND NOT CYGWIN) DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/ DESTINATION - ${HDF5_INSTALL_INCLUDE_DIR}/fortran + ${HDF5_INSTALL_INCLUDE_DIR} COMPONENT fortheaders ) diff --git a/fortran/src/H5Off.f90 b/fortran/src/H5Off.f90 index 1437e9f..8a40079 100644 --- a/fortran/src/H5Off.f90 +++ b/fortran/src/H5Off.f90 @@ -191,7 +191,7 @@ CONTAINS SUBROUTINE h5oclose_f(object_id, hdferr) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: object_id - INTEGER , INTENT(OUT) :: hdferr + INTEGER , INTENT(OUT) :: hdferr !***** INTERFACE INTEGER FUNCTION h5oclose_c(object_id) @@ -565,7 +565,7 @@ CONTAINS ! obj_id - Object identifier. ! ! Outputs: -! hdferr - Returns 0 if successful and -1 if fails. +! hdferr - Returns 0 if successful and -1 if fails. ! ! AUTHOR ! M. Scot Breitenfeld @@ -717,16 +717,16 @@ CONTAINS ! Sets comment for specified object. ! ! Inputs: -! loc_id - Identifier of a file, group, dataset, or named datatype. -! name - Name of the object whose comment is to be set or reset, +! loc_id - Identifier of a file, group, dataset, or named datatype. +! name - Name of the object whose comment is to be set or reset, ! specified as a path relative to loc_id. -! comment - The new comment. +! comment - The new comment. ! ! Outputs: -! hdferr - Returns 0 if successful and -1 if fails. +! hdferr - Returns 0 if successful and -1 if fails. ! ! Optional parameters: -! lapl_id - Link access property list identifier. +! lapl_id - Link access property list identifier. ! ! AUTHOR ! M. Scot Breitenfeld diff --git a/fortran/src/Makefile.in b/fortran/src/Makefile.in index 1497b2d..db93992 100644 --- a/fortran/src/Makefile.in +++ b/fortran/src/Makefile.in @@ -526,7 +526,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 = 139 +LT_VERS_REVISION = 146 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 37f7c71..d052046 100644 --- a/fortran/src/h5fc.in +++ b/fortran/src/h5fc.in @@ -118,8 +118,9 @@ usage() { 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" - echo " -noshlib Compile with static HDF5 libraries [default]" + echo " -shlib Compile with shared HDF5 libraries [default when built with" + echo " disable-static]" + echo " -noshlib Compile with static HDF5 libraries [default when static available]" echo " " echo " <compile line> - the normal compile line options for your compiler." echo " $prog_name uses the same compiler you used to compile" @@ -316,20 +317,6 @@ if test "x$do_link" = "xyes"; then if test -n "$flag"; then shared_link="${flag}${libdir}" - # Any libraries in LDFLAGS or H5BLD_LDFLAGS also should have rpaths embedded - # in the executables created by h5cc (reduces need for LD_LIBRARY_PATH). - if test -n "$LDFLAGS"; then - for entry in $LDFLAGS; do - extdir=`echo $entry | sed '/^-L/ s/^-L//'` - shared_link="${shared_link} ${flag}${extdir}" - done - fi - if test -n "$H5BLD_LDFLAGS"; then - for entry in $H5BLD_LDFLAGS; do - extdir=`echo $entry | sed '/^-L/ s/^-L//'` - shared_link="${shared_link} ${flag}${extdir}" - done - fi fi if test "x$USE_SHARED_LIB" != "xyes"; then diff --git a/fortran/test/CMakeLists.txt b/fortran/test/CMakeLists.txt index 5b9ca11..72f239e 100644 --- a/fortran/test/CMakeLists.txt +++ b/fortran/test/CMakeLists.txt @@ -10,6 +10,7 @@ INCLUDE_DIRECTORIES (${CMAKE_Fortran_MODULE_DIRECTORY} ${HDF5_F90_BINARY_DIR} ${ # Add Test Lib #----------------------------------------------------------------------------- ADD_LIBRARY (${HDF5_F90_C_TEST_LIB_TARGET} ${LIB_TYPE} t.c) +TARGET_C_PROPERTIES (${HDF5_F90_C_TEST_LIB_TARGET} " " " ") TARGET_LINK_LIBRARIES (${HDF5_F90_C_TEST_LIB_TARGET} ${HDF5_F90_C_LIB_TARGET} ${HDF5_TEST_LIB_TARGET} @@ -28,7 +29,7 @@ IF (WIN32 AND NOT CYGWIN) ENDIF (BUILD_SHARED_LIBS) SET_PROPERTY (TARGET ${HDF5_F90_TEST_LIB_TARGET} APPEND PROPERTY COMPILE_DEFINITIONS HDF5F90_WINDOWS) ENDIF (WIN32 AND NOT CYGWIN) -TARGET_FORTRAN_WIN_PROPERTIES (${HDF5_F90_TEST_LIB_TARGET} ${SHARED_LINK_FLAGS}) +TARGET_FORTRAN_PROPERTIES (${HDF5_F90_TEST_LIB_TARGET} " " ${SHARED_LINK_FLAGS}) 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} @@ -60,7 +61,7 @@ ADD_EXECUTABLE (testhdf5_fortran tH5Z.f90 ) TARGET_NAMING (testhdf5_fortran ${LIB_TYPE}) -TARGET_FORTRAN_WIN_PROPERTIES (testhdf5_fortran "") +TARGET_FORTRAN_PROPERTIES (testhdf5_fortran " " " ") TARGET_LINK_LIBRARIES (testhdf5_fortran ${HDF5_F90_TEST_LIB_TARGET} ${HDF5_F90_LIB_TARGET} @@ -84,7 +85,7 @@ ADD_EXECUTABLE (testhdf5_fortran_1_8 tH5G_1_8.f90 ) TARGET_NAMING (testhdf5_fortran_1_8 ${LIB_TYPE}) -TARGET_FORTRAN_WIN_PROPERTIES (testhdf5_fortran_1_8 "") +TARGET_FORTRAN_PROPERTIES (testhdf5_fortran_1_8 " " " ") TARGET_LINK_LIBRARIES (testhdf5_fortran_1_8 ${HDF5_F90_TEST_LIB_TARGET} ${HDF5_F90_LIB_TARGET} @@ -112,7 +113,7 @@ IF (HDF5_ENABLE_F2003) tH5T_F03.f90 ) TARGET_NAMING (fortranlib_test_F03 ${LIB_TYPE}) - TARGET_FORTRAN_WIN_PROPERTIES (fortranlib_test_F03 "") + TARGET_FORTRAN_PROPERTIES (fortranlib_test_F03 " " " ") TARGET_LINK_LIBRARIES (fortranlib_test_F03 ${HDF5_F90_TEST_LIB_TARGET} ${HDF5_F90_LIB_TARGET} @@ -131,7 +132,7 @@ ENDIF (HDF5_ENABLE_F2003) #-- Adding test for fflush1 ADD_EXECUTABLE (fflush1 fflush1.f90) TARGET_NAMING (fflush1 ${LIB_TYPE}) -TARGET_FORTRAN_WIN_PROPERTIES (fflush1 "") +TARGET_FORTRAN_PROPERTIES (fflush1 " " " ") TARGET_LINK_LIBRARIES (fflush1 ${HDF5_F90_LIB_TARGET} ${HDF5_F90_TEST_LIB_TARGET} @@ -148,7 +149,7 @@ ADD_TEST (NAME fflush1 COMMAND $<TARGET_FILE:fflush1>) #-- Adding test for fflush2 ADD_EXECUTABLE (fflush2 fflush2.f90) TARGET_NAMING (fflush2 ${LIB_TYPE}) -TARGET_FORTRAN_WIN_PROPERTIES (fflush2 "") +TARGET_FORTRAN_PROPERTIES (fflush2 " " " ") TARGET_LINK_LIBRARIES (fflush2 ${HDF5_F90_TEST_LIB_TARGET} ${HDF5_F90_LIB_TARGET} diff --git a/fortran/test/tH5O.f90 b/fortran/test/tH5O.f90 index b68e7ca..ea91631 100644 --- a/fortran/test/tH5O.f90 +++ b/fortran/test/tH5O.f90 @@ -535,7 +535,7 @@ SUBROUTINE test_h5o_link(total_error) ! close the datatype CALL h5tclose_f(tid, error) - CALL check("h5tclose_f",error) + CALL check("h5tclose_f",error, total_error) CALL h5ocopy_f(file_id, NAME_DATATYPE_SIMPLE, file_id, NAME_DATATYPE_SIMPLE2, error) CALL check("h5ocopy_f",error,total_error) diff --git a/fortran/test/tH5T_F03.f90 b/fortran/test/tH5T_F03.f90 index f7efcc4..a9a6487 100644 --- a/fortran/test/tH5T_F03.f90 +++ b/fortran/test/tH5T_F03.f90 @@ -3137,10 +3137,15 @@ SUBROUTINE t_enum_conv(total_error) ! Enumerated data array ! Some values are out of range for testing. The library should accept them - INTEGER(KIND(E1_RED)), DIMENSION(1:20), TARGET :: data1 = (/E1_RED, E1_GREEN, E1_BLUE, E1_GREEN, E1_WHITE,& - E1_WHITE, E1_BLACK, E1_GREEN, E1_BLUE, E1_RED,& - E1_RED, E1_BLUE, E1_GREEN, E1_BLACK, E1_WHITE,& - E1_RED, E1_WHITE, INT(0,KIND(E1_RED)), INT(-1,KIND(E1_RED)), INT(-2,KIND(E1_RED))/) + INTEGER(KIND(E1_RED)), DIMENSION(1:20), TARGET :: data1 = (/INT(E1_RED,KIND(E1_RED)), & + INT(E1_GREEN,KIND(E1_RED)), INT(E1_BLUE,KIND(E1_RED)), & + INT(E1_GREEN,KIND(E1_RED)), INT(E1_WHITE,KIND(E1_RED)), & + INT(E1_WHITE,KIND(E1_RED)), INT(E1_BLACK,KIND(E1_RED)), & + INT(E1_GREEN,KIND(E1_RED)), INT(E1_BLUE,KIND(E1_RED)), & + INT(E1_RED,KIND(E1_RED)), INT(E1_RED,KIND(E1_RED)), INT(E1_BLUE,KIND(E1_RED)), & + INT(E1_GREEN,KIND(E1_RED)), INT(E1_BLACK,KIND(E1_RED)), INT(E1_WHITE,KIND(E1_RED)),& + INT(E1_RED,KIND(E1_RED)), INT(E1_WHITE,KIND(E1_RED)), & + INT(0,KIND(E1_RED)), INT(-1,KIND(E1_RED)), INT(-2,KIND(E1_RED))/) ! Reading array for enum data INTEGER(KIND(E1_RED)), DIMENSION(1:20), TARGET :: data2 diff --git a/fortran/test/tf.f90 b/fortran/test/tf.f90 index 1060747..4f73fda 100644 --- a/fortran/test/tf.f90 +++ b/fortran/test/tf.f90 @@ -115,7 +115,7 @@ END SUBROUTINE verify !This definition is needed for Windows DLLs !DEC$if defined(BUILD_HDF5_DLL) -!DEC$attributes dllexport :: verify +!DEC$attributes dllexport :: verify_Fortran_INTEGER_4 !DEC$endif SUBROUTINE verify_Fortran_INTEGER_4(string,value,correct_value,total_error) USE HDF5 @@ -129,9 +129,6 @@ SUBROUTINE verify_Fortran_INTEGER_4(string,value,correct_value,total_error) RETURN END SUBROUTINE verify_Fortran_INTEGER_4 - - - !This definition is needed for Windows DLLs !DEC$if defined(BUILD_HDF5_DLL) !DEC$attributes dllexport :: verifyLogical @@ -151,7 +148,7 @@ END SUBROUTINE verifyLogical !DEC$if defined(BUILD_HDF5_DLL) !DEC$attributes dllexport :: verifyString !DEC$endif -SUBROUTINE verifystring(string, value,correct_value,total_error) +SUBROUTINE verifyString(string, value,correct_value,total_error) CHARACTER*(*) :: string CHARACTER*(*) :: value, correct_value INTEGER :: total_error @@ -160,7 +157,7 @@ SUBROUTINE verifystring(string, value,correct_value,total_error) WRITE(*,*) "ERROR: INCORRECT VALIDATION ", string ENDIF RETURN -END SUBROUTINE verifystring +END SUBROUTINE verifyString !---------------------------------------------------------------------- diff --git a/fortran/testpar/CMakeLists.txt b/fortran/testpar/CMakeLists.txt index 1c7248c..76b6023 100644 --- a/fortran/testpar/CMakeLists.txt +++ b/fortran/testpar/CMakeLists.txt @@ -17,7 +17,7 @@ ADD_EXECUTABLE (parallel_test mdset.f90 ) TARGET_NAMING (parallel_test ${LIB_TYPE}) -TARGET_FORTRAN_WIN_PROPERTIES (parallel_test "") +TARGET_FORTRAN_PROPERTIES (parallel_test " " " ") TARGET_LINK_LIBRARIES (parallel_test ${HDF5_F90_TEST_LIB_TARGET} ${HDF5_F90_LIB_TARGET} diff --git a/hl/c++/examples/CMakeLists.txt b/hl/c++/examples/CMakeLists.txt index 4c60165..aa4221f 100644 --- a/hl/c++/examples/CMakeLists.txt +++ b/hl/c++/examples/CMakeLists.txt @@ -12,6 +12,7 @@ INCLUDE_DIRECTORIES (${HDF5_HL_CPP_SRC_DIR}/src) # -------------------------------------------------------------------- ADD_EXECUTABLE (ptExampleFL ${HDF5_HL_CPP_EXAMPLES_SOURCE_DIR}/ptExampleFL.cpp) TARGET_NAMING (ptExampleFL ${LIB_TYPE}) +TARGET_C_PROPERTIES (ptExampleFL " " " ") TARGET_LINK_LIBRARIES ( ptExampleFL ${HDF5_HL_CPP_LIB_TARGET} diff --git a/hl/c++/src/CMakeLists.txt b/hl/c++/src/CMakeLists.txt index 5a2a7c4..aa54889 100644 --- a/hl/c++/src/CMakeLists.txt +++ b/hl/c++/src/CMakeLists.txt @@ -10,7 +10,8 @@ INCLUDE_DIRECTORIES (${HDF5_HL_CPP_SRC_SOURCE_DIR}) SET (HDF5_HL_CPP_SRCS ${HDF5_HL_CPP_SRC_SOURCE_DIR}/H5PacketTable.cpp) SET (HDF5_HL_CPP_HDRS ${HDF5_HL_CPP_SRC_SOURCE_DIR}/H5PacketTable.h) -ADD_LIBRARY ( ${HDF5_HL_CPP_LIB_TARGET} ${LIB_TYPE} ${HDF5_HL_CPP_SRCS}) +ADD_LIBRARY (${HDF5_HL_CPP_LIB_TARGET} ${LIB_TYPE} ${HDF5_HL_CPP_SRCS}) +TARGET_C_PROPERTIES (${HDF5_HL_CPP_LIB_TARGET} " " " ") TARGET_LINK_LIBRARIES ( ${HDF5_HL_CPP_LIB_TARGET} ${HDF5_HL_LIB_TARGET} @@ -27,7 +28,7 @@ INSTALL ( FILES ${HDF5_HL_CPP_HDRS} DESTINATION - ${HDF5_INSTALL_INCLUDE_DIR}/hl/cpp + ${HDF5_INSTALL_INCLUDE_DIR} COMPONENT hlcppheaders ) diff --git a/hl/c++/src/Makefile.in b/hl/c++/src/Makefile.in index 7b60392..71efac1 100644 --- a/hl/c++/src/Makefile.in +++ b/hl/c++/src/Makefile.in @@ -466,7 +466,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 = 139 +LT_VERS_REVISION = 146 LT_VERS_AGE = 0 # Include src directory diff --git a/hl/c++/test/CMakeLists.txt b/hl/c++/test/CMakeLists.txt index 0f82748..6633426 100644 --- a/hl/c++/test/CMakeLists.txt +++ b/hl/c++/test/CMakeLists.txt @@ -17,6 +17,7 @@ IF (BUILD_TESTING) INCLUDE_DIRECTORIES (${HDF5_CPP_SRC_DIR}/src) ADD_EXECUTABLE (hl_ptableTest ${HDF5_HL_CPP_TEST_SOURCE_DIR}/ptableTest.cpp) + TARGET_C_PROPERTIES (hl_ptableTest " " " ") TARGET_NAMING (hl_ptableTest ${LIB_TYPE}) TARGET_LINK_LIBRARIES ( hl_ptableTest diff --git a/hl/examples/CMakeLists.txt b/hl/examples/CMakeLists.txt index 1f4807a..b702754 100644 --- a/hl/examples/CMakeLists.txt +++ b/hl/examples/CMakeLists.txt @@ -43,6 +43,7 @@ SET (examples FOREACH (example ${examples}) ADD_EXECUTABLE (hl_ex_${example} ${HDF5_HL_EXAMPLES_SOURCE_DIR}/${example}.c) TARGET_NAMING (hl_ex_${example} ${LIB_TYPE}) + TARGET_C_PROPERTIES (hl_ex_${example} " " " ") TARGET_LINK_LIBRARIES (hl_ex_${example} ${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET}) SET_TARGET_PROPERTIES (hl_ex_${example} PROPERTIES FOLDER examples/hl) diff --git a/hl/fortran/examples/CMakeLists.txt b/hl/fortran/examples/CMakeLists.txt index 03b9e9b..df7fd24 100644 --- a/hl/fortran/examples/CMakeLists.txt +++ b/hl/fortran/examples/CMakeLists.txt @@ -18,7 +18,7 @@ SET (examples FOREACH (example ${examples}) ADD_EXECUTABLE (hl_f90_ex_${example} ${HDF5_HL_F90_EXAMPLES_SOURCE_DIR}/${example}.f90) TARGET_NAMING (hl_f90_ex_${example} ${LIB_TYPE}) - TARGET_FORTRAN_WIN_PROPERTIES (hl_f90_ex_${example} "") + TARGET_FORTRAN_PROPERTIES (hl_f90_ex_${example} " " " ") TARGET_LINK_LIBRARIES (hl_f90_ex_${example} ${HDF5_HL_F90_LIB_TARGET} ${HDF5_F90_LIB_TARGET} diff --git a/hl/fortran/src/CMakeLists.txt b/hl/fortran/src/CMakeLists.txt index c580516..22353f8 100644 --- a/hl/fortran/src/CMakeLists.txt +++ b/hl/fortran/src/CMakeLists.txt @@ -26,6 +26,7 @@ SET_SOURCE_FILES_PROPERTIES (${HDF5_HL_F90_C_SRCS} PROPERTIES LANGUAGE C) SET (HDF5_HL_F90_HEADERS ${HDF5_HL_F90_SRC_SOURCE_DIR}/H5LTf90proto.h) ADD_LIBRARY (${HDF5_HL_F90_C_LIB_TARGET} ${LIB_TYPE} ${HDF5_HL_F90_C_SRCS} ${HDF5_HL_F90_HEADERS}) +TARGET_C_PROPERTIES (${HDF5_HL_F90_C_LIB_TARGET} " " " ") TARGET_LINK_LIBRARIES (${HDF5_HL_F90_C_LIB_TARGET} ${HDF5_F90_C_LIB_TARGET} ${HDF5_HL_LIB_TARGET}) SET_GLOBAL_VARIABLE (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_HL_F90_C_LIB_TARGET}") H5_SET_LIB_OPTIONS (${HDF5_HL_F90_C_LIB_TARGET} ${HDF5_HL_F90_C_LIB_NAME} ${LIB_TYPE}) @@ -61,7 +62,7 @@ IF (WIN32 AND NOT CYGWIN) HDF5F90_WINDOWS ) ENDIF (WIN32 AND NOT CYGWIN) -TARGET_FORTRAN_WIN_PROPERTIES (${HDF5_HL_F90_LIB_TARGET} ${SHARED_LINK_FLAGS}) +TARGET_FORTRAN_PROPERTIES (${HDF5_HL_F90_LIB_TARGET} " " ${SHARED_LINK_FLAGS}) 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} ${HDF5_F90_LIB_TARGET}) SET_GLOBAL_VARIABLE (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_HL_F90_LIB_TARGET}") @@ -76,7 +77,7 @@ IF (WIN32 AND NOT CYGWIN) DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/\${BUILD_TYPE}/ DESTINATION - ${HDF5_INSTALL_INCLUDE_DIR}/fortran + ${HDF5_INSTALL_INCLUDE_DIR} COMPONENT fortheaders ) @@ -85,7 +86,7 @@ ELSE (WIN32 AND NOT CYGWIN) DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/ DESTINATION - ${HDF5_INSTALL_INCLUDE_DIR}/fortran + ${HDF5_INSTALL_INCLUDE_DIR} COMPONENT fortheaders ) diff --git a/hl/fortran/src/Makefile.in b/hl/fortran/src/Makefile.in index 051e110..d12cb1f 100644 --- a/hl/fortran/src/Makefile.in +++ b/hl/fortran/src/Makefile.in @@ -482,7 +482,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 = 139 +LT_VERS_REVISION = 146 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 d76e7f2..7e7aa1d 100644 --- a/hl/fortran/test/CMakeLists.txt +++ b/hl/fortran/test/CMakeLists.txt @@ -23,7 +23,7 @@ ADD_TEST ( #-- Adding test for hl_f90_tstds ADD_EXECUTABLE (hl_f90_tstds tstds.f90) TARGET_NAMING (hl_f90_tstds ${LIB_TYPE}) -TARGET_FORTRAN_WIN_PROPERTIES (hl_f90_tstds "") +TARGET_FORTRAN_PROPERTIES (hl_f90_tstds " " " ") TARGET_LINK_LIBRARIES (hl_f90_tstds ${HDF5_HL_F90_LIB_TARGET} ${HDF5_F90_LIB_TARGET}) SET_TARGET_PROPERTIES (hl_f90_tstds PROPERTIES LINKER_LANGUAGE Fortran) SET_TARGET_PROPERTIES (hl_f90_tstds PROPERTIES FOLDER test/hl/fortran) @@ -33,7 +33,7 @@ ADD_TEST (NAME hl_f90_tstds COMMAND $<TARGET_FILE:hl_f90_tstds>) #-- Adding test for hl_f90_tstlite ADD_EXECUTABLE (hl_f90_tstlite tstlite.f90) TARGET_NAMING (hl_f90_tstlite ${LIB_TYPE}) -TARGET_FORTRAN_WIN_PROPERTIES (hl_f90_tstlite "") +TARGET_FORTRAN_PROPERTIES (hl_f90_tstlite " " " ") TARGET_LINK_LIBRARIES (hl_f90_tstlite ${HDF5_HL_F90_LIB_TARGET} ${HDF5_F90_LIB_TARGET}) SET_TARGET_PROPERTIES (hl_f90_tstlite PROPERTIES LINKER_LANGUAGE Fortran) SET_TARGET_PROPERTIES (hl_f90_tstlite PROPERTIES FOLDER test/hl/fortran) @@ -43,7 +43,7 @@ ADD_TEST (NAME hl_f90_tstlite COMMAND $<TARGET_FILE:hl_f90_tstlite>) #-- Adding test for hl_f90_tstimage ADD_EXECUTABLE (hl_f90_tstimage tstimage.f90) TARGET_NAMING (hl_f90_tstimage ${LIB_TYPE}) -TARGET_FORTRAN_WIN_PROPERTIES (hl_f90_tstimage "") +TARGET_FORTRAN_PROPERTIES (hl_f90_tstimage " " " ") TARGET_LINK_LIBRARIES (hl_f90_tstimage ${HDF5_HL_F90_LIB_TARGET} ${HDF5_F90_LIB_TARGET}) SET_TARGET_PROPERTIES (hl_f90_tstimage PROPERTIES LINKER_LANGUAGE Fortran) SET_TARGET_PROPERTIES (hl_f90_tstimage PROPERTIES FOLDER test/hl/fortran) @@ -53,7 +53,7 @@ ADD_TEST (NAME hl_f90_tstimage COMMAND $<TARGET_FILE:hl_f90_tstimage>) #-- Adding test for hl_f90_tsttable ADD_EXECUTABLE (hl_f90_tsttable tsttable.f90) TARGET_NAMING (hl_f90_tsttable ${LIB_TYPE}) -TARGET_FORTRAN_WIN_PROPERTIES (hl_f90_tsttable "") +TARGET_FORTRAN_PROPERTIES (hl_f90_tsttable " " " ") TARGET_LINK_LIBRARIES (hl_f90_tsttable ${HDF5_HL_F90_LIB_TARGET} ${HDF5_F90_LIB_TARGET}) SET_TARGET_PROPERTIES (hl_f90_tsttable PROPERTIES LINKER_LANGUAGE Fortran) SET_TARGET_PROPERTIES (hl_f90_tsttable PROPERTIES FOLDER test/hl/fortran) diff --git a/hl/src/CMakeLists.txt b/hl/src/CMakeLists.txt index edba042..5904d05 100644 --- a/hl/src/CMakeLists.txt +++ b/hl/src/CMakeLists.txt @@ -36,6 +36,7 @@ SET (HL_HEADERS ) ADD_LIBRARY (${HDF5_HL_LIB_TARGET} ${LIB_TYPE} ${HL_SRCS} ${HL_HEADERS}) +TARGET_C_PROPERTIES (${HDF5_HL_LIB_TARGET} " " " ") TARGET_LINK_LIBRARIES (${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET}) SET_GLOBAL_VARIABLE (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_HL_LIB_TARGET}") H5_SET_LIB_OPTIONS (${HDF5_HL_LIB_TARGET} ${HDF5_HL_LIB_NAME} ${LIB_TYPE}) diff --git a/hl/src/H5LT.c b/hl/src/H5LT.c index eed2721..88f8de4 100644 --- a/hl/src/H5LT.c +++ b/hl/src/H5LT.c @@ -803,7 +803,7 @@ herr_t H5LTmake_dataset_string(hid_t loc_id, if((tid = H5Tcopy(H5T_C_S1)) < 0 ) goto out; - size = strlen(buf) + 1; /* extra null term */ + size = HDstrlen(buf) + 1; /* extra null term */ if(H5Tset_size(tid, size) < 0) goto out; @@ -1354,7 +1354,7 @@ find_dataset(hid_t loc_id, const char *name, const H5L_info_t *linfo, void *op_d * cause the iterator to immediately return that positive value, * indicating short-circuit success */ - if(strcmp(name, (char *)op_data) == 0) + if(HDstrcmp(name, (char *)op_data) == 0) ret = 1; return ret; @@ -1437,7 +1437,7 @@ herr_t H5LTset_attribute_string( hid_t loc_id, if ( (attr_type = H5Tcopy( H5T_C_S1 )) < 0 ) goto out; - attr_size = strlen( attr_data ) + 1; /* extra null term */ + attr_size = HDstrlen( attr_data ) + 1; /* extra null term */ if ( H5Tset_size( attr_type, (size_t)attr_size) < 0 ) goto out; @@ -1936,7 +1936,7 @@ find_attr(hid_t loc_id, const char *name, const H5A_info_t *ainfo, * cause the iterator to immediately return that positive value, * indicating short-circuit success */ - if(strcmp(name, (char *)op_data) == 0) + if(HDstrcmp(name, (char *)op_data) == 0) ret = H5_ITER_STOP; return ret; @@ -2168,17 +2168,17 @@ hid_t H5LTtext_to_dtype(const char *text, H5LT_lang_t lang_type) goto out; if(lang_type != H5LT_DDL) { - fprintf(stderr, "only DDL is supported for now.\n"); + HDfprintf(stderr, "only DDL is supported for now.\n"); goto out; } - input_len = strlen(text); - myinput = strdup(text); + input_len = HDstrlen(text); + myinput = HDstrdup(text); if((type_id = H5LTyyparse()) < 0) goto out; - free(myinput); + HDfree(myinput); input_len = 0; return type_id; @@ -2207,12 +2207,12 @@ realloc_and_append(hbool_t _no_user_buf, size_t *len, char *buf, char *str_to_ad { if(_no_user_buf) { /* If the buffer isn't big enough, reallocate it. Otherwise, go to do strcat. */ - if(str_to_add && ((ssize_t)(*len - (strlen(buf) + strlen(str_to_add) + 1)) < LIMIT)) { - *len += ((strlen(buf) + strlen(str_to_add) + 1) / INCREMENT + 1) * INCREMENT; - buf = (char*)realloc(buf, *len); - } else if(!str_to_add && ((ssize_t)(*len - strlen(buf) - 1) < LIMIT)) { + if(str_to_add && ((ssize_t)(*len - (HDstrlen(buf) + HDstrlen(str_to_add) + 1)) < LIMIT)) { + *len += ((HDstrlen(buf) + HDstrlen(str_to_add) + 1) / INCREMENT + 1) * INCREMENT; + buf = (char*)HDrealloc(buf, *len); + } else if(!str_to_add && ((ssize_t)(*len - HDstrlen(buf) - 1) < LIMIT)) { *len += INCREMENT; - buf = (char*)realloc(buf, *len); + buf = (char*)HDrealloc(buf, *len); } } @@ -2220,7 +2220,7 @@ realloc_and_append(hbool_t _no_user_buf, size_t *len, char *buf, char *str_to_ad goto out; if(str_to_add) - strcat(buf, str_to_add); + HDstrcat(buf, str_to_add); return buf; @@ -2249,7 +2249,7 @@ indentation(size_t x, char* str, hbool_t no_u_buf, size_t *s_len) char tmp_str[TMP_LEN]; if (x < 80) { - memset(tmp_str, ' ', x); + HDmemset(tmp_str, ' ', x); tmp_str[x]='\0'; } else HDsnprintf(tmp_str, TMP_LEN, "error: the indentation exceeds the number of cols."); @@ -2310,8 +2310,8 @@ print_enum(hid_t type, char* str, size_t *str_len, hbool_t no_ubuf, size_t indt) dst_size = H5Tget_size(native); /* Get the names and raw values of all members */ - name = (char**)calloc((size_t)nmembs, sizeof(char *)); - value = (unsigned char*)calloc((size_t)nmembs, MAX(dst_size, super_size)); + name = (char**)HDcalloc((size_t)nmembs, sizeof(char *)); + value = (unsigned char*)HDcalloc((size_t)nmembs, MAX(dst_size, super_size)); for (i = 0; i < nmembs; i++) { if((name[i] = H5Tget_member_name(type, (unsigned)i))==NULL) @@ -2359,10 +2359,10 @@ print_enum(hid_t type, char* str, size_t *str_len, hbool_t no_ubuf, size_t indt) /* Release resources */ for(i = 0; i < nmembs; i++) - free(name[i]); + HDfree(name[i]); - free(name); - free(value); + HDfree(name); + HDfree(value); H5Tclose(super); return str; @@ -2378,12 +2378,12 @@ out: if(name) { for(i = 0; i < nmembs; i++) if(name[i]) - free(name[i]); - free(name); + HDfree(name[i]); + HDfree(name); } /* end if */ if(value) - free(value); + HDfree(value); if(super >= 0) H5Tclose(super); @@ -2418,13 +2418,13 @@ herr_t H5LTdtype_to_text(hid_t dtype, char *str, H5LT_lang_t lang_type, size_t * goto out; if(len && !str) { - text_str = (char*)calloc(str_len, sizeof(char)); + text_str = (char*)HDcalloc(str_len, sizeof(char)); text_str[0]='\0'; if(!(text_str = H5LT_dtype_to_text(dtype, text_str, lang_type, &str_len, 1))) goto out; - *len = strlen(text_str) + 1; + *len = HDstrlen(text_str) + 1; if(text_str) - free(text_str); + HDfree(text_str); text_str = NULL; } else if(len && str) { if(!(H5LT_dtype_to_text(dtype, str, lang_type, len, 0))) @@ -2744,7 +2744,7 @@ next: if(tag) { HDsnprintf(tmp_str, TMP_LEN, "OPQ_TAG \"%s\";\n", tag); if(tag) - free(tag); + HDfree(tag); tag = NULL; } else HDsnprintf(tmp_str, TMP_LEN, "OPQ_TAG \"\";\n"); @@ -2777,14 +2777,14 @@ next: goto out; if(H5LTdtype_to_text(super, NULL, lang, &super_len) < 0) goto out; - stmp = (char*)calloc(super_len, sizeof(char)); + stmp = (char*)HDcalloc(super_len, sizeof(char)); if(H5LTdtype_to_text(super, stmp, lang, &super_len) < 0) goto out; if(!(dt_str = realloc_and_append(no_user_buf, slen, dt_str, stmp))) goto out; if(stmp) - free(stmp); + HDfree(stmp); stmp = NULL; HDsnprintf(tmp_str, TMP_LEN, ";\n"); @@ -2821,14 +2821,14 @@ next: goto out; if(H5LTdtype_to_text(super, NULL, lang, &super_len) < 0) goto out; - stmp = (char*)calloc(super_len, sizeof(char)); + stmp = (char*)HDcalloc(super_len, sizeof(char)); if(H5LTdtype_to_text(super, stmp, lang, &super_len) < 0) goto out; if(!(dt_str = realloc_and_append(no_user_buf, slen, dt_str, stmp))) goto out; if(stmp) - free(stmp); + HDfree(stmp); stmp = NULL; HDsnprintf(tmp_str, TMP_LEN, "\n"); if(!(dt_str = realloc_and_append(no_user_buf, slen, dt_str, tmp_str))) @@ -2879,13 +2879,13 @@ next: goto out; if(H5LTdtype_to_text(super, NULL, lang, &super_len) < 0) goto out; - stmp = (char*)calloc(super_len, sizeof(char)); + stmp = (char*)HDcalloc(super_len, sizeof(char)); if(H5LTdtype_to_text(super, stmp, lang, &super_len) < 0) goto out; if(!(dt_str = realloc_and_append(no_user_buf, slen, dt_str, stmp))) goto out; if(stmp) - free(stmp); + HDfree(stmp); stmp = NULL; HDsnprintf(tmp_str, TMP_LEN, "\n"); if(!(dt_str = realloc_and_append(no_user_buf, slen, dt_str, tmp_str))) @@ -2934,13 +2934,13 @@ next: if(H5LTdtype_to_text(mtype, NULL, lang, &mlen) < 0) goto out; - mtmp = (char*)calloc(mlen, sizeof(char)); + mtmp = (char*)HDcalloc(mlen, sizeof(char)); if(H5LTdtype_to_text(mtype, mtmp, lang, &mlen) < 0) goto out; if(!(dt_str = realloc_and_append(no_user_buf, slen, dt_str, mtmp))) goto out; if(mtmp) - free(mtmp); + HDfree(mtmp); mtmp = NULL; if (H5T_COMPOUND == mclass) @@ -2950,7 +2950,7 @@ next: if(!(dt_str = realloc_and_append(no_user_buf, slen, dt_str, tmp_str))) goto out; if(mname) - free(mname); + HDfree(mname); mname = NULL; HDsnprintf(tmp_str, TMP_LEN, " : %lu;\n", (unsigned long)moffset); @@ -3560,7 +3560,7 @@ herr_t H5LT_set_attribute_string(hid_t dset_id, if((tid = H5Tcopy(H5T_C_S1)) < 0) return FAIL; - size = strlen(buf) + 1; /* extra null term */ + size = HDstrlen(buf) + 1; /* extra null term */ if(H5Tset_size(tid,(size_t)size) < 0) goto out; diff --git a/hl/src/Makefile.in b/hl/src/Makefile.in index a7d77b1..2ac18a0 100644 --- a/hl/src/Makefile.in +++ b/hl/src/Makefile.in @@ -465,7 +465,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 = 139 +LT_VERS_REVISION = 146 LT_VERS_AGE = 0 # This library is our main target. diff --git a/hl/test/CMakeLists.txt b/hl/test/CMakeLists.txt index c5b6f6e..9cb61e0 100644 --- a/hl/test/CMakeLists.txt +++ b/hl/test/CMakeLists.txt @@ -23,6 +23,7 @@ INCLUDE_DIRECTORIES (${HDF5_TEST_SRC_DIR}) MACRO (HL_ADD_TEST hl_name files) ADD_EXECUTABLE (hl_${hl_name} ${hl_name}.c) TARGET_NAMING (hl_${hl_name} ${LIB_TYPE}) + TARGET_C_PROPERTIES (hl_${hl_name} " " " ") TARGET_LINK_LIBRARIES (hl_${hl_name} ${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET} @@ -97,6 +98,7 @@ HL_ADD_TEST (test_table "test_table_be.h5;test_table_cray.h5;test_table_le.h5") IF (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) ADD_EXECUTABLE (hl_gen_test_ds gen_test_ds.c) TARGET_NAMING (hl_gen_test_ds ${LIB_TYPE}) + TARGET_C_PROPERTIES (hl_gen_test_ds " " " ") TARGET_LINK_LIBRARIES (hl_gen_test_ds ${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET} diff --git a/hl/test/test_ds.c b/hl/test/test_ds.c index b81f8d4..1bfa23f 100644 --- a/hl/test/test_ds.c +++ b/hl/test/test_ds.c @@ -219,9 +219,8 @@ static hid_t create_test_file(const char *fileext) { char filename[65]; - HDstrcpy(filename, FILENAME); - HDstrcat(filename, fileext); - HDstrcat(filename, FILEEXT); + HDsnprintf(filename, sizeof(filename), "%s%s%s", FILENAME, fileext, FILEEXT); + return H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); } @@ -229,9 +228,7 @@ static hid_t open_test_file(const char *fileext) { char filename[65]; - HDstrcpy(filename, FILENAME); - HDstrcat(filename, fileext); - HDstrcat(filename, FILEEXT); + HDsnprintf(filename, sizeof(filename), "%s%s%s", FILENAME, fileext, FILEEXT); return H5Fopen(filename, H5F_ACC_RDWR, H5P_DEFAULT); } @@ -258,10 +255,10 @@ herr_t create_char_dataset(hid_t fid, const char *dsidx, int fulldims) char s31_wbuf[DIM3_SIZE] = {1,1,1,2,2,2,3,3,3,4,4,4}; char s32_wbuf[DIM3_SIZE] = {5,5,5,10,10,10,50,50,50,100,100,100}; char s33_wbuf[DIM3_SIZE] = {6,6,6,12,12,12,53,53,53,120,120,120}; - char name[32]; + char name[64]; + + HDsnprintf(name, sizeof(name), "%s%s", DATASET_NAME, dsidx); - HDstrcpy(name, DATASET_NAME); - HDstrcat(name, dsidx); /* make a dataset */ if(H5LTmake_dataset_char(fid, name, rank, dims, buf) >= 0) { if(fulldims==0) { @@ -307,14 +304,13 @@ herr_t create_short_dataset(hid_t fid, const char *dsidx, int fulldims) short s2_wbuf[DIM2_SIZE] = {100,200,300,400}; short s21_wbuf[DIM2_SIZE] = {10,20,30,40}; short s22_wbuf[DIM2_SIZE] = {5,10,50,300}; - short s3_wbuf[DIM3_SIZE] = {10,10,10,20,20,20,30,30,30,40,40,40}; - short s31_wbuf[DIM3_SIZE] = {1,1,1,2,2,2,3,3,3,4,4,4}; - short s32_wbuf[DIM3_SIZE] = {5,5,5,10,10,10,50,50,50,100,100,100}; - short s33_wbuf[DIM3_SIZE] = {6,6,6,12,12,12,53,53,53,140,140,140}; - char name[32]; + short s3_wbuf[DIM3_SIZE] = {10,10,10,20,20,20,30,30,30,40,40,40}; + short s31_wbuf[DIM3_SIZE] = {1,1,1,2,2,2,3,3,3,4,4,4}; + short s32_wbuf[DIM3_SIZE] = {5,5,5,10,10,10,50,50,50,100,100,100}; + short s33_wbuf[DIM3_SIZE] = {6,6,6,12,12,12,53,53,53,140,140,140}; + char name[64]; - HDstrcpy(name, DATASET_NAME); - HDstrcat(name, dsidx); + HDsnprintf(name, sizeof(name), "%s%s", DATASET_NAME, dsidx); /* make a dataset */ if(H5LTmake_dataset_short(fid, name, rank, dims, buf) >= 0) { @@ -360,10 +356,9 @@ herr_t create_int_dataset(hid_t fid, const char *dsidx, int fulldims) int s2_wbuf[DIM2_SIZE] = {100,200,300,400}; int s21_wbuf[DIM2_SIZE] = {10,20,30,40}; int s22_wbuf[DIM2_SIZE] = {5,10,50,300}; - char name[32]; + char name[64]; - HDstrcpy(name, DATASET_NAME); - HDstrcat(name, dsidx); + HDsnprintf(name, sizeof(name), "%s%s", DATASET_NAME, dsidx); /* make a dataset */ if(H5LTmake_dataset_int(fid, name, rank, dims, buf) >= 0) { @@ -413,12 +408,9 @@ herr_t create_long_dataset(hid_t fid, const char *dsname, const char *dsidx, int long s42_wbuf[DIM4_SIZE] = {80,80}; long s43_wbuf[DIM4_SIZE] = {180,180}; long s44_wbuf[DIM4_SIZE] = {280,280}; - char name[32]; - - HDstrcpy(name, dsname); /* make a dataset */ - if(H5LTmake_dataset_long(fid, name, rank, dims, buf) >= 0) { + if(H5LTmake_dataset_long(fid, dsname, rank, dims, buf) >= 0) { if(fulldims==0) { /* make a DS dataset for the first dimension */ if(create_DS1_long_datasets(fid, dsidx, rankds, s1_dim, s1_wbuf, NULL) < 0) @@ -468,10 +460,9 @@ herr_t create_float_dataset(hid_t fid, const char *dsidx, int fulldims) float s2_wbuf[DIM2_SIZE] = {100,200,300,400}; float s21_wbuf[DIM2_SIZE] = {10,20,30,40}; float s22_wbuf[DIM2_SIZE] = {5,10,50,300}; - char name[32]; + char name[64]; - HDstrcpy(name, DATASET_NAME); - HDstrcat(name, dsidx); + HDsnprintf(name, sizeof(name), "%s%s", DATASET_NAME, dsidx); /* make a dataset */ if(H5LTmake_dataset_float(fid, name, rank, dims, buf) >= 0) { @@ -503,17 +494,17 @@ herr_t create_float_dataset(hid_t fid, const char *dsidx, int fulldims) */ herr_t create_DS1_char_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_dim, char *s_wbuf, char *s1_wbuf) { - char name[32]; + char name[64]; + + HDsnprintf(name, sizeof(name), "%s%s", DS_1_NAME, dsidx); - HDstrcpy(name, DS_1_NAME); - HDstrcat(name, dsidx); /* make a DS dataset for the first dimension */ if(H5LTmake_dataset_char(fid, name, rankds, s_dim, s_wbuf) < 0) return FAIL; - if(s1_wbuf!=NULL) { - HDstrcpy(name, DS_11_NAME); - HDstrcat(name, dsidx); + if(s1_wbuf != NULL) { + HDsnprintf(name, sizeof(name), "%s%s", DS_11_NAME, dsidx); + /* make a DS dataset with an alternate scale for the first dimension */ if(H5LTmake_dataset_char(fid, name, rankds, s_dim, s1_wbuf) < 0) return FAIL; @@ -528,25 +519,25 @@ herr_t create_DS1_char_datasets(hid_t fid, const char *dsidx, int rankds, hsize_ */ herr_t create_DS2_char_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_dim, char *s_wbuf, char *s1_wbuf, char *s2_wbuf) { - char name[32]; + char name[64]; + + HDsnprintf(name, sizeof(name), "%s%s", DS_2_NAME, dsidx); - HDstrcpy(name, DS_2_NAME); - HDstrcat(name, dsidx); /* make a DS dataset for the second dimension */ if(H5LTmake_dataset_char(fid, name, rankds, s_dim, s_wbuf) < 0) return FAIL; - if(s1_wbuf!=NULL) { - HDstrcpy(name, DS_21_NAME); - HDstrcat(name, dsidx); + if(s1_wbuf != NULL) { + HDsnprintf(name, sizeof(name), "%s%s", DS_21_NAME, dsidx); + /* make a DS dataset with an alternate scale for the second dimension */ if(H5LTmake_dataset_char(fid, name, rankds, s_dim, s1_wbuf) < 0) return FAIL; } - if(s2_wbuf!=NULL) { - HDstrcpy(name, DS_22_NAME); - HDstrcat(name, dsidx); + if(s2_wbuf != NULL) { + HDsnprintf(name, sizeof(name), "%s%s", DS_22_NAME, dsidx); + /* make a DS dataset with an alternate scale for the second dimension */ if(H5LTmake_dataset_char(fid, name, rankds, s_dim, s2_wbuf) < 0) return FAIL; @@ -561,33 +552,33 @@ herr_t create_DS2_char_datasets(hid_t fid, const char *dsidx, int rankds, hsize_ */ herr_t create_DS3_char_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_dim, char *s_wbuf, char *s1_wbuf, char *s2_wbuf, char *s3_wbuf) { - char name[32]; + char name[64]; + + HDsnprintf(name, sizeof(name), "%s%s", DS_3_NAME, dsidx); - HDstrcpy(name, DS_3_NAME); - HDstrcat(name, dsidx); /* make a DS dataset for the first dimension */ if(H5LTmake_dataset_char(fid, name, rankds, s_dim, s_wbuf) < 0) return FAIL; - if(s1_wbuf!=NULL) { - HDstrcpy(name, DS_31_NAME); - HDstrcat(name, dsidx); + if(s1_wbuf != NULL) { + HDsnprintf(name, sizeof(name), "%s%s", DS_31_NAME, dsidx); + /* make a DS dataset with an alternate scale for the second dimension */ if(H5LTmake_dataset_char(fid, name, rankds, s_dim, s1_wbuf) < 0) return FAIL; } - if(s2_wbuf!=NULL) { - HDstrcpy(name, DS_32_NAME); - HDstrcat(name, dsidx); + if(s2_wbuf != NULL) { + HDsnprintf(name, sizeof(name), "%s%s", DS_32_NAME, dsidx); + /* make a DS dataset with an alternate scale for the second dimension */ if(H5LTmake_dataset_char(fid, name, rankds, s_dim, s2_wbuf) < 0) return FAIL; } - if(s3_wbuf!=NULL) { - HDstrcpy(name, DS_33_NAME); - HDstrcat(name, dsidx); + if(s3_wbuf != NULL) { + HDsnprintf(name, sizeof(name), "%s%s", DS_33_NAME, dsidx); + /* make a DS dataset with an alternate scale for the second dimension */ if(H5LTmake_dataset_char(fid, name, rankds, s_dim, s3_wbuf) < 0) return FAIL; @@ -602,17 +593,17 @@ herr_t create_DS3_char_datasets(hid_t fid, const char *dsidx, int rankds, hsize_ */ herr_t create_DS1_short_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_dim, short *s_wbuf, short *s1_wbuf) { - char name[32]; + char name[64]; + + HDsnprintf(name, sizeof(name), "%s%s", DS_1_NAME, dsidx); - HDstrcpy(name, DS_1_NAME); - HDstrcat(name, dsidx); /* make a DS dataset for the first dimension */ if(H5LTmake_dataset_short(fid, name, rankds, s_dim, s_wbuf) < 0) return FAIL; - if(s1_wbuf!=NULL) { - HDstrcpy(name, DS_11_NAME); - HDstrcat(name, dsidx); + if(s1_wbuf != NULL) { + HDsnprintf(name, sizeof(name), "%s%s", DS_11_NAME, dsidx); + /* make a DS dataset with an alternate scale for the first dimension */ if(H5LTmake_dataset_short(fid, name, rankds, s_dim, s1_wbuf) < 0) return FAIL; @@ -627,26 +618,25 @@ herr_t create_DS1_short_datasets(hid_t fid, const char *dsidx, int rankds, hsize */ herr_t create_DS2_short_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_dim, short *s_wbuf, short *s1_wbuf, short *s2_wbuf) { - char name[32]; + char name[64]; - HDstrcpy(name, DS_2_NAME); - HDstrcat(name, dsidx); + HDsnprintf(name, sizeof(name), "%s%s", DS_2_NAME, dsidx); /* make a DS dataset for the second dimension */ if(H5LTmake_dataset_short(fid, name, rankds, s_dim, s_wbuf) < 0) return FAIL; - if(s1_wbuf!=NULL) { - HDstrcpy(name, DS_21_NAME); - HDstrcat(name, dsidx); + if(s1_wbuf != NULL) { + HDsnprintf(name, sizeof(name), "%s%s", DS_21_NAME, dsidx); + /* make a DS dataset with an alternate scale for the second dimension */ if(H5LTmake_dataset_short(fid, name, rankds, s_dim, s1_wbuf) < 0) return FAIL; } - if(s2_wbuf!=NULL) { - HDstrcpy(name, DS_22_NAME); - HDstrcat(name, dsidx); + if(s2_wbuf != NULL) { + HDsnprintf(name, sizeof(name), "%s%s", DS_22_NAME, dsidx); + /* make a DS dataset with an alternate scale for the second dimension */ if(H5LTmake_dataset_short(fid, name, rankds, s_dim, s2_wbuf) < 0) return FAIL; @@ -661,34 +651,33 @@ herr_t create_DS2_short_datasets(hid_t fid, const char *dsidx, int rankds, hsize */ herr_t create_DS3_short_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_dim, short *s_wbuf, short *s1_wbuf, short *s2_wbuf, short *s3_wbuf) { - char name[32]; + char name[64]; - HDstrcpy(name, DS_3_NAME); - HDstrcat(name, dsidx); + HDsnprintf(name, sizeof(name), "%s%s", DS_3_NAME, dsidx); /* make a DS dataset for the first dimension */ if(H5LTmake_dataset_short(fid, name, rankds, s_dim, s_wbuf) < 0) return FAIL; - if(s1_wbuf!=NULL) { - HDstrcpy(name, DS_31_NAME); - HDstrcat(name, dsidx); + if(s1_wbuf != NULL) { + HDsnprintf(name, sizeof(name), "%s%s", DS_31_NAME, dsidx); + /* make a DS dataset for the first dimension */ if(H5LTmake_dataset_short(fid, name, rankds, s_dim, s1_wbuf) < 0) return FAIL; } - if(s2_wbuf!=NULL) { - HDstrcpy(name, DS_32_NAME); - HDstrcat(name, dsidx); + if(s2_wbuf != NULL) { + HDsnprintf(name, sizeof(name), "%s%s", DS_32_NAME, dsidx); + /* make a DS dataset for the first dimension */ if(H5LTmake_dataset_short(fid, name, rankds, s_dim, s2_wbuf) < 0) return FAIL; } - if(s3_wbuf!=NULL) { - HDstrcpy(name, DS_33_NAME); - HDstrcat(name, dsidx); + if(s3_wbuf != NULL) { + HDsnprintf(name, sizeof(name), "%s%s", DS_33_NAME, dsidx); + /* make a DS dataset for the first dimension */ if(H5LTmake_dataset_short(fid, name, rankds, s_dim, s3_wbuf) < 0) return FAIL; @@ -703,18 +692,17 @@ herr_t create_DS3_short_datasets(hid_t fid, const char *dsidx, int rankds, hsize */ herr_t create_DS1_int_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_dim, int *s_wbuf, int *s1_wbuf) { - char name[32]; + char name[64]; - HDstrcpy(name, DS_1_NAME); - HDstrcat(name, dsidx); + HDsnprintf(name, sizeof(name), "%s%s", DS_1_NAME, dsidx); /* make a DS dataset for the first dimension */ if(H5LTmake_dataset_int(fid, name, rankds, s_dim, s_wbuf) < 0) return FAIL; - if(s1_wbuf!=NULL) { - HDstrcpy(name, DS_11_NAME); - HDstrcat(name, dsidx); + if(s1_wbuf != NULL) { + HDsnprintf(name, sizeof(name), "%s%s", DS_11_NAME, dsidx); + /* make a DS dataset with an alternate scale for the first dimension */ if(H5LTmake_dataset_int(fid, name, rankds, s_dim, s1_wbuf) < 0) return FAIL; @@ -729,26 +717,25 @@ herr_t create_DS1_int_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t */ herr_t create_DS2_int_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_dim, int *s_wbuf, int *s1_wbuf, int *s2_wbuf) { - char name[32]; + char name[64]; - HDstrcpy(name, DS_2_NAME); - HDstrcat(name, dsidx); + HDsnprintf(name, sizeof(name), "%s%s", DS_2_NAME, dsidx); /* make a DS dataset for the second dimension */ if(H5LTmake_dataset_int(fid, name, rankds, s_dim, s_wbuf) < 0) return FAIL; - if(s1_wbuf!=NULL) { - HDstrcpy(name, DS_21_NAME); - HDstrcat(name, dsidx); + if(s1_wbuf != NULL) { + HDsnprintf(name, sizeof(name), "%s%s", DS_21_NAME, dsidx); + /* make a DS dataset with an alternate scale for the second dimension */ if(H5LTmake_dataset_int(fid, name, rankds, s_dim, s1_wbuf) < 0) return FAIL; } - if(s2_wbuf!=NULL) { - HDstrcpy(name, DS_22_NAME); - HDstrcat(name, dsidx); + if(s2_wbuf != NULL) { + HDsnprintf(name, sizeof(name), "%s%s", DS_22_NAME, dsidx); + /* make a DS dataset with an alternate scale for the second dimension */ if(H5LTmake_dataset_int(fid, name, rankds, s_dim, s2_wbuf) < 0) return FAIL; @@ -763,34 +750,33 @@ herr_t create_DS2_int_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t */ herr_t create_DS3_int_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_dim, int *s_wbuf, int *s1_wbuf, int *s2_wbuf, int *s3_wbuf) { - char name[32]; + char name[64]; - HDstrcpy(name, DS_3_NAME); - HDstrcat(name, dsidx); + HDsnprintf(name, sizeof(name), "%s%s", DS_3_NAME, dsidx); /* make a DS dataset for the first dimension */ if(H5LTmake_dataset_int(fid, name, rankds, s_dim, s_wbuf) < 0) return FAIL; - if(s1_wbuf!=NULL) { - HDstrcpy(name, DS_31_NAME); - HDstrcat(name, dsidx); + if(s1_wbuf != NULL) { + HDsnprintf(name, sizeof(name), "%s%s", DS_31_NAME, dsidx); + /* make a DS dataset with an alternate scale for the first dimension */ if(H5LTmake_dataset_int(fid, name, rankds, s_dim, s1_wbuf) < 0) return FAIL; } - if(s2_wbuf!=NULL) { - HDstrcpy(name, DS_32_NAME); - HDstrcat(name, dsidx); + if(s2_wbuf != NULL) { + HDsnprintf(name, sizeof(name), "%s%s", DS_32_NAME, dsidx); + /* make a DS dataset with an alternate scale for the first dimension */ if(H5LTmake_dataset_int(fid, name, rankds, s_dim, s2_wbuf) < 0) return FAIL; } - if(s3_wbuf!=NULL) { - HDstrcpy(name, DS_33_NAME); - HDstrcat(name, dsidx); + if(s3_wbuf != NULL) { + HDsnprintf(name, sizeof(name), "%s%s", DS_33_NAME, dsidx); + /* make a DS dataset with an alternate scale for the first dimension */ if(H5LTmake_dataset_int(fid, name, rankds, s_dim, s3_wbuf) < 0) return FAIL; @@ -805,18 +791,17 @@ herr_t create_DS3_int_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t */ herr_t create_DS1_long_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_dim, long *s_wbuf, long *s1_wbuf) { - char name[32]; + char name[64]; - HDstrcpy(name, DS_1_NAME); - HDstrcat(name, dsidx); + HDsnprintf(name, sizeof(name), "%s%s", DS_1_NAME, dsidx); /* make a DS dataset for the first dimension */ if(H5LTmake_dataset_long(fid, name, rankds, s_dim, s_wbuf) < 0) return FAIL; - if(s1_wbuf!=NULL) { - HDstrcpy(name, DS_11_NAME); - HDstrcat(name, dsidx); + if(s1_wbuf != NULL) { + HDsnprintf(name, sizeof(name), "%s%s", DS_11_NAME, dsidx); + /* make a DS dataset with an alternate scale for the first dimension */ if(H5LTmake_dataset_long(fid, name, rankds, s_dim, s1_wbuf) < 0) return FAIL; @@ -831,26 +816,25 @@ herr_t create_DS1_long_datasets(hid_t fid, const char *dsidx, int rankds, hsize_ */ herr_t create_DS2_long_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_dim, long *s_wbuf, long *s1_wbuf, long *s2_wbuf) { - char name[32]; + char name[64]; - HDstrcpy(name, DS_2_NAME); - HDstrcat(name, dsidx); + HDsnprintf(name, sizeof(name), "%s%s", DS_2_NAME, dsidx); /* make a DS dataset for the second dimension */ if(H5LTmake_dataset_long(fid, name, rankds, s_dim, s_wbuf) < 0) return FAIL; - if(s1_wbuf!=NULL) { - HDstrcpy(name, DS_21_NAME); - HDstrcat(name, dsidx); + if(s1_wbuf != NULL) { + HDsnprintf(name, sizeof(name), "%s%s", DS_21_NAME, dsidx); + /* make a DS dataset with an alternate scale for the second dimension */ if(H5LTmake_dataset_long(fid, name, rankds, s_dim, s1_wbuf) < 0) return FAIL; } - if(s2_wbuf!=NULL) { - HDstrcpy(name, DS_22_NAME); - HDstrcat(name, dsidx); + if(s2_wbuf != NULL) { + HDsnprintf(name, sizeof(name), "%s%s", DS_22_NAME, dsidx); + /* make a DS dataset with an alternate scale for the second dimension */ if(H5LTmake_dataset_long(fid, name, rankds, s_dim, s2_wbuf) < 0) return FAIL; @@ -865,34 +849,33 @@ herr_t create_DS2_long_datasets(hid_t fid, const char *dsidx, int rankds, hsize_ */ herr_t create_DS3_long_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_dim, long *s_wbuf, long *s1_wbuf, long *s2_wbuf, long *s3_wbuf) { - char name[32]; + char name[64]; - HDstrcpy(name, DS_3_NAME); - HDstrcat(name, dsidx); + HDsnprintf(name, sizeof(name), "%s%s", DS_3_NAME, dsidx); /* make a DS dataset for the first dimension */ if(H5LTmake_dataset_long(fid, name, rankds, s_dim, s_wbuf) < 0) return FAIL; - if(s1_wbuf!=NULL) { - HDstrcpy(name, DS_31_NAME); - HDstrcat(name, dsidx); + if(s1_wbuf != NULL) { + HDsnprintf(name, sizeof(name), "%s%s", DS_31_NAME, dsidx); + /* make a DS dataset with an alternate scale for the second dimension */ if(H5LTmake_dataset_long(fid, name, rankds, s_dim, s1_wbuf) < 0) return FAIL; } - if(s2_wbuf!=NULL) { - HDstrcpy(name, DS_32_NAME); - HDstrcat(name, dsidx); + if(s2_wbuf != NULL) { + HDsnprintf(name, sizeof(name), "%s%s", DS_32_NAME, dsidx); + /* make a DS dataset with an alternate scale for the second dimension */ if(H5LTmake_dataset_long(fid, name, rankds, s_dim, s2_wbuf) < 0) return FAIL; } - if(s3_wbuf!=NULL) { - HDstrcpy(name, DS_33_NAME); - HDstrcat(name, dsidx); + if(s3_wbuf != NULL) { + HDsnprintf(name, sizeof(name), "%s%s", DS_33_NAME, dsidx); + /* make a DS dataset with an alternate scale for the second dimension */ if(H5LTmake_dataset_long(fid, name, rankds, s_dim, s3_wbuf) < 0) return FAIL; @@ -907,42 +890,41 @@ herr_t create_DS3_long_datasets(hid_t fid, const char *dsidx, int rankds, hsize_ */ herr_t create_DS4_long_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_dim, long *s_wbuf, long *s1_wbuf, long *s2_wbuf, long *s3_wbuf, long *s4_wbuf) { - char name[32]; + char name[64]; - HDstrcpy(name, DS_4_NAME); - HDstrcat(name, dsidx); + HDsnprintf(name, sizeof(name), "%s%s", DS_4_NAME, dsidx); /* make a DS dataset for the first dimension */ if(H5LTmake_dataset_long(fid, name, rankds, s_dim, s_wbuf) < 0) return FAIL; - if(s1_wbuf!=NULL) { - HDstrcpy(name, DS_41_NAME); - HDstrcat(name, dsidx); + if(s1_wbuf != NULL) { + HDsnprintf(name, sizeof(name), "%s%s", DS_41_NAME, dsidx); + /* make a DS dataset with an alternate scale for the second dimension */ if(H5LTmake_dataset_long(fid, name, rankds, s_dim, s1_wbuf) < 0) return FAIL; } - if(s2_wbuf!=NULL) { - HDstrcpy(name, DS_42_NAME); - HDstrcat(name, dsidx); + if(s2_wbuf != NULL) { + HDsnprintf(name, sizeof(name), "%s%s", DS_42_NAME, dsidx); + /* make a DS dataset with an alternate scale for the second dimension */ if(H5LTmake_dataset_long(fid, name, rankds, s_dim, s2_wbuf) < 0) return FAIL; } - if(s3_wbuf!=NULL) { - HDstrcpy(name, DS_43_NAME); - HDstrcat(name, dsidx); + if(s3_wbuf != NULL) { + HDsnprintf(name, sizeof(name), "%s%s", DS_43_NAME, dsidx); + /* make a DS dataset with an alternate scale for the second dimension */ if(H5LTmake_dataset_long(fid, name, rankds, s_dim, s3_wbuf) < 0) return FAIL; } - if(s4_wbuf!=NULL) { - HDstrcpy(name, DS_44_NAME); - HDstrcat(name, dsidx); + if(s4_wbuf != NULL) { + HDsnprintf(name, sizeof(name), "%s%s", DS_44_NAME, dsidx); + /* make a DS dataset with an alternate scale for the second dimension */ if(H5LTmake_dataset_long(fid, name, rankds, s_dim, s4_wbuf) < 0) return FAIL; @@ -957,18 +939,17 @@ herr_t create_DS4_long_datasets(hid_t fid, const char *dsidx, int rankds, hsize_ */ herr_t create_DS1_float_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_dim, float *s_wbuf, float *s1_wbuf) { - char name[32]; + char name[64]; - HDstrcpy(name, DS_1_NAME); - HDstrcat(name, dsidx); + HDsnprintf(name, sizeof(name), "%s%s", DS_1_NAME, dsidx); /* make a DS dataset for the first dimension */ if(H5LTmake_dataset_float(fid, name, rankds, s_dim, s_wbuf) < 0) return FAIL; - if(s1_wbuf!=NULL) { - HDstrcpy(name, DS_11_NAME); - HDstrcat(name, dsidx); + if(s1_wbuf != NULL) { + HDsnprintf(name, sizeof(name), "%s%s", DS_11_NAME, dsidx); + /* make a DS dataset with an alternate scale for the first dimension */ if(H5LTmake_dataset_float(fid, name, rankds, s_dim, s1_wbuf) < 0) return FAIL; @@ -983,26 +964,25 @@ herr_t create_DS1_float_datasets(hid_t fid, const char *dsidx, int rankds, hsize */ herr_t create_DS2_float_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_dim, float *s_wbuf, float *s1_wbuf, float *s2_wbuf) { - char name[32]; + char name[64]; - HDstrcpy(name, DS_2_NAME); - HDstrcat(name, dsidx); + HDsnprintf(name, sizeof(name), "%s%s", DS_2_NAME, dsidx); /* make a DS dataset for the second dimension */ if(H5LTmake_dataset_float(fid, name, rankds, s_dim, s_wbuf) < 0) return FAIL; - if(s1_wbuf!=NULL) { - HDstrcpy(name, DS_21_NAME); - HDstrcat(name, dsidx); + if(s1_wbuf != NULL) { + HDsnprintf(name, sizeof(name), "%s%s", DS_21_NAME, dsidx); + /* make a DS dataset with an alternate scale for the second dimension */ if(H5LTmake_dataset_float(fid, name, rankds, s_dim, s1_wbuf) < 0) return FAIL; } - if(s2_wbuf!=NULL) { - HDstrcpy(name, DS_22_NAME); - HDstrcat(name, dsidx); + if(s2_wbuf != NULL) { + HDsnprintf(name, sizeof(name), "%s%s", DS_22_NAME, dsidx); + /* make a DS dataset with an alternate scale for the second dimension */ if(H5LTmake_dataset_float(fid, name, rankds, s_dim, s2_wbuf) < 0) return FAIL; @@ -1017,34 +997,33 @@ herr_t create_DS2_float_datasets(hid_t fid, const char *dsidx, int rankds, hsize */ herr_t create_DS3_float_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_dim, float *s_wbuf, float *s1_wbuf, float *s2_wbuf, float *s3_wbuf) { - char name[32]; + char name[64]; - HDstrcpy(name, DS_3_NAME); - HDstrcat(name, dsidx); + HDsnprintf(name, sizeof(name), "%s%s", DS_3_NAME, dsidx); /* make a DS dataset for the first dimension */ if(H5LTmake_dataset_float(fid, name, rankds, s_dim, s_wbuf) < 0) return FAIL; - if(s1_wbuf!=NULL) { - HDstrcpy(name, DS_31_NAME); - HDstrcat(name, dsidx); + if(s1_wbuf != NULL) { + HDsnprintf(name, sizeof(name), "%s%s", DS_31_NAME, dsidx); + /* make a DS dataset with an alternate scale for the second dimension */ if(H5LTmake_dataset_float(fid, name, rankds, s_dim, s1_wbuf) < 0) return FAIL; } - if(s2_wbuf!=NULL) { - HDstrcpy(name, DS_32_NAME); - HDstrcat(name, dsidx); + if(s2_wbuf != NULL) { + HDsnprintf(name, sizeof(name), "%s%s", DS_32_NAME, dsidx); + /* make a DS dataset with an alternate scale for the second dimension */ if(H5LTmake_dataset_float(fid, name, rankds, s_dim, s2_wbuf) < 0) return FAIL; } - if(s3_wbuf!=NULL) { - HDstrcpy(name, DS_33_NAME); - HDstrcat(name, dsidx); + if(s3_wbuf != NULL) { + HDsnprintf(name, sizeof(name), "%s%s", DS_33_NAME, dsidx); + /* make a DS dataset with an alternate scale for the second dimension */ if(H5LTmake_dataset_float(fid, name, rankds, s_dim, s3_wbuf) < 0) return FAIL; @@ -1062,7 +1041,6 @@ herr_t test_attach_scale(hid_t fid, hid_t did, const char *name, unsigned int id if(H5DSis_attached(did, dsid, idx) == 0) { if(H5DSattach_scale(did, dsid, idx) >= 0) { if(H5DSis_attached(did, dsid, idx) > 0) { - /* printf(" scale attached "); */ ret_value = SUCCEED; } else if(H5DSis_attached(did, dsid, idx) == 0) { @@ -1127,10 +1105,10 @@ herr_t test_cmp_scalename(hid_t fid, hid_t did, const char *name, const char *sc if((dsid = H5Dopen2(fid, name, H5P_DEFAULT)) >= 0) { if(H5DSis_attached(did, dsid, idx) == 1) { if((name_len=H5DSget_scale_name(dsid,NULL,(size_t)0)) > 0) { - name_out = (char*)HDmalloc((name_len+1) * sizeof (char)); + name_out = (char*)HDmalloc(((size_t)name_len+1) * sizeof (char)); if(name_out != NULL) { if(H5DSget_scale_name(dsid, name_out, (size_t)name_len+1) >= 0) { - if(HDstrcmp(scalename,name_out)==0) { + if(HDstrncmp(scalename, name_out, (size_t)name_len)==0) { ret_value = SUCCEED; } HDfree(name_out); @@ -1294,8 +1272,8 @@ static int test_char_attachscales(const char *fileext) hid_t did = -1; char dsname[32]; char scalename[32]; - HDstrcpy(dsname, DATASET_NAME); - HDstrcat(dsname, "ac"); + + HDsnprintf(dsname, sizeof(dsname), "%s%s", DATASET_NAME, "ac"); TESTING2("test_char_attachscales"); @@ -1307,18 +1285,15 @@ static int test_char_attachscales(const char *fileext) goto out; if((did = H5Dopen2(fid, dsname, H5P_DEFAULT)) >= 0) { - HDstrcpy(scalename, DS_1_NAME); - HDstrcat(scalename, "ac"); + HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_1_NAME, "ac"); if(test_attach_scale(fid, did, scalename, DIM0) < 0) goto out; - HDstrcpy(scalename, DS_2_NAME); - HDstrcat(scalename, "ac"); + HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_2_NAME, "ac"); if(test_attach_scale(fid, did, scalename, DIM1) < 0) goto out; - HDstrcpy(scalename, DS_3_NAME); - HDstrcat(scalename, "ac"); + HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_3_NAME, "ac"); if(test_attach_scale(fid, did, scalename, DIM2) < 0) goto out; @@ -1350,8 +1325,8 @@ static int test_short_attachscales(const char *fileext) hid_t did = -1; char dsname[32]; char scalename[32]; - HDstrcpy(dsname, DATASET_NAME); - HDstrcat(dsname, "as"); + + HDsnprintf(dsname, sizeof(dsname), "%s%s", DATASET_NAME, "as"); TESTING2("test_short_attachscales"); @@ -1363,48 +1338,39 @@ static int test_short_attachscales(const char *fileext) goto out; if((did = H5Dopen2(fid, dsname, H5P_DEFAULT)) >= 0) { - HDstrcpy(scalename, DS_1_NAME); - HDstrcat(scalename, "as"); + HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_1_NAME, "as"); if(test_attach_scale(fid, did, scalename, DIM0) < 0) goto out; - HDstrcpy(scalename, DS_11_NAME); - HDstrcat(scalename, "as"); + HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_11_NAME, "as"); if(test_attach_scale(fid, did, scalename, DIM0) < 0) goto out; - HDstrcpy(scalename, DS_2_NAME); - HDstrcat(scalename, "as"); + HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_2_NAME, "as"); if(test_attach_scale(fid, did, scalename, DIM1) < 0) goto out; - HDstrcpy(scalename, DS_21_NAME); - HDstrcat(scalename, "as"); + HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_21_NAME, "as"); if(test_attach_scale(fid, did, scalename, DIM1) < 0) goto out; - HDstrcpy(scalename, DS_22_NAME); - HDstrcat(scalename, "as"); + HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_22_NAME, "as"); if(test_attach_scale(fid, did, scalename, DIM1) < 0) goto out; - HDstrcpy(scalename, DS_3_NAME); - HDstrcat(scalename, "as"); + HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_3_NAME, "as"); if(test_attach_scale(fid, did, scalename, DIM2) < 0) goto out; - HDstrcpy(scalename, DS_31_NAME); - HDstrcat(scalename, "as"); + HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_31_NAME, "as"); if(test_attach_scale(fid, did, scalename, DIM2) < 0) goto out; - HDstrcpy(scalename, DS_32_NAME); - HDstrcat(scalename, "as"); + HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_32_NAME, "as"); if(test_attach_scale(fid, did, scalename, DIM2) < 0) goto out; - HDstrcpy(scalename, DS_33_NAME); - HDstrcat(scalename, "as"); + HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_33_NAME, "as"); if(test_attach_scale(fid, did, scalename, DIM2) < 0) goto out; @@ -1436,8 +1402,8 @@ static int test_int_attachscales(const char *fileext) hid_t did = -1; char dsname[32]; char scalename[32]; - HDstrcpy(dsname, DATASET_NAME); - HDstrcat(dsname, "a"); + + HDsnprintf(dsname, sizeof(dsname), "%s%s", DATASET_NAME, "a"); TESTING2("test_int_attachscales"); @@ -1449,28 +1415,23 @@ static int test_int_attachscales(const char *fileext) goto out; if((did = H5Dopen2(fid, dsname, H5P_DEFAULT)) >= 0) { - HDstrcpy(scalename, DS_1_NAME); - HDstrcat(scalename, "a"); + HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_1_NAME, "a"); if(test_attach_scale(fid, did, scalename, DIM0) < 0) goto out; - HDstrcpy(scalename, DS_11_NAME); - HDstrcat(scalename, "a"); + HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_11_NAME, "a"); if(test_attach_scale(fid, did, scalename, DIM0) < 0) goto out; - HDstrcpy(scalename, DS_2_NAME); - HDstrcat(scalename, "a"); + HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_2_NAME, "a"); if(test_attach_scale(fid, did, scalename, DIM1) < 0) goto out; - HDstrcpy(scalename, DS_21_NAME); - HDstrcat(scalename, "a"); + HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_21_NAME, "a"); if(test_attach_scale(fid, did, scalename, DIM1) < 0) goto out; - HDstrcpy(scalename, DS_22_NAME); - HDstrcat(scalename, "a"); + HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_22_NAME, "a"); if(test_attach_scale(fid, did, scalename, DIM1) < 0) goto out; @@ -1502,8 +1463,8 @@ static int test_long_attachscales(const char *fileext) hid_t did = -1; char dsname[32]; char scalename[32]; - HDstrcpy(dsname, DATASET_NAME); - HDstrcat(dsname, "al"); + + HDsnprintf(dsname, sizeof(dsname), "%s%s", DATASET_NAME, "al"); TESTING2("test_long_attachscales"); @@ -1515,23 +1476,19 @@ static int test_long_attachscales(const char *fileext) goto out; if((did = H5Dopen2(fid, dsname, H5P_DEFAULT)) >= 0) { - HDstrcpy(scalename, DS_1_NAME); - HDstrcat(scalename, "al"); + HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_1_NAME, "al"); if(test_attach_scale(fid, did, scalename, DIM0) < 0) goto out; - HDstrcpy(scalename, DS_2_NAME); - HDstrcat(scalename, "al"); + HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_2_NAME, "al"); if(test_attach_scale(fid, did, scalename, DIM1) < 0) goto out; - HDstrcpy(scalename, DS_3_NAME); - HDstrcat(scalename, "al"); + HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_3_NAME, "al"); if(test_attach_scale(fid, did, scalename, DIM2) < 0) goto out; - HDstrcpy(scalename, DS_4_NAME); - HDstrcat(scalename, "al"); + HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_4_NAME, "al"); if(test_attach_scale(fid, did, scalename, DIM3) < 0) goto out; @@ -1563,8 +1520,8 @@ static int test_duplicatelong_attachscales(const char *fileext) hid_t did = -1; char dsname[32]; char scalename[32]; - HDstrcpy(dsname, DATASET_NAME); - HDstrcat(dsname, "al2"); + + HDsnprintf(dsname, sizeof(dsname), "%s%s", DATASET_NAME, "al2"); TESTING2("test_duplicatelong_attachscales"); @@ -1576,23 +1533,19 @@ static int test_duplicatelong_attachscales(const char *fileext) goto out; if((did = H5Dopen2(fid, dsname, H5P_DEFAULT)) >= 0) { - HDstrcpy(scalename, DS_1_NAME); - HDstrcat(scalename, "al"); + HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_1_NAME, "al"); if(test_attach_scale(fid, did, scalename, DIM0) < 0) goto out; - HDstrcpy(scalename, DS_2_NAME); - HDstrcat(scalename, "al"); + HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_2_NAME, "al"); if(test_attach_scale(fid, did, scalename, DIM1) < 0) goto out; - HDstrcpy(scalename, DS_3_NAME); - HDstrcat(scalename, "al"); + HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_3_NAME, "al"); if(test_attach_scale(fid, did, scalename, DIM2) < 0) goto out; - HDstrcpy(scalename, DS_4_NAME); - HDstrcat(scalename, "al"); + HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_4_NAME, "al"); if(test_attach_scale(fid, did, scalename, DIM3) < 0) goto out; @@ -1624,8 +1577,8 @@ static int test_float_attachscales(const char *fileext) hid_t did = -1; char dsname[32]; char scalename[32]; - HDstrcpy(dsname, DATASET_NAME); - HDstrcat(dsname, "af"); + + HDsnprintf(dsname, sizeof(dsname), "%s%s", DATASET_NAME, "af"); TESTING2("test_float_attachscales"); @@ -1637,28 +1590,23 @@ static int test_float_attachscales(const char *fileext) goto out; if((did = H5Dopen2(fid, dsname, H5P_DEFAULT)) >= 0) { - HDstrcpy(scalename, DS_1_NAME); - HDstrcat(scalename, "af"); + HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_1_NAME, "af"); if(test_attach_scale(fid, did, scalename, DIM0) < 0) goto out; - HDstrcpy(scalename, DS_11_NAME); - HDstrcat(scalename, "af"); + HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_11_NAME, "af"); if(test_attach_scale(fid, did, scalename, DIM0) < 0) goto out; - HDstrcpy(scalename, DS_2_NAME); - HDstrcat(scalename, "af"); + HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_2_NAME, "af"); if(test_attach_scale(fid, did, scalename, DIM1) < 0) goto out; - HDstrcpy(scalename, DS_21_NAME); - HDstrcat(scalename, "af"); + HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_21_NAME, "af"); if(test_attach_scale(fid, did, scalename, DIM1) < 0) goto out; - HDstrcpy(scalename, DS_22_NAME); - HDstrcat(scalename, "af"); + HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_22_NAME, "af"); if(test_attach_scale(fid, did, scalename, DIM1) < 0) goto out; @@ -1691,8 +1639,8 @@ static int test_numberofscales(const char *fileext) int nscales; /* number of scales in DIM */ char dsname[32]; char scalename[32]; - HDstrcpy(dsname, DATASET_NAME); - HDstrcat(dsname, "a"); + + HDsnprintf(dsname, sizeof(dsname), "%s%s", DATASET_NAME, "a"); TESTING2("test_numberofscales"); @@ -1718,8 +1666,7 @@ static int test_numberofscales(const char *fileext) else goto out; - HDstrcpy(dsname, DATASET_NAME); - HDstrcat(dsname, "b"); + HDsnprintf(dsname, sizeof(dsname), "%s%s", DATASET_NAME, "b"); /* make a dataset */ if(create_int_dataset(fid, "b", 1) < 0) @@ -1727,8 +1674,7 @@ static int test_numberofscales(const char *fileext) /* make a DS dataset for the first dimension */ if((did = H5Dopen2(fid, dsname, H5P_DEFAULT)) >= 0) { - HDstrcpy(scalename, DS_1_NAME); - HDstrcat(scalename, "b"); + HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_1_NAME, "b"); if(test_attach_scale(fid, did, scalename, DIM0) < 0) goto out; @@ -1772,38 +1718,32 @@ static int test_char_scalenames(const char *fileext) { char dsname[32]; char scalename[32]; char name[32]; - HDstrcpy(dsname, DATASET_NAME); - HDstrcat(dsname, "ac"); + + HDsnprintf(dsname, sizeof(dsname), "%s%s", DATASET_NAME, "ac"); if((fid = open_test_file(fileext)) < 0) goto out; TESTING2("set char scale/cmp scale name"); if((did = H5Dopen2(fid, dsname, H5P_DEFAULT)) >= 0) { - HDstrcpy(scalename, DS_1_NAME); - HDstrcat(scalename, "ac"); - HDstrcpy(name, SCALE_1_NAME); - HDstrcat(name, "ac"); + HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_1_NAME, "ac"); + HDsnprintf(name, sizeof(name), "%s%s", SCALE_1_NAME, "ac"); if(test_set_scalename(fid, did, scalename, name, DIM0) < 0) goto out; if(test_cmp_scalename(fid, did, scalename, name, DIM0) < 0) goto out; - HDstrcpy(scalename, DS_2_NAME); - HDstrcat(scalename, "ac"); - HDstrcpy(name, SCALE_2_NAME); - HDstrcat(name, "ac"); + HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_2_NAME, "ac"); + HDsnprintf(name, sizeof(name), "%s%s", SCALE_2_NAME, "ac"); if(test_set_scalename(fid, did, scalename, name, DIM1) < 0) goto out; if(test_cmp_scalename(fid, did, scalename, name, DIM1) < 0) goto out; - HDstrcpy(scalename, DS_3_NAME); - HDstrcat(scalename, "ac"); - HDstrcpy(name, SCALE_3_NAME); - HDstrcat(name, "ac"); + HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_3_NAME, "ac"); + HDsnprintf(name, sizeof(name), "%s%s", SCALE_3_NAME, "ac"); if(test_set_scalename(fid, did, scalename, name, DIM2) < 0) goto out; @@ -1838,98 +1778,80 @@ static int test_short_scalenames(const char *fileext) { char dsname[32]; char scalename[32]; char name[32]; - HDstrcpy(dsname, DATASET_NAME); - HDstrcat(dsname, "as"); + + HDsnprintf(dsname, sizeof(dsname), "%s%s", DATASET_NAME, "as"); if((fid = open_test_file(fileext)) < 0) goto out; TESTING2("set short scale/cmp scale name"); if((did = H5Dopen2(fid, dsname, H5P_DEFAULT)) >= 0) { - HDstrcpy(scalename, DS_1_NAME); - HDstrcat(scalename, "as"); - HDstrcpy(name, SCALE_1_NAME); - HDstrcat(name, "as"); + HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_1_NAME, "as"); + HDsnprintf(name, sizeof(name), "%s%s", SCALE_1_NAME, "as"); if(test_set_scalename(fid, did, scalename, name, DIM0) < 0) goto out; if(test_cmp_scalename(fid, did, scalename, name, DIM0) < 0) goto out; - HDstrcpy(scalename, DS_11_NAME); - HDstrcat(scalename, "as"); - HDstrcpy(name, SCALE_11_NAME); - HDstrcat(name, "as"); + HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_11_NAME, "as"); + HDsnprintf(name, sizeof(name), "%s%s", SCALE_11_NAME, "as"); if(test_set_scalename(fid, did, scalename, name, DIM0) < 0) goto out; if(test_cmp_scalename(fid, did, scalename, name, DIM0) < 0) goto out; - HDstrcpy(scalename, DS_2_NAME); - HDstrcat(scalename, "as"); - HDstrcpy(name, SCALE_2_NAME); - HDstrcat(name, "as"); + HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_2_NAME, "as"); + HDsnprintf(name, sizeof(name), "%s%s", SCALE_2_NAME, "as"); if(test_set_scalename(fid, did, scalename, name, DIM1) < 0) goto out; if(test_cmp_scalename(fid, did, scalename, name, DIM1) < 0) goto out; - HDstrcpy(scalename, DS_21_NAME); - HDstrcat(scalename, "as"); - HDstrcpy(name, SCALE_21_NAME); - HDstrcat(name, "as"); + HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_21_NAME, "as"); + HDsnprintf(name, sizeof(name), "%s%s", SCALE_21_NAME, "as"); if(test_set_scalename(fid, did, scalename, name, DIM1) < 0) goto out; if(test_cmp_scalename(fid, did, scalename, name, DIM1) < 0) goto out; - HDstrcpy(scalename, DS_22_NAME); - HDstrcat(scalename, "as"); - HDstrcpy(name, SCALE_22_NAME); - HDstrcat(name, "as"); + HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_22_NAME, "as"); + HDsnprintf(name, sizeof(name), "%s%s", SCALE_22_NAME, "as"); if(test_set_scalename(fid, did, scalename, name, DIM1) < 0) goto out; if(test_cmp_scalename(fid, did, scalename, name, DIM1) < 0) goto out; - HDstrcpy(scalename, DS_3_NAME); - HDstrcat(scalename, "as"); - HDstrcpy(name, SCALE_3_NAME); - HDstrcat(name, "as"); + HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_3_NAME, "as"); + HDsnprintf(name, sizeof(name), "%s%s", SCALE_3_NAME, "as"); if(test_set_scalename(fid, did, scalename, name, DIM2) < 0) goto out; if(test_cmp_scalename(fid, did, scalename, name, DIM2) < 0) goto out; - HDstrcpy(scalename, DS_31_NAME); - HDstrcat(scalename, "as"); - HDstrcpy(name, SCALE_31_NAME); - HDstrcat(name, "as"); + HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_31_NAME, "as"); + HDsnprintf(name, sizeof(name), "%s%s", SCALE_31_NAME, "as"); if(test_set_scalename(fid, did, scalename, name, DIM2) < 0) goto out; if(test_cmp_scalename(fid, did, scalename, name, DIM2) < 0) goto out; - HDstrcpy(scalename, DS_32_NAME); - HDstrcat(scalename, "as"); - HDstrcpy(name, SCALE_32_NAME); - HDstrcat(name, "as"); + HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_32_NAME, "as"); + HDsnprintf(name, sizeof(name), "%s%s", SCALE_32_NAME, "as"); if(test_set_scalename(fid, did, scalename, name, DIM2) < 0) goto out; if(test_cmp_scalename(fid, did, scalename, name, DIM2) < 0) goto out; - HDstrcpy(scalename, DS_33_NAME); - HDstrcat(scalename, "as"); - HDstrcpy(name, SCALE_33_NAME); - HDstrcat(name, "as"); + HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_33_NAME, "as"); + HDsnprintf(name, sizeof(name), "%s%s", SCALE_33_NAME, "as"); if(test_set_scalename(fid, did, scalename, name, DIM2) < 0) goto out; @@ -1964,58 +1886,48 @@ static int test_int_scalenames(const char *fileext) { char dsname[32]; char scalename[32]; char name[32]; - HDstrcpy(dsname, DATASET_NAME); - HDstrcat(dsname, "a"); + + HDsnprintf(dsname, sizeof(dsname), "%s%s", DATASET_NAME, "a"); if((fid = open_test_file(fileext)) < 0) goto out; TESTING2("set int scale/cmp scale name"); if((did = H5Dopen2(fid, dsname, H5P_DEFAULT)) >= 0) { - HDstrcpy(scalename, DS_1_NAME); - HDstrcat(scalename, "a"); - HDstrcpy(name, SCALE_1_NAME); - HDstrcat(name, "a"); + HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_1_NAME, "a"); + HDsnprintf(name, sizeof(name), "%s%s", SCALE_1_NAME, "a"); if(test_set_scalename(fid, did, scalename, name, DIM0) < 0) goto out; if(test_cmp_scalename(fid, did, scalename, name, DIM0) < 0) goto out; - HDstrcpy(scalename, DS_11_NAME); - HDstrcat(scalename, "a"); - HDstrcpy(name, SCALE_11_NAME); - HDstrcat(name, "a"); + HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_11_NAME, "a"); + HDsnprintf(name, sizeof(name), "%s%s", SCALE_11_NAME, "a"); if(test_set_scalename(fid, did, scalename, name, DIM0) < 0) goto out; if(test_cmp_scalename(fid, did, scalename, name, DIM0) < 0) goto out; - HDstrcpy(scalename, DS_2_NAME); - HDstrcat(scalename, "a"); - HDstrcpy(name, SCALE_2_NAME); - HDstrcat(name, "a"); + HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_2_NAME, "a"); + HDsnprintf(name, sizeof(name), "%s%s", SCALE_2_NAME, "a"); if(test_set_scalename(fid, did, scalename, name, DIM1) < 0) goto out; if(test_cmp_scalename(fid, did, scalename, name, DIM1) < 0) goto out; - HDstrcpy(scalename, DS_21_NAME); - HDstrcat(scalename, "a"); - HDstrcpy(name, SCALE_21_NAME); - HDstrcat(name, "a"); + HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_21_NAME, "a"); + HDsnprintf(name, sizeof(name), "%s%s", SCALE_21_NAME, "a"); if(test_set_scalename(fid, did, scalename, name, DIM1) < 0) goto out; if(test_cmp_scalename(fid, did, scalename, name, DIM1) < 0) goto out; - HDstrcpy(scalename, DS_22_NAME); - HDstrcat(scalename, "a"); - HDstrcpy(name, SCALE_22_NAME); - HDstrcat(name, "a"); + HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_22_NAME, "a"); + HDsnprintf(name, sizeof(name), "%s%s", SCALE_22_NAME, "a"); if(test_set_scalename(fid, did, scalename, name, DIM1) < 0) goto out; @@ -2050,48 +1962,40 @@ static int test_long_scalenames(const char *fileext) { char dsname[32]; char scalename[32]; char name[32]; - HDstrcpy(dsname, DATASET_NAME); - HDstrcat(dsname, "al"); + + HDsnprintf(dsname, sizeof(dsname), "%s%s", DATASET_NAME, "al"); if((fid = open_test_file(fileext)) < 0) goto out; TESTING2("set long scale/cmp scale name"); if((did = H5Dopen2(fid, dsname, H5P_DEFAULT)) >= 0) { - HDstrcpy(scalename, DS_1_NAME); - HDstrcat(scalename, "al"); - HDstrcpy(name, SCALE_1_NAME); - HDstrcat(name, "al"); + HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_1_NAME, "al"); + HDsnprintf(name, sizeof(name), "%s%s", SCALE_1_NAME, "al"); if(test_set_scalename(fid, did, scalename, name, DIM0) < 0) goto out; if(test_cmp_scalename(fid, did, scalename, name, DIM0) < 0) goto out; - HDstrcpy(scalename, DS_2_NAME); - HDstrcat(scalename, "al"); - HDstrcpy(name, SCALE_2_NAME); - HDstrcat(name, "al"); + HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_2_NAME, "al"); + HDsnprintf(name, sizeof(name), "%s%s", SCALE_2_NAME, "al"); if(test_set_scalename(fid, did, scalename, name, DIM1) < 0) goto out; if(test_cmp_scalename(fid, did, scalename, name, DIM1) < 0) goto out; - HDstrcpy(scalename, DS_3_NAME); - HDstrcat(scalename, "al"); - HDstrcpy(name, SCALE_3_NAME); - HDstrcat(name, "al"); + HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_3_NAME, "al"); + HDsnprintf(name, sizeof(name), "%s%s", SCALE_3_NAME, "al"); if(test_set_scalename(fid, did, scalename, name, DIM2) < 0) goto out; if(test_cmp_scalename(fid, did, scalename, name, DIM2) < 0) goto out; - HDstrcpy(scalename, DS_4_NAME); - HDstrcat(scalename, "al"); - HDstrcpy(name, SCALE_4_NAME); - HDstrcat(name, "al"); + HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_4_NAME, "al"); + HDsnprintf(name, sizeof(name), "%s%s", SCALE_4_NAME, "al"); if(test_set_scalename(fid, did, scalename, name, DIM3) < 0) goto out; @@ -2126,48 +2030,40 @@ static int test_samelong_scalenames(const char *fileext) { char dsname[32]; char scalename[32]; char name[32]; - HDstrcpy(dsname, DATASET_NAME); - HDstrcat(dsname, "al2"); + + HDsnprintf(dsname, sizeof(dsname), "%s%s", DATASET_NAME, "al2"); if((fid = open_test_file(fileext)) < 0) goto out; TESTING2("set same long scale/cmp scale name"); if((did = H5Dopen2(fid, dsname, H5P_DEFAULT)) >= 0) { - HDstrcpy(scalename, DS_1_NAME); - HDstrcat(scalename, "al"); - HDstrcpy(name, DS_1_NAME); - HDstrcat(name, "al"); + HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_1_NAME, "al"); + HDsnprintf(name, sizeof(name), "%s%s", DS_1_NAME, "al"); if(test_set_scalename(fid, did, scalename, name, DIM0) < 0) goto out; if(test_cmp_scalename(fid, did, scalename, name, DIM0) < 0) goto out; - HDstrcpy(scalename, DS_2_NAME); - HDstrcat(scalename, "al"); - HDstrcpy(name, DS_2_NAME); - HDstrcat(name, "al"); + HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_2_NAME, "al"); + HDsnprintf(name, sizeof(name), "%s%s", DS_2_NAME, "al"); if(test_set_scalename(fid, did, scalename, name, DIM1) < 0) goto out; if(test_cmp_scalename(fid, did, scalename, name, DIM1) < 0) goto out; - HDstrcpy(scalename, DS_3_NAME); - HDstrcat(scalename, "al"); - HDstrcpy(name, DS_3_NAME); - HDstrcat(name, "al"); + HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_3_NAME, "al"); + HDsnprintf(name, sizeof(name), "%s%s", DS_3_NAME, "al"); if(test_set_scalename(fid, did, scalename, name, DIM2) < 0) goto out; if(test_cmp_scalename(fid, did, scalename, name, DIM2) < 0) goto out; - HDstrcpy(scalename, DS_4_NAME); - HDstrcat(scalename, "al"); - HDstrcpy(name, DS_4_NAME); - HDstrcat(name, "al"); + HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_4_NAME, "al"); + HDsnprintf(name, sizeof(name), "%s%s", DS_4_NAME, "al"); if(test_set_scalename(fid, did, scalename, name, DIM3) < 0) goto out; @@ -2202,58 +2098,48 @@ static int test_float_scalenames(const char *fileext) { char dsname[32]; char scalename[32]; char name[32]; - HDstrcpy(dsname, DATASET_NAME); - HDstrcat(dsname, "af"); + + HDsnprintf(dsname, sizeof(dsname), "%s%s", DATASET_NAME, "af"); if((fid = open_test_file(fileext)) < 0) goto out; TESTING2("set float scale/cmp scale name"); if((did = H5Dopen2(fid, dsname, H5P_DEFAULT)) >= 0) { - HDstrcpy(scalename, DS_1_NAME); - HDstrcat(scalename, "af"); - HDstrcpy(name, SCALE_1_NAME); - HDstrcat(name, "af"); + HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_1_NAME, "af"); + HDsnprintf(name, sizeof(name), "%s%s", SCALE_1_NAME, "af"); if(test_set_scalename(fid, did, scalename, name, DIM0) < 0) goto out; if(test_cmp_scalename(fid, did, scalename, name, DIM0) < 0) goto out; - HDstrcpy(scalename, DS_11_NAME); - HDstrcat(scalename, "af"); - HDstrcpy(name, SCALE_11_NAME); - HDstrcat(name, "af"); + HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_11_NAME, "af"); + HDsnprintf(name, sizeof(name), "%s%s", SCALE_11_NAME, "af"); if(test_set_scalename(fid, did, scalename, name, DIM0) < 0) goto out; if(test_cmp_scalename(fid, did, scalename, name, DIM0) < 0) goto out; - HDstrcpy(scalename, DS_2_NAME); - HDstrcat(scalename, "af"); - HDstrcpy(name, SCALE_2_NAME); - HDstrcat(name, "af"); + HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_2_NAME, "af"); + HDsnprintf(name, sizeof(name), "%s%s", SCALE_2_NAME, "af"); if(test_set_scalename(fid, did, scalename, name, DIM1) < 0) goto out; if(test_cmp_scalename(fid, did, scalename, name, DIM1) < 0) goto out; - HDstrcpy(scalename, DS_21_NAME); - HDstrcat(scalename, "af"); - HDstrcpy(name, SCALE_21_NAME); - HDstrcat(name, "af"); + HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_21_NAME, "af"); + HDsnprintf(name, sizeof(name), "%s%s", SCALE_21_NAME, "af"); if(test_set_scalename(fid, did, scalename, name, DIM1) < 0) goto out; if(test_cmp_scalename(fid, did, scalename, name, DIM1) < 0) goto out; - HDstrcpy(scalename, DS_22_NAME); - HDstrcat(scalename, "af"); - HDstrcpy(name, SCALE_22_NAME); - HDstrcat(name, "af"); + HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_22_NAME, "af"); + HDsnprintf(name, sizeof(name), "%s%s", SCALE_22_NAME, "af"); if(test_set_scalename(fid, did, scalename, name, DIM1) < 0) goto out; @@ -3150,9 +3036,9 @@ static int test_simple(void) goto out; if(H5DSget_label(did,DIM1,dim1_label,sizeof(dim1_label)) < 0) goto out; - if(HDstrcmp(DIM0_LABEL,dim0_label)!=0) + if(HDstrncmp(DIM0_LABEL,dim0_label,sizeof(dim0_label))!=0) goto out; - if(HDstrcmp(DIM1_LABEL,dim1_label)!=0) + if(HDstrncmp(DIM1_LABEL,dim1_label,sizeof(dim1_label))!=0) goto out; /*------------------------------------------------------------------------- @@ -3166,8 +3052,8 @@ static int test_simple(void) goto out; /* allocate */ - dim0_labeld = (char*)HDmalloc(dim0_label_size * sizeof (char)); - dim1_labeld = (char*)HDmalloc(dim1_label_size * sizeof (char)); + dim0_labeld = (char*)HDmalloc((size_t)dim0_label_size * sizeof (char)); + dim1_labeld = (char*)HDmalloc((size_t)dim1_label_size * sizeof (char)); if( dim0_labeld==NULL || dim1_labeld==NULL) goto out; if(H5DSget_label(did,DIM0,dim0_labeld,(size_t)dim0_label_size) < 0) @@ -3197,9 +3083,9 @@ static int test_simple(void) goto out; if(H5DSget_label(did,DIM1,dim1_labels,sizeof(dim1_labels)) < 0) goto out; - if(HDstrncmp(DIM0_LABEL,dim0_label,sizeof(dim0_labels)-1)!=0) + if(HDstrncmp(DIM0_LABEL,dim0_labels,sizeof(dim0_labels)-1)!=0) goto out; - if(HDstrncmp(DIM1_LABEL,dim1_label,sizeof(dim1_labels)-1)!=0) + if(HDstrncmp(DIM1_LABEL,dim1_labels,sizeof(dim1_labels)-1)!=0) goto out; if(H5Dclose(did)) goto out; @@ -3232,7 +3118,7 @@ static int test_simple(void) goto out; /* allocate a buffer */ - name_out = (char*)HDmalloc((name_len+1) * sizeof (char)); + name_out = (char*)HDmalloc(((size_t)name_len+1) * sizeof (char)); if(name_out == NULL) goto out; @@ -3240,7 +3126,7 @@ static int test_simple(void) if(H5DSget_scale_name(dsid, name_out, (size_t)name_len+1) < 0) goto out; - if(HDstrcmp("Latitude set 0",name_out)!=0) + if(HDstrncmp("Latitude set 0",name_out, sizeof(name_out))!=0) goto out; if(name_out) { HDfree(name_out); @@ -3253,10 +3139,10 @@ static int test_simple(void) */ /* get the scale name using this buffer */ - if(H5DSget_scale_name(dsid, sname, sizeof (sname)) < 0) + if(H5DSget_scale_name(dsid, sname, sizeof(sname)) < 0) goto out; - if(HDstrcmp("Latitude set 0",sname)!=0) + if(HDstrncmp("Latitude set 0", sname, sizeof(sname))!=0) goto out; /*------------------------------------------------------------------------- @@ -3642,7 +3528,7 @@ static herr_t read_scale(hid_t dset, unsigned dim, hid_t scale_id, void *visitor goto out; if(nelmts) { - buf=(char *)HDmalloc((size_t)(nelmts*size)); + buf=(char *)HDmalloc(((size_t)nelmts*size)); if(buf==NULL) goto out; if(H5Dread(scale_id,mtid,H5S_ALL,H5S_ALL,H5P_DEFAULT,buf) < 0) @@ -4529,9 +4415,9 @@ static int test_rank(void) goto out; if(H5DSget_label(did,(unsigned)i,namel,sizeof(namel)) < 0) goto out; - if(HDstrcmp(name,names)!=0) + if(HDstrncmp(name, names, sizeof(names))!=0) goto out; - if(HDstrcmp(name,namel)!=0) + if(HDstrncmp(name, namel, sizeof(namel))!=0) goto out; } @@ -4986,8 +4872,8 @@ static int read_data( const char* fname, for(i=0, nelms=1; i < ndims; i++) { fscanf( f, "%s %u", str, &j); fscanf( f, "%d",&n ); - dims[i] = n; - nelms *= n; + dims[i] = (hsize_t)n; + nelms *= (size_t)n; } *buf = (float*) HDmalloc (nelms * sizeof( float )); diff --git a/hl/test/test_image.c b/hl/test/test_image.c index a4a10e4..38f1830 100644 --- a/hl/test/test_image.c +++ b/hl/test/test_image.c @@ -100,24 +100,34 @@ static int test_simple(void) hssize_t npals; /* 8-bit image */ - unsigned char buf1 [ WIDTH*HEIGHT ]; + unsigned char *buf1 = NULL; unsigned char pal[ PAL_ENTRIES * 3 ]; /* palette array */ hsize_t pal_dims[2] = {PAL_ENTRIES,3}; /* palette dimensions */ /* 24-bit image */ - unsigned char buf2 [ WIDTH*HEIGHT*3 ]; + unsigned char *buf2 = NULL; /* read data */ - unsigned char buf1_out [ WIDTH*HEIGHT ]; - unsigned char buf2_out [ WIDTH*HEIGHT*3 ]; + unsigned char *buf1_out = NULL; + unsigned char *buf2_out = NULL; unsigned char pal_out[ PAL_ENTRIES * 3 ]; /* palette array */ hsize_t pal_dims_out[2]; /* palette dimensions */ + /* Allocate image buffers */ + buf1 = (unsigned char *)HDmalloc(WIDTH * HEIGHT); + HDassert(buf1); + buf2 = (unsigned char *)HDmalloc(WIDTH * HEIGHT * 3); + HDassert(buf2); + buf1_out = (unsigned char *)HDmalloc(WIDTH * HEIGHT); + HDassert(buf1_out); + buf2_out = (unsigned char *)HDmalloc(WIDTH * HEIGHT * 3); + HDassert(buf2_out); + /* create an image */ space = WIDTH*HEIGHT / PAL_ENTRIES; for (i=0, j=0, n=0; i < WIDTH*HEIGHT; i++, j++ ) { - buf1[i] = n; + buf1[i] = (unsigned char)n; if ( j > space ) { n++; @@ -126,17 +136,13 @@ static int test_simple(void) } - /* create an image */ space = WIDTH*HEIGHT / 256; for (i=0, j=0, n=0; i < WIDTH*HEIGHT*3; i+=3, j++ ) { - unsigned char r, g, b; - - r = n; g = 0; b = 255-n; - buf2[i] = r; - buf2[i+1] = g; - buf2[i+2] = b; + buf2[i] = (unsigned char)n; + buf2[i+1] = 0; + buf2[i+2] = (unsigned char)(255 - n); if ( j > space ) { n++; @@ -150,9 +156,9 @@ static int test_simple(void) */ for ( i=0, n=0; i<PAL_ENTRIES*3; i+=3, n++) { - pal[i] =n; /* red */ + pal[i] =(unsigned char)n; /* red */ pal[i+1]=0; /* green */ - pal[i+2]=255-n; /* blue */ + pal[i+2]=(unsigned char)(255 - n); /* blue */ } /* Create a new HDF5 file using default properties. */ @@ -283,6 +289,15 @@ static int test_simple(void) *------------------------------------------------------------------------- */ + if(buf1) + HDfree(buf1); + if(buf2) + HDfree(buf2); + if(buf1_out) + HDfree(buf1_out); + if(buf2_out) + HDfree(buf2_out); + /* Close the file. */ if(H5Fclose( fid ) < 0) goto out; @@ -294,6 +309,14 @@ static int test_simple(void) /* error zone, gracefully close */ out: + if(buf1) + HDfree(buf1); + if(buf2) + HDfree(buf2); + if(buf1_out) + HDfree(buf1_out); + if(buf2_out) + HDfree(buf2_out); H5E_BEGIN_TRY { H5Fclose(fid); } H5E_END_TRY; @@ -367,7 +390,7 @@ static int test_data(void) */ /* read a PAL file */ - if (read_palette(PAL2_FILE, rgb, sizeof(rgb))<0) + if (read_palette(PAL2_FILE, rgb, (sizeof(rgb) / sizeof(rgb[0]))) < 0) goto out; /* transfer to the HDF5 buffer */ @@ -393,7 +416,7 @@ static int test_data(void) */ /* read a PAL file */ - if (read_palette(PAL3_FILE, rgb, sizeof(rgb))<0) + if (read_palette(PAL3_FILE, rgb, (sizeof(rgb) / sizeof(rgb[0]))) < 0) goto out; /* transfer to the HDF5 buffer */ @@ -422,9 +445,9 @@ static int test_data(void) */ for ( i=0, n=0; i<256*3; i+=3, n++) { - pal[i] =n; + pal[i] =(unsigned char)n; pal[i+1]=0; - pal[i+2]=255-n; + pal[i+2]=(unsigned char)(255 - n); } /* make a palette */ @@ -478,13 +501,21 @@ static int test_data(void) if (H5Fclose(fid)<0) goto out; + /* Release memory buffer */ + HDfree(image_data); + return 0; /* error zone, gracefully close */ out: + /* Release memory buffer */ + if(image_data) + HDfree(image_data); + H5E_BEGIN_TRY { H5Fclose(fid); } H5E_END_TRY; + H5_FAILED(); return FAIL; } @@ -509,6 +540,7 @@ static int test_generate(void) hsize_t pal_dims[2] = { 256, 3 }; float *data; int imax, jmax, kmax; + int n_elements; float valex, xmin, xmax, value; FILE *f; const char *data_file = H5_get_srcdir_filename(DATA_FILE4); @@ -530,8 +562,7 @@ static int test_generate(void) if ( f == NULL ) { printf( "Could not find file %s. Try set $srcdir \n", data_file ); - H5Fclose(fid); - return -1; + goto out; } /* @@ -573,10 +604,30 @@ static int test_generate(void) fscanf( f, "%d %d %d", &imax, &jmax, &kmax ); fscanf( f, "%f %f %f", &valex, &xmin, &xmax ); - data = (float*) HDmalloc ( imax * jmax * kmax * sizeof( float )); - image_data = (unsigned char*) HDmalloc ( imax * jmax * kmax * sizeof( unsigned char )); + /* Sanity check on scanned-in values */ + if(imax < 1 || jmax < 1 || kmax < 1) + goto out; - for ( i = 0; i < imax * jmax * kmax; i++ ) + /* Test product for integer overflow */ + if(imax > INT_MAX / jmax) + goto out; + if(imax * jmax > INT_MAX / kmax) + goto out; + + n_elements = imax * jmax * kmax; + + /* Test buffer sizes for overflow */ + if(n_elements > INT_MAX / (int)sizeof(unsigned char)) + goto out; + if(n_elements > INT_MAX / (int)sizeof(float)) + goto out; + + data = (float *)HDmalloc((size_t)n_elements * sizeof( float )); + HDassert(data); + image_data = (unsigned char *)HDmalloc((size_t)n_elements * sizeof( unsigned char )); + HDassert(image_data); + + for ( i = 0; i < n_elements; i++ ) { fscanf( f, "%f ", &value ); data[i] = value; @@ -591,10 +642,8 @@ static int test_generate(void) TESTING2("make indexed image from all the data"); - for ( i = 0; i < imax * jmax * kmax; i++ ) - { + for ( i = 0; i < n_elements; i++ ) image_data[i] = (unsigned char)(( 255 * (data[i] - xmin ) ) / (xmax - xmin )); - } /* Make the image */ if ((H5IMmake_image_8bit(fid,"All data",(hsize_t)imax,(hsize_t)jmax,image_data))<0) @@ -610,7 +659,7 @@ static int test_generate(void) TESTING2("make indexed image from land data"); - for ( i = 0; i < imax * jmax * kmax; i++ ) + for ( i = 0; i < n_elements; i++ ) { if ( data[i] < 0 ) image_data[i] = 0; @@ -632,7 +681,7 @@ static int test_generate(void) TESTING2("make indexed image from sea data"); - for ( i = 0; i < imax * jmax * kmax; i++ ) + for ( i = 0; i < n_elements; i++ ) { if ( data[i] > 0 ) image_data[i] = 0; @@ -675,12 +724,21 @@ static int test_generate(void) if (H5Fclose(fid)<0) goto out; + /* Release memory buffers */ + HDfree(data); + HDfree(image_data); + /* Indicate success */ return 0; /* error zone, gracefully close */ out: - HDfree(data); + /* Release memory buffers */ + if(data) + HDfree(data); + if(image_data) + HDfree(image_data); + H5E_BEGIN_TRY { H5Fclose(fid); } H5E_END_TRY; @@ -713,51 +771,71 @@ static int read_data( const char* fname, /*IN*/ int i, n; int color_planes; char str[20]; - FILE *f; + FILE *f = NULL; int w, h; + int n_elements; const char *data_file = H5_get_srcdir_filename(fname); + int ret_val = -1; /*------------------------------------------------------------------------- * read *------------------------------------------------------------------------- */ - f = HDfopen(data_file, "r"); - if ( f == NULL ) - { + if(NULL == (f = HDfopen(data_file, "r"))) { printf( "Could not open file %s. Try set $srcdir \n", data_file ); - return -1; + goto out; } - fscanf( f, "%s", str ); - fscanf( f, "%d", &color_planes ); - fscanf( f, "%s", str ); - fscanf( f, "%d", &h); - fscanf( f, "%s", str ); - fscanf( f, "%d", &w); + fscanf(f, "%s", str); + fscanf(f, "%d", &color_planes); + fscanf(f, "%s", str); + fscanf(f, "%d", &h); + fscanf(f, "%s", str); + fscanf(f, "%d", &w); *width = (hsize_t)w; *height = (hsize_t)h; - if ( image_data ) - { - HDfree( image_data ); - image_data=NULL; - } + /* Check product for overflow */ + if(w < 1 || h < 1 || color_planes < 1) + goto out; + if(w > INT_MAX / h) + goto out; + if(w * h > INT_MAX / color_planes) + goto out; - image_data = (unsigned char*) HDmalloc (w * h * color_planes * sizeof( unsigned char )); + /* Compute buffer size */ + n_elements = w * h * color_planes; - for (i = 0; i < h * w * color_planes ; i++) - { - fscanf( f, "%d",&n ); + /* Check buffer size for overflow */ + if(n_elements > INT_MAX / (int)sizeof(unsigned char)) + goto out; + + /* Release the buffer, if it was previously allocated */ + if(image_data) { + HDfree(image_data); + image_data = NULL; + } /* end if */ + + /* Allocate the image data buffer */ + image_data = (unsigned char *)HDmalloc((size_t)n_elements * sizeof(unsigned char)); + + /* Read data elements */ + for(i = 0; i < n_elements; i++) { + fscanf(f, "%d",&n); image_data[i] = (unsigned char)n; - } - HDfclose(f); + } /* end for */ - return 1; + /* Indicate success */ + ret_val = 1; -} +out: + if(f) + HDfclose(f); + return ret_val; +} /* end read_data() */ /*------------------------------------------------------------------------- @@ -882,6 +960,6 @@ static int read_palette(const char* fname, /* close file */ HDfclose(file); - return nentries; + return (int)nentries; } diff --git a/hl/tools/CMakeLists.txt b/hl/tools/CMakeLists.txt index 4887b6c..1deff23 100644 --- a/hl/tools/CMakeLists.txt +++ b/hl/tools/CMakeLists.txt @@ -19,6 +19,7 @@ INCLUDE_DIRECTORIES (${HDF5_HL_TOOLS_SOURCE_DIR}/gif2h5) ADD_EXECUTABLE (gif2h5 ${GIF2H5_SRCS}) TARGET_NAMING (gif2h5 ${LIB_TYPE}) +TARGET_C_PROPERTIES (gif2h5 " " " ") TARGET_LINK_LIBRARIES (gif2h5 ${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) SET_TARGET_PROPERTIES (gif2h5 PROPERTIES FOLDER tools/hl) @@ -29,6 +30,7 @@ SET (hdf2gif_SRCS ) ADD_EXECUTABLE (h52gif ${hdf2gif_SRCS}) TARGET_NAMING (h52gif ${LIB_TYPE}) +TARGET_C_PROPERTIES (h52gif " " " ") TARGET_LINK_LIBRARIES (h52gif ${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) SET_TARGET_PROPERTIES (h52gif PROPERTIES FOLDER tools/hl) @@ -40,6 +42,7 @@ SET_TARGET_PROPERTIES (h52gif PROPERTIES FOLDER tools/hl) IF (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) ADD_EXECUTABLE (hl_h52gifgentest ${HDF5_HL_TOOLS_SOURCE_DIR}/gif2h5/h52gifgentst.c) TARGET_NAMING (hl_h52gifgentest ${LIB_TYPE}) + TARGET_C_PROPERTIES (hl_h52gifgentest " " " ") TARGET_LINK_LIBRARIES (hl_h52gifgentest ${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET}) SET_TARGET_PROPERTIES (hl_h52gifgentest PROPERTIES FOLDER generator/tools/hl) diff --git a/perform/CMakeLists.txt b/perform/CMakeLists.txt index 3f8b9b7..f3aed76 100644 --- a/perform/CMakeLists.txt +++ b/perform/CMakeLists.txt @@ -23,6 +23,7 @@ SET (h5perf_serial_SRCS ) ADD_EXECUTABLE (h5perf_serial ${h5perf_serial_SRCS}) TARGET_NAMING (h5perf_serial ${LIB_TYPE}) +TARGET_C_PROPERTIES (h5perf_serial " " " ") TARGET_LINK_LIBRARIES (h5perf_serial ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) SET_TARGET_PROPERTIES (h5perf_serial PROPERTIES FOLDER perform) @@ -38,6 +39,7 @@ IF (HDF5_BUILD_PERFORM_STANDALONE) APPEND PROPERTY COMPILE_DEFINITIONS STANDALONE ) TARGET_NAMING (h5perf_serial_alone ${LIB_TYPE}) + TARGET_C_PROPERTIES (h5perf_serial_alone " " " ") TARGET_LINK_LIBRARIES (h5perf_serial_alone ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) SET_TARGET_PROPERTIES (h5perf_serial_alone PROPERTIES FOLDER perform) ENDIF (HDF5_BUILD_PERFORM_STANDALONE) @@ -48,6 +50,7 @@ SET (chunk_SRCS ) ADD_EXECUTABLE(chunk ${chunk_SRCS}) TARGET_NAMING (chunk ${LIB_TYPE}) +TARGET_C_PROPERTIES (chunk " " " ") TARGET_LINK_LIBRARIES(chunk ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) SET_TARGET_PROPERTIES (chunk PROPERTIES FOLDER perform) @@ -57,6 +60,7 @@ SET (iopipe_SRCS ) ADD_EXECUTABLE (iopipe ${iopipe_SRCS}) TARGET_NAMING (iopipe ${LIB_TYPE}) +TARGET_C_PROPERTIES (iopipe " " " ") TARGET_LINK_LIBRARIES (iopipe ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) SET_TARGET_PROPERTIES (iopipe PROPERTIES FOLDER perform) @@ -66,6 +70,7 @@ SET (overhead_SRCS ) ADD_EXECUTABLE (overhead ${overhead_SRCS}) TARGET_NAMING (overhead ${LIB_TYPE}) +TARGET_C_PROPERTIES (overhead " " " ") TARGET_LINK_LIBRARIES (overhead ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) SET_TARGET_PROPERTIES (overhead PROPERTIES FOLDER perform) @@ -75,6 +80,7 @@ SET (perf_meta_SRCS ) ADD_EXECUTABLE (perf_meta ${perf_meta_SRCS}) TARGET_NAMING (perf_meta ${LIB_TYPE}) +TARGET_C_PROPERTIES (perf_meta " " " ") TARGET_LINK_LIBRARIES (perf_meta ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) SET_TARGET_PROPERTIES (perf_meta PROPERTIES FOLDER perform) @@ -84,6 +90,7 @@ SET (zip_perf_SRCS ) ADD_EXECUTABLE (zip_perf ${zip_perf_SRCS}) TARGET_NAMING (zip_perf ${LIB_TYPE}) +TARGET_C_PROPERTIES (zip_perf " " " ") TARGET_LINK_LIBRARIES (zip_perf ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) SET_TARGET_PROPERTIES (zip_perf PROPERTIES FOLDER perform) @@ -96,6 +103,7 @@ IF (H5_HAVE_PARALLEL) ) ADD_EXECUTABLE (h5perf ${h5perf_SRCS}) TARGET_NAMING (h5perf ${LIB_TYPE}) + TARGET_C_PROPERTIES (h5perf " " " ") TARGET_LINK_LIBRARIES (h5perf ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) SET_TARGET_PROPERTIES (h5perf PROPERTIES FOLDER perform) @@ -111,6 +119,7 @@ IF (H5_HAVE_PARALLEL) APPEND PROPERTY COMPILE_DEFINITIONS STANDALONE ) TARGET_NAMING (h5perf_alone ${LIB_TYPE}) + TARGET_C_PROPERTIES (h5perf_alone " " " ") TARGET_LINK_LIBRARIES (h5perf_alone ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) SET_TARGET_PROPERTIES (h5perf_alone PROPERTIES FOLDER perform) ENDIF (HDF5_BUILD_PERFORM_STANDALONE) @@ -122,6 +131,7 @@ IF (H5_HAVE_PARALLEL) ) ADD_EXECUTABLE (benchpar ${benchpar_SRCS}) TARGET_NAMING (benchpar ${LIB_TYPE}) + TARGET_C_PROPERTIES (benchpar " " " ") TARGET_LINK_LIBRARIES (benchpar ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) SET_TARGET_PROPERTIES (benchpar PROPERTIES FOLDER perform) ENDIF (HDF5_BUILD_PARALLEL_ALL) diff --git a/release_docs/CMake.txt b/release_docs/INSTALL_CMake.txt index 81dfb61..95ebec9 100644 --- a/release_docs/CMake.txt +++ b/release_docs/INSTALL_CMake.txt @@ -2,65 +2,112 @@ * Build and Install HDF5 C/C++ Library with CMake * ************************************************************************ -Notes: This short instruction is written for users who want to quickly build - HDF5 library and tools from the HDF5 source code package using the - CMake tools. - - More information about using CMake can be found at the KitWare site, - www.cmake.org. - - CMake uses the command line, however the visual CMake tool is - recommended for the configuration step. The steps are similar for - all the operating systems supported by CMake. + Table of Contents + +Section I: Quick Step Building HDF5 Libraries with CMake +Section II: Preconditions +Section III: Building HDF5 C/C++ Libraries with CMake +Section IV: All Options for HDF5 C/C++ Libraries with CMake +Section V: APPENDIX + +************************************************************************ + + + +======================================================================== +I. Quick Step Building HDF5 Libraries with CMake +======================================================================== +Notes: This short set of instructions is written for users who want to + quickly build the HDF5 Library and tools from the HDF5 source code + package using the CMake tools. - NOTES: - 1. Using CMake for building and using HDF5 is under active development. - While we have attempted to provide error-free files, please - understand that development with CMake has not been extensively - tested outside of HDF. The CMake specific files may change - before the next release. - - 2. CMake was originally introduced to support development on Windows, - however it should be usable on any system where CMake is supported. - Please send us any comments on how CMake support can be improved on - any system. Visit the KitWare site for more information about CMake. - - 3. Build and test results can be submitted to our CDash server at: - cdash.hdfgroup.uiuc.edu. - Please read the HDF and CDash document at: - www.hdfgroup.org/CDash/HowToSubmit. - - 4. See the appendix at the bottom of this file for examples of using - a ctest script for building and testing. - + A. Windows Quick Step Building HDF5 Libraries with CMake Using VS2010 + + Go through these steps: + + 1. Locate the source files in: + c:\MyHDFstuff\hdf5 + + 2. Create a build folder at: + c:\MyHDFstuff\hdf5\build + + 3. Open a command prompt at: + c:\MyHDFstuff\hdf5\build + + 4. Configure the C library, tools and tests with this command: + cmake -G "Visual Studio 10" -DBUILD_TESTING:BOOL=ON -DHDF5_BUILD_TOOLS:BOOL=ON .. + + 3. Build the C library, tools and tests with this command: + cmake --build . --config Release + + 4. Test the C library and tools with this command: + ctest . -C Release + + 5. Create an install image with this command: + cpack -C Release CPackConfig.cmake + + 6. Install with this command: + HDF5-1.8.11-win32.exe + + B. Linux Quick Step Building HDF5 Libraries with CMake Using GCC + + Go through these steps: + 1. Locate the source files in: + ~\MyHDFstuff\hdf5 + + 2. Create a build folder at: + ~\MyHDFstuff\hdf5\build + + 3. Open a command prompt at: + ~\MyHDFstuff\hdf5\build + + 4. Configure the C library, tools and tests with this command: + cmake -G "Unix Makefiles" -DBUILD_TESTING:BOOL=ON -DHDF5_BUILD_TOOLS:BOOL=ON .. + + 3. Build the C library, tools and tests with this command: + cmake --build . --config Release + + 4. Test the C library and tools with this command: + ctest . -C Release + + 5. Create an install image with this command: + cpack -C Release CPackConfig.cmake + + 6. Install with this command: + HDF5-1.8.11-Linux.sh + + + + +======================================================================== +II. Preconditions ======================================================================== - Preconditions -======================================================================== 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.10. + web site. The HDF5 1.8.x product requires a minimum CMake version 2.8.10. - 2. If you plan to use Zlib or Szip; - A. Download the packages and install them - in a central location. For example on Windows, create a folder extlibs - and install the packages there. - B. Use source packages from a SVN server by adding the following CMake + 2. If you plan to use Zlib or Szip: + A. Download the packages and install them in a central location. + For example on Windows, create a folder extlibs and install the + packages there. + B. Use source packages from an SVN server by adding the following CMake options: HDF5_ALLOW_EXTERNAL_SUPPORT:STRING="SVN" ZLIB_SVN_URL:STRING="http://some_location/zlib/trunk" SZIP_SVN_URL:STRING="http://some_location/szip/trunk" where "some_location" is the URL to the SVN repository. - C. Use source packages from a compressed file by adding the following CMake - options: + C. Use source packages from a compressed file by adding the following + CMake options: HDF5_ALLOW_EXTERNAL_SUPPORT:STRING="TGZ" ZLIB_TGZ_NAME:STRING="zlib_src.ext" SZIP_TGZ_NAME:STRING="szip_src.ext" TGZ_PATH:STRING="some_location" - where "some_location" is the URL or full path to the compressed file and - ext is the type of compression file. + where "some_location" is the URL or full path to the compressed + file and ext is the type of compression file. - 3. Building on Apple Darwin platforms should add the following options: + 3. If you are building on Apple Darwin platforms, you should add the + following options: Compiler choice - use xcode by setting the ENV variables of CC and CXX Shared fortran is not supported, build static: BUILD_SHARED_LIBS:BOOL=OFF @@ -69,9 +116,55 @@ Notes: This short instruction is written for users who want to quickly build CTEST_USE_LAUNCHERS:BOOL=ON CMAKE_BUILD_WITH_INSTALL_RPATH:BOOL=OFF - + 4. Windows developers should install NSIS to create an install image with CPack. + Visual Studio Express users will not be able to package HDF5 into + an install image executable. + + +Notes: More information about using CMake can be found at the KitWare site, + www.cmake.org. + + CMake uses the command line; however, the visual CMake tool is + recommended for the configuration step. The steps are similar for + all the operating systems supported by CMake. + + NOTES: + 1. Using CMake for building and using HDF5 is under active development. + While we have attempted to provide error-free files, please + understand that development with CMake has not been extensively + tested outside of HDF. The CMake specific files may change + before the next release. + + 2. CMake support for HDF5 development should be usable on any + system where CMake is supported. Please send us any comments on + how CMake support can be improved on any system. Visit the + KitWare site for more information about CMake. + + 3. Build and test results can be submitted to our CDash server at: + cdash.hdfgroup.uiuc.edu. + Please read the HDF and CDash document at: + www.hdfgroup.org/CDash/HowToSubmit. + + 4. See the appendix at the bottom of this file for examples of using + a ctest script for building and testing. + + + + ======================================================================== - Building HDF5 C/C++ Libraries with CMake +III. Building HDF5 C/C++ Libraries with CMake +======================================================================== + +To build the HDF5 C/C++ Libraries with CMake, go through these five steps: + + 1. Run CMake + 2. Configure the cache settings + 3. Build HDF5 + 4. Test HDF5 + 5. Packaging HDF5 (create install image) + +These five steps are described in detail below. + ======================================================================== 1. Run CMake @@ -80,18 +173,21 @@ Notes: This short instruction is written for users who want to quickly build available in your Start menu. For Linux, UNIX, and Mac users the executable is named "cmake-gui" and can be found where CMake was installed. + Specify the source and build directories. - ***** It is recommemded that you 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). + + ***** Make the build and source directories different. ****** + + For example on Windows, if the source is at c:\MyHDFstuff\hdf5, + then use c:\MyHDFstuff\hdf5\build or c:\MyHDFstuff\build\hdf5 as the + build directory. 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: + 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 <sourcepath>/config/cmake/cacheinit.cmake -G "<generator>" [-D<options>] <sourcepath> @@ -101,6 +197,8 @@ Notes: This short instruction is written for users who want to quickly build * MinGW Makefiles * NMake Makefiles * Unix Makefiles + * Visual Studio 11 + * Visual Studio 11 Win64 * Visual Studio 10 * Visual Studio 10 Win64 * Visual Studio 6 @@ -119,7 +217,7 @@ Notes: This short instruction is written for users who want to quickly build * <HDF5OPTION>:BOOL=[ON | OFF] <cacheinit.cmake> is: - # This is the CMakeCache file. + # This is the CMakeCache file used by HDF Group for daily tests. ######################## # EXTERNAL cache entries ######################## @@ -167,7 +265,7 @@ Notes: This short instruction is written for users who want to quickly build 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. + can adjust the cache settings and/or specify the 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 @@ -185,8 +283,8 @@ Notes: This short instruction is written for users who want to quickly build cmake -C ../config/cmake/cacheinit.cmake -G "Visual Studio 9 2008" \ -DHDF5_ENABLE_SZIP_SUPPORT:BOOL=OFF -DHDF5_ENABLE_Z_LIB_SUPPORT:BOOL=OFF .. - 2.3 On Windows, if you are using a VS Express version you must be sure that the - following two options are correctly set/unset: + 2.3 On Windows, if you are using a Visual Studio Express version you must + be sure that the following two options are correctly set/unset: HDF5_NO_PACKAGES:BOOL=ON HDF5_USE_FOLDERS:BOOL=OFF @@ -197,7 +295,7 @@ Notes: This short instruction is written for users who want to quickly build or the command line. The command line is used on linux, Unix, and Mac. To build from the command line, navigate to your build directory and - execute the following; + execute the following: cmake --build . --config {Debug | Release} @@ -209,33 +307,34 @@ Notes: This short instruction is written for users who want to quickly build Release and build the solution. 3.2.1 The external libraries (zlib and szip) can be configured - to allow building the libraries by downloading from a SVN repository. + to allow building the libraries by downloading from an SVN repository. The option is 'HDF5_ALLOW_EXTERNAL_SUPPORT'; by adding the following configuration option: -DHDF5_ALLOW_EXTERNAL_SUPPORT:STRING="SVN" - The options to control the SVN URL (config/cmake/cacheinit.cmake file): + The options to control the SVN URL (config/cmake/cacheinit.cmake file) are: ZLIB_SVN_URL:STRING="http://svn.hdfgroup.uiuc.edu/zlib/trunk" SZIP_SVN_URL:STRING="http://svn.hdfgroup.uiuc.edu/szip/trunk" These should be changed to your location. 3.2.2 Or the external libraries (zlib and szip) can be configured to allow building the libraries by using a compressed file. - The option is 'HDF5_ALLOW_EXTERNAL_SUPPORT'; by adding the following - configuration option: + The option is 'HDF5_ALLOW_EXTERNAL_SUPPORT' and is enabled by + adding the following configuration option: -DHDF5_ALLOW_EXTERNAL_SUPPORT:STRING="TGZ" - The options to control the SVN URL (config/cmake/cacheinit.cmake file): + The options to control the SVN URL (config/cmake/cacheinit.cmake + file) are: ZLIB_TGZ_NAME:STRING="zlib_src.ext" SZIP_TGZ_NAME:STRING="szip_src.ext" TGZ_PATH:STRING="some_location" - where "some_location/xxxx_src.ext" is the URL or full path to the - compressed file and where ext is the type of the compression file like: - .bz2, .tar, .tar.gz, .tgz, .zip + where "some_location/xxxx_src.ext" is the URL or full path to + the compressed file and where ext is the type of the compression + file such as .bz2, .tar, .tar.gz, .tgz, or .zip. - 4. Test HDF5. + 4. Test HDF5 - To test the build, navigate to your build directory and execute; + To test the build, navigate to your build directory and execute: ctest . -C {Debug | Release} @@ -243,7 +342,7 @@ Notes: This short instruction is written for users who want to quickly build recommend choosing either Debug or Release to match the build step on Windows. - 5. Packaging HDF5 + 5. Packaging HDF5 (create an install image) 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. @@ -252,17 +351,17 @@ Notes: This short instruction is written for users who want to quickly build 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. - See NSIS note 8 of this document. - Also, if you are using a VS Express version or do not want to enable - the packaging components, set HDF5_NO_PACKAGES to ON (on the command - line add -DHDF5_NO_PACKAGES:BOOL=ON) + NOTE: See note 8 of this document for NSIS information. + Also, if you are using a Visual Studio Express version or do not + want to enable the packaging components, set HDF5_NO_PACKAGES + to ON (on the command line add -DHDF5_NO_PACKAGES:BOOL=ON) 6. 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 CTestConfig.cmake. CTestConfig.cmake is specific to the internal testing - performed by The HDF Group. It should be altered for the users + performed by The HDF Group. It should be altered for the user's + installation and needs. The cacheinit.cmake file settings are used by + The HDF Group for daily testing. It should be altered/ignored for the user's installation and needs. 7. More information about using CMake can be found at the KitWare site, @@ -276,90 +375,104 @@ Notes: This short instruction is written for users who want to quickly build "output directory", which is where the program will be installed. These options are case-sensitive, so be sure to type them in upper case. - + + ======================================================================== - All options for HDF5 C/C++ Libraries with CMake - Option Name --- Option Description --- Option Default +IV. All Options for HDF5 C/C++ Libraries with CMake ======================================================================== + +In the options listed below, there are three columns of information: +Option Name, Option Description, and Option Default. + ---------------- General Build Options --------------------- -BUILD_SHARED_LIBS "Build Shared Libraries" OFF +BUILD_SHARED_LIBS "Build Shared Libraries" OFF BUILD_STATIC_EXECS "Build Static Executabless" OFF -BUILD_STATIC_PIC "Build Static PIC" OFF -BUILD_TESTING "Build HDF5 Unit Testing" OFF +BUILD_STATIC_PIC "Build Static PIC" OFF +BUILD_TESTING "Build HDF5 Unit Testing" OFF ---------------- HDF5 Build Options --------------------- -HDF5_BUILD_CPP_LIB "Build HDF5 C++ Library" OFF -HDF5_BUILD_EXAMPLES "Build HDF5 Library Examples" OFF -HDF5_BUILD_FORTRAN "Build FORTRAN support" OFF -HDF5_BUILD_HL_LIB "Build HIGH Level HDF5 Library" OFF -HDF5_BUILD_TOOLS "Build HDF5 Tools" OFF +HDF5_BUILD_CPP_LIB "Build HDF5 C++ Library" OFF +HDF5_BUILD_EXAMPLES "Build HDF5 Library Examples" OFF +HDF5_BUILD_FORTRAN "Build FORTRAN support" OFF +HDF5_BUILD_HL_LIB "Build HIGH Level HDF5 Library" OFF +HDF5_BUILD_TOOLS "Build HDF5 Tools" OFF IF (HDF5_BUILD_FORTRAN) HDF5_ENABLE_F2003 "Enable FORTRAN 2003 Standard" OFF ---------------- HDF5 Advanced Options --------------------- -HDF5_DISABLE_COMPILER_WARNINGS "Disable compiler warnings" OFF -HDF5_Enable_Clear_File_Buffers "Securely clear file buffers before writing to file" ON -HDF5_Enable_Instrument "Instrument The library" HDF5_Enable_Instrument -HDF5_ENABLE_CODESTACK "Enable the function stack tracing (for developer debugging)." OFF -HDF5_ENABLE_COVERAGE "Enable code coverage for Libraries and Programs" OFF -HDF5_ENABLE_DEPRECATED_SYMBOLS "Enable deprecated public API symbols" ON -HDF5_ENABLE_EMBEDDED_LIBINFO "embed library info into executables" ON -HDF5_ENABLE_GPFS "Enable GPFS hints for the MPI/POSIX file driver" OFF -HDF5_ENABLE_HSIZET "Enable datasets larger than memory" ON -HDF5_ENABLE_LARGE_FILE "Enable support for large (64-bit) files on Linux." ON -HDF5_ENABLE_PARALLEL "Enable parallel build (requires MPI)" OFF -HDF5_ENABLE_TRACE "Enable API tracing capability" OFF -HDF5_ENABLE_USING_MEMCHECKER "Indicate that a memory checker is used" OFF -HDF5_METADATA_TRACE_FILE "Enable metadata trace file collection" OFF -HDF5_NO_PACKAGES "Do not include CPack Packaging" OFF -HDF5_PACKAGE_EXTLIBS "CPACK - include external libraries" OFF -HDF5_STRICT_FORMAT_CHECKS "Whether to perform strict file format checks" OFF -HDF5_TEST_VFD "Execute tests with different VFDs" OFF -HDF5_USE_16_API_DEFAULT "Use the HDF5 1.6.x API by default" OFF -HDF5_USE_18_API_DEFAULT "Use the HDF5 1.8.x API by default" OFF -HDF5_USE_FOLDERS "Enable folder grouping of projects in IDEs." OFF -HDF5_WANT_DATA_ACCURACY "IF data accuracy is guaranteed during data conversions" ON -HDF5_WANT_DCONV_EXCEPTION "exception handling functions is checked during data conversions" ON +HDF5_DISABLE_COMPILER_WARNINGS "Disable compiler warnings" OFF +HDF5_Enable_Clear_File_Buffers "Securely clear file buffers before writing to file" ON +HDF5_Enable_Instrument "Instrument The library" OFF +HDF5_ENABLE_CODESTACK "Enable the function stack tracing (for developer debugging)." OFF +HDF5_ENABLE_COVERAGE "Enable code coverage for Libraries and Programs" OFF +HDF5_ENABLE_DEPRECATED_SYMBOLS "Enable deprecated public API symbols" ON +HDF5_ENABLE_EMBEDDED_LIBINFO "embed library info into executables" ON +HDF5_ENABLE_GPFS "Enable GPFS hints for the MPI/POSIX file driver" OFF +HDF5_ENABLE_HSIZET "Enable datasets larger than memory" ON +HDF5_ENABLE_LARGE_FILE "Enable support for large (64-bit) files on Linux." ON +HDF5_ENABLE_PARALLEL "Enable parallel build (requires MPI)" OFF +HDF5_ENABLE_TRACE "Enable API tracing capability" OFF +HDF5_ENABLE_USING_MEMCHECKER "Indicate that a memory checker is used" OFF +HDF5_METADATA_TRACE_FILE "Enable metadata trace file collection" OFF +HDF5_NO_PACKAGES "Do not include CPack Packaging" OFF +HDF5_PACKAGE_EXTLIBS "CPACK - include external libraries" OFF +HDF5_STRICT_FORMAT_CHECKS "Whether to perform strict file format checks" OFF +HDF5_TEST_VFD "Execute tests with different VFDs" OFF +HDF5_USE_16_API_DEFAULT "Use the HDF5 1.6.x API by default" OFF +HDF5_USE_18_API_DEFAULT "Use the HDF5 1.8.x API by default" OFF +HDF5_USE_FOLDERS "Enable folder grouping of projects in IDEs." OFF +HDF5_WANT_DATA_ACCURACY "IF data accuracy is guaranteed during data conversions" ON +HDF5_WANT_DCONV_EXCEPTION "exception handling functions is checked during data conversions" ON +HDF5_ENABLE_THREADSAFE "Enable Threadsafety" OFF IF (APPLE) - HDF5_BUILD_WITH_INSTALL_NAME "Build with library install_name set to the installation path" OFF + HDF5_BUILD_WITH_INSTALL_NAME "Build with library install_name set to the installation path" OFF IF (CMAKE_BUILD_TYPE MATCHES Debug) - HDF5_ENABLE_TRACE "Enable API tracing capability" ON + HDF5_ENABLE_TRACE "Enable API tracing capability" ON IF (HDF5_TEST_VFD) - HDF5_TEST_FHEAP_VFD "Execute fheap test with different VFDs" ON + HDF5_TEST_FHEAP_VFD "Execute fheap test with different VFDs" ON IF (WIN32 AND NOT CYGWIN) - HDF_LEGACY_NAMING "Use Legacy Names for Libraries and Programs" OFF -HDF5_ENABLE_THREADSAFE "Enable Threadsafety" OFF + HDF_LEGACY_NAMING "Use Legacy Names for Libraries and Programs" OFF ---------------- External Library Options --------------------- -HDF5_ALLOW_EXTERNAL_SUPPORT "Allow External Library Building" "NO" -HDF5_ENABLE_SZIP_SUPPORT "Use SZip Filter" OFF -HDF5_ENABLE_Z_LIB_SUPPORT "Enable Zlib Filters" OFF -ZLIB_USE_EXTERNAL "Use External Library Building for ZLIB" 0 -SZIP_USE_EXTERNAL "Use External Library Building for SZIP" 0 -HDF5_USE_FILTER_FLETCHER32 "Use the FLETCHER32 Filter" ON -HDF5_USE_FILTER_NBIT "Use the NBIT Filter" ON -HDF5_USE_FILTER_SCALEOFFSET "Use the SCALEOFFSET Filter" ON -HDF5_USE_FILTER_SHUFFLE "Use the SHUFFLE Filter" ON +HDF5_ALLOW_EXTERNAL_SUPPORT "Allow External Library Building" "NO" +HDF5_ENABLE_SZIP_SUPPORT "Use SZip Filter" OFF +HDF5_ENABLE_Z_LIB_SUPPORT "Enable Zlib Filters" OFF +ZLIB_USE_EXTERNAL "Use External Library Building for ZLIB" 0 +SZIP_USE_EXTERNAL "Use External Library Building for SZIP" 0 +HDF5_USE_FILTER_FLETCHER32 "Use the FLETCHER32 Filter" ON +HDF5_USE_FILTER_NBIT "Use the NBIT Filter" ON +HDF5_USE_FILTER_SCALEOFFSET "Use the SCALEOFFSET Filter" ON +HDF5_USE_FILTER_SHUFFLE "Use the SHUFFLE Filter" ON IF (HDF5_ENABLE_SZIP_SUPPORT) - HDF5_ENABLE_SZIP_ENCODING "Use SZip Encoding" OFF + HDF5_ENABLE_SZIP_ENCODING "Use SZip Encoding" OFF -************************************************************************ - APPENDIX + +======================================================================== +V. APPENDIX +======================================================================== Below are examples of the ctest scripts used by The HDF Group. See the script, cmakehdf5, in the bin folder for a smaller and limited function shell script version of the following general scripts. The example is for a linux machine, but the same scripts can be used on -a windows machine by adjusting the CTEST_CMAKE_GENERATOR option in the +a Windows machine by adjusting the CTEST_CMAKE_GENERATOR option in the product specific script. - -************************************************************************ -CTestScript.cmake: common ctest script used to build, test and package +CTestScript.cmake + + + ======================================================================== +CTestScript.cmake +======================================================================== + +The CTestScript.cmake script, shown below, is a common ctest script that +is used to build, test, and package HDF5 Library files. + -cmake_minimum_required(VERSION 2.8.6 FATAL_ERROR) + +cmake_minimum_required(VERSION 2.8.10 FATAL_ERROR) ######################################################## # This dashboard is maintained by The HDF Group # For any comments please contact cdashhelp@hdfgroup.org @@ -569,108 +682,86 @@ endforeach(v) message("Dashboard script configuration:\n${vars}\n") #----------------------------------------------------------------------------- -if(${MODEL} STREQUAL "Continuous") - ## Continuous mode is used for commit test processing - ## -------------------------- - while (${CTEST_ELAPSED_TIME} LESS 36000) - set(START_TIME ${CTEST_ELAPSED_TIME}) - CTEST_START (Continuous) - CTEST_UPDATE (SOURCE "${CTEST_SOURCE_DIRECTORY}" RETURN_VALUE res) - set (CTEST_CHECKOUT_COMMAND) # checkout on first iteration only - message("Dashboard updated files: ${res}\n") - if(res GREATER 0) - CTEST_CONFIGURE (BUILD "${CTEST_BINARY_DIRECTORY}") - CTEST_READ_CUSTOM_FILES ("${CTEST_BINARY_DIRECTORY}") - CTEST_SUBMIT (PARTS Update Configure Notes) - CTEST_BUILD (BUILD "${CTEST_BINARY_DIRECTORY}" APPEND) - CTEST_SUBMIT (PARTS Build) - CTEST_TEST (BUILD "${CTEST_BINARY_DIRECTORY}" APPEND ${ctest_test_args}) - CTEST_SUBMIT (PARTS Test) - - execute_process (COMMAND cpack -C ${CTEST_BUILD_CONFIGURATION} - WORKING_DIRECTORY ${CTEST_BINARY_DIRECTORY} - RESULT_VARIABLE cpackResult - OUTPUT_VARIABLE cpackLog - ERROR_VARIABLE cpackLog.err - ) - file (WRITE ${CTEST_BINARY_DIRECTORY}/cpack.log "${cpackLog.err}" "${cpackLog}") - endif(${res} GREATER 0) - - CTEST_SLEEP(${START_TIME} 300 ${CTEST_ELAPSED_TIME}) - endwhile (${CTEST_ELAPSED_TIME} LESS 36000) -#----------------------------------------------------------------------------- -else(${MODEL} STREQUAL "Continuous") -#----------------------------------------------------------------------------- - ## NORMAL process - ## -- LOCAL_SKIP_UPDATE skips updating the source folder from svn - ## -- LOCAL_NO_SUBMIT skips reporting to CDash server - ## -- LOCAL_SKIP_TEST skips the test process (only builds) - ## -- LOCAL_MEMCHECK_TEST executes the Valgrind testing - ## -- LOCAL_COVERAGE_TEST executes code coverage process - ## -------------------------- - CTEST_START (${MODEL} TRACK ${MODEL}) - if(NOT LOCAL_SKIP_UPDATE) - CTEST_UPDATE (SOURCE "${CTEST_SOURCE_DIRECTORY}") - endif(NOT LOCAL_SKIP_UPDATE) - CTEST_CONFIGURE (BUILD "${CTEST_BINARY_DIRECTORY}") - CTEST_READ_CUSTOM_FILES ("${CTEST_BINARY_DIRECTORY}") - if(NOT LOCAL_NO_SUBMIT) - CTEST_SUBMIT (PARTS Update Configure Notes) - endif(NOT LOCAL_NO_SUBMIT) - CTEST_BUILD (BUILD "${CTEST_BINARY_DIRECTORY}" APPEND) - if(NOT LOCAL_NO_SUBMIT) - CTEST_SUBMIT (PARTS Build) - endif(NOT LOCAL_NO_SUBMIT) - if(NOT LOCAL_SKIP_TEST) - if(NOT LOCAL_MEMCHECK_TEST) - CTEST_TEST (BUILD "${CTEST_BINARY_DIRECTORY}" APPEND ${ctest_test_args}) - if(NOT LOCAL_NO_SUBMIT) - CTEST_SUBMIT (PARTS Test) - endif(NOT LOCAL_NO_SUBMIT) - else(NOT LOCAL_MEMCHECK_TEST) - CTEST_MEMCHECK (BUILD "${CTEST_BINARY_DIRECTORY}" APPEND ${ctest_test_args}) - if(NOT LOCAL_NO_SUBMIT) - CTEST_SUBMIT (PARTS MemCheck) - endif(NOT LOCAL_NO_SUBMIT) - endif(NOT LOCAL_MEMCHECK_TEST) - if(LOCAL_COVERAGE_TEST) - CTEST_COVERAGE (BUILD "${CTEST_BINARY_DIRECTORY}" APPEND) - if(NOT LOCAL_NO_SUBMIT) - CTEST_SUBMIT (PARTS Coverage) - endif(NOT LOCAL_NO_SUBMIT) - endif(LOCAL_COVERAGE_TEST) - endif(NOT LOCAL_SKIP_TEST) +## NORMAL process +## -- LOCAL_SKIP_UPDATE skips updating the source folder from svn +## -- LOCAL_NO_SUBMIT skips reporting to CDash server +## -- LOCAL_SKIP_TEST skips the test process (only builds) +## -- LOCAL_MEMCHECK_TEST executes the Valgrind testing +## -- LOCAL_COVERAGE_TEST executes code coverage process +## -------------------------- +CTEST_START (${MODEL} TRACK ${MODEL}) +if(NOT LOCAL_SKIP_UPDATE) + CTEST_UPDATE (SOURCE "${CTEST_SOURCE_DIRECTORY}") +endif(NOT LOCAL_SKIP_UPDATE) +CTEST_CONFIGURE (BUILD "${CTEST_BINARY_DIRECTORY}") +CTEST_READ_CUSTOM_FILES ("${CTEST_BINARY_DIRECTORY}") +if(NOT LOCAL_NO_SUBMIT) + CTEST_SUBMIT (PARTS Update Configure Notes) +endif(NOT LOCAL_NO_SUBMIT) + CTEST_BUILD (BUILD "${CTEST_BINARY_DIRECTORY}" APPEND) +if(NOT LOCAL_NO_SUBMIT) + CTEST_SUBMIT (PARTS Build) +endif(NOT LOCAL_NO_SUBMIT) +if(NOT LOCAL_SKIP_TEST) if(NOT LOCAL_MEMCHECK_TEST) - ##----------------------------------------------- - ## Package the product - ##----------------------------------------------- - execute_process(COMMAND cpack -C ${CTEST_BUILD_CONFIGURATION} -V - WORKING_DIRECTORY ${CTEST_BINARY_DIRECTORY} - RESULT_VARIABLE cpackResult - OUTPUT_VARIABLE cpackLog - ERROR_VARIABLE cpackLog.err - ) - file(WRITE ${CTEST_BINARY_DIRECTORY}/cpack.log "${cpackLog.err}" "${cpackLog}") + CTEST_TEST (BUILD "${CTEST_BINARY_DIRECTORY}" APPEND ${ctest_test_args}) + if(NOT LOCAL_NO_SUBMIT) + CTEST_SUBMIT (PARTS Test) + endif(NOT LOCAL_NO_SUBMIT) + else(NOT LOCAL_MEMCHECK_TEST) + CTEST_MEMCHECK (BUILD "${CTEST_BINARY_DIRECTORY}" APPEND ${ctest_test_args}) + if(NOT LOCAL_NO_SUBMIT) + CTEST_SUBMIT (PARTS MemCheck) + endif(NOT LOCAL_NO_SUBMIT) endif(NOT LOCAL_MEMCHECK_TEST) -endif(${MODEL} STREQUAL "Continuous") + if(LOCAL_COVERAGE_TEST) + CTEST_COVERAGE (BUILD "${CTEST_BINARY_DIRECTORY}" APPEND) + if(NOT LOCAL_NO_SUBMIT) + CTEST_SUBMIT (PARTS Coverage) + endif(NOT LOCAL_NO_SUBMIT) + endif(LOCAL_COVERAGE_TEST) +endif(NOT LOCAL_SKIP_TEST) +if(NOT LOCAL_MEMCHECK_TEST) + ##----------------------------------------------- + ## Package the product + ##----------------------------------------------- + execute_process(COMMAND cpack -C ${CTEST_BUILD_CONFIGURATION} -V + WORKING_DIRECTORY ${CTEST_BINARY_DIRECTORY} + RESULT_VARIABLE cpackResult + OUTPUT_VARIABLE cpackLog + ERROR_VARIABLE cpackLog.err + ) + file(WRITE ${CTEST_BINARY_DIRECTORY}/cpack.log "${cpackLog.err}" "${cpackLog}") +endif(NOT LOCAL_MEMCHECK_TEST) #----------------------------------------------------------------------------- - message("DONE:CTestScript") -************************************************************************ -************************************************************************ -Product specific script, HDF518Static.cmake, that uses the -CTestScript.cmake file (see above). Usage: -"ctest -S HDF518Static.cmake,hdf518 -C Release -O hdf518static.log" -where hdf518 is the source folder relative to the location of these scripts + + +======================================================================== +ctest ======================================================================== -cmake_minimum_required(VERSION 2.8.6 FATAL_ERROR) +Below is an example of the ctest script used by The HDF Group. The +CTestScript.cmake file used by this script is shown above. Adjust the values +as necessary. Note that the source folder is entered on the command line +and the build folder is created as a sub-folder. + + + +############################################################################ +# Product specific script, HDF518Static.cmake, that uses the +# CTestScript.cmake file (see above). Usage: +# "ctest -S HDF518Static.cmake,hdf518 -C Release -O hdf518static.log" +# where hdf518 is the source folder relative to the location of these scripts +############################################################################ + +cmake_minimum_required(VERSION 2.8.10 FATAL_ERROR) # CTEST_SCRIPT_ARG is the source folder passed on the command line +set(CTEST_DASHBOARD_ROOT ${CTEST_SCRIPT_DIRECTORY}) set(CTEST_SOURCE_NAME ${CTEST_SCRIPT_ARG}) set(CTEST_BINARY_NAME ${CTEST_SOURCE_NAME}/buildstatic) -set(CTEST_DASHBOARD_ROOT ${CTEST_SCRIPT_DIRECTORY}) set(CTEST_SOURCE_DIRECTORY "${CTEST_DASHBOARD_ROOT}/${CTEST_SOURCE_NAME}") set(CTEST_BINARY_DIRECTORY "${CTEST_DASHBOARD_ROOT}/${CTEST_BINARY_NAME}") set(CTEST_BUILD_CONFIGURATION "Release") @@ -703,7 +794,11 @@ include(${CTEST_SCRIPT_DIRECTORY}/CTestScript.cmake) message("DONE") -************************************************************************ -Need further assistance, send email to help@hdfgroup.org + +======================================================================== +For further assistance, send email to help@hdfgroup.org +======================================================================== + + diff --git a/release_docs/INSTALL_MinGW.txt b/release_docs/INSTALL_MinGW.txt deleted file mode 100644 index 245e3ff..0000000 --- a/release_docs/INSTALL_MinGW.txt +++ /dev/null @@ -1,269 +0,0 @@ -************************************************************************ - HDF5 Build and Install Instructions for MinGW -************************************************************************ - -NOTE: -We are no longer actively supporting MinGW as of 1.8.5. ------- 1.8.9 notes ------ -Autotools configure failed to correctly generate the *config.h files. -CMake 2.8.6 can configure and build the library, however fortran programs did - not execute correctly. Some tests may fail. Used the "MSYS Makefiles" - generator for the "-G" parameter. Follow the CMake.txt document. - -Below are the old instructions from the 1.8.4 release. - -************************************************************************ -************************************************************************ -************************************************************************ - -Preconditions: --------------- - -1. Installed MinGW (5.1.6 or higher) and MSYS (1.0.11 or higher) - - To install the MinGW net release, go to http://www.mingw.org and - follow the instructions for a manual installation. - -2. Compilers Installed - - 2.1 C/C++ Compilers HDF5-1.8.4 Supported - - gcc-4.4.0 is included in MinGW, which includes: - gcc : GNU C compiler - gcc-g++: GNU C++ compiler - gfortran: GNU Fortran compiler - - 2.2 Using Compilers Not Supported - - The compilers in 2.1 are supported and tested by The HDF - Group. Any other compilers may still work but they are not - guaranteed by HDF group. - - If users want to use other compilers except those in 2.1, - try to set the following variables to override the default - choices. - - CC : C compiler command - CXX : C++ compiler command - FC : Fortran compiler command - -3. HDF5 Dependencies - - 3.1 Zlib - - zlib-1.2.2 or later is supported and tested on MinGW. - - 3.2 Szip - The HDF5 library has a predefined compression filter that uses - the extended-Rice lossless compression algorithm for chunked - datatsets. For more information about Szip compression and - license terms see - http://hdfgroup.org/HDF5/doc_resource/SZIP/index.html. - - Szip is currently not supported on MinGW, although we plan to add - support in the future. - - -Build HDF5 on MinGW ----------------------- - -1. Get HDF5 source code package - Users can download HDF5 source code package from HDF website - (http://hdfgroup.org). - -2. Unpacking the distribution - - The HDF5 source code is distributed in a variety of formats which - can be unpacked with the following commands, each of which creates - an `hdf5-1.8.4' directory. - - 2.1 Non-compressed tar archive (*.tar) - - $ tar xf hdf5-1.8.4.tar - - 2.2 Gzip'd tar archive (*.tar.gz) - - $ gunzip < hdf5-1.8.4.tar.gz | tar xf - - - 2.3 Bzip'd tar archive (*.tar.bz2) - - $ bunzip2 < hdf5-1.8.4.tar.bz2 | tar xf - - -3. Setup Environment - - Building HDF5 1.8.4 requires an explicit link to libws2_32.a - to handle Windows Sockets. To do this, issue the command: - - $ export LIBS=-lws2_32 - - Also, the default search path can cause trouble using ./configure in HDF5 - 1.8.4. Check that non-MinGW or non-msys directories are not added to the - PATH. You can do this by: - - $ echo $PATH - - If there are spurious entries, specifically those related to other Windows - compilers or tools, remove them by setting a new PATH without them. For - example, - - $ export PATH=.:/usr/local/bin:/mingw/bin:/bin - - -4. Remove Unsupported Source - - There are some projects which are built by default to test performance on - POSIX systems. They are irrelevent on MinGW, and can cause compiler errors. - - To remove these projects from the build script, open ./perform/Makefile.in - Find all instances of "h5perf_serial", and remove them (along with their - respective extension or targets, if they exist). Then save the file. - - -5. Remove Tests - - When building with MinGW, many tests must be removed from the - test suite run with "make check". This is because of the way - MinGW and Windows handles certain parsing. For example, MinGW - treats any command parameter starting with '/' as a path, and - replaces it with it's root directory on Windows, such as - 'C:\msys\1.0\'. - - To remove the tests, open the given 'Makefile.in' and edit the - line begining with "TEST_SCRIPT = " to remove the test script. - For example, to remove the "testerror.sh" from ./test/Makefile.in: - - 1) Open ./test/Makefile.in - - 2) Find the line "TEST_SCRIPT = $(top_srcdir)/test/testerror.sh" - - 3) Change it to simply read "TEST_SCRIPT =", and save. - - Do this for the following Makefiles and tests: - - - ./test/Makefile.in: "testerror.sh testlibinfo.sh testcheckinfo.sh" - - - ./tools/h5diff/Makefile.in: "testh5diff.sh" - - - ./tools/h5ls/Makefile.in: "testh5ls.sh" - - - ./tools/misc/Makefile.in: "testh5mkgrp.sh" - - - ./tools/h5copy/Makefile.in: "testh5copy.sh" - - - ./tools/h5stat/Makefile.in: "testh5stat.sh" - - - ./tools/h5dump/Makefile.in: "testh5dump.sh" and "testh5dumpxml.sh" - - -6. Configuring - - Notes: - 1) Note: MinGW is c++ package is missing the libstdc++.dll.a file - and c++ linking fails. Do not enable c++ option in configure. - - 2) See detailed information in hdf5/release_docs/INSTALL, - part 5. Full installation instructions for source - distributions - - In short, - - To configure HDF5 with C Library, use - - $ ./configure - - If you would like to build the C++ library, add the parameter: - - --enable-cxx (12-11-2009 MinGW C++ package is missing a file) - - If you would like to build without the Zlib library, add the parameter: - - --without-zlib - - If you would like to specify the the Zlib library, there are two ways: - - Using - - --with-zlib=INCDIR,LIBDIR - - For example, if the zlib library is installed in - /usr, which is the parent directory of directories - "include" and "lib", - - --with-zlib=/usr/include,/usr/lib - - Through the CPPFLAGS and LDFLAGS Variables - - For example, if zlib was installed in the directory - /c/usr then using the following command to configure - HDF5 with zib - - $ export CPPFLAGS=-I/usr/include - $ export LDFLAGS=-L/usr/lib - - If you would like to specify the install directory, add the parameter: - - --prefix="path for installation" - - By default, HDF5 library, header files, examples, and - support programs will be installed in /usr/local/lib, - /usr/local/include, /usr/local/doc/hdf5/examples, and - /usr/local/bin. To use a path other than /usr/local specify - the path with the `--prefix=PATH' switch as in the above - command. - - Combination of Switches - - All of the above switches can be combined together. For - example, if users want to configure HDF5 C/Fortran - library, with zlib library at /c/usr/, and - install HDF5 into directory /c/hdf5 using - gcc/gfortran as C/Fortran compiler: - - $ ./configure - --with-zlib=/usr/include,/usr/lib - --prefix=/c/hdf5 - --enable-fortran - <"If no more switches, then hit Enter"> - - Notes: The command format above is for readilibity. In practice, - please type in the command above with at least one - space between each line, No "Enter" until users finish - the switches and want to run the configure. - - - or do it through CPPFLAGS and LDFLAGS variables: - - $ CPPFLAGS=-I/usr/include \ - $ LDFLAGS=-L/usr/lib \ - - $ ./configure - --prefix=/c/hdf5 - --enable-fortran - <"If no more switches, then hit Enter"> - -7. Make and Make Check - - After configuration is done successfully, run the following series of - commands to build, test and install HDF5 - - $ make > "output file name" - $ make check > "output file name" - - Before run "make install", check output file for "make check", there - should be no failures at all. - -8. Make Install - - $ make install > "output file name" - - -9. Check installed HDF5 library - - After step 8, go to your installation directory, there should be - three subdirectories: "bin" "include" and "lib". - - $ make installcheck > "output file name" - ------------------------------------------------------------------------ - -Need Further assistance, email help@hdfgroup.org diff --git a/release_docs/INSTALL_Windows.txt b/release_docs/INSTALL_Windows.txt index 4344ea4..7873709 100644 --- a/release_docs/INSTALL_Windows.txt +++ b/release_docs/INSTALL_Windows.txt @@ -6,8 +6,11 @@ We now recommend that users build, test and install HDF5 using CMake. -Instructions for building and testing HDF5 using CMake can be found in -the CMake.txt file found in this folder. +Instructions for building and testing HDF5 using CMake can be found in the +INSTALL_CMake.txt file found in this folder. -The old INSTALL_Windows documentation can be found in the -obsolete_windows_docs\ folder located with this document. +For instructions of building and testing an application with HDF5, see +USING_HDF5_CMake.txt file found in this folder. + +Users who want to build and run an application with HDF5 in Visual Studio +without using CMake should consult the USING_HDF5_VS.txt file. diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index dbd3b75..ed3ec6b 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -1,4 +1,4 @@ -HDF5 version 1.9.149 currently under development +HDF5 version 1.9.156 currently under development ================================================================================ @@ -106,6 +106,9 @@ New Features Library: -------- + - The library can load filter libraries dynamically during runtime. Users + can set the search path through environment variable HDF5_PLUGIN_PATH + and call H5Pset_filter to enable a dynamic filter. (SLU - 2013/04/08) - Added new API functions H5Dscatter and H5Dgather to scatter data to and and gather data from a selection within a memory buffer. (NAF - 2013/02/05) @@ -407,12 +410,20 @@ Support for new platforms, languages and compilers. - Intel V11.1 uses now -O3 optimization in production mode (EIP - 2010/10/08) - PathScale compilers are recognized and can build the HDF5 library properly. AKC - 2009/7/28 - + - SunOS 5.11 (emu) 32-bit and 64-bit with Sun C/C++ 5.12 compiler and + Sun Fortran 95 8.6 compiler. (SLU - 2013/04/15) Bug Fixes since HDF5-1.8.0 release ================================== Library ------- + - Fixed an error involving failure to write fill values to the user's + buffer when reading unallocated chunks from datasets that have a + fill value set to H5D_FILL_VALUE_DEFAULT. A consequence of this + was the reporting of spurious data values in h5dump and h5diff + output. + (HDFFV-8247; JP - 2013/05/03) - Fixed an error that could occur when calling H5Ocopy within an H5Literate callback (and possibly other situations). (NAF - 2012/7/25 - HDFFV-5853) @@ -1126,10 +1137,11 @@ Supported Platforms MPICH mpich2-1.4.1p1 compiled with gcc 4.1.2 and gfortran 4.1.2 - Linux 2.6.32-220.7.1.el6.ppc64 gcc (GCC) 4.4.6 20120305 (Red Hat 4.4.6-4) - #1 SMP ppc64 GNU/Linux g++ (GCC) 4.4.6 20120305 (Red Hat 4.4.6-4) - (ostrich) GNU Fortran (GCC) 4.4.6 20120305 (Red Hat 4.4.6-4) - + Linux 2.6.32-358.2.1.el6.ppc64 gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-3) + #1 SMP ppc64 GNU/Linux g++ (GCC) 4.4.7 20120313 (Red Hat 4.4.7-3) + (ostrich) GNU Fortran (GCC) 4.4.7 20120313 (Red Hat 4.4.7-3) + IBM XL C/C++ V11.1 + IBM XL Fortran V13.1 Linux 2.6.32-220.23.1.1chaos Intel C, C++, Fortran Compilers ch5.x86_64 GNU/Linux Version 12.1.5.339 (LLNL Aztec) @@ -1138,12 +1150,9 @@ Supported Platforms (LLNL uDawn) XL C++ for Blue Gene/P, bgxlC V9.0 XL Fortran for Blue Gene/P, bgxlf90 V11.1 - SunOS 5.10 32- and 64-bit Sun C 5.9 Sun OS_sparc Patch 124867-16 - (linew) Sun Fortran 95 8.3 Sun OS_sparc Patch 127000-13 - Sun C++ 5.9 Sun OS_sparc Patch 124863-26 - Sun C 5.11 SunOS_sparc - Sun Fortran 95 8.5 SunOS_sparc - Sun C++ 5.11 SunOS_sparc + SunOS 5.11 32- and 64-bit Sun C 5.12 SunOS_sparc + (emu) Sun Fortran 95 8.6 SunOS_sparc + Sun C++ 5.12 SunOS_sparc Windows XP Visual Studio 2008 w/ Intel Fortran 10.1 (project files) @@ -1161,15 +1170,9 @@ Supported Platforms Mac OS X Snow Leopard 10.6.8 gcc i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 from Xcode 3.2.6 Darwin Kernel Version 10.8.0 g++ i686-apple-darwin11-llvm-g++-4.2 (GCC) 4.2.1 from Xcode 3.2.6 - (fred) gfortran GNU Fortran (GCC) 4.6.2 - Intel C (icc), Fortran (ifort), C++ (icpc) - 12.1.0.038 Build 20110811 - - Mac OS X Snow Leopard 10.6.8 gcc i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 from Xcode 3.2.6 - Darwin Kernel Version 10.8.0 g++ i686-apple-darwin11-llvm-g++-4.2 (GCC) 4.2.1 from Xcode 3.2.6 - Intel 32-bit gfortran GNU Fortran (GCC) 4.6.1 - (tejeda) Intel C (icc), Fortran (ifort), C++ (icpc) - 12.1.0.038 Build 20110811 + 64-bit gfortran GNU Fortran (GCC) 4.6.2 + (fred) Intel C (icc), Fortran (ifort), C++ (icpc) + 12.1 Build 20120928 Mac OS X Lion 10.7.3 gcc i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 from Xcode 4.2.1 32- and 64-bit g++ i686-apple-darwin11-llvm-g++-4.2 (GCC) 4.2.1 from Xcode 4.2.1 @@ -1197,11 +1200,10 @@ Tested Configuration Features Summary Platform C F90/ F90 C++ zlib SZIP parallel F2003 parallel -Solaris2.10 32-bit n y/y n y y y -Solaris2.10 64-bit n y/n n y y y +Solaris2.11 32-bit n y/y n y y y +Solaris2.11 64-bit n y/n n y y y Windows 7 y y/n n y y y Windows 7 x64 y y/n n y y y -Mac OS X Snow Leopard 10.6.8 32-bit n y/y n y y n Mac OS X Snow Leopard 10.6.8 64-bit n y/y n y y y Mac OS X Lion 10.7.3 32-bit n y/y n y y n Mac OS X Lion 10.7.3 64-bit n y/y n y y y @@ -1213,16 +1215,15 @@ CentOS 5.5 Linux 2.6.18-308 i686 PGI n y/y n y y y CentOS 5.5 Linux 2.6.18 x86_64 GNU y y/y y y y y CentOS 5.5 Linux 2.6.18 x86_64 Intel n y/y n y y y CentOS 5.5 Linux 2.6.18 x86_64 PGI n y/y n y y y -Linux 2.6.32-220.7.1.el6.ppc64 n y/n n y y y +Linux 2.6.32-358.2.1.el6.ppc64 n y/n n y y y Platform Shared Shared Shared Thread- C libs F90 libs C++ libs safe -Solaris2.10 32-bit y y y y -Solaris2.10 64-bit n n n n +Solaris2.11 32-bit y y y y +Solaris2.11 64-bit y y y y Windows 7 y y y y Windows 7 x64 y y y y -Mac OS X Snow Leopard 10.6.8 32-bit y n y n Mac OS X Snow Leopard 10.6.8 64-bit y n y n Mac OS X Lion 10.7.3 32-bit y n y y Mac OS X Lion 10.7.3 64-bit y n y y @@ -1234,7 +1235,7 @@ CentOS 5.5 Linux 2.6.18-308 i686 PGI y y y n CentOS 5.5 Linux 2.6.18 x86_64 GNU y y y y CentOS 5.5 Linux 2.6.18 x86_64 Intel y y y n CentOS 5.5 Linux 2.6.18 x86_64 PGI y y y n -Linux 2.6.32-220.7.1.el6.ppc64 y y y n +Linux 2.6.32-358.2.1.el6.ppc64 y y y n Compiler versions for each platform are listed in the preceding "Supported Platforms" table. diff --git a/release_docs/USING_CMake.txt b/release_docs/USING_HDF5_CMake.txt index 0e980ea..3c04f36 100644 --- a/release_docs/USING_CMake.txt +++ b/release_docs/USING_HDF5_CMake.txt @@ -1,79 +1,96 @@ ************************************************************************ -* Build and Install HDF5 Applications with CMake * +* Build and Install HDF5 Applications with CMake * ************************************************************************ -Notes: This short instruction is written for users who want to quickly build - HDF5 Applications from the HDF5 Examples package using the CMake tools. - Users can adapt these instructions for their own applications, see the - "Minimum Project Files" section. +Notes: This short instruction is written for users who want to quickly + build HDF5 applications using the CMake tools. Users can adapt + these instructions for their own applications. For more information, + see the "Minimum C Project Files for CMake" section. - More information about using CMake can be found at the KitWare site, - www.cmake.org. + More information about using CMake can be found at the KitWare + site, www.cmake.org. - CMake uses the command line, however the visual CMake tool is + CMake uses the command line; however, the visual CMake tool is available for the configuration step. The steps are similar for - all the operating systems supported by CMake. + all of the operating systems supported by CMake. NOTES: - 1. Using CMake for building and using HDF5 is under active development. - While we have attempted to provide error-free files, please - understand that development with CMake has not been extensively - tested outside of HDF. The CMake specific files may change - before the next release. + 1. Using CMake for building and using HDF5 is under active + development. While we have attempted to provide error-free + files, please understand that development with CMake has not + been extensively tested outside of HDF. The CMake specific + files may change before the next release. - 2. CMake was originally introduced to support development on Windows, - however it should be usable on any system where CMake is supported. - Please send us any comments on how CMake support can be improved on - any system. Visit the KitWare site for more information about CMake. - - 3. HDF5 library build and test results can be submitted to our CDash server at: - cdash.hdfgroup.uiuc.edu. - Please read the HDF and CDash document at: - www.hdfgroup.org/CDash/HowToSubmit. - - 4. See the appendix at the bottom of this file for an example of using - a ctest script for building and testing. See CMake.txt for more - information. + 2. CMake for HDF5 development should be usable on any system + where CMake is supported. Please send us any comments on how + CMake support can be improved on any system. + 3. See the appendix at the bottom of this file for an example + of using a ctest script for building and testing. See + CMake.txt for more information. + + ======================================================================== - Preconditions -======================================================================== +I. Preconditions +======================================================================== 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.10 (minimum). - - 2. You have installed the HDF5 library built with CMake, by executing the - HDF Install Utility (The *.exe file in the binary package for Windows). - If you are using a Windows platform, you can obtain a pre-built Windows - binary from The HDF Group's website at www.hdfgroup.org. - - 3. On Windows with Visual Studio, if you have installed the static HDF5 - library, you will need to add the HDF5\lib folder to the library - search list. See the "Using Static Libraries with Visual Studio" section. - - 4. Set the environment variable HDF5_ROOT to the installed location of HDF5. - On Windows HDF5_ROOT=C:\Program Files\HDF Group\HDF5\hdf5-1.8.x - (Note there are no quote characters used on windows) + web site. The HDF5 1.8.x product requires a minimum CMake version + of 2.8.10. + 2. You have installed the HDF5 library built with CMake, by executing + the HDF Install Utility (the *.exe file in the binary package for + Windows). If you are using a Windows platform, you can obtain a + pre-built Windows binary from The HDF Group's website at + www.hdfgroup.org. + + 3. Set the environment variable HDF5_DIR to the installed location of + the config files for HDF5. On Windows: + HDF5_DIR=C:/Program Files/HDF_Group/HDF5/1.8.x/cmake/hdf5 + + (Note there are no quote characters used on Windows and all platforms + use forward slashes) + + 4. Created separate source and build directories. + (CMake commands are executed in the build directory) + + 5. Created a CMakeLists.txt file(s) for your source. See Section III + below. + + + ======================================================================== - Building HDF5 Applications with CMake +II. Building HDF5 Applications with CMake ======================================================================== +Go through these steps to build HDF5 applications with CMake. + + 1. Run CMake + 2. Configure the cache settings + 3. Build HDF5 Applications + 4. Test HDF5 Applications. + +These steps are described in more detail below. + + + 1. Run CMake The CMake executable is named "cmake-gui.exe" on Windows and should be available in your Start menu. For Linux, UNIX, and Mac users the executable is named "cmake-gui" and can be found where CMake was installed. - Specify the source and build directories. It is recommended that you - 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). + + Specify the source and build directories. Make the build and source + directories different. For example on Windows, if the source is at + c:\MyHDFstuff\hdf5, then use c:\MyHDFstuff\hdf5\build or + c:\MyHDFstuff\build\hdf5 for the build directory. OPTIONAL: - Users can perform the configuration step without using the visual cmake-gui - program. Example configuration step executed within the build directory: + Users can perform the configuration step without using the visual + cmake-gui program. The following is an example command line + configuration step executed within the build directory: cmake -G "<generator>" [-D<options>] <sourcepath> @@ -83,6 +100,8 @@ Notes: This short instruction is written for users who want to quickly build * MinGW Makefiles * NMake Makefiles * Unix Makefiles + * Visual Studio 11 + * Visual Studio 11 Win64 * Visual Studio 10 * Visual Studio 10 Win64 * Visual Studio 6 @@ -127,7 +146,7 @@ Notes: This short instruction is written for users who want to quickly build or the command line. The command line is normally used on linux, Unix, and Mac. To build from the command line, navigate to your build directory and - execute the following; + execute the following: cmake --build . --config {Debug | Release} @@ -139,9 +158,9 @@ Notes: This short instruction is written for users who want to quickly build file in your build directory. Be sure to select either Debug or Release and build the solution. - 4. Test HDF5 Applications. + 4. Test HDF5 Applications - To test the build, navigate to your build directory and execute; + To test the build, navigate to your build directory and execute: ctest . -C {Debug | Release} @@ -149,95 +168,75 @@ Notes: This short instruction is written for users who want to quickly build recommend choosing either Debug or Release to match the build step on Windows. - 6. The files that support building with CMake are all the files in the + 5. The files that support building with CMake are all of the files in the 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. + performed by The HDF Group. It should be altered for the user's + installation and needs. The cacheinit.cmake file settings are used by + The HDF Group for daily testing. It should be altered/ignored for the user's + installation and needs. + + - 7. More information about using CMake can be found at the KitWare site, - www.cmake.org. - - ======================================================================== - Using Visual Studio 2008 with HDF5 Libraries built with Visual Studio 2008 +III. Minimum C Project Files for CMake ======================================================================== - 8. Set up path for external libraries and headers - - Invoke Microsoft Visual Studio and go to "Tools" and select "Options", - find "Projects", and then "VC++ Directories". - - 8.1 If you are building on 64-bit Windows, find the "Platform" dropdown - and select "x64". + 6. Create a CMakeLists.txt file at the source root. Include the + following text in the file: - 8.2 Find the box "Show directories for", choose "Include files", add the - header path (i.e. c:\Program Files\HDF Group\HDF5\hdf5-1.8.x\include) - to the included directories. +########################################################## +cmake_minimum_required (VERSION 2.8.10) +PROJECT (HDF5MyApp C CXX) - 8.3 Find the box "Show directories for", choose "Library files", add the - library path (i.e. c:\Program Files\HDF Group\HDF5\hdf5-1.8.x\lib) - to the library directories. - - 8.4 If using Fortran libraries, you will also need to setup the path - for the Intel Fortran compiler. +FIND_PACKAGE (HDF5 NAMES hdf5) +# FIND_PACKAGE (HDF5) # Find non-cmake built HDF5 +INCLUDE_DIRECTORIES (${HDF5_INCLUDE_DIR}) +SET (LINK_LIBS ${LINK_LIBS} ${HDF5_LIBRARIES}) - -======================================================================== - Using Visual Studio 2010 with HDF5 Libraries built with Visual Studio 2010 -======================================================================== +SET (example hdf_example) - 9. Set up path for external libraries and headers +ADD_EXECUTABLE (${example} ${PROJECT_SOURCE_DIR}/${example}.c) +TARGET_C_PROPERTIES (${example} " " " ") +TARGET_LINK_LIBRARIES (${example} ${LINK_LIBS}) - The path settings will need to be in project property sheets per project. - Go to "Project" and select "Properties", find "Configuration Properties", - and then "VC++ Directories". - - 9.1 If you are building on 64-bit Windows, find the "Platform" dropdown - and select "x64". - - 9.2 Add the header path to the "Include Directories" setting. - - 9.3 Add the library path to the "Library Directories" setting. +ENABLE_TESTING () +INCLUDE (CTest) - -======================================================================== - Minimum C Project Files for CMake -======================================================================== +ADD_TEST (NAME test_example COMMAND ${example}) +########################################################## - 10. Create a CMakeLists.txt file at the source root. -.......................................................................... -cmake_minimum_required (VERSION 2.8.10) -PROJECT (HDF5MyApp C CXX) -FIND_PACKAGE (HDF5 REQURIED) -INCLUDE_DIRECTORIES (${HDF5_INCLUDE_DIRS}) -SET (LINK_LIBS ${LINK_LIBS} ${HDF5_LIBRARIES}) -ADD_EXECUTABLE (hdf_example ${PROJECT_SOURCE_DIR}/hdf_example.c) -TARGET_LINK_LIBRARIES (hdf_example ${LINK_LIBS}) -.......................................................................... +======================================================================== +IV. APPENDIX +======================================================================== +Below is an example of the ctest script used by The HDF Group. See the +Appendix in the INSTALL_CMake.txt file for the CTestScript.cmake file used +by this script. Adjust the values as necessary. Note that the source folder +is entered on the command line and the build folder is created as a sub-folder. +Windows should adjust the forward slash to double backslashes, except for +the HDF_DIR environment variable. -************************************************************************ - APPENDIX -Below ia an example of the ctest script used by The HDF Group. See the -Appendix in the CMake.txt file for the CTestScript.cmake file used by this -script. -************************************************************************ -Product specific script, HDF518Example.cmake, that uses the -CTestScript.cmake file (see Appendix in the CMake.txt). Usage: -"ctest -S HDF518Example.cmake,hdf518Examples -C Release -O hdf518EX.log" -where hdf518Examples is the source folder relative to the location of these scripts +======================================================================== +ctest ======================================================================== -cmake_minimum_required(VERSION 2.8.6 FATAL_ERROR) +############################################################################ +# Product specific script, HDF518Example.cmake, that uses the +# CTestScript.cmake file (see Appendix in the CMake.txt). Usage: +# "ctest -S HDF518Example.cmake,hdf518Examples -C Release -O hdf518EX.log" +# where hdf518Examples is the source folder relative to the location of these scripts +############################################################################ +cmake_minimum_required(VERSION 2.8.10 FATAL_ERROR) + +set(CTEST_DASHBOARD_ROOT ${CTEST_SCRIPT_DIRECTORY}) set(CTEST_SOURCE_NAME ${CTEST_SCRIPT_ARG}) set(CTEST_BINARY_NAME ${CTEST_SOURCE_NAME}/build) -set(CTEST_DASHBOARD_ROOT ${CTEST_SCRIPT_DIRECTORY}) set(CTEST_SOURCE_DIRECTORY "${CTEST_DASHBOARD_ROOT}/${CTEST_SOURCE_NAME}") set(CTEST_BINARY_DIRECTORY "${CTEST_DASHBOARD_ROOT}/${CTEST_BINARY_NAME}") set(CTEST_BUILD_CONFIGURATION "Release") @@ -254,6 +253,10 @@ set(SITE_OS_BITS "os size") set(SITE_COMPILER_NAME "compiler name") set(SITE_COMPILER_VERSION "compiler version") +# skip submit to cdash +set(LOCAL_NO_SUBMIT "True") +# skip update source from repository +set(LOCAL_SKIP_UPDATE "True") # needed for source updates, change as required set(REPOSITORY_URL "http://svn.hdfgroup.uiuc.edu/hdf5-examples/trunk/1_8") @@ -266,7 +269,12 @@ set(ENV{HDF5_DIR} "/usr/share/cmake/hdf5") include(${CTEST_SCRIPT_DIRECTORY}/CTestScript.cmake) message("DONE") +################################################################################# + -Need further assistance, send email to help@hdfgroup.org +======================================================================== +For further assistance, send email to help@hdfgroup.org +======================================================================== + diff --git a/release_docs/USING_HDF5_VS.txt b/release_docs/USING_HDF5_VS.txt new file mode 100644 index 0000000..bbfc501 --- /dev/null +++ b/release_docs/USING_HDF5_VS.txt @@ -0,0 +1,88 @@ + +*********************************************************************** +* HDF5 Build and Install Suggestions for Windows and Visual Studio * +* (Full Version) * +*********************************************************************** + +These suggestions are for Visual Studio users. + +Instructions for building and testing HDF5 applications using CMake can +be found in the USING_CMake.txt file found in this folder. + +The following two sections are helpful if you do not use CMake to build +your applications. + +======================================================================== +Using Visual Studio 2010 with HDF5 Libraries built with Visual Studio 2010 +======================================================================== + + 1. Set up path for external libraries and headers + + The path settings will need to be in project property sheets per project. + Go to "Project" and select "Properties", find "Configuration Properties", + and then "VC++ Directories". + + 1.1 If you are building on 64-bit Windows, find the "Platform" dropdown + and select "x64". + + 1.2 Add the header path to the "Include Directories" setting. + + 1.3 Add the library path to the "Library Directories" setting. + + 1.4 Select Linker->Input and beginning with the + "Additional Dependencies" line, enter the library names. The + external libraries should be listed first, followed by the HDF5 + library, and then optionally the HDF5 High Level, Fortran or C++ + libraries. For example, to compile a C++ application, enter: + + szip.lib zlib.lib hdf5dll.lib hdf5_cppdll.lib + + +========================================================================== +Using Visual Studio 2008 with HDF5 Libraries built with Visual Studio 2008 +========================================================================== + + 2. Set up path for external libraries and headers + + Invoke Microsoft Visual Studio and go to "Tools" and select "Options", + find "Projects", and then "VC++ Directories". + + 2.1 If you are building on 64-bit Windows, find the "Platform" dropdown + and select "x64". + + 2.2 Find the box "Show directories for", choose "Include files", add the + header path (i.e. c:\Program Files\HDF_Group\HDF5\1.8.x\include) + to the included directories. + + 2.3 Find the box "Show directories for", choose "Library files", add the + library path (i.e. c:\Program Files\HDF_Group\HDF5\1.8.x\lib) + to the library directories. + + 2.4 If using Fortran libraries, you will also need to setup the path + for the Intel Fortran compiler. + + 2.5 Select Project->Properties->Linker->Input and beginning with the + "Additional Dependencies" line, enter the library names. The + external libraries should be listed first, followed by the HDF5 + library, and then optionally the HDF5 High Level, Fortran or C++ + libraries. For example, to compile a C++ application, enter: + + szip.lib zlib.lib hdf5dll.lib hdf5_cppdll.lib + +======================================================================== +3. Helpful Pointers +======================================================================== + + 3.1 FAQ + + Many other common questions and hints are located online and being updated + in the HDF5 FAQ. For Windows-specific questions, please see: + + http://www.hdfgroup.org/HDF5/faq/windows.html + + For all other general questions, you can look in the general FAQ: + + http://hdfgroup.org/HDF5-FAQ.html + +************************************************************************ + Please send email to help@hdfgroup.org for further assistance. diff --git a/release_docs/USING_Windows.txt b/release_docs/USING_Windows.txt deleted file mode 100644 index 97ac4ad..0000000 --- a/release_docs/USING_Windows.txt +++ /dev/null @@ -1,35 +0,0 @@ - -*********************************************************************** -* HDF5 Build and Install Instructions for Windows * -* (Full Version) * -*********************************************************************** - -We now recommend that users build, test and install HDF5 using CMake. - -Instructions for building and testing HDF5 applications using CMake can be found in -the USING_CMake.txt file found in this folder. - - -======================================================================== - Section VI: Misc. -======================================================================== - -1. Helpful Pointers - -Here are some helpful notes if you are not familiar with -using the Visual C++ Development Environment. - - 1.1 FAQ - - Many other common questions and hints are located online and being updated - in the HDF5 FAQ. For Windows-specific questions, please see: - - http://www.hdfgroup.org/windows/faq.html - - For all other general questions, you can look in the general FAQ: - - http://hdfgroup.org/HDF5-FAQ.html - - -************************************************************************ - Please send email to help@hdfgroup.org for further assistance. diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 588919f..ddc1cd3 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -478,6 +478,15 @@ SET (H5P_HDRS ) IDE_GENERATED_PROPERTIES ("H5P" "${H5P_HDRS}" "${H5P_SRCS}" ) +SET (H5PL_SRCS + ${HDF5_SRC_DIR}/H5PL.c +) + +SET (H5PL_HDRS + ${HDF5_SRC_DIR}/H5PLextern.h +) +IDE_GENERATED_PROPERTIES ("H5PL" "${H5PL_HDRS}" "${H5PL_SRCS}" ) + SET (H5R_SRCS ${HDF5_SRC_DIR}/H5R.c @@ -630,6 +639,13 @@ IF (HDF5_ENABLE_EFF) ${HDF5_SRC_DIR}/H5VLiod.c ${HDF5_SRC_DIR}/H5VLiod_client.c ${HDF5_SRC_DIR}/H5VLiod_server.c + ${HDF5_SRC_DIR}/H5VLiod_file.c + ${HDF5_SRC_DIR}/H5VLiod_group.c + ${HDF5_SRC_DIR}/H5VLiod_dset.c + ${HDF5_SRC_DIR}/H5VLiod_dtype.c + ${HDF5_SRC_DIR}/H5VLiod_attr.c + ${HDF5_SRC_DIR}/H5VLiod_link.c + ${HDF5_SRC_DIR}/H5VLiod_obj.c ${HDF5_SRC_DIR}/H5VLiod_encdec.c ) SET (H5VL_HDRS @@ -699,6 +715,7 @@ SET (common_SRCS ${H5MP_SRCS} ${H5O_SRCS} ${H5P_SRCS} + ${H5PL_SRCS} ${H5R_SRCS} ${H5RC_SRCS} ${H5RS_SRCS} @@ -745,6 +762,7 @@ SET (H5_PUBLIC_HEADERS ${H5MP_HDRS} ${H5O_HDRS} ${H5P_HDRS} + ${H5PL_HDRS} ${H5R_HDRS} ${H5S_HDRS} ${H5SM_HDRS} @@ -790,6 +808,7 @@ SET (H5_PRIVATE_HEADERS ${HDF5_SRC_DIR}/H5MPprivate.h ${HDF5_SRC_DIR}/H5Oprivate.h ${HDF5_SRC_DIR}/H5Pprivate.h + ${HDF5_SRC_DIR}/H5PLprivate.h ${HDF5_SRC_DIR}/H5RCprivate.h ${HDF5_SRC_DIR}/H5Rprivate.h ${HDF5_SRC_DIR}/H5RSprivate.h @@ -820,6 +839,7 @@ INCLUDE_DIRECTORIES (${CMAKE_BINARY_DIR}) # specific type checks inside #----------------------------------------------------------------------------- ADD_EXECUTABLE (H5detect ${HDF5_SRC_DIR}/H5detect.c) +TARGET_C_PROPERTIES (H5detect " " " ") IF (MSVC) TARGET_LINK_LIBRARIES (H5detect "ws2_32.lib") ENDIF (MSVC) @@ -833,6 +853,7 @@ ADD_CUSTOM_COMMAND ( ) ADD_EXECUTABLE (H5make_libsettings ${HDF5_SRC_DIR}/H5make_libsettings.c) +TARGET_C_PROPERTIES (H5make_libsettings " " " ") IF (MSVC) TARGET_LINK_LIBRARIES (H5make_libsettings "ws2_32.lib") ENDIF (MSVC) @@ -882,7 +903,11 @@ SET (common_SRCS ${common_SRCS} ${HDF5_BINARY_DIR}/H5overflow.h) SET_SOURCE_FILES_PROPERTIES (${HDF5_BINARY_DIR}/H5overflow.h GENERATED) ADD_LIBRARY (${HDF5_LIB_TARGET} ${LIB_TYPE} ${common_SRCS} ${H5_PUBLIC_HEADERS} ${H5_PRIVATE_HEADERS}) +TARGET_C_PROPERTIES (${HDF5_LIB_TARGET} " " " ") TARGET_LINK_LIBRARIES (${HDF5_LIB_TARGET} ${LINK_LIBS}) +IF (NOT WIN32) + TARGET_LINK_LIBRARIES (${HDF5_LIB_TARGET} dl) +ENDIF (NOT WIN32) SET_GLOBAL_VARIABLE (HDF5_LIBRARIES_TO_EXPORT ${HDF5_LIB_TARGET}) H5_SET_LIB_OPTIONS (${HDF5_LIB_TARGET} ${HDF5_LIB_NAME} ${LIB_TYPE}) SET_TARGET_PROPERTIES (${HDF5_LIB_TARGET} PROPERTIES FOLDER libraries) @@ -145,7 +145,7 @@ H5_init_library(void) MPI_Initialized(&mpi_initialized); if (mpi_initialized){ mpe_code = MPE_Init_log(); - assert(mpe_code >=0); + HDassert(mpe_code >=0); H5_MPEinit_g = TRUE; } } @@ -258,6 +258,7 @@ H5_term_library(void) pending += DOWN(A); pending += DOWN(S); pending += DOWN(T); + pending += DOWN(EQ); /* Don't shut down the file code until objects in files are shut down */ if(pending == 0) pending += DOWN(F); @@ -273,6 +274,7 @@ H5_term_library(void) pending += DOWN(Z); pending += DOWN(FD); pending += DOWN(P); + pending += DOWN(PL); /* Don't shut down the error code until other APIs which use it are shut down */ if(pending == 0) pending += DOWN(E); @@ -311,7 +313,7 @@ H5_term_library(void) MPI_Initialized(&mpi_initialized); if(mpi_initialized) { mpe_code = MPE_Finish_log("h5log"); - assert(mpe_code >=0); + HDassert(mpe_code >=0); } /* end if */ H5_MPEinit_g = FALSE; /* turn it off no matter what */ } /* end if */ @@ -1390,9 +1390,9 @@ herr_t H5Aiterate2(hid_t loc_id, H5_index_t idx_type, H5_iter_order_t order, hsize_t *idx, H5A_operator2_t op, void *op_data) { - H5A_attr_iter_op_t attr_op; /* Attribute operator */ - hsize_t start_idx; /* Index of attribute to start iterating at */ - hsize_t last_attr; /* Index of last attribute examined */ + void *obj = NULL; /* object token of loc_id */ + H5VL_t *vol_plugin; /* VOL plugin information */ + H5VL_loc_params_t loc_params; herr_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) @@ -1406,18 +1406,20 @@ H5Aiterate2(hid_t loc_id, H5_index_t idx_type, H5_iter_order_t order, if(order <= H5_ITER_UNKNOWN || order >= H5_ITER_N) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid iteration order specified") - /* Build attribute operator info */ - attr_op.op_type = H5A_ATTR_OP_APP2; - attr_op.u.app_op2 = op; + loc_params.type = H5VL_OBJECT_BY_SELF; + loc_params.obj_type = H5I_get_type(loc_id); - /* Call attribute iteration routine */ - last_attr = start_idx = (idx ? *idx : 0); - if((ret_value = H5O_attr_iterate(loc_id, H5AC_ind_dxpl_id, idx_type, order, start_idx, &last_attr, &attr_op, op_data)) < 0) - HERROR(H5E_ATTR, H5E_BADITER, "error iterating over attributes"); + /* get the file object */ + if(NULL == (obj = (void *)H5I_object(loc_id))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid file identifier") + /* get the plugin pointer */ + if (NULL == (vol_plugin = (H5VL_t *)H5I_get_aux(loc_id))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "ID does not contain VOL information") - /* Set the last attribute information */ - if(idx) - *idx = last_attr; + /* iterate over the links through the VOL */ + if((ret_value = H5VL_attr_iterate(obj, loc_params, vol_plugin, idx_type, order, idx, + op, op_data, H5AC_dxpl_id, H5_EVENT_QUEUE_NULL)) < 0) + HGOTO_ERROR(H5E_SYM, H5E_BADITER, FAIL, "link iteration failed") done: FUNC_LEAVE_API(ret_value) @@ -1472,15 +1474,9 @@ H5Aiterate_by_name(hid_t loc_id, const char *obj_name, H5_index_t idx_type, H5_iter_order_t order, hsize_t *idx, H5A_operator2_t op, void *op_data, hid_t lapl_id) { - H5G_loc_t loc; /* Object location */ - H5G_loc_t obj_loc; /* Location used to open group */ - H5G_name_t obj_path; /* Opened object group hier. path */ - H5O_loc_t obj_oloc; /* Opened object object location */ - hbool_t loc_found = FALSE; /* Entry at 'obj_name' found */ - hid_t obj_loc_id = (-1); /* ID for object located */ - H5A_attr_iter_op_t attr_op; /* Attribute operator */ - hsize_t start_idx; /* Index of attribute to start iterating at */ - hsize_t last_attr; /* Index of last attribute examined */ + void *obj = NULL; /* object token of loc_id */ + H5VL_t *vol_plugin; /* VOL plugin information */ + H5VL_loc_params_t loc_params; herr_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) @@ -1490,8 +1486,6 @@ H5Aiterate_by_name(hid_t loc_id, const char *obj_name, H5_index_t idx_type, /* check arguments */ if(H5I_ATTR == H5I_get_type(loc_id)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "location is not valid for an attribute") - if(H5G_loc(loc_id, &loc) < 0) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location") if(!obj_name || !*obj_name) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no object name") if(idx_type <= H5_INDEX_UNKNOWN || idx_type >= H5_INDEX_N) @@ -1504,55 +1498,24 @@ H5Aiterate_by_name(hid_t loc_id, const char *obj_name, H5_index_t idx_type, if(TRUE != H5P_isa_class(lapl_id, H5P_LINK_ACCESS)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not link access property list ID") - /* Set up opened group location to fill in */ - obj_loc.oloc = &obj_oloc; - obj_loc.path = &obj_path; - H5G_loc_reset(&obj_loc); - - /* Find the object's location */ - if(H5G_loc_find(&loc, obj_name, &obj_loc/*out*/, lapl_id, H5AC_ind_dxpl_id) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_NOTFOUND, FAIL, "object not found") - loc_found = TRUE; - - /* Open the object */ - if((obj_loc_id = H5O_open_by_loc(&obj_loc, lapl_id, H5AC_ind_dxpl_id, TRUE)) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, FAIL, "unable to open object") - - /* get the native object from the ID created by the object header and create - a "VOL object" ID */ - { - void *temp_obj = NULL; - H5I_type_t obj_type; - obj_type = H5I_get_type(obj_loc_id); - if(NULL == (temp_obj = H5I_remove(obj_loc_id))) - HGOTO_ERROR(H5E_SYM, H5E_CANTOPENOBJ, FAIL, "unable to open object") - /* Get an atom for the datatype */ - if((obj_loc_id = H5VL_native_register(obj_type, temp_obj, TRUE)) < 0) - HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register datatype") - } - - /* Build attribute operator info */ - attr_op.op_type = H5A_ATTR_OP_APP2; - attr_op.u.app_op2 = op; + loc_params.type = H5VL_OBJECT_BY_NAME; + loc_params.obj_type = H5I_get_type(loc_id); + loc_params.loc_data.loc_by_name.name = obj_name; + loc_params.loc_data.loc_by_name.plist_id = lapl_id; - /* Call attribute iteration routine */ - last_attr = start_idx = (idx ? *idx : 0); - if((ret_value = H5O_attr_iterate(obj_loc_id, H5AC_ind_dxpl_id, idx_type, order, start_idx, &last_attr, &attr_op, op_data)) < 0) - HERROR(H5E_ATTR, H5E_BADITER, "error iterating over attributes"); + /* get the file object */ + if(NULL == (obj = (void *)H5I_object(loc_id))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid file identifier") + /* get the plugin pointer */ + if (NULL == (vol_plugin = (H5VL_t *)H5I_get_aux(loc_id))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "ID does not contain VOL information") - /* Set the last attribute information */ - if(idx) - *idx = last_attr; + /* iterate over the links through the VOL */ + if((ret_value = H5VL_attr_iterate(obj, loc_params, vol_plugin, idx_type, order, idx, + op, op_data, H5AC_dxpl_id, H5_EVENT_QUEUE_NULL)) < 0) + HGOTO_ERROR(H5E_SYM, H5E_BADITER, FAIL, "attribute iteration failed") done: - /* Release resources */ - if(obj_loc_id > 0) { - if(H5I_dec_app_ref(obj_loc_id) < 0) - HDONE_ERROR(H5E_ATTR, H5E_CANTDEC, FAIL, "unable to close temporary object") - } /* end if */ - else if(loc_found && H5G_loc_free(&obj_loc) < 0) - HDONE_ERROR(H5E_ATTR, H5E_CANTRELEASE, FAIL, "can't free location") - FUNC_LEAVE_API(ret_value) } /* H5Aiterate_by_name() */ @@ -259,6 +259,7 @@ H5AC_init_interface(void) H5P_genclass_t *xfer_pclass; /* Dataset transfer property list class object */ H5P_genplist_t *xfer_plist; /* Dataset transfer property list object */ unsigned block_before_meta_write; /* "block before meta write" property value */ + unsigned coll_meta_write; /* "collective metadata write" property value */ unsigned library_internal=1; /* "library internal" property value */ H5FD_mpio_xfer_t xfer_mode; /* I/O transfer mode property value */ herr_t ret_value=SUCCEED; /* Return value */ @@ -272,6 +273,7 @@ H5AC_init_interface(void) if (NULL == (xfer_pclass = H5I_object(H5P_CLS_DATASET_XFER_g))) HGOTO_ERROR(H5E_CACHE, H5E_BADATOM, FAIL, "can't get property list class") + /* Get an ID for the blocking, collective H5AC dxpl */ if ((H5AC_dxpl_id=H5P_create_id(xfer_pclass,FALSE)) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTCREATE, FAIL, "unable to register property list") @@ -291,10 +293,12 @@ H5AC_init_interface(void) NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL)<0) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't insert metadata cache dxpl property") - /* Set the transfer mode */ - xfer_mode=H5FD_MPIO_COLLECTIVE; - if (H5P_set(xfer_plist,H5D_XFER_IO_XFER_MODE_NAME,&xfer_mode)<0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "unable to set value") + /* Insert 'collective metadata write' property */ + coll_meta_write = 1; + if(H5P_insert(xfer_plist, H5AC_COLLECTIVE_META_WRITE_NAME, H5AC_COLLECTIVE_META_WRITE_SIZE, &coll_meta_write, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't insert metadata cache dxpl property") + /* Get an ID for the non-blocking, collective H5AC dxpl */ if ((H5AC_noblock_dxpl_id=H5P_create_id(xfer_pclass,FALSE)) < 0) @@ -315,10 +319,12 @@ H5AC_init_interface(void) NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL)<0) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't insert metadata cache dxpl property") - /* Set the transfer mode */ - xfer_mode=H5FD_MPIO_COLLECTIVE; - if (H5P_set(xfer_plist,H5D_XFER_IO_XFER_MODE_NAME,&xfer_mode)<0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "unable to set value") + /* Insert 'collective metadata write' property */ + coll_meta_write = 1; + if(H5P_insert(xfer_plist, H5AC_COLLECTIVE_META_WRITE_NAME, H5AC_COLLECTIVE_META_WRITE_SIZE, &coll_meta_write, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't insert metadata cache dxpl property") + /* Get an ID for the non-blocking, independent H5AC dxpl */ if ((H5AC_ind_dxpl_id=H5P_create_id(xfer_pclass,FALSE)) < 0) @@ -339,10 +345,11 @@ H5AC_init_interface(void) NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL)<0) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't insert metadata cache dxpl property") - /* Set the transfer mode */ - xfer_mode=H5FD_MPIO_INDEPENDENT; - if (H5P_set(xfer_plist,H5D_XFER_IO_XFER_MODE_NAME,&xfer_mode)<0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "unable to set value") + /* Insert 'collective metadata write' property */ + coll_meta_write = 0; + if(H5P_insert(xfer_plist, H5AC_COLLECTIVE_META_WRITE_NAME, H5AC_COLLECTIVE_META_WRITE_SIZE, &coll_meta_write, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't insert metadata cache dxpl property") done: FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5ACprivate.h b/src/H5ACprivate.h index 17ce310..cc669a7 100644 --- a/src/H5ACprivate.h +++ b/src/H5ACprivate.h @@ -199,6 +199,11 @@ typedef H5C_t H5AC_t; #define H5AC_BLOCK_BEFORE_META_WRITE_SIZE sizeof(unsigned) #define H5AC_BLOCK_BEFORE_META_WRITE_DEF 0 +/* Definitions for "collective metadata write" property */ +#define H5AC_COLLECTIVE_META_WRITE_NAME "H5AC_collective_metadata_write" +#define H5AC_COLLECTIVE_META_WRITE_SIZE sizeof(unsigned) +#define H5AC_COLLECTIVE_META_WRITE_DEF 0 + /* Definitions for "library internal" property */ #define H5AC_LIBRARY_INTERNAL_NAME "H5AC_library_internal" #define H5AC_LIBRARY_INTERNAL_SIZE sizeof(unsigned) @@ -75,6 +75,9 @@ #include "H5private.h" /* Generic Functions */ +#ifdef H5_HAVE_PARALLEL +#include "H5ACprivate.h" /* Metadata cache */ +#endif /* H5_HAVE_PARALLEL */ #include "H5Cpkg.h" /* Cache */ #include "H5Dprivate.h" /* Dataset functions */ #include "H5Eprivate.h" /* Error handling */ @@ -476,10 +479,10 @@ H5C_apply_candidate_list(H5F_t * f, sprintf(&(tbl_buf[0]), "candidate list = "); for ( i = 0; i < num_candidates; i++ ) { - sprintf(&(tbl_buf[strlen(tbl_buf)]), " 0x%llx", + sprintf(&(tbl_buf[HDstrlen(tbl_buf)]), " 0x%llx", (long long)(*(candidates_list_ptr + i))); } - sprintf(&(tbl_buf[strlen(tbl_buf)]), "\n"); + sprintf(&(tbl_buf[HDstrlen(tbl_buf)]), "\n"); HDfprintf(stdout, "%s", tbl_buf); #endif /* H5C_APPLY_CANDIDATE_LIST__DEBUG */ @@ -536,8 +539,8 @@ H5C_apply_candidate_list(H5F_t * f, tbl_buf[i] = '\0'; sprintf(&(tbl_buf[0]), "candidate assignment table = "); for(i = 0; i <= mpi_size; i++) - sprintf(&(tbl_buf[strlen(tbl_buf)]), " %d", candidate_assignment_table[i]); - sprintf(&(tbl_buf[strlen(tbl_buf)]), "\n"); + sprintf(&(tbl_buf[HDstrlen(tbl_buf)]), " %d", candidate_assignment_table[i]); + sprintf(&(tbl_buf[HDstrlen(tbl_buf)]), "\n"); HDfprintf(stdout, "%s", tbl_buf); HDfprintf(stdout, "%s:%d: flush entries [%d, %d].\n", @@ -811,7 +814,7 @@ H5C_apply_candidate_list(H5F_t * f, entries_cleared, entries_flushed); HDfprintf(stdout, "%s:%d: done.\n", FUNC, mpi_rank); - fsync(stdout); + HDfsync(stdout); #endif /* H5C_APPLY_CANDIDATE_LIST__DEBUG */ /* ====================================================================== * @@ -8277,37 +8280,27 @@ H5C_flush_single_entry(H5F_t * f, #ifdef H5_HAVE_PARALLEL #ifndef NDEBUG - /* If MPI based VFD is used, do special parallel I/O sanity checks. * Note that we only do these sanity checks when the clear_only flag * is not set, and the entry to be flushed is dirty. Don't bother * otherwise as no file I/O can result. */ - if ( ( ! clear_only ) && - ( entry_ptr->is_dirty ) && - (H5F_HAS_FEATURE(f, H5FD_FEAT_HAS_MPI) ) ) { - - H5P_genplist_t *dxpl; /* Dataset transfer property list */ - H5FD_mpio_xfer_t xfer_mode; /* I/O xfer mode property value */ + if(!clear_only && entry_ptr->is_dirty && + H5F_HAS_FEATURE(f, H5FD_FEAT_HAS_MPI)) { + H5P_genplist_t *dxpl; /* Dataset transfer property list */ + unsigned coll_meta; /* Collective metadata write flag */ /* Get the dataset transfer property list */ - if ( NULL == (dxpl = H5I_object(primary_dxpl_id)) ) { - - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, \ - "not a dataset transfer property list") - } + if(NULL == (dxpl = H5I_object(primary_dxpl_id))) + HGOTO_ERROR(H5E_CACHE, H5E_BADTYPE, FAIL, "not a dataset transfer property list") - /* Get the transfer mode property */ - if( H5P_get(dxpl, H5D_XFER_IO_XFER_MODE_NAME, &xfer_mode) < 0 ) { - - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, \ - "can't retrieve xfer mode") - } - - /* Sanity check transfer mode */ - HDassert( xfer_mode == H5FD_MPIO_COLLECTIVE ); - } + /* Get the collective metadata write property */ + if(H5P_get(dxpl, H5AC_COLLECTIVE_META_WRITE_NAME, &coll_meta) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_CANTGET, FAIL, "can't retrieve xfer mode") + /* Sanity check collective metadata write flag */ + HDassert(coll_meta); + } /* end if */ #endif /* NDEBUG */ #endif /* H5_HAVE_PARALLEL */ @@ -173,7 +173,7 @@ H5CS_print(FILE *stream) FUNC_ENTER_NOAPI_NOERR_NOFS /* Sanity check */ - assert(fstack); + HDassert(fstack); H5CS_print_stack(fstack, stream); @@ -205,8 +205,8 @@ H5CS_push(const char *func_name) FUNC_ENTER_NOAPI_NOERR_NOFS /* Sanity check */ - assert (fstack); - assert (func_name); + HDassert(fstack); + HDassert(func_name); /* * Push the function if there's room. Otherwise just increment count @@ -242,8 +242,8 @@ H5CS_pop(void) FUNC_ENTER_NOAPI_NOERR_NOFS /* Sanity check */ - assert (fstack); - assert (fstack->nused>0); + HDassert(fstack); + HDassert(fstack->nused>0); /* Pop the function. */ fstack->nused--; @@ -276,7 +276,7 @@ H5CS_copy_stack(H5CS_t *new_stack) FUNC_ENTER_NOAPI_NOERR_NOFS /* Sanity check */ - HDassert (old_stack); + HDassert(old_stack); /* Copy old stack to new one, duplicating the strings */ for(u = 0; u < old_stack->nused; u++) @@ -310,7 +310,7 @@ H5CS_close_stack(H5CS_t *stack) FUNC_ENTER_NOAPI_NOERR_NOFS /* Sanity check */ - HDassert (stack); + HDassert(stack); /* Free strings on stack */ for(u = 0; u < stack->nused; u++) @@ -115,7 +115,7 @@ done: * properties (DCPL_ID). * * All arguments are copied into the dataset, so the caller is - * allowed to derive new types, data spaces, and creation + * allowed to derive new types, dataspaces, and creation * parameters from the old ones and reuse them in calls to * create other datasets. * @@ -221,7 +221,7 @@ done: * properties (DCPL_ID). * * All arguments are copied into the dataset, so the caller is - * allowed to derive new types, data spaces, and creation + * allowed to derive new types, dataspaces, and creation * parameters from the old ones and reuse them in calls to * create other datasets. * @@ -436,9 +436,9 @@ done: /*------------------------------------------------------------------------- * Function: H5Dget_space * - * Purpose: Returns a copy of the file data space for a dataset. + * Purpose: Returns a copy of the file dataspace for a dataset. * - * Return: Success: ID for a copy of the data space. The data + * Return: Success: ID for a copy of the dataspace. The data * space should be released by calling * H5Sclose(). * @@ -467,8 +467,10 @@ H5Dget_space(hid_t dset_id) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid dataset identifier") /* get the dataspace through the VOL */ - if(H5VL_dataset_get(dset, vol_plugin, H5VL_DATASET_GET_SPACE, H5AC_dxpl_id, H5_EVENT_QUEUE_NULL, &ret_value) < 0) + if(H5VL_dataset_get(dset, vol_plugin, H5VL_DATASET_GET_SPACE, H5AC_dxpl_id, + H5_EVENT_QUEUE_NULL, &ret_value) < 0) HGOTO_ERROR(H5E_INTERNAL, H5E_CANTGET, FAIL, "unable to get data space") + done: FUNC_LEAVE_API(ret_value) } @@ -477,7 +479,7 @@ done: /*------------------------------------------------------------------------- * Function: H5Dget_space_status * - * Purpose: Returns the status of data space allocation. + * Purpose: Returns the status of dataspace allocation. * * Return: * Success: Non-negative @@ -506,7 +508,8 @@ H5Dget_space_status(hid_t dset_id, H5D_space_status_t *allocation) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid dataset identifier") /* Read data space address through the VOL and return */ - if((ret_value=H5VL_dataset_get(dset, vol_plugin, H5VL_DATASET_GET_SPACE_STATUS, H5AC_dxpl_id, H5_EVENT_QUEUE_NULL, allocation)) < 0) + if((ret_value=H5VL_dataset_get(dset, vol_plugin, H5VL_DATASET_GET_SPACE_STATUS, + H5AC_dxpl_id, H5_EVENT_QUEUE_NULL, allocation)) < 0) HGOTO_ERROR(H5E_INTERNAL, H5E_CANTGET, FAIL, "unable to get space status") done: @@ -577,7 +580,7 @@ H5Dget_create_plist(hid_t dset_id) { H5VL_t *vol_plugin; void *dset; - hid_t ret_value = FAIL; /* Return value */ + hid_t ret_value = FAIL; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE1("i", "i", dset_id); @@ -903,7 +906,10 @@ herr_t H5Dvlen_get_buf_size(hid_t dataset_id, hid_t type_id, hid_t space_id, hsize_t *size) { - H5D_vlen_bufsize_t vlen_bufsize = {0, 0, 0, 0, 0, 0, 0}; + H5D_vlen_bufsize_t vlen_bufsize = {0, 0, 0, 0, 0, 0, 0, 0}; + H5VL_t *vol_plugin; /* VOL plugin this object belongs to */ + void *dset; /* Dataset for operation */ + H5S_t *mspace = NULL; /* Memory dataspace */ char bogus; /* bogus value to pass to H5Diterate() */ H5S_t *space; /* Dataspace for iteration */ H5P_genclass_t *pclass; /* Property class */ @@ -917,35 +923,35 @@ H5Dvlen_get_buf_size(hid_t dataset_id, hid_t type_id, hid_t space_id, if(H5I_DATASET != H5I_get_type(dataset_id) || (H5I_DATATYPE != H5I_get_type(type_id)) || size == NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid argument") + /* get the plugin pointer */ + if (NULL == (vol_plugin = (H5VL_t *)H5I_get_aux(dataset_id))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "ID does not contain VOL information") + /* get the dataset object */ + if(NULL == (dset = (void *)H5I_object(dataset_id))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid dataset identifier") if(NULL == (space = (H5S_t *)H5I_object_verify(space_id, H5I_DATASPACE))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid dataspace") if(!(H5S_has_extent(space))) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "dataspace does not have extent set") - /* Save the dataset ID */ - vlen_bufsize.dataset_id = dataset_id; + /* Save the dataset & VOL plugin */ + vlen_bufsize.dset = dset; + vlen_bufsize.vol_plugin = vol_plugin; + + vlen_bufsize.fspace_id = FAIL; + vlen_bufsize.mspace_id = FAIL; - if((vlen_bufsize.fspace_id = H5Dget_space(dataset_id)) < 0) + /* Get a copy of the dataspace ID */ + if(H5VL_dataset_get(dset, vol_plugin, H5VL_DATASET_GET_SPACE, H5AC_dxpl_id, + H5_EVENT_QUEUE_NULL, &vlen_bufsize.fspace_id) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCOPY, FAIL, "can't copy dataspace") -#if 0 - { - H5VL_t *vol_plugin; - void *dset; - /* get the plugin pointer */ - if (NULL == (vol_plugin = (H5VL_t *)H5I_get_aux(dataset_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "ID does not contain VOL information") - /* get the dataset object */ - if(NULL == (dset = (void *)H5I_object(dataset_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid dataset identifier") - /* Get a copy of the dataspace ID */ - if(H5VL_dataset_get(dset, vol_plugin, H5VL_DATASET_GET_SPACE, H5AC_dxpl_id, H5_EVENT_QUEUE_NULL, &(vlen_bufsize.fspace_id)) < 0) - HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCOPY, FAIL, "can't copy dataspace") - } -#endif /* Create a scalar for the memory dataspace */ - if((vlen_bufsize.mspace_id = H5Screate(H5S_SCALAR)) < 0) - HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCOPY, FAIL, "can't create dataspace") + if(NULL == (mspace = H5S_create(H5S_SCALAR))) + HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCREATE, FAIL, "can't create dataspace") + /* Atomize */ + if((vlen_bufsize.mspace_id = H5I_register (H5I_DATASPACE, mspace, TRUE)) < 0) + HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register dataspace atom") /* Grab the temporary buffers required */ if(NULL == (vlen_bufsize.fl_tbuf = H5FL_BLK_MALLOC(vlen_fl_buf, (size_t)1))) @@ -980,10 +986,15 @@ H5Dvlen_get_buf_size(hid_t dataset_id, hid_t type_id, hid_t space_id, *size = vlen_bufsize.size; done: - if(vlen_bufsize.fspace_id > 0 && H5I_dec_ref(vlen_bufsize.fspace_id) < 0) - HDONE_ERROR(H5E_DATASET, H5E_CLOSEERROR, FAIL, "unable to release dataspace") - if(vlen_bufsize.mspace_id > 0 && H5I_dec_ref(vlen_bufsize.mspace_id) < 0) - HDONE_ERROR(H5E_DATASET, H5E_CLOSEERROR, FAIL, "unable to release dataspace") + if(ret_value < 0) { + if(mspace && H5S_close(mspace) < 0) + HDONE_ERROR(H5E_DATASPACE, H5E_CANTRELEASE, FAIL, "unable to release dataspace") + } /* end if */ + + if(vlen_bufsize.fspace_id && H5I_dec_app_ref(vlen_bufsize.fspace_id) < 0) + HGOTO_ERROR(H5E_DATASPACE, H5E_CANTDEC, FAIL, "problem freeing id") + if(vlen_bufsize.mspace_id && H5I_dec_app_ref(vlen_bufsize.mspace_id) < 0) + HGOTO_ERROR(H5E_DATASPACE, H5E_CANTDEC, FAIL, "problem freeing id") if(vlen_bufsize.fl_tbuf != NULL) vlen_bufsize.fl_tbuf = H5FL_BLK_FREE(vlen_fl_buf, vlen_bufsize.fl_tbuf); if(vlen_bufsize.vl_tbuf != NULL) diff --git a/src/H5Dchunk.c b/src/H5Dchunk.c index 497846b..dd1860f 100644 --- a/src/H5Dchunk.c +++ b/src/H5Dchunk.c @@ -1206,7 +1206,7 @@ H5D__create_chunk_file_map_hyper(H5D_chunk_map_t *fm, const H5D_io_info_t FUNC_ENTER_STATIC /* Sanity check */ - assert(fm->f_ndims>0); + HDassert(fm->f_ndims>0); /* Get number of elements selected in file */ sel_points = fm->nelmts; @@ -1383,7 +1383,7 @@ H5D__create_chunk_mem_map_hyper(const H5D_chunk_map_t *fm) FUNC_ENTER_STATIC /* Sanity check */ - assert(fm->f_ndims>0); + HDassert(fm->f_ndims>0); /* Check for all I/O going to a single chunk */ if(H5SL_count(fm->sel_chunks)==1) { @@ -1394,7 +1394,7 @@ H5D__create_chunk_mem_map_hyper(const H5D_chunk_map_t *fm) /* Get pointer to chunk's information */ chunk_info = (H5D_chunk_info_t *)H5SL_item(curr_node); - assert(chunk_info); + HDassert(chunk_info); /* Just point at the memory dataspace & selection */ /* (Casting away const OK -QAK) */ @@ -1413,7 +1413,7 @@ H5D__create_chunk_mem_map_hyper(const H5D_chunk_map_t *fm) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTGET, FAIL, "can't get file selection bound info") /* Calculate the adjustment for memory selection from file selection */ - assert(fm->m_ndims==fm->f_ndims); + HDassert(fm->m_ndims==fm->f_ndims); for(u=0; u<fm->f_ndims; u++) { H5_CHECK_OVERFLOW(file_sel_start[u],hsize_t,hssize_t); H5_CHECK_OVERFLOW(mem_sel_start[u],hsize_t,hssize_t); @@ -1427,7 +1427,7 @@ H5D__create_chunk_mem_map_hyper(const H5D_chunk_map_t *fm) /* Get pointer to chunk's information */ chunk_info = (H5D_chunk_info_t *)H5SL_item(curr_node); - assert(chunk_info); + HDassert(chunk_info); /* Copy the information */ @@ -1709,8 +1709,9 @@ H5D__chunk_cacheable(const H5D_io_info_t *io_info, haddr_t caddr, hbool_t write_ /* If the fill value needs to be written then we will need * to use the cache to write the fill value */ if(fill->fill_time == H5D_FILL_TIME_ALLOC || - (fill->fill_time == H5D_FILL_TIME_IFSET - && fill_status == H5D_FILL_VALUE_USER_DEFINED)) + (fill->fill_time == H5D_FILL_TIME_IFSET && + (fill_status == H5D_FILL_VALUE_USER_DEFINED || + fill_status == H5D_FILL_VALUE_DEFAULT))) ret_value = TRUE; else ret_value = FALSE; @@ -1796,7 +1797,9 @@ H5D__chunk_read(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, * but they aren't set, set the flag to skip missing chunks. */ if(fill->fill_time == H5D_FILL_TIME_NEVER || - (fill->fill_time == H5D_FILL_TIME_IFSET && fill_status != H5D_FILL_VALUE_USER_DEFINED)) + (fill->fill_time == H5D_FILL_TIME_IFSET && + fill_status != H5D_FILL_VALUE_USER_DEFINED && + fill_status != H5D_FILL_VALUE_DEFAULT)) skip_missing_chunks = TRUE; } @@ -2887,7 +2890,9 @@ H5D__chunk_lock(const H5D_io_info_t *io_info, H5D_chunk_ud_t *udata, HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't tell if fill value defined") if(fill->fill_time == H5D_FILL_TIME_ALLOC || - (fill->fill_time == H5D_FILL_TIME_IFSET && fill_status == H5D_FILL_VALUE_USER_DEFINED)) { + (fill->fill_time == H5D_FILL_TIME_IFSET && + (fill_status == H5D_FILL_VALUE_USER_DEFINED || + fill_status == H5D_FILL_VALUE_DEFAULT))) { /* * The chunk doesn't exist in the file. Replicate the fill * value throughout the chunk, if the fill value is defined. @@ -3312,7 +3317,9 @@ H5D__chunk_allocate(H5D_t *dset, hid_t dxpl_id, hbool_t full_overwrite, * set the "should fill" flag */ if((!full_overwrite && (fill->fill_time == H5D_FILL_TIME_ALLOC || - (fill->fill_time == H5D_FILL_TIME_IFSET && fill_status == H5D_FILL_VALUE_USER_DEFINED))) + (fill->fill_time == H5D_FILL_TIME_IFSET && + (fill_status == H5D_FILL_VALUE_USER_DEFINED || + fill_status == H5D_FILL_VALUE_DEFAULT)))) || pline->nused > 0) should_fill = TRUE; diff --git a/src/H5Dint.c b/src/H5Dint.c index 402ff8d..f2b70e7 100644 --- a/src/H5Dint.c +++ b/src/H5Dint.c @@ -379,7 +379,7 @@ H5D__get_dxpl_cache(hid_t dxpl_id, H5D_dxpl_cache_t **cache) FUNC_ENTER_PACKAGE /* Check args */ - assert(cache); + HDassert(cache); /* Check for the default DXPL */ if(dxpl_id==H5P_DATASET_XFER_DEFAULT) @@ -2052,6 +2052,7 @@ H5D__vlen_get_buf_size(void UNUSED *elem, hid_t type_id, unsigned UNUSED ndim, c { H5D_vlen_bufsize_t *vlen_bufsize = (H5D_vlen_bufsize_t *)op_data; H5T_t *dt; /* Datatype for operation */ + H5S_t *fspace; /* File dataspace for operation */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -2061,19 +2062,24 @@ H5D__vlen_get_buf_size(void UNUSED *elem, hid_t type_id, unsigned UNUSED ndim, c /* Check args */ if(NULL == (dt = (H5T_t *)H5I_object(type_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype") + HGOTO_ERROR(H5E_DATASET, H5E_BADTYPE, FAIL, "not a datatype") /* Make certain there is enough fixed-length buffer available */ if(NULL == (vlen_bufsize->fl_tbuf = H5FL_BLK_REALLOC(vlen_fl_buf, vlen_bufsize->fl_tbuf, H5T_get_size(dt)))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't resize tbuf") + HGOTO_ERROR(H5E_DATASET, H5E_NOSPACE, FAIL, "can't resize tbuf") /* Select point to read in */ - if(H5Sselect_elements(vlen_bufsize->fspace_id, H5S_SELECT_SET, (size_t)1, point) < 0) - HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCREATE, FAIL, "can't select point") + if(NULL == (fspace = (H5S_t *)H5I_object_verify(vlen_bufsize->fspace_id, H5I_DATASPACE))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataspace") + if(H5S_select_elements(fspace, H5S_SELECT_SET, (size_t)1, point) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTCREATE, FAIL, "can't select point") /* Read in the point (with the custom VL memory allocator) */ - if(H5Dread(vlen_bufsize->dataset_id, type_id, vlen_bufsize->mspace_id, vlen_bufsize->fspace_id, vlen_bufsize->xfer_pid, vlen_bufsize->fl_tbuf) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "can't read point") + if(H5VL_dataset_read(vlen_bufsize->dset, vlen_bufsize->vol_plugin, + type_id, vlen_bufsize->mspace_id, + vlen_bufsize->fspace_id, vlen_bufsize->xfer_pid, + vlen_bufsize->fl_tbuf, H5_EVENT_QUEUE_NULL) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "can't read data") done: FUNC_LEAVE_NOAPI(ret_value) @@ -2464,15 +2470,16 @@ done: /*------------------------------------------------------------------------- * Function: H5D_get_create_plist * - * Purpose: Returns a copy of the dataset creation property list. + * Purpose: Private function for H5Dget_create_plist * * Return: Success: ID for a copy of the dataset creation - * property list. + * property list. The template should be + * released by calling H5P_close(). * * Failure: FAIL * - * Programmer: Mohamad Chaarawi - * March, 2012 + * Programmer: Robb Matzke + * Tuesday, February 3, 1998 * *------------------------------------------------------------------------- */ @@ -2482,19 +2489,19 @@ H5D_get_create_plist(H5D_t *dset) H5P_genplist_t *dcpl_plist; /* Dataset's DCPL */ H5P_genplist_t *new_plist; /* Copy of dataset's DCPL */ H5O_fill_t copied_fill; /* Fill value to tweak */ - hid_t new_id = FAIL; - hid_t ret_value = FAIL; + hid_t new_dcpl_id = FAIL; + hid_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_NOAPI(FAIL) /* Check args */ if(NULL == (dcpl_plist = (H5P_genplist_t *)H5I_object(dset->shared->dcpl_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "can't get property list") /* Copy the creation property list */ - if((new_id = H5P_copy_plist(dcpl_plist, TRUE)) < 0) + if((new_dcpl_id = H5P_copy_plist(dcpl_plist, TRUE)) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "unable to copy the creation property list") - if(NULL == (new_plist = (H5P_genplist_t *)H5I_object(new_id))) + if(NULL == (new_plist = (H5P_genplist_t *)H5I_object(new_dcpl_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "can't get property list") /* Retrieve any object creation properties */ @@ -2565,14 +2572,13 @@ H5D_get_create_plist(H5D_t *dset) HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "unable to set property list fill value") /* Set the return value */ - ret_value = new_id; + ret_value = new_dcpl_id; done: - if(ret_value < 0) { - if(new_id > 0) - if(H5I_dec_app_ref(new_id) < 0) - HDONE_ERROR(H5E_SYM, H5E_CANTDEC, FAIL, "can't free") - } /* end if */ + if(ret_value < 0) + if(new_dcpl_id > 0) + if(H5I_dec_app_ref(new_dcpl_id) < 0) + HDONE_ERROR(H5E_DATASET, H5E_CANTDEC, FAIL, "unable to close temporary object") FUNC_LEAVE_NOAPI(ret_value) } /* end H5D_get_create_plist() */ diff --git a/src/H5Dio.c b/src/H5Dio.c index 25af0f5..f67a40f 100644 --- a/src/H5Dio.c +++ b/src/H5Dio.c @@ -359,7 +359,7 @@ H5D__read(H5D_t *dataset, hid_t mem_type_id, const H5S_t *mem_space, H5D_dxpl_cache_t *dxpl_cache = &_dxpl_cache; /* Data transfer property cache */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_STATIC_TAG(dxpl_id, dataset->oloc.addr, FAIL) + FUNC_ENTER_PACKAGE_TAG(dxpl_id, dataset->oloc.addr, FAIL) /* check args */ HDassert(dataset && dataset->oloc.file); diff --git a/src/H5Dmpio.c b/src/H5Dmpio.c index 900ad6a..4d4c2bf 100644 --- a/src/H5Dmpio.c +++ b/src/H5Dmpio.c @@ -648,42 +648,49 @@ H5D__chunk_collective_io(H5D_io_info_t *io_info, const H5D_type_info_t *type_inf } /* end else */ #ifdef H5_HAVE_INSTRUMENTED_LIBRARY +{ + H5P_genplist_t *plist; /* Property list pointer */ htri_t check_prop; int new_value; + /* Get the dataset transfer property list */ + if(NULL == (plist = (H5P_genplist_t *)H5I_object(io_info->dxpl_id))) + HGOTO_ERROR(H5E_IO, H5E_BADTYPE, FAIL, "not a dataset transfer property list") + /*** Test collective chunk user-input optimization APIs. ***/ - check_prop = H5Pexist(io_info->dxpl_id, H5D_XFER_COLL_CHUNK_LINK_HARD_NAME); + check_prop = H5P_exist_plist(plist, H5D_XFER_COLL_CHUNK_LINK_HARD_NAME); if(check_prop > 0) { if(H5D_ONE_LINK_CHUNK_IO == io_option) { new_value = 0; - if(H5Pset(io_info->dxpl_id, H5D_XFER_COLL_CHUNK_LINK_HARD_NAME, &new_value) < 0) + if(H5P_set(plist, H5D_XFER_COLL_CHUNK_LINK_HARD_NAME, &new_value) < 0) HGOTO_ERROR(H5E_IO, H5E_CANTSET, FAIL, "unable to set property value") } /* end if */ } /* end if */ - check_prop = H5Pexist(io_info->dxpl_id, H5D_XFER_COLL_CHUNK_MULTI_HARD_NAME); + check_prop = H5P_exist_plist(plist, H5D_XFER_COLL_CHUNK_MULTI_HARD_NAME); if(check_prop > 0) { if(H5D_MULTI_CHUNK_IO == io_option) { new_value = 0; - if(H5Pset(io_info->dxpl_id, H5D_XFER_COLL_CHUNK_MULTI_HARD_NAME, &new_value) < 0) + if(H5P_set(plist, H5D_XFER_COLL_CHUNK_MULTI_HARD_NAME, &new_value) < 0) HGOTO_ERROR(H5E_IO, H5E_CANTSET, FAIL, "unable to set property value") } /* end if */ } /* end if */ - check_prop = H5Pexist(io_info->dxpl_id, H5D_XFER_COLL_CHUNK_LINK_NUM_TRUE_NAME); + check_prop = H5P_exist_plist(plist, H5D_XFER_COLL_CHUNK_LINK_NUM_TRUE_NAME); if(check_prop > 0) { if(H5D_ONE_LINK_CHUNK_IO_MORE_OPT == io_option) { new_value = 0; - if(H5Pset(io_info->dxpl_id, H5D_XFER_COLL_CHUNK_LINK_NUM_TRUE_NAME, &new_value) < 0) + if(H5P_set(plist, H5D_XFER_COLL_CHUNK_LINK_NUM_TRUE_NAME, &new_value) < 0) HGOTO_ERROR(H5E_IO, H5E_CANTSET, FAIL, "unable to set property value") } /* end if */ } /* end if */ - check_prop = H5Pexist(io_info->dxpl_id, H5D_XFER_COLL_CHUNK_LINK_NUM_FALSE_NAME); + check_prop = H5P_exist_plist(plist, H5D_XFER_COLL_CHUNK_LINK_NUM_FALSE_NAME); if(check_prop > 0) { if(temp_not_link_io) { new_value = 0; - if(H5Pset(io_info->dxpl_id, H5D_XFER_COLL_CHUNK_LINK_NUM_FALSE_NAME, &new_value) < 0) + if(H5P_set(plist, H5D_XFER_COLL_CHUNK_LINK_NUM_FALSE_NAME, &new_value) < 0) HGOTO_ERROR(H5E_IO, H5E_CANTSET, FAIL, "unable to set property value") } /* end if */ } /* end if */ +} #endif /* step 2: Go ahead to do IO.*/ @@ -1713,19 +1720,26 @@ H5D__obtain_mpio_mode(H5D_io_info_t* io_info, H5D_chunk_map_t *fm, HDmemcpy(chunk_addr, tempbuf, sizeof(haddr_t) * total_chunks); #ifdef H5_HAVE_INSTRUMENTED_LIBRARY - check_prop = H5Pexist(io_info->dxpl_id, H5D_XFER_COLL_CHUNK_MULTI_RATIO_COLL_NAME); +{ + H5P_genplist_t *plist; /* Property list pointer */ + + /* Get the dataset transfer property list */ + if(NULL == (plist = (H5P_genplist_t *)H5I_object(io_info->dxpl_id))) + HGOTO_ERROR(H5E_IO, H5E_BADTYPE, FAIL, "not a dataset transfer property list") + + check_prop = H5P_exist_plist(plist, H5D_XFER_COLL_CHUNK_MULTI_RATIO_COLL_NAME); if(check_prop > 0) { for(ic = 0; ic < total_chunks; ic++) { if(assign_io_mode[ic] == H5D_CHUNK_IO_MODE_COL) { new_value = 0; - if(H5Pset(io_info->dxpl_id,H5D_XFER_COLL_CHUNK_MULTI_RATIO_COLL_NAME,&new_value) < 0) + if(H5P_set(plist, H5D_XFER_COLL_CHUNK_MULTI_RATIO_COLL_NAME, &new_value) < 0) HGOTO_ERROR(H5E_PLIST, H5E_UNSUPPORTED, FAIL, "unable to set property value") break; } /* end if */ } /* end for */ } /* end if */ - check_prop = H5Pexist(io_info->dxpl_id, H5D_XFER_COLL_CHUNK_MULTI_RATIO_IND_NAME); + check_prop = H5P_exist_plist(plist, H5D_XFER_COLL_CHUNK_MULTI_RATIO_IND_NAME); if(check_prop > 0) { int temp_count = 0; @@ -1737,10 +1751,11 @@ H5D__obtain_mpio_mode(H5D_io_info_t* io_info, H5D_chunk_map_t *fm, } /* end for */ if(temp_count == 0) { new_value = 0; - if(H5Pset(io_info->dxpl_id, H5D_XFER_COLL_CHUNK_MULTI_RATIO_IND_NAME, &new_value) < 0) + if(H5P_set(plist, H5D_XFER_COLL_CHUNK_MULTI_RATIO_IND_NAME, &new_value) < 0) HGOTO_ERROR(H5E_PLIST, H5E_UNSUPPORTED, FAIL, "unable to set property value") } /* end if */ } /* end if */ +} #endif done: diff --git a/src/H5Dpkg.h b/src/H5Dpkg.h index ed6da8f..bc862dd 100644 --- a/src/H5Dpkg.h +++ b/src/H5Dpkg.h @@ -479,7 +479,8 @@ typedef struct H5D_fill_buf_info_t { /* Internal data structure for computing variable-length dataset's total size */ typedef struct { - hid_t dataset_id; /* ID of the dataset we are working on */ + void *dset; /* Dataset for operation */ + H5VL_t *vol_plugin; /* VOL plugin the dataset belongs to */ hid_t fspace_id; /* ID of the file dataset's dataspace we are working on */ hid_t mspace_id; /* ID of the memory dataset's dataspace we are working on */ void *fl_tbuf; /* Ptr to the temporary buffer we are using for fixed-length data */ diff --git a/src/H5Dprivate.h b/src/H5Dprivate.h index 8baafe9..fe26137 100644 --- a/src/H5Dprivate.h +++ b/src/H5Dprivate.h @@ -171,8 +171,8 @@ H5_DLL H5O_loc_t *H5D_oloc(H5D_t *dataset); H5_DLL H5G_name_t *H5D_nameof(H5D_t *dataset); H5_DLL H5T_t *H5D_typeof(const H5D_t *dset); H5_DLL herr_t H5D_flush(const H5F_t *f, hid_t dxpl_id); -H5_DLL hid_t H5D_get_access_plist(H5D_t *dset); H5_DLL hid_t H5D_get_create_plist(H5D_t *dset); +H5_DLL hid_t H5D_get_access_plist(H5D_t *dset); H5_DLL hid_t H5D_get_space(H5D_t *dset); H5_DLL hid_t H5D_get_type(H5D_t *dset); @@ -129,7 +129,7 @@ H5EQ_init_interface(void) FUNC_ENTER_NOAPI_NOINIT - /* Initialize the atom group for the file IDs */ + /* Initialize the atom group for the EQ IDs */ if(H5I_register_type(H5I_EQ_CLS) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINIT, FAIL, "unable to initialize interface") diff --git a/src/H5EQprivate.h b/src/H5EQprivate.h index 3862cfa..34904e1 100644 --- a/src/H5EQprivate.h +++ b/src/H5EQprivate.h @@ -59,7 +59,6 @@ typedef struct H5EQ_t { /* Library Private Prototypes */ /******************************/ -H5_DLL int H5EQ_term_interface(void); herr_t H5EQ_init(void); /* API wrappers */ diff --git a/src/H5Edefin.h b/src/H5Edefin.h index 6e3a7c6..4c4b4df 100644 --- a/src/H5Edefin.h +++ b/src/H5Edefin.h @@ -26,6 +26,7 @@ hid_t H5E_FILE_g = FAIL; /* File accessibilty */ hid_t H5E_VOL_g = FAIL; /* Virtual Object Layer */ hid_t H5E_SOHM_g = FAIL; /* Shared Object Header Messages */ hid_t H5E_SYM_g = FAIL; /* Symbol table */ +hid_t H5E_PLUGIN_g = FAIL; /* Plugin for dynamically loaded library */ hid_t H5E_VFL_g = FAIL; /* Virtual File Layer */ hid_t H5E_INTERNAL_g = FAIL; /* Internal error (too specific to document in detail) */ hid_t H5E_BTREE_g = FAIL; /* B-Tree node */ @@ -132,6 +133,9 @@ hid_t H5E_PATH_g = FAIL; /* Problem with path to object */ /* No error */ hid_t H5E_NONE_MINOR_g = FAIL; /* No error */ +/* Plugin errors */ +hid_t H5E_OPENERROR_g = FAIL; /* Can't open directory or file */ + /* File accessibilty errors */ hid_t H5E_FILEEXISTS_g = FAIL; /* File already exists */ hid_t H5E_FILEOPEN_g = FAIL; /* File already open */ diff --git a/src/H5Einit.h b/src/H5Einit.h index 7cd63a2..75c0b70 100644 --- a/src/H5Einit.h +++ b/src/H5Einit.h @@ -49,6 +49,11 @@ if((msg = H5E_create_msg(cls, H5E_MAJOR, "Symbol table"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") if((H5E_SYM_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") +assert(H5E_PLUGIN_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MAJOR, "Plugin for dynamically loaded library"))==NULL) + HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") +if((H5E_PLUGIN_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) + HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") assert(H5E_VFL_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MAJOR, "Virtual File Layer"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") @@ -482,6 +487,13 @@ if((msg = H5E_create_msg(cls, H5E_MINOR, "No error"))==NULL) if((H5E_NONE_MINOR_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") +/* Plugin errors */ +assert(H5E_OPENERROR_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Can't open directory or file"))==NULL) + HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") +if((H5E_OPENERROR_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) + HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") + /* File accessibilty errors */ assert(H5E_FILEEXISTS_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MINOR, "File already exists"))==NULL) diff --git a/src/H5Epubgen.h b/src/H5Epubgen.h index 6da85a7..e5ecd10 100644 --- a/src/H5Epubgen.h +++ b/src/H5Epubgen.h @@ -29,6 +29,7 @@ #define H5E_VOL (H5OPEN H5E_VOL_g) #define H5E_SOHM (H5OPEN H5E_SOHM_g) #define H5E_SYM (H5OPEN H5E_SYM_g) +#define H5E_PLUGIN (H5OPEN H5E_PLUGIN_g) #define H5E_VFL (H5OPEN H5E_VFL_g) #define H5E_INTERNAL (H5OPEN H5E_INTERNAL_g) #define H5E_BTREE (H5OPEN H5E_BTREE_g) @@ -62,6 +63,7 @@ H5_DLLVAR hid_t H5E_FILE_g; /* File accessibilty */ H5_DLLVAR hid_t H5E_VOL_g; /* Virtual Object Layer */ H5_DLLVAR hid_t H5E_SOHM_g; /* Shared Object Header Messages */ H5_DLLVAR hid_t H5E_SYM_g; /* Symbol table */ +H5_DLLVAR hid_t H5E_PLUGIN_g; /* Plugin for dynamically loaded library */ H5_DLLVAR hid_t H5E_VFL_g; /* Virtual File Layer */ H5_DLLVAR hid_t H5E_INTERNAL_g; /* Internal error (too specific to document in detail) */ H5_DLLVAR hid_t H5E_BTREE_g; /* B-Tree node */ @@ -223,6 +225,10 @@ H5_DLLVAR hid_t H5E_PATH_g; /* Problem with path to object */ #define H5E_NONE_MINOR (H5OPEN H5E_NONE_MINOR_g) H5_DLLVAR hid_t H5E_NONE_MINOR_g; /* No error */ +/* Plugin errors */ +#define H5E_OPENERROR (H5OPEN H5E_OPENERROR_g) +H5_DLLVAR hid_t H5E_OPENERROR_g; /* Can't open directory or file */ + /* File accessibilty errors */ #define H5E_FILEEXISTS (H5OPEN H5E_FILEEXISTS_g) #define H5E_FILEOPEN (H5OPEN H5E_FILEOPEN_g) diff --git a/src/H5Eterm.h b/src/H5Eterm.h index 2ebda75..aecef3e 100644 --- a/src/H5Eterm.h +++ b/src/H5Eterm.h @@ -27,6 +27,7 @@ H5E_FILE_g= H5E_VOL_g= H5E_SOHM_g= H5E_SYM_g= +H5E_PLUGIN_g= H5E_VFL_g= H5E_INTERNAL_g= H5E_BTREE_g= @@ -134,6 +135,9 @@ H5E_PATH_g= /* No error */ H5E_NONE_MINOR_g= +/* Plugin errors */ +H5E_OPENERROR_g= + /* File accessibilty errors */ H5E_FILEEXISTS_g= H5E_FILEOPEN_g= @@ -926,15 +926,13 @@ done: * david.pitt@bigpond.com * Apr 27, 2004 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5Fget_filesize(hid_t file_id, hsize_t *size) { H5VL_t *vol_plugin; - void *obj; + void *file; herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -945,10 +943,11 @@ H5Fget_filesize(hid_t file_id, hsize_t *size) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "ID does not contain VOL information") /* get the file object */ - if(NULL == (obj = (void *)H5I_object(file_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid file identifier") + if(NULL == (file = (void *)H5I_object_verify(file_id, H5I_FILE))) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "not a file ID") - if((ret_value = H5VL_file_optional(obj, vol_plugin, H5VL_FILE_GET_SIZE, H5AC_dxpl_id, H5_EVENT_QUEUE_NULL, size)) < 0) + if((ret_value = H5VL_file_optional(file, vol_plugin, H5VL_FILE_GET_SIZE, + H5AC_dxpl_id, H5_EVENT_QUEUE_NULL, size)) < 0) HGOTO_ERROR(H5E_INTERNAL, H5E_CANTGET, FAIL, "unable to get file size") done: @@ -491,7 +491,7 @@ H5FD_sb_size(H5FD_t *file) FUNC_ENTER_NOAPI(0) - assert(file && file->cls); + HDassert(file && file->cls); if(file->cls->sb_size) ret_value = (file->cls->sb_size)(file); @@ -529,7 +529,7 @@ H5FD_sb_encode(H5FD_t *file, char *name/*out*/, uint8_t *buf) FUNC_ENTER_NOAPI(FAIL) - assert(file && file->cls); + HDassert(file && file->cls); if(file->cls->sb_encode && (file->cls->sb_encode)(file, name/*out*/, buf/*out*/) < 0) HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "driver sb_encode request failed") @@ -691,7 +691,7 @@ H5FD_fapl_get(H5FD_t *file) FUNC_ENTER_NOAPI(NULL) - assert(file); + HDassert(file); if(file->cls->fapl_get) ret_value = (file->cls->fapl_get)(file); @@ -1198,8 +1198,8 @@ H5FDquery(const H5FD_t *f, unsigned long *flags/*out*/) FUNC_ENTER_API(FAIL) H5TRACE2("Is", "*xx", f, flags); - assert(f); - assert(flags); + HDassert(f); + HDassert(flags); ret_value = H5FD_query(f, flags); diff --git a/src/H5FDcore.c b/src/H5FDcore.c index 43c8945..74aeed3 100644 --- a/src/H5FDcore.c +++ b/src/H5FDcore.c @@ -211,7 +211,7 @@ H5FD_core_init(void) FUNC_ENTER_NOAPI(FAIL) - if(H5I_VFL != H5Iget_type(H5FD_CORE_g)) + if(H5I_VFL != H5I_get_type(H5FD_CORE_g)) H5FD_CORE_g = H5FD_register(&H5FD_core_g,sizeof(H5FD_class_t),FALSE); /* Set return value */ diff --git a/src/H5FDdirect.c b/src/H5FDdirect.c index 9715bc1..079554d 100644 --- a/src/H5FDdirect.c +++ b/src/H5FDdirect.c @@ -104,36 +104,8 @@ typedef struct H5FD_direct_t { } H5FD_direct_t; /* - * This driver supports systems that have the lseek64() function by defining - * some macros here so we don't have to have conditional compilations later - * throughout the code. - * - * file_offset_t: The datatype for file offsets, the second argument of - * the lseek() or lseek64() call. - * - * file_seek: The function which adjusts the current file position, - * either lseek() or lseek64(). - */ -/* adding for windows NT file system support. */ - -#ifdef H5_HAVE_LSEEK64 -# define file_offset_t off64_t -# define file_seek lseek64 -# define file_truncate ftruncate64 -#elif defined (H5_HAVE_WIN32_API) -# /*MSVC*/ -# define file_offset_t __int64 -# define file_seek _lseeki64 -# define file_truncate _chsize -#else -# define file_offset_t off_t -# define file_seek lseek -# define file_truncate HDftruncate -#endif - -/* * These macros check for overflow of various quantities. These macros - * assume that file_offset_t is signed and haddr_t and size_t are unsigned. + * assume that HDoff_t is signed and haddr_t and size_t are unsigned. * * ADDR_OVERFLOW: Checks whether a file address of type `haddr_t' * is too large to be represented by the second argument @@ -146,13 +118,13 @@ typedef struct H5FD_direct_t { * which can be addressed entirely by the second * argument of the file seek function. */ -#define MAXADDR (((haddr_t)1<<(8*sizeof(file_offset_t)-1))-1) +#define MAXADDR (((haddr_t)1<<(8*sizeof(HDoff_t)-1))-1) #define ADDR_OVERFLOW(A) (HADDR_UNDEF==(A) || \ ((A) & ~(haddr_t)MAXADDR)) #define SIZE_OVERFLOW(Z) ((Z) & ~(hsize_t)MAXADDR) #define REGION_OVERFLOW(A,Z) (ADDR_OVERFLOW(A) || SIZE_OVERFLOW(Z) || \ HADDR_UNDEF==(A)+(Z) || \ - (file_offset_t)((A)+(Z))<(file_offset_t)(A)) + (HDoff_t)((A)+(Z))<(HDoff_t)(A)) /* Prototypes */ static herr_t H5FD_direct_term(void); @@ -454,7 +426,7 @@ H5FD_direct_fapl_copy(const void *_old_fa) FUNC_ENTER_NOAPI_NOINIT_NOERR - assert(new_fa); + HDassert(new_fa); /* Copy the general information */ HDmemcpy(new_fa, old_fa, sizeof(H5FD_direct_fapl_t)); @@ -500,7 +472,7 @@ H5FD_direct_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxadd FUNC_ENTER_NOAPI_NOINIT /* Sanity check on file offsets */ - assert(sizeof(file_offset_t)>=sizeof(size_t)); + HDassert(sizeof(HDoff_t)>=sizeof(size_t)); /* Check arguments */ if (!name || !*name) @@ -568,26 +540,26 @@ H5FD_direct_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxadd HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, NULL, "HDposix_memalign failed") if(o_flags & O_CREAT) { - if(write(file->fd, (void*)buf1, sizeof(int))<0) { - if(write(file->fd, (void*)buf2, file->fa.fbsize)<0) + if(HDwrite(file->fd, (void*)buf1, sizeof(int))<0) { + if(HDwrite(file->fd, (void*)buf2, file->fa.fbsize)<0) HGOTO_ERROR(H5E_FILE, H5E_WRITEERROR, NULL, "file system may not support Direct I/O") else file->fa.must_align = TRUE; } else { file->fa.must_align = FALSE; - file_truncate(file->fd, (file_offset_t)0); + HDftruncate(file->fd, (HDoff_t)0); } } else { - if(read(file->fd, (void*)buf1, sizeof(int))<0) { - if(read(file->fd, (void*)buf2, file->fa.fbsize)<0) + if(HDread(file->fd, (void*)buf1, sizeof(int))<0) { + if(HDread(file->fd, (void*)buf2, file->fa.fbsize)<0) HGOTO_ERROR(H5E_FILE, H5E_READERROR, NULL, "file system may not support Direct I/O") else file->fa.must_align = TRUE; } else { if(o_flags & O_RDWR) { - if(file_seek(file->fd, (file_offset_t)0, SEEK_SET) < 0) + if(HDlseek(file->fd, (HDoff_t)0, SEEK_SET) < 0) HSYS_GOTO_ERROR(H5E_IO, H5E_SEEKERROR, NULL, "unable to seek to proper position") - if(write(file->fd, (void *)buf1, sizeof(int))<0) + if(HDwrite(file->fd, (void *)buf1, sizeof(int))<0) file->fa.must_align = TRUE; else file->fa.must_align = FALSE; @@ -911,8 +883,8 @@ H5FD_direct_read(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t UNUSED dxpl_id, ha FUNC_ENTER_NOAPI_NOINIT - assert(file && file->pub.cls); - assert(buf); + HDassert(file && file->pub.cls); + HDassert(buf); /* Check for overflow conditions */ if (HADDR_UNDEF==addr) @@ -941,7 +913,7 @@ H5FD_direct_read(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t UNUSED dxpl_id, ha if(!_must_align || ((addr%_fbsize==0) && (size%_fbsize==0) && ((size_t)buf%_boundary==0))) { /* Seek to the correct location */ if ((addr!=file->pos || OP_READ!=file->op) && - file_seek(file->fd, (file_offset_t)addr, SEEK_SET)<0) + HDlseek(file->fd, (HDoff_t)addr, SEEK_SET)<0) HSYS_GOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to seek to proper position") /* Read the aligned data in file first, being careful of interrupted * system calls and partial results. */ @@ -956,8 +928,8 @@ H5FD_direct_read(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t UNUSED dxpl_id, ha HDmemset(buf, 0, size); break; } - assert(nbytes>=0); - assert((size_t)nbytes<=size); + HDassert(nbytes>=0); + HDassert((size_t)nbytes<=size); H5_CHECK_OVERFLOW(nbytes,ssize_t,size_t); size -= (size_t)nbytes; H5_CHECK_OVERFLOW(nbytes,ssize_t,haddr_t); @@ -980,7 +952,7 @@ H5FD_direct_read(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t UNUSED dxpl_id, ha /* look for the aligned position for reading the data */ HDassert(!(((addr / _fbsize) * _fbsize) % _fbsize)); - if(file_seek(file->fd, (file_offset_t)((addr / _fbsize) * _fbsize), + if(HDlseek(file->fd, (HDoff_t)((addr / _fbsize) * _fbsize), SEEK_SET) < 0) HSYS_GOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to seek to proper position") @@ -1099,8 +1071,8 @@ H5FD_direct_write(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t UNUSED dxpl_id, h FUNC_ENTER_NOAPI_NOINIT - assert(file && file->pub.cls); - assert(buf); + HDassert(file && file->pub.cls); + HDassert(buf); /* Check for overflow conditions */ if (HADDR_UNDEF==addr) @@ -1129,7 +1101,7 @@ H5FD_direct_write(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t UNUSED dxpl_id, h if(!_must_align || ((addr%_fbsize==0) && (size%_fbsize==0) && ((size_t)buf%_boundary==0))) { /* Seek to the correct location */ if ((addr!=file->pos || OP_WRITE!=file->op) && - file_seek(file->fd, (file_offset_t)addr, SEEK_SET)<0) + HDlseek(file->fd, (HDoff_t)addr, SEEK_SET)<0) HSYS_GOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to seek to proper position") while (size>0) { @@ -1138,8 +1110,8 @@ H5FD_direct_write(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t UNUSED dxpl_id, h } while (-1==nbytes && EINTR==errno); if (-1==nbytes) /* error */ HSYS_GOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "file write failed") - assert(nbytes>0); - assert((size_t)nbytes<=size); + HDassert(nbytes>0); + HDassert((size_t)nbytes<=size); H5_CHECK_OVERFLOW(nbytes,ssize_t,size_t); size -= (size_t)nbytes; H5_CHECK_OVERFLOW(nbytes,ssize_t,haddr_t); @@ -1165,7 +1137,7 @@ H5FD_direct_write(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t UNUSED dxpl_id, h HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "HDposix_memalign failed") /* look for the right position for reading or writing the data */ - if(file_seek(file->fd, (file_offset_t)write_addr, SEEK_SET) < 0) + if(HDlseek(file->fd, (HDoff_t)write_addr, SEEK_SET) < 0) HSYS_GOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to seek to proper position") p3 = buf; @@ -1207,8 +1179,8 @@ H5FD_direct_write(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t UNUSED dxpl_id, h /* Seek to the last block, for reading */ HDassert(!((write_addr + write_size - _fbsize) % _fbsize)); - if(file_seek(file->fd, - (file_offset_t)(write_addr + write_size - _fbsize), + if(HDlseek(file->fd, + (HDoff_t)(write_addr + write_size - _fbsize), SEEK_SET) < 0) HSYS_GOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to seek to proper position") } /* end if */ @@ -1218,7 +1190,7 @@ H5FD_direct_write(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t UNUSED dxpl_id, h if(p1) { HDassert(!(read_size % _fbsize)); do { - nbytes = read(file->fd, p1, read_size); + nbytes = HDread(file->fd, p1, read_size); } while (-1==nbytes && EINTR==errno); if (-1==nbytes) /* error */ @@ -1245,7 +1217,7 @@ H5FD_direct_write(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t UNUSED dxpl_id, h /*look for the aligned position for writing the data*/ HDassert(!(write_addr % _fbsize)); - if(file_seek(file->fd, (file_offset_t)write_addr, SEEK_SET) < 0) + if(HDlseek(file->fd, (HDoff_t)write_addr, SEEK_SET) < 0) HSYS_GOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to seek to proper position") /* @@ -1317,7 +1289,7 @@ H5FD_direct_truncate(H5FD_t *_file, hid_t UNUSED dxpl_id, hbool_t UNUSED closing FUNC_ENTER_NOAPI_NOINIT - assert(file); + HDassert(file); /* Extend the file to make sure it's large enough */ if (file->eoa!=file->eof) { @@ -1335,7 +1307,7 @@ H5FD_direct_truncate(H5FD_t *_file, hid_t UNUSED dxpl_id, hbool_t UNUSED closing if(SetEndOfFile((HANDLE)filehandle)==0) HGOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to extend file properly") #else /* H5_HAVE_WIN32_API */ - if (-1==file_truncate(file->fd, (file_offset_t)file->eoa)) + if (-1==HDftruncate(file->fd, (HDoff_t)file->eoa)) HSYS_GOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to extend file properly") #endif /* H5_HAVE_WIN32_API */ @@ -1350,7 +1322,7 @@ H5FD_direct_truncate(H5FD_t *_file, hid_t UNUSED dxpl_id, hbool_t UNUSED closing /*Even though eof is equal to eoa, file is still truncated because Direct I/O *write introduces some extra data for alignment. */ - if (-1==file_truncate(file->fd, (file_offset_t)file->eof)) + if (-1==HDftruncate(file->fd, (HDoff_t)file->eof)) HSYS_GOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to extend file properly") } diff --git a/src/H5FDfamily.c b/src/H5FDfamily.c index dc535a2..75c75ad 100644 --- a/src/H5FDfamily.c +++ b/src/H5FDfamily.c @@ -187,19 +187,19 @@ H5FD_family_init_interface(void) hid_t H5FD_family_init(void) { - hid_t ret_value=H5FD_FAMILY_g; /* Return value */ + hid_t ret_value = H5FD_FAMILY_g; /* Return value */ FUNC_ENTER_NOAPI(FAIL) - if (H5I_VFL!=H5Iget_type(H5FD_FAMILY_g)) - H5FD_FAMILY_g = H5FD_register(&H5FD_family_g,sizeof(H5FD_class_t),FALSE); + if(H5I_VFL != H5I_get_type(H5FD_FAMILY_g)) + H5FD_FAMILY_g = H5FD_register(&H5FD_family_g, sizeof(H5FD_class_t), FALSE); /* Set return value */ - ret_value=H5FD_FAMILY_g; + ret_value = H5FD_FAMILY_g; done: FUNC_LEAVE_NOAPI(ret_value) -} +} /* H5FD_family_init() */ /*--------------------------------------------------------------------------- @@ -416,7 +416,7 @@ H5FD_family_fapl_copy(const void *_old_fa) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") /* Copy the fields of the structure */ - memcpy(new_fa, old_fa, sizeof(H5FD_family_fapl_t)); + HDmemcpy(new_fa, old_fa, sizeof(H5FD_family_fapl_t)); /* Deep copy the property list objects in the structure */ if(old_fa->memb_fapl_id==H5P_FILE_ACCESS_DEFAULT) { @@ -1176,7 +1176,7 @@ H5FD_family_read(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, si tempreq = SIZET_MAX; req = MIN(size, (size_t)tempreq); - assert(u<file->nmembs); + HDassert(u<file->nmembs); if (H5FDread(file->memb[u], type, dxpl_id, sub, req, buf)<0) HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "member file read failed") @@ -1245,7 +1245,7 @@ H5FD_family_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, s tempreq = SIZET_MAX; req = MIN(size, (size_t)tempreq); - assert(u<file->nmembs); + HDassert(u<file->nmembs); if (H5FDwrite(file->memb[u], type, dxpl_id, sub, req, buf)<0) HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "member file write failed") diff --git a/src/H5FDint.c b/src/H5FDint.c index 09af4ed..c9e9a67 100644 --- a/src/H5FDint.c +++ b/src/H5FDint.c @@ -298,7 +298,7 @@ H5FD_get_eof(const H5FD_t *file) /* Dispatch to driver */ if(file->cls->get_eof) { if(HADDR_UNDEF == (ret_value = (file->cls->get_eof)(file))) - HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, HADDR_UNDEF, "driver get_eof request failed") + HGOTO_ERROR(H5E_VFL, H5E_CANTGET, HADDR_UNDEF, "driver get_eof request failed") } /* end if */ else ret_value = file->maxaddr; diff --git a/src/H5FDlog.c b/src/H5FDlog.c index 81d050d..cb04b80 100644 --- a/src/H5FDlog.c +++ b/src/H5FDlog.c @@ -795,7 +795,7 @@ H5FD_log_close(H5FD_t *_file) if(file->fa.flags & H5FD_LOG_FLAVOR) file->flavor = (unsigned char *)H5MM_xfree(file->flavor); if(file->logfp != stderr) - fclose(file->logfp); + HDfclose(file->logfp); } /* end if */ /* Release the file info */ diff --git a/src/H5FDmpi.c b/src/H5FDmpi.c index 295e3c9f..86a5d39 100644 --- a/src/H5FDmpi.c +++ b/src/H5FDmpi.c @@ -57,10 +57,10 @@ H5FD_mpi_get_rank(const H5FD_t *file) FUNC_ENTER_NOAPI(FAIL) - assert(file); + HDassert(file); cls = (const H5FD_class_mpi_t *)(file->cls); - assert(cls); - assert(cls->get_rank); /* All MPI drivers must implement this */ + HDassert(cls); + HDassert(cls->get_rank); /* All MPI drivers must implement this */ /* Dispatch to driver */ if ((ret_value=(cls->get_rank)(file))<0) @@ -95,10 +95,10 @@ H5FD_mpi_get_size(const H5FD_t *file) FUNC_ENTER_NOAPI(FAIL) - assert(file); + HDassert(file); cls = (const H5FD_class_mpi_t *)(file->cls); - assert(cls); - assert(cls->get_size); /* All MPI drivers must implement this */ + HDassert(cls); + HDassert(cls->get_size); /* All MPI drivers must implement this */ /* Dispatch to driver */ if ((ret_value=(cls->get_size)(file))<0) @@ -133,10 +133,10 @@ H5FD_mpi_get_comm(const H5FD_t *file) FUNC_ENTER_NOAPI(MPI_COMM_NULL) - assert(file); + HDassert(file); cls = (const H5FD_class_mpi_t *)(file->cls); - assert(cls); - assert(cls->get_comm); /* All MPI drivers must implement this */ + HDassert(cls); + HDassert(cls->get_comm); /* All MPI drivers must implement this */ /* Dispatch to driver */ if ((ret_value=(cls->get_comm)(file))==MPI_COMM_NULL) @@ -217,7 +217,7 @@ H5FD_mpi_haddr_to_MPIOff(haddr_t addr, MPI_Offset *mpi_off/*out*/) FUNC_ENTER_NOAPI_NOINIT_NOERR - assert(mpi_off); + HDassert(mpi_off); /* Convert the HDF5 address into an MPI offset */ *mpi_off = (MPI_Offset)addr; @@ -373,8 +373,8 @@ H5FD_mpio_wait_for_left_neighbor(H5FD_t *_file) FUNC_ENTER_NOAPI(FAIL) - assert(file); - assert(H5FD_MPIO==file->pub.driver_id); + HDassert(file); + HDassert(H5FD_MPIO==file->pub.driver_id); /* Portably initialize MPI status variable */ HDmemset(&rcvstat,0,sizeof(MPI_Status)); @@ -427,14 +427,12 @@ H5FD_mpio_signal_right_neighbor(H5FD_t *_file) FUNC_ENTER_NOAPI(FAIL) - assert(file); - assert(H5FD_MPIO==file->pub.driver_id); + HDassert(file); + HDassert(H5FD_MPIO==file->pub.driver_id); - if (file->mpi_rank != (file->mpi_size-1)) { - if (MPI_SUCCESS != (mpi_code=MPI_Send(&msgbuf, 0/*empty msg*/, MPI_CHAR, - file->mpi_rank+1, 0, file->comm))) + if(file->mpi_rank != (file->mpi_size - 1)) + if(MPI_SUCCESS != (mpi_code=MPI_Send(&msgbuf, 0/*empty msg*/, MPI_CHAR, file->mpi_rank + 1, 0, file->comm))) HMPI_GOTO_ERROR(FAIL, "MPI_Send failed", mpi_code) - } done: FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5FDmpio.c b/src/H5FDmpio.c index 878bf82..f23a3b5 100644 --- a/src/H5FDmpio.c +++ b/src/H5FDmpio.c @@ -825,10 +825,10 @@ H5FD_mpio_fapl_free(void *_fa) if (H5FD_mpio_Debug[(int)'t']) fprintf(stderr, "in H5FD_mpio_fapl_free\n"); #endif - assert(fa); + HDassert(fa); /* Free the internal communicator and INFO object */ - assert(MPI_COMM_NULL!=fa->comm); + HDassert(MPI_COMM_NULL!=fa->comm); H5FD_mpi_comm_info_free(&fa->comm, &fa->info); H5MM_xfree(fa); @@ -1167,8 +1167,8 @@ H5FD_mpio_close(H5FD_t *_file) if (H5FD_mpio_Debug[(int)'t']) fprintf(stdout, "Entering H5FD_mpio_close\n"); #endif - assert(file); - assert(H5FD_MPIO==file->pub.driver_id); + HDassert(file); + HDassert(H5FD_MPIO==file->pub.driver_id); /* MPI_File_close sets argument to MPI_FILE_NULL */ if (MPI_SUCCESS != (mpi_code=MPI_File_close(&(file->f)/*in,out*/))) @@ -1257,8 +1257,8 @@ H5FD_mpio_get_eoa(const H5FD_t *_file, H5FD_mem_t UNUSED type) FUNC_ENTER_NOAPI_NOINIT_NOERR - assert(file); - assert(H5FD_MPIO==file->pub.driver_id); + HDassert(file); + HDassert(H5FD_MPIO==file->pub.driver_id); FUNC_LEAVE_NOAPI(file->eoa) } @@ -1292,8 +1292,8 @@ H5FD_mpio_set_eoa(H5FD_t *_file, H5FD_mem_t UNUSED type, haddr_t addr) FUNC_ENTER_NOAPI_NOINIT_NOERR - assert(file); - assert(H5FD_MPIO==file->pub.driver_id); + HDassert(file); + HDassert(H5FD_MPIO==file->pub.driver_id); file->eoa = addr; @@ -1337,8 +1337,8 @@ H5FD_mpio_get_eof(const H5FD_t *_file) FUNC_ENTER_NOAPI_NOINIT_NOERR - assert(file); - assert(H5FD_MPIO==file->pub.driver_id); + HDassert(file); + HDassert(H5FD_MPIO==file->pub.driver_id); FUNC_LEAVE_NOAPI(file->eof) } @@ -1468,12 +1468,12 @@ H5FD_mpio_read(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t dxpl_id, haddr_t add if (H5FD_mpio_Debug[(int)'t']) fprintf(stdout, "Entering H5FD_mpio_read\n" ); #endif - assert(file); - assert(H5FD_MPIO==file->pub.driver_id); + HDassert(file); + HDassert(H5FD_MPIO==file->pub.driver_id); /* Make certain we have the correct type of property list */ - assert(H5I_GENPROP_LST==H5I_get_type(dxpl_id)); - assert(TRUE==H5P_isa_class(dxpl_id,H5P_DATASET_XFER)); - assert(buf); + HDassert(H5I_GENPROP_LST==H5I_get_type(dxpl_id)); + HDassert(TRUE==H5P_isa_class(dxpl_id,H5P_DATASET_XFER)); + HDassert(buf); /* Portably initialize MPI status variable */ HDmemset(&mpi_stat,0,sizeof(MPI_Status)); @@ -1752,12 +1752,12 @@ H5FD_mpio_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, if (H5FD_mpio_Debug[(int)'t']) fprintf(stdout, "Entering H5FD_mpio_write\n" ); #endif - assert(file); - assert(H5FD_MPIO==file->pub.driver_id); + HDassert(file); + HDassert(H5FD_MPIO==file->pub.driver_id); /* Make certain we have the correct type of property list */ - assert(H5I_GENPROP_LST==H5I_get_type(dxpl_id)); - assert(TRUE==H5P_isa_class(dxpl_id,H5P_DATASET_XFER)); - assert(buf); + HDassert(H5I_GENPROP_LST==H5I_get_type(dxpl_id)); + HDassert(TRUE==H5P_isa_class(dxpl_id,H5P_DATASET_XFER)); + HDassert(buf); /* Portably initialize MPI status variable */ HDmemset(&mpi_stat, 0, sizeof(MPI_Status)); @@ -2058,8 +2058,8 @@ H5FD_mpio_mpi_rank(const H5FD_t *_file) FUNC_ENTER_NOAPI_NOINIT_NOERR - assert(file); - assert(H5FD_MPIO==file->pub.driver_id); + HDassert(file); + HDassert(H5FD_MPIO==file->pub.driver_id); FUNC_LEAVE_NOAPI(file->mpi_rank) } /* end H5FD_mpio_mpi_rank() */ @@ -2087,8 +2087,8 @@ H5FD_mpio_mpi_size(const H5FD_t *_file) FUNC_ENTER_NOAPI_NOINIT_NOERR - assert(file); - assert(H5FD_MPIO==file->pub.driver_id); + HDassert(file); + HDassert(H5FD_MPIO==file->pub.driver_id); FUNC_LEAVE_NOAPI(file->mpi_size) } /* end H5FD_mpio_mpi_size() */ @@ -2117,8 +2117,8 @@ H5FD_mpio_communicator(const H5FD_t *_file) FUNC_ENTER_NOAPI_NOINIT_NOERR - assert(file); - assert(H5FD_MPIO==file->pub.driver_id); + HDassert(file); + HDassert(H5FD_MPIO==file->pub.driver_id); FUNC_LEAVE_NOAPI(file->comm) } diff --git a/src/H5FDmpiposix.c b/src/H5FDmpiposix.c index 978494e..7248dff 100644 --- a/src/H5FDmpiposix.c +++ b/src/H5FDmpiposix.c @@ -263,8 +263,8 @@ H5FD_mpiposix_init(void) FUNC_ENTER_NOAPI(FAIL) - if (H5I_VFL != H5Iget_type(H5FD_MPIPOSIX_g)) - H5FD_MPIPOSIX_g = H5FD_register((const H5FD_class_t *)&H5FD_mpiposix_g,sizeof(H5FD_class_mpi_t),FALSE); + if(H5I_VFL != H5I_get_type(H5FD_MPIPOSIX_g)) + H5FD_MPIPOSIX_g = H5FD_register((const H5FD_class_t *)&H5FD_mpiposix_g, sizeof(H5FD_class_mpi_t), FALSE); /* Set return value */ ret_value = H5FD_MPIPOSIX_g; diff --git a/src/H5FDmulti.c b/src/H5FDmulti.c index 9d6e065..a3ce7f8 100644 --- a/src/H5FDmulti.c +++ b/src/H5FDmulti.c @@ -73,10 +73,6 @@ #define END_MEMBERS }} - -#define H5FD_MULTI_DXPL_PROP_NAME "H5FD_MULTI_DXPL" -#define H5FD_MULTI_DXPL_PROP_SIZE sizeof(H5FD_multi_dxpl_t) - #define H5FD_MULT_MAX_FILE_NAME_LEN 1024 /* The driver identification number, initialized at runtime */ @@ -1792,18 +1788,6 @@ H5FD_multi_read(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, /* Clear the error stack */ H5Eclear2(H5E_DEFAULT); - /* Get the data transfer properties */ - if(H5P_FILE_ACCESS_DEFAULT != dxpl_id) { - /* Check for existence of multi VFD DXPL property in DXPL */ - if((prop_exists = H5Pexist(dxpl_id, H5FD_MULTI_DXPL_PROP_NAME)) < 0) - H5Epush_ret(func, H5E_ERR_CLS, H5E_PLIST, H5E_CANTGET, "can't check for multi VFD property", -1) - - /* Get the DXPL value, if it exists */ - if(prop_exists) - if(H5Pget(dxpl_id, H5FD_MULTI_DXPL_PROP_NAME, &dx) < 0) - H5Epush_ret(func, H5E_ERR_CLS, H5E_PLIST, H5E_CANTGET, "can't get property value", -1) - } /* end if */ - /* Find the file to which this address belongs */ for(mt = H5FD_MEM_SUPER; mt < H5FD_MEM_NTYPES; mt = (H5FD_mem_t)(mt + 1)) { mmt = file->fa.memb_map[mt]; @@ -1856,18 +1840,6 @@ H5FD_multi_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, /* Clear the error stack */ H5Eclear2(H5E_DEFAULT); - /* Get the data transfer properties */ - if(H5P_FILE_ACCESS_DEFAULT != dxpl_id) { - /* Check for existence of multi VFD DXPL property in DXPL */ - if((prop_exists = H5Pexist(dxpl_id, H5FD_MULTI_DXPL_PROP_NAME)) < 0) - H5Epush_ret(func, H5E_ERR_CLS, H5E_PLIST, H5E_CANTGET, "can't check for multi VFD property", -1) - - /* Get the DXPL value, if it exists */ - if(prop_exists) - if(H5Pget(dxpl_id, H5FD_MULTI_DXPL_PROP_NAME, &dx) < 0) - H5Epush_ret(func, H5E_ERR_CLS, H5E_PLIST, H5E_CANTGET, "can't get property value", -1) - } /* end if */ - /* Find the file to which this address belongs */ for(mt = H5FD_MEM_SUPER; mt < H5FD_MEM_NTYPES; mt = (H5FD_mem_t)(mt + 1)) { mmt = file->fa.memb_map[mt]; @@ -78,8 +78,8 @@ H5FO_create(const H5F_t *f) FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ - assert(f); - assert(f->shared); + HDassert(f); + HDassert(f->shared); /* Create container used to store open object info */ if((f->shared->open_objs = H5SL_create(H5SL_TYPE_HADDR, NULL)) == NULL) @@ -166,11 +166,11 @@ H5FO_insert(const H5F_t *f, haddr_t addr, void *obj, hbool_t delete_flag) FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ - assert(f); - assert(f->shared); - assert(f->shared->open_objs); - assert(H5F_addr_defined(addr)); - assert(obj); + HDassert(f); + HDassert(f->shared); + HDassert(f->shared->open_objs); + HDassert(H5F_addr_defined(addr)); + HDassert(obj); /* Allocate new opened object information structure */ if((open_obj=H5FL_MALLOC(H5FO_open_obj_t))==NULL) @@ -269,10 +269,10 @@ H5FO_mark(const H5F_t *f, haddr_t addr, hbool_t deleted) FUNC_ENTER_NOAPI_NOERR /* Sanity check */ - assert(f); - assert(f->shared); - assert(f->shared->open_objs); - assert(H5F_addr_defined(addr)); + HDassert(f); + HDassert(f->shared); + HDassert(f->shared->open_objs); + HDassert(H5F_addr_defined(addr)); /* Get the object node from the container */ if(NULL != (open_obj = (H5FO_open_obj_t *)H5SL_search(f->shared->open_objs, &addr))) @@ -352,9 +352,9 @@ H5FO_dest(const H5F_t *f) FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ - assert(f); - assert(f->shared); - assert(f->shared->open_objs); + HDassert(f); + HDassert(f->shared); + HDassert(f->shared->open_objs); /* Check if the object info set is empty */ if(H5SL_count(f->shared->open_objs)!=0) diff --git a/src/H5Fint.c b/src/H5Fint.c index a853140..88464f9 100644 --- a/src/H5Fint.c +++ b/src/H5Fint.c @@ -1669,8 +1669,10 @@ H5F_build_actual_name(const H5F_t *f, const H5P_genplist_t *fapl, const char *na } /* end else */ done: - if(new_fapl_id > 0 && H5Pclose(new_fapl_id) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTCLOSEOBJ, FAIL, "can't close duplicated FAPL") + /* Close the property list */ + if(new_fapl_id > 0) + if(H5I_dec_app_ref(new_fapl_id) < 0) + HDONE_ERROR(H5E_FILE, H5E_CANTCLOSEOBJ, FAIL, "can't close duplicated FAPL") FUNC_LEAVE_NOAPI(ret_value) } /* H5F_build_actual_name() */ diff --git a/src/H5Fmpi.c b/src/H5Fmpi.c index 07d29f2..4d3ca34 100644 --- a/src/H5Fmpi.c +++ b/src/H5Fmpi.c @@ -101,7 +101,7 @@ H5F_mpi_get_rank(const H5F_t *f) FUNC_ENTER_NOAPI(FAIL) - assert(f && f->shared); + HDassert(f && f->shared); /* Dispatch to driver */ if ((ret_value=H5FD_mpi_get_rank(f->shared->lf)) < 0) @@ -135,7 +135,7 @@ H5F_mpi_get_comm(const H5F_t *f) FUNC_ENTER_NOAPI(MPI_COMM_NULL) - assert(f && f->shared); + HDassert(f && f->shared); /* Dispatch to driver */ if ((ret_value=H5FD_mpi_get_comm(f->shared->lf))==MPI_COMM_NULL) @@ -169,7 +169,7 @@ H5F_mpi_get_size(const H5F_t *f) FUNC_ENTER_NOAPI(FAIL) - assert(f && f->shared); + HDassert(f && f->shared); /* Dispatch to driver */ if ((ret_value=H5FD_mpi_get_size(f->shared->lf)) < 0) diff --git a/src/H5Fpkg.h b/src/H5Fpkg.h index 98de62a..0ef5a0d 100644 --- a/src/H5Fpkg.h +++ b/src/H5Fpkg.h @@ -306,7 +306,6 @@ H5_DLL herr_t H5F_unmount(H5G_loc_t *loc, const char *name, hid_t dxpl_id); H5_DLL herr_t H5F_close_mounts(H5F_t *f); H5_DLL int H5F_term_unmount_cb(void *obj_ptr, hid_t obj_id, void *key); H5_DLL herr_t H5F_mount_count_ids(H5F_t *f, unsigned *nopen_files, unsigned *nopen_objs); -H5_DLL herr_t H5F_flush_mounts(H5F_t *f, hid_t dxpl_id); /* Superblock related routines */ H5_DLL herr_t H5F_super_init(H5F_t *f, hid_t dxpl_id); diff --git a/src/H5Fprivate.h b/src/H5Fprivate.h index a05d945..5a30828 100644 --- a/src/H5Fprivate.h +++ b/src/H5Fprivate.h @@ -639,6 +639,7 @@ H5_DLL herr_t H5F_get_vfd_handle(const H5F_t *file, hid_t fapl, H5_DLL hbool_t H5F_is_mount(const H5F_t *file); H5_DLL hbool_t H5F_has_mount(const H5F_t *file); H5_DLL herr_t H5F_traverse_mount(struct H5O_loc_t *oloc/*in,out*/); +H5_DLL herr_t H5F_flush_mounts(H5F_t *f, hid_t dxpl_id); /* Functions that operate on blocks of bytes wrt super block */ H5_DLL herr_t H5F_block_read(const H5F_t *f, H5FD_mem_t type, haddr_t addr, diff --git a/src/H5Gint.c b/src/H5Gint.c index 3eb374c..2d305a2 100644 --- a/src/H5Gint.c +++ b/src/H5Gint.c @@ -1188,15 +1188,16 @@ done: /*------------------------------------------------------------------------- * Function: H5G_get_create_plist * - * Purpose: Returns a copy of the group creation property list. + * Purpose: Private function for H5Gget_create_plist * * Return: Success: ID for a copy of the group creation - * property list. + * property list. The property list ID should be + * released by calling H5Pclose(). * * Failure: FAIL * - * Programmer: Mohamad Chaarawi - * March, 2012 + * Programmer: Quincey Koziol + * Tuesday, October 25, 2005 * *------------------------------------------------------------------------- */ @@ -1209,17 +1210,17 @@ H5G_get_create_plist(H5G_t *grp) htri_t pline_exists; H5P_genplist_t *gcpl_plist; H5P_genplist_t *new_plist; - hid_t new_id = FAIL; - hid_t ret_value = FAIL; + hid_t new_gcpl_id = FAIL; + hid_t ret_value = FAIL; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_NOAPI(FAIL) /* Copy the default group creation property list */ if(NULL == (gcpl_plist = (H5P_genplist_t *)H5I_object(H5P_LST_GROUP_CREATE_g))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "can't get default group creation property list") - if((new_id = H5P_copy_plist(gcpl_plist, TRUE)) < 0) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "can't get default group creation property list") + if((new_gcpl_id = H5P_copy_plist(gcpl_plist, TRUE)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "unable to copy the creation property list") - if(NULL == (new_plist = (H5P_genplist_t *)H5I_object(new_id))) + if(NULL == (new_plist = (H5P_genplist_t *)H5I_object(new_gcpl_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "can't get property list") /* Retrieve any object creation properties */ @@ -1228,7 +1229,7 @@ H5G_get_create_plist(H5G_t *grp) /* Check for the group having a group info message */ if((ginfo_exists = H5O_msg_exists(&(grp->oloc), H5O_GINFO_ID, H5AC_ind_dxpl_id)) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to read object header") + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to read object header") if(ginfo_exists) { H5O_ginfo_t ginfo; /* Group info message */ @@ -1243,7 +1244,7 @@ H5G_get_create_plist(H5G_t *grp) /* Check for the group having a link info message */ if((linfo_exists = H5G__obj_get_linfo(&(grp->oloc), &linfo, H5AC_ind_dxpl_id)) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to read object header") + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to read object header") if(linfo_exists) { /* Set the link info for the property list */ if(H5P_set(new_plist, H5G_CRT_LINK_INFO_NAME, &linfo) < 0) @@ -1266,12 +1267,12 @@ H5G_get_create_plist(H5G_t *grp) } /* end if */ /* Set the return value */ - ret_value = new_id; + ret_value = new_gcpl_id; done: if(ret_value < 0) { - if(new_id > 0) - if(H5I_dec_app_ref(new_id) < 0) + if(new_gcpl_id > 0) + if(H5I_dec_app_ref(new_gcpl_id) < 0) HDONE_ERROR(H5E_SYM, H5E_CANTDEC, FAIL, "can't free") } /* end if */ diff --git a/src/H5Gname.c b/src/H5Gname.c index fd8bf92..9dc8849 100644 --- a/src/H5Gname.c +++ b/src/H5Gname.c @@ -135,7 +135,7 @@ H5G__component(const char *name, size_t *size_p) { FUNC_ENTER_PACKAGE_NOERR - assert(name); + HDassert(name); while ('/' == *name) name++; @@ -236,13 +236,13 @@ H5G_common_path(const H5RS_str_t *fullpath_r, const H5RS_str_t *prefix_r) /* Get component of each name */ fullpath=H5RS_get_str(fullpath_r); - assert(fullpath); + HDassert(fullpath); fullpath=H5G__component(fullpath,&nchars1); - assert(fullpath); + HDassert(fullpath); prefix=H5RS_get_str(prefix_r); - assert(prefix); + HDassert(prefix); prefix=H5G__component(prefix,&nchars2); - assert(prefix); + HDassert(prefix); /* Check if we have a real string for each component */ while(*fullpath && *prefix) { @@ -256,9 +256,9 @@ H5G_common_path(const H5RS_str_t *fullpath_r, const H5RS_str_t *prefix_r) /* Get next component of each name */ fullpath=H5G__component(fullpath,&nchars1); - assert(fullpath); + HDassert(fullpath); prefix=H5G__component(prefix,&nchars2); - assert(prefix); + HDassert(prefix); } /* end if */ else HGOTO_DONE(FALSE) diff --git a/src/H5Gprivate.h b/src/H5Gprivate.h index 328ef93..52f895c 100644 --- a/src/H5Gprivate.h +++ b/src/H5Gprivate.h @@ -202,7 +202,7 @@ H5_DLL herr_t H5G_get_shared_count(H5G_t *grp); H5_DLL herr_t H5G_mount(H5G_t *grp); H5_DLL hbool_t H5G_mounted(H5G_t *grp); H5_DLL herr_t H5G_unmount(H5G_t *grp); -H5_DLL hid_t H5G_get_create_plist(H5G_t *grp); + #ifndef H5_NO_DEPRECATED_SYMBOLS H5_DLL H5G_obj_t H5G_map_obj_type(H5O_type_t obj_type); #endif /* H5_NO_DEPRECATED_SYMBOLS */ @@ -244,6 +244,7 @@ H5_DLL herr_t H5G_obj_remove_by_idx(const struct H5O_loc_t *grp_oloc, H5RS_str_t H5_index_t idx_type, H5_iter_order_t order, hsize_t n, hid_t dxpl_id); H5_DLL herr_t H5G_obj_lookup_by_idx(const struct H5O_loc_t *grp_oloc, H5_index_t idx_type, H5_iter_order_t order, hsize_t n, struct H5O_link_t *lnk, hid_t dxpl_id); +H5_DLL hid_t H5G_get_create_plist(H5G_t *grp); /* * These functions operate on symbol table nodes. @@ -191,7 +191,7 @@ HDmemset(heap->chunk, 0, size); /* The freespace object */ heap->obj[0].size = size - H5HG_SIZEOF_HDR(f); - assert(H5HG_ISALIGNED(heap->obj[0].size)); + HDassert(H5HG_ISALIGNED(heap->obj[0].size)); heap->obj[0].nrefs = 0; heap->obj[0].begin = p; UINT16ENCODE(p, 0); /*object ID*/ @@ -372,7 +372,7 @@ H5HG_alloc(H5F_t *f, H5HG_heap_t *heap, size_t size, unsigned *heap_flags_ptr) UINT16ENCODE(p, 0); /*nrefs*/ UINT32ENCODE(p, 0); /*reserved*/ H5F_ENCODE_LENGTH (f, p, heap->obj[0].size); - assert(H5HG_ISALIGNED(heap->obj[0].size)); + HDassert(H5HG_ISALIGNED(heap->obj[0].size)); } /* end else-if */ else { /* @@ -381,7 +381,7 @@ H5HG_alloc(H5F_t *f, H5HG_heap_t *heap, size_t size, unsigned *heap_flags_ptr) */ heap->obj[0].size -= need; heap->obj[0].begin += need; - assert(H5HG_ISALIGNED(heap->obj[0].size)); + HDassert(H5HG_ISALIGNED(heap->obj[0].size)); } /* Mark the heap as dirty */ @@ -475,7 +475,7 @@ HDmemset(new_chunk + heap->size, 0, need); UINT16ENCODE(p, 0); /*nrefs*/ UINT32ENCODE(p, 0); /*reserved*/ H5F_ENCODE_LENGTH(f, p, heap->obj[0].size); - assert(H5HG_ISALIGNED(heap->obj[0].size)); + HDassert(H5HG_ISALIGNED(heap->obj[0].size)); /* Resize the heap in the cache */ if(H5AC_resize_entry(heap, heap->size) < 0) @@ -342,7 +342,7 @@ H5HP_create(H5HP_type_t heap_type) FUNC_ENTER_NOAPI(NULL) /* Check args */ - assert(heap_type==H5HP_MIN_HEAP || heap_type==H5HP_MAX_HEAP); + HDassert(heap_type==H5HP_MIN_HEAP || heap_type==H5HP_MAX_HEAP); /* Allocate ref-counted string structure */ if((new_heap=H5FL_MALLOC(H5HP_t))==NULL) @@ -416,15 +416,15 @@ H5HP_count(const H5HP_t *heap) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ - assert(heap); + HDassert(heap); /* Check internal consistency */ /* (Pre-condition) */ - assert(heap->nobjs<heap->nalloc); - assert(heap->heap); - assert((heap->type==H5HP_MAX_HEAP && heap->heap[0].val==INT_MAX) || + HDassert(heap->nobjs<heap->nalloc); + HDassert(heap->heap); + HDassert((heap->type==H5HP_MAX_HEAP && heap->heap[0].val==INT_MAX) || (heap->type==H5HP_MIN_HEAP && heap->heap[0].val==INT_MIN)); - assert(heap->heap[0].obj==NULL); + HDassert(heap->heap[0].obj==NULL); /* Return the number of objects in the heap */ H5_CHECK_OVERFLOW(heap->nobjs,size_t,ssize_t); @@ -463,16 +463,16 @@ H5HP_insert(H5HP_t *heap, int val, void *obj) FUNC_ENTER_NOAPI(FAIL) /* Check args */ - assert(heap); - assert(obj); + HDassert(heap); + HDassert(obj); /* Check internal consistency */ /* (Pre-condition) */ - assert(heap->nobjs<heap->nalloc); - assert(heap->heap); - assert((heap->type==H5HP_MAX_HEAP && heap->heap[0].val==INT_MAX) || + HDassert(heap->nobjs<heap->nalloc); + HDassert(heap->heap); + HDassert((heap->type==H5HP_MAX_HEAP && heap->heap[0].val==INT_MAX) || (heap->type==H5HP_MIN_HEAP && heap->heap[0].val==INT_MIN)); - assert(heap->heap[0].obj==NULL); + HDassert(heap->heap[0].obj==NULL); /* Increment number of objects in heap */ heap->nobjs++; @@ -507,11 +507,11 @@ done: /* Check internal consistency */ /* (Post-condition) */ - assert(heap->nobjs<heap->nalloc); - assert(heap->heap); - assert((heap->type==H5HP_MAX_HEAP && heap->heap[0].val==INT_MAX) || + HDassert(heap->nobjs<heap->nalloc); + HDassert(heap->heap); + HDassert((heap->type==H5HP_MAX_HEAP && heap->heap[0].val==INT_MAX) || (heap->type==H5HP_MIN_HEAP && heap->heap[0].val==INT_MIN)); - assert(heap->heap[0].obj==NULL); + HDassert(heap->heap[0].obj==NULL); FUNC_LEAVE_NOAPI(ret_value); } /* end H5HP_insert() */ @@ -542,16 +542,16 @@ H5HP_top(const H5HP_t *heap, int *val) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ - assert(heap); - assert(val); + HDassert(heap); + HDassert(val); /* Check internal consistency */ /* (Pre-condition) */ - assert(heap->nobjs<heap->nalloc); - assert(heap->heap); - assert((heap->type==H5HP_MAX_HEAP && heap->heap[0].val==INT_MAX) || + HDassert(heap->nobjs<heap->nalloc); + HDassert(heap->heap); + HDassert((heap->type==H5HP_MAX_HEAP && heap->heap[0].val==INT_MAX) || (heap->type==H5HP_MIN_HEAP && heap->heap[0].val==INT_MIN)); - assert(heap->heap[0].obj==NULL); + HDassert(heap->heap[0].obj==NULL); /* Get value of the top object in the heap */ *val=heap->heap[1].val; @@ -589,24 +589,24 @@ H5HP_remove(H5HP_t *heap, int *val, void **obj) FUNC_ENTER_NOAPI(FAIL) /* Check args */ - assert(heap); - assert(val); - assert(obj); + HDassert(heap); + HDassert(val); + HDassert(obj); /* Check internal consistency */ /* (Pre-condition) */ - assert(heap->nobjs<heap->nalloc); - assert(heap->heap); - assert((heap->type==H5HP_MAX_HEAP && heap->heap[0].val==INT_MAX) || + HDassert(heap->nobjs<heap->nalloc); + HDassert(heap->heap); + HDassert((heap->type==H5HP_MAX_HEAP && heap->heap[0].val==INT_MAX) || (heap->type==H5HP_MIN_HEAP && heap->heap[0].val==INT_MIN)); - assert(heap->heap[0].obj==NULL); + HDassert(heap->heap[0].obj==NULL); /* Check if there are any objects on the heap to remove */ if(heap->nobjs==0) HGOTO_ERROR(H5E_HEAP, H5E_NOTFOUND, FAIL, "heap is empty"); /* Get the information for the top object on the heap */ - assert(heap->heap[1].obj->heap_loc==1); + HDassert(heap->heap[1].obj->heap_loc==1); *val=heap->heap[1].val; *obj=heap->heap[1].obj; @@ -634,11 +634,11 @@ done: /* Check internal consistency */ /* (Post-condition) */ - assert(heap->nobjs<heap->nalloc); - assert(heap->heap); - assert((heap->type==H5HP_MAX_HEAP && heap->heap[0].val==INT_MAX) || + HDassert(heap->nobjs<heap->nalloc); + HDassert(heap->heap); + HDassert((heap->type==H5HP_MAX_HEAP && heap->heap[0].val==INT_MAX) || (heap->type==H5HP_MIN_HEAP && heap->heap[0].val==INT_MIN)); - assert(heap->heap[0].obj==NULL); + HDassert(heap->heap[0].obj==NULL); FUNC_LEAVE_NOAPI(ret_value); } /* end H5HP_remove() */ @@ -675,20 +675,20 @@ H5HP_change(H5HP_t *heap, int val, void *_obj) FUNC_ENTER_NOAPI(FAIL) /* Check args */ - assert(heap); - assert(obj); + HDassert(heap); + HDassert(obj); /* Check internal consistency */ /* (Pre-condition) */ - assert(heap->nobjs<heap->nalloc); - assert(heap->heap); - assert((heap->type==H5HP_MAX_HEAP && heap->heap[0].val==INT_MAX) || + HDassert(heap->nobjs<heap->nalloc); + HDassert(heap->heap); + HDassert((heap->type==H5HP_MAX_HEAP && heap->heap[0].val==INT_MAX) || (heap->type==H5HP_MIN_HEAP && heap->heap[0].val==INT_MIN)); - assert(heap->heap[0].obj==NULL); + HDassert(heap->heap[0].obj==NULL); /* Get the location of the object in the heap */ obj_loc=obj->heap_loc; - assert(obj_loc>0 && obj_loc<=heap->nobjs); + HDassert(obj_loc>0 && obj_loc<=heap->nobjs); /* Change the heap object's priority */ old_val=heap->heap[obj_loc].val; @@ -720,11 +720,11 @@ done: /* Check internal consistency */ /* (Post-condition) */ - assert(heap->nobjs<heap->nalloc); - assert(heap->heap); - assert((heap->type==H5HP_MAX_HEAP && heap->heap[0].val==INT_MAX) || + HDassert(heap->nobjs<heap->nalloc); + HDassert(heap->heap); + HDassert((heap->type==H5HP_MAX_HEAP && heap->heap[0].val==INT_MAX) || (heap->type==H5HP_MIN_HEAP && heap->heap[0].val==INT_MIN)); - assert(heap->heap[0].obj==NULL); + HDassert(heap->heap[0].obj==NULL); FUNC_LEAVE_NOAPI(ret_value); } /* end H5HP_change() */ @@ -760,20 +760,20 @@ H5HP_incr(H5HP_t *heap, unsigned amt, void *_obj) FUNC_ENTER_NOAPI(FAIL) /* Check args */ - assert(heap); - assert(obj); + HDassert(heap); + HDassert(obj); /* Check internal consistency */ /* (Pre-condition) */ - assert(heap->nobjs<heap->nalloc); - assert(heap->heap); - assert((heap->type==H5HP_MAX_HEAP && heap->heap[0].val==INT_MAX) || + HDassert(heap->nobjs<heap->nalloc); + HDassert(heap->heap); + HDassert((heap->type==H5HP_MAX_HEAP && heap->heap[0].val==INT_MAX) || (heap->type==H5HP_MIN_HEAP && heap->heap[0].val==INT_MIN)); - assert(heap->heap[0].obj==NULL); + HDassert(heap->heap[0].obj==NULL); /* Get the location of the object in the heap */ obj_loc = obj->heap_loc; - assert(obj_loc > 0 && obj_loc <= heap->nobjs); + HDassert(obj_loc > 0 && obj_loc <= heap->nobjs); /* Change the heap object's priority */ heap->heap[obj_loc].val += (int)amt; @@ -792,11 +792,11 @@ done: /* Check internal consistency */ /* (Post-condition) */ - assert(heap->nobjs<heap->nalloc); - assert(heap->heap); - assert((heap->type==H5HP_MAX_HEAP && heap->heap[0].val==INT_MAX) || + HDassert(heap->nobjs<heap->nalloc); + HDassert(heap->heap); + HDassert((heap->type==H5HP_MAX_HEAP && heap->heap[0].val==INT_MAX) || (heap->type==H5HP_MIN_HEAP && heap->heap[0].val==INT_MIN)); - assert(heap->heap[0].obj==NULL); + HDassert(heap->heap[0].obj==NULL); FUNC_LEAVE_NOAPI(ret_value); } /* end H5HP_incr() */ @@ -832,20 +832,20 @@ H5HP_decr(H5HP_t *heap, unsigned amt, void *_obj) FUNC_ENTER_NOAPI(FAIL) /* Check args */ - assert(heap); - assert(obj); + HDassert(heap); + HDassert(obj); /* Check internal consistency */ /* (Pre-condition) */ - assert(heap->nobjs<heap->nalloc); - assert(heap->heap); - assert((heap->type==H5HP_MAX_HEAP && heap->heap[0].val==INT_MAX) || + HDassert(heap->nobjs<heap->nalloc); + HDassert(heap->heap); + HDassert((heap->type==H5HP_MAX_HEAP && heap->heap[0].val==INT_MAX) || (heap->type==H5HP_MIN_HEAP && heap->heap[0].val==INT_MIN)); - assert(heap->heap[0].obj==NULL); + HDassert(heap->heap[0].obj==NULL); /* Get the location of the object in the heap */ obj_loc=obj->heap_loc; - assert(obj_loc>0 && obj_loc<=heap->nobjs); + HDassert(obj_loc>0 && obj_loc<=heap->nobjs); /* Change the heap object's priority */ heap->heap[obj_loc].val-=amt; @@ -864,11 +864,11 @@ done: /* Check internal consistency */ /* (Post-condition) */ - assert(heap->nobjs<heap->nalloc); - assert(heap->heap); - assert((heap->type==H5HP_MAX_HEAP && heap->heap[0].val==INT_MAX) || + HDassert(heap->nobjs<heap->nalloc); + HDassert(heap->heap); + HDassert((heap->type==H5HP_MAX_HEAP && heap->heap[0].val==INT_MAX) || (heap->type==H5HP_MIN_HEAP && heap->heap[0].val==INT_MIN)); - assert(heap->heap[0].obj==NULL); + HDassert(heap->heap[0].obj==NULL); FUNC_LEAVE_NOAPI(ret_value); } /* end H5HP_decr() */ @@ -59,7 +59,7 @@ H5MM_malloc(size_t size) /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ FUNC_ENTER_NOAPI_NOINIT_NOERR - assert(size); + HDassert(size); FUNC_LEAVE_NOAPI(HDmalloc(size)); } /* end H5MM_malloc() */ @@ -92,7 +92,7 @@ H5MM_calloc(size_t size) /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ FUNC_ENTER_NOAPI_NOINIT_NOERR - assert(size); + HDassert(size); FUNC_LEAVE_NOAPI(HDcalloc(1,size)); } /* end H5MM_calloc() */ diff --git a/src/H5Ocopy.c b/src/H5Ocopy.c index 85346eb..543a9c1 100644 --- a/src/H5Ocopy.c +++ b/src/H5Ocopy.c @@ -326,9 +326,9 @@ herr_t H5O_copy(H5G_loc_t *loc, const char *src_name, H5G_loc_t *dst_loc, const done: if(loc_found && H5G_loc_free(&src_loc) < 0) - HDONE_ERROR(H5E_SYM, H5E_CANTRELEASE, FAIL, "can't free location") - if(obj_open) - H5O_close(&src_oloc); + HDONE_ERROR(H5E_OHDR, H5E_CANTRELEASE, FAIL, "can't free location") + if(obj_open && H5O_close(&src_oloc) < 0) + HDONE_ERROR(H5E_OHDR, H5E_CLOSEERROR, FAIL, "unable to release object header") FUNC_LEAVE_NOAPI(ret_value) } /* end H5O_copy() */ @@ -709,7 +709,7 @@ H5O_copy_header_real(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out*/, } /* end if */ /* Add in destination's object header size now */ - dst_oh_size += H5O_SIZEOF_HDR(oh_dst); + dst_oh_size += (uint64_t)H5O_SIZEOF_HDR(oh_dst); /* Allocate space for chunk in destination file */ if(HADDR_UNDEF == (oh_dst->chunk[0].addr = H5MF_alloc(oloc_dst->file, H5FD_MEM_OHDR, dxpl_id, (hsize_t)dst_oh_size))) @@ -1324,7 +1324,8 @@ H5O_copy_expand_ref(H5F_t *file_src, void *_src_ref, hid_t dxpl_id, H5O_loc_t dst_oloc; /* Copied object object location */ H5O_loc_t src_oloc; /* Temporary object location for source object */ H5G_loc_t dst_root_loc; /* The location of root group of the destination file */ - uint8_t *p; /* Pointer to OID to store */ + const uint8_t *q; /* Pointer to source OID to store */ + uint8_t *p; /* Pointer to destination OID to store */ size_t i; /* Local index variable */ herr_t ret_value = SUCCEED; @@ -1358,8 +1359,8 @@ H5O_copy_expand_ref(H5F_t *file_src, void *_src_ref, hid_t dxpl_id, /* Making equivalent references in the destination file */ for(i = 0; i < ref_count; i++) { /* Set up for the object copy for the reference */ - p = (uint8_t *)(&src_ref[i]); - H5F_addr_decode(src_oloc.file, (const uint8_t **)&p, &(src_oloc.addr)); + q = (uint8_t *)(&src_ref[i]); + H5F_addr_decode(src_oloc.file, (const uint8_t **)&q, &(src_oloc.addr)); dst_oloc.addr = HADDR_UNDEF; /* Attempt to copy object from source to destination file */ @@ -1387,9 +1388,9 @@ H5O_copy_expand_ref(H5F_t *file_src, void *_src_ref, hid_t dxpl_id, /* Making equivalent references in the destination file */ for(i = 0; i < ref_count; i++) { /* Get the heap ID for the dataset region */ - p = (uint8_t *)(&src_ref[i]); - H5F_addr_decode(src_oloc.file, (const uint8_t **)&p, &(hobjid.addr)); - INT32DECODE(p, hobjid.idx); + q = (const uint8_t *)(&src_ref[i]); + H5F_addr_decode(src_oloc.file, (const uint8_t **)&q, &(hobjid.addr)); + UINT32DECODE(q, hobjid.idx); if(hobjid.addr != (haddr_t)0) { /* Get the dataset region from the heap (allocate inside routine) */ @@ -1397,8 +1398,8 @@ H5O_copy_expand_ref(H5F_t *file_src, void *_src_ref, hid_t dxpl_id, HGOTO_ERROR(H5E_REFERENCE, H5E_READERROR, FAIL, "Unable to read dataset region information") /* Get the object oid for the dataset */ - p = (uint8_t *)buf; - H5F_addr_decode(src_oloc.file, (const uint8_t **)&p, &(src_oloc.addr)); + q = (const uint8_t *)buf; + H5F_addr_decode(src_oloc.file, (const uint8_t **)&q, &(src_oloc.addr)); dst_oloc.addr = HADDR_UNDEF; /* copy the object pointed by the ref to the destination */ @@ -1424,7 +1425,7 @@ H5O_copy_expand_ref(H5F_t *file_src, void *_src_ref, hid_t dxpl_id, /* Set the dataset region reference info for the destination file */ p = (uint8_t *)(&dst_ref[i]); H5F_addr_encode(dst_oloc.file, &p, hobjid.addr); - INT32ENCODE(p, hobjid.idx); + UINT32ENCODE(p, hobjid.idx); /* Free the buffer allocated in H5HG_read() */ H5MM_xfree(buf); diff --git a/src/H5Oefl.c b/src/H5Oefl.c index db9066e..487b6f4 100644 --- a/src/H5Oefl.c +++ b/src/H5Oefl.c @@ -118,9 +118,9 @@ H5O_efl_decode(H5F_t *f, hid_t dxpl_id, H5O_t UNUSED *open_oh, /* Number of slots */ UINT16DECODE(p, mesg->nalloc); - assert(mesg->nalloc>0); + HDassert(mesg->nalloc>0); UINT16DECODE(p, mesg->nused); - assert(mesg->nused <= mesg->nalloc); + HDassert(mesg->nused <= mesg->nalloc); /* Heap address */ H5F_addr_decode(f, &p, &(mesg->heap_addr)); diff --git a/src/H5Olayout.c b/src/H5Olayout.c index 6326fd9..4c43873 100644 --- a/src/H5Olayout.c +++ b/src/H5Olayout.c @@ -127,7 +127,7 @@ H5O_layout_decode(H5F_t *f, hid_t UNUSED dxpl_id, H5O_t UNUSED *open_oh, /* Layout class */ mesg->type = (H5D_layout_t)*p++; - assert(H5D_CONTIGUOUS == mesg->type || H5D_CHUNKED == mesg->type || H5D_COMPACT == mesg->type); + HDassert(H5D_CONTIGUOUS == mesg->type || H5D_CHUNKED == mesg->type || H5D_COMPACT == mesg->type); /* Reserved bytes */ p += 5; diff --git a/src/H5Oname.c b/src/H5Oname.c index c1cb8c8..5ca05e1 100644 --- a/src/H5Oname.c +++ b/src/H5Oname.c @@ -228,8 +228,8 @@ H5O_name_size(const H5F_t UNUSED *f, hbool_t UNUSED disable_shared, const void * FUNC_ENTER_NOAPI_NOINIT_NOERR /* check args */ - assert(f); - assert(mesg); + HDassert(f); + HDassert(mesg); ret_value = mesg->s ? HDstrlen(mesg->s) + 1 : 0; @@ -294,11 +294,11 @@ H5O_name_debug(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, const void *_mesg, FILE *s FUNC_ENTER_NOAPI_NOINIT_NOERR /* check args */ - assert(f); - assert(mesg); - assert(stream); - assert(indent >= 0); - assert(fwidth >= 0); + HDassert(f); + HDassert(mesg); + HDassert(stream); + HDassert(indent >= 0); + HDassert(fwidth >= 0); fprintf(stream, "%*s%-*s `%s'\n", indent, "", fwidth, "Name:", diff --git a/src/H5Ostab.c b/src/H5Ostab.c index d05c7c2..f7c77bc 100644 --- a/src/H5Ostab.c +++ b/src/H5Ostab.c @@ -149,9 +149,9 @@ H5O_stab_encode(H5F_t *f, hbool_t UNUSED disable_shared, uint8_t *p, const void FUNC_ENTER_NOAPI_NOINIT_NOERR /* check args */ - assert(f); - assert(p); - assert(stab); + HDassert(f); + HDassert(p); + HDassert(stab); /* encode */ H5F_addr_encode(f, &p, stab->btree_addr); @@ -433,11 +433,11 @@ H5O_stab_debug(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, const void *_mesg, FILE * FUNC_ENTER_NOAPI_NOINIT_NOERR /* check args */ - assert(f); - assert(stab); - assert(stream); - assert(indent >= 0); - assert(fwidth >= 0); + HDassert(f); + HDassert(stab); + HDassert(stream); + HDassert(indent >= 0); + HDassert(fwidth >= 0); HDfprintf(stream, "%*s%-*s %a\n", indent, "", fwidth, "B-tree address:", stab->btree_addr); diff --git a/src/H5PL.c b/src/H5PL.c new file mode 100644 index 0000000..def41d1 --- /dev/null +++ b/src/H5PL.c @@ -0,0 +1,661 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by The HDF Group. * + * All rights reserved. * + * * + * This file is part of HDF5. The full HDF5 copyright notice, including * + * terms governing use, modification, and redistribution, is contained in * + * the files COPYING and Copyright.html. COPYING can be found at the root * + * of the source code distribution tree; Copyright.html can be found at the * + * root level of an installed copy of the electronic document set and is * + * linked from the top-level documents page. It can also be found at * + * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have access * + * to either file, you may request a copy from help@hdfgroup.org. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/****************/ +/* Module Setup */ +/****************/ + +/* Interface initialization */ +#define H5_INTERFACE_INIT_FUNC H5PL__init_interface + + +/***********/ +/* Headers */ +/***********/ +#include "H5private.h" /* Generic Functions */ +#include "H5Eprivate.h" /* Error handling */ +#include "H5MMprivate.h" /* Memory management */ +#include "H5PLprivate.h" /* Plugin */ +#include "H5Zprivate.h" /* Filter pipeline */ + + +/****************/ +/* Local Macros */ +/****************/ + +#define H5PL_MAX_PATH_NUM 16 + +/****************************/ +/* Macros for supporting + * both Windows and Unix */ +/****************************/ +/* Windows support */ +#ifdef H5_HAVE_WIN32_API + +#define H5PL_DEFAULT_PATH "%ALLUSERSPROFILE%/hdf5/lib/plugin" +#define H5PL_PATH_SEPARATOR ";" + +/* Handle for dynamic library */ +#define H5PL_HANDLE HINSTANCE + +/* Get a handle to a plugin library. Windows: TEXT macro handles Unicode strings */ +#define H5PL_OPEN_DLIB(S) LoadLibraryEx(TEXT(S), NULL, LOAD_WITH_ALTERED_SEARCH_PATH) + +/* Get the address of a symbol in dynamic library */ +#define H5PL_GET_LIB_FUNC(H,N) GetProcAddress(H,N) + +/* Close dynamic library */ +#define H5PL_CLOSE_LIB(H) FreeLibrary(H) + +/* Clear error - nothing to do */ +#define H5PL_CLR_ERROR + +typedef const void *(__cdecl *H5PL_get_plugin_info_t)(void); + +/* Unix support */ +#else /* H5_HAVE_WIN32_API */ + +#define H5PL_DEFAULT_PATH "/usr/local/hdf5/lib/plugin" +#define H5PL_PATH_SEPARATOR ":" + +/* Handle for dynamic library */ +#define H5PL_HANDLE void * + +/* Get a handle to a plugin library. Windows: TEXT macro handles Unicode strings */ +#define H5PL_OPEN_DLIB(S) dlopen(S, RTLD_NOW) + +/* Get the address of a symbol in dynamic library */ +#define H5PL_GET_LIB_FUNC(H,N) dlsym(H,N) + +/* Close dynamic library */ +#define H5PL_CLOSE_LIB(H) dlclose(H) + +/* Clear error */ +#define H5PL_CLR_ERROR dlerror() + +typedef const void *(*H5PL_get_plugin_info_t)(void); +#endif /* H5_HAVE_WIN32_API */ + +/* Special symbol to indicate no plugin loading */ +#define H5PL_NO_PLUGIN "::" + +/******************/ +/* Local Typedefs */ +/******************/ + +/* Type for the list of info for opened plugin libraries */ +typedef struct H5PL_table_t { + H5PL_type_t pl_type; /* plugin type */ + int pl_id; /* ID for the plugin */ + H5PL_HANDLE handle; /* plugin handle */ +} H5PL_table_t; + + +/********************/ +/* Local Prototypes */ +/********************/ + +static herr_t H5PL__init_path_table(void); +static htri_t H5PL__find(H5PL_type_t plugin_type, int type_id, char *dir, const void **info); +static htri_t H5PL__open(H5PL_type_t pl_type, char *libname, int plugin_id, const void **pl_info); +static htri_t H5PL__search_table(H5PL_type_t plugin_type, int type_id, const void **info); +static herr_t H5PL__close(H5PL_HANDLE handle); + + +/*********************/ +/* Package Variables */ +/*********************/ + + +/*****************************/ +/* Library Private Variables */ +/*****************************/ + + +/*******************/ +/* Local Variables */ +/*******************/ + +/* Table for opened plugin libraries */ +static size_t H5PL_table_alloc_g = 0; +static size_t H5PL_table_used_g = 0; +static H5PL_table_t *H5PL_table_g = NULL; + +/* Table of location paths for plugin libraries */ +static char *H5PL_path_table_g[H5PL_MAX_PATH_NUM]; +static size_t H5PL_num_paths_g = 0; +static hbool_t H5PL_path_found_g = FALSE; + +/* Whether to preload pathnames for plugin libraries */ +static hbool_t H5PL_no_plugin_g = FALSE; + + +/*-------------------------------------------------------------------------- +NAME + H5PL__init_interface -- Initialize interface-specific information +USAGE + herr_t H5PL__init_interface() +RETURNS + Non-negative on success/Negative on failure +DESCRIPTION + Initializes any interface-specific data or routines. + +--------------------------------------------------------------------------*/ +static herr_t +H5PL__init_interface(void) +{ + char *preload_path; + + FUNC_ENTER_STATIC_NOERR + + /* Retrieve pathnames from HDF5_PLUGIN_PRELOAD if the user sets it + * to tell the library to load plugin libraries without search. + */ + if(NULL != (preload_path = HDgetenv("HDF5_PLUGIN_PRELOAD"))) { + /* Special symbal "::" means no plugin during data reading. */ + if(!HDstrcmp(preload_path, H5PL_NO_PLUGIN)) + H5PL_no_plugin_g = TRUE; + } /* end if */ + + FUNC_LEAVE_NOAPI(SUCCEED) +} /* end H5PL__init_interface() */ + + +/*------------------------------------------------------------------------- + * Function: H5PL_no_plugin + * + * Purpose: Quick way for filter module to query whether to load plugin + * + * Return: TRUE: No plugin loading during data reading + * + * FALSE: Load plugin during data reading + * + * Programmer: Raymond Lu + * 20 February 2013 + * + *------------------------------------------------------------------------- + */ +htri_t +H5PL_no_plugin(void) +{ + htri_t ret_value; + + FUNC_ENTER_NOAPI(FAIL) + + ret_value = (htri_t)H5PL_no_plugin_g; + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5PL_no_plugin() */ + + +/*------------------------------------------------------------------------- + * Function: H5PL_term_interface + * + * Purpose: Terminate the H5PL interface: release all memory, reset all + * global variables to initial values. This only happens if all + * types have been destroyed from other interfaces. + * + * Return: Success: Positive if any action was taken that might + * affect some other interface; zero otherwise. + * + * Failure: Negative. + * + * Programmer: Raymond Lu + * 20 February 2013 + * + *------------------------------------------------------------------------- + */ +int +H5PL_term_interface(void) +{ + int i = 0; + + FUNC_ENTER_NOAPI_NOINIT_NOERR + + if(H5_interface_initialize_g) { + size_t u; /* Local index variable */ + + /* Close opened dynamic libraries */ + for(u = 0; u < H5PL_table_used_g; u++) + H5PL__close((H5PL_table_g[u]).handle); + + /* Free the table of dynamic libraries */ + H5PL_table_g = (H5PL_table_t *)H5MM_xfree(H5PL_table_g); + H5PL_table_used_g = H5PL_table_alloc_g = 0; + + /* Free the table of search paths */ + for(u = 0; u < H5PL_num_paths_g; u++) + if(H5PL_path_table_g[u]) + H5PL_path_table_g[u] = (char *)H5MM_xfree(H5PL_path_table_g[u]); + H5PL_num_paths_g = 0; + H5PL_path_found_g = FALSE; + + H5_interface_initialize_g = 0; + i = 1; + } /* end if */ + + FUNC_LEAVE_NOAPI(i) +} /* end H5PL_term_interface() */ + + +/*------------------------------------------------------------------------- + * Function: H5PL_load + * + * Purpose: Given the plugin type and identifier, this function searches + * and/or loads a dynamic plugin library first among the already + * opened libraries then in the designated location paths. + * + * Return: Non-NULL on success/NULL on failure + * + * Programmer: Raymond Lu + * 13 February 2013 + * + *------------------------------------------------------------------------- + */ +const void * +H5PL_load(H5PL_type_t type, int id) +{ + htri_t found; /* Whether the plugin was found */ + const void *plugin_info = NULL; + const void *ret_value = NULL; + + FUNC_ENTER_NOAPI(NULL) + + /* Initialize the location paths for dynamic libraries, if they aren't + * already set up. + */ + if(FALSE == H5PL_path_found_g) + if(H5PL__init_path_table() < 0) + HGOTO_ERROR(H5E_PLUGIN, H5E_CANTINIT, NULL, "can't initialize search path table") + + /* Search in the table of already loaded plugin libraries */ + if((found = H5PL__search_table(type, id, &plugin_info)) < 0) + HGOTO_ERROR(H5E_PLUGIN, H5E_CANTGET, NULL, "search in table failed") + + /* If not found, iterate through the path table to find the right dynamic library */ + if(!found) { + size_t i; /* Local index variable */ + + for(i = 0; i < H5PL_num_paths_g; i++) { + if((found = H5PL__find(type, id, H5PL_path_table_g[i], &plugin_info)) < 0) + HGOTO_ERROR(H5E_PLUGIN, H5E_CANTGET, NULL, "search in paths failed") + + /* Break out if found */ + if(found) { + HDassert(plugin_info); + break; + } /* end if */ + } /* end for */ + } /* end if */ + + /* Check if we found the plugin */ + if(found) + ret_value = plugin_info; + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5PL_load() */ + + +/*------------------------------------------------------------------------- + * Function: H5PL__init_path_table + * + * Purpose: Initialize the path table. + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Quincey Koziol + * 18 March 2013 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5PL__init_path_table(void) +{ + char *dl_path = NULL; + char *origin_dl_path; + char *dir; + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_STATIC + + /* Retrieve paths from HDF5_PLUGIN_PATH if the user sets it + * or from the default paths if it isn't set. + */ + origin_dl_path = HDgetenv("HDF5_PLUGIN_PATH"); + if(NULL == origin_dl_path) + dl_path = HDstrdup(H5PL_DEFAULT_PATH); + else + dl_path = HDstrdup(origin_dl_path); + if(NULL == dl_path) + HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "can't allocate memory for path") + + /* Put paths in the path table. They are separated by ":" */ + dir = HDstrtok(dl_path, H5PL_PATH_SEPARATOR); + while(dir) { + /* Check for too many directories in path */ + if(H5PL_num_paths_g == H5PL_MAX_PATH_NUM) + HGOTO_ERROR(H5E_PLUGIN, H5E_NOSPACE, FAIL, "too many directories in path for table") + if(NULL == (H5PL_path_table_g[H5PL_num_paths_g] = HDstrdup(dir))) + HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "can't allocate memory for path") + H5PL_num_paths_g++; + dir = HDstrtok(NULL, H5PL_PATH_SEPARATOR); + } /* end while */ + + H5PL_path_found_g = TRUE; + +done: + if(dl_path) + dl_path = (char *)H5MM_xfree(dl_path); + + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5PL__init_path_table() */ + + +/*------------------------------------------------------------------------- + * Function: H5PL__find + * + * Purpose: Given a path, this function opens the directory and envokes + * another function to go through all files to find the right + * plugin library. Two function definitions are for Unix and + * Windows. + * + * Return: TRUE on success, + * FALSE on not found, + * negative on failure + * + * Programmer: Raymond Lu + * 13 February 2013 + * + *------------------------------------------------------------------------- + */ +#ifndef H5_HAVE_WIN32_API +static htri_t +H5PL__find(H5PL_type_t plugin_type, int type_id, char *dir, const void **info) +{ + char *pathname = NULL; + DIR *dirp = NULL; + struct dirent *dp; + htri_t ret_value = FALSE; + + FUNC_ENTER_STATIC + + /* Open the directory */ + if(!(dirp = HDopendir(dir))) + HGOTO_ERROR(H5E_PLUGIN, H5E_OPENERROR, FAIL, "can't open directory") + + /* Iterates through all entries in the directory to find the right plugin library */ + while(NULL != (dp = HDreaddir(dirp))) { + /* The library we are looking for should be called libxxx.so... on Unix + * or libxxx.xxx.dylib on Mac. + */ + if(!HDstrncmp(dp->d_name, "lib", (size_t)3) && + (HDstrstr(dp->d_name, ".so") || HDstrstr(dp->d_name, ".dylib"))) { + h5_stat_t my_stat; + size_t pathname_len; + htri_t found_in_dir; + + /* Allocate & initialize the path name */ + pathname_len = HDstrlen(dir) + HDstrlen(dp->d_name) + 2; + if(NULL == (pathname = (char *)H5MM_malloc(pathname_len))) + HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "can't allocate memory for path") + HDsnprintf(pathname, pathname_len, "%s/%s", dir, dp->d_name); + + /* Get info for directory entry */ + if(HDstat(pathname, &my_stat) == -1) + HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "can't stat file: %s", HDstrerror(errno)) + + /* If it is a directory, skip it */ + if(S_ISDIR(my_stat.st_mode)) + continue; + + /* Attempt to open the dynamic library as a filter library */ + if((found_in_dir = H5PL__open(plugin_type, pathname, type_id, info)) < 0) + HGOTO_ERROR(H5E_PLUGIN, H5E_CANTGET, FAIL, "search in directory failed") + if(found_in_dir) { + /* Indicate success */ + HGOTO_DONE(TRUE) + } /* end if */ + else + HDassert(pathname); + pathname = (char *)H5MM_xfree(pathname); + } /* end if */ + } /* end while */ + +done: + if(dirp) + if(HDclosedir(dirp) < 0) + HDONE_ERROR(H5E_FILE, H5E_CLOSEERROR, FAIL, "can't close directory: %s", HDstrerror(errno)) + if(pathname) + pathname = (char *)H5MM_xfree(pathname); + + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5PL__find() */ +#else /* H5_HAVE_WIN32_API */ +static htri_t +H5PL__find(H5PL_type_t plugin_type, int type_id, char *dir, const void **info) +{ + WIN32_FIND_DATA fdFile; + HANDLE hFind; + char *pathname = NULL; + char service[2048]; + htri_t ret_value = FALSE; + + FUNC_ENTER_STATIC + + /* Specify a file mask. *.* = We want everything! */ + sprintf(service, "%s\\*.dll", dir); + if((hFind = FindFirstFile(service, &fdFile)) == INVALID_HANDLE_VALUE) + HGOTO_ERROR(H5E_PLUGIN, H5E_OPENERROR, FAIL, "can't open directory") + + do { + /* Find first file will always return "." + * and ".." as the first two directories. + */ + if(HDstrcmp(fdFile.cFileName, ".") != 0 && HDstrcmp(fdFile.cFileName, "..") != 0) { + size_t pathname_len; + htri_t found_in_dir; + + /* Allocate & initialize the path name */ + pathname_len = HDstrlen(dir) + HDstrlen(fdFile.cFileName) + 2; + if(NULL == (pathname = (char *)H5MM_malloc(pathname_len))) + HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "can't allocate memory for path") + HDsnprintf(pathname, pathname_len, "%s\\%s", dir, fdFile.cFileName); + + /* Is the entity a File or Folder? */ + if(fdFile.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) + continue; + + if((found_in_dir = H5PL__open(plugin_type, pathname, type_id, info)) < 0) + HGOTO_ERROR(H5E_PLUGIN, H5E_CANTGET, FAIL, "search in directory failed") + if(found_in_dir) { + /* Indicate success */ + HGOTO_DONE(TRUE) + } /* end if */ + else + HDassert(pathname); + pathname = (char *)H5MM_xfree(pathname); + } /* end if */ + } while(FindNextFile(hFind, &fdFile)); /* Find the next file. */ + +done: + if(hFind) + FindClose(hFind); + if(pathname) + pathname = (char *)H5MM_xfree(pathname); + + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5PL__find() */ +#endif /* H5_HAVE_WIN32_API */ + + +/*------------------------------------------------------------------------- + * Function: H5PL__open + * + * Purpose: Iterates through all files to find the right plugin library. + * It loads the dynamic plugin library and keeps it on the list + * of loaded libraries. + * + * Return: TRUE on success, + * FALSE on not found, + * negative on failure + * + * Programmer: Raymond Lu + * 13 February 2013 + * + *------------------------------------------------------------------------- + */ +static htri_t +H5PL__open(H5PL_type_t pl_type, char *libname, int pl_id, const void **pl_info) +{ + H5PL_HANDLE handle = NULL; + htri_t ret_value = FALSE; + + FUNC_ENTER_STATIC + + /* There are different reasons why a library can't be open, e.g. wrong architecture. + * simply continue if we can't open it. + */ + if(NULL == (handle = H5PL_OPEN_DLIB(libname))) { + H5PL_CLR_ERROR; /* clear error */ + } /* end if */ + else { + H5PL_get_plugin_info_t get_plugin_info = NULL; + + /* Return a handle for the function H5PLget_plugin_info in the dynamic library. + * The plugin library is suppose to define this function. + */ + if(NULL == (get_plugin_info = (H5PL_get_plugin_info_t)H5PL_GET_LIB_FUNC(handle, "H5PLget_plugin_info"))) { + if(H5PL__close(handle) < 0) + HGOTO_ERROR(H5E_PLUGIN, H5E_CLOSEERROR, FAIL, "can't close dynamic library") + } /* end if */ + else { + const H5Z_class2_t *plugin_info; + + /* Invoke H5PLget_plugin_info to verify this is the right library we are looking for. + * Move on if it isn't. + */ + if(NULL == (plugin_info = (const H5Z_class2_t *)(*get_plugin_info)())) { + if(H5PL__close(handle) < 0) + HGOTO_ERROR(H5E_PLUGIN, H5E_CLOSEERROR, FAIL, "can't close dynamic library") + HGOTO_ERROR(H5E_PLUGIN, H5E_CANTGET, FAIL, "can't get plugin info") + } /* end if */ + + /* Successfully found plugin library, check if it's the right one */ + if(plugin_info->id == pl_id) { + /* Expand the table if it is too small */ + if(H5PL_table_used_g >= H5PL_table_alloc_g) { + size_t n = MAX(H5Z_MAX_NFILTERS, 2 * H5PL_table_alloc_g); + H5PL_table_t *table = (H5PL_table_t *)H5MM_realloc(H5PL_table_g, n * sizeof(H5PL_table_t)); + + if(!table) + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "unable to extend dynamic library table") + + H5PL_table_g = table; + H5PL_table_alloc_g = n; + } /* end if */ + + (H5PL_table_g[H5PL_table_used_g]).handle = handle; + (H5PL_table_g[H5PL_table_used_g]).pl_type = pl_type; + (H5PL_table_g[H5PL_table_used_g]).pl_id = plugin_info->id; + H5PL_table_used_g++; + + /* Set the plugin info to return */ + *pl_info = (const void *)plugin_info; + + /* Indicate success */ + ret_value = TRUE; + } /* end if */ + else + if(H5PL__close(handle) < 0) + HGOTO_ERROR(H5E_PLUGIN, H5E_CLOSEERROR, FAIL, "can't close dynamic library") + } /* end if */ + } /* end else */ + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5PL__open() */ + + +/*------------------------------------------------------------------------- + * Function: H5PL__search_table + * + * Purpose: Search in the list of already opened dynamic libraries + * to see if the one we are looking for is already opened. + * + * Return: TRUE on success, + * FALSE on not found, + * Negative on failure + * + * Programmer: Raymond Lu + * 13 February 2013 + * + *------------------------------------------------------------------------- + */ +static htri_t +H5PL__search_table(H5PL_type_t plugin_type, int type_id, const void **info) +{ + htri_t ret_value = FALSE; + + FUNC_ENTER_STATIC + + /* Search in the table of already opened dynamic libraries */ + if(H5PL_table_used_g > 0) { + size_t i; + + for(i = 0; i < H5PL_table_used_g; i++) { + if((plugin_type == (H5PL_table_g[i]).pl_type) && (type_id == (H5PL_table_g[i]).pl_id)) { + H5PL_get_plugin_info_t get_plugin_info; + const H5Z_class2_t *plugin_info; + + if(NULL == (get_plugin_info = (H5PL_get_plugin_info_t)H5PL_GET_LIB_FUNC((H5PL_table_g[i]).handle, "H5PLget_plugin_info"))) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTGET, FAIL, "can't get function for H5PLget_plugin_info") + + if(NULL == (plugin_info = (const H5Z_class2_t *)(*get_plugin_info)())) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTGET, FAIL, "can't get plugin info") + + *info = plugin_info; + HGOTO_DONE(TRUE) + } /* end if */ + } /* end for */ + } /* end if */ + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5PL__search_table() */ + + +/*------------------------------------------------------------------------- + * Function: H5PL__close + * + * Purpose: Closes the handle for dynamic library + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Raymond Lu + * 13 February 2013 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5PL__close(H5PL_HANDLE handle) +{ + FUNC_ENTER_STATIC_NOERR + + H5PL_CLOSE_LIB(handle); + + FUNC_LEAVE_NOAPI(SUCCEED) +} /* end H5PL__close() */ + diff --git a/src/H5PLextern.h b/src/H5PLextern.h new file mode 100644 index 0000000..943e3aa --- /dev/null +++ b/src/H5PLextern.h @@ -0,0 +1,84 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by The HDF Group. * + * All rights reserved. * + * * + * This file is part of HDF5. The full HDF5 copyright notice, including * + * terms governing use, modification, and redistribution, is contained in * + * the files COPYING and Copyright.html. COPYING can be found at the root * + * of the source code distribution tree; Copyright.html can be found at the * + * root level of an installed copy of the electronic document set and is * + * linked from the top-level documents page. It can also be found at * + * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have access * + * to either file, you may request a copy from help@hdfgroup.org. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* + * Programmer: Raymond Lu <songyulu@hdfgroup.org> + * 13 February 2013 + */ +#ifndef _H5PLextern_H +#define _H5PLextern_H + +/* Include HDF5 header */ +#include "hdf5.h" + +/*******************/ +/* Public Typedefs */ +/*******************/ + +/* Plugin type */ +typedef enum H5PL_type_t { + H5PL_TYPE_ERROR = -1, /*error */ + H5PL_TYPE_FILTER = 0, /*filter */ + H5PL_TYPE_NONE = 1 /*this must be last! */ +} H5PL_type_t; + + +#ifdef H5_BUILT_AS_DYNAMIC_LIB + + #if defined (hdf5_EXPORTS) + /* hdf5 library imports from plugin */ + #if defined (_MSC_VER) /* MSVC Compiler Case */ + #define H5PLUGIN_DLL __declspec(dllimport) + #elif (__GNUC__ >= 4) /* GCC 4.x has support for visibility options */ + #define H5PLUGIN_DLL __attribute__ ((visibility("default"))) + #endif + #else + /* plugins always export */ + #if defined (_MSC_VER) /* MSVC Compiler Case */ + #define H5PLUGIN_DLL __declspec(dllexport) + #elif (__GNUC__ >= 4) /* GCC 4.x has support for visibility options */ + #define H5PLUGIN_DLL __attribute__ ((visibility("default"))) + #endif + #endif + +#elif defined(H5_BUILT_AS_STATIC_LIB) + #define H5PLUGIN_DLL +#else + + #if defined(H5_HAVE_WIN32_API) + #if defined(_HDF5DLL_) + #pragma warning(disable: 4273) /* Disable the dll linkage warnings */ + #define H5PLUGIN_DLL __declspec(dllimport) + #elif defined(_HDF5USEDLL_) + #define H5PLUGIN_DLL __declspec(dllexport) + #endif /* _HDF5DLL_ */ + #else /*H5_HAVE_WIN32_API*/ + #define H5PLUGIN_DLL + #endif /*H5_HAVE_WIN32_API*/ + +#endif /* H5_BUILT_AS_xxx_LIB */ + +#ifdef __cplusplus +extern "C" { +#endif + +H5PLUGIN_DLL H5PL_type_t H5PLget_plugin_type(void); +H5PLUGIN_DLL const void *H5PLget_plugin_info(void); + +#ifdef __cplusplus +} +#endif + +#endif /* _H5PLextern_H */ + diff --git a/src/H5PLprivate.h b/src/H5PLprivate.h new file mode 100644 index 0000000..b117613 --- /dev/null +++ b/src/H5PLprivate.h @@ -0,0 +1,53 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by The HDF Group. * + * All rights reserved. * + * * + * This file is part of HDF5. The full HDF5 copyright notice, including * + * terms governing use, modification, and redistribution, is contained in * + * the files COPYING and Copyright.html. COPYING can be found at the root * + * of the source code distribution tree; Copyright.html can be found at the * + * root level of an installed copy of the electronic document set and is * + * linked from the top-level documents page. It can also be found at * + * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have access * + * to either file, you may request a copy from help@hdfgroup.org. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* Programmer: Raymond Lu <songyulu@hdfgroup.org> + * 13 February 2013 + */ + +#ifndef _H5PLprivate_H +#define _H5PLprivate_H + +/* Include package's "external" header */ +#include "H5PLextern.h" + +/* Private headers needed by this file */ +#include "H5private.h" /* Generic Functions */ + + +/**************************/ +/* Library Private Macros */ +/**************************/ + + +/****************************/ +/* Library Private Typedefs */ +/****************************/ + + +/*****************************/ +/* Library-private Variables */ +/*****************************/ + + +/***************************************/ +/* Library-private Function Prototypes */ +/***************************************/ + +/* Internal API routines */ +H5_DLL const void *H5PL_load(H5PL_type_t plugin_type, int type_id); +H5_DLL htri_t H5PL_no_plugin(void); + +#endif /* _H5PLprivate_H */ + diff --git a/src/H5Pdcpl.c b/src/H5Pdcpl.c index be0f987..c8b8110 100644 --- a/src/H5Pdcpl.c +++ b/src/H5Pdcpl.c @@ -1701,13 +1701,6 @@ done: * Programmer: Kent Yang * Tuesday, April 1, 2003 * - * Modifications: - * - * Nat Furrer and James Laird - * June 30, 2004 - * Now ensures that SZIP encoding is enabled - * SZIP defaults to k13 compression - * *------------------------------------------------------------------------- */ herr_t @@ -1717,22 +1710,22 @@ H5Pset_szip(hid_t plist_id, unsigned options_mask, unsigned pixels_per_block) H5P_genplist_t *plist; /* Property list pointer */ unsigned cd_values[2]; /* Filter parameters */ unsigned int config_flags; - herr_t ret_value=SUCCEED; /* return value */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE3("e", "iIuIu", plist_id, options_mask, pixels_per_block); - if(H5Zget_filter_info(H5Z_FILTER_SZIP, &config_flags) < 0) + if(H5Z_get_filter_info(H5Z_FILTER_SZIP, &config_flags) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "can't get filter info") - if(! (config_flags & H5Z_FILTER_CONFIG_ENCODE_ENABLED)) + if(!(config_flags & H5Z_FILTER_CONFIG_ENCODE_ENABLED)) HGOTO_ERROR(H5E_PLINE, H5E_NOENCODER, FAIL, "Filter present but encoding is disabled.") /* Check arguments */ - if ((pixels_per_block%2)==1) - HGOTO_ERROR (H5E_ARGS, H5E_BADVALUE, FAIL, "pixels_per_block is not even") - if (pixels_per_block>H5_SZIP_MAX_PIXELS_PER_BLOCK) - HGOTO_ERROR (H5E_ARGS, H5E_BADVALUE, FAIL, "pixels_per_block is too large") + if((pixels_per_block % 2) == 1) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "pixels_per_block is not even") + if(pixels_per_block > H5_SZIP_MAX_PIXELS_PER_BLOCK) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "pixels_per_block is too large") /* Get the plist structure */ if(NULL == (plist = H5P_object_verify(plist_id,H5P_DATASET_CREATE))) diff --git a/src/H5Pfapl.c b/src/H5Pfapl.c index aaa7ecf..82833c1 100644 --- a/src/H5Pfapl.c +++ b/src/H5Pfapl.c @@ -2522,7 +2522,7 @@ H5P_file_image_info_del(hid_t UNUSED prop_id, const char UNUSED *name, size_t UN HGOTO_ERROR(H5E_RESOURCE, H5E_CANTFREE, FAIL, "image_free callback failed") } /* end if */ else - free(info.buffer); + HDfree(info.buffer); } /* end if */ /* Free udata if it exists */ diff --git a/src/H5Pint.c b/src/H5Pint.c index aa7ad21..dfc6e2e 100644 --- a/src/H5Pint.c +++ b/src/H5Pint.c @@ -2732,7 +2732,7 @@ done: PURPOSE Internal routine to query the existance of a property in a property list. USAGE - herr_t H5P_exist_plist(plist, name) + htri_t H5P_exist_plist(plist, name) const H5P_genplist_t *plist; IN: Property list to check const char *name; IN: Name of property to check for RETURNS diff --git a/src/H5Pocpl.c b/src/H5Pocpl.c index d8ddfee..2166020 100644 --- a/src/H5Pocpl.c +++ b/src/H5Pocpl.c @@ -40,6 +40,8 @@ #include "H5MMprivate.h" /* Memory management */ #include "H5Opkg.h" /* Object headers */ #include "H5Ppkg.h" /* Property lists */ +#include "H5PLprivate.h" /* Dynamic plugin */ +#include "H5Zprivate.h" /* Filter pipeline */ /****************/ @@ -90,6 +92,9 @@ static herr_t H5P__ocrt_pipeline_enc(const void *value, void **_pp, size_t *size static herr_t H5P__ocrt_pipeline_dec(const void **_pp, void *value); static int H5P__ocrt_pipeline_cmp(const void *value1, const void *value2, size_t size); +/* Local routines */ +static herr_t H5P__set_filter(H5P_genplist_t *plist, H5Z_filter_t filter, + unsigned int flags, size_t cd_nelmts, const unsigned int cd_values[/*cd_nelmts*/]); /*********************/ /* Package Variables */ @@ -747,7 +752,6 @@ H5Pset_filter(hid_t plist_id, H5Z_filter_t filter, unsigned int flags, size_t cd_nelmts, const unsigned int cd_values[/*cd_nelmts*/]) { H5P_genplist_t *plist; /* Property list */ - H5O_pline_t pline; /* Filter pipeline */ herr_t ret_value=SUCCEED; /* return value */ FUNC_ENTER_API(FAIL) @@ -765,6 +769,74 @@ H5Pset_filter(hid_t plist_id, H5Z_filter_t filter, unsigned int flags, if(NULL == (plist = H5P_object_verify(plist_id, H5P_OBJECT_CREATE))) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID") + /* Call the private function */ + if(H5P__set_filter(plist, filter, flags, cd_nelmts, cd_values) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "failed to call private function") + +done: + FUNC_LEAVE_API(ret_value) +} /* end H5Pset_filter() */ + + +/*------------------------------------------------------------------------- + * Function: H5P__set_filter + * + * Purpose: Adds the specified FILTER and corresponding properties to the + * end of the data or link output filter pipeline + * depending on whether PLIST is a dataset creation or group + * creation property list. The FLAGS argument specifies certain + * general properties of the filter and is documented below. + * The CD_VALUES is an array of CD_NELMTS integers which are + * auxiliary data for the filter. The integer vlues will be + * stored in the dataset object header as part of the filter + * information. + * + * The FLAGS argument is a bit vector of the following fields: + * + * H5Z_FLAG_OPTIONAL(0x0001) + * If this bit is set then the filter is optional. If the + * filter fails during an H5Dwrite() operation then the filter + * is just excluded from the pipeline for the chunk for which it + * failed; the filter will not participate in the pipeline + * during an H5Dread() of the chunk. If this bit is clear and + * the filter fails then the entire I/O operation fails. + * If this bit is set but encoding is disabled for a filter, + * attempting to write will generate an error. + * + * If the filter is not registered, this function tries to load + * it dynamically during run time. + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Robb Matzke + * Wednesday, April 15, 1998 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5P__set_filter(H5P_genplist_t *plist, H5Z_filter_t filter, unsigned int flags, + size_t cd_nelmts, const unsigned int cd_values[/*cd_nelmts*/]) +{ + H5O_pline_t pline; /* Filter pipeline */ + htri_t filter_avail; /* Filter availability */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_STATIC + + /* Check if filter is already available */ + if((filter_avail = H5Z_filter_avail(filter)) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't check filter availability") + + /* If filter is not available, try to dynamically load it */ + if(!filter_avail) { + const H5Z_class2_t *filter_info; + + if(NULL == (filter_info = (const H5Z_class2_t *)H5PL_load(H5PL_TYPE_FILTER, (int)filter))) + HGOTO_ERROR(H5E_PLINE, H5E_CANTLOAD, FAIL, "failed to load dynamically loaded plugin") + if(H5Z_register(filter_info) < 0) + HGOTO_ERROR(H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register filter") + } /* end if */ + /* Get the pipeline property to append to */ if(H5P_get(plist, H5O_CRT_PIPELINE_NAME, &pline) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get pipeline") @@ -778,8 +850,8 @@ H5Pset_filter(hid_t plist_id, H5Z_filter_t filter, unsigned int flags, HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set pipeline") done: - FUNC_LEAVE_API(ret_value) -} /* end H5Pset_filter() */ + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5P__set_filter() */ /*------------------------------------------------------------------------- @@ -1105,6 +1177,43 @@ done: /*------------------------------------------------------------------------- + * Function: H5P_filter_in_pline + * + * Purpose: Check whether the filter is in the pipeline of the object + * creation property list. + * + * Return: TRUE: found + * FALSE: not found + * FAIL: error + * + * Programmer: Raymond Lu + * 26 April 2013 + * + *------------------------------------------------------------------------- + */ +htri_t +H5P_filter_in_pline(H5P_genplist_t *plist, H5Z_filter_t id) +{ + H5O_pline_t pline; /* Filter pipeline */ + H5Z_filter_info_t *filter; /* Pointer to filter information */ + htri_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI(FAIL) + + /* Get pipeline info */ + if(H5P_get(plist, H5O_CRT_PIPELINE_NAME, &pline) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get pipeline") + + /* Check if the file is in the pipeline */ + if((ret_value = H5Z_filter_in_pline(&pline, id)) < 0) + HGOTO_ERROR(H5E_PLINE, H5E_CANTCOMPARE, FAIL, "can't find filter") + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5P_get_filter_by_id() */ + + +/*------------------------------------------------------------------------- * Function: H5Premove_filter * * Purpose: Deletes a filter from the dataset creation property list; @@ -1344,7 +1453,7 @@ H5P_get_filter(const H5Z_filter_info_t *filter, unsigned int *flags/*out*/, /* Filter configuration (assume filter ID has already been checked) */ if(filter_config) - H5Zget_filter_info(filter->id, filter_config); + H5Z_get_filter_info(filter->id, filter_config); FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5P_get_filter() */ diff --git a/src/H5Pprivate.h b/src/H5Pprivate.h index fe3293f..93b57ef 100644 --- a/src/H5Pprivate.h +++ b/src/H5Pprivate.h @@ -117,6 +117,7 @@ H5_DLL herr_t H5P_modify_filter(H5P_genplist_t *plist, H5Z_filter_t filter, H5_DLL herr_t H5P_get_filter_by_id(H5P_genplist_t *plist, H5Z_filter_t id, unsigned int *flags, size_t *cd_nelmts, unsigned cd_values[], size_t namelen, char name[], unsigned *filter_config); +H5_DLL htri_t H5P_filter_in_pline(H5P_genplist_t *plist, H5Z_filter_t id); /* *SPECIAL* Don't make more of these! -QAK */ H5_DLL htri_t H5P_isa_class(hid_t plist_id, hid_t pclass_id); @@ -291,7 +291,7 @@ H5R_create(void *_ref, H5G_loc_t *loc, const char *name, H5R_type_t ref_type, H5 /* Serialize the heap ID and index for storage in the file */ p = (uint8_t *)ref; H5F_addr_encode(loc->oloc->file, &p, hobjid.addr); - INT32ENCODE(p, hobjid.idx); + UINT32ENCODE(p, hobjid.idx); /* Free the buffer we serialized data in */ H5MM_xfree(buf); @@ -443,7 +443,7 @@ H5R_dereference(H5F_t *file, hid_t oapl_id, hid_t dxpl_id, H5R_type_t ref_type, /* Get the heap ID for the dataset region */ p = (const uint8_t *)_ref; H5F_addr_decode(oloc.file, &p, &(hobjid.addr)); - INT32DECODE(p, hobjid.idx); + UINT32DECODE(p, hobjid.idx); /* Get the dataset region from the heap (allocate inside routine) */ if(NULL == (buf = (uint8_t *)H5HG_read(oloc.file, dxpl_id, &hobjid, NULL, NULL))) @@ -656,7 +656,7 @@ H5R_get_region(H5F_t *file, hid_t dxpl_id, const void *_ref) /* Get the heap ID for the dataset region */ p = (const uint8_t *)_ref; H5F_addr_decode(oloc.file, &p, &(hobjid.addr)); - INT32DECODE(p, hobjid.idx); + UINT32DECODE(p, hobjid.idx); /* Get the dataset region from the heap (allocate inside routine) */ if((buf = (uint8_t *)H5HG_read(oloc.file, dxpl_id, &hobjid, NULL, NULL)) == NULL) @@ -797,7 +797,7 @@ H5R_get_obj_type(H5F_t *file, hid_t dxpl_id, H5R_type_t ref_type, /* Get the heap ID for the dataset region */ p = (const uint8_t *)_ref; H5F_addr_decode(oloc.file, &p, &(hobjid.addr)); - INT32DECODE(p, hobjid.idx); + UINT32DECODE(p, hobjid.idx); /* Get the dataset region from the heap (allocate inside routine) */ if((buf = (uint8_t *)H5HG_read(oloc.file, dxpl_id, &hobjid, NULL, NULL)) == NULL) @@ -956,7 +956,7 @@ H5R_get_name(H5G_loc_t *loc, hid_t lapl_id, hid_t dxpl_id, H5R_type_t ref_type, /* Get the heap ID for the dataset region */ p = (const uint8_t *)_ref; H5F_addr_decode(oloc.file, &p, &(hobjid.addr)); - INT32DECODE(p, hobjid.idx); + UINT32DECODE(p, hobjid.idx); /* Get the dataset region from the heap (allocate inside routine) */ if((buf = (uint8_t *)H5HG_read(oloc.file, dxpl_id, &hobjid, NULL, NULL)) == NULL) @@ -323,7 +323,7 @@ H5S_extent_release(H5S_extent_t *extent) FUNC_ENTER_NOAPI(FAIL) - assert(extent); + HDassert(extent); /* Release extent */ if(extent->type == H5S_SIMPLE) { @@ -724,7 +724,7 @@ H5S_get_npoints_max(const H5S_t *ds) FUNC_ENTER_NOAPI(0) /* check args */ - assert(ds); + HDassert(ds); switch (H5S_GET_EXTENT_TYPE(ds)) { case H5S_NULL: @@ -754,7 +754,7 @@ H5S_get_npoints_max(const H5S_t *ds) case H5S_NO_CLASS: default: - assert("unknown dataspace class" && 0); + HDassert("unknown dataspace class" && 0); HGOTO_ERROR(H5E_DATASPACE, H5E_UNSUPPORTED, 0, "internal error (unknown dataspace class)") } @@ -1433,7 +1433,7 @@ H5S_create_simple(unsigned rank, const hsize_t dims[/*rank*/], FUNC_ENTER_NOAPI(NULL) /* Check arguments */ - assert(rank <=H5S_MAX_RANK); + HDassert(rank <=H5S_MAX_RANK); /* Create the space and set the extent */ if(NULL==(ret_value=H5S_create(H5S_SIMPLE))) @@ -1711,7 +1711,7 @@ H5S_get_simple_extent_type(const H5S_t *space) FUNC_ENTER_NOAPI(H5S_NO_CLASS) - assert(space); + HDassert(space); ret_value=H5S_GET_EXTENT_TYPE(space); @@ -754,7 +754,7 @@ H5SL_release_common(H5SL_t *slist, H5SL_operator_t op, void *op_data) FUNC_ENTER_NOAPI_NOINIT /* Check args */ - assert(slist); + HDassert(slist); /* Check internal consistency */ /* (Pre-condition) */ @@ -940,7 +940,7 @@ H5SL_count(H5SL_t *slist) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ - assert(slist); + HDassert(slist); /* Check internal consistency */ /* (Pre-condition) */ @@ -978,8 +978,8 @@ H5SL_insert(H5SL_t *slist, void *item, const void *key) FUNC_ENTER_NOAPI_NOINIT /* Check args */ - assert(slist); - assert(key); + HDassert(slist); + HDassert(key); /* Check internal consistency */ /* (Pre-condition) */ @@ -1025,8 +1025,8 @@ H5SL_add(H5SL_t *slist, void *item, const void *key) FUNC_ENTER_NOAPI_NOINIT /* Check args */ - assert(slist); - assert(key); + HDassert(slist); + HDassert(key); /* Check internal consistency */ /* (Pre-condition) */ @@ -1252,8 +1252,8 @@ H5SL_search(H5SL_t *slist, const void *key) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ - assert(slist); - assert(key); + HDassert(slist); + HDassert(key); /* Check internal consistency */ /* (Pre-condition) */ @@ -1341,8 +1341,8 @@ H5SL_less(H5SL_t *slist, const void *key) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ - assert(slist); - assert(key); + HDassert(slist); + HDassert(key); /* Check internal consistency */ /* (Pre-condition) */ @@ -1535,8 +1535,8 @@ H5SL_find(H5SL_t *slist, const void *key) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ - assert(slist); - assert(key); + HDassert(slist); + HDassert(key); /* Check internal consistency */ /* (Pre-condition) */ @@ -1806,7 +1806,7 @@ H5SL_first(H5SL_t *slist) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ - assert(slist); + HDassert(slist); /* Check internal consistency */ /* (Pre-condition) */ @@ -1840,7 +1840,7 @@ H5SL_next(H5SL_node_t *slist_node) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ - assert(slist_node); + HDassert(slist_node); /* Check internal consistency */ /* (Pre-condition) */ @@ -1874,7 +1874,7 @@ H5SL_prev(H5SL_node_t *slist_node) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ - assert(slist_node); + HDassert(slist_node); /* Check internal consistency */ /* (Pre-condition) */ @@ -1909,7 +1909,7 @@ H5SL_last(H5SL_t *slist) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ - assert(slist); + HDassert(slist); /* Check internal consistency */ /* (Pre-condition) */ @@ -1943,7 +1943,7 @@ H5SL_item(H5SL_node_t *slist_node) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ - assert(slist_node); + HDassert(slist_node); /* Check internal consistency */ /* (Pre-condition) */ @@ -2040,7 +2040,7 @@ H5SL_release(H5SL_t *slist) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ - assert(slist); + HDassert(slist); /* Check internal consistency */ /* (Pre-condition) */ @@ -2086,7 +2086,7 @@ H5SL_free(H5SL_t *slist, H5SL_operator_t op, void *op_data) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ - assert(slist); + HDassert(slist); /* Check internal consistency */ /* (Pre-condition) */ @@ -2132,7 +2132,7 @@ H5SL_destroy(H5SL_t *slist, H5SL_operator_t op, void *op_data) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ - assert(slist); + HDassert(slist); /* Check internal consistency */ /* (Pre-condition) */ @@ -2169,7 +2169,7 @@ H5SL_close(H5SL_t *slist) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ - assert(slist); + HDassert(slist); /* Check internal consistency */ /* (Pre-condition) */ diff --git a/src/H5Sall.c b/src/H5Sall.c index 8d56c80..19d1efc 100644 --- a/src/H5Sall.c +++ b/src/H5Sall.c @@ -118,8 +118,8 @@ H5S_all_iter_init (H5S_sel_iter_t *iter, const H5S_t *space) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ - assert (space && H5S_SEL_ALL==H5S_GET_SELECT_TYPE(space)); - assert (iter); + HDassert (space && H5S_SEL_ALL==H5S_GET_SELECT_TYPE(space)); + HDassert (iter); /* Initialize the number of elements to iterate over */ iter->elmt_left=H5S_GET_SELECT_NPOINTS(space); @@ -158,8 +158,8 @@ H5S_all_iter_coords (const H5S_sel_iter_t *iter, hsize_t *coords) FUNC_ENTER_NOAPI_NOINIT /* Check args */ - assert (iter); - assert (coords); + HDassert (iter); + HDassert (coords); /* Calculate the coordinates for the current iterator offset */ if(H5V_array_calc(iter->u.all.elmt_offset,iter->rank,iter->dims,coords)<0) @@ -193,9 +193,9 @@ H5S_all_iter_block (const H5S_sel_iter_t *iter, hsize_t *start, hsize_t *end) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ - assert (iter); - assert (start); - assert (end); + HDassert (iter); + HDassert (start); + HDassert (end); for(u=0; u<iter->rank; u++) { /* Set the start of the 'all' block */ @@ -231,7 +231,7 @@ H5S_all_iter_nelmts (const H5S_sel_iter_t *iter) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ - assert (iter); + HDassert (iter); FUNC_LEAVE_NOAPI(iter->elmt_left) } /* H5S_all_iter_nelmts() */ @@ -260,7 +260,7 @@ H5S_all_iter_has_next_block (const H5S_sel_iter_t UNUSED *iter) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ - assert (iter); + HDassert (iter); FUNC_LEAVE_NOAPI(FALSE) } /* H5S_all_iter_has_next_block() */ @@ -290,8 +290,8 @@ H5S_all_iter_next(H5S_sel_iter_t *iter, size_t nelem) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ - assert (iter); - assert (nelem>0); + HDassert (iter); + HDassert (nelem>0); /* Increment the iterator */ iter->u.all.elmt_offset+=nelem; @@ -324,7 +324,7 @@ H5S_all_iter_next_block(H5S_sel_iter_t UNUSED *iter) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ - assert (iter); + HDassert (iter); FUNC_LEAVE_NOAPI(FAIL) } /* H5S_all_iter_next_block() */ @@ -353,7 +353,7 @@ H5S_all_iter_release (H5S_sel_iter_t UNUSED * iter) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ - assert (iter); + HDassert (iter); FUNC_LEAVE_NOAPI(SUCCEED) } /* H5S_all_iter_release() */ @@ -450,7 +450,7 @@ H5S_all_is_valid (const H5S_t UNUSED *space) { FUNC_ENTER_NOAPI_NOINIT_NOERR - assert(space); + HDassert(space); FUNC_LEAVE_NOAPI(TRUE) } /* end H5S_all_is_valid() */ @@ -480,7 +480,7 @@ H5S_all_serial_size (const H5S_t UNUSED *space) { FUNC_ENTER_NOAPI_NOINIT_NOERR - assert(space); + HDassert(space); /* Basic number of bytes required to serialize point selection: * <type (4 bytes)> + <version (4 bytes)> + <padding (4 bytes)> + @@ -514,7 +514,7 @@ H5S_all_serialize (const H5S_t *space, uint8_t *buf) { FUNC_ENTER_NOAPI_NOINIT_NOERR - assert(space); + HDassert(space); /* Store the preamble information */ UINT32ENCODE(buf, (uint32_t)H5S_GET_SELECT_TYPE(space)); /* Store the type of selection */ @@ -671,7 +671,7 @@ H5S_all_is_contiguous(const H5S_t UNUSED *space) { FUNC_ENTER_NOAPI_NOINIT_NOERR - assert(space); + HDassert(space); FUNC_LEAVE_NOAPI(TRUE) } /* H5S_all_is_contiguous() */ @@ -700,7 +700,7 @@ H5S_all_is_single(const H5S_t UNUSED *space) { FUNC_ENTER_NOAPI_NOINIT_NOERR - assert(space); + HDassert(space); FUNC_LEAVE_NOAPI(TRUE) } /* H5S_all_is_single() */ @@ -731,7 +731,7 @@ H5S_all_is_regular(const H5S_t UNUSED *space) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ - assert(space); + HDassert(space); FUNC_LEAVE_NOAPI(TRUE) } /* H5S_all_is_regular() */ @@ -955,14 +955,14 @@ H5S_all_get_seq_list(const H5S_t UNUSED *space, unsigned UNUSED flags, H5S_sel_i FUNC_ENTER_NOAPI_NOINIT_NOERR /* 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(maxseq>0); + HDassert(maxelem>0); + HDassert(nseq); + HDassert(nelem); + HDassert(off); + HDassert(len); /* Determine the actual number of elements to use */ H5_CHECK_OVERFLOW(iter->elmt_left,hsize_t,size_t); diff --git a/src/H5Sselect.c b/src/H5Sselect.c index 6cfa2de..028eac2 100644 --- a/src/H5Sselect.c +++ b/src/H5Sselect.c @@ -112,8 +112,8 @@ H5S_select_copy (H5S_t *dst, const H5S_t *src, hbool_t share_selection) FUNC_ENTER_NOAPI(FAIL) /* Check args */ - assert(dst); - assert(src); + HDassert(dst); + HDassert(src); /* Copy regular fields */ dst->select=src->select; @@ -152,7 +152,7 @@ H5S_select_release(H5S_t *ds) FUNC_ENTER_NOAPI_NOINIT_NOERR - assert(ds); + HDassert(ds); /* Call the selection type's release function */ ret_value=(*ds->select.type->release)(ds); @@ -224,7 +224,7 @@ H5S_select_serial_size(const H5S_t *space) FUNC_ENTER_NOAPI_NOINIT_NOERR - assert(space); + HDassert(space); /* Call the selection type's serial_size function */ ret_value=(*space->select.type->serial_size)(space); @@ -262,8 +262,8 @@ H5S_select_serialize(const H5S_t *space, uint8_t *buf) FUNC_ENTER_NOAPI_NOINIT_NOERR - assert(space); - assert(buf); + HDassert(space); + HDassert(buf); /* Call the selection type's serialize function */ ret_value=(*space->select.type->serialize)(space,buf); @@ -413,7 +413,7 @@ H5S_select_valid(const H5S_t *space) FUNC_ENTER_NOAPI_NOINIT_NOERR - assert(space); + HDassert(space); ret_value = (*space->select.type->is_valid)(space); @@ -452,7 +452,7 @@ H5S_select_deserialize (H5S_t *space, const uint8_t *buf) FUNC_ENTER_NOAPI(FAIL) - assert(space); + HDassert(space); tbuf=buf; UINT32DECODE(tbuf, sel_type); @@ -571,9 +571,9 @@ H5S_get_select_bounds(const H5S_t *space, hsize_t *start, hsize_t *end) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ - assert(space); - assert(start); - assert(end); + HDassert(space); + HDassert(start); + HDassert(end); ret_value = (*space->select.type->bounds)(space,start,end); @@ -650,7 +650,7 @@ H5S_select_is_contiguous(const H5S_t *space) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ - assert(space); + HDassert(space); ret_value = (*space->select.type->is_contiguous)(space); @@ -687,7 +687,7 @@ H5S_select_is_single(const H5S_t *space) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ - assert(space); + HDassert(space); ret_value = (*space->select.type->is_single)(space); @@ -724,7 +724,7 @@ H5S_select_is_regular(const H5S_t *space) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ - assert(space); + HDassert(space); ret_value = (*space->select.type->is_regular)(space); @@ -929,8 +929,8 @@ H5S_select_iter_coords (const H5S_sel_iter_t *sel_iter, hsize_t *coords) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ - assert(sel_iter); - assert(coords); + HDassert(sel_iter); + HDassert(coords); /* Call iter_coords routine for selection type */ ret_value = (*sel_iter->type->iter_coords)(sel_iter,coords); @@ -971,9 +971,9 @@ H5S_select_iter_block (const H5S_sel_iter_t *iter, hsize_t *start, hsize_t *end) FUNC_ENTER_NOAPI_NOINIT_NOINIT_NOERR /* Check args */ - assert(iter); - assert(start); - assert(end); + HDassert(iter); + HDassert(start); + HDassert(end); /* Call iter_block routine for selection type */ ret_value = (*iter->type->iter_block)(iter,start,end); @@ -1011,7 +1011,7 @@ H5S_select_iter_nelmts (const H5S_sel_iter_t *sel_iter) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ - assert(sel_iter); + HDassert(sel_iter); /* Call iter_nelmts routine for selection type */ ret_value = (*sel_iter->type->iter_nelmts)(sel_iter); @@ -1050,7 +1050,7 @@ H5S_select_iter_has_next_block (const H5S_sel_iter_t *iter) FUNC_ENTER_NOAPI_NOINIT_NOINIT_NOERR /* Check args */ - assert(iter); + HDassert(iter); /* Call iter_has_next_block routine for selection type */ ret_value = (*iter->type->iter_has_next_block)(iter); @@ -1090,8 +1090,8 @@ H5S_select_iter_next(H5S_sel_iter_t *iter, size_t nelem) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ - assert(iter); - assert(nelem>0); + HDassert(iter); + HDassert(nelem>0); /* Call iter_next routine for selection type */ ret_value = (*iter->type->iter_next)(iter,nelem); @@ -1135,7 +1135,7 @@ H5S_select_iter_next_block(H5S_sel_iter_t *iter) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ - assert(iter); + HDassert(iter); /* Call iter_next_block routine for selection type */ ret_value = (*iter->type->iter_next_block)(iter); @@ -1173,7 +1173,7 @@ H5S_select_iter_release(H5S_sel_iter_t *sel_iter) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ - assert(sel_iter); + HDassert(sel_iter); /* Call selection type-specific release routine */ ret_value = (*sel_iter->type->iter_release)(sel_iter); @@ -1387,7 +1387,7 @@ H5S_get_select_type(const H5S_t *space) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ - assert(space); + HDassert(space); /* Set return value */ ret_value=H5S_GET_SELECT_TYPE(space); @@ -1351,7 +1351,7 @@ H5T_init_interface(void) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to register conversion function(s)") /* ========== Datatype Creation Property Class Initialization ============*/ - assert(H5P_CLS_DATATYPE_CREATE_g!=-1); + HDassert(H5P_CLS_DATATYPE_CREATE_g!=-1); /* Get the pointer to group creation class */ if(NULL == (crt_pclass = (H5P_genclass_t *)H5I_object(H5P_CLS_DATATYPE_CREATE_g))) @@ -1926,7 +1926,7 @@ H5T_get_class(const H5T_t *dt, htri_t internal) FUNC_ENTER_NOAPI(H5T_NO_CLASS) - assert(dt); + HDassert(dt); /* Externally, a VL string is a string; internally, a VL string is a VL. */ if(internal) { @@ -2283,7 +2283,7 @@ H5T_get_super(const H5T_t *dt) FUNC_ENTER_NOAPI(NULL) - assert(dt); + HDassert(dt); if (!dt->shared->parent) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "not a derived data type"); @@ -2331,11 +2331,11 @@ H5T_register(H5T_pers_t pers, const char *name, H5T_t *src, H5T_t *dst, FUNC_ENTER_NOAPI_NOINIT /* Check args */ - assert(src); - assert(dst); - assert(func); - assert(H5T_PERS_HARD==pers || H5T_PERS_SOFT==pers); - assert(name && *name); + HDassert(src); + HDassert(dst); + HDassert(func); + HDassert(H5T_PERS_HARD==pers || H5T_PERS_SOFT==pers); + HDassert(name && *name); if(H5T_PERS_HARD == pers) { /* Only bother to register the path if it's not a no-op path (for this machine) */ @@ -2381,7 +2381,7 @@ H5T_register(H5T_pers_t pers, const char *name, H5T_t *src, H5T_t *dst, */ for (i=1; i<H5T_g.npaths; i++) { old_path = H5T_g.path[i]; - assert(old_path); + HDassert(old_path); /* Does the new soft conversion function apply to this path? */ if (old_path->is_hard || @@ -3449,7 +3449,7 @@ H5T_lock (H5T_t *dt, hbool_t immutable) FUNC_ENTER_NOAPI(FAIL) - assert (dt); + HDassert (dt); switch (dt->shared->state) { case H5T_STATE_TRANSIENT: @@ -3724,10 +3724,10 @@ H5T_set_size(H5T_t *dt, size_t size) FUNC_ENTER_NOAPI_NOINIT /* Check args */ - assert(dt); - assert(size!=0); - assert(H5T_REFERENCE!=dt->shared->type); - assert(!(H5T_ENUM==dt->shared->type && 0==dt->shared->u.enumer.nmembs)); + HDassert(dt); + HDassert(size!=0); + HDassert(H5T_REFERENCE!=dt->shared->type); + HDassert(!(H5T_ENUM==dt->shared->type && 0==dt->shared->u.enumer.nmembs)); if (dt->shared->parent) { if (H5T_set_size(dt->shared->parent, size)<0) @@ -3856,12 +3856,12 @@ H5T_set_size(H5T_t *dt, size_t size) case H5T_VLEN: case H5T_ARRAY: case H5T_REFERENCE: - assert("can't happen" && 0); + HDassert("can't happen" && 0); case H5T_NO_CLASS: case H5T_NCLASSES: - assert("invalid type" && 0); + HDassert("invalid type" && 0); default: - assert("not implemented yet" && 0); + HDassert("not implemented yet" && 0); } /* Commit (if we didn't convert this type to a VL string) */ @@ -3908,7 +3908,7 @@ H5T_get_size(const H5T_t *dt) FUNC_ENTER_NOAPI_NOINIT_NOERR /* check args */ - assert(dt); + HDassert(dt); FUNC_LEAVE_NOAPI(dt->shared->size) } @@ -4014,9 +4014,9 @@ H5T_cmp(const H5T_t *dt1, const H5T_t *dt2, hbool_t superset) #ifdef H5T_DEBUG /* I don't quite trust the code above yet :-) --RPM */ for (u=0; u<dt1->shared->u.compnd.nmembs-1; u++) { - assert(HDstrcmp(dt1->shared->u.compnd.memb[idx1[u]].name, + HDassert(HDstrcmp(dt1->shared->u.compnd.memb[idx1[u]].name, dt1->shared->u.compnd.memb[idx1[u + 1]].name)); - assert(HDstrcmp(dt2->shared->u.compnd.memb[idx2[u]].name, + HDassert(HDstrcmp(dt2->shared->u.compnd.memb[idx2[u]].name, dt2->shared->u.compnd.memb[idx2[u + 1]].name)); } #endif @@ -4094,9 +4094,9 @@ H5T_cmp(const H5T_t *dt1, const H5T_t *dt2, hbool_t superset) #ifdef H5T_DEBUG /* I don't quite trust the code above yet :-) --RPM */ for (u=0; u<dt1->shared->u.enumer.nmembs-1; u++) { - assert(HDstrcmp(dt1->shared->u.enumer.name[idx1[u]], + HDassert(HDstrcmp(dt1->shared->u.enumer.name[idx1[u]], dt1->shared->u.enumer.name[idx1[u+1]])); - assert(HDstrcmp(dt2->shared->u.enumer.name[idx2[u]], + HDassert(HDstrcmp(dt2->shared->u.enumer.name[idx2[u]], dt2->shared->u.enumer.name[idx2[u+1]])); } #endif @@ -4152,10 +4152,10 @@ H5T_cmp(const H5T_t *dt1, const H5T_t *dt2, hbool_t superset) break; case H5T_VLEN: - assert(dt1->shared->u.vlen.type>H5T_VLEN_BADTYPE && dt1->shared->u.vlen.type<H5T_VLEN_MAXTYPE); - assert(dt2->shared->u.vlen.type>H5T_VLEN_BADTYPE && dt2->shared->u.vlen.type<H5T_VLEN_MAXTYPE); - assert(dt1->shared->u.vlen.loc>=H5T_LOC_BADLOC && dt1->shared->u.vlen.loc<H5T_LOC_MAXLOC); - assert(dt2->shared->u.vlen.loc>=H5T_LOC_BADLOC && dt2->shared->u.vlen.loc<H5T_LOC_MAXLOC); + HDassert(dt1->shared->u.vlen.type>H5T_VLEN_BADTYPE && dt1->shared->u.vlen.type<H5T_VLEN_MAXTYPE); + HDassert(dt2->shared->u.vlen.type>H5T_VLEN_BADTYPE && dt2->shared->u.vlen.type<H5T_VLEN_MAXTYPE); + HDassert(dt1->shared->u.vlen.loc>=H5T_LOC_BADLOC && dt1->shared->u.vlen.loc<H5T_LOC_MAXLOC); + HDassert(dt2->shared->u.vlen.loc>=H5T_LOC_BADLOC && dt2->shared->u.vlen.loc<H5T_LOC_MAXLOC); /* Arbitrarily sort sequence VL datatypes before string VL datatypes */ if (dt1->shared->u.vlen.type==H5T_VLEN_SEQUENCE && @@ -4315,14 +4315,14 @@ H5T_cmp(const H5T_t *dt1, const H5T_t *dt2, hbool_t superset) case H5R_BADTYPE: case H5R_MAXTYPE: - assert("invalid type" && 0); + HDassert("invalid type" && 0); default: - assert("not implemented yet" && 0); + HDassert("not implemented yet" && 0); } break; default: - assert("not implemented yet" && 0); + HDassert("not implemented yet" && 0); } break; } /* end switch */ @@ -4648,7 +4648,7 @@ H5T_path_noop(const H5T_path_t *p) { FUNC_ENTER_NOAPI_NOINIT_NOERR - assert(p); + HDassert(p); FUNC_LEAVE_NOAPI(p->is_noop || (p->is_hard && 0==H5T_cmp(p->src, p->dst, FALSE))) } /* end H5T_path_noop() */ @@ -4717,7 +4717,7 @@ H5T_path_bkg(const H5T_path_t *p) { FUNC_ENTER_NOAPI_NOINIT_NOERR - assert(p); + HDassert(p); FUNC_LEAVE_NOAPI(p->cdata.need_bkg) } /* end H5T_path_bkg() */ @@ -4933,7 +4933,7 @@ H5T_is_immutable(const H5T_t *dt) FUNC_ENTER_NOAPI(FAIL) - assert(dt); + HDassert(dt); if(dt->shared->state == H5T_STATE_IMMUTABLE) ret_value = TRUE; @@ -4966,7 +4966,7 @@ H5T_is_named(const H5T_t *dt) FUNC_ENTER_NOAPI(FAIL) - assert(dt); + HDassert(dt); if(dt->shared->state == H5T_STATE_OPEN || dt->shared->state == H5T_STATE_NAMED) ret_value = TRUE; @@ -5003,7 +5003,7 @@ H5T_get_ref_type(const H5T_t *dt) FUNC_ENTER_NOAPI(H5R_BADTYPE) - assert(dt); + HDassert(dt); if(dt->shared->type==H5T_REFERENCE) ret_value=dt->shared->u.atomic.u.r.rtype; @@ -5037,7 +5037,7 @@ H5T_is_sensible(const H5T_t *dt) FUNC_ENTER_NOAPI(FAIL) - assert(dt); + HDassert(dt); switch(dt->shared->type) { case H5T_COMPOUND: @@ -5102,8 +5102,8 @@ H5T_set_loc(H5T_t *dt, H5F_t *f, H5T_loc_t loc) FUNC_ENTER_NOAPI(FAIL) - assert(dt); - assert(loc>=H5T_LOC_BADLOC && loc<H5T_LOC_MAXLOC); + HDassert(dt); + HDassert(loc>=H5T_LOC_BADLOC && loc<H5T_LOC_MAXLOC); /* Datatypes can't change in size if the force_conv flag is not set */ if(dt->shared->force_conv) { diff --git a/src/H5Tcommit.c b/src/H5Tcommit.c index 4ec668a..4b305ef 100644 --- a/src/H5Tcommit.c +++ b/src/H5Tcommit.c @@ -684,19 +684,20 @@ H5Tget_create_plist(hid_t dtype_id) /* Retrieve further information, if the datatype is committed */ if(status > 0) { - H5P_genplist_t *new_plist; /* New datatype creation property list */ + H5VL_t *vol_plugin; /* VOL plugin information */ + + /* get the plugin pointer */ + if (NULL == (vol_plugin = (H5VL_t *)H5I_get_aux(dtype_id))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "ID does not contain VOL information") /* get the named datatype object */ if(NULL == (type = (H5T_t *)H5VL_get_object(dtype_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid file identifier") - /* Get property list object for new TCPL */ - if(NULL == (new_plist = (H5P_genplist_t *)H5I_object(new_tcpl_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "can't get property list") - - /* Retrieve any object creation properties */ - if(H5O_get_create_plist(&type->oloc, H5AC_ind_dxpl_id, new_plist) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTGET, FAIL, "can't get object creation info") + /* get the rest of the plist through the VOL */ + if(H5VL_datatype_get(type, vol_plugin, H5VL_DATATYPE_GET_TCPL, + H5AC_dxpl_id, H5_EVENT_QUEUE_NULL, new_tcpl_id) < 0) + HGOTO_ERROR(H5E_INTERNAL, H5E_CANTGET, FAIL, "unable to get datatype") } /* end if */ /* Set the return value */ @@ -914,14 +915,47 @@ H5T_update_shared(H5T_t *dt) /*------------------------------------------------------------------------- + * Function: H5Tget_named_type + * + * Purpose: returns the VOL object or the named datatype structure + * if it exists. This is the public wrapper for H5T_get_named_type. + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Mohamad Chaarawi + * June 2013 + * + *------------------------------------------------------------------------- + */ +herr_t +H5Tget_vol_named_type(hid_t type_id, void **dt_obj) +{ + H5T_t *type; /* datatype for operation */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_API(FAIL) + H5TRACE2("e", "i**x", type_id, dt_obj); + + /* Check arguments */ + if(NULL == (type = (H5T_t *)H5I_object_verify(type_id, H5I_DATATYPE))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype") + + *dt_obj = H5T_get_named_type(type); + +done: + FUNC_LEAVE_API(ret_value) +} /* end H5Tget_named_type() */ + + +/*------------------------------------------------------------------------- * Function: H5T_get_named_type * * Purpose: returns the VOL object or the named datatype structure * if it exists * - * Return: Success: Non-negative + * Return: Success: Pointer to the VOL Datatype object * - * Failure: Negative + * Failure: NULL * * Programmer: Mohamad Chaarawi * June 2012 diff --git a/src/H5Tconv.c b/src/H5Tconv.c index 4e5d1f0..c6cba52 100644 --- a/src/H5Tconv.c +++ b/src/H5Tconv.c @@ -189,7 +189,7 @@ * to the destination. SLU - 2005/06/29 */ #define H5T_CONV_Xx_CORE(S,D,ST,DT,D_MIN,D_MAX) { \ - if (*(S) > (DT)(D_MAX)) { \ + if (*(S) > (ST)(D_MAX)) { \ H5T_conv_ret_t except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_HI, \ src_id, dst_id, S, D, cb_struct.user_data); \ if(except_ret == H5T_CONV_UNHANDLED) \ @@ -198,7 +198,7 @@ else if(except_ret == H5T_CONV_ABORT) \ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "can't handle conversion exception") \ /* if(except_ret==H5T_CONV_HANDLED): Fall through, user handled it */ \ - } else if (*(S) < (DT)(D_MIN)) { \ + } else if (*(S) < (ST)(D_MIN)) { \ H5T_conv_ret_t except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_LOW, \ src_id, dst_id, S, D, cb_struct.user_data); \ if(except_ret == H5T_CONV_UNHANDLED) \ @@ -211,16 +211,16 @@ *(D) = (DT)(*(S)); \ } #define H5T_CONV_Xx_NOEX_CORE(S,D,ST,DT,D_MIN,D_MAX) { \ - if (*(S) > (DT)(D_MAX)) { \ + if (*(S) > (ST)(D_MAX)) { \ *(D) = (DT)(D_MAX); \ - } else if (*(S) < (DT)(D_MIN)) { \ + } else if (*(S) < (ST)(D_MIN)) { \ *(D) = (DT)(D_MIN); \ } else \ *(D) = (DT)(*(S)); \ } #define H5T_CONV_Ux_CORE(S,D,ST,DT,D_MIN,D_MAX) { \ - if (*(S) > (DT)(D_MAX)) { \ + if (*(S) > (ST)(D_MAX)) { \ H5T_conv_ret_t except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_HI, \ src_id, dst_id, S, D, cb_struct.user_data); \ if(except_ret == H5T_CONV_UNHANDLED) \ @@ -233,7 +233,7 @@ *(D) = (DT)(*(S)); \ } #define H5T_CONV_Ux_NOEX_CORE(S,D,ST,DT,D_MIN,D_MAX) { \ - if (*(S) > (DT)(D_MAX)) { \ + if (*(S) > (ST)(D_MAX)) { \ *(D) = (DT)(D_MAX); \ } else \ *(D) = (DT)(*(S)); \ @@ -241,7 +241,7 @@ #define H5T_CONV_sS(STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \ HDcompile_assert(sizeof(ST)<=sizeof(DT)); \ - H5T_CONV(H5T_CONV_xX, STYPE, DTYPE, ST, DT, D_MIN, D_MAX) \ + H5T_CONV(H5T_CONV_xX, STYPE, DTYPE, ST, DT, D_MIN, D_MAX, N) \ } #define H5T_CONV_sU_CORE(S,D,ST,DT,D_MIN,D_MAX) { \ @@ -266,7 +266,7 @@ #define H5T_CONV_sU(STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \ HDcompile_assert(sizeof(ST)<=sizeof(DT)); \ - H5T_CONV(H5T_CONV_sU, STYPE, DTYPE, ST, DT, D_MIN, D_MAX) \ + H5T_CONV(H5T_CONV_sU, STYPE, DTYPE, ST, DT, D_MIN, D_MAX, N) \ } #define H5T_CONV_uS_CORE(S,D,ST,DT,D_MIN,D_MAX) { \ @@ -283,7 +283,7 @@ *(D) = (DT)(*(S)); \ } #define H5T_CONV_uS_NOEX_CORE(S,D,ST,DT,D_MIN,D_MAX) { \ - if (sizeof(ST)==sizeof(DT) && *(S) > (D_MAX)) { \ + if (sizeof(ST)==sizeof(DT) && *(S) > (DT)(D_MAX)) { \ *(D) = (D_MAX); \ } else \ *(D) = (DT)(*(S)); \ @@ -291,17 +291,17 @@ #define H5T_CONV_uS(STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \ HDcompile_assert(sizeof(ST)<=sizeof(DT)); \ - H5T_CONV(H5T_CONV_uS, STYPE, DTYPE, ST, DT, D_MIN, D_MAX) \ + H5T_CONV(H5T_CONV_uS, STYPE, DTYPE, ST, DT, D_MIN, D_MAX, N) \ } #define H5T_CONV_uU(STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \ HDcompile_assert(sizeof(ST)<=sizeof(DT)); \ - H5T_CONV(H5T_CONV_xX, STYPE, DTYPE, ST, DT, D_MIN, D_MAX) \ + H5T_CONV(H5T_CONV_xX, STYPE, DTYPE, ST, DT, D_MIN, D_MAX, N) \ } #define H5T_CONV_Ss(STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \ HDcompile_assert(sizeof(ST)>=sizeof(DT)); \ - H5T_CONV(H5T_CONV_Xx, STYPE, DTYPE, ST, DT, D_MIN, D_MAX) \ + H5T_CONV(H5T_CONV_Xx, STYPE, DTYPE, ST, DT, D_MIN, D_MAX, N) \ } #define H5T_CONV_Su_CORE(S,D,ST,DT,D_MIN,D_MAX) { \ @@ -314,7 +314,7 @@ else if(except_ret == H5T_CONV_ABORT) \ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "can't handle conversion exception") \ /* if(except_ret==H5T_CONV_HANDLED): Fall through, user handled it */ \ - } else if (sizeof(ST)>sizeof(DT) && *(S) > (DT)(D_MAX)) { \ + } else if (sizeof(ST)>sizeof(DT) && *(S) > (ST)(D_MAX)) { \ H5T_conv_ret_t except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_HI, \ src_id, dst_id, S, D, cb_struct.user_data); \ if(except_ret == H5T_CONV_UNHANDLED) \ @@ -329,7 +329,7 @@ #define H5T_CONV_Su_NOEX_CORE(S,D,ST,DT,D_MIN,D_MAX) { \ if(*(S) < 0) \ *(D) = 0; \ - else if (sizeof(ST)>sizeof(DT) && *(S) > (DT)(D_MAX)) \ + else if (sizeof(ST)>sizeof(DT) && *(S) > (ST)(D_MAX)) \ *(D) = (DT)(D_MAX); \ else \ *(D) = (DT)(*(S)); \ @@ -337,17 +337,17 @@ #define H5T_CONV_Su(STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \ HDcompile_assert(sizeof(ST)>=sizeof(DT)); \ - H5T_CONV(H5T_CONV_Su, STYPE, DTYPE, ST, DT, D_MIN, D_MAX) \ + H5T_CONV(H5T_CONV_Su, STYPE, DTYPE, ST, DT, D_MIN, D_MAX, N) \ } #define H5T_CONV_Us(STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \ HDcompile_assert(sizeof(ST)>=sizeof(DT)); \ - H5T_CONV(H5T_CONV_Ux, STYPE, DTYPE, ST, DT, D_MIN, D_MAX) \ + H5T_CONV(H5T_CONV_Ux, STYPE, DTYPE, ST, DT, D_MIN, D_MAX, N) \ } #define H5T_CONV_Uu(STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \ HDcompile_assert(sizeof(ST)>=sizeof(DT)); \ - H5T_CONV(H5T_CONV_Ux, STYPE, DTYPE, ST, DT, D_MIN, D_MAX) \ + H5T_CONV(H5T_CONV_Ux, STYPE, DTYPE, ST, DT, D_MIN, D_MAX, N) \ } #define H5T_CONV_su_CORE(S,D,ST,DT,D_MIN,D_MAX) { \ @@ -374,12 +374,12 @@ #define H5T_CONV_su(STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \ HDcompile_assert(sizeof(ST)==sizeof(DT)); \ - H5T_CONV(H5T_CONV_su, STYPE, DTYPE, ST, DT, D_MIN, D_MAX) \ + H5T_CONV(H5T_CONV_su, STYPE, DTYPE, ST, DT, D_MIN, D_MAX, N) \ } #define H5T_CONV_us_CORE(S,D,ST,DT,D_MIN,D_MAX) { \ /* Assumes memory format of unsigned & signed integers is same */ \ - if (*(S) > (DT)(D_MAX)) { \ + if (*(S) > (ST)(D_MAX)) { \ H5T_conv_ret_t except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_HI, \ src_id, dst_id, S, D, cb_struct.user_data); \ if(except_ret == H5T_CONV_UNHANDLED) \ @@ -393,7 +393,7 @@ } #define H5T_CONV_us_NOEX_CORE(S,D,ST,DT,D_MIN,D_MAX) { \ /* Assumes memory format of unsigned & signed integers is same */ \ - if(*(S) > (DT)(D_MAX)) \ + if(*(S) > (ST)(D_MAX)) \ *(D) = (DT)(D_MAX); \ else \ *(D) = (DT)(*(S)); \ @@ -401,19 +401,19 @@ #define H5T_CONV_us(STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \ HDcompile_assert(sizeof(ST)==sizeof(DT)); \ - H5T_CONV(H5T_CONV_us, STYPE, DTYPE, ST, DT, D_MIN, D_MAX) \ + H5T_CONV(H5T_CONV_us, STYPE, DTYPE, ST, DT, D_MIN, D_MAX, N) \ } #define H5T_CONV_fF(STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \ HDcompile_assert(sizeof(ST)<=sizeof(DT)); \ - H5T_CONV(H5T_CONV_xX, STYPE, DTYPE, ST, DT, D_MIN, D_MAX) \ + H5T_CONV(H5T_CONV_xX, STYPE, DTYPE, ST, DT, D_MIN, D_MAX, N) \ } /* Same as H5T_CONV_Xx_CORE, except that instead of using D_MAX and D_MIN * when an overflow occurs, use the 'float' infinity values. */ #define H5T_CONV_Ff_CORE(S,D,ST,DT,D_MIN,D_MAX) { \ - if(*(S) > (DT)(D_MAX)) { \ + if(*(S) > (ST)(D_MAX)) { \ H5T_conv_ret_t except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_HI, \ src_id, dst_id, S, D, cb_struct.user_data); \ if(except_ret == H5T_CONV_UNHANDLED) \ @@ -422,7 +422,7 @@ else if(except_ret == H5T_CONV_ABORT) \ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "can't handle conversion exception") \ /* if(except_ret==H5T_CONV_HANDLED): Fall through, user handled it */ \ - } else if (*(S) < (DT)(D_MIN)) { \ + } else if (*(S) < (ST)(D_MIN)) { \ H5T_conv_ret_t except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_LOW, \ src_id, dst_id, S, D, cb_struct.user_data); \ if(except_ret == H5T_CONV_UNHANDLED) \ @@ -435,9 +435,9 @@ *(D) = (DT)(*(S)); \ } #define H5T_CONV_Ff_NOEX_CORE(S,D,ST,DT,D_MIN,D_MAX) { \ - if(*(S) > (DT)(D_MAX)) \ + if(*(S) > (ST)(D_MAX)) \ *(D) = (H5T_NATIVE_FLOAT_POS_INF_g); \ - else if (*(S) < (DT)(D_MIN)) \ + else if (*(S) < (ST)(D_MIN)) \ *(D) = (H5T_NATIVE_FLOAT_NEG_INF_g); \ else \ *(D) = (DT)(*(S)); \ @@ -445,7 +445,7 @@ #define H5T_CONV_Ff(STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \ HDcompile_assert(sizeof(ST)>=sizeof(DT)); \ - H5T_CONV(H5T_CONV_Ff, STYPE, DTYPE, ST, DT, D_MIN, D_MAX) \ + H5T_CONV(H5T_CONV_Ff, STYPE, DTYPE, ST, DT, D_MIN, D_MAX, N) \ } #define H5T_HI_LO_BIT_SET(TYP, V, LO, HI) { \ @@ -455,8 +455,8 @@ \ count = 0; \ for(u = 0; u < sizeof(TYP); u++) { \ - count = ((sizeof(TYP) - 1) - u) * 8; \ - p = ((V) >> count) & 0xff; \ + count = (((unsigned)sizeof(TYP) - 1) - u) * 8; \ + p = (unsigned char)((V) >> count); \ if(p > 0) { \ if(p & 0x80) \ count += 7; \ @@ -480,7 +480,7 @@ \ count = 0; \ for(u = 0; u < sizeof(TYP); u++) { \ - p = ((V) >> (u * 8)) & 0xff; \ + p = (unsigned char)((V) >> (u * 8)); \ if(p > 0) { \ count = u * 8; \ \ @@ -536,7 +536,7 @@ } #define H5T_CONV_xF(STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \ - H5T_CONV(H5T_CONV_xF, STYPE, DTYPE, ST, DT, D_MIN, D_MAX) \ + H5T_CONV(H5T_CONV_xF, STYPE, DTYPE, ST, DT, D_MIN, D_MAX, Y) \ } /* Quincey added the condition branch (else if (*(S) != (ST)((DT)(*(S))))). @@ -544,11 +544,11 @@ * of "INT_MAX". Compilers do roundup making this value "INT_MAX+1". This branch * is to check that situation and return exception for some compilers, mainly GCC. * The branch if (*(S) > (DT)(D_MAX) || (sprec < dprec && *(S) == - * (DT)(D_MAX))) is for some compilers like Sun, HP, IBM, and SGI where under + * (ST)(D_MAX))) is for some compilers like Sun, HP, IBM, and SGI where under * the same situation the "int" doesn't overflow. SLU - 2005/9/12 */ #define H5T_CONV_Fx_CORE(S,D,ST,DT,D_MIN,D_MAX) { \ - if(*(S) > (DT)(D_MAX) || (sprec < dprec && *(S) == (DT)(D_MAX))) { \ + if(*(S) > (ST)(D_MAX) || (sprec < dprec && *(S) == (ST)(D_MAX))) { \ H5T_conv_ret_t except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_HI, \ src_id, dst_id, S, D, cb_struct.user_data); \ if(except_ret == H5T_CONV_UNHANDLED) \ @@ -557,7 +557,7 @@ else if(except_ret == H5T_CONV_ABORT) \ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "can't handle conversion exception") \ /* if(except_ret==H5T_CONV_HANDLED): Fall through, user handled it */ \ - } else if (*(S) < (DT)(D_MIN)) { \ + } else if (*(S) < (ST)(D_MIN)) { \ H5T_conv_ret_t except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_LOW, \ src_id, dst_id, S, D, cb_struct.user_data); \ if(except_ret == H5T_CONV_UNHANDLED) \ @@ -580,28 +580,31 @@ *(D) = (DT)(*(S)); \ } #define H5T_CONV_Fx_NOEX_CORE(S,D,ST,DT,D_MIN,D_MAX) { \ - if(*(S) > (DT)(D_MAX)) \ + if(*(S) > (ST)(D_MAX)) \ *(D) = (DT)(D_MAX); \ - else if(*(S) < (DT)(D_MIN)) \ + else if(*(S) < (ST)(D_MIN)) \ *(D) = (DT)(D_MIN); \ else \ *(D) = (DT)(*(S)); \ } #define H5T_CONV_Fx(STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \ - H5T_CONV(H5T_CONV_Fx, STYPE, DTYPE, ST, DT, D_MIN, D_MAX) \ + H5T_CONV(H5T_CONV_Fx, STYPE, DTYPE, ST, DT, D_MIN, D_MAX, Y) \ } /* Since all "no exception" cores do the same thing (assign the value in the * source location to the destination location, using casting), use one "core" * to do them all. */ +#ifndef H5_WANT_DCONV_EXCEPTION #define H5T_CONV_NO_EXCEPT_CORE(S,D,ST,DT,D_MIN,D_MAX) { \ *(D) = (DT)(*(S)); \ } +#endif /* H5_WANT_DCONV_EXCEPTION */ + /* The main part of every integer hardware conversion macro */ -#define H5T_CONV(GUTS,STYPE,DTYPE,ST,DT,D_MIN,D_MAX) \ +#define H5T_CONV(GUTS,STYPE,DTYPE,ST,DT,D_MIN,D_MAX,PREC) \ { \ herr_t ret_value=SUCCEED; /* Return value */ \ \ @@ -609,13 +612,11 @@ \ { \ size_t elmtno; /*element number */ \ - size_t sprec; /*source precision */ \ - size_t dprec; /*destination precision */ \ + H5T_CONV_DECL_PREC(PREC) /*declare precision variables, or not */ \ uint8_t *src_buf; /*'raw' source buffer */ \ uint8_t *dst_buf; /*'raw' destination buffer */ \ ST *src, *s; /*source buffer */ \ DT *dst, *d; /*destination buffer */ \ - H5T_class_t tclass; /*datatype's class */ \ H5T_t *st, *dt; /*datatype descriptors */ \ ST src_aligned; /*source aligned type */ \ DT dst_aligned; /*destination aligned type */ \ @@ -647,8 +648,8 @@ case H5T_CONV_CONV: \ /* Initialize source & destination strides */ \ if (buf_stride) { \ - assert(buf_stride>=sizeof(ST)); \ - assert(buf_stride>=sizeof(DT)); \ + HDassert(buf_stride >= sizeof(ST)); \ + HDassert(buf_stride >= sizeof(DT)); \ s_stride = d_stride = (ssize_t)buf_stride; \ } else { \ s_stride = sizeof(ST); \ @@ -659,11 +660,11 @@ s_mv = H5T_NATIVE_##STYPE##_ALIGN_g>1 && \ ((size_t)buf%H5T_NATIVE_##STYPE##_ALIGN_g || \ /* Cray */ ((size_t)((ST*)buf)!=(size_t)buf) || \ - s_stride%H5T_NATIVE_##STYPE##_ALIGN_g); \ + (size_t)s_stride%H5T_NATIVE_##STYPE##_ALIGN_g); \ d_mv = H5T_NATIVE_##DTYPE##_ALIGN_g>1 && \ ((size_t)buf%H5T_NATIVE_##DTYPE##_ALIGN_g || \ /* Cray */ ((size_t)((DT*)buf)!=(size_t)buf) || \ - d_stride%H5T_NATIVE_##DTYPE##_ALIGN_g); \ + (size_t)d_stride%H5T_NATIVE_##DTYPE##_ALIGN_g); \ CI_INC_SRC(s_mv) \ CI_INC_DST(d_mv) \ \ @@ -679,19 +680,7 @@ if (NULL==(st=(H5T_t*)H5I_object_verify(src_id, H5I_DATATYPE)) || NULL==(dt=(H5T_t*)H5I_object_verify(dst_id, H5I_DATATYPE))) \ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to dereference datatype object ID") \ \ - /* Get source & destination precisions into a variable */ \ - tclass = st->shared->type; \ - HDassert(tclass == H5T_INTEGER || tclass == H5T_FLOAT); \ - if(tclass == H5T_INTEGER) \ - sprec = st->shared->u.atomic.prec; \ - else \ - sprec = 1 + st->shared->u.atomic.u.f.msize; \ - tclass = dt->shared->type; \ - HDassert(tclass == H5T_INTEGER || tclass == H5T_FLOAT); \ - if(tclass == H5T_INTEGER) \ - dprec = dt->shared->u.atomic.prec; \ - else \ - dprec = 1 + dt->shared->u.atomic.u.f.msize; \ + H5T_CONV_SET_PREC(PREC) /*init precision variables, or not */ \ \ /* The outer loop of the type conversion macro, controlling which */ \ /* direction the buffer is walked */ \ @@ -701,21 +690,21 @@ /* Compute the number of "safe" destination elements at */ \ /* the end of the buffer (Those which don't overlap with */ \ /* any source elements at the beginning of the buffer) */ \ - safe=nelmts-(((nelmts*s_stride)+(d_stride-1))/d_stride); \ + safe = nelmts - (((nelmts * (size_t)s_stride) + (size_t)(d_stride - 1)) / (size_t)d_stride); \ \ /* If we're down to the last few elements, just wrap up */ \ /* with a "real" reverse copy */ \ if(safe<2) { \ - src = (ST *)(src_buf = (uint8_t*)buf+(nelmts-1)*s_stride); \ - dst = (DT *)(dst_buf = (uint8_t*)buf+(nelmts-1)*d_stride); \ + src = (ST *)(src_buf = (uint8_t *)buf + (nelmts - 1) * (size_t)s_stride); \ + dst = (DT *)(dst_buf = (uint8_t *)buf + (nelmts - 1) * (size_t)d_stride); \ s_stride = -s_stride; \ d_stride = -d_stride; \ \ safe=nelmts; \ } /* end if */ \ else { \ - src = (ST *)(src_buf = (uint8_t*)buf+(nelmts-safe)*s_stride); \ - dst = (DT *)(dst_buf = (uint8_t*)buf+(nelmts-safe)*d_stride); \ + src = (ST *)(src_buf = (uint8_t *)buf + (nelmts - safe) * (size_t)s_stride); \ + dst = (DT *)(dst_buf = (uint8_t *)buf + (nelmts - safe) * (size_t)d_stride); \ } /* end else */ \ } /* end if */ \ else { \ @@ -757,6 +746,36 @@ done: \ FUNC_LEAVE_NOAPI(ret_value) \ } +/* Declare the source & destination precision variables */ +#define H5T_CONV_DECL_PREC(PREC) H5_GLUE(H5T_CONV_DECL_PREC_, PREC) + +#define H5T_CONV_DECL_PREC_Y \ + size_t sprec; /*source precision */ \ + size_t dprec; /*destination precision */ \ + H5T_class_t tclass; /*datatype's class */ + +#define H5T_CONV_DECL_PREC_N /*no precision variables */ + +/* Initialize the source & destination precision variables */ +#define H5T_CONV_SET_PREC(PREC) H5_GLUE(H5T_CONV_SET_PREC_, PREC) + +#define H5T_CONV_SET_PREC_Y \ + /* Get source & destination precisions into a variable */ \ + tclass = st->shared->type; \ + HDassert(tclass == H5T_INTEGER || tclass == H5T_FLOAT); \ + if(tclass == H5T_INTEGER) \ + sprec = st->shared->u.atomic.prec; \ + else \ + sprec = 1 + st->shared->u.atomic.u.f.msize; \ + tclass = dt->shared->type; \ + HDassert(tclass == H5T_INTEGER || tclass == H5T_FLOAT); \ + if(tclass == H5T_INTEGER) \ + dprec = dt->shared->u.atomic.prec; \ + else \ + dprec = 1 + dt->shared->u.atomic.u.f.msize; + +#define H5T_CONV_SET_PREC_N /*don't init precision variables */ + /* Macro defining action on source data which needs to be aligned (before main action) */ #define H5T_CONV_LOOP_PRE_SALIGN(ST) { \ HDmemcpy(&src_aligned, src, sizeof(ST)); \ @@ -903,7 +922,7 @@ typedef struct H5T_conv_struct_t { /* Conversion data for H5T__conv_enum() */ typedef struct H5T_enum_struct_t { int base; /*lowest `in' value */ - int length; /*num elements in arrays */ + unsigned length; /*num elements in arrays */ int *src2dst; /*map from src to dst index */ } H5T_enum_struct_t; @@ -1085,6 +1104,15 @@ H5T__conv_order_opt(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, HGOTO_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, FAIL, "conversion not supported") break; + case H5T_NO_CLASS: + case H5T_TIME: + case H5T_STRING: + case H5T_OPAQUE: + case H5T_COMPOUND: + case H5T_ENUM: + case H5T_VLEN: + case H5T_ARRAY: + case H5T_NCLASSES: default: HGOTO_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, FAIL, "conversion not supported") } @@ -1402,6 +1430,9 @@ H5T__conv_order_opt(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, H5_SWAP_BYTES(buf, 7, 8); } /* end for */ break; + + default: + HGOTO_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, FAIL, "invalid conversion size") } /* end switch */ break; @@ -1487,6 +1518,16 @@ H5T__conv_order(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, } /* end if */ break; + case H5T_NO_CLASS: + case H5T_TIME: + case H5T_STRING: + case H5T_OPAQUE: + case H5T_COMPOUND: + case H5T_REFERENCE: + case H5T_ENUM: + case H5T_VLEN: + case H5T_ARRAY: + case H5T_NCLASSES: default: HGOTO_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, FAIL, "conversion not supported") } /* end switch */ @@ -1543,7 +1584,7 @@ H5T__conv_b_b(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, { uint8_t *buf = (uint8_t*)_buf; H5T_t *src = NULL, *dst = NULL; /*source and dest datatypes */ - int direction; /*direction of traversal */ + ssize_t direction; /*direction of traversal */ size_t elmtno; /*element number */ size_t olap; /*num overlapping elements */ size_t half_size; /*1/2 of total size for swapping*/ @@ -1620,6 +1661,9 @@ H5T__conv_b_b(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, src_rev = (uint8_t *)H5MM_calloc(src->shared->size); /* The conversion loop */ + H5_CHECK_OVERFLOW(buf_stride, size_t, ssize_t); + H5_CHECK_OVERFLOW(src->shared->size, size_t, ssize_t); + H5_CHECK_OVERFLOW(dst->shared->size, size_t, ssize_t); for(elmtno = 0; elmtno < nelmts; elmtno++) { /* @@ -1703,6 +1747,9 @@ H5T__conv_b_b(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, H5T__bit_set(d, (size_t)0, dst->shared->u.atomic.offset, TRUE); break; + case H5T_PAD_ERROR: + case H5T_PAD_BACKGROUND: + case H5T_NPAD: default: HGOTO_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, FAIL, "unsupported LSB padding") } /* end switch */ @@ -1715,6 +1762,10 @@ H5T__conv_b_b(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, case H5T_PAD_ONE: H5T__bit_set(d, msb_pad_offset, 8 * dst->shared->size - msb_pad_offset, TRUE); break; + + case H5T_PAD_ERROR: + case H5T_PAD_BACKGROUND: + case H5T_NPAD: default: HGOTO_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, FAIL, "unsupported MSB padding") } /* end switch */ @@ -1739,12 +1790,12 @@ H5T__conv_b_b(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, if(d == dbuf) HDmemcpy(dp, d, dst->shared->size); if(buf_stride) { - sp += direction * buf_stride; - dp += direction * buf_stride; + sp += direction * (ssize_t)buf_stride; /* Note that cast is checked with H5_CHECK_OVERFLOW, above */ + dp += direction * (ssize_t)buf_stride; /* Note that cast is checked with H5_CHECK_OVERFLOW, above */ } /* end if */ else { - sp += direction * src->shared->size; - dp += direction * dst->shared->size; + sp += direction * (ssize_t)src->shared->size; /* Note that cast is checked with H5_CHECK_OVERFLOW, above */ + dp += direction * (ssize_t)dst->shared->size; /* Note that cast is checked with H5_CHECK_OVERFLOW, above */ } /* end else */ } /* end for */ @@ -2062,20 +2113,6 @@ H5T__conv_struct_subset(const H5T_cdata_t *cdata) * Programmer: Robb Matzke * Thursday, January 22, 1998 * - * Modifications: - * Robb Matzke, 1999-06-16 - * Added support for non-zero strides. If BUF_STRIDE is - * non-zero then convert one value at each memory location - * advancing BUF_STRIDE bytes each time; otherwise assume - * both source and destination values are packed. - * - * Robb Matzke, 2000-05-17 - * Added the BKG_STRIDE argument to fix a design bug. If - * BUF_STRIDE and BKG_STRIDE are both non-zero then each - * data element converted will be placed temporarily at a - * multiple of BKG_STRIDE in the BKG buffer; otherwise the - * BKG buffer is assumed to be a packed array of destination - * datatype. *------------------------------------------------------------------------- */ herr_t @@ -2091,7 +2128,8 @@ H5T__conv_struct(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, H5T_cmemb_t *src_memb = NULL; /*source struct member descript.*/ H5T_cmemb_t *dst_memb = NULL; /*destination struct memb desc. */ size_t offset; /*byte offset wrt struct */ - size_t src_delta; /*source stride */ + ssize_t src_delta; /*source stride */ + ssize_t bkg_delta; /*background stride */ size_t elmtno; unsigned u; /*counters */ int i; /*counters */ @@ -2149,17 +2187,22 @@ H5T__conv_struct(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, * Direction of conversion and striding through background. */ if(buf_stride) { - src_delta = buf_stride; - if(!bkg_stride) - bkg_stride = dst->shared->size; + H5_ASSIGN_OVERFLOW(src_delta, buf_stride, size_t, ssize_t); + if(!bkg_stride) { + H5_ASSIGN_OVERFLOW(bkg_delta, dst->shared->size, size_t, ssize_t); + } /* end if */ + else + H5_ASSIGN_OVERFLOW(bkg_delta, bkg_stride, size_t, ssize_t); } /* end if */ else if(dst->shared->size <= src->shared->size) { - src_delta = src->shared->size; - bkg_stride = dst->shared->size; + H5_ASSIGN_OVERFLOW(src_delta, src->shared->size, size_t, ssize_t); + H5_ASSIGN_OVERFLOW(bkg_delta, dst->shared->size, size_t, ssize_t); } /* end else-if */ else { - src_delta = -(int)src->shared->size; /*overflow shouldn't be possible*/ - bkg_stride = -(int)dst->shared->size; /*overflow shouldn't be possible*/ + H5_CHECK_OVERFLOW(src->shared->size, size_t, ssize_t); + src_delta = -(ssize_t)src->shared->size; + H5_CHECK_OVERFLOW(dst->shared->size, size_t, ssize_t); + bkg_delta = -(ssize_t)dst->shared->size; xbuf += (nelmts - 1) * src->shared->size; xbkg += (nelmts - 1) * dst->shared->size; } /* end else */ @@ -2204,7 +2247,8 @@ H5T__conv_struct(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, * yet). Then copy the member to the destination offset in the * background buffer. */ - for(i = src->shared->u.compnd.nmembs - 1; i >= 0; --i) { + H5_CHECK_OVERFLOW(src->shared->u.compnd.nmembs, size_t, int); + for(i = (int)src->shared->u.compnd.nmembs - 1; i >= 0; --i) { if(src2dst[i] < 0) continue; /*subsetting*/ src_memb = src->shared->u.compnd.memb + i; @@ -2229,12 +2273,12 @@ H5T__conv_struct(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, * Update pointers */ xbuf += src_delta; - xbkg += bkg_stride; + xbkg += bkg_delta; } /* end for */ - /* If the bkg_stride was set to -(dst->shared->size), make it positive now */ + /* If the bkg_delta was set to -(dst->shared->size), make it positive now */ if(buf_stride == 0 && dst->shared->size > src->shared->size) - bkg_stride = dst->shared->size; + H5_ASSIGN_OVERFLOW(bkg_delta, dst->shared->size, size_t, ssize_t); /* * Copy the background buffer back into the in-place conversion @@ -2243,7 +2287,7 @@ H5T__conv_struct(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, for(xbuf = buf, xbkg = bkg, elmtno = 0; elmtno < nelmts; elmtno++) { HDmemmove(xbuf, xbkg, dst->shared->size); xbuf += buf_stride ? buf_stride : dst->shared->size; - xbkg += bkg_stride; + xbkg += bkg_delta; } /* end for */ break; @@ -2390,7 +2434,8 @@ H5T__conv_struct_opt(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, if(dst_memb->size > src_memb->size) offset += src_memb->size; } /* end for */ - for(i = src->shared->u.compnd.nmembs - 1; i >= 0; --i) { + H5_CHECK_OVERFLOW(src->shared->u.compnd.nmembs, size_t, int); + for(i = (int)src->shared->u.compnd.nmembs - 1; i >= 0; --i) { if(src2dst[i] < 0) continue; src_memb = src->shared->u.compnd.memb + i; @@ -2509,7 +2554,8 @@ H5T__conv_struct_opt(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * is larger than the source) and them to their final position in the * bkg buffer. */ - for(i = src->shared->u.compnd.nmembs - 1; i >= 0; --i) { + H5_CHECK_OVERFLOW(src->shared->u.compnd.nmembs, size_t, int); + for(i = (int)src->shared->u.compnd.nmembs - 1; i >= 0; --i) { if(src2dst[i] < 0) continue; src_memb = src->shared->u.compnd.memb + i; @@ -2605,7 +2651,7 @@ H5T_conv_enum_init(H5T_t *src, H5T_t *dst, H5T_cdata_t *cdata) j++; if(j >= dst->shared->u.enumer.nmembs) HGOTO_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, FAIL, "source type is not a subset of destination type") - priv->src2dst[i] = j; + priv->src2dst[i] = (int)j; } /* end for */ /* @@ -2634,45 +2680,44 @@ H5T_conv_enum_init(H5T_t *src, H5T_t *dst, H5T_cdata_t *cdata) * Because this is the optimized code, we won't fix it. It should still work in some * situations. SLU - 2011/5/24) */ - if (1==src->shared->size || sizeof(short)==src->shared->size || sizeof(int)==src->shared->size) { - for (i=0; i<src->shared->u.enumer.nmembs; i++) { - if (1==src->shared->size) { - n = *((signed char*)(src->shared->u.enumer.value+i)); - } else if (sizeof(short)==src->shared->size) { - n = *((short*)(src->shared->u.enumer.value+i*src->shared->size)); - } else { - n = *((int*)(src->shared->u.enumer.value+i*src->shared->size)); - } - if (0==i) { + if(1 == src->shared->size || sizeof(short) == src->shared->size || sizeof(int) == src->shared->size) { + for(i = 0; i < src->shared->u.enumer.nmembs; i++) { + if(1 == src->shared->size) + n = *((signed char *)(src->shared->u.enumer.value + i)); + else if (sizeof(short) == src->shared->size) + n = *((short *)(src->shared->u.enumer.value + i * src->shared->size)); + else + n = *((int *)(src->shared->u.enumer.value + i * src->shared->size)); + if(0 == i) { domain[0] = domain[1] = n; } else { domain[0] = MIN(domain[0], n); domain[1] = MAX(domain[1], n); } - } + } /* end for */ - length = (domain[1]-domain[0])+1; - if (src->shared->u.enumer.nmembs<2 || - (double)length/src->shared->u.enumer.nmembs<1.2) { + HDassert(domain[1] >= domain[0]); + length = (unsigned)(domain[1] - domain[0]) + 1; + if(src->shared->u.enumer.nmembs < 2 || + (double)length / src->shared->u.enumer.nmembs < (double)(1.2f)) { priv->base = domain[0]; priv->length = length; - if (NULL==(map=(int *)H5MM_malloc(length*sizeof(int)))) + if(NULL == (map = (int *)H5MM_malloc(length * sizeof(int)))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed") - for (i=0; i<length; i++) + for(i = 0; i < length; i++) map[i] = -1; /*entry unused*/ - for (i=0; i<src->shared->u.enumer.nmembs; i++) { - if (1==src->shared->size) { - n = *((signed char*)(src->shared->u.enumer.value+i)); - } else if (sizeof(short)==src->shared->size) { - n = *((short*)(src->shared->u.enumer.value+i*src->shared->size)); - } else { - n = *((int*)(src->shared->u.enumer.value+i*src->shared->size)); - } + for(i = 0; i < src->shared->u.enumer.nmembs; i++) { + if(1 == src->shared->size) + n = *((signed char *)(src->shared->u.enumer.value + i)); + else if(sizeof(short) == src->shared->size) + n = *((short *)(src->shared->u.enumer.value + i * src->shared->size)); + else + n = *((int *)(src->shared->u.enumer.value + i * src->shared->size)); n -= priv->base; - assert(n>=0 && n<priv->length); - assert(map[n]<0); + HDassert(n >= 0 && (unsigned)n < priv->length); + HDassert(map[n] < 0); map[n] = priv->src2dst[i]; - } + } /* end for */ /* * Replace original src2dst array with our new one. The original @@ -2718,9 +2763,8 @@ H5T__conv_enum(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, { uint8_t *buf = (uint8_t*)_buf; /*cast for pointer arithmetic */ H5T_t *src = NULL, *dst = NULL; /*src and dst datatypes */ - H5T_t *src_super = NULL, *dst_super = NULL; /*parent types for src and dst*/ uint8_t *s = NULL, *d = NULL; /*src and dst BUF pointers */ - int src_delta, dst_delta; /*conversion strides */ + ssize_t src_delta, dst_delta; /*conversion strides */ int n; /*src value cast as native int */ H5T_enum_struct_t *priv = (H5T_enum_struct_t*)(cdata->priv); H5P_genplist_t *plist; /*property list pointer */ @@ -2785,17 +2829,20 @@ H5T__conv_enum(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, * Direction of conversion. */ if(buf_stride) { - src_delta = dst_delta = (int)buf_stride; + H5_CHECK_OVERFLOW(buf_stride, size_t, ssize_t); + src_delta = dst_delta = (ssize_t)buf_stride; s = d = buf; } else if(dst->shared->size <= src->shared->size) { - src_delta = (int)src->shared->size; /*overflow shouldn't be possible*/ - dst_delta = (int)dst->shared->size; /*overflow shouldn't be possible*/ + H5_ASSIGN_OVERFLOW(src_delta, src->shared->size, size_t, ssize_t); + H5_ASSIGN_OVERFLOW(dst_delta, dst->shared->size, size_t, ssize_t); s = d = buf; } else { - src_delta = -(int)src->shared->size; /*overflow shouldn't be possible*/ - dst_delta = -(int)dst->shared->size; /*overflow shouldn't be possible*/ - s = buf + (nelmts-1) * src->shared->size; - d = buf + (nelmts-1) * dst->shared->size; + H5_CHECK_OVERFLOW(src->shared->size, size_t, ssize_t); + H5_CHECK_OVERFLOW(dst->shared->size, size_t, ssize_t); + src_delta = -(ssize_t)src->shared->size; + dst_delta = -(ssize_t)dst->shared->size; + s = buf + (nelmts - 1) * src->shared->size; + d = buf + (nelmts - 1) * dst->shared->size; } /* Get the plist structure */ @@ -2822,28 +2869,29 @@ H5T__conv_enum(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, else n = *((int*)s); n -= priv->base; - if(n < 0 || n >= priv->length || priv->src2dst[n] < 0) { + if(n < 0 || (unsigned)n >= priv->length || priv->src2dst[n] < 0) { /*overflow*/ except_ret = H5T_CONV_UNHANDLED; - if(cb_struct.func) { /*If user's exception handler is present, use it*/ + /*If user's exception handler is present, use it*/ + if(cb_struct.func) except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_HI, src_id, dst_id, s, d, cb_struct.user_data); - } - if(except_ret == H5T_CONV_UNHANDLED) { + if(except_ret == H5T_CONV_UNHANDLED) HDmemset(d, 0xff, dst->shared->size); - } else if(except_ret == H5T_CONV_ABORT) + else if(except_ret == H5T_CONV_ABORT) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "can't handle conversion exception") - } else { + } else HDmemcpy(d, - dst->shared->u.enumer.value+priv->src2dst[n]*dst->shared->size, + dst->shared->u.enumer.value + (unsigned)priv->src2dst[n] * dst->shared->size, dst->shared->size); - } - } else { + } /* end if */ + else { /* Use O(log N) lookup */ - int lt = 0; - int rt = src->shared->u.enumer.nmembs; - int md, cmp; + unsigned lt = 0; + unsigned rt = src->shared->u.enumer.nmembs; + unsigned md; + int cmp; while(lt < rt) { md = (lt + rt) / 2; @@ -2858,22 +2906,23 @@ H5T__conv_enum(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, } /* end while */ if(lt >= rt) { except_ret = H5T_CONV_UNHANDLED; - if(cb_struct.func) { /*If user's exception handler is present, use it*/ + /*If user's exception handler is present, use it*/ + if(cb_struct.func) except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_HI, src_id, dst_id, src, d, cb_struct.user_data); - } - if(except_ret == H5T_CONV_UNHANDLED) { + if(except_ret == H5T_CONV_UNHANDLED) HDmemset(d, 0xff, dst->shared->size); - } else if(except_ret == H5T_CONV_ABORT) + else if(except_ret == H5T_CONV_ABORT) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "can't handle conversion exception") } /* end if */ else { + HDassert(priv->src2dst[md] >= 0); HDmemcpy(d, - dst->shared->u.enumer.value+priv->src2dst[md]*dst->shared->size, + dst->shared->u.enumer.value + (unsigned)priv->src2dst[md] * dst->shared->size, dst->shared->size); } /* end else */ - } + } /* end else */ } break; @@ -2906,7 +2955,7 @@ done: */ herr_t H5T__conv_enum_numeric(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, - size_t buf_stride, size_t UNUSED bkg_stride, void *_buf, + size_t UNUSED buf_stride, size_t UNUSED bkg_stride, void *_buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { H5T_t *src, *dst; /*src and dst datatypes */ @@ -3017,7 +3066,7 @@ H5T__conv_vlen(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, H5T_path_t *tpath = NULL; /* Type conversion path */ hbool_t noop_conv = FALSE; /* Flag to indicate a noop conversion */ hbool_t write_to_file = FALSE; /* Flag to indicate writing to file */ - hbool_t parent_is_vlen; /* Flag to indicate parent is vlen datatyp */ + htri_t parent_is_vlen; /* Flag to indicate parent is vlen datatyp */ hid_t tsrc_id = -1, tdst_id = -1;/*temporary type atoms */ H5T_t *src = NULL; /*source datatype */ H5T_t *dst = NULL; /*destination datatype */ @@ -3028,7 +3077,6 @@ H5T__conv_vlen(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, ssize_t s_stride, d_stride; /*src and dst strides */ ssize_t b_stride; /*bkg stride */ size_t safe; /*how many elements are safe to process in each pass */ - ssize_t seq_len; /*the number of elements in the current sequence*/ size_t bg_seq_len = 0; size_t src_base_size, dst_base_size;/*source & destination base size*/ void *conv_buf = NULL; /*temporary conversion buffer */ @@ -3116,12 +3164,13 @@ H5T__conv_vlen(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, noop_conv = TRUE; /* Check if we need a temporary buffer for this conversion */ - parent_is_vlen = H5T_detect_class(dst->shared->parent, H5T_VLEN, FALSE); + if((parent_is_vlen = H5T_detect_class(dst->shared->parent, H5T_VLEN, FALSE)) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_SYSTEM, FAIL, "internal error when detecting variable-length class") if(tpath->cdata.need_bkg || parent_is_vlen) { /* Set up initial background buffer */ tmp_buf_size = MAX(src_base_size, dst_base_size); if(NULL == (tmp_buf = H5FL_BLK_CALLOC(vlen_seq,tmp_buf_size))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for type conversion") + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "memory allocation failed for type conversion") } /* end if */ /* Get the allocation info */ @@ -3141,17 +3190,22 @@ H5T__conv_vlen(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, while(nelmts > 0) { /* Check if we need to go backwards through the buffer */ if(d_stride > s_stride) { + /* Sanity check */ + HDassert(s_stride > 0); + HDassert(d_stride > 0); + HDassert(b_stride >= 0); + /* Compute the number of "safe" destination elements at */ /* the end of the buffer (Those which don't overlap with */ /* any source elements at the beginning of the buffer) */ - safe = nelmts - (((nelmts * s_stride) + (d_stride - 1)) / d_stride); + safe = nelmts - (((nelmts * (size_t)s_stride) + ((size_t)d_stride - 1)) / (size_t)d_stride); /* If we're down to the last few elements, just wrap up */ /* with a "real" reverse copy */ if(safe < 2) { - s = (uint8_t *)buf + (nelmts - 1) * s_stride; - d = (uint8_t *)buf + (nelmts - 1) * d_stride; - b = (uint8_t *)bkg + (nelmts - 1) * b_stride; + s = (uint8_t *)buf + (nelmts - 1) * (size_t)s_stride; + d = (uint8_t *)buf + (nelmts - 1) * (size_t)d_stride; + b = (uint8_t *)bkg + (nelmts - 1) * (size_t)b_stride; s_stride = -s_stride; d_stride = -d_stride; b_stride = -b_stride; @@ -3159,9 +3213,9 @@ H5T__conv_vlen(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, safe = nelmts; } /* end if */ else { - s = (uint8_t *)buf + (nelmts - safe) * s_stride; - d = (uint8_t *)buf + (nelmts - safe) * d_stride; - b = (uint8_t *)bkg + (nelmts - safe) * b_stride; + s = (uint8_t *)buf + (nelmts - safe) * (size_t)s_stride; + d = (uint8_t *)buf + (nelmts - safe) * (size_t)d_stride; + b = (uint8_t *)bkg + (nelmts - safe) * (size_t)b_stride; } /* end else */ } /* end if */ else { @@ -3179,9 +3233,13 @@ H5T__conv_vlen(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, HGOTO_ERROR(H5E_DATATYPE, H5E_WRITEERROR, FAIL, "can't set VL data to 'nil'") } /* end if */ else { + ssize_t sseq_len; /* (signed) The number of elements in the current sequence*/ + size_t seq_len; /* The number of elements in the current sequence*/ + /* Get length of element sequences */ - if((seq_len = (*(src->shared->u.vlen.getlen))(s)) < 0) + if((sseq_len = (*(src->shared->u.vlen.getlen))(s)) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "incorrect length") + seq_len = (size_t)sseq_len; /* If we are reading from memory and there is no conversion, just get the pointer to sequence */ if(write_to_file && noop_conv) { @@ -3230,7 +3288,7 @@ H5T__conv_vlen(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, /* If we are writing and there is a nested VL type, read * the sequence into the background buffer */ if(nested) { - uint8_t *tmp = b; + const uint8_t *tmp = b; UINT32DECODE(tmp, bg_seq_len); if(bg_seq_len > 0) { @@ -3240,40 +3298,40 @@ H5T__conv_vlen(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for type conversion") HDmemset(tmp_buf, 0, tmp_buf_size); } /* end if */ - H5F_addr_decode(dst->shared->u.vlen.f, (const uint8_t **)&tmp, &(bg_hobjid.addr)); - INT32DECODE(tmp, bg_hobjid.idx); + H5F_addr_decode(dst->shared->u.vlen.f, &tmp, &(bg_hobjid.addr)); + UINT32DECODE(tmp, bg_hobjid.idx); if(NULL == H5HG_read(dst->shared->u.vlen.f, dxpl_id, &bg_hobjid, tmp_buf, NULL)) HGOTO_ERROR(H5E_DATATYPE, H5E_READERROR, FAIL, "can't read VL sequence into background buffer") } /* end if */ /* If the sequence gets shorter, pad out the original sequence with zeros */ - if((ssize_t)bg_seq_len < seq_len) + if(bg_seq_len < seq_len) HDmemset((uint8_t *)tmp_buf + dst_base_size * bg_seq_len, 0, (seq_len - bg_seq_len) * dst_base_size); } /* end if */ /* Convert VL sequence */ - if(H5T_convert(tpath, tsrc_id, tdst_id, (size_t)seq_len, (size_t)0, (size_t)0, conv_buf, tmp_buf, dxpl_id) < 0) + if(H5T_convert(tpath, tsrc_id, tdst_id, seq_len, (size_t)0, (size_t)0, conv_buf, tmp_buf, dxpl_id) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "datatype conversion failed") } /* end if */ /* Write sequence to destination location */ - if((*(dst->shared->u.vlen.write))(dst->shared->u.vlen.f, dxpl_id, vl_alloc_info, d, conv_buf, b, (size_t)seq_len, dst_base_size) < 0) + if((*(dst->shared->u.vlen.write))(dst->shared->u.vlen.f, dxpl_id, vl_alloc_info, d, conv_buf, b, seq_len, dst_base_size) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_WRITEERROR, FAIL, "can't write VL data") if(!noop_conv) { /* For nested VL case, free leftover heap objects from the deeper level if the length of new data elements is shorter than the old data elements.*/ - if(nested && seq_len < (ssize_t)bg_seq_len) { + if(nested && seq_len < bg_seq_len) { size_t parent_seq_len; - uint8_t *tmp_p; + const uint8_t *tmp; size_t u; /* TMP_P is reset each time in the loop because DST_BASE_SIZE may include some data in addition to VL info. - SLU */ for(u = seq_len; u < bg_seq_len; u++) { - tmp_p = (uint8_t*)tmp_buf + u * dst_base_size; - UINT32DECODE(tmp_p, parent_seq_len); + tmp = (uint8_t *)tmp_buf + u * dst_base_size; + UINT32DECODE(tmp, parent_seq_len); if(parent_seq_len > 0) { - H5F_addr_decode(dst->shared->u.vlen.f, (const uint8_t **)&tmp_p, &(parent_hobjid.addr)); - INT32DECODE(tmp_p, parent_hobjid.idx); + H5F_addr_decode(dst->shared->u.vlen.f, &tmp, &(parent_hobjid.addr)); + UINT32DECODE(tmp, parent_hobjid.idx); if(H5HG_remove(dst->shared->u.vlen.f, dxpl_id, &parent_hobjid) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_WRITEERROR, FAIL, "Unable to remove heap object") } /* end if */ @@ -3343,7 +3401,7 @@ H5T__conv_array(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, H5T_t *src = NULL; /*source datatype */ H5T_t *dst = NULL; /*destination datatype */ uint8_t *sp, *dp; /*source and dest traversal ptrs */ - size_t src_delta, dst_delta; /*source & destination stride */ + ssize_t src_delta, dst_delta; /*source & destination stride */ int direction; /*direction of traversal */ size_t elmtno; /*element number counter */ unsigned u; /* local index variable */ @@ -3408,8 +3466,11 @@ H5T__conv_array(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, /* * Direction & size of buffer traversal. */ - src_delta = direction * (buf_stride ? buf_stride : src->shared->size); - dst_delta = direction * (buf_stride ? buf_stride : dst->shared->size); + H5_CHECK_OVERFLOW(buf_stride, size_t, ssize_t); + H5_CHECK_OVERFLOW(src->shared->size, size_t, ssize_t); + H5_CHECK_OVERFLOW(dst->shared->size, size_t, ssize_t); + src_delta = (ssize_t)direction * (ssize_t)(buf_stride ? buf_stride : src->shared->size); + dst_delta = (ssize_t)direction * (ssize_t)(buf_stride ? buf_stride : dst->shared->size); /* Set up conversion path for base elements */ if(NULL == (tpath = H5T_path_find(src->shared->parent, dst->shared->parent, NULL, NULL, dxpl_id, FALSE))) { @@ -3499,6 +3560,7 @@ H5T__conv_i_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, { H5T_t *src = NULL; /*source datatype */ H5T_t *dst = NULL; /*destination datatype */ + ssize_t src_delta, dst_delta; /*source & destination stride */ int direction; /*direction of traversal */ size_t elmtno; /*element number */ size_t half_size; /*half the type size */ @@ -3565,6 +3627,15 @@ H5T__conv_i_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, direction = -1; } + /* + * Direction & size of buffer traversal. + */ + H5_CHECK_OVERFLOW(buf_stride, size_t, ssize_t); + H5_CHECK_OVERFLOW(src->shared->size, size_t, ssize_t); + H5_CHECK_OVERFLOW(dst->shared->size, size_t, ssize_t); + src_delta = (ssize_t)direction * (ssize_t)(buf_stride ? buf_stride : src->shared->size); + dst_delta = (ssize_t)direction * (ssize_t)(buf_stride ? buf_stride : dst->shared->size); + /* Get the plist structure */ if(NULL == (plist = H5P_object_verify(dxpl_id, H5P_DATASET_XFER))) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find property list for ID") @@ -3577,25 +3648,25 @@ H5T__conv_i_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, src_rev = (uint8_t*)H5MM_calloc(src->shared->size); /* The conversion loop */ - for (elmtno=0; elmtno<nelmts; elmtno++) { + for(elmtno = 0; elmtno < nelmts; elmtno++) { /* * If the source and destination buffers overlap then use a * temporary buffer for the destination. */ - if (direction>0) { + if(direction > 0) { s = sp; - d = elmtno<olap ? dbuf : dp; + d = elmtno < olap ? dbuf : dp; } else { s = sp; - d = elmtno+olap >= nelmts ? dbuf : dp; + d = elmtno + olap >= nelmts ? dbuf : dp; } #ifndef NDEBUG /* I don't quite trust the overlap calculations yet --rpm */ if (d==dbuf) { - assert ((dp>=sp && dp<sp+src->shared->size) || (sp>=dp && sp<dp+dst->shared->size)); + HDassert((dp>=sp && dp<sp+src->shared->size) || (sp>=dp && sp<dp+dst->shared->size)); } else { - assert ((dp<sp && dp+dst->shared->size<=sp) || (sp<dp && sp+src->shared->size<=dp)); + HDassert((dp<sp && dp+dst->shared->size<=sp) || (sp<dp && sp+src->shared->size<=dp)); } #endif @@ -3819,11 +3890,11 @@ H5T__conv_i_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, * Set padding areas in destination. */ if (dst->shared->u.atomic.offset>0) { - assert(H5T_PAD_ZERO==dst->shared->u.atomic.lsb_pad || H5T_PAD_ONE==dst->shared->u.atomic.lsb_pad); + HDassert(H5T_PAD_ZERO==dst->shared->u.atomic.lsb_pad || H5T_PAD_ONE==dst->shared->u.atomic.lsb_pad); H5T__bit_set(d, (size_t)0, dst->shared->u.atomic.offset, (hbool_t)(H5T_PAD_ONE==dst->shared->u.atomic.lsb_pad)); } if (dst->shared->u.atomic.offset+dst->shared->u.atomic.prec!=8*dst->shared->size) { - assert (H5T_PAD_ZERO==dst->shared->u.atomic.msb_pad || H5T_PAD_ONE==dst->shared->u.atomic.msb_pad); + HDassert(H5T_PAD_ZERO==dst->shared->u.atomic.msb_pad || H5T_PAD_ONE==dst->shared->u.atomic.msb_pad); H5T__bit_set (d, dst->shared->u.atomic.offset+dst->shared->u.atomic.prec, 8*dst->shared->size - (dst->shared->u.atomic.offset+ dst->shared->u.atomic.prec), (hbool_t)(H5T_PAD_ONE==dst->shared->u.atomic.msb_pad)); @@ -3846,16 +3917,13 @@ H5T__conv_i_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, * If we had used a temporary buffer for the destination then we * should copy the value to the true destination buffer. */ - if (d==dbuf) - HDmemcpy (dp, d, dst->shared->size); - if (buf_stride) { - sp += direction * buf_stride; - dp += direction * buf_stride; - } else { - sp += direction * src->shared->size; - dp += direction * dst->shared->size; - } - } + if(d==dbuf) + HDmemcpy(dp, d, dst->shared->size); + + /* Advance source & destination pointers by delta amounts */ + sp += src_delta; + dp += dst_delta; + } /* end for */ break; @@ -3911,6 +3979,7 @@ H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, H5T_t *dst_p; /*destination datatype */ H5T_atomic_t src; /*atomic source info */ H5T_atomic_t dst; /*atomic destination info */ + ssize_t src_delta, dst_delta; /*source & destination stride */ int direction; /*forward or backward traversal */ size_t elmtno; /*element number */ size_t half_size; /*half the type size */ @@ -3923,11 +3992,11 @@ H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, uint8_t tmp1, tmp2; /*temp variables for swapping bytes*/ /* Conversion-related variables */ - hssize_t expo; /*exponent */ + int64_t expo; /*exponent */ hssize_t expo_max; /*maximum possible dst exponent */ size_t msize = 0; /*useful size of mantissa in src*/ size_t mpos; /*offset to useful mant is src */ - hssize_t sign; /*source sign bit value */ + uint64_t sign; /*source sign bit value */ size_t mrsh; /*amount to right shift mantissa*/ hbool_t carry = 0; /*carry after rounding mantissa */ size_t i; /*miscellaneous counters */ @@ -3995,6 +4064,15 @@ H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, direction = -1; } + /* + * Direction & size of buffer traversal. + */ + H5_CHECK_OVERFLOW(buf_stride, size_t, ssize_t); + H5_CHECK_OVERFLOW(src_p->shared->size, size_t, ssize_t); + H5_CHECK_OVERFLOW(dst_p->shared->size, size_t, ssize_t); + src_delta = (ssize_t)direction * (ssize_t)(buf_stride ? buf_stride : src_p->shared->size); + dst_delta = (ssize_t)direction * (ssize_t)(buf_stride ? buf_stride : dst_p->shared->size); + /* Get the plist structure */ if(NULL == (plist = H5P_object_verify(dxpl_id,H5P_DATASET_XFER))) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find property list for ID") @@ -4026,10 +4104,10 @@ H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, #ifndef NDEBUG /* I don't quite trust the overlap calculations yet --rpm */ if (d==dbuf) { - assert ((dp>=sp && dp<sp+src_p->shared->size) || + HDassert((dp>=sp && dp<sp+src_p->shared->size) || (sp>=dp && sp<dp+dst_p->shared->size)); } else { - assert ((dp<sp && dp+dst_p->shared->size<=sp) || + HDassert((dp<sp && dp+dst_p->shared->size<=sp) || (sp<dp && sp+src_p->shared->size<=dp)); } #endif @@ -4048,7 +4126,7 @@ H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, } } else if (H5T_ORDER_VAX==src.order) { tsize = src_p->shared->size; - assert(0 == tsize % 2); + HDassert(0 == tsize % 2); for (i = 0; i < tsize; i += 4) { tmp1 = s[i]; @@ -4146,9 +4224,7 @@ H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "can't handle conversion exception") goto padding; -#ifdef H5_VMS - } /*Temporary solution to handle VAX special values*/ -#else /*H5_VMS*/ +#ifndef H5_VMS /*Temporary solution to handle VAX special values*/ } else if (H5T__bit_find (s, src.u.f.epos, src.u.f.esize, H5T_BIT_LSB, FALSE)<0) { /* NaN */ @@ -4173,15 +4249,15 @@ H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "can't handle conversion exception") goto padding; - } #endif /*H5_VMS*/ + } /* * Get the exponent as an unsigned quantity from the section of * the source bit field where it's located. Don't worry about * the exponent bias yet. */ - expo = H5T__bit_get_d(s, src.u.f.epos, src.u.f.esize); + expo = (int64_t)H5T__bit_get_d(s, src.u.f.epos, src.u.f.esize); if(expo==0) denormalized=TRUE; @@ -4193,10 +4269,9 @@ H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, implied = 1; mpos = src.u.f.mpos; mrsh = 0; - if (0==expo || H5T_NORM_NONE==src.u.f.norm) { - if ((bitno=H5T__bit_find(s, src.u.f.mpos, src.u.f.msize, - H5T_BIT_MSB, TRUE))>0) { - msize = bitno; + if(0 == expo || H5T_NORM_NONE == src.u.f.norm) { + if((bitno = H5T__bit_find(s, src.u.f.mpos, src.u.f.msize, H5T_BIT_MSB, TRUE)) > 0) { + msize = (size_t)bitno; } else if (0==bitno) { msize = 1; H5T__bit_set(s, src.u.f.mpos, (size_t)1, FALSE); @@ -4204,8 +4279,7 @@ H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, } else if (H5T_NORM_IMPLIED==src.u.f.norm) { msize = src.u.f.msize; } else { - assert("normalization method not implemented yet" && 0); - HDabort(); + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "normalization method not implemented yet") } /* @@ -4219,13 +4293,12 @@ H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, * the source exponent bias. */ if (0==expo || H5T_NORM_NONE==src.u.f.norm) { - assert(bitno>=0); - expo -= (src.u.f.ebias-1) + (src.u.f.msize-bitno); + HDassert(bitno>=0); + expo -= (int64_t)((src.u.f.ebias - 1) + (src.u.f.msize - (size_t)bitno)); } else if (H5T_NORM_IMPLIED==src.u.f.norm) { - expo -= src.u.f.ebias; + expo -= (int64_t)src.u.f.ebias; } else { - assert("normalization method not implemented yet" && 0); - HDabort(); + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "normalization method not implemented yet") } /* @@ -4240,7 +4313,7 @@ H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, * bias and clipping by the minimum and maximum possible * destination exponent values. */ - expo += dst.u.f.ebias; + expo += (int64_t)dst.u.f.ebias; if (expo < -(hssize_t)(dst.u.f.msize)) { /* The exponent is way too small. Result is zero. */ @@ -4254,7 +4327,7 @@ H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, * accomodate that value. The mantissa of course is no * longer normalized. */ - H5_ASSIGN_OVERFLOW(mrsh,(mrsh+1-expo),hssize_t,size_t); + mrsh += (size_t)(1 - expo); expo = 0; denormalized=TRUE; } else if (expo>=expo_max) { @@ -4293,20 +4366,20 @@ H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, * mantissa bit is `1', else it is `10' binary. */ if (msize>0 && mrsh<=dst.u.f.msize && mrsh+msize>dst.u.f.msize) { - bitno = (ssize_t)(mrsh+msize - dst.u.f.msize); - assert(bitno>=0 && (size_t)bitno<=msize); - /*If the 1st bit being cut off is set and source isn't denormalized.*/ - if(H5T__bit_get_d(s, (mpos + bitno) - 1, (size_t)1) && !denormalized) { - /*Don't do rounding if exponent is 111...110 and mantissa is 111...11. - *To do rounding and increment exponent in this case will create an infinity value.*/ - if((H5T__bit_find(s, mpos+bitno, msize-bitno, H5T_BIT_LSB, FALSE)>=0 || expo<expo_max-1)) { - carry = H5T__bit_inc(s, mpos+bitno-1, 1+msize-bitno); - if (carry) + bitno = (ssize_t)(mrsh + msize - dst.u.f.msize); + HDassert(bitno >= 0 && (size_t)bitno <= msize); + /* If the 1st bit being cut off is set and source isn't denormalized.*/ + if(H5T__bit_get_d(s, (mpos + (size_t)bitno) - 1, (size_t)1) && !denormalized) { + /* Don't do rounding if exponent is 111...110 and mantissa is 111...11. + * To do rounding and increment exponent in this case will create an infinity value.*/ + if((H5T__bit_find(s, mpos + (size_t)bitno, msize - (size_t)bitno, H5T_BIT_LSB, FALSE) >= 0 || expo < expo_max - 1)) { + carry = (hbool_t)H5T__bit_inc(s, mpos + (size_t)bitno - 1, 1 + msize - (size_t)bitno); + if(carry) implied = 2; } - } else if(H5T__bit_get_d(s, (mpos + bitno) - 1, (size_t)1) && denormalized) - /*For either source or destination, denormalized value doesn't increment carry.*/ - H5T__bit_inc(s, mpos+bitno-1, 1+msize-bitno); + } else if(H5T__bit_get_d(s, (mpos + (size_t)bitno) - 1, (size_t)1) && denormalized) + /* For either source or destination, denormalized value doesn't increment carry.*/ + H5T__bit_inc(s, mpos + (size_t)bitno - 1, 1 + msize - (size_t)bitno); } else carry=0; @@ -4383,11 +4456,11 @@ H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, * Set external padding areas */ if (dst.offset>0) { - assert (H5T_PAD_ZERO==dst.lsb_pad || H5T_PAD_ONE==dst.lsb_pad); + HDassert(H5T_PAD_ZERO==dst.lsb_pad || H5T_PAD_ONE==dst.lsb_pad); H5T__bit_set (d, (size_t)0, dst.offset, (hbool_t)(H5T_PAD_ONE==dst.lsb_pad)); } if (dst.offset+dst.prec!=8*dst_p->shared->size) { - assert (H5T_PAD_ZERO==dst.msb_pad || H5T_PAD_ONE==dst.msb_pad); + HDassert(H5T_PAD_ZERO==dst.msb_pad || H5T_PAD_ONE==dst.msb_pad); H5T__bit_set (d, dst.offset+dst.prec, 8*dst_p->shared->size - (dst.offset+dst.prec), (hbool_t)(H5T_PAD_ONE==dst.msb_pad)); } @@ -4405,7 +4478,7 @@ H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, } } else if (H5T_ORDER_VAX==dst.order && reverse) { tsize = dst_p->shared->size; - assert(0 == tsize % 2); + HDassert(0 == tsize % 2); for (i = 0; i < tsize; i += 4) { tmp1 = d[i]; @@ -4424,15 +4497,12 @@ H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, * should copy the value to the true destination buffer. */ next: - if (d==dbuf) - HDmemcpy (dp, d, dst_p->shared->size); - if (buf_stride) { - sp += direction * buf_stride; - dp += direction * buf_stride; - } else { - sp += direction * src_p->shared->size; - dp += direction * dst_p->shared->size; - } + if(d == dbuf) + HDmemcpy(dp, d, dst_p->shared->size); + + /* Advance source & destination pointers by delta amounts */ + sp += src_delta; + dp += dst_delta; } break; @@ -4478,7 +4548,8 @@ H5T__conv_s_s(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, { H5T_t *src=NULL; /*source datatype */ H5T_t *dst=NULL; /*destination datatype */ - int direction; /*direction of traversal */ + ssize_t src_delta, dst_delta; /*source & destination stride */ + int direction; /*direction of traversal */ size_t elmtno; /*element number */ size_t olap; /*num overlapping elements */ size_t nchars=0; /*number of characters copied */ @@ -4503,8 +4574,8 @@ H5T__conv_s_s(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, if((H5T_CSET_ASCII == src->shared->u.atomic.u.s.cset && H5T_CSET_UTF8 == dst->shared->u.atomic.u.s.cset) || (H5T_CSET_ASCII == dst->shared->u.atomic.u.s.cset && H5T_CSET_UTF8 == src->shared->u.atomic.u.s.cset)) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "The library doesn't convert between strings of ASCII and UTF") - if(src->shared->u.atomic.u.s.pad < 0 || src->shared->u.atomic.u.s.pad >= H5T_NPAD || - dst->shared->u.atomic.u.s.pad < 0 || dst->shared->u.atomic.u.s.pad >= H5T_NPAD) + if(src->shared->u.atomic.u.s.pad < 0 || src->shared->u.atomic.u.s.pad >= H5T_NSTR || + dst->shared->u.atomic.u.s.pad < 0 || dst->shared->u.atomic.u.s.pad >= H5T_NSTR) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "bad character padding") cdata->need_bkg = H5T_BKG_NO; break; @@ -4545,6 +4616,15 @@ H5T__conv_s_s(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, direction = -1; } + /* + * Direction & size of buffer traversal. + */ + H5_CHECK_OVERFLOW(buf_stride, size_t, ssize_t); + H5_CHECK_OVERFLOW(src->shared->size, size_t, ssize_t); + H5_CHECK_OVERFLOW(dst->shared->size, size_t, ssize_t); + src_delta = (ssize_t)direction * (ssize_t)(buf_stride ? buf_stride : src->shared->size); + dst_delta = (ssize_t)direction * (ssize_t)(buf_stride ? buf_stride : dst->shared->size); + /* Allocate the overlap buffer */ if(NULL == (dbuf = (uint8_t *)H5MM_malloc(dst->shared->size))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for string conversion") @@ -4566,12 +4646,12 @@ H5T__conv_s_s(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, #ifndef NDEBUG /* I don't quite trust the overlap calculations yet --rpm */ if (src->shared->size==dst->shared->size || buf_stride) { - assert(s==d); + HDassert(s==d); } else if (d==dbuf) { - assert((dp>=sp && dp<sp+src->shared->size) || + HDassert((dp>=sp && dp<sp+src->shared->size) || (sp>=dp && sp<dp+dst->shared->size)); } else { - assert((dp<sp && dp+dst->shared->size<=sp) || + HDassert((dp<sp && dp+dst->shared->size<=sp) || (sp<dp && sp+src->shared->size<=dp)); } #endif @@ -4617,6 +4697,7 @@ H5T__conv_s_s(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, case H5T_STR_RESERVED_14: case H5T_STR_RESERVED_15: case H5T_STR_ERROR: + default: HGOTO_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, FAIL, "source string padding method not supported") } /* end switch */ @@ -4652,6 +4733,7 @@ H5T__conv_s_s(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, case H5T_STR_RESERVED_14: case H5T_STR_RESERVED_15: case H5T_STR_ERROR: + default: HGOTO_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, FAIL, "destination string padding method not supported") } /* end switch */ @@ -4659,15 +4741,12 @@ H5T__conv_s_s(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, * If we used a temporary buffer for the destination then we * should copy the value to the true destination buffer. */ - if (d==dbuf) + if(d == dbuf) HDmemcpy(dp, d, dst->shared->size); - if (buf_stride) { - sp += direction * buf_stride; - dp += direction * buf_stride; - } else { - sp += direction * src->shared->size; - dp += direction * dst->shared->size; - } + + /* Advance source & destination pointers by delta amounts */ + sp += src_delta; + dp += dst_delta; } /* end for */ break; @@ -8871,10 +8950,10 @@ H5T__conv_f_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, #ifndef NDEBUG /* I don't quite trust the overlap calculations yet --rpm */ if (d==dbuf) { - assert ((dp>=sp && dp<sp+src_p->shared->size) || + HDassert((dp>=sp && dp<sp+src_p->shared->size) || (sp>=dp && sp<dp+dst_p->shared->size)); } else { - assert ((dp<sp && dp+dst_p->shared->size<=sp) || + HDassert((dp<sp && dp+dst_p->shared->size<=sp) || (sp<dp && sp+src_p->shared->size<=dp)); } #endif @@ -8892,7 +8971,7 @@ H5T__conv_f_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, } } else if (H5T_ORDER_VAX==src.order) { tsize = src_p->shared->size; - assert(0 == tsize % 2); + HDassert(0 == tsize % 2); for (i = 0; i < tsize; i += 4) { tmp1 = s[i]; @@ -9050,8 +9129,7 @@ H5T__conv_f_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, } else if (H5T_NORM_IMPLIED==src.u.f.norm) { expo -= src.u.f.ebias; } else { - assert("normalization method not implemented yet" && 0); - HDabort(); + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "normalization method not implemented yet") } /* @@ -9253,11 +9331,11 @@ H5T__conv_f_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, * Set padding areas in destination. */ if (dst.offset>0) { - assert (H5T_PAD_ZERO==dst.lsb_pad || H5T_PAD_ONE==dst.lsb_pad); + HDassert(H5T_PAD_ZERO==dst.lsb_pad || H5T_PAD_ONE==dst.lsb_pad); H5T__bit_set(d, (size_t)0, dst.offset, (hbool_t)(H5T_PAD_ONE==dst.lsb_pad)); } if (dst.offset+dst.prec!=8*dst_p->shared->size) { - assert (H5T_PAD_ZERO==dst.msb_pad || H5T_PAD_ONE==dst.msb_pad); + HDassert(H5T_PAD_ZERO==dst.msb_pad || H5T_PAD_ONE==dst.msb_pad); H5T__bit_set(d, dst.offset+dst.prec, 8*dst_p->shared->size - (dst.offset+ dst.prec), (hbool_t)(H5T_PAD_ONE==dst.msb_pad)); @@ -9467,10 +9545,10 @@ H5T__conv_i_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, #ifndef NDEBUG /* I don't quite trust the overlap calculations yet --rpm */ if (d==dbuf) { - assert ((dp>=sp && dp<sp+src_p->shared->size) || + HDassert((dp>=sp && dp<sp+src_p->shared->size) || (sp>=dp && sp<dp+dst_p->shared->size)); } else { - assert ((dp<sp && dp+dst_p->shared->size<=sp) || + HDassert((dp<sp && dp+dst_p->shared->size<=sp) || (sp<dp && sp+src_p->shared->size<=dp)); } #endif @@ -9556,8 +9634,7 @@ H5T__conv_i_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, if (H5T_NORM_NONE==dst.u.f.norm || H5T_NORM_IMPLIED==dst.u.f.norm) { expo = first + dst.u.f.ebias; } else { - assert("normalization method not implemented yet" && 0); - HDabort(); + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "normalization method not implemented yet") } /* Handle mantissa part here */ @@ -9637,7 +9714,7 @@ H5T__conv_i_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, /* Check if the exponent is too big */ - expo_max = (hsize_t)HDpow((double)2.0, (double)dst.u.f.esize) - 1; + expo_max = (hsize_t)HDpow((double)2.0f, (double)dst.u.f.esize) - 1; if(expo > expo_max) { /*overflows*/ if(cb_struct.func) { /*user's exception handler. Reverse back source order*/ @@ -9695,7 +9772,7 @@ H5T__conv_i_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, } } else if (H5T_ORDER_VAX==dst.order && reverse) { tsize = dst_p->shared->size; - assert(0 == tsize % 2); + HDassert(0 == tsize % 2); for (i = 0; i < tsize; i += 4) { tmp1 = d[i]; @@ -9770,8 +9847,8 @@ H5T_reverse_order(uint8_t *rev, uint8_t *s, size_t size, H5T_order_t order) FUNC_ENTER_NOAPI_NOINIT_NOERR - assert(s); - assert(size); + HDassert(s); + HDassert(size); if (H5T_ORDER_VAX == order) { for (i = 0; i < size; i += 2) { diff --git a/src/H5Tenum.c b/src/H5Tenum.c index 8e4e8a2..2b7563b 100644 --- a/src/H5Tenum.c +++ b/src/H5Tenum.c @@ -127,14 +127,14 @@ H5T__enum_create(const H5T_t *parent) FUNC_ENTER_PACKAGE - assert(parent); + HDassert(parent); /* Build new type */ if(NULL == (ret_value = H5T__alloc())) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") ret_value->shared->type = H5T_ENUM; ret_value->shared->parent = H5T_copy(parent, H5T_COPY_ALL); - assert(ret_value->shared->parent); + HDassert(ret_value->shared->parent); ret_value->shared->size = ret_value->shared->parent->shared->size; done: @@ -220,9 +220,9 @@ H5T__enum_insert(const H5T_t *dt, const char *name, const void *value) FUNC_ENTER_PACKAGE - assert(dt); - assert(name && *name); - assert(value); + HDassert(dt); + HDassert(name && *name); + HDassert(value); /* The name and value had better not already exist */ for (i=0; i<dt->shared->u.enumer.nmembs; i++) { @@ -322,8 +322,8 @@ H5T__get_member_value(const H5T_t *dt, unsigned membno, void *value/*out*/) { FUNC_ENTER_PACKAGE_NOERR - assert(dt); - assert(value); + HDassert(dt); + HDassert(value); HDmemcpy(value, dt->shared->u.enumer.value + membno*dt->shared->size, dt->shared->size); @@ -563,9 +563,9 @@ H5T_enum_valueof(const H5T_t *dt, const char *name, void *value/*out*/) FUNC_ENTER_NOAPI_NOINIT /* Check args */ - assert(dt && H5T_ENUM==dt->shared->type); - assert(name && *name); - assert(value); + HDassert(dt && H5T_ENUM==dt->shared->type); + HDassert(name && *name); + HDassert(value); /* Sanity check */ if (dt->shared->u.enumer.nmembs == 0) diff --git a/src/H5Tfields.c b/src/H5Tfields.c index 163bab3..0e0d4e7 100644 --- a/src/H5Tfields.c +++ b/src/H5Tfields.c @@ -202,7 +202,7 @@ H5T__get_member_name(H5T_t const *dt, unsigned membno) FUNC_ENTER_PACKAGE - assert(dt); + HDassert(dt); switch (dt->shared->type) { case H5T_COMPOUND: @@ -435,8 +435,8 @@ H5T__sort_name(const H5T_t *dt, int *map) FUNC_ENTER_PACKAGE_NOERR /* Check args */ - assert(dt); - assert(H5T_COMPOUND==dt->shared->type || H5T_ENUM==dt->shared->type); + HDassert(dt); + HDassert(H5T_COMPOUND==dt->shared->type || H5T_ENUM==dt->shared->type); /* Use a bubble sort because we can short circuit */ if (H5T_COMPOUND==dt->shared->type) { @@ -462,7 +462,7 @@ H5T__sort_name(const H5T_t *dt, int *map) #ifndef NDEBUG /* I never trust a sort :-) -RPM */ for (i=0; i<nmembs-1; i++) { - assert(HDstrcmp(dt->shared->u.compnd.memb[i].name, + HDassert(HDstrcmp(dt->shared->u.compnd.memb[i].name, dt->shared->u.compnd.memb[i+1].name)<0); } #endif @@ -472,7 +472,7 @@ H5T__sort_name(const H5T_t *dt, int *map) dt->shared->u.enumer.sorted = H5T_SORT_NAME; nmembs = dt->shared->u.enumer.nmembs; size = dt->shared->size; - assert(size<=sizeof(tbuf)); + HDassert(size<=sizeof(tbuf)); for (i=nmembs-1, swapped=TRUE; i>0 && swapped; --i) { for (j=0, swapped=FALSE; j<i; j++) { if (HDstrcmp(dt->shared->u.enumer.name[j], @@ -502,7 +502,7 @@ H5T__sort_name(const H5T_t *dt, int *map) #ifndef NDEBUG /* I never trust a sort :-) -RPM */ for (i=0; i<nmembs-1; i++) - assert(HDstrcmp(dt->shared->u.enumer.name[i], dt->shared->u.enumer.name[i+1])<0); + HDassert(HDstrcmp(dt->shared->u.enumer.name[i], dt->shared->u.enumer.name[i+1])<0); #endif } } diff --git a/src/H5Tfixed.c b/src/H5Tfixed.c index 51737eb..b2401d4 100644 --- a/src/H5Tfixed.c +++ b/src/H5Tfixed.c @@ -113,7 +113,7 @@ H5T_get_sign(H5T_t const *dt) FUNC_ENTER_NOAPI(H5T_SGN_ERROR) - assert(dt); + HDassert(dt); /* Defer to parent */ while(dt->shared->parent) diff --git a/src/H5Tnative.c b/src/H5Tnative.c index b9192f9..1a97f39 100644 --- a/src/H5Tnative.c +++ b/src/H5Tnative.c @@ -172,7 +172,7 @@ H5T_get_native_type(H5T_t *dtype, H5T_direction_t direction, size_t *struct_alig FUNC_ENTER_NOAPI(NULL) - assert(dtype); + HDassert(dtype); if(H5T_NO_CLASS == (h5_class = H5T_get_class(dtype, FALSE))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a valid class") @@ -355,6 +355,7 @@ H5T_get_native_type(H5T_t *dtype, H5T_direction_t direction, size_t *struct_alig case H5T_ENUM: { + H5T_path_t *tpath; /* Type conversion info */ hid_t super_type_id, nat_super_type_id; /* Don't need to do anything special for alignment, offset since the ENUM type usually is integer. */ @@ -380,6 +381,10 @@ H5T_get_native_type(H5T_t *dtype, H5T_direction_t direction, size_t *struct_alig if(NULL == (new_type = H5T__enum_create(nat_super_type))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "unable to create enum type") + /* Find the conversion function */ + if(NULL == (tpath = H5T_path_find(super_type, nat_super_type, NULL, NULL, H5P_DEFAULT, FALSE))) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, NULL, "unable to convert between src and dst data types") + /* Retrieve member info and insert members into new enum type */ if((snmemb = H5T_get_nmembers(dtype)) <= 0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "enumerate data type doesn't have any member") @@ -391,7 +396,7 @@ H5T_get_native_type(H5T_t *dtype, H5T_direction_t direction, size_t *struct_alig HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot get member value") HDmemcpy(memb_value, tmp_memb_value, H5T_get_size(super_type)); - if(H5Tconvert(super_type_id, nat_super_type_id, (size_t)1, memb_value, NULL, H5P_DEFAULT) < 0) + if(H5T_convert(tpath, super_type_id, nat_super_type_id, (size_t)1, (size_t)0, (size_t)0, memb_value, NULL, H5P_DEFAULT) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot get member value") if(H5T__enum_insert(new_type, memb_name, memb_value) < 0) @@ -402,10 +407,10 @@ H5T_get_native_type(H5T_t *dtype, H5T_direction_t direction, size_t *struct_alig tmp_memb_value = H5MM_xfree(tmp_memb_value); /* Close base type */ - if(H5Tclose(nat_super_type_id) < 0) + if(H5I_dec_app_ref(nat_super_type_id) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot close datatype") - /* Close super type */ - if(H5Tclose(super_type_id) < 0) + /* Close super type */ + if(H5I_dec_app_ref(super_type_id) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot close datatype") ret_value = new_type; @@ -571,19 +576,19 @@ H5T_get_native_integer(size_t prec, H5T_sign_t sign, H5T_direction_t direction, FUNC_ENTER_NOAPI(NULL) if(direction == H5T_DIR_DEFAULT || direction == H5T_DIR_ASCEND) { - if(prec <= H5Tget_precision(H5T_NATIVE_SCHAR)) { + if(prec <= H5T_get_precision((H5T_t *)H5I_object(H5T_NATIVE_SCHAR_g))) { match = H5T_NATIVE_INT_MATCH_CHAR; native_size = sizeof(char); - } else if(prec<=H5Tget_precision(H5T_NATIVE_SHORT)) { + } else if(prec<=H5T_get_precision((H5T_t *)H5I_object(H5T_NATIVE_SHORT_g))) { match = H5T_NATIVE_INT_MATCH_SHORT; native_size = sizeof(short); - } else if(prec<=H5Tget_precision(H5T_NATIVE_INT)) { + } else if(prec<=H5T_get_precision((H5T_t *)H5I_object(H5T_NATIVE_INT_g))) { match = H5T_NATIVE_INT_MATCH_INT; native_size = sizeof(int); - } else if(prec <= H5Tget_precision(H5T_NATIVE_LONG)) { + } else if(prec <= H5T_get_precision((H5T_t *)H5I_object(H5T_NATIVE_LONG_g))) { match = H5T_NATIVE_INT_MATCH_LONG; native_size = sizeof(long); - } else if(prec <= H5Tget_precision(H5T_NATIVE_LLONG)) { + } else if(prec <= H5T_get_precision((H5T_t *)H5I_object(H5T_NATIVE_LLONG_g))) { match = H5T_NATIVE_INT_MATCH_LLONG; native_size = sizeof(long long); } else { /* If no native type matches the querried datatype, simply choose the type of biggest size. */ @@ -591,16 +596,16 @@ H5T_get_native_integer(size_t prec, H5T_sign_t sign, H5T_direction_t direction, native_size = sizeof(long long); } } else if(direction == H5T_DIR_DESCEND) { - if(prec > H5Tget_precision(H5T_NATIVE_LONG)) { + if(prec > H5T_get_precision((H5T_t *)H5I_object(H5T_NATIVE_LONG_g))) { match = H5T_NATIVE_INT_MATCH_LLONG; native_size = sizeof(long long); - } else if(prec > H5Tget_precision(H5T_NATIVE_INT)) { + } else if(prec > H5T_get_precision((H5T_t *)H5I_object(H5T_NATIVE_INT_g))) { match = H5T_NATIVE_INT_MATCH_LONG; native_size = sizeof(long); - } else if(prec > H5Tget_precision(H5T_NATIVE_SHORT)) { + } else if(prec > H5T_get_precision((H5T_t *)H5I_object(H5T_NATIVE_SHORT_g))) { match = H5T_NATIVE_INT_MATCH_INT; native_size = sizeof(int); - } else if(prec > H5Tget_precision(H5T_NATIVE_SCHAR)) { + } else if(prec > H5T_get_precision((H5T_t *)H5I_object(H5T_NATIVE_SCHAR_g))) { match = H5T_NATIVE_INT_MATCH_SHORT; native_size = sizeof(short); } else { @@ -710,7 +715,7 @@ H5T_get_native_float(size_t size, H5T_direction_t direction, size_t *struct_alig FUNC_ENTER_NOAPI(NULL) - assert(size>0); + HDassert(size>0); if(direction == H5T_DIR_DEFAULT || direction == H5T_DIR_ASCEND) { if(size<=sizeof(float)) { @@ -786,7 +791,7 @@ H5T_get_native_float(size_t size, H5T_direction_t direction, size_t *struct_alig } /* end switch */ /* Create new native type */ - assert(tid>=0); + HDassert(tid>=0); if(NULL==(dt=(H5T_t *)H5I_object(tid))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a data type") if((ret_value=H5T_copy(dt, H5T_COPY_TRANSIENT))==NULL) @@ -829,19 +834,19 @@ H5T_get_native_bitfield(size_t prec, H5T_direction_t direction, size_t *struct_a FUNC_ENTER_NOAPI(NULL) if(direction == H5T_DIR_DEFAULT || direction == H5T_DIR_ASCEND) { - if(prec<=H5Tget_precision(H5T_NATIVE_B8)) { + if(prec<=H5T_get_precision((H5T_t *)H5I_object(H5T_NATIVE_B8_g))) { tid = H5T_NATIVE_B8; native_size = 1; align = H5T_NATIVE_UINT8_ALIGN_g; - } else if(prec<=H5Tget_precision(H5T_NATIVE_B16)) { + } else if(prec<=H5T_get_precision((H5T_t *)H5I_object(H5T_NATIVE_B16_g))) { tid = H5T_NATIVE_B16; native_size = 2; align = H5T_NATIVE_UINT16_ALIGN_g; - } else if(prec<=H5Tget_precision(H5T_NATIVE_B32)) { + } else if(prec<=H5T_get_precision((H5T_t *)H5I_object(H5T_NATIVE_B32_g))) { tid = H5T_NATIVE_B32; native_size = 4; align = H5T_NATIVE_UINT32_ALIGN_g; - } else if(prec<=H5Tget_precision(H5T_NATIVE_B64)) { + } else if(prec<=H5T_get_precision((H5T_t *)H5I_object(H5T_NATIVE_B64_g))) { tid = H5T_NATIVE_B64; native_size = 8; align = H5T_NATIVE_UINT64_ALIGN_g; @@ -851,15 +856,15 @@ H5T_get_native_bitfield(size_t prec, H5T_direction_t direction, size_t *struct_a align = H5T_NATIVE_UINT64_ALIGN_g; } } else if(direction == H5T_DIR_DESCEND) { - if(prec>H5Tget_precision(H5T_NATIVE_B32)) { + if(prec>H5T_get_precision((H5T_t *)H5I_object(H5T_NATIVE_B32_g))) { tid = H5T_NATIVE_B64; native_size = 8; align = H5T_NATIVE_UINT64_ALIGN_g; - } else if(prec>H5Tget_precision(H5T_NATIVE_B16)) { + } else if(prec>H5T_get_precision((H5T_t *)H5I_object(H5T_NATIVE_B16_g))) { tid = H5T_NATIVE_B32; native_size = 4; align = H5T_NATIVE_UINT32_ALIGN_g; - } else if(prec>H5Tget_precision(H5T_NATIVE_B8)) { + } else if(prec>H5T_get_precision((H5T_t *)H5I_object(H5T_NATIVE_B8_g))) { tid = H5T_NATIVE_B16; native_size = 2; align = H5T_NATIVE_UINT16_ALIGN_g; @@ -871,7 +876,7 @@ H5T_get_native_bitfield(size_t prec, H5T_direction_t direction, size_t *struct_a } /* Create new native type */ - assert(tid>=0); + HDassert(tid>=0); if(NULL==(dt=(H5T_t *)H5I_object(tid))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a data type") diff --git a/src/H5Toffset.c b/src/H5Toffset.c index bea8d2b..ea4b3b5 100644 --- a/src/H5Toffset.c +++ b/src/H5Toffset.c @@ -272,12 +272,12 @@ H5T_set_offset(const H5T_t *dt, size_t offset) FUNC_ENTER_NOAPI(FAIL) /* Check args */ - assert(dt); - assert(H5T_STRING!=dt->shared->type || 0==offset); - assert(H5T_REFERENCE!=dt->shared->type); - assert(H5T_OPAQUE!=dt->shared->type); - assert(H5T_COMPOUND!=dt->shared->type); - assert(!(H5T_ENUM==dt->shared->type && 0==dt->shared->u.enumer.nmembs)); + HDassert(dt); + HDassert(H5T_STRING!=dt->shared->type || 0==offset); + HDassert(H5T_REFERENCE!=dt->shared->type); + HDassert(H5T_OPAQUE!=dt->shared->type); + HDassert(H5T_COMPOUND!=dt->shared->type); + HDassert(!(H5T_ENUM==dt->shared->type && 0==dt->shared->u.enumer.nmembs)); if (dt->shared->parent) { if (H5T_set_offset(dt->shared->parent, offset)<0) diff --git a/src/H5Tprecis.c b/src/H5Tprecis.c index 671ae2e..6725165 100644 --- a/src/H5Tprecis.c +++ b/src/H5Tprecis.c @@ -238,12 +238,12 @@ H5T_set_precision(const H5T_t *dt, size_t prec) FUNC_ENTER_NOAPI(FAIL) /* Check args */ - assert(dt); - assert(prec>0); - assert(H5T_OPAQUE!=dt->shared->type); - assert(H5T_COMPOUND!=dt->shared->type); - assert(H5T_STRING!=dt->shared->type); - assert(!(H5T_ENUM==dt->shared->type && 0==dt->shared->u.enumer.nmembs)); + HDassert(dt); + HDassert(prec>0); + HDassert(H5T_OPAQUE!=dt->shared->type); + HDassert(H5T_COMPOUND!=dt->shared->type); + HDassert(H5T_STRING!=dt->shared->type); + HDassert(!(H5T_ENUM==dt->shared->type && 0==dt->shared->u.enumer.nmembs)); if (dt->shared->parent) { if (H5T_set_precision(dt->shared->parent, prec)<0) diff --git a/src/H5Tpublic.h b/src/H5Tpublic.h index d646ef1..046d454 100644 --- a/src/H5Tpublic.h +++ b/src/H5Tpublic.h @@ -592,6 +592,9 @@ H5_DLL htri_t H5Tcompiler_conv(hid_t src_id, hid_t dst_id); H5_DLL herr_t H5Tconvert(hid_t src_id, hid_t dst_id, size_t nelmts, void *buf, void *background, hid_t plist_id); +/* VOL named datatype rouines */ +H5_DLL herr_t H5Tget_vol_named_type(hid_t type_id, void **dt_obj); + /* Symbols defined for compatibility with previous versions of the HDF5 API. * * Use of these symbols is deprecated. diff --git a/src/H5Tvlen.c b/src/H5Tvlen.c index f497d1e..52a2cde 100644 --- a/src/H5Tvlen.c +++ b/src/H5Tvlen.c @@ -882,7 +882,7 @@ H5T_vlen_disk_read(H5F_t *f, hid_t dxpl_id, void *_vl, void *buf, size_t UNUSED /* Get the heap information */ H5F_addr_decode(f,(const uint8_t **)&vl,&(hobjid.addr)); - INT32DECODE(vl,hobjid.idx); + UINT32DECODE(vl,hobjid.idx); /* Check if this sequence actually has any data */ if(hobjid.addr>0) { @@ -935,7 +935,7 @@ H5T_vlen_disk_write(H5F_t *f, hid_t dxpl_id, const H5T_vlen_alloc_info_t UNUSED /* Get heap information */ H5F_addr_decode(f, (const uint8_t **)&bg, &(bg_hobjid.addr)); - INT32DECODE(bg, bg_hobjid.idx); + UINT32DECODE(bg, bg_hobjid.idx); /* Free heap object for old data */ if(bg_hobjid.addr > 0) { @@ -955,7 +955,7 @@ H5T_vlen_disk_write(H5F_t *f, hid_t dxpl_id, const H5T_vlen_alloc_info_t UNUSED /* Encode the heap information */ H5F_addr_encode(f, &vl, hobjid.addr); - INT32ENCODE(vl, hobjid.idx); + UINT32ENCODE(vl, hobjid.idx); done: FUNC_LEAVE_NOAPI(ret_value) @@ -997,7 +997,7 @@ H5T_vlen_disk_setnull(H5F_t *f, hid_t dxpl_id, void *_vl, void *_bg) /* Get heap information */ H5F_addr_decode(f, (const uint8_t **)&bg, &(bg_hobjid.addr)); - INT32DECODE(bg, bg_hobjid.idx); + UINT32DECODE(bg, bg_hobjid.idx); /* Free heap object for old data */ if(bg_hobjid.addr > 0) { @@ -1012,7 +1012,7 @@ H5T_vlen_disk_setnull(H5F_t *f, hid_t dxpl_id, void *_vl, void *_bg) /* Encode the "nil" heap pointer information */ H5F_addr_encode(f, &vl, (haddr_t)0); - INT32ENCODE(vl, 0); + UINT32ENCODE(vl, 0); done: FUNC_LEAVE_NOAPI(ret_value) @@ -78,7 +78,7 @@ H5V_stride_optimize1(unsigned *np/*in,out*/, hsize_t *elmt_size/*in,out*/, * This has to be true because if we optimize the dimensionality down to * zero we still must make one reference. */ - assert(1 == H5V_vector_reduce_product(0, NULL)); + HDassert(1 == H5V_vector_reduce_product(0, NULL)); /* * Combine adjacent memory accesses @@ -127,8 +127,8 @@ H5V_stride_optimize2(unsigned *np/*in,out*/, hsize_t *elmt_size/*in,out*/, * This has to be true because if we optimize the dimensionality down to * zero we still must make one reference. */ - assert(1 == H5V_vector_reduce_product(0, NULL)); - assert (*elmt_size>0); + HDassert(1 == H5V_vector_reduce_product(0, NULL)); + HDassert(*elmt_size>0); /* * Combine adjacent memory accesses @@ -267,48 +267,48 @@ H5V_hyper_stride(unsigned n, const hsize_t *size, FUNC_ENTER_NOAPI_NOINIT_NOERR - assert(n <= H5V_HYPER_NDIMS); - assert(size); - assert(total_size); - assert(stride); + HDassert(n <= H5V_HYPER_NDIMS); + HDassert(size); + HDassert(total_size); + HDassert(stride); /* init */ - assert(n>0); + HDassert(n>0); stride[n-1] = 1; skip = offset ? offset[n-1] : 0; switch(n) { case 2: /* 1-D dataset */ - assert (total_size[1]>=size[1]); + HDassert(total_size[1]>=size[1]); stride[0] = total_size[1]-size[1]; /*overflow checked*/ acc = total_size[1]; skip += acc * (offset ? offset[0] : 0); break; case 3: /* 2-D dataset */ - assert (total_size[2]>=size[2]); + HDassert(total_size[2]>=size[2]); stride[1] = total_size[2]-size[2]; /*overflow checked*/ acc = total_size[2]; skip += acc * (offset ? (hsize_t)offset[1] : 0); - assert (total_size[1]>=size[1]); + HDassert(total_size[1]>=size[1]); stride[0] = acc * (total_size[1] - size[1]); /*overflow checked*/ acc *= total_size[1]; skip += acc * (offset ? (hsize_t)offset[0] : 0); break; case 4: /* 3-D dataset */ - assert (total_size[3]>=size[3]); + HDassert(total_size[3]>=size[3]); stride[2] = total_size[3]-size[3]; /*overflow checked*/ acc = total_size[3]; skip += acc * (offset ? (hsize_t)offset[2] : 0); - assert (total_size[2]>=size[2]); + HDassert(total_size[2]>=size[2]); stride[1] = acc * (total_size[2] - size[2]); /*overflow checked*/ acc *= total_size[2]; skip += acc * (offset ? (hsize_t)offset[1] : 0); - assert (total_size[1]>=size[1]); + HDassert(total_size[1]>=size[1]); stride[0] = acc * (total_size[1] - size[1]); /*overflow checked*/ acc *= total_size[1]; skip += acc * (offset ? (hsize_t)offset[0] : 0); @@ -317,7 +317,7 @@ H5V_hyper_stride(unsigned n, const hsize_t *size, default: /* others */ for (i=(int)(n-2), acc=1; i>=0; --i) { - assert (total_size[i+1]>=size[i+1]); + HDassert(total_size[i+1]>=size[i+1]); stride[i] = acc * (total_size[i+1] - size[i+1]); /*overflow checked*/ acc *= total_size[i+1]; skip += acc * (offset ? (hsize_t)offset[i] : 0); @@ -474,14 +474,14 @@ H5V_hyper_fill(unsigned n, const hsize_t *_size, FUNC_ENTER_NOAPI_NOINIT_NOERR /* check args */ - assert(n > 0 && n <= H5V_HYPER_NDIMS); - assert(_size); - assert(total_size); - assert(dst); + HDassert(n > 0 && n <= H5V_HYPER_NDIMS); + HDassert(_size); + HDassert(total_size); + HDassert(dst); #ifndef NDEBUG for (u = 0; u < n; u++) { - assert(_size[u] > 0); - assert(total_size[u] > 0); + HDassert(_size[u] > 0); + HDassert(total_size[u] > 0); } #endif @@ -560,17 +560,17 @@ H5V_hyper_copy(unsigned n, const hsize_t *_size, FUNC_ENTER_NOAPI_NOINIT_NOERR /* check args */ - assert(n > 0 && n <= H5V_HYPER_NDIMS); - assert(_size); - assert(dst_size); - assert(src_size); - assert(dst); - assert(src); + HDassert(n > 0 && n <= H5V_HYPER_NDIMS); + HDassert(_size); + HDassert(dst_size); + HDassert(src_size); + HDassert(dst); + HDassert(src); #ifndef NDEBUG for (u = 0; u < n; u++) { - assert(_size[u] > 0); - assert(dst_size[u] > 0); - assert(src_size[u] > 0); + HDassert(_size[u] > 0); + HDassert(dst_size[u] > 0); + HDassert(src_size[u] > 0); } #endif @@ -589,7 +589,7 @@ H5V_hyper_copy(unsigned n, const hsize_t *_size, int ii; /*counter */ /* init */ - assert(n>0); + HDassert(n>0); dst_stride[n-1] = 1; src_stride[n-1] = 1; dst_start = dst_offset ? dst_offset[n-1] : 0; @@ -598,8 +598,8 @@ H5V_hyper_copy(unsigned n, const hsize_t *_size, /* Unroll loop for common cases */ switch(n) { case 2: - assert (dst_size[1]>=size[1]); - assert (src_size[1]>=size[1]); + HDassert(dst_size[1]>=size[1]); + HDassert(src_size[1]>=size[1]); dst_stride[0] = dst_size[1] - size[1]; /*overflow checked*/ src_stride[0] = src_size[1] - size[1]; /*overflow checked*/ dst_acc = dst_size[1]; @@ -609,8 +609,8 @@ H5V_hyper_copy(unsigned n, const hsize_t *_size, break; case 3: - assert (dst_size[2]>=size[2]); - assert (src_size[2]>=size[2]); + HDassert(dst_size[2]>=size[2]); + HDassert(src_size[2]>=size[2]); dst_stride[1] = dst_size[2] - size[2]; /*overflow checked*/ src_stride[1] = src_size[2] - size[2]; /*overflow checked*/ dst_acc = dst_size[2]; @@ -618,8 +618,8 @@ H5V_hyper_copy(unsigned n, const hsize_t *_size, dst_start += dst_acc * (dst_offset ? dst_offset[1] : 0); src_start += src_acc * (src_offset ? src_offset[1] : 0); - assert (dst_size[1]>=size[1]); - assert (src_size[1]>=size[1]); + HDassert(dst_size[1]>=size[1]); + HDassert(src_size[1]>=size[1]); dst_stride[0] = dst_acc * (dst_size[1] - size[1]); /*overflow checked*/ src_stride[0] = src_acc * (src_size[1] - size[1]); /*overflow checked*/ dst_acc *= dst_size[1]; @@ -629,8 +629,8 @@ H5V_hyper_copy(unsigned n, const hsize_t *_size, break; case 4: - assert (dst_size[3]>=size[3]); - assert (src_size[3]>=size[3]); + HDassert(dst_size[3]>=size[3]); + HDassert(src_size[3]>=size[3]); dst_stride[2] = dst_size[3] - size[3]; /*overflow checked*/ src_stride[2] = src_size[3] - size[3]; /*overflow checked*/ dst_acc = dst_size[3]; @@ -638,8 +638,8 @@ H5V_hyper_copy(unsigned n, const hsize_t *_size, dst_start += dst_acc * (dst_offset ? dst_offset[2] : 0); src_start += src_acc * (src_offset ? src_offset[2] : 0); - assert (dst_size[2]>=size[2]); - assert (src_size[2]>=size[2]); + HDassert(dst_size[2]>=size[2]); + HDassert(src_size[2]>=size[2]); dst_stride[1] = dst_acc * (dst_size[2] - size[2]); /*overflow checked*/ src_stride[1] = src_acc * (src_size[2] - size[2]); /*overflow checked*/ dst_acc *= dst_size[2]; @@ -647,8 +647,8 @@ H5V_hyper_copy(unsigned n, const hsize_t *_size, dst_start += dst_acc * (dst_offset ? dst_offset[1] : 0); src_start += src_acc * (src_offset ? src_offset[1] : 0); - assert (dst_size[1]>=size[1]); - assert (src_size[1]>=size[1]); + HDassert(dst_size[1]>=size[1]); + HDassert(src_size[1]>=size[1]); dst_stride[0] = dst_acc * (dst_size[1] - size[1]); /*overflow checked*/ src_stride[0] = src_acc * (src_size[1] - size[1]); /*overflow checked*/ dst_acc *= dst_size[1]; @@ -660,8 +660,8 @@ H5V_hyper_copy(unsigned n, const hsize_t *_size, default: /* others */ for (ii=(int)(n-2), dst_acc=1, src_acc=1; ii>=0; --ii) { - assert (dst_size[ii+1]>=size[ii+1]); - assert (src_size[ii+1]>=size[ii+1]); + HDassert(dst_size[ii+1]>=size[ii+1]); + HDassert(src_size[ii+1]>=size[ii+1]); dst_stride[ii] = dst_acc * (dst_size[ii+1] - size[ii+1]); /*overflow checked*/ src_stride[ii] = src_acc * (src_size[ii+1] - size[ii+1]); /*overflow checked*/ dst_acc *= dst_size[ii+1]; @@ -713,7 +713,7 @@ H5V_stride_fill(unsigned n, hsize_t elmt_size, const hsize_t *size, FUNC_ENTER_NOAPI_NOINIT_NOERR - assert (elmt_size < SIZET_MAX); + HDassert(elmt_size < SIZET_MAX); H5V_vector_cpy(n, idx, size); nelmts = H5V_vector_reduce_product(n, size); @@ -729,7 +729,7 @@ H5V_stride_fill(unsigned n, hsize_t elmt_size, const hsize_t *size, if (--idx[j]) carry = FALSE; else { - assert(size); + HDassert(size); idx[j] = size[j]; } /* end else */ } @@ -775,7 +775,7 @@ H5V_stride_copy(unsigned n, hsize_t elmt_size, const hsize_t *size, FUNC_ENTER_NOAPI_NOINIT_NOERR - assert (elmt_size<SIZET_MAX); + HDassert(elmt_size<SIZET_MAX); if (n) { H5V_vector_cpy(n, idx, size); @@ -794,7 +794,7 @@ H5V_stride_copy(unsigned n, hsize_t elmt_size, const hsize_t *size, if (--idx[j]) carry = FALSE; else { - assert(size); + HDassert(size); idx[j] = size[j]; } } @@ -844,7 +844,7 @@ H5V_stride_copy_s(unsigned n, hsize_t elmt_size, const hsize_t *size, FUNC_ENTER_NOAPI_NOINIT_NOERR - assert (elmt_size<SIZET_MAX); + HDassert(elmt_size<SIZET_MAX); if (n) { H5V_vector_cpy(n, idx, size); @@ -863,7 +863,7 @@ H5V_stride_copy_s(unsigned n, hsize_t elmt_size, const hsize_t *size, if (--idx[j]) carry = FALSE; else { - assert(size); + HDassert(size); idx[j] = size[j]; } } @@ -918,9 +918,9 @@ H5V_stride_copy2(hsize_t nelmts, hsize_t elmt_size, FUNC_ENTER_NOAPI_NOINIT_NOERR - assert (elmt_size < SIZET_MAX); - assert(dst_n>0); - assert(src_n>0); + HDassert(elmt_size < SIZET_MAX); + HDassert(dst_n>0); + HDassert(src_n>0); H5V_vector_cpy(dst_n, dst_idx, dst_size); H5V_vector_cpy(src_n, src_idx, src_size); @@ -937,7 +937,7 @@ H5V_stride_copy2(hsize_t nelmts, hsize_t elmt_size, if (--dst_idx[j]) carry = FALSE; else { - assert(dst_size); + HDassert(dst_size); dst_idx[j] = dst_size[j]; } /* end else */ } @@ -946,7 +946,7 @@ H5V_stride_copy2(hsize_t nelmts, hsize_t elmt_size, if (--src_idx[j]) carry = FALSE; else { - assert(src_size); + HDassert(src_size); src_idx[j] = src_size[j]; } /* end else */ } @@ -983,10 +983,10 @@ H5V_array_fill(void *_dst, const void *src, size_t size, size_t count) FUNC_ENTER_NOAPI_NOINIT_NOERR - assert (dst); - assert (src); - assert (size < SIZET_MAX && size > 0); - assert (count < SIZET_MAX && count > 0); + HDassert(dst); + HDassert(src); + HDassert(size < SIZET_MAX && size > 0); + HDassert(count < SIZET_MAX && count > 0); HDmemcpy(dst, src, size); /* copy first item */ @@ -1038,9 +1038,9 @@ H5V_array_down(unsigned n, const hsize_t *total_size, hsize_t *down) FUNC_ENTER_NOAPI_NOINIT_NOERR - assert(n <= H5V_HYPER_NDIMS); - assert(total_size); - assert(down); + HDassert(n <= H5V_HYPER_NDIMS); + HDassert(total_size); + HDassert(down); /* Build the sizes of each dimension in the array */ /* (From fastest to slowest) */ @@ -1084,9 +1084,9 @@ H5V_array_offset_pre(unsigned n, const hsize_t *acc, const hsize_t *offset) FUNC_ENTER_NOAPI_NOINIT_NOERR - assert(n <= H5V_HYPER_NDIMS); - assert(acc); - assert(offset); + HDassert(n <= H5V_HYPER_NDIMS); + HDassert(acc); + HDassert(offset); /* Compute offset in array */ for (i=(int)(n-1), ret_value=0; i>=0; --i) @@ -1124,9 +1124,9 @@ H5V_array_offset(unsigned n, const hsize_t *total_size, const hsize_t *offset) FUNC_ENTER_NOAPI((HDabort(), 0)) /*lint !e527 Don't worry about unreachable statement */ - assert(n <= H5V_HYPER_NDIMS); - assert(total_size); - assert(offset); + HDassert(n <= H5V_HYPER_NDIMS); + HDassert(total_size); + HDassert(offset); /* Build the sizes of each dimension in the array */ if(H5V_array_down(n,total_size,acc_arr)<0) @@ -1278,10 +1278,10 @@ H5V_chunk_index(unsigned ndims, const hsize_t *coord, const uint32_t *chunk, FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity check */ - assert(ndims <= H5V_HYPER_NDIMS); - assert(coord); - assert(chunk); - assert(chunk_idx); + HDassert(ndims <= H5V_HYPER_NDIMS); + HDassert(coord); + HDassert(chunk); + HDassert(chunk_idx); /* Compute the scaled coordinates for actual coordinates */ for(u=0; u<ndims; u++) @@ -504,6 +504,38 @@ done: /*------------------------------------------------------------------------- + * Function: H5VLattr_iterate + * + * Purpose: Iterate over attrs in a group + * + * Return: Success: non negative + * Failure: negative + * + * Programmer: Mohamad Chaarawi + * June, 2013 + * + *------------------------------------------------------------------------- + */ +herr_t H5VLattr_iterate(void *obj, H5VL_loc_params_t loc_params, H5VL_t *vol_plugin, + H5_index_t idx_type, H5_iter_order_t order, hsize_t *n, + H5A_operator2_t op, void *op_data, hid_t dxpl_id, void UNUSED **req) +{ + herr_t ret_value = SUCCEED; + + FUNC_ENTER_API(FAIL) + + if(NULL == obj || NULL == vol_plugin || NULL == vol_plugin->cls) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid object/VOL class pointer") + if((ret_value = H5VL_attr_iterate(obj, loc_params, vol_plugin, idx_type, order, n, + op, op_data, dxpl_id, H5_EVENT_QUEUE_NULL)) < 0) + HGOTO_ERROR(H5E_VOL, H5E_CANTINIT, FAIL, "Attr iteration failed") + +done: + FUNC_LEAVE_API(ret_value) +} /* end H5VLattr_iterate() */ + + +/*------------------------------------------------------------------------- * Function: H5VLattr_get * * Purpose: Get specific information about the attribute through the VOL @@ -781,6 +813,51 @@ done: /*------------------------------------------------------------------------- + * Function: H5VLdatatype_get + * + * Purpose: Get specific information about the datatype through the VOL + * + * Return: Success: non negative + * + * Failure: negative + * + * Programmer: Mohamad Chaarawi + * June, 2013 + * + *------------------------------------------------------------------------- + */ +herr_t +H5VLdatatype_get(void *obj, H5VL_t *vol_plugin, H5VL_datatype_get_t get_type, + hid_t dxpl_id, void UNUSED **req, va_list arguments) +{ + herr_t ret_value = SUCCEED; + + FUNC_ENTER_API(FAIL) + + if(NULL == obj || NULL == vol_plugin || NULL == vol_plugin->cls) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid object/VOL class pointer") + + switch (get_type) { + /* H5Tget_create_plist */ + case H5VL_DATATYPE_GET_TCPL: + { + hid_t *new_tcpl_id = va_arg (arguments, hid_t *); + + if((ret_value = H5VL_datatype_get(obj, vol_plugin, get_type, dxpl_id, + H5_EVENT_QUEUE_NULL, new_tcpl_id)) < 0) + HGOTO_ERROR(H5E_VOL, H5E_CANTINIT, FAIL, "unable to get datatype information") + break; + } + default: + HGOTO_ERROR(H5E_VOL, H5E_CANTGET, FAIL, "can't get this type of information from datatype") + } + +done: + FUNC_LEAVE_API(ret_value) +} /* end H5VLdatatype_get() */ + + +/*------------------------------------------------------------------------- * Function: H5VLdatatype_close * * Purpose: Closes a datatype through the VOL diff --git a/src/H5VLint.c b/src/H5VLint.c index 6624070..bb32151 100644 --- a/src/H5VLint.c +++ b/src/H5VLint.c @@ -663,6 +663,39 @@ done: /*------------------------------------------------------------------------- + * Function: H5VL_attr_iterate + * + * Purpose: Iterate over attrs in an object + * + * Return: Success: non negative + * Failure: negative + * + * Programmer: Mohamad Chaarawi + * June, 2013 + * + *------------------------------------------------------------------------- + */ +herr_t +H5VL_attr_iterate(void *obj, H5VL_loc_params_t loc_params, H5VL_t *vol_plugin, + H5_index_t idx_type, H5_iter_order_t order, hsize_t *n, + H5A_operator2_t op, void *op_data, hid_t dxpl_id, hid_t UNUSED event_q) +{ + herr_t ret_value = SUCCEED; + + FUNC_ENTER_NOAPI(FAIL) + + if(NULL == vol_plugin->cls->attr_cls.iterate) + HGOTO_ERROR(H5E_VOL, H5E_UNSUPPORTED, FAIL, "vol plugin has no `attr iterate' method") + if((ret_value = (vol_plugin->cls->attr_cls.iterate)(obj, loc_params, idx_type, order, n, op, + op_data, dxpl_id, H5_REQUEST_NULL)) < 0) + HGOTO_ERROR(H5E_VOL, H5E_BADITER, FAIL, "iteration failed") + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5VL_attr_iterate() */ + + +/*------------------------------------------------------------------------- * Function: H5VL_attr_get * * Purpose: Get specific information about the attribute through the VOL @@ -985,6 +1018,42 @@ done: /*------------------------------------------------------------------------- + * Function: H5VL_datatype_get + * + * Purpose: Get specific information about the datatype through the VOL + * + * Return: Success: non negative + * + * Failure: negative + * + * Programmer: Mohamad Chaarawi + * June, 2013 + * + *------------------------------------------------------------------------- + */ +herr_t +H5VL_datatype_get(void *obj, H5VL_t *vol_plugin, H5VL_datatype_get_t get_type, + hid_t dxpl_id, hid_t event_q, ...) +{ + va_list arguments; /* argument list passed from the API call */ + herr_t ret_value = SUCCEED; + + FUNC_ENTER_NOAPI(FAIL) + + if(NULL == vol_plugin->cls->datatype_cls.get) + HGOTO_ERROR(H5E_VOL, H5E_UNSUPPORTED, FAIL, "vol plugin has no `datatype get' method") + va_start (arguments, event_q); + if((ret_value = (vol_plugin->cls->datatype_cls.get)(obj, get_type, dxpl_id, + H5_REQUEST_NULL, arguments)) < 0) + HGOTO_ERROR(H5E_VOL, H5E_CANTGET, FAIL, "get failed") + va_end (arguments); + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5VL_datatype_get() */ + + +/*------------------------------------------------------------------------- * Function: H5VL_datatype_close * * Purpose: Closes a datatype through the VOL diff --git a/src/H5VLiod.c b/src/H5VLiod.c index b35a100..6855ca1 100644 --- a/src/H5VLiod.c +++ b/src/H5VLiod.c @@ -94,6 +94,7 @@ static herr_t H5VL_iod_attribute_close(void *attr, hid_t dxpl_id, void **req); static void *H5VL_iod_datatype_commit(void *obj, H5VL_loc_params_t loc_params, const char *name, hid_t type_id, hid_t lcpl_id, hid_t tcpl_id, hid_t tapl_id, hid_t dxpl_id, void **req); static void *H5VL_iod_datatype_open(void *obj, H5VL_loc_params_t loc_params, const char *name, hid_t tapl_id, hid_t dxpl_id, void **req); static ssize_t H5VL_iod_datatype_get_binary(void *obj, unsigned char *buf, size_t size, hid_t dxpl_id, void **req); +static herr_t H5VL_iod_datatype_get(void *obj, H5VL_datatype_get_t get_type, hid_t dxpl_id, void **req, va_list arguments); static herr_t H5VL_iod_datatype_close(void *dt, hid_t dxpl_id, void **req); /* Dataset callbacks */ @@ -178,6 +179,7 @@ static H5VL_class_t H5VL_iod_g = { H5VL_iod_attribute_open, /* open */ H5VL_iod_attribute_read, /* read */ H5VL_iod_attribute_write, /* write */ + NULL,//H5VL_iod_attr_iterate, /* iterate */ H5VL_iod_attribute_get, /* get */ H5VL_iod_attribute_remove, /* remove */ H5VL_iod_attribute_close /* close */ @@ -186,6 +188,7 @@ static H5VL_class_t H5VL_iod_g = { H5VL_iod_datatype_commit, /* commit */ H5VL_iod_datatype_open, /* open */ H5VL_iod_datatype_get_binary, /* get_size */ + H5VL_iod_datatype_get, /* get */ H5VL_iod_datatype_close /* close */ }, { /* dataset_cls */ @@ -312,16 +315,22 @@ EFF_init(MPI_Comm comm, MPI_Info UNUSED info) MPI_Comm_size(comm, &num_procs); MPI_Comm_rank(comm, &my_rank); + /* generate global variables to create and track axe_ids for every + operation. Each process owns a portion of the ID space and uses + that space incrementally. */ axe_seed = (pow(2.0,64.0) - 1) / num_procs; axe_id = axe_seed * my_rank + 1; axe_bound = axe_seed * (my_rank + 1); + /* This is a temporary solution for connecting to the server using + mercury */ if ((config = fopen("port.cfg", "r")) != NULL) { fread(mpi_port_name, sizeof(char), MPI_MAX_PORT_NAME, config); printf("Using MPI port name: %s.\n", mpi_port_name); fclose(config); } + /* initialize Mercury stuff */ network_class = NA_MPI_Init(NULL, 0); if (HG_SUCCESS != HG_Init(network_class)) return FAIL; @@ -382,54 +391,11 @@ EFF_init(MPI_Comm comm, MPI_Info UNUSED info) H5VL_CANCEL_OP_ID = MERCURY_REGISTER("cancel_op", uint64_t, uint8_t); - /* forward the init call to the IONs */ + /* forward the init call to the ION and wait for its completion */ if(HG_Forward(PEER, H5VL_EFF_INIT_ID, &num_procs, &ret_value, &hg_req) < 0) return FAIL; - HG_Wait(hg_req, HG_MAX_IDLE_TIME, HG_STATUS_IGNORE); -#if 0 - { - int i; - uint64_t id; - - for(i=0; i<10; i++) { - H5VL_iod_gen_obj_id(my_rank, num_procs, i, IOD_OBJ_KV, &id); - fprintf(stderr,"%d ID %d = %llu\n", my_rank, i, id); - while (id) { - if (id & 1) - fprintf(stderr,"1"); - else - fprintf(stderr,"0"); - - id >>= 1; - } - fprintf(stderr,"\n"); - H5VL_iod_gen_obj_id(my_rank, num_procs, i, IOD_OBJ_BLOB, &id); - fprintf(stderr,"%d ID %d = %llu\n", my_rank, i, id); - while (id) { - if (id & 1) - fprintf(stderr,"1"); - else - fprintf(stderr,"0"); - - id >>= 1; - } - fprintf(stderr,"\n"); - H5VL_iod_gen_obj_id(my_rank, num_procs, i, IOD_OBJ_ARRAY, &id); - fprintf(stderr,"%d ID %d = %llu\n", my_rank, i, id); - while (id) { - if (id & 1) - fprintf(stderr,"1"); - else - fprintf(stderr,"0"); - - id >>= 1; - } - fprintf(stderr,"\n"); - } - } -#endif return ret_value; } /* end EFF_init() */ @@ -452,10 +418,9 @@ EFF_finalize(void) hg_request_t hg_req; herr_t ret_value = SUCCEED; - /* forward the finalize call to the IONs */ + /* forward the finalize call to the ION and wait for it to complete */ if(HG_Forward(PEER, H5VL_EFF_FINALIZE_ID, &ret_value, &ret_value, &hg_req) < 0) return FAIL; - HG_Wait(hg_req, HG_MAX_IDLE_TIME, HG_STATUS_IGNORE); /* Free addr id */ @@ -541,7 +506,7 @@ H5VL_iod_fapl_copy(const void *_old_fa) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed"); /* Copy the general information */ - //HDmemcpy(new_fa, old_fa, sizeof(H5VL_iod_fapl_t)); + /* HDmemcpy(new_fa, old_fa, sizeof(H5VL_iod_fapl_t)); */ /* Duplicate communicator and Info object. */ if(FAIL == H5FD_mpi_comm_info_dup(old_fa->comm, old_fa->info, &new_fa->comm, &new_fa->info)) @@ -593,6 +558,21 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5VL_iod_fapl_free() */ + +/*------------------------------------------------------------------------- + * Function: H5Pset_dxpl_checksum + * + * Purpose: Modify the dataset transfer property list to set a + * checksum value for the data to be transfered. + * This is used with write operations. + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Mohamad Chaarawi + * June, 2013 + * + *------------------------------------------------------------------------- + */ herr_t H5Pset_dxpl_checksum(hid_t dxpl_id, uint32_t cs) { @@ -617,6 +597,20 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pset_dxpl_checksum() */ + +/*------------------------------------------------------------------------- + * Function: H5Pget_dxpl_checksum + * + * Purpose: Retrieve the checksum value that was set using + * H5Pset_dxpl_checksum. + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Mohamad Chaarawi + * June, 2013 + * + *------------------------------------------------------------------------- + */ herr_t H5Pget_dxpl_checksum(hid_t dxpl_id, uint32_t *cs/*out*/) { @@ -638,6 +632,21 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pget_dxpl_checksum() */ + +/*------------------------------------------------------------------------- + * Function: H5Pset_dxpl_checksum_ptr + * + * Purpose: Set a pointer to tell the library where to insert the + * checksum that is received from a remote location. + * This is used with read operations. + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Mohamad Chaarawi + * June, 2013 + * + *------------------------------------------------------------------------- + */ herr_t H5Pset_dxpl_checksum_ptr(hid_t dxpl_id, uint32_t *cs) { @@ -662,6 +671,20 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pset_dxpl_checksum_ptr() */ + +/*------------------------------------------------------------------------- + * Function: H5Pget_dxpl_checksum_ptr + * + * Purpose: Retrieve the checksum pointer value that was set using + * H5Pset_dxpl_checksum_ptr. + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Mohamad Chaarawi + * June, 2013 + * + *------------------------------------------------------------------------- + */ herr_t H5Pget_dxpl_checksum_ptr(hid_t dxpl_id, uint32_t **cs/*out*/) { @@ -683,6 +706,20 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pget_dxpl_checksum_ptr() */ + +/*------------------------------------------------------------------------- + * Function: H5Pset_dxpl_inject_corruption + * + * Purpose: Temporary routine to set a boolean flag that tells the + * library to inject corruption in the stack. + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Mohamad Chaarawi + * June, 2013 + * + *------------------------------------------------------------------------- + */ herr_t H5Pset_dxpl_inject_corruption(hid_t dxpl_id, hbool_t flag) { @@ -707,6 +744,20 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pset_dxpl_inject_corruption() */ + +/*------------------------------------------------------------------------- + * Function: H5Pget_dxpl_inject_corruption + * + * Purpose: Temporary routine to retrieve the boolean flag that tells the + * library to inject corruption in the stack. + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Mohamad Chaarawi + * June, 2013 + * + *------------------------------------------------------------------------- + */ herr_t H5Pget_dxpl_inject_corruption(hid_t dxpl_id, hbool_t *flag/*out*/) { @@ -728,6 +779,21 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pget_dxpl_inject_corruption() */ + +/*------------------------------------------------------------------------- + * Function: H5Pset_dcpl_append_only + * + * Purpose: Set a boolean flag on the dataset creation property list + * to indicate to the VOL plugin that access to this dataset + * will always be in an append/sequence only manner. + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Mohamad Chaarawi + * June, 2013 + * + *------------------------------------------------------------------------- + */ herr_t H5Pset_dcpl_append_only(hid_t dcpl_id, hbool_t flag) { @@ -752,6 +818,21 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pset_dcpl_append_only() */ + +/*------------------------------------------------------------------------- + * Function: H5Pget_dcpl_append_only + * + * Purpose: Retrieve a boolean flag on the dataset creation property list + * that indicates whether access to this dataset + * will always be in an append/sequence only manner. + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Mohamad Chaarawi + * June, 2013 + * + *------------------------------------------------------------------------- + */ herr_t H5Pget_dcpl_append_only(hid_t dcpl_id, hbool_t *flag/*out*/) { @@ -870,7 +951,7 @@ H5VL_iod_file_create(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl file->common.obj_type = H5I_FILE; /* The name of the location is the root's object name "\" */ - file->common.obj_name = strdup("/"); + file->common.obj_name = HDstrdup("/"); file->common.obj_name[1] = '\0'; file->common.file = file; @@ -1003,7 +1084,7 @@ H5VL_iod_file_open(const char *name, unsigned flags, hid_t fapl_id, hid_t dxpl_i file->common.obj_type = H5I_FILE; /* The name of the location is the root's object name "\" */ - file->common.obj_name = strdup("/"); + file->common.obj_name = HDstrdup("/"); file->common.obj_name[1] = '\0'; file->common.file = file; @@ -1470,7 +1551,7 @@ H5VL_iod_group_create(void *_obj, H5VL_loc_params_t loc_params, const char *name iod_obj_id_t iod_id; iod_handle_t iod_oh; uint64_t parent_axe_id; - char *new_name; /* resolved path to where we need to start traversal at the server */ + char *new_name = NULL; /* resolved path to where we need to start traversal at the server */ hg_request_t _hg_req; /* Local function shipper request, for sync. operations */ hg_request_t *hg_req = NULL; H5VL_iod_request_t _request; /* Local request, for sync. operations */ @@ -1545,12 +1626,16 @@ H5VL_iod_group_create(void *_obj, H5VL_loc_params_t loc_params, const char *name /* setup the local group struct */ /* store the entire path of the group locally */ - if (NULL == (grp->common.obj_name = (char *)malloc - (HDstrlen(obj->obj_name) + HDstrlen(name) + 1))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate"); - HDstrcpy(grp->common.obj_name, obj->obj_name); - HDstrcat(grp->common.obj_name, name); - grp->common.obj_name[HDstrlen(obj->obj_name) + HDstrlen(name) + 1] = '\0'; + { + size_t obj_name_len = HDstrlen(obj->obj_name); + size_t name_len = HDstrlen(name); + + if (NULL == (grp->common.obj_name = (char *)HDmalloc(obj_name_len + name_len + 1))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate"); + HDmemcpy(grp->common.obj_name, obj->obj_name, obj_name_len); + HDmemcpy(grp->common.obj_name+obj_name_len, name, name_len); + grp->common.obj_name[obj_name_len+name_len] = '\0'; + } /* copy property lists */ if((grp->remote_group.gcpl_id = H5Pcopy(gcpl_id)) < 0) @@ -1606,7 +1691,7 @@ H5VL_iod_group_create(void *_obj, H5VL_loc_params_t loc_params, const char *name ret_value = (void *)grp; done: - free(new_name); + if(new_name) free(new_name); FUNC_LEAVE_NOAPI(ret_value) } /* end H5VL_iod_group_create() */ @@ -1634,7 +1719,7 @@ H5VL_iod_group_open(void *_obj, H5VL_loc_params_t loc_params, const char *name, iod_obj_id_t iod_id; iod_handle_t iod_oh; uint64_t parent_axe_id; - char *new_name; /* resolved path to where we need to start traversal at the server */ + char *new_name = NULL; /* resolved path to where we need to start traversal at the server */ hg_request_t _hg_req; /* Local function shipper request, for sync. operations */ hg_request_t *hg_req = NULL; H5VL_iod_request_t _request; /* Local request, for sync. operations */ @@ -1690,12 +1775,16 @@ H5VL_iod_group_open(void *_obj, H5VL_loc_params_t loc_params, const char *name, /* setup the local group struct */ /* store the entire path of the group locally */ - if (NULL == (grp->common.obj_name = (char *)malloc - (HDstrlen(obj->obj_name) + HDstrlen(name) + 1))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate"); - HDstrcpy(grp->common.obj_name, obj->obj_name); - HDstrcat(grp->common.obj_name, name); - grp->common.obj_name[HDstrlen(obj->obj_name) + HDstrlen(name) + 1] = '\0'; + { + size_t obj_name_len = HDstrlen(obj->obj_name); + size_t name_len = HDstrlen(name); + + if (NULL == (grp->common.obj_name = (char *)HDmalloc(obj_name_len + name_len + 1))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate"); + HDmemcpy(grp->common.obj_name, obj->obj_name, obj_name_len); + HDmemcpy(grp->common.obj_name+obj_name_len, name, name_len); + grp->common.obj_name[obj_name_len+name_len] = '\0'; + } /* copy property lists */ if((grp->gapl_id = H5Pcopy(gapl_id)) < 0) @@ -1749,7 +1838,7 @@ H5VL_iod_group_open(void *_obj, H5VL_loc_params_t loc_params, const char *name, ret_value = (void *)grp; done: - free(new_name); + if(new_name) free(new_name); FUNC_LEAVE_NOAPI(ret_value) } /* end H5VL_iod_group_open() */ @@ -1829,6 +1918,13 @@ H5VL_iod_group_close(void *_grp, hid_t dxpl_id, void **req) FUNC_ENTER_NOAPI_NOINIT + /* If this call is not asynchronous, complete and remove all + requests that are associated with this object from the List */ + if(!do_async) { + if(H5VL_iod_request_wait_some(grp->common.file, grp) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "can't wait on all object requests"); + } + /* allocate an integer to receive the return value if the group close succeeded or not */ status = (int *)malloc(sizeof(int)); @@ -1926,7 +2022,7 @@ H5VL_iod_dataset_create(void *_obj, H5VL_loc_params_t loc_params, const char *na iod_obj_id_t iod_id; iod_handle_t iod_oh; uint64_t parent_axe_id; - char *new_name; /* resolved path to where we need to start traversal at the server */ + char *new_name = NULL; /* resolved path to where we need to start traversal at the server */ hg_request_t _hg_req; /* Local function shipper request, for sync. operations */ hg_request_t *hg_req = NULL; H5VL_iod_request_t _request; /* Local request, for sync. operations */ @@ -2003,12 +2099,16 @@ H5VL_iod_dataset_create(void *_obj, H5VL_loc_params_t loc_params, const char *na /* setup the local dataset struct */ /* store the entire path of the dataset locally */ - if (NULL == (dset->common.obj_name = (char *)malloc - (HDstrlen(obj->obj_name) + HDstrlen(name) + 1))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate"); - HDstrcpy(dset->common.obj_name, obj->obj_name); - HDstrcat(dset->common.obj_name, name); - dset->common.obj_name[HDstrlen(obj->obj_name) + HDstrlen(name) + 1] = '\0'; + { + size_t obj_name_len = HDstrlen(obj->obj_name); + size_t name_len = HDstrlen(name); + + if (NULL == (dset->common.obj_name = (char *)HDmalloc(obj_name_len + name_len + 1))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate"); + HDmemcpy(dset->common.obj_name, obj->obj_name, obj_name_len); + HDmemcpy(dset->common.obj_name+obj_name_len, name, name_len); + dset->common.obj_name[obj_name_len+name_len] = '\0'; + } /* copy property lists, dtype, and dspace*/ if((dset->remote_dset.dcpl_id = H5Pcopy(dcpl_id)) < 0) @@ -2069,7 +2169,7 @@ H5VL_iod_dataset_create(void *_obj, H5VL_loc_params_t loc_params, const char *na ret_value = (void *)dset; done: - free(new_name); + if(new_name) free(new_name); FUNC_LEAVE_NOAPI(ret_value) } /* end H5VL_iod_dataset_create() */ @@ -2097,7 +2197,7 @@ H5VL_iod_dataset_open(void *_obj, H5VL_loc_params_t loc_params, const char *name iod_obj_id_t iod_id; iod_handle_t iod_oh; uint64_t parent_axe_id; - char *new_name; /* resolved path to where we need to start traversal at the server */ + char *new_name = NULL; /* resolved path to where we need to start traversal at the server */ hg_request_t _hg_req; /* Local function shipper request, for sync. operations */ hg_request_t *hg_req = NULL; H5VL_iod_request_t _request; /* Local request, for sync. operations */ @@ -2151,14 +2251,22 @@ H5VL_iod_dataset_open(void *_obj, H5VL_loc_params_t loc_params, const char *name /* setup the local dataset struct */ /* store the entire path of the dataset locally */ - if (NULL == (dset->common.obj_name = (char *)malloc - (HDstrlen(obj->obj_name) + HDstrlen(name) + 1))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate"); - HDstrcpy(dset->common.obj_name, obj->obj_name); - HDstrcat(dset->common.obj_name, name); - dset->common.obj_name[HDstrlen(obj->obj_name) + HDstrlen(name) + 1] = '\0'; + { + size_t obj_name_len = HDstrlen(obj->obj_name); + size_t name_len = HDstrlen(name); + + if (NULL == (dset->common.obj_name = (char *)HDmalloc(obj_name_len + name_len + 1))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate"); + HDmemcpy(dset->common.obj_name, obj->obj_name, obj_name_len); + HDmemcpy(dset->common.obj_name+obj_name_len, name, name_len); + dset->common.obj_name[obj_name_len+name_len] = '\0'; + } + +#if H5VL_IOD_DEBUG printf("Dataset Open %s LOC ID %llu, axe id %llu, parent %llu\n", dset->common.obj_name, input.loc_id, input.axe_id, input.parent_axe_id); +#endif + if((dset->dapl_id = H5Pcopy(dapl_id)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTCOPY, NULL, "failed to copy dapl"); @@ -2211,7 +2319,7 @@ H5VL_iod_dataset_open(void *_obj, H5VL_loc_params_t loc_params, const char *name ret_value = (void *)dset; done: - free(new_name); + if(new_name) free(new_name); FUNC_LEAVE_NOAPI(ret_value) } /* end H5VL_iod_dataset_open() */ @@ -2400,12 +2508,13 @@ H5VL_iod_dataset_read(void *_dset, hid_t mem_type_id, hid_t mem_space_id, info->buf_ptr = buf; info->nelmts = nelmts; info->type_size = type_size; + info->cs_ptr = NULL; /* store a copy of the dataspace selection to be able to calculate the checksum later */ if(NULL == (info->space = H5S_copy(mem_space, FALSE, TRUE))) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINIT, FAIL, "unable to copy dataspace"); /* Get the dxpl plist structure */ if(NULL == (plist = (H5P_genplist_t *)H5I_object(dxpl_id))) - HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, NULL, "can't find object for ID"); + HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID"); /* store the pointer to the buffer where the checksum needs to be placed */ if(H5P_get(plist, H5D_XFER_CHECKSUM_PTR_NAME, &info->cs_ptr) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "unable to get checksum pointer value"); @@ -2558,7 +2667,7 @@ H5VL_iod_dataset_write(void *_dset, hid_t mem_type_id, hid_t mem_space_id, /* Get the dcpl plist structure */ if(NULL == (plist = (H5P_genplist_t *)H5I_object(dxpl_id))) - HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, NULL, "can't find object for ID"); + HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID"); if(H5P_get(plist, H5D_XFER_CHECKSUM_NAME, &user_cs) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "unable to get checksum value"); @@ -2966,10 +3075,17 @@ H5VL_iod_dataset_close(void *_dset, hid_t dxpl_id, void **req) -1 == dset->remote_dset.space_id) { /* Synchronously wait on the request attached to the dataset */ if(H5VL_iod_request_wait(dset->common.file, dset->common.request) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't wait on HG request"); + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't wait dset request"); dset->common.request = NULL; } + /* If this call is not asynchronous, complete and remove all + requests that are associated with this object from the List */ + if(!do_async) { + if(H5VL_iod_request_wait_some(dset->common.file, dset) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't wait on all object requests"); + } + /* determine the parent axe IDs array for this operation*/ if(H5VL_iod_get_axe_parents((H5VL_iod_object_t *)dset, &num_parents, NULL) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get num AXE parents"); @@ -3045,6 +3161,7 @@ H5VL_iod_dataset_close(void *_dset, hid_t dxpl_id, void **req) /* Synchronously wait on the request */ if(H5VL_iod_request_wait(dset->common.file, request) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't wait on HG request"); + /* Sanity check */ HDassert(request == &_request); } /* end else */ @@ -3079,7 +3196,7 @@ H5VL_iod_datatype_commit(void *_obj, H5VL_loc_params_t loc_params, const char *n dtype_commit_in_t input; iod_obj_id_t iod_id; iod_handle_t iod_oh; - char *new_name; /* resolved path to where we need to start traversal at the server */ + char *new_name = NULL; /* resolved path to where we need to start traversal at the server */ hg_request_t _hg_req; /* Local function shipper request, for sync. operations */ hg_request_t *hg_req = NULL; H5VL_iod_request_t _request; /* Local request, for sync. operations */ @@ -3143,12 +3260,16 @@ H5VL_iod_datatype_commit(void *_obj, H5VL_loc_params_t loc_params, const char *n /* setup the local datatype struct */ /* store the entire path of the datatype locally */ - if (NULL == (dtype->common.obj_name = (char *)malloc - (HDstrlen(obj->obj_name) + HDstrlen(name) + 1))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate"); - HDstrcpy(dtype->common.obj_name, obj->obj_name); - HDstrcat(dtype->common.obj_name, name); - dtype->common.obj_name[HDstrlen(obj->obj_name) + HDstrlen(name) + 1] = '\0'; + { + size_t obj_name_len = HDstrlen(obj->obj_name); + size_t name_len = HDstrlen(name); + + if (NULL == (dtype->common.obj_name = (char *)HDmalloc(obj_name_len + name_len + 1))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate"); + HDmemcpy(dtype->common.obj_name, obj->obj_name, obj_name_len); + HDmemcpy(dtype->common.obj_name+obj_name_len, name, name_len); + dtype->common.obj_name[obj_name_len+name_len] = '\0'; + } /* store a copy of the datatype parameters*/ if((dtype->remote_dtype.tcpl_id = H5Pcopy(tcpl_id)) < 0) @@ -3206,6 +3327,7 @@ H5VL_iod_datatype_commit(void *_obj, H5VL_loc_params_t loc_params, const char *n ret_value = (void *)dtype; done: + if(new_name) free(new_name); FUNC_LEAVE_NOAPI(ret_value) } /* end H5VL_iod_datatype_commit() */ @@ -3232,7 +3354,7 @@ H5VL_iod_datatype_open(void *_obj, H5VL_loc_params_t loc_params, const char *nam dtype_open_in_t input; iod_obj_id_t iod_id; iod_handle_t iod_oh; - char *new_name; /* resolved path to where we need to start traversal at the server */ + char *new_name = NULL; /* resolved path to where we need to start traversal at the server */ hg_request_t _hg_req; /* Local function shipper request, for sync. operations */ hg_request_t *hg_req = NULL; H5VL_iod_request_t _request; /* Local request, for sync. operations */ @@ -3286,12 +3408,16 @@ H5VL_iod_datatype_open(void *_obj, H5VL_loc_params_t loc_params, const char *nam /* setup the local datatype struct */ /* store the entire path of the datatype locally */ - if (NULL == (dtype->common.obj_name = (char *)malloc - (HDstrlen(obj->obj_name) + HDstrlen(name) + 1))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate"); - HDstrcpy(dtype->common.obj_name, obj->obj_name); - HDstrcat(dtype->common.obj_name, name); - dtype->common.obj_name[HDstrlen(obj->obj_name) + HDstrlen(name) + 1] = '\0'; + { + size_t obj_name_len = HDstrlen(obj->obj_name); + size_t name_len = HDstrlen(name); + + if (NULL == (dtype->common.obj_name = (char *)HDmalloc(obj_name_len + name_len + 1))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate"); + HDmemcpy(dtype->common.obj_name, obj->obj_name, obj_name_len); + HDmemcpy(dtype->common.obj_name+obj_name_len, name, name_len); + dtype->common.obj_name[obj_name_len+name_len] = '\0'; + } if((dtype->tapl_id = H5Pcopy(tapl_id)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTCOPY, NULL, "failed to copy tapl"); @@ -3345,6 +3471,7 @@ H5VL_iod_datatype_open(void *_obj, H5VL_loc_params_t loc_params, const char *nam ret_value = (void *)dtype; done: + if(new_name) free(new_name); FUNC_LEAVE_NOAPI(ret_value) } /* end H5VL_iod_datatype_open() */ @@ -3383,6 +3510,43 @@ done: /*------------------------------------------------------------------------- + * Function: H5VL_iod_datatype_get + * + * Purpose: Gets certain information about a datatype + * + * Return: Success: 0 + * Failure: -1 + * + * Programmer: Mohamad Chaarawi + * June, 2013 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5VL_iod_datatype_get(void UNUSED *obj, H5VL_datatype_get_t get_type, + hid_t UNUSED dxpl_id, void UNUSED **req, va_list arguments) +{ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI_NOINIT + + switch (get_type) { + /* H5Tget_create_plist */ + case H5VL_DATATYPE_GET_TCPL: + { + /* Nothing to return here */ + break; + } + default: + HGOTO_ERROR(H5E_VOL, H5E_CANTGET, FAIL, "can't get this type of information from datatype") + } + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5VL_iod_datatype_get() */ + + +/*------------------------------------------------------------------------- * Function: H5VL_iod_datatype_close * * Purpose: Closes an datatype. @@ -3405,12 +3569,18 @@ H5VL_iod_datatype_close(void *obj, hid_t dxpl_id, void **req) hg_request_t *hg_req = NULL; H5VL_iod_request_t _request; /* Local request, for sync. operations */ H5VL_iod_request_t *request = NULL; - uint64_t parent_axe_id; hbool_t do_async = (req == NULL) ? FALSE : TRUE; /* Whether we're performing async. I/O */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI_NOINIT + /* If this call is not asynchronous, complete and remove all + requests that are associated with this object from the List */ + if(!do_async) { + if(H5VL_iod_request_wait_some(dtype->common.file, dtype) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "can't wait on all object requests"); + } + /* set the parent axe id */ if(dtype->common.request) input.parent_axe_id = dtype->common.request->axe_id; @@ -3455,6 +3625,11 @@ H5VL_iod_datatype_close(void *obj, hid_t dxpl_id, void **req) /* add request to container's linked list */ H5VL_iod_request_add(dtype->common.file, request); +#if H5VL_IOD_DEBUG + printf("Datatype Close %s, axe id %llu, parent %d\n", + dtype->common.obj_name, input.axe_id, input.parent_axe_id); +#endif + /* Store/wait on request */ if(do_async) { /* Sanity check */ @@ -3501,7 +3676,7 @@ H5VL_iod_attribute_create(void *_obj, H5VL_loc_params_t loc_params, const char * H5P_genplist_t *plist; iod_obj_id_t iod_id; iod_handle_t iod_oh; - char *new_name; /* resolved path to where we need to start traversal at the server */ + char *new_name = NULL; /* resolved path to where we need to start traversal at the server */ const char *path; /* path on where the traversal starts relative to the location object specified */ hg_request_t _hg_req; /* Local function shipper request, for sync. operations */ hg_request_t *hg_req = NULL; @@ -3558,11 +3733,6 @@ H5VL_iod_attribute_create(void *_obj, H5VL_loc_params_t loc_params, const char * input.space_id = space_id; input.axe_id = axe_id ++; -#if H5VL_IOD_DEBUG - printf("Attribute Create %s IOD ID %llu, axe id %llu, parent %llu\n", - attr_name, input.attr_id, input.axe_id, input.parent_axe_id); -#endif - /* get a function shipper request */ if(do_async) { if(NULL == (hg_req = (hg_request_t *)H5MM_malloc(sizeof(hg_request_t)))) @@ -3583,18 +3753,27 @@ H5VL_iod_attribute_create(void *_obj, H5VL_loc_params_t loc_params, const char * attr->loc_name = HDstrdup(obj->obj_name); } else if (loc_params.type == H5VL_OBJECT_BY_NAME) { + size_t obj_name_len = HDstrlen(obj->obj_name); + size_t name_len; + path = loc_params.loc_data.loc_by_name.name; - if (NULL == (attr->loc_name = (char *)malloc - (HDstrlen(obj->obj_name) + HDstrlen(path) + 1))) + name_len = HDstrlen(path); + + if (NULL == (attr->loc_name = (char *)HDmalloc(obj_name_len + name_len + 1))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate"); - HDstrcpy(attr->loc_name, obj->obj_name); - HDstrcat(attr->loc_name, path); - attr->loc_name[HDstrlen(obj->obj_name) + HDstrlen(path) + 1] = '\0'; + HDmemcpy(attr->loc_name, obj->obj_name, obj_name_len); + HDmemcpy(attr->loc_name+obj_name_len, path, name_len); + attr->loc_name[obj_name_len+name_len] = '\0'; } /* store the name of the attribute locally */ attr->common.obj_name = strdup(attr_name); +#if H5VL_IOD_DEBUG + printf("Attribute Create %s IOD ID %llu, axe id %llu, parent %llu\n", + attr_name, input.attr_id, input.axe_id, input.parent_axe_id); +#endif + /* copy property lists, dtype, and dspace*/ if((attr->remote_attr.acpl_id = H5Pcopy(acpl_id)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTCOPY, NULL, "failed to copy acpl"); @@ -3652,7 +3831,7 @@ H5VL_iod_attribute_create(void *_obj, H5VL_loc_params_t loc_params, const char * ret_value = (void *)attr; done: - free(new_name); + if(new_name) free(new_name); FUNC_LEAVE_NOAPI(ret_value) } /* end H5VL_iod_attribute_create() */ @@ -3677,7 +3856,7 @@ H5VL_iod_attribute_open(void *_obj, H5VL_loc_params_t loc_params, const char *at H5VL_iod_object_t *obj = (H5VL_iod_object_t *)_obj; /* location object to create the attribute */ H5VL_iod_attr_t *attr = NULL; /* the attribute object that is created and passed to the user */ attr_open_in_t input; - char *new_name; /* resolved path to where we need to start traversal at the server */ + char *new_name = NULL; /* resolved path to where we need to start traversal at the server */ const char *path; /* path on where the traversal starts relative to the location object specified */ iod_obj_id_t iod_id; iod_handle_t iod_oh; @@ -3741,13 +3920,17 @@ H5VL_iod_attribute_open(void *_obj, H5VL_loc_params_t loc_params, const char *at attr->loc_name = HDstrdup(obj->obj_name); } else if (loc_params.type == H5VL_OBJECT_BY_NAME) { + size_t obj_name_len = HDstrlen(obj->obj_name); + size_t name_len; + path = loc_params.loc_data.loc_by_name.name; - if (NULL == (attr->loc_name = (char *)malloc - (HDstrlen(obj->obj_name) + HDstrlen(path) + 1))) + name_len = HDstrlen(path); + + if (NULL == (attr->loc_name = (char *)HDmalloc(obj_name_len + name_len + 1))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate"); - HDstrcpy(attr->loc_name, obj->obj_name); - HDstrcat(attr->loc_name, path); - attr->loc_name[HDstrlen(obj->obj_name) + HDstrlen(path) + 1] = '\0'; + HDmemcpy(attr->loc_name, obj->obj_name, obj_name_len); + HDmemcpy(attr->loc_name+obj_name_len, path, name_len); + attr->loc_name[obj_name_len+name_len] = '\0'; } /* store the name of the attribute locally */ @@ -3802,7 +3985,7 @@ H5VL_iod_attribute_open(void *_obj, H5VL_loc_params_t loc_params, const char *at ret_value = (void *)attr; done: - free(new_name); + if(new_name) free(new_name); FUNC_LEAVE_NOAPI(ret_value) } /* end H5VL_iod_attribute_open() */ @@ -4095,7 +4278,7 @@ H5VL_iod_attribute_remove(void *_obj, H5VL_loc_params_t loc_params, const char * attr_op_in_t input; iod_obj_id_t iod_id; iod_handle_t iod_oh; - char *new_name; /* resolved path to where we need to start traversal at the server */ + char *new_name = NULL; /* resolved path to where we need to start traversal at the server */ hg_request_t _hg_req; /* Local function shipper request, for sync. operations */ hg_request_t *hg_req = NULL; H5VL_iod_request_t _request; /* Local request, for sync. operations */ @@ -4172,9 +4355,7 @@ H5VL_iod_attribute_remove(void *_obj, H5VL_loc_params_t loc_params, const char * } /* end else */ done: - - free(new_name); - + if(new_name) free(new_name); FUNC_LEAVE_NOAPI(ret_value) } /* end H5VL_iod_attribute_remove() */ @@ -4299,7 +4480,7 @@ H5VL_iod_attribute_get(void *_obj, H5VL_attr_get_t get_type, hid_t dxpl_id, H5VL_loc_params_t loc_params = va_arg (arguments, H5VL_loc_params_t); char *attr_name = va_arg (arguments, char *); htri_t *ret = va_arg (arguments, htri_t *); - char *new_name; + char *new_name = NULL; attr_op_in_t input; /* Retrieve the parent AXE id by traversing the path where the @@ -4364,7 +4545,7 @@ H5VL_iod_attribute_get(void *_obj, H5VL_attr_get_t get_type, hid_t dxpl_id, HDassert(request == &_request); } /* end else */ - free(new_name); + if(new_name) free(new_name); break; } /* H5Aget_info */ @@ -4443,6 +4624,13 @@ H5VL_iod_attribute_close(void *_attr, hid_t dxpl_id, void **req) attr->common.request = NULL; } + /* If this call is not asynchronous, complete and remove all + requests that are associated with this object from the List */ + if(!do_async) { + if(H5VL_iod_request_wait_some(attr->common.file, attr) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "can't wait on all object requests"); + } + /* get all the parents required to complete before this operation can start */ if(H5VL_iod_get_axe_parents((H5VL_iod_object_t *)attr, &num_parents, NULL) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't get num AXE parents"); @@ -4740,10 +4928,10 @@ H5VL_iod_link_create(H5VL_link_create_type_t create_type, void *_obj, H5VL_loc_p HDassert(request == &_request); } /* end else */ - free(loc_name); - free(new_name); - done: + if(loc_name) free(loc_name); + if(new_name) free(new_name); + FUNC_LEAVE_NOAPI(ret_value) } /* end H5VL_iod_link_create() */ @@ -4804,13 +4992,16 @@ H5VL_iod_link_move(void *_src_obj, H5VL_loc_params_t loc_params1, char *link_name = NULL; /* generate the entire path of the new link */ - if (NULL == (link_name = (char *)malloc(HDstrlen(dst_obj->obj_name) + - HDstrlen(loc_params2.loc_data.loc_by_name.name) + 1))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate"); - HDstrcpy(link_name, dst_obj->obj_name); - HDstrcat(link_name, loc_params2.loc_data.loc_by_name.name); - link_name[HDstrlen(dst_obj->obj_name) + - HDstrlen(loc_params2.loc_data.loc_by_name.name) + 1] = '\0'; + { + size_t obj_name_len = HDstrlen(dst_obj->obj_name); + size_t name_len = HDstrlen(loc_params2.loc_data.loc_by_name.name); + + if (NULL == (link_name = (char *)HDmalloc(obj_name_len + name_len + 1))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate"); + HDmemcpy(link_name, dst_obj->obj_name, obj_name_len); + HDmemcpy(link_name+obj_name_len, loc_params2.loc_data.loc_by_name.name, name_len); + link_name[obj_name_len+name_len] = '\0'; + } //H5VL_iod_update_link(dst_obj, loc_params2, link_name); free(link_name); } @@ -4888,8 +5079,8 @@ H5VL_iod_link_move(void *_src_obj, H5VL_loc_params_t loc_params1, } /* end else */ done: - free(src_name); - free(dst_name); + if(src_name) free(src_name); + if(dst_name) free(dst_name); FUNC_LEAVE_NOAPI(ret_value) } /* end H5VL_iod_link_move() */ @@ -5022,7 +5213,7 @@ H5VL_iod_link_get(void *_obj, H5VL_loc_params_t loc_params, H5VL_link_get_t get_ HDassert(request == &_request); } /* end else */ - free(new_name); + if(new_name) free(new_name); break; } /* H5Lget_info/H5Lget_info_by_idx */ @@ -5153,8 +5344,8 @@ H5VL_iod_link_remove(void *_obj, H5VL_loc_params_t loc_params, hid_t dxpl_id, vo HDassert(request == &_request); } /* end else */ - free(new_name); done: + if(new_name) free(new_name); FUNC_LEAVE_NOAPI(ret_value) } /* end H5VL_iod_link_remove() */ @@ -5181,7 +5372,7 @@ H5VL_iod_object_open(void *_obj, H5VL_loc_params_t loc_params, H5VL_iod_request_t request; /* Local request, for sync. operations */ H5VL_iod_remote_object_t remote_obj; /* generic remote object structure */ object_op_in_t input; - char *new_name; + char *new_name = NULL; void *ret_value; FUNC_ENTER_NOAPI_NOINIT @@ -5243,14 +5434,18 @@ H5VL_iod_object_open(void *_obj, H5VL_loc_params_t loc_params, /* setup the local dataset struct */ /* store the entire path of the dataset locally */ - if (NULL == (dset->common.obj_name = (char *)malloc - (HDstrlen(obj->obj_name) + - HDstrlen(loc_params.loc_data.loc_by_name.name) + 1))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate"); - HDstrcpy(dset->common.obj_name, obj->obj_name); - HDstrcat(dset->common.obj_name, loc_params.loc_data.loc_by_name.name); - dset->common.obj_name[HDstrlen(obj->obj_name) + - HDstrlen(loc_params.loc_data.loc_by_name.name) + 1] = '\0'; + { + size_t obj_name_len = HDstrlen(obj->obj_name); + size_t name_len = HDstrlen(loc_params.loc_data.loc_by_name.name); + + if (NULL == (dset->common.obj_name = (char *)HDmalloc(obj_name_len + name_len + 1))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate"); + HDmemcpy(dset->common.obj_name, obj->obj_name, obj_name_len); + HDmemcpy(dset->common.obj_name+obj_name_len, + loc_params.loc_data.loc_by_name.name, name_len); + dset->common.obj_name[obj_name_len+name_len] = '\0'; + } + if((dset->dapl_id = H5Pcopy(H5P_DATASET_CREATE_DEFAULT)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTCOPY, NULL, "failed to copy dapl"); @@ -5284,14 +5479,19 @@ H5VL_iod_object_open(void *_obj, H5VL_loc_params_t loc_params, /* setup the local dataset struct */ /* store the entire path of the dataset locally */ - if (NULL == (dtype->common.obj_name = (char *)malloc - (HDstrlen(obj->obj_name) + - HDstrlen(loc_params.loc_data.loc_by_name.name) + 1))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate"); - HDstrcpy(dtype->common.obj_name, obj->obj_name); - HDstrcat(dtype->common.obj_name, loc_params.loc_data.loc_by_name.name); - dtype->common.obj_name[HDstrlen(obj->obj_name) + - HDstrlen(loc_params.loc_data.loc_by_name.name) + 1] = '\0'; + { + size_t obj_name_len = HDstrlen(obj->obj_name); + size_t name_len = HDstrlen(loc_params.loc_data.loc_by_name.name); + + if (NULL == (dtype->common.obj_name = (char *)HDmalloc + (obj_name_len + name_len + 1))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate"); + HDmemcpy(dtype->common.obj_name, obj->obj_name, obj_name_len); + HDmemcpy(dtype->common.obj_name+obj_name_len, + loc_params.loc_data.loc_by_name.name, name_len); + dtype->common.obj_name[obj_name_len+name_len] = '\0'; + } + if((dtype->tapl_id = H5Pcopy(H5P_DATATYPE_CREATE_DEFAULT)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTCOPY, NULL, "failed to copy dapl"); @@ -5323,14 +5523,18 @@ H5VL_iod_object_open(void *_obj, H5VL_loc_params_t loc_params, /* setup the local dataset struct */ /* store the entire path of the dataset locally */ - if (NULL == (grp->common.obj_name = (char *)malloc - (HDstrlen(obj->obj_name) + - HDstrlen(loc_params.loc_data.loc_by_name.name) + 1))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate"); - HDstrcpy(grp->common.obj_name, obj->obj_name); - HDstrcat(grp->common.obj_name, loc_params.loc_data.loc_by_name.name); - grp->common.obj_name[HDstrlen(obj->obj_name) + - HDstrlen(loc_params.loc_data.loc_by_name.name) + 1] = '\0'; + { + size_t obj_name_len = HDstrlen(obj->obj_name); + size_t name_len = HDstrlen(loc_params.loc_data.loc_by_name.name); + + if (NULL == (grp->common.obj_name = (char *)HDmalloc(obj_name_len + name_len + 1))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate"); + HDmemcpy(grp->common.obj_name, obj->obj_name, obj_name_len); + HDmemcpy(grp->common.obj_name+obj_name_len, + loc_params.loc_data.loc_by_name.name, name_len); + grp->common.obj_name[obj_name_len+name_len] = '\0'; + } + if((grp->gapl_id = H5Pcopy(H5P_GROUP_CREATE_DEFAULT)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTCOPY, NULL, "failed to copy gapl"); @@ -5348,7 +5552,7 @@ H5VL_iod_object_open(void *_obj, H5VL_loc_params_t loc_params, } done: - free(new_name); + if(new_name) free(new_name); FUNC_LEAVE_NOAPI(ret_value) } /* end H5VL_iod_object_open */ @@ -5467,8 +5671,8 @@ H5VL_iod_object_copy(void *_src_obj, H5VL_loc_params_t loc_params1, const char * } /* end else */ done: - free(new_src_name); - free(new_dst_name); + if(new_src_name) free(new_src_name); + if(new_dst_name) free(new_dst_name); FUNC_LEAVE_NOAPI(ret_value) } /* end H5VL_iod_object_copy() */ @@ -5537,7 +5741,7 @@ H5VL_iod_object_misc(void *_obj, H5VL_loc_params_t loc_params, H5VL_object_misc_ { const char *old_name = va_arg (arguments, const char *); const char *new_name = va_arg (arguments, const char *); - char *loc_name; + char *loc_name = NULL; attr_rename_in_t input; /* Retrieve the parent AXE id by traversing the path where the @@ -5608,7 +5812,7 @@ H5VL_iod_object_misc(void *_obj, H5VL_loc_params_t loc_params, H5VL_object_misc_ HDassert(request == &_request); } /* end else */ - free(loc_name); + if(loc_name) free(loc_name); break; } /* H5Oset_comment */ @@ -5682,7 +5886,7 @@ H5VL_iod_object_misc(void *_obj, H5VL_loc_params_t loc_params, H5VL_object_misc_ if(loc_params.type == H5VL_OBJECT_BY_SELF) obj->comment = HDstrdup(comment); - free(loc_name); + if(loc_name) free(loc_name); break; } /* H5Oincr_refcount / H5Odecr_refcount */ @@ -5810,7 +6014,7 @@ H5VL_iod_object_get(void *_obj, H5VL_loc_params_t loc_params, H5VL_object_get_t HDassert(request == &_request); } /* end else */ - free(new_name); + if(new_name) free(new_name); break; } /* H5Oget_comment / H5Oget_comment_by_name */ @@ -5915,7 +6119,7 @@ H5VL_iod_object_get(void *_obj, H5VL_loc_params_t loc_params, H5VL_object_get_t HDassert(request == &_request); } /* end else */ - free(new_name); + if(new_name) free(new_name); break; } /* H5Oget_info / H5Oget_info_by_name / H5Oget_info_by_idx */ diff --git a/src/H5VLiod_attr.c b/src/H5VLiod_attr.c new file mode 100644 index 0000000..d7863dd --- /dev/null +++ b/src/H5VLiod_attr.c @@ -0,0 +1,967 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by The HDF Group. * + * Copyright by the Board of Trustees of the University of Illinois. * + * All rights reserved. * + * * + * This file is part of HDF5. The full HDF5 copyright notice, including * + * terms governing use, modification, and redistribution, is contained in * + * the files COPYING and Copyright.html. COPYING can be found at the root * + * of the source code distribution tree; Copyright.html can be found at the * + * root level of an installed copy of the electronic HDF5 document set and * + * is linked from the top-level documents page. It can also be found at * + * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * + * access to either file, you may request a copy from help@hdfgroup.org. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#include "H5VLiod_server.h" + +#ifdef H5_HAVE_EFF + +/* + * Programmer: Mohamad Chaarawi <chaarawi@hdfgroup.gov> + * June, 2013 + * + * Purpose: The IOD plugin server side attribute routines. + */ + + +/*------------------------------------------------------------------------- + * Function: H5VL_iod_server_attr_create_cb + * + * Purpose: Creates a attr as a iod object. + * + * Return: Success: SUCCEED + * Failure: Negative + * + * Programmer: Mohamad Chaarawi + * April, 2013 + * + *------------------------------------------------------------------------- + */ +void +H5VL_iod_server_attr_create_cb(AXE_engine_t UNUSED axe_engine, + size_t UNUSED num_n_parents, AXE_task_t UNUSED n_parents[], + size_t UNUSED num_s_parents, AXE_task_t UNUSED s_parents[], + void *_op_data) +{ + op_data_t *op_data = (op_data_t *)_op_data; + attr_create_in_t *input = (attr_create_in_t *)op_data->input; + attr_create_out_t output; + iod_handle_t coh = input->coh; + iod_handle_t loc_handle = input->loc_oh; + iod_obj_id_t loc_id = input->loc_id; /* The ID of the current location object */ + iod_obj_id_t attr_id = input->attr_id; /* The ID of the attribute that needs to be created */ + iod_handle_t attr_oh, attr_kv_oh, cur_oh, mdkv_oh; + iod_obj_id_t cur_id, mdkv_id; + const char *loc_name = input->path; + const char *attr_name = input->attr_name; + char *last_comp = NULL; + iod_array_struct_t array; + iod_size_t *max_dims; + iod_kv_t kv; + size_t buf_size; + scratch_pad_t sp; + iod_ret_t ret; + hbool_t collective = FALSE; /* MSC - change when we allow for collective */ + herr_t ret_value = SUCCEED; + + FUNC_ENTER_NOAPI_NOINIT + +#if H5VL_IOD_DEBUG + fprintf(stderr, "Start attribute Create %s on object path %s\n", attr_name, loc_name); +#endif + + /* the traversal will retrieve the location where the attribute needs + to be created. The traversal will fail if an intermediate group + does not exist. */ + if(H5VL_iod_server_traverse(coh, loc_id, loc_handle, loc_name, FALSE, + &last_comp, &cur_id, &cur_oh) < 0) + HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't traverse path"); + + /* Set the IOD array creation parameters */ + array.cell_size = H5Tget_size(input->type_id); + array.num_dims = H5Sget_simple_extent_ndims(input->space_id); + if(NULL == (array.current_dims = (iod_size_t *)malloc (sizeof(iod_size_t) * array.num_dims))) + HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't allocate dimention size array"); + if(NULL == (max_dims = (iod_size_t *)malloc (sizeof(iod_size_t) * array.num_dims))) + HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't allocate dimention size array"); + if(H5Sget_simple_extent_dims(input->space_id, array.current_dims, max_dims) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't get dimentions' sizes"); + array.firstdim_max = max_dims[0]; + array.chunk_dims = NULL; + array.dims_seq = NULL; + + /* create the attribute */ + ret = iod_obj_create(coh, IOD_TID_UNKNOWN, NULL/*hints*/, IOD_OBJ_ARRAY, NULL, &array, + &attr_id, NULL /*event*/); + if(collective && (0 == ret || EEXISTS == ret)) { + /* Attribute has been created by another process, open it */ + if (iod_obj_open_write(coh, attr_id, NULL, &attr_oh, NULL) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't open attribute"); + } + else if(!collective && 0 != ret) { + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't create Attribute"); + } + + /* for the process that succeeded in creating the attribute, update + the parent scratch pad, create attribute scratch pad */ + if(0 == ret) { + /* create the metadata KV object for the attribute */ + if(iod_obj_create(coh, IOD_TID_UNKNOWN, NULL, IOD_OBJ_KV, + NULL, NULL, &mdkv_id, NULL) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't create metadata KV object"); + + /* set values for the scratch pad object */ + sp.mdkv_id = mdkv_id; + sp.attr_id = IOD_ID_UNDEFINED; + sp.filler1_id = IOD_ID_UNDEFINED; + sp.filler2_id = IOD_ID_UNDEFINED; + + /* set scratch pad in attribute */ + if (iod_obj_set_scratch(attr_oh, IOD_TID_UNKNOWN, &sp, NULL, NULL) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't set scratch pad"); + + /* Store Metadata in scratch pad */ + if (iod_obj_open_write(coh, mdkv_id, NULL, &mdkv_oh, NULL) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't create scratch pad"); + + /* MSC - TODO store things */ + +#if 0 + /* insert attribute metadata into scratch pad */ + kv.key = HDstrdup("attribute_dtype"); + /* determine the buffer size needed to store the encoded type of the attribute */ + if(H5Tencode(input->type_id, NULL, &buf_size) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTENCODE, FAIL, "failed to encode attribute type"); + if(NULL == (kv.value = malloc (buf_size))) + HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't allocate type buffer"); + /* encode datatype of the attribute */ + if(H5Tencode(input->type_id, kv.value, &buf_size) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTENCODE, FAIL, "failed to encode attribute type"); + kv.value_len = (iod_size_t)buf_size; + /* insert kv pair into scratch pad */ + if (iod_kv_set(mdkv_oh, IOD_TID_UNKNOWN, NULL, &kv, NULL, NULL) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't set KV pair in parent"); + HDfree(kv.key); + free(kv.value); + + kv.key = HDstrdup("attribute_dspace"); + /* determine the buffer size needed to store the encoded space of the attribute */ + if(H5Sencode(input->space_id, NULL, &buf_size) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTENCODE, FAIL, "failed to encode attribute space"); + if(NULL == (kv.value = malloc (buf_size))) + HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't allocate space buffer"); + /* encode dataspace of the attribute */ + if(H5Sencode(input->space_id, kv.value, &buf_size) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTENCODE, FAIL, "failed to encode attribute space"); + kv.value_len = (iod_size_t)buf_size; + /* insert kv pair into scratch pad */ + if (iod_kv_set(mdkv_oh, IOD_TID_UNKNOWN, NULL, &kv, NULL, NULL) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't set KV pair in parent"); + HDfree(kv.key); + free(kv.value); +#endif + + /* close the Metadata KV object */ + if(iod_obj_close(mdkv_oh, NULL, NULL)) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't close object"); + + /* get scratch pad of the parent */ + if(iod_obj_get_scratch(cur_oh, IOD_TID_UNKNOWN, &sp, NULL, NULL) < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, FAIL, "can't get scratch pad for object"); + + /* if attribute KV does not exist, create it */ + if(IOD_ID_UNDEFINED == sp.attr_id) { + /* create the attribute KV object for the parent */ + if(iod_obj_create(coh, IOD_TID_UNKNOWN, NULL, IOD_OBJ_KV, + NULL, NULL, &sp.attr_id, NULL)<0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't create Attr KV"); + + /* set scratch pad in attribute */ + if (iod_obj_set_scratch(cur_oh, IOD_TID_UNKNOWN, &sp, NULL, NULL) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't set scratch pad"); + } + + /* open the attribute KV in scratch pad */ + if (iod_obj_open_write(coh, sp.attr_id, NULL /*hints*/, &attr_kv_oh, NULL) < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, FAIL, "can't open scratch pad"); + + /* insert new attribute in scratch pad of current object */ + kv.key = HDstrdup(attr_name); + kv.value = &attr_id; + kv.value_len = 0; + if (iod_kv_set(attr_kv_oh, IOD_TID_UNKNOWN, NULL, &kv, NULL, NULL) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't set KV pair in parent"); + HDfree(kv.key); + + iod_obj_close(attr_kv_oh, NULL, NULL); + } + + /* close parent group if it is not the location we started the + traversal into */ + if(loc_handle.cookie != cur_oh.cookie) { + iod_obj_close(cur_oh, NULL, NULL); + } + +#if H5_DO_NATIVE + cur_oh.cookie = H5Acreate2(cur_oh.cookie, attr_name, input->type_id, + input->space_id, H5P_DEFAULT, H5P_DEFAULT); + HDassert(cur_oh.cookie); +#endif + + output.iod_oh = cur_oh; + +#if H5VL_IOD_DEBUG + fprintf(stderr, "Done with attr create, sending response to client\n"); +#endif + + HG_Handler_start_output(op_data->hg_handle, &output); + +done: + + /* return an UNDEFINED oh to the client if the operation failed */ + if(ret_value < 0) { + output.iod_oh.cookie = IOD_OH_UNDEFINED; + HG_Handler_start_output(op_data->hg_handle, &output); + } + + if(max_dims) free(max_dims); + if(array.current_dims) free(array.current_dims); + input = (attr_create_in_t *)H5MM_xfree(input); + op_data = (op_data_t *)H5MM_xfree(op_data); + last_comp = (char *)H5MM_xfree(last_comp); + + FUNC_LEAVE_NOAPI_VOID +} /* end H5VL_iod_server_attr_create_cb() */ + + +/*------------------------------------------------------------------------- + * Function: H5VL_iod_server_attr_open_cb + * + * Purpose: Opens a attribute as a iod object. + * + * Return: Success: SUCCEED + * Failure: Negative + * + * Programmer: Mohamad Chaarawi + * April, 2013 + * + *------------------------------------------------------------------------- + */ +void +H5VL_iod_server_attr_open_cb(AXE_engine_t UNUSED axe_engine, + size_t UNUSED num_n_parents, AXE_task_t UNUSED n_parents[], + size_t UNUSED num_s_parents, AXE_task_t UNUSED s_parents[], + void *_op_data) +{ + op_data_t *op_data = (op_data_t *)_op_data; + attr_open_in_t *input = (attr_open_in_t *)op_data->input; + attr_open_out_t output; + iod_handle_t coh = input->coh; + iod_handle_t loc_handle = input->loc_oh; + iod_obj_id_t loc_id = input->loc_id; + iod_handle_t attr_kv_oh, cur_oh, mdkv_oh; + iod_obj_id_t cur_id, mdkv_id; + iod_obj_id_t attr_id; + const char *loc_name = input->path; + const char *attr_name = input->attr_name; + char *last_comp = NULL; + scratch_pad_t sp; + herr_t ret_value = SUCCEED; + + FUNC_ENTER_NOAPI_NOINIT + +#if H5VL_IOD_DEBUG + fprintf(stderr, "Start attribute Open %s\n", attr_name); +#endif + + /* the traversal will retrieve the location where the attribute needs + to be opened. The traversal will fail if an intermediate group + does not exist. */ + if(H5VL_iod_server_traverse(coh, loc_id, loc_handle, loc_name, FALSE, + &last_comp, &cur_id, &cur_oh) < 0) + HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't traverse path"); + + /* get scratch pad of the parent */ + if(iod_obj_get_scratch(cur_oh, IOD_TID_UNKNOWN, &sp, NULL, NULL) < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, FAIL, "can't get scratch pad for object"); + + /* if attribute KV does not exist, return error*/ + if(IOD_ID_UNDEFINED == sp.attr_id) + HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, FAIL, "Object has no attributes"); + + /* open the attribute KV in scratch pad */ + if (iod_obj_open_write(coh, sp.attr_id, NULL /*hints*/, &attr_kv_oh, NULL) < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, FAIL, "can't open scratch pad"); + + /* get attribute ID */ + if(iod_kv_get_value(attr_kv_oh, IOD_TID_UNKNOWN, attr_name, &attr_id, + sizeof(iod_obj_id_t) , NULL, NULL) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't retrieve Attribute ID from parent KV store"); + + /* close parent group if it is not the location we started the + traversal into */ + if(loc_handle.cookie != cur_oh.cookie) { + iod_obj_close(cur_oh, NULL, NULL); + } + + iod_obj_close(attr_kv_oh, NULL, NULL); + + /* open the attribute */ + if (iod_obj_open_write(coh, attr_id, NULL /*hints*/, &cur_oh, NULL) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't open current group"); + + /* get scratch pad of the attribute */ + if(iod_obj_get_scratch(cur_oh, IOD_TID_UNKNOWN, &sp, NULL, NULL) < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, FAIL, "can't get scratch pad for object"); + + /* open the metadata scratch pad of the attribute */ + if (iod_obj_open_write(coh, sp.mdkv_id, NULL /*hints*/, &mdkv_oh, NULL) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "can't open scratch pad"); + + /* MSC - retrieve all metadata from scratch pad */ + + /* close the metadata scratch pad */ + if(iod_obj_close(mdkv_oh, NULL, NULL)) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't close object"); + + { + hsize_t dims[1]; + //hid_t space_id, type_id; + +#if H5_DO_NATIVE + printf("attr name %s location %d %s\n", attr_name, loc_handle.cookie, loc_name); + if(strcmp(loc_name, ".") == 0) + cur_oh.cookie = H5Aopen(loc_handle.cookie, attr_name, H5P_DEFAULT); + else + cur_oh.cookie = H5Aopen_by_name(loc_handle.cookie, loc_name, + attr_name, H5P_DEFAULT, H5P_DEFAULT); + HDassert(cur_oh.cookie); + output.space_id = H5Aget_space(cur_oh.cookie); + output.type_id = H5Aget_type(cur_oh.cookie); + output.acpl_id = H5P_ATTRIBUTE_CREATE_DEFAULT; +#else + /* fake a dataspace, type, and dcpl */ + dims [0] = 60; + output.space_id = H5Screate_simple(1, dims, NULL); + output.type_id = H5Tcopy(H5T_NATIVE_INT); + output.acpl_id = H5P_ATTRIBUTE_CREATE_DEFAULT; +#endif + } + + output.iod_id = attr_id; + output.iod_oh = cur_oh; + +#if H5VL_IOD_DEBUG + fprintf(stderr, "Done with attr open, sending response to client\n"); +#endif + + HG_Handler_start_output(op_data->hg_handle, &output); + +done: + if(ret_value < 0) { + output.iod_oh.cookie = IOD_OH_UNDEFINED; + output.iod_id = IOD_ID_UNDEFINED; + HG_Handler_start_output(op_data->hg_handle, &output); + } + + H5Sclose(output.space_id); + H5Tclose(output.type_id); + + input = (attr_open_in_t *)H5MM_xfree(input); + op_data = (op_data_t *)H5MM_xfree(op_data); + last_comp = (char *)H5MM_xfree(last_comp); + + FUNC_LEAVE_NOAPI_VOID +} /* end H5VL_iod_server_attr_open_cb() */ + + +/*------------------------------------------------------------------------- + * Function: H5VL_iod_server_attr_read_cb + * + * Purpose: Reads from IOD into the function shipper BDS handle. + * + * Return: Success: SUCCEED + * Failure: Negative + * + * Programmer: Mohamad Chaarawi + * April, 2013 + * + *------------------------------------------------------------------------- + */ +void +H5VL_iod_server_attr_read_cb(AXE_engine_t UNUSED axe_engine, + size_t UNUSED num_n_parents, AXE_task_t UNUSED n_parents[], + size_t UNUSED num_s_parents, AXE_task_t UNUSED s_parents[], + void *_op_data) +{ + op_data_t *op_data = (op_data_t *)_op_data; + attr_io_in_t *input = (attr_io_in_t *)op_data->input; + iod_handle_t coh = input->coh; + iod_handle_t iod_oh = input->iod_oh; + iod_obj_id_t iod_id = input->iod_id; + hg_bulk_t bulk_handle = input->bulk_handle; + hid_t type_id = input->type_id; + hg_bulk_block_t bulk_block_handle; + hg_bulk_request_t bulk_request; + iod_mem_desc_t mem_desc; + iod_array_iodesc_t file_desc; + size_t size; + void *buf; + na_addr_t dest = HG_Handler_get_addr(op_data->hg_handle); + hbool_t opened_locally = FALSE; + herr_t ret_value = SUCCEED; + + FUNC_ENTER_NOAPI_NOINIT + + /* open the attribute if we don't have the handle yet */ + if(iod_oh.cookie == IOD_OH_UNDEFINED) { + if (iod_obj_open_write(coh, iod_id, NULL /*hints*/, &iod_oh, NULL) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't open current group"); + opened_locally = TRUE; + } + + size = HG_Bulk_handle_get_size(bulk_handle); + + if(NULL == (buf = malloc(size))) + HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't allocate read buffer"); + +#if 0 + /* create memory descriptor for reading */ + mem_desc.nfrag = 1; + mem_desc.frag->addr = buf; + mem_desc.frag->len = (iod_size_t)size; + + /* retrieve the dataspace of the attribute and create file descriptor for reading */ + /* MSC TODO - populate file descriptor hyperslab */ +#endif + + /* read from array object */ + if(iod_array_read(iod_oh, IOD_TID_UNKNOWN, NULL, &mem_desc, &file_desc, NULL, NULL) < 0) + HGOTO_ERROR(H5E_SYM, H5E_READERROR, FAIL, "can't read from array object"); + + { + int i; + hbool_t flag; + int *buf_ptr = (int *)buf; + +#if H5_DO_NATIVE + ret_value = H5Aread(iod_oh.cookie, type_id, buf); +#else + for(i=0;i<60;++i) + buf_ptr[i] = i; +#endif + } + + /* Create a new block handle to write the data */ + HG_Bulk_block_handle_create(buf, size, HG_BULK_READ_ONLY, &bulk_block_handle); + + /* Write bulk data here and wait for the data to be there */ + if(HG_SUCCESS != HG_Bulk_write_all(dest, bulk_handle, bulk_block_handle, &bulk_request)) + HGOTO_ERROR(H5E_SYM, H5E_READERROR, FAIL, "can't read from array object"); + /* wait for it to complete */ + if(HG_SUCCESS != HG_Bulk_wait(bulk_request, HG_BULK_MAX_IDLE_TIME, HG_BULK_STATUS_IGNORE)) + HGOTO_ERROR(H5E_SYM, H5E_READERROR, FAIL, "can't read from array object"); + +done: +#if H5VL_IOD_DEBUG + fprintf(stderr, "Done with attr read, sending response to client\n"); +#endif + + if(HG_SUCCESS != HG_Handler_start_output(op_data->hg_handle, &ret_value)) + HDONE_ERROR(H5E_SYM, H5E_WRITEERROR, FAIL, "can't send result of write to client"); + if(HG_SUCCESS != HG_Bulk_block_handle_free(bulk_block_handle)) + HDONE_ERROR(H5E_SYM, H5E_WRITEERROR, FAIL, "can't free bds block handle"); + + input = (attr_io_in_t *)H5MM_xfree(input); + op_data = (op_data_t *)H5MM_xfree(op_data); + free(buf); + + /* close the attribute if we opened it in this routine */ + if(opened_locally) { + if(iod_obj_close(iod_oh, NULL, NULL)) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't close Array object"); + } + + FUNC_LEAVE_NOAPI_VOID +} /* end H5VL_iod_server_attr_read_cb() */ + + +/*------------------------------------------------------------------------- + * Function: H5VL_iod_server_attr_write_cb + * + * Purpose: Writes from IOD into the function shipper BDS handle. + * + * Return: Success: SUCCEED + * Failure: Negative + * + * Programmer: Mohamad Chaarawi + * April, 2013 + * + *------------------------------------------------------------------------- + */ +void +H5VL_iod_server_attr_write_cb(AXE_engine_t UNUSED axe_engine, + size_t UNUSED num_n_parents, AXE_task_t UNUSED n_parents[], + size_t UNUSED num_s_parents, AXE_task_t UNUSED s_parents[], + void *_op_data) +{ + op_data_t *op_data = (op_data_t *)_op_data; + attr_io_in_t *input = (attr_io_in_t *)op_data->input; + iod_handle_t coh = input->coh; + iod_handle_t iod_oh = input->iod_oh; + iod_obj_id_t iod_id = input->iod_id; + hg_bulk_t bulk_handle = input->bulk_handle; + hid_t type_id = input->type_id; + hg_bulk_block_t bulk_block_handle; + hg_bulk_request_t bulk_request; + iod_mem_desc_t mem_desc; + iod_array_iodesc_t file_desc; + size_t size; + void *buf; + ssize_t ret; + na_addr_t source = HG_Handler_get_addr(op_data->hg_handle); + hbool_t opened_locally = FALSE; + herr_t ret_value = SUCCEED; + + FUNC_ENTER_NOAPI_NOINIT + + /* open the attribute if we don't have the handle yet */ + if(iod_oh.cookie == IOD_OH_UNDEFINED) { + if (iod_obj_open_write(coh, iod_id, NULL /*hints*/, &iod_oh, NULL) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't open current group"); + } + + /* Read bulk data here and wait for the data to be here */ + size = HG_Bulk_handle_get_size(bulk_handle); + if(NULL == (buf = malloc(size))) + HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't allocate read buffer"); + + HG_Bulk_block_handle_create(buf, size, HG_BULK_READWRITE, &bulk_block_handle); + + /* Write bulk data here and wait for the data to be there */ + if(HG_SUCCESS != HG_Bulk_read_all(source, bulk_handle, bulk_block_handle, &bulk_request)) + HGOTO_ERROR(H5E_SYM, H5E_WRITEERROR, FAIL, "can't get data from function shipper"); + /* wait for it to complete */ + if(HG_SUCCESS != HG_Bulk_wait(bulk_request, HG_BULK_MAX_IDLE_TIME, HG_BULK_STATUS_IGNORE)) + HGOTO_ERROR(H5E_SYM, H5E_WRITEERROR, FAIL, "can't get data from function shipper"); + + /* free the bds block handle */ + if(HG_SUCCESS != HG_Bulk_block_handle_free(bulk_block_handle)) + HGOTO_ERROR(H5E_SYM, H5E_WRITEERROR, FAIL, "can't free bds block handle"); + +#if H5VL_IOD_DEBUG + { + int i; + int *buf_ptr = (int *)buf; + + fprintf(stderr, "AWRITE Received a buffer of size %d with values: ", size); + for(i=0;i<60;++i) + fprintf(stderr, "%d ", buf_ptr[i]); + fprintf(stderr, "\n"); + } +#endif + +#if 0 + mem_desc.nfrag = 1; + mem_desc.frag->addr = buf; + mem_desc.frag->len = (iod_size_t)size; + + /* retrieve the dataspace of the attribute and create file descriptor for reading */ + /* MSC TODO - populate file descriptor hyperslab */ +#endif + + /* write from array object */ + if(iod_array_write(iod_oh, IOD_TID_UNKNOWN, NULL, &mem_desc, &file_desc, NULL, NULL) < 0) + HGOTO_ERROR(H5E_SYM, H5E_WRITEERROR, FAIL, "can't write to array object"); + +#if H5_DO_NATIVE + ret_value = H5Awrite(iod_oh.cookie, type_id, buf); +#endif + +done: +#if H5VL_IOD_DEBUG + fprintf(stderr, "Done with attr write, sending %d response to client\n", ret_value); +#endif + + if(HG_SUCCESS != HG_Handler_start_output(op_data->hg_handle, &ret_value)) + HDONE_ERROR(H5E_SYM, H5E_WRITEERROR, FAIL, "can't send result of write to client"); + + input = (attr_io_in_t *)H5MM_xfree(input); + op_data = (op_data_t *)H5MM_xfree(op_data); + free(buf); + + /* close the dataset if we opened it in this routine */ + if(opened_locally) { + if(iod_obj_close(iod_oh, NULL, NULL)) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't close Array object"); + } + FUNC_LEAVE_NOAPI_VOID +} /* end H5VL_iod_server_attr_write_cb() */ + + +/*------------------------------------------------------------------------- + * Function: H5VL_iod_server_attr_exists_cb + * + * Purpose: Checks if an attribute exists on object. + * + * Return: Success: SUCCEED + * Failure: Negative + * + * Programmer: Mohamad Chaarawi + * April, 2013 + * + *------------------------------------------------------------------------- + */ +void +H5VL_iod_server_attr_exists_cb(AXE_engine_t UNUSED axe_engine, + size_t UNUSED num_n_parents, AXE_task_t UNUSED n_parents[], + size_t UNUSED num_s_parents, AXE_task_t UNUSED s_parents[], + void *_op_data) +{ + op_data_t *op_data = (op_data_t *)_op_data; + attr_op_in_t *input = (attr_op_in_t *)op_data->input; + iod_handle_t coh = input->coh; + iod_handle_t loc_handle = input->loc_oh; + iod_obj_id_t loc_id = input->loc_id; + iod_handle_t cur_oh, attr_kv_oh; + iod_obj_id_t cur_id, attr_id; + const char *loc_name = input->path; + const char *attr_name = input->attr_name; + char *last_comp = NULL; + scratch_pad_t sp; + htri_t ret = -1; + herr_t ret_value = SUCCEED; + + FUNC_ENTER_NOAPI_NOINIT + +#if H5VL_IOD_DEBUG + fprintf(stderr, "Start attribute Exists %s\n", attr_name); +#endif + + /* the traversal will retrieve the location where the attribute needs + to be checked. The traversal will fail if an intermediate group + does not exist. */ + if(H5VL_iod_server_traverse(coh, loc_id, loc_handle, loc_name, FALSE, + &last_comp, &cur_id, &cur_oh) < 0) + HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't traverse path"); + + /* get scratch pad of the parent */ + if(iod_obj_get_scratch(cur_oh, IOD_TID_UNKNOWN, &sp, NULL, NULL) < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, FAIL, "can't get scratch pad for object"); + + /* close parent group if it is not the location we started the + traversal into */ + if(loc_handle.cookie != cur_oh.cookie) { + iod_obj_close(cur_oh, NULL, NULL); + } + + /* if attribute KV does not exist, return false*/ + if(IOD_ID_UNDEFINED == sp.attr_id) { + ret = FALSE; + HGOTO_DONE(SUCCEED); + } + + /* open the attribute KV in scratch pad */ + if (iod_obj_open_write(coh, sp.attr_id, NULL /*hints*/, &attr_kv_oh, NULL) < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, FAIL, "can't open scratch pad"); + + /* get attribute ID */ + if(iod_kv_get_value(attr_kv_oh, IOD_TID_UNKNOWN, attr_name, &attr_id, + sizeof(iod_obj_id_t) , NULL, NULL) < 0) { + ret = FALSE; + } + else { + ret = TRUE; + } + + iod_obj_close(attr_kv_oh, NULL, NULL); + +#if H5_DO_NATIVE + ret = H5Aexists(loc_handle.cookie, attr_name); +#else + ret = FALSE; +#endif + +done: + +#if H5VL_IOD_DEBUG + fprintf(stderr, "Done with attr exists, sending response to client\n"); +#endif + + HG_Handler_start_output(op_data->hg_handle, &ret); + + input = (attr_op_in_t *)H5MM_xfree(input); + op_data = (op_data_t *)H5MM_xfree(op_data); + last_comp = (char *)H5MM_xfree(last_comp); + + FUNC_LEAVE_NOAPI_VOID +} /* end H5VL_iod_server_attr_exists_cb() */ + + +/*------------------------------------------------------------------------- + * Function: H5VL_iod_server_attr_rename_cb + * + * Purpose: Renames iod HDF5 attribute. + * + * Return: Success: SUCCEED + * Failure: Negative + * + * Programmer: Mohamad Chaarawi + * April, 2013 + * + *------------------------------------------------------------------------- + */ +void +H5VL_iod_server_attr_rename_cb(AXE_engine_t UNUSED axe_engine, + size_t UNUSED num_n_parents, AXE_task_t UNUSED n_parents[], + size_t UNUSED num_s_parents, AXE_task_t UNUSED s_parents[], + void *_op_data) +{ + op_data_t *op_data = (op_data_t *)_op_data; + attr_rename_in_t *input = (attr_rename_in_t *)op_data->input; + iod_handle_t coh = input->coh; + iod_handle_t loc_handle = input->loc_oh; + iod_obj_id_t loc_id = input->loc_id; + iod_handle_t cur_oh, attr_kv_oh; + iod_obj_id_t cur_id, attr_id; + const char *loc_name = input->path; + const char *old_name = input->old_attr_name; + const char *new_name = input->new_attr_name; + char *last_comp = NULL; + iod_kv_params_t kvs; + iod_kv_t kv; + scratch_pad_t sp; + herr_t ret_value = SUCCEED; + + FUNC_ENTER_NOAPI_NOINIT + +#if H5VL_IOD_DEBUG + fprintf(stderr, "Start attribute Rename %s to %s\n", old_name, new_name); +#endif + + /* the traversal will retrieve the location where the attribute + needs to be renamed. The traversal will fail if an intermediate + group does not exist. */ + if(H5VL_iod_server_traverse(coh, loc_id, loc_handle, loc_name, FALSE, + &last_comp, &cur_id, &cur_oh) < 0) + HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't traverse path"); + + /* get scratch pad of the parent */ + if(iod_obj_get_scratch(cur_oh, IOD_TID_UNKNOWN, &sp, NULL, NULL) < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, FAIL, "can't get scratch pad for object"); + + /* close parent group if it is not the location we started the + traversal into */ + if(loc_handle.cookie != cur_oh.cookie) { + iod_obj_close(cur_oh, NULL, NULL); + } + + /* if attribute KV does not exist, return error*/ + if(IOD_ID_UNDEFINED == sp.attr_id) + HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, FAIL, "Object has no attributes"); + + /* open the attribute KV in scratch pad */ + if (iod_obj_open_write(coh, sp.attr_id, NULL /*hints*/, &attr_kv_oh, NULL) < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, FAIL, "can't open scratch pad"); + + /* get attribute ID */ + if(iod_kv_get_value(attr_kv_oh, IOD_TID_UNKNOWN, old_name, &attr_id, + sizeof(iod_obj_id_t) , NULL, NULL) < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, FAIL, "Attribute does not exist"); + + /* remove attribute with old name */ + kv.key = old_name; + kv.value = &attr_id; + kv.value_len = sizeof(iod_obj_id_t); + kvs.kv = &kv; + if(iod_kv_unlink_keys(attr_kv_oh,IOD_TID_UNKNOWN, NULL, 1, &kvs, NULL) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTDEC, FAIL, "Unable to unlink KV pair"); + + /* insert attribute with new name */ + kv.key = strdup(new_name); + kv.value = &attr_id; + kv.value_len = sizeof(iod_obj_id_t); + if (iod_kv_set(attr_kv_oh, IOD_TID_UNKNOWN, NULL, &kv, NULL, NULL) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't set KV pair in parent"); + HDfree(kv.key); + + iod_obj_close(attr_kv_oh, NULL, NULL); + +#if H5_DO_NATIVE + ret_value = H5Arename(loc_handle.cookie, old_name, new_name); +#endif + +done: + +#if H5VL_IOD_DEBUG + fprintf(stderr, "Done with attr rename, sending response to client\n"); +#endif + + HG_Handler_start_output(op_data->hg_handle, &ret_value); + + input = (attr_rename_in_t *)H5MM_xfree(input); + op_data = (op_data_t *)H5MM_xfree(op_data); + last_comp = (char *)H5MM_xfree(last_comp); + + FUNC_LEAVE_NOAPI_VOID +} /* end H5VL_iod_server_attr_rename_cb() */ + + +/*------------------------------------------------------------------------- + * Function: H5VL_iod_server_attr_remove_cb + * + * Purpose: Removes iod HDF5 attribute. + * + * Return: Success: SUCCEED + * Failure: Negative + * + * Programmer: Mohamad Chaarawi + * April, 2013 + * + *------------------------------------------------------------------------- + */ +void +H5VL_iod_server_attr_remove_cb(AXE_engine_t UNUSED axe_engine, + size_t UNUSED num_n_parents, AXE_task_t UNUSED n_parents[], + size_t UNUSED num_s_parents, AXE_task_t UNUSED s_parents[], + void *_op_data) +{ + op_data_t *op_data = (op_data_t *)_op_data; + attr_op_in_t *input = (attr_op_in_t *)op_data->input; + iod_handle_t coh = input->coh; + iod_handle_t loc_handle = input->loc_oh; + iod_obj_id_t loc_id = input->loc_id; + iod_handle_t cur_oh, attr_kv_oh; + iod_obj_id_t cur_id, attr_id; + const char *loc_name = input->path; + const char *attr_name = input->attr_name; + char *last_comp = NULL; + iod_kv_params_t kvs; + iod_kv_t kv; + scratch_pad_t sp; + herr_t ret_value = SUCCEED; + + FUNC_ENTER_NOAPI_NOINIT + +#if H5VL_IOD_DEBUG + fprintf(stderr, "Start attribute Remove %s\n", attr_name); +#endif + + /* the traversal will retrieve the location where the attribute + needs to be removed. The traversal will fail if an intermediate + group does not exist. */ + if(H5VL_iod_server_traverse(coh, loc_id, loc_handle, loc_name, FALSE, + &last_comp, &cur_id, &cur_oh) < 0) + HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't traverse path"); + + /* get scratch pad of the parent */ + if(iod_obj_get_scratch(cur_oh, IOD_TID_UNKNOWN, &sp, NULL, NULL) < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, FAIL, "can't get scratch pad for object"); + + /* close parent group if it is not the location we started the + traversal into */ + if(loc_handle.cookie != cur_oh.cookie) { + iod_obj_close(cur_oh, NULL, NULL); + } + + /* if attribute KV does not exist, return error*/ + if(IOD_ID_UNDEFINED == sp.attr_id) + HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, FAIL, "Object has no attributes"); + + /* open the attribute KV in scratch pad */ + if (iod_obj_open_write(coh, sp.attr_id, NULL /*hints*/, &attr_kv_oh, NULL) < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, FAIL, "can't open scratch pad"); + + /* get attribute ID */ + if(iod_kv_get_value(attr_kv_oh, IOD_TID_UNKNOWN, attr_name, &attr_id, + sizeof(iod_obj_id_t) , NULL, NULL) < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, FAIL, "Attribute does not exist"); + + /* remove attribute */ + kv.key = attr_name; + kv.value = &attr_id; + kv.value_len = sizeof(iod_obj_id_t); + kvs.kv = &kv; + if(iod_kv_unlink_keys(attr_kv_oh,IOD_TID_UNKNOWN, NULL, 1, &kvs, NULL) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTDEC, FAIL, "Unable to unlink KV pair"); + + if(iod_obj_unlink(coh, attr_id, IOD_TID_UNKNOWN, NULL) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTDEC, FAIL, "Unable to unlink object"); + +#if H5_DO_NATIVE + ret_value = H5Adelete(loc_handle.cookie, attr_name); +#endif + +done: +#if H5VL_IOD_DEBUG + fprintf(stderr, "Done with attr remove, sending response to client\n"); +#endif + + HG_Handler_start_output(op_data->hg_handle, &ret_value); + + input = (attr_op_in_t *)H5MM_xfree(input); + op_data = (op_data_t *)H5MM_xfree(op_data); + last_comp = (char *)H5MM_xfree(last_comp); + + FUNC_LEAVE_NOAPI_VOID +} /* end H5VL_iod_server_attr_remove_cb() */ + + +/*------------------------------------------------------------------------- + * Function: H5VL_iod_server_attr_close_cb + * + * Purpose: Closes iod HDF5 attribute. + * + * Return: Success: SUCCEED + * Failure: Negative + * + * Programmer: Mohamad Chaarawi + * April, 2013 + * + *------------------------------------------------------------------------- + */ +void +H5VL_iod_server_attr_close_cb(AXE_engine_t UNUSED axe_engine, + size_t UNUSED num_n_parents, AXE_task_t UNUSED n_parents[], + size_t UNUSED num_s_parents, AXE_task_t UNUSED s_parents[], + void *_op_data) +{ + op_data_t *op_data = (op_data_t *)_op_data; + attr_close_in_t *input = (attr_close_in_t *)op_data->input; + iod_handle_t iod_oh = input->iod_oh; + iod_obj_id_t iod_id = input->iod_id; + herr_t ret_value = SUCCEED; + + FUNC_ENTER_NOAPI_NOINIT + +#if H5VL_IOD_DEBUG + fprintf(stderr, "Start attribute Close\n"); +#endif + + if(iod_oh.cookie != IOD_OH_UNDEFINED) { +#if H5_DO_NATIVE + HDassert(H5Aclose(iod_oh.cookie) == SUCCEED); +#endif + if((ret_value = iod_obj_close(iod_oh, NULL, NULL)) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't close object"); + } + else { + /* MSC - need a way to kill object handle for this group */ + fprintf(stderr, "I do not have the OH of this attribute to close it\n"); + } + +done: +#if H5VL_IOD_DEBUG + fprintf(stderr, "Done with attr close, sending response to client\n"); +#endif + + HG_Handler_start_output(op_data->hg_handle, &ret_value); + + input = (attr_close_in_t *)H5MM_xfree(input); + op_data = (op_data_t *)H5MM_xfree(op_data); + + FUNC_LEAVE_NOAPI_VOID +} /* end H5VL_iod_server_attr_close_cb() */ + +#endif /* H5_HAVE_EFF */ diff --git a/src/H5VLiod_client.c b/src/H5VLiod_client.c index 475d3bf..66825dc 100644 --- a/src/H5VLiod_client.c +++ b/src/H5VLiod_client.c @@ -141,7 +141,7 @@ H5VL_iod_request_wait(H5VL_iod_file_t *file, H5VL_iod_request_t *request) H5VL_iod_request_t *tmp_req = NULL; if(cur_req) { - if(cur_req->req != request->req) { + if(HG_FILE_CLOSE != cur_req->type && cur_req->req != request->req) { hg_status_t tmp_status; tmp_req = cur_req->next; @@ -243,15 +243,15 @@ H5VL_iod_request_wait_some(H5VL_iod_file_t *file, const void *object) fprintf(stderr, "failed to wait on request\n"); cur_req->status = H5AO_FAILED; cur_req->state = H5VL_IOD_COMPLETED; + H5VL_iod_request_delete(file, cur_req); } else { HDassert(status); cur_req->status = H5AO_SUCCEEDED; cur_req->state = H5VL_IOD_COMPLETED; + if(H5VL_iod_request_complete(file, cur_req) < 0) + fprintf(stderr, "Operation Failed!\n"); } - - if(H5VL_iod_request_complete(file, cur_req) < 0) - fprintf(stderr, "Operation Failed!\n"); } cur_req = tmp_req; } @@ -360,9 +360,8 @@ H5VL_iod_request_complete(H5VL_iod_file_t *file, H5VL_iod_request_t *req) req->state = H5VL_IOD_COMPLETED; } else { - uint32_t internal_cs; + uint32_t internal_cs = 0; - fprintf(stderr, "size %d nelmts %d\n", info->type_size, info->nelmts); /* calculate a checksum for the data recieved */ internal_cs = H5S_checksum(info->buf_ptr, info->type_size, info->nelmts, info->space); @@ -511,7 +510,10 @@ H5VL_iod_request_complete(H5VL_iod_file_t *file, H5VL_iod_request_t *req) H5VL_iod_request_delete(file, req); /* free attr components */ - free(attr->common.obj_name); + if(attr->common.obj_name) + free(attr->common.obj_name); + if(attr->loc_name) + free(attr->loc_name); if(attr->common.comment) HDfree(attr->common.comment); if(attr->remote_attr.acpl_id != H5P_ATTRIBUTE_CREATE_DEFAULT && @@ -766,7 +768,10 @@ H5VL_iod_request_cancel(H5VL_iod_file_t *file, H5VL_iod_request_t *req) H5VL_iod_request_delete(file, req); /* free attr components */ - free(attr->common.obj_name); + if(attr->common.obj_name) + free(attr->common.obj_name); + if(attr->loc_name) + free(attr->loc_name); if(attr->common.comment) HDfree(attr->common.comment); if(attr->remote_attr.acpl_id != 0 && diff --git a/src/H5VLiod_compactor.h b/src/H5VLiod_compactor.h index 1601cb0..1f3bf1a 100644 --- a/src/H5VLiod_compactor.h +++ b/src/H5VLiod_compactor.h @@ -31,9 +31,10 @@ *------------------------------------------------------------------*/ +#include "H5VLiod_compactor_queue.h" -#include "H5VLiod_compactor_queue.h" +compactor *curr_queue; typedef struct { hsize_t offset; @@ -64,6 +65,7 @@ typedef struct { } request_list_t; + /*----------------------------------------------------------------------------------- */ #ifdef DEBUG_COMPACTOR H5_DLL int H5VL_iod_create_request_list (compactor *queue, request_list_t **list, diff --git a/src/H5VLiod_compactor_queue.h b/src/H5VLiod_compactor_queue.h index 1ccbc46..0f3fb01 100644 --- a/src/H5VLiod_compactor_queue.h +++ b/src/H5VLiod_compactor_queue.h @@ -23,7 +23,7 @@ #define CP_SUCCESS 0 #define CP_FAIL -1 -#define DEBUG_COMPACTOR 1 + typedef struct { diff --git a/src/H5VLiod_dset.c b/src/H5VLiod_dset.c new file mode 100644 index 0000000..f2f6421 --- /dev/null +++ b/src/H5VLiod_dset.c @@ -0,0 +1,986 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by The HDF Group. * + * Copyright by the Board of Trustees of the University of Illinois. * + * All rights reserved. * + * * + * This file is part of HDF5. The full HDF5 copyright notice, including * + * terms governing use, modification, and redistribution, is contained in * + * the files COPYING and Copyright.html. COPYING can be found at the root * + * of the source code distribution tree; Copyright.html can be found at the * + * root level of an installed copy of the electronic HDF5 document set and * + * is linked from the top-level documents page. It can also be found at * + * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * + * access to either file, you may request a copy from help@hdfgroup.org. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#include "H5VLiod_server.h" +#include "H5VLiod_compactor.h" +#include "H5VLiod_compactor_queue.h" + +#ifdef H5_HAVE_EFF + +/* + * Programmer: Mohamad Chaarawi <chaarawi@hdfgroup.gov> + * June, 2013 + * + * Purpose: The IOD plugin server side dataset routines. + */ + + +/*------------------------------------------------------------------------- + * Function: H5VL_iod_server_dset_create_cb + * + * Purpose: Creates a dset as a iod object. + * + * Return: Success: SUCCEED + * Failure: Negative + * + * Programmer: Mohamad Chaarawi + * February, 2013 + * + *------------------------------------------------------------------------- + */ +void +H5VL_iod_server_dset_create_cb(AXE_engine_t UNUSED axe_engine, + size_t UNUSED num_n_parents, AXE_task_t UNUSED n_parents[], + size_t UNUSED num_s_parents, AXE_task_t UNUSED s_parents[], + void *_op_data) +{ + op_data_t *op_data = (op_data_t *)_op_data; + dset_create_in_t *input = (dset_create_in_t *)op_data->input; + dset_create_out_t output; + iod_handle_t coh = input->coh; + iod_handle_t loc_handle = input->loc_oh; + iod_obj_id_t loc_id = input->loc_id; /* The ID of the current location object */ + iod_obj_id_t dset_id = input->dset_id; /* The ID of the dataset that needs to be created */ + iod_handle_t dset_oh, cur_oh, mdkv_oh; + iod_obj_id_t cur_id, mdkv_id; + const char *name = input->name; + char *last_comp; /* the name of the dataset obtained from the last component in the path */ + iod_kv_t kv; + iod_array_struct_t array; + iod_size_t *max_dims; + size_t buf_size; + scratch_pad_t sp; + iod_ret_t ret; + hbool_t collective = FALSE; /* MSC - change when we allow for collective */ + herr_t ret_value = SUCCEED; + + FUNC_ENTER_NOAPI_NOINIT + + /* the traversal will retrieve the location where the dataset needs + to be created. The traversal will fail if an intermediate group + does not exist. */ + if(H5VL_iod_server_traverse(coh, loc_id, loc_handle, name, FALSE, + &last_comp, &cur_id, &cur_oh) < 0) + HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't traverse path"); + + /* Set the IOD array creation parameters */ + array.cell_size = H5Tget_size(input->type_id); + array.num_dims = H5Sget_simple_extent_ndims(input->space_id); + if(NULL == (array.current_dims = (iod_size_t *)malloc (sizeof(iod_size_t) * array.num_dims))) + HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't allocate dimention size array"); + if(NULL == (max_dims = (iod_size_t *)malloc (sizeof(iod_size_t) * array.num_dims))) + HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't allocate dimention size array"); + if(H5Sget_simple_extent_dims(input->space_id, array.current_dims, max_dims) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't get dimentions' sizes"); + array.firstdim_max = max_dims[0]; + array.chunk_dims = NULL; + array.dims_seq = NULL; + + /* MSC - NEED TO FIX THAT */ +#if 0 + if(layout.type == H5D_CHUNKED) { + if(NULL == (array.chunk_dims = malloc (sizeof(iod_size_t) * layout.u.chunk.ndims))) + HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't allocate chunk dimention size array"); + array.chunk_dims; + } +#endif + +#if H5VL_IOD_DEBUG + fprintf(stderr, "now creating the dataset %s cellsize %d num dimenstions %d\n", + last_comp, array.cell_size, array.num_dims); +#endif + + /* create the dataset */ + ret = iod_obj_create(coh, IOD_TID_UNKNOWN, NULL/*hints*/, IOD_OBJ_ARRAY, NULL, &array, + &dset_id, NULL /*event*/); + if(collective && (0 == ret || EEXISTS == ret)) { + /* Dataset has been created by another process, open it */ + if (iod_obj_open_write(coh, dset_id, NULL, &dset_oh, NULL) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't open Dataset"); + } + else if(!collective && 0 != ret) { + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't create Dataset"); + } + + /* for the process that succeeded in creating the dataset, update + the parent KV, create scratch pad */ + if(0 == ret) { + kv.key = HDstrdup(last_comp); + kv.value = &dset_id; + kv.value_len = sizeof(iod_obj_id_t); + /* insert new dataset in kv store of current group */ + if (iod_kv_set(cur_oh, IOD_TID_UNKNOWN, NULL, &kv, NULL, NULL) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't set KV pair in parent"); + HDfree(kv.key); + + /* create the metadata KV object for the dataset */ + if(iod_obj_create(coh, IOD_TID_UNKNOWN, NULL, IOD_OBJ_KV, + NULL, NULL, &mdkv_id, NULL) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't create metadata KV object"); + + /* set values for the scratch pad object */ + sp.mdkv_id = mdkv_id; + sp.attr_id = IOD_ID_UNDEFINED; + sp.filler1_id = IOD_ID_UNDEFINED; + sp.filler2_id = IOD_ID_UNDEFINED; + + /* set scratch pad in dataset */ + if (iod_obj_set_scratch(dset_oh, IOD_TID_UNKNOWN, &sp, NULL, NULL) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't set scratch pad"); + + /* Store Metadata in scratch pad */ + if (iod_obj_open_write(coh, mdkv_id, NULL, &mdkv_oh, NULL) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't create scratch pad"); + + /* MSC - TODO store things */ +#if 0 + /* insert layout metadata into scratch pad */ + kv.key = HDstrdup("dataset_dcpl"); + /* determine the buffer size needed to store the encoded dcpl of the dataset */ + if(H5Pencode(input->dcpl_id, NULL, &buf_size) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTENCODE, FAIL, "failed to encode dataset dcpl"); + if(NULL == (kv.value = malloc (buf_size))) + HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't allocate dcpl buffer"); + /* encode dcpl of the dataset */ + if(H5Pencode(input->dcpl_id, kv.value, &buf_size) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTENCODE, FAIL, "failed to encode dataset dcpl"); + kv.value_len = (iod_size_t)buf_size; + /* insert kv pair into scratch pad */ + if (iod_kv_set(mdkv_oh, IOD_TID_UNKNOWN, NULL, &kv, NULL, NULL) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't set KV pair in parent"); + HDfree(kv.key); + free(kv.value); + + /* insert datatyoe metadata into scratch pad */ + kv.key = HDstrdup("dataset_dtype"); + /* determine the buffer size needed to store the encoded type of the dataset */ + if(H5Tencode(input->type_id, NULL, &buf_size) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTENCODE, FAIL, "failed to encode dataset type"); + if(NULL == (kv.value = malloc (buf_size))) + HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't allocate type buffer"); + /* encode datatype of the dataset */ + if(H5Tencode(input->type_id, kv.value, &buf_size) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTENCODE, FAIL, "failed to encode dataset type"); + kv.value_len = (iod_size_t)buf_size; + /* insert kv pair into scratch pad */ + if (iod_kv_set(mdkv_oh, IOD_TID_UNKNOWN, NULL, &kv, NULL, NULL) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't set KV pair in parent"); + HDfree(kv.key); + free(kv.value); + + kv.key = HDstrdup("dataset_dspace"); + /* determine the buffer size needed to store the encoded space of the dataset */ + if(H5Sencode(input->space_id, NULL, &buf_size) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTENCODE, FAIL, "failed to encode dataset space"); + if(NULL == (kv.value = malloc (buf_size))) + HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't allocate space buffer"); + /* encode dataspace of the dataset */ + if(H5Sencode(input->space_id, kv.value, &buf_size) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTENCODE, FAIL, "failed to encode dataset space"); + kv.value_len = (iod_size_t)buf_size; + /* insert kv pair into scratch pad */ + if (iod_kv_set(mdkv_oh, IOD_TID_UNKNOWN, NULL, &kv, NULL, NULL) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't set KV pair in parent"); + HDfree(kv.key); + free(kv.value); +#endif + /* close the Metadata KV object */ + if(iod_obj_close(mdkv_oh, NULL, NULL)) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't close object"); + } + + /* close parent group if it is not the location we started the + traversal into */ + if(loc_handle.cookie != cur_oh.cookie) { + iod_obj_close(cur_oh, NULL, NULL); + } + +#if H5_DO_NATIVE + cur_oh.cookie = H5Dcreate2(loc_handle.cookie, last_comp, input->type_id, + input->space_id, input->lcpl_id, + input->dcpl_id, input->dapl_id); + HDassert(cur_oh.cookie); +#endif + + output.iod_oh = cur_oh; + +#if H5VL_IOD_DEBUG + fprintf(stderr, "Done with dset create, sending response to client\n"); +#endif + + HG_Handler_start_output(op_data->hg_handle, &output); + +done: + /* return an UNDEFINED oh to the client if the operation failed */ + if(ret_value < 0) { + output.iod_oh.cookie = IOD_OH_UNDEFINED; + HG_Handler_start_output(op_data->hg_handle, &output); + } + + if(max_dims) free(max_dims); + if(array.current_dims) free(array.current_dims); + last_comp = (char *)H5MM_xfree(last_comp); + input = (dset_create_in_t *)H5MM_xfree(input); + op_data = (op_data_t *)H5MM_xfree(op_data); + + FUNC_LEAVE_NOAPI_VOID +} /* end H5VL_iod_server_dset_create_cb() */ + + +/*------------------------------------------------------------------------- + * Function: H5VL_iod_server_dset_open_cb + * + * Purpose: Opens a dataset as a iod object. + * + * Return: Success: SUCCEED + * Failure: Negative + * + * Programmer: Mohamad Chaarawi + * February, 2013 + * + *------------------------------------------------------------------------- + */ +void +H5VL_iod_server_dset_open_cb(AXE_engine_t UNUSED axe_engine, + size_t UNUSED num_n_parents, AXE_task_t UNUSED n_parents[], + size_t UNUSED num_s_parents, AXE_task_t UNUSED s_parents[], + void *_op_data) +{ + op_data_t *op_data = (op_data_t *)_op_data; + dset_open_in_t *input = (dset_open_in_t *)op_data->input; + dset_open_out_t output; + iod_handle_t coh = input->coh; + iod_handle_t loc_handle = input->loc_oh; + iod_obj_id_t loc_id = input->loc_id; + iod_handle_t cur_oh, mdkv_oh; + iod_obj_id_t cur_id; + iod_obj_id_t dset_id; + char *name = input->name; + char *last_comp; + scratch_pad_t sp; + iod_size_t kv_size = sizeof(iod_obj_id_t); + herr_t ret_value = SUCCEED; + + FUNC_ENTER_NOAPI_NOINIT + +#if H5VL_IOD_DEBUG + fprintf(stderr, "Start dataset Open %s\n", name); +#endif + + /* the traversal will retrieve the location where the dataset needs + to be opened. The traversal will fail if an intermediate group + does not exist. */ + if(H5VL_iod_server_traverse(coh, loc_id, loc_handle, name, FALSE, + &last_comp, &cur_id, &cur_oh) < 0) + HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't traverse path"); + + if(iod_kv_get_value(cur_oh, IOD_TID_UNKNOWN, last_comp, &dset_id, + kv_size , NULL, NULL) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't retrieve Array ID from parent KV store"); + + /* close parent group and its scratch pad if it is not the + location we started the traversal into */ + if(loc_handle.cookie != cur_oh.cookie) { + iod_obj_close(cur_oh, NULL, NULL); + } + + /* open the dataset */ + if (iod_obj_open_write(coh, dset_id, NULL /*hints*/, &cur_oh, NULL) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't open dataset"); + + /* get scratch pad of the dataset */ + if(iod_obj_get_scratch(cur_oh, IOD_TID_UNKNOWN, &sp, NULL, NULL) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "can't get scratch pad for object"); + + /* open the metadata scratch pad */ + if (iod_obj_open_write(coh, sp.mdkv_id, NULL /*hints*/, &mdkv_oh, NULL) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "can't open scratch pad"); + +#if 0 + /* MSC - retrieve all metadata from scratch pad */ + if(iod_kv_get_value(mdkv_oh, IOD_TID_UNKNOWN, "dataset_dcpl", NULL, + &output.dcpl_size, NULL, NULL) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "dataset dcpl lookup failed"); + if(NULL == (output.dcpl = H5MM_malloc (output.dcpl_size))) + HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't allocate dcpl buffer"); + if(iod_kv_get_value(mdkv_oh, IOD_TID_UNKNOWN, "dataset_dcpl", output.dcpl, + &output.dcpl_size, NULL, NULL) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "dataset dcpl lookup failed"); + + if(iod_kv_get_value(mdkv_oh, IOD_TID_UNKNOWN, "dataset_dtype", NULL, + &output.dtype_size, NULL, NULL) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "dataset dtype lookup failed"); + if(NULL == (output.dtype = H5MM_malloc (output.dtype_size))) + HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't allocate dtype buffer"); + if(iod_kv_get_value(mdkv_oh, IOD_TID_UNKNOWN, "dataset_dtype", output.dtype, + &output.dtype_size, NULL, NULL) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "dataset dtype lookup failed"); + + if(iod_kv_get_value(mdkv_oh, IOD_TID_UNKNOWN, "dataset_dspace", NULL, + &output.dspace_size, NULL, NULL) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "dataset dspace lookup failed"); + if(NULL == (output.dspace = H5MM_malloc (output.dspace_size))) + HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't allocate dspace buffer"); + if(iod_kv_get_value(mdkv_oh, IOD_TID_UNKNOWN, "dataset_dspace", output.dspace, + &output.dspace_size, NULL, NULL) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "dataset dspace lookup failed"); +#endif + + /* close the metadata scratch pad */ + if(iod_obj_close(mdkv_oh, NULL, NULL)) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't close object"); + + { + hsize_t dims[1]; + //hid_t space_id, type_id; + +#if H5_DO_NATIVE + printf("dataset name %s location %d\n", name, loc_handle.cookie); + cur_oh.cookie = H5Dopen(loc_handle.cookie, name, input->dapl_id); + HDassert(cur_oh.cookie); + output.space_id = H5Dget_space(cur_oh.cookie); + output.type_id = H5Dget_type(cur_oh.cookie); + output.dcpl_id = H5P_DATASET_CREATE_DEFAULT; +#else + /* fake a dataspace, type, and dcpl */ + dims [0] = 60; + output.space_id = H5Screate_simple(1, dims, NULL); + output.type_id = H5Tcopy(H5T_NATIVE_INT); + output.dcpl_id = H5P_DATASET_CREATE_DEFAULT; + cur_oh.cookie = 1; +#endif + +#if 0 + output.dcpl_size = 0; + output.dcpl = NULL; + + /* get Type size to encode */ + if(H5Tencode(type_id, NULL, &output.dtype_size) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTENCODE, FAIL, "failed to encode dataset type"); + if(NULL == (output.dtype = H5MM_malloc (output.dtype_size))) + HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't allocate datatype buffer"); + if(H5Tencode(type_id, output.dtype, &output.dtype_size) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTENCODE, FAIL, "can't encode datatype"); + + /* get Dataspace size to encode */ + if(H5Sencode(space_id, NULL, &output.dspace_size)<0) + HGOTO_ERROR(H5E_DATASPACE, H5E_CANTENCODE, FAIL, "can't encode dataspace"); + if(NULL == (output.dspace = H5MM_malloc (output.dspace_size))) + HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't allocate datatype buffer"); + if(H5Sencode(space_id, output.dspace, &output.dspace_size) < 0) + HGOTO_ERROR(H5E_DATASPACE, H5E_CANTENCODE, FAIL, "can't encode dataspace"); + + H5Sclose(space_id); +#endif + + } + + dset_id = 1; + output.iod_id = dset_id; + output.iod_oh.cookie = cur_oh.cookie; + +#if H5VL_IOD_DEBUG + fprintf(stderr, "Done with dset open, sending response to client\n"); +#endif + + HG_Handler_start_output(op_data->hg_handle, &output); + +done: + if(ret_value < 0) { + output.iod_oh.cookie = IOD_OH_UNDEFINED; + output.iod_id = IOD_ID_UNDEFINED; + HG_Handler_start_output(op_data->hg_handle, &output); + } + + H5Tclose(output.type_id); + H5Sclose(output.space_id); + + input = (dset_open_in_t *)H5MM_xfree(input); + op_data = (op_data_t *)H5MM_xfree(op_data); + last_comp = (char *)H5MM_xfree(last_comp); + + FUNC_LEAVE_NOAPI_VOID +} /* end H5VL_iod_server_dset_open_cb() */ + + +/*------------------------------------------------------------------------- + * Function: H5VL_iod_server_dset_read_cb + * + * Purpose: Reads from IOD into the function shipper BDS handle. + * + * Return: Success: SUCCEED + * Failure: Negative + * + * Programmer: Mohamad Chaarawi + * January, 2013 + * + *------------------------------------------------------------------------- + */ +void +H5VL_iod_server_dset_read_cb(AXE_engine_t UNUSED axe_engine, + size_t UNUSED num_n_parents, AXE_task_t UNUSED n_parents[], + size_t UNUSED num_s_parents, AXE_task_t UNUSED s_parents[], + void *_op_data) +{ + op_data_t *op_data = (op_data_t *)_op_data; + dset_io_in_t *input = (dset_io_in_t *)op_data->input; + dset_read_out_t output; + iod_handle_t coh = input->coh; + iod_handle_t iod_oh = input->iod_oh; + iod_obj_id_t iod_id = input->iod_id; + hg_bulk_t bulk_handle = input->bulk_handle; + hid_t space_id = input->space_id; + hid_t dxpl_id = input->dxpl_id; + hid_t src_id = input->dset_type_id; + hid_t dst_id = input->mem_type_id; + hg_bulk_block_t bulk_block_handle; + hg_bulk_request_t bulk_request; + iod_mem_desc_t mem_desc; + iod_array_iodesc_t file_desc; + size_t size, buf_size, src_size, dst_size; + void *buf; + uint32_t cs = 0; + size_t nelmts; + na_addr_t dest = HG_Handler_get_addr(op_data->hg_handle); + hbool_t opened_locally = FALSE; + herr_t ret_value = SUCCEED; + + FUNC_ENTER_NOAPI_NOINIT + + /* open the dataset if we don't have the handle yet */ + if(iod_oh.cookie == IOD_OH_UNDEFINED) { + if (iod_obj_open_write(coh, iod_id, NULL /*hints*/, &iod_oh, NULL) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't open current group"); + opened_locally = TRUE; + } + + size = HG_Bulk_handle_get_size(bulk_handle); + + nelmts = (size_t)H5Sget_simple_extent_npoints(space_id); + src_size = H5Tget_size(src_id); + dst_size = H5Tget_size(dst_id); + + /* adjust buffer size for datatype conversion */ + if(src_size > dst_size) { + buf_size = src_size * nelmts; +#if H5VL_IOD_DEBUG + fprintf(stderr, "Adjusted Buffer size because of datatype conversion from %d to %d: ", + size, buf_size); +#endif + } + else { + buf_size = dst_size * nelmts; + assert(buf_size == size); + } + + if(NULL == (buf = malloc(buf_size))) + HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't allocate read buffer"); + +#if 0 + mem_desc.nfrag = 1; + mem_desc.frag->addr = buf; + mem_desc.frag->len = (iod_size_t)buf_size; + + /* MSC TODO - populate file location hyperslab */ +#endif + + /* read from array object */ + if(iod_array_read(iod_oh, IOD_TID_UNKNOWN, NULL, &mem_desc, &file_desc, NULL, NULL) < 0) + HGOTO_ERROR(H5E_SYM, H5E_READERROR, FAIL, "can't read from array object"); + + { + int i; + hbool_t flag = FALSE; + int *buf_ptr = (int *)buf; + +#if H5_DO_NATIVE + ret_value = H5Dread(iod_oh.cookie, src_id, H5S_ALL, space_id, dxpl_id, buf); +#else /* fake data */ + for(i=0;i<60;++i) + buf_ptr[i] = i; +#endif + if(H5Tconvert(src_id, dst_id, nelmts, buf, NULL, dxpl_id) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "data type conversion failed"); + + /* calculate a checksum for the data to be sent */ + cs = H5checksum(buf, size, NULL); + + /* MSC - check if client requested to corrupt data */ + if(dxpl_id != H5P_DEFAULT && H5Pget_dxpl_inject_corruption(dxpl_id, &flag) < 0) + HGOTO_ERROR(H5E_SYM, H5E_READERROR, FAIL, "can't read property list"); + if(flag) { + fprintf(stderr, "Injecting a bad data value to cause corruption \n"); + buf_ptr[0] = 10; + } + } + + /* Create a new block handle to write the data */ + HG_Bulk_block_handle_create(buf, size, HG_BULK_READ_ONLY, &bulk_block_handle); + + /* Write bulk data here and wait for the data to be there */ + if(HG_SUCCESS != HG_Bulk_write_all(dest, bulk_handle, bulk_block_handle, &bulk_request)) + HGOTO_ERROR(H5E_SYM, H5E_READERROR, FAIL, "can't read from array object"); + /* wait for it to complete */ + if(HG_SUCCESS != HG_Bulk_wait(bulk_request, HG_BULK_MAX_IDLE_TIME, HG_BULK_STATUS_IGNORE)) + HGOTO_ERROR(H5E_SYM, H5E_READERROR, FAIL, "can't read from array object"); + +done: + + output.ret = ret_value; + output.cs = cs; + +#if H5VL_IOD_DEBUG + fprintf(stderr, "Done with dset read, checksum %u, sending response to client\n", cs); +#endif + + if(HG_SUCCESS != HG_Handler_start_output(op_data->hg_handle, &output)) + HDONE_ERROR(H5E_SYM, H5E_WRITEERROR, FAIL, "can't send result of write to client"); + if(HG_SUCCESS != HG_Bulk_block_handle_free(bulk_block_handle)) + HDONE_ERROR(H5E_SYM, H5E_WRITEERROR, FAIL, "can't free bds block handle"); + + input = (dset_io_in_t *)H5MM_xfree(input); + op_data = (op_data_t *)H5MM_xfree(op_data); + free(buf); + + /* close the dataset if we opened it in this routine */ + if(opened_locally) { + if(iod_obj_close(iod_oh, NULL, NULL)) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't close Array object"); + } + FUNC_LEAVE_NOAPI_VOID +} /* end H5VL_iod_server_dset_read_cb() */ + +/*------------------------------------------------------------------------- + * Function: H5VL_iod_server_dset_compactor_cb + * + * Purpose: Compacts the requests and calls the appropriate read/write. + * + * Return: Success: SUCCEED + * Failure: Negative + * + * Programmer: Vishwanath Venkatesan + * July, 2013 + * + *------------------------------------------------------------------------- + */ + +void +H5VL_iod_server_dset_compactor_cb (AXE_engine_t UNUSED axe_engine, + size_t UNUSED num_n_parents, AXE_task_t UNUSED n_parents[], + size_t UNUSED num_s_parents, AXE_task_t UNUSED s_parents[], + void *_queue) +{ + + compactor *cqueue = (compactor *)_queue; + int n_requests, i = 0; + op_data_t *op_data = NULL; + herr_t ret_value = SUCCEED; + request_list_t *wlist=NULL; + dataset_container_t *dlist=NULL; + int nentries = 0, ndatasets = 0; + + FUNC_ENTER_NOAPI_NOINIT + +#if DEBUG_COMPACTOR + fprintf(fp, "Enters Call BACK!\n"); + fprintf (fp, "Number of requests : %d from call back in queue : %p\n", + H5VL_iod_get_number_of_requests(cqueue), cqueue); + fflush(fp); +#endif + + pthread_mutex_lock(&lock); + compactor_queue_flag = 0; + curr_queue = NULL; + pthread_mutex_unlock(&lock); + +#ifdef DEBUG_COMPACTOR + ret_value = H5VL_iod_create_request_list (cqueue, + &wlist, + &nentries, + &dlist, + &ndatasets, + WRITE, + fp); +#else + ret_value = H5VL_iod_create_request_list (cqueue, + &wlist, + &nentries, + &dlist, + &ndatasets, + WRITE); +#endif +#if DEBUG_COMPACTOR + if (ret_value != CP_SUCCESS){ + fprintf(fp,"ERROR !! Compactor create request list failed with error %d \n", + ret_value); + } +#endif + + +#if DEBUG_COMPACTOR + fprintf(fp,"nentires : %d############################################\n", nentries); + fprintf(fp,"Compactor Request List \n"); + fprintf(fp,"id -- dataset -- dataspace -- fileblocks -- memblocks\n"); + for ( i = 0; i < nentries; i++){ + fprintf(fp, "%d -- %d -- %d -- %zd -- %zd\n", + wlist[i].request_id, + wlist[i].dataset_id, + wlist[i].selection_id, + wlist[i].num_fblocks, + wlist[i].num_mblocks); + } + fprintf(fp,"#############################################\n"); +#endif + +#if 0 + for ( i = 0; i < ndatasets; i ++){ + + H5VL_iod_compact_requests (&wlist, &nentries,dlist[i].num_requests, + dlist[i].requests); + } +#endif + + + n_requests = H5VL_iod_get_number_of_requests(cqueue); + + + + while ( n_requests > 0){ + compactor_entry t_entry; + H5VL_iod_remove_request_from_compactor (cqueue, &t_entry); + if ( t_entry.type_request == WRITE){ +#if DEBUG_COMPACTOR + fprintf (fp, "Request: %d is a WRITE request\n ", t_entry.request_id); + fprintf (fp, "With op_data : %p\n ", + t_entry.input_structure, + t_entry.request_id); + fflush(fp); +#endif + op_data = NULL; + op_data = t_entry.input_structure; + H5VL_iod_server_dset_write_cb (NULL,NULL,NULL,NULL,NULL,op_data); + } + else{ + fprintf (fp, "Request: %d is a READ request\n ", t_entry.request_id); + /* Have to do the same for READ requests!*/ + } + n_requests--; + } + + if (CP_SUCCESS != H5VL_iod_destroy_compactor_queue(cqueue)){ + HGOTO_ERROR(H5E_HEAP, H5E_NOSPACE, CP_FAIL, "Cannot free NULL queue\n"); + } + done: + FUNC_LEAVE_NOAPI_VOID +} /*end H5VL_iod_server_dset_compactor_cb */ + + + + + +/*------------------------------------------------------------------------- + * Function: H5VL_iod_server_dset_write_cb + * + * Purpose: Writes from IOD into the function shipper BDS handle. + * + * Return: Success: SUCCEED + * Failure: Negative + * + * Programmer: Mohamad Chaarawi + * January, 2013 + * + *------------------------------------------------------------------------- + */ +void +H5VL_iod_server_dset_write_cb(AXE_engine_t UNUSED axe_engine, + size_t UNUSED num_n_parents, AXE_task_t UNUSED n_parents[], + size_t UNUSED num_s_parents, AXE_task_t UNUSED s_parents[], + void *_op_data) +{ + op_data_t *op_data = (op_data_t *)_op_data; + dset_io_in_t *input = (dset_io_in_t *)op_data->input; + iod_handle_t coh = input->coh; + iod_handle_t iod_oh = input->iod_oh; + iod_obj_id_t iod_id = input->iod_id; + hg_bulk_t bulk_handle = input->bulk_handle; + hid_t space_id = input->space_id; + hid_t dxpl_id = input->dxpl_id; + uint32_t cs = input->checksum; + uint32_t data_cs = 0; + hid_t src_id = input->mem_type_id; + hid_t dst_id = input->dset_type_id; + hg_bulk_block_t bulk_block_handle; + hg_bulk_request_t bulk_request; + iod_mem_desc_t mem_desc; + iod_array_iodesc_t file_desc; + size_t size, buf_size, src_size, dst_size; + void *buf; + size_t nelmts; + hbool_t flag = FALSE; + na_addr_t source = HG_Handler_get_addr(op_data->hg_handle); + hbool_t opened_locally = FALSE; + herr_t ret_value = SUCCEED; + + FUNC_ENTER_NOAPI_NOINIT + +#if H5VL_IOD_DEBUG + fprintf(stderr, "Dataset Write with AXE ID %llu\n",input->axe_id); +#endif + /* open the dataset if we don't have the handle yet */ + if(iod_oh.cookie == IOD_OH_UNDEFINED) { + if (iod_obj_open_write(coh, iod_id, NULL /*hints*/, &iod_oh, NULL) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't open current group"); + opened_locally = TRUE; + } + + /* Read bulk data here and wait for the data to be here */ + size = HG_Bulk_handle_get_size(bulk_handle); + + nelmts = (size_t)H5Sget_simple_extent_npoints(space_id); + src_size = H5Tget_size(src_id); + dst_size = H5Tget_size(dst_id); + + /* adjust buffer size for datatype conversion */ + if(src_size < dst_size) { + buf_size = dst_size * nelmts; +#if H5VL_IOD_DEBUG + fprintf(stderr, "Adjusted Buffer size because of datatype conversion from %d to %d\n", + size, buf_size); +#endif + } + else { + buf_size = src_size * nelmts; + assert(buf_size == size); + } + + if(NULL == (buf = malloc(buf_size))) + HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't allocate read buffer"); + + HG_Bulk_block_handle_create(buf, size, HG_BULK_READWRITE, &bulk_block_handle); + + /* Write bulk data here and wait for the data to be there */ + if(HG_SUCCESS != HG_Bulk_read_all(source, bulk_handle, bulk_block_handle, &bulk_request)) + HGOTO_ERROR(H5E_SYM, H5E_WRITEERROR, FAIL, "can't get data from function shipper"); + /* wait for it to complete */ + if(HG_SUCCESS != HG_Bulk_wait(bulk_request, HG_BULK_MAX_IDLE_TIME, HG_BULK_STATUS_IGNORE)) + HGOTO_ERROR(H5E_SYM, H5E_WRITEERROR, FAIL, "can't get data from function shipper"); + + /* free the bds block handle */ + if(HG_SUCCESS != HG_Bulk_block_handle_free(bulk_block_handle)) + HGOTO_ERROR(H5E_SYM, H5E_WRITEERROR, FAIL, "can't free bds block handle"); + + /* MSC - check if client requested to corrupt data */ + if(dxpl_id != H5P_DEFAULT && H5Pget_dxpl_inject_corruption(dxpl_id, &flag) < 0) + HGOTO_ERROR(H5E_SYM, H5E_READERROR, FAIL, "can't read property list"); + if(flag) { + ((int *)buf)[0] = 10; + } + + /* If client specified a checksum, verify it */ + if(dxpl_id != H5P_DEFAULT && H5Pget_dxpl_checksum(dxpl_id, &data_cs) < 0) + HGOTO_ERROR(H5E_SYM, H5E_READERROR, FAIL, "can't read property list"); + if(data_cs != 0) { + cs = H5_checksum_lookup4(buf, size, NULL); + if(cs != data_cs) { + fprintf(stderr, "Errrr.. Network transfer Data corruption. expecting %u, got %u\n", + data_cs, cs); + HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "Checksum verification failed"); + } + } + + if(H5Tconvert(src_id, dst_id, nelmts, buf, NULL, dxpl_id) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "data type conversion failed") + +#if H5VL_IOD_DEBUG + { + int i; + int *buf_ptr = (int *)buf; + + fprintf(stderr, "DWRITE Received a buffer of size %d with values: ", size); + for(i=0;i<60;++i) + fprintf(stderr, "%d ", buf_ptr[i]); + fprintf(stderr, "\n"); + } +#endif + +#if 0 + mem_desc.nfrag = 1; + mem_desc.frag->addr = buf; + mem_desc.frag->len = (iod_size_t)buf_size; + + /* MSC TODO - populate file location hyperslab */ +#endif + + /* write from array object */ + if(iod_array_write(iod_oh, IOD_TID_UNKNOWN, NULL, &mem_desc, &file_desc, &cs, NULL) < 0) + HGOTO_ERROR(H5E_SYM, H5E_WRITEERROR, FAIL, "can't write to array object"); + +#if H5_DO_NATIVE + ret_value = H5Dwrite(iod_oh.cookie, H5T_NATIVE_INT, H5S_ALL, space_id, dxpl_id, buf); +#endif + +done: +#if H5VL_IOD_DEBUG + fprintf(stderr, "Done with dset write, sending %d response to client\n", ret_value); +#endif + + if(HG_SUCCESS != HG_Handler_start_output(op_data->hg_handle, &ret_value)) + HDONE_ERROR(H5E_SYM, H5E_WRITEERROR, FAIL, "can't send result of write to client"); +#if 0 + /* Shut down datatype info for operation */ + if(type_info_init && H5VL_iod_typeinfo_term(&type_info) < 0) + HDONE_ERROR(H5E_DATASET, H5E_CANTCLOSEOBJ, FAIL, "unable to shut down type info") +#endif + + input = (dset_io_in_t *)H5MM_xfree(input); + op_data = (op_data_t *)H5MM_xfree(op_data); + free(buf); + + /* close the dataset if we opened it in this routine */ + if(opened_locally) { + if(iod_obj_close(iod_oh, NULL, NULL)) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't close Array object"); + } + FUNC_LEAVE_NOAPI_VOID +} /* end H5VL_iod_server_dset_write_cb() */ + + +/*------------------------------------------------------------------------- + * Function: H5VL_iod_server_dset_set_extent_cb + * + * Purpose: Set_Extents iod HDF5 dataset. + * + * Return: Success: SUCCEED + * Failure: Negative + * + * Programmer: Mohamad Chaarawi + * January, 2013 + * + *------------------------------------------------------------------------- + */ +void +H5VL_iod_server_dset_set_extent_cb(AXE_engine_t UNUSED axe_engine, + size_t UNUSED num_n_parents, AXE_task_t UNUSED n_parents[], + size_t UNUSED num_s_parents, AXE_task_t UNUSED s_parents[], + void *_op_data) +{ + op_data_t *op_data = (op_data_t *)_op_data; + dset_set_extent_in_t *input = (dset_set_extent_in_t *)op_data->input; + iod_handle_t coh = input->coh; + iod_handle_t iod_oh = input->iod_oh; + iod_obj_id_t iod_id = input->iod_id; + int rank = input->dims.rank; + hbool_t opened_locally = FALSE; + herr_t ret_value = SUCCEED; + + FUNC_ENTER_NOAPI_NOINIT + +#if H5VL_IOD_DEBUG + fprintf(stderr, "Start dataset Extend on the first dimension to %d\n", input->dims.size[0]); +#endif + + /* open the dataset if we don't have the handle yet */ + if(iod_oh.cookie == IOD_OH_UNDEFINED) { + if (iod_obj_open_write(coh, iod_id, NULL /*hints*/, &iod_oh, NULL) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't open current group"); + opened_locally = TRUE; + } + + /* extend along the first dimension only */ + if(iod_array_extend(iod_oh, IOD_TID_UNKNOWN, (iod_size_t)input->dims.size[0], NULL) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't extend dataset"); + +#if H5_DO_NATIVE + ret_value = H5Dset_extent(iod_oh.cookie, input->dims.size); +#endif + +done: +#if H5VL_IOD_DEBUG + fprintf(stderr, "Done with dset set_extent, sending response to client\n"); +#endif + + HG_Handler_start_output(op_data->hg_handle, &ret_value); + + input = (dset_set_extent_in_t *)H5MM_xfree(input); + op_data = (op_data_t *)H5MM_xfree(op_data); + + /* close the dataset if we opened it in this routine */ + if(opened_locally) { + if(iod_obj_close(iod_oh, NULL, NULL)) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't close Array object"); + } + + FUNC_LEAVE_NOAPI_VOID +} /* end H5VL_iod_server_dset_set_extent_cb() */ + + +/*------------------------------------------------------------------------- + * Function: H5VL_iod_server_dset_close_cb + * + * Purpose: Closes iod HDF5 dataset. + * + * Return: Success: SUCCEED + * Failure: Negative + * + * Programmer: Mohamad Chaarawi + * January, 2013 + * + *------------------------------------------------------------------------- + */ +void +H5VL_iod_server_dset_close_cb(AXE_engine_t UNUSED axe_engine, + size_t UNUSED num_n_parents, AXE_task_t UNUSED n_parents[], + size_t UNUSED num_s_parents, AXE_task_t UNUSED s_parents[], + void *_op_data) +{ + op_data_t *op_data = (op_data_t *)_op_data; + dset_close_in_t *input = (dset_close_in_t *)op_data->input; + iod_handle_t iod_oh = input->iod_oh; + iod_obj_id_t iod_id = input->iod_id; + herr_t ret_value = SUCCEED; + + FUNC_ENTER_NOAPI_NOINIT + +#if H5VL_IOD_DEBUG + fprintf(stderr, "Start dataset Close\n"); +#endif + + if(iod_oh.cookie != IOD_OH_UNDEFINED) { +#if H5_DO_NATIVE + ret_value = H5Dclose(iod_oh.cookie); +#endif + + if((ret_value = iod_obj_close(iod_oh, NULL, NULL)) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't close object"); + } + else { + /* MSC - need a way to kill object handle for this group */ + fprintf(stderr, "I do not have the OH of this dataset to close it\n"); + } + +done: +#if H5VL_IOD_DEBUG + fprintf(stderr, "Done with dset close, sending response to client\n"); +#endif + + HG_Handler_start_output(op_data->hg_handle, &ret_value); + + input = (dset_close_in_t *)H5MM_xfree(input); + op_data = (op_data_t *)H5MM_xfree(op_data); + + FUNC_LEAVE_NOAPI_VOID +} /* end H5VL_iod_server_dset_close_cb() */ + +#endif /* H5_HAVE_EFF */ diff --git a/src/H5VLiod_dtype.c b/src/H5VLiod_dtype.c new file mode 100644 index 0000000..4be26ec --- /dev/null +++ b/src/H5VLiod_dtype.c @@ -0,0 +1,432 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by The HDF Group. * + * Copyright by the Board of Trustees of the University of Illinois. * + * All rights reserved. * + * * + * This file is part of HDF5. The full HDF5 copyright notice, including * + * terms governing use, modification, and redistribution, is contained in * + * the files COPYING and Copyright.html. COPYING can be found at the root * + * of the source code distribution tree; Copyright.html can be found at the * + * root level of an installed copy of the electronic HDF5 document set and * + * is linked from the top-level documents page. It can also be found at * + * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * + * access to either file, you may request a copy from help@hdfgroup.org. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#include "H5VLiod_server.h" + +#ifdef H5_HAVE_EFF + +/* + * Programmer: Mohamad Chaarawi <chaarawi@hdfgroup.gov> + * June, 2013 + * + * Purpose: The IOD plugin server side datatype routines. + */ + + +/*------------------------------------------------------------------------- + * Function: H5VL_iod_server_dtype_commit_cb + * + * Purpose: Commits a dtype as a iod object. + * + * Return: Success: SUCCEED + * Failure: Negative + * + * Programmer: Mohamad Chaarawi + * April, 2013 + * + *------------------------------------------------------------------------- + */ +void +H5VL_iod_server_dtype_commit_cb(AXE_engine_t UNUSED axe_engine, + size_t UNUSED num_n_parents, AXE_task_t UNUSED n_parents[], + size_t UNUSED num_s_parents, AXE_task_t UNUSED s_parents[], + void *_op_data) +{ + op_data_t *op_data = (op_data_t *)_op_data; + dtype_commit_in_t *input = (dtype_commit_in_t *)op_data->input; + dtype_commit_out_t output; + iod_handle_t coh = input->coh; + iod_handle_t loc_handle = input->loc_oh; + iod_obj_id_t loc_id = input->loc_id; /* The ID of the current location object */ + iod_obj_id_t dtype_id = input->dtype_id; /* The ID of the datatype that needs to be created */ + iod_handle_t dtype_oh, cur_oh, mdkv_oh; + iod_obj_id_t cur_id, mdkv_id; + const char *name = input->name; + iod_kv_t kv; + char *last_comp; /* the name of the datatype obtained from the last component in the path */ + size_t buf_size; + void *buf; + iod_mem_desc_t mem_desc; + iod_blob_iodesc_t file_desc; + scratch_pad_t sp; + iod_ret_t ret; + hbool_t collective = FALSE; /* MSC - change when we allow for collective */ + herr_t ret_value = SUCCEED; + + FUNC_ENTER_NOAPI_NOINIT + +#if H5VL_IOD_DEBUG + fprintf(stderr, "Start datatype Commit %s\n", name); +#endif + + /* the traversal will retrieve the location where the datatype needs + to be created. The traversal will fail if an intermediate group + does not exist. */ + if(H5VL_iod_server_traverse(coh, loc_id, loc_handle, name, FALSE, + &last_comp, &cur_id, &cur_oh) < 0) + HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't traverse path"); + + /* create the datatype */ + ret = iod_obj_create(coh, IOD_TID_UNKNOWN, NULL/*hints*/, IOD_OBJ_BLOB, NULL, NULL, + &dtype_id, NULL /*event*/); + if(collective && (0 == ret || EEXISTS == ret)) { + /* Datatype has been created by another process, open it */ + if (iod_obj_open_write(coh, dtype_id, NULL, &dtype_oh, NULL) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't open Datatype"); + } + else if(!collective && 0 != ret) { + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't create Datatype"); + } + + /* for the process that succeeded in creating the datatype, update + the parent KV, create scratch pad */ + if(0 == ret) { + kv.key = HDstrdup(last_comp); + kv.value = &dtype_id; + kv.value_len = sizeof(iod_obj_id_t); + /* insert new datatype in kv store of current group */ + if (iod_kv_set(cur_oh, IOD_TID_UNKNOWN, NULL, &kv, NULL, NULL) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't set KV pair in parent"); + HDfree(kv.key); + + /* create the metadata KV object for the datatype */ + if(iod_obj_create(coh, IOD_TID_UNKNOWN, NULL, IOD_OBJ_KV, + NULL, NULL, &mdkv_id, NULL) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't create metadata KV object"); + + /* set values for the scratch pad object */ + sp.mdkv_id = mdkv_id; + sp.attr_id = IOD_ID_UNDEFINED; + sp.filler1_id = IOD_ID_UNDEFINED; + sp.filler2_id = IOD_ID_UNDEFINED; + + /* set scratch pad in datatype */ + if (iod_obj_set_scratch(dtype_oh, IOD_TID_UNKNOWN, &sp, NULL, NULL) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't set scratch pad"); + + /* Store Metadata in scratch pad */ + if (iod_obj_open_write(coh, mdkv_id, NULL, &mdkv_oh, NULL) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't create scratch pad"); + + /* determine the buffer size needed to store the encoded type of the datatype */ + if(H5Tencode(input->type_id, NULL, &buf_size) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTENCODE, FAIL, "failed to encode datatype type"); + if(NULL == (buf = malloc (buf_size))) + HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't allocate type buffer"); + /* encode datatype of the datatype */ + if(H5Tencode(input->type_id, buf, &buf_size) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTENCODE, FAIL, "failed to encode datatype type"); + +#if 0 + /* create memory descriptor for writing */ + mem_desc.nfrag = 1; + mem_desc.frag->addr = buf; + mem_desc.frag->len = (iod_size_t)buf_size; + + /* create file descriptor for writing */ + file_desc.nfrag = 1; + file_desc.frag->offset = 0; + file_desc.frag->len = (iod_size_t)buf_size; +#endif + + /* write the serialized type value to the BLOB object */ + if(iod_blob_write(cur_oh, IOD_TID_UNKNOWN, NULL, &mem_desc, &file_desc, NULL, NULL) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to write BLOB object"); + + /* MSC - TODO store things */ +#if 0 + /* insert datatype metadata into scratch pad */ + + kv.key = HDstrdup("datatype_tcpl"); + /* determine the buffer size needed to store the encoded tcpl of the datatype */ + if(H5Pencode(input->tcpl_id, NULL, &value_size) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTENCODE, FAIL, "failed to encode datatype tcpl"); + if(NULL == (kv.value = malloc (value_size))) + HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't allocate tcpl buffer"); + /* encode tcpl of the datatype */ + if(H5Pencode(input->tcpl_id, kv.value, &value_size) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTENCODE, FAIL, "failed to encode datatype tcpl"); + kv.value_len = (iod_size_t)value_size; + /* insert kv pair into scratch pad */ + if (iod_kv_set(mdkv_oh, IOD_TID_UNKNOWN, NULL, &kv, NULL, NULL) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't set KV pair in parent"); + HDfree(kv.key); + free(kv.value); + + kv.key = HDstrdup("datatype_size"); + kv.value_len = sizeof(iod_size_t); + if(NULL == (kv.value = malloc (kv.value_len))) + HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't allocate buffer"); + memcpy(kv.value, &buf_size, kv.value_len); + + /* insert kv pair into scratch pad */ + if (iod_kv_set(mdkv_oh, IOD_TID_UNKNOWN, NULL, &kv, NULL, NULL) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't set KV pair in parent"); + HDfree(kv.key); + free(kv.value); +#endif + + /* close the Metadata KV object */ + if(iod_obj_close(mdkv_oh, NULL, NULL)) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't close object"); + } +#if H5_DO_NATIVE + cur_oh.cookie = H5Tcopy(input->type_id); + if(H5Tcommit2(loc_handle.cookie, last_comp, cur_oh.cookie, + H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't commit datatype"); + fprintf(stderr, "Committed Native Datatype %s with ID %d on %d\n", + last_comp, cur_oh.cookie, loc_handle.cookie); +#endif + + /* close parent group and its scratch pad if it is not the + location we started the traversal into */ + if(loc_handle.cookie != cur_oh.cookie) { + iod_obj_close(cur_oh, NULL, NULL); + } + + output.iod_oh = cur_oh; + +#if H5VL_IOD_DEBUG + fprintf(stderr, "Done with dtype commit, sending response to client\n"); +#endif + + HG_Handler_start_output(op_data->hg_handle, &output); + +done: + if(ret_value < 0) { + output.iod_oh.cookie = IOD_OH_UNDEFINED; + HG_Handler_start_output(op_data->hg_handle, &output); + } + + input = (dtype_commit_in_t *)H5MM_xfree(input); + op_data = (op_data_t *)H5MM_xfree(op_data); + last_comp = (char *)H5MM_xfree(last_comp); + free(buf); + + FUNC_LEAVE_NOAPI_VOID +} /* end H5VL_iod_server_dtype_commit_cb() */ + + +/*------------------------------------------------------------------------- + * Function: H5VL_iod_server_dtype_open_cb + * + * Purpose: Opens a datatype as a iod object. + * + * Return: Success: SUCCEED + * Failure: Negative + * + * Programmer: Mohamad Chaarawi + * April, 2013 + * + *------------------------------------------------------------------------- + */ +void +H5VL_iod_server_dtype_open_cb(AXE_engine_t UNUSED axe_engine, + size_t UNUSED num_n_parents, AXE_task_t UNUSED n_parents[], + size_t UNUSED num_s_parents, AXE_task_t UNUSED s_parents[], + void *_op_data) +{ + op_data_t *op_data = (op_data_t *)_op_data; + dtype_open_in_t *input = (dtype_open_in_t *)op_data->input; + dtype_open_out_t output; + iod_handle_t coh = input->coh; + iod_handle_t loc_handle = input->loc_oh; + iod_obj_id_t loc_id = input->loc_id; + iod_obj_id_t dtype_id; + iod_handle_t cur_oh, mdkv_oh; + iod_obj_id_t cur_id, mdkv_id; + const char *name = input->name; + char *last_comp; /* the name of the datatype obtained from the last component in the path */ + size_t buf_size; + void *buf; + iod_mem_desc_t mem_desc; + iod_blob_iodesc_t file_desc; + iod_size_t kv_size = sizeof(iod_obj_id_t); + scratch_pad_t sp; + herr_t ret_value = SUCCEED; + + FUNC_ENTER_NOAPI_NOINIT + + fprintf(stderr, "Start datatype Open %s\n", name); + + /* the traversal will retrieve the location where the datatype needs + to be opened. The traversal will fail if an intermediate group + does not exist. */ + if(H5VL_iod_server_traverse(coh, loc_id, loc_handle, name, FALSE, + &last_comp, &cur_id, &cur_oh) < 0) + HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't traverse path"); + + if(iod_kv_get_value(cur_oh, IOD_TID_UNKNOWN, last_comp, &dtype_id, + kv_size , NULL, NULL) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't retrieve BLOB ID from parent KV store"); + + /* open the datatype */ + if (iod_obj_open_write(coh, dtype_id, NULL /*hints*/, &cur_oh, NULL) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't open datatype"); + + /* get scratch pad of the datatype */ + if(iod_obj_get_scratch(cur_oh, IOD_TID_UNKNOWN, &sp, NULL, NULL) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "can't get scratch pad for object"); + + /* open the metadata scratch pad */ + if (iod_obj_open_write(coh, sp.mdkv_id, NULL /*hints*/, &mdkv_oh, NULL) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "can't open scratch pad"); + + /* MSC - need to read datatype; size should be stored in metadata, + but since no real IOD, can't do anything now */ + +#if 0 + /*retrieve tcpl metadata from scratch pad */ + if(iod_kv_get_value(mdkv_oh, IOD_TID_UNKNOWN, "datatype_tcpl", NULL, + &output.tcpl_size, NULL, NULL) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "datatype tcpl lookup failed"); + if(NULL == (output.tcpl = H5MM_malloc (output.tcpl_size))) + HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't allocate tcpl buffer"); + if(iod_kv_get_value(mdkv_oh, IOD_TID_UNKNOWN, "datatype_tcpl", output.tcpl, + &output.tcpl_size, NULL, NULL) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "datatype tcpl lookup failed"); + + /*retrieve blob size metadata from scratch pad */ + if(iod_kv_get_value(mdkv_oh, IOD_TID_UNKNOWN, "datatype_size", &buf_size, + sizeof(iod_size_t), NULL, NULL) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "datatype size lookup failed"); + + if(NULL == (buf = malloc(buf_size))) + HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't allocate BLOB read buffer"); + + /* create memory descriptor for writing */ + mem_desc.nfrag = 1; + mem_desc.frag->addr = buf; + mem_desc.frag->len = (iod_size_t)buf_size; + + /* create file descriptor for writing */ + file_desc.nfrag = 1; + file_desc.frag->offset = 0; + file_desc.frag->len = (iod_size_t)buf_size; + + /* write the serialized type value to the BLOB object */ + if(iod_blob_write(cur_oh, IOD_TID_UNKNOWN, NULL, &mem_desc, &file_desc, NULL, NULL) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to write BLOB object"); + + /* decode the datatype */ + if((output.type_id = H5Tdecode(buf)) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to decode datatype"); + + free(buf); +#endif + + /* close the metadata scratch pad */ + if(iod_obj_close(mdkv_oh, NULL, NULL)) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't close object"); + +#if H5_DO_NATIVE + printf("datatype name %s location %d\n", name, loc_handle.cookie); + cur_oh.cookie = H5Topen(loc_handle.cookie, name, input->tapl_id); + HDassert(cur_oh.cookie); + output.type_id = cur_oh.cookie; + output.tcpl_id = H5P_DATATYPE_CREATE_DEFAULT; +#else + /* fake a type, and tcpl */ + output.type_id = H5Tcopy(H5T_NATIVE_INT); + output.tcpl_id = H5P_DATATYPE_CREATE_DEFAULT; +#endif + + output.iod_id = dtype_id; + output.iod_oh = cur_oh; + +#if H5VL_IOD_DEBUG + fprintf(stderr, "Done with dtype open, sending response to client\n"); +#endif + + HG_Handler_start_output(op_data->hg_handle, &output); + +done: + if(ret_value < 0) { + output.iod_oh.cookie = IOD_OH_UNDEFINED; + output.iod_id = IOD_ID_UNDEFINED; + HG_Handler_start_output(op_data->hg_handle, &output); + } + +#if !H5_DO_NATIVE + H5Tclose(output.type_id); +#endif + + last_comp = (char *)H5MM_xfree(last_comp); + input = (dtype_open_in_t *)H5MM_xfree(input); + op_data = (op_data_t *)H5MM_xfree(op_data); + + FUNC_LEAVE_NOAPI_VOID +} /* end H5VL_iod_server_dtype_open_cb() */ + + +/*------------------------------------------------------------------------- + * Function: H5VL_iod_server_dtype_close_cb + * + * Purpose: Closes iod HDF5 datatype. + * + * Return: Success: SUCCEED + * Failure: Negative + * + * Programmer: Mohamad Chaarawi + * April, 2013 + * + *------------------------------------------------------------------------- + */ +void +H5VL_iod_server_dtype_close_cb(AXE_engine_t UNUSED axe_engine, + size_t UNUSED num_n_parents, AXE_task_t UNUSED n_parents[], + size_t UNUSED num_s_parents, AXE_task_t UNUSED s_parents[], + void *_op_data) +{ + op_data_t *op_data = (op_data_t *)_op_data; + dtype_close_in_t *input = (dtype_close_in_t *)op_data->input; + iod_handle_t iod_oh = input->iod_oh; + iod_obj_id_t iod_id = input->iod_id; + herr_t ret_value = SUCCEED; + + FUNC_ENTER_NOAPI_NOINIT + +#if H5VL_IOD_DEBUG + fprintf(stderr, "Start datatype Close\n"); +#endif + + if(iod_oh.cookie != IOD_OH_UNDEFINED) { +#if H5_DO_NATIVE + HDassert(H5Tclose(iod_oh.cookie) == SUCCEED); +#endif + + if((ret_value = iod_obj_close(iod_oh, NULL, NULL)) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't close object"); + } + else { + /* MSC - need a way to kill object handle for this group */ + fprintf(stderr, "I do not have the OH of this datatype to close it\n"); + } + +done: +#if H5VL_IOD_DEBUG + fprintf(stderr, "Done with dtype close, sending response to client\n"); +#endif + + HG_Handler_start_output(op_data->hg_handle, &ret_value); + + input = (dtype_close_in_t *)H5MM_xfree(input); + op_data = (op_data_t *)H5MM_xfree(op_data); + + FUNC_LEAVE_NOAPI_VOID +} /* end H5VL_iod_server_dtype_close_cb() */ + +#endif /* H5_HAVE_EFF */ diff --git a/src/H5VLiod_file.c b/src/H5VLiod_file.c new file mode 100644 index 0000000..3dc9a3e --- /dev/null +++ b/src/H5VLiod_file.c @@ -0,0 +1,348 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by The HDF Group. * + * Copyright by the Board of Trustees of the University of Illinois. * + * All rights reserved. * + * * + * This file is part of HDF5. The full HDF5 copyright notice, including * + * terms governing use, modification, and redistribution, is contained in * + * the files COPYING and Copyright.html. COPYING can be found at the root * + * of the source code distribution tree; Copyright.html can be found at the * + * root level of an installed copy of the electronic HDF5 document set and * + * is linked from the top-level documents page. It can also be found at * + * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * + * access to either file, you may request a copy from help@hdfgroup.org. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#include "H5VLiod_server.h" + +#ifdef H5_HAVE_EFF + +/* + * Programmer: Mohamad Chaarawi <chaarawi@hdfgroup.gov> + * February, 2013 + * + * Purpose: The IOD plugin server side file routines. + */ + +static iod_obj_id_t ROOT_ID; + + +/*------------------------------------------------------------------------- + * Function: H5VL_iod_server_file_create_cb + * + * Purpose: Creates a file as a iod HDF5 file. + * + * Return: Success: SUCCEED + * Failure: Negative + * + * Programmer: Mohamad Chaarawi + * January, 2013 + * + *------------------------------------------------------------------------- + */ +void +H5VL_iod_server_file_create_cb(AXE_engine_t UNUSED axe_engine, + size_t UNUSED num_n_parents, AXE_task_t UNUSED n_parents[], + size_t UNUSED num_s_parents, AXE_task_t UNUSED s_parents[], + void *_op_data) +{ + op_data_t *op_data = (op_data_t *)_op_data; + file_create_in_t *input = (file_create_in_t *)op_data->input; + file_create_out_t output; + unsigned int mode; + iod_handle_t coh; + iod_handle_t root_oh, mdkv_oh; + iod_obj_id_t mdkv_id; + iod_ret_t ret; + herr_t ret_value = SUCCEED; + + FUNC_ENTER_NOAPI_NOINIT + +#if H5VL_IOD_DEBUG + fprintf(stderr, "Start file create %s %d %d\n", input->name, input->fapl_id, input->fcpl_id); +#endif + + /* convert HDF5 flags to IOD flags */ + mode = (input->flags&H5F_ACC_RDWR) ? IOD_CONT_RW : IOD_CONT_RO; + if (input->flags&H5F_ACC_CREAT) + mode |= IOD_CONT_CREATE; + + /* Create the Container */ + if(iod_container_open(input->name, NULL /*hints*/, mode, &coh, NULL /*event*/) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "can't create container"); + + /* create the root group */ + ret = iod_obj_create(coh, IOD_TID_UNKNOWN, NULL, IOD_OBJ_KV, NULL, NULL, + &input->root_id, NULL); + if(0 == ret || EEXISTS == ret) { + /* root group has been created, open it */ + if (iod_obj_open_write(coh, input->root_id, NULL, &root_oh, NULL) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't open root group"); + } + else { + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't create root group"); + } + + /* for the process that succeeded in creating the group, create + the scratch pad for it too */ + if(0 == ret) { + scratch_pad_t sp; + + /* create the metadata KV object for the root group */ + if(iod_obj_create(coh, IOD_TID_UNKNOWN, NULL, IOD_OBJ_KV, + NULL, NULL, &mdkv_id, NULL) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't create metadata KV object"); + + /* set values for the scratch pad object */ + sp.mdkv_id = mdkv_id; + sp.attr_id = IOD_ID_UNDEFINED; + sp.filler1_id = IOD_ID_UNDEFINED; + sp.filler2_id = IOD_ID_UNDEFINED; + + /* set scratch pad in root group */ + if (iod_obj_set_scratch(root_oh, IOD_TID_UNKNOWN, &sp, NULL, NULL) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't set scratch pad"); + + /* Store Metadata in scratch pad */ + if (iod_obj_open_write(coh, mdkv_id, NULL, &mdkv_oh, NULL) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't create scratch pad"); + + /* MSC - TODO store things */ + + if(iod_obj_close(mdkv_oh, NULL, NULL)) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't close root object handle"); + } + +#if H5_DO_NATIVE + coh.cookie = H5Fcreate(input->name, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); + HDassert(coh.cookie); + root_oh.cookie = coh.cookie; + fprintf(stderr, "Created Native file %s with ID %d\n", input->name, root_oh.cookie); +#endif + + output.coh = coh; + output.root_oh = root_oh; + output.kv_oid_index = 1; + output.array_oid_index = 1; + output.blob_oid_index = 1; + +#if H5VL_IOD_DEBUG + fprintf(stderr, "Done with file create, sending response to client \n"); +#endif + + HG_Handler_start_output(op_data->hg_handle, &output); + +done: + if(ret_value < 0) { + output.coh.cookie = IOD_OH_UNDEFINED; + output.root_oh.cookie = IOD_OH_UNDEFINED; + output.kv_oid_index = 0; + output.array_oid_index = 0; + output.blob_oid_index = 0; + HG_Handler_start_output(op_data->hg_handle, &ret_value); + } + + input = (file_create_in_t *)H5MM_xfree(input); + op_data = (op_data_t *)H5MM_xfree(op_data); + + FUNC_LEAVE_NOAPI_VOID +} /* end H5VL_iod_server_file_create_cb() */ + + +/*------------------------------------------------------------------------- + * Function: H5VL_iod_server_file_open_cb + * + * Purpose: Opens a file as a iod HDF5 file. + * + * Return: Success: SUCCEED + * Failure: Negative + * + * Programmer: Mohamad Chaarawi + * January, 2013 + * + *------------------------------------------------------------------------- + */ +void +H5VL_iod_server_file_open_cb(AXE_engine_t UNUSED axe_engine, + size_t UNUSED num_n_parents, AXE_task_t UNUSED n_parents[], + size_t UNUSED num_s_parents, AXE_task_t UNUSED s_parents[], + void *_op_data) +{ + op_data_t *op_data = (op_data_t *)_op_data; + file_open_in_t *input = (file_open_in_t *)op_data->input; + file_open_out_t output; + unsigned int mode = input->flags; + iod_handle_t coh; + iod_handle_t root_oh, mdkv_oh; + scratch_pad_t sp; + herr_t ret_value = SUCCEED; + + FUNC_ENTER_NOAPI_NOINIT + +#if H5VL_IOD_DEBUG + fprintf(stderr, "Start file open %s %d %d\n", input->name, input->flags, input->fapl_id); +#endif + + /* open the container */ + if(iod_container_open(input->name, NULL /*hints*/, mode, &coh, NULL /*event*/)) + HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "can't open file"); + + /* open the root group */ + if (iod_obj_open_write(coh, ROOT_ID, NULL /*hints*/, &root_oh, NULL) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "can't open root object"); + + /* get scratch pad of root group */ + if(iod_obj_get_scratch(root_oh, IOD_TID_UNKNOWN, &sp, NULL, NULL) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "can't get scratch pad for root object"); + + /* open the metadata scratch pad */ + if (iod_obj_open_write(coh, sp.mdkv_id, NULL /*hints*/, &mdkv_oh, NULL) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "can't open scratch pad"); + + /* MSC - retrieve metadata */ + output.kv_oid_index = 1; + output.array_oid_index = 1; + output.blob_oid_index = 1; + output.fcpl_id = H5P_FILE_CREATE_DEFAULT; + + /* close the metadata scratch pad */ + if(iod_obj_close(mdkv_oh, NULL, NULL)) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't close root object handle"); + +#if H5_DO_NATIVE + { + coh.cookie = H5Fopen(input->name, H5F_ACC_RDWR, H5P_DEFAULT); + HDassert(coh.cookie); + root_oh.cookie = coh.cookie; + fprintf(stderr, "Opened Native file %s with ID %d\n", input->name, root_oh.cookie); + } +#endif + + output.coh = coh; + output.root_id = ROOT_ID; + output.root_oh = root_oh; + +#if H5VL_IOD_DEBUG + fprintf(stderr, "Done with file open, sending response to client\n"); +#endif + + HG_Handler_start_output(op_data->hg_handle, &output); + +done: + if(ret_value < 0) { + output.coh.cookie = IOD_OH_UNDEFINED; + output.root_id = IOD_ID_UNDEFINED; + output.root_oh.cookie = IOD_OH_UNDEFINED; + output.fcpl_id = H5P_FILE_CREATE_DEFAULT; + output.kv_oid_index = 0; + output.array_oid_index = 0; + output.blob_oid_index = 0; + HG_Handler_start_output(op_data->hg_handle, &output); + } + + input = (file_open_in_t *)H5MM_xfree(input); + op_data = (op_data_t *)H5MM_xfree(op_data); + + FUNC_LEAVE_NOAPI_VOID +} /* end H5VL_iod_server_file_open_cb() */ + + +/*------------------------------------------------------------------------- + * Function: H5VL_iod_server_file_flush_cb + * + * Purpose: Flushs iod HDF5 file. + * + * Return: Success: SUCCEED + * Failure: Negative + * + * Programmer: Mohamad Chaarawi + * January, 2013 + * + *------------------------------------------------------------------------- + */ +void +H5VL_iod_server_file_flush_cb(AXE_engine_t UNUSED axe_engine, + size_t UNUSED num_n_parents, AXE_task_t UNUSED n_parents[], + size_t UNUSED num_s_parents, AXE_task_t UNUSED s_parents[], + void *_op_data) +{ + op_data_t *op_data = (op_data_t *)_op_data; + file_flush_in_t *input = (file_flush_in_t *)op_data->input; + iod_handle_t coh = input->coh; + H5F_scope_t scope = input->scope; + herr_t ret_value = SUCCEED; + + FUNC_ENTER_NOAPI_NOINIT + + /* MSC - TODO */ + +#if H5_DO_NATIVE + ret_value = H5Fflush(coh.cookie, scope); +#endif + +done: + if(HG_SUCCESS != HG_Handler_start_output(op_data->hg_handle, &ret_value)) + HDONE_ERROR(H5E_SYM, H5E_CANTDEC, FAIL, "can't send result of file flush to client"); + + input = (file_flush_in_t *)H5MM_xfree(input); + op_data = (op_data_t *)H5MM_xfree(op_data); + + FUNC_LEAVE_NOAPI_VOID +} /* end H5VL_iod_server_file_flush_cb() */ + + +/*------------------------------------------------------------------------- + * Function: H5VL_iod_server_file_close_cb + * + * Purpose: Closes iod HDF5 file. + * + * Return: Success: SUCCEED + * Failure: Negative + * + * Programmer: Mohamad Chaarawi + * January, 2013 + * + *------------------------------------------------------------------------- + */ +void +H5VL_iod_server_file_close_cb(AXE_engine_t UNUSED axe_engine, + size_t UNUSED num_n_parents, AXE_task_t UNUSED n_parents[], + size_t UNUSED num_s_parents, AXE_task_t UNUSED s_parents[], + void *_op_data) +{ + op_data_t *op_data = (op_data_t *)_op_data; + file_close_in_t *input = (file_close_in_t *)op_data->input; + iod_handle_t coh = input->coh; + iod_handle_t root_oh = input->root_oh; + herr_t ret_value = SUCCEED; + + FUNC_ENTER_NOAPI_NOINIT + +#if H5VL_IOD_DEBUG + fprintf(stderr, "Start file close\n"); +#endif + +#if H5_DO_NATIVE + H5Fclose(coh.cookie); +#endif + + /* close the root group */ + if(iod_obj_close(root_oh, NULL, NULL) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTDEC, FAIL, "can't close root object handle"); + + /* close the container */ + if(iod_container_close(coh, NULL, NULL) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTDEC, FAIL, "can't close container"); + +done: + fprintf(stderr, "Done with file close, sending response to client\n"); + if(HG_SUCCESS != HG_Handler_start_output(op_data->hg_handle, &ret_value)) + HDONE_ERROR(H5E_SYM, H5E_CANTDEC, FAIL, "can't send result of file close to client"); + + input = (file_close_in_t *)H5MM_xfree(input); + op_data = (op_data_t *)H5MM_xfree(op_data); + + FUNC_LEAVE_NOAPI_VOID +} /* end H5VL_iod_server_file_close_cb() */ + +#endif /* H5_HAVE_EFF */ diff --git a/src/H5VLiod_group.c b/src/H5VLiod_group.c new file mode 100644 index 0000000..33a8fad --- /dev/null +++ b/src/H5VLiod_group.c @@ -0,0 +1,337 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by The HDF Group. * + * Copyright by the Board of Trustees of the University of Illinois. * + * All rights reserved. * + * * + * This file is part of HDF5. The full HDF5 copyright notice, including * + * terms governing use, modification, and redistribution, is contained in * + * the files COPYING and Copyright.html. COPYING can be found at the root * + * of the source code distribution tree; Copyright.html can be found at the * + * root level of an installed copy of the electronic HDF5 document set and * + * is linked from the top-level documents page. It can also be found at * + * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * + * access to either file, you may request a copy from help@hdfgroup.org. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#include "H5VLiod_server.h" + +#ifdef H5_HAVE_EFF + +/* + * Programmer: Mohamad Chaarawi <chaarawi@hdfgroup.gov> + * June, 2013 + * + * Purpose: The IOD plugin server side group routines. + */ + +#define EEXISTS 1 + + +/*------------------------------------------------------------------------- + * Function: H5VL_iod_server_group_create_cb + * + * Purpose: Creates a group as a iod object. + * + * Return: Success: SUCCEED + * Failure: Negative + * + * Programmer: Mohamad Chaarawi + * February, 2013 + * + *------------------------------------------------------------------------- + */ +void +H5VL_iod_server_group_create_cb(AXE_engine_t UNUSED axe_engine, + size_t UNUSED num_n_parents, AXE_task_t UNUSED n_parents[], + size_t UNUSED num_s_parents, AXE_task_t UNUSED s_parents[], + void *_op_data) +{ + op_data_t *op_data = (op_data_t *)_op_data; + group_create_in_t *input = (group_create_in_t *)op_data->input; + group_create_out_t output; + iod_handle_t coh = input->coh; /* the container handle */ + iod_handle_t loc_handle = input->loc_oh; /* The handle for current object - could be undefined */ + iod_obj_id_t loc_id = input->loc_id; /* The ID of the current location object */ + iod_obj_id_t grp_id = input->grp_id; /* The ID of the group that needs to be created */ + const char *name = input->name; /* path relative to loc_id and loc_oh */ + iod_handle_t grp_oh, cur_oh, mdkv_oh; + iod_obj_id_t cur_id, mdkv_id; + char *last_comp; /* the name of the group obtained from traversal function */ + iod_kv_t kv; + scratch_pad_t sp; + iod_ret_t ret; + hbool_t collective = FALSE; /* MSC - change when we allow for collective */ + herr_t ret_value = SUCCEED; + + FUNC_ENTER_NOAPI_NOINIT + +#if H5VL_IOD_DEBUG + fprintf(stderr, "Start group create %s\n", name); +#endif + + /* the traversal will retrieve the location where the group needs + to be created. The traversal will fail if an intermediate group + does not exist. */ + if(H5VL_iod_server_traverse(coh, loc_id, loc_handle, name, FALSE, + &last_comp, &cur_id, &cur_oh) < 0) + HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't traverse path"); + + /* create the group */ + ret = iod_obj_create(coh, IOD_TID_UNKNOWN, NULL, IOD_OBJ_KV, + NULL, NULL, &grp_id, NULL); + if(collective && (0 == ret || EEXISTS == ret)) { + /* group has been created by another process, open it */ + if (iod_obj_open_write(coh, grp_id, NULL, &grp_oh, NULL) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't open Group"); + } + else if(!collective && 0 != ret) { + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't create Group"); + } + + /* for the process that succeeded in creating the group, create + the scratch pad for it too */ + if(0 == ret) { + /* insert new group in kv store of parent object */ + kv.key = HDstrdup(last_comp); + kv.value = &grp_id; + kv.value_len = sizeof(iod_obj_id_t); + if (iod_kv_set(cur_oh, IOD_TID_UNKNOWN, NULL, &kv, NULL, NULL) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't set KV pair in parent"); + HDfree(kv.key); + + /* create the metadata KV object for the group */ + if(iod_obj_create(coh, IOD_TID_UNKNOWN, NULL, IOD_OBJ_KV, + NULL, NULL, &mdkv_id, NULL) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't create metadata KV object"); + + /* set values for the scratch pad object */ + sp.mdkv_id = mdkv_id; + sp.attr_id = IOD_ID_UNDEFINED; + sp.filler1_id = IOD_ID_UNDEFINED; + sp.filler2_id = IOD_ID_UNDEFINED; + + /* set scratch pad in group */ + if (iod_obj_set_scratch(grp_oh, IOD_TID_UNKNOWN, &sp, NULL, NULL) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't set scratch pad"); + + /* Store Metadata in scratch pad */ + if (iod_obj_open_write(coh, mdkv_id, NULL, &mdkv_oh, NULL) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't create scratch pad"); + + /* MSC - TODO store things */ + + if(iod_obj_close(mdkv_oh, NULL, NULL)) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't close object"); + } /* end if */ + + /* close parent group if it is not the location we started the + traversal into */ + if(loc_handle.cookie != cur_oh.cookie) { + iod_obj_close(cur_oh, NULL, NULL); + } +#if H5_DO_NATIVE + grp_oh.cookie = H5Gcreate2(loc_handle.cookie, name, input->lcpl_id, + input->gcpl_id, input->gapl_id); + HDassert(grp_oh.cookie); +#endif + +#if H5VL_IOD_DEBUG + fprintf(stderr, "Done with group create, sending response to client\n"); +#endif + + /* return the object handle for the group to the client */ + output.iod_oh = grp_oh; + HG_Handler_start_output(op_data->hg_handle, &output); + +done: + /* return an UNDEFINED oh to the client if the operation failed */ + if(ret_value < 0) { + fprintf(stderr, "Failed Group Create\n"); + output.iod_oh.cookie = IOD_OH_UNDEFINED; + HG_Handler_start_output(op_data->hg_handle, &output); + } + + last_comp = (char *)H5MM_xfree(last_comp); + input = (group_create_in_t *)H5MM_xfree(input); + op_data = (op_data_t *)H5MM_xfree(op_data); + + FUNC_LEAVE_NOAPI_VOID +} /* end H5VL_iod_server_group_create_cb() */ + + +/*------------------------------------------------------------------------- + * Function: H5VL_iod_server_group_open_cb + * + * Purpose: Opens a group as a iod object. + * + * Return: Success: SUCCEED + * Failure: Negative + * + * Programmer: Mohamad Chaarawi + * February, 2013 + * + *------------------------------------------------------------------------- + */ +void +H5VL_iod_server_group_open_cb(AXE_engine_t UNUSED axe_engine, + size_t UNUSED num_n_parents, AXE_task_t UNUSED n_parents[], + size_t UNUSED num_s_parents, AXE_task_t UNUSED s_parents[], + void *_op_data) +{ + op_data_t *op_data = (op_data_t *)_op_data; + group_open_in_t *input = (group_open_in_t *)op_data->input; + group_open_out_t output; + iod_handle_t coh = input->coh; + iod_handle_t loc_handle = input->loc_oh; + iod_obj_id_t loc_id = input->loc_id; + const char *name = input->name; + iod_obj_id_t grp_id; /* The ID of the group that needs to be opened */ + iod_handle_t cur_oh, mdkv_oh; + iod_obj_id_t cur_id, mdkv_id; + char *last_comp; /* the name of the group obtained from traversal function */ + iod_size_t kv_size; + scratch_pad_t sp; + herr_t ret_value = SUCCEED; + + FUNC_ENTER_NOAPI_NOINIT + +#if H5VL_IOD_DEBUG + fprintf(stderr, "Start group open %s\n", name); +#endif + + /* the traversal will retrieve the location where the group needs + to be created. The traversal will fail if an intermediate group + does not exist. */ + if(H5VL_iod_server_traverse(coh, loc_id, loc_handle, name, FALSE, + &last_comp, &cur_id, &cur_oh) < 0) + HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't traverse path"); + + kv_size = sizeof(iod_obj_id_t); + + /* lookup group in the current location */ + if(iod_kv_get_value(cur_oh, IOD_TID_UNKNOWN, last_comp, &grp_id, &kv_size, NULL, NULL) < 0) { + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "Intermdiate group does not exist"); + } /* end if */ + + /* close parent group and its scratch pad if it is not the + location we started the traversal into */ + if(loc_handle.cookie != cur_oh.cookie) { + iod_obj_close(cur_oh, NULL, NULL); + } + + /* open the group */ + if (iod_obj_open_write(coh, grp_id, NULL, &cur_oh, NULL) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't open current group"); + + /* get scratch pad of group */ + if(iod_obj_get_scratch(cur_oh, IOD_TID_UNKNOWN, &sp, NULL, NULL) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "can't get scratch pad for object"); + + /* open the metadata scratch pad */ + if (iod_obj_open_write(coh, sp.mdkv_id, NULL /*hints*/, &mdkv_oh, NULL) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "can't open scratch pad"); + + /* MSC - retrieve metadata */ +#if 0 + /* When we have a real IOD, open the scratch pad and read the + group's metadata */ + if(iod_kv_get_value(mdkv_oh, IOD_TID_UNKNOWN, "dataset_gcpl", NULL, + &output.gcpl_size, NULL, NULL) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "dataset gcpl lookup failed"); + if(NULL == (output.gcpl = H5MM_malloc (output.gcpl_size))) + HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't allocate gcpl buffer"); + if(iod_kv_get_value(mdkv_oh, IOD_TID_UNKNOWN, "dataset_gcpl", output.gcpl, + &output.gcpl_size, NULL, NULL) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "dataset dcpl lookup failed"); +#endif + + /* close the metadata scratch pad */ + if(iod_obj_close(mdkv_oh, NULL, NULL)) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't close meta data KV handle"); + +#if H5_DO_NATIVE + cur_oh.cookie = H5Gopen(loc_handle.cookie, name, input->gapl_id); + HDassert(cur_oh.cookie); +#endif + + output.iod_id = grp_id; + output.iod_oh = cur_oh; + output.gcpl_id = H5P_GROUP_CREATE_DEFAULT; + +#if H5VL_IOD_DEBUG + fprintf(stderr, "Done with group open, sending response to client\n"); +#endif + + HG_Handler_start_output(op_data->hg_handle, &output); + +done: + if(ret_value < 0) { + output.iod_oh.cookie = IOD_OH_UNDEFINED; + output.iod_id = IOD_ID_UNDEFINED; + output.gcpl_id = H5P_GROUP_CREATE_DEFAULT; + HG_Handler_start_output(op_data->hg_handle, &output); + } + + last_comp = (char *)H5MM_xfree(last_comp); + input = (group_open_in_t *)H5MM_xfree(input); + op_data = (op_data_t *)H5MM_xfree(op_data); + + FUNC_LEAVE_NOAPI_VOID +} /* end H5VL_iod_server_group_open_cb() */ + + +/*------------------------------------------------------------------------- + * Function: H5VL_iod_server_group_close_cb + * + * Purpose: Closes iod HDF5 group. + * + * Return: Success: SUCCEED + * Failure: Negative + * + * Programmer: Mohamad Chaarawi + * January, 2013 + * + *------------------------------------------------------------------------- + */ +void +H5VL_iod_server_group_close_cb(AXE_engine_t UNUSED axe_engine, + size_t UNUSED num_n_parents, AXE_task_t UNUSED n_parents[], + size_t UNUSED num_s_parents, AXE_task_t UNUSED s_parents[], + void *_op_data) +{ + op_data_t *op_data = (op_data_t *)_op_data; + group_close_in_t *input = (group_close_in_t *)op_data->input; + iod_handle_t iod_oh = input->iod_oh; + herr_t ret_value = SUCCEED; + + FUNC_ENTER_NOAPI_NOINIT + +#if H5VL_IOD_DEBUG + fprintf(stderr, "Start group close\n"); +#endif + + if(iod_oh.cookie != IOD_OH_UNDEFINED) { +#if H5_DO_NATIVE + ret_value = H5Gclose(iod_oh.cookie); +#endif + if((ret_value = iod_obj_close(iod_oh, NULL, NULL)) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't close object"); + } + else { + /* MSC - need a way to kill object handle for this group */ + fprintf(stderr, "I do not have the OH of this group to close it\n"); + } +done: +#if H5VL_IOD_DEBUG + fprintf(stderr, "Done with group close, sending response to client\n"); +#endif + + HG_Handler_start_output(op_data->hg_handle, &ret_value); + + input = (group_close_in_t *)H5MM_xfree(input); + op_data = (op_data_t *)H5MM_xfree(op_data); + + FUNC_LEAVE_NOAPI_VOID +} /* end H5VL_iod_server_group_close_cb() */ + +#endif /* H5_HAVE_EFF */ diff --git a/src/H5VLiod_link.c b/src/H5VLiod_link.c new file mode 100644 index 0000000..bf24949 --- /dev/null +++ b/src/H5VLiod_link.c @@ -0,0 +1,470 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by The HDF Group. * + * Copyright by the Board of Trustees of the University of Illinois. * + * All rights reserved. * + * * + * This file is part of HDF5. The full HDF5 copyright notice, including * + * terms governing use, modification, and redistribution, is contained in * + * the files COPYING and Copyright.html. COPYING can be found at the root * + * of the source code distribution tree; Copyright.html can be found at the * + * root level of an installed copy of the electronic HDF5 document set and * + * is linked from the top-level documents page. It can also be found at * + * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * + * access to either file, you may request a copy from help@hdfgroup.org. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#include "H5VLiod_server.h" + +#ifdef H5_HAVE_EFF + +/* + * Programmer: Mohamad Chaarawi <chaarawi@hdfgroup.gov> + * June, 2013 + * + * Purpose: The IOD plugin server side link routines. + */ + + +/*------------------------------------------------------------------------- + * Function: H5VL_iod_server_link_create_cb + * + * Purpose: Creates a new link in the container (Hard or Soft). + * + * Return: Success: SUCCEED + * Failure: Negative + * + * Programmer: Mohamad Chaarawi + * May, 2013 + * + *------------------------------------------------------------------------- + */ +void +H5VL_iod_server_link_create_cb(AXE_engine_t UNUSED axe_engine, + size_t UNUSED num_n_parents, AXE_task_t UNUSED n_parents[], + size_t UNUSED num_s_parents, AXE_task_t UNUSED s_parents[], + void *_op_data) +{ + op_data_t *op_data = (op_data_t *)_op_data; + link_create_in_t *input = (link_create_in_t *)op_data->input; + H5VL_link_create_type_t create_type = input->create_type; + iod_handle_t coh = input->coh; /* the container handle */ + iod_handle_t src_oh; /* The handle for creation src object */ + iod_obj_id_t src_id; /* The ID of the creation src object */ + iod_handle_t cur_oh, target_oh; + iod_obj_id_t cur_id; + iod_obj_id_t target_id; /* The ID of the target object where link is created*/ + char *src_last_comp = NULL, *dst_last_comp = NULL; + iod_kv_t kv; + iod_size_t kv_size = sizeof(iod_obj_id_t); + herr_t ret_value = SUCCEED; + + FUNC_ENTER_NOAPI_NOINIT + +#if H5VL_IOD_DEBUG + fprintf(stderr, "Start link create\n"); +#endif + + /* the traversal will retrieve the location where the link needs + to be created from. The traversal will fail if an intermediate group + does not exist. */ + if(H5VL_iod_server_traverse(coh, input->loc_id, input->loc_oh, input->loc_name, FALSE, + &src_last_comp, &cur_id, &cur_oh) < 0) + HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't traverse path"); + + /* lookup group in the current location */ + if(iod_kv_get_value(cur_oh, IOD_TID_UNKNOWN, src_last_comp, &src_id, &kv_size, NULL, NULL) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "Intermdiate group does not exist"); + + /* close parent group if it is not the location we started the + traversal into */ + if(input->loc_oh.cookie != cur_oh.cookie) { + iod_obj_close(cur_oh, NULL, NULL); + } + + /* open the source group for link creation*/ + if (iod_obj_open_write(coh, src_id, NULL, &src_oh, NULL) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't open current group"); + + if(H5VL_LINK_CREATE_HARD == create_type) { + /* Retrieve the parent of the object where the new link points + to. The traversal must not fail. */ + if(H5VL_iod_server_traverse(coh, input->target_loc_id, input->target_loc_oh, + input->target_name, FALSE, + &dst_last_comp, &cur_id, &cur_oh) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't traverse path"); + + /* lookup target object in the current location - the lookup + must succeed since this is a hard link. */ + if(iod_kv_get_value(cur_oh, IOD_TID_UNKNOWN, dst_last_comp, &target_id, &kv_size, + NULL, NULL) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "Intermdiate group does not exist"); + } + else if(H5VL_LINK_CREATE_SOFT == create_type) { + /* Retrieve the parent of the object where the new link points + to. The traversal must not fail. */ + if(H5VL_iod_server_traverse(coh, input->target_loc_id, input->target_loc_oh, + input->target_name, FALSE, + &dst_last_comp, &cur_id, &cur_oh) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't traverse path"); + + /* lookup target object in the current location. The lookup + might fail since this is a soft link */ + if(iod_kv_get_value(cur_oh, IOD_TID_UNKNOWN, dst_last_comp, + &target_id, &kv_size, NULL, NULL) < 0) { + /* the lookup failed so just insert the target_id as + undefined in the src object */ + /* MSC - Figure out what to do when reaccessing this + object after it was created */ + target_id = IOD_ID_UNDEFINED; + } + } + else + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "Invalid Link type"); + + /* close parent group if it is not the location we started the + traversal into */ + if(input->loc_oh.cookie != cur_oh.cookie) { + iod_obj_close(cur_oh, NULL, NULL); + } + + /* insert new link (target group's ID) in kv store of the source object */ + kv.key = HDstrdup(src_last_comp); + kv.value = &target_id; + kv.value_len = kv_size; + if (iod_kv_set(src_oh, IOD_TID_UNKNOWN, NULL, &kv, NULL, NULL) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't set KV pair in parent"); + HDfree(kv.key); + + /* close the source group */ + if(src_oh.cookie != input->loc_oh.cookie) { + iod_obj_close(src_oh, NULL, NULL); + } + + /* open the target object */ + if (iod_obj_open_write(coh, target_id, NULL, &target_oh, NULL) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't open current group"); + + /* MSC - update metadata link information for this object */ + + /* close the target object */ + iod_obj_close(target_oh, NULL, NULL); + +#if H5_DO_NATIVE + if(H5VL_LINK_CREATE_HARD == create_type) { + if(H5Lcreate_hard(input->target_loc_oh.cookie, input->target_name, + input->loc_oh.cookie, input->loc_name, H5P_DEFAULT, H5P_DEFAULT) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't create hard link"); + } + else if(H5VL_LINK_CREATE_SOFT == create_type) { + if(H5Lcreate_soft(input->target_name, input->loc_oh.cookie, input->loc_name, + H5P_DEFAULT, H5P_DEFAULT) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't create soft link"); + } + else + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "Invalid Link type"); +#endif + +done: +#if H5VL_IOD_DEBUG + fprintf(stderr, "Done with link create, sending response to client\n"); +#endif + + HG_Handler_start_output(op_data->hg_handle, &ret_value); + + src_last_comp = (char *)H5MM_xfree(src_last_comp); + dst_last_comp = (char *)H5MM_xfree(dst_last_comp); + input = (link_create_in_t *)H5MM_xfree(input); + op_data = (op_data_t *)H5MM_xfree(op_data); + + FUNC_LEAVE_NOAPI_VOID +} /* end H5VL_iod_server_link_create_cb() */ + + +/*------------------------------------------------------------------------- + * Function: H5VL_iod_server_link_move_cb + * + * Purpose: Moves/Copies a link in the container. + * + * Return: Success: SUCCEED + * Failure: Negative + * + * Programmer: Mohamad Chaarawi + * May, 2013 + * + *------------------------------------------------------------------------- + */ +void +H5VL_iod_server_link_move_cb(AXE_engine_t UNUSED axe_engine, + size_t UNUSED num_n_parents, AXE_task_t UNUSED n_parents[], + size_t UNUSED num_s_parents, AXE_task_t UNUSED s_parents[], + void *_op_data) +{ + op_data_t *op_data = (op_data_t *)_op_data; + link_move_in_t *input = (link_move_in_t *)op_data->input; + hbool_t copy_flag = input->copy_flag; + iod_handle_t coh = input->coh; /* the container handle */ + iod_handle_t src_oh; /* The handle for src object group */ + iod_obj_id_t src_id; /* The ID of the src object */ + iod_handle_t dst_oh; /* The handle for the dst object where link is created*/ + iod_obj_id_t dst_id; /* The ID of the dst object where link is created*/ + iod_obj_id_t obj_id; /* The ID of the object to be moved/copied */ + char *last_comp = NULL; + iod_kv_t kv; + iod_size_t kv_size = sizeof(iod_obj_id_t); + herr_t ret_value = SUCCEED; + + FUNC_ENTER_NOAPI_NOINIT + +#if H5VL_IOD_DEBUG + fprintf(stderr, "Start link move\n"); +#endif + + /* the traversal will retrieve the location where the link needs + to be moved/copied from. The traversal will fail if an intermediate group + does not exist. */ + if(H5VL_iod_server_traverse(coh, input->src_loc_id, input->src_loc_oh, input->src_loc_name, + FALSE, &last_comp, &src_id, &src_oh) < 0) + HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't traverse path"); + + /* the traversal will retrieve the location where the link needs + to be moved/copied to. The traversal will fail if an intermediate group + does not exist. */ + if(H5VL_iod_server_traverse(coh, input->dst_loc_id, input->dst_loc_oh, input->dst_loc_name, + FALSE, NULL, &dst_id, &dst_oh) < 0) + HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't traverse path"); + + /* lookup object ID in the current src location */ + if(iod_kv_get_value(src_oh, IOD_TID_UNKNOWN, last_comp, &obj_id, &kv_size, NULL, NULL) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "Object does not exist in source path"); + + /* Insert object in the destination path */ + kv.key = HDstrdup(last_comp); + kv.value = &obj_id; + kv.value_len = kv_size; + if (iod_kv_set(dst_oh, IOD_TID_UNKNOWN, NULL, &kv, NULL, NULL) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't set KV pair in parent"); + + /* if the operation type is a Move, remove the KV pair from the source object */ + if(!copy_flag) { + iod_kv_params_t kvs; + + kvs.kv = &kv; + if(iod_kv_unlink_keys(src_oh,IOD_TID_UNKNOWN, NULL, 1, &kvs, NULL) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTDEC, FAIL, "Unable to unlink KV pair"); + } + + HDfree(kv.key); + + /* close source group if it is not the location we started the + traversal into */ + if(input->src_loc_oh.cookie != src_oh.cookie) { + iod_obj_close(src_oh, NULL, NULL); + } + + /* close parent group if it is not the location we started the + traversal into */ + if(input->dst_loc_oh.cookie != dst_oh.cookie) { + iod_obj_close(dst_oh, NULL, NULL); + } + +#if H5_DO_NATIVE + if(copy_flag) { + if(H5Lcopy(input->src_loc_oh.cookie, input->src_loc_name, + input->dst_loc_oh.cookie, input->dst_loc_name, + H5P_DEFAULT, H5P_DEFAULT) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't create hard link"); + } + else { + if(H5Lmove(input->src_loc_oh.cookie, input->src_loc_name, + input->dst_loc_oh.cookie, input->dst_loc_name, + H5P_DEFAULT, H5P_DEFAULT) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't create hard link"); + } +#endif + +done: +#if H5VL_IOD_DEBUG + fprintf(stderr, "Done with link move, sending response to client\n"); +#endif + + HG_Handler_start_output(op_data->hg_handle, &ret_value); + + last_comp = (char *)H5MM_xfree(last_comp); + input = (link_move_in_t *)H5MM_xfree(input); + op_data = (op_data_t *)H5MM_xfree(op_data); + + FUNC_LEAVE_NOAPI_VOID +} /* end H5VL_iod_server_link_move_cb() */ + + +/*------------------------------------------------------------------------- + * Function: H5VL_iod_server_link_exists_cb + * + * Purpose: Checks if a link exists. + * + * Return: Success: SUCCEED + * Failure: Negative + * + * Programmer: Mohamad Chaarawi + * May, 2013 + * + *------------------------------------------------------------------------- + */ +void +H5VL_iod_server_link_exists_cb(AXE_engine_t UNUSED axe_engine, + size_t UNUSED num_n_parents, AXE_task_t UNUSED n_parents[], + size_t UNUSED num_s_parents, AXE_task_t UNUSED s_parents[], + void *_op_data) +{ + op_data_t *op_data = (op_data_t *)_op_data; + link_op_in_t *input = (link_op_in_t *)op_data->input; + iod_handle_t coh = input->coh; + iod_handle_t loc_oh = input->loc_oh; + iod_obj_id_t loc_id = input->loc_id; + iod_handle_t cur_oh; + iod_obj_id_t cur_id; + const char *loc_name = input->path; + char *last_comp = NULL; + htri_t ret = -1; + iod_size_t kv_size = sizeof(iod_obj_id_t); + herr_t ret_value = SUCCEED; + + FUNC_ENTER_NOAPI_NOINIT + +#if H5VL_IOD_DEBUG + fprintf(stderr, "Start link Exists\n"); +#endif + + /* the traversal will retrieve the location where the link needs + to be checked */ + if(H5VL_iod_server_traverse(coh, loc_id, loc_oh, loc_name, FALSE, + &last_comp, &cur_id, &cur_oh) < 0) { + ret = FALSE; + HGOTO_DONE(SUCCEED); + } + + /* check the last component */ + if(iod_kv_get_value(cur_oh, IOD_TID_UNKNOWN, last_comp, + &cur_id, &kv_size, NULL, NULL) < 0) { + ret = FALSE; + } /* end if */ + else { + ret = TRUE; + } + +#if H5_DO_NATIVE + ret = H5Lexists(loc_oh.cookie, loc_name, H5P_DEFAULT); +#else + ret = FALSE; +#endif + +done: + + /* close parent group if it is not the location we started the + traversal into */ + if(loc_oh.cookie != IOD_OH_UNDEFINED && input->loc_oh.cookie != loc_oh.cookie) { + iod_obj_close(loc_oh, NULL, NULL); + } + +#if H5VL_IOD_DEBUG + fprintf(stderr, "Done with link exists, sending response to client\n"); +#endif + + HG_Handler_start_output(op_data->hg_handle, &ret); + + input = (link_op_in_t *)H5MM_xfree(input); + op_data = (op_data_t *)H5MM_xfree(op_data); + last_comp = (char *)H5MM_xfree(last_comp); + + FUNC_LEAVE_NOAPI_VOID +} /* end H5VL_iod_server_link_exists_cb() */ + + +/*------------------------------------------------------------------------- + * Function: H5VL_iod_server_link_remove_cb + * + * Purpose: Removes a link from a container. + * + * Return: Success: SUCCEED + * Failure: Negative + * + * Programmer: Mohamad Chaarawi + * May, 2013 + * + *------------------------------------------------------------------------- + */ +void +H5VL_iod_server_link_remove_cb(AXE_engine_t UNUSED axe_engine, + size_t UNUSED num_n_parents, AXE_task_t UNUSED n_parents[], + size_t UNUSED num_s_parents, AXE_task_t UNUSED s_parents[], + void *_op_data) +{ + op_data_t *op_data = (op_data_t *)_op_data; + link_op_in_t *input = (link_op_in_t *)op_data->input; + iod_handle_t coh = input->coh; + iod_handle_t loc_oh = input->loc_oh; + iod_obj_id_t loc_id = input->loc_id; + iod_handle_t cur_oh; + iod_obj_id_t cur_id, obj_id; + const char *loc_name = input->path; + char *last_comp = NULL; + iod_kv_params_t kvs; + iod_kv_t kv; + iod_size_t kv_size = sizeof(iod_obj_id_t); + herr_t ret_value = SUCCEED; + + FUNC_ENTER_NOAPI_NOINIT + +#if H5VL_IOD_DEBUG + fprintf(stderr, "Start link Remove\n"); +#endif + + /* the traversal will retrieve the location where the link needs + to be removed. The traversal will fail if an intermediate group + does not exist. */ + if(H5VL_iod_server_traverse(coh, loc_id, loc_oh, loc_name, + FALSE, &last_comp, &cur_id, &cur_oh) < 0) + HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't traverse path"); + + /* lookup object ID in the current location */ + if(iod_kv_get_value(cur_oh, IOD_TID_UNKNOWN, last_comp, &obj_id, &kv_size, NULL, NULL) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "Object does not exist in source path"); + + /* unlink object from conainer */ + kv.key = HDstrdup(last_comp); + kv.value = &obj_id; + kv.value_len = kv_size; + kvs.kv = &kv; + if(iod_kv_unlink_keys(cur_oh, IOD_TID_UNKNOWN, NULL, 1, &kvs, NULL) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTDEC, FAIL, "Unable to unlink KV pair"); + HDfree(kv.key); + + /* MSC - check the metadata information for the object and remove + it from the container if this is the last link to it */ + + /* close location object */ + if(input->loc_oh.cookie != cur_oh.cookie) { + iod_obj_close(cur_oh, NULL, NULL); + } + +#if H5_DO_NATIVE + if(H5Ldelete(loc_oh.cookie, loc_name, H5P_DEFAULT) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTDEC, FAIL, "Unable to unlink KV pair"); +#endif + +done: + +#if H5VL_IOD_DEBUG + fprintf(stderr, "Done with link remove, sending response to client\n"); +#endif + + HG_Handler_start_output(op_data->hg_handle, &ret_value); + + last_comp = (char *)H5MM_xfree(last_comp); + input = (link_op_in_t *)H5MM_xfree(input); + op_data = (op_data_t *)H5MM_xfree(op_data); + + FUNC_LEAVE_NOAPI_VOID +} /* end H5VL_iod_server_link_remove_cb() */ + +#endif /* H5_HAVE_EFF */ diff --git a/src/H5VLiod_obj.c b/src/H5VLiod_obj.c new file mode 100644 index 0000000..be0dfe0 --- /dev/null +++ b/src/H5VLiod_obj.c @@ -0,0 +1,579 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by The HDF Group. * + * Copyright by the Board of Trustees of the University of Illinois. * + * All rights reserved. * + * * + * This file is part of HDF5. The full HDF5 copyright notice, including * + * terms governing use, modification, and redistribution, is contained in * + * the files COPYING and Copyright.html. COPYING can be found at the root * + * of the source code distribution tree; Copyright.html can be found at the * + * root level of an installed copy of the electronic HDF5 document set and * + * is linked from the top-level documents page. It can also be found at * + * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * + * access to either file, you may request a copy from help@hdfgroup.org. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#include "H5VLiod_server.h" + +#ifdef H5_HAVE_EFF + +/* + * Programmer: Mohamad Chaarawi <chaarawi@hdfgroup.gov> + * June, 2013 + * + * Purpose: The IOD plugin server side general object routines. + */ + + +/*------------------------------------------------------------------------- + * Function: H5VL_iod_server_object_open_cb + * + * Purpose: Opens an existing object in the container + * + * Return: Success: SUCCEED + * Failure: Negative + * + * Programmer: Mohamad Chaarawi + * May, 2013 + * + *------------------------------------------------------------------------- + */ +void +H5VL_iod_server_object_open_cb(AXE_engine_t UNUSED axe_engine, + size_t UNUSED num_n_parents, AXE_task_t UNUSED n_parents[], + size_t UNUSED num_s_parents, AXE_task_t UNUSED s_parents[], + void *_op_data) +{ + op_data_t *op_data = (op_data_t *)_op_data; + object_op_in_t *input = (object_op_in_t *)op_data->input; + object_open_out_t output; + iod_handle_t coh = input->coh; /* the container handle */ + iod_handle_t obj_oh; /* The handle for object */ + iod_obj_id_t obj_id; /* The ID of the object */ + iod_handle_t cur_oh, mdkv_oh; + iod_obj_id_t cur_id; + char *last_comp = NULL; + iod_kv_t kv; + scratch_pad_t sp; + iod_size_t kv_size = sizeof(iod_obj_id_t); + herr_t ret_value = SUCCEED; + + FUNC_ENTER_NOAPI_NOINIT + +#if H5VL_IOD_DEBUG + fprintf(stderr, "Start Object Open\n"); +#endif + + /* the traversal will retrieve the location where the object needs + to be opened to be created from. The traversal will fail if an + intermediate group does not exist. */ + if(H5VL_iod_server_traverse(coh, input->loc_id, input->loc_oh, input->loc_name, FALSE, + last_comp, &cur_id, &cur_oh) < 0) + HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't traverse path"); + + /* lookup object in the current location */ + if(iod_kv_get_value(cur_oh, IOD_TID_UNKNOWN, last_comp, &obj_id, &kv_size, NULL, NULL) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "Intermdiate group does not exist"); + + /* close parent group if it is not the location we started the + traversal into */ + if(input->loc_oh.cookie != cur_oh.cookie) { + iod_obj_close(cur_oh, NULL, NULL); + } + + /* open the object */ + if (iod_obj_open_write(coh, obj_id, NULL, &obj_oh, NULL) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't open current group"); + + /* get scratch pad of the dataset */ + if(iod_obj_get_scratch(cur_oh, IOD_TID_UNKNOWN, &sp, NULL, NULL) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "can't get scratch pad for object"); + + /* open the metadata scratch pad */ + if (iod_obj_open_write(coh, sp.mdkv_id, NULL /*hints*/, &mdkv_oh, NULL) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "can't open scratch pad"); + + /* MSC - Read object's metadata */ + + /* close the metadata scratch pad */ + if(iod_obj_close(mdkv_oh, NULL, NULL)) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't close object"); + + +#if H5_DO_NATIVE + obj_oh.cookie = H5Oopen(input->loc_oh.cookie, input->loc_name, H5P_DEFAULT); + output.obj_type = H5Iget_type(obj_oh.cookie); + switch(output.obj_type){ + case H5I_GROUP: + output.cpl_id = H5P_GROUP_CREATE_DEFAULT; + output.type_id = 0; + output.space_id = 0; + break; + case H5I_DATASET: + output.cpl_id = H5P_DATASET_CREATE_DEFAULT; + output.type_id = H5Dget_type(obj_oh.cookie); + output.space_id = H5Dget_space(obj_oh.cookie); + break; + case H5I_DATATYPE: + output.cpl_id = H5P_DATATYPE_CREATE_DEFAULT; + output.type_id = obj_oh.cookie; + output.space_id = 0; + break; + default: + HGOTO_ERROR(H5E_ARGS, H5E_CANTINIT, FAIL, "not a valid object (dataset, group, or datatype)") + } +#else + /* Fake something */ + output.obj_type = H5I_GROUP; + output.cpl_id = H5P_GROUP_CREATE_DEFAULT; + output.type_id = 0; + output.space_id = 0; +#endif + + output.iod_id = obj_id; + output.iod_oh = obj_oh; + +#if H5VL_IOD_DEBUG + fprintf(stderr, "Done with object open, sending response to client\n"); +#endif + + HG_Handler_start_output(op_data->hg_handle, &output); + +done: + if(ret_value < 0) { + output.iod_oh.cookie = IOD_OH_UNDEFINED; + output.iod_id = IOD_ID_UNDEFINED; + output.cpl_id = H5P_GROUP_CREATE_DEFAULT; + HG_Handler_start_output(op_data->hg_handle, &output); + } + + switch(output.obj_type){ + case H5I_GROUP: + break; + case H5I_DATASET: +#if H5_DO_NATIVE + H5Tclose(output.type_id); + H5Sclose(output.space_id); +#endif + break; + case H5I_DATATYPE: + break; + default: + HGOTO_ERROR(H5E_ARGS, H5E_CANTINIT, FAIL, "not a valid object (dataset, group, or datatype)") + } + + last_comp = (char *)H5MM_xfree(last_comp); + input = (object_op_in_t *)H5MM_xfree(input); + op_data = (op_data_t *)H5MM_xfree(op_data); + + FUNC_LEAVE_NOAPI_VOID +} /* end H5VL_iod_server_object_open_cb() */ + + +/*------------------------------------------------------------------------- + * Function: H5VL_iod_server_object_copy_cb + * + * Purpose: Moves/Copies a link in the container. + * + * Return: Success: SUCCEED + * Failure: Negative + * + * Programmer: Mohamad Chaarawi + * May, 2013 + * + *------------------------------------------------------------------------- + */ +void +H5VL_iod_server_object_copy_cb(AXE_engine_t UNUSED axe_engine, + size_t UNUSED num_n_parents, AXE_task_t UNUSED n_parents[], + size_t UNUSED num_s_parents, AXE_task_t UNUSED s_parents[], + void *_op_data) +{ + op_data_t *op_data = (op_data_t *)_op_data; + object_copy_in_t *input = (object_copy_in_t *)op_data->input; + iod_handle_t coh = input->coh; /* the container handle */ + iod_handle_t src_oh; /* The handle for src object group */ + iod_obj_id_t src_id; /* The ID of the src object */ + iod_handle_t dst_oh; /* The handle for the dst object where link is created*/ + iod_obj_id_t dst_id; /* The ID of the dst object where link is created*/ + iod_obj_id_t obj_id; /* The ID of the object to be moved/copied */ + char *last_comp = NULL, *new_name; + iod_kv_t kv; + iod_size_t kv_size = sizeof(iod_obj_id_t); + herr_t ret_value = SUCCEED; + + FUNC_ENTER_NOAPI_NOINIT + +#if H5VL_IOD_DEBUG + fprintf(stderr, "Start object copy\n"); +#endif + + /* the traversal will retrieve the location where the object + exists. The traversal will fail if an intermediate group does + not exist. */ + if(H5VL_iod_server_traverse(coh, input->src_loc_id, input->src_loc_oh, input->src_loc_name, + FALSE, &last_comp, &src_id, &src_oh) < 0) + HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't traverse path"); + + /* the traversal will retrieve the location where the objects + needs to be copied to. The traversal will fail if an + intermediate group does not exist. */ + if(H5VL_iod_server_traverse(coh, input->dst_loc_id, input->dst_loc_oh, input->dst_loc_name, + FALSE, &new_name, &dst_id, &dst_oh) < 0) + HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't traverse path"); + + /* lookup object ID in the current src location */ + if(iod_kv_get_value(src_oh, IOD_TID_UNKNOWN, last_comp, &obj_id, &kv_size, NULL, NULL) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "Object does not exist in source path"); + + /* create new object as a copy of the source object */ + /* MSC - wait to see if IOD will have an object copy */ + + /* Insert object in the destination path */ + kv.key = HDstrdup(new_name); + kv.value = &obj_id; + kv.value_len = kv_size; + if (iod_kv_set(dst_oh, IOD_TID_UNKNOWN, NULL, &kv, NULL, NULL) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't set KV pair in parent"); + HDfree(kv.key); + + /* close source group if it is not the location we started the + traversal into */ + if(input->src_loc_oh.cookie != src_oh.cookie) { + iod_obj_close(src_oh, NULL, NULL); + } + + /* close dst group if it is not the location we started the + traversal into */ + if(input->dst_loc_oh.cookie != dst_oh.cookie) { + iod_obj_close(dst_oh, NULL, NULL); + } + +#if H5_DO_NATIVE + if(H5Ocopy(input->src_loc_oh.cookie, input->src_loc_name, + input->dst_loc_oh.cookie, input->dst_loc_name, + H5P_DEFAULT, H5P_DEFAULT) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't copy object"); +#endif + +done: +#if H5VL_IOD_DEBUG + fprintf(stderr, "Done with object Copy, sending response to client\n"); +#endif + + HG_Handler_start_output(op_data->hg_handle, &ret_value); + + last_comp = (char *)H5MM_xfree(last_comp); + if(new_name) + free(new_name); + input = (object_copy_in_t *)H5MM_xfree(input); + op_data = (op_data_t *)H5MM_xfree(op_data); + + FUNC_LEAVE_NOAPI_VOID +} /* end H5VL_iod_server_object_copy_cb() */ + + +/*------------------------------------------------------------------------- + * Function: H5VL_iod_server_object_exists_cb + * + * Purpose: Checks if an object exists. + * + * Return: Success: SUCCEED + * Failure: Negative + * + * Programmer: Mohamad Chaarawi + * May, 2013 + * + *------------------------------------------------------------------------- + */ +void +H5VL_iod_server_object_exists_cb(AXE_engine_t UNUSED axe_engine, + size_t UNUSED num_n_parents, AXE_task_t UNUSED n_parents[], + size_t UNUSED num_s_parents, AXE_task_t UNUSED s_parents[], + void *_op_data) +{ + op_data_t *op_data = (op_data_t *)_op_data; + object_op_in_t *input = (object_op_in_t *)op_data->input; + iod_handle_t coh = input->coh; + iod_handle_t loc_oh = input->loc_oh; + iod_obj_id_t loc_id = input->loc_id; + iod_handle_t cur_oh; + iod_obj_id_t cur_id; + const char *loc_name = input->loc_name; + char *last_comp = NULL; + htri_t ret = -1; + iod_size_t kv_size = sizeof(iod_obj_id_t); + herr_t ret_value = SUCCEED; + + FUNC_ENTER_NOAPI_NOINIT + + /* the traversal will retrieve the location where the object needs + to be checked */ + if(H5VL_iod_server_traverse(coh, loc_id, loc_oh, loc_name, FALSE, + &last_comp, &cur_id, &cur_oh) < 0) { + ret = FALSE; + HGOTO_DONE(SUCCEED); + } + + /* check the last component */ + if(iod_kv_get_value(cur_oh, IOD_TID_UNKNOWN, last_comp, + &cur_id, &kv_size, NULL, NULL) < 0) { + ret = FALSE; + } /* end if */ + else { + iod_handle_t obj_oh; + /* try to open the object */ + if (iod_obj_open_write(coh, cur_id, NULL, &obj_oh, NULL) < 0) { + ret = FALSE; + HGOTO_DONE(SUCCEED); + } + else { + /* close the object */ + iod_obj_close(obj_oh, NULL, NULL); + ret = TRUE; + } + } + +#if H5_DO_NATIVE + ret = H5Oexists_by_name(loc_oh.cookie, loc_name, H5P_DEFAULT); +#else + ret = FALSE; +#endif + +done: + + /* close parent group if it is not the location we started the + traversal into */ + if(loc_oh.cookie != IOD_OH_UNDEFINED && input->loc_oh.cookie != loc_oh.cookie) { + iod_obj_close(loc_oh, NULL, NULL); + } + +#if H5VL_IOD_DEBUG + fprintf(stderr, "Done with Object exists, sending response to client\n"); +#endif + + HG_Handler_start_output(op_data->hg_handle, &ret); + + input = (object_op_in_t *)H5MM_xfree(input); + op_data = (op_data_t *)H5MM_xfree(op_data); + last_comp = (char *)H5MM_xfree(last_comp); + + FUNC_LEAVE_NOAPI_VOID +} /* end H5VL_iod_server_object_exists_cb() */ + + +/*------------------------------------------------------------------------- + * Function: H5VL_iod_server_object_set_comment_cb + * + * Purpose: Set comment for an object. + * + * Return: Success: SUCCEED + * Failure: Negative + * + * Programmer: Mohamad Chaarawi + * May, 2013 + * + *------------------------------------------------------------------------- + */ +void +H5VL_iod_server_object_set_comment_cb(AXE_engine_t UNUSED axe_engine, + size_t UNUSED num_n_parents, AXE_task_t UNUSED n_parents[], + size_t UNUSED num_s_parents, AXE_task_t UNUSED s_parents[], + void *_op_data) +{ + op_data_t *op_data = (op_data_t *)_op_data; + object_set_comment_in_t *input = (object_set_comment_in_t *)op_data->input; + iod_handle_t coh = input->coh; + iod_handle_t loc_oh = input->loc_oh; + iod_obj_id_t loc_id = input->loc_id; + iod_handle_t cur_oh, mdkv_oh; + iod_obj_id_t cur_id, obj_id; + const char *loc_name = input->path; + const char *comment = input->comment; + char *last_comp = NULL; + iod_kv_params_t kvs; + iod_kv_t kv; + scratch_pad_t sp; + iod_size_t kv_size = sizeof(iod_obj_id_t); + herr_t ret_value = SUCCEED; + + FUNC_ENTER_NOAPI_NOINIT + + /* the traversal will retrieve the location where the link needs + to be removed. The traversal will fail if an intermediate group + does not exist. */ + if(H5VL_iod_server_traverse(coh, loc_id, loc_oh, loc_name, + FALSE, &last_comp, &cur_id, &cur_oh) < 0) + HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't traverse path"); + + /* lookup object ID in the current location */ + if(iod_kv_get_value(cur_oh, IOD_TID_UNKNOWN, last_comp, &obj_id, &kv_size, NULL, NULL) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "Object does not exist in source path"); + + /* close parent group and its scratch pad if it is not the + location we started the traversal into */ + if(loc_oh.cookie != cur_oh.cookie) { + iod_obj_close(cur_oh, NULL, NULL); + } + + /* open the object */ + if (iod_obj_open_write(coh, obj_id, NULL /*hints*/, &cur_oh, NULL) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't open object"); + + /* get scratch pad of the object */ + if(iod_obj_get_scratch(cur_oh, IOD_TID_UNKNOWN, &sp, NULL, NULL) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "can't get scratch pad for object"); + + /* open the metadata scratch pad */ + if (iod_obj_open_write(coh, sp.mdkv_id, NULL /*hints*/, &mdkv_oh, NULL) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "can't open scratch pad"); + + /* MSC - update scratch pad with comment */ + + /* close metadata KV and object */ + if(iod_obj_close(mdkv_oh, NULL, NULL)) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't close object"); + if(iod_obj_close(cur_oh, NULL, NULL)) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't close object"); + +#if H5_DO_NATIVE + if(H5Oset_comment(loc_oh.cookie, comment) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "Unable to set object comment"); +#endif + +done: +#if H5VL_IOD_DEBUG + fprintf(stderr, "Done with set comment, sending response to client\n"); +#endif + + HG_Handler_start_output(op_data->hg_handle, &ret_value); + + last_comp = (char *)H5MM_xfree(last_comp); + input = (object_set_comment_in_t *)H5MM_xfree(input); + op_data = (op_data_t *)H5MM_xfree(op_data); + + FUNC_LEAVE_NOAPI_VOID +} /* end H5VL_iod_server_object_set_comment_cb() */ + + +/*------------------------------------------------------------------------- + * Function: H5VL_iod_server_object_get_comment_cb + * + * Purpose: Get comment for an object. + * + * Return: Success: SUCCEED + * Failure: Negative + * + * Programmer: Mohamad Chaarawi + * May, 2013 + * + *------------------------------------------------------------------------- + */ +void +H5VL_iod_server_object_get_comment_cb(AXE_engine_t UNUSED axe_engine, + size_t UNUSED num_n_parents, AXE_task_t UNUSED n_parents[], + size_t UNUSED num_s_parents, AXE_task_t UNUSED s_parents[], + void *_op_data) +{ + op_data_t *op_data = (op_data_t *)_op_data; + object_get_comment_in_t *input = (object_get_comment_in_t *)op_data->input; + object_get_comment_out_t output; + name_t comment; + iod_handle_t coh = input->coh; + iod_handle_t loc_oh = input->loc_oh; + iod_obj_id_t loc_id = input->loc_id; + size_t length = input->length; + iod_handle_t cur_oh, mdkv_oh; + iod_obj_id_t cur_id, obj_id; + const char *loc_name = input->path; + char *last_comp = NULL; + iod_kv_params_t kvs; + iod_kv_t kv; + iod_size_t kv_size = sizeof(iod_obj_id_t); + scratch_pad_t sp; + ssize_t size = 0; + herr_t ret_value = SUCCEED; + + FUNC_ENTER_NOAPI_NOINIT + + /* the traversal will retrieve the location where the link needs + to be removed. The traversal will fail if an intermediate group + does not exist. */ + if(H5VL_iod_server_traverse(coh, loc_id, loc_oh, loc_name, + FALSE, &last_comp, &cur_id, &cur_oh) < 0) + HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't traverse path"); + + /* lookup object ID in the current location */ + if(iod_kv_get_value(cur_oh, IOD_TID_UNKNOWN, last_comp, &obj_id, &kv_size, NULL, NULL) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "Object does not exist in source path"); + + /* close parent group and its scratch pad if it is not the + location we started the traversal into */ + if(loc_oh.cookie != cur_oh.cookie) { + iod_obj_close(cur_oh, NULL, NULL); + } + + /* open the object */ + if (iod_obj_open_write(coh, obj_id, NULL /*hints*/, &cur_oh, NULL) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't open object"); + + /* get scratch pad of the object */ + if(iod_obj_get_scratch(cur_oh, IOD_TID_UNKNOWN, &sp, NULL, NULL) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "can't get scratch pad for object"); + + /* open the metadata scratch pad */ + if (iod_obj_open_write(coh, sp.mdkv_id, NULL /*hints*/, &mdkv_oh, NULL) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "can't open scratch pad"); + + /* MSC - Get comment from MD KV store*/ + + /* close metadata KV and object */ + if(iod_obj_close(mdkv_oh, NULL, NULL)) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't close object"); + if(iod_obj_close(cur_oh, NULL, NULL)) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't close object"); + + comment.value_size = (ssize_t *)malloc(sizeof(ssize_t)); + comment.value = NULL; + comment.size = length; + +#if H5_DO_NATIVE + if(0 != length) { + size = H5Oget_comment(loc_oh.cookie, NULL, length); + comment.value = malloc(size); + } + if((size = H5Oget_comment(loc_oh.cookie, comment.value, length)) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "Unable to get object comment"); +#else + if(length) { + comment.value = strdup("fake comment"); + size = strlen(comment.value) + 1; + } + else + size = 22; +#endif + + *comment.value_size = size; + +done: + output.ret = ret_value; + output.name = comment; + +#if H5VL_IOD_DEBUG + fprintf(stderr, "Done with get comment, sending response to client\n"); +#endif + + HG_Handler_start_output(op_data->hg_handle, &output); + + if(comment.value) + free(comment.value); + free(comment.value_size); + + last_comp = (char *)H5MM_xfree(last_comp); + input = (object_get_comment_in_t *)H5MM_xfree(input); + op_data = (op_data_t *)H5MM_xfree(op_data); + + FUNC_LEAVE_NOAPI_VOID +} /* end H5VL_iod_server_object_get_comment_cb() */ + +#endif /* H5_HAVE_EFF */ diff --git a/src/H5VLiod_server.c b/src/H5VLiod_server.c index 6d0d4f7..18af504 100644 --- a/src/H5VLiod_server.c +++ b/src/H5VLiod_server.c @@ -16,26 +16,25 @@ #define H5G_PACKAGE /*suppress error about including H5Gpkg */ #define H5D_PACKAGE /*suppress error about including H5Dpkg */ -#include "H5private.h" /* Generic Functions */ -#include "H5Apublic.h" /* Attributes */ -#include "H5Dpkg.h" /* Dataset functions */ -#include "H5Eprivate.h" /* Error handling */ -#include "H5Gpkg.h" /* Groups */ -#include "H5Iprivate.h" /* IDs */ -#include "H5MMprivate.h" /* Memory management */ -#include "H5Oprivate.h" /* Object headers */ -#include "H5Pprivate.h" /* Property lists */ -#include "H5Sprivate.h" /* Dataspaces */ -#include "H5Tprivate.h" /* Datatypes */ -#include "H5VLprivate.h" /* VOL plugins */ +#include "H5private.h" /* Generic Functions */ +#include "H5Apublic.h" /* Attributes */ +#include "H5Dpkg.h" /* Dataset functions */ +#include "H5Eprivate.h" /* Error handling */ +#include "H5Gpkg.h" /* Groups */ +#include "H5Iprivate.h" /* IDs */ +#include "H5MMprivate.h" /* Memory management */ +#include "H5Oprivate.h" /* Object headers */ +#include "H5Pprivate.h" /* Property lists */ +#include "H5Sprivate.h" /* Dataspaces */ +#include "H5Tprivate.h" /* Datatypes */ +#include "H5VLprivate.h" /* VOL plugins */ #include "H5VLiod_server.h" -#include "H5WBprivate.h" /* Wrapped Buffers */ +#include "H5WBprivate.h" /* Wrapped Buffers */ #include "H5VLiod_compactor_queue.h" -#include "H5VLiod_compactor.h" +#include "H5VLiod_compactor.h" /* Compactor Routine */ -#ifdef H5_HAVE_EFF -#define H5_DO_NATIVE 0 +#ifdef H5_HAVE_EFF /* * Programmer: Mohamad Chaarawi <chaarawi@hdfgroup.gov> @@ -50,22 +49,8 @@ static iod_obj_id_t ROOT_ID; static int num_peers = 0; static int terminate_requests = 0; static hbool_t shutdown = FALSE; -static int compactor_queue_flag = 0, request_id = 0; -static compactor *curr_queue = NULL; -pthread_mutex_t lock = PTHREAD_MUTEX_INITIALIZER; - -#if DEBUG_COMPACTOR -FILE *fp; -#endif - -#define EEXISTS 1 +static int request_id = 0; -H5FL_BLK_EXTERN(type_conv); - -static herr_t H5VL_iod_server_traverse(iod_handle_t coh, iod_obj_id_t loc_id, - iod_handle_t loc_handle, const char *path, - hbool_t create_interm_grps, char **last_comp, - iod_obj_id_t *iod_id, iod_handle_t *iod_oh); #if 0 static herr_t H5VL_iod_typeinfo_init(hid_t dset_type_id, const H5D_dxpl_cache_t *dxpl_cache, @@ -74,144 +59,6 @@ static herr_t H5VL_iod_typeinfo_init(hid_t dset_type_id, const H5D_dxpl_cache_t static herr_t H5VL_iod_typeinfo_term(const H5D_type_info_t *type_info); #endif -static void H5VL_iod_server_file_create_cb(AXE_engine_t axe_engine, - size_t num_n_parents, AXE_task_t n_parents[], - size_t num_s_parents, AXE_task_t s_parents[], - void *op_data); -static void H5VL_iod_server_file_open_cb(AXE_engine_t axe_engine, - size_t num_n_parents, AXE_task_t n_parents[], - size_t num_s_parents, AXE_task_t s_parents[], - void *op_data); -static void H5VL_iod_server_file_close_cb(AXE_engine_t axe_engine, - size_t num_n_parents, AXE_task_t n_parents[], - size_t num_s_parents, AXE_task_t s_parents[], - void *op_data); -static void H5VL_iod_server_file_flush_cb(AXE_engine_t axe_engine, - size_t num_n_parents, AXE_task_t n_parents[], - size_t num_s_parents, AXE_task_t s_parents[], - void *op_data); -static void H5VL_iod_server_attr_create_cb(AXE_engine_t axe_engine, - size_t num_n_parents, AXE_task_t n_parents[], - size_t num_s_parents, AXE_task_t s_parents[], - void *op_data); -static void H5VL_iod_server_attr_open_cb(AXE_engine_t axe_engine, - size_t num_n_parents, AXE_task_t n_parents[], - size_t num_s_parents, AXE_task_t s_parents[], - void *op_data); -static void H5VL_iod_server_attr_read_cb(AXE_engine_t axe_engine, - size_t num_n_parents, AXE_task_t n_parents[], - size_t num_s_parents, AXE_task_t s_parents[], - void *op_data); -static void H5VL_iod_server_attr_write_cb(AXE_engine_t axe_engine, - size_t num_n_parents, AXE_task_t n_parents[], - size_t num_s_parents, AXE_task_t s_parents[], - void *op_data); -static void H5VL_iod_server_attr_exists_cb(AXE_engine_t axe_engine, - size_t num_n_parents, AXE_task_t n_parents[], - size_t num_s_parents, AXE_task_t s_parents[], - void *op_data); -static void H5VL_iod_server_attr_rename_cb(AXE_engine_t axe_engine, - size_t num_n_parents, AXE_task_t n_parents[], - size_t num_s_parents, AXE_task_t s_parents[], - void *op_data); -static void H5VL_iod_server_attr_remove_cb(AXE_engine_t axe_engine, - size_t num_n_parents, AXE_task_t n_parents[], - size_t num_s_parents, AXE_task_t s_parents[], - void *op_data); -static void H5VL_iod_server_attr_close_cb(AXE_engine_t axe_engine, - size_t num_n_parents, AXE_task_t n_parents[], - size_t num_s_parents, AXE_task_t s_parents[], - void *op_data); -static void H5VL_iod_server_group_create_cb(AXE_engine_t axe_engine, - size_t num_n_parents, AXE_task_t n_parents[], - size_t num_s_parents, AXE_task_t s_parents[], - void *op_data); -static void H5VL_iod_server_group_open_cb(AXE_engine_t axe_engine, - size_t num_n_parents, AXE_task_t n_parents[], - size_t num_s_parents, AXE_task_t s_parents[], - void *op_data); -static void H5VL_iod_server_group_close_cb(AXE_engine_t axe_engine, - size_t num_n_parents, AXE_task_t n_parents[], - size_t num_s_parents, AXE_task_t s_parents[], - void *op_data); -static void H5VL_iod_server_dset_create_cb(AXE_engine_t axe_engine, - size_t num_n_parents, AXE_task_t n_parents[], - size_t num_s_parents, AXE_task_t s_parents[], - void *op_data); -static void H5VL_iod_server_dset_open_cb(AXE_engine_t axe_engine, - size_t num_n_parents, AXE_task_t n_parents[], - size_t num_s_parents, AXE_task_t s_parents[], - void *op_data); -static void H5VL_iod_server_dset_read_cb(AXE_engine_t axe_engine, - size_t num_n_parents, AXE_task_t n_parents[], - size_t num_s_parents, AXE_task_t s_parents[], - void *op_data); -static void H5VL_iod_server_dset_write_cb(AXE_engine_t axe_engine, - size_t num_n_parents, AXE_task_t n_parents[], - size_t num_s_parents, AXE_task_t s_parents[], - void *op_data); -static void H5VL_iod_server_dset_compactor_cb(AXE_engine_t axe_engine, - size_t num_n_parents, AXE_task_t n_parents[], - size_t num_s_parents, AXE_task_t s_parents[], - void *queue); -static void H5VL_iod_server_dset_set_extent_cb(AXE_engine_t axe_engine, - size_t num_n_parents, AXE_task_t n_parents[], - size_t num_s_parents, AXE_task_t s_parents[], - void *op_data); -static void H5VL_iod_server_dset_close_cb(AXE_engine_t axe_engine, - size_t num_n_parents, AXE_task_t n_parents[], - size_t num_s_parents, AXE_task_t s_parents[], - void *op_data); -static void H5VL_iod_server_dtype_commit_cb(AXE_engine_t axe_engine, - size_t num_n_parents, AXE_task_t n_parents[], - size_t num_s_parents, AXE_task_t s_parents[], - void *op_data); -static void H5VL_iod_server_dtype_open_cb(AXE_engine_t axe_engine, - size_t num_n_parents, AXE_task_t n_parents[], - size_t num_s_parents, AXE_task_t s_parents[], - void *op_data); -static void H5VL_iod_server_dtype_close_cb(AXE_engine_t axe_engine, - size_t num_n_parents, AXE_task_t n_parents[], - size_t num_s_parents, AXE_task_t s_parents[], - void *op_data); -static void H5VL_iod_server_link_create_cb(AXE_engine_t axe_engine, - size_t num_n_parents, AXE_task_t n_parents[], - size_t num_s_parents, AXE_task_t s_parents[], - void *op_data); -static void H5VL_iod_server_link_move_cb(AXE_engine_t axe_engine, - size_t num_n_parents, AXE_task_t n_parents[], - size_t num_s_parents, AXE_task_t s_parents[], - void *op_data); -static void H5VL_iod_server_link_exists_cb(AXE_engine_t axe_engine, - size_t num_n_parents, AXE_task_t n_parents[], - size_t num_s_parents, AXE_task_t s_parents[], - void *op_data); -static void H5VL_iod_server_link_remove_cb(AXE_engine_t axe_engine, - size_t num_n_parents, AXE_task_t n_parents[], - size_t num_s_parents, AXE_task_t s_parents[], - void *op_data); - -static void H5VL_iod_server_object_open_cb(AXE_engine_t axe_engine, - size_t num_n_parents, AXE_task_t n_parents[], - size_t num_s_parents, AXE_task_t s_parents[], - void *op_data); -static void H5VL_iod_server_object_copy_cb(AXE_engine_t axe_engine, - size_t num_n_parents, AXE_task_t n_parents[], - size_t num_s_parents, AXE_task_t s_parents[], - void *op_data); -static void H5VL_iod_server_object_exists_cb(AXE_engine_t axe_engine, - size_t num_n_parents, AXE_task_t n_parents[], - size_t num_s_parents, AXE_task_t s_parents[], - void *op_data); -static void H5VL_iod_server_object_set_comment_cb(AXE_engine_t axe_engine, - size_t num_n_parents, AXE_task_t n_parents[], - size_t num_s_parents, AXE_task_t s_parents[], - void *op_data); -static void H5VL_iod_server_object_get_comment_cb(AXE_engine_t UNUSED axe_engine, - size_t num_n_parents, AXE_task_t n_parents[], - size_t num_s_parents, AXE_task_t s_parents[], - void *_op_data); - herr_t H5VLiod_start_handler(MPI_Comm comm, MPI_Info UNUSED info) { @@ -221,11 +68,10 @@ H5VLiod_start_handler(MPI_Comm comm, MPI_Info UNUSED info) herr_t ret_value = SUCCEED; MPI_Comm_size(comm, &num_procs); - -#if DEBUG_COMPACTOR + + #if DEBUG_COMPACTOR fp = fopen("compactor.out", "w+"); -#endif - + #endif iod_comm = comm; /* initialize the netwrok class */ @@ -235,6 +81,10 @@ H5VLiod_start_handler(MPI_Comm comm, MPI_Info UNUSED info) if(HG_SUCCESS != HG_Bulk_init(network_class)) return FAIL; + compactor_queue_flag = 0; + pthread_mutex_init(&lock, NULL); + curr_queue = NULL; + /* Register function and encoding/decoding functions */ MERCURY_HANDLER_REGISTER("eff_init", H5VL_iod_server_eff_init, eff_init_in_t, ret_t); @@ -325,7 +175,7 @@ H5VLiod_start_handler(MPI_Comm comm, MPI_Info UNUSED info) return FAIL; /* Set number of threads in AXE engine */ - if(AXEset_num_threads(&engine_attr, 1) != AXE_SUCCEED) + if(AXEset_num_threads(&engine_attr, 4) != AXE_SUCCEED) return FAIL; /* Create AXE engine */ @@ -334,7 +184,6 @@ H5VLiod_start_handler(MPI_Comm comm, MPI_Info UNUSED info) /* Loop tp receive requests from clients */ while(1) { - /*fprintf(stderr, "Server In Loop\n");*/ /* Receive new function calls */ if(HG_SUCCESS != HG_Handler_process(HG_HANDLER_MAX_IDLE_TIME, HG_STATUS_IGNORE)) return FAIL; @@ -379,9 +228,11 @@ H5VL_iod_server_eff_init(hg_handle_t handle) FUNC_ENTER_NOAPI_NOINIT + /* get the input from the client connecting */ if(HG_FAIL == HG_Handler_get_input(handle, &num_procs)) HGOTO_ERROR(H5E_FILE, H5E_CANTGET, HG_FAIL, "can't get input parameters"); + /* initialize the IOD library */ if(iod_initialize(iod_comm, NULL, num_procs, num_procs, NULL) < 0 ) HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, HG_FAIL, "can't initialize"); @@ -414,8 +265,12 @@ H5VL_iod_server_eff_finalize(hg_handle_t handle) FUNC_ENTER_NOAPI_NOINIT + /* increment the number of terminate requests received so far */ terminate_requests ++; + /* if all the peers that connected at the beginning have sent the + terminate request, then finalize IOD and indicate that it is + time to shutdown the server */ if(terminate_requests == num_peers) { if(iod_finalize(NULL, NULL) < 0 ) HGOTO_ERROR(H5E_FILE, H5E_CANTDEC, HG_FAIL, "can't finalize IOD"); @@ -1444,6 +1299,70 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5VL_iod_server_dset_read() */ + +/*------------------------------------------------------------------------- + * Function: H5VL_iod_server_dset_write + * + * Purpose: Function shipper registered call for Dset Write. + * Inserts the real worker routine into the Async Engine. + * + * Return: Success: HG_SUCCESS + * Failure: Negative + * + * Programmer: Mohamad Chaarawi + * January, 2013 + * + *------------------------------------------------------------------------- + */ +int +H5VL_iod_server_dset_write(hg_handle_t handle) +{ + op_data_t *op_data = NULL; + dset_io_in_t *input = NULL; + int ret_value = HG_SUCCESS; + + FUNC_ENTER_NOAPI_NOINIT + + if(NULL == (op_data = (op_data_t *)H5MM_malloc(sizeof(op_data_t)))) + HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, HG_FAIL, "can't allocate axe op_data struct"); + + if(NULL == (input = (dset_io_in_t *) + H5MM_malloc(sizeof(dset_io_in_t)))) + HGOTO_ERROR(H5E_DATASET, H5E_NOSPACE, HG_FAIL, "can't allocate input struct for decoding"); + + if(HG_FAIL == HG_Handler_get_input(handle, input)) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, HG_FAIL, "can't get input parameters"); + + if(NULL == engine) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, HG_FAIL, "AXE engine not started"); + + op_data->hg_handle = handle; + op_data->input = (void *)input; + +#if 0 + if(input->parent_axe_id) { + if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_id, + 1, &input->parent_axe_id, 0, NULL, + H5VL_iod_server_dset_write_cb, op_data, NULL)) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, HG_FAIL, "can't insert task into async engine"); + } + else { + if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_id, 0, NULL, 0, NULL, + H5VL_iod_server_dset_write_cb, op_data, NULL)) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, HG_FAIL, "can't insert task into async engine"); + } +#endif + +#if 1 + if(CP_SUCCESS != H5VL_iod_server_dset_compactor(op_data, WRITE)){ + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, HG_FAIL, "compactor task failed for WRITE\n"); + } +#endif + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5VL_iod_server_dset_write() */ + /*--------------------------------------------------------------------- * Function: H5VL_iod_server_dset_compactor @@ -1466,6 +1385,7 @@ int H5VL_iod_server_dset_compactor(op_data_t *op_data, int request_type) int ret_value = CP_SUCCESS; dset_io_in_t *input = NULL; + compactor_entry entry; FUNC_ENTER_NOAPI_NOINIT @@ -1493,12 +1413,12 @@ int H5VL_iod_server_dset_compactor(op_data_t *op_data, int request_type) HGOTO_ERROR(H5E_HEAP, H5E_NOSPACE, CP_FAIL, "Queue initialization error"); } - fprintf (fp, "Completed creating a queue : %p\n", curr_queue); + fprintf (fp, "Completed creating a queue : %p\n", (void *)curr_queue); fflush(fp); } - compactor_entry entry; + entry.input_structure = op_data; entry.type_request = request_type; entry.request_id = request_id; @@ -1540,72 +1460,11 @@ int H5VL_iod_server_dset_compactor(op_data_t *op_data, int request_type) fflush(fp); #endif request_id++; - done: - FUNC_LEAVE_NOAPI(ret_value); -} - + done: + FUNC_LEAVE_NOAPI(ret_value); +} /*end H5VL_iod_server_dset_compactor */ -/*------------------------------------------------------------------------- - * Function: H5VL_iod_server_dset_write - * - * Purpose: Function shipper registered call for Dset Write. - * Inserts the real worker routine into the Async Engine. - * - * Return: Success: HG_SUCCESS - * Failure: Negative - * - * Programmer: Mohamad Chaarawi - * January, 2013 - * - *------------------------------------------------------------------------- - */ -int -H5VL_iod_server_dset_write(hg_handle_t handle) -{ - op_data_t *op_data = NULL; - dset_io_in_t *input = NULL; - int ret_value = HG_SUCCESS; - - FUNC_ENTER_NOAPI_NOINIT - - if(NULL == (op_data = (op_data_t *)H5MM_malloc(sizeof(op_data_t)))) - HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, HG_FAIL, "can't allocate axe op_data struct"); - - if(NULL == (input = (dset_io_in_t *) - H5MM_malloc(sizeof(dset_io_in_t)))) - HGOTO_ERROR(H5E_DATASET, H5E_NOSPACE, HG_FAIL, "can't allocate input struct for decoding"); - - if(HG_FAIL == HG_Handler_get_input(handle, input)) - HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, HG_FAIL, "can't get input parameters"); - - if(NULL == engine) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, HG_FAIL, "AXE engine not started"); - - op_data->hg_handle = handle; - op_data->input = (void *)input; - -#if 0 - if(input->parent_axe_id) { - if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_id, - 1, &input->parent_axe_id, 0, NULL, - H5VL_iod_server_dset_write_cb, op_data, NULL)) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, HG_FAIL, "can't insert task into async engine"); - } - else { - if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_id, 0, NULL, 0, NULL, - H5VL_iod_server_dset_write_cb, op_data, NULL)) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, HG_FAIL, "can't insert task into async engine"); - } -#endif -#if 1 - if(CP_SUCCESS != H5VL_iod_server_dset_compactor(op_data, WRITE)){ - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, HG_FAIL, "compactor task failed for WRITE\n"); - } -#endif -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5VL_iod_server_dset_write() */ /*------------------------------------------------------------------------- @@ -1684,7 +1543,7 @@ H5VL_iod_server_dset_close(hg_handle_t handle) { op_data_t *op_data = NULL; dset_close_in_t *input = NULL; - int ret_value = HG_SUCCESS; + int ret_value = HG_SUCCESS, i = 0; FUNC_ENTER_NOAPI_NOINIT @@ -1704,6 +1563,26 @@ H5VL_iod_server_dset_close(hg_handle_t handle) op_data->hg_handle = handle; op_data->input = (void *)input; + for (i = 0; i < input->parent_axe_ids.count; i++){ + switch (input->parent_axe_ids.ids[i]){ + case AXE_TASK_SCHEDULED: + fprintf(fp, "Task %d scheduled\n", input->parent_axe_ids.ids[i]); + break; + case AXE_TASK_DONE: + fprintf(fp, "Task %d Done\n", input->parent_axe_ids.ids[i]); + break; + case AXE_TASK_CANCELED: + fprintf(fp, "Task %d Canceled \n", input->parent_axe_ids.ids[i]); + break; + case AXE_TASK_RUNNING: + fprintf(fp, "Task %d RUNNING\n", input->parent_axe_ids.ids[i]); + break; + case AXE_WAITING_FOR_PARENT: + fprintf(fp, "Task %d waiting for parent\n", input->parent_axe_ids.ids[i]); + break; + } + } + if(input->parent_axe_ids.count) { if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_id, input->parent_axe_ids.count, input->parent_axe_ids.ids, @@ -2507,3667 +2386,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5VL_iod_server_object_get_comment() */ - -/*------------------------------------------------------------------------- - * Function: H5VL_iod_server_file_create_cb - * - * Purpose: Creates a file as a iod HDF5 file. - * - * Return: Success: SUCCEED - * Failure: Negative - * - * Programmer: Mohamad Chaarawi - * January, 2013 - * - *------------------------------------------------------------------------- - */ -static void -H5VL_iod_server_file_create_cb(AXE_engine_t UNUSED axe_engine, - size_t UNUSED num_n_parents, AXE_task_t UNUSED n_parents[], - size_t UNUSED num_s_parents, AXE_task_t UNUSED s_parents[], - void *_op_data) -{ - op_data_t *op_data = (op_data_t *)_op_data; - file_create_in_t *input = (file_create_in_t *)op_data->input; - file_create_out_t output; - unsigned int mode; - iod_handle_t coh; - iod_handle_t root_oh, mdkv_oh; - iod_obj_id_t mdkv_id; - iod_ret_t ret; - herr_t ret_value = SUCCEED; - - FUNC_ENTER_NOAPI_NOINIT - -#if H5VL_IOD_DEBUG - fprintf(stderr, "Start file create %s %d %d\n", input->name, input->fapl_id, input->fcpl_id); -#endif - - /* convert HDF5 flags to IOD flags */ - mode = (input->flags&H5F_ACC_RDWR) ? IOD_CONT_RW : IOD_CONT_RO; - if (input->flags&H5F_ACC_CREAT) - mode |= IOD_CONT_CREATE; - - /* Create the Container */ - if(iod_container_open(input->name, NULL /*hints*/, mode, &coh, NULL /*event*/) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "can't create container"); - - /* create the root group */ - ret = iod_obj_create(coh, IOD_TID_UNKNOWN, NULL, IOD_OBJ_KV, NULL, NULL, - &input->root_id, NULL); - if(0 == ret || EEXISTS == ret) { - /* root group has been created, open it */ - if (iod_obj_open_write(coh, input->root_id, NULL, &root_oh, NULL) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't open current group"); - } - else { - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't create root group"); - } - - /* for the process that succeeded in creating the group, create - the scratch pad for it too */ - if(0 == ret) { - scratch_pad_t sp; - - /* create the metadata KV object for the root group */ - if(iod_obj_create(coh, IOD_TID_UNKNOWN, NULL, IOD_OBJ_KV, - NULL, NULL, &mdkv_id, NULL) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't create metadata KV object"); - - /* set values for the scratch pad object */ - sp.mdkv_id = mdkv_id; - sp.attr_id = IOD_ID_UNDEFINED; - sp.filler1_id = IOD_ID_UNDEFINED; - sp.filler2_id = IOD_ID_UNDEFINED; - - /* set scratch pad in root group */ - if (iod_obj_set_scratch(root_oh, IOD_TID_UNKNOWN, &sp, NULL, NULL) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't set scratch pad"); - - /* Store Metadata in scratch pad */ - if (iod_obj_open_write(coh, mdkv_id, NULL, &mdkv_oh, NULL) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't create scratch pad"); - - /* MSC - TODO store things */ - - if(iod_obj_close(mdkv_oh, NULL, NULL)) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't close root object handle"); - } - -#if H5_DO_NATIVE - coh.cookie = H5Fcreate(input->name, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - HDassert(coh.cookie); - root_oh.cookie = coh.cookie; - fprintf(stderr, "Created Native file %s with ID %d\n", input->name, root_oh.cookie); -#endif - - output.coh = coh; - output.root_oh = root_oh; - output.kv_oid_index = 1; - output.array_oid_index = 1; - output.blob_oid_index = 1; - -#if H5VL_IOD_DEBUG - fprintf(stderr, "Done with file create, sending response to client \n"); -#endif - - HG_Handler_start_output(op_data->hg_handle, &output); - -done: - if(ret_value < 0) { - output.coh.cookie = IOD_OH_UNDEFINED; - output.root_oh.cookie = IOD_OH_UNDEFINED; - output.kv_oid_index = 0; - output.array_oid_index = 0; - output.blob_oid_index = 0; - HG_Handler_start_output(op_data->hg_handle, &ret_value); - } - - input = (file_create_in_t *)H5MM_xfree(input); - op_data = (op_data_t *)H5MM_xfree(op_data); - - FUNC_LEAVE_NOAPI_VOID -} /* end H5VL_iod_server_file_create_cb() */ - - -/*------------------------------------------------------------------------- - * Function: H5VL_iod_server_file_open_cb - * - * Purpose: Opens a file as a iod HDF5 file. - * - * Return: Success: SUCCEED - * Failure: Negative - * - * Programmer: Mohamad Chaarawi - * January, 2013 - * - *------------------------------------------------------------------------- - */ -static void -H5VL_iod_server_file_open_cb(AXE_engine_t UNUSED axe_engine, - size_t UNUSED num_n_parents, AXE_task_t UNUSED n_parents[], - size_t UNUSED num_s_parents, AXE_task_t UNUSED s_parents[], - void *_op_data) -{ - op_data_t *op_data = (op_data_t *)_op_data; - file_open_in_t *input = (file_open_in_t *)op_data->input; - file_open_out_t output; - unsigned int mode = input->flags; - iod_handle_t coh; - iod_handle_t root_oh, mdkv_oh; - scratch_pad_t sp; - herr_t ret_value = SUCCEED; - - FUNC_ENTER_NOAPI_NOINIT - -#if H5VL_IOD_DEBUG - fprintf(stderr, "Start file open %s %d %d\n", input->name, input->flags, input->fapl_id); -#endif - - if(iod_container_open(input->name, NULL /*hints*/, mode, &coh, NULL /*event*/)) - HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "can't open file"); - - /* open the root group */ - if (iod_obj_open_write(coh, ROOT_ID, NULL /*hints*/, &root_oh, NULL) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "can't open root object"); - - /* get scratch pad of root group */ - if(iod_obj_get_scratch(root_oh, IOD_TID_UNKNOWN, &sp, NULL, NULL) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "can't get scratch pad for root object"); - - /* open the metadata scratch pad */ - if (iod_obj_open_write(coh, sp.mdkv_id, NULL /*hints*/, &mdkv_oh, NULL) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "can't open scratch pad"); - - /* MSC - retrieve metadata */ - output.kv_oid_index = 1; - output.array_oid_index = 1; - output.blob_oid_index = 1; - output.fcpl_id = H5P_FILE_CREATE_DEFAULT; - - /* close the metadata scratch pad */ - if(iod_obj_close(mdkv_oh, NULL, NULL)) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't close root object handle"); - -#if H5_DO_NATIVE - { - coh.cookie = H5Fopen(input->name, H5F_ACC_RDWR, H5P_DEFAULT); - HDassert(coh.cookie); - root_oh.cookie = coh.cookie; - fprintf(stderr, "Opened Native file %s with ID %d\n", input->name, root_oh.cookie); - } -#endif - - output.coh = coh; - output.root_id = ROOT_ID; - output.root_oh = root_oh; - -#if H5VL_IOD_DEBUG - fprintf(stderr, "Done with file open, sending response to client\n"); -#endif - - HG_Handler_start_output(op_data->hg_handle, &output); - -done: - if(ret_value < 0) { - output.coh.cookie = IOD_OH_UNDEFINED; - output.root_id = IOD_ID_UNDEFINED; - output.root_oh.cookie = IOD_OH_UNDEFINED; - output.fcpl_id = H5P_FILE_CREATE_DEFAULT; - output.kv_oid_index = 0; - output.array_oid_index = 0; - output.blob_oid_index = 0; - HG_Handler_start_output(op_data->hg_handle, &output); - } - - input = (file_open_in_t *)H5MM_xfree(input); - op_data = (op_data_t *)H5MM_xfree(op_data); - - FUNC_LEAVE_NOAPI_VOID -} /* end H5VL_iod_server_file_open_cb() */ - - -/*------------------------------------------------------------------------- - * Function: H5VL_iod_server_file_flush_cb - * - * Purpose: Flushs iod HDF5 file. - * - * Return: Success: SUCCEED - * Failure: Negative - * - * Programmer: Mohamad Chaarawi - * January, 2013 - * - *------------------------------------------------------------------------- - */ -static void -H5VL_iod_server_file_flush_cb(AXE_engine_t UNUSED axe_engine, - size_t UNUSED num_n_parents, AXE_task_t UNUSED n_parents[], - size_t UNUSED num_s_parents, AXE_task_t UNUSED s_parents[], - void *_op_data) -{ - op_data_t *op_data = (op_data_t *)_op_data; - file_flush_in_t *input = (file_flush_in_t *)op_data->input; - iod_handle_t coh = input->coh; - H5F_scope_t scope = input->scope; - herr_t ret_value = SUCCEED; - - FUNC_ENTER_NOAPI_NOINIT - - /* MSC - TODO */ - -#if H5_DO_NATIVE - ret_value = H5Fflush(coh.cookie, scope); -#endif - -done: - if(HG_SUCCESS != HG_Handler_start_output(op_data->hg_handle, &ret_value)) - HDONE_ERROR(H5E_SYM, H5E_CANTDEC, FAIL, "can't send result of file flush to client"); - - input = (file_flush_in_t *)H5MM_xfree(input); - op_data = (op_data_t *)H5MM_xfree(op_data); - - FUNC_LEAVE_NOAPI_VOID -} /* end H5VL_iod_server_file_flush_cb() */ - - -/*------------------------------------------------------------------------- - * Function: H5VL_iod_server_file_close_cb - * - * Purpose: Closes iod HDF5 file. - * - * Return: Success: SUCCEED - * Failure: Negative - * - * Programmer: Mohamad Chaarawi - * January, 2013 - * - *------------------------------------------------------------------------- - */ -static void -H5VL_iod_server_file_close_cb(AXE_engine_t UNUSED axe_engine, - size_t UNUSED num_n_parents, AXE_task_t UNUSED n_parents[], - size_t UNUSED num_s_parents, AXE_task_t UNUSED s_parents[], - void *_op_data) -{ - op_data_t *op_data = (op_data_t *)_op_data; - file_close_in_t *input = (file_close_in_t *)op_data->input; - iod_handle_t coh = input->coh; - iod_handle_t root_oh = input->root_oh; - herr_t ret_value = SUCCEED; - - FUNC_ENTER_NOAPI_NOINIT - -#if H5VL_IOD_DEBUG - fprintf(stderr, "Start file close\n"); -#endif - -#if H5_DO_NATIVE - H5Fclose(coh.cookie); -#endif - - /* close the root group */ - if(iod_obj_close(root_oh, NULL, NULL) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTDEC, FAIL, "can't close root object handle"); - - /* close the container */ - if(iod_container_close(coh, NULL, NULL) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTDEC, FAIL, "can't close container"); - -done: - fprintf(stderr, "Done with file close, sending response to client\n"); - if(HG_SUCCESS != HG_Handler_start_output(op_data->hg_handle, &ret_value)) - HDONE_ERROR(H5E_SYM, H5E_CANTDEC, FAIL, "can't send result of file close to client"); - - input = (file_close_in_t *)H5MM_xfree(input); - op_data = (op_data_t *)H5MM_xfree(op_data); - - FUNC_LEAVE_NOAPI_VOID -} /* end H5VL_iod_server_file_close_cb() */ - - -/*------------------------------------------------------------------------- - * Function: H5VL_iod_server_group_create_cb - * - * Purpose: Creates a group as a iod object. - * - * Return: Success: SUCCEED - * Failure: Negative - * - * Programmer: Mohamad Chaarawi - * February, 2013 - * - *------------------------------------------------------------------------- - */ -static void -H5VL_iod_server_group_create_cb(AXE_engine_t UNUSED axe_engine, - size_t UNUSED num_n_parents, AXE_task_t UNUSED n_parents[], - size_t UNUSED num_s_parents, AXE_task_t UNUSED s_parents[], - void *_op_data) -{ - op_data_t *op_data = (op_data_t *)_op_data; - group_create_in_t *input = (group_create_in_t *)op_data->input; - group_create_out_t output; - iod_handle_t coh = input->coh; /* the container handle */ - iod_handle_t loc_handle = input->loc_oh; /* The handle for current object - could be undefined */ - iod_obj_id_t loc_id = input->loc_id; /* The ID of the current location object */ - iod_obj_id_t grp_id = input->grp_id; /* The ID of the group that needs to be created */ - const char *name = input->name; /* path relative to loc_id and loc_oh */ - iod_handle_t grp_oh, cur_oh, mdkv_oh; - iod_obj_id_t cur_id, mdkv_id; - char *last_comp; /* the name of the group obtained from traversal function */ - iod_kv_t kv; - scratch_pad_t sp; - iod_ret_t ret; - hbool_t collective = FALSE; /* MSC - change when we allow for collective */ - herr_t ret_value = SUCCEED; - - FUNC_ENTER_NOAPI_NOINIT - -#if H5VL_IOD_DEBUG - fprintf(stderr, "Start group create %s\n", name); -#endif - - /* the traversal will retrieve the location where the group needs - to be created. The traversal will fail if an intermediate group - does not exist. */ - if(H5VL_iod_server_traverse(coh, loc_id, loc_handle, name, FALSE, - &last_comp, &cur_id, &cur_oh) < 0) - HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't traverse path"); - - /* create the group */ - ret = iod_obj_create(coh, IOD_TID_UNKNOWN, NULL, IOD_OBJ_KV, - NULL, NULL, &grp_id, NULL); - if(collective && (0 == ret || EEXISTS == ret)) { - /* group has been created by another process, open it */ - if (iod_obj_open_write(coh, grp_id, NULL, &grp_oh, NULL) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't open Group"); - } - else if(!collective && 0 != ret) { - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't create Group"); - } - - /* for the process that succeeded in creating the group, create - the scratch pad for it too */ - if(0 == ret) { - /* insert new group in kv store of parent object */ - kv.key = HDstrdup(last_comp); - kv.value = &grp_id; - kv.value_len = sizeof(iod_obj_id_t); - if (iod_kv_set(cur_oh, IOD_TID_UNKNOWN, NULL, &kv, NULL, NULL) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't set KV pair in parent"); - HDfree(kv.key); - - /* create the metadata KV object for the group */ - if(iod_obj_create(coh, IOD_TID_UNKNOWN, NULL, IOD_OBJ_KV, - NULL, NULL, &mdkv_id, NULL) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't create metadata KV object"); - - /* set values for the scratch pad object */ - sp.mdkv_id = mdkv_id; - sp.attr_id = IOD_ID_UNDEFINED; - sp.filler1_id = IOD_ID_UNDEFINED; - sp.filler2_id = IOD_ID_UNDEFINED; - - /* set scratch pad in group */ - if (iod_obj_set_scratch(grp_oh, IOD_TID_UNKNOWN, &sp, NULL, NULL) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't set scratch pad"); - - /* Store Metadata in scratch pad */ - if (iod_obj_open_write(coh, mdkv_id, NULL, &mdkv_oh, NULL) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't create scratch pad"); - - /* MSC - TODO store things */ - - if(iod_obj_close(mdkv_oh, NULL, NULL)) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't close object"); - } /* end if */ - - /* close parent group if it is not the location we started the - traversal into */ - if(loc_handle.cookie != cur_oh.cookie) { - iod_obj_close(cur_oh, NULL, NULL); - } -#if H5_DO_NATIVE - grp_oh.cookie = H5Gcreate2(loc_handle.cookie, name, input->lcpl_id, - input->gcpl_id, input->gapl_id); - HDassert(grp_oh.cookie); -#endif - -#if H5VL_IOD_DEBUG - fprintf(stderr, "Done with group create, sending response to client\n"); -#endif - - /* return the object handle for the group to the client */ - output.iod_oh = grp_oh; - HG_Handler_start_output(op_data->hg_handle, &output); - -done: - /* return an UNDEFINED oh to the client if the operation failed */ - if(ret_value < 0) { - fprintf(stderr, "Failed Group Create\n"); - output.iod_oh.cookie = IOD_OH_UNDEFINED; - HG_Handler_start_output(op_data->hg_handle, &output); - } - - last_comp = (char *)H5MM_xfree(last_comp); - input = (group_create_in_t *)H5MM_xfree(input); - op_data = (op_data_t *)H5MM_xfree(op_data); - - FUNC_LEAVE_NOAPI_VOID -} /* end H5VL_iod_server_group_create_cb() */ - - -/*------------------------------------------------------------------------- - * Function: H5VL_iod_server_group_open_cb - * - * Purpose: Opens a group as a iod object. - * - * Return: Success: SUCCEED - * Failure: Negative - * - * Programmer: Mohamad Chaarawi - * February, 2013 - * - *------------------------------------------------------------------------- - */ -static void -H5VL_iod_server_group_open_cb(AXE_engine_t UNUSED axe_engine, - size_t UNUSED num_n_parents, AXE_task_t UNUSED n_parents[], - size_t UNUSED num_s_parents, AXE_task_t UNUSED s_parents[], - void *_op_data) -{ - op_data_t *op_data = (op_data_t *)_op_data; - group_open_in_t *input = (group_open_in_t *)op_data->input; - group_open_out_t output; - iod_handle_t coh = input->coh; - iod_handle_t loc_handle = input->loc_oh; - iod_obj_id_t loc_id = input->loc_id; - const char *name = input->name; - iod_obj_id_t grp_id; /* The ID of the group that needs to be opened */ - iod_handle_t cur_oh, mdkv_oh; - iod_obj_id_t cur_id, mdkv_id; - char *last_comp; /* the name of the group obtained from traversal function */ - iod_size_t kv_size; - scratch_pad_t sp; - herr_t ret_value = SUCCEED; - - FUNC_ENTER_NOAPI_NOINIT - -#if H5VL_IOD_DEBUG - fprintf(stderr, "Start group open %s\n", name); -#endif - - /* the traversal will retrieve the location where the group needs - to be created. The traversal will fail if an intermediate group - does not exist. */ - if(H5VL_iod_server_traverse(coh, loc_id, loc_handle, name, FALSE, - &last_comp, &cur_id, &cur_oh) < 0) - HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't traverse path"); - - kv_size = sizeof(iod_obj_id_t); - - /* lookup group in the current location */ - if(iod_kv_get_value(cur_oh, IOD_TID_UNKNOWN, last_comp, &grp_id, &kv_size, NULL, NULL) < 0) { - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "Intermdiate group does not exist"); - } /* end if */ - - /* close parent group and its scratch pad if it is not the - location we started the traversal into */ - if(loc_handle.cookie != cur_oh.cookie) { - iod_obj_close(cur_oh, NULL, NULL); - } - - /* open the group */ - if (iod_obj_open_write(coh, grp_id, NULL, &cur_oh, NULL) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't open current group"); - - /* get scratch pad of group */ - if(iod_obj_get_scratch(cur_oh, IOD_TID_UNKNOWN, &sp, NULL, NULL) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "can't get scratch pad for object"); - - /* open the metadata scratch pad */ - if (iod_obj_open_write(coh, sp.mdkv_id, NULL /*hints*/, &mdkv_oh, NULL) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "can't open scratch pad"); - - /* MSC - retrieve metadata */ -#if 0 - /* When we have a real IOD, open the scratch pad and read the - group's metadata */ - if(iod_kv_get_value(mdkv_oh, IOD_TID_UNKNOWN, "dataset_gcpl", NULL, - &output.gcpl_size, NULL, NULL) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "dataset gcpl lookup failed"); - if(NULL == (output.gcpl = H5MM_malloc (output.gcpl_size))) - HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't allocate gcpl buffer"); - if(iod_kv_get_value(mdkv_oh, IOD_TID_UNKNOWN, "dataset_gcpl", output.gcpl, - &output.gcpl_size, NULL, NULL) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "dataset dcpl lookup failed"); -#endif - - /* close the metadata scratch pad */ - if(iod_obj_close(mdkv_oh, NULL, NULL)) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't close meta data KV handle"); - -#if H5_DO_NATIVE - cur_oh.cookie = H5Gopen(loc_handle.cookie, name, input->gapl_id); - HDassert(cur_oh.cookie); -#endif - - output.iod_id = grp_id; - output.iod_oh = cur_oh; - output.gcpl_id = H5P_GROUP_CREATE_DEFAULT; - -#if H5VL_IOD_DEBUG - fprintf(stderr, "Done with group open, sending response to client\n"); -#endif - - HG_Handler_start_output(op_data->hg_handle, &output); - -done: - if(ret_value < 0) { - output.iod_oh.cookie = IOD_OH_UNDEFINED; - output.iod_id = IOD_ID_UNDEFINED; - output.gcpl_id = H5P_GROUP_CREATE_DEFAULT; - HG_Handler_start_output(op_data->hg_handle, &output); - } - - last_comp = (char *)H5MM_xfree(last_comp); - input = (group_open_in_t *)H5MM_xfree(input); - op_data = (op_data_t *)H5MM_xfree(op_data); - - FUNC_LEAVE_NOAPI_VOID -} /* end H5VL_iod_server_group_open_cb() */ - - -/*------------------------------------------------------------------------- - * Function: H5VL_iod_server_group_close_cb - * - * Purpose: Closes iod HDF5 group. - * - * Return: Success: SUCCEED - * Failure: Negative - * - * Programmer: Mohamad Chaarawi - * January, 2013 - * - *------------------------------------------------------------------------- - */ -static void -H5VL_iod_server_group_close_cb(AXE_engine_t UNUSED axe_engine, - size_t UNUSED num_n_parents, AXE_task_t UNUSED n_parents[], - size_t UNUSED num_s_parents, AXE_task_t UNUSED s_parents[], - void *_op_data) -{ - op_data_t *op_data = (op_data_t *)_op_data; - group_close_in_t *input = (group_close_in_t *)op_data->input; - iod_handle_t iod_oh = input->iod_oh; - herr_t ret_value = SUCCEED; - - FUNC_ENTER_NOAPI_NOINIT - -#if H5VL_IOD_DEBUG - fprintf(stderr, "Start group close\n"); -#endif - - if(iod_oh.cookie != IOD_OH_UNDEFINED) { -#if H5_DO_NATIVE - ret_value = H5Gclose(iod_oh.cookie); -#endif - if((ret_value = iod_obj_close(iod_oh, NULL, NULL)) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't close object"); - } - else { - /* MSC - need a way to kill object handle for this group */ - fprintf(stderr, "I do not have the OH of this group to close it\n"); - } -done: -#if H5VL_IOD_DEBUG - fprintf(stderr, "Done with group close, sending response to client\n"); -#endif - - HG_Handler_start_output(op_data->hg_handle, &ret_value); - - input = (group_close_in_t *)H5MM_xfree(input); - op_data = (op_data_t *)H5MM_xfree(op_data); - - FUNC_LEAVE_NOAPI_VOID -} /* end H5VL_iod_server_group_close_cb() */ - - -/*------------------------------------------------------------------------- - * Function: H5VL_iod_server_dset_create_cb - * - * Purpose: Creates a dset as a iod object. - * - * Return: Success: SUCCEED - * Failure: Negative - * - * Programmer: Mohamad Chaarawi - * February, 2013 - * - *------------------------------------------------------------------------- - */ -static void -H5VL_iod_server_dset_create_cb(AXE_engine_t UNUSED axe_engine, - size_t UNUSED num_n_parents, AXE_task_t UNUSED n_parents[], - size_t UNUSED num_s_parents, AXE_task_t UNUSED s_parents[], - void *_op_data) -{ - op_data_t *op_data = (op_data_t *)_op_data; - dset_create_in_t *input = (dset_create_in_t *)op_data->input; - dset_create_out_t output; - iod_handle_t coh = input->coh; - iod_handle_t loc_handle = input->loc_oh; - iod_obj_id_t loc_id = input->loc_id; /* The ID of the current location object */ - iod_obj_id_t dset_id = input->dset_id; /* The ID of the dataset that needs to be created */ - iod_handle_t dset_oh, cur_oh, mdkv_oh; - iod_obj_id_t cur_id, mdkv_id; - const char *name = input->name; - char *last_comp; /* the name of the dataset obtained from the last component in the path */ - iod_kv_t kv; - iod_array_struct_t array; - iod_size_t *max_dims; - size_t buf_size; - scratch_pad_t sp; - iod_ret_t ret; - hbool_t collective = FALSE; /* MSC - change when we allow for collective */ - herr_t ret_value = SUCCEED; - - FUNC_ENTER_NOAPI_NOINIT - - /* the traversal will retrieve the location where the dataset needs - to be created. The traversal will fail if an intermediate group - does not exist. */ - if(H5VL_iod_server_traverse(coh, loc_id, loc_handle, name, FALSE, - &last_comp, &cur_id, &cur_oh) < 0) - HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't traverse path"); - - /* Set the IOD array creation parameters */ - array.cell_size = H5Tget_size(input->type_id); - array.num_dims = H5Sget_simple_extent_ndims(input->space_id); - if(NULL == (array.current_dims = (iod_size_t *)malloc (sizeof(iod_size_t) * array.num_dims))) - HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't allocate dimention size array"); - if(NULL == (max_dims = (iod_size_t *)malloc (sizeof(iod_size_t) * array.num_dims))) - HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't allocate dimention size array"); - if(H5Sget_simple_extent_dims(input->space_id, array.current_dims, max_dims) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't get dimentions' sizes"); - array.firstdim_max = max_dims[0]; - array.chunk_dims = NULL; - array.dims_seq = NULL; - - /* MSC - NEED TO FIX THAT */ -#if 0 - if(layout.type == H5D_CHUNKED) { - if(NULL == (array.chunk_dims = malloc (sizeof(iod_size_t) * layout.u.chunk.ndims))) - HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't allocate chunk dimention size array"); - array.chunk_dims; - } -#endif - -#if H5VL_IOD_DEBUG - fprintf(stderr, "now creating the dataset %s cellsize %d num dimenstions %d\n", - last_comp, array.cell_size, array.num_dims); -#endif - - /* create the dataset */ - ret = iod_obj_create(coh, IOD_TID_UNKNOWN, NULL/*hints*/, IOD_OBJ_ARRAY, NULL, &array, - &dset_id, NULL /*event*/); - if(collective && (0 == ret || EEXISTS == ret)) { - /* Dataset has been created by another process, open it */ - if (iod_obj_open_write(coh, dset_id, NULL, &dset_oh, NULL) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't open Dataset"); - } - else if(!collective && 0 != ret) { - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't create Dataset"); - } - - /* for the process that succeeded in creating the dataset, update - the parent KV, create scratch pad */ - if(0 == ret) { - kv.key = HDstrdup(last_comp); - kv.value = &dset_id; - kv.value_len = sizeof(iod_obj_id_t); - /* insert new dataset in kv store of current group */ - if (iod_kv_set(cur_oh, IOD_TID_UNKNOWN, NULL, &kv, NULL, NULL) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't set KV pair in parent"); - HDfree(kv.key); - - /* create the metadata KV object for the dataset */ - if(iod_obj_create(coh, IOD_TID_UNKNOWN, NULL, IOD_OBJ_KV, - NULL, NULL, &mdkv_id, NULL) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't create metadata KV object"); - - /* set values for the scratch pad object */ - sp.mdkv_id = mdkv_id; - sp.attr_id = IOD_ID_UNDEFINED; - sp.filler1_id = IOD_ID_UNDEFINED; - sp.filler2_id = IOD_ID_UNDEFINED; - - /* set scratch pad in dataset */ - if (iod_obj_set_scratch(dset_oh, IOD_TID_UNKNOWN, &sp, NULL, NULL) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't set scratch pad"); - - /* Store Metadata in scratch pad */ - if (iod_obj_open_write(coh, mdkv_id, NULL, &mdkv_oh, NULL) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't create scratch pad"); - - /* MSC - TODO store things */ -#if 0 - /* insert layout metadata into scratch pad */ - kv.key = HDstrdup("dataset_dcpl"); - /* determine the buffer size needed to store the encoded dcpl of the dataset */ - if(H5Pencode(input->dcpl_id, NULL, &buf_size) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTENCODE, FAIL, "failed to encode dataset dcpl"); - if(NULL == (kv.value = malloc (buf_size))) - HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't allocate dcpl buffer"); - /* encode dcpl of the dataset */ - if(H5Pencode(input->dcpl_id, kv.value, &buf_size) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTENCODE, FAIL, "failed to encode dataset dcpl"); - kv.value_len = (iod_size_t)buf_size; - /* insert kv pair into scratch pad */ - if (iod_kv_set(mdkv_oh, IOD_TID_UNKNOWN, NULL, &kv, NULL, NULL) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't set KV pair in parent"); - HDfree(kv.key); - free(kv.value); - - /* insert datatyoe metadata into scratch pad */ - kv.key = HDstrdup("dataset_dtype"); - /* determine the buffer size needed to store the encoded type of the dataset */ - if(H5Tencode(input->type_id, NULL, &buf_size) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTENCODE, FAIL, "failed to encode dataset type"); - if(NULL == (kv.value = malloc (buf_size))) - HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't allocate type buffer"); - /* encode datatype of the dataset */ - if(H5Tencode(input->type_id, kv.value, &buf_size) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTENCODE, FAIL, "failed to encode dataset type"); - kv.value_len = (iod_size_t)buf_size; - /* insert kv pair into scratch pad */ - if (iod_kv_set(mdkv_oh, IOD_TID_UNKNOWN, NULL, &kv, NULL, NULL) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't set KV pair in parent"); - HDfree(kv.key); - free(kv.value); - - kv.key = HDstrdup("dataset_dspace"); - /* determine the buffer size needed to store the encoded space of the dataset */ - if(H5Sencode(input->space_id, NULL, &buf_size) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTENCODE, FAIL, "failed to encode dataset space"); - if(NULL == (kv.value = malloc (buf_size))) - HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't allocate space buffer"); - /* encode dataspace of the dataset */ - if(H5Sencode(input->space_id, kv.value, &buf_size) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTENCODE, FAIL, "failed to encode dataset space"); - kv.value_len = (iod_size_t)buf_size; - /* insert kv pair into scratch pad */ - if (iod_kv_set(mdkv_oh, IOD_TID_UNKNOWN, NULL, &kv, NULL, NULL) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't set KV pair in parent"); - HDfree(kv.key); - free(kv.value); -#endif - /* close the Metadata KV object */ - if(iod_obj_close(mdkv_oh, NULL, NULL)) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't close object"); - } - - /* close parent group if it is not the location we started the - traversal into */ - if(loc_handle.cookie != cur_oh.cookie) { - iod_obj_close(cur_oh, NULL, NULL); - } - -#if H5_DO_NATIVE - cur_oh.cookie = H5Dcreate2(loc_handle.cookie, last_comp, input->type_id, - input->space_id, input->lcpl_id, - input->dcpl_id, input->dapl_id); - HDassert(cur_oh.cookie); -#endif - - output.iod_oh = cur_oh; - -#if H5VL_IOD_DEBUG - fprintf(stderr, "Done with dset create, sending response to client\n"); -#endif - - HG_Handler_start_output(op_data->hg_handle, &output); - -done: - /* return an UNDEFINED oh to the client if the operation failed */ - if(ret_value < 0) { - output.iod_oh.cookie = IOD_OH_UNDEFINED; - HG_Handler_start_output(op_data->hg_handle, &output); - } - - if(max_dims) free(max_dims); - if(array.current_dims) free(array.current_dims); - last_comp = (char *)H5MM_xfree(last_comp); - input = (dset_create_in_t *)H5MM_xfree(input); - op_data = (op_data_t *)H5MM_xfree(op_data); - - FUNC_LEAVE_NOAPI_VOID -} /* end H5VL_iod_server_dset_create_cb() */ - - -/*------------------------------------------------------------------------- - * Function: H5VL_iod_server_dset_open_cb - * - * Purpose: Opens a dataset as a iod object. - * - * Return: Success: SUCCEED - * Failure: Negative - * - * Programmer: Mohamad Chaarawi - * February, 2013 - * - *------------------------------------------------------------------------- - */ -static void -H5VL_iod_server_dset_open_cb(AXE_engine_t UNUSED axe_engine, - size_t UNUSED num_n_parents, AXE_task_t UNUSED n_parents[], - size_t UNUSED num_s_parents, AXE_task_t UNUSED s_parents[], - void *_op_data) -{ - op_data_t *op_data = (op_data_t *)_op_data; - dset_open_in_t *input = (dset_open_in_t *)op_data->input; - dset_open_out_t output; - iod_handle_t coh = input->coh; - iod_handle_t loc_handle = input->loc_oh; - iod_obj_id_t loc_id = input->loc_id; - iod_handle_t cur_oh, mdkv_oh; - iod_obj_id_t cur_id; - iod_obj_id_t dset_id; - char *name = input->name; - char *last_comp; - scratch_pad_t sp; - iod_size_t kv_size = sizeof(iod_obj_id_t); - herr_t ret_value = SUCCEED; - - FUNC_ENTER_NOAPI_NOINIT - -#if H5VL_IOD_DEBUG - fprintf(stderr, "Start dataset Open %s\n", name); -#endif - - /* the traversal will retrieve the location where the dataset needs - to be opened. The traversal will fail if an intermediate group - does not exist. */ - if(H5VL_iod_server_traverse(coh, loc_id, loc_handle, name, FALSE, - &last_comp, &cur_id, &cur_oh) < 0) - HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't traverse path"); - - if(iod_kv_get_value(cur_oh, IOD_TID_UNKNOWN, last_comp, &dset_id, - kv_size , NULL, NULL) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't retrieve Array ID from parent KV store"); - - /* close parent group and its scratch pad if it is not the - location we started the traversal into */ - if(loc_handle.cookie != cur_oh.cookie) { - iod_obj_close(cur_oh, NULL, NULL); - } - - /* open the dataset */ - if (iod_obj_open_write(coh, dset_id, NULL /*hints*/, &cur_oh, NULL) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't open dataset"); - - /* get scratch pad of the dataset */ - if(iod_obj_get_scratch(cur_oh, IOD_TID_UNKNOWN, &sp, NULL, NULL) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "can't get scratch pad for object"); - - /* open the metadata scratch pad */ - if (iod_obj_open_write(coh, sp.mdkv_id, NULL /*hints*/, &mdkv_oh, NULL) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "can't open scratch pad"); - -#if 0 - /* MSC - retrieve all metadata from scratch pad */ - if(iod_kv_get_value(mdkv_oh, IOD_TID_UNKNOWN, "dataset_dcpl", NULL, - &output.dcpl_size, NULL, NULL) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "dataset dcpl lookup failed"); - if(NULL == (output.dcpl = H5MM_malloc (output.dcpl_size))) - HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't allocate dcpl buffer"); - if(iod_kv_get_value(mdkv_oh, IOD_TID_UNKNOWN, "dataset_dcpl", output.dcpl, - &output.dcpl_size, NULL, NULL) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "dataset dcpl lookup failed"); - - if(iod_kv_get_value(mdkv_oh, IOD_TID_UNKNOWN, "dataset_dtype", NULL, - &output.dtype_size, NULL, NULL) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "dataset dtype lookup failed"); - if(NULL == (output.dtype = H5MM_malloc (output.dtype_size))) - HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't allocate dtype buffer"); - if(iod_kv_get_value(mdkv_oh, IOD_TID_UNKNOWN, "dataset_dtype", output.dtype, - &output.dtype_size, NULL, NULL) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "dataset dtype lookup failed"); - - if(iod_kv_get_value(mdkv_oh, IOD_TID_UNKNOWN, "dataset_dspace", NULL, - &output.dspace_size, NULL, NULL) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "dataset dspace lookup failed"); - if(NULL == (output.dspace = H5MM_malloc (output.dspace_size))) - HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't allocate dspace buffer"); - if(iod_kv_get_value(mdkv_oh, IOD_TID_UNKNOWN, "dataset_dspace", output.dspace, - &output.dspace_size, NULL, NULL) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "dataset dspace lookup failed"); -#endif - - /* close the metadata scratch pad */ - if(iod_obj_close(mdkv_oh, NULL, NULL)) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't close object"); - - { - hsize_t dims[1]; - //hid_t space_id, type_id; - -#if H5_DO_NATIVE - printf("dataset name %s location %d\n", name, loc_handle.cookie); - cur_oh.cookie = H5Dopen(loc_handle.cookie, name, input->dapl_id); - HDassert(cur_oh.cookie); - output.space_id = H5Dget_space(cur_oh.cookie); - output.type_id = H5Dget_type(cur_oh.cookie); - output.dcpl_id = H5P_DATASET_CREATE_DEFAULT; -#else - /* fake a dataspace, type, and dcpl */ - dims [0] = 60; - output.space_id = H5Screate_simple(1, dims, NULL); - output.type_id = H5Tcopy(H5T_NATIVE_INT); - output.dcpl_id = H5P_DATASET_CREATE_DEFAULT; - cur_oh.cookie = 1; -#endif - -#if 0 - output.dcpl_size = 0; - output.dcpl = NULL; - - /* get Type size to encode */ - if(H5Tencode(type_id, NULL, &output.dtype_size) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTENCODE, FAIL, "failed to encode dataset type"); - if(NULL == (output.dtype = H5MM_malloc (output.dtype_size))) - HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't allocate datatype buffer"); - if(H5Tencode(type_id, output.dtype, &output.dtype_size) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTENCODE, FAIL, "can't encode datatype"); - - /* get Dataspace size to encode */ - if(H5Sencode(space_id, NULL, &output.dspace_size)<0) - HGOTO_ERROR(H5E_DATASPACE, H5E_CANTENCODE, FAIL, "can't encode dataspace"); - if(NULL == (output.dspace = H5MM_malloc (output.dspace_size))) - HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't allocate datatype buffer"); - if(H5Sencode(space_id, output.dspace, &output.dspace_size) < 0) - HGOTO_ERROR(H5E_DATASPACE, H5E_CANTENCODE, FAIL, "can't encode dataspace"); - - H5Sclose(space_id); -#endif - - } - - dset_id = 1; - output.iod_id = dset_id; - output.iod_oh.cookie = cur_oh.cookie; - -#if H5VL_IOD_DEBUG - fprintf(stderr, "Done with dset open, sending response to client\n"); -#endif - - HG_Handler_start_output(op_data->hg_handle, &output); - -done: - if(ret_value < 0) { - output.iod_oh.cookie = IOD_OH_UNDEFINED; - output.iod_id = IOD_ID_UNDEFINED; - HG_Handler_start_output(op_data->hg_handle, &output); - } - - H5Tclose(output.type_id); - H5Sclose(output.space_id); - - input = (dset_open_in_t *)H5MM_xfree(input); - op_data = (op_data_t *)H5MM_xfree(op_data); - last_comp = (char *)H5MM_xfree(last_comp); - - FUNC_LEAVE_NOAPI_VOID -} /* end H5VL_iod_server_dset_open_cb() */ - - -/*------------------------------------------------------------------------- - * Function: H5VL_iod_server_dset_read_cb - * - * Purpose: Reads from IOD into the function shipper BDS handle. - * - * Return: Success: SUCCEED - * Failure: Negative - * - * Programmer: Mohamad Chaarawi - * January, 2013 - * - *------------------------------------------------------------------------- - */ -static void -H5VL_iod_server_dset_read_cb(AXE_engine_t UNUSED axe_engine, - size_t UNUSED num_n_parents, AXE_task_t UNUSED n_parents[], - size_t UNUSED num_s_parents, AXE_task_t UNUSED s_parents[], - void *_op_data) -{ - op_data_t *op_data = (op_data_t *)_op_data; - dset_io_in_t *input = (dset_io_in_t *)op_data->input; - dset_read_out_t output; - iod_handle_t coh = input->coh; - iod_handle_t iod_oh = input->iod_oh; - iod_obj_id_t iod_id = input->iod_id; - hg_bulk_t bulk_handle = input->bulk_handle; - hid_t space_id = input->space_id; - hid_t dxpl_id = input->dxpl_id; - hid_t src_id = input->dset_type_id; - hid_t dst_id = input->mem_type_id; - hg_bulk_block_t bulk_block_handle; - hg_bulk_request_t bulk_request; - iod_mem_desc_t mem_desc; - iod_array_iodesc_t file_desc; - size_t size, buf_size, src_size, dst_size; - void *buf; - uint32_t cs = 0; - size_t nelmts; - na_addr_t dest = HG_Handler_get_addr(op_data->hg_handle); - hbool_t opened_locally = FALSE; - herr_t ret_value = SUCCEED; - - FUNC_ENTER_NOAPI_NOINIT - - /* open the dataset if we don't have the handle yet */ - if(iod_oh.cookie == IOD_OH_UNDEFINED) { - if (iod_obj_open_write(coh, iod_id, NULL /*hints*/, &iod_oh, NULL) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't open current group"); - opened_locally = TRUE; - } - - size = HG_Bulk_handle_get_size(bulk_handle); - - nelmts = (size_t)H5Sget_simple_extent_npoints(space_id); - src_size = H5Tget_size(src_id); - dst_size = H5Tget_size(dst_id); - - /* adjust buffer size for datatype conversion */ - if(src_size > dst_size) { - buf_size = src_size * nelmts; -#if H5VL_IOD_DEBUG - fprintf(stderr, "Adjusted Buffer size because of datatype conversion from %d to %d: ", - size, buf_size); -#endif - } - else { - buf_size = dst_size * nelmts; - assert(buf_size == size); - } - - if(NULL == (buf = malloc(buf_size))) - HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't allocate read buffer"); - - mem_desc.nfrag = 1; - mem_desc.frag->addr = buf; - mem_desc.frag->len = (iod_size_t)buf_size; - - /* MSC TODO - populate file location hyperslab */ - - /* read from array object */ - if(iod_array_read(iod_oh, IOD_TID_UNKNOWN, NULL, &mem_desc, &file_desc, NULL, NULL) < 0) - HGOTO_ERROR(H5E_SYM, H5E_READERROR, FAIL, "can't read from array object"); - - { - int i; - hbool_t flag = FALSE; - int *buf_ptr = (int *)buf; - -#if H5_DO_NATIVE - ret_value = H5Dread(iod_oh.cookie, src_id, H5S_ALL, space_id, dxpl_id, buf); -#else /* fake data */ - for(i=0;i<60;++i) - buf_ptr[i] = i; -#endif - if(H5Tconvert(src_id, dst_id, nelmts, buf, NULL, dxpl_id) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "data type conversion failed"); - - /* calculate a checksum for the data to be sent */ - cs = H5checksum(buf, size, NULL); - - /* MSC - check if client requested to corrupt data */ - if(dxpl_id != H5P_DEFAULT && H5Pget_dxpl_inject_corruption(dxpl_id, &flag) < 0) - HGOTO_ERROR(H5E_SYM, H5E_READERROR, FAIL, "can't read property list"); - if(flag) { - fprintf(stderr, "Injecting a bad data value to cause corruption \n"); - buf_ptr[0] = 10; - } - } - - /* Create a new block handle to write the data */ - HG_Bulk_block_handle_create(buf, size, HG_BULK_READ_ONLY, &bulk_block_handle); - - /* Write bulk data here and wait for the data to be there */ - if(HG_SUCCESS != HG_Bulk_write_all(dest, bulk_handle, bulk_block_handle, &bulk_request)) - HGOTO_ERROR(H5E_SYM, H5E_READERROR, FAIL, "can't read from array object"); - /* wait for it to complete */ - if(HG_SUCCESS != HG_Bulk_wait(bulk_request, HG_BULK_MAX_IDLE_TIME, HG_BULK_STATUS_IGNORE)) - HGOTO_ERROR(H5E_SYM, H5E_READERROR, FAIL, "can't read from array object"); - -done: - - output.ret = ret_value; - output.cs = cs; - -#if H5VL_IOD_DEBUG - fprintf(stderr, "Done with dset read, checksum %u, sending response to client\n", cs); -#endif - - if(HG_SUCCESS != HG_Handler_start_output(op_data->hg_handle, &output)) - HDONE_ERROR(H5E_SYM, H5E_WRITEERROR, FAIL, "can't send result of write to client"); - if(HG_SUCCESS != HG_Bulk_block_handle_free(bulk_block_handle)) - HDONE_ERROR(H5E_SYM, H5E_WRITEERROR, FAIL, "can't free bds block handle"); - - input = (dset_io_in_t *)H5MM_xfree(input); - op_data = (op_data_t *)H5MM_xfree(op_data); - free(buf); - - /* close the dataset if we opened it in this routine */ - if(opened_locally) { - if(iod_obj_close(iod_oh, NULL, NULL)) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't close Array object"); - } - FUNC_LEAVE_NOAPI_VOID -} /* end H5VL_iod_server_dset_read_cb() */ - -/*------------------------------------------------------------------------- - * Function: H5VL_iod_server_dset_compactor_cb - * - * Purpose: Compacts the requests and calls the appropriate read/write. - * - * Return: Success: SUCCEED - * Failure: Negative - * - * Programmer: Vishwanath Venkatesan - * July, 2013 - * - *------------------------------------------------------------------------- - */ - -static void -H5VL_iod_server_dset_compactor_cb (AXE_engine_t UNUSED axe_engine, - size_t UNUSED num_n_parents, AXE_task_t UNUSED n_parents[], - size_t UNUSED num_s_parents, AXE_task_t UNUSED s_parents[], - void *_queue) -{ - - compactor *cqueue = (compactor *)_queue; - int n_requests, i = 0; - op_data_t *op_data = NULL; - herr_t ret_value = SUCCEED; - request_list_t *wlist=NULL; - dataset_container_t *dlist=NULL; - int nentries = 0, ndatasets = 0; - - FUNC_ENTER_NOAPI_NOINIT - -#if DEBUG_COMPACTOR - fprintf(fp, "Enters Call BACK!\n"); - fprintf (fp, "Number of requests : %d from call back in queue : %p\n", - H5VL_iod_get_number_of_requests(cqueue), cqueue); - fflush(fp); -#endif - - pthread_mutex_lock(&lock); - compactor_queue_flag = 0; - curr_queue = NULL; - pthread_mutex_unlock(&lock); - -#ifdef DEBUG_COMPACTOR - ret_value = H5VL_iod_create_request_list (cqueue, - &wlist, - &nentries, - &dlist, - &ndatasets, - WRITE, - fp); -#else - ret_value = H5VL_iod_create_request_list (cqueue, - &wlist, - &nentries, - &dlist, - &ndatasets, - WRITE); -#endif -#if DEBUG_COMPACTOR - if (ret_value != CP_SUCCESS){ - fprintf(fp,"ERROR !! Compactor create request list failed with error %d \n", - ret_value); - } -#endif - - -#if DEBUG_COMPACTOR - fprintf(fp,"nentires : %d############################################\n", nentries); - fprintf(fp,"Compactor Request List \n"); - fprintf(fp,"id -- dataset -- dataspace -- fileblocks -- memblocks\n"); - for ( i = 0; i < nentries; i++){ - fprintf(fp, "%d -- %d -- %d -- %zd -- %zd\n", - wlist[i].request_id, - wlist[i].dataset_id, - wlist[i].selection_id, - wlist[i].num_fblocks, - wlist[i].num_mblocks); - } - fprintf(fp,"#############################################\n"); -#endif - - for ( i = 0; i < ndatasets; i ++){ - - H5VL_iod_compact_requests (&wlist, &nentries,dlist[i].num_requests, - dlist[i].requests); - } - - - - n_requests = H5VL_iod_get_number_of_requests(cqueue); - - - - while ( n_requests > 0){ - compactor_entry t_entry; - H5VL_iod_remove_request_from_compactor (cqueue, &t_entry); - if ( t_entry.type_request == WRITE){ -#if DEBUG_COMPACTOR - fprintf (fp, "Request: %d is a WRITE request\n ", t_entry.request_id); - fprintf (fp, "With op_data : %p\n ", - t_entry.input_structure, - t_entry.request_id); - fflush(fp); -#endif - op_data = NULL; - op_data = t_entry.input_structure; - H5VL_iod_server_dset_write_cb (NULL,NULL,NULL,NULL,NULL,op_data); - } - else{ - fprintf (fp, "Request: %d is a READ request\n ", t_entry.request_id); - /* Have to do the same for READ requests!*/ - } - n_requests--; - } - - if (CP_SUCCESS != H5VL_iod_destroy_compactor_queue(cqueue)){ - HGOTO_ERROR(H5E_HEAP, H5E_NOSPACE, CP_FAIL, "Cannot free NULL queue\n"); - } - - done: - FUNC_LEAVE_NOAPI_VOID -} - - -/*------------------------------------------------------------------------- - * Function: H5VL_iod_server_dset_write_cb - * - * Purpose: Writes from IOD into the function shipper BDS handle. - * - * Return: Success: SUCCEED - * Failure: Negative - * - * Programmer: Mohamad Chaarawi - * January, 2013 - * - *------------------------------------------------------------------------- - */ -static void -H5VL_iod_server_dset_write_cb(AXE_engine_t UNUSED axe_engine, - size_t UNUSED num_n_parents, AXE_task_t UNUSED n_parents[], - size_t UNUSED num_s_parents, AXE_task_t UNUSED s_parents[], - void *_op_data) -{ - op_data_t *op_data = (op_data_t *)_op_data; - dset_io_in_t *input = (dset_io_in_t *)op_data->input; - iod_handle_t coh = input->coh; - iod_handle_t iod_oh = input->iod_oh; - iod_obj_id_t iod_id = input->iod_id; - hg_bulk_t bulk_handle = input->bulk_handle; - hid_t space_id = input->space_id; - hid_t dxpl_id = input->dxpl_id; - uint32_t cs = input->checksum; - uint32_t data_cs = 0; - hid_t src_id = input->mem_type_id; - hid_t dst_id = input->dset_type_id; - hg_bulk_block_t bulk_block_handle; - hg_bulk_request_t bulk_request; - iod_mem_desc_t mem_desc; - iod_array_iodesc_t file_desc; - size_t size, buf_size, src_size, dst_size; - void *buf; - size_t nelmts; - hbool_t flag = FALSE; - na_addr_t source = HG_Handler_get_addr(op_data->hg_handle); - hbool_t opened_locally = FALSE; - herr_t ret_value = SUCCEED; - - FUNC_ENTER_NOAPI_NOINIT - - /* open the dataset if we don't have the handle yet */ - if(iod_oh.cookie == IOD_OH_UNDEFINED) { - if (iod_obj_open_write(coh, iod_id, NULL /*hints*/, &iod_oh, NULL) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't open current group"); - opened_locally = TRUE; - } - - /* Read bulk data here and wait for the data to be here */ - size = HG_Bulk_handle_get_size(bulk_handle); - - nelmts = (size_t)H5Sget_simple_extent_npoints(space_id); - src_size = H5Tget_size(src_id); - dst_size = H5Tget_size(dst_id); - - /* adjust buffer size for datatype conversion */ - if(src_size < dst_size) { - buf_size = dst_size * nelmts; -#if H5VL_IOD_DEBUG - fprintf(stderr, "Adjusted Buffer size because of datatype conversion from %d to %d: ", - size, buf_size); -#endif - } - else { - buf_size = src_size * nelmts; - assert(buf_size == size); - } - - if(NULL == (buf = malloc(buf_size))) - HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't allocate read buffer"); - - HG_Bulk_block_handle_create(buf, size, HG_BULK_READWRITE, &bulk_block_handle); - - /* Write bulk data here and wait for the data to be there */ - if(HG_SUCCESS != HG_Bulk_read_all(source, bulk_handle, bulk_block_handle, &bulk_request)) - HGOTO_ERROR(H5E_SYM, H5E_WRITEERROR, FAIL, "can't get data from function shipper"); - /* wait for it to complete */ - if(HG_SUCCESS != HG_Bulk_wait(bulk_request, HG_BULK_MAX_IDLE_TIME, HG_BULK_STATUS_IGNORE)) - HGOTO_ERROR(H5E_SYM, H5E_WRITEERROR, FAIL, "can't get data from function shipper"); - - /* free the bds block handle */ - if(HG_SUCCESS != HG_Bulk_block_handle_free(bulk_block_handle)) - HGOTO_ERROR(H5E_SYM, H5E_WRITEERROR, FAIL, "can't free bds block handle"); - - /* MSC - check if client requested to corrupt data */ - if(dxpl_id != H5P_DEFAULT && H5Pget_dxpl_inject_corruption(dxpl_id, &flag) < 0) - HGOTO_ERROR(H5E_SYM, H5E_READERROR, FAIL, "can't read property list"); - if(flag) { - ((int *)buf)[0] = 10; - } - - /* If client specified a checksum, verify it */ - if(dxpl_id != H5P_DEFAULT && H5Pget_dxpl_checksum(dxpl_id, &data_cs) < 0) - HGOTO_ERROR(H5E_SYM, H5E_READERROR, FAIL, "can't read property list"); - if(data_cs != 0) { - cs = H5_checksum_lookup4(buf, size, NULL); - if(cs != data_cs) { - fprintf(stderr, "Errrr.. Network transfer Data corruption. expecting %u, got %u\n", - data_cs, cs); - HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "Checksum verification failed"); - } - } - - if(H5Tconvert(src_id, dst_id, nelmts, buf, NULL, dxpl_id) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "data type conversion failed") - - { - int i; - int *buf_ptr = (int *)buf; - - fprintf(stderr, "Received a buffer of size %d with values: ", size); - for(i=0;i<60;++i) - fprintf(stderr, "%d ", buf_ptr[i]); - fprintf(stderr, "\n"); - } - - mem_desc.nfrag = 1; - mem_desc.frag->addr = buf; - mem_desc.frag->len = (iod_size_t)buf_size; - mem_desc.nfrag = 1; - - /* MSC TODO - populate file location hyperslab */ - - /* write from array object */ - if(iod_array_write(iod_oh, IOD_TID_UNKNOWN, NULL, &mem_desc, &file_desc, &cs, NULL) < 0) - HGOTO_ERROR(H5E_SYM, H5E_WRITEERROR, FAIL, "can't write to array object"); - -#if H5_DO_NATIVE - ret_value = H5Dwrite(iod_oh.cookie, H5T_NATIVE_INT, H5S_ALL, space_id, dxpl_id, buf); -#endif - -done: -#if H5VL_IOD_DEBUG - fprintf(stderr, "Done with dset write, sending %d response to client\n", ret_value); -#endif - - if(HG_SUCCESS != HG_Handler_start_output(op_data->hg_handle, &ret_value)) - HDONE_ERROR(H5E_SYM, H5E_WRITEERROR, FAIL, "can't send result of write to client"); -#if 0 - /* Shut down datatype info for operation */ - if(type_info_init && H5VL_iod_typeinfo_term(&type_info) < 0) - HDONE_ERROR(H5E_DATASET, H5E_CANTCLOSEOBJ, FAIL, "unable to shut down type info") -#endif - - input = (dset_io_in_t *)H5MM_xfree(input); - op_data = (op_data_t *)H5MM_xfree(op_data); - free(buf); - - /* close the dataset if we opened it in this routine */ - if(opened_locally) { - if(iod_obj_close(iod_oh, NULL, NULL)) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't close Array object"); - } - FUNC_LEAVE_NOAPI_VOID -} /* end H5VL_iod_server_dset_write_cb() */ - - -/*------------------------------------------------------------------------- - * Function: H5VL_iod_server_dset_set_extent_cb - * - * Purpose: Set_Extents iod HDF5 dataset. - * - * Return: Success: SUCCEED - * Failure: Negative - * - * Programmer: Mohamad Chaarawi - * January, 2013 - * - *------------------------------------------------------------------------- - */ -static void -H5VL_iod_server_dset_set_extent_cb(AXE_engine_t UNUSED axe_engine, - size_t UNUSED num_n_parents, AXE_task_t UNUSED n_parents[], - size_t UNUSED num_s_parents, AXE_task_t UNUSED s_parents[], - void *_op_data) -{ - op_data_t *op_data = (op_data_t *)_op_data; - dset_set_extent_in_t *input = (dset_set_extent_in_t *)op_data->input; - iod_handle_t coh = input->coh; - iod_handle_t iod_oh = input->iod_oh; - iod_obj_id_t iod_id = input->iod_id; - int rank = input->dims.rank; - hbool_t opened_locally = FALSE; - herr_t ret_value = SUCCEED; - - FUNC_ENTER_NOAPI_NOINIT - -#if H5VL_IOD_DEBUG - fprintf(stderr, "Start dataset Extend on the first dimension to %d\n", input->dims.size[0]); -#endif - - /* open the dataset if we don't have the handle yet */ - if(iod_oh.cookie == IOD_OH_UNDEFINED) { - if (iod_obj_open_write(coh, iod_id, NULL /*hints*/, &iod_oh, NULL) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't open current group"); - opened_locally = TRUE; - } - - /* extend along the first dimension only */ - if(iod_array_extend(iod_oh, IOD_TID_UNKNOWN, (iod_size_t)input->dims.size[0], NULL) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't extend dataset"); - -#if H5_DO_NATIVE - ret_value = H5Dset_extent(iod_oh.cookie, input->dims.size); -#endif - -done: -#if H5VL_IOD_DEBUG - fprintf(stderr, "Done with dset set_extent, sending response to client\n"); -#endif - - HG_Handler_start_output(op_data->hg_handle, &ret_value); - - input = (dset_set_extent_in_t *)H5MM_xfree(input); - op_data = (op_data_t *)H5MM_xfree(op_data); - - /* close the dataset if we opened it in this routine */ - if(opened_locally) { - if(iod_obj_close(iod_oh, NULL, NULL)) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't close Array object"); - } - - FUNC_LEAVE_NOAPI_VOID -} /* end H5VL_iod_server_dset_set_extent_cb() */ - - -/*------------------------------------------------------------------------- - * Function: H5VL_iod_server_dset_close_cb - * - * Purpose: Closes iod HDF5 dataset. - * - * Return: Success: SUCCEED - * Failure: Negative - * - * Programmer: Mohamad Chaarawi - * January, 2013 - * - *------------------------------------------------------------------------- - */ -static void -H5VL_iod_server_dset_close_cb(AXE_engine_t UNUSED axe_engine, - size_t UNUSED num_n_parents, AXE_task_t UNUSED n_parents[], - size_t UNUSED num_s_parents, AXE_task_t UNUSED s_parents[], - void *_op_data) -{ - op_data_t *op_data = (op_data_t *)_op_data; - dset_close_in_t *input = (dset_close_in_t *)op_data->input; - iod_handle_t iod_oh = input->iod_oh; - iod_obj_id_t iod_id = input->iod_id; - herr_t ret_value = SUCCEED; - - FUNC_ENTER_NOAPI_NOINIT - -#if H5VL_IOD_DEBUG - fprintf(stderr, "Start dataset Close\n"); -#endif - - if(iod_oh.cookie != IOD_OH_UNDEFINED) { -#if H5_DO_NATIVE - ret_value = H5Dclose(iod_oh.cookie); -#endif - - if((ret_value = iod_obj_close(iod_oh, NULL, NULL)) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't close object"); - } - else { - /* MSC - need a way to kill object handle for this group */ - fprintf(stderr, "I do not have the OH of this dataset to close it\n"); - } - -done: -#if H5VL_IOD_DEBUG - fprintf(stderr, "Done with dset close, sending response to client\n"); -#endif - - HG_Handler_start_output(op_data->hg_handle, &ret_value); - - input = (dset_close_in_t *)H5MM_xfree(input); - op_data = (op_data_t *)H5MM_xfree(op_data); - - FUNC_LEAVE_NOAPI_VOID -} /* end H5VL_iod_server_dset_close_cb() */ - - -/*------------------------------------------------------------------------- - * Function: H5VL_iod_server_dtype_commit_cb - * - * Purpose: Commits a dtype as a iod object. - * - * Return: Success: SUCCEED - * Failure: Negative - * - * Programmer: Mohamad Chaarawi - * April, 2013 - * - *------------------------------------------------------------------------- - */ -static void -H5VL_iod_server_dtype_commit_cb(AXE_engine_t UNUSED axe_engine, - size_t UNUSED num_n_parents, AXE_task_t UNUSED n_parents[], - size_t UNUSED num_s_parents, AXE_task_t UNUSED s_parents[], - void *_op_data) -{ - op_data_t *op_data = (op_data_t *)_op_data; - dtype_commit_in_t *input = (dtype_commit_in_t *)op_data->input; - dtype_commit_out_t output; - iod_handle_t coh = input->coh; - iod_handle_t loc_handle = input->loc_oh; - iod_obj_id_t loc_id = input->loc_id; /* The ID of the current location object */ - iod_obj_id_t dtype_id = input->dtype_id; /* The ID of the datatype that needs to be created */ - iod_handle_t dtype_oh, cur_oh, mdkv_oh; - iod_obj_id_t cur_id, mdkv_id; - const char *name = input->name; - iod_kv_t kv; - char *last_comp; /* the name of the datatype obtained from the last component in the path */ - size_t buf_size; - void *buf; - iod_mem_desc_t mem_desc; - iod_blob_iodesc_t file_desc; - scratch_pad_t sp; - iod_ret_t ret; - hbool_t collective = FALSE; /* MSC - change when we allow for collective */ - herr_t ret_value = SUCCEED; - - FUNC_ENTER_NOAPI_NOINIT - -#if H5VL_IOD_DEBUG - fprintf(stderr, "Start datatype Commit %s\n", name); -#endif - - /* the traversal will retrieve the location where the datatype needs - to be created. The traversal will fail if an intermediate group - does not exist. */ - if(H5VL_iod_server_traverse(coh, loc_id, loc_handle, name, FALSE, - &last_comp, &cur_id, &cur_oh) < 0) - HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't traverse path"); - - /* create the datatype */ - ret = iod_obj_create(coh, IOD_TID_UNKNOWN, NULL/*hints*/, IOD_OBJ_BLOB, NULL, NULL, - &dtype_id, NULL /*event*/); - if(collective && (0 == ret || EEXISTS == ret)) { - /* Datatype has been created by another process, open it */ - if (iod_obj_open_write(coh, dtype_id, NULL, &dtype_oh, NULL) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't open Datatype"); - } - else if(!collective && 0 != ret) { - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't create Datatype"); - } - - /* for the process that succeeded in creating the datatype, update - the parent KV, create scratch pad */ - if(0 == ret) { - kv.key = HDstrdup(last_comp); - kv.value = &dtype_id; - kv.value_len = sizeof(iod_obj_id_t); - /* insert new datatype in kv store of current group */ - if (iod_kv_set(cur_oh, IOD_TID_UNKNOWN, NULL, &kv, NULL, NULL) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't set KV pair in parent"); - HDfree(kv.key); - - /* create the metadata KV object for the datatype */ - if(iod_obj_create(coh, IOD_TID_UNKNOWN, NULL, IOD_OBJ_KV, - NULL, NULL, &mdkv_id, NULL) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't create metadata KV object"); - - /* set values for the scratch pad object */ - sp.mdkv_id = mdkv_id; - sp.attr_id = IOD_ID_UNDEFINED; - sp.filler1_id = IOD_ID_UNDEFINED; - sp.filler2_id = IOD_ID_UNDEFINED; - - /* set scratch pad in datatype */ - if (iod_obj_set_scratch(dtype_oh, IOD_TID_UNKNOWN, &sp, NULL, NULL) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't set scratch pad"); - - /* Store Metadata in scratch pad */ - if (iod_obj_open_write(coh, mdkv_id, NULL, &mdkv_oh, NULL) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't create scratch pad"); - - /* determine the buffer size needed to store the encoded type of the datatype */ - if(H5Tencode(input->type_id, NULL, &buf_size) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTENCODE, FAIL, "failed to encode datatype type"); - if(NULL == (buf = malloc (buf_size))) - HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't allocate type buffer"); - /* encode datatype of the datatype */ - if(H5Tencode(input->type_id, buf, &buf_size) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTENCODE, FAIL, "failed to encode datatype type"); - - /* create memory descriptor for writing */ - mem_desc.nfrag = 1; - mem_desc.frag->addr = buf; - mem_desc.frag->len = (iod_size_t)buf_size; - - /* create file descriptor for writing */ - file_desc.nfrag = 1; - file_desc.frag->offset = 0; - file_desc.frag->len = (iod_size_t)buf_size; - - /* write the serialized type value to the BLOB object */ - if(iod_blob_write(cur_oh, IOD_TID_UNKNOWN, NULL, &mem_desc, &file_desc, NULL, NULL) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to write BLOB object"); - - /* MSC - TODO store things */ -#if 0 - /* insert datatype metadata into scratch pad */ - - kv.key = HDstrdup("datatype_tcpl"); - /* determine the buffer size needed to store the encoded tcpl of the datatype */ - if(H5Pencode(input->tcpl_id, NULL, &value_size) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTENCODE, FAIL, "failed to encode datatype tcpl"); - if(NULL == (kv.value = malloc (value_size))) - HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't allocate tcpl buffer"); - /* encode tcpl of the datatype */ - if(H5Pencode(input->tcpl_id, kv.value, &value_size) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTENCODE, FAIL, "failed to encode datatype tcpl"); - kv.value_len = (iod_size_t)value_size; - /* insert kv pair into scratch pad */ - if (iod_kv_set(mdkv_oh, IOD_TID_UNKNOWN, NULL, &kv, NULL, NULL) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't set KV pair in parent"); - HDfree(kv.key); - free(kv.value); - - kv.key = HDstrdup("datatype_size"); - kv.value_len = sizeof(iod_size_t); - if(NULL == (kv.value = malloc (kv.value_len))) - HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't allocate buffer"); - memcpy(kv.value, &buf_size, kv.value_len); - - /* insert kv pair into scratch pad */ - if (iod_kv_set(mdkv_oh, IOD_TID_UNKNOWN, NULL, &kv, NULL, NULL) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't set KV pair in parent"); - HDfree(kv.key); - free(kv.value); -#endif - - /* close the Metadata KV object */ - if(iod_obj_close(mdkv_oh, NULL, NULL)) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't close object"); - } - -#if H5_DO_NATIVE - cur_oh.cookie = H5Tcopy(input->type_id); - if(H5Tcommit2(loc_handle.cookie, last_comp, cur_oh.cookie, - H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't commit datatype"); - fprintf(stderr, "Committed Native Datatype %s with ID %d on %d\n", - last_comp, cur_oh.cookie, loc_handle.cookie); -#endif - - /* close parent group and its scratch pad if it is not the - location we started the traversal into */ - if(loc_handle.cookie != cur_oh.cookie) { - iod_obj_close(cur_oh, NULL, NULL); - } - - output.iod_oh = cur_oh; - -#if H5VL_IOD_DEBUG - fprintf(stderr, "Done with dtype commit, sending response to client\n"); -#endif - - HG_Handler_start_output(op_data->hg_handle, &output); - -done: - if(ret_value < 0) { - output.iod_oh.cookie = IOD_OH_UNDEFINED; - HG_Handler_start_output(op_data->hg_handle, &output); - } - - input = (dtype_commit_in_t *)H5MM_xfree(input); - op_data = (op_data_t *)H5MM_xfree(op_data); - last_comp = (char *)H5MM_xfree(last_comp); - free(buf); - - FUNC_LEAVE_NOAPI_VOID -} /* end H5VL_iod_server_dtype_commit_cb() */ - - -/*------------------------------------------------------------------------- - * Function: H5VL_iod_server_dtype_open_cb - * - * Purpose: Opens a datatype as a iod object. - * - * Return: Success: SUCCEED - * Failure: Negative - * - * Programmer: Mohamad Chaarawi - * April, 2013 - * - *------------------------------------------------------------------------- - */ -static void -H5VL_iod_server_dtype_open_cb(AXE_engine_t UNUSED axe_engine, - size_t UNUSED num_n_parents, AXE_task_t UNUSED n_parents[], - size_t UNUSED num_s_parents, AXE_task_t UNUSED s_parents[], - void *_op_data) -{ - op_data_t *op_data = (op_data_t *)_op_data; - dtype_open_in_t *input = (dtype_open_in_t *)op_data->input; - dtype_open_out_t output; - iod_handle_t coh = input->coh; - iod_handle_t loc_handle = input->loc_oh; - iod_obj_id_t loc_id = input->loc_id; - iod_obj_id_t dtype_id; - iod_handle_t cur_oh, mdkv_oh; - iod_obj_id_t cur_id, mdkv_id; - const char *name = input->name; - char *last_comp; /* the name of the datatype obtained from the last component in the path */ - size_t buf_size; - void *buf; - iod_mem_desc_t mem_desc; - iod_blob_iodesc_t file_desc; - iod_size_t kv_size = sizeof(iod_obj_id_t); - scratch_pad_t sp; - herr_t ret_value = SUCCEED; - - FUNC_ENTER_NOAPI_NOINIT - - fprintf(stderr, "Start datatype Open %s\n", name); - - /* the traversal will retrieve the location where the datatype needs - to be opened. The traversal will fail if an intermediate group - does not exist. */ - if(H5VL_iod_server_traverse(coh, loc_id, loc_handle, name, FALSE, - &last_comp, &cur_id, &cur_oh) < 0) - HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't traverse path"); - - if(iod_kv_get_value(cur_oh, IOD_TID_UNKNOWN, last_comp, &dtype_id, - kv_size , NULL, NULL) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't retrieve BLOB ID from parent KV store"); - - /* open the datatype */ - if (iod_obj_open_write(coh, dtype_id, NULL /*hints*/, &cur_oh, NULL) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't open datatype"); - - /* get scratch pad of the datatype */ - if(iod_obj_get_scratch(cur_oh, IOD_TID_UNKNOWN, &sp, NULL, NULL) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "can't get scratch pad for object"); - - /* open the metadata scratch pad */ - if (iod_obj_open_write(coh, sp.mdkv_id, NULL /*hints*/, &mdkv_oh, NULL) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "can't open scratch pad"); - - /* MSC - need to read datatype; size should be stored in metadata, - but since no real IOD, can't do anything now */ - -#if 0 - /*retrieve tcpl metadata from scratch pad */ - if(iod_kv_get_value(mdkv_oh, IOD_TID_UNKNOWN, "datatype_tcpl", NULL, - &output.tcpl_size, NULL, NULL) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "datatype tcpl lookup failed"); - if(NULL == (output.tcpl = H5MM_malloc (output.tcpl_size))) - HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't allocate tcpl buffer"); - if(iod_kv_get_value(mdkv_oh, IOD_TID_UNKNOWN, "datatype_tcpl", output.tcpl, - &output.tcpl_size, NULL, NULL) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "datatype tcpl lookup failed"); - - /*retrieve blob size metadata from scratch pad */ - if(iod_kv_get_value(mdkv_oh, IOD_TID_UNKNOWN, "datatype_size", &buf_size, - sizeof(iod_size_t), NULL, NULL) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "datatype size lookup failed"); - - if(NULL == (buf = malloc(buf_size))) - HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't allocate BLOB read buffer"); - - /* create memory descriptor for writing */ - mem_desc.nfrag = 1; - mem_desc.frag->addr = buf; - mem_desc.frag->len = (iod_size_t)buf_size; - - /* create file descriptor for writing */ - file_desc.nfrag = 1; - file_desc.frag->offset = 0; - file_desc.frag->len = (iod_size_t)buf_size; - - /* write the serialized type value to the BLOB object */ - if(iod_blob_write(cur_oh, IOD_TID_UNKNOWN, NULL, &mem_desc, &file_desc, NULL, NULL) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to write BLOB object"); - - /* decode the datatype */ - if((output.type_id = H5Tdecode(buf)) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to decode datatype"); - - free(buf); -#endif - - /* close the metadata scratch pad */ - if(iod_obj_close(mdkv_oh, NULL, NULL)) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't close object"); - -#if H5_DO_NATIVE - printf("datatype name %s location %d\n", name, loc_handle.cookie); - cur_oh.cookie = H5Topen(loc_handle.cookie, name, input->tapl_id); - HDassert(cur_oh.cookie); - output.type_id = cur_oh.cookie; - output.tcpl_id = H5P_DATATYPE_CREATE_DEFAULT; -#else - /* fake a type, and tcpl */ - output.type_id = H5Tcopy(H5T_NATIVE_INT); - output.tcpl_id = H5P_DATATYPE_CREATE_DEFAULT; -#endif - - output.iod_id = dtype_id; - output.iod_oh = cur_oh; - -#if H5VL_IOD_DEBUG - fprintf(stderr, "Done with dtype open, sending response to client\n"); -#endif - - HG_Handler_start_output(op_data->hg_handle, &output); - -done: - if(ret_value < 0) { - output.iod_oh.cookie = IOD_OH_UNDEFINED; - output.iod_id = IOD_ID_UNDEFINED; - HG_Handler_start_output(op_data->hg_handle, &output); - } - -#if !H5_DO_NATIVE - H5Tclose(output.type_id); -#endif - - last_comp = (char *)H5MM_xfree(last_comp); - input = (dtype_open_in_t *)H5MM_xfree(input); - op_data = (op_data_t *)H5MM_xfree(op_data); - - FUNC_LEAVE_NOAPI_VOID -} /* end H5VL_iod_server_dtype_open_cb() */ - - -/*------------------------------------------------------------------------- - * Function: H5VL_iod_server_dtype_close_cb - * - * Purpose: Closes iod HDF5 datatype. - * - * Return: Success: SUCCEED - * Failure: Negative - * - * Programmer: Mohamad Chaarawi - * April, 2013 - * - *------------------------------------------------------------------------- - */ -static void -H5VL_iod_server_dtype_close_cb(AXE_engine_t UNUSED axe_engine, - size_t UNUSED num_n_parents, AXE_task_t UNUSED n_parents[], - size_t UNUSED num_s_parents, AXE_task_t UNUSED s_parents[], - void *_op_data) -{ - op_data_t *op_data = (op_data_t *)_op_data; - dtype_close_in_t *input = (dtype_close_in_t *)op_data->input; - iod_handle_t iod_oh = input->iod_oh; - iod_obj_id_t iod_id = input->iod_id; - herr_t ret_value = SUCCEED; - - FUNC_ENTER_NOAPI_NOINIT - -#if H5VL_IOD_DEBUG - fprintf(stderr, "Start datatype Close\n"); -#endif - - if(iod_oh.cookie != IOD_OH_UNDEFINED) { -#if H5_DO_NATIVE - HDassert(H5Tclose(iod_oh.cookie) == SUCCEED); -#endif - - if((ret_value = iod_obj_close(iod_oh, NULL, NULL)) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't close object"); - } - else { - /* MSC - need a way to kill object handle for this group */ - fprintf(stderr, "I do not have the OH of this datatype to close it\n"); - } - -done: -#if H5VL_IOD_DEBUG - fprintf(stderr, "Done with dtype close, sending response to client\n"); -#endif - - HG_Handler_start_output(op_data->hg_handle, &ret_value); - - input = (dtype_close_in_t *)H5MM_xfree(input); - op_data = (op_data_t *)H5MM_xfree(op_data); - - FUNC_LEAVE_NOAPI_VOID -} /* end H5VL_iod_server_dtype_close_cb() */ - - -/*------------------------------------------------------------------------- - * Function: H5VL_iod_server_attr_create_cb - * - * Purpose: Creates a attr as a iod object. - * - * Return: Success: SUCCEED - * Failure: Negative - * - * Programmer: Mohamad Chaarawi - * April, 2013 - * - *------------------------------------------------------------------------- - */ -static void -H5VL_iod_server_attr_create_cb(AXE_engine_t UNUSED axe_engine, - size_t UNUSED num_n_parents, AXE_task_t UNUSED n_parents[], - size_t UNUSED num_s_parents, AXE_task_t UNUSED s_parents[], - void *_op_data) -{ - op_data_t *op_data = (op_data_t *)_op_data; - attr_create_in_t *input = (attr_create_in_t *)op_data->input; - attr_create_out_t output; - iod_handle_t coh = input->coh; - iod_handle_t loc_handle = input->loc_oh; - iod_obj_id_t loc_id = input->loc_id; /* The ID of the current location object */ - iod_obj_id_t attr_id = input->attr_id; /* The ID of the attribute that needs to be created */ - iod_handle_t attr_oh, attr_kv_oh, cur_oh, mdkv_oh; - iod_obj_id_t cur_id, mdkv_id; - const char *loc_name = input->path; - const char *attr_name = input->attr_name; - char *last_comp = NULL; - iod_array_struct_t array; - iod_size_t *max_dims; - iod_kv_t kv; - size_t buf_size; - scratch_pad_t sp; - iod_ret_t ret; - hbool_t collective = FALSE; /* MSC - change when we allow for collective */ - herr_t ret_value = SUCCEED; - - FUNC_ENTER_NOAPI_NOINIT - -#if H5VL_IOD_DEBUG - fprintf(stderr, "Start attribute Create %s on object path %s\n", attr_name, loc_name); -#endif - - /* the traversal will retrieve the location where the attribute needs - to be created. The traversal will fail if an intermediate group - does not exist. */ - if(H5VL_iod_server_traverse(coh, loc_id, loc_handle, loc_name, FALSE, - &last_comp, &cur_id, &cur_oh) < 0) - HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't traverse path"); - - /* Set the IOD array creation parameters */ - array.cell_size = H5Tget_size(input->type_id); - array.num_dims = H5Sget_simple_extent_ndims(input->space_id); - if(NULL == (array.current_dims = (iod_size_t *)malloc (sizeof(iod_size_t) * array.num_dims))) - HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't allocate dimention size array"); - if(NULL == (max_dims = (iod_size_t *)malloc (sizeof(iod_size_t) * array.num_dims))) - HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't allocate dimention size array"); - if(H5Sget_simple_extent_dims(input->space_id, array.current_dims, max_dims) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't get dimentions' sizes"); - array.firstdim_max = max_dims[0]; - array.chunk_dims = NULL; - array.dims_seq = NULL; - - /* create the attribute */ - ret = iod_obj_create(coh, IOD_TID_UNKNOWN, NULL/*hints*/, IOD_OBJ_ARRAY, NULL, &array, - &attr_id, NULL /*event*/); - if(collective && (0 == ret || EEXISTS == ret)) { - /* Attribute has been created by another process, open it */ - if (iod_obj_open_write(coh, attr_id, NULL, &attr_oh, NULL) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't open attribute"); - } - else if(!collective && 0 != ret) { - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't create Attribute"); - } - - /* for the process that succeeded in creating the attribute, update - the parent scratch pad, create attribute scratch pad */ - if(0 == ret) { - /* create the metadata KV object for the attribute */ - if(iod_obj_create(coh, IOD_TID_UNKNOWN, NULL, IOD_OBJ_KV, - NULL, NULL, &mdkv_id, NULL) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't create metadata KV object"); - - /* set values for the scratch pad object */ - sp.mdkv_id = mdkv_id; - sp.attr_id = IOD_ID_UNDEFINED; - sp.filler1_id = IOD_ID_UNDEFINED; - sp.filler2_id = IOD_ID_UNDEFINED; - - /* set scratch pad in attribute */ - if (iod_obj_set_scratch(attr_oh, IOD_TID_UNKNOWN, &sp, NULL, NULL) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't set scratch pad"); - - /* Store Metadata in scratch pad */ - if (iod_obj_open_write(coh, mdkv_id, NULL, &mdkv_oh, NULL) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't create scratch pad"); - - /* MSC - TODO store things */ - -#if 0 - /* insert attribute metadata into scratch pad */ - kv.key = HDstrdup("attribute_dtype"); - /* determine the buffer size needed to store the encoded type of the attribute */ - if(H5Tencode(input->type_id, NULL, &buf_size) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTENCODE, FAIL, "failed to encode attribute type"); - if(NULL == (kv.value = malloc (buf_size))) - HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't allocate type buffer"); - /* encode datatype of the attribute */ - if(H5Tencode(input->type_id, kv.value, &buf_size) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTENCODE, FAIL, "failed to encode attribute type"); - kv.value_len = (iod_size_t)buf_size; - /* insert kv pair into scratch pad */ - if (iod_kv_set(mdkv_oh, IOD_TID_UNKNOWN, NULL, &kv, NULL, NULL) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't set KV pair in parent"); - HDfree(kv.key); - free(kv.value); - - kv.key = HDstrdup("attribute_dspace"); - /* determine the buffer size needed to store the encoded space of the attribute */ - if(H5Sencode(input->space_id, NULL, &buf_size) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTENCODE, FAIL, "failed to encode attribute space"); - if(NULL == (kv.value = malloc (buf_size))) - HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't allocate space buffer"); - /* encode dataspace of the attribute */ - if(H5Sencode(input->space_id, kv.value, &buf_size) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTENCODE, FAIL, "failed to encode attribute space"); - kv.value_len = (iod_size_t)buf_size; - /* insert kv pair into scratch pad */ - if (iod_kv_set(mdkv_oh, IOD_TID_UNKNOWN, NULL, &kv, NULL, NULL) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't set KV pair in parent"); - HDfree(kv.key); - free(kv.value); -#endif - - /* close the Metadata KV object */ - if(iod_obj_close(mdkv_oh, NULL, NULL)) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't close object"); - - /* get scratch pad of the parent */ - if(iod_obj_get_scratch(cur_oh, IOD_TID_UNKNOWN, &sp, NULL, NULL) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, FAIL, "can't get scratch pad for object"); - - /* if attribute KV does not exist, create it */ - if(IOD_ID_UNDEFINED == sp.attr_id) { - /* create the attribute KV object for the parent */ - if(iod_obj_create(coh, IOD_TID_UNKNOWN, NULL, IOD_OBJ_KV, - NULL, NULL, &sp.attr_id, NULL)<0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't create Attr KV"); - - /* set scratch pad in attribute */ - if (iod_obj_set_scratch(cur_oh, IOD_TID_UNKNOWN, &sp, NULL, NULL) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't set scratch pad"); - } - - /* open the attribute KV in scratch pad */ - if (iod_obj_open_write(coh, sp.attr_id, NULL /*hints*/, &attr_kv_oh, NULL) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, FAIL, "can't open scratch pad"); - - /* insert new attribute in scratch pad of current object */ - kv.key = HDstrdup(attr_name); - kv.value = &attr_id; - kv.value_len = 0; - if (iod_kv_set(attr_kv_oh, IOD_TID_UNKNOWN, NULL, &kv, NULL, NULL) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't set KV pair in parent"); - HDfree(kv.key); - - iod_obj_close(attr_kv_oh, NULL, NULL); - } - - /* close parent group if it is not the location we started the - traversal into */ - if(loc_handle.cookie != cur_oh.cookie) { - iod_obj_close(cur_oh, NULL, NULL); - } - -#if H5_DO_NATIVE - cur_oh.cookie = H5Acreate2(cur_oh.cookie, attr_name, input->type_id, - input->space_id, H5P_DEFAULT, H5P_DEFAULT); - HDassert(cur_oh.cookie); -#endif - - output.iod_oh = cur_oh; - -#if H5VL_IOD_DEBUG - fprintf(stderr, "Done with attr create, sending response to client\n"); -#endif - - HG_Handler_start_output(op_data->hg_handle, &output); - -done: - - /* return an UNDEFINED oh to the client if the operation failed */ - if(ret_value < 0) { - output.iod_oh.cookie = IOD_OH_UNDEFINED; - HG_Handler_start_output(op_data->hg_handle, &output); - } - - if(max_dims) free(max_dims); - if(array.current_dims) free(array.current_dims); - input = (attr_create_in_t *)H5MM_xfree(input); - op_data = (op_data_t *)H5MM_xfree(op_data); - last_comp = (char *)H5MM_xfree(last_comp); - - FUNC_LEAVE_NOAPI_VOID -} /* end H5VL_iod_server_attr_create_cb() */ - - -/*------------------------------------------------------------------------- - * Function: H5VL_iod_server_attr_open_cb - * - * Purpose: Opens a attribute as a iod object. - * - * Return: Success: SUCCEED - * Failure: Negative - * - * Programmer: Mohamad Chaarawi - * April, 2013 - * - *------------------------------------------------------------------------- - */ -static void -H5VL_iod_server_attr_open_cb(AXE_engine_t UNUSED axe_engine, - size_t UNUSED num_n_parents, AXE_task_t UNUSED n_parents[], - size_t UNUSED num_s_parents, AXE_task_t UNUSED s_parents[], - void *_op_data) -{ - op_data_t *op_data = (op_data_t *)_op_data; - attr_open_in_t *input = (attr_open_in_t *)op_data->input; - attr_open_out_t output; - iod_handle_t coh = input->coh; - iod_handle_t loc_handle = input->loc_oh; - iod_obj_id_t loc_id = input->loc_id; - iod_handle_t attr_kv_oh, cur_oh, mdkv_oh; - iod_obj_id_t cur_id, mdkv_id; - iod_obj_id_t attr_id; - const char *loc_name = input->path; - const char *attr_name = input->attr_name; - char *last_comp = NULL; - scratch_pad_t sp; - herr_t ret_value = SUCCEED; - - FUNC_ENTER_NOAPI_NOINIT - -#if H5VL_IOD_DEBUG - fprintf(stderr, "Start attribute Open %s\n", attr_name); -#endif - - /* the traversal will retrieve the location where the attribute needs - to be opened. The traversal will fail if an intermediate group - does not exist. */ - if(H5VL_iod_server_traverse(coh, loc_id, loc_handle, loc_name, FALSE, - &last_comp, &cur_id, &cur_oh) < 0) - HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't traverse path"); - - /* get scratch pad of the parent */ - if(iod_obj_get_scratch(cur_oh, IOD_TID_UNKNOWN, &sp, NULL, NULL) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, FAIL, "can't get scratch pad for object"); - - /* if attribute KV does not exist, return error*/ - if(IOD_ID_UNDEFINED == sp.attr_id) - HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, FAIL, "Object has no attributes"); - - /* open the attribute KV in scratch pad */ - if (iod_obj_open_write(coh, sp.attr_id, NULL /*hints*/, &attr_kv_oh, NULL) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, FAIL, "can't open scratch pad"); - - /* get attribute ID */ - if(iod_kv_get_value(attr_kv_oh, IOD_TID_UNKNOWN, attr_name, &attr_id, - sizeof(iod_obj_id_t) , NULL, NULL) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't retrieve Array ID from parent KV store"); - - /* close parent group if it is not the location we started the - traversal into */ - if(loc_handle.cookie != cur_oh.cookie) { - iod_obj_close(cur_oh, NULL, NULL); - } - - iod_obj_close(attr_kv_oh, NULL, NULL); - - /* open the attribute */ - if (iod_obj_open_write(coh, attr_id, NULL /*hints*/, &cur_oh, NULL) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't open current group"); - - /* open the metadata scratch pad */ - if (iod_obj_open_write(coh, sp.mdkv_id, NULL /*hints*/, &mdkv_oh, NULL) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "can't open scratch pad"); - - /* MSC - retrieve all metadata from scratch pad */ - - /* close the metadata scratch pad */ - if(iod_obj_close(mdkv_oh, NULL, NULL)) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't close object"); - - { - hsize_t dims[1]; - //hid_t space_id, type_id; - -#if H5_DO_NATIVE - printf("attr name %s location %d %s\n", attr_name, loc_handle.cookie, loc_name); - if(strcmp(loc_name, ".") == 0) - cur_oh.cookie = H5Aopen(loc_handle.cookie, attr_name, H5P_DEFAULT); - else - cur_oh.cookie = H5Aopen_by_name(loc_handle.cookie, loc_name, - attr_name, H5P_DEFAULT, H5P_DEFAULT); - HDassert(cur_oh.cookie); - output.space_id = H5Aget_space(cur_oh.cookie); - output.type_id = H5Aget_type(cur_oh.cookie); - output.acpl_id = H5P_ATTRIBUTE_CREATE_DEFAULT; -#else - /* fake a dataspace, type, and dcpl */ - dims [0] = 60; - output.space_id = H5Screate_simple(1, dims, NULL); - output.type_id = H5Tcopy(H5T_NATIVE_INT); - output.acpl_id = H5P_ATTRIBUTE_CREATE_DEFAULT; -#endif - } - - output.iod_id = attr_id; - output.iod_oh = cur_oh; - -#if H5VL_IOD_DEBUG - fprintf(stderr, "Done with attr open, sending response to client\n"); -#endif - - HG_Handler_start_output(op_data->hg_handle, &output); - -done: - if(ret_value < 0) { - output.iod_oh.cookie = IOD_OH_UNDEFINED; - output.iod_id = IOD_ID_UNDEFINED; - HG_Handler_start_output(op_data->hg_handle, &output); - } - - H5Sclose(output.space_id); - H5Tclose(output.type_id); - - input = (attr_open_in_t *)H5MM_xfree(input); - op_data = (op_data_t *)H5MM_xfree(op_data); - last_comp = (char *)H5MM_xfree(last_comp); - - FUNC_LEAVE_NOAPI_VOID -} /* end H5VL_iod_server_attr_open_cb() */ - - -/*------------------------------------------------------------------------- - * Function: H5VL_iod_server_attr_read_cb - * - * Purpose: Reads from IOD into the function shipper BDS handle. - * - * Return: Success: SUCCEED - * Failure: Negative - * - * Programmer: Mohamad Chaarawi - * April, 2013 - * - *------------------------------------------------------------------------- - */ -static void -H5VL_iod_server_attr_read_cb(AXE_engine_t UNUSED axe_engine, - size_t UNUSED num_n_parents, AXE_task_t UNUSED n_parents[], - size_t UNUSED num_s_parents, AXE_task_t UNUSED s_parents[], - void *_op_data) -{ - op_data_t *op_data = (op_data_t *)_op_data; - attr_io_in_t *input = (attr_io_in_t *)op_data->input; - iod_handle_t coh = input->coh; - iod_handle_t iod_oh = input->iod_oh; - iod_obj_id_t iod_id = input->iod_id; - hg_bulk_t bulk_handle = input->bulk_handle; - hid_t type_id = input->type_id; - hg_bulk_block_t bulk_block_handle; - hg_bulk_request_t bulk_request; - iod_mem_desc_t mem_desc; - iod_array_iodesc_t file_desc; - size_t size; - void *buf; - na_addr_t dest = HG_Handler_get_addr(op_data->hg_handle); - herr_t ret_value = SUCCEED; - - FUNC_ENTER_NOAPI_NOINIT - - /* If the attribute handle and ID are not avaiable, traverse the path to obtain it */ - if(iod_id == IOD_ID_UNDEFINED) { - ;/* traverse routine */ - } - /* open the attribute if we don't have the handle yet */ - if(iod_oh.cookie == IOD_OH_UNDEFINED) { - if (iod_obj_open_write(coh, iod_id, NULL /*hints*/, &iod_oh, NULL) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't open current group"); - } - - size = HG_Bulk_handle_get_size(bulk_handle); - - if(NULL == (buf = malloc(size))) - HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't allocate read buffer"); - - mem_desc.nfrag = 1; - //mem_desc.frag[0].addr = buf; - //mem_desc.frag[0].len = (iod_size_t)size; - - /* MSC TODO - populate file location hyperslab */ - - /* read from array object */ - if(iod_array_read(iod_oh, IOD_TID_UNKNOWN, NULL, &mem_desc, &file_desc, NULL, NULL) < 0) - HGOTO_ERROR(H5E_SYM, H5E_READERROR, FAIL, "can't read from array object"); - - { - int i; - hbool_t flag; - int *buf_ptr = (int *)buf; - -#if H5_DO_NATIVE - ret_value = H5Aread(iod_oh.cookie, type_id, buf); -#else - for(i=0;i<60;++i) - buf_ptr[i] = i; -#endif - } - - /* Create a new block handle to write the data */ - HG_Bulk_block_handle_create(buf, size, HG_BULK_READ_ONLY, &bulk_block_handle); - - /* Write bulk data here and wait for the data to be there */ - if(HG_SUCCESS != HG_Bulk_write_all(dest, bulk_handle, bulk_block_handle, &bulk_request)) - HGOTO_ERROR(H5E_SYM, H5E_READERROR, FAIL, "can't read from array object"); - /* wait for it to complete */ - if(HG_SUCCESS != HG_Bulk_wait(bulk_request, HG_BULK_MAX_IDLE_TIME, HG_BULK_STATUS_IGNORE)) - HGOTO_ERROR(H5E_SYM, H5E_READERROR, FAIL, "can't read from array object"); - -done: - fprintf(stderr, "Done with attr read, sending response to client\n"); - - if(HG_SUCCESS != HG_Handler_start_output(op_data->hg_handle, &ret_value)) - HDONE_ERROR(H5E_SYM, H5E_WRITEERROR, FAIL, "can't send result of write to client"); - if(HG_SUCCESS != HG_Bulk_block_handle_free(bulk_block_handle)) - HDONE_ERROR(H5E_SYM, H5E_WRITEERROR, FAIL, "can't free bds block handle"); - - input = (attr_io_in_t *)H5MM_xfree(input); - op_data = (op_data_t *)H5MM_xfree(op_data); - free(buf); - - FUNC_LEAVE_NOAPI_VOID -} /* end H5VL_iod_server_attr_read_cb() */ - - -/*------------------------------------------------------------------------- - * Function: H5VL_iod_server_attr_write_cb - * - * Purpose: Writes from IOD into the function shipper BDS handle. - * - * Return: Success: SUCCEED - * Failure: Negative - * - * Programmer: Mohamad Chaarawi - * April, 2013 - * - *------------------------------------------------------------------------- - */ -static void -H5VL_iod_server_attr_write_cb(AXE_engine_t UNUSED axe_engine, - size_t UNUSED num_n_parents, AXE_task_t UNUSED n_parents[], - size_t UNUSED num_s_parents, AXE_task_t UNUSED s_parents[], - void *_op_data) -{ - op_data_t *op_data = (op_data_t *)_op_data; - attr_io_in_t *input = (attr_io_in_t *)op_data->input; - iod_handle_t coh = input->coh; - iod_handle_t iod_oh = input->iod_oh; - iod_obj_id_t iod_id = input->iod_id; - hg_bulk_t bulk_handle = input->bulk_handle; - hid_t type_id = input->type_id; - hg_bulk_block_t bulk_block_handle; - hg_bulk_request_t bulk_request; - iod_mem_desc_t mem_desc; - iod_array_iodesc_t file_desc; - size_t size; - void *buf; - ssize_t ret; - na_addr_t source = HG_Handler_get_addr(op_data->hg_handle); - herr_t ret_value = SUCCEED; - - FUNC_ENTER_NOAPI_NOINIT - - fprintf(stderr, "Start attribute Write\n"); - - /* If the attribute handle and ID are not avaiable, traverse the path to obtain it */ - if(iod_id == IOD_ID_UNDEFINED) { - ;/* traverse routine */ - } - /* open the attribute if we don't have the handle yet */ - if(iod_oh.cookie == IOD_OH_UNDEFINED) { - if (iod_obj_open_write(coh, iod_id, NULL /*hints*/, &iod_oh, NULL) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't open current group"); - } - - /* Read bulk data here and wait for the data to be here */ - size = HG_Bulk_handle_get_size(bulk_handle); - if(NULL == (buf = malloc(size))) - HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't allocate read buffer"); - - HG_Bulk_block_handle_create(buf, size, HG_BULK_READWRITE, &bulk_block_handle); - - /* Write bulk data here and wait for the data to be there */ - if(HG_SUCCESS != HG_Bulk_read_all(source, bulk_handle, bulk_block_handle, &bulk_request)) - HGOTO_ERROR(H5E_SYM, H5E_WRITEERROR, FAIL, "can't get data from function shipper"); - /* wait for it to complete */ - if(HG_SUCCESS != HG_Bulk_wait(bulk_request, HG_BULK_MAX_IDLE_TIME, HG_BULK_STATUS_IGNORE)) - HGOTO_ERROR(H5E_SYM, H5E_WRITEERROR, FAIL, "can't get data from function shipper"); - - /* free the bds block handle */ - if(HG_SUCCESS != HG_Bulk_block_handle_free(bulk_block_handle)) - HGOTO_ERROR(H5E_SYM, H5E_WRITEERROR, FAIL, "can't free bds block handle"); - - { - int i; - int *buf_ptr = (int *)buf; - - fprintf(stderr, "Received a buffer of size %d with values: ", size); - for(i=0;i<60;++i) - fprintf(stderr, "%d ", buf_ptr[i]); - fprintf(stderr, "\n"); - } - - mem_desc.nfrag = 1; - //mem_desc.frag[0].addr = buf; - //mem_desc.frag[0].len = (iod_size_t)size; - - /* MSC TODO - populate file location hyperslab */ - - /* write from array object */ - if(iod_array_write(iod_oh, IOD_TID_UNKNOWN, NULL, &mem_desc, &file_desc, NULL, NULL) < 0) - HGOTO_ERROR(H5E_SYM, H5E_WRITEERROR, FAIL, "can't write to array object"); - -#if H5_DO_NATIVE - ret_value = H5Awrite(iod_oh.cookie, type_id, buf); -#endif - -done: - fprintf(stderr, "Done with attr write, sending %d response to client\n", ret_value); - if(HG_SUCCESS != HG_Handler_start_output(op_data->hg_handle, &ret_value)) - HDONE_ERROR(H5E_SYM, H5E_WRITEERROR, FAIL, "can't send result of write to client"); - - input = (attr_io_in_t *)H5MM_xfree(input); - op_data = (op_data_t *)H5MM_xfree(op_data); - free(buf); - - FUNC_LEAVE_NOAPI_VOID -} /* end H5VL_iod_server_attr_write_cb() */ - - -/*------------------------------------------------------------------------- - * Function: H5VL_iod_server_attr_exists_cb - * - * Purpose: Checks if an attribute exists on object. - * - * Return: Success: SUCCEED - * Failure: Negative - * - * Programmer: Mohamad Chaarawi - * April, 2013 - * - *------------------------------------------------------------------------- - */ -static void -H5VL_iod_server_attr_exists_cb(AXE_engine_t UNUSED axe_engine, - size_t UNUSED num_n_parents, AXE_task_t UNUSED n_parents[], - size_t UNUSED num_s_parents, AXE_task_t UNUSED s_parents[], - void *_op_data) -{ - op_data_t *op_data = (op_data_t *)_op_data; - attr_op_in_t *input = (attr_op_in_t *)op_data->input; - iod_handle_t coh = input->coh; - iod_handle_t loc_handle = input->loc_oh; - iod_obj_id_t loc_id = input->loc_id; - iod_handle_t cur_oh, mdkv_oh; - iod_obj_id_t cur_id, mdkv_id; - const char *loc_name = input->path; - const char *attr_name = input->attr_name; - char *last_comp = NULL; - htri_t ret = -1; - herr_t ret_value = SUCCEED; - - FUNC_ENTER_NOAPI_NOINIT - - fprintf(stderr, "Start attribute Exists %s\n", attr_name); - - /* the traversal will retrieve the location where the attribute needs - to be checked. The traversal will fail if an intermediate group - does not exist. */ - if(H5VL_iod_server_traverse(coh, loc_id, loc_handle, loc_name, FALSE, - &last_comp, &cur_id, &cur_oh) < 0) - HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't traverse path"); - - /*MSC - check the attribute in the scratch pad KV store when it is - there */ - -#if H5_DO_NATIVE - ret = H5Aexists(loc_handle.cookie, attr_name); -#else - ret = FALSE; -#endif - -done: - fprintf(stderr, "Done with attr exists, sending response to client\n"); - HG_Handler_start_output(op_data->hg_handle, &ret); - - input = (attr_op_in_t *)H5MM_xfree(input); - op_data = (op_data_t *)H5MM_xfree(op_data); - last_comp = (char *)H5MM_xfree(last_comp); - - FUNC_LEAVE_NOAPI_VOID -} /* end H5VL_iod_server_attr_exists_cb() */ - - -/*------------------------------------------------------------------------- - * Function: H5VL_iod_server_attr_rename_cb - * - * Purpose: Renames iod HDF5 attribute. - * - * Return: Success: SUCCEED - * Failure: Negative - * - * Programmer: Mohamad Chaarawi - * April, 2013 - * - *------------------------------------------------------------------------- - */ -static void -H5VL_iod_server_attr_rename_cb(AXE_engine_t UNUSED axe_engine, - size_t UNUSED num_n_parents, AXE_task_t UNUSED n_parents[], - size_t UNUSED num_s_parents, AXE_task_t UNUSED s_parents[], - void *_op_data) -{ - op_data_t *op_data = (op_data_t *)_op_data; - attr_rename_in_t *input = (attr_rename_in_t *)op_data->input; - iod_handle_t coh = input->coh; - iod_handle_t loc_handle = input->loc_oh; - iod_obj_id_t loc_id = input->loc_id; - iod_handle_t cur_oh, mdkv_oh; - iod_obj_id_t cur_id, mdkv_id; - const char *loc_name = input->path; - const char *old_name = input->old_attr_name; - const char *new_name = input->new_attr_name; - char *last_comp = NULL; - herr_t ret_value = SUCCEED; - - FUNC_ENTER_NOAPI_NOINIT - - fprintf(stderr, "Start attribute Rename %s to %s\n", old_name, new_name); - - /* the traversal will retrieve the location where the attribute - needs to be renamed. The traversal will fail if an intermediate - group does not exist. */ - if(H5VL_iod_server_traverse(coh, loc_id, loc_handle, loc_name, FALSE, - &last_comp, &cur_id, &cur_oh) < 0) - HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't traverse path"); - - /*MSC - Rename the attribute from the scratch pad KV store when it - is there */ - -#if H5_DO_NATIVE - ret_value = H5Arename(loc_handle.cookie, old_name, new_name); -#endif - -done: - fprintf(stderr, "Done with attr rename, sending response to client\n"); - HG_Handler_start_output(op_data->hg_handle, &ret_value); - - input = (attr_rename_in_t *)H5MM_xfree(input); - op_data = (op_data_t *)H5MM_xfree(op_data); - last_comp = (char *)H5MM_xfree(last_comp); - - FUNC_LEAVE_NOAPI_VOID -} /* end H5VL_iod_server_attr_rename_cb() */ - - -/*------------------------------------------------------------------------- - * Function: H5VL_iod_server_attr_remove_cb - * - * Purpose: Removes iod HDF5 attribute. - * - * Return: Success: SUCCEED - * Failure: Negative - * - * Programmer: Mohamad Chaarawi - * April, 2013 - * - *------------------------------------------------------------------------- - */ -static void -H5VL_iod_server_attr_remove_cb(AXE_engine_t UNUSED axe_engine, - size_t UNUSED num_n_parents, AXE_task_t UNUSED n_parents[], - size_t UNUSED num_s_parents, AXE_task_t UNUSED s_parents[], - void *_op_data) -{ - op_data_t *op_data = (op_data_t *)_op_data; - attr_op_in_t *input = (attr_op_in_t *)op_data->input; - iod_handle_t coh = input->coh; - iod_handle_t loc_handle = input->loc_oh; - iod_obj_id_t loc_id = input->loc_id; - iod_handle_t cur_oh, mdkv_oh; - iod_obj_id_t cur_id, mdkv_id; - const char *loc_name = input->path; - const char *attr_name = input->attr_name; - char *last_comp = NULL; - herr_t ret_value = SUCCEED; - - FUNC_ENTER_NOAPI_NOINIT - - fprintf(stderr, "Start attribute Remove %s\n", attr_name); - - /* the traversal will retrieve the location where the attribute - needs to be removed. The traversal will fail if an intermediate - group does not exist. */ - if(H5VL_iod_server_traverse(coh, loc_id, loc_handle, loc_name, FALSE, - &last_comp, &cur_id, &cur_oh) < 0) - HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't traverse path"); - - /*MSC - Remove the attribute from the scratch pad KV store when it - is there */ - -#if H5_DO_NATIVE - ret_value = H5Adelete(loc_handle.cookie, attr_name); -#endif - -done: - fprintf(stderr, "Done with attr remove, sending response to client\n"); - HG_Handler_start_output(op_data->hg_handle, &ret_value); - - input = (attr_op_in_t *)H5MM_xfree(input); - op_data = (op_data_t *)H5MM_xfree(op_data); - last_comp = (char *)H5MM_xfree(last_comp); - - FUNC_LEAVE_NOAPI_VOID -} /* end H5VL_iod_server_attr_remove_cb() */ - - -/*------------------------------------------------------------------------- - * Function: H5VL_iod_server_attr_close_cb - * - * Purpose: Closes iod HDF5 attribute. - * - * Return: Success: SUCCEED - * Failure: Negative - * - * Programmer: Mohamad Chaarawi - * April, 2013 - * - *------------------------------------------------------------------------- - */ -static void -H5VL_iod_server_attr_close_cb(AXE_engine_t UNUSED axe_engine, - size_t UNUSED num_n_parents, AXE_task_t UNUSED n_parents[], - size_t UNUSED num_s_parents, AXE_task_t UNUSED s_parents[], - void *_op_data) -{ - op_data_t *op_data = (op_data_t *)_op_data; - attr_close_in_t *input = (attr_close_in_t *)op_data->input; - iod_handle_t iod_oh = input->iod_oh; - iod_obj_id_t iod_id = input->iod_id; - herr_t ret_value = SUCCEED; - - FUNC_ENTER_NOAPI_NOINIT - - fprintf(stderr, "Start attribute Close\n"); - - if(iod_oh.cookie != IOD_OH_UNDEFINED) { -#if H5_DO_NATIVE - HDassert(H5Aclose(iod_oh.cookie) == SUCCEED); -#endif - if((ret_value = iod_obj_close(iod_oh, NULL, NULL)) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't close object"); - } - else { - /* MSC - need a way to kill object handle for this group */ - fprintf(stderr, "I do not have the OH of this attribute to close it\n"); - } - -done: - fprintf(stderr, "Done with attr close, sending response to client\n"); - HG_Handler_start_output(op_data->hg_handle, &ret_value); - - input = (attr_close_in_t *)H5MM_xfree(input); - op_data = (op_data_t *)H5MM_xfree(op_data); - - FUNC_LEAVE_NOAPI_VOID -} /* end H5VL_iod_server_attr_close_cb() */ - - -/*------------------------------------------------------------------------- - * Function: H5VL_iod_server_link_create_cb - * - * Purpose: Creates a new link in the container (Hard or Soft). - * - * Return: Success: SUCCEED - * Failure: Negative - * - * Programmer: Mohamad Chaarawi - * May, 2013 - * - *------------------------------------------------------------------------- - */ -static void -H5VL_iod_server_link_create_cb(AXE_engine_t UNUSED axe_engine, - size_t UNUSED num_n_parents, AXE_task_t UNUSED n_parents[], - size_t UNUSED num_s_parents, AXE_task_t UNUSED s_parents[], - void *_op_data) -{ - op_data_t *op_data = (op_data_t *)_op_data; - link_create_in_t *input = (link_create_in_t *)op_data->input; - H5VL_link_create_type_t create_type = input->create_type; - iod_handle_t coh = input->coh; /* the container handle */ - iod_handle_t src_oh; /* The handle for creation src object */ - iod_obj_id_t src_id; /* The ID of the creation src object */ - iod_handle_t cur_oh; - iod_obj_id_t cur_id; - iod_obj_id_t target_id; /* The ID of the target object where link is created*/ - char *last_comp = NULL; - iod_kv_t kv; - iod_size_t kv_size = sizeof(iod_obj_id_t); - herr_t ret_value = SUCCEED; - - FUNC_ENTER_NOAPI_NOINIT - - fprintf(stderr, "Start link create\n"); - - /* the traversal will retrieve the location where the link needs - to be created from. The traversal will fail if an intermediate group - does not exist. */ - if(H5VL_iod_server_traverse(coh, input->loc_id, input->loc_oh, input->loc_name, FALSE, - &last_comp, &cur_id, &cur_oh) < 0) - HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't traverse path"); - - /* lookup group in the current location */ - if(iod_kv_get_value(cur_oh, IOD_TID_UNKNOWN, last_comp, &src_id, &kv_size, NULL, NULL) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "Intermdiate group does not exist"); - - /* close parent group if it is not the location we started the - traversal into */ - if(input->loc_oh.cookie != cur_oh.cookie) { - iod_obj_close(cur_oh, NULL, NULL); - } - - /* open the source group for link creation*/ - if (iod_obj_open_write(coh, src_id, NULL, &src_oh, NULL) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't open current group"); - - if(H5VL_LINK_CREATE_HARD == create_type) { - /* Retrieve the parent of the object where the new link points - to. The traversal must not fail. */ - if(H5VL_iod_server_traverse(coh, input->target_loc_id, input->target_loc_oh, - input->target_name, FALSE, - &last_comp, &cur_id, &cur_oh) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't traverse path"); - - /* lookup target object in the current location - the lookup - must succeed since this is a hard link. */ - if(iod_kv_get_value(cur_oh, IOD_TID_UNKNOWN, last_comp, &target_id, &kv_size, NULL, NULL) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "Intermdiate group does not exist"); - } - else if(H5VL_LINK_CREATE_SOFT == create_type) { - /* Retrieve the parent of the object where the new link points - to. The traversal must not fail. */ - if(H5VL_iod_server_traverse(coh, input->target_loc_id, input->target_loc_oh, - input->target_name, FALSE, - &last_comp, &cur_id, &cur_oh) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't traverse path"); - - /* lookup target object in the current location. The lookup - might fail since this is a soft link */ - if(iod_kv_get_value(cur_oh, IOD_TID_UNKNOWN, last_comp, - &target_id, &kv_size, NULL, NULL) < 0) { - /* the lookup failed so just insert the target_id as - undefined in the src object */ - target_id = IOD_ID_UNDEFINED; - } - } - else - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "Invalid Link type"); - - /* close parent group if it is not the location we started the - traversal into */ - if(input->loc_oh.cookie != cur_oh.cookie) { - iod_obj_close(cur_oh, NULL, NULL); - } - - /* insert new link (target group's ID) in kv store of the source object */ - kv.key = HDstrdup(last_comp); - kv.value = &target_id; - kv.value_len = kv_size; - if (iod_kv_set(src_oh, IOD_TID_UNKNOWN, NULL, &kv, NULL, NULL) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't set KV pair in parent"); - HDfree(kv.key); - - /* close the source group */ - if(src_oh.cookie != input->loc_oh.cookie) { - iod_obj_close(src_oh, NULL, NULL); - } - -#if H5_DO_NATIVE - if(H5VL_LINK_CREATE_HARD == create_type) { - if(H5Lcreate_hard(input->target_loc_oh.cookie, input->target_name, - input->loc_oh.cookie, input->loc_name, H5P_DEFAULT, H5P_DEFAULT) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't create hard link"); - } - else if(H5VL_LINK_CREATE_SOFT == create_type) { - if(H5Lcreate_soft(input->target_name, input->loc_oh.cookie, input->loc_name, - H5P_DEFAULT, H5P_DEFAULT) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't create soft link"); - } - else - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "Invalid Link type"); -#endif - -done: - fprintf(stderr, "Done with link create, sending response to client\n"); - HG_Handler_start_output(op_data->hg_handle, &ret_value); - - last_comp = (char *)H5MM_xfree(last_comp); - input = (link_create_in_t *)H5MM_xfree(input); - op_data = (op_data_t *)H5MM_xfree(op_data); - - FUNC_LEAVE_NOAPI_VOID -} /* end H5VL_iod_server_link_create_cb() */ - - -/*------------------------------------------------------------------------- - * Function: H5VL_iod_server_link_move_cb - * - * Purpose: Moves/Copies a link in the container. - * - * Return: Success: SUCCEED - * Failure: Negative - * - * Programmer: Mohamad Chaarawi - * May, 2013 - * - *------------------------------------------------------------------------- - */ -static void -H5VL_iod_server_link_move_cb(AXE_engine_t UNUSED axe_engine, - size_t UNUSED num_n_parents, AXE_task_t UNUSED n_parents[], - size_t UNUSED num_s_parents, AXE_task_t UNUSED s_parents[], - void *_op_data) -{ - op_data_t *op_data = (op_data_t *)_op_data; - link_move_in_t *input = (link_move_in_t *)op_data->input; - hbool_t copy_flag = input->copy_flag; - iod_handle_t coh = input->coh; /* the container handle */ - iod_handle_t src_oh; /* The handle for src object group */ - iod_obj_id_t src_id; /* The ID of the src object */ - iod_handle_t dst_oh; /* The handle for the dst object where link is created*/ - iod_obj_id_t dst_id; /* The ID of the dst object where link is created*/ - iod_obj_id_t obj_id; /* The ID of the object to be moved/copied */ - char *last_comp = NULL; - iod_kv_t kv; - iod_size_t kv_size = sizeof(iod_obj_id_t); - herr_t ret_value = SUCCEED; - - FUNC_ENTER_NOAPI_NOINIT - - fprintf(stderr, "Start link move\n"); - - /* the traversal will retrieve the location where the link needs - to be moved/copied from. The traversal will fail if an intermediate group - does not exist. */ - if(H5VL_iod_server_traverse(coh, input->src_loc_id, input->src_loc_oh, input->src_loc_name, - FALSE, &last_comp, &src_id, &src_oh) < 0) - HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't traverse path"); - - /* the traversal will retrieve the location where the link needs - to be moved/copied to. The traversal will fail if an intermediate group - does not exist. */ - if(H5VL_iod_server_traverse(coh, input->dst_loc_id, input->dst_loc_oh, input->dst_loc_name, - FALSE, NULL, &dst_id, &dst_oh) < 0) - HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't traverse path"); - - /* lookup object ID in the current src location */ - if(iod_kv_get_value(src_oh, IOD_TID_UNKNOWN, last_comp, &obj_id, &kv_size, NULL, NULL) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "Object does not exist in source path"); - - /* Insert object in the destination path */ - kv.key = HDstrdup(last_comp); - kv.value = &obj_id; - kv.value_len = kv_size; - if (iod_kv_set(dst_oh, IOD_TID_UNKNOWN, NULL, &kv, NULL, NULL) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't set KV pair in parent"); - - /* if the operation type is a Move, remove the KV pair from the source object */ - if(!copy_flag) { - iod_kv_params_t kvs; - - kvs.kv = &kv; - if(iod_kv_unlink_keys(src_oh,IOD_TID_UNKNOWN, NULL, 1, &kvs, NULL) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTDEC, FAIL, "Unable to unlink KV pair");; - } - - HDfree(kv.key); - - /* close source group if it is not the location we started the - traversal into */ - if(input->src_loc_oh.cookie != src_oh.cookie) { - iod_obj_close(src_oh, NULL, NULL); - } - - /* close parent group if it is not the location we started the - traversal into */ - if(input->dst_loc_oh.cookie != dst_oh.cookie) { - iod_obj_close(dst_oh, NULL, NULL); - } - -#if H5_DO_NATIVE - if(copy_flag) { - if(H5Lcopy(input->src_loc_oh.cookie, input->src_loc_name, - input->dst_loc_oh.cookie, input->dst_loc_name, - H5P_DEFAULT, H5P_DEFAULT) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't create hard link"); - } - else { - if(H5Lmove(input->src_loc_oh.cookie, input->src_loc_name, - input->dst_loc_oh.cookie, input->dst_loc_name, - H5P_DEFAULT, H5P_DEFAULT) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't create hard link"); - } -#endif - -done: - fprintf(stderr, "Done with link move, sending response to client\n"); - HG_Handler_start_output(op_data->hg_handle, &ret_value); - - last_comp = (char *)H5MM_xfree(last_comp); - input = (link_move_in_t *)H5MM_xfree(input); - op_data = (op_data_t *)H5MM_xfree(op_data); - - FUNC_LEAVE_NOAPI_VOID -} /* end H5VL_iod_server_link_move_cb() */ - - -/*------------------------------------------------------------------------- - * Function: H5VL_iod_server_link_exists_cb - * - * Purpose: Checks if a link exists. - * - * Return: Success: SUCCEED - * Failure: Negative - * - * Programmer: Mohamad Chaarawi - * May, 2013 - * - *------------------------------------------------------------------------- - */ -static void -H5VL_iod_server_link_exists_cb(AXE_engine_t UNUSED axe_engine, - size_t UNUSED num_n_parents, AXE_task_t UNUSED n_parents[], - size_t UNUSED num_s_parents, AXE_task_t UNUSED s_parents[], - void *_op_data) -{ - op_data_t *op_data = (op_data_t *)_op_data; - link_op_in_t *input = (link_op_in_t *)op_data->input; - iod_handle_t coh = input->coh; - iod_handle_t loc_oh = input->loc_oh; - iod_obj_id_t loc_id = input->loc_id; - iod_handle_t cur_oh; - iod_obj_id_t cur_id; - const char *loc_name = input->path; - char *last_comp = NULL; - htri_t ret = -1; - iod_size_t kv_size = sizeof(iod_obj_id_t); - herr_t ret_value = SUCCEED; - - FUNC_ENTER_NOAPI_NOINIT - - fprintf(stderr, "Start link Exists\n"); - - /* the traversal will retrieve the location where the link needs - to be checked */ - if(H5VL_iod_server_traverse(coh, loc_id, loc_oh, loc_name, FALSE, - &last_comp, &cur_id, &cur_oh) < 0) { - ret = FALSE; - HGOTO_DONE(SUCCEED); - } - - /* check the last component */ - if(iod_kv_get_value(cur_oh, IOD_TID_UNKNOWN, last_comp, - &cur_id, &kv_size, NULL, NULL) < 0) { - ret = FALSE; - } /* end if */ - else { - ret = TRUE; - } - -#if H5_DO_NATIVE - ret = H5Lexists(loc_oh.cookie, loc_name, H5P_DEFAULT); -#else - ret = FALSE; -#endif - -done: - - /* close parent group if it is not the location we started the - traversal into */ - if(loc_oh.cookie != IOD_OH_UNDEFINED && input->loc_oh.cookie != loc_oh.cookie) { - iod_obj_close(loc_oh, NULL, NULL); - } - - fprintf(stderr, "Done with link exists, sending response to client\n"); - HG_Handler_start_output(op_data->hg_handle, &ret); - - input = (link_op_in_t *)H5MM_xfree(input); - op_data = (op_data_t *)H5MM_xfree(op_data); - last_comp = (char *)H5MM_xfree(last_comp); - - FUNC_LEAVE_NOAPI_VOID -} /* end H5VL_iod_server_link_exists_cb() */ - - -/*------------------------------------------------------------------------- - * Function: H5VL_iod_server_link_remove_cb - * - * Purpose: Removes a link from a container. - * - * Return: Success: SUCCEED - * Failure: Negative - * - * Programmer: Mohamad Chaarawi - * May, 2013 - * - *------------------------------------------------------------------------- - */ -static void -H5VL_iod_server_link_remove_cb(AXE_engine_t UNUSED axe_engine, - size_t UNUSED num_n_parents, AXE_task_t UNUSED n_parents[], - size_t UNUSED num_s_parents, AXE_task_t UNUSED s_parents[], - void *_op_data) -{ - op_data_t *op_data = (op_data_t *)_op_data; - link_op_in_t *input = (link_op_in_t *)op_data->input; - iod_handle_t coh = input->coh; - iod_handle_t loc_oh = input->loc_oh; - iod_obj_id_t loc_id = input->loc_id; - iod_handle_t cur_oh; - iod_obj_id_t cur_id, obj_id; - const char *loc_name = input->path; - char *last_comp = NULL; - iod_kv_params_t kvs; - iod_kv_t kv; - iod_size_t kv_size = sizeof(iod_obj_id_t); - herr_t ret_value = SUCCEED; - - FUNC_ENTER_NOAPI_NOINIT - - fprintf(stderr, "Start link Remove\n"); - - /* the traversal will retrieve the location where the link needs - to be removed. The traversal will fail if an intermediate group - does not exist. */ - if(H5VL_iod_server_traverse(coh, loc_id, loc_oh, loc_name, - FALSE, &last_comp, &cur_id, &cur_oh) < 0) - HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't traverse path"); - - /* lookup object ID in the current location */ - if(iod_kv_get_value(cur_oh, IOD_TID_UNKNOWN, last_comp, &obj_id, &kv_size, NULL, NULL) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "Object does not exist in source path"); - - /* unlink object from conainer */ - kv.key = HDstrdup(last_comp); - kv.value = &obj_id; - kv.value_len = kv_size; - kvs.kv = &kv; - if(iod_kv_unlink_keys(cur_oh, IOD_TID_UNKNOWN, NULL, 1, &kvs, NULL) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTDEC, FAIL, "Unable to unlink KV pair"); - HDfree(kv.key); - - /* close location object */ - if(input->loc_oh.cookie != cur_oh.cookie) { - iod_obj_close(cur_oh, NULL, NULL); - } - -#if H5_DO_NATIVE - if(H5Ldelete(loc_oh.cookie, loc_name, H5P_DEFAULT) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTDEC, FAIL, "Unable to unlink KV pair"); -#endif - -done: - fprintf(stderr, "Done with link remove, sending response to client\n"); - HG_Handler_start_output(op_data->hg_handle, &ret_value); - - last_comp = (char *)H5MM_xfree(last_comp); - input = (link_op_in_t *)H5MM_xfree(input); - op_data = (op_data_t *)H5MM_xfree(op_data); - - FUNC_LEAVE_NOAPI_VOID -} /* end H5VL_iod_server_link_remove_cb() */ - - -/*------------------------------------------------------------------------- - * Function: H5VL_iod_server_object_open_cb - * - * Purpose: Opens an existing object in the container - * - * Return: Success: SUCCEED - * Failure: Negative - * - * Programmer: Mohamad Chaarawi - * May, 2013 - * - *------------------------------------------------------------------------- - */ -static void -H5VL_iod_server_object_open_cb(AXE_engine_t UNUSED axe_engine, - size_t UNUSED num_n_parents, AXE_task_t UNUSED n_parents[], - size_t UNUSED num_s_parents, AXE_task_t UNUSED s_parents[], - void *_op_data) -{ - op_data_t *op_data = (op_data_t *)_op_data; - object_op_in_t *input = (object_op_in_t *)op_data->input; - object_open_out_t output; - iod_handle_t coh = input->coh; /* the container handle */ - iod_handle_t obj_oh; /* The handle for object */ - iod_obj_id_t obj_id; /* The ID of the object */ - iod_handle_t cur_oh; - iod_obj_id_t cur_id; - char *last_comp = NULL; - iod_kv_t kv; - iod_size_t kv_size = sizeof(iod_obj_id_t); - herr_t ret_value = SUCCEED; - - FUNC_ENTER_NOAPI_NOINIT - - fprintf(stderr, "Start Object Open\n"); - - /* the traversal will retrieve the location where the object needs - to be opened to be created from. The traversal will fail if an - intermediate group does not exist. */ - if(H5VL_iod_server_traverse(coh, input->loc_id, input->loc_oh, input->loc_name, FALSE, - last_comp, &cur_id, &cur_oh) < 0) - HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't traverse path"); - - /* lookup object in the current location */ - if(iod_kv_get_value(cur_oh, IOD_TID_UNKNOWN, last_comp, &obj_id, &kv_size, NULL, NULL) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "Intermdiate group does not exist"); - - /* close parent group if it is not the location we started the - traversal into */ - if(input->loc_oh.cookie != cur_oh.cookie) { - iod_obj_close(cur_oh, NULL, NULL); - } - - /* open the object */ - if (iod_obj_open_write(coh, obj_id, NULL, &obj_oh, NULL) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't open current group"); - -#if 0 - /* When we have a real IOD, open the scratch pad and read the - object's metadata */ -#endif - -#if H5_DO_NATIVE - obj_oh.cookie = H5Oopen(input->loc_oh.cookie, input->loc_name, H5P_DEFAULT); - output.obj_type = H5Iget_type(obj_oh.cookie); - switch(output.obj_type){ - case H5I_GROUP: - output.cpl_id = H5P_GROUP_CREATE_DEFAULT; - output.type_id = 0; - output.space_id = 0; - break; - case H5I_DATASET: - output.cpl_id = H5P_DATASET_CREATE_DEFAULT; - output.type_id = H5Dget_type(obj_oh.cookie); - output.space_id = H5Dget_space(obj_oh.cookie); - break; - case H5I_DATATYPE: - output.cpl_id = H5P_DATATYPE_CREATE_DEFAULT; - output.type_id = obj_oh.cookie; - output.space_id = 0; - break; - default: - HGOTO_ERROR(H5E_ARGS, H5E_CANTINIT, FAIL, "not a valid object (dataset, group, or datatype)") - } -#else - /* Fake something */ - output.obj_type = H5I_GROUP; - output.cpl_id = H5P_GROUP_CREATE_DEFAULT; - output.type_id = 0; - output.space_id = 0; -#endif - - output.iod_id = obj_id; - output.iod_oh = obj_oh; - - fprintf(stderr, "Done with object open, sending response to client\n"); - HG_Handler_start_output(op_data->hg_handle, &output); - -done: - if(ret_value < 0) { - output.iod_oh.cookie = IOD_OH_UNDEFINED; - output.iod_id = IOD_ID_UNDEFINED; - output.cpl_id = H5P_GROUP_CREATE_DEFAULT; - HG_Handler_start_output(op_data->hg_handle, &output); - } - - switch(output.obj_type){ - case H5I_GROUP: - break; - case H5I_DATASET: -#if H5_DO_NATIVE - H5Tclose(output.type_id); - H5Sclose(output.space_id); -#endif - break; - case H5I_DATATYPE: - break; - default: - HGOTO_ERROR(H5E_ARGS, H5E_CANTINIT, FAIL, "not a valid object (dataset, group, or datatype)") - } - - last_comp = (char *)H5MM_xfree(last_comp); - input = (object_op_in_t *)H5MM_xfree(input); - op_data = (op_data_t *)H5MM_xfree(op_data); - - FUNC_LEAVE_NOAPI_VOID -} /* end H5VL_iod_server_object_open_cb() */ - - -/*------------------------------------------------------------------------- - * Function: H5VL_iod_server_object_copy_cb - * - * Purpose: Moves/Copies a link in the container. - * - * Return: Success: SUCCEED - * Failure: Negative - * - * Programmer: Mohamad Chaarawi - * May, 2013 - * - *------------------------------------------------------------------------- - */ -static void -H5VL_iod_server_object_copy_cb(AXE_engine_t UNUSED axe_engine, - size_t UNUSED num_n_parents, AXE_task_t UNUSED n_parents[], - size_t UNUSED num_s_parents, AXE_task_t UNUSED s_parents[], - void *_op_data) -{ - op_data_t *op_data = (op_data_t *)_op_data; - object_copy_in_t *input = (object_copy_in_t *)op_data->input; - iod_handle_t coh = input->coh; /* the container handle */ - iod_handle_t src_oh; /* The handle for src object group */ - iod_obj_id_t src_id; /* The ID of the src object */ - iod_handle_t dst_oh; /* The handle for the dst object where link is created*/ - iod_obj_id_t dst_id; /* The ID of the dst object where link is created*/ - iod_obj_id_t obj_id; /* The ID of the object to be moved/copied */ - char *last_comp = NULL, *new_name; - iod_kv_t kv; - iod_size_t kv_size = sizeof(iod_obj_id_t); - herr_t ret_value = SUCCEED; - - FUNC_ENTER_NOAPI_NOINIT - - fprintf(stderr, "Start object copy\n"); - - /* the traversal will retrieve the location where the object - exists. The traversal will fail if an intermediate group does - not exist. */ - if(H5VL_iod_server_traverse(coh, input->src_loc_id, input->src_loc_oh, input->src_loc_name, - FALSE, &last_comp, &src_id, &src_oh) < 0) - HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't traverse path"); - - /* the traversal will retrieve the location where the objects - needs to be copied to. The traversal will fail if an - intermediate group does not exist. */ - if(H5VL_iod_server_traverse(coh, input->dst_loc_id, input->dst_loc_oh, input->dst_loc_name, - FALSE, &new_name, &dst_id, &dst_oh) < 0) - HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't traverse path"); - - /* lookup object ID in the current src location */ - if(iod_kv_get_value(src_oh, IOD_TID_UNKNOWN, last_comp, &obj_id, &kv_size, NULL, NULL) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "Object does not exist in source path"); - - /* create new object as a copy of the source object */ - /* MSC - wait to see if IOD will have an object copy */ - - /* Insert object in the destination path */ - kv.key = HDstrdup(new_name); - kv.value = &obj_id; - kv.value_len = kv_size; - if (iod_kv_set(dst_oh, IOD_TID_UNKNOWN, NULL, &kv, NULL, NULL) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't set KV pair in parent"); - HDfree(kv.key); - - /* close source group if it is not the location we started the - traversal into */ - if(input->src_loc_oh.cookie != src_oh.cookie) { - iod_obj_close(src_oh, NULL, NULL); - } - - /* close dst group if it is not the location we started the - traversal into */ - if(input->dst_loc_oh.cookie != dst_oh.cookie) { - iod_obj_close(dst_oh, NULL, NULL); - } - -#if H5_DO_NATIVE - if(H5Ocopy(input->src_loc_oh.cookie, input->src_loc_name, - input->dst_loc_oh.cookie, input->dst_loc_name, - H5P_DEFAULT, H5P_DEFAULT) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't copy object"); -#endif - -done: - fprintf(stderr, "Done with object Copy, sending response to client\n"); - HG_Handler_start_output(op_data->hg_handle, &ret_value); - - last_comp = (char *)H5MM_xfree(last_comp); - if(new_name) - free(new_name); - input = (object_copy_in_t *)H5MM_xfree(input); - op_data = (op_data_t *)H5MM_xfree(op_data); - - FUNC_LEAVE_NOAPI_VOID -} /* end H5VL_iod_server_object_copy_cb() */ - - -/*------------------------------------------------------------------------- - * Function: H5VL_iod_server_object_exists_cb - * - * Purpose: Checks if an object exists. - * - * Return: Success: SUCCEED - * Failure: Negative - * - * Programmer: Mohamad Chaarawi - * May, 2013 - * - *------------------------------------------------------------------------- - */ -static void -H5VL_iod_server_object_exists_cb(AXE_engine_t UNUSED axe_engine, - size_t UNUSED num_n_parents, AXE_task_t UNUSED n_parents[], - size_t UNUSED num_s_parents, AXE_task_t UNUSED s_parents[], - void *_op_data) -{ - op_data_t *op_data = (op_data_t *)_op_data; - object_op_in_t *input = (object_op_in_t *)op_data->input; - iod_handle_t coh = input->coh; - iod_handle_t loc_oh = input->loc_oh; - iod_obj_id_t loc_id = input->loc_id; - iod_handle_t cur_oh; - iod_obj_id_t cur_id; - const char *loc_name = input->loc_name; - char *last_comp = NULL; - htri_t ret = -1; - iod_size_t kv_size = sizeof(iod_obj_id_t); - herr_t ret_value = SUCCEED; - - FUNC_ENTER_NOAPI_NOINIT - - fprintf(stderr, "Start Object Exists\n"); - - /* the traversal will retrieve the location where the object needs - to be checked */ - if(H5VL_iod_server_traverse(coh, loc_id, loc_oh, loc_name, FALSE, - &last_comp, &cur_id, &cur_oh) < 0) { - ret = FALSE; - HGOTO_DONE(SUCCEED); - } - - /* check the last component */ - if(iod_kv_get_value(cur_oh, IOD_TID_UNKNOWN, last_comp, - &cur_id, &kv_size, NULL, NULL) < 0) { - ret = FALSE; - } /* end if */ - else { - iod_handle_t obj_oh; - /* try to open the object */ - if (iod_obj_open_write(coh, cur_id, NULL, &obj_oh, NULL) < 0) { - ret = FALSE; - HGOTO_DONE(SUCCEED); - } - else { - /* close the object */ - iod_obj_close(obj_oh, NULL, NULL); - ret = TRUE; - } - } - -#if H5_DO_NATIVE - ret = H5Oexists_by_name(loc_oh.cookie, loc_name, H5P_DEFAULT); -#else - ret = FALSE; -#endif - -done: - - /* close parent group if it is not the location we started the - traversal into */ - if(loc_oh.cookie != IOD_OH_UNDEFINED && input->loc_oh.cookie != loc_oh.cookie) { - iod_obj_close(loc_oh, NULL, NULL); - } - - fprintf(stderr, "Done with Object exists, sending response to client\n"); - HG_Handler_start_output(op_data->hg_handle, &ret); - - input = (object_op_in_t *)H5MM_xfree(input); - op_data = (op_data_t *)H5MM_xfree(op_data); - last_comp = (char *)H5MM_xfree(last_comp); - - FUNC_LEAVE_NOAPI_VOID -} /* end H5VL_iod_server_object_exists_cb() */ - - -/*------------------------------------------------------------------------- - * Function: H5VL_iod_server_object_set_comment_cb - * - * Purpose: Set comment for an object. - * - * Return: Success: SUCCEED - * Failure: Negative - * - * Programmer: Mohamad Chaarawi - * May, 2013 - * - *------------------------------------------------------------------------- - */ -static void -H5VL_iod_server_object_set_comment_cb(AXE_engine_t UNUSED axe_engine, - size_t UNUSED num_n_parents, AXE_task_t UNUSED n_parents[], - size_t UNUSED num_s_parents, AXE_task_t UNUSED s_parents[], - void *_op_data) -{ - op_data_t *op_data = (op_data_t *)_op_data; - object_set_comment_in_t *input = (object_set_comment_in_t *)op_data->input; - iod_handle_t coh = input->coh; - iod_handle_t loc_oh = input->loc_oh; - iod_obj_id_t loc_id = input->loc_id; - iod_handle_t cur_oh; - iod_obj_id_t cur_id, obj_id; - const char *loc_name = input->path; - const char *comment = input->comment; - char *last_comp = NULL; - iod_kv_params_t kvs; - iod_kv_t kv; - iod_size_t kv_size = sizeof(iod_obj_id_t); - herr_t ret_value = SUCCEED; - - FUNC_ENTER_NOAPI_NOINIT - - fprintf(stderr, "Start Object set comment: %s on %s\n", comment, loc_name); - - /* the traversal will retrieve the location where the link needs - to be removed. The traversal will fail if an intermediate group - does not exist. */ - if(H5VL_iod_server_traverse(coh, loc_id, loc_oh, loc_name, - FALSE, &last_comp, &cur_id, &cur_oh) < 0) - HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't traverse path"); - - /* lookup object ID in the current location */ - if(iod_kv_get_value(cur_oh, IOD_TID_UNKNOWN, last_comp, &obj_id, &kv_size, NULL, NULL) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "Object does not exist in source path"); - - /* Open object */ - /* retrieve scratch pad */ - /* open scratch pad */ - /* update scratch pad with comment */ - /* close scratch pad and object */ - -#if H5_DO_NATIVE - if(H5Oset_comment(loc_oh.cookie, comment) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "Unable to set object comment"); -#endif - -done: - fprintf(stderr, "Done with set comment, sending response to client\n"); - HG_Handler_start_output(op_data->hg_handle, &ret_value); - - last_comp = (char *)H5MM_xfree(last_comp); - input = (object_set_comment_in_t *)H5MM_xfree(input); - op_data = (op_data_t *)H5MM_xfree(op_data); - - FUNC_LEAVE_NOAPI_VOID -} /* end H5VL_iod_server_object_set_comment_cb() */ - - -/*------------------------------------------------------------------------- - * Function: H5VL_iod_server_object_get_comment_cb - * - * Purpose: Get comment for an object. - * - * Return: Success: SUCCEED - * Failure: Negative - * - * Programmer: Mohamad Chaarawi - * May, 2013 - * - *------------------------------------------------------------------------- - */ -static void -H5VL_iod_server_object_get_comment_cb(AXE_engine_t UNUSED axe_engine, - size_t UNUSED num_n_parents, AXE_task_t UNUSED n_parents[], - size_t UNUSED num_s_parents, AXE_task_t UNUSED s_parents[], - void *_op_data) -{ - op_data_t *op_data = (op_data_t *)_op_data; - object_get_comment_in_t *input = (object_get_comment_in_t *)op_data->input; - object_get_comment_out_t output; - name_t comment; - iod_handle_t coh = input->coh; - iod_handle_t loc_oh = input->loc_oh; - iod_obj_id_t loc_id = input->loc_id; - size_t length = input->length; - iod_handle_t cur_oh; - iod_obj_id_t cur_id, obj_id; - const char *loc_name = input->path; - char *last_comp = NULL; - iod_kv_params_t kvs; - iod_kv_t kv; - iod_size_t kv_size = sizeof(iod_obj_id_t); - ssize_t size = 0; - herr_t ret_value = SUCCEED; - - FUNC_ENTER_NOAPI_NOINIT - - fprintf(stderr, "Start Object get comment on %s\n", loc_name); - - /* the traversal will retrieve the location where the link needs - to be removed. The traversal will fail if an intermediate group - does not exist. */ - if(H5VL_iod_server_traverse(coh, loc_id, loc_oh, loc_name, - FALSE, &last_comp, &cur_id, &cur_oh) < 0) - HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't traverse path"); - - /* lookup object ID in the current location */ - if(iod_kv_get_value(cur_oh, IOD_TID_UNKNOWN, last_comp, &obj_id, &kv_size, NULL, NULL) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "Object does not exist in source path"); - - /* Open object */ - /* retrieve scratch pad */ - /* open scratch pad */ - /* get comment */ - /* close scratch pad and object */ - - comment.value_size = (ssize_t *)malloc(sizeof(ssize_t)); - comment.value = NULL; - comment.size = length; - -#if H5_DO_NATIVE - if(0 != length) { - size = H5Oget_comment(loc_oh.cookie, NULL, length); - comment.value = malloc(size); - } - if((size = H5Oget_comment(loc_oh.cookie, comment.value, length)) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "Unable to get object comment"); -#else - if(length) { - comment.value = strdup("fake comment"); - size = strlen(comment.value) + 1; - } - else - size = 22; -#endif - - *comment.value_size = size; - -done: - output.ret = ret_value; - output.name = comment; - - fprintf(stderr, "Done with get comment, sending response to client\n"); - HG_Handler_start_output(op_data->hg_handle, &output); - - if(comment.value) - free(comment.value); - free(comment.value_size); - - last_comp = (char *)H5MM_xfree(last_comp); - input = (object_get_comment_in_t *)H5MM_xfree(input); - op_data = (op_data_t *)H5MM_xfree(op_data); - - FUNC_LEAVE_NOAPI_VOID -} /* end H5VL_iod_server_object_get_comment_cb() */ - -static herr_t +herr_t H5VL_iod_server_traverse(iod_handle_t coh, iod_obj_id_t loc_id, iod_handle_t loc_handle, const char *path, hbool_t create_interm_grps, char **last_comp, iod_obj_id_t *iod_id, iod_handle_t *iod_oh) @@ -6218,8 +2437,9 @@ H5VL_iod_server_traverse(iod_handle_t coh, iod_obj_id_t loc_id, iod_handle_t loc /* Check if this is the last component of the path */ if(!((s = H5G__component(path + nchars, NULL)) && *s)) { - if(last_comp) + if(last_comp) { *last_comp = HDstrdup(comp); + } break; } diff --git a/src/H5VLiod_server.h b/src/H5VLiod_server.h index 9700a34..c7705b0 100644 --- a/src/H5VLiod_server.h +++ b/src/H5VLiod_server.h @@ -21,9 +21,12 @@ #include "H5VLiod_common.h" -#ifdef H5_HAVE_EFF +#ifdef H5_HAVE_EFF +#define EEXISTS 1 +#define H5_DO_NATIVE 0 +#define DEBUG_COMPACTOR 1 /* the AXE op data strucutre stored with every operation */ typedef struct op_data_t { @@ -40,6 +43,12 @@ typedef struct scratch_pad_t { } scratch_pad_t; +#if DEBUG_COMPACTOR +FILE *fp; +#endif + +int compactor_queue_flag; +pthread_mutex_t lock; H5_DLL int H5VL_iod_server_eff_init(hg_handle_t handle); H5_DLL int H5VL_iod_server_eff_finalize(hg_handle_t handle); @@ -83,5 +92,150 @@ H5_DLL int H5VL_iod_server_object_get_comment(hg_handle_t handle); H5_DLL int H5VL_iod_server_dset_compactor(op_data_t *op_data, int request_type); + +H5_DLL void H5VL_iod_server_dset_compactor_cb(AXE_engine_t axe_engine, + size_t num_n_parents, AXE_task_t n_parents[], + size_t num_s_parents, AXE_task_t s_parents[], + void *queue); + + +H5_DLL void H5VL_iod_server_file_create_cb(AXE_engine_t axe_engine, + size_t num_n_parents, AXE_task_t n_parents[], + size_t num_s_parents, AXE_task_t s_parents[], + void *op_data); +H5_DLL void H5VL_iod_server_file_open_cb(AXE_engine_t axe_engine, + size_t num_n_parents, AXE_task_t n_parents[], + size_t num_s_parents, AXE_task_t s_parents[], + void *op_data); +H5_DLL void H5VL_iod_server_file_close_cb(AXE_engine_t axe_engine, + size_t num_n_parents, AXE_task_t n_parents[], + size_t num_s_parents, AXE_task_t s_parents[], + void *op_data); +H5_DLL void H5VL_iod_server_file_flush_cb(AXE_engine_t axe_engine, + size_t num_n_parents, AXE_task_t n_parents[], + size_t num_s_parents, AXE_task_t s_parents[], + void *op_data); +H5_DLL void H5VL_iod_server_attr_create_cb(AXE_engine_t axe_engine, + size_t num_n_parents, AXE_task_t n_parents[], + size_t num_s_parents, AXE_task_t s_parents[], + void *op_data); +H5_DLL void H5VL_iod_server_attr_open_cb(AXE_engine_t axe_engine, + size_t num_n_parents, AXE_task_t n_parents[], + size_t num_s_parents, AXE_task_t s_parents[], + void *op_data); +H5_DLL void H5VL_iod_server_attr_read_cb(AXE_engine_t axe_engine, + size_t num_n_parents, AXE_task_t n_parents[], + size_t num_s_parents, AXE_task_t s_parents[], + void *op_data); +H5_DLL void H5VL_iod_server_attr_write_cb(AXE_engine_t axe_engine, + size_t num_n_parents, AXE_task_t n_parents[], + size_t num_s_parents, AXE_task_t s_parents[], + void *op_data); +H5_DLL void H5VL_iod_server_attr_exists_cb(AXE_engine_t axe_engine, + size_t num_n_parents, AXE_task_t n_parents[], + size_t num_s_parents, AXE_task_t s_parents[], + void *op_data); +H5_DLL void H5VL_iod_server_attr_rename_cb(AXE_engine_t axe_engine, + size_t num_n_parents, AXE_task_t n_parents[], + size_t num_s_parents, AXE_task_t s_parents[], + void *op_data); +H5_DLL void H5VL_iod_server_attr_remove_cb(AXE_engine_t axe_engine, + size_t num_n_parents, AXE_task_t n_parents[], + size_t num_s_parents, AXE_task_t s_parents[], + void *op_data); +H5_DLL void H5VL_iod_server_attr_close_cb(AXE_engine_t axe_engine, + size_t num_n_parents, AXE_task_t n_parents[], + size_t num_s_parents, AXE_task_t s_parents[], + void *op_data); +H5_DLL void H5VL_iod_server_group_create_cb(AXE_engine_t axe_engine, + size_t num_n_parents, AXE_task_t n_parents[], + size_t num_s_parents, AXE_task_t s_parents[], + void *op_data); +H5_DLL void H5VL_iod_server_group_open_cb(AXE_engine_t axe_engine, + size_t num_n_parents, AXE_task_t n_parents[], + size_t num_s_parents, AXE_task_t s_parents[], + void *op_data); +H5_DLL void H5VL_iod_server_group_close_cb(AXE_engine_t axe_engine, + size_t num_n_parents, AXE_task_t n_parents[], + size_t num_s_parents, AXE_task_t s_parents[], + void *op_data); +H5_DLL void H5VL_iod_server_dset_create_cb(AXE_engine_t axe_engine, + size_t num_n_parents, AXE_task_t n_parents[], + size_t num_s_parents, AXE_task_t s_parents[], + void *op_data); +H5_DLL void H5VL_iod_server_dset_open_cb(AXE_engine_t axe_engine, + size_t num_n_parents, AXE_task_t n_parents[], + size_t num_s_parents, AXE_task_t s_parents[], + void *op_data); +H5_DLL void H5VL_iod_server_dset_read_cb(AXE_engine_t axe_engine, + size_t num_n_parents, AXE_task_t n_parents[], + size_t num_s_parents, AXE_task_t s_parents[], + void *op_data); +H5_DLL void H5VL_iod_server_dset_write_cb(AXE_engine_t axe_engine, + size_t num_n_parents, AXE_task_t n_parents[], + size_t num_s_parents, AXE_task_t s_parents[], + void *op_data); +H5_DLL void H5VL_iod_server_dset_set_extent_cb(AXE_engine_t axe_engine, + size_t num_n_parents, AXE_task_t n_parents[], + size_t num_s_parents, AXE_task_t s_parents[], + void *op_data); +H5_DLL void H5VL_iod_server_dset_close_cb(AXE_engine_t axe_engine, + size_t num_n_parents, AXE_task_t n_parents[], + size_t num_s_parents, AXE_task_t s_parents[], + void *op_data); +H5_DLL void H5VL_iod_server_dtype_commit_cb(AXE_engine_t axe_engine, + size_t num_n_parents, AXE_task_t n_parents[], + size_t num_s_parents, AXE_task_t s_parents[], + void *op_data); +H5_DLL void H5VL_iod_server_dtype_open_cb(AXE_engine_t axe_engine, + size_t num_n_parents, AXE_task_t n_parents[], + size_t num_s_parents, AXE_task_t s_parents[], + void *op_data); +H5_DLL void H5VL_iod_server_dtype_close_cb(AXE_engine_t axe_engine, + size_t num_n_parents, AXE_task_t n_parents[], + size_t num_s_parents, AXE_task_t s_parents[], + void *op_data); +H5_DLL void H5VL_iod_server_link_create_cb(AXE_engine_t axe_engine, + size_t num_n_parents, AXE_task_t n_parents[], + size_t num_s_parents, AXE_task_t s_parents[], + void *op_data); +H5_DLL void H5VL_iod_server_link_move_cb(AXE_engine_t axe_engine, + size_t num_n_parents, AXE_task_t n_parents[], + size_t num_s_parents, AXE_task_t s_parents[], + void *op_data); +H5_DLL void H5VL_iod_server_link_exists_cb(AXE_engine_t axe_engine, + size_t num_n_parents, AXE_task_t n_parents[], + size_t num_s_parents, AXE_task_t s_parents[], + void *op_data); +H5_DLL void H5VL_iod_server_link_remove_cb(AXE_engine_t axe_engine, + size_t num_n_parents, AXE_task_t n_parents[], + size_t num_s_parents, AXE_task_t s_parents[], + void *op_data); + +H5_DLL void H5VL_iod_server_object_open_cb(AXE_engine_t axe_engine, + size_t num_n_parents, AXE_task_t n_parents[], + size_t num_s_parents, AXE_task_t s_parents[], + void *op_data); +H5_DLL void H5VL_iod_server_object_copy_cb(AXE_engine_t axe_engine, + size_t num_n_parents, AXE_task_t n_parents[], + size_t num_s_parents, AXE_task_t s_parents[], + void *op_data); +H5_DLL void H5VL_iod_server_object_exists_cb(AXE_engine_t axe_engine, + size_t num_n_parents, AXE_task_t n_parents[], + size_t num_s_parents, AXE_task_t s_parents[], + void *op_data); +H5_DLL void H5VL_iod_server_object_set_comment_cb(AXE_engine_t axe_engine, + size_t num_n_parents, AXE_task_t n_parents[], + size_t num_s_parents, AXE_task_t s_parents[], + void *op_data); +H5_DLL void H5VL_iod_server_object_get_comment_cb(AXE_engine_t UNUSED axe_engine, + size_t num_n_parents, AXE_task_t n_parents[], + size_t num_s_parents, AXE_task_t s_parents[], + void *_op_data); + +H5_DLL herr_t H5VL_iod_server_traverse(iod_handle_t coh, iod_obj_id_t loc_id, iod_handle_t loc_handle, + const char *path, hbool_t create_interm_grps, + char **last_comp, iod_obj_id_t *iod_id, iod_handle_t *iod_oh); + #endif /* H5_HAVE_EFF */ #endif /* _H5VLiod_server_H */ diff --git a/src/H5VLnative.c b/src/H5VLnative.c index 346adc7..9b669f3 100644 --- a/src/H5VLnative.c +++ b/src/H5VLnative.c @@ -66,6 +66,9 @@ static void *H5VL_native_attr_create(void *obj, H5VL_loc_params_t loc_params, co static void *H5VL_native_attr_open(void *obj, H5VL_loc_params_t loc_params, const char *attr_name, hid_t aapl_id, hid_t dxpl_id, void **req); static herr_t H5VL_native_attr_read(void *attr, hid_t dtype_id, void *buf, hid_t dxpl_id, void **req); static herr_t H5VL_native_attr_write(void *attr, hid_t dtype_id, const void *buf, hid_t dxpl_id, void **req); +static herr_t H5VL_native_attr_iterate(void *obj, H5VL_loc_params_t loc_params, + H5_index_t idx_type, H5_iter_order_t order, hsize_t *n, + H5A_operator2_t op, void *op_data, hid_t dxpl_id, void **req); static herr_t H5VL_native_attr_get(void *obj, H5VL_attr_get_t get_type, hid_t dxpl_id, void **req, va_list arguments); static herr_t H5VL_native_attr_remove(void *obj, H5VL_loc_params_t loc_params, const char *attr_name, hid_t dxpl_id, void **req); static herr_t H5VL_native_attr_close(void *attr, hid_t dxpl_id, void **req); @@ -74,6 +77,7 @@ static herr_t H5VL_native_attr_close(void *attr, hid_t dxpl_id, void **req); static void *H5VL_native_datatype_commit(void *obj, H5VL_loc_params_t loc_params, const char *name, hid_t type_id, hid_t lcpl_id, hid_t tcpl_id, hid_t tapl_id, hid_t dxpl_id, void **req); static void *H5VL_native_datatype_open(void *obj, H5VL_loc_params_t loc_params, const char *name, hid_t tapl_id, hid_t dxpl_id, void **req); static ssize_t H5VL_native_datatype_get_binary(void *obj, unsigned char *buf, size_t size, hid_t dxpl_id, void **req); +static herr_t H5VL_native_datatype_get(void *dt, H5VL_datatype_get_t get_type, hid_t dxpl_id, void **req, va_list arguments); static herr_t H5VL_native_datatype_close(void *dt, hid_t dxpl_id, void **req); /* Dataset callbacks */ @@ -139,6 +143,7 @@ static H5VL_class_t H5VL_native_g = { H5VL_native_attr_open, /* open */ H5VL_native_attr_read, /* read */ H5VL_native_attr_write, /* write */ + H5VL_native_attr_iterate, /* iterate */ H5VL_native_attr_get, /* get */ H5VL_native_attr_remove, /* remove */ H5VL_native_attr_close /* close */ @@ -146,7 +151,8 @@ static H5VL_class_t H5VL_native_g = { { /* datatype_cls */ H5VL_native_datatype_commit, /* commit */ H5VL_native_datatype_open, /* open */ - H5VL_native_datatype_get_binary, /* get_size */ + H5VL_native_datatype_get_binary, /* get_binary */ + H5VL_native_datatype_get, /* get */ H5VL_native_datatype_close /* close */ }, { /* dataset_cls */ @@ -332,7 +338,7 @@ done: /*--------------------------------------------------------------------------- * Function: H5VL_native_register * - * Purpose: utility routine to register and ID with the native VOL plugin + * Purpose: utility routine to register an ID with the native VOL plugin * as an auxilary object * * Returns: Non-negative on success or negative on failure @@ -627,6 +633,116 @@ done: /*------------------------------------------------------------------------- + * Function: H5VL_native_attr_iterate + * + * Purpose: Iterates through attrs in an object + * + * Return: Success: 0 + * Failure: -1 + * + * Programmer: Mohamad Chaarawi + * June, 2013 + * + *------------------------------------------------------------------------- + */ +static herr_t H5VL_native_attr_iterate(void *obj, H5VL_loc_params_t loc_params, H5_index_t idx_type, + H5_iter_order_t order, hsize_t *idx, H5A_operator2_t op, + void *op_data, hid_t UNUSED dxpl_id, void UNUSED **req) +{ + H5G_loc_t loc; /* Object location */ + H5G_loc_t obj_loc; /* Location used to open group */ + H5G_name_t obj_path; /* Opened object group hier. path */ + H5O_loc_t obj_oloc; /* Opened object object location */ + hbool_t loc_found = FALSE; /* Entry at 'obj_name' found */ + hid_t obj_loc_id = (-1); /* ID for object located */ + H5A_attr_iter_op_t attr_op; /* Attribute operator */ + hsize_t start_idx; /* Index of attribute to start iterating at */ + hsize_t last_attr; /* Index of last attribute examined */ + void *temp_obj = NULL; + H5I_type_t obj_type; + herr_t ret_value; /* Return value */ + + FUNC_ENTER_NOAPI_NOINIT + + /* check arguments */ + if(H5G_loc_real(obj, loc_params.obj_type, &loc) < 0) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file or file object") + + /* Build attribute operator info */ + attr_op.op_type = H5A_ATTR_OP_APP2; + attr_op.u.app_op2 = op; + + /* Call attribute iteration routine */ + last_attr = start_idx = (idx ? *idx : 0); + + /* Iterate over the links */ + if(loc_params.type == H5VL_OBJECT_BY_SELF) { + /* Get an atom for the object */ + if((obj_loc_id = H5VL_native_register(loc_params.obj_type, obj, TRUE)) < 0) + HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register object"); + } + else if(loc_params.type == H5VL_OBJECT_BY_NAME) { + /* Set up opened group location to fill in */ + obj_loc.oloc = &obj_oloc; + obj_loc.path = &obj_path; + H5G_loc_reset(&obj_loc); + + /* Find the object's location */ + if(H5G_loc_find(&loc, loc_params.loc_data.loc_by_name.name, &obj_loc/*out*/, + loc_params.loc_data.loc_by_name.plist_id, H5AC_ind_dxpl_id) < 0) + HGOTO_ERROR(H5E_ATTR, H5E_NOTFOUND, FAIL, "object not found"); + loc_found = TRUE; + + /* Open the object */ + if((obj_loc_id = H5O_open_by_loc(&obj_loc, loc_params.loc_data.loc_by_name.plist_id, + H5AC_ind_dxpl_id, TRUE)) < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, FAIL, "unable to open object"); + + /* get the native object from the ID created by the object header and create + a "VOL object" ID */ + obj_type = H5I_get_type(obj_loc_id); + if(NULL == (temp_obj = H5I_remove(obj_loc_id))) + HGOTO_ERROR(H5E_SYM, H5E_CANTOPENOBJ, FAIL, "unable to open object"); + /* Get an atom for the object */ + if((obj_loc_id = H5VL_native_register(obj_type, temp_obj, TRUE)) < 0) + HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register datatype"); + } + else { + HGOTO_ERROR(H5E_VOL, H5E_UNSUPPORTED, FAIL, "unknown link iterate params"); + } + + /* Do the real iteration */ + if((ret_value = H5O_attr_iterate(obj_loc_id, H5AC_ind_dxpl_id, idx_type, order, + start_idx, &last_attr, &attr_op, op_data)) < 0) + HERROR(H5E_ATTR, H5E_BADITER, "error iterating over attributes"); + + /* Set the last attribute information */ + if(idx) + *idx = last_attr; + +done: + /* Release resources */ + if(loc_params.type == H5VL_OBJECT_BY_SELF) { + if(obj_loc_id >= 0 && NULL == H5I_remove(obj_loc_id)) + HDONE_ERROR(H5E_SYM, H5E_CANTOPENOBJ, FAIL, "unable to open object"); + } + else if(loc_params.type == H5VL_OBJECT_BY_NAME) { + if(obj_loc_id >= 0) { + if(H5I_dec_app_ref(obj_loc_id) < 0) + HDONE_ERROR(H5E_ATTR, H5E_CANTDEC, FAIL, "unable to close temporary object"); + } /* end if */ + else if(loc_found && H5G_loc_free(&obj_loc) < 0) + HDONE_ERROR(H5E_ATTR, H5E_CANTRELEASE, FAIL, "can't free location"); + } + else { + HDONE_ERROR(H5E_VOL, H5E_UNSUPPORTED, FAIL, "unknown link iterate params"); + } + + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5VL_native_attr_iterate() */ + + +/*------------------------------------------------------------------------- * Function: H5VL_native_attr_get * * Purpose: Gets certain information about an attribute @@ -1127,6 +1243,54 @@ done: /*------------------------------------------------------------------------- + * Function: H5VL_native_datatype_get + * + * Purpose: Gets certain information about a datatype + * + * Return: Success: 0 + * Failure: -1 + * + * Programmer: Mohamad Chaarawi + * June, 2013 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5VL_native_datatype_get(void *obj, H5VL_datatype_get_t get_type, + hid_t UNUSED dxpl_id, void UNUSED **req, va_list arguments) +{ + H5T_t *dt = (H5T_t *)obj; + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI_NOINIT + + switch (get_type) { + /* H5Tget_create_plist */ + case H5VL_DATATYPE_GET_TCPL: + { + H5P_genplist_t *new_plist; /* New datatype creation property list */ + hid_t tcpl_id = va_arg (arguments, hid_t); + + /* Get property list object for new TCPL */ + if(NULL == (new_plist = (H5P_genplist_t *)H5I_object(tcpl_id))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "can't get property list"); + + /* Retrieve any object creation properties */ + if(H5O_get_create_plist(&dt->oloc, H5AC_ind_dxpl_id, new_plist) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTGET, FAIL, "can't get object creation info"); + + break; + } + default: + HGOTO_ERROR(H5E_VOL, H5E_CANTGET, FAIL, "can't get this type of information from datatype") + } + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5VL_native_datatype_get() */ + + +/*------------------------------------------------------------------------- * Function: H5VL_native_datatype_close * * Purpose: Closes an datatype. @@ -1961,7 +2125,8 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5VL_native_file_optional(void *obj, H5VL_file_optional_t optional_type, hid_t UNUSED dxpl_id, void UNUSED **req, va_list arguments) +H5VL_native_file_optional(void *obj, H5VL_file_optional_t optional_type, hid_t UNUSED dxpl_id, + void UNUSED **req, va_list arguments) { H5F_t *f = NULL; /* File */ herr_t ret_value = SUCCEED; /* Return value */ @@ -1972,14 +2137,18 @@ H5VL_native_file_optional(void *obj, H5VL_file_optional_t optional_type, hid_t U /* H5Fget_filesize */ case H5VL_FILE_GET_SIZE: { - haddr_t eof; /* End of file address */ + haddr_t eof; /* End of file address */ + haddr_t base_addr; /* Base address for the file */ hsize_t *ret = va_arg (arguments, hsize_t *); f = (H5F_t *)obj; /* Go get the actual file size */ - if(HADDR_UNDEF == (eof = H5FDget_eof(f->shared->lf))) + if(HADDR_UNDEF == (eof = H5FD_get_eof(f->shared->lf))) HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "unable to get file size") - *ret = (hsize_t)eof; + base_addr = H5FD_get_base_addr(f->shared->lf); + + if(ret) + *ret = (hsize_t)(eof + base_addr); /* Convert relative base address for file to absolute address */ break; } /* H5Fget_file_image */ diff --git a/src/H5VLprivate.h b/src/H5VLprivate.h index eb03b58..4aa06c6 100644 --- a/src/H5VLprivate.h +++ b/src/H5VLprivate.h @@ -54,6 +54,9 @@ H5_DLL void *H5VL_attr_create(void *obj, H5VL_loc_params_t loc_params, H5VL_t *v H5_DLL void *H5VL_attr_open(void *obj, H5VL_loc_params_t loc_params, H5VL_t *vol_plugin, const char *name, hid_t aapl_id, hid_t dxpl_id, hid_t event_q); H5_DLL herr_t H5VL_attr_read(void *attr, H5VL_t *vol_plugin, hid_t dtype_id, void *buf, hid_t dxpl_id, hid_t event_q); H5_DLL herr_t H5VL_attr_write(void *attr, H5VL_t *vol_plugin, hid_t dtype_id, const void *buf, hid_t dxpl_id, hid_t event_q); +H5_DLL herr_t H5VL_attr_iterate(void *obj, H5VL_loc_params_t loc_params, H5VL_t *vol_plugin, + H5_index_t idx_type, H5_iter_order_t order, hsize_t *n, + H5A_operator2_t op, void *op_data, hid_t dxpl_id, hid_t event_q); H5_DLL herr_t H5VL_attr_get(void *attr, H5VL_t *vol_plugin, H5VL_attr_get_t get_type, hid_t dxpl_id, hid_t event_q, ...); H5_DLL herr_t H5VL_attr_remove(void *obj, H5VL_loc_params_t loc_params, H5VL_t *vol_plugin, const char *attr_name, hid_t dxpl_id, hid_t event_q); H5_DLL herr_t H5VL_attr_close(void *attr, H5VL_t *vol_plugin, hid_t dxpl_id, hid_t event_q); @@ -69,6 +72,7 @@ H5_DLL herr_t H5VL_dataset_close(void *dset, H5VL_t *vol_plugin, hid_t dxpl_id, H5_DLL void *H5VL_datatype_commit(void *obj, H5VL_loc_params_t loc_params, H5VL_t *vol_plugin, const char *name, hid_t type_id, hid_t lcpl_id, hid_t tcpl_id, hid_t tapl_id, hid_t dxpl_id, hid_t event_q); H5_DLL void *H5VL_datatype_open(void *obj, H5VL_loc_params_t loc_params, H5VL_t *vol_plugin, const char *name, hid_t tapl_id, hid_t dxpl_id, hid_t event_q); H5_DLL ssize_t H5VL_datatype_get_binary(void *obj, H5VL_t *vol_plugin, unsigned char *buf, size_t size, hid_t dxpl_id, hid_t event_q); +H5_DLL herr_t H5VL_datatype_get(void *dt, H5VL_t *vol_plugin, H5VL_datatype_get_t get_type, hid_t dxpl_id, hid_t event_q, ...); H5_DLL herr_t H5VL_datatype_close(void *dt, H5VL_t *vol_plugin, hid_t dxpl_id, hid_t event_q); H5_DLL void *H5VL_file_create(H5VL_t **vol_plugin, const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id, hid_t dxpl_id, hid_t event_q); diff --git a/src/H5VLpublic.h b/src/H5VLpublic.h index c62c2a9..73bb9fd 100644 --- a/src/H5VLpublic.h +++ b/src/H5VLpublic.h @@ -24,6 +24,7 @@ #include "H5public.h" #include "H5EQpublic.h" +#include "H5Apublic.h" /* Attributes */ #include "H5Fpublic.h" #include "H5Lpublic.h" #include "H5Opublic.h" @@ -113,6 +114,11 @@ typedef enum H5VL_group_get_t { H5VL_GROUP_GET_INFO = 1 /*group info */ } H5VL_group_get_t; +/* types for all datatype get API routines */ +typedef enum H5VL_datatype_get_t { + H5VL_DATATYPE_GET_TCPL = 0 /*datatype creation property list */ +} H5VL_datatype_get_t; + /* link create types for VOL */ typedef enum H5VL_link_create_type_t { H5VL_LINK_CREATE_HARD = 0, @@ -207,6 +213,9 @@ typedef struct H5VL_attr_class_t { void *(*open) (void *obj, H5VL_loc_params_t loc_params, const char *attr_name, hid_t aapl_id, hid_t dxpl_id, void **req); herr_t (*read) (void *attr, hid_t mem_type_id, void *buf, hid_t dxpl_id, void **req); herr_t (*write) (void *attr, hid_t mem_type_id, const void *buf, hid_t dxpl_id, void **req); + herr_t (*iterate) (void *obj, H5VL_loc_params_t loc_params, + H5_index_t idx_type, H5_iter_order_t order, hsize_t *n, + H5A_operator2_t op, void *op_data, hid_t dxpl_id, void **req); herr_t (*get) (void *attr, H5VL_attr_get_t get_type, hid_t dxpl_id, void **req, va_list arguments); herr_t (*remove)(void *obj, H5VL_loc_params_t loc_params, const char *attr_name, hid_t dxpl_id, void **req); herr_t (*close) (void *attr, hid_t dxpl_id, void **req); @@ -218,6 +227,7 @@ typedef struct H5VL_datatype_class_t { hid_t lcpl_id, hid_t tcpl_id, hid_t tapl_id, hid_t dxpl_id, void **req); void *(*open) (void *obj, H5VL_loc_params_t loc_params, const char * name, hid_t tapl_id, hid_t dxpl_id, void **req); ssize_t (*get_binary) (void *obj, unsigned char *buf, size_t size, hid_t dxpl_id, void **req); + herr_t (*get) (void *obj, H5VL_datatype_get_t get_type, hid_t dxpl_id, void **req, va_list arguments); herr_t (*close) (void *dt, hid_t dxpl_id, void **req); } H5VL_datatype_class_t; @@ -339,6 +349,8 @@ H5_DLL void *H5VLattr_create(void *obj, H5VL_loc_params_t loc_params, H5VL_t *vo H5_DLL void *H5VLattr_open(void *obj, H5VL_loc_params_t loc_params, H5VL_t *vol_plugin, const char *name, hid_t aapl_id, hid_t dxpl_id, void **req); H5_DLL herr_t H5VLattr_read(void *attr, H5VL_t *vol_plugin, hid_t dtype_id, void *buf, hid_t dxpl_id, void **req); H5_DLL herr_t H5VLattr_write(void *attr, H5VL_t *vol_plugin, hid_t dtype_id, const void *buf, hid_t dxpl_id, void **req); +H5_DLL herr_t H5VLattr_iterate(void *obj, H5VL_loc_params_t loc_params, H5VL_t *vol_plugin, + H5_index_t idx_type, H5_iter_order_t order, hsize_t *n, H5A_operator2_t op, void *op_data, hid_t dxpl_id, void **req); H5_DLL herr_t H5VLattr_get(void *attr, H5VL_t *vol_plugin, H5VL_attr_get_t get_type, hid_t dxpl_id, void **req, va_list arguments); H5_DLL herr_t H5VLattr_remove(void *obj, H5VL_loc_params_t loc_params, H5VL_t *vol_plugin, const char *attr_name, hid_t dxpl_id, void **req); H5_DLL herr_t H5VLattr_close(void *attr, H5VL_t *vol_plugin, hid_t dxpl_id, void **req); @@ -356,6 +368,7 @@ H5_DLL herr_t H5VLdataset_close(void *dset, H5VL_t *vol_plugin, hid_t dxpl_id, v H5_DLL void *H5VLdatatype_commit(void *obj, H5VL_loc_params_t loc_params, H5VL_t *vol_plugin, const char *name, hid_t type_id, hid_t lcpl_id, hid_t tcpl_id, hid_t tapl_id, hid_t dxpl_id, void **req); H5_DLL void *H5VLdatatype_open(void *obj, H5VL_loc_params_t loc_params, H5VL_t *vol_plugin, const char *name, hid_t tapl_id, hid_t dxpl_id, void **req); H5_DLL ssize_t H5VLdatatype_get_binary(void *obj, H5VL_t *vol_plugin, unsigned char *buf, size_t size, hid_t dxpl_id, void **req); +H5_DLL herr_t H5VLdatatype_get(void *obj, H5VL_t *vol_plugin, H5VL_datatype_get_t get_type, hid_t dxpl_id, void **req, va_list arguments); H5_DLL herr_t H5VLdatatype_close(void *dt, H5VL_t *vol_plugin, hid_t dxpl_id, void **req); /* FILE OBJECT ROUTINES */ diff --git a/src/H5Vprivate.h b/src/H5Vprivate.h index de85fbc..5ce26a0 100644 --- a/src/H5Vprivate.h +++ b/src/H5Vprivate.h @@ -42,7 +42,7 @@ typedef herr_t (*H5V_opvv_func_t)(hsize_t dst_off, hsize_t src_off, /* Other functions */ #define H5V_vector_cpy(N,DST,SRC) { \ - assert (sizeof(*(DST))==sizeof(*(SRC))); \ + HDassert(sizeof(*(DST))==sizeof(*(SRC))); \ if (SRC) HDmemcpy (DST, SRC, (N)*sizeof(*(DST))); \ else HDmemset (DST, 0, (N)*sizeof(*(DST))); \ } @@ -22,10 +22,12 @@ #include "H5private.h" /* Generic Functions */ #include "H5Dprivate.h" /* Dataset functions */ #include "H5Eprivate.h" /* Error handling */ +#include "H5Fprivate.h" /* File */ #include "H5Iprivate.h" /* IDs */ #include "H5MMprivate.h" /* Memory management */ #include "H5Oprivate.h" /* Object headers */ #include "H5Pprivate.h" /* Property lists */ +#include "H5PLprivate.h" /* Plugins */ #include "H5Sprivate.h" /* Dataspace functions */ #include "H5Zpkg.h" /* Data filters */ @@ -44,6 +46,11 @@ typedef struct H5Z_stats_t { } H5Z_stats_t; #endif /* H5Z_DEBUG */ +typedef struct H5Z_object_t { + H5Z_filter_t filter_id; /* ID of the filter we're looking for */ + htri_t found; /* Whether we find an object using the filter */ +} H5Z_object_t; + /* Enumerated type for dataset creation prelude callbacks */ typedef enum { H5Z_PRELUDE_CAN_APPLY, /* Call "can apply" callback */ @@ -60,6 +67,9 @@ static H5Z_stats_t *H5Z_stat_table_g = NULL; /* Local functions */ static int H5Z_find_idx(H5Z_filter_t id); +static int H5Z__check_unregister_dset_cb(void *obj_ptr, hid_t obj_id, void *key); +static int H5Z__check_unregister_group_cb(void *obj_ptr, hid_t obj_id, void *key); +static int H5Z__flush_file_cb(void *obj_ptr, hid_t obj_id, void *key); /*------------------------------------------------------------------------- @@ -359,8 +369,6 @@ done: * Programmer: Quincey Koziol * Thursday, November 14, 2002 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t @@ -372,14 +380,14 @@ H5Zunregister(H5Z_filter_t id) H5TRACE1("e", "Zf", id); /* Check args */ - if (id<0 || id>H5Z_FILTER_MAX) - HGOTO_ERROR (H5E_ARGS, H5E_BADVALUE, FAIL, "invalid filter identification number") - if (id<H5Z_FILTER_RESERVED) - HGOTO_ERROR (H5E_ARGS, H5E_BADVALUE, FAIL, "unable to modify predefined filters") + if(id < 0 || id > H5Z_FILTER_MAX) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid filter identification number") + if(id < H5Z_FILTER_RESERVED) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to modify predefined filters") /* Do it */ - if (H5Z_unregister (id)<0) - HGOTO_ERROR (H5E_PLINE, H5E_CANTINIT, FAIL, "unable to unregister filter") + if(H5Z_unregister(id) < 0) + HGOTO_ERROR(H5E_PLINE, H5E_CANTINIT, FAIL, "unable to unregister filter") done: FUNC_LEAVE_API(ret_value) @@ -397,34 +405,55 @@ done: * Programmer: Quincey Koziol * Thursday, November 14, 2002 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t -H5Z_unregister (H5Z_filter_t id) +H5Z_unregister(H5Z_filter_t filter_id) { - size_t i; /* Local index variable */ - herr_t ret_value=SUCCEED; /* Return value */ + size_t filter_index; /* Local index variable for filter */ + H5Z_object_t object; + herr_t ret_value=SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) - assert (id>=0 && id<=H5Z_FILTER_MAX); + HDassert(filter_id>=0 && filter_id<=H5Z_FILTER_MAX); /* Is the filter already registered? */ - for (i=0; i<H5Z_table_used_g; i++) - if (H5Z_table_g[i].id==id) + for (filter_index=0; filter_index<H5Z_table_used_g; filter_index++) + if (H5Z_table_g[filter_index].id==filter_id) break; /* Fail if filter not found */ - if (i>=H5Z_table_used_g) + if (filter_index>=H5Z_table_used_g) HGOTO_ERROR(H5E_PLINE, H5E_NOTFOUND, FAIL, "filter is not registered") + /* Initialize the structure object for iteration */ + object.filter_id = filter_id; + object.found = FALSE; + + /* Iterate through all opened datasets, returns a failure if any of them uses the filter */ + if(H5I_iterate(H5I_DATASET, H5Z__check_unregister_dset_cb, &object, FALSE) < 0) + HGOTO_ERROR(H5E_FILE, H5E_BADITER, FAIL, "iteration failed") + + if(object.found) + HGOTO_ERROR(H5E_PLINE, H5E_CANTRELEASE, FAIL, "can't unregister filter because a dataset is still using it") + + /* Iterate through all opened groups, returns a failure if any of them uses the filter */ + if(H5I_iterate(H5I_GROUP, H5Z__check_unregister_group_cb, &object, FALSE) < 0) + HGOTO_ERROR(H5E_FILE, H5E_BADITER, FAIL, "iteration failed") + + if(object.found) + HGOTO_ERROR(H5E_PLINE, H5E_CANTRELEASE, FAIL, "can't unregister filter because a group is still using it") + + /* Iterate through all opened files and flush them */ + if(H5I_iterate(H5I_FILE, H5Z__flush_file_cb, NULL, FALSE) < 0) + HGOTO_ERROR(H5E_FILE, H5E_BADITER, FAIL, "iteration failed") + /* Remove filter from table */ /* Don't worry about shrinking table size (for now) */ - HDmemmove(&H5Z_table_g[i],&H5Z_table_g[i+1],sizeof(H5Z_class2_t)*((H5Z_table_used_g-1)-i)); + HDmemmove(&H5Z_table_g[filter_index],&H5Z_table_g[filter_index+1],sizeof(H5Z_class2_t)*((H5Z_table_used_g-1)-filter_index)); #ifdef H5Z_DEBUG - HDmemmove(&H5Z_stat_table_g[i],&H5Z_stat_table_g[i+1],sizeof(H5Z_stats_t)*((H5Z_table_used_g-1)-i)); + HDmemmove(&H5Z_stat_table_g[filter_index],&H5Z_stat_table_g[filter_index+1],sizeof(H5Z_stats_t)*((H5Z_table_used_g-1)-filter_index)); #endif /* H5Z_DEBUG */ H5Z_table_used_g--; @@ -434,6 +463,181 @@ done: /*------------------------------------------------------------------------- + * Function: H5Z__check_unregister + * + * Purpose: Check if an object uses the filter to be unregistered. + * + * Return: TRUE if the object uses the filter. + * FALSE if not, NEGATIVE on error. + * + * Programmer: Quincey Koziol + * 11 May 2013 + * + *------------------------------------------------------------------------- + */ +static htri_t +H5Z__check_unregister(hid_t ocpl_id, H5Z_filter_t filter_id) +{ + H5P_genplist_t *plist; /* Property list */ + htri_t ret_value = FALSE; /* Return value */ + + FUNC_ENTER_STATIC + + /* Get the plist structure of object creation */ + if(NULL == (plist = H5P_object_verify(ocpl_id, H5P_OBJECT_CREATE))) + HGOTO_ERROR(H5E_PLINE, H5E_BADATOM, FAIL, "can't find object for ID") + + /* Check if the object creation property list uses the filter */ + if((ret_value = H5P_filter_in_pline(plist, filter_id)) < 0) + HGOTO_ERROR(H5E_PLINE, H5E_CANTGET, FAIL, "can't check filter in pipeline") + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5Z__check_unregister() */ + + +/*------------------------------------------------------------------------- + * Function: H5Z__check_unregister_group_cb + * + * Purpose: The callback function for H5Z_unregister. It iterates + * through all opened objects. If the object is a dataset + * or a group and it uses the filter to be unregistered, the + * function returns TRUE. + * + * Return: TRUE if the object uses the filter. + * FALSE otherwise. + * + * Programmer: Raymond Lu + * 6 May 2013 + * + *------------------------------------------------------------------------- + */ +static int +H5Z__check_unregister_group_cb(void *obj_ptr, hid_t UNUSED obj_id, void *key) +{ + hid_t ocpl_id = -1; + H5Z_object_t *object = (H5Z_object_t *)key; + htri_t filter_in_pline = FALSE; + int ret_value = FALSE; /* Return value */ + + FUNC_ENTER_STATIC + + HDassert(obj_ptr); + + /* Get the group creation property */ + if((ocpl_id = H5G_get_create_plist((H5G_t *)obj_ptr)) < 0) + HGOTO_ERROR(H5E_PLINE, H5E_CANTGET, FAIL, "can't get group creation property list") + + /* Check if the filter is in the group creation property list */ + if((filter_in_pline = H5Z__check_unregister(ocpl_id, object->filter_id)) < 0) + HGOTO_ERROR(H5E_PLINE, H5E_CANTGET, FAIL, "can't check filter in pipeline") + + /* H5I_iterate expects TRUE to stop the loop over objects. Stop the loop and + * let H5Z_unregister return failure. + */ + if(filter_in_pline) { + object->found = TRUE; + ret_value = TRUE; + } /* end if */ + +done: + if(ocpl_id > 0) + if(H5I_dec_app_ref(ocpl_id) < 0) + HDONE_ERROR(H5E_PLINE, H5E_CANTDEC, FAIL, "can't release plist") + + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5Z__check_unregister_group_cb() */ + + +/*------------------------------------------------------------------------- + * Function: H5Z__check_unregister_dset_cb + * + * Purpose: The callback function for H5Z_unregister. It iterates + * through all opened objects. If the object is a dataset + * or a group and it uses the filter to be unregistered, the + * function returns TRUE. + * + * Return: TRUE if the object uses the filter. + * FALSE otherwise. + * + * Programmer: Raymond Lu + * 6 May 2013 + * + *------------------------------------------------------------------------- + */ +static int +H5Z__check_unregister_dset_cb(void *obj_ptr, hid_t UNUSED obj_id, void *key) +{ + hid_t ocpl_id = -1; + H5Z_object_t *object = (H5Z_object_t *)key; + htri_t filter_in_pline = FALSE; + int ret_value = FALSE; /* Return value */ + + FUNC_ENTER_STATIC + + HDassert(obj_ptr); + + /* Get the dataset creation property */ + if((ocpl_id = H5D_get_create_plist((H5D_t *)obj_ptr)) < 0) + HGOTO_ERROR(H5E_PLINE, H5E_CANTGET, FAIL, "can't get dataset creation property list") + + /* Check if the filter is in the dataset creation property list */ + if((filter_in_pline = H5Z__check_unregister(ocpl_id, object->filter_id)) < 0) + HGOTO_ERROR(H5E_PLINE, H5E_CANTGET, FAIL, "can't check filter in pipeline") + + /* H5I_iterate expects TRUE to stop the loop over objects. Stop the loop and + * let H5Z_unregister return failure. + */ + if(filter_in_pline) { + object->found = TRUE; + ret_value = TRUE; + } /* end if */ + +done: + if(ocpl_id > 0) + if(H5I_dec_app_ref(ocpl_id) < 0) + HDONE_ERROR(H5E_PLINE, H5E_CANTDEC, FAIL, "can't release plist") + + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5Z__check_unregister_dset_cb() */ + + +/*------------------------------------------------------------------------- + * Function: H5Z__flush_file_cb + * + * Purpose: The callback function for H5Z_unregister. It iterates + * through all opened files and flush them. + * + * Return: FALSE if finishes flushing and moves on + * FAIL if there is an error + * + * Programmer: Raymond Lu + * 6 May 2013 + * + *------------------------------------------------------------------------- + */ +static int +H5Z__flush_file_cb(void *obj_ptr, hid_t UNUSED obj_id, void UNUSED *key) +{ + int ret_value = FALSE; /* Return value */ + + FUNC_ENTER_STATIC + + HDassert(obj_ptr); + + /* Call the flush routine for mounted file hierarchies. Do a global flush + * if the file is opened for write */ + if(H5F_ACC_RDWR & H5F_INTENT((H5F_t *)obj_ptr)) { + if(H5F_flush_mounts((H5F_t *)obj_ptr, H5AC_dxpl_id) < 0) + HGOTO_ERROR(H5E_PLINE, H5E_CANTFLUSH, FAIL, "unable to flush file hierarchy") + } /* end if */ + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5Z__flush_file_cb() */ + + +/*------------------------------------------------------------------------- * Function: H5Zfilter_avail * * Purpose: Check if a filter is available @@ -450,7 +654,6 @@ done: htri_t H5Zfilter_avail(H5Z_filter_t id) { - size_t i; /* Local index variable */ htri_t ret_value=FALSE; /* Return value */ FUNC_ENTER_API(FAIL) @@ -459,13 +662,9 @@ H5Zfilter_avail(H5Z_filter_t id) /* Check args */ if(id<0 || id>H5Z_FILTER_MAX) HGOTO_ERROR (H5E_ARGS, H5E_BADVALUE, FAIL, "invalid filter identification number") - - /* Is the filter already registered? */ - for(i=0; i<H5Z_table_used_g; i++) - if(H5Z_table_g[i].id==id) { - ret_value=TRUE; - break; - } /* end if */ + + if((ret_value = H5Z_filter_avail(id)) < 0) + HGOTO_ERROR(H5E_PLINE, H5E_NOTFOUND, FAIL, "unable to check the availability of the filter") done: FUNC_LEAVE_API(ret_value) @@ -473,6 +672,36 @@ done: /*------------------------------------------------------------------------- + * Function: H5Z_filter_avail + * + * Purpose: Private function to check if a filter is available + * + * Return: Non-negative (TRUE/FALSE) on success/Negative on failure + * + * Programmer: Raymond Lu + * 13 February 2013 + * + *------------------------------------------------------------------------- + */ +htri_t +H5Z_filter_avail(H5Z_filter_t id) +{ + size_t i; /* Local index variable */ + htri_t ret_value = FALSE; /* Return value */ + + FUNC_ENTER_NOAPI(FAIL) + + /* Is the filter already registered? */ + for(i = 0; i < H5Z_table_used_g; i++) + if(H5Z_table_g[i].id == id) + HGOTO_DONE(TRUE) + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5Z_filter_avail() */ + + +/*------------------------------------------------------------------------- * Function: H5Z_prelude_callback * * Purpose: Makes a dataset creation "prelude" callback for the "can_apply" @@ -1073,12 +1302,12 @@ H5Z_pipeline(const H5O_pline_t *pline, unsigned flags, FUNC_ENTER_NOAPI(FAIL) - assert(0==(flags & ~((unsigned)H5Z_FLAG_INVMASK))); - assert(filter_mask); - assert(nbytes && *nbytes>0); - assert(buf_size && *buf_size>0); - assert(buf && *buf); - assert(!pline || pline->nused<H5Z_MAX_NFILTERS); + HDassert(0==(flags & ~((unsigned)H5Z_FLAG_INVMASK))); + HDassert(filter_mask); + HDassert(nbytes && *nbytes>0); + HDassert(buf_size && *buf_size>0); + HDassert(buf && *buf); + HDassert(!pline || pline->nused<H5Z_MAX_NFILTERS); if (pline && (flags & H5Z_FLAG_REVERSE)) { /* Read */ for (i=pline->nused; i>0; --i) { @@ -1088,16 +1317,45 @@ H5Z_pipeline(const H5O_pline_t *pline, unsigned flags, failed |= (unsigned)1 << idx; continue;/*filter excluded*/ } - if ((fclass_idx=H5Z_find_idx(pline->filter[idx].id))<0) { - /* Print out the filter name to give more info. But the name is optional for - * the filter */ - if(pline->filter[idx].name) - HGOTO_ERROR(H5E_PLINE, H5E_READERROR, FAIL, "required filter '%s' is not registered", - pline->filter[idx].name) - else - HGOTO_ERROR(H5E_PLINE, H5E_READERROR, FAIL, "required filter (name unavailable) is not registered") - } + /* If the filter isn't registered and the application doesn't + * indicate no plugin through HDF5_PRELOAD_PLUG (using the symbol "::"), + * try to load it dynamically and register it. Otherwise, return failure + */ + if((fclass_idx = H5Z_find_idx(pline->filter[idx].id)) < 0) { + hbool_t issue_error = FALSE; + + /* Check for "no plugins" indicated" */ + if(H5PL_no_plugin()) + issue_error = TRUE; + else { + const H5Z_class2_t *filter_info; + + /* Try loading the filter */ + if(NULL != (filter_info = (const H5Z_class2_t *)H5PL_load(H5PL_TYPE_FILTER, (int)(pline->filter[idx].id)))) { + /* Register the filter we loaded */ + if(H5Z_register(filter_info) < 0) + HGOTO_ERROR(H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register filter") + + /* Search in the table of registered filters again to find the dynamic filter just loaded and registered */ + if((fclass_idx = H5Z_find_idx(pline->filter[idx].id)) < 0) + issue_error = TRUE; + } /* end if */ + else + issue_error = TRUE; + } /* end else */ + + /* Check for error */ + if(issue_error) { + /* Print out the filter name to give more info. But the name is optional for + * the filter */ + if(pline->filter[idx].name) + HGOTO_ERROR(H5E_PLINE, H5E_READERROR, FAIL, "required filter '%s' is not registered", pline->filter[idx].name) + else + HGOTO_ERROR(H5E_PLINE, H5E_READERROR, FAIL, "required filter (name unavailable) is not registered") + } /* end if */ + } /* end if */ + fclass=&H5Z_table_g[fclass_idx]; #ifdef H5Z_DEBUG fstats=&H5Z_stat_table_g[fclass_idx]; @@ -1199,8 +1457,8 @@ H5Z_filter_info(const H5O_pline_t *pline, H5Z_filter_t filter) FUNC_ENTER_NOAPI(NULL) - assert(pline); - assert(filter>=0 && filter<=H5Z_FILTER_MAX); + HDassert(pline); + HDassert(filter>=0 && filter<=H5Z_FILTER_MAX); /* Locate the filter in the pipeline */ for(idx=0; idx<pline->nused; idx++) @@ -1220,6 +1478,49 @@ done: /*------------------------------------------------------------------------- + * Function: H5Z_filter_in_pline + * + * Purpose: Check wheter a filter is in the filter pipeline using the + * filter ID. This function is very similar to H5Z_filter_info + * + * Return: TRUE - found filter + * FALSE - not found + * FAIL - error + * + * Programmer: Raymond Lu + * 26 April 2013 + * + * Modifications: + * + *------------------------------------------------------------------------- + */ +htri_t +H5Z_filter_in_pline(const H5O_pline_t *pline, H5Z_filter_t filter) +{ + size_t idx; /* Index of filter in pipeline */ + htri_t ret_value = TRUE; /* Return value */ + + FUNC_ENTER_NOAPI(FAIL) + + HDassert(pline); + HDassert(filter>=0 && filter<=H5Z_FILTER_MAX); + + /* Locate the filter in the pipeline */ + for(idx=0; idx<pline->nused; idx++) + if(pline->filter[idx].id==filter) + break; + + /* Check if the filter was not already in the pipeline */ + if(idx>=pline->nused) + ret_value = FALSE; + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5Z_filter_in_pline() */ + + + +/*------------------------------------------------------------------------- * Function: H5Z_all_filters_avail * * Purpose: Verify that all the filters in a pipeline are currently @@ -1243,7 +1544,7 @@ H5Z_all_filters_avail(const H5O_pline_t *pline) FUNC_ENTER_NOAPI(FAIL) /* Check args */ - assert(pline); + HDassert(pline); /* Iterate through all the filters in pipeline */ for(i=0; i<pline->nused; i++) { @@ -1365,15 +1666,44 @@ done: herr_t H5Zget_filter_info(H5Z_filter_t filter, unsigned int *filter_config_flags) { - H5Z_class2_t *fclass; herr_t ret_value = SUCCEED; FUNC_ENTER_API(FAIL) H5TRACE2("e", "Zf*Iu", filter, filter_config_flags); + /* Get the filter info */ + if(H5Z_get_filter_info(filter, filter_config_flags) < 0) + HGOTO_ERROR(H5E_PLINE, H5E_CANTGET, FAIL, "Filter info not retrieved") + +done: + FUNC_LEAVE_API(ret_value) +} /* end H5Zget_filter_info() */ + + +/*------------------------------------------------------------------------- + * Function: H5Z_get_filter_info + * + * Purpose: Gets information about a pipeline data filter and stores it + * in filter_config_flags. + * + * Return: zero on success / negative on failure + * + * Programmer: Quincey Koziol + * Saturday, May 11, 2013 + * + *------------------------------------------------------------------------- + */ +herr_t +H5Z_get_filter_info(H5Z_filter_t filter, unsigned int *filter_config_flags) +{ + H5Z_class2_t *fclass; + herr_t ret_value = SUCCEED; + + FUNC_ENTER_NOAPI(FAIL) + /* Look up the filter class info */ if(NULL == (fclass = H5Z_find(filter))) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Filter not defined") + HGOTO_ERROR(H5E_PLINE, H5E_BADVALUE, FAIL, "Filter not defined") /* Set the filter config flags for the application */ if(filter_config_flags != NULL) { @@ -1386,6 +1716,6 @@ H5Zget_filter_info(H5Z_filter_t filter, unsigned int *filter_config_flags) } /* end if */ done: - FUNC_LEAVE_API(ret_value) -} /* end H5Zget_filter_info() */ + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5Z_get_filter_info() */ diff --git a/src/H5Zfletcher32.c b/src/H5Zfletcher32.c index d2ad965..8d2643d 100644 --- a/src/H5Zfletcher32.c +++ b/src/H5Zfletcher32.c @@ -87,7 +87,7 @@ H5Z_filter_fletcher32 (unsigned flags, size_t UNUSED cd_nelmts, const unsigned U FUNC_ENTER_NOAPI(0) - assert(sizeof(uint32_t)>=4); + HDassert(sizeof(uint32_t)>=4); if (flags & H5Z_FLAG_REVERSE) { /* Read */ /* Do checksum if it's enabled for read; otherwise skip it diff --git a/src/H5Zprivate.h b/src/H5Zprivate.h index c1528b3..bd5bef0 100644 --- a/src/H5Zprivate.h +++ b/src/H5Zprivate.h @@ -74,7 +74,6 @@ struct H5O_pline_t; /*forward decl*/ /* Internal API routines */ H5_DLL herr_t H5Z_init(void); H5_DLL herr_t H5Z_register(const H5Z_class2_t *cls); -H5_DLL herr_t H5Z_unregister(H5Z_filter_t id); H5_DLL herr_t H5Z_append(struct H5O_pline_t *pline, H5Z_filter_t filter, unsigned flags, size_t cd_nelmts, const unsigned int cd_values[]); H5_DLL herr_t H5Z_modify(const struct H5O_pline_t *pline, H5Z_filter_t filter, @@ -91,8 +90,12 @@ H5_DLL herr_t H5Z_can_apply_direct(const struct H5O_pline_t *pline); H5_DLL herr_t H5Z_set_local_direct(const struct H5O_pline_t *pline); H5_DLL H5Z_filter_info_t *H5Z_filter_info(const struct H5O_pline_t *pline, H5Z_filter_t filter); +H5_DLL htri_t H5Z_filter_in_pline(const struct H5O_pline_t *pline, H5Z_filter_t filter); H5_DLL htri_t H5Z_all_filters_avail(const struct H5O_pline_t *pline); +H5_DLL herr_t H5Z_unregister(H5Z_filter_t filter_id); +H5_DLL htri_t H5Z_filter_avail(H5Z_filter_t id); H5_DLL herr_t H5Z_delete(struct H5O_pline_t *pline, H5Z_filter_t filter); +H5_DLL herr_t H5Z_get_filter_info(H5Z_filter_t filter, unsigned int *filter_config_flags); /* Data Transform Functions */ typedef struct H5Z_data_xform_t H5Z_data_xform_t; /* Defined in H5Ztrans.c */ diff --git a/src/H5Zpublic.h b/src/H5Zpublic.h index 5d9b5ed..8daa5f4 100644 --- a/src/H5Zpublic.h +++ b/src/H5Zpublic.h @@ -42,6 +42,7 @@ typedef int H5Z_filter_t; #define H5Z_FILTER_NBIT 5 /*nbit compression */ #define H5Z_FILTER_SCALEOFFSET 6 /*scale+offset compression */ #define H5Z_FILTER_RESERVED 256 /*filter ids below this value are reserved for library use */ + #define H5Z_FILTER_MAX 65535 /*maximum filter id */ /* General macros */ diff --git a/src/H5Zscaleoffset.c b/src/H5Zscaleoffset.c index 1538765..0aaff11 100644 --- a/src/H5Zscaleoffset.c +++ b/src/H5Zscaleoffset.c @@ -1164,7 +1164,7 @@ H5Z_filter_scaleoffset(unsigned flags, size_t cd_nelmts, const unsigned cd_value minval |= minval_mask; } - assert(minbits <= p.size * 8); + HDassert(minbits <= p.size * 8); p.minbits = minbits; /* calculate size of output buffer after decompression */ @@ -1241,7 +1241,7 @@ H5Z_filter_scaleoffset(unsigned flags, size_t cd_nelmts, const unsigned cd_value HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, 0, "pre-compression failed") } - assert(minbits <= p.size * 8); + HDassert(minbits <= p.size * 8); /* calculate buffer size after compression * minbits and minval are stored in the front of the compressed buffer diff --git a/src/H5Zszip.c b/src/H5Zszip.c index fd3d90c..4544ec3 100644 --- a/src/H5Zszip.c +++ b/src/H5Zszip.c @@ -198,7 +198,7 @@ H5Z_set_local_szip(hid_t dcpl_id, hid_t type_id, hid_t space_id) /* Set "local" parameter for this dataset's "pixels-per-scanline" */ /* (Use the chunk's fastest changing dimension size) */ - assert(ndims > 0); + HDassert(ndims > 0); scanline = dims[ndims - 1]; /* Adjust scanline if it is smaller than number of pixels per block or @@ -288,13 +288,13 @@ H5Z_filter_szip (unsigned flags, size_t cd_nelmts, const unsigned cd_values[], /* Sanity check to make certain that we haven't drifted out of date with * the mask options from the szlib.h header */ - assert(H5_SZIP_ALLOW_K13_OPTION_MASK==SZ_ALLOW_K13_OPTION_MASK); - assert(H5_SZIP_CHIP_OPTION_MASK==SZ_CHIP_OPTION_MASK); - assert(H5_SZIP_EC_OPTION_MASK==SZ_EC_OPTION_MASK); - assert(H5_SZIP_LSB_OPTION_MASK==SZ_LSB_OPTION_MASK); - assert(H5_SZIP_MSB_OPTION_MASK==SZ_MSB_OPTION_MASK); - assert(H5_SZIP_NN_OPTION_MASK==SZ_NN_OPTION_MASK); - assert(H5_SZIP_RAW_OPTION_MASK==SZ_RAW_OPTION_MASK); + HDassert(H5_SZIP_ALLOW_K13_OPTION_MASK==SZ_ALLOW_K13_OPTION_MASK); + HDassert(H5_SZIP_CHIP_OPTION_MASK==SZ_CHIP_OPTION_MASK); + HDassert(H5_SZIP_EC_OPTION_MASK==SZ_EC_OPTION_MASK); + HDassert(H5_SZIP_LSB_OPTION_MASK==SZ_LSB_OPTION_MASK); + HDassert(H5_SZIP_MSB_OPTION_MASK==SZ_MSB_OPTION_MASK); + HDassert(H5_SZIP_NN_OPTION_MASK==SZ_NN_OPTION_MASK); + HDassert(H5_SZIP_RAW_OPTION_MASK==SZ_RAW_OPTION_MASK); /* Check arguments */ if (cd_nelmts!=4) @@ -324,7 +324,7 @@ H5Z_filter_szip (unsigned flags, size_t cd_nelmts, const unsigned cd_values[], size_out=nalloc; if(SZ_BufftoBuffDecompress(outbuf, &size_out, newbuf, nbytes-4, &sz_param) != SZ_OK) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, 0, "szip_filter: decompression failed") - assert(size_out==nalloc); + HDassert(size_out==nalloc); /* Free the input buffer */ H5MM_xfree(*buf); @@ -351,7 +351,7 @@ H5Z_filter_szip (unsigned flags, size_t cd_nelmts, const unsigned cd_values[], size_out = nbytes; if(SZ_OK!= SZ_BufftoBuffCompress(dst, &size_out, *buf, nbytes, &sz_param)) HGOTO_ERROR(H5E_PLINE, H5E_CANTINIT, 0, "overflow") - assert(size_out<=nbytes); + HDassert(size_out<=nbytes); /* Free the input buffer */ H5MM_xfree(*buf); diff --git a/src/H5Ztrans.c b/src/H5Ztrans.c index 498db03..f9e7186 100644 --- a/src/H5Ztrans.c +++ b/src/H5Ztrans.c @@ -378,7 +378,7 @@ H5Z_unget_token(H5Z_token *current) FUNC_ENTER_NOAPI_NOINIT_NOERR /* check args */ - assert(current); + HDassert(current); current->tok_type = current->tok_last_type; current->tok_begin = current->tok_last_begin; @@ -414,7 +414,7 @@ H5Z_get_token(H5Z_token *current) FUNC_ENTER_NOAPI_NOINIT /* check args */ - assert(current); + HDassert(current); /* Save the last position for possible ungets */ current->tok_last_type = current->tok_type; @@ -424,9 +424,9 @@ H5Z_get_token(H5Z_token *current) current->tok_begin = current->tok_end; while (current->tok_begin[0] != '\0') { - if (isspace(current->tok_begin[0])) { + if (HDisspace(current->tok_begin[0])) { /* ignore whitespace */ - } else if (isdigit(current->tok_begin[0]) || + } else if (HDisdigit(current->tok_begin[0]) || current->tok_begin[0] == '.') { current->tok_end = current->tok_begin; @@ -439,7 +439,7 @@ H5Z_get_token(H5Z_token *current) /* is number */ current->tok_type = H5Z_XFORM_INTEGER; - while (isdigit(current->tok_end[0])) + while (HDisdigit(current->tok_end[0])) ++current->tok_end; } @@ -458,7 +458,7 @@ H5Z_get_token(H5Z_token *current) if (current->tok_end[0] == '.') do { ++current->tok_end; - } while (isdigit(current->tok_end[0])); + } while (HDisdigit(current->tok_end[0])); if (current->tok_end[0] == 'e' || current->tok_end[0] == 'E') { @@ -468,29 +468,29 @@ H5Z_get_token(H5Z_token *current) current->tok_end[0] == '+') ++current->tok_end; - if (!isdigit(current->tok_end[0])) { + if (!HDisdigit(current->tok_end[0])) { current->tok_type = H5Z_XFORM_ERROR; HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, current, "Invalidly formatted floating point number") } - while (isdigit(current->tok_end[0])) + while (HDisdigit(current->tok_end[0])) ++current->tok_end; } /* Check that this is a properly formatted numerical value */ - if (isalpha(current->tok_end[0]) || current->tok_end[0] == '.') { + if (HDisalpha(current->tok_end[0]) || current->tok_end[0] == '.') { current->tok_type = H5Z_XFORM_ERROR; HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, current, "Invalidly formatted floating point number") } } break; - } else if (isalpha(current->tok_begin[0])) { + } else if (HDisalpha(current->tok_begin[0])) { /* is symbol */ current->tok_type = H5Z_XFORM_SYMBOL; current->tok_end = current->tok_begin; - while (isalnum(current->tok_end[0])) + while (HDisalnum(current->tok_end[0])) ++current->tok_end; break; @@ -995,7 +995,7 @@ H5Z_xform_eval(H5Z_data_xform_t *data_xform_prop, void* array, size_t array_size H5Z_XFORM_DO_OP5(short, array_size) else if(array_type == H5T_NATIVE_USHORT) H5Z_XFORM_DO_OP5(unsigned short, array_size) - else if( array_type == H5T_NATIVE_INT) + else if(array_type == H5T_NATIVE_INT) H5Z_XFORM_DO_OP5(int, array_size) else if(array_type == H5T_NATIVE_UINT) H5Z_XFORM_DO_OP5(unsigned int, array_size) @@ -1026,10 +1026,10 @@ H5Z_xform_eval(H5Z_data_xform_t *data_xform_prop, void* array, size_t array_size /* If it's a quadratic transform, we have no choice but to store multiple copies of the data */ else { for(i = 0; i < data_xform_prop->dat_val_pointers->num_ptrs; i++) { - if(NULL == (data_xform_prop->dat_val_pointers->ptr_dat_val[i] = (void*)H5MM_malloc(array_size * H5Tget_size(array_type)))) + if(NULL == (data_xform_prop->dat_val_pointers->ptr_dat_val[i] = (void*)H5MM_malloc(array_size * H5T_get_size((H5T_t *)H5I_object(array_type))))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "Ran out of memory trying to allocate space for data in data transform") - HDmemcpy(data_xform_prop->dat_val_pointers->ptr_dat_val[i], array, array_size * H5Tget_size(array_type)); + HDmemcpy(data_xform_prop->dat_val_pointers->ptr_dat_val[i], array, array_size * H5T_get_size((H5T_t *)H5I_object(array_type))); } /* end for */ } /* end else */ @@ -1037,7 +1037,7 @@ H5Z_xform_eval(H5Z_data_xform_t *data_xform_prop, void* array, size_t array_size HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "error while performing data transform") if(data_xform_prop->dat_val_pointers->num_ptrs > 1) - HDmemcpy(array, res.value.dat_val, array_size * H5Tget_size(array_type)); + HDmemcpy(array, res.value.dat_val, array_size * H5T_get_size((H5T_t *)H5I_object(array_type))); /* Free the temporary arrays we used */ if(data_xform_prop->dat_val_pointers->num_ptrs > 1) @@ -1175,60 +1175,60 @@ H5Z_xform_find_type(const H5T_t* type) HDassert(type); /* Check for SHORT type */ - if((tmp = (H5T_t *)H5I_object_verify(H5T_NATIVE_SHORT, H5I_DATATYPE)) + if((tmp = (H5T_t *)H5I_object(H5T_NATIVE_SHORT)) && 0 == H5T_cmp(type, tmp, FALSE)) HGOTO_DONE(H5T_NATIVE_SHORT) /* Check for INT type */ - else if((tmp = (H5T_t *)H5I_object_verify(H5T_NATIVE_INT, H5I_DATATYPE)) + else if((tmp = (H5T_t *)H5I_object(H5T_NATIVE_INT)) && 0 == H5T_cmp(type, tmp, FALSE)) HGOTO_DONE(H5T_NATIVE_INT) /* Check for LONG type */ - else if((tmp = (H5T_t *)H5I_object_verify(H5T_NATIVE_LONG, H5I_DATATYPE)) + else if((tmp = (H5T_t *)H5I_object(H5T_NATIVE_LONG)) && 0 == H5T_cmp(type, tmp, FALSE)) HGOTO_DONE(H5T_NATIVE_LONG) /* Check for LONGLONG type */ - else if((tmp = (H5T_t *)H5I_object_verify(H5T_NATIVE_LLONG, H5I_DATATYPE)) + else if((tmp = (H5T_t *)H5I_object(H5T_NATIVE_LLONG)) && 0 == H5T_cmp(type, tmp, FALSE)) HGOTO_DONE(H5T_NATIVE_LLONG) /* Check for UCHAR type */ - else if((tmp = (H5T_t *)H5I_object_verify(H5T_NATIVE_UCHAR, H5I_DATATYPE)) + else if((tmp = (H5T_t *)H5I_object(H5T_NATIVE_UCHAR)) && 0 == H5T_cmp(type, tmp, FALSE)) HGOTO_DONE(H5T_NATIVE_UCHAR) /* Check for CHAR type */ - else if((tmp = (H5T_t *)H5I_object_verify(H5T_NATIVE_CHAR, H5I_DATATYPE)) + else if((tmp = (H5T_t *)H5I_object(H5T_NATIVE_CHAR)) && 0 == H5T_cmp(type, tmp, FALSE)) HGOTO_DONE(H5T_NATIVE_CHAR) /* Check for SCHAR type */ - else if((tmp = (H5T_t *)H5I_object_verify(H5T_NATIVE_SCHAR, H5I_DATATYPE)) + else if((tmp = (H5T_t *)H5I_object(H5T_NATIVE_SCHAR)) && 0 == H5T_cmp(type, tmp, FALSE)) HGOTO_DONE(H5T_NATIVE_SCHAR) /* Check for USHORT type */ - else if((tmp = (H5T_t *)H5I_object_verify(H5T_NATIVE_USHORT, H5I_DATATYPE)) + else if((tmp = (H5T_t *)H5I_object(H5T_NATIVE_USHORT)) && 0 == H5T_cmp(type, tmp, FALSE)) HGOTO_DONE(H5T_NATIVE_USHORT) /* Check for UINT type */ - else if((tmp = (H5T_t *)H5I_object_verify(H5T_NATIVE_UINT, H5I_DATATYPE)) + else if((tmp = (H5T_t *)H5I_object(H5T_NATIVE_UINT)) && 0 == H5T_cmp(type, tmp, FALSE)) HGOTO_DONE(H5T_NATIVE_UINT) /* Check for ULONG type */ - else if((tmp = (H5T_t *)H5I_object_verify(H5T_NATIVE_ULONG, H5I_DATATYPE)) + else if((tmp = (H5T_t *)H5I_object(H5T_NATIVE_ULONG)) && 0 == H5T_cmp(type, tmp, FALSE)) HGOTO_DONE(H5T_NATIVE_ULONG) /* Check for ULONGLONG type */ - else if((tmp = (H5T_t *)H5I_object_verify(H5T_NATIVE_ULLONG, H5I_DATATYPE)) + else if((tmp = (H5T_t *)H5I_object(H5T_NATIVE_ULLONG)) && 0 == H5T_cmp(type, tmp, FALSE)) HGOTO_DONE(H5T_NATIVE_ULLONG) /* Check for FLOAT type */ - else if((tmp = (H5T_t *)H5I_object_verify(H5T_NATIVE_FLOAT, H5I_DATATYPE)) + else if((tmp = (H5T_t *)H5I_object(H5T_NATIVE_FLOAT)) && 0 == H5T_cmp(type, tmp, FALSE)) HGOTO_DONE(H5T_NATIVE_FLOAT) /* Check for DOUBLE type */ - else if((tmp = (H5T_t *)H5I_object_verify(H5T_NATIVE_DOUBLE, H5I_DATATYPE)) + else if((tmp = (H5T_t *)H5I_object(H5T_NATIVE_DOUBLE)) && 0 == H5T_cmp(type, tmp, FALSE)) HGOTO_DONE(H5T_NATIVE_DOUBLE) #if H5_SIZEOF_LONG_DOUBLE !=0 /* Check for LONGDOUBLE type */ - else if((tmp = (H5T_t *)H5I_object_verify(H5T_NATIVE_LDOUBLE, H5I_DATATYPE)) + else if((tmp = (H5T_t *)H5I_object(H5T_NATIVE_LDOUBLE)) && 0 == H5T_cmp(type, tmp, FALSE)) HGOTO_DONE(H5T_NATIVE_LDOUBLE) #endif @@ -1258,7 +1258,7 @@ H5Z_xform_copy_tree(H5Z_node* tree, H5Z_datval_ptrs* dat_val_pointers, H5Z_datva FUNC_ENTER_NOAPI(NULL) - assert(tree); + HDassert(tree); if(tree->type == H5Z_XFORM_INTEGER) { @@ -1335,7 +1335,7 @@ H5Z_op_is_numbs(H5Z_node* _tree) FUNC_ENTER_NOAPI_NOINIT_NOERR - assert(_tree); + HDassert(_tree); if(((_tree->lchild->type == H5Z_XFORM_INTEGER) || (_tree->lchild->type == H5Z_XFORM_FLOAT)) && ((_tree->rchild->type == H5Z_XFORM_INTEGER) || (_tree->rchild->type == H5Z_XFORM_FLOAT))) ret_value = TRUE; @@ -1364,7 +1364,7 @@ H5Z_op_is_numbs2(H5Z_node* _tree) FUNC_ENTER_NOAPI_NOINIT_NOERR - assert(_tree); + HDassert(_tree); if((!_tree->lchild && ((_tree->rchild->type == H5Z_XFORM_INTEGER) || (_tree->rchild->type == H5Z_XFORM_FLOAT))) || ((_tree->lchild && ((_tree->lchild->type == H5Z_XFORM_INTEGER) || (_tree->lchild->type == H5Z_XFORM_FLOAT))) && (_tree->rchild && ((_tree->rchild->type == H5Z_XFORM_INTEGER) || (_tree->rchild->type == H5Z_XFORM_FLOAT))))) @@ -1494,7 +1494,7 @@ H5Z_xform_create(const char *expr) FUNC_ENTER_NOAPI(NULL) - assert(expr); + HDassert(expr); /* Allocate space for the data transform information */ if(NULL == (data_xform_prop = (H5Z_data_xform_t *)H5MM_calloc(sizeof(H5Z_data_xform_t)))) @@ -1740,7 +1740,7 @@ H5Z_xform_extract_xform_str(const H5Z_data_xform_t *data_xform_prop) /* There should be no way that this can be NULL since the function * that calls this one checks to make sure it isn't before * pasing them */ - assert(data_xform_prop); + HDassert(data_xform_prop); FUNC_LEAVE_NOAPI(data_xform_prop->xform_exp) } /* H5Z_xform_extract_xform_str() */ diff --git a/src/H5config.h.in b/src/H5config.h.in index be95cbc..33d98aa 100644 --- a/src/H5config.h.in +++ b/src/H5config.h.in @@ -90,6 +90,9 @@ /* Define if the direct I/O virtual file driver should be compiled */ #undef HAVE_DIRECT +/* Define to 1 if you have the <dirent.h> header file. */ +#undef HAVE_DIRENT_H + /* Define to 1 if you have the <dlfcn.h> header file. */ #undef HAVE_DLFCN_H @@ -202,6 +205,9 @@ /* Define to 1 if you have the `axe' library (-laxe). */ #undef HAVE_LIBAXE +/* Define to 1 if you have the `dl' library (-ldl). */ +#undef HAVE_LIBDL + /* Define to 1 if you have the `dmalloc' library (-ldmalloc). */ #undef HAVE_LIBDMALLOC diff --git a/src/H5detect.c b/src/H5detect.c index d6f6a3b..2bf0d2d 100644 --- a/src/H5detect.c +++ b/src/H5detect.c @@ -246,7 +246,7 @@ precision (detected_t *d) _v = (_v << 8) + _i; \ for(_i = 0, _x = (unsigned char *)&_v; _i < (signed)sizeof(TYPE); _i++) { \ _j = (*_x++) - 1; \ - assert(_j < (signed)sizeof(TYPE)); \ + HDassert(_j < (signed)sizeof(TYPE)); \ INFO.perm[_i] = _j; \ } /* end for */ \ } else { /*Not able to detect order if type size is 1 byte. Use native int \ @@ -255,7 +255,7 @@ precision (detected_t *d) _int_v = (_int_v << 8) + _i; \ for(_i = 0, _x = (unsigned char *)&_int_v; _i < (signed)sizeof(int); _i++) { \ _j = (*_x++)-1; \ - assert(_j < (signed)sizeof(int)); \ + HDassert(_j < (signed)sizeof(int)); \ INFO.perm[_i] = _j; \ } /* end for */ \ } /* end else */ \ @@ -296,23 +296,23 @@ precision (detected_t *d) int _i, _j, _last = (-1); \ char *_mesg; \ \ - memset(&INFO, 0, sizeof(INFO)); \ + HDmemset(&INFO, 0, sizeof(INFO)); \ INFO.varname = #VAR; \ INFO.size = sizeof(TYPE); \ \ /* Completely initialize temporary variables, in case the bits used in */ \ /* the type take less space than the number of bits used to store the type */ \ - memset(&_v3, 0, sizeof(TYPE)); \ - memset(&_v2, 0, sizeof(TYPE)); \ - memset(&_v1, 0, sizeof(TYPE)); \ + HDmemset(&_v3, 0, sizeof(TYPE)); \ + HDmemset(&_v2, 0, sizeof(TYPE)); \ + HDmemset(&_v1, 0, sizeof(TYPE)); \ \ /* Byte Order */ \ for(_i = 0, _v1 = 0.0, _v2 = 1.0; _i < (int)sizeof(TYPE); _i++) { \ _v3 = _v1; \ _v1 += _v2; \ _v2 /= 256.0; \ - memcpy(_buf1, (const void *)&_v1, sizeof(TYPE)); \ - memcpy(_buf3, (const void *)&_v3, sizeof(TYPE)); \ + HDmemcpy(_buf1, (const void *)&_v1, sizeof(TYPE)); \ + HDmemcpy(_buf3, (const void *)&_v3, sizeof(TYPE)); \ _j = byte_cmp(sizeof(TYPE), &_buf3, &_buf1); \ if(_j >= 0) { \ INFO.perm[_i] = _j; \ @@ -321,7 +321,7 @@ precision (detected_t *d) } \ fix_order(sizeof(TYPE), _last, INFO.perm, (const char**)&_mesg); \ \ - if(!strcmp(_mesg, "VAX")) \ + if(!HDstrcmp(_mesg, "VAX")) \ INFO.is_vax = TRUE; \ \ /* Implicit mantissa bit */ \ @@ -351,8 +351,8 @@ precision (detected_t *d) INFO.bias = find_bias (INFO.epos, INFO.esize, INFO.perm, &_v1); \ precision (&(INFO)); \ ALIGNMENT(TYPE, INFO); \ - if(!strcmp(INFO.varname, "FLOAT") || !strcmp(INFO.varname, "DOUBLE") || \ - !strcmp(INFO.varname, "LDOUBLE")) { \ + if(!HDstrcmp(INFO.varname, "FLOAT") || !HDstrcmp(INFO.varname, "DOUBLE") || \ + !HDstrcmp(INFO.varname, "LDOUBLE")) { \ COMP_ALIGNMENT(TYPE,INFO.comp_align); \ } \ } @@ -399,7 +399,7 @@ precision (detected_t *d) void (*_handler)(int) = HDsignal(SIGBUS, sigbus_handler); \ void (*_handler2)(int) = HDsignal(SIGSEGV, sigsegv_handler);\ \ - _buf = (char*)malloc(sizeof(TYPE) + align_g[NELMTS(align_g) - 1]); \ + _buf = (char*)HDmalloc(sizeof(TYPE) + align_g[NELMTS(align_g) - 1]); \ if(H5SETJMP(jbuf_g)) _ano++; \ if(_ano < NELMTS(align_g)) { \ *((TYPE*)(_buf+align_g[_ano])) = _val; /*possible SIGBUS or SEGSEGV*/ \ @@ -409,12 +409,12 @@ precision (detected_t *d) /* pointer values when pointing to non-word aligned */ \ /* locations with pointers that are supposed to be */ \ /* word aligned. -QAK */ \ - memset(_buf, 0xff, sizeof(TYPE)+align_g[NELMTS(align_g)-1]); \ + HDmemset(_buf, 0xff, sizeof(TYPE)+align_g[NELMTS(align_g)-1]); \ /*How to handle VAX types?*/ \ if(INFO.perm[0]) /* Big-Endian */ \ - memcpy(_buf+align_g[_ano]+(INFO.size-((INFO.offset+INFO.precision)/8)),((char *)&_val)+(INFO.size-((INFO.offset+INFO.precision)/8)),(size_t)(INFO.precision/8)); \ + HDmemcpy(_buf+align_g[_ano]+(INFO.size-((INFO.offset+INFO.precision)/8)),((char *)&_val)+(INFO.size-((INFO.offset+INFO.precision)/8)),(size_t)(INFO.precision/8)); \ else /* Little-Endian */ \ - memcpy(_buf+align_g[_ano]+(INFO.offset/8),((char *)&_val)+(INFO.offset/8),(size_t)(INFO.precision/8)); \ + HDmemcpy(_buf+align_g[_ano]+(INFO.offset/8),((char *)&_val)+(INFO.offset/8),(size_t)(INFO.precision/8)); \ _val2 = *((TYPE*)(_buf+align_g[_ano])); \ if(_val!=_val2) \ H5LONGJMP(jbuf_g, 1); \ @@ -424,7 +424,7 @@ precision (detected_t *d) (INFO.align)=0; \ fprintf(stderr, "unable to calculate alignment for %s\n", #TYPE); \ } \ - free(_buf); \ + HDfree(_buf); \ HDsignal(SIGBUS, _handler); /*restore original handler*/ \ HDsignal(SIGSEGV, _handler2); /*restore original handler*/ \ } @@ -669,7 +669,7 @@ H5TN_init_interface(void)\n\ dt->shared->u.atomic.msb_pad = H5T_PAD_ZERO;\n", d[i].offset, /*offset */ d[i].precision); /*precision */ - /*assert((d[i].perm[0]>0)==(byte_order>0));*/ /* Double-check that byte-order doesn't change */ + /*HDassert((d[i].perm[0]>0)==(byte_order>0));*/ /* Double-check that byte-order doesn't change */ if (0 == d[i].msize) { /* The part unique to fixed point types */ @@ -705,10 +705,10 @@ H5TN_init_interface(void)\n\ d[i].varname, (unsigned long)(d[i].align)); /* Variables for alignment of compound datatype */ - if(!strcmp(d[i].varname, "SCHAR") || !strcmp(d[i].varname, "SHORT") || - !strcmp(d[i].varname, "INT") || !strcmp(d[i].varname, "LONG") || - !strcmp(d[i].varname, "LLONG") || !strcmp(d[i].varname, "FLOAT") || - !strcmp(d[i].varname, "DOUBLE") || !strcmp(d[i].varname, "LDOUBLE")) { + if(!HDstrcmp(d[i].varname, "SCHAR") || !HDstrcmp(d[i].varname, "SHORT") || + !HDstrcmp(d[i].varname, "INT") || !HDstrcmp(d[i].varname, "LONG") || + !HDstrcmp(d[i].varname, "LLONG") || !HDstrcmp(d[i].varname, "FLOAT") || + !HDstrcmp(d[i].varname, "DOUBLE") || !HDstrcmp(d[i].varname, "LDOUBLE")) { printf(" H5T_NATIVE_%s_COMP_ALIGN_g = %lu;\n", d[i].varname, (unsigned long)(d[i].comp_align)); } @@ -823,7 +823,7 @@ iprint(detected_t *d) printf(" * "); for (i=MIN(pass*4+3,d->size-1); i>=pass*4; --i) { printf ("%4d", d->perm[i]); - if (i>pass*4) fputs (" ", stdout); + if (i>pass*4) HDfputs (" ", stdout); } /* @@ -835,23 +835,23 @@ iprint(detected_t *d) i>=pass*4; --i) { for (j=7; j>=0; --j) { if (k==d->sign && d->msize) { - putchar('S'); + HDputchar('S'); } else if (k>=d->epos && k<d->epos+d->esize) { - putchar('E'); + HDputchar('E'); } else if (k>=d->mpos && k<d->mpos+d->msize) { - putchar('M'); + HDputchar('M'); } else if (d->msize) { - putchar('?'); /*unknown floating point bit */ + HDputchar('?'); /*unknown floating point bit */ } else if (d->sign) { - putchar('I'); + HDputchar('I'); } else { - putchar('U'); + HDputchar('U'); } --k; } - if (i>pass*4) putchar(' '); + if (i>pass*4) HDputchar(' '); } - putchar('\n'); + HDputchar('\n'); } /* @@ -934,13 +934,13 @@ bit_cmp(int nbytes, int *perm, volatile void *_a, volatile void *_b) unsigned char aa, bb; for (i = 0; i < nbytes; i++) { - assert(perm[i] < nbytes); + HDassert(perm[i] < nbytes); if ((aa = a[perm[i]]) != (bb = b[perm[i]])) { for (j = 0; j < 8; j++, aa >>= 1, bb >>= 1) { if ((aa & 1) != (bb & 1)) return i * 8 + j; } - assert("INTERNAL ERROR" && 0); - abort(); + HDassert("INTERNAL ERROR" && 0); + HDabort(); } } return -1; @@ -998,7 +998,7 @@ fix_order(int n, int last, int *perm, const char **mesg) * It could have some other endianess and fall into this * case - JKM & QAK) */ - assert(0 == n % 2); + HDassert(0 == n % 2); if (mesg) *mesg = "VAX"; for (i = 0; i < n; i += 2) { perm[i] = (n - 2) - i; @@ -1008,7 +1008,7 @@ fix_order(int n, int last, int *perm, const char **mesg) } else { fprintf(stderr, "Failed to detect byte order of %d-byte floating point.\n", n); - exit(1); + HDexit(1); } } @@ -1062,7 +1062,7 @@ imp_bit(int n, int *perm, volatile void *_a, volatile void *_b) * A and B. This is the least significant bit of the exponent. */ changed = bit_cmp(n, perm, a, b); - assert(changed >= 0); + HDassert(changed >= 0); /* * The bit to the right (less significant) of the changed bit should @@ -1139,8 +1139,8 @@ static void print_header(void) { - time_t now = time(NULL); - struct tm *tm = localtime(&now); + time_t now = HDtime(NULL); + struct tm *tm = HDlocaltime(&now); char real_name[30]; char host_name[256]; int i; @@ -1199,13 +1199,13 @@ bit.\n"; { size_t n; char *comma; - if ((pwd = getpwuid(getuid()))) { - if ((comma = strchr(pwd->pw_gecos, ','))) { + if ((pwd = HDgetpwuid(HDgetuid()))) { + if ((comma = HDstrchr(pwd->pw_gecos, ','))) { n = MIN(sizeof(real_name)-1, (unsigned)(comma-pwd->pw_gecos)); - strncpy(real_name, pwd->pw_gecos, n); + HDstrncpy(real_name, pwd->pw_gecos, n); real_name[n] = '\0'; } else { - strncpy(real_name, pwd->pw_gecos, sizeof(real_name)); + HDstrncpy(real_name, pwd->pw_gecos, sizeof(real_name)); real_name[sizeof(real_name) - 1] = '\0'; } } else { @@ -1220,7 +1220,7 @@ bit.\n"; * The FQDM of this host or the empty string. */ #ifdef H5_HAVE_GETHOSTNAME - if (gethostname(host_name, sizeof(host_name)) < 0) { + if (HDgethostname(host_name, sizeof(host_name)) < 0) { host_name[0] = '\0'; } #else @@ -1231,7 +1231,7 @@ bit.\n"; * The file header: warning, copyright notice, build information. */ printf("/* Generated automatically by H5detect -- do not edit */\n\n\n"); - puts(FileHeader); /*the copyright notice--see top of this file */ + HDputs(FileHeader); /*the copyright notice--see top of this file */ printf(" *\n * Created:\t\t%s %2d, %4d\n", month_name[tm->tm_mon], tm->tm_mday, 1900 + tm->tm_year); @@ -1239,15 +1239,15 @@ bit.\n"; printf(" *\t\t\t"); if (real_name[0]) printf("%s <", real_name); #ifdef H5_HAVE_GETPWUID - if (pwd) fputs(pwd->pw_name, stdout); + if (pwd) HDfputs(pwd->pw_name, stdout); #endif if (host_name[0]) printf("@%s", host_name); if (real_name[0]) printf(">"); - putchar('\n'); + HDputchar('\n'); } printf(" *\n * Purpose:\t\t"); for (s = purpose; *s; s++) { - putchar(*s); + HDputchar(*s); if ('\n' == *s && s[1]) printf(" *\t\t\t"); } @@ -1256,7 +1256,7 @@ bit.\n"; printf(" *\tIt was generated by code in `H5detect.c'.\n"); printf(" *\n *"); - for (i = 0; i < 73; i++) putchar('-'); + for (i = 0; i < 73; i++) HDputchar('-'); printf("\n */\n\n"); } @@ -1645,7 +1645,7 @@ main(void) nvpairs[1] = UAC_NOPRINT | UAC_SIGBUS; if (setsysinfo(SSI_NVPAIRS, nvpairs, 1, 0, 0)<0) { fprintf(stderr, "H5detect: unable to turn off UAC handling: %s\n", - strerror(errno)); + HDstrerror(errno)); } #endif #endif diff --git a/src/H5err.txt b/src/H5err.txt index 02ac14d..c3908e4 100644 --- a/src/H5err.txt +++ b/src/H5err.txt @@ -77,6 +77,7 @@ MAJOR, H5E_FSPACE, Free Space Manager MAJOR, H5E_SOHM, Shared Object Header Messages MAJOR, H5E_EARRAY, Extensible Array MAJOR, H5E_FARRAY, Fixed Array +MAJOR, H5E_PLUGIN, Plugin for dynamically loaded library MAJOR, H5E_NONE_MAJOR, No error # Sections (for grouping minor errors) @@ -99,6 +100,7 @@ SECTION, HEAP, Heap errors SECTION, FSPACE, Free space errors SECTION, PIPELINE, I/O pipeline errors SECTION, SYSTEM, System level errors +SECTION, PLUGIN, Plugin errors SECTION, NONE, No error # Minor errors @@ -259,5 +261,8 @@ MINOR, PIPELINE, H5E_CANTFILTER, Filter operation failed # System level errors MINOR, SYSTEM, H5E_SYSERRSTR, System error message +# Plugin errors +MINOR, PLUGIN, H5E_OPENERROR, Can't open directory or file + # No error, for backward compatibility */ MINOR, NONE, H5E_NONE_MINOR, No error diff --git a/src/H5make_libsettings.c b/src/H5make_libsettings.c index d903592..fa00c64 100644 --- a/src/H5make_libsettings.c +++ b/src/H5make_libsettings.c @@ -94,7 +94,7 @@ insert_libhdf5_settings(FILE *flibinfo) else HDputc(inchar, flibinfo); } /* end while */ - if(feof(fsettings)) { + if(HDfeof(fsettings)) { /* wrap up */ if(!bol) /* EOF found without a new line */ @@ -182,7 +182,7 @@ information about the library build configuration\n"; size_t n; char *comma; - if((pwd = HDgetpwuid(getuid()))) { + if((pwd = HDgetpwuid(HDgetuid()))) { if((comma = HDstrchr(pwd->pw_gecos, ','))) { n = MIN(sizeof(real_name) - 1, (unsigned)(comma - pwd->pw_gecos)); HDstrncpy(real_name, pwd->pw_gecos, n); @@ -204,7 +204,7 @@ information about the library build configuration\n"; * The FQDM of this host or the empty string. */ #ifdef H5_HAVE_GETHOSTNAME - if(gethostname(host_name, sizeof(host_name)) < 0) + if(HDgethostname(host_name, sizeof(host_name)) < 0) host_name[0] = '\0'; #else host_name[0] = '\0'; diff --git a/src/H5private.h b/src/H5private.h index 42ea519..a55fbcd5 100644 --- a/src/H5private.h +++ b/src/H5private.h @@ -149,6 +149,17 @@ # include <io.h> #endif +/* + * Dynamic library handling. These are needed for dynamically loading I/O + * filters and VFDs. + */ +#ifdef H5_HAVE_DLFCN_H +#include <dlfcn.h> +#endif +#ifdef H5_HAVE_DIRENT_H +#include <dirent.h> +#endif + #ifdef H5_HAVE_WIN32_API /* The following two defines must be before any windows headers are included */ @@ -833,6 +844,9 @@ H5_DLL int HDfprintf (FILE *stream, const char *fmt, ...); #ifndef HDgetgroups #define HDgetgroups(Z,G) getgroups(Z,G) #endif /* HDgetgroups */ +#ifndef HDgethostname + #define HDgethostname(N,L) gethostname(N,L) +#endif /* HDgetlogin */ #ifndef HDgetlogin #define HDgetlogin() getlogin() #endif /* HDgetlogin */ @@ -2335,7 +2349,11 @@ func_init_failed: \ #define H5_GLUE4(w,x,y,z) w##x##y##z /* Compile-time "assert" macro */ -#define HDcompile_assert(e) do { enum { compile_assert__ = 1 / (e) }; } while(0) +#define HDcompile_assert(e) ((void)sizeof(char[ !!(e) ? 1 : -1])) +/* Variants that are correct, but generate compile-time warnings in some circumstances: + #define HDcompile_assert(e) do { enum { compile_assert__ = 1 / (e) }; } while(0) + #define HDcompile_assert(e) do { typedef struct { unsigned int b: (e); } x; } while(0) +*/ /* Private functions, not part of the publicly documented API */ H5_DLL herr_t H5_init_library(void); @@ -2346,12 +2364,14 @@ H5_DLL int H5A_term_interface(void); H5_DLL int H5AC_term_interface(void); H5_DLL int H5D_term_interface(void); H5_DLL int H5E_term_interface(void); +H5_DLL int H5EQ_term_interface(void); H5_DLL int H5F_term_interface(void); H5_DLL int H5FS_term_interface(void); H5_DLL int H5G_term_interface(void); H5_DLL int H5I_term_interface(void); H5_DLL int H5L_term_interface(void); H5_DLL int H5P_term_interface(void); +H5_DLL int H5PL_term_interface(void); H5_DLL int H5R_term_interface(void); H5_DLL int H5S_term_interface(void); H5_DLL int H5T_term_interface(void); diff --git a/src/H5public.h b/src/H5public.h index 4331cb0..1622b3c 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 149 /* For tweaks, bug-fixes, or development */ +#define H5_VERS_RELEASE 156 /* For tweaks, bug-fixes, or development */ #define H5_VERS_SUBRELEASE "" /* For pre-releases like snap0 */ /* Empty string for real releases. */ -#define H5_VERS_INFO "HDF5 library version: 1.9.149" /* Full version string */ +#define H5_VERS_INFO "HDF5 library version: 1.9.156" /* Full version string */ #define H5check() H5check_version(H5_VERS_MAJOR,H5_VERS_MINOR, \ H5_VERS_RELEASE) diff --git a/src/H5system.c b/src/H5system.c index 3ffe411..a93a128 100644 --- a/src/H5system.c +++ b/src/H5system.c @@ -117,8 +117,8 @@ HDfprintf(FILE *stream, const char *fmt, ...) const char *s; va_list ap; - assert (stream); - assert (fmt); + HDassert(stream); + HDassert(fmt); va_start (ap, fmt); while (*fmt) { diff --git a/src/H5timer.c b/src/H5timer.c index 7bdee8a..301d98b 100644 --- a/src/H5timer.c +++ b/src/H5timer.c @@ -97,8 +97,8 @@ void H5_timer_reset (H5_timer_t *timer) { - assert (timer); - HDmemset (timer, 0, sizeof *timer); + HDassert(timer); + HDmemset(timer, 0, sizeof *timer); } /* end H5_timer_reset() */ @@ -126,7 +126,7 @@ H5_timer_begin (H5_timer_t *timer) struct timeval etime; #endif - assert (timer); + HDassert(timer); #ifdef H5_HAVE_GETRUSAGE HDgetrusage (RUSAGE_SELF, &rusage); @@ -169,7 +169,7 @@ H5_timer_end (H5_timer_t *sum/*in,out*/, H5_timer_t *timer/*in,out*/) { H5_timer_t now; - assert (timer); + HDassert(timer); H5_timer_begin (&now); timer->utime = MAX(0.0, now.utime - timer->utime); @@ -220,7 +220,7 @@ H5_bandwidth(char *buf/*out*/, double nbytes, double nseconds) HDstrcpy(buf, " NaN"); else { bw = nbytes/nseconds; - if(fabs(bw) < 0.0000000001) + if(HDfabs(bw) < 0.0000000001) /* That is == 0.0, but direct comparison between floats is bad */ HDstrcpy(buf, "0.000 B/s"); else if(bw < 1.0) diff --git a/src/H5trace.c b/src/H5trace.c index 24b052e..d3c235b 100644 --- a/src/H5trace.c +++ b/src/H5trace.c @@ -156,7 +156,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) } /* end if */ /* Get tim for event */ - if(fabs(first_time.etime) < 0.0000000001) + if(HDfabs(first_time.etime) < 0.0000000001) /* That is == 0.0, but direct comparison between floats is bad */ H5_timer_begin(&first_time); if(H5_debug_g.ttimes) @@ -179,10 +179,10 @@ H5_trace(const double *returning, const char *func, const char *type, ...) char tmp[128]; sprintf(tmp, "%.6f", event_time.etime-first_time.etime); - fprintf(out, " %*s ", (int)strlen(tmp), ""); + fprintf(out, " %*s ", (int)HDstrlen(tmp), ""); } /* end if */ for(i = 0; i < current_depth; i++) - fputc('+', out); + HDfputc('+', out); fprintf(out, "%*s%s = ", 2*current_depth, "", func); } /* end if */ else { @@ -192,11 +192,11 @@ H5_trace(const double *returning, const char *func, const char *type, ...) } /* end if */ else { if(current_depth>last_call_depth) - fputs(" = <delayed>\n", out); + HDfputs(" = <delayed>\n", out); if(H5_debug_g.ttimes) fprintf(out, "@%.6f ", event_time.etime - first_time.etime); for(i = 0; i < current_depth; i++) - fputc('+', out); + HDfputc('+', out); fprintf(out, "%*s%s(", 2*current_depth, "", func); } /* end else */ diff --git a/src/Makefile.am b/src/Makefile.am index 5f9b90b..8fa8732 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -62,6 +62,7 @@ libhdf5_la_SOURCES= H5.c H5checksum.c H5dbg.c H5system.c H5timer.c H5trace.c \ H5VL.c H5VLint.c H5VLnative.c \ H5VLiod.c H5VLiod_client.c H5VLiod_server.c \ H5VLiod_encdec.c H5VLiod_compactor.c H5VLiod_compactor_queue.c \ + H5VLiod_file.c H5VLiod_group.c H5VLiod_dset.c H5VLiod_dtype.c H5VLiod_attr.c H5VLiod_link.c H5VLiod_obj.c \ H5FD.c H5FDcore.c \ H5FDdirect.c H5FDfamily.c H5FDint.c H5FDlog.c H5FDmpi.c H5FDmpio.c \ H5FDmpiposix.c H5FDmulti.c H5FDsec2.c H5FDspace.c H5FDstdio.c \ @@ -94,6 +95,7 @@ libhdf5_la_SOURCES= H5.c H5checksum.c H5dbg.c H5system.c H5timer.c H5trace.c \ H5Pfapl.c H5Pfcpl.c H5Pfmpl.c \ H5Pgcpl.c H5Pint.c \ H5Plapl.c H5Plcpl.c H5Pocpl.c H5Pocpypl.c H5Pstrcpl.c H5Ptest.c \ + H5PL.c \ H5R.c H5Rdeprec.c \ H5RC.c \ H5RS.c \ @@ -122,7 +124,9 @@ include_HEADERS = hdf5.h H5api_adpt.h H5overflow.h H5pubconf.h H5public.h H5vers H5FDmulti.h H5FDsec2.h H5FDstdio.h \ H5VLpublic.h H5VLnative.h H5VLiod.h H5FFpublic.h H5EQpublic.h\ H5Gpublic.h H5Ipublic.h H5Lpublic.h \ - H5MMpublic.h H5Opublic.h H5Ppublic.h H5Rpublic.h H5Spublic.h \ + H5MMpublic.h H5Opublic.h H5Ppublic.h \ + H5PLextern.h \ + H5Rpublic.h H5Spublic.h \ H5Tpublic.h H5Zpublic.h # install libhdf5.settings in lib directory diff --git a/src/Makefile.in b/src/Makefile.in index e2d6b85..cf0ba9f 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -136,19 +136,21 @@ am_libhdf5_la_OBJECTS = H5.lo H5checksum.lo H5dbg.lo H5system.lo \ H5Ftest.lo H5FA.lo H5FAcache.lo H5FAdbg.lo H5FAdblock.lo \ H5FAdblkpage.lo H5FAhdr.lo H5FAstat.lo H5FAtest.lo H5VL.lo \ H5VLint.lo H5VLnative.lo H5VLiod.lo H5VLiod_client.lo \ - H5VLiod_server.lo H5VLiod_compactor_queue.lo H5VLiod_compactor.lo \ - H5VLiod_encdec.lo H5FD.lo H5FDcore.lo \ - H5FDdirect.lo H5FDfamily.lo H5FDint.lo H5FDlog.lo H5FDmpi.lo \ - H5FDmpio.lo H5FDmpiposix.lo H5FDmulti.lo H5FDsec2.lo \ - H5FDspace.lo H5FDstdio.lo H5FF.lo H5EQ.lo H5FL.lo H5FO.lo \ - H5FS.lo H5FScache.lo H5FSdbg.lo H5FSsection.lo H5FSstat.lo \ - H5FStest.lo H5G.lo H5Gbtree2.lo H5Gcache.lo H5Gcompact.lo \ - H5Gdense.lo H5Gdeprec.lo H5Gent.lo H5Gint.lo H5Glink.lo \ - H5Gloc.lo H5Gname.lo H5Gnode.lo H5Gobj.lo H5Goh.lo H5Groot.lo \ - H5Gstab.lo H5Gtest.lo H5Gtraverse.lo H5HF.lo H5HFbtree2.lo \ - H5HFcache.lo H5HFdbg.lo H5HFdblock.lo H5HFdtable.lo H5HFhdr.lo \ - H5HFhuge.lo H5HFiblock.lo H5HFiter.lo H5HFman.lo \ - H5HFsection.lo H5HFspace.lo H5HFstat.lo H5HFtest.lo \ + H5VLiod_server.lo H5VLiod_encdec.lo H5VLiod_file.lo \ + H5VLiod_compactor_queue.lo H5VLiod_compactor.lo \ + H5VLiod_group.lo H5VLiod_dset.lo H5VLiod_dtype.lo \ + H5VLiod_attr.lo H5VLiod_link.lo H5VLiod_obj.lo H5FD.lo \ + H5FDcore.lo H5FDdirect.lo H5FDfamily.lo H5FDint.lo H5FDlog.lo \ + H5FDmpi.lo H5FDmpio.lo H5FDmpiposix.lo H5FDmulti.lo \ + H5FDsec2.lo H5FDspace.lo H5FDstdio.lo H5FF.lo H5EQ.lo H5FL.lo \ + H5FO.lo H5FS.lo H5FScache.lo H5FSdbg.lo H5FSsection.lo \ + H5FSstat.lo H5FStest.lo H5G.lo H5Gbtree2.lo H5Gcache.lo \ + H5Gcompact.lo H5Gdense.lo H5Gdeprec.lo H5Gent.lo H5Gint.lo \ + H5Glink.lo H5Gloc.lo H5Gname.lo H5Gnode.lo H5Gobj.lo H5Goh.lo \ + H5Groot.lo H5Gstab.lo H5Gtest.lo H5Gtraverse.lo H5HF.lo \ + H5HFbtree2.lo H5HFcache.lo H5HFdbg.lo H5HFdblock.lo \ + H5HFdtable.lo H5HFhdr.lo H5HFhuge.lo H5HFiblock.lo H5HFiter.lo \ + H5HFman.lo H5HFsection.lo H5HFspace.lo H5HFstat.lo H5HFtest.lo \ H5HFtiny.lo H5HG.lo H5HGcache.lo H5HGdbg.lo H5HGquery.lo \ H5HL.lo H5HLcache.lo H5HLdbg.lo H5HLint.lo H5HP.lo H5I.lo \ H5Itest.lo H5L.lo H5Lexternal.lo H5lib_settings.lo H5MF.lo \ @@ -163,18 +165,18 @@ am_libhdf5_la_OBJECTS = H5.lo H5checksum.lo H5dbg.lo H5system.lo \ H5P.lo H5Pacpl.lo H5Pdapl.lo H5Pdcpl.lo H5Pdeprec.lo \ H5Pdxpl.lo H5Pencdec.lo H5Pfapl.lo H5Pfcpl.lo H5Pfmpl.lo \ H5Pgcpl.lo H5Pint.lo H5Plapl.lo H5Plcpl.lo H5Pocpl.lo \ - H5Pocpypl.lo H5Pstrcpl.lo H5Ptest.lo H5R.lo H5Rdeprec.lo \ - H5RC.lo H5RS.lo H5S.lo H5Sall.lo H5Sdbg.lo H5Shyper.lo \ - H5Smpio.lo H5Snone.lo H5Spoint.lo H5Sselect.lo H5Stest.lo \ - H5SL.lo H5SM.lo H5SMbtree2.lo H5SMcache.lo H5SMmessage.lo \ - H5SMtest.lo H5ST.lo H5T.lo H5Tarray.lo H5Tbit.lo H5Tcommit.lo \ - H5Tcompound.lo H5Tconv.lo H5Tcset.lo H5Tdbg.lo H5Tdeprec.lo \ - H5Tenum.lo H5Tfields.lo H5Tfixed.lo H5Tfloat.lo H5Tinit.lo \ - H5Tnative.lo H5Toffset.lo H5Toh.lo H5Topaque.lo H5Torder.lo \ - H5Tpad.lo H5Tprecis.lo H5Tstrpad.lo H5Tvisit.lo H5Tvlen.lo \ - H5TS.lo H5V.lo H5WB.lo H5Z.lo H5Zdeflate.lo H5Zfletcher32.lo \ - H5Znbit.lo H5Zshuffle.lo H5Zszip.lo H5Zscaleoffset.lo \ - H5Ztrans.lo + H5Pocpypl.lo H5Pstrcpl.lo H5Ptest.lo H5PL.lo H5R.lo \ + H5Rdeprec.lo H5RC.lo H5RS.lo H5S.lo H5Sall.lo H5Sdbg.lo \ + H5Shyper.lo H5Smpio.lo H5Snone.lo H5Spoint.lo H5Sselect.lo \ + H5Stest.lo H5SL.lo H5SM.lo H5SMbtree2.lo H5SMcache.lo \ + H5SMmessage.lo H5SMtest.lo H5ST.lo H5T.lo H5Tarray.lo \ + H5Tbit.lo H5Tcommit.lo H5Tcompound.lo H5Tconv.lo H5Tcset.lo \ + H5Tdbg.lo H5Tdeprec.lo H5Tenum.lo H5Tfields.lo H5Tfixed.lo \ + H5Tfloat.lo H5Tinit.lo H5Tnative.lo H5Toffset.lo H5Toh.lo \ + H5Topaque.lo H5Torder.lo H5Tpad.lo H5Tprecis.lo H5Tstrpad.lo \ + H5Tvisit.lo H5Tvlen.lo H5TS.lo H5V.lo H5WB.lo H5Z.lo \ + H5Zdeflate.lo H5Zfletcher32.lo H5Znbit.lo H5Zshuffle.lo \ + H5Zszip.lo H5Zscaleoffset.lo H5Ztrans.lo libhdf5_la_OBJECTS = $(am_libhdf5_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) @@ -533,7 +535,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 = 139 +LT_VERS_REVISION = 146 LT_VERS_AGE = 0 H5detect_CFLAGS = -g $(AM_CFLAGS) @@ -568,7 +570,8 @@ libhdf5_la_SOURCES = H5.c H5checksum.c H5dbg.c H5system.c H5timer.c H5trace.c \ H5FA.c H5FAcache.c H5FAdbg.c H5FAdblock.c H5FAdblkpage.c H5FAhdr.c \ H5FAstat.c H5FAtest.c \ H5VL.c H5VLint.c H5VLnative.c \ - H5VLiod.c H5VLiod_client.c H5VLiod_server.c H5VLiod_encdec.c H5VLiod_compactor_queue.c \ + H5VLiod.c H5VLiod_client.c H5VLiod_server.c H5VLiod_encdec.c \ + H5VLiod_file.c H5VLiod_group.c H5VLiod_dset.c H5VLiod_dtype.c H5VLiod_attr.c H5VLiod_link.c H5VLiod_obj.c \ H5FD.c H5FDcore.c \ H5FDdirect.c H5FDfamily.c H5FDint.c H5FDlog.c H5FDmpi.c H5FDmpio.c \ H5FDmpiposix.c H5FDmulti.c H5FDsec2.c H5FDspace.c H5FDstdio.c \ @@ -601,6 +604,7 @@ libhdf5_la_SOURCES = H5.c H5checksum.c H5dbg.c H5system.c H5timer.c H5trace.c \ H5Pfapl.c H5Pfcpl.c H5Pfmpl.c \ H5Pgcpl.c H5Pint.c \ H5Plapl.c H5Plcpl.c H5Pocpl.c H5Pocpypl.c H5Pstrcpl.c H5Ptest.c \ + H5PL.c \ H5R.c H5Rdeprec.c \ H5RC.c \ H5RS.c \ @@ -629,7 +633,9 @@ include_HEADERS = hdf5.h H5api_adpt.h H5overflow.h H5pubconf.h H5public.h H5vers H5FDmulti.h H5FDsec2.h H5FDstdio.h \ H5VLpublic.h H5VLnative.h H5VLiod.h H5FFpublic.h H5EQpublic.h\ H5Gpublic.h H5Ipublic.h H5Lpublic.h \ - H5MMpublic.h H5Opublic.h H5Ppublic.h H5Rpublic.h H5Spublic.h \ + H5MMpublic.h H5Opublic.h H5Ppublic.h \ + H5PLextern.h \ + H5Rpublic.h H5Spublic.h \ H5Tpublic.h H5Zpublic.h @@ -953,6 +959,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5Otest.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5Ounknown.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5P.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5PL.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5Pacpl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5Pdapl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5Pdcpl.Plo@am__quote@ @@ -1019,8 +1026,15 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5VL.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5VLint.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5VLiod.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5VLiod_attr.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5VLiod_client.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5VLiod_dset.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5VLiod_dtype.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5VLiod_encdec.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5VLiod_file.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5VLiod_group.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5VLiod_link.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5VLiod_obj.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5VLiod_server.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5VLnative.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5WB.Plo@am__quote@ diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 6af1e94..741976b 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -7,7 +7,14 @@ PROJECT (HDF5_TEST) ADD_DEFINITIONS (${HDF5_EXTRA_C_FLAGS}) #----------------------------------------------------------------------------- -# Define Sources +# Generate the H5srcdir_str.h file containing user settings needed by compilation +#----------------------------------------------------------------------------- +SET (srcdir ${CMAKE_CURRENT_SOURCE_DIR}) +CONFIGURE_FILE (${HDF5_TEST_SOURCE_DIR}/H5srcdir_str.h.in H5srcdir_str.h @ONLY) +INCLUDE_DIRECTORIES (${CMAKE_CURRENT_BINARY_DIR}) + +#----------------------------------------------------------------------------- +# Define Test Library Sources #----------------------------------------------------------------------------- SET (TEST_LIB_SRCS ${HDF5_TEST_SOURCE_DIR}/h5test.c @@ -19,14 +26,8 @@ SET (TEST_LIB_HEADERS ${HDF5_TEST_SOURCE_DIR}/h5test.h ) -#----------------------------------------------------------------------------- -# Generate the H5srcdir_str.h file containing user settings needed by compilation -#----------------------------------------------------------------------------- -SET (srcdir ${CMAKE_CURRENT_SOURCE_DIR}) -CONFIGURE_FILE (${HDF5_TEST_SOURCE_DIR}/H5srcdir_str.h.in H5srcdir_str.h @ONLY) -INCLUDE_DIRECTORIES (${CMAKE_CURRENT_BINARY_DIR}) - ADD_LIBRARY (${HDF5_TEST_LIB_TARGET} ${LIB_TYPE} ${TEST_LIB_SRCS} ${TEST_LIB_HEADERS}) +TARGET_C_PROPERTIES (${HDF5_TEST_LIB_TARGET} " " " ") IF (MSVC) TARGET_LINK_LIBRARIES (${HDF5_TEST_LIB_TARGET} "ws2_32.lib") ENDIF (MSVC) @@ -37,6 +38,88 @@ TARGET_LINK_LIBRARIES (${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET}) H5_SET_LIB_OPTIONS (${HDF5_TEST_LIB_TARGET} ${HDF5_TEST_LIB_NAME} ${LIB_TYPE}) SET_TARGET_PROPERTIES (${HDF5_TEST_LIB_TARGET} PROPERTIES FOLDER libraries/test) +#----------------------------------------------------------------------------- +# If plugin library tests can be tested +#----------------------------------------------------------------------------- +IF (BUILD_SHARED_LIBS) + # make plugins dir + FILE (MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/testdir1") + FILE (MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/testdir2") + + #----------------------------------------------------------------------------- + # Define Test Library Sources + #----------------------------------------------------------------------------- + SET (TEST_PLUGIN_LIBS + dynlib1 + dynlib3 + ) + SET (TEST2_PLUGIN_LIBS + dynlib2 + ) + + FOREACH (test_lib ${TEST_PLUGIN_LIBS}) + SET (HDF5_TEST_PLUGIN_LIB_CORENAME "${test_lib}") + SET (HDF5_TEST_PLUGIN_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_TEST_PLUGIN_LIB_CORENAME}") + SET (HDF5_TEST_PLUGIN_LIB_TARGET ${HDF5_TEST_PLUGIN_LIB_CORENAME}) + ADD_DEFINITIONS (${HDF5_EXTRA_C_FLAGS}) + INCLUDE_DIRECTORIES (${HDF5_SRC_DIR}) + + ADD_LIBRARY (${HDF5_TEST_PLUGIN_LIB_TARGET} ${LIB_TYPE} ${HDF5_TEST_SOURCE_DIR}/${test_lib}.c) + TARGET_C_PROPERTIES (${HDF5_TEST_PLUGIN_LIB_TARGET} " " " ") + TARGET_LINK_LIBRARIES (${HDF5_TEST_PLUGIN_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) + H5_SET_LIB_OPTIONS ( + ${HDF5_TEST_PLUGIN_LIB_TARGET} ${HDF5_TEST_PLUGIN_LIB_NAME} + ${LIB_TYPE} + HDF5_TEST_PLUGIN_LIB_NAME_RELEASE + HDF5_TEST_PLUGIN_LIB_NAME_DEBUG + ) + SET_TARGET_PROPERTIES (${HDF5_TEST_PLUGIN_LIB_TARGET} PROPERTIES FOLDER libraries/TEST_PLUGIN) + + #----------------------------------------------------------------------------- + # Copy plugin library to a plugins folder + #----------------------------------------------------------------------------- + ADD_CUSTOM_COMMAND ( + TARGET ${HDF5_TEST_PLUGIN_LIB_TARGET} + POST_BUILD + COMMAND ${CMAKE_COMMAND} + ARGS -E copy_if_different + "$<TARGET_FILE:${HDF5_TEST_PLUGIN_LIB_TARGET}>" + "${CMAKE_BINARY_DIR}/testdir1/$<TARGET_FILE_NAME:${HDF5_TEST_PLUGIN_LIB_TARGET}>" + ) + ENDFOREACH (test_lib ${TEST_PLUGIN_LIBS}) + + FOREACH (test_lib ${TEST2_PLUGIN_LIBS}) + SET (HDF5_TEST_PLUGIN_LIB_CORENAME "${test_lib}") + SET (HDF5_TEST_PLUGIN_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_TEST_PLUGIN_LIB_CORENAME}") + SET (HDF5_TEST_PLUGIN_LIB_TARGET ${HDF5_TEST_PLUGIN_LIB_CORENAME}) + ADD_DEFINITIONS (${HDF5_EXTRA_C_FLAGS}) + INCLUDE_DIRECTORIES (${HDF5_SRC_DIR}) + + ADD_LIBRARY (${HDF5_TEST_PLUGIN_LIB_TARGET} ${LIB_TYPE} ${HDF5_TEST_SOURCE_DIR}/${test_lib}.c) + TARGET_C_PROPERTIES (${HDF5_TEST_PLUGIN_LIB_TARGET} " " " ") + TARGET_LINK_LIBRARIES (${HDF5_TEST_PLUGIN_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) + H5_SET_LIB_OPTIONS ( + ${HDF5_TEST_PLUGIN_LIB_TARGET} ${HDF5_TEST_PLUGIN_LIB_NAME} + ${LIB_TYPE} + HDF5_TEST_PLUGIN_LIB_NAME_RELEASE + HDF5_TEST_PLUGIN_LIB_NAME_DEBUG + ) + SET_TARGET_PROPERTIES (${HDF5_TEST_PLUGIN_LIB_TARGET} PROPERTIES FOLDER libraries/TEST_PLUGIN) + + #----------------------------------------------------------------------------- + # Copy plugin library to a plugins folder + #----------------------------------------------------------------------------- + ADD_CUSTOM_COMMAND ( + TARGET ${HDF5_TEST_PLUGIN_LIB_TARGET} + POST_BUILD + COMMAND ${CMAKE_COMMAND} + ARGS -E copy_if_different + "$<TARGET_FILE:${HDF5_TEST_PLUGIN_LIB_TARGET}>" + "${CMAKE_BINARY_DIR}/testdir2/$<TARGET_FILE_NAME:${HDF5_TEST_PLUGIN_LIB_TARGET}>" + ) + ENDFOREACH (test_lib ${TEST2_PLUGIN_LIBS}) +ENDIF (BUILD_SHARED_LIBS) + # -------------------------------------------------------------------- # Copy all the HDF5 files from the test directory into the source directory # -------------------------------------------------------------------- @@ -199,6 +282,7 @@ SET (testhdf5_SRCS #-- Adding test for testhdf5 ADD_EXECUTABLE (testhdf5 ${testhdf5_SRCS}) TARGET_NAMING (testhdf5 ${LIB_TYPE}) +TARGET_C_PROPERTIES (testhdf5 " " " ") TARGET_LINK_LIBRARIES (testhdf5 ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET}) SET_TARGET_PROPERTIES (testhdf5 PROPERTIES FOLDER test) @@ -251,6 +335,7 @@ ENDIF (HDF5_ENABLE_USING_MEMCHECKER) MACRO (ADD_H5_TEST file) ADD_EXECUTABLE (${file} ${HDF5_TEST_SOURCE_DIR}/${file}.c) TARGET_NAMING (${file} ${LIB_TYPE}) + TARGET_C_PROPERTIES (${file} " " " ") TARGET_LINK_LIBRARIES (${file} ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET}) SET_TARGET_PROPERTIES (${file} PROPERTIES FOLDER test) @@ -317,6 +402,8 @@ ADD_TEST ( testmeta.h5 tstint1.h5 tstint2.h5 + unregister_filter_1.h5 + unregister_filter_2.h5 ) SET (H5_TESTS @@ -373,6 +460,7 @@ SET (H5_TESTS file_image enc_dec_plist enc_dec_plist_with_endianess + unregister ) FOREACH (test ${H5_TESTS}) @@ -391,6 +479,7 @@ SET_TESTS_PROPERTIES(flush2 PROPERTIES DEPENDS flush1) #-- Adding test for cache ADD_EXECUTABLE (cache ${HDF5_TEST_SOURCE_DIR}/cache.c ${HDF5_TEST_SOURCE_DIR}/cache_common.c) TARGET_NAMING (cache ${LIB_TYPE}) +TARGET_C_PROPERTIES (cache " " " ") TARGET_LINK_LIBRARIES (cache ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) SET_TARGET_PROPERTIES (cache PROPERTIES FOLDER test) ADD_TEST ( @@ -405,6 +494,7 @@ SET_TESTS_PROPERTIES(cache PROPERTIES DEPENDS h5test-clear-cache-objects) #-- Adding test for cache_api ADD_EXECUTABLE (cache_api ${HDF5_TEST_SOURCE_DIR}/cache_api.c ${HDF5_TEST_SOURCE_DIR}/cache_common.c) TARGET_NAMING (cache_api ${LIB_TYPE}) +TARGET_C_PROPERTIES (cache_api " " " ") TARGET_LINK_LIBRARIES (cache_api ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) SET_TARGET_PROPERTIES (cache_api PROPERTIES FOLDER test) @@ -420,6 +510,7 @@ SET_TESTS_PROPERTIES(cache_api PROPERTIES DEPENDS h5test-clear-cache_api-objects #-- Adding test for cache_tagging ADD_EXECUTABLE (cache_tagging ${HDF5_TEST_SOURCE_DIR}/cache_tagging.c ${HDF5_TEST_SOURCE_DIR}/cache_common.c) TARGET_NAMING (cache_tagging ${LIB_TYPE}) +TARGET_C_PROPERTIES (cache_tagging " " " ") TARGET_LINK_LIBRARIES (cache_tagging ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) SET_TARGET_PROPERTIES (cache_tagging PROPERTIES FOLDER test) @@ -442,6 +533,7 @@ ADD_EXECUTABLE (ttsafe ${HDF5_TEST_SOURCE_DIR}/ttsafe_acreate.c ) TARGET_NAMING (ttsafe ${LIB_TYPE}) +TARGET_C_PROPERTIES (ttsafe " " " ") TARGET_LINK_LIBRARIES (ttsafe ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) SET_TARGET_PROPERTIES (ttsafe PROPERTIES FOLDER test) @@ -461,6 +553,7 @@ SET_TESTS_PROPERTIES(ttsafe PROPERTIES DEPENDS h5test-clear-ttsafe-objects) IF (HDF5_ENABLE_DEPRECATED_SYMBOLS) ADD_EXECUTABLE (err_compat ${HDF5_TEST_SOURCE_DIR}/err_compat.c) TARGET_NAMING (err_compat ${LIB_TYPE}) + TARGET_C_PROPERTIES (err_compat " " " ") TARGET_LINK_LIBRARIES (err_compat ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) SET_TARGET_PROPERTIES (err_compat PROPERTIES FOLDER test) @@ -487,6 +580,7 @@ ENDIF (HDF5_ENABLE_DEPRECATED_SYMBOLS) #-- Adding test for error_test ADD_EXECUTABLE (error_test ${HDF5_TEST_SOURCE_DIR}/error_test.c) TARGET_NAMING (error_test ${LIB_TYPE}) +TARGET_C_PROPERTIES (error_test " " " ") TARGET_LINK_LIBRARIES (error_test ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) SET_TARGET_PROPERTIES (error_test PROPERTIES FOLDER test) @@ -508,10 +602,12 @@ ADD_TEST (NAME error_test COMMAND "${CMAKE_COMMAND}" -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) SET_TESTS_PROPERTIES(error_test PROPERTIES DEPENDS h5test-clear-error_test-objects) +SET_TESTS_PROPERTIES (error_test PROPERTIES ENVIRONMENT "HDF5_PLUGIN_PRELOAD=::") #-- Adding test for links_env ADD_EXECUTABLE (links_env ${HDF5_TEST_SOURCE_DIR}/links_env.c) TARGET_NAMING (links_env ${LIB_TYPE}) +TARGET_C_PROPERTIES (links_env " " " ") TARGET_LINK_LIBRARIES (links_env ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) SET_TARGET_PROPERTIES (links_env PROPERTIES FOLDER test) @@ -553,6 +649,33 @@ ENDIF (\${TEST_RESULT} STREQUAL \"0\") ADD_TEST (NAME testlibinfo COMMAND ${CMAKE_COMMAND} -D "TEST_PROGRAM=$<TARGET_FILE:${HDF5_LIB_TARGET}>" -P "${GREP_RUNNER}") ############################################################################## +### P L U G I N T E S T S +############################################################################## +IF (BUILD_SHARED_LIBS) + + IF (WIN32 AND NOT CYGWIN) + SET(CMAKE_SEP "\;") + ELSE (WIN32 AND NOT CYGWIN) + SET(CMAKE_SEP ":") + ENDIF(WIN32 AND NOT CYGWIN) + + ADD_EXECUTABLE (plugin ${HDF5_TEST_SOURCE_DIR}/plugin.c) + TARGET_NAMING (plugin ${LIB_TYPE}) + TARGET_C_PROPERTIES (plugin " " " ") + TARGET_LINK_LIBRARIES (plugin ${HDF5_TEST_PLUGIN_LIB_TARGET}) + SET_TARGET_PROPERTIES (plugin PROPERTIES FOLDER test) + + ADD_TEST (NAME H5PLUGIN-plugin COMMAND $<TARGET_FILE:plugin>) + SET_TESTS_PROPERTIES (H5PLUGIN-plugin PROPERTIES ENVIRONMENT "HDF5_PLUGIN_PATH=${CMAKE_BINARY_DIR}/testdir1${CMAKE_SEP}${CMAKE_BINARY_DIR}/testdir2") +ELSE (BUILD_SHARED_LIBS) + MESSAGE (STATUS " **** Plugins libraries must be built as shared libraries **** ") + ADD_TEST ( + NAME H5PLUGIN-SKIPPED + COMMAND ${CMAKE_COMMAND} -E echo "SKIP H5PLUGIN TESTING" + ) +ENDIF (BUILD_SHARED_LIBS) + +############################################################################## ############################################################################## ### V F D T E S T S ### ############################################################################## @@ -621,6 +744,7 @@ IF (HDF5_TEST_VFD) tcheck_version testmeta links_env + unregister ) IF (DIRECT_VFD) @@ -673,6 +797,7 @@ IF (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) MACRO (ADD_H5_GENERATOR genfile) ADD_EXECUTABLE (${genfile} ${HDF5_TEST_SOURCE_DIR}/${genfile}.c) TARGET_NAMING (${genfile} ${LIB_TYPE}) + TARGET_C_PROPERTIES (${genfile} " " " ") TARGET_LINK_LIBRARIES (${genfile} ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET}) SET_TARGET_PROPERTIES (${genfile} PROPERTIES FOLDER generator/test) ENDMACRO (ADD_H5_GENERATOR genfile) diff --git a/test/H5srcdir.h b/test/H5srcdir.h index 8bc8780..202d050 100644 --- a/test/H5srcdir.h +++ b/test/H5srcdir.h @@ -50,10 +50,12 @@ static const char *H5_get_srcdir_filename(const char *filename) #ifdef H5_VMS if(filename[0] == '[') { char *tmp = filename; - srcdir_testpath[strlen(srcdir)-1] = '\0'; - strcat(srcdir_testpath, ++tmp); - } else - strcat(srcdir_testpath, filename); + + srcdir_testpath[HDstrlen(srcdir) - 1] = '\0'; + HDstrcat(srcdir_testpath, ++tmp); + } /* end if */ + else + HDstrcat(srcdir_testpath, filename); #else HDstrcat(srcdir_testpath, "/"); HDstrcat(srcdir_testpath, filename); @@ -84,4 +86,3 @@ static const char *H5_get_srcdir(void) } #endif /* _H5SRCDIR_H */ - diff --git a/test/Makefile.am b/test/Makefile.am index f1f98f1..b7fd1a9 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -26,9 +26,13 @@ INCLUDES=-I$(top_srcdir)/src -I$(top_builddir)/src # Test script for error_test and err_compat #TEST_SCRIPT = testerror.sh testlibinfo.sh testcheck_version.sh testlinks_env.sh TEST_SCRIPT = testlibinfo.sh testcheck_version.sh testlinks_env.sh -check_SCRIPTS = $(TEST_SCRIPT) SCRIPT_DEPEND = error_test$(EXEEXT) err_compat$(EXEEXT) links_env$(EXEEXT) +if HAVE_SHARED_CONDITIONAL + TEST_SCRIPT += test_plugin.sh + SCRIPT_DEPEND += plugin$(EXEEXT) +endif +check_SCRIPTS = $(TEST_SCRIPT) # These are our main targets. They should be listed in the order to be # executed, generally most specific tests to least specific tests. @@ -43,7 +47,7 @@ TEST_PROG= testhdf5 lheap ohdr stab gheap cache cache_api cache_tagging \ big mtime fillval mount flush1 flush2 app_ref enum \ set_extent ttsafe enc_dec_plist enc_dec_plist_with_endianess\ getname vfd ntypes dangle dtransform reserved cross_read \ - freespace mf farray earray btree2 fheap file_image + freespace mf farray earray btree2 fheap file_image unregister # List programs to be built when testing here. error_test and err_compat are # built at the same time as the other tests, but executed by testerror.sh. @@ -52,7 +56,9 @@ TEST_PROG= testhdf5 lheap ohdr stab gheap cache cache_api cache_tagging \ # Also build testmeta, which is used for timings test. It builds quickly, # and this lets automake keep all its test programs in one place. check_PROGRAMS=$(TEST_PROG) error_test err_compat tcheck_version testmeta links_env - +if HAVE_SHARED_CONDITIONAL + check_PROGRAMS+= plugin +endif # These programs generate test files for the tests. They don't need to be # compiled every time we want to test the library. However, putting @@ -70,8 +76,25 @@ if BUILD_ALL_CONDITIONAL noinst_PROGRAMS=$(BUILD_ALL_PROGS) endif -# The libh5test library provides common support code for the tests. -noinst_LTLIBRARIES=libh5test.la +if HAVE_SHARED_CONDITIONAL + # The libh5test library provides common support code for the tests. + noinst_LTLIBRARIES=libh5test.la + + # The libdynlib1 and libdynlib2 library for testing plugin module plugin.c. + # Build it as shared library if configure is enabled for shared library. + lib_LTLIBRARIES=libdynlib1.la libdynlib2.la libdynlib3.la + libdynlib1_la_SOURCES=dynlib1.c + libdynlib2_la_SOURCES=dynlib2.c + libdynlib3_la_SOURCES=dynlib3.c + +install-exec-hook: + $(RM) $(DESTDIR)$(libdir)/*dynlib* + +else + # The libh5test library provides common support code for the tests. + noinst_LTLIBRARIES=libh5test.la +endif + libh5test_la_SOURCES=h5test.c testframe.c cache_common.c # Use libhd5test.la to compile all of the tests @@ -81,10 +104,9 @@ LDADD=libh5test.la $(LIBHDF5) ttsafe_SOURCES=ttsafe.c ttsafe_dcreate.c ttsafe_error.c ttsafe_cancel.c \ ttsafe_acreate.c +VFD_LIST = sec2 stdio core split multi family if DIRECT_VFD_CONDITIONAL - VFD_LIST = sec2 stdio core split multi family direct -else - VFD_LIST = sec2 stdio core split multi family + VFD_LIST += direct endif # Additional target for running timing test @@ -121,7 +143,7 @@ CHECK_CLEANFILES+=accum.h5 cmpd_dset.h5 compact_dataset.h5 dataset.h5 dset_offse tmisc[0-9]*.h5 set_extent[1-5].h5 ext[12].bin \ getname.h5 getname[1-3].h5 sec2_file.h5 direct_file.h5 \ family_file000[0-3][0-9].h5 new_family_v16_000[0-3][0-9].h5 \ - multi_file-[rs].h5 core_file \ + multi_file-[rs].h5 core_file plugin.h5 \ new_move_[ab].h5 ntypes.h5 dangle.h5 error_test.h5 err_compat.h5 \ dtransform.h5 test_filters.h5 get_file_name.h5 tstint[1-2].h5 \ unlink_chunked.h5 btree2.h5 objcopy_src.h5 objcopy_dst.h5 \ @@ -129,7 +151,7 @@ CHECK_CLEANFILES+=accum.h5 cmpd_dset.h5 compact_dataset.h5 dataset.h5 dset_offse earray.h5 efc[0-5].h5 log_vfd_out.log \ new_multi_file_v16-r.h5 new_multi_file_v16-s.h5 \ split_get_file_image_test-m.h5 split_get_file_image_test-r.h5 \ - file_image_core_test.h5.copy + file_image_core_test.h5.copy unregister_filter_1.h5 unregister_filter_2.h5 # Sources for testhdf5 executable testhdf5_SOURCES=testhdf5.c tarray.c tattr.c tchecksum.c tconfig.c tfile.c \ @@ -138,7 +160,7 @@ testhdf5_SOURCES=testhdf5.c tarray.c tattr.c tchecksum.c tconfig.c tfile.c \ tvlstr.c tvltypes.c # Temporary files. -#DISTCLEANFILES=testerror.sh testlibinfo.sh testcheck_version.sh testlinks_env.sh -DISTCLEANFILES=testlibinfo.sh testcheck_version.sh testlinks_env.sh +#DISTCLEANFILES=testerror.sh testlibinfo.sh testcheck_version.sh testlinks_env.sh test_plugin.sh +DISTCLEANFILES=testlibinfo.sh testcheck_version.sh testlinks_env.sh test_plugin.sh include $(top_srcdir)/config/conclude.am diff --git a/test/Makefile.in b/test/Makefile.in index fc3e5be..693b655 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -69,16 +69,20 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ DIST_COMMON = $(srcdir)/H5srcdir_str.h.in $(srcdir)/Makefile.am \ - $(srcdir)/Makefile.in $(srcdir)/testcheck_version.sh.in \ - $(srcdir)/testerror.sh.in $(srcdir)/testlibinfo.sh.in \ - $(srcdir)/testlinks_env.sh.in $(top_srcdir)/bin/depcomp \ - $(top_srcdir)/bin/mkinstalldirs \ + $(srcdir)/Makefile.in $(srcdir)/test_plugin.sh.in \ + $(srcdir)/testcheck_version.sh.in $(srcdir)/testerror.sh.in \ + $(srcdir)/testlibinfo.sh.in $(srcdir)/testlinks_env.sh.in \ + $(top_srcdir)/bin/depcomp $(top_srcdir)/bin/mkinstalldirs \ $(top_srcdir)/config/commence.am \ $(top_srcdir)/config/conclude.am COPYING +@HAVE_SHARED_CONDITIONAL_TRUE@am__append_1 = test_plugin.sh +@HAVE_SHARED_CONDITIONAL_TRUE@am__append_2 = plugin$(EXEEXT) check_PROGRAMS = $(am__EXEEXT_1) error_test$(EXEEXT) \ err_compat$(EXEEXT) tcheck_version$(EXEEXT) testmeta$(EXEEXT) \ - links_env$(EXEEXT) -@BUILD_ALL_CONDITIONAL_TRUE@noinst_PROGRAMS = $(am__EXEEXT_2) + links_env$(EXEEXT) $(am__EXEEXT_2) +@HAVE_SHARED_CONDITIONAL_TRUE@am__append_3 = plugin +@BUILD_ALL_CONDITIONAL_TRUE@noinst_PROGRAMS = $(am__EXEEXT_3) +@DIRECT_VFD_CONDITIONAL_TRUE@am__append_4 = direct TESTS = $(am__EXEEXT_1) $(TEST_SCRIPT) subdir = test ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 @@ -88,16 +92,64 @@ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ mkinstalldirs = $(SHELL) $(top_srcdir)/bin/mkinstalldirs CONFIG_HEADER = $(top_builddir)/src/H5config.h CONFIG_CLEAN_FILES = testcheck_version.sh testerror.sh H5srcdir_str.h \ - testlibinfo.sh testlinks_env.sh + testlibinfo.sh testlinks_env.sh test_plugin.sh CONFIG_CLEAN_VPATH_FILES = -LTLIBRARIES = $(noinst_LTLIBRARIES) -libh5test_la_LIBADD = -am_libh5test_la_OBJECTS = h5test.lo testframe.lo cache_common.lo -libh5test_la_OBJECTS = $(am_libh5test_la_OBJECTS) +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +am__installdirs = "$(DESTDIR)$(libdir)" +LTLIBRARIES = $(lib_LTLIBRARIES) $(noinst_LTLIBRARIES) +libdynlib1_la_LIBADD = +am__libdynlib1_la_SOURCES_DIST = dynlib1.c +@HAVE_SHARED_CONDITIONAL_TRUE@am_libdynlib1_la_OBJECTS = dynlib1.lo +libdynlib1_la_OBJECTS = $(am_libdynlib1_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = +@HAVE_SHARED_CONDITIONAL_TRUE@am_libdynlib1_la_rpath = -rpath \ +@HAVE_SHARED_CONDITIONAL_TRUE@ $(libdir) +libdynlib2_la_LIBADD = +am__libdynlib2_la_SOURCES_DIST = dynlib2.c +@HAVE_SHARED_CONDITIONAL_TRUE@am_libdynlib2_la_OBJECTS = dynlib2.lo +libdynlib2_la_OBJECTS = $(am_libdynlib2_la_OBJECTS) +@HAVE_SHARED_CONDITIONAL_TRUE@am_libdynlib2_la_rpath = -rpath \ +@HAVE_SHARED_CONDITIONAL_TRUE@ $(libdir) +libdynlib3_la_LIBADD = +am__libdynlib3_la_SOURCES_DIST = dynlib3.c +@HAVE_SHARED_CONDITIONAL_TRUE@am_libdynlib3_la_OBJECTS = dynlib3.lo +libdynlib3_la_OBJECTS = $(am_libdynlib3_la_OBJECTS) +@HAVE_SHARED_CONDITIONAL_TRUE@am_libdynlib3_la_rpath = -rpath \ +@HAVE_SHARED_CONDITIONAL_TRUE@ $(libdir) +libh5test_la_LIBADD = +am_libh5test_la_OBJECTS = h5test.lo testframe.lo cache_common.lo +libh5test_la_OBJECTS = $(am_libh5test_la_OBJECTS) +@HAVE_SHARED_CONDITIONAL_FALSE@am_libh5test_la_rpath = +@HAVE_SHARED_CONDITIONAL_TRUE@am_libh5test_la_rpath = am__EXEEXT_1 = testhdf5$(EXEEXT) lheap$(EXEEXT) ohdr$(EXEEXT) \ stab$(EXEEXT) gheap$(EXEEXT) cache$(EXEEXT) cache_api$(EXEEXT) \ cache_tagging$(EXEEXT) pool$(EXEEXT) accum$(EXEEXT) \ @@ -113,8 +165,10 @@ am__EXEEXT_1 = testhdf5$(EXEEXT) lheap$(EXEEXT) ohdr$(EXEEXT) \ vfd$(EXEEXT) ntypes$(EXEEXT) dangle$(EXEEXT) \ dtransform$(EXEEXT) reserved$(EXEEXT) cross_read$(EXEEXT) \ freespace$(EXEEXT) mf$(EXEEXT) farray$(EXEEXT) earray$(EXEEXT) \ - btree2$(EXEEXT) fheap$(EXEEXT) file_image$(EXEEXT) -am__EXEEXT_2 = gen_bad_ohdr$(EXEEXT) gen_bogus$(EXEEXT) \ + btree2$(EXEEXT) fheap$(EXEEXT) file_image$(EXEEXT) \ + unregister$(EXEEXT) +@HAVE_SHARED_CONDITIONAL_TRUE@am__EXEEXT_2 = plugin$(EXEEXT) +am__EXEEXT_3 = gen_bad_ohdr$(EXEEXT) gen_bogus$(EXEEXT) \ gen_cross$(EXEEXT) gen_deflate$(EXEEXT) gen_filters$(EXEEXT) \ gen_new_array$(EXEEXT) gen_new_fill$(EXEEXT) \ gen_new_group$(EXEEXT) gen_new_mtime$(EXEEXT) \ @@ -377,6 +431,10 @@ ohdr_SOURCES = ohdr.c ohdr_OBJECTS = ohdr.$(OBJEXT) ohdr_LDADD = $(LDADD) ohdr_DEPENDENCIES = libh5test.la $(LIBHDF5) +plugin_SOURCES = plugin.c +plugin_OBJECTS = plugin.$(OBJEXT) +plugin_LDADD = $(LDADD) +plugin_DEPENDENCIES = libh5test.la $(LIBHDF5) pool_SOURCES = pool.c pool_OBJECTS = pool.$(OBJEXT) pool_LDADD = $(LDADD) @@ -427,6 +485,10 @@ unlink_SOURCES = unlink.c unlink_OBJECTS = unlink.$(OBJEXT) unlink_LDADD = $(LDADD) unlink_DEPENDENCIES = libh5test.la $(LIBHDF5) +unregister_SOURCES = unregister.c +unregister_OBJECTS = unregister.$(OBJEXT) +unregister_LDADD = $(LDADD) +unregister_DEPENDENCIES = libh5test.la $(LIBHDF5) vfd_SOURCES = vfd.c vfd_OBJECTS = vfd.$(OBJEXT) vfd_LDADD = $(LDADD) @@ -465,38 +527,43 @@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = -SOURCES = $(libh5test_la_SOURCES) accum.c app_ref.c big.c bittests.c \ - btree2.c cache.c cache_api.c cache_tagging.c cmpd_dset.c \ - cross_read.c dangle.c dsets.c dt_arith.c dtransform.c dtypes.c \ - earray.c efc.c enc_dec_plist.c enc_dec_plist_with_endianess.c \ - enum.c err_compat.c error_test.c extend.c external.c farray.c \ - fheap.c file_image.c fillval.c filter_fail.c flush1.c flush2.c \ +SOURCES = $(libdynlib1_la_SOURCES) $(libdynlib2_la_SOURCES) \ + $(libdynlib3_la_SOURCES) $(libh5test_la_SOURCES) accum.c \ + app_ref.c big.c bittests.c btree2.c cache.c cache_api.c \ + cache_tagging.c cmpd_dset.c cross_read.c dangle.c dsets.c \ + dt_arith.c dtransform.c dtypes.c earray.c efc.c \ + enc_dec_plist.c enc_dec_plist_with_endianess.c enum.c \ + err_compat.c error_test.c extend.c external.c farray.c fheap.c \ + file_image.c fillval.c filter_fail.c flush1.c flush2.c \ freespace.c gen_bad_ohdr.c gen_bogus.c gen_cross.c \ gen_deflate.c gen_file_image.c gen_filespace.c gen_filters.c \ gen_new_array.c gen_new_fill.c gen_new_group.c gen_new_mtime.c \ gen_new_super.c gen_noencoder.c gen_nullspace.c gen_plist.c \ gen_sizes_lheap.c gen_specmetaread.c gen_udlinks.c getname.c \ gheap.c hyperslab.c istore.c lheap.c links.c links_env.c mf.c \ - mount.c mtime.c ntypes.c objcopy.c ohdr.c pool.c reserved.c \ - set_extent.c space_overflow.c stab.c tcheck_version.c \ - $(testhdf5_SOURCES) testmeta.c $(ttsafe_SOURCES) unlink.c \ - vfd.c -DIST_SOURCES = $(libh5test_la_SOURCES) accum.c app_ref.c big.c \ - bittests.c btree2.c cache.c cache_api.c cache_tagging.c \ - cmpd_dset.c cross_read.c dangle.c dsets.c dt_arith.c \ - dtransform.c dtypes.c earray.c efc.c enc_dec_plist.c \ - enc_dec_plist_with_endianess.c enum.c err_compat.c \ - error_test.c extend.c external.c farray.c fheap.c file_image.c \ - fillval.c filter_fail.c flush1.c flush2.c freespace.c \ - gen_bad_ohdr.c gen_bogus.c gen_cross.c gen_deflate.c \ - gen_file_image.c gen_filespace.c gen_filters.c gen_new_array.c \ - gen_new_fill.c gen_new_group.c gen_new_mtime.c gen_new_super.c \ - gen_noencoder.c gen_nullspace.c gen_plist.c gen_sizes_lheap.c \ - gen_specmetaread.c gen_udlinks.c getname.c gheap.c hyperslab.c \ - istore.c lheap.c links.c links_env.c mf.c mount.c mtime.c \ - ntypes.c objcopy.c ohdr.c pool.c reserved.c set_extent.c \ - space_overflow.c stab.c tcheck_version.c $(testhdf5_SOURCES) \ - testmeta.c $(ttsafe_SOURCES) unlink.c vfd.c + mount.c mtime.c ntypes.c objcopy.c ohdr.c plugin.c pool.c \ + reserved.c set_extent.c space_overflow.c stab.c \ + tcheck_version.c $(testhdf5_SOURCES) testmeta.c \ + $(ttsafe_SOURCES) unlink.c unregister.c vfd.c +DIST_SOURCES = $(am__libdynlib1_la_SOURCES_DIST) \ + $(am__libdynlib2_la_SOURCES_DIST) \ + $(am__libdynlib3_la_SOURCES_DIST) $(libh5test_la_SOURCES) \ + accum.c app_ref.c big.c bittests.c btree2.c cache.c \ + cache_api.c cache_tagging.c cmpd_dset.c cross_read.c dangle.c \ + dsets.c dt_arith.c dtransform.c dtypes.c earray.c efc.c \ + enc_dec_plist.c enc_dec_plist_with_endianess.c enum.c \ + err_compat.c error_test.c extend.c external.c farray.c fheap.c \ + file_image.c fillval.c filter_fail.c flush1.c flush2.c \ + freespace.c gen_bad_ohdr.c gen_bogus.c gen_cross.c \ + gen_deflate.c gen_file_image.c gen_filespace.c gen_filters.c \ + gen_new_array.c gen_new_fill.c gen_new_group.c gen_new_mtime.c \ + gen_new_super.c gen_noencoder.c gen_nullspace.c gen_plist.c \ + gen_sizes_lheap.c gen_specmetaread.c gen_udlinks.c getname.c \ + gheap.c hyperslab.c istore.c lheap.c links.c links_env.c mf.c \ + mount.c mtime.c ntypes.c objcopy.c ohdr.c plugin.c pool.c \ + reserved.c set_extent.c space_overflow.c stab.c \ + tcheck_version.c $(testhdf5_SOURCES) testmeta.c \ + $(ttsafe_SOURCES) unlink.c unregister.c vfd.c am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ @@ -818,21 +885,24 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog accum.h5 cmpd_dset.h5 \ tmisc[0-9]*.h5 set_extent[1-5].h5 ext[12].bin getname.h5 \ getname[1-3].h5 sec2_file.h5 direct_file.h5 \ family_file000[0-3][0-9].h5 new_family_v16_000[0-3][0-9].h5 \ - multi_file-[rs].h5 core_file new_move_[ab].h5 ntypes.h5 \ - dangle.h5 error_test.h5 err_compat.h5 dtransform.h5 \ + multi_file-[rs].h5 core_file plugin.h5 new_move_[ab].h5 \ + ntypes.h5 dangle.h5 error_test.h5 err_compat.h5 dtransform.h5 \ test_filters.h5 get_file_name.h5 tstint[1-2].h5 \ unlink_chunked.h5 btree2.h5 objcopy_src.h5 objcopy_dst.h5 \ objcopy_ext.dat trefer1.h5 trefer2.h5 app_ref.h5 farray.h5 \ earray.h5 efc[0-5].h5 log_vfd_out.log new_multi_file_v16-r.h5 \ new_multi_file_v16-s.h5 split_get_file_image_test-m.h5 \ - split_get_file_image_test-r.h5 file_image_core_test.h5.copy + split_get_file_image_test-r.h5 file_image_core_test.h5.copy \ + unregister_filter_1.h5 unregister_filter_2.h5 INCLUDES = -I$(top_srcdir)/src -I$(top_builddir)/src # Test script for error_test and err_compat #TEST_SCRIPT = testerror.sh testlibinfo.sh testcheck_version.sh testlinks_env.sh -TEST_SCRIPT = testlibinfo.sh testcheck_version.sh testlinks_env.sh +TEST_SCRIPT = testlibinfo.sh testcheck_version.sh testlinks_env.sh \ + $(am__append_1) +SCRIPT_DEPEND = error_test$(EXEEXT) err_compat$(EXEEXT) \ + links_env$(EXEEXT) $(am__append_2) check_SCRIPTS = $(TEST_SCRIPT) -SCRIPT_DEPEND = error_test$(EXEEXT) err_compat$(EXEEXT) links_env$(EXEEXT) # These are our main targets. They should be listed in the order to be # executed, generally most specific tests to least specific tests. @@ -847,7 +917,7 @@ TEST_PROG = testhdf5 lheap ohdr stab gheap cache cache_api cache_tagging \ big mtime fillval mount flush1 flush2 app_ref enum \ set_extent ttsafe enc_dec_plist enc_dec_plist_with_endianess\ getname vfd ntypes dangle dtransform reserved cross_read \ - freespace mf farray earray btree2 fheap file_image + freespace mf farray earray btree2 fheap file_image unregister # These programs generate test files for the tests. They don't need to be @@ -862,9 +932,12 @@ BUILD_ALL_PROGS = gen_bad_ohdr gen_bogus gen_cross gen_deflate gen_filters gen_n gen_nullspace gen_udlinks space_overflow gen_filespace gen_specmetaread \ gen_sizes_lheap gen_file_image gen_plist - -# The libh5test library provides common support code for the tests. -noinst_LTLIBRARIES = libh5test.la +@HAVE_SHARED_CONDITIONAL_FALSE@noinst_LTLIBRARIES = libh5test.la +@HAVE_SHARED_CONDITIONAL_TRUE@noinst_LTLIBRARIES = libh5test.la +@HAVE_SHARED_CONDITIONAL_TRUE@lib_LTLIBRARIES = libdynlib1.la libdynlib2.la libdynlib3.la +@HAVE_SHARED_CONDITIONAL_TRUE@libdynlib1_la_SOURCES = dynlib1.c +@HAVE_SHARED_CONDITIONAL_TRUE@libdynlib2_la_SOURCES = dynlib2.c +@HAVE_SHARED_CONDITIONAL_TRUE@libdynlib3_la_SOURCES = dynlib3.c libh5test_la_SOURCES = h5test.c testframe.c cache_common.c # Use libhd5test.la to compile all of the tests @@ -874,8 +947,7 @@ LDADD = libh5test.la $(LIBHDF5) ttsafe_SOURCES = ttsafe.c ttsafe_dcreate.c ttsafe_error.c ttsafe_cancel.c \ ttsafe_acreate.c -@DIRECT_VFD_CONDITIONAL_FALSE@VFD_LIST = sec2 stdio core split multi family -@DIRECT_VFD_CONDITIONAL_TRUE@VFD_LIST = sec2 stdio core split multi family direct +VFD_LIST = sec2 stdio core split multi family $(am__append_4) # Sources for testhdf5 executable testhdf5_SOURCES = testhdf5.c tarray.c tattr.c tchecksum.c tconfig.c tfile.c \ @@ -885,8 +957,8 @@ testhdf5_SOURCES = testhdf5.c tarray.c tattr.c tchecksum.c tconfig.c tfile.c \ # Temporary files. -#DISTCLEANFILES=testerror.sh testlibinfo.sh testcheck_version.sh testlinks_env.sh -DISTCLEANFILES = testlibinfo.sh testcheck_version.sh testlinks_env.sh +#DISTCLEANFILES=testerror.sh testlibinfo.sh testcheck_version.sh testlinks_env.sh test_plugin.sh +DISTCLEANFILES = testlibinfo.sh testcheck_version.sh testlinks_env.sh test_plugin.sh # Automake needs to be taught how to build lib, progs, and tests targets. # These will be filled in automatically for the most part (e.g., @@ -952,6 +1024,42 @@ testlibinfo.sh: $(top_builddir)/config.status $(srcdir)/testlibinfo.sh.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ testlinks_env.sh: $(top_builddir)/config.status $(srcdir)/testlinks_env.sh.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ +test_plugin.sh: $(top_builddir)/config.status $(srcdir)/test_plugin.sh.in + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ +install-libLTLIBRARIES: $(lib_LTLIBRARIES) + @$(NORMAL_INSTALL) + @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ + list2=; for p in $$list; do \ + if test -f $$p; then \ + list2="$$list2 $$p"; \ + else :; fi; \ + done; \ + test -z "$$list2" || { \ + echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ + } + +uninstall-libLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ + for p in $$list; do \ + $(am__strip_dir) \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ + done + +clean-libLTLIBRARIES: + -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) + @list='$(lib_LTLIBRARIES)'; \ + locs=`for p in $$list; do echo $$p; done | \ + sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ + sort -u`; \ + test -z "$$locs" || { \ + echo rm -f $${locs}; \ + rm -f $${locs}; \ + } clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @@ -963,8 +1071,14 @@ clean-noinstLTLIBRARIES: echo rm -f $${locs}; \ rm -f $${locs}; \ } +libdynlib1.la: $(libdynlib1_la_OBJECTS) $(libdynlib1_la_DEPENDENCIES) $(EXTRA_libdynlib1_la_DEPENDENCIES) + $(AM_V_CCLD)$(LINK) $(am_libdynlib1_la_rpath) $(libdynlib1_la_OBJECTS) $(libdynlib1_la_LIBADD) $(LIBS) +libdynlib2.la: $(libdynlib2_la_OBJECTS) $(libdynlib2_la_DEPENDENCIES) $(EXTRA_libdynlib2_la_DEPENDENCIES) + $(AM_V_CCLD)$(LINK) $(am_libdynlib2_la_rpath) $(libdynlib2_la_OBJECTS) $(libdynlib2_la_LIBADD) $(LIBS) +libdynlib3.la: $(libdynlib3_la_OBJECTS) $(libdynlib3_la_DEPENDENCIES) $(EXTRA_libdynlib3_la_DEPENDENCIES) + $(AM_V_CCLD)$(LINK) $(am_libdynlib3_la_rpath) $(libdynlib3_la_OBJECTS) $(libdynlib3_la_LIBADD) $(LIBS) libh5test.la: $(libh5test_la_OBJECTS) $(libh5test_la_DEPENDENCIES) $(EXTRA_libh5test_la_DEPENDENCIES) - $(AM_V_CCLD)$(LINK) $(libh5test_la_OBJECTS) $(libh5test_la_LIBADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(am_libh5test_la_rpath) $(libh5test_la_OBJECTS) $(libh5test_la_LIBADD) $(LIBS) clean-checkPROGRAMS: @list='$(check_PROGRAMS)'; test -n "$$list" || exit 0; \ @@ -1172,6 +1286,9 @@ objcopy$(EXEEXT): $(objcopy_OBJECTS) $(objcopy_DEPENDENCIES) $(EXTRA_objcopy_DEP ohdr$(EXEEXT): $(ohdr_OBJECTS) $(ohdr_DEPENDENCIES) $(EXTRA_ohdr_DEPENDENCIES) @rm -f ohdr$(EXEEXT) $(AM_V_CCLD)$(LINK) $(ohdr_OBJECTS) $(ohdr_LDADD) $(LIBS) +plugin$(EXEEXT): $(plugin_OBJECTS) $(plugin_DEPENDENCIES) $(EXTRA_plugin_DEPENDENCIES) + @rm -f plugin$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(plugin_OBJECTS) $(plugin_LDADD) $(LIBS) pool$(EXEEXT): $(pool_OBJECTS) $(pool_DEPENDENCIES) $(EXTRA_pool_DEPENDENCIES) @rm -f pool$(EXEEXT) $(AM_V_CCLD)$(LINK) $(pool_OBJECTS) $(pool_LDADD) $(LIBS) @@ -1202,6 +1319,9 @@ ttsafe$(EXEEXT): $(ttsafe_OBJECTS) $(ttsafe_DEPENDENCIES) $(EXTRA_ttsafe_DEPENDE unlink$(EXEEXT): $(unlink_OBJECTS) $(unlink_DEPENDENCIES) $(EXTRA_unlink_DEPENDENCIES) @rm -f unlink$(EXEEXT) $(AM_V_CCLD)$(LINK) $(unlink_OBJECTS) $(unlink_LDADD) $(LIBS) +unregister$(EXEEXT): $(unregister_OBJECTS) $(unregister_DEPENDENCIES) $(EXTRA_unregister_DEPENDENCIES) + @rm -f unregister$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(unregister_OBJECTS) $(unregister_LDADD) $(LIBS) vfd$(EXEEXT): $(vfd_OBJECTS) $(vfd_DEPENDENCIES) $(EXTRA_vfd_DEPENDENCIES) @rm -f vfd$(EXEEXT) $(AM_V_CCLD)$(LINK) $(vfd_OBJECTS) $(vfd_LDADD) $(LIBS) @@ -1228,6 +1348,9 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dt_arith.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dtransform.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dtypes.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dynlib1.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dynlib2.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dynlib3.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/earray.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/efc.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/enc_dec_plist.Po@am__quote@ @@ -1277,6 +1400,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntypes.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/objcopy.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ohdr.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/plugin.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pool.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/reserved.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/set_extent.Po@am__quote@ @@ -1316,6 +1440,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tvlstr.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tvltypes.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unlink.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unregister.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vfd.Po@am__quote@ .c.o: @@ -1447,6 +1572,9 @@ check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) all-local installdirs: + for dir in "$(DESTDIR)$(libdir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done install: install-am install-exec: install-exec-am install-data: install-data-am @@ -1478,10 +1606,12 @@ distclean-generic: maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." +@HAVE_SHARED_CONDITIONAL_FALSE@install-exec-hook: clean: clean-am -clean-am: clean-checkPROGRAMS clean-generic clean-libtool \ - clean-noinstLTLIBRARIES clean-noinstPROGRAMS mostlyclean-am +clean-am: clean-checkPROGRAMS clean-generic clean-libLTLIBRARIES \ + clean-libtool clean-noinstLTLIBRARIES clean-noinstPROGRAMS \ + mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) @@ -1507,8 +1637,9 @@ install-dvi: install-dvi-am install-dvi-am: -install-exec-am: - +install-exec-am: install-libLTLIBRARIES + @$(NORMAL_INSTALL) + $(MAKE) $(AM_MAKEFLAGS) install-exec-hook install-html: install-html-am install-html-am: @@ -1547,24 +1678,25 @@ ps: ps-am ps-am: -uninstall-am: +uninstall-am: uninstall-libLTLIBRARIES -.MAKE: check-am install-am install-strip +.MAKE: check-am install-am install-exec-am install-strip .PHONY: CTAGS GTAGS all all-am all-local check check-TESTS check-am \ - clean clean-checkPROGRAMS clean-generic clean-libtool \ - clean-noinstLTLIBRARIES clean-noinstPROGRAMS cscopelist ctags \ - distclean distclean-compile distclean-generic \ + clean clean-checkPROGRAMS clean-generic clean-libLTLIBRARIES \ + clean-libtool clean-noinstLTLIBRARIES clean-noinstPROGRAMS \ + cscopelist ctags distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ - install-exec-am install-html install-html-am install-info \ - install-info-am install-man install-pdf install-pdf-am \ - install-ps install-ps-am install-strip installcheck \ - installcheck-am installdirs maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-compile \ - mostlyclean-generic mostlyclean-libtool mostlyclean-local pdf \ - pdf-am ps ps-am tags uninstall uninstall-am + install-exec-am install-exec-hook install-html install-html-am \ + install-info install-info-am install-libLTLIBRARIES \ + install-man install-pdf install-pdf-am install-ps \ + install-ps-am install-strip installcheck installcheck-am \ + installdirs maintainer-clean maintainer-clean-generic \ + mostlyclean mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool mostlyclean-local pdf pdf-am ps ps-am tags \ + uninstall uninstall-am uninstall-libLTLIBRARIES # List all build rules defined by HDF5 Makefiles as "PHONY" targets here. @@ -1578,6 +1710,16 @@ uninstall-am: help: @$(top_srcdir)/bin/makehelp +@HAVE_SHARED_CONDITIONAL_TRUE@ # The libh5test library provides common support code for the tests. + +@HAVE_SHARED_CONDITIONAL_TRUE@ # The libdynlib1 and libdynlib2 library for testing plugin module plugin.c. +@HAVE_SHARED_CONDITIONAL_TRUE@ # Build it as shared library if configure is enabled for shared library. + +@HAVE_SHARED_CONDITIONAL_TRUE@install-exec-hook: +@HAVE_SHARED_CONDITIONAL_TRUE@ $(RM) $(DESTDIR)$(libdir)/*dynlib* + +@HAVE_SHARED_CONDITIONAL_FALSE@ # The libh5test library provides common support code for the tests. + # Additional target for running timing test timings _timings: testmeta @for timing in $(TIMINGS) dummy; do \ diff --git a/test/dynlib1.c b/test/dynlib1.c new file mode 100644 index 0000000..1ccc33a --- /dev/null +++ b/test/dynlib1.c @@ -0,0 +1,97 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by The HDF Group. * + * All rights reserved. * + * * + * This file is part of HDF5. The full HDF5 copyright notice, including * + * terms governing use, modification, and redistribution, is contained in * + * the files COPYING and Copyright.html. COPYING can be found at the root * + * of the source code distribution tree; Copyright.html can be found at the * + * root level of an installed copy of the electronic document set and is * + * linked from the top-level documents page. It can also be found at * + * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have access * + * to either file, you may request a copy from help@hdfgroup.org. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/* + * Programmer: Raymond Lu + * 13 February 2013 + * + * Purpose: Tests the plugin module (H5PL) + */ + +#include <stdlib.h> +#include <stdio.h> +#include "H5PLextern.h" + +#define H5Z_FILTER_DYNLIB1 257 + +static size_t H5Z_filter_dynlib1(unsigned int flags, size_t cd_nelmts, + const unsigned int *cd_values, size_t nbytes, size_t *buf_size, void **buf); + +/* This message derives from H5Z */ +const H5Z_class2_t H5Z_DYNLIB1[1] = {{ + H5Z_CLASS_T_VERS, /* H5Z_class_t version */ + H5Z_FILTER_DYNLIB1, /* Filter id number */ + 1, 1, /* Encoding and decoding enabled */ + "dynlib1", /* Filter name for debugging */ + NULL, /* The "can apply" callback */ + NULL, /* The "set local" callback */ + (H5Z_func_t)H5Z_filter_dynlib1, /* The actual filter function */ +}}; + +H5PL_type_t H5PLget_plugin_type(void) {return H5PL_TYPE_FILTER;} +const void *H5PLget_plugin_info(void) {return H5Z_DYNLIB1;} + +/*------------------------------------------------------------------------- + * Function: H5Z_filter_dynlib1 + * + * Purpose: A dynlib1 filter method that adds on and subtract from + * the original value with another value. It will be built + * as a shared library. plugin.c test will load and use + * this filter library. + * + * Return: Success: Data chunk size + * + * Failure: 0 + * + * Programmer: Raymond Lu + * 29 March 2013 + * + *------------------------------------------------------------------------- + */ +static size_t +H5Z_filter_dynlib1(unsigned int flags, size_t cd_nelmts, + const unsigned int *cd_values, size_t nbytes, + size_t *buf_size, void **buf) +{ + int *int_ptr = (int *)*buf; /* Pointer to the data values */ + size_t buf_left = *buf_size; /* Amount of data buffer left to process */ + int add_on = 0; + + /* Check for the correct number of parameters */ + if(cd_nelmts == 0) + return(0); + + /* Check that permanent parameters are set correctly */ + if(cd_values[0] > 9) + return(0); + + add_on = (int)cd_values[0]; + + if(flags & H5Z_FLAG_REVERSE) { /*read*/ + /* Substract the "add on" value to all the data values */ + while(buf_left > 0) { + *int_ptr++ -= add_on; + buf_left -= sizeof(int); + } /* end while */ + } /* end if */ + else { /*write*/ + /* Add the "add on" value to all the data values */ + while(buf_left > 0) { + *int_ptr++ += add_on; + buf_left -= sizeof(int); + } /* end while */ + } /* end else */ + + return nbytes; +} /* end H5Z_filter_dynlib1() */ + diff --git a/test/dynlib2.c b/test/dynlib2.c new file mode 100644 index 0000000..a853ed0 --- /dev/null +++ b/test/dynlib2.c @@ -0,0 +1,91 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by The HDF Group. * + * All rights reserved. * + * * + * This file is part of HDF5. The full HDF5 copyright notice, including * + * terms governing use, modification, and redistribution, is contained in * + * the files COPYING and Copyright.html. COPYING can be found at the root * + * of the source code distribution tree; Copyright.html can be found at the * + * root level of an installed copy of the electronic document set and is * + * linked from the top-level documents page. It can also be found at * + * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have access * + * to either file, you may request a copy from help@hdfgroup.org. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/* + * Programmer: Raymond Lu + * 13 February 2013 + * + * Purpose: Tests the plugin module (H5PL) + */ + +#include <stdlib.h> +#include <stdio.h> +#include "H5PLextern.h" + +#define H5Z_FILTER_DYNLIB2 258 +#define MULTIPLIER 3 + +static size_t H5Z_filter_dynlib2(unsigned int flags, size_t cd_nelmts, + const unsigned int *cd_values, size_t nbytes, size_t *buf_size, void **buf); + +/* This message derives from H5Z */ +const H5Z_class2_t H5Z_DYNLIB2[1] = {{ + H5Z_CLASS_T_VERS, /* H5Z_class_t version */ + H5Z_FILTER_DYNLIB2, /* Filter id number */ + 1, 1, /* Encoding and decoding enabled */ + "dynlib2", /* Filter name for debugging */ + NULL, /* The "can apply" callback */ + NULL, /* The "set local" callback */ + (H5Z_func_t)H5Z_filter_dynlib2, /* The actual filter function */ +}}; + +H5PL_type_t H5PLget_plugin_type(void) {return H5PL_TYPE_FILTER;} +const void *H5PLget_plugin_info(void) {return H5Z_DYNLIB2;} + +/*------------------------------------------------------------------------- + * Function: H5Z_filter_dynlib2 + * + * Purpose: A dynlib2 filter method that multiplies the original value + * during write and divide the original value during read. It + * will be built as a shared library. plugin.c test will load + * and use this filter library. + * + * Return: Success: Data chunk size + * + * Failure: 0 + * + * Programmer: Raymond Lu + * 29 March 2013 + * + *------------------------------------------------------------------------- + */ +static size_t +H5Z_filter_dynlib2(unsigned int flags, size_t cd_nelmts, + const unsigned int *cd_values, size_t nbytes, + size_t *buf_size, void **buf) +{ + int *int_ptr = (int *)*buf; /* Pointer to the data values */ + size_t buf_left = *buf_size; /* Amount of data buffer left to process */ + + /* Check for the correct number of parameters */ + if(cd_nelmts > 0) + return(0); + + if(flags & H5Z_FLAG_REVERSE) { /*read*/ + /* Divide the original value with MULTIPLIER */ + while(buf_left > 0) { + *int_ptr++ /= MULTIPLIER; + buf_left -= sizeof(int); + } /* end while */ + } /* end if */ + else { /*write*/ + /* Multiply the original value with MULTIPLIER */ + while(buf_left > 0) { + *int_ptr++ *= MULTIPLIER; + buf_left -= sizeof(int); + } /* end while */ + } /* end else */ + + return nbytes; +} /* end H5Z_filter_dynlib2() */ + diff --git a/test/dynlib3.c b/test/dynlib3.c new file mode 100644 index 0000000..9560b86 --- /dev/null +++ b/test/dynlib3.c @@ -0,0 +1,102 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by The HDF Group. * + * All rights reserved. * + * * + * This file is part of HDF5. The full HDF5 copyright notice, including * + * terms governing use, modification, and redistribution, is contained in * + * the files COPYING and Copyright.html. COPYING can be found at the root * + * of the source code distribution tree; Copyright.html can be found at the * + * root level of an installed copy of the electronic document set and is * + * linked from the top-level documents page. It can also be found at * + * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have access * + * to either file, you may request a copy from help@hdfgroup.org. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/* + * Programmer: Raymond Lu + * 1 April 2013 + * + * Purpose: Tests the plugin module (H5PL) + */ + +#include <stdlib.h> +#include <stdio.h> +#include <string.h> +#include "H5PLextern.h" + +#define H5Z_FILTER_DYNLIB3 259 +#define SUFFIX_LEN 8 +#define GROUP_SUFFIX ".h5group" + +static size_t H5Z_filter_dynlib3(unsigned int flags, size_t cd_nelmts, + const unsigned int *cd_values, size_t nbytes, size_t *buf_size, void **buf); + +/* This message derives from H5Z */ +const H5Z_class2_t H5Z_DYNLIB3[1] = {{ + H5Z_CLASS_T_VERS, /* H5Z_class_t version */ + H5Z_FILTER_DYNLIB3, /* Filter id number */ + 1, 1, /* Encoding and decoding enabled */ + "dynlib3", /* Filter name for debugging */ + NULL, /* The "can apply" callback */ + NULL, /* The "set local" callback */ + (H5Z_func_t)H5Z_filter_dynlib3, /* The actual filter function */ +}}; + +H5PL_type_t H5PLget_plugin_type(void) {return H5PL_TYPE_FILTER;} +const void *H5PLget_plugin_info(void) {return H5Z_DYNLIB3;} + +/*------------------------------------------------------------------------- + * Function: H5Z_filter_dynlib3 + * + * Purpose: A dynlib3 filter method that is used to test groups. It + * appends the suffix ".h5group" to each group name during + * write and takes it out during read. + * + * Return: Success: Data chunk size + * + * Failure: 0 + * + * Programmer: Raymond Lu + * 1 April 2013 + * + *------------------------------------------------------------------------- + */ +static size_t +H5Z_filter_dynlib3(unsigned int flags, size_t cd_nelmts, + const unsigned int *cd_values, size_t nbytes, + size_t *buf_size, void **buf) +{ + size_t ret_value; /* Return value */ + + /* Check for the correct number of parameters */ + if(cd_nelmts > 0) + return(0); + + if(flags & H5Z_FLAG_REVERSE) { /*read*/ + ret_value = *buf_size = nbytes - SUFFIX_LEN; + } /* end if */ + else { /*write*/ + void *outbuf = NULL; /* Pointer to new buffer */ + unsigned char *dst; /* Temporary pointer to destination buffer */ + + dst = (unsigned char *)(outbuf = malloc(nbytes + SUFFIX_LEN)); + + /* Copy raw data */ + memcpy((void*)dst, (void*)(*buf), nbytes); + + /* Append suffix to raw data for storage */ + dst += nbytes; + memcpy(dst, (void*)GROUP_SUFFIX, SUFFIX_LEN); + + /* Free input buffer */ + free(*buf); + + /* Set return values */ + *buf_size = nbytes + SUFFIX_LEN; + *buf = outbuf; + outbuf = NULL; + ret_value = *buf_size; + } /* end else */ + + return ret_value; +} /* H5Z_filter_dynlib3() */ + diff --git a/test/file_image.c b/test/file_image.c index c734db8..d4056a7 100644 --- a/test/file_image.c +++ b/test/file_image.c @@ -1207,6 +1207,9 @@ test_get_file_image_error_rejection(void) err = H5Fclose(file_id); VERIFY(err == SUCCEED, "H5Fclose(2) failed."); + /* tidy up */ + result = h5_cleanup(FILENAME2, fapl_id); + VERIFY(result != 0, "h5_cleanup(2 failed."); /************************** Test #4 **********************************/ /* set up a family file driver test file, and try to get its image diff --git a/test/fillval.c b/test/fillval.c index 847dfbd..9271f80 100644 --- a/test/fillval.c +++ b/test/fillval.c @@ -37,6 +37,7 @@ const char *FILENAME[] = { "fillval_6", "fillval_7", "fillval_8", + "fillval_9", NULL }; @@ -2085,6 +2086,266 @@ error: return 1; } +/*------------------------------------------------------------------------- + * Function: test_partalloc_cases + * + * Purpose: Tests fill values read and write for datasets. + * + * Return: Success: 0 + * + * Failure: 1 + * + * Programmer: Joel Plutchak + * April 15, 2013 + * + * Modifications: + * This function is called by test_rdwr to write and read + * dataset for different cases of chunked datasets with + * unallocated chunks. + * + *------------------------------------------------------------------------- + */ + +static int +test_partalloc_cases(hid_t file, hid_t dcpl, const char *dname, H5D_fill_time_t fill_time) +{ + hid_t fspace=-1, dset1=-1, rspace = -1; + herr_t ret; + hsize_t ds_size[2] = {4, 4}; + hsize_t max_size[2] = {H5S_UNLIMITED,4}; + hsize_t chunk_size[2] = {1, 4}; + int fillval=(-1); + int w_values[] = {42}; /* New value to be written */ + int f_values[4] = {88,88,88,88}; /* pre-seed read buffer with known values */ + int r_values[4] = {88,88,88,88}; /* pre-seed read buffer with known values */ + hsize_t coord[1][2]; /* coordinate(s) of point to write */ + hsize_t start[2], count[2]; + + fillval = 0; /* default fill value is zero */ + + /* Create dataset with 4x4 integer dataset */ + if((fspace = H5Screate_simple(2, ds_size, max_size)) < 0) + goto error; + if((dset1 = H5Dcreate2(file, dname, H5T_NATIVE_INT, fspace, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) + goto error; + + /* + * Select a point in the file dataspace. + */ + coord[0][0]=0; coord[0][1]=0; + if (H5Sselect_elements( fspace, H5S_SELECT_SET, (size_t)1, (const hsize_t *)coord)) + goto error; + + /* + * Write single data point to the dataset. + */ + if ((ret = H5Dwrite(dset1, H5T_NATIVE_INT, H5S_ALL, fspace, H5P_DEFAULT, w_values))< 0) { + goto error; + } + + /* Read a line/chunk and make sure values are right */ + rspace = H5Screate_simple(2, chunk_size, NULL); + + /* Read the first row of elements: one known plus three fill */ + start[0] = 0; + start[1] = 0; + count[0] = 1; + count[1] = 4; + if ((ret = H5Sselect_hyperslab(fspace, H5S_SELECT_SET, start, NULL, count, NULL)) < 0) + goto error; + if ((ret = H5Sselect_all(rspace)) < 0) + goto error; + if(H5Dread(dset1, H5T_NATIVE_INT, rspace, fspace, H5P_DEFAULT, &r_values) < 0) + goto error; + + /* Read the third row of elements: all fill */ + start[0] = 2; + start[1] = 0; + count[0] = 1; + count[1] = 4; + if ((ret = H5Sselect_hyperslab(fspace, H5S_SELECT_SET, start, NULL, count, NULL)) < 0) + goto error; + if(H5Dread(dset1, H5T_NATIVE_INT, rspace, fspace, H5P_DEFAULT, &f_values) < 0) + goto error; + + if(fill_time != H5D_FILL_TIME_NEVER) { + /* check allocated chunk */ + if ((r_values[0] != w_values[0]) || + (r_values[1] != fillval) || + (r_values[2] != fillval) || + (r_values[3] != fillval)) { + H5_FAILED(); + HDfprintf(stdout, "%u: Allocated chunk value read was not correct.\n", (unsigned)__LINE__); + printf(" {%ld,%ld,%ld,%ld} should be {%ld,%ld,%ld,%ld}\n", + (long)r_values[0], (long)r_values[1], + (long)r_values[2], (long)r_values[3], + (long)w_values[0], (long)fillval, + (long)fillval, (long)fillval ); + goto error; + } + /* check unallocated chunk */ + if ((f_values[0] != fillval) || + (f_values[1] != fillval) || + (f_values[2] != fillval) || + (f_values[3] != fillval)) { + H5_FAILED(); + HDfprintf(stdout, "%u: Unallocated chunk value read was not correct.\n", (unsigned)__LINE__); + printf(" {%ld,%ld,%ld,%ld} should be {%ld,%ld,%ld,%ld}\n", + (long)f_values[0], (long)f_values[1], + (long)f_values[2], (long)f_values[3], + (long)fillval, (long)fillval, + (long)fillval, (long)fillval ); + goto error; + } + /* for the "never fill" case expect to get trash values, so skip */ + } + else if(fill_time == H5D_FILL_TIME_NEVER) { + } + + if(H5Sclose(rspace) < 0) goto error; + if(H5Dclose(dset1) < 0) goto error; + if(H5Sclose(fspace) < 0) goto error; + return 0; + + error: + H5E_BEGIN_TRY { + H5Dclose(dset1); + H5Sclose(fspace); + H5Sclose(rspace); + } H5E_END_TRY; + + return 1; +} + + +/*------------------------------------------------------------------------- + * Function: test_partalloc + * + * Purpose: Tests fill values for chunked, partially-allocated datasets. + * Regression test for HDFFV-8247. + * + * Return: Success: 0 + * + * Failure: number of errors + * + * Programmer: Joel Plutchak + * April 15, 2013 + * + *------------------------------------------------------------------------- + */ +static int +test_partalloc(hid_t fapl, const char *base_name) +{ + char filename[1024]; + hid_t file=-1, dcpl=-1; + hsize_t ch_size[2] = {1, 4}; + int nerrors=0; + + TESTING("chunked dataset partially allocated I/O"); + + h5_fixname(base_name, fapl, filename, sizeof filename); + if((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) + goto error; + + if((dcpl=H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error; + if(H5Pset_chunk(dcpl, 2, ch_size) < 0) goto error; + + /* I. Test H5D_ALLOC_TIME_LATE space allocation cases */ + if(H5Pset_alloc_time(dcpl, H5D_ALLOC_TIME_LATE) < 0) goto error; +#ifdef DEBUG + fprintf( stdout, "\nALLOC_TIME_LATE\n" ); +#endif + + /* case for H5D_FILL_TIME_ALLOC as fill write time and fill value to be default */ + if(H5Pset_fill_time(dcpl, H5D_FILL_TIME_ALLOC) < 0) goto error; +#ifdef DEBUG + fprintf( stdout, " FILL_TIME_ALLOC\n" ); +#endif + nerrors += test_partalloc_cases(file, dcpl, "dset1", H5D_FILL_TIME_ALLOC); + + /* case for H5D_FILL_TIME_NEVER as fill write time and fill value to be default */ + if(H5Pset_fill_time(dcpl, H5D_FILL_TIME_NEVER) < 0) goto error; +#ifdef DEBUG + fprintf( stdout, " FILL_TIME_NEVER\n" ); +#endif + nerrors += test_partalloc_cases(file, dcpl, "dset2", H5D_FILL_TIME_NEVER ); + + /* case for H5D_FILL_TIME_IFSET as fill write time and fill value to be default */ + if(H5Pset_fill_time(dcpl, H5D_FILL_TIME_IFSET) < 0) goto error; +#ifdef DEBUG + fprintf( stdout, " FILL_TIME_IFSET\n" ); +#endif + nerrors += test_partalloc_cases(file, dcpl, "dset3", H5D_FILL_TIME_IFSET ); + + /* II. Test H5D_ALLOC_TIME_INCR space allocation cases */ + if(H5Pset_alloc_time(dcpl, H5D_ALLOC_TIME_INCR) < 0) goto error; +#ifdef DEBUG + fprintf( stdout, "\nALLOC_TIME_INCR\n" ); +#endif + + /* case for H5D_FILL_TIME_ALLOC as fill write time and fill value to be default */ + if(H5Pset_fill_time(dcpl, H5D_FILL_TIME_ALLOC) < 0) goto error; +#ifdef DEBUG + fprintf( stdout, " FILL_TIME_ALLOC\n" ); +#endif + nerrors += test_partalloc_cases(file, dcpl, "dset4", H5D_FILL_TIME_ALLOC ); + + /* case for H5D_FILL_TIME_NEVER as fill write time and fill value to be default */ + if(H5Pset_fill_time(dcpl, H5D_FILL_TIME_NEVER) < 0) goto error; +#ifdef DEBUG + fprintf( stdout, " FILL_TIME_NEVER\n" ); +#endif + nerrors += test_partalloc_cases(file, dcpl, "dset5", H5D_FILL_TIME_NEVER ); + + /* case for H5D_FILL_TIME_IFSET as fill write time and fill value to be default */ + if(H5Pset_fill_time(dcpl, H5D_FILL_TIME_IFSET) < 0) goto error; +#ifdef DEBUG + fprintf( stdout, " FILL_TIME_IFSET\n" ); +#endif + nerrors += test_partalloc_cases(file, dcpl, "dset6", H5D_FILL_TIME_IFSET ); + + /* III. Test H5D_ALLOC_TIME_EARLY space allocation cases */ + if(H5Pset_alloc_time(dcpl, H5D_ALLOC_TIME_EARLY) < 0) goto error; +#ifdef DEBUG + fprintf( stdout, "\nALLOC_TIME_EARLY\n" ); +#endif + + /* case for H5D_FILL_TIME_ALLOC as fill write time and fill value to be default */ + if(H5Pset_fill_time(dcpl, H5D_FILL_TIME_ALLOC) < 0) goto error; +#ifdef DEBUG + fprintf( stdout, " FILL_TIME_ALLOC\n" ); +#endif + nerrors += test_partalloc_cases(file, dcpl, "dset7", H5D_FILL_TIME_ALLOC ); + + /* case for H5D_FILL_TIME_NEVER as fill write time and fill value to be default */ + if(H5Pset_fill_time(dcpl, H5D_FILL_TIME_NEVER) < 0) goto error; +#ifdef DEBUG + fprintf( stdout, " FILL_TIME_NEVER\n" ); +#endif + nerrors += test_partalloc_cases(file, dcpl, "dset8", H5D_FILL_TIME_NEVER ); + + /* case for H5D_FILL_TIME_IFSET as fill write time and fill value to be default */ + if(H5Pset_fill_time(dcpl, H5D_FILL_TIME_IFSET) < 0) goto error; +#ifdef DEBUG + fprintf( stdout, " FILL_TIME_IFSET\n" ); +#endif + nerrors += test_partalloc_cases(file, dcpl, "dset9", H5D_FILL_TIME_IFSET ); + + if(nerrors) + goto error; + if(H5Pclose(dcpl) < 0) goto error; + if(H5Fclose(file) < 0) goto error; + PASSED(); + return 0; + + error: + H5E_BEGIN_TRY { + H5Pclose(dcpl); + H5Fclose(file); + } H5E_END_TRY; + return nerrors; +} + /*------------------------------------------------------------------------- * Function: main @@ -2157,6 +2418,7 @@ main(int argc, char *argv[]) nerrors += test_create(my_fapl, FILENAME[0], H5D_CHUNKED); nerrors += test_rdwr (my_fapl, FILENAME[2], H5D_CHUNKED); nerrors += test_extend(my_fapl, FILENAME[4], H5D_CHUNKED); + nerrors += test_partalloc(my_fapl, FILENAME[8]); } /* end if */ /* Contiguous storage layout tests */ diff --git a/test/h5test.c b/test/h5test.c index 91497e3..32d78bd 100644 --- a/test/h5test.c +++ b/test/h5test.c @@ -1124,24 +1124,8 @@ h5_make_local_copy(const char *origfilename, const char *local_copy_name) { int fd_old = (-1), fd_new = (-1); /* File descriptors for copying data */ ssize_t nread; /* Number of bytes read in */ - char buf[READ_BUF_SIZE]; /* Buffer for copying data */ - char filename[FILENAME_BUF_SIZE] = ""; -#ifdef H5_VMS - HDstrcat(filename, origfilename); -#else - const char * srcdir = HDgetenv("srcdir"); /* The source directory */ - - /* Check for using the srcdir from configure time */ - if(NULL == srcdir) - srcdir = config_srcdir; - - if(srcdir && ((HDstrlen(srcdir) + - HDstrlen(origfilename) + 6) < FILENAME_BUF_SIZE)) { - HDstrcpy(filename, srcdir); - HDstrcat(filename, "/"); - } - HDstrcat(filename, origfilename); -#endif + char buf[READ_BUF_SIZE]; /* Buffer for copying data */ + const char *filename = H5_get_srcdir_filename(origfilename);; /* Get the test file name to copy */ /* Copy old file into temporary file */ if((fd_old = HDopen(filename, O_RDONLY, 0666)) < 0) return -1; diff --git a/test/links.c b/test/links.c index 19b620a..6aad164 100644 --- a/test/links.c +++ b/test/links.c @@ -558,8 +558,8 @@ cklinks(hid_t fapl, hbool_t new_format) } /* end if */ if(H5F_addr_ne(oinfo1.addr, oinfo2.addr)) { H5_FAILED(); - puts(" Hard link test failed. Link seems not to point to the "); - puts(" expected file location."); + HDputs(" Hard link test failed. Link seems not to point to the "); + HDputs(" expected file location."); TEST_ERROR } /* end if */ if(H5Lexists(file, "d1", H5P_DEFAULT) != TRUE) FAIL_STACK_ERROR @@ -574,14 +574,14 @@ cklinks(hid_t fapl, hbool_t new_format) } /* end if */ if(H5F_addr_ne(oinfo1.addr, oinfo2.addr)) { H5_FAILED(); - puts(" Soft link test failed. Link seems not to point to the "); - puts(" expected file location."); + HDputs(" Soft link test failed. Link seems not to point to the "); + HDputs(" expected file location."); TEST_ERROR } /* end if */ if(H5Lget_val(file, "grp1/soft", linkval, sizeof linkval, H5P_DEFAULT) < 0) FAIL_STACK_ERROR if(HDstrcmp(linkval, "/d1")) { H5_FAILED(); - puts(" Soft link test failed. Wrong link value"); + HDputs(" Soft link test failed. Wrong link value"); TEST_ERROR } /* end if */ if(H5Lexists(file, "grp1/soft", H5P_DEFAULT) != TRUE) FAIL_STACK_ERROR @@ -592,7 +592,7 @@ cklinks(hid_t fapl, hbool_t new_format) } H5E_END_TRY; if(status >= 0) { H5_FAILED(); - puts(" H5Oget_info_by_name() should have failed for a dangling link."); + HDputs(" H5Oget_info_by_name() should have failed for a dangling link."); TEST_ERROR } /* end if */ if(H5Lget_info(file, "grp1/dangle", &linfo2, H5P_DEFAULT) < 0) FAIL_STACK_ERROR @@ -608,7 +608,7 @@ cklinks(hid_t fapl, hbool_t new_format) } /* end if */ if(HDstrcmp(linkval, "foobar")) { H5_FAILED(); - puts(" Dangling link test failed. Wrong link value"); + HDputs(" Dangling link test failed. Wrong link value"); TEST_ERROR } /* end if */ if(H5Lexists(file, "grp1/dangle", H5P_DEFAULT) != TRUE) FAIL_STACK_ERROR @@ -619,7 +619,7 @@ cklinks(hid_t fapl, hbool_t new_format) } H5E_END_TRY; if(status >= 0) { H5_FAILED(); - puts(" H5Oget_info_by_name() should have failed for a recursive link."); + HDputs(" H5Oget_info_by_name() should have failed for a recursive link."); TEST_ERROR } /* end if */ if(H5Lget_info(file, "grp1/recursive", &linfo2, H5P_DEFAULT) < 0) FAIL_STACK_ERROR @@ -635,7 +635,7 @@ cklinks(hid_t fapl, hbool_t new_format) } /* end if */ if(HDstrcmp(linkval, "/grp1/recursive")) { H5_FAILED(); - puts(" Recursive link test failed. Wrong link value"); + HDputs(" Recursive link test failed. Wrong link value"); TEST_ERROR } /* end if */ @@ -700,8 +700,8 @@ ck_new_links(hid_t fapl, hbool_t new_format) } if(H5F_addr_ne(oi_dset.addr, oi_hard1.addr) || H5F_addr_ne(oi_dset.addr, oi_hard2.addr)) { H5_FAILED(); - puts(" Hard link test failed. Link seems not to point to the "); - puts(" expected file location."); + HDputs(" Hard link test failed. Link seems not to point to the "); + HDputs(" expected file location."); TEST_ERROR } @@ -905,7 +905,7 @@ toomany(hid_t fapl, hbool_t new_format) } H5E_END_TRY; if(gid >= 0) { H5_FAILED(); - puts(" Should have failed for sequence of too many nested links."); + HDputs(" Should have failed for sequence of too many nested links."); TEST_ERROR } /* end if */ @@ -1189,7 +1189,7 @@ test_move(hid_t fapl, hbool_t new_format) } H5E_END_TRY; if(moved_grp >= 0) { H5_FAILED(); - puts(" Group still in original location?"); + HDputs(" Group still in original location?"); TEST_ERROR } /* end if */ @@ -1684,8 +1684,8 @@ test_deprec(hid_t fapl, hbool_t new_format) if(HDmemcmp(&sb_hard1.objno, sb_hard2.objno, sizeof(sb_hard1.objno))) { H5_FAILED(); - puts(" Hard link test failed. Link seems not to point to the "); - puts(" expected file location."); + HDputs(" Hard link test failed. Link seems not to point to the "); + HDputs(" expected file location."); TEST_ERROR } /* end if */ @@ -1695,8 +1695,8 @@ test_deprec(hid_t fapl, hbool_t new_format) if(HDmemcmp(&sb_hard1.objno, sb_hard2.objno, sizeof(sb_hard1.objno))) { H5_FAILED(); - puts(" Hard link test failed. Link seems not to point to the "); - puts(" expected file location."); + HDputs(" Hard link test failed. Link seems not to point to the "); + HDputs(" expected file location."); TEST_ERROR } /* end if */ @@ -1812,19 +1812,19 @@ external_link_root(hid_t fapl, hbool_t new_format) if(H5Lget_info(fid, "ext_link", &linfo, H5P_DEFAULT) < 0) goto error; if(H5L_TYPE_EXTERNAL != linfo.type) { H5_FAILED(); - puts(" Unexpected object type - should have been an external link"); + HDputs(" Unexpected object type - should have been an external link"); goto error; } if(H5Lget_val(fid, "ext_link", objname, sizeof(objname), H5P_DEFAULT) < 0) TEST_ERROR if(H5Lunpack_elink_val(objname, linfo.u.val_size, NULL, &file, &path) < 0) TEST_ERROR if(HDstrcmp(file, filename1)) { H5_FAILED(); - puts(" External link file name incorrect"); + HDputs(" External link file name incorrect"); goto error; } if(HDstrcmp(path, "/")) { H5_FAILED(); - puts(" External link path incorrect"); + HDputs(" External link path incorrect"); goto error; } @@ -1836,19 +1836,19 @@ external_link_root(hid_t fapl, hbool_t new_format) if(H5Lget_info(fid, "ext_link", &linfo, H5P_DEFAULT) < 0) goto error; if(H5L_TYPE_EXTERNAL != linfo.type) { H5_FAILED(); - puts(" Unexpected object type - should have been an external link"); + HDputs(" Unexpected object type - should have been an external link"); goto error; } if(H5Lget_val(fid, "ext_link", objname, sizeof(objname), H5P_DEFAULT) < 0) TEST_ERROR if(H5Lunpack_elink_val(objname, linfo.u.val_size, NULL, &file, &path) < 0) TEST_ERROR if(HDstrcmp(file, filename1)) { H5_FAILED(); - puts(" External link file name incorrect"); + HDputs(" External link file name incorrect"); goto error; } if(HDstrcmp(path, "/")) { H5_FAILED(); - puts(" External link path incorrect"); + HDputs(" External link path incorrect"); goto error; } @@ -2693,7 +2693,7 @@ external_link_dangling(hid_t fapl, hbool_t new_format) } H5E_END_TRY; if (gid >= 0) { H5_FAILED(); - puts(" Should have failed for sequence of too many nested links."); + HDputs(" Should have failed for sequence of too many nested links."); goto error; } @@ -2703,7 +2703,7 @@ external_link_dangling(hid_t fapl, hbool_t new_format) } H5E_END_TRY; if (gid >= 0) { H5_FAILED(); - puts(" Should have failed for sequence of too many nested links."); + HDputs(" Should have failed for sequence of too many nested links."); goto error; } @@ -2713,7 +2713,7 @@ external_link_dangling(hid_t fapl, hbool_t new_format) } H5E_END_TRY; if (status >= 0) { H5_FAILED(); - puts(" Retreiving name of object by index through dangling file external link should have failed."); + HDputs(" Retreiving name of object by index through dangling file external link should have failed."); } /* end if */ /* Close root group */ @@ -2810,7 +2810,7 @@ external_link_prefix(hid_t fapl, hbool_t new_format) /* should be able to find the target file from pathnames set via H5Pset_elink_prefix() */ if (gid < 0) { H5_FAILED(); - puts(" Should have found the file in tmp directory."); + HDputs(" Should have found the file in tmp directory."); goto error; } @@ -2905,7 +2905,7 @@ external_link_abs_mainpath(hid_t fapl, hbool_t new_format) /* should be able to find the target file from absolute path set for main file */ if(gid < 0) { H5_FAILED(); - puts(" Should have found the file in tmp directory."); + HDputs(" Should have found the file in tmp directory."); goto error; } @@ -2991,7 +2991,7 @@ external_link_rel_mainpath(hid_t fapl, hbool_t new_format) /* should be able to find the target file from the main file's relative pathname */ if (gid < 0) { H5_FAILED(); - puts(" Should have found the file in current working directory"); + HDputs(" Should have found the file in current working directory"); goto error; } @@ -3083,7 +3083,7 @@ external_link_cwd(hid_t fapl, hbool_t new_format) /* should be able to find the target file from the current working directory */ if(gid < 0) { H5_FAILED(); - puts(" Should have found the file in current working directory"); + HDputs(" Should have found the file in current working directory"); goto error; } @@ -3179,7 +3179,7 @@ external_link_abstar(hid_t fapl, hbool_t new_format) /* should be able to find the target file with abolute path */ if(gid < 0) { H5_FAILED(); - puts(" Should have found the file in tmp directory."); + HDputs(" Should have found the file in tmp directory."); goto error; } @@ -3273,7 +3273,7 @@ external_link_abstar_cur(hid_t fapl, hbool_t new_format) /* should be able to find the target file from main file's current working directory */ if (gid < 0) { H5_FAILED(); - puts(" Should have found the file in current working directory."); + HDputs(" Should have found the file in current working directory."); goto error; } @@ -3353,7 +3353,7 @@ external_link_reltar(hid_t fapl, hbool_t new_format) /* Open object through external link */ if((gid = H5Gopen2(fid, "ext_link", H5P_DEFAULT)) < 0) { H5_FAILED(); - puts(" Should have found the file in tmp directory."); + HDputs(" Should have found the file in tmp directory."); goto error; } /* end if */ @@ -3450,7 +3450,7 @@ external_link_chdir(hid_t fapl, hbool_t new_format) */ if (gid < 0) { H5_FAILED(); - puts(" Should have found the file in tmp directory."); + HDputs(" Should have found the file in tmp directory."); goto error; } @@ -3625,7 +3625,7 @@ external_set_elink_fapl1(hid_t fapl, hbool_t new_format) /* should succeed in opening the target object A in the current working directory */ if (oidA < 0) { H5_FAILED(); - puts(" Should succeed in opening family target file A in current working directory"); + HDputs(" Should succeed in opening family target file A in current working directory"); goto error; } @@ -3639,7 +3639,7 @@ external_set_elink_fapl1(hid_t fapl, hbool_t new_format) /* should succeed in opening the target object B in the current working directory */ if (oidB < 0) { H5_FAILED(); - puts(" Should succeed in opening multi target file B in current working directory"); + HDputs(" Should succeed in opening multi target file B in current working directory"); goto error; } @@ -3785,7 +3785,7 @@ external_set_elink_fapl2(hid_t fapl, hbool_t new_format) did = H5Dopen2(fid, "ext_link", dapl_id); if(did < 0) { H5_FAILED(); - puts(" Should succeed in opening the target dataset"); + HDputs(" Should succeed in opening the target dataset"); goto error; } @@ -4371,7 +4371,7 @@ external_link_win1(hid_t fapl, hbool_t new_format) /* should be able to find the target file via main file's CWD*/ if(gid < 0) { H5_FAILED(); - puts(" Should have found the file in CWD."); + HDputs(" Should have found the file in CWD."); goto error; } @@ -4465,7 +4465,7 @@ external_link_win2(hid_t fapl, hbool_t new_format) /* should be able to find the target file directly */ if(gid < 0) { H5_FAILED(); - puts(" Should have found the file in tmp."); + HDputs(" Should have found the file in tmp."); goto error; } @@ -4558,7 +4558,7 @@ external_link_win3(hid_t fapl, hbool_t new_format) /* should be able to find the target file directly */ if (gid < 0) { H5_FAILED(); - puts(" Should have found the file in tmp."); + HDputs(" Should have found the file in tmp."); goto error; } @@ -4647,7 +4647,7 @@ external_link_win4(hid_t fapl, hbool_t new_format) /* should be able to find the target file via main file's absolute drive/relative path */ if (gid < 0) { H5_FAILED(); - puts(" Should have found the file in CWD."); + HDputs(" Should have found the file in CWD."); goto error; } @@ -4743,7 +4743,7 @@ external_link_win5(hid_t fapl, hbool_t new_format) /* should be able to find the target file via main file's rel drive/abs path */ if(gid < 0) { H5_FAILED(); - puts(" Should have found the file in CWD."); + HDputs(" Should have found the file in CWD."); goto error; } @@ -4836,7 +4836,7 @@ external_link_win6(hid_t fapl, hbool_t new_format) /* should be able to find the target file via target file's rel path in current drive */ if (gid < 0) { H5_FAILED(); - puts(" Should have found the file in tmp."); + HDputs(" Should have found the file in tmp."); goto error; } @@ -4923,7 +4923,7 @@ external_link_win7(hid_t fapl, hbool_t new_format) /* should be able to find the target file via main file's local host/main drive*/ if(gid < 0) { H5_FAILED(); - puts(" Should have found the file in local host/main drive."); + HDputs(" Should have found the file in local host/main drive."); goto error; } @@ -5015,7 +5015,7 @@ external_link_win8(hid_t fapl, hbool_t new_format) /* should be able to find the target file directly */ if(gid < 0) { H5_FAILED(); - puts(" Should have found the file in tmp."); + HDputs(" Should have found the file in tmp."); goto error; } @@ -5102,7 +5102,7 @@ external_link_win9(hid_t fapl, hbool_t new_format) /* should be able to find the target file via main file's local host/main drive*/ if(gid < 0) { H5_FAILED(); - puts(" Should have found the file in local host/main drive."); + HDputs(" Should have found the file in local host/main drive."); goto error; } @@ -5173,7 +5173,7 @@ external_link_recursive(hid_t fapl, hbool_t new_format) } H5E_END_TRY; if (gid >= 0) { H5_FAILED(); - puts(" Should have failed for recursive external links."); + HDputs(" Should have failed for recursive external links."); goto error; } @@ -5243,7 +5243,7 @@ external_link_query(hid_t fapl, hbool_t new_format) if(li.u.val_size != (1 + (HDstrlen(filename2) + 1) + (HDstrlen("/dst") + 1))) TEST_ERROR if (H5L_TYPE_EXTERNAL != li.type) { H5_FAILED(); - puts(" Unexpected link class - should have been an external link"); + HDputs(" Unexpected link class - should have been an external link"); goto error; } @@ -5269,7 +5269,7 @@ external_link_query(hid_t fapl, hbool_t new_format) if(li.u.val_size != (1 + (HDstrlen(filename2) + 1) + (HDstrlen("/dst") + 1))) TEST_ERROR if(H5L_TYPE_EXTERNAL != li.type) { H5_FAILED(); - puts(" Unexpected link class - should have been an external link"); + HDputs(" Unexpected link class - should have been an external link"); goto error; } @@ -5287,7 +5287,7 @@ external_link_query(hid_t fapl, hbool_t new_format) if(H5Oget_info_by_name(fid, "src", &oi, H5P_DEFAULT) < 0) FAIL_STACK_ERROR if(H5O_TYPE_GROUP != oi.type) { H5_FAILED(); - puts(" Unexpected object type - should have been a group"); + HDputs(" Unexpected object type - should have been a group"); goto error; } @@ -6510,7 +6510,7 @@ external_symlink(const char *env_h5_drvr, hid_t fapl, hbool_t new_format) } /* end if */ else { SKIPPED(); - puts(" Current VFD doesn't support POSIX I/O calls"); + HDputs(" Current VFD doesn't support POSIX I/O calls"); } /* end else */ return 0; @@ -6530,7 +6530,7 @@ external_symlink(const char *env_h5_drvr, hid_t fapl, hbool_t new_format) return -1; #else /* H5_HAVE_SYMLINK */ SKIPPED(); - puts(" Current file system or operating system doesn't support symbolic links"); + HDputs(" Current file system or operating system doesn't support symbolic links"); return 0; #endif /* H5_HAVE_SYMLINK */ @@ -7569,7 +7569,7 @@ ud_hard_links(hid_t fapl) if(li.u.val_size != 0) TEST_ERROR if(UD_HARD_TYPE != li.type) { H5_FAILED(); - puts(" Unexpected link class - should have been a UD hard link"); + HDputs(" Unexpected link class - should have been a UD hard link"); goto error; } /* end if */ @@ -7983,7 +7983,7 @@ ud_callbacks(hid_t fapl, hbool_t new_format) if(li.u.val_size != 16) TEST_ERROR if (UD_CB_TYPE != li.type) { H5_FAILED(); - puts(" Unexpected link class - should have been a UD hard link"); + HDputs(" Unexpected link class - should have been a UD hard link"); goto error; } @@ -8631,7 +8631,7 @@ lapl_nlinks(hid_t fapl, hbool_t new_format) } H5E_END_TRY; if (gid >= 0) { H5_FAILED(); - puts(" Should have failed for sequence of too many nested links."); + HDputs(" Should have failed for sequence of too many nested links."); goto error; } @@ -10146,7 +10146,7 @@ corder_create_empty(hid_t fapl) } H5E_END_TRY; if(ret > 0) { H5_FAILED(); - puts(" H5Pset_link_create_order() should have failed for a creation order index with no tracking."); + HDputs(" H5Pset_link_create_order() should have failed for a creation order index with no tracking."); TEST_ERROR } /* end if */ @@ -14702,7 +14702,7 @@ main(void) if(nerrors) { printf("***** %d LINK TEST%s FAILED! *****\n", nerrors, 1 == nerrors ? "" : "S"); - exit(1); + HDexit(1); } printf("All link tests passed.\n"); @@ -14717,7 +14717,7 @@ main(void) return 0; error: - puts("*** TESTS FAILED ***"); + HDputs("*** TESTS FAILED ***"); return 1; } diff --git a/test/links_env.c b/test/links_env.c index 2da5e64..308d562 100644 --- a/test/links_env.c +++ b/test/links_env.c @@ -21,7 +21,6 @@ #define H5G_TESTING #include "h5test.h" -#include "H5srcdir.h" #include "H5Gpkg.h" /* Groups */ #include "H5Iprivate.h" /* IDs */ #include "H5Lprivate.h" /* Links */ diff --git a/test/plugin.c b/test/plugin.c new file mode 100644 index 0000000..86bc952 --- /dev/null +++ b/test/plugin.c @@ -0,0 +1,732 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by The HDF Group. * + * All rights reserved. * + * * + * This file is part of HDF5. The full HDF5 copyright notice, including * + * terms governing use, modification, and redistribution, is contained in * + * the files COPYING and Copyright.html. COPYING can be found at the root * + * of the source code distribution tree; Copyright.html can be found at the * + * root level of an installed copy of the electronic document set and is * + * linked from the top-level documents page. It can also be found at * + * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have access * + * to either file, you may request a copy from help@hdfgroup.org. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/* + * Programmer: Raymond Lu + * 13 February 2013 + * + * Purpose: Tests the plugin module (H5PL) + */ +#include <stdlib.h> +#include <time.h> + +#include "h5test.h" +#include "H5srcdir.h" + +/* + * This file needs to access private datatypes from the H5Z package. + */ +#define H5Z_PACKAGE +#include "H5Zpkg.h" + +/* Filters for HDF5 internal test */ +#define H5Z_FILTER_DYNLIB1 257 +#define H5Z_FILTER_DYNLIB2 258 +#define H5Z_FILTER_DYNLIB3 259 + +const char *FILENAME[] = { + "plugin", + NULL +}; +#define FILENAME_BUF_SIZE 1024 + +/* Dataset names for testing filters */ +#define DSET_DEFLATE_NAME "deflate" +#define DSET_DYNLIB1_NAME "dynlib1" +#define DSET_DYNLIB2_NAME "dynlib2" + +/* Parameters for internal filter test */ +#define FILTER_CHUNK_DIM1 2 +#define FILTER_CHUNK_DIM2 25 +#define FILTER_HS_OFFSET1 7 +#define FILTER_HS_OFFSET2 30 +#define FILTER_HS_SIZE1 4 +#define FILTER_HS_SIZE2 50 + +/* Shared global arrays */ +#define DSET_DIM1 100 +#define DSET_DIM2 200 + +/* Limit random number within 20000 */ +#define RANDOM_LIMIT 20000 + +#define GROUP_ITERATION 1000 + +int points_deflate[DSET_DIM1][DSET_DIM2], + points_dynlib1[DSET_DIM1][DSET_DIM2], + points_dynlib2[DSET_DIM1][DSET_DIM2], + points_bzip2[DSET_DIM1][DSET_DIM2]; + + +/*------------------------------------------------------------------------- + * Function: test_filter_internal + * + * Purpose: Tests writing entire data and partial data with filters + * + * Return: Success: 0 + * Failure: -1 + * + * Programmer: Raymond Lu + * 27 February 2013 + * + *------------------------------------------------------------------------- + */ +static herr_t +test_filter_internal(hid_t fid, const char *name, hid_t dcpl) +{ + hid_t dataset; /* Dataset ID */ + hid_t dxpl; /* Dataset xfer property list ID */ + hid_t write_dxpl; /* Dataset xfer property list ID for writing */ + hid_t sid; /* Dataspace ID */ + const hsize_t size[2] = {DSET_DIM1, DSET_DIM2}; /* Dataspace dimensions */ + const hsize_t hs_offset[2] = {FILTER_HS_OFFSET1, FILTER_HS_OFFSET2}; /* Hyperslab offset */ + const hsize_t hs_size[2] = {FILTER_HS_SIZE1, FILTER_HS_SIZE2}; /* Hyperslab size */ + void *tconv_buf = NULL; /* Temporary conversion buffer */ + int points[DSET_DIM1][DSET_DIM2], check[DSET_DIM1][DSET_DIM2]; + size_t i, j; /* Local index variables */ + int n = 0; + + /* Create the data space */ + if((sid = H5Screate_simple(2, size, NULL)) < 0) goto error; + + /* + * Create a small conversion buffer to test strip mining. We + * might as well test all we can! + */ + if((dxpl = H5Pcreate(H5P_DATASET_XFER)) < 0) goto error; + tconv_buf = HDmalloc((size_t)1000); + if(H5Pset_buffer(dxpl, (size_t)1000, tconv_buf, NULL) < 0) goto error; + if((write_dxpl = H5Pcopy(dxpl)) < 0) TEST_ERROR; + + TESTING(" filters (setup)"); + + /* Check if all the filters are available */ + if(H5Pall_filters_avail(dcpl)!=TRUE) { + H5_FAILED(); + printf(" Line %d: Incorrect filter availability\n",__LINE__); + goto error; + } /* end if */ + + /* Create the dataset */ + if((dataset = H5Dcreate2(fid, name, H5T_NATIVE_INT, sid, H5P_DEFAULT, + dcpl, H5P_DEFAULT)) < 0) goto error; + + PASSED(); + + /*---------------------------------------------------------------------- + * STEP 1: Read uninitialized data. It should be zero. + *---------------------------------------------------------------------- + */ + TESTING(" filters (uninitialized read)"); + + if(H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl, check) < 0) + TEST_ERROR; + + for(i=0; i<(size_t)size[0]; i++) { + for(j=0; j<(size_t)size[1]; j++) { + if(0!=check[i][j]) { + H5_FAILED(); + printf(" Read a non-zero value.\n"); + printf(" At index %lu,%lu\n", + (unsigned long)i, (unsigned long)j); + goto error; + } + } + } + PASSED(); + + /*---------------------------------------------------------------------- + * STEP 2: Test filters by setting up a chunked dataset and writing + * to it. + *---------------------------------------------------------------------- + */ + TESTING(" filters (write)"); + + n = 0; + for(i=0; i<size[0]; i++) { + for(j=0; j<size[1]; j++) { + points[i][j] = (int)(n++); + } + } + + if(H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, write_dxpl, points) < 0) + TEST_ERROR; + + PASSED(); + + /*---------------------------------------------------------------------- + * STEP 3: Try to read the data we just wrote. + *---------------------------------------------------------------------- + */ + TESTING(" filters (read)"); + + /* Read the dataset back */ + if(H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl, check) < 0) + TEST_ERROR; + + /* Check that the values read are the same as the values written */ + for(i=0; i<size[0]; i++) { + for(j=0; j<size[1]; j++) { + if(points[i][j] != check[i][j]) { + H5_FAILED(); + fprintf(stderr," Read different values than written.\n"); + fprintf(stderr," At index %lu,%lu\n", (unsigned long)i, (unsigned long)j); + fprintf(stderr," At original: %d\n", (int)points[i][j]); + fprintf(stderr," At returned: %d\n", (int)check[i][j]); + goto error; + } + } + } + + PASSED(); + + /*---------------------------------------------------------------------- + * STEP 4: Write new data over the top of the old data. The new data is + * random thus not very compressible, and will cause the chunks to move + * around as they grow. We only change values for the left half of the + * dataset although we rewrite the whole thing. + *---------------------------------------------------------------------- + */ + TESTING(" filters (modify)"); + + for(i=0; i<size[0]; i++) { + for(j=0; j<size[1]/2; j++) { + points[i][j] = (int)HDrandom () % RANDOM_LIMIT; + } + } + if(H5Dwrite (dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, write_dxpl, points) < 0) + TEST_ERROR; + + /* Read the dataset back and check it */ + if(H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl, check) < 0) + TEST_ERROR; + + /* Check that the values read are the same as the values written */ + for(i=0; i<size[0]; i++) { + for(j=0; j<size[1]; j++) { + if(points[i][j] != check[i][j]) { + H5_FAILED(); + printf(" Read different values than written.\n"); + printf(" At index %lu,%lu\n", + (unsigned long)i, (unsigned long)j); + goto error; + } + } + } + + PASSED(); + + /*---------------------------------------------------------------------- + * STEP 5: Close the dataset and then open it and read it again. This + * insures that the filters message is picked up properly from the + * object header. + *---------------------------------------------------------------------- + */ + TESTING(" filters (re-open)"); + + if(H5Dclose(dataset) < 0) TEST_ERROR; + if((dataset = H5Dopen2(fid, name, H5P_DEFAULT)) < 0) TEST_ERROR; + + if(H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl, check) < 0) + TEST_ERROR; + + /* Check that the values read are the same as the values written */ + for(i = 0; i < size[0]; i++) + for(j = 0; j < size[1]; j++) + if(points[i][j] != check[i][j]) { + H5_FAILED(); + printf(" Read different values than written.\n"); + printf(" At index %lu,%lu\n", + (unsigned long)i, (unsigned long)j); + goto error; + } /* end if */ + + PASSED(); + + /*---------------------------------------------------------------------- + * STEP 6: Test partial I/O by writing to and then reading from a + * hyperslab of the dataset. The hyperslab does not line up on chunk + * boundaries (we know that case already works from above tests). + *---------------------------------------------------------------------- + */ + TESTING(" filters (partial I/O)"); + + for(i=0; i<(size_t)hs_size[0]; i++) { + for(j=0; j<(size_t)hs_size[1]; j++) { + points[(size_t)hs_offset[0]+i][(size_t)hs_offset[1]+j] = (int)HDrandom() % RANDOM_LIMIT; + } + } + if(H5Sselect_hyperslab(sid, H5S_SELECT_SET, hs_offset, NULL, hs_size, + NULL) < 0) TEST_ERROR; + /* (Use the "read" DXPL because partial I/O on corrupted data test needs to ignore errors during writing) */ + if(H5Dwrite (dataset, H5T_NATIVE_INT, sid, sid, dxpl, points) < 0) + TEST_ERROR; + + if(H5Dread (dataset, H5T_NATIVE_INT, sid, sid, dxpl, check) < 0) + TEST_ERROR; + + /* Check that the values read are the same as the values written */ + for(i=0; i<(size_t)hs_size[0]; i++) { + for(j=0; j<(size_t)hs_size[1]; j++) { + if(points[(size_t)hs_offset[0]+i][(size_t)hs_offset[1]+j] != + check[(size_t)hs_offset[0]+i][(size_t)hs_offset[1]+j]) { + H5_FAILED(); + fprintf(stderr," Read different values than written.\n"); + fprintf(stderr," At index %lu,%lu\n", + (unsigned long)((size_t)hs_offset[0]+i), + (unsigned long)((size_t)hs_offset[1]+j)); + fprintf(stderr," At original: %d\n", + (int)points[(size_t)hs_offset[0]+i][(size_t)hs_offset[1]+j]); + fprintf(stderr," At returned: %d\n", + (int)check[(size_t)hs_offset[0]+i][(size_t)hs_offset[1]+j]); + goto error; + } + } + } + + PASSED(); + + /* Save the data written to the file for later comparison when the file + * is reopened for read test */ + for(i=0; i<size[0]; i++) { + for(j=0; j<size[1]; j++) { + if(!HDstrcmp(name, DSET_DEFLATE_NAME)) { + points_deflate[i][j] = points[i][j]; + } else if(!HDstrcmp(name, DSET_DYNLIB1_NAME)) { + points_dynlib1[i][j] = points[i][j]; + } else if(!HDstrcmp(name, DSET_DYNLIB2_NAME)) { + points_dynlib2[i][j] = points[i][j]; + } + } + } + + /* Clean up objects used for this test */ + if(H5Dclose (dataset) < 0) goto error; + if(H5Sclose (sid) < 0) goto error; + if(H5Pclose (dxpl) < 0) goto error; + free (tconv_buf); + + return(0); + +error: + if(tconv_buf) + free (tconv_buf); + return -1; +} + +/*------------------------------------------------------------------------- + * Function: test_filters_for_datasets + * + * Purpose: Tests creating datasets and writing data with dynamically + * loaded filters + * + * Return: Success: 0 + * Failure: -1 + * + * Programmer: Raymond Lu + * 14 March 2013 + * + *------------------------------------------------------------------------- + */ +static herr_t +test_filters_for_datasets(hid_t file) +{ + hid_t dc; /* Dataset creation property list ID */ + const hsize_t chunk_size[2] = {FILTER_CHUNK_DIM1, FILTER_CHUNK_DIM2}; /* Chunk dimensions */ + unsigned int compress_level = 9; + + /*---------------------------------------------------------- + * STEP 1: Test deflation by itself. + *---------------------------------------------------------- + */ +#ifdef H5_HAVE_FILTER_DEFLATE + puts("Testing deflate filter"); + if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error; + if(H5Pset_chunk (dc, 2, chunk_size) < 0) goto error; + if(H5Pset_deflate (dc, 6) < 0) goto error; + + if(test_filter_internal(file,DSET_DEFLATE_NAME,dc) < 0) goto error; + /* Clean up objects used for this test */ + if(H5Pclose (dc) < 0) goto error; +#else /* H5_HAVE_FILTER_DEFLATE */ + TESTING("deflate filter"); + SKIPPED(); + puts(" Deflate filter not enabled"); +#endif /* H5_HAVE_FILTER_DEFLATE */ + + /*---------------------------------------------------------- + * STEP 2: Test DYNLIB1 by itself. + *---------------------------------------------------------- + */ + puts("Testing DYNLIB1 filter"); + if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error; + if(H5Pset_chunk (dc, 2, chunk_size) < 0) goto error; + if(H5Pset_filter (dc, H5Z_FILTER_DYNLIB1, H5Z_FLAG_MANDATORY, (size_t)1, &compress_level) < 0) goto error; + + if(test_filter_internal(file,DSET_DYNLIB1_NAME,dc) < 0) goto error; + + /* Clean up objects used for this test */ + if(H5Pclose (dc) < 0) goto error; + + /* Unregister the dynamic filter DYNLIB1 for testing purpose. The next time when this test is run for + * the new file format, the library's H5PL code has to search in the table of loaded plugin libraries + * for this filter. */ + if(H5Zunregister(H5Z_FILTER_DYNLIB1) < 0) goto error; + + /*---------------------------------------------------------- + * STEP 3: Test DYNLIB2 by itself. + *---------------------------------------------------------- + */ + puts("Testing DYNLIB2 filter"); + if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error; + if(H5Pset_chunk (dc, 2, chunk_size) < 0) goto error; + if(H5Pset_filter (dc, H5Z_FILTER_DYNLIB2, H5Z_FLAG_MANDATORY, 0, NULL) < 0) goto error; + + if(test_filter_internal(file,DSET_DYNLIB2_NAME,dc) < 0) goto error; + + /* Clean up objects used for this test */ + if(H5Pclose (dc) < 0) goto error; + + /* Unregister the dynamic filter DYNLIB2 for testing purpose. The next time when this test is run for + * the new file format, the library's H5PL code has to search in the table of loaded plugin libraries + * for this filter. */ + if(H5Zunregister(H5Z_FILTER_DYNLIB2) < 0) goto error; + + return 0; + +error: + return -1; +} + +/*------------------------------------------------------------------------- + * Function: test_read_data + * + * Purpose: Tests reading data and compares values + * + * Return: Success: 0 + * Failure: -1 + * + * Programmer: Raymond Lu + * 14 March 2013 + * + *------------------------------------------------------------------------- + */ +static herr_t +test_read_data(hid_t dataset, int *origin_data) +{ + int check[DSET_DIM1][DSET_DIM2]; + const hsize_t size[2] = {DSET_DIM1, DSET_DIM2}; /* Dataspace dimensions */ + int *data_p = origin_data; + size_t i, j; /* Local index variables */ + + /* Read the dataset back */ + if(H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, check) < 0) + TEST_ERROR; + + /* Check that the values read are the same as the values written */ + for(i=0; i<size[0]; i++) { + for(j=0; j<size[1]; j++) { + if(*data_p != check[i][j]) { + H5_FAILED(); + fprintf(stderr," Read different values than written.\n"); + fprintf(stderr," At index %lu,%lu\n", (unsigned long)i, (unsigned long)j); + fprintf(stderr," At original: %d\n", *data_p); + fprintf(stderr," At returned: %d\n", (int)check[i][j]); + goto error; + } + data_p++; + } + } + + PASSED(); + return 0; + +error: + return -1; +} + +/*------------------------------------------------------------------------- + * Function: test_read_with_filters + * + * Purpose: Tests reading dataset created with dynamically loaded filters + * + * Return: Success: 0 + * Failure: -1 + * + * Programmer: Raymond Lu + * 14 March 2013 + * + *------------------------------------------------------------------------- + */ +static herr_t +test_read_with_filters(hid_t file) +{ + hid_t dset; /* Dataset ID */ + + /*---------------------------------------------------------- + * STEP 1: Test deflation by itself. + *---------------------------------------------------------- + */ +#ifdef H5_HAVE_FILTER_DEFLATE + TESTING("Testing deflate filter"); + + if(H5Zfilter_avail(H5Z_FILTER_DEFLATE) != TRUE) TEST_ERROR + + if((dset = H5Dopen2(file,DSET_DEFLATE_NAME,H5P_DEFAULT)) < 0) TEST_ERROR + + if(test_read_data(dset, (int *)points_deflate) < 0) TEST_ERROR + + if(H5Dclose(dset) < 0) TEST_ERROR + + /* Clean up objects used for this test */ +#else /* H5_HAVE_FILTER_DEFLATE */ + TESTING("deflate filter"); + SKIPPED(); + puts(" Deflate filter not enabled"); +#endif /* H5_HAVE_FILTER_DEFLATE */ + + /*---------------------------------------------------------- + * STEP 2: Test DYNLIB1 by itself. + *---------------------------------------------------------- + */ + TESTING("Testing DYNLIB1 filter"); + + if((dset = H5Dopen2(file,DSET_DYNLIB1_NAME,H5P_DEFAULT)) < 0) TEST_ERROR + + if(test_read_data(dset, (int *)points_dynlib1) < 0) TEST_ERROR + + if(H5Dclose(dset) < 0) TEST_ERROR + + /*---------------------------------------------------------- + * STEP 3: Test Bogus2 by itself. + *---------------------------------------------------------- + */ + TESTING("Testing DYNLIB2 filter"); + + if((dset = H5Dopen2(file,DSET_DYNLIB2_NAME,H5P_DEFAULT)) < 0) TEST_ERROR + + if(test_read_data(dset, (int *)points_dynlib2) < 0) TEST_ERROR + + if(H5Dclose(dset) < 0) TEST_ERROR + + return 0; + +error: + return -1; +} + +/*------------------------------------------------------------------------- + * Function: test_filters_for_groups + * + * Purpose: Tests creating group with dynamically loaded filters + * + * Return: Success: 0 + * Failure: -1 + * + * Programmer: Raymond Lu + * 1 April 2013 + * + *------------------------------------------------------------------------- + */ +static herr_t +test_filters_for_groups(hid_t file) +{ + hid_t gcpl, gid, group; + int i; + char gname[256]; + + TESTING("Testing DYNLIB3 filter for group"); + + if((gcpl = H5Pcreate(H5P_GROUP_CREATE)) < 0) goto error; + + /* Use DYNLIB3 for creating groups */ + if(H5Pset_filter (gcpl, H5Z_FILTER_DYNLIB3, H5Z_FLAG_MANDATORY, (size_t)0, NULL) < 0) goto error; + + /* Create a group using this filter */ + if((gid = H5Gcreate2(file, "group1", H5P_DEFAULT, gcpl, H5P_DEFAULT)) < 0) goto error; + + /* Create multiple groups under "group1" */ + for (i=0; i < GROUP_ITERATION; i++) { + sprintf(gname, "group_%d", i); + if((group = H5Gcreate2(gid, gname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto error; + if(H5Gclose(group) < 0) goto error; + } + + /* Close the group */ + if(H5Gclose(gid) < 0) goto error; + + /* Clean up objects used for this test */ + if(H5Pclose (gcpl) < 0) goto error; + + PASSED(); + + return 0; + +error: + return -1; +} + +/*------------------------------------------------------------------------- + * Function: test_groups_with_filters + * + * Purpose: Tests opening group with dynamically loaded filters + * + * Return: Success: 0 + * Failure: -1 + * + * Programmer: Raymond Lu + * 1 April 2013 + * + *------------------------------------------------------------------------- + */ +static herr_t +test_groups_with_filters(hid_t file) +{ + hid_t gid, group; + int i; + char gname[256]; + + TESTING("Testing opening groups with DYNLIB3 filter"); + + /* Open the top group */ + if((gid = H5Gopen2(file, "group1", H5P_DEFAULT)) < 0) goto error; + + /* Create multiple groups under "group1" */ + for (i=0; i < GROUP_ITERATION; i++) { + sprintf(gname, "group_%d", i); + if((group = H5Gopen2(gid, gname, H5P_DEFAULT)) < 0) goto error; + if(H5Gclose(group) < 0) goto error; + } + + /* Close the group */ + if(H5Gclose(gid) < 0) goto error; + + PASSED(); + + return 0; + +error: + return -1; +} + + +/*------------------------------------------------------------------------- + * Function: main + * + * Purpose: Tests the plugin module (H5PL) + * + * Return: Success: exit(0) + * + * Failure: exit(1) + * + * Programmer: Raymond Lu + * 14 March 2013 + * + *------------------------------------------------------------------------- + */ +int +main(void) +{ + char filename[FILENAME_BUF_SIZE]; + hid_t file, fapl, fapl2; + hbool_t new_format; + int mdc_nelmts; + size_t rdcc_nelmts; + size_t rdcc_nbytes; + double rdcc_w0; + int nerrors = 0; + + /* Testing setup */ + h5_reset(); + fapl = h5_fileaccess(); + + /* Turn off the chunk cache, so all the chunks are immediately written to disk */ + if(H5Pget_cache(fapl, &mdc_nelmts, &rdcc_nelmts, &rdcc_nbytes, &rdcc_w0) < 0) + TEST_ERROR + rdcc_nbytes = 0; + if(H5Pset_cache(fapl, mdc_nelmts, rdcc_nelmts, rdcc_nbytes, rdcc_w0) < 0) + TEST_ERROR + + /* Copy the file access property list */ + if((fapl2 = H5Pcopy(fapl)) < 0) TEST_ERROR + + /* Set the "use the latest version of the format" bounds for creating objects in the file */ + if(H5Pset_libver_bounds(fapl2, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) TEST_ERROR + + h5_fixname(FILENAME[0], fapl, filename, sizeof filename); + + /* Test with old & new format groups */ + for(new_format = FALSE; new_format <= TRUE; new_format++) { + hid_t my_fapl; + + /* Set the FAPL for the type of format */ + if(new_format) { + puts("\nTesting with new file format:"); + my_fapl = fapl2; + } /* end if */ + else { + puts("Testing with old file format:"); + my_fapl = fapl; + } /* end else */ + + /* Create the file for this test */ + if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, my_fapl)) < 0) + TEST_ERROR + + /* Test dynamically loaded filters for chunked dataset */ + nerrors += (test_filters_for_datasets(file) < 0 ? 1 : 0); + + /* Test dynamically loaded filters for groups */ + nerrors += (test_filters_for_groups(file) < 0 ? 1 : 0); + + if(H5Fclose(file) < 0) + TEST_ERROR + } /* end for */ + + /* Close FAPL */ + if(H5Pclose(fapl2) < 0) TEST_ERROR + if(H5Pclose(fapl) < 0) TEST_ERROR + + puts("\nTesting reading data with with dynamic plugin filters:"); + + /* Close the library so that all loaded plugin libraries are unloaded */ + h5_reset(); + fapl = h5_fileaccess(); + + /* Reopen the file for testing data reading */ + if((file = H5Fopen(filename, H5F_ACC_RDONLY, fapl)) < 0) + TEST_ERROR + + /* Read the data with filters */ + nerrors += (test_read_with_filters(file) < 0 ? 1 : 0); + + /* Open the groups with filters */ + nerrors += (test_groups_with_filters(file) < 0 ? 1 : 0); + + if(H5Fclose(file) < 0) + TEST_ERROR + + if(nerrors) + TEST_ERROR + printf("All plugin tests passed.\n"); + h5_cleanup(FILENAME, fapl); + + return 0; + +error: + nerrors = MAX(1, nerrors); + printf("***** %d PLUGIN TEST%s FAILED! *****\n", + nerrors, 1 == nerrors ? "" : "S"); + return 1; +} + diff --git a/test/test_plugin.sh.in b/test/test_plugin.sh.in new file mode 100644 index 0000000..569e938 --- /dev/null +++ b/test/test_plugin.sh.in @@ -0,0 +1,93 @@ +#! /bin/sh +# +# Copyright by The HDF Group. +# All rights reserved. +# +# This file is part of HDF5. The full HDF5 copyright notice, including +# terms governing use, modification, and redistribution, is contained in +# the files COPYING and Copyright.html. COPYING can be found at the root +# of the source code distribution tree; Copyright.html can be found at the +# root level of an installed copy of the electronic document set and is +# linked from the top-level documents page. It can also be found at +# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have access +# to either file, you may request a copy from help@hdfgroup.org. +# +srcdir=@srcdir@ +TOP_BUILDDIR=@top_builddir@ + +# Determine backward compatibility options enabled +DEPRECATED_SYMBOLS="@DEPRECATED_SYMBOLS@" + +EXIT_SUCCESS=0 +EXIT_FAILURE=1 + +nerrors=0 +verbose=yes +exit_code=$EXIT_SUCCESS + +TEST_NAME=plugin +TEST_BIN=`pwd`/$TEST_NAME +FROM_DIR=`pwd`/.libs +PLUGIN_LIB1="$FROM_DIR/libdynlib1.* $FROM_DIR/libdynlib3.*" +PLUGIN_LIB2="$FROM_DIR/libdynlib2.*" +PLUGIN_LIBDIR1=testdir1 +PLUGIN_LIBDIR2=testdir2 +CP="cp -p" # Use -p to preserve mode,ownership,timestamps +RM="rm -rf" + +# Print a line-line message left justified in a field of 70 characters +# beginning with the word "Testing". +# +TESTING() { + SPACES=" " + echo "Testing $* $SPACES" | cut -c1-70 | tr -d '\012' +} + +# Main Body +# Create test directories if not exists yet. +test -d $PLUGIN_LIBDIR1 || mkdir -p $PLUGIN_LIBDIR1 +if [ $? != 0 ]; then + echo "Failed to create test directory($PLUGIN_LIBDIR1)" + exit $EXIT_FAILURE +fi + +test -d $PLUGIN_LIBDIR2 || mkdir -p $PLUGIN_LIBDIR2 +if [ $? != 0 ]; then + echo "Failed to create test directory($PLUGIN_LIBDIR2)" + exit $EXIT_FAILURE +fi + +# copy plugin library for test +$CP $PLUGIN_LIB1 $PLUGIN_LIBDIR1 +if [ $? != 0 ]; then + echo "Failed to copy plugin library ($PLUGIN_LIB1) for test." + exit $EXIT_FAILURE +fi + +$CP $PLUGIN_LIB2 $PLUGIN_LIBDIR2 +if [ $? != 0 ]; then + echo "Failed to copy plugin library ($PLUGIN_LIB2) for test." + exit $EXIT_FAILURE +fi + +# setup plugin path +ENVCMD="env HDF5_PLUGIN_PATH=${PLUGIN_LIBDIR1}:${PLUGIN_LIBDIR2}" + +# Run the test +$ENVCMD $TEST_BIN +if [ $? != 0 ]; then + nerrors=`expr $nerrors + 1` +fi + +# print results +if test $nerrors -ne 0 ; then + echo "$nerrors errors encountered" + exit_code=$EXIT_FAILURE +else + echo "All Plugin API tests passed." + exit_code=$EXIT_SUCCESS +fi + +# Clean up temporary files/directories and leave +$RM $PLUGIN_LIBDIR2 +exit $exit_code diff --git a/test/testerror.sh.in b/test/testerror.sh.in index b68fa7e..eb01fb1 100644 --- a/test/testerror.sh.in +++ b/test/testerror.sh.in @@ -23,6 +23,9 @@ DEPRECATED_SYMBOLS="@DEPRECATED_SYMBOLS@" CMP='cmp -s' DIFF='diff -c' +# Skip plugin module to test missing filter +ENVCMD="env HDF5_PLUGIN_PRELOAD=::" + nerrors=0 verbose=yes @@ -61,7 +64,9 @@ TEST() { echo "#############################" echo "Expected output for $TEST_ERR" echo "#############################" - $RUNSERIAL $TEST_ERR_BIN + + # Skip the plugin for testing missing filter. + $ENVCMD $RUNSERIAL $TEST_ERR_BIN ) >$actual 2>$actual_err # Extract file name, line number, version and thread IDs because they may be different sed -e 's/thread [0-9]*/thread (IDs)/' -e 's/: .*\.c /: (file name) /' \ @@ -109,7 +114,7 @@ else TEST err_compat fi -# test for error_test +# test for error_test. Skip the plugin for testing missing filter. TEST error_test if test $nerrors -eq 0 ; then diff --git a/test/testframe.c b/test/testframe.c index 8ab7a5b..af6e975 100644 --- a/test/testframe.c +++ b/test/testframe.c @@ -26,7 +26,7 @@ /* * Definitions for the testing structure. */ -#define MAXNUMOFTESTS 50 +#define MAXNUMOFTESTS 60 #define MAXTESTNAME 16 #define MAXTESTDESC 64 @@ -73,7 +73,7 @@ AddTest(const char *TheName, void (*TheCall) (void), void (*Cleanup) (void), con { /* Sanity checking */ if (Index >= MAXNUMOFTESTS) { - printf("Too many tests added, increase MAXNUMOFTEST(%d).\n", + printf("Too many tests added, increase MAXNUMOFTESTS(%d).\n", MAXNUMOFTESTS); exit(-1); } /* end if */ diff --git a/test/unregister.c b/test/unregister.c new file mode 100644 index 0000000..383958d --- /dev/null +++ b/test/unregister.c @@ -0,0 +1,256 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by The HDF Group. * + * All rights reserved. * + * * + * This file is part of HDF5. The full HDF5 copyright notice, including * + * terms governing use, modification, and redistribution, is contained in * + * the files COPYING and Copyright.html. COPYING can be found at the root * + * of the source code distribution tree; Copyright.html can be found at the * + * root level of an installed copy of the electronic document set and is * + * linked from the top-level documents page. It can also be found at * + * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have access * + * to either file, you may request a copy from help@hdfgroup.org. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/* + * Programmer: Raymond Lu + * 24 April 2013 + * + * Purpose: Tests H5Zunregister function + */ +#include "h5test.h" + +const char *FILENAME[] = { + "unregister_filter_1", + "unregister_filter_2", + NULL +}; + +#define GROUP_NAME "group" +#define DSET_NAME "dataset" +#define FILENAME_BUF_SIZE 1024 +#define DSET_DIM1 100 +#define DSET_DIM2 200 +#define FILTER_CHUNK_DIM1 2 +#define FILTER_CHUNK_DIM2 25 +#define GROUP_ITERATION 1000 + +#define H5Z_FILTER_DUMMY 312 + +static size_t filter_dummy(unsigned int flags, size_t cd_nelmts, + const unsigned int *cd_values, size_t nbytes, size_t *buf_size, void **buf); + +/* Dummy filter for test_unregister_filters only */ +const H5Z_class2_t H5Z_DUMMY[1] = {{ + H5Z_CLASS_T_VERS, /* H5Z_class_t version */ + H5Z_FILTER_DUMMY, /* Filter id number */ + 1, 1, /* Encoding and decoding enabled */ + "dummy", /* Filter name for debugging */ + NULL, /* The "can apply" callback */ + NULL, /* The "set local" callback */ + filter_dummy, /* The actual filter function */ +}}; + + +/*------------------------------------------------------------------------- + * Function: filter_dummy + * + * Purpose: A dummy compression method that doesn't do anything. This + * filter is only for test_unregister_filters. Please don't + * use it for other tests because it may mess up this test. + * + * Return: Success: Data chunk size + * + * Failure: 0 + * + * Programmer: Raymond Lu + * April 24, 2013 + * + *------------------------------------------------------------------------- + */ +static size_t +filter_dummy(unsigned int UNUSED flags, size_t UNUSED cd_nelmts, + const unsigned int UNUSED *cd_values, size_t nbytes, + size_t UNUSED *buf_size, void UNUSED **buf) +{ + return nbytes; +} + +/*------------------------------------------------------------------------- + * Function: test_unregister_filters + * + * Purpose: Tests unregistering filter before closing the file + * + * Return: Success: 0 + * Failure: -1 + * + * Programmer: Raymond Lu + * 11 April 2013 + * + *------------------------------------------------------------------------- + */ +static herr_t +test_unregister_filters(hid_t my_fapl) +{ + hid_t file1, file2; + hid_t dc; + hid_t gcpl, gid, group; + hid_t dataset, space; + int i, j, n; + char gname[256]; + char filename[FILENAME_BUF_SIZE]; + const hsize_t chunk_size[2] = {FILTER_CHUNK_DIM1, FILTER_CHUNK_DIM2}; /* Chunk dimensions */ + hsize_t dims[2]; + int points[DSET_DIM1][DSET_DIM2]; + herr_t ret; + + TESTING("Unregistering filter"); + + /* Create first file */ + h5_fixname(FILENAME[0], my_fapl, filename, sizeof filename); + if((file1 = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, my_fapl)) < 0) goto error; + + /* Create second file */ + h5_fixname(FILENAME[1], my_fapl, filename, sizeof filename); + if((file2 = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, my_fapl)) < 0) goto error; + + /* Register DUMMY filter */ + if(H5Zregister(H5Z_DUMMY) < 0) goto error; + + if(H5Zfilter_avail(H5Z_FILTER_DUMMY)!=TRUE) goto error; + + if((gcpl = H5Pcreate(H5P_GROUP_CREATE)) < 0) goto error; + + /* Use DUMMY filter for creating groups */ + if(H5Pset_filter (gcpl, H5Z_FILTER_DUMMY, H5Z_FLAG_MANDATORY, (size_t)0, NULL) < 0) goto error; + + /* Create a group using this filter */ + if((gid = H5Gcreate2(file1, GROUP_NAME, H5P_DEFAULT, gcpl, H5P_DEFAULT)) < 0) goto error; + + /* Create multiple groups under the main group */ + for (i=0; i < GROUP_ITERATION; i++) { + sprintf(gname, "group_%d", i); + if((group = H5Gcreate2(gid, gname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto error; + if(H5Gclose(group) < 0) goto error; + } + + if(H5Fflush(file1, H5F_SCOPE_GLOBAL) < 0) goto error; + + /* Unregister the filter before closing the group. It should fail */ + H5E_BEGIN_TRY { + ret = H5Zunregister(H5Z_FILTER_DUMMY); + } H5E_END_TRY; + if(ret>=0) { + H5_FAILED(); + printf(" Line %d: Should not be able to unregister filter\n", __LINE__); + goto error; + } /* end if */ + + /* Close the group */ + if(H5Gclose(gid) < 0) goto error; + + /* Clean up objects used for this test */ + if(H5Pclose (gcpl) < 0) goto error; + + if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error; + if(H5Pset_chunk (dc, 2, chunk_size) < 0) goto error; + + if(H5Pset_filter(dc, H5Z_FILTER_DUMMY, 0, (size_t)0, NULL) < 0) goto error; + + /* Initialize the dataset */ + for(i = n = 0; i < DSET_DIM1; i++) + for(j = 0; j < DSET_DIM2; j++) + points[i][j] = n++; + + /* Create the data space */ + dims[0] = DSET_DIM1; + dims[1] = DSET_DIM2; + if((space = H5Screate_simple(2, dims, NULL)) < 0) goto error; + + /* Create a dataset in the first file */ + if((dataset = H5Dcreate2(file1, DSET_NAME, H5T_NATIVE_INT, space, + H5P_DEFAULT, dc, H5P_DEFAULT)) < 0) goto error; + + /* Write the data to the dataset */ + if(H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, points) < 0) + goto error; + + /* Unregister the filter before closing the dataset. It should fail */ + H5E_BEGIN_TRY { + ret = H5Zunregister(H5Z_FILTER_DUMMY); + } H5E_END_TRY; + if(ret>=0) { + H5_FAILED(); + printf(" Line %d: Should not be able to unregister filter\n", __LINE__); + goto error; + } /* end if */ + + if(H5Dclose(dataset) < 0) goto error; + + /* Create a dataset in the second file */ + if((dataset = H5Dcreate2(file2, DSET_NAME, H5T_NATIVE_INT, space, + H5P_DEFAULT, dc, H5P_DEFAULT)) < 0) goto error; + + /* Write the data to the dataset */ + if(H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, points) < 0) + goto error; + + if(H5Dclose(dataset) < 0) goto error; + + /* Unregister the filter after closing all objects but before closing files. + * It should flush all files. */ + if(H5Zunregister(H5Z_FILTER_DUMMY) < 0) goto error; + + /* Clean up objects used for this test */ + if(H5Pclose (dc) < 0) goto error; + if(H5Fclose(file1) < 0) goto error; + if(H5Fclose(file2) < 0) goto error; + + PASSED(); + return 0; + +error: + return -1; +} + + +/*------------------------------------------------------------------------- + * Function: main + * + * Purpose: Tests unregistering filter with H5Zunregister + * + * Return: Success: exit(0) + * + * Failure: exit(1) + * + * Programmer: Raymond Lu + * 11 April 2013 + * + *------------------------------------------------------------------------- + */ +int +main(void) +{ + hid_t fapl; + int nerrors = 0; + + /* Testing setup */ + h5_reset(); + fapl = h5_fileaccess(); + + /* Test unregistering filter in its own file */ + nerrors += (test_unregister_filters(fapl) < 0 ? 1 : 0); + + if(nerrors) + goto error; + printf("All filter unregistration tests passed.\n"); + h5_cleanup(FILENAME, fapl); + + return 0; + +error: + nerrors = MAX(1, nerrors); + printf("***** %d FILTER UNREGISTRATION TEST%s FAILED! *****\n", + nerrors, 1 == nerrors ? "" : "S"); + return 1; +} + diff --git a/testpar/CMakeLists.txt b/testpar/CMakeLists.txt index cccb148..04aa383 100644 --- a/testpar/CMakeLists.txt +++ b/testpar/CMakeLists.txt @@ -29,6 +29,7 @@ SET (testphdf5_SRCS #-- Adding test for testhdf5 ADD_EXECUTABLE (testphdf5 ${testphdf5_SRCS}) TARGET_NAMING (testphdf5 ${LIB_TYPE}) +TARGET_C_PROPERTIES (testphdf5 " " " ") TARGET_LINK_LIBRARIES (testphdf5 ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET} ${LINK_LIBS}) SET_TARGET_PROPERTIES (testphdf5 PROPERTIES FOLDER test/par) @@ -37,6 +38,7 @@ ADD_TEST (NAME TEST_PAR_testphdf5 COMMAND ${MPIEXEC} ${MPIEXEC_PREFLAGS} ${MPIEX MACRO (ADD_H5P_TEST file) ADD_EXECUTABLE (${file} ${HDF5_TEST_PAR_SOURCE_DIR}/${file}.c) TARGET_NAMING (${file} ${LIB_TYPE}) + TARGET_C_PROPERTIES (${file} " " " ") TARGET_LINK_LIBRARIES (${file} ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET} ${LINK_LIBS}) SET_TARGET_PROPERTIES (${file} PROPERTIES FOLDER test/par) diff --git a/testpar/t_cache.c b/testpar/t_cache.c index 8f193cd..b0fea36 100644 --- a/testpar/t_cache.c +++ b/testpar/t_cache.c @@ -4218,125 +4218,6 @@ verify_writes(int num_writes, /***************************************************************************** * - * Function: setup_noblock_dxpl_id() - * - * Purpose: Setup the noblock_dxpl_id global. Increment nerrors if - * errors are detected. Do nothing if nerrors is non-zero - * on entry. - * - * Return: void. - * - * Programmer: JRM -- 1/5/06 - * - * Modifications: - * - * None. - * - *****************************************************************************/ -/* So far we haven't needed this, but that may change. - * Keep it around for now - */ -#if 0 -void -setup_noblock_dxpl_id(void) -{ - const char * fcn_name = "setup_noblock_dxpl_id()"; - H5P_genclass_t *xfer_pclass; /* Dataset transfer property list - * class object - */ - H5P_genplist_t *xfer_plist; /* Dataset transfer property list object */ - unsigned block_before_meta_write; /* "block before meta write" - * property value - */ - unsigned library_internal = 1; /* "library internal" property value */ - H5FD_mpio_xfer_t xfer_mode; /* I/O transfer mode property value */ - - /* Sanity check */ - HDassert(H5P_CLS_DATASET_XFER_g!=(-1)); - - /* Get the dataset transfer property list class object */ - if ( ( nerrors == 0 ) && - ( NULL == (xfer_pclass = H5I_object(H5P_CLS_DATASET_XFER_g)) ) ) { - - nerrors++; - if ( verbose ) { - HDfprintf(stdout, "%d:%s: can't get property list class.\n", - world_mpi_rank, fcn_name); - } - } - - /* Get an ID for the non-blocking, collective H5AC dxpl */ - if ( ( nerrors == 0 ) && - ( (noblock_dxpl_id = H5P_create_id(xfer_pclass)) < 0 ) ) { - - nerrors++; - if ( verbose ) { - HDfprintf(stdout, "%d:%s: can't register property list.\n", - world_mpi_rank, fcn_name); - } - } - - /* Get the property list object */ - if ( ( nerrors == 0 ) && - ( NULL == (xfer_plist = H5I_object(H5AC_noblock_dxpl_id)) ) ) { - - nerrors++; - if ( verbose ) { - HDfprintf(stdout, "%d:%s: can't get new property list object.\n", - world_mpi_rank, fcn_name); - } - } - - /* Insert 'block before metadata write' property */ - block_before_meta_write=0; - if ( ( nerrors == 0 ) && - ( H5P_insert(xfer_plist, H5AC_BLOCK_BEFORE_META_WRITE_NAME, - H5AC_BLOCK_BEFORE_META_WRITE_SIZE, - &block_before_meta_write, - NULL, NULL, NULL, NULL, NULL, NULL) < 0 ) ) { - - nerrors++; - if ( verbose ) { - HDfprintf(stdout, - "%d:%s: can't insert metadata cache dxpl property 1.\n", - world_mpi_rank, fcn_name); - } - } - - /* Insert 'library internal' property */ - if ( ( nerrors == 0 ) && - ( H5P_insert(xfer_plist, H5AC_LIBRARY_INTERNAL_NAME, - H5AC_LIBRARY_INTERNAL_SIZE, &library_internal, - NULL, NULL, NULL, NULL, NULL, NULL ) < 0 ) ) { - - nerrors++; - if ( verbose ) { - HDfprintf(stdout, - "%d:%s: can't insert metadata cache dxpl property 2.\n", - world_mpi_rank, fcn_name); - } - } - - /* Set the transfer mode */ - xfer_mode = H5FD_MPIO_COLLECTIVE; - if ( ( nerrors == 0 ) && - ( H5P_set(xfer_plist, H5D_XFER_IO_XFER_MODE_NAME, &xfer_mode) < 0 ) ) { - - nerrors++; - if ( verbose ) { - HDfprintf(stdout, "%d:%s: unable to set value.\n", world_mpi_rank, - fcn_name); - } - } - - return(success); - -} /* setup_noblock_dxpl_id() */ -#endif - - -/***************************************************************************** - * * Function: setup_rand() * * Purpose: Use gettimeofday() to obtain a seed for rand(), print the diff --git a/testpar/t_dset.c b/testpar/t_dset.c index 79a5555..743de3a 100644 --- a/testpar/t_dset.c +++ b/testpar/t_dset.c @@ -3620,7 +3620,7 @@ test_no_collective_cause_mode_filter(int selection_mode) VRFY((fapl_read >= 0), "create_faccess_plist() succeeded"); fid = H5Fopen (filename, H5F_ACC_RDONLY, fapl_read); - dataset = H5Dopen (fid, DSET_NOCOLCAUSE, H5P_DEFAULT); + dataset = H5Dopen2 (fid, DSET_NOCOLCAUSE, H5P_DEFAULT); /* Set collective I/O properties in the dxpl. */ ret = H5Pset_dxpl_mpio(dxpl, H5FD_MPIO_COLLECTIVE); @@ -4038,3 +4038,63 @@ dataset_atomicity(void) VRFY((ret >= 0), "H5Fclose succeeded"); } + +/* Function: dense_attr_test + * + * Purpose: Test cases for writing dense attributes in parallel + * + * Programmer: Quincey Koziol + * Date: April, 2013 + */ +void +test_dense_attr(void) +{ + int mpi_size, mpi_rank; + hid_t fpid, fid; + hid_t gid, gpid; + hid_t atFileSpace, atid; + hsize_t atDims[1] = {10000}; + herr_t status; + + /* set up MPI parameters */ + MPI_Comm_size(MPI_COMM_WORLD,&mpi_size); + MPI_Comm_rank(MPI_COMM_WORLD,&mpi_rank); + + fpid = H5Pcreate(H5P_FILE_ACCESS); + VRFY((fpid > 0), "H5Pcreate succeeded"); + status = H5Pset_libver_bounds(fpid, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST); + VRFY((status >= 0), "H5Pset_libver_bounds succeeded"); + status = H5Pset_fapl_mpio(fpid, MPI_COMM_WORLD, MPI_INFO_NULL); + VRFY((status >= 0), "H5Pset_fapl_mpio succeeded"); + fid = H5Fcreate("ph5Dense.h5", H5F_ACC_TRUNC, H5P_DEFAULT, fpid); + VRFY((fid > 0), "H5Fcreate succeeded"); + status = H5Pclose(fpid); + VRFY((status >= 0), "H5Pclose succeeded"); + + gpid = H5Pcreate(H5P_GROUP_CREATE); + VRFY((gpid > 0), "H5Pcreate succeeded"); + status = H5Pset_attr_phase_change(gpid, 0, 0); + VRFY((status >= 0), "H5Pset_attr_phase_change succeeded"); + gid = H5Gcreate2(fid, "foo", H5P_DEFAULT, gpid, H5P_DEFAULT); + VRFY((gid > 0), "H5Gcreate2 succeeded"); + status = H5Pclose(gpid); + VRFY((status >= 0), "H5Pclose succeeded"); + + atFileSpace = H5Screate_simple(1, atDims, NULL); + VRFY((atFileSpace > 0), "H5Screate_simple succeeded"); + atid = H5Acreate2(gid, "bar", H5T_STD_U64LE, atFileSpace, H5P_DEFAULT, H5P_DEFAULT); + VRFY((atid > 0), "H5Acreate succeeded"); + status = H5Sclose(atFileSpace); + VRFY((status >= 0), "H5Sclose succeeded"); + + status = H5Aclose(atid); + VRFY((status >= 0), "H5Aclose succeeded"); + + status = H5Gclose(gid); + VRFY((status >= 0), "H5Gclose succeeded"); + status = H5Fclose(fid); + VRFY((status >= 0), "H5Fclose succeeded"); + + return; +} + diff --git a/testpar/testphdf5.c b/testpar/testphdf5.c index 784892a..89230f1 100644 --- a/testpar/testphdf5.c +++ b/testpar/testphdf5.c @@ -532,6 +532,10 @@ int main(int argc, char **argv) "dataset atomic updates", PARATESTFILE); } + AddTest("denseattr", test_dense_attr, NULL, + "Store Dense Attributes", NULL); + + /* Display testing information */ TestInfo(argv[0]); diff --git a/testpar/testphdf5.h b/testpar/testphdf5.h index fa83697..15ff884 100644 --- a/testpar/testphdf5.h +++ b/testpar/testphdf5.h @@ -289,6 +289,7 @@ void file_image_daisy_chain_test(void); #ifdef H5_HAVE_FILTER_DEFLATE void compress_readAll(void); #endif /* H5_HAVE_FILTER_DEFLATE */ +void test_dense_attr(void); /* commonly used prototypes */ hid_t create_faccess_plist(MPI_Comm comm, MPI_Info info, int l_facc_type, hbool_t use_gpfs); diff --git a/tools/Makefile.am b/tools/Makefile.am index 4479c20..76b32d2 100644 --- a/tools/Makefile.am +++ b/tools/Makefile.am @@ -24,6 +24,6 @@ include $(top_srcdir)/config/commence.am CONFIG=ordered # All subdirectories -SUBDIRS=lib h5diff h5ls misc h5import h5repack h5jam h5copy h5stat h5dump +SUBDIRS=lib h5diff h5ls h5dump misc h5import h5repack h5jam h5copy h5stat include $(top_srcdir)/config/conclude.am diff --git a/tools/Makefile.in b/tools/Makefile.in index 4d83a42..a0b5657 100644 --- a/tools/Makefile.in +++ b/tools/Makefile.in @@ -433,7 +433,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog CONFIG = ordered # All subdirectories -SUBDIRS = lib h5diff h5ls misc h5import h5repack h5jam h5copy h5stat h5dump +SUBDIRS = lib h5diff h5ls h5dump misc h5import h5repack h5jam h5copy h5stat # Automake needs to be taught how to build lib, progs, and tests targets. # These will be filled in automatically for the most part (e.g., diff --git a/tools/h5copy/CMakeLists.txt b/tools/h5copy/CMakeLists.txt index 7f68e76..137edb0 100644 --- a/tools/h5copy/CMakeLists.txt +++ b/tools/h5copy/CMakeLists.txt @@ -11,6 +11,7 @@ INCLUDE_DIRECTORIES (${HDF5_TOOLS_SRC_DIR}/lib) # -------------------------------------------------------------------- ADD_EXECUTABLE (h5copy ${HDF5_TOOLS_H5COPY_SOURCE_DIR}/h5copy.c) TARGET_NAMING (h5copy ${LIB_TYPE}) +TARGET_C_PROPERTIES (h5copy " " " ") TARGET_LINK_LIBRARIES (h5copy ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) SET_TARGET_PROPERTIES (h5copy PROPERTIES FOLDER tools) @@ -26,6 +27,7 @@ IF (BUILD_TESTING) IF (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) ADD_EXECUTABLE (h5copygentest ${HDF5_TOOLS_H5COPY_SOURCE_DIR}/h5copygentest.c) TARGET_NAMING (h5copygentest ${LIB_TYPE}) + TARGET_C_PROPERTIES (h5copygentest " " " ") TARGET_LINK_LIBRARIES (h5copygentest ${HDF5_LIB_TARGET}) SET_TARGET_PROPERTIES (h5copygentest PROPERTIES FOLDER generator/tools) diff --git a/tools/h5copy/testh5copy.sh.in b/tools/h5copy/testh5copy.sh.in index d30d8d8..bec3bfc 100644 --- a/tools/h5copy/testh5copy.sh.in +++ b/tools/h5copy/testh5copy.sh.in @@ -513,7 +513,7 @@ COPY_REFERENCES() TESTFILE="$TESTDIR/h5copy_ref.h5" echo "Test copying object and region references" - TOOLTEST_F -f ref -i $TESTFILE -o $TESTDIR/region_ref.out.h5 -v -s / -d /COPY + TOOLTEST -f ref -i $TESTFILE -o $TESTDIR/region_ref.out.h5 -v -s / -d /COPY } # Copy external links. @@ -529,25 +529,25 @@ COPY_EXT_LINKS() TOOLTEST -v -i $TESTFILE -o $TESTDIR/ext_link.out.h5 -s /group_ext/extlink_dset -d /copy1_dset echo "Test copying external link directly with -f ext" - TOOLTEST_F -f ext -i $TESTFILE -o $TESTDIR/ext_link_f.out.h5 -v -s /group_ext/extlink_dset -d /copy2_dset + TOOLTEST -f ext -i $TESTFILE -o $TESTDIR/ext_link_f.out.h5 -v -s /group_ext/extlink_dset -d /copy2_dset echo "Test copying dangling external link (no obj) directly without -f ext" TOOLTEST -v -i $TESTFILE -o $TESTDIR/ext_dangle_noobj.out.h5 -s /group_ext/extlink_notyet1 -d /copy_dangle1_1 echo "Test copying dangling external link (no obj) directly with -f ext" - TOOLTEST_F -f ext -i $TESTFILE -o $TESTDIR/ext_dangle_noobj_f.out.h5 -v -s /group_ext/extlink_notyet1 -d /copy_dangle1_2 + TOOLTEST -f ext -i $TESTFILE -o $TESTDIR/ext_dangle_noobj_f.out.h5 -v -s /group_ext/extlink_notyet1 -d /copy_dangle1_2 echo "Test copying dangling external link (no file) directly without -f ext" TOOLTEST -v -i $TESTFILE -o $TESTDIR/ext_dangle_nofile.out.h5 -s /group_ext/extlink_notyet2 -d /copy_dangle2_1 echo "Test copying dangling external link (no file) directly with -f ext" - TOOLTEST_F -f ext -i $TESTFILE -o $TESTDIR/ext_dangle_nofile_f.out.h5 -v -s /group_ext/extlink_notyet2 -d /copy_dangle2_2 + TOOLTEST -f ext -i $TESTFILE -o $TESTDIR/ext_dangle_nofile_f.out.h5 -v -s /group_ext/extlink_notyet2 -d /copy_dangle2_2 echo "Test copying a group contains external links without -f ext" TOOLTEST -v -i $TESTFILE -o $TESTDIR/ext_link_group.out.h5 -s /group_ext -d /copy1_group echo "Test copying a group contains external links with -f ext" - TOOLTEST_F -f ext -i $TESTFILE -o $TESTDIR/ext_link_group_f.out.h5 -v -s /group_ext -d /copy2_group + TOOLTEST -f ext -i $TESTFILE -o $TESTDIR/ext_link_group_f.out.h5 -v -s /group_ext -d /copy2_group } # Test misc. diff --git a/tools/h5diff/CMakeLists.txt b/tools/h5diff/CMakeLists.txt index 8eb5ad1..e4e722a 100644 --- a/tools/h5diff/CMakeLists.txt +++ b/tools/h5diff/CMakeLists.txt @@ -14,6 +14,7 @@ ADD_EXECUTABLE (h5diff ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/h5diff_main.c ) TARGET_NAMING (h5diff ${LIB_TYPE}) +TARGET_C_PROPERTIES (h5diff " " " ") TARGET_LINK_LIBRARIES (h5diff ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) SET_TARGET_PROPERTIES (h5diff PROPERTIES FOLDER tools) @@ -25,6 +26,7 @@ IF (H5_HAVE_PARALLEL) ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/ph5diff_main.c ) TARGET_NAMING (ph5diff ${LIB_TYPE}) + TARGET_C_PROPERTIES (ph5diff " " " ") TARGET_LINK_LIBRARIES (ph5diff ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) SET_TARGET_PROPERTIES (ph5diff PROPERTIES FOLDER tools) ENDIF (H5_HAVE_PARALLEL) @@ -42,6 +44,7 @@ IF (BUILD_TESTING) IF (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) ADD_EXECUTABLE (h5diffgentest ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/h5diffgentest.c) TARGET_NAMING (h5diffgentest ${LIB_TYPE}) + TARGET_C_PROPERTIES (h5diffgentest " " " ") TARGET_LINK_LIBRARIES (h5diffgentest ${HDF5_LIB_TARGET}) SET_TARGET_PROPERTIES (h5diffgentest PROPERTIES FOLDER generator/tools) diff --git a/tools/h5diff/h5diff_main.c b/tools/h5diff/h5diff_main.c index 607d58e..a916ec5 100644 --- a/tools/h5diff/h5diff_main.c +++ b/tools/h5diff/h5diff_main.c @@ -101,7 +101,6 @@ int main(int argc, const char *argv[]) print_info(&options); -out: /*------------------------------------------------------------------------- * exit code * 1 if differences, 0 if no differences, 2 if error diff --git a/tools/h5dump/CMakeLists.txt b/tools/h5dump/CMakeLists.txt index 3f39ae3..8d15e2b 100644 --- a/tools/h5dump/CMakeLists.txt +++ b/tools/h5dump/CMakeLists.txt @@ -15,6 +15,7 @@ ADD_EXECUTABLE (h5dump ${HDF5_TOOLS_H5DUMP_SOURCE_DIR}/h5dump_xml.c ) TARGET_NAMING (h5dump ${LIB_TYPE}) +TARGET_C_PROPERTIES (h5dump " " " ") TARGET_LINK_LIBRARIES (h5dump ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) SET_TARGET_PROPERTIES (h5dump PROPERTIES FOLDER tools) @@ -33,6 +34,7 @@ IF (BUILD_TESTING) IF (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) ADD_EXECUTABLE (h5dumpgentest ${HDF5_TOOLS_H5DUMP_SOURCE_DIR}/h5dumpgentest.c) TARGET_NAMING (h5dumpgentest ${LIB_TYPE}) + TARGET_C_PROPERTIES (h5dumpgentest " " " ") TARGET_LINK_LIBRARIES (h5dumpgentest ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) SET_TARGET_PROPERTIES (h5dumpgentest PROPERTIES FOLDER generator/tools) @@ -50,6 +52,7 @@ IF (BUILD_TESTING) ${HDF5_TOOLS_SRC_DIR}/testfiles/tall-1.ddl ${HDF5_TOOLS_SRC_DIR}/testfiles/tall-2.ddl ${HDF5_TOOLS_SRC_DIR}/testfiles/tall-2A.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tall-2A0.ddl ${HDF5_TOOLS_SRC_DIR}/testfiles/tall-2B.ddl ${HDF5_TOOLS_SRC_DIR}/testfiles/tall-3.ddl ${HDF5_TOOLS_SRC_DIR}/testfiles/tall-4s.ddl @@ -148,6 +151,7 @@ IF (BUILD_TESTING) ${HDF5_TOOLS_SRC_DIR}/testfiles/tno-subset.ddl ${HDF5_TOOLS_SRC_DIR}/testfiles/tnullspace.ddl ${HDF5_TOOLS_SRC_DIR}/testfiles/trawdatafile.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/trawssetfile.ddl ${HDF5_TOOLS_SRC_DIR}/testfiles/zerodim.ddl ${HDF5_TOOLS_SRC_DIR}/testfiles/tordergr1.ddl ${HDF5_TOOLS_SRC_DIR}/testfiles/tordergr2.ddl @@ -199,6 +203,7 @@ IF (BUILD_TESTING) tall-6.exp tnoddlfile.exp trawdatafile.exp + trawssetfile.exp tstr2bin2.exp tstr2bin6.exp twithddl.exp @@ -301,6 +306,7 @@ IF (BUILD_TESTING) ${PROJECT_SOURCE_DIR}/errfiles/filter_fail.err ${PROJECT_SOURCE_DIR}/errfiles/tall-1.err ${PROJECT_SOURCE_DIR}/errfiles/tall-2A.err + ${PROJECT_SOURCE_DIR}/errfiles/tall-2A0.err ${PROJECT_SOURCE_DIR}/errfiles/tall-2B.err ${PROJECT_SOURCE_DIR}/errfiles/tarray1_big.err ${PROJECT_SOURCE_DIR}/errfiles/tattrregR.err @@ -906,6 +912,33 @@ IF (BUILD_TESTING) ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (ADD_H5ERR_MASK_TEST file) + MACRO (ADD_H5ERR_MASK_ENV_TEST resultfile resultcode envvar envval) + IF (NOT HDF5_ENABLE_USING_MEMCHECKER) + ADD_TEST ( + NAME H5DUMP-${resultfile}-clear-objects + COMMAND ${CMAKE_COMMAND} + -E remove ${resultfile}.out ${resultfile}.out.err + ) + SET_TESTS_PROPERTIES (H5DUMP-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") + ADD_TEST ( + NAME H5DUMP-${resultfile} + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$<TARGET_FILE:h5dump>" + -D "TEST_ARGS:STRING=${ARGN}" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles/std" + -D "TEST_OUTPUT=${resultfile}.out" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_REFERENCE=${resultfile}.ddl" + -D "TEST_ERRREF=${resultfile}.err" + -D "TEST_MASK_ERROR=true" + -D "TEST_ENV_VAR:STRING=${envvar}" + -D "TEST_ENV_VALUE:STRING=${envval}" + -P "${HDF5_RESOURCES_DIR}/runTest.cmake" + ) + SET_TESTS_PROPERTIES (H5DUMP-${resultfile} PROPERTIES DEPENDS "H5DUMP-${resultfile}-clear-objects") + ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) + ENDMACRO (ADD_H5ERR_MASK_ENV_TEST) + MACRO (ADD_H5_TEST_IMPORT conffile resultfile testfile resultcode) # If using memchecker add tests without using scripts IF (NOT HDF5_ENABLE_USING_MEMCHECKER) @@ -1041,6 +1074,8 @@ IF (BUILD_TESTING) tall-2.out.err tall-2A.out tall-2A.out.err + tall-2A0.out + tall-2A0.out.err tall-2B.out tall-2B.out.err tall-3.out @@ -1227,6 +1262,9 @@ IF (BUILD_TESTING) trawdatafile.out trawdatafile.out.err trawdatafile.txt + trawssetfile.out + trawssetfile.out.err + trawssetfile.txt tno-subset.out tno-subset.out.err tnullspace.out @@ -1342,7 +1380,8 @@ IF (BUILD_TESTING) ADD_H5_TEST (tnoattrdata 0 --enable-error-stack -A -o tattr.h5) ADD_H5_TEST_EXPORT (trawdatafile packedbits.h5 0 --enable-error-stack -y -o) ADD_H5_TEST_EXPORT (tnoddlfile packedbits.h5 0 --enable-error-stack -O -y -o) - + ADD_H5_TEST_EXPORT (trawssetfile tdset.h5 0 --enable-error-stack -d "/dset1[1,1;;;]" -y -o) + ADD_H5_TEST_EXPORT_DDL (twithddlfile packedbits.h5 0 twithddl --enable-error-stack --ddl=twithddl.txt -y -o) # test for maximum display datasets @@ -1471,6 +1510,9 @@ IF (BUILD_TESTING) # test '-A' to suppress data but print attr's ADD_H5ERR_MASK_TEST (tall-2A 0 --enable-error-stack -A tall.h5) + # test '-A' to suppress attr's but print data + ADD_H5ERR_MASK_TEST (tall-2A0 0 --enable-error-stack -A 0 tall.h5) + # test '-r' to print attributes in ASCII instead of decimal ADD_H5ERR_MASK_TEST (tall-2B 0 --enable-error-stack -A -r tall.h5) @@ -1604,20 +1646,14 @@ IF (BUILD_TESTING) ADD_H5_TEST_IMPORT (tbin1 out1D tbinary.h5 0 --enable-error-stack -d integer -b) IF (NOT HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST (NAME H5DUMP-tbin2-bin-clear-objects COMMAND ${CMAKE_COMMAND} -E remove out2.bin) - SET_TESTS_PROPERTIES (H5DUMP-tbin2-bin-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") - ADD_H5_TEST (tbin2 0 --enable-error-stack -b BE -d float -o out2.bin tbinary.h5) - SET_TESTS_PROPERTIES (H5DUMP-tbin2 PROPERTIES DEPENDS H5DUMP-tbin2-bin-clear-objects) + ADD_H5_TEST (tbin2 0 --enable-error-stack -b BE -d float -o tbin2.bin tbinary.h5) ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) # the NATIVE test can be validated with h5import/h5diff ADD_H5_TEST_IMPORT (tbin3 out3D tbinary.h5 0 --enable-error-stack -d integer -b NATIVE) IF (NOT HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST (NAME H5DUMP-tbin4-bin-clear-objects COMMAND ${CMAKE_COMMAND} -E remove out4.bin) - SET_TESTS_PROPERTIES (H5DUMP-tbin4-bin-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") - ADD_H5_TEST (tbin4 0 --enable-error-stack -d double -b FILE -o out4.bin tbinary.h5) - SET_TESTS_PROPERTIES (H5DUMP-tbin4 PROPERTIES DEPENDS H5DUMP-tbin4-bin-clear-objects) + ADD_H5_TEST (tbin4 0 --enable-error-stack -d double -b FILE -o tbin4.bin tbinary.h5) ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) # test for dataset region references @@ -1655,7 +1691,7 @@ IF (BUILD_TESTING) ADD_H5ERR_MASK_TEST (textlink 0 --enable-error-stack textlink.h5) # test for error stack display (BZ2048) - ADD_H5ERR_MASK_TEST (filter_fail 1 --enable-error-stack filter_fail.h5) + ADD_H5ERR_MASK_ENV_TEST (filter_fail 1 "HDF5_PLUGIN_PRELOAD" "::" --enable-error-stack filter_fail.h5) # test for -o -y for dataset with attributes ADD_H5_TEST_EXPORT (tall-6 tall.h5 0 --enable-error-stack -d /g1/g1.1/dset1.1.1 -y -o) diff --git a/tools/h5dump/errfiles/tall-2A0.err b/tools/h5dump/errfiles/tall-2A0.err new file mode 100644 index 0000000..ba691d0 --- /dev/null +++ b/tools/h5dump/errfiles/tall-2A0.err @@ -0,0 +1,25 @@ +HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): + #000: (file name) line (number) in H5Oopen(): unable to open object + major: Symbol table + minor: Can't open object + #001: (file name) line (number) in H5O_open_name(): object not found + major: Symbol table + minor: Object not found + #002: (file name) line (number) in H5G_loc_find(): can't find object + major: Symbol table + minor: Object not found + #003: (file name) line (number) in H5G_traverse(): internal path traversal failed + major: Symbol table + minor: Object not found + #004: (file name) line (number) in H5G_traverse_real(): special link traversal failed + major: Links + minor: Link traversal failure + #005: (file name) line (number) in H5G__traverse_special(): user-defined link traversal failed + major: Links + minor: Link traversal failure + #006: (file name) line (number) in H5G_traverse_ud(): traversal callback returned invalid ID + major: Symbol table + minor: Unable to find atom information (already closed?) + #007: (file name) line (number) in H5L_extern_traverse(): unable to open external file, external link file name = 'somefile', temp_file_name = 'somefile' + major: Links + minor: Unable to open file diff --git a/tools/h5dump/h5dump.c b/tools/h5dump/h5dump.c index d89202c..9b304bd 100644 --- a/tools/h5dump/h5dump.c +++ b/tools/h5dump/h5dump.c @@ -30,7 +30,7 @@ static const char *xml_dtd_uri = NULL; /* module-scoped variables for XML option */ #define DEFAULT_XSD "http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd" -#define DEFAULT_DTD "http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.dtd" +#define DEFAULT_DTD "http://www.hdfgroup.org/HDF5/XML/DTD/HDF5-File.dtd" /* Standard DDL output */ static const dump_functions ddl_function_table = { @@ -71,7 +71,7 @@ struct handler_t { */ /* The following initialization makes use of C language cancatenating */ /* "xxx" "yyy" into "xxxyyy". */ -static const char *s_opts = "hn*peyBHirVa:c:d:f:g:k:l:t:w:xD:uX:o*b*F:s:S:Aq:z:m:RECM:O*"; +static const char *s_opts = "hn*peyBHirVa:c:d:f:g:k:l:t:w:xD:uX:o*b*F:s:S:A*q:z:m:RECM:O*"; static struct long_options l_opts[] = { { "help", no_arg, 'h' }, { "hel", no_arg, 'h' }, @@ -175,7 +175,7 @@ static struct long_options l_opts[] = { { "xml-n", require_arg, 'X' }, { "xml", no_arg, 'x' }, { "xm", no_arg, 'x' }, - { "onlyattr", no_arg, 'A' }, + { "onlyattr", optional_arg, 'A' }, { "escape", no_arg, 'e' }, { "noindex", no_arg, 'y' }, { "binary", optional_arg, 'b' }, @@ -221,11 +221,6 @@ leave(int ret) * Purpose: Print the usage message about dumper * * Return: void - * - * Programmer: Ruey-Hsia Li - * - * Modifications: - * Pedro Vicente, October 5, 2007. Add -q and -z flags *------------------------------------------------------------------------- */ static void @@ -240,6 +235,7 @@ usage(const char *prog) PRINTVALSTREAM(rawoutstream, " -B, --superblock Print the content of the super block\n"); PRINTVALSTREAM(rawoutstream, " -H, --header Print the header only; no data is displayed\n"); PRINTVALSTREAM(rawoutstream, " -A, --onlyattr Print the header and value of attributes\n"); + PRINTVALSTREAM(rawoutstream, " Optional value 0 suppresses printing attributes.\n"); PRINTVALSTREAM(rawoutstream, " -i, --object-ids Print the object ids\n"); PRINTVALSTREAM(rawoutstream, " -r, --string Print 1-byte integer datasets as ASCII\n"); PRINTVALSTREAM(rawoutstream, " -e, --escape Escape non printing characters\n"); @@ -1093,9 +1089,14 @@ parse_start: last_was_dset = FALSE; break; case 'A': - display_data = FALSE; - display_attr_data = TRUE; - last_was_dset = FALSE; + if ( opt_arg != NULL) { + if(0 == HDatoi(opt_arg)) include_attrs = FALSE; + } + else { + display_data = FALSE; + display_attr_data = TRUE; + last_was_dset = FALSE; + } break; case 'i': display_oid = TRUE; @@ -1649,7 +1650,7 @@ main(int argc, const char *argv[]) indx = HDstrrchr(ns,(int)':'); if (indx) *indx = '\0'; - PRINTSTREAM(rawoutstream, "<%sHDF5-File xmlns:%s=\"http://hdfgroup.org/HDF5/XML/schema/HDF5-File\" " + PRINTSTREAM(rawoutstream, "<%sHDF5-File xmlns:%s=\"http://hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd\" " "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" " "xsi:schemaLocation=\"http://hdfgroup.org/HDF5/XML/schema/HDF5-File " "http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd\">\n",xmlnsprefix,ns); diff --git a/tools/h5dump/h5dump.h b/tools/h5dump/h5dump.h index 7d4f460..7bfead7 100644 --- a/tools/h5dump/h5dump.h +++ b/tools/h5dump/h5dump.h @@ -76,6 +76,7 @@ int display_region = FALSE; /*print region reference data */ int enable_error_stack= FALSE; /* re-enable error stack */ int disable_compact_subset= FALSE; /* disable compact form of subset notation */ int display_packed_bits = FALSE; /*print 1-8 byte numbers as packed bits*/ +int include_attrs = TRUE; /* Display attributes */ /* sort parameters */ H5_index_t sort_by = H5_INDEX_NAME; /*sort_by [creation_order | name] */ diff --git a/tools/h5dump/h5dump_ddl.c b/tools/h5dump/h5dump_ddl.c index c4a9ecb..a9a23a5 100644 --- a/tools/h5dump/h5dump_ddl.c +++ b/tools/h5dump/h5dump_ddl.c @@ -556,19 +556,20 @@ attr_iteration(hid_t gid, unsigned attr_crt_order_flags) { /* attribute iteration: if there is a request to do H5_INDEX_CRT_ORDER and tracking order is set in the group for attributes, then, sort by creation order, otherwise by name */ - - if((sort_by == H5_INDEX_CRT_ORDER) && (attr_crt_order_flags & H5P_CRT_ORDER_TRACKED)) { - if(H5Aiterate2(gid, sort_by, sort_order, NULL, dump_attr_cb, NULL) < 0) { - error_msg("error getting attribute information\n"); - h5tools_setstatus(EXIT_FAILURE); - } /* end if */ - } /* end if */ - else { - if(H5Aiterate2(gid, H5_INDEX_NAME, sort_order, NULL, dump_attr_cb, NULL) < 0) { - error_msg("error getting attribute information\n"); - h5tools_setstatus(EXIT_FAILURE); + if(include_attrs) { + if((sort_by == H5_INDEX_CRT_ORDER) && (attr_crt_order_flags & H5P_CRT_ORDER_TRACKED)) { + if(H5Aiterate2(gid, sort_by, sort_order, NULL, dump_attr_cb, NULL) < 0) { + error_msg("error getting attribute information\n"); + h5tools_setstatus(EXIT_FAILURE); + } /* end if */ } /* end if */ - } /* end else */ + else { + if(H5Aiterate2(gid, H5_INDEX_NAME, sort_order, NULL, dump_attr_cb, NULL) < 0) { + error_msg("error getting attribute information\n"); + h5tools_setstatus(EXIT_FAILURE); + } /* end if */ + } /* end else */ + } } /*------------------------------------------------------------------------- @@ -1360,8 +1361,6 @@ handle_attributes(hid_t fid, const char *attr, void UNUSED * data, int UNUSED pe string_dataformat.do_escape = display_escape; outputformat = &string_dataformat; - //attr_name = attr + j + 1; - // need to replace escape characters attr_name = h5tools_str_replace(attr + j + 1, "\\/", "/"); diff --git a/tools/h5dump/h5dump_extern.h b/tools/h5dump/h5dump_extern.h index 5a0f2bd..08f9e36 100644 --- a/tools/h5dump/h5dump_extern.h +++ b/tools/h5dump/h5dump_extern.h @@ -76,6 +76,7 @@ extern int display_region; /*print region reference data */ extern int enable_error_stack; /* re-enable error stack */ extern int disable_compact_subset; /* disable compact form of subset notation */ extern int display_packed_bits; /*print 1-8 byte numbers as packed bits*/ +extern int include_attrs; /* Display attributes */ /* sort parameters */ extern H5_index_t sort_by; /*sort_by [creation_order | name] */ diff --git a/tools/h5dump/testh5dump.sh.in b/tools/h5dump/testh5dump.sh.in index 238eee9..0e3cfda 100644 --- a/tools/h5dump/testh5dump.sh.in +++ b/tools/h5dump/testh5dump.sh.in @@ -38,6 +38,9 @@ DIRNAME='dirname' LS='ls' AWK='awk' +# Skip plugin module to test missing filter +ENVCMD="env HDF5_PLUGIN_PRELOAD=::" + nerrors=0 verbose=yes @@ -56,7 +59,9 @@ SRC_H5JAM_TESTFILES="$SRC_TOOLS/h5jam/testfiles" SRC_H5STAT_TESTFILES="$SRC_TOOLS/h5stat/testfiles" SRC_H5IMPORT_TESTFILES="$SRC_TOOLS/h5import/testfiles" +TEST_P_DIR=./testfiles TESTDIR=./testfiles/std +test -d $TEST_P_DIR || mkdir -p $TEST_P_DIR test -d $TESTDIR || mkdir -p $TESTDIR ###################################################################### @@ -170,6 +175,7 @@ $SRC_H5DUMP_TESTFILES/packedbits.ddl $SRC_H5DUMP_TESTFILES/tall-1.ddl $SRC_H5DUMP_TESTFILES/tall-2.ddl $SRC_H5DUMP_TESTFILES/tall-2A.ddl +$SRC_H5DUMP_TESTFILES/tall-2A0.ddl $SRC_H5DUMP_TESTFILES/tall-2B.ddl $SRC_H5DUMP_TESTFILES/tall-3.ddl $SRC_H5DUMP_TESTFILES/tall-4s.ddl @@ -271,6 +277,8 @@ $SRC_H5DUMP_TESTFILES/tno-subset.ddl $SRC_H5DUMP_TESTFILES/tnullspace.ddl $SRC_H5DUMP_TESTFILES/trawdatafile.ddl $SRC_H5DUMP_TESTFILES/trawdatafile.exp +$SRC_H5DUMP_TESTFILES/trawssetfile.ddl +$SRC_H5DUMP_TESTFILES/trawssetfile.exp $SRC_H5DUMP_TESTFILES/zerodim.ddl $SRC_H5DUMP_TESTFILES/tordergr1.ddl $SRC_H5DUMP_TESTFILES/tordergr2.ddl @@ -328,6 +336,7 @@ LIST_ERROR_TEST_FILES=" ${SRC_H5DUMP_ERRORFILES}/filter_fail.err ${SRC_H5DUMP_ERRORFILES}/tall-1.err ${SRC_H5DUMP_ERRORFILES}/tall-2A.err +${SRC_H5DUMP_ERRORFILES}/tall-2A0.err ${SRC_H5DUMP_ERRORFILES}/tall-2B.err ${SRC_H5DUMP_ERRORFILES}/tarray1_big.err ${SRC_H5DUMP_ERRORFILES}/tattr-3.err @@ -721,6 +730,70 @@ TOOLTEST4() { } +# same as TOOLTEST4 but disables plugin filter loading +# silences extra error output on some platforms +# ADD_H5ERR_MASK_TEST +TOOLTEST5() { + + expect="$TESTDIR/$1" + expect_err="$TESTDIR/`basename $1 .ddl`.err" + actual="$TESTDIR/`basename $1 .ddl`.out" + actual_err="$TESTDIR/`basename $1 .ddl`.oerr" + actual_ext="$TESTDIR/`basename $1 .ddl`.ext" + actual_sav=${actual}-sav + actual_err_sav=${actual_err}-sav + shift + + # Run test. + TESTING $DUMPER $@ + ( + cd $TESTDIR + $ENVCMD $RUNSERIAL $DUMPER_BIN "$@" + ) >$actual 2>$actual_err + + # save actual and actual_err in case they are needed later. + cp $actual $actual_sav + STDOUT_FILTER $actual + cp $actual_err $actual_err_sav + STDERR_FILTER $actual_err + + # Extract file name, line number, version and thread IDs because they may be different + sed -e 's/thread [0-9]*/thread (IDs)/' -e 's/: .*\.c /: (file name) /' \ + -e 's/line [0-9]*/line (number)/' \ + -e 's/v[1-9]*\.[0-9]*\./version (number)\./' \ + -e 's/[1-9]*\.[0-9]*\.[0-9]*[^)]*/version (number)/' \ + -e 's/H5Eget_auto[1-2]*/H5Eget_auto(1 or 2)/' \ + -e 's/H5Eset_auto[1-2]*/H5Eset_auto(1 or 2)/' \ + $actual_err > $actual_ext + #cat $actual_ext >> $actual + + if [ ! -f $expect ]; then + # Create the expect file if it doesn't yet exist. + echo " CREATED" + cp $actual $expect + elif $CMP $expect $actual; then + if $CMP $expect_err $actual_ext; then + echo " PASSED" + else + echo "*FAILED*" + echo " Expected result (*.err) differs from actual result (*.oerr)" + nerrors="`expr $nerrors + 1`" + test yes = "$verbose" && $DIFF $expect_err $actual_ext |sed 's/^/ /' + fi + else + echo "*FAILED*" + echo " Expected result (*.ddl) differs from actual result (*.out)" + nerrors="`expr $nerrors + 1`" + test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' + fi + + # Clean up output file + if test -z "$HDF5_NOCLEANUP"; then + rm -f $actual $actual_err $actual_sav $actual_err_sav + fi + +} + # Print a "SKIP" message SKIP() { TESTING $DUMPER $@ @@ -806,6 +879,7 @@ TOOLTEST tnoattrdata.ddl --enable-error-stack -A -o tattr.h5 TOOLTEST2 trawdatafile.exp --enable-error-stack -y -o trawdatafile.txt packedbits.h5 TOOLTEST2 tnoddlfile.exp --enable-error-stack -O -y -o tnoddlfile.txt packedbits.h5 TOOLTEST2A twithddlfile.exp twithddl.exp --enable-error-stack --ddl=twithddl.txt -y -o twithddlfile.txt packedbits.h5 +TOOLTEST2 trawssetfile.exp --enable-error-stack -d "/dset1[1,1;;;]" -y -o trawssetfile.txt tdset.h5 # test for maximum display datasets TOOLTEST twidedisplay.ddl --enable-error-stack -w0 packedbits.h5 @@ -933,6 +1007,9 @@ TOOLTEST tlarge_objname.ddl --enable-error-stack -w157 tlarge_objname.h5 # test '-A' to suppress data but print attr's TOOLTEST4 tall-2A.ddl --enable-error-stack -A tall.h5 +# test '-A' to suppress attr's but print data +TOOLTEST4 tall-2A0.ddl --enable-error-stack -A 0 tall.h5 + # test '-r' to print attributes in ASCII instead of decimal TOOLTEST4 tall-2B.ddl --enable-error-stack -A -r tall.h5 @@ -1128,7 +1205,7 @@ TOOLTEST4 textlinkfar.ddl --enable-error-stack textlinkfar.h5 TOOLTEST4 textlink.ddl --enable-error-stack textlink.h5 # test for error stack display (BZ2048) -TOOLTEST4 filter_fail.ddl --enable-error-stack filter_fail.h5 +TOOLTEST5 filter_fail.ddl --enable-error-stack filter_fail.h5 # test for -o -y for dataset with attributes TOOLTEST2 tall-6.exp --enable-error-stack -y -o tall-6.txt -d /g1/g1.1/dset1.1.1 tall.h5 diff --git a/tools/h5dump/testh5dumppbits.sh.in b/tools/h5dump/testh5dumppbits.sh.in index 8e8e0c0..def687b 100644 --- a/tools/h5dump/testh5dumppbits.sh.in +++ b/tools/h5dump/testh5dumppbits.sh.in @@ -64,7 +64,9 @@ SRC_H5JAM_TESTFILES="$SRC_TOOLS/h5jam/testfiles" SRC_H5STAT_TESTFILES="$SRC_TOOLS/h5stat/testfiles" SRC_H5IMPORT_TESTFILES="$SRC_TOOLS/h5import/testfiles" +TEST_P_DIR=./testfiles TESTDIR=./testfiles/pbits +test -d $TEST_P_DIR || mkdir -p $TEST_P_DIR test -d $TESTDIR || mkdir -p $TESTDIR ###################################################################### diff --git a/tools/h5dump/testh5dumpxml.sh.in b/tools/h5dump/testh5dumpxml.sh.in index a70d31c..6e4efd1 100644 --- a/tools/h5dump/testh5dumpxml.sh.in +++ b/tools/h5dump/testh5dumpxml.sh.in @@ -50,7 +50,9 @@ SRC_H5JAM_TESTFILES="$SRC_TOOLS/h5jam/testfiles" SRC_H5STAT_TESTFILES="$SRC_TOOLS/h5stat/testfiles" SRC_H5IMPORT_TESTFILES="$SRC_TOOLS/h5import/testfiles" +TEST_P_DIR=./testfiles TESTDIR=./testfiles/xml +test -d $TEST_P_DIR || mkdir -p $TEST_P_DIR test -d $TESTDIR || mkdir -p $TESTDIR ###################################################################### diff --git a/tools/h5import/CMakeLists.txt b/tools/h5import/CMakeLists.txt index 97f7be9..94dd69c 100644 --- a/tools/h5import/CMakeLists.txt +++ b/tools/h5import/CMakeLists.txt @@ -11,6 +11,7 @@ INCLUDE_DIRECTORIES (${HDF5_TOOLS_SRC_DIR}/lib) # -------------------------------------------------------------------- ADD_EXECUTABLE (h5import ${HDF5_TOOLS_H5IMPORT_SOURCE_DIR}/h5import.c) TARGET_NAMING (h5import ${LIB_TYPE}) +TARGET_C_PROPERTIES (h5import " " " ") TARGET_LINK_LIBRARIES (h5import ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) #SET_TARGET_PROPERTIES (h5import PROPERTIES COMPILE_DEFINITIONS H5DEBUGIMPORT) SET_TARGET_PROPERTIES (h5import PROPERTIES FOLDER tools) @@ -29,6 +30,7 @@ IF (BUILD_TESTING) # -------------------------------------------------------------------- ADD_EXECUTABLE (h5importtest ${HDF5_TOOLS_H5IMPORT_SOURCE_DIR}/h5importtest.c) TARGET_NAMING (h5importtest ${LIB_TYPE}) + TARGET_C_PROPERTIES (h5importtest " " " ") TARGET_LINK_LIBRARIES (h5importtest ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) SET_TARGET_PROPERTIES (h5importtest PROPERTIES FOLDER tools) diff --git a/tools/h5jam/CMakeLists.txt b/tools/h5jam/CMakeLists.txt index 95777b3..af9639d 100644 --- a/tools/h5jam/CMakeLists.txt +++ b/tools/h5jam/CMakeLists.txt @@ -11,21 +11,25 @@ INCLUDE_DIRECTORIES (${HDF5_TOOLS_SRC_DIR}/lib) # -------------------------------------------------------------------- ADD_EXECUTABLE (h5jam ${HDF5_TOOLS_H5JAM_SOURCE_DIR}/h5jam.c) TARGET_NAMING (h5jam ${LIB_TYPE}) +TARGET_C_PROPERTIES (h5jam " " " ") TARGET_LINK_LIBRARIES (h5jam ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) SET_TARGET_PROPERTIES (h5jam PROPERTIES FOLDER tools) ADD_EXECUTABLE (getub ${HDF5_TOOLS_H5JAM_SOURCE_DIR}/getub.c) TARGET_NAMING (getub ${LIB_TYPE}) +TARGET_C_PROPERTIES (getub " " " ") TARGET_LINK_LIBRARIES (getub ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) SET_TARGET_PROPERTIES (getub PROPERTIES FOLDER tools) ADD_EXECUTABLE (tellub ${HDF5_TOOLS_H5JAM_SOURCE_DIR}/tellub.c) TARGET_NAMING (tellub ${LIB_TYPE}) +TARGET_C_PROPERTIES (tellub " " " ") TARGET_LINK_LIBRARIES (tellub ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) SET_TARGET_PROPERTIES (tellub PROPERTIES FOLDER tools) ADD_EXECUTABLE (h5unjam ${HDF5_TOOLS_H5JAM_SOURCE_DIR}/h5unjam.c) TARGET_NAMING (h5unjam ${LIB_TYPE}) +TARGET_C_PROPERTIES (h5unjam " " " ") TARGET_LINK_LIBRARIES (h5unjam ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) SET_TARGET_PROPERTIES (h5unjam PROPERTIES FOLDER tools) @@ -49,6 +53,7 @@ IF (BUILD_TESTING) IF (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) ADD_EXECUTABLE (h5jamgentest ${HDF5_TOOLS_H5JAM_SOURCE_DIR}/h5jamgentest.c) TARGET_NAMING (h5jamgentest ${LIB_TYPE}) + TARGET_C_PROPERTIES (testhdf5 " " " ") TARGET_LINK_LIBRARIES (h5jamgentest ${HDF5_LIB_TARGET}) SET_TARGET_PROPERTIES (h5jamgentest PROPERTIES FOLDER generator/tools) diff --git a/tools/h5jam/getub.c b/tools/h5jam/getub.c index f536605..d84f7f2 100644 --- a/tools/h5jam/getub.c +++ b/tools/h5jam/getub.c @@ -153,7 +153,7 @@ main (int argc, const char *argv[]) exit (EXIT_FAILURE); } - buf = malloc ((unsigned)(size + 1)); + buf = (char *)HDmalloc ((unsigned)(size + 1)); if (buf == NULL) { HDclose (fd); diff --git a/tools/h5ls/CMakeLists.txt b/tools/h5ls/CMakeLists.txt index 70943b5..2d7bd97 100644 --- a/tools/h5ls/CMakeLists.txt +++ b/tools/h5ls/CMakeLists.txt @@ -11,6 +11,7 @@ INCLUDE_DIRECTORIES (${HDF5_TOOLS_SRC_DIR}/lib) #----------------------------------------------------------------------------- ADD_EXECUTABLE (h5ls ${HDF5_TOOLS_H5LS_SOURCE_DIR}/h5ls.c) TARGET_NAMING (h5ls ${LIB_TYPE}) +TARGET_C_PROPERTIES (h5ls " " " ") TARGET_LINK_LIBRARIES (h5ls ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) SET_TARGET_PROPERTIES (h5ls PROPERTIES FOLDER tools) diff --git a/tools/h5repack/CMakeLists.txt b/tools/h5repack/CMakeLists.txt index 06c6b71..7d251ac 100644 --- a/tools/h5repack/CMakeLists.txt +++ b/tools/h5repack/CMakeLists.txt @@ -22,6 +22,7 @@ SET (REPACK_COMMON_SRCS ADD_EXECUTABLE (h5repack ${REPACK_COMMON_SRCS} ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/h5repack_main.c) TARGET_NAMING (h5repack ${LIB_TYPE}) +TARGET_C_PROPERTIES (h5repack " " " ") TARGET_LINK_LIBRARIES (h5repack ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) SET_TARGET_PROPERTIES (h5repack PROPERTIES FOLDER tools) @@ -39,11 +40,13 @@ IF (BUILD_TESTING) # -------------------------------------------------------------------- ADD_EXECUTABLE (testh5repack_detect_szip ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testh5repack_detect_szip.c) TARGET_NAMING (testh5repack_detect_szip ${LIB_TYPE}) + TARGET_C_PROPERTIES (testh5repack_detect_szip " " " ") TARGET_LINK_LIBRARIES (testh5repack_detect_szip ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) SET_TARGET_PROPERTIES (testh5repack_detect_szip PROPERTIES FOLDER tools) ADD_EXECUTABLE (h5repacktest ${REPACK_COMMON_SRCS} ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/h5repacktst.c) TARGET_NAMING (h5repacktest ${LIB_TYPE}) + TARGET_C_PROPERTIES (h5repacktest " " " ") TARGET_LINK_LIBRARIES (h5repacktest ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) SET_TARGET_PROPERTIES (h5repacktest PROPERTIES FOLDER tools) diff --git a/tools/h5stat/CMakeLists.txt b/tools/h5stat/CMakeLists.txt index 447df70..78f39dd 100644 --- a/tools/h5stat/CMakeLists.txt +++ b/tools/h5stat/CMakeLists.txt @@ -11,6 +11,7 @@ INCLUDE_DIRECTORIES (${HDF5_TOOLS_SRC_DIR}/lib) # -------------------------------------------------------------------- ADD_EXECUTABLE (h5stat ${HDF5_TOOLS_H5STAT_SOURCE_DIR}/h5stat.c) TARGET_NAMING (h5stat ${LIB_TYPE}) +TARGET_C_PROPERTIES (h5stat " " " ") TARGET_LINK_LIBRARIES (h5stat ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) SET_TARGET_PROPERTIES (h5stat PROPERTIES FOLDER tools) @@ -29,6 +30,7 @@ IF (BUILD_TESTING) IF (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) ADD_EXECUTABLE (h5stat_gentest ${HDF5_TOOLS_H5STAT_SOURCE_DIR}/h5stat_gentest.c) TARGET_NAMING (h5stat_gentest ${LIB_TYPE}) + TARGET_C_PROPERTIES (h5stat_gentest " " " ") TARGET_LINK_LIBRARIES (h5stat_gentest ${HDF5_LIB_TARGET}) SET_TARGET_PROPERTIES (h5stat_gentest PROPERTIES FOLDER generator/tools) diff --git a/tools/h5stat/h5stat.c b/tools/h5stat/h5stat.c index a68760d..dcc2c08 100644 --- a/tools/h5stat/h5stat.c +++ b/tools/h5stat/h5stat.c @@ -136,7 +136,8 @@ static int display_object = FALSE; /* not implemented yet */ /* a structure for handling the order command-line parameters come in */ struct handler_t { - char *obj; + size_t obj_count; + char **obj; }; @@ -552,7 +553,7 @@ dataset_stats(iter_t *iter, const char *name, const H5O_info_t *oi) if(type_found) (iter->dset_type_info[u].count)++; else { - unsigned curr_ntype = iter->dset_ntypes; + unsigned curr_ntype = (unsigned)iter->dset_ntypes; /* Increment # of datatypes seen for datasets */ iter->dset_ntypes++; @@ -670,9 +671,11 @@ obj_stats(const char *path, const H5O_info_t *oi, const char *already_visited, break; case H5O_TYPE_NAMED_DATATYPE: - datatype_stats(iter, oi); + datatype_stats(iter, oi); break; + case H5O_TYPE_UNKNOWN: + case H5O_TYPE_NTYPES: default: /* Gather statistics about this type of object */ iter->uniq_others++; @@ -710,6 +713,9 @@ lnk_stats(const char UNUSED *path, const H5L_info_t *li, void *_iter) iter->uniq_links++; break; + case H5L_TYPE_HARD: + case H5L_TYPE_MAX: + case H5L_TYPE_ERROR: default: /* Gather statistics about this type of object */ iter->uniq_others++; @@ -740,19 +746,19 @@ freespace_stats(hid_t fid, iter_t *iter) /* Query section information */ if((nsects = H5Fget_free_sections(fid, H5FD_MEM_DEFAULT, 0, NULL)) < 0) - return(FAIL); + return(FAIL); else if(nsects) { - if(NULL == (sect_info = (H5F_sect_info_t *)HDcalloc((size_t)nsects, sizeof(H5F_sect_info_t)))) - return(FAIL); - nsects = H5Fget_free_sections(fid, H5FD_MEM_DEFAULT, (size_t)nsects, sect_info); - HDassert(nsects); + if(NULL == (sect_info = (H5F_sect_info_t *)HDcalloc((size_t)nsects, sizeof(H5F_sect_info_t)))) + return(FAIL); + nsects = H5Fget_free_sections(fid, H5FD_MEM_DEFAULT, (size_t)nsects, sect_info); + HDassert(nsects); } /* end else-if */ for(u = 0; u < (size_t)nsects; u++) { unsigned bin; /* "bin" the number of objects falls in */ - if(sect_info[u].size < SIZE_SMALL_SECTS) - (iter->num_small_sects[(size_t)sect_info[u].size])++; + if(sect_info[u].size < SIZE_SMALL_SECTS) + (iter->num_small_sects[(size_t)sect_info[u].size])++; /* Add section size to proper bin */ bin = ceil_log10((unsigned long)sect_info[u].size); @@ -781,6 +787,35 @@ freespace_stats(hid_t fid, iter_t *iter) /*------------------------------------------------------------------------- + * Function: hand_free + * + * Purpose: Free handler structure + * + * Return: Success: 0 + * + * Failure: Never fails + * + *------------------------------------------------------------------------- + */ +static void +hand_free(struct handler_t *hand) +{ + if(hand) { + unsigned u; + + for(u = 0; u < hand->obj_count; u++) + if(hand->obj[u]) { + HDfree(hand->obj[u]); + hand->obj[u] = NULL; + } /* end if */ + hand->obj_count = 0; + HDfree(hand->obj); + HDfree(hand); + } /* end if */ +} /* end hand_free() */ + + +/*------------------------------------------------------------------------- * Function: parse_command_line * * Purpose: Parses command line and sets up global variable to control output @@ -794,50 +829,25 @@ freespace_stats(hid_t fid, iter_t *iter) * *------------------------------------------------------------------------- */ -static struct handler_t * -parse_command_line(int argc, const char *argv[]) +static int +parse_command_line(int argc, const char *argv[], struct handler_t **hand_ret) { - int opt, i; + int opt; + unsigned u; struct handler_t *hand = NULL; - /* Allocate space to hold the command line info */ - if((hand = (struct handler_t *)HDcalloc((size_t)argc, sizeof(struct handler_t)))==NULL) { - error_msg("unable to parse command line arguments \n"); - goto error; - } - /* parse command line options */ - while ((opt = get_option(argc, argv, s_opts, l_opts)) != EOF) { - switch ((char)opt) { + while((opt = get_option(argc, argv, s_opts, l_opts)) != EOF) { + switch((char)opt) { case 'h': usage(h5tools_getprogname()); h5tools_setstatus(EXIT_SUCCESS); - if (hand) { - for (i = 0; i < argc; i++) - if(hand[i].obj) { - free(hand[i].obj); - hand[i].obj=NULL; - } - - free(hand); - hand = NULL; - } goto done; break; case 'V': print_version(h5tools_getprogname()); h5tools_setstatus(EXIT_SUCCESS); - if (hand) { - for (i = 0; i < argc; i++) - if(hand[i].obj) { - free(hand[i].obj); - hand[i].obj=NULL; - } - - free(hand); - hand = NULL; - } goto done; break; @@ -894,45 +904,52 @@ parse_command_line(int argc, const char *argv[]) case 'O': display_all = FALSE; display_object = TRUE; - for(i = 0; i < argc; i++) - if(!hand[i].obj) { - hand[i].obj = HDstrdup(opt_arg); - break; + + /* Allocate space to hold the command line info */ + if(NULL == (hand = (struct handler_t *)HDcalloc((size_t)1, sizeof(struct handler_t)))) { + error_msg("unable to allocate memory for object struct\n"); + goto error; + } /* end if */ + + /* Allocate space to hold the object strings */ + hand->obj_count = (size_t)argc; + if(NULL == (hand->obj = (char **)HDcalloc((size_t)argc, sizeof(char *)))) { + error_msg("unable to allocate memory for object array\n"); + goto error; + } /* end if */ + + /* Store object names */ + for(u = 0; u < hand->obj_count; u++) + if(NULL == (hand->obj[u] = HDstrdup(opt_arg))) { + error_msg("unable to allocate memory for object name\n"); + goto error; } /* end if */ break; default: usage(h5tools_getprogname()); - h5tools_setstatus(EXIT_FAILURE); goto error; } /* end switch */ } /* end while */ /* check for file name to be processed */ - if (argc <= opt_ind) { + if(argc <= opt_ind) { error_msg("missing file name\n"); usage(h5tools_getprogname()); - h5tools_setstatus(EXIT_FAILURE); goto error; } /* end if */ + /* Set handler structure */ + *hand_ret = hand; + done: - return hand; + return 0; error: - if (hand) { - for (i = 0; i < argc; i++) - if(hand[i].obj) { - free(hand[i].obj); - hand[i].obj=NULL; - } - - free(hand); - hand = NULL; - } + hand_free(hand); h5tools_setstatus(EXIT_FAILURE); - return hand; + return -1; } @@ -947,32 +964,39 @@ error: * *------------------------------------------------------------------------- */ -static herr_t +static void iter_free(iter_t *iter) { /* Clear array of bins for group counts */ - if(iter->group_bins) - free(iter->group_bins); - iter->group_bins = NULL; + if(iter->group_bins) { + HDfree(iter->group_bins); + iter->group_bins = NULL; + } /* end if */ + /* Clear array of bins for attribute counts */ - if(iter->attr_bins) - free(iter->attr_bins); - iter->attr_bins = NULL; + if(iter->attr_bins) { + HDfree(iter->attr_bins); + iter->attr_bins = NULL; + } /* end if */ + /* Clear dataset datatype information found */ - if(iter->dset_type_info) - free(iter->dset_type_info); - iter->dset_type_info = NULL; + if(iter->dset_type_info) { + HDfree(iter->dset_type_info); + iter->dset_type_info = NULL; + } /* end if */ + /* Clear array of bins for dataset dimensions */ - if(iter->dset_dim_bins) - free(iter->dset_dim_bins); - iter->dset_dim_bins = NULL; - /* Clear array of bins for free-space section sizes */ - if(iter->sect_bins) - free(iter->sect_bins); - iter->sect_bins = NULL; + if(iter->dset_dim_bins) { + HDfree(iter->dset_dim_bins); + iter->dset_dim_bins = NULL; + } /* end if */ - return 0; -} + /* Clear array of bins for free-space section sizes */ + if(iter->sect_bins) { + HDfree(iter->sect_bins); + iter->sect_bins = NULL; + } /* end if */ +} /* end iter_free() */ /*------------------------------------------------------------------------- @@ -1428,7 +1452,7 @@ print_storage_summary(const iter_t *iter) { hsize_t total_meta = 0; hsize_t unaccount = 0; - float percent = 0.0; + double percent = 0.0f; HDfprintf(stdout, "File space management strategy: %s\n", FS_STRATEGY_NAME[iter->fs_strategy]); printf("Summary of file space information:\n"); @@ -1451,7 +1475,7 @@ print_storage_summary(const iter_t *iter) HDfprintf(stdout, " File metadata: %Hu bytes\n", total_meta); HDfprintf(stdout, " Raw data: %Hu bytes\n", iter->dset_storage_size); - percent = ((float)iter->free_space / (float)iter->filesize) * 100; + percent = ((double)iter->free_space / (double)iter->filesize) * (double)100.0f; HDfprintf(stdout, " Amount/Percent of tracked free space: %Hu bytes/%3.1f%\n", iter->free_space, percent); @@ -1584,10 +1608,7 @@ main(int argc, const char *argv[]) iter_t iter; const char *fname = NULL; hid_t fid = -1; - hid_t fcpl; struct handler_t *hand = NULL; - H5F_info2_t finfo; - int i; h5tools_setprogname(PROGRAMNAME); h5tools_setstatus(EXIT_SUCCESS); @@ -1598,97 +1619,91 @@ main(int argc, const char *argv[]) /* Initialize h5tools lib */ h5tools_init(); - if((hand = parse_command_line(argc, argv))==NULL) { - goto done; - } - - fname = argv[opt_ind]; - - printf("Filename: %s\n", fname); - HDmemset(&iter, 0, sizeof(iter)); - fid = H5Fopen(fname, H5F_ACC_RDONLY, H5P_DEFAULT); - if(fid < 0) { - error_msg("unable to open file \"%s\"\n", fname); - h5tools_setstatus(EXIT_FAILURE); + if(parse_command_line(argc, argv, &hand) < 0) goto done; - } /* end if */ - /* Initialize iter structure */ - iter.fid = fid; - - if(H5Fget_filesize(fid, &iter.filesize) < 0) - warn_msg("Unable to retrieve file size\n"); - HDassert(iter.filesize != 0); - - /* Get storge info for file-level structures */ - if(H5Fget_info2(fid, &finfo) < 0) - warn_msg("Unable to retrieve file info\n"); - else { - iter.super_size = finfo.super.super_size; - iter.super_ext_size = finfo.super.super_ext_size; - iter.SM_hdr_storage_size = finfo.sohm.hdr_size; - iter.SM_index_storage_size = finfo.sohm.msgs_info.index_size; - iter.SM_heap_storage_size = finfo.sohm.msgs_info.heap_size; - iter.free_space = finfo.free.tot_space; - iter.free_hdr = finfo.free.meta_size; - } /* end else */ - - if((fcpl = H5Fget_create_plist(fid)) < 0) - warn_msg("Unable to retrieve file creation property\n"); - - if(H5Pget_userblock(fcpl, &iter.ublk_size) < 0) - warn_msg("Unable to retrieve userblock size\n"); + fname = argv[opt_ind]; - if(H5Pget_file_space(fcpl, &iter.fs_strategy, &iter.fs_threshold) < 0) - warn_msg("Unable to retrieve file space information\n"); - HDassert(iter.fs_strategy != 0 && iter.fs_strategy < H5F_FILE_SPACE_NTYPES); + /* Check for filename given */ + if(fname) { + hid_t fcpl; + H5F_info2_t finfo; - /* get information for free-space sections */ - if(freespace_stats(fid, &iter) < 0) - warn_msg("Unable to retrieve freespace info\n"); + printf("Filename: %s\n", fname); - /* Walk the objects or all file */ - if(display_object) { - unsigned u; + fid = H5Fopen(fname, H5F_ACC_RDONLY, H5P_DEFAULT); + if(fid < 0) { + error_msg("unable to open file \"%s\"\n", fname); + h5tools_setstatus(EXIT_FAILURE); + goto done; + } /* end if */ - u = 0; - while(hand[u].obj) { - if (h5trav_visit(fid, hand[u].obj, TRUE, TRUE, obj_stats, lnk_stats, &iter) < 0) - warn_msg("Unable to traverse object \"%s\"\n", hand[u].obj); + /* Initialize iter structure */ + iter.fid = fid; + + if(H5Fget_filesize(fid, &iter.filesize) < 0) + warn_msg("Unable to retrieve file size\n"); + HDassert(iter.filesize != 0); + + /* Get storge info for file-level structures */ + if(H5Fget_info2(fid, &finfo) < 0) + warn_msg("Unable to retrieve file info\n"); + else { + iter.super_size = finfo.super.super_size; + iter.super_ext_size = finfo.super.super_ext_size; + iter.SM_hdr_storage_size = finfo.sohm.hdr_size; + iter.SM_index_storage_size = finfo.sohm.msgs_info.index_size; + iter.SM_heap_storage_size = finfo.sohm.msgs_info.heap_size; + iter.free_space = finfo.free.tot_space; + iter.free_hdr = finfo.free.meta_size; + } /* end else */ + + if((fcpl = H5Fget_create_plist(fid)) < 0) + warn_msg("Unable to retrieve file creation property\n"); + + if(H5Pget_userblock(fcpl, &iter.ublk_size) < 0) + warn_msg("Unable to retrieve userblock size\n"); + + if(H5Pget_file_space(fcpl, &iter.fs_strategy, &iter.fs_threshold) < 0) + warn_msg("Unable to retrieve file space information\n"); + HDassert(iter.fs_strategy != 0 && iter.fs_strategy < H5F_FILE_SPACE_NTYPES); + + /* get information for free-space sections */ + if(freespace_stats(fid, &iter) < 0) + warn_msg("Unable to retrieve freespace info\n"); + + /* Walk the objects or all file */ + if(display_object) { + unsigned u; + + for(u = 0; u < hand->obj_count; u++) { + if(h5trav_visit(fid, hand->obj[u], TRUE, TRUE, obj_stats, lnk_stats, &iter) < 0) + warn_msg("Unable to traverse object \"%s\"\n", hand->obj[u]); + else + print_statistics(hand->obj[u], &iter); + } /* end for */ + } /* end if */ + else { + if(h5trav_visit(fid, "/", TRUE, TRUE, obj_stats, lnk_stats, &iter) < 0) + warn_msg("Unable to traverse objects/links in file \"%s\"\n", fname); else - print_statistics(hand[u].obj, &iter); - u++; - } /* end while */ + print_statistics("/", &iter); + } /* end else */ } /* end if */ - else { - if (h5trav_visit(fid, "/", TRUE, TRUE, obj_stats, lnk_stats, &iter) < 0) - warn_msg("Unable to traverse objects/links in file \"%s\"\n", fname); - else - print_statistics("/", &iter); - } /* end else */ done: - if(hand) { - for (i = 0; i < argc; i++) - if(hand[i].obj) { - free(hand[i].obj); - hand[i].obj=NULL; - } + hand_free(hand); - free(hand); - hand = NULL; + /* Free iter structure */ + iter_free(&iter); - /* Free iter structure */ - iter_free(&iter); - - if(fid >= 0 && H5Fclose(fid) < 0) { - error_msg("unable to close file \"%s\"\n", fname); - h5tools_setstatus(EXIT_FAILURE); - } - } + if(fid >= 0 && H5Fclose(fid) < 0) { + error_msg("unable to close file \"%s\"\n", fname); + h5tools_setstatus(EXIT_FAILURE); + } /* end if */ leave(h5tools_getstatus()); -} +} /* end main() */ diff --git a/tools/lib/CMakeLists.txt b/tools/lib/CMakeLists.txt index ac86e8a..6649e48 100644 --- a/tools/lib/CMakeLists.txt +++ b/tools/lib/CMakeLists.txt @@ -37,8 +37,9 @@ SET (H5_TOOLS_LIB_HDRS ) ADD_LIBRARY (${HDF5_TOOLS_LIB_TARGET} ${LIB_TYPE} ${H5_TOOLS_LIB_SRCS} ${H5_TOOLS_LIB_HDRS}) +TARGET_C_PROPERTIES (${HDF5_TOOLS_LIB_TARGET} " " " ") TARGET_LINK_LIBRARIES (${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) -SET_GLOBAL_VARIABLE(HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_TOOLS_LIB_TARGET}") +SET_GLOBAL_VARIABLE (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_TOOLS_LIB_TARGET}") H5_SET_LIB_OPTIONS ( ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TOOLS_LIB_NAME} ${LIB_TYPE} diff --git a/tools/lib/h5diff_array.c b/tools/lib/h5diff_array.c index 528fc40..96b508d 100644 --- a/tools/lib/h5diff_array.c +++ b/tools/lib/h5diff_array.c @@ -5783,17 +5783,19 @@ static int ull2float(unsigned long long ull_value, float *f_value) { hid_t dxpl_id; - unsigned char *buf; + unsigned char *buf = NULL; size_t src_size; size_t dst_size; h5difftrace("ull2float start\n"); if((dxpl_id = H5Pcreate(H5P_DATASET_XFER))<0) - return -1; + goto error; src_size = H5Tget_size(H5T_NATIVE_ULLONG); dst_size = H5Tget_size(H5T_NATIVE_FLOAT); buf = (unsigned char*)HDcalloc(1, MAX(src_size, dst_size)); + if(!buf) + goto error; HDmemcpy(buf, &ull_value, src_size); diff --git a/tools/lib/h5tools.c b/tools/lib/h5tools.c index 5f4227c..3e9c43e 100644 --- a/tools/lib/h5tools.c +++ b/tools/lib/h5tools.c @@ -527,16 +527,18 @@ h5tools_detect_vlen_str(hid_t tid) } } else if(tclass == H5T_COMPOUND) { - int i = 0; - int n = H5Tget_nmembers(tid); + unsigned nmembs; + int snmembs = H5Tget_nmembers(tid); + unsigned u; - if(n < 0) { - n = ret; + if(snmembs < 0) { + ret = FAIL; goto done; } + nmembs = (unsigned)snmembs; - for(i = 0; i < n; i++) { - hid_t mtid = H5Tget_member_type(tid, i); + for(u = 0; u < nmembs; u++) { + hid_t mtid = H5Tget_member_type(tid, u); ret = h5tools_detect_vlen_str(mtid); if((ret == TRUE) || (ret < 0)) { @@ -1150,6 +1152,8 @@ render_bin_output(FILE *stream, hid_t container, hid_t tid, void *_mem, hsize_t s = *(char**) mem; if (s != NULL) size = HDstrlen(s); + else + H5E_THROW(FAIL, H5E_tools_min_id_g, "NULL string"); } else { s = (char *) mem; diff --git a/tools/lib/h5tools_dump.c b/tools/lib/h5tools_dump.c index d6cd0a0..cde249c 100644 --- a/tools/lib/h5tools_dump.c +++ b/tools/lib/h5tools_dump.c @@ -188,7 +188,7 @@ table_t *h5dump_type_table = NULL; /*type table reference for datatype dump */ static int h5tools_print_region_data_blocks(hid_t region_id, FILE *stream, const h5tool_format_t *info, h5tools_context_t *cur_ctx, h5tools_str_t *buffer/*string into which to render */, size_t ncols, - int ndims, hid_t type_id, hssize_t nblocks, hsize_t *ptdata); + unsigned ndims, hid_t type_id, hsize_t nblocks, hsize_t *ptdata); hbool_t h5tools_dump_region_data_points(hid_t region_space, hid_t region_id, FILE *stream, const h5tool_format_t *info, @@ -314,13 +314,13 @@ h5tools_dump_simple_data(FILE *stream, const h5tool_format_t *info, hid_t contai if (region_space >= 0) { if (h5tools_is_zero(memref, H5Tget_size(type))) { ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); + h5tools_simple_prefix(rawoutstream, info, ctx, curr_pos, 0); /* Render the region element begin */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "NULL"); - dimension_break = h5tools_render_element(stream, info, + dimension_break = h5tools_render_element(rawoutstream, info, ctx, &buffer, &curr_pos, ncols, i, elmt_counter); } else { @@ -328,25 +328,25 @@ h5tools_dump_simple_data(FILE *stream, const h5tool_format_t *info, hid_t contai HERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Rget_name failed"); ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, curr_pos+i, 0); + h5tools_simple_prefix(rawoutstream, info, ctx, curr_pos+i, 0); /* Render the region element begin */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, info->dset_format, ref_name); - dimension_break = h5tools_render_element(stream, info, + dimension_break = h5tools_render_element(rawoutstream, info, ctx, &buffer, &curr_pos, ncols, i, elmt_counter); region_type = H5Sget_select_type(region_space); if(region_type == H5S_SEL_POINTS) /* Print point information */ dimension_break = h5tools_dump_region_data_points( - region_space, region_id, stream, info, ctx, + region_space, region_id, rawoutstream, info, ctx, &buffer, &curr_pos, ncols, i, elmt_counter); else if(region_type == H5S_SEL_HYPERSLABS) /* Print block information */ dimension_break = h5tools_dump_region_data_blocks( - region_space, region_id, stream, info, ctx, + region_space, region_id, rawoutstream, info, ctx, &buffer, &curr_pos, ncols, i, elmt_counter); else HERROR(H5E_tools_g, H5E_tools_min_id_g, "invalid region type"); @@ -419,7 +419,7 @@ static int h5tools_print_region_data_blocks(hid_t region_id, FILE *stream, const h5tool_format_t *info, h5tools_context_t *cur_ctx, h5tools_str_t *buffer/*string into which to render */, size_t ncols, - int ndims, hid_t type_id, hssize_t nblocks, hsize_t *ptdata) + unsigned ndims, hid_t type_id, hsize_t nblocks, hsize_t *ptdata) { hbool_t dimension_break = TRUE; hsize_t *dims1 = NULL; @@ -432,9 +432,9 @@ h5tools_print_region_data_blocks(hid_t region_id, unsigned int region_flags; /* buffer extent flags */ hsize_t numelem; hsize_t numindex; - size_t jndx; unsigned indx; - int type_size; + unsigned jndx; + size_t type_size; int ret_value = SUCCEED; hid_t mem_space = -1; hid_t sid1 = -1; @@ -447,6 +447,7 @@ h5tools_print_region_data_blocks(hid_t region_id, HDassert(ptdata); HDmemset(&ctx, 0, sizeof(ctx)); + /* Get the dataspace of the dataset */ if((sid1 = H5Dget_space(region_id)) < 0) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dget_space failed"); @@ -463,7 +464,7 @@ h5tools_print_region_data_blocks(hid_t region_id, } /* Create dataspace for reading buffer */ - if((mem_space = H5Screate_simple(ndims, dims1, NULL)) < 0) + if((mem_space = H5Screate_simple((int)ndims, dims1, NULL)) < 0) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Screate_simple failed"); if((type_size = H5Tget_size(type_id)) == 0) @@ -504,7 +505,7 @@ h5tools_print_region_data_blocks(hid_t region_id, HERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Sget_simple_extent_dims failed"); /* assume entire data space to be printed */ - for (indx = 0; indx < (size_t) ctx.ndims; indx++) + for (indx = 0; indx < (unsigned)ctx.ndims; indx++) ctx.p_min_idx[indx] = start[indx]; init_acc_pos(&ctx, total_size); @@ -513,11 +514,11 @@ h5tools_print_region_data_blocks(hid_t region_id, if (blkndx == nblocks - 1) region_flags |= END_OF_DATA; - for (indx = 0; indx < (size_t)ctx.ndims; indx++) + for (indx = 0; indx < (unsigned)ctx.ndims; indx++) ctx.p_max_idx[indx] = dims1[indx]; curr_pos = 0; - ctx.sm_pos = blkndx*2*ndims; + ctx.sm_pos = blkndx * 2 * ndims; ctx.size_last_dim = dims1[ndims-1]; h5tools_region_simple_prefix(stream, info, &ctx, curr_pos, ptdata, 0); @@ -540,7 +541,7 @@ h5tools_print_region_data_blocks(hid_t region_id, if(FALSE == dimension_break) elmtno = 0; - } /* end for (jndx = 0; jndx < numelem; jndx++, region_elmtno++, ctx.cur_elmt++) */ + } /* end for (numindex = 0; numindex < numelem; numindex++, elmtno++, ctx.cur_elmt++) */ ctx.indent_level--; } /* end for (blkndx = 0; blkndx < nblocks; blkndx++) */ @@ -593,24 +594,28 @@ h5tools_dump_region_data_blocks(hid_t region_space, hid_t region_id, { HERR_INIT(hbool_t, TRUE) hbool_t dimension_break = TRUE; - hssize_t nblocks; + hssize_t snblocks; + hsize_t nblocks; hsize_t alloc_size; hsize_t *ptdata = NULL; - int ndims; + int sndims; + unsigned ndims; hid_t dtype = -1; hid_t type_id = -1; - int i; + hsize_t u; HDassert(info); HDassert(ctx); HDassert(buffer); - if((nblocks = H5Sget_select_hyper_nblocks(region_space)) <= 0) + if((snblocks = H5Sget_select_hyper_nblocks(region_space)) <= 0) H5E_THROW(dimension_break, H5E_tools_min_id_g, "H5Sget_select_hyper_nblocks failed"); + nblocks = (hsize_t)snblocks; /* Print block information */ - if((ndims = H5Sget_simple_extent_ndims(region_space)) < 0) + if((sndims = H5Sget_simple_extent_ndims(region_space)) < 0) H5E_THROW(dimension_break, H5E_tools_min_id_g, "H5Sget_simple_extent_ndims failed"); + ndims = (unsigned)sndims; /* Render the region { element begin */ h5tools_str_reset(buffer); @@ -632,30 +637,28 @@ h5tools_dump_region_data_blocks(hid_t region_space, hid_t region_id, { HERROR(H5E_tools_g, H5E_tools_min_id_g, "Could not allocate buffer for ptdata"); HGOTO_DONE(dimension_break); - //HGOTO_ERROR(dimension_break, H5E_tools_min_id_g, "Could not allocate buffer for ptdata"); } - H5_CHECK_OVERFLOW(nblocks, hssize_t, hsize_t); - if(H5Sget_select_hyper_blocklist(region_space, (hsize_t) 0, (hsize_t) nblocks, ptdata) < 0) + if(H5Sget_select_hyper_blocklist(region_space, (hsize_t)0, nblocks, ptdata) < 0) HGOTO_ERROR(dimension_break, H5E_tools_min_id_g, "H5Rget_select_hyper_blocklist failed"); - for (i = 0; i < nblocks; i++) { - int j; + for(u = 0; u < nblocks; u++) { + unsigned v; h5tools_str_append(buffer, info->dset_blockformat_pre, - i ? "," OPTIONAL_LINE_BREAK " " : "", (unsigned long) i); + u ? "," OPTIONAL_LINE_BREAK " " : "", (unsigned long)u); /* Start coordinates and opposite corner */ - for (j = 0; j < ndims; j++) - h5tools_str_append(buffer, "%s" HSIZE_T_FORMAT, j ? "," : "(", - ptdata[i * 2 * ndims + j]); + for (v = 0; v < ndims; v++) + h5tools_str_append(buffer, "%s" HSIZE_T_FORMAT, v ? "," : "(", + ptdata[u * 2 * ndims + v]); - for (j = 0; j < ndims; j++) - h5tools_str_append(buffer, "%s" HSIZE_T_FORMAT, j ? "," : ")-(", - ptdata[i * 2 * ndims + j + ndims]); + for (v = 0; v < ndims; v++) + h5tools_str_append(buffer, "%s" HSIZE_T_FORMAT, v ? "," : ")-(", + ptdata[u * 2 * ndims + v + ndims]); h5tools_str_append(buffer, ")"); - } /* end for (i = 0; i < nblocks; i++) */ + } /* end for (u = 0; u < nblocks; u++) */ dimension_break = h5tools_render_element(stream, info, ctx, buffer, curr_pos, ncols, region_elmt_counter, elmt_counter); /* Render the region datatype info and indices element end */ @@ -1786,7 +1789,7 @@ h5tools_dump_dset(FILE *stream, const h5tool_format_t *info, h5tools_context_t * if(!sset) status = h5tools_dump_simple_dset(rawdatastream, info, ctx, dset, p_type); else - status = h5tools_dump_simple_subset(stream, info, ctx, dset, p_type, sset); + status = h5tools_dump_simple_subset(rawdatastream, info, ctx, dset, p_type, sset); } else /* space is H5S_NULL */ @@ -2222,12 +2225,16 @@ h5tools_print_datatype(FILE *stream, h5tools_str_t *buffer, const h5tool_format_ /* Change the endianness and see if they're equal. */ order = H5Tget_order(tmp_type); - if (order == H5T_ORDER_LE) - H5Tset_order(str_type, H5T_ORDER_LE); - else if (order == H5T_ORDER_BE) - H5Tset_order(str_type, H5T_ORDER_BE); - - if (H5Tequal(tmp_type, str_type)) { + if(order == H5T_ORDER_LE) { + if(H5Tset_order(str_type, H5T_ORDER_LE) < 0) + HERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Tset_order failed"); + } /* end if */ + else if(order == H5T_ORDER_BE) { + if(H5Tset_order(str_type, H5T_ORDER_BE) < 0) + HERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Tset_order failed"); + } /* end if */ + + if(H5Tequal(tmp_type, str_type)) { h5tools_str_append(buffer, "H5T_C_S1;"); goto found_string_type; } @@ -2249,12 +2256,16 @@ h5tools_print_datatype(FILE *stream, h5tools_str_t *buffer, const h5tool_format_ /* Change the endianness and see if they're equal. */ order = H5Tget_order(tmp_type); - if (order == H5T_ORDER_LE) - H5Tset_order(str_type, H5T_ORDER_LE); - else if (order == H5T_ORDER_BE) - H5Tset_order(str_type, H5T_ORDER_BE); - - if (H5Tequal(tmp_type, str_type)) { + if(order == H5T_ORDER_LE) { + if(H5Tset_order(str_type, H5T_ORDER_LE) < 0) + HERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Tset_order failed"); + } /* end if */ + else if(order == H5T_ORDER_BE) { + if(H5Tset_order(str_type, H5T_ORDER_BE) < 0) + HERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Tset_order failed"); + } /* end if */ + + if(H5Tequal(tmp_type, str_type)) { h5tools_str_append(buffer, "H5T_FORTRAN_S1;"); goto found_string_type; } diff --git a/tools/lib/h5tools_str.c b/tools/lib/h5tools_str.c index e17ae89..9bacd19 100644 --- a/tools/lib/h5tools_str.c +++ b/tools/lib/h5tools_str.c @@ -631,8 +631,6 @@ h5tools_str_indent(h5tools_str_t *str, const h5tool_format_t *info, for (i = 0; i < indentlevel; i++) { h5tools_str_append(str, "%s", OPT(info->line_indent, "")); } - -// ctx->need_prefix = 0; } /*------------------------------------------------------------------------- @@ -1397,24 +1395,24 @@ h5tools_str_replace ( const char *string, const char *substr, const char *replac char *head = NULL; if ( substr == NULL || replacement == NULL ) - return strdup (string); + return HDstrdup (string); - newstr = strdup (string); + newstr = HDstrdup (string); head = newstr; - while ( (tok = strstr ( head, substr ))){ + while ( (tok = HDstrstr ( head, substr ))){ oldstr = newstr; - newstr = HDmalloc ( strlen ( oldstr ) - strlen ( substr ) + strlen ( replacement ) + 1 ); + newstr = HDmalloc ( HDstrlen ( oldstr ) - HDstrlen ( substr ) + HDstrlen ( replacement ) + 1 ); if ( newstr == NULL ){ HDfree (oldstr); return NULL; } - memcpy ( newstr, oldstr, tok - oldstr ); - memcpy ( newstr + (tok - oldstr), replacement, strlen ( replacement ) ); - memcpy ( newstr + (tok - oldstr) + strlen( replacement ), tok + strlen ( substr ), strlen ( oldstr ) - strlen ( substr ) - ( tok - oldstr ) ); - memset ( newstr + strlen ( oldstr ) - strlen ( substr ) + strlen ( replacement ) , 0, 1 ); + HDmemcpy ( newstr, oldstr, tok - oldstr ); + HDmemcpy ( newstr + (tok - oldstr), replacement, HDstrlen ( replacement ) ); + HDmemcpy ( newstr + (tok - oldstr) + HDstrlen( replacement ), tok + HDstrlen ( substr ), HDstrlen ( oldstr ) - HDstrlen ( substr ) - ( tok - oldstr ) ); + HDmemset ( newstr + HDstrlen ( oldstr ) - HDstrlen ( substr ) + HDstrlen ( replacement ) , 0, 1 ); /* move back head right after the last replacement */ - head = newstr + (tok - oldstr) + strlen( replacement ); + head = newstr + (tok - oldstr) + HDstrlen( replacement ); HDfree (oldstr); } diff --git a/tools/misc/CMakeLists.txt b/tools/misc/CMakeLists.txt index e778d2f..dc98967 100644 --- a/tools/misc/CMakeLists.txt +++ b/tools/misc/CMakeLists.txt @@ -12,16 +12,19 @@ INCLUDE_DIRECTORIES (${HDF5_TOOLS_SRC_DIR}/lib) #-- Misc Executables ADD_EXECUTABLE (h5debug ${HDF5_TOOLS_MISC_SOURCE_DIR}/h5debug.c) TARGET_NAMING (h5debug ${LIB_TYPE}) +TARGET_C_PROPERTIES (h5debug " " " ") TARGET_LINK_LIBRARIES (h5debug ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) SET_TARGET_PROPERTIES (h5debug PROPERTIES FOLDER tools) ADD_EXECUTABLE (h5repart ${HDF5_TOOLS_MISC_SOURCE_DIR}/h5repart.c) TARGET_NAMING (h5repart ${LIB_TYPE}) +TARGET_C_PROPERTIES (h5repart " " " ") TARGET_LINK_LIBRARIES (h5repart ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) SET_TARGET_PROPERTIES (h5repart PROPERTIES FOLDER tools) ADD_EXECUTABLE (h5mkgrp ${HDF5_TOOLS_MISC_SOURCE_DIR}/h5mkgrp.c) TARGET_NAMING (h5mkgrp ${LIB_TYPE}) +TARGET_C_PROPERTIES (h5mkgrp " " " ") TARGET_LINK_LIBRARIES (h5mkgrp ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) SET_TARGET_PROPERTIES (h5mkgrp PROPERTIES FOLDER tools) @@ -51,6 +54,7 @@ IF (BUILD_TESTING) IF (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) ADD_EXECUTABLE (h5repart_gentest ${HDF5_TOOLS_MISC_SOURCE_DIR}/h5repart_gentest.c) TARGET_NAMING (h5repart_gentest ${LIB_TYPE}) + TARGET_C_PROPERTIES (h5repart_gentest " " " ") TARGET_LINK_LIBRARIES (h5repart_gentest ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) SET_TARGET_PROPERTIES (h5repart_gentest PROPERTIES FOLDER generator/tools) #ADD_TEST (NAME h5repart_gentest COMMAND $<TARGET_FILE:h5repart_gentest>) @@ -58,6 +62,7 @@ IF (BUILD_TESTING) ADD_EXECUTABLE (h5repart_test ${HDF5_TOOLS_MISC_SOURCE_DIR}/repart_test.c) TARGET_NAMING (h5repart_test ${LIB_TYPE}) + TARGET_C_PROPERTIES (h5repart_test " " " ") TARGET_LINK_LIBRARIES (h5repart_test ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) SET_TARGET_PROPERTIES (h5repart_test PROPERTIES FOLDER tools) diff --git a/tools/misc/h5cc.in b/tools/misc/h5cc.in index fe11c26..f62c66f 100644 --- a/tools/misc/h5cc.in +++ b/tools/misc/h5cc.in @@ -132,8 +132,9 @@ usage() { 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" - echo " -noshlib Compile with static HDF5 libraries [default]" + echo " -shlib Compile with shared HDF5 libraries [default when built with" + echo " disable-static]" + echo " -noshlib Compile with static HDF5 libraries [default when static available]" echo " " echo " <compile line> - the normal compile line options for your compiler." echo " $prog_name uses the same compiler you used to compile" @@ -350,20 +351,6 @@ if test "x$do_link" = "xyes"; then if test -n "$flag"; then shared_link="${flag}${libdir}" - # Any libraries in LDFLAGS or H5BLD_LDFLAGS also should have rpaths embedded - # in the executables created by h5cc (reduces need for LD_LIBRARY_PATH). - if test -n "$LDFLAGS"; then - for entry in $LDFLAGS; do - extdir=`echo $entry | sed '/^-L/ s/^-L//'` - shared_link="${shared_link} ${flag}${extdir}" - done - fi - if test -n "$H5BLD_LDFLAGS"; then - for entry in $H5BLD_LDFLAGS; do - extdir=`echo $entry | sed '/^-L/ s/^-L//'` - shared_link="${shared_link} ${flag}${extdir}" - done - fi fi if test "x$USE_SHARED_LIB" != "xyes"; then diff --git a/tools/misc/h5perf_gentest.c b/tools/misc/h5perf_gentest.c index 6a080d0..6a080d0 100755..100644 --- a/tools/misc/h5perf_gentest.c +++ b/tools/misc/h5perf_gentest.c diff --git a/tools/misc/h5redeploy.in b/tools/misc/h5redeploy.in index ae79b70..6b6ef87 100644 --- a/tools/misc/h5redeploy.in +++ b/tools/misc/h5redeploy.in @@ -14,9 +14,10 @@ # access to either file, you may request a copy from help@hdfgroup.org. # -## Update HDF5 compiler tools after the HDF5 software has been installed -## in a new location. -## For help page, use "h5redeploy -help" +## Update HDF5 compiler tools after the HDF5 software has been installed ## +## in a new location. ## +## For help page, use "h5redeploy -help" ## +## ## # Constants definitions EXIT_SUCCESS=0 @@ -29,14 +30,20 @@ usage() { # A wonderfully informative "usage" message. echo "usage: $prog_name [OPTIONS]" echo " OPTIONS:" - echo " -help|help This help message" - echo " -echo Show all the shell commands executed" - echo " -force No prompt, just do it" - echo " -prefix=DIR New directory to find HDF5 lib/ and include/" - echo " subdirectories [default: current directory]" - echo " -tool=TOOL Tool to update. TOOL must be in the current" - echo " directory and writable. [default: $h5tools]" - echo " -show Show the commands without executing them" + echo " -help|help This help message" + echo " -echo Show all the shell commands executed" + echo " -force No prompt, just do it" + echo " -prefix=DIR New directory to find HDF5 lib/ and include/" + echo " subdirectories [default: current directory]" + echo " -exec-prefix=DIR New directory to find HDF5 lib/" + echo " subdirectory [default: <prefix>]" + echo " -libdir=DIR New directory for the HDF5 lib directory" + echo " [default: <exec-prefix>/lib]" + echo " -includedir=DIR New directory for the HDF5 header files" + echo " [default: <prefix>/include]" + echo " -tool=TOOL Tool to update. TOOL must be in the current" + echo " directory and writable. [default: $h5tools]" + echo " -show Show the commands without executing them" echo " " exit $EXIT_FAILURE } @@ -70,17 +77,38 @@ ERROR() # Main # +############################################################################ +## Installation directories: ## +## prefix architecture-independent files. ## +## exec_prefix architecture-dependent files, default is <prefix>. ## +## libdir libraries, default is <exec_prefix>/lib. ## +## includedir header files, default is <prefix/include>. ## +## Not used here: ## +## bindir executables, <exec_prefix/bin>. ## +############################################################################ # Initialization h5tools="h5cc h5pcc h5fc h5pfc h5c++" # possible hdf5 tools foundtools= # tools found and will be modified fmode= # force mode, default is off -prefix=`(cd ..;pwd)` +prefix= +exec_prefix= +libdir= +includedir= # Parse options for arg in $@ ; do case "$arg" in -prefix=*) - prefix="`expr "$arg" : '-prefix=\(.*\)'`" + prefix="`echo $arg | cut -f2 -d=`" + ;; + -exec-prefix=*) + exec_prefix="`echo $arg | cut -f2 -d=`" + ;; + -libdir=*) + libdir="`echo $arg | cut -f2 -d=`" + ;; + -includedir=*) + includedir="`echo $arg | cut -f2 -d=`" ;; -echo) set -x @@ -89,7 +117,7 @@ for arg in $@ ; do SHOW="echo" ;; -tool=*) - h5tools="`expr "$arg" : '-tool=\(.*\)'`" + h5tools="`echo $arg | cut -f2 -d=`" ;; -help|help) usage @@ -105,10 +133,18 @@ for arg in $@ ; do esac done -# Sanity checks -if [ ! -d $prefix ]; then - ERROR "prefix($prefix) is not an existing directory" - exit $EXIT_FAILURE +# Set to default value, one above where i am, if not given by user +if [ -z "$prefix" ]; then + prefix=`(cd ..;pwd)` +fi +if [ -z "$exec_prefix" ]; then + exec_prefix='${prefix}' # use single quotes to prevent expansion of $ +fi +if [ -z "$libdir" ]; then + libdir='${exec_prefix}'/lib # use single quotes to prevent expansion of $ +fi +if [ -z "$includedir" ]; then + includedir='${prefix}'/include # use single quotes to prevent expansion of $ fi for x in $h5tools; do @@ -144,10 +180,19 @@ fi CMDFILE=/tmp/h5redeploy.$$ touch $CMDFILE chmod 0600 $CMDFILE -echo "/^prefix/c" >> $CMDFILE -echo prefix=\""$prefix"\" >> $CMDFILE -echo . >> $CMDFILE -(echo w; echo q) >> $CMDFILE +echo "/^prefix=/c" >> $CMDFILE +echo prefix=\""$prefix"\" >> $CMDFILE +echo . >> $CMDFILE +echo "/^exec_prefix=/c" >> $CMDFILE +echo exec_prefix=\""$exec_prefix"\" >> $CMDFILE +echo . >> $CMDFILE +echo "/^libdir=/c" >> $CMDFILE +echo libdir=\""$libdir"\" >> $CMDFILE +echo . >> $CMDFILE +echo "/^includedir=/c" >> $CMDFILE +echo includedir=\""$includedir"\" >> $CMDFILE +echo . >> $CMDFILE +(echo w; echo q) >> $CMDFILE # Update them @@ -171,10 +216,3 @@ done # Cleanup rm -f $CMDFILE exit $EXIT_SUCCESS - -# Some possible future features to add -# CCBASE - Name of the alternative C compiler -# CLINKERBASE - Name of the alternative linker -# LDFLAGS - Path to different libraries your application will link with -# (this path should include the path to the zlib library) -# LIBS - Libraries your application will link with diff --git a/tools/testfiles/h5dump-help.txt b/tools/testfiles/h5dump-help.txt index 40510a4..b735b18 100644 --- a/tools/testfiles/h5dump-help.txt +++ b/tools/testfiles/h5dump-help.txt @@ -6,6 +6,7 @@ usage: h5dump [OPTIONS] files -B, --superblock Print the content of the super block -H, --header Print the header only; no data is displayed -A, --onlyattr Print the header and value of attributes + Optional value 0 suppresses printing attributes. -i, --object-ids Print the object ids -r, --string Print 1-byte integer datasets as ASCII -e, --escape Escape non printing characters diff --git a/tools/testfiles/tall-2A.h5.xml b/tools/testfiles/tall-2A.h5.xml index d118a69..c7d2fcf 100644 --- a/tools/testfiles/tall-2A.h5.xml +++ b/tools/testfiles/tall-2A.h5.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd"> +<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd"> <hdf5:RootGroup OBJ-XID="xid_96" H5Path="/"> <hdf5:Attribute Name="attr1"> <hdf5:Dataspace> diff --git a/tools/testfiles/tall-2A0.ddl b/tools/testfiles/tall-2A0.ddl new file mode 100644 index 0000000..e0955f3 --- /dev/null +++ b/tools/testfiles/tall-2A0.ddl @@ -0,0 +1,64 @@ +HDF5 "tall.h5" { +GROUP "/" { + GROUP "g1" { + GROUP "g1.1" { + DATASET "dset1.1.1" { + DATATYPE H5T_STD_I32BE + DATASPACE SIMPLE { ( 10, 10 ) / ( 10, 10 ) } + DATA { + (0,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (1,0): 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, + (2,0): 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, + (3,0): 0, 3, 6, 9, 12, 15, 18, 21, 24, 27, + (4,0): 0, 4, 8, 12, 16, 20, 24, 28, 32, 36, + (5,0): 0, 5, 10, 15, 20, 25, 30, 35, 40, 45, + (6,0): 0, 6, 12, 18, 24, 30, 36, 42, 48, 54, + (7,0): 0, 7, 14, 21, 28, 35, 42, 49, 56, 63, + (8,0): 0, 8, 16, 24, 32, 40, 48, 56, 64, 72, + (9,0): 0, 9, 18, 27, 36, 45, 54, 63, 72, 81 + } + } + DATASET "dset1.1.2" { + DATATYPE H5T_STD_I32BE + DATASPACE SIMPLE { ( 20 ) / ( 20 ) } + DATA { + (0): 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, + (17): 17, 18, 19 + } + } + } + GROUP "g1.2" { + EXTERNAL_LINK "extlink" { + TARGETFILE "somefile" + TARGETPATH "somepath" + } + GROUP "g1.2.1" { + SOFTLINK "slink" { + LINKTARGET "somevalue" + } + } + } + } + GROUP "g2" { + DATASET "dset2.1" { + DATATYPE H5T_IEEE_F32BE + DATASPACE SIMPLE { ( 10 ) / ( 10 ) } + DATA { + (0): 1, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9 + } + } + DATASET "dset2.2" { + DATATYPE H5T_IEEE_F32BE + DATASPACE SIMPLE { ( 3, 5 ) / ( 3, 5 ) } + DATA { + (0,0): 0, 0.1, 0.2, 0.3, 0.4, + (1,0): 0, 0.2, 0.4, 0.6, 0.8, + (2,0): 0, 0.3, 0.6, 0.9, 1.2 + } + } + USERDEFINED_LINK "udlink" { + LINKCLASS 187 + } + } +} +} diff --git a/tools/testfiles/tall.h5.xml b/tools/testfiles/tall.h5.xml index a74ccbe..ba130f1 100644 --- a/tools/testfiles/tall.h5.xml +++ b/tools/testfiles/tall.h5.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd"> +<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd"> <hdf5:RootGroup OBJ-XID="xid_96" H5Path="/"> <hdf5:Attribute Name="attr1"> <hdf5:Dataspace> diff --git a/tools/testfiles/tarray1.h5.xml b/tools/testfiles/tarray1.h5.xml index 86db36f..26d2d9b 100644 --- a/tools/testfiles/tarray1.h5.xml +++ b/tools/testfiles/tarray1.h5.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd"> +<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd"> <hdf5:RootGroup OBJ-XID="xid_928" H5Path="/"> <hdf5:Dataset Name="Dataset1" OBJ-XID="xid_976" H5Path= "/Dataset1" Parents="xid_928" H5ParentPaths="/"> <hdf5:StorageLayout> diff --git a/tools/testfiles/tarray2.h5.xml b/tools/testfiles/tarray2.h5.xml index 7f89b9b..8f4f312 100644 --- a/tools/testfiles/tarray2.h5.xml +++ b/tools/testfiles/tarray2.h5.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd"> +<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd"> <hdf5:RootGroup OBJ-XID="xid_928" H5Path="/"> <hdf5:Dataset Name="Dataset1" OBJ-XID="xid_976" H5Path= "/Dataset1" Parents="xid_928" H5ParentPaths="/"> <hdf5:StorageLayout> diff --git a/tools/testfiles/tarray3.h5.xml b/tools/testfiles/tarray3.h5.xml index 0b74db8..3879994 100644 --- a/tools/testfiles/tarray3.h5.xml +++ b/tools/testfiles/tarray3.h5.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd"> +<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd"> <hdf5:RootGroup OBJ-XID="xid_928" H5Path="/"> <hdf5:Dataset Name="Dataset1" OBJ-XID="xid_976" H5Path= "/Dataset1" Parents="xid_928" H5ParentPaths="/"> <hdf5:StorageLayout> diff --git a/tools/testfiles/tarray6.h5.xml b/tools/testfiles/tarray6.h5.xml index 628a342..0fb50ed 100644 --- a/tools/testfiles/tarray6.h5.xml +++ b/tools/testfiles/tarray6.h5.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd"> +<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd"> <hdf5:RootGroup OBJ-XID="xid_928" H5Path="/"> <hdf5:Dataset Name="Dataset1" OBJ-XID="xid_976" H5Path= "/Dataset1" Parents="xid_928" H5ParentPaths="/"> <hdf5:StorageLayout> diff --git a/tools/testfiles/tarray7.h5.xml b/tools/testfiles/tarray7.h5.xml index dbf5ec5..e6a5bca 100644 --- a/tools/testfiles/tarray7.h5.xml +++ b/tools/testfiles/tarray7.h5.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd"> +<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd"> <hdf5:RootGroup OBJ-XID="xid_928" H5Path="/"> <hdf5:Dataset Name="Dataset1" OBJ-XID="xid_976" H5Path= "/Dataset1" Parents="xid_928" H5ParentPaths="/"> <hdf5:StorageLayout> diff --git a/tools/testfiles/tattr.h5.xml b/tools/testfiles/tattr.h5.xml index fceea99..ce54360 100644 --- a/tools/testfiles/tattr.h5.xml +++ b/tools/testfiles/tattr.h5.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd"> +<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd"> <hdf5:RootGroup OBJ-XID="xid_928" H5Path="/"> <hdf5:Attribute Name="/attr1"> <hdf5:Dataspace> diff --git a/tools/testfiles/tbitfields.h5.xml b/tools/testfiles/tbitfields.h5.xml index 73365f0..c8ba026 100644 --- a/tools/testfiles/tbitfields.h5.xml +++ b/tools/testfiles/tbitfields.h5.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd"> +<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd"> <hdf5:RootGroup OBJ-XID="xid_696" H5Path="/"> <hdf5:Group Name="typetests" OBJ-XID="xid_1344" H5Path="/typetests" Parents="xid_696" H5ParentPaths="/" > <hdf5:Dataset Name="bitfield_1" OBJ-XID="xid_1720" H5Path= "/typetests/bitfield_1" Parents="xid_1344" H5ParentPaths="/typetests"> diff --git a/tools/testfiles/tcompound.h5.xml b/tools/testfiles/tcompound.h5.xml index 10ef36e..5c74493 100644 --- a/tools/testfiles/tcompound.h5.xml +++ b/tools/testfiles/tcompound.h5.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd"> +<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd"> <hdf5:RootGroup OBJ-XID="xid_696" H5Path="/"> <hdf5:NamedDataType Name="#6632" OBJ-XID="xid_18446744073709551614" Parents="xid_696" H5ParentPaths="/"> <hdf5:DataType> diff --git a/tools/testfiles/tcompound2.h5.xml b/tools/testfiles/tcompound2.h5.xml index ac139d9..5c69cef 100644 --- a/tools/testfiles/tcompound2.h5.xml +++ b/tools/testfiles/tcompound2.h5.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd"> +<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd"> <hdf5:RootGroup OBJ-XID="xid_696" H5Path="/"> <hdf5:NamedDataType Name="#9560" OBJ-XID="xid_18446744073709551614" Parents="xid_696" H5ParentPaths="/"> <hdf5:DataType> diff --git a/tools/testfiles/tcompound_complex.h5.xml b/tools/testfiles/tcompound_complex.h5.xml index b35193a..92bd64d 100644 --- a/tools/testfiles/tcompound_complex.h5.xml +++ b/tools/testfiles/tcompound_complex.h5.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd"> +<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd"> <hdf5:RootGroup OBJ-XID="xid_928" H5Path="/"> <hdf5:Dataset Name="CompoundComplex" OBJ-XID="xid_976" H5Path= "/CompoundComplex" Parents="xid_928" H5ParentPaths="/"> <hdf5:StorageLayout> diff --git a/tools/testfiles/tdatareg.h5.xml b/tools/testfiles/tdatareg.h5.xml index 327e213..ea65384 100644 --- a/tools/testfiles/tdatareg.h5.xml +++ b/tools/testfiles/tdatareg.h5.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd"> +<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd"> <hdf5:RootGroup OBJ-XID="xid_696" H5Path="/"> <hdf5:Dataset Name="Dataset1" OBJ-XID="xid_1284" H5Path= "/Dataset1" Parents="xid_696" H5ParentPaths="/"> <hdf5:StorageLayout> diff --git a/tools/testfiles/tdset.h5.xml b/tools/testfiles/tdset.h5.xml index e914bf6..80dcf6f 100644 --- a/tools/testfiles/tdset.h5.xml +++ b/tools/testfiles/tdset.h5.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd"> +<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd"> <hdf5:RootGroup OBJ-XID="xid_928" H5Path="/"> <hdf5:Dataset Name="dset1" OBJ-XID="xid_976" H5Path= "/dset1" Parents="xid_928" H5ParentPaths="/"> <hdf5:StorageLayout> diff --git a/tools/testfiles/tdset2.h5.xml b/tools/testfiles/tdset2.h5.xml index 34f43e1..7f78685 100644 --- a/tools/testfiles/tdset2.h5.xml +++ b/tools/testfiles/tdset2.h5.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd"> +<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd"> <hdf5:RootGroup OBJ-XID="xid_696" H5Path="/"> <hdf5:Dataset Name="dset1" OBJ-XID="xid_744" H5Path= "/dset1" Parents="xid_696" H5ParentPaths="/"> <hdf5:StorageLayout> diff --git a/tools/testfiles/tempty-dtd-2.h5.xml b/tools/testfiles/tempty-dtd-2.h5.xml index a9b1d4f..213d582 100644 --- a/tools/testfiles/tempty-dtd-2.h5.xml +++ b/tools/testfiles/tempty-dtd-2.h5.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE HDF5-File PUBLIC "HDF5-File.dtd" "http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.dtd"> +<!DOCTYPE HDF5-File PUBLIC "HDF5-File.dtd" "http://www.hdfgroup.org/HDF5/XML/DTD/HDF5-File.dtd"> <HDF5-File> <RootGroup OBJ-XID="xid_928" H5Path="/"> <Dataset Name="Dataset1.0" OBJ-XID="xid_976" H5Path= "/Dataset1.0" Parents="xid_928" H5ParentPaths="/"> diff --git a/tools/testfiles/tempty-dtd.h5.xml b/tools/testfiles/tempty-dtd.h5.xml index a9b1d4f..213d582 100644 --- a/tools/testfiles/tempty-dtd.h5.xml +++ b/tools/testfiles/tempty-dtd.h5.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE HDF5-File PUBLIC "HDF5-File.dtd" "http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.dtd"> +<!DOCTYPE HDF5-File PUBLIC "HDF5-File.dtd" "http://www.hdfgroup.org/HDF5/XML/DTD/HDF5-File.dtd"> <HDF5-File> <RootGroup OBJ-XID="xid_928" H5Path="/"> <Dataset Name="Dataset1.0" OBJ-XID="xid_976" H5Path= "/Dataset1.0" Parents="xid_928" H5ParentPaths="/"> diff --git a/tools/testfiles/tempty-ns-2.h5.xml b/tools/testfiles/tempty-ns-2.h5.xml index 3476b60..00040d2 100644 --- a/tools/testfiles/tempty-ns-2.h5.xml +++ b/tools/testfiles/tempty-ns-2.h5.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<thing:HDF5-File xmlns:thing="http://hdfgroup.org/HDF5/XML/schema/HDF5-File" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd"> +<thing:HDF5-File xmlns:thing="http://hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd"> <thing:RootGroup OBJ-XID="xid_928" H5Path="/"> <thing:Dataset Name="Dataset1.0" OBJ-XID="xid_976" H5Path= "/Dataset1.0" Parents="xid_928" H5ParentPaths="/"> <thing:StorageLayout> diff --git a/tools/testfiles/tempty-ns.h5.xml b/tools/testfiles/tempty-ns.h5.xml index 3476b60..00040d2 100644 --- a/tools/testfiles/tempty-ns.h5.xml +++ b/tools/testfiles/tempty-ns.h5.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<thing:HDF5-File xmlns:thing="http://hdfgroup.org/HDF5/XML/schema/HDF5-File" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd"> +<thing:HDF5-File xmlns:thing="http://hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd"> <thing:RootGroup OBJ-XID="xid_928" H5Path="/"> <thing:Dataset Name="Dataset1.0" OBJ-XID="xid_976" H5Path= "/Dataset1.0" Parents="xid_928" H5ParentPaths="/"> <thing:StorageLayout> diff --git a/tools/testfiles/tempty.h5.xml b/tools/testfiles/tempty.h5.xml index d75bc70..41eef37 100644 --- a/tools/testfiles/tempty.h5.xml +++ b/tools/testfiles/tempty.h5.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd"> +<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd"> <hdf5:RootGroup OBJ-XID="xid_928" H5Path="/"> <hdf5:Dataset Name="Dataset1.0" OBJ-XID="xid_976" H5Path= "/Dataset1.0" Parents="xid_928" H5ParentPaths="/"> <hdf5:StorageLayout> diff --git a/tools/testfiles/tenum.h5.xml b/tools/testfiles/tenum.h5.xml index ecc7804..33a6e62 100644 --- a/tools/testfiles/tenum.h5.xml +++ b/tools/testfiles/tenum.h5.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd"> +<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd"> <hdf5:RootGroup OBJ-XID="xid_928" H5Path="/"> <hdf5:NamedDataType Name="enum normal" OBJ-XID="xid_976" H5Path="/enum normal" Parents="xid_928" H5ParentPaths="/"> <hdf5:DataType> diff --git a/tools/testfiles/textlink.h5.xml b/tools/testfiles/textlink.h5.xml index f6c7ff6..9097f79 100644 --- a/tools/testfiles/textlink.h5.xml +++ b/tools/testfiles/textlink.h5.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd"> +<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd"> <hdf5:RootGroup OBJ-XID="xid_96" H5Path="/"> <hdf5:ExternalLink LinkName="extlink1" OBJ-XID="xid_18446744073709551614" H5SourcePath="/extlink1" TargetFilename="filename" TargetPath="objname" Parents="xid_96" H5ParentPaths="/" /> <hdf5:ExternalLink LinkName="extlink2" OBJ-XID="xid_18446744073709551613" H5SourcePath="/extlink2" TargetFilename="anotherfile" TargetPath="anotherobj" Parents="xid_96" H5ParentPaths="/" /> diff --git a/tools/testfiles/tfpformat.h5.xml b/tools/testfiles/tfpformat.h5.xml index c2bd96f..6445979 100644 --- a/tools/testfiles/tfpformat.h5.xml +++ b/tools/testfiles/tfpformat.h5.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE HDF5-File PUBLIC "HDF5-File.dtd" "http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.dtd"> +<!DOCTYPE HDF5-File PUBLIC "HDF5-File.dtd" "http://www.hdfgroup.org/HDF5/XML/DTD/HDF5-File.dtd"> <HDF5-File> <RootGroup OBJ-XID="xid_96" H5Path="/"> <Dataset Name="double" OBJ-XID="xid_800" H5Path= "/double" Parents="xid_96" H5ParentPaths="/"> diff --git a/tools/testfiles/tgroup.h5.xml b/tools/testfiles/tgroup.h5.xml index 8065165..1eaf662 100644 --- a/tools/testfiles/tgroup.h5.xml +++ b/tools/testfiles/tgroup.h5.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd"> +<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd"> <hdf5:RootGroup OBJ-XID="xid_696" H5Path="/"> <hdf5:Group Name="g1" OBJ-XID="xid_1344" H5Path="/g1" Parents="xid_696" H5ParentPaths="/" > <hdf5:Group Name="g1.1" OBJ-XID="xid_3616" H5Path="/g1/g1.1" Parents="xid_1344" H5ParentPaths="/g1" > diff --git a/tools/testfiles/thlink.h5.xml b/tools/testfiles/thlink.h5.xml index 65d7f8a..d0fa36e 100644 --- a/tools/testfiles/thlink.h5.xml +++ b/tools/testfiles/thlink.h5.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd"> +<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd"> <hdf5:RootGroup OBJ-XID="xid_96" H5Path="/"> <hdf5:Dataset Name="dset1" OBJ-XID="xid_808" H5Path= "/dset1" Parents="xid_96" H5ParentPaths="/"> <hdf5:StorageLayout> diff --git a/tools/testfiles/tloop.h5.xml b/tools/testfiles/tloop.h5.xml index 36e8f1b..8cc6880 100644 --- a/tools/testfiles/tloop.h5.xml +++ b/tools/testfiles/tloop.h5.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd"> +<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd"> <hdf5:RootGroup OBJ-XID="xid_696" H5Path="/"> <hdf5:Group Name="g1" OBJ-XID="xid_1344" H5Path="/g1" Parents="xid_696" H5ParentPaths="/" > <hdf5:Group Name="g1.1" OBJ-XID="xid_2320" H5Path="/g1/g1.1" Parents="xid_1344" H5ParentPaths="/g1" > diff --git a/tools/testfiles/tloop2.h5.xml b/tools/testfiles/tloop2.h5.xml index 185e08b..e2df102 100644 --- a/tools/testfiles/tloop2.h5.xml +++ b/tools/testfiles/tloop2.h5.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd"> +<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd"> <hdf5:RootGroup OBJ-XID="xid_696" H5Path="/"> <hdf5:Group Name="g1" OBJ-XID="xid_1344" H5Path="/g1" Parents="xid_696" H5ParentPaths="/" > <hdf5:Group Name="g1.1" OBJ-XID="xid_2320" H5Path="/g1/g1.1" Parents="xid_1344" H5ParentPaths="/g1" > diff --git a/tools/testfiles/tmany.h5.xml b/tools/testfiles/tmany.h5.xml index 8056783..842f1f5 100644 --- a/tools/testfiles/tmany.h5.xml +++ b/tools/testfiles/tmany.h5.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd"> +<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd"> <hdf5:RootGroup OBJ-XID="xid_96" H5Path="/"> <hdf5:Group Name="g1" OBJ-XID="xid_800" H5Path="/g1" Parents="xid_96" H5ParentPaths="/" > <hdf5:Group Name="g1.1" OBJ-XID="xid_1832" H5Path="/g1/g1.1" Parents="xid_800" H5ParentPaths="/g1" > diff --git a/tools/testfiles/tname-amp.h5.xml b/tools/testfiles/tname-amp.h5.xml index f28cdc5..e40c38b 100644 --- a/tools/testfiles/tname-amp.h5.xml +++ b/tools/testfiles/tname-amp.h5.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd"> +<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd"> <hdf5:RootGroup OBJ-XID="xid_696" H5Path="/"> <hdf5:Attribute Name="attr1&withamp"> <hdf5:Dataspace> diff --git a/tools/testfiles/tname-apos.h5.xml b/tools/testfiles/tname-apos.h5.xml index 2194971..2acd0bf 100644 --- a/tools/testfiles/tname-apos.h5.xml +++ b/tools/testfiles/tname-apos.h5.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd"> +<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd"> <hdf5:RootGroup OBJ-XID="xid_696" H5Path="/"> <hdf5:Attribute Name="attr1'withapos"> <hdf5:Dataspace> diff --git a/tools/testfiles/tname-gt.h5.xml b/tools/testfiles/tname-gt.h5.xml index 6a56587..b44949e 100644 --- a/tools/testfiles/tname-gt.h5.xml +++ b/tools/testfiles/tname-gt.h5.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd"> +<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd"> <hdf5:RootGroup OBJ-XID="xid_696" H5Path="/"> <hdf5:Attribute Name="attr1>withgt"> <hdf5:Dataspace> diff --git a/tools/testfiles/tname-lt.h5.xml b/tools/testfiles/tname-lt.h5.xml index a6d2480..b148275 100644 --- a/tools/testfiles/tname-lt.h5.xml +++ b/tools/testfiles/tname-lt.h5.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd"> +<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd"> <hdf5:RootGroup OBJ-XID="xid_696" H5Path="/"> <hdf5:Attribute Name="attr1<withlt"> <hdf5:Dataspace> diff --git a/tools/testfiles/tname-quot.h5.xml b/tools/testfiles/tname-quot.h5.xml index 96ad068..83fd347 100644 --- a/tools/testfiles/tname-quot.h5.xml +++ b/tools/testfiles/tname-quot.h5.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd"> +<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd"> <hdf5:RootGroup OBJ-XID="xid_696" H5Path="/"> <hdf5:Attribute Name="attr1"withquot"> <hdf5:Dataspace> diff --git a/tools/testfiles/tname-sp.h5.xml b/tools/testfiles/tname-sp.h5.xml index d6f8278..07b80e4 100644 --- a/tools/testfiles/tname-sp.h5.xml +++ b/tools/testfiles/tname-sp.h5.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd"> +<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd"> <hdf5:RootGroup OBJ-XID="xid_696" H5Path="/"> <hdf5:Attribute Name="attr1 withspace"> <hdf5:Dataspace> diff --git a/tools/testfiles/tnamed_dtype_attr.h5.xml b/tools/testfiles/tnamed_dtype_attr.h5.xml index 199211c..c0e30b4 100644 --- a/tools/testfiles/tnamed_dtype_attr.h5.xml +++ b/tools/testfiles/tnamed_dtype_attr.h5.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd"> +<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd"> <hdf5:RootGroup OBJ-XID="xid_96" H5Path="/"> <hdf5:Dataset Name="Dataset" OBJ-XID="xid_1256" H5Path= "/Dataset" Parents="xid_96" H5ParentPaths="/"> <hdf5:StorageLayout> diff --git a/tools/testfiles/tnestedcomp.h5.xml b/tools/testfiles/tnestedcomp.h5.xml index 2cae353..a5ca214 100644 --- a/tools/testfiles/tnestedcomp.h5.xml +++ b/tools/testfiles/tnestedcomp.h5.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd"> +<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd"> <hdf5:RootGroup OBJ-XID="xid_696" H5Path="/"> <hdf5:Dataset Name="ArrayOfStructures" OBJ-XID="xid_744" H5Path= "/ArrayOfStructures" Parents="xid_696" H5ParentPaths="/"> <hdf5:StorageLayout> diff --git a/tools/testfiles/tnodata.h5.xml b/tools/testfiles/tnodata.h5.xml index 17b4ac9..b60c4dc 100644 --- a/tools/testfiles/tnodata.h5.xml +++ b/tools/testfiles/tnodata.h5.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd"> +<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd"> <hdf5:RootGroup OBJ-XID="xid_696" H5Path="/"> <hdf5:Dataset Name="dset1" OBJ-XID="xid_744" H5Path= "/dset1" Parents="xid_696" H5ParentPaths="/"> <hdf5:StorageLayout> diff --git a/tools/testfiles/tnofilename-with-packed-bits.ddl b/tools/testfiles/tnofilename-with-packed-bits.ddl index 440e3d9..e8d6d84 100644 --- a/tools/testfiles/tnofilename-with-packed-bits.ddl +++ b/tools/testfiles/tnofilename-with-packed-bits.ddl @@ -6,6 +6,7 @@ usage: h5dump [OPTIONS] files -B, --superblock Print the content of the super block -H, --header Print the header only; no data is displayed -A, --onlyattr Print the header and value of attributes + Optional value 0 suppresses printing attributes. -i, --object-ids Print the object ids -r, --string Print 1-byte integer datasets as ASCII -e, --escape Escape non printing characters diff --git a/tools/testfiles/tobjref.h5.xml b/tools/testfiles/tobjref.h5.xml index 016b298..71eb6ed 100644 --- a/tools/testfiles/tobjref.h5.xml +++ b/tools/testfiles/tobjref.h5.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd"> +<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd"> <hdf5:RootGroup OBJ-XID="xid_696" H5Path="/"> <hdf5:Dataset Name="Dataset3" OBJ-XID="xid_2348" H5Path= "/Dataset3" Parents="xid_696" H5ParentPaths="/"> <hdf5:StorageLayout> diff --git a/tools/testfiles/topaque.h5.xml b/tools/testfiles/topaque.h5.xml index 314fd23..25dbcdb 100644 --- a/tools/testfiles/topaque.h5.xml +++ b/tools/testfiles/topaque.h5.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd"> +<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd"> <hdf5:RootGroup OBJ-XID="xid_696" H5Path="/"> <hdf5:Dataset Name="opaque test" OBJ-XID="xid_744" H5Path= "/opaque test" Parents="xid_696" H5ParentPaths="/"> <hdf5:StorageLayout> diff --git a/tools/testfiles/torderattr1.h5.xml b/tools/testfiles/torderattr1.h5.xml index 027cd64..e3e56eb 100644 --- a/tools/testfiles/torderattr1.h5.xml +++ b/tools/testfiles/torderattr1.h5.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd"> +<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd"> <hdf5:RootGroup OBJ-XID="xid_96" H5Path="/"> <hdf5:Attribute Name="a"> <hdf5:Dataspace> diff --git a/tools/testfiles/torderattr2.h5.xml b/tools/testfiles/torderattr2.h5.xml index fe441da..1163afb 100644 --- a/tools/testfiles/torderattr2.h5.xml +++ b/tools/testfiles/torderattr2.h5.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd"> +<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd"> <hdf5:RootGroup OBJ-XID="xid_96" H5Path="/"> <hdf5:Attribute Name="c"> <hdf5:Dataspace> diff --git a/tools/testfiles/torderattr3.h5.xml b/tools/testfiles/torderattr3.h5.xml index 38bbef7..73ef223 100644 --- a/tools/testfiles/torderattr3.h5.xml +++ b/tools/testfiles/torderattr3.h5.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd"> +<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd"> <hdf5:RootGroup OBJ-XID="xid_96" H5Path="/"> <hdf5:Attribute Name="a"> <hdf5:Dataspace> diff --git a/tools/testfiles/torderattr4.h5.xml b/tools/testfiles/torderattr4.h5.xml index 0f90b22..1cc78fd 100644 --- a/tools/testfiles/torderattr4.h5.xml +++ b/tools/testfiles/torderattr4.h5.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd"> +<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd"> <hdf5:RootGroup OBJ-XID="xid_96" H5Path="/"> <hdf5:Attribute Name="c"> <hdf5:Dataspace> diff --git a/tools/testfiles/tpbitsIncomplete.ddl b/tools/testfiles/tpbitsIncomplete.ddl index 758b6b4..06c5613 100644 --- a/tools/testfiles/tpbitsIncomplete.ddl +++ b/tools/testfiles/tpbitsIncomplete.ddl @@ -6,6 +6,7 @@ usage: h5dump [OPTIONS] files -B, --superblock Print the content of the super block -H, --header Print the header only; no data is displayed -A, --onlyattr Print the header and value of attributes + Optional value 0 suppresses printing attributes. -i, --object-ids Print the object ids -r, --string Print 1-byte integer datasets as ASCII -e, --escape Escape non printing characters diff --git a/tools/testfiles/tpbitsLengthExceeded.ddl b/tools/testfiles/tpbitsLengthExceeded.ddl index a85ba49..ffd9910 100644 --- a/tools/testfiles/tpbitsLengthExceeded.ddl +++ b/tools/testfiles/tpbitsLengthExceeded.ddl @@ -6,6 +6,7 @@ usage: h5dump [OPTIONS] files -B, --superblock Print the content of the super block -H, --header Print the header only; no data is displayed -A, --onlyattr Print the header and value of attributes + Optional value 0 suppresses printing attributes. -i, --object-ids Print the object ids -r, --string Print 1-byte integer datasets as ASCII -e, --escape Escape non printing characters diff --git a/tools/testfiles/tpbitsLengthPositive.ddl b/tools/testfiles/tpbitsLengthPositive.ddl index d5a1c88..a54812b 100644 --- a/tools/testfiles/tpbitsLengthPositive.ddl +++ b/tools/testfiles/tpbitsLengthPositive.ddl @@ -6,6 +6,7 @@ usage: h5dump [OPTIONS] files -B, --superblock Print the content of the super block -H, --header Print the header only; no data is displayed -A, --onlyattr Print the header and value of attributes + Optional value 0 suppresses printing attributes. -i, --object-ids Print the object ids -r, --string Print 1-byte integer datasets as ASCII -e, --escape Escape non printing characters diff --git a/tools/testfiles/tpbitsMaxExceeded.ddl b/tools/testfiles/tpbitsMaxExceeded.ddl index e24245c..1a8dd11 100644 --- a/tools/testfiles/tpbitsMaxExceeded.ddl +++ b/tools/testfiles/tpbitsMaxExceeded.ddl @@ -6,6 +6,7 @@ usage: h5dump [OPTIONS] files -B, --superblock Print the content of the super block -H, --header Print the header only; no data is displayed -A, --onlyattr Print the header and value of attributes + Optional value 0 suppresses printing attributes. -i, --object-ids Print the object ids -r, --string Print 1-byte integer datasets as ASCII -e, --escape Escape non printing characters diff --git a/tools/testfiles/tpbitsOffsetExceeded.ddl b/tools/testfiles/tpbitsOffsetExceeded.ddl index 8f58c47..7527131 100644 --- a/tools/testfiles/tpbitsOffsetExceeded.ddl +++ b/tools/testfiles/tpbitsOffsetExceeded.ddl @@ -6,6 +6,7 @@ usage: h5dump [OPTIONS] files -B, --superblock Print the content of the super block -H, --header Print the header only; no data is displayed -A, --onlyattr Print the header and value of attributes + Optional value 0 suppresses printing attributes. -i, --object-ids Print the object ids -r, --string Print 1-byte integer datasets as ASCII -e, --escape Escape non printing characters diff --git a/tools/testfiles/tpbitsOffsetNegative.ddl b/tools/testfiles/tpbitsOffsetNegative.ddl index 6df8cce..21b573d 100644 --- a/tools/testfiles/tpbitsOffsetNegative.ddl +++ b/tools/testfiles/tpbitsOffsetNegative.ddl @@ -6,6 +6,7 @@ usage: h5dump [OPTIONS] files -B, --superblock Print the content of the super block -H, --header Print the header only; no data is displayed -A, --onlyattr Print the header and value of attributes + Optional value 0 suppresses printing attributes. -i, --object-ids Print the object ids -r, --string Print 1-byte integer datasets as ASCII -e, --escape Escape non printing characters diff --git a/tools/testfiles/trawssetfile.ddl b/tools/testfiles/trawssetfile.ddl new file mode 100644 index 0000000..e8f07f8 --- /dev/null +++ b/tools/testfiles/trawssetfile.ddl @@ -0,0 +1,14 @@ +HDF5 "tdset.h5" { +DATASET "/dset1" { + DATATYPE H5T_STD_I32BE + DATASPACE SIMPLE { ( 10, 20 ) / ( 10, 20 ) } + SUBSET { + START ( 1, 1 ); + STRIDE ( 1, 1 ); + COUNT ( 1, 1 ); + BLOCK ( 1, 1 ); + DATA { + } + } +} +} diff --git a/tools/testfiles/trawssetfile.exp b/tools/testfiles/trawssetfile.exp new file mode 100644 index 0000000..2de8392 --- /dev/null +++ b/tools/testfiles/trawssetfile.exp @@ -0,0 +1,2 @@ + + 2
\ No newline at end of file diff --git a/tools/testfiles/tref-escapes-at.h5.xml b/tools/testfiles/tref-escapes-at.h5.xml index 8126484..40c6b89 100644 --- a/tools/testfiles/tref-escapes-at.h5.xml +++ b/tools/testfiles/tref-escapes-at.h5.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd"> +<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd"> <hdf5:RootGroup OBJ-XID="xid_696" H5Path="/"> <hdf5:Group Name="Group1" OBJ-XID="xid_1344" H5Path="/Group1" Parents="xid_696" H5ParentPaths="/" > <hdf5:Dataset Name="Dataset space" OBJ-XID="xid_3716" H5Path= "/Group1/Dataset space" Parents="xid_1344" H5ParentPaths="/Group1"> diff --git a/tools/testfiles/tref-escapes.h5.xml b/tools/testfiles/tref-escapes.h5.xml index 6c6455b..4ebac85 100644 --- a/tools/testfiles/tref-escapes.h5.xml +++ b/tools/testfiles/tref-escapes.h5.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd"> +<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd"> <hdf5:RootGroup OBJ-XID="xid_696" H5Path="/"> <hdf5:Group Name="Group1" OBJ-XID="xid_1344" H5Path="/Group1" Parents="xid_696" H5ParentPaths="/" > <hdf5:Dataset Name="Dataset space" OBJ-XID="xid_1720" H5Path= "/Group1/Dataset space" Parents="xid_1344" H5ParentPaths="/Group1"> diff --git a/tools/testfiles/tref.h5.xml b/tools/testfiles/tref.h5.xml index 7ff360e..4c3fb8f 100644 --- a/tools/testfiles/tref.h5.xml +++ b/tools/testfiles/tref.h5.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd"> +<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd"> <hdf5:RootGroup OBJ-XID="xid_696" H5Path="/"> <hdf5:Group Name="Group1" OBJ-XID="xid_1344" H5Path="/Group1" Parents="xid_696" H5ParentPaths="/" > <hdf5:Dataset Name="Dataset1" OBJ-XID="xid_1720" H5Path= "/Group1/Dataset1" Parents="xid_1344" H5ParentPaths="/Group1"> diff --git a/tools/testfiles/tsaf.h5.xml b/tools/testfiles/tsaf.h5.xml index 8da41b9..d646791 100644 --- a/tools/testfiles/tsaf.h5.xml +++ b/tools/testfiles/tsaf.h5.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd"> +<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd"> <hdf5:RootGroup OBJ-XID="xid_696" H5Path="/"> <hdf5:Dataset Name=".DSL_METADATA" OBJ-XID="xid_744" H5Path= "/.DSL_METADATA" Parents="xid_696" H5ParentPaths="/"> <hdf5:StorageLayout> diff --git a/tools/testfiles/tslink.h5.xml b/tools/testfiles/tslink.h5.xml index 9d8040e..493decd 100644 --- a/tools/testfiles/tslink.h5.xml +++ b/tools/testfiles/tslink.h5.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd"> +<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd"> <hdf5:RootGroup OBJ-XID="xid_696" H5Path="/"> <hdf5:SoftLink LinkName="slink1" OBJ-XID="xid_18446744073709551614" H5SourcePath="/slink1" TargetPath="somevalue" Parents="xid_696" H5ParentPaths="/" /> <hdf5:SoftLink LinkName="slink2" OBJ-XID="xid_18446744073709551613" H5SourcePath="/slink2" TargetPath="linkvalue" Parents="xid_696" H5ParentPaths="/" /> diff --git a/tools/testfiles/tstr.h5.xml b/tools/testfiles/tstr.h5.xml index d7214fd..32d63af 100644 --- a/tools/testfiles/tstr.h5.xml +++ b/tools/testfiles/tstr.h5.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd"> +<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd"> <hdf5:RootGroup OBJ-XID="xid_696" H5Path="/"> <hdf5:Dataset Name="comp1" OBJ-XID="xid_2520" H5Path= "/comp1" Parents="xid_696" H5ParentPaths="/"> <hdf5:StorageLayout> diff --git a/tools/testfiles/tstr2.h5.xml b/tools/testfiles/tstr2.h5.xml index 26758b3..1203417 100644 --- a/tools/testfiles/tstr2.h5.xml +++ b/tools/testfiles/tstr2.h5.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd"> +<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd"> <hdf5:RootGroup OBJ-XID="xid_696" H5Path="/"> <hdf5:Group Name="g1" OBJ-XID="xid_1344" H5Path="/g1" Parents="xid_696" H5ParentPaths="/" > <hdf5:Dataset Name="dset1" OBJ-XID="xid_1720" H5Path= "/g1/dset1" Parents="xid_1344" H5ParentPaths="/g1"> diff --git a/tools/testfiles/tstring-at.h5.xml b/tools/testfiles/tstring-at.h5.xml index 1962610..a8281f4 100644 --- a/tools/testfiles/tstring-at.h5.xml +++ b/tools/testfiles/tstring-at.h5.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd"> +<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd"> <hdf5:RootGroup OBJ-XID="xid_696" H5Path="/"> <hdf5:Dataset Name="dset1" OBJ-XID="xid_744" H5Path= "/dset1" Parents="xid_696" H5ParentPaths="/"> <hdf5:StorageLayout> diff --git a/tools/testfiles/tstring.h5.xml b/tools/testfiles/tstring.h5.xml index ebd0a3c..d68db77 100644 --- a/tools/testfiles/tstring.h5.xml +++ b/tools/testfiles/tstring.h5.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd"> +<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd"> <hdf5:RootGroup OBJ-XID="xid_928" H5Path="/"> <hdf5:Dataset Name="dset1" OBJ-XID="xid_976" H5Path= "/dset1" Parents="xid_928" H5ParentPaths="/"> <hdf5:StorageLayout> diff --git a/tools/testfiles/tudlink.h5.xml b/tools/testfiles/tudlink.h5.xml index 7e57dd8..137c47b 100644 --- a/tools/testfiles/tudlink.h5.xml +++ b/tools/testfiles/tudlink.h5.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd"> +<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd"> <hdf5:RootGroup OBJ-XID="xid_96" H5Path="/"> <hdf5:UserDefined LinkName="udlink1" OBJ-XID="xid_18446744073709551614" H5SourcePath="/udlink1" LinkClass="187" Parents="xid_96" H5ParentPaths="/" /> <hdf5:UserDefined LinkName="udlink2" OBJ-XID="xid_18446744073709551613" H5SourcePath="/udlink2" LinkClass="187" Parents="xid_96" H5ParentPaths="/" /> diff --git a/tools/testfiles/tvldtypes1.h5.xml b/tools/testfiles/tvldtypes1.h5.xml index 9c519f0..b1aa5a6 100644 --- a/tools/testfiles/tvldtypes1.h5.xml +++ b/tools/testfiles/tvldtypes1.h5.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd"> +<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd"> <hdf5:RootGroup OBJ-XID="xid_928" H5Path="/"> <hdf5:Dataset Name="Dataset1.0" OBJ-XID="xid_976" H5Path= "/Dataset1.0" Parents="xid_928" H5ParentPaths="/"> <hdf5:StorageLayout> diff --git a/tools/testfiles/tvldtypes2.h5.xml b/tools/testfiles/tvldtypes2.h5.xml index 9cabfdf..662ad3a 100644 --- a/tools/testfiles/tvldtypes2.h5.xml +++ b/tools/testfiles/tvldtypes2.h5.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd"> +<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd"> <hdf5:RootGroup OBJ-XID="xid_928" H5Path="/"> <hdf5:Dataset Name="Dataset1" OBJ-XID="xid_976" H5Path= "/Dataset1" Parents="xid_928" H5ParentPaths="/"> <hdf5:StorageLayout> diff --git a/tools/testfiles/tvldtypes3.h5.xml b/tools/testfiles/tvldtypes3.h5.xml index 811d536..56d81a1 100644 --- a/tools/testfiles/tvldtypes3.h5.xml +++ b/tools/testfiles/tvldtypes3.h5.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd"> +<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd"> <hdf5:RootGroup OBJ-XID="xid_928" H5Path="/"> <hdf5:Dataset Name="Dataset1" OBJ-XID="xid_976" H5Path= "/Dataset1" Parents="xid_928" H5ParentPaths="/"> <hdf5:StorageLayout> diff --git a/tools/testfiles/tvldtypes4.h5.xml b/tools/testfiles/tvldtypes4.h5.xml index 1d368ce..8e31bd9 100644 --- a/tools/testfiles/tvldtypes4.h5.xml +++ b/tools/testfiles/tvldtypes4.h5.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd"> +<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd"> <hdf5:RootGroup OBJ-XID="xid_928" H5Path="/"> <hdf5:Dataset Name="Dataset1" OBJ-XID="xid_976" H5Path= "/Dataset1" Parents="xid_928" H5ParentPaths="/"> <hdf5:StorageLayout> diff --git a/tools/testfiles/tvldtypes5.h5.xml b/tools/testfiles/tvldtypes5.h5.xml index d6ed774..be68e09 100644 --- a/tools/testfiles/tvldtypes5.h5.xml +++ b/tools/testfiles/tvldtypes5.h5.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd"> +<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd"> <hdf5:RootGroup OBJ-XID="xid_928" H5Path="/"> <hdf5:Dataset Name="Dataset" OBJ-XID="xid_976" H5Path= "/Dataset" Parents="xid_928" H5ParentPaths="/"> <hdf5:StorageLayout> diff --git a/tools/testfiles/tvlstr.h5.xml b/tools/testfiles/tvlstr.h5.xml index e5ec1f3..d945964 100644 --- a/tools/testfiles/tvlstr.h5.xml +++ b/tools/testfiles/tvlstr.h5.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd"> +<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd"> <hdf5:RootGroup OBJ-XID="xid_96" H5Path="/"> <hdf5:Attribute Name="test_scalar"> <hdf5:Dataspace> diff --git a/vms/src/h5pubconf.h b/vms/src/h5pubconf.h index 5fef009..e042076 100644 --- a/vms/src/h5pubconf.h +++ b/vms/src/h5pubconf.h @@ -102,6 +102,9 @@ /* Define if the direct I/O virtual file driver should be compiled */ /* #undef H5_HAVE_DIRECT */ +/* Define to 1 if you have the <dirent.h> header file. */ +#define H5_HAVE_DIRENT_H 1 + /* Define to 1 if you have the <dlfcn.h> header file. */ #define H5_HAVE_DLFCN_H 1 @@ -199,6 +202,9 @@ /* Define to 1 if you have the <io.h> header file. */ /* #undef H5_HAVE_IO_H */ +/* Define to 1 if you have the `dl' library (-ldl). */ +#define H5_HAVE_LIBDL 1 + /* Define to 1 if you have the `dmalloc' library (-ldmalloc). */ /* #undef H5_HAVE_LIBDMALLOC */ @@ -277,6 +283,9 @@ /* Define to 1 if you have the `rand_r' function. */ /* #define H5_HAVE_RAND_R 1 */ +/* Define to 1 if you have the `setjmp' function. */ +#define H5_HAVE_SETJMP 1 + /* Define to 1 if you have the <setjmp.h> header file. */ #define H5_HAVE_SETJMP_H 1 @@ -505,7 +514,7 @@ #define H5_PACKAGE_NAME "HDF5" /* Define to the full name and version of this package. */ -#define H5_PACKAGE_STRING "HDF5 1.9.149" +#define H5_PACKAGE_STRING "HDF5 1.9.156" /* Define to the one symbol short name of this package. */ #define H5_PACKAGE_TARNAME "hdf5" @@ -514,7 +523,7 @@ #define H5_PACKAGE_URL "" /* Define to the version of this package. */ -#define H5_PACKAGE_VERSION "1.9.149" +#define H5_PACKAGE_VERSION "1.9.156" /* Width for printf() for type `long long' or `__int64', use `ll' */ #define H5_PRINTF_LL_WIDTH "ll" @@ -677,7 +686,7 @@ /* #undef H5_USING_MEMCHECKER */ /* Version number of package */ -#define H5_VERSION "1.9.149" +#define H5_VERSION "1.9.156" /* Define if vsnprintf() returns the correct value for formatted strings that don't fit into size allowed */ diff --git a/vms/src/make.com b/vms/src/make.com index bd1f55c..cdf0f4a 100644 --- a/vms/src/make.com +++ b/vms/src/make.com @@ -57,7 +57,7 @@ $ cobj1= "H5MFaggr, H5MF, H5MFdbg, H5MFsection, H5MM,"+- "H5O, H5Ocache, H5Ochunk, H5Ocont, H5Ocopy, H5Odbg, H5Odrvinfo, H5Odtype, H5Oefl, H5Ofill, H5Ofsinfo,"+- "H5Oginfo, H5Olayout, H5Olinfo, H5Olink, H5Omessage, H5Omtime, H5Oname, H5Onull, H5Opline,"+- "H5Orefcount, H5Osdspace, H5Oshared, H5Oshmesg, H5Ostab, H5Otest, H5Ounknown,"+- - "H5Pacpl, H5P, H5Pdapl, H5Pdcpl, H5Pdeprec, H5Pdxpl, H5Pfapl, H5Pfcpl, H5Pfmpl, H5Pgcpl, H5Pint,"+- + "H5Pacpl, H5P, H5Pdapl, H5Pdcpl, H5Pdeprec, H5Pdxpl, H5Pencdec, H5Pfapl, H5Pfcpl, H5Pfmpl, H5Pgcpl, H5Pint,"+- "H5Plapl, H5Plcpl, H5Pocpl, H5Pocpypl, H5Pstrcpl, H5Ptest,"+- "H5R, H5RC, H5Rdeprec, H5RS, H5Sall, H5S, H5Sdbg, H5Shyper, H5SL, H5SMbtree2, H5SM, H5SMcache,"+- "H5SMmessage, H5Smpio, H5SMtest, H5Snone, H5Spoint, H5Sselect, H5ST, H5Stest,"+- |