diff options
author | Marco De La Pierre <marco.delapierre@gmail.com> | 2022-07-12 22:14:58 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-12 16:14:58 +0200 |
commit | ff67e10f60654c19cc249e35dfadf81598f2b71a (patch) | |
tree | 5e0ac4e3bff55fe8e528b278d719b4a3190f2d80 /var | |
parent | c8931e390ac1f62e5ddd61576c13e57e1d3bf86f (diff) | |
download | spack-ff67e10f60654c19cc249e35dfadf81598f2b71a.tar.gz spack-ff67e10f60654c19cc249e35dfadf81598f2b71a.tar.bz2 spack-ff67e10f60654c19cc249e35dfadf81598f2b71a.tar.xz spack-ff67e10f60654c19cc249e35dfadf81598f2b71a.zip |
lammps package: added fftw_precision variant (#31459)
Diffstat (limited to 'var')
-rw-r--r-- | var/spack/repos/builtin/packages/lammps/package.py | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/var/spack/repos/builtin/packages/lammps/package.py b/var/spack/repos/builtin/packages/lammps/package.py index 5324b5e7a2..1d8ba8019e 100644 --- a/var/spack/repos/builtin/packages/lammps/package.py +++ b/var/spack/repos/builtin/packages/lammps/package.py @@ -144,6 +144,9 @@ class Lammps(CMakePackage, CudaPackage): '64-bit #atoms #timesteps, bigbig: also 64-bit imageint, 64-bit atom ids)', values=('smallbig', 'bigbig', 'smallsmall'), multi=False ) + variant('fftw_precision', default='double', when='+kspace', + description='Select FFTW precision (used by Kspace)', + values=('single', 'double'), multi=False) depends_on('mpi', when='+mpi') depends_on('mpi', when='+mpiio') @@ -567,20 +570,23 @@ class Lammps(CMakePackage, CudaPackage): if '+kim' in spec: args.append('-DPKG_KIM=ON') if '+kspace' in spec: + # If FFTW3 is selected, then CMake will try to detect, if threaded + # FFTW libraries are available and enable them by default. if '^fftw' in spec: args.append('-DFFT=FFTW3') if '^mkl' in spec: args.append('-DFFT=MKL') if '^amdfftw' in spec: - # If FFTW3 is selected, then CMake will try to detect, if threaded - # FFTW libraries are available and enable them by default. args.append(self.define('FFT', 'FFTW3')) - # Using the -DFFT_SINGLE setting trades off a little accuracy - # for reduced memory use and parallel communication costs - # for transposing 3d FFT data. - args.append(self.define('FFT_SINGLE', True)) if '^cray-fftw' in spec: args.append('-DFFT=FFTW3') + # Using the -DFFT_SINGLE setting trades off a little accuracy + # for reduced memory use and parallel communication costs + # for transposing 3d FFT data. + if spec.satisfies('fftw_precision=single'): + args.append('-DFFT_SINGLE=True') + else: + args.append('-DFFT_SINGLE=False') if '+kokkos' in spec: args.append('-DEXTERNAL_KOKKOS=ON') |