Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Don't give actors a chance to survive their exec if their host is turned off
authorMartin Quinson <martin.quinson@ens-rennes.fr>
Thu, 28 Feb 2019 01:30:53 +0000 (02:30 +0100)
committerMartin Quinson <martin.quinson@ens-rennes.fr>
Thu, 28 Feb 2019 07:03:48 +0000 (08:03 +0100)
Before, they received an HostFailureException that they could catch to
survive. Now, they are simply killed (once their on_exit callbacks are
executed).

This is more consistent with what happens with sleep actions, and thus
fixes the github issue #325.

ChangeLog
examples/deprecated/msg/platform-failures/platform-failures.tesh
examples/s4u/platform-failures/s4u-platform-failures.cpp
examples/s4u/platform-failures/s4u-platform-failures.tesh
src/kernel/activity/ExecImpl.cpp
teshsuite/msg/host_on_off_processes/host_on_off_processes.cpp
teshsuite/msg/host_on_off_processes/host_on_off_processes.tesh

index 9f4001b..cce8b08 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -44,6 +44,7 @@ Fixed bugs:
  - #314: SMPI args internal cleanup
  - #316: Fix a bug related to the CPU utilization of multi-core VM
  - #318: Invalid trace file when using option --cfg=tracing/smpi/display-sizes:yes
+ - #325: Turning off a host has different behavior on sleeping actors and computing actors
 
 ----------------------------------------------------------------------------
 
index 9e36930..6aa6f0b 100644 (file)
@@ -94,7 +94,6 @@ $ $SG_TEST_EXENV ${bindir:=.}/platform-failures$EXEEXT --log=xbt_cfg.thres:criti
 > [ 40.278351] (1:master@Tremblay) Send to worker-3 completed
 > [ 40.278351] (1:master@Tremblay) Send a message to worker-4
 > [ 40.278351] (4:worker@Ginette) Start execution...
-> [ 41.000000] (4:worker@Ginette) Gloups. The cpu on which I'm running just turned off!. See you!
 > [ 41.309278] (1:master@Tremblay) Send to worker-4 completed
 > [ 41.309278] (1:master@Tremblay) All tasks have been dispatched. Let's tell everybody the computation is over.
 > [ 41.309278] (2:worker@Tremblay) I'm done. See you!
@@ -202,7 +201,6 @@ $ $SG_TEST_EXENV ${bindir:=.}/platform-failures$EXEEXT --log=xbt_cfg.thres:criti
 > [ 40.692268] (4:worker@Ginette) Start execution...
 > [ 40.692268] (1:master@Tremblay) Send to worker-3 completed
 > [ 40.692268] (1:master@Tremblay) Send a message to worker-4
-> [ 41.000000] (4:worker@Ginette) Gloups. The cpu on which I'm running just turned off!. See you!
 > [ 41.774742] (5:worker@Bourassa) Start execution...
 > [ 41.774742] (1:master@Tremblay) Send to worker-4 completed
 > [ 41.774742] (1:master@Tremblay) All tasks have been dispatched. Let's tell everybody the computation is over.
index e4cca6a..cd949f8 100644 (file)
@@ -93,16 +93,15 @@ static int worker(int argc, char* argv[])
       payload   = static_cast<double*>(mailbox->get());
       xbt_assert(payload != nullptr, "mailbox->get() failed");
       comp_size = *payload;
+      delete payload;
       if (comp_size < 0) { /* - Exit when -1.0 is received */
         XBT_INFO("I'm done. See you!");
-        delete payload;
         break;
       }
       /*  - Otherwise, process the task */
       XBT_INFO("Start execution...");
       simgrid::s4u::this_actor::execute(comp_size);
       XBT_INFO("Execution complete.");
-      delete payload;
     } catch (simgrid::HostFailureException& e) {
       XBT_INFO("Gloups. The cpu on which I'm running just turned off!. See you!");
       delete payload;
index 007a7c1..ed8a8cf 100644 (file)
@@ -94,7 +94,6 @@ $ $SG_TEST_EXENV ${bindir:=.}/s4u-platform-failures$EXEEXT --log=xbt_cfg.thres:c
 > [ 40.278351] (1:master@Tremblay) Send to worker-3 completed
 > [ 40.278351] (1:master@Tremblay) Send a message to worker-4
 > [ 40.278351] (4:worker@Ginette) Start execution...
-> [ 41.000000] (4:worker@Ginette) Gloups. The cpu on which I'm running just turned off!. See you!
 > [ 41.309278] (1:master@Tremblay) Send to worker-4 completed
 > [ 41.309278] (1:master@Tremblay) All tasks have been dispatched. Let's tell everybody the computation is over.
 > [ 41.309278] (2:worker@Tremblay) I'm done. See you!
@@ -202,7 +201,6 @@ $ $SG_TEST_EXENV ${bindir:=.}/s4u-platform-failures$EXEEXT --log=xbt_cfg.thres:c
 > [ 40.692268] (4:worker@Ginette) Start execution...
 > [ 40.692268] (1:master@Tremblay) Send to worker-3 completed
 > [ 40.692268] (1:master@Tremblay) Send a message to worker-4
-> [ 41.000000] (4:worker@Ginette) Gloups. The cpu on which I'm running just turned off!. See you!
 > [ 41.774742] (5:worker@Bourassa) Start execution...
 > [ 41.774742] (1:master@Tremblay) Send to worker-4 completed
 > [ 41.774742] (1:master@Tremblay) All tasks have been dispatched. Let's tell everybody the computation is over.
index a55c1f3..6645e76 100644 (file)
@@ -175,8 +175,10 @@ void ExecImpl::finish()
       case SIMIX_FAILED:
         XBT_DEBUG("ExecImpl::finish(): host '%s' failed", simcall->issuer->get_host()->get_cname());
         simcall->issuer->context_->iwannadie = true;
-        simcall->issuer->exception_ =
-            std::make_exception_ptr(simgrid::HostFailureException(XBT_THROW_POINT, "Host failed"));
+        if (simcall->issuer->get_host()->is_on())
+          simcall->issuer->exception_ =
+              std::make_exception_ptr(simgrid::HostFailureException(XBT_THROW_POINT, "Host failed"));
+        /* else, the actor will be killed with no possibility to survive */
         break;
 
       case SIMIX_CANCELED:
index 85eab76..87cb748 100644 (file)
@@ -27,13 +27,9 @@ static int process_daemon(int /*argc*/, char** /*argv*/)
     msg_task_t task = MSG_task_create("daemon", MSG_host_get_speed(MSG_host_self()), 0, NULL);
     MSG_process_set_data(self, task);
     XBT_INFO("  Execute daemon");
-    msg_error_t res = MSG_task_execute(task);
+    MSG_task_execute(task);
     MSG_task_destroy(task);
     tasks_done++;
-    if (res == MSG_HOST_FAILURE) {
-      XBT_INFO("Host has died as expected, do nothing else");
-      return 0;
-    }
   }
   XBT_INFO("  daemon done. See you!");
   return 0;
index 261b76a..1156e2d 100644 (file)
@@ -61,7 +61,6 @@ $ ${bindir}/host_on_off_processes ${platfdir}/small_platform.xml 6 --log=no_loc
 > [Jupiter:process_daemonJUPI:(3) 9.000011] [msg_test/INFO]   Execute daemon
 > [Tremblay:test_launcher:(1) 10.000000] [msg_test/INFO]   Turn Jupiter off
 > [Tremblay:test_launcher:(1) 10.000000] [msg_test/INFO]   Shutdown vm0
-> [Jupiter:process_daemonJUPI:(3) 10.000000] [msg_test/INFO] Host has died as expected, do nothing else
 > [Tremblay:test_launcher:(1) 10.000000] [msg_test/INFO]   Destroy vm0
 > [Tremblay:test_launcher:(1) 10.000000] [msg_test/INFO] Test 6 is also weird: when the node Jupiter is turned off once again, the VM and its daemon are not killed. However, the issue regarding the shutdown of hosted VMs can be seen a feature not a bug ;)
 > [Tremblay:test_launcher:(1) 10.000000] [msg_test/INFO]   Test done. See you!