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

Wait for communication to finish. #15372

Merged
merged 1 commit into from
Jun 17, 2023
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
11 changes: 11 additions & 0 deletions source/grid/grid_tools.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3665,6 +3665,11 @@ namespace GridTools
AssertThrowMPI(ierr);
}

// At this point, wait for all of the isend operations to finish:
Copy link
Member

Choose a reason for hiding this comment

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

You could move this Waitall to the end of the function, which potentially could improve performance. Or am I wrong?

Copy link
Member Author

Choose a reason for hiding this comment

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

I did think of this, but couldn't quite convince myself that that was right -- and then decided that for purposes of a fix for an actual problem, this is good enough. The function is improveworthy anyway for a variety of reasons, and that's on my list for post-release. I think as a bug fix, this is all I propose.

MPI_Waitall(first_requests.size(),
first_requests.data(),
MPI_STATUSES_IGNORE);


// Send second message
std::vector<std::vector<char>> cellids_send_buffers(
Expand Down Expand Up @@ -3773,6 +3778,12 @@ namespace GridTools
}
}
}

// At this point, wait for all of the isend operations of the second round
// to finish:
MPI_Waitall(second_requests.size(),
second_requests.data(),
MPI_STATUSES_IGNORE);
#endif

return local_to_global_vertex_index;
Expand Down