]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Testsuite: do not use 0 for task limit 13350/head
authorMatthias Maier <tamiko@43-1.org>
Wed, 9 Feb 2022 12:38:16 +0000 (06:38 -0600)
committerMatthias Maier <tamiko@43-1.org>
Wed, 9 Feb 2022 13:07:07 +0000 (07:07 -0600)
tests/tests.h

index f12d9e15428a0e0ca97c818936d6a3e578c04e97..123e7b7b66636a1cc59bd39179cd2ce0bd3286d1 100644 (file)
@@ -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

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.