From d3eba36c5d87f07bcc46c96783156e2875884563 Mon Sep 17 00:00:00 2001 From: Martin Kroeker Date: Fri, 10 Apr 2020 12:32:37 +0200 Subject: [PATCH] Reduce thread count if necessary --- cpp_thread_test/dgemm_thread_safety.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cpp_thread_test/dgemm_thread_safety.cpp b/cpp_thread_test/dgemm_thread_safety.cpp index 1b6ad3826..f10886518 100644 --- a/cpp_thread_test/dgemm_thread_safety.cpp +++ b/cpp_thread_test/dgemm_thread_safety.cpp @@ -14,7 +14,11 @@ int main(int argc, char* argv[]){ blasint randomMatSize = 1024; //dimension of the random square matrices used uint32_t numConcurrentThreads = 96; //number of concurrent calls of the functions being tested uint32_t numTestRounds = 16; //number of testing rounds before success exit + uint32_t maxHwThreads = omp_get_max_threads(); + if (maxHwThreads() < 96) + numConcurrentThreads = maxHwThreads; + if (argc > 4){ std::cout<<"ERROR: too many arguments for thread safety tester"<