From: Wolfgang Bangerth Date: Fri, 30 Jun 2017 15:42:45 +0000 (-0600) Subject: Parallelize some operations. X-Git-Tag: v9.0.0-rc1~1456^2~3 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f413b3f8f80899921860ceed7ebf28cbe54d7f4d;p=dealii.git Parallelize some operations. The previous refactoring allows parallelizing renumbering for vertices, cells, and faces, since these all work on mutually independent data structures. --- 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);