17 int main(
int argc,
char *argv[])
24 #ifdef USE_TESTMANAGER
27 std::string arg1 = argv[1];
29 if ((arg1 ==
"-l") || (arg1 ==
"--list")) {
32 }
else if ((arg1 ==
"-h") || (arg1 ==
"--help")) {
36 vout.
general(
" (without args) -- run tests interactively.\n");
37 vout.
general(
" test_names -- run specified tests.\n");
39 vout.
general(
" -l | --list -- list registered tests.\n");
40 vout.
general(
" -h | --help -- show this message.\n");
62 if (filename_input ==
"stdin") {
64 std::cin >> filename_input;
67 vout.
general(vl,
"input filename : %s\n", filename_input.c_str());
73 const std::vector<int> lattice_size = params_main->
get_int_vector(
"lattice_size");
74 const std::vector<int> grid_size = params_main->
get_int_vector(
"grid_size");
75 const int number_of_thread = params_main->
get_int(
"number_of_thread");
76 const int number_of_color = params_main->
get_int(
"number_of_color");
77 const string str_logfile = params_main->
get_string(
"log_filename");
78 const string str_ildg_logfile = params_main->
get_string(
"ildg_log_filename");
79 const string str_vlevel = params_main->
get_string(
"verbose_level");
89 std::ofstream logfile;
91 if (str_logfile !=
"stdout") {
92 logfile.open(str_logfile.c_str());
94 vout.
crucial(vl,
"cannot open logfile: %s.\n", str_logfile.c_str());
100 std::ofstream ildg_logfile;
102 if (str_ildg_logfile !=
"stdout") {
103 ildg_logfile.open(str_ildg_logfile.c_str());
105 vout.
crucial(vl,
"cannot open logfile for ildg format: %s.\n", str_ildg_logfile.c_str());
123 for (
int mu = 0; mu < Ndim; ++mu) {
124 vout.
general(vl,
" lattice_size[%d] = %d\n", mu, lattice_size[mu]);
126 for (
int mu = 0; mu < Ndim; ++mu) {
127 vout.
general(vl,
" grid_size[%d] = %d\n", mu, grid_size[mu]);
129 vout.
general(vl,
" number of thread = %d\n", number_of_thread);
130 vout.
general(vl,
" number of color = %d\n", number_of_color);
131 vout.
general(vl,
" logfile = %s\n", str_logfile.c_str());
132 vout.
general(vl,
" ildg_logfile = %s\n", str_ildg_logfile.c_str());
133 vout.
general(vl,
" vlevel = %s\n", str_vlevel.c_str());
142 vout.
crucial(vl,
"Main: input parameters have not been set.\n");
153 #ifdef USE_TESTMANAGER
void ildg_init(std::ostream &os)
static int init(int *pargc, char ***pargv)
initialize communicator
void general(const char *format,...)
int get_int(const string &key) const
static void init_Vlevel(Bridge::VerboseLevel vlevel)
initialization for default verbose level.
static int finalize()
finalize communicator
static void init(int Nthread)
setup: called in main only once.
std::vector< int > get_int_vector(const string &key) const
int run_testmanager(int argc, char **argv)
static void finalize()
finalization.
void init(std::ostream &os)
int non_NULL(const std::string v)
static TestManager & Instance()
static int setup(int ninstance=1)
setup communicator
void crucial(const char *format,...)
const string filename_main_input
void Register_Parameters(const string &, Parameters *const)
static void read(const std::string ¶ms_file, Parameters *params)
string get_string(const string &key) const
int main(int argc, char *argv[])
void report(const Bridge::VerboseLevel vl=Bridge::GENERAL)
static VerboseLevel set_verbose_level(const std::string &str)
static void init(const std::vector< int > &lattice_size, const std::vector< int > &grid_size)
initialization (Nc=3 is assumed).