SimGrid
3.12
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 (dont rely on exact value) 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_host_model_execute_parallel_task (surf_host_model_t model, int host_nb, sg_host_t *host_list, double *flops_amount, double *bytes_amount, double rate) |
Execute a parallel task. More... | |
xbt_dynar_t | surf_host_model_get_route (surf_host_model_t model, surf_resource_t src, surf_resource_t dst) |
Get the route (dynar of sg_link_t) between two hosts. | |
void | surf_vm_model_create (const char *name, surf_resource_t host_PM) |
Create a new VM on the specified host. | |
surf_action_t | surf_network_model_communicate (surf_network_model_t model, sg_host_t src, sg_host_t dst, double size, double rate) |
Create a communication between two hosts. More... | |
const char * | surf_resource_name (surf_cpp_resource_t resource) |
Get the name of a surf resource (cpu, host, network, …) More... | |
xbt_dict_t | surf_resource_get_properties (surf_cpp_resource_t resource) |
Get the properties of a surf resource (cpu, host, network, …) | |
e_surf_resource_state_t | surf_resource_get_state (surf_cpp_resource_t resource) |
Get the state of a surf resource (cpu, host, network, …) | |
void | surf_resource_set_state (surf_cpp_resource_t resource, e_surf_resource_state_t state) |
Set the state of a surf resource (cpu, host, network, …) | |
double | surf_host_get_speed (surf_resource_t resource, double load) |
Get the speed of the cpu associated to a host. | |
double | surf_host_get_available_speed (surf_resource_t host) |
Get the available speed of cpu associated to a host. | |
int | surf_host_get_core (surf_resource_t host) |
Get the number of cores of the cpu associated to a host. | |
surf_action_t | surf_host_execute (surf_resource_t host, double size) |
Create a computation action on the given host. | |
surf_action_t | surf_host_sleep (surf_resource_t host, double duration) |
Create a sleep action on the given host. | |
surf_action_t | surf_host_open (surf_resource_t host, const char *fullpath) |
Create a file opening action on the given host. | |
surf_action_t | surf_host_close (surf_resource_t host, surf_file_t fd) |
Create a file closing action on the given host. | |
surf_action_t | surf_host_read (surf_resource_t host, surf_file_t fd, sg_size_t size) |
Create a file reading action on the given host. | |
surf_action_t | surf_host_write (surf_resource_t host, surf_file_t fd, sg_size_t size) |
Create a file writing action on the given host. | |
xbt_dynar_t | surf_host_get_info (surf_resource_t host, surf_file_t fd) |
Get the informations of a file descriptor. More... | |
sg_size_t | surf_host_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_host_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_host_get_vms (surf_resource_t resource) |
Get the list of VMs hosted on the host. | |
void | surf_host_get_params (surf_resource_t resource, vm_params_t params) |
Retrieve the params of that VM. More... | |
void | surf_host_set_params (surf_resource_t resource, vm_params_t params) |
Sets the params of that VM/PM. More... | |
void | surf_vm_destroy (surf_resource_t resource) |
Destroy a VM. More... | |
void | surf_vm_suspend (surf_resource_t resource) |
Suspend a VM. | |
void | surf_vm_resume (surf_resource_t resource) |
Resume a VM. | |
void | surf_vm_save (surf_resource_t resource) |
Save the VM (Not yet implemented) More... | |
void | surf_vm_restore (surf_resource_t resource) |
Restore the VM (Not yet implemented) More... | |
void | surf_vm_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_get_pm (surf_resource_t resource) |
Get the physical machine hosting the VM. More... | |
void | surf_vm_set_bound (surf_resource_t resource, double bound) |
[brief description] More... | |
void | surf_vm_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_host_get_current_power_peak (surf_resource_t host) |
Get the host power peak. More... | |
double | surf_host_get_power_peak_at (surf_resource_t host, int pstate_index) |
[brief description] More... | |
int | surf_host_get_nb_pstates (surf_resource_t host) |
[brief description] More... | |
double | surf_host_get_consumed_energy (surf_resource_t host) |
Get the consumed energy (in joules) of an host. More... | |
xbt_dict_t | surf_host_get_mounted_storage_list (surf_resource_t host) |
Get the list of storages mounted on an host. More... | |
xbt_dynar_t | surf_host_get_attached_storage_list (surf_resource_t host) |
Get the list of storages attached to an host. More... | |
int | surf_host_unlink (surf_resource_t host, surf_file_t fd) |
Unlink a file descriptor. More... | |
size_t | surf_host_get_size (surf_resource_t host, surf_file_t fd) |
Get the size of a file on a host. More... | |
size_t | surf_host_file_tell (surf_resource_t host, surf_file_t fd) |
Get the current position of the file descriptor. More... | |
int | surf_host_file_move (surf_resource_t host, surf_file_t fd, const char *fullpath) |
Move a file to another location on the same mount point. More... | |
int | surf_host_file_seek (surf_resource_t host, surf_file_t fd, sg_offset_t offset, int origin) |
Set the position indictator assiociated with the file descriptor to a new position. 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 hosts, 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 (dont rely on exact value)
This is implemented using typeid(), so it may change with the compiler
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_host_model_execute_parallel_task | ( | surf_host_model_t | model, |
int | host_nb, | ||
sg_host_t * | host_list, | ||
double * | flops_amount, | ||
double * | bytes_amount, | ||
double | rate | ||
) |
Execute a parallel task.
[long description]
model | The model which handle the parallelisation |
host_nb | The number of hosts |
host_list | The list of hosts on which the task is executed |
flops_amount | The processing amount (in flop) needed to process |
bytes_amount | The amount of data (in bytes) needed to transfer |
rate | [description] |
surf_action_t surf_network_model_communicate | ( | surf_network_model_t | model, |
sg_host_t | src, | ||
sg_host_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] |
const char* surf_resource_name | ( | surf_cpp_resource_t | resource | ) |
Get the name of a surf resource (cpu, host, network, …)
resource | The surf resource |
xbt_dynar_t surf_host_get_info | ( | surf_resource_t | host, |
surf_file_t | fd | ||
) |
Get the informations of a file descriptor.
The returned xbt_dynar_t contains:
host | The surf host |
fd | The file descriptor |
sg_size_t surf_host_get_free_size | ( | surf_resource_t | resource, |
const char * | name | ||
) |
Get the available space of the storage at the mount point.
resource | The surf host |
name | The mount point |
sg_size_t surf_host_get_used_size | ( | surf_resource_t | resource, |
const char * | name | ||
) |
Get the used space of the storage at the mount point.
resource | The surf host |
name | The mount point |
void surf_host_get_params | ( | surf_resource_t | resource, |
vm_params_t | params | ||
) |
Retrieve the params of that VM.
You can use fields ramsize and overcommit on a PM, too.
void surf_host_set_params | ( | surf_resource_t | resource, |
vm_params_t | params | ||
) |
Sets the params of that VM/PM.
You can use fields ramsize and overcommit on a PM, too.
void surf_vm_destroy | ( | surf_resource_t | resource | ) |
Destroy a VM.
resource | The surf vm |
void surf_vm_save | ( | surf_resource_t | resource | ) |
Save the VM (Not yet implemented)
resource | The surf vm |
void surf_vm_restore | ( | surf_resource_t | resource | ) |
Restore the VM (Not yet implemented)
resource | The surf vm |
void surf_vm_migrate | ( | surf_resource_t | resource, |
surf_resource_t | ind_vm_ws_dest | ||
) |
Migrate the VM to the destination host.
resource | The surf vm |
ind_vm_ws_dest | The destination host |
surf_resource_t surf_vm_get_pm | ( | surf_resource_t | resource | ) |
void surf_vm_set_bound | ( | surf_resource_t | resource, |
double | bound | ||
) |
[brief description]
[long description]
resource | [description] |
bound | [description] |
void surf_vm_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_host_get_current_power_peak | ( | surf_resource_t | host | ) |
Get the host power peak.
[long description]
host | The surf host |
double surf_host_get_power_peak_at | ( | surf_resource_t | host, |
int | pstate_index | ||
) |
[brief description]
[long description]
host | [description] |
pstate_index | [description] |
int surf_host_get_nb_pstates | ( | surf_resource_t | host | ) |
[brief description]
[long description]
host | [description] |
double surf_host_get_consumed_energy | ( | surf_resource_t | host | ) |
Get the consumed energy (in joules) of an host.
host | The surf host |
xbt_dict_t surf_host_get_mounted_storage_list | ( | surf_resource_t | host | ) |
Get the list of storages mounted on an host.
host | The surf host |
xbt_dynar_t surf_host_get_attached_storage_list | ( | surf_resource_t | host | ) |
Get the list of storages attached to an host.
host | The surf host |
int surf_host_unlink | ( | surf_resource_t | host, |
surf_file_t | fd | ||
) |
Unlink a file descriptor.
host | The surf host |
fd | The file descriptor |
size_t surf_host_get_size | ( | surf_resource_t | host, |
surf_file_t | fd | ||
) |
Get the size of a file on a host.
host | The surf host |
fd | The file descriptor |
size_t surf_host_file_tell | ( | surf_resource_t | host, |
surf_file_t | fd | ||
) |
Get the current position of the file descriptor.
host | The surf host |
fd | The file descriptor |
int surf_host_file_move | ( | surf_resource_t | host, |
surf_file_t | fd, | ||
const char * | fullpath | ||
) |
Move a file to another location on the same mount point.
[long description]
host | The surf host |
fd | The file descriptor |
fullpath | The new full path |
int surf_host_file_seek | ( | surf_resource_t | host, |
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]
host | The surf host |
fd | The file descriptor |
offset | The offset from the origin |
origin | Position used as a reference for the offset
|
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 |