SimGrid  3.16
Versatile Simulation of Distributed Systems
Host Management Functions

Detailed Description

Host structure of MSG.

(msg_host_t) and the functions for managing it.

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

See also
msg_host_t

Macros

#define MSG_host_get_name(host)   sg_host_get_name(host)
 Return the name of the msg_host_t. More...
 
#define MSG_host_get_name(host)   sg_host_get_name(host)
 Return the name of the msg_host_t. More...
 

Typedefs

typedef sg_host_t msg_host_t
 Host datatype. More...
 
typedef sg_host_t msg_host_t
 Host datatype. More...
 

Functions

msg_host_t MSG_host_by_name (const char *name)
 Finds a msg_host_t using its name. More...
 
msg_error_t MSG_host_set_data (msg_host_t host, void *data)
 Set the user data of a msg_host_t. More...
 
voidMSG_host_get_data (msg_host_t host)
 Return the user data of a msg_host_t. More...
 
msg_host_t MSG_host_self ()
 Return the location on which the current process is executed. More...
 
void MSG_host_on (msg_host_t host)
 Start the host if it is off. More...
 
void MSG_host_off (msg_host_t host)
 Stop the host if it is on. More...
 
int MSG_get_host_number ()
 Return the current number MSG hosts. More...
 
xbt_dynar_t MSG_hosts_as_dynar ()
 Return a dynar containing all the hosts declared at a given point of time (including VMs) More...
 
double MSG_host_get_speed (msg_host_t host)
 Return the speed of the processor (in flop/s), regardless of the current load on the machine. More...
 
double MSG_get_host_speed (msg_host_t host)
 Return the speed of the processor (in flop/s), regardless of the current load on the machine. More...
 
int MSG_host_get_core_number (msg_host_t host)
 Return the number of cores. More...
 
void MSG_host_get_process_list (msg_host_t host, xbt_dynar_t whereto)
 Return the list of processes attached to an host. More...
 
const char * MSG_host_get_property_value (msg_host_t host, const char *name)
 Returns the value of a given host property. More...
 
xbt_dict_t MSG_host_get_properties (msg_host_t host)
 Returns a xbt_dict_t consisting of the list of properties assigned to this host. More...
 
void MSG_host_set_property_value (msg_host_t host, const char *name, char *value)
 Change the value of a given host property. More...
 
int MSG_host_is_on (msg_host_t host)
 Determine if a host is up and running. More...
 
int MSG_host_is_off (msg_host_t host)
 Determine if a host is currently off. More...
 
double MSG_host_get_power_peak_at (msg_host_t host, int pstate_index)
 Return the speed of the processor (in flop/s) at a given pstate. More...
 
int MSG_host_get_nb_pstates (msg_host_t host)
 Return the total count of pstates defined for a host. More...
 
xbt_dict_t MSG_host_get_mounted_storage_list (msg_host_t host)
 Return the list of mount point names on an host. More...
 
xbt_dynar_t MSG_host_get_attached_storage_list (msg_host_t host)
 Return the list of storages attached to an host. More...
 
xbt_dict_t MSG_host_get_storage_content (msg_host_t host)
 Return the content of mounted storages on an host. More...
 
voidMSG_storage_get_data (msg_storage_t storage)
 Returns the user data of a msg_storage_t. More...
 
const char * sg_host_get_property_value (sg_host_t host, const char *name)
 Returns the value of a given host property. More...
 

Macro Definition Documentation

◆ MSG_host_get_name [1/2]

◆ MSG_host_get_name [2/2]

#define MSG_host_get_name (   host)    sg_host_get_name(host)

Return the name of the msg_host_t.

Typedef Documentation

◆ msg_host_t [1/2]

Host datatype.

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

◆ msg_host_t [2/2]

Host datatype.

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

Function Documentation

◆ MSG_host_by_name()

msg_host_t MSG_host_by_name ( const char *  name)

Finds a msg_host_t using its name.

This is a name directory service

Parameters
namethe name of an host.
Returns
the corresponding host

◆ MSG_host_set_data()

msg_error_t MSG_host_set_data ( msg_host_t  host,
void data 
)

Set the user data of a msg_host_t.

This functions attach data to host if it is possible.

◆ MSG_host_get_data()

void* MSG_host_get_data ( msg_host_t  host)

Return the user data of a msg_host_t.

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

◆ MSG_host_self()

msg_host_t MSG_host_self ( )

Return the location on which the current process is executed.

◆ MSG_host_on()

void MSG_host_on ( msg_host_t  host)

Start the host if it is off.

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.

◆ MSG_host_off()

void MSG_host_off ( msg_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.

◆ MSG_get_host_number()

int MSG_get_host_number ( )

Return the current number MSG hosts.

◆ MSG_hosts_as_dynar()

xbt_dynar_t MSG_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)

◆ MSG_host_get_speed()

double MSG_host_get_speed ( msg_host_t  host)

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

◆ MSG_get_host_speed()

double MSG_get_host_speed ( msg_host_t  host)

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

Deprecated: use MSG_host_get_speed

◆ MSG_host_get_core_number()

int MSG_host_get_core_number ( msg_host_t  host)

Return the number of cores.

Parameters
hosta host
Returns
the number of cores

◆ MSG_host_get_process_list()

void MSG_host_get_process_list ( msg_host_t  host,
xbt_dynar_t  whereto 
)

Return the list of processes attached to an host.

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

◆ MSG_host_get_property_value()

const char* MSG_host_get_property_value ( msg_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)

◆ MSG_host_get_properties()

xbt_dict_t MSG_host_get_properties ( msg_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

◆ MSG_host_set_property_value()

void MSG_host_set_property_value ( msg_host_t  host,
const char *  name,
char *  value 
)

Change the value of a given host property.

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

◆ MSG_host_is_on()

int MSG_host_is_on ( msg_host_t  host)

Determine if a host is up and running.

See also MSG_host_on() and MSG_host_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

◆ MSG_host_is_off()

int MSG_host_is_off ( msg_host_t  host)

Determine if a host is currently off.

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

◆ MSG_host_get_power_peak_at()

double MSG_host_get_power_peak_at ( msg_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

◆ MSG_host_get_nb_pstates()

int MSG_host_get_nb_pstates ( msg_host_t  host)

Return the total count of pstates defined for a host.

See also Energy Plugin.

Parameters
hosthost to test

◆ MSG_host_get_mounted_storage_list()

xbt_dict_t MSG_host_get_mounted_storage_list ( msg_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 => msg_storage_t)

◆ MSG_host_get_attached_storage_list()

xbt_dynar_t MSG_host_get_attached_storage_list ( msg_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

◆ MSG_host_get_storage_content()

xbt_dict_t MSG_host_get_storage_content ( msg_host_t  host)

Return the content of mounted storages on an host.

Parameters
hosta host
Returns
a dict containing content (as a dict) of all storages mounted on the host

◆ MSG_storage_get_data()

void* MSG_storage_get_data ( msg_storage_t  storage)

Returns the user data of a msg_storage_t.

This functions checks whether storage is a valid pointer and returns its associate user data if possible.

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