From: Wolfgang Bangerth Date: Sun, 28 Apr 2024 13:02:30 +0000 (+0530) Subject: Remove a non-functional test. X-Git-Tag: v9.6.0-rc1~338^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F16933%2Fhead;p=dealii.git Remove a non-functional test. --- diff --git a/tests/multithreading/task_11.cc b/tests/multithreading/task_11.cc deleted file mode 100644 index 8033b8532c..0000000000 --- a/tests/multithreading/task_11.cc +++ /dev/null @@ -1,99 +0,0 @@ -// ------------------------------------------------------------------------ -// -// SPDX-License-Identifier: LGPL-2.1-or-later -// Copyright (C) 2015 - 2020 by the deal.II authors -// -// This file is part of the deal.II library. -// -// Part of the source code is dual licensed under Apache-2.0 WITH -// LLVM-exception OR LGPL-2.1-or-later. Detailed license information -// governing the source code and code contributions can be found in -// LICENSE.md and CONTRIBUTING.md at the top level directory of deal.II. -// -// ------------------------------------------------------------------------ - -// test calling MultithreadInfo::set_thread_limit() multiple times and the -// effect for running tasks - -#include - -#include "../tests.h" - -Threads::Mutex mutex; -unsigned int n_running; -unsigned int n_max_running; - -void -a_task() -{ - mutex.lock(); - n_running++; - n_max_running = std::max(n_max_running, n_running); - mutex.unlock(); - - // Sleep some time to make sure all other concurrently running tasks enter - // here. - std::this_thread::sleep_for(std::chrono::seconds(1)); - - mutex.lock(); - n_running--; - mutex.unlock(); -} - - -void -test() -{ - Threads::TaskGroup<> tg; - - n_running = 0; - n_max_running = 0; - - // force all tasks to wait until we are done starting - mutex.lock(); - - for (unsigned int t = 0; t < 10; ++t) - tg += Threads::new_task(a_task); - - // now let the tasks run - mutex.unlock(); - - tg.join_all(); -} - - -int -main() -{ - initlog(); - - const unsigned int n = testing_max_num_threads(); - - // if we have a machine with less than 5 cores fake the output: - if (MultithreadInfo::n_threads() < n) - { - // you should buy more cores, seriously. - deallog << "* default thread limit for tests: " << n << std::endl; - deallog << "max concurrent running: " << n << " should be: " << n - << std::endl; - } - else if (MultithreadInfo::n_threads() == n) - { - deallog << "* default thread limit for tests: " - << MultithreadInfo::n_threads() << std::endl; - test(); - } - else - Assert(false, - ExcInternalError( - "did somebody mess with LimitConcurrency in tests.h?")); - - deallog << "* now with thread limit 1:" << std::endl; - MultithreadInfo::set_thread_limit(1); - test(); - deallog << "* now with thread limit 2:" << std::endl; - MultithreadInfo::set_thread_limit(2); - test(); - - deallog << "OK" << std::endl; -}