[gmx-users] data analysis on-fly

Erik Lindahl lindahl at stanford.edu
Sun Mar 3 18:49:38 CET 2002


David van der Spoel wrote:

> On Sat, 2 Mar 2002, Rui Qiao wrote:
>
> >Dear all:
> >       I am wondering if someone has tried to code some program into
> >Gromacs to do data analysis on-fly. The huge data is filling up my disk
> >very quickly (35GB in two weeks), so I have no choice.
> >       I am eager to know in which source code that the positions
> >and velocity of atoms are available (I guess they are available in the
> >function that save the data to disk...). In addition, where should I start
> >to look if I need Gromacs to read in some parameters that are needed in
> >the analysis?
> What kind of analysis do you want to do that is not already there? CHeck
> out one of the simpler trajectory analysis programs if you want to do
> something yourself. The contrib directory even has a ready template I
> think.

In case you have to do things on the fly (I did it for high-accuracy velocity
autocorrelations a couple of years ago), you could just put a call in the main
loop in the do_md routine in kernel/md.c (for version 3.1). You can basically
put it anywhere; the new forces are available after the call to do_force, and
once the update() routine returns the coordinates are changed too.

If you are running on a single processor it's trivial - positions are
available in the "x" array, velocities in "v" and forces in "f". For parallel
runs it's a bit trickier - check the write_traj routine (and subroutines) to
understand how you can communicate coordinates - it's not too hard.

If you want to pass a small number of parameters you could use
userint1-userint4 and userreal1-userreal4 in the inputrec. Set them in the mdp
file, and then access them in do_md:

parm->ir.userint4

Cheers,

Erik





More information about the gromacs.org_gmx-users mailing list