Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
inline two C calls in surf
authorMartin Quinson <martin.quinson@loria.fr>
Mon, 4 Jan 2016 22:58:53 +0000 (23:58 +0100)
committerMartin Quinson <martin.quinson@loria.fr>
Mon, 4 Jan 2016 22:58:53 +0000 (23:58 +0100)
src/include/surf/surf.h
src/simdag/sd_workstation.c
src/simgrid/host.cpp
src/surf/surf_c_bindings.cpp

index ab9ef84..cf58fce 100644 (file)
@@ -316,15 +316,9 @@ static inline void surf_host_set_state(surf_host_t host, e_surf_resource_state_t
        surf_resource_set_state((surf_cpp_resource_t)host, state);
 }
 
-/** @brief Get the speed of the cpu associated to a host */
-XBT_PUBLIC(double) surf_host_get_speed(sg_host_t resource, double load);
-
 /** @brief Get the available speed of cpu associated to a host */
 XBT_PUBLIC(double) surf_host_get_available_speed(sg_host_t host);
 
-/** @brief Get the number of cores of the cpu associated to a host */
-XBT_PUBLIC(int) surf_host_get_core(sg_host_t host);
-
 /** @brief Create a computation action on the given host */
 XBT_PUBLIC(surf_action_t) surf_host_execute(sg_host_t host, double size);
 
index e61ebda..13b33b9 100644 (file)
@@ -6,6 +6,7 @@
 
 #include "src/simdag/simdag_private.h"
 #include "simgrid/simdag.h"
+#include "simgrid/host.h"
 #include "xbt/dict.h"
 #include "xbt/lib.h"
 #include "xbt/sysdep.h"
@@ -260,7 +261,7 @@ int SD_route_get_size(SD_workstation_t src, SD_workstation_t dst)
  */
 double SD_workstation_get_power(SD_workstation_t workstation)
 {
-  return surf_host_get_speed(workstation, 1.0);
+  return sg_host_get_speed(workstation);
 }
 /**
  * \brief Returns the amount of cores of a workstation
@@ -269,7 +270,7 @@ double SD_workstation_get_power(SD_workstation_t workstation)
  * \return the amount of cores of this workstation
  */
 int SD_workstation_get_cores(SD_workstation_t workstation) {
-  return surf_host_get_core(workstation);
+  return sg_host_get_core(workstation);
 }
 
 /**
index cb72bc8..5c881b0 100644 (file)
@@ -126,8 +126,9 @@ void sg_host_simix_destroy(sg_host_t host) {
 
 // =========== user-level functions ===============
 // ================================================
+/** @brief Get the speed of the cpu associated to a host */
 double sg_host_get_speed(sg_host_t host){
-  return surf_host_get_speed(host, 1.0);
+       return host->p_cpu->getSpeed(1.0);
 }
 
 double sg_host_get_available_speed(sg_host_t host){
@@ -135,7 +136,7 @@ double sg_host_get_available_speed(sg_host_t host){
 }
 /** @brief Returns the number of core of the processor. */
 int sg_host_get_core(sg_host_t host) {
-       return surf_host_get_core(host);
+       return host->p_cpu->getCore();
 }
 /** @brief Returns the state of a host.
  *  @return 1 if the host is active or 0 if it has crashed.
index e9190b2..fc630e2 100644 (file)
@@ -259,18 +259,10 @@ xbt_dict_t sg_host_get_properties(sg_host_t host) {
        return get_casted_host(host)->getProperties();
 }
 
-double surf_host_get_speed(sg_host_t host, double load){
-  return host->p_cpu->getSpeed(load);
-}
-
 double surf_host_get_available_speed(sg_host_t host){
   return host->p_cpu->getAvailableSpeed();
 }
 
-int surf_host_get_core(sg_host_t host){
-  return host->p_cpu->getCore();
-}
-
 surf_action_t surf_host_execute(sg_host_t host, double size){
   return host->p_cpu->execute(size);
 }