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);
#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"
*/
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
* \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);
}
/**
// =========== 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){
}
/** @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.
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);
}