Improving GROMACS for API-driven simulations

The lead developer for the GROMACS Python API (gmxapi – see, Dr Eric Irrgang of Prof. Peter Kasson’s lab (, visited Stockholm recently, thanks to travel support from HPC-Europa3. Sadly the state of COVID-19 in the world meant that he was still distanced from many of the core GROMACS team in Stockholm. However Dr Mark Abraham of ENCSS was still able to use the time with Eric to focus on planning how to remove obstacles in the path of exascale-suitable API-driven molecular dynamics simulations.

The figure below depicts the kind of workflow we need to be able to generalize to run multiple ensemble members simultaneously. 

Restrained-ensemble simulations using gmxapi. Schematized are the Python commands to declare an array of MD simulations, bind a custom potential and run, and the corresponding computational graph. (Image by Eric Irrgang, used with permission,

Like many HPC codes, GROMACS uses MPI to coordinate work across computer nodes within a simulation. However its history as a command-line program wasn’t the best preparation for being able to generalize the use of MPI across many simulations. Gmxapi could currently run multiple simulations, but there are severe restrictions on the amount of resources each simulation can address.

During the visit, Eric worked on infrastructure to allow the Python layer to manage an MPI context for running successive simulations, and Mark moved the GROMACS hardware detection to run earlier and inter-operate better with the external MPI context. Several awkward legacy code constructs were improved and the resulting code is much better suited for further work to support the generalization. Several related issues were observed during that work, and have been documented and planned for future resolution, e.g and

For more information on GROMACS visit:


On the 5th of October, ENCCS, for the first time, organized the Swedish HPC Business Day face-to-face event in collaboration Read more
SHAPE FOURTEENTH CALL FOR APPLICATIONS IS OPEN FROM 1 OCTOBER 2021 UNTIL 15 NOVEMBER 2021 Opening Date: 01/10/2021 @ 15:53Closing Date: 15/11/2021 Read more
During the last couple of years, there have been a lot of inflated expectations about Artificial Intelligence (AI). This has Read more