I think that's the third time I'm sure I'm done with this file.
This gonna be a long one refactoring :(
double max_duration_ = NO_MAX_DURATION; /*< max_duration (may fluctuate until the task is completed) */
double remains_; /**< How much of that cost remains to be done in the currently running task */
double start_time_; /**< start time */
- char* category_ = nullptr; /**< tracing category for categorized resource utilization monitoring */
- double finish_time_ =
- -1; /**< finish time : this is modified during the run and fluctuates until the task is completed */
+ double finish_time_ = -1; /**< finish time (may fluctuate until the task is completed) */
+ char* category_ = nullptr; /**< tracing category for categorized resource utilization monitoring */
double cost_;
simgrid::kernel::resource::Model* model_;
void* data_ = nullptr; /**< for your convenience */
/* LMM */
- double last_update_ = 0;
- double last_value_ = 0;
- kernel::lmm::Variable* variable_ = nullptr;
- Action::Type type_ = Action::Type::NOTSET;
- boost::optional<heap_type::handle_type> heap_handle_ = boost::none;
+ double last_update_ = 0;
+ double last_value_ = 0;
+ kernel::lmm::Variable* variable_ = nullptr;
+ Action::Type type_ = Action::Type::NOTSET;
+ boost::optional<heap_type::handle_type> heap_hook_ = boost::none;
public:
void heapInsert(heap_type& heap, double key, Action::Type hat);
void heapRemove(heap_type& heap);
void heapUpdate(heap_type& heap, double key, Action::Type hat);
- void clearHeapHandle() { heap_handle_ = boost::none; }
- kernel::lmm::Variable* getVariable() const { return variable_; }
- void setVariable(kernel::lmm::Variable* var) { variable_ = var; }
- double getLastUpdate() const { return last_update_; }
- void refreshLastUpdate();
- double getLastValue() const { return last_value_; }
- void setLastValue(double val) { last_value_ = val; }
- Action::Type getType() const { return type_; }
+ void clearHeapHandle() { heap_hook_ = boost::none; }
+
+ lmm::Variable* get_variable() const { return variable_; }
+ void set_variable(lmm::Variable* var) { variable_ = var; }
+
+ double get_last_update() const { return last_update_; }
+ void set_last_update();
+
+ double get_last_value() const { return last_value_; }
+ void set_last_value(double val) { last_value_ = val; }
+
+ Action::Type get_type() const { return type_; }
protected:
Action::SuspendStates suspended_ = Action::SuspendStates::not_suspended;
{
if (state_set_hook_.is_linked())
simgrid::xbt::intrusive_erase(*state_set_, *this);
- if (getVariable())
- get_model()->getMaxminSystem()->variable_free(getVariable());
+ if (get_variable())
+ get_model()->getMaxminSystem()->variable_free(get_variable());
if (get_model()->getUpdateMechanism() == UM_LAZY) {
/* remove from heap */
heapRemove(get_model()->getActionHeap());
if (variable_)
get_model()->getMaxminSystem()->update_variable_bound(variable_, bound);
- if (get_model()->getUpdateMechanism() == UM_LAZY && getLastUpdate() != surf_get_clock())
+ if (get_model()->getUpdateMechanism() == UM_LAZY && get_last_update() != surf_get_clock())
heapRemove(get_model()->getActionHeap());
XBT_OUT();
}
{
XBT_IN("(%p,%g)", this, weight);
sharing_priority_ = weight;
- get_model()->getMaxminSystem()->update_variable_weight(getVariable(), weight);
+ get_model()->getMaxminSystem()->update_variable_weight(get_variable(), weight);
if (get_model()->getUpdateMechanism() == UM_LAZY)
heapRemove(get_model()->getActionHeap());
{
XBT_IN("(%p)", this);
if (suspended_ != SuspendStates::sleeping) {
- get_model()->getMaxminSystem()->update_variable_weight(getVariable(), 0.0);
+ get_model()->getMaxminSystem()->update_variable_weight(get_variable(), 0.0);
if (get_model()->getUpdateMechanism() == UM_LAZY) {
heapRemove(get_model()->getActionHeap());
if (get_model()->getUpdateMechanism() == UM_LAZY && state_set_ == get_model()->getRunningActionSet() &&
{
XBT_IN("(%p)", this);
if (suspended_ != SuspendStates::sleeping) {
- get_model()->getMaxminSystem()->update_variable_weight(getVariable(), get_priority());
+ get_model()->getMaxminSystem()->update_variable_weight(get_variable(), get_priority());
suspended_ = SuspendStates::not_suspended;
if (get_model()->getUpdateMechanism() == UM_LAZY)
heapRemove(get_model()->getActionHeap());
void Action::heapInsert(heap_type& heap, double key, Action::Type hat)
{
type_ = hat;
- heap_handle_ = heap.emplace(std::make_pair(key, this));
+ heap_hook_ = heap.emplace(std::make_pair(key, this));
}
void Action::heapRemove(heap_type& heap)
{
type_ = Action::Type::NOTSET;
- if (heap_handle_) {
- heap.erase(*heap_handle_);
+ if (heap_hook_) {
+ heap.erase(*heap_hook_);
clearHeapHandle();
}
}
void Action::heapUpdate(heap_type& heap, double key, Action::Type hat)
{
type_ = hat;
- if (heap_handle_) {
- heap.update(*heap_handle_, std::make_pair(key, this));
+ if (heap_hook_) {
+ heap.update(*heap_hook_, std::make_pair(key, this));
} else {
- heap_handle_ = heap.emplace(std::make_pair(key, this));
+ heap_hook_ = heap.emplace(std::make_pair(key, this));
}
}
double_update(&remains_, delta, sg_maxmin_precision * sg_surf_precision);
}
-void Action::refreshLastUpdate()
+void Action::set_last_update()
{
last_update_ = surf_get_clock();
}
continue;
/* bogus priority, skip it */
- if (action->get_priority() <= 0 || action->getType() == Action::Type::LATENCY)
+ if (action->get_priority() <= 0 || action->get_type() == Action::Type::LATENCY)
continue;
action->update_remains_lazy(now);
double min = -1;
- double share = action->getVariable()->get_value();
+ double share = action->get_variable()->get_value();
if (share > 0) {
double time_to_completion;
max_dur_flag = true;
}
- XBT_DEBUG("Action(%p) corresponds to variable %d", action, action->getVariable()->id_int);
+ XBT_DEBUG("Action(%p) corresponds to variable %d", action, action->get_variable()->id_int);
XBT_DEBUG("Action(%p) Start %f. May finish at %f (got a share of %f). Max_duration %f", action,
action->get_start_time(), min, share, action->get_max_duration());
double min = -1;
for (Action& action : *getRunningActionSet()) {
- double value = action.getVariable()->get_value();
+ double value = action.get_variable()->get_value();
if (value > 0) {
if (action.get_remains() > 0)
value = action.get_remains_no_update() / value;
surf::Cpu* cpu = ws_vm->pimpl_cpu;
xbt_assert(cpu, "cpu-less host");
- double solved_value = ws_vm->getImpl()->action_->getVariable()->get_value(); // this is X1 in comment above, what
- // this VM got in the sharing on the PM
+ double solved_value =
+ ws_vm->getImpl()->action_->get_variable()->get_value(); // this is X1 in comment above, what
+ // this VM got in the sharing on the PM
XBT_DEBUG("assign %f to vm %s @ pm %s", solved_value, ws_vm->getCname(), ws_vm->getPm()->getCname());
xbt_assert(cpu->model() == surf_cpu_model_vm);
while ((var = constraint()->get_variable(&elem))) {
CpuCas01Action* action = static_cast<CpuCas01Action*>(var->get_id());
- model()->getMaxminSystem()->update_variable_bound(action->getVariable(),
+ model()->getMaxminSystem()->update_variable_bound(action->get_variable(),
action->requestedCore() * speed_.scale * speed_.peak);
}
action->get_state_set()->push_back(*action);
}
- model()->getMaxminSystem()->update_variable_weight(action->getVariable(), 0.0);
+ model()->getMaxminSystem()->update_variable_weight(action->get_variable(), 0.0);
if (model()->getUpdateMechanism() == UM_LAZY) { // remove action from the heap
action->heapRemove(model()->getActionHeap());
// this is necessary for a variable with weight 0 since such variables are ignored in lmm and we need to set its
, requestedCore_(requestedCore)
{
if (model->getUpdateMechanism() == UM_LAZY) {
- refreshLastUpdate();
- setLastValue(0.0);
+ set_last_update();
+ set_last_value(0.0);
}
- model->getMaxminSystem()->expand(constraint, getVariable(), 1.0);
+ model->getMaxminSystem()->expand(constraint, get_variable(), 1.0);
}
CpuCas01Action::CpuCas01Action(kernel::resource::Model* model, double cost, bool failed, double speed,
CpuAction* action = static_cast<CpuAction*>(actionHeapPop());
XBT_CDEBUG(surf_kernel, "Something happened to action %p", action);
if (TRACE_is_enabled()) {
- Cpu* cpu = static_cast<Cpu*>(action->getVariable()->get_constraint(0)->get_id());
- TRACE_surf_host_set_utilization(cpu->getCname(), action->get_category(), action->getVariable()->get_value(),
- action->getLastUpdate(), now - action->getLastUpdate());
+ Cpu* cpu = static_cast<Cpu*>(action->get_variable()->get_constraint(0)->get_id());
+ TRACE_surf_host_set_utilization(cpu->getCname(), action->get_category(), action->get_variable()->get_value(),
+ action->get_last_update(), now - action->get_last_update());
}
action->finish(kernel::resource::Action::State::done);
//without losing the event ascending order (considering all CPU's)
double smaller = -1;
for (kernel::resource::Action const& action : *getRunningActionSet()) {
- if (smaller < 0 || action.getLastUpdate() < smaller)
- smaller = action.getLastUpdate();
+ if (smaller < 0 || action.get_last_update() < smaller)
+ smaller = action.get_last_update();
}
if (smaller > 0) {
TRACE_last_timestamp_to_dump = smaller;
CpuAction& action = static_cast<CpuAction&>(*it);
++it; // increment iterator here since the following calls to action.finish() may invalidate it
if (TRACE_is_enabled()) {
- Cpu* cpu = static_cast<Cpu*>(action.getVariable()->get_constraint(0)->get_id());
- TRACE_surf_host_set_utilization(cpu->getCname(), action.get_category(), action.getVariable()->get_value(),
+ Cpu* cpu = static_cast<Cpu*>(action.get_variable()->get_constraint(0)->get_id());
+ TRACE_surf_host_set_utilization(cpu->getCname(), action.get_category(), action.get_variable()->get_value(),
now - delta, delta);
TRACE_last_timestamp_to_dump = now - delta;
}
- action.update_remains(action.getVariable()->get_value() * delta);
+ action.update_remains(action.get_variable()->get_value() * delta);
if (action.get_max_duration() != NO_MAX_DURATION)
action.update_max_duration(delta);
- if (((action.get_remains_no_update() <= 0) && (action.getVariable()->get_weight() > 0)) ||
+ if (((action.get_remains_no_update() <= 0) && (action.get_variable()->get_weight() > 0)) ||
((action.get_max_duration() != NO_MAX_DURATION) && (action.get_max_duration() <= 0))) {
action.finish(kernel::resource::Action::State::done);
}
xbt_assert(get_state_set() == get_model()->getRunningActionSet(), "You're updating an action that is not running.");
xbt_assert(get_priority() > 0, "You're updating an action that seems suspended.");
- double delta = now - getLastUpdate();
+ double delta = now - get_last_update();
if (get_remains_no_update() > 0) {
XBT_CDEBUG(surf_kernel, "Updating action(%p): remains was %f, last_update was: %f", this, get_remains_no_update(),
- getLastUpdate());
- update_remains(getLastValue() * delta);
+ get_last_update());
+ update_remains(get_last_value() * delta);
if (TRACE_is_enabled()) {
- Cpu* cpu = static_cast<Cpu*>(getVariable()->get_constraint(0)->get_id());
- TRACE_surf_host_set_utilization(cpu->getCname(), get_category(), getLastValue(), getLastUpdate(),
- now - getLastUpdate());
+ Cpu* cpu = static_cast<Cpu*>(get_variable()->get_constraint(0)->get_id());
+ TRACE_surf_host_set_utilization(cpu->getCname(), get_category(), get_last_value(), get_last_update(),
+ now - get_last_update());
}
XBT_CDEBUG(surf_kernel, "Updating action(%p): remains is now %f", this, get_remains_no_update());
}
- refreshLastUpdate();
- setLastValue(getVariable()->get_value());
+ set_last_update();
+ set_last_value(get_variable()->get_value());
}
simgrid::xbt::signal<void(simgrid::surf::CpuAction*, kernel::resource::Action::State)> CpuAction::onStateChange;
/** @brief returns a list of all CPUs that this action is using */
std::list<Cpu*> CpuAction::cpus() {
std::list<Cpu*> retlist;
- int llen = getVariable()->get_number_of_constraint();
+ int llen = get_variable()->get_number_of_constraint();
for (int i = 0; i < llen; i++) {
/* Beware of composite actions: ptasks put links and cpus together */
// extra pb: we cannot dynamic_cast from void*...
kernel::resource::Resource* resource =
- static_cast<kernel::resource::Resource*>(getVariable()->get_constraint(i)->get_id());
+ static_cast<kernel::resource::Resource*>(get_variable()->get_constraint(i)->get_id());
Cpu* cpu = dynamic_cast<Cpu*>(resource);
if (cpu != nullptr)
retlist.push_back(cpu);
NetworkCm02Action* action = static_cast<NetworkCm02Action*>(actionHeapPop());
XBT_DEBUG("Something happened to action %p", action);
if (TRACE_is_enabled()) {
- int n = action->getVariable()->get_number_of_constraint();
+ int n = action->get_variable()->get_number_of_constraint();
for (int i = 0; i < n; i++){
- kernel::lmm::Constraint* constraint = action->getVariable()->get_constraint(i);
+ kernel::lmm::Constraint* constraint = action->get_variable()->get_constraint(i);
NetworkCm02Link* link = static_cast<NetworkCm02Link*>(constraint->get_id());
- double value = action->getVariable()->get_value() * action->getVariable()->get_constraint_weight(i);
- TRACE_surf_link_set_utilization(link->getCname(), action->get_category(), value, action->getLastUpdate(),
- now - action->getLastUpdate());
+ double value = action->get_variable()->get_value() * action->get_variable()->get_constraint_weight(i);
+ TRACE_surf_link_set_utilization(link->getCname(), action->get_category(), value, action->get_last_update(),
+ now - action->get_last_update());
}
}
// if I am wearing a latency hat
- if (action->getType() == kernel::resource::Action::Type::LATENCY) {
+ if (action->get_type() == kernel::resource::Action::Type::LATENCY) {
XBT_DEBUG("Latency paid for action %p. Activating", action);
- maxmin_system_->update_variable_weight(action->getVariable(), action->weight_);
+ maxmin_system_->update_variable_weight(action->get_variable(), action->weight_);
action->heapRemove(getActionHeap());
- action->refreshLastUpdate();
+ action->set_last_update();
- // if I am wearing a max_duration or normal hat
- } else if (action->getType() == kernel::resource::Action::Type::MAX_DURATION ||
- action->getType() == kernel::resource::Action::Type::NORMAL) {
+ // if I am wearing a max_duration or normal hat
+ } else if (action->get_type() == kernel::resource::Action::Type::MAX_DURATION ||
+ action->get_type() == kernel::resource::Action::Type::NORMAL) {
// no need to communicate anymore
// assume that flows that reached max_duration have remaining of 0
XBT_DEBUG("Action %p finished", action);
action.latency_ = 0.0;
}
if (action.latency_ <= 0.0 && not action.is_suspended())
- maxmin_system_->update_variable_weight(action.getVariable(), action.weight_);
+ maxmin_system_->update_variable_weight(action.get_variable(), action.weight_);
}
if (TRACE_is_enabled()) {
- int n = action.getVariable()->get_number_of_constraint();
+ int n = action.get_variable()->get_number_of_constraint();
for (int i = 0; i < n; i++) {
- kernel::lmm::Constraint* constraint = action.getVariable()->get_constraint(i);
+ kernel::lmm::Constraint* constraint = action.get_variable()->get_constraint(i);
NetworkCm02Link* link = static_cast<NetworkCm02Link*>(constraint->get_id());
TRACE_surf_link_set_utilization(
link->getCname(), action.get_category(),
- (action.getVariable()->get_value() * action.getVariable()->get_constraint_weight(i)),
- action.getLastUpdate(), now - action.getLastUpdate());
+ (action.get_variable()->get_value() * action.get_variable()->get_constraint_weight(i)),
+ action.get_last_update(), now - action.get_last_update());
}
}
- if (not action.getVariable()->get_number_of_constraint()) {
+ if (not action.get_variable()->get_number_of_constraint()) {
/* There is actually no link used, hence an infinite bandwidth. This happens often when using models like
* vivaldi. In such case, just make sure that the action completes immediately.
*/
action.update_remains(action.get_remains());
}
- action.update_remains(action.getVariable()->get_value() * delta);
+ action.update_remains(action.get_variable()->get_value() * delta);
if (action.get_max_duration() > NO_MAX_DURATION)
action.update_max_duration(delta);
- if (((action.get_remains() <= 0) && (action.getVariable()->get_weight() > 0)) ||
+ if (((action.get_remains() <= 0) && (action.get_variable()->get_weight() > 0)) ||
((action.get_max_duration() > NO_MAX_DURATION) && (action.get_max_duration() <= 0))) {
action.finish(kernel::resource::Action::State::done);
}
action->latency_ = latency;
action->rate_ = rate;
if (getUpdateMechanism() == UM_LAZY) {
- action->refreshLastUpdate();
+ action->set_last_update();
}
double bandwidth_bound = -1.0;
constraints_per_variable += back_route.size();
if (action->latency_ > 0) {
- action->setVariable(maxmin_system_->variable_new(action, 0.0, -1.0, constraints_per_variable));
+ action->set_variable(maxmin_system_->variable_new(action, 0.0, -1.0, constraints_per_variable));
if (getUpdateMechanism() == UM_LAZY) {
// add to the heap the event when the latency is payed
- XBT_DEBUG("Added action (%p) one latency event at date %f", action, action->latency_ + action->getLastUpdate());
- action->heapInsert(getActionHeap(), action->latency_ + action->getLastUpdate(),
+ XBT_DEBUG("Added action (%p) one latency event at date %f", action, action->latency_ + action->get_last_update());
+ action->heapInsert(getActionHeap(), action->latency_ + action->get_last_update(),
route.empty() ? kernel::resource::Action::Type::NORMAL
: kernel::resource::Action::Type::LATENCY);
}
} else
- action->setVariable(maxmin_system_->variable_new(action, 1.0, -1.0, constraints_per_variable));
+ action->set_variable(maxmin_system_->variable_new(action, 1.0, -1.0, constraints_per_variable));
if (action->rate_ < 0) {
maxmin_system_->update_variable_bound(
- action->getVariable(), (action->latCurrent_ > 0) ? sg_tcp_gamma / (2.0 * action->latCurrent_) : -1.0);
+ action->get_variable(), (action->latCurrent_ > 0) ? sg_tcp_gamma / (2.0 * action->latCurrent_) : -1.0);
} else {
- maxmin_system_->update_variable_bound(action->getVariable(),
+ maxmin_system_->update_variable_bound(action->get_variable(),
(action->latCurrent_ > 0)
? std::min(action->rate_, sg_tcp_gamma / (2.0 * action->latCurrent_))
: action->rate_);
}
for (auto const& link : route)
- maxmin_system_->expand(link->constraint(), action->getVariable(), 1.0);
+ maxmin_system_->expand(link->constraint(), action->get_variable(), 1.0);
if (not back_route.empty()) { // sg_network_crosstraffic was activated
XBT_DEBUG("Crosstraffic active adding backward flow using 5%%");
for (auto const& link : back_route)
- maxmin_system_->expand(link->constraint(), action->getVariable(), .05);
+ maxmin_system_->expand(link->constraint(), action->get_variable(), .05);
// Change concurrency_share here, if you want that cross-traffic is included in the SURF concurrency
// (You would also have to change simgrid::kernel::lmm::Element::get_concurrency())
NetworkCm02Action* action = static_cast<NetworkCm02Action*>(var->get_id());
action->weight_ += delta;
if (not action->is_suspended())
- model()->getMaxminSystem()->update_variable_weight(action->getVariable(), action->weight_);
+ model()->getMaxminSystem()->update_variable_weight(action->get_variable(), action->weight_);
}
}
}
action->latCurrent_ += delta;
action->weight_ += delta;
if (action->rate_ < 0)
- model()->getMaxminSystem()->update_variable_bound(action->getVariable(),
+ model()->getMaxminSystem()->update_variable_bound(action->get_variable(),
sg_tcp_gamma / (2.0 * action->latCurrent_));
else {
model()->getMaxminSystem()->update_variable_bound(
- action->getVariable(), std::min(action->rate_, sg_tcp_gamma / (2.0 * action->latCurrent_)));
+ action->get_variable(), std::min(action->rate_, sg_tcp_gamma / (2.0 * action->latCurrent_)));
if (action->rate_ < sg_tcp_gamma / (2.0 * action->latCurrent_)) {
XBT_INFO("Flow is limited BYBANDWIDTH");
}
}
if (not action->is_suspended())
- model()->getMaxminSystem()->update_variable_weight(action->getVariable(), action->weight_);
+ model()->getMaxminSystem()->update_variable_weight(action->get_variable(), action->weight_);
}
}
if (suspended_ != Action::SuspendStates::not_suspended)
return;
- double delta = now - getLastUpdate();
+ double delta = now - get_last_update();
double max_duration = get_max_duration();
if (get_remains_no_update() > 0) {
XBT_DEBUG("Updating action(%p): remains was %f, last_update was: %f", this, get_remains_no_update(),
- getLastUpdate());
- update_remains(getLastValue() * delta);
+ get_last_update());
+ update_remains(get_last_value() * delta);
XBT_DEBUG("Updating action(%p): remains is now %f", this, get_remains_no_update());
}
set_max_duration(max_duration);
}
- if ((get_remains_no_update() <= 0 && (getVariable()->get_weight() > 0)) ||
+ if ((get_remains_no_update() <= 0 && (get_variable()->get_weight() > 0)) ||
((max_duration > NO_MAX_DURATION) && (max_duration <= 0))) {
finish(Action::State::done);
heapRemove(get_model()->getActionHeap());
}
- refreshLastUpdate();
- setLastValue(getVariable()->get_value());
+ set_last_update();
+ set_last_value(get_variable()->get_value());
}
}
if (not double_equals(penalized_bw, rate_before_update, sg_surf_precision)) {
XBT_DEBUG("%d->%d action %p penalty updated : bw now %f, before %f , initial rate %f", root->id,
(*it)->destination->id, (*it)->action, penalized_bw, (*it)->action->get_bound(), (*it)->init_rate);
- maxmin_system_->update_variable_bound((*it)->action->getVariable(), penalized_bw);
+ maxmin_system_->update_variable_bound((*it)->action->get_variable(), penalized_bw);
} else {
XBT_DEBUG("%d->%d action %p penalty not updated : bw %f, initial rate %f", root->id, (*it)->destination->id,
(*it)->action, penalized_bw, (*it)->init_rate);
std::list<LinkImpl*> NetworkAction::links()
{
std::list<LinkImpl*> retlist;
- int llen = getVariable()->get_number_of_constraint();
+ int llen = get_variable()->get_number_of_constraint();
for (int i = 0; i < llen; i++) {
/* Beware of composite actions: ptasks put links and cpus together */
// extra pb: we cannot dynamic_cast from void*...
kernel::resource::Resource* resource =
- static_cast<kernel::resource::Resource*>(getVariable()->get_constraint(i)->get_id());
+ static_cast<kernel::resource::Resource*>(get_variable()->get_constraint(i)->get_id());
LinkImpl* link = dynamic_cast<LinkImpl*>(resource);
if (link != nullptr)
retlist.push_back(link);
}
if ((action.latency_ <= 0.0) && (action.is_suspended() == 0)) {
action.updateBound();
- maxmin_system_->update_variable_weight(action.getVariable(), 1.0);
+ maxmin_system_->update_variable_weight(action.get_variable(), 1.0);
}
}
XBT_DEBUG("Action (%p) : remains (%g) updated by %g.", &action, action.get_remains(),
- action.getVariable()->get_value() * delta);
- action.update_remains(action.getVariable()->get_value() * delta);
+ action.get_variable()->get_value() * delta);
+ action.update_remains(action.get_variable()->get_value() * delta);
if (action.get_max_duration() > NO_MAX_DURATION)
action.update_max_duration(delta);
* If it's not done, it may have failed.
*/
- if (((action.get_remains() <= 0) && (action.getVariable()->get_weight() > 0)) ||
+ if (((action.get_remains() <= 0) && (action.get_variable()->get_weight() > 0)) ||
((action.get_max_duration() > NO_MAX_DURATION) && (action.get_max_duration() <= 0))) {
action.finish(kernel::resource::Action::State::done);
} else {
/* Need to check that none of the model has failed */
int i = 0;
- kernel::lmm::Constraint* cnst = action.getVariable()->get_constraint(i);
+ kernel::lmm::Constraint* cnst = action.get_variable()->get_constraint(i);
while (cnst != nullptr) {
i++;
void* constraint_id = cnst->get_id();
action.finish(kernel::resource::Action::State::failed);
break;
}
- cnst = action.getVariable()->get_constraint(i);
+ cnst = action.get_variable()->get_constraint(i);
}
}
}
XBT_DEBUG("Creating a parallel task (%p) with %d hosts and %d unique links.", this, host_nb, nb_link);
latency_ = latency;
- setVariable(model->getMaxminSystem()->variable_new(this, 1.0, (rate > 0 ? rate : -1.0), host_nb + nb_link));
+ set_variable(model->getMaxminSystem()->variable_new(this, 1.0, (rate > 0 ? rate : -1.0), host_nb + nb_link));
if (latency_ > 0)
- model->getMaxminSystem()->update_variable_weight(getVariable(), 0.0);
+ model->getMaxminSystem()->update_variable_weight(get_variable(), 0.0);
for (int i = 0; i < host_nb; i++)
- model->getMaxminSystem()->expand(host_list[i]->pimpl_cpu->constraint(), getVariable(), flops_amount[i]);
+ model->getMaxminSystem()->expand(host_list[i]->pimpl_cpu->constraint(), get_variable(), flops_amount[i]);
if(bytes_amount != nullptr) {
for (int i = 0; i < host_nb; i++) {
hostList_->at(i)->routeTo(hostList_->at(j), route, nullptr);
for (auto const& link : route)
- model->getMaxminSystem()->expand_add(link->constraint(), this->getVariable(),
+ model->getMaxminSystem()->expand_add(link->constraint(), this->get_variable(),
bytes_amount[i * host_nb + j]);
}
}
L07Action *action = static_cast<L07Action*>(execution_start(1.0));
action->set_max_duration(duration);
action->suspended_ = kernel::resource::Action::SuspendStates::sleeping;
- model()->getMaxminSystem()->update_variable_weight(action->getVariable(), 0.0);
+ model()->getMaxminSystem()->update_variable_weight(action->get_variable(), 0.0);
return action;
}
while ((var = constraint()->get_variable(&elem))) {
kernel::resource::Action* action = static_cast<kernel::resource::Action*>(var->get_id());
- model()->getMaxminSystem()->update_variable_bound(action->getVariable(), speed_.scale * speed_.peak);
+ model()->getMaxminSystem()->update_variable_bound(action->get_variable(), speed_.scale * speed_.peak);
}
Cpu::onSpeedChange();
XBT_DEBUG("action (%p) : lat_bound = %g", this, lat_bound);
if ((latency_ <= 0.0) && (suspended_ == Action::SuspendStates::not_suspended)) {
if (rate_ < 0)
- get_model()->getMaxminSystem()->update_variable_bound(getVariable(), lat_bound);
+ get_model()->getMaxminSystem()->update_variable_bound(get_variable(), lat_bound);
else
- get_model()->getMaxminSystem()->update_variable_bound(getVariable(), std::min(rate_, lat_bound));
+ get_model()->getMaxminSystem()->update_variable_bound(get_variable(), std::min(rate_, lat_bound));
}
}
for (auto it = std::begin(*getRunningActionSet()); it != std::end(*getRunningActionSet());) {
StorageAction& action = static_cast<StorageAction&>(*it);
++it; // increment iterator here since the following calls to action.finish() may invalidate it
- action.update_remains(lrint(action.getVariable()->get_value() * delta));
+ action.update_remains(lrint(action.get_variable()->get_value() * delta));
if (action.get_max_duration() > NO_MAX_DURATION)
action.update_max_duration(delta);
- if (((action.get_remains_no_update() <= 0) && (action.getVariable()->get_weight() > 0)) ||
+ if (((action.get_remains_no_update() <= 0) && (action.get_variable()->get_weight() > 0)) ||
((action.get_max_duration() > NO_MAX_DURATION) && (action.get_max_duration() <= 0))) {
action.finish(kernel::resource::Action::State::done);
}
XBT_IN("(%s,%g", storage->getCname(), cost);
// Must be less than the max bandwidth for all actions
- model->getMaxminSystem()->expand(storage->constraint(), getVariable(), 1.0);
+ model->getMaxminSystem()->expand(storage->constraint(), get_variable(), 1.0);
switch(type) {
case READ:
- model->getMaxminSystem()->expand(storage->constraintRead_, getVariable(), 1.0);
+ model->getMaxminSystem()->expand(storage->constraintRead_, get_variable(), 1.0);
break;
case WRITE:
- model->getMaxminSystem()->expand(storage->constraintWrite_, getVariable(), 1.0);
+ model->getMaxminSystem()->expand(storage->constraintWrite_, get_variable(), 1.0);
break;
default:
THROW_UNIMPLEMENTED;
{
XBT_IN("(%p)", this);
if (suspended_ != Action::SuspendStates::sleeping) {
- get_model()->getMaxminSystem()->update_variable_weight(getVariable(), 0.0);
+ get_model()->getMaxminSystem()->update_variable_weight(get_variable(), 0.0);
suspended_ = Action::SuspendStates::suspended;
}
XBT_OUT();