SimGrid
3.11
Versatile Simulation of Distributed Systems
|
Describes the c bindings of SURF. More...
Typedefs | |
typedef Model * | surf_model_t |
Model datatype. More... | |
typedef Action * | surf_action_t |
Action structure. More... | |
const char * | surf_model_name (surf_model_t model) |
Get the name of a surf model. More... | |
surf_action_t | surf_model_extract_done_action_set (surf_model_t model) |
Pop an action from the done actions set. More... | |
surf_action_t | surf_model_extract_failed_action_set (surf_model_t model) |
Pop an action from the failed actions set. More... | |
surf_action_t | surf_model_extract_ready_action_set (surf_model_t model) |
Pop an action from the ready actions set. More... | |
surf_action_t | surf_model_extract_running_action_set (surf_model_t model) |
Pop an action from the running actions set. More... | |
int | surf_model_running_action_set_size (surf_model_t model) |
Get the size of the running action set of a model. More... | |
surf_action_t | surf_workstation_model_execute_parallel_task (surf_workstation_model_t model, int workstation_nb, void **workstation_list, double *computation_amount, double *communication_amount, double rate) |
Execute a parallel task. More... | |
surf_action_t | surf_workstation_model_communicate (surf_workstation_model_t model, surf_resource_t src, surf_resource_t dst, double size, double rate) |
Create a communication between two hosts. More... | |
xbt_dynar_t | surf_workstation_model_get_route (surf_workstation_model_t model, surf_resource_t src, surf_resource_t dst) |
Get the route between two hosts. More... | |
void | surf_vm_workstation_model_create (const char *name, surf_resource_t ind_phys_host) |
Create a new VM on the specified host. More... | |
surf_action_t | surf_network_model_communicate (surf_network_model_t model, sg_routing_edge_t src, sg_routing_edge_t dst, double size, double rate) |
Create a communication between two routing edges [TODO]. More... | |
const char * | surf_resource_name (surf_cpp_resource_t resource) |
Get the name of a surf resource (cpu, workstation, network, …) More... | |
xbt_dict_t | surf_resource_get_properties (surf_cpp_resource_t resource) |
Get the properties of a surf resource (cpu, workstation, network, …) More... | |
e_surf_resource_state_t | surf_resource_get_state (surf_cpp_resource_t resource) |
Get the state of a surf resource (cpu, workstation, network, …) More... | |
void | surf_resource_set_state (surf_cpp_resource_t resource, e_surf_resource_state_t state) |
Set the state of a surf resource (cpu, workstation, network, …) More... | |
double | surf_workstation_get_speed (surf_resource_t resource, double load) |
Get the speed of the cpu associtated to a workstation. More... | |
double | surf_workstation_get_available_speed (surf_resource_t resource) |
Get the available speed of cpu associtated to a workstation. More... | |
int | surf_workstation_get_core (surf_resource_t resource) |
Get the number of cores of the cpu associated to a workstation. More... | |
surf_action_t | surf_workstation_execute (surf_resource_t resource, double size) |
Execute some quantity of computation. More... | |
surf_action_t | surf_workstation_sleep (surf_resource_t resource, double duration) |
Make the workstation sleep. More... | |
surf_action_t | surf_workstation_open (surf_resource_t workstation, const char *fullpath) |
Open a file on a workstation. More... | |
surf_action_t | surf_workstation_close (surf_resource_t workstation, surf_file_t fd) |
Close a file descriptor on a workstation. More... | |
surf_action_t | surf_workstation_read (surf_resource_t resource, surf_file_t fd, sg_size_t size) |
Read a file. More... | |
surf_action_t | surf_workstation_write (surf_resource_t resource, surf_file_t fd, sg_size_t size) |
Write a file. More... | |
xbt_dynar_t | surf_workstation_get_info (surf_resource_t resource, surf_file_t fd) |
Get the informations of a file descriptor. More... | |
sg_size_t | surf_workstation_get_free_size (surf_resource_t resource, const char *name) |
Get the available space of the storage at the mount point. More... | |
sg_size_t | surf_workstation_get_used_size (surf_resource_t resource, const char *name) |
Get the used space of the storage at the mount point. More... | |
xbt_dynar_t | surf_workstation_get_vms (surf_resource_t resource) |
Get the VMs hosted on the workstation. More... | |
void | surf_workstation_get_params (surf_resource_t resource, ws_params_t params) |
[brief description] More... | |
void | surf_workstation_set_params (surf_resource_t resource, ws_params_t params) |
[brief description] More... | |
void | surf_vm_workstation_destroy (surf_resource_t resource) |
Destroy a Workstation VM. More... | |
void | surf_vm_workstation_suspend (surf_resource_t resource) |
Suspend a Workstation VM. More... | |
void | surf_vm_workstation_resume (surf_resource_t resource) |
Resume a Workstation VM. More... | |
void | surf_vm_workstation_save (surf_resource_t resource) |
Save the Workstation VM (Not yet implemented) More... | |
void | surf_vm_workstation_restore (surf_resource_t resource) |
Restore the Workstation VM (Not yet implemented) More... | |
void | surf_vm_workstation_migrate (surf_resource_t resource, surf_resource_t ind_vm_ws_dest) |
Migrate the VM to the destination host. More... | |
surf_resource_t | surf_vm_workstation_get_pm (surf_resource_t resource) |
Get the physical machine hosting the VM. More... | |
void | surf_vm_workstation_set_bound (surf_resource_t resource, double bound) |
[brief description] More... | |
void | surf_vm_workstation_set_affinity (surf_resource_t resource, surf_resource_t cpu, unsigned long mask) |
[brief description] More... | |
surf_action_t | surf_cpu_execute (surf_resource_t cpu, double size) |
Execute some quantity of computation. More... | |
surf_action_t | surf_cpu_sleep (surf_resource_t cpu, double duration) |
Make the cpu sleep for duration (in seconds) More... | |
double | surf_workstation_get_current_power_peak (surf_resource_t host) |
Get the workstation power peak. More... | |
double | surf_workstation_get_power_peak_at (surf_resource_t host, int pstate_index) |
[brief description] More... | |
int | surf_workstation_get_nb_pstates (surf_resource_t host) |
[brief description] More... | |
void | surf_workstation_set_power_peak_at (surf_resource_t host, int pstate_index) |
[brief description] More... | |
double | surf_workstation_get_consumed_energy (surf_resource_t host) |
Get the consumed energy (in joules) of a workstation. More... | |
xbt_dict_t | surf_workstation_get_mounted_storage_list (surf_resource_t workstation) |
Get the list of storages mounted on a workstation. More... | |
xbt_dynar_t | surf_workstation_get_attached_storage_list (surf_resource_t workstation) |
Get the list of storages attached to a workstation. More... | |
int | surf_workstation_unlink (surf_resource_t workstation, surf_file_t fd) |
Unlink a file descriptor. More... | |
size_t | surf_workstation_get_size (surf_resource_t workstation, surf_file_t fd) |
Get the size of a file on a workstation. More... | |
size_t | surf_workstation_file_tell (surf_resource_t workstation, surf_file_t fd) |
Get the current position of the file descriptor. More... | |
int | surf_workstation_file_move (surf_resource_t workstation, surf_file_t fd, const char *fullpath) |
Move a file to another location on the same mount point. More... | |
int | surf_workstation_file_seek (surf_resource_t workstation, surf_file_t fd, sg_offset_t offset, int origin) |
Set the position indictator assiociated with the file descriptor to a new position. More... | |
int | surf_network_link_is_shared (surf_cpp_resource_t link) |
[brief description] More... | |
double | surf_network_link_get_bandwidth (surf_cpp_resource_t link) |
Get the bandwidth of a link in bytes per second. More... | |
double | surf_network_link_get_latency (surf_cpp_resource_t link) |
Get the latency of a link in seconds. More... | |
xbt_dict_t | surf_storage_get_content (surf_resource_t resource) |
Get the content of a storage. More... | |
sg_size_t | surf_storage_get_size (surf_resource_t resource) |
Get the size in bytes of a storage. More... | |
sg_size_t | surf_storage_get_free_size (surf_resource_t resource) |
Get the available size in bytes of a storage. More... | |
sg_size_t | surf_storage_get_used_size (surf_resource_t resource) |
Get the size in bytes of a storage. More... | |
void * | surf_action_get_data (surf_action_t action) |
Get the data associated to the action. More... | |
void | surf_action_set_data (surf_action_t action, void *data) |
Set the data associated to the action. More... | |
void | surf_action_unref (surf_action_t action) |
Unreference an action. More... | |
double | surf_action_get_start_time (surf_action_t action) |
Get the start time of an action. More... | |
double | surf_action_get_finish_time (surf_action_t action) |
Get the finish time of an action. More... | |
double | surf_action_get_remains (surf_action_t action) |
Get the remains amount of work to do of an action. More... | |
void | surf_action_suspend (surf_action_t action) |
Suspend an action. More... | |
void | surf_action_resume (surf_action_t action) |
Resume an action. More... | |
void | surf_action_cancel (surf_action_t action) |
Cancel an action. More... | |
void | surf_action_set_priority (surf_action_t action, double priority) |
Set the priority of an action. More... | |
void | surf_action_set_category (surf_action_t action, const char *category) |
Set the category of an action. More... | |
e_surf_action_state_t | surf_action_get_state (surf_action_t action) |
Get the state of an action. More... | |
double | surf_action_get_cost (surf_action_t action) |
Get the cost of an action. More... | |
void | surf_cpu_action_set_affinity (surf_action_t action, surf_resource_t cpu, unsigned long mask) |
[brief desrciption] More... | |
void | surf_cpu_action_set_bound (surf_action_t action, double bound) |
[brief description] More... | |
double | surf_network_action_get_latency_limited (surf_action_t action) |
[brief description] More... | |
surf_file_t | surf_storage_action_get_file (surf_action_t action) |
Get the file associated to a storage action. More... | |
xbt_dict_t | surf_storage_action_get_ls_dict (surf_action_t action) |
Get the result dictionary of an ls action. More... | |
const char * | surf_storage_get_host (surf_resource_t resource) |
Get the host the storage is attached to. More... | |
Describes the c bindings of SURF.
typedef Model* surf_model_t |
Model datatype.
Generic data structure for a model. The workstations, the CPUs and the network links are examples of models.
typedef Action* surf_action_t |
Action structure.
Never create s_surf_action_t by yourself ! The actions are created on the fly when you call execute or communicate on a model.
const char* surf_model_name | ( | surf_model_t | model | ) |
Get the name of a surf model.
model | A model |
surf_action_t surf_model_extract_done_action_set | ( | surf_model_t | model | ) |
Pop an action from the done actions set.
model | The model from which the action is extracted |
surf_action_t surf_model_extract_failed_action_set | ( | surf_model_t | model | ) |
Pop an action from the failed actions set.
model | The model from which the action is extracted |
surf_action_t surf_model_extract_ready_action_set | ( | surf_model_t | model | ) |
Pop an action from the ready actions set.
model | The model from which the action is extracted |
surf_action_t surf_model_extract_running_action_set | ( | surf_model_t | model | ) |
Pop an action from the running actions set.
model | The model from which the action is extracted |
int surf_model_running_action_set_size | ( | surf_model_t | model | ) |
Get the size of the running action set of a model.
model | The model |
surf_action_t surf_workstation_model_execute_parallel_task | ( | surf_workstation_model_t | model, |
int | workstation_nb, | ||
void ** | workstation_list, | ||
double * | computation_amount, | ||
double * | communication_amount, | ||
double | rate | ||
) |
Execute a parallel task.
[long description]
model | The model which handle the parallelisation |
workstation_nb | The number of workstations |
workstation_list | The list of workstations on which the task is executed |
computation_amount | The processing amount (in flop) needed to process |
communication_amount | The amount of data (in bytes) needed to transfer |
rate | [description] |
surf_action_t surf_workstation_model_communicate | ( | surf_workstation_model_t | model, |
surf_resource_t | src, | ||
surf_resource_t | dst, | ||
double | size, | ||
double | rate | ||
) |
Create a communication between two hosts.
model | The model which handle the communication |
src | The source host |
dst | The destination host |
size | The amount of data (in bytes) needed to transfer |
rate | [description] |
xbt_dynar_t surf_workstation_model_get_route | ( | surf_workstation_model_t | model, |
surf_resource_t | src, | ||
surf_resource_t | dst | ||
) |
Get the route between two hosts.
[long description]
model | The model which handle the routes |
src | The source host |
dst | The destination host |
void surf_vm_workstation_model_create | ( | const char * | name, |
surf_resource_t | ind_phys_host | ||
) |
Create a new VM on the specified host.
name | The name of the workstation |
ind_phys_host | The host on which the VM is created |
surf_action_t surf_network_model_communicate | ( | surf_network_model_t | model, |
sg_routing_edge_t | src, | ||
sg_routing_edge_t | dst, | ||
double | size, | ||
double | rate | ||
) |
Create a communication between two routing edges [TODO].
[long description]
model | The model which handle the communication |
src | The source host |
dst | The destination host |
size | The amount of data (in bytes) needed to transfer |
rate | [description] |
const char* surf_resource_name | ( | surf_cpp_resource_t | resource | ) |
Get the name of a surf resource (cpu, workstation, network, …)
resource | The surf resource |
xbt_dict_t surf_resource_get_properties | ( | surf_cpp_resource_t | resource | ) |
Get the properties of a surf resource (cpu, workstation, network, …)
resource | The surf resource |
e_surf_resource_state_t surf_resource_get_state | ( | surf_cpp_resource_t | resource | ) |
Get the state of a surf resource (cpu, workstation, network, …)
resource | The surf resource |
void surf_resource_set_state | ( | surf_cpp_resource_t | resource, |
e_surf_resource_state_t | state | ||
) |
Set the state of a surf resource (cpu, workstation, network, …)
resource | The surf resource |
state | The new state of the surf resource |
double surf_workstation_get_speed | ( | surf_resource_t | resource, |
double | load | ||
) |
Get the speed of the cpu associtated to a workstation.
resource | The surf workstation |
load | [description] |
double surf_workstation_get_available_speed | ( | surf_resource_t | resource | ) |
Get the available speed of cpu associtated to a workstation.
resource | The surf workstation |
int surf_workstation_get_core | ( | surf_resource_t | resource | ) |
Get the number of cores of the cpu associated to a workstation.
resource | The surf workstation |
surf_action_t surf_workstation_execute | ( | surf_resource_t | resource, |
double | size | ||
) |
Execute some quantity of computation.
resource | The surf workstation |
size | The value of the processing amount (in flop) needed to process |
surf_action_t surf_workstation_sleep | ( | surf_resource_t | resource, |
double | duration | ||
) |
Make the workstation sleep.
resource | The surf workstation |
duration | The number of seconds to sleep |
surf_action_t surf_workstation_open | ( | surf_resource_t | workstation, |
const char * | fullpath | ||
) |
Open a file on a workstation.
workstation | The surf workstation |
fullpath | The path to the file |
surf_action_t surf_workstation_close | ( | surf_resource_t | workstation, |
surf_file_t | fd | ||
) |
Close a file descriptor on a workstation.
workstation | The surf workstation |
fd | The file descriptor |
surf_action_t surf_workstation_read | ( | surf_resource_t | resource, |
surf_file_t | fd, | ||
sg_size_t | size | ||
) |
Read a file.
resource | The surf workstation |
fd | The file descriptor to read |
size | The size in bytes to read |
surf_action_t surf_workstation_write | ( | surf_resource_t | resource, |
surf_file_t | fd, | ||
sg_size_t | size | ||
) |
Write a file.
resource | The surf workstation |
fd | The file descriptor to write |
size | The size in bytes to write |
xbt_dynar_t surf_workstation_get_info | ( | surf_resource_t | resource, |
surf_file_t | fd | ||
) |
Get the informations of a file descriptor.
The returned xbt_dynar_t contains:
resource | The surf workstation |
fd | The file descriptor |
sg_size_t surf_workstation_get_free_size | ( | surf_resource_t | resource, |
const char * | name | ||
) |
Get the available space of the storage at the mount point.
resource | The surf workstation |
name | The mount point |
sg_size_t surf_workstation_get_used_size | ( | surf_resource_t | resource, |
const char * | name | ||
) |
Get the used space of the storage at the mount point.
resource | The surf workstation |
name | The mount point |
xbt_dynar_t surf_workstation_get_vms | ( | surf_resource_t | resource | ) |
Get the VMs hosted on the workstation.
resource | The surf workstation |
void surf_workstation_get_params | ( | surf_resource_t | resource, |
ws_params_t | params | ||
) |
[brief description]
[long description]
resource | [description] |
params | [description] |
void surf_workstation_set_params | ( | surf_resource_t | resource, |
ws_params_t | params | ||
) |
[brief description]
[long description]
resource | [description] |
params | [description] |
void surf_vm_workstation_destroy | ( | surf_resource_t | resource | ) |
Destroy a Workstation VM.
resource | The surf workstation vm |
void surf_vm_workstation_suspend | ( | surf_resource_t | resource | ) |
Suspend a Workstation VM.
resource | The surf workstation vm |
void surf_vm_workstation_resume | ( | surf_resource_t | resource | ) |
Resume a Workstation VM.
resource | The surf workstation vm |
void surf_vm_workstation_save | ( | surf_resource_t | resource | ) |
Save the Workstation VM (Not yet implemented)
resource | The surf workstation vm |
void surf_vm_workstation_restore | ( | surf_resource_t | resource | ) |
Restore the Workstation VM (Not yet implemented)
resource | The surf workstation vm |
void surf_vm_workstation_migrate | ( | surf_resource_t | resource, |
surf_resource_t | ind_vm_ws_dest | ||
) |
Migrate the VM to the destination host.
resource | The surf workstation vm |
ind_vm_ws_dest | The destination host |
surf_resource_t surf_vm_workstation_get_pm | ( | surf_resource_t | resource | ) |
Get the physical machine hosting the VM.
resource | The surf workstation vm |
void surf_vm_workstation_set_bound | ( | surf_resource_t | resource, |
double | bound | ||
) |
[brief description]
[long description]
resource | [description] |
bound | [description] |
void surf_vm_workstation_set_affinity | ( | surf_resource_t | resource, |
surf_resource_t | cpu, | ||
unsigned long | mask | ||
) |
[brief description]
[long description]
resource | [description] |
cpu | [description] |
mask | [description] |
surf_action_t surf_cpu_execute | ( | surf_resource_t | cpu, |
double | size | ||
) |
Execute some quantity of computation.
cpu | The surf cpu |
size | The value of the processing amount (in flop) needed to process |
surf_action_t surf_cpu_sleep | ( | surf_resource_t | cpu, |
double | duration | ||
) |
Make the cpu sleep for duration (in seconds)
[long description]
cpu | The surf cpu |
duration | The number of seconds to sleep |
double surf_workstation_get_current_power_peak | ( | surf_resource_t | host | ) |
Get the workstation power peak.
[long description]
host | The surf workstation |
double surf_workstation_get_power_peak_at | ( | surf_resource_t | host, |
int | pstate_index | ||
) |
[brief description]
[long description]
host | [description] |
pstate_index | [description] |
int surf_workstation_get_nb_pstates | ( | surf_resource_t | host | ) |
[brief description]
[long description]
host | [description] |
void surf_workstation_set_power_peak_at | ( | surf_resource_t | host, |
int | pstate_index | ||
) |
[brief description]
[long description]
host | [description] |
pstate_index | [description] |
double surf_workstation_get_consumed_energy | ( | surf_resource_t | host | ) |
Get the consumed energy (in joules) of a workstation.
host | The surf workstation |
xbt_dict_t surf_workstation_get_mounted_storage_list | ( | surf_resource_t | workstation | ) |
Get the list of storages mounted on a workstation.
workstation | The surf workstation |
xbt_dynar_t surf_workstation_get_attached_storage_list | ( | surf_resource_t | workstation | ) |
Get the list of storages attached to a workstation.
workstation | The surf workstation |
int surf_workstation_unlink | ( | surf_resource_t | workstation, |
surf_file_t | fd | ||
) |
Unlink a file descriptor.
workstation | The surf workstation |
fd | The file descriptor |
size_t surf_workstation_get_size | ( | surf_resource_t | workstation, |
surf_file_t | fd | ||
) |
Get the size of a file on a workstation.
workstation | The surf workstation |
fd | The file descriptor |
size_t surf_workstation_file_tell | ( | surf_resource_t | workstation, |
surf_file_t | fd | ||
) |
Get the current position of the file descriptor.
workstation | The surf workstation |
fd | The file descriptor |
int surf_workstation_file_move | ( | surf_resource_t | workstation, |
surf_file_t | fd, | ||
const char * | fullpath | ||
) |
Move a file to another location on the same mount point.
[long description]
workstation | The surf workstation |
fd | The file descriptor |
fullpath | The new full path |
int surf_workstation_file_seek | ( | surf_resource_t | workstation, |
surf_file_t | fd, | ||
sg_offset_t | offset, | ||
int | origin | ||
) |
Set the position indictator assiociated with the file descriptor to a new position.
[long description]
workstation | The surf workstation |
fd | The file descriptor |
offset | The offset from the origin |
origin | Position used as a reference for the offset
|
int surf_network_link_is_shared | ( | surf_cpp_resource_t | link | ) |
[brief description]
[long description]
link | [description] |
double surf_network_link_get_bandwidth | ( | surf_cpp_resource_t | link | ) |
Get the bandwidth of a link in bytes per second.
link | The surf link |
double surf_network_link_get_latency | ( | surf_cpp_resource_t | link | ) |
Get the latency of a link in seconds.
link | The surf link |
xbt_dict_t surf_storage_get_content | ( | surf_resource_t | resource | ) |
Get the content of a storage.
resource | The surf storage |
sg_size_t surf_storage_get_size | ( | surf_resource_t | resource | ) |
Get the size in bytes of a storage.
resource | The surf storage |
sg_size_t surf_storage_get_free_size | ( | surf_resource_t | resource | ) |
Get the available size in bytes of a storage.
resource | The surf storage |
sg_size_t surf_storage_get_used_size | ( | surf_resource_t | resource | ) |
Get the size in bytes of a storage.
resource | The surf storage |
void* surf_action_get_data | ( | surf_action_t | action | ) |
Get the data associated to the action.
action | The surf action |
void surf_action_set_data | ( | surf_action_t | action, |
void * | data | ||
) |
Set the data associated to the action.
[long description]
action | The surf action |
data | The new data associated to the action |
void surf_action_unref | ( | surf_action_t | action | ) |
Unreference an action.
action | The surf action |
double surf_action_get_start_time | ( | surf_action_t | action | ) |
Get the start time of an action.
action | The surf action |
double surf_action_get_finish_time | ( | surf_action_t | action | ) |
Get the finish time of an action.
action | The surf action |
double surf_action_get_remains | ( | surf_action_t | action | ) |
Get the remains amount of work to do of an action.
action | The surf action |
void surf_action_suspend | ( | surf_action_t | action | ) |
Suspend an action.
action | The surf action |
void surf_action_resume | ( | surf_action_t | action | ) |
Resume an action.
action | The surf action |
void surf_action_cancel | ( | surf_action_t | action | ) |
Cancel an action.
action | The surf action |
void surf_action_set_priority | ( | surf_action_t | action, |
double | priority | ||
) |
Set the priority of an action.
[long description]
action | The surf action |
priority | The new priority [TODO] |
void surf_action_set_category | ( | surf_action_t | action, |
const char * | category | ||
) |
Set the category of an action.
[long description]
action | The surf action |
category | The new category of the action |
e_surf_action_state_t surf_action_get_state | ( | surf_action_t | action | ) |
Get the state of an action.
action | The surf action |
double surf_action_get_cost | ( | surf_action_t | action | ) |
Get the cost of an action.
action | The surf action |
void surf_cpu_action_set_affinity | ( | surf_action_t | action, |
surf_resource_t | cpu, | ||
unsigned long | mask | ||
) |
[brief desrciption]
[long description]
action | The surf cpu action |
cpu | [description] |
mask | [description] |
void surf_cpu_action_set_bound | ( | surf_action_t | action, |
double | bound | ||
) |
[brief description]
[long description]
action | The surf cpu action |
bound | [description] |
double surf_network_action_get_latency_limited | ( | surf_action_t | action | ) |
[brief description]
[long description]
action | The surf network action |
surf_file_t surf_storage_action_get_file | ( | surf_action_t | action | ) |
Get the file associated to a storage action.
action | The surf storage action |
xbt_dict_t surf_storage_action_get_ls_dict | ( | surf_action_t | action | ) |
Get the result dictionary of an ls action.
action | The surf storage action |
const char* surf_storage_get_host | ( | surf_resource_t | resource | ) |
Get the host the storage is attached to.
resource | The surf storage |