Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
leak plug and cosmetics
[simgrid.git] / src / surf / cpu_interface.cpp
index 5b31783..a857298 100644 (file)
@@ -185,6 +185,8 @@ Cpu::~Cpu()
   }
   if (p_constraintCoreId)
     xbt_free(p_constraintCoreId);
+  if (p_speedPeakList)
+    xbt_dynar_free(&p_speedPeakList);
 }
 
 double Cpu::getCurrentPowerPeak()
@@ -245,6 +247,20 @@ int Cpu::getCore()
   return m_core;
 }
 
+void Cpu::set_state_trace(tmgr_trace_t trace)
+{
+  xbt_assert(p_stateEvent==NULL,"Cannot set a second state trace to Host %s", m_host->name().c_str());
+
+  p_stateEvent = future_evt_set->add_trace(trace, 0.0, this);
+}
+void Cpu::set_speed_trace(tmgr_trace_t trace)
+{
+  xbt_assert(p_speedEvent==NULL,"Cannot set a second speed trace to Host %s", m_host->name().c_str());
+
+  p_speedEvent = future_evt_set->add_trace(trace, 0.0, this);
+}
+
+
 /**********
  * Action *
  **********/