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

Use free consensus algorithms functions instead of the class version. #13895

Merged
merged 2 commits into from Aug 18, 2022

Conversation

bangerth
Copy link
Member

@bangerth bangerth commented Jun 2, 2022

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, the DictionaryPayload 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

@bangerth bangerth added this to the Release 9.5 milestone Jun 2, 2022
@bangerth
Copy link
Member Author

Ping?

@masterleinad masterleinad merged commit 0bed6ac into dealii:master Aug 18, 2022
mkghadban pushed a commit to OpenFCST/dealii that referenced this pull request Sep 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants