X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/15142e98775405b23e3059da088d4aeecb906b78..56c7548bb53f2f0a0b7d07c722ab207e28febe46:/src/simix/smx_deployment.c diff --git a/src/simix/smx_deployment.c b/src/simix/smx_deployment.c index 87d3f6151a..c1f8dd5158 100644 --- a/src/simix/smx_deployment.c +++ b/src/simix/smx_deployment.c @@ -22,10 +22,10 @@ static double kill_time = -1.0; static void parse_process_init(void) { parse_host = xbt_strdup(A_surfxml_process_host); - xbt_assert1(SIMIX_host_get_by_name(parse_host), + xbt_assert(SIMIX_host_get_by_name(parse_host), "Host '%s' unknown", parse_host); parse_code = SIMIX_get_registered_function(A_surfxml_process_function); - xbt_assert1(parse_code, "Function '%s' unknown", + xbt_assert(parse_code, "Function '%s' unknown", A_surfxml_process_function); parse_argc = 0; parse_argv = NULL; @@ -34,8 +34,6 @@ static void parse_process_init(void) parse_argv[(parse_argc) - 1] = xbt_strdup(A_surfxml_process_function); surf_parse_get_double(&start_time, A_surfxml_process_start_time); surf_parse_get_double(&kill_time, A_surfxml_process_kill_time); - - current_property_set = xbt_dict_new(); } static void parse_argument(void) @@ -88,6 +86,7 @@ static void parse_process_finalize(void) } xbt_free(parse_host); } + current_property_set = NULL; } /** @@ -107,7 +106,7 @@ static void parse_process_finalize(void) void SIMIX_launch_application(const char *file) { int parse_status; - xbt_assert0(simix_global, + xbt_assert(simix_global, "SIMIX_global_init has to be called before SIMIX_launch_application."); // Reset callbacks @@ -115,14 +114,14 @@ void SIMIX_launch_application(const char *file) surfxml_add_callback(STag_surfxml_process_cb_list, parse_process_init); surfxml_add_callback(ETag_surfxml_argument_cb_list, parse_argument); - surfxml_add_callback(STag_surfxml_prop_cb_list, parse_properties); + surfxml_add_callback(STag_surfxml_prop_cb_list, parse_properties_XML); surfxml_add_callback(ETag_surfxml_process_cb_list, parse_process_finalize); surf_parse_open(file); parse_status = surf_parse(); surf_parse_close(); - xbt_assert1(!parse_status, "Parse error in %s", file); + xbt_assert(!parse_status, "Parse error in %s", file); } /** @@ -136,7 +135,7 @@ void SIMIX_launch_application(const char *file) XBT_INLINE void SIMIX_function_register(const char *name, xbt_main_func_t code) { - xbt_assert0(simix_global, + xbt_assert(simix_global, "SIMIX_global_init has to be called before SIMIX_function_register."); xbt_dict_set(simix_global->registered_functions, name, code, NULL); @@ -151,7 +150,7 @@ static xbt_main_func_t default_function = NULL; */ void SIMIX_function_register_default(xbt_main_func_t code) { - xbt_assert0(simix_global, + xbt_assert(simix_global, "SIMIX_global_init has to be called before SIMIX_function_register."); default_function = code; @@ -168,7 +167,7 @@ void SIMIX_function_register_default(xbt_main_func_t code) xbt_main_func_t SIMIX_get_registered_function(const char *name) { xbt_main_func_t res = NULL; - xbt_assert0(simix_global, + xbt_assert(simix_global, "SIMIX_global_init has to be called before SIMIX_get_registered_function."); res = xbt_dict_get_or_null(simix_global->registered_functions, name); @@ -191,10 +190,10 @@ void SIMIX_process_set_function(const char *process_host, /* init process */ parse_host = xbt_strdup(process_host); - xbt_assert1(SIMIX_host_get_by_name(parse_host), + xbt_assert(SIMIX_host_get_by_name(parse_host), "Host '%s' unknown", parse_host); parse_code = SIMIX_get_registered_function(process_function); - xbt_assert1(parse_code, "Function '%s' unknown", process_function); + xbt_assert(parse_code, "Function '%s' unknown", process_function); parse_argc = 0; parse_argv = NULL; @@ -203,7 +202,6 @@ void SIMIX_process_set_function(const char *process_host, parse_argv[(parse_argc) - 1] = xbt_strdup(process_function); start_time = process_start_time; kill_time = process_kill_time; - current_property_set = xbt_dict_new(); /* add arguments */ xbt_dynar_foreach(arguments, i, arg) {