Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Kill some further empty function chaining.
[simgrid.git] / src / bindings / lua / lua_console.c
index eeda51d..e467d34 100644 (file)
@@ -7,6 +7,7 @@
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
 #include "simgrid_lua.h"
+#include "simgrid/platf.h"
 #include <string.h>
 #include <ctype.h>
 
@@ -16,15 +17,6 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(lua_console, bindings, "Lua Bindings");
 //AS List
 static xbt_dynar_t as_list_d;
 
-/*
- * Initialize platform model routing
- */
-
-static void create_AS(const char *id, const char *mode)
-{
-  surf_AS_new(id, mode);
-}
-
 /**
  * create host resource via CPU model [for MSG]
  */
@@ -707,7 +699,7 @@ static int surf_parse_bypass_platform()
   // Add AS
   xbt_dynar_foreach(as_list_d, i,p_as)
   {
-         create_AS(p_as->id, p_as->mode);
+    sg_platf_new_AS_open(p_as->id,p_as->mode);
          // add associated Hosts
          xbt_dynar_foreach(p_as->host_list_d, j, p_host){
                  create_host(p_host->id, p_host->power_peak, p_host->power_scale,
@@ -715,8 +707,7 @@ static int surf_parse_bypass_platform()
                                  p_host->state_trace, p_host->properties);
 
 
-                  //add to routing model host list
-                  surf_route_add_host((char *) p_host->id);
+                  //FIXME: should use sg_platf instead. That would add to routing model host list, amongst other benefits
          }
          // add associated Links
          xbt_dynar_foreach(p_as->link_list_d, j, p_link){
@@ -732,7 +723,7 @@ static int surf_parse_bypass_platform()
          }
 
          // Finalize AS
-         surf_AS_finalize(p_as->id);
+         sg_platf_new_AS_close();
   }
 
   // add traces
@@ -760,7 +751,7 @@ static int surf_wsL07_parse_bypass_platform()
   xbt_dynar_foreach(as_list_d, i, p_as)
   {
          // Init AS
-         create_AS(p_as->id, p_as->mode);
+    sg_platf_new_AS_open(p_as->id,p_as->mode);
 
          // add Sub AS
 
@@ -773,7 +764,6 @@ static int surf_wsL07_parse_bypass_platform()
                              p_host->power_trace, p_host->state_initial,
                              p_host->state_trace);
            //add to routing model host list
-           surf_route_add_host((char *) p_host->id);
          }
          //add Links
          xbt_dynar_foreach(p_as->link_list_d, j, p_link) {
@@ -789,7 +779,7 @@ static int surf_wsL07_parse_bypass_platform()
              }
          /* </AS> */
          // Finalize AS
-         surf_AS_finalize(p_as->id);
+         sg_platf_new_AS_close();
   }
   // add traces
   surf_wsL07_add_traces();