SimGrid
3.21
Versatile Simulation of Distributed Systems
|
Some physical resource with computing and networking capabilities on which Actors execute.
All hosts are automatically created during the call of the method simgrid::s4u::Engine::load_platform(). You cannot create a host yourself.
You can retrieve a particular host using simgrid::s4u::Host::by_name() and actors can retrieve the host on which they run using simgrid::s4u::Host::current() or simgrid::s4u::this_actor::get_host().
#include <Host.hpp>
Inherits simgrid::xbt::Extendable< Host >.
Inherited by simgrid::s4u::VirtualMachine.
Public Member Functions | |
Host (std::string name) | |
virtual void | destroy () |
Host (Host const &)=delete | |
Host & | operator= (Host const &)=delete |
simgrid::xbt::string const & | get_name () const |
Retrieves the name of that host as a C++ string. More... | |
const char * | get_cname () const |
Retrieves the name of that host as a C string. More... | |
int | get_actor_count () |
std::vector< ActorPtr > | get_all_actors () |
void | turn_on () |
Turns that host on if it was previously off. More... | |
void | turn_off () |
Turns that host off. More... | |
bool | is_on () const |
Returns if that host is currently up and running. More... | |
bool | is_off () const |
Returns if that host is currently down and offline. More... | |
const char * | get_property (std::string key) const |
void | set_property (std::string key, std::string value) |
std::unordered_map< std::string, std::string > * | get_properties () |
double | get_speed () const |
double | get_available_speed () const |
int | get_core_count () const |
double | get_load () const |
double | get_pstate_speed (int pstate_index) const |
int | get_pstate_count () const |
void | set_pstate (int pstate_index) |
int | get_pstate () const |
std::vector< const char * > | get_attached_storages () const |
void | getAttachedStorages (std::vector< const char *> *storages) |
std::unordered_map< std::string, Storage * > const & | get_mounted_storages () |
Get an associative list [mount point]->[Storage] of all local mount points. More... | |
std::unordered_map< std::string, Storage * > const & | getMountedStorages () |
void | route_to (Host *dest, std::vector< Link *> &links, double *latency) |
void | route_to (Host *dest, std::vector< kernel::resource::LinkImpl *> &links, double *latency) |
void | execute (double flops) |
Block the calling actor on an execution located on the called host. More... | |
ExecPtr | exec_async (double flops_amounts) |
Start an asynchronous computation on that host (possibly remote) More... | |
void | execute (double flops, double priority) |
Block the calling actor on an execution located on the called host (with explicit priority) More... | |
![]() | |
Extendable () | |
~Extendable () | |
void * | extension (std::size_t rank) |
U * | extension (Extension< Host, U > rank) |
U * | extension () |
void | extension_set (std::size_t rank, void *value, bool use_dtor=true) |
void | extension_set (Extension< Host, U > rank, U *value, bool use_dtor=true) |
void | extension_set (U *p) |
Static Public Member Functions | |
static Host * | by_name_or_null (std::string name) |
Retrieves an host from its name, or return nullptr. More... | |
static s4u::Host * | by_name (std::string name) |
Retrieves an host from its name, or die. More... | |
static s4u::Host * | current () |
Retrieves the host on which the current actor is running. More... | |
![]() | |
static size_t | extension_create (void(*deleter)(void *)) |
static Extension< Host, U > | extension_create (void(*deleter)(void *)) |
static Extension< Host, U > | extension_create () |
Public Attributes | |
surf::Cpu * | pimpl_cpu = nullptr |
DO NOT USE DIRECTLY (. More... | |
surf::HostImpl * | pimpl_ = nullptr |
kernel::routing::NetPoint * | pimpl_netpoint = nullptr |
DO NOT USE DIRECTLY (. More... | |
Static Public Attributes | |
static simgrid::xbt::signal< void(Host &)> | on_creation |
static simgrid::xbt::signal< void(Host &)> | on_destruction |
static simgrid::xbt::signal< void(Host &)> | on_state_change |
static simgrid::xbt::signal< void(Host &)> | on_speed_change |
Protected Member Functions | |
virtual | ~Host () |
Host destruction logic. More... | |
|
explicit |
|
protectedvirtual |
Host destruction logic.
|
delete |
|
virtual |
Reimplemented in simgrid::s4u::VirtualMachine.
|
static |
Retrieves an host from its name, or return nullptr.
|
static |
Retrieves an host from its name, or die.
|
static |
Retrieves the host on which the current actor is running.
|
inline |
Retrieves the name of that host as a C++ string.
|
inline |
Retrieves the name of that host as a C string.
int simgrid::s4u::Host::get_actor_count | ( | ) |
std::vector<ActorPtr> simgrid::s4u::Host::get_all_actors | ( | ) |
void simgrid::s4u::Host::turn_on | ( | ) |
Turns that host on if it was previously off.
All actors on that host which were marked autorestart will be restarted automatically. This call does nothing if the host is already on.
void simgrid::s4u::Host::turn_off | ( | ) |
Turns that host off.
All actors are forcefully stopped.
bool simgrid::s4u::Host::is_on | ( | ) | const |
Returns if that host is currently up and running.
|
inline |
Returns if that host is currently down and offline.
const char* simgrid::s4u::Host::get_property | ( | std::string | key | ) | const |
void simgrid::s4u::Host::set_property | ( | std::string | key, |
std::string | value | ||
) |
std::unordered_map<std::string, std::string>* simgrid::s4u::Host::get_properties | ( | ) |
double simgrid::s4u::Host::get_speed | ( | ) | const |
double simgrid::s4u::Host::get_available_speed | ( | ) | const |
int simgrid::s4u::Host::get_core_count | ( | ) | const |
double simgrid::s4u::Host::get_load | ( | ) | const |
double simgrid::s4u::Host::get_pstate_speed | ( | int | pstate_index | ) | const |
int simgrid::s4u::Host::get_pstate_count | ( | ) | const |
void simgrid::s4u::Host::set_pstate | ( | int | pstate_index | ) |
int simgrid::s4u::Host::get_pstate | ( | ) | const |
std::vector<const char*> simgrid::s4u::Host::get_attached_storages | ( | ) | const |
void simgrid::s4u::Host::getAttachedStorages | ( | std::vector< const char *> * | storages | ) |
std::unordered_map<std::string, Storage*> const& simgrid::s4u::Host::get_mounted_storages | ( | ) |
Get an associative list [mount point]->[Storage] of all local mount points.
This is defined in the platform file, and cannot be modified programatically (yet).
|
inline |
void simgrid::s4u::Host::route_to | ( | Host * | dest, |
std::vector< kernel::resource::LinkImpl *> & | links, | ||
double * | latency | ||
) |
void simgrid::s4u::Host::execute | ( | double | flops | ) |
Block the calling actor on an execution located on the called host.
It is not a problem if the actor is not located on the called host. The actor will not be migrated in this case. Such remote execution are easy in simulation.
ExecPtr simgrid::s4u::Host::exec_async | ( | double | flops_amounts | ) |
Start an asynchronous computation on that host (possibly remote)
void simgrid::s4u::Host::execute | ( | double | flops, |
double | priority | ||
) |
Block the calling actor on an execution located on the called host (with explicit priority)
|
static |
|
static |
|
static |
|
static |
surf::Cpu* simgrid::s4u::Host::pimpl_cpu = nullptr |
DO NOT USE DIRECTLY (.
surf::HostImpl* simgrid::s4u::Host::pimpl_ = nullptr |
kernel::routing::NetPoint* simgrid::s4u::Host::pimpl_netpoint = nullptr |
DO NOT USE DIRECTLY (.