Bridge++  Ver. 2.0.2
main.cpp
Go to the documentation of this file.
1 
14 #include "bridge_setup.h"
15 #ifdef DEBUG
16 #include "bridge_init_factory.h"
17 #endif
19 #include "Parameters/parameters.h"
21 #include "Tools/timer.h"
22 
23 #ifdef USE_TESTMANAGER
24 #include "run_testmanager.h"
25 #endif
26 
27 #include "IO/bridgeIO.h"
28 using Bridge::vout;
29 
30 
31 const std::string filename_main_input = "main.yaml";
32 // const std::string filename_main_input = "stdin";
33 
34 //- prototype declarations
35 int run_test();
36 
37 
38 //====================================================================
39 int main(int argc, char *argv[])
40 {
41  // ### initial setup ###
43 
44  //- initialization step one
45  bridge_initialize(&argc, &argv);
46 
47  std::string filename_input = filename_main_input;
48  if (filename_input == "stdin") {
49  vout.general(vl, "input filename : ");
50  std::cin >> filename_input;
51  vout.general(vl, "%s\n", filename_input.c_str());
52  } else {
53  vout.general(vl, "input filename : %s\n", filename_input.c_str());
54  }
55  vout.general(vl, "\n");
56 
57  //- load input parameters
58  Parameters params_all = ParameterManager::read(filename_input);
59  Parameters params_main = params_all.lookup("Main");
60 
61  //- initialization step two: setup using parameter values,
62  bridge_setup(params_main);
63 
64 #ifdef USE_FACTORY
65 #ifdef DEBUG
66 // bridge_report_factory();
67 #endif
68 #endif
69 
70  //- start timer
71  Timer timer("Main");
72  timer.start();
73 
74 #ifdef USE_TESTMANAGER
75  run_testmanager(argc, argv);
76 #else
77  run_test();
78 #endif
79 
80  //- find total elapsed time
81  timer.report();
82 
83  //- finalization step
85 
86  return EXIT_SUCCESS;
87 }
88 
89 
90 //====================================================================
91 //============================================================END=====
bridgeIO.h
filename_main_input
const std::string filename_main_input
Definition: main.cpp:31
bridge_setup.h
Parameters
Class for parameters.
Definition: parameters.h:46
run_testmanager
int run_testmanager(int argc, char **argv)
Definition: run_testmanager.cpp:32
run_test
int run_test()
Definition: test_HMC_Clover_Nf2.cpp:64
Bridge::GENERAL
@ GENERAL
Definition: bridgeIO.h:45
Timer
Definition: timer.h:31
parameterManager_YAML.h
Timer::start
void start()
Definition: timer.cpp:44
timer.h
bridge_init_factory.h
ParameterCheck::vl
Bridge::VerboseLevel vl
Definition: parameterCheck.cpp:18
bridge_finalize
int bridge_finalize()
Definition: bridge_setup.cpp:94
bridge_initialize
int bridge_initialize(int *pargc, char ***pargv)
Definition: bridge_setup.cpp:32
ParameterManager::read
static void read(const std::string &params_file, Parameters &params)
Definition: parameterManager.cpp:33
parameters.h
run_testmanager.h
bridge_setup
void bridge_setup(const Parameters &params)
Definition: bridge_setup.cpp:106
commonParameters.h
Bridge::VerboseLevel
VerboseLevel
Definition: bridgeIO.h:42
Bridge::BridgeIO::general
void general(const char *format,...)
Definition: bridgeIO.cpp:200
main
int main(int argc, char *argv[])
Definition: main.cpp:39
Parameters::lookup
Parameters lookup(const string &key) const
Definition: parameters.h:79
Timer::report
void report(const Bridge::VerboseLevel vl=Bridge::GENERAL)
Definition: timer.cpp:128
Bridge::vout
BridgeIO vout
Definition: bridgeIO.cpp:512