Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' of scm.gforge.inria.fr:/gitroot/simgrid/simgrid
[simgrid.git] / src / include / surf / surf.h
index 701ae8c..fd80b13 100644 (file)
@@ -171,16 +171,12 @@ typedef enum {
 /* FIXME: Where should the VM state be defined? */
 typedef enum {
   SURF_VM_STATE_CREATED, /**< created, but not yet started */
 /* FIXME: Where should the VM state be defined? */
 typedef enum {
   SURF_VM_STATE_CREATED, /**< created, but not yet started */
-
   SURF_VM_STATE_RUNNING,
   SURF_VM_STATE_RUNNING,
-  SURF_VM_STATE_MIGRATING,
-
   SURF_VM_STATE_SUSPENDED, /**< Suspend/resume does not involve disk I/O, so we assume there is no transition states. */
 
   SURF_VM_STATE_SAVING, /**< Save/restore involves disk I/O, so there should be transition states. */
   SURF_VM_STATE_SAVED,
   SURF_VM_STATE_RESTORING,
   SURF_VM_STATE_SUSPENDED, /**< Suspend/resume does not involve disk I/O, so we assume there is no transition states. */
 
   SURF_VM_STATE_SAVING, /**< Save/restore involves disk I/O, so there should be transition states. */
   SURF_VM_STATE_SAVED,
   SURF_VM_STATE_RESTORING,
-
 } e_surf_vm_state_t;
 
 /***************************/
 } e_surf_vm_state_t;
 
 /***************************/
@@ -196,6 +192,9 @@ static inline void *surf_cpu_resource_priv(const void *host) {
 static inline void *surf_workstation_resource_priv(const void *host){
   return (void*)xbt_lib_get_level((xbt_dictelm_t)host, SURF_WKS_LEVEL);
 }
 static inline void *surf_workstation_resource_priv(const void *host){
   return (void*)xbt_lib_get_level((xbt_dictelm_t)host, SURF_WKS_LEVEL);
 }
+static inline void *surf_routing_resource_priv(const void *host){
+  return (void*)xbt_lib_get_level((xbt_dictelm_t)host, ROUTING_HOST_LEVEL);
+}
 static inline void *surf_storage_resource_priv(const void *storage){
   return (void*)xbt_lib_get_level((xbt_dictelm_t)storage, SURF_STORAGE_LEVEL);
 }
 static inline void *surf_storage_resource_priv(const void *storage){
   return (void*)xbt_lib_get_level((xbt_dictelm_t)storage, SURF_STORAGE_LEVEL);
 }
@@ -272,16 +271,16 @@ XBT_PUBLIC(int) surf_model_running_action_set_size(surf_model_t model);
  * @param model The model which handle the parallelisation
  * @param workstation_nb The number of workstations
  * @param workstation_list The list of workstations on which the task is executed
  * @param model The model which handle the parallelisation
  * @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
+ * @param flops_amount The processing amount (in flop) needed to process
+ * @param bytes_amount The amount of data (in bytes) needed to transfer
  * @param rate [description]
  * @return The action corresponding to the parallele execution task
  */
 XBT_PUBLIC(surf_action_t) surf_workstation_model_execute_parallel_task(surf_workstation_model_t model,
                                                    int workstation_nb,
                                             void **workstation_list,
  * @param rate [description]
  * @return The action corresponding to the parallele execution task
  */
 XBT_PUBLIC(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 *flops_amount,
+                                            double *bytes_amount,
                                             double rate);
 
 /**
                                             double rate);
 
 /**
@@ -621,14 +620,10 @@ XBT_PUBLIC(double) surf_workstation_get_power_peak_at(surf_resource_t host, int
  */
 XBT_PUBLIC(int) surf_workstation_get_nb_pstates(surf_resource_t host);
 
  */
 XBT_PUBLIC(int) surf_workstation_get_nb_pstates(surf_resource_t host);
 
-/**
- * @brief [brief description]
- * @details [long description]
- *
- * @param host [description]
- * @param pstate_index [description]
- */
-XBT_PUBLIC(void) surf_workstation_set_power_peak_at(surf_resource_t host, int pstate_index);
+XBT_PUBLIC(void) surf_workstation_set_pstate(surf_resource_t host, int pstate_index);
+XBT_PUBLIC(int) surf_workstation_get_pstate(surf_resource_t host);
+XBT_PUBLIC(double) surf_workstation_get_wattmin_at(surf_resource_t resource, int pstate);
+XBT_PUBLIC(double) surf_workstation_get_wattmax_at(surf_resource_t resource, int pstate);
 
 /**
  * @brief Get the consumed energy (in joules) of a workstation
 
 /**
  * @brief Get the consumed energy (in joules) of a workstation
@@ -708,7 +703,9 @@ XBT_PUBLIC(int) surf_workstation_file_move(surf_resource_t workstation, surf_fil
  *  - SEEK_END: end of the file
  * @return MSG_OK if successful, otherwise MSG_TASK_CANCELED
  */
  *  - SEEK_END: end of the file
  * @return MSG_OK if successful, otherwise MSG_TASK_CANCELED
  */
-XBT_PUBLIC(int) surf_workstation_file_seek(surf_resource_t workstation, surf_file_t fd, sg_size_t offset, int origin);
+XBT_PUBLIC(int) surf_workstation_file_seek(surf_resource_t workstation,
+                                           surf_file_t fd, sg_offset_t offset,
+                                           int origin);
 
 /**
  * @brief [brief description]
 
 /**
  * @brief [brief description]
@@ -751,6 +748,23 @@ XBT_PUBLIC(xbt_dict_t) surf_storage_get_content(surf_resource_t resource);
  */
 XBT_PUBLIC(sg_size_t) surf_storage_get_size(surf_resource_t resource);
 
  */
 XBT_PUBLIC(sg_size_t) surf_storage_get_size(surf_resource_t resource);
 
+/**
+ * @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
+ * @return The used size in bytes of the storage
+ */
+XBT_PUBLIC(sg_size_t) surf_storage_get_used_size(surf_resource_t resource);
+
+
 /**
  * @brief Get the data associated to the action
  *
 /**
  * @brief Get the data associated to the action
  *
@@ -915,7 +929,7 @@ XBT_PUBLIC(surf_model_t) surf_resource_model(const void *host, int level);
 /**************************************/
 
 XBT_PUBLIC_DATA(int) autoload_surf_cpu_model;
 /**************************************/
 
 XBT_PUBLIC_DATA(int) autoload_surf_cpu_model;
-extern void_f_void_t surf_cpu_model_init_preparse;
+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
 
 /** \ingroup SURF_models
  *  \brief The CPU model object for the physical machine layer
@@ -990,6 +1004,16 @@ XBT_PUBLIC_DATA(surf_network_model_t) surf_network_model;
  */
 XBT_PUBLIC(void) surf_network_model_init_SMPI(void);
 
  */
 XBT_PUBLIC(void) surf_network_model_init_SMPI(void);
 
+/** \ingroup SURF_models
+ *  \brief Same as network model 'LagrangeVelho', only with different correction factors.
+ *
+ * This model impelments a variant of the contention model on Infinband networks based on
+ * the works of Jérôme Vienne : http://mescal.imag.fr/membres/jean-marc.vincent/index.html/PhD/Vienne.pdf
+ *
+ *  \see surf_workstation_model_init_IB()
+ */
+XBT_PUBLIC(void) surf_network_model_init_IB(void);
+
 /** \ingroup SURF_models
  *  \brief Initializes the platform with the network model 'LegrandVelho'
  *
 /** \ingroup SURF_models
  *  \brief Initializes the platform with the network model 'LegrandVelho'
  *
@@ -1181,7 +1205,7 @@ XBT_PUBLIC_DATA(s_surf_model_description_t)
  *  Such model is subject to modification with warning in the ChangeLog so monitor it!
  *
  */
  *  Such model is subject to modification with warning in the ChangeLog so monitor it!
  *
  */
-XBT_PUBLIC(void) surf_vm_workstation_model_init_current_default(void);
+XBT_PUBLIC(void) surf_vm_workstation_model_init_HL13(void);
 
 /** \ingroup SURF_models
  *  \brief The list of all available vm workstation model models
 
 /** \ingroup SURF_models
  *  \brief The list of all available vm workstation model models
@@ -1205,13 +1229,14 @@ XBT_PUBLIC_DATA(xbt_dynar_t) host_that_restart;
 /** \ingroup SURF_simulation
  *  \brief List of hosts for which one want to be notified if they ever restart.
  */
 /** \ingroup SURF_simulation
  *  \brief List of hosts for which one want to be notified if they ever restart.
  */
-XBT_PUBLIC(xbt_dict_t) watched_hosts_lib;
+XBT_PUBLIC_DATA(xbt_dict_t) watched_hosts_lib;
 
 /*******************************************/
 /*** SURF Platform *************************/
 /*******************************************/
 XBT_PUBLIC_DATA(AS_t) surf_AS_get_routing_root(void);
 XBT_PUBLIC_DATA(const char *) surf_AS_get_name(AS_t as);
 
 /*******************************************/
 /*** SURF Platform *************************/
 /*******************************************/
 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);
 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);