Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
cosmetics
authorMartin Quinson <martin.quinson@loria.fr>
Sun, 11 Dec 2016 20:07:06 +0000 (21:07 +0100)
committerMartin Quinson <martin.quinson@loria.fr>
Sun, 11 Dec 2016 20:07:06 +0000 (21:07 +0100)
src/kernel/routing/AsCluster.cpp
src/kernel/routing/AsClusterDragonfly.cpp
src/kernel/routing/AsClusterFatTree.cpp
src/kernel/routing/AsClusterFatTree.hpp
src/kernel/routing/AsClusterTorus.cpp
src/surf/network_ib.cpp
src/surf/network_smpi.cpp

index 95805fc..6170c59 100644 (file)
@@ -73,30 +73,25 @@ void AsCluster::getLocalRoute(NetCard* src, NetCard* dst, sg_platf_route_cbarg_t
 
 void AsCluster::getGraph(xbt_graph_t graph, xbt_dict_t nodes, xbt_dict_t edges)
 {
-  xbt_node_t current, previous, backboneNode = nullptr;
-  std::pair<Link*, Link*> info;
-
   xbt_assert(router_,"Malformed cluster. This may be because your platform file is a hypergraph while it must be a graph.");
 
   /* create the router */
   xbt_node_t routerNode = new_xbt_graph_node(graph, router_->cname(), nodes);
 
+  xbt_node_t backboneNode = nullptr;
   if(backbone_) {
-    const char *link_nameR = backbone_->getName();
-    backboneNode = new_xbt_graph_node(graph, link_nameR, nodes);
-
+    backboneNode = new_xbt_graph_node(graph, backbone_->getName(), nodes);
     new_xbt_graph_edge(graph, routerNode, backboneNode, edges);
   }
 
   for (auto src: vertices_){
     if (! src->isRouter()) {
-      previous = new_xbt_graph_node(graph, src->cname(), nodes);
+      xbt_node_t previous = new_xbt_graph_node(graph, src->cname(), nodes);
 
-      info = privateLinks_.at(src->id());
+      std::pair<Link*, Link*> info = privateLinks_.at(src->id());
 
       if (info.first) { // link up
-        const char* link_name = static_cast<simgrid::surf::Resource*>(info.first)->getName();
-        current = new_xbt_graph_node(graph, link_name, nodes);
+        xbt_node_t current = new_xbt_graph_node(graph, info.first->getName(), nodes);
         new_xbt_graph_edge(graph, previous, current, edges);
 
         if (backbone_) {
@@ -107,8 +102,7 @@ void AsCluster::getGraph(xbt_graph_t graph, xbt_dict_t nodes, xbt_dict_t edges)
       }
 
       if (info.second) { // link down
-        const char* link_name = static_cast<simgrid::surf::Resource*>(info.second)->getName();
-        current = new_xbt_graph_node(graph, link_name, nodes);
+        xbt_node_t current = new_xbt_graph_node(graph, info.second->getName(), nodes);
         new_xbt_graph_edge(graph, previous, current, edges);
 
         if (backbone_) {
index 355c17d..11cbc8b 100644 (file)
@@ -6,7 +6,6 @@
 #include "src/kernel/routing/AsClusterDragonfly.hpp"
 #include "src/kernel/routing/NetCard.hpp"
 #include "src/surf/network_interface.hpp"
-#include "src/surf/xml/platf.hpp" // FIXME: move that back to the parsing area
 
 #include <boost/algorithm/string/split.hpp>
 #include <boost/algorithm/string/classification.hpp>
index d8d19e0..47db2c3 100644 (file)
@@ -15,9 +15,6 @@
 #include <boost/algorithm/string/split.hpp>
 #include <boost/algorithm/string/classification.hpp>
 
-#include "src/surf/xml/platf.hpp" // FIXME: move that back to the parsing area
-
-
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_route_fat_tree, surf, "Routing for fat trees");
 
 namespace simgrid {
index 8f37d0d..37690be 100644 (file)
@@ -134,7 +134,7 @@ private:
   std::vector<FatTreeLink*> links_;
   std::vector<unsigned int> nodesByLevel_;
 
-  sg_platf_cluster_cbarg_t cluster_;
+  sg_platf_cluster_cbarg_t cluster_ = nullptr;
 
   void addLink(FatTreeNode *parent, unsigned int parentPort,
                FatTreeNode *child, unsigned int childPort);
index d3477eb..6053de1 100644 (file)
@@ -7,7 +7,6 @@
 #include "src/kernel/routing/NetCard.hpp"
 
 #include "src/surf/network_interface.hpp"
-#include "src/surf/xml/platf.hpp" // FIXME: move that back to the parsing area
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_route_cluster_torus, surf_route_cluster, "Torus Routing part of surf");
 
index dce8789..78a4a28 100644 (file)
@@ -97,8 +97,6 @@ void surf_network_model_init_IB()
 
 }
 
-#include "src/surf/xml/platf.hpp" // FIXME: move that back to the parsing area
-
 namespace simgrid {
   namespace surf {
 
index 8dad6eb..dedd899 100644 (file)
@@ -20,14 +20,6 @@ std::vector<s_smpi_factor_t> smpi_lat_factor;
 
 xbt_dict_t gap_lookup = nullptr;
 
-static int factor_cmp(const void *pa, const void *pb)
-{
-  return (((s_smpi_factor_t*)pa)->factor > ((s_smpi_factor_t*)pb)->factor) ? 1 :
-      (((s_smpi_factor_t*)pa)->factor < ((s_smpi_factor_t*)pb)->factor) ? -1 : 0;
-}
-
-#include "src/surf/xml/platf.hpp" // FIXME: move that back to the parsing area
-
 /*********
  * Model *
  *********/