44 int mult(
const std::string&);
49 return mult(
"test_Mult_Clover.yaml");
55 return mult(
"test_Mult_CloverGeneral.yaml");
61 return mult(
"test_Mult_Clover_Isochemical.yaml");
81 return mult(
"test_Mult_WilsonGeneral.yaml");
87 return mult(
"test_Mult_Wilson_Isochemical.yaml");
98 #ifdef USE_TESTMANAGER_AUTOREGISTER
100 #if defined(USE_GROUP_SU2)
108 #if defined(USE_IMP_BGQ)
112 "Mult.CloverGeneral",
118 "Mult.Clover_Isochemical",
134 #if defined(USE_IMP_BGQ)
138 "Mult.WilsonGeneral",
144 "Mult.Wilson_Isochemical",
158 int mult(
const std::string& filename_input)
175 const string str_gconf_status = params_test.
get_string(
"gauge_config_status");
176 const string str_gconf_read = params_test.
get_string(
"gauge_config_type_input");
177 const string readfile = params_test.
get_string(
"config_filename_input");
178 const string str_rand_type = params_test.
get_string(
"random_number_type");
179 const unsigned long seed = params_test.
get_unsigned_long(
"seed_for_random_number");
180 const int Nmult = params_test.
get_int(
"number_of_mult");
181 const string str_vlevel = params_test.
get_string(
"verbose_level");
183 const bool do_check = params_test.
is_set(
"expected_result");
184 const double expected_result = do_check ? params_test.
get_double(
"expected_result") : 0.0;
185 const double tolerance = params_test.
get_double(
"tolerance");
187 const string str_fopr_type = params_fopr.
get_string(
"fermion_type");
188 const string str_gmset_type = params_fopr.
get_string(
"gamma_matrix_type");
193 vout.
general(vl,
" gconf_status = %s\n", str_gconf_status.c_str());
194 vout.
general(vl,
" gconf_read = %s\n", str_gconf_read.c_str());
195 vout.
general(vl,
" readfile = %s\n", readfile.c_str());
196 vout.
general(vl,
" rand_type = %s\n", str_rand_type.c_str());
199 vout.
general(vl,
" vlevel = %s\n", str_vlevel.c_str());
200 vout.
general(vl,
" gmset_type = %s\n", str_gmset_type.c_str());
218 if (str_gconf_status ==
"Continue") {
220 }
else if (str_gconf_status ==
"Cold_start") {
222 }
else if (str_gconf_status ==
"Hot_start") {
225 vout.
crucial(vl,
"Error at %s: unsupported gconf status \"%s\"\n",
test_name.c_str(), str_gconf_status.c_str());
256 for (
int i = 0; i < Nmult; ++i) {
272 double result_single = 0.0;
275 result_single = y.
norm();
278 vout.
crucial(
"%s: result(multithread) not equal to result(single thread)\n",
test_name.c_str());
288 double gflo_mult = fopr->
flop_count() / 1.0e+9;
289 double gflops_mult = gflo_mult * Nmult / (elapse_sec * NPE * Nthread);
299 int verify_test =
Test::verify(result, expected_result, tolerance);
301 if ((thread_test == 0) && (verify_test == 0)) {
307 vout.
detailed(vl,
"check skipped: expected_result not set.\n\n");
void detailed(const char *format,...)
void set(const int jin, const int site, const int jex, double v)
double elapsed_sec() const
void general(const char *format,...)
virtual void set_config(Field *)=0
setting pointer to the gauge configuration.
int mult_Wilson_Isochemical()
int get_int(const string &key) const
Wilson-type fermion field.
const std::string test_name
Parameters lookup(const string &key) const
static bool RegisterTest(const std::string &key, const Test_function func)
static bool initialize(const std::string &rng_type, unsigned long seed)
void read(Field_G *U, const string &filename=string())
unsigned long get_unsigned_long(const string &key) const
double get_double(const string &key) const
virtual double flop_count()
returns the flops per site.
virtual void set_parameters(const Parameters &)=0
static int get_num_threads_available()
returns number of threads (works outside of parallel region).
int mult_Clover_Isochemical()
int non_NULL(const std::string v)
bool is_set(const string &key) const
void crucial(const char *format,...)
static void read(const std::string ¶ms_file, Parameters ¶ms)
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...
GaugeConfig class for file I/O of gauge configuration.
string get_string(const string &key) const
int mult(const std::string &)
static VerboseLevel set_verbose_level(const std::string &str)