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

MG transfer global coarsening: Avoid sending empty messages #16633

Merged
merged 1 commit into from
Feb 16, 2024
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -866,7 +866,11 @@ namespace internal

for (const auto &i : targets_with_indexset)
{
if (i.first == my_rank)
// Skip communication in case we would send to ourselves or when
// there are no indices to send (this can still happen in the run
// of the consensus algorithms above if the index spaces are
// sparse).
if (i.first == my_rank || i.second.begin() == i.second.end())
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i.second corresponds to an object of type IndexSet. Checking for begin() == end() is probably more easily understood if you said i.second.is_empty().

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Separately, I don't think this is sending an empty message. It perhaps sends an empty collection packed up into a string, but that's a non-zero length string.

continue;

indices_to_be_sent[i.first] = {};
Expand Down