X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/07c12189c716ea527ddcf8f8b55983213dead2bf..d8a58294b59b5660e91410d5c9e5a48e44c67005:/src/surf/surf_interface.cpp diff --git a/src/surf/surf_interface.cpp b/src/surf/surf_interface.cpp index 623aeba4ce..7db2906da7 100644 --- a/src/surf/surf_interface.cpp +++ b/src/surf/surf_interface.cpp @@ -46,8 +46,8 @@ simgrid::xbt::signal surfExitCallbacks; #include // FIXME: this plugin should not be linked to the core s_surf_model_description_t surf_plugin_description[] = { - {"Energy", "Cpu energy consumption.", &sg_energy_plugin_init}, - {nullptr, nullptr, nullptr} /* this array must be nullptr terminated */ + {"Energy", "Cpu energy consumption.", &sg_host_energy_plugin_init}, + {nullptr, nullptr, nullptr} /* this array must be nullptr terminated */ }; /* Don't forget to update the option description in smx_config when you change this */ @@ -579,11 +579,13 @@ void Resource::turnOff() isOn_ = false; } -Model *Resource::getModel() const { +Model* Resource::model() const +{ return model_; } -const char *Resource::getName() const { +const char* Resource::cname() const +{ return name_.c_str(); } @@ -591,7 +593,8 @@ bool Resource::operator==(const Resource &other) const { return name_ == other.name_; } -lmm_constraint_t Resource::getConstraint() const { +lmm_constraint_t Resource::constraint() const +{ return constraint_; } @@ -644,13 +647,13 @@ void Action::finish() { Action::State Action::getState() { - if (stateSet_ == getModel()->getReadyActionSet()) + if (stateSet_ == model_->getReadyActionSet()) return Action::State::ready; - if (stateSet_ == getModel()->getRunningActionSet()) + if (stateSet_ == model_->getRunningActionSet()) return Action::State::running; - if (stateSet_ == getModel()->getFailedActionSet()) + if (stateSet_ == model_->getFailedActionSet()) return Action::State::failed; - if (stateSet_ == getModel()->getDoneActionSet()) + if (stateSet_ == model_->getDoneActionSet()) return Action::State::done; return Action::State::not_in_the_system; } @@ -660,16 +663,16 @@ void Action::setState(Action::State state) stateSet_->erase(stateSet_->iterator_to(*this)); switch (state) { case Action::State::ready: - stateSet_ = getModel()->getReadyActionSet(); + stateSet_ = model_->getReadyActionSet(); break; case Action::State::running: - stateSet_ = getModel()->getRunningActionSet(); + stateSet_ = model_->getRunningActionSet(); break; case Action::State::failed: - stateSet_ = getModel()->getFailedActionSet(); + stateSet_ = model_->getFailedActionSet(); break; case Action::State::done: - stateSet_ = getModel()->getDoneActionSet(); + stateSet_ = model_->getDoneActionSet(); break; default: stateSet_ = nullptr; @@ -876,7 +879,7 @@ void Action::updateRemainingLazy(double now) if (getModel() == surf_cpu_model_pm && TRACE_is_enabled()) { simgrid::surf::Resource *cpu = static_cast( lmm_constraint_id(lmm_get_cnst_from_var(getModel()->getMaxminSystem(), getVariable(), 0))); - TRACE_surf_host_set_utilization(cpu->getName(), getCategory(), lastValue_, lastUpdate_, now - lastUpdate_); + TRACE_surf_host_set_utilization(cpu->cname(), getCategory(), lastValue_, lastUpdate_, now - lastUpdate_); } XBT_DEBUG("Updating action(%p): remains is now %f", this, remains_); }