From 6cbd463d411ebbd621adfb92034c434d41d9a58a Mon Sep 17 00:00:00 2001 From: Larry Knox Date: Wed, 14 Nov 2018 11:19:28 -0600 Subject: Add script and changes to wait for H5Tinit.c Add more sample batch scripts, specifically for sbatch, not for knl cross compile. Don't run parallel tests when no parallel test script is configured in HDF5options.cmake. --- MANIFEST | 5 + bin/batch/knl_ctestP.sl | 18 + bin/batch/knl_ctestS.sl | 17 + bin/batch/sbatch_ctestP.sl | 17 + bin/batch/sbatch_ctestS.sl | 16 + bin/batch/sbatch_ctestSP.sl | 3 - config/cmake/scripts/CTestScript.cmake | 609 +++++++++++++++++--------------- config/cmake/scripts/wait_H5Tinit.cmake | 10 + src/CMakeLists.txt | 25 +- 9 files changed, 416 insertions(+), 304 deletions(-) create mode 100644 bin/batch/knl_ctestP.sl create mode 100644 bin/batch/knl_ctestS.sl create mode 100644 bin/batch/sbatch_ctestP.sl create mode 100644 bin/batch/sbatch_ctestS.sl create mode 100755 config/cmake/scripts/wait_H5Tinit.cmake diff --git a/MANIFEST b/MANIFEST index e586b3b..e8ab7fe 100644 --- a/MANIFEST +++ b/MANIFEST @@ -92,8 +92,12 @@ ./bin/timekeeper _DO_NOT_DISTRIBUTE_ ./bin/trace ./bin/yodconfigure +./bin/batch/knl_ctestP.sl +./bin/batch/knl_ctestS.sl ./bin/batch/knl_ctestSP.sl ./bin/batch/knl_H5detect.sl.in.cmake +./bin/batch/sbatch_ctestS.sl +./bin/batch/sbatch_ctestP.sl ./bin/batch/sbatch_ctestSP.sl ./bin/pkgscrpts/h5rmflags _DO_NOT_DISTRIBUTE_ ./bin/pkgscrpts/makeHDF5BinaryTarfiles.pl _DO_NOT_DISTRIBUTE_ @@ -3323,6 +3327,7 @@ ./config/cmake/scripts/CTestScript.cmake ./config/cmake/scripts/HDF5config.cmake ./config/cmake/scripts/HDF5options.cmake +./config/cmake/scripts/wait_H5Tinit.cmake # Files generated by autogen ./aclocal.m4 diff --git a/bin/batch/knl_ctestP.sl b/bin/batch/knl_ctestP.sl new file mode 100644 index 0000000..3a03fe2 --- /dev/null +++ b/bin/batch/knl_ctestP.sl @@ -0,0 +1,18 @@ +#!/bin/bash + +#SBATCH -p knl -C quad,flat +#SBATCH --nodes=1 +#SBATCH -t 00:30:00 +#SBATCH --mail-type=BEGIN,END,FAIL +##SBATCH --mail-user=@sandia.gov +#SBATCH --export=ALL +#SBATCH --job-name=h5_ctestS + +cd build +#run parallel tests except t_cache_image test +CMD="ctest . -R TEST_PAR|PH5DIFF|PERFORM -E t_cache_image -C Release -T test" + +echo "Run $CMD. Test output will be in build/ctestP.out" +$CMD >& ctestP.out +echo "Done running $CMD" + diff --git a/bin/batch/knl_ctestS.sl b/bin/batch/knl_ctestS.sl new file mode 100644 index 0000000..5b77c5b --- /dev/null +++ b/bin/batch/knl_ctestS.sl @@ -0,0 +1,17 @@ +#!/bin/bash + +#SBATCH -p knl -C quad,flat +#SBATCH --nodes=1 +#SBATCH -t 00:30:00 +#SBATCH --mail-type=BEGIN,END,FAIL +##SBATCH --mail-user=@sandia.gov +#SBATCH --export=ALL +#SBATCH --job-name=h5_ctestS + +cd build +CMD="ctest . -E TEST_PAR|H5DIFF|PERFORM -C Release -j 32 -T test" + +echo "Run $CMD. Test output will be in build/ctestS.out" +$CMD >& ctestS.out +echo "Done running $CMD" + diff --git a/bin/batch/sbatch_ctestP.sl b/bin/batch/sbatch_ctestP.sl new file mode 100644 index 0000000..e967dce --- /dev/null +++ b/bin/batch/sbatch_ctestP.sl @@ -0,0 +1,17 @@ +#!/bin/bash + +#SBATCH --nodes=1 +#SBATCH -t 00:30:00 +#SBATCH --mail-type=BEGIN,END,FAIL +##SBATCH --mail-user=@sandia.gov +#SBATCH --export=ALL +#SBATCH --job-name=h5_ctestS + + +cd build +CMD="ctest . -R TEST_PAR|PH5DIFF|PERFORM -E t_cache_image -C Release -T test" + +echo "Run $CMD. Test output will be in build/ctestP.out" +$CMD >& ctestP.out +echo "Done running $CMD" + diff --git a/bin/batch/sbatch_ctestS.sl b/bin/batch/sbatch_ctestS.sl new file mode 100644 index 0000000..a103356 --- /dev/null +++ b/bin/batch/sbatch_ctestS.sl @@ -0,0 +1,16 @@ +#!/bin/bash + +#SBATCH --nodes=1 +#SBATCH -t 00:30:00 +#SBATCH --mail-type=BEGIN,END,FAIL +##SBATCH --mail-user=@sandia.gov +#SBATCH --export=ALL +#SBATCH --job-name=h5_ctestS + + +cd build +CMD="ctest . -E TEST_PAR|H5DIFF|PERFORM -C Release -j 32 -T test" + +echo "Run $CMD. Test output will be in build/ctestS.out" +$CMD >& ctestS.out +echo "Done running $CMD" diff --git a/bin/batch/sbatch_ctestSP.sl b/bin/batch/sbatch_ctestSP.sl index 56da347..5d79d9b 100644 --- a/bin/batch/sbatch_ctestSP.sl +++ b/bin/batch/sbatch_ctestSP.sl @@ -1,6 +1,5 @@ #!/bin/bash -#SBATCH -p knl -C quad,flat #SBATCH --nodes=1 #SBATCH -t 01:00:00 #SBATCH --mail-type=BEGIN,END,FAIL @@ -8,8 +7,6 @@ #SBATCH --export=ALL #SBATCH --job-name=h5_ctestS -module load cmake -module load craype-hugepages4M cd build CMD="ctest . -E TEST_PAR|H5DIFF|PERFORM -C Release -j 32 -T test" diff --git a/config/cmake/scripts/CTestScript.cmake b/config/cmake/scripts/CTestScript.cmake index 43cd48d..fd56ffa 100755 --- a/config/cmake/scripts/CTestScript.cmake +++ b/config/cmake/scripts/CTestScript.cmake @@ -9,298 +9,325 @@ # If you do not have access to either file, you may request a copy from # help@hdfgroup.org. # -cmake_minimum_required (VERSION 3.10) -######################################################## -# This dashboard is maintained by The HDF Group -# For any comments please contact cdashhelp@hdfgroup.org -# -######################################################## -# ----------------------------------------------------------- -# -- Get environment -# ----------------------------------------------------------- -if (NOT SITE_OS_NAME) - ## machine name not provided - attempt to discover with uname - ## -- set hostname - ## -------------------------- - find_program (HOSTNAME_CMD NAMES hostname) - exec_program (${HOSTNAME_CMD} ARGS OUTPUT_VARIABLE HOSTNAME) - set (CTEST_SITE "${HOSTNAME}${CTEST_SITE_EXT}") - find_program (UNAME NAMES uname) - macro (getuname name flag) - exec_program ("${UNAME}" ARGS "${flag}" OUTPUT_VARIABLE "${name}") - endmacro () - - getuname (osname -s) - getuname (osrel -r) - getuname (cpu -m) - message (STATUS "Dashboard script uname output: ${osname}-${osrel}-${cpu}\n") - - set (CTEST_BUILD_NAME "${osname}-${osrel}-${cpu}") - if (SITE_BUILDNAME_SUFFIX) - set (CTEST_BUILD_NAME "${SITE_BUILDNAME_SUFFIX}-${CTEST_BUILD_NAME}") - endif () - set (BUILD_OPTIONS "${ADD_BUILD_OPTIONS}") -else () - ## machine name provided - ## -------------------------- - if (CMAKE_HOST_UNIX) - set (CTEST_BUILD_NAME "${SITE_OS_NAME}-${SITE_OS_VERSION}-${SITE_OS_BITS}-${SITE_COMPILER_NAME}-${SITE_COMPILER_VERSION}") - else () - set (CTEST_BUILD_NAME "${SITE_OS_NAME}-${SITE_OS_VERSION}-${SITE_COMPILER_NAME}") - endif () - if (SITE_BUILDNAME_SUFFIX) - set (CTEST_BUILD_NAME "${CTEST_BUILD_NAME}-${SITE_BUILDNAME_SUFFIX}") - endif () - set (BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DSITE:STRING=${CTEST_SITE} -DBUILDNAME:STRING=${CTEST_BUILD_NAME}") -endif () - -#----------------------------------------------------------------------------- -# MAC machines need special option -#----------------------------------------------------------------------------- -if (APPLE) - # Compiler choice - execute_process (COMMAND xcrun --find cc OUTPUT_VARIABLE XCODE_CC OUTPUT_STRIP_TRAILING_WHITESPACE) - execute_process (COMMAND xcrun --find c++ OUTPUT_VARIABLE XCODE_CXX OUTPUT_STRIP_TRAILING_WHITESPACE) - set (ENV{CC} "${XCODE_CC}") - set (ENV{CXX} "${XCODE_CXX}") - - set (BUILD_OPTIONS "${BUILD_OPTIONS} -DCTEST_USE_LAUNCHERS:BOOL=ON -DCMAKE_BUILD_WITH_INSTALL_RPATH:BOOL=OFF") -endif () - -#----------------------------------------------------------------------------- -set (NEED_REPOSITORY_CHECKOUT 0) -set (CTEST_CMAKE_COMMAND "\"${CMAKE_COMMAND}\"") -if (CTEST_USE_TAR_SOURCE) - ## Uncompress source if tar file provided - ## -------------------------- - if (WIN32) - message (STATUS "extracting... [${CMAKE_EXECUTABLE_NAME} x ${CTEST_DASHBOARD_ROOT}\\${CTEST_USE_TAR_SOURCE}.zip]") - execute_process (COMMAND ${CMAKE_EXECUTABLE_NAME} -E tar -xvf ${CTEST_DASHBOARD_ROOT}\\${CTEST_USE_TAR_SOURCE}.zip RESULT_VARIABLE rv) - else () - message (STATUS "extracting... [${CMAKE_EXECUTABLE_NAME} -E tar -xvf ${CTEST_DASHBOARD_ROOT}/${CTEST_USE_TAR_SOURCE}.tar]") - execute_process (COMMAND ${CMAKE_EXECUTABLE_NAME} -E tar -xvf ${CTEST_DASHBOARD_ROOT}/${CTEST_USE_TAR_SOURCE}.tar RESULT_VARIABLE rv) - endif () - - if (NOT rv EQUAL 0) - message (STATUS "extracting... [error-(${rv}) clean up]") - file (REMOVE_RECURSE "${CTEST_SOURCE_DIRECTORY}") - message (FATAL_ERROR "error: extract of ${CTEST_USE_TAR_SOURCE} failed") - endif () - - file (RENAME ${CTEST_DASHBOARD_ROOT}/${CTEST_USE_TAR_SOURCE} ${CTEST_SOURCE_DIRECTORY}) - set (LOCAL_SKIP_UPDATE "TRUE") -else () - if (LOCAL_UPDATE) - if (CTEST_USE_GIT_SOURCE) - find_program (CTEST_GIT_COMMAND NAMES git git.cmd) - set (CTEST_GIT_UPDATE_OPTIONS) - - if (NOT EXISTS "${CTEST_SOURCE_DIRECTORY}") - set (NEED_REPOSITORY_CHECKOUT 1) - endif () - - if (${NEED_REPOSITORY_CHECKOUT}) - if (REPOSITORY_BRANCH) - set (CTEST_GIT_options "clone \"${REPOSITORY_URL}\" --branch \"${REPOSITORY_BRANCH}\" --single-branch \"${CTEST_SOURCE_DIRECTORY}\" --recurse-submodules") - else () - set (CTEST_GIT_options "clone \"${REPOSITORY_URL}\" \"${CTEST_SOURCE_DIRECTORY}\" --recurse-submodules") - endif () - set (CTEST_CHECKOUT_COMMAND "${CTEST_GIT_COMMAND} ${CTEST_GIT_options}") - else () - set (CTEST_GIT_options "pull") - endif () - set (CTEST_UPDATE_COMMAND "${CTEST_GIT_COMMAND}") - else () - ## -------------------------- - ## use subversion to get source - #----------------------------------------------------------------------------- - ## cygwin does not handle the find_package() call - ## -------------------------- - set (CTEST_UPDATE_COMMAND "SVNCommand") - if (NOT SITE_CYGWIN}) - find_package (Subversion) - set (CTEST_SVN_COMMAND "${Subversion_SVN_EXECUTABLE}") - set (CTEST_UPDATE_COMMAND "${Subversion_SVN_EXECUTABLE}") - else () - set (CTEST_SVN_COMMAND "/usr/bin/svn") - set (CTEST_UPDATE_COMMAND "/usr/bin/svn") - endif () - - if (NOT EXISTS "${CTEST_SOURCE_DIRECTORY}") - set (NEED_REPOSITORY_CHECKOUT 1) - endif () - - if (NOT CTEST_REPO_VERSION) - set (CTEST_REPO_VERSION "HEAD") - endif () - if (${NEED_REPOSITORY_CHECKOUT}) - set (CTEST_CHECKOUT_COMMAND - "\"${CTEST_SVN_COMMAND}\" co ${REPOSITORY_URL} \"${CTEST_SOURCE_DIRECTORY}\" -r ${CTEST_REPO_VERSION}") - else () - if (CTEST_REPO_VERSION) - set (CTEST_SVN_UPDATE_OPTIONS "-r ${CTEST_REPO_VERSION}") - endif () - endif () - endif () - endif () -endif () - -#----------------------------------------------------------------------------- -## Clear the build directory -## -------------------------- -set (CTEST_START_WITH_EMPTY_BINARY_DIRECTORY TRUE) -if (NOT EXISTS "${CTEST_BINARY_DIRECTORY}") - file (MAKE_DIRECTORY "${CTEST_BINARY_DIRECTORY}") -else () - ctest_empty_binary_directory (${CTEST_BINARY_DIRECTORY}) -endif () - -# Use multiple CPU cores to build -include (ProcessorCount) -ProcessorCount (N) -if (NOT N EQUAL 0) - if (NOT WIN32) - set (CTEST_BUILD_FLAGS -j${N}) - endif () - set (ctest_test_args ${ctest_test_args} PARALLEL_LEVEL ${N}) -endif () - -#----------------------------------------------------------------------------- -# Send the main script as a note. -list (APPEND CTEST_NOTES_FILES - "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}" - "${CMAKE_CURRENT_LIST_FILE}" - "${CTEST_SOURCE_DIRECTORY}/config/cmake/cacheinit.cmake" -) - -#----------------------------------------------------------------------------- -# Check for required variables. -# -------------------------- -foreach (req - CTEST_CMAKE_GENERATOR - CTEST_SITE - CTEST_BUILD_NAME - ) - if (NOT DEFINED ${req}) - message (FATAL_ERROR "The containing script must set ${req}") - endif () -endforeach () - -#----------------------------------------------------------------------------- -# Initialize the CTEST commands -#------------------------------ -if(CMAKE_GENERATOR_TOOLSET) - set(CTEST_CONFIGURE_TOOLSET "-T${CMAKE_GENERATOR_TOOLSET}") -else () - set(CTEST_CONFIGURE_TOOLSET "") -endif() -if (LOCAL_MEMCHECK_TEST) - find_program (CTEST_MEMORYCHECK_COMMAND NAMES valgrind) - set (CTEST_CONFIGURE_COMMAND - "${CTEST_CMAKE_COMMAND} -C \"${CTEST_SOURCE_DIRECTORY}/config/cmake/mccacheinit.cmake\" -DCMAKE_BUILD_TYPE:STRING=${CTEST_CONFIGURATION_TYPE} ${BUILD_OPTIONS} \"-G${CTEST_CMAKE_GENERATOR}\" \"${CTEST_CONFIGURE_TOOLSET}\" \"${CTEST_SOURCE_DIRECTORY}\"" - ) -else () - if (LOCAL_COVERAGE_TEST) - find_program (CTEST_COVERAGE_COMMAND NAMES gcov) - endif () - set (CTEST_CONFIGURE_COMMAND - "${CTEST_CMAKE_COMMAND} -C \"${CTEST_SOURCE_DIRECTORY}/config/cmake/cacheinit.cmake\" -DCMAKE_BUILD_TYPE:STRING=${CTEST_CONFIGURATION_TYPE} ${BUILD_OPTIONS} \"-G${CTEST_CMAKE_GENERATOR}\" \"${CTEST_CONFIGURE_TOOLSET}\" \"${CTEST_SOURCE_DIRECTORY}\"" - ) -endif () - -#----------------------------------------------------------------------------- -## -- set output to english -set ($ENV{LC_MESSAGES} "en_EN") - -# Print summary information. -foreach (v - CTEST_SITE - CTEST_BUILD_NAME - CTEST_SOURCE_DIRECTORY - CTEST_BINARY_DIRECTORY - CTEST_CMAKE_GENERATOR - CTEST_CONFIGURATION_TYPE - CTEST_GIT_COMMAND - CTEST_CHECKOUT_COMMAND - CTEST_CONFIGURE_COMMAND - CTEST_SCRIPT_DIRECTORY - CTEST_USE_LAUNCHERS - ) - set (vars "${vars} ${v}=[${${v}}]\n") -endforeach () -message (STATUS "Dashboard script configuration:\n${vars}\n") - -#----------------------------------------------------------------------------- -#----------------------------------------------------------------------------- - ## NORMAL process - ## -- LOCAL_UPDATE updates the source folder from svn - ## -- LOCAL_SUBMIT reports to CDash server - ## -- LOCAL_SKIP_TEST skips the test process (only builds) - ## -- LOCAL_MEMCHECK_TEST executes the Valgrind testing - ## -- LOCAL_COVERAGE_TEST executes code coverage process - ## -------------------------- - ctest_start (${MODEL} TRACK ${MODEL}) - if (LOCAL_UPDATE) - ctest_update (SOURCE "${CTEST_SOURCE_DIRECTORY}") - endif () - configure_file (${CTEST_SOURCE_DIRECTORY}/config/cmake/CTestCustom.cmake ${CTEST_BINARY_DIRECTORY}/CTestCustom.cmake) - ctest_read_custom_files ("${CTEST_BINARY_DIRECTORY}") - ctest_configure (BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) - if (LOCAL_SUBMIT) - ctest_submit (PARTS Update Configure Notes) - endif () - if (${res} LESS 0 OR ${res} GREATER 0) - file (APPEND ${CTEST_SCRIPT_DIRECTORY}/FailedCTest.txt "Failed Configure: ${res}\n") - endif () - - ctest_build (BUILD "${CTEST_BINARY_DIRECTORY}" APPEND RETURN_VALUE res NUMBER_ERRORS errval) - if (LOCAL_SUBMIT) - ctest_submit (PARTS Build) - endif () - if (${res} LESS 0 OR ${res} GREATER 0 OR ${errval} GREATER 0) - file (APPEND ${CTEST_SCRIPT_DIRECTORY}/FailedCTest.txt "Failed ${errval} Build: ${res}\n") - endif () - - if (NOT LOCAL_SKIP_TEST) - if (NOT LOCAL_MEMCHECK_TEST) +cmake_minimum_required (VERSION 3.10) +######################################################## +# This dashboard is maintained by The HDF Group +# For any comments please contact cdashhelp@hdfgroup.org +# +######################################################## +# ----------------------------------------------------------- +# -- Get environment +# ----------------------------------------------------------- +if (NOT SITE_OS_NAME) + ## machine name not provided - attempt to discover with uname + ## -- set hostname + ## -------------------------- + find_program (HOSTNAME_CMD NAMES hostname) + exec_program (${HOSTNAME_CMD} ARGS OUTPUT_VARIABLE HOSTNAME) + set (CTEST_SITE "${HOSTNAME}${CTEST_SITE_EXT}") + find_program (UNAME NAMES uname) + macro (getuname name flag) + exec_program ("${UNAME}" ARGS "${flag}" OUTPUT_VARIABLE "${name}") + endmacro () + + getuname (osname -s) + getuname (osrel -r) + getuname (cpu -m) + message (STATUS "Dashboard script uname output: ${osname}-${osrel}-${cpu}\n") + + set (CTEST_BUILD_NAME "${osname}-${osrel}-${cpu}") + if (SITE_BUILDNAME_SUFFIX) + set (CTEST_BUILD_NAME "${SITE_BUILDNAME_SUFFIX}-${CTEST_BUILD_NAME}") + endif () + set (BUILD_OPTIONS "${ADD_BUILD_OPTIONS}") +else () + ## machine name provided + ## -------------------------- + if (CMAKE_HOST_UNIX) + set (CTEST_BUILD_NAME "${SITE_OS_NAME}-${SITE_OS_VERSION}-${SITE_OS_BITS}-${SITE_COMPILER_NAME}-${SITE_COMPILER_VERSION}") + else () + set (CTEST_BUILD_NAME "${SITE_OS_NAME}-${SITE_OS_VERSION}-${SITE_COMPILER_NAME}") + endif () + if (SITE_BUILDNAME_SUFFIX) + set (CTEST_BUILD_NAME "${CTEST_BUILD_NAME}-${SITE_BUILDNAME_SUFFIX}") + endif () + set (BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DSITE:STRING=${CTEST_SITE} -DBUILDNAME:STRING=${CTEST_BUILD_NAME}") +endif () + +#----------------------------------------------------------------------------- +# MAC machines need special option +#----------------------------------------------------------------------------- +if (APPLE) + # Compiler choice + execute_process (COMMAND xcrun --find cc OUTPUT_VARIABLE XCODE_CC OUTPUT_STRIP_TRAILING_WHITESPACE) + execute_process (COMMAND xcrun --find c++ OUTPUT_VARIABLE XCODE_CXX OUTPUT_STRIP_TRAILING_WHITESPACE) + set (ENV{CC} "${XCODE_CC}") + set (ENV{CXX} "${XCODE_CXX}") + + set (BUILD_OPTIONS "${BUILD_OPTIONS} -DCTEST_USE_LAUNCHERS:BOOL=ON -DCMAKE_BUILD_WITH_INSTALL_RPATH:BOOL=OFF") +endif () + +#----------------------------------------------------------------------------- +set (NEED_REPOSITORY_CHECKOUT 0) +set (CTEST_CMAKE_COMMAND "\"${CMAKE_COMMAND}\"") +if (CTEST_USE_TAR_SOURCE) + ## Uncompress source if tar file provided + ## -------------------------- + if (WIN32) + message (STATUS "extracting... [${CMAKE_EXECUTABLE_NAME} x ${CTEST_DASHBOARD_ROOT}\\${CTEST_USE_TAR_SOURCE}.zip]") + execute_process (COMMAND ${CMAKE_EXECUTABLE_NAME} -E tar -xvf ${CTEST_DASHBOARD_ROOT}\\${CTEST_USE_TAR_SOURCE}.zip RESULT_VARIABLE rv) + else () + message (STATUS "extracting... [${CMAKE_EXECUTABLE_NAME} -E tar -xvf ${CTEST_DASHBOARD_ROOT}/${CTEST_USE_TAR_SOURCE}.tar]") + execute_process (COMMAND ${CMAKE_EXECUTABLE_NAME} -E tar -xvf ${CTEST_DASHBOARD_ROOT}/${CTEST_USE_TAR_SOURCE}.tar RESULT_VARIABLE rv) + endif () + + if (NOT rv EQUAL 0) + message (STATUS "extracting... [error-(${rv}) clean up]") + file (REMOVE_RECURSE "${CTEST_SOURCE_DIRECTORY}") + message (FATAL_ERROR "error: extract of ${CTEST_USE_TAR_SOURCE} failed") + endif () + + file (RENAME ${CTEST_DASHBOARD_ROOT}/${CTEST_USE_TAR_SOURCE} ${CTEST_SOURCE_DIRECTORY}) + set (LOCAL_SKIP_UPDATE "TRUE") +else () + if (LOCAL_UPDATE) + if (CTEST_USE_GIT_SOURCE) + find_program (CTEST_GIT_COMMAND NAMES git git.cmd) + set (CTEST_GIT_UPDATE_OPTIONS) + + if (NOT EXISTS "${CTEST_SOURCE_DIRECTORY}") + set (NEED_REPOSITORY_CHECKOUT 1) + endif () + + if (${NEED_REPOSITORY_CHECKOUT}) + if (REPOSITORY_BRANCH) + set (CTEST_GIT_options "clone \"${REPOSITORY_URL}\" --branch \"${REPOSITORY_BRANCH}\" --single-branch \"${CTEST_SOURCE_DIRECTORY}\" --recurse-submodules") + else () + set (CTEST_GIT_options "clone \"${REPOSITORY_URL}\" \"${CTEST_SOURCE_DIRECTORY}\" --recurse-submodules") + endif () + set (CTEST_CHECKOUT_COMMAND "${CTEST_GIT_COMMAND} ${CTEST_GIT_options}") + else () + set (CTEST_GIT_options "pull") + endif () + set (CTEST_UPDATE_COMMAND "${CTEST_GIT_COMMAND}") + else () + ## -------------------------- + ## use subversion to get source + #----------------------------------------------------------------------------- + ## cygwin does not handle the find_package() call + ## -------------------------- + set (CTEST_UPDATE_COMMAND "SVNCommand") + if (NOT SITE_CYGWIN}) + find_package (Subversion) + set (CTEST_SVN_COMMAND "${Subversion_SVN_EXECUTABLE}") + set (CTEST_UPDATE_COMMAND "${Subversion_SVN_EXECUTABLE}") + else () + set (CTEST_SVN_COMMAND "/usr/bin/svn") + set (CTEST_UPDATE_COMMAND "/usr/bin/svn") + endif () + + if (NOT EXISTS "${CTEST_SOURCE_DIRECTORY}") + set (NEED_REPOSITORY_CHECKOUT 1) + endif () + + if (NOT CTEST_REPO_VERSION) + set (CTEST_REPO_VERSION "HEAD") + endif () + if (${NEED_REPOSITORY_CHECKOUT}) + set (CTEST_CHECKOUT_COMMAND + "\"${CTEST_SVN_COMMAND}\" co ${REPOSITORY_URL} \"${CTEST_SOURCE_DIRECTORY}\" -r ${CTEST_REPO_VERSION}") + else () + if (CTEST_REPO_VERSION) + set (CTEST_SVN_UPDATE_OPTIONS "-r ${CTEST_REPO_VERSION}") + endif () + endif () + endif () + endif () +endif () + +#----------------------------------------------------------------------------- +## Clear the build directory +## -------------------------- +set (CTEST_START_WITH_EMPTY_BINARY_DIRECTORY TRUE) +if (NOT EXISTS "${CTEST_BINARY_DIRECTORY}") + file (MAKE_DIRECTORY "${CTEST_BINARY_DIRECTORY}") +else () + ctest_empty_binary_directory (${CTEST_BINARY_DIRECTORY}) +endif () + +# Use multiple CPU cores to build +include (ProcessorCount) +ProcessorCount (N) +if (NOT N EQUAL 0) + if (NOT WIN32) + set (CTEST_BUILD_FLAGS -j${N}) + endif () + set (ctest_test_args ${ctest_test_args} PARALLEL_LEVEL ${N}) +endif () + +#----------------------------------------------------------------------------- +# Send the main script as a note. +list (APPEND CTEST_NOTES_FILES + "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}" + "${CMAKE_CURRENT_LIST_FILE}" + "${CTEST_SOURCE_DIRECTORY}/config/cmake/cacheinit.cmake" +) + +#----------------------------------------------------------------------------- +# Check for required variables. +# -------------------------- +foreach (req + CTEST_CMAKE_GENERATOR + CTEST_SITE + CTEST_BUILD_NAME + ) + if (NOT DEFINED ${req}) + message (FATAL_ERROR "The containing script must set ${req}") + endif () +endforeach () + +#----------------------------------------------------------------------------- +# Initialize the CTEST commands +#------------------------------ +if(CMAKE_GENERATOR_TOOLSET) + set(CTEST_CONFIGURE_TOOLSET "-T${CMAKE_GENERATOR_TOOLSET}") +else () + set(CTEST_CONFIGURE_TOOLSET "") +endif() +if (LOCAL_MEMCHECK_TEST) + find_program (CTEST_MEMORYCHECK_COMMAND NAMES valgrind) + set (CTEST_CONFIGURE_COMMAND + "${CTEST_CMAKE_COMMAND} -C \"${CTEST_SOURCE_DIRECTORY}/config/cmake/mccacheinit.cmake\" -DCMAKE_BUILD_TYPE:STRING=${CTEST_CONFIGURATION_TYPE} ${BUILD_OPTIONS} \"-G${CTEST_CMAKE_GENERATOR}\" \"${CTEST_CONFIGURE_TOOLSET}\" \"${CTEST_SOURCE_DIRECTORY}\"" + ) +else () + if (LOCAL_COVERAGE_TEST) + find_program (CTEST_COVERAGE_COMMAND NAMES gcov) + endif () + set (CTEST_CONFIGURE_COMMAND + "${CTEST_CMAKE_COMMAND} -C \"${CTEST_SOURCE_DIRECTORY}/config/cmake/cacheinit.cmake\" -DCMAKE_BUILD_TYPE:STRING=${CTEST_CONFIGURATION_TYPE} ${BUILD_OPTIONS} \"-G${CTEST_CMAKE_GENERATOR}\" \"${CTEST_CONFIGURE_TOOLSET}\" \"${CTEST_SOURCE_DIRECTORY}\"" + ) +endif () + +#----------------------------------------------------------------------------- +## -- set output to english +set ($ENV{LC_MESSAGES} "en_EN") + +# Print summary information. +foreach (v + CTEST_SITE + CTEST_BUILD_NAME + CTEST_SOURCE_DIRECTORY + CTEST_BINARY_DIRECTORY + CTEST_CMAKE_GENERATOR + CTEST_CONFIGURATION_TYPE + CTEST_GIT_COMMAND + CTEST_CHECKOUT_COMMAND + CTEST_CONFIGURE_COMMAND + CTEST_SCRIPT_DIRECTORY + CTEST_USE_LAUNCHERS + ) + set (vars "${vars} ${v}=[${${v}}]\n") +endforeach () +message (STATUS "Dashboard script configuration:\n${vars}\n") + +#----------------------------------------------------------------------------- +#----------------------------------------------------------------------------- + ## NORMAL process + ## -- LOCAL_UPDATE updates the source folder from svn + ## -- LOCAL_SUBMIT reports to CDash server + ## -- LOCAL_SKIP_TEST skips the test process (only builds) + ## -- LOCAL_MEMCHECK_TEST executes the Valgrind testing + ## -- LOCAL_COVERAGE_TEST executes code coverage process + ## -------------------------- + ctest_start (${MODEL} TRACK ${MODEL}) + if (LOCAL_UPDATE) + ctest_update (SOURCE "${CTEST_SOURCE_DIRECTORY}") + endif () + configure_file (${CTEST_SOURCE_DIRECTORY}/config/cmake/CTestCustom.cmake ${CTEST_BINARY_DIRECTORY}/CTestCustom.cmake) + ctest_read_custom_files ("${CTEST_BINARY_DIRECTORY}") + ctest_configure (BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) + if (LOCAL_SUBMIT) + ctest_submit (PARTS Update Configure Notes) + endif () + if (${res} LESS 0 OR ${res} GREATER 0) + file (APPEND ${CTEST_SCRIPT_DIRECTORY}/FailedCTest.txt "Failed Configure: ${res}\n") + endif () + + ctest_build (BUILD "${CTEST_BINARY_DIRECTORY}" APPEND RETURN_VALUE res NUMBER_ERRORS errval) + if (LOCAL_SUBMIT) + ctest_submit (PARTS Build) + endif () + if (${res} LESS 0 OR ${res} GREATER 0 OR ${errval} GREATER 0) + file (APPEND ${CTEST_SCRIPT_DIRECTORY}/FailedCTest.txt "Failed ${errval} Build: ${res}\n") + endif () + + if (NOT LOCAL_SKIP_TEST) + if (NOT LOCAL_MEMCHECK_TEST) if (NOT LOCAL_BATCH_TEST) ctest_test (BUILD "${CTEST_BINARY_DIRECTORY}" APPEND ${ctest_test_args} RETURN_VALUE res) + if (LOCAL_SUBMIT) + ctest_submit (PARTS Test) + endif () else () - execute_process (COMMAND ${LOCAL_BATCH_SCRIPT_COMMAND} ${LOCAL_BATCH_SCRIPT_NAME}) + file(STRINGS ${CTEST_BINARY_DIRECTORY}/Testing/TAG TAG_CONTENTS REGEX "^2([0-9]+)[-]([0-9]+)$") + execute_process (COMMAND ${LOCAL_BATCH_SCRIPT_COMMAND} ${CTEST_SOURCE_DIRECTORY}/bin/batch/${LOCAL_BATCH_SCRIPT_NAME}) + message(STATUS "Check for existence of ${CTEST_BINARY_DIRECTORY}/Testing/${TAG_CONTENTS}/Test.xml") + execute_process(COMMAND ls ${CTEST_BINARY_DIRECTORY}/Testing/${TAG_CONTENTS}/Test.xml RESULT_VARIABLE result OUTPUT_QUIET ERROR_QUIET) + while(result) + ctest_sleep(60) + message(STATUS "Checking again for existence of ${CTEST_BINARY_DIRECTORY}/Testing/${TAG_CONTENTS}/Test.xml") + execute_process(COMMAND ls ${CTEST_BINARY_DIRECTORY}/Testing/${TAG_CONTENTS}/Test.xml RESULT_VARIABLE result OUTPUT_QUIET ERROR_QUIET) + endwhile(result) + if (LOCAL_SUBMIT) + ctest_submit (PARTS Test) + endif () + message(STATUS "Found ${CTEST_BINARY_DIRECTORY}/Testing/${TAG_CONTENTS}/Test.xml. Renaming to SerialTest.xml") + file (RENAME ${CTEST_BINARY_DIRECTORY}/Testing/${TAG_CONTENTS}/Test.xml ${CTEST_BINARY_DIRECTORY}/Testing/${TAG_CONTENTS}/SerialTest.xml) + message(STATUS "Check for existence of ${CTEST_BINARY_DIRECTORY}/Testing/${TAG_CONTENTS}/Test.xml") + unset(result CACHE) + execute_process (COMMAND ${LOCAL_BATCH_SCRIPT_COMMAND} ${CTEST_SOURCE_DIRECTORY}/bin/batch/${LOCAL_BATCH_SCRIPT_PARALLEL_NAME}) + message(STATUS "Check for existence of ${CTEST_BINARY_DIRECTORY}/Testing/${TAG_CONTENTS}/Test.xml") + execute_process(COMMAND ls ${CTEST_BINARY_DIRECTORY}/Testing/${TAG_CONTENTS}/Test.xml RESULT_VARIABLE result OUTPUT_QUIET ERROR_QUIET) + while(result) + ctest_sleep(60) + message(STATUS "Checking again for existence of ${CTEST_BINARY_DIRECTORY}/Testing/${TAG_CONTENTS}/Test.xml") + execute_process(COMMAND ls ${CTEST_BINARY_DIRECTORY}/Testing/${TAG_CONTENTS}/Test.xml RESULT_VARIABLE result OUTPUT_QUIET ERROR_QUIET) + endwhile(result) + if (LOCAL_SUBMIT) + ctest_submit (PARTS Test) + endif () + message(STATUS "Found ${CTEST_BINARY_DIRECTORY}/Testing/${TAG_CONTENTS}/Test.xml. Done with parallel batch tests.") + endif () + if (${res} LESS 0 OR ${res} GREATER 0) + file (APPEND ${CTEST_SCRIPT_DIRECTORY}/FailedCTest.txt "Failed Tests: ${res}\n") + endif () + else () + ctest_memcheck (BUILD "${CTEST_BINARY_DIRECTORY}" APPEND ${ctest_test_args}) + if (LOCAL_SUBMIT) + ctest_submit (PARTS MemCheck) + endif () + endif () + if (LOCAL_COVERAGE_TEST) + ctest_coverage (BUILD "${CTEST_BINARY_DIRECTORY}" APPEND) + if (LOCAL_SUBMIT) + ctest_submit (PARTS Coverage) endif () - if (LOCAL_SUBMIT) - ctest_submit (PARTS Test) - endif () - if (${res} LESS 0 OR ${res} GREATER 0) - file (APPEND ${CTEST_SCRIPT_DIRECTORY}/FailedCTest.txt "Failed Tests: ${res}\n") - endif () - else () - ctest_memcheck (BUILD "${CTEST_BINARY_DIRECTORY}" APPEND ${ctest_test_args}) - if (LOCAL_SUBMIT) - ctest_submit (PARTS MemCheck) - endif () - endif () - if (LOCAL_COVERAGE_TEST) - ctest_coverage (BUILD "${CTEST_BINARY_DIRECTORY}" APPEND) - if (LOCAL_SUBMIT) - ctest_submit (PARTS Coverage) - endif () - endif () - endif () - - if (NOT LOCAL_MEMCHECK_TEST AND NOT LOCAL_NO_PACKAGE AND NOT LOCAL_SKIP_BUILD) - ##----------------------------------------------- - ## Package the product - ##----------------------------------------------- - execute_process (COMMAND cpack -C ${CTEST_CONFIGURATION_TYPE} -V - WORKING_DIRECTORY ${CTEST_BINARY_DIRECTORY} - RESULT_VARIABLE cpackResult - OUTPUT_VARIABLE cpackLog - ERROR_VARIABLE cpackLog.err - ) - file (WRITE ${CTEST_BINARY_DIRECTORY}/cpack.log "${cpackLog.err}" "${cpackLog}") - if (cpackResult GREATER 0) - file (APPEND ${CTEST_SCRIPT_DIRECTORY}/FailedCTest.txt "Failed packaging: ${cpackResult}:${cpackLog.err} \n") - endif () - endif () -#----------------------------------------------------------------------------- + endif () + endif () + + if (NOT LOCAL_MEMCHECK_TEST AND NOT LOCAL_NO_PACKAGE AND NOT LOCAL_SKIP_BUILD) + ##----------------------------------------------- + ## Package the product + ##----------------------------------------------- + execute_process (COMMAND cpack -C ${CTEST_CONFIGURATION_TYPE} -V + WORKING_DIRECTORY ${CTEST_BINARY_DIRECTORY} + RESULT_VARIABLE cpackResult + OUTPUT_VARIABLE cpackLog + ERROR_VARIABLE cpackLog.err + ) + file (WRITE ${CTEST_BINARY_DIRECTORY}/cpack.log "${cpackLog.err}" "${cpackLog}") + if (cpackResult GREATER 0) + file (APPEND ${CTEST_SCRIPT_DIRECTORY}/FailedCTest.txt "Failed packaging: ${cpackResult}:${cpackLog.err} \n") + endif () + endif () +#----------------------------------------------------------------------------- diff --git a/config/cmake/scripts/wait_H5Tinit.cmake b/config/cmake/scripts/wait_H5Tinit.cmake new file mode 100755 index 0000000..14976ce --- /dev/null +++ b/config/cmake/scripts/wait_H5Tinit.cmake @@ -0,0 +1,10 @@ +cmake_minimum_required (VERSION 3.10) + +message(STATUS "Check for existence of ${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.c") +execute_process(COMMAND ls ${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.c RESULT_VARIABLE H5TI_result OUTPUT_QUIET ERROR_QUIET) +while(H5TI_result) + ctest_sleep(30) + message(STATUS "Checking again for existence of ${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.c") + execute_process(COMMAND ls ${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.c RESULT_VARIABLE H5TI_result OUTPUT_QUIET ERROR_QUIET) +endwhile(H5TI_result) +message(STATUS "Found ${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.c") diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 31a38be..8affc6d 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -947,28 +947,33 @@ if (NOT EXISTS ${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.c) ${HDF5_BINARY_DIR}/${HDF5_BATCH_H5DETECT_SCRIPT} ESCAPE_QUOTES @ONLY ) add_custom_command ( - OUTPUT ${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.tmp + OUTPUT ${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.c COMMAND ${HDF5_BATCH_CMD} ARGS ${HDF5_BINARY_DIR}/${HDF5_BATCH_H5DETECT_SCRIPT} + COMMAND ${CMAKE_COMMAND} + ARGS -E echo "Executed batch command to create H5Tinit.c" DEPENDS H5detect WORKING_DIRECTORY ${HDF5_GENERATED_SOURCE_DIR} ) + add_custom_target (gen_H5Tinit + COMMAND ${CMAKE_COMMAND} -P ${HDF5_SOURCE_DIR}/config/cmake/scripts/wait_H5Tinit.cmake + ) else () add_custom_command ( - OUTPUT ${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.tmp + OUTPUT ${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.c COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR}$ - ARGS ${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.tmp + ARGS ${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.c DEPENDS H5detect WORKING_DIRECTORY ${HDF5_GENERATED_SOURCE_DIR} ) endif () - add_custom_target (gen_H5Tinit ALL DEPENDS ${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.tmp) - add_custom_command ( - OUTPUT ${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.c - COMMAND ${CMAKE_COMMAND} - ARGS -E copy_if_different "${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.tmp" "${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.c" - DEPENDS gen_H5Tinit ${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.tmp - ) +# add_custom_target (gen_H5Tinit ALL DEPENDS ${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.tmp) +# add_custom_command ( +# OUTPUT ${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.c +# COMMAND ${CMAKE_COMMAND} +# ARGS -E copy_if_different "${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.tmp" "${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.c" +# DEPENDS gen_H5Tinit ${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.tmp +# ) set_source_files_properties (${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.c PROPERTIES GENERATED TRUE) endif () if (BUILD_SHARED_LIBS) -- cgit v0.12 From 38f7e3c86b2ce51ec7fb7c003192b9cef333d720 Mon Sep 17 00:00:00 2001 From: Larry Knox Date: Wed, 14 Nov 2018 11:35:36 -0600 Subject: Really don't run parallel tests without option specifying script. --- config/cmake/scripts/CTestScript.cmake | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/config/cmake/scripts/CTestScript.cmake b/config/cmake/scripts/CTestScript.cmake index fd56ffa..41366bd 100755 --- a/config/cmake/scripts/CTestScript.cmake +++ b/config/cmake/scripts/CTestScript.cmake @@ -275,28 +275,27 @@ message (STATUS "Dashboard script configuration:\n${vars}\n") execute_process(COMMAND ls ${CTEST_BINARY_DIRECTORY}/Testing/${TAG_CONTENTS}/Test.xml RESULT_VARIABLE result OUTPUT_QUIET ERROR_QUIET) while(result) ctest_sleep(60) - message(STATUS "Checking again for existence of ${CTEST_BINARY_DIRECTORY}/Testing/${TAG_CONTENTS}/Test.xml") execute_process(COMMAND ls ${CTEST_BINARY_DIRECTORY}/Testing/${TAG_CONTENTS}/Test.xml RESULT_VARIABLE result OUTPUT_QUIET ERROR_QUIET) endwhile(result) if (LOCAL_SUBMIT) ctest_submit (PARTS Test) endif () - message(STATUS "Found ${CTEST_BINARY_DIRECTORY}/Testing/${TAG_CONTENTS}/Test.xml. Renaming to SerialTest.xml") - file (RENAME ${CTEST_BINARY_DIRECTORY}/Testing/${TAG_CONTENTS}/Test.xml ${CTEST_BINARY_DIRECTORY}/Testing/${TAG_CONTENTS}/SerialTest.xml) - message(STATUS "Check for existence of ${CTEST_BINARY_DIRECTORY}/Testing/${TAG_CONTENTS}/Test.xml") - unset(result CACHE) - execute_process (COMMAND ${LOCAL_BATCH_SCRIPT_COMMAND} ${CTEST_SOURCE_DIRECTORY}/bin/batch/${LOCAL_BATCH_SCRIPT_PARALLEL_NAME}) - message(STATUS "Check for existence of ${CTEST_BINARY_DIRECTORY}/Testing/${TAG_CONTENTS}/Test.xml") - execute_process(COMMAND ls ${CTEST_BINARY_DIRECTORY}/Testing/${TAG_CONTENTS}/Test.xml RESULT_VARIABLE result OUTPUT_QUIET ERROR_QUIET) - while(result) - ctest_sleep(60) - message(STATUS "Checking again for existence of ${CTEST_BINARY_DIRECTORY}/Testing/${TAG_CONTENTS}/Test.xml") + if (LOCAL_BATCH_SCRIPT_PARALLEL_NAME) + message(STATUS "Found ${CTEST_BINARY_DIRECTORY}/Testing/${TAG_CONTENTS}/Test.xml. Renaming to SerialTest.xml") + file (RENAME ${CTEST_BINARY_DIRECTORY}/Testing/${TAG_CONTENTS}/Test.xml ${CTEST_BINARY_DIRECTORY}/Testing/${TAG_CONTENTS}/SerialTest.xml) + unset(result CACHE) + execute_process (COMMAND ${LOCAL_BATCH_SCRIPT_COMMAND} ${CTEST_SOURCE_DIRECTORY}/bin/batch/${LOCAL_BATCH_SCRIPT_PARALLEL_NAME}) + message(STATUS "Check for existence of ${CTEST_BINARY_DIRECTORY}/Testing/${TAG_CONTENTS}/Test.xml") execute_process(COMMAND ls ${CTEST_BINARY_DIRECTORY}/Testing/${TAG_CONTENTS}/Test.xml RESULT_VARIABLE result OUTPUT_QUIET ERROR_QUIET) - endwhile(result) - if (LOCAL_SUBMIT) - ctest_submit (PARTS Test) - endif () - message(STATUS "Found ${CTEST_BINARY_DIRECTORY}/Testing/${TAG_CONTENTS}/Test.xml. Done with parallel batch tests.") + while(result) + ctest_sleep(60) + execute_process(COMMAND ls ${CTEST_BINARY_DIRECTORY}/Testing/${TAG_CONTENTS}/Test.xml RESULT_VARIABLE result OUTPUT_QUIET ERROR_QUIET) + endwhile(result) + if (LOCAL_SUBMIT) + ctest_submit (PARTS Test) + endif () + message(STATUS "Found ${CTEST_BINARY_DIRECTORY}/Testing/${TAG_CONTENTS}/Test.xml. Done with parallel batch tests.") + endif() endif () if (${res} LESS 0 OR ${res} GREATER 0) file (APPEND ${CTEST_SCRIPT_DIRECTORY}/FailedCTest.txt "Failed Tests: ${res}\n") -- cgit v0.12 From 720bbdfe614660c885cd2dd31e5e4678422fcbcf Mon Sep 17 00:00:00 2001 From: Larry Knox Date: Tue, 20 Nov 2018 11:03:58 -0600 Subject: Changes to CMake code to pause cmake/ctest, waiting for batch jobs to run and finish. --- config/cmake/scripts/CTestScript.cmake | 19 ++++++++---------- config/cmake/scripts/wait_H5Tinit.cmake | 1 + src/CMakeLists.txt | 34 +++++++++++++++++---------------- 3 files changed, 27 insertions(+), 27 deletions(-) diff --git a/config/cmake/scripts/CTestScript.cmake b/config/cmake/scripts/CTestScript.cmake index 41366bd..09ff63b 100755 --- a/config/cmake/scripts/CTestScript.cmake +++ b/config/cmake/scripts/CTestScript.cmake @@ -265,9 +265,6 @@ message (STATUS "Dashboard script configuration:\n${vars}\n") if (NOT LOCAL_MEMCHECK_TEST) if (NOT LOCAL_BATCH_TEST) ctest_test (BUILD "${CTEST_BINARY_DIRECTORY}" APPEND ${ctest_test_args} RETURN_VALUE res) - if (LOCAL_SUBMIT) - ctest_submit (PARTS Test) - endif () else () file(STRINGS ${CTEST_BINARY_DIRECTORY}/Testing/TAG TAG_CONTENTS REGEX "^2([0-9]+)[-]([0-9]+)$") execute_process (COMMAND ${LOCAL_BATCH_SCRIPT_COMMAND} ${CTEST_SOURCE_DIRECTORY}/bin/batch/${LOCAL_BATCH_SCRIPT_NAME}) @@ -277,11 +274,11 @@ message (STATUS "Dashboard script configuration:\n${vars}\n") ctest_sleep(60) execute_process(COMMAND ls ${CTEST_BINARY_DIRECTORY}/Testing/${TAG_CONTENTS}/Test.xml RESULT_VARIABLE result OUTPUT_QUIET ERROR_QUIET) endwhile(result) - if (LOCAL_SUBMIT) - ctest_submit (PARTS Test) - endif () if (LOCAL_BATCH_SCRIPT_PARALLEL_NAME) - message(STATUS "Found ${CTEST_BINARY_DIRECTORY}/Testing/${TAG_CONTENTS}/Test.xml. Renaming to SerialTest.xml") + if (LOCAL_SUBMIT) + ctest_submit (PARTS Test) + endif () + message(STATUS "Found ${CTEST_BINARY_DIRECTORY}/Testing/${TAG_CONTENTS}/Test.xml for serial tests. Renaming to SerialTest.xml") file (RENAME ${CTEST_BINARY_DIRECTORY}/Testing/${TAG_CONTENTS}/Test.xml ${CTEST_BINARY_DIRECTORY}/Testing/${TAG_CONTENTS}/SerialTest.xml) unset(result CACHE) execute_process (COMMAND ${LOCAL_BATCH_SCRIPT_COMMAND} ${CTEST_SOURCE_DIRECTORY}/bin/batch/${LOCAL_BATCH_SCRIPT_PARALLEL_NAME}) @@ -291,12 +288,12 @@ message (STATUS "Dashboard script configuration:\n${vars}\n") ctest_sleep(60) execute_process(COMMAND ls ${CTEST_BINARY_DIRECTORY}/Testing/${TAG_CONTENTS}/Test.xml RESULT_VARIABLE result OUTPUT_QUIET ERROR_QUIET) endwhile(result) - if (LOCAL_SUBMIT) - ctest_submit (PARTS Test) - endif () - message(STATUS "Found ${CTEST_BINARY_DIRECTORY}/Testing/${TAG_CONTENTS}/Test.xml. Done with parallel batch tests.") + message(STATUS "Found ${CTEST_BINARY_DIRECTORY}/Testing/${TAG_CONTENTS}/Test.xml for parallel tests.") endif() endif () + if (LOCAL_SUBMIT) + ctest_submit (PARTS Test) + endif () if (${res} LESS 0 OR ${res} GREATER 0) file (APPEND ${CTEST_SCRIPT_DIRECTORY}/FailedCTest.txt "Failed Tests: ${res}\n") endif () diff --git a/config/cmake/scripts/wait_H5Tinit.cmake b/config/cmake/scripts/wait_H5Tinit.cmake index 14976ce..c0b4d06 100755 --- a/config/cmake/scripts/wait_H5Tinit.cmake +++ b/config/cmake/scripts/wait_H5Tinit.cmake @@ -7,4 +7,5 @@ while(H5TI_result) message(STATUS "Checking again for existence of ${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.c") execute_process(COMMAND ls ${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.c RESULT_VARIABLE H5TI_result OUTPUT_QUIET ERROR_QUIET) endwhile(H5TI_result) +file (TOUCH "${HDF5_BINARY_DIR}/H5Tinit_created") message(STATUS "Found ${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.c") diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 8affc6d..9660c89 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -958,6 +958,15 @@ if (NOT EXISTS ${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.c) add_custom_target (gen_H5Tinit COMMAND ${CMAKE_COMMAND} -P ${HDF5_SOURCE_DIR}/config/cmake/scripts/wait_H5Tinit.cmake ) + if (BUILD_SHARED_LIBS) + add_custom_command ( + OUTPUT ${HDF5_GENERATED_SOURCE_DIR}/shared/H5Tinit.c + COMMAND ${CMAKE_COMMAND} + ARGS -E copy_if_different "${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.c" "${HDF5_GENERATED_SOURCE_DIR}/shared/H5Tinit.c" + DEPENDS gen_H5Tinit ${HDF5_GENERATED_SOURCE_DIR}/H5Tinit_created + ) + set_source_files_properties (${HDF5_GENERATED_SOURCE_DIR}/shared/H5Tinit.c PROPERTIES GENERATED TRUE) + endif () else () add_custom_command ( OUTPUT ${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.c @@ -966,25 +975,18 @@ if (NOT EXISTS ${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.c) DEPENDS H5detect WORKING_DIRECTORY ${HDF5_GENERATED_SOURCE_DIR} ) + if (BUILD_SHARED_LIBS) + add_custom_command ( + OUTPUT ${HDF5_GENERATED_SOURCE_DIR}/shared/H5Tinit.c + COMMAND ${CMAKE_COMMAND} + ARGS -E copy_if_different "${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.c" "${HDF5_GENERATED_SOURCE_DIR}/shared/H5Tinit.c" + DEPENDS ${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.c + ) + set_source_files_properties (${HDF5_GENERATED_SOURCE_DIR}/shared/H5Tinit.c PROPERTIES GENERATED TRUE) + endif () endif () -# add_custom_target (gen_H5Tinit ALL DEPENDS ${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.tmp) -# add_custom_command ( -# OUTPUT ${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.c -# COMMAND ${CMAKE_COMMAND} -# ARGS -E copy_if_different "${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.tmp" "${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.c" -# DEPENDS gen_H5Tinit ${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.tmp -# ) set_source_files_properties (${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.c PROPERTIES GENERATED TRUE) endif () -if (BUILD_SHARED_LIBS) - add_custom_command ( - OUTPUT ${HDF5_GENERATED_SOURCE_DIR}/shared/H5Tinit.c - COMMAND ${CMAKE_COMMAND} - ARGS -E copy_if_different "${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.c" "${HDF5_GENERATED_SOURCE_DIR}/shared/H5Tinit.c" - DEPENDS ${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.c - ) - set_source_files_properties (${HDF5_GENERATED_SOURCE_DIR}/shared/H5Tinit.c PROPERTIES GENERATED TRUE) -endif () add_executable (H5make_libsettings ${HDF5_SRC_DIR}/H5make_libsettings.c) target_include_directories(H5make_libsettings PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") -- cgit v0.12 From 7bf6e98bd921c4ef1899144ab8a1f0d66a141141 Mon Sep 17 00:00:00 2001 From: Larry Knox Date: Tue, 20 Nov 2018 12:09:14 -0600 Subject: Move wait_H5init.cmake up to config/cmake. --- MANIFEST | 2 +- config/cmake/scripts/wait_H5Tinit.cmake | 11 ----------- config/cmake/wait_H5Tinit.cmake | 11 +++++++++++ src/CMakeLists.txt | 2 +- 4 files changed, 13 insertions(+), 13 deletions(-) delete mode 100755 config/cmake/scripts/wait_H5Tinit.cmake create mode 100644 config/cmake/wait_H5Tinit.cmake diff --git a/MANIFEST b/MANIFEST index a2b1a07..95d8b39 100644 --- a/MANIFEST +++ b/MANIFEST @@ -3196,6 +3196,7 @@ ./config/cmake/UseJavaSymlinks.cmake ./config/cmake/userblockTest.cmake ./config/cmake/vfdTest.cmake +./config/cmake/wait_H5Tinit.cmake ./config/cmake_ext_mod/ConfigureChecks.cmake ./config/cmake_ext_mod/CTestCustom.cmake @@ -3328,7 +3329,6 @@ ./config/cmake/scripts/CTestScript.cmake ./config/cmake/scripts/HDF5config.cmake ./config/cmake/scripts/HDF5options.cmake -./config/cmake/scripts/wait_H5Tinit.cmake # Files generated by autogen ./aclocal.m4 diff --git a/config/cmake/scripts/wait_H5Tinit.cmake b/config/cmake/scripts/wait_H5Tinit.cmake deleted file mode 100755 index c0b4d06..0000000 --- a/config/cmake/scripts/wait_H5Tinit.cmake +++ /dev/null @@ -1,11 +0,0 @@ -cmake_minimum_required (VERSION 3.10) - -message(STATUS "Check for existence of ${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.c") -execute_process(COMMAND ls ${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.c RESULT_VARIABLE H5TI_result OUTPUT_QUIET ERROR_QUIET) -while(H5TI_result) - ctest_sleep(30) - message(STATUS "Checking again for existence of ${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.c") - execute_process(COMMAND ls ${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.c RESULT_VARIABLE H5TI_result OUTPUT_QUIET ERROR_QUIET) -endwhile(H5TI_result) -file (TOUCH "${HDF5_BINARY_DIR}/H5Tinit_created") -message(STATUS "Found ${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.c") diff --git a/config/cmake/wait_H5Tinit.cmake b/config/cmake/wait_H5Tinit.cmake new file mode 100644 index 0000000..c0b4d06 --- /dev/null +++ b/config/cmake/wait_H5Tinit.cmake @@ -0,0 +1,11 @@ +cmake_minimum_required (VERSION 3.10) + +message(STATUS "Check for existence of ${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.c") +execute_process(COMMAND ls ${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.c RESULT_VARIABLE H5TI_result OUTPUT_QUIET ERROR_QUIET) +while(H5TI_result) + ctest_sleep(30) + message(STATUS "Checking again for existence of ${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.c") + execute_process(COMMAND ls ${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.c RESULT_VARIABLE H5TI_result OUTPUT_QUIET ERROR_QUIET) +endwhile(H5TI_result) +file (TOUCH "${HDF5_BINARY_DIR}/H5Tinit_created") +message(STATUS "Found ${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.c") diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 9660c89..bca5a92 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -956,7 +956,7 @@ if (NOT EXISTS ${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.c) WORKING_DIRECTORY ${HDF5_GENERATED_SOURCE_DIR} ) add_custom_target (gen_H5Tinit - COMMAND ${CMAKE_COMMAND} -P ${HDF5_SOURCE_DIR}/config/cmake/scripts/wait_H5Tinit.cmake + COMMAND ${CMAKE_COMMAND} -P ${HDF5_SOURCE_DIR}/config/cmake/wait_H5Tinit.cmake ) if (BUILD_SHARED_LIBS) add_custom_command ( -- cgit v0.12