SimGrid  3.21
Versatile Simulation of Distributed Systems
simgrid::s4u::Host Class Reference

Detailed Description

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
 
Hostoperator= (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...
 
- Public Member Functions inherited from simgrid::xbt::Extendable< Host >
 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 Hostby_name_or_null (std::string name)
 Retrieves an host from its name, or return nullptr. More...
 
static s4u::Hostby_name (std::string name)
 Retrieves an host from its name, or die. More...
 
static s4u::Hostcurrent ()
 Retrieves the host on which the current actor is running. More...
 
- Static Public Member Functions inherited from simgrid::xbt::Extendable< Host >
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::NetPointpimpl_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...
 

Constructor & Destructor Documentation

◆ Host() [1/2]

simgrid::s4u::Host::Host ( std::string  name)
explicit

◆ ~Host()

virtual simgrid::s4u::Host::~Host ( )
protectedvirtual

Host destruction logic.

◆ Host() [2/2]

simgrid::s4u::Host::Host ( Host const &  )
delete

Member Function Documentation

◆ destroy()

virtual void simgrid::s4u::Host::destroy ( )
virtual

Reimplemented in simgrid::s4u::VirtualMachine.

◆ operator=()

Host& simgrid::s4u::Host::operator= ( Host const &  )
delete

◆ by_name_or_null()

static Host* simgrid::s4u::Host::by_name_or_null ( std::string  name)
static

Retrieves an host from its name, or return nullptr.

◆ by_name()

static s4u::Host* simgrid::s4u::Host::by_name ( std::string  name)
static

Retrieves an host from its name, or die.

◆ current()

static s4u::Host* simgrid::s4u::Host::current ( )
static

Retrieves the host on which the current actor is running.

◆ get_name()

simgrid::xbt::string const& simgrid::s4u::Host::get_name ( ) const
inline

Retrieves the name of that host as a C++ string.

◆ get_cname()

const char* simgrid::s4u::Host::get_cname ( ) const
inline

Retrieves the name of that host as a C string.

◆ get_actor_count()

int simgrid::s4u::Host::get_actor_count ( )

◆ get_all_actors()

std::vector<ActorPtr> simgrid::s4u::Host::get_all_actors ( )

◆ turn_on()

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.

◆ turn_off()

void simgrid::s4u::Host::turn_off ( )

Turns that host off.

All actors are forcefully stopped.

◆ is_on()

bool simgrid::s4u::Host::is_on ( ) const

Returns if that host is currently up and running.

◆ is_off()

bool simgrid::s4u::Host::is_off ( ) const
inline

Returns if that host is currently down and offline.

◆ get_property()

const char* simgrid::s4u::Host::get_property ( std::string  key) const

◆ set_property()

void simgrid::s4u::Host::set_property ( std::string  key,
std::string  value 
)

◆ get_properties()

std::unordered_map<std::string, std::string>* simgrid::s4u::Host::get_properties ( )

◆ get_speed()

double simgrid::s4u::Host::get_speed ( ) const

◆ get_available_speed()

double simgrid::s4u::Host::get_available_speed ( ) const

◆ get_core_count()

int simgrid::s4u::Host::get_core_count ( ) const

◆ get_load()

double simgrid::s4u::Host::get_load ( ) const

◆ get_pstate_speed()

double simgrid::s4u::Host::get_pstate_speed ( int  pstate_index) const

◆ get_pstate_count()

int simgrid::s4u::Host::get_pstate_count ( ) const

◆ set_pstate()

void simgrid::s4u::Host::set_pstate ( int  pstate_index)

◆ get_pstate()

int simgrid::s4u::Host::get_pstate ( ) const

◆ get_attached_storages()

std::vector<const char*> simgrid::s4u::Host::get_attached_storages ( ) const

◆ getAttachedStorages()

void simgrid::s4u::Host::getAttachedStorages ( std::vector< const char *> *  storages)

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

◆ getMountedStorages()

std::unordered_map<std::string, Storage*> const& simgrid::s4u::Host::getMountedStorages ( )
inline

◆ route_to() [1/2]

void simgrid::s4u::Host::route_to ( Host dest,
std::vector< Link *> &  links,
double *  latency 
)

◆ route_to() [2/2]

void simgrid::s4u::Host::route_to ( Host dest,
std::vector< kernel::resource::LinkImpl *> &  links,
double *  latency 
)

◆ execute() [1/2]

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.

◆ exec_async()

ExecPtr simgrid::s4u::Host::exec_async ( double  flops_amounts)

Start an asynchronous computation on that host (possibly remote)

◆ execute() [2/2]

void simgrid::s4u::Host::execute ( double  flops,
double  priority 
)

Block the calling actor on an execution located on the called host (with explicit priority)

Member Data Documentation

◆ on_creation

simgrid::xbt::signal<void(Host&)> simgrid::s4u::Host::on_creation
static

◆ on_destruction

simgrid::xbt::signal<void(Host&)> simgrid::s4u::Host::on_destruction
static

◆ on_state_change

simgrid::xbt::signal<void(Host&)> simgrid::s4u::Host::on_state_change
static

◆ on_speed_change

simgrid::xbt::signal<void(Host&)> simgrid::s4u::Host::on_speed_change
static

◆ pimpl_cpu

surf::Cpu* simgrid::s4u::Host::pimpl_cpu = nullptr

DO NOT USE DIRECTLY (.

◆ pimpl_

surf::HostImpl* simgrid::s4u::Host::pimpl_ = nullptr

◆ pimpl_netpoint

kernel::routing::NetPoint* simgrid::s4u::Host::pimpl_netpoint = nullptr

DO NOT USE DIRECTLY (.


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