/** @brief Get the available speed of cpu associated to a host */
XBT_PUBLIC(double) surf_host_get_available_speed(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);
-
/** @brief Create a sleep action on the given host */
XBT_PUBLIC(surf_action_t) surf_host_sleep(sg_host_t host, double duration);
/* set surf's action */
if (!MC_is_active() && !MC_record_replay_is_active()) {
- synchro->execution.surf_exec = surf_host_execute(issuer->host, flops_amount);
+ synchro->execution.surf_exec = issuer->host->p_cpu->execute(flops_amount);
synchro->execution.surf_exec->setData(synchro);
synchro->execution.surf_exec->setPriority(priority);
Action *action =NULL;
if ((host_nb == 1)
&& (cost_or_zero(bytes_amount, 0) == 0.0)){
- action = surf_host_execute(host_list[0],flops_amount[0]);
+ action = host_list[0]->p_cpu->execute(flops_amount[0]);
} else if ((host_nb == 1)
&& (cost_or_zero(flops_amount, 0) == 0.0)) {
action = surf_network_model->communicate(host_list[0]->p_netcard,
return host->p_cpu->getAvailableSpeed();
}
-surf_action_t surf_host_execute(sg_host_t host, double size){
- return host->p_cpu->execute(size);
-}
-
double surf_host_get_current_power_peak(sg_host_t host){
return host->p_cpu->getCurrentPowerPeak();
}
#define cost_or_zero(array,pos) ((array)?(array)[pos]:0.0)
if ((host_nb == 1)
&& (cost_or_zero(bytes_amount, 0) == 0.0))
- return surf_host_execute(host_list[0], flops_amount[0]);
+ return host_list[0]->p_cpu->execute(flops_amount[0]);
else if ((host_nb == 1)
&& (cost_or_zero(flops_amount, 0) == 0.0))
return surf_network_model_communicate(surf_network_model, host_list[0], host_list[0],bytes_amount[0], rate);
#include "surf/surf.h"
#include "surf/surfxml_parse.h" // for reset callback
#include "src/surf/surf_interface.hpp"
+#include "src/surf/cpu_interface.hpp"
#include "xbt/log.h"
XBT_LOG_NEW_DEFAULT_CATEGORY(surf_test,
XBT_DEBUG("%s : %p", surf_cpu_name(hostB->p_cpu), hostB);
/* Let's do something on it */
- actionA = surf_host_execute(hostA, 1000.0);
- actionB = surf_host_execute(hostB, 1000.0);
+ actionA = hostA->p_cpu->execute(1000.0);
+ actionB = hostB->p_cpu->execute(1000.0);
actionC = surf_host_sleep(hostB, 7.32);
/* Use whatever calling style you want... */
#include "surf/surf.h"
#include "surf/surfxml_parse.h" // for reset callback
#include "src/surf/surf_interface.hpp"
+#include "src/surf/cpu_interface.hpp"
#include "xbt/log.h"
XBT_LOG_NEW_DEFAULT_CATEGORY(surf_test,
XBT_DEBUG("%s : %p", sg_host_get_name(hostB), hostB);
/* Let's do something on it */
- surf_host_execute(hostA, 1000.0);
- surf_host_execute(hostB, 1000.0);
+ hostA->p_cpu->execute(1000.0);
+ hostB->p_cpu->execute(1000.0);
surf_host_sleep(hostB, 7.32);
surf_network_model_communicate(surf_network_model, hostA, hostB, 150.0, -1.0);