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

Allow multiple concurrent reaction methods #4609

Merged

Conversation

pm-blanco
Copy link
Contributor

@pm-blanco pm-blanco commented Nov 23, 2022

Fixes #4595

Description of changes:

  • Reaction methods now rebuild the list of free particle ids every time ReactionAlgorithm::do_reaction() and WidomInsertion::calculate_particle_insertion_potential_energy() are called
  • Added a new test that checks that the reaction methods do the bookkeeping of empty ids by setting up two different instances of the reaction methods (constant pH and Widom insertion) with competing reactions.

I benchmarked my implementation against the current python branch using the mc_acid_base_reservoir.py script and I get the following timings: 1.564e-04 (my PR) vs 1.473e-04 (current python branch). That means that my implementation comes with a 6% performance loss in its current state.

@pm-blanco pm-blanco changed the title WIP bugfix: reaction_methods check for empty ids before performing reaction steps bugfix: reaction_methods check for empty ids before performing reaction steps Dec 12, 2022
@jngrad jngrad self-requested a review December 12, 2022 12:27
@jngrad jngrad force-pushed the bugfix_reaction_methods_bookeeping branch from f121b44 to eb4e3d7 Compare December 12, 2022 13:56
@jngrad jngrad changed the title bugfix: reaction_methods check for empty ids before performing reaction steps Allow multiple concurrent reaction methods Dec 12, 2022
@jngrad jngrad added the automerge Merge with kodiak label Dec 12, 2022
@kodiakhq kodiakhq bot merged commit 75f6fda into espressomd:python Dec 12, 2022
@pm-blanco pm-blanco deleted the bugfix_reaction_methods_bookeeping branch December 13, 2022 16:49
jngrad pushed a commit to jngrad/espresso that referenced this pull request Dec 23, 2022
Fixes espressomd#4595

Description of changes:
- Reaction methods now rebuild the list of free particle ids every time `ReactionAlgorithm::do_reaction()` and `WidomInsertion::calculate_particle_insertion_potential_energy()` are called
- Added a new test that checks that the reaction methods do the bookkeeping of empty ids by setting up two different instances of the reaction methods (constant pH and Widom insertion) with competing reactions.

I benchmarked my implementation against the current python branch using the `mc_acid_base_reservoir.py` script and I get the following timings: 1.564e-04 (my PR) vs  1.473e-04 (current python branch). That means that my implementation comes with a 6% performance loss in its current state.
jngrad pushed a commit to jngrad/espresso that referenced this pull request Dec 23, 2022
Fixes espressomd#4595

Description of changes:
- Reaction methods now rebuild the list of free particle ids every time `ReactionAlgorithm::do_reaction()` and `WidomInsertion::calculate_particle_insertion_potential_energy()` are called
- Added a new test that checks that the reaction methods do the bookkeeping of empty ids by setting up two different instances of the reaction methods (constant pH and Widom insertion) with competing reactions.

I benchmarked my implementation against the current python branch using the `mc_acid_base_reservoir.py` script and I get the following timings: 1.564e-04 (my PR) vs  1.473e-04 (current python branch). That means that my implementation comes with a 6% performance loss in its current state.
jngrad pushed a commit to jngrad/espresso that referenced this pull request Dec 23, 2022
Fixes espressomd#4595

Description of changes:
- Reaction methods now rebuild the list of free particle ids every time `ReactionAlgorithm::do_reaction()` and `WidomInsertion::calculate_particle_insertion_potential_energy()` are called
- Added a new test that checks that the reaction methods do the bookkeeping of empty ids by setting up two different instances of the reaction methods (constant pH and Widom insertion) with competing reactions.

I benchmarked my implementation against the current python branch using the `mc_acid_base_reservoir.py` script and I get the following timings: 1.564e-04 (my PR) vs  1.473e-04 (current python branch). That means that my implementation comes with a 6% performance loss in its current state.
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.

Electroneutrality breaks when combining Widom + cpH methods
2 participants