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

Replace bonded interactions cython interface #4225

Closed
RudolfWeeber opened this issue Apr 12, 2021 · 0 comments · Fixed by #4350
Closed

Replace bonded interactions cython interface #4225

RudolfWeeber opened this issue Apr 12, 2021 · 0 comments · Fixed by #4350

Comments

@RudolfWeeber
Copy link
Contributor

RudolfWeeber commented Apr 12, 2021

Bonded interactions should be managed by the script interface and the hand-crafted Cython code should be removed.

Steps:

  • Wrap the bonded interaction parameter store by a map-like container

    • should support at() and insert() and contains() as in std::unordered_map
    • and an additional insert() which auto-generates a free key (as we would like to avoid manual bond id handling in the future)
  • Reading clients such as the bond loop should probably only have const access

    • convert read access throughout Espresso source to use bonded_ia_params.at()
    • adapt set_bonded_ia_params() in bonded_interactions/bonded_interactions_utils.hpp
  • Remove MPI broadcasting of bonds

  • Write an ObjectMap analogue to the script interface ObjectList which wraps an associative container:

    • add() method takes a KeyType and a ManagedType
    • remove() takes a KeyType
  • Write Python bindings for the ObjectMap

    • __getitem__(), __iter__(), and dictionary-related friends
  • Implement the script interface BondedInteractInteractionsMap

    • making use of ObjectMap, otherwise analogous to Constraints or LBBoundaries
  • Write script interface classes for Espresso's bonded interaction classes

  • @script_interface-register the classes BondedInteractionsStore and the bonded interaction script interface classes in Python

@jngrad jngrad self-assigned this Apr 26, 2021
kodiakhq bot added a commit that referenced this issue May 9, 2021
Preparing the ground for #4225.

Description of changes:
- document the creation policy of script interface objects
- guard against double parsing in `ObjectList::do_call_method()`
@jngrad jngrad added this to the Espresso 4.2 milestone Jul 5, 2021
@kodiakhq kodiakhq bot closed this as completed in #4350 Oct 26, 2021
kodiakhq bot added a commit that referenced this issue Oct 26, 2021
Fixes #4225
Fixes #4377
Fixes #4169

Description of changes:
- Bonded interactions are now stored as ScriptInterface objects, are immutable and can be removed
- It is no longer possible to overwrite a bond object by a different type of bond (avoids segmentation faults)
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.

2 participants