Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Rename RoutingEdge into NetCard
[simgrid.git] / teshsuite / simdag / platforms / flatifier.c
index 2fcac34..462f159 100644 (file)
@@ -21,7 +21,7 @@
 #include "xbt/ex.h"
 #include "xbt/xbt_os_time.h"
 #include "surf/surf.h"
-#include "surf/surf_private.h"
+#include "src/surf/surf_private.h"
 
 static const char link_ctn_v2[] =  "link:ctn";
 static const char link_ctn_v3[] = "link_ctn";
@@ -97,8 +97,8 @@ int main(int argc, char **argv)
   xbt_lib_cursor_t cursor_src = NULL;
   xbt_lib_cursor_t cursor_dst = NULL;
   char *src,*dst,*key,*data;
-  sg_routing_edge_t value1;
-  sg_routing_edge_t value2;
+  sg_netcard_t value1;
+  sg_netcard_t value2;
 
   const SD_workstation_t *hosts;
   const SD_link_t *links;
@@ -190,18 +190,18 @@ int main(int argc, char **argv)
       }
     }
 
-
-    xbt_lib_foreach(host_lib, cursor_src, src, value1) // Routes from host
+    sg_host_t host1, host2;
+    xbt_dict_foreach(host_list, cursor_src, src, host1) // Routes from host
     {
       value1 = sg_host_edge(sg_host_by_name(src));
-      xbt_lib_foreach(host_lib, cursor_dst, dst, value2) //to host
+      xbt_dict_foreach(host_list, cursor_dst, dst, host2) //to host
       {
         printf("  <route src=\"%s\" dst=\"%s\">\n  "
             ,src
             ,dst);
         xbt_dynar_t route=NULL;
         value2 = sg_host_edge(sg_host_by_name(dst));
-        routing_get_route_and_latency(value1,value2,&route,NULL);
+        routing_get_route_and_latency(value1, value2, &route,NULL);
         for(i=0;i<xbt_dynar_length(route) ;i++)
         {
           void *link = xbt_dynar_get_as(route,i,void *);
@@ -220,7 +220,7 @@ int main(int argc, char **argv)
               ,dst);
           xbt_dynar_t route=NULL;
           value2 = xbt_lib_get_or_null(as_router_lib,dst,ROUTING_ASR_LEVEL);
-          routing_get_route_and_latency((sg_routing_edge_t)value1,(sg_routing_edge_t)value2,&route,NULL);
+          routing_get_route_and_latency((sg_netcard_t)value1,(sg_netcard_t)value2,&route,NULL);
           for(i=0;i<xbt_dynar_length(route) ;i++)
           {
             void *link = xbt_dynar_get_as(route,i,void *);
@@ -246,7 +246,7 @@ int main(int argc, char **argv)
                 ,dst);
             xbt_dynar_t route=NULL;
             value2 = xbt_lib_get_or_null(as_router_lib,dst,ROUTING_ASR_LEVEL);
-            routing_get_route_and_latency((sg_routing_edge_t)value1,(sg_routing_edge_t)value2,&route,NULL);
+            routing_get_route_and_latency((sg_netcard_t)value1,(sg_netcard_t)value2,&route,NULL);
             for(i=0;i<xbt_dynar_length(route) ;i++)
             {
               void *link = xbt_dynar_get_as(route,i,void *);
@@ -258,13 +258,13 @@ int main(int argc, char **argv)
             printf("\n  </route>\n");
           }
           }
-        xbt_lib_foreach(host_lib, cursor_dst, dst, value2) //to host
+        xbt_dict_foreach(host_list, cursor_dst, dst, value2) //to host
         {
           printf("  <route src=\"%s\" dst=\"%s\">\n  "
               ,src, dst);
           xbt_dynar_t route=NULL;
           value2 = sg_host_edge(sg_host_by_name(dst));
-          routing_get_route_and_latency((sg_routing_edge_t)value1,(sg_routing_edge_t)value2,&route, NULL);
+          routing_get_route_and_latency((sg_netcard_t)value1,(sg_netcard_t)value2,&route, NULL);
           for(i=0;i<xbt_dynar_length(route) ;i++)
           {
             void *link = xbt_dynar_get_as(route,i,void *);