SimGrid
3.10
Versatile Simulation of Distributed Systems
|
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. |
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.
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
.
name | workstation name |
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.
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.
The new data can be NULL
. The old data should have been freed first if it was not NULL
.
workstation | a workstation |
data | the new data you want to associate with this workstation |
void* SD_workstation_get_data | ( | SD_workstation_t | workstation | ) |
Returns the user data of a workstation.
workstation | a workstation |
NULL
) const char* SD_workstation_get_name | ( | SD_workstation_t | workstation | ) |
Returns the name of a workstation.
workstation | a workstation |
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.
workstation | a workstation |
const char* SD_workstation_get_property_value | ( | SD_workstation_t | ws, |
const char * | name | ||
) |
Returns the value of a given workstation property.
ws | a workstation |
name | a property name |
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.
src | a workstation |
dst | another workstation |
int SD_route_get_size | ( | SD_workstation_t | src, |
SD_workstation_t | dst | ||
) |
Returns the number of links on the route between two workstations.
src | a workstation |
dst | another workstation |
double SD_workstation_get_power | ( | SD_workstation_t | workstation | ) |
Returns the total power of a workstation.
workstation | a workstation |
double SD_workstation_get_available_power | ( | SD_workstation_t | workstation | ) |
Returns the proportion of available power in a workstation.
workstation | a workstation |
e_SD_workstation_access_mode_t SD_workstation_get_access_mode | ( | SD_workstation_t | workstation | ) |
Returns the access mode of this workstation.
workstation | a 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.
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.
workstation | a workstation |
access_mode | the access mode you want to set to this workstation: SD_WORKSTATION_SHARED_ACCESS or SD_WORKSTATION_SEQUENTIAL_ACCESS |
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.
workstation | a workstation |
computation_amount | the computation amount you want to evaluate (in flops) |
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.
src | the first workstation |
dst | the second workstation |
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.
src | the first workstation |
dst | the second workstation |
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.
src | the first workstation |
dst | the second workstation |
communication_amount | the communication amount you want to evaluate (in bytes) |
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.
workstation | a workstation |
xbt_dict_t SD_workstation_get_storage_list | ( | SD_workstation_t | workstation | ) |
Return the list of mounted storages on a workstation.
workstation | a workstation |