From 6eb1ddebf1960b9ee5676efe7cf64f651de6e792 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Tue, 31 Dec 2019 14:47:01 -0700 Subject: [PATCH] Provide TaskGroup::size(). --- include/deal.II/base/thread_management.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/include/deal.II/base/thread_management.h b/include/deal.II/base/thread_management.h index 18d9cc8bfa..4568730caa 100644 --- a/include/deal.II/base/thread_management.h +++ b/include/deal.II/base/thread_management.h @@ -1824,6 +1824,21 @@ namespace Threads return *this; } + + /** + * Return how many tasks have been put into this group. This + * function does not distinguish how many of these tasks have + * already run and have finished, are still waiting to be + * scheduled to a CPU resource, or are currently running. Tasks + * that have been joined already are also still counted. + */ + std::size_t + size() const + { + return tasks.size(); + } + + /** * Wait for all tasks in the collection to finish. It is not a problem if * some of them have already been waited for, i.e. you may call this -- 2.39.5