From: Matthias Maier Date: Wed, 9 Feb 2022 12:38:16 +0000 (-0600) Subject: Testsuite: do not use 0 for task limit X-Git-Tag: v9.4.0-rc1~518^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5b63ed281661a999e7aa3ca02189fac28bd07489;p=dealii.git Testsuite: do not use 0 for task limit --- diff --git a/tests/tests.h b/tests/tests.h index f12d9e1542..123e7b7b66 100644 --- a/tests/tests.h +++ b/tests/tests.h @@ -427,17 +427,20 @@ filter_out_small_numbers(const Number number, const double tolerance) inline unsigned int testing_max_num_threads() { + const int default_n_threads = 3; + if (const char *penv = std::getenv("TEST_N_THREADS")) try { - return Utilities::string_to_int(std::string(penv)); + const int n_threads = Utilities::string_to_int(std::string(penv)); + return n_threads > 0 ? n_threads : default_n_threads; } catch (...) { - return 3; + return default_n_threads; } else - return 3; + return default_n_threads; } struct LimitConcurrency