From: Martin Quinson Date: Fri, 11 May 2018 23:12:37 +0000 (+0200) Subject: cosmetics: snake_case some random local variables, fields and non-s4u methods X-Git-Tag: v3.20~241 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/fd2865e1ce63170aba3f6d6dcfe6b007c52e8cba?hp=89047acf6125582321f8e86f9765b0f57e350e2c cosmetics: snake_case some random local variables, fields and non-s4u methods --- diff --git a/src/kernel/activity/ExecImpl.cpp b/src/kernel/activity/ExecImpl.cpp index 20c99682d6..6cecccf6cf 100644 --- a/src/kernel/activity/ExecImpl.cpp +++ b/src/kernel/activity/ExecImpl.cpp @@ -126,19 +126,19 @@ simgrid::kernel::activity::ExecImpl::migrate(simgrid::s4u::Host* to) { if (not MC_is_active() && not MC_record_replay_is_active()) { - simgrid::kernel::resource::Action* oldAction = this->surf_action_; - simgrid::kernel::resource::Action* newAction = to->pimpl_cpu->execution_start(oldAction->get_cost()); - newAction->set_remains(oldAction->get_remains()); - newAction->set_data(this); - newAction->set_priority(oldAction->get_priority()); + simgrid::kernel::resource::Action* old_action = this->surf_action_; + simgrid::kernel::resource::Action* new_action = to->pimpl_cpu->execution_start(old_action->get_cost()); + new_action->set_remains(old_action->get_remains()); + new_action->set_data(this); + new_action->set_priority(old_action->get_priority()); // FIXME: the user-defined bound seem to not be kept by LMM, that seem to overwrite it for the multi-core modeling. // I hope that the user did not provide any. - oldAction->set_data(nullptr); - oldAction->cancel(); - oldAction->unref(); - this->surf_action_ = newAction; + old_action->set_data(nullptr); + old_action->cancel(); + old_action->unref(); + this->surf_action_ = new_action; } onMigration(this, to); diff --git a/src/surf/cpu_cas01.cpp b/src/surf/cpu_cas01.cpp index cc47188652..940e88b7b6 100644 --- a/src/surf/cpu_cas01.cpp +++ b/src/surf/cpu_cas01.cpp @@ -116,7 +116,7 @@ void CpuCas01::onSpeedChange() { CpuCas01Action* action = static_cast(var->get_id()); get_model()->get_maxmin_system()->update_variable_bound(action->get_variable(), - action->requestedCore() * speed_.scale * speed_.peak); + action->requested_core() * speed_.scale * speed_.peak); } Cpu::onSpeedChange(); @@ -172,9 +172,9 @@ CpuAction* CpuCas01::execution_start(double size) return new CpuCas01Action(get_model(), size, is_off(), speed_.scale * speed_.peak, get_constraint()); } -CpuAction* CpuCas01::execution_start(double size, int requestedCores) +CpuAction* CpuCas01::execution_start(double size, int requested_cores) { - return new CpuCas01Action(get_model(), size, is_off(), speed_.scale * speed_.peak, get_constraint(), requestedCores); + return new CpuCas01Action(get_model(), size, is_off(), speed_.scale * speed_.peak, get_constraint(), requested_cores); } CpuAction *CpuCas01::sleep(double duration) @@ -211,10 +211,10 @@ CpuAction *CpuCas01::sleep(double duration) * Action * **********/ CpuCas01Action::CpuCas01Action(kernel::resource::Model* model, double cost, bool failed, double speed, - kernel::lmm::Constraint* constraint, int requestedCore) + kernel::lmm::Constraint* constraint, int requested_core) : CpuAction(model, cost, failed, - model->get_maxmin_system()->variable_new(this, 1.0 / requestedCore, requestedCore * speed, 1)) - , requestedCore_(requestedCore) + model->get_maxmin_system()->variable_new(this, 1.0 / requested_core, requested_core * speed, 1)) + , requested_core_(requested_core) { if (model->get_update_algorithm() == kernel::resource::Model::UpdateAlgo::Lazy) { set_last_update(); @@ -225,13 +225,13 @@ CpuCas01Action::CpuCas01Action(kernel::resource::Model* model, double cost, bool CpuCas01Action::CpuCas01Action(kernel::resource::Model* model, double cost, bool failed, double speed, kernel::lmm::Constraint* constraint) - : CpuCas01Action(model, cost, failed, speed, constraint, 1) + : CpuCas01Action(model, cost, failed, speed, constraint, /* requested_core */ 1) { } -int CpuCas01Action::requestedCore() +int CpuCas01Action::requested_core() { - return requestedCore_; + return requested_core_; } CpuCas01Action::~CpuCas01Action()=default; diff --git a/src/surf/cpu_cas01.hpp b/src/surf/cpu_cas01.hpp index 38a81954c0..99cbea69e6 100644 --- a/src/surf/cpu_cas01.hpp +++ b/src/surf/cpu_cas01.hpp @@ -63,10 +63,10 @@ public: CpuCas01Action(kernel::resource::Model* model, double cost, bool failed, double speed, kernel::lmm::Constraint* constraint); ~CpuCas01Action() override; - int requestedCore(); + int requested_core(); private: - int requestedCore_ = 1; + int requested_core_ = 1; }; }