X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/a714f2cc13ccf01d24d8848aafc9085aef8eb6ce..e9c3452d0a6bdc89e663102456eb7a8e9b085077:/src/surf/cpu_interface.cpp diff --git a/src/surf/cpu_interface.cpp b/src/surf/cpu_interface.cpp index feca4113d0..772e86ae3f 100644 --- a/src/surf/cpu_interface.cpp +++ b/src/surf/cpu_interface.cpp @@ -20,12 +20,12 @@ simgrid::surf::CpuModel *surf_cpu_model_vm; namespace simgrid { namespace surf { -simgrid::xbt::FacetLevel Cpu::LEVEL; +simgrid::xbt::Extension Cpu::EXTENSION_ID; void Cpu::init() { - if (!LEVEL.valid()) - LEVEL = simgrid::Host::add_level(); + if (!EXTENSION_ID.valid()) + EXTENSION_ID = simgrid::Host::extension_create(); } /************* @@ -38,10 +38,8 @@ Cpu *getActionCpu(CpuAction *action) { action->getVariable(), 0))); } -simgrid::surf::signal cpuCreatedCallbacks; -simgrid::surf::signal cpuDestructedCallbacks; -simgrid::surf::signal cpuStateChangedCallbacks; simgrid::surf::signal cpuActionStateChangedCallbacks; + void cpu_add_traces(){ surf_cpu_model_pm->addTraces(); } @@ -193,7 +191,6 @@ Cpu::Cpu(Model *model, const char *name, void Cpu::onDie() { - cpuDestructedCallbacks(this); Resource::onDie(); } @@ -231,22 +228,12 @@ int Cpu::getCore() return m_core; } -void Cpu::setState(e_surf_resource_state_t state) -{ - e_surf_resource_state_t old = Resource::getState(); - Resource::setState(state); - cpuStateChangedCallbacks(this, old, state); -} - void Cpu::plug(simgrid::Host* host) { if (this->m_host != nullptr) - xbt_die("Aleady plugged into host %s", host->id().c_str()); - host->set_facet(this); + xbt_die("Already plugged into host %s", host->id().c_str()); + host->extension_set(this); this->m_host = host; - simgrid::surf::cpuCreatedCallbacks(this); - simgrid::surf::cpuStateChangedCallbacks(this, - SURF_RESOURCE_ON, this->getState()); } /**********