[gmx-developers] Integrator framework draft on github
Pascal Merz
Pascal.Merz at Colorado.EDU
Thu Mar 28 07:13:40 CET 2019
Dear all,
Following the discussion in today’s roundtable, here is the github repository of the integrator framework draft: https://github.com/ptmerz/gromacs This is planned to be made more easily accessible by uploading it to a sandbox branch on gerrit once these are ready (soon), but if your project would benefit from earlier access to these drafts, please feel free to look around. If you don’t have an immediate stake in this effort, you can probably ignore this email. As this repo was not necessarily meant to be shared with more than a few close collaborators, the documentation is not everywhere yet at the level I would like to have it to submit these changes for general review on gerrit. I’ll therefore try to outline the draft in the next few paragraphs, and link to some additional resources at then end of the email.
The big picture of this effort is to rewrite the integrator loop of GROMACS using a modular approach and introducing Monte Carlo capability. The modularity aims at making the single instructions as independent as possible, allowing for a certain level of recomposition and parallelism, helping the development of new algorithms and task-parallelism. The addition of MC will allow to explore hybrid MC/MD algorithms, which show promise to enhance sampling in condensed simulations, and other algorithms such as an MC barostat.
The draft on github is a fork of the main GROMACS repo, and has last been rebased 2 months ago. Rebasing it to the tip of current master should be reasonably easy. Most of the work was done in a single branch, https://github.com/ptmerz/gromacs/tree/integrator. It encompasses the high-level changes necessary to move from the current integrator (do_md() function) to a more modular approach. This is done by first creating a copy of do_md(), do_md_simple(), and rip out all functionality except for a basic leap-frog and velocity-verlet NVE loop (however, keeping things like trajectory & energy writing, and domain decomposition in place). The functionality is then developed one by one into elements which are able to be called via a unified, argument-less run function. This requires these elements to bind some data via pointers - not a nice solution, but later changes explore how to reduce these dependencies. After developing all needed functionality into these type of elements, the new framework can be put to work, reducing the setup of the integrator (more or less common for all integrator flavors) to about 250 lines, and the definition (i.e. the place where the order of the operations is defined) to about 50 lines of code. This is reached at commit 0e34a97. Later commits then explore ways to improve the data management - defining clear owners for pieces of data, and defining interfaces for others to interact with this data.
Two approaches to the life-time of tasks are explored. In one case, present in commit 0e34a97 and onwards, elements register tasks, i.e. the function they want to run at each step, before the first step of the integrator, forming the integrator loop as a rigid list of functions being called repeatedly. In the other case, a queue is created instead of a list - all tasks are pre-computed ahead of time, such that the integrator is not a loop anymore, but a (FIFO) queue of tasks. This queue is currently filled at neighbor-searching steps, i.e. all tasks that need to be ran by any element before the next neighbor searching step are known ahead of time. Most of the development of the elements is identical for both approaches, such that the second approach is simply formulated as a commit on top of the first approach (in a separate branch, https://github.com/ptmerz/gromacs/tree/scheduler_v1). In both approaches, multi-stepping can easily be incorporated by nesting loops over elements - we could, for example, imagine to call a non-bonded force element once before looping 4 times over a bonded-force element and some velocity and position propagating elements, which would result in a larger time-step for the non-bonded forces compared to the bonded forces.
We are currently working on exploring ways to express the position and velocity propagators in a general, extensible, yet performant way - ideally, leap-frog, velocity-verlet, and any other integrator we’d be interested in (including temperature and pressure coupling) would be expressed by a few elements such as a position and a velocity propagator. These changes are not yet on github, but let me know if you have an interest in discussing these changes.
As said, regarding documentation, these changes might not yet all be documented enough to be self-explanatory. I have a wiki page which describes some of the ideas and all commits, https://github.com/ptmerz/gromacs/wiki/GROMACS---New-Integrator-Framework. I find this a useful tool to keep an overview over the chain of dependent changes, and quickly jump to the relevant ones. Otherwise, I am happy to share my presentation from the last Göttingen developer workshop, where I have been talking about most concepts used here: https://www.dropbox.com/s/yt95913dkzc72k1/Goettingen_2018-Integrator-Pascal_Merz.pdf?dl=0. And I am more than happy to answer any questions, on github or via email or by setting up a call.
I am grateful for any feedback, and looking forward to share this on more standard GROMACS resources soon!
Pascal
PS: A word about testing, since I was asked today - as all changes until now were not intended to change how the integrator functions, but rather how its expressed, all changes have been tested by ensuring that on a few systems, the legacy do_md() (which is unchanged for now), and the new approach have identical positions, velocities, forces and energies for a few steps. This test is introduced early in the chain of commits.
Pascal Merz
Research Associate, Shirts Group
Dept. of Chemical and Biological Engineering
University of Colorado Boulder
pascal.merz at colorado.edu<mailto:pascal.merz at colorado.edu>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://maillist.sys.kth.se/pipermail/gromacs.org_gmx-developers/attachments/20190328/1b2a699b/attachment-0001.html>
More information about the gromacs.org_gmx-developers
mailing list