diff options
author | Brad King <brad.king@kitware.com> | 2018-03-01 15:38:15 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2018-03-05 14:21:32 (GMT) |
commit | 6be53c6695e8d82d3633681f893b79db1de466f0 (patch) | |
tree | 753efcf002e0af8545df663288627d142a299f80 /Source/CTest/cmCTestTestHandler.cxx | |
parent | c5428d8db2aebb215b418d72eae99f4a106a82b0 (diff) | |
download | CMake-6be53c6695e8d82d3633681f893b79db1de466f0.zip CMake-6be53c6695e8d82d3633681f893b79db1de466f0.tar.gz CMake-6be53c6695e8d82d3633681f893b79db1de466f0.tar.bz2 |
CTest: Add options to control test process affinity to CPUs
In commit v2.8.0~170 (ENH: Added ctest test options PROCESSORS and
RUN_SERIAL, 2009-09-07) CTest learned to track the number of processors
allocated to running tests in order to balance it against the desired
level of parallelism. Extend this idea by introducing a new
`PROCESSOR_AFFINITY` test property to ask that CTest run a test
with the CPU affinity mask set. This will allow a set of tests
that are running concurrently to use disjoint CPU resources.
Diffstat (limited to 'Source/CTest/cmCTestTestHandler.cxx')
-rw-r--r-- | Source/CTest/cmCTestTestHandler.cxx | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx index 84d8926..d1affd4 100644 --- a/Source/CTest/cmCTestTestHandler.cxx +++ b/Source/CTest/cmCTestTestHandler.cxx @@ -2165,6 +2165,9 @@ bool cmCTestTestHandler::SetTestsProperties( rt.Processors = 1; } } + if (key == "PROCESSOR_AFFINITY") { + rt.WantAffinity = cmSystemTools::IsOn(val.c_str()); + } if (key == "SKIP_RETURN_CODE") { rt.SkipReturnCode = atoi(val.c_str()); if (rt.SkipReturnCode < 0 || rt.SkipReturnCode > 255) { @@ -2336,6 +2339,7 @@ bool cmCTestTestHandler::AddTest(const std::vector<std::string>& args) test.ExplicitTimeout = false; test.Cost = 0; test.Processors = 1; + test.WantAffinity = false; test.SkipReturnCode = -1; test.PreviousRuns = 0; if (this->UseIncludeRegExpFlag && |