Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Kill typedef lmm_system_t
authorMartin Quinson <martin.quinson@loria.fr>
Sat, 24 Mar 2018 20:35:42 +0000 (21:35 +0100)
committerMartin Quinson <martin.quinson@loria.fr>
Sat, 24 Mar 2018 20:35:42 +0000 (21:35 +0100)
28 files changed:
include/simgrid/forward.h
include/simgrid/kernel/resource/Model.hpp
include/simgrid/kernel/routing/ClusterZone.hpp
include/simgrid/plugins/live_migration.h
include/simgrid/plugins/load.h
src/instr/instr_paje_events.cpp
src/kernel/lmm/fair_bottleneck.cpp
src/kernel/lmm/lagrange.cpp
src/kernel/lmm/maxmin.cpp
src/kernel/lmm/maxmin.hpp
src/msg/msg_legacy.cpp
src/plugins/vm/VirtualMachineImpl.cpp
src/plugins/vm/s4u_VirtualMachine.cpp
src/simgrid/sg_config.cpp
src/smpi/bindings/smpi_mpi.cpp
src/surf/StorageImpl.cpp
src/surf/StorageImpl.hpp
src/surf/network_cm02.cpp
src/surf/network_cm02.hpp
src/surf/network_interface.hpp
src/surf/ptask_L07.cpp
src/surf/ptask_L07.hpp
src/surf/storage_n11.cpp
src/surf/storage_n11.hpp
src/surf/trace_mgr.cpp
src/surf/xml/surfxml_parseplatf.cpp
teshsuite/surf/lmm_usage/lmm_usage.cpp
teshsuite/surf/maxmin_bench/maxmin_bench.cpp

index 7851a60..8f71d15 100644 (file)
@@ -102,7 +102,6 @@ typedef simgrid::surf::StorageImpl* surf_storage_t;
 typedef simgrid::kernel::lmm::Element* lmm_element_t;
 typedef const simgrid::kernel::lmm::Element* const_lmm_element_t;
 typedef simgrid::kernel::lmm::ConstraintLight* lmm_constraint_light_t;
-typedef simgrid::kernel::lmm::System* lmm_system_t;
 
 #else
 
index a67f1fe..5de68af 100644 (file)
@@ -50,7 +50,7 @@ public:
   ActionLmmListPtr getModifiedSet() const;
 
   /** @brief Get the maxmin system of the current Model */
-  lmm_system_t getMaxminSystem() const { return maxmin_system_; }
+  lmm::System* getMaxminSystem() const { return maxmin_system_; }
 
   /**
    * @brief Get the update mechanism of the current Model
@@ -94,7 +94,7 @@ public:
   virtual bool nextOccuringEventIsIdempotent() { return true; }
 
 protected:
-  lmm_system_t maxmin_system_ = nullptr;
+  lmm::System* maxmin_system_ = nullptr;
 
 private:
   e_UM_t update_mechanism_        = UM_UNDEFINED;
index f07b371..f44aba3 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2013-2017. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2013-2018. 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. */
index a75cac2..bfdf1f8 100644 (file)
@@ -1,5 +1,4 @@
-/* Copyright (c) 2017-2018. The SimGrid Team.
- * All rights reserved.                                                     */
+/* Copyright (c) 2017-2018. 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. */
index d6d09b9..734752a 100644 (file)
@@ -1,5 +1,4 @@
-/* Copyright (c) 2017-2018. The SimGrid Team.
- * All rights reserved.                                                     */
+/* Copyright (c) 2017-2018. 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. */
index 49c8d77..4037df7 100644 (file)
@@ -1,5 +1,4 @@
-/* Copyright (c) 2012-2017. The SimGrid Team.
- * All rights reserved.                                                     */
+/* Copyright (c) 2012-2018. 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. */
index 83bd007..cd43352 100644 (file)
@@ -1,5 +1,4 @@
-/* Copyright (c) 2007-2011, 2013-2017. The SimGrid Team.
- * All rights reserved.                                                     */
+/* Copyright (c) 2007-2018. 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. */
@@ -18,7 +17,7 @@ XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(surf_maxmin);
 #define SHOW_EXPR_D(expr) XBT_DEBUG(#expr " = %d", expr);
 #define SHOW_EXPR_P(expr) XBT_DEBUG(#expr " = %p", expr);
 
-void simgrid::kernel::lmm::bottleneck_solve(lmm_system_t sys)
+void simgrid::kernel::lmm::bottleneck_solve(lmm::System* sys)
 {
   if (not sys->modified)
     return;
index d08d85c..7d2afe0 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2007-2017. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2007-2018. 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. */
@@ -37,7 +37,7 @@ double (*func_fpi_def)(const Variable&, double);
  * Local prototypes to implement the Lagrangian optimization with optimal step, also called dichotomy.
  */
 // solves the proportional fairness using a Lagrangian optimization with dichotomy step
-void lagrange_solve(lmm_system_t sys);
+void lagrange_solve(kernel::lmm::System* sys);
 // computes the value of the dichotomy using a initial values, init, with a specific variable or constraint
 static double dichotomy(double init, double diff(double, const Constraint&), const Constraint& cnst, double min_error);
 // computes the value of the differential of constraint cnst applied to lambda
@@ -137,7 +137,7 @@ static double dual_objective(const VarList& var_list, const CnstList& cnst_list)
   return obj;
 }
 
-void lagrange_solve(lmm_system_t sys)
+void lagrange_solve(kernel::lmm::System* sys)
 {
   /* Lagrange Variables. */
   int max_iterations       = 100;
index 879813e..c3b1668 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2004-2017. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2004-2018. 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. */
@@ -412,7 +412,7 @@ static inline void saturated_constraints_update(double usage, int cnst_light_num
 }
 
 static inline void saturated_variable_set_update(ConstraintLight* cnst_light_tab,
-                                                 const dyn_light_t& saturated_constraints, lmm_system_t sys)
+                                                 const dyn_light_t& saturated_constraints, System* sys)
 {
   /* Add active variables (i.e. variables that need to be set) from the set of constraints to saturate
    * (cnst_light_tab)*/
@@ -690,7 +690,7 @@ template <class CnstList> void System::solve(CnstList& cnst_list)
   delete[] cnst_light_tab;
 }
 
-void lmm_solve(lmm_system_t sys)
+void lmm_solve(System* sys)
 {
   sys->solve();
 }
index f294e72..65a2cd1 100644 (file)
@@ -139,10 +139,10 @@ namespace lmm {
  * @brief Solve the lmm system
  * @param sys The lmm system to solve
  */
-XBT_PUBLIC void lmm_solve(lmm_system_t sys);
+XBT_PUBLIC void lmm_solve(lmm::System* sys);
 
-XBT_PUBLIC void lagrange_solve(lmm_system_t sys);
-XBT_PUBLIC void bottleneck_solve(lmm_system_t sys);
+XBT_PUBLIC void lagrange_solve(lmm::System* sys);
+XBT_PUBLIC void bottleneck_solve(lmm::System* sys);
 
 /** Default functions associated to the chosen protocol. When using the lagrangian approach. */
 
@@ -603,7 +603,7 @@ public:
 
   simgrid::kernel::resource::ActionLmmListPtr modified_set_ = nullptr;
 
-  void (*solve_fun)(lmm_system_t self);
+  void (*solve_fun)(lmm::System* self);
 
 private:
   bool selective_update_active; /* flag to update partially the system only selecting changed portions */
index 0e9e819..849f151 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2004-2017. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2004-2018. 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. */
index f4c0dd6..69070f0 100644 (file)
@@ -1,5 +1,4 @@
-/* Copyright (c) 2013-2017. The SimGrid Team.
- * All rights reserved.                                                     */
+/* Copyright (c) 2013-2018. 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. */
@@ -98,7 +97,7 @@ double VMModel::nextOccuringEvent(double now)
     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);
-    lmm_system_t vcpu_system = cpu->model()->getMaxminSystem();
+    kernel::lmm::System* vcpu_system = cpu->model()->getMaxminSystem();
     vcpu_system->update_constraint_bound(cpu->constraint(), virt_overhead * solved_value);
   }
 
index e5b209e..5dfaf83 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2015-2017. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2015-2018. 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. */
index 19e7b14..cff2376 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2009-2017. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2009-2018. 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. */
index 483f17d..09ed672 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright ,(c) 2007-2017. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2007-2018. 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. */
index 56ad247..1cdd353 100644 (file)
@@ -44,8 +44,8 @@ StorageModel::~StorageModel()
  * Resource *
  ************/
 
-StorageImpl::StorageImpl(kernel::resource::Model* model, std::string name, lmm_system_t maxminSystem, double bread,
-                         double bwrite, std::string type_id, std::string content_name, sg_size_t size,
+StorageImpl::StorageImpl(kernel::resource::Model* model, std::string name, kernel::lmm::System* maxminSystem,
+                         double bread, double bwrite, std::string type_id, std::string content_name, sg_size_t size,
                          std::string attach)
     : Resource(model, name.c_str(), maxminSystem->constraint_new(this, std::max(bread, bwrite)))
     , piface_(name, this)
index 1f3d170..5027331 100644 (file)
@@ -1,5 +1,4 @@
-/* Copyright (c) 2004-2018. The SimGrid Team.
- * All rights reserved.                                                     */
+/* Copyright (c) 2004-2018. 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. */
@@ -86,8 +85,8 @@ public:
 class StorageImpl : public kernel::resource::Resource, public PropertyHolder {
 public:
   /** @brief Storage constructor */
-  StorageImpl(kernel::resource::Model* model, std::string name, lmm_system_t maxminSystem, double bread, double bwrite,
-              std::string type_id, std::string content_name, sg_size_t size, std::string attach);
+  StorageImpl(kernel::resource::Model* model, std::string name, kernel::lmm::System* maxminSystem, double bread,
+              double bwrite, std::string type_id, std::string content_name, sg_size_t size, std::string attach);
 
   ~StorageImpl() override;
 
index b84a7a0..c5d3c9d 100644 (file)
@@ -158,7 +158,7 @@ NetworkCm02Model::NetworkCm02Model()
     maxmin_system_->modified_set_ = new kernel::resource::ActionLmmList();
 }
 
-NetworkCm02Model::NetworkCm02Model(void (*specificSolveFun)(lmm_system_t self)) : NetworkCm02Model()
+NetworkCm02Model::NetworkCm02Model(void (*specificSolveFun)(kernel::lmm::System* self)) : NetworkCm02Model()
 {
   maxmin_system_->solve_fun = specificSolveFun;
 }
@@ -349,7 +349,7 @@ kernel::resource::Action* NetworkCm02Model::communicate(s4u::Host* src, s4u::Hos
  * Resource *
  ************/
 NetworkCm02Link::NetworkCm02Link(NetworkCm02Model* model, const std::string& name, double bandwidth, double latency,
-                                 e_surf_link_sharing_policy_t policy, lmm_system_t system)
+                                 e_surf_link_sharing_policy_t policy, kernel::lmm::System* system)
     : LinkImpl(model, name, system->constraint_new(this, sg_bandwidth_factor * bandwidth))
 {
   bandwidth_.scale = 1.0;
index 07486aa..f9904fd 100644 (file)
@@ -36,7 +36,7 @@ namespace surf {
 class NetworkCm02Model : public NetworkModel {
 public:
   NetworkCm02Model();
-  explicit NetworkCm02Model(void (*solve_fun)(lmm_system_t self));
+  explicit NetworkCm02Model(void (*solve_fun)(kernel::lmm::System* self));
   virtual ~NetworkCm02Model() = default;
   LinkImpl* createLink(const std::string& name, double bandwidth, double latency,
                        e_surf_link_sharing_policy_t policy) override;
@@ -52,7 +52,7 @@ public:
 class NetworkCm02Link : public LinkImpl {
 public:
   NetworkCm02Link(NetworkCm02Model* model, const std::string& name, double bandwidth, double latency,
-                  e_surf_link_sharing_policy_t policy, lmm_system_t system);
+                  e_surf_link_sharing_policy_t policy, kernel::lmm::System* system);
   virtual ~NetworkCm02Link() = default;
   void apply_event(tmgr_trace_event_t event, double value) override;
   void setBandwidth(double value) override;
index 373bc7a..e1e88ee 100644 (file)
@@ -68,7 +68,7 @@ public:
    *
    * @param system The lmm_system_t to solve
    */
-  void (*f_networkSolve)(lmm_system_t) = simgrid::kernel::lmm::lmm_solve;
+  void (*f_networkSolve)(kernel::lmm::System*) = kernel::lmm::lmm_solve;
 
   /**
    * @brief Get the right multiplicative factor for the latency.
index 00be086..87778c7 100644 (file)
@@ -46,7 +46,7 @@ HostL07Model::~HostL07Model()
   delete surf_cpu_model_pm;
 }
 
-CpuL07Model::CpuL07Model(HostL07Model* hmodel, lmm_system_t sys) : CpuModel(), hostModel_(hmodel)
+CpuL07Model::CpuL07Model(HostL07Model* hmodel, kernel::lmm::System* sys) : CpuModel(), hostModel_(hmodel)
 {
   maxmin_system_ = sys;
 }
@@ -56,7 +56,7 @@ CpuL07Model::~CpuL07Model()
   maxmin_system_ = nullptr;
 }
 
-NetworkL07Model::NetworkL07Model(HostL07Model* hmodel, lmm_system_t sys) : NetworkModel(), hostModel_(hmodel)
+NetworkL07Model::NetworkL07Model(HostL07Model* hmodel, kernel::lmm::System* sys) : NetworkModel(), hostModel_(hmodel)
 {
   maxmin_system_ = sys;
   loopback_     = NetworkL07Model::createLink("__loopback__", 498000000, 0.000015, SURF_LINK_FATPIPE);
index b783d55..90de6a9 100644 (file)
@@ -46,7 +46,7 @@ public:
 
 class CpuL07Model : public CpuModel {
 public:
-  CpuL07Model(HostL07Model* hmodel, lmm_system_t sys);
+  CpuL07Model(HostL07Model* hmodel, kernel::lmm::System* sys);
   ~CpuL07Model();
 
   Cpu *createCpu(simgrid::s4u::Host *host, std::vector<double> *speedPerPstate, int core) override;
@@ -55,7 +55,7 @@ public:
 
 class NetworkL07Model : public NetworkModel {
 public:
-  NetworkL07Model(HostL07Model* hmodel, lmm_system_t sys);
+  NetworkL07Model(HostL07Model* hmodel, kernel::lmm::System* sys);
   ~NetworkL07Model();
   LinkImpl* createLink(const std::string& name, double bandwidth, double latency,
                        e_surf_link_sharing_policy_t policy) override;
index 05cde18..4ee0d4a 100644 (file)
@@ -96,8 +96,8 @@ void StorageN11Model::updateActionsState(double /*now*/, double delta)
  * Resource *
  ************/
 
-StorageN11::StorageN11(StorageModel* model, std::string name, lmm_system_t maxminSystem, double bread, double bwrite,
-                       std::string type_id, std::string content_name, sg_size_t size, std::string attach)
+StorageN11::StorageN11(StorageModel* model, std::string name, kernel::lmm::System* maxminSystem, double bread,
+                       double bwrite, std::string type_id, std::string content_name, sg_size_t size, std::string attach)
     : StorageImpl(model, name, maxminSystem, bread, bwrite, type_id, content_name, size, attach)
 {
   XBT_DEBUG("Create resource with Bread '%f' Bwrite '%f' and Size '%llu'", bread, bwrite, size);
index c38ec74..09ddf63 100644 (file)
@@ -39,7 +39,7 @@ public:
 
 class StorageN11 : public StorageImpl {
 public:
-  StorageN11(StorageModel* model, std::string name, lmm_system_t maxminSystem, double bread, double bwrite,
+  StorageN11(StorageModel* model, std::string name, kernel::lmm::System* maxminSystem, double bread, double bwrite,
              std::string type_id, std::string content_name, sg_size_t size, std::string attach);
   virtual ~StorageN11() = default;
   StorageAction* read(sg_size_t size);
index 2e2743f..9fd4620 100644 (file)
@@ -1,5 +1,4 @@
-/* Copyright (c) 2004-2005, 2007, 2009-2014, 2016-2017. The SimGrid Team.
- * All rights reserved.                                                     */
+/* Copyright (c) 2004-2018. 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. */
index de90f8d..a8d085c 100644 (file)
@@ -1,5 +1,4 @@
-/* Copyright (c) 2006-2017. The SimGrid Team.
- * All rights reserved.                                                     */
+/* Copyright (c) 2006-2018. 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. */
index c4ea52e..acac3e1 100644 (file)
@@ -1,7 +1,6 @@
 /* A few tests for the maxmin library                                       */
 
-/* Copyright (c) 2007-2018s. The SimGrid Team.
- * All rights reserved.                                                     */
+/* Copyright (c) 2007-2018. 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. */
@@ -98,7 +97,7 @@ static void test1(method_t method)
     set_default_protocol_function(simgrid::kernel::lmm::func_reno_f, simgrid::kernel::lmm::func_reno_fpi,
                                   simgrid::kernel::lmm::func_reno_fpi);
 
-  lmm_system_t Sys    = new simgrid::kernel::lmm::System(true);
+  simgrid::kernel::lmm::System* Sys    = new simgrid::kernel::lmm::System(true);
   simgrid::kernel::lmm::Constraint* L1 = Sys->constraint_new(nullptr, a);
   simgrid::kernel::lmm::Constraint* L2 = Sys->constraint_new(nullptr, b);
   simgrid::kernel::lmm::Constraint* L3 = Sys->constraint_new(nullptr, a);
@@ -186,7 +185,7 @@ static void test2(method_t method)
     set_default_protocol_function(simgrid::kernel::lmm::func_reno_f, simgrid::kernel::lmm::func_reno_fp,
                                   simgrid::kernel::lmm::func_reno_fpi);
 
-  lmm_system_t Sys      = new simgrid::kernel::lmm::System(true);
+  simgrid::kernel::lmm::System* Sys      = new simgrid::kernel::lmm::System(true);
   simgrid::kernel::lmm::Constraint* CPU1 = Sys->constraint_new(nullptr, 200.0);
   simgrid::kernel::lmm::Constraint* CPU2 = Sys->constraint_new(nullptr, 100.0);
 
@@ -259,7 +258,7 @@ static void test3(method_t method)
     set_default_protocol_function(simgrid::kernel::lmm::func_reno_f, simgrid::kernel::lmm::func_reno_fp,
                                   simgrid::kernel::lmm::func_reno_fpi);
 
-  lmm_system_t Sys = new simgrid::kernel::lmm::System(true);
+  simgrid::kernel::lmm::System* Sys = new simgrid::kernel::lmm::System(true);
 
   /* Creates the constraints */
   simgrid::kernel::lmm::Constraint** tmp_cnst = new simgrid::kernel::lmm::Constraint*[15];
index 1082238..2b22d14 100644 (file)
@@ -44,7 +44,7 @@ static void test(int nb_cnst, int nb_var, int nb_elem, unsigned int pw_base_limi
   simgrid::kernel::lmm::Variable* var[nb_var];
   int used[nb_cnst];
 
-  lmm_system_t Sys = new simgrid::kernel::lmm::System(true);
+  simgrid::kernel::lmm::System* Sys = new simgrid::kernel::lmm::System(true);
 
   for (int i = 0; i < nb_cnst; i++) {
     cnst[i] = Sys->constraint_new(NULL, float_random(10.0));