X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/db5be29f73ecbdd4e645849a941ccdd387bd858f..d92bb5e90dbe8bd7eead32aba6941a4341fcf204:/src/bindings/lua/lua_platf.c diff --git a/src/bindings/lua/lua_platf.c b/src/bindings/lua/lua_platf.c index 581b06de68..2cd35f4f89 100644 --- a/src/bindings/lua/lua_platf.c +++ b/src/bindings/lua/lua_platf.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2010. The SimGrid Team. +/* Copyright (c) 2010, 2012-2014. The SimGrid Team. * All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it @@ -61,10 +61,12 @@ int console_close(lua_State *L) { /* Initialize MSG and WKS hosts */ XBT_DEBUG("Initialize MSG and WKS hosts"); xbt_lib_foreach(host_lib, cursor, name, data) { - if(data[SURF_WKS_LEVEL]){ + if(data[SURF_HOST_LEVEL]){ XBT_DEBUG("\tSee surf host %s",name); - SIMIX_host_create(name, data[SURF_WKS_LEVEL], NULL); - __MSG_host_create((smx_host_t)data[SIMIX_HOST_LEVEL]); + SIMIX_host_create(name); + // THIS IS BRAINDEAD. There is no sg_host_t in that level, but a smx_host_priv. So commenting out for now. + // Lua is broken anyway. Christian will fix it + // __MSG_host_create((sg_host_t)data[SIMIX_HOST_LEVEL]); } } @@ -92,7 +94,8 @@ int console_add_host(lua_State *L) { // get power value lua_pushstring(L, "power"); lua_gettable(L, -2); - host.power_peak = lua_tonumber(L, -1); + host.power_peak = xbt_dynar_new(sizeof(double), NULL); + xbt_dynar_push_as(host.power_peak, double, lua_tonumber(L, -1)); lua_pop(L, 1); // get core