Skip to content

Commit

Permalink
#1876: tests: fix num procs used for perf tests
Browse files Browse the repository at this point in the history
  • Loading branch information
nlslatt committed Jul 20, 2022
1 parent 41a66fb commit bda9a9d
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,12 @@ set(

file(GLOB PROJECT_PERF_TESTS ${PROJECT_TEST_PERF_DIR}/*.cc)

if (MPI_MAX_NUMPROC LESS 2)
set(PERF_TEST_NUMPROC 2)
else()
set(PERF_TEST_NUMPROC ${MPI_MAX_NUMPROC})
endif()

foreach(PERF_TEST ${PROJECT_PERF_TESTS})
if (${PERF_TEST} IN_LIST EXCLUDED_PERF_TEST_FILES)
message(STATUS "Test file ${PERF_TEST} is present on EXCLUDED_PERF_TEST_FILES list. Skipping!")
Expand All @@ -245,7 +251,7 @@ foreach(PERF_TEST ${PROJECT_PERF_TESTS})

add_test(
NAME ${TEST_NAME}
COMMAND ${MPI_RUN_COMMAND} ${MPI_EXTRA_FLAGS_LIST} ${MPI_NUMPROC_FLAG} ${MPI_MAX_NUMPROC}
COMMAND ${MPI_RUN_COMMAND} ${MPI_EXTRA_FLAGS_LIST} ${MPI_NUMPROC_FLAG} ${PERF_TEST_NUMPROC}
${CMAKE_CURRENT_BINARY_DIR}/${TEST_NAME} ${VT_TEST_EXTRA_FLAGS}
)

Expand All @@ -257,7 +263,7 @@ foreach(PERF_TEST ${PROJECT_PERF_TESTS})
set_tests_properties(
${TEST_NAME}
PROPERTIES
PROCESSORS ${MPI_NUMPROC_FLAG}
PROCESSORS ${PERF_TEST_NUMPROC}
TIMEOUT 300
LABELS "perf_test"
)
Expand Down

0 comments on commit bda9a9d

Please sign in to comment.