From 9f61f559d1541066b07c02609579bf053099ab90 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Fri, 18 Jan 2019 16:02:09 -0600 Subject: Fix CMake policy 54 warnings --- config/cmake/jrunTest.cmake | 46 +++++++++++++++++----------------- config/cmake/scripts/HDF5config.cmake | 2 +- config/cmake/vfdTest.cmake | 2 +- config/cmake_ext_mod/grepTest.cmake | 8 +++--- config/cmake_ext_mod/runTest.cmake | 44 ++++++++++++++++---------------- release_docs/RELEASE.txt | 6 +++++ tools/test/misc/CMakeTestsRepart.cmake | 25 +++++++++++------- 7 files changed, 73 insertions(+), 60 deletions(-) diff --git a/config/cmake/jrunTest.cmake b/config/cmake/jrunTest.cmake index 43aef22..23f297c 100644 --- a/config/cmake/jrunTest.cmake +++ b/config/cmake/jrunTest.cmake @@ -77,10 +77,10 @@ if (EXISTS ${TEST_FOLDER}/${TEST_OUTPUT}.err) endif () if (NOT ERROR_APPEND) - # append error output to the stdout output file + # write back to original .err file file (WRITE ${TEST_FOLDER}/${TEST_OUTPUT}.err "${TEST_STREAM}") else () - # write back to original .err file + # append error output to the stdout output file file (APPEND ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}") endif () endif () @@ -110,8 +110,8 @@ if (TEST_MASK_ERROR) endif () endif () -# if the return value is !=0 bail out -if (NOT "${TEST_RESULT}" STREQUAL "${TEST_EXPECT}") +# if the return value is !=expected bail out +if (NOT TEST_RESULT EQUAL TEST_EXPECT) message (STATUS "ERROR OUTPUT: ${TEST_STREAM}") message (FATAL_ERROR "Failed: Test program ${TEST_PROGRAM} exited != 0.\n${TEST_ERROR}") endif () @@ -131,33 +131,33 @@ if (NOT TEST_SKIP_COMPARE) COMMAND ${CMAKE_COMMAND} -E compare_files ${TEST_FOLDER}/${TEST_OUTPUT} ${TEST_FOLDER}/${TEST_REFERENCE} RESULT_VARIABLE TEST_RESULT ) - if (NOT "${TEST_RESULT}" STREQUAL "0") + if (TEST_RESULT) set (TEST_RESULT 0) file (STRINGS ${TEST_FOLDER}/${TEST_OUTPUT} test_act) list (LENGTH test_act len_act) file (STRINGS ${TEST_FOLDER}/${TEST_REFERENCE} test_ref) list (LENGTH test_ref len_ref) - if (NOT "${len_act}" STREQUAL "0" AND NOT "${len_ref}" STREQUAL "0") + if (len_act GREATER 0 AND len_ref GREATER 0) math (EXPR _FP_LEN "${len_ref} - 1") foreach (line RANGE 0 ${_FP_LEN}) list (GET test_act ${line} str_act) list (GET test_ref ${line} str_ref) - if (NOT "${str_act}" STREQUAL "${str_ref}") - if (NOT "${str_act}" STREQUAL "") + if (NOT ${str_act} STREQUAL ${str_ref}) + if (NOT str_act STREQUAL "") set (TEST_RESULT 1) message ("line = ${line}\n***ACTUAL: ${str_act}\n****REFER: ${str_ref}\n") endif () endif () endforeach () else () - if ("${len_act}" STREQUAL "0") + if (len_act EQUAL 0) message (STATUS "COMPARE Failed: ${TEST_FOLDER}/${TEST_OUTPUT} is empty") endif () - if ("${len_ref}" STREQUAL "0") + if (len_ref EQUAL 0) message (STATUS "COMPARE Failed: ${TEST_FOLDER}/${TEST_REFERENCE} is empty") endif () endif () - if (NOT "${len_act}" STREQUAL "${len_ref}") + if (NOT len_act EQUAL len_ref) set (TEST_RESULT 1) endif () endif () @@ -165,7 +165,7 @@ if (NOT TEST_SKIP_COMPARE) message (STATUS "COMPARE Result: ${TEST_RESULT}") # again, if return value is !=0 scream and shout - if (NOT "${TEST_RESULT}" STREQUAL "0") + if (TEST_RESULT) message (FATAL_ERROR "Failed: The output of ${TEST_OUTPUT} did not match ${TEST_REFERENCE}") endif () endif () @@ -182,34 +182,34 @@ if (NOT TEST_SKIP_COMPARE) COMMAND ${CMAKE_COMMAND} -E compare_files ${TEST_FOLDER}/${TEST_OUTPUT}.err ${TEST_FOLDER}/${TEST_ERRREF} RESULT_VARIABLE TEST_RESULT ) - if (NOT "${TEST_RESULT}" STREQUAL "0") + if (TEST_RESULT) set (TEST_RESULT 0) file (STRINGS ${TEST_FOLDER}/${TEST_OUTPUT}.err test_act) list (LENGTH test_act len_act) file (STRINGS ${TEST_FOLDER}/${TEST_ERRREF} test_ref) list (LENGTH test_ref len_ref) math (EXPR _FP_LEN "${len_ref} - 1") - if (NOT "${len_act}" STREQUAL "0" AND NOT "${len_ref}" STREQUAL "0") + if (len_act GREATER 0 AND len_ref GREATER 0) math (EXPR _FP_LEN "${len_ref} - 1") foreach (line RANGE 0 ${_FP_LEN}) list (GET test_act ${line} str_act) list (GET test_ref ${line} str_ref) - if (NOT "${str_act}" STREQUAL "${str_ref}") - if (NOT "${str_act}" STREQUAL "") + if (NOT ${str_act} STREQUAL ${str_ref}) + if (NOT ${str_act} STREQUAL "") set (TEST_RESULT 1) message ("line = ${line}\n***ACTUAL: ${str_act}\n****REFER: ${str_ref}\n") endif () endif () endforeach () else () - if ("${len_act}" STREQUAL "0") + if (len_act EQUAL 0) message (STATUS "COMPARE Failed: ${TEST_FOLDER}/${TEST_OUTPUT}.err is empty") endif () - if ("${len_ref}" STREQUAL "0") + if (len_ref EQUAL 0) message (STATUS "COMPARE Failed: ${TEST_FOLDER}/${TEST_ERRREF} is empty") endif () endif () - if (NOT "${len_act}" STREQUAL "${len_ref}") + if (NOT len_act EQUAL len_ref) set (TEST_RESULT 1) endif () endif () @@ -217,7 +217,7 @@ if (NOT TEST_SKIP_COMPARE) message (STATUS "COMPARE Result: ${TEST_RESULT}") # again, if return value is !=0 scream and shout - if (NOT "${TEST_RESULT}" STREQUAL "0") + if (TEST_RESULT) message (FATAL_ERROR "Failed: The error output of ${TEST_OUTPUT}.err did not match ${TEST_ERRREF}") endif () endif () @@ -230,15 +230,15 @@ if (TEST_GREP_COMPARE) # TEST_REFERENCE should always be matched string (REGEX MATCH "${TEST_REFERENCE}" TEST_MATCH ${TEST_STREAM}) string (COMPARE EQUAL "${TEST_REFERENCE}" "${TEST_MATCH}" TEST_RESULT) - if ("${TEST_RESULT}" STREQUAL "0") + if (NOT TEST_RESULT) message (FATAL_ERROR "Failed: The output of ${TEST_PROGRAM} did not contain ${TEST_REFERENCE}") endif () string (REGEX MATCH "${TEST_FILTER}" TEST_MATCH ${TEST_STREAM}) - if ("${TEST_EXPECT}" STREQUAL "1") + if (TEST_EXPECT) # TEST_EXPECT (1) interperts TEST_FILTER as NOT to match string (LENGTH "${TEST_MATCH}" TEST_RESULT) - if (NOT "${TEST_RESULT}" STREQUAL "0") + if (TEST_RESULT) message (FATAL_ERROR "Failed: The output of ${TEST_PROGRAM} did contain ${TEST_FILTER}") endif () endif () diff --git a/config/cmake/scripts/HDF5config.cmake b/config/cmake/scripts/HDF5config.cmake index f9b6401..f8e6f9b 100755 --- a/config/cmake/scripts/HDF5config.cmake +++ b/config/cmake/scripts/HDF5config.cmake @@ -184,7 +184,7 @@ set (MODEL "Experimental") ##### Following controls source update ##### #set (LOCAL_UPDATE "TRUE") set (REPOSITORY_URL "https://git@bitbucket.hdfgroup.org/scm/hdffv/hdf5.git") -set (REPOSITORY_BRANCH "hdf5_1_10_4") +set (REPOSITORY_BRANCH "hdf5_1_10_5") #uncomment to use a compressed source file: *.tar on linux or mac *.zip on windows #set(CTEST_USE_TAR_SOURCE "${CTEST_SOURCE_VERSION}") diff --git a/config/cmake/vfdTest.cmake b/config/cmake/vfdTest.cmake index 95a4c40..b616958 100644 --- a/config/cmake/vfdTest.cmake +++ b/config/cmake/vfdTest.cmake @@ -60,7 +60,7 @@ if (ERROR_APPEND AND EXISTS ${TEST_FOLDER}/${TEST_OUTPUT}_${TEST_VFD}.err) endif () # if the return value is !=${TEST_EXPECT} bail out -if (NOT "${TEST_RESULT}" STREQUAL "${TEST_EXPECT}") +if (NOT TEST_RESULT EQUAL TEST_EXPECT) if (NOT TEST_NOERRDISPLAY) if (EXISTS ${TEST_FOLDER}/${TEST_OUTPUT}_${TEST_VFD}.out) file (READ ${TEST_FOLDER}/${TEST_OUTPUT}_${TEST_VFD}.out TEST_STREAM) diff --git a/config/cmake_ext_mod/grepTest.cmake b/config/cmake_ext_mod/grepTest.cmake index b812d73..1417204 100644 --- a/config/cmake_ext_mod/grepTest.cmake +++ b/config/cmake_ext_mod/grepTest.cmake @@ -57,15 +57,15 @@ file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) # TEST_REFERENCE should always be matched string (REGEX MATCH "${TEST_REFERENCE}" TEST_MATCH ${TEST_STREAM}) string (COMPARE EQUAL "${TEST_REFERENCE}" "${TEST_MATCH}" TEST_RESULT) -if ("${TEST_RESULT}" STREQUAL "0") +if (NOT TEST_RESULT) message (FATAL_ERROR "Failed: The output of ${TEST_PROGRAM} did not contain ${TEST_REFERENCE}") endif () string (REGEX MATCH "${TEST_FILTER}" TEST_MATCH ${TEST_STREAM}) -if ("${TEST_EXPECT}" STREQUAL "1") - # TEST_EXPECT (1) interperts TEST_FILTER as NOT to match +if (TEST_EXPECT) + # TEST_EXPECT (1) interprets TEST_FILTER as; NOT to match string (LENGTH "${TEST_MATCH}" TEST_RESULT) - if (NOT "${TEST_RESULT}" STREQUAL "0") + if (TEST_RESULT) message (FATAL_ERROR "Failed: The output of ${TEST_PROGRAM} did contain ${TEST_FILTER}") endif () endif () diff --git a/config/cmake_ext_mod/runTest.cmake b/config/cmake_ext_mod/runTest.cmake index 4ac1dc8..e11852a 100644 --- a/config/cmake_ext_mod/runTest.cmake +++ b/config/cmake_ext_mod/runTest.cmake @@ -80,7 +80,7 @@ if (TEST_REGEX) file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) string (REGEX MATCH "${TEST_REGEX}" REGEX_MATCH ${TEST_STREAM}) string (COMPARE EQUAL "${REGEX_MATCH}" "${TEST_MATCH}" REGEX_RESULT) - if ("${REGEX_RESULT}" STREQUAL "0") + if (NOT REGEX_RESULT) message (STATUS "Failed: The output of ${TEST_PROGRAM} did not contain ${TEST_MATCH}") endif () endif () @@ -111,7 +111,7 @@ if (TEST_APPEND) endif () # if the return value is !=${TEST_EXPECT} bail out -if (NOT "${TEST_RESULT}" STREQUAL "${TEST_EXPECT}") +if (NOT TEST_RESULT EQUAL TEST_EXPECT) if (NOT TEST_NOERRDISPLAY) if (EXISTS ${TEST_FOLDER}/${TEST_OUTPUT}) file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) @@ -126,7 +126,7 @@ message (STATUS "COMMAND Error: ${TEST_ERROR}") # remove special output file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) string (FIND TEST_STREAM "_pmi_alps" "${TEST_FIND_RESULT}") -if (NOT ${TEST_FIND_RESULT} STREQUAL "0") +if (TEST_FIND_RESULT GREATER 0) string (REGEX REPLACE "^.*_pmi_alps[^\n]+\n" "" TEST_STREAM "${TEST_STREAM}") file (WRITE ${TEST_FOLDER}/${TEST_OUTPUT} ${TEST_STREAM}) endif () @@ -207,33 +207,33 @@ if (NOT TEST_SKIP_COMPARE) endif () endif () - if (NOT "${TEST_RESULT}" STREQUAL "0") + if (TEST_RESULT) set (TEST_RESULT 0) file (STRINGS ${TEST_FOLDER}/${TEST_OUTPUT} test_act) list (LENGTH test_act len_act) file (STRINGS ${TEST_FOLDER}/${TEST_REFERENCE} test_ref) list (LENGTH test_ref len_ref) - if (NOT "${len_act}" STREQUAL "0" AND NOT "${len_ref}" STREQUAL "0") + if (len_act GREATER 0 AND len_ref GREATER 0) math (EXPR _FP_LEN "${len_ref} - 1") foreach (line RANGE 0 ${_FP_LEN}) list (GET test_act ${line} str_act) list (GET test_ref ${line} str_ref) - if (NOT "${str_act}" STREQUAL "${str_ref}") - if (NOT "${str_act}" STREQUAL "") + if (NOT ${str_act} STREQUAL ${str_ref}) + if (NOT str_act STREQUAL "") set (TEST_RESULT 1) message ("line = ${line}\n***ACTUAL: ${str_act}\n****REFER: ${str_ref}\n") endif () endif () endforeach () else () - if ("${len_act}" STREQUAL "0") + if (len_act EQUAL 0) message (STATUS "COMPARE Failed: ${TEST_FOLDER}/${TEST_OUTPUT} is empty") endif () - if ("${len_ref}" STREQUAL "0") + if (len_ref EQUAL 0) message (STATUS "COMPARE Failed: ${TEST_FOLDER}/${TEST_REFERENCE} is empty") endif () endif () - if (NOT "${len_act}" STREQUAL "${len_ref}") + if (NOT len_act EQUAL len_ref) set (TEST_RESULT 1) endif () endif () @@ -241,7 +241,7 @@ if (NOT TEST_SKIP_COMPARE) message (STATUS "COMPARE Result: ${TEST_RESULT}") # again, if return value is !=0 scream and shout - if (NOT "${TEST_RESULT}" STREQUAL "0") + if (TEST_RESULT) message (FATAL_ERROR "Failed: The output of ${TEST_OUTPUT} did not match ${TEST_REFERENCE}") endif () endif () @@ -258,34 +258,34 @@ if (NOT TEST_SKIP_COMPARE) COMMAND ${CMAKE_COMMAND} -E compare_files ${TEST_FOLDER}/${TEST_OUTPUT}.err ${TEST_FOLDER}/${TEST_ERRREF} RESULT_VARIABLE TEST_RESULT ) - if (NOT "${TEST_RESULT}" STREQUAL "0") + if (TEST_RESULT) set (TEST_RESULT 0) file (STRINGS ${TEST_FOLDER}/${TEST_OUTPUT}.err test_act) list (LENGTH test_act len_act) file (STRINGS ${TEST_FOLDER}/${TEST_ERRREF} test_ref) list (LENGTH test_ref len_ref) math (EXPR _FP_LEN "${len_ref} - 1") - if (NOT "${len_act}" STREQUAL "0" AND NOT "${len_ref}" STREQUAL "0") + if (len_act GREATER 0 AND len_ref GREATER 0) math (EXPR _FP_LEN "${len_ref} - 1") foreach (line RANGE 0 ${_FP_LEN}) list (GET test_act ${line} str_act) list (GET test_ref ${line} str_ref) - if (NOT "${str_act}" STREQUAL "${str_ref}") - if (NOT "${str_act}" STREQUAL "") + if (NOT ${str_act} STREQUAL ${str_ref}) + if (NOT ${str_act} STREQUAL "") set (TEST_RESULT 1) message ("line = ${line}\n***ACTUAL: ${str_act}\n****REFER: ${str_ref}\n") endif () endif () endforeach () else () - if ("${len_act}" STREQUAL "0") + if (len_act EQUAL 0) message (STATUS "COMPARE Failed: ${TEST_FOLDER}/${TEST_OUTPUT}.err is empty") endif () - if ("${len_ref}" STREQUAL "0") + if (len_ref EQUAL 0) message (STATUS "COMPARE Failed: ${TEST_FOLDER}/${TEST_ERRREF} is empty") endif () endif () - if (NOT "${len_act}" STREQUAL "${len_ref}") + if (NOT len_act EQUAL len_ref) set (TEST_RESULT 1) endif () endif () @@ -293,7 +293,7 @@ if (NOT TEST_SKIP_COMPARE) message (STATUS "COMPARE Result: ${TEST_RESULT}") # again, if return value is !=0 scream and shout - if (NOT "${TEST_RESULT}" STREQUAL "0") + if (TEST_RESULT) message (FATAL_ERROR "Failed: The error output of ${TEST_OUTPUT}.err did not match ${TEST_ERRREF}") endif () endif () @@ -306,15 +306,15 @@ if (TEST_GREP_COMPARE) # TEST_REFERENCE should always be matched string (REGEX MATCH "${TEST_REFERENCE}" TEST_MATCH ${TEST_STREAM}) string (COMPARE EQUAL "${TEST_REFERENCE}" "${TEST_MATCH}" TEST_RESULT) - if ("${TEST_RESULT}" STREQUAL "0") + if (NOT TEST_RESULT) message (FATAL_ERROR "Failed: The output of ${TEST_PROGRAM} did not contain ${TEST_REFERENCE}") endif () string (REGEX MATCH "${TEST_FILTER}" TEST_MATCH ${TEST_STREAM}) - if ("${TEST_EXPECT}" STREQUAL "1") + if (TEST_EXPECT) # TEST_EXPECT (1) interperts TEST_FILTER as NOT to match string (LENGTH "${TEST_MATCH}" TEST_RESULT) - if (NOT "${TEST_RESULT}" STREQUAL "0") + if (TEST_RESULT) message (FATAL_ERROR "Failed: The output of ${TEST_PROGRAM} did contain ${TEST_FILTER}") endif () endif () diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 836d1a1..e4a39c9 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -47,6 +47,12 @@ New Features Configuration: ------------- + - Rework CMake command files to eliminate developer CMP005 warning + + Use variables without quotes in if () statements. + + (ADB - 2019/01/18, TILABS-105) + - Rework CMake configure files to eliminate developer CMP0075 warning Renamed varname to HDF5_REQUIRED_LIBRARIES as the contents were not diff --git a/tools/test/misc/CMakeTestsRepart.cmake b/tools/test/misc/CMakeTestsRepart.cmake index 830de11..8edd243 100644 --- a/tools/test/misc/CMakeTestsRepart.cmake +++ b/tools/test/misc/CMakeTestsRepart.cmake @@ -71,30 +71,37 @@ family_to_single.h5 family_to_sec2.h5 ) - if (NOT "${last_test}" STREQUAL "") - set_tests_properties (H5REPART-clearall-objects PROPERTIES DEPENDS ${last_test}) - endif () - set (last_test "H5REPART-clearall-objects") + set_tests_properties (H5REPART-clearall-objects PROPERTIES FIXTURES_SETUP clear_testrepart) # repartition family member size to 20,000 bytes. add_test (NAME H5REPART-h5repart_20K COMMAND $ -m 20000 family_file%05d.h5 fst_family%05d.h5) - set_tests_properties (H5REPART-h5repart_20K PROPERTIES DEPENDS H5REPART-clearall-objects) + set_tests_properties (H5REPART-h5repart_20K PROPERTIES + FIXTURES_REQUIRED clear_testrepart + ) # repartition family member size to 5 KB. add_test (NAME H5REPART-h5repart_5K COMMAND $ -m 5k family_file%05d.h5 scd_family%05d.h5) - set_tests_properties (H5REPART-h5repart_5K PROPERTIES DEPENDS H5REPART-clearall-objects) + set_tests_properties (H5REPART-h5repart_5K PROPERTIES + FIXTURES_REQUIRED clear_testrepart + ) # convert family file to sec2 file of 20,000 bytes add_test (NAME H5REPART-h5repart_single COMMAND $ -m 20000 -family_to_single family_file%05d.h5 family_to_single.h5) - set_tests_properties (H5REPART-h5repart_single PROPERTIES DEPENDS H5REPART-clearall-objects) + set_tests_properties (H5REPART-h5repart_single PROPERTIES + FIXTURES_REQUIRED clear_testrepart + ) # convert family file to sec2 file of 20,000 bytes (old argument) add_test (NAME H5REPART-h5repart_sec2 COMMAND $ -m 20000 -family_to_sec2 family_file%05d.h5 family_to_sec2.h5) - set_tests_properties (H5REPART-h5repart_sec2 PROPERTIES DEPENDS H5REPART-clearall-objects) + set_tests_properties (H5REPART-h5repart_sec2 PROPERTIES + FIXTURES_REQUIRED clear_testrepart + ) # test the output files repartitioned above. add_test (NAME H5REPART-h5repart_test COMMAND $) - set_tests_properties (H5REPART-h5repart_test PROPERTIES DEPENDS "H5REPART-clearall-objects;H5REPART-h5repart_20K;H5REPART-h5repart_5K;H5REPART-h5repart_sec2") + set_tests_properties (H5REPART-h5repart_test PROPERTIES + DEPENDS "H5REPART-h5repart_20K;H5REPART-h5repart_5K;H5REPART-h5repart_single;H5REPART-h5repart_sec2" + ) set (H5_DEP_EXECUTABLES ${H5_DEP_EXECUTABLES} h5repart_test -- cgit v0.12 From 2bd5c6d529e5038f81575d59f3b2d1b36ec2abaa Mon Sep 17 00:00:00 2001 From: Ray Lu Date: Tue, 8 Jan 2019 17:59:03 -0600 Subject: Merge pull request #1450 in HDFFV/hdf5 from ~SONGYULU/hdf5_ray:TRILAB-98-dt_arith-and-cpp_testhdf5-tests to develop * commit 'b02de315b93ac29d2483a91d526b110a25073505': NNSA Tri-LabsTRILAB-98: Another two test cases out. NNSA Tri-Labs TRILAB-98: Taking out a few more test cases. NNSA Tri-Labs TRILAB-98 dt_arith and cpp_testhdf5 tests fail on sierra.llnl.gov: According to the group decision, simply provide a macro to disable some failing test cases on sierra (IBM power9 cpu). All failing cases involve long double data type. --- config/cmake/ConfigureChecks.cmake | 5 +++ config/cmake/ConversionTests.c | 24 +++++++++++ config/cmake/H5pubconf.h.in | 3 ++ configure.ac | 24 +++++++++++ test/dt_arith.c | 81 +++++++++++++++++++++++++++++++++----- 5 files changed, 128 insertions(+), 9 deletions(-) diff --git a/config/cmake/ConfigureChecks.cmake b/config/cmake/ConfigureChecks.cmake index 459346e..c1abeed 100644 --- a/config/cmake/ConfigureChecks.cmake +++ b/config/cmake/ConfigureChecks.cmake @@ -247,6 +247,11 @@ H5ConversionTests (${HDF_PREFIX}_LDOUBLE_TO_LLONG_ACCURATE "Checking IF correctl # H5ConversionTests (${HDF_PREFIX}_LLONG_TO_LDOUBLE_CORRECT "Checking IF correctly converting (unsigned) long long to long double values") # ---------------------------------------------------------------------- +# Set the flag to indicate that the machine can accurately convert +# some long double values +# +H5ConversionTests (${HDF_PREFIX}_DISABLE_SOME_LDOUBLE_CONV "Checking IF the cpu is power9 and cannot correctly converting long double values") +# ---------------------------------------------------------------------- # Check if pointer alignments are enforced # H5ConversionTests (${HDF_PREFIX}_NO_ALIGNMENT_RESTRICTIONS "Checking IF alignment restrictions are strictly enforced") diff --git a/config/cmake/ConversionTests.c b/config/cmake/ConversionTests.c index c2748b2..6d597a0 100644 --- a/config/cmake/ConversionTests.c +++ b/config/cmake/ConversionTests.c @@ -287,3 +287,27 @@ main () #endif +#ifdef H5_DISABLE_SOME_LDOUBLE_CONV_TEST + +#include +#include +#include + +int HDF_NO_UBSAN main(void) +{ + FILE *fp; + char cpu[64]; + + fp = popen("uname -m", "r"); + + fgets(cpu, sizeof(cpu)-1, fp); + + pclose(fp); + + if(strncmp(cpu, "ppc64le", 7) == 0) + return 0; + + return 1; +} + +#endif diff --git a/config/cmake/H5pubconf.h.in b/config/cmake/H5pubconf.h.in index 4edaff0..871a78d 100644 --- a/config/cmake/H5pubconf.h.in +++ b/config/cmake/H5pubconf.h.in @@ -460,6 +460,9 @@ with special algorithm. */ #cmakedefine H5_LONG_TO_LDOUBLE_SPECIAL @H5_LONG_TO_LDOUBLE_SPECIAL@ +/* Define if your system is power6 and cannot convert some long double values. */ +#cmakedefine H5_DISABLE_SOME_LDOUBLE_CONV @H5_DISABLE_SOME_LDOUBLE_CONV@ + /* Define to the sub-directory where libtool stores uninstalled libraries. */ #cmakedefine H5_LT_OBJDIR @H5_LT_OBJDIR@ diff --git a/configure.ac b/configure.ac index 6b591ae..4f37bd4 100644 --- a/configure.ac +++ b/configure.ac @@ -2970,6 +2970,30 @@ else fi ## ---------------------------------------------------------------------- +## Set the flag to indicate that the machine is IBM ppc64le and cannot +## accurately convert some long double values. +## +AC_MSG_CHECKING([if the system is IBM ppc64le and cannot correctly convert some long double values]) + +TEST_SRC="`(echo \"#define H5_DISABLE_SOME_LDOUBLE_CONV_TEST 1\"; cat $srcdir/config/cmake/ConversionTests.c)`" + +if test ${ac_cv_sizeof_long_double} = 0; then + hdf5_cv_disable_some_ldouble_conv=${hdf5_cv_disable_some_ldouble_conv=no} +else + AC_CACHE_VAL([hdf5_cv_disable_some_ldouble_conv], + [AC_RUN_IFELSE([AC_LANG_SOURCE([$TEST_SRC])], + [hdf5_cv_disable_some_ldouble_conv=yes], [hdf5_cv_disable_some_ldouble_conv=no],[])]) +fi + +if test ${hdf5_cv_disable_some_ldouble_conv} = "yes"; then + AC_DEFINE([DISABLE_SOME_LDOUBLE_CONV], [1], + [Define if your system is IBM ppc64le and cannot convert some long double values correctly.]) + AC_MSG_RESULT([yes]) +else + AC_MSG_RESULT([no]) +fi + +## ---------------------------------------------------------------------- ## Set some variables for general configuration information to be saved ## and installed with the libraries (used to generate libhdf5.settings). ## diff --git a/test/dt_arith.c b/test/dt_arith.c index c7f2986..2729ba1 100644 --- a/test/dt_arith.c +++ b/test/dt_arith.c @@ -4883,7 +4883,24 @@ run_fp_tests(const char *name) #if H5_SIZEOF_LONG_DOUBLE!=H5_SIZEOF_DOUBLE && H5_SIZEOF_LONG_DOUBLE!=0 nerrors += test_conv_flt_1(name, TEST_DENORM, H5T_NATIVE_FLOAT, H5T_NATIVE_LDOUBLE); nerrors += test_conv_flt_1(name, TEST_DENORM, H5T_NATIVE_DOUBLE, H5T_NATIVE_LDOUBLE); +#ifndef H5_DISABLE_SOME_LDOUBLE_CONV nerrors += test_conv_flt_1(name, TEST_DENORM, H5T_NATIVE_LDOUBLE, H5T_NATIVE_FLOAT); +#else + { + char str[256]; /*string */ + + HDsnprintf(str, sizeof(str), "Testing %s denormalized %s -> %s conversions", + name, "long double", "float"); + printf("%-70s", str); + SKIPPED(); +#if H5_SIZEOF_LONG_DOUBLE!=0 + HDputs(" Test skipped due to the conversion problem on IBM ppc64le cpu."); +#else + HDputs(" Test skipped due to disabled long double."); +#endif + } +#endif + nerrors += test_conv_flt_1(name, TEST_DENORM, H5T_NATIVE_LDOUBLE, H5T_NATIVE_DOUBLE); #endif @@ -4893,8 +4910,24 @@ run_fp_tests(const char *name) #if H5_SIZEOF_LONG_DOUBLE!=H5_SIZEOF_DOUBLE && H5_SIZEOF_LONG_DOUBLE!=0 nerrors += test_conv_flt_1(name, TEST_SPECIAL, H5T_NATIVE_FLOAT, H5T_NATIVE_LDOUBLE); nerrors += test_conv_flt_1(name, TEST_SPECIAL, H5T_NATIVE_DOUBLE, H5T_NATIVE_LDOUBLE); +#ifndef H5_DISABLE_SOME_LDOUBLE_CONV nerrors += test_conv_flt_1(name, TEST_SPECIAL, H5T_NATIVE_LDOUBLE, H5T_NATIVE_FLOAT); nerrors += test_conv_flt_1(name, TEST_SPECIAL, H5T_NATIVE_LDOUBLE, H5T_NATIVE_DOUBLE); +#else + { + char str[256]; /*string */ + + HDsnprintf(str, sizeof(str), "Testing %s special %s -> %s conversions", + name, "long double", "float or double"); + printf("%-70s", str); + SKIPPED(); +#if H5_SIZEOF_LONG_DOUBLE!=0 + HDputs(" Test skipped due to the conversion problem on IBM ppc64le cpu."); +#else + HDputs(" Test skipped due to disabled long double."); +#endif + } +#endif #endif done: @@ -4963,7 +4996,7 @@ run_int_fp_conv(const char *name) nerrors += test_conv_int_fp(name, TEST_NORMAL, H5T_NATIVE_INT, H5T_NATIVE_LDOUBLE); nerrors += test_conv_int_fp(name, TEST_NORMAL, H5T_NATIVE_UINT, H5T_NATIVE_LDOUBLE); #if H5_SIZEOF_LONG!=H5_SIZEOF_INT -#ifndef H5_LONG_TO_LDOUBLE_SPECIAL +#if !defined(H5_LONG_TO_LDOUBLE_SPECIAL) && !defined(H5_DISABLE_SOME_LDOUBLE_CONV) nerrors += test_conv_int_fp(name, TEST_NORMAL, H5T_NATIVE_LONG, H5T_NATIVE_LDOUBLE); nerrors += test_conv_int_fp(name, TEST_NORMAL, H5T_NATIVE_ULONG, H5T_NATIVE_LDOUBLE); #else @@ -5077,16 +5110,46 @@ run_fp_int_conv(const char *name) #endif #if H5_SIZEOF_LONG_DOUBLE!=H5_SIZEOF_DOUBLE - nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_LDOUBLE, H5T_NATIVE_SCHAR); - nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_LDOUBLE, H5T_NATIVE_UCHAR); - nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_LDOUBLE, H5T_NATIVE_SHORT); - nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_LDOUBLE, H5T_NATIVE_USHORT); - nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_LDOUBLE, H5T_NATIVE_INT); - nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_LDOUBLE, H5T_NATIVE_UINT); + if(test_values != TEST_SPECIAL) { + nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_LDOUBLE, H5T_NATIVE_SCHAR); + nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_LDOUBLE, H5T_NATIVE_UCHAR); + nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_LDOUBLE, H5T_NATIVE_SHORT); + nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_LDOUBLE, H5T_NATIVE_USHORT); + nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_LDOUBLE, H5T_NATIVE_INT); + nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_LDOUBLE, H5T_NATIVE_UINT); + } else { +#ifndef H5_DISABLE_SOME_LDOUBLE_CONV + nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_LDOUBLE, H5T_NATIVE_SCHAR); + nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_LDOUBLE, H5T_NATIVE_UCHAR); + nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_LDOUBLE, H5T_NATIVE_SHORT); + nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_LDOUBLE, H5T_NATIVE_USHORT); + nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_LDOUBLE, H5T_NATIVE_INT); + nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_LDOUBLE, H5T_NATIVE_UINT); +#else + char str[256]; /*string */ + + HDsnprintf(str, sizeof(str), "Testing %s special %s -> %s conversions", + name, "long double", "signed and unsigned char, short, int, long"); + printf("%-70s", str); + SKIPPED(); +#if H5_SIZEOF_LONG_DOUBLE!=0 + HDputs(" Test skipped due to the conversion problem on IBM ppc64le cpu."); +#else + HDputs(" Test skipped due to disabled long double."); +#endif +#endif + } #if H5_SIZEOF_LONG!=H5_SIZEOF_INT && H5_SIZEOF_LONG_DOUBLE!=0 #ifndef H5_LDOUBLE_TO_LONG_SPECIAL - nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_LDOUBLE, H5T_NATIVE_LONG); - nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_LDOUBLE, H5T_NATIVE_ULONG); + if(test_values != TEST_SPECIAL && test_values != TEST_NORMAL) { + nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_LDOUBLE, H5T_NATIVE_LONG); + nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_LDOUBLE, H5T_NATIVE_ULONG); + } else { +#ifndef H5_DISABLE_SOME_LDOUBLE_CONV + nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_LDOUBLE, H5T_NATIVE_LONG); + nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_LDOUBLE, H5T_NATIVE_ULONG); +#endif + } #else { char str[256]; /*string */ -- cgit v0.12 From 68ec03a09812982a44e8bf6b29f98d84568700c7 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Fri, 18 Jan 2019 21:50:01 -0600 Subject: Add parallel runtest for examples --- MANIFEST | 1 + config/cmake_ext_mod/parrunTest.cmake | 325 ++++++++++++++++++++++++++++++++++ examples/CMakeTests.cmake | 10 +- 3 files changed, 332 insertions(+), 4 deletions(-) create mode 100644 config/cmake_ext_mod/parrunTest.cmake diff --git a/MANIFEST b/MANIFEST index d240527..2837136 100644 --- a/MANIFEST +++ b/MANIFEST @@ -3211,6 +3211,7 @@ ./config/cmake_ext_mod/NSIS.InstallOptions.ini.in ./config/cmake_ext_mod/NSIS.template.in ./config/cmake_ext_mod/runTest.cmake +./config/cmake_ext_mod/parrunTest.cmake ./config/cmake_ext_mod/version.plist.in # CMake-specific User Files diff --git a/config/cmake_ext_mod/parrunTest.cmake b/config/cmake_ext_mod/parrunTest.cmake new file mode 100644 index 0000000..8449448 --- /dev/null +++ b/config/cmake_ext_mod/parrunTest.cmake @@ -0,0 +1,325 @@ +# +# Copyright by The HDF Group. +# All rights reserved. +# +# This file is part of HDF5. The full HDF5 copyright notice, including +# terms governing use, modification, and redistribution, is contained in +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. +# +# parrunTest.cmake executes a command using MPI and captures the output in a file. File is then compared +# against a reference file. Exit status of command can also be compared. +cmake_policy(SET CMP0007 NEW) + +# arguments checking +if (NOT TEST_PROGRAM) + message (FATAL_ERROR "Require TEST_PROGRAM to be defined") +endif () +if (NOT TEST_FOLDER) + message ( FATAL_ERROR "Require TEST_FOLDER to be defined") +endif () +if (NOT TEST_OUTPUT) + message (FATAL_ERROR "Require TEST_OUTPUT to be defined") +endif () +if (NOT TEST_EXPECT) + message (STATUS "Require TEST_EXPECT to be defined") +endif () + +if (EXISTS ${TEST_FOLDER}/${TEST_OUTPUT}) + file (REMOVE ${TEST_FOLDER}/${TEST_OUTPUT}) +endif () + +if (EXISTS ${TEST_FOLDER}/${TEST_OUTPUT}.err) + file (REMOVE ${TEST_FOLDER}/${TEST_OUTPUT}.err) +endif () + +message (STATUS "COMMAND: ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_PREFLAGS} ${TEST_PROGRAM} ${MPIEXEC_POSTFLAGS} ${TEST_ARGS}") + +if (TEST_LIBRARY_DIRECTORY) + if (WIN32 AND NOT MINGW) + set (ENV{PATH} "$ENV{PATH};${TEST_LIBRARY_DIRECTORY}") + else () + set (ENV{LD_LIBRARY_PATH} "$ENV{LD_LIBRARY_PATH}:${TEST_LIBRARY_DIRECTORY}") + endif () +endif () + +if (TEST_ENV_VAR) + set (ENV{${TEST_ENV_VAR}} "${TEST_ENV_VALUE}") + #message (STATUS "ENV:${TEST_ENV_VAR}=$ENV{${TEST_ENV_VAR}}") +endif () + +if (NOT TEST_INPUT) + # run the test program, capture the stdout/stderr and the result var + execute_process ( + COMMAND ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_PREFLAGS} ${TEST_PROGRAM} ${MPIEXEC_POSTFLAGS} ${TEST_ARGS} + WORKING_DIRECTORY ${TEST_FOLDER} + RESULT_VARIABLE TEST_RESULT + OUTPUT_FILE ${TEST_OUTPUT} + ERROR_FILE ${TEST_OUTPUT}.err + OUTPUT_VARIABLE TEST_OUT + ERROR_VARIABLE TEST_ERROR + ) +else () + # run the test program with stdin, capture the stdout/stderr and the result var + execute_process ( + COMMAND ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_PREFLAGS} ${TEST_PROGRAM} ${MPIEXEC_POSTFLAGS} ${TEST_ARGS} + WORKING_DIRECTORY ${TEST_FOLDER} + RESULT_VARIABLE TEST_RESULT + INPUT_FILE ${TEST_INPUT} + OUTPUT_FILE ${TEST_OUTPUT} + ERROR_FILE ${TEST_OUTPUT}.err + OUTPUT_VARIABLE TEST_OUT + ERROR_VARIABLE TEST_ERROR + ) +endif () + +if (TEST_REGEX) + # TEST_REGEX should always be matched + file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) + string (REGEX MATCH "${TEST_REGEX}" REGEX_MATCH ${TEST_STREAM}) + string (COMPARE EQUAL "${REGEX_MATCH}" "${TEST_MATCH}" REGEX_RESULT) + if (NOT REGEX_RESULT) + message (STATUS "Failed: The output of ${TEST_PROGRAM} did not contain ${TEST_MATCH}") + endif () +endif () + +message (STATUS "COMMAND Result: ${TEST_RESULT}") + +# if the .err file exists and ERRROR_APPEND is enabled +if (EXISTS ${TEST_FOLDER}/${TEST_OUTPUT}.err) + file (READ ${TEST_FOLDER}/${TEST_OUTPUT}.err TEST_STREAM) + if (TEST_MASK_FILE) + STRING(REGEX REPLACE "CurrentDir is [^\n]+\n" "CurrentDir is (dir name)\n" TEST_STREAM "${TEST_STREAM}") + endif () + # remove special output + string (REGEX REPLACE "^.*_pmi_alps[^\n]+\n" "" TEST_STREAM "${TEST_STREAM}") + + if (NOT ERROR_APPEND) + # write back to original .err file + file (WRITE ${TEST_FOLDER}/${TEST_OUTPUT}.err "${TEST_STREAM}") + else () + # append error output to the stdout output file + file (APPEND ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}") + endif () +endif () + +# append the test result status with a predefined text +if (TEST_APPEND) + file (APPEND ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_APPEND} ${TEST_RESULT}\n") +endif () + +# if the return value is !=${TEST_EXPECT} bail out +if (NOT TEST_RESULT EQUAL TEST_EXPECT) + if (NOT TEST_NOERRDISPLAY) + if (EXISTS ${TEST_FOLDER}/${TEST_OUTPUT}) + file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) + message (STATUS "Output :\n${TEST_STREAM}") + endif () + endif () + message (FATAL_ERROR "Failed: Test program ${TEST_PROGRAM} exited != ${TEST_EXPECT}.\n${TEST_ERROR}") +endif () + +message (STATUS "COMMAND Error: ${TEST_ERROR}") + +# remove special output +file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) +string (FIND TEST_STREAM "_pmi_alps" "${TEST_FIND_RESULT}") +if (TEST_FIND_RESULT GREATER 0) + string (REGEX REPLACE "^.*_pmi_alps[^\n]+\n" "" TEST_STREAM "${TEST_STREAM}") + file (WRITE ${TEST_FOLDER}/${TEST_OUTPUT} ${TEST_STREAM}) +endif () + +# if the output file needs Storage text removed +if (TEST_MASK) + file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) + string (REGEX REPLACE "Storage:[^\n]+\n" "Storage:
\n" TEST_STREAM "${TEST_STREAM}") + file (WRITE ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}") +endif () + +# if the output file needs Modified text removed +if (TEST_MASK_MOD) + file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) + string (REGEX REPLACE "Modified:[^\n]+\n" "Modified: XXXX-XX-XX XX:XX:XX XXX\n" TEST_STREAM "${TEST_STREAM}") + file (WRITE ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}") +endif () + +# if the output file or the .err file needs to mask out error stack info +if (TEST_MASK_ERROR) + if (NOT TEST_ERRREF) + # the error stack has been appended to the output file + file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) + else () + # the error stack remains in the .err file + file (READ ${TEST_FOLDER}/${TEST_OUTPUT}.err TEST_STREAM) + endif () + string (REGEX REPLACE "thread [0-9]*:" "thread (IDs):" TEST_STREAM "${TEST_STREAM}") + string (REGEX REPLACE ": ([^\n]*)[.]c " ": (file name) " TEST_STREAM "${TEST_STREAM}") + string (REGEX REPLACE " line [0-9]*" " line (number)" TEST_STREAM "${TEST_STREAM}") + string (REGEX REPLACE "v[1-9]*[.][0-9]*[.]" "version (number)." TEST_STREAM "${TEST_STREAM}") + string (REGEX REPLACE "[1-9]*[.][0-9]*[.][0-9]*[^)]*" "version (number)" TEST_STREAM "${TEST_STREAM}") + string (REGEX REPLACE "H5Eget_auto[1-2]*" "H5Eget_auto(1 or 2)" TEST_STREAM "${TEST_STREAM}") + string (REGEX REPLACE "H5Eset_auto[1-2]*" "H5Eset_auto(1 or 2)" TEST_STREAM "${TEST_STREAM}") + # write back the changes to the original files + if (NOT TEST_ERRREF) + file (WRITE ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}") + else () + file (WRITE ${TEST_FOLDER}/${TEST_OUTPUT}.err "${TEST_STREAM}") + endif () +endif () + +# remove text from the output file +if (TEST_FILTER) + file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) + string (REGEX REPLACE "${TEST_FILTER}" "${TEST_FILTER_REPLACE}" TEST_STREAM "${TEST_STREAM}") + file (WRITE ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}") +endif () + +if (TEST_REF_FILTER) + #message (STATUS "TEST_REF_FILTER: ${TEST_APPEND}${TEST_REF_FILTER}") + file (READ ${TEST_FOLDER}/${TEST_REFERENCE} TEST_STREAM) + STRING(REGEX REPLACE "${TEST_REF_APPEND}" "${TEST_REF_FILTER}" TEST_STREAM "${TEST_STREAM}") + file (WRITE ${TEST_FOLDER}/${TEST_REFERENCE} "${TEST_STREAM}") +endif () + +# compare output files to references unless this must be skipped +if (NOT TEST_SKIP_COMPARE) + if (EXISTS ${TEST_FOLDER}/${TEST_REFERENCE}) + if (WIN32 AND NOT MINGW) + file (READ ${TEST_FOLDER}/${TEST_REFERENCE} TEST_STREAM) + file (WRITE ${TEST_FOLDER}/${TEST_REFERENCE} "${TEST_STREAM}") + endif () + + if (NOT TEST_SORT_COMPARE) + # now compare the output with the reference + execute_process ( + COMMAND ${CMAKE_COMMAND} -E compare_files ${TEST_FOLDER}/${TEST_OUTPUT} ${TEST_FOLDER}/${TEST_REFERENCE} + RESULT_VARIABLE TEST_RESULT + ) + else () + file (STRINGS ${TEST_FOLDER}/${TEST_OUTPUT} v1) + file (STRINGS ${TEST_FOLDER}/${TEST_REFERENCE} v2) + list (SORT v1) + list (SORT v2) + if (NOT v1 STREQUAL v2) + set(TEST_RESULT 1) + endif () + endif () + + if (TEST_RESULT) + set (TEST_RESULT 0) + file (STRINGS ${TEST_FOLDER}/${TEST_OUTPUT} test_act) + list (LENGTH test_act len_act) + file (STRINGS ${TEST_FOLDER}/${TEST_REFERENCE} test_ref) + list (LENGTH test_ref len_ref) + if (len_act GREATER 0 AND len_ref GREATER 0) + math (EXPR _FP_LEN "${len_ref} - 1") + foreach (line RANGE 0 ${_FP_LEN}) + list (GET test_act ${line} str_act) + list (GET test_ref ${line} str_ref) + if (NOT ${str_act} STREQUAL ${str_ref}) + if (NOT str_act STREQUAL "") + set (TEST_RESULT 1) + message ("line = ${line}\n***ACTUAL: ${str_act}\n****REFER: ${str_ref}\n") + endif () + endif () + endforeach () + else () + if (len_act EQUAL 0) + message (STATUS "COMPARE Failed: ${TEST_FOLDER}/${TEST_OUTPUT} is empty") + endif () + if (len_ref EQUAL 0) + message (STATUS "COMPARE Failed: ${TEST_FOLDER}/${TEST_REFERENCE} is empty") + endif () + endif () + if (NOT len_act EQUAL len_ref) + set (TEST_RESULT 1) + endif () + endif () + + message (STATUS "COMPARE Result: ${TEST_RESULT}") + + # again, if return value is !=0 scream and shout + if (TEST_RESULT) + message (FATAL_ERROR "Failed: The output of ${TEST_OUTPUT} did not match ${TEST_REFERENCE}") + endif () + endif () + + # now compare the .err file with the error reference, if supplied + if (TEST_ERRREF) + if (WIN32 AND NOT MINGW) + file (READ ${TEST_FOLDER}/${TEST_ERRREF} TEST_STREAM) + file (WRITE ${TEST_FOLDER}/${TEST_ERRREF} "${TEST_STREAM}") + endif () + + # now compare the error output with the error reference + execute_process ( + COMMAND ${CMAKE_COMMAND} -E compare_files ${TEST_FOLDER}/${TEST_OUTPUT}.err ${TEST_FOLDER}/${TEST_ERRREF} + RESULT_VARIABLE TEST_RESULT + ) + if (TEST_RESULT) + set (TEST_RESULT 0) + file (STRINGS ${TEST_FOLDER}/${TEST_OUTPUT}.err test_act) + list (LENGTH test_act len_act) + file (STRINGS ${TEST_FOLDER}/${TEST_ERRREF} test_ref) + list (LENGTH test_ref len_ref) + math (EXPR _FP_LEN "${len_ref} - 1") + if (len_act GREATER 0 AND len_ref GREATER 0) + math (EXPR _FP_LEN "${len_ref} - 1") + foreach (line RANGE 0 ${_FP_LEN}) + list (GET test_act ${line} str_act) + list (GET test_ref ${line} str_ref) + if (NOT ${str_act} STREQUAL ${str_ref}) + if (NOT ${str_act} STREQUAL "") + set (TEST_RESULT 1) + message ("line = ${line}\n***ACTUAL: ${str_act}\n****REFER: ${str_ref}\n") + endif () + endif () + endforeach () + else () + if (len_act EQUAL 0) + message (STATUS "COMPARE Failed: ${TEST_FOLDER}/${TEST_OUTPUT}.err is empty") + endif () + if (len_ref EQUAL 0) + message (STATUS "COMPARE Failed: ${TEST_FOLDER}/${TEST_ERRREF} is empty") + endif () + endif () + if (NOT len_act EQUAL len_ref) + set (TEST_RESULT 1) + endif () + endif () + + message (STATUS "COMPARE Result: ${TEST_RESULT}") + + # again, if return value is !=0 scream and shout + if (TEST_RESULT) + message (FATAL_ERROR "Failed: The error output of ${TEST_OUTPUT}.err did not match ${TEST_ERRREF}") + endif () + endif () +endif () + +if (TEST_GREP_COMPARE) + # now grep the output with the reference + file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) + + # TEST_REFERENCE should always be matched + string (REGEX MATCH "${TEST_REFERENCE}" TEST_MATCH ${TEST_STREAM}) + string (COMPARE EQUAL "${TEST_REFERENCE}" "${TEST_MATCH}" TEST_RESULT) + if (NOT TEST_RESULT) + message (FATAL_ERROR "Failed: The output of ${TEST_PROGRAM} did not contain ${TEST_REFERENCE}") + endif () + + string (REGEX MATCH "${TEST_FILTER}" TEST_MATCH ${TEST_STREAM}) + if (TEST_EXPECT) + # TEST_EXPECT (1) interperts TEST_FILTER as NOT to match + string (LENGTH "${TEST_MATCH}" TEST_RESULT) + if (TEST_RESULT) + message (FATAL_ERROR "Failed: The output of ${TEST_PROGRAM} did contain ${TEST_FILTER}") + endif () + endif () +endif () + +# everything went fine... +message ("${TEST_PROGRAM} Passed") + diff --git a/examples/CMakeTests.cmake b/examples/CMakeTests.cmake index 6b4504b..26babbb 100644 --- a/examples/CMakeTests.cmake +++ b/examples/CMakeTests.cmake @@ -181,17 +181,18 @@ ### Windows pops up a modal permission dialog on this test if (H5_HAVE_PARALLEL AND NOT WIN32) if (HDF5_ENABLE_USING_MEMCHECKER) - add_test (NAME EXAMPLES_PAR-ph5example COMMAND $) + add_test (NAME EXAMPLES_PAR-ph5example COMMAND ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_PREFLAGS} $ ${MPIEXEC_POSTFLAGS}) else () add_test (NAME EXAMPLES_PAR-ph5example COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$" -D "TEST_ARGS:STRING=" -D "TEST_EXPECT=0" -D "TEST_SKIP_COMPARE=TRUE" + #-D "TEST_SORT_COMPARE=TRUE" -D "TEST_OUTPUT=ph5example.txt" #-D "TEST_REFERENCE=ph5example.out" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" - -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + -P "${HDF_RESOURCES_EXT_DIR}/parrunTest.cmake" ) endif () if (NOT "${last_test}" STREQUAL "") @@ -200,17 +201,18 @@ set (last_test "EXAMPLES_PAR-ph5example") if (BUILD_SHARED_LIBS) if (HDF5_ENABLE_USING_MEMCHECKER) - add_test (NAME EXAMPLES_PAR-shared-ph5example COMMAND $) + add_test (NAME EXAMPLES_PAR-shared-ph5example COMMAND ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_PREFLAGS} $ ${MPIEXEC_POSTFLAGS}) else () add_test (NAME EXAMPLES_PAR-shared-ph5example COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$" -D "TEST_ARGS:STRING=" -D "TEST_EXPECT=0" -D "TEST_SKIP_COMPARE=TRUE" + #-D "TEST_SORT_COMPARE=TRUE" -D "TEST_OUTPUT=ph5example-shared.txt" #-D "TEST_REFERENCE=ph5example-shared.out" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/H5EX-shared" - -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + -P "${HDF_RESOURCES_EXT_DIR}/parrunTest.cmake" ) endif () set_tests_properties (EXAMPLES_PAR-shared-ph5example PROPERTIES WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/H5EX-shared) -- cgit v0.12 From c817bcdf0d345c8dbd2943be44b55db290cfd09f Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Sun, 20 Jan 2019 16:49:06 -0600 Subject: MPI vars need passed in, change to grepTest --- MANIFEST | 1 - config/cmake_ext_mod/parrunTest.cmake | 325 ---------------------------------- config/cmake_ext_mod/runTest.cmake | 2 +- examples/CMakeTests.cmake | 22 ++- 4 files changed, 11 insertions(+), 339 deletions(-) delete mode 100644 config/cmake_ext_mod/parrunTest.cmake diff --git a/MANIFEST b/MANIFEST index 2837136..d240527 100644 --- a/MANIFEST +++ b/MANIFEST @@ -3211,7 +3211,6 @@ ./config/cmake_ext_mod/NSIS.InstallOptions.ini.in ./config/cmake_ext_mod/NSIS.template.in ./config/cmake_ext_mod/runTest.cmake -./config/cmake_ext_mod/parrunTest.cmake ./config/cmake_ext_mod/version.plist.in # CMake-specific User Files diff --git a/config/cmake_ext_mod/parrunTest.cmake b/config/cmake_ext_mod/parrunTest.cmake deleted file mode 100644 index 8449448..0000000 --- a/config/cmake_ext_mod/parrunTest.cmake +++ /dev/null @@ -1,325 +0,0 @@ -# -# Copyright by The HDF Group. -# All rights reserved. -# -# This file is part of HDF5. The full HDF5 copyright notice, including -# terms governing use, modification, and redistribution, is contained in -# the COPYING file, which can be found at the root of the source code -# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. -# If you do not have access to either file, you may request a copy from -# help@hdfgroup.org. -# -# parrunTest.cmake executes a command using MPI and captures the output in a file. File is then compared -# against a reference file. Exit status of command can also be compared. -cmake_policy(SET CMP0007 NEW) - -# arguments checking -if (NOT TEST_PROGRAM) - message (FATAL_ERROR "Require TEST_PROGRAM to be defined") -endif () -if (NOT TEST_FOLDER) - message ( FATAL_ERROR "Require TEST_FOLDER to be defined") -endif () -if (NOT TEST_OUTPUT) - message (FATAL_ERROR "Require TEST_OUTPUT to be defined") -endif () -if (NOT TEST_EXPECT) - message (STATUS "Require TEST_EXPECT to be defined") -endif () - -if (EXISTS ${TEST_FOLDER}/${TEST_OUTPUT}) - file (REMOVE ${TEST_FOLDER}/${TEST_OUTPUT}) -endif () - -if (EXISTS ${TEST_FOLDER}/${TEST_OUTPUT}.err) - file (REMOVE ${TEST_FOLDER}/${TEST_OUTPUT}.err) -endif () - -message (STATUS "COMMAND: ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_PREFLAGS} ${TEST_PROGRAM} ${MPIEXEC_POSTFLAGS} ${TEST_ARGS}") - -if (TEST_LIBRARY_DIRECTORY) - if (WIN32 AND NOT MINGW) - set (ENV{PATH} "$ENV{PATH};${TEST_LIBRARY_DIRECTORY}") - else () - set (ENV{LD_LIBRARY_PATH} "$ENV{LD_LIBRARY_PATH}:${TEST_LIBRARY_DIRECTORY}") - endif () -endif () - -if (TEST_ENV_VAR) - set (ENV{${TEST_ENV_VAR}} "${TEST_ENV_VALUE}") - #message (STATUS "ENV:${TEST_ENV_VAR}=$ENV{${TEST_ENV_VAR}}") -endif () - -if (NOT TEST_INPUT) - # run the test program, capture the stdout/stderr and the result var - execute_process ( - COMMAND ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_PREFLAGS} ${TEST_PROGRAM} ${MPIEXEC_POSTFLAGS} ${TEST_ARGS} - WORKING_DIRECTORY ${TEST_FOLDER} - RESULT_VARIABLE TEST_RESULT - OUTPUT_FILE ${TEST_OUTPUT} - ERROR_FILE ${TEST_OUTPUT}.err - OUTPUT_VARIABLE TEST_OUT - ERROR_VARIABLE TEST_ERROR - ) -else () - # run the test program with stdin, capture the stdout/stderr and the result var - execute_process ( - COMMAND ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_PREFLAGS} ${TEST_PROGRAM} ${MPIEXEC_POSTFLAGS} ${TEST_ARGS} - WORKING_DIRECTORY ${TEST_FOLDER} - RESULT_VARIABLE TEST_RESULT - INPUT_FILE ${TEST_INPUT} - OUTPUT_FILE ${TEST_OUTPUT} - ERROR_FILE ${TEST_OUTPUT}.err - OUTPUT_VARIABLE TEST_OUT - ERROR_VARIABLE TEST_ERROR - ) -endif () - -if (TEST_REGEX) - # TEST_REGEX should always be matched - file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) - string (REGEX MATCH "${TEST_REGEX}" REGEX_MATCH ${TEST_STREAM}) - string (COMPARE EQUAL "${REGEX_MATCH}" "${TEST_MATCH}" REGEX_RESULT) - if (NOT REGEX_RESULT) - message (STATUS "Failed: The output of ${TEST_PROGRAM} did not contain ${TEST_MATCH}") - endif () -endif () - -message (STATUS "COMMAND Result: ${TEST_RESULT}") - -# if the .err file exists and ERRROR_APPEND is enabled -if (EXISTS ${TEST_FOLDER}/${TEST_OUTPUT}.err) - file (READ ${TEST_FOLDER}/${TEST_OUTPUT}.err TEST_STREAM) - if (TEST_MASK_FILE) - STRING(REGEX REPLACE "CurrentDir is [^\n]+\n" "CurrentDir is (dir name)\n" TEST_STREAM "${TEST_STREAM}") - endif () - # remove special output - string (REGEX REPLACE "^.*_pmi_alps[^\n]+\n" "" TEST_STREAM "${TEST_STREAM}") - - if (NOT ERROR_APPEND) - # write back to original .err file - file (WRITE ${TEST_FOLDER}/${TEST_OUTPUT}.err "${TEST_STREAM}") - else () - # append error output to the stdout output file - file (APPEND ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}") - endif () -endif () - -# append the test result status with a predefined text -if (TEST_APPEND) - file (APPEND ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_APPEND} ${TEST_RESULT}\n") -endif () - -# if the return value is !=${TEST_EXPECT} bail out -if (NOT TEST_RESULT EQUAL TEST_EXPECT) - if (NOT TEST_NOERRDISPLAY) - if (EXISTS ${TEST_FOLDER}/${TEST_OUTPUT}) - file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) - message (STATUS "Output :\n${TEST_STREAM}") - endif () - endif () - message (FATAL_ERROR "Failed: Test program ${TEST_PROGRAM} exited != ${TEST_EXPECT}.\n${TEST_ERROR}") -endif () - -message (STATUS "COMMAND Error: ${TEST_ERROR}") - -# remove special output -file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) -string (FIND TEST_STREAM "_pmi_alps" "${TEST_FIND_RESULT}") -if (TEST_FIND_RESULT GREATER 0) - string (REGEX REPLACE "^.*_pmi_alps[^\n]+\n" "" TEST_STREAM "${TEST_STREAM}") - file (WRITE ${TEST_FOLDER}/${TEST_OUTPUT} ${TEST_STREAM}) -endif () - -# if the output file needs Storage text removed -if (TEST_MASK) - file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) - string (REGEX REPLACE "Storage:[^\n]+\n" "Storage:
\n" TEST_STREAM "${TEST_STREAM}") - file (WRITE ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}") -endif () - -# if the output file needs Modified text removed -if (TEST_MASK_MOD) - file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) - string (REGEX REPLACE "Modified:[^\n]+\n" "Modified: XXXX-XX-XX XX:XX:XX XXX\n" TEST_STREAM "${TEST_STREAM}") - file (WRITE ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}") -endif () - -# if the output file or the .err file needs to mask out error stack info -if (TEST_MASK_ERROR) - if (NOT TEST_ERRREF) - # the error stack has been appended to the output file - file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) - else () - # the error stack remains in the .err file - file (READ ${TEST_FOLDER}/${TEST_OUTPUT}.err TEST_STREAM) - endif () - string (REGEX REPLACE "thread [0-9]*:" "thread (IDs):" TEST_STREAM "${TEST_STREAM}") - string (REGEX REPLACE ": ([^\n]*)[.]c " ": (file name) " TEST_STREAM "${TEST_STREAM}") - string (REGEX REPLACE " line [0-9]*" " line (number)" TEST_STREAM "${TEST_STREAM}") - string (REGEX REPLACE "v[1-9]*[.][0-9]*[.]" "version (number)." TEST_STREAM "${TEST_STREAM}") - string (REGEX REPLACE "[1-9]*[.][0-9]*[.][0-9]*[^)]*" "version (number)" TEST_STREAM "${TEST_STREAM}") - string (REGEX REPLACE "H5Eget_auto[1-2]*" "H5Eget_auto(1 or 2)" TEST_STREAM "${TEST_STREAM}") - string (REGEX REPLACE "H5Eset_auto[1-2]*" "H5Eset_auto(1 or 2)" TEST_STREAM "${TEST_STREAM}") - # write back the changes to the original files - if (NOT TEST_ERRREF) - file (WRITE ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}") - else () - file (WRITE ${TEST_FOLDER}/${TEST_OUTPUT}.err "${TEST_STREAM}") - endif () -endif () - -# remove text from the output file -if (TEST_FILTER) - file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) - string (REGEX REPLACE "${TEST_FILTER}" "${TEST_FILTER_REPLACE}" TEST_STREAM "${TEST_STREAM}") - file (WRITE ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}") -endif () - -if (TEST_REF_FILTER) - #message (STATUS "TEST_REF_FILTER: ${TEST_APPEND}${TEST_REF_FILTER}") - file (READ ${TEST_FOLDER}/${TEST_REFERENCE} TEST_STREAM) - STRING(REGEX REPLACE "${TEST_REF_APPEND}" "${TEST_REF_FILTER}" TEST_STREAM "${TEST_STREAM}") - file (WRITE ${TEST_FOLDER}/${TEST_REFERENCE} "${TEST_STREAM}") -endif () - -# compare output files to references unless this must be skipped -if (NOT TEST_SKIP_COMPARE) - if (EXISTS ${TEST_FOLDER}/${TEST_REFERENCE}) - if (WIN32 AND NOT MINGW) - file (READ ${TEST_FOLDER}/${TEST_REFERENCE} TEST_STREAM) - file (WRITE ${TEST_FOLDER}/${TEST_REFERENCE} "${TEST_STREAM}") - endif () - - if (NOT TEST_SORT_COMPARE) - # now compare the output with the reference - execute_process ( - COMMAND ${CMAKE_COMMAND} -E compare_files ${TEST_FOLDER}/${TEST_OUTPUT} ${TEST_FOLDER}/${TEST_REFERENCE} - RESULT_VARIABLE TEST_RESULT - ) - else () - file (STRINGS ${TEST_FOLDER}/${TEST_OUTPUT} v1) - file (STRINGS ${TEST_FOLDER}/${TEST_REFERENCE} v2) - list (SORT v1) - list (SORT v2) - if (NOT v1 STREQUAL v2) - set(TEST_RESULT 1) - endif () - endif () - - if (TEST_RESULT) - set (TEST_RESULT 0) - file (STRINGS ${TEST_FOLDER}/${TEST_OUTPUT} test_act) - list (LENGTH test_act len_act) - file (STRINGS ${TEST_FOLDER}/${TEST_REFERENCE} test_ref) - list (LENGTH test_ref len_ref) - if (len_act GREATER 0 AND len_ref GREATER 0) - math (EXPR _FP_LEN "${len_ref} - 1") - foreach (line RANGE 0 ${_FP_LEN}) - list (GET test_act ${line} str_act) - list (GET test_ref ${line} str_ref) - if (NOT ${str_act} STREQUAL ${str_ref}) - if (NOT str_act STREQUAL "") - set (TEST_RESULT 1) - message ("line = ${line}\n***ACTUAL: ${str_act}\n****REFER: ${str_ref}\n") - endif () - endif () - endforeach () - else () - if (len_act EQUAL 0) - message (STATUS "COMPARE Failed: ${TEST_FOLDER}/${TEST_OUTPUT} is empty") - endif () - if (len_ref EQUAL 0) - message (STATUS "COMPARE Failed: ${TEST_FOLDER}/${TEST_REFERENCE} is empty") - endif () - endif () - if (NOT len_act EQUAL len_ref) - set (TEST_RESULT 1) - endif () - endif () - - message (STATUS "COMPARE Result: ${TEST_RESULT}") - - # again, if return value is !=0 scream and shout - if (TEST_RESULT) - message (FATAL_ERROR "Failed: The output of ${TEST_OUTPUT} did not match ${TEST_REFERENCE}") - endif () - endif () - - # now compare the .err file with the error reference, if supplied - if (TEST_ERRREF) - if (WIN32 AND NOT MINGW) - file (READ ${TEST_FOLDER}/${TEST_ERRREF} TEST_STREAM) - file (WRITE ${TEST_FOLDER}/${TEST_ERRREF} "${TEST_STREAM}") - endif () - - # now compare the error output with the error reference - execute_process ( - COMMAND ${CMAKE_COMMAND} -E compare_files ${TEST_FOLDER}/${TEST_OUTPUT}.err ${TEST_FOLDER}/${TEST_ERRREF} - RESULT_VARIABLE TEST_RESULT - ) - if (TEST_RESULT) - set (TEST_RESULT 0) - file (STRINGS ${TEST_FOLDER}/${TEST_OUTPUT}.err test_act) - list (LENGTH test_act len_act) - file (STRINGS ${TEST_FOLDER}/${TEST_ERRREF} test_ref) - list (LENGTH test_ref len_ref) - math (EXPR _FP_LEN "${len_ref} - 1") - if (len_act GREATER 0 AND len_ref GREATER 0) - math (EXPR _FP_LEN "${len_ref} - 1") - foreach (line RANGE 0 ${_FP_LEN}) - list (GET test_act ${line} str_act) - list (GET test_ref ${line} str_ref) - if (NOT ${str_act} STREQUAL ${str_ref}) - if (NOT ${str_act} STREQUAL "") - set (TEST_RESULT 1) - message ("line = ${line}\n***ACTUAL: ${str_act}\n****REFER: ${str_ref}\n") - endif () - endif () - endforeach () - else () - if (len_act EQUAL 0) - message (STATUS "COMPARE Failed: ${TEST_FOLDER}/${TEST_OUTPUT}.err is empty") - endif () - if (len_ref EQUAL 0) - message (STATUS "COMPARE Failed: ${TEST_FOLDER}/${TEST_ERRREF} is empty") - endif () - endif () - if (NOT len_act EQUAL len_ref) - set (TEST_RESULT 1) - endif () - endif () - - message (STATUS "COMPARE Result: ${TEST_RESULT}") - - # again, if return value is !=0 scream and shout - if (TEST_RESULT) - message (FATAL_ERROR "Failed: The error output of ${TEST_OUTPUT}.err did not match ${TEST_ERRREF}") - endif () - endif () -endif () - -if (TEST_GREP_COMPARE) - # now grep the output with the reference - file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) - - # TEST_REFERENCE should always be matched - string (REGEX MATCH "${TEST_REFERENCE}" TEST_MATCH ${TEST_STREAM}) - string (COMPARE EQUAL "${TEST_REFERENCE}" "${TEST_MATCH}" TEST_RESULT) - if (NOT TEST_RESULT) - message (FATAL_ERROR "Failed: The output of ${TEST_PROGRAM} did not contain ${TEST_REFERENCE}") - endif () - - string (REGEX MATCH "${TEST_FILTER}" TEST_MATCH ${TEST_STREAM}) - if (TEST_EXPECT) - # TEST_EXPECT (1) interperts TEST_FILTER as NOT to match - string (LENGTH "${TEST_MATCH}" TEST_RESULT) - if (TEST_RESULT) - message (FATAL_ERROR "Failed: The output of ${TEST_PROGRAM} did contain ${TEST_FILTER}") - endif () - endif () -endif () - -# everything went fine... -message ("${TEST_PROGRAM} Passed") - diff --git a/config/cmake_ext_mod/runTest.cmake b/config/cmake_ext_mod/runTest.cmake index e11852a..48402a2 100644 --- a/config/cmake_ext_mod/runTest.cmake +++ b/config/cmake_ext_mod/runTest.cmake @@ -312,7 +312,7 @@ if (TEST_GREP_COMPARE) string (REGEX MATCH "${TEST_FILTER}" TEST_MATCH ${TEST_STREAM}) if (TEST_EXPECT) - # TEST_EXPECT (1) interperts TEST_FILTER as NOT to match + # TEST_EXPECT (1) interprets TEST_FILTER as; NOT to match string (LENGTH "${TEST_MATCH}" TEST_RESULT) if (TEST_RESULT) message (FATAL_ERROR "Failed: The output of ${TEST_PROGRAM} did contain ${TEST_FILTER}") diff --git a/examples/CMakeTests.cmake b/examples/CMakeTests.cmake index 26babbb..dd1e03b 100644 --- a/examples/CMakeTests.cmake +++ b/examples/CMakeTests.cmake @@ -184,15 +184,14 @@ add_test (NAME EXAMPLES_PAR-ph5example COMMAND ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_PREFLAGS} $ ${MPIEXEC_POSTFLAGS}) else () add_test (NAME EXAMPLES_PAR-ph5example COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$" + -D "TEST_PROGRAM=${MPIEXEC_EXECUTABLE};${MPIEXEC_NUMPROC_FLAG};${MPIEXEC_MAX_NUMPROCS};${MPIEXEC_PREFLAGS};$;${MPIEXEC_POSTFLAGS}" -D "TEST_ARGS:STRING=" -D "TEST_EXPECT=0" - -D "TEST_SKIP_COMPARE=TRUE" - #-D "TEST_SORT_COMPARE=TRUE" - -D "TEST_OUTPUT=ph5example.txt" - #-D "TEST_REFERENCE=ph5example.out" + -D "TEST_OUTPUT=ph5example.out" + -D "TEST_REFERENCE:STRING=PHDF5 tests finished with no errors" + -D "TEST_FILTER:STRING=PHDF5 tests finished with no errors" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" - -P "${HDF_RESOURCES_EXT_DIR}/parrunTest.cmake" + -P "${HDF_RESOURCES_EXT_DIR}/grepTest.cmake" ) endif () if (NOT "${last_test}" STREQUAL "") @@ -204,15 +203,14 @@ add_test (NAME EXAMPLES_PAR-shared-ph5example COMMAND ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_PREFLAGS} $ ${MPIEXEC_POSTFLAGS}) else () add_test (NAME EXAMPLES_PAR-shared-ph5example COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$" + -D "TEST_PROGRAM=${MPIEXEC_EXECUTABLE};${MPIEXEC_NUMPROC_FLAG};${MPIEXEC_MAX_NUMPROCS};${MPIEXEC_PREFLAGS};$;${MPIEXEC_POSTFLAGS}" -D "TEST_ARGS:STRING=" -D "TEST_EXPECT=0" - -D "TEST_SKIP_COMPARE=TRUE" - #-D "TEST_SORT_COMPARE=TRUE" - -D "TEST_OUTPUT=ph5example-shared.txt" - #-D "TEST_REFERENCE=ph5example-shared.out" + -D "TEST_OUTPUT=ph5example-shared.out" + -D "TEST_REFERENCE:STRING=PHDF5 tests finished with no errors" + -D "TEST_FILTER:STRING=PHDF5 tests finished with no errors" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/H5EX-shared" - -P "${HDF_RESOURCES_EXT_DIR}/parrunTest.cmake" + -P "${HDF_RESOURCES_EXT_DIR}/grepTest.cmake" ) endif () set_tests_properties (EXAMPLES_PAR-shared-ph5example PROPERTIES WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/H5EX-shared) -- cgit v0.12 From b910ec276305ebcfebc4d05921ea0474f421e0f0 Mon Sep 17 00:00:00 2001 From: Jordan Henderson Date: Wed, 5 Dec 2018 15:23:44 -0600 Subject: Updates to t_filters_parallel for missing filters --- testpar/t_filters_parallel.c | 359 ++++++++++++++++++++++++++----------------- 1 file changed, 220 insertions(+), 139 deletions(-) diff --git a/testpar/t_filters_parallel.c b/testpar/t_filters_parallel.c index f436c8f..1f26e0d 100644 --- a/testpar/t_filters_parallel.c +++ b/testpar/t_filters_parallel.c @@ -32,9 +32,28 @@ char filenames[1][256]; int nerrors = 0; size_t cur_filter_idx = 0; +#define GZIP_INDEX 0 +#define FLETCHER32_INDEX 1 #define ARRAY_SIZE(a) sizeof(a) / sizeof(a[0]) +/* + * Used to check if a filter is available before running a test. + */ +#define CHECK_CUR_FILTER_AVAIL() \ +{ \ + htri_t filter_is_avail; \ + \ + if (cur_filter_idx == GZIP_INDEX) { \ + if ((filter_is_avail = H5Zfilter_avail(H5Z_FILTER_DEFLATE)) != TRUE) { \ + if (MAINPROCESS) { \ + HDputs(" - SKIPPED - Deflate filter not available"); \ + } \ + return; \ + } \ + } \ +} + static herr_t set_dcpl_filter(hid_t dcpl); #if MPI_VERSION >= 3 @@ -144,9 +163,9 @@ static herr_t set_dcpl_filter(hid_t dcpl) { switch (cur_filter_idx) { - case 0: + case GZIP_INDEX: return H5Pset_deflate(dcpl, DEFAULT_DEFLATE_LEVEL); - case 1: + case FLETCHER32_INDEX: return H5Pset_fletcher32(dcpl); default: return H5Pset_deflate(dcpl, DEFAULT_DEFLATE_LEVEL); @@ -178,7 +197,9 @@ test_write_one_chunk_filtered_dataset(void) hid_t file_id = -1, dset_id = -1, plist_id = -1; hid_t filespace = -1, memspace = -1; - if (MAINPROCESS) puts("Testing write to one-chunk filtered dataset"); + if (MAINPROCESS) HDputs("Testing write to one-chunk filtered dataset"); + + CHECK_CUR_FILTER_AVAIL(); /* Set up file access property list with parallel I/O access */ plist_id = H5Pcreate(H5P_FILE_ACCESS); @@ -238,9 +259,9 @@ test_write_one_chunk_filtered_dataset(void) start[1] = 0; if (VERBOSE_MED) { - printf("Process %d is writing with count[ %llu, %llu ], stride[ %llu, %llu ], start[ %llu, %llu ], block size[ %llu, %llu ]\n", + HDprintf("Process %d is writing with count[ %llu, %llu ], stride[ %llu, %llu ], start[ %llu, %llu ], block size[ %llu, %llu ]\n", mpi_rank, count[0], count[1], stride[0], stride[1], start[0], start[1], block[0], block[1]); - fflush(stdout); + HDfflush(stdout); } /* Select hyperslab in the file */ @@ -292,7 +313,7 @@ test_write_one_chunk_filtered_dataset(void) VRFY((H5Dread(dset_id, HDF5_DATATYPE_NAME, H5S_ALL, H5S_ALL, plist_id, read_buf) >= 0), "Dataset read succeeded"); - VRFY((0 == memcmp(read_buf, correct_buf, correct_buf_size)), + VRFY((0 == HDmemcmp(read_buf, correct_buf, correct_buf_size)), "Data verification succeeded"); if (correct_buf) HDfree(correct_buf); @@ -333,7 +354,9 @@ test_write_filtered_dataset_no_overlap(void) hid_t file_id = -1, dset_id = -1, plist_id = -1; hid_t filespace = -1, memspace = -1; - if (MAINPROCESS) puts("Testing write to unshared filtered chunks"); + if (MAINPROCESS) HDputs("Testing write to unshared filtered chunks"); + + CHECK_CUR_FILTER_AVAIL(); /* Set up file access property list with parallel I/O access */ plist_id = H5Pcreate(H5P_FILE_ACCESS); @@ -394,9 +417,9 @@ test_write_filtered_dataset_no_overlap(void) start[1] = 0; if (VERBOSE_MED) { - printf("Process %d is writing with count[ %llu, %llu ], stride[ %llu, %llu ], start[ %llu, %llu ], block size[ %llu, %llu ]\n", + HDprintf("Process %d is writing with count[ %llu, %llu ], stride[ %llu, %llu ], start[ %llu, %llu ], block size[ %llu, %llu ]\n", mpi_rank, count[0], count[1], stride[0], stride[1], start[0], start[1], block[0], block[1]); - fflush(stdout); + HDfflush(stdout); } /* Select hyperslab in the file */ @@ -450,7 +473,7 @@ test_write_filtered_dataset_no_overlap(void) VRFY((H5Dread(dset_id, HDF5_DATATYPE_NAME, H5S_ALL, H5S_ALL, plist_id, read_buf) >= 0), "Dataset read succeeded"); - VRFY((0 == memcmp(read_buf, correct_buf, correct_buf_size)), + VRFY((0 == HDmemcmp(read_buf, correct_buf, correct_buf_size)), "Data verification succeeded"); if (correct_buf) HDfree(correct_buf); @@ -492,7 +515,9 @@ test_write_filtered_dataset_overlap(void) hid_t file_id = -1, dset_id = -1, plist_id = -1; hid_t filespace = -1, memspace = -1; - if (MAINPROCESS) puts("Testing write to shared filtered chunks"); + if (MAINPROCESS) HDputs("Testing write to shared filtered chunks"); + + CHECK_CUR_FILTER_AVAIL(); /* Set up file access property list with parallel I/O access */ plist_id = H5Pcreate(H5P_FILE_ACCESS); @@ -553,9 +578,9 @@ test_write_filtered_dataset_overlap(void) start[1] = 0; if (VERBOSE_MED) { - printf("Process %d is writing with count[ %llu, %llu ], stride[ %llu, %llu ], start[ %llu, %llu ], block size[ %llu, %llu ]\n", + HDprintf("Process %d is writing with count[ %llu, %llu ], stride[ %llu, %llu ], start[ %llu, %llu ], block size[ %llu, %llu ]\n", mpi_rank, count[0], count[1], stride[0], stride[1], start[0], start[1], block[0], block[1]); - fflush(stdout); + HDfflush(stdout); } /* Select hyperslab in the file */ @@ -609,7 +634,7 @@ test_write_filtered_dataset_overlap(void) VRFY((H5Dread(dset_id, HDF5_DATATYPE_NAME, H5S_ALL, H5S_ALL, plist_id, read_buf) >= 0), "Dataset read succeeded"); - VRFY((0 == memcmp(read_buf, correct_buf, correct_buf_size)), + VRFY((0 == HDmemcmp(read_buf, correct_buf, correct_buf_size)), "Data verification succeeded"); if (correct_buf) HDfree(correct_buf); @@ -654,7 +679,9 @@ test_write_filtered_dataset_single_no_selection(void) hid_t file_id = -1, dset_id = -1, plist_id = -1; hid_t filespace = -1, memspace = -1; - if (MAINPROCESS) puts("Testing write to filtered chunks with a single process having no selection"); + if (MAINPROCESS) HDputs("Testing write to filtered chunks with a single process having no selection"); + + CHECK_CUR_FILTER_AVAIL(); /* Set up file access property list with parallel I/O access */ plist_id = H5Pcreate(H5P_FILE_ACCESS); @@ -718,9 +745,9 @@ test_write_filtered_dataset_single_no_selection(void) start[1] = 0; if (VERBOSE_MED) { - printf("Process %d is writing with count[ %llu, %llu ], stride[ %llu, %llu ], start[ %llu, %llu ], block size[ %llu, %llu ]\n", + HDprintf("Process %d is writing with count[ %llu, %llu ], stride[ %llu, %llu ], start[ %llu, %llu ], block size[ %llu, %llu ]\n", mpi_rank, count[0], count[1], stride[0], stride[1], start[0], start[1], block[0], block[1]); - fflush(stdout); + HDfflush(stdout); } /* Select hyperslab in the file */ @@ -782,7 +809,7 @@ test_write_filtered_dataset_single_no_selection(void) VRFY((H5Dread(dset_id, HDF5_DATATYPE_NAME, H5S_ALL, H5S_ALL, plist_id, read_buf) >= 0), "Dataset read succeeded"); - VRFY((0 == memcmp(read_buf, correct_buf, correct_buf_size)), + VRFY((0 == HDmemcmp(read_buf, correct_buf, correct_buf_size)), "Data verification succeeded"); if (correct_buf) HDfree(correct_buf); @@ -823,7 +850,9 @@ test_write_filtered_dataset_all_no_selection(void) hid_t file_id = -1, dset_id = -1, plist_id = -1; hid_t filespace = -1, memspace = -1; - if (MAINPROCESS) puts("Testing write to filtered chunks with all processes having no selection"); + if (MAINPROCESS) HDputs("Testing write to filtered chunks with all processes having no selection"); + + CHECK_CUR_FILTER_AVAIL(); /* Set up file access property list with parallel I/O access */ plist_id = H5Pcreate(H5P_FILE_ACCESS); @@ -912,7 +941,7 @@ test_write_filtered_dataset_all_no_selection(void) VRFY((H5Dread(dset_id, HDF5_DATATYPE_NAME, H5S_ALL, H5S_ALL, plist_id, read_buf) >= 0), "Dataset read succeeded"); - VRFY((0 == memcmp(read_buf, correct_buf, correct_buf_size)), + VRFY((0 == HDmemcmp(read_buf, correct_buf, correct_buf_size)), "Data verification succeeded"); if (correct_buf) HDfree(correct_buf); @@ -949,7 +978,9 @@ test_write_filtered_dataset_point_selection(void) hid_t file_id = -1, dset_id = -1, plist_id = -1; hid_t filespace = -1, memspace = -1; - if (MAINPROCESS) puts("Testing write to filtered chunks with point selection"); + if (MAINPROCESS) HDputs("Testing write to filtered chunks with point selection"); + + CHECK_CUR_FILTER_AVAIL(); /* Set up file access property list with parallel I/O access */ plist_id = H5Pcreate(H5P_FILE_ACCESS); @@ -1058,7 +1089,7 @@ test_write_filtered_dataset_point_selection(void) VRFY((H5Dread(dset_id, HDF5_DATATYPE_NAME, H5S_ALL, H5S_ALL, plist_id, read_buf) >= 0), "Dataset read succeeded"); - VRFY((0 == memcmp(read_buf, correct_buf, correct_buf_size)), + VRFY((0 == HDmemcmp(read_buf, correct_buf, correct_buf_size)), "Data verification succeeded"); if (coords) HDfree(coords); @@ -1102,7 +1133,9 @@ test_write_filtered_dataset_interleaved_write(void) hid_t file_id = -1, dset_id = -1, plist_id = -1; hid_t filespace = -1, memspace = -1; - if (MAINPROCESS) puts("Testing interleaved write to filtered chunks"); + if (MAINPROCESS) HDputs("Testing interleaved write to filtered chunks"); + + CHECK_CUR_FILTER_AVAIL(); /* Set up file access property list with parallel I/O access */ plist_id = H5Pcreate(H5P_FILE_ACCESS); @@ -1163,9 +1196,9 @@ test_write_filtered_dataset_interleaved_write(void) start[1] = 0; if (VERBOSE_MED) { - printf("Process %d is writing with count[ %llu, %llu ], stride[ %llu, %llu ], start[ %llu, %llu ], block size[ %llu, %llu ]\n", + HDprintf("Process %d is writing with count[ %llu, %llu ], stride[ %llu, %llu ], start[ %llu, %llu ], block size[ %llu, %llu ]\n", mpi_rank, count[0], count[1], stride[0], stride[1], start[0], start[1], block[0], block[1]); - fflush(stdout); + HDfflush(stdout); } /* Select hyperslab in the file */ @@ -1225,7 +1258,7 @@ test_write_filtered_dataset_interleaved_write(void) VRFY((H5Dread(dset_id, HDF5_DATATYPE_NAME, H5S_ALL, H5S_ALL, plist_id, read_buf) >= 0), "Dataset read succeeded"); - VRFY((0 == memcmp(read_buf, correct_buf, correct_buf_size)), + VRFY((0 == HDmemcmp(read_buf, correct_buf, correct_buf_size)), "Data verification succeeded"); if (correct_buf) HDfree(correct_buf); @@ -1265,7 +1298,9 @@ test_write_3d_filtered_dataset_no_overlap_separate_pages(void) hid_t file_id = -1, dset_id = -1, plist_id = -1; hid_t filespace = -1, memspace = -1; - if (MAINPROCESS) puts("Testing write to unshared filtered chunks on separate pages in 3D dataset"); + if (MAINPROCESS) HDputs("Testing write to unshared filtered chunks on separate pages in 3D dataset"); + + CHECK_CUR_FILTER_AVAIL(); /* Set up file access property list with parallel I/O access */ plist_id = H5Pcreate(H5P_FILE_ACCESS); @@ -1333,9 +1368,9 @@ test_write_3d_filtered_dataset_no_overlap_separate_pages(void) start[2] = (hsize_t) mpi_rank; if (VERBOSE_MED) { - printf("Process %d is writing with count[ %llu, %llu, %llu ], stride[ %llu, %llu, %llu ], start[ %llu, %llu, %llu ], block size[ %llu, %llu, %llu ]\n", + HDprintf("Process %d is writing with count[ %llu, %llu, %llu ], stride[ %llu, %llu, %llu ], start[ %llu, %llu, %llu ], block size[ %llu, %llu, %llu ]\n", mpi_rank, count[0], count[1], count[2], stride[0], stride[1], stride[2], start[0], start[1], start[2], block[0], block[1], block[2]); - fflush(stdout); + HDfflush(stdout); } /* Select hyperslab in the file */ @@ -1385,7 +1420,7 @@ test_write_3d_filtered_dataset_no_overlap_separate_pages(void) VRFY((H5Dread(dset_id, HDF5_DATATYPE_NAME, H5S_ALL, H5S_ALL, plist_id, read_buf) >= 0), "Dataset read succeeded"); - VRFY((0 == memcmp(read_buf, correct_buf, correct_buf_size)), + VRFY((0 == HDmemcmp(read_buf, correct_buf, correct_buf_size)), "Data verification succeeded"); if (correct_buf) HDfree(correct_buf); @@ -1426,7 +1461,9 @@ test_write_3d_filtered_dataset_no_overlap_same_pages(void) hid_t file_id, dset_id, plist_id; hid_t filespace, memspace; - if (MAINPROCESS) puts("Testing write to unshared filtered chunks on the same pages in 3D dataset"); + if (MAINPROCESS) HDputs("Testing write to unshared filtered chunks on the same pages in 3D dataset"); + + CHECK_CUR_FILTER_AVAIL(); /* Set up file access property list with parallel I/O access */ plist_id = H5Pcreate(H5P_FILE_ACCESS); @@ -1494,9 +1531,9 @@ test_write_3d_filtered_dataset_no_overlap_same_pages(void) start[2] = 0; if (VERBOSE_MED) { - printf("Process %d is writing with count[ %llu, %llu, %llu ], stride[ %llu, %llu, %llu ], start[ %llu, %llu, %llu ], block size[ %llu, %llu, %llu ]\n", + HDprintf("Process %d is writing with count[ %llu, %llu, %llu ], stride[ %llu, %llu, %llu ], start[ %llu, %llu, %llu ], block size[ %llu, %llu, %llu ]\n", mpi_rank, count[0], count[1], count[2], stride[0], stride[1], stride[2], start[0], start[1], start[2], block[0], block[1], block[2]); - fflush(stdout); + HDfflush(stdout); } /* Select hyperslab in the file */ @@ -1549,7 +1586,7 @@ test_write_3d_filtered_dataset_no_overlap_same_pages(void) VRFY((H5Dread(dset_id, HDF5_DATATYPE_NAME, H5S_ALL, H5S_ALL, plist_id, read_buf) >= 0), "Dataset read succeeded"); - VRFY((0 == memcmp(read_buf, correct_buf, correct_buf_size)), + VRFY((0 == HDmemcmp(read_buf, correct_buf, correct_buf_size)), "Data verification succeeded"); if (correct_buf) HDfree(correct_buf); @@ -1590,7 +1627,9 @@ test_write_3d_filtered_dataset_overlap(void) hid_t file_id = -1, dset_id = -1, plist_id = -1; hid_t filespace = -1, memspace = -1; - if (MAINPROCESS) puts("Testing write to shared filtered chunks in 3D dataset"); + if (MAINPROCESS) HDputs("Testing write to shared filtered chunks in 3D dataset"); + + CHECK_CUR_FILTER_AVAIL(); /* Set up file access property list with parallel I/O access */ plist_id = H5Pcreate(H5P_FILE_ACCESS); @@ -1658,9 +1697,9 @@ test_write_3d_filtered_dataset_overlap(void) start[2] = 0; if (VERBOSE_MED) { - printf("Process %d is writing with count[ %llu, %llu, %llu ], stride[ %llu, %llu, %llu ], start[ %llu, %llu, %llu ], block size[ %llu, %llu, %llu ]\n", + HDprintf("Process %d is writing with count[ %llu, %llu, %llu ], stride[ %llu, %llu, %llu ], start[ %llu, %llu, %llu ], block size[ %llu, %llu, %llu ]\n", mpi_rank, count[0], count[1], count[2], stride[0], stride[1], stride[2], start[0], start[1], start[2], block[0], block[1], block[2]); - fflush(stdout); + HDfflush(stdout); } /* Select hyperslab in the file */ @@ -1722,7 +1761,7 @@ test_write_3d_filtered_dataset_overlap(void) VRFY((H5Dread(dset_id, HDF5_DATATYPE_NAME, H5S_ALL, H5S_ALL, plist_id, read_buf) >= 0), "Dataset read succeeded"); - VRFY((0 == memcmp(read_buf, correct_buf, correct_buf_size)), + VRFY((0 == HDmemcmp(read_buf, correct_buf, correct_buf_size)), "Data verification succeeded"); if (correct_buf) HDfree(correct_buf); @@ -1762,7 +1801,9 @@ test_write_cmpd_filtered_dataset_no_conversion_unshared(void) hid_t file_id = -1, dset_id = -1, plist_id = -1, memtype = -1; hid_t filespace = -1, memspace = -1; - if (MAINPROCESS) puts("Testing write to unshared filtered chunks in Compound Datatype dataset without Datatype conversion"); + if (MAINPROCESS) HDputs("Testing write to unshared filtered chunks in Compound Datatype dataset without Datatype conversion"); + + CHECK_CUR_FILTER_AVAIL(); /* Set up file access property list with parallel I/O access */ plist_id = H5Pcreate(H5P_FILE_ACCESS); @@ -1834,9 +1875,9 @@ test_write_cmpd_filtered_dataset_no_conversion_unshared(void) start[1] = ((hsize_t) mpi_rank * WRITE_COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_CH_NCOLS); if (VERBOSE_MED) { - printf("Process %d is writing with count[ %llu, %llu ], stride[ %llu, %llu ], start[ %llu, %llu ], block size[ %llu, %llu ]\n", + HDprintf("Process %d is writing with count[ %llu, %llu ], stride[ %llu, %llu ], start[ %llu, %llu ], block size[ %llu, %llu ]\n", mpi_rank, count[0], count[1], stride[0], stride[1], start[0], start[1], block[0], block[1]); - fflush(stdout); + HDfflush(stdout); } /* Select hyperslab in the file */ @@ -1902,7 +1943,7 @@ test_write_cmpd_filtered_dataset_no_conversion_unshared(void) VRFY((H5Dread(dset_id, memtype, H5S_ALL, H5S_ALL, plist_id, read_buf) >= 0), "Dataset read succeeded"); - VRFY((0 == memcmp(read_buf, correct_buf, correct_buf_size)), + VRFY((0 == HDmemcmp(read_buf, correct_buf, correct_buf_size)), "Data verification succeeded"); if (correct_buf) HDfree(correct_buf); @@ -1943,7 +1984,9 @@ test_write_cmpd_filtered_dataset_no_conversion_shared(void) hid_t file_id, dset_id, plist_id, memtype; hid_t filespace, memspace; - if (MAINPROCESS) puts("Testing write to shared filtered chunks in Compound Datatype dataset without Datatype conversion"); + if (MAINPROCESS) HDputs("Testing write to shared filtered chunks in Compound Datatype dataset without Datatype conversion"); + + CHECK_CUR_FILTER_AVAIL(); /* Set up file access property list with parallel I/O access */ plist_id = H5Pcreate(H5P_FILE_ACCESS); @@ -2015,9 +2058,9 @@ test_write_cmpd_filtered_dataset_no_conversion_shared(void) start[1] = 0; if (VERBOSE_MED) { - printf("Process %d is writing with count[ %llu, %llu ], stride[ %llu, %llu ], start[ %llu, %llu ], block size[ %llu, %llu ]\n", + HDprintf("Process %d is writing with count[ %llu, %llu ], stride[ %llu, %llu ], start[ %llu, %llu ], block size[ %llu, %llu ]\n", mpi_rank, count[0], count[1], stride[0], stride[1], start[0], start[1], block[0], block[1]); - fflush(stdout); + HDfflush(stdout); } /* Select hyperslab in the file */ @@ -2086,7 +2129,7 @@ test_write_cmpd_filtered_dataset_no_conversion_shared(void) VRFY((H5Dread(dset_id, memtype, H5S_ALL, H5S_ALL, plist_id, read_buf) >= 0), "Dataset read succeeded"); - VRFY((0 == memcmp(read_buf, correct_buf, correct_buf_size)), + VRFY((0 == HDmemcmp(read_buf, correct_buf, correct_buf_size)), "Data verification succeeded"); if (correct_buf) HDfree(correct_buf); @@ -2132,7 +2175,9 @@ test_write_cmpd_filtered_dataset_type_conversion_unshared(void) hid_t file_id = -1, dset_id = -1, plist_id = -1, filetype = -1, memtype = -1; hid_t filespace = -1, memspace = -1; - if (MAINPROCESS) puts("Testing write to unshared filtered chunks in Compound Datatype dataset with Datatype conversion"); + if (MAINPROCESS) HDputs("Testing write to unshared filtered chunks in Compound Datatype dataset with Datatype conversion"); + + CHECK_CUR_FILTER_AVAIL(); /* Set up file access property list with parallel I/O access */ plist_id = H5Pcreate(H5P_FILE_ACCESS); @@ -2215,9 +2260,9 @@ test_write_cmpd_filtered_dataset_type_conversion_unshared(void) start[1] = ((hsize_t) mpi_rank * WRITE_COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_CH_NCOLS); if (VERBOSE_MED) { - printf("Process %d is writing with count[ %llu, %llu ], stride[ %llu, %llu ], start[ %llu, %llu ], block size[ %llu, %llu ]\n", + HDprintf("Process %d is writing with count[ %llu, %llu ], stride[ %llu, %llu ], start[ %llu, %llu ], block size[ %llu, %llu ]\n", mpi_rank, count[0], count[1], stride[0], stride[1], start[0], start[1], block[0], block[1]); - fflush(stdout); + HDfflush(stdout); } /* Select hyperslab in the file */ @@ -2269,7 +2314,7 @@ test_write_cmpd_filtered_dataset_type_conversion_unshared(void) VRFY((H5Dread(dset_id, memtype, H5S_ALL, H5S_ALL, plist_id, read_buf) >= 0), "Dataset read succeeded"); - VRFY((0 == memcmp(read_buf, correct_buf, correct_buf_size)), + VRFY((0 == HDmemcmp(read_buf, correct_buf, correct_buf_size)), "Data verification succeeded"); if (correct_buf) HDfree(correct_buf); @@ -2316,7 +2361,9 @@ test_write_cmpd_filtered_dataset_type_conversion_shared(void) hid_t file_id, dset_id, plist_id, filetype, memtype; hid_t filespace, memspace; - if (MAINPROCESS) puts("Testing write to shared filtered chunks in Compound Datatype dataset with Datatype conversion"); + if (MAINPROCESS) HDputs("Testing write to shared filtered chunks in Compound Datatype dataset with Datatype conversion"); + + CHECK_CUR_FILTER_AVAIL(); /* Set up file access property list with parallel I/O access */ plist_id = H5Pcreate(H5P_FILE_ACCESS); @@ -2399,9 +2446,9 @@ test_write_cmpd_filtered_dataset_type_conversion_shared(void) start[1] = 0; if (VERBOSE_MED) { - printf("Process %d is writing with count[ %llu, %llu ], stride[ %llu, %llu ], start[ %llu, %llu ], block size[ %llu, %llu ]\n", + HDprintf("Process %d is writing with count[ %llu, %llu ], stride[ %llu, %llu ], start[ %llu, %llu ], block size[ %llu, %llu ]\n", mpi_rank, count[0], count[1], stride[0], stride[1], start[0], start[1], block[0], block[1]); - fflush(stdout); + HDfflush(stdout); } /* Select hyperslab in the file */ @@ -2453,7 +2500,7 @@ test_write_cmpd_filtered_dataset_type_conversion_shared(void) VRFY((H5Dread(dset_id, memtype, H5S_ALL, H5S_ALL, plist_id, read_buf) >= 0), "Dataset read succeeded"); - VRFY((0 == memcmp(read_buf, correct_buf, correct_buf_size)), + VRFY((0 == HDmemcmp(read_buf, correct_buf, correct_buf_size)), "Data verification succeeded"); if (correct_buf) HDfree(correct_buf); @@ -2503,6 +2550,10 @@ test_read_one_chunk_filtered_dataset(void) int *recvcounts = NULL; int *displs = NULL; + if (MAINPROCESS) HDputs("Testing read from one-chunk filtered dataset"); + + CHECK_CUR_FILTER_AVAIL(); + dataset_dims[0] = (hsize_t) READ_ONE_CHUNK_FILTERED_DATASET_NROWS; dataset_dims[1] = (hsize_t) READ_ONE_CHUNK_FILTERED_DATASET_NCOLS; @@ -2517,8 +2568,6 @@ test_read_one_chunk_filtered_dataset(void) + ((C_DATATYPE) i / (READ_ONE_CHUNK_FILTERED_DATASET_CH_NROWS / mpi_size * READ_ONE_CHUNK_FILTERED_DATASET_CH_NCOLS)); if (MAINPROCESS) { - puts("Testing read from one-chunk filtered dataset"); - plist_id = H5Pcreate(H5P_FILE_ACCESS); VRFY((plist_id >= 0), "FAPL creation succeeded"); @@ -2606,9 +2655,9 @@ test_read_one_chunk_filtered_dataset(void) start[1] = 0; if (VERBOSE_MED) { - printf("Process %d is reading with count[ %llu, %llu ], stride[ %llu, %llu ], start[ %llu, %llu ], block size[ %llu, %llu ]\n", + HDprintf("Process %d is reading with count[ %llu, %llu ], stride[ %llu, %llu ], start[ %llu, %llu ], block size[ %llu, %llu ]\n", mpi_rank, count[0], count[1], stride[0], stride[1], start[0], start[1], block[0], block[1]); - fflush(stdout); + HDfflush(stdout); } VRFY((H5Sselect_hyperslab(filespace, H5S_SELECT_SET, start, stride, count, block) >= 0), @@ -2648,7 +2697,7 @@ test_read_one_chunk_filtered_dataset(void) VRFY((MPI_SUCCESS == MPI_Allgatherv(read_buf, (int) flat_dims[0], C_DATATYPE_MPI, global_buf, recvcounts, displs, C_DATATYPE_MPI, comm)), "MPI_Allgatherv succeeded"); - VRFY((0 == memcmp(global_buf, correct_buf, correct_buf_size)), + VRFY((0 == HDmemcmp(global_buf, correct_buf, correct_buf_size)), "Data verification succeeded"); if (displs) HDfree(displs); @@ -2698,6 +2747,10 @@ test_read_filtered_dataset_no_overlap(void) int *recvcounts = NULL; int *displs = NULL; + if (MAINPROCESS) HDputs("Testing read from unshared filtered chunks"); + + CHECK_CUR_FILTER_AVAIL(); + dataset_dims[0] = (hsize_t) READ_UNSHARED_FILTERED_CHUNKS_NROWS; dataset_dims[1] = (hsize_t) READ_UNSHARED_FILTERED_CHUNKS_NCOLS; @@ -2714,8 +2767,6 @@ test_read_filtered_dataset_no_overlap(void) ); if (MAINPROCESS) { - puts("Testing read from unshared filtered chunks"); - plist_id = H5Pcreate(H5P_FILE_ACCESS); VRFY((plist_id >= 0), "FAPL creation succeeded"); @@ -2803,9 +2854,9 @@ test_read_filtered_dataset_no_overlap(void) start[1] = 0; if (VERBOSE_MED) { - printf("Process %d is reading with count[ %llu, %llu ], stride[ %llu, %llu ], start[ %llu, %llu ], block size[ %llu, %llu ]\n", + HDprintf("Process %d is reading with count[ %llu, %llu ], stride[ %llu, %llu ], start[ %llu, %llu ], block size[ %llu, %llu ]\n", mpi_rank, count[0], count[1], stride[0], stride[1], start[0], start[1], block[0], block[1]); - fflush(stdout); + HDfflush(stdout); } VRFY((H5Sselect_hyperslab(filespace, H5S_SELECT_SET, start, stride, count, block) >= 0), @@ -2845,7 +2896,7 @@ test_read_filtered_dataset_no_overlap(void) VRFY((MPI_SUCCESS == MPI_Allgatherv(read_buf, (int) flat_dims[0], C_DATATYPE_MPI, global_buf, recvcounts, displs, C_DATATYPE_MPI, comm)), "MPI_Allgatherv succeeded"); - VRFY((0 == memcmp(global_buf, correct_buf, correct_buf_size)), + VRFY((0 == HDmemcmp(global_buf, correct_buf, correct_buf_size)), "Data verification succeeded"); if (displs) HDfree(displs); @@ -2896,6 +2947,10 @@ test_read_filtered_dataset_overlap(void) int *recvcounts = NULL; int *displs = NULL; + if (MAINPROCESS) HDputs("Testing read from shared filtered chunks"); + + CHECK_CUR_FILTER_AVAIL(); + dataset_dims[0] = (hsize_t) READ_SHARED_FILTERED_CHUNKS_NROWS; dataset_dims[1] = (hsize_t) READ_SHARED_FILTERED_CHUNKS_NCOLS; @@ -2913,8 +2968,6 @@ test_read_filtered_dataset_overlap(void) ); if (MAINPROCESS) { - puts("Testing read from shared filtered chunks"); - plist_id = H5Pcreate(H5P_FILE_ACCESS); VRFY((plist_id >= 0), "FAPL creation succeeded"); @@ -3002,9 +3055,9 @@ test_read_filtered_dataset_overlap(void) start[1] = 0; if (VERBOSE_MED) { - printf("Process %d is reading with count[ %llu, %llu ], stride[ %llu, %llu ], start[ %llu, %llu ], block size[ %llu, %llu ]\n", + HDprintf("Process %d is reading with count[ %llu, %llu ], stride[ %llu, %llu ], start[ %llu, %llu ], block size[ %llu, %llu ]\n", mpi_rank, count[0], count[1], stride[0], stride[1], start[0], start[1], block[0], block[1]); - fflush(stdout); + HDfflush(stdout); } VRFY((H5Sselect_hyperslab(filespace, H5S_SELECT_SET, start, stride, count, block) >= 0), @@ -3059,7 +3112,7 @@ test_read_filtered_dataset_overlap(void) } } - VRFY((0 == memcmp(global_buf, correct_buf, correct_buf_size)), + VRFY((0 == HDmemcmp(global_buf, correct_buf, correct_buf_size)), "Data verification succeeded"); if (displs) HDfree(displs); @@ -3111,6 +3164,10 @@ test_read_filtered_dataset_single_no_selection(void) int *recvcounts = NULL; int *displs = NULL; + if (MAINPROCESS) HDputs("Testing read from filtered chunks with a single process having no selection"); + + CHECK_CUR_FILTER_AVAIL(); + dataset_dims[0] = (hsize_t) READ_SINGLE_NO_SELECTION_FILTERED_CHUNKS_NROWS; dataset_dims[1] = (hsize_t) READ_SINGLE_NO_SELECTION_FILTERED_CHUNKS_NCOLS; @@ -3133,8 +3190,6 @@ test_read_filtered_dataset_single_no_selection(void) 0, segment_length * sizeof(*correct_buf)); if (MAINPROCESS) { - puts("Testing read from filtered chunks with a single process having no selection"); - plist_id = H5Pcreate(H5P_FILE_ACCESS); VRFY((plist_id >= 0), "FAPL creation succeeded"); @@ -3225,9 +3280,9 @@ test_read_filtered_dataset_single_no_selection(void) start[1] = 0; if (VERBOSE_MED) { - printf("Process %d is reading with count[ %llu, %llu ], stride[ %llu, %llu ], start[ %llu, %llu ], block size[ %llu, %llu ]\n", + HDprintf("Process %d is reading with count[ %llu, %llu ], stride[ %llu, %llu ], start[ %llu, %llu ], block size[ %llu, %llu ]\n", mpi_rank, count[0], count[1], stride[0], stride[1], start[0], start[1], block[0], block[1]); - fflush(stdout); + HDfflush(stdout); } if (mpi_rank == READ_SINGLE_NO_SELECTION_FILTERED_CHUNKS_NO_SELECT_PROC) @@ -3275,7 +3330,7 @@ test_read_filtered_dataset_single_no_selection(void) VRFY((MPI_SUCCESS == MPI_Allgatherv(read_buf, (int) flat_dims[0], C_DATATYPE_MPI, global_buf, recvcounts, displs, C_DATATYPE_MPI, comm)), "MPI_Allgatherv succeeded"); - VRFY((0 == memcmp(global_buf, correct_buf, correct_buf_size)), + VRFY((0 == HDmemcmp(global_buf, correct_buf, correct_buf_size)), "Data verification succeeded"); if (displs) HDfree(displs); @@ -3319,6 +3374,10 @@ test_read_filtered_dataset_all_no_selection(void) hid_t file_id = -1, dset_id = -1, plist_id = -1; hid_t filespace = -1, memspace = -1; + if (MAINPROCESS) HDputs("Testing read from filtered chunks with all processes having no selection"); + + CHECK_CUR_FILTER_AVAIL(); + dataset_dims[0] = (hsize_t) READ_ALL_NO_SELECTION_FILTERED_CHUNKS_NROWS; dataset_dims[1] = (hsize_t) READ_ALL_NO_SELECTION_FILTERED_CHUNKS_NCOLS; @@ -3329,8 +3388,6 @@ test_read_filtered_dataset_all_no_selection(void) VRFY((NULL != correct_buf), "HDcalloc succeeded"); if (MAINPROCESS) { - puts("Testing read from filtered chunks with all processes having no selection"); - plist_id = H5Pcreate(H5P_FILE_ACCESS); VRFY((plist_id >= 0), "FAPL creation succeeded"); @@ -3460,6 +3517,10 @@ test_read_filtered_dataset_point_selection(void) int *recvcounts = NULL; int *displs = NULL; + if (MAINPROCESS) HDputs("Testing read from filtered chunks with point selection"); + + CHECK_CUR_FILTER_AVAIL(); + dataset_dims[0] = (hsize_t) READ_POINT_SELECTION_FILTERED_CHUNKS_NROWS; dataset_dims[1] = (hsize_t) READ_POINT_SELECTION_FILTERED_CHUNKS_NCOLS; @@ -3477,8 +3538,6 @@ test_read_filtered_dataset_point_selection(void) ); if (MAINPROCESS) { - puts("Testing read from filtered chunks with point selection"); - plist_id = H5Pcreate(H5P_FILE_ACCESS); VRFY((plist_id >= 0), "FAPL creation succeeded"); @@ -3615,7 +3674,7 @@ test_read_filtered_dataset_point_selection(void) } } - VRFY((0 == memcmp(global_buf, correct_buf, correct_buf_size)), + VRFY((0 == HDmemcmp(global_buf, correct_buf, correct_buf_size)), "Data verification succeeded"); if (displs) HDfree(displs); @@ -3669,6 +3728,10 @@ test_read_filtered_dataset_interleaved_read(void) int *recvcounts = NULL; int *displs = NULL; + if (MAINPROCESS) HDputs("Testing interleaved read from filtered chunks"); + + CHECK_CUR_FILTER_AVAIL(); + dataset_dims[0] = (hsize_t) INTERLEAVED_READ_FILTERED_DATASET_NROWS; dataset_dims[1] = (hsize_t) INTERLEAVED_READ_FILTERED_DATASET_NCOLS; @@ -3692,8 +3755,6 @@ test_read_filtered_dataset_interleaved_read(void) ); if (MAINPROCESS) { - puts("Testing interleaved read from filtered chunks"); - plist_id = H5Pcreate(H5P_FILE_ACCESS); VRFY((plist_id >= 0), "FAPL creation succeeded"); @@ -3781,9 +3842,9 @@ test_read_filtered_dataset_interleaved_read(void) start[1] = 0; if (VERBOSE_MED) { - printf("Process %d is reading with count[ %llu, %llu ], stride[ %llu, %llu ], start[ %llu, %llu ], block size[ %llu, %llu ]\n", + HDprintf("Process %d is reading with count[ %llu, %llu ], stride[ %llu, %llu ], start[ %llu, %llu ], block size[ %llu, %llu ]\n", mpi_rank, count[0], count[1], stride[0], stride[1], start[0], start[1], block[0], block[1]); - fflush(stdout); + HDfflush(stdout); } VRFY((H5Sselect_hyperslab(filespace, H5S_SELECT_SET, start, stride, count, block) >= 0), @@ -3838,7 +3899,7 @@ test_read_filtered_dataset_interleaved_read(void) } } - VRFY((0 == memcmp(global_buf, correct_buf, correct_buf_size)), + VRFY((0 == HDmemcmp(global_buf, correct_buf, correct_buf_size)), "Data verification succeeded"); if (displs) HDfree(displs); @@ -3889,6 +3950,10 @@ test_read_3d_filtered_dataset_no_overlap_separate_pages(void) hid_t file_id = -1, dset_id = -1, plist_id = -1; hid_t filespace = -1, memspace = -1; + if (MAINPROCESS) HDputs("Testing read from unshared filtered chunks on separate pages in 3D dataset"); + + CHECK_CUR_FILTER_AVAIL(); + dataset_dims[0] = (hsize_t) READ_UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_NROWS; dataset_dims[1] = (hsize_t) READ_UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_NCOLS; dataset_dims[2] = (hsize_t) READ_UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_DEPTH; @@ -3903,8 +3968,6 @@ test_read_3d_filtered_dataset_no_overlap_separate_pages(void) correct_buf[i] = (C_DATATYPE) ((i % (hsize_t) mpi_size) + (i / (hsize_t) mpi_size)); if (MAINPROCESS) { - puts("Testing read from unshared filtered chunks on separate pages in 3D dataset"); - plist_id = H5Pcreate(H5P_FILE_ACCESS); VRFY((plist_id >= 0), "FAPL creation succeeded"); @@ -3998,9 +4061,9 @@ test_read_3d_filtered_dataset_no_overlap_separate_pages(void) start[2] = (hsize_t) mpi_rank; if (VERBOSE_MED) { - printf("Process %d is reading with count[ %llu, %llu ], stride[ %llu, %llu ], start[ %llu, %llu ], block size[ %llu, %llu ]\n", + HDprintf("Process %d is reading with count[ %llu, %llu ], stride[ %llu, %llu ], start[ %llu, %llu ], block size[ %llu, %llu ]\n", mpi_rank, count[0], count[1], stride[0], stride[1], start[0], start[1], block[0], block[1]); - fflush(stdout); + HDfflush(stdout); } VRFY((H5Sselect_hyperslab(filespace, H5S_SELECT_SET, start, stride, count, block) >= 0), @@ -4043,7 +4106,7 @@ test_read_3d_filtered_dataset_no_overlap_separate_pages(void) VRFY((MPI_SUCCESS == MPI_Allgather(read_buf, (int) flat_dims[0], C_DATATYPE_MPI, global_buf, 1, resized_vector_type, comm)), "MPI_Allgather succeeded"); - VRFY((0 == memcmp(global_buf, correct_buf, correct_buf_size)), + VRFY((0 == HDmemcmp(global_buf, correct_buf, correct_buf_size)), "Data verification succeeded"); VRFY((MPI_SUCCESS == MPI_Type_free(&vector_type)), "MPI_Type_free succeeded"); @@ -4096,6 +4159,10 @@ test_read_3d_filtered_dataset_no_overlap_same_pages(void) int *recvcounts = NULL; int *displs = NULL; + if (MAINPROCESS) HDputs("Testing read from unshared filtered chunks on the same pages in 3D dataset"); + + CHECK_CUR_FILTER_AVAIL(); + dataset_dims[0] = (hsize_t) READ_UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_NROWS; dataset_dims[1] = (hsize_t) READ_UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_NCOLS; dataset_dims[2] = (hsize_t) READ_UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_DEPTH; @@ -4113,8 +4180,6 @@ test_read_3d_filtered_dataset_no_overlap_same_pages(void) ); if (MAINPROCESS) { - puts("Testing read from unshared filtered chunks on the same pages in 3D dataset"); - plist_id = H5Pcreate(H5P_FILE_ACCESS); VRFY((plist_id >= 0), "FAPL creation succeeded"); @@ -4208,9 +4273,9 @@ test_read_3d_filtered_dataset_no_overlap_same_pages(void) start[2] = 0; if (VERBOSE_MED) { - printf("Process %d is reading with count[ %llu, %llu ], stride[ %llu, %llu ], start[ %llu, %llu ], block size[ %llu, %llu ]\n", + HDprintf("Process %d is reading with count[ %llu, %llu ], stride[ %llu, %llu ], start[ %llu, %llu ], block size[ %llu, %llu ]\n", mpi_rank, count[0], count[1], stride[0], stride[1], start[0], start[1], block[0], block[1]); - fflush(stdout); + HDfflush(stdout); } VRFY((H5Sselect_hyperslab(filespace, H5S_SELECT_SET, start, stride, count, block) >= 0), @@ -4250,7 +4315,7 @@ test_read_3d_filtered_dataset_no_overlap_same_pages(void) VRFY((MPI_SUCCESS == MPI_Allgatherv(read_buf, (int) flat_dims[0], C_DATATYPE_MPI, global_buf, recvcounts, displs, C_DATATYPE_MPI, comm)), "MPI_Allgatherv succeeded"); - VRFY((0 == memcmp(global_buf, correct_buf, correct_buf_size)), + VRFY((0 == HDmemcmp(global_buf, correct_buf, correct_buf_size)), "Data verification succeeded"); if (displs) HDfree(displs); @@ -4302,6 +4367,10 @@ test_read_3d_filtered_dataset_overlap(void) hid_t file_id = -1, dset_id = -1, plist_id = -1; hid_t filespace = -1, memspace = -1; + if (MAINPROCESS) HDputs("Testing read from shared filtered chunks in 3D dataset"); + + CHECK_CUR_FILTER_AVAIL(); + dataset_dims[0] = (hsize_t) READ_SHARED_FILTERED_CHUNKS_3D_NROWS; dataset_dims[1] = (hsize_t) READ_SHARED_FILTERED_CHUNKS_3D_NCOLS; dataset_dims[2] = (hsize_t) READ_SHARED_FILTERED_CHUNKS_3D_DEPTH; @@ -4328,8 +4397,6 @@ test_read_3d_filtered_dataset_overlap(void) ); if (MAINPROCESS) { - puts("Testing read from shared filtered chunks in 3D dataset"); - plist_id = H5Pcreate(H5P_FILE_ACCESS); VRFY((plist_id >= 0), "FAPL creation succeeded"); @@ -4423,9 +4490,9 @@ test_read_3d_filtered_dataset_overlap(void) start[2] = 0; if (VERBOSE_MED) { - printf("Process %d is reading with count[ %llu, %llu ], stride[ %llu, %llu ], start[ %llu, %llu ], block size[ %llu, %llu ]\n", + HDprintf("Process %d is reading with count[ %llu, %llu ], stride[ %llu, %llu ], start[ %llu, %llu ], block size[ %llu, %llu ]\n", mpi_rank, count[0], count[1], stride[0], stride[1], start[0], start[1], block[0], block[1]); - fflush(stdout); + HDfflush(stdout); } VRFY((H5Sselect_hyperslab(filespace, H5S_SELECT_SET, start, stride, count, block) >= 0), @@ -4473,7 +4540,7 @@ test_read_3d_filtered_dataset_overlap(void) VRFY((MPI_SUCCESS == MPI_Allgather(read_buf, (int) flat_dims[0], C_DATATYPE_MPI, global_buf, 1, resized_vector_type, comm)), "MPI_Allgatherv succeeded"); - VRFY((0 == memcmp(global_buf, correct_buf, correct_buf_size)), + VRFY((0 == HDmemcmp(global_buf, correct_buf, correct_buf_size)), "Data verification succeeded"); VRFY((MPI_SUCCESS == MPI_Type_free(&vector_type)), "MPI_Type_free succeeded"); @@ -4525,6 +4592,10 @@ test_read_cmpd_filtered_dataset_no_conversion_unshared(void) int *recvcounts = NULL; int *displs = NULL; + if (MAINPROCESS) HDputs("Testing read from unshared filtered chunks in Compound Datatype dataset without Datatype conversion"); + + CHECK_CUR_FILTER_AVAIL(); + dataset_dims[0] = (hsize_t) READ_COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_NROWS; dataset_dims[1] = (hsize_t) READ_COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_NCOLS; @@ -4563,8 +4634,6 @@ test_read_cmpd_filtered_dataset_no_conversion_unshared(void) "Datatype insertion succeeded"); if (MAINPROCESS) { - puts("Testing read from unshared filtered chunks in Compound Datatype dataset without Datatype conversion"); - plist_id = H5Pcreate(H5P_FILE_ACCESS); VRFY((plist_id >= 0), "FAPL creation succeeded"); @@ -4652,9 +4721,9 @@ test_read_cmpd_filtered_dataset_no_conversion_unshared(void) start[1] = ((hsize_t) mpi_rank * READ_COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_CH_NCOLS); if (VERBOSE_MED) { - printf("Process %d is reading with count[ %llu, %llu ], stride[ %llu, %llu ], start[ %llu, %llu ], block size[ %llu, %llu ]\n", + HDprintf("Process %d is reading with count[ %llu, %llu ], stride[ %llu, %llu ], start[ %llu, %llu ], block size[ %llu, %llu ]\n", mpi_rank, count[0], count[1], stride[0], stride[1], start[0], start[1], block[0], block[1]); - fflush(stdout); + HDfflush(stdout); } VRFY((H5Sselect_hyperslab(filespace, H5S_SELECT_SET, start, stride, count, block) >= 0), @@ -4694,7 +4763,7 @@ test_read_cmpd_filtered_dataset_no_conversion_unshared(void) VRFY((MPI_SUCCESS == MPI_Allgatherv(read_buf, (int) (flat_dims[0] * sizeof(COMPOUND_C_DATATYPE)), MPI_BYTE, global_buf, recvcounts, displs, MPI_BYTE, comm)), "MPI_Allgatherv succeeded"); - VRFY((0 == memcmp(global_buf, correct_buf, correct_buf_size)), + VRFY((0 == HDmemcmp(global_buf, correct_buf, correct_buf_size)), "Data verification succeeded"); if (displs) HDfree(displs); @@ -4746,6 +4815,10 @@ test_read_cmpd_filtered_dataset_no_conversion_shared(void) int *recvcounts = NULL; int *displs = NULL; + if (MAINPROCESS) HDputs("Testing read from shared filtered chunks in Compound Datatype dataset without Datatype conversion"); + + CHECK_CUR_FILTER_AVAIL(); + dataset_dims[0] = (hsize_t) READ_COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_NROWS; dataset_dims[1] = (hsize_t) READ_COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_NCOLS; @@ -4787,8 +4860,6 @@ test_read_cmpd_filtered_dataset_no_conversion_shared(void) "Datatype insertion succeeded"); if (MAINPROCESS) { - puts("Testing read from shared filtered chunks in Compound Datatype dataset without Datatype conversion"); - plist_id = H5Pcreate(H5P_FILE_ACCESS); VRFY((plist_id >= 0), "FAPL creation succeeded"); @@ -4876,9 +4947,9 @@ test_read_cmpd_filtered_dataset_no_conversion_shared(void) start[1] = 0; if (VERBOSE_MED) { - printf("Process %d is reading with count[ %llu, %llu ], stride[ %llu, %llu ], start[ %llu, %llu ], block size[ %llu, %llu ]\n", + HDprintf("Process %d is reading with count[ %llu, %llu ], stride[ %llu, %llu ], start[ %llu, %llu ], block size[ %llu, %llu ]\n", mpi_rank, count[0], count[1], stride[0], stride[1], start[0], start[1], block[0], block[1]); - fflush(stdout); + HDfflush(stdout); } VRFY((H5Sselect_hyperslab(filespace, H5S_SELECT_SET, start, stride, count, block) >= 0), @@ -4918,7 +4989,7 @@ test_read_cmpd_filtered_dataset_no_conversion_shared(void) VRFY((MPI_SUCCESS == MPI_Allgatherv(read_buf, (int) (flat_dims[0] * sizeof(COMPOUND_C_DATATYPE)), MPI_BYTE, global_buf, recvcounts, displs, MPI_BYTE, comm)), "MPI_Allgatherv succeeded"); - VRFY((0 == memcmp(global_buf, correct_buf, correct_buf_size)), + VRFY((0 == HDmemcmp(global_buf, correct_buf, correct_buf_size)), "Data verification succeeded"); if (displs) HDfree(displs); @@ -4970,6 +5041,10 @@ test_read_cmpd_filtered_dataset_type_conversion_unshared(void) int *recvcounts = NULL; int *displs = NULL; + if (MAINPROCESS) HDputs("Testing read from unshared filtered chunks in Compound Datatype dataset with Datatype conversion"); + + CHECK_CUR_FILTER_AVAIL(); + dataset_dims[0] = (hsize_t) READ_COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_NROWS; dataset_dims[1] = (hsize_t) READ_COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_NCOLS; @@ -5019,8 +5094,6 @@ test_read_cmpd_filtered_dataset_type_conversion_unshared(void) "Datatype insertion succeeded"); if (MAINPROCESS) { - puts("Testing read from unshared filtered chunks in Compound Datatype dataset with Datatype conversion"); - plist_id = H5Pcreate(H5P_FILE_ACCESS); VRFY((plist_id >= 0), "FAPL creation succeeded"); @@ -5108,9 +5181,9 @@ test_read_cmpd_filtered_dataset_type_conversion_unshared(void) start[1] = ((hsize_t) mpi_rank * READ_COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_CH_NCOLS); if (VERBOSE_MED) { - printf("Process %d is reading with count[ %llu, %llu ], stride[ %llu, %llu ], start[ %llu, %llu ], block size[ %llu, %llu ]\n", + HDprintf("Process %d is reading with count[ %llu, %llu ], stride[ %llu, %llu ], start[ %llu, %llu ], block size[ %llu, %llu ]\n", mpi_rank, count[0], count[1], stride[0], stride[1], start[0], start[1], block[0], block[1]); - fflush(stdout); + HDfflush(stdout); } VRFY((H5Sselect_hyperslab(filespace, H5S_SELECT_SET, start, stride, count, block) >= 0), @@ -5150,7 +5223,7 @@ test_read_cmpd_filtered_dataset_type_conversion_unshared(void) VRFY((MPI_SUCCESS == MPI_Allgatherv(read_buf, (int) (flat_dims[0] * sizeof(COMPOUND_C_DATATYPE)), MPI_BYTE, global_buf, recvcounts, displs, MPI_BYTE, comm)), "MPI_Allgatherv succeeded"); - VRFY((0 == memcmp(global_buf, correct_buf, correct_buf_size)), + VRFY((0 == HDmemcmp(global_buf, correct_buf, correct_buf_size)), "Data verification succeeded"); if (displs) HDfree(displs); @@ -5203,6 +5276,10 @@ test_read_cmpd_filtered_dataset_type_conversion_shared(void) int *recvcounts = NULL; int *displs = NULL; + if (MAINPROCESS) HDputs("Testing read from shared filtered chunks in Compound Datatype dataset with Datatype conversion"); + + CHECK_CUR_FILTER_AVAIL(); + dataset_dims[0] = (hsize_t) READ_COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_NROWS; dataset_dims[1] = (hsize_t) READ_COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_NCOLS; @@ -5255,8 +5332,6 @@ test_read_cmpd_filtered_dataset_type_conversion_shared(void) "Datatype insertion succeeded"); if (MAINPROCESS) { - puts("Testing read from shared filtered chunks in Compound Datatype dataset with Datatype conversion"); - plist_id = H5Pcreate(H5P_FILE_ACCESS); VRFY((plist_id >= 0), "FAPL creation succeeded"); @@ -5344,9 +5419,9 @@ test_read_cmpd_filtered_dataset_type_conversion_shared(void) start[1] = 0; if (VERBOSE_MED) { - printf("Process %d is reading with count[ %llu, %llu ], stride[ %llu, %llu ], start[ %llu, %llu ], block size[ %llu, %llu ]\n", + HDprintf("Process %d is reading with count[ %llu, %llu ], stride[ %llu, %llu ], start[ %llu, %llu ], block size[ %llu, %llu ]\n", mpi_rank, count[0], count[1], stride[0], stride[1], start[0], start[1], block[0], block[1]); - fflush(stdout); + HDfflush(stdout); } VRFY((H5Sselect_hyperslab(filespace, H5S_SELECT_SET, start, stride, count, block) >= 0), @@ -5386,7 +5461,7 @@ test_read_cmpd_filtered_dataset_type_conversion_shared(void) VRFY((MPI_SUCCESS == MPI_Allgatherv(read_buf, (int) (flat_dims[0] * sizeof(COMPOUND_C_DATATYPE)), MPI_BYTE, global_buf, recvcounts, displs, MPI_BYTE, comm)), "MPI_Allgatherv succeeded"); - VRFY((0 == memcmp(global_buf, correct_buf, correct_buf_size)), + VRFY((0 == HDmemcmp(global_buf, correct_buf, correct_buf_size)), "Data verification succeeded"); if (displs) HDfree(displs); @@ -5427,7 +5502,9 @@ test_write_serial_read_parallel(void) hid_t file_id = -1, dset_id = -1, plist_id = -1; hid_t filespace = -1; - if (MAINPROCESS) puts("Testing write file serially; read file in parallel"); + if (MAINPROCESS) HDputs("Testing write file serially; read file in parallel"); + + CHECK_CUR_FILTER_AVAIL(); dataset_dims[0] = (hsize_t) WRITE_SERIAL_READ_PARALLEL_NROWS; dataset_dims[1] = (hsize_t) WRITE_SERIAL_READ_PARALLEL_NCOLS; @@ -5527,7 +5604,7 @@ test_write_serial_read_parallel(void) VRFY((H5Dread(dset_id, HDF5_DATATYPE_NAME, H5S_ALL, H5S_ALL, plist_id, read_buf) >= 0), "Dataset read succeeded"); - VRFY((0 == memcmp(read_buf, correct_buf, correct_buf_size)), + VRFY((0 == HDmemcmp(read_buf, correct_buf, correct_buf_size)), "Data verification succeeded"); if (correct_buf) HDfree(correct_buf); @@ -5568,7 +5645,9 @@ test_write_parallel_read_serial(void) hid_t file_id = -1, dset_id = -1, plist_id = -1; hid_t filespace = -1, memspace = -1; - if (MAINPROCESS) puts("Testing write file in parallel; read serially"); + if (MAINPROCESS) HDputs("Testing write file in parallel; read serially"); + + CHECK_CUR_FILTER_AVAIL(); /* Set up file access property list with parallel I/O access */ plist_id = H5Pcreate(H5P_FILE_ACCESS); @@ -5636,9 +5715,9 @@ test_write_parallel_read_serial(void) offset[2] = 0; if (VERBOSE_MED) { - printf("Process %d is writing with count[ %llu, %llu, %llu ], stride[ %llu, %llu, %llu ], offset[ %llu, %llu, %llu ], block size[ %llu, %llu, %llu ]\n", + HDprintf("Process %d is writing with count[ %llu, %llu, %llu ], stride[ %llu, %llu, %llu ], offset[ %llu, %llu, %llu ], block size[ %llu, %llu, %llu ]\n", mpi_rank, count[0], count[1], count[2], stride[0], stride[1], stride[2], offset[0], offset[1], offset[2], block[0], block[1], block[2]); - fflush(stdout); + HDfflush(stdout); } /* Select hyperslab in the file */ @@ -5707,7 +5786,7 @@ test_write_parallel_read_serial(void) VRFY((H5Dread(dset_id, HDF5_DATATYPE_NAME, H5S_ALL, H5S_ALL, H5P_DEFAULT, read_buf) >= 0), "Dataset read succeeded"); - VRFY((0 == memcmp(read_buf, correct_buf, correct_buf_size)), + VRFY((0 == HDmemcmp(read_buf, correct_buf, correct_buf_size)), "Data verification succeeded"); VRFY((H5Dclose(dset_id) >= 0), "Dataset close succeeded"); @@ -5741,7 +5820,9 @@ test_shrinking_growing_chunks(void) hid_t file_id = -1, dset_id = -1, plist_id = -1; hid_t filespace = -1, memspace = -1; - if (MAINPROCESS) puts("Testing continually shrinking/growing chunks"); + if (MAINPROCESS) HDputs("Testing continually shrinking/growing chunks"); + + CHECK_CUR_FILTER_AVAIL(); /* Set up file access property list with parallel I/O access */ plist_id = H5Pcreate(H5P_FILE_ACCESS); @@ -5803,9 +5884,9 @@ test_shrinking_growing_chunks(void) start[1] = 0; if (VERBOSE_MED) { - printf("Process %d is writing with count[ %llu, %llu ], stride[ %llu, %llu ], start[ %llu, %llu ], block size[ %llu, %llu ]\n", + HDprintf("Process %d is writing with count[ %llu, %llu ], stride[ %llu, %llu ], start[ %llu, %llu ], block size[ %llu, %llu ]\n", mpi_rank, count[0], count[1], stride[0], stride[1], start[0], start[1], block[0], block[1]); - fflush(stdout); + HDfflush(stdout); } /* Select hyperslab in the file */ @@ -5868,8 +5949,8 @@ main(int argc, char** argv) if (mpi_size <= 0) { if (MAINPROCESS) { - printf("The Parallel Filters tests require at least 1 rank.\n"); - printf("Quitting...\n"); + HDprintf("The Parallel Filters tests require at least 1 rank.\n"); + HDprintf("Quitting...\n"); } MPI_Abort(MPI_COMM_WORLD, 1); @@ -5877,16 +5958,16 @@ main(int argc, char** argv) if (H5dont_atexit() < 0) { if (MAINPROCESS) { - printf("Failed to turn off atexit processing. Continue.\n"); + HDprintf("Failed to turn off atexit processing. Continue.\n"); } } H5open(); if (MAINPROCESS) { - printf("==========================\n"); - printf("Parallel Filters tests\n"); - printf("==========================\n\n"); + HDprintf("==========================\n"); + HDprintf("Parallel Filters tests\n"); + HDprintf("==========================\n\n"); } if (VERBOSE_MED) h5_show_hostname(); @@ -5942,9 +6023,9 @@ main(int argc, char** argv) VRFY((H5Fclose(file_id) >= 0), "File close succeeded"); if (MAINPROCESS) { - printf("\n=================================================================\n"); - printf("Re-running Parallel Filters tests with Fletcher32 checksum filter\n"); - printf("=================================================================\n\n"); + HDprintf("\n=================================================================\n"); + HDprintf("Re-running Parallel Filters tests with Fletcher32 checksum filter\n"); + HDprintf("=================================================================\n\n"); } for (i = 0; i < ARRAY_SIZE(tests); i++) { @@ -5959,12 +6040,12 @@ main(int argc, char** argv) if (nerrors) goto exit; - if (MAINPROCESS) puts("All Parallel Filters tests passed\n"); + if (MAINPROCESS) HDputs("All Parallel Filters tests passed\n"); exit: if (nerrors) if (MAINPROCESS) - printf("*** %d TEST ERROR%s OCCURRED ***\n", nerrors, + HDprintf("*** %d TEST ERROR%s OCCURRED ***\n", nerrors, nerrors > 1 ? "S" : ""); ALARM_OFF; -- cgit v0.12 From 5b5079652915b02f097309ae3fe295721f03142b Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 22 Jan 2019 13:30:11 -0600 Subject: HDFFV-10685 Always set version flags on OSX --- config/cmake/HDF5Macros.cmake | 10 +++++++--- release_docs/RELEASE.txt | 29 ++++++++++++++++++----------- 2 files changed, 25 insertions(+), 14 deletions(-) diff --git a/config/cmake/HDF5Macros.cmake b/config/cmake/HDF5Macros.cmake index 6c203e2..007bc29 100644 --- a/config/cmake/HDF5Macros.cmake +++ b/config/cmake/HDF5Macros.cmake @@ -15,6 +15,8 @@ macro (H5_SET_LIB_OPTIONS libtarget libname libtype libpackage) # SOVERSION passed in ARGN when shared if (${libtype} MATCHES "SHARED") set (PACKAGE_SOVERSION ${HDF5_${libpackage}_PACKAGE_SOVERSION}) + set (PACKAGE_COMPATIBILITY ${H5_${libpackage}_SOVERS_INTERFACE}.0.0) + set (PACKAGE_CURRENT ${H5_${libpackage}_SOVERS_INTERFACE}.${H5_${libpackage}_SOVERS_MINOR}.0) if (WIN32) set (LIBHDF_VERSION ${HDF5_PACKAGE_VERSION_MAJOR}) else () @@ -26,6 +28,11 @@ macro (H5_SET_LIB_OPTIONS libtarget libname libtype libpackage) else () set_target_properties (${libtarget} PROPERTIES SOVERSION ${LIBHDF_VERSION}) endif () + if (CMAKE_C_OSX_CURRENT_VERSION_FLAG) + set_property(TARGET ${libtarget} APPEND PROPERTY + LINK_FLAGS "${CMAKE_C_OSX_CURRENT_VERSION_FLAG}${PACKAGE_CURRENT} ${CMAKE_C_OSX_COMPATIBILITY_VERSION_FLAG}${PACKAGE_COMPATIBILITY}" + ) + endif () endif () HDF_SET_LIB_OPTIONS (${libtarget} ${LIB_OUT_NAME} ${libtype}) @@ -33,9 +40,6 @@ macro (H5_SET_LIB_OPTIONS libtarget libname libtype libpackage) if (APPLE) option (HDF5_BUILD_WITH_INSTALL_NAME "Build with library install_name set to the installation path" OFF) if (HDF5_BUILD_WITH_INSTALL_NAME) - set_property(TARGET ${libtarget} APPEND PROPERTY - LINK_FLAGS "-current_version ${HDF5_PACKAGE_VERSION} -compatibility_version ${HDF5_PACKAGE_VERSION}" - ) set_target_properties (${libtarget} PROPERTIES INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/lib" BUILD_WITH_INSTALL_RPATH ${HDF5_BUILD_WITH_INSTALL_NAME} diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index e4a39c9..d40e59a 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -47,6 +47,13 @@ New Features Configuration: ------------- + - Rework CMake versioning for OSX platforms. + + Changed the current_version and compatibility_version flags from optional + with HDF5_BUILD_WITH_INSTALL_NAME to always setting the flags for OSX. + + (ADB - 2019/01/22, HDFFV-10685) + - Rework CMake command files to eliminate developer CMP005 warning Use variables without quotes in if () statements. @@ -203,8 +210,8 @@ New Features - Changed the default behavior in parallel when reading the same dataset in its entirely (i.e. H5S_ALL dataset selection) which is being read by all the processes collectively. The dataset mush be contiguous, less than 2GB, and of an atomic datatype. - The new behavior is the HDF5 library will use an MPI_Bcast to pass the data read from - the disk by the root process to the remain processes in the MPI communicator associated + The new behavior is the HDF5 library will use an MPI_Bcast to pass the data read from + the disk by the root process to the remain processes in the MPI communicator associated with the HDF5 file. (MSB - 2019/01/02, HDFFV-10652) @@ -231,10 +238,10 @@ New Features - Added new Fortran API, H5gmtime, which converts (C) 'time_t' structure to Fortran DATE AND TIME storage format. - + (MSB, 2019/01/08, HDFFV-10443) - - Added new Fortran 'fields' optional parameter to: h5ovisit_f, h5oget_info_by_name_f, + - Added new Fortran 'fields' optional parameter to: h5ovisit_f, h5oget_info_by_name_f, h5oget_info, h5oget_info_by_idx and h5ovisit_by_name_f. (MSB, 2019/01/08, HDFFV-10443) @@ -318,8 +325,8 @@ Bug Fixes since HDF5-1.10.3 release When deleting the attribute nodes from the name index v2 B-tree, if an attribute is found in the intermediate B-tree nodes, - which may be merged/redistributed in the process, we need to - free the dynamically allocated spaces for the intermediate + which may be merged/redistributed in the process, we need to + free the dynamically allocated spaces for the intermediate decoded attribute. (VC - 2018/12/26, HDFFV-10659) @@ -408,10 +415,10 @@ Bug Fixes since HDF5-1.10.3 release Fortran -------- - Added symbolic links libhdf5_hl_fortran.so to libhdf5hl_fortran.so and - libhdf5_hl_fortran.a to libhdf5hl_fortran.a in hdf5/lib directory for - autotools installs. These were added to match the name of the files - installed by cmake and the general pattern of hl lib files. We will - change the names of the installed lib files to the matching name in + libhdf5_hl_fortran.a to libhdf5hl_fortran.a in hdf5/lib directory for + autotools installs. These were added to match the name of the files + installed by cmake and the general pattern of hl lib files. We will + change the names of the installed lib files to the matching name in the next major release. (LRK - 2019/01/04, HDFFV-10596) @@ -422,7 +429,7 @@ Bug Fixes since HDF5-1.10.3 release (MSB, 2018/12/04, HDFFV-10511) - - Fixed issue with Fortran not returning h5o_info_t field values + - Fixed issue with Fortran not returning h5o_info_t field values meta_size%attr%index_size and meta_size%attr%heap_size. (MSB, 2018/1/8, HDFFV-10443) -- cgit v0.12 From 8eb86b5a2474d44429bd83775fc5af0e7ed70ad5 Mon Sep 17 00:00:00 2001 From: Jordan Henderson Date: Tue, 22 Jan 2019 13:53:07 -0600 Subject: Add RELEASE.txt note for parallel filters test fix --- release_docs/RELEASE.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index e4a39c9..23cbe40 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -324,6 +324,13 @@ Bug Fixes since HDF5-1.10.3 release (VC - 2018/12/26, HDFFV-10659) + - Fixed an issue where the parallel filters tests would fail + if zlib was not available on the system. Until support can + be added in the tests for filters beyond gzip/zlib, the tests + will be skipped if zlib is not available. + + (JTH - 2018/12/05) + - A bug was discovered in the parallel library where an application would eventually consume all of the available MPI communicators when continually writing to a compressed dataset in parallel. This -- cgit v0.12 From 29064dcb109359d3b17a8c361d172fa077012e7c Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 22 Jan 2019 15:39:31 -0600 Subject: Cleanup variable names --- config/cmake/HDF5UseFortran.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/cmake/HDF5UseFortran.cmake b/config/cmake/HDF5UseFortran.cmake index a24b2e1..6b77ca4 100644 --- a/config/cmake/HDF5UseFortran.cmake +++ b/config/cmake/HDF5UseFortran.cmake @@ -57,8 +57,8 @@ endmacro () # Read source line beginning at the line matching Input:"START" and ending at the line matching Input:"END" macro (READ_SOURCE SOURCE_START SOURCE_END RETURN_VAR) - file (READ "${HDF5_SOURCE_DIR}/m4/aclocal_fc.f90" SOURCE_CODE) - string (REGEX MATCH "${SOURCE_START}[\\\t\\\n\\\r[].+]*${SOURCE_END}" SOURCE_CODE ${SOURCE_CODE}) + file (READ "${HDF5_SOURCE_DIR}/m4/aclocal_fc.f90" SOURCE_MASTER) + string (REGEX MATCH "${SOURCE_START}[\\\t\\\n\\\r[].+]*${SOURCE_END}" SOURCE_CODE ${SOURCE_MASTER}) set (RETURN_VAR "${SOURCE_CODE}") endmacro () -- cgit v0.12 From 5c1d48bdcc2a324cf803f04f85f5f479d0f55d95 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 22 Jan 2019 16:19:15 -0600 Subject: Add new clear tests to ignore list --- config/cmake/CTestCustom.cmake | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/config/cmake/CTestCustom.cmake b/config/cmake/CTestCustom.cmake index 33e6d4c..424c8bc 100644 --- a/config/cmake/CTestCustom.cmake +++ b/config/cmake/CTestCustom.cmake @@ -307,6 +307,11 @@ set (CTEST_CUSTOM_MEMCHECK_IGNORE H5REPACK_VERIFY_LAYOUT_ALL-layout_short_switches #uses grepTest.cmake H5REPACK-plugin H5REPACK_CMP-plugin_zero + ######### + ADD_H5_VERIFY_INVALIDBOUNDS-h5repack-latest_latest_invalid-clear-objects + H5REPACK_VERIFY_SUPERBLOCK-SB_IS_0-clear-objects + H5REPACK_VERIFY_SUPERBLOCK-SB_IS_2-clear-objects + H5REPACK_VERIFY_SUPERBLOCK-SB_IS_3-clear-objects ######### tools/h5stat ######### H5STAT-clearall-objects ######### tools/misc ######### -- cgit v0.12 From 7367fc0c1b916cffe50d1b8d729ccccfd6a9ec77 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 22 Jan 2019 16:30:22 -0600 Subject: Add clear objects to ignore tests --- config/cmake/CTestCustom.cmake | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/config/cmake/CTestCustom.cmake b/config/cmake/CTestCustom.cmake index 424c8bc..27eaa56 100644 --- a/config/cmake/CTestCustom.cmake +++ b/config/cmake/CTestCustom.cmake @@ -41,16 +41,20 @@ set (CTEST_CUSTOM_MEMCHECK_IGNORE H5TEST-err_compat #uses runTest.cmake H5TEST-links_env #uses runTest.cmake H5TEST-testlibinfo #uses grepTest.cmake - H5TEST-clear-testhdf5-objects + ######### H5TEST-clear-objects H5TEST-clear-cache-objects H5TEST-clear-cache_api-objects H5TEST-clear-cache_image-objects H5TEST-clear-cache_tagging-objects + H5TEST-clear-del_many_dense_attrs-objects H5TEST-clear-err_compat-objects H5TEST-clear-error_test-objects H5TEST-clear-filenotclosed-objects + H5TEST-clear-flush-objects H5TEST-clear-links_env-objects + H5TEST-clear-testflushrefresh-objects + H5TEST-clear-testhdf5-objects H5TEST-clear-ttsafe-objects PERFORM_h5perform-clear-objects HL_TOOLS-clear-objects -- cgit v0.12 From 5398c881d296299a0184d89c5373122999144c54 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 24 Jan 2019 08:52:20 -0600 Subject: HDFFV-10686 revert H5Oget_info1 to H5Oget_info(H5Ovisit) --- MANIFEST | 1 - config/cmake/HDF5_Examples.cmake.in | 8 +- config/cmake/patch.xml | 4 +- src/CMakeLists.txt | 1 - src/H5O.c | 598 ++++++++++++++++++++++++++---------- src/H5Odeprec.c | 337 -------------------- src/H5Opublic.h | 10 +- 7 files changed, 444 insertions(+), 515 deletions(-) delete mode 100644 src/H5Odeprec.c diff --git a/MANIFEST b/MANIFEST index d240527..33038a3 100644 --- a/MANIFEST +++ b/MANIFEST @@ -759,7 +759,6 @@ ./src/H5Ocont.c ./src/H5Ocopy.c ./src/H5Odbg.c -./src/H5Odeprec.c ./src/H5Odrvinfo.c ./src/H5Odtype.c ./src/H5Oefl.c diff --git a/config/cmake/HDF5_Examples.cmake.in b/config/cmake/HDF5_Examples.cmake.in index d30f2ab..6951b09 100644 --- a/config/cmake/HDF5_Examples.cmake.in +++ b/config/cmake/HDF5_Examples.cmake.in @@ -48,7 +48,11 @@ set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DCTEST_CONFIGURATION_TYPE:STRING=${ ################################################################## if(NOT DEFINED INSTALLDIR) - set(INSTALLDIR "C:/Program Files/HDF_Group/@HDF5_PACKAGE_NAME@/@HDF5_PACKAGE_VERSION@") + if(WIN32) + set(INSTALLDIR "C:/Program Files/HDF_Group/@HDF5_PACKAGE_NAME@/@HDF5_PACKAGE_VERSION@") + else() + set(INSTALLDIR "@CMAKE_INSTALL_PREFIX@") + endif() endif() if(NOT DEFINED CTEST_SOURCE_NAME) @@ -70,7 +74,7 @@ set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DSITE:STRING=${CTEST_SITE} -DBUILDN #TAR_SOURCE - name of tarfile #if(NOT DEFINED TAR_SOURCE) -# set(CTEST_USE_TAR_SOURCE "HDF5Examples-1.10.10-Source") +# set(CTEST_USE_TAR_SOURCE "HDF5Examples-1.10.13-Source") #endif() ############################################################################################################### diff --git a/config/cmake/patch.xml b/config/cmake/patch.xml index 70571c5..1bdff3e 100644 --- a/config/cmake/patch.xml +++ b/config/cmake/patch.xml @@ -1,5 +1,5 @@ - + - + diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 3b3459d..983add1 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -423,7 +423,6 @@ set (H5O_SOURCES ${HDF5_SRC_DIR}/H5Ocont.c ${HDF5_SRC_DIR}/H5Ocopy.c ${HDF5_SRC_DIR}/H5Odbg.c - ${HDF5_SRC_DIR}/H5Odeprec.c ${HDF5_SRC_DIR}/H5Odrvinfo.c ${HDF5_SRC_DIR}/H5Odtype.c ${HDF5_SRC_DIR}/H5Oefl.c diff --git a/src/H5O.c b/src/H5O.c index 25c3d83..aa175eb 100644 --- a/src/H5O.c +++ b/src/H5O.c @@ -73,11 +73,11 @@ /* Local Variables */ /*******************/ - + /*------------------------------------------------------------------------- - * Function: H5Oopen + * Function: H5Oopen * - * Purpose: Opens an object within an HDF5 file. + * Purpose: Opens an object within an HDF5 file. * * This function opens an object in the same way that H5Gopen2, * H5Topen2, and H5Dopen2 do. However, H5Oopen doesn't require @@ -88,18 +88,18 @@ * The opened object should be closed again with H5Oclose * or H5Gclose, H5Tclose, or H5Dclose. * - * Return: Success: An open object identifier - * Failure: Negative + * Return: Success: An open object identifier + * Failure: Negative * - * Programmer: James Laird - * July 14 2006 + * Programmer: James Laird + * July 14 2006 * *------------------------------------------------------------------------- */ hid_t H5Oopen(hid_t loc_id, const char *name, hid_t lapl_id) { - H5G_loc_t loc; /* Location of group */ + H5G_loc_t loc; /* Location of group */ hid_t ret_value = FAIL; FUNC_ENTER_API(FAIL) @@ -123,11 +123,11 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Oopen() */ - + /*------------------------------------------------------------------------- - * Function: H5Oopen_by_idx + * Function: H5Oopen_by_idx * - * Purpose: Opens an object within an HDF5 file, according to the offset + * Purpose: Opens an object within an HDF5 file, according to the offset * within an index. * * This function opens an object in the same way that H5Gopen, @@ -139,11 +139,11 @@ done: * The opened object should be closed again with H5Oclose * or H5Gclose, H5Tclose, or H5Dclose. * - * Return: Success: An open object identifier - * Failure: Negative + * Return: Success: An open object identifier + * Failure: Negative * - * Programmer: Quincey Koziol - * November 20 2006 + * Programmer: Quincey Koziol + * November 20 2006 * *------------------------------------------------------------------------- */ @@ -151,7 +151,7 @@ hid_t H5Oopen_by_idx(hid_t loc_id, const char *group_name, H5_index_t idx_type, H5_iter_order_t order, hsize_t n, hid_t lapl_id) { - H5G_loc_t loc; /* Location of group */ + H5G_loc_t loc; /* Location of group */ hid_t ret_value = FAIL; FUNC_ENTER_API(FAIL) @@ -179,11 +179,11 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Oopen_by_idx() */ - + /*------------------------------------------------------------------------- - * Function: H5Oopen_by_addr + * Function: H5Oopen_by_addr * - * Purpose: Warning! This function is EXTREMELY DANGEROUS! + * Purpose: Warning! This function is EXTREMELY DANGEROUS! * Improper use can lead to FILE CORRUPTION, INACCESSIBLE DATA, * and other VERY BAD THINGS! * @@ -207,19 +207,19 @@ done: * HDF5 file, and HDF5's file drivers will transparently * map this to an address on disk for the filesystem. * - * Return: Success: An open object identifier - * Failure: Negative + * Return: Success: An open object identifier + * Failure: Negative * - * Programmer: James Laird - * July 14 2006 + * Programmer: James Laird + * July 14 2006 * *------------------------------------------------------------------------- */ hid_t H5Oopen_by_addr(hid_t loc_id, haddr_t addr) { - H5G_loc_t loc; /* Location within file */ - hid_t ret_value = H5I_INVALID_HID; /* Return value */ + H5G_loc_t loc; /* Location within file */ + hid_t ret_value = H5I_INVALID_HID; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE2("i", "ia", loc_id, addr); @@ -238,24 +238,24 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Oopen_by_addr() */ - + /*------------------------------------------------------------------------- - * Function: H5Olink + * Function: H5Olink * - * Purpose: Creates a hard link from NEW_NAME to the object specified - * by OBJ_ID using properties defined in the Link Creation + * Purpose: Creates a hard link from NEW_NAME to the object specified + * by OBJ_ID using properties defined in the Link Creation * Property List LCPL. * - * This function should be used to link objects that have just + * This function should be used to link objects that have just * been created. * - * NEW_NAME is interpreted relative to - * NEW_LOC_ID, which is either a file ID or a - * group ID. + * NEW_NAME is interpreted relative to + * NEW_LOC_ID, which is either a file ID or a + * group ID. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: James Laird + * Programmer: James Laird * Tuesday, December 13, 2005 * *------------------------------------------------------------------------- @@ -264,8 +264,8 @@ herr_t H5Olink(hid_t obj_id, hid_t new_loc_id, const char *new_name, hid_t lcpl_id, hid_t lapl_id) { - H5G_loc_t new_loc; /* Location of group to link from */ - H5G_loc_t obj_loc; /* Location of object to link to */ + H5G_loc_t new_loc; /* Location of group to link from */ + H5G_loc_t obj_loc; /* Location of object to link to */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -300,11 +300,11 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Olink() */ - + /*------------------------------------------------------------------------- - * Function: H5Oincr_refcount + * Function: H5Oincr_refcount * - * Purpose: Warning! This function is EXTREMELY DANGEROUS! + * Purpose: Warning! This function is EXTREMELY DANGEROUS! * Improper use can lead to FILE CORRUPTION, INACCESSIBLE DATA, * and other VERY BAD THINGS! * @@ -313,19 +313,19 @@ done: * that references an object by address is created. When the * link is deleted, H5Odecr_refcount should be used. * - * Return: Success: Non-negative - * Failure: Negative + * Return: Success: Non-negative + * Failure: Negative * - * Programmer: James Laird - * July 14 2006 + * Programmer: James Laird + * July 14 2006 * *------------------------------------------------------------------------- */ herr_t H5Oincr_refcount(hid_t object_id) { - H5O_loc_t *oloc; /* Object location */ - herr_t ret_value = SUCCEED; /* Return value */ + H5O_loc_t *oloc; /* Object location */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE1("e", "i", object_id); @@ -346,11 +346,11 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5O_incr_refcount() */ - + /*------------------------------------------------------------------------- - * Function: H5Odecr_refcount + * Function: H5Odecr_refcount * - * Purpose: Warning! This function is EXTREMELY DANGEROUS! + * Purpose: Warning! This function is EXTREMELY DANGEROUS! * Improper use can lead to FILE CORRUPTION, INACCESSIBLE DATA, * and other VERY BAD THINGS! * @@ -359,19 +359,19 @@ done: * that reference an object by address are deleted, and only * after H5Oincr_refcount has already been used. * - * Return: Success: Non-negative - * Failure: Negative + * Return: Success: Non-negative + * Failure: Negative * - * Programmer: James Laird - * July 14 2006 + * Programmer: James Laird + * July 14 2006 * *------------------------------------------------------------------------- */ herr_t H5Odecr_refcount(hid_t object_id) { - H5O_loc_t *oloc; /* Object location */ - herr_t ret_value = SUCCEED; /* Return value */ + H5O_loc_t *oloc; /* Object location */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE1("e", "i", object_id); @@ -392,24 +392,24 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Odecr_refcount() */ - + /*------------------------------------------------------------------------- - * Function: H5Oexists_by_name + * Function: H5Oexists_by_name * - * Purpose: Determine if a linked-to object exists + * Purpose: Determine if a linked-to object exists * - * Return: Success: TRUE/FALSE - * Failure: Negative + * Return: Success: TRUE/FALSE + * Failure: Negative * - * Programmer: Quincey Koziol - * February 2 2010 + * Programmer: Quincey Koziol + * February 2 2010 * *------------------------------------------------------------------------- */ htri_t H5Oexists_by_name(hid_t loc_id, const char *name, hid_t lapl_id) { - H5G_loc_t loc; /* Location info */ + H5G_loc_t loc; /* Location info */ htri_t ret_value = FAIL; /* Return value */ FUNC_ENTER_API(FAIL) @@ -433,7 +433,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Oexists_by_name() */ - + /*------------------------------------------------------------------------- * Function: H5Oget_info2 * @@ -474,7 +474,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Oget_info2() */ - + /*------------------------------------------------------------------------- * Function: H5Oget_info_by_name2 * @@ -494,7 +494,7 @@ herr_t H5Oget_info_by_name2(hid_t loc_id, const char *name, H5O_info_t *oinfo, unsigned fields, hid_t lapl_id) { - H5G_loc_t loc; /* Location of group */ + H5G_loc_t loc; /* Location of group */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -522,7 +522,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Oget_info_by_name2() */ - + /*------------------------------------------------------------------------- * Function: H5Oget_info_by_idx2 * @@ -531,10 +531,10 @@ done: * * NOTE: Add a parameter "fields" to indicate selection of object info. * - * Return: Success: Non-negative - * Failure: Negative + * Return: Success: Non-negative + * Failure: Negative * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * November 26 2006 * *------------------------------------------------------------------------- @@ -543,7 +543,7 @@ herr_t H5Oget_info_by_idx2(hid_t loc_id, const char *group_name, H5_index_t idx_type, H5_iter_order_t order, hsize_t n, H5O_info_t *oinfo, unsigned fields, hid_t lapl_id) { - H5G_loc_t loc; /* Location of group */ + H5G_loc_t loc; /* Location of group */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -576,28 +576,28 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Oget_info_by_idx2() */ - + /*------------------------------------------------------------------------- - * Function: H5Oset_comment + * Function: H5Oset_comment * * Purpose: Gives the specified object a comment. The COMMENT string - * should be a null terminated string. An object can have only - * one comment at a time. Passing NULL for the COMMENT argument - * will remove the comment property from the object. + * should be a null terminated string. An object can have only + * one comment at a time. Passing NULL for the COMMENT argument + * will remove the comment property from the object. * - * Note: Deprecated in favor of using attributes on objects + * Note: Deprecated in favor of using attributes on objects * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol - * August 30 2007 + * Programmer: Quincey Koziol + * August 30 2007 * *------------------------------------------------------------------------- */ herr_t H5Oset_comment(hid_t obj_id, const char *comment) { - H5G_loc_t loc; /* Location of group */ + H5G_loc_t loc; /* Location of group */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -619,21 +619,21 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Oset_comment() */ - + /*------------------------------------------------------------------------- - * Function: H5Oset_comment_by_name + * Function: H5Oset_comment_by_name * * Purpose: Gives the specified object a comment. The COMMENT string - * should be a null terminated string. An object can have only - * one comment at a time. Passing NULL for the COMMENT argument - * will remove the comment property from the object. + * should be a null terminated string. An object can have only + * one comment at a time. Passing NULL for the COMMENT argument + * will remove the comment property from the object. * - * Note: Deprecated in favor of using attributes on objects + * Note: Deprecated in favor of using attributes on objects * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol - * August 30 2007 + * Programmer: Quincey Koziol + * August 30 2007 * *------------------------------------------------------------------------- */ @@ -641,7 +641,7 @@ herr_t H5Oset_comment_by_name(hid_t loc_id, const char *name, const char *comment, hid_t lapl_id) { - H5G_loc_t loc; /* Location of group */ + H5G_loc_t loc; /* Location of group */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -665,27 +665,27 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Oset_comment_by_name() */ - + /*------------------------------------------------------------------------- - * Function: H5Oget_comment + * Function: H5Oget_comment * - * Purpose: Retrieve comment for an object. + * Purpose: Retrieve comment for an object. * - * Return: Success: Number of bytes in the comment excluding the - * null terminator. Zero if the object has no - * comment. + * Return: Success: Number of bytes in the comment excluding the + * null terminator. Zero if the object has no + * comment. * - * Failure: Negative + * Failure: Negative * - * Programmer: Quincey Koziol - * August 30 2007 + * Programmer: Quincey Koziol + * August 30 2007 * *------------------------------------------------------------------------- */ ssize_t H5Oget_comment(hid_t obj_id, char *comment, size_t bufsize) { - H5G_loc_t loc; /* Location of group */ + H5G_loc_t loc; /* Location of group */ ssize_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) @@ -703,20 +703,20 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Oget_comment() */ - + /*------------------------------------------------------------------------- - * Function: H5Oget_comment_by_name + * Function: H5Oget_comment_by_name * - * Purpose: Retrieve comment for an object. + * Purpose: Retrieve comment for an object. * - * Return: Success: Number of bytes in the comment excluding the - * null terminator. Zero if the object has no - * comment. + * Return: Success: Number of bytes in the comment excluding the + * null terminator. Zero if the object has no + * comment. * - * Failure: Negative + * Failure: Negative * - * Programmer: Quincey Koziol - * August 30 2007 + * Programmer: Quincey Koziol + * August 30 2007 * *------------------------------------------------------------------------- */ @@ -724,7 +724,7 @@ ssize_t H5Oget_comment_by_name(hid_t loc_id, const char *name, char *comment, size_t bufsize, hid_t lapl_id) { - H5G_loc_t loc; /* Location of group */ + H5G_loc_t loc; /* Location of group */ ssize_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) @@ -748,11 +748,11 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Oget_comment_by_name() */ - + /*------------------------------------------------------------------------- - * Function: H5Ovisit2 + * Function: H5Ovisit2 * - * Purpose: Recursively visit an object and all the objects reachable + * Purpose: Recursively visit an object and all the objects reachable * from it. If the starting object is a group, all the objects * linked to from that group will be visited. Links within * each group are visited according to the order within the @@ -772,14 +772,14 @@ done: * object info to be retrieved to the callback "op". * * Return: Success: The return value of the first operator that - * returns non-zero, or zero if all members were - * processed with no operator returning non-zero. + * returns non-zero, or zero if all members were + * processed with no operator returning non-zero. * * Failure: Negative if something goes wrong within the - * library, or the negative value returned by one - * of the operators. + * library, or the negative value returned by one + * of the operators. * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * November 25 2007 * *------------------------------------------------------------------------- @@ -811,9 +811,9 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Ovisit2() */ - + /*------------------------------------------------------------------------- - * Function: H5Ovisit_by_name2 + * Function: H5Ovisit_by_name2 * * Purpose: Recursively visit an object and all the objects reachable * from it. If the starting object is a group, all the objects @@ -835,14 +835,14 @@ done: * object info to be retrieved to the callback "op". * * Return: Success: The return value of the first operator that - * returns non-zero, or zero if all members were - * processed with no operator returning non-zero. + * returns non-zero, or zero if all members were + * processed with no operator returning non-zero. * - * Failure: Negative if something goes wrong within the - * library, or the negative value returned by one - * of the operators. + * Failure: Negative if something goes wrong within the + * library, or the negative value returned by one + * of the operators. * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * November 24 2007 * *------------------------------------------------------------------------- @@ -881,22 +881,22 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Ovisit_by_name2() */ - + /*------------------------------------------------------------------------- - * Function: H5Oclose + * Function: H5Oclose * - * Purpose: Close an open file object. + * Purpose: Close an open file object. * * This is the companion to H5Oopen. It is used to close any * open object in an HDF5 file (but not IDs are that not file * objects, such as property lists and dataspaces). It has * the same effect as calling H5Gclose, H5Dclose, or H5Tclose. * - * Return: Success: Non-negative - * Failure: Negative + * Return: Success: Non-negative + * Failure: Negative * - * Programmer: James Laird - * July 14 2006 + * Programmer: James Laird + * July 14 2006 * *------------------------------------------------------------------------- */ @@ -941,26 +941,26 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Oclose() */ - + /*------------------------------------------------------------------------- - * Function: H5Odisable_mdc_flushes + * Function: H5Odisable_mdc_flushes * - * Purpose: To "cork" an object: - * --keep dirty entries associated with the object in the metadata cache + * Purpose: To "cork" an object: + * --keep dirty entries associated with the object in the metadata cache * - * Return: Success: Non-negative - * Failure: Negative + * Return: Success: Non-negative + * Failure: Negative * - * Programmer: Vailin Choi - * January 2014 + * Programmer: Vailin Choi + * January 2014 * *------------------------------------------------------------------------- */ herr_t H5Odisable_mdc_flushes(hid_t object_id) { - H5O_loc_t *oloc; /* Object location */ - herr_t ret_value = SUCCEED; /* Return value */ + H5O_loc_t *oloc; /* Object location */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE1("e", "i", object_id); @@ -976,27 +976,27 @@ done: FUNC_LEAVE_API(ret_value) } /* H5Odisable_mdc_flushes() */ - + /*------------------------------------------------------------------------- - * Function: H5Oenable_mdc_flushes + * Function: H5Oenable_mdc_flushes * - * Purpose: To "uncork" an object - * --release keeping dirty entries associated with the object - * in the metadata cache + * Purpose: To "uncork" an object + * --release keeping dirty entries associated with the object + * in the metadata cache * - * Return: Success: Non-negative - * Failure: Negative + * Return: Success: Non-negative + * Failure: Negative * - * Programmer: Vailin Choi - * January 2014 + * Programmer: Vailin Choi + * January 2014 * *------------------------------------------------------------------------- */ herr_t H5Oenable_mdc_flushes(hid_t object_id) { - H5O_loc_t *oloc; /* Object location */ - herr_t ret_value = SUCCEED; /* Return value */ + H5O_loc_t *oloc; /* Object location */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE1("e", "i", object_id); @@ -1013,28 +1013,28 @@ done: FUNC_LEAVE_API(ret_value) } /* H5Oenable_mdc_flushes() */ - + /*------------------------------------------------------------------------- - * Function: H5Oare_mdc_flushes_disabled + * Function: H5Oare_mdc_flushes_disabled * - * Purpose: Retrieve the object's "cork" status in the parameter "are_disabled": - * TRUE if mdc flushes for the object is disabled - * FALSE if mdc flushes for the object is not disabled - * Return error if the parameter "are_disabled" is not supplied + * Purpose: Retrieve the object's "cork" status in the parameter "are_disabled": + * TRUE if mdc flushes for the object is disabled + * FALSE if mdc flushes for the object is not disabled + * Return error if the parameter "are_disabled" is not supplied * - * Return: Success: Non-negative - * Failure: Negative + * Return: Success: Non-negative + * Failure: Negative * - * Programmer: Vailin Choi - * January 2014 + * Programmer: Vailin Choi + * January 2014 * *------------------------------------------------------------------------- */ herr_t H5Oare_mdc_flushes_disabled(hid_t object_id, hbool_t *are_disabled) { - H5O_loc_t *oloc; /* Object location */ - herr_t ret_value = SUCCEED; /* Return value */ + H5O_loc_t *oloc; /* Object location */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE2("e", "i*b", object_id, are_disabled); @@ -1055,3 +1055,267 @@ done: FUNC_LEAVE_API(ret_value) } /* H5Oare_mdc_flushes_disabled() */ +/* Future function prototypes to be deprecated in next major version + * see HDFFV-10552 +#ifndef H5_NO_DEPRECATED_SYMBOLS + */ + +/*------------------------------------------------------------------------- + * Function: H5Oget_info + * + * Purpose: Retrieve information about an object. + * + * Return: Success: Non-negative + * Failure: Negative + * + *------------------------------------------------------------------------- + */ +herr_t +H5Oget_info(hid_t loc_id, H5O_info_t *oinfo) +{ + H5G_loc_t loc; /* Location of group */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_API(FAIL) + H5TRACE2("e", "i*x", loc_id, oinfo); + + /* Check args */ + if(H5G_loc(loc_id, &loc) < 0) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location") + if(!oinfo) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no info struct") + + /* Retrieve the object's information */ + if(H5G_loc_info(&loc, ".", oinfo/*out*/, H5O_INFO_ALL) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't retrieve object info") + +done: + FUNC_LEAVE_API(ret_value) +} /* end H5Oget_info() */ + + +/*------------------------------------------------------------------------- + * Function: H5Oget_info_by_name + * + * Purpose: Retrieve information about an object. + * + * Return: Success: Non-negative + * Failure: Negative + * + *------------------------------------------------------------------------- + */ +herr_t +H5Oget_info_by_name(hid_t loc_id, const char *name, H5O_info_t *oinfo, hid_t lapl_id) +{ + H5G_loc_t loc; /* Location of group */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_API(FAIL) + H5TRACE4("e", "i*s*xi", loc_id, name, oinfo, lapl_id); + + /* Check args */ + if(H5G_loc(loc_id, &loc) < 0) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location") + if(!name || !*name) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name") + if(!oinfo) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no info struct") + + /* Verify access property list and set up collective metadata if appropriate */ + if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, FALSE) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set access property list info") + + /* Retrieve the object's information */ + if(H5G_loc_info(&loc, name, oinfo/*out*/, H5O_INFO_ALL) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't get info for object: '%s'", name) + +done: + FUNC_LEAVE_API(ret_value) +} /* end H5Oget_info_by_name() */ + + +/*------------------------------------------------------------------------- + * Function: H5Oget_info_by_idx + * + * Purpose: Retrieve information about an object, according to the order + * of an index. + * + * Return: Success: Non-negative + * Failure: Negative + * + * Programmer: Quincey Koziol + * November 26 2006 + * + *------------------------------------------------------------------------- + */ +herr_t +H5Oget_info_by_idx(hid_t loc_id, const char *group_name, H5_index_t idx_type, + H5_iter_order_t order, hsize_t n, H5O_info_t *oinfo, hid_t lapl_id) +{ + H5G_loc_t loc; /* Location of group */ + H5G_loc_t obj_loc; /* Location used to open group */ + H5G_name_t obj_path; /* Opened object group hier. path */ + H5O_loc_t obj_oloc; /* Opened object object location */ + hbool_t loc_found = FALSE; /* Entry at 'name' found */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_API(FAIL) + H5TRACE7("e", "i*sIiIoh*xi", loc_id, group_name, idx_type, order, n, oinfo, + lapl_id); + + /* Check args */ + if(H5G_loc(loc_id, &loc) < 0) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location") + if(!group_name || !*group_name) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name specified") + if(idx_type <= H5_INDEX_UNKNOWN || idx_type >= H5_INDEX_N) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid index type specified") + if(order <= H5_ITER_UNKNOWN || order >= H5_ITER_N) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid iteration order specified") + if(!oinfo) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no info struct") + + /* Verify access property list and set up collective metadata if appropriate */ + if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, FALSE) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set access property list info") + + /* Retrieve the object's information */ + if(H5O__get_info_by_idx(&loc, group_name, idx_type, order, n, oinfo, H5O_INFO_ALL) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't get info for object") + +done: + /* Release the object location */ + if(loc_found && H5G_loc_free(&obj_loc) < 0) + HDONE_ERROR(H5E_OHDR, H5E_CANTRELEASE, FAIL, "can't free location") + + FUNC_LEAVE_API(ret_value) +} /* end H5Oget_info_by_idx() */ + + +/*------------------------------------------------------------------------- + * Function: H5Ovisit + * + * Purpose: Recursively visit an object and all the objects reachable + * from it. If the starting object is a group, all the objects + * linked to from that group will be visited. Links within + * each group are visited according to the order within the + * specified index (unless the specified index does not exist for + * a particular group, then the "name" index is used). + * + * NOTE: Soft links and user-defined links are ignored during + * this operation. + * + * NOTE: Each _object_ reachable from the initial group will only + * be visited once. If multiple hard links point to the same + * object, the first link to the object's path (according to the + * iteration index and iteration order given) will be used to in + * the callback about the object. + * + * Return: Success: The return value of the first operator that + * returns non-zero, or zero if all members were + * processed with no operator returning non-zero. + * + * Failure: Negative if something goes wrong within the + * library, or the negative value returned by one + * of the operators. + * + * Programmer: Quincey Koziol + * November 25 2007 + * + *------------------------------------------------------------------------- + */ +herr_t +H5Ovisit(hid_t obj_id, H5_index_t idx_type, H5_iter_order_t order, + H5O_iterate_t op, void *op_data) +{ + herr_t ret_value; /* Return value */ + + FUNC_ENTER_API(FAIL) + H5TRACE5("e", "iIiIox*x", obj_id, idx_type, order, op, op_data); + + /* Check args */ + if(idx_type <= H5_INDEX_UNKNOWN || idx_type >= H5_INDEX_N) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid index type specified") + if(order <= H5_ITER_UNKNOWN || order >= H5_ITER_N) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid iteration order specified") + if(!op) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no callback operator specified") + + /* Call internal object visitation routine */ + if((ret_value = H5O__visit(obj_id, ".", idx_type, order, op, op_data, H5O_INFO_ALL)) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_BADITER, FAIL, "object visitation failed") + +done: + FUNC_LEAVE_API(ret_value) +} /* end H5Ovisit() */ + + +/*------------------------------------------------------------------------- + * Function: H5Ovisit_by_name + * + * Purpose: Recursively visit an object and all the objects reachable + * from it. If the starting object is a group, all the objects + * linked to from that group will be visited. Links within + * each group are visited according to the order within the + * specified index (unless the specified index does not exist for + * a particular group, then the "name" index is used). + * + * NOTE: Soft links and user-defined links are ignored during + * this operation. + * + * NOTE: Each _object_ reachable from the initial group will only + * be visited once. If multiple hard links point to the same + * object, the first link to the object's path (according to the + * iteration index and iteration order given) will be used to in + * the callback about the object. + * + * Return: Success: The return value of the first operator that + * returns non-zero, or zero if all members were + * processed with no operator returning non-zero. + * + * Failure: Negative if something goes wrong within the + * library, or the negative value returned by one + * of the operators. + * + * Programmer: Quincey Koziol + * November 24 2007 + * + *------------------------------------------------------------------------- + */ +herr_t +H5Ovisit_by_name(hid_t loc_id, const char *obj_name, H5_index_t idx_type, + H5_iter_order_t order, H5O_iterate_t op, void *op_data, hid_t lapl_id) +{ + herr_t ret_value; /* Return value */ + + FUNC_ENTER_API(FAIL) + H5TRACE7("e", "i*sIiIox*xi", loc_id, obj_name, idx_type, order, op, op_data, + lapl_id); + + /* Check args */ + if(!obj_name || !*obj_name) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name") + if(idx_type <= H5_INDEX_UNKNOWN || idx_type >= H5_INDEX_N) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid index type specified") + if(order <= H5_ITER_UNKNOWN || order >= H5_ITER_N) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid iteration order specified") + if(!op) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no callback operator specified") + + /* Verify access property list and set up collective metadata if appropriate */ + if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, FALSE) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set access property list info") + + /* Call internal object visitation routine */ + if((ret_value = H5O__visit(loc_id, obj_name, idx_type, order, op, op_data, H5O_INFO_ALL)) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_BADITER, FAIL, "object visitation failed") + +done: + FUNC_LEAVE_API(ret_value) +} /* end H5Ovisit_by_name() */ + +/* Future function prototypes to be deprecated in next major version + * see HDFFV-10552 +#endif (* H5_NO_DEPRECATED_SYMBOLS *) + */ + diff --git a/src/H5Odeprec.c b/src/H5Odeprec.c deleted file mode 100644 index 9f0babc..0000000 --- a/src/H5Odeprec.c +++ /dev/null @@ -1,337 +0,0 @@ -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * - * All rights reserved. * - * * - * This file is part of HDF5. The full HDF5 copyright notice, including * - * terms governing use, modification, and redistribution, is contained in * - * the COPYING file, which can be found at the root of the source code * - * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * - * If you do not have access to either file, you may request a copy from * - * help@hdfgroup.org. * - * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ - -/*------------------------------------------------------------------------- - * - * Purpose: Deprecated functions from the H5O interface. These - * functions are here for compatibility purposes and may be - * removed in the future. Applications should switch to the - * newer APIs. - * - *------------------------------------------------------------------------- - */ - -/****************/ -/* Module Setup */ -/****************/ - -#include "H5Omodule.h" /* This source code file is part of the H5O module */ - - -/***********/ -/* Headers */ -/***********/ -#include "H5private.h" /* Generic Functions */ -#include "H5CXprivate.h" /* API Contexts */ -#include "H5Eprivate.h" /* Error handling */ -#include "H5Opkg.h" /* Object headers */ - - -/****************/ -/* Local Macros */ -/****************/ - - -/******************/ -/* Local Typedefs */ -/******************/ - - -/********************/ -/* Package Typedefs */ -/********************/ - - -/********************/ -/* Local Prototypes */ -/********************/ - - -/*********************/ -/* Package Variables */ -/*********************/ - - -/*****************************/ -/* Library Private Variables */ -/*****************************/ - - -/*******************/ -/* Local Variables */ -/*******************/ - - -/* Future function prototypes to be deprecated in next major version - * see HDFFV-10552 -#ifndef H5_NO_DEPRECATED_SYMBOLS - */ - -/*------------------------------------------------------------------------- - * Function: H5Oget_info1 - * - * Purpose: Retrieve information about an object. - * - * Return: Success: Non-negative - * Failure: Negative - * - *------------------------------------------------------------------------- - */ -herr_t -H5Oget_info1(hid_t loc_id, H5O_info_t *oinfo) -{ - H5G_loc_t loc; /* Location of group */ - herr_t ret_value = SUCCEED; /* Return value */ - - FUNC_ENTER_API(FAIL) - H5TRACE2("e", "i*x", loc_id, oinfo); - - /* Check args */ - if(H5G_loc(loc_id, &loc) < 0) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location") - if(!oinfo) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no info struct") - - /* Retrieve the object's information */ - if(H5G_loc_info(&loc, ".", oinfo/*out*/, H5O_INFO_ALL) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't retrieve object info") - -done: - FUNC_LEAVE_API(ret_value) -} /* end H5Oget_info1() */ - - -/*------------------------------------------------------------------------- - * Function: H5Oget_info_by_name1 - * - * Purpose: Retrieve information about an object. - * - * Return: Success: Non-negative - * Failure: Negative - * - *------------------------------------------------------------------------- - */ -herr_t -H5Oget_info_by_name1(hid_t loc_id, const char *name, H5O_info_t *oinfo, hid_t lapl_id) -{ - H5G_loc_t loc; /* Location of group */ - herr_t ret_value = SUCCEED; /* Return value */ - - FUNC_ENTER_API(FAIL) - H5TRACE4("e", "i*s*xi", loc_id, name, oinfo, lapl_id); - - /* Check args */ - if(H5G_loc(loc_id, &loc) < 0) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location") - if(!name || !*name) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name") - if(!oinfo) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no info struct") - - /* Verify access property list and set up collective metadata if appropriate */ - if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, FALSE) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set access property list info") - - /* Retrieve the object's information */ - if(H5G_loc_info(&loc, name, oinfo/*out*/, H5O_INFO_ALL) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't get info for object: '%s'", name) - -done: - FUNC_LEAVE_API(ret_value) -} /* end H5Oget_info_by_name1() */ - - -/*------------------------------------------------------------------------- - * Function: H5Oget_info_by_idx1 - * - * Purpose: Retrieve information about an object, according to the order - * of an index. - * - * Return: Success: Non-negative - * Failure: Negative - * - * Programmer: Quincey Koziol - * November 26 2006 - * - *------------------------------------------------------------------------- - */ -herr_t -H5Oget_info_by_idx1(hid_t loc_id, const char *group_name, H5_index_t idx_type, - H5_iter_order_t order, hsize_t n, H5O_info_t *oinfo, hid_t lapl_id) -{ - H5G_loc_t loc; /* Location of group */ - H5G_loc_t obj_loc; /* Location used to open group */ - H5G_name_t obj_path; /* Opened object group hier. path */ - H5O_loc_t obj_oloc; /* Opened object object location */ - hbool_t loc_found = FALSE; /* Entry at 'name' found */ - herr_t ret_value = SUCCEED; /* Return value */ - - FUNC_ENTER_API(FAIL) - H5TRACE7("e", "i*sIiIoh*xi", loc_id, group_name, idx_type, order, n, oinfo, - lapl_id); - - /* Check args */ - if(H5G_loc(loc_id, &loc) < 0) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location") - if(!group_name || !*group_name) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name specified") - if(idx_type <= H5_INDEX_UNKNOWN || idx_type >= H5_INDEX_N) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid index type specified") - if(order <= H5_ITER_UNKNOWN || order >= H5_ITER_N) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid iteration order specified") - if(!oinfo) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no info struct") - - /* Verify access property list and set up collective metadata if appropriate */ - if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, FALSE) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set access property list info") - - /* Retrieve the object's information */ - if(H5O__get_info_by_idx(&loc, group_name, idx_type, order, n, oinfo, H5O_INFO_ALL) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't get info for object") - -done: - /* Release the object location */ - if(loc_found && H5G_loc_free(&obj_loc) < 0) - HDONE_ERROR(H5E_OHDR, H5E_CANTRELEASE, FAIL, "can't free location") - - FUNC_LEAVE_API(ret_value) -} /* end H5Oget_info_by_idx1() */ - - -/*------------------------------------------------------------------------- - * Function: H5Ovisit1 - * - * Purpose: Recursively visit an object and all the objects reachable - * from it. If the starting object is a group, all the objects - * linked to from that group will be visited. Links within - * each group are visited according to the order within the - * specified index (unless the specified index does not exist for - * a particular group, then the "name" index is used). - * - * NOTE: Soft links and user-defined links are ignored during - * this operation. - * - * NOTE: Each _object_ reachable from the initial group will only - * be visited once. If multiple hard links point to the same - * object, the first link to the object's path (according to the - * iteration index and iteration order given) will be used to in - * the callback about the object. - * - * Return: Success: The return value of the first operator that - * returns non-zero, or zero if all members were - * processed with no operator returning non-zero. - * - * Failure: Negative if something goes wrong within the - * library, or the negative value returned by one - * of the operators. - * - * Programmer: Quincey Koziol - * November 25 2007 - * - *------------------------------------------------------------------------- - */ -herr_t -H5Ovisit1(hid_t obj_id, H5_index_t idx_type, H5_iter_order_t order, - H5O_iterate_t op, void *op_data) -{ - herr_t ret_value; /* Return value */ - - FUNC_ENTER_API(FAIL) - H5TRACE5("e", "iIiIox*x", obj_id, idx_type, order, op, op_data); - - /* Check args */ - if(idx_type <= H5_INDEX_UNKNOWN || idx_type >= H5_INDEX_N) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid index type specified") - if(order <= H5_ITER_UNKNOWN || order >= H5_ITER_N) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid iteration order specified") - if(!op) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no callback operator specified") - - /* Call internal object visitation routine */ - if((ret_value = H5O__visit(obj_id, ".", idx_type, order, op, op_data, H5O_INFO_ALL)) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_BADITER, FAIL, "object visitation failed") - -done: - FUNC_LEAVE_API(ret_value) -} /* end H5Ovisit1() */ - - -/*------------------------------------------------------------------------- - * Function: H5Ovisit_by_name1 - * - * Purpose: Recursively visit an object and all the objects reachable - * from it. If the starting object is a group, all the objects - * linked to from that group will be visited. Links within - * each group are visited according to the order within the - * specified index (unless the specified index does not exist for - * a particular group, then the "name" index is used). - * - * NOTE: Soft links and user-defined links are ignored during - * this operation. - * - * NOTE: Each _object_ reachable from the initial group will only - * be visited once. If multiple hard links point to the same - * object, the first link to the object's path (according to the - * iteration index and iteration order given) will be used to in - * the callback about the object. - * - * Return: Success: The return value of the first operator that - * returns non-zero, or zero if all members were - * processed with no operator returning non-zero. - * - * Failure: Negative if something goes wrong within the - * library, or the negative value returned by one - * of the operators. - * - * Programmer: Quincey Koziol - * November 24 2007 - * - *------------------------------------------------------------------------- - */ -herr_t -H5Ovisit_by_name1(hid_t loc_id, const char *obj_name, H5_index_t idx_type, - H5_iter_order_t order, H5O_iterate_t op, void *op_data, hid_t lapl_id) -{ - herr_t ret_value; /* Return value */ - - FUNC_ENTER_API(FAIL) - H5TRACE7("e", "i*sIiIox*xi", loc_id, obj_name, idx_type, order, op, op_data, - lapl_id); - - /* Check args */ - if(!obj_name || !*obj_name) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name") - if(idx_type <= H5_INDEX_UNKNOWN || idx_type >= H5_INDEX_N) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid index type specified") - if(order <= H5_ITER_UNKNOWN || order >= H5_ITER_N) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid iteration order specified") - if(!op) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no callback operator specified") - - /* Verify access property list and set up collective metadata if appropriate */ - if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, FALSE) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set access property list info") - - /* Call internal object visitation routine */ - if((ret_value = H5O__visit(loc_id, obj_name, idx_type, order, op, op_data, H5O_INFO_ALL)) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_BADITER, FAIL, "object visitation failed") - -done: - FUNC_LEAVE_API(ret_value) -} /* end H5Ovisit_by_name1() */ - -/* Future function prototypes to be deprecated in next major version - * see HDFFV-10552 -#endif (* H5_NO_DEPRECATED_SYMBOLS *) - */ diff --git a/src/H5Opublic.h b/src/H5Opublic.h index 3a34fd2..e779627 100644 --- a/src/H5Opublic.h +++ b/src/H5Opublic.h @@ -198,16 +198,16 @@ H5_DLL herr_t H5Oenable_mdc_flushes(hid_t object_id); H5_DLL herr_t H5Oare_mdc_flushes_disabled(hid_t object_id, hbool_t *are_disabled); /* Future function prototypes to be deprecated in next version */ -H5_DLL herr_t H5Oget_info1(hid_t loc_id, H5O_info_t *oinfo); -H5_DLL herr_t H5Oget_info_by_name1(hid_t loc_id, const char *name, H5O_info_t *oinfo, +H5_DLL herr_t H5Oget_info(hid_t loc_id, H5O_info_t *oinfo); +H5_DLL herr_t H5Oget_info_by_name(hid_t loc_id, const char *name, H5O_info_t *oinfo, hid_t lapl_id); -H5_DLL herr_t H5Oget_info_by_idx1(hid_t loc_id, const char *group_name, +H5_DLL herr_t H5Oget_info_by_idx(hid_t loc_id, const char *group_name, H5_index_t idx_type, H5_iter_order_t order, hsize_t n, H5O_info_t *oinfo, hid_t lapl_id); -H5_DLL herr_t H5Ovisit1(hid_t obj_id, H5_index_t idx_type, H5_iter_order_t order, +H5_DLL herr_t H5Ovisit(hid_t obj_id, H5_index_t idx_type, H5_iter_order_t order, H5O_iterate_t op, void *op_data); -H5_DLL herr_t H5Ovisit_by_name1(hid_t loc_id, const char *obj_name, +H5_DLL herr_t H5Ovisit_by_name(hid_t loc_id, const char *obj_name, H5_index_t idx_type, H5_iter_order_t order, H5O_iterate_t op, void *op_data, hid_t lapl_id); -- cgit v0.12 From 0658286687972e623e3121464e80b5b422dd42da Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 24 Jan 2019 09:04:07 -0600 Subject: HDFFV-10686 add note --- release_docs/RELEASE.txt | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index d40e59a..624a6da 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -318,6 +318,21 @@ Bug Fixes since HDF5-1.10.3 release Library ------- + - Revert H5Oget_info* and H5Ovisit* functions + + In 1.10.3 new H5Oget_info*2 and H5Ovisit*2 functions were + added for performance. Inadvertently, the original functions; + H5Oget_info, + H5Oget_info_by_name, + H5Oget_info_by_idx, + H5Ovisit, + H5Ovisit_by_name + were versioned to H5Oget_info*1 and H5Ovisit*1. This + broke the API compatibility for a maintenance release. The + original functions have been restored. + + (ADB - 2019/01/24, HDFFV-10686) + - Deleting attributes in dense storage The library aborts with "infinite loop closing library" after -- cgit v0.12 From 3ba3c59a7d2731d9207d3492ebcdaef3a249b46b Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 24 Jan 2019 15:57:05 -0600 Subject: Java html fix and cmake update --- config/cmake_ext_mod/HDFMacros.cmake | 6 +- java/src/hdf/hdf5lib/H5.java | 131 +++++++++++++++++++---------------- java/src/hdf/overview.html | 3 +- 3 files changed, 74 insertions(+), 66 deletions(-) diff --git a/config/cmake_ext_mod/HDFMacros.cmake b/config/cmake_ext_mod/HDFMacros.cmake index 147ae2f..77980c0 100644 --- a/config/cmake_ext_mod/HDFMacros.cmake +++ b/config/cmake_ext_mod/HDFMacros.cmake @@ -170,7 +170,7 @@ macro (HDF_IMPORT_SET_LIB_OPTIONS libtarget libname libtype libversion) if (${importtype} MATCHES "IMPORT") set (importprefix "${CMAKE_STATIC_LIBRARY_PREFIX}") endif () - if (${CMAKE_BUILD_TYPE} MATCHES "Debug") + if (${HDF_CFG_NAME} MATCHES "Debug") set (IMPORT_LIB_NAME ${LIB_DEBUG_NAME}) else () set (IMPORT_LIB_NAME ${LIB_RELEASE_NAME}) @@ -273,7 +273,7 @@ macro (HDF_README_PROPERTIES target_fortran) set (BINARY_PLATFORM "${BINARY_PLATFORM}, using VISUAL STUDIO 2015") else () set (BINARY_PLATFORM "${BINARY_PLATFORM}, using VISUAL STUDIO 2017") - endif () + endif () else () set (BINARY_PLATFORM "${BINARY_PLATFORM}, using VISUAL STUDIO ${CMAKE_C_COMPILER_VERSION}") endif () @@ -397,7 +397,7 @@ macro (HDF_DIR_PATHS package_prefix) ) get_property(_isMultiConfig GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) if(_isMultiConfig) - set (CMAKE_TEST_OUTPUT_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_BUILD_TYPE}) + set (CMAKE_TEST_OUTPUT_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${HDF_BUILD_TYPE}) set (CMAKE_PDB_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin CACHE PATH "Single Directory for all pdb files." ) diff --git a/java/src/hdf/hdf5lib/H5.java b/java/src/hdf/hdf5lib/H5.java index 40a6358..03266e6 100644 --- a/java/src/hdf/hdf5lib/H5.java +++ b/java/src/hdf/hdf5lib/H5.java @@ -57,21 +57,21 @@ import hdf.hdf5lib.structs.H5O_info_t; /** * This class is the Java interface for the HDF5 library. *

- * This code is the called by Java programs to access the entry points of the HDF5 library. Each routine wraps a single - * HDF5 entry point, generally with the arguments and return codes analogous to the C interface. + * This code is the called by Java programs to access the entry points of the HDF5 library. Each + * routine wraps a single HDF5 entry point, generally with the arguments and return codes analogous + * to the C interface. *

- * For details of the HDF5 library, see the HDF5 Documentation at: http://hdfgroup.org/HDF5/ + * For details of the HDF5 library, see the HDF5 Documentation at: + * http://hdfgroup.org/HDF5/ *


*

* Mapping of arguments for Java * *

- * In general, arguments to the HDF Java API are straightforward translations from the 'C' API described in the HDF - * Reference Manual. + * In general, arguments to the HDF Java API are straightforward translations from the 'C' API + * described in the HDF Reference Manual. * - *

- * + *
* * * @@ -107,20 +107,21 @@ import hdf.hdf5lib.structs.H5O_info_t; * * *
HDF-5 C types to Java types
HDF-5Special -- see HDFArray
- *
- *
General Rules for Passing Arguments and Results
+ * General Rules for Passing Arguments and Results *

- * In general, arguments passed IN to Java are the analogous basic types, as above. The exception is for arrays, - * which are discussed below. + * In general, arguments passed IN to Java are the analogous basic types, as above. The + * exception is for arrays, which are discussed below. *

- * The return value of Java methods is also the analogous type, as above. A major exception to that rule is that - * all HDF functions that return SUCCEED/FAIL are declared boolean in the Java version, rather than int as - * in the C. Functions that return a value or else FAIL are declared the equivalent to the C function. However, in most - * cases the Java method will raise an exception instead of returning an error code. See Errors and - * Exceptions below. + * The return value of Java methods is also the analogous type, as above. A major exception + * to that rule is that all HDF functions that return SUCCEED/FAIL are declared boolean in + * the Java version, rather than int as in the C. Functions that return a value or else FAIL + * are declared the equivalent to the C function. However, in most cases the Java method will raise + * an exception instead of returning an error code. See Errors and Exceptions + * below. *

- * Java does not support pass by reference of arguments, so arguments that are returned through OUT parameters - * must be wrapped in an object or array. The Java API for HDF consistently wraps arguments in arrays. + * Java does not support pass by reference of arguments, so arguments that are returned through + * OUT parameters must be wrapped in an object or array. The Java API for HDF consistently + * wraps arguments in arrays. *

* For instance, a function that returns two integers is declared: * @@ -141,12 +142,14 @@ import hdf.hdf5lib.structs.H5O_info_t; * * *

- * All the routines where this convention is used will have specific documentation of the details, given below. + * All the routines where this convention is used will have specific documentation of the details, + * given below. *

- * Arrays + * Arrays *

- * HDF5 needs to read and write multi-dimensional arrays of any number type (and records). The HDF5 API describes the - * layout of the source and destination, and the data for the array passed as a block of bytes, for instance, + * HDF5 needs to read and write multi-dimensional arrays of any number type (and records). The HDF5 + * API describes the layout of the source and destination, and the data for the array passed as a + * block of bytes, for instance, * *

  *      herr_t H5Dread(long fid, long filetype, long memtype, long memspace,
@@ -154,40 +157,45 @@ import hdf.hdf5lib.structs.H5O_info_t;
  * 
* *

- * where ``void *'' means that the data may be any valid numeric type, and is a contiguous block of bytes that is the - * data for a multi-dimensional array. The other parameters describe the dimensions, rank, and datatype of the array on - * disk (source) and in memory (destination). + * where ``void *'' means that the data may be any valid numeric type, and is a contiguous block of + * bytes that is the data for a multi-dimensional array. The other parameters describe the + * dimensions, rank, and datatype of the array on disk (source) and in memory (destination). *

- * For Java, this ``ANY'' is a problem, as the type of data must always be declared. Furthermore, multidimensional - * arrays are definitely not layed out contiguously in memory. It would be infeasible to declare a separate - * routine for every combination of number type and dimensionality. For that reason, the HDFArray class is used to discover the type, shape, and size of the - * data array at run time, and to convert to and from a contiguous array of bytes in synchronized static native C order. + * For Java, this ``ANY'' is a problem, as the type of data must always be declared. Furthermore, + * multidimensional arrays are definitely not layed out contiguously in memory. It would be + * infeasible to declare a separate routine for every combination of number type and dimensionality. + * For that reason, the HDFArray class is used to + * discover the type, shape, and size of the data array at run time, and to convert to and from a + * contiguous array of bytes in synchronized static native C order. *

- * The upshot is that any Java array of numbers (either primitive or sub-classes of type Number) can be passed as - * an ``Object'', and the Java API will translate to and from the appropriate packed array of bytes needed by the C - * library. So the function above would be declared: + * The upshot is that any Java array of numbers (either primitive or sub-classes of type + * Number) can be passed as an ``Object'', and the Java API will translate to and from the + * appropriate packed array of bytes needed by the C library. So the function above would be + * declared: * *

  * public synchronized static native int H5Dread(long fid, long filetype, long memtype, long memspace, Object data);
  * 
- * OPEN_IDS.addElement(id); - - * and the parameter data can be any multi-dimensional array of numbers, such as float[][], or int[][][], or - * Double[][]. + * + * OPEN_IDS.addElement(id); + * + * and the parameter data can be any multi-dimensional array of numbers, such as float[][], + * or int[][][], or Double[][]. *

- * HDF-5 Constants + * HDF-5 Constants *

- * The HDF-5 API defines a set of constants and enumerated values. Most of these values are available to Java programs - * via the class HDF5Constants. For example, the parameters for - * the h5open() call include two numeric values, HDFConstants.H5F_ACC_RDWR and - * HDF5Constants.H5P_DEFAULT. As would be expected, these numbers correspond to the C constants - * H5F_ACC_RDWR and H5P_DEFAULT. + * The HDF-5 API defines a set of constants and enumerated values. Most of these values are + * available to Java programs via the class + * HDF5Constants. For example, the parameters for the h5open() call include two numeric + * values, HDFConstants.H5F_ACC_RDWR and HDF5Constants.H5P_DEFAULT. As + * would be expected, these numbers correspond to the C constants H5F_ACC_RDWR and + * H5P_DEFAULT. *

- * The HDF-5 API defines a set of values that describe number types and sizes, such as "H5T_NATIVE_INT" and "hsize_t". - * These values are determined at run time by the HDF-5 C library. To support these parameters, the Java class HDF5CDataTypes looks up the values when initiated. The values - * can be accessed as public variables of the Java class, such as: + * The HDF-5 API defines a set of values that describe number types and sizes, such as + * "H5T_NATIVE_INT" and "hsize_t". These values are determined at run time by the HDF-5 C library. + * To support these parameters, the Java class + * HDF5CDataTypes looks up the values when initiated. The values can be accessed as + * public variables of the Java class, such as: * *

  * long data_type = HDF5CDataTypes.JH5T_NATIVE_INT;
@@ -196,22 +204,23 @@ import hdf.hdf5lib.structs.H5O_info_t;
  * The Java application uses both types of constants the same way, the only difference is that the
  * HDF5CDataTypes may have different values on different platforms.
  * 

- * Error handling and Exceptions + * Error handling and Exceptions *

- * The HDF5 error API (H5E) manages the behavior of the error stack in the HDF-5 library. This API is omitted from the - * JHI5. Errors are converted into Java exceptions. This is totally different from the C interface, but is very natural - * for Java programming. + * The HDF5 error API (H5E) manages the behavior of the error stack in the HDF-5 library. This API + * is omitted from the JHI5. Errors are converted into Java exceptions. This is totally different + * from the C interface, but is very natural for Java programming. *

- * The exceptions of the JHI5 are organized as sub-classes of the class HDF5Exception. There are two subclasses of - * HDF5Exception, HDF5LibraryException - * and HDF5JavaException. The sub-classes of the - * former represent errors from the HDF-5 C library, while sub-classes of the latter represent errors in the JHI5 - * wrapper and support code. + * The exceptions of the JHI5 are organized as sub-classes of the class + * HDF5Exception. There are two + * subclasses of HDF5Exception, + * HDF5LibraryException and + * HDF5JavaException. The sub-classes of the former represent errors from the HDF-5 C + * library, while sub-classes of the latter represent errors in the JHI5 wrapper and support code. *

- * The super-class HDF5LibraryException implements the method 'printStackTrace()', which - * prints out the HDF-5 error stack, as described in the HDF-5 C API H5Eprint(). This may be used by Java - * exception handlers to print out the HDF-5 error stack. + * The super-class HDF5LibraryException implements the method + * 'printStackTrace()', which prints out the HDF-5 error stack, as described in the + * HDF-5 C API H5Eprint(). This may be used by Java exception handlers to print out + * the HDF-5 error stack. *


* * @version HDF5 1.10.5
diff --git a/java/src/hdf/overview.html b/java/src/hdf/overview.html index edb1b76..e3a032b 100644 --- a/java/src/hdf/overview.html +++ b/java/src/hdf/overview.html @@ -90,8 +90,7 @@ like this: The H5 class automatically loads the native method implementations and the HDF5 library. -

-To Obtain

+

To Obtain

The JHI5 is included with the HDF5 library. -- cgit v0.12 From 217d57d30d2d62f987affcc8859df982dc86d2b3 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 24 Jan 2019 16:37:04 -0600 Subject: CMake fix --- config/cmake_ext_mod/HDFMacros.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/cmake_ext_mod/HDFMacros.cmake b/config/cmake_ext_mod/HDFMacros.cmake index 77980c0..27d730b 100644 --- a/config/cmake_ext_mod/HDFMacros.cmake +++ b/config/cmake_ext_mod/HDFMacros.cmake @@ -397,7 +397,7 @@ macro (HDF_DIR_PATHS package_prefix) ) get_property(_isMultiConfig GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) if(_isMultiConfig) - set (CMAKE_TEST_OUTPUT_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${HDF_BUILD_TYPE}) + set (CMAKE_TEST_OUTPUT_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_BUILD_TYPE}) set (CMAKE_PDB_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin CACHE PATH "Single Directory for all pdb files." ) -- cgit v0.12 From d0abe6502af9846f77a647fddb0fda1da11a0a75 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Fri, 25 Jan 2019 12:13:20 -0600 Subject: CMake fix, makefile fix, direct_chunk valgrind fix --- config/cmake_ext_mod/HDFMacros.cmake | 2 +- src/Makefile.am | 2 +- test/direct_chunk.c | 182 +++++++++++++++++------------------ 3 files changed, 93 insertions(+), 93 deletions(-) diff --git a/config/cmake_ext_mod/HDFMacros.cmake b/config/cmake_ext_mod/HDFMacros.cmake index 27d730b..b3d97ce 100644 --- a/config/cmake_ext_mod/HDFMacros.cmake +++ b/config/cmake_ext_mod/HDFMacros.cmake @@ -14,7 +14,7 @@ macro (SET_HDF_BUILD_TYPE) get_property(_isMultiConfig GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) if(_isMultiConfig) - set(HDF_CFG_NAME ${CTEST_CONFIGURATION_TYPE}) + set(HDF_CFG_NAME \${CTEST_CONFIGURATION_TYPE}) set(HDF_BUILD_TYPE ${CMAKE_CFG_INTDIR}) set(HDF_CFG_BUILD_TYPE \${CMAKE_INSTALL_CONFIG_NAME}) else() diff --git a/src/Makefile.am b/src/Makefile.am index 10ef8c6..7d472f3 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -80,7 +80,7 @@ libhdf5_la_SOURCES= H5.c H5checksum.c H5dbg.c H5system.c H5timer.c H5trace.c \ H5HP.c H5I.c H5Itest.c H5L.c H5Lexternal.c H5lib_settings.c \ H5MF.c H5MFaggr.c H5MFdbg.c H5MFsection.c \ H5MM.c H5MP.c H5MPtest.c \ - H5O.c H5Odeprec.c H5Oainfo.c H5Oalloc.c H5Oattr.c \ + H5O.c H5Oainfo.c H5Oalloc.c H5Oattr.c \ H5Oattribute.c H5Obogus.c H5Obtreek.c H5Ocache.c H5Ocache_image.c \ H5Ochunk.c \ H5Ocont.c H5Ocopy.c H5Odbg.c H5Odrvinfo.c H5Odtype.c H5Oefl.c \ diff --git a/test/direct_chunk.c b/test/direct_chunk.c index 2ef38ea..1c5862d 100644 --- a/test/direct_chunk.c +++ b/test/direct_chunk.c @@ -13,7 +13,7 @@ #include "h5test.h" -#if defined(H5_HAVE_ZLIB_H) && !defined(H5_ZLIB_HEADER) +#if defined(H5_HAVE_ZLIB_H) && !defined(H5_ZLIB_HEADER) # define H5_ZLIB_HEADER "zlib.h" #endif #if defined(H5_ZLIB_HEADER) @@ -46,10 +46,10 @@ #define DEFLATE_SIZE_ADJUST(s) (HDceil(((double)(s))*H5_DOUBLE(1.001))+H5_DOUBLE(12.0)) /* Temporary filter IDs used for testing */ -#define H5Z_FILTER_BOGUS1 305 -#define H5Z_FILTER_BOGUS2 306 -#define ADD_ON 7 -#define FACTOR 3 +#define H5Z_FILTER_BOGUS1 305 +#define H5Z_FILTER_BOGUS2 306 +#define ADD_ON 7 +#define FACTOR 3 /* Constants for the overwrite test */ #define OVERWRITE_NDIMS 3 @@ -75,33 +75,33 @@ static size_t filter_bogus2(unsigned int flags, size_t cd_nelmts, /* This message derives from H5Z */ const H5Z_class2_t H5Z_BOGUS1[1] = {{ H5Z_CLASS_T_VERS, /* H5Z_class_t version */ - H5Z_FILTER_BOGUS1, /* Filter id number */ + H5Z_FILTER_BOGUS1, /* Filter id number */ 1, 1, /* Encoding and decoding enabled */ - "bogus1", /* Filter name for debugging */ + "bogus1", /* Filter name for debugging */ NULL, /* The "can apply" callback */ NULL, /* The "set local" callback */ - filter_bogus1, /* The actual filter function */ + filter_bogus1, /* The actual filter function */ }}; const H5Z_class2_t H5Z_BOGUS2[1] = {{ H5Z_CLASS_T_VERS, /* H5Z_class_t version */ - H5Z_FILTER_BOGUS2, /* Filter id number */ + H5Z_FILTER_BOGUS2, /* Filter id number */ 1, 1, /* Encoding and decoding enabled */ - "bogus2", /* Filter name for debugging */ + "bogus2", /* Filter name for debugging */ NULL, /* The "can apply" callback */ NULL, /* The "set local" callback */ - filter_bogus2, /* The actual filter function */ + filter_bogus2, /* The actual filter function */ }}; /*------------------------------------------------------------------------- - * Function: test_direct_chunk_write + * Function: test_direct_chunk_write * - * Purpose: Test the basic functionality of H5Dwrite_chunk + * Purpose: Test the basic functionality of H5Dwrite_chunk * - * Return: Success: 0 - * Failure: 1 + * Return: Success: 0 + * Failure: 1 * - * Programmer: Raymond Lu + * Programmer: Raymond Lu * 30 November 2012 * *------------------------------------------------------------------------- @@ -113,7 +113,7 @@ test_direct_chunk_write (hid_t file) hid_t dataspace = -1, dataset = -1; hid_t mem_space = -1; hid_t cparms = -1, dxpl = -1; - hsize_t dims[2] = {NX, NY}; + hsize_t dims[2] = {NX, NY}; hsize_t maxdims[2] = {H5S_UNLIMITED, H5S_UNLIMITED}; hsize_t chunk_dims[2] ={CHUNK_NX, CHUNK_NY}; herr_t status; @@ -128,11 +128,11 @@ test_direct_chunk_write (hid_t file) size_t buf_size = CHUNK_NX*CHUNK_NY*sizeof(int); const Bytef *z_src = (const Bytef*)(direct_buf); - Bytef *z_dst = NULL; /*destination buffer */ - uLongf z_dst_nbytes = (uLongf)DEFLATE_SIZE_ADJUST(buf_size); - uLong z_src_nbytes = (uLong)buf_size; + Bytef *z_dst = NULL; /*destination buffer */ + uLongf z_dst_nbytes = (uLongf)DEFLATE_SIZE_ADJUST(buf_size); + uLong z_src_nbytes = (uLong)buf_size; int aggression = 9; /* Compression aggression setting */ - void *outbuf = NULL; /* Pointer to new buffer */ + void *outbuf = NULL; /* Pointer to new buffer */ hsize_t start[2]; /* Start of hyperslab */ hsize_t stride[2]; /* Stride of hyperslab */ @@ -167,29 +167,29 @@ test_direct_chunk_write (hid_t file) * creation properties. */ if((dataset = H5Dcreate2(file, DATASETNAME1, H5T_NATIVE_INT, dataspace, H5P_DEFAULT, - cparms, H5P_DEFAULT)) < 0) + cparms, H5P_DEFAULT)) < 0) goto error; /* Initialize the dataset */ for(i = n = 0; i < NX; i++) for(j = 0; j < NY; j++) - data[i][j] = n++; + data[i][j] = n++; if((dxpl = H5Pcreate(H5P_DATASET_XFER)) < 0) goto error; /* * Write the data for the dataset. It should stay in the chunk cache. - * It will be evicted from the cache by the H5Dwrite_chunk calls. + * It will be evicted from the cache by the H5Dwrite_chunk calls. */ if((status = H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, - dxpl, data)) < 0) + dxpl, data)) < 0) goto error; /* Initialize data for one chunk */ for(i = n = 0; i < CHUNK_NX; i++) for(j = 0; j < CHUNK_NY; j++) - direct_buf[i][j] = n++; + direct_buf[i][j] = n++; /* Allocate output (compressed) buffer */ outbuf = HDmalloc(z_dst_nbytes); @@ -210,8 +210,8 @@ test_direct_chunk_write (hid_t file) goto error; } - /* Write the compressed chunk data repeatedly to cover all the chunks in the - * dataset, using the direct writing function. */ + /* Write the compressed chunk data repeatedly to cover all the chunks in the + * dataset, using the direct writing function. */ for(i=0; i Date: Sun, 27 Jan 2019 17:04:33 -0600 Subject: Revert CMake and fix H5Oget_info - H5Ovisit versions --- config/cmake_ext_mod/HDFMacros.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/cmake_ext_mod/HDFMacros.cmake b/config/cmake_ext_mod/HDFMacros.cmake index b3d97ce..2f4ce52 100644 --- a/config/cmake_ext_mod/HDFMacros.cmake +++ b/config/cmake_ext_mod/HDFMacros.cmake @@ -14,7 +14,7 @@ macro (SET_HDF_BUILD_TYPE) get_property(_isMultiConfig GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) if(_isMultiConfig) - set(HDF_CFG_NAME \${CTEST_CONFIGURATION_TYPE}) + set(HDF_CFG_NAME ${CMAKE_BUILD_TYPE}) set(HDF_BUILD_TYPE ${CMAKE_CFG_INTDIR}) set(HDF_CFG_BUILD_TYPE \${CMAKE_INSTALL_CONFIG_NAME}) else() -- cgit v0.12 From fec7c48a4b2504f0ee6304534dd8f742a08ee05a Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 28 Jan 2019 08:22:28 -0600 Subject: Remove Not_yet_versioned files --- src/H5vers.txt | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/H5vers.txt b/src/H5vers.txt index 914c30e..0303bf5 100644 --- a/src/H5vers.txt +++ b/src/H5vers.txt @@ -56,11 +56,6 @@ FUNCTION: H5Ewalk; H5E_walk, H5E_error; v10, v18 FUNCTION: H5Fget_info; H5F_info; v18, v110 FUNCTION: H5Gcreate; ; v10, v18 FUNCTION: H5Gopen; ; v10, v18 -FUNCTION: H5Oget_info; ; v18, v112 -FUNCTION: H5Oget_info_by_name; ; v18, v112 -FUNCTION: H5Oget_info_by_idx; ; v18, v112 -FUNCTION: H5Ovisit; ; v18, v112 -FUNCTION: H5Ovisit_by_name; ; v18, v112 FUNCTION: H5Pget_filter; ; v10, v18 FUNCTION: H5Pget_filter_by_id; ; v16, v18 FUNCTION: H5Pinsert; ; v14, v18 -- cgit v0.12 From cfebcaa2a307192ae02d2afe859e8aa42ce76e1a Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 28 Jan 2019 09:39:58 -0600 Subject: HDFFV-10686 Remove version 1 reference names --- test/th5o.c | 88 ++++++++++++++++++++++++++++++------------------------------- 1 file changed, 44 insertions(+), 44 deletions(-) diff --git a/test/th5o.c b/test/th5o.c index 63fee5f..2949c4e 100644 --- a/test/th5o.c +++ b/test/th5o.c @@ -13,7 +13,7 @@ /*********************************************************** * -* Test program: th5o +* Test program: th5o * * Test public H5O functions for accessing * @@ -30,7 +30,7 @@ #define TEST6_DIM1 100 #define TEST6_DIM2 100 - + /**************************************************************** ** ** test_h5o_open(): Test H5Oopen function. @@ -140,7 +140,7 @@ test_h5o_open(void) } /* test_h5o_open() */ - + /**************************************************************** ** ** test_h5o_close(): Test H5Oclose function. @@ -230,7 +230,7 @@ test_h5o_close(void) CHECK(ret, FAIL, "H5Fclose"); } - + /**************************************************************** ** ** test_h5o_open_by_addr(): Test H5Oopen_by_addr function. @@ -367,7 +367,7 @@ test_h5o_open_by_addr(void) VERIFY(dtype, FAIL, "H5Oopen_by_addr"); } /* test_h5o_open_by_addr() */ - + /**************************************************************** ** ** test_h5o_refcount(): Test H5O refcounting functions. @@ -378,7 +378,7 @@ test_h5o_refcount(void) { hid_t fid; /* HDF5 File ID */ hid_t grp, dset, dtype, dspace; /* Object identifiers */ - H5O_info_t oinfo; /* Object info struct */ + H5O_info_t oinfo; /* Object info struct */ hsize_t dims[RANK]; herr_t ret; /* Value returned from API calls */ @@ -562,7 +562,7 @@ test_h5o_refcount(void) CHECK(ret, FAIL, "H5Fclose"); } /* test_h5o_refcount() */ - + /**************************************************************** ** ** test_h5o_plist(): Test object creation properties @@ -756,7 +756,7 @@ test_h5o_plist(void) CHECK(ret, FAIL, "H5Pclose"); } /* test_h5o_plist() */ - + /**************************************************************** ** ** test_h5o_link(): Test creating link to object @@ -850,7 +850,7 @@ test_h5o_link(void) /* Verify the data */ for(i = 0; i < (TEST6_DIM1 * TEST6_DIM2); i++) VERIFY(wdata[i], rdata[i], "H5Dread"); - + /* Create a group with no name*/ group_id = H5Gcreate_anon(file_id, H5P_DEFAULT, H5P_DEFAULT); CHECK(group_id, FAIL, "H5Gcreate_anon"); @@ -910,7 +910,7 @@ test_h5o_link(void) HDfree(rdata); } /* end test_h5o_link() */ - + /**************************************************************** ** ** test_h5o_comment(): Test H5Oset(get)_comment functions. @@ -1083,7 +1083,7 @@ test_h5o_comment(void) } /* test_h5o_comment() */ - + /**************************************************************** ** ** test_h5o_comment_by_name(): Test H5Oset(get)_comment_by_name functions. @@ -1242,7 +1242,7 @@ test_h5o_comment_by_name(void) } /* test_h5o_comment_by_name() */ - + /**************************************************************** ** ** test_h5o_getinfo_same_file(): Test that querying the object info for @@ -1254,7 +1254,7 @@ test_h5o_getinfo_same_file(void) { hid_t fid1, fid2; /* HDF5 File ID */ hid_t gid1, gid2; /* Group IDs */ - H5O_info_t oinfo1, oinfo2; /* Object info structs */ + H5O_info_t oinfo1, oinfo2; /* Object info structs */ herr_t ret; /* Value returned from API calls */ /* Create a new HDF5 file */ @@ -1353,7 +1353,7 @@ test_h5o_getinfo_same_file(void) /**************************************************************** ** ** visit_obj_cb(): -** This is the callback function invoked by H5Ovisit1() in +** This is the callback function invoked by H5Ovisit() in ** test_h5o_getinfo_visit(): ** --Verify that the object info returned to the callback ** function is the same as H5Oget_info2(). @@ -1368,27 +1368,27 @@ visit_obj_cb(hid_t group_id, const char *name, const H5O_info_t *oinfo1, /* Verify the object info for "group1", "group2" and the root group */ if(!(HDstrcmp(name, "group1"))) { H5Oget_info_by_name2(group_id, name, &oinfo2, H5O_INFO_NUM_ATTRS, H5P_DEFAULT); - VERIFY(oinfo1->num_attrs, oinfo2.num_attrs, "obj info from H5Ovisit1"); + VERIFY(oinfo1->num_attrs, oinfo2.num_attrs, "obj info from H5Ovisit"); } else if(!(HDstrcmp(name, "group2"))) { H5Oget_info_by_name2(group_id, name, &oinfo2, H5O_INFO_HDR, H5P_DEFAULT); - VERIFY(oinfo1->hdr.nmesgs, oinfo2.hdr.nmesgs, "obj info from H5Ovisit1/H5Oget_info2"); - VERIFY(oinfo1->hdr.nchunks, oinfo2.hdr.nchunks, "obj info from H5Ovisit1/H5Oget_info2"); + VERIFY(oinfo1->hdr.nmesgs, oinfo2.hdr.nmesgs, "obj info from H5Ovisit/H5Oget_info2"); + VERIFY(oinfo1->hdr.nchunks, oinfo2.hdr.nchunks, "obj info from H5Ovisit/H5Oget_info2"); } else if(!(HDstrcmp(name, "."))) { H5Oget_info_by_name2(group_id, name, &oinfo2, H5O_INFO_META_SIZE, H5P_DEFAULT); - VERIFY(oinfo1->meta_size.obj.index_size, oinfo2.meta_size.obj.index_size, "obj info from H5Ovisit1/H5Oget_info2"); - VERIFY(oinfo1->meta_size.obj.heap_size, oinfo2.meta_size.obj.heap_size, "obj info from H5Ovisit1/H5Oget_info2"); + VERIFY(oinfo1->meta_size.obj.index_size, oinfo2.meta_size.obj.index_size, "obj info from H5Ovisit/H5Oget_info2"); + VERIFY(oinfo1->meta_size.obj.heap_size, oinfo2.meta_size.obj.heap_size, "obj info from H5Ovisit/H5Oget_info2"); } return(H5_ITER_CONT); } /* end visit_obj_cb() */ - + /**************************************************************** ** -** test_h5o_getinfo_visit(): -** Verify that the object info returned via H5Oget_info1() +** test_h5o_getinfo_visit(): +** Verify that the object info returned via H5Oget_info() ** and H5Oget_info2() are the same. -** Verify that the object info retrieved via H5Ovisit1() is +** Verify that the object info retrieved via H5Ovisit() is ** the same as H5Oget_info2(). ** ****************************************************************/ @@ -1436,31 +1436,31 @@ test_h5o_getinfo_visit(void) HDmemset(&oinfo1, 0, sizeof(oinfo1)); HDmemset(&oinfo2, 0, sizeof(oinfo2)); - /* Query the object info for "group1" via H5Oget_info1 and H5Oget_info2 */ - ret = H5Oget_info1(gid1, &oinfo1); + /* Query the object info for "group1" via H5Oget_info and H5Oget_info2 */ + ret = H5Oget_info(gid1, &oinfo1); CHECK(ret, FAIL, "H5Oget_info"); ret = H5Oget_info2(gid1, &oinfo2, H5O_INFO_BASIC|H5O_INFO_NUM_ATTRS); CHECK(ret, FAIL, "H5Oget_info"); /* Verify the object info for "group1" is correct */ - VERIFY(oinfo1.fileno, oinfo2.fileno, "obj info from H5Oget_info1/2"); - VERIFY(oinfo1.num_attrs, oinfo2.num_attrs, "obj info from H5Oget_info1/2"); + VERIFY(oinfo1.fileno, oinfo2.fileno, "obj info from H5Oget_info/2"); + VERIFY(oinfo1.num_attrs, oinfo2.num_attrs, "obj info from H5Oget_info/2"); /* Reset object info */ HDmemset(&oinfo1, 0, sizeof(oinfo1)); HDmemset(&oinfo2, 0, sizeof(oinfo2)); - /* Query the object info for "group2" via H5Oget_info1 and H5Oget_info2 */ - ret = H5Oget_info_by_name1(fid, "group2", &oinfo1, H5P_DEFAULT); + /* Query the object info for "group2" via H5Oget_info_by_name and H5Oget_info_by_name2 */ + ret = H5Oget_info_by_name(fid, "group2", &oinfo1, H5P_DEFAULT); CHECK(ret, FAIL, "H5Oget_info_by_name"); ret = H5Oget_info_by_name2(fid, "group2", &oinfo2, H5O_INFO_HDR|H5O_INFO_META_SIZE, H5P_DEFAULT); CHECK(ret, FAIL, "H5Oget_info_by_name"); /* Verify the object info for "group2" is correct */ - VERIFY(oinfo1.hdr.nmesgs, oinfo2.hdr.nmesgs, "obj info from H5Oget_info1/2"); - VERIFY(oinfo1.hdr.nchunks, oinfo2.hdr.nchunks, "obj info from H5Oget_info1/2"); - VERIFY(oinfo1.meta_size.obj.index_size, oinfo2.meta_size.obj.index_size, "obj info from H5Oget_info1/2"); - VERIFY(oinfo1.meta_size.obj.heap_size, oinfo2.meta_size.obj.heap_size, "obj info from H5Oget_info1/2"); + VERIFY(oinfo1.hdr.nmesgs, oinfo2.hdr.nmesgs, "obj info from H5Oget_info_by_name/2"); + VERIFY(oinfo1.hdr.nchunks, oinfo2.hdr.nchunks, "obj info from H5Oget_info_by_name/2"); + VERIFY(oinfo1.meta_size.obj.index_size, oinfo2.meta_size.obj.index_size, "obj info from H5Oget_info_by_name/2"); + VERIFY(oinfo1.meta_size.obj.heap_size, oinfo2.meta_size.obj.heap_size, "obj info from H5Oget_info_by_name/2"); /* Close everything */ ret = H5Gclose(gid1); @@ -1469,7 +1469,7 @@ test_h5o_getinfo_visit(void) CHECK(ret, FAIL, "H5Gclose"); /* Verify the object info returned to the callback function is correct */ - ret = H5Ovisit1(fid, H5_INDEX_NAME, H5_ITER_INC, visit_obj_cb, NULL); + ret = H5Ovisit(fid, H5_INDEX_NAME, H5_ITER_INC, visit_obj_cb, NULL); /* Close the file */ ret = H5Fclose(fid); @@ -1479,7 +1479,7 @@ test_h5o_getinfo_visit(void) #endif /* H5_NO_DEPRECATED_SYMBOLS */ - + /**************************************************************** ** ** test_h5o(): Main H5O (generic object) testing routine. @@ -1491,9 +1491,9 @@ test_h5o(void) /* Output message about test being performed */ MESSAGE(5, ("Testing Objects\n")); - test_h5o_open(); /* Test generic open function */ - test_h5o_open_by_addr(); /* Test opening objects by address */ - test_h5o_close(); /* Test generic close function */ + test_h5o_open(); /* Test generic open function */ + test_h5o_open_by_addr(); /* Test opening objects by address */ + test_h5o_close(); /* Test generic close function */ test_h5o_refcount(); /* Test incrementing and decrementing reference count */ test_h5o_plist(); /* Test object creation properties */ test_h5o_link(); /* Test object link routine */ @@ -1501,19 +1501,19 @@ test_h5o(void) test_h5o_comment_by_name(); /* Test routines for comment by name */ test_h5o_getinfo_same_file(); /* Test info for objects in the same file */ #ifndef H5_NO_DEPRECATED_SYMBOLS - test_h5o_getinfo_visit(); /* Test object info for H5Oget_info1/2 and H5Ovisit1 */ + test_h5o_getinfo_visit(); /* Test object info for H5Oget_info/2 and H5Ovisit */ #endif } /* test_h5o() */ - + /*------------------------------------------------------------------------- - * Function: cleanup_h5o + * Function: cleanup_h5o * - * Purpose: Cleanup temporary test files + * Purpose: Cleanup temporary test files * - * Return: none + * Return: none * - * Programmer: James Laird + * Programmer: James Laird * June 3, 2006 * *------------------------------------------------------------------------- -- cgit v0.12 From a09bcbcb07609ee38a1ccbcfafd4fd5a9dbe27f5 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Fri, 25 Jan 2019 09:58:50 -0800 Subject: Fixed a bug identified by valgrind in the cork test. --- test/cork.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/test/cork.c b/test/cork.c index dceaf5a..240be77 100644 --- a/test/cork.c +++ b/test/cork.c @@ -286,19 +286,19 @@ static unsigned verify_obj_dset_cork(hbool_t swmr) { /* Variable Declarations */ - hid_t fid = -1; /* File ID */ + hid_t fid = -1; /* File ID */ hid_t fapl = -1; /* File access property list */ hid_t aid = -1; /* Attribute ID */ hid_t sid = -1, sid2 = -1; /* Dataspace IDs */ hid_t did = -1, did2 = -1; /* Dataset IDs */ hid_t oid = -1; /* Object ID */ - hid_t dcpl2; /* Dataset creation property list */ + hid_t dcpl2; /* Dataset creation property list */ int i = 0; /* Local index variable */ - hsize_t dim[1] = {100}; /* Dataset dimension size */ + hsize_t dim[1] = {100}; /* Dataset dimension size */ hsize_t chunk_dim[1] = {7}; /* Dataset chunk dimension size */ H5O_info_t oinfo, oinfo2; /* Object metadata information */ char attrname[500]; /* Name of attribute */ - unsigned flags; /* File access flags */ + unsigned flags; /* File access flags */ if(swmr) { TESTING("cork status for dataset objects with attributes (SWMR)"); @@ -341,7 +341,7 @@ verify_obj_dset_cork(hbool_t swmr) TEST_ERROR /* Attach and write to an attribute to the dataset: DSET */ - if((aid = H5Acreate2(did, ATTR, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT)) < 0) + if((aid = H5Acreate2(did, ATTR, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR /* Verify cork status of the dataset: DSET */ @@ -380,11 +380,11 @@ verify_obj_dset_cork(hbool_t swmr) TEST_ERROR /* Attach 8 attributes to the dataset */ - for(i = 0;i < 8; i++) { - sprintf(attrname, "attr %d", i); - if((aid = H5Acreate2(did2, attrname, H5T_NATIVE_UINT, sid2, H5P_DEFAULT, H5P_DEFAULT)) < 0) + for(i = 0; i < 8; i++) { + HDsprintf(attrname, "attr %d", i); + if((aid = H5Acreate2(did2, attrname, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR - if(H5Awrite(aid, H5T_NATIVE_UINT, &i) < 0) + if(H5Awrite(aid, H5T_NATIVE_INT, &i) < 0) TEST_ERROR if(H5Aclose(aid) < 0) TEST_ERROR -- cgit v0.12 From ec42c4e3e141ba4df343be8e519cb704676a5424 Mon Sep 17 00:00:00 2001 From: Neil Fortner Date: Tue, 29 Jan 2019 10:22:18 -0600 Subject: Add RELEASE.txt note for unknown message fix (pull request 1448) --- release_docs/RELEASE.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 4c254ab..c7c3be3 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -333,6 +333,12 @@ Bug Fixes since HDF5-1.10.3 release (ADB - 2019/01/24, HDFFV-10686) + - Fixed a potential invalid memory access and failure that could occur when + decoding an unknown object header message (from a future version of the + library). + + (NAF - 2019/01/07) + - Deleting attributes in dense storage The library aborts with "infinite loop closing library" after -- cgit v0.12