Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
actors on failing hosts should die silently and with no delay
[simgrid.git] / examples / s4u / platform-failures / s4u-platform-failures.cpp
index cd949f8..75669f5 100644 (file)
@@ -25,7 +25,7 @@ static int master(int argc, char* argv[])
 {
   xbt_assert(argc == 5, "Expecting one parameter");
 
-  simgrid::s4u::MailboxPtr mailbox;
+  simgrid::s4u::Mailbox* mailbox;
   long number_of_tasks = xbt_str_parse_int(argv[1], "Invalid amount of tasks: %s");
   double comp_size     = xbt_str_parse_double(argv[2], "Invalid computational size: %s");
   double comm_size     = xbt_str_parse_double(argv[3], "Invalid communication size: %s");
@@ -40,9 +40,6 @@ static int master(int argc, char* argv[])
       XBT_INFO("Send a message to %s", mailbox->get_cname());
       mailbox->put(payload, comm_size, 10.0);
       XBT_INFO("Send to %s completed", mailbox->get_cname());
-    } catch (simgrid::HostFailureException& e) {
-      XBT_INFO("Gloups. The cpu on which I'm running just turned off!. See you!");
-      return -1;
     } catch (simgrid::TimeoutError& e) {
       delete payload;
       XBT_INFO("Mmh. Got timeouted while speaking to '%s'. Nevermind. Let's keep going!", mailbox->get_cname());
@@ -84,7 +81,7 @@ static int worker(int argc, char* argv[])
 {
   xbt_assert(argc == 2, "Expecting one parameter");
   long id                          = xbt_str_parse_int(argv[1], "Invalid argument %s");
-  simgrid::s4u::MailboxPtr mailbox = simgrid::s4u::Mailbox::by_name(std::string("worker-") + std::to_string(id));
+  simgrid::s4u::Mailbox* mailbox   = simgrid::s4u::Mailbox::by_name(std::string("worker-") + std::to_string(id));
   double* payload                  = nullptr;
   double comp_size                 = -1;
   while (1) {