You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
In the ConsensusAlgorithms interface, the
prepare_buffer_for_answer()
function exists because we want to post anMPI_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 theMPI_Irecv
right away and checking its completion later on (inclean_up_and_end_communication()
), but to work through a loop of regularMPI_Probe
/MPI_Recv
functions inclean_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; theProbe
then gives us the message length, we can resize the answer buffer, and then put the answer into it in theMPI_Recv
.The text was updated successfully, but these errors were encountered: