Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
sonar
authorFrederic Suter <frederic.suter@cc.in2p3.fr>
Thu, 26 Jul 2018 07:51:00 +0000 (09:51 +0200)
committerFrederic Suter <frederic.suter@cc.in2p3.fr>
Thu, 26 Jul 2018 07:51:00 +0000 (09:51 +0200)
examples/s4u/platform-failures/s4u-platform-failures.cpp
src/simix/smx_host.cpp

index e62f6ed..941ea2a 100644 (file)
@@ -108,13 +108,11 @@ static int worker(int argc, char* argv[])
     try {
       simgrid::s4u::this_actor::execute(comp_size);
     } 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!");
-          return -1;
-        default:
-          xbt_die("Unexpected behavior");
-      }
+      if (e.category == host_error) {
+        XBT_INFO("Gloups. The cpu on which I'm running just turned off!. See you!");
+        return -1;
+      } else
+        xbt_die("Unexpected behavior");
     }
   }
   XBT_INFO("I'm done. See you!");
index d814cd7..05dc306 100644 (file)
@@ -76,7 +76,7 @@ simgrid::kernel::activity::ExecImplPtr SIMIX_execution_start(std::string name, s
   simgrid::kernel::activity::ExecImplPtr exec = simgrid::kernel::activity::ExecImplPtr(
       new simgrid::kernel::activity::ExecImpl(name, surf_action, /*timeout_detector*/ nullptr, host));
 
-  exec->set_category(name);
+  exec->set_category(category);
   XBT_DEBUG("Create execute synchro %p: %s", exec.get(), exec->name_.c_str());
   simgrid::kernel::activity::ExecImpl::on_creation(exec);