SimGrid  3.21
Versatile Simulation of Distributed Systems
host.h File Reference
#include <xbt/dict.h>
#include <xbt/dynar.h>
#include <simgrid/forward.h>

Functions

sg_host_t * sg_host_list ()
 Host datatype. More...
 
size_t sg_host_count ()
 Return the current number of hosts. More...
 
xbt_dynar_t sg_hosts_as_dynar ()
 Return a dynar containing all the hosts declared at a given point of time (including VMs) More...
 
size_t sg_host_extension_create (void(*deleter)(void *))
 
void * sg_host_extension_get (sg_host_t host, size_t rank)
 
sg_host_t sg_host_by_name (const char *name)
 Finds a sg_host_t using its name. More...
 
const char * sg_host_get_name (sg_host_t host)
 Return the name of the #sg_host_t. More...
 
void * sg_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)
 Return the speed of the processor (in flop/s), regardless of the current load on the machine. More...
 
double sg_host_get_pstate_speed (sg_host_t host, int pstate_index)
 
double sg_host_get_available_speed (sg_host_t host)
 
int sg_host_core_count (sg_host_t host)
 
sg_host_t sg_host_self ()
 Return the location on which a process is running. More...
 
const char * sg_host_self_get_name ()
 
int sg_host_get_nb_pstates (sg_host_t host)
 Return the total count of pstates defined for a host. More...
 
int sg_host_get_pstate (sg_host_t host)
 
void sg_host_set_pstate (sg_host_t host, int pstate)
 
void sg_host_turn_on (sg_host_t host)
 
void sg_host_turn_off (sg_host_t host)
 
int sg_host_is_on (sg_host_t host)
 
int sg_host_is_off (sg_host_t host)
 
xbt_dict_t sg_host_get_properties (sg_host_t host)
 Returns a xbt_dict_t consisting of the list of properties assigned to this 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)
 
double sg_host_route_latency (sg_host_t from, sg_host_t to)
 
double sg_host_route_bandwidth (sg_host_t from, sg_host_t to)
 
void sg_host_dump (sg_host_t ws)
 
void sg_host_get_actor_list (sg_host_t host, xbt_dynar_t whereto)
 

Function Documentation

◆ sg_host_list()

sg_host_t* sg_host_list ( )

Host datatype.

A location (or host) is any possible place where an actor may run. Thus it is represented as a physical resource with computing capabilities, some mailboxes to enable running actors to communicate with remote ones, and some private data that can be only accessed by local actors.

◆ sg_host_count()

size_t sg_host_count ( )

Return the current number of hosts.

◆ sg_hosts_as_dynar()

xbt_dynar_t sg_hosts_as_dynar ( )

Return a dynar containing all the hosts declared at a given point of time (including VMs)

Remarks
The host order in the returned array is generally different from the host creation/declaration order in the XML platform (we use a hash table internally)

◆ sg_host_extension_create()

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

◆ sg_host_extension_get()

void* sg_host_extension_get ( sg_host_t  host,
size_t  rank 
)

◆ sg_host_by_name()

sg_host_t sg_host_by_name ( const char *  name)

Finds a sg_host_t using its name.

This is a name directory service

Parameters
namethe name of an host.
Returns
the corresponding host

◆ sg_host_get_name()

const char* sg_host_get_name ( sg_host_t  host)

Return the name of the #sg_host_t.

◆ sg_host_user()

void* sg_host_user ( sg_host_t  host)

Return the user data of a #sg_host_t.

This functions returns the user data associated to host if it is possible.

◆ sg_host_user_set()

void sg_host_user_set ( sg_host_t  host,
void *  userdata 
)

Set the user data of a #sg_host_t.

This functions attach data to host if it is possible.

◆ sg_host_user_destroy()

void sg_host_user_destroy ( sg_host_t  host)

◆ sg_host_get_mounted_storage_list()

xbt_dict_t sg_host_get_mounted_storage_list ( sg_host_t  host)

Return the list of mount point names on an host.

Parameters
hosta host
Returns
a dict containing all mount point on the host (mount_name => sg_storage_t)

◆ sg_host_get_attached_storage_list()

xbt_dynar_t sg_host_get_attached_storage_list ( sg_host_t  host)

Return the list of storages attached to an host.

Parameters
hosta host
Returns
a dynar containing all storages (name) attached to the host

◆ sg_host_speed()

double sg_host_speed ( sg_host_t  host)

Return the speed of the processor (in flop/s), regardless of the current load on the machine.

◆ sg_host_get_pstate_speed()

double sg_host_get_pstate_speed ( sg_host_t  host,
int  pstate_index 
)

◆ sg_host_get_available_speed()

double sg_host_get_available_speed ( sg_host_t  host)

◆ sg_host_core_count()

int sg_host_core_count ( sg_host_t  host)

◆ sg_host_self()

sg_host_t sg_host_self ( )

Return the location on which a process is running.

Returns
the sg_host_t corresponding to the location on which process is running.

◆ sg_host_self_get_name()

const char* sg_host_self_get_name ( )

◆ sg_host_get_nb_pstates()

int sg_host_get_nb_pstates ( sg_host_t  host)

Return the total count of pstates defined for a host.

See also Energy Plugin.

Parameters
hosthost to test

◆ sg_host_get_pstate()

int sg_host_get_pstate ( sg_host_t  host)

◆ sg_host_set_pstate()

void sg_host_set_pstate ( sg_host_t  host,
int  pstate 
)

◆ sg_host_turn_on()

void sg_host_turn_on ( sg_host_t  host)

◆ sg_host_turn_off()

void sg_host_turn_off ( sg_host_t  host)

◆ sg_host_is_on()

int sg_host_is_on ( sg_host_t  host)

◆ sg_host_is_off()

int sg_host_is_off ( sg_host_t  host)

◆ sg_host_get_properties()

xbt_dict_t sg_host_get_properties ( sg_host_t  host)

Returns a xbt_dict_t consisting of the list of properties assigned to this host.

Parameters
hosta host
Returns
a dict containing the properties

◆ sg_host_get_property_value()

const char* sg_host_get_property_value ( sg_host_t  host,
const char *  name 
)

Returns the value of a given host property.

Parameters
hosta host
namea property name
Returns
value of a property (or nullptr if property not set)

◆ sg_host_set_property_value()

void sg_host_set_property_value ( sg_host_t  host,
const char *  name,
const char *  value 
)

Change the value of a given host property.

Parameters
hosta host
namea property name
valuewhat to change the property to

◆ sg_host_route()

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

◆ sg_host_route_latency()

double sg_host_route_latency ( sg_host_t  from,
sg_host_t  to 
)

◆ sg_host_route_bandwidth()

double sg_host_route_bandwidth ( sg_host_t  from,
sg_host_t  to 
)

◆ sg_host_dump()

void sg_host_dump ( sg_host_t  ws)

◆ sg_host_get_actor_list()

void sg_host_get_actor_list ( sg_host_t  host,
xbt_dynar_t  whereto 
)