From 3a96da9c3a3789da67e175ebc82ad0ab6a0aed96 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Thu, 27 Sep 2018 10:05:44 -0600 Subject: [PATCH] Do some hp DoF index allocation tasks in parallel. --- source/hp/dof_handler.cc | 40 ++++++++++++++++++++++++---------------- 1 file changed, 24 insertions(+), 16 deletions(-) diff --git a/source/hp/dof_handler.cc b/source/hp/dof_handler.cc index 582b581890..78d6cf29b2 100644 --- a/source/hp/dof_handler.cc +++ b/source/hp/dof_handler.cc @@ -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(); } -- 2.39.5