SimGrid  3.16
Versatile Simulation of Distributed Systems
simgrid::s4u::Engine Class Reference

Detailed Description

#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::NetZonenetRoot ()
 Retrieve the root netzone, containing all others. More...
 
simgrid::s4u::NetZonenetzoneByNameOrNull (const char *name)
 Retrieve the netzone of the given name (or nullptr if not found) More...
 
simgrid::kernel::routing::NetPointnetpointByNameOrNull (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::Engineinstance ()
 Retrieve the engine singleton. More...
 
static bool isInitialized ()
 Returns whether SimGrid was initialized yet – mostly for internal use. More...
 

Public Attributes

simgrid::kernel::EngineImplpimpl
 

Constructor & Destructor Documentation

◆ Engine()

simgrid::s4u::Engine::Engine ( int *  argc,
char **  argv 
)

Constructor, taking the command line parameters of your main function.

Member Function Documentation

◆ shutdown()

void simgrid::s4u::Engine::shutdown ( )
static

Finalize the default engine and all its dependencies.

◆ loadPlatform()

void simgrid::s4u::Engine::loadPlatform ( const char *  platf)

◆ registerFunction() [1/3]

void simgrid::s4u::Engine::registerFunction ( const char *  name,
int(*)(int, char **)  code 
)

◆ registerDefault()

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).

Examples:
examples/s4u/actions-comm/s4u_actions-comm.cpp, and examples/s4u/actions-storage/s4u_actions-storage.cpp.

◆ loadDeployment()

void simgrid::s4u::Engine::loadDeployment ( const char *  deploy)

◆ hostCount()

size_t simgrid::s4u::Engine::hostCount ( )

Returns the amount of hosts in the platform.

Examples:
examples/s4u/app-token-ring/s4u_app-token-ring.cpp.

◆ hostList()

void simgrid::s4u::Engine::hostList ( std::vector< Host *> *  whereTo)

Fills the passed list with all hosts found in the platform.

Examples:
examples/s4u/actor-suspend/s4u_actor-suspend.cpp, and examples/s4u/app-token-ring/s4u_app-token-ring.cpp.

◆ run()

◆ getClock()

◆ instance()

Engine * simgrid::s4u::Engine::instance ( )
static

Retrieve the engine singleton.

Examples:
examples/s4u/app-token-ring/s4u_app-token-ring.cpp.

◆ netRoot()

s4u::NetZone * simgrid::s4u::Engine::netRoot ( )

Retrieve the root netzone, containing all others.

◆ netzoneByNameOrNull()

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)

◆ netpointByNameOrNull()

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)

◆ netpointList()

void simgrid::s4u::Engine::netpointList ( std::vector< simgrid::kernel::routing::NetPoint *> *  list)

Fill the provided vector with all existing netpoints.

◆ netpointRegister()

void simgrid::s4u::Engine::netpointRegister ( simgrid::kernel::routing::NetPoint card)

Register a new netpoint to the system.

◆ netpointUnregister()

void simgrid::s4u::Engine::netpointUnregister ( simgrid::kernel::routing::NetPoint card)

Unregister a given netpoint.

◆ registerFunction() [2/3]

template<class F >
void simgrid::s4u::Engine::registerFunction ( const char *  name)
inline

◆ registerFunction() [3/3]

template<class F >
void simgrid::s4u::Engine::registerFunction ( const char *  name,
code 
)
inline

◆ isInitialized()

bool simgrid::s4u::Engine::isInitialized ( )
static

Returns whether SimGrid was initialized yet – mostly for internal use.

Member Data Documentation

◆ pimpl

simgrid::kernel::EngineImpl* simgrid::s4u::Engine::pimpl

The documentation for this class was generated from the following files: