4 * Copyright 2006,2007 Martin Quinson, Malek Cherier
\r
5 * All right reserved.
\r
7 * This program is free software; you can redistribute
\r
8 * it and/or modify it under the terms of the license
\r
9 *(GNU LGPL) which comes with this package.
\r
13 /* Simulation member functions implementation.
\r
16 #include <Simulation.hpp>
\r
24 int Simulation::execute(int argc, char** argv)
\r
28 info("Usage: Msg platform_file deployment_file");
\r
32 // initialize the MSG simulator. Must be done before anything else (even logging).
\r
35 // the environment to load
\r
38 // the application to deploy
\r
42 // try to load the environment described by the xml file (argv[1])
\r
47 catch(FileNotFoundException e)
\r
54 // try to deploy the application described by the xml file deployment (argv[2])
\r
57 app.deploy(argv[2]);
\r
58 catch(FileNotFoundException e)
\r
65 //try to run the simulation the given application on the given environment
\r
70 catch(MsgException e)
\r
77 // finalize the MSG simulator
\r
82 catch(MsgException e)
\r
91 void Simulation::run(void)
\r
92 throw (MsgException)
\r
94 if(MSG_OK != MSG_main())
\r
95 throw MsgException("MSG_main() failed");
\r
98 } // namespace SimGrid
\r