SimGrid: Host Management Functions

SimGrid 3.10 Versatile Simulation of Distributed Systems

- Home page
- Online documentation
- Dev's Corner

All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
Functions
Host Management Functions
SIMIX

## Functions
smx_host_t | simcall_host_get_by_name (const char *name)
| Returns a host given its name.
const char * | simcall_host_get_name (smx_host_t host)
| Returns the name of a host.
xbt_dict_t | simcall_host_get_properties (smx_host_t host)
| Returns a dict of the properties assigned to a host.
xbt_dict_t | simcall_asr_get_properties (const char *name)
| Returns a dict of the properties assigned to a router or AS.
double | simcall_host_get_speed (smx_host_t host)
| Returns the speed of the processor.
int | simcall_host_get_core (smx_host_t host)
| Returns the number of core of the processor.
xbt_swag_t | simcall_host_get_process_list (smx_host_t host)
| Returns the list of processes attached to the host.
double | simcall_host_get_available_speed (smx_host_t host)
| Returns the available speed of the processor.
int | simcall_host_get_state (smx_host_t host)
| Returns the state of a host.
void * | simcall_host_get_data (smx_host_t host)
| Returns the user data associated to a host.
void | simcall_host_set_data (smx_host_t host, void *data)
| Sets the user data associated to a host.
double | simcall_host_get_current_power_peak (smx_host_t host)
| Returns the power peak of a host.
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.
int | simcall_host_get_nb_pstates (smx_host_t host)
| Returns the number of power states for a host.
void | simcall_host_set_power_peak_at (smx_host_t host, int pstate_index)
| Sets a new power peak for a host.
double | simcall_host_get_consumed_energy (smx_host_t host)
| Returns the total energy consumed by the host (in Joules)
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.
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.
void | simcall_host_execution_destroy (smx_action_t execution)
| Destroys an execution action.
void | simcall_host_execution_cancel (smx_action_t execution)
| Cancels an execution action.
double | simcall_host_execution_get_remains (smx_action_t execution)
| Returns how much of an execution action remains to be done.
e_smx_state_t | simcall_host_execution_get_state (smx_action_t execution)
| Returns the state of an execution action.
void | simcall_host_execution_set_priority (smx_action_t execution, double priority)
| Changes the priority of an execution action.
e_smx_state_t | simcall_host_execution_wait (smx_action_t execution)
| Waits for the completion of an execution action and destroy it.
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.

## 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

  name | The 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

  host | A 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

  host | A 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

  name | The 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

  host | A 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

  host | A 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

  host | A 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

  host | A 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

  host | SIMIX 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

  host | A SIMIX host
  data | The user data to set

double simcall_host_get_current_power_peak | ( | smx_host_t | host | ) |

Returns the power peak of a host.

Parameters

  host | A 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

  host | A SIMIX host
  pstate_index | pstate 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

  host | A 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

  host | A SIMIX host
  pstate_index | The 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

  host | A 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

  name | Name of the execution action to create
  host | SIMIX host where the action will be executed
  computation_amount | amount Computation amount (in bytes)
  priority | computation 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

  name | Name of the execution action to create
  host_nb | Number of hosts where the action will be executed
  host_list | Array (of size host_nb) of hosts where the action will be executed
  computation_amount | Array (of size host_nb) of computation amount of hosts (in bytes)
  communication_amount | Array (of size host_nb * host_nb) representing the communication amount between each pair of hosts
  amount | the SURF action amount
  rate | the 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

  execution | The 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

  execution | The 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

  execution | The 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

  execution | The 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

  execution | The execution action
  priority | The 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

  execution | The execution action