Skip to content

Prototype reaction method in Python #4617

@RudolfWeeber

Description

@RudolfWeeber
  • MC methods in Python would be much easier to develop\
  • MC methods probably do not benefit form parallelization, as the sytem is only locally modified most of the time
  • However, as we are remoming mpi callbacks, it would have to be parallelized if remainign in the core.
  • this is non-trivial.
  • Time consuming tasks like energy calculaiton will still be done by the core
  • The current C++ implementaion is not parallelized and essentially calls the same core funcitons, the Python script would use.

To assess the performance cost, a reaction ensemble simulation of a polymer with dissociating ions (HA -> H+ +A- and back reaction) should be written in Python.

Notes

  • energy calculation should be done via the core (system.analysis.energy(), in a later stage, this can be made mor specific, e.g., to omit kinetic energy.

  • the methods needs a list of ids for each particle type. For the prototype, this shuold be constructed once and updated on the fly. Later an effiient implementaiton in the core can be added.

    all_types = np.unique(system.part.all().type())
    ids_by_type = {t: system.part.select(type=t).id.shape) for t in all_types} # maybe shape[0]
  • Exclusion radius checking can be done with system.analysis.nbhood() We need to make usre, the O(1) implementaiton is used.

  • If this is significantly slower than the current core implementaiton, bottlenecks can be identified with a line-by-line profiling: https://stackoverflow.com/questions/3927628/how-can-i-profile-python-code-line-by-line

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions