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

Consensus algorithm: answer needs to be of known size #13213

Closed
bangerth opened this issue Jan 11, 2022 · 2 comments · Fixed by #13257
Closed

Consensus algorithm: answer needs to be of known size #13213

bangerth opened this issue Jan 11, 2022 · 2 comments · Fixed by #13257

Comments

@bangerth
Copy link
Member

In the ConsensusAlgorithms interface, the prepare_buffer_for_answer() function exists because we want to post an MPI_Irecv operation right after sending the request to another processor. A downside of this interface is that we need to know the size of the answer message, unlike for the request which can be of variable length. This is a bit awkward because it doesn't allow sending variably sized messages: the receiver of the answer needs to already know the length of the answer.

A possibly better interface would do away with the prepare_buffer_for_answer() function by not posting the MPI_Irecv right away and checking its completion later on (in clean_up_and_end_communication()), but to work through a loop of regular MPI_Probe/MPI_Recv functions in clean_up_and_end_communication() for all incoming answers. We can do this because we know how many answers we expect, so we can just loop as many times as we expect answers; the Probe then gives us the message length, we can resize the answer buffer, and then put the answer into it in the MPI_Recv.

@bangerth
Copy link
Member Author

Let me reopen this to remind myself that I need to document that the callback is no longer used.

@bangerth bangerth reopened this Jan 19, 2022
@bangerth bangerth added this to the Release 10.0 milestone Jan 19, 2022
@bangerth bangerth changed the title ConsensusAlgorithm: answer needs to be of known size Consensus algorithm: answer needs to be of known size Jan 19, 2022
@bangerth
Copy link
Member Author

Fixed now with #13267.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant