Separate FFT periodic from FFT OPEN
Summary
We are inconsistent in setting the solvers. For both FFT and FFTOPEN, we are using OPEN solver from IPPL.
else if (this->getStype() == "FFT") {
if constexpr (Dim == 2 || Dim == 3) {
#ifdef OPALX_FIELD_DEBUG
this->dumpScalField("rho");
call_counter_m++;
#endif
std::get<OpenSolver_t<double, 3>>(this->getSolver()).solve();
#ifdef OPALX_FIELD_DEBUG
this->dumpScalField("phi");
this->dumpVectField("ef");
call_counter_m++;
#endif
}
} else if (this->getStype() == "P3M") {
if constexpr (Dim == 3) {
std::get<FFTTruncatedGreenSolver_t<double, 3>>(this->getSolver()).solve();
}
} else if (this->getStype() == "FFTOPEN") {
if constexpr (Dim == 3) {
#ifdef OPALX_FIELD_DEBUG
this->dumpScalField("rho");
call_counter_m++;
#endif
std::get<OpenSolver_t<double, 3>>(this->getSolver()).solve();
#ifdef OPALX_FIELD_DEBUG
this->dumpScalField("phi");
this->dumpVectField("ef");
call_counter_m++;
#endif
}
if (this->getStype() == "FFT") {
initOpenSolver();
} else if (this->getStype() == "FFTOPEN") {
initOpenSolver();
}
where
template <>
void FieldSolver<double,3>::initOpenSolver() {
ippl::ParameterList sp;
sp.add("output_type", OpenSolver_t<double, 3>::SOL_AND_GRAD);
sp.add("use_heffte_defaults", false);
sp.add("use_pencils", true);
sp.add("use_reorder", false);
sp.add("use_gpu_aware", true);
sp.add("comm", ippl::p2p_pl);
sp.add("r2c_direction", 0);
sp.add("algorithm", OpenSolver_t<double, 3>::HOCKNEY);
initSolverWithParams<OpenSolver_t<double, 3>>(sp);
}
I think it makes sense to maintain periodic FFT, and correctly separate FFT (periodic) from FFTOPEN solvers. Periodic FFT was working on GPUs, and maintaining it helps with further development while the FFTOPEN being resolved.