Use free consensus algorithms functions instead of the class version. #13895
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Not for 9.4.
One of the remaining users of the class-based consensus algorithms functionality is in
mpi_compute_index_owner_internal.(h|cc)
. There, theDictionaryPayload
class is declared and implemented to wrap a bunch of local variables that are then passed to the CA algorithms. In essence, the class does what lambda closures do: wrap captured variables and provide functions that work on those captured variables.This patch converts the class to lambda functions and calls the free CA functions instead of the class-based versions, as enabled by the work done for #13414. In the process, I also realized (again) that this is an algorithm where the answer to the requests does not actually matter (and is not in fact implemented, using
std::vector<unsigned int>
as a dummy type for answers). This then allows the use of the specializations of the free functions introduced in #13826.The whole exercise saves 110 lines of code.
Part of #13208.
/rebuild