Skip to content
Snippets Groups Projects
Commit 929783dd authored by Florian Uhlig's avatar Florian Uhlig
Browse files

Add possibility to define number of cpus for tests

When running the Dart.sh script normally all available cores are used which
works well in most cases. Up to now it was possible to limit the number of
used cores by defining the environment variable NCPU which was used for the
build as well as the test stage. Depending on the system this resulted in a
large number of tests which ran into timeouts which were not seen when running
the tests sequentially. With this commit it becomes possible to limit the used
cores during the test stage independently. This is done by defining the
environent variable NCPU4TEST.
parent bf068f78
No related branches found
No related tags found
1 merge request!1982Add possibility to define number of cpus for tests
Pipeline #32183 passed
......@@ -33,6 +33,9 @@ Set(CTEST_BUILD_COMMAND "${BUILD_COMMAND} -i -k -j$ENV{number_of_processors}")
#Include(CbmMacros)
#FairRootVersion()
message("Compiling with $ENV{number_of_processors} jobs in parallel.")
message("Testing with $ENV{number_of_processors_for_test} jobs in parallel.")
Set(CTEST_USE_LAUNCHERS 1)
If(${CBM_TEST_MODEL} MATCHES MergeRequest OR ${CBM_TEST_MODEL} MATCHES Continuous)
......@@ -139,7 +142,7 @@ If(NOT _RETVAL)
EndIf()
Ctest_Test(BUILD "${CTEST_BINARY_DIRECTORY}"
PARALLEL_LEVEL $ENV{number_of_processors}
PARALLEL_LEVEL $ENV{number_of_processors_for_test}
${repeat}
${stop_time}
RETURN_VALUE _ctest_test_ret_val
......
......@@ -119,15 +119,22 @@ then
fi
fi
if [ -z $NCPU4TEST ]; then
export number_of_processors_for_test=$number_of_processors
else
export number_of_processors_for_test=$NCPU4TEST
fi
echo "************************"
date
echo "LABEL: " $LABEL
echo "SITE: " $SITE
echo "Model: " ${ctest_model}
echo "Nr. of processes: " $number_of_processors
echo "Nr. of processes for build: " $number_of_processors
echo "Nr. of processes for test: " $number_of_processors_for_test
echo "************************"
cd $SOURCEDIR
ctest -S $SOURCEDIR/CbmRoot_test.cmake -V --VV -DCBM_TEST_MODEL=${ctest_model}
ctest -S $SOURCEDIR/CbmRoot_test.cmake -V -DCBM_TEST_MODEL=${ctest_model}
#ctest -S $SOURCEDIR/CbmRoot_test.cmake -V --VV
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment