[gmx-developers] stuff in double precision

Erik Lindahl lindahl at cbr.su.se
Mon Feb 5 17:18:04 CET 2007


Hi,

On Feb 5, 2007, at 5:08 PM, Berk Hess wrote:

> Hi,
>
> This difference can be avoided by having all energy terms in double
> precision. In general this is for free, but it might need recoding
> of the assembly loops.
> We should consider making most/all variables double precision,
> except for the natoms sized arrays.

One problem I can see is that single/double conversions are not free,  
and you would do extra operations to sum in double (SSE is 2-way for  
double 4-way for single).

A possible intermediary approach could be to introduce a handful of  
extra single precision variables that we zero in the outer loop, and  
after each inner loop we convert the sum to double and add it to a  
double precision summation.

I've started to go more in the direction of "double unless it's an  
array" recently, but for the innermost loop it would mean sacrificing  
performance.

In principle I could also recode the loops to enable a solution with  
"double for all summation variables", but then we might want to have  
that as a third option besides all-double and all-single. Before  
doing that for ASM I'd like to see hard result that it solves the  
problem when done for the C loops, though :-)

Cheers,

Erik




More information about the gromacs.org_gmx-developers mailing list