Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
obey our naming conventions
[simgrid.git] / src / surf / network_ib.cpp
index dce8789..64e9649 100644 (file)
@@ -6,11 +6,11 @@
 
 #include <utility>
 
-#include "network_ib.hpp"
-
-#include "src/surf/HostImpl.hpp"
 #include "simgrid/sg_config.h"
-#include "maxmin_private.hpp"
+#include "src/surf/HostImpl.hpp"
+#include "src/surf/maxmin_private.hpp"
+#include "src/surf/network_ib.hpp"
+#include "src/surf/xml/platf.hpp"
 
 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(surf_network);
 
@@ -26,9 +26,7 @@ static void IB_create_host_callback(simgrid::s4u::Host& host){
   IBNode* act = new IBNode(id);
 
   id++;
-  xbt_dict_set(((NetworkIBModel*)surf_network_model)->active_nodes,
-      host.name().c_str(), act, nullptr);
-
+  xbt_dict_set(((NetworkIBModel*)surf_network_model)->active_nodes, host.cname(), act, nullptr);
 }
 
 static void IB_action_state_changed_callback(
@@ -54,12 +52,10 @@ static void IB_action_init_callback(simgrid::surf::NetworkAction* action, simgri
 {
   simgrid::surf::NetworkIBModel* ibModel = (simgrid::surf::NetworkIBModel*)surf_network_model;
 
-  simgrid::surf::IBNode* act_src =
-      (simgrid::surf::IBNode*)xbt_dict_get_or_null(ibModel->active_nodes, src->name().c_str());
+  simgrid::surf::IBNode* act_src = (simgrid::surf::IBNode*)xbt_dict_get_or_null(ibModel->active_nodes, src->cname());
   xbt_assert(act_src, "could not find src node active comms !");
 
-  simgrid::surf::IBNode* act_dst =
-      (simgrid::surf::IBNode*)xbt_dict_get_or_null(ibModel->active_nodes, dst->name().c_str());
+  simgrid::surf::IBNode* act_dst = (simgrid::surf::IBNode*)xbt_dict_get_or_null(ibModel->active_nodes, dst->cname());
   xbt_assert(act_dst, "could not find dst node active comms !");
 
   ibModel->active_comms[action]=std::make_pair(act_src, act_dst);
@@ -91,14 +87,12 @@ void surf_network_model_init_IB()
   surf_network_model = new simgrid::surf::NetworkIBModel();
   all_existing_models->push_back(surf_network_model);
   networkActionStateChangedCallbacks.connect(IB_action_state_changed_callback);
-  Link::onCommunicate.connect(IB_action_init_callback);
+  simgrid::surf::LinkImpl::onCommunicate.connect(IB_action_init_callback);
   simgrid::s4u::Host::onCreation.connect(IB_create_host_callback);
   xbt_cfg_setdefault_double("network/weight-S", 8775);
 
 }
 
-#include "src/surf/xml/platf.hpp" // FIXME: move that back to the parsing area
-
 namespace simgrid {
   namespace surf {