[gmx-users] help with gmx C source code

Mark Abraham Mark.Abraham at anu.edu.au
Tue Sep 15 18:13:06 CEST 2009


Inon Sharony wrote:
> 
>  Hi all!
> 
> I'm having some difficulties getting the trajectories and energetics to 
> agree for quite a simple simulation (see my previous posts: 
> http://lists.gromacs.org/pipermail/gmx-users/2009-September/044793.html 
> on the users' list, which got no response, and 
> http://lists.gromacs.org/pipermail/gmx-developers/2009-September/003636.html 
> on the developers' list). The complete details of my procedure are
> given in the latter.
> I'd like to get some help reading the GROMACS source code (in C, for 
> instance), so that I may better understand how the energy calculations 
> are done.
> 
> Specifically, I'd like to know in what lines of which files is the 
> energy calculated.

That's a poorly-formed question, and not easily answered even if 
well-formed. There's a whole pile of different energy contributions that 
*might* be occurring, and without seeing your .top as well as .mdp it's 
hard to have confidence that you're doing your parts right. The part 
where you say "throw out all energetic information of interactions other 
than relevant pair (Au-S)" despite saying "There are no other
interactions." makes me wonder what you're really doing.

My usual advice is to compile GROMACS with -g, get a graphical debugger 
(Totalview, ddd, insight, whatever) and spend a day stepping through a 
short mdrun to get some understanding about what is really happening. 
You will find it simpler if you've set the environment variable 
GMX_NB_GENERIC=1 so that the nonbonded kernels are more transparent.

> Additionally, I may want to add a few printout lines of my own to the 
> source code and be able to compile it -- in order to be able to conduct 
> my own inquiries.
> I'm not sure how one becomes a GROMACS source contributor or developer, 
> but so far I've been having a tough time getting help with the (open) 
> source code.

There's a sharp learning curve with any large software project. 
Unfortunately, there's nobody paid to teach people :-) The best you can 
do is read lots, work hard and get your hands dirty!

Mark



More information about the gromacs.org_gmx-users mailing list