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=refs%2Fpull%2F13350%2Fhead;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