SimGrid  3.13
Versatile Simulation of Distributed Systems
surf_c_bindings.cpp File Reference

Functions

 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY (surf_kernel)
 
static simgrid::surf::HostImplget_casted_host (sg_host_t host)
 
static simgrid::surf::VirtualMachineget_casted_vm (sg_host_t host)
 
void surf_presolve (void)
 Finish simulation initialization. More...
 
double surf_solve (double max_date)
 Performs a part of the simulation. 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...
 
int surf_model_running_action_set_size (surf_model_t model)
 Get the size of the running action set of a model. More...
 
void surf_vm_model_create (const char *name, sg_host_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_host_t src, sg_host_t dst, double size, double rate)
 Create a communication between two hosts. More...
 
surf_action_t surf_host_sleep (sg_host_t host, double duration)
 Create a sleep action on the given host. More...
 
surf_action_t surf_host_open (sg_host_t host, const char *fullpath)
 Create a file opening action on the given host. More...
 
surf_action_t surf_host_close (sg_host_t host, surf_file_t fd)
 Create a file closing action on the given host. More...
 
int surf_host_unlink (sg_host_t host, surf_file_t fd)
 Unlink a file descriptor. More...
 
size_t surf_host_get_size (sg_host_t host, surf_file_t fd)
 Get the size of a file on a host. More...
 
surf_action_t surf_host_read (sg_host_t host, surf_file_t fd, sg_size_t size)
 Create a file reading action on the given host. More...
 
surf_action_t surf_host_write (sg_host_t host, surf_file_t fd, sg_size_t size)
 Create a file writing action on the given host. More...
 
xbt_dynar_t surf_host_get_info (sg_host_t host, surf_file_t fd)
 Get the informations of a file descriptor. More...
 
size_t surf_host_file_tell (sg_host_t host, surf_file_t fd)
 Get the current position of the file descriptor. More...
 
int surf_host_file_seek (sg_host_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...
 
int surf_host_file_move (sg_host_t host, surf_file_t fd, const char *fullpath)
 Move a file to another location on the same mount point. More...
 
void surf_vm_destroy (sg_host_t vm)
 Destroy a VM. More...
 
void surf_vm_suspend (sg_host_t vm)
 Suspend a VM. More...
 
void surf_vm_resume (sg_host_t vm)
 Resume a VM. More...
 
void surf_vm_save (sg_host_t vm)
 Save the VM (Not yet implemented) More...
 
void surf_vm_restore (sg_host_t vm)
 Restore the VM (Not yet implemented) More...
 
void surf_vm_migrate (sg_host_t vm, sg_host_t ind_vm_ws_dest)
 Migrate the VM to the destination host. More...
 
sg_host_t surf_vm_get_pm (sg_host_t vm)
 Get the physical machine hosting the VM. More...
 
void surf_vm_set_bound (sg_host_t vm, double bound)
 [brief description] More...
 
void surf_vm_set_affinity (sg_host_t vm, sg_host_t host, unsigned long mask)
 [brief description] 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...
 
xbt_dict_t surf_storage_get_properties (surf_resource_t resource)
 return the properties set associated to that storage More...
 
const char * surf_storage_get_host (surf_resource_t resource)
 Get the host the storage is attached to. More...
 
void surf_cpu_action_set_bound (surf_action_t action, double bound)
 [brief description] More...
 
surf_file_t surf_storage_action_get_file (surf_action_t action)
 Get the file associated to a storage action. More...
 

Variables

double NOW
 

Function Documentation

XBT_LOG_EXTERNAL_DEFAULT_CATEGORY ( surf_kernel  )
static simgrid::surf::HostImpl* get_casted_host ( sg_host_t  host)
static
static simgrid::surf::VirtualMachine* get_casted_vm ( sg_host_t  host)
static
surf_action_t surf_model_extract_failed_action_set ( surf_model_t  model)

Pop an action from the failed actions set.

Parameters
modelThe model from which the action is extracted
Returns
An action in failed state
int surf_model_running_action_set_size ( surf_model_t  model)

Get the size of the running action set of a model.

Parameters
modelThe model
Returns
The size of the running action set
void surf_vm_model_create ( const char *  name,
sg_host_t  ind_phys_host 
)

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.

Parameters
modelThe model which handle the communication
srcThe source host
dstThe destination host
sizeThe amount of data (in bytes) needed to transfer
rate[description]
Returns
The action corresponding to the communication
surf_action_t surf_host_sleep ( sg_host_t  host,
double  duration 
)

Create a sleep action on the given host.

surf_action_t surf_host_open ( sg_host_t  host,
const char *  fullpath 
)

Create a file opening action on the given host.

surf_action_t surf_host_close ( sg_host_t  host,
surf_file_t  fd 
)

Create a file closing action on the given host.

int surf_host_unlink ( sg_host_t  host,
surf_file_t  fd 
)

Unlink a file descriptor.

Parameters
hostThe surf host
fdThe file descriptor
Returns
0 if failed to unlink, 1 otherwise
size_t surf_host_get_size ( sg_host_t  host,
surf_file_t  fd 
)

Get the size of a file on a host.

Parameters
hostThe surf host
fdThe file descriptor
Returns
The size in bytes of the file
surf_action_t surf_host_read ( sg_host_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 ( sg_host_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 ( sg_host_t  host,
surf_file_t  fd 
)

Get the informations of a file descriptor.

The returned xbt_dynar_t contains:

  • the size of the file,
  • the mount point,
  • the storage name,
  • the storage typeId,
  • the storage content type
Parameters
hostThe surf host
fdThe file descriptor
Returns
An xbt_dynar_t with the file informations
size_t surf_host_file_tell ( sg_host_t  host,
surf_file_t  fd 
)

Get the current position of the file descriptor.

Parameters
hostThe surf host
fdThe file descriptor
Returns
The current position of the file descriptor
int surf_host_file_seek ( sg_host_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]

Parameters
hostThe surf host
fdThe file descriptor
offsetThe offset from the origin
originPosition used as a reference for the offset
  • SEEK_SET: beginning of the file
  • SEEK_CUR: current position indicator
  • SEEK_END: end of the file
Returns
MSG_OK if successful, otherwise MSG_TASK_CANCELED
int surf_host_file_move ( sg_host_t  host,
surf_file_t  fd,
const char *  fullpath 
)

Move a file to another location on the same mount point.

[long description]

Parameters
hostThe surf host
fdThe file descriptor
fullpathThe new full path
Returns
MSG_OK if successful, otherwise MSG_TASK_CANCELED
void surf_vm_destroy ( sg_host_t  resource)

Destroy a VM.

Parameters
resourceThe surf vm
void surf_vm_suspend ( sg_host_t  vm)

Suspend a VM.

void surf_vm_resume ( sg_host_t  vm)

Resume a VM.

void surf_vm_save ( sg_host_t  resource)

Save the VM (Not yet implemented)

Parameters
resourceThe surf vm
void surf_vm_restore ( sg_host_t  resource)

Restore the VM (Not yet implemented)

Parameters
resourceThe surf vm
void surf_vm_migrate ( sg_host_t  resource,
sg_host_t  ind_vm_ws_dest 
)

Migrate the VM to the destination host.

Parameters
resourceThe surf vm
ind_vm_ws_destThe destination host
sg_host_t surf_vm_get_pm ( sg_host_t  resource)

Get the physical machine hosting the VM.

Parameters
resourceThe surf vm
Returns
The physical machine hosting the VM
void surf_vm_set_bound ( sg_host_t  resource,
double  bound 
)

[brief description]

[long description]

Parameters
resource[description]
bound[description]
void surf_vm_set_affinity ( sg_host_t  resource,
sg_host_t  cpu,
unsigned long  mask 
)

[brief description]

[long description]

Parameters
resource[description]
cpu[description]
mask[description]
xbt_dict_t surf_storage_get_content ( surf_resource_t  resource)

Get the content of a storage.

Parameters
resourceThe surf storage
Returns
A xbt_dict_t with path as keys and size in bytes as values
sg_size_t surf_storage_get_size ( surf_resource_t  resource)

Get the size in bytes of a storage.

Parameters
resourceThe surf storage
Returns
The size in bytes of the storage
sg_size_t surf_storage_get_free_size ( surf_resource_t  resource)

Get the available size in bytes of a storage.

Parameters
resourceThe surf storage
Returns
The available size in bytes of the storage
sg_size_t surf_storage_get_used_size ( surf_resource_t  resource)

Get the size in bytes of a storage.

Parameters
resourceThe surf storage
Returns
The used size in bytes of the storage
xbt_dict_t surf_storage_get_properties ( surf_resource_t  resource)

return the properties set associated to that storage

const char* surf_storage_get_host ( surf_resource_t  resource)

Get the host the storage is attached to.

Parameters
resourceThe surf storage
Returns
The host name may not exist.
void surf_cpu_action_set_bound ( surf_action_t  action,
double  bound 
)

[brief description]

[long description]

Parameters
actionThe surf cpu action
bound[description]
surf_file_t surf_storage_action_get_file ( surf_action_t  action)

Get the file associated to a storage action.

Parameters
actionThe surf storage action
Returns
The file associated to a storage action

Variable Documentation

double NOW