Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
More cleaning for surfxml callback (property and trace*)
[simgrid.git] / src / simix / smx_deployment.c
index c7e943c..6b17613 100644 (file)
@@ -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;
   }
 }