SimGrid
3.16
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... | |
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 | hostCount () |
Returns the amount of hosts in the platform. More... | |
void | hostList (std::vector< Host *> *whereTo) |
Fills the passed list with all hosts found in the platform. More... | |
void | run () |
Run the simulation. More... | |
simgrid::s4u::NetZone * | netRoot () |
Retrieve the root netzone, containing all others. More... | |
simgrid::s4u::NetZone * | netzoneByNameOrNull (const char *name) |
Retrieve the netzone of the given name (or nullptr if not found) More... | |
simgrid::kernel::routing::NetPoint * | netpointByNameOrNull (const char *name) |
Retrieve the netcard of the given name (or nullptr if not found) More... | |
void | netpointList (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) |
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 * | instance () |
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.
|
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::hostCount | ( | ) |
Returns the amount of hosts 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::netRoot | ( | ) |
Retrieve the root netzone, containing all others.
NetZone * simgrid::s4u::Engine::netzoneByNameOrNull | ( | 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::netpointByNameOrNull | ( | const char * | 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::netpointList | ( | 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.
simgrid::kernel::EngineImpl* simgrid::s4u::Engine::pimpl |