- Finally kill the 'compound' host model. You can change the CPU or network model
with the default host model, as it should.
- Rename option "surf/precision" to "precision/timing" for clarity.
+ - Rename option "maxmin/precision" to "precision/work-amount" for clarity.
sthread:
- Implement pthread_join in MC mode.
- **host/model:** :ref:`options_model_select`
-- **maxmin/precision:** :ref:`cfg=maxmin/precision`
- **maxmin/concurrency-limit:** :ref:`cfg=maxmin/concurrency-limit`
- **model-check:** :ref:`options_modelchecking`
- **storage/max_file_descriptors:** :ref:`cfg=storage/max_file_descriptors`
- **precision/timing:** :ref:`cfg=precision/timing`
+- **precision/work-amount:** :ref:`cfg=precision/work-amount`
- **For collective operations of SMPI,** please refer to Section :ref:`cfg=smpi/coll-selector`
- **smpi/auto-shared-malloc-thresh:** :ref:`cfg=smpi/auto-shared-malloc-thresh`
and slow pattern that follows the actual dependencies.
.. _cfg=bmf/precision:
-.. _cfg=maxmin/precision:
.. _cfg=precision/timing:
+.. _cfg=precision/work-amount:
Numerical Precision
...................
-**Option** ``maxmin/precision`` **Default:** 1e-5 (in flops or bytes) |br|
**Option** ``precision/timing`` **Default:** 1e-9 (in seconds) |br|
+**Option** ``precision/work-amount`` **Default:** 1e-5 (in flops or bytes) |br|
**Option** ``bmf/precision`` **Default:** 1e-12 (no unit)
The analytical models handle a lot of floating point values. It is
<!DOCTYPE platform SYSTEM "https://simgrid.org/simgrid.dtd">
<platform version = "4.1">
<config>
- <prop id = "maxmin/precision" value = "0.000010" />
+ <prop id = "precision/work-amount" value = "0.000010" />
<prop id = "cpu/optim" value = "TI" />
<prop id = "network/model" value = "SMPI" />
<prop id = "network/bandwidth-factor" value = "65472:0.940694;15424:0.697866;9376:0.58729" />
<!DOCTYPE platform SYSTEM "https://simgrid.org/simgrid.dtd">
<platform version="4.1">
<config id="General">
- <prop id="maxmin/precision" value="0.000010"></prop>
+ <prop id="precision/work-amount" value="0.000010"></prop>
<prop id="cpu/optim" value="TI"></prop>
<prop id="network/model" value="SMPI"></prop>
<prop id="path" value="~/"></prop>
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(ker_lmm, kernel, "Kernel Linear Max-Min solver");
-double sg_maxmin_precision = 1E-5; /* Change this with --cfg=maxmin/precision:VALUE */
+double sg_precision_workamount = 1E-5; /* Change this with --cfg=precision/work-amount:VALUE */
double sg_precision_timing = 1E-9; /* Change this with --cfg=precision/timing:VALUE */
int sg_concurrency_limit = -1; /* Change this with --cfg=maxmin/concurrency-limit:VALUE */
}
XBT_DEBUG("%s", buf.c_str());
buf.clear();
- xbt_assert(not double_positive(sum - cnst.bound_, cnst.bound_ * sg_maxmin_precision),
+ xbt_assert(not double_positive(sum - cnst.bound_, cnst.bound_ * sg_precision_workamount),
"Incorrect value (%f is not smaller than %f): %g", sum, cnst.bound_, sum - cnst.bound_);
}
for (Variable const& var : variable_set) {
if (var.bound_ > 0) {
XBT_DEBUG("'%d'(%f) : %f (<=%f)", var.rank_, var.sharing_penalty_, var.value_, var.bound_);
- xbt_assert(not double_positive(var.value_ - var.bound_, var.bound_ * sg_maxmin_precision),
+ xbt_assert(not double_positive(var.value_ - var.bound_, var.bound_ * sg_precision_workamount),
"Incorrect value (%f is not smaller than %f", var.value_, var.bound_);
} else {
XBT_DEBUG("'%d'(%f) : %f", var.rank_, var.sharing_penalty_, var.value_);
Eigen::VectorXd remaining = (A_ * rho) - C_;
remaining = remaining.array() * shared.array(); // ignore non shared resources
bmf = bmf && (not std::any_of(remaining.data(), remaining.data() + remaining.size(),
- [](double v) { return double_positive(v, sg_maxmin_precision); }));
+ [](double v) { return double_positive(v, sg_precision_workamount); }));
// 3) every player receives maximum share in at least 1 saturated resource
// due to subflows, compare with the maximum consumption and not the A matrix
// matrix_ji: boolean indicating player p has the maximum share at resource j
Eigen::MatrixXi player_max_share =
- ((usage.array().colwise() - max_share.array()).abs() <= sg_maxmin_precision).cast<int>();
+ ((usage.array().colwise() - max_share.array()).abs() <= sg_precision_workamount).cast<int>();
// but only saturated resources must be considered
- Eigen::VectorXi saturated = (remaining.array().abs() <= sg_maxmin_precision).cast<int>();
+ Eigen::VectorXi saturated = (remaining.array().abs() <= sg_precision_workamount).cast<int>();
XBT_DEBUG("Saturated_j resources:\n%s", debug_eigen(saturated).c_str());
player_max_share.array().colwise() *= saturated.array();
// just check if it has received at least it's bound
for (int p = 0; p < rho.size(); p++) {
- if (double_equals(rho[p], phi_[p], sg_maxmin_precision)) {
+ if (double_equals(rho[p], phi_[p], sg_precision_workamount)) {
player_max_share(0, p) = 1; // it doesn't really matter, just to say that it's a bmf
saturated[0] = 1;
}
Sys.expand(sys_cnst, rho_1, 1);
Sys.solve();
- REQUIRE(double_equals(rho_1->get_value(), 3, sg_maxmin_precision));
+ REQUIRE(double_equals(rho_1->get_value(), 3, sg_precision_workamount));
}
SECTION("Two flows")
Sys.expand(sys_cnst, rho_2, 10);
Sys.solve();
- REQUIRE(double_equals(rho_1->get_value(), 3.0 / 2.0, sg_maxmin_precision));
- REQUIRE(double_equals(rho_2->get_value(), (3.0 / 2.0) / 10.0, sg_maxmin_precision));
+ REQUIRE(double_equals(rho_1->get_value(), 3.0 / 2.0, sg_precision_workamount));
+ REQUIRE(double_equals(rho_2->get_value(), (3.0 / 2.0) / 10.0, sg_precision_workamount));
}
SECTION("Variable penalty/priority")
Sys.expand(sys_cnst, rho_2, 1);
Sys.solve();
- REQUIRE(double_equals(rho_1->get_value(), 2.0 / 3.0, sg_maxmin_precision));
- REQUIRE(double_equals(rho_2->get_value(), 1.0 / 3.0, sg_maxmin_precision));
+ REQUIRE(double_equals(rho_1->get_value(), 2.0 / 3.0, sg_precision_workamount));
+ REQUIRE(double_equals(rho_2->get_value(), 1.0 / 3.0, sg_precision_workamount));
}
SECTION("Disable variable doesn't count")
Sys.expand(sys_cnst, rho_2, 10);
Sys.solve();
- REQUIRE(double_equals(rho_1->get_value(), 1.0, sg_maxmin_precision));
- REQUIRE(double_equals(rho_2->get_value(), 0.0, sg_maxmin_precision));
+ REQUIRE(double_equals(rho_1->get_value(), 1.0, sg_precision_workamount));
+ REQUIRE(double_equals(rho_2->get_value(), 0.0, sg_precision_workamount));
}
SECTION("No consumption variable")
Sys.expand(sys_cnst, rho_2, 10);
Sys.solve();
- REQUIRE(double_positive(rho_1->get_value(), sg_maxmin_precision));
+ REQUIRE(double_positive(rho_1->get_value(), sg_precision_workamount));
}
SECTION("Bounded variable")
Sys.expand(sys_cnst, rho_1, 2);
Sys.expand(sys_cnst, rho_2, 1);
Sys.solve();
- REQUIRE(double_equals(rho_1->get_value(), .1, sg_maxmin_precision));
- REQUIRE(double_equals(rho_2->get_value(), .8, sg_maxmin_precision));
+ REQUIRE(double_equals(rho_1->get_value(), .1, sg_precision_workamount));
+ REQUIRE(double_equals(rho_2->get_value(), .8, sg_precision_workamount));
}
SECTION("Fatpipe")
Sys.expand(sys_cnst, rho_2, 1);
Sys.solve();
- REQUIRE(double_equals(rho_1->get_value(), 3.0, sg_maxmin_precision));
- REQUIRE(double_equals(rho_2->get_value(), 3.0, sg_maxmin_precision));
+ REQUIRE(double_equals(rho_1->get_value(), 3.0, sg_precision_workamount));
+ REQUIRE(double_equals(rho_2->get_value(), 3.0, sg_precision_workamount));
}
SECTION("(un)Bounded variable")
Sys.expand(sys_cnst, rho_1, 1);
Sys.expand(sys_cnst, rho_2, 1);
Sys.solve();
- REQUIRE(double_equals(rho_1->get_value(), .5, sg_maxmin_precision));
- REQUIRE(double_equals(rho_2->get_value(), .5, sg_maxmin_precision));
+ REQUIRE(double_equals(rho_1->get_value(), .5, sg_precision_workamount));
+ REQUIRE(double_equals(rho_2->get_value(), .5, sg_precision_workamount));
}
SECTION("Dynamic bounds")
lmm::Variable* rho_1 = Sys.variable_new(nullptr, 1);
Sys.expand(sys_cnst, rho_1, 1);
Sys.solve();
- REQUIRE(double_equals(rho_1->get_value(), 1, sg_maxmin_precision));
+ REQUIRE(double_equals(rho_1->get_value(), 1, sg_precision_workamount));
// add another variable, half initial capacity
lmm::Variable* rho_2 = Sys.variable_new(nullptr, 1);
Sys.expand(sys_cnst, rho_2, 1);
Sys.solve();
- REQUIRE(double_equals(rho_1->get_value(), .25, sg_maxmin_precision));
- REQUIRE(double_equals(rho_2->get_value(), .25, sg_maxmin_precision));
+ REQUIRE(double_equals(rho_1->get_value(), .25, sg_precision_workamount));
+ REQUIRE(double_equals(rho_2->get_value(), .25, sg_precision_workamount));
}
Sys.variable_free_all();
Sys.expand(sys_cnst2, rho_2, 1);
Sys.solve();
- REQUIRE(double_equals(rho_1->get_value(), 1.0 / 11.0, sg_maxmin_precision));
- REQUIRE(double_equals(rho_2->get_value(), 1.0 / 11.0, sg_maxmin_precision));
+ REQUIRE(double_equals(rho_1->get_value(), 1.0 / 11.0, sg_precision_workamount));
+ REQUIRE(double_equals(rho_2->get_value(), 1.0 / 11.0, sg_precision_workamount));
}
SECTION("BMF paper example")
Sys.expand(sys_cnst3, rho_3, 3.0 / 4.0);
Sys.solve();
- REQUIRE(double_equals(rho_1->get_value(), 1.0 / 3.0, sg_maxmin_precision));
- REQUIRE(double_equals(rho_2->get_value(), 4.0 / 9.0, sg_maxmin_precision));
- REQUIRE(double_equals(rho_3->get_value(), 4.0 / 9.0, sg_maxmin_precision));
+ REQUIRE(double_equals(rho_1->get_value(), 1.0 / 3.0, sg_precision_workamount));
+ REQUIRE(double_equals(rho_2->get_value(), 4.0 / 9.0, sg_precision_workamount));
+ REQUIRE(double_equals(rho_3->get_value(), 4.0 / 9.0, sg_precision_workamount));
}
SECTION("IO - example")
Sys.expand(sys_cnst3, rho_2, 1);
Sys.solve();
- REQUIRE(double_equals(rho_1->get_value(), 1e6 / 2.0, sg_maxmin_precision));
- REQUIRE(double_equals(rho_2->get_value(), 1e6 / 2.0, sg_maxmin_precision));
+ REQUIRE(double_equals(rho_1->get_value(), 1e6 / 2.0, sg_precision_workamount));
+ REQUIRE(double_equals(rho_2->get_value(), 1e6 / 2.0, sg_precision_workamount));
}
SECTION("Proportional fairness")
Sys.expand(sys_cnst, rho_3, epsilon);
Sys.solve();
- REQUIRE(double_equals(rho_1->get_value(), 1.0 / (2.0 + 2 * epsilon), sg_maxmin_precision));
- REQUIRE(double_equals(rho_2->get_value(), 1.0 / (2.0 + 2 * epsilon), sg_maxmin_precision));
- REQUIRE(double_equals(rho_3->get_value(), 1.0 / (1.0 + epsilon), sg_maxmin_precision));
+ REQUIRE(double_equals(rho_1->get_value(), 1.0 / (2.0 + 2 * epsilon), sg_precision_workamount));
+ REQUIRE(double_equals(rho_2->get_value(), 1.0 / (2.0 + 2 * epsilon), sg_precision_workamount));
+ REQUIRE(double_equals(rho_3->get_value(), 1.0 / (1.0 + epsilon), sg_precision_workamount));
}
Sys.variable_free_all();
Sys.expand(sys_cnst, rho_2, 5);
Sys.solve();
- REQUIRE(double_equals(rho_1->get_value(), 5.0 / 24.0, sg_maxmin_precision));
- REQUIRE(double_equals(rho_2->get_value(), 5.0 / 24.0, sg_maxmin_precision));
+ REQUIRE(double_equals(rho_1->get_value(), 5.0 / 24.0, sg_precision_workamount));
+ REQUIRE(double_equals(rho_2->get_value(), 5.0 / 24.0, sg_precision_workamount));
}
SECTION("1 subflows, 1 flow and 1 resource")
Sys.expand(sys_cnst, rho_2, 10);
Sys.solve();
- REQUIRE(double_equals(rho_1->get_value(), (5.0 / 25.0), sg_maxmin_precision));
- REQUIRE(double_equals(rho_2->get_value(), (5.0 / 25.0), sg_maxmin_precision));
- REQUIRE(double_equals(15 * rho_1->get_value(), 10 * rho_2->get_value() * 3 / 2, sg_maxmin_precision));
+ REQUIRE(double_equals(rho_1->get_value(), (5.0 / 25.0), sg_precision_workamount));
+ REQUIRE(double_equals(rho_2->get_value(), (5.0 / 25.0), sg_precision_workamount));
+ REQUIRE(double_equals(15 * rho_1->get_value(), 10 * rho_2->get_value() * 3 / 2, sg_precision_workamount));
}
SECTION("1 subflows using 2 resources: different max for each resource")
Sys.expand(sys_cnst2, rho_2, 3.0 / 2.0);
Sys.solve();
- REQUIRE(double_equals(rho_1->get_value(), (1.0 / 3.0), sg_maxmin_precision));
- REQUIRE(double_equals(rho_2->get_value(), (1.0 / 3.0), sg_maxmin_precision));
+ REQUIRE(double_equals(rho_1->get_value(), (1.0 / 3.0), sg_precision_workamount));
+ REQUIRE(double_equals(rho_2->get_value(), (1.0 / 3.0), sg_precision_workamount));
}
Sys.variable_free_all();
Sys.solve();
for (const auto* rho : vars) {
- REQUIRE(double_positive(rho->get_value(), sg_maxmin_precision));
+ REQUIRE(double_positive(rho->get_value(), sg_precision_workamount));
}
}
Sys.expand(sys_cnst, rho_2, 1.0);
Sys.expand(sys_cnst2, rho_2, 1.0);
Sys.solve();
- REQUIRE(double_equals(rho_1->get_value(), 1.4, sg_maxmin_precision));
- REQUIRE(double_equals(rho_2->get_value(), 3, sg_maxmin_precision));
+ REQUIRE(double_equals(rho_1->get_value(), 1.4, sg_precision_workamount));
+ REQUIRE(double_equals(rho_2->get_value(), 3, sg_precision_workamount));
}
SECTION("s4u-cloud-capping bug: all limited by bound extra case")
Sys.expand(sys_cnst, rho_1, 1);
Sys.expand(sys_cnst, rho_2, 1);
Sys.solve();
- REQUIRE(double_equals(rho_1->get_value(), 7.6296e+06, sg_maxmin_precision));
- REQUIRE(double_equals(rho_2->get_value(), 3.8148e+07, sg_maxmin_precision));
+ REQUIRE(double_equals(rho_1->get_value(), 7.6296e+06, sg_precision_workamount));
+ REQUIRE(double_equals(rho_2->get_value(), 3.8148e+07, sg_precision_workamount));
}
SECTION("Variable penalty with bounds: thread bug")
Sys.expand(sys_cnst, rho_1, 1);
Sys.solve();
- REQUIRE(double_equals(rho_1->get_value(), 8e7, sg_maxmin_precision));
- REQUIRE(double_equals(rho_2->get_value(), 3.2e8, sg_maxmin_precision));
+ REQUIRE(double_equals(rho_1->get_value(), 8e7, sg_precision_workamount));
+ REQUIRE(double_equals(rho_2->get_value(), 3.2e8, sg_precision_workamount));
}
SECTION("Variable penalty with bounds greater than C")
Sys.expand(sys_cnst, rho_1, 1);
Sys.solve();
- REQUIRE(double_equals(rho_1->get_value(), 4e8, sg_maxmin_precision));
+ REQUIRE(double_equals(rho_1->get_value(), 4e8, sg_precision_workamount));
}
Sys.variable_free_all();
xbt_assert(elem.variable->sharing_penalty_ > 0);
XBT_DEBUG("\tUpdate constraint %p (%g) with variable %p by %g", &cnst, cnst.remaining_, elem.variable,
elem.variable->mu_);
- double_update(&cnst.remaining_, elem.consumption_weight * elem.variable->mu_, sg_maxmin_precision);
+ double_update(&cnst.remaining_, elem.consumption_weight * elem.variable->mu_, sg_precision_workamount);
}
} else {
for (const Element& elem : cnst.enabled_element_set_) {
cnst.usage_ = std::min(cnst.usage_, elem.consumption_weight * elem.variable->mu_);
}
XBT_DEBUG("\tUpdate constraint %p (%g) by %g", &cnst, cnst.remaining_, cnst.usage_);
- double_update(&cnst.remaining_, cnst.usage_, sg_maxmin_precision);
+ double_update(&cnst.remaining_, cnst.usage_, sg_precision_workamount);
}
XBT_DEBUG("\tRemaining for %p : %g", &cnst, cnst.remaining_);
cnst.dynamic_bound_ = cnst.dyn_constraint_cb_(cnst.bound_, cnst.concurrency_current_);
}
cnst.remaining_ = cnst.dynamic_bound_;
- if (not double_positive(cnst.remaining_, cnst.dynamic_bound_ * sg_maxmin_precision))
+ if (not double_positive(cnst.remaining_, cnst.dynamic_bound_ * sg_precision_workamount))
continue;
cnst.usage_ = 0;
for (Element& elem : cnst.enabled_element_set_) {
XBT_DEBUG("Setting var (%d) value to %f\n", var.rank_, var.value_);
} else {
// If there exist a variable that can reach its bound, only update it (and other with the same bound) for now.
- if (double_equals(min_bound, var.bound_ * var.sharing_penalty_, sg_maxmin_precision)) {
+ if (double_equals(min_bound, var.bound_ * var.sharing_penalty_, sg_precision_workamount)) {
var.value_ = var.bound_;
XBT_DEBUG("Setting %p (%d) value to %f\n", &var, var.rank_, var.value_);
} else {
if (cnst->sharing_policy_ != Constraint::SharingPolicy::FATPIPE) {
// Remember: shared constraints require that sum(elem.value * var.value) < cnst->bound
double_update(&(cnst->remaining_), elem.consumption_weight * var.value_,
- cnst->dynamic_bound_ * sg_maxmin_precision);
- double_update(&(cnst->usage_), elem.consumption_weight / var.sharing_penalty_, sg_maxmin_precision);
+ cnst->dynamic_bound_ * sg_precision_workamount);
+ double_update(&(cnst->usage_), elem.consumption_weight / var.sharing_penalty_, sg_precision_workamount);
// If the constraint is saturated, remove it from the set of active constraints (light_tab)
- if (not double_positive(cnst->usage_, sg_maxmin_precision) ||
- not double_positive(cnst->remaining_, cnst->dynamic_bound_ * sg_maxmin_precision)) {
+ if (not double_positive(cnst->usage_, sg_precision_workamount) ||
+ not double_positive(cnst->remaining_, cnst->dynamic_bound_ * sg_precision_workamount)) {
if (cnst->cnst_light_) {
size_t index = (cnst->cnst_light_ - cnst_light_tab);
XBT_DEBUG("index: %zu \t cnst_light_num: %d \t || usage: %f remaining: %f bound: %f", index,
cnst->usage_ = std::max(cnst->usage_, elem2.consumption_weight / elem2.variable->sharing_penalty_);
}
// If the constraint is saturated, remove it from the set of active constraints (light_tab)
- if (not double_positive(cnst->usage_, sg_maxmin_precision) ||
- not double_positive(cnst->remaining_, cnst->dynamic_bound_ * sg_maxmin_precision)) {
+ if (not double_positive(cnst->usage_, sg_precision_workamount) ||
+ not double_positive(cnst->remaining_, cnst->dynamic_bound_ * sg_precision_workamount)) {
if (cnst->cnst_light_) {
size_t index = (cnst->cnst_light_ - cnst_light_tab);
XBT_DEBUG("index: %zu \t cnst_light_num: %d \t || \t cnst: %p \t cnst->cnst_light: %p "
min_bound = -1;
saturated_constraints.clear();
for (int pos = 0; pos < cnst_light_num; pos++) {
- xbt_assert(not cnst_light_tab[pos].cnst->active_element_set_.empty(),
- "Cannot saturate more a constraint that has"
- " no active element! You may want to change the maxmin precision (--cfg=maxmin/precision:<new_value>)"
- " because of possible rounding effects.\n\tFor the record, the usage of this constraint is %g while "
- "the maxmin precision to which it is compared is %g.\n\tThe usage of the previous constraint is %g.",
- cnst_light_tab[pos].cnst->usage_, sg_maxmin_precision, cnst_light_tab[pos - 1].cnst->usage_);
+ xbt_assert(
+ not cnst_light_tab[pos].cnst->active_element_set_.empty(),
+ "Cannot saturate more a constraint that has"
+ " no active element! You may want to change the work amount precision (--cfg=precision/work:<new_value>)"
+ " because of possible rounding effects.\n\tFor the record, the usage of this constraint is %g while "
+ "the maxmin precision to which it is compared is %g.\n\tThe usage of the previous constraint is %g.",
+ cnst_light_tab[pos].cnst->usage_, sg_precision_workamount, cnst_light_tab[pos - 1].cnst->usage_);
saturated_constraints_update(cnst_light_tab[pos].remaining_over_usage, pos, saturated_constraints, &min_usage);
}
Sys.expand(sys_cnst, rho_2, 1);
Sys.solve();
- REQUIRE(double_equals(rho_1->get_value(), 2, sg_maxmin_precision));
- REQUIRE(double_equals(rho_2->get_value(), 1, sg_maxmin_precision));
+ REQUIRE(double_equals(rho_1->get_value(), 2, sg_precision_workamount));
+ REQUIRE(double_equals(rho_2->get_value(), 1, sg_precision_workamount));
}
SECTION("Consumption weight")
Sys.expand(sys_cnst, rho_2, 2);
Sys.solve();
- REQUIRE(double_equals(rho_1->get_value(), 1, sg_maxmin_precision));
- REQUIRE(double_equals(rho_2->get_value(), 1, sg_maxmin_precision));
+ REQUIRE(double_equals(rho_1->get_value(), 1, sg_precision_workamount));
+ REQUIRE(double_equals(rho_2->get_value(), 1, sg_precision_workamount));
}
SECTION("Consumption weight + variable penalty")
Sys.solve();
double rho_1_share = 10;
- REQUIRE(double_equals(rho_1->get_value(), rho_1_share, sg_maxmin_precision));
- REQUIRE(double_equals(rho_2->get_value(), rho_1_share / 2, sg_maxmin_precision));
+ REQUIRE(double_equals(rho_1->get_value(), rho_1_share, sg_precision_workamount));
+ REQUIRE(double_equals(rho_2->get_value(), rho_1_share / 2, sg_precision_workamount));
}
SECTION("Multiple constraints systems")
Sys.solve();
double rho_1_share = 10; // Start by solving the first constraint (results is the same as previous tests)
- REQUIRE(double_equals(rho_1->get_value(), rho_1_share, sg_maxmin_precision));
- REQUIRE(double_equals(rho_2->get_value(), rho_1_share / 2, sg_maxmin_precision));
- REQUIRE(double_equals(rho_3->get_value(), 60 - 2 * rho_1_share, sg_maxmin_precision));
+ REQUIRE(double_equals(rho_1->get_value(), rho_1_share, sg_precision_workamount));
+ REQUIRE(double_equals(rho_2->get_value(), rho_1_share / 2, sg_precision_workamount));
+ REQUIRE(double_equals(rho_3->get_value(), 60 - 2 * rho_1_share, sg_precision_workamount));
}
Sys.variable_free_all();
Sys.expand(sys_cnst, rho_2, 1);
Sys.solve();
- REQUIRE(double_equals(rho_1->get_value(), 10, sg_maxmin_precision));
- REQUIRE(double_equals(rho_2->get_value(), 10 / 2, sg_maxmin_precision));
+ REQUIRE(double_equals(rho_1->get_value(), 10, sg_precision_workamount));
+ REQUIRE(double_equals(rho_2->get_value(), 10 / 2, sg_precision_workamount));
}
SECTION("Consumption weight")
Sys.expand(sys_cnst, rho_2, 2);
Sys.solve();
- REQUIRE(double_equals(rho_1->get_value(), 5, sg_maxmin_precision));
- REQUIRE(double_equals(rho_2->get_value(), 5, sg_maxmin_precision));
+ REQUIRE(double_equals(rho_1->get_value(), 5, sg_precision_workamount));
+ REQUIRE(double_equals(rho_2->get_value(), 5, sg_precision_workamount));
}
SECTION("Consumption weight + variable penalty")
Sys.expand(sys_cnst, sys_var_2, 2);
Sys.solve();
- REQUIRE(double_equals(sys_var_1->get_value(), 10, sg_maxmin_precision));
- REQUIRE(double_equals(sys_var_2->get_value(), 5, sg_maxmin_precision));
+ REQUIRE(double_equals(sys_var_1->get_value(), 10, sg_precision_workamount));
+ REQUIRE(double_equals(sys_var_2->get_value(), 5, sg_precision_workamount));
}
SECTION("Multiple constraints systems")
Sys.solve();
double rho_1_share = 10; // Start by solving the first constraint (results is the same as previous tests)
- REQUIRE(double_equals(rho_1->get_value(), rho_1_share, sg_maxmin_precision));
- REQUIRE(double_equals(rho_2->get_value(), rho_1_share / 2, sg_maxmin_precision));
- REQUIRE(double_equals(rho_3->get_value(), 60, sg_maxmin_precision));
+ REQUIRE(double_equals(rho_1->get_value(), rho_1_share, sg_precision_workamount));
+ REQUIRE(double_equals(rho_2->get_value(), rho_1_share / 2, sg_precision_workamount));
+ REQUIRE(double_equals(rho_3->get_value(), 60, sg_precision_workamount));
}
Sys.variable_free_all();
Sys.expand(sys_cnst, rho_1, 1);
Sys.solve();
- REQUIRE(double_equals(rho_1->get_value(), 10, sg_maxmin_precision));
+ REQUIRE(double_equals(rho_1->get_value(), 10, sg_precision_workamount));
}
SECTION("2 activities, but ignore crosstraffic 100% C")
Sys.expand(sys_cnst, rho_2, 0.05);
Sys.solve();
- REQUIRE(double_equals(rho_1->get_value(), 10 / 1.05, sg_maxmin_precision));
- REQUIRE(double_equals(rho_1->get_value(), rho_2->get_value(), sg_maxmin_precision));
+ REQUIRE(double_equals(rho_1->get_value(), 10 / 1.05, sg_precision_workamount));
+ REQUIRE(double_equals(rho_1->get_value(), rho_2->get_value(), sg_precision_workamount));
}
SECTION("2 activities, 1 inactive 100% C")
Sys.expand(sys_cnst, rho_2, 1);
Sys.solve();
- REQUIRE(double_equals(rho_1->get_value(), 10, sg_maxmin_precision));
- REQUIRE(double_equals(rho_2->get_value(), 0, sg_maxmin_precision));
+ REQUIRE(double_equals(rho_1->get_value(), 10, sg_precision_workamount));
+ REQUIRE(double_equals(rho_2->get_value(), 0, sg_precision_workamount));
}
SECTION("2 activity, 90% C")
Sys.expand(sys_cnst, rho_2, 1);
Sys.solve();
- REQUIRE(double_equals(rho_1->get_value(), 4.5, sg_maxmin_precision));
- REQUIRE(double_equals(rho_1->get_value(), 4.5, sg_maxmin_precision));
+ REQUIRE(double_equals(rho_1->get_value(), 4.5, sg_precision_workamount));
+ REQUIRE(double_equals(rho_1->get_value(), 4.5, sg_precision_workamount));
}
SECTION("3 activity, 80% C")
Sys.expand(sys_cnst, rho_3, 1);
Sys.solve();
- REQUIRE(double_equals(rho_1->get_value(), 4, sg_maxmin_precision));
- REQUIRE(double_equals(rho_2->get_value(), 2, sg_maxmin_precision));
- REQUIRE(double_equals(rho_3->get_value(), 2, sg_maxmin_precision));
+ REQUIRE(double_equals(rho_1->get_value(), 4, sg_precision_workamount));
+ REQUIRE(double_equals(rho_2->get_value(), 2, sg_precision_workamount));
+ REQUIRE(double_equals(rho_3->get_value(), 2, sg_precision_workamount));
}
Sys.variable_free_all();
Sys.expand(sys_cnst, rho_3, epsilon);
Sys.solve();
- REQUIRE(double_equals(rho_1->get_value(), 1.0 / (2.0 + epsilon), sg_maxmin_precision));
- REQUIRE(double_equals(rho_2->get_value(), 1.0 / (2.0 + epsilon), sg_maxmin_precision));
- REQUIRE(double_equals(rho_3->get_value(), 1.0 / (2.0 + epsilon), sg_maxmin_precision));
+ REQUIRE(double_equals(rho_1->get_value(), 1.0 / (2.0 + epsilon), sg_precision_workamount));
+ REQUIRE(double_equals(rho_2->get_value(), 1.0 / (2.0 + epsilon), sg_precision_workamount));
+ REQUIRE(double_equals(rho_3->get_value(), 1.0 / (2.0 + epsilon), sg_precision_workamount));
}
Sys.variable_free_all();
void Action::update_remains(double delta)
{
- double_update(&remains_, delta, sg_maxmin_precision * sg_precision_timing);
+ double_update(&remains_, delta, sg_precision_workamount * sg_precision_timing);
}
void Action::set_last_update()
return;
}
- /* Plugins configuration */
+ /* Plugins and models configuration */
simgrid_plugins().create_flag("plugin", "The plugins", "", true);
simgrid_cpu_models().create_flag("cpu/model", "The model to use for the CPU", "Cas01", false);
simgrid_network_models().create_flag("network/model", "The model to use for the network", "LV08", false);
simgrid::config::bind_flag(sg_precision_timing, "precision/timing", {"surf/precision"},
"Numerical precision used when updating simulation times (in seconds)");
- simgrid::config::bind_flag(sg_maxmin_precision, "maxmin/precision",
+ simgrid::config::bind_flag(sg_precision_workamount, "precision/work-amount", {"maxmin/precision"},
"Numerical precision used when computing resource sharing (in flops/sec or bytes/sec)");
simgrid::config::bind_flag(sg_concurrency_limit, "maxmin/concurrency-limit",
XBT_DEBUG("a %f ind %ld integral %f ind + 1 %f ind %f time +1 %f time %f", a, ind, integral, integral_[ind + 1],
integral_[ind], time_points_[ind + 1], time_points_[ind]);
- double_update(&a_aux, time_points_[ind], sg_maxmin_precision * sg_precision_timing);
+ double_update(&a_aux, time_points_[ind], sg_precision_workamount * sg_precision_timing);
if (a_aux > 0)
integral +=
((integral_[ind + 1] - integral_[ind]) / (time_points_[ind + 1] - time_points_[ind])) * (a - time_points_[ind]);
*********/
/* user-visible parameters */
-XBT_PUBLIC_DATA double sg_maxmin_precision;
+XBT_PUBLIC_DATA double sg_precision_workamount;
XBT_PUBLIC_DATA double sg_precision_timing;
XBT_PUBLIC_DATA int sg_concurrency_limit;
<!DOCTYPE platform SYSTEM "https://simgrid.org/simgrid.dtd">
<platform version="4.1">
<config id="General">
- <prop id="maxmin/precision" value="0.000010"/>
+ <prop id="precision/work-amount" value="0.000010"/>
<prop id="cpu/optim" value="TI"/>
<prop id="path" value="~/"/>
</config>
$ ${bindir:=.}/basic-parsing-test ${srcdir:=.}/../../platforms/properties.xml --log=root.fmt=%m%n
> Configuration change: Set 'cpu/optim' to 'TI'
-> Configuration change: Set 'maxmin/precision' to '0.000010'
+> Configuration change: Set 'precision/work-amount' to '0.000010'
> Workstation number: 1, link number: 1
$ ${bindir:=.}/basic-parsing-test ${srcdir:=.}/../../platforms/properties.xml --cfg=cpu/optim:TI --log=root.fmt=%m%n
> Configuration change: Set 'cpu/optim' to 'TI'
> The custom configuration 'cpu/optim' is already defined by user!
-> Configuration change: Set 'maxmin/precision' to '0.000010'
+> Configuration change: Set 'precision/work-amount' to '0.000010'
> Workstation number: 1, link number: 1