Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Rename option maxmin/precision to precision/work-amount for clarity
authorMartin Quinson <martin.quinson@ens-rennes.fr>
Thu, 16 Feb 2023 23:01:45 +0000 (00:01 +0100)
committerMartin Quinson <martin.quinson@ens-rennes.fr>
Fri, 17 Feb 2023 07:30:13 +0000 (08:30 +0100)
16 files changed:
ChangeLog
docs/source/Configuring_SimGrid.rst
docs/source/XML_reference.rst
examples/platforms/config.xml
src/kernel/lmm/System.cpp
src/kernel/lmm/bmf.cpp
src/kernel/lmm/bmf_test.cpp
src/kernel/lmm/fair_bottleneck.cpp
src/kernel/lmm/maxmin.cpp
src/kernel/lmm/maxmin_test.cpp
src/kernel/resource/Action.cpp
src/simgrid/sg_config.cpp
src/surf/cpu_ti.cpp
src/surf/surf_interface.hpp
teshsuite/platforms/properties.xml
teshsuite/s4u/basic-parsing-test/basic-parsing-test.tesh

index b9f5e31..30e8baf 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -37,6 +37,7 @@ Models:
  - 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.
index a2bc3e3..172de94 100644 (file)
@@ -105,7 +105,6 @@ Existing Configuration Items
 
 - **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`
@@ -141,6 +140,7 @@ Existing Configuration Items
 - **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`
@@ -303,14 +303,14 @@ configurations.
     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
index a7619f3..dad879d 100644 (file)
@@ -132,7 +132,7 @@ name of the flag and ``value`` is what it has to be set to.
    <!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" />
index b524bf1..6ab6432 100644 (file)
@@ -2,7 +2,7 @@
 <!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>
index a665cfe..6664f3a 100644 (file)
@@ -13,7 +13,7 @@
 
 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 */
 
@@ -426,7 +426,7 @@ void System::print() const
     }
     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_);
   }
 
@@ -435,7 +435,7 @@ void System::print() const
   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_);
index eb629b4..b46c8c7 100644 (file)
@@ -309,7 +309,7 @@ bool BmfSolver::is_bmf(const Eigen::VectorXd& rho) const
   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
@@ -321,15 +321,15 @@ bool BmfSolver::is_bmf(const Eigen::VectorXd& rho) const
 
   // 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;
     }
index ffaf589..2306af9 100644 (file)
@@ -34,7 +34,7 @@ TEST_CASE("kernel::bmf Basic tests", "[kernel-bmf-basic]")
     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")
@@ -60,8 +60,8 @@ TEST_CASE("kernel::bmf Basic tests", "[kernel-bmf-basic]")
     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")
@@ -87,8 +87,8 @@ TEST_CASE("kernel::bmf Basic tests", "[kernel-bmf-basic]")
     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")
@@ -113,8 +113,8 @@ TEST_CASE("kernel::bmf Basic tests", "[kernel-bmf-basic]")
     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")
@@ -138,7 +138,7 @@ TEST_CASE("kernel::bmf Basic tests", "[kernel-bmf-basic]")
     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")
@@ -163,8 +163,8 @@ TEST_CASE("kernel::bmf Basic tests", "[kernel-bmf-basic]")
     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")
@@ -191,8 +191,8 @@ TEST_CASE("kernel::bmf Basic tests", "[kernel-bmf-basic]")
     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")
@@ -217,8 +217,8 @@ TEST_CASE("kernel::bmf Basic tests", "[kernel-bmf-basic]")
     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")
@@ -242,15 +242,15 @@ TEST_CASE("kernel::bmf Basic tests", "[kernel-bmf-basic]")
     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();
@@ -291,8 +291,8 @@ TEST_CASE("kernel::bmf Advanced tests", "[kernel-bmf-advanced]")
     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")
@@ -327,9 +327,9 @@ TEST_CASE("kernel::bmf Advanced tests", "[kernel-bmf-advanced]")
     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")
@@ -368,8 +368,8 @@ TEST_CASE("kernel::bmf Advanced tests", "[kernel-bmf-advanced]")
     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")
@@ -398,9 +398,9 @@ TEST_CASE("kernel::bmf Advanced tests", "[kernel-bmf-advanced]")
     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();
@@ -440,8 +440,8 @@ TEST_CASE("kernel::bmf Subflows", "[kernel-bmf-subflow]")
     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")
@@ -475,9 +475,9 @@ TEST_CASE("kernel::bmf Subflows", "[kernel-bmf-subflow]")
     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")
@@ -513,8 +513,8 @@ TEST_CASE("kernel::bmf Subflows", "[kernel-bmf-subflow]")
     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();
@@ -556,7 +556,7 @@ TEST_CASE("kernel::bmf Loop", "[kernel-bmf-loop]")
     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));
     }
   }
 
@@ -655,8 +655,8 @@ TEST_CASE("kernel::bmf Bugs", "[kernel-bmf-bug]")
     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")
@@ -675,8 +675,8 @@ TEST_CASE("kernel::bmf Bugs", "[kernel-bmf-bug]")
     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")
@@ -694,8 +694,8 @@ TEST_CASE("kernel::bmf Bugs", "[kernel-bmf-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")
@@ -709,7 +709,7 @@ TEST_CASE("kernel::bmf Bugs", "[kernel-bmf-bug]")
     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();
index 2f9c2e7..c9cd24c 100644 (file)
@@ -103,7 +103,7 @@ void simgrid::kernel::lmm::FairBottleneck::do_solve()
           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_) {
@@ -113,7 +113,7 @@ void simgrid::kernel::lmm::FairBottleneck::do_solve()
           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_);
index 7cbe6cf..574bef2 100644 (file)
@@ -71,7 +71,7 @@ template <class CnstList> void MaxMin::maxmin_solve(CnstList& cnst_list)
       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_) {
@@ -132,7 +132,7 @@ template <class CnstList> void MaxMin::maxmin_solve(CnstList& cnst_list)
         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 {
@@ -151,11 +151,11 @@ template <class CnstList> void MaxMin::maxmin_solve(CnstList& cnst_list)
         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,
@@ -183,8 +183,8 @@ template <class CnstList> void MaxMin::maxmin_solve(CnstList& cnst_list)
               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 "
@@ -214,12 +214,13 @@ template <class CnstList> void MaxMin::maxmin_solve(CnstList& cnst_list)
     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);
     }
 
index dd34cd0..1ef58cc 100644 (file)
@@ -37,8 +37,8 @@ TEST_CASE("kernel::lmm Single constraint shared systems", "[kernel-lmm-shared-si
     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")
@@ -65,8 +65,8 @@ TEST_CASE("kernel::lmm Single constraint shared systems", "[kernel-lmm-shared-si
     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")
@@ -94,8 +94,8 @@ TEST_CASE("kernel::lmm Single constraint shared systems", "[kernel-lmm-shared-si
     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")
@@ -134,9 +134,9 @@ TEST_CASE("kernel::lmm Single constraint shared systems", "[kernel-lmm-shared-si
     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();
@@ -171,8 +171,8 @@ TEST_CASE("kernel::lmm Single constraint unshared systems", "[kernel-lmm-unshare
     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")
@@ -201,8 +201,8 @@ TEST_CASE("kernel::lmm Single constraint unshared systems", "[kernel-lmm-unshare
     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")
@@ -231,8 +231,8 @@ TEST_CASE("kernel::lmm Single constraint unshared systems", "[kernel-lmm-unshare
     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")
@@ -273,9 +273,9 @@ TEST_CASE("kernel::lmm Single constraint unshared systems", "[kernel-lmm-unshare
     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();
@@ -310,7 +310,7 @@ TEST_CASE("kernel::lmm dynamic constraint shared systems", "[kernel-lmm-shared-s
     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")
@@ -336,8 +336,8 @@ TEST_CASE("kernel::lmm dynamic constraint shared systems", "[kernel-lmm-shared-s
     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")
@@ -362,8 +362,8 @@ TEST_CASE("kernel::lmm dynamic constraint shared systems", "[kernel-lmm-shared-s
     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")
@@ -388,8 +388,8 @@ TEST_CASE("kernel::lmm dynamic constraint shared systems", "[kernel-lmm-shared-s
     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")
@@ -417,9 +417,9 @@ TEST_CASE("kernel::lmm dynamic constraint shared systems", "[kernel-lmm-shared-s
     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();
@@ -458,9 +458,9 @@ TEST_CASE("kernel::lmm shared systems with crosstraffic", "[kernel-lmm-shared-cr
     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();
index ed431b7..8ca52bd 100644 (file)
@@ -199,7 +199,7 @@ void Action::update_max_duration(double delta)
 
 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()
index dc2fd84..44e982d 100644 (file)
@@ -139,7 +139,7 @@ void sg_config_init(int *argc, char **argv)
     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);
@@ -149,7 +149,7 @@ void sg_config_init(int *argc, char **argv)
   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",
index 029965a..e65a824 100644 (file)
@@ -120,7 +120,7 @@ double CpuTiProfile::integrate_simple_point(double a) const
 
   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]);
index b5dfbd3..a63cd3f 100644 (file)
@@ -26,7 +26,7 @@
  *********/
 
 /* 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;
 
index fd238af..6f06059 100644 (file)
@@ -2,7 +2,7 @@
 <!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>
index 66e38a4..2a3d976 100644 (file)
@@ -37,11 +37,11 @@ $ ${bindir:=.}/basic-parsing-test ${platfdir:=.}/cloud.xml --log=root.fmt=%m%n
 
 $ ${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