From b72300b560e49de98abdac6a7ca18303d6bb7c1e Mon Sep 17 00:00:00 2001 From: Erik Lindahl Date: Mon, 6 Jul 2015 14:56:23 +0200 Subject: [PATCH] Move FFT defines to use cmakedefine01 Change-Id: Ie9fface5ea2ec365aa740cfe60243d195e1039ba --- src/config.h.cmakein | 10 ++-------- src/gromacs/fft/fft.cpp | 4 ++-- src/gromacs/fft/fft5d.cpp | 11 ++++++----- src/gromacs/fft/fft5d.h | 6 +++--- src/gromacs/fft/fft_fftw3.cpp | 6 +++--- 5 files changed, 16 insertions(+), 21 deletions(-) diff --git a/src/config.h.cmakein b/src/config.h.cmakein index 971bbd6d7d..51f3fb0ec6 100644 --- a/src/config.h.cmakein +++ b/src/config.h.cmakein @@ -56,16 +56,10 @@ #cmakedefine GMX_BROKEN_CALLOC /* Do not optimize FFTW setups (not needed with SSE FFT kernels) */ -#cmakedefine GMX_DISABLE_FFTW_MEASURE - -/* Use Built-in FFTPACK FFT library */ -#cmakedefine GMX_FFT_FFTPACK +#cmakedefine01 GMX_DISABLE_FFTW_MEASURE /* Use FFTW3 FFT library */ -#cmakedefine GMX_FFT_FFTW3 - -/* Use Intel MKL FFT library */ -#cmakedefine GMX_FFT_MKL +#cmakedefine01 GMX_FFT_FFTW3 /* Target platform is x86 or x86_64 */ #cmakedefine GMX_TARGET_X86 diff --git a/src/gromacs/fft/fft.cpp b/src/gromacs/fft/fft.cpp index 2d8a81e17b..9ead1601ff 100644 --- a/src/gromacs/fft/fft.cpp +++ b/src/gromacs/fft/fft.cpp @@ -2,7 +2,7 @@ * This file is part of the GROMACS molecular simulation package. * * Copyright (c) 1991-2003 Erik Lindahl, David van der Spoel, University of Groningen. - * Copyright (c) 2013,2014, by the GROMACS development team, led by + * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -53,7 +53,7 @@ * files like fft_fftw3.c or fft_mkl.c for that. */ -#ifndef GMX_FFT_FFTW3 +#if !GMX_FFT_FFTW3 struct gmx_many_fft { int howmany; diff --git a/src/gromacs/fft/fft5d.cpp b/src/gromacs/fft/fft5d.cpp index 38b105a761..4982dfbf59 100644 --- a/src/gromacs/fft/fft5d.cpp +++ b/src/gromacs/fft/fft5d.cpp @@ -77,7 +77,8 @@ FILE* debug = 0; #endif -#ifdef GMX_FFT_FFTW3 +#if GMX_FFT_FFTW3 + #include "gromacs/utility/exceptions.h" #include "gromacs/utility/mutex.h" /* none of the fftw3 calls, except execute(), are thread-safe, so @@ -451,7 +452,7 @@ fft5d_plan fft5d_plan_3d(int NG, int MG, int KG, MPI_Comm comm[2], int flags, t_ fprintf(debug, "Running on %d threads\n", nthreads); } -#ifdef GMX_FFT_FFTW3 +#if GMX_FFT_FFTW3 /* Don't add more stuff here! We have already had at least one bug because we are reimplementing * the low-level FFT interface instead of using the Gromacs FFT module. If we need more * generic functionality it is far better to extend the interface so we can use it for @@ -613,7 +614,7 @@ fft5d_plan fft5d_plan_3d(int NG, int MG, int KG, MPI_Comm comm[2], int flags, t_ } } -#ifdef GMX_FFT_FFTW3 +#if GMX_FFT_FFTW3 } #endif if ((flags&FFT5D_ORDER_YZ)) /*plan->cart is in the order of transposes */ @@ -984,7 +985,7 @@ void fft5d_execute(fft5d_plan plan, int thread, fft5d_time times) int s = 0, tstart, tend, bParallelDim; -#ifdef GMX_FFT_FFTW3 +#if GMX_FFT_FFTW3 if (plan->p3d) { if (thread == 0) @@ -1276,7 +1277,7 @@ void fft5d_destroy(fft5d_plan plan) plan->oNout[s] = 0; } } -#ifdef GMX_FFT_FFTW3 +#if GMX_FFT_FFTW3 FFTW_LOCK; #ifdef FFT5D_MPI_TRANSPOS for (s = 0; s < 2; s++) diff --git a/src/gromacs/fft/fft5d.h b/src/gromacs/fft/fft5d.h index ba6753d473..ceb87ddc89 100644 --- a/src/gromacs/fft/fft5d.h +++ b/src/gromacs/fft/fft5d.h @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2009,2010,2012,2013,2014, by the GROMACS development team, led by + * Copyright (c) 2009,2010,2012,2013,2014,2015, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -53,7 +53,7 @@ double MPI_Wtime(); #endif /*currently only special optimization for FFTE*/ -#ifdef GMX_FFT_FFTW3 +#if GMX_FFT_FFTW3 #include #endif @@ -93,7 +93,7 @@ struct fft5d_plan_t { t_complex *lin; t_complex *lout, *lout2, *lout3; gmx_fft_t* p1d[3]; /*1D plans*/ -#ifdef GMX_FFT_FFTW3 +#if GMX_FFT_FFTW3 FFTW(plan) p2d; /*2D plan: used for 1D decomposition if FFT supports transposed output*/ FFTW(plan) p3d; /*3D plan: used for 0D decomposition if FFT supports transposed output*/ FFTW(plan) mpip[2]; diff --git a/src/gromacs/fft/fft_fftw3.cpp b/src/gromacs/fft/fft_fftw3.cpp index 2c1f0b80db..891a7ee2d9 100644 --- a/src/gromacs/fft/fft_fftw3.cpp +++ b/src/gromacs/fft/fft_fftw3.cpp @@ -114,7 +114,7 @@ gmx_fft_init_many_1d(gmx_fft_t * pfft, int i, j, k; int fftw_flags; -#ifdef GMX_DISABLE_FFTW_MEASURE +#if GMX_DISABLE_FFTW_MEASURE flags |= GMX_FFT_FLAG_CONSERVATIVE; #endif @@ -231,7 +231,7 @@ gmx_fft_init_many_1d_real(gmx_fft_t * pfft, int i, j, k; int fftw_flags; -#ifdef GMX_DISABLE_FFTW_MEASURE +#if GMX_DISABLE_FFTW_MEASURE flags |= GMX_FFT_FLAG_CONSERVATIVE; #endif @@ -342,7 +342,7 @@ gmx_fft_init_2d_real(gmx_fft_t * pfft, int i, j, k; int fftw_flags; -#ifdef GMX_DISABLE_FFTW_MEASURE +#if GMX_DISABLE_FFTW_MEASURE flags |= GMX_FFT_FLAG_CONSERVATIVE; #endif -- 2.22.0