X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/fc727903530d55d5d3f903a8213c7cb8a3273c7a..3ad5f0614d652e8d808b849e6f5e06ddc6cc579a:/src/simix/smx_deployment.c diff --git a/src/simix/smx_deployment.c b/src/simix/smx_deployment.c index 60b7e6fe28..a25155acca 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) { @@ -120,11 +123,11 @@ void SIMIX_launch_application(const char *file) surf_parse_open(file); TRY { - parse_status = surf_parse(); - surf_parse_close(); - xbt_assert(!parse_status, "Parse error at %s:%d", file,surf_parse_lineno); + parse_status = surf_parse(); + 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", + xbt_die("Unrecoverable error at %s:%d: %s", file, surf_parse_lineno, e.msg); } }