CPU Precision

Hello LAMMPS people,

I’m trying to determine the standard degree of precision that LAMMPS uses when performing calculations in a default CPU, non-accelerated build (there seems to be plenty of information for accelerated packages). Is it guaranteed single or double precision across LAMMPS?

Thanks,
Aaron

Hello LAMMPS people,

I'm trying to determine the standard degree of precision that LAMMPS uses
when performing calculations in a default CPU, non-accelerated build (there
seems to be plenty of information for accelerated packages). Is it
guaranteed single or double precision across LAMMPS?

LAMMPS uses double precision throughout with a few exceptions:
- tabulation for coulomb interactions uses single precision
- FFT support can be compiled with single or double precision FFTs
(default is double).

please note that "precision" is still a rather vague descriptor for
accuracy, since there are a lot of approximations and simplifications
that can go into a model and its implementation and please also note
that the precision of force computations, for example, depends on the
absolute magnitude of coordinates. for a model in reduced units,
distances are computed the most precise between 1.0 and 2.0. beyond
that you lose one bit per doubling of the absolute value of the
coordinate.

axel.

LAMMPS is double precision (this doesn’t mean the results you get will actually be “double precision” themselves, due to the floating point arithemtic!). This is at a quick glance all that I could find about building single precision:

“”"
The FFT_INC variable also allows for a -DFFT_SINGLE setting that will use single-precision FFTs with PPPM, which can speed-up long-range calulations, particularly in parallel or on GPUs. Fourier transform and related PPPM operations are somewhat insensitive to floating point truncation errors and thus do not always need to be performed in double precision. Using the -DFFT_SINGLE setting trades off a little accuracy for reduced memory use and parallel communication costs for transposing 3d FFT data. Note that single precision FFTs have only been tested with the FFTW3, FFTW2, MKL, and KISS FFT options.

“”"