X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/22a45a8d97ef0f1211ee05f9c16d7d90b37cf33b..9caf173e476622d309cc5653a83d224d05787cc7:/src/surf/cpu_cas01.cpp diff --git a/src/surf/cpu_cas01.cpp b/src/surf/cpu_cas01.cpp index d9f5f14c59..a9a81104ff 100644 --- a/src/surf/cpu_cas01.cpp +++ b/src/surf/cpu_cas01.cpp @@ -14,6 +14,10 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_cpu_cas, surf_cpu, "Logging specific to the SURF CPU module"); +/*********** + * Options * + ***********/ + static simgrid::config::Flag cpu_optim_opt("cpu/optim", "Optimization algorithm to use for CPU resources. ", "Lazy", @@ -69,9 +73,6 @@ CpuCas01Model::CpuCas01Model(kernel::resource::Model::UpdateAlgo algo) : simgrid } set_maxmin_system(new simgrid::kernel::lmm::System(select)); - - if (algo == Model::UpdateAlgo::Lazy) - get_maxmin_system()->modified_set_ = new kernel::resource::Action::ModifiedSet(); } CpuCas01Model::~CpuCas01Model() @@ -103,7 +104,7 @@ std::vector * CpuCas01::getSpeedPeakList(){ return &speedPerPstate_; } -bool CpuCas01::isUsed() +bool CpuCas01::is_used() { return model()->get_maxmin_system()->constraint_used(constraint()); } @@ -184,7 +185,7 @@ CpuAction *CpuCas01::sleep(double duration) if (duration > 0) duration = std::max(duration, sg_surf_precision); - XBT_IN("(%s,%g)", getCname(), duration); + XBT_IN("(%s,%g)", get_cname(), duration); CpuCas01Action* action = new CpuCas01Action(model(), 1.0, isOff(), speed_.scale * speed_.peak, constraint()); // FIXME: sleep variables should not consume 1.0 in System::expand() @@ -198,8 +199,8 @@ CpuAction *CpuCas01::sleep(double duration) } model()->get_maxmin_system()->update_variable_weight(action->get_variable(), 0.0); - if (model()->getUpdateMechanism() == kernel::resource::Model::UpdateAlgo::Lazy) { // remove action from the heap - action->heapRemove(); + if (model()->get_update_algorithm() == kernel::resource::Model::UpdateAlgo::Lazy) { // remove action from the heap + model()->get_action_heap().remove(action); // this is necessary for a variable with weight 0 since such variables are ignored in lmm and we need to set its // max_duration correctly at the next call to share_resources model()->get_modified_set()->push_front(*action); @@ -218,7 +219,7 @@ CpuCas01Action::CpuCas01Action(kernel::resource::Model* model, double cost, bool model->get_maxmin_system()->variable_new(this, 1.0 / requestedCore, requestedCore * speed, 1)) , requestedCore_(requestedCore) { - if (model->getUpdateMechanism() == kernel::resource::Model::UpdateAlgo::Lazy) { + if (model->get_update_algorithm() == kernel::resource::Model::UpdateAlgo::Lazy) { set_last_update(); set_last_value(0.0); }