Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Remove a bunch of stuff from Host that was delegated to cpu anyway
authorMartin Quinson <martin.quinson@loria.fr>
Mon, 20 Jul 2015 23:27:19 +0000 (01:27 +0200)
committerMartin Quinson <martin.quinson@loria.fr>
Mon, 20 Jul 2015 23:27:19 +0000 (01:27 +0200)
- getSpeed()
- getAvailableSpeed()
- getCore()
- getCurrentPowerPeak();
- getPowerPeakAt(pstate_index);
- getNbPstates();
- {set,get}Pstate()

src/include/surf/surf.h
src/surf/host_interface.cpp
src/surf/host_interface.hpp
src/surf/surf_c_bindings.cpp

index d0f362e..c081bcb 100644 (file)
@@ -328,16 +328,16 @@ XBT_PUBLIC(double) surf_host_get_speed(surf_resource_t resource, double load);
  * @param resource The surf host
  * @return [description]
  */
-XBT_PUBLIC(double) surf_host_get_available_speed(surf_resource_t resource);
+XBT_PUBLIC(double) surf_host_get_available_speed(surf_resource_t host);
 
 /** @brief Get the number of cores of the cpu associated to a host */
-XBT_PUBLIC(int) surf_host_get_core(surf_resource_t resource);
+XBT_PUBLIC(int) surf_host_get_core(surf_resource_t host);
 
 /** @brief Create a computation action on the given host */
-XBT_PUBLIC(surf_action_t) surf_host_execute(surf_resource_t resource, double size);
+XBT_PUBLIC(surf_action_t) surf_host_execute(surf_resource_t host, double size);
 
 /** @brief Create a sleep action on the given host */
-XBT_PUBLIC(surf_action_t) surf_host_sleep(surf_resource_t resource, double duration);
+XBT_PUBLIC(surf_action_t) surf_host_sleep(surf_resource_t host, double duration);
 
 /** @brief Create a file opening action on the given host */
 XBT_PUBLIC(surf_action_t) surf_host_open(surf_resource_t host, const char* fullpath);
index 4382e94..956a0b6 100644 (file)
@@ -106,42 +106,6 @@ void Host::setState(e_surf_resource_state_t state){
   p_cpu->setState(state);
 }
 
-int Host::getCore(){
-  return p_cpu->getCore();
-}
-
-double Host::getSpeed(double load){
-  return p_cpu->getSpeed(load);
-}
-
-double Host::getAvailableSpeed(){
-  return p_cpu->getAvailableSpeed();
-}
-
-double Host::getCurrentPowerPeak()
-{
-  return p_cpu->getCurrentPowerPeak();
-}
-
-double Host::getPowerPeakAt(int pstate_index)
-{
-  return p_cpu->getPowerPeakAt(pstate_index);
-}
-
-int Host::getNbPstates()
-{
-  return p_cpu->getNbPstates();
-}
-
-void Host::setPstate(int pstate_index)
-{
-       p_cpu->setPstate(pstate_index);
-}
-int Host::getPstate()
-{
-       return p_cpu->getPstate();
-}
-
 xbt_dict_t Host::getProperties()
 {
   return p_cpu->getProperties();
index 0fd2d15..b451329 100644 (file)
@@ -143,40 +143,6 @@ public:
    */
   virtual Action *sleep(double duration)=0;
 
-  /**
-   * @brief Get the number of cores of the associated Cpu
-   *
-   * @return The number of cores of the associated Cpu
-   * @see Cpu
-   */
-  virtual int getCore();
-
-  /**
-   * @brief Get the speed of the associated Cpu
-   *
-   * @param load [TODO]
-   * @return The speed of the associated Cpu
-   * @see Cpu
-   */
-  virtual double getSpeed(double load);
-
-  /**
-   * @brief Get the available speed of the associated Cpu
-   * @details [TODO]
-   *
-   * @return The available speed of the associated Cpu
-   * @see Cpu
-   */
-  virtual double getAvailableSpeed();
-
-  /** @brief Get the associated Cpu power peak */
-  virtual double getCurrentPowerPeak();
-
-  virtual double getPowerPeakAt(int pstate_index);
-  virtual int getNbPstates();
-  virtual void setPstate(int pstate_index);
-  virtual int  getPstate();
-
   /** @brief Return the storage of corresponding mount point */
   virtual Storage *findStorageOnMountList(const char* storage);
 
index 9c172d4..a149c66 100644 (file)
@@ -266,43 +266,43 @@ void surf_resource_set_state(surf_cpp_resource_t resource, e_surf_resource_state
   resource->setState(state);
 }
 
-surf_action_t surf_host_sleep(surf_resource_t resource, double duration){
-  return get_casted_host(resource)->sleep(duration);
+surf_action_t surf_host_sleep(surf_resource_t host, double duration){
+  return get_casted_host(host)->sleep(duration);
 }
 
-double surf_host_get_speed(surf_resource_t resource, double load){
-  return get_casted_host(resource)->getSpeed(load);
+double surf_host_get_speed(surf_resource_t host, double load){
+  return sg_host_surfcpu(host)->getSpeed(load);
 }
 
-double surf_host_get_available_speed(surf_resource_t resource){
-  return get_casted_host(resource)->getAvailableSpeed();
+double surf_host_get_available_speed(surf_resource_t host){
+  return sg_host_surfcpu(host)->getAvailableSpeed();
 }
 
-int surf_host_get_core(surf_resource_t resource){
-  return get_casted_host(resource)->getCore();
+int surf_host_get_core(surf_resource_t host){
+  return sg_host_surfcpu(host)->getCore();
 }
 
-surf_action_t surf_host_execute(surf_resource_t resource, double size){
-  return get_casted_host(resource)->execute(size);
+surf_action_t surf_host_execute(surf_resource_t host, double size){
+  return get_casted_host(host)->execute(size);
 }
 
-double surf_host_get_current_power_peak(surf_resource_t resource){
-  return get_casted_host(resource)->getCurrentPowerPeak();
+double surf_host_get_current_power_peak(surf_resource_t host){
+  return sg_host_surfcpu(host)->getCurrentPowerPeak();
 }
 
-double surf_host_get_power_peak_at(surf_resource_t resource, int pstate_index){
-  return get_casted_host(resource)->getPowerPeakAt(pstate_index);
+double surf_host_get_power_peak_at(surf_resource_t host, int pstate_index){
+  return sg_host_surfcpu(host)->getPowerPeakAt(pstate_index);
 }
 
-int surf_host_get_nb_pstates(surf_resource_t resource){
-  return get_casted_host(resource)->getNbPstates();
+int surf_host_get_nb_pstates(surf_resource_t host){
+  return sg_host_surfcpu(host)->getNbPstates();
 }
 
-void surf_host_set_pstate(surf_resource_t resource, int pstate_index){
-  get_casted_host(resource)->setPstate(pstate_index);
+void surf_host_set_pstate(surf_resource_t host, int pstate_index){
+       sg_host_surfcpu(host)->setPstate(pstate_index);
 }
-int surf_host_get_pstate(surf_resource_t resource){
-  return get_casted_host(resource)->getPstate();
+int surf_host_get_pstate(surf_resource_t host){
+  return sg_host_surfcpu(host)->getPstate();
 }
 double surf_host_get_wattmin_at(surf_resource_t resource, int pstate){
   xbt_assert(surf_energy!=NULL, "The Energy plugin is not active. Please call sg_energy_plugin_init() during initialization.");