40 const std::string filename_output =
"stdout";
42 class Parameters_Test_Mult :
public Parameters {
44 Parameters_Test_Mult()
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.yaml");
71 return mult(
"test_Mult_Clover_General.yaml");
77 return mult(
"test_Mult_Clover_Isochemical.yaml");
96 return mult(
"test_Mult_Wilson_General.yaml");
102 return mult(
"test_Mult_Wilson_Isochemical.yaml");
113 #ifdef USE_TESTMANAGER_AUTOREGISTER
115 #if defined(USE_GROUP_SU2)
123 #if defined(USE_IMP_BGQ)
127 "Mult.Clover_General",
133 "Mult.Clover_Isochemical",
150 #if defined(USE_IMP_BGQ)
154 "Mult.Wilson_General",
160 "Mult.Wilson_Isochemical",
174 int mult(
const std::string& filename_input)
195 const string str_gconf_status = params_test->
get_string(
"gauge_config_status");
196 const string str_gconf_read = params_test->
get_string(
"gauge_config_type_input");
197 const string readfile = params_test->
get_string(
"config_filename_input");
198 const int Nmult = params_test->
get_int(
"number_of_mult");
199 const string str_vlevel = params_test->
get_string(
"verbose_level");
201 const bool do_check = params_test->
is_set(
"expected_result");
202 const double expected_result = do_check ? params_test->
get_double(
"expected_result") : 0.0;
204 const string str_fopr_type = params_fopr->
get_string(
"fermion_type");
205 const string str_gmset_type = params_fopr->
get_string(
"gamma_matrix_type");
210 vout.
general(vl,
" gconf_status = %s\n", str_gconf_status.c_str());
211 vout.
general(vl,
" gconf_read = %s\n", str_gconf_read.c_str());
212 vout.
general(vl,
" readfile = %s\n", readfile.c_str());
214 vout.
general(vl,
" vlevel = %s\n", str_vlevel.c_str());
215 vout.
general(vl,
" gmset_type = %s\n", str_gmset_type.c_str());
222 vout.
crucial(vl,
"%s: Input parameters have not been set.\n", test_name.c_str());
231 if (str_gconf_status ==
"Continue") {
233 }
else if (str_gconf_status ==
"Cold_start") {
235 }
else if (str_gconf_status ==
"Hot_start") {
236 int i_seed_noise = 1234567;
240 vout.
crucial(vl,
"%s: unsupported gconf status \"%s\".\n", test_name.c_str(), str_gconf_status.c_str());
271 for (
int i = 0; i < Nmult; ++i) {
283 double result_single = y.
norm();
285 if (
Test::verify(abs(result - result_single), 0.0, epsilon)) {
286 vout.
crucial(
"%s: result(multithread) not equal to result(single thread)\n", test_name.c_str());
287 vout.
crucial(
"%s: result(multithread) = %22.14e\n", test_name.c_str(), result);
288 vout.
crucial(
"%s: result(single thread) = %22.14e\n", test_name.c_str(), result_single);
302 double gflo_mult = fopr->
flop_count() / 1.0e+9;
303 double gflops_mult = gflo_mult * Nmult / (elapse_sec * NPE * Nthread);
305 vout.
general(vl,
"%s: %12.4e GFlops / core\n", test_name.c_str(), gflops_mult);
312 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)
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
static Parameters * New(const std::string &realm)
void read_file(Field *U, const string &filename)
int mult_Wilson_General()
void set_random(RandomNumbers *rand)
Wilson-type fermion field.
const std::string test_name
static bool RegisterTest(const std::string &key, const Test_function func)
bool is_set(const string &) 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)
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
int mult(const std::string &)
static VerboseLevel set_verbose_level(const std::string &str)
int mult_Clover_General()