[gmx-users] Precision in trajectory file

Mark Abraham mark.abraham at anu.edu.au
Wed Aug 4 04:56:54 CEST 2010

----- Original Message -----
From: Inon Sharony <InonShar at TAU.ac.IL>
Date: Tuesday, August 3, 2010 20:55
Subject: [gmx-users] Precision in trajectory file
To: "gmx-users at gromacs.org" <gmx-users at gromacs.org>, gmx-developers <gmx-developers at gromacs.org>

> Good afternoon!
> It seems to me that although I'm running a double-precision 
> installation of GROMACS, the printout to file (of the positions 
> and velocities) is of much less precision. i.e. the computation 
> is done on numbers with something like 16 significant digits, 
> but the last 10 of those are simply truncated and lost (e.g. 
> positions are given in single-precision as 0.000 nm, and in 
> double-precision as 0.00000 nm). Since I've already spent 
> computation time at getting double-precision, I'd like to make 
> use of all of it -- for my own reasons. I already searched the 
> manuals, mailing lists and source code for instruction but 
> didn't find any.
> Could you please tell me how I can change the number of digits 
> printed out (e.g. to the .trr file)? I'm looking for a more 
> elegant solution than adding a printf line to the source code. 
> Something along the lines of changing the format of numbers in 
> the function that prints to .trr .

You seem confused about something. The .trr file contains a binary representation of the value, in the appropriate precision. There's no nonsense about the number of digits *it* has - it has full single/double-precision binary floating-point numbers, and its precision is not measured in digits.

Some program that reads those numbers and writes human-readable forms might choose to lose precision, but the underlying precision was always there...

There's no straightforward way to get large amounts of precision output with GROMACS tools, because only a few of the digits are actually significant. You could hack the code to g_traj or gmxdump to get all the precision if you really want it.


> Thanks in advance!
> -- 
> Inon Sharony
> ינון שרוני
> 972-3-6407634
> Please consider your environmental responsibility before 
> printing this e-mail.
> -- 
> gmx-users mailing list    gmx-users at gromacs.org
> http://lists.gromacs.org/mailman/listinfo/gmx-users
> Please search the archive at http://www.gromacs.org/search 
> before posting!
> Please don't post (un)subscribe requests to the list. Use the 
> www interface or send it to gmx-users-request at gromacs.org.
> Can't post? Read http://www.gromacs.org/mailing_lists/users.php
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://maillist.sys.kth.se/pipermail/gromacs.org_gmx-users/attachments/20100804/16ec1827/attachment.html>

More information about the gromacs.org_gmx-users mailing list