SimGrid  3.11
Versatile Simulation of Distributed Systems
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Modules Pages
Workstations

Functions for managing the workstations. More...

Functions

SD_workstation_t SD_workstation_get_by_name (const char *name)
 Returns a workstation given its name. More...
 
const SD_workstation_tSD_workstation_get_list (void)
 Returns the workstation list. More...
 
int SD_workstation_get_number (void)
 Returns the number of workstations. More...
 
void SD_workstation_set_data (SD_workstation_t workstation, void *data)
 Sets the user data of a workstation. More...
 
void * SD_workstation_get_data (SD_workstation_t workstation)
 Returns the user data of a workstation. More...
 
const char * SD_workstation_get_name (SD_workstation_t workstation)
 Returns the name of a workstation. More...
 
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. More...
 
const char * SD_workstation_get_property_value (SD_workstation_t workstation, const char *name)
 Returns the value of a given workstation property. More...
 
void SD_workstation_dump (SD_workstation_t ws)
 Displays debugging informations about a workstation.
 
const SD_link_tSD_route_get_list (SD_workstation_t src, SD_workstation_t dst)
 Returns the route between two workstations. More...
 
int SD_route_get_size (SD_workstation_t src, SD_workstation_t dst)
 Returns the number of links on the route between two workstations. More...
 
double SD_workstation_get_power (SD_workstation_t workstation)
 Returns the total power of a workstation. More...
 
double SD_workstation_get_available_power (SD_workstation_t workstation)
 Returns the proportion of available power in a workstation. More...
 
int SD_workstation_get_cores (SD_workstation_t workstation)
 Returns the amount of cores of a workstation. More...
 
e_SD_workstation_access_mode_t SD_workstation_get_access_mode (SD_workstation_t workstation)
 Returns the access mode of this workstation. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
xbt_dict_t SD_workstation_get_mounted_storage_list (SD_workstation_t workstation)
 Return the list of mounted storages on a workstation. More...
 
xbt_dynar_t SD_workstation_get_attached_storage_list (SD_workstation_t workstation)
 Return the list of mounted storages on a workstation. More...
 
const char * SD_storage_get_host (SD_storage_t storage)
 Returns the host name the storage is attached to. More...
 

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
nameworkstation 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
workstationa workstation
datathe 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
workstationa 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
workstationa 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
workstationa 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
wsa workstation
namea 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
srca workstation
dstanother 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
srca workstation
dstanother 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
workstationa 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
workstationa workstation
Returns
the proportion of power currently available in this workstation (normally a number between 0 and 1)
See also
SD_workstation_get_power()
int SD_workstation_get_cores ( SD_workstation_t  workstation)

Returns the amount of cores of a workstation.

Parameters
workstationa workstation
Returns
the amount of cores of this workstation
e_SD_workstation_access_mode_t SD_workstation_get_access_mode ( SD_workstation_t  workstation)

Returns the access mode of this workstation.

Parameters
workstationa 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
workstationa workstation
access_modethe 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
workstationa workstation
computation_amountthe 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
srcthe first workstation
dstthe 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
srcthe first workstation
dstthe 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
srcthe first workstation
dstthe second workstation
communication_amountthe 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
workstationa workstation
xbt_dict_t SD_workstation_get_mounted_storage_list ( SD_workstation_t  workstation)

Return the list of mounted storages on a workstation.

Parameters
workstationa workstation
Returns
a dynar containing all mounted storages on the workstation
xbt_dynar_t SD_workstation_get_attached_storage_list ( SD_workstation_t  workstation)

Return the list of mounted storages on a workstation.

Parameters
workstationa workstation
Returns
a dynar containing all mounted storages on the workstation
const char* SD_storage_get_host ( msg_storage_t  storage)

Returns the host name the storage is attached to.

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