Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
convert all xbt_ex(host_error) catching locations to simgrid::HostFailureException
authorMartin Quinson <martin.quinson@loria.fr>
Sat, 25 Aug 2018 19:51:19 +0000 (21:51 +0200)
committerMartin Quinson <martin.quinson@loria.fr>
Sat, 25 Aug 2018 19:51:19 +0000 (21:51 +0200)
examples/s4u/platform-failures/s4u-platform-failures.cpp
src/msg/msg_gos.cpp
src/simix/libsmx.cpp

index 5f7d63f..fd71092 100644 (file)
@@ -104,17 +104,17 @@ static int worker(int argc, char* argv[])
         XBT_INFO("Gloups. The cpu on which I'm running just turned off!. See you!");
         return -1;
       }
+    } catch (simgrid::HostFailureException& e) {
+      XBT_INFO("Gloups. The cpu on which I'm running just turned off!. See you!");
+      delete payload;
+      return -1;
     } catch (xbt_ex& e) {
       switch (e.category) {
-        case host_error:
-          XBT_INFO("Gloups. The cpu on which I'm running just turned off!. See you!");
-          delete payload;
-          return -1;
         case network_error:
           XBT_INFO("Mmh. Something went wrong. Nevermind. Let's keep going!");
           break;
         default:
-          xbt_die("Unexpected behavior");
+          xbt_die("Unexpected behavior. Category: %s", xbt_ex_catname(e.category));
       }
     }
   }
index 9b434b4..f698102 100644 (file)
@@ -78,15 +78,13 @@ msg_error_t MSG_parallel_task_execute_with_timeout(msg_task_t task, double timeo
     simdata->setNotUsed();
 
     XBT_DEBUG("Execution task '%s' finished in state %d", task->name, (int)comp_state);
-  }
-  catch (xbt_ex& e) {
+  } catch (simgrid::HostFailureException& e) {
+    status = MSG_HOST_FAILURE;
+  } catch (xbt_ex& e) {
     switch (e.category) {
     case cancel_error:
       status = MSG_TASK_CANCELED;
       break;
-    case host_error:
-      status = MSG_HOST_FAILURE;
-      break;
     case timeout_error:
       status = MSG_TIMEOUT;
       break;
@@ -280,10 +278,10 @@ msg_error_t MSG_task_receive_ext_bounded(msg_task_t * task, const char *alias, d
                       timeout, rate);
     XBT_DEBUG("Got task %s from %s", (*task)->name, mailbox->get_cname());
     (*task)->simdata->setNotUsed();
-  }
-  catch (xbt_ex& e) {
+  } catch (simgrid::HostFailureException& e) {
+    ret = MSG_HOST_FAILURE;
+  } catch (xbt_ex& e) {
     switch (e.category) {
-    case host_error:
     case cancel_error:
       ret = MSG_HOST_FAILURE;
       break;
index d340908..0dbe5b1 100644 (file)
@@ -31,7 +31,7 @@ XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(simix);
  * @brief Creates a synchro that executes some computation of an host.
  *
  * This function creates a SURF action and allocates the data necessary
- * to create the SIMIX synchro. It can raise a host_error exception if the host crashed.
+ * to create the SIMIX synchro. It can raise a HostFailureException exception if the host crashed.
  *
  * @param name Name of the execution synchro to create
  * @param category Tracing category
@@ -211,7 +211,7 @@ void simcall_process_set_kill_time(smx_actor_t process, double kill_time)
  * @brief Creates a new sleep SIMIX synchro.
  *
  * This function creates a SURF action and allocates the data necessary
- * to create the SIMIX synchro. It can raise a host_error exception if the
+ * to create the SIMIX synchro. It can raise a HostFailureException if the
  * host crashed. The default SIMIX name of the synchro is "sleep".
  *
  *   @param duration Time duration of the sleep.