33 namespace Test_Gauge {
34 const std::string
test_name =
"Gauge.Shift";
38 const std::string filename_input =
"test_Gauge_lex.yaml";
44 #ifdef USE_TESTMANAGER_AUTOREGISTER
46 #if defined(USE_GROUP_SU2)
68 const string str_gconf_status = params_test.
get_string(
"gauge_config_status");
69 const string str_gconf_read = params_test.
get_string(
"gauge_config_type_input");
70 const string readfile = params_test.
get_string(
"config_filename_input");
71 const string str_rand_type = params_test.
get_string(
"random_number_type");
72 const unsigned long seed = params_test.
get_unsigned_long(
"seed_for_random_number");
73 const string str_vlevel = params_test.
get_string(
"verbose_level");
75 const bool do_check = params_test.
is_set(
"expected_result");
76 const double expected_result = do_check ? params_test.
get_double(
"expected_result") : 0.0;
81 vout.
general(vl,
" gconf_status = %s\n", str_gconf_status.c_str());
82 vout.
general(vl,
" gconf_read = %s\n", str_gconf_read.c_str());
83 vout.
general(vl,
" readfile = %s\n", readfile.c_str());
84 vout.
general(vl,
" rand_type = %s\n", str_rand_type.c_str());
86 vout.
general(vl,
" vlevel = %s\n", str_vlevel.c_str());
105 if (str_gconf_status ==
"Continue") {
107 }
else if (str_gconf_status ==
"Cold_start") {
109 }
else if (str_gconf_status ==
"Hot_start") {
112 vout.
crucial(vl,
"Error at %s: unsupported gconf status \"%s\"\n",
test_name.c_str(), str_gconf_status.c_str());
138 const int t_global = Lt - 1;
139 const int node_t = t_global / Nt;
140 const int it_shift = t_global - ipe_t * Nt;
142 const int x_global = 1;
143 const int node_x = x_global / Nx;
144 const int ix_shift = x_global - ipe_x * Nx;
151 vout.
general(vl,
"U(before backward) = %.8f\n", U->
cmp(17, index->
site(0, 0, 0, 0), 2));
153 if ( (ipe_x == 0) && (ipe_y == 0) && (ipe_z == 0) ) {
154 if (ipe_t == node_t) {
163 vout.
general(vl,
"U(before forward) = %.8f\n", U->
cmp(17, index->
site(0, 0, 0, 0), 3));
165 if ( (ipe_y == 0) && (ipe_z == 0) && (ipe_t == 0) ) {
166 if (ipe_x == node_x) {
191 vout.
detailed(vl,
"check skipped: expected_result not set.\n\n");
void detailed(const char *format,...)
int site(const int &x, const int &y, const int &z, const int &t) const
void general(const char *format,...)
double plaquette(const Field_G &)
calculates plaquette value.
double cmp(const int jin, const int site, const int jex) const
static int ipe(const int dir)
logical coordinate of current proc.
Parameters lookup(const string &key) const
static bool RegisterTest(const std::string &key, const Test_function func)
const std::string test_name
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
void backward(Field &, const Field &, const int mu)
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)
static int sync()
synchronize within small world.
Methods to shift a field in the lexical site index.
static int nodeid()
alternative name for self().
GaugeConfig class for file I/O of gauge configuration.
string get_string(const string &key) const
void report(const Bridge::VerboseLevel vl=Bridge::GENERAL)
static VerboseLevel set_verbose_level(const std::string &str)
void forward(Field &, const Field &, const int mu)