-
Notifications
You must be signed in to change notification settings - Fork 188
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
Make reaction methods run in parallel #4666
Conversation
Rewrite reaction methods without MpiCallbacks. Add sanity checks. Rewrite some of the functionality as Python code and expose the `calculate_acceptance_probability()` function in Python to make prototyping of new Monte Carlo methods easier. Reduce overhead from the cell system when altering particle properties. Co-authored-by: Pablo Miguel Blanco Andrés <[email protected]>
e54ea07
to
4fbbcb1
Compare
Rewrite the EspressoSystemStandAlone class and all particle property setters, getters and events without MpiCallbacks. Run unit tests in parallel.
4fbbcb1
to
82cda68
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you again @jngrad for all your hard work on this PR. I think that it looks good to me, except some specific comments that I leave here. Since this PR comes with quite some changes in the code, I tested it for the case of a oligopeptide for which we have published reference data (See fig. attached). The results look good to me within the statistics (the simulations are rather short), so on my side the PR can be merged after addressing my other comments.
Co-authored-by: Pablo Miguel Blanco Andrés <[email protected]>
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
For consistency with the integrator.run() method. Co-authored-by: Pablo Miguel Blanco Andrés <[email protected]>
d51bc91
to
881d214
Compare
for reaction in self.reactions: | ||
reaction = {"reactant_coefficients": reaction.reactant_coefficients, | ||
"reactant_types": reaction.reactant_types, | ||
"product_types": reaction.product_types, | ||
"product_coefficients": reaction.product_coefficients, | ||
"reactant_types": reaction.reactant_types, | ||
"gamma": reaction.gamma} | ||
reactions_list.append(reaction) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I personally don't like the name-overriding of variables like here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice catch. It's quite dangerous. Not to mention the W0109 pylint violation (key "reactant_types"
appears twice) and the amount of copy-pasting that could be elided with a getattr
in a list comprehension.
Duplicated dict keys will silently override one another.
Partial fix for #4614
Partial fix for #4617
Follow-up to #4637
Description of changes:
gamma <= 0
ReactionAlgorithm.reaction()
now takessteps
instead ofreaction_steps
as argumentparticle_data.cpp
source file was removedEspressoSystemStandAlone
class no longer relies on MpiCallbacks