forked from samerg1/ezSpectrum
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.C
executable file
·53 lines (37 loc) · 1.35 KB
/
main.C
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#include "genincludes.h"
#include "genutil.h"
#include "harmonic_pes_main.h"
#include "simple_xml_parser.h"
main(int argc, char* argv[])
{
if ((argc-1)<1) {
std::cerr << argv[0] << ": one and only one argument required, <Job.xml>.\n";
exit(1);
}
std::string arg=argv[1];
std::cout << "Job \"" << argv[0] << ' ' << argv[1] << "\" has been started: " << GetTime() << '\n';
simpleXMLparser xmlF;
xmlF.assignFile(arg.c_str());
xmlF.reset().node("input");
bool if_web_version=false;
if ( xmlF.CheckSubNode("if_web_version") )
{
xmlF.node("if_web_version");
if_web_version = xmlF.getBoolValue("flag");
}
if (not(if_web_version))
{
std::cout << "A copy of the \"" << argv[1] << "\" input:\n";
std::cout << "------------------------------------------------------------------------------\n";
xmlF.printInputFile();
std::cout << "------------------------------------------------------------------------------\n \n";
}
std::string job;
job=xmlF.reset().node("input").value("job");
bool done = false;
if (job == "harmonic_pes")
done=harmonic_pes_main(arg.c_str());
if ( !done )
std::cout << "Method \"" << job <<"\" is unknown, or it has been failed. \n";
std::cout << '\n' << "Job \"" << argv[0] << ' ' << argv[1] << "\" has been finished: " << GetTime() << '\n';
}