Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bug for global coarsening: Must allow invalid proc id #13858

Merged
merged 1 commit into from
May 30, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 3 additions & 1 deletion include/deal.II/base/mpi_compute_index_owner_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@ namespace Utilities
FlexibleIndexStorage(const bool use_vector = true);

void
reinit(const bool use_vector, const std::size_t size);
reinit(const bool use_vector,
const bool index_range_contiguous,
const std::size_t size);

void
fill(const std::size_t start,
Expand Down
9 changes: 7 additions & 2 deletions source/base/mpi_compute_index_owner_internal.cc
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ namespace Utilities

void
FlexibleIndexStorage::reinit(const bool use_vector,
const bool index_range_contiguous,
const std::size_t size)
{
this->use_vector = use_vector;
Expand All @@ -52,8 +53,10 @@ namespace Utilities
data = {};
data_map.clear();

// do not initialize the vector but only upon first request in
// `fill`
// in case we have contiguous indices, only fill the vector upon
// first request in `fill`
if (!index_range_contiguous)
data.resize(size, invalid_index_value);
}


Expand Down Expand Up @@ -263,6 +266,8 @@ namespace Utilities

actually_owning_ranks.reinit((owned_indices_size_actual *
sparsity_factor) > owned_indices.size(),
owned_indices_size_actual ==
owned_indices.size(),
locally_owned_size);

// 2) collect relevant processes and process local dict entries
Expand Down