Re: amber-developers: ptraj precision

From: Robert Duke <rduke.email.unc.edu>
Date: Tue, 6 Feb 2007 08:08:15 -0500

Hi Carlos -
You are not correct; the conversion error seen here is due to using a float
as the input variable, as well as a float reading format, but there would
still be no error associated with that if there were not unavoidable
problems with the mix of internal and external representation. The reason
you don't "see" any conversion error is that using double precision in
fortran, the conversion error occurs down around decimal place 16-17 (if
memory serves). SO you WOULD see differences in a restart trajectory, but
once again you may have to do something like a debug dump of the energies to
actually notice it due to truncation of mdout output. The reason I am being
sticky about this point is that you were talking about "exact conversion to
restart"; the only way to get this is with a binary restart file which I am
not sure we reliably support (I know there are input options to do this; I
have no confidence that the stuff actually works across all platforms,
having seen the standard fortran binary i/o fall on it's face before - the
specification of external (file) representation is incomplete and vendor
specific). We should maybe extend NetCDF to cover the restrt and inpcrd
files sometime, if folks really want to be able to do an "exact" restrart.
Regards - Bob

----- Original Message -----
From: "Carlos Simmerling" <carlos.csb.sunysb.edu>
To: <amber-developers.scripps.edu>
Sent: Tuesday, February 06, 2007 7:44 AM
Subject: Re: amber-developers: ptraj precision


>I should point out that I wrote a simple fortran program to write restarts
> and I get exactly what I expected- the number in the traj file followed
> by zeroes. So, I don't think it is a problem with internal representation,
> it's something with either ptraj or C.
> carlos
>
> Robert Duke wrote:
>
>> Carlos -
>> I expect the problem is internal binary representation of the floating
>> point numbers. So the input trajectory file values may not be exactly
>> representable, though you are probably coming closer internally to your
>> input than it appears in your restart output (which also suffers from not
>> exactly representing the internal value). The only way to avoid this
>> sort of thing is with BCD - binary-coded decimal, which I believe is
>> probably available in Cobol and assembler :-) (probably PL/1 too).
>> Regards - Bob
>>
>> ----- Original Message ----- From: "Carlos Simmerling"
>> <carlos.csb.sunysb.edu>
>> To: <amber-developers.scripps.edu>
>> Sent: Monday, February 05, 2007 5:18 PM
>> Subject: amber-developers: ptraj precision
>>
>>
>>> I am reading a trajectory file into ptraj and writing as restart, with
>>> no actions (no imaging, etc).
>>>
>>> I don't get quite what is in the traj file, does anyone know why?
>>> The precision error is enough to affect the energies
>>> and I want the actual coordinates from the traj file, not ones that are
>>> +/- 0.000005 etc.
>>> yes, I know that the ones in the traj file aren't exactly what was in
>>> the original MD, but the point is to do an exact
>>> conversion to restart.
>>> thanks
>>> carlos
>>>
>>> EXAMPLE
>>> input trajectory file:
>>> 18.438 29.157 33.019 18.614 28.133 32.690
>>> output restart from ptraj:
>>> 18.4379997 29.1569996 33.0190010 18.6140003 28.1329994 32.6899986
>>>
>>>
>>>
>>>
>>> --
>>> ===================================================================
>>> Carlos L. Simmerling, Ph.D.
>>> Associate Professor Phone: (631) 632-1336
>>> Center for Structural Biology Fax: (631) 632-1555
>>> CMM Bldg, Room G80
>>> Stony Brook University E-mail: carlos.simmerling.stonybrook.edu
>>> Stony Brook, NY 11794-5115
>>> ===================================================================
>>>
>>>
>>>
>>>
>>
>
Received on Wed Feb 07 2007 - 06:07:35 PST
Custom Search