Algorithmique Numérique Distribuée Public GIT Repository
 author Jonathan Rouzaud-Cornabas Thu, 14 Feb 2013 12:03:05 +0000 (13:03 +0100) committer Jonathan Rouzaud-Cornabas Thu, 14 Feb 2013 12:03:05 +0000 (13:03 +0100)
1  2
src/surf/surf_routing_cluster.c

@@@ -87,42 -87,138 +87,41 @@@ static void cluster_get_graph(xbt_graph
}

for (isrc = 0; isrc < table_size; isrc++) {
-         src = xbt_dynar_get_as(rc->index_network_elm, isrc, sg_routing_edge_t);
+     src = xbt_dynar_get_as(rc->index_network_elm, isrc, sg_routing_edge_t);

-         if (src->rc_type != SURF_NETWORK_ELEMENT_ROUTER) {
-                         previous = new_xbt_graph_node(graph, src->name, nodes);
+     if (src->rc_type != SURF_NETWORK_ELEMENT_ROUTER) {
+       previous = new_xbt_graph_node(graph, src->name, nodes);

-                                 current = new_xbt_graph_node(graph, link_name, nodes);
-                                 new_xbt_graph_edge(graph, previous, current, edges);
+         current = new_xbt_graph_node(graph, link_name, nodes);
+         new_xbt_graph_edge(graph, previous, current, edges);

-                                 if (((as_cluster_t) rc)->backbone) {
-                                         new_xbt_graph_edge(graph, current, backboneNode, edges);
-                                 } else {
-                                         new_xbt_graph_edge(graph, current, routerNode, edges);
-                                 }
+         if (((as_cluster_t) rc)->backbone) {
+           new_xbt_graph_edge(graph, current, backboneNode, edges);
+         } else {
+           new_xbt_graph_edge(graph, current, routerNode, edges);
+         }

-                         }
+       }

-                                 current = new_xbt_graph_node(graph, link_name, nodes);
-                                 new_xbt_graph_edge(graph, previous, current, edges);
+         current = new_xbt_graph_node(graph, link_name, nodes);
+         new_xbt_graph_edge(graph, previous, current, edges);

-                                 if (((as_cluster_t) rc)->backbone) {
-                                         new_xbt_graph_edge(graph, current, backboneNode, edges);
-                                 } else {
-                                         new_xbt_graph_edge(graph, current, routerNode, edges);
-                                 }
-                         }
-                 }
+         if (((as_cluster_t) rc)->backbone) {
+           new_xbt_graph_edge(graph, current, backboneNode, edges);
+         } else {
+           new_xbt_graph_edge(graph, current, routerNode, edges);
+         }
-
-      }
-/*
-      if (((as_cluster_t) rc)->backbone) {
-          ((surf_resource_t) ((as_cluster_t) rc)->backbone)->name;
-
-        current = new_xbt_graph_node(graph, link_name, nodes);
-        new_xbt_graph_edge(graph, previous, current, edges);
-        previous = current;
-
-        revCurrent = new_xbt_graph_node(graph, link_name, nodes);
-        new_xbt_graph_edge(graph, revCurrent, revPrevious, edges);
-        revPrevious = revCurrent;
-      } else {
-
-          current = new_xbt_graph_node(graph, link_name, nodes);
-          new_xbt_graph_edge(graph, previous, current, edges);
-          previous = current;
-          revCurrent = new_xbt_graph_node(graph, link_name, nodes);
-          new_xbt_graph_edge(graph, revCurrent, revPrevious, edges);
-          revPrevious = revCurrent;
-        }
-      }
-*/
+     }
}
-/*
-  if(rc->)
-    for (isrc = 0; isrc < table_size; isrc++) {
-      src = xbt_dynar_get_as(rc->index_network_elm, isrc, sg_routing_edge_t);
-
-      previous = new_xbt_graph_node(graph, src->name, nodes);
-      revPrevious = new_xbt_graph_node(graph, src->name, nodes);
-
-      for (idst = isrc + 1; idst < table_size; idst++) {
-        dst = xbt_dynar_get_as(rc->index_network_elm, idst, sg_routing_edge_t);
-
-
-        if (src->rc_type != SURF_NETWORK_ELEMENT_ROUTER) {        // No specific link for router
-          info =
-
-            current = new_xbt_graph_node(graph, link_name, nodes);
-            new_xbt_graph_edge(graph, previous, current, edges);
-            previous = current;
-            revCurrent = new_xbt_graph_node(graph, link_name, nodes);
-            new_xbt_graph_edge(graph, revCurrent, revPrevious, edges);
-            revPrevious = revCurrent;
-          }
-        }
-
-
-        if (((as_cluster_t) rc)->backbone) {
-            ((surf_resource_t) ((as_cluster_t) rc)->backbone)->name;
-
-          current = new_xbt_graph_node(graph, link_name, nodes);
-          new_xbt_graph_edge(graph, previous, current, edges);
-          previous = current;
-
-          revCurrent = new_xbt_graph_node(graph, link_name, nodes);
-          new_xbt_graph_edge(graph, revCurrent, revPrevious, edges);
-          revPrevious = revCurrent;
-        }
-
-        if (dst->rc_type != SURF_NETWORK_ELEMENT_ROUTER) {        // No specific link for router
-          info =
-
-            current = new_xbt_graph_node(graph, link_name, nodes);
-            new_xbt_graph_edge(graph, previous, current, edges);
-            previous = current;