Updates will be applied - 12:30pm EDT (UTC -400). Site will be down for around 30

Commit 48cc2f66 authored by Robert Maynard's avatar Robert Maynard

Make sure VTK-m runs all OpenMP tests serially.

Fixes issue #276.
OpenMP tests when run in parallel exhibit negative scaling as we
have N openMP processes each spawning N threads. We speculate that
this causes excessive context switching and swapping and reduces
performance.
parent b9082cd8
......@@ -387,7 +387,7 @@ function(vtkm_unit_tests)
vtkm_get_kit_name(kit)
set(test_prog "UnitTests_${kit}")
endif()
if(VTKm_UT_BACKEND)
if(backend)
set(test_prog "${test_prog}_${backend}")
endif()
......@@ -421,10 +421,18 @@ function(vtkm_unit_tests)
#determine the timeout for all the tests based on the backend. CUDA tests
#generally require more time because of kernel generation.
set(timeout 180)
set(run_serial False)
if(backend STREQUAL "CUDA")
set(timeout 1500)
elseif(backend STREQUAL "OPENMP")
#We need to have all OpenMP tests run serially as they
#will uses all the system cores, and we will cause a N*N thread
#explosion which causes the tests to run slower than when run
#serially
set(run_serial True)
endif()
foreach (test ${VTKm_UT_SOURCES})
get_filename_component(tname ${test} NAME_WE)
if(VTKm_UT_MPI AND VTKm_ENABLE_MPI)
......@@ -438,7 +446,10 @@ function(vtkm_unit_tests)
COMMAND ${test_prog} ${tname} ${VTKm_UT_TEST_ARGS}
)
endif()
set_tests_properties("${tname}${backend}" PROPERTIES TIMEOUT ${timeout})
set_tests_properties("${tname}${backend}" PROPERTIES
TIMEOUT ${timeout}
RUN_SERIAL ${run_serial}
)
endforeach (test)
endfunction(vtkm_unit_tests)
......
......@@ -31,3 +31,14 @@ set(unit_tests
UnitTestOpenMPVirtualObjectHandle.cxx
)
vtkm_unit_tests(OpenMP SOURCES ${unit_tests})
#We need to have all OpenMP tests run serially as they
#will uses all the system cores, and we will cause a N*N thread
#explosion which causes the tests to run slower than when run
#serially
foreach (test ${unit_tests})
get_filename_component(tname ${test} NAME_WE)
set_tests_properties(${tname} PROPERTIES
RUN_SERIAL True
)
endforeach()
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment