File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -6,6 +6,10 @@ if (APPLE)
66 set (CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG TRUE )
77endif (APPLE )
88
9+ if (DEFINED ENV{PPC_ASAN_RUN} AND "$ENV{PPC_ASAN_RUN} " STREQUAL "1" )
10+ add_compile_definitions (USE_ASAN )
11+ endif ()
12+
913if (NOT CMAKE_BUILD_TYPE )
1014 set (CMAKE_BUILD_TYPE "Release" )
1115endif (NOT CMAKE_BUILD_TYPE )
Original file line number Diff line number Diff line change @@ -7,19 +7,19 @@ set(exec_perf_tests "ppc_perf_tests")
77# Init func tests executable files
88set (list_of_exec_tests "" )
99if (USE_FUNC_TESTS)
10- add_executable (${exec_func_tests} "${CMAKE_CURRENT_SOURCE_DIR } /runners/functional.cpp" )
10+ add_executable (${exec_func_tests} "${CMAKE_CURRENT_SOURCE_DIR } /common/ runners/functional.cpp" )
1111 list (APPEND list_of_exec_tests ${exec_func_tests} )
1212endif (USE_FUNC_TESTS )
1313
1414# Init perf tests executable files
1515if (USE_PERF_TESTS)
16- add_executable (${exec_perf_tests} "${CMAKE_CURRENT_SOURCE_DIR } /runners/performance.cpp" )
16+ add_executable (${exec_perf_tests} "${CMAKE_CURRENT_SOURCE_DIR } /common/ runners/performance.cpp" )
1717 list (APPEND list_of_exec_tests ${exec_perf_tests} )
1818endif (USE_PERF_TESTS )
1919
2020SUBDIRLIST (subdirs ${CMAKE_CURRENT_LIST_DIR } )
2121foreach (subd ${subdirs} )
22- if (subd STREQUAL "runners " )
22+ if (subd STREQUAL "common " )
2323 continue ()
2424 endif ()
2525 add_subdirectory (${subd} )
Original file line number Diff line number Diff line change @@ -71,6 +71,7 @@ class WorkerTestFailurePrinter : public ::testing::EmptyTestEventListener {
7171};
7272
7373int main (int argc, char ** argv) {
74+ #ifndef USE_ASAN
7475 MPI_Init (&argc, &argv);
7576
7677 // Limit the number of threads in TBB
@@ -92,4 +93,13 @@ int main(int argc, char** argv) {
9293
9394 MPI_Finalize ();
9495 return status;
96+ #else
97+ // Limit the number of threads in TBB
98+ tbb::global_control control (tbb::global_control::max_allowed_parallelism, ppc::util::GetNumThreads ());
99+ // Limit the number of threads in OMP
100+ omp_set_num_threads (ppc::util::GetNumThreads ());
101+
102+ ::testing::InitGoogleTest (&argc, argv);
103+ return RUN_ALL_TESTS ();
104+ #endif
95105}
Original file line number Diff line number Diff line change @@ -71,6 +71,7 @@ class WorkerTestFailurePrinter : public ::testing::EmptyTestEventListener {
7171};
7272
7373int main (int argc, char ** argv) {
74+ #ifndef USE_ASAN
7475 MPI_Init (&argc, &argv);
7576
7677 // Limit the number of threads in TBB
@@ -92,4 +93,13 @@ int main(int argc, char** argv) {
9293
9394 MPI_Finalize ();
9495 return status;
96+ #else
97+ // Limit the number of threads in TBB
98+ tbb::global_control control (tbb::global_control::max_allowed_parallelism, ppc::util::GetNumThreads ());
99+ // Limit the number of threads in OMP
100+ omp_set_num_threads (ppc::util::GetNumThreads ());
101+
102+ ::testing::InitGoogleTest (&argc, argv);
103+ return RUN_ALL_TESTS ();
104+ #endif
95105}
You can’t perform that action at this time.
0 commit comments