ActionList* getDoneActionSet() const { return doneActionSet_; }
/** @brief Get the set of modified [actions](@ref Action) */
- ActionLmmListPtr getModifiedSet() const { return modifiedSet_; }
+ ActionLmmListPtr getModifiedSet() const;
/** @brief Get the maxmin system of the current Model */
lmm_system_t getMaxminSystem() const { return maxminSystem_; }
virtual bool nextOccuringEventIsIdempotent() { return true; }
protected:
- ActionLmmListPtr modifiedSet_ = nullptr;
lmm_system_t maxminSystem_ = nullptr;
private:
XBT_DEBUG("Setting selective_update_active flag to %d", selective_update_active);
- keep_track = nullptr;
variable_mallocator =
xbt_mallocator_new(65536, System::variable_mallocator_new_f, System::variable_mallocator_free_f, nullptr);
solve_fun = &lmm_solve;
cnst_free(cnst);
xbt_mallocator_free(variable_mallocator);
+ delete modified_set_;
}
void System::cnst_free(Constraint* cnst)
elem.make_active();
simgrid::kernel::resource::Action* action = static_cast<simgrid::kernel::resource::Action*>(elem.variable->id);
- if (keep_track && not action->isLinkedModifiedSet())
- keep_track->push_back(*action);
+ if (modified_set_ && not action->isLinkedModifiedSet())
+ modified_set_->push_back(*action);
}
}
XBT_DEBUG("Constraint '%d' usage: %f remaining: %f concurrency: %i<=%i<=%i", cnst.id_int, cnst.usage,
&Constraint::saturated_constraint_set_hook>>
saturated_constraint_set;
- simgrid::kernel::resource::ActionLmmListPtr keep_track;
+ simgrid::kernel::resource::ActionLmmListPtr modified_set_ = nullptr;
void (*solve_fun)(lmm_system_t self);
delete runningActionSet_;
delete failedActionSet_;
delete doneActionSet_;
- delete modifiedSet_;
delete maxminSystem_;
}
return action;
}
+ActionLmmListPtr Model::getModifiedSet() const
+{
+ return maxminSystem_->modified_set_;
+}
+
double Model::nextOccuringEvent(double now)
{
// FIXME: set the good function once and for all
double Model::nextOccuringEventLazy(double now)
{
- XBT_DEBUG("Before share resources, the size of modified actions set is %zu", modifiedSet_->size());
+ XBT_DEBUG("Before share resources, the size of modified actions set is %zu", maxminSystem_->modified_set_->size());
lmm_solve(maxminSystem_);
- XBT_DEBUG("After share resources, The size of modified actions set is %zu", modifiedSet_->size());
+ XBT_DEBUG("After share resources, The size of modified actions set is %zu", maxminSystem_->modified_set_->size());
- while (not modifiedSet_->empty()) {
- Action* action = &(modifiedSet_->front());
- modifiedSet_->pop_front();
+ while (not maxminSystem_->modified_set_->empty()) {
+ Action* action = &(maxminSystem_->modified_set_->front());
+ maxminSystem_->modified_set_->pop_front();
bool max_dur_flag = false;
if (action->getStateSet() != runningActionSet_)
maxminSystem_ = new simgrid::kernel::lmm::System(select);
- if (getUpdateMechanism() == UM_LAZY) {
- modifiedSet_ = new kernel::resource::ActionLmmList();
- maxminSystem_->keep_track = modifiedSet_;
- }
+ if (getUpdateMechanism() == UM_LAZY)
+ maxminSystem_->modified_set_ = new kernel::resource::ActionLmmList();
}
CpuCas01Model::~CpuCas01Model()
maxminSystem_ = new simgrid::kernel::lmm::System(select);
loopback_ = NetworkCm02Model::createLink("__loopback__", 498000000, 0.000015, SURF_LINK_FATPIPE);
- if (getUpdateMechanism() == UM_LAZY) {
- modifiedSet_ = new kernel::resource::ActionLmmList();
- maxminSystem_->keep_track = modifiedSet_;
- }
+ if (getUpdateMechanism() == UM_LAZY)
+ maxminSystem_->modified_set_ = new kernel::resource::ActionLmmList();
}
NetworkCm02Model::NetworkCm02Model(void (*specificSolveFun)(lmm_system_t self)) : NetworkCm02Model()