SimGrid  3.19.1
Versatile Simulation of Distributed Systems
host.cpp File Reference
#include <algorithm>
#include <vector>
#include "simgrid/host.h"
#include "simgrid/s4u/Engine.hpp"
#include "simgrid/s4u/Host.hpp"
#include "xbt/Extendable.hpp"
#include "xbt/dict.h"
#include "simgrid/kernel/routing/NetPoint.hpp"
#include "src/simix/smx_host_private.hpp"
#include "src/surf/HostImpl.hpp"
#include "src/surf/cpu_interface.hpp"

Functions

 XBT_LOG_NEW_DEFAULT_SUBCATEGORY (sg_host, sd, "Logging specific to sg_hosts")
 
size_t sg_host_count ()
 Return the current number of hosts. More...
 
sg_host_tsg_host_list ()
 Returns the host list. More...
 
const char * sg_host_get_name (sg_host_t host)
 Return the name of the sg_host_t. More...
 
voidsg_host_extension_get (sg_host_t host, size_t ext)
 
size_t sg_host_extension_create (void(*deleter)(void *))
 
sg_host_t sg_host_by_name (const char *name)
 Finds a sg_host_t using its name. More...
 
static int hostcmp_voidp (const void *pa, const void *pb)
 
xbt_dynar_t sg_hosts_as_dynar ()
 Return a dynar containing all the hosts declared at a given point of time (including VMs) More...
 
voidsg_host_user (sg_host_t host)
 Return the user data of a sg_host_t. More...
 
void sg_host_user_set (sg_host_t host, void *userdata)
 Set the user data of a sg_host_t. More...
 
void sg_host_user_destroy (sg_host_t host)
 
xbt_dict_t sg_host_get_mounted_storage_list (sg_host_t host)
 Return the list of mount point names on an host. More...
 
xbt_dynar_t sg_host_get_attached_storage_list (sg_host_t host)
 Return the list of storages attached to an host. More...
 
double sg_host_speed (sg_host_t host)
 Returns the total speed of a host. More...
 
double sg_host_get_pstate_speed (sg_host_t host, int pstate_index)
 Return the speed of the processor (in flop/s) at a given pstate. More...
 
int sg_host_core_count (sg_host_t host)
 Return the number of cores. More...
 
double sg_host_get_available_speed (sg_host_t host)
 
int sg_host_get_nb_pstates (sg_host_t host)
 Returns the number of power states for a host. More...
 
int sg_host_get_pstate (sg_host_t host)
 Gets the pstate at which that host currently runs. More...
 
void sg_host_set_pstate (sg_host_t host, int pstate)
 Sets the pstate at which that host should run. More...
 
void sg_host_turn_on (sg_host_t host)
 Start the host if it is off. More...
 
void sg_host_turn_off (sg_host_t host)
 Stop the host if it is on. More...
 
int sg_host_is_on (sg_host_t host)
 Determine if a host is up and running. More...
 
int sg_host_is_off (sg_host_t host)
 Determine if a host is currently off. More...
 
xbt_dict_t sg_host_get_properties (sg_host_t host)
 Get the properties of an host. More...
 
const char * sg_host_get_property_value (sg_host_t host, const char *name)
 Returns the value of a given host property. More...
 
void sg_host_set_property_value (sg_host_t host, const char *name, const char *value)
 Change the value of a given host property. More...
 
void sg_host_route (sg_host_t from, sg_host_t to, xbt_dynar_t links)
 Find a route between two hosts. More...
 
double sg_host_route_latency (sg_host_t from, sg_host_t to)
 Find the latency of the route between two hosts. More...
 
double sg_host_route_bandwidth (sg_host_t from, sg_host_t to)
 Find the bandwitdh of the route between two hosts. More...
 
void sg_host_dump (sg_host_t host)
 Displays debugging information about a host. More...
 
void sg_host_get_actor_list (sg_host_t host, xbt_dynar_t whereto)
 Return the list of actors attached to an host. More...
 
sg_host_t sg_host_self ()
 Return the location on which a process is running. More...
 

Function Documentation

◆ XBT_LOG_NEW_DEFAULT_SUBCATEGORY()

XBT_LOG_NEW_DEFAULT_SUBCATEGORY ( sg_host  ,
sd  ,
"Logging specific to sg_hosts"   
)

◆ sg_host_extension_get()

void* sg_host_extension_get ( sg_host_t  host,
size_t  ext 
)

◆ sg_host_extension_create()

size_t sg_host_extension_create ( void(*)(void *)  deleter)

◆ hostcmp_voidp()

static int hostcmp_voidp ( const void pa,
const void pb 
)
static

◆ sg_host_user_destroy()

void sg_host_user_destroy ( sg_host_t  host)

◆ sg_host_get_pstate_speed()

double sg_host_get_pstate_speed ( sg_host_t  host,
int  pstate_index 
)

Return the speed of the processor (in flop/s) at a given pstate.

See also Energy Plugin.

Parameters
hosthost to test
pstate_indexpstate to test
Returns
Returns the processor speed associated with pstate_index

◆ sg_host_get_available_speed()

double sg_host_get_available_speed ( sg_host_t  host)

◆ sg_host_get_pstate()

int sg_host_get_pstate ( sg_host_t  host)

Gets the pstate at which that host currently runs.

See also Energy Plugin.

◆ sg_host_set_pstate()

void sg_host_set_pstate ( sg_host_t  host,
int  pstate 
)

Sets the pstate at which that host should run.

See also Energy Plugin.

◆ sg_host_route()

void sg_host_route ( sg_host_t  from,
sg_host_t  to,
xbt_dynar_t  links 
)

Find a route between two hosts.

Parameters
fromwhere from
towhere to
links[OUT] where to store the list of links (must exist, cannot be nullptr).

◆ sg_host_route_latency()

double sg_host_route_latency ( sg_host_t  from,
sg_host_t  to 
)

Find the latency of the route between two hosts.

Parameters
fromwhere from
towhere to

◆ sg_host_route_bandwidth()

double sg_host_route_bandwidth ( sg_host_t  from,
sg_host_t  to 
)

Find the bandwitdh of the route between two hosts.

Parameters
fromwhere from
towhere to

◆ sg_host_dump()

void sg_host_dump ( sg_host_t  host)

Displays debugging information about a host.

◆ sg_host_get_actor_list()

void sg_host_get_actor_list ( sg_host_t  host,
xbt_dynar_t  whereto 
)

Return the list of actors attached to an host.

Parameters
hosta host
wheretoa dynar in which we should push actors living on that host