Tags: Wissenschaft, Molekulardynamik, Interaktive Molekulardynamik
Here, I explain how a patched GROMACS allows running of interactive simulations by implementing the interactive molecular dynamics (IMD) protocol. IMD allows monitoring of running simulations from a VMD client. In addition, the user can interact with the simulation by pulling on atoms, residues or fragments with a mouse or force-feedback devices.
Interactive Molecular Dynamics (IMD) allows monitoring of and interaction with running simulations. The first NAMD - VMD implementation of IMD goes back to 2001 [1]. Recently, we implemented the IMD protocol into GROMACS v4.6 and the GROMACS master-branch. Features of our implementation are:
Flowchart of the GROMACS IMD implementation and the communication with a VMD client.
Currently, IMD for GROMAC is in review and most likely will be in the next major version. The github repository http://github.com/martinhoefling/gromacs contains two branches release-4-6-imd and master-imd, which both contain their respective non-imd patches plus imd-patch. Therefore, a IMD enabled gromacs version can be build from these branches as described briefly on http://www.gromacs.org/Developer_Zone/Git.
The GROMACS implementation allows transmission and interaction with a
part of the running simulation only, e.g. in cases where no water
molecules should be transmitted or pulled. The group is specified via
the IMD-group
.mdp
option. When IMD-group
is empty, the IMD
protocol is disabled and cannot be enabled via the switches in mdrun
.
To interact with the entire system, IMD-group
has to be set to
System
, which is also the default for .tpr
files created with an
older version without IMD implementation. When using grompp
, a
.gro
file to be used with VMD is written out ( -imd
switch of
grompp
).
Communication between VMD and GROMACS is achieved via tcp-sockets and
thus enables controlling an mdrun
running locally or on a remote
cluster. The port for the connection can be specified with the
-imdport
switch of mdrun
, 8888 is the default. Every \(N\)
steps, the client receives the applied forces from the VMD client and
sends the new coordinates to the client. The initial frequency for
communication with the client is set to the global communication
frequency but can be altered using the -imdfreq
switch. VMD also
permits increasing or decreasing the communication frequency
interactively. By default, the simulation starts and runs even if no IMD
client is connected. This behavior is changed by the -imdwait
switch
of mdrun
. After startup and whenever the client has disconnected, the
integration stops until reconnection of the client. When the -imdterm
switch is used, the simulation can be terminated pressing the stop
button in VMD. This is disabled by default. Finally, to turn on
interaction with the simulation (i.e. pulling from VMD) the -imdpull
switch has to be used. Therefore, a simulation can only be monitored but
not influenced from the VMD client when none of -imdwait
, -imdterm
or -imdpull
are set. However, since the IMD protocol requires no
authentication, it is not advisable to run simulations on a host
directly reachable from an insecure environment. Secure shell forwarding
of TCP
can be used to connect to running simulations not directly
reachable from the interacting host.
In VMD, first the structure corresponding to the IMD group has to be
loaded (File → New Molecule\ldots). Then the IMD connection window has
to be used (Extensions → Simulation → IMD Connect (NAMD)). In the IMD
connection window, hostname and port have to be specified and followed
by pressing Connect. Detach Sim allows disconnecting without terminating
the simulation, while Stop Sim ends the simulation on the next neighbor
searching step (if allowed by -imdterm
). The timestep transfer rate
allows adjusting the communication frequency between simulation and IMD
client. Setting the keep rate loads every Nth frame into VMD instead of
discarding them when a new one is received. The displayed energies are
in SI units in contrast to energies displayed from NAMD simulations.
[1] “A System for Interactive Molecular Dynamics Simulation” John E. Stone, Justin Gullingsrud, Klaus Schulten, Paul Grayson In 2001 ACM Symposium on Interactive 3D Graphics, John F. Hughes and Carlo H. Sequin, editors, pages 191-194, New York, 2001, ACM SIGGRAPH