Error on lammps-4Jul12: Lammps adding values to defined timestep

I have recently installed debian “squeeze” as my main OS and have since encountered an issue with lammps. I’ve have attached a log file displaying the fact that a value of 0.0000000000000000001041 is being added to the value I have set as my timestep. I have also attached my input file. My simulation runs are completing without error, but, in very long runs (or runs where the timestep value is combined with other variables to set parameters), this artifact can become a bit of an issue. I have experienced this error running both with mpich2 and without it, and have experienced it in every run since installation. I was wondering if anyone has had problems with this or a similar error before or had advice on how it could be solved. I have tried re-making lammps and the problem persists. Any help would be greatly appreciated.

Thank you,

Ryan

tr.log (3.25 KB)

trial.6beadtail (1.5 KB)

I have recently installed debian "squeeze" as my main OS and have since
encountered an issue with lammps. I've have attached a log file displaying
the fact that a value of 0.0000000000000000001041 is being added to the
value I have set as my timestep. I have also attached my input file. My
simulation runs are completing without error, but, in very long runs (or
runs where the timestep value is combined with other variables to set
parameters), this artifact can become a bit of an issue. I have experienced
this error running both with mpich2 and without it, and have experienced it
in every run since installation. I was wondering if anyone has had problems
with this or a similar error before or had advice on how it could be solved.

there is no "solution". welcome to the wonderful world
of inexact floating point math. the secret is that you
choice of timestep cannot be exactly represented as
a floating point number. a lot of other things that you
compute during your MD has similar issues and often
with much more drastic outcome for the exact same
reasons. they ain't no escape from the blues...

axel.

I think the recent change that is causing this is this line in
Variable::retrieve()
    sprintf(result,"%.20g",answer);
which was to try and capture as much precision as possible in the
variable evaluation.

However 20 is more digits of precision than there really are, so there
is garbage at the end. This also affected someone in a recent post
who was using the variable as a filename.

I don't really like this side effect. Maybe we need to use a different
format string, or have an option with variables to limit the precision
when desired? Any suggestions from Axel or others?

Steve