18 #include <deal.II/base/partitioner.templates.h>
30 , n_ghost_indices_data(0)
31 , n_import_indices_data(0)
32 , n_ghost_indices_in_larger_set(0)
35 , communicator(MPI_COMM_SELF)
36 , have_ghost_indices(false)
43 , locally_owned_range_data(size)
46 , n_ghost_indices_data(0)
47 , n_import_indices_data(0)
48 , n_ghost_indices_in_larger_set(0)
51 , communicator(MPI_COMM_SELF)
52 , have_ghost_indices(false)
66 , n_ghost_indices_data(0)
67 , n_import_indices_data(0)
68 , n_ghost_indices_in_larger_set(0)
71 , communicator(communicator_in)
72 , have_ghost_indices(false)
84 , n_ghost_indices_data(0)
85 , n_import_indices_data(0)
86 , n_ghost_indices_in_larger_set(0)
89 , communicator(communicator_in)
90 , have_ghost_indices(false)
99 const IndexSet &read_write_vector_index_set,
126 ExcMessage(
"The index set specified in locally_owned_indices "
127 "is not contiguous."));
131 std::pair<types::global_dof_index, types::global_dof_index>(
140 "Index overflow: This class supports at most 2^32-1 locally owned vector entries"));
153 const IndexSet &larger_ghost_index_set)
173 "Index overflow: This class supports at most 2^32-1 ghost elements"));
187 #ifdef DEAL_II_WITH_MPI
206 const int ierr = MPI_Exscan(&my_size,
232 std::vector<unsigned int> owning_ranks_of_ghosts(
240 owning_ranks_of_ghosts,
247 std::pair<types::global_dof_index, types::global_dof_index>,
250 consensus_algorithm.run();
255 if (owning_ranks_of_ghosts.size() > 0)
258 for (
auto i : owning_ranks_of_ghosts)
262 "Expect result of ConsensusAlgorithmsProcess to be "
273 std::map<unsigned int, IndexSet> import_data = process.
get_requesters();
282 for (
const auto &i : import_data)
283 if (i.second.n_elements() > 0)
289 i.second.n_intervals());
295 for (
const auto &i : import_data)
299 for (
auto interval = i.second.begin_intervals();
300 interval != i.second.end_intervals();
304 interval->last() + 1 -
326 std::vector<types::global_dof_index> ghost_indices_ref;
331 std::vector<types::global_dof_index> my_indices;
333 std::vector<MPI_Request> requests;
337 my_indices.data(), my_indices.size()),
343 const int ierr = MPI_Testall(requests.size(),
346 MPI_STATUSES_IGNORE);
350 "MPI found unfinished requests. Check communication setup"));
357 #endif // #ifdef DEAL_II_WITH_MPI
359 if (larger_ghost_index_set.
size() == 0)
374 ExcMessage(
"Ghost index set should not overlap with owned set."));
377 ExcMessage(
"Larger ghost index set must contain the tight "
378 "ghost index set."));
384 std::vector<unsigned int> expanded_numbering;
388 ExcMessage(
"The given larger ghost index set must contain "
389 "all indices in the actual index set."));
395 "Index overflow: This class supports at most 2^32-1 ghost elements"));
396 expanded_numbering.push_back(
401 std::vector<std::pair<unsigned int, unsigned int>>
402 ghost_indices_subset;
407 unsigned int shift = 0;
413 const unsigned int i =
shift + ii;
414 if (expanded_numbering[i] == last_index + 1)
416 ghost_indices_subset.back().second++;
419 ghost_indices_subset.emplace_back(expanded_numbering[i],
420 expanded_numbering[i] +
422 last_index = expanded_numbering[i];
426 ghost_indices_subset.size();
441 #ifdef DEAL_II_WITH_MPI
444 int communicators_same = 0;
447 &communicators_same);
449 if (!(communicators_same == MPI_IDENT ||
450 communicators_same == MPI_CONGRUENT))
474 4 *
sizeof(
unsigned int) +
sizeof(
MPI_Comm));
496 #include "partitioner.inst"