Two issues while using package GPU

Hi Luis,

in the corrected version of, I fixed a bug with computing force and energy in born/coul/wolf/gpu. The correction in lal_answer.cpp on the other hand deals with computing the potential energy per atom when the neighbor list is built on the CPU. Regarding your questions,

  • The minimization run should change, as expected, because energy with born/coul/wolf/gpu is now corrected. But I expect that the GPU minimization run with double-precision should match perfectly with the CPU run for the first iterations. The mixed precision version should give similar results to the CPU run at the first iteration.

  • Does temperature also blows up if you run without the GPU, i.e., in the CPU mode? If yes, then this is not the issue with the /gpu pair style.

  • The single precision version would give poor accuracy, particularly with the born/coul/wolf/gpu, where exp() and erfc() are directly used in the kernel. You may want to compile libgpu.a in the mixed precision for production runs.

For energy minimization, the GPU version would give very similar results to the CPU version at the very beginning of the minimization if you build libpgu.a in mixed- and double-precisions. The results will diverge as 1) the number of iterations increases and 2) how the potential energy landscape of your system behaves at the given initial configuration. Also the divergence between single-, mixed- and double-precision versions depends the specific floating-point operations of the pair styles, as mentioned above for born/coul/wolf/gpu. The reason that before correction the single and double precision versions gave almost the same results (which are wrong for your system) could be that the energy (and force) term, which had been missed in the previous version, are large relatively to the computed values. For both computational efficiency and accuracy, mixed precision is therefore often an option of choice.


Hi Trung,

  Thank you for all the clarification. In my case, unfortunately, mixed
precision also does not work. Actually, energy minimization is worse
compared to the single precision. I have to stick to double precision
for this system. CPU runs are also fine and compares well with GPU in


Hi Trung,

  Were these changes already deployed to the latest version of lammps?


Hi Trung,

  Were these changes already deployed to the latest version of lammps?

no. they (and a few additional changes and improvements) are currently
only available in the LAMMPS-ICMS git repo.