15 template<
typename AFIELD>
17 =
"Fprop_alt_Standard_SAP";
20 template<
typename AFIELD>
26 vout.
general(m_vl,
"%s: being setup (without link smearing).\n",
31 string fopr_type = params_fopr.
get_string(
"fermion_type");
32 vout.
general(
"%s: fopr_type: %s\n", class_name.c_str(), fopr_type.c_str());
33 string fopr_type_dd = fopr_type +
"_dd";
39 if (m_afopr ==
nullptr) {
40 vout.
crucial(m_vl,
"%s: failed to create AFopr_dd with fermion type %s.\n", class_name.c_str(), fopr_type.c_str());
43 init_common(params_fopr, params_solver);
45 vout.
general(m_vl,
"%s: setup finished.\n", class_name.c_str());
50 template<
typename AFIELD>
57 vout.
general(m_vl,
"%s: being setup (with link smearing).\n",
82 template<
typename AFIELD>
88 m_fine_lattice.resize(Ndim);
89 m_coarse_lattice.resize(Ndim);
96 std::vector<int> block_size;
100 vout.
crucial(m_vl,
"Error at %s: block_size not found.\n",
105 for (
int mu = 0; mu < Ndim; ++mu) {
106 m_coarse_lattice[mu] = m_fine_lattice[mu] / block_size[mu];
109 for (
int mu = 0; mu < Ndim; ++mu) {
111 " coarse_lattice[%d] = %3d\n",
112 mu, block_size[mu], mu, m_coarse_lattice[mu]);
124 err += params_solver.
fetch_int(
"maximum_number_of_iteration",
126 err += params_solver.
fetch_double(
"convergence_criterion_squared",
129 vout.
crucial(m_vl,
"Error at %s: input parameter not found.\n",
134 m_asolver->set_parameters(niter,
real_t(stop_cond));
141 template<
typename AFIELD>
146 delete m_block_index;
147 if (m_kernel != 0)
delete m_kernel;
152 template<
typename AFIELD>
155 m_afopr->set_config(U);
160 template<
typename AFIELD>
163 int& nconv,
double& diff)
165 vout.
paranoiac(m_vl,
"%s: invert is called.\n", class_name.c_str());
172 invert_D(xq, b, nconv, diff);
173 }
else if (m_mode ==
"DdagD") {
174 invert_DdagD(xq, b, nconv, diff);
177 class_name.c_str(), m_mode.c_str());
182 m_elapsed_time += m_timer.elapsed_sec();
188 template<
typename AFIELD>
191 int& nconv,
double& diff)
193 int Nin = m_afopr->field_nin();
194 int Nvol = m_afopr->field_nvol();
195 int Nex = m_afopr->field_nex();
198 AFIELD ab(Nin, Nvol, Nex);
201 AFIELD ax(Nin, Nvol, Nex);
209 if (m_afopr->needs_convert()) {
211 m_afopr->convert(ab, b);
223 invert_D(ax, ab, nconv, diff);
227 if (m_afopr->needs_convert()) {
229 m_afopr->reverse(xq, ax);
239 template<
typename AFIELD>
242 int& nconv,
double& diff)
244 vout.
crucial(m_vl,
"%s: invert_DdagD is not available.\n",
251 template<
typename AFIELD>
254 int& nconv,
double& diff)
256 vout.
paranoiac(m_vl,
"%s: invert is called.\n", class_name.c_str());
260 invert_D(xq, b, nconv, diff);
261 }
else if (m_mode ==
"DdagD") {
262 invert_DdagD(xq, b, nconv, diff);
265 class_name.c_str(), m_mode.c_str());
272 template<
typename AFIELD>
275 int& nconv,
double& diff)
277 int Nin = m_afopr->field_nin();
278 int Nvol = m_afopr->field_nvol();
279 int Nex = m_afopr->field_nex();
281 m_afopr->set_mode(m_mode);
287 m_asolver->solve(ax, ab, nconv, diff1);
290 AFIELD ay(Nin, Nvol, Nex);
294 m_afopr->mult(ay, ax);
303 diff = double(diff2);
308 vout.
general(
" solver residue squared = %22.15e\n", diff1);
309 vout.
general(
" real residue squared = %22.15e\n", diff2);
315 template<
typename AFIELD>
318 int& nconv,
double& diff)
320 vout.
crucial(m_vl,
"%s: invert_DdagD is not available.\n",
327 template<
typename AFIELD>
330 return m_asolver->flop_count();
335 template<
typename AFIELD>
339 m_elapsed_time = 0.0;
344 template<
typename AFIELD>
347 double flops = m_flop_count / m_elapsed_time;
348 double gflops = flops * 1.0e-9;
351 vout.
general(m_vl,
"%s: solver performance:\n", class_name.c_str());
363 template<
typename AFIELD>
365 const std::string mode,