Go to the documentation of this file.
86 #ifdef USE_TESTMANAGER_AUTOREGISTER
88 #if defined(USE_GROUP_SU2)
92 "IO.GaugeConfig.Text",
96 "IO.GaugeConfig.Binary",
101 "IO.GaugeConfig.BinaryParallel",
105 "IO.GaugeConfig.BinaryDistributed",
110 "IO.GaugeConfig.Fortran",
116 "IO.GaugeConfig.ILDG",
121 "IO.GaugeConfig.ILDG_Parallel",
141 const string str_gconf_status = params_test.
get_string(
"gauge_config_status");
142 const string str_gconf_read = params_test.
get_string(
"gauge_config_type_input");
143 const string str_gconf_write = params_test.
get_string(
"gauge_config_type_output");
144 const string readfile = params_test.
get_string(
"config_filename_input");
145 const string testfile = params_test.
get_string(
"config_filename_output");
146 const string str_rand_type = params_test.
get_string(
"random_number_type");
147 const unsigned long seed = params_test.
get_unsigned_long(
"seed_for_random_number");
148 const string str_vlevel = params_test.
get_string(
"verbose_level");
150 const bool do_check = params_test.
is_set(
"expected_result");
151 const double expected_result = do_check ? params_test.
get_double(
"expected_result") : 0.0;
156 vout.
general(
vl,
" gconf_status = %s\n", str_gconf_status.c_str());
157 vout.
general(
vl,
" gconf_read = %s\n", str_gconf_read.c_str());
158 vout.
general(
vl,
" gconf_write = %s\n", str_gconf_write.c_str());
161 vout.
general(
vl,
" rand_type = %s\n", str_rand_type.c_str());
183 if (str_gconf_status ==
"Continue") {
185 }
else if (str_gconf_status ==
"Cold_start") {
187 }
else if (str_gconf_status ==
"Hot_start") {
190 vout.
crucial(
vl,
"Error at %s: unsupported gconf status \"%s\"\n",
test_name.c_str(), str_gconf_status.c_str());
222 const int result = err;
239 static inline bool is_equal(
const double x,
const double y)
243 if ((x == 0) && (y == 0))
return true;
245 if (x == 0)
return fabs(y) < eps;
247 if (y == 0)
return fabs(x) < eps;
249 return fabs((x - y) / y) < eps;
264 for (
int idir = 0; idir < Ndim; ++idir) {
265 for (
int isite = 0; isite < Nvol; ++isite) {
266 for (
int i = 0; i < Nc * Nc; ++i) {
267 double v1r = f.
cmp_r(i, isite, idir);
268 double v1i = f.
cmp_i(i, isite, idir);
270 double v2r = g.
cmp_r(i, isite, idir);
271 double v2i = g.
cmp_i(i, isite, idir);
278 vout.
general(
vl,
"%6d : %4d: %2d: %19.15f %19.15f\n %19.15f %19.15f : %s\n",
281 is_ok ?
"ok" :
"fail");
283 vout.
paranoiac(
vl,
"%6d : %4d: %2d: %19.15f %19.15f\n %19.15f %19.15f : %s\n",
286 is_ok ?
"ok" :
"fail");
int verify(const double result, const double expected, double eps)
int non_NULL(const std::string v)
int test_io_gconf_ILDG_parallel()
int test_io_gconf_fortran()
void detailed(const char *format,...)
void read(Field_G &U, const string &filename=string())
void write_file(Field_G &U, const string &filename)
int test_io_gconf_binary()
int test_io_gconf_binary_parallel()
void paranoiac(const char *format,...)
static bool initialize(const std::string &rng_type, unsigned long seed)
int check_conf(const Field_G &f, const Field_G &g)
const std::string test_name
int test_io_gconf_binary_distributed()
static void read(const std::string ¶ms_file, Parameters ¶ms)
double get_double(const string &key) const
static bool is_equal(const double x, const double y)
unsigned long get_unsigned_long(const string &key) const
static Bridge::VerboseLevel Vlevel()
double cmp_r(const int cc, const int site, const int mn=0) const
GaugeConfig class for file I/O of gauge configuration.
static VerboseLevel set_verbose_level(const std::string &str)
bool is_set(const string &key) const
void read_file(Field_G &U, const string &filename)
double cmp_i(const int cc, const int site, const int mn=0) const
string get_string(const string &key) const
void crucial(const char *format,...)
void general(const char *format,...)
Parameters lookup(const string &key) const
void report(const Bridge::VerboseLevel vl=Bridge::GENERAL)
static bool RegisterTest(const std::string &key, const Test_function func)
int test_io_gconf_main(const std::string &)
static double epsilon_criterion()