Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
give the VM a link to their PM as a simgrid::Host
[simgrid.git] / src / surf / cpu_interface.cpp
index 772e86a..10334fa 100644 (file)
@@ -22,7 +22,7 @@ namespace surf {
 
 simgrid::xbt::Extension<simgrid::Host, Cpu> Cpu::EXTENSION_ID;
 
-void Cpu::init()
+void Cpu::classInit()
 {
   if (!EXTENSION_ID.valid())
     EXTENSION_ID = simgrid::Host::extension_create<simgrid::surf::Cpu>();
@@ -189,14 +189,8 @@ Cpu::Cpu(Model *model, const char *name,
 : Cpu(model, name, core, speedPeak, speedScale, SURF_RESOURCE_ON)
 {}
 
-void Cpu::onDie()
-{
-  Resource::onDie();
-}
-
 Cpu::~Cpu()
 {
-  this->die();
   if (p_constraintCoreId){
     for (int i = 0; i < m_core; i++) {
          xbt_free(p_constraintCoreId[i]);
@@ -231,7 +225,7 @@ int Cpu::getCore()
 void Cpu::plug(simgrid::Host* host)
 {
   if (this->m_host != nullptr)
-    xbt_die("Already plugged into host %s", host->id().c_str());
+    xbt_die("Already plugged into host %s", host->getName().c_str());
   host->extension_set(this);
   this->m_host = host;
 }
@@ -336,10 +330,12 @@ void CpuAction::setAffinity(Cpu *cpu, unsigned long mask)
   XBT_OUT();
 }
 
+simgrid::surf::signal<void(simgrid::surf::CpuAction*, e_surf_action_state_t, e_surf_action_state_t)> CpuAction::onStateChange;
+
 void CpuAction::setState(e_surf_action_state_t state){
   e_surf_action_state_t old = getState();
   Action::setState(state);
-  cpuActionStateChangedCallbacks(this, old, state);
+  onStateChange(this, old, state);
 }
 
 }