Go to the documentation of this file.
24 template<
typename AFIELD>
28 template<
typename AFIELD>
33 vout.
general(m_vl,
"%s: being setup (without link smearing).\n",
40 string fopr_type = params_fopr.
get_string(
"fermion_type");
49 set_parameters(params_solver);
52 vout.
general(m_vl,
"%s: setup finished.\n", class_name.c_str());
56 template<
typename AFIELD>
60 int Niter, Nrestart, Niter_s;
65 err += params_solver.
fetch_int(
"maximum_number_of_iteration_single_prec", Niter_s);
66 err += params_solver.
fetch_int(
"maximum_number_of_iteration", Niter);
67 err += params_solver.
fetch_int(
"maximum_number_of_restart", Nrestart);
68 err += params_solver.
fetch_double(
"convergence_criterion_squared", Stop_cond);
70 vout.
crucial(m_vl,
"Error at %s: input parameter not found.\n",
80 m_tol_d = sqrt(Stop_cond);
85 vout.
general(m_vl,
"%s: negative convergence criterion is given, run as a fixed iteration sovler\n", class_name.c_str());
89 m_Stop_cond = Stop_cond;
90 std::string prec =
"double";
91 if (
sizeof(
real_t) == 4) prec =
"float";
94 vout.
general(m_vl,
" Precision: %s\n", prec.c_str());
139 template<
typename AFIELD>
143 if (m_kernel != 0)
delete m_kernel;
148 template<
typename AFIELD>
151 m_fopr->set_config(U);
156 template<
typename AFIELD>
158 int& nconv,
double& diff)
160 vout.
paranoiac(m_vl,
"%s: invert is called.\n", class_name.c_str());
164 invert_D(xq, b, nconv, diff);
173 class_name.c_str(), m_mode.c_str());
180 template<
typename AFIELD>
182 int& nconv,
double& diff)
186 if (
sizeof(
real_t) != 8) {
187 vout.
crucial(m_vl,
"%s: single prec is not supported\n", class_name.c_str());
190 int nin = m_fopr->field_nin();
191 int nvol = m_fopr->field_nvol();
192 int nex = m_fopr->field_nex();
194 vout.
paranoiac(m_vl,
"nin = %d nvol = %d nex = %d\n", nin, nvol, nex);
196 AFIELD abq(nin, nvol, nex);
197 AFIELD axq(nin, nvol, nex);
203 m_fopr->convert(abq, b);
212 int dd_maxiter_s = m_Niter_s;
213 int dd_maxiter = m_Niter_d;
214 double tol_s = m_tol_s;
215 double tol = m_tol_d;
225 bicgstab_dd_mix_((scd_t *)axq.
ptr(0), (scd_t *)abq.
ptr(0), &tol, &iter, &dd_maxiter, &tol_s, &dd_maxiter_s, &nsap, &nm);
233 m_fopr->reverse(xq, axq);
238 m_elapsed_time += m_timer.elapsed_sec();
242 template<
typename AFIELD>
245 int& nconv,
double& diff)
278 template<
typename AFIELD>
286 template<
typename AFIELD>
290 m_elapsed_time = 0.0;
295 template<
typename AFIELD>
297 double& elapsed_time)
300 elapsed_time = m_elapsed_time;
305 template<
typename AFIELD>
310 double gflops = flops * 1.0e-9;
313 vout.
general(m_vl,
"%s: solver performance:\n", class_name.c_str());
314 vout.
general(m_vl,
" Elapsed time = %14.6f sec\n", m_elapsed_time);
315 vout.
general(m_vl,
" Flop(total) = %18.0f\n", m_flop_count);
316 vout.
general(m_vl,
" Performance = %11.3f GFlops\n", gflops);
321 template<
typename AFIELD>
323 const std::string mode,
377 =
"Fprop_alt_QWS<Afield<double,QXS> >";
void mult_performance(const std::string mode, const int Nrepeat)
void set(const int jin, const int site, const int jex, double v)
void init(const Parameters ¶ms_fopr, const Parameters ¶ms_solver)
void report_performance()
Base class of fermion operator family.
void invert_DdagD(Field &, const Field &, int &, double &)
void invert_D(Field &, const Field &, int &, double &)
void paranoiac(const char *format,...)
void set_parameters(const Parameters ¶ms_solver)
void invert(Field &, const Field &, int &, double &)
invert accordingly to the mode. [22 Sep 2018 H.Matsufuru]
const double * ptr(const int jin, const int site, const int jex) const
int fetch_double(const string &key, double &value) const
string get_string(const string &key) const
void crucial(const char *format,...)
void get_performance(double &flop_count, double &elapsed_time)
Container of Field-type object.
int fetch_int(const string &key, int &value) const
void general(const char *format,...)