SimGrid  3.11
Versatile Simulation of Distributed Systems
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
Host Management Functions

This section describes the host structure of MSG. More...

Typedefs

typedef xbt_dictelm_t msg_host_t
 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.
 

Functions

msg_error_t MSG_host_set_data (msg_host_t host, void *data)
 Set the user data of a msg_host_t. More...
 
void * MSG_host_get_data (msg_host_t host)
 Return the user data of a msg_host_t. More...
 
const char * MSG_host_get_name (msg_host_t host)
 Return the name of the msg_host_t. More...
 
msg_host_t MSG_host_self (void)
 Return the location on which the current process is executed.
 
int MSG_get_host_number (void)
 Return the current number MSG hosts.
 
xbt_dynar_t MSG_hosts_as_dynar (void)
 Return a dynar containing all the hosts declared at a given point of time.
 
int MSG_get_host_msgload (msg_host_t h)
 Return the number of MSG tasks currently running on a msg_host_t. The external load is not taken in account.
 
double MSG_get_host_speed (msg_host_t h)
 Return the speed of the processor (in flop/s), regardless of the current load on the machine.
 
int MSG_host_get_core_number (msg_host_t host)
 Return the number of cores. More...
 
xbt_swag_t MSG_host_get_process_list (msg_host_t host)
 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, void_f_pvoid_t free_ctn)
 Change the value of a given host property. More...
 
void MSG_host_set_params (msg_host_t host, ws_params_t params)
 Set the parameters of a given host. More...
 
void MSG_host_get_params (msg_host_t host, ws_params_t params)
 Get the parameters of a given host. More...
 
double MSG_get_host_power_peak_at (msg_host_t host, int pstate_index)
 Return the speed of the processor (in flop/s) at a given pstate. More...
 
double MSG_get_host_current_power_peak (msg_host_t host)
 Return the current speed of the processor (in flop/s) More...
 
int MSG_get_host_nb_pstates (msg_host_t host)
 Return the number of pstates defined for a host. More...
 
void MSG_set_host_power_peak_at (msg_host_t host, int pstate_index)
 Sets the speed of the processor (in flop/s) at a given pstate. More...
 
double MSG_get_host_consumed_energy (msg_host_t host)
 Return the total energy consumed by a host (in Joules) 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...
 
void MSG_vm_set_property_value (msg_vm_t vm, const char *name, void *value, void_f_pvoid_t free_ctn)
 Change the value of a given host property. More...
 

Detailed Description

This section describes the 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

Function Documentation

msg_error_t MSG_host_set_data ( msg_host_t  host,
void *  data 
)

Set the user data of a msg_host_t.

This functions checks whether some data has already been associated to host or not and attach data to host if it is possible.

void* MSG_host_get_data ( msg_host_t  host)

Return the user data of a msg_host_t.

This functions checks whether host is a valid pointer or not and return the user data associated to host if it is possible.

const char* MSG_host_get_name ( msg_host_t  host)

Return the name of the msg_host_t.

This functions checks whether host is a valid pointer or not and return its name.

int MSG_host_get_core_number ( msg_host_t  host)

Return the number of cores.

Parameters
hosta host
Returns
the number of cores
xbt_swag_t MSG_host_get_process_list ( msg_host_t  host)

Return the list of processes attached to an host.

Parameters
hosta host
Returns
a swag with the attached processes
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 NULL if property not set)
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
void MSG_host_set_property_value ( msg_host_t  host,
const char *  name,
char *  value,
void_f_pvoid_t  free_ctn 
)

Change the value of a given host property.

Parameters
hosta host
namea property name
valuewhat to change the property to
free_ctnthe freeing function to use to kill the value on need
void MSG_host_set_params ( msg_host_t  host,
ws_params_t  params 
)

Set the parameters of a given host.

Parameters
hosta host
paramsa prameter object
void MSG_host_get_params ( msg_host_t  host,
ws_params_t  params 
)

Get the parameters of a given host.

Parameters
hosta host
paramsa prameter object
double MSG_get_host_power_peak_at ( msg_host_t  host,
int  pstate_index 
)

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

Parameters
hosthost to test
pstate_indexpstate to test
Returns
Returns the processor speed associated with pstate_index
double MSG_get_host_current_power_peak ( msg_host_t  host)

Return the current speed of the processor (in flop/s)

Parameters
hosthost to test
Returns
Returns the current processor speed
int MSG_get_host_nb_pstates ( msg_host_t  host)

Return the number of pstates defined for a host.

Parameters
hosthost to test
void MSG_set_host_power_peak_at ( msg_host_t  host,
int  pstate_index 
)

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

Parameters
hosthost to test
pstate_indexpstate to switch to
double MSG_get_host_consumed_energy ( msg_host_t  host)

Return the total energy consumed by a host (in Joules)

Parameters
hosthost to test
Returns
Returns the consumed energy
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)
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
void MSG_vm_set_property_value ( msg_vm_t  vm,
const char *  name,
void *  value,
void_f_pvoid_t  free_ctn 
)

Change the value of a given host property.

Parameters
vma vm
namea property name
valuewhat to change the property to
free_ctnthe freeing function to use to kill the value on need