UnitTestBoundingIntervalHierarchy handles systems under load better

The UnitTestBoundingIntervalHierarchy has historically had problems
when the machine is already under-load when the algorithm is executed.
By limiting the number of openMP threads the test uses we can
reduce the amount of CPU time slicing that this test causes.
This commit is contained in:
Robert Maynard 2019-04-17 16:16:08 -04:00
parent 671c1df5c9
commit 9c29200723

@ -116,6 +116,13 @@ void TestBoundingIntervalHierarchy(vtkm::cont::DataSet dataSet, vtkm::IdComponen
void RunTest()
{
//If this test is run on a machine that already has heavy
//cpu usage it will fail, so we limit the number of threads
//to avoid the test timing out
#ifdef VTKM_ENABLE_OPENMP
omp_set_num_threads(std::min(4, omp_get_max_threads()));
#endif
TestBoundingIntervalHierarchy(ConstructDataSet(16), 3);
TestBoundingIntervalHierarchy(ConstructDataSet(16), 4);
TestBoundingIntervalHierarchy(ConstructDataSet(16), 6);