I hope you’re all well. I’m currently experiencing a problem when running simulations involving several minimization steps. The simulation was run on two different workstations, the difference being in the number of CPUs used, I observed a slight discrepancy in the potential energy of the system (about 10 Kcal/mol) in a system containing 1302 atoms. m trying to understand whether this deviation arises due to:
- The differing number of CPUs.
- Differences in the minimization algorithm.
- Or perhaps there is another factor I might be overlooking.
Simulation A was run on 40 cpu
Simulation B was run on 140 cpu
I would greatly appreciate your insights, suggestions, or any pointers that could assist me in resolving this discrepancy.
Thank you very much for your help and time.
Both these numbers seem quite large for the rather small number of atoms, unless you are using a very computationally expensive pair style.
Whether you get consistent or even identical results from two minimization runs can depend on several factors:
- LAMMPS version (sometimes there are changes / bugfixes to the algorithms)
- Choice of compiler vendor, compiler version, compiler (optimization) flags
- CPU/GPU hardware
- Configuration settings (FFT library/precision, GPU/CPU acceleration and settings)
- Number of processors
- Roughness of the potential hyper-surface
- Initial geometry
- minimizer convergence settings and algorithm properties
Minimization is particularly sensitive, since small changes can lead the minimization algorithm into a different direction, especially when the initial configuration is at a meta-stable state or when the potential is rather rough. Compiler, CPU, optimization and number of processors can impact the order in which the forces are summed up and since floating-point math is not associative, this can have an impact on the exact result. Because minimizers can get trapped in (small) local minima, it is always possible that you get different results.
Whether the resulting differences are significant or can be ignored depend largely on the specific system and force field and purpose of the simulation. A common procedure to check for the “stability” of minimization results would be to randomize atom positions by a small (but not too small) margin and re-minimize and check how close the results are to each other.