Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
rename parameters all around to make their meaning unambiguous
[simgrid.git] / src / surf / workstation_interface.hpp
index 1be3e4a..13ccd60 100644 (file)
@@ -33,30 +33,32 @@ typedef WorkstationAction *WorkstationActionPtr;
  * @brief Callbacks handler which emit the callbacks after Workstation creation *
  * @details Callback functions have the following signature: `void(WorkstationPtr)`
  */
-extern surf_callback(void, WorkstationPtr) workstationCreatedCallbacks;
+XBT_PUBLIC_DATA(surf_callback(void, WorkstationPtr)) workstationCreatedCallbacks;
 
 /** @ingroup SURF_callbacks
  * @brief Callbacks handler which emit the callbacks after Workstation destruction *
  * @details Callback functions have the following signature: `void(WorkstationPtr)`
  */
-extern surf_callback(void, WorkstationPtr) workstationDestructedCallbacks;
+XBT_PUBLIC_DATA(surf_callback(void, WorkstationPtr)) workstationDestructedCallbacks;
 
 /** @ingroup SURF_callbacks
  * @brief Callbacks handler which emit the callbacks after Workstation State changed *
  * @details Callback functions have the following signature: `void(WorkstationActionPtr action, e_surf_resource_state_t old, e_surf_resource_state_t current)`
  */
-extern surf_callback(void, WorkstationPtr, e_surf_resource_state_t, e_surf_resource_state_t) workstationStateChangedCallbacks;
+XBT_PUBLIC_DATA(surf_callback(void, WorkstationPtr, e_surf_resource_state_t, e_surf_resource_state_t)) workstationStateChangedCallbacks;
 
 /** @ingroup SURF_callbacks
  * @brief Callbacks handler which emit the callbacks after WorkstationAction State changed *
  * @details Callback functions have the following signature: `void(WorkstationActionPtr action, e_surf_resource_state_t old, e_surf_resource_state_t current)`
  */
-extern surf_callback(void, WorkstationActionPtr, e_surf_action_state_t, e_surf_action_state_t) workstationActionStateChangedCallbacks;
+XBT_PUBLIC_DATA(surf_callback(void, WorkstationActionPtr, e_surf_action_state_t, e_surf_action_state_t)) workstationActionStateChangedCallbacks;
 
 /*********
  * Tools *
  *********/
-extern WorkstationModelPtr surf_workstation_model;
+XBT_PUBLIC_DATA(WorkstationModelPtr) surf_workstation_model;
+XBT_PUBLIC(void) workstation_parse_init(sg_platf_host_cbarg_t host);
+XBT_PUBLIC(void) workstation_add_traces();
 
 /*********
  * Model *
@@ -84,6 +86,9 @@ public:
    */
   ~WorkstationModel();
 
+  virtual WorkstationPtr createWorkstation(const char *name)=0;
+  void addTraces(){DIE_IMPOSSIBLE;}
+
   /**
    * @brief [brief description]
    * @details [long description]
@@ -96,15 +101,15 @@ public:
    *
    * @param workstation_nb [description]
    * @param workstation_list [description]
-   * @param computation_amount [description]
-   * @param communication_amount [description]
+   * @param flops_amount [description]
+   * @param bytes_amount [description]
    * @param rate [description]
    * @return [description]
    */
   virtual ActionPtr executeParallelTask(int workstation_nb,
                                         void **workstation_list,
-                                        double *computation_amount,
-                                        double *communication_amount,
+                                        double *flops_amount,
+                                        double *bytes_amount,
                                         double rate)=0;
 
  /**
@@ -160,8 +165,9 @@ public:
    * @param netElm The RoutingEdge associated to this Workstation
    * @param cpu The Cpu associated to this Workstation
    */
-  Workstation(ModelPtr model, const char *name, xbt_dict_t props, lmm_constraint_t constraint,
-                     xbt_dynar_t storage, RoutingEdgePtr netElm, CpuPtr cpu);
+  Workstation(ModelPtr model, const char *name, xbt_dict_t props,
+      lmm_constraint_t constraint, xbt_dynar_t storage, RoutingEdgePtr netElm,
+      CpuPtr cpu);
 
   /**
    * @brief Workstation destructor
@@ -180,11 +186,11 @@ public:
   /**
    * @brief Execute some quantity of computation
    *
-   * @param size The value of the processing amount (in flop) needed to process
+   * @param flops_amount The value of the processing amount (in flop) needed to process
    * @return The CpuAction corresponding to the processing
    * @see Cpu
    */
-  virtual ActionPtr execute(double size)=0;
+  virtual ActionPtr execute(double flops_amount)=0;
 
   /**
    * @brief Make a process sleep for duration seconds
@@ -330,23 +336,7 @@ public:
   virtual sg_size_t fileTell(surf_file_t fd);
 
   /**
-   * @brief Get the available space of the storage at the mount point
-   *
-   * @param name The mount point
-   * @return The amount of availble space in bytes
-   */
-  virtual sg_size_t getFreeSize(const char* name);
-
-  /**
-   * @brief Get the used space of the storage at the mount point
-   *
-   * @param name The mount point
-   * @return The amount of used space in bytes
-   */
-  virtual sg_size_t getUsedSize(const char* name);
-
-  /**
-   * @brief Set the position indictator assiociated with the file descriptor to a new position
+   * @brief Set the position indicator associated with the file descriptor to a new position
    * @details [long description]
    *
    * @param fd The file descriptor
@@ -357,7 +347,7 @@ public:
    *  - SEEK_END: end of the file
    * @return MSG_OK if successful, otherwise MSG_TASK_CANCELED
    */
-  virtual int fileSeek(surf_file_t fd, sg_size_t offset, int origin);
+  virtual int fileSeek(surf_file_t fd, sg_offset_t offset, int origin);
 
   /**
    * @brief Move a file to another location on the *same mount point*.