update variable names
This commit is contained in:
@ -971,6 +971,20 @@ if(PKG_KOKKOS)
|
|||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
if(PKG_KSPACE)
|
if(PKG_KSPACE)
|
||||||
|
if (LMP_HEFFTE)
|
||||||
|
message(STATUS "<<< FFT settings >>>
|
||||||
|
-- Primary FFT lib: heFFTe")
|
||||||
|
if (HEFFTE_BACKEND)
|
||||||
|
message(STATUS "heFFTe backend: ${HEFFTE_BACKEND}")
|
||||||
|
else()
|
||||||
|
message(STATUS "heFFTe backend: stock (not intended for production)")
|
||||||
|
endif()
|
||||||
|
if(FFT_SINGLE)
|
||||||
|
message(STATUS "Using single precision FFTs")
|
||||||
|
else()
|
||||||
|
message(STATUS "Using double precision FFTs")
|
||||||
|
endif()
|
||||||
|
else()
|
||||||
message(STATUS "<<< FFT settings >>>
|
message(STATUS "<<< FFT settings >>>
|
||||||
-- Primary FFT lib: ${FFT}")
|
-- Primary FFT lib: ${FFT}")
|
||||||
if(FFT_SINGLE)
|
if(FFT_SINGLE)
|
||||||
@ -1005,6 +1019,7 @@ if(PKG_KSPACE)
|
|||||||
message(STATUS "Kokkos FFT: ${FFT}")
|
message(STATUS "Kokkos FFT: ${FFT}")
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
if(BUILD_DOC)
|
if(BUILD_DOC)
|
||||||
message(STATUS "<<< Building HTML Manual >>>")
|
message(STATUS "<<< Building HTML Manual >>>")
|
||||||
|
|||||||
@ -46,17 +46,21 @@ else()
|
|||||||
target_compile_definitions(lammps PRIVATE -DFFT_KISS)
|
target_compile_definitions(lammps PRIVATE -DFFT_KISS)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
option(FFT_HEFFTE "Use heFFTe as the distributed FFT engine." OFF)
|
option(LMP_HEFFTE "Use heFFTe as the distributed FFT engine, supersedes the FFT option." OFF)
|
||||||
if(FFT_HEFFTE)
|
if(LMP_HEFFTE)
|
||||||
# if FFT_HEFFTE is enabled, switch the builtin FFT engine with Heffte
|
# if FFT_HEFFTE is enabled, switch the builtin FFT engine with Heffte
|
||||||
if(FFT STREQUAL "FFTW3") # respect the backend choice, FFTW or MKL
|
set(HEFFTE_BACKEND_VALUES FFTW MKL)
|
||||||
|
set(HEFFTE_BACKEND "" CACHE STRING "Select heFFTe backend, e.g., FFTW or MKL")
|
||||||
|
set_property(CACHE HEFFTE_BACKEND PROPERTY STRINGS ${HEFFTE_BACKEND_VALUES})
|
||||||
|
|
||||||
|
if(HEFFTE_BACKEND STREQUAL "FFTW") # respect the backend choice, FFTW or MKL
|
||||||
set(HEFFTE_COMPONENTS "FFTW")
|
set(HEFFTE_COMPONENTS "FFTW")
|
||||||
set(Heffte_ENABLE_FFTW "ON" CACHE BOOL "Enables FFTW backend for heFFTe")
|
set(Heffte_ENABLE_FFTW "ON" CACHE BOOL "Enables FFTW backend for heFFTe")
|
||||||
elseif(FFT STREQUAL "MKL")
|
elseif(HEFFTE_BACKEND STREQUAL "MKL")
|
||||||
set(HEFFTE_COMPONENTS "MKL")
|
set(HEFFTE_COMPONENTS "MKL")
|
||||||
set(Heffte_ENABLE_MKL "ON" CACHE BOOL "Enables MKL backend for heFFTe")
|
set(Heffte_ENABLE_MKL "ON" CACHE BOOL "Enables MKL backend for heFFTe")
|
||||||
else()
|
else()
|
||||||
message(FATAL_ERROR "Using -DFFT_HEFFTE=ON, requires FFT either FFTW or MKL")
|
message(WARNING "HEFFTE_BACKEND not selected, defaulting to 'stock' backend, which is not intended for production")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
find_package(Heffte 2.3.0 QUIET COMPONENTS ${HEFFTE_COMPONENTS})
|
find_package(Heffte 2.3.0 QUIET COMPONENTS ${HEFFTE_COMPONENTS})
|
||||||
@ -72,7 +76,7 @@ if(FFT_HEFFTE)
|
|||||||
set_target_properties(lammps PROPERTIES INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
|
set_target_properties(lammps PROPERTIES INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
target_compile_definitions(lammps PRIVATE -DHEFFTE)
|
target_compile_definitions(lammps PRIVATE -DLMP_HEFFTE "-DHEFFTE_${HEFFTE_BACKEND}")
|
||||||
target_link_libraries(lammps PRIVATE Heffte::Heffte)
|
target_link_libraries(lammps PRIVATE Heffte::Heffte)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|||||||
@ -27,7 +27,7 @@ FFT3d::FFT3d(LAMMPS *lmp, MPI_Comm comm, int nfast, int nmid, int nslow,
|
|||||||
int out_klo, int out_khi,
|
int out_klo, int out_khi,
|
||||||
int scaled, int permute, int *nbuf, int usecollective) : Pointers(lmp)
|
int scaled, int permute, int *nbuf, int usecollective) : Pointers(lmp)
|
||||||
{
|
{
|
||||||
#ifndef HEFFTE
|
#ifndef LMP_HEFFTE
|
||||||
plan = fft_3d_create_plan(comm,nfast,nmid,nslow,
|
plan = fft_3d_create_plan(comm,nfast,nmid,nslow,
|
||||||
in_ilo,in_ihi,in_jlo,in_jhi,in_klo,in_khi,
|
in_ilo,in_ihi,in_jlo,in_jhi,in_klo,in_khi,
|
||||||
out_ilo,out_ihi,out_jlo,out_jhi,out_klo,out_khi,
|
out_ilo,out_ihi,out_jlo,out_jhi,out_klo,out_khi,
|
||||||
@ -56,7 +56,7 @@ FFT3d::FFT3d(LAMMPS *lmp, MPI_Comm comm, int nfast, int nmid, int nslow,
|
|||||||
|
|
||||||
FFT3d::~FFT3d()
|
FFT3d::~FFT3d()
|
||||||
{
|
{
|
||||||
#ifndef HEFFTE
|
#ifndef LMP_HEFFTE
|
||||||
fft_3d_destroy_plan(plan);
|
fft_3d_destroy_plan(plan);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
@ -65,7 +65,7 @@ FFT3d::~FFT3d()
|
|||||||
|
|
||||||
void FFT3d::compute(FFT_SCALAR *in, FFT_SCALAR *out, int flag)
|
void FFT3d::compute(FFT_SCALAR *in, FFT_SCALAR *out, int flag)
|
||||||
{
|
{
|
||||||
#ifndef HEFFTE
|
#ifndef LMP_HEFFTE
|
||||||
fft_3d((FFT_DATA *) in,(FFT_DATA *) out,flag,plan);
|
fft_3d((FFT_DATA *) in,(FFT_DATA *) out,flag,plan);
|
||||||
#else
|
#else
|
||||||
if (flag == 1)
|
if (flag == 1)
|
||||||
@ -86,7 +86,7 @@ void FFT3d::compute(FFT_SCALAR *in, FFT_SCALAR *out, int flag)
|
|||||||
|
|
||||||
void FFT3d::timing1d(FFT_SCALAR *in, int nsize, int flag)
|
void FFT3d::timing1d(FFT_SCALAR *in, int nsize, int flag)
|
||||||
{
|
{
|
||||||
#ifndef HEFFTE
|
#ifndef LMP_HEFFTE
|
||||||
fft_1d_only((FFT_DATA *) in,nsize,flag,plan);
|
fft_1d_only((FFT_DATA *) in,nsize,flag,plan);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|||||||
@ -17,16 +17,18 @@
|
|||||||
#include "fft3d.h" // IWYU pragma: export
|
#include "fft3d.h" // IWYU pragma: export
|
||||||
#include "pointers.h"
|
#include "pointers.h"
|
||||||
|
|
||||||
#ifdef HEFFTE
|
#ifdef LMP_HEFFTE
|
||||||
#include "heffte.h"
|
#include "heffte.h"
|
||||||
// select the backend
|
// select the backend
|
||||||
#if defined(FFT_FFTW3)
|
#if defined(HEFFTE_FFTW)
|
||||||
using heffte_backend = heffte::backend::fftw;
|
using heffte_backend = heffte::backend::fftw;
|
||||||
#elif defined(FFT_MKL)
|
#elif defined(HEFFTE_MKL)
|
||||||
using heffte_backend = heffte::backend::mkl;
|
using heffte_backend = heffte::backend::mkl;
|
||||||
|
#elif defined(HEFFTE_)
|
||||||
|
using heffte_backend = heffte::backend::stock;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif // HEFFTE
|
#endif // LMP_HEFFTE
|
||||||
|
|
||||||
namespace LAMMPS_NS {
|
namespace LAMMPS_NS {
|
||||||
|
|
||||||
@ -41,7 +43,7 @@ class FFT3d : protected Pointers {
|
|||||||
void timing1d(FFT_SCALAR *, int, int);
|
void timing1d(FFT_SCALAR *, int, int);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
#ifdef HEFFTE
|
#ifdef LMP_HEFFTE
|
||||||
// the heFFTe plan supersedes the internal fft_plan_3d
|
// the heFFTe plan supersedes the internal fft_plan_3d
|
||||||
std::unique_ptr<heffte::fft3d<heffte_backend>> heffte_plan;
|
std::unique_ptr<heffte::fft3d<heffte_backend>> heffte_plan;
|
||||||
std::vector<std::complex<FFT_SCALAR>> heffte_workspace;
|
std::vector<std::complex<FFT_SCALAR>> heffte_workspace;
|
||||||
|
|||||||
Reference in New Issue
Block a user