From: Wolfgang Bangerth Date: Tue, 28 Apr 2020 18:39:55 +0000 (-0600) Subject: Do the computations in parallel. X-Git-Tag: v9.2.0-rc1~156^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4f375ff02106e296e4555e29bb9ade9ee1098580;p=dealii.git Do the computations in parallel. --- diff --git a/source/hp/fe_values.cc b/source/hp/fe_values.cc index 04291740bb..ec227e87b0 100644 --- a/source/hp/fe_values.cc +++ b/source/hp/fe_values.cc @@ -80,6 +80,7 @@ namespace hp // We've already resized the `fe_values_table` correctly above, but right // now it just contains nullptrs. Create copies of the objects that // `other.fe_values_table` stores + Threads::TaskGroup<> task_group; for (unsigned int fe_index = 0; fe_index < fe_collection->size(); ++fe_index) for (unsigned int m_index = 0; m_index < mapping_collection->size(); @@ -87,12 +88,16 @@ namespace hp for (unsigned int q_index = 0; q_index < q_collection.size(); ++q_index) if (other.fe_values_table[fe_index][m_index][q_index].get() != nullptr) - fe_values_table[fe_index][m_index][q_index] = - std_cxx14::make_unique( - (*mapping_collection)[m_index], - (*fe_collection)[fe_index], - q_collection[q_index], - update_flags); + task_group += Threads::new_task([&, fe_index, m_index, q_index]() { + fe_values_table[fe_index][m_index][q_index] = + std_cxx14::make_unique( + (*mapping_collection)[m_index], + (*fe_collection)[fe_index], + q_collection[q_index], + update_flags); + }); + + task_group.join_all(); }