X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/ae855a0d996d06d373fbc233e78b0fbe7f1f2df6..125ba3dea38f9b31330b322f9bc59fdd428821ae:/src/simdag/sd_global.c diff --git a/src/simdag/sd_global.c b/src/simdag/sd_global.c index c24ce295be..344ec2aef2 100644 --- a/src/simdag/sd_global.c +++ b/src/simdag/sd_global.c @@ -13,6 +13,7 @@ #include "xbt/str.h" #include "xbt/config.h" #include "instr/instr_private.h" +#include "surf/surfxml_parse.h" #ifdef HAVE_LUA #include #include @@ -170,11 +171,13 @@ void SD_create_environment(const char *platform_file) void *surf_workstation = NULL; void *surf_link = NULL; - SD_CHECK_INIT_DONE(); - - DEBUG0("SD_create_environment"); + platform_filename = bprintf("%s",platform_file); - surf_config_models_setup(platform_file); + // Reset callbacks + surf_parse_reset_callbacks(); + // Add config callbacks + surf_parse_add_callback_config(); + SD_CHECK_INIT_DONE(); parse_platform_file(platform_file); surf_config_models_create_elms(); @@ -191,10 +194,6 @@ void SD_create_environment(const char *platform_file) DEBUG2("Workstation number: %d, link number: %d", SD_workstation_get_number(), SD_link_get_number()); - -#ifdef HAVE_TRACING - TRACE_surf_save_onelink(); -#endif } /** @@ -410,15 +409,16 @@ void SD_exit(void) xbt_free(sd_global); sd_global = NULL; +#ifdef HAVE_TRACING + TRACE_end(); +#endif + DEBUG0("Exiting Surf..."); surf_exit(); } else { WARN0("SD_exit() called, but SimDag is not running"); /* we cannot use exceptions here because xbt is not running! */ } -#ifdef HAVE_TRACING - TRACE_end(); -#endif } /**