SimGrid: Workstations

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
Workstations
SimDag

Functions for managing the workstations. More...

## Functions
SD_workstation_t | SD_workstation_get_by_name (const char *name)
| Returns a workstation given its name.
const SD_workstation_t * | SD_workstation_get_list (void)
| Returns the workstation list.
int | SD_workstation_get_number (void)
| Returns the number of workstations.
void | SD_workstation_set_data (SD_workstation_t workstation, void *data)
| Sets the user data of a workstation.
void * | SD_workstation_get_data (SD_workstation_t workstation)
| Returns the user data of a workstation.
const char * | SD_workstation_get_name (SD_workstation_t workstation)
| Returns the name of a workstation.
xbt_dict_t | SD_workstation_get_properties (SD_workstation_t workstation)
| Returns a xbt_dict_t consisting of the list of properties assigned to this workstation.
const char * | SD_workstation_get_property_value (SD_workstation_t workstation, const char *name)
| Returns the value of a given workstation property.
void | SD_workstation_dump (SD_workstation_t ws)
| Displays debugging informations about a workstation.
const SD_link_t * | SD_route_get_list (SD_workstation_t src, SD_workstation_t dst)
| Returns the route between two workstations.
int | SD_route_get_size (SD_workstation_t src, SD_workstation_t dst)
| Returns the number of links on the route between two workstations.
double | SD_workstation_get_power (SD_workstation_t workstation)
| Returns the total power of a workstation.
double | SD_workstation_get_available_power (SD_workstation_t workstation)
| Returns the proportion of available power in a workstation.
e_SD_workstation_access_mode_t | SD_workstation_get_access_mode (SD_workstation_t workstation)
| Returns the access mode of this workstation.
void | SD_workstation_set_access_mode (SD_workstation_t workstation, e_SD_workstation_access_mode_t access_mode)
| Sets the access mode for the tasks that will be executed on a workstation.
double | SD_workstation_get_computation_time (SD_workstation_t workstation, double computation_amount)
| Returns an approximative estimated time for the given computation amount on a workstation.
double | SD_route_get_current_latency (SD_workstation_t src, SD_workstation_t dst)
| Returns the latency of the route between two workstations, i.e. the sum of all link latencies between the workstations.
double | SD_route_get_current_bandwidth (SD_workstation_t src, SD_workstation_t dst)
| Returns the bandwidth of the route between two workstations, i.e. the minimum link bandwidth of all between the workstations.
double | SD_route_get_communication_time (SD_workstation_t src, SD_workstation_t dst, double communication_amount)
| Returns an approximative estimated time for the given communication amount between two workstations.
SD_task_t | SD_workstation_get_current_task (SD_workstation_t workstation)
| Returns the kind of the task currently running on a workstation Only call this with sequential access mode set.
xbt_dict_t | SD_workstation_get_storage_list (SD_workstation_t workstation)
| Return the list of mounted storages on a workstation.

## Detailed Description

Functions for managing the workstations.

This section describes the functions for managing the workstations.

A workstation is a place where a task can be executed. A workstation is represented as a physical resource with computing capabilities and has a name.

The workstations are created when you call the function SD_create_environment.

See Also
  SD_workstation_t

## Function Documentation

SD_workstation_t SD_workstation_get_by_name | ( | const char * | name | ) |

Returns a workstation given its name.

If there is no such workstation, the function returns `NULL`.

Parameters

  name | workstation name

Returns
  the workstation, or `NULL` if there is no such workstation

const SD_workstation_t* SD_workstation_get_list | ( | void |  | ) |

Returns the workstation list.

Use SD_workstation_get_number() to know the array size.

Returns
  an array of SD_workstation_t containing all workstations

See Also
  SD_workstation_get_number()

int SD_workstation_get_number | ( | void |  | ) |

Returns the number of workstations.

Returns
  the number of existing workstations

See Also
  SD_workstation_get_list()

void SD_workstation_set_data | ( | SD_workstation_t | workstation,
|  | void * | data
| ) |  |

Sets the user data of a workstation.

The new data can be `NULL`. The old data should have been freed first if it was not `NULL`.

Parameters

  workstation | a workstation
  data | the new data you want to associate with this workstation

See Also
  SD_workstation_get_data()

void* SD_workstation_get_data | ( | SD_workstation_t | workstation | ) |

Returns the user data of a workstation.

Parameters

  workstation | a workstation

Returns
  the user data associated with this workstation (can be `NULL`)

See Also
  SD_workstation_set_data()

const char* SD_workstation_get_name | ( | SD_workstation_t | workstation | ) |

Returns the name of a workstation.

Parameters

  workstation | a workstation

Returns
  the name of this workstation (cannot be `NULL`)

xbt_dict_t SD_workstation_get_properties | ( | SD_workstation_t | workstation | ) |

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

Parameters

  workstation | a workstation

Returns
  the dictionary containing the properties associated with the workstation

const char* SD_workstation_get_property_value | ( | SD_workstation_t | ws,
|  | const char * | name
| ) |  |

Returns the value of a given workstation property.

Parameters

  ws | a workstation
  name | a property name

Returns
  value of a property (or NULL if property not set)

const SD_link_t* SD_route_get_list | ( | SD_workstation_t | src,
|  | SD_workstation_t | dst
| ) |  |

Returns the route between two workstations.

Use SD_route_get_size() to know the array size.

Parameters

  src | a workstation
  dst | another workstation

Returns
  a new array of SD_link_t representating the route between these two workstations

See Also
  SD_route_get_size(), SD_link_t

int SD_route_get_size | ( | SD_workstation_t | src,
|  | SD_workstation_t | dst
| ) |  |

Returns the number of links on the route between two workstations.

Parameters

  src | a workstation
  dst | another workstation

Returns
  the number of links on the route between these two workstations

See Also
  SD_route_get_list()

double SD_workstation_get_power | ( | SD_workstation_t | workstation | ) |

Returns the total power of a workstation.

Parameters

  workstation | a workstation

Returns
  the total power of this workstation

See Also
  SD_workstation_get_available_power()

double SD_workstation_get_available_power | ( | SD_workstation_t | workstation | ) |

Returns the proportion of available power in a workstation.

Parameters

  workstation | a workstation

Returns
  the proportion of power currently available in this workstation (normally a number between 0 and 1)

See Also
  SD_workstation_get_power()

e_SD_workstation_access_mode_t SD_workstation_get_access_mode | ( | SD_workstation_t | workstation | ) |

Returns the access mode of this workstation.

Parameters

  workstation | a workstation

Returns
  the access mode for the tasks running on this workstation: SD_WORKSTATION_SHARED_ACCESS or SD_WORKSTATION_SEQUENTIAL_ACCESS

See Also
  SD_workstation_set_access_mode(), e_SD_workstation_access_mode_t

void SD_workstation_set_access_mode | ( | SD_workstation_t | workstation,
|  | e_SD_workstation_access_mode_t | access_mode
| ) |  |

Sets the access mode for the tasks that will be executed on a workstation.

By default, a workstation model is shared, i.e. several tasks can be executed at the same time on a workstation. The CPU power of the workstation is shared between the running tasks on the workstation. In sequential mode, only one task can use the workstation, and the other tasks wait in a FIFO.

Parameters

  workstation | a workstation
  access_mode | the access mode you want to set to this workstation: SD_WORKSTATION_SHARED_ACCESS or SD_WORKSTATION_SEQUENTIAL_ACCESS

See Also
  SD_workstation_get_access_mode(), e_SD_workstation_access_mode_t

double SD_workstation_get_computation_time | ( | SD_workstation_t | workstation,
|  | double | computation_amount
| ) |  |

Returns an approximative estimated time for the given computation amount on a workstation.

Parameters

  workstation | a workstation
  computation_amount | the computation amount you want to evaluate (in flops)

Returns
  an approximative estimated computation time for the given computation amount on this workstation (in seconds)

double SD_route_get_current_latency | ( | SD_workstation_t | src,
|  | SD_workstation_t | dst
| ) |  |

Returns the latency of the route between two workstations, i.e. the sum of all link latencies between the workstations.

Parameters

  src | the first workstation
  dst | the second workstation

Returns
  the latency of the route between the two workstations (in seconds)

See Also
  SD_route_get_current_bandwidth()

double SD_route_get_current_bandwidth | ( | SD_workstation_t | src,
|  | SD_workstation_t | dst
| ) |  |

Returns the bandwidth of the route between two workstations, i.e. the minimum link bandwidth of all between the workstations.

Parameters

  src | the first workstation
  dst | the second workstation

Returns
  the bandwidth of the route between the two workstations (in bytes/second)

See Also
  SD_route_get_current_latency()

double SD_route_get_communication_time | ( | SD_workstation_t | src,
|  | SD_workstation_t | dst,
|  | double | communication_amount
| ) |  |

Returns an approximative estimated time for the given communication amount between two workstations.

Parameters

  src | the first workstation
  dst | the second workstation
  communication_amount | the communication amount you want to evaluate (in bytes)

Returns
  an approximative estimated computation time for the given communication amount between the workstations (in seconds)

SD_task_t SD_workstation_get_current_task | ( | SD_workstation_t | workstation | ) |

Returns the kind of the task currently running on a workstation Only call this with sequential access mode set.

Parameters

  workstation | a workstation

xbt_dict_t SD_workstation_get_storage_list | ( | SD_workstation_t | workstation | ) |

Return the list of mounted storages on a workstation.

Parameters

  workstation | a workstation

Returns
  a dynar containing all mounted storages on the workstation