Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[surf] Move VMCreatedCallbacks outside of constructor
[simgrid.git] / src / surf / cpu_ti.cpp
index 00346bf..976a85c 100644 (file)
@@ -400,8 +400,8 @@ void surf_cpu_model_init_ti()
   cpu_ti_define_callbacks();
   Model *model_pm = static_cast<Model*>(surf_cpu_model_pm);
   Model *model_vm = static_cast<Model*>(surf_cpu_model_vm);
-  xbt_dynar_push(model_list, &model_pm);
-  xbt_dynar_push(model_list, &model_vm);
+  xbt_dynar_push(all_existing_models, &model_pm);
+  xbt_dynar_push(all_existing_models, &model_vm);
 }
 
 CpuTiModel::CpuTiModel() : CpuModel()
@@ -442,7 +442,7 @@ Cpu *CpuTiModel::createCpu(const char *name,
       "Power has to be >0.0. Did you forget to specify the mandatory power attribute?");
   CpuTi *cpu = new CpuTi(this, name, powerPeak, pstate, powerScale, powerTrace,
                           core, stateInitial, stateTrace, cpuProperties);
-  sg_host_surfcpu_set(host, cpu);
+  sg_host_surfcpu_register(host, cpu);
   return cpu;
 }
 
@@ -545,11 +545,10 @@ void CpuTiModel::addTraces()
 CpuTi::CpuTi(CpuTiModel *model, const char *name, xbt_dynar_t powerPeak,
         int pstate, double powerScale, tmgr_trace_t powerTrace, int core,
         e_surf_resource_state_t stateInitial, tmgr_trace_t stateTrace,
-       xbt_dict_t properties)
-: Cpu(model, name, properties, core, 0, powerScale)
+             xbt_dict_t properties)
+  : Cpu(model, name, properties, core, 0, powerScale, stateInitial)
 {
   p_powerEvent = NULL;
-  setState(stateInitial);
   m_powerScale = powerScale;
   m_core = core;
   tmgr_trace_t empty_trace;