[gmx-developers] Replacing float and double in gromacs.

Carsten Kutzner ckutzne at gwdg.de
Sat Oct 2 16:21:55 CEST 2010

Hi Christian,

On Oct 1, 2010, at 4:43 PM, Christian Mötzing wrote:

> Hi, for my thesis I'm trying to replace float and double in Gromacs with
> an own type. During compilation real is typedef to float or double. But
> there are still a few places where double or float is explicitly used.
> Sometimes this happens in functions with pre- or postfix s/d. As I
> understand these are double and single functions, right? Are d-functions
> really only used if compiled with double precision?
I think d-functions are used where you want double prec accurary though
you compile in single precision.
Typically one compiles Gromacs in single precision which is enough
accuracy for most calculations. However, where single precision is
not enough, double precision is used for both compile scenarios. 

> If found at least one instance where a comment states that double is
> used for greater accuracy. If I compile gromacs in single precision this
> makes sense. Would it be a big impact if those places where compiled
> with single precision as well?
Yes, definitely. The idea of using explicit double-precision calculations
within a single-precision code is to get high (nearly double prec) accuracy 
at low (not more than single prec) cost.


> I appreciate all comments and opinions.
> Cheers
> Christian
> -- 
> gmx-developers mailing list
> gmx-developers at gromacs.org
> http://lists.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