Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Reduce the amount of implicit include directories
[simgrid.git] / teshsuite / simdag / platforms / flatifier.c
index 0b735e4..3115c3f 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008-2013. The SimGrid Team.
+/* Copyright (c) 2008-2015. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
 #include <math.h>
 
 
-#include "simdag/simdag.h"
+#include "simgrid/simdag.h"
 #include "xbt/log.h"
 #include "xbt/dict.h"
 #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";
@@ -116,7 +116,7 @@ int main(int argc, char **argv)
   if (parse_cmdline(&timings, &downgrade, &platformFile, argc, argv) || !platformFile) {
     xbt_die("Invalid command line arguments: expected [--timings|--downgrade] platformFile");
   }
+
   XBT_DEBUG("%d,%d,%s", timings, downgrade, platformFile);
 
   if (downgrade) {
@@ -147,6 +147,9 @@ int main(int argc, char **argv)
           SD_workstation_get_name(hosts[i]),
           SD_workstation_get_power(hosts[i]));
       props = SD_workstation_get_properties(hosts[i]);
+      if (SD_workstation_get_cores(hosts[i])>1) {
+        printf(" core=\"%d\"", SD_workstation_get_cores(hosts[i]));
+      }
       if (props && !xbt_dict_is_empty(props)) {
         printf(">\n");
         xbt_dict_foreach(props, cursor, key, data) {
@@ -180,7 +183,7 @@ int main(int argc, char **argv)
           SD_link_get_name(links[i]),
           SD_link_get_current_bandwidth(links[i]),
           SD_link_get_current_latency(links[i]));
-      if (SD_link_get_sharing_policy(links[i]) == SD_LINK_SHARED) {
+      if (SD_link_is_shared(links[i])) {
         printf("/>\n");
       } else {
         printf(" sharing_policy=\"FATPIPE\"/>\n");
@@ -190,14 +193,14 @@ int main(int argc, char **argv)
 
     xbt_lib_foreach(host_lib, cursor_src, src, value1) // Routes from host
     {
-      value1 = xbt_lib_get_or_null(host_lib,src,ROUTING_HOST_LEVEL);
+      value1 = sg_host_edge(sg_host_by_name(src));
       xbt_lib_foreach(host_lib, cursor_dst, dst, value2) //to host
       {
         printf("  <route src=\"%s\" dst=\"%s\">\n  "
             ,src
             ,dst);
         xbt_dynar_t route=NULL;
-        value2 = xbt_lib_get_or_null(host_lib,dst,ROUTING_HOST_LEVEL);
+        value2 = sg_host_edge(sg_host_by_name(dst));
         routing_get_route_and_latency(value1,value2,&route,NULL);
         for(i=0;i<xbt_dynar_length(route) ;i++)
         {
@@ -260,7 +263,7 @@ int main(int argc, char **argv)
           printf("  <route src=\"%s\" dst=\"%s\">\n  "
               ,src, dst);
           xbt_dynar_t route=NULL;
-          value2 = xbt_lib_get_or_null(host_lib,dst,ROUTING_HOST_LEVEL);
+          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);
           for(i=0;i<xbt_dynar_length(route) ;i++)
           {