Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
more verbose error messages
[simgrid.git] / src / simix / smx_deployment.c
index d1cbbf6..a62992c 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 *));
@@ -60,7 +62,7 @@ static void parse_process_finalize(void)
     arg->kill_time = kill_time;
     arg->properties = current_property_set;
 
-    XBT_INFO("Process %s(%s) will be started at time %f", arg->name,
+    XBT_DEBUG("Process %s(%s) will be started at time %f", arg->name,
            arg->hostname, start_time);
     SIMIX_timer_set(start_time, &SIMIX_process_create_from_wrapper, arg);
   } else {                      // start_time <= SIMIX_get_clock()
@@ -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,12 +123,13 @@ 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",
-                  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;
   }
 }