]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Do some hp DoF index allocation tasks in parallel.
authorWolfgang Bangerth <bangerth@colostate.edu>
Thu, 27 Sep 2018 16:05:44 +0000 (10:05 -0600)
committerWolfgang Bangerth <bangerth@colostate.edu>
Thu, 27 Sep 2018 16:05:44 +0000 (10:05 -0600)
source/hp/dof_handler.cc

index 582b58189068b5e24243bf0b3d2e1d35a1b493d1..78d6cf29b2134d14ad3d04f5b9d22c10ea928929 100644 (file)
@@ -648,8 +648,12 @@ namespace internal
 
           reserve_space_release_space(dof_handler);
 
-          reserve_space_cells(dof_handler);
-          reserve_space_vertices(dof_handler);
+          Threads::TaskGroup<> tasks;
+          tasks +=
+            Threads::new_task(&reserve_space_cells<1, spacedim>, dof_handler);
+          tasks += Threads::new_task(&reserve_space_vertices<1, spacedim>,
+                                     dof_handler);
+          tasks.join_all();
         }
 
 
@@ -666,12 +670,14 @@ namespace internal
 
           reserve_space_release_space(dof_handler);
 
-          // FIRST CELLS AND FACES
-          reserve_space_cells(dof_handler);
-          reserve_space_faces(dof_handler);
-
-          // VERTEX DOFS
-          reserve_space_vertices(dof_handler);
+          Threads::TaskGroup<> tasks;
+          tasks +=
+            Threads::new_task(&reserve_space_cells<2, spacedim>, dof_handler);
+          tasks +=
+            Threads::new_task(&reserve_space_faces<2, spacedim>, dof_handler);
+          tasks += Threads::new_task(&reserve_space_vertices<2, spacedim>,
+                                     dof_handler);
+          tasks.join_all();
         }
 
 
@@ -690,12 +696,15 @@ namespace internal
 
           reserve_space_release_space(dof_handler);
 
-          // FIRST CELLS AND FACES
-          reserve_space_cells(dof_handler);
-          reserve_space_faces(dof_handler);
-
+          Threads::TaskGroup<> tasks;
+          tasks +=
+            Threads::new_task(&reserve_space_cells<3, spacedim>, dof_handler);
+          tasks +=
+            Threads::new_task(&reserve_space_faces<3, spacedim>, dof_handler);
+          tasks += Threads::new_task(&reserve_space_vertices<3, spacedim>,
+                                     dof_handler);
 
-          // LINE DOFS
+          // While the tasks above are running, we can turn to line dofs
 
           // the situation here is pretty much like with vertices:
           // there can be an arbitrary number of finite elements
@@ -794,9 +803,8 @@ namespace internal
                   }
             }
 
-
-          // VERTEX DOFS
-          reserve_space_vertices(dof_handler);
+          // Ensure that everything is done at this point.
+          tasks.join_all();
         }
 
 

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.