I have a question about precision in LAMMPS. (lammps-1Feb14)

We’re comparing two calculations using LAMMPS. Both calculations involve
the same initial conditions. Both are NVE (regular MD). The cell is small (8 atoms).

Calculation #1 runs the MD for the total time. So, for example, run 10000

Calculation #2 chops the MD into segments but for the same total time.
So, for example,
run 1000
run 1000
run 1000
(total of 10 of these).

We find that the final states of the two calculations differ in the 8th decimal place.
The differences increase if we make more segments in the 2nd calculation.

The difference is comparable to what one would expect for single precision. Is it
possible somewhere in the LAMMPS procedure that there is a step between the
successive runs where the configuration is converted to single precision and then
back to double precision for the next segment?

Or maybe something else is happening?

Do you have any thoughts to help us out? We need to have double precision throughout
in order to carry out the calculations we’re doing.

Thank you.

…Murray Daw

I have a question about precision in LAMMPS. (lammps-1Feb14)

We’re comparing two calculations using LAMMPS. Both calculations involve
the same initial conditions. Both are NVE (regular MD). The cell is small
(8 atoms).

Calculation #1 runs the MD for the total time. So, for example, run
10000

Calculation #2 chops the MD into segments but for the same total time.
So, for example,
run 1000
run 1000
run 1000
(total of 10 of these).

We find that the final states of the two calculations differ in the 8th
decimal place.
The differences increase if we make more segments in the 2nd calculation.

The difference is comparable to what one would expect for single
precision. Is it
possible somewhere in the LAMMPS procedure that there is a step between the
successive runs where the configuration is converted to single precision
and then
back to double precision for the next segment?

​there is no such thing.

Or maybe something else is happening?

​since you don't use the "pre no" flag, LAMMPS will re-initialize the
neighbor list processing, which in turn may lead to atoms being ordered
differently, when the neighbor list processing happens on different stes,
which in turn can result in small differences when summing up forces due to
floating-point math not being associative. these small differences will
grow exponentially (aka lyapunov instability or "butterfly effect"), due to
MD being a chaotic system.

Do you have any thoughts to help us out? We need to have double precision
throughout
in order to carry out the calculations we’re doing.

​please note, that if you want perfectly reproducible MD runs, especially
when also running in parallel, you will have to implement an MD code using
fixed point math.​

​axel.​

Thank you.

…Murray Daw

Dear Axel,

Thank you for your quick reply. And also especially because it worked!

Best,
Murray