Skip to content

Commit

Permalink
Merge branch '7112-atdm-ride-run-serial' into atdm-nightly-manual-upd…
Browse files Browse the repository at this point in the history
…ates (#7112, #7881, #8063)
  • Loading branch information
bartlettroscoe committed Sep 19, 2020
2 parents 294b04f + a64fbf9 commit 5597546
Show file tree
Hide file tree
Showing 8 changed files with 141 additions and 18 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
18 changes: 17 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,20 @@ 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)

ENDIF()
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,13 @@ ENDFUNCTION()

FUNCTION(SET_DIR_OWNER_AND_PERMS dirPath recurseFlag)

EXECUTE_PROCESS(COMMAND stat -c %U "${dirPath}"
IF (CMAKE_SYSTEM_NAME STREQUAL "Darwin")
SET(STAT_ARG "-f") # MacOSX stat
ELSE()
SET(STAT_ARG "-c") # BinUtils stat
ENDIF()

EXECUTE_PROCESS(COMMAND stat ${STAT_ARG} %U "${dirPath}"
OUTPUT_STRIP_TRAILING_WHITESPACE
OUTPUT_VARIABLE dirOwner)

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
Expand Up @@ -2,6 +2,29 @@ INCLUDE(Join)
INCLUDE(TribitsFilepathHelpers)


FUNCTION(TRIBITS_DETERMINE_IF_SETUP_FOR_GROUP_AND_PERMS_MODIFICATIONS
SETUP_FOR_GROUP_AND_PERMS_MODIFICATIONS_OUT
)

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

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

ENDFUNCTION()


FUNCTION(TRIBITS_CONFIGURE_SET_INSTALLED_GROUP_AND_PERMS_FILE TARGET_FILE)

SET(PROJECT_SET_GROUP_AND_PERMISSIONS_ON_INSTALL_BASE_DIR
Expand Down Expand Up @@ -41,7 +64,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 5597546

Please sign in to comment.