Load balance led to unreproducible results

Hi LAMMPS developers and users.

I would get distinct results when I ran the same simulation twice. However, when I turned off load balancing, the results would be the same for two trials. I used the rcb style with sort yes. I just want to know how to keep subdomain decomposition the same for different runs.

Then I tried to save the atoms of each processor, which have been balanced, so that atoms of each processor could be the same at every run and reproducibility could be ensured.

comm_style tiled
balance 1.01 rcb
run     100
write_restart test-proc%.restart

Nlocal: 5073.17 ave 5106 max 5050 min

In a new simulation, I read these atoms with the same processors but found they were not balanced as what I had saved.

read_restart test-proc%.restart
...
run 0

Nlocal: 5073.17 ave 11149 max 0 min

This confused me very much.

That is no surprise since the domain decomposition is not stored in a restart, only the global box and particle positions. So to recreate the effect of the balance command, you would have to re-run it, and if the particle positions are not exactly the same, you won’t get the exact same sub-domain division. That is just in the nature of things. It is generally so that perfect reproduction of simulation results requires to run in serial and without thermostats and other irreversible system manipulations.
Please keep in mind, that restarts are supposed to be (mostly) independent from how many MPI ranks you are using.

1 Like

Thanks. I got it.