Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Warn processes killed because their host was turned off.
[simgrid.git] / teshsuite / msg / host_on_off_recv / host_on_off_recv.c
index a170bd1..9755c8d 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010-2015. The SimGrid Team.
+/* Copyright (c) 2010-2018. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -26,6 +26,7 @@ static int master(int argc, char *argv[])
   MSG_host_off(jupiter);
 
   if (comm) {
+    MSG_task_destroy(task);
     MSG_comm_wait(comm, -1);
     MSG_comm_destroy(comm);
   }
@@ -40,7 +41,10 @@ static int slave(int argc, char *argv[])
   msg_task_t task = NULL;
   msg_error_t error = MSG_task_receive(&(task), mailbox);
   if (error) {
-    XBT_ERROR("Error while receiving message");
+    if (error != MSG_HOST_FAILURE)
+      XBT_ERROR("Error while receiving message");
+    else
+      XBT_DEBUG("The host has been turned off, this was expected");
     return 1;
   }