40 const std::string filename_output =
"stdout";
42 class Parameters_Test_Mult_eo :
public Parameters {
44 Parameters_Test_Mult_eo()
46 Register_string(
"gauge_config_status",
"NULL");
47 Register_string(
"gauge_config_type_input",
"NULL");
48 Register_string(
"config_filename_input",
"NULL");
50 Register_int(
"number_of_mult", 0);
52 Register_string(
"verbose_level",
"NULL");
54 Register_double(
"expected_result", 0.0);
60 int mult(
const std::string&);
65 return mult(
"test_Mult_Clover_eo.yaml");
71 return mult(
"test_Mult_Wilson_eo.yaml");
75 #ifdef USE_TESTMANAGER_AUTOREGISTER
77 #if defined(USE_GROUP_SU2)
94 int mult(
const std::string& filename_input)
115 const string str_gconf_status = params_test->
get_string(
"gauge_config_status");
116 const string str_gconf_read = params_test->
get_string(
"gauge_config_type_input");
117 const string readfile = params_test->
get_string(
"config_filename_input");
118 const int Nmult = params_test->
get_int(
"number_of_mult");
119 const string str_vlevel = params_test->
get_string(
"verbose_level");
121 const bool do_check = params_test->
is_set(
"expected_result");
122 const double expected_result = do_check ? params_test->
get_double(
"expected_result") : 0.0;
124 const string str_fopr_type = params_fopr->
get_string(
"fermion_type");
125 const string str_gmset_type = params_fopr->
get_string(
"gamma_matrix_type");
130 vout.
general(vl,
" gconf_status = %s\n", str_gconf_status.c_str());
131 vout.
general(vl,
" gconf_read = %s\n", str_gconf_read.c_str());
132 vout.
general(vl,
" readfile = %s\n", readfile.c_str());
134 vout.
general(vl,
" vlevel = %s\n", str_vlevel.c_str());
135 vout.
general(vl,
" gmset_type = %s\n", str_gmset_type.c_str());
142 vout.
crucial(vl,
"%s: Input parameters have not been set.\n", test_name.c_str());
151 if (str_gconf_status ==
"Continue") {
153 }
else if (str_gconf_status ==
"Cold_start") {
155 }
else if (str_gconf_status ==
"Hot_start") {
156 int i_seed_noise = 1234567;
160 vout.
crucial(vl,
"%s: unsupported gconf status \"%s\".\n", test_name.c_str(), str_gconf_status.c_str());
184 Field be(Nin, Nvol / 2, Nex);
185 Field ye(Nin, Nvol / 2, Nex);
197 for (
int i = 0; i < Nmult; ++i) {
209 double result_single = ye.
norm();
211 if (
Test::verify(abs(result - result_single), 0.0, epsilon)) {
212 vout.
crucial(
"%s: result(multithread) not equal to result(single thread)\n", test_name.c_str());
213 vout.
crucial(
"%s: result(multithread) = %22.14e\n", test_name.c_str(), result);
214 vout.
crucial(
"%s: result(single thread) = %22.14e\n", test_name.c_str(), result_single);
227 double gflo_mult = fopr->
flop_count() / 1.0e+9;
228 double gflops_mult = gflo_mult * Nmult / (elapse_sec * NPE * Nthread);
230 vout.
general(vl,
"%s: %12.4e GFlops / core\n", test_name.c_str(), gflops_mult);
237 vout.
detailed(vl,
"check skipped: expected_result not set.\n\n");
Random number generator base on M-series.
void detailed(const char *format,...)
static double epsilon_criterion()
void set(const int jin, const int site, const int jex, double v)
int mult(const std::string &)
double elapsed_sec() const
void general(const char *format,...)
virtual void set_config(Field *)=0
setting pointer to the gauge configuration.
Container of Field-type object.
int get_int(const string &key) const
static Parameters * New(const std::string &realm)
void read_file(Field *U, const string &filename)
void set_random(RandomNumbers *rand)
Wilson-type fermion field.
static bool RegisterTest(const std::string &key, const Test_function func)
Test of Mult with even-odd preconditioning.
bool is_set(const string &) const
double get_double(const string &key) const
virtual double flop_count()
returns the flops per site.
const std::string test_name
virtual void set_parameters(const Parameters &)=0
static int get_num_threads_available()
returns number of threads (works outside of parallel region).
int non_NULL(const std::string v)
void crucial(const char *format,...)
void Register_Parameters(const string &, Parameters *const)
int verify(const double result, const double expected, double eps)
virtual void mult(Field &, const Field &)=0
multiplies fermion operator to a given field (2nd argument)
virtual void set_mode(std::string mode)
setting the mode of multiplication if necessary. Default implementation here is just to avoid irrelev...
static void read(const std::string ¶ms_file, Parameters *params)
GaugeConfig class for file I/O of gauge configuration.
string get_string(const string &key) const
static VerboseLevel set_verbose_level(const std::string &str)