xbt_heap_free(p_tiActionHeap);
}
-Cpu *CpuTiModel::createCpu(const char *name,
+Cpu *CpuTiModel::createCpu(simgrid::Host *host,
xbt_dynar_t speedPeak,
int pstate,
double speedScale,
xbt_assert(core==1,"Multi-core not handled with this model yet");
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,
+ CpuTi *cpu = new CpuTi(this, host, speedPeak, pstate, speedScale, speedTrace,
core, stateInitial, stateTrace);
return cpu;
}
/* connect all traces relative to hosts */
xbt_dict_foreach(trace_connect_list_host_avail, cursor, trace_name, elm) {
tmgr_trace_t trace = (tmgr_trace_t) xbt_dict_get_or_null(traces_set_list, trace_name);
- CpuTi *cpu = static_cast<CpuTi*>(sg_host_surfcpu(sg_host_by_name(elm)));
+ CpuTi *cpu = static_cast<CpuTi*>(sg_host_by_name(elm)->p_cpu);
xbt_assert(cpu, "Host %s undefined", elm);
xbt_assert(trace, "Trace %s undefined", trace_name);
xbt_dict_foreach(trace_connect_list_power, cursor, trace_name, elm) {
tmgr_trace_t trace = (tmgr_trace_t) xbt_dict_get_or_null(traces_set_list, trace_name);
- CpuTi *cpu = static_cast<CpuTi*>(sg_host_surfcpu(sg_host_by_name(elm)));
+ CpuTi *cpu = static_cast<CpuTi*>(sg_host_by_name(elm)->p_cpu);
xbt_assert(cpu, "Host %s undefined", elm);
xbt_assert(trace, "Trace %s undefined", trace_name);
/************
* Resource *
************/
-CpuTi::CpuTi(CpuTiModel *model, const char *name, xbt_dynar_t speedPeak,
+CpuTi::CpuTi(CpuTiModel *model, simgrid::Host *host, xbt_dynar_t speedPeak,
int pstate, double speedScale, tmgr_trace_t speedTrace, int core,
e_surf_resource_state_t stateInitial, tmgr_trace_t stateTrace)
- : Cpu(model, name, core, 0, speedScale, stateInitial)
+ : Cpu(model, host, NULL, pstate, core, 0, speedScale, stateInitial)
{
p_speedEvent = NULL;
m_speedScale = speedScale;
CpuTi *cpu)
: CpuAction(model_, cost, failed)
{
- m_suspended = 0; /* Should be useless because of the
- calloc but it seems to help valgrind... */
p_cpu = cpu;
m_indexHeap = -1;
p_cpu->modified(true);