got different results for a same input script

Hi,

I ran a lammps input script with 2 approaches : 1) using mpich2 on 18 nodes with 1 processor/node and 2) using mpich2 on a single node but utilized all 4 processors. I was surprised when I realized that I got slightly different results (volume, energy, etc.) from the two different approaches. I wonder why I did not get same results?

I attached my input script for your perusal.

strontium titanate system

atom_style charge
units real
dimension 3
boundary p p p

lattice

lattice custom 3.9051 a1 1.0 0.0 0.0 a2 0.0 1.0 0.0 a3 0.0 0.0 1.0 basis 0.0 0.0 0.0 basis 0.5 0.5 0.5 &
basis 0.5 0.5 0.0 basis 0.5 0.0 0.5 basis 0.0 0.5 0.5
region simbox block 0 4 0 4 0 4
create_box 3 simbox
create_atoms 1 box basis 1 1 basis 2 2 basis 3 3 basis 4 3 basis 5 3
group sr type 1
group ti type 2
group o type 3
mass 1 87.62
mass 2 47.867
mass 3 15.999
set group sr charge 1.2
set group ti charge 2.4
set group o charge -1.2

force-field

pair_style hybrid/overlay born 11.0 coul/long 11.0 morse 11.0
pair_coeff * * coul/long
pair_coeff 1 1 born 0.32 0.32 2.396 100.0 0.0
pair_coeff 1 2 born 0.34 0.34 2.253 250.0 0.0
pair_coeff 1 3 born 0.32 0.32 3.124 200.0 0.0
pair_coeff 2 2 born 0.36 0.36 2.110 625.0 0.0
pair_coeff 2 3 born 0.34 0.34 2.981 500.0 0.0
pair_coeff 3 3 born 0.32 0.32 3.852 400.0 0.0
pair_coeff 1 3 morse 2.41 1.18 2.7615
pair_coeff 2 3 morse 4.23 3.82 2.1923

kspace_style ewald 0.0001
pair_modify tail yes shift no

initialize

timestep 1.0
#velocity all create 298.0 1234567 dist gaussian
neighbor 2.0 bin
neigh_modify delay 5 check yes

output

variable N equal step
variable pote equal pe
variable Etotal equal etotal
variable T equal temp
variable Press equal press
variable V equal vol
variable kine equal ke
variable Lx equal lx/4
variable Ly equal ly/4
variable Lz equal lz/4

fix extra all print 1 “{N} {T} {V} {Press} {kine} {pote} {Etotal}" file strontium_titanate.out fix cell all print 1 "{N} {T} {Lx} {Ly} {Lz}” file strontium_titanate.cell

dump snapshot all custom 100 strontium_titanate.lammpstrj id q type x y z

equilibration & thermalization

fix NPT all npt temp 298.0 298.0 100 aniso 1.01325 1.01325 1000
run 15000

Thank you.

Regards,
Christopher

Hi,

I ran a lammps input script with 2 approaches : 1) using mpich2 on 18 nodes
with 1 processor/node and 2) using mpich2 on a single node but utilized all
4 processors. I was surprised when I realized that I got slightly different
results (volume, energy, etc.) from the two different approaches. I wonder
why I did not get same results?

because floating point math has truncation errors and is not associative.
results depend on the order they are summed up in.

for more details, you can check out slides 12 to 20 in the lecture
"From Source Code To Executable Part 2" posted on my homepage:
http://sites.google.com/site/akohlmey/lectures/introduction-to-hpc-fall-2010
that page also has some example programs to play with.

cheers,
    axel.

if forgot. if you use fixed point math, you will make similar errors,
but the results will be reproducible. however, fixed point math is
not convenient to use.

in MD and at finite temperature, it doesn't matter whether individual
results diverge (MD _is_ chaotic and thus trajectories are always bound
to diverge exponentially) for as long as you are equilibrium and you
can average over the whole time.

cheers,
    axel.

Axel (and I) are assuming you mean the 2 simulations started
out identical, then slowly drifted apart. In which case Axel's
explanation is spot-on.

Steve

Dear Dr. Axel Kohlmeyer and Dr. Steve Plimpton,

Thank you for your guidance.

Ya, both started out identically (using lmp_g++), the only difference is the machines (18nodes with 1core/node and single node with 4 cores).
I guess the small discrepancies came from the numerical floating-point. Dr. Axel suggested me to increase the number of time steps.
At the beginning I used 10 000 time steps (according to published article). So this time I will increase the equilibration’s time steps to 100 000 and obtain quantities by averaging over 100 000 steps.

I would like to ask a question in passing, I calculated covariance of energy and volume for a molecular dynamics system and found out the covariance is equals to zero. This means that the energy (Hamiltonian) and the volume are independent. Am I right?

Thank you.

Regards,
Christopher