#include "cpu_cas01.hpp"
#include "cpu_ti.hpp"
-#include "simgrid/sg_config.h"
+#include "simgrid/sg_config.hpp"
#include "src/kernel/lmm/maxmin.hpp"
#include "xbt/utility.hpp"
#include <algorithm>
bool select = xbt_cfg_get_boolean("cpu/maxmin-selective-update");
if (optim == "Full") {
- setUpdateMechanism(UM_FULL);
+ setUpdateMechanism(Model::UpdateAlgo::Full);
} else if (optim == "Lazy") {
xbt_assert(select || xbt_cfg_is_default_value("cpu/maxmin-selective-update"),
"You cannot disable cpu selective update when using the lazy update mechanism");
+ setUpdateMechanism(Model::UpdateAlgo::Lazy);
select = true;
- setUpdateMechanism(UM_LAZY);
} else {
xbt_die("Unsupported optimization (%s) for this model", optim.c_str());
}
- maxmin_system_ = new simgrid::kernel::lmm::System(select);
+ set_maxmin_system(new simgrid::kernel::lmm::System(select));
- if (getUpdateMechanism() == UM_LAZY)
- maxmin_system_->modified_set_ = new kernel::resource::Action::ModifiedSet();
+ if (getUpdateMechanism() == Model::UpdateAlgo::Lazy)
+ get_maxmin_system()->modified_set_ = new kernel::resource::Action::ModifiedSet();
}
CpuCas01Model::~CpuCas01Model()
}
model()->get_maxmin_system()->update_variable_weight(action->get_variable(), 0.0);
- if (model()->getUpdateMechanism() == UM_LAZY) { // remove action from the heap
+ if (model()->getUpdateMechanism() == kernel::resource::Model::UpdateAlgo::Lazy) { // remove action from the heap
action->heapRemove();
// 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_maxmin_system()->variable_new(this, 1.0 / requestedCore, requestedCore * speed, 1))
, requestedCore_(requestedCore)
{
- if (model->getUpdateMechanism() == UM_LAZY) {
+ if (model->getUpdateMechanism() == kernel::resource::Model::UpdateAlgo::Lazy) {
set_last_update();
set_last_value(0.0);
}