[gmx-developers] interface for externally calculated forces
Anton Feenstra
feenstra at few.vu.nl
Wed May 4 17:19:24 CEST 2011
On 04/05/11 17:09, Rene Staritzbichler wrote:
> Anton,
>
>
> Wouldn't that make the interplay of Gromacs and the external program a
> bit more tricky?
>
>
> For the interface to be as general as possible, the external program
> would need to read from a file, do its calculations and write to a file.
>
>
> A callback is usually something like passing a function as a pointer to
> another function.
> But I saw that only within one program so far.
> Can one use that for the coordination of two separate programs?
That of course depends on what interface(s) the other program allows. If
you can call it as a library function, that would allow passing a
pointer to a function. But I think making a callback to something like
the python wrapper, and then handling any calling is a good design.
Using the callback, you could still implement it using file IO etc and
starting the other program, making it equivalent to the script option
your proposed. But the callback could be much more manageable, more
flexible, and potentially more efficient.
We have this now implemented to the point where you can initiate an MD
run from your python script by calling a (new) library 'libmdrun'.
The mdrunnner function (vanilla gromacs) is now split into md_init(),
md_integrate() and md_finalize() (and yes we found memory leaks and
fixed all of them). Adding a callback functionality would not be much of
a problem.
--
Groetjes,
Anton
_____________ _______________________________________________________
| | |
| _ _ ___,| K. Anton Feenstra |
| / \ / \'| | | IBIVU/Bioinformatics - Free University Amsterdam |
|( | )| | | De Boelelaan 1083A - 1081 HV Amsterdam - Netherlands |
| \_/ \_/ | | | Tel +31 20 59 87783 - Fax +31 20 59 87653 - Room P136 |
| | Feenstra at few.vu.nl - www.few.vu.nl/~feenstra/ |
| | "Everybody is Smashing Things Down" (Offspring) |
|_____________|_______________________________________________________|
More information about the gromacs.org_gmx-developers
mailing list