update the naming convention

This commit is contained in:
Miroslav Stoyanov
2023-11-15 17:16:04 -05:00
parent bc7d0f5d50
commit 3c331321b3
4 changed files with 21 additions and 21 deletions

View File

@ -49,18 +49,18 @@ endif()
option(FFT_USE_HEFFTE "Use heFFTe as the distributed FFT engine, overrides the FFT option." OFF) option(FFT_USE_HEFFTE "Use heFFTe as the distributed FFT engine, overrides the FFT option." OFF)
if(FFT_USE_HEFFTE) if(FFT_USE_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
set(HEFFTE_BACKEND_VALUES FFTW MKL) set(FFT_HEFFTE_BACKEND_VALUES FFTW MKL)
set(HEFFTE_BACKEND "" CACHE STRING "Select heFFTe backend, e.g., FFTW or MKL") set(FFT_HEFFTE_BACKEND "" CACHE STRING "Select heFFTe backend, e.g., FFTW or MKL")
set_property(CACHE HEFFTE_BACKEND PROPERTY STRINGS ${HEFFTE_BACKEND_VALUES}) set_property(CACHE FFT_HEFFTE_BACKEND PROPERTY STRINGS ${FFT_HEFFTE_BACKEND_VALUES})
if(HEFFTE_BACKEND STREQUAL "FFTW") # respect the backend choice, FFTW or MKL if(FFT_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(HEFFTE_BACKEND STREQUAL "MKL") elseif(FFT_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(WARNING "HEFFTE_BACKEND not selected, defaulting to the builtin 'stock' backend, which is intended for testing and is not optimized for production runs") message(WARNING "FFT_HEFFTE_BACKEND not selected, defaulting to the builtin 'stock' backend, which is intended for testing and is not optimized for production runs")
endif() endif()
find_package(Heffte 2.4.0 QUIET COMPONENTS ${HEFFTE_COMPONENTS}) find_package(Heffte 2.4.0 QUIET COMPONENTS ${HEFFTE_COMPONENTS})
@ -78,7 +78,7 @@ if(FFT_USE_HEFFTE)
target_link_libraries(Heffte::Heffte INTERFACE Heffte) target_link_libraries(Heffte::Heffte INTERFACE Heffte)
endif() endif()
target_compile_definitions(lammps PRIVATE -DLMP_HEFFTE "-DHEFFTE_${HEFFTE_BACKEND}") target_compile_definitions(lammps PRIVATE -DFFT_HEFFTE "-DFFT_HEFFTE_${FFT_HEFFTE_BACKEND}")
target_link_libraries(lammps PRIVATE Heffte::Heffte) target_link_libraries(lammps PRIVATE Heffte::Heffte)
endif() endif()

View File

@ -83,7 +83,7 @@ better pipelining for packing and communication.
-D MKL_INCLUDE_DIR=path # ditto for Intel MKL library -D MKL_INCLUDE_DIR=path # ditto for Intel MKL library
-D FFT_MKL_THREADS=on # enable using threaded FFTs with MKL libraries -D FFT_MKL_THREADS=on # enable using threaded FFTs with MKL libraries
-D MKL_LIBRARY=path # path to MKL libraries -D MKL_LIBRARY=path # path to MKL libraries
-D HEFFTE_BACKEND=value # FFTW or MKL or empty/undefined for the stock backend -D FFT_HEFFTE_BACKEND=value # FFTW or MKL or empty/undefined for the stock backend
-D Heffte_ROOT=path # path to an existing heFFTe installation -D Heffte_ROOT=path # path to an existing heFFTe installation
@ -126,15 +126,15 @@ better pipelining for packing and communication.
.. code-block:: make .. code-block:: make
include <path-to-heffte-installation>/share/heffte/HeffteMakefile.in include <path-to-heffte-installation>/share/heffte/HeffteMakefile.in
FFT_INC = -DLMP_HEFFTE -DHEFFTE_FFTW $(heffte_include) FFT_INC = -DFFT_HEFFTE -DFFT_HEFFTE_FFTW $(heffte_include)
FFT_PATH = FFT_PATH =
FFT_LIB = $(heffte_link) $(heffte_libs) FFT_LIB = $(heffte_link) $(heffte_libs)
The heFFTe install path will contain `HeffteMakefile.in`. The heFFTe install path will contain `HeffteMakefile.in`.
which will define the `heffte_` include variables needed to link to heFFTe from which will define the `heffte_` include variables needed to link to heFFTe from
an external project using traditional make. an external project using traditional make.
The `-DLMP_HEFFTE` is required to switch to using heFFTe, while the optional `-DHEFFTE_FFTW` The `-DFFT_HEFFTE` is required to switch to using heFFTe, while the optional `-DFFT_HEFFTE_FFTW`
selects the desired heFFTe backend, e.g., `-DHEFFTE_FFTW` or `-DHEFFTE_MKL`, selects the desired heFFTe backend, e.g., `-DFFT_HEFFTE_FFTW` or `-DFFT_HEFFTE_MKL`,
omitting the variable will default to the `stock` backend. omitting the variable will default to the `stock` backend.
The `KISS FFT library <https://github.com/mborgerding/kissfft>`_ is The `KISS FFT library <https://github.com/mborgerding/kissfft>`_ is

View File

@ -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 LMP_HEFFTE #ifndef FFT_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 LMP_HEFFTE #ifndef FFT_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 LMP_HEFFTE #ifndef FFT_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 LMP_HEFFTE #ifndef FFT_HEFFTE
fft_1d_only((FFT_DATA *) in,nsize,flag,plan); fft_1d_only((FFT_DATA *) in,nsize,flag,plan);
#endif #endif
} }

View File

@ -17,18 +17,18 @@
#include "fft3d.h" // IWYU pragma: export #include "fft3d.h" // IWYU pragma: export
#include "pointers.h" #include "pointers.h"
#ifdef LMP_HEFFTE #ifdef FFT_HEFFTE
#include "heffte.h" #include "heffte.h"
// select the backend // select the backend
#if defined(HEFFTE_FFTW) #if defined(FFT_HEFFTE_FFTW)
using heffte_backend = heffte::backend::fftw; using heffte_backend = heffte::backend::fftw;
#elif defined(HEFFTE_MKL) #elif defined(FFT_HEFFTE_MKL)
using heffte_backend = heffte::backend::mkl; using heffte_backend = heffte::backend::mkl;
#elif defined(HEFFTE_) #else
using heffte_backend = heffte::backend::stock; using heffte_backend = heffte::backend::stock;
#endif #endif
#endif // LMP_HEFFTE #endif // FFT_HEFFTE
namespace LAMMPS_NS { namespace LAMMPS_NS {
@ -43,7 +43,7 @@ class FFT3d : protected Pointers {
void timing1d(FFT_SCALAR *, int, int); void timing1d(FFT_SCALAR *, int, int);
private: private:
#ifdef LMP_HEFFTE #ifdef FFT_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;