4 * Copyright 2006,2007 Martin Quinson, Malek Cherier
7 * This program is free software; you can redistribute
8 * it and/or modify it under the terms of the license
9 *(GNU LGPL) which comes with this package.
13 /* Simulation member functions implementation.
17 #include <MsgApplication.hpp>
18 #include <MsgEnvironment.hpp>
22 #include <MsgSimulation.hpp>
31 int Simulation::execute(int argc, char** argv)
35 info("Usage: Msg platform_file deployment_file");
39 // initialize the MSG simulator. Must be done before anything else (even logging).
42 // the environment to load
45 // the application to deploy
49 // try to load the environment described by the xml file (argv[1])
54 catch(FileNotFoundException e)
61 // try to deploy the application described by the xml file deployment (argv[2])
66 catch(FileNotFoundException e)
73 //try to run the simulation the given application on the given environment
85 // finalize the MSG simulator
99 void Simulation::run(void)
102 if(MSG_OK != MSG_main())
103 throw MsgException("MSG_main() failed");
106 } // namespace SimGrid