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

Functions

smx_host_t simcall_host_get_by_name (const char *name)
 Returns a host given its name. More...
 
const char * simcall_host_get_name (smx_host_t host)
 Returns the name of a host. More...
 
xbt_dict_t simcall_host_get_properties (smx_host_t host)
 Returns a dict of the properties assigned to a host. More...
 
xbt_dict_t simcall_asr_get_properties (const char *name)
 Returns a dict of the properties assigned to a router or AS. More...
 
double simcall_host_get_speed (smx_host_t host)
 Returns the speed of the processor. More...
 
int simcall_host_get_core (smx_host_t host)
 Returns the number of core of the processor. More...
 
xbt_swag_t simcall_host_get_process_list (smx_host_t host)
 Returns the list of processes attached to the host. More...
 
double simcall_host_get_available_speed (smx_host_t host)
 Returns the available speed of the processor. More...
 
int simcall_host_get_state (smx_host_t host)
 Returns the state of a host. More...
 
void * simcall_host_get_data (smx_host_t host)
 Returns the user data associated to a host. More...
 
void simcall_host_set_data (smx_host_t host, void *data)
 Sets the user data associated to a host. More...
 
double simcall_host_get_current_power_peak (smx_host_t host)
 Returns the power peak of a host. More...
 
double simcall_host_get_power_peak_at (smx_host_t host, int pstate_index)
 Returns one power peak (in flops/s) of a host at a given pstate. More...
 
int simcall_host_get_nb_pstates (smx_host_t host)
 Returns the number of power states for a host. More...
 
void simcall_host_set_power_peak_at (smx_host_t host, int pstate_index)
 Sets a new power peak for a host. More...
 
double simcall_host_get_consumed_energy (smx_host_t host)
 Returns the total energy consumed by the host (in Joules) More...
 
smx_action_t simcall_host_execute (const char *name, smx_host_t host, double computation_amount, double priority)
 Creates an action that executes some computation of an host. More...
 
smx_action_t simcall_host_parallel_execute (const char *name, int host_nb, smx_host_t *host_list, double *computation_amount, double *communication_amount, double amount, double rate)
 Creates an action that may involve parallel computation on several hosts and communication between them. More...
 
void simcall_host_execution_destroy (smx_action_t execution)
 Destroys an execution action. More...
 
void simcall_host_execution_cancel (smx_action_t execution)
 Cancels an execution action. More...
 
double simcall_host_execution_get_remains (smx_action_t execution)
 Returns how much of an execution action remains to be done. More...
 
e_smx_state_t simcall_host_execution_get_state (smx_action_t execution)
 Returns the state of an execution action. More...
 
void simcall_host_execution_set_priority (smx_action_t execution, double priority)
 Changes the priority of an execution action. More...
 
e_smx_state_t simcall_host_execution_wait (smx_action_t execution)
 Waits for the completion of an execution action and destroy it. More...
 
typedef xbt_dictelm_t smx_host_t
 Host datatypeA 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. More...
 

Detailed Description

Typedef Documentation

typedef xbt_dictelm_t smx_host_t

Host datatypeA 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.

See Also
Host Management Functions

Function Documentation

smx_host_t simcall_host_get_by_name ( const char *  name)

Returns a host given its name.

Parameters
nameThe name of the host to get
Returns
The corresponding host
const char* simcall_host_get_name ( smx_host_t  host)

Returns the name of a host.

Parameters
hostA SIMIX host
Returns
The name of this host
xbt_dict_t simcall_host_get_properties ( smx_host_t  host)

Returns a dict of the properties assigned to a host.

Parameters
hostA host
Returns
The properties of this host
xbt_dict_t simcall_asr_get_properties ( const char *  name)

Returns a dict of the properties assigned to a router or AS.

Parameters
nameThe name of the router or AS
Returns
The properties
double simcall_host_get_speed ( smx_host_t  host)

Returns the speed of the processor.

The speed returned does not take into account the current load on the machine.

Parameters
hostA SIMIX host
Returns
The speed of this host (in Mflop/s)
int simcall_host_get_core ( smx_host_t  host)

Returns the number of core of the processor.

Parameters
hostA SIMIX host
Returns
The number of core
xbt_swag_t simcall_host_get_process_list ( smx_host_t  host)

Returns the list of processes attached to the host.

Parameters
hostA SIMIX host
Returns
the swag of attached processes
double simcall_host_get_available_speed ( smx_host_t  host)

Returns the available speed of the processor.

Returns
Speed currently available (in Mflop/s)
int simcall_host_get_state ( smx_host_t  host)

Returns the state of a host.

Two states are possible: 1 if the host is active or 0 if it has crashed.

Parameters
hostA SIMIX host
Returns
1 if the host is available, 0 otherwise
void* simcall_host_get_data ( smx_host_t  host)

Returns the user data associated to a host.

Parameters
hostSIMIX host
Returns
the user data of this host
void simcall_host_set_data ( smx_host_t  host,
void *  data 
)

Sets the user data associated to a host.

The host must not have previous user data associated to it.

Parameters
hostA SIMIX host
dataThe user data to set
double simcall_host_get_current_power_peak ( smx_host_t  host)

Returns the power peak of a host.

Parameters
hostA SIMIX host
Returns
the current power peak value (double)
double simcall_host_get_power_peak_at ( smx_host_t  host,
int  pstate_index 
)

Returns one power peak (in flops/s) of a host at a given pstate.

Parameters
hostA SIMIX host
pstate_indexpstate to test
Returns
the current power peak value (double) for pstate_index
int simcall_host_get_nb_pstates ( smx_host_t  host)

Returns the number of power states for a host.

Parameters
hostA SIMIX host
Returns
the number of power states
void simcall_host_set_power_peak_at ( smx_host_t  host,
int  pstate_index 
)

Sets a new power peak for a host.

Parameters
hostA SIMIX host
pstate_indexThe pstate to which the CPU power will be set
Returns
void
double simcall_host_get_consumed_energy ( smx_host_t  host)

Returns the total energy consumed by the host (in Joules)

Parameters
hostA SIMIX host
Returns
the energy consumed by the host (double)
smx_action_t simcall_host_execute ( const char *  name,
smx_host_t  host,
double  computation_amount,
double  priority 
)

Creates an action that executes some computation of an host.

This function creates a SURF action and allocates the data necessary to create the SIMIX action. It can raise a host_error exception if the host crashed.

Parameters
nameName of the execution action to create
hostSIMIX host where the action will be executed
computation_amountamount Computation amount (in bytes)
prioritycomputation priority
Returns
A new SIMIX execution action
smx_action_t simcall_host_parallel_execute ( const char *  name,
int  host_nb,
smx_host_t host_list,
double *  computation_amount,
double *  communication_amount,
double  amount,
double  rate 
)

Creates an action that may involve parallel computation on several hosts and communication between them.

Parameters
nameName of the execution action to create
host_nbNumber of hosts where the action will be executed
host_listArray (of size host_nb) of hosts where the action will be executed
computation_amountArray (of size host_nb) of computation amount of hosts (in bytes)
communication_amountArray (of size host_nb * host_nb) representing the communication amount between each pair of hosts
amountthe SURF action amount
ratethe SURF action rate
Returns
A new SIMIX execution action
void simcall_host_execution_destroy ( smx_action_t  execution)

Destroys an execution action.

Destroys an action, freing its memory. This function cannot be called if there are a conditional waiting for it.

Parameters
executionThe execution action to destroy
void simcall_host_execution_cancel ( smx_action_t  execution)

Cancels an execution action.

This functions stops the execution. It calls a surf function.

Parameters
executionThe execution action to cancel
double simcall_host_execution_get_remains ( smx_action_t  execution)

Returns how much of an execution action remains to be done.

Parameters
executionThe execution action
Returns
The remaining amount
e_smx_state_t simcall_host_execution_get_state ( smx_action_t  execution)

Returns the state of an execution action.

Parameters
executionThe execution action
Returns
The state
void simcall_host_execution_set_priority ( smx_action_t  execution,
double  priority 
)

Changes the priority of an execution action.

This functions changes the priority only. It calls a surf function.

Parameters
executionThe execution action
priorityThe new priority
e_smx_state_t simcall_host_execution_wait ( smx_action_t  execution)

Waits for the completion of an execution action and destroy it.

Parameters
executionThe execution action