class XBT_PUBLIC Action {
friend ActionHeap;
+ int refcount_ = 1;
+ double sharing_penalty_ = 1.0; /**< priority (1.0 by default) */
+ 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 */
+ double finish_time_ = -1; /**< finish time (may fluctuate until the task is completed) */
+ std::string category_; /**< tracing category for categorized resource utilization monitoring */
+
+ double cost_;
+ Model* model_;
+ void* data_ = nullptr; /**< for your convenience */
+ activity::ActivityImpl* activity_ = nullptr;
+
+ /* LMM */
+ double last_update_ = 0;
+ double last_value_ = 0;
+ lmm::Variable* variable_ = nullptr;
+ double user_bound_ = -1;
+
+ ActionHeap::Type type_ = ActionHeap::Type::unset;
+ boost::optional<ActionHeap::handle_type> heap_hook_ = boost::none;
+ boost::intrusive::list_member_hook<> modified_set_hook_;
+ boost::intrusive::list_member_hook<> state_set_hook_;
+
public:
/* Lazy update needs this Set hook to maintain a list of the tracked actions */
- boost::intrusive::list_member_hook<> modified_set_hook_;
bool is_within_modified_set() const { return modified_set_hook_.is_linked(); }
using ModifiedSet = boost::intrusive::list<
Action, boost::intrusive::member_hook<Action, boost::intrusive::list_member_hook<>, &Action::modified_set_hook_>>;
- boost::intrusive::list_member_hook<> state_set_hook_;
using StateSet = boost::intrusive::list<
Action, boost::intrusive::member_hook<Action, boost::intrusive::list_member_hook<>, &Action::state_set_hook_>>;
SLEEPING
};
+private:
+ StateSet* state_set_;
+ Action::SuspendStates suspended_ = Action::SuspendStates::RUNNING;
+
+public:
/**
* @brief Action constructor
*
Model* get_model() const { return model_; }
-private:
- StateSet* state_set_;
- Action::SuspendStates suspended_ = Action::SuspendStates::RUNNING;
- int refcount_ = 1;
- double sharing_penalty_ = 1.0; /**< priority (1.0 by default) */
- 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 */
- double finish_time_ = -1; /**< finish time (may fluctuate until the task is completed) */
- std::string category_; /**< tracing category for categorized resource utilization monitoring */
-
- double cost_;
- Model* model_;
- void* data_ = nullptr; /**< for your convenience */
- activity::ActivityImpl* activity_ = nullptr;
-
- /* LMM */
- double last_update_ = 0;
- double last_value_ = 0;
- lmm::Variable* variable_ = nullptr;
-
- ActionHeap::Type type_ = ActionHeap::Type::unset;
- boost::optional<ActionHeap::handle_type> heap_hook_ = boost::none;
-
-public:
ActionHeap::Type get_type() const { return type_; }
lmm::Variable* get_variable() const { return variable_; }
void set_variable(lmm::Variable* var) { variable_ = var; }
+ double get_user_bound() const { return user_bound_; }
+ void set_user_bound(double bound) { user_bound_ = bound; }
+
double get_last_update() const { return last_update_; }
void set_last_update();
action = new NetworkWifiAction(this, *src, *dst, size, failed, src_wifi_link, dst_wifi_link);
action->sharing_penalty_ = latency;
action->latency_ = latency;
- action->rate_ = rate;
+ action->set_user_bound(rate);
if (is_update_lazy()) {
action->set_last_update();
action->lat_current_ = action->latency_;
action->latency_ *= get_latency_factor(size);
- action->rate_ = get_bandwidth_constraint(action->rate_, bandwidth_bound, size);
+ action->set_user_bound(get_bandwidth_constraint(action->get_user_bound(), bandwidth_bound, size));
size_t constraints_per_variable = route.size();
constraints_per_variable += back_route.size();
} else
action->set_variable(get_maxmin_system()->variable_new(action, 1.0, -1.0, constraints_per_variable));
- if (action->rate_ < 0) {
+ if (action->get_user_bound() < 0) {
get_maxmin_system()->update_variable_bound(
action->get_variable(), (action->lat_current_ > 0) ? cfg_tcp_gamma / (2.0 * action->lat_current_) : -1.0);
} else {
get_maxmin_system()->update_variable_bound(
action->get_variable(), (action->lat_current_ > 0)
- ? std::min(action->rate_, cfg_tcp_gamma / (2.0 * action->lat_current_))
- : action->rate_);
+ ? std::min(action->get_user_bound(), cfg_tcp_gamma / (2.0 * action->lat_current_))
+ : action->get_user_bound());
}
if (src_wifi_link != nullptr)
auto* action = static_cast<NetworkCm02Action*>(var->get_id());
action->lat_current_ += delta;
action->sharing_penalty_ += delta;
- if (action->rate_ < 0)
+ if (action->get_user_bound() < 0)
get_model()->get_maxmin_system()->update_variable_bound(action->get_variable(), NetworkModel::cfg_tcp_gamma /
(2.0 * action->lat_current_));
else {
get_model()->get_maxmin_system()->update_variable_bound(
- action->get_variable(), std::min(action->rate_, NetworkModel::cfg_tcp_gamma / (2.0 * action->lat_current_)));
+ action->get_variable(),
+ std::min(action->get_user_bound(), NetworkModel::cfg_tcp_gamma / (2.0 * action->lat_current_)));
- if (action->rate_ < NetworkModel::cfg_tcp_gamma / (2.0 * action->lat_current_)) {
+ if (action->get_user_bound() < NetworkModel::cfg_tcp_gamma / (2.0 * action->lat_current_)) {
XBT_INFO("Flow is limited BYBANDWIDTH");
} else {
XBT_INFO("Flow is limited BYLATENCY, latency of flow is %f", action->lat_current_);