]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Provide TaskGroup::size().
authorWolfgang Bangerth <bangerth@colostate.edu>
Tue, 31 Dec 2019 21:47:01 +0000 (14:47 -0700)
committerWolfgang Bangerth <bangerth@colostate.edu>
Tue, 7 Jan 2020 00:16:05 +0000 (17:16 -0700)
include/deal.II/base/thread_management.h

index 18d9cc8bfa3af9640282c005306379322cf67f3e..4568730caad952c17a0566a3d8e4c63b30473628 100644 (file)
@@ -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

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.