[gmx-developers] mdrun continuation
Mark Abraham
mark.abraham at anu.edu.au
Thu Mar 5 12:45:15 CET 2009
----- Original Message -----
From: Emanuel Peter <Emanuel.Peter at chemie.uni-regensburg.de>
Date: Thursday, March 5, 2009 21:52
Subject: [gmx-developers] mdrun continuation
To: Discussion list for GROMACS development <gmx-developers at gromacs.org>
> Dear developers,
>
> I tried to change the mdrun-main program to a kind of a function and
> then to do a run that follows a first run in a for - loop.
> The problem is that you cannot call mdrun for a second time.
> There is always the following error :'Illegal instruction' after
> readingthe topol.tpr file when I want to call mdrun a second
> time in this loop.
> I know that there could be variables that persist after the
> first run
> and make troubles in the second call of mdrun.
> Could you please send me some suggestions in which way I should change
> this mdrun.c ?
The particular problem here is probably a test for validity of SSE instructions, or such like - use a debugger to find out.
However the underlying strategic problem is harder. mdrun is designed as a one-shot process. It does very little destruction of objects, and there are some variables whose values are assigned on creation, and then later tested to detect whether this is the first use of some part of the code (and thus full initialization should occur). Such variables don't ever get "unset" upon exit of mdrun. Any repeated execution is likely to encounter confusion based on these sorts of things. Historically things have not needed to be better behaved, for when mdrun returns, the process is about to exit and cleaning up is not needed.
I have been writing a utility that does do iterative calling of mdrun, and which requires that not much memory gets leaked, and so I've written a lot of destructors and work-around code, but often these will be tailored the usage pattern I have in mind, and so I'm not prepared to share them (yet).
My advice is to consider thoroughly whether looping mdrun in a shell script is a suitable solution for you.
Mark
More information about the gromacs.org_gmx-developers
mailing list