Inconsistancy in output for different number of cores

Dear LAMMPS users,

I am trying to calculate Thermal Conductivity of Si by Green-Kubo method, using the standard input file given in lammps/examples/KAPPA directory.

But, when I run the same input file on a different number of cores/processors using mpi command, i am getting different output value. e.g. Value of thermal conductivity is significantly different for 8 core run and 16 core run. I have tried testing on different installations but I’m facing the same problem. I am not sure what the issue is and how to approach the problem further.

Any comment is greatly appreciated.

What do you mean by “significant”?

You have to keep two things in mind:

  • MD is chaotic, i.e. trajectories will diverge exponentially if there are small differences (the so-called “Butterfly effect”) and small differences will appear due to the use of floating-point math, which is not associative, i.e. final value of total sums (e.g. that of forces) will depend on the order of the summing, which is different for different numbers of processors
  • Please keep the following note from the README file in mind:

These scripts are provided for illustration purposes. No guarantee is
made that the systems are fully equilibrated or that the runs are long
enough to generate good statistics and highly accurate results.

Thank you for your response.

  1. What I mean by significant is,
    The value of thermal conductivity of Si is 1506.40857903743 W/mK and 2257.75873594483 W/mK for 16 and 32 cores respectively. This difference is large enough. Although I am using the same input file.

  2. Regarding the chaotic nature of the simulations and the errors due to floating point math, I followed the suggestions given in the common problems section of the LAMMPS documentation (link : 11.1. Common problems — LAMMPS documentation) and used the loop option in the velocity command. This didn’t resolve the issue and the difference between the output is still large. Is there something else that can be done to resolve this problem ?

Looking forward to your reply.

I have nothing significant to add. Si is a different material than the LJ liquid from the examples in the KAPPA folder. So the quote from the README file still very much applies.

Try random independent starting configurations, and try to work out the uncertainty on your thermal conductivities – which you will have to do anyway, seeing as it’s very unlikely that your simulation gives you results accurate to 10^-10 W/mK. Correlational quantities are very tricky to calculate with MD and often require significant computational time to give proper sampling.