Updated documentation for FFT_KOKKOS_ flags and CMake variable selection

This commit is contained in:
Nick Hagerty
2023-12-18 11:30:56 -05:00
parent c45183d45c
commit a6addbc907
3 changed files with 21 additions and 4 deletions

View File

@ -51,14 +51,18 @@ LAMMPS can use them if they are available on your system.
.. code-block:: bash
-D FFT=value # FFTW3 or MKL or KISS, default is FFTW3 if found, else KISS
-D FFT_KOKKOS=value # FFTW3 or MKL or KISS or CUFFT or HIPFFT, default is KISS
-D FFT_SINGLE=value # yes or no (default), no = double precision
-D FFT_PACK=value # array (default) or pointer or memcpy
.. note::
The values for the FFT variable must be in upper-case. This is
an exception to the rule that all CMake variables can be specified
with lower-case values.
When the Kokkos variant of a package is compiled and selected at run time,
the FFT library selected by the FFT_KOKKOS variable applies. Otherwise,
the FFT library selected by the FFT variable applies.
The same FFT settings apply to both. FFT_KOKKOS must be compatible with the
Kokkos backend - for example, when using the CUDA backend of Kokkos,
you must use either CUFFT or KISS.
Usually these settings are all that is needed. If FFTW3 is
selected, then CMake will try to detect, if threaded FFTW
@ -87,6 +91,8 @@ LAMMPS can use them if they are available on your system.
FFT_INC = -DFFT_FFTW3 # -DFFT_FFTW3, -DFFT_FFTW (same as -DFFT_FFTW3), -DFFT_MKL, or -DFFT_KISS
# default is KISS if not specified
FFT_INC = -DFFT_KOKKOS_CUFFT # -DFFT_KOKKOS_{FFTW,FFTW3,MKL,CUFFT,HIPFFT,KISS}
# default is KISS if not specified
FFT_INC = -DFFT_SINGLE # do not specify for double precision
FFT_INC = -DFFT_FFTW_THREADS # enable using threaded FFTW3 libraries
FFT_INC = -DFFT_MKL_THREADS # enable using threaded FFTs with MKL libraries
@ -97,6 +103,8 @@ LAMMPS can use them if they are available on your system.
FFT_INC = -I/usr/local/include
FFT_PATH = -L/usr/local/lib
FFT_LIB = -lhipfft # hipFFT either precision
FFT_LIB = -lcufft # cuFFT either precision
FFT_LIB = -lfftw3 # FFTW3 double precision
FFT_LIB = -lfftw3 -lfftw3_omp # FFTW3 double precision with threads (needs -DFFT_FFTW_THREADS)
FFT_LIB = -lfftw3 -lfftw3f # FFTW3 single precision
@ -141,6 +149,10 @@ The Intel MKL math library is part of the Intel compiler suite. It
can be used with the Intel or GNU compiler (see the ``FFT_LIB`` setting
above).
The CUFFT and HIPFFT FFT libraries are packaged with NVIDIA's CUDA and AMD's
HIP installations, respectively. These FFT libraries require the Kokkos acceleration
package to be enabled and the Kokkos backend to be GPU-resident (ie, HIP or CUDA).
Performing 3d FFTs in parallel can be time-consuming due to data access
and required communication. This cost can be reduced by performing
single-precision FFTs instead of double precision. Single precision

View File

@ -349,6 +349,8 @@ Some common LAMMPS specific variables
- when set to ``name`` the LAMMPS executable and library will be called ``lmp_name`` and ``liblammps_name.a``
* - ``FFT``
- select which FFT library to use: ``FFTW3``, ``MKL``, ``KISS`` (default, unless FFTW3 is found)
* - ``FFT_KOKKOS``
- select which FFT library to use in Kokkos-enabled styles: ``FFTW3``, ``MKL``, ``HIPFFT``, ``CUFFT``, ``KISS`` (default)
* - ``FFT_SINGLE``
- select whether to use single precision FFTs (default: ``off``)
* - ``WITH_JPEG``

View File

@ -450,7 +450,10 @@ relative RMS error.
For the KOKKOS package, the *pppm/kk* style performs charge
assignment and force interpolation calculations, along with the FFTs
themselves, on the GPU or (optionally) threaded on the CPU when
using OpenMP and FFTW3.
using OpenMP and FFTW3. The specific FFT library is selected using
the FFT_KOKKOS CMake parameter. See the
:doc:`Build settings <Build_settings>` doc page for how to select a
3rd-party FFT library.
----------