#include "portable.h"
#include "xbt/config.h"
#include "surf/datatypes.h"
+#include "xbt/lib.h"
+
+xbt_lib_t host_lib;
+int ROUTING_HOST_LEVEL; //Routing level
+int SURF_CPU_LEVEL; //Surf cpu level
+int SURF_WKS_LEVEL; //Surf workstation level
+int SIMIX_HOST_LEVEL; //Simix level
+int MSG_HOST_LEVEL; //Msg level
+int SD_HOST_LEVEL; //Simdag level
+int COORD_HOST_LEVEL; //Coordinates level
+
+xbt_lib_t link_lib;
+int SD_LINK_LEVEL; //Simdag level
+int SURF_LINK_LEVEL; //Surf level
+
+xbt_lib_t as_router_lib;
+int ROUTING_ASR_LEVEL; //Routing level
+int COORD_ASR_LEVEL; //Coordinates level
SG_BEGIN_DECL()
/* Actions and models are highly connected structures... */
void surf_init(int *argc, char **argv)
{
+ XBT_DEBUG("Create all Libs");
+ host_lib = xbt_lib_new();
+ link_lib = xbt_lib_new();
+ as_router_lib = xbt_lib_new();
+
+ XBT_DEBUG("ADD ROUTING LEVEL");
+ ROUTING_HOST_LEVEL = xbt_lib_add_level(host_lib,free);
+ ROUTING_ASR_LEVEL = xbt_lib_add_level(as_router_lib,free);
+
+ XBT_DEBUG("ADD SURF LEVELS");
+ SURF_CPU_LEVEL = xbt_lib_add_level(host_lib,free);
+ SURF_WKS_LEVEL = xbt_lib_add_level(host_lib,free);
+ SURF_LINK_LEVEL = xbt_lib_add_level(link_lib,free);
+
+ XBT_DEBUG("ADD COORD LEVEL");
+ COORD_HOST_LEVEL = xbt_lib_add_level(host_lib,free);
+ COORD_ASR_LEVEL = xbt_lib_add_level(as_router_lib,free);
+
/* Connect our log channels: that must be done manually under windows */
XBT_LOG_CONNECT(surf_cpu, surf);
XBT_LOG_CONNECT(surf_kernel, surf);
surf_parse_lex_destroy();
surf_parse_free_callbacks();
NOW = 0; /* Just in case the user plans to restart the simulation afterward */
+ // Exit the LIB host_lib
+ xbt_lib_free(&host_lib);
+ xbt_lib_free(&link_lib);
+ xbt_lib_free(&as_router_lib);
}
void surf_presolve(void)