From f413b3f8f80899921860ceed7ebf28cbe54d7f4d Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Fri, 30 Jun 2017 09:42:45 -0600 Subject: [PATCH] Parallelize some operations. The previous refactoring allows parallelizing renumbering for vertices, cells, and faces, since these all work on mutually independent data structures. --- source/dofs/dof_handler_policy.cc | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/source/dofs/dof_handler_policy.cc b/source/dofs/dof_handler_policy.cc index e4fbc271b1..49618a6051 100644 --- a/source/dofs/dof_handler_policy.cc +++ b/source/dofs/dof_handler_policy.cc @@ -20,6 +20,7 @@ #include #include #include +#include #include #include #include @@ -782,9 +783,23 @@ namespace internal if (dim == 1) Assert (indices == IndexSet(0), ExcNotImplemented()); - renumber_vertex_dofs (new_numbers, indices, dof_handler, check_validity); - renumber_face_dofs (new_numbers, indices, dof_handler); - renumber_cell_dofs (new_numbers, indices, dof_handler); + // renumber DoF indices on vertices, cells, and faces. this + // can be done in parallel because the respective functions + // work on separate data structures + Threads::TaskGroup<> tasks; + tasks += Threads::new_task ([&]() + { + renumber_vertex_dofs (new_numbers, indices, dof_handler, check_validity); + }); + tasks += Threads::new_task ([&]() + { + renumber_face_dofs (new_numbers, indices, dof_handler); + }); + tasks += Threads::new_task ([&]() + { + renumber_cell_dofs (new_numbers, indices, dof_handler); + }); + tasks.join_all (); // update the cache used for cell dof indices update_all_level_cell_dof_indices_caches(dof_handler); -- 2.39.5