SimGrid  3.16
Versatile Simulation of Distributed Systems
surf_c_bindings.cpp File Reference
#include "simgrid/s4u/Engine.hpp"
#include "src/instr/instr_private.h"
#include "src/plugins/vm/VirtualMachineImpl.hpp"

Functions

 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY (surf_kernel)
 
void surf_presolve ()
 Finish simulation initialization. More...
 
double surf_solve (double max_date)
 Performs a part of the simulation. More...
 
static surf_action_t ActionListExtract (simgrid::surf::ActionList *list)
 
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...
 
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...
 
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...
 
sg_size_t surf_storage_get_size (surf_storage_t resource)
 Get the size in bytes of a storage. More...
 
sg_size_t surf_storage_get_free_size (surf_storage_t resource)
 Get the available size in bytes of a storage. More...
 
sg_size_t surf_storage_get_used_size (surf_storage_t resource)
 Get the size in bytes of a storage. More...
 
xbt_dict_t surf_storage_get_properties (surf_storage_t resource)
 return the properties set associated to that storage More...
 
const char * surf_storage_get_host (surf_storage_t resource)
 Get the host the storage is attached to. More...
 
const char * surf_storage_get_name (surf_storage_t resource)
 
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()

XBT_LOG_EXTERNAL_DEFAULT_CATEGORY ( surf_kernel  )

◆ ActionListExtract()

static surf_action_t ActionListExtract ( simgrid::surf::ActionList list)
static

◆ surf_model_extract_failed_action_set()

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

◆ surf_model_running_action_set_size()

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

◆ surf_host_close()

surf_action_t surf_host_close ( sg_host_t  host,
surf_file_t  fd 
)

Create a file closing action on the given host.

◆ surf_host_unlink()

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

◆ surf_host_get_size()

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_host_read()

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_host_write()

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.

◆ surf_host_file_tell()

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

◆ surf_host_file_seek()

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

◆ surf_host_file_move()

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

◆ surf_storage_get_size()

sg_size_t surf_storage_get_size ( surf_storage_t  resource)

Get the size in bytes of a storage.

Parameters
resourceThe surf storage
Returns
The size in bytes of the storage

◆ surf_storage_get_free_size()

sg_size_t surf_storage_get_free_size ( surf_storage_t  resource)

Get the available size in bytes of a storage.

Parameters
resourceThe surf storage
Returns
The available size in bytes of the storage

◆ surf_storage_get_used_size()

sg_size_t surf_storage_get_used_size ( surf_storage_t  resource)

Get the size in bytes of a storage.

Parameters
resourceThe surf storage
Returns
The used size in bytes of the storage

◆ surf_storage_get_properties()

xbt_dict_t surf_storage_get_properties ( surf_storage_t  resource)

return the properties set associated to that storage

◆ surf_storage_get_host()

const char* surf_storage_get_host ( surf_storage_t  resource)

Get the host the storage is attached to.

Parameters
resourceThe surf storage
Returns
The host name may not exist.

◆ surf_storage_get_name()

const char* surf_storage_get_name ( surf_storage_t  resource)

◆ surf_cpu_action_set_bound()

void surf_cpu_action_set_bound ( surf_action_t  action,
double  bound 
)

[brief description]

[long description]

Parameters
actionThe surf cpu action
bound[description]

◆ surf_storage_action_get_file()

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

◆ NOW

double NOW