Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Network::shareResourcesFull revival
authorPaul Bédaride <paul.bedaride@gmail.com>
Wed, 11 Jun 2014 13:26:45 +0000 (15:26 +0200)
committerPaul Bédaride <paul.bedaride@gmail.com>
Wed, 11 Jun 2014 13:27:12 +0000 (15:27 +0200)
src/surf/network_interface.cpp
src/surf/network_interface.hpp
src/surf/network_smpi.cpp

index 4694f9d..63f1356 100644 (file)
@@ -77,6 +77,34 @@ double NetworkModel::bandwidthConstraint(double rate, double /*bound*/, double /
   return rate;
 }
 
   return rate;
 }
 
+double NetworkModel::shareResourcesFull(double now)
+{
+  NetworkActionPtr action = NULL;
+  ActionListPtr runningActions = surf_network_model->getRunningActionSet();
+  double minRes;
+
+  minRes = shareResourcesMaxMin(runningActions, surf_network_model->p_maxminSystem, surf_network_model->f_networkSolve);
+
+  for(ActionList::iterator it(runningActions->begin()), itend(runningActions->end())
+       ; it != itend ; ++it) {
+      action = static_cast<NetworkActionPtr>(&*it);
+#ifdef HAVE_LATENCY_BOUND_TRACKING
+    if (lmm_is_variable_limited_by_latency(action->getVariable())) {
+      action->m_latencyLimited = 1;
+    } else {
+      action->m_latencyLimited = 0;
+    }
+#endif
+    if (action->m_latency > 0) {
+      minRes = (minRes < 0) ? action->m_latency : min(minRes, action->m_latency);
+    }
+  }
+
+  XBT_DEBUG("Min of share resources %f", minRes);
+
+  return minRes;
+}
+
 /************
  * Resource *
  ************/
 /************
  * Resource *
  ************/
index 3c20de2..770acf8 100644 (file)
@@ -10,7 +10,6 @@
 #ifndef SURF_NETWORK_INTERFACE_HPP_
 #define SURF_NETWORK_INTERFACE_HPP_
 
 #ifndef SURF_NETWORK_INTERFACE_HPP_
 #define SURF_NETWORK_INTERFACE_HPP_
 
-
 /***********
  * Classes *
  ***********/
 /***********
  * Classes *
  ***********/
@@ -77,6 +76,7 @@ public:
    * @brief NetworkModel constructor
    */
   NetworkModel() : Model("network") {
    * @brief NetworkModel constructor
    */
   NetworkModel() : Model("network") {
+    f_networkSolve = lmm_solve;
   };
 
   /**
   };
 
   /**
@@ -181,6 +181,7 @@ public:
    * @return The new bandwidth.
    */
   virtual double bandwidthConstraint(double rate, double bound, double size);
    * @return The new bandwidth.
    */
   virtual double bandwidthConstraint(double rate, double bound, double size);
+  double shareResourcesFull(double now);
   bool m_haveGap;
 };
 
   bool m_haveGap;
 };
 
index 68174da..e5967be 100644 (file)
@@ -80,7 +80,6 @@ void surf_network_model_init_SMPI(void)
   surf_network_model = new NetworkSmpiModel();
   net_define_callbacks();
   xbt_dynar_push(model_list, &surf_network_model);
   surf_network_model = new NetworkSmpiModel();
   net_define_callbacks();
   xbt_dynar_push(model_list, &surf_network_model);
-  //network_solve = lmm_solve;
 
   xbt_cfg_setdefault_double(_sg_cfg_set, "network/sender_gap", 10e-6);
   xbt_cfg_setdefault_double(_sg_cfg_set, "network/weight_S", 8775);
 
   xbt_cfg_setdefault_double(_sg_cfg_set, "network/sender_gap", 10e-6);
   xbt_cfg_setdefault_double(_sg_cfg_set, "network/weight_S", 8775);