10 template<
typename AFIELD>
12 =
"Action_F_Ratio_lex_alt";
15 template<
typename AFIELD>
23 template<
typename AFIELD>
31 template<
typename AFIELD>
35 set_parameter_verboselevel(
vl);
40 template<
typename AFIELD>
48 template<
typename AFIELD>
53 m_fopr_prec->set_config(U);
54 m_fopr_prec_force->set_config(U);
56 m_fopr->set_config(U);
57 m_fopr_force->set_config(U);
62 template<
typename AFIELD>
68 const int NinF = m_fopr_prec->field_nin();
69 const int NvolF = m_fopr_prec->field_nvol();
70 const int NexF = m_fopr_prec->field_nex();
73 assert(NvolF == Nvol);
74 m_psf.reset(NinF, NvolF, NexF);
80 vout.
general(m_vl,
" %s: %s\n", class_name.c_str(), m_label.c_str());
82 Field xi(NinF, NvolF, NexF);
85 AFIELD xiA(NinF, NvolF, NexF);
87 Index_lex_alt<real_t, AFIELD::IMPL> index_alt;
91 if (m_fopr->needs_convert()) {
92 m_fopr->convert(xiA, xi);
98 m_fopr_prec->set_config(m_U);
99 m_fopr->set_config(m_U);
101 AFIELD v2(NinF, NvolF, NexF);
102 m_fopr->set_mode(
"H");
103 m_fopr->mult_dag(v2, xiA);
105 AFIELD v1(NinF, NvolF, NexF);
106 m_fopr_prec->set_mode(
"H");
107 m_fopr_prec->mult_dag(v1, v2);
111 m_fprop_H_prec->set_config(m_U);
112 m_fprop_H_prec->set_mode(
"DdagD");
113 m_fprop_H_prec->invert(m_psf, v1, Nconv, diff);
114 vout.
general(m_vl,
" Fprop_H_prec: %6d %18.15e\n", Nconv, diff);
116 const double xi2 = xi.
norm();
117 const double H_psf = xi2 * xi2;
123 vout.
general(m_vl,
" H_F/dof = %18.8f\n", H_psf / size_psf);
124 vout.
general(m_vl,
" elapsed time: %12.6f [sec]\n", elapsed_time);
131 template<
typename AFIELD>
137 const int NinF = m_fopr_prec->field_nin();
138 const int NvolF = m_fopr_prec->field_nvol();
139 const int NexF = m_fopr_prec->field_nex();
146 vout.
general(m_vl,
" %s: %s\n", class_name.c_str(), m_label.c_str());
148 m_fopr_prec->set_config(m_U);
149 m_fopr->set_config(m_U);
151 AFIELD v1(NinF, NvolF, NexF);
152 m_fopr_prec->set_mode(
"H");
153 m_fopr_prec->mult(v1, m_psf);
155 AFIELD v2(NinF, NvolF, NexF);
159 m_fprop_H->set_config(m_U);
160 m_fprop_H->reset_performance();
161 m_fprop_H->set_mode(
"DdagD");
162 m_fprop_H->invert(v2, v1, Nconv, diff);
164 double flop_count, elapsed_time2, gflops;
165 m_fprop_H->get_performance(flop_count, elapsed_time2);
166 if (elapsed_time2 > 0.0) {
167 gflops = (flop_count / elapsed_time2) * 1.0e-9;
172 vout.
general(m_vl,
" Fprop_H: %6d %12.4e %12.4e [GFlops]\n",
173 Nconv, diff, gflops);
175 double H_psf =
dot(v1, v2);
181 vout.
general(m_vl,
" H_F/dof = %18.8f\n", H_psf / size_psf);
182 vout.
general(m_vl,
" elapsed time: %12.6f [sec]\n", elapsed_time);
189 template<
typename AFIELD>
192 const int Nin = m_U->nin();
193 const int Nvol = m_U->nvol();
194 const int Nex = m_U->nex();
198 assert(force.
nin() == Nin);
199 assert(force.
nvol() == Nvol);
200 assert(force.
nex() == Nex);
202 AFIELD force1(Nin, Nvol, Nex);
204 int NinF = m_fopr_prec->field_nin();
205 int NvolF = m_fopr_prec->field_nvol();
206 int NexF = m_fopr_prec->field_nex();
212 vout.
general(m_vl,
" %s: %s\n", class_name.c_str(), m_label.c_str());
214 m_fopr_prec->set_config(m_U);
215 m_fopr->set_config(m_U);
216 m_fopr_prec_force->set_config(m_U);
217 m_fopr_force->set_config(m_U);
219 AFIELD v1(NinF, NvolF, NexF);
220 m_fopr_prec->set_mode(
"H");
223 m_fopr_prec->mult(v1, m_psf);
226 AFIELD v2(NinF, NvolF, NexF);
229 m_fprop_MD->set_config(m_U);
230 m_fprop_MD->set_mode(
"DdagD");
231 m_fprop_MD->invert(v2, v1, Nconv, diff);
232 vout.
general(m_vl,
" Fprop_MD: %6d %18.15e\n", Nconv, diff);
234 m_fopr_force->force_core(force1, v2);
236 AFIELD force_tmp(Nin, Nvol, Nex);
237 m_fopr_prec_force->set_mode(
"H");
238 m_fopr_prec_force->force_core1(force_tmp, v2, m_psf);
242 axpy(force1, -1.0, force_tmp);
245 m_fopr_prec_force->set_mode(
"Hdag");
246 m_fopr_prec_force->force_core1(force_tmp, m_psf, v2);
250 axpy(force1, -1.0, force_tmp);
253 Index_lex_alt<real_t, AFIELD::IMPL> index_lex;
259 double Fave, Fmax, Fdev;
260 force.
stat(Fave, Fmax, Fdev);
265 vout.
general(m_vl,
" Fave = %12.6f Fmax = %12.6f Fdev = %12.6f\n",
267 vout.
general(m_vl,
" elapsed time: %12.6f [sec]\n", elapsed_time);