Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
simplify a bit the CPU creation API
[simgrid.git] / src / surf / sg_platf.cpp
index a3ae7d8..1b6341f 100644 (file)
@@ -101,11 +101,16 @@ void sg_platf_new_host(sg_platf_host_cbarg_t host)
 
   simgrid::surf::Cpu *cpu = surf_cpu_model_pm->createCpu( h,
       host->speed_peak,
-      host->pstate,
       host->speed_scale, host->speed_trace,
       host->core_amount,
-      host->initiallyOn, host->state_trace);
+      host->state_trace);
   surf_host_model->createHost(host->id, netcard, cpu, host->properties)->attach(h);
+
+  if (host->pstate != 0)
+    cpu->setPState(host->pstate);
+  if (! host->initiallyOn)
+    cpu->turnOff();
+
   simgrid::s4u::Host::onCreation(*h);
 
   if (TRACE_is_enabled() && TRACE_needs_platform())