Commit 4d7450cc authored by Pierre Augier's avatar Pierre Augier
Browse files

Start to fix pfft and p3dfft

parent 1257dea88a79
[fftw3]
use = mkl
dir =
include_dir = /opt/software/common/intel/compilers_and_libraries_2017.2.174/linux/mkl/include/fftw
library_dir = /opt/software/common/intel/compilers_and_libraries_2017.2.174/linux/mkl/lib/intel64
[fftw3_mpi]
use = False
dir =
include_dir =
library_dir =
[cufft]
use = False
dir =
include_dir =
library_dir =
[pfft]
use = False
dir =
include_dir =
library_dir =
[p3dfft]
use = False
dir =
include_dir =
library_dir =
......@@ -231,19 +231,12 @@ myreal FFT3DMPIWithP3DFFT::sum_wavenumbers_double(myreal* fieldK)
}
#ifdef SINGLE_PREC
void FFT3DMPIWithP3DFFT::sum_wavenumbers_complex(
fftwf_complex* fieldK, fftwf_complex* result)
mycomplex* fieldK, mycomplex* result)
{
fftwf_complex sum_tmp = 0;
fftwf_complex sum_loc, sum;
#else
void FFT3DMPIWithP3DFFT::sum_wavenumbers_complex(
fftw_complex* fieldK, fftw_complex* result)
{
fftw_complex sum_tmp = 0;
fftw_complex sum_loc, sum;
#endif
mycomplex sum_tmp = 0;
mycomplex sum_loc, sum;
int i0, i1, i2;
i0 = 0;
......@@ -296,11 +289,8 @@ myreal FFT3DMPIWithP3DFFT::compute_mean_from_X(myreal* fieldX)
return (myreal) mean / coef_norm;
}
#ifdef SINGLE_PREC
myreal FFT3DMPIWithP3DFFT::compute_mean_from_K(fftwf_complex* fieldK)
#else
myreal FFT3DMPIWithP3DFFT::compute_mean_from_K(fftw_complex* fieldK)
#endif
myreal FFT3DMPIWithP3DFFT::compute_mean_from_K(mycomplex* fieldK)
{
double mean, local_mean;
......@@ -316,17 +306,17 @@ myreal FFT3DMPIWithP3DFFT::compute_mean_from_K(fftw_complex* fieldK)
void FFT3DMPIWithP3DFFT::fft(myreal *fieldX, mycomplex *fieldK)
{
int i0, i1, i2;
int i0;
unsigned char op_f[]="fft";
//cout << "FFT3DMPIWithP3DFFT::fft" << endl;
myreal coef_normdiv = 1./coef_norm;
memcpy(arrayX, fieldX, nX0loc*nX1loc*nX2loc*sizeof(myreal));
Cp3dfft_ftran_r2c(arrayX, reinterpret_cast<mycomplex_fftw*>(arrayK), op_f);
Cp3dfft_ftran_r2c(arrayX, arrayK, op_f);
memcpy(fieldK, arrayK, nK0loc*nK1loc*nK2loc*sizeof(mycomplex));
for (i0=0; i0<nK0loc*nK1loc*nK2loc; i0++)
fieldK[i0] *= coef_normdiv;
fieldK[i0] *= coef_normdiv;
}
void FFT3DMPIWithP3DFFT::ifft(mycomplex *fieldK, myreal *fieldX)
......@@ -335,7 +325,7 @@ void FFT3DMPIWithP3DFFT::ifft(mycomplex *fieldK, myreal *fieldX)
//cout << "FFT3DMPIWithP3DFFT::ifft" << endl;
memcpy(arrayK, fieldK, nK0loc*nK1loc*nK2loc*sizeof(mycomplex));
Cp3dfft_btran_c2r(reinterpret_cast<mycomplex_fftw*>(arrayK), arrayX, op_b);
Cp3dfft_btran_c2r(arrayK, arrayX, op_b);
memcpy(fieldX, arrayX, nX0loc*nX1loc*nX2loc*sizeof(myreal));
}
......
......@@ -308,19 +308,12 @@ myreal FFT3DMPIWithPFFT::sum_wavenumbers_double(myreal* fieldK)
}
#ifdef SINGLE_PREC
void FFT3DMPIWithPFFT::sum_wavenumbers_complex(
pfftf_complex* fieldK, pfftf_complex* result)
{
pfftf_complex sum_tmp = 0;
pfftf_complex sum_loc, sum;
#else
void FFT3DMPIWithPFFT::sum_wavenumbers_complex(
pfft_complex* fieldK, pfft_complex* result)
mycomplex* fieldK, mycomplex* result)
{
pfft_complex sum_tmp = 0;
pfft_complex sum_loc, sum;
#endif
mycomplex sum_tmp = 0;
mycomplex sum_loc, sum;
int i0, i1, i2;
// modes i1_seq = iKx = 0
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment