Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[doc] Add todo about user .then()
[simgrid.git] / src / surf / AsCluster.cpp
index 53b8882..100ff55 100644 (file)
@@ -12,7 +12,7 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_route_cluster, surf, "Routing part of surf"
  * Note that a router is created, easing the interconnexion with the rest of the world. */
 
 namespace simgrid {
-namespace surf {
+namespace routing {
   AsCluster::AsCluster(const char*name)
     : AsImpl(name)
   {}
@@ -26,7 +26,7 @@ void AsCluster::getRouteAndLatency(NetCard *src, NetCard *dst, sg_platf_route_cb
   s_surf_parsing_link_up_down_t info;
   XBT_VERB("cluster_get_route_and_latency from '%s'[%d] to '%s'[%d]",
             src->name(), src->id(), dst->name(), dst->id());
-
+  xbt_assert(!xbt_dynar_is_empty(privateLinks_), "Cluster routing : no links attached to the source node - did you use host_link tag?");
   if (! src->isRouter()) {    // No specific link for router
 
     if((src->id() == dst->id()) && hasLoopback_ ){
@@ -79,7 +79,7 @@ void AsCluster::getGraph(xbt_graph_t graph, xbt_dict_t nodes, xbt_dict_t edges)
   int table_size = xbt_dynar_length(vertices_);
 
   NetCard *src;
-  xbt_node_t current, previous, backboneNode = NULL, routerNode;
+  xbt_node_t current, previous, backboneNode = nullptr, routerNode;
   s_surf_parsing_link_up_down_t info;
 
   xbt_assert(router_,"Malformed cluster. This may be because your platform file is a hypergraph while it must be a graph.");