|
SimGrid
3.18
Versatile Simulation of Distributed Systems
|
Simulation engine.
This class is an interface to the simulation engine.
#include <Engine.hpp>
Public Member Functions | |
| Engine (int *argc, char **argv) | |
| Constructor, taking the command line parameters of your main function. More... | |
| ~Engine () | |
| void | loadPlatform (const char *platf) |
| Load a platform file describing the environment. More... | |
| void | registerFunction (const char *name, int(*code)(int, char **)) |
| Registers the main function of an actor that will be launched from the deployment file. More... | |
| void | registerDefault (int(*code)(int, char **)) |
| Registers a function as the default main function of actors. More... | |
| void | loadDeployment (const char *deploy) |
| Load a deployment file and launch the actors that it contains. More... | |
| size_t | getHostCount () |
| Returns the amount of hosts in the platform. More... | |
| void | getHostList (std::vector< Host *> *whereTo) |
| Fills the passed list with all hosts found in the platform. More... | |
| size_t | getLinkCount () |
| Returns the amount of links in the platform. More... | |
| void | getLinkList (std::vector< Link *> *list) |
| Fills the passed list with all hosts found in the platform. More... | |
| void | run () |
| Run the simulation. More... | |
| simgrid::s4u::NetZone * | getNetRoot () |
| Retrieve the root netzone, containing all others. More... | |
| simgrid::s4u::NetZone * | getNetzoneByNameOrNull (const char *name) |
| Retrieve the netzone of the given name (or nullptr if not found) More... | |
| simgrid::kernel::routing::NetPoint * | getNetpointByNameOrNull (std::string name) |
| Retrieve the netcard of the given name (or nullptr if not found) More... | |
| void | getNetpointList (std::vector< simgrid::kernel::routing::NetPoint *> *list) |
| Fill the provided vector with all existing netpoints. More... | |
| void | netpointRegister (simgrid::kernel::routing::NetPoint *card) |
| Register a new netpoint to the system. More... | |
| void | netpointUnregister (simgrid::kernel::routing::NetPoint *card) |
| Unregister a given netpoint. More... | |
| template<class F > | |
| void | registerFunction (const char *name) |
| template<class F > | |
| void | registerFunction (const char *name, F code) |
| void | setConfig (std::string str) |
| set a configuration variable More... | |
Static Public Member Functions | |
| static void | shutdown () |
| Finalize the default engine and all its dependencies. More... | |
| static double | getClock () |
| Retrieve the simulation time. More... | |
| static s4u::Engine * | getInstance () |
| Retrieve the engine singleton. More... | |
| static bool | isInitialized () |
| Returns whether SimGrid was initialized yet – mostly for internal use. More... | |
Public Attributes | |
| simgrid::kernel::EngineImpl * | pimpl |
| simgrid::s4u::Engine::Engine | ( | int * | argc, |
| char ** | argv | ||
| ) |
Constructor, taking the command line parameters of your main function.
| simgrid::s4u::Engine::~Engine | ( | ) |
|
static |
Finalize the default engine and all its dependencies.
| void simgrid::s4u::Engine::loadPlatform | ( | const char * | platf | ) |
Load a platform file describing the environment.
The environment is either a XML file following the simgrid.dtd formalism, or a lua file. Some examples can be found in the directory examples/platforms.
| void simgrid::s4u::Engine::registerFunction | ( | const char * | name, |
| int(*)(int, char **) | code | ||
| ) |
Registers the main function of an actor that will be launched from the deployment file.
| void simgrid::s4u::Engine::registerDefault | ( | int(*)(int, char **) | code | ) |
Registers a function as the default main function of actors.
It will be used as fallback when the function requested from the deployment file was not registered. It is used for trace-based simulations (see examples/msg/actions).
| void simgrid::s4u::Engine::loadDeployment | ( | const char * | deploy | ) |
Load a deployment file and launch the actors that it contains.
| size_t simgrid::s4u::Engine::getHostCount | ( | ) |
Returns the amount of hosts in the platform.
Fills the passed list with all hosts found in the platform.
| size_t simgrid::s4u::Engine::getLinkCount | ( | ) |
Returns the amount of links in the platform.
Fills the passed list with all hosts found in the platform.
| void simgrid::s4u::Engine::run | ( | ) |
Run the simulation.
|
static |
Retrieve the simulation time.
|
static |
Retrieve the engine singleton.
| s4u::NetZone * simgrid::s4u::Engine::getNetRoot | ( | ) |
Retrieve the root netzone, containing all others.
| NetZone * simgrid::s4u::Engine::getNetzoneByNameOrNull | ( | const char * | name | ) |
Retrieve the netzone of the given name (or nullptr if not found)
Retrieve the NetZone of the given name (or nullptr if not found)
| simgrid::kernel::routing::NetPoint * simgrid::s4u::Engine::getNetpointByNameOrNull | ( | std::string | name | ) |
Retrieve the netcard of the given name (or nullptr if not found)
Retrieve the netpoint of the given name (or nullptr if not found)
| void simgrid::s4u::Engine::getNetpointList | ( | std::vector< simgrid::kernel::routing::NetPoint *> * | list | ) |
Fill the provided vector with all existing netpoints.
| void simgrid::s4u::Engine::netpointRegister | ( | simgrid::kernel::routing::NetPoint * | card | ) |
Register a new netpoint to the system.
| void simgrid::s4u::Engine::netpointUnregister | ( | simgrid::kernel::routing::NetPoint * | card | ) |
Unregister a given netpoint.
|
inline |
|
inline |
|
static |
Returns whether SimGrid was initialized yet – mostly for internal use.
| void simgrid::s4u::Engine::setConfig | ( | std::string | str | ) |
set a configuration variable
Do –help on any simgrid binary to see the list of currently existing configuration variables (see Configure SimGrid).
Example: e->setConfig("host/model","ptask_L07");
| simgrid::kernel::EngineImpl* simgrid::s4u::Engine::pimpl |