Skip to content

Commit

Permalink
Merge Pull Request #8063 from bartlettroscoe/Trilinos/7112-atdm-ride-…
Browse files Browse the repository at this point in the history
…run-serial

Automatically Merged using Trilinos Pull Request AutoTester
PR Title: Add <fullTestName>_SET_RUN_SERIAL and use on 'ride' (#7112), fix MaxOSX install (#7881)
PR Author: bartlettroscoe
  • Loading branch information
trilinos-autotester authored Sep 23, 2020
2 parents 7c42e25 + 90cee2a commit 8340613
Show file tree
Hide file tree
Showing 8 changed files with 189 additions and 20 deletions.
8 changes: 7 additions & 1 deletion cmake/ctest/TrilinosCTestDriverCore.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,13 @@ SET(Trilinos_REPOS_URL_BASE https://github.com/trilinos/
# it here.
SET(TRILINOS_CMAKE_DIR ${CMAKE_CURRENT_LIST_DIR}/../)

INCLUDE("${TRIBITS_PROJECT_ROOT}/cmake/tribits/ctest_driver/TribitsCTestDriverCore.cmake")
IF (NOT "$ENV{Trilinos_TRIBITS_DIR_OVERRIDE}" STREQUAL "")
SET(Trilinos_TRIBITS_DIR "$ENV{Trilinos_TRIBITS_DIR_OVERRIDE}")
ELSE()
SET(Trilinos_TRIBITS_DIR "${TRIBITS_PROJECT_ROOT}/cmake/tribits")
ENDIF()

INCLUDE("${Trilinos_TRIBITS_DIR}/ctest_driver/TribitsCTestDriverCore.cmake")

macro(TRILINOS_CTEST_DRIVER)
TRIBITS_CTEST_DRIVER()
Expand Down
19 changes: 18 additions & 1 deletion cmake/std/atdm/ride/tweaks/Tweaks.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,21 @@ IF (ATDM_NODE_TYPE STREQUAL "CUDA")

ENDIF()

ENDIF()
ENDIF()

IF (NOT ATDM_NODE_TYPE STREQUAL "CUDA" AND ATDM_CMAKE_BUILD_TYPE STREQUAL "DEBUG")

# Make a bunch of tests RUN_SERIAL that are timing out (#7112)
ATDM_SET_ENABLE(Intrepid2_unit-test_Projection_OpenMP_Test_Convergence_HEX_MPI_1_SET_RUN_SERIAL ON)
ATDM_SET_ENABLE(Intrepid2_unit-test_Projection_Serial_Test_Convergence_HEX_MPI_1_SET_RUN_SERIAL ON)
ATDM_SET_ENABLE(KokkosContainers_PerformanceTest_OpenMP_MPI_1_SET_RUN_SERIAL ON)
ATDM_SET_ENABLE(KokkosCore_UnitTest_Serial1_MPI_1_SET_RUN_SERIAL ON)
ATDM_SET_ENABLE(Rythmos_IntegratorBuilder_ConvergenceTest_MPI_1_SET_RUN_SERIAL ON)
ATDM_SET_ENABLE(Tempus_BDF2_MPI_1_SET_RUN_SERIAL ON)
ATDM_SET_ENABLE(Tempus_IMEX_RK_Combined_FSA_Tangent_MPI_1_SET_RUN_SERIAL ON)
ATDM_SET_ENABLE(Tempus_IMEX_RK_Partitioned_Combined_FSA_Partitioned_IMEX_RK_1st_Order_MPI_1_SET_RUN_SERIAL ON)
ATDM_SET_ENABLE(Tempus_IMEX_RK_Partitioned_Staggered_FSA_General_Partioned_IMEX_RK_MPI_1_SET_RUN_SERIAL ON)
ATDM_SET_ENABLE(Tempus_IMEX_RK_Staggered_FSA_Tangent_MPI_1_SET_RUN_SERIAL ON)
ATDM_SET_ENABLE(Tempus_IMEX_RK_Partitioned_Staggered_FSA_Partitioned_IMEX_RK_ARS_233_MPI_1_SET_RUN_SERIAL ON)

ENDIF()
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@ SET(PROJECT_MAKE_INSTALL_PERMS_CHANGE "@PROJECT_MAKE_INSTALL_PERMS_CHANGE@")
# Helper functions
#


SET(CHMOD_CHGRP_IDX 0)


FUNCTION(ECHO_AND_RUN_CMND)
STRING(REPLACE ";" " " CMND_STR "${ARGN}")
MESSAGE(STATUS "${CHMOD_CHGRP_IDX}: Running: ${CMND_STR}")
Expand All @@ -26,9 +28,21 @@ FUNCTION(ECHO_AND_RUN_CMND)
ENDIF()
ENDFUNCTION()


FUNCTION(SET_DIR_OWNER_AND_PERMS dirPath recurseFlag)

EXECUTE_PROCESS(COMMAND stat -c %U "${dirPath}"
IF (CMAKE_HOST_SYSTEM_NAME STREQUAL "Darwin")
SET(STAT_ARGS "-f%Su") # MacOSX stat
ELSE()
SET(STAT_ARGS "-c%U") # BinUtils stat
ENDIF()
# NOTE: Above, we can't have a space between the '-f' and '%Su' strings or
# the '-c' and '%U' strings. If you do, then you get a single space at the
# beginning of the returned owner name as ' <dirOwner>' instead of
# '<dirOwner>'. The automated tests on Linux and MacOSX don't pass if you
# don't have it this way.

EXECUTE_PROCESS(COMMAND stat ${STAT_ARGS} "${dirPath}"
OUTPUT_STRIP_TRAILING_WHITESPACE
OUTPUT_VARIABLE dirOwner)

Expand All @@ -40,12 +54,12 @@ FUNCTION(SET_DIR_OWNER_AND_PERMS dirPath recurseFlag)

IF (NOT "${PROJECT_MAKE_INSTALL_GROUP}" STREQUAL "")
ECHO_AND_RUN_CMND(
chgrp ${PROJECT_MAKE_INSTALL_GROUP} ${recurseFlag} "${dirPath}")
chgrp ${recurseFlag} ${PROJECT_MAKE_INSTALL_GROUP} "${dirPath}")
ENDIF()

IF (NOT "${PROJECT_MAKE_INSTALL_PERMS_CHANGE}" STREQUAL "")
ECHO_AND_RUN_CMND(
chmod ${PROJECT_MAKE_INSTALL_PERMS_CHANGE} ${recurseFlag} "${dirPath}")
chmod ${recurseFlag} ${PROJECT_MAKE_INSTALL_PERMS_CHANGE} "${dirPath}")
ENDIF()

ENDIF()
Expand All @@ -55,10 +69,12 @@ FUNCTION(SET_DIR_OWNER_AND_PERMS dirPath recurseFlag)

ENDFUNCTION()


#
# Executable script
#


IF (EXISTS "${projectInstallBaseDir}")

EXECUTE_PROCESS(COMMAND whoami
Expand Down
7 changes: 5 additions & 2 deletions cmake/tribits/core/package_arch/TribitsAddAdvancedTest.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -910,6 +910,9 @@ FUNCTION(TRIBITS_ADD_ADVANCED_TEST TEST_NAME_IN)
RETURN()
ENDIF()

TRIBITS_SET_RUN_SERIAL(${TEST_NAME} "${PARSE_RUN_SERIAL}"
SET_RUN_SERIAL)

TRIBITS_SET_DISABLED_AND_MSG(${TEST_NAME} "${PARSE_DISABLED}"
SET_DISABLED_AND_MSG) # Adds the test but sets DISABLED test prop!

Expand Down Expand Up @@ -1386,7 +1389,7 @@ FUNCTION(TRIBITS_ADD_ADVANCED_TEST TEST_NAME_IN)
LIST(REMOVE_DUPLICATES TEST_EXE_LIST)
TRIBITS_SET_TEST_PROPERTY(${TEST_NAME} PROPERTY REQUIRED_FILES ${TEST_EXE_LIST})

IF(PARSE_RUN_SERIAL)
IF(SET_RUN_SERIAL)
TRIBITS_SET_TESTS_PROPERTIES(${TEST_NAME} PROPERTIES RUN_SERIAL ON)
ENDIF()

Expand Down Expand Up @@ -1431,7 +1434,7 @@ FUNCTION(TRIBITS_ADD_ADVANCED_TEST TEST_NAME_IN)
TRIBITS_PRIVATE_ADD_TEST_PRINT_ADDED(${TEST_NAME}
"${PARSE_CATEGORIES}" "${MAX_NUM_MPI_PROCS_USED_TO_PRINT}"
"${MAX_NUM_PROCESSORS_USED}" "${TIMEOUT_USED}"
"${SET_DISABLED_AND_MSG}")
"${SET_RUN_SERIAL}" "${SET_DISABLED_AND_MSG}")

#
# F.2) Write the cmake -P script
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,63 @@
INCLUDE(Join)
INCLUDE(TribitsFilepathHelpers)
INCLUDE(AppendStringVarWithSep)


FUNCTION(TRIBITS_RAISE_INSTALL_PERMS_MODS_NOT_SUPPORTED_ON_WINDOWS_ERROR)

SET(INSTALL_PERMS_SET "")
TRIBITS_APPEND_INSTALL_PERMS_VAR_NOT_SUPPORTED(
${PROJECT_NAME}_MAKE_INSTALL_GROUP_WRITABLE)
TRIBITS_APPEND_INSTALL_PERMS_VAR_NOT_SUPPORTED(
${PROJECT_NAME}_MAKE_INSTALL_GROUP_READABLE)
TRIBITS_APPEND_INSTALL_PERMS_VAR_NOT_SUPPORTED(
${PROJECT_NAME}_MAKE_INSTALL_WORLD_READABLE)
TRIBITS_APPEND_INSTALL_PERMS_VAR_NOT_SUPPORTED(
${PROJECT_NAME}_MAKE_INSTALL_GROUP)

MESSAGE(FATAL_ERROR
"ERROR: The options:\n"
"${INSTALL_PERMS_SET}"
"are not supported on Windows!\n"
"Please remove these options and configure from scratch!"
)

ENDFUNCTION()


# Reads and writes var INSTALL_PERMS_SET in above function
MACRO(TRIBITS_APPEND_INSTALL_PERMS_VAR_NOT_SUPPORTED VAR_NAME)
IF (NOT "${${VAR_NAME}}" STREQUAL "")
SET(INSTALL_PERMS_SET "${INSTALL_PERMS_SET} ${VAR_NAME}='${${VAR_NAME}}'\n")
ENDIF()
ENDMACRO()


FUNCTION(TRIBITS_DETERMINE_IF_SETUP_FOR_GROUP_AND_PERMS_MODIFICATIONS
SETUP_FOR_GROUP_AND_PERMS_MODIFICATIONS_OUT
)

IF(
${PROJECT_NAME}_MAKE_INSTALL_GROUP_WRITABLE OR
${PROJECT_NAME}_MAKE_INSTALL_GROUP_READABLE OR
${PROJECT_NAME}_MAKE_INSTALL_WORLD_READABLE OR
(NOT "${${PROJECT_NAME}_MAKE_INSTALL_GROUP}" STREQUAL "")
)
SET(setupForGroupAndPermsModifications TRUE)
ELSE()
SET(setupForGroupAndPermsModifications FALSE)
ENDIF()

IF (setupForGroupAndPermsModifications AND
${PROJECT_NAME}_HOSTTYPE STREQUAL "Windows"
)
TRIBITS_RAISE_INSTALL_PERMS_MODS_NOT_SUPPORTED_ON_WINDOWS_ERROR()
ENDIF()

SET(${SETUP_FOR_GROUP_AND_PERMS_MODIFICATIONS_OUT}
${setupForGroupAndPermsModifications} PARENT_SCOPE)

ENDFUNCTION()


FUNCTION(TRIBITS_CONFIGURE_SET_INSTALLED_GROUP_AND_PERMS_FILE TARGET_FILE)
Expand Down Expand Up @@ -41,7 +99,10 @@ ENDFUNCTION()

FUNCTION(TRIBITS_ADD_INSTALL_GROUP_AND_PERMS_FIXUPS)

IF (NOT CMAKE_SYSTEM_NAME STREQUAL "Windows")
TRIBITS_DETERMINE_IF_SETUP_FOR_GROUP_AND_PERMS_MODIFICATIONS(
setupForGroupAndPermsModifications)

IF (setupForGroupAndPermsModifications)

SET(set_installed_group_and_permissions_file
"${PROJECT_BINARY_DIR}/set_installed_group_and_permissions.cmake")
Expand Down
19 changes: 14 additions & 5 deletions cmake/tribits/core/package_arch/TribitsAddTest.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -886,9 +886,6 @@ FUNCTION(TRIBITS_ADD_TEST EXE_NAME)
RETURN()
ENDIF()

TRIBITS_SET_DISABLED_AND_MSG(${TEST_NAME} "${PARSE_DISABLED}"
SET_DISABLED_AND_MSG) # Adds the test but sets DISABLED test prop!

#
# C) Set the name and path of the binary that will be run
#
Expand Down Expand Up @@ -967,10 +964,16 @@ FUNCTION(TRIBITS_ADD_TEST EXE_NAME)
PRINT_VAR(INARGS)
ENDIF()

TRIBITS_SET_RUN_SERIAL(${TEST_NAME_INSTANCE} "${PARSE_RUN_SERIAL}"
SET_RUN_SERIAL)

TRIBITS_SET_DISABLED_AND_MSG(${TEST_NAME_INSTANCE} "${PARSE_DISABLED}"
SET_DISABLED_AND_MSG)

TRIBITS_ADD_TEST_ADD_TEST_ALL( ${TEST_NAME_INSTANCE}
"${EXECUTABLE_PATH}" "${PARSE_CATEGORIES}" "${NUM_PROCS_USED}"
"${NUM_TOTAL_CORES_USED}"
${PARSE_RUN_SERIAL} "${SET_DISABLED_AND_MSG}" ADDED_TEST_NAME ${INARGS}
"${SET_RUN_SERIAL}" "${SET_DISABLED_AND_MSG}" ADDED_TEST_NAME ${INARGS}
"${${TEST_NAME_INSTANCE}_EXTRA_ARGS}" )
IF(PARSE_ADDED_TESTS_NAMES_OUT AND ADDED_TEST_NAME)
LIST(APPEND ADDED_TESTS_NAMES_OUT ${ADDED_TEST_NAME})
Expand Down Expand Up @@ -1002,11 +1005,17 @@ FUNCTION(TRIBITS_ADD_TEST EXE_NAME)

SET(TEST_NAME_INSTANCE "${TEST_NAME}_${POSTFIX}${MPI_NAME_POSTFIX}")

TRIBITS_SET_RUN_SERIAL(${TEST_NAME_INSTANCE} "${PARSE_RUN_SERIAL}"
SET_RUN_SERIAL)

TRIBITS_SET_DISABLED_AND_MSG(${TEST_NAME_INSTANCE} "${PARSE_DISABLED}"
SET_DISABLED_AND_MSG)

TRIBITS_ADD_TEST_ADD_TEST_ALL( ${TEST_NAME_INSTANCE}
"${EXECUTABLE_PATH}" "${PARSE_CATEGORIES}" "${NUM_PROCS_USED}"
"${NUM_TOTAL_CORES_USED}"
${PARSE_CREATE_WORKING_DIR}
${PARSE_RUN_SERIAL} "${SET_DISABLED_AND_MSG}" ADDED_TEST_NAME ${INARGS}
"${SET_RUN_SERIAL}" "${SET_DISABLED_AND_MSG}" ADDED_TEST_NAME ${INARGS}
"${${TEST_NAME_INSTANCE}_EXTRA_ARGS}"
)
IF(PARSE_ADDED_TESTS_NAMES_OUT AND ADDED_TEST_NAME)
Expand Down
47 changes: 40 additions & 7 deletions cmake/tribits/core/package_arch/TribitsAddTestHelpers.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -599,7 +599,7 @@ ENDFUNCTION()
#
# TRIBITS_SET_DISABLED_AND_MSG(
# <testName> # The full test name passed to add_test()
# "${PARSE_DISABLED}" # From the input arg DISABLED <msg>
# "${PARSE_DISABLED}" # From the input arg "DISABLED <msg>"
# <setDisabledAndMsgOut> # Sets var of this name
# )
#
Expand All @@ -617,6 +617,32 @@ FUNCTION(TRIBITS_SET_DISABLED_AND_MSG TEST_NAME_IN PARSE_DISABLED
ENDFUNCTION()


#
# Read ${TEST_NAME_IN}_SET_RUN_SERIAL and set output
# var SET_RUN_SERIAL_OUT
#
# Usage:
#
# TRIBITS_SET_RUN_SERIAL(
# <testName> # The full test name passed to add_test()
# "${PARSE_RUN_SERIAL}" # From the input option "RUN_SERIAL"
# <setRunSerial> # Sets var of this name
# )
#
FUNCTION(TRIBITS_SET_RUN_SERIAL TEST_NAME_IN PARSE_RUN_SERIAL
SET_RUN_SERIAL_OUT
)

SET(SET_RUN_SERIAL "${PARSE_RUN_SERIAL}")
IF (NOT "${${TEST_NAME_IN}_SET_RUN_SERIAL}" STREQUAL "")
SET(SET_RUN_SERIAL "${${TEST_NAME_IN}_SET_RUN_SERIAL}")
ENDIF()

SET(${SET_RUN_SERIAL_OUT} "${SET_RUN_SERIAL}" PARENT_SCOPE)

ENDFUNCTION()


#
# Determine if the test should be skipped due to a disable var set
#
Expand Down Expand Up @@ -777,7 +803,7 @@ ENDFUNCTION()
# Print test added message!
#
FUNCTION(TRIBITS_PRIVATE_ADD_TEST_PRINT_ADDED TEST_NAME_IN CATEGORIES_IN
NUM_MPI_PROCS_IN PROCESSORS_IN TIMEOUT_IN DISABLED_MSG_IN
NUM_MPI_PROCS_IN PROCESSORS_IN TIMEOUT_IN RUN_SERIAL_IN DISABLED_MSG_IN
)

SET(ADDED_TEST_PROPS "")
Expand All @@ -797,6 +823,11 @@ FUNCTION(TRIBITS_PRIVATE_ADD_TEST_PRINT_ADDED TEST_NAME_IN CATEGORIES_IN
", " "TIMEOUT=${TIMEOUT_IN}")
ENDIF()

IF (RUN_SERIAL_IN)
APPEND_STRING_VAR_WITH_SEP(ADDED_TEST_PROPS
", " "RUN_SERIAL")
ENDIF()

IF (DISABLED_MSG_IN)
APPEND_STRING_VAR_WITH_SEP(ADDED_TEST_PROPS
", " "DISABLED")
Expand All @@ -823,7 +854,7 @@ ENDFUNCTION()
#
FUNCTION(TRIBITS_ADD_TEST_ADD_TEST_ALL TEST_NAME_IN
EXECUTABLE_PATH_IN CATEGORIES_IN NUM_PROCS_USED_IN NUM_TOTAL_CORES_USED_IN
RUN_SERIAL_IN DISABLED_MSG_IN
RUN_SERIAL_IN DISABLED_MSG_IN
ADDED_TEST_NAME_OUT
)

Expand All @@ -839,7 +870,7 @@ FUNCTION(TRIBITS_ADD_TEST_ADD_TEST_ALL TEST_NAME_IN

TRIBITS_PRIVATE_ADD_TEST_POST_PROCESS_ADDED_TEST(${TEST_NAME_IN}
"${CATEGORIES_IN}" ${NUM_PROCS_USED_IN} "${NUM_TOTAL_CORES_USED_IN}"
"${DISABLED_MSG_IN}")
"${RUN_SERIAL_IN}" "${DISABLED_MSG_IN}")

ELSE()

Expand Down Expand Up @@ -873,7 +904,8 @@ ENDFUNCTION()

FUNCTION(TRIBITS_PRIVATE_ADD_TEST_POST_PROCESS_ADDED_TEST TEST_NAME_IN
CATEGORIES_IN NUM_PROCS_USED_IN NUM_TOTAL_CORES_USED_IN
DISABLED_MSG_IN)
RUN_SERIAL_IN DISABLED_MSG_IN
)

TRIBITS_PRIVATE_ADD_TEST_SET_PASSFAIL_PROPERTIES(${TEST_NAME_IN})
TRIBITS_PRIVATE_ADD_TEST_SET_ENVIRONMENT(${TEST_NAME_IN})
Expand All @@ -889,13 +921,14 @@ FUNCTION(TRIBITS_PRIVATE_ADD_TEST_POST_PROCESS_ADDED_TEST TEST_NAME_IN
TRIBITS_SET_TESTS_PROPERTIES(${TEST_NAME_IN} PROPERTIES DISABLED ON)
ENDIF()

TRIBITS_PRIVATE_ADD_TEST_ADD_ENVIRONMENT_AND_RESOURCE(${TEST_NAME_IN} ${NUM_PROCS_USED_IN})
TRIBITS_PRIVATE_ADD_TEST_ADD_ENVIRONMENT_AND_RESOURCE(${TEST_NAME_IN}
${NUM_PROCS_USED_IN})

TRIBITS_PRIVATE_ADD_TEST_ADD_LABEL_AND_KEYWORDS(${TEST_NAME_IN})

TRIBITS_PRIVATE_ADD_TEST_PRINT_ADDED(${TEST_NAME_IN}
"${CATEGORIES_IN}" "${NUM_PROCS_USED_IN}" "${PROCESSORS_USED}"
"${TIMEOUT_USED}" "${DISABLED_MSG_IN}")
"${TIMEOUT_USED}" "${RUN_SERIAL_IN}" "${DISABLED_MSG_IN}")

ENDFUNCTION()

Expand Down
24 changes: 24 additions & 0 deletions cmake/tribits/doc/build_ref/TribitsBuildReferenceBody.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2040,6 +2040,30 @@ at configure time. Therefore, all of the decisions about what test targets
should be build and which tests should be run can be made at configure time.


Set specific tests to run in serial
+++++++++++++++++++++++++++++++++++

In order to cause a specific test to run by itself on the machine and not at
the same time as other tests (such as when running multiple tests at the same
time with something like ``ctest -j16``), set at configure time::

-D <fullTestName>_SET_RUN_SERIAL=ON

This will set the CTest test property ``RUN_SERIAL`` for the test
``<fullTestName>``.

This can help to avoid longer runtimes and timeouts when some individual tests
don't run as quickly when run beside other tests running at the same time on
the same machine. These longer runtimes can often occur when running tests
with CUDA code on GPUs and with OpenMP code on some platforms with some OpenMP
options.

Also, if individual tests have ``RUN_SERIAL`` set by default internally, they
can have the ``RUN_SERIAL`` property removed by setting::

-D <fullTestName>_SET_RUN_SERIAL=OFF


Trace test addition or exclusion
++++++++++++++++++++++++++++++++

Expand Down

0 comments on commit 8340613

Please sign in to comment.