Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Add a class of exception for file not found and Msg files containing the declarations...
[simgrid.git] / src / cxx / Simulation.cxx
1 #include <Simulation.hpp>\r
2 \r
3 #include <Simulator.hpp>\r
4 \r
5 namespace SimGrid\r
6 {\r
7         namespace Msg\r
8         {\r
9                 int Simulation::execute(int argc, char** argv)\r
10                 {\r
11                         if(argc < 3) \r
12                         {\r
13                       info("Usage: Msg platform_file deployment_file");\r
14                       return 1;\r
15                     }\r
16                     \r
17                          // initialize the MSG simulator. Must be done before anything else (even logging).\r
18                 Simulator::init(argc, argv);\r
19                         \r
20                         // the environment to load\r
21                         Environment environment(argv[1]);\r
22                         // the application to deploy\r
23                         Application application(argv[2]);\r
24                         // the simulation\r
25                         Simulation simulation;\r
26                         \r
27                         // load the environment\r
28                         environment.load();\r
29                         \r
30                         // deploy the application\r
31                         application.deploy();\r
32                         \r
33                         // run the simulation\r
34                         simulation.run(environment, application);\r
35                         \r
36                         // finalize the simulator\r
37                         Simulator::finalize();\r
38                 }\r
39         } // namespace Msg\r
40 } // namespace SimGrid\r