Commit f3cb1ca1 authored by Cyrille Bonamy's avatar Cyrille Bonamy
Browse files

debug + clean + dev + inlining of src_cpp

parent 0bf32e608b6d
SINGLE_PREC:=no
OMP:=no
CUDA:=no
PFFT:=no
P3DFFT:=no
PFFT:=yes
P3DFFT:=yes
LD:=mpic++
CC:=mpic++
......@@ -131,6 +131,6 @@ test:
testmpi:
mpirun -np 4 ./test_bench.out --N0=64 --N1=32 --N2=16
mpirun -np 4 ./test_bench.out --N0=16 --N1=16 --N2=4
mpirun -np 4 ./test_bench.out --N0=4 --N1=16 --N2=16
mpirun -np 4 ./test_bench.out --N0=16 --N1=4 --N2=16
mpirun -np 4 ./test_bench.out --N0=128 --N1=128 --N2=128
mpirun -np 4 ./test_bench.out --N0=256 --N1=256 --N2=256
mpirun -np 4 ./test_bench.out --N0=512 --N1=512 --N2=512
......@@ -15,7 +15,6 @@ class FFT3DMPIWithFFTW1D: public BaseFFT3DMPI
void ifft(mycomplex *fieldK, myreal *fieldX);
myreal compute_energy_from_K(mycomplex* fieldK);
// myreal compute_mean_from_K(mycomplex* fieldK);
myreal sum_wavenumbers_double(myreal* fieldK);
void sum_wavenumbers_complex(mycomplex* fieldK, mycomplex* result);
......
......@@ -403,3 +403,15 @@ void FFT3DMPIWithPFFT::get_seq_indices_first_K(int *i0, int *i1)
*i0 = local_K0_start;
*i1 = local_K1_start;
}
bool FFT3DMPIWithPFFT::are_parameters_bad()
{
if ((N0/nb_proc == 1) || (N2/nb_proc == 1) || (N1/nb_proc == 1))
{
if (rank == 0)
cout << "bad parameters N0 or N1 or N2" << endl;
return 1;
}
return 0;
}
......@@ -9,6 +9,7 @@ class FFT3DMPIWithPFFT: public BaseFFT3DMPI
~FFT3DMPIWithPFFT();
void destroy();
bool are_parameters_bad();
virtual const char* get_classname();
void fft(myreal *fieldX, mycomplex *fieldK);
......
......@@ -268,10 +268,3 @@ int BaseFFT::get_local_size_K()
cout << "BaseFFT::get_local_size_K" << endl;
return nKxloc * nKy;
}
myreal BaseFFT::square_abs(mycomplex cm)
{
// return pow(abs(cm), 2);
return real(cm) * real(cm) + imag(cm) * imag(cm);
}
......@@ -33,6 +33,11 @@ using namespace std;
typedef fftw_plan myfftw_plan;
#endif
inline myreal square_abs(mycomplex cm)
{
return real(cm) * real(cm) + imag(cm) * imag(cm);
}
class BaseFFT
{
public:
......@@ -63,7 +68,6 @@ class BaseFFT
virtual void alloc_array_X(myreal* &fieldX);
myreal square_abs(mycomplex cm);
int rank, nb_proc;
......
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