Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[ci-skip] document s4u::Task
[simgrid.git] / src / kernel / lmm / System.hpp
index b2e5c4f42cb4c32badca52152ed5ae3fffd779ee..25fa550730fee8ed3d4500064a37f6074e449b9c 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2004-2022. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2004-2023. The SimGrid Team. All rights reserved.          */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
@@ -8,21 +8,24 @@
 
 #include "simgrid/kernel/resource/Action.hpp"
 #include "simgrid/kernel/resource/Model.hpp"
-#include "simgrid/s4u/Link.hpp"
-#include "src/surf/surf_interface.hpp"
 #include "xbt/asserts.h"
-#include "xbt/ex.h"
 #include "xbt/mallocator.h"
 
 #include <boost/intrusive/list.hpp>
 #include <cmath>
 #include <limits>
 #include <memory>
+#include <string_view>
 #include <vector>
 
+/* user-visible parameters */
+XBT_PUBLIC_DATA double sg_precision_workamount;
+XBT_PUBLIC_DATA double sg_precision_timing;
+XBT_PUBLIC_DATA int sg_concurrency_limit;
+
 namespace simgrid::kernel::lmm {
 
-/** @addtogroup SURF_lmm
+/** @addtogroup Model_lmm
  * @details
  * A linear maxmin solver to resolve inequations systems.
  *
@@ -132,7 +135,7 @@ namespace simgrid::kernel::lmm {
  * At the current state, each variable counts as 1 if its consumption weight is greater than 1.
  */
 
-/** @{ @ingroup SURF_lmm */
+/** @{ @ingroup Model_lmm */
 
 /**
  * @brief LMM element
@@ -217,8 +220,8 @@ public:
   /** @brief Check how a constraint is shared  */
   SharingPolicy get_sharing_policy() const { return sharing_policy_; }
 
-  /** @brief Get the usage of the constraint after the last lmm solve */
-  double get_usage() const;
+  /** @brief Get the load of the constraint after the last lmm solve */
+  double get_load() const;
 
   /** @brief Sets the concurrency limit for this constraint */
   void set_concurrency_limit(int limit)
@@ -242,7 +245,7 @@ public:
   int get_concurrency_maximum() const
   {
     xbt_assert(concurrency_limit_ < 0 || concurrency_maximum_ <= concurrency_limit_,
-               "Very bad: maximum observed concurrency is higher than limit. This is a bug of SURF, please report it.");
+               "Very bad: maximum observed concurrency is higher than limit. This is a bug, please report it.");
     return concurrency_maximum_;
   }
 
@@ -418,7 +421,7 @@ public:
    * @param selective_update Enables lazy updates
    * @return pointer to System instance
    */
-  static System* build(const std::string& solver_name, bool selective_update);
+  static System* build(std::string_view solver_name, bool selective_update);
   /** @brief Validates solver configuration */
   static void validate_solver(const std::string& solver_name);
 
@@ -464,8 +467,11 @@ public:
    * @param cnst A constraint
    * @param var A variable
    * @param value The coefficient associated to the variable in the constraint
+   * @param force_creation Force the creation of new element linking the variable to the constraint. Should be used only
+   * by the model ptask_L07 to cope with ptasks composed of flows running on the same resource (see
+   * https://framagit.org/simgrid/simgrid/-/issues/111)
    */
-  void expand(Constraint * cnst, Variable * var, double value);
+  void expand(Constraint* cnst, Variable* var, double value, bool force_creation = false);
 
   /** @brief Update the bound of a variable */
   void update_variable_bound(Variable * var, double bound);