SimGrid  3.19.1
Versatile Simulation of Distributed Systems

Detailed Description

Host structure of MSG.

Functions

sg_host_tsg_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...
 
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...
 
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...
 
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...
 
int sg_host_get_nb_pstates (sg_host_t host)
 Return the total count of pstates defined for a host. More...
 
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...
 
int sg_host_core_count (sg_host_t host)
 Return the number of cores. 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...
 

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.

Host datatype.

Uses sg_host_count() to know the array size.

Returns
an array of sg_host_t containing all the hosts in the platform.
Remarks
The host order in this array is generally different from the creation/declaration order in the XML platform (we use a hash table internally).
See also
sg_host_count()

◆ sg_host_count()

size_t sg_host_count ( )

Return the current number of hosts.

Examples:
examples/s4u/platform-properties/s4u-platform-properties.cpp.

◆ 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_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_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.

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

◆ 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

Return the total count of pstates defined for a host.

See also Energy Plugin.

◆ 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

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

◆ 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_core_count()

int sg_host_core_count ( sg_host_t  host)

Return the number of cores.

Parameters
hosta host
Returns
the number of cores

◆ sg_host_turn_on()

void sg_host_turn_on ( sg_host_t  host)

Start the host if it is off.

See also sg_host_is_on() and sg_host_is_off() to test the current state of the host and Energy Plugin for more info on DVFS.

◆ sg_host_turn_off()

void sg_host_turn_off ( sg_host_t  host)

Stop the host if it is on.

See also MSG_host_is_on() and MSG_host_is_off() to test the current state of the host and Energy Plugin for more info on DVFS.

◆ sg_host_is_on()

int sg_host_is_on ( sg_host_t  host)

Determine if a host is up and running.

See also sg_host_turn_on() and sg_host_turn_off() to switch the host ON and OFF and Energy Plugin for more info on DVFS.

Parameters
hosthost to test
Returns
Returns true if the host is up and running, and false if it's currently down

◆ sg_host_is_off()

int sg_host_is_off ( sg_host_t  host)

Determine if a host is currently off.

See also sg_host_turn_on() and sg_host_turn_off() to switch the host ON and OFF and Energy Plugin for more info on DVFS.