From aa4d38e3b08665ded92cafb9e3dd45af78491d5d Mon Sep 17 00:00:00 2001 From: Martin Quinson Date: Sun, 11 Dec 2016 21:07:06 +0100 Subject: [PATCH] cosmetics --- src/kernel/routing/AsCluster.cpp | 18 ++++++------------ src/kernel/routing/AsClusterDragonfly.cpp | 1 - src/kernel/routing/AsClusterFatTree.cpp | 3 --- src/kernel/routing/AsClusterFatTree.hpp | 2 +- src/kernel/routing/AsClusterTorus.cpp | 1 - src/surf/network_ib.cpp | 2 -- src/surf/network_smpi.cpp | 8 -------- 7 files changed, 7 insertions(+), 28 deletions(-) diff --git a/src/kernel/routing/AsCluster.cpp b/src/kernel/routing/AsCluster.cpp index 95805fc2f8..6170c5949f 100644 --- a/src/kernel/routing/AsCluster.cpp +++ b/src/kernel/routing/AsCluster.cpp @@ -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 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 info = privateLinks_.at(src->id()); if (info.first) { // link up - const char* link_name = static_cast(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(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_) { diff --git a/src/kernel/routing/AsClusterDragonfly.cpp b/src/kernel/routing/AsClusterDragonfly.cpp index 355c17d35e..11cbc8baf9 100644 --- a/src/kernel/routing/AsClusterDragonfly.cpp +++ b/src/kernel/routing/AsClusterDragonfly.cpp @@ -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 #include diff --git a/src/kernel/routing/AsClusterFatTree.cpp b/src/kernel/routing/AsClusterFatTree.cpp index d8d19e0794..47db2c398b 100644 --- a/src/kernel/routing/AsClusterFatTree.cpp +++ b/src/kernel/routing/AsClusterFatTree.cpp @@ -15,9 +15,6 @@ #include #include -#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 { diff --git a/src/kernel/routing/AsClusterFatTree.hpp b/src/kernel/routing/AsClusterFatTree.hpp index 8f37d0de5b..37690befde 100644 --- a/src/kernel/routing/AsClusterFatTree.hpp +++ b/src/kernel/routing/AsClusterFatTree.hpp @@ -134,7 +134,7 @@ private: std::vector links_; std::vector 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); diff --git a/src/kernel/routing/AsClusterTorus.cpp b/src/kernel/routing/AsClusterTorus.cpp index d3477eb13b..6053de1f4a 100644 --- a/src/kernel/routing/AsClusterTorus.cpp +++ b/src/kernel/routing/AsClusterTorus.cpp @@ -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"); diff --git a/src/surf/network_ib.cpp b/src/surf/network_ib.cpp index dce8789547..78a4a28549 100644 --- a/src/surf/network_ib.cpp +++ b/src/surf/network_ib.cpp @@ -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 { diff --git a/src/surf/network_smpi.cpp b/src/surf/network_smpi.cpp index 8dad6ebb06..dedd899ae5 100644 --- a/src/surf/network_smpi.cpp +++ b/src/surf/network_smpi.cpp @@ -20,14 +20,6 @@ std::vector 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 * *********/ -- 2.20.1