typedef struct RoutingPlatf RoutingPlatf;
#endif
-/** \ingroup SURF_models
+/** @ingroup SURF_c_bindings
* \brief Model datatype
*
* Generic data structure for a model. The workstations,
typedef NetworkCm02Link *surf_network_link_t;
typedef Cpu *surf_cpu_t;
-/** \ingroup SURF_actions
+/** @ingroup SURF_c_bindings
* \brief Action structure
*
* Never create s_surf_action_t by yourself ! The actions are created
* \see e_surf_action_state_t
*/
typedef Action *surf_action_t;
-typedef ActionLmm *surf_action_lmm_t;
-typedef StorageActionLmm *surf_storage_action_lmm_t;
typedef As *AS_t;
typedef RoutingEdge *routing_edge_t;
} e_surf_action_state_t;
/** @ingroup SURF_vm_interface
- *
- *
+ *
+ *
*/
/* FIXME: Where should the VM state be defined? */
typedef enum {
/** @{ @ingroup SURF_c_bindings */
-/**
+/**
* @brief Get the name of a surf model
- *
+ *
* @param model A model
* @return The name of the model
*/
/**
* @brief Pop an action from the done actions set
- *
+ *
* @param model The model from which the action is extracted
* @return An action in done state
*/
/**
* @brief Pop an action from the failed actions set
- *
+ *
* @param model The model from which the action is extracted
* @return An action in failed state
*/
/**
* @brief Pop an action from the ready actions set
- *
+ *
* @param model The model from which the action is extracted
* @return An action in ready state
*/
/**
* @brief Pop an action from the running actions set
- *
+ *
* @param model The model from which the action is extracted
* @return An action in running state
*/
/**
* @brief Get the size of the running action set of a model
- *
+ *
* @param model The model
* @return The size of the running action set
*/
/**
* @brief Execute a parallel task
* @details [long description]
- *
+ *
* @param model The model which handle the parallelisation
- * @param workstation_nb The number of workstations
+ * @param workstation_nb The number of workstations
* @param workstation_list The list of workstations on which the task is executed
* @param computation_amount The processing amount (in flop) needed to process
* @param communication_amount The amount of data (in bytes) needed to transfer
/**
* @brief Create a communication between two hosts
- *
+ *
* @param model The model which handle the communication
* @param src The source host
* @param dst The destination host
/**
* @brief Get the route between two hosts
* @details [long description]
- *
+ *
* @param model The model which handle the routes
* @param src The source host
* @param dst The destination host
/**
* @brief Create a new VM on the specified host
- *
+ *
* @param name The name of the workstation
* @param ind_phys_host The host on which the VM is created
*/
/**
* @brief Create a communication between two routing edges [TODO]
* @details [long description]
- *
+ *
* @param model The model which handle the communication
* @param src The source host
* @param dst The destination host
/**
* @brief Get the name of a surf resource (cpu, workstation, network, …)
- *
+ *
* @param resource The surf resource
* @return The name of the surf resource
*/
/**
* @brief Get the properties of a surf resource (cpu, workstation, network, …)
- *
+ *
* @param resource The surf resource
* @return The properties of the surf resource
*/
/**
* @brief Get the state of a surf resource (cpu, workstation, network, …)
- *
+ *
* @param resource The surf resource
* @return The state of the surf resource
*/
/**
* @brief Set the state of a surf resource (cpu, workstation, network, …)
- *
+ *
* @param resource The surf resource
* @param state The new state of the surf resource
*/
/**
* @brief Get the speed of the cpu associtated to a workstation
- *
+ *
* @param resource The surf workstation
* @param load [description]
- *
+ *
* @return [description]
*/
XBT_PUBLIC(double) surf_workstation_get_speed(surf_resource_t resource, double load);
/**
* @brief Get the available speed of cpu associtated to a workstation
- *
+ *
* @param resource The surf workstation
* @return [description]
*/
/**
* @brief Get the number of cores of the cpu associated to a workstation
- *
+ *
* @param resource The surf workstation
* @return The number of cores
*/
*
* @param resource The surf workstation
* @param size The value of the processing amount (in flop) needed to process
- *
+ *
* @return The surf action corresponding to the processing
*/
XBT_PUBLIC(surf_action_t) surf_workstation_execute(surf_resource_t resource, double size);
/**
* @brief Make the workstation sleep
- *
+ *
* @param resource The surf workstation
* @param duration The number of seconds to sleep
* @return The surf action corresponding to the sleep
/**
* @brief Open a file on a workstation
- *
+ *
* @param workstation The surf workstation
- * @param mount The mount point
- * @param path The path to the file
+ * @param fullpath The path to the file
* @return The surf action corresponding to the openning
*/
-XBT_PUBLIC(surf_action_t) surf_workstation_open(surf_resource_t workstation, const char* mount, const char* path);
+XBT_PUBLIC(surf_action_t) surf_workstation_open(surf_resource_t workstation, const char* fullpath);
/**
* @brief Close a file descriptor on a workstation
- *
+ *
* @param workstation The surf workstation
* @param fd The file descriptor
- *
+ *
* @return The surf action corresponding to the closing
*/
XBT_PUBLIC(surf_action_t) surf_workstation_close(surf_resource_t workstation, surf_file_t fd);
/**
* @brief Read a file
- *
+ *
* @param resource The surf workstation
* @param fd The file descriptor to read
* @param size The size in bytes to read
/**
* @brief Write a file
- *
+ *
* @param resource The surf workstation
* @param fd The file descriptor to write
* @param size The size in bytes to write
* - the storage name,
* - the storage typeId,
* - the storage content type
- *
+ *
* @param resource The surf workstation
* @param fd The file descriptor
* @return An xbt_dynar_t with the file informations
/**
* @brief Get the available space of the storage at the mount point
- *
+ *
* @param resource The surf workstation
* @param name The mount point
* @return The amount of availble space in bytes
/**
* @brief Get the used space of the storage at the mount point
- *
+ *
* @param resource The surf workstation
* @param name The mount point
* @return The amount of used space in bytes
/**
* @brief Get the VMs hosted on the workstation
- *
+ *
* @param resource The surf workstation
* @return The list of VMs on the workstation
*/
/**
* @brief [brief description]
* @details [long description]
- *
+ *
* @param resource [description]
* @param params [description]
*/
/**
* @brief [brief description]
* @details [long description]
- *
+ *
* @param resource [description]
* @param params [description]
*/
/**
* @brief Destroy a Workstation VM
- *
+ *
* @param resource The surf workstation vm
*/
XBT_PUBLIC(void) surf_vm_workstation_destroy(surf_resource_t resource);
/**
* @brief Suspend a Workstation VM
- *
+ *
* @param resource The surf workstation vm
*/
XBT_PUBLIC(void) surf_vm_workstation_suspend(surf_resource_t resource);
/**
* @brief Resume a Workstation VM
- *
+ *
* @param resource The surf workstation vm
*/
XBT_PUBLIC(void) surf_vm_workstation_resume(surf_resource_t resource);
/**
* @brief Save the Workstation VM (Not yet implemented)
- *
+ *
* @param resource The surf workstation vm
*/
XBT_PUBLIC(void) surf_vm_workstation_save(surf_resource_t resource);
/**
* @brief Restore the Workstation VM (Not yet implemented)
- *
+ *
* @param resource The surf workstation vm
*/
XBT_PUBLIC(void) surf_vm_workstation_restore(surf_resource_t resource);
/**
* @brief Migrate the VM to the destination host
- *
+ *
* @param resource The surf workstation vm
* @param ind_vm_ws_dest The destination host
*/
/**
* @brief Get the physical machine hosting the VM
- *
+ *
* @param resource The surf workstation vm
* @return The physical machine hosting the VM
*/
/**
* @brief [brief description]
* @details [long description]
- *
+ *
* @param resource [description]
* @param bound [description]
*/
/**
* @brief [brief description]
* @details [long description]
- *
+ *
* @param resource [description]
* @param cpu [description]
* @param mask [description]
/**
* @brief Execute some quantity of computation
- *
+ *
* @param cpu The surf cpu
* @param size The value of the processing amount (in flop) needed to process
* @return The surf action corresponding to the processing
/**
* @brief Make the cpu sleep for duration (in seconds)
* @details [long description]
- *
+ *
* @param cpu The surf cpu
* @param duration The number of seconds to sleep
* @return The surf action corresponding to the sleeping
/**
* @brief Get the workstation power peak
* @details [long description]
- *
+ *
* @param host The surf workstation
* @return The power peak
*/
/**
* @brief [brief description]
* @details [long description]
- *
+ *
* @param host [description]
* @param pstate_index [description]
- *
+ *
* @return [description]
*/
XBT_PUBLIC(double) surf_workstation_get_power_peak_at(surf_resource_t host, int pstate_index);
/**
* @brief [brief description]
* @details [long description]
- *
+ *
* @param host [description]
* @return [description]
*/
/**
* @brief [brief description]
* @details [long description]
- *
+ *
* @param host [description]
* @param pstate_index [description]
*/
/**
* @brief Get the consumed energy (in joules) of a workstation
- *
+ *
* @param host The surf workstation
* @return The consumed energy
*/
XBT_PUBLIC(double) surf_workstation_get_consumed_energy(surf_resource_t host);
/**
- * @brief Get the list of storages of a workstation
- *
+ * @brief Get the list of storages mounted on a workstation
+ *
* @param workstation The surf workstation
* @return Dictionary of mount point, Storage
*/
-XBT_PUBLIC(xbt_dict_t) surf_workstation_get_storage_list(surf_resource_t workstation);
+XBT_PUBLIC(xbt_dict_t) surf_workstation_get_mounted_storage_list(surf_resource_t workstation);
/**
- * @brief Unlink a file descriptor
- *
+ * @brief Get the list of storages attached to a workstation
+ *
* @param workstation The surf workstation
- * @param fd The file descriptor
- *
- * @return 0 if failed to unlink, 1 otherwise
+ * @return Dictionary of storage
*/
-XBT_PUBLIC(int) surf_workstation_unlink(surf_resource_t workstation, surf_file_t fd);
+XBT_PUBLIC(xbt_dynar_t) surf_workstation_get_attached_storage_list(surf_resource_t workstation);
/**
- * @brief List directory contents of a path
- * @details [long description]
- *
+ * @brief Unlink a file descriptor
+ *
* @param workstation The surf workstation
- * @param mount The mount point
- * @param path The path to the directory
- * @return The surf action corresponding to the ls action
+ * @param fd The file descriptor
+ *
+ * @return 0 if failed to unlink, 1 otherwise
*/
-XBT_PUBLIC(surf_action_t) surf_workstation_ls(surf_resource_t workstation, const char* mount, const char *path);
+XBT_PUBLIC(int) surf_workstation_unlink(surf_resource_t workstation, surf_file_t fd);
/**
* @brief Get the size of a file on a workstation
- *
+ *
* @param workstation The surf workstation
* @param fd The file descriptor
- *
+ *
* @return The size in bytes of the file
*/
XBT_PUBLIC(size_t) surf_workstation_get_size(surf_resource_t workstation, surf_file_t fd);
/**
* @brief Get the current position of the file descriptor
- *
+ *
* @param workstation The surf workstation
* @param fd The file descriptor
* @return The current position of the file descriptor
*/
XBT_PUBLIC(size_t) surf_workstation_file_tell(surf_resource_t workstation, surf_file_t fd);
+/**
+ * @brief Move a file to another location on the *same mount point*.
+ * @details [long description]
+ *
+ * @param workstation The surf workstation
+ * @param fd The file descriptor
+ * @param fullpath The new full path
+ *
+ * @return MSG_OK if successful, otherwise MSG_TASK_CANCELED
+ */
+XBT_PUBLIC(int) surf_workstation_file_move(surf_resource_t workstation, surf_file_t fd, const char* fullpath);
+
/**
* @brief Set the position indictator assiociated with the file descriptor to a new position
* @details [long description]
- *
+ *
* @param workstation The surf workstation
* @param fd The file descriptor
* @param offset The offset from the origin
/**
* @brief [brief description]
* @details [long description]
- *
+ *
* @param link [description]
* @return [description]
*/
/**
* @brief Get the bandwidth of a link in bytes per second
- *
+ *
* @param link The surf link
* @return The bandwidth in bytes per second
*/
/**
* @brief Get the latency of a link in seconds
- *
+ *
* @param link The surf link
* @return The latency in seconds
*/
/**
* @brief Get the content of a storage
- *
+ *
* @param resource The surf storage
* @return A xbt_dict_t with path as keys and size in bytes as values
*/
/**
* @brief Get the size in bytes of a storage
- *
+ *
* @param resource The surf storage
* @return The size in bytes of the storage
*/
XBT_PUBLIC(sg_size_t) surf_storage_get_size(surf_resource_t resource);
/**
- * @brief Rename a path
- *
+ * @brief Get the available size in bytes of a storage
+ *
+ * @param resource The surf storage
+ * @return The available size in bytes of the storage
+ */
+XBT_PUBLIC(sg_size_t) surf_storage_get_free_size(surf_resource_t resource);
+
+/**
+ * @brief Get the size in bytes of a storage
+ *
* @param resource The surf storage
- * @param src The old path
- * @param dest The new path
+ * @return The used size in bytes of the storage
*/
-XBT_PUBLIC(void) surf_storage_rename(surf_resource_t resource, const char* src, const char* dest);
+XBT_PUBLIC(sg_size_t) surf_storage_get_used_size(surf_resource_t resource);
+
/**
* @brief Get the data associated to the action
- *
+ *
* @param action The surf action
* @return The data associated to the action
*/
/**
* @brief Set the data associated to the action
* @details [long description]
- *
+ *
* @param action The surf action
* @param data The new data associated to the action
*/
/**
* @brief Unreference an action
- *
+ *
* @param action The surf action
*/
XBT_PUBLIC(void) surf_action_unref(surf_action_t action);
/**
* @brief Get the start time of an action
- *
+ *
* @param action The surf action
* @return The start time in seconds from the beginning of the simulation
*/
/**
* @brief Get the finish time of an action
- *
+ *
* @param action The surf action
* @return The finish time in seconds from the beginning of the simulation
*/
/**
* @brief Get the remains amount of work to do of an action
- *
+ *
* @param action The surf action
* @return The remains amount of work to do
*/
/**
* @brief Suspend an action
- *
+ *
* @param action The surf action
*/
XBT_PUBLIC(void) surf_action_suspend(surf_action_t action);
/**
* @brief Resume an action
- *
+ *
* @param action The surf action
*/
XBT_PUBLIC(void) surf_action_resume(surf_action_t action);
/**
* @brief Cancel an action
- *
+ *
* @param action The surf action
*/
XBT_PUBLIC(void) surf_action_cancel(surf_action_t action);
/**
* @brief Set the priority of an action
* @details [long description]
- *
+ *
* @param action The surf action
* @param priority The new priority [TODO]
*/
/**
* @brief Set the category of an action
* @details [long description]
- *
+ *
* @param action The surf action
* @param category The new category of the action
*/
XBT_PUBLIC(void) surf_action_set_category(surf_action_t action, const char *category);
/**
- * @brief Get the state of an action
- *
+ * @brief Get the state of an action
+ *
* @param action The surf action
* @return The state of the action
*/
/**
* @brief Get the cost of an action
- *
+ *
* @param action The surf action
* @return The cost of the action
*/
/**
* @brief [brief desrciption]
* @details [long description]
- *
+ *
* @param action The surf cpu action
* @param cpu [description]
* @param mask [description]
/**
* @brief [brief description]
* @details [long description]
- *
+ *
* @param action The surf cpu action
* @param bound [description]
*/
/**
* @brief Get the file associated to a storage action
- *
+ *
* @param action The surf storage action
* @return The file associated to a storage action
*/
/**
* @brief Get the result dictionary of an ls action
- *
+ *
* @param action The surf storage action
* @return The dictionry listing a path
*/
XBT_PUBLIC(xbt_dict_t) surf_storage_action_get_ls_dict(surf_action_t action);
+
+/**
+ * @brief Get the host the storage is attached to
+ *
+ * @param resource The surf storage
+ * @return The host name
+ */
+XBT_PUBLIC(const char * ) surf_storage_get_host(surf_resource_t resource);
+
XBT_PUBLIC(surf_model_t) surf_resource_model(const void *host, int level);
/** @} */
/* Implementations of model object */
/**************************************/
+XBT_PUBLIC_DATA(int) autoload_surf_cpu_model;
+XBT_PUBLIC_DATA(void_f_void_t) surf_cpu_model_init_preparse;
+
/** \ingroup SURF_models
* \brief The CPU model object for the physical machine layer
*/
/*******************************************/
/*** SURF Platform *************************/
/*******************************************/
-XBT_PUBLIC_DATA(AS_t) surf_AS_get_routing_root(void);
+XBT_PUBLIC_DATA(AS_t) surf_AS_get_routing_root(void);
XBT_PUBLIC_DATA(const char *) surf_AS_get_name(AS_t as);
+XBT_PUBLIC_DATA(AS_t) surf_AS_get_by_name(const char * name);
XBT_PUBLIC_DATA(xbt_dict_t) surf_AS_get_routing_sons(AS_t as);
XBT_PUBLIC_DATA(const char *) surf_AS_get_model(AS_t as);
XBT_PUBLIC_DATA(xbt_dynar_t) surf_AS_get_hosts(AS_t as);
*
* This function has to be called to initialize the common
* structures. Then you will have to create the environment by
- * calling
+ * calling
* e.g. surf_workstation_model_init_CM02()
*
* \see surf_workstation_model_init_CM02(), surf_workstation_model_init_compound(), surf_exit()