Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Make cmd-line option "network/TCP-gamma" neat and clean
[simgrid.git] / src / surf / network_ib.cpp
index 6b98ff8..24258c5 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2014-2017. The SimGrid Team.
+/* Copyright (c) 2014-2018. The SimGrid Team.
 *All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -6,9 +6,9 @@
 
 #include <utility>
 
-#include "simgrid/sg_config.h"
+#include "simgrid/sg_config.hpp"
+#include "src/kernel/lmm/maxmin.hpp"
 #include "src/surf/HostImpl.hpp"
-#include "src/surf/maxmin_private.hpp"
 #include "src/surf/network_ib.hpp"
 #include "src/surf/xml/platf.hpp"
 #include <boost/algorithm/string/classification.hpp>
@@ -26,7 +26,7 @@ static void IB_create_host_callback(simgrid::s4u::Host& host){
   IBNode* act = new IBNode(id);
 
   id++;
-  ((NetworkIBModel*)surf_network_model)->active_nodes.insert({host.getName(), act});
+  ((NetworkIBModel*)surf_network_model)->active_nodes.insert({host.get_name(), act});
 }
 
 static void IB_action_state_changed_callback(simgrid::surf::NetworkAction* action)
@@ -34,7 +34,7 @@ static void IB_action_state_changed_callback(simgrid::surf::NetworkAction* actio
   using simgrid::surf::NetworkIBModel;
   using simgrid::surf::IBNode;
 
-  if (action->getState() != simgrid::surf::Action::State::done)
+  if (action->get_state() != simgrid::kernel::resource::Action::State::done)
     return;
   std::pair<IBNode*,IBNode*> pair = ((NetworkIBModel*)surf_network_model)->active_comms[action];
   XBT_DEBUG("IB callback - action %p finished", action);
@@ -52,18 +52,18 @@ static void IB_action_init_callback(simgrid::surf::NetworkAction* action, simgri
   simgrid::surf::IBNode* act_src;
   simgrid::surf::IBNode* act_dst;
 
-  auto asrc = ibModel->active_nodes.find(src->getName());
+  auto asrc = ibModel->active_nodes.find(src->get_name());
   if (asrc != ibModel->active_nodes.end()) {
     act_src = asrc->second;
   } else {
-    throw std::out_of_range(std::string("Could not find '") + src->getCname() + "' active comms !");
+    throw std::out_of_range(std::string("Could not find '") + src->get_cname() + "' active comms !");
   }
 
-  auto adst = ibModel->active_nodes.find(dst->getName());
+  auto adst = ibModel->active_nodes.find(dst->get_name());
   if (adst != ibModel->active_nodes.end()) {
     act_dst = adst->second;
   } else {
-    throw std::out_of_range(std::string("Could not find '") + dst->getCname() + "' active comms !");
+    throw std::out_of_range(std::string("Could not find '") + dst->get_cname() + "' active comms !");
   }
 
   ibModel->active_comms[action]=std::make_pair(act_src, act_dst);
@@ -164,7 +164,7 @@ void NetworkIBModel::computeIBfactors(IBNode* root)
 
     double penalty = std::max(my_penalty_in, max_penalty_out);
 
-    double rate_before_update = (*it)->action->getBound();
+    double rate_before_update = (*it)->action->get_bound();
     // save initial rate of the action
     if ((*it)->init_rate == -1)
       (*it)->init_rate = rate_before_update;
@@ -173,8 +173,8 @@ void NetworkIBModel::computeIBfactors(IBNode* root)
 
     if (not double_equals(penalized_bw, rate_before_update, sg_surf_precision)) {
       XBT_DEBUG("%d->%d action %p penalty updated : bw now %f, before %f , initial rate %f", root->id,
-                (*it)->destination->id, (*it)->action, penalized_bw, (*it)->action->getBound(), (*it)->init_rate);
-      maxminSystem_->update_variable_bound((*it)->action->getVariable(), penalized_bw);
+                (*it)->destination->id, (*it)->action, penalized_bw, (*it)->action->get_bound(), (*it)->init_rate);
+      get_maxmin_system()->update_variable_bound((*it)->action->get_variable(), penalized_bw);
     } else {
       XBT_DEBUG("%d->%d action %p penalty not updated : bw %f, initial rate %f", root->id, (*it)->destination->id,
                 (*it)->action, penalized_bw, (*it)->init_rate);