[gmx-developers] single precision, double precision hybrid GROMACS

Erik Lindahl lindahl at sbc.su.se
Fri Apr 7 10:49:27 CEST 2006


Hi,

I think the only case for "limited double precision" is to get  
perfect energy conservation with constraints.

I tested this a year or two ago, and at least for a simple test  
system I found that you could get energy conservation by copying the  
coordinate array to double in update, perform all integration and  
temperature control in double, perform constraints and force  
correction in double, and finally copy back to single. Doing only one  
of integration or constraints in double did _not_ conserve energy.

This is a bit too much (2-3% of runtime) to do by default, since  
Gromacs also runs on embedded systems where double precision needs to  
be emulated in software and is 10-100 times slower than single.

I think it's possible to limit it further, but we don't yet fully  
understand how the precision in integration and constraints interact,  
so looking there would be my first recommendation for somebody  
interested in working on it.

Cheers,

Erik


On Apr 7, 2006, at 10:13 AM, Berk Hess wrote:

> First I must say that I agree completely with Mark.
>
> But I have tried doing the constraints only in double precision.
> Thus x is float, but xprime is double and all constraints  
> algorithms double precision.
> This did not improve the accuracy.
> It might be that one could improve things by also making x double  
> precision.
> I would assume that you need to have the position increment very  
> accurate
> to have accurate compensation of potential and constraints forces.
> But that was to much effort for me, as then x would have to be double
> precision throughtout the whole code, except in the innerloop calls,
> which would also make it questionable if it would really improve  
> things.
>
> Making x double precision in the innerloops in not a viable option,
> since then you could not uses the assembly loops
> and then assembly full double precision is anyhow faster.
>
> Berk.
>
> _______________________________________________
> gmx-developers mailing list
> gmx-developers at gromacs.org
> http://www.gromacs.org/mailman/listinfo/gmx-developers
> Please don't post (un)subscribe requests to the list. Use the www  
> interface or send it to gmx-developers-request at gromacs.org.
>




More information about the gromacs.org_gmx-developers mailing list