SimGrid
3.21
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 (const Engine &)=delete | |
Currently, only one instance is allowed to exist. More... | |
Engine (Engine &&)=delete | |
~Engine () | |
void | run () |
Run the simulation. More... | |
void | load_platform (std::string platf) |
Load a platform file describing the environment. More... | |
void | register_function (std::string name, int(*code)(int, char **)) |
Registers the main function of an actor that will be launched from the deployment file. More... | |
void | register_function (std::string name, void(*code)(std::vector< std::string >)) |
Registers the main function of an actor that will be launched from the deployment file. More... | |
void | register_default (int(*code)(int, char **)) |
Registers a function as the default main function of actors. More... | |
template<class F > | |
void | register_actor (std::string name) |
template<class F > | |
void | register_actor (std::string name, F code) |
void | load_deployment (std::string deploy) |
Load a deployment file and launch the actors that it contains. More... | |
size_t | get_host_count () |
std::vector< Host * > | get_all_hosts () |
Returns the list of all hosts found in the platform. More... | |
std::vector< Host * > | get_filtered_hosts (std::function< bool(Host *)> filter) |
simgrid::s4u::Host * | host_by_name (std::string name) |
simgrid::s4u::Host * | host_by_name_or_null (std::string name) |
size_t | get_link_count () |
std::vector< Link * > | get_all_links () |
std::vector< Link * > | get_filtered_links (std::function< bool(Link *)> filter) |
simgrid::s4u::Link * | link_by_name (std::string name) |
simgrid::s4u::Link * | link_by_name_or_null (std::string name) |
size_t | get_actor_count () |
std::vector< ActorPtr > | get_all_actors () |
std::vector< ActorPtr > | get_filtered_actors (std::function< bool(ActorPtr)> filter) |
size_t | get_storage_count () |
std::vector< Storage * > | get_all_storages () |
simgrid::s4u::Storage * | storage_by_name (std::string name) |
simgrid::s4u::Storage * | storage_by_name_or_null (std::string name) |
std::vector< simgrid::kernel::routing::NetPoint * > | get_all_netpoints () |
simgrid::kernel::routing::NetPoint * | netpoint_by_name_or_null (std::string name) |
simgrid::s4u::NetZone * | get_netzone_root () |
void | set_netzone_root (s4u::NetZone *netzone) |
simgrid::s4u::NetZone * | netzone_by_name_or_null (std::string name) |
template<class T > | |
std::vector< T * > | get_filtered_netzones () |
Retrieves all netzones of the type indicated by the template argument. More... | |
void | set_config (std::string str) |
set a configuration variable More... | |
void | loadPlatform (std::string platf) |
void | registerFunction (std::string name, int(*code)(int, char **)) |
void | registerDefault (int(*code)(int, char **)) |
template<class F > | |
void | registerFunction (std::string name) |
template<class F > | |
void | registerFunction (std::string name, F code) |
void | loadDeployment (std::string deploy) |
simgrid::s4u::Host * | hostByName (std::string name) |
simgrid::s4u::Host * | hostByNameOrNull (std::string name) |
simgrid::s4u::Storage * | storageByName (std::string name) |
simgrid::s4u::Storage * | storageByNameOrNull (std::string name) |
size_t | getHostCount () |
void | getHostList (std::vector< Host *> *whereTo) |
std::vector< Host * > | getAllHosts () |
size_t | getLinkCount () |
void | getLinkList (std::vector< Link *> *list) |
std::vector< Link * > | getAllLinks () |
std::vector< Storage * > | getAllStorages () |
void | getNetpointList (std::vector< simgrid::kernel::routing::NetPoint *> *list) |
simgrid::kernel::routing::NetPoint * | getNetpointByNameOrNull (std::string name) |
simgrid::s4u::NetZone * | getNetRoot () |
simgrid::s4u::NetZone * | getNetzoneByNameOrNull (std::string name) |
template<class T > | |
void | getNetzoneByType (std::vector< T *> *whereto) |
void | setConfig (std::string str) |
Static Public Member Functions | |
static void | shutdown () |
Finalize the default engine and all its dependencies. More... | |
static double | get_clock () |
Retrieve the simulation time. More... | |
static s4u::Engine * | get_instance () |
Retrieve the engine singleton. More... | |
static bool | is_initialized () |
Returns whether SimGrid was initialized yet – mostly for internal use. More... | |
static double | getClock () |
static s4u::Engine * | getInstance () |
static bool | isInitialized () |
|
explicit |
Constructor, taking the command line parameters of your main function.
|
delete |
Currently, only one instance is allowed to exist.
This is why you can't copy or move it
|
delete |
simgrid::s4u::Engine::~Engine | ( | ) |
|
static |
Finalize the default engine and all its dependencies.
void simgrid::s4u::Engine::run | ( | ) |
Run the simulation.
|
static |
Retrieve the simulation time.
|
static |
Retrieve the engine singleton.
void simgrid::s4u::Engine::load_platform | ( | std::string | 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::register_function | ( | std::string | name, |
int(*)(int, char **) | code | ||
) |
Registers the main function of an actor that will be launched from the deployment file.
void simgrid::s4u::Engine::register_function | ( | std::string | name, |
void(*)(std::vector< std::string >) | code | ||
) |
Registers the main function of an actor that will be launched from the deployment file.
void simgrid::s4u::Engine::register_default | ( | 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/s4u/replay-comms and similar).
|
inline |
|
inline |
void simgrid::s4u::Engine::load_deployment | ( | std::string | deploy | ) |
Load a deployment file and launch the actors that it contains.
size_t simgrid::s4u::Engine::get_host_count | ( | ) |
std::vector<Host*> simgrid::s4u::Engine::get_all_hosts | ( | ) |
Returns the list of all hosts found in the platform.
simgrid::s4u::Host* simgrid::s4u::Engine::host_by_name | ( | std::string | name | ) |
simgrid::s4u::Host* simgrid::s4u::Engine::host_by_name_or_null | ( | std::string | name | ) |
size_t simgrid::s4u::Engine::get_link_count | ( | ) |
std::vector<Link*> simgrid::s4u::Engine::get_all_links | ( | ) |
simgrid::s4u::Link* simgrid::s4u::Engine::link_by_name | ( | std::string | name | ) |
simgrid::s4u::Link* simgrid::s4u::Engine::link_by_name_or_null | ( | std::string | name | ) |
size_t simgrid::s4u::Engine::get_actor_count | ( | ) |
std::vector<ActorPtr> simgrid::s4u::Engine::get_all_actors | ( | ) |
std::vector<ActorPtr> simgrid::s4u::Engine::get_filtered_actors | ( | std::function< bool(ActorPtr)> | filter | ) |
size_t simgrid::s4u::Engine::get_storage_count | ( | ) |
std::vector<Storage*> simgrid::s4u::Engine::get_all_storages | ( | ) |
simgrid::s4u::Storage* simgrid::s4u::Engine::storage_by_name | ( | std::string | name | ) |
simgrid::s4u::Storage* simgrid::s4u::Engine::storage_by_name_or_null | ( | std::string | name | ) |
std::vector<simgrid::kernel::routing::NetPoint*> simgrid::s4u::Engine::get_all_netpoints | ( | ) |
simgrid::kernel::routing::NetPoint* simgrid::s4u::Engine::netpoint_by_name_or_null | ( | std::string | name | ) |
simgrid::s4u::NetZone* simgrid::s4u::Engine::get_netzone_root | ( | ) |
void simgrid::s4u::Engine::set_netzone_root | ( | s4u::NetZone * | netzone | ) |
simgrid::s4u::NetZone* simgrid::s4u::Engine::netzone_by_name_or_null | ( | std::string | name | ) |
|
inline |
Retrieves all netzones of the type indicated by the template argument.
|
static |
Returns whether SimGrid was initialized yet – mostly for internal use.
void simgrid::s4u::Engine::set_config | ( | std::string | str | ) |
set a configuration variable
Do –help on any simgrid binary to see the list of currently existing configuration variables (see also options).
Example: e->set_config("host/model:ptask_L07");
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
void simgrid::s4u::Engine::getHostList | ( | std::vector< Host *> * | whereTo | ) |
|
inline |
|
inline |
void simgrid::s4u::Engine::getLinkList | ( | std::vector< Link *> * | list | ) |
|
inline |
|
inline |
|
inlinestatic |
void simgrid::s4u::Engine::getNetpointList | ( | std::vector< simgrid::kernel::routing::NetPoint *> * | list | ) |
|
inline |
|
inline |
|
inline |
|
inline |
|
inlinestatic |
|
inlinestatic |
|
inline |