diff options
119 files changed, 2054 insertions, 1538 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 1466865..dbbf55f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,9 +1,9 @@ cmake_minimum_required (VERSION 3.10) project (HDF5 C) -if(POLICY CMP0074) - cmake_policy(SET CMP0074 NEW) -endif() +if (POLICY CMP0074) + cmake_policy (SET CMP0074 NEW) +endif () #----------------------------------------------------------------------------- # Instructions for use : Normal Build @@ -15,7 +15,7 @@ endif() # Make install can be used to install all components for system-wide use. # if (CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_CURRENT_BINARY_DIR) - MESSAGE(FATAL_ERROR "\nERROR! ${PROJECT_NAME} DOES NOT SUPPORT IN SOURCE BUILDS!\n" + message (FATAL_ERROR "\nERROR! ${PROJECT_NAME} DOES NOT SUPPORT IN SOURCE BUILDS!\n" "CMAKE_CURRENT_SOURCE_DIR=${CMAKE_CURRENT_SOURCE_DIR}" " == CMAKE_CURRENT_BINARY_DIR=${CMAKE_CURRENT_BINARY_DIR}\n" "NEXT STEPS:\n" @@ -100,7 +100,7 @@ mark_as_advanced (HDF5_EXTERNAL_LIB_PREFIX) # # Add the sub project # add_subdirectory (Utilities/hdf5-1.8) #----------------------------------------------------------------------------- -string(TIMESTAMP CONFIG_DATE "%Y-%m-%d") +string (TIMESTAMP CONFIG_DATE "%Y-%m-%d") #----------------------------------------------------------------------------- # Allow Visual Studio solution directories @@ -440,6 +440,7 @@ set (H5_ENABLE_STATIC_LIB NO) option (BUILD_SHARED_LIBS "Build Shared Libraries" ON) set (H5_ENABLE_SHARED_LIB NO) option (ONLY_SHARED_LIBS "Only Build Shared Libraries" OFF) +mark_as_advanced (ONLY_SHARED_LIBS) if (BUILD_STATIC_LIBS) set (H5_ENABLE_STATIC_LIB YES) @@ -460,6 +461,12 @@ endif () set (CMAKE_POSITION_INDEPENDENT_CODE ON) +if (NOT BUILD_SHARED_LIBS) + set (tgt_file_ext "") +else () + set (tgt_file_ext "-shared") +endif () + #----------------------------------------------------------------------------- # Option to Build Static executables #----------------------------------------------------------------------------- @@ -485,7 +492,7 @@ option (HDF5_ENABLE_COVERAGE "Enable code coverage for Libraries and Programs" O if (HDF5_ENABLE_COVERAGE) include (${HDF5_SOURCE_DIR}/config/sanitizer/code-coverage.cmake) if(CODE_COVERAGE AND CODE_COVERAGE_ADDED) - add_code_coverage() # Adds instrumentation to all targets + add_code_coverage () # Adds instrumentation to all targets else () set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -O0 --coverage -fprofile-arcs -ftest-coverage") set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g --coverage -O0 -fprofile-arcs -ftest-coverage") @@ -795,8 +802,8 @@ if (HDF5_ENABLE_THREADSAFE) message (FATAL_ERROR " **** thread-safe option requires Win32 threads or Pthreads **** ") endif () endif () - set(THREADS_PREFER_PTHREAD_FLAG ON) - find_package(Threads REQUIRED) + set (THREADS_PREFER_PTHREAD_FLAG ON) + find_package (Threads REQUIRED) if (Threads_FOUND) set (H5_HAVE_THREADSAFE 1) endif () @@ -142,6 +142,12 @@ ./config/pgi-flags ./config/solaris +#warnings files for both autotools and CMake +./config/gnu-warnings-general +./config/gnu-warnings-developer-general +./config/gnu-warnings-no-developer-general +./config/intel-warnings-general + ./config/site-specific/BlankForm ./examples/Attributes.txt diff --git a/config/cmake/CTestCustom.cmake b/config/cmake/CTestCustom.cmake index 7ee5737..fa4c66e 100644 --- a/config/cmake/CTestCustom.cmake +++ b/config/cmake/CTestCustom.cmake @@ -21,14 +21,18 @@ set (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" + "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" + "src.ZLIB.*:[ \t]*warning" + "warning LNK4197:.*ZLIB-prefix" + "src.SZIP.*:[ \t]*warning" # "POSIX name for this item is deprecated" "disabling jobserver mode" "config.cmake.xlatefile.c" # "warning.*implicit declaration of function" + "warning.*unknown pragma" + "warning.*unrecognized .pragma" # "note: expanded from macro" # "fpp:[ \t]*warning:[ \t]*cannot remove H5_DEBUG_API - not a predefined macro" ) @@ -69,26 +73,6 @@ set (CTEST_CUSTOM_MEMCHECK_IGNORE HL_FORTRAN_f90_ex-clear-objects ######### tools/h5clear ######### H5CLEAR-clearall-objects - H5CLEAR-copy_h5clear_fsm_persist_equal.h5 - H5CLEAR-copy_h5clear_fsm_persist_greater.h5 - H5CLEAR-copy_h5clear_fsm_persist_less.h5 - H5CLEAR-copy_h5clear_fsm_persist_noclose.h5 - H5CLEAR-copy_h5clear_fsm_persist_user_equal.h5 - H5CLEAR-copy_h5clear_fsm_persist_user_greater.h5 - H5CLEAR-copy_h5clear_fsm_persist_user_less.h5 - H5CLEAR-copy_h5clear_log_v3.h5 - H5CLEAR-copy_h5clear_mdc_image.h5 - H5CLEAR-copy_h5clear_sec2_v0.h5 - H5CLEAR-copy_h5clear_sec2_v2.h5 - H5CLEAR-copy_h5clear_sec2_v3.h5 - H5CLEAR-copy_h5clear_status_noclear.h5 - H5CLEAR-copy_latest_h5clear_log_v3.h5 - H5CLEAR-copy_latest_h5clear_sec2_v3.h5 - H5CLEAR-copy_mod_h5clear_mdc_image.h5 - H5CLEAR-copy_mod_h5clr_mdc_image2.h5 - H5CLEAR-copy_orig_h5clear_sec2_v0.h5 - H5CLEAR-copy_orig_h5clear_sec2_v2.h5 - H5CLEAR-copy_orig_h5clear_sec2_v3.h5 H5CLEAR-h5clear_gentest # does not close ids by design ######### tools/h5copy ######### H5COPY-clearall-objects @@ -151,7 +135,9 @@ set (CTEST_CUSTOM_MEMCHECK_IGNORE H5REPACK-szip_individual-clear-objects H5REPACK-szip_remove-clear-objects H5REPACK-upgrade_layout-clear-objects + H5REPACK_DMP-attrregion-clear-objects H5REPACK_DMP-crtorder-clear-objects + H5REPACK_DMP-dataregion-clear-objects H5REPACK_DMP-deflate_limit-clear-objects H5REPACK-bug1814-clear-objects H5REPACK-HDFFV-5932-clear-objects diff --git a/config/cmake/HDFCompilerFlags.cmake b/config/cmake/HDFCompilerFlags.cmake index 99a8f56..ea85736 100644 --- a/config/cmake/HDFCompilerFlags.cmake +++ b/config/cmake/HDFCompilerFlags.cmake @@ -12,6 +12,24 @@ set(CMAKE_C_STANDARD 99) set(CMAKE_C_STANDARD_REQUIRED TRUE) +macro (ADD_H5_FLAGS h5_flag_var infile) + file (STRINGS ${infile} TEST_FLAG_STREAM) + #message (STATUS "TEST_FLAG_STREAM=${TEST_FLAG_STREAM}") + list (LENGTH TEST_FLAG_STREAM len_flag) + if (len_flag GREATER 0) + math (EXPR _FP_LEN "${len_flag} - 1") + foreach (line RANGE 0 ${_FP_LEN}) + list (GET TEST_FLAG_STREAM ${line} str_flag) + string (REGEX REPLACE "^#.*" "" str_flag "${str_flag}") + #message (STATUS "str_flag=${str_flag}") + if (str_flag) + set (${h5_flag_var} "${${h5_flag_var}} ${str_flag}") + endif () + endforeach () + endif () + #message (STATUS "h5_flag_var=${${h5_flag_var}}") +endmacro () + message (STATUS "Warnings Configuration:") set (CMAKE_C_FLAGS "${CMAKE_C99_STANDARD_COMPILE_OPTION} ${CMAKE_C_FLAGS}") #----------------------------------------------------------------------------- @@ -95,7 +113,9 @@ if (NOT MSVC AND CMAKE_COMPILER_IS_GNUCC) # NOTE: Don't add -Wpadded here since we can't/won't fix the (many) # warnings that are emitted. If you need it, add it at configure time. if (CMAKE_C_COMPILER_ID STREQUAL "Intel") - set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wcheck -Wall") + ADD_H5_FLAGS (CMAKE_C_FLAGS_GENERAL "${HDF5_SOURCE_DIR}/config/intel-warnings-general") + message (STATUS "CMAKE_C_FLAGS_GENERAL=${CMAKE_C_FLAGS_GENERAL}") + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${CMAKE_C_FLAGS_GENERAL}") set (H5_CFLAGS0 "${H5_CFLAGS0} -Wcomment -Wdeprecated -Wmain -Wmissing-declarations -Wmissing-prototypes -Wp64 -Wpointer-arith") set (H5_CFLAGS0 "${H5_CFLAGS0} -Wreturn-type -Wstrict-prototypes -Wuninitialized") set (H5_CFLAGS0 "${H5_CFLAGS0} -Wunknown-pragmas -Wunused-function -Wunused-variable") @@ -106,16 +126,19 @@ if (NOT MSVC AND CMAKE_COMPILER_IS_GNUCC) set (H5_CFLAGS0 "${H5_CFLAGS0} -Wsign-compare -Wtrigraphs -Wwrite-strings") endif() elseif (CMAKE_C_COMPILER_ID STREQUAL "GNU") - set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pedantic -Wall -Wextra") - set (H5_CFLAGS0 "${H5_CFLAGS0} -Wbad-function-cast -Wno-c++-compat -Wcast-align") - set (H5_CFLAGS0 "${H5_CFLAGS0} -Wcast-qual -Wconversion -Wdeclaration-after-statement -Wdisabled-optimization -Wfloat-equal") - set (H5_CFLAGS0 "${H5_CFLAGS0} -Wformat=2 -Winit-self -Winvalid-pch -Wmissing-declarations -Wmissing-include-dirs") - set (H5_CFLAGS0 "${H5_CFLAGS0} -Wmissing-prototypes -Wnested-externs -Wold-style-definition -Wpacked -Wpointer-arith") - set (H5_CFLAGS0 "${H5_CFLAGS0} -Wredundant-decls -Wshadow -Wstrict-prototypes -Wswitch-default -Wswitch-enum") - set (H5_CFLAGS0 "${H5_CFLAGS0} -Wundef -Wunused-macros -Wunsafe-loop-optimizations -Wwrite-strings") + ADD_H5_FLAGS (CMAKE_C_FLAGS_GENERAL "${HDF5_SOURCE_DIR}/config/gnu-warnings-general") + message (STATUS "CMAKE_C_FLAGS_GENERAL=${CMAKE_C_FLAGS_GENERAL}") + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${CMAKE_C_FLAGS_GENERAL}") + set (H5_CFLAGS0 "${H5_CFLAGS0} -Wbad-function-cast -Wcast-align") + set (H5_CFLAGS0 "${H5_CFLAGS0} -Wdeclaration-after-statement -Wdisabled-optimization") + set (H5_CFLAGS0 "${H5_CFLAGS0} -Wmissing-declarations") + set (H5_CFLAGS0 "${H5_CFLAGS0} -Wmissing-prototypes -Wnested-externs -Wold-style-definition -Wpacked") + set (H5_CFLAGS0 "${H5_CFLAGS0} -Wredundant-decls -Wstrict-prototypes -Wswitch-enum -Wswitch-default") + set (H5_CFLAGS0 "${H5_CFLAGS0} -Wunused-macros -Wunsafe-loop-optimizations") # gcc automatically inlines based on the optimization level # this is just a failsafe set (H5_CFLAGS0 "${H5_CFLAGS0} -finline-functions") + message (STATUS "H5_CFLAGS0=${H5_CFLAGS0}") endif () endif () @@ -129,11 +152,13 @@ if (NOT MSVC AND CMAKE_COMPILER_IS_GNUCC) if (CMAKE_C_COMPILER_ID STREQUAL "Intel") set (H5_CFLAGS0 "${H5_CFLAGS0} -Winline -Wreorder -Wport -Wstrict-aliasing") elseif (CMAKE_C_COMPILER_ID STREQUAL "GNU") - set (H5_CFLAGS0 "${H5_CFLAGS0} -Winline -Waggregate-return -Wmissing-format-attribute -Wmissing-noreturn") + ADD_H5_FLAGS (CMAKE_C_FLAGS_DEV_GENERAL "${HDF5_SOURCE_DIR}/config/gnu-warnings-developer-general") + set (H5_CFLAGS0 "${H5_CFLAGS0} ${CMAKE_C_FLAGS_DEV_GENERAL}") endif () else () if (CMAKE_C_COMPILER_ID STREQUAL "GNU") - set (H5_CFLAGS0 "${H5_CFLAGS0} -Wno-inline -Wno-aggregate-return -Wno-missing-format-attribute -Wno-missing-noreturn") + ADD_H5_FLAGS (CMAKE_C_FLAGS_NO_DEV_GENERAL "${HDF5_SOURCE_DIR}/config/gnu-warnings-no-developer-general") + set (H5_CFLAGS0 "${H5_CFLAGS0} ${CMAKE_C_FLAGS_NO_DEV_GENERAL}") endif () endif () diff --git a/config/gnu-flags b/config/gnu-flags index eaa30a9..3ca74c1 100644 --- a/config/gnu-flags +++ b/config/gnu-flags @@ -17,6 +17,21 @@ # if the compiler is not GNU; otherwise 'cc_flags_set' is set to 'yes' # +# +# Prepend `$srcdir/config/gnu-` to the filename suffix(es) given as +# subroutine argument(s), remove comments starting with # and ending +# at EOL, replace spans of whitespace (including newlines) with spaces, +# and re-emit the file(s) thus filtered on the standard output stream. +# +load_gcc_arguments() +{ + set -- $(for arg; do + sed 's,#.*$,,' $srcdir/config/gnu-${arg} + done) + IFS=' ' echo "$*" +} + + # Get the compiler version in a way that works for gcc # unless a compiler version is already known # @@ -138,7 +153,7 @@ if test "X-gcc" = "X-$cc_vendor"; then ################ # Optimization # ################ - + if test $cc_vers_major -le 4; then HIGH_OPT_CFLAGS="-O3" DEBUG_OPT_CFLAGS= @@ -171,12 +186,13 @@ if test "X-gcc" = "X-$cc_vendor"; then # NOTE: Due to the divergence in the C and C++, we're dropping support for # compiling the C library with a C++ compiler and dropping the -Wc++-compat # warning. - H5_CFLAGS="$H5_CFLAGS -pedantic -Wall -Wextra -Wbad-function-cast -Wno-c++-compat -Wcast-align" - H5_CFLAGS="$H5_CFLAGS -Wcast-qual -Wconversion -Wdeclaration-after-statement -Wdisabled-optimization -Wfloat-equal" - H5_CFLAGS="$H5_CFLAGS -Wformat=2 -Wno-format-nonliteral -Winit-self -Winvalid-pch -Wmissing-declarations -Wmissing-include-dirs" + H5_CFLAGS="$H5_CFLAGS $(load_gcc_arguments warnings-general)" + H5_CFLAGS="$H5_CFLAGS -Wbad-function-cast -Wcast-align" + H5_CFLAGS="$H5_CFLAGS -Wdeclaration-after-statement -Wdisabled-optimization" + H5_CFLAGS="$H5_CFLAGS -Wmissing-declarations" H5_CFLAGS="$H5_CFLAGS -Wmissing-prototypes -Wnested-externs -Wold-style-definition -Wpacked" - H5_CFLAGS="$H5_CFLAGS -Wredundant-decls -Wshadow -Wstrict-prototypes -Wswitch-enum -Wswitch-default" - H5_CFLAGS="$H5_CFLAGS -Wundef -Wunused-macros -Wunsafe-loop-optimizations -Wwrite-strings" + H5_CFLAGS="$H5_CFLAGS -Wredundant-decls -Wstrict-prototypes -Wswitch-enum -Wswitch-default" + H5_CFLAGS="$H5_CFLAGS -Wunused-macros -Wunsafe-loop-optimizations" ###################### # Developer warnings # @@ -184,8 +200,8 @@ if test "X-gcc" = "X-$cc_vendor"; then # (suggestions from gcc, not code problems) # NOTE: -Wformat-nonliteral added back in here (from being disabled in H5_CFLAGS) - DEVELOPER_WARNING_CFLAGS="-Winline -Waggregate-return -Wmissing-format-attribute -Wmissing-noreturn -Wformat-nonliteral" - NO_DEVELOPER_WARNING_CFLAGS="-Wno-inline -Wno-aggregate-return -Wno-missing-format-attribute -Wno-missing-noreturn" + NO_DEVELOPER_WARNING_CFLAGS=$(load_gcc_arguments warnings-no-developer-general) + DEVELOPER_WARNING_CFLAGS=$(load_gcc_arguments warnings-developer-general) ####################### # gcc 4 special cases # @@ -196,11 +212,11 @@ if test "X-gcc" = "X-$cc_vendor"; then H5_CFLAGS="$H5_CFLAGS -Wno-long-long" fi - # -Wvolatile-register-var was later incorporated into -Wall and - # only needs to be specified explicitly for gcc 4.2-4.3 + # -Wvolatile-register-var was later incorporated into -Wall and + # only needs to be specified explicitly for gcc 4.2-4.3 if test $cc_vers_major -eq 4 -a $cc_vers_minor -ge 2 -o $cc_vers_major -eq 4 -a $cc_vers_minor -le 3; then - H5_CFLAGS="$H5_CFLAGS -Wvolatile-register-var" - fi + H5_CFLAGS="$H5_CFLAGS -Wvolatile-register-var" + fi # -Wstrict-aliasing was later incorporated into -Wall and # only needs to be specified explicitly for gcc 4.5-4.6 @@ -223,10 +239,10 @@ if test "X-gcc" = "X-$cc_vendor"; then # Version-specific warnings # ############################# - # gcc 4.3 + # gcc 4.3 if test $cc_vers_major -ge 5 -o $cc_vers_major -eq 4 -a $cc_vers_minor -ge 3; then - H5_CFLAGS="$H5_CFLAGS -Wlogical-op -Wlarger-than=2560" - fi + H5_CFLAGS="$H5_CFLAGS -Wlogical-op -Wlarger-than=2560" + fi # gcc 4.4 if test $cc_vers_major -ge 5 -o $cc_vers_major -eq 4 -a $cc_vers_minor -ge 4; then diff --git a/config/gnu-warnings-developer-general b/config/gnu-warnings-developer-general new file mode 100644 index 0000000..698f0e0 --- /dev/null +++ b/config/gnu-warnings-developer-general @@ -0,0 +1,8 @@ +# (suggestions from gcc, not code problems) +# NOTE: -Wformat-nonliteral added back in here (from being disabled in +# H5_CFLAGS) +-Waggregate-return +-Wformat-nonliteral +-Winline +-Wmissing-format-attribute +-Wmissing-noreturn diff --git a/config/gnu-warnings-general b/config/gnu-warnings-general new file mode 100644 index 0000000..9e67b71 --- /dev/null +++ b/config/gnu-warnings-general @@ -0,0 +1,32 @@ +# Note that some of the flags listed here really should be developer +# flags (listed in separate files, gnu-warnings-developer*) but we put +# them here because they are not raised by the current code and we'd like to +# know if they do start showing up. +# +# NOTE: Don't add -Wpadded here since we can't/won't fix the (many) +# warnings that are emitted. If you need it, add it from the +# environment variable at configure time. +-Wall +-Wcast-qual +-Wconversion +-Wextra +-Wfloat-equal +-Wformat=2 +-Winit-self +-Winvalid-pch +-Wmissing-include-dirs +# +# NOTE: Due to the divergence in the C and C++, we're dropping support for +# compiling the C library with a C++ compiler and dropping the -Wc++-compat +# warning. +# +-Wno-c++-compat +# +# NOTE: Disable the -Wformat-nonliteral from -Wformat=2 here and re-add +# it to the developer flags. +# +-Wno-format-nonliteral +-Wshadow +-Wundef +-Wwrite-strings +-pedantic
\ No newline at end of file diff --git a/config/gnu-warnings-no-developer-general b/config/gnu-warnings-no-developer-general new file mode 100644 index 0000000..85dc0a3 --- /dev/null +++ b/config/gnu-warnings-no-developer-general @@ -0,0 +1,4 @@ +-Wno-aggregate-return +-Wno-inline +-Wno-missing-format-attribute +-Wno-missing-noreturn diff --git a/config/intel-flags b/config/intel-flags index dad210c..6b4e406 100644 --- a/config/intel-flags +++ b/config/intel-flags @@ -1,4 +1,4 @@ -# -*- shell-script -*- +# -*- shell-script -*- # # Copyright by The HDF Group. # Copyright by the Board of Trustees of the University of Illinois. @@ -17,6 +17,20 @@ # if the compiler is not Intel; otherwise `cc_flags_set' is set to `yes' # +# +# Prepend `$srcdir/config/intel-` to the filename suffix(es) given as +# subroutine argument(s), remove comments starting with # and ending +# at EOL, replace spans of whitespace (including newlines) with spaces, +# and re-emit the file(s) thus filtered on the standard output stream. +# +load_intel_arguments() +{ + set -- $(for arg; do + sed 's,#.*$,,' $srcdir/config/intel-${arg} + done) + IFS=' ' echo "$*" +} + # Get the compiler version in a way that works for icc # icc unless a compiler version is already known # @@ -66,7 +80,8 @@ if test "X-icc" = "X-$cc_vendor"; then # General # Default to C99 standard. - H5_CFLAGS="$H5_CFLAGS $arch -std=c99 -Wcheck -Wall" + H5_CFLAGS="$H5_CFLAGS $arch -std=c99" + H5_CFLAGS="$H5_CFLAGS $(load_intel_arguments warnings-general)" # Production PROD_CFLAGS= diff --git a/config/intel-warnings-general b/config/intel-warnings-general new file mode 100644 index 0000000..f4ed24c --- /dev/null +++ b/config/intel-warnings-general @@ -0,0 +1,10 @@ +# Note that some of the flags listed here really should be developer +# flags (listed in separate files, gnu-warnings-developer*) but we put +# them here because they are not raised by the current code and we'd like to +# know if they do start showing up. +# +# NOTE: Don't add -Wpadded here since we can't/won't fix the (many) +# warnings that are emitted. If you need it, add it from the +# environment variable at configure time. +-Wall +-Wcheck
\ No newline at end of file diff --git a/config/sanitizer/sanitizers.cmake b/config/sanitizer/sanitizers.cmake index 7a6c195..2625ec3 100644 --- a/config/sanitizer/sanitizers.cmake +++ b/config/sanitizer/sanitizers.cmake @@ -28,7 +28,7 @@ function(append value) endforeach(variable) endfunction() -if(USE_SANITIZER) +if(USE_SANITIZER AND "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang") set(CMAKE_EXPORT_COMPILE_COMMANDS ON) append("-fno-omit-frame-pointer" CMAKE_C_FLAGS CMAKE_CXX_FLAGS) diff --git a/fortran/src/H5Pf.c b/fortran/src/H5Pf.c index 9fdd19b..2cacc8c 100644 --- a/fortran/src/H5Pf.c +++ b/fortran/src/H5Pf.c @@ -488,12 +488,26 @@ h5pget_fill_value_c (hid_t_f *prp_id, hid_t_f *type_id, void *fillvalue) * Removed extra length parameters EP 7/6/00 * SOURCE */ +#ifdef H5_NO_DEPRECATED_SYMBOLS +int_f +h5pget_version_c (hid_t_f H5_ATTR_UNUSED *prp_id, int_f * boot,int_f * freelist, int_f * stab, int_f *shhdr) +/******/ +{ + /* + * Fill in fake values [since we need a file ID to call H5Fget_info :-( -QAK ] + */ + *boot = (int_f)0; + *freelist = (int_f)0; + *stab = (int_f)0; + *shhdr = (int_f)0; + + return 0; +} +#else /* H5_NO_DEPRECATED_SYMBOLS */ int_f h5pget_version_c (hid_t_f *prp_id, int_f * boot,int_f * freelist, int_f * stab, int_f *shhdr) /******/ { - int ret_value = -1; -#ifndef H5_NO_DEPRECATED_SYMBOLS herr_t ret; unsigned c_boot; unsigned c_freelist; @@ -504,25 +518,16 @@ h5pget_version_c (hid_t_f *prp_id, int_f * boot,int_f * freelist, int_f * stab, * Call H5Pget_version function. */ ret = H5Pget_version((hid_t)*prp_id, &c_boot, &c_freelist, &c_stab, &c_shhdr); - if (ret < 0) return ret_value; + if (ret < 0) return -1; *boot = (int_f)c_boot; *freelist = (int_f)c_freelist; *stab = (int_f)c_stab; *shhdr = (int_f)c_shhdr; -#else /* H5_NO_DEPRECATED_SYMBOLS */ - /* - * Fill in fake values [since we need a file ID to call H5Fget_info :-( -QAK ] - */ - *boot = (int_f)0; - *freelist = (int_f)0; - *stab = (int_f)0; - *shhdr = (int_f)0; -#endif /* H5_NO_DEPRECATED_SYMBOLS */ - ret_value = 0; - return ret_value; + return 0; } +#endif /* H5_NO_DEPRECATED_SYMBOLS */ /****if* H5Pf/h5pget_userblock_c * NAME diff --git a/fortran/src/H5VLff.F90 b/fortran/src/H5VLff.F90 index eea9dfe..32dd7d7 100644 --- a/fortran/src/H5VLff.F90 +++ b/fortran/src/H5VLff.F90 @@ -124,13 +124,14 @@ CONTAINS END SUBROUTINE H5VLregister_connector_by_value_f ! -!****s* H5VL/H5VLis_connector_registered_f +!****s* H5VL/H5VLis_connector_registered_by_name_f ! ! NAME -! H5VLis_connector_registered_f +! H5VLis_connector_registered_by_name_f ! ! PURPOSE -! Tests whether a VOL class has been registered or not. +! Tests whether a VOL class has been registered or not +! according to a specified connector name. ! ! INPUTS ! name - Connector name @@ -139,7 +140,7 @@ CONTAINS ! hdferr - Returns 0 if successful and -1 if fails ! SOURCE - SUBROUTINE H5VLis_connector_registered_f(name, registered, hdferr) + SUBROUTINE H5VLis_connector_registered_by_name_f(name, registered, hdferr) IMPLICIT NONE CHARACTER(LEN=*), INTENT(IN) :: name LOGICAL, INTENT(OUT) :: registered @@ -149,22 +150,63 @@ CONTAINS INTEGER(C_INT) :: registered_c INTERFACE - INTEGER(C_INT) FUNCTION H5VLis_connector_registered(name) BIND(C,NAME='H5VLis_connector_registered') + INTEGER(C_INT) FUNCTION H5VLis_connector_registered_by_name(name) BIND(C,NAME='H5VLis_connector_registered_by_name') IMPORT :: C_CHAR IMPORT :: C_INT CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: name - END FUNCTION H5VLis_connector_registered + END FUNCTION H5VLis_connector_registered_by_name END INTERFACE c_name = TRIM(name)//C_NULL_CHAR - registered_c = H5VLis_connector_registered(c_name) + registered_c = H5VLis_connector_registered_by_name(c_name) hdferr = 0 registered = .FALSE. IF(registered_c .GT. 0) registered = .TRUE. IF(registered_c .LT. 0) hdferr = INT(registered_c) - END SUBROUTINE H5VLis_connector_registered_f + END SUBROUTINE H5VLis_connector_registered_by_name_f + +! +!****s* H5VL/H5VLis_connector_registered_by_value_f +! +! NAME +! H5VLis_connector_registered_by_value_f +! +! PURPOSE +! Tests whether a VOL class has been registered or not +! according to a specified connector value (ID). +! +! INPUTS +! value - Connector value +! OUTPUTS +! registered - state of VOL class registration +! hdferr - Returns 0 if successful and -1 if fails +! SOURCE + + SUBROUTINE H5VLis_connector_registered_by_value_f(value, registered, hdferr) + IMPLICIT NONE + INTEGER, INTENT(IN) :: value + LOGICAL, INTENT(OUT) :: registered + INTEGER, INTENT(OUT) :: hdferr +!***** + INTEGER(C_INT) :: registered_c + + INTERFACE + INTEGER(C_INT) FUNCTION H5VLis_connector_registered_by_value(value) BIND(C,NAME='H5VLis_connector_registered_by_value') + IMPORT :: C_INT + INTEGER(C_INT), VALUE :: value + END FUNCTION H5VLis_connector_registered_by_value + END INTERFACE + + registered_c = H5VLis_connector_registered_by_value(INT(value,C_INT)) + + hdferr = 0 + registered = .FALSE. + IF(registered_c .GT. 0) registered = .TRUE. + IF(registered_c .LT. 0) hdferr = INT(registered_c) + + END SUBROUTINE H5VLis_connector_registered_by_value_f ! !****s* H5VL/H5VLget_connector_id_f @@ -248,6 +290,46 @@ CONTAINS END SUBROUTINE H5VLget_connector_id_by_name_f +! +!****s* H5VL/H5VLget_connector_id_by_value_f +! +! NAME +! H5VLget_connector_id_by_value_f +! +! PURPOSE +! Retrieves the ID for a registered VOL connector. +! +! INPUTS +! value - Connector value +! OUTPUTS +! vol_id - Connector id +! hdferr - Returns 0 if successful and -1 if fails +! SOURCE + + SUBROUTINE H5VLget_connector_id_by_value_f(value, vol_id, hdferr) + IMPLICIT NONE + INTEGER, INTENT(IN) :: value + INTEGER(HID_T), INTENT(OUT) :: vol_id + INTEGER, INTENT(OUT) :: hdferr +!***** + INTERFACE + INTEGER(HID_T) FUNCTION H5VLget_connector_id_by_value(value) BIND(C,NAME='H5VLget_connector_id_by_value') + IMPORT :: C_INT + IMPORT :: HID_T + INTEGER(C_INT), VALUE :: value + END FUNCTION H5VLget_connector_id_by_value + END INTERFACE + + vol_id = H5VLget_connector_id_by_value(INT(value,C_INT)) + + hdferr = 0 + IF(vol_id.LT.0)THEN + hdferr = -1 + vol_id = H5I_INVALID_HID_F + ENDIF + + END SUBROUTINE H5VLget_connector_id_by_value_f + SUBROUTINE H5VLget_connector_name_f(obj_id, name, hdferr, name_len) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: obj_id diff --git a/fortran/src/H5match_types.c b/fortran/src/H5match_types.c index 2a6204d..ec2d66f 100644 --- a/fortran/src/H5match_types.c +++ b/fortran/src/H5match_types.c @@ -153,7 +153,9 @@ int main(void) int FORTRAN_NUM_INTEGER_KINDS=H5_FORTRAN_NUM_INTEGER_KINDS; int H5_FORTRAN_NUM_REAL_KINDS; +#if H5_FORTRAN_HAVE_C_LONG_DOUBLE!=0 int found_long_double = 0; +#endif /* Open target files */ c_header = fopen(CFILE, "w"); diff --git a/fortran/src/hdf5_fortrandll.def.in b/fortran/src/hdf5_fortrandll.def.in index 7e8b611..c792232 100644 --- a/fortran/src/hdf5_fortrandll.def.in +++ b/fortran/src/hdf5_fortrandll.def.in @@ -458,9 +458,11 @@ H5T_mp_H5TENUM_INSERT_F03 ; H5VL H5VL_mp_H5VLREGISTER_CONNECTOR_BY_NAME_F H5VL_mp_H5VLREGISTER_CONNECTOR_BY_VALUE_F -H5VL_mp_H5VLIS_CONNECTOR_REGISTERED_F +H5VL_mp_H5VLIS_CONNECTOR_REGISTERED_BY_NAME_F +H5VL_mp_H5VLIS_CONNECTOR_REGISTERED_BY_VALUE_F H5VL_mp_H5VLGET_CONNECTOR_ID_F H5VL_mp_H5VLGET_CONNECTOR_ID_BY_NAME_F +H5VL_mp_H5VLGET_CONNECTOR_ID_BY_VALUE_F H5VL_mp_H5VLGET_CONNECTOR_NAME_F H5VL_mp_H5VLCLOSE_F H5VL_mp_H5VLUNREGISTER_CONNECTOR_F diff --git a/fortran/test/vol_connector.F90 b/fortran/test/vol_connector.F90 index cd05cb1..d346737 100644 --- a/fortran/test/vol_connector.F90 +++ b/fortran/test/vol_connector.F90 @@ -61,18 +61,18 @@ CONTAINS INTEGER(hid_t) :: file_id ! The null VOL connector should not be registered at the start of the test - CALL H5VLis_connector_registered_f( "FAKE_VOL_CONNECTOR_NAME", is_registered, error) - CALL check("H5VLis_connector_registered_f",error,total_error) - CALL VERIFY("H5VLis_connector_registered_f", is_registered, .FALSE., total_error) + CALL H5VLis_connector_registered_by_name_f( "FAKE_VOL_CONNECTOR_NAME", is_registered, error) + CALL check("H5VLis_connector_registered_by_name_f",error,total_error) + CALL VERIFY("H5VLis_connector_registered_by_name_f", is_registered, .FALSE., total_error) ! Register the connector by name CALL H5VLregister_connector_by_name_f(NATIVE_VOL_CONNECTOR_NAME, vol_id, error) CALL check("H5VLregister_connector_by_name_f",error,total_error) ! The connector should be registered now - CALL H5VLis_connector_registered_f(NATIVE_VOL_CONNECTOR_NAME, is_registered, error) - CALL check("H5VLis_connector_registered_f",error,total_error) - CALL VERIFY("H5VLis_connector_registered_f", is_registered, .TRUE., total_error) + CALL H5VLis_connector_registered_by_name_f(NATIVE_VOL_CONNECTOR_NAME, is_registered, error) + CALL check("H5VLis_connector_registered_by_name_f",error,total_error) + CALL VERIFY("H5VLis_connector_registered_by_name_f", is_registered, .TRUE., total_error) CALL H5VLget_connector_id_by_name_f(NATIVE_VOL_CONNECTOR_NAME, vol_id_out, error) CALL check("H5VLget_connector_id_by_name_f",error,total_error) @@ -118,24 +118,24 @@ CONTAINS INTEGER, INTENT(INOUT) :: total_error INTEGER :: error = 0 - + LOGICAL :: is_registered = .FALSE. INTEGER(hid_t) :: vol_id = 0 ! The null VOL connector should not be registered at the start of the test - CALL H5VLis_connector_registered_f( "FAKE_VOL_CONNECTOR_NAME", is_registered, error) - CALL check("H5VLis_connector_registered_f",error,total_error) - CALL VERIFY("H5VLis_connector_registered_f", is_registered, .FALSE., total_error) + CALL H5VLis_connector_registered_by_name_f( "FAKE_VOL_CONNECTOR_NAME", is_registered, error) + CALL check("H5VLis_connector_registered_by_name_f",error,total_error) + CALL VERIFY("H5VLis_connector_registered_by_name_f", is_registered, .FALSE., total_error) ! Register the connector by value CALL H5VLregister_connector_by_value_f(NATIVE_VOL_CONNECTOR_VALUE, vol_id, error) CALL check("H5VLregister_connector_by_value_f", error, total_error) ! The connector should be registered now - CALL H5VLis_connector_registered_f(NATIVE_VOL_CONNECTOR_NAME, is_registered, error) - CALL check("H5VLis_connector_registered_f",error,total_error) - CALL VERIFY("H5VLis_connector_registered_f", is_registered, .TRUE., total_error) + CALL H5VLis_connector_registered_by_name_f(NATIVE_VOL_CONNECTOR_NAME, is_registered, error) + CALL check("H5VLis_connector_registered_by_name_f",error,total_error) + CALL VERIFY("H5VLis_connector_registered_by_name_f", is_registered, .TRUE., total_error) END SUBROUTINE test_registration_by_value @@ -162,23 +162,23 @@ CONTAINS INTEGER(hid_t) :: fapl_id TYPE(C_PTR) :: f_ptr - CALL H5VLis_connector_registered_f( "FAKE_VOL_CONNECTOR_NAME", is_registered, error) + CALL H5VLis_connector_registered_by_name_f( "FAKE_VOL_CONNECTOR_NAME", is_registered, error) - CALL check("H5VLis_connector_registered_f",error,total_error) - CALL VERIFY("H5VLis_connector_registered_f", is_registered, .FALSE., total_error) + CALL check("H5VLis_connector_registered_by_name_f",error,total_error) + CALL VERIFY("H5VLis_connector_registered_by_name_f", is_registered, .FALSE., total_error) ! The null VOL connector should not be registered at the start of the test - CALL H5VLis_connector_registered_f( "FAKE_VOL_CONNECTOR_NAME", is_registered, error) - CALL check("H5VLis_connector_registered_f",error,total_error) - CALL VERIFY("H5VLis_connector_registered_f", is_registered, .FALSE., total_error) + CALL H5VLis_connector_registered_by_name_f( "FAKE_VOL_CONNECTOR_NAME", is_registered, error) + CALL check("H5VLis_connector_registered_by_name_f",error,total_error) + CALL VERIFY("H5VLis_connector_registered_by_name_f", is_registered, .FALSE., total_error) CALL H5VLregister_connector_by_name_f(NATIVE_VOL_CONNECTOR_NAME, vol_id, error) CALL check("H5VLregister_connector_by_name_f",error,total_error) ! The connector should be registered now - CALL H5VLis_connector_registered_f(NATIVE_VOL_CONNECTOR_NAME, is_registered, error) - CALL check("H5VLis_connector_registered_f",error,total_error) - CALL VERIFY("H5VLis_connector_registered_f", is_registered, .TRUE., total_error) + CALL H5VLis_connector_registered_by_name_f(NATIVE_VOL_CONNECTOR_NAME, is_registered, error) + CALL check("H5VLis_connector_registered_by_name_f",error,total_error) + CALL VERIFY("H5VLis_connector_registered_by_name_f", is_registered, .TRUE., total_error) ! Register the connector CALL H5Pcreate_f(H5P_FILE_ACCESS_F, fapl_id, error) diff --git a/fortran/testpar/CMakeLists.txt b/fortran/testpar/CMakeLists.txt index 17aa6c3..1f8dbb4 100644 --- a/fortran/testpar/CMakeLists.txt +++ b/fortran/testpar/CMakeLists.txt @@ -4,7 +4,12 @@ project (HDF5_FORTRAN_TESTPAR C Fortran) #----------------------------------------------------------------------------- # Setup include Directories #----------------------------------------------------------------------------- -set (TESTPAR_INCLUDES ${MPI_Fortran_INCLUDE_DIRS} ${CMAKE_Fortran_MODULE_DIRECTORY}/static ${HDF5_F90_BINARY_DIR} ${HDF5_F90_SRC_DIR}/src) +set (TESTPAR_INCLUDES ${MPI_Fortran_INCLUDE_DIRS} ${HDF5_F90_BINARY_DIR} ${HDF5_F90_SRC_DIR}/src)) +if (NOT BUILD_SHARED_LIBS) + set (TESTPAR_INCLUDES ${TESTPAR_INCLUDES} ${CMAKE_Fortran_MODULE_DIRECTORY}/static) +else () + set (TESTPAR_INCLUDES ${TESTPAR_INCLUDES} ${CMAKE_Fortran_MODULE_DIRECTORY}/shared) +endif () #----------------------------------------------------------------------------- # Add Tests @@ -24,11 +29,30 @@ target_compile_options(parallel_test PRIVATE $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_COMPILE_FLAGS}> ) -target_link_libraries (parallel_test - PRIVATE - ${HDF5_F90_TEST_LIB_TARGET} ${HDF5_F90_LIB_TARGET} ${HDF5_LIB_TARGET} ${LINK_Fortran_LIBS} - $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:"ws2_32.lib"> -) +if (NOT BUILD_SHARED_LIBS) + target_link_libraries (parallel_test + PRIVATE + ${HDF5_F90_TEST_LIB_TARGET} ${HDF5_F90_LIB_TARGET} ${HDF5_LIB_TARGET} ${LINK_Fortran_LIBS} + $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:"ws2_32.lib"> + ) + set_target_properties (parallel_test PROPERTIES + FOLDER test/fortran + LINKER_LANGUAGE Fortran + Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/static + ) +else () + target_link_libraries (parallel_test + PRIVATE + ${HDF5_F90_TEST_LIBSH_TARGET} ${HDF5_F90_LIBSH_TARGET} ${HDF5_LIBSH_TARGET} ${LINK_Fortran_LIBS} + $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:"ws2_32.lib"> + ) + set_target_properties (parallel_test PROPERTIES + FOLDER test/fortran + LINKER_LANGUAGE Fortran + Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/shared + ) +endif () + #set_property(TARGET parallel_test APPEND PROPERTY # LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:"-SUBSYSTEM:CONSOLE"> #) @@ -38,12 +62,6 @@ target_link_libraries (parallel_test if(MSVC) set_property(TARGET parallel_test PROPERTY LINK_FLAGS "/SUBSYSTEM:CONSOLE ${WIN_LINK_FLAGS}") endif() -set_target_properties (parallel_test PROPERTIES - FOLDER test/fortran - LINKER_LANGUAGE Fortran - Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/static -) -endif () if (HDF5_TEST_FORTRAN AND HDF5_TEST_PARALLEL) include (CMakeTests.cmake) diff --git a/hl/tools/gif2h5/CMakeTests.cmake b/hl/tools/gif2h5/CMakeTests.cmake index 8537d7c..094a7b5 100644 --- a/hl/tools/gif2h5/CMakeTests.cmake +++ b/hl/tools/gif2h5/CMakeTests.cmake @@ -27,12 +27,6 @@ HDFTEST_COPY_FILE("${HDF5_HL_TOOLS_GIF2H5_SOURCE_DIR}/testfiles/h52giftst.h5" "$ HDFTEST_COPY_FILE("${HDF5_HL_TOOLS_GIF2H5_SOURCE_DIR}/testfiles/ex_image2.h5" "${PROJECT_BINARY_DIR}/testfiles/ex_image2.h5" "gif2h5_files") add_custom_target(gif2h5_files ALL COMMENT "Copying files needed by gif2h5 tests" DEPENDS ${gif2h5_files_list}) -if (NOT BUILD_SHARED_LIBS) - set (tgt_ext "") -else () - set (tgt_ext "-shared") -endif () - # Remove any output file left over from previous test run add_test ( NAME HL_TOOLS-clear-objects @@ -45,29 +39,29 @@ add_test ( ) set_tests_properties (HL_TOOLS-clear-objects PROPERTIES FIXTURES_SETUP clear_tools_hl) -add_test (NAME HL_TOOLS_gif2h5 COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:gif2h5${tgt_ext}> testfiles/image1.gif image1.h5) +add_test (NAME HL_TOOLS_gif2h5 COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:gif2h5${tgt_file_ext}> testfiles/image1.gif image1.h5) set_tests_properties (HL_TOOLS_gif2h5 PROPERTIES FIXTURES_REQUIRED clear_tools_hl ) -add_test (NAME HL_TOOLS_h52gif COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h52gif${tgt_ext}> testfiles/h52giftst.h5 image1.gif -i image) +add_test (NAME HL_TOOLS_h52gif COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h52gif${tgt_file_ext}> testfiles/h52giftst.h5 image1.gif -i image) set_tests_properties (HL_TOOLS_h52gif PROPERTIES FIXTURES_REQUIRED clear_tools_hl ) -add_test (NAME HL_TOOLS_h52gif_none COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h52gif${tgt_ext}> testfiles/h52giftst.h5 image.gif -i nosuch_image) +add_test (NAME HL_TOOLS_h52gif_none COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h52gif${tgt_file_ext}> testfiles/h52giftst.h5 image.gif -i nosuch_image) set_tests_properties (HL_TOOLS_h52gif_none PROPERTIES WILL_FAIL "true" FIXTURES_REQUIRED clear_tools_hl ) -#add_test (NAME HL_TOOLS_h52gifpal COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h52gif${tgt_ext}> testfiles/h52giftst.h5 image.gif -i palette) +#add_test (NAME HL_TOOLS_h52gifpal COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h52gif${tgt_file_ext}> testfiles/h52giftst.h5 image.gif -i palette) #set_tests_properties (HL_TOOLS_h52gifpal PROPERTIES # WILL_FAIL "true" # FIXTURES_REQUIRED clear_tools_hl #) -add_test (NAME HL_TOOLS_h52gif24bits COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h52gif${tgt_ext}> testfiles/ex_image2.h5 image24.gif -i image24bitpixel) +add_test (NAME HL_TOOLS_h52gif24bits COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h52gif${tgt_file_ext}> testfiles/ex_image2.h5 image24.gif -i image24bitpixel) set_tests_properties (HL_TOOLS_h52gif24bits PROPERTIES WILL_FAIL "true" FIXTURES_REQUIRED clear_tools_hl diff --git a/hl/tools/h5watch/CMakeTests.cmake b/hl/tools/h5watch/CMakeTests.cmake index 0424140..19d47cb 100644 --- a/hl/tools/h5watch/CMakeTests.cmake +++ b/hl/tools/h5watch/CMakeTests.cmake @@ -68,19 +68,13 @@ add_custom_target(H5WATCH_files ALL COMMENT "Copying files needed by H5WATCH tes ############################################################################## ############################################################################## - if (NOT BUILD_SHARED_LIBS) - set (tgt_ext "") - else () - set (tgt_ext "-shared") - endif () - macro (ADD_H5_TEST resultfile resultcode) if (NOT HDF5_ENABLE_USING_MEMCHECKER) add_test ( NAME H5WATCH_ARGS-h5watch-${resultfile} COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" - -D "TEST_PROGRAM=$<TARGET_FILE:h5watch${tgt_ext}>" + -D "TEST_PROGRAM=$<TARGET_FILE:h5watch${tgt_file_ext}>" -D "TEST_ARGS:STRING=${ARGN}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" -D "TEST_OUTPUT=${resultfile}.out" @@ -102,7 +96,7 @@ add_custom_target(H5WATCH_files ALL COMMENT "Copying files needed by H5WATCH tes NAME H5WATCH_ARGS-h5watch-${resultfile} COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" - -D "TEST_PROGRAM=$<TARGET_FILE:h5watch${tgt_ext}>" + -D "TEST_PROGRAM=$<TARGET_FILE:h5watch${tgt_file_ext}>" -D "TEST_ARGS:STRING=${ARGN}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" -D "TEST_OUTPUT=${resultfile}.out" @@ -131,7 +125,7 @@ add_custom_target(H5WATCH_files ALL COMMENT "Copying files needed by H5WATCH tes NAME H5WATCH-${resultfile} COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" - -D "TEST_PROGRAM=$<TARGET_FILE:h5watch${tgt_ext}>" + -D "TEST_PROGRAM=$<TARGET_FILE:h5watch${tgt_file_ext}>" -D "TEST_ARGS:STRING=${ARGN}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" -D "TEST_OUTPUT=${resultfile}.out" diff --git a/java/examples/datasets/JavaDatasetExample.sh.in b/java/examples/datasets/JavaDatasetExample.sh.in index f5c63cd..ae79416 100644 --- a/java/examples/datasets/JavaDatasetExample.sh.in +++ b/java/examples/datasets/JavaDatasetExample.sh.in @@ -324,16 +324,18 @@ else nerrors="`expr $nerrors + 1`" fi -echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_Gzip" -TESTING examples.datasets.H5Ex_D_Gzip -( -$RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_Gzip > H5Ex_D_Gzip.out -) -if diff H5Ex_D_Gzip.out examples.datasets.H5Ex_D_Gzip.txt > /dev/null; then - echo " PASSED datasets.H5Ex_D_Gzip" -else - echo "**FAILED** datasets.H5Ex_D_Gzip" - nerrors="`expr $nerrors + 1`" +if test $USE_FILTER_DEFLATE = "yes"; then + echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_Gzip" + TESTING examples.datasets.H5Ex_D_Gzip + ( + $RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_Gzip > H5Ex_D_Gzip.out + ) + if diff H5Ex_D_Gzip.out examples.datasets.H5Ex_D_Gzip.txt > /dev/null; then + echo " PASSED datasets.H5Ex_D_Gzip" + else + echo "**FAILED** datasets.H5Ex_D_Gzip" + nerrors="`expr $nerrors + 1`" + fi fi echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_Hyperslab" @@ -360,16 +362,18 @@ else nerrors="`expr $nerrors + 1`" fi -echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_Shuffle" -TESTING examples.datasets.H5Ex_D_Shuffle -( -$RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_Shuffle > H5Ex_D_Shuffle.out -) -if diff H5Ex_D_Shuffle.out examples.datasets.H5Ex_D_Shuffle.txt > /dev/null; then - echo " PASSED datasets.H5Ex_D_Shuffle" -else - echo "**FAILED** datasets.H5Ex_D_Shuffle" - nerrors="`expr $nerrors + 1`" +if test $USE_FILTER_DEFLATE = "yes"; then + echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_Shuffle" + TESTING examples.datasets.H5Ex_D_Shuffle + ( + $RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_Shuffle > H5Ex_D_Shuffle.out + ) + if diff H5Ex_D_Shuffle.out examples.datasets.H5Ex_D_Shuffle.txt > /dev/null; then + echo " PASSED datasets.H5Ex_D_Shuffle" + else + echo "**FAILED** datasets.H5Ex_D_Shuffle" + nerrors="`expr $nerrors + 1`" + fi fi if test $USE_FILTER_SZIP = "yes"; then diff --git a/java/src/hdf/hdf5lib/H5.java b/java/src/hdf/hdf5lib/H5.java index 5b704dd..872fbc7 100644 --- a/java/src/hdf/hdf5lib/H5.java +++ b/java/src/hdf/hdf5lib/H5.java @@ -10895,9 +10895,11 @@ public class H5 implements java.io.Serializable { /// VOL Connector Functionality public synchronized static native long H5VLregister_connector_by_name(String connector_name, long vipl_id); public synchronized static native long H5VLregister_connector_by_value(int connector_value, long vipl_id); - public synchronized static native boolean H5VLis_connector_registered(String name); + public synchronized static native boolean H5VLis_connector_registered_by_name(String name); + public synchronized static native boolean H5VLis_connector_registered_by_value(int connector_value); public synchronized static native long H5VLget_connector_id(long object_id); public synchronized static native long H5VLget_connector_id_by_name(String name); + public synchronized static native long H5VLget_connector_id_by_value(int connector_value); public synchronized static native String H5VLget_connector_name(long object_id); public synchronized static native void H5VLclose(long connector_id); public synchronized static native void H5VLunregister_connector(long connector_id); diff --git a/java/src/jni/h5Constants.c b/java/src/jni/h5Constants.c index 77a5d18..8fdca35 100644 --- a/java/src/jni/h5Constants.c +++ b/java/src/jni/h5Constants.c @@ -26,9 +26,8 @@ extern "C" { #include <stdlib.h> #include "h5jni.h" -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wmissing-prototypes" -#pragma GCC diagnostic ignored "-Wunused-parameter" +H5_GCC_DIAG_OFF(missing-prototypes) +H5_GCC_DIAG_OFF(unused-parameter) JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5_1QUARTER_1HADDR_1MAX(JNIEnv *env, jclass cls) { return (hsize_t)HADDR_MAX/4; } @@ -366,8 +365,7 @@ JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5ES_1STATUS_1CANCELED(JNIEnv *env, jclass cls) { return H5ES_STATUS_CANCELED; } /* Java does not have unsigned native types */ -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wsign-conversion" +H5_GCC_DIAG_OFF(sign-conversion) JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5F_1ACC_1CREAT(JNIEnv *env, jclass cls) { return H5F_ACC_CREAT; } JNIEXPORT jint JNICALL @@ -384,7 +382,7 @@ JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5F_1ACC_1SWMR_1READ(JNIEnv *env, jclass cls) { return H5F_ACC_SWMR_READ; } JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5F_1ACC_1SWMR_1WRITE(JNIEnv *env, jclass cls) { return H5F_ACC_SWMR_WRITE; } -#pragma GCC diagnostic pop +H5_GCC_DIAG_ON(sign-conversion) JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5F_1CLOSE_1DEFAULT(JNIEnv *env, jclass cls) { return H5F_CLOSE_DEFAULT; } @@ -1412,7 +1410,8 @@ Java_hdf_hdf5lib_HDF5Constants_H5Z_1SCALEOFFSET_1USER_1NPARMS(JNIEnv *env, jclas JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5Z_1FILTER_1ALL(JNIEnv *env, jclass cls) { return H5Z_FILTER_ALL; } -#pragma GCC diagnostic pop +H5_GCC_DIAG_ON(missing-prototypes) +H5_GCC_DIAG_ON(unused-parameter) #ifdef __cplusplus } /* end extern "C" */ diff --git a/java/src/jni/h5pDCPLImp.c b/java/src/jni/h5pDCPLImp.c index c43079f..f5bbcb1 100644 --- a/java/src/jni/h5pDCPLImp.c +++ b/java/src/jni/h5pDCPLImp.c @@ -1237,7 +1237,7 @@ done: */ JNIEXPORT jstring JNICALL Java_hdf_hdf5lib_H5_H5Pget_1virtual_1dsetname - (JNIEnv *env, jclass clss, jlong dcpl_id, jlong index) + (JNIEnv *env, jclass clss, jlong dcpl_id, jlong idx) { ssize_t buf_size; char *dname = NULL; @@ -1246,13 +1246,13 @@ Java_hdf_hdf5lib_H5_H5Pget_1virtual_1dsetname UNUSED(clss); /* get the length of the filename */ - if ((buf_size = H5Pget_virtual_dsetname((hid_t)dcpl_id, (size_t)index, NULL, 0)) < 0) + if ((buf_size = H5Pget_virtual_dsetname((hid_t)dcpl_id, (size_t) idx, NULL, 0)) < 0) H5_LIBRARY_ERROR(ENVONLY); if (NULL == (dname = (char *) HDmalloc(sizeof(char) * (size_t)buf_size + 1))) H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Pget_virtual_dsetname: memory allocation failed"); - if (H5Pget_virtual_dsetname((hid_t)dcpl_id, (size_t)index, dname, (size_t)buf_size + 1) < 0) + if (H5Pget_virtual_dsetname((hid_t)dcpl_id, (size_t) idx, dname, (size_t)buf_size + 1) < 0) H5_LIBRARY_ERROR(ENVONLY); dname[buf_size] = '\0'; @@ -1275,7 +1275,7 @@ done: */ JNIEXPORT jstring JNICALL Java_hdf_hdf5lib_H5_H5Pget_1virtual_1filename - (JNIEnv *env, jclass clss, jlong dcpl_id, jlong index) + (JNIEnv *env, jclass clss, jlong dcpl_id, jlong idx) { ssize_t buf_size; char *fname = NULL; @@ -1284,13 +1284,13 @@ Java_hdf_hdf5lib_H5_H5Pget_1virtual_1filename UNUSED(clss); /* get the length of the filename */ - if ((buf_size = H5Pget_virtual_filename((hid_t)dcpl_id, (size_t)index, NULL, 0)) < 0) + if ((buf_size = H5Pget_virtual_filename((hid_t)dcpl_id, (size_t) idx, NULL, 0)) < 0) H5_LIBRARY_ERROR(ENVONLY); if (NULL == (fname = (char *) HDmalloc(sizeof(char) * (size_t)buf_size + 1))) H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Pget_virtual_filename: memory allocation failed"); - if (H5Pget_virtual_filename((hid_t)dcpl_id, (size_t)index, fname, (size_t)buf_size + 1) < 0) + if (H5Pget_virtual_filename((hid_t)dcpl_id, (size_t) idx, fname, (size_t)buf_size + 1) < 0) H5_LIBRARY_ERROR(ENVONLY); fname[buf_size] = '\0'; @@ -1313,13 +1313,13 @@ done: */ JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_H5_H5Pget_1virtual_1srcspace - (JNIEnv *env, jclass clss, jlong dcpl_id, jlong index) + (JNIEnv *env, jclass clss, jlong dcpl_id, jlong idx) { hid_t space_id = H5I_INVALID_HID; UNUSED(clss); - if ((space_id = H5Pget_virtual_srcspace((hid_t)dcpl_id, (size_t)index)) < 0) + if ((space_id = H5Pget_virtual_srcspace((hid_t)dcpl_id, (size_t) idx)) < 0) H5_LIBRARY_ERROR(ENVONLY); done: @@ -1333,13 +1333,13 @@ done: */ JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_H5_H5Pget_1virtual_1vspace - (JNIEnv *env, jclass clss, jlong dcpl_id, jlong index) + (JNIEnv *env, jclass clss, jlong dcpl_id, jlong idx) { hid_t space_id = H5I_INVALID_HID; UNUSED(clss); - if ((space_id = H5Pget_virtual_vspace((hid_t)dcpl_id, (size_t)index)) < 0) + if ((space_id = H5Pget_virtual_vspace((hid_t)dcpl_id, (size_t) idx)) < 0) H5_LIBRARY_ERROR(ENVONLY); done: diff --git a/java/src/jni/h5plImp.c b/java/src/jni/h5plImp.c index b43b532..ce42842 100644 --- a/java/src/jni/h5plImp.c +++ b/java/src/jni/h5plImp.c @@ -129,7 +129,7 @@ done: */ JNIEXPORT void JNICALL Java_hdf_hdf5lib_H5_H5PLreplace - (JNIEnv *env, jclass clss, jobjectArray plugin_path, jint index) + (JNIEnv *env, jclass clss, jobjectArray plugin_path, jint idx) { const char *newPath = NULL; herr_t retVal = FAIL; @@ -139,12 +139,12 @@ Java_hdf_hdf5lib_H5_H5PLreplace if (NULL == plugin_path) H5_NULL_ARGUMENT_ERROR(ENVONLY, "H5PLreplace: new path is NULL"); - if (index < 0) + if (idx < 0) H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5PLreplace: index < 0"); PIN_JAVA_STRING(ENVONLY, plugin_path, newPath, NULL, "H5PLreplace: new path not pinned"); - if ((retVal = H5PLreplace(newPath, (unsigned) index)) < 0) + if ((retVal = H5PLreplace(newPath, (unsigned) idx)) < 0) H5_LIBRARY_ERROR(ENVONLY); done: @@ -159,7 +159,7 @@ done: */ JNIEXPORT void JNICALL Java_hdf_hdf5lib_H5_H5PLinsert - (JNIEnv *env, jclass clss, jobjectArray plugin_path, jint index) + (JNIEnv *env, jclass clss, jobjectArray plugin_path, jint idx) { const char *newPath = NULL; herr_t retVal = FAIL; @@ -169,12 +169,12 @@ Java_hdf_hdf5lib_H5_H5PLinsert if (NULL == plugin_path) H5_NULL_ARGUMENT_ERROR(ENVONLY, "H5PLinsert: new path is NULL"); - if (index < 0) + if (idx < 0) H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5PLinsert: index < 0"); PIN_JAVA_STRING(ENVONLY, plugin_path, newPath, NULL, "H5PLinsert: new path not pinned"); - if ((retVal = H5PLinsert(newPath, (unsigned) index)) < 0) + if ((retVal = H5PLinsert(newPath, (unsigned) idx)) < 0) H5_LIBRARY_ERROR(ENVONLY); done: @@ -189,14 +189,14 @@ done: */ JNIEXPORT void JNICALL Java_hdf_hdf5lib_H5_H5PLremove - (JNIEnv *env, jclass clss, jint index) + (JNIEnv *env, jclass clss, jint idx) { UNUSED(clss); - if (index < 0) + if (idx < 0) H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5PLremove: index < 0"); - if (H5PLremove((unsigned) index) < 0) + if (H5PLremove((unsigned) idx) < 0) H5_LIBRARY_ERROR(ENVONLY); done: @@ -210,7 +210,7 @@ done: */ JNIEXPORT jstring JNICALL Java_hdf_hdf5lib_H5_H5PLget - (JNIEnv *env, jclass clss, jint index) + (JNIEnv *env, jclass clss, jint idx) { jstring str = NULL; ssize_t buf_size; @@ -218,17 +218,17 @@ Java_hdf_hdf5lib_H5_H5PLget UNUSED(clss); - if (index < 0) + if (idx < 0) H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5PLget: index < 0"); /* Get the length of the name */ - if ((buf_size = H5PLget((unsigned) index, NULL, 0)) < 0) + if ((buf_size = H5PLget((unsigned) idx, NULL, 0)) < 0) H5_LIBRARY_ERROR(ENVONLY); if (NULL == (aName = (char *) HDmalloc(sizeof(char) * (size_t)buf_size + 1))) H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5PLget: failed to allocate plugin name buffer"); - if ((H5PLget((unsigned) index, aName, (size_t)buf_size + 1)) < 0) + if ((H5PLget((unsigned) idx, aName, (size_t)buf_size + 1)) < 0) H5_LIBRARY_ERROR(ENVONLY); aName[buf_size] = '\0'; diff --git a/java/src/jni/h5rImp.c b/java/src/jni/h5rImp.c index def27f4..e24fc2a 100644 --- a/java/src/jni/h5rImp.c +++ b/java/src/jni/h5rImp.c @@ -50,7 +50,7 @@ Java_hdf_hdf5lib_H5_H5Rcreate_1object PIN_JAVA_STRING(ENVONLY, name, refName, NULL, "H5Rcreate_object: reference name not pinned"); - if (NULL == (refBuf = (unsigned char *) HDcalloc((size_t) 1, H5R_REF_BUF_SIZE))) + if (NULL == (refBuf = HDcalloc(1, H5R_REF_BUF_SIZE))) H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Rcreate_object: failed to allocate reference buffer"); if ((status = H5Rcreate_object((hid_t)loc_id, refName, (hid_t)aid, (const H5R_ref_t *)refBuf)) < 0) @@ -93,7 +93,7 @@ Java_hdf_hdf5lib_H5_H5Rcreate_1region PIN_JAVA_STRING(ENVONLY, name, refName, NULL, "H5Rcreate_region: reference name not pinned"); - if (NULL == (refBuf = (unsigned char *) HDcalloc((size_t) 1, H5R_REF_BUF_SIZE))) + if (NULL == (refBuf = HDcalloc(1, H5R_REF_BUF_SIZE))) H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Rcreate_region: failed to allocate reference buffer"); if ((status = H5Rcreate_region((hid_t)loc_id, refName, space_id, (hid_t)aid, (const H5R_ref_t *)refBuf)) < 0) @@ -140,7 +140,7 @@ Java_hdf_hdf5lib_H5_H5Rcreate_1attr PIN_JAVA_STRING(ENVONLY, name, refName, NULL, "H5Rcreate_attr: reference name not pinned"); - if (NULL == (refBuf = (unsigned char *) HDcalloc((size_t) 1, H5R_REF_BUF_SIZE))) + if (NULL == (refBuf = HDcalloc(1, H5R_REF_BUF_SIZE))) H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Rcreate_attr: failed to allocate reference buffer"); if ((status = H5Rcreate_attr((hid_t)loc_id, refName, attrName, (hid_t)aid, (const H5R_ref_t *)refBuf)) < 0) @@ -314,7 +314,7 @@ Java_hdf_hdf5lib_H5_H5Rcopy PIN_BYTE_ARRAY(ENVONLY, src_ref, src_refBuf, &isCopy, "H5Rcopy: src reference buffer not pinned"); - if (NULL == (dst_refBuf = (unsigned char *) HDcalloc((size_t) 1, H5R_REF_BUF_SIZE))) + if (NULL == (dst_refBuf = HDcalloc(1, H5R_REF_BUF_SIZE))) H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Rcreate_attr: failed to allocate dst reference buffer"); if ((status = H5Rcopy((const H5R_ref_t *)src_refBuf, (const H5R_ref_t *)dst_refBuf)) < 0) @@ -504,7 +504,7 @@ Java_hdf_hdf5lib_H5_H5Rget_1file_1name if ((buf_size = H5Rget_file_name((const H5R_ref_t *)refBuf, NULL, 0)) < 0) H5_LIBRARY_ERROR(ENVONLY); - if (NULL == (namePtr = (char *) HDmalloc(sizeof(char) * (size_t)buf_size + 1))) + if (NULL == (namePtr = HDmalloc(sizeof(char) * (size_t)buf_size + 1))) H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Rget_file_name: malloc failed"); if ((check_size = H5Rget_file_name((const H5R_ref_t *)refBuf, namePtr, (size_t)buf_size + 1)) < 0) @@ -550,7 +550,7 @@ Java_hdf_hdf5lib_H5_H5Rget_1obj_1name if ((buf_size = H5Rget_obj_name((const H5R_ref_t *)refBuf, (hid_t)rapl_id, NULL, 0)) < 0) H5_LIBRARY_ERROR(ENVONLY); - if (NULL == (namePtr = (char *) HDmalloc(sizeof(char) * (size_t)buf_size + 1))) + if (NULL == (namePtr = HDmalloc(sizeof(char) * (size_t)buf_size + 1))) H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Rget_obj_name: malloc failed"); if ((check_size = H5Rget_obj_name((const H5R_ref_t *)refBuf, (hid_t)rapl_id, namePtr, (size_t)buf_size + 1)) < 0) @@ -596,7 +596,7 @@ Java_hdf_hdf5lib_H5_H5Rget_1attr_1name if ((buf_size = H5Rget_attr_name((const H5R_ref_t *)refBuf, NULL, 0)) < 0) H5_LIBRARY_ERROR(ENVONLY); - if (NULL == (namePtr = (char *) HDmalloc(sizeof(char) * (size_t)buf_size + 1))) + if (NULL == (namePtr = HDmalloc(sizeof(char) * (size_t)buf_size + 1))) H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Rget_attr_name: malloc failed"); if ((check_size = H5Rget_attr_name((const H5R_ref_t *)refBuf, namePtr, (size_t)buf_size + 1)) < 0) @@ -862,7 +862,7 @@ Java_hdf_hdf5lib_H5_H5Rget_1name PIN_BYTE_ARRAY(ENVONLY, ref, refBuf, &isCopy, "H5Rget_name: reference buffer not pinned"); - if (NULL == (aName = (char *) HDmalloc(sizeof(char) * (size_t)size + 1))) + if (NULL == (aName = HDmalloc(sizeof(char) * (size_t)size + 1))) H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Rget_name: failed to allocate referenced object name buffer"); if ((ret_val = (jlong)H5Rget_name((hid_t)loc_id, (H5R_type_t)ref_type, refBuf, aName, (size_t)size + 1)) < 0) diff --git a/java/src/jni/h5util.c b/java/src/jni/h5util.c index 55f7571..f45902f 100644 --- a/java/src/jni/h5util.c +++ b/java/src/jni/h5util.c @@ -28,6 +28,8 @@ extern "C" { #include "hdf5.h" #include "h5util.h" +#define SKIP_UNUSED_DUMP_ROUTINES + /* size of hyperslab buffer when a dataset is bigger than H5TOOLS_MALLOCSIZE */ hsize_t H5TOOLS_BUFSIZE = (32 * 1024 * 1024); /* 32 MB */ int H5TOOLS_TEXT_BLOCK = 16; /* Number of elements on a line in a text export file */ @@ -52,8 +54,10 @@ void *edata; /* Local Prototypes */ /********************/ +#ifndef SKIP_UNUSED_DUMP_ROUTINES static int h5str_dump_region_blocks(JNIEnv *env, h5str_t *str, hid_t region, hid_t region_obj); static int h5str_dump_region_points(JNIEnv *env, h5str_t *str, hid_t region, hid_t region_obj); +#endif static int h5str_is_zero(const void *_mem, size_t size); static hid_t h5str_get_native_type(hid_t type); static hid_t h5str_get_little_endian_type(hid_t type); @@ -708,7 +712,6 @@ h5str_sprintf unsigned char *ucptr = (unsigned char *) in_buf; static char fmt_llong[8], fmt_ullong[8]; H5T_class_t tclass = H5T_NO_CLASS; - H5T_str_t pad; size_t typeSize = 0; H5T_sign_t nsign = H5T_SGN_ERROR; hid_t mtid = H5I_INVALID_HID; @@ -814,7 +817,6 @@ h5str_sprintf else { tmp_str = cptr; } - pad = H5Tget_strpad(tid); /* Check for NULL pointer for string */ if (!tmp_str) { @@ -1482,6 +1484,7 @@ done: return ret_value; } /* end h5str_dump_region_blocks_data */ +#ifndef SKIP_UNUSED_DUMP_ROUTINES static int h5str_dump_region_blocks (JNIEnv *env, h5str_t *str, hid_t region, hid_t region_id) @@ -1569,6 +1572,7 @@ done: return ret_value; } /* end h5str_dump_region_blocks */ +#endif /*------------------------------------------------------------------------- * Purpose: Print the data values from a dataset referenced by region points. @@ -1701,6 +1705,7 @@ done: return ret_value; } /* end h5str_dump_region_points_data */ +#ifndef SKIP_UNUSED_DUMP_ROUTINES static int h5str_dump_region_points (JNIEnv *env, h5str_t *str, hid_t region, hid_t region_id) @@ -1776,6 +1781,7 @@ done: return ret_value; } /* end h5str_dump_region_points */ +#endif static int h5str_is_zero diff --git a/java/src/jni/h5vlImp.c b/java/src/jni/h5vlImp.c index 0fee343..1ead30b 100644 --- a/java/src/jni/h5vlImp.c +++ b/java/src/jni/h5vlImp.c @@ -78,11 +78,11 @@ done: /* * Class: hdf_hdf5lib_H5 - * Method: H5VLis_connector_registered + * Method: H5VLis_connector_registered_by_name * Signature: (Ljava/lang/String;)Z */ JNIEXPORT jboolean JNICALL -Java_hdf_hdf5lib_H5_H5VLis_1connector_1registered +Java_hdf_hdf5lib_H5_H5VLis_1connector_1registered_1by_1name (JNIEnv *env, jclass clss, jobject connector_name) { const char *volName = NULL; @@ -91,11 +91,11 @@ Java_hdf_hdf5lib_H5_H5VLis_1connector_1registered UNUSED(clss); if (NULL == connector_name) - H5_NULL_ARGUMENT_ERROR(ENVONLY, "H5VLis_connector_registered: VOL connector name is NULL"); + H5_NULL_ARGUMENT_ERROR(ENVONLY, "H5VLis_connector_registered_by_name: VOL connector name is NULL"); - PIN_JAVA_STRING(ENVONLY, connector_name, volName, NULL, "H5VLis_connector_registered: VOL connector name not pinned"); + PIN_JAVA_STRING(ENVONLY, connector_name, volName, NULL, "H5VLis_connector_registered_by_name: VOL connector name not pinned"); - if ((bval = H5VLis_connector_registered(volName)) < 0) + if ((bval = H5VLis_connector_registered_by_name(volName)) < 0) H5_LIBRARY_ERROR(ENVONLY); bval = (bval > 0) ? JNI_TRUE : JNI_FALSE; @@ -105,7 +105,32 @@ done: UNPIN_JAVA_STRING(ENVONLY, connector_name, volName); return (jboolean)bval; -} /* end Java_hdf_hdf5lib_H5_H5VLis_1connector_1registered */ +} /* end Java_hdf_hdf5lib_H5_H5VLis_1connector_1registered_1by_1name */ + +/* + * Class: hdf_hdf5lib_H5 + * Method: H5VLis_connector_registered_by_value + * Signature: (I)Z + */ +JNIEXPORT jboolean JNICALL +Java_hdf_hdf5lib_H5_H5VLis_1connector_1registered_1by_1value + (JNIEnv *env, jclass clss, jint connector_value) +{ + htri_t bval = JNI_FALSE; + + UNUSED(clss); + + if (connector_value < 0) + H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5VLis_connector_registered_by_value: VOL connector value < 0"); + + if ((bval = H5VLis_connector_registered_by_value((H5VL_class_value_t)connector_value)) < 0) + H5_LIBRARY_ERROR(ENVONLY); + + bval = (bval > 0) ? JNI_TRUE : JNI_FALSE; + +done: + return (jboolean)bval; +} /* end Java_hdf_hdf5lib_H5_H5VLis_1connector_1registered_1by_1value */ /* * Class: hdf_hdf5lib_H5 @@ -158,6 +183,29 @@ done: /* * Class: hdf_hdf5lib_H5 + * Method: H5VLget_connector_id_by_value + * Signature: (I)J + */ +JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_H5_H5VLget_1connector_1id_1by_1value + (JNIEnv *env, jclass clss, jint connector_value) +{ + hid_t status = H5I_INVALID_HID; + + UNUSED(clss); + + if (connector_value < 0) + H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5VLget_connector_id_by_value: VOL connector value < 0"); + + if ((status = H5VLget_connector_id_by_value((H5VL_class_value_t)connector_value)) < 0) + H5_LIBRARY_ERROR(ENVONLY); + +done: + return (jlong)status; +} /* end Java_hdf_hdf5lib_H5_H5VLget_1connector_1id_1by_1value */ + +/* + * Class: hdf_hdf5lib_H5 * Method: H5VLget_connector_name * Signature: (J)Ljava/lang/String; */ diff --git a/java/src/jni/h5vlImp.h b/java/src/jni/h5vlImp.h index 6dd7529..a58abef 100644 --- a/java/src/jni/h5vlImp.h +++ b/java/src/jni/h5vlImp.h @@ -40,15 +40,24 @@ Java_hdf_hdf5lib_H5_H5VLregister_1connector_1by_1value /* * Class: hdf_hdf5lib_H5 - * Method: H5VLis_connector_registered + * Method: H5VLis_connector_registered_by_name * Signature: (Ljava/lang/String;)Z */ JNIEXPORT jboolean JNICALL -Java_hdf_hdf5lib_H5_H5VLis_1connector_1registered +Java_hdf_hdf5lib_H5_H5VLis_1connector_1registered_1by_1name (JNIEnv *, jclass, jobject); /* * Class: hdf_hdf5lib_H5 + * Method: H5VLis_connector_registered_by_value + * Signature: (I)Z + */ +JNIEXPORT jboolean JNICALL +Java_hdf_hdf5lib_H5_H5VLis_1connector_1registered_1by_1value + (JNIEnv *, jclass, jint); + +/* + * Class: hdf_hdf5lib_H5 * Method: H5VLget_connector_id * Signature: (J)J */ @@ -67,6 +76,15 @@ Java_hdf_hdf5lib_H5_H5VLget_1connector_1id_1by_1name /* * Class: hdf_hdf5lib_H5 + * Method: H5VLget_connector_id_by_value + * Signature: (I)J + */ +JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_H5_H5VLget_1connector_1id_1by_1value + (JNIEnv *, jclass, jint); + +/* + * Class: hdf_hdf5lib_H5 * Method: H5VLget_connector_name * Signature: (J)Ljava/lang/String; */ diff --git a/java/test/TestH5VL.java b/java/test/TestH5VL.java index d774dbb..bd660d3 100644 --- a/java/test/TestH5VL.java +++ b/java/test/TestH5VL.java @@ -55,15 +55,18 @@ public class TestH5VL { try { boolean is_registered; - is_registered = H5.H5VLis_connector_registered(HDF5Constants.H5VL_NATIVE_NAME); - assertTrue("H5.H5VLis_connector_registered H5VL_NATIVE_NAME", is_registered); + is_registered = H5.H5VLis_connector_registered_by_name(HDF5Constants.H5VL_NATIVE_NAME); + assertTrue("H5.H5VLis_connector_registered_by_name H5VL_NATIVE_NAME", is_registered); - is_registered = H5.H5VLis_connector_registered("FAKE_VOL_NAME"); - assertFalse("H5.H5VLis_connector_registered FAKE_VOL_NAME", is_registered); + is_registered = H5.H5VLis_connector_registered_by_name("FAKE_VOL_NAME"); + assertFalse("H5.H5VLis_connector_registered_by_name FAKE_VOL_NAME", is_registered); + + is_registered = H5.H5VLis_connector_registered_by_value(HDF5Constants.H5VL_NATIVE_VALUE); + assertTrue("H5.H5VLis_connector_registered_by_value H5VL_NATIVE_VALUE", is_registered); } catch (Throwable err) { err.printStackTrace(); - fail("H5.H5VLis_connector_registered " + err); + fail("testH5VLnative_init(): " + err); } } @@ -113,6 +116,19 @@ public class TestH5VL { } @Test + public void testH5VLget_connector_id_by_value() { + try { + long native_id = H5.H5VLget_connector_id_by_value(HDF5Constants.H5VL_NATIVE_VALUE); + assertTrue("H5.H5VLget_connector_id_by_value H5VL_NATIVE_VALUE", native_id >= 0); + assertEquals(HDF5Constants.H5VL_NATIVE, native_id); + } + catch (Throwable err) { + err.printStackTrace(); + fail("H5.H5VLget_connector_id_by_value " + err); + } + } + + @Test public void testH5VLget_connector_name() { String H5_FILE = "testFvl.h5"; diff --git a/java/test/testfiles/JUnit-TestH5VL.txt b/java/test/testfiles/JUnit-TestH5VL.txt index f646009..ff94969 100644 --- a/java/test/testfiles/JUnit-TestH5VL.txt +++ b/java/test/testfiles/JUnit-TestH5VL.txt @@ -1,5 +1,6 @@ JUnit version 4.11 .testH5VLget_connector_id_by_name +.testH5VLget_connector_id_by_value .testH5VLget_connector_id .testH5VLnative_init .testH5VLget_connector_name @@ -8,5 +9,5 @@ JUnit version 4.11 Time: XXXX -OK (6 tests) +OK (7 tests) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 3cc0dea..33c2cb0 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -48,6 +48,15 @@ New Features Configuration: ------------- + - Added common warnings files for gnu and intel + + Added warnings files to use one common set of flags + during configure for both autotools and CMake build + systems. The initial implementation only affects a + general set of flags for gnu and intel compilers. + + (ADB - 2020/01/17) + - Added new options to CMake for control of testing Added CMake options (default ON); @@ -2037,7 +2037,7 @@ H5B_valid(H5F_t *f, const H5B_class_t *type, haddr_t addr) /* Get shared info for B-tree */ if(NULL == (rc_shared = (type->get_shared)(f, NULL))) HGOTO_ERROR(H5E_BTREE, H5E_CANTGET, FAIL, "can't retrieve B-tree's shared ref. count object") - HDassert((H5B_shared_t *)H5UC_GET_OBJ(rc_shared)); + HDassert(H5UC_GET_OBJ(rc_shared) != NULL); /* * Load the tree node. diff --git a/src/H5Cdbg.c b/src/H5Cdbg.c index 1f55e86..cb1d0e2 100644 --- a/src/H5Cdbg.c +++ b/src/H5Cdbg.c @@ -319,9 +319,8 @@ H5C_dump_cache_skip_list(H5C_t * cache_ptr, char * calling_fcn) (int)(entry_ptr->is_dirty), entry_ptr->type->name); - HDfprintf(stdout, " node_ptr = 0x%llx, item = %p\n", - (unsigned long long)node_ptr, - H5SL_item(node_ptr)); + HDfprintf(stdout, " node_ptr = %p, item = %p\n", + node_ptr, H5SL_item(node_ptr)); /* increment node_ptr before we delete its target */ node_ptr = H5SL_next(node_ptr); diff --git a/src/H5Cpkg.h b/src/H5Cpkg.h index cafc6d5..6608bc2 100644 --- a/src/H5Cpkg.h +++ b/src/H5Cpkg.h @@ -4694,7 +4694,7 @@ struct H5C_t { uint32_t num_last_entries; #if H5C_DO_SANITY_CHECKS int32_t slist_len_increase; - ssize_t slist_size_increase; + int64_t slist_size_increase; #endif /* H5C_DO_SANITY_CHECKS */ /* Fields for maintaining list of tagged entries */ diff --git a/src/H5Dchunk.c b/src/H5Dchunk.c index 33950a4..556e367 100644 --- a/src/H5Dchunk.c +++ b/src/H5Dchunk.c @@ -74,12 +74,12 @@ /* Sanity check on chunk index types: commonly used by a lot of routines in this file */ #define H5D_CHUNK_STORAGE_INDEX_CHK(storage) \ - HDassert((H5D_CHUNK_IDX_EARRAY == storage->idx_type && H5D_COPS_EARRAY == storage->ops) || \ - (H5D_CHUNK_IDX_FARRAY == storage->idx_type && H5D_COPS_FARRAY == storage->ops) || \ - (H5D_CHUNK_IDX_BT2 == storage->idx_type && H5D_COPS_BT2 == storage->ops) || \ - (H5D_CHUNK_IDX_BTREE == storage->idx_type && H5D_COPS_BTREE == storage->ops) || \ - (H5D_CHUNK_IDX_SINGLE == storage->idx_type && H5D_COPS_SINGLE == storage->ops) || \ - (H5D_CHUNK_IDX_NONE == storage->idx_type && H5D_COPS_NONE == storage->ops)); + HDassert((H5D_CHUNK_IDX_EARRAY == (storage)->idx_type && H5D_COPS_EARRAY == (storage)->ops) || \ + (H5D_CHUNK_IDX_FARRAY == (storage)->idx_type && H5D_COPS_FARRAY == (storage)->ops) || \ + (H5D_CHUNK_IDX_BT2 == (storage)->idx_type && H5D_COPS_BT2 == (storage)->ops) || \ + (H5D_CHUNK_IDX_BTREE == (storage)->idx_type && H5D_COPS_BTREE == (storage)->ops) || \ + (H5D_CHUNK_IDX_SINGLE == (storage)->idx_type && H5D_COPS_SINGLE == (storage)->ops) || \ + (H5D_CHUNK_IDX_NONE == (storage)->idx_type && H5D_COPS_NONE == (storage)->ops)); /* * Feature: If this constant is defined then every cache preemption and load @@ -936,7 +936,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5D__chunk_init(H5F_t *f, const H5D_t *dset, hid_t dapl_id) +H5D__chunk_init(H5F_t *f, const H5D_t * const dset, hid_t dapl_id) { H5D_chk_idx_info_t idx_info; /* Chunked index info */ H5D_rdcc_t *rdcc = &(dset->shared->cache.chunk); /* Convenience pointer to dataset's chunk cache */ @@ -1012,11 +1012,11 @@ H5D__chunk_init(H5F_t *f, const H5D_t *dset, hid_t dapl_id) idx_info.f = f; idx_info.pline = &dset->shared->dcpl_cache.pline; idx_info.layout = &dset->shared->layout.u.chunk; - idx_info.storage = &dset->shared->layout.storage.u.chunk; + idx_info.storage = sc; /* Allocate any indexing structures */ - if(dset->shared->layout.storage.u.chunk.ops->init && (dset->shared->layout.storage.u.chunk.ops->init)(&idx_info, dset->shared->space, dset->oloc.addr) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't initialize indexing information") + if(sc->ops->init && (sc->ops->init)(&idx_info, dset->shared->space, dset->oloc.addr) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't initialize indexing information") /* Set the number of chunks in dataset, etc. */ if(H5D__chunk_set_info(dset) < 0) @@ -1052,7 +1052,7 @@ H5D__chunk_is_space_alloc(const H5O_storage_t *storage) H5D_CHUNK_STORAGE_INDEX_CHK(sc); /* Query index layer */ - ret_value = (storage->u.chunk.ops->is_space_alloc)(&storage->u.chunk); + ret_value = (sc->ops->is_space_alloc)(sc); FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__chunk_is_space_alloc() */ @@ -2931,12 +2931,11 @@ H5D__chunk_dest(H5D_t *dset) idx_info.f = dset->oloc.file; idx_info.pline = &dset->shared->dcpl_cache.pline; idx_info.layout = &dset->shared->layout.u.chunk; - idx_info.storage = &dset->shared->layout.storage.u.chunk; + idx_info.storage = sc; /* Free any index structures */ - if(dset->shared->layout.storage.u.chunk.ops->dest && - (dset->shared->layout.storage.u.chunk.ops->dest)(&idx_info) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "unable to release chunk index info") + if(sc->ops->dest && (sc->ops->dest)(&idx_info) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "unable to release chunk index info") done: FUNC_LEAVE_NOAPI_TAG(ret_value) @@ -3132,11 +3131,11 @@ H5D__chunk_create(const H5D_t *dset /*in,out*/) idx_info.f = dset->oloc.file; idx_info.pline = &dset->shared->dcpl_cache.pline; idx_info.layout = &dset->shared->layout.u.chunk; - idx_info.storage = &dset->shared->layout.storage.u.chunk; + idx_info.storage = sc; /* Create the index for the chunks */ - if((dset->shared->layout.storage.u.chunk.ops->create)(&idx_info) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't create chunk index") + if((sc->ops->create)(&idx_info) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't create chunk index") done: FUNC_LEAVE_NOAPI(ret_value) @@ -3219,7 +3218,7 @@ H5D__chunk_lookup(const H5D_t *dset, const hsize_t *scaled, /* Initialize the query information about the chunk we are looking for */ udata->common.layout = &(dset->shared->layout.u.chunk); - udata->common.storage = &(dset->shared->layout.storage.u.chunk); + udata->common.storage = sc; udata->common.scaled = scaled; /* Reset information about the chunk we are looking for */ @@ -3269,7 +3268,7 @@ H5D__chunk_lookup(const H5D_t *dset, const hsize_t *scaled, idx_info.f = dset->oloc.file; idx_info.pline = &dset->shared->dcpl_cache.pline; idx_info.layout = &dset->shared->layout.u.chunk; - idx_info.storage = &dset->shared->layout.storage.u.chunk; + idx_info.storage = sc; #ifdef H5_HAVE_PARALLEL /* Disable collective metadata read for chunk indexes as it is @@ -3281,7 +3280,7 @@ H5D__chunk_lookup(const H5D_t *dset, const hsize_t *scaled, #endif /* H5_HAVE_PARALLEL */ /* Go get the chunk information */ - if((dset->shared->layout.storage.u.chunk.ops->get_addr)(&idx_info, udata) < 0) + if((sc->ops->get_addr)(&idx_info, udata) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't query chunk address") /* @@ -3367,7 +3366,7 @@ H5D__chunk_flush_entry(const H5D_t *dset, H5D_rdcc_ent_t *ent, hbool_t reset) /* Set up user data for index callbacks */ udata.common.layout = &dset->shared->layout.u.chunk; - udata.common.storage = &dset->shared->layout.storage.u.chunk; + udata.common.storage = sc; udata.common.scaled = ent->scaled; udata.chunk_block.offset = ent->chunk_block.offset; udata.chunk_block.length = dset->shared->layout.u.chunk.size; @@ -3452,7 +3451,7 @@ H5D__chunk_flush_entry(const H5D_t *dset, H5D_rdcc_ent_t *ent, hbool_t reset) idx_info.f = dset->oloc.file; idx_info.pline = &dset->shared->dcpl_cache.pline; idx_info.layout = &dset->shared->layout.u.chunk; - idx_info.storage = &dset->shared->layout.storage.u.chunk; + idx_info.storage = sc; /* Create the chunk it if it doesn't exist, or reallocate the chunk * if its size changed. @@ -3472,8 +3471,8 @@ H5D__chunk_flush_entry(const H5D_t *dset, H5D_rdcc_ent_t *ent, hbool_t reset) HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "unable to write raw data to file") /* Insert the chunk record into the index */ - if(need_insert && dset->shared->layout.storage.u.chunk.ops->insert) - if((dset->shared->layout.storage.u.chunk.ops->insert)(&idx_info, &udata, dset) < 0) + if(need_insert && sc->ops->insert) + if((sc->ops->insert)(&idx_info, &udata, dset) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINSERT, FAIL, "unable to insert chunk addr into index") /* Cache the chunk's info, in case it's accessed again shortly */ @@ -4282,10 +4281,10 @@ H5D__chunk_allocated(const H5D_t *dset, hsize_t *nbytes) idx_info.f = dset->oloc.file; idx_info.pline = &dset->shared->dcpl_cache.pline; idx_info.layout = &dset->shared->layout.u.chunk; - idx_info.storage = &dset->shared->layout.storage.u.chunk; + idx_info.storage = sc; /* Iterate over the chunks */ - if((dset->shared->layout.storage.u.chunk.ops->iterate)(&idx_info, H5D__chunk_allocated_cb, &chunk_bytes) < 0) + if((sc->ops->iterate)(&idx_info, H5D__chunk_allocated_cb, &chunk_bytes) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "unable to retrieve allocated chunk information from index") /* Set number of bytes for caller */ @@ -4484,7 +4483,7 @@ H5D__chunk_allocate(const H5D_io_info_t *io_info, hbool_t full_overwrite, hsize_ idx_info.f = dset->oloc.file; idx_info.pline = &dset->shared->dcpl_cache.pline; idx_info.layout = &dset->shared->layout.u.chunk; - idx_info.storage = &dset->shared->layout.storage.u.chunk; + idx_info.storage = sc; /* Loop over all chunks */ /* The algorithm is: @@ -4555,7 +4554,7 @@ H5D__chunk_allocate(const H5D_io_info_t *io_info, hbool_t full_overwrite, hsize_ HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "error looking up chunk address") #ifndef NDEBUG /* None of the chunks should be allocated */ - if(H5D_CHUNK_IDX_NONE != layout->storage.u.chunk.idx_type) { + if(H5D_CHUNK_IDX_NONE != sc->idx_type) { HDassert(!H5F_addr_defined(udata.chunk_block.offset)); } @@ -4630,7 +4629,7 @@ H5D__chunk_allocate(const H5D_io_info_t *io_info, hbool_t full_overwrite, hsize_ /* Initialize the chunk information */ udata.common.layout = &layout->u.chunk; - udata.common.storage = &layout->storage.u.chunk; + udata.common.storage = sc; udata.common.scaled = scaled; udata.chunk_block.offset = HADDR_UNDEF; H5_CHECKED_ASSIGN(udata.chunk_block.length, uint32_t, chunk_size, size_t); @@ -4780,7 +4779,6 @@ H5D__chunk_update_old_edge_chunks(H5D_t *dset, hsize_t old_dim[]) hsize_t max_edge_chunk_sc[H5O_LAYOUT_NDIMS]; /* largest offset of chunks that might need to be modified in each dimension */ hbool_t new_full_dim[H5O_LAYOUT_NDIMS]; /* Whether the plane of chunks in this dimension needs to be modified */ const H5O_layout_t *layout = &(dset->shared->layout); /* Dataset layout */ - const H5O_pline_t *pline = &(dset->shared->dcpl_cache.pline); /* I/O pipeline info */ hsize_t chunk_sc[H5O_LAYOUT_NDIMS]; /* Offset of current chunk */ const uint32_t *chunk_dim = layout->u.chunk.dim; /* Convenience pointer to chunk dimensions */ unsigned space_ndims; /* Dataset's space rank */ @@ -4791,7 +4789,6 @@ H5D__chunk_update_old_edge_chunks(H5D_t *dset, hsize_t old_dim[]) H5D_storage_t chk_store; /* Chunk storage information */ void *chunk; /* The file chunk */ hbool_t carry; /* Flag to indicate that chunk increment carrys to higher dimension (sorta) */ - const H5O_storage_chunk_t *sc = &(layout->storage.u.chunk); herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -4799,8 +4796,8 @@ H5D__chunk_update_old_edge_chunks(H5D_t *dset, hsize_t old_dim[]) /* Check args */ HDassert(dset && H5D_CHUNKED == layout->type); HDassert(layout->u.chunk.ndims > 0 && layout->u.chunk.ndims <= H5O_LAYOUT_NDIMS); - H5D_CHUNK_STORAGE_INDEX_CHK(sc); - HDassert(pline->nused > 0); + H5D_CHUNK_STORAGE_INDEX_CHK(&layout->storage.u.chunk); + HDassert(dset->shared->dcpl_cache.pline.nused > 0); HDassert(layout->u.chunk.flags & H5O_LAYOUT_CHUNK_DONT_FILTER_PARTIAL_BOUND_CHUNKS); @@ -5393,7 +5390,7 @@ H5D__chunk_prune_by_extent(H5D_t *dset, const hsize_t *old_dim) /* Initialize the user data for the iteration */ HDmemset(&udata, 0, sizeof udata); udata.common.layout = &layout->u.chunk; - udata.common.storage = &layout->storage.u.chunk; + udata.common.storage = sc; udata.common.scaled = scaled; udata.io_info = &chk_io_info; udata.idx_info = &idx_info; @@ -5406,7 +5403,7 @@ H5D__chunk_prune_by_extent(H5D_t *dset, const hsize_t *old_dim) /* Initialize user data for removal */ idx_udata.layout = &layout->u.chunk; - idx_udata.storage = &layout->storage.u.chunk; + idx_udata.storage = sc; /* Determine if partial edge chunk filters are disabled */ disable_edge_filters = (layout->u.chunk.flags @@ -5563,7 +5560,7 @@ H5D__chunk_prune_by_extent(H5D_t *dset, const hsize_t *old_dim) idx_udata.scaled = udata.common.scaled; /* Remove the chunk from disk */ - if((layout->storage.u.chunk.ops->remove)(&idx_info, &idx_udata) < 0) + if((sc->ops->remove)(&idx_info, &idx_udata) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTDELETE, FAIL, "unable to remove chunk entry from index") } /* end if */ } /* end else */ @@ -5693,17 +5690,17 @@ H5D__chunk_addrmap(const H5D_io_info_t *io_info, haddr_t chunk_addr[]) /* Set up user data for B-tree callback */ HDmemset(&udata, 0, sizeof(udata)); udata.common.layout = &dset->shared->layout.u.chunk; - udata.common.storage = &dset->shared->layout.storage.u.chunk; + udata.common.storage = sc; udata.chunk_addr = chunk_addr; /* Compose chunked index info struct */ idx_info.f = dset->oloc.file; idx_info.pline = &dset->shared->dcpl_cache.pline; idx_info.layout = &dset->shared->layout.u.chunk; - idx_info.storage = &dset->shared->layout.storage.u.chunk; + idx_info.storage = sc; /* Iterate over chunks to build mapping of chunk addresses */ - if((dset->shared->layout.storage.u.chunk.ops->iterate)(&idx_info, H5D__chunk_addrmap_cb, &udata) < 0) + if((sc->ops->iterate)(&idx_info, H5D__chunk_addrmap_cb, &udata) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "unable to iterate over chunk index to build address map") done: @@ -5734,7 +5731,6 @@ H5D__chunk_delete(H5F_t *f, H5O_t *oh, H5O_storage_t *storage) H5O_pline_t pline; /* I/O pipeline message */ hbool_t pline_read = FALSE; /* Whether the I/O pipeline message was read from the file */ htri_t exists; /* Flag if header message of interest exists */ - H5O_storage_chunk_t *sc = &(storage->u.chunk); herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -5743,7 +5739,7 @@ H5D__chunk_delete(H5F_t *f, H5O_t *oh, H5O_storage_t *storage) HDassert(f); HDassert(oh); HDassert(storage); - H5D_CHUNK_STORAGE_INDEX_CHK(sc); + H5D_CHUNK_STORAGE_INDEX_CHK(&storage->u.chunk); /* Check for I/O pipeline message */ if((exists = H5O_msg_exists_oh(oh, H5O_PLINE_ID)) < 0) @@ -6470,26 +6466,25 @@ H5D__chunk_bh_info(const H5O_loc_t *loc, H5O_t *oh, H5O_layout_t *layout, idx_info.f = loc->file; idx_info.pline = &pline; idx_info.layout = &layout->u.chunk; - idx_info.storage = &layout->storage.u.chunk; + idx_info.storage = sc; /* Get the dataspace for the dataset */ if(NULL == (space = H5S_read(loc))) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to load dataspace info from dataset header") /* Allocate any indexing structures */ - if(layout->storage.u.chunk.ops->init && (layout->storage.u.chunk.ops->init)(&idx_info, space, loc->addr) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't initialize indexing information") + if(sc->ops->init && (sc->ops->init)(&idx_info, space, loc->addr) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't initialize indexing information") idx_info_init = TRUE; /* Get size of index structure */ - if(layout->storage.u.chunk.ops->size && (layout->storage.u.chunk.ops->size)(&idx_info, index_size) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "unable to retrieve chunk index info") + if(sc->ops->size && (sc->ops->size)(&idx_info, index_size) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "unable to retrieve chunk index info") done: /* Free resources, if they've been initialized */ - if(idx_info_init && layout->storage.u.chunk.ops->dest && - (layout->storage.u.chunk.ops->dest)(&idx_info) < 0) - HDONE_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "unable to release chunk index info") + if(idx_info_init && sc->ops->dest && (sc->ops->dest)(&idx_info) < 0) + HDONE_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "unable to release chunk index info") if(pline_read && H5O_msg_reset(H5O_PLINE_ID, &pline) < 0) HDONE_ERROR(H5E_DATASET, H5E_CANTRESET, FAIL, "unable to reset I/O pipeline message") if(space && H5S_close(space) < 0) @@ -6576,14 +6571,14 @@ H5D__chunk_dump_index(H5D_t *dset, FILE *stream) H5D_chunk_it_ud4_t udata; /* User data for callback */ /* Display info for index */ - if((dset->shared->layout.storage.u.chunk.ops->dump)(&dset->shared->layout.storage.u.chunk, stream) < 0) + if((sc->ops->dump)(sc, stream) < 0) HGOTO_ERROR(H5E_DATASET, H5E_UNSUPPORTED, FAIL, "unable to dump chunk index info") /* Compose chunked index info struct */ idx_info.f = dset->oloc.file; idx_info.pline = &dset->shared->dcpl_cache.pline; idx_info.layout = &dset->shared->layout.u.chunk; - idx_info.storage = &dset->shared->layout.storage.u.chunk; + idx_info.storage = sc; /* Set up user data for callback */ udata.stream = stream; @@ -6592,7 +6587,7 @@ H5D__chunk_dump_index(H5D_t *dset, FILE *stream) udata.chunk_dim = dset->shared->layout.u.chunk.dim; /* Iterate over index and dump chunk info */ - if((dset->shared->layout.storage.u.chunk.ops->iterate)(&idx_info, H5D__chunk_dump_index_cb, &udata) < 0) + if((sc->ops->iterate)(&idx_info, H5D__chunk_dump_index_cb, &udata) < 0) HGOTO_ERROR(H5E_DATASET, H5E_BADITER, FAIL, "unable to iterate over chunk index to dump chunk info") } /* end if */ diff --git a/src/H5Dint.c b/src/H5Dint.c index 436a507..0d67fd0 100644 --- a/src/H5Dint.c +++ b/src/H5Dint.c @@ -133,11 +133,10 @@ H5FL_EXTERN(H5D_chunk_info_t); H5FL_BLK_EXTERN(type_conv); /* Disable warning for intentional identical branches here -QAK */ -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wlarger-than=" +H5_GCC_DIAG_OFF(larger-than=) /* Define a static "default" dataset structure to use to initialize new datasets */ static H5D_shared_t H5D_def_dset; -#pragma GCC diagnostic pop +H5_GCC_DIAG_ON(larger-than=) /* Dataset ID class */ static const H5I_class_t H5I_DATASET_CLS[1] = {{ diff --git a/src/H5Dio.c b/src/H5Dio.c index 0f4e703..3d49df7 100644 --- a/src/H5Dio.c +++ b/src/H5Dio.c @@ -1131,7 +1131,7 @@ H5D__ioinfo_adjust(H5D_io_info_t *io_info, const H5D_t *dset, uint32_t global_no_collective_cause; hbool_t local_error_message_previously_written = FALSE; hbool_t global_error_message_previously_written = FALSE; - size_t index; + size_t idx; size_t cause_strings_len; char local_no_collective_cause_string[512] = ""; char global_no_collective_cause_string[512] = ""; @@ -1153,8 +1153,11 @@ H5D__ioinfo_adjust(H5D_io_info_t *io_info, const H5D_t *dset, /* Append each of the "reason for breaking collective I/O" error messages to the * local and global no collective cause strings */ - for (cause = 1, index = 0; (cause < H5D_MPIO_NO_COLLECTIVE_MAX_CAUSE) && (index < cause_strings_len); cause <<= 1, index++) { - size_t cause_strlen = HDstrlen(cause_strings[index]); + for (cause = 1, idx = 0; + (cause < H5D_MPIO_NO_COLLECTIVE_MAX_CAUSE) && + (idx < cause_strings_len); + cause <<= 1, idx++) { + size_t cause_strlen = HDstrlen(cause_strings[idx]); if (cause & local_no_collective_cause) { /* Check if there were any previous error messages included. If so, prepend a semicolon @@ -1163,7 +1166,8 @@ H5D__ioinfo_adjust(H5D_io_info_t *io_info, const H5D_t *dset, if(local_error_message_previously_written) HDstrncat(local_no_collective_cause_string, "; ", 2); - HDstrncat(local_no_collective_cause_string, cause_strings[index], cause_strlen); + HDstrncat(local_no_collective_cause_string, + cause_strings[idx], cause_strlen); local_error_message_previously_written = TRUE; } /* end if */ @@ -1175,7 +1179,8 @@ H5D__ioinfo_adjust(H5D_io_info_t *io_info, const H5D_t *dset, if(global_error_message_previously_written) HDstrncat(global_no_collective_cause_string, "; ", 2); - HDstrncat(global_no_collective_cause_string, cause_strings[index], cause_strlen); + HDstrncat(global_no_collective_cause_string, + cause_strings[idx], cause_strlen); global_error_message_previously_written = TRUE; } /* end if */ @@ -1052,15 +1052,15 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Fget_fileno(hid_t file_id, unsigned long *fileno) +H5Fget_fileno(hid_t file_id, unsigned long *fnumber) { herr_t ret_value = SUCCEED; FUNC_ENTER_API(FAIL) - H5TRACE2("e", "i*Ul", file_id, fileno); + H5TRACE2("e", "i*Ul", file_id, fnumber); - /* If no fileno pointer was passed in, exit quietly */ - if(fileno) { + /* If no fnumber pointer was passed in, exit quietly */ + if(fnumber) { H5VL_object_t *vol_obj; /* File info */ /* Get the internal file structure */ @@ -1068,7 +1068,7 @@ H5Fget_fileno(hid_t file_id, unsigned long *fileno) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid file identifier") /* Get the flags */ - if((ret_value = H5VL_file_get(vol_obj, H5VL_FILE_GET_FILENO, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL, fileno)) < 0) + if((ret_value = H5VL_file_get(vol_obj, H5VL_FILE_GET_FILENO, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL, fnumber)) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "unable to get file's 'file number'") } /* end if */ diff --git a/src/H5FDdirect.c b/src/H5FDdirect.c index 33a0ef4..ce5e081 100644 --- a/src/H5FDdirect.c +++ b/src/H5FDdirect.c @@ -459,8 +459,8 @@ H5FD_direct_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxadd #endif h5_stat_t sb; H5P_genplist_t *plist; /* Property list */ - int *buf1, *buf2; - H5FD_t *ret_value; + void *buf1, *buf2; + H5FD_t *ret_value = NULL; FUNC_ENTER_NOAPI_NOINIT @@ -525,13 +525,13 @@ H5FD_direct_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxadd /* NOTE: Use HDmalloc and HDfree here to ensure compatibility with * HDposix_memalign. */ - buf1 = (int *)HDmalloc(sizeof(int)); + buf1 = HDmalloc(sizeof(int)); if(HDposix_memalign(&buf2, file->fa.mboundary, file->fa.fbsize) != 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, NULL, "HDposix_memalign failed") if(o_flags & O_CREAT) { - if(HDwrite(file->fd, (void*)buf1, sizeof(int))<0) { - if(HDwrite(file->fd, (void*)buf2, file->fa.fbsize)<0) + if(HDwrite(file->fd, buf1, sizeof(int))<0) { + if(HDwrite(file->fd, 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; @@ -540,8 +540,8 @@ H5FD_direct_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxadd HDftruncate(file->fd, (HDoff_t)0); } } else { - if(HDread(file->fd, (void*)buf1, sizeof(int))<0) { - if(HDread(file->fd, (void*)buf2, file->fa.fbsize)<0) + if(HDread(file->fd, buf1, sizeof(int))<0) { + if(HDread(file->fd, 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; @@ -549,7 +549,7 @@ H5FD_direct_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxadd if(o_flags & O_RDWR) { 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(HDwrite(file->fd, (void *)buf1, sizeof(int))<0) + if(HDwrite(file->fd, buf1, sizeof(int))<0) file->fa.must_align = TRUE; else file->fa.must_align = FALSE; diff --git a/src/H5FDfamily.c b/src/H5FDfamily.c index bc00403..d110ef7 100644 --- a/src/H5FDfamily.c +++ b/src/H5FDfamily.c @@ -619,8 +619,7 @@ done: * memb_name & temp in the code below, but early (4.4.7, at least) gcc only * allows diagnostic pragmas to be toggled outside of functions. */ -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wformat-nonliteral" +H5_GCC_DIAG_OFF(format-nonliteral) static H5FD_t * H5FD_family_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr) @@ -771,7 +770,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5FD_family_open() */ -#pragma GCC diagnostic pop +H5_GCC_DIAG_ON(format-nonliteral) /*------------------------------------------------------------------------- @@ -957,8 +956,7 @@ H5FD_family_get_eoa(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type) * memb_name in the code below, but early (4.4.7, at least) gcc only * allows diagnostic pragmas to be toggled outside of functions. */ -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wformat-nonliteral" +H5_GCC_DIAG_OFF(format-nonliteral) static herr_t H5FD_family_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t abs_eoa) { @@ -1025,7 +1023,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } -#pragma GCC diagnostic pop +H5_GCC_DIAG_ON(format-nonliteral) /*------------------------------------------------------------------------- diff --git a/src/H5FDmulti.c b/src/H5FDmulti.c index 800869d..d7fc88d 100644 --- a/src/H5FDmulti.c +++ b/src/H5FDmulti.c @@ -1961,8 +1961,7 @@ compute_next(H5FD_multi_t *file) * tmp in the code below, but early (4.4.7, at least) gcc only * allows diagnostic pragmas to be toggled outside of functions. */ -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wformat-nonliteral" +H5_GCC_DIAG_OFF(format-nonliteral) static int open_members(H5FD_multi_t *file) { @@ -1996,7 +1995,7 @@ open_members(H5FD_multi_t *file) return 0; } -#pragma GCC diagnostic pop +H5_GCC_DIAG_ON(format-nonliteral) #ifdef _H5private_H diff --git a/src/H5Fsuper_cache.c b/src/H5Fsuper_cache.c index f95f13d..f8a40b2 100644 --- a/src/H5Fsuper_cache.c +++ b/src/H5Fsuper_cache.c @@ -347,7 +347,7 @@ static herr_t H5F__cache_superblock_get_final_load_size(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED image_len, void *_udata, size_t *actual_len) { - const uint8_t *image = (const uint8_t *)_image; /* Pointer into raw data buffer */ + const uint8_t *image = _image; /* Pointer into raw data buffer */ H5F_superblock_cache_ud_t *udata = (H5F_superblock_cache_ud_t *)_udata; /* User data */ H5F_super_t sblock; /* Temporary file superblock */ htri_t ret_value = SUCCEED; /* Return value */ @@ -393,7 +393,7 @@ done: static htri_t H5F__cache_superblock_verify_chksum(const void *_image, size_t len, void *_udata) { - const uint8_t *image = (const uint8_t *)_image; /* Pointer into raw data buffer */ + const uint8_t *image = _image; /* Pointer into raw data buffer */ H5F_superblock_cache_ud_t *udata = (H5F_superblock_cache_ud_t *)_udata; /* User data */ uint32_t stored_chksum; /* Stored metadata checksum value */ uint32_t computed_chksum; /* Computed metadata checksum value */ @@ -439,7 +439,7 @@ H5F__cache_superblock_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUS { H5F_super_t *sblock = NULL; /* File's superblock */ H5F_superblock_cache_ud_t *udata = (H5F_superblock_cache_ud_t *)_udata; /* User data */ - const uint8_t *image = (const uint8_t *)_image; /* Pointer into raw data buffer */ + const uint8_t *image = _image; /* Pointer into raw data buffer */ H5F_super_t *ret_value = NULL; /* Return value */ FUNC_ENTER_STATIC @@ -664,7 +664,7 @@ H5F__cache_superblock_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_UNU void *_thing) { H5F_super_t *sblock = (H5F_super_t *)_thing; /* Pointer to the object */ - uint8_t *image = (uint8_t *)_image; /* Pointer into raw data buffer */ + uint8_t *image = _image; /* Pointer into raw data buffer */ haddr_t rel_eof; /* Relative EOF for file */ herr_t ret_value = SUCCEED; /* Return value */ @@ -870,7 +870,7 @@ static herr_t H5F__cache_drvrinfo_get_final_load_size(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED image_len, void *_udata, size_t *actual_len) { - const uint8_t *image = (const uint8_t *)_image; /* Pointer into raw data buffer */ + const uint8_t *image = _image; /* Pointer into raw data buffer */ H5F_drvrinfo_cache_ud_t *udata = (H5F_drvrinfo_cache_ud_t *)_udata; /* User data */ H5O_drvinfo_t drvrinfo; /* Driver info */ herr_t ret_value = SUCCEED; /* Return value */ @@ -916,7 +916,7 @@ H5F__cache_drvrinfo_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED { H5O_drvinfo_t *drvinfo = NULL; /* Driver info */ H5F_drvrinfo_cache_ud_t *udata = (H5F_drvrinfo_cache_ud_t *)_udata; /* User data */ - const uint8_t *image = (const uint8_t *)_image; /* Pointer into raw data buffer */ + const uint8_t *image = _image; /* Pointer into raw data buffer */ char drv_name[9]; /* Name of driver */ H5O_drvinfo_t *ret_value = NULL; /* Return value */ @@ -1010,7 +1010,7 @@ H5F__cache_drvrinfo_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_NDEBU void *_thing) { H5O_drvinfo_t *drvinfo = (H5O_drvinfo_t *)_thing; /* Pointer to the object */ - uint8_t *image = (uint8_t *)_image; /* Pointer into raw data buffer */ + uint8_t *image = _image; /* Pointer into raw data buffer */ uint8_t *dbuf; /* Pointer to beginning of driver info */ herr_t ret_value = SUCCEED; /* Return value */ @@ -210,13 +210,13 @@ done: *------------------------------------------------------------------------- */ herr_t -H5PLreplace(const char *search_path, unsigned int index) +H5PLreplace(const char *search_path, unsigned int idx) { unsigned num_paths; /* Current number of stored paths */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE2("e", "*sIu", search_path, index); + H5TRACE2("e", "*sIu", search_path, idx); /* Check args */ if (NULL == search_path) @@ -228,11 +228,11 @@ H5PLreplace(const char *search_path, unsigned int index) num_paths = H5PL__get_num_paths(); if (0 == num_paths) HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "path table is empty") - else if (index >= num_paths) + else if (idx >= num_paths) HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "index path out of bounds for table - can't be more than %u", (num_paths - 1)) /* Insert the search path into the path table */ - if (H5PL__replace_path(search_path, index) < 0) + if (H5PL__replace_path(search_path, idx) < 0) HGOTO_ERROR(H5E_PLUGIN, H5E_CANTINSERT, FAIL, "unable to replace search path") done: @@ -252,13 +252,13 @@ done: *------------------------------------------------------------------------- */ herr_t -H5PLinsert(const char *search_path, unsigned int index) +H5PLinsert(const char *search_path, unsigned int idx) { unsigned num_paths; /* Current number of stored paths */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE2("e", "*sIu", search_path, index); + H5TRACE2("e", "*sIu", search_path, idx); /* Check args */ if (NULL == search_path) @@ -268,11 +268,11 @@ H5PLinsert(const char *search_path, unsigned int index) /* Check index */ num_paths = H5PL__get_num_paths(); - if ((0 != num_paths) && (index >= num_paths)) + if ((0 != num_paths) && (idx >= num_paths)) HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "index path out of bounds for table - can't be more than %u", (num_paths - 1)) /* Insert the search path into the path table */ - if (H5PL__insert_path(search_path, index) < 0) + if (H5PL__insert_path(search_path, idx) < 0) HGOTO_ERROR(H5E_PLUGIN, H5E_CANTINSERT, FAIL, "unable to insert search path") done: @@ -294,23 +294,23 @@ done: *------------------------------------------------------------------------- */ herr_t -H5PLremove(unsigned int index) +H5PLremove(unsigned int idx) { unsigned num_paths; /* Current number of stored paths */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE1("e", "Iu", index); + H5TRACE1("e", "Iu", idx); /* Check index */ num_paths = H5PL__get_num_paths(); if (0 == num_paths) HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "path table is empty") - else if (index >= num_paths) + else if (idx >= num_paths) HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "index path out of bounds for table - can't be more than %u", (num_paths - 1)) /* Delete the search path from the path table */ - if (H5PL__remove_path(index) < 0) + if (H5PL__remove_path(idx) < 0) HGOTO_ERROR(H5E_PLUGIN, H5E_CANTDELETE, FAIL, "unable to remove search path") done: @@ -343,7 +343,7 @@ done: *------------------------------------------------------------------------- */ ssize_t -H5PLget(unsigned int index, char *path_buf, size_t buf_size) +H5PLget(unsigned int idx, char *path_buf, size_t buf_size) { unsigned num_paths; /* Current number of stored paths */ const char *path = NULL; /* path from table */ @@ -351,13 +351,13 @@ H5PLget(unsigned int index, char *path_buf, size_t buf_size) ssize_t ret_value = 0; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE3("Zs", "Iu*sz", index, path_buf, buf_size); + H5TRACE3("Zs", "Iu*sz", idx, path_buf, buf_size); /* Check index */ num_paths = H5PL__get_num_paths(); if (0 == num_paths) HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "path table is empty") - else if (index >= num_paths) + else if (idx >= num_paths) HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "index path out of bounds for table - can't be more than %u", (num_paths - 1)) /* Check if the search table is empty */ @@ -365,7 +365,7 @@ H5PLget(unsigned int index, char *path_buf, size_t buf_size) HGOTO_ERROR(H5E_PLUGIN, H5E_NOSPACE, (-1), "plugin search path table is empty") /* Get the path at the specified index and its length */ - if (NULL == (path = H5PL__get_path(index))) + if (NULL == (path = H5PL__get_path(idx))) HGOTO_ERROR(H5E_PLUGIN, H5E_BADVALUE, (-1), "no path stored at that index") path_len = HDstrlen(path); diff --git a/src/H5PLint.c b/src/H5PLint.c index 8dec14b..b69a788 100644 --- a/src/H5PLint.c +++ b/src/H5PLint.c @@ -304,8 +304,7 @@ done: * get_plugin_info function pointer, but early (4.4.7, at least) gcc * only allows diagnostic pragmas to be toggled outside of functions. */ -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wpedantic" +H5_GCC_DIAG_OFF(pedantic) herr_t H5PL__open(const char *path, H5PL_type_t type, const H5PL_key_t *key, hbool_t *success, const void **plugin_info) @@ -417,7 +416,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5PL__open() */ -#pragma GCC diagnostic pop +H5_GCC_DIAG_ON(pedantic) /*------------------------------------------------------------------------- diff --git a/src/H5PLpath.c b/src/H5PLpath.c index e270c73..ba23fd3 100644 --- a/src/H5PLpath.c +++ b/src/H5PLpath.c @@ -62,9 +62,9 @@ /* Local Prototypes */ /********************/ -static herr_t H5PL__insert_at(const char *path, unsigned int index); -static herr_t H5PL__make_space_at(unsigned int index); -static herr_t H5PL__replace_at(const char *path, unsigned int index); +static herr_t H5PL__insert_at(const char *path, unsigned int idx); +static herr_t H5PL__make_space_at(unsigned int idx); +static herr_t H5PL__replace_at(const char *path, unsigned int idx); static herr_t H5PL__expand_path_table(void); static herr_t H5PL__find_plugin_in_path(const H5PL_search_params_t *search_params, hbool_t *found, const char *dir, const void **plugin_info); @@ -105,7 +105,7 @@ static unsigned H5PL_path_capacity_g = H5PL_INITIAL_PATH_CAPACITY; *------------------------------------------------------------------------- */ static herr_t -H5PL__insert_at(const char *path, unsigned int index) +H5PL__insert_at(const char *path, unsigned int idx) { char *path_copy = NULL; /* copy of path string (for storing) */ herr_t ret_value = SUCCEED; /* Return value */ @@ -132,12 +132,12 @@ H5PL__insert_at(const char *path, unsigned int index) #endif /* H5_HAVE_WIN32_API */ /* If the table entry is in use, make some space */ - if (H5PL_paths_g[index]) - if (H5PL__make_space_at(index) < 0) + if (H5PL_paths_g[idx]) + if (H5PL__make_space_at(idx) < 0) HGOTO_ERROR(H5E_PLUGIN, H5E_NOSPACE, FAIL, "unable to make space in the table for the new entry") /* Insert the copy of the search path into the table at the specified index */ - H5PL_paths_g[index] = path_copy; + H5PL_paths_g[idx] = path_copy; H5PL_num_paths_g++; done: @@ -156,7 +156,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5PL__make_space_at(unsigned int index) +H5PL__make_space_at(unsigned int idx) { unsigned u; /* iterator */ herr_t ret_value = SUCCEED; /* Return value */ @@ -164,13 +164,13 @@ H5PL__make_space_at(unsigned int index) FUNC_ENTER_STATIC_NOERR /* Check args - Just assert on package functions */ - HDassert(index < H5PL_path_capacity_g); + HDassert(idx < H5PL_path_capacity_g); /* Copy the paths back to make a space */ - for (u = H5PL_num_paths_g; u > index; u--) + for (u = H5PL_num_paths_g; u > idx; u--) H5PL_paths_g[u] = H5PL_paths_g[u-1]; - H5PL_paths_g[index] = NULL; + H5PL_paths_g[idx] = NULL; FUNC_LEAVE_NOAPI(ret_value) } /* end H5PL__make_space_at() */ @@ -188,7 +188,7 @@ H5PL__make_space_at(unsigned int index) *------------------------------------------------------------------------- */ static herr_t -H5PL__replace_at(const char *path, unsigned int index) +H5PL__replace_at(const char *path, unsigned int idx) { char *path_copy = NULL; /* copy of path string (for storing) */ herr_t ret_value = SUCCEED; /* Return value */ @@ -200,8 +200,8 @@ H5PL__replace_at(const char *path, unsigned int index) HDassert(HDstrlen(path)); /* Check that the table entry is in use */ - if (!H5PL_paths_g[index]) - HGOTO_ERROR(H5E_PLUGIN, H5E_CANTFREE, FAIL, "path entry at index %u in the table is NULL", index) + if (!H5PL_paths_g[idx]) + HGOTO_ERROR(H5E_PLUGIN, H5E_CANTFREE, FAIL, "path entry at index %u in the table is NULL", idx) /* Copy the path for storage so the caller can dispose of theirs */ if (NULL == (path_copy = H5MM_strdup(path))) @@ -214,10 +214,10 @@ H5PL__replace_at(const char *path, unsigned int index) #endif /* H5_HAVE_WIN32_API */ /* Free the existing path entry */ - H5PL_paths_g[index] = (char *)H5MM_xfree(H5PL_paths_g[index]); + H5PL_paths_g[idx] = (char *)H5MM_xfree(H5PL_paths_g[idx]); /* Copy the search path into the table at the specified index */ - H5PL_paths_g[index] = path_copy; + H5PL_paths_g[idx] = path_copy; done: FUNC_LEAVE_NOAPI(ret_value) @@ -448,7 +448,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5PL__replace_path(const char *path, unsigned int index) +H5PL__replace_path(const char *path, unsigned int idx) { herr_t ret_value = SUCCEED; /* Return value */ @@ -457,10 +457,10 @@ H5PL__replace_path(const char *path, unsigned int index) /* Check args - Just assert on package functions */ HDassert(path); HDassert(HDstrlen(path)); - HDassert(index < H5PL_path_capacity_g); + HDassert(idx < H5PL_path_capacity_g); /* Insert the path at the requested index */ - if (H5PL__replace_at(path, index) < 0) + if (H5PL__replace_at(path, idx) < 0) HGOTO_ERROR(H5E_PLUGIN, H5E_CANTINSERT, FAIL, "unable to replace search path") done: @@ -479,7 +479,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5PL__insert_path(const char *path, unsigned int index) +H5PL__insert_path(const char *path, unsigned int idx) { herr_t ret_value = SUCCEED; /* Return value */ @@ -488,10 +488,10 @@ H5PL__insert_path(const char *path, unsigned int index) /* Check args - Just assert on package functions */ HDassert(path); HDassert(HDstrlen(path)); - HDassert(index < H5PL_path_capacity_g); + HDassert(idx < H5PL_path_capacity_g); /* Insert the path at the requested index */ - if (H5PL__insert_at(path, index) < 0) + if (H5PL__insert_at(path, idx) < 0) HGOTO_ERROR(H5E_PLUGIN, H5E_CANTINSERT, FAIL, "unable to insert search path") done: @@ -510,7 +510,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5PL__remove_path(unsigned int index) +H5PL__remove_path(unsigned int idx) { unsigned u; /* iterator */ herr_t ret_value = SUCCEED; /* Return value */ @@ -518,18 +518,18 @@ H5PL__remove_path(unsigned int index) FUNC_ENTER_PACKAGE /* Check args - Just assert on package functions */ - HDassert(index < H5PL_path_capacity_g); + HDassert(idx < H5PL_path_capacity_g); /* Check if the path at that index is set */ - if (!H5PL_paths_g[index]) - HGOTO_ERROR(H5E_PLUGIN, H5E_CANTDELETE, FAIL, "search path at index %u is NULL", index) + if (!H5PL_paths_g[idx]) + HGOTO_ERROR(H5E_PLUGIN, H5E_CANTDELETE, FAIL, "search path at index %u is NULL", idx) /* Delete the path */ H5PL_num_paths_g--; - H5PL_paths_g[index] = (char *)H5MM_xfree(H5PL_paths_g[index]); + H5PL_paths_g[idx] = (char *)H5MM_xfree(H5PL_paths_g[idx]); /* Shift the paths down to close the gap */ - for (u = index; u < H5PL_num_paths_g; u++) + for (u = idx; u < H5PL_num_paths_g; u++) H5PL_paths_g[u] = H5PL_paths_g[u+1]; /* Set the (former) last path to NULL */ @@ -551,17 +551,17 @@ done: *------------------------------------------------------------------------- */ const char * -H5PL__get_path(unsigned int index) +H5PL__get_path(unsigned int idx) { char *ret_value = NULL; /* Return value */ FUNC_ENTER_PACKAGE /* Get the path at the requested index */ - if (index >= H5PL_num_paths_g) - HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, NULL, "path index %u is out of range in table", index) + if (idx >= H5PL_num_paths_g) + HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, NULL, "path index %u is out of range in table", idx) - return H5PL_paths_g[index]; + return H5PL_paths_g[idx]; done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5PL__replace_path() */ diff --git a/src/H5PLplugin_cache.c b/src/H5PLplugin_cache.c index cd0b4d6..c58828f 100644 --- a/src/H5PLplugin_cache.c +++ b/src/H5PLplugin_cache.c @@ -253,8 +253,7 @@ done: /* See the other use of H5PL_GET_LIB_FUNC() for an explanation * for why we disable -Wpedantic here. */ -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wpedantic" +H5_GCC_DIAG_OFF(pedantic) herr_t H5PL__find_plugin_in_cache(const H5PL_search_params_t *search_params, hbool_t *found, const void **plugin_info) { @@ -303,5 +302,5 @@ H5PL__find_plugin_in_cache(const H5PL_search_params_t *search_params, hbool_t *f done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5PL__find_plugin_in_cache() */ -#pragma GCC diagnostic pop +H5_GCC_DIAG_ON(pedantic) diff --git a/src/H5Pdcpl.c b/src/H5Pdcpl.c index b83e2cf..09ba2ee 100644 --- a/src/H5Pdcpl.c +++ b/src/H5Pdcpl.c @@ -2353,7 +2353,7 @@ done: *------------------------------------------------------------------------- */ hid_t -H5Pget_virtual_vspace(hid_t dcpl_id, size_t index) +H5Pget_virtual_vspace(hid_t dcpl_id, size_t idx) { H5P_genplist_t *plist; /* Property list pointer */ H5O_layout_t layout; /* Layout information */ @@ -2361,7 +2361,7 @@ H5Pget_virtual_vspace(hid_t dcpl_id, size_t index) hid_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE2("i", "iz", dcpl_id, index); + H5TRACE2("i", "iz", dcpl_id, idx); /* Get the plist structure */ if(NULL == (plist = H5P_object_verify(dcpl_id, H5P_DATASET_CREATE))) @@ -2374,10 +2374,10 @@ H5Pget_virtual_vspace(hid_t dcpl_id, size_t index) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "not a virtual storage layout") /* Get the virtual space */ - if(index >= layout.storage.u.virt.list_nused) - HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "invalid index (out of range)") + if(idx >= layout.storage.u.virt.list_nused) + HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "invalid idx (out of range)") HDassert(layout.storage.u.virt.list_nused <= layout.storage.u.virt.list_nalloc); - if(NULL == (space = H5S_copy(layout.storage.u.virt.list[index].source_dset.virtual_select, FALSE, TRUE))) + if(NULL == (space = H5S_copy(layout.storage.u.virt.list[idx].source_dset.virtual_select, FALSE, TRUE))) HGOTO_ERROR(H5E_PLIST, H5E_CANTCOPY, FAIL, "unable to copy virtual selection") /* Register ID */ @@ -2411,7 +2411,7 @@ done: *------------------------------------------------------------------------- */ hid_t -H5Pget_virtual_srcspace(hid_t dcpl_id, size_t index) +H5Pget_virtual_srcspace(hid_t dcpl_id, size_t idx) { H5P_genplist_t *plist; /* Property list pointer */ H5O_layout_t layout; /* Layout information */ @@ -2419,7 +2419,7 @@ H5Pget_virtual_srcspace(hid_t dcpl_id, size_t index) hid_t ret_value = FAIL; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE2("i", "iz", dcpl_id, index); + H5TRACE2("i", "iz", dcpl_id, idx); /* Get the plist structure */ if(NULL == (plist = H5P_object_verify(dcpl_id, H5P_DATASET_CREATE))) @@ -2431,28 +2431,28 @@ H5Pget_virtual_srcspace(hid_t dcpl_id, size_t index) if(H5D_VIRTUAL != layout.type) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "not a virtual storage layout") - /* Check index */ - if(index >= layout.storage.u.virt.list_nused) - HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "invalid index (out of range)") + /* Check idx */ + if(idx >= layout.storage.u.virt.list_nused) + HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "invalid idx (out of range)") HDassert(layout.storage.u.virt.list_nused <= layout.storage.u.virt.list_nalloc); /* Attempt to open source dataset and patch extent if extent status is not * H5O_VIRTUAL_STATUS_CORRECT? -NAF */ /* If source space status is H5O_VIRTUAL_STATUS_INVALID, patch with bounds * of selection */ - if((H5O_VIRTUAL_STATUS_INVALID == layout.storage.u.virt.list[index].source_space_status) - && (layout.storage.u.virt.list[index].unlim_dim_source < 0)) { + if((H5O_VIRTUAL_STATUS_INVALID == layout.storage.u.virt.list[idx].source_space_status) + && (layout.storage.u.virt.list[idx].unlim_dim_source < 0)) { hsize_t bounds_start[H5S_MAX_RANK]; hsize_t bounds_end[H5S_MAX_RANK]; int rank; int i; /* Get rank of source space */ - if((rank = H5S_GET_EXTENT_NDIMS(layout.storage.u.virt.list[index].source_select)) < 0) + if((rank = H5S_GET_EXTENT_NDIMS(layout.storage.u.virt.list[idx].source_select)) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get source space rank") /* Get bounds of selection */ - if(H5S_SELECT_BOUNDS(layout.storage.u.virt.list[index].source_select, bounds_start, bounds_end) < 0) + if(H5S_SELECT_BOUNDS(layout.storage.u.virt.list[idx].source_select, bounds_start, bounds_end) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get selection bounds") /* Adjust bounds to extent */ @@ -2460,15 +2460,15 @@ H5Pget_virtual_srcspace(hid_t dcpl_id, size_t index) bounds_end[i]++; /* Set extent */ - if(H5S_set_extent_simple(layout.storage.u.virt.list[index].source_select, (unsigned)rank, bounds_end, NULL) < 0) + if(H5S_set_extent_simple(layout.storage.u.virt.list[idx].source_select, (unsigned)rank, bounds_end, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set source space extent") /* Update source space status */ - layout.storage.u.virt.list[index].source_space_status = H5O_VIRTUAL_STATUS_SEL_BOUNDS; + layout.storage.u.virt.list[idx].source_space_status = H5O_VIRTUAL_STATUS_SEL_BOUNDS; } /* end if */ /* Get the source space */ - if(NULL == (space = H5S_copy(layout.storage.u.virt.list[index].source_select, FALSE, TRUE))) + if(NULL == (space = H5S_copy(layout.storage.u.virt.list[idx].source_select, FALSE, TRUE))) HGOTO_ERROR(H5E_PLIST, H5E_CANTCOPY, FAIL, "unable to copy source selection") /* Register ID */ @@ -2515,7 +2515,7 @@ done: *------------------------------------------------------------------------- */ ssize_t -H5Pget_virtual_filename(hid_t dcpl_id, size_t index, char *name/*out*/, +H5Pget_virtual_filename(hid_t dcpl_id, size_t idx, char *name/*out*/, size_t size) { H5P_genplist_t *plist; /* Property list pointer */ @@ -2523,7 +2523,7 @@ H5Pget_virtual_filename(hid_t dcpl_id, size_t index, char *name/*out*/, ssize_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE4("Zs", "izxz", dcpl_id, index, name, size); + H5TRACE4("Zs", "izxz", dcpl_id, idx, name, size); /* Get the plist structure */ if(NULL == (plist = H5P_object_verify(dcpl_id, H5P_DATASET_CREATE))) @@ -2536,13 +2536,13 @@ H5Pget_virtual_filename(hid_t dcpl_id, size_t index, char *name/*out*/, HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "not a virtual storage layout") /* Get the virtual filename */ - if(index >= layout.storage.u.virt.list_nused) - HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "invalid index (out of range)") + if(idx >= layout.storage.u.virt.list_nused) + HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "invalid idx (out of range)") HDassert(layout.storage.u.virt.list_nused <= layout.storage.u.virt.list_nalloc); - HDassert(layout.storage.u.virt.list[index].source_file_name); + HDassert(layout.storage.u.virt.list[idx].source_file_name); if(name && (size > 0)) - (void)HDstrncpy(name, layout.storage.u.virt.list[index].source_file_name, size); - ret_value = (ssize_t)HDstrlen(layout.storage.u.virt.list[index].source_file_name); + (void)HDstrncpy(name, layout.storage.u.virt.list[idx].source_file_name, size); + ret_value = (ssize_t)HDstrlen(layout.storage.u.virt.list[idx].source_file_name); done: FUNC_LEAVE_API(ret_value) @@ -2578,7 +2578,7 @@ done: *------------------------------------------------------------------------- */ ssize_t -H5Pget_virtual_dsetname(hid_t dcpl_id, size_t index, char *name/*out*/, +H5Pget_virtual_dsetname(hid_t dcpl_id, size_t idx, char *name/*out*/, size_t size) { H5P_genplist_t *plist; /* Property list pointer */ @@ -2586,7 +2586,7 @@ H5Pget_virtual_dsetname(hid_t dcpl_id, size_t index, char *name/*out*/, ssize_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE4("Zs", "izxz", dcpl_id, index, name, size); + H5TRACE4("Zs", "izxz", dcpl_id, idx, name, size); /* Get the plist structure */ if(NULL == (plist = H5P_object_verify(dcpl_id, H5P_DATASET_CREATE))) @@ -2599,13 +2599,13 @@ H5Pget_virtual_dsetname(hid_t dcpl_id, size_t index, char *name/*out*/, HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "not a virtual storage layout") /* Get the virtual filename */ - if(index >= layout.storage.u.virt.list_nused) - HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "invalid index (out of range)") + if(idx >= layout.storage.u.virt.list_nused) + HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "invalid idx (out of range)") HDassert(layout.storage.u.virt.list_nused <= layout.storage.u.virt.list_nalloc); - HDassert(layout.storage.u.virt.list[index].source_dset_name); + HDassert(layout.storage.u.virt.list[idx].source_dset_name); if(name && (size > 0)) - (void)HDstrncpy(name, layout.storage.u.virt.list[index].source_dset_name, size); - ret_value = (ssize_t)HDstrlen(layout.storage.u.virt.list[index].source_dset_name); + (void)HDstrncpy(name, layout.storage.u.virt.list[idx].source_dset_name, size); + ret_value = (ssize_t)HDstrlen(layout.storage.u.virt.list[idx].source_dset_name); done: FUNC_LEAVE_API(ret_value) diff --git a/src/H5Tnative.c b/src/H5Tnative.c index 1d203c7..8859102 100644 --- a/src/H5Tnative.c +++ b/src/H5Tnative.c @@ -530,8 +530,7 @@ done: * the code below, but early (4.4.7, at least) gcc only allows * diagnostic pragmas to be toggled outside of functions. */ -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wduplicated-branches" +H5_GCC_DIAG_OFF(duplicated-branches) /*------------------------------------------------------------------------- * Function: H5T__get_native_integer @@ -672,7 +671,7 @@ H5T__get_native_integer(size_t prec, H5T_sign_t sign, H5T_direction_t direction, done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5T__get_native_integer() */ -#pragma GCC diagnostic pop +H5_GCC_DIAG_ON(duplicated-branches) /* Disable warning for intentional identical branches here -QAK */ /* @@ -680,8 +679,7 @@ done: * the code below, but early (4.4.7, at least) gcc only allows * diagnostic pragmas to be toggled outside of functions. */ -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wduplicated-branches" +H5_GCC_DIAG_OFF(duplicated-branches) /*------------------------------------------------------------------------- * Function: H5T__get_native_float @@ -806,7 +804,7 @@ H5T__get_native_float(size_t size, H5T_direction_t direction, size_t *struct_ali done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5T__get_native_float() */ -#pragma GCC diagnostic pop +H5_GCC_DIAG_ON(duplicated-branches) /* Disable warning for intentional identical branches here -QAK */ /* @@ -814,8 +812,7 @@ done: * the code below, but early (4.4.7, at least) gcc only allows * diagnostic pragmas to be toggled outside of functions. */ -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wduplicated-branches" +H5_GCC_DIAG_OFF(duplicated-branches) /*------------------------------------------------------------------------- * Function: H5T__get_native_bitfield @@ -901,7 +898,7 @@ H5T__get_native_bitfield(size_t prec, H5T_direction_t direction, done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5T__get_native_bitfield() */ -#pragma GCC diagnostic pop +H5_GCC_DIAG_ON(duplicated-branches) /*------------------------------------------------------------------------- @@ -216,9 +216,10 @@ done: /*------------------------------------------------------------------------- - * Function: H5VLis_connector_registered + * Function: H5VLis_connector_registered_by_name * * Purpose: Tests whether a VOL class has been registered or not + * according to a supplied connector name. * * Return: >0 if a VOL connector with that name has been registered * 0 if a VOL connector with that name has NOT been registered @@ -230,7 +231,7 @@ done: *------------------------------------------------------------------------- */ htri_t -H5VLis_connector_registered(const char *name) +H5VLis_connector_registered_by_name(const char *name) { htri_t ret_value = FALSE; /* Return value */ @@ -238,12 +239,41 @@ H5VLis_connector_registered(const char *name) H5TRACE1("t", "*s", name); /* Check if connector with this name is registered */ - if((ret_value = H5VL__is_connector_registered(name)) < 0) + if((ret_value = H5VL__is_connector_registered_by_name(name)) < 0) HGOTO_ERROR(H5E_VOL, H5E_CANTGET, FAIL, "can't check for VOL") done: FUNC_LEAVE_API(ret_value) -} /* end H5VLis_connector_registered() */ +} /* end H5VLis_connector_registered_by_name() */ + + +/*------------------------------------------------------------------------- + * Function: H5VLis_connector_registered_by_value + * + * Purpose: Tests whether a VOL class has been registered or not + * according to a supplied connector value (ID). + * + * Return: >0 if a VOL connector with that value has been registered + * 0 if a VOL connector with that value hasn't been registered + * <0 on errors + * + *------------------------------------------------------------------------- + */ +htri_t +H5VLis_connector_registered_by_value(H5VL_class_value_t connector_value) +{ + htri_t ret_value = FALSE; + + FUNC_ENTER_API(FAIL) + H5TRACE1("t", "VC", connector_value); + + /* Check if connector with this value is registered */ + if((ret_value = H5VL__is_connector_registered_by_value(connector_value)) < 0) + HGOTO_ERROR(H5E_VOL, H5E_CANTGET, FAIL, "can't check for VOL") + +done: + FUNC_LEAVE_API(ret_value) +} /* end H5VLis_connector_registered_by_value() */ /*------------------------------------------------------------------------- @@ -313,7 +343,38 @@ done: /*------------------------------------------------------------------------- - * Function: H5VLpeek_connector_id + * Function: H5VLget_connector_id_by_value + * + * Purpose: Retrieves the ID for a registered VOL connector. + * + * Return: A valid VOL connector ID if a connector with that value has + * been registered. This ID will need to be closed using + * H5VLclose(). + * + * H5I_INVALID_HID on error or if a VOL connector with that + * value has not been registered. + * + *------------------------------------------------------------------------- + */ +hid_t +H5VLget_connector_id_by_value(H5VL_class_value_t connector_value) +{ + hid_t ret_value = H5I_INVALID_HID; /* Return value */ + + FUNC_ENTER_API(H5I_INVALID_HID) + H5TRACE1("i", "VC", connector_value); + + /* Get connector ID with this value */ + if((ret_value = H5VL__get_connector_id_by_value(connector_value, TRUE)) < 0) + HGOTO_ERROR(H5E_VOL, H5E_CANTGET, H5I_INVALID_HID, "can't get VOL id") + +done: + FUNC_LEAVE_API(ret_value) +} /* end H5VLget_connector_id_by_value() */ + + +/*------------------------------------------------------------------------- + * Function: H5VLpeek_connector_id_by_name * * Purpose: Retrieves the ID for a registered VOL connector. * @@ -328,7 +389,7 @@ done: *------------------------------------------------------------------------- */ hid_t -H5VLpeek_connector_id(const char *name) +H5VLpeek_connector_id_by_name(const char *name) { hid_t ret_value = H5I_INVALID_HID; /* Return value */ @@ -336,12 +397,44 @@ H5VLpeek_connector_id(const char *name) H5TRACE1("i", "*s", name); /* Get connector ID with this name */ - if((ret_value = H5VL__peek_connector_id(name)) < 0) + if((ret_value = H5VL__peek_connector_id_by_name(name)) < 0) + HGOTO_ERROR(H5E_VOL, H5E_CANTGET, H5I_INVALID_HID, "can't get VOL id") + +done: + FUNC_LEAVE_API(ret_value) +} /* end H5VLpeek_connector_id_by_name() */ + + +/*------------------------------------------------------------------------- + * Function: H5VLpeek_connector_id_by_value + * + * Purpose: Retrieves the ID for a registered VOL connector. + * + * Return: A valid VOL connector ID if a connector with that value + * has been registered. This ID is *not* owned by the caller + * and H5VLclose() should not be called. Intended for use by + * VOL connectors to find their own ID. + * + * H5I_INVALID_HID on error or if a VOL connector with that + * value has not been registered. + * + *------------------------------------------------------------------------- + */ +hid_t +H5VLpeek_connector_id_by_value(H5VL_class_value_t value) +{ + hid_t ret_value = H5I_INVALID_HID; /* Return value */ + + FUNC_ENTER_API(H5I_INVALID_HID) + H5TRACE1("i", "VC", value); + + /* Get connector ID with this value */ + if((ret_value = H5VL__peek_connector_id_by_value(value)) < 0) HGOTO_ERROR(H5E_VOL, H5E_CANTGET, H5I_INVALID_HID, "can't get VOL id") done: FUNC_LEAVE_API(ret_value) -} /* end H5VLpeek_connector_id() */ +} /* end H5VLpeek_connector_id_by_value() */ /*------------------------------------------------------------------------- diff --git a/src/H5VLconnector.h b/src/H5VLconnector.h index 9bc3a7b..baa4cca 100644 --- a/src/H5VLconnector.h +++ b/src/H5VLconnector.h @@ -512,7 +512,8 @@ H5_DLL hid_t H5VLregister_connector(const H5VL_class_t *cls, hid_t vipl_id); H5_DLL void *H5VLobject(hid_t obj_id); H5_DLL hid_t H5VLget_file_type(void *file_obj, hid_t connector_id, hid_t dtype_id); -H5_DLL hid_t H5VLpeek_connector_id(const char *name); +H5_DLL hid_t H5VLpeek_connector_id_by_name(const char *name); +H5_DLL hid_t H5VLpeek_connector_id_by_value(H5VL_class_value_t value); #ifdef __cplusplus } diff --git a/src/H5VLint.c b/src/H5VLint.c index 9038d38..39b0f53 100644 --- a/src/H5VLint.c +++ b/src/H5VLint.c @@ -421,7 +421,7 @@ H5VL__set_def_conn(void) HGOTO_ERROR(H5E_VOL, H5E_BADVALUE, FAIL, "VOL connector environment variable set empty?") /* First, check to see if the connector is already registered */ - if((connector_is_registered = H5VL__is_connector_registered(tok)) < 0) + if((connector_is_registered = H5VL__is_connector_registered_by_name(tok)) < 0) HGOTO_ERROR(H5E_VOL, H5E_CANTGET, FAIL, "can't check if VOL connector already registered") else if(connector_is_registered) { /* Retrieve the ID of the already-registered VOL connector */ @@ -1325,7 +1325,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5VL__is_connector_registered + * Function: H5VL__is_connector_registered_by_name * * Purpose: Checks if a connector with a particular name is registered. * @@ -1338,7 +1338,7 @@ done: *------------------------------------------------------------------------- */ htri_t -H5VL__is_connector_registered(const char *name) +H5VL__is_connector_registered_by_name(const char *name) { H5VL_get_connector_ud_t op_data; /* Callback info for connector search */ htri_t ret_value = FALSE; /* Return value */ @@ -1360,7 +1360,44 @@ H5VL__is_connector_registered(const char *name) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5VL__is_connector_registered() */ +} /* end H5VL__is_connector_registered_by_name() */ + + +/*------------------------------------------------------------------------- + * Function: H5VL__is_connector_registered_by_value + * + * Purpose: Checks if a connector with a particular value (ID) is + * registered. + * + * Return: Success: 0 + * Failure: -1 + * + *------------------------------------------------------------------------- + */ +htri_t +H5VL__is_connector_registered_by_value(H5VL_class_value_t value) +{ + H5VL_get_connector_ud_t op_data; /* Callback info for connector search */ + htri_t ret_value = FALSE; /* Return value */ + + FUNC_ENTER_PACKAGE + + /* Set up op data for iteration */ + op_data.kind = H5VL_GET_CONNECTOR_BY_VALUE; + op_data.u.value = value; + op_data.found_id = H5I_INVALID_HID; + + /* Find connector with value */ + if(H5I_iterate(H5I_VOL, H5VL__get_connector_cb, &op_data, TRUE) < 0) + HGOTO_ERROR(H5E_VOL, H5E_BADITER, FAIL, "can't iterate over VOL connectors") + + /* Found a connector with that name */ + if(op_data.found_id != H5I_INVALID_HID) + ret_value = TRUE; + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5VL__is_connector_registered_by_value() */ /*------------------------------------------------------------------------- @@ -1419,7 +1456,7 @@ H5VL__get_connector_id_by_name(const char *name, hbool_t is_api) FUNC_ENTER_PACKAGE /* Find connector with name */ - if((ret_value = H5VL__peek_connector_id(name)) < 0) + if((ret_value = H5VL__peek_connector_id_by_name(name)) < 0) HGOTO_ERROR(H5E_VOL, H5E_BADITER, H5I_INVALID_HID, "can't find VOL connector") /* Found a connector with that name */ @@ -1432,18 +1469,50 @@ done: /*------------------------------------------------------------------------- - * Function: H5VL__peek_connector_id + * Function: H5VL__get_connector_id_by_value + * + * Purpose: Retrieves the ID for a registered VOL connector. + * + * Return: Positive if the VOL class has been registered + * Negative on error (if the class is not a valid class or + * not registered) + * + *------------------------------------------------------------------------- + */ +hid_t +H5VL__get_connector_id_by_value(H5VL_class_value_t value, hbool_t is_api) +{ + hid_t ret_value = H5I_INVALID_HID; /* Return value */ + + FUNC_ENTER_PACKAGE + + /* Find connector with value */ + if((ret_value = H5VL__peek_connector_id_by_value(value)) < 0) + HGOTO_ERROR(H5E_VOL, H5E_BADITER, H5I_INVALID_HID, "can't find VOL connector") + + /* Found a connector with that value */ + if(H5I_inc_ref(ret_value, is_api) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTINC, H5I_INVALID_HID, "unable to increment ref count on VOL connector") + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5VL__get_connector_id_by_value() */ + + +/*------------------------------------------------------------------------- + * Function: H5VL__peek_connector_id_by_name * * Purpose: Retrieves the ID for a registered VOL connector. Does not * increment the ref count * * Return: Positive if the VOL class has been registered - * Negative on error (if the class is not a valid class or not registered) + * Negative on error (if the class is not a valid class or + * not registered) * *------------------------------------------------------------------------- */ hid_t -H5VL__peek_connector_id(const char *name) +H5VL__peek_connector_id_by_name(const char *name) { H5VL_get_connector_ud_t op_data; /* Callback info for connector search */ hid_t ret_value = H5I_INVALID_HID; /* Return value */ @@ -1464,7 +1533,44 @@ H5VL__peek_connector_id(const char *name) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5VL__peek_connector_id() */ +} /* end H5VL__peek_connector_id_by_name() */ + + +/*------------------------------------------------------------------------- + * Function: H5VL__peek_connector_id_by_value + * + * Purpose: Retrieves the ID for a registered VOL connector. Does not + * increment the ref count + * + * Return: Positive if the VOL class has been registered + * Negative on error (if the class is not a valid class or + * not registered) + * + *------------------------------------------------------------------------- + */ +hid_t +H5VL__peek_connector_id_by_value(H5VL_class_value_t value) +{ + H5VL_get_connector_ud_t op_data; /* Callback info for connector search */ + hid_t ret_value = H5I_INVALID_HID; /* Return value */ + + FUNC_ENTER_PACKAGE + + /* Set up op data for iteration */ + op_data.kind = H5VL_GET_CONNECTOR_BY_VALUE; + op_data.u.value = value; + op_data.found_id = H5I_INVALID_HID; + + /* Find connector with value */ + if(H5I_iterate(H5I_VOL, H5VL__get_connector_cb, &op_data, TRUE) < 0) + HGOTO_ERROR(H5E_VOL, H5E_BADITER, H5I_INVALID_HID, "can't iterate over VOL connectors") + + /* Set return value */ + ret_value = op_data.found_id; + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5VL__peek_connector_id_by_value() */ /*------------------------------------------------------------------------- diff --git a/src/H5VLnative_file.c b/src/H5VLnative_file.c index 23ea37b..1f213dd 100644 --- a/src/H5VLnative_file.c +++ b/src/H5VLnative_file.c @@ -207,12 +207,12 @@ H5VL__native_file_get(void *obj, H5VL_file_get_t get_type, /* H5Fget_fileno */ case H5VL_FILE_GET_FILENO: { - unsigned long *fileno = HDva_arg(arguments, unsigned long *); + unsigned long *fno = HDva_arg(arguments, unsigned long *); unsigned long my_fileno = 0; f = (H5F_t *)obj; H5F_GET_FILENO(f, my_fileno); - *fileno = my_fileno; /* sigh */ + *fno = my_fileno; /* sigh */ break; } diff --git a/src/H5VLpassthru.c b/src/H5VLpassthru.c index 5c9f28c..8b3dc62 100644 --- a/src/H5VLpassthru.c +++ b/src/H5VLpassthru.c @@ -2788,22 +2788,24 @@ H5VL_pass_through_request_specific(void *obj, H5VL_request_specific_t specific_t /* Release requests that have completed */ if(H5VL_REQUEST_WAITANY == specific_type) { - size_t *index; /* Pointer to the index of completed request */ + size_t *idx; /* Pointer to the index of completed request */ H5ES_status_t *status; /* Pointer to the request's status */ /* Retrieve the remaining arguments */ - index = va_arg(tmp_arguments, size_t *); - assert(*index <= req_count); + idx = va_arg(tmp_arguments, size_t *); + assert(*idx <= req_count); status = va_arg(tmp_arguments, H5ES_status_t *); /* Reissue the WAITANY 'request specific' call */ - ret_value = H5VL_pass_through_request_specific_reissue(o->under_object, o->under_vol_id, specific_type, req_count, under_req_array, timeout, index, status); + ret_value = H5VL_pass_through_request_specific_reissue(o->under_object, o->under_vol_id, specific_type, req_count, under_req_array, timeout, + idx, + status); /* Release the completed request, if it completed */ if(ret_value >= 0 && *status != H5ES_STATUS_IN_PROGRESS) { H5VL_pass_through_t *tmp_o; - tmp_o = (H5VL_pass_through_t *)req_array[*index]; + tmp_o = (H5VL_pass_through_t *)req_array[*idx]; H5VL_pass_through_free_obj(tmp_o); } /* end if */ } /* end if */ diff --git a/src/H5VLpkg.h b/src/H5VLpkg.h index 5965adc..4174732 100644 --- a/src/H5VLpkg.h +++ b/src/H5VLpkg.h @@ -53,10 +53,13 @@ H5_DLL hid_t H5VL__register_connector_by_name(const char *name, hbool_t app_ref, hid_t vipl_id); H5_DLL hid_t H5VL__register_connector_by_value(H5VL_class_value_t value, hbool_t app_ref, hid_t vipl_id); -H5_DLL htri_t H5VL__is_connector_registered(const char *name); +H5_DLL htri_t H5VL__is_connector_registered_by_name(const char *name); +H5_DLL htri_t H5VL__is_connector_registered_by_value(H5VL_class_value_t value); H5_DLL hid_t H5VL__get_connector_id(hid_t obj_id, hbool_t is_api); H5_DLL hid_t H5VL__get_connector_id_by_name(const char *name, hbool_t is_api); -H5_DLL hid_t H5VL__peek_connector_id(const char *name); +H5_DLL hid_t H5VL__get_connector_id_by_value(H5VL_class_value_t value, hbool_t is_api); +H5_DLL hid_t H5VL__peek_connector_id_by_name(const char *name); +H5_DLL hid_t H5VL__peek_connector_id_by_value(H5VL_class_value_t value); H5_DLL herr_t H5VL__connector_str_to_info(const char *str, hid_t connector_id, void **info); H5_DLL ssize_t H5VL__get_connector_name(hid_t id, char *name/*out*/, size_t size); diff --git a/src/H5VLpublic.h b/src/H5VLpublic.h index 883aac8..006c3ea 100644 --- a/src/H5VLpublic.h +++ b/src/H5VLpublic.h @@ -42,7 +42,7 @@ /* * VOL connector identifiers. Values 0 through 255 are for connectors defined * by the HDF5 library. Values 256 through 511 are available for testing new - * filters. Subsequent values should be obtained from the HDF5 development + * connectors. Subsequent values should be obtained from the HDF5 development * team at help@hdfgroup.org. */ typedef int H5VL_class_value_t; @@ -60,14 +60,13 @@ typedef int H5VL_class_value_t; extern "C" { #endif -/* The H5VL types uses in the API calls are not opaque - they are defined in - * H5VLconnector.h, which is included at the top of this file. - */ H5_DLL hid_t H5VLregister_connector_by_name(const char *connector_name, hid_t vipl_id); H5_DLL hid_t H5VLregister_connector_by_value(H5VL_class_value_t connector_value, hid_t vipl_id); -H5_DLL htri_t H5VLis_connector_registered(const char *name); +H5_DLL htri_t H5VLis_connector_registered_by_name(const char *name); +H5_DLL htri_t H5VLis_connector_registered_by_value(H5VL_class_value_t connector_value); H5_DLL hid_t H5VLget_connector_id(hid_t obj_id); H5_DLL hid_t H5VLget_connector_id_by_name(const char *name); +H5_DLL hid_t H5VLget_connector_id_by_value(H5VL_class_value_t connector_value); H5_DLL ssize_t H5VLget_connector_name(hid_t id, char *name/*out*/, size_t size); H5_DLL herr_t H5VLclose(hid_t connector_id); H5_DLL herr_t H5VLunregister_connector(hid_t connector_id); @@ -215,8 +215,10 @@ herr_t H5Zregister(const void *cls) { const H5Z_class2_t *cls_real = (const H5Z_class2_t *) cls; /* "Real" class pointer */ - H5Z_class2_t cls_new; /* Translated class struct */ herr_t ret_value = SUCCEED; /* Return value */ +#ifndef H5_NO_DEPRECATED_SYMBOLS + H5Z_class2_t cls_new; /* Translated class struct */ +#endif FUNC_ENTER_API(FAIL) H5TRACE1("e", "*x", cls); diff --git a/src/H5detect.c b/src/H5detect.c index d01ee9f..655b05c 100644 --- a/src/H5detect.c +++ b/src/H5detect.c @@ -49,7 +49,7 @@ static const char *FileHeader = "\n\ /* Disable warning about cast increasing the alignment of the target type, * that's _exactly_ what this code is probing. -QAK */ -#pragma GCC diagnostic ignored "-Wcast-align" +H5_GCC_DIAG_OFF(cast-align) #if defined(__has_attribute) # if __has_attribute(no_sanitize_address) @@ -1707,3 +1707,4 @@ main(int argc, char *argv[]) return EXIT_SUCCESS; } +H5_GCC_DIAG_ON(cast-align) diff --git a/src/H5private.h b/src/H5private.h index fbea9b8..41cef16 100644 --- a/src/H5private.h +++ b/src/H5private.h @@ -1010,6 +1010,9 @@ typedef off_t h5_stat_size_t; #ifndef HDislower #define HDislower(C) islower((int)(C)) /*cast for solaris warning*/ #endif /* HDislower */ +#ifndef HDisnan + #define HDisnan(X) isnan(X) +#endif /* HDisnan */ #ifndef HDisprint #define HDisprint(C) isprint((int)(C)) /*cast for solaris warning*/ #endif /* HDisprint */ @@ -1594,7 +1597,7 @@ extern char *strdup(const char *s); srctype _tmp_src = (srctype)(src); \ dsttype _tmp_dst = (dsttype)(_tmp_src); \ HDassert(_tmp_src >= 0); \ - HDassert(_tmp_src == _tmp_dst); \ + HDassert(_tmp_src == (srctype)_tmp_dst); \ (dst) = _tmp_dst; \ } diff --git a/src/H5system.c b/src/H5system.c index 9310243..dd1f10d 100644 --- a/src/H5system.c +++ b/src/H5system.c @@ -107,8 +107,7 @@ static hbool_t H5_ntzset = FALSE; * format_templ in the code below, but early (4.4.7, at least) gcc only * allows diagnostic pragmas to be toggled outside of functions. */ -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wformat-nonliteral" +H5_GCC_DIAG_OFF(format-nonliteral) int HDfprintf(FILE *stream, const char *fmt, ...) { @@ -460,7 +459,7 @@ HDfprintf(FILE *stream, const char *fmt, ...) HDva_end(ap); return nout; } /* end HDfprintf() */ -#pragma GCC diagnostic pop +H5_GCC_DIAG_ON(format-nonliteral) /*------------------------------------------------------------------------- diff --git a/test/H5srcdir.h b/test/H5srcdir.h index 32fe8c9..b02d432 100644 --- a/test/H5srcdir.h +++ b/test/H5srcdir.h @@ -21,50 +21,19 @@ #define _H5SRCDIR_H /* Include the header file with the correct relative path for the srcdir string */ -#include "H5srcdir_str.h" - -/* Buffer to construct path in and return pointer to */ -static char srcdir_path[1024] = ""; - -/* Buffer to construct file in and return pointer to */ -static char srcdir_testpath[1024] = ""; +#ifdef __cplusplus +extern "C" { +#endif /* Just return the srcdir path */ -static const char * -H5_get_srcdir(void) -{ - const char *srcdir = HDgetenv("srcdir"); - - /* Check for using the srcdir from configure time */ - if(NULL == srcdir) - srcdir = config_srcdir; - - /* Build path to all test files */ - if((HDstrlen(srcdir) + 2) < sizeof(srcdir_path)) { - HDsnprintf(srcdir_path, sizeof(srcdir_path), "%s/", srcdir); - return(srcdir_path); - } /* end if */ - else - return(NULL); -} /* end H5_get_srcdir() */ +H5TEST_DLL const char *H5_get_srcdir(void); /* Append the test file name to the srcdir path and return the whole string */ -static const char *H5_get_srcdir_filename(const char *filename) -{ - const char *srcdir = H5_get_srcdir(); +H5TEST_DLL const char *H5_get_srcdir_filename(const char *filename); + +#ifdef __cplusplus +} +#endif - /* Check for error */ - if(NULL == srcdir) - return(NULL); - else { - /* Build path to test file */ - if((HDstrlen(srcdir) + HDstrlen(filename) + 1) < sizeof(srcdir_testpath)) { - HDsnprintf(srcdir_testpath, sizeof(srcdir_testpath), "%s%s", srcdir, filename); - return(srcdir_testpath); - } /* end if */ - else - return(NULL); - } /* end else */ -} /* end H5_get_srcdir_filename() */ #endif /* _H5SRCDIR_H */ @@ -281,8 +281,7 @@ error: * 'name' in the code below, but early (4.4.7, at least) gcc only * allows diagnostic pragmas to be toggled outside of functions. */ -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wformat-nonliteral" +H5_GCC_DIAG_OFF(format-nonliteral) static int enough_room(hid_t fapl) { @@ -323,7 +322,7 @@ done: return ret_value; } -#pragma GCC diagnostic pop +H5_GCC_DIAG_ON(format-nonliteral) /*------------------------------------------------------------------------- diff --git a/test/cache_common.h b/test/cache_common.h index 969cc2a..785dc21 100644 --- a/test/cache_common.h +++ b/test/cache_common.h @@ -25,6 +25,7 @@ /* Include library header files */ #include "H5ACprivate.h" +#include "H5MFprivate.h" #include "H5Cpkg.h" #include "H5Fpkg.h" #include "H5Iprivate.h" diff --git a/test/dsets.c b/test/dsets.c index 9926f10..2201d89 100644 --- a/test/dsets.c +++ b/test/dsets.c @@ -2331,9 +2331,9 @@ H5_ATTR_UNUSED hsize_t shuffle_size; /* Size of dataset with shuffle filter */ -#if(defined H5_HAVE_FILTER_DEFLATE | defined H5_HAVE_FILTER_SZIP) +#if defined(H5_HAVE_FILTER_DEFLATE) || defined(H5_HAVE_FILTER_SZIP) hsize_t combo_size; /* Size of dataset with multiple filters */ -#endif /* defined H5_HAVE_FILTER_DEFLATE | defined H5_HAVE_FILTER_SZIP */ +#endif /* defined(H5_HAVE_FILTER_DEFLATE) || defined(H5_HAVE_FILTER_SZIP) */ /* test the H5Zget_filter_info function */ if(test_get_filter_info() < 0) goto error; diff --git a/test/dt_arith.c b/test/dt_arith.c index 7e1adf5..8d04770 100644 --- a/test/dt_arith.c +++ b/test/dt_arith.c @@ -770,7 +770,7 @@ static int test_particular_fp_integer(void) /* Print errors */ if(dst_c != SCHAR_MAX) { - double x; + double x = 0.; signed char y; if(0 == fails_this_test++) @@ -814,7 +814,7 @@ static int test_particular_fp_integer(void) /* Print errors */ if(dst_i != fill_value) { - float x; + float x = 0.; int y; if(0 == fails_this_test++) @@ -2723,16 +2723,16 @@ my_isnan(dtype_t type, void *val) char s[256]; if (FLT_FLOAT==type) { - float x; + float x = 0.; HDmemcpy(&x, val, sizeof(float)); retval = (x!=x); } else if (FLT_DOUBLE==type) { - double x; + double x = 0.; HDmemcpy(&x, val, sizeof(double)); retval = (x!=x); #if H5_SIZEOF_LONG_DOUBLE!=H5_SIZEOF_DOUBLE && H5_SIZEOF_LONG_DOUBLE!=0 } else if (FLT_LDOUBLE==type) { - long double x; + long double x = 0.; HDmemcpy(&x, val, sizeof(long double)); retval = (x!=x); #endif @@ -2746,18 +2746,18 @@ my_isnan(dtype_t type, void *val) */ if (!retval) { if (FLT_FLOAT==type) { - float x; + float x = 0.; HDmemcpy(&x, val, sizeof(float)); HDsnprintf(s, sizeof(s), "%g", (double)x); } else if (FLT_DOUBLE==type) { - double x; + double x = 0.; HDmemcpy(&x, val, sizeof(double)); HDsnprintf(s, sizeof(s), "%g", x); #if H5_SIZEOF_LONG_DOUBLE!=H5_SIZEOF_DOUBLE && H5_SIZEOF_LONG_DOUBLE!=0 } else if (FLT_LDOUBLE==type) { - long double x; + long double x = 0.; HDmemcpy(&x, val, sizeof(long double)); HDsnprintf(s, sizeof(s), "%Lg", x); @@ -3197,7 +3197,7 @@ test_conv_flt_1 (const char *name, int run_test, hid_t src, hid_t dst) int check_expo[2]; if (FLT_FLOAT==dst_type) { - float x; + float x = 0.; HDmemcpy(&x, &buf[j*dst_size], sizeof(float)); if (underflow && HDfabsf(x) <= FLT_MIN && HDfabsf(hw_f) <= FLT_MIN) @@ -3208,7 +3208,7 @@ test_conv_flt_1 (const char *name, int run_test, hid_t src, hid_t dst) check_mant[0] = HDfrexpf(x, check_expo+0); check_mant[1] = HDfrexpf(hw_f, check_expo+1); } else if (FLT_DOUBLE==dst_type) { - double x; + double x = 0.; HDmemcpy(&x, &buf[j*dst_size], sizeof(double)); if (underflow && HDfabs(x) <= DBL_MIN && HDfabs(hw_d) <= DBL_MIN) @@ -3220,7 +3220,7 @@ test_conv_flt_1 (const char *name, int run_test, hid_t src, hid_t dst) check_mant[1] = HDfrexp(hw_d, check_expo+1); #if H5_SIZEOF_LONG_DOUBLE !=0 && (H5_SIZEOF_LONG_DOUBLE!=H5_SIZEOF_DOUBLE) } else { - long double x; + long double x = 0.; HDmemcpy(&x, &buf[j*dst_size], sizeof(long double)); /* dst is largest float, no need to check underflow. */ check_mant[0] = (double)HDfrexpl(x, check_expo+0); @@ -3265,16 +3265,16 @@ test_conv_flt_1 (const char *name, int run_test, hid_t src, hid_t dst) HDprintf(" %02x", saved[j*src_size+ENDIAN(src_size,k,sendian)]); HDprintf("%*s", (int)(3*MAX(0, (ssize_t)dst_size-(ssize_t)src_size)), ""); if (FLT_FLOAT==src_type) { - float x; + float x = 0.; HDmemcpy(&x, &saved[j*src_size], sizeof(float)); HDprintf(" %29.20e\n", (double)x); } else if (FLT_DOUBLE==src_type) { - double x; + double x = 0.; HDmemcpy(&x, &saved[j*src_size], sizeof(double)); HDprintf(" %29.20e\n", x); #if H5_SIZEOF_LONG_DOUBLE!=H5_SIZEOF_DOUBLE } else { - long double x; + long double x = 0.; HDmemcpy(&x, &saved[j*src_size], sizeof(long double)); HDfprintf(stdout," %29.20Le\n", x); #endif @@ -3285,16 +3285,16 @@ test_conv_flt_1 (const char *name, int run_test, hid_t src, hid_t dst) HDprintf(" %02x", buf[j*dst_size+ENDIAN(dst_size,k,dendian)]); HDprintf("%*s", (int)(3*MAX(0, (ssize_t)src_size-(ssize_t)dst_size)), ""); if (FLT_FLOAT==dst_type) { - float x; + float x = 0.; HDmemcpy(&x, &buf[j*dst_size], sizeof(float)); HDprintf(" %29.20e\n", (double)x); } else if (FLT_DOUBLE==dst_type) { - double x; + double x = 0.; HDmemcpy(&x, &buf[j*dst_size], sizeof(double)); HDprintf(" %29.20e\n", x); #if H5_SIZEOF_LONG_DOUBLE!=H5_SIZEOF_DOUBLE } else { - long double x; + long double x = 0.; HDmemcpy(&x, &buf[j*dst_size], sizeof(long double)); HDfprintf(stdout," %29.20Le\n", x); #endif diff --git a/test/error_test.c b/test/error_test.c index e99a82f..7c6cf9f 100644 --- a/test/error_test.c +++ b/test/error_test.c @@ -329,8 +329,7 @@ long_desc_cb(unsigned H5_ATTR_UNUSED n, const H5E_error2_t *err_desc, void *clie * 'full_desc' in the code below, but early (4.4.7, at least) gcc only * allows diagnostic pragmas to be toggled outside of functions. */ -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wformat-nonliteral" +H5_GCC_DIAG_OFF(format-nonliteral) static herr_t test_long_desc(void) { @@ -385,7 +384,7 @@ error: return -1; } /* end test_long_desc() */ -#pragma GCC diagnostic pop +H5_GCC_DIAG_ON(format-nonliteral) /*------------------------------------------------------------------------- diff --git a/test/fheap.c b/test/fheap.c index b8c54d6..7772ff7 100644 --- a/test/fheap.c +++ b/test/fheap.c @@ -545,8 +545,7 @@ get_fill_size(const fheap_test_param_t *tparam) * test_desc in the code below, but early (4.4.7, at least) gcc only * allows diagnostic pragmas to be toggled outside of functions. */ -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wformat-nonliteral" +H5_GCC_DIAG_OFF(format-nonliteral) static int begin_test(fheap_test_param_t *tparam, const char *base_desc, fheap_heap_ids_t *keep_ids, size_t *fill_size) @@ -575,7 +574,7 @@ begin_test(fheap_test_param_t *tparam, const char *base_desc, /* Success */ return(0); } /* end begin_test() */ -#pragma GCC diagnostic pop +H5_GCC_DIAG_ON(format-nonliteral) /*------------------------------------------------------------------------- diff --git a/test/file_image.c b/test/file_image.c index ddbec80..dfb3ae8 100644 --- a/test/file_image.c +++ b/test/file_image.c @@ -678,8 +678,7 @@ error: * 'member_file_name' in the code below, but early (4.4.7, at least) gcc only * allows diagnostic pragmas to be toggled outside of functions. */ -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wformat-nonliteral" +H5_GCC_DIAG_OFF(format-nonliteral) static int test_get_file_image(const char * test_banner, const int file_name_num, @@ -946,7 +945,7 @@ test_get_file_image(const char * test_banner, error: return 1; } /* end test_get_file_image() */ -#pragma GCC diagnostic pop +H5_GCC_DIAG_ON(format-nonliteral) /****************************************************************************** diff --git a/test/fillval.c b/test/fillval.c index b3e2e88..019744a 100644 --- a/test/fillval.c +++ b/test/fillval.c @@ -762,6 +762,11 @@ test_rdwr_cases(hid_t file, hid_t dcpl, const char *dname, void *_fillval, comp_datatype *buf_c=NULL; H5D_space_status_t allocation; + fill_c.a = 0; + fill_c.x = 0; + fill_c.y = 0; + fill_c.z = 0; + if(datatype == H5T_INTEGER) { fillval = *(int*)_fillval; } diff --git a/test/h5test.c b/test/h5test.c index ab859a5..78d0077 100644 --- a/test/h5test.c +++ b/test/h5test.c @@ -23,6 +23,7 @@ #include "h5test.h" #include "H5srcdir.h" +#include "H5srcdir_str.h" /* Necessary for h5_verify_cached_stabs() */ #define H5G_FRIEND /*suppress error about including H5Gpkg */ @@ -100,6 +101,12 @@ static const char *multi_letters = "msbrglo"; /* The # of seconds to wait for the message file--used by h5_wait_message() */ #define MESSAGE_TIMEOUT 300 /* Timeout in seconds */ +/* Buffer to construct path in and return pointer to */ +static char srcdir_path[1024] = ""; + +/* Buffer to construct file in and return pointer to */ +static char srcdir_testpath[1024] = ""; + /* The strings that correspond to library version bounds H5F_libver_t in H5Fpublic.h */ /* This is used by h5_get_version_string() */ const char *LIBVER_NAMES[] = { @@ -196,8 +203,7 @@ h5_clean_files(const char *base_name[], hid_t fapl) * sub_filename in the code below, but early (4.4.7, at least) gcc only * allows diagnostic pragmas to be toggled outside of functions. */ -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wformat-nonliteral" +H5_GCC_DIAG_OFF(format-nonliteral) void h5_delete_test_file(const char *base_name, hid_t fapl) { @@ -247,7 +253,7 @@ h5_delete_test_file(const char *base_name, hid_t fapl) return; } /* end h5_delete_test_file() */ -#pragma GCC diagnostic pop +H5_GCC_DIAG_ON(format-nonliteral) /*------------------------------------------------------------------------- @@ -1358,8 +1364,7 @@ h5_dump_info_object(MPI_Info info) * temp in the code below, but early (4.4.7, at least) gcc only * allows diagnostic pragmas to be toggled outside of functions. */ -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wformat-nonliteral" +H5_GCC_DIAG_OFF(format-nonliteral) h5_stat_size_t h5_get_file_size(const char *filename, hid_t fapl) { @@ -1461,7 +1466,7 @@ h5_get_file_size(const char *filename, hid_t fapl) return(-1); } /* end get_file_size() */ -#pragma GCC diagnostic pop +H5_GCC_DIAG_ON(format-nonliteral) /* * This routine is designed to provide equivalent functionality to 'printf' @@ -2038,3 +2043,56 @@ h5_get_version_string(H5F_libver_t libver) { return(LIBVER_NAMES[libver]); } /* end of h5_get_version_string */ + +/*------------------------------------------------------------------------- + * Function: H5_get_srcdir_filename + * + * Purpose: Append the test file name to the srcdir path and return the whole string + * + * Return: The string + * + *------------------------------------------------------------------------- + */ +const char *H5_get_srcdir_filename(const char *filename) +{ + const char *srcdir = H5_get_srcdir(); + + /* Check for error */ + if(NULL == srcdir) + return(NULL); + else { + /* Build path to test file */ + if((HDstrlen(srcdir) + HDstrlen(filename) + 1) < sizeof(srcdir_testpath)) { + HDsnprintf(srcdir_testpath, sizeof(srcdir_testpath), "%s%s", srcdir, filename); + return(srcdir_testpath); + } /* end if */ + else + return(NULL); + } /* end else */ +} /* end H5_get_srcdir_filename() */ + +/*------------------------------------------------------------------------- + * Function: H5_get_srcdir + * + * Purpose: Just return the srcdir path + * + * Return: The string + * + *------------------------------------------------------------------------- + */ +const char *H5_get_srcdir(void) +{ + const char *srcdir = HDgetenv("srcdir"); + + /* Check for using the srcdir from configure time */ + if(NULL == srcdir) + srcdir = config_srcdir; + + /* Build path to all test files */ + if((HDstrlen(srcdir) + 2) < sizeof(srcdir_path)) { + HDsnprintf(srcdir_path, sizeof(srcdir_path), "%s/", srcdir); + return(srcdir_path); + } /* end if */ + else + return(NULL); +} /* end H5_get_srcdir() */ @@ -19,6 +19,13 @@ #define H5I_FRIEND /*suppress error about including H5Ipkg */ #include "H5Ipkg.h" +static herr_t +free_wrapper(void *p) +{ + HDfree(p); + return SUCCEED; +} + /* Test basic functionality of registering and deleting types and IDs */ static int basic_id_test(void) { @@ -69,7 +76,7 @@ static int basic_id_test(void) goto out; /* Register a type */ - myType = H5Iregister_type((size_t)64, 0, (H5I_free_t) free ); + myType = H5Iregister_type((size_t)64, 0, free_wrapper); CHECK(myType, H5I_BADID, "H5Iregister_type"); if(myType == H5I_BADID) @@ -163,7 +170,7 @@ static int basic_id_test(void) H5E_END_TRY /* Register another type and another object in that type */ - myType = H5Iregister_type((size_t)64, 0, (H5I_free_t) free ); + myType = H5Iregister_type((size_t)64, 0, free_wrapper); CHECK(myType, H5I_BADID, "H5Iregister_type"); if(myType == H5I_BADID) @@ -238,7 +245,7 @@ out: /* A dummy search function for the next test */ -static int test_search_func(void H5_ATTR_UNUSED * ptr1, void H5_ATTR_UNUSED * ptr2) { return 0; } +static int test_search_func(void H5_ATTR_UNUSED * ptr1, hid_t H5_ATTR_UNUSED id, void H5_ATTR_UNUSED * ptr2) { return 0; } /* Ensure that public functions cannot access "predefined" ID types */ static int id_predefined_test(void ) @@ -264,7 +271,7 @@ static int id_predefined_test(void ) goto out; H5E_BEGIN_TRY - testPtr = H5Isearch(H5I_GENPROP_LST, (H5I_search_func_t) test_search_func, testObj); + testPtr = H5Isearch(H5I_GENPROP_LST, test_search_func, testObj); H5E_END_TRY CHECK_PTR_NULL(testPtr, "H5Isearch"); @@ -492,7 +499,7 @@ static int test_id_type_list(void) H5I_type_t testType; int i; /* Just a counter variable */ - startType = H5Iregister_type((size_t)8, 0, (H5I_free_t) free ); + startType = H5Iregister_type((size_t)8, 0, free_wrapper); CHECK(startType, H5I_BADID, "H5Iregister_type"); if(startType == H5I_BADID) goto out; @@ -507,7 +514,7 @@ static int test_id_type_list(void) /* Create types up to H5I_MAX_NUM_TYPES */ for(i = startType + 1; i < H5I_MAX_NUM_TYPES; i++) { - currentType = H5Iregister_type((size_t)8, 0, (H5I_free_t) free ); + currentType = H5Iregister_type((size_t)8, 0, free_wrapper); CHECK(currentType, H5I_BADID, "H5Iregister_type"); if(currentType == H5I_BADID) goto out; @@ -516,7 +523,7 @@ static int test_id_type_list(void) /* Wrap around to low type ID numbers */ for(i = H5I_NTYPES; i < startType; i++) { - currentType = H5Iregister_type((size_t)8, 0, (H5I_free_t) free ); + currentType = H5Iregister_type((size_t)8, 0, free_wrapper); CHECK(currentType, H5I_BADID, "H5Iregister_type"); if(currentType == H5I_BADID) goto out; @@ -524,7 +531,7 @@ static int test_id_type_list(void) /* There should be no room at the inn for a new ID type*/ H5E_BEGIN_TRY - testType = H5Iregister_type((size_t)8, 0, (H5I_free_t) free ); + testType = H5Iregister_type((size_t)8, 0, free_wrapper); H5E_END_TRY VERIFY(testType, H5I_BADID, "H5Iregister_type"); @@ -533,7 +540,7 @@ static int test_id_type_list(void) /* Now delete a type and try to insert again */ H5Idestroy_type(H5I_NTYPES); - testType = H5Iregister_type((size_t)8, 0, (H5I_free_t) free ); + testType = H5Iregister_type((size_t)8, 0, free_wrapper); VERIFY(testType, H5I_NTYPES, "H5Iregister_type"); if(testType != H5I_NTYPES) diff --git a/test/trefer.c b/test/trefer.c index fe237d7..32caf5e 100644 --- a/test/trefer.c +++ b/test/trefer.c @@ -2123,7 +2123,7 @@ test_reference_compat_conv(void) /* Allocate write & read buffers */ wbuf_obj = (hobj_ref_t *)HDcalloc(sizeof(hobj_ref_t), SPACE1_DIM1); rbuf_obj = HDcalloc(sizeof(H5R_ref_t), SPACE1_DIM1); - wbuf_reg = (hdset_reg_ref_t *)HDcalloc(sizeof(hdset_reg_ref_t), SPACE1_DIM1); + wbuf_reg = HDcalloc(sizeof(hdset_reg_ref_t), SPACE1_DIM1); rbuf_reg = HDcalloc(sizeof(H5R_ref_t), SPACE1_DIM1); /* Create file */ diff --git a/test/tvltypes.c b/test/tvltypes.c index a6ed60e..e8c69b4 100644 --- a/test/tvltypes.c +++ b/test/tvltypes.c @@ -2398,17 +2398,17 @@ test_vltypes_fill_value(void) typedef struct dtype1_struct { unsigned int gui; unsigned int pgui; - char *str_id; - char *str_name; - char *str_desc; - char *str_orig; - char *str_stat; + const char *str_id; + const char *str_name; + const char *str_desc; + const char *str_orig; + const char *str_stat; unsigned int ver; double val; double ma; double mi; - char *str_form; - char *str_unit; + const char *str_form; + const char *str_unit; } dtype1_struct; herr_t ret; diff --git a/test/use_common.c b/test/use_common.c index 9effa06..4111b24 100644 --- a/test/use_common.c +++ b/test/use_common.c @@ -343,44 +343,45 @@ int write_uc_file(hbool_t tosend, hid_t fid) count[1]=dims[1]; count[2]=dims[2]; for (i=0; i<UC_opts.nplanes; i++){ - /* fill buffer with value i+1 */ - bufptr = buffer; - for (j=0; j<dims[1]; j++) - for (k=0; k<dims[2]; k++) - *bufptr++ = (UC_CTYPE)i; + /* fill buffer with value i+1 */ + bufptr = buffer; + for (j=0; j<dims[1]; j++) + for (k=0; k<dims[2]; k++) + *bufptr++ = (UC_CTYPE)i; /* Cork the dataset's metadata in the cache, if SWMR is enabled */ - if(UC_opts.use_swmr) + if(UC_opts.use_swmr) { if(H5Odisable_mdc_flushes(dsid) < 0) { HDfprintf(stderr, "H5Odisable_mdc_flushes failed\n"); return -1; } + } - /* extend the dataset by one for new plane */ - dims[0]=i+1; + /* extend the dataset by one for new plane */ + dims[0]=i+1; if(H5Dset_extent(dsid, dims) < 0){ HDfprintf(stderr, "H5Dset_extent failed\n"); return -1; - } + } /* Get the dataset's dataspace */ if((f_sid = H5Dget_space(dsid)) < 0){ HDfprintf(stderr, "H5Dset_extent failed\n"); return -1; - } + } - start[0]=i; + start[0]=i; /* Choose the next plane to write */ if(H5Sselect_hyperslab(f_sid, H5S_SELECT_SET, start, NULL, count, NULL) < 0){ HDfprintf(stderr, "Failed H5Sselect_hyperslab\n"); return -1; - } + } /* Write plane to the dataset */ if(H5Dwrite(dsid, UC_DATATYPE, m_sid, f_sid, H5P_DEFAULT, buffer) < 0){ HDfprintf(stderr, "Failed H5Dwrite\n"); return -1; - } + } /* Uncork the dataset's metadata from the cache, if SWMR is enabled */ if(UC_opts.use_swmr) @@ -389,12 +390,11 @@ int write_uc_file(hbool_t tosend, hid_t fid) return -1; } - /* flush file to make the just written plane available. */ - if(H5Dflush(dsid) < 0) - { - HDfprintf(stderr, "Failed to H5Fflush file\n"); - return -1; - } + /* flush file to make the just written plane available. */ + if(H5Dflush(dsid) < 0) { + HDfprintf(stderr, "Failed to H5Fflush file\n"); + return -1; + } } /* Done writing. Free/Close all resources including data file */ @@ -562,6 +562,7 @@ test_direct(void) size_t mbound; size_t fbsize; size_t cbsize; + void *proto_points = NULL, *proto_check = NULL; int *points = NULL, *check = NULL, *p1 = NULL, *p2 = NULL; int wdata2[DSET2_DIM] = {11,12,13,14}; int rdata2[DSET2_DIM]; @@ -633,10 +634,12 @@ test_direct(void) /* Allocate aligned memory for data set 1. For data set 1, everything is aligned including * memory address, size of data, and file address. */ - if(0 != HDposix_memalign(&points, (size_t)FBSIZE, (size_t)(DSET1_DIM1 * DSET1_DIM2 * sizeof(int)))) + if(0 != HDposix_memalign(&proto_points, (size_t)FBSIZE, (size_t)(DSET1_DIM1 * DSET1_DIM2 * sizeof(int)))) TEST_ERROR; - if(0 != HDposix_memalign(&check, (size_t)FBSIZE, (size_t)(DSET1_DIM1 * DSET1_DIM2 * sizeof(int)))) + points = proto_points; + if(0 != HDposix_memalign(&proto_check, (size_t)FBSIZE, (size_t)(DSET1_DIM1 * DSET1_DIM2 * sizeof(int)))) TEST_ERROR; + check = proto_check; /* Initialize the dset1 */ p1 = points; @@ -746,10 +749,10 @@ error: H5Fclose(file); } H5E_END_TRY; - if(points) - HDfree(points); - if(check) - HDfree(check); + if(proto_points) + HDfree(proto_points); + if(proto_check) + HDfree(proto_check); return -1; #endif /*H5_HAVE_DIRECT*/ @@ -776,8 +779,7 @@ error: * 'first_name' in the code below, but early (4.4.7, at least) gcc only * allows diagnostic pragmas to be toggled outside of functions. */ -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wformat-nonliteral" +H5_GCC_DIAG_OFF(format-nonliteral) static herr_t test_family_opens(char *fname, hid_t fa_pl) { @@ -834,7 +836,7 @@ test_family_opens(char *fname, hid_t fa_pl) error: return -1; } /* end test_family_opens() */ -#pragma GCC diagnostic pop +H5_GCC_DIAG_ON(format-nonliteral) /*------------------------------------------------------------------------- @@ -1058,8 +1060,7 @@ error: * 'newname_individual', etc. in the code below, but early (4.4.7, at least) gcc only * allows diagnostic pragmas to be toggled outside of functions. */ -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wformat-nonliteral" +H5_GCC_DIAG_OFF(format-nonliteral) static herr_t test_family_compat(void) { @@ -1143,7 +1144,7 @@ error: return -1; } /* end test_family_compat() */ -#pragma GCC diagnostic pop +H5_GCC_DIAG_ON(format-nonliteral) /*------------------------------------------------------------------------- @@ -1282,8 +1283,7 @@ error: * 'sf_name' in the code below, but early (4.4.7, at least) gcc only * allows diagnostic pragmas to be toggled outside of functions. */ -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wformat-nonliteral" +H5_GCC_DIAG_OFF(format-nonliteral) static herr_t test_multi_opens(char *fname) { @@ -1301,7 +1301,7 @@ test_multi_opens(char *fname) return(fid >= 0 ? FAIL : SUCCEED); } /* end test_multi_opens() */ -#pragma GCC diagnostic pop +H5_GCC_DIAG_ON(format-nonliteral) /*------------------------------------------------------------------------- @@ -38,13 +38,14 @@ const char *FILENAME[] = { #define N_ELEMENTS 10 #define FAKE_VOL_NAME "fake" +#define FAKE_VOL_VALUE ((H5VL_class_value_t)501) /* A VOL class struct that describes a VOL class with no * functionality. */ static const H5VL_class_t fake_vol_g = { 0, /* version */ - (H5VL_class_value_t)501, /* value */ + FAKE_VOL_VALUE, /* value */ FAKE_VOL_NAME, /* name */ 0, /* capability flags */ NULL, /* initialize */ @@ -174,7 +175,11 @@ test_vol_registration(void) TESTING("VOL registration"); /* The test/fake VOL connector should not be registered at the start of the test */ - if ((is_registered = H5VLis_connector_registered(FAKE_VOL_NAME)) < 0) + if ((is_registered = H5VLis_connector_registered_by_name(FAKE_VOL_NAME)) < 0) + TEST_ERROR; + if (is_registered > 0) + FAIL_PUTS_ERROR("VOL connector is inappropriately registered"); + if ((is_registered = H5VLis_connector_registered_by_value(FAKE_VOL_VALUE)) < 0) TEST_ERROR; if (is_registered > 0) FAIL_PUTS_ERROR("VOL connector is inappropriately registered"); @@ -203,7 +208,11 @@ test_vol_registration(void) TEST_ERROR; /* The test/fake VOL connector should be registered now */ - if ((is_registered = H5VLis_connector_registered(FAKE_VOL_NAME)) < 0) + if ((is_registered = H5VLis_connector_registered_by_name(FAKE_VOL_NAME)) < 0) + TEST_ERROR; + if (0 == is_registered) + FAIL_PUTS_ERROR("VOL connector is un-registered"); + if ((is_registered = H5VLis_connector_registered_by_value(FAKE_VOL_VALUE)) < 0) TEST_ERROR; if (0 == is_registered) FAIL_PUTS_ERROR("VOL connector is un-registered"); @@ -213,7 +222,11 @@ test_vol_registration(void) TEST_ERROR; /* The test/fake VOL connector should still be registered now */ - if ((is_registered = H5VLis_connector_registered(FAKE_VOL_NAME)) < 0) + if ((is_registered = H5VLis_connector_registered_by_name(FAKE_VOL_NAME)) < 0) + TEST_ERROR; + if (0 == is_registered) + FAIL_PUTS_ERROR("VOL connector is un-registered"); + if ((is_registered = H5VLis_connector_registered_by_value(FAKE_VOL_VALUE)) < 0) TEST_ERROR; if (0 == is_registered) FAIL_PUTS_ERROR("VOL connector is un-registered"); @@ -223,7 +236,11 @@ test_vol_registration(void) TEST_ERROR; /* The test/fake VOL connector should still be registered now */ - if ((is_registered = H5VLis_connector_registered(FAKE_VOL_NAME)) < 0) + if ((is_registered = H5VLis_connector_registered_by_name(FAKE_VOL_NAME)) < 0) + TEST_ERROR; + if (0 == is_registered) + FAIL_PUTS_ERROR("VOL connector is un-registered"); + if ((is_registered = H5VLis_connector_registered_by_value(FAKE_VOL_VALUE)) < 0) TEST_ERROR; if (0 == is_registered) FAIL_PUTS_ERROR("VOL connector is un-registered"); @@ -272,7 +289,12 @@ test_native_vol_init(void) TESTING("Native VOL connector initialization"); /* The native VOL connector should always be registered */ - if ((is_registered = H5VLis_connector_registered(H5VL_NATIVE_NAME)) < 0) + if ((is_registered = H5VLis_connector_registered_by_name(H5VL_NATIVE_NAME)) < 0) + TEST_ERROR; + if (0 == is_registered) + FAIL_PUTS_ERROR("native VOL connector is un-registered"); + + if ((is_registered = H5VLis_connector_registered_by_value(H5VL_NATIVE_VALUE)) < 0) TEST_ERROR; if (0 == is_registered) FAIL_PUTS_ERROR("native VOL connector is un-registered"); diff --git a/test/vol_plugin.c b/test/vol_plugin.c index e4f171b..565c847 100644 --- a/test/vol_plugin.c +++ b/test/vol_plugin.c @@ -43,7 +43,7 @@ test_registration_by_value(void) TESTING("VOL registration by value"); /* The null VOL connector should not be registered at the start of the test */ - if((is_registered = H5VLis_connector_registered(NULL_VOL_CONNECTOR_NAME)) < 0) + if((is_registered = H5VLis_connector_registered_by_value(NULL_VOL_CONNECTOR_VALUE)) < 0) TEST_ERROR; if(TRUE == is_registered) FAIL_PUTS_ERROR("NULL VOL connector is inappropriately registered"); @@ -53,7 +53,7 @@ test_registration_by_value(void) TEST_ERROR; /* The connector should be registered now */ - if((is_registered = H5VLis_connector_registered(NULL_VOL_CONNECTOR_NAME)) < 0) + if((is_registered = H5VLis_connector_registered_by_value(NULL_VOL_CONNECTOR_VALUE)) < 0) TEST_ERROR; if(FALSE == is_registered) FAIL_PUTS_ERROR("NULL VOL connector was not registered"); @@ -63,7 +63,7 @@ test_registration_by_value(void) TEST_ERROR; /* The connector should not be registered now */ - if((is_registered = H5VLis_connector_registered(NULL_VOL_CONNECTOR_NAME)) < 0) + if((is_registered = H5VLis_connector_registered_by_value(NULL_VOL_CONNECTOR_VALUE)) < 0) TEST_ERROR; if(TRUE == is_registered) FAIL_PUTS_ERROR("NULL VOL connector is inappropriately registered"); @@ -99,7 +99,7 @@ test_registration_by_name(void) TESTING("VOL registration by name"); /* The null VOL connector should not be registered at the start of the test */ - if((is_registered = H5VLis_connector_registered(NULL_VOL_CONNECTOR_NAME)) < 0) + if((is_registered = H5VLis_connector_registered_by_name(NULL_VOL_CONNECTOR_NAME)) < 0) TEST_ERROR; if(TRUE == is_registered) FAIL_PUTS_ERROR("NULL VOL connector is inappropriately registered"); @@ -109,7 +109,7 @@ test_registration_by_name(void) TEST_ERROR; /* The connector should be registered now */ - if((is_registered = H5VLis_connector_registered(NULL_VOL_CONNECTOR_NAME)) < 0) + if((is_registered = H5VLis_connector_registered_by_name(NULL_VOL_CONNECTOR_NAME)) < 0) TEST_ERROR; if(FALSE == is_registered) FAIL_PUTS_ERROR("NULL VOL connector was not registered"); @@ -119,7 +119,7 @@ test_registration_by_name(void) TEST_ERROR; /* The connector should not be registered now */ - if((is_registered = H5VLis_connector_registered(NULL_VOL_CONNECTOR_NAME)) < 0) + if((is_registered = H5VLis_connector_registered_by_name(NULL_VOL_CONNECTOR_NAME)) < 0) TEST_ERROR; if(TRUE == is_registered) FAIL_PUTS_ERROR("NULL VOL connector is inappropriately registered"); @@ -156,7 +156,7 @@ test_multiple_registration(void) TESTING("registering a VOL connector multiple times"); /* The null VOL connector should not be registered at the start of the test */ - if((is_registered = H5VLis_connector_registered(NULL_VOL_CONNECTOR_NAME)) < 0) + if((is_registered = H5VLis_connector_registered_by_name(NULL_VOL_CONNECTOR_NAME)) < 0) TEST_ERROR; if(TRUE == is_registered) FAIL_PUTS_ERROR("NULL VOL connector is inappropriately registered"); @@ -168,7 +168,7 @@ test_multiple_registration(void) } /* The connector should be registered now */ - if((is_registered = H5VLis_connector_registered(NULL_VOL_CONNECTOR_NAME)) < 0) + if((is_registered = H5VLis_connector_registered_by_name(NULL_VOL_CONNECTOR_NAME)) < 0) TEST_ERROR; if(FALSE == is_registered) FAIL_PUTS_ERROR("NULL VOL connector was not registered"); @@ -186,7 +186,43 @@ test_multiple_registration(void) } /* The connector should not be registered now */ - if((is_registered = H5VLis_connector_registered(NULL_VOL_CONNECTOR_NAME)) < 0) + if((is_registered = H5VLis_connector_registered_by_name(NULL_VOL_CONNECTOR_NAME)) < 0) + TEST_ERROR; + if(TRUE == is_registered) + FAIL_PUTS_ERROR("NULL VOL connector is inappropriately registered"); + + /* Repeat testing with the _by_value routines */ + if((is_registered = H5VLis_connector_registered_by_value(NULL_VOL_CONNECTOR_VALUE)) < 0) + TEST_ERROR; + if(TRUE == is_registered) + FAIL_PUTS_ERROR("NULL VOL connector is inappropriately registered"); + + /* Register the connector multiple times */ + for(i = 0; i < N_REGISTRATIONS; i++) { + if((vol_ids[i] = H5VLregister_connector_by_value(NULL_VOL_CONNECTOR_VALUE, H5P_DEFAULT)) < 0) + TEST_ERROR; + } + + /* The connector should be registered now */ + if((is_registered = H5VLis_connector_registered_by_value(NULL_VOL_CONNECTOR_VALUE)) < 0) + TEST_ERROR; + if(FALSE == is_registered) + FAIL_PUTS_ERROR("NULL VOL connector was not registered"); + + /* Unregister the connector */ + for(i = 0; i < N_REGISTRATIONS; i++) { + if(H5VLunregister_connector(vol_ids[i]) < 0) + TEST_ERROR; + /* Also test close on some of the IDs. This call currently works + * identically to unregister. + */ + i++; + if(H5VLclose(vol_ids[i]) < 0) + TEST_ERROR; + } + + /* The connector should not be registered now */ + if((is_registered = H5VLis_connector_registered_by_value(NULL_VOL_CONNECTOR_VALUE)) < 0) TEST_ERROR; if(TRUE == is_registered) FAIL_PUTS_ERROR("NULL VOL connector is inappropriately registered"); @@ -223,7 +259,7 @@ test_getters(void) TESTING("VOL getters"); /* The null VOL connector should not be registered at the start of the test */ - if((is_registered = H5VLis_connector_registered(NULL_VOL_CONNECTOR_NAME)) < 0) + if((is_registered = H5VLis_connector_registered_by_name(NULL_VOL_CONNECTOR_NAME)) < 0) TEST_ERROR; if(TRUE == is_registered) FAIL_PUTS_ERROR("NULL VOL connector is inappropriately registered"); @@ -232,11 +268,35 @@ test_getters(void) if((vol_id = H5VLregister_connector_by_name(NULL_VOL_CONNECTOR_NAME, H5P_DEFAULT)) < 0) TEST_ERROR; - /* Get the connector's ID */ + /* Get the connector's ID by name */ if((vol_id_out = H5VLget_connector_id_by_name(NULL_VOL_CONNECTOR_NAME)) < 0) TEST_ERROR; if(vol_id != vol_id_out) FAIL_PUTS_ERROR("VOL connector IDs don't match"); + if(H5VLclose(vol_id_out) < 0) + TEST_ERROR; + + /* Unregister the connector */ + if(H5VLunregister_connector(vol_id) < 0) + TEST_ERROR; + + /* Repeat testing with the _by_value routines */ + if((is_registered = H5VLis_connector_registered_by_value(NULL_VOL_CONNECTOR_VALUE)) < 0) + TEST_ERROR; + if(TRUE == is_registered) + FAIL_PUTS_ERROR("NULL VOL connector is inappropriately registered"); + + /* Register the connector by value */ + if((vol_id = H5VLregister_connector_by_value(NULL_VOL_CONNECTOR_VALUE, H5P_DEFAULT)) < 0) + TEST_ERROR; + + /* Get the connector's ID by value */ + if((vol_id_out = H5VLget_connector_id_by_value(NULL_VOL_CONNECTOR_VALUE)) < 0) + TEST_ERROR; + if(vol_id != vol_id_out) + FAIL_PUTS_ERROR("VOL connector IDs don't match"); + if(H5VLclose(vol_id_out) < 0) + TEST_ERROR; /* Unregister the connector */ if(H5VLunregister_connector(vol_id) < 0) @@ -247,6 +307,7 @@ test_getters(void) error: H5E_BEGIN_TRY { + H5VLclose(vol_id_out); H5VLunregister_connector(vol_id); } H5E_END_TRY; return FAIL; diff --git a/testpar/t_2Gio.c b/testpar/t_2Gio.c index 977a154..e5ab280 100644 --- a/testpar/t_2Gio.c +++ b/testpar/t_2Gio.c @@ -562,7 +562,17 @@ static int MpioTest2G( MPI_Comm comm ) hid_t plist_id; /* property list identifier */ hid_t filespace; /* file and memory dataspace identifiers */ int *data; /* pointer to data buffer to write */ - + size_t tot_size_bytes; + hid_t dcpl_id; + hid_t memorydataspace; + hid_t filedataspace; + size_t slice_per_process; + size_t data_size; + size_t data_size_bytes; + + hsize_t chunk[3]; + hsize_t h5_counts[3]; + hsize_t h5_offsets[3]; hsize_t shape[3] = {1024, 1024, 1152}; /* @@ -598,7 +608,7 @@ static int MpioTest2G( MPI_Comm comm ) /* * Create the dataspace for the dataset. */ - size_t tot_size_bytes = sizeof(int); + tot_size_bytes = sizeof(int); for (int i = 0; i < 3; i++) { tot_size_bytes *= shape[i]; } @@ -611,9 +621,11 @@ static int MpioTest2G( MPI_Comm comm ) /* * Select chunking */ - hid_t dcpl_id = H5Pcreate (H5P_DATASET_CREATE); + dcpl_id = H5Pcreate (H5P_DATASET_CREATE); VRFY((dcpl_id >= 0), "H5P_DATASET_CREATE"); - hsize_t chunk[3] = {4, shape[1], shape[2]}; + chunk[0] = 4; + chunk[1] = shape[1]; + chunk[2] = shape[2]; status = H5Pset_chunk(dcpl_id, 3, chunk); VRFY((status >= 0), "H5Pset_chunk succeeded"); @@ -634,10 +646,9 @@ static int MpioTest2G( MPI_Comm comm ) status = H5Pset_dxpl_mpio(plist_id, H5FD_MPIO_COLLECTIVE); VRFY((status >= 0), ""); - size_t slice_per_process; H5_CHECKED_ASSIGN(slice_per_process, size_t, (shape[0] + (hsize_t)mpi_size - 1) / (hsize_t)mpi_size, hsize_t); - size_t data_size = slice_per_process * shape[1] * shape[2]; - size_t data_size_bytes = sizeof(int) * data_size; + data_size = slice_per_process * shape[1] * shape[2]; + data_size_bytes = sizeof(int) * data_size; data = HDmalloc(data_size_bytes); VRFY((data != NULL), "data HDmalloc succeeded"); @@ -645,9 +656,13 @@ static int MpioTest2G( MPI_Comm comm ) data[i] = mpi_rank; } - hsize_t h5_counts[3] = { slice_per_process, shape[1], shape[2] }; - hsize_t h5_offsets[3] = { (size_t)mpi_rank * slice_per_process, 0, 0}; - hid_t filedataspace = H5Screate_simple(3, shape, NULL); + h5_counts[0] = slice_per_process; + h5_counts[1] = shape[1]; + h5_counts[2] = shape[2]; + h5_offsets[0] = (size_t)mpi_rank * slice_per_process; + h5_offsets[1] = 0; + h5_offsets[2] = 0; + filedataspace = H5Screate_simple(3, shape, NULL); VRFY((filedataspace >= 0), "H5Screate_simple succeeded"); // fix reminder along first dimension multiple of chunk[0] @@ -659,7 +674,7 @@ static int MpioTest2G( MPI_Comm comm ) h5_offsets, NULL, h5_counts, NULL); VRFY((status >= 0), "H5Sselect_hyperslab succeeded"); - hid_t memorydataspace = H5Screate_simple(3, h5_counts, NULL); + memorydataspace = H5Screate_simple(3, h5_counts, NULL); VRFY((memorydataspace >= 0), "H5Screate_simple succeeded"); status = H5Dwrite(dset_id, H5T_NATIVE_INT, @@ -2149,7 +2164,7 @@ extend_writeInd2(void) { const char *filename; hid_t fid; /* HDF5 file ID */ - hid_t fapl; /* File access templates */ + hid_t fapl_id; /* File access templates */ hid_t fs; /* File dataspace ID */ hid_t ms; /* Memory dataspace ID */ hid_t dataset; /* Dataset ID */ @@ -2177,15 +2192,15 @@ extend_writeInd2(void) * START AN HDF5 FILE * -------------------*/ /* setup file access template */ - fapl = create_faccess_plist(test_comm, MPI_INFO_NULL, facc_type); - VRFY((fapl >= 0), "create_faccess_plist succeeded"); + fapl_id = create_faccess_plist(test_comm, MPI_INFO_NULL, facc_type); + VRFY((fapl_id >= 0), "create_faccess_plist succeeded"); /* create the file collectively */ - fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl); + fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id); VRFY((fid >= 0), "H5Fcreate succeeded"); /* Release file-access template */ - ret = H5Pclose(fapl); + ret = H5Pclose(fapl_id); VRFY((ret >= 0), "H5Pclose succeeded"); @@ -3403,7 +3418,7 @@ test_actual_io_mode(int selection_mode) { hid_t sid = -1; hid_t dataset = -1; hid_t data_type = H5T_NATIVE_INT; - hid_t fapl = -1; + hid_t fapl_id = -1; hid_t mem_space = -1; hid_t file_space = -1; hid_t dcpl = -1; @@ -3454,11 +3469,11 @@ test_actual_io_mode(int selection_mode) { HDassert(filename != NULL); /* Setup the file access template */ - fapl = create_faccess_plist(mpi_comm, mpi_info, facc_type); - VRFY((fapl >= 0), "create_faccess_plist() succeeded"); + fapl_id = create_faccess_plist(mpi_comm, mpi_info, facc_type); + VRFY((fapl_id >= 0), "create_faccess_plist() succeeded"); /* Create the file */ - fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl); + fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id); VRFY((fid >= 0), "H5Fcreate succeeded"); /* Create the basic Space */ @@ -3790,7 +3805,7 @@ test_actual_io_mode(int selection_mode) { /* Release some resources */ ret = H5Sclose(sid); - ret = H5Pclose(fapl); + ret = H5Pclose(fapl_id); ret = H5Pclose(dcpl); ret = H5Pclose(dxpl_write); ret = H5Pclose(dxpl_read); @@ -3919,7 +3934,7 @@ test_no_collective_cause_mode(int selection_mode) hid_t sid = -1; hid_t dataset = -1; hid_t data_type = H5T_NATIVE_INT; - hid_t fapl = -1; + hid_t fapl_id = -1; hid_t dcpl = -1; hid_t dxpl_write = -1; hid_t dxpl_read = -1; @@ -4000,11 +4015,11 @@ test_no_collective_cause_mode(int selection_mode) HDassert(filename != NULL); /* Setup the file access template */ - fapl = create_faccess_plist(mpi_comm, mpi_info, l_facc_type); - VRFY((fapl >= 0), "create_faccess_plist() succeeded"); + fapl_id = create_faccess_plist(mpi_comm, mpi_info, l_facc_type); + VRFY((fapl_id >= 0), "create_faccess_plist() succeeded"); /* Create the file */ - fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl); + fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id); VRFY((fid >= 0), "H5Fcreate succeeded"); @@ -4171,8 +4186,8 @@ test_no_collective_cause_mode(int selection_mode) /* Release some resources */ if (sid) H5Sclose(sid); - if (fapl) - H5Pclose(fapl); + if (fapl_id) + H5Pclose(fapl_id); if (dcpl) H5Pclose(dcpl); if (dxpl_write) diff --git a/testpar/t_bigio.c b/testpar/t_bigio.c index 70c77c3..f86852a 100644 --- a/testpar/t_bigio.c +++ b/testpar/t_bigio.c @@ -15,7 +15,7 @@ const char *FILENAME[3]={ "bigio_test.h5", /* Define some handy debugging shorthands, routines, ... */ /* debugging tools */ -#define MAINPROCESS (!mpi_rank) /* define process 0 as main process */ +#define MAIN_PROCESS (mpi_rank_g == 0) /* define process 0 as main process */ /* Constants definitions */ #define RANK 2 @@ -43,14 +43,13 @@ int facc_type = FACC_MPIO; /*Test file access type */ int dxfer_coll_type = DXFER_COLLECTIVE_IO; size_t bigcount = (size_t)DXFER_BIGCOUNT; int nerrors = 0; -int mpi_size, mpi_rank; +static int mpi_size_g, mpi_rank_g; hsize_t space_dim1 = SPACE_DIM1 * 256; // 4096 hsize_t space_dim2 = SPACE_DIM2; static void coll_chunktest(const char* filename, int chunk_factor, int select_factor, int api_option, int file_selection, int mem_selection, int mode); -hid_t create_faccess_plist(MPI_Comm comm, MPI_Info info, int l_facc_type); /* * Setup the coordinates for point selection. @@ -291,8 +290,8 @@ ccslab_set(int mpi_rank, count[1] = 1; start[1] = 0; stride[1] = 1; - if((mpi_rank *3)<(mpi_size*2)) start[0] = (hsize_t)mpi_rank; - else start[0] = 1 + space_dim1*(hsize_t)mpi_size/2 + (hsize_t)(mpi_rank-2*mpi_size/3); + if((mpi_rank *3)<(mpi_size*2)) start[0] = (hsize_t)mpi_rank; + else start[0] = 1 + space_dim1*(hsize_t)mpi_size/2 + (hsize_t)(mpi_rank-2*mpi_size/3); break; case BYROW_SELECTINCHUNK: @@ -300,12 +299,12 @@ ccslab_set(int mpi_rank, block[0] = 1; count[0] = 1; - start[0] = (hsize_t)mpi_rank*space_dim1; + start[0] = (hsize_t)mpi_rank*space_dim1; stride[0]= 1; - block[1] = space_dim2; - count[1] = 1; - stride[1]= 1; - start[1] = 0; + block[1] = space_dim2; + count[1] = 1; + stride[1]= 1; + start[1] = 0; break; @@ -498,53 +497,53 @@ dataset_big_write(void) /* allocate memory for data buffer */ wdata = (B_DATATYPE *)HDmalloc(bigcount*sizeof(B_DATATYPE)); - VRFY((wdata != NULL), "wdata malloc succeeded"); + VRFY_G((wdata != NULL), "wdata malloc succeeded"); /* setup file access template */ acc_tpl = H5Pcreate (H5P_FILE_ACCESS); - VRFY((acc_tpl >= 0), "H5P_FILE_ACCESS"); + VRFY_G((acc_tpl >= 0), "H5P_FILE_ACCESS"); H5Pset_fapl_mpio(acc_tpl, MPI_COMM_WORLD, MPI_INFO_NULL); /* create the file collectively */ fid = H5Fcreate(FILENAME[0], H5F_ACC_TRUNC, H5P_DEFAULT, acc_tpl); - VRFY((fid >= 0), "H5Fcreate succeeded"); + VRFY_G((fid >= 0), "H5Fcreate succeeded"); /* Release file-access template */ ret = H5Pclose(acc_tpl); - VRFY((ret >= 0), ""); + VRFY_G((ret >= 0), ""); /* Each process takes a slabs of rows. */ - if (mpi_rank == 0) + if (mpi_rank_g == 0) HDprintf("\nTesting Dataset1 write by ROW\n"); /* Create a large dataset */ dims[0] = bigcount; - dims[1] = (hsize_t)mpi_size; + dims[1] = (hsize_t)mpi_size_g; sid = H5Screate_simple (RANK, dims, NULL); - VRFY((sid >= 0), "H5Screate_simple succeeded"); + VRFY_G((sid >= 0), "H5Screate_simple succeeded"); dataset = H5Dcreate2(fid, DATASET1, H5T_NATIVE_LLONG, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - VRFY((dataset >= 0), "H5Dcreate2 succeeded"); + VRFY_G((dataset >= 0), "H5Dcreate2 succeeded"); H5Sclose(sid); - block[0] = dims[0]/(hsize_t)mpi_size; + block[0] = dims[0]/(hsize_t)mpi_size_g; block[1] = dims[1]; stride[0] = block[0]; stride[1] = block[1]; count[0] = 1; count[1] = 1; - start[0] = (hsize_t)mpi_rank*block[0]; + start[0] = (hsize_t)mpi_rank_g*block[0]; start[1] = 0; /* create a file dataspace independently */ file_dataspace = H5Dget_space (dataset); - VRFY((file_dataspace >= 0), "H5Dget_space succeeded"); + VRFY_G((file_dataspace >= 0), "H5Dget_space succeeded"); ret = H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block); - VRFY((ret >= 0), "H5Sset_hyperslab succeeded"); + VRFY_G((ret >= 0), "H5Sset_hyperslab succeeded"); /* create a memory dataspace independently */ mem_dataspace = H5Screate_simple (RANK, block, NULL); - VRFY((mem_dataspace >= 0), ""); + VRFY_G((mem_dataspace >= 0), ""); /* fill the local slab with some trivial data */ fill_datasets(start, block, wdata); @@ -556,17 +555,17 @@ dataset_big_write(void) /* set up the collective transfer properties list */ xfer_plist = H5Pcreate (H5P_DATASET_XFER); - VRFY((xfer_plist >= 0), "H5Pcreate xfer succeeded"); + VRFY_G((xfer_plist >= 0), "H5Pcreate xfer succeeded"); ret = H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_COLLECTIVE); - VRFY((ret >= 0), "H5Pset_dxpl_mpio succeeded"); + VRFY_G((ret >= 0), "H5Pset_dxpl_mpio succeeded"); if(dxfer_coll_type == DXFER_INDEPENDENT_IO) { ret = H5Pset_dxpl_mpio_collective_opt(xfer_plist,H5FD_MPIO_INDIVIDUAL_IO); - VRFY((ret>= 0),"set independent IO collectively succeeded"); + VRFY_G((ret>= 0),"set independent IO collectively succeeded"); } ret = H5Dwrite(dataset, H5T_NATIVE_LLONG, mem_dataspace, file_dataspace, xfer_plist, wdata); - VRFY((ret >= 0), "H5Dwrite dataset1 succeeded"); + VRFY_G((ret >= 0), "H5Dwrite dataset1 succeeded"); /* release all temporary handles. */ H5Sclose(file_dataspace); @@ -574,40 +573,40 @@ dataset_big_write(void) H5Pclose(xfer_plist); ret = H5Dclose(dataset); - VRFY((ret >= 0), "H5Dclose1 succeeded"); + VRFY_G((ret >= 0), "H5Dclose1 succeeded"); /* Each process takes a slabs of cols. */ - if (mpi_rank == 0) + if (mpi_rank_g == 0) HDprintf("\nTesting Dataset2 write by COL\n"); /* Create a large dataset */ dims[0] = bigcount; - dims[1] = (hsize_t)mpi_size; + dims[1] = (hsize_t)mpi_size_g; sid = H5Screate_simple (RANK, dims, NULL); - VRFY((sid >= 0), "H5Screate_simple succeeded"); + VRFY_G((sid >= 0), "H5Screate_simple succeeded"); dataset = H5Dcreate2(fid, DATASET2, H5T_NATIVE_LLONG, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - VRFY((dataset >= 0), "H5Dcreate2 succeeded"); + VRFY_G((dataset >= 0), "H5Dcreate2 succeeded"); H5Sclose(sid); block[0] = dims[0]; - block[1] = dims[1]/(hsize_t)mpi_size; + block[1] = dims[1]/(hsize_t)mpi_size_g; stride[0] = block[0]; stride[1] = block[1]; count[0] = 1; count[1] = 1; start[0] = 0; - start[1] = (hsize_t)mpi_rank*block[1]; + start[1] = (hsize_t)mpi_rank_g*block[1]; /* create a file dataspace independently */ file_dataspace = H5Dget_space (dataset); - VRFY((file_dataspace >= 0), "H5Dget_space succeeded"); + VRFY_G((file_dataspace >= 0), "H5Dget_space succeeded"); ret = H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block); - VRFY((ret >= 0), "H5Sset_hyperslab succeeded"); + VRFY_G((ret >= 0), "H5Sset_hyperslab succeeded"); /* create a memory dataspace independently */ mem_dataspace = H5Screate_simple (RANK, block, NULL); - VRFY((mem_dataspace >= 0), ""); + VRFY_G((mem_dataspace >= 0), ""); /* fill the local slab with some trivial data */ fill_datasets(start, block, wdata); @@ -619,17 +618,17 @@ dataset_big_write(void) /* set up the collective transfer properties list */ xfer_plist = H5Pcreate (H5P_DATASET_XFER); - VRFY((xfer_plist >= 0), "H5Pcreate xfer succeeded"); + VRFY_G((xfer_plist >= 0), "H5Pcreate xfer succeeded"); ret = H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_COLLECTIVE); - VRFY((ret >= 0), "H5Pset_dxpl_mpio succeeded"); + VRFY_G((ret >= 0), "H5Pset_dxpl_mpio succeeded"); if(dxfer_coll_type == DXFER_INDEPENDENT_IO) { ret = H5Pset_dxpl_mpio_collective_opt(xfer_plist,H5FD_MPIO_INDIVIDUAL_IO); - VRFY((ret>= 0),"set independent IO collectively succeeded"); + VRFY_G((ret>= 0),"set independent IO collectively succeeded"); } ret = H5Dwrite(dataset, H5T_NATIVE_LLONG, mem_dataspace, file_dataspace, xfer_plist, wdata); - VRFY((ret >= 0), "H5Dwrite dataset1 succeeded"); + VRFY_G((ret >= 0), "H5Dwrite dataset1 succeeded"); /* release all temporary handles. */ H5Sclose(file_dataspace); @@ -637,51 +636,51 @@ dataset_big_write(void) H5Pclose(xfer_plist); ret = H5Dclose(dataset); - VRFY((ret >= 0), "H5Dclose1 succeeded"); + VRFY_G((ret >= 0), "H5Dclose1 succeeded"); /* ALL selection */ - if (mpi_rank == 0) + if (mpi_rank_g == 0) HDprintf("\nTesting Dataset3 write select ALL proc 0, NONE others\n"); /* Create a large dataset */ dims[0] = bigcount; dims[1] = 1; sid = H5Screate_simple (RANK, dims, NULL); - VRFY((sid >= 0), "H5Screate_simple succeeded"); + VRFY_G((sid >= 0), "H5Screate_simple succeeded"); dataset = H5Dcreate2(fid, DATASET3, H5T_NATIVE_LLONG, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - VRFY((dataset >= 0), "H5Dcreate2 succeeded"); + VRFY_G((dataset >= 0), "H5Dcreate2 succeeded"); H5Sclose(sid); /* create a file dataspace independently */ file_dataspace = H5Dget_space (dataset); - VRFY((file_dataspace >= 0), "H5Dget_space succeeded"); - if(mpi_rank == 0) { + VRFY_G((file_dataspace >= 0), "H5Dget_space succeeded"); + if(mpi_rank_g == 0) { ret = H5Sselect_all(file_dataspace); - VRFY((ret >= 0), "H5Sset_all succeeded"); + VRFY_G((ret >= 0), "H5Sset_all succeeded"); } else { ret = H5Sselect_none(file_dataspace); - VRFY((ret >= 0), "H5Sset_none succeeded"); + VRFY_G((ret >= 0), "H5Sset_none succeeded"); } /* create a memory dataspace independently */ mem_dataspace = H5Screate_simple (RANK, dims, NULL); - VRFY((mem_dataspace >= 0), ""); - if(mpi_rank != 0) { + VRFY_G((mem_dataspace >= 0), ""); + if(mpi_rank_g != 0) { ret = H5Sselect_none(mem_dataspace); - VRFY((ret >= 0), "H5Sset_none succeeded"); + VRFY_G((ret >= 0), "H5Sset_none succeeded"); } /* set up the collective transfer properties list */ xfer_plist = H5Pcreate (H5P_DATASET_XFER); - VRFY((xfer_plist >= 0), "H5Pcreate xfer succeeded"); + VRFY_G((xfer_plist >= 0), "H5Pcreate xfer succeeded"); ret = H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_COLLECTIVE); - VRFY((ret >= 0), "H5Pset_dxpl_mpio succeeded"); + VRFY_G((ret >= 0), "H5Pset_dxpl_mpio succeeded"); if(dxfer_coll_type == DXFER_INDEPENDENT_IO) { ret = H5Pset_dxpl_mpio_collective_opt(xfer_plist,H5FD_MPIO_INDIVIDUAL_IO); - VRFY((ret>= 0),"set independent IO collectively succeeded"); + VRFY_G((ret>= 0),"set independent IO collectively succeeded"); } /* fill the local slab with some trivial data */ @@ -693,7 +692,7 @@ dataset_big_write(void) ret = H5Dwrite(dataset, H5T_NATIVE_LLONG, mem_dataspace, file_dataspace, xfer_plist, wdata); - VRFY((ret >= 0), "H5Dwrite dataset1 succeeded"); + VRFY_G((ret >= 0), "H5Dwrite dataset1 succeeded"); /* release all temporary handles. */ H5Sclose(file_dataspace); @@ -701,19 +700,19 @@ dataset_big_write(void) H5Pclose(xfer_plist); ret = H5Dclose(dataset); - VRFY((ret >= 0), "H5Dclose1 succeeded"); + VRFY_G((ret >= 0), "H5Dclose1 succeeded"); /* Point selection */ - if (mpi_rank == 0) + if (mpi_rank_g == 0) HDprintf("\nTesting Dataset4 write point selection\n"); /* Create a large dataset */ dims[0] = bigcount; - dims[1] = (hsize_t)(mpi_size * 4); + dims[1] = (hsize_t)(mpi_size_g * 4); sid = H5Screate_simple (RANK, dims, NULL); - VRFY((sid >= 0), "H5Screate_simple succeeded"); + VRFY_G((sid >= 0), "H5Screate_simple succeeded"); dataset = H5Dcreate2(fid, DATASET4, H5T_NATIVE_LLONG, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - VRFY((dataset >= 0), "H5Dcreate2 succeeded"); + VRFY_G((dataset >= 0), "H5Dcreate2 succeeded"); H5Sclose(sid); block[0] = dims[0]/2; @@ -723,19 +722,19 @@ dataset_big_write(void) count[0] = 1; count[1] = 1; start[0] = 0; - start[1] = dims[1]/(hsize_t)mpi_size * (hsize_t)mpi_rank; + start[1] = dims[1]/(hsize_t)mpi_size_g * (hsize_t)mpi_rank_g; num_points = bigcount; coords = (hsize_t *)HDmalloc(num_points * RANK * sizeof(hsize_t)); - VRFY((coords != NULL), "coords malloc succeeded"); + VRFY_G((coords != NULL), "coords malloc succeeded"); set_coords (start, count, stride, block, num_points, coords, IN_ORDER); /* create a file dataspace */ file_dataspace = H5Dget_space (dataset); - VRFY((file_dataspace >= 0), "H5Dget_space succeeded"); + VRFY_G((file_dataspace >= 0), "H5Dget_space succeeded"); ret = H5Sselect_elements(file_dataspace, H5S_SELECT_SET, num_points, coords); - VRFY((ret >= 0), "H5Sselect_elements succeeded"); + VRFY_G((ret >= 0), "H5Sselect_elements succeeded"); if(coords) free(coords); @@ -752,21 +751,21 @@ dataset_big_write(void) * appears to cause problems with 32 bit compilers. */ mem_dataspace = H5Screate_simple (1, dims, NULL); - VRFY((mem_dataspace >= 0), ""); + VRFY_G((mem_dataspace >= 0), ""); /* set up the collective transfer properties list */ xfer_plist = H5Pcreate (H5P_DATASET_XFER); - VRFY((xfer_plist >= 0), "H5Pcreate xfer succeeded"); + VRFY_G((xfer_plist >= 0), "H5Pcreate xfer succeeded"); ret = H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_COLLECTIVE); - VRFY((ret >= 0), "H5Pset_dxpl_mpio succeeded"); + VRFY_G((ret >= 0), "H5Pset_dxpl_mpio succeeded"); if(dxfer_coll_type == DXFER_INDEPENDENT_IO) { ret = H5Pset_dxpl_mpio_collective_opt(xfer_plist,H5FD_MPIO_INDIVIDUAL_IO); - VRFY((ret>= 0),"set independent IO collectively succeeded"); + VRFY_G((ret>= 0),"set independent IO collectively succeeded"); } ret = H5Dwrite(dataset, H5T_NATIVE_LLONG, mem_dataspace, file_dataspace, xfer_plist, wdata); - VRFY((ret >= 0), "H5Dwrite dataset1 succeeded"); + VRFY_G((ret >= 0), "H5Dwrite dataset1 succeeded"); /* release all temporary handles. */ H5Sclose(file_dataspace); @@ -774,7 +773,7 @@ dataset_big_write(void) H5Pclose(xfer_plist); ret = H5Dclose(dataset); - VRFY((ret >= 0), "H5Dclose1 succeeded"); + VRFY_G((ret >= 0), "H5Dclose1 succeeded"); HDfree(wdata); H5Fclose(fid); @@ -810,52 +809,52 @@ dataset_big_read(void) /* allocate memory for data buffer */ rdata = (B_DATATYPE *)HDmalloc(bigcount*sizeof(B_DATATYPE)); - VRFY((rdata != NULL), "rdata malloc succeeded"); + VRFY_G((rdata != NULL), "rdata malloc succeeded"); wdata = (B_DATATYPE *)HDmalloc(bigcount*sizeof(B_DATATYPE)); - VRFY((wdata != NULL), "wdata malloc succeeded"); + VRFY_G((wdata != NULL), "wdata malloc succeeded"); HDmemset(rdata, 0, bigcount*sizeof(B_DATATYPE)); /* setup file access template */ acc_tpl = H5Pcreate (H5P_FILE_ACCESS); - VRFY((acc_tpl >= 0), "H5P_FILE_ACCESS"); + VRFY_G((acc_tpl >= 0), "H5P_FILE_ACCESS"); H5Pset_fapl_mpio(acc_tpl, MPI_COMM_WORLD, MPI_INFO_NULL); /* open the file collectively */ fid=H5Fopen(FILENAME[0],H5F_ACC_RDONLY,acc_tpl); - VRFY((fid >= 0), "H5Fopen succeeded"); + VRFY_G((fid >= 0), "H5Fopen succeeded"); /* Release file-access template */ ret = H5Pclose(acc_tpl); - VRFY((ret >= 0), ""); + VRFY_G((ret >= 0), ""); - if (mpi_rank == 0) + if (mpi_rank_g == 0) HDprintf("\nRead Testing Dataset1 by COL\n"); dataset = H5Dopen2(fid, DATASET1, H5P_DEFAULT); - VRFY((dataset >= 0), "H5Dopen2 succeeded"); + VRFY_G((dataset >= 0), "H5Dopen2 succeeded"); dims[0] = bigcount; - dims[1] = (hsize_t)mpi_size; + dims[1] = (hsize_t)mpi_size_g; /* Each process takes a slabs of cols. */ block[0] = dims[0]; - block[1] = dims[1]/(hsize_t)mpi_size; + block[1] = dims[1]/(hsize_t)mpi_size_g; stride[0] = block[0]; stride[1] = block[1]; count[0] = 1; count[1] = 1; start[0] = 0; - start[1] = (hsize_t)mpi_rank*block[1]; + start[1] = (hsize_t)mpi_rank_g*block[1]; /* create a file dataspace independently */ file_dataspace = H5Dget_space (dataset); - VRFY((file_dataspace >= 0), "H5Dget_space succeeded"); + VRFY_G((file_dataspace >= 0), "H5Dget_space succeeded"); ret = H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block); - VRFY((ret >= 0), "H5Sset_hyperslab succeeded"); + VRFY_G((ret >= 0), "H5Sset_hyperslab succeeded"); /* create a memory dataspace independently */ mem_dataspace = H5Screate_simple (RANK, block, NULL); - VRFY((mem_dataspace >= 0), ""); + VRFY_G((mem_dataspace >= 0), ""); /* fill dataset with test data */ fill_datasets(start, block, wdata); @@ -866,18 +865,18 @@ dataset_big_read(void) /* set up the collective transfer properties list */ xfer_plist = H5Pcreate (H5P_DATASET_XFER); - VRFY((xfer_plist >= 0), ""); + VRFY_G((xfer_plist >= 0), ""); ret = H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_COLLECTIVE); - VRFY((ret >= 0), "H5Pcreate xfer succeeded"); + VRFY_G((ret >= 0), "H5Pcreate xfer succeeded"); if(dxfer_coll_type == DXFER_INDEPENDENT_IO) { ret = H5Pset_dxpl_mpio_collective_opt(xfer_plist,H5FD_MPIO_INDIVIDUAL_IO); - VRFY((ret>= 0),"set independent IO collectively succeeded"); + VRFY_G((ret>= 0),"set independent IO collectively succeeded"); } /* read data collectively */ ret = H5Dread(dataset, H5T_NATIVE_LLONG, mem_dataspace, file_dataspace, xfer_plist, rdata); - VRFY((ret >= 0), "H5Dread dataset1 succeeded"); + VRFY_G((ret >= 0), "H5Dread dataset1 succeeded"); /* verify the read data with original expected data */ ret = verify_data(start, count, stride, block, rdata, wdata); @@ -888,36 +887,36 @@ dataset_big_read(void) H5Sclose(mem_dataspace); H5Pclose(xfer_plist); ret = H5Dclose(dataset); - VRFY((ret >= 0), "H5Dclose1 succeeded"); + VRFY_G((ret >= 0), "H5Dclose1 succeeded"); - if (mpi_rank == 0) + if (mpi_rank_g == 0) HDprintf("\nRead Testing Dataset2 by ROW\n"); HDmemset(rdata, 0, bigcount*sizeof(B_DATATYPE)); dataset = H5Dopen2(fid, DATASET2, H5P_DEFAULT); - VRFY((dataset >= 0), "H5Dopen2 succeeded"); + VRFY_G((dataset >= 0), "H5Dopen2 succeeded"); dims[0] = bigcount; - dims[1] = (hsize_t)mpi_size; + dims[1] = (hsize_t)mpi_size_g; /* Each process takes a slabs of rows. */ - block[0] = dims[0]/(hsize_t)mpi_size; + block[0] = dims[0]/(hsize_t)mpi_size_g; block[1] = dims[1]; stride[0] = block[0]; stride[1] = block[1]; count[0] = 1; count[1] = 1; - start[0] = (hsize_t)mpi_rank*block[0]; + start[0] = (hsize_t)mpi_rank_g*block[0]; start[1] = 0; /* create a file dataspace independently */ file_dataspace = H5Dget_space (dataset); - VRFY((file_dataspace >= 0), "H5Dget_space succeeded"); + VRFY_G((file_dataspace >= 0), "H5Dget_space succeeded"); ret = H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block); - VRFY((ret >= 0), "H5Sset_hyperslab succeeded"); + VRFY_G((ret >= 0), "H5Sset_hyperslab succeeded"); /* create a memory dataspace independently */ mem_dataspace = H5Screate_simple (RANK, block, NULL); - VRFY((mem_dataspace >= 0), ""); + VRFY_G((mem_dataspace >= 0), ""); /* fill dataset with test data */ fill_datasets(start, block, wdata); @@ -928,18 +927,18 @@ dataset_big_read(void) /* set up the collective transfer properties list */ xfer_plist = H5Pcreate (H5P_DATASET_XFER); - VRFY((xfer_plist >= 0), ""); + VRFY_G((xfer_plist >= 0), ""); ret = H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_COLLECTIVE); - VRFY((ret >= 0), "H5Pcreate xfer succeeded"); + VRFY_G((ret >= 0), "H5Pcreate xfer succeeded"); if(dxfer_coll_type == DXFER_INDEPENDENT_IO) { ret = H5Pset_dxpl_mpio_collective_opt(xfer_plist,H5FD_MPIO_INDIVIDUAL_IO); - VRFY((ret>= 0),"set independent IO collectively succeeded"); + VRFY_G((ret>= 0),"set independent IO collectively succeeded"); } /* read data collectively */ ret = H5Dread(dataset, H5T_NATIVE_LLONG, mem_dataspace, file_dataspace, xfer_plist, rdata); - VRFY((ret >= 0), "H5Dread dataset2 succeeded"); + VRFY_G((ret >= 0), "H5Dread dataset2 succeeded"); /* verify the read data with original expected data */ ret = verify_data(start, count, stride, block, rdata, wdata); @@ -950,35 +949,35 @@ dataset_big_read(void) H5Sclose(mem_dataspace); H5Pclose(xfer_plist); ret = H5Dclose(dataset); - VRFY((ret >= 0), "H5Dclose1 succeeded"); + VRFY_G((ret >= 0), "H5Dclose1 succeeded"); - if (mpi_rank == 0) + if (mpi_rank_g == 0) HDprintf("\nRead Testing Dataset3 read select ALL proc 0, NONE others\n"); HDmemset(rdata, 0, bigcount*sizeof(B_DATATYPE)); dataset = H5Dopen2(fid, DATASET3, H5P_DEFAULT); - VRFY((dataset >= 0), "H5Dopen2 succeeded"); + VRFY_G((dataset >= 0), "H5Dopen2 succeeded"); dims[0] = bigcount; dims[1] = 1; /* create a file dataspace independently */ file_dataspace = H5Dget_space (dataset); - VRFY((file_dataspace >= 0), "H5Dget_space succeeded"); - if(mpi_rank == 0) { + VRFY_G((file_dataspace >= 0), "H5Dget_space succeeded"); + if(mpi_rank_g == 0) { ret = H5Sselect_all(file_dataspace); - VRFY((ret >= 0), "H5Sset_all succeeded"); + VRFY_G((ret >= 0), "H5Sset_all succeeded"); } else { ret = H5Sselect_none(file_dataspace); - VRFY((ret >= 0), "H5Sset_none succeeded"); + VRFY_G((ret >= 0), "H5Sset_none succeeded"); } /* create a memory dataspace independently */ mem_dataspace = H5Screate_simple (RANK, dims, NULL); - VRFY((mem_dataspace >= 0), ""); - if(mpi_rank != 0) { + VRFY_G((mem_dataspace >= 0), ""); + if(mpi_rank_g != 0) { ret = H5Sselect_none(mem_dataspace); - VRFY((ret >= 0), "H5Sset_none succeeded"); + VRFY_G((ret >= 0), "H5Sset_none succeeded"); } /* fill dataset with test data */ @@ -990,20 +989,20 @@ dataset_big_read(void) /* set up the collective transfer properties list */ xfer_plist = H5Pcreate (H5P_DATASET_XFER); - VRFY((xfer_plist >= 0), ""); + VRFY_G((xfer_plist >= 0), ""); ret = H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_COLLECTIVE); - VRFY((ret >= 0), "H5Pcreate xfer succeeded"); + VRFY_G((ret >= 0), "H5Pcreate xfer succeeded"); if(dxfer_coll_type == DXFER_INDEPENDENT_IO) { ret = H5Pset_dxpl_mpio_collective_opt(xfer_plist,H5FD_MPIO_INDIVIDUAL_IO); - VRFY((ret>= 0),"set independent IO collectively succeeded"); + VRFY_G((ret>= 0),"set independent IO collectively succeeded"); } /* read data collectively */ ret = H5Dread(dataset, H5T_NATIVE_LLONG, mem_dataspace, file_dataspace, xfer_plist, rdata); - VRFY((ret >= 0), "H5Dread dataset3 succeeded"); + VRFY_G((ret >= 0), "H5Dread dataset3 succeeded"); - if(mpi_rank == 0) { + if(mpi_rank_g == 0) { /* verify the read data with original expected data */ ret = verify_data(start, count, stride, block, rdata, wdata); if(ret) {HDfprintf(stderr, "verify failed\n"); exit(1);} @@ -1014,15 +1013,15 @@ dataset_big_read(void) H5Sclose(mem_dataspace); H5Pclose(xfer_plist); ret = H5Dclose(dataset); - VRFY((ret >= 0), "H5Dclose1 succeeded"); + VRFY_G((ret >= 0), "H5Dclose1 succeeded"); - if (mpi_rank == 0) + if (mpi_rank_g == 0) HDprintf("\nRead Testing Dataset4 with Point selection\n"); dataset = H5Dopen2(fid, DATASET4, H5P_DEFAULT); - VRFY((dataset >= 0), "H5Dopen2 succeeded"); + VRFY_G((dataset >= 0), "H5Dopen2 succeeded"); dims[0] = bigcount; - dims[1] = (hsize_t)(mpi_size * 4); + dims[1] = (hsize_t)(mpi_size_g * 4); block[0] = dims[0]/2; block[1] = 2; @@ -1031,7 +1030,7 @@ dataset_big_read(void) count[0] = 1; count[1] = 1; start[0] = 0; - start[1] = dims[1]/(hsize_t)mpi_size * (hsize_t)mpi_rank; + start[1] = dims[1]/(hsize_t)mpi_size_g * (hsize_t)mpi_rank_g; fill_datasets(start, block, wdata); MESG("data_array initialized"); @@ -1043,14 +1042,14 @@ dataset_big_read(void) num_points = bigcount; coords = (hsize_t *)HDmalloc(num_points * RANK * sizeof(hsize_t)); - VRFY((coords != NULL), "coords malloc succeeded"); + VRFY_G((coords != NULL), "coords malloc succeeded"); set_coords (start, count, stride, block, num_points, coords, IN_ORDER); /* create a file dataspace */ file_dataspace = H5Dget_space (dataset); - VRFY((file_dataspace >= 0), "H5Dget_space succeeded"); + VRFY_G((file_dataspace >= 0), "H5Dget_space succeeded"); ret = H5Sselect_elements(file_dataspace, H5S_SELECT_SET, num_points, coords); - VRFY((ret >= 0), "H5Sselect_elements succeeded"); + VRFY_G((ret >= 0), "H5Sselect_elements succeeded"); if(coords) HDfree(coords); @@ -1060,22 +1059,22 @@ dataset_big_read(void) * appears to cause problems with 32 bit compilers. */ mem_dataspace = H5Screate_simple (1, dims, NULL); - VRFY((mem_dataspace >= 0), ""); + VRFY_G((mem_dataspace >= 0), ""); /* set up the collective transfer properties list */ xfer_plist = H5Pcreate (H5P_DATASET_XFER); - VRFY((xfer_plist >= 0), ""); + VRFY_G((xfer_plist >= 0), ""); ret = H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_COLLECTIVE); - VRFY((ret >= 0), "H5Pcreate xfer succeeded"); + VRFY_G((ret >= 0), "H5Pcreate xfer succeeded"); if(dxfer_coll_type == DXFER_INDEPENDENT_IO) { ret = H5Pset_dxpl_mpio_collective_opt(xfer_plist,H5FD_MPIO_INDIVIDUAL_IO); - VRFY((ret>= 0),"set independent IO collectively succeeded"); + VRFY_G((ret>= 0),"set independent IO collectively succeeded"); } /* read data collectively */ ret = H5Dread(dataset, H5T_NATIVE_LLONG, mem_dataspace, file_dataspace, xfer_plist, rdata); - VRFY((ret >= 0), "H5Dread dataset1 succeeded"); + VRFY_G((ret >= 0), "H5Dread dataset1 succeeded"); ret = verify_data(start, count, stride, block, rdata, wdata); if(ret) {HDfprintf(stderr, "verify failed\n"); exit(1);} @@ -1085,7 +1084,7 @@ dataset_big_read(void) H5Sclose(mem_dataspace); H5Pclose(xfer_plist); ret = H5Dclose(dataset); - VRFY((ret >= 0), "H5Dclose1 succeeded"); + VRFY_G((ret >= 0), "H5Dclose1 succeeded"); HDfree(wdata); HDfree(rdata); @@ -1106,7 +1105,7 @@ dataset_big_read(void) if (xfer_plist != -1) H5Pclose(xfer_plist); if (dataset != -1) { ret = H5Dclose(dataset); - VRFY((ret >= 0), "H5Dclose1 succeeded"); + VRFY_G((ret >= 0), "H5Dclose1 succeeded"); } H5Fclose(fid); @@ -1119,10 +1118,10 @@ dataset_big_read(void) static void single_rank_independent_io(void) { - if (mpi_rank == 0) + if (mpi_rank_g == 0) HDprintf("single_rank_independent_io\n"); - if (MAINPROCESS) { + if (MAIN_PROCESS) { hsize_t dims[] = { LARGE_DIM }; hid_t file_id = -1; hid_t fapl_id = -1; @@ -1132,14 +1131,14 @@ single_rank_independent_io(void) void *data = NULL; fapl_id = H5Pcreate(H5P_FILE_ACCESS); - VRFY((fapl_id >= 0), "H5P_FILE_ACCESS"); + VRFY_G((fapl_id >= 0), "H5P_FILE_ACCESS"); H5Pset_fapl_mpio(fapl_id, MPI_COMM_SELF, MPI_INFO_NULL); file_id = H5Fcreate(FILENAME[1], H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id); - VRFY((file_id >= 0), "H5Dcreate2 succeeded"); + VRFY_G((file_id >= 0), "H5Dcreate2 succeeded"); fspace_id = H5Screate_simple(1, dims, NULL); - VRFY((fspace_id >= 0), "H5Screate_simple fspace_id succeeded"); + VRFY_G((fspace_id >= 0), "H5Screate_simple fspace_id succeeded"); /* * Create and write to a >2GB dataset from a single rank. @@ -1147,18 +1146,18 @@ single_rank_independent_io(void) dset_id = H5Dcreate2(file_id, "test_dset", H5T_NATIVE_INT, fspace_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - VRFY((dset_id >= 0), "H5Dcreate2 succeeded"); + VRFY_G((dset_id >= 0), "H5Dcreate2 succeeded"); data = malloc(LARGE_DIM * sizeof(int)); - if (mpi_rank == 0) + if (mpi_rank_g == 0) H5Sselect_all(fspace_id); else H5Sselect_none(fspace_id); dims[0] = LARGE_DIM; mspace_id = H5Screate_simple(1, dims, NULL); - VRFY((mspace_id >= 0), "H5Screate_simple mspace_id succeeded"); + VRFY_G((mspace_id >= 0), "H5Screate_simple mspace_id succeeded"); H5Dwrite(dset_id, H5T_NATIVE_INT, mspace_id, fspace_id, H5P_DEFAULT, data); free(data); @@ -1188,7 +1187,7 @@ create_faccess_plist(MPI_Comm comm, MPI_Info info, int l_facc_type) MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank); ret_pl = H5Pcreate (H5P_FILE_ACCESS); - VRFY((ret_pl >= 0), "H5P_FILE_ACCESS"); + VRFY_G((ret_pl >= 0), "H5P_FILE_ACCESS"); if (l_facc_type == FACC_DEFAULT) return (ret_pl); @@ -1196,11 +1195,11 @@ create_faccess_plist(MPI_Comm comm, MPI_Info info, int l_facc_type) if (l_facc_type == FACC_MPIO){ /* set Parallel access with communicator */ ret = H5Pset_fapl_mpio(ret_pl, comm, info); - VRFY((ret >= 0), ""); + VRFY_G((ret >= 0), ""); ret = H5Pset_all_coll_metadata_ops(ret_pl, TRUE); - VRFY((ret >= 0), ""); + VRFY_G((ret >= 0), ""); ret = H5Pset_coll_metadata_write(ret_pl, TRUE); - VRFY((ret >= 0), ""); + VRFY_G((ret >= 0), ""); return(ret_pl); } @@ -1208,17 +1207,17 @@ create_faccess_plist(MPI_Comm comm, MPI_Info info, int l_facc_type) hid_t mpio_pl; mpio_pl = H5Pcreate (H5P_FILE_ACCESS); - VRFY((mpio_pl >= 0), ""); + VRFY_G((mpio_pl >= 0), ""); /* set Parallel access with communicator */ ret = H5Pset_fapl_mpio(mpio_pl, comm, info); - VRFY((ret >= 0), ""); + VRFY_G((ret >= 0), ""); /* setup file access template */ ret_pl = H5Pcreate (H5P_FILE_ACCESS); - VRFY((ret_pl >= 0), ""); + VRFY_G((ret_pl >= 0), ""); /* set Parallel access with communicator */ ret = H5Pset_fapl_split(ret_pl, ".meta", mpio_pl, ".raw", mpio_pl); - VRFY((ret >= 0), "H5Pset_fapl_split succeeded"); + VRFY_G((ret >= 0), "H5Pset_fapl_split succeeded"); H5Pclose(mpio_pl); return(ret_pl); } @@ -1267,7 +1266,7 @@ void coll_chunk1(void) { const char *filename = FILENAME[0]; - if (mpi_rank == 0) + if (mpi_rank_g == 0) HDprintf("coll_chunk1\n"); coll_chunktest(filename, 1, BYROW_CONT, API_NONE, HYPER, HYPER, OUT_OF_ORDER); @@ -1321,7 +1320,7 @@ void coll_chunk2(void) { const char *filename = FILENAME[0]; - if (mpi_rank == 0) + if (mpi_rank_g == 0) HDprintf("coll_chunk2\n"); coll_chunktest(filename, 1, BYROW_DISCONT, API_NONE, HYPER, HYPER, OUT_OF_ORDER); @@ -1376,18 +1375,18 @@ void coll_chunk3(void) { const char *filename = FILENAME[0]; - if (mpi_rank == 0) + if (mpi_rank_g == 0) HDprintf("coll_chunk3\n"); - coll_chunktest(filename, mpi_size, BYROW_CONT, API_NONE, HYPER, HYPER, OUT_OF_ORDER); - coll_chunktest(filename, mpi_size, BYROW_CONT, API_NONE, HYPER, POINT, OUT_OF_ORDER); - coll_chunktest(filename, mpi_size, BYROW_CONT, API_NONE, POINT, ALL, OUT_OF_ORDER); - coll_chunktest(filename, mpi_size, BYROW_CONT, API_NONE, POINT, POINT, OUT_OF_ORDER); - coll_chunktest(filename, mpi_size, BYROW_CONT, API_NONE, POINT, HYPER, OUT_OF_ORDER); + coll_chunktest(filename, mpi_size_g, BYROW_CONT, API_NONE, HYPER, HYPER, OUT_OF_ORDER); + coll_chunktest(filename, mpi_size_g, BYROW_CONT, API_NONE, HYPER, POINT, OUT_OF_ORDER); + coll_chunktest(filename, mpi_size_g, BYROW_CONT, API_NONE, POINT, ALL, OUT_OF_ORDER); + coll_chunktest(filename, mpi_size_g, BYROW_CONT, API_NONE, POINT, POINT, OUT_OF_ORDER); + coll_chunktest(filename, mpi_size_g, BYROW_CONT, API_NONE, POINT, HYPER, OUT_OF_ORDER); - coll_chunktest(filename, mpi_size, BYROW_CONT, API_NONE, POINT, ALL, IN_ORDER); - coll_chunktest(filename, mpi_size, BYROW_CONT, API_NONE, POINT, POINT, IN_ORDER); - coll_chunktest(filename, mpi_size, BYROW_CONT, API_NONE, POINT, HYPER, IN_ORDER); + coll_chunktest(filename, mpi_size_g, BYROW_CONT, API_NONE, POINT, ALL, IN_ORDER); + coll_chunktest(filename, mpi_size_g, BYROW_CONT, API_NONE, POINT, POINT, IN_ORDER); + coll_chunktest(filename, mpi_size_g, BYROW_CONT, API_NONE, POINT, HYPER, IN_ORDER); } @@ -1452,29 +1451,29 @@ coll_chunktest(const char* filename, /* Create the data space */ acc_plist = create_faccess_plist(comm,info,facc_type); - VRFY((acc_plist >= 0),""); + VRFY_G((acc_plist >= 0),""); file = H5Fcreate(filename,H5F_ACC_TRUNC,H5P_DEFAULT,acc_plist); - VRFY((file >= 0),"H5Fcreate succeeded"); + VRFY_G((file >= 0),"H5Fcreate succeeded"); status = H5Pclose(acc_plist); - VRFY((status >= 0),""); + VRFY_G((status >= 0),""); /* setup dimensionality object */ - dims[0] = space_dim1*(hsize_t)mpi_size; + dims[0] = space_dim1*(hsize_t)mpi_size_g; dims[1] = space_dim2; /* allocate memory for data buffer */ data_array1 = (int *)HDmalloc(dims[0] * dims[1] * sizeof(int)); - VRFY((data_array1 != NULL), "data_array1 malloc succeeded"); + VRFY_G((data_array1 != NULL), "data_array1 malloc succeeded"); /* set up dimensions of the slab this process accesses */ - ccslab_set(mpi_rank, mpi_size, start, count, stride, block, select_factor); + ccslab_set(mpi_rank_g, mpi_size_g, start, count, stride, block, select_factor); /* set up the coords array selection */ num_points = block[0] * block[1] * count[0] * count[1]; coords = (hsize_t *)HDmalloc(num_points * RANK * sizeof(hsize_t)); - VRFY((coords != NULL), "coords malloc succeeded"); + VRFY_G((coords != NULL), "coords malloc succeeded"); point_set(start, count, stride, block, num_points, coords, mode); /* Warning: H5Screate_simple requires an array of hsize_t elements @@ -1482,21 +1481,21 @@ coll_chunktest(const char* filename, * appears to cause problems with 32 bit compilers. */ file_dataspace = H5Screate_simple(2, dims, NULL); - VRFY((file_dataspace >= 0), "file dataspace created succeeded"); + VRFY_G((file_dataspace >= 0), "file dataspace created succeeded"); if(ALL != mem_selection) { mem_dataspace = H5Screate_simple(2, dims, NULL); - VRFY((mem_dataspace >= 0), "mem dataspace created succeeded"); + VRFY_G((mem_dataspace >= 0), "mem dataspace created succeeded"); } else { /* Putting the warning about H5Screate_simple (above) into practice... */ hsize_t dsdims[1] = {num_points}; mem_dataspace = H5Screate_simple (1, dsdims, NULL); - VRFY((mem_dataspace >= 0), "mem_dataspace create succeeded"); + VRFY_G((mem_dataspace >= 0), "mem_dataspace create succeeded"); } crp_plist = H5Pcreate(H5P_DATASET_CREATE); - VRFY((crp_plist >= 0),""); + VRFY_G((crp_plist >= 0),""); /* Set up chunk information. */ chunk_dims[0] = dims[0]/(hsize_t)chunk_factor; @@ -1504,14 +1503,14 @@ coll_chunktest(const char* filename, /* to decrease the testing time, maintain bigger chunk size */ (chunk_factor == 1) ? (chunk_dims[1] = space_dim2) : (chunk_dims[1] = space_dim2/2); status = H5Pset_chunk(crp_plist, 2, chunk_dims); - VRFY((status >= 0),"chunk creation property list succeeded"); + VRFY_G((status >= 0),"chunk creation property list succeeded"); dataset = H5Dcreate2(file, DSET_COLLECTIVE_CHUNK_NAME, H5T_NATIVE_INT, file_dataspace, H5P_DEFAULT, crp_plist, H5P_DEFAULT); - VRFY((dataset >= 0),"dataset created succeeded"); + VRFY_G((dataset >= 0),"dataset created succeeded"); status = H5Pclose(crp_plist); - VRFY((status >= 0), ""); + VRFY_G((status >= 0), ""); /*put some trivial data in the data array */ ccdataset_fill(start, stride, count,block, data_array1, mem_selection); @@ -1521,93 +1520,93 @@ coll_chunktest(const char* filename, switch (file_selection) { case HYPER: status = H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block); - VRFY((status >= 0),"hyperslab selection succeeded"); + VRFY_G((status >= 0),"hyperslab selection succeeded"); break; case POINT: if (num_points) { status = H5Sselect_elements(file_dataspace, H5S_SELECT_SET, num_points, coords); - VRFY((status >= 0),"Element selection succeeded"); + VRFY_G((status >= 0),"Element selection succeeded"); } else { status = H5Sselect_none(file_dataspace); - VRFY((status >= 0),"none selection succeeded"); + VRFY_G((status >= 0),"none selection succeeded"); } break; case ALL: status = H5Sselect_all(file_dataspace); - VRFY((status >= 0), "H5Sselect_all succeeded"); + VRFY_G((status >= 0), "H5Sselect_all succeeded"); break; } switch (mem_selection) { case HYPER: status = H5Sselect_hyperslab(mem_dataspace, H5S_SELECT_SET, start, stride, count, block); - VRFY((status >= 0),"hyperslab selection succeeded"); + VRFY_G((status >= 0),"hyperslab selection succeeded"); break; case POINT: if (num_points) { status = H5Sselect_elements(mem_dataspace, H5S_SELECT_SET, num_points, coords); - VRFY((status >= 0),"Element selection succeeded"); + VRFY_G((status >= 0),"Element selection succeeded"); } else { status = H5Sselect_none(mem_dataspace); - VRFY((status >= 0),"none selection succeeded"); + VRFY_G((status >= 0),"none selection succeeded"); } break; case ALL: status = H5Sselect_all(mem_dataspace); - VRFY((status >= 0), "H5Sselect_all succeeded"); + VRFY_G((status >= 0), "H5Sselect_all succeeded"); break; } /* set up the collective transfer property list */ xfer_plist = H5Pcreate(H5P_DATASET_XFER); - VRFY((xfer_plist >= 0), ""); + VRFY_G((xfer_plist >= 0), ""); status = H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_COLLECTIVE); - VRFY((status>= 0),"MPIO collective transfer property succeeded"); + VRFY_G((status>= 0),"MPIO collective transfer property succeeded"); if(dxfer_coll_type == DXFER_INDEPENDENT_IO) { status = H5Pset_dxpl_mpio_collective_opt(xfer_plist, H5FD_MPIO_INDIVIDUAL_IO); - VRFY((status>= 0),"set independent IO collectively succeeded"); + VRFY_G((status>= 0),"set independent IO collectively succeeded"); } switch(api_option){ case API_LINK_HARD: status = H5Pset_dxpl_mpio_chunk_opt(xfer_plist,H5FD_MPIO_CHUNK_ONE_IO); - VRFY((status>= 0),"collective chunk optimization succeeded"); + VRFY_G((status>= 0),"collective chunk optimization succeeded"); break; case API_MULTI_HARD: status = H5Pset_dxpl_mpio_chunk_opt(xfer_plist,H5FD_MPIO_CHUNK_MULTI_IO); - VRFY((status>= 0),"collective chunk optimization succeeded "); + VRFY_G((status>= 0),"collective chunk optimization succeeded "); break; case API_LINK_TRUE: status = H5Pset_dxpl_mpio_chunk_opt_num(xfer_plist,2); - VRFY((status>= 0),"collective chunk optimization set chunk number succeeded"); + VRFY_G((status>= 0),"collective chunk optimization set chunk number succeeded"); break; case API_LINK_FALSE: status = H5Pset_dxpl_mpio_chunk_opt_num(xfer_plist,6); - VRFY((status>= 0),"collective chunk optimization set chunk number succeeded"); + VRFY_G((status>= 0),"collective chunk optimization set chunk number succeeded"); break; case API_MULTI_COLL: status = H5Pset_dxpl_mpio_chunk_opt_num(xfer_plist,8);/* make sure it is using multi-chunk IO */ - VRFY((status>= 0),"collective chunk optimization set chunk number succeeded"); + VRFY_G((status>= 0),"collective chunk optimization set chunk number succeeded"); status = H5Pset_dxpl_mpio_chunk_opt_ratio(xfer_plist,50); - VRFY((status>= 0),"collective chunk optimization set chunk ratio succeeded"); + VRFY_G((status>= 0),"collective chunk optimization set chunk ratio succeeded"); break; case API_MULTI_IND: status = H5Pset_dxpl_mpio_chunk_opt_num(xfer_plist,8);/* make sure it is using multi-chunk IO */ - VRFY((status>= 0),"collective chunk optimization set chunk number succeeded"); + VRFY_G((status>= 0),"collective chunk optimization set chunk number succeeded"); status = H5Pset_dxpl_mpio_chunk_opt_ratio(xfer_plist,100); - VRFY((status>= 0),"collective chunk optimization set chunk ratio succeeded"); + VRFY_G((status>= 0),"collective chunk optimization set chunk ratio succeeded"); break; default: @@ -1621,42 +1620,42 @@ coll_chunktest(const char* filename, prop_value = H5D_XFER_COLL_CHUNK_DEF; status = H5Pinsert2(xfer_plist, H5D_XFER_COLL_CHUNK_LINK_HARD_NAME, H5D_XFER_COLL_CHUNK_SIZE, &prop_value, NULL, NULL, NULL, NULL, NULL, NULL); - VRFY((status >= 0),"testing property list inserted succeeded"); + VRFY_G((status >= 0),"testing property list inserted succeeded"); break; case API_MULTI_HARD: prop_value = H5D_XFER_COLL_CHUNK_DEF; status = H5Pinsert2(xfer_plist, H5D_XFER_COLL_CHUNK_MULTI_HARD_NAME, H5D_XFER_COLL_CHUNK_SIZE, &prop_value, NULL, NULL, NULL, NULL, NULL, NULL); - VRFY((status >= 0),"testing property list inserted succeeded"); + VRFY_G((status >= 0),"testing property list inserted succeeded"); break; case API_LINK_TRUE: prop_value = H5D_XFER_COLL_CHUNK_DEF; status = H5Pinsert2(xfer_plist, H5D_XFER_COLL_CHUNK_LINK_NUM_TRUE_NAME, H5D_XFER_COLL_CHUNK_SIZE, &prop_value, NULL, NULL, NULL, NULL, NULL, NULL); - VRFY((status >= 0),"testing property list inserted succeeded"); + VRFY_G((status >= 0),"testing property list inserted succeeded"); break; case API_LINK_FALSE: prop_value = H5D_XFER_COLL_CHUNK_DEF; status = H5Pinsert2(xfer_plist, H5D_XFER_COLL_CHUNK_LINK_NUM_FALSE_NAME, H5D_XFER_COLL_CHUNK_SIZE, &prop_value, NULL, NULL, NULL, NULL, NULL, NULL); - VRFY((status >= 0),"testing property list inserted succeeded"); + VRFY_G((status >= 0),"testing property list inserted succeeded"); break; case API_MULTI_COLL: prop_value = H5D_XFER_COLL_CHUNK_DEF; status = H5Pinsert2(xfer_plist, H5D_XFER_COLL_CHUNK_MULTI_RATIO_COLL_NAME, H5D_XFER_COLL_CHUNK_SIZE, &prop_value, NULL, NULL, NULL, NULL, NULL, NULL); - VRFY((status >= 0),"testing property list inserted succeeded"); + VRFY_G((status >= 0),"testing property list inserted succeeded"); break; case API_MULTI_IND: prop_value = H5D_XFER_COLL_CHUNK_DEF; status = H5Pinsert2(xfer_plist, H5D_XFER_COLL_CHUNK_MULTI_RATIO_IND_NAME, H5D_XFER_COLL_CHUNK_SIZE, &prop_value, NULL, NULL, NULL, NULL, NULL, NULL); - VRFY((status >= 0),"testing property list inserted succeeded"); + VRFY_G((status >= 0),"testing property list inserted succeeded"); break; default: @@ -1668,45 +1667,45 @@ coll_chunktest(const char* filename, /* write data collectively */ status = H5Dwrite(dataset, H5T_NATIVE_INT, mem_dataspace, file_dataspace, xfer_plist, data_array1); - VRFY((status >= 0),"dataset write succeeded"); + VRFY_G((status >= 0),"dataset write succeeded"); #ifdef H5_HAVE_INSTRUMENTED_LIBRARY if(facc_type == FACC_MPIO) { switch(api_option){ case API_LINK_HARD: status = H5Pget(xfer_plist,H5D_XFER_COLL_CHUNK_LINK_HARD_NAME,&prop_value); - VRFY((status >= 0),"testing property list get succeeded"); - VRFY((prop_value == 0),"API to set LINK COLLECTIVE IO directly succeeded"); + VRFY_G((status >= 0),"testing property list get succeeded"); + VRFY_G((prop_value == 0),"API to set LINK COLLECTIVE IO directly succeeded"); break; case API_MULTI_HARD: status = H5Pget(xfer_plist,H5D_XFER_COLL_CHUNK_MULTI_HARD_NAME,&prop_value); - VRFY((status >= 0),"testing property list get succeeded"); - VRFY((prop_value == 0),"API to set MULTI-CHUNK COLLECTIVE IO optimization succeeded"); + VRFY_G((status >= 0),"testing property list get succeeded"); + VRFY_G((prop_value == 0),"API to set MULTI-CHUNK COLLECTIVE IO optimization succeeded"); break; case API_LINK_TRUE: status = H5Pget(xfer_plist,H5D_XFER_COLL_CHUNK_LINK_NUM_TRUE_NAME,&prop_value); - VRFY((status >= 0),"testing property list get succeeded"); - VRFY((prop_value == 0),"API to set LINK COLLECTIVE IO succeeded"); + VRFY_G((status >= 0),"testing property list get succeeded"); + VRFY_G((prop_value == 0),"API to set LINK COLLECTIVE IO succeeded"); break; case API_LINK_FALSE: status = H5Pget(xfer_plist,H5D_XFER_COLL_CHUNK_LINK_NUM_FALSE_NAME,&prop_value); - VRFY((status >= 0),"testing property list get succeeded"); - VRFY((prop_value == 0),"API to set LINK IO transferring to multi-chunk IO succeeded"); + VRFY_G((status >= 0),"testing property list get succeeded"); + VRFY_G((prop_value == 0),"API to set LINK IO transferring to multi-chunk IO succeeded"); break; case API_MULTI_COLL: status = H5Pget(xfer_plist,H5D_XFER_COLL_CHUNK_MULTI_RATIO_COLL_NAME,&prop_value); - VRFY((status >= 0),"testing property list get succeeded"); - VRFY((prop_value == 0),"API to set MULTI-CHUNK COLLECTIVE IO with optimization succeeded"); + VRFY_G((status >= 0),"testing property list get succeeded"); + VRFY_G((prop_value == 0),"API to set MULTI-CHUNK COLLECTIVE IO with optimization succeeded"); break; case API_MULTI_IND: status = H5Pget(xfer_plist,H5D_XFER_COLL_CHUNK_MULTI_RATIO_IND_NAME,&prop_value); - VRFY((status >= 0),"testing property list get succeeded"); - VRFY((prop_value == 0),"API to set MULTI-CHUNK IO transferring to independent IO succeeded"); + VRFY_G((status >= 0),"testing property list get succeeded"); + VRFY_G((prop_value == 0),"API to set MULTI-CHUNK IO transferring to independent IO succeeded"); break; default: @@ -1716,20 +1715,20 @@ coll_chunktest(const char* filename, #endif status = H5Dclose(dataset); - VRFY((status >= 0),""); + VRFY_G((status >= 0),""); status = H5Pclose(xfer_plist); - VRFY((status >= 0),"property list closed"); + VRFY_G((status >= 0),"property list closed"); status = H5Sclose(file_dataspace); - VRFY((status >= 0),""); + VRFY_G((status >= 0),""); status = H5Sclose(mem_dataspace); - VRFY((status >= 0),""); + VRFY_G((status >= 0),""); status = H5Fclose(file); - VRFY((status >= 0),""); + VRFY_G((status >= 0),""); if (data_array1) HDfree(data_array1); @@ -1737,35 +1736,35 @@ coll_chunktest(const char* filename, /* allocate memory for data buffer */ data_array1 = (int *)HDmalloc(dims[0]*dims[1]*sizeof(int)); - VRFY((data_array1 != NULL), "data_array1 malloc succeeded"); + VRFY_G((data_array1 != NULL), "data_array1 malloc succeeded"); /* allocate memory for data buffer */ data_origin1 = (int *)HDmalloc(dims[0]*dims[1]*sizeof(int)); - VRFY((data_origin1 != NULL), "data_origin1 malloc succeeded"); + VRFY_G((data_origin1 != NULL), "data_origin1 malloc succeeded"); acc_plist = create_faccess_plist(comm, info, facc_type); - VRFY((acc_plist >= 0),"MPIO creation property list succeeded"); + VRFY_G((acc_plist >= 0),"MPIO creation property list succeeded"); file = H5Fopen(FILENAME[0],H5F_ACC_RDONLY,acc_plist); - VRFY((file >= 0),"H5Fcreate succeeded"); + VRFY_G((file >= 0),"H5Fcreate succeeded"); status = H5Pclose(acc_plist); - VRFY((status >= 0),""); + VRFY_G((status >= 0),""); /* open the collective dataset*/ dataset = H5Dopen2(file, DSET_COLLECTIVE_CHUNK_NAME, H5P_DEFAULT); - VRFY((dataset >= 0), ""); + VRFY_G((dataset >= 0), ""); /* set up dimensions of the slab this process accesses */ - ccslab_set(mpi_rank, mpi_size, start, count, stride, block, select_factor); + ccslab_set(mpi_rank_g, mpi_size_g, start, count, stride, block, select_factor); /* obtain the file and mem dataspace*/ file_dataspace = H5Dget_space (dataset); - VRFY((file_dataspace >= 0), ""); + VRFY_G((file_dataspace >= 0), ""); if (ALL != mem_selection) { mem_dataspace = H5Dget_space (dataset); - VRFY((mem_dataspace >= 0), ""); + VRFY_G((mem_dataspace >= 0), ""); } else { /* Warning: H5Screate_simple requires an array of hsize_t elements @@ -1774,92 +1773,92 @@ coll_chunktest(const char* filename, */ hsize_t dsdims[1] = {num_points}; mem_dataspace = H5Screate_simple (1, dsdims, NULL); - VRFY((mem_dataspace >= 0), "mem_dataspace create succeeded"); + VRFY_G((mem_dataspace >= 0), "mem_dataspace create succeeded"); } switch (file_selection) { case HYPER: status = H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block); - VRFY((status >= 0),"hyperslab selection succeeded"); + VRFY_G((status >= 0),"hyperslab selection succeeded"); break; case POINT: if (num_points) { status = H5Sselect_elements(file_dataspace, H5S_SELECT_SET, num_points, coords); - VRFY((status >= 0),"Element selection succeeded"); + VRFY_G((status >= 0),"Element selection succeeded"); } else { status = H5Sselect_none(file_dataspace); - VRFY((status >= 0),"none selection succeeded"); + VRFY_G((status >= 0),"none selection succeeded"); } break; case ALL: status = H5Sselect_all(file_dataspace); - VRFY((status >= 0), "H5Sselect_all succeeded"); + VRFY_G((status >= 0), "H5Sselect_all succeeded"); break; } switch (mem_selection) { case HYPER: status = H5Sselect_hyperslab(mem_dataspace, H5S_SELECT_SET, start, stride, count, block); - VRFY((status >= 0),"hyperslab selection succeeded"); + VRFY_G((status >= 0),"hyperslab selection succeeded"); break; case POINT: if (num_points) { status = H5Sselect_elements(mem_dataspace, H5S_SELECT_SET, num_points, coords); - VRFY((status >= 0),"Element selection succeeded"); + VRFY_G((status >= 0),"Element selection succeeded"); } else { status = H5Sselect_none(mem_dataspace); - VRFY((status >= 0),"none selection succeeded"); + VRFY_G((status >= 0),"none selection succeeded"); } break; case ALL: status = H5Sselect_all(mem_dataspace); - VRFY((status >= 0), "H5Sselect_all succeeded"); + VRFY_G((status >= 0), "H5Sselect_all succeeded"); break; } /* fill dataset with test data */ ccdataset_fill(start, stride,count,block, data_origin1, mem_selection); xfer_plist = H5Pcreate (H5P_DATASET_XFER); - VRFY((xfer_plist >= 0),""); + VRFY_G((xfer_plist >= 0),""); status = H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_COLLECTIVE); - VRFY((status>= 0),"MPIO collective transfer property succeeded"); + VRFY_G((status>= 0),"MPIO collective transfer property succeeded"); if(dxfer_coll_type == DXFER_INDEPENDENT_IO) { status = H5Pset_dxpl_mpio_collective_opt(xfer_plist,H5FD_MPIO_INDIVIDUAL_IO); - VRFY((status>= 0),"set independent IO collectively succeeded"); + VRFY_G((status>= 0),"set independent IO collectively succeeded"); } status = H5Dread(dataset, H5T_NATIVE_INT, mem_dataspace, file_dataspace, xfer_plist, data_array1); - VRFY((status >=0),"dataset read succeeded"); + VRFY_G((status >=0),"dataset read succeeded"); /* verify the read data with original expected data */ status = ccdataset_vrfy(start, count, stride, block, data_array1, data_origin1, mem_selection); if (status) nerrors++; status = H5Pclose(xfer_plist); - VRFY((status >= 0),"property list closed"); + VRFY_G((status >= 0),"property list closed"); /* close dataset collectively */ status=H5Dclose(dataset); - VRFY((status >= 0), "H5Dclose"); + VRFY_G((status >= 0), "H5Dclose"); /* release all IDs created */ status = H5Sclose(file_dataspace); - VRFY((status >= 0),"H5Sclose"); + VRFY_G((status >= 0),"H5Sclose"); status = H5Sclose(mem_dataspace); - VRFY((status >= 0),"H5Sclose"); + VRFY_G((status >= 0),"H5Sclose"); /* close the file collectively */ status = H5Fclose(file); - VRFY((status >= 0),"H5Fclose"); + VRFY_G((status >= 0),"H5Fclose"); /* release data buffers */ if(coords) HDfree(coords); @@ -1937,8 +1936,8 @@ int main(int argc, char **argv) } MPI_Init(&argc, &argv); - MPI_Comm_size(MPI_COMM_WORLD,&mpi_size); - MPI_Comm_rank(MPI_COMM_WORLD,&mpi_rank); + MPI_Comm_size(MPI_COMM_WORLD,&mpi_size_g); + MPI_Comm_rank(MPI_COMM_WORLD,&mpi_rank_g); /* Attempt to turn off atexit post processing so that in case errors * happen during the test and the process is aborted, it will not get @@ -1952,7 +1951,7 @@ int main(int argc, char **argv) /* set alarm. */ ALARM_ON; - ExpressMode = do_express_test(mpi_rank); + ExpressMode = do_express_test(mpi_rank_g); dataset_big_write(); MPI_Barrier(MPI_COMM_WORLD); @@ -1961,7 +1960,7 @@ int main(int argc, char **argv) MPI_Barrier(MPI_COMM_WORLD); if (ExpressMode > 0) { - if (mpi_rank == 0) + if (mpi_rank_g == 0) HDprintf("***Express test mode on. Several tests are skipped\n"); } else { @@ -1977,7 +1976,7 @@ int main(int argc, char **argv) /* turn off alarm */ ALARM_OFF; - if (mpi_rank == 0) + if (mpi_rank_g == 0) HDremove(FILENAME[0]); /* close HDF5 library */ diff --git a/testpar/t_chunk_alloc.c b/testpar/t_chunk_alloc.c index e6df2d8..e716f41 100644 --- a/testpar/t_chunk_alloc.c +++ b/testpar/t_chunk_alloc.c @@ -385,18 +385,18 @@ verify_data(const char *filename, int chunk_factor, write_type write_pattern, in /* set expected value according the write pattern */ switch (write_pattern) { - case all: - value = i%mpi_size + 1; - break; - case none: - value = 0; - break; - case sec_last: - if (i==nchunks-2) - value = 100; - else + case all: + value = i%mpi_size + 1; + break; + case none: value = 0; break; + case sec_last: + if (i==nchunks-2) + value = 100; + else + value = 0; + break; default: HDassert(0); } diff --git a/testpar/t_dset.c b/testpar/t_dset.c index 05baf3f..13f9e89 100644 --- a/testpar/t_dset.c +++ b/testpar/t_dset.c @@ -80,7 +80,7 @@ slab_set(int mpi_rank, int mpi_size, hsize_t start[], hsize_t count[], stride[1] = block[1]; count[0] = 1; count[1] = 1; - start[0] = (hsize_t)(mpi_rank ? (hsize_t)mpi_rank * block[0] : 0); + start[0] = (mpi_rank ? (hsize_t)mpi_rank * block[0] : 0); start[1] = 0; if (VERBOSE_MED) HDprintf("slab_set ZROW\n"); @@ -90,11 +90,11 @@ slab_set(int mpi_rank, int mpi_size, hsize_t start[], hsize_t count[], block[0] = (hsize_t)dim0; block[1] = (hsize_t)(mpi_rank ? dim1 / mpi_size : 0); stride[0] = block[0]; - stride[1] = (mpi_rank ? block[1] : 1); /* avoid setting stride to 0 */ + stride[1] = (hsize_t)(mpi_rank ? block[1] : 1); /* avoid setting stride to 0 */ count[0] = 1; count[1] = 1; start[0] = 0; - start[1] = (hsize_t)(mpi_rank ? (hsize_t)mpi_rank * block[1] : 0); + start[1] = (mpi_rank ? (hsize_t)mpi_rank * block[1] : 0); if (VERBOSE_MED) HDprintf("slab_set ZCOL\n"); break; @@ -1115,7 +1115,7 @@ dataset_readAll(void) /* set up the coords array selection */ num_points = (size_t)dim1; - coords = (hsize_t *)HDmalloc((size_t)dim0 * (size_t)dim1 * (size_t)RANK * sizeof(hsize_t)); + coords = (hsize_t *)HDmalloc((size_t)dim0 * (size_t)dim1 * RANK * sizeof(hsize_t)); VRFY((coords != NULL), "coords malloc succeeded"); /* allocate memory for data buffer */ @@ -1416,7 +1416,7 @@ dataset_readAll(void) ret = H5Sselect_all(file_dataspace); VRFY((ret >= 0), "H5Sselect_all succeeded"); - H5_CHECKED_ASSIGN(num_points, size_t, dim0 * dim1, int); + num_points = (size_t)(dim0 * dim1); k=0; for (i=0 ; i<dim0; i++) { for (j=0 ; j<dim1; j++) { @@ -1839,6 +1839,7 @@ extend_writeInd2(void) /* ------------------------- * Write to the second half of the dataset * -------------------------*/ + H5_CHECK_OVERFLOW(orig_size, hsize_t, int); for (i=0; i<(int)orig_size; i++) written[i] = (int)orig_size + i; MESG("data array re-initialized"); @@ -2545,7 +2546,7 @@ compress_readAll(void) /* Initialize data buffers */ for(u=0; u<dim;u++) - data_orig[u]=(int)u; + data_orig[u]=(DATATYPE)u; /* Run test both with and without filters disabled on partial chunks */ for(disable_partial_chunk_filters = 0; disable_partial_chunk_filters <= 1; @@ -3913,7 +3914,7 @@ test_no_collective_cause_mode_filter(int selection_mode) length = dim0 * dim1; /* Allocate and initialize the buffer */ - buffer = (int *)HDmalloc(sizeof(int) * (size_t)length); + buffer = (int *)HDmalloc(sizeof(int) * length); VRFY((buffer != NULL), "HDmalloc of buffer succeeded"); for(i = 0; i < length; i++) buffer[i] = i; @@ -4337,20 +4338,22 @@ dataset_atomicity(void) compare = 5; + H5_CHECK_OVERFLOW(block[0], hsize_t, int); + H5_CHECK_OVERFLOW(block[1], hsize_t, int); for (i=0 ; i<dim0 ; i++) { - if ((hsize_t)i >= (hsize_t)mpi_rank*(block[0]+1)) { + if (i >= mpi_rank*((int)block[0]+1)) { break; } - if (((hsize_t)i+1)%(block[0]+1)==0) { + if ((i+1)%((int)block[0]+1)==0) { k += dim1; continue; } for (j=0 ; j<dim1 ; j++) { - if ((hsize_t)j >= (hsize_t)mpi_rank*(block[1]+1)) { - H5_CHECKED_ASSIGN(k, int, (hsize_t)dim1 - (hsize_t)mpi_rank*(block[1]+1), hsize_t); + if (j >= mpi_rank*((int)block[1]+1)) { + k += dim1 - mpi_rank*((int)block[1]+1); break; } - if (((hsize_t)j+1)%(block[1]+1)==0) { + if ((j+1)%((int)block[1]+1)==0) { k++; continue; } diff --git a/testpar/t_mdset.c b/testpar/t_mdset.c index 6cdb0af7..db0d059 100644 --- a/testpar/t_mdset.c +++ b/testpar/t_mdset.c @@ -235,6 +235,9 @@ void compact_dataset(void) char dname[]="dataset"; herr_t ret; const char *filename; +#ifdef H5_HAVE_INSTRUMENTED_LIBRARY + hbool_t prop_value; +#endif size = get_size(); @@ -314,7 +317,6 @@ void compact_dataset(void) VRFY((dataset >= 0), "H5Dopen2 succeeded"); #ifdef H5_HAVE_INSTRUMENTED_LIBRARY - hbool_t prop_value; prop_value = H5D_XFER_COLL_RANK0_BCAST_DEF; ret = H5Pinsert2(dxpl, H5D_XFER_COLL_RANK0_BCAST_NAME, H5D_XFER_COLL_RANK0_BCAST_SIZE, &prop_value, NULL, NULL, NULL, NULL, NULL, NULL); @@ -620,6 +622,9 @@ void dataset_fillvalue(void) int acc, i, ii, j, k, l; /* Local index variables */ herr_t ret; /* Generic return value */ const char *filename; +#ifdef H5_HAVE_INSTRUMENTED_LIBRARY + hbool_t prop_value; +#endif MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank); MPI_Comm_size(MPI_COMM_WORLD, &mpi_size); @@ -664,7 +669,6 @@ void dataset_fillvalue(void) VRFY((dxpl >= 0), "H5Pcreate succeeded"); #ifdef H5_HAVE_INSTRUMENTED_LIBRARY - hbool_t prop_value; prop_value = H5D_XFER_COLL_RANK0_BCAST_DEF; ret = H5Pinsert2(dxpl, H5D_XFER_COLL_RANK0_BCAST_NAME, H5D_XFER_COLL_RANK0_BCAST_SIZE, &prop_value, NULL, NULL, NULL, NULL, NULL, NULL); diff --git a/testpar/t_mpi.c b/testpar/t_mpi.c index 064fb57..670e02b 100644 --- a/testpar/t_mpi.c +++ b/testpar/t_mpi.c @@ -303,7 +303,7 @@ static int test_mpio_gb_file(char *filename) { mpi_rank, mpi_off, mpi_off); /* set data to some trivial pattern for easy verification */ for (j = 0; j < MB; j++) - H5_CHECKED_ASSIGN(*(buf + j), int8_t, i * mpi_size + mpi_rank, int); + *(buf + j) = (int8_t)(i * mpi_size + mpi_rank); if (VERBOSE_MED) HDfprintf(stdout, "proc %d: writing %d bytes at offset %lld\n", @@ -351,7 +351,7 @@ static int test_mpio_gb_file(char *filename) { mrc = MPI_File_read_at(fh, mpi_off, buf, MB, MPI_BYTE, &mpi_stat); INFO((mrc == MPI_SUCCESS), "GB size file read"); - H5_CHECKED_ASSIGN(expected, int8_t, i * mpi_size + (mpi_size - mpi_rank - 1), int); + expected = (int8_t)(i * mpi_size + (mpi_size - mpi_rank - 1)); vrfyerrs = 0; for (j = 0; j < MB; j++) { if ((*(buf + j) != expected) diff --git a/testpar/t_prestart.c b/testpar/t_prestart.c index fc9d475..cf974e8 100644 --- a/testpar/t_prestart.c +++ b/testpar/t_prestart.c @@ -34,8 +34,8 @@ main (int argc, char **argv) hid_t file_id, dset_id, grp_id; hid_t fapl, sid, mem_dataspace; herr_t ret; - char filename[1024]; - int mpi_size, mpi_rank, ndims, i, j; + char filename[1024]; + int mpi_size, mpi_rank, ndims; MPI_Comm comm = MPI_COMM_WORLD; MPI_Info info = MPI_INFO_NULL; hsize_t dims[RANK]; @@ -43,6 +43,7 @@ main (int argc, char **argv) hsize_t count[RANK]; hsize_t stride[RANK]; hsize_t block[RANK]; + hsize_t i, j; DATATYPE *data_array = NULL, *dataptr; /* data buffer */ MPI_Init(&argc, &argv); @@ -73,8 +74,8 @@ main (int argc, char **argv) ndims = H5Sget_simple_extent_dims(sid, dims, NULL); VRFY((ndims == 2), "H5Sget_simple_extent_dims succeeded"); - VRFY(dims[0] == ROW_FACTOR*mpi_size, "Wrong dataset dimensions"); - VRFY(dims[1] == COL_FACTOR*mpi_size, "Wrong dataset dimensions"); + VRFY(dims[0] == (hsize_t)(ROW_FACTOR*mpi_size), "Wrong dataset dimensions"); + VRFY(dims[1] == (hsize_t)(COL_FACTOR*mpi_size), "Wrong dataset dimensions"); /* allocate memory for data buffer */ data_array = (DATATYPE *)HDmalloc(dims[0]*dims[1]*sizeof(DATATYPE)); diff --git a/testpar/t_shapesame.c b/testpar/t_shapesame.c index c12cf5a..34fcc72 100644 --- a/testpar/t_shapesame.c +++ b/testpar/t_shapesame.c @@ -397,14 +397,9 @@ hs_dr_pio_test__setup(const int test_num, * * JRM -- 9/16/10 */ - if ( express_test == 0 ) { - tv_ptr->chunk_dims[0] = 1; + tv_ptr->chunk_dims[0] = 1; - } else { - - tv_ptr->chunk_dims[0] = 1; - } tv_ptr->chunk_dims[1] = tv_ptr->chunk_dims[2] = tv_ptr->chunk_dims[3] = tv_ptr->chunk_dims[4] = (hsize_t)(tv_ptr->chunk_edge_size); diff --git a/testpar/t_span_tree.c b/testpar/t_span_tree.c index e1a86a1..fe8a618 100644 --- a/testpar/t_span_tree.c +++ b/testpar/t_span_tree.c @@ -223,7 +223,7 @@ void coll_write_test(int chunk_factor) hsize_t chunk_dims[2]; herr_t ret; - unsigned i; + int i; int fillvalue = 0; /* Fill value for the dataset */ int *matrix_out = NULL; @@ -682,7 +682,7 @@ coll_read_test(void) hsize_t block[2]; /* Block sizes */ herr_t ret; - unsigned i; + int i; int *matrix_out; int *matrix_out1; /* Buffer to read from the dataset */ diff --git a/testpar/testpar.h b/testpar/testpar.h index 86677d1..2c1bce2 100644 --- a/testpar/testpar.h +++ b/testpar/testpar.h @@ -44,12 +44,12 @@ * This will allow program to continue and can be used for debugging. * (The "do {...} while(0)" is to group all the statements as one unit.) */ -#define VRFY(val, mesg) do { \ +#define VRFY_IMPL(val, mesg, rankvar) do { \ if (val) { \ MESG(mesg); \ } \ else { \ - HDprintf("Proc %d: ", mpi_rank); \ + HDprintf("Proc %d: ", rankvar); \ HDprintf("*** Parallel ERROR ***\n"); \ HDprintf(" VRFY (%s) failed at line %4d in %s\n", \ mesg, (int)__LINE__, __FILE__); \ @@ -62,6 +62,9 @@ } \ } while(0) +#define VRFY_G(val, mesg) VRFY_IMPL(val, mesg, mpi_rank_g) +#define VRFY(val, mesg) VRFY_IMPL(val, mesg, mpi_rank) + /* * Checking for information purpose. * If val is false, print mesg; else nothing. diff --git a/tools/lib/h5diff.c b/tools/lib/h5diff.c index 7830e25..86726b4 100644 --- a/tools/lib/h5diff.c +++ b/tools/lib/h5diff.c @@ -1345,7 +1345,7 @@ diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1, } /* end else */ } /* end while */ - for(i = 1; i < g_nTasks; i++) + for(i = 1; (int)i < g_nTasks; i++) MPI_Send(NULL, 0, MPI_BYTE, (int)i, MPI_TAG_END, MPI_COMM_WORLD); /* Print any final data waiting in our queue */ diff --git a/tools/lib/h5diff_array.c b/tools/lib/h5diff_array.c index 3127870..52bae51 100644 --- a/tools/lib/h5diff_array.c +++ b/tools/lib/h5diff_array.c @@ -155,7 +155,7 @@ static void print_char_pos(int *ph, int pp, hsize_t curr_pos, size_t u, hsize_t *acc, hsize_t *pos, int rank, hsize_t *dims, const char *obj1, const char *obj2); static void h5diff_print_char(char ch); -static hsize_t diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t index, +static hsize_t diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t idx, int rank, hsize_t *dims, hsize_t *acc, hsize_t *pos, diff_opt_t *opts, const char *obj1, const char *obj2, hid_t container1_id, hid_t container2_id, /*where the reference came from*/ @@ -243,7 +243,6 @@ typedef enum dtype_t { } dtype_t; #endif -static hbool_t my_isnan(dtype_t type, void *val); /*------------------------------------------------------------------------- * XCAO, 11/10/2010 @@ -372,9 +371,7 @@ hsize_t diff_array(void *_mem1, void *_mem2, hsize_t nelmts, hsize_t hyper_start } /* i */ close_member_types(&members); } /* switch */ - H5TOOLS_DEBUG("diff_array finish:%d - errstat:%d", nfound, opts->err_stat); - - H5TOOLS_ENDDEBUG(": %d", nfound); + H5TOOLS_ENDDEBUG(":%d - errstat:%d", nfound, opts->err_stat); return nfound; } @@ -411,9 +408,11 @@ hsize_t diff_array(void *_mem1, void *_mem2, hsize_t nelmts, hsize_t hyper_start * Dereference the object and compare the type (basic object type). *------------------------------------------------------------------------- */ -static hsize_t diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t index, int rank, - hsize_t *dims, hsize_t *acc, hsize_t *pos, diff_opt_t *opts, const char *obj1, const char *obj2, - hid_t container1_id, hid_t container2_id, +static hsize_t +diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t idx, int rank, + hsize_t *dims, hsize_t *acc, hsize_t *pos, diff_opt_t *opts, + const char *obj1, const char *obj2, + hid_t container1_id, hid_t container2_id, int *ph, /*print header */ mcomp_t *members) /*compound members */ { @@ -473,7 +472,7 @@ static hsize_t diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t index, offset = members->offsets[j]; memb_type = members->ids[j]; - nfound += diff_datum(mem1 + offset, mem2 + offset, memb_type, index, + nfound += diff_datum(mem1 + offset, mem2 + offset, memb_type, idx, rank, dims, acc, pos, opts, obj1, obj2, container1_id, container2_id, ph, members->m[j]); } } @@ -577,11 +576,11 @@ static hsize_t diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t index, if (size1 != size2) if (print_data(opts)) for (u = size; u < sizex; u++) - character_compare(s + u, sx + u, index, u, rank, dims, acc, pos, opts, obj1, obj2, ph); + character_compare(s + u, sx + u, idx, u, rank, dims, acc, pos, opts, obj1, obj2, ph); } else for (u = 0; u < size; u++) - nfound += character_compare(s + u, sx + u, index, u, rank, dims, acc, pos, opts, obj1, obj2, ph); + nfound += character_compare(s + u, sx + u, idx, u, rank, dims, acc, pos, opts, obj1, obj2, ph); } /* end check for NULL pointer for string */ } break; @@ -594,7 +593,7 @@ static hsize_t diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t index, H5TOOLS_DEBUG("diff_datum H5T_BITFIELD"); /* byte-by-byte comparison */ for (u = 0; u < type_size; u++) - nfound += character_compare_opt(mem1 + u, mem2 + u, index, rank, dims, acc, pos, opts, obj1, obj2, ph); + nfound += character_compare_opt(mem1 + u, mem2 + u, idx, rank, dims, acc, pos, opts, obj1, obj2, ph); break; /*------------------------------------------------------------------------- @@ -605,7 +604,7 @@ static hsize_t diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t index, H5TOOLS_DEBUG("diff_datum H5T_OPAQUE"); /* byte-by-byte comparison */ for (u = 0; u < type_size; u++) - nfound += character_compare_opt(mem1 + u, mem2 + u, index, rank, dims, acc, pos, opts, obj1, obj2, ph); + nfound += character_compare_opt(mem1 + u, mem2 + u, idx, rank, dims, acc, pos, opts, obj1, obj2, ph); break; /*------------------------------------------------------------------------- @@ -646,7 +645,7 @@ static hsize_t diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t index, */ nfound += 1; if (print_data(opts)) { - print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); + print_pos(ph, 0, idx, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(S_FORMAT, enum_name1, enum_name2); } @@ -656,14 +655,14 @@ static hsize_t diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t index, if (HDstrcmp(enum_name1, enum_name2) != 0) { nfound = 1; if (print_data(opts)) { - print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); + print_pos(ph, 0, idx, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(S_FORMAT, enum_name1, enum_name2); } } else { for (u = 0; u < type_size; u++) - nfound += character_compare_opt(mem1 + u, mem2 + u, index, rank, dims, acc, pos, opts, obj1, obj2, ph); + nfound += character_compare_opt(mem1 + u, mem2 + u, idx, rank, dims, acc, pos, opts, obj1, obj2, ph); } } /* enable error reporting */ @@ -693,7 +692,7 @@ static hsize_t diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t index, for (u = 0, nelmts = 1; u < (unsigned) ndims; u++) nelmts *= adims[u]; for (u = 0; u < nelmts; u++) { - nfound += diff_datum(mem1 + u * size, mem2 + u * size, memb_type, index, + nfound += diff_datum(mem1 + u * size, mem2 + u * size, memb_type, idx, rank, dims, acc, pos, opts, obj1, obj2, container1_id, container2_id, ph, members); } H5Tclose(memb_type); @@ -1103,7 +1102,7 @@ static hsize_t diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t index, nelmts = ((hvl_t *)((void *)mem1))->len; for (j = 0; j < nelmts; j++) - nfound += diff_datum(((char *) (((hvl_t *)((void *)mem1))->p)) + j * size, ((char *) (((hvl_t *)((void *)mem2))->p)) + j * size, memb_type, index, /* Extra (void *) cast to quiet "cast to create alignment" warning - 2019/07/05, QAK */ + nfound += diff_datum(((char *) (((hvl_t *)((void *)mem1))->p)) + j * size, ((char *) (((hvl_t *)((void *)mem2))->p)) + j * size, memb_type, idx, /* Extra (void *) cast to quiet "cast to create alignment" warning - 2019/07/05, QAK */ rank, dims, acc, pos, opts, obj1, obj2, container1_id, container2_id, ph, members); H5Tclose(memb_type); @@ -1133,7 +1132,7 @@ static hsize_t diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t index, if (opts->d && !opts->p) { if (ABS(temp1_char-temp2_char) > opts->delta) { if (print_data(opts)) { - print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); + print_pos(ph, 0, idx, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT, temp1_char, temp2_char, ABS(temp1_char - temp2_char)); } @@ -1146,7 +1145,7 @@ static hsize_t diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t index, if (not_comparable && !both_zero) { if (print_data(opts)) { - print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); + print_pos(ph, 1, idx, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT_P_NOTCOMP, temp1_char, temp2_char, ABS(temp1_char - temp2_char)); } @@ -1154,7 +1153,7 @@ static hsize_t diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t index, } else if (per > opts->percent) { if (print_data(opts)) { - print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); + print_pos(ph, 1, idx, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT_P, temp1_char, temp2_char, ABS(temp1_char - temp2_char), per); } @@ -1167,7 +1166,7 @@ static hsize_t diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t index, if (not_comparable && !both_zero) { if (print_data(opts)) { - print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); + print_pos(ph, 1, idx, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT_P_NOTCOMP, temp1_char, temp2_char, ABS(temp1_char - temp2_char)); } @@ -1175,7 +1174,7 @@ static hsize_t diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t index, } else if (per > opts->percent && ABS(temp1_char - temp2_char) > opts->delta) { if (print_data(opts)) { - print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); + print_pos(ph, 1, idx, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT_P, temp1_char, temp2_char, ABS(temp1_char - temp2_char), per); } @@ -1184,7 +1183,7 @@ static hsize_t diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t index, } else if (temp1_char != temp2_char) { if (print_data(opts)) { - print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); + print_pos(ph, 0, idx, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT, temp1_char, temp2_char, ABS(temp1_char - temp2_char)); } @@ -1209,7 +1208,7 @@ static hsize_t diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t index, if (opts->d && !opts->p) { if (PDIFF(temp1_uchar, temp2_uchar) > opts->delta) { if (print_data(opts)) { - print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); + print_pos(ph, 0, idx, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT, temp1_uchar, temp2_uchar, PDIFF(temp1_uchar, temp2_uchar)); } @@ -1222,7 +1221,7 @@ static hsize_t diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t index, if (not_comparable && !both_zero) { if (print_data(opts)) { - print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); + print_pos(ph, 1, idx, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT_P_NOTCOMP, temp1_uchar, temp2_uchar, PDIFF(temp1_uchar, temp2_uchar)); } @@ -1230,7 +1229,7 @@ static hsize_t diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t index, } else if (per > opts->percent) { if (print_data(opts)) { - print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); + print_pos(ph, 1, idx, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT_P, temp1_uchar, temp2_uchar, PDIFF(temp1_uchar, temp2_uchar), per); } @@ -1243,7 +1242,7 @@ static hsize_t diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t index, if (not_comparable && !both_zero) { if (print_data(opts)) { - print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); + print_pos(ph, 1, idx, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT_P_NOTCOMP, temp1_uchar, temp2_uchar, PDIFF(temp1_uchar, temp2_uchar)); } @@ -1251,7 +1250,7 @@ static hsize_t diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t index, } else if (per > opts->percent && PDIFF(temp1_uchar, temp2_uchar) > opts->delta) { if (print_data(opts)) { - print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); + print_pos(ph, 1, idx, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT_P, temp1_uchar, temp2_uchar, PDIFF(temp1_uchar, temp2_uchar), per); } @@ -1260,7 +1259,7 @@ static hsize_t diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t index, } else if (temp1_uchar != temp2_uchar) { if (print_data(opts)) { - print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); + print_pos(ph, 0, idx, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT, temp1_uchar, temp2_uchar, PDIFF(temp1_uchar, temp2_uchar)); } @@ -1285,7 +1284,7 @@ static hsize_t diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t index, if (opts->d && !opts->p) { if (ABS(temp1_short - temp2_short) > opts->delta) { if (print_data(opts)) { - print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); + print_pos(ph, 0, idx, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT, temp1_short, temp2_short, ABS(temp1_short - temp2_short)); } @@ -1298,7 +1297,7 @@ static hsize_t diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t index, if (not_comparable && !both_zero) { if (print_data(opts)) { - print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); + print_pos(ph, 1, idx, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT_P_NOTCOMP, temp1_short, temp2_short, ABS(temp1_short - temp2_short)); } @@ -1306,7 +1305,7 @@ static hsize_t diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t index, } else if (per > opts->percent) { if (print_data(opts)) { - print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); + print_pos(ph, 1, idx, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT_P, temp1_short, temp2_short, ABS(temp1_short - temp2_short), per); } @@ -1319,7 +1318,7 @@ static hsize_t diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t index, if (not_comparable && !both_zero) { if (print_data(opts)) { - print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); + print_pos(ph, 1, idx, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT_P_NOTCOMP, temp1_short, temp2_short, ABS(temp1_short - temp2_short)); } @@ -1327,7 +1326,7 @@ static hsize_t diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t index, } else if (per > opts->percent && ABS(temp1_short - temp2_short) > opts->delta) { if (print_data(opts)) { - print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); + print_pos(ph, 1, idx, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT_P, temp1_short, temp2_short, ABS(temp1_short - temp2_short), per); } @@ -1336,7 +1335,7 @@ static hsize_t diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t index, } else if (temp1_short != temp2_short) { if (print_data(opts)) { - print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); + print_pos(ph, 0, idx, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT, temp1_short, temp2_short, ABS(temp1_short - temp2_short)); } @@ -1361,7 +1360,7 @@ static hsize_t diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t index, if (opts->d && !opts->p) { if (PDIFF(temp1_ushort, temp2_ushort) > opts->delta) { if (print_data(opts)) { - print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); + print_pos(ph, 0, idx, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT, temp1_ushort, temp2_ushort, PDIFF(temp1_ushort, temp2_ushort)); } @@ -1374,7 +1373,7 @@ static hsize_t diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t index, if (not_comparable && !both_zero) { if (print_data(opts)) { - print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); + print_pos(ph, 1, idx, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT_P_NOTCOMP, temp1_ushort, temp2_ushort, PDIFF(temp1_ushort, temp2_ushort)); } @@ -1382,7 +1381,7 @@ static hsize_t diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t index, } else if (per > opts->percent) { if (print_data(opts)) { - print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); + print_pos(ph, 1, idx, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT_P, temp1_ushort, temp2_ushort, PDIFF(temp1_ushort, temp2_ushort), per); } @@ -1395,7 +1394,7 @@ static hsize_t diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t index, if (not_comparable && !both_zero) { if (print_data(opts)) { - print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); + print_pos(ph, 1, idx, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT_P_NOTCOMP, temp1_ushort, temp2_ushort, PDIFF(temp1_ushort, temp2_ushort)); } @@ -1403,7 +1402,7 @@ static hsize_t diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t index, } else if (per > opts->percent && PDIFF(temp1_ushort, temp2_ushort) > opts->delta) { if (print_data(opts)) { - print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); + print_pos(ph, 1, idx, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT_P, temp1_ushort, temp2_ushort, PDIFF(temp1_ushort, temp2_ushort), per); } @@ -1412,7 +1411,7 @@ static hsize_t diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t index, } else if (temp1_ushort != temp2_ushort) { if (print_data(opts)) { - print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); + print_pos(ph, 0, idx, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT, temp1_ushort, temp2_ushort, PDIFF(temp1_ushort, temp2_ushort)); } @@ -1437,7 +1436,7 @@ static hsize_t diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t index, if (opts->d && !opts->p) { if (ABS(temp1_int-temp2_int) > opts->delta) { if (print_data(opts)) { - print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); + print_pos(ph, 0, idx, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT, temp1_int, temp2_int, ABS(temp1_int - temp2_int)); } @@ -1450,7 +1449,7 @@ static hsize_t diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t index, if (not_comparable && !both_zero) { if (print_data(opts)) { - print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); + print_pos(ph, 1, idx, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT_P_NOTCOMP, temp1_int, temp2_int, ABS(temp1_int - temp2_int)); } @@ -1458,7 +1457,7 @@ static hsize_t diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t index, } else if (per > opts->percent) { if (print_data(opts)) { - print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); + print_pos(ph, 1, idx, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT_P, temp1_int, temp2_int, ABS(temp1_int - temp2_int), per); } @@ -1471,7 +1470,7 @@ static hsize_t diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t index, if (not_comparable && !both_zero) { if (print_data(opts)) { - print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); + print_pos(ph, 1, idx, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT_P_NOTCOMP, temp1_int, temp2_int, ABS(temp1_int - temp2_int)); } @@ -1479,7 +1478,7 @@ static hsize_t diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t index, } else if (per > opts->percent && ABS(temp1_int - temp2_int) > opts->delta) { if (print_data(opts)) { - print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); + print_pos(ph, 1, idx, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT_P, temp1_int, temp2_int, ABS(temp1_int - temp2_int), per); } @@ -1488,7 +1487,7 @@ static hsize_t diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t index, } else if (temp1_int != temp2_int) { if (print_data(opts)) { - print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); + print_pos(ph, 0, idx, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT, temp1_int, temp2_int, ABS(temp1_int - temp2_int)); } @@ -1513,7 +1512,7 @@ static hsize_t diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t index, if (opts->d && !opts->p) { if (PDIFF(temp1_uint, temp2_uint) > opts->delta) { if (print_data(opts)) { - print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); + print_pos(ph, 0, idx, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(UI_FORMAT, temp1_uint, temp2_uint, PDIFF(temp1_uint, temp2_uint)); } @@ -1526,7 +1525,7 @@ static hsize_t diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t index, if (not_comparable && !both_zero) { if (print_data(opts)) { - print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); + print_pos(ph, 1, idx, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(UI_FORMAT_P_NOTCOMP, temp1_uint, temp2_uint, PDIFF(temp1_uint, temp2_uint)); } @@ -1534,7 +1533,7 @@ static hsize_t diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t index, } else if (per > opts->percent) { if (print_data(opts)) { - print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); + print_pos(ph, 1, idx, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(UI_FORMAT_P, temp1_uint, temp2_uint, PDIFF(temp1_uint, temp2_uint), per); } @@ -1547,7 +1546,7 @@ static hsize_t diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t index, if (not_comparable && !both_zero) { if (print_data(opts)) { - print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); + print_pos(ph, 1, idx, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(UI_FORMAT_P_NOTCOMP, temp1_uint, temp2_uint, PDIFF(temp1_uint, temp2_uint)); } @@ -1555,7 +1554,7 @@ static hsize_t diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t index, } else if (per > opts->percent && PDIFF(temp1_uint,temp2_uint) > opts->delta) { if (print_data(opts)) { - print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); + print_pos(ph, 1, idx, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(UI_FORMAT_P, temp1_uint, temp2_uint, PDIFF(temp1_uint, temp2_uint), per); } @@ -1564,7 +1563,7 @@ static hsize_t diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t index, } else if (temp1_uint != temp2_uint) { if (print_data(opts)) { - print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); + print_pos(ph, 0, idx, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(UI_FORMAT, temp1_uint, temp2_uint, PDIFF(temp1_uint, temp2_uint)); } @@ -1589,7 +1588,7 @@ static hsize_t diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t index, if (opts->d && !opts->p) { if (ABS(temp1_long-temp2_long) > opts->delta) { if (print_data(opts)) { - print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); + print_pos(ph, 0, idx, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(LI_FORMAT, temp1_long, temp2_long, ABS(temp1_long - temp2_long)); } @@ -1602,7 +1601,7 @@ static hsize_t diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t index, if (not_comparable && !both_zero) { if (print_data(opts)) { - print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); + print_pos(ph, 1, idx, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(LI_FORMAT_P_NOTCOMP, temp1_long, temp2_long, ABS(temp1_long - temp2_long)); } @@ -1610,7 +1609,7 @@ static hsize_t diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t index, } else if (per > opts->percent) { if (print_data(opts)) { - print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); + print_pos(ph, 1, idx, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(LI_FORMAT_P, temp1_long, temp2_long, ABS(temp1_long - temp2_long), per); } @@ -1623,7 +1622,7 @@ static hsize_t diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t index, if (not_comparable && !both_zero) { if (print_data(opts)) { - print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); + print_pos(ph, 1, idx, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(LI_FORMAT_P_NOTCOMP, temp1_long, temp2_long, ABS(temp1_long - temp2_long)); } @@ -1631,7 +1630,7 @@ static hsize_t diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t index, } else if (per > opts->percent && ABS(temp1_long-temp2_long) > opts->delta) { if (print_data(opts)) { - print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); + print_pos(ph, 1, idx, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(LI_FORMAT_P, temp1_long, temp2_long, ABS(temp1_long - temp2_long), per); } @@ -1640,7 +1639,7 @@ static hsize_t diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t index, } else if (temp1_long != temp2_long) { if (print_data(opts)) { - print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); + print_pos(ph, 0, idx, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(LI_FORMAT, temp1_long, temp2_long, ABS(temp1_long - temp2_long)); } @@ -1665,7 +1664,7 @@ static hsize_t diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t index, if (opts->d && !opts->p) { if (PDIFF(temp1_ulong, temp2_ulong) > opts->delta) { if (print_data(opts)) { - print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); + print_pos(ph, 0, idx, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(ULI_FORMAT, temp1_ulong, temp2_ulong, PDIFF(temp1_ulong, temp2_ulong)); } @@ -1678,7 +1677,7 @@ static hsize_t diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t index, if (not_comparable && !both_zero) { if (print_data(opts)) { - print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); + print_pos(ph, 1, idx, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(ULI_FORMAT_P_NOTCOMP, temp1_ulong, temp2_ulong, PDIFF(temp1_ulong, temp2_ulong)); } @@ -1686,7 +1685,7 @@ static hsize_t diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t index, } else if (per > opts->percent) { if (print_data(opts)) { - print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); + print_pos(ph, 1, idx, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(ULI_FORMAT_P, temp1_ulong, temp2_ulong, PDIFF(temp1_ulong, temp2_ulong), per); } @@ -1699,7 +1698,7 @@ static hsize_t diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t index, if (not_comparable && !both_zero) { if (print_data(opts)) { - print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); + print_pos(ph, 1, idx, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(ULI_FORMAT_P_NOTCOMP, temp1_ulong, temp2_ulong, PDIFF(temp1_ulong, temp2_ulong)); } @@ -1707,7 +1706,7 @@ static hsize_t diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t index, } else if (per > opts->percent && PDIFF(temp1_ulong,temp2_ulong) > opts->delta) { if (print_data(opts)) { - print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); + print_pos(ph, 1, idx, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(ULI_FORMAT_P, temp1_ulong, temp2_ulong, PDIFF(temp1_ulong, temp2_ulong), per); } @@ -1716,7 +1715,7 @@ static hsize_t diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t index, } else if (temp1_ulong != temp2_ulong) { if (print_data(opts)) { - print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); + print_pos(ph, 0, idx, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(ULI_FORMAT, temp1_ulong, temp2_ulong, PDIFF(temp1_ulong, temp2_ulong)); } @@ -1759,15 +1758,15 @@ static hsize_t diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t index, *------------------------------------------------------------------------- */ if (opts->do_nans) { - isnan1 = my_isnan(FLT_FLOAT, &temp1_float); - isnan2 = my_isnan(FLT_FLOAT, &temp2_float); + isnan1 = HDisnan(temp1_float); + isnan2 = HDisnan(temp2_float); } /* both not NaN, do the comparison */ if (!isnan1 && !isnan2) { if (ABS(temp1_float-temp2_float) > (float) opts->delta) { if (print_data(opts)) { - print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); + print_pos(ph, 0, idx, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(F_FORMAT, (double) temp1_float, (double) temp2_float, (double) ABS(temp1_float - temp2_float)); } @@ -1777,7 +1776,7 @@ static hsize_t diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t index, /* only one is NaN, assume difference */ else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { if (print_data(opts)) { - print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); + print_pos(ph, 0, idx, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(F_FORMAT, (double) temp1_float, (double) temp2_float, (double) ABS(temp1_float - temp2_float)); } @@ -1794,8 +1793,8 @@ static hsize_t diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t index, *------------------------------------------------------------------------- */ if (opts->do_nans) { - isnan1 = my_isnan(FLT_FLOAT, &temp1_float); - isnan2 = my_isnan(FLT_FLOAT, &temp2_float); + isnan1 = HDisnan(temp1_float); + isnan2 = HDisnan(temp2_float); } /* both not NaN, do the comparison */ @@ -1804,7 +1803,7 @@ static hsize_t diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t index, if (not_comparable && !both_zero) { if (print_data(opts)) { - print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); + print_pos(ph, 1, idx, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(F_FORMAT_P_NOTCOMP, (double) temp1_float, (double) temp2_float, (double) ABS(temp1_float - temp2_float)); } @@ -1812,7 +1811,7 @@ static hsize_t diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t index, } else if (per > opts->percent && (double) ABS(temp1_float - temp2_float) > opts->delta) { if (print_data(opts)) { - print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); + print_pos(ph, 1, idx, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(F_FORMAT_P, (double) temp1_float, (double) temp2_float, (double) ABS(temp1_float - temp2_float), (double) ABS(1 - temp2_float / temp1_float)); @@ -1823,7 +1822,7 @@ static hsize_t diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t index, /* only one is NaN, assume difference */ else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { if (print_data(opts)) { - print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); + print_pos(ph, 0, idx, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(F_FORMAT, (double) temp1_float, (double) temp2_float, (double) ABS(temp1_float - temp2_float)); } @@ -1840,8 +1839,8 @@ static hsize_t diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t index, *------------------------------------------------------------------------- */ if (opts->do_nans) { - isnan1 = my_isnan(FLT_FLOAT, &temp1_float); - isnan2 = my_isnan(FLT_FLOAT, &temp2_float); + isnan1 = HDisnan(temp1_float); + isnan2 = HDisnan(temp2_float); } /* both not NaN, do the comparison */ @@ -1850,7 +1849,7 @@ static hsize_t diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t index, if (not_comparable && !both_zero) { if (print_data(opts)) { - print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); + print_pos(ph, 1, idx, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(F_FORMAT_P_NOTCOMP, (double) temp1_float, (double) temp2_float, (double) ABS(temp1_float - temp2_float)); } @@ -1858,7 +1857,7 @@ static hsize_t diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t index, } else if (per > opts->percent) { if (print_data(opts)) { - print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); + print_pos(ph, 1, idx, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(F_FORMAT_P, (double) temp1_float, (double) temp2_float, (double) ABS(temp1_float - temp2_float), (double) ABS(1 - temp2_float / temp1_float)); @@ -1869,7 +1868,7 @@ static hsize_t diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t index, /* only one is NaN, assume difference */ else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { if (print_data(opts)) { - print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); + print_pos(ph, 0, idx, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(F_FORMAT, (double) temp1_float, (double) temp2_float, (double) ABS(temp1_float - temp2_float)); } @@ -1882,7 +1881,7 @@ static hsize_t diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t index, */ else if (equal_float(temp1_float, temp2_float, opts) == FALSE) { if (print_data(opts)) { - print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); + print_pos(ph, 0, idx, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(F_FORMAT, (double) temp1_float, (double) temp2_float, (double) ABS(temp1_float - temp2_float)); } @@ -1917,15 +1916,15 @@ static hsize_t diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t index, *------------------------------------------------------------------------- */ if (opts->do_nans) { - isnan1 = my_isnan(FLT_DOUBLE, &temp1_double); - isnan2 = my_isnan(FLT_DOUBLE, &temp2_double); + isnan1 = HDisnan(temp1_double); + isnan2 = HDisnan(temp2_double); } /* both not NaN, do the comparison */ if (!isnan1 && !isnan2) { if (ABS(temp1_double-temp2_double) > opts->delta) { if (print_data(opts)) { - print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); + print_pos(ph, 0, idx, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(F_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); } @@ -1935,7 +1934,7 @@ static hsize_t diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t index, /* only one is NaN, assume difference */ else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { if (print_data(opts)) { - print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); + print_pos(ph, 0, idx, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(F_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); } @@ -1952,8 +1951,8 @@ static hsize_t diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t index, *------------------------------------------------------------------------- */ if (opts->do_nans) { - isnan1 = my_isnan(FLT_DOUBLE, &temp1_double); - isnan2 = my_isnan(FLT_DOUBLE, &temp2_double); + isnan1 = HDisnan(temp1_double); + isnan2 = HDisnan(temp2_double); } /* both not NaN, do the comparison */ @@ -1962,7 +1961,7 @@ static hsize_t diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t index, if (not_comparable && !both_zero) { if (print_data(opts)) { - print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); + print_pos(ph, 1, idx, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(F_FORMAT_P_NOTCOMP, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); } @@ -1970,7 +1969,7 @@ static hsize_t diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t index, } else if (per > opts->percent) { if (print_data(opts)) { - print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); + print_pos(ph, 1, idx, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(F_FORMAT_P, temp1_double, temp2_double, ABS(temp1_double - temp2_double), ABS(1 - temp2_double / temp1_double)); } @@ -1980,7 +1979,7 @@ static hsize_t diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t index, /* only one is NaN, assume difference */ else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { if (print_data(opts)) { - print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); + print_pos(ph, 0, idx, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(F_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); } @@ -1997,8 +1996,8 @@ static hsize_t diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t index, *------------------------------------------------------------------------- */ if (opts->do_nans) { - isnan1 = my_isnan(FLT_DOUBLE, &temp1_double); - isnan2 = my_isnan(FLT_DOUBLE, &temp2_double); + isnan1 = HDisnan(temp1_double); + isnan2 = HDisnan(temp2_double); } /* both not NaN, do the comparison */ @@ -2007,7 +2006,7 @@ static hsize_t diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t index, if (not_comparable && !both_zero) { if (print_data(opts)) { - print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); + print_pos(ph, 1, idx, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(F_FORMAT_P_NOTCOMP, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); } @@ -2016,7 +2015,7 @@ static hsize_t diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t index, else if (per > opts->percent && ABS(temp1_double-temp2_double) > opts->delta) { if (print_data(opts)) { - print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); + print_pos(ph, 1, idx, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(F_FORMAT_P, temp1_double, temp2_double, ABS(temp1_double - temp2_double), ABS(1 - temp2_double / temp1_double)); } @@ -2026,7 +2025,7 @@ static hsize_t diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t index, /* only one is NaN, assume difference */ else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { if (print_data(opts)) { - print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); + print_pos(ph, 0, idx, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(F_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); } @@ -2039,7 +2038,7 @@ static hsize_t diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t index, */ else if (equal_double(temp1_double, temp2_double, opts) == FALSE) { if (print_data(opts)) { - print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); + print_pos(ph, 0, idx, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(F_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); } @@ -2078,15 +2077,15 @@ static hsize_t diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t index, *------------------------------------------------------------------------- */ if (opts->do_nans) { - isnan1 = my_isnan(FLT_LDOUBLE,&temp1_double); - isnan2 = my_isnan(FLT_LDOUBLE,&temp2_double); + isnan1 = HDisnan(temp1_double); + isnan2 = HDisnan(temp2_double); } /* both not NaN, do the comparison */ if (!isnan1 && !isnan2) { if (ABS(temp1_double-temp2_double) > opts->delta) { if (print_data(opts)) { - print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); + print_pos(ph, 0, idx, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(LD_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); } @@ -2096,7 +2095,7 @@ static hsize_t diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t index, /* only one is NaN, assume difference */ else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { if (print_data(opts)) { - print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); + print_pos(ph, 0, idx, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(F_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); } @@ -2113,8 +2112,8 @@ static hsize_t diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t index, *------------------------------------------------------------------------- */ if (opts->do_nans) { - isnan1 = my_isnan(FLT_LDOUBLE, &temp1_double); - isnan2 = my_isnan(FLT_LDOUBLE, &temp2_double); + isnan1 = HDisnan(temp1_double); + isnan2 = HDisnan(temp2_double); } /* both not NaN, do the comparison */ @@ -2123,7 +2122,7 @@ static hsize_t diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t index, if (not_comparable && !both_zero) { if (print_data(opts)) { - print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); + print_pos(ph, 1, idx, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(LD_FORMAT_P_NOTCOMP, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); } @@ -2131,7 +2130,7 @@ static hsize_t diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t index, } else if (per > opts->percent) { if (print_data(opts)) { - print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); + print_pos(ph, 1, idx, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(LD_FORMAT_P, temp1_double, temp2_double, ABS(temp1_double - temp2_double), ABS(1 - temp2_double / temp1_double)); } @@ -2141,7 +2140,7 @@ static hsize_t diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t index, /* only one is NaN, assume difference */ else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { if (print_data(opts)) { - print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); + print_pos(ph, 0, idx, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(F_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); } @@ -2158,8 +2157,8 @@ static hsize_t diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t index, *------------------------------------------------------------------------- */ if (opts->do_nans) { - isnan1 = my_isnan(FLT_LDOUBLE, &temp1_double); - isnan2 = my_isnan(FLT_LDOUBLE, &temp2_double); + isnan1 = HDisnan(temp1_double); + isnan2 = HDisnan(temp2_double); } /* both not NaN, do the comparison */ @@ -2168,7 +2167,7 @@ static hsize_t diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t index, if (not_comparable && !both_zero) { if (print_data(opts)) { - print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); + print_pos(ph, 1, idx, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(LD_FORMAT_P_NOTCOMP, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); } @@ -2176,7 +2175,7 @@ static hsize_t diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t index, } else if (per > opts->percent && ABS(temp1_double-temp2_double) > opts->delta) { if (print_data(opts)) { - print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); + print_pos(ph, 1, idx, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(LD_FORMAT_P, temp1_double, temp2_double, ABS(temp1_double - temp2_double), ABS(1 - temp2_double / temp1_double)); } @@ -2186,7 +2185,7 @@ static hsize_t diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t index, /* only one is NaN, assume difference */ else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { if (print_data(opts)) { - print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); + print_pos(ph, 0, idx, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(F_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); } @@ -2199,7 +2198,7 @@ static hsize_t diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t index, */ else if (equal_ldouble(temp1_double, temp2_double, opts) == FALSE) { if (print_data(opts)) { - print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); + print_pos(ph, 0, idx, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(LD_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); } @@ -2215,9 +2214,7 @@ static hsize_t diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t index, done: opts->err_stat = opts->err_stat | ret_value; - H5TOOLS_DEBUG("diff_datum finish:%d - errstat:%d", nfound, opts->err_stat); - - H5TOOLS_ENDDEBUG(""); + H5TOOLS_ENDDEBUG(":%d - errstat:%d", nfound, opts->err_stat); return nfound; } @@ -2633,8 +2630,8 @@ static hsize_t diff_float(unsigned char *mem1, unsigned char *mem2, *------------------------------------------------------------------------- */ if (opts->do_nans) { - isnan1 = my_isnan(FLT_FLOAT, &temp1_float); - isnan2 = my_isnan(FLT_FLOAT, &temp2_float); + isnan1 = HDisnan(temp1_float); + isnan2 = HDisnan(temp2_float); } /* both not NaN, do the comparison */ @@ -2678,8 +2675,8 @@ static hsize_t diff_float(unsigned char *mem1, unsigned char *mem2, *------------------------------------------------------------------------- */ if (opts->do_nans) { - isnan1 = my_isnan(FLT_FLOAT, &temp1_float); - isnan2 = my_isnan(FLT_FLOAT, &temp2_float); + isnan1 = HDisnan(temp1_float); + isnan2 = HDisnan(temp2_float); } /* both not NaN, do the comparison */ if ((!isnan1 && !isnan2)) { @@ -2733,8 +2730,8 @@ static hsize_t diff_float(unsigned char *mem1, unsigned char *mem2, *------------------------------------------------------------------------- */ if (opts->do_nans) { - isnan1 = my_isnan(FLT_FLOAT, &temp1_float); - isnan2 = my_isnan(FLT_FLOAT, &temp2_float); + isnan1 = HDisnan(temp1_float); + isnan2 = HDisnan(temp2_float); } /* both not NaN, do the comparison */ @@ -2843,8 +2840,8 @@ static hsize_t diff_double(unsigned char *mem1, unsigned char *mem2, *------------------------------------------------------------------------- */ if (opts->do_nans) { - isnan1 = my_isnan(FLT_DOUBLE, &temp1_double); - isnan2 = my_isnan(FLT_DOUBLE, &temp2_double); + isnan1 = HDisnan(temp1_double); + isnan2 = HDisnan(temp2_double); } /* both not NaN, do the comparison */ @@ -2889,8 +2886,8 @@ static hsize_t diff_double(unsigned char *mem1, unsigned char *mem2, *------------------------------------------------------------------------- */ if (opts->do_nans) { - isnan1 = my_isnan(FLT_DOUBLE, &temp1_double); - isnan2 = my_isnan(FLT_DOUBLE, &temp2_double); + isnan1 = HDisnan(temp1_double); + isnan2 = HDisnan(temp2_double); } /* both not NaN, do the comparison */ if (!isnan1 && !isnan2) { @@ -2945,8 +2942,8 @@ static hsize_t diff_double(unsigned char *mem1, unsigned char *mem2, *------------------------------------------------------------------------- */ if (opts->do_nans) { - isnan1 = my_isnan(FLT_DOUBLE, &temp1_double); - isnan2 = my_isnan(FLT_DOUBLE, &temp2_double); + isnan1 = HDisnan(temp1_double); + isnan2 = HDisnan(temp2_double); } /* both not NaN, do the comparison */ @@ -3062,8 +3059,8 @@ static hsize_t diff_ldouble(unsigned char *mem1, *------------------------------------------------------------------------- */ if (opts->do_nans) { - isnan1 = my_isnan(FLT_LDOUBLE,&temp1_double); - isnan2 = my_isnan(FLT_LDOUBLE,&temp2_double); + isnan1 = HDisnan(temp1_double); + isnan2 = HDisnan(temp2_double); } /* both not NaN, do the comparison */ @@ -3108,8 +3105,8 @@ static hsize_t diff_ldouble(unsigned char *mem1, *------------------------------------------------------------------------- */ if (opts->do_nans) { - isnan1 = my_isnan(FLT_LDOUBLE, &temp1_double); - isnan2 = my_isnan(FLT_LDOUBLE, &temp2_double); + isnan1 = HDisnan(temp1_double); + isnan2 = HDisnan(temp2_double); } /* both not NaN, do the comparison */ if (!isnan1 && !isnan2) { @@ -3162,8 +3159,8 @@ static hsize_t diff_ldouble(unsigned char *mem1, *------------------------------------------------------------------------- */ if (opts->do_nans) { - isnan1 = my_isnan(FLT_LDOUBLE, &temp1_double); - isnan2 = my_isnan(FLT_LDOUBLE, &temp2_double); + isnan1 = HDisnan(temp1_double); + isnan2 = HDisnan(temp2_double); } /* both not NaN, do the comparison */ @@ -4541,8 +4538,8 @@ static hbool_t equal_double(double value, double expected, diff_opt_t *opts) { * detect NaNs *------------------------------------------------------------------------- */ - hbool_t isnan1 = my_isnan(FLT_DOUBLE, &value); - hbool_t isnan2 = my_isnan(FLT_DOUBLE, &expected); + hbool_t isnan1 = HDisnan(value); + hbool_t isnan2 = HDisnan(expected); /*------------------------------------------------------------------------- * we consider NaN == NaN to be true @@ -4589,8 +4586,8 @@ hbool_t equal_ldouble(long double value, long double expected, diff_opt_t *opts) * detect NaNs *------------------------------------------------------------------------- */ - hbool_t isnan1 = my_isnan(FLT_LDOUBLE, &value); - hbool_t isnan2 = my_isnan(FLT_LDOUBLE, &expected); + hbool_t isnan1 = HDisnan(value); + hbool_t isnan2 = HDisnan(expected); /*------------------------------------------------------------------------- * we consider NaN == NaN to be true @@ -4635,8 +4632,8 @@ static hbool_t equal_float(float value, float expected, diff_opt_t *opts) { * detect NaNs *------------------------------------------------------------------------- */ - hbool_t isnan1 = my_isnan(FLT_FLOAT, &value); - hbool_t isnan2 = my_isnan(FLT_FLOAT, &expected); + hbool_t isnan1 = HDisnan(value); + hbool_t isnan2 = HDisnan(expected); /*------------------------------------------------------------------------- * we consider NaN == NaN to be true @@ -4667,79 +4664,6 @@ static hbool_t equal_float(float value, float expected, diff_opt_t *opts) { return FALSE; } -/*------------------------------------------------------------------------- - * Function: my_isnan - * - * Purpose: Determines whether VAL points to NaN. - * - * Return: TRUE or FALSE - *------------------------------------------------------------------------- - */ -static hbool_t my_isnan(dtype_t type, void *val) { - hbool_t retval = FALSE; - char s[256]; - - if (FLT_FLOAT == type) { - float x; - - HDmemcpy(&x, val, sizeof(float)); - retval = (x != x); - } - else if (FLT_DOUBLE == type) { - double x; - - HDmemcpy(&x, val, sizeof(double)); - retval = (x != x); - } -#if H5_SIZEOF_LONG_DOUBLE != H5_SIZEOF_DOUBLE && H5_SIZEOF_LONG_DOUBLE != 0 - else if (FLT_LDOUBLE == type) { - long double x; - - HDmemcpy(&x, val, sizeof(long double)); - retval = (x!=x); - } -#endif - else - return FALSE; - - /* - * Sometimes NaN==NaN (e.g., DEC Alpha) so we try to print it and see if - * the result contains a NaN string. - */ - if (!retval) { - if (FLT_FLOAT == type) { - float x; - - HDmemcpy(&x, val, sizeof(float)); - HDsnprintf(s, sizeof(s), "%g", (double) x); - } - else if (FLT_DOUBLE == type) { - double x; - - HDmemcpy(&x, val, sizeof(double)); - HDsnprintf(s, sizeof(s), "%g", x); - } -#if H5_SIZEOF_LONG_DOUBLE != H5_SIZEOF_DOUBLE && H5_SIZEOF_LONG_DOUBLE != 0 - else if (FLT_LDOUBLE == type) { - long double x; - - HDmemcpy(&x, val, sizeof(long double)); - HDsnprintf(s, sizeof(s), "%Lg", x); - } -#endif - else - return FALSE; - - if (HDstrstr(s, "NaN") || - HDstrstr(s, "NAN") || - HDstrstr(s, "nan") || - HDstrstr(s, "-1.#IND")) { - retval = TRUE; - } - } - - return retval; -} /*------------------------------------------------------------------------- * diff --git a/tools/lib/h5diff_attr.c b/tools/lib/h5diff_attr.c index 087414d..5ad29fc 100644 --- a/tools/lib/h5diff_attr.c +++ b/tools/lib/h5diff_attr.c @@ -152,7 +152,6 @@ static herr_t build_match_list_attrs(hid_t loc1_id, hid_t loc2_id, table_attrs_t unsigned i; herr_t ret_value = SUCCEED; - H5TOOLS_START_DEBUG(" - errstat:%d", opts->err_stat); if(H5Oget_info3(loc1_id, &oinfo1, H5O_INFO_NUM_ATTRS) < 0) { diff --git a/tools/lib/h5tools.c b/tools/lib/h5tools.c index 47f6e3f..33f1e11 100644 --- a/tools/lib/h5tools.c +++ b/tools/lib/h5tools.c @@ -12,8 +12,8 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Purpose: A library for displaying the values of a dataset in a human - * readable format. + * Purpose: A library for routines that are common + * amongst the various HDF5 tools. */ #include "h5tools.h" diff --git a/tools/lib/h5tools_utils.h b/tools/lib/h5tools_utils.h index 366800a..598930c 100644 --- a/tools/lib/h5tools_utils.h +++ b/tools/lib/h5tools_utils.h @@ -129,7 +129,7 @@ H5TOOLS_DLL void warn_msg(const char *fmt, ...); H5TOOLS_DLL void help_ref_msg(FILE *output); H5TOOLS_DLL void free_table(table_t *table); #ifdef H5DUMP_DEBUG -H5TOOLS_DLL void dump_tables(find_objs_t *info) +H5TOOLS_DLL void dump_tables(find_objs_t *info); #endif /* H5DUMP_DEBUG */ H5TOOLS_DLL herr_t init_objs(hid_t fid, find_objs_t *info, table_t **group_table, table_t **dset_table, table_t **type_table); H5TOOLS_DLL obj_t *search_obj(table_t *temp, const H5O_token_t *obj_token); diff --git a/tools/src/h5diff/CMakeLists.txt b/tools/src/h5diff/CMakeLists.txt index c1021e4..2009a14 100644 --- a/tools/src/h5diff/CMakeLists.txt +++ b/tools/src/h5diff/CMakeLists.txt @@ -10,7 +10,7 @@ if (NOT ONLY_SHARED_LIBS) ${HDF5_TOOLS_SRC_H5DIFF_SOURCE_DIR}/h5diff_main.c ) target_include_directories (h5diff PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>") - #target_compile_definitions(h5diff PRIVATE H5_TOOLS_DEBUG) + #target_compile_definitions (h5diff PRIVATE H5_TOOLS_DEBUG) TARGET_C_PROPERTIES (h5diff STATIC) target_link_libraries (h5diff PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) set_target_properties (h5diff PROPERTIES FOLDER tools) @@ -24,7 +24,7 @@ if (BUILD_SHARED_LIBS) ${HDF5_TOOLS_SRC_H5DIFF_SOURCE_DIR}/h5diff_main.c ) target_include_directories (h5diff-shared PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>") - #target_compile_definitions(h5diff-shared PRIVATE H5_TOOLS_DEBUG) + #target_compile_definitions (h5diff-shared PRIVATE H5_TOOLS_DEBUG) TARGET_C_PROPERTIES (h5diff-shared SHARED) target_link_libraries (h5diff-shared PRIVATE ${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) set_target_properties (h5diff-shared PROPERTIES FOLDER tools) diff --git a/tools/src/h5diff/ph5diff_main.c b/tools/src/h5diff/ph5diff_main.c index 5ba5fb3..c473c8b 100644 --- a/tools/src/h5diff/ph5diff_main.c +++ b/tools/src/h5diff/ph5diff_main.c @@ -166,7 +166,7 @@ ph5diff_worker(int nID) { struct diff_mpi_args args; struct diffs_found diffs; - int i; + unsigned i; /* Make certain we've received the filenames and opened the files already */ if(file1_id < 0 || file2_id < 0) diff --git a/tools/src/h5import/h5import.c b/tools/src/h5import/h5import.c index fc4d431..b11fe7f 100644 --- a/tools/src/h5import/h5import.c +++ b/tools/src/h5import/h5import.c @@ -1431,7 +1431,7 @@ static int processConfigurationFile(char *infile, struct Input *in) /* Initialize machine endian */ volatile uint32_t ibyte=0x01234567; /* 0 for big endian, 1 for little endian. */ - if ((*((uint8_t*)(&ibyte))) == 0x67) { + if ((*((volatile uint8_t*)(&ibyte))) == 0x67) { if ((kindex = OutputByteOrderStrToInt("LE")) == -1) { (void) HDfprintf(stderr, "%s", err11e); return (-1); diff --git a/tools/src/h5ls/h5ls.c b/tools/src/h5ls/h5ls.c index 3dfbb49..f3f9ede 100644 --- a/tools/src/h5ls/h5ls.c +++ b/tools/src/h5ls/h5ls.c @@ -1302,7 +1302,7 @@ dump_reference(FILE *stream, const h5tool_format_t *info, h5tools_context_t *ctx hid_t new_obj_sid = H5I_INVALID_HID; hsize_t elmt_counter = 0; /*counts the # elements printed. */ size_t ncols = 80; /* available output width */ - size_t i; + int i; hsize_t curr_pos = 0; /* total data element position */ h5tools_str_t buffer; /* string into which to render */ h5tools_context_t datactx; /* print context */ @@ -1312,7 +1312,7 @@ dump_reference(FILE *stream, const h5tool_format_t *info, h5tools_context_t *ctx datactx = *ctx; /* print context */ /* Assume entire data space to be printed */ if (datactx.ndims > 0) - for (i = 0; i < (size_t)datactx.ndims; i++) + for (i = 0; (unsigned)i < datactx.ndims; i++) datactx.p_min_idx[i] = 0; datactx.need_prefix = TRUE; @@ -1447,13 +1447,13 @@ dump_reference(FILE *stream, const h5tool_format_t *info, h5tools_context_t *ctx /* Print point information */ H5TOOLS_DEBUG("H5S_SEL_POINTS H5R_DATASET_REGION2"); h5tools_dump_region_data_points(new_obj_sid, new_obj_id, stream, info, &datactx, - &buffer, &curr_pos, ncols, i, elmt_counter); + &buffer, &curr_pos, ncols, (hsize_t)i, elmt_counter); } else if(region_type == H5S_SEL_HYPERSLABS) { /* Print block information */ H5TOOLS_DEBUG("H5S_SEL_HYPERSLABS H5R_DATASET_REGION2"); h5tools_dump_region_data_blocks(new_obj_sid, new_obj_id, stream, info, &datactx, - &buffer, &curr_pos, ncols, i, elmt_counter); + &buffer, &curr_pos, ncols, (hsize_t)i, elmt_counter); } else H5TOOLS_INFO("invalid region type"); diff --git a/tools/src/h5repack/h5repack_main.c b/tools/src/h5repack/h5repack_main.c index c0c8a2a..16899a3 100644 --- a/tools/src/h5repack/h5repack_main.c +++ b/tools/src/h5repack/h5repack_main.c @@ -412,7 +412,7 @@ set_sort_order(const char *form) static int parse_command_line(int argc, const char **argv, pack_opt_t* options) { - int opt; + int bound, opt; int ret_value = 0; /* parse command line options */ @@ -492,19 +492,21 @@ int parse_command_line(int argc, const char **argv, pack_opt_t* options) break; case 'j': - options->low_bound = (H5F_libver_t)HDatoi(opt_arg); - if (options->low_bound < H5F_LIBVER_EARLIEST || options->low_bound > H5F_LIBVER_LATEST) { + bound = HDatoi(opt_arg); + if (bound < H5F_LIBVER_EARLIEST || bound > H5F_LIBVER_LATEST) { error_msg("in parsing low bound\n"); goto done; } + options->low_bound = bound; break; case 'k': - options->high_bound = (H5F_libver_t)HDatoi(opt_arg); - if (options->high_bound < H5F_LIBVER_EARLIEST || options->high_bound > H5F_LIBVER_LATEST) { + bound = HDatoi(opt_arg); + if (bound < H5F_LIBVER_EARLIEST || bound > H5F_LIBVER_LATEST) { error_msg("in parsing high bound\n"); goto done; } + options->high_bound = bound; break; case 'c': diff --git a/tools/test/h5copy/CMakeTests.cmake b/tools/test/h5copy/CMakeTests.cmake index b0d1615..4ce0318 100644 --- a/tools/test/h5copy/CMakeTests.cmake +++ b/tools/test/h5copy/CMakeTests.cmake @@ -45,12 +45,6 @@ endforeach () add_custom_target(h5copy_files ALL COMMENT "Copying files needed by h5copy tests" DEPENDS ${h5copy_files_list}) - if (NOT BUILD_SHARED_LIBS) - set (tgt_ext "") - else () - set (tgt_ext "-shared") - endif () - ############################################################################## ############################################################################## ### T H E T E S T S M A C R O S ### @@ -71,7 +65,7 @@ add_test ( NAME H5COPY_F-${testname} - COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5copy${tgt_ext}> -f ${fparam} -i ./testfiles/${infile} -o ./testfiles/${testname}.out.h5 ${vparam} ${sparam} ${srcname} ${dparam} ${dstname} ${ARGN} + COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5copy${tgt_file_ext}> -f ${fparam} -i ./testfiles/${infile} -o ./testfiles/${testname}.out.h5 ${vparam} ${sparam} ${srcname} ${dparam} ${dstname} ${ARGN} ) if (HDF5_ENABLE_USING_MEMCHECKER) if (last_test) @@ -85,7 +79,7 @@ if (NOT ${resultcode} EQUAL 2) add_test ( NAME H5COPY_F-${testname}-DIFF - COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5diff${tgt_ext}> -v ./testfiles/${infile} ./testfiles/${testname}.out.h5 ${srcname} ${dstname} + COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5diff${tgt_file_ext}> -v ./testfiles/${infile} ./testfiles/${testname}.out.h5 ${srcname} ${dstname} ) set_tests_properties (H5COPY_F-${testname}-DIFF PROPERTIES DEPENDS H5COPY_F-${testname}) if (${resultcode} EQUAL 1) @@ -105,7 +99,7 @@ add_test ( NAME H5COPY-${testname} - COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5copy${tgt_ext}> -i ./testfiles/${infile} -o ./testfiles/${testname}.out.h5 ${vparam} ${sparam} ${srcname} ${dparam} ${dstname} ${ARGN} + COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5copy${tgt_file_ext}> -i ./testfiles/${infile} -o ./testfiles/${testname}.out.h5 ${vparam} ${sparam} ${srcname} ${dparam} ${dstname} ${ARGN} ) if (HDF5_ENABLE_USING_MEMCHECKER) if (last_test) @@ -119,7 +113,7 @@ if (NOT ${resultcode} EQUAL 2) add_test ( NAME H5COPY-${testname}-DIFF - COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5diff${tgt_ext}> -v ./testfiles/${infile} ./testfiles/${testname}.out.h5 ${srcname} ${dstname} + COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5diff${tgt_file_ext}> -v ./testfiles/${infile} ./testfiles/${testname}.out.h5 ${srcname} ${dstname} ) set_tests_properties (H5COPY-${testname}-DIFF PROPERTIES DEPENDS H5COPY-${testname}) if (${resultcode} EQUAL 1) @@ -149,7 +143,7 @@ add_test ( NAME H5COPY-${testname}-prefill - COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5copy${tgt_ext}> -i ./testfiles/${infile} -o ./testfiles/${testname}.out.h5 -v -s ${psparam} -d ${pdparam} + COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5copy${tgt_file_ext}> -i ./testfiles/${infile} -o ./testfiles/${testname}.out.h5 -v -s ${psparam} -d ${pdparam} ) if (HDF5_ENABLE_USING_MEMCHECKER) if (last_test) @@ -161,14 +155,14 @@ add_test ( NAME H5COPY-${testname} - COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5copy${tgt_ext}> -i ./testfiles/${infile} -o ./testfiles/${testname}.out.h5 ${vparam} ${sparam} ${srcname} ${dparam} ${dstname} ${ARGN} + COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5copy${tgt_file_ext}> -i ./testfiles/${infile} -o ./testfiles/${testname}.out.h5 ${vparam} ${sparam} ${srcname} ${dparam} ${dstname} ${ARGN} ) set_tests_properties (H5COPY-${testname} PROPERTIES DEPENDS H5COPY-${testname}-prefill) # resultcode=2 will cause the test to skip the diff test if (NOT ${resultcode} EQUAL 2) add_test ( NAME H5COPY-${testname}-DIFF - COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5diff${tgt_ext}> -v ./testfiles/${infile} ./testfiles/${testname}.out.h5 ${srcname} ${dstname} + COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5diff${tgt_file_ext}> -v ./testfiles/${infile} ./testfiles/${testname}.out.h5 ${srcname} ${dstname} ) set_tests_properties (H5COPY-${testname}-DIFF PROPERTIES DEPENDS H5COPY-${testname}) if (${resultcode} EQUAL 1) @@ -188,7 +182,7 @@ add_test ( NAME H5COPY_SAME-${testname}-prefill - COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5copy${tgt_ext}> -i ./testfiles/${pfile} -o ./testfiles/${testname}.out.h5 -v -s ${psparam} -d ${pdparam} + COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5copy${tgt_file_ext}> -i ./testfiles/${pfile} -o ./testfiles/${testname}.out.h5 -v -s ${psparam} -d ${pdparam} ) if (HDF5_ENABLE_USING_MEMCHECKER) if (last_test) @@ -200,14 +194,14 @@ add_test ( NAME H5COPY_SAME-${testname} - COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5copy${tgt_ext}> -i ./testfiles/${testname}.out.h5 -o ./testfiles/${testname}.out.h5 ${vparam} ${sparam} ${srcname} ${dparam} ${dstname} ${ARGN} + COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5copy${tgt_file_ext}> -i ./testfiles/${testname}.out.h5 -o ./testfiles/${testname}.out.h5 ${vparam} ${sparam} ${srcname} ${dparam} ${dstname} ${ARGN} ) set_tests_properties (H5COPY_SAME-${testname} PROPERTIES DEPENDS H5COPY_SAME-${testname}-prefill) # resultcode=2 will cause the test to skip the diff test if (NOT ${resultcode} EQUAL 2) add_test ( NAME H5COPY_SAME-${testname}-DIFF - COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5diff${tgt_ext}> -v ./testfiles/${testname}.out.h5 ./testfiles/${testname}.out.h5 ${srcname} ${dstname} + COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5diff${tgt_file_ext}> -v ./testfiles/${testname}.out.h5 ./testfiles/${testname}.out.h5 ${srcname} ${dstname} ) set_tests_properties (H5COPY_SAME-${testname}-DIFF PROPERTIES DEPENDS H5COPY_SAME-${testname}) if (${resultcode} EQUAL 1) @@ -223,7 +217,7 @@ macro (ADD_H5_CMP_TEST testname resultcode infile vparam sparam srcname dparam dstname) # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) - add_test (NAME H5COPY-CMP-${testname} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5copy${tgt_ext}> -i ./testfiles/${infile} -o ./testfiles/${testname}.out.h5 ${vparam} ${sparam} ${srcname} ${dparam} ${dstname} ${ARGN}) + add_test (NAME H5COPY-CMP-${testname} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5copy${tgt_file_ext}> -i ./testfiles/${infile} -o ./testfiles/${testname}.out.h5 ${vparam} ${sparam} ${srcname} ${dparam} ${dstname} ${ARGN}) if (${resultcode} EQUAL 1) set_tests_properties (H5COPY-CMP-${testname} PROPERTIES WILL_FAIL "true") endif () @@ -240,7 +234,7 @@ NAME H5COPY-CMP-${testname} COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" - -D "TEST_PROGRAM=$<TARGET_FILE:h5copy${tgt_ext}>" + -D "TEST_PROGRAM=$<TARGET_FILE:h5copy${tgt_file_ext}>" -D "TEST_ARGS=-i;./testfiles/${infile};-o;./testfiles/${testname}.out.h5;${vparam};${sparam};${srcname};${dparam};${dstname}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" -D "TEST_OUTPUT=./testfiles/${testname}.out.out" diff --git a/tools/test/h5copy/h5copygentest.c b/tools/test/h5copy/h5copygentest.c index 716b0d2..2a8a575 100644 --- a/tools/test/h5copy/h5copygentest.c +++ b/tools/test/h5copy/h5copygentest.c @@ -744,9 +744,9 @@ static void Test_Obj_Copy(void) /* Set the FAPL for the type of format */ /* Create source file */ if(new_format) - fid = H5Fcreate(HDF_FILE1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_new); - else - fid = H5Fcreate(HDF_FILE1_NEW, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); + fid = H5Fcreate(HDF_FILE1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_new); + else + fid = H5Fcreate(HDF_FILE1_NEW, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); if(fid < 0) { HDfprintf(stderr, "Error: H5Fcreate failed.\n"); goto out; @@ -756,7 +756,7 @@ static void Test_Obj_Copy(void) gent_empty_group(fid); gent_nested_datasets(fid); gent_nested_group(fid); - gent_att_compound_vlstr(fid); + gent_att_compound_vlstr(fid); H5Fclose(fid); fid = (-1); diff --git a/tools/test/h5diff/CMakeTests.cmake b/tools/test/h5diff/CMakeTests.cmake index 88ed62c..3d9c6f5 100644 --- a/tools/test/h5diff/CMakeTests.cmake +++ b/tools/test/h5diff/CMakeTests.cmake @@ -363,12 +363,6 @@ endif () add_custom_target(h5diff_files ALL COMMENT "Copying files needed by h5diff tests" DEPENDS ${h5diff_files_list}) - if (NOT BUILD_SHARED_LIBS) - set (tgt_ext "") - else () - set (tgt_ext "-shared") - endif () - ############################################################################## ############################################################################## ### T H E T E S T S M A C R O S ### @@ -379,7 +373,7 @@ if (HDF5_TEST_SERIAL) # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) - add_test (NAME H5DIFF-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5diff${tgt_ext}> ${ARGN}) + add_test (NAME H5DIFF-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5diff${tgt_file_ext}> ${ARGN}) set_tests_properties (H5DIFF-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") if (${resultcode}) set_tests_properties (H5DIFF-${resultfile} PROPERTIES WILL_FAIL "true") @@ -392,7 +386,7 @@ NAME H5DIFF-${resultfile} COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" - -D "TEST_PROGRAM=$<TARGET_FILE:h5diff${tgt_ext}>" + -D "TEST_PROGRAM=$<TARGET_FILE:h5diff${tgt_file_ext}>" -D "TEST_ARGS:STRING=${ARGN}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" -D "TEST_OUTPUT=${resultfile}.out" @@ -414,7 +408,7 @@ macro (ADD_PH5_TEST resultfile resultcode) # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) - add_test (NAME MPI_TEST_H5DIFF-${resultfile} COMMAND ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_PREFLAGS} $<TARGET_FILE:ph5diff> ${MPIEXEC_POSTFLAGS} ${ARGN}) + add_test (NAME MPI_TEST_H5DIFF-${resultfile} COMMAND ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_PREFLAGS} $<TARGET_FILE:ph5diff${tgt_file_ext}> ${MPIEXEC_POSTFLAGS} ${ARGN}) set_tests_properties (MPI_TEST_H5DIFF-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/PAR/testfiles") if (${resultcode}) set_tests_properties (MPI_TEST_H5DIFF-${resultfile} PROPERTIES WILL_FAIL "true") @@ -426,7 +420,7 @@ add_test ( NAME MPI_TEST_H5DIFF-${resultfile} COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=${MPIEXEC_EXECUTABLE};${MPIEXEC_NUMPROC_FLAG};${MPIEXEC_MAX_NUMPROCS};${MPIEXEC_PREFLAGS};$<TARGET_FILE:ph5diff>;${MPIEXEC_POSTFLAGS}" + -D "TEST_PROGRAM=${MPIEXEC_EXECUTABLE};${MPIEXEC_NUMPROC_FLAG};${MPIEXEC_MAX_NUMPROCS};${MPIEXEC_PREFLAGS};$<TARGET_FILE:ph5diff${tgt_file_ext}>;${MPIEXEC_POSTFLAGS}" -D "TEST_ARGS:STRING=${ARGN}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/PAR/testfiles" -D "TEST_OUTPUT=${resultfile}.out" diff --git a/tools/test/h5dump/CMakeTests.cmake b/tools/test/h5dump/CMakeTests.cmake index 2e731f3..187328e 100644 --- a/tools/test/h5dump/CMakeTests.cmake +++ b/tools/test/h5dump/CMakeTests.cmake @@ -420,16 +420,10 @@ ############################################################################## ############################################################################## - if (NOT BUILD_SHARED_LIBS) - set (tgt_ext "") - else () - set (tgt_ext "-shared") - endif () - macro (ADD_HELP_TEST testname resultcode) # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) - add_test (NAME H5DUMP-${testname} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5dump${tgt_ext}> ${ARGN}) + add_test (NAME H5DUMP-${testname} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5dump${tgt_file_ext}> ${ARGN}) set_tests_properties (H5DUMP-${testname} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") if (last_test) set_tests_properties (H5DUMP-${testname} PROPERTIES DEPENDS ${last_test}) @@ -440,7 +434,7 @@ NAME H5DUMP-${testname} COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" - -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>" + -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_file_ext}>" -D "TEST_ARGS:STRING=${ARGN}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles/std" -D "TEST_OUTPUT=h5dump-${testname}.out" @@ -471,7 +465,7 @@ macro (ADD_H5_TEST resultfile resultcode) # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) - add_test (NAME H5DUMP-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5dump${tgt_ext}> ${ARGN}) + add_test (NAME H5DUMP-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5dump${tgt_file_ext}> ${ARGN}) set_tests_properties (H5DUMP-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") if (${resultcode}) set_tests_properties (H5DUMP-${resultfile} PROPERTIES WILL_FAIL "true") @@ -489,7 +483,7 @@ NAME H5DUMP-${resultfile} COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" - -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>" + -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_file_ext}>" -D "TEST_ARGS:STRING=${ARGN}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles/std" -D "TEST_OUTPUT=${resultfile}.out" @@ -504,7 +498,7 @@ macro (ADD_H5_TEST_N resultfile resultcode) # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) - add_test (NAME H5DUMP-N-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5dump${tgt_ext}> ${ARGN}) + add_test (NAME H5DUMP-N-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5dump${tgt_file_ext}> ${ARGN}) set_tests_properties (H5DUMP-N-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") if (${resultcode}) set_tests_properties (H5DUMP-N-${resultfile} PROPERTIES WILL_FAIL "true") @@ -522,7 +516,7 @@ NAME H5DUMP-N-${resultfile} COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" - -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>" + -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_file_ext}>" -D "TEST_ARGS:STRING=${ARGN}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles/std" -D "TEST_OUTPUT=${resultfile}-N.out" @@ -537,7 +531,7 @@ macro (ADD_H5_TEST_EXPORT resultfile targetfile resultcode) # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) - add_test (NAME H5DUMP-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5dump${tgt_ext}> ${ARGN} ${resultfile}.txt ${targetfile}) + add_test (NAME H5DUMP-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5dump${tgt_file_ext}> ${ARGN} ${resultfile}.txt ${targetfile}) set_tests_properties (H5DUMP-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") if (${resultcode}) set_tests_properties (H5DUMP-${resultfile} PROPERTIES WILL_FAIL "true") @@ -555,7 +549,7 @@ NAME H5DUMP-${resultfile} COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" - -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>" + -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_file_ext}>" -D "TEST_ARGS:STRING=${ARGN};${resultfile}.txt;${targetfile}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles/std" -D "TEST_OUTPUT=${resultfile}.out" @@ -578,7 +572,7 @@ macro (ADD_H5_TEST_EXPORT_DDL resultfile targetfile resultcode ddlfile) # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) - add_test (NAME H5DUMP-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5dump${tgt_ext}> --ddl=${ddlfile}.txt ${ARGN} ${resultfile}.txt ${targetfile}) + add_test (NAME H5DUMP-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5dump${tgt_file_ext}> --ddl=${ddlfile}.txt ${ARGN} ${resultfile}.txt ${targetfile}) set_tests_properties (H5DUMP-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") if (${resultcode}) set_tests_properties (H5DUMP-${resultfile} PROPERTIES WILL_FAIL "true") @@ -598,7 +592,7 @@ NAME H5DUMP-${resultfile} COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" - -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>" + -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_file_ext}>" -D "TEST_ARGS:STRING=--ddl=${ddlfile}.txt;${ARGN};${resultfile}.txt;${targetfile}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles/std" -D "TEST_OUTPUT=${resultfile}.out" @@ -633,7 +627,7 @@ set_tests_properties (H5DUMP-output-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") add_test ( NAME H5DUMP-output-${resultfile} - COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5dump${tgt_ext}> ${ARGN} ${resultfile}.txt ${targetfile} + COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5dump${tgt_file_ext}> ${ARGN} ${resultfile}.txt ${targetfile} ) set_tests_properties (H5DUMP-output-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") set_tests_properties (H5DUMP-output-${resultfile} PROPERTIES DEPENDS H5DUMP-output-${resultfile}-clear-objects) @@ -654,7 +648,7 @@ NAME H5DUMP-${resultfile} COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" - -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>" + -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_file_ext}>" -D "TEST_ARGS:STRING=${ARGN}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles/std" -D "TEST_OUTPUT=${resultfile}.out" @@ -672,7 +666,7 @@ NAME H5DUMP-${resultfile} COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" - -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>" + -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_file_ext}>" -D "TEST_ARGS:STRING=${ARGN}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles/std" -D "TEST_OUTPUT=${resultfile}.out" @@ -689,7 +683,7 @@ NAME H5DUMP-${resultfile} COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" - -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>" + -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_file_ext}>" -D "TEST_ARGS:STRING=${ARGN}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles/std" -D "TEST_OUTPUT=${resultfile}.out" @@ -707,7 +701,7 @@ NAME H5DUMP-${resultfile} COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" - -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>" + -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_file_ext}>" -D "TEST_ARGS:STRING=${ARGN}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles/std" -D "TEST_OUTPUT=${resultfile}.out" @@ -735,7 +729,7 @@ NAME H5DUMP-IMPORT-${resultfile} COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" - -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>" + -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_file_ext}>" -D "TEST_ARGS:STRING=${ARGN};-o;${resultfile}.bin;${testfile}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles/std" -D "TEST_OUTPUT=${conffile}.out" @@ -744,10 +738,10 @@ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) set_tests_properties (H5DUMP-IMPORT-${resultfile} PROPERTIES DEPENDS "H5DUMP-IMPORT-${resultfile}-clear-objects") - add_test (NAME H5DUMP-IMPORT-h5import-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5import> ${resultfile}.bin -c ${conffile}.out -o ${resultfile}.h5) + add_test (NAME H5DUMP-IMPORT-h5import-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5import${tgt_file_ext}> ${resultfile}.bin -c ${conffile}.out -o ${resultfile}.h5) set_tests_properties (H5DUMP-IMPORT-h5import-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") set_tests_properties (H5DUMP-IMPORT-h5import-${resultfile} PROPERTIES DEPENDS H5DUMP-IMPORT-${resultfile}) - add_test (NAME H5DUMP-IMPORT-h5diff-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5diff> ${testfile} ${resultfile}.h5 /integer /integer) + add_test (NAME H5DUMP-IMPORT-h5diff-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5diff${tgt_file_ext}> ${testfile} ${resultfile}.h5 /integer /integer) set_tests_properties (H5DUMP-IMPORT-h5diff-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") set_tests_properties (H5DUMP-IMPORT-h5diff-${resultfile} PROPERTIES DEPENDS H5DUMP-IMPORT-h5import-${resultfile}) endif () @@ -759,7 +753,7 @@ NAME H5DUMP_UD-${testname} COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" - -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>" + -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_file_ext}>" -D "TEST_ARGS:STRING=${ARGN}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles/std" -D "TEST_OUTPUT=${resultfile}.out" diff --git a/tools/test/h5dump/CMakeTestsPBITS.cmake b/tools/test/h5dump/CMakeTestsPBITS.cmake index a6be9ae..1e16875 100644 --- a/tools/test/h5dump/CMakeTestsPBITS.cmake +++ b/tools/test/h5dump/CMakeTestsPBITS.cmake @@ -119,16 +119,10 @@ ############################################################################## ############################################################################## - if (NOT BUILD_SHARED_LIBS) - set (tgt_ext "") - else () - set (tgt_ext "-shared") - endif () - macro (ADD_H5_PBITS_TEST resultfile resultcode) # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) - add_test (NAME H5DUMP-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5dump${tgt_ext}> ${ARGN}) + add_test (NAME H5DUMP-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5dump${tgt_file_ext}> ${ARGN}) set_tests_properties (H5DUMP-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/pbits") if (${resultcode}) set_tests_properties (H5DUMP-${resultfile} PROPERTIES WILL_FAIL "true") @@ -141,7 +135,7 @@ NAME H5DUMP-${resultfile} COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" - -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>" + -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_file_ext}>" -D "TEST_ARGS:STRING=${ARGN}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles/pbits" -D "TEST_OUTPUT=${resultfile}.out" diff --git a/tools/test/h5dump/CMakeTestsVDS.cmake b/tools/test/h5dump/CMakeTestsVDS.cmake index 036609c..ae7193c 100644 --- a/tools/test/h5dump/CMakeTestsVDS.cmake +++ b/tools/test/h5dump/CMakeTestsVDS.cmake @@ -115,16 +115,10 @@ ############################################################################## ############################################################################## - if (NOT BUILD_SHARED_LIBS) - set (tgt_ext "") - else () - set (tgt_ext "-shared") - endif () - macro (ADD_H5_VDS_TEST resultfile resultcode) # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) - add_test (NAME H5DUMP-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5dump${tgt_ext}> ${ARGN}) + add_test (NAME H5DUMP-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5dump${tgt_file_ext}> ${ARGN}) set_tests_properties (H5DUMP-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/vds") if (${resultcode}) set_tests_properties (H5DUMP-${resultfile} PROPERTIES WILL_FAIL "true") @@ -137,7 +131,7 @@ NAME H5DUMP-${resultfile} COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" - -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>" + -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_file_ext}>" -D "TEST_ARGS:STRING=${ARGN}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles/vds" -D "TEST_OUTPUT=${resultfile}.out" @@ -151,7 +145,7 @@ macro (ADD_H5_VDS_PREFIX_TEST resultfile resultcode) # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) - add_test (NAME H5DUMP_PREFIX-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5dump${tgt_ext}> ${ARGN}) + add_test (NAME H5DUMP_PREFIX-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5dump${tgt_file_ext}> ${ARGN}) set_tests_properties (H5DUMP_PREFIX-${resultfile} PROPERTIES ENVIRONMENT "HDF5_VDS_PREFIX=${PROJECT_BINARY_DIR}/testfiles/vds/" WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/vds/prefix" @@ -167,7 +161,7 @@ NAME H5DUMP_PREFIX-${resultfile} COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" - -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>" + -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_file_ext}>" -D "TEST_ARGS:STRING=${ARGN}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles/vds/prefix" -D "TEST_OUTPUT=${resultfile}.out" @@ -183,7 +177,7 @@ macro (ADD_H5_VDS_LAYOUT resultfile resultcode) # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) - add_test (NAME H5DUMP-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5dump${tgt_ext}> -p ${ARGN}) + add_test (NAME H5DUMP-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5dump${tgt_file_ext}> -p ${ARGN}) set_tests_properties (H5DUMP-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/vds") if (${resultcode}) set_tests_properties (H5DUMP-${resultfile} PROPERTIES WILL_FAIL "true") @@ -196,7 +190,7 @@ NAME H5DUMP-${resultfile} COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" - -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>" + -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_file_ext}>" -D "TEST_ARGS:STRING=-p;${ARGN}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles/vds" -D "TEST_OUTPUT=${resultfile}.out" diff --git a/tools/test/h5dump/CMakeTestsXML.cmake b/tools/test/h5dump/CMakeTestsXML.cmake index 6d73cb1..985d940 100644 --- a/tools/test/h5dump/CMakeTestsXML.cmake +++ b/tools/test/h5dump/CMakeTestsXML.cmake @@ -160,12 +160,6 @@ ############################################################################## ############################################################################## - if (NOT BUILD_SHARED_LIBS) - set (tgt_ext "") - else () - set (tgt_ext "-shared") - endif () - macro (ADD_XML_SKIP_H5_TEST skipresultfile skipresultcode testtype) if ("${testtype}" STREQUAL "SKIP") if (NOT HDF5_ENABLE_USING_MEMCHECKER) @@ -182,7 +176,7 @@ macro (ADD_XML_H5_TEST resultfile resultcode) if (HDF5_ENABLE_USING_MEMCHECKER) - add_test (NAME H5DUMP_XML-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5dump${tgt_ext}> --xml ${ARGN}) + add_test (NAME H5DUMP_XML-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5dump${tgt_file_ext}> --xml ${ARGN}) set_tests_properties (H5DUMP_XML-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/xml") if (${resultcode}) set_tests_properties (H5DUMP_XML-${resultfile} PROPERTIES WILL_FAIL "true") @@ -195,7 +189,7 @@ NAME H5DUMP_XML-${resultfile} COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" - -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>" + -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_file_ext}>" -D "TEST_ARGS:STRING=--xml;${ARGN}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles/xml" -D "TEST_OUTPUT=${resultfile}.out" diff --git a/tools/test/h5dump/CMakeVFDTests.cmake b/tools/test/h5dump/CMakeVFDTests.cmake index 0a345ef..337cfe2 100644 --- a/tools/test/h5dump/CMakeVFDTests.cmake +++ b/tools/test/h5dump/CMakeVFDTests.cmake @@ -53,19 +53,13 @@ add_custom_target(HDF5_VFD_H5DUMP_files ALL COMMENT "Copying files needed by HDF ############################################################################## ############################################################################## -if (NOT BUILD_SHARED_LIBS) - set (tgt_ext "") -else () - set (tgt_ext "-shared") -endif () - macro (ADD_VFD_H5DUMP_TEST vfdname resultfile resultcode) if (NOT HDF5_ENABLE_USING_MEMCHECKER) add_test ( NAME H5DUMP_VFD-${vfdname}-${resultfile}-h5dump COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" - -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>" + -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_file_ext}>" -D "TEST_ARGS:STRING=${ARGN}" -D "TEST_VFD:STRING=${vfdname}" -D "TEST_EXPECT=${resultcode}" diff --git a/tools/test/h5format_convert/CMakeTests.cmake b/tools/test/h5format_convert/CMakeTests.cmake index 398866c..7bc33ce 100644 --- a/tools/test/h5format_convert/CMakeTests.cmake +++ b/tools/test/h5format_convert/CMakeTests.cmake @@ -97,12 +97,6 @@ ############################################################################## ############################################################################## - if (NOT BUILD_SHARED_LIBS) - set (tgt_ext "") - else () - set (tgt_ext "-shared") - endif () - macro (ADD_H5_OUTPUT testname resultfile resultcode testfile) # If using memchecker add tests without using scripts if (NOT HDF5_ENABLE_USING_MEMCHECKER) @@ -123,7 +117,7 @@ NAME H5FC-${testname}-${testfile} COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" - -D "TEST_PROGRAM=$<TARGET_FILE:h5format_convert${tgt_ext}>" + -D "TEST_PROGRAM=$<TARGET_FILE:h5format_convert${tgt_file_ext}>" -D "TEST_ARGS=${ARGN};outtmp.h5" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" -D "TEST_OUTPUT=${testname}.out" @@ -139,7 +133,7 @@ NAME H5FC-${testname}-NA COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" - -D "TEST_PROGRAM=$<TARGET_FILE:h5format_convert${tgt_ext}>" + -D "TEST_PROGRAM=$<TARGET_FILE:h5format_convert${tgt_file_ext}>" -D "TEST_ARGS=${ARGN}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" -D "TEST_OUTPUT=${testname}.out" @@ -172,7 +166,7 @@ NAME H5FC-${testname}-${testfile} COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" - -D "TEST_PROGRAM=$<TARGET_FILE:h5format_convert${tgt_ext}>" + -D "TEST_PROGRAM=$<TARGET_FILE:h5format_convert${tgt_file_ext}>" -D "TEST_ARGS=${ARGN};outtmp.h5" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" -D "TEST_OUTPUT=${testname}.out" @@ -204,7 +198,7 @@ NAME H5FC-${testname}-${testfile} COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" - -D "TEST_PROGRAM=$<TARGET_FILE:h5format_convert${tgt_ext}>" + -D "TEST_PROGRAM=$<TARGET_FILE:h5format_convert${tgt_file_ext}>" -D "TEST_ARGS=${ARGN};outtmp.h5" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" -D "TEST_OUTPUT=${testname}.out" @@ -237,7 +231,7 @@ NAME H5FC-${testname} COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" - -D "TEST_PROGRAM=$<TARGET_FILE:h5format_convert${tgt_ext}>" + -D "TEST_PROGRAM=$<TARGET_FILE:h5format_convert${tgt_file_ext}>" -D "TEST_ARGS=${ARGN};./testfiles/tmp.h5" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" -D "TEST_OUTPUT=testfiles/${testname}.out" @@ -280,7 +274,7 @@ NAME H5FC-${testname} COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" - -D "TEST_PROGRAM=$<TARGET_FILE:h5format_convert${tgt_ext}>" + -D "TEST_PROGRAM=$<TARGET_FILE:h5format_convert${tgt_file_ext}>" -D "TEST_ARGS=-d;${ARGN};./testfiles/chktmp.h5" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" -D "TEST_OUTPUT=testfiles/${testname}.out" @@ -317,7 +311,7 @@ NAME H5FC-${testname} COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" - -D "TEST_PROGRAM=$<TARGET_FILE:h5format_convert${tgt_ext}>" + -D "TEST_PROGRAM=$<TARGET_FILE:h5format_convert${tgt_file_ext}>" -D "TEST_ARGS=${ARGN};./testfiles/dmptmp.h5" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" -D "TEST_OUTPUT=testfiles/${testname}.out" @@ -330,7 +324,7 @@ NAME H5FC_CHECK_DUMP-${testname} COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" - -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>" + -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_file_ext}>" -D "TEST_ARGS:STRING=-BH;./testfiles/dmptmp.h5" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" -D "TEST_OUTPUT=testfiles/${testname}_chk.out" diff --git a/tools/test/h5import/CMakeTests.cmake b/tools/test/h5import/CMakeTests.cmake index 22ab848..00d5009 100644 --- a/tools/test/h5import/CMakeTests.cmake +++ b/tools/test/h5import/CMakeTests.cmake @@ -96,16 +96,10 @@ ############################################################################## ############################################################################## - if (NOT BUILD_SHARED_LIBS) - set (tgt_ext "") - else () - set (tgt_ext "-shared") - endif () - macro (ADD_H5_TEST testname importfile conffile testfile) # If using memchecker skip macro based tests if (HDF5_ENABLE_USING_MEMCHECKER) - add_test (NAME H5IMPORT-${testname} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5import${tgt_ext}> ${importfile} -c ${conffile} -o ${testfile}) + add_test (NAME H5IMPORT-${testname} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5import${tgt_file_ext}> ${importfile} -c ${conffile} -o ${testfile}) set_tests_properties (H5IMPORT-${testname} PROPERTIES FIXTURES_REQUIRED set_h5importtest ) @@ -118,7 +112,7 @@ FIXTURES_REQUIRED set_h5importtest ) - add_test (NAME H5IMPORT-${testname} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5import${tgt_ext}> ${importfile} -c ${conffile} -o ${testfile}) + add_test (NAME H5IMPORT-${testname} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5import${tgt_file_ext}> ${importfile} -c ${conffile} -o ${testfile}) set_tests_properties (H5IMPORT-${testname} PROPERTIES DEPENDS H5IMPORT-${testname}-clear-objects ) @@ -127,7 +121,7 @@ NAME H5IMPORT-${testname}-H5DMP COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" - -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>" + -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_file_ext}>" -D "TEST_ARGS:STRING=${testfile}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" -D "TEST_OUTPUT=${testfile}.new" @@ -143,7 +137,7 @@ NAME H5IMPORT-${testname}-H5DMP_CMP COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" - -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>" + -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_file_ext}>" -D "TEST_ARGS:STRING=testfiles/${testfile}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" -D "TEST_OUTPUT=${testfile}.out" @@ -176,7 +170,7 @@ NAME H5IMPORT-DUMP-${testname}-H5DMP COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" - -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>" + -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_file_ext}>" -D "TEST_ARGS:STRING=-p;-d;${datasetname};-o;d${testfile}.bin;-b;NATIVE;testfiles/${testfile}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" -D "TEST_OUTPUT=d${testfile}.dmp" @@ -189,7 +183,7 @@ NAME H5IMPORT-DUMP-${testname}-H5DMP COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" - -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>" + -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_file_ext}>" -D "TEST_ARGS:STRING=-p;-d;${datasetname};-o;d${testfile}.bin;-y;--width=1;testfiles/${testfile}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" -D "TEST_OUTPUT=d${testfile}.dmp" @@ -206,7 +200,7 @@ NAME H5IMPORT-DUMP-${testname} COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" - -D "TEST_PROGRAM=$<TARGET_FILE:h5import${tgt_ext}>" + -D "TEST_PROGRAM=$<TARGET_FILE:h5import${tgt_file_ext}>" -D "TEST_ARGS:STRING=d${testfile}.bin;-c;d${testfile}.dmp;-o;d${testfile}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" -D "TEST_OUTPUT=d${testfile}.imp" @@ -222,7 +216,7 @@ NAME H5IMPORT-DUMP-${testname}-H5DFF COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" - -D "TEST_PROGRAM=$<TARGET_FILE:h5diff${tgt_ext}>" + -D "TEST_PROGRAM=$<TARGET_FILE:h5diff${tgt_file_ext}>" -D "TEST_ARGS:STRING=-r;d${testfile};testfiles/${testfile};${datasetname};${datasetname}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" -D "TEST_OUTPUT=d${testfile}.dff" @@ -254,7 +248,7 @@ NAME H5IMPORT_SUB-DUMP-${testname}-H5DMP COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" - -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>" + -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_file_ext}>" -D "TEST_ARGS:STRING=-p;-d;${datasetname};${ARGN};-o;${testname}.bin;-b;NATIVE;testfiles/${testfile}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" -D "TEST_OUTPUT=${testname}.dmp" @@ -270,7 +264,7 @@ NAME H5IMPORT_SUB-DUMP-${testname}-H5IMP COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" - -D "TEST_PROGRAM=$<TARGET_FILE:h5import${tgt_ext}>" + -D "TEST_PROGRAM=$<TARGET_FILE:h5import${tgt_file_ext}>" -D "TEST_ARGS:STRING=${testname}.bin;-c;${testname}.dmp;-o;d-${testname}.h5" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" -D "TEST_OUTPUT=${testname}.imp" @@ -285,7 +279,7 @@ NAME H5IMPORT_SUB-DUMP-${testname}-CMP COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" - -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>" + -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_file_ext}>" -D "TEST_ARGS:STRING=-p;d-${testname}.h5" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" -D "TEST_OUTPUT=d-${testname}.dmp" diff --git a/tools/test/h5jam/CMakeTests.cmake b/tools/test/h5jam/CMakeTests.cmake index f108afc..aaa9a5c 100644 --- a/tools/test/h5jam/CMakeTests.cmake +++ b/tools/test/h5jam/CMakeTests.cmake @@ -47,12 +47,6 @@ ############################################################################## ############################################################################## - if (NOT BUILD_SHARED_LIBS) - set (tgt_ext "") - else () - set (tgt_ext "-shared") - endif () - # ============================================================ # TEST_H5JAM_OUTPUT # For the purpose to verify only output & exitcode from h5jam @@ -60,7 +54,7 @@ macro (TEST_H5JAM_OUTPUT expectfile resultcode) # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) - add_test (NAME H5JAM-${expectfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5jam${tgt_ext}> ${ARGN}) + add_test (NAME H5JAM-${expectfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5jam${tgt_file_ext}> ${ARGN}) if (${resultcode}) set_tests_properties (H5JAM-${expectfile} PROPERTIES WILL_FAIL "true") endif () @@ -69,7 +63,7 @@ NAME H5JAM-${expectfile} COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" - -D "TEST_PROGRAM=$<TARGET_FILE:h5jam${tgt_ext}>" + -D "TEST_PROGRAM=$<TARGET_FILE:h5jam${tgt_file_ext}>" -D "TEST_ARGS:STRING=${ARGN}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" -D "TEST_OUTPUT=${expectfile}.out" @@ -89,7 +83,7 @@ macro (TEST_H5UNJAM_OUTPUT expectfile resultcode) # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) - add_test (NAME H5JAM-UNJAM-${expectfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5unjam${tgt_ext}> ${ARGN}) + add_test (NAME H5JAM-UNJAM-${expectfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5unjam${tgt_file_ext}> ${ARGN}) if (${resultcode}) set_tests_properties (H5JAM-UNJAM-${expectfile} PROPERTIES WILL_FAIL "true") endif () @@ -98,7 +92,7 @@ NAME H5JAM-UNJAM-${expectfile} COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" - -D "TEST_PROGRAM=$<TARGET_FILE:h5unjam${tgt_ext}>" + -D "TEST_PROGRAM=$<TARGET_FILE:h5unjam${tgt_file_ext}>" -D "TEST_ARGS=${ARGN}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" -D "TEST_OUTPUT=${expectfile}.out" @@ -116,7 +110,7 @@ NAME H5JAM-${testname}-CHECKFILE-H5DMP COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" - -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>" + -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_file_ext}>" -D "TEST_ARGS:STRING=testfiles/${expected}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" -D "TEST_OUTPUT=${actual}.new" @@ -130,7 +124,7 @@ NAME H5JAM-${testname}-CHECKFILE-H5DMP_CMP COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" - -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>" + -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_file_ext}>" -D "TEST_ARGS:STRING=${actual}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" -D "TEST_OUTPUT=${actual}.out" @@ -165,7 +159,7 @@ COMMAND ${CMAKE_COMMAND} -E remove ${ufile} ) set_tests_properties (H5JAM-${testname}-UNJAM_D-clear-objects PROPERTIES DEPENDS H5JAM-${testname}-UNJAM-clear-objects) - add_test (NAME H5JAM-${testname}-UNJAM COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5unjam${tgt_ext}> -i ${infile} -u ${ufile} -o ${outfile}) + add_test (NAME H5JAM-${testname}-UNJAM COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5unjam${tgt_file_ext}> -i ${infile} -u ${ufile} -o ${outfile}) set_tests_properties (H5JAM-${testname}-UNJAM PROPERTIES DEPENDS H5JAM-${testname}-UNJAM_D-clear-objects) set (compare_test ${ufile}) else () @@ -174,7 +168,7 @@ NAME H5JAM-${testname}-UNJAM COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" - -D "TEST_PROGRAM=$<TARGET_FILE:h5unjam${tgt_ext}>" + -D "TEST_PROGRAM=$<TARGET_FILE:h5unjam${tgt_file_ext}>" -D "TEST_ARGS:STRING=-i;${infile};-o;${outfile}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" -D "TEST_OUTPUT=${outfile}.ufile.txt" @@ -185,7 +179,7 @@ set_tests_properties (H5JAM-${testname}-UNJAM PROPERTIES DEPENDS H5JAM-${testname}-UNJAM-clear-objects) set (compare_test "${outfile}.ufile.txt") else () - add_test (NAME H5JAM-${testname}-UNJAM COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5unjam${tgt_ext}> -i ${infile} -o ${outfile}) + add_test (NAME H5JAM-${testname}-UNJAM COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5unjam${tgt_file_ext}> -i ${infile} -o ${outfile}) set_tests_properties (H5JAM-${testname}-UNJAM PROPERTIES DEPENDS H5JAM-${testname}-UNJAM-clear-objects) set (compare_test "") endif () @@ -247,7 +241,7 @@ COMMAND ${CMAKE_COMMAND} -E remove ${outfile} ${infile}.cpy.h5 ) endif () - add_test (NAME H5JAM-${testname} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5jam${tgt_ext}> -u testfiles/${jamfile} -i testfiles/${infile} -o ${outfile} ${ARGN}) + add_test (NAME H5JAM-${testname} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5jam${tgt_file_ext}> -u testfiles/${jamfile} -i testfiles/${infile} -o ${outfile} ${ARGN}) if (NOT HDF5_ENABLE_USING_MEMCHECKER) set_tests_properties (H5JAM-${testname} PROPERTIES DEPENDS H5JAM-${testname}-clear-objects) set (compare_test ${outfile}) @@ -302,7 +296,7 @@ ) set_tests_properties (H5JAM-${testname}_NONE_COPY PROPERTIES DEPENDS H5JAM-${testname}_NONE-SETUP) - add_test (NAME H5JAM-${testname}_NONE COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5jam${tgt_ext}> -u testfiles/${jamfile} -i ${chkfile} ${ARGN}) + add_test (NAME H5JAM-${testname}_NONE COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5jam${tgt_file_ext}> -u testfiles/${jamfile} -i ${chkfile} ${ARGN}) set_tests_properties (H5JAM-${testname}_NONE PROPERTIES DEPENDS H5JAM-${testname}_NONE_COPY) set (compare_test ${chkfile}) diff --git a/tools/test/h5ls/CMakeTests.cmake b/tools/test/h5ls/CMakeTests.cmake index 7ff17ff..2b7aa96 100644 --- a/tools/test/h5ls/CMakeTests.cmake +++ b/tools/test/h5ls/CMakeTests.cmake @@ -134,16 +134,10 @@ ############################################################################## ############################################################################## - if (NOT BUILD_SHARED_LIBS) - set (tgt_ext "") - else () - set (tgt_ext "-shared") - endif () - macro (ADD_H5_TEST resultfile resultcode) # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) - add_test (NAME H5LS-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5ls${tgt_ext}> ${ARGN}) + add_test (NAME H5LS-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5ls${tgt_file_ext}> ${ARGN}) set_tests_properties (H5LS-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") if (${resultcode} EQUAL 1) set_tests_properties (H5LS-${resultfile} PROPERTIES WILL_FAIL "true") @@ -154,7 +148,7 @@ NAME H5LS-${resultfile} COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" - -D "TEST_PROGRAM=$<TARGET_FILE:h5ls${tgt_ext}>" + -D "TEST_PROGRAM=$<TARGET_FILE:h5ls${tgt_file_ext}>" -D "TEST_ARGS=${ARGN}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" -D "TEST_OUTPUT=${resultfile}.out" @@ -168,7 +162,7 @@ macro (ADD_H5_ERR_TEST resultfile resultcode) # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) - add_test (NAME H5LS-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5ls${tgt_ext}> ${ARGN}) + add_test (NAME H5LS-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5ls${tgt_file_ext}> ${ARGN}) set_tests_properties (H5LS-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") if (${resultcode} EQUAL 1) set_tests_properties (H5LS-${resultfile} PROPERTIES WILL_FAIL "true") @@ -178,7 +172,7 @@ NAME H5LS-${resultfile} COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" - -D "TEST_PROGRAM=$<TARGET_FILE:h5ls${tgt_ext}>" + -D "TEST_PROGRAM=$<TARGET_FILE:h5ls${tgt_file_ext}>" -D "TEST_ARGS=${ARGN}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" -D "TEST_OUTPUT=${resultfile}.out" @@ -196,7 +190,7 @@ NAME H5LS_UD-${testname} COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" - -D "TEST_PROGRAM=$<TARGET_FILE:h5ls${tgt_ext}>" + -D "TEST_PROGRAM=$<TARGET_FILE:h5ls${tgt_file_ext}>" -D "TEST_ARGS=${ARGN}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" -D "TEST_OUTPUT=${resultfile}.out" diff --git a/tools/test/h5ls/CMakeTestsVDS.cmake b/tools/test/h5ls/CMakeTestsVDS.cmake index cf5b6d7..3fc8aab 100644 --- a/tools/test/h5ls/CMakeTestsVDS.cmake +++ b/tools/test/h5ls/CMakeTestsVDS.cmake @@ -80,16 +80,10 @@ ############################################################################## ############################################################################## - if (NOT BUILD_SHARED_LIBS) - set (tgt_ext "") - else () - set (tgt_ext "-shared") - endif () - macro (ADD_H5_VDS_TEST resultfile resultcode) # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) - add_test (NAME H5LS-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5ls${tgt_ext}> ${ARGN}) + add_test (NAME H5LS-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5ls${tgt_file_ext}> ${ARGN}) set_tests_properties (H5LS-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/vds") if (${resultcode} EQUAL 1) set_tests_properties (H5LS-${resultfile} PROPERTIES WILL_FAIL "true") @@ -99,7 +93,7 @@ NAME H5LS-${resultfile} COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" - -D "TEST_PROGRAM=$<TARGET_FILE:h5ls${tgt_ext}>" + -D "TEST_PROGRAM=$<TARGET_FILE:h5ls${tgt_file_ext}>" -D "TEST_ARGS=${ARGN}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles/vds" -D "TEST_OUTPUT=${resultfile}.out" @@ -113,7 +107,7 @@ macro (ADD_H5_VDS_PREFIX_TEST resultfile resultcode) # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) - add_test (NAME H5LS_PREFIX-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5ls${tgt_ext}> ${ARGN}) + add_test (NAME H5LS_PREFIX-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5ls${tgt_file_ext}> ${ARGN}) set_tests_properties (H5LS_PREFIX-${resultfile} PROPERTIES ENVIRONMENT "HDF5_VDS_PREFIX=\${ORIGIN}" WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles" @@ -126,7 +120,7 @@ NAME H5LS_PREFIX-${resultfile} COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" - -D "TEST_PROGRAM=$<TARGET_FILE:h5ls${tgt_ext}>" + -D "TEST_PROGRAM=$<TARGET_FILE:h5ls${tgt_file_ext}>" -D "TEST_ARGS=${ARGN}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" -D "TEST_OUTPUT=vds/prefix/${resultfile}.out" diff --git a/tools/test/h5repack/CMakeTests.cmake b/tools/test/h5repack/CMakeTests.cmake index 0c761e2..e654bce 100644 --- a/tools/test/h5repack/CMakeTests.cmake +++ b/tools/test/h5repack/CMakeTests.cmake @@ -182,16 +182,10 @@ ############################################################################## ############################################################################## - if (NOT BUILD_SHARED_LIBS) - set (tgt_ext "") - else () - set (tgt_ext "-shared") - endif () - macro (ADD_HELP_TEST testname resultcode) # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) - add_test (NAME H5REPACK-h5repack-${testname} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repack${tgt_ext}> ${ARGN}) + add_test (NAME H5REPACK-h5repack-${testname} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repack${tgt_file_ext}> ${ARGN}) set_tests_properties (H5REPACK-h5repack-${testname} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles" ) @@ -200,7 +194,7 @@ NAME H5REPACK-h5repack-${testname} COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" - -D "TEST_PROGRAM=$<TARGET_FILE:h5repack${tgt_ext}>" + -D "TEST_PROGRAM=$<TARGET_FILE:h5repack${tgt_file_ext}>" -D "TEST_ARGS:STRING=${ARGN}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" -D "TEST_OUTPUT=h5repack-${testname}.out" @@ -232,14 +226,14 @@ ) add_test ( NAME H5REPACK_OLD-${testname} - COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repack${tgt_ext}> ${ARGN} -i ${PROJECT_BINARY_DIR}/testfiles/${testfile} -o ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} + COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repack${tgt_file_ext}> ${ARGN} -i ${PROJECT_BINARY_DIR}/testfiles/${testfile} -o ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} ) set_tests_properties (H5REPACK_OLD-${testname} PROPERTIES DEPENDS H5REPACK_OLD-${testname}-clear-objects ) add_test ( NAME H5REPACK_OLD-${testname}_DFF - COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5diff${tgt_ext}> ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} + COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5diff${tgt_file_ext}> ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} ) set_tests_properties (H5REPACK_OLD-${testname}_DFF PROPERTIES DEPENDS H5REPACK_OLD-${testname} @@ -267,14 +261,14 @@ ) add_test ( NAME H5REPACK-${testname} - COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repack${tgt_ext}> --enable-error-stack ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} + COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repack${tgt_file_ext}> --enable-error-stack ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} ) set_tests_properties (H5REPACK-${testname} PROPERTIES DEPENDS H5REPACK-${testname}-clear-objects ) add_test ( NAME H5REPACK-${testname}_DFF - COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5diff${tgt_ext}> --enable-error-stack ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} + COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5diff${tgt_file_ext}> --enable-error-stack ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} ) set_tests_properties (H5REPACK-${testname}_DFF PROPERTIES DEPENDS H5REPACK-${testname} @@ -296,7 +290,7 @@ if (HDF5_ENABLE_USING_MEMCHECKER) add_test ( NAME H5REPACK_CMP-${testname} - COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repack${tgt_ext}> ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${resultfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${resultfile} + COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repack${tgt_file_ext}> ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${resultfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${resultfile} ) else () add_test ( @@ -310,7 +304,7 @@ NAME H5REPACK_CMP-${testname} COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" - -D "TEST_PROGRAM=$<TARGET_FILE:h5repack${tgt_ext}>" + -D "TEST_PROGRAM=$<TARGET_FILE:h5repack${tgt_file_ext}>" -D "TEST_ARGS:STRING=${ARGN};${resultfile};out-${testname}.${resultfile}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" -D "TEST_OUTPUT=${resultfile}-${testname}.out" @@ -340,7 +334,7 @@ if (HDF5_ENABLE_USING_MEMCHECKER) add_test ( NAME H5REPACK_MASK-${testname} - COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repack${tgt_ext}> ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${resultfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${resultfile} + COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repack${tgt_file_ext}> ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${resultfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${resultfile} ) set_tests_properties (H5REPACK_MASK-${testname} PROPERTIES FIXTURES_REQUIRED clear_h5repack @@ -357,7 +351,7 @@ NAME H5REPACK_MASK-${testname} COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" - -D "TEST_PROGRAM=$<TARGET_FILE:h5repack${tgt_ext}>" + -D "TEST_PROGRAM=$<TARGET_FILE:h5repack${tgt_file_ext}>" -D "TEST_ARGS:STRING=${ARGN};${resultfile};out-${testname}.${resultfile}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" -D "TEST_OUTPUT=${resultfile}-${testname}.out" @@ -391,7 +385,7 @@ ) add_test ( NAME H5REPACK_DMP-${testname} - COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repack${tgt_ext}> ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${resultfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${resultfile} + COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repack${tgt_file_ext}> ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${resultfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${resultfile} ) set_tests_properties (H5REPACK_DMP-${testname} PROPERTIES DEPENDS H5REPACK_DMP-${testname}-clear-objects @@ -401,7 +395,7 @@ NAME H5REPACK_DMP-h5dump-${testname} COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" - -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>" + -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_file_ext}>" -D "TEST_ARGS:STRING=-q;creation_order;-pH;out-${testname}.${resultfile}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" -D "TEST_OUTPUT=${resultfile}-${testname}.out" @@ -435,7 +429,7 @@ ) add_test ( NAME H5REPACK_STAT-${testname} - COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repack${tgt_ext}> ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${resultfile} ${PROJECT_BINARY_DIR}/testfiles/out-${statarg}.${resultfile} + COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repack${tgt_file_ext}> ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${resultfile} ${PROJECT_BINARY_DIR}/testfiles/out-${statarg}.${resultfile} ) set_tests_properties (H5REPACK_STAT-${testname} PROPERTIES DEPENDS H5REPACK_STAT-${testname}-clear-objects @@ -445,7 +439,7 @@ NAME H5REPACK_STAT-h5stat-${testname} COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" - -D "TEST_PROGRAM=$<TARGET_FILE:h5stat${tgt_ext}>" + -D "TEST_PROGRAM=$<TARGET_FILE:h5stat${tgt_file_ext}>" -D "TEST_ARGS:STRING=-S;-s;out-${statarg}.${resultfile}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" -D "TEST_OUTPUT=${resultfile}-${testname}.out" @@ -480,14 +474,14 @@ ) add_test ( NAME H5REPACK_VERIFY_LAYOUT-${testname} - COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repack${tgt_ext}> ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} + COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repack${tgt_file_ext}> ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} ) set_tests_properties (H5REPACK_VERIFY_LAYOUT-${testname} PROPERTIES DEPENDS H5REPACK_VERIFY_LAYOUT-${testname}-clear-objects ) add_test ( NAME H5REPACK_VERIFY_LAYOUT-${testname}_DFF - COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5diff${tgt_ext}> ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} + COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5diff${tgt_file_ext}> ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} ) set_tests_properties (H5REPACK_VERIFY_LAYOUT-${testname}_DFF PROPERTIES DEPENDS H5REPACK_VERIFY_LAYOUT-${testname} @@ -497,7 +491,7 @@ NAME H5REPACK_VERIFY_LAYOUT-${testname}_DMP COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" - -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>" + -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_file_ext}>" -D "TEST_ARGS:STRING=-d;${testdset};-pH;out-${testname}.${testfile}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" -D "TEST_OUTPUT=${testfile}-${testname}-v.out" @@ -523,7 +517,7 @@ NAME H5REPACK_VERIFY_LAYOUT-${testname}_DMP COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" - -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>" + -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_file_ext}>" -D "TEST_ARGS:STRING=-pH;out-${testname}.${testfile}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" -D "TEST_OUTPUT=${testfile}-${testname}-v.out" @@ -561,7 +555,7 @@ ) add_test ( NAME H5REPACK_VERIFY_LAYOUT_VDS-${testname} - COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repack${tgt_ext}> ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} + COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repack${tgt_file_ext}> ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} ) set_tests_properties (H5REPACK_VERIFY_LAYOUT_VDS-${testname} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles" @@ -571,7 +565,7 @@ NAME H5REPACK_VERIFY_LAYOUT_VDS-${testname}_DMP COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" - -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>" + -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_file_ext}>" -D "TEST_ARGS:STRING=-d;${testdset};-p;out-${testname}.${testfile}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" -D "TEST_OUTPUT=${testfile}-${testname}-v.out" @@ -599,7 +593,7 @@ ) add_test ( NAME H5REPACK_VERIFY_SUPERBLOCK-${testname} - COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repack${tgt_ext}> -j;${lowbound};-k;${highbound} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} + COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repack${tgt_file_ext}> -j;${lowbound};-k;${highbound} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} ) set_tests_properties (H5REPACK_VERIFY_SUPERBLOCK-${testname} PROPERTIES DEPENDS H5REPACK_VERIFY_SUPERBLOCK-${testname}-clear-objects @@ -608,7 +602,7 @@ NAME H5REPACK_VERIFY_SUPERBLOCK-${testname}_DMP COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" - -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>" + -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_file_ext}>" -D "TEST_ARGS:STRING=-H;-B;out-${testname}.${testfile}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" -D "TEST_OUTPUT=${testfile}-${testname}-v.out" @@ -633,7 +627,7 @@ ) add_test ( NAME ADD_H5_VERIFY_INVALIDBOUNDS-h5repack-${testname} - COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repack${tgt_ext}> -j;${lowbound};-k;${highbound} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} + COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repack${tgt_file_ext}> -j;${lowbound};-k;${highbound} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} ) set_tests_properties (ADD_H5_VERIFY_INVALIDBOUNDS-h5repack-${testname} PROPERTIES DEPENDS ADD_H5_VERIFY_INVALIDBOUNDS-h5repack-${testname}-clear-objects @@ -654,20 +648,20 @@ ) add_test ( NAME H5REPACK_META-${testname}_N - COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repack${tgt_ext}> ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}_N.${testname}.h5 + COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repack${tgt_file_ext}> ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}_N.${testname}.h5 ) set_tests_properties (H5REPACK_META-${testname}_N PROPERTIES DEPENDS H5REPACK_META-${testname}_N-clear-objects ) add_test ( NAME H5REPACK_META-${testname}_M - COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repack${tgt_ext}> ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}_M.${testname}.h5 + COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repack${tgt_file_ext}> ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}_M.${testname}.h5 ) set_tests_properties (H5REPACK_META-${testname}_M PROPERTIES DEPENDS H5REPACK_META-${testname}_N ) - add_test (NAME H5REPACK_META-${testname} COMMAND ${CMAKE_COMMAND} -E compare_files ${PROJECT_BINARY_DIR}/testfiles/out-${testname}_N.${testname}.h5 ${PROJECT_BINARY_DIR}/testfiles/out-${testname}_M.${testname}.h5) + add_test (NAME H5REPACK_META-${testname} COMMAND ${CMAKE_COMMAND} -E compare_files ${CMAKE_IGNORE_EOL} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}_N.${testname}.h5 ${PROJECT_BINARY_DIR}/testfiles/out-${testname}_M.${testname}.h5) set_tests_properties (H5REPACK_META-${testname} PROPERTIES WILL_FAIL "true" DEPENDS H5REPACK_META-${testname}_M @@ -725,100 +719,100 @@ endmacro () macro (ADD_H5_EXTERNAL_TEST testname testtype testfile) - # canonical file = h5repack_${testfile}.h5 - preexist - # external file = h5repack_${testfile}_ex.h5 - preexist - # repacked file = h5repack_${testfile}_rp.h5 - created - # external data file = h5repack_${testfile}_ex-0.dat - if ("${testtype}" STREQUAL "SKIP") - if (NOT HDF5_ENABLE_USING_MEMCHECKER) + if (NOT HDF5_ENABLE_USING_MEMCHECKER) + # canonical file = h5repack_${testfile}.h5 - preexist + # external file = h5repack_${testfile}_ex.h5 - preexist + # repacked file = h5repack_${testfile}_rp.h5 - created + # external data file = h5repack_${testfile}_ex-0.dat + if ("${testtype}" STREQUAL "SKIP") add_test ( NAME H5REPACK_EXTERNAL-${testname} COMMAND ${CMAKE_COMMAND} -E echo "SKIP ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile}" ) set_property(TEST H5REPACK_EXTERNAL-${testname} PROPERTY DISABLED) + else () + add_test ( + NAME H5REPACK_EXTERNAL-${testname}-clear-objects + COMMAND ${CMAKE_COMMAND} -E remove h5repack_${testfile}_rp.h5 + ) + set_tests_properties (H5REPACK_EXTERNAL-${testname}-clear-objects PROPERTIES + WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles" + FIXTURES_REQUIRED clear_h5repack + ) + # make sure external data file 0 is available + add_test ( + NAME H5REPACK_EXTERNAL-${testname}_CPY + COMMAND ${CMAKE_COMMAND} -E copy_if_different + "${PROJECT_SOURCE_DIR}/testfiles/h5repack_${testfile}_ex-0.dat" "${PROJECT_BINARY_DIR}/testfiles/h5repack_${testfile}_ex-0.dat" + ) + set_tests_properties (H5REPACK_EXTERNAL-${testname}_CPY PROPERTIES + WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles" + DEPENDS H5REPACK_EXTERNAL-${testname}-clear-objects + ) + # comparison of known files + add_test ( + NAME H5REPACK_EXTERNAL-${testname}_DFF1 + COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5diff${tgt_file_ext}> --enable-error-stack ${PROJECT_BINARY_DIR}/testfiles/h5repack_${testfile}.h5 ${PROJECT_BINARY_DIR}/testfiles/h5repack_${testfile}_ex.h5 + ) + set_tests_properties (H5REPACK_EXTERNAL-${testname}_DFF1 PROPERTIES + WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles" + DEPENDS H5REPACK_EXTERNAL-${testname}_CPY + ) + # repack the external file to the repacked file + add_test ( + NAME H5REPACK_EXTERNAL-${testname} + COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repack${tgt_file_ext}> --enable-error-stack ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/h5repack_${testfile}_ex.h5 ${PROJECT_BINARY_DIR}/testfiles/h5repack_${testfile}_rp.h5 + ) + set_tests_properties (H5REPACK_EXTERNAL-${testname} PROPERTIES + WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles" + DEPENDS H5REPACK_EXTERNAL-${testname}_DFF1 + ) + # comparison of repacked file to known files + add_test ( + NAME H5REPACK_EXTERNAL-${testname}_DFF2 + COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5diff${tgt_file_ext}> --enable-error-stack ${PROJECT_BINARY_DIR}/testfiles/h5repack_${testfile}_rp.h5 ${PROJECT_BINARY_DIR}/testfiles/h5repack_${testfile}.h5 + ) + set_tests_properties (H5REPACK_EXTERNAL-${testname}_DFF2 PROPERTIES + WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles" + DEPENDS H5REPACK_EXTERNAL-${testname} + ) + add_test ( + NAME H5REPACK_EXTERNAL-${testname}_DFF3 + COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5diff${tgt_file_ext}> --enable-error-stack ${PROJECT_BINARY_DIR}/testfiles/h5repack_${testfile}_rp.h5 ${PROJECT_BINARY_DIR}/testfiles/h5repack_${testfile}_ex.h5 + ) + set_tests_properties (H5REPACK_EXTERNAL-${testname}_DFF3 PROPERTIES + WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles" + DEPENDS H5REPACK_EXTERNAL-${testname}_DFF2 + ) + # invalidate external file by removing its first data file + add_test ( + NAME H5REPACK_EXTERNAL-${testname}_DATA_RMV + COMMAND ${CMAKE_COMMAND} -E remove h5repack_${testfile}_ex-0.dat + ) + set_tests_properties (H5REPACK_EXTERNAL-${testname}_DATA_RMV PROPERTIES + WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles" + DEPENDS H5REPACK_EXTERNAL-${testname}_DFF3 + ) + # verify comparison of repacked file to known file + add_test ( + NAME H5REPACK_EXTERNAL-${testname}_DFF4 + COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5diff${tgt_file_ext}> --enable-error-stack ${PROJECT_BINARY_DIR}/testfiles/h5repack_${testfile}_rp.h5 ${PROJECT_BINARY_DIR}/testfiles/h5repack_${testfile}.h5 + ) + set_tests_properties (H5REPACK_EXTERNAL-${testname}_DFF4 PROPERTIES + WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles" + DEPENDS H5REPACK_EXTERNAL-${testname}_DATA_RMV + ) + # verify comparison of repacked file to known external file fails + add_test ( + NAME H5REPACK_EXTERNAL-${testname}_DFF_FAIL + COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5diff${tgt_file_ext}> --enable-error-stack ${PROJECT_BINARY_DIR}/testfiles/h5repack_${testfile}_rp.h5 ${PROJECT_BINARY_DIR}/testfiles/h5repack_${testfile}_ex.h5 + ) + set_tests_properties (H5REPACK_EXTERNAL-${testname}_DFF_FAIL PROPERTIES + WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles" + DEPENDS H5REPACK_EXTERNAL-${testname}_DFF4 + WILL_FAIL "true" + ) endif () - else () - add_test ( - NAME H5REPACK_EXTERNAL-${testname}-clear-objects - COMMAND ${CMAKE_COMMAND} -E remove h5repack_${testfile}_rp.h5 - ) - set_tests_properties (H5REPACK_EXTERNAL-${testname}-clear-objects PROPERTIES - WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles" - FIXTURES_REQUIRED clear_h5repack - ) - # make sure external data file 0 is available - add_test ( - NAME H5REPACK_EXTERNAL-${testname}_CPY - COMMAND ${CMAKE_COMMAND} -E copy_if_different - "${PROJECT_SOURCE_DIR}/testfiles/h5repack_${testfile}_ex-0.dat" "${PROJECT_BINARY_DIR}/testfiles/h5repack_${testfile}_ex-0.dat" - ) - set_tests_properties (H5REPACK_EXTERNAL-${testname}_CPY PROPERTIES - WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles" - DEPENDS H5REPACK_EXTERNAL-${testname}-clear-objects - ) - # comparison of known files - add_test ( - NAME H5REPACK_EXTERNAL-${testname}_DFF1 - COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5diff${tgt_ext}> --enable-error-stack ${PROJECT_BINARY_DIR}/testfiles/h5repack_${testfile}.h5 ${PROJECT_BINARY_DIR}/testfiles/h5repack_${testfile}_ex.h5 - ) - set_tests_properties (H5REPACK_EXTERNAL-${testname}_DFF1 PROPERTIES - WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles" - DEPENDS H5REPACK_EXTERNAL-${testname}_CPY - ) - # repack the external file to the repacked file - add_test ( - NAME H5REPACK_EXTERNAL-${testname} - COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repack${tgt_ext}> --enable-error-stack ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/h5repack_${testfile}_ex.h5 ${PROJECT_BINARY_DIR}/testfiles/h5repack_${testfile}_rp.h5 - ) - set_tests_properties (H5REPACK_EXTERNAL-${testname} PROPERTIES - WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles" - DEPENDS H5REPACK_EXTERNAL-${testname}_DFF1 - ) - # comparison of repacked file to known files - add_test ( - NAME H5REPACK_EXTERNAL-${testname}_DFF2 - COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5diff${tgt_ext}> --enable-error-stack ${PROJECT_BINARY_DIR}/testfiles/h5repack_${testfile}_rp.h5 ${PROJECT_BINARY_DIR}/testfiles/h5repack_${testfile}.h5 - ) - set_tests_properties (H5REPACK_EXTERNAL-${testname}_DFF2 PROPERTIES - WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles" - DEPENDS H5REPACK_EXTERNAL-${testname} - ) - add_test ( - NAME H5REPACK_EXTERNAL-${testname}_DFF3 - COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5diff${tgt_ext}> --enable-error-stack ${PROJECT_BINARY_DIR}/testfiles/h5repack_${testfile}_rp.h5 ${PROJECT_BINARY_DIR}/testfiles/h5repack_${testfile}_ex.h5 - ) - set_tests_properties (H5REPACK_EXTERNAL-${testname}_DFF3 PROPERTIES - WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles" - DEPENDS H5REPACK_EXTERNAL-${testname}_DFF2 - ) - # invalidate external file by removing its first data file - add_test ( - NAME H5REPACK_EXTERNAL-${testname}_DATA_RMV - COMMAND ${CMAKE_COMMAND} -E remove h5repack_${testfile}_ex-0.dat - ) - set_tests_properties (H5REPACK_EXTERNAL-${testname}_DATA_RMV PROPERTIES - WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles" - DEPENDS H5REPACK_EXTERNAL-${testname}_DFF3 - ) - # verify comparison of repacked file to known file - add_test ( - NAME H5REPACK_EXTERNAL-${testname}_DFF4 - COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5diff${tgt_ext}> --enable-error-stack ${PROJECT_BINARY_DIR}/testfiles/h5repack_${testfile}_rp.h5 ${PROJECT_BINARY_DIR}/testfiles/h5repack_${testfile}.h5 - ) - set_tests_properties (H5REPACK_EXTERNAL-${testname}_DFF4 PROPERTIES - WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles" - DEPENDS H5REPACK_EXTERNAL-${testname}_DATA_RMV - ) - # verify comparison of repacked file to known external file fails - add_test ( - NAME H5REPACK_EXTERNAL-${testname}_DFF_FAIL - COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5diff${tgt_ext}> --enable-error-stack ${PROJECT_BINARY_DIR}/testfiles/h5repack_${testfile}_rp.h5 ${PROJECT_BINARY_DIR}/testfiles/h5repack_${testfile}_ex.h5 - ) - set_tests_properties (H5REPACK_EXTERNAL-${testname}_DFF_FAIL PROPERTIES - WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles" - DEPENDS H5REPACK_EXTERNAL-${testname}_DFF4 - WILL_FAIL "true" - ) endif () endmacro () diff --git a/tools/test/h5repack/h5repackgentest.c b/tools/test/h5repack/h5repackgentest.c index a61d8d7..7604964 100644 --- a/tools/test/h5repack/h5repackgentest.c +++ b/tools/test/h5repack/h5repackgentest.c @@ -231,9 +231,9 @@ generate_int32le_3d(hbool_t external) { /* generate values, alternating positive and negative */ - for (i = 0, n = 0; i < dims[0]; i++) { - for (j = 0; j < dims[1]; j++) { - for (k = 0; k < dims[2]; k++, n++) { + for (i = 0, n = 0; (hsize_t)i < dims[0]; i++) { + for (j = 0; (hsize_t)j < dims[1]; j++) { + for (k = 0; (hsize_t)k < dims[2]; k++, n++) { wdata[n] = (k + j * 512 + i * 4096) * ((n & 1) ? (-1) : (1)); } } @@ -263,9 +263,9 @@ generate_uint8be(hbool_t external) { /* Generate values, ping-pong from ends of range */ - for (i = 0, n = 0; i < dims[0]; i++) { - for (j = 0; j < dims[1]; j++) { - for (k = 0; k < dims[2]; k++, n++) { + for (i = 0, n = 0; (hsize_t)i < dims[0]; i++) { + for (j = 0; (hsize_t)j < dims[1]; j++) { + for (k = 0; (hsize_t)k < dims[2]; k++, n++) { wdata[n] = (uint8_t)((n & 1) ? -n : n); } } @@ -294,8 +294,8 @@ generate_f32le(hbool_t external) { int ret_value = 0; /* Generate values */ - for (i = 0, k = 0, n = 0; i < dims[0]; i++) { - for (j = 0; j < dims[1]; j++, k++, n++) { + for (i = 0, k = 0, n = 0; (hsize_t)i < dims[0]; i++) { + for (j = 0; (hsize_t)j < dims[1]; j++, k++, n++) { wdata[k] = n * 801.1f * ((k % 5 == 1) ? (-1) : (1)); } } diff --git a/tools/test/h5stat/CMakeTests.cmake b/tools/test/h5stat/CMakeTests.cmake index 9674a77..0c07418 100644 --- a/tools/test/h5stat/CMakeTests.cmake +++ b/tools/test/h5stat/CMakeTests.cmake @@ -93,16 +93,10 @@ ############################################################################## ############################################################################## - if (NOT BUILD_SHARED_LIBS) - set (tgt_ext "") - else () - set (tgt_ext "-shared") - endif () - macro (ADD_H5_TEST resultfile resultcode) # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) - add_test (NAME H5STAT-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5stat${tgt_ext}> ${ARGN}) + add_test (NAME H5STAT-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5stat${tgt_file_ext}> ${ARGN}) if (${resultcode}) set_tests_properties (H5STAT-${resultfile} PROPERTIES WILL_FAIL "true") endif () @@ -111,7 +105,7 @@ NAME H5STAT-${resultfile} COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" - -D "TEST_PROGRAM=$<TARGET_FILE:h5stat${tgt_ext}>" + -D "TEST_PROGRAM=$<TARGET_FILE:h5stat${tgt_file_ext}>" -D "TEST_ARGS=${ARGN}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" -D "TEST_OUTPUT=${resultfile}.out" @@ -125,7 +119,7 @@ macro (ADD_H5_ERR_TEST resultfile resultcode) # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) - add_test (NAME H5STAT-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5stat${tgt_ext}> ${ARGN}) + add_test (NAME H5STAT-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5stat${tgt_file_ext}> ${ARGN}) if (${resultcode}) set_tests_properties (H5STAT-${resultfile} PROPERTIES WILL_FAIL "true") endif () @@ -134,7 +128,7 @@ NAME H5STAT-${resultfile} COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" - -D "TEST_PROGRAM=$<TARGET_FILE:h5stat${tgt_ext}>" + -D "TEST_PROGRAM=$<TARGET_FILE:h5stat${tgt_file_ext}>" -D "TEST_ARGS=${ARGN}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" -D "TEST_OUTPUT=${resultfile}.out" diff --git a/tools/test/misc/CMakeTestsClear.cmake b/tools/test/misc/CMakeTestsClear.cmake index a2c494d..cb285e4 100644 --- a/tools/test/misc/CMakeTestsClear.cmake +++ b/tools/test/misc/CMakeTestsClear.cmake @@ -83,12 +83,6 @@ ############################################################################## ############################################################################## - if (NOT BUILD_SHARED_LIBS) - set (tgt_ext "") - else () - set (tgt_ext "-shared") - endif () - # Need special dependencies for tests that use the same reference file # This is an issue on Windows macro (ADD_H5_CMP testname resultfile resultcode) @@ -97,7 +91,7 @@ NAME H5CLEAR_CMP-${testname} COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" - -D "TEST_PROGRAM=$<TARGET_FILE:h5clear${tgt_ext}>" + -D "TEST_PROGRAM=$<TARGET_FILE:h5clear${tgt_file_ext}>" -D "TEST_ARGS:STRING=${ARGN}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" -D "TEST_OUTPUT=${testname}.out" @@ -114,7 +108,7 @@ NAME H5CLEAR_CMP-${testname} COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" - -D "TEST_PROGRAM=$<TARGET_FILE:h5clear${tgt_ext}>" + -D "TEST_PROGRAM=$<TARGET_FILE:h5clear${tgt_file_ext}>" -D "TEST_ARGS:STRING=${ARGN}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" -D "TEST_OUTPUT=${testname}.out" @@ -144,7 +138,7 @@ NAME H5CLEAR_CMP-${testname} COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" - -D "TEST_PROGRAM=$<TARGET_FILE:h5clear${tgt_ext}>" + -D "TEST_PROGRAM=$<TARGET_FILE:h5clear${tgt_file_ext}>" -D "TEST_ARGS:STRING=${ARGN};${testfile}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" -D "TEST_OUTPUT=${testname}.out" @@ -176,7 +170,7 @@ NAME H5CLEAR_CMP-${testname} COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" - -D "TEST_PROGRAM=$<TARGET_FILE:h5clear${tgt_ext}>" + -D "TEST_PROGRAM=$<TARGET_FILE:h5clear${tgt_file_ext}>" -D "TEST_ARGS:STRING=${ARGN};${testfile}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" -D "TEST_OUTPUT=${testname}.out" @@ -195,7 +189,7 @@ if (NOT HDF5_ENABLE_USING_MEMCHECKER) add_test ( NAME H5CLEAR_RET-${testname} - COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5clear${tgt_ext}> ${ARGN} + COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5clear${tgt_file_ext}> ${ARGN} ) set_tests_properties (H5CLEAR_RET-${testname} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles" @@ -222,7 +216,7 @@ NAME H5CLEAR_FILESIZE_CMP-${testname}_before_size COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" - -D "TEST_PROGRAM=$<TARGET_FILE:h5clear${tgt_ext}>" + -D "TEST_PROGRAM=$<TARGET_FILE:h5clear${tgt_file_ext}>" -D "TEST_ARGS:STRING=--filesize;${testname}.h5" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" -D "TEST_OUTPUT=${testname}_before_size.out" @@ -236,12 +230,12 @@ if (NOT ${incr_size} MATCHES "NONE") add_test ( NAME H5CLEAR_FILESIZE_INCR-${testname} - COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5clear${tgt_ext}> --increment=${incr_size} ${testname}.h5 + COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5clear${tgt_file_ext}> --increment=${incr_size} ${testname}.h5 ) else () add_test ( NAME H5CLEAR_FILESIZE_INCR-${testname} - COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5clear${tgt_ext}> --increment ${testname}.h5 + COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5clear${tgt_file_ext}> --increment ${testname}.h5 ) endif () set_tests_properties (H5CLEAR_FILESIZE_INCR-${testname} PROPERTIES @@ -253,7 +247,7 @@ NAME H5CLEAR_FILESIZE_CMP-${testname}_after_size COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" - -D "TEST_PROGRAM=$<TARGET_FILE:h5clear${tgt_ext}>" + -D "TEST_PROGRAM=$<TARGET_FILE:h5clear${tgt_file_ext}>" -D "TEST_ARGS:STRING=--filesize;${testname}.h5" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" -D "TEST_OUTPUT=${testname}_after_size.out" @@ -285,7 +279,7 @@ NAME H5CLEAR_FILESIZE_FAIL_CMP-${testname}_before_size COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" - -D "TEST_PROGRAM=$<TARGET_FILE:h5clear${tgt_ext}>" + -D "TEST_PROGRAM=$<TARGET_FILE:h5clear${tgt_file_ext}>" -D "TEST_ARGS:STRING=--filesize;${testname}.h5" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" -D "TEST_OUTPUT=${testname}_before_size.out" @@ -299,12 +293,12 @@ if (NOT ${incr_size} MATCHES "NONE") add_test ( NAME H5CLEAR_FILESIZE_FAIL_INCR-${testname} - COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5clear${tgt_ext}> -s --increment=${incr_size} ${testname}.h5 + COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5clear${tgt_file_ext}> -s --increment=${incr_size} ${testname}.h5 ) else () add_test ( NAME H5CLEAR_FILESIZE_FAIL_INCR-${testname} - COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5clear${tgt_ext}> -s --increment ${testname}.h5 + COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5clear${tgt_file_ext}> -s --increment ${testname}.h5 ) endif () set_tests_properties (H5CLEAR_FILESIZE_FAIL_INCR-${testname} PROPERTIES @@ -315,7 +309,7 @@ NAME H5CLEAR_FILESIZE_FAIL_CMP-${testname}_after_size COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" - -D "TEST_PROGRAM=$<TARGET_FILE:h5clear${tgt_ext}>" + -D "TEST_PROGRAM=$<TARGET_FILE:h5clear${tgt_file_ext}>" -D "TEST_ARGS:STRING=--filesize;${testname}.h5" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" -D "TEST_OUTPUT=${testname}_after_size.out" @@ -352,7 +346,7 @@ # After "h5clear" the file, the subsequent file open succeeds add_test ( NAME H5CLEAR-h5clr-${testname} - COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5clear${tgt_ext}> -s ${testfile}.h5 + COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5clear${tgt_file_ext}> -s ${testfile}.h5 ) set_tests_properties (H5CLEAR-h5clr-${testname} PROPERTIES DEPENDS H5CLEAR-clr_open_chk-${testname}_${resultcode} diff --git a/tools/test/misc/CMakeTestsMkgrp.cmake b/tools/test/misc/CMakeTestsMkgrp.cmake index c947e0e..fb9e5ba 100644 --- a/tools/test/misc/CMakeTestsMkgrp.cmake +++ b/tools/test/misc/CMakeTestsMkgrp.cmake @@ -54,34 +54,33 @@ ############################################################################## ############################################################################## - if (NOT BUILD_SHARED_LIBS) - set (tgt_ext "") - else () - set (tgt_ext "-shared") - endif () - macro (ADD_H5_TEST resultfile resultcode resultoption) - add_test ( - NAME H5MKGRP-${resultfile}-clear-objects - COMMAND ${CMAKE_COMMAND} -E remove ${resultfile}.h5 - ) - set_tests_properties (H5MKGRP-${resultfile}-clear-objects PROPERTIES - WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles" - ) - add_test ( - NAME H5MKGRP-${resultfile} - COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5mkgrp${tgt_ext}> ${resultoption} ${resultfile}.h5 ${ARGN} - ) - set_tests_properties (H5MKGRP-${resultfile} PROPERTIES - DEPENDS H5MKGRP-${resultfile}-clear-objects - WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles" - ) - if (NOT HDF5_ENABLE_USING_MEMCHECKER) + if (HDF5_ENABLE_USING_MEMCHECKER) + add_test ( + NAME H5MKGRP-${resultfile} + COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5mkgrp${tgt_file_ext}> ${resultoption} ${resultfile}.h5 ${ARGN} + ) + else () + add_test ( + NAME H5MKGRP-${resultfile}-clear-objects + COMMAND ${CMAKE_COMMAND} -E remove ${resultfile}.h5 + ) + set_tests_properties (H5MKGRP-${resultfile}-clear-objects PROPERTIES + WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles" + ) + add_test ( + NAME H5MKGRP-${resultfile} + COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5mkgrp${tgt_file_ext}> ${resultoption} ${resultfile}.h5 ${ARGN} + ) + set_tests_properties (H5MKGRP-${resultfile} PROPERTIES + DEPENDS H5MKGRP-${resultfile}-clear-objects + WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles" + ) add_test ( NAME H5MKGRP-${resultfile}-h5ls COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" - -D "TEST_PROGRAM=$<TARGET_FILE:h5ls${tgt_ext}>" + -D "TEST_PROGRAM=$<TARGET_FILE:h5ls${tgt_file_ext}>" -D "TEST_ARGS:STRING=-v;-r;${resultfile}.h5" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" -D "TEST_OUTPUT=${resultfile}.out" @@ -96,7 +95,7 @@ macro (ADD_H5_CMP resultfile resultcode) if (HDF5_ENABLE_USING_MEMCHECKER) - add_test (NAME H5MKGRP_CMP-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5mkgrp${tgt_ext}> ${ARGN}) + add_test (NAME H5MKGRP_CMP-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5mkgrp${tgt_file_ext}> ${ARGN}) else () add_test ( NAME H5MKGRP_CMP-${resultfile}-clear-objects @@ -109,7 +108,7 @@ NAME H5MKGRP_CMP-${resultfile} COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" - -D "TEST_PROGRAM=$<TARGET_FILE:h5mkgrp${tgt_ext}>" + -D "TEST_PROGRAM=$<TARGET_FILE:h5mkgrp${tgt_file_ext}>" -D "TEST_ARGS:STRING=${ARGN}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" -D "TEST_OUTPUT=${resultfile}.out" diff --git a/tools/test/misc/CMakeTestsRepart.cmake b/tools/test/misc/CMakeTestsRepart.cmake index fa49c53..14b349c 100644 --- a/tools/test/misc/CMakeTestsRepart.cmake +++ b/tools/test/misc/CMakeTestsRepart.cmake @@ -58,12 +58,6 @@ ############################################################################## ############################################################################## - if (NOT BUILD_SHARED_LIBS) - set (tgt_ext "") - else () - set (tgt_ext "-shared") - endif () - # Remove any output file left over from previous test run add_test ( NAME H5REPART-clearall-objects @@ -82,7 +76,7 @@ # repartition family member size to 20,000 bytes. add_test ( NAME H5REPART-h5repart_20K - COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repart${tgt_ext}> -m 20000 family_file%05d.h5 fst_family%05d.h5 + COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repart${tgt_file_ext}> -m 20000 family_file%05d.h5 fst_family%05d.h5 ) set_tests_properties (H5REPART-h5repart_20K PROPERTIES FIXTURES_REQUIRED clear_testrepart @@ -91,7 +85,7 @@ # repartition family member size to 5 KB. add_test ( NAME H5REPART-h5repart_5K - COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repart${tgt_ext}> -m 5k family_file%05d.h5 scd_family%05d.h5 + COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repart${tgt_file_ext}> -m 5k family_file%05d.h5 scd_family%05d.h5 ) set_tests_properties (H5REPART-h5repart_5K PROPERTIES FIXTURES_REQUIRED clear_testrepart @@ -100,7 +94,7 @@ # convert family file to sec2 file of 20,000 bytes add_test ( NAME H5REPART-h5repart_single - COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repart${tgt_ext}> -m 20000 -family_to_single family_file%05d.h5 family_to_single.h5 + COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repart${tgt_file_ext}> -m 20000 -family_to_single family_file%05d.h5 family_to_single.h5 ) set_tests_properties (H5REPART-h5repart_single PROPERTIES FIXTURES_REQUIRED clear_testrepart @@ -109,7 +103,7 @@ # convert family file to sec2 file of 20,000 bytes (old argument) add_test ( NAME H5REPART-h5repart_sec2 - COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repart${tgt_ext}> -m 20000 -family_to_sec2 family_file%05d.h5 family_to_sec2.h5 + COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repart${tgt_file_ext}> -m 20000 -family_to_sec2 family_file%05d.h5 family_to_sec2.h5 ) set_tests_properties (H5REPART-h5repart_sec2 PROPERTIES FIXTURES_REQUIRED clear_testrepart diff --git a/tools/test/perform/perf.c b/tools/test/perform/perf.c index 3f56d8b..364836f 100644 --- a/tools/test/perform/perf.c +++ b/tools/test/perform/perf.c @@ -110,8 +110,10 @@ const char *FILENAME[] = { /* function prototypes */ static int parse_args(int argc, char **argv); +#ifndef H5_HAVE_UNISTD_H /* globals needed for getopt */ extern char *optarg; +#endif int main(int argc, char **argv) { diff --git a/tools/test/perform/pio_engine.c b/tools/test/perform/pio_engine.c index 8bc522f..cdd698e 100644 --- a/tools/test/perform/pio_engine.c +++ b/tools/test/perform/pio_engine.c @@ -129,6 +129,7 @@ static herr_t do_fopen(parameters *param, char *fname, file_descr *fd /*out*/, int flags); static herr_t do_fclose(iotype iot, file_descr *fd); static void do_cleanupfile(iotype iot, char *fname); +static off_t sqrto(off_t); /* * Function: do_pio @@ -199,7 +200,7 @@ do_pio(parameters param) bsize = buf_size; /* Actual buffer size */ } else { - snbytes = (off_t)sqrt((double)nbytes); /* General dataset size */ + snbytes = sqrto(nbytes); /* General dataset size */ bsize = buf_size * blk_size; /* Actual buffer size */ } @@ -362,15 +363,17 @@ done: switch (iot) { case POSIXIO: if (fd.posixfd != -1) - hrc = do_fclose(iot, &fd); + hrc = do_fclose(iot, &fd); break; case MPIO: if (fd.mpifd != MPI_FILE_NULL) - hrc = do_fclose(iot, &fd); + hrc = do_fclose(iot, &fd); break; case PHDF5: if (fd.h5fd != -1) - hrc = do_fclose(iot, &fd); + hrc = do_fclose(iot, &fd); + break; + default: break; } @@ -413,6 +416,8 @@ pio_create_filename(iotype iot, const char *base_name, char *fullname, size_t si case PHDF5: suffix = ".h5"; break; + default: + break; } /* First use the environment variable and then try the constant */ @@ -592,7 +597,7 @@ do_write(results *res, file_descr *fd, parameters *parms, long ndsets, /* nbytes is always the number of bytes per dataset (1D or 2D). If the dataspace is 2D, snbytes is the size of a side of the dataset square. */ - snbytes = (off_t)sqrt((double)nbytes); + snbytes = sqrto(nbytes); /* Contiguous Pattern: */ if (!parms->interleaved) { @@ -857,6 +862,9 @@ do_write(results *res, file_descr *fd, parameters *parms, long ndsets, } /* end if */ } /* end if */ break; + + default: + break; } /* end switch */ for (ndset = 1; ndset <= ndsets; ++ndset) { @@ -920,6 +928,9 @@ do_write(results *res, file_descr *fd, parameters *parms, long ndsets, GOTOERROR(FAIL); } break; + + default: + break; } /* The task is to transfer bytes_count bytes, starting at @@ -1376,6 +1387,9 @@ do_write(results *res, file_descr *fd, parameters *parms, long ndsets, } /* end else */ break; + + default: + break; } /* switch (parms->io_type) */ } /* end while */ @@ -1476,6 +1490,13 @@ done: return ret_code; } +static off_t +sqrto(off_t x) +{ + double root_x = sqrt((double)x); + return (off_t)root_x; +} + /* * Function: do_read * Purpose: read the required amount of data from the file. @@ -1568,7 +1589,7 @@ do_read(results *res, file_descr *fd, parameters *parms, long ndsets, /* nbytes is always the number of bytes per dataset (1D or 2D). If the dataspace is 2D, snbytes is the size of a side of the 'dataset square'. */ - snbytes = (off_t)sqrt((double)nbytes); + snbytes = sqrto(nbytes); bsize = buf_size * blk_size; @@ -1815,19 +1836,22 @@ do_read(results *res, file_descr *fd, parameters *parms, long ndsets, /* Create the dataset transfer property list */ h5dxpl = H5Pcreate(H5P_DATASET_XFER); if (h5dxpl < 0) { - HDfprintf(stderr, "HDF5 Property List Create failed\n"); - GOTOERROR(FAIL); + HDfprintf(stderr, "HDF5 Property List Create failed\n"); + GOTOERROR(FAIL); } /* Change to collective I/O, if asked */ if(parms->collective) { - hrc = H5Pset_dxpl_mpio(h5dxpl, H5FD_MPIO_COLLECTIVE); - if (hrc < 0) { - HDfprintf(stderr, "HDF5 Property List Set failed\n"); - GOTOERROR(FAIL); - } /* end if */ + hrc = H5Pset_dxpl_mpio(h5dxpl, H5FD_MPIO_COLLECTIVE); + if (hrc < 0) { + HDfprintf(stderr, "HDF5 Property List Set failed\n"); + GOTOERROR(FAIL); + } /* end if */ } /* end if */ break; + + default: + break; } /* end switch */ for (ndset = 1; ndset <= ndsets; ++ndset) { @@ -1838,19 +1862,21 @@ do_read(results *res, file_descr *fd, parameters *parms, long ndsets, switch (parms->io_type) { case POSIXIO: case MPIO: - /* both posix and mpi io just need dataset offset in file*/ - dset_offset = (ndset - 1) * nbytes; - break; + /* both posix and mpi io just need dataset offset in file*/ + dset_offset = (ndset - 1) * nbytes; + break; case PHDF5: HDsprintf(dname, "Dataset_%ld", ndset); - h5ds_id = H5DOPEN(fd->h5fd, dname); - if (h5ds_id < 0) { - HDfprintf(stderr, "HDF5 Dataset open failed\n"); - GOTOERROR(FAIL); - } + h5ds_id = H5DOPEN(fd->h5fd, dname); + if (h5ds_id < 0) { + HDfprintf(stderr, "HDF5 Dataset open failed\n"); + GOTOERROR(FAIL); + } + break; - break; + default: + break; } /* The task is to transfer bytes_count bytes, starting at @@ -2303,6 +2329,9 @@ do_read(results *res, file_descr *fd, parameters *parms, long ndsets, } /* end else */ break; + + default: + break; } /* switch (parms->io_type) */ /* Verify raw data, if asked */ @@ -2532,6 +2561,9 @@ do_fopen(parameters *param, char *fname, file_descr *fd /*out*/, int flags) } break; + + default: + break; } done: @@ -2552,38 +2584,41 @@ do_fclose(iotype iot, file_descr *fd /*out*/) int mrc = 0, rc = 0; switch (iot) { - case POSIXIO: - rc = POSIXCLOSE(fd->posixfd); + case POSIXIO: + rc = POSIXCLOSE(fd->posixfd); - if (rc != 0){ - HDfprintf(stderr, "POSIX File Close failed\n"); - GOTOERROR(FAIL); - } + if (rc != 0){ + HDfprintf(stderr, "POSIX File Close failed\n"); + GOTOERROR(FAIL); + } - fd->posixfd = -1; - break; + fd->posixfd = -1; + break; - case MPIO: - mrc = MPI_File_close(&fd->mpifd); + case MPIO: + mrc = MPI_File_close(&fd->mpifd); - if (mrc != MPI_SUCCESS){ - HDfprintf(stderr, "MPI File close failed\n"); - GOTOERROR(FAIL); - } + if (mrc != MPI_SUCCESS){ + HDfprintf(stderr, "MPI File close failed\n"); + GOTOERROR(FAIL); + } - fd->mpifd = MPI_FILE_NULL; - break; + fd->mpifd = MPI_FILE_NULL; + break; - case PHDF5: - hrc = H5Fclose(fd->h5fd); + case PHDF5: + hrc = H5Fclose(fd->h5fd); - if (hrc < 0) { - HDfprintf(stderr, "HDF5 File Close failed\n"); - GOTOERROR(FAIL); - } + if (hrc < 0) { + HDfprintf(stderr, "HDF5 File Close failed\n"); + GOTOERROR(FAIL); + } - fd->h5fd = -1; - break; + fd->h5fd = -1; + break; + + default: + break; } done: @@ -2610,15 +2645,17 @@ do_cleanupfile(iotype iot, char *fname) clean_file_g = (getenv("HDF5_NOCLEANUP")==NULL) ? 1 : 0; if (clean_file_g){ - switch (iot){ - case POSIXIO: - HDremove(fname); - break; - case MPIO: - case PHDF5: - MPI_File_delete(fname, h5_io_info_g); - break; - } + switch (iot){ + case POSIXIO: + HDremove(fname); + break; + case MPIO: + case PHDF5: + MPI_File_delete(fname, h5_io_info_g); + break; + default: + break; + } } } diff --git a/tools/test/perform/pio_perf.c b/tools/test/perform/pio_perf.c index 4c0ec5e..826e7a9 100644 --- a/tools/test/perform/pio_perf.c +++ b/tools/test/perform/pio_perf.c @@ -80,11 +80,12 @@ #define PIO_MPI 0x2 #define PIO_HDF5 0x4 +#ifdef STANDALONE #define DBL_EPSILON 2.2204460492503131e-16 #define H5_DBL_ABS_EQUAL(X,Y) (fabs((X)-(Y)) < DBL_EPSILON) +#endif /* report 0.0 in case t is zero too */ -#define MB_PER_SEC(bytes,t) (((t)==0.0) ? 0.0 : ((((double)bytes) / ONE_MB) / (t))) #define MB_PER_SEC(bytes,t) (H5_DBL_ABS_EQUAL((t), 0.0) ? 0.0 : ((((double)bytes) / ONE_MB) / (t))) #ifndef TRUE @@ -569,6 +570,8 @@ run_test(iotype iot, parameters parms, struct options *opts) case PHDF5: output_report("PHDF5 (w/MPI-IO driver)\n"); break; + default: + break; } MPI_Comm_size(pio_comm_g, &comm_size); diff --git a/tools/test/perform/sio_engine.c b/tools/test/perform/sio_engine.c index 69409bb..9ea94cb 100644 --- a/tools/test/perform/sio_engine.c +++ b/tools/test/perform/sio_engine.c @@ -1268,8 +1268,7 @@ done: * 'temp' in the code below, but early (4.4.7, at least) gcc only * allows diagnostic pragmas to be toggled outside of functions. */ -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wformat-nonliteral" +H5_GCC_DIAG_OFF(format-nonliteral) static void do_cleanupfile(iotype iot, char *filename) { @@ -1331,5 +1330,5 @@ do_cleanupfile(iotype iot, char *filename) } } } -#pragma GCC diagnostic pop +H5_GCC_DIAG_ON(format-nonliteral) |