Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[Bugfix] Fixed wrong property in SimSplay test: latency<->lat
authorChristian Heinrich <franz-christian.heinrich@inria.fr>
Mon, 8 Jun 2015 21:07:48 +0000 (23:07 +0200)
committerChristian Heinrich <franz-christian.heinrich@inria.fr>
Thu, 15 Oct 2015 17:17:17 +0000 (19:17 +0200)
examples/lua/SimSplay/platform_script.lua
src/bindings/lua/lua_comm.c

index 1226288..eaf04be 100644 (file)
@@ -20,7 +20,7 @@ require "simgrid"
   simgrid.host.setProperty{host="Fafard",prop_id="port",prop_value="76"};
     -- create Links
   for i=10,0,-1 do
-    simgrid.AS.addLink{AS="AS0",id=i,bandwidth=252750+ i*768,latency=0.000270544+i*0.087};   
+    simgrid.AS.addLink{AS="AS0",id=i,bandwidth=252750+ i*768,lat=0.000270544+i*0.087};   
   end
   -- simgrid.route.new(src_id,des_id,links_nb,links_list)
    simgrid.AS.addRoute("AS0","Tremblay","Jupiter",{"1"});
index 5e761e6..06fb601 100644 (file)
@@ -181,8 +181,6 @@ void sglua_register_comm_functions(lua_State* L)
   /* create a table simgrid.comm and fill it with com functions */
   lua_getglobal(L, "simgrid");    /* simgrid */
   luaL_newlib(L, comm_functions); /* simgrid simgrid.comm */
-  lua_setfield(L, -2, "comm");    /* simgrid */
-  lua_getfield(L, -1, "host");    /* simgrid simgrid.comm */
 
   /* create the metatable for comm, add it to the Lua registry */
   luaL_newmetatable(L, COMM_MODULE_NAME); /* simgrid simgrid.comm mt */
@@ -194,7 +192,7 @@ void sglua_register_comm_functions(lua_State* L)
    * Copy the table and push it onto the stack.
    * Required for the lua_setfield call below.
    */
-  lua_getfield(L, -3, "comm");                   /* simgrid simgrid.comm mt simgrid.comm */
+  lua_pushvalue(L, -2);            /* simgrid simgrid.comm mt simgrid.comm */
 
   /* metatable.__index = simgrid.comm
    * we put the comm functions inside the comm userdata itself:
@@ -203,6 +201,7 @@ void sglua_register_comm_functions(lua_State* L)
   lua_setfield(L, -2, "__index");         /* simgrid simgrid.comm mt */
 
   lua_setmetatable(L, -2);                /* simgrid simgrid.comm */
-  lua_pop(L, 2);                          /* -- */
+  lua_setfield(L, -1, "comm");            /* simgrid */
+  lua_pop(L, 1);                          /* -- */
 }