From 568440fd4c4e3433396d00f50a5e59596c1673e6 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Wed, 25 May 2022 16:58:04 -0600 Subject: [PATCH] Use CA specializations in places where we don't expect an answer. --- .../fe/fe_tools_extrapolate.templates.h | 47 ++++++------------- source/grid/tria_description.cc | 9 ++-- 2 files changed, 20 insertions(+), 36 deletions(-) diff --git a/include/deal.II/fe/fe_tools_extrapolate.templates.h b/include/deal.II/fe/fe_tools_extrapolate.templates.h index 3688b3a694..ed3a1b9c96 100644 --- a/include/deal.II/fe/fe_tools_extrapolate.templates.h +++ b/include/deal.II/fe/fe_tools_extrapolate.templates.h @@ -1150,40 +1150,23 @@ namespace FETools return cells_for_this_destination; }; - const auto answer_request = + const auto process_request = [&received_cells](const unsigned int other_rank, - const std::vector &request) -> int { - // We got a message from 'other_rank', so let us decode the - // message in the same way as we have assembled it above. - // Note that the cells just received do not contain - // information where they came from, and we have to add that - // ourselves for later use. - for (CellData cell_data : request) - { - cell_data.receiver = other_rank; - received_cells.emplace_back(std::move(cell_data)); - } - - // Nothing left to do here, we don't actually need to provide an - // answer: - return 0; - }; - - const auto read_answer = [](const unsigned int /*other_rank*/, - const int &answer) { - // We don't put anything into the answers, so nothing should - // have been coming out at this end either that differs from - // the default-sent zero integer: - (void)answer; - Assert(answer == 0, ExcInternalError()); - }; + const std::vector &request) { + // We got a message from 'other_rank', so let us decode the + // message in the same way as we have assembled it above. + // Note that the cells just received do not contain + // information where they came from, and we have to add that + // ourselves for later use. + for (CellData cell_data : request) + { + cell_data.receiver = other_rank; + received_cells.emplace_back(std::move(cell_data)); + } + }; - Utilities::MPI::ConsensusAlgorithms::selector, int>( - destinations, - create_request, - answer_request, - read_answer, - communicator); + Utilities::MPI::ConsensusAlgorithms::selector>( + destinations, create_request, process_request, communicator); } diff --git a/source/grid/tria_description.cc b/source/grid/tria_description.cc index bdeaec046b..2d3d6334f6 100644 --- a/source/grid/tria_description.cc +++ b/source/grid/tria_description.cc @@ -126,16 +126,17 @@ namespace TriangulationDescription return description_temp[other_rank_index]; }; - const auto answer_request = + const auto process_request = [&](const unsigned int, const DescriptionTemp &request) { this->merge(request, vertices_have_unique_ids); - return char{}; }; dealii::Utilities::MPI::ConsensusAlgorithms::selector< - DescriptionTemp, - char>(relevant_processes, create_request, answer_request, {}, comm); + DescriptionTemp>(relevant_processes, + create_request, + process_request, + comm); } /** -- 2.39.5