* 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>
//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]
*/
// 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,
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){
}
// Finalize AS
- surf_AS_finalize(p_as->id);
+ sg_platf_new_AS_close();
}
// add traces
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
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) {
}
/* </AS> */
// Finalize AS
- surf_AS_finalize(p_as->id);
+ sg_platf_new_AS_close();
}
// add traces
surf_wsL07_add_traces();