diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 6706ed5208..7c8b5ee097 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -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!") @@ -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} ) @@ -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" )