Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Have the s4u::Actor::execute() actually wait for the completion of the execution
[simgrid.git] / include / simgrid / s4u / engine.hpp
1 /* Copyright (c) 2006-2015. The SimGrid Team. All rights reserved.          */
2
3 /* This program is free software; you can redistribute it and/or modify it
4  * under the terms of the license (GNU LGPL) which comes with this package. */
5
6 #ifndef SIMGRID_S4U_ENGINE_HPP
7 #define SIMGRID_S4U_ENGINE_HPP
8
9 namespace simgrid {
10 namespace s4u {
11 /** @brief Simulation engine
12  *
13  * This class is an interface to the simulation engine.
14  */
15 class Engine {
16 public:
17         /** Constructor, taking the command line parameters of your main function */
18         Engine(int *argc, char **argv);
19
20         /** @brief Load a platform file describing the environment
21          *
22          * The environment is either a XML file following the simgrid.dtd formalism, or a lua file.
23          * Some examples can be found in the directory examples/platforms.
24          */
25         void loadPlatform(const char *platf);
26
27         /** Registers the main function of an actor that will be launched from the deployment file */
28         void register_function(const char*name, int (*code)(int,char**));
29
30         /** Registers a function as the default main function of actors
31          *
32          * It will be used as fallback when the function requested from the deployment file was not registered.
33          * It is used for trace-based simulations (see examples/msg/actions).
34          */
35         void register_default(int (*code)(int,char**));
36
37         /** @brief Load a deployment file and launch the actors that it contains */
38         void loadDeployment(const char *deploy);
39
40         /** @brief Run the simulation */
41         void run();
42
43         /** @brief Retrieve the simulation time */
44         static double getClock();
45         
46 };
47 }} // namespace simgrid::sgo
48
49 #endif /* SIMGRID_S4U_ENGINE_HPP */