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

Rewrite non-bonded interactions as script interface objects #4555

Closed
jngrad opened this issue Aug 22, 2022 · 0 comments · Fixed by #4558
Closed

Rewrite non-bonded interactions as script interface objects #4555

jngrad opened this issue Aug 22, 2022 · 0 comments · Fixed by #4558

Comments

@jngrad
Copy link
Member

jngrad commented Aug 22, 2022

This is a self-contained task for #4542.

The python interface currently relies on MpiCallbacks to broadcast interaction structs to all MPI ranks. This communication can be taken care of by the ScriptInterface framework.

Use the jngrad/nonbonded_refactor branch as the starting point. The first commit lays out the new interface, and can be ignored. The next two commits show how to use the new interface with LJ and WCA. Simply apply that formula to all remaining interactions. Some interactions might require extra care, for example DPD requires two structs and interacts with thermostats. Be sure to use the maxset myconfig file and to run the testsuite frequently to catch regressions.

Once this is done and the python testsuite shows no regression, it will be possible to delete the old interface in the core. To that end, delete the code marked with // TODO in ca9f833, then build again and delete all lines that trigger any compiler warning.

@kodiakhq kodiakhq bot closed this as completed in #4558 Sep 20, 2022
kodiakhq bot added a commit that referenced this issue Sep 20, 2022
Fixes #4555 and fixes #4569

Description of changes:
- rewrite non-bonded interactions as script interface objects
   - convert Cython file `interaction.pyx` to Python file `interaction.py`
   - 1600 lines of Cython code were removed
- bugfix: the `set_params()` method now raises an error if required arguments are not provided
   - scripts may silently break when a potential is set and later updated in a way that is affected by the bug described in #4569
- new feature: possibility to deactivate/reset non-bonded interactions
- reduce code duplication in the script interface of bonded interactions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant