]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Use TaskGroup instead of ThreadGroup in step-9.
authorturcksin <turcksin@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 28 Oct 2013 14:21:21 +0000 (14:21 +0000)
committerturcksin <turcksin@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 28 Oct 2013 14:21:21 +0000 (14:21 +0000)
git-svn-id: https://svn.dealii.org/trunk@31466 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/examples/step-9/step-9.cc

index f81f6ac395b21567e5efd9607cd234ca29612668..445d5e3e1ae2a73cb23681e83db1eb27898cd472 100644 (file)
@@ -56,6 +56,7 @@
 // how many threads to start in parallel.
 #include <deal.II/base/work_stream.h>
 #include <deal.II/base/multithread_info.h>
+#include <deal.II/base/thread_management.h>
 
 // The next new include file declares a base class <code>TensorFunction</code>
 // not unlike the <code>Function</code> class, but with the difference that
@@ -964,20 +965,20 @@ namespace Step9
     // or the other compiler, but have to take a temporary variable for that
     // purpose. Here, in this case, Compaq's <code>cxx</code> compiler choked
     // on the code so we use this workaround with the function pointer:
-    Threads::ThreadGroup<> threads;
+    Threads::TaskGroup<> tasks;
     void (*estimate_interval_ptr) (const DoFHandler<dim> &,
                                    const Vector<double> &,
                                    const IndexInterval &,
                                    Vector<float> &)
       = &GradientEstimation::template estimate_interval<dim>;
     for (unsigned int i=0; i<n_threads; ++i)
-      threads += Threads::new_thread (estimate_interval_ptr,
-                                      dof_handler, solution,
-                                      index_intervals[i],
-                                      error_per_cell);
+      tasks += Threads::new_task (estimate_interval_ptr,
+                                  dof_handler, solution,
+                                  index_intervals[i],
+                                  error_per_cell);
     // Ok, now the threads are at work, and we only have to wait for them to
     // finish their work:
-    threads.join_all ();
+    tasks.join_all ();
     // Note that if the value of the variable
     // <code>multithread_info.n_threads()</code> was one, or if the
     // library was not configured to use threads, then the sequence of

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.