##
# Limit the deal.II thread pool to TEST_THREAD_LIMIT threads.
- export DEAL_II_NUM_THREADS="${TEST_THREAD_LIMIT}"
+ export TEST_N_THREADS="${TEST_THREAD_LIMIT}"
# Limit the OpenMP pool to two threads.
export OMP_NUM_THREADS="2"
/*
- * If we run 64 tests at the same time on a 64-core system, and
- * each of them runs 64 threads, then we get astronomical loads.
- * Limit concurrency to a fixed (small) number of threads, independent
- * of the core count.
+ * If we run 64 tests at the same time on a 64-core system, and each of
+ * them runs 64 threads, then we get astronomical loads. Limit concurrency
+ * to a fixed (small) number of threads, independent of the core count. The
+ * limit defaults to 3 and can be overriden by the environment variable
+ * TEST_N_THREADS.
*/
inline unsigned int
testing_max_num_threads()
{
- return 3;
+ if (const char *penv = std::getenv("TEST_N_THREADS"))
+ try
+ {
+ return Utilities::string_to_int(std::string(penv));
+ }
+ catch (...)
+ {
+ return 3;
+ }
+ else
+ return 3;
}
struct LimitConcurrency