From: Wolfgang Bangerth Date: Tue, 31 Dec 2019 21:47:01 +0000 (-0700) Subject: Provide TaskGroup::size(). X-Git-Tag: v9.2.0-rc1~728^2~2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6eb1ddebf1960b9ee5676efe7cf64f651de6e792;p=dealii.git Provide TaskGroup::size(). --- 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