tmgr_trace_t state_trace,
xbt_dict_t cpu_properties)
{
- Cpu *cpu = NULL;
- sg_host_t host = sg_host_by_name(name);
xbt_assert(xbt_dynar_getfirst_as(speedPeak, double) > 0.0,
"Speed has to be >0.0. Did you forget to specify the mandatory power attribute?");
xbt_assert(core > 0, "Invalid number of cores %d. Must be larger than 0", core);
-
- cpu = new CpuCas01(this, name, speedPeak, pstate, speedScale, speedTrace, core, state_initial, state_trace, cpu_properties);
- sg_host_surfcpu_register(host, cpu);
+ Cpu *cpu = new CpuCas01(this, name, speedPeak, pstate, speedScale, speedTrace, core, state_initial, state_trace, cpu_properties);
return cpu;
}
xbt_dict_t cpuProperties)
{
xbt_assert(core==1,"Multi-core not handled with this model yet");
- sg_host_t host = sg_host_by_name(name);
xbt_assert(xbt_dynar_getfirst_as(speedPeak, double) > 0.0,
"Speed has to be >0.0. Did you forget to specify the mandatory speed attribute?");
CpuTi *cpu = new CpuTi(this, name, speedPeak, pstate, speedScale, speedTrace,
core, stateInitial, stateTrace, cpuProperties);
- sg_host_surfcpu_register(host, cpu);
return cpu;
}
}
#endif /* SURF_MODEL_CPUTI_H_ */
-
xbt_dict_t cpu_properties)
{
double power_initial = xbt_dynar_get_as(powerPeak, pstate, double);
- sg_host_t sg_host = sg_host_by_name(name);
-
CpuL07 *cpu = new CpuL07(this, name, cpu_properties,
power_initial, power_scale, power_trace,
core, state_initial, state_trace);
- sg_host_surfcpu_register(sg_host, cpu);
return cpu;
}
host->initial_state,
host->state_trace,
host->properties);
+ sg_host_surfcpu_register(sg_host_by_name(host->id), cpu);
surf_host_model->createHost(host->id, net, cpu);
if (TRACE_is_enabled() && TRACE_needs_platform())
#include <algorithm>
+#include <simgrid/host.h>
+
#include "cpu_cas01.hpp"
#include "vm_hl13.hpp"
* is still used by the physical machine. */
sg_host_t sg_sub_ws = sg_host_by_name_or_create(sub_ws->getName());
p_netElm = new RoutingEdgeWrapper(sg_host_edge(sg_sub_ws));
- sg_host_edge_set(sg_host_by_name_or_create(name), p_netElm);
+ sg_host_t host = sg_host_by_name_or_create(name);
+ sg_host_edge_set(host, p_netElm);
p_subWs = sub_ws;
p_currentState = SURF_VM_STATE_CREATED;
SURF_RESOURCE_ON, // host->initial_state,
NULL, // host->state_trace,
NULL); // host->properties,
+ sg_host_surfcpu_register(host, p_cpu);
/* We create cpu_action corresponding to a VM process on the host operating system. */
/* FIXME: TODO: we have to periodically input GUESTOS_NOISE to the system? how ? */