[gmx-developers] innerc to forcebuf: Energy is still zero

Erik Lindahl lindahl at stanford.edu
Fri Apr 5 19:33:38 CEST 2002


>Problem is, I don't get the pair-potential energies (they are zero all
>the time) in output files for bham and new interaction. Strange thing is
>I didn't even touch bham loops. Moreover,
>print statements at inner loop for vnbtot gives no-zero values at all. 

vnbtot and vctot are only the temporary variables used in the innermost 
loop; at the
end of the outer loop the are assigned to Vc(ggid) and Vnb(ggid), where 
ggid is the group
index. If you only have one energy group ggid=0.

Check that these two variables are non-zero, and if that's the case you 
can also check
in fnbf.c (after calling the inner loop) that the corresponding arrays 
and egcoul(ggid) have the energy.

>I have checked in may places that energy arrays are zero.(a 14,15th
>members where defined as bham and new pot's energies)
>- before and after or inside: do_fnbf(), do_force(), sum_epot() 
>  grps->estat.ee[egBHAM] and   ener[i]
>- identical input files with original GROMACS code gives energies
>properly as expected :-)
>Apparently, either energies do not passed properly from inner loops or I
>some error in modification that affects this mechanism.
>How could I put a print statements in outer-loops? Cos, what I did for
>innerloops is
>defining new function(simple print statement) and use this function with
>assign() in
>mkinl routines.In outher loops this strategy didn't work cos compiler
>complains about conflicting data types.

What I usually do when I debug is that I first create the inner loop in 
C or Fortran
by going to gmxlib and issuing e.g 'make innerc.c'. Then I can edit the 
loops I
want like a normal routine, and when you issue 'make' again the modified 
loop will
be newer than the source files used to create it, so it will not be 



More information about the gromacs.org_gmx-developers mailing list