X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/272ccad1b68b6d9c17069f3c934886925bb15b5d..6135d964e2f6309e0c3e1608c84faa8264553eba:/src/simix/smx_deployment.c diff --git a/src/simix/smx_deployment.c b/src/simix/smx_deployment.c index c7e943cf2b..6b176131c6 100644 --- a/src/simix/smx_deployment.c +++ b/src/simix/smx_deployment.c @@ -19,6 +19,8 @@ static char *parse_host = NULL; static double start_time = 0.0; static double kill_time = -1.0; +static int auto_restart = 0; + extern int surf_parse_lineno; static void parse_process_init(void) @@ -35,8 +37,8 @@ static void parse_process_init(void) parse_argc = 1; start_time = surf_parse_get_double(A_surfxml_process_start_time); kill_time = surf_parse_get_double(A_surfxml_process_kill_time); + auto_restart = A_surfxml_process_on_failure == A_surfxml_process_on_failure_DIE ? 0 : 1; } - static void parse_argument(void) { parse_argv = xbt_realloc(parse_argv, (parse_argc + 2) * sizeof(char *)); @@ -75,10 +77,11 @@ static void parse_process_finalize(void) kill_time, parse_argc, parse_argv, - current_property_set); + current_property_set, + auto_restart); else simcall_process_create(&process, parse_argv[0], parse_code, NULL, parse_host, kill_time, parse_argc, parse_argv, - current_property_set); + current_property_set,auto_restart); /* verify if process has been created (won't be the case if the host is currently dead, but that's fine) */ if (!process) { @@ -114,7 +117,6 @@ 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(ETag_surfxml_process_cb_list, parse_process_finalize); @@ -124,8 +126,9 @@ void SIMIX_launch_application(const char *file) surf_parse_close(); xbt_assert(!parse_status, "Parse error at %s:%d", file,surf_parse_lineno); } CATCH(e) { - xbt_die("Unrecoverable error at %s:%d: %s", - file, surf_parse_lineno, e.msg); + XBT_ERROR("Unrecoverable error at %s:%d. The full exception stack follows, in case it helps you to diagnose the problem.", + file, surf_parse_lineno); + RETHROW; } }