45 int solver(
const std::string&);
50 return solver(
"test_Solver_Wilson_BiCGStab_Cmplx.yaml");
56 return solver(
"test_Solver_Wilson_BiCGStab_DS_L_Cmplx.yaml");
62 return solver(
"test_Solver_Wilson_BiCGStab_IDS_L_Cmplx.yaml");
68 return solver(
"test_Solver_Wilson_BiCGStab_L_Cmplx.yaml");
74 return solver(
"test_Solver_Wilson_CGNE.yaml");
80 return solver(
"test_Solver_Wilson_CGNR.yaml");
86 return solver(
"test_Solver_Wilson_GMRES_m_Cmplx.yaml");
90 #ifdef USE_TESTMANAGER_AUTOREGISTER
92 #if defined(USE_GROUP_SU2)
96 "Solver.Wilson.BiCGStab_Cmplx",
101 "Solver.Wilson.BiCGStab_DS_L_Cmplx",
106 "Solver.Wilson.BiCGStab_IDS_L_Cmplx",
111 "Solver.Wilson.BiCGStab_L_Cmplx",
116 "Solver.Wilson.CGNE",
121 "Solver.Wilson.CGNR",
126 "Solver.Wilson.GMRES_m_Cmplx",
134 int solver(
const std::string& filename_input)
153 const string str_gconf_status = params_test.
get_string(
"gauge_config_status");
154 const string str_gconf_read = params_test.
get_string(
"gauge_config_type_input");
155 const string readfile = params_test.
get_string(
"config_filename_input");
156 const string str_rand_type = params_test.
get_string(
"random_number_type");
157 const unsigned long seed = params_test.
get_unsigned_long(
"seed_for_random_number");
158 const string str_vlevel = params_test.
get_string(
"verbose_level");
160 const bool do_check = params_test.
is_set(
"expected_result");
161 const double expected_result = do_check ? params_test.
get_double(
"expected_result") : 0.0;
163 const string str_gfix_type = params_gfix.
get_string(
"gauge_fixing_type");
164 const string str_fopr_type = params_fopr.
get_string(
"fermion_type");
165 const string str_solver_type = params_solver.
get_string(
"solver_type");
166 const string str_source_type = params_source.
get_string(
"source_type");
171 vout.
general(
vl,
" gconf_status = %s\n", str_gconf_status.c_str());
172 vout.
general(
vl,
" gconf_read = %s\n", str_gconf_read.c_str());
174 vout.
general(
vl,
" rand_type = %s\n", str_rand_type.c_str());
177 vout.
general(
vl,
" gfix_type = %s\n", str_gfix_type.c_str());
178 vout.
general(
vl,
" solver_type = %s\n", str_solver_type.c_str());
179 vout.
general(
vl,
" source_type = %s\n", str_source_type.c_str());
190 if (str_solver_type ==
"CG") {
201 if (str_gconf_status ==
"Continue") {
203 }
else if (str_gconf_status ==
"Cold_start") {
205 }
else if (str_gconf_status ==
"Hot_start") {
208 vout.
crucial(
vl,
"Error at %s: unsupported gconf status \"%s\"\n",
test_name.c_str(), str_gconf_status.c_str());
216 unique_ptr<GaugeFixing> gfix(GaugeFixing::New(str_gfix_type, params_gfix));
224 unique_ptr<Fopr> fopr(Fopr::New(str_fopr_type, params_fopr));
225 fopr->set_config(&U);
227 unique_ptr<Solver>
solver(Solver::New(str_solver_type, fopr.get(), params_solver));
231 unique_ptr<Source> source(Source::New(str_source_type, params_source));
239 std::vector<Field_F> sq(Nc * Nd);
240 for (
int i_cd = 0; i_cd < Nc * Nd; ++i_cd) {
253 int i_cd = icolor + Nc * ispin;
256 source->
set(b, i_cd);
260 fprop_lex->invert_D(sq[i_cd], b, Nconv, diff);
264 fopr->mult(y, sq[i_cd]);
269 icolor, ispin, Nconv, diff, diff2);
273 const double result = round(Nconv / 10.0);
280 const double gflops_mult = fprop_lex->flop_count() / (elapse_sec * NPE * Nthread);