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
ConsensusAlgorithms interface #13208
Comments
Historically, However, there are cases where we want to reuse processes, most notably |
Just to give some more background: Indeed the function dealii/include/deal.II/base/mpi.h Lines 1245 to 1258 in d5995ec
On the other hand, I would also agree that providing a possibility to run the algorithm via lambda functions would be a good solution to cover all those additional use cases of the consensus algorithms that we keep gathering recently. |
@peterrum Ah, I had not known about How about the following proposal:
|
@kronbichler I would suspect that the overhead of whether we call a virtual function or a function object is negligible compared to the cost of data transfer. I'm ok with leaving the existing interfaces around, but it would be nice to reduce the set up cost (in terms of lines of code) if one just wants to call the algorithm once. |
Sounds OK. But how do you want to make this backwards-compatible - the process is taken currently by the constructor. |
I would eventually break the interface, but for the moment can retain the existing constructor and |
We should add an (extensive?) changelog entry on how the ConsensusAlgorithm interface has been changed. Possibly by expanding the current entry https://github.com/dealii/dealii/blob/master/doc/news/changes/incompatibilities/20220118Bangerth, which is the only one I could find in the folder. |
I intend to write a section about this in the release paper. |
I'm playing with the consensus algorithms and I'm finding the interface a bit clunky. Specifically, the intent is that one creates a class that has a bunch of virtual functions that encode the various operations. But, in practice, these functions will typically access variables that live in the environment of the place where one calls the consensus algorithm and that would have to be passed to the object of the class one has to implement. That's what is most easily done using lambda functions -- which is actually already modeled by the
ConsensusAlgorithms::AnonymousProcess
class. Consequently the places I can find where consensus algorithms are used do things with lambda functions.My proposal would be to get rid of the whole
Process
class and instead just let theConsensusAlgorithms::Interface::run()
have an interface of the formI can do this in a backward compatible way if desired, though I doubt that that functionality is used anywhere outside deal.II. (But then, I've been surprised before...)
Any thoughts about this?
The text was updated successfully, but these errors were encountered: