Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
make MSG_process_create die if host is off.
authorFrederic Suter <frederic.suter@cc.in2p3.fr>
Wed, 27 Feb 2019 08:31:17 +0000 (09:31 +0100)
committerFrederic Suter <frederic.suter@cc.in2p3.fr>
Wed, 27 Feb 2019 08:31:17 +0000 (09:31 +0100)
This was requested by adsein long time ago.

ChangeLog
src/msg/msg_process.cpp
teshsuite/msg/host_on_off_processes/host_on_off_processes.cpp
teshsuite/msg/host_on_off_processes/host_on_off_processes.tesh

index 87eab8d..9f4001b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -16,6 +16,8 @@ MSG:
    This C++ function was a pimple in the C API, made necessary at some
    point by the Java bindings. This is fixed now.
  - Hide the examples into examples/deprecated. New users should use S4U.
    This C++ function was a pimple in the C API, made necessary at some
    point by the Java bindings. This is fixed now.
  - Hide the examples into examples/deprecated. New users should use S4U.
+ - MSG_process_create and MSG_process_attach now crash if the host used
+   to run this process is off.
 
 XBT:
  - Drop sg_cmdline. Please use xbt_cmdline instead.
 
 XBT:
  - Drop sg_cmdline. Please use xbt_cmdline instead.
index 0604ec9..7a261de 100644 (file)
@@ -90,7 +90,7 @@ msg_process_t MSG_process_create_with_environment(const char *name, xbt_main_fun
           .get();
     });
   } catch (simgrid::HostFailureException const&) {
           .get();
     });
   } catch (simgrid::HostFailureException const&) {
-    XBT_DEBUG("The warning has already been issued. Do nothing more than catching the exception.");
+    xbt_die("Could not create a new process on failed host %s.", host->get_cname());
   }
 
   for (int i = 0; i != argc; ++i)
   }
 
   for (int i = 0; i != argc; ++i)
index eb6b463..85eab76 100644 (file)
@@ -97,7 +97,7 @@ static int test_launcher(int /*argc*/, char** /*argv*/)
   }
 
   test = 2;
   }
 
   test = 2;
-  // Create a process that on a host that is turned off (this should not be possible)
+  // Create a process that on a host that is turned off (this is not allowed)
   if (xbt_dynar_search_or_negative(tests, &test) != -1) {
     XBT_INFO("Test 2:");
     XBT_INFO("  Turn off Jupiter");
   if (xbt_dynar_search_or_negative(tests, &test) != -1) {
     XBT_INFO("Test 2:");
     XBT_INFO("  Turn off Jupiter");
@@ -108,17 +108,7 @@ static int test_launcher(int /*argc*/, char** /*argv*/)
     argvF[0] = xbt_strdup("process_daemon");
     MSG_process_create_with_arguments("process_daemon", process_daemon, NULL, jupiter, 1, argvF);
     MSG_process_sleep(10);
     argvF[0] = xbt_strdup("process_daemon");
     MSG_process_create_with_arguments("process_daemon", process_daemon, NULL, jupiter, 1, argvF);
     MSG_process_sleep(10);
-    XBT_INFO("  Test 2 does not crash as it should (number of Process : %d, it should be 1)", MSG_process_get_number());
-    XBT_INFO("  Ok so let's turn on/off the node to see whether the process is correctly bound to Jupiter");
-    MSG_host_on(jupiter);
-    XBT_INFO("  Turn off");
-    MSG_host_off(jupiter);
-    XBT_INFO("  sleep");
-    MSG_process_sleep(10);
-    XBT_INFO("number of Process : %d it should be 1. The daemon that has been created for test2 has been correctly "
-             "destroyed....ok at least it looks rigorous, cool ! You just have to disallow the possibility to create "
-             "a new process on a node when the node is off.)",
-             MSG_process_get_number());
+    XBT_INFO("  Test 2 does crash as it should. This message will not be displayed.");
   }
 
   test = 3;
   }
 
   test = 3;
index e4dfcfb..261b76a 100644 (file)
@@ -12,17 +12,12 @@ $ ${bindir}/host_on_off_processes ${platfdir}/small_platform.xml 1 --log=no_loc
 > [Tremblay:test_launcher:(1) 13.000000] [msg_test/INFO]   Test done. See you!
 > [13.000000] [msg_test/INFO] Simulation time 13
 
 > [Tremblay:test_launcher:(1) 13.000000] [msg_test/INFO]   Test done. See you!
 > [13.000000] [msg_test/INFO] Simulation time 13
 
+! expect signal SIGIOT
 $ ${bindir}/host_on_off_processes ${platfdir}/small_platform.xml 2 --log=no_loc
 > [Tremblay:test_launcher:(1) 0.000000] [msg_test/INFO] Test 2:
 > [Tremblay:test_launcher:(1) 0.000000] [msg_test/INFO]   Turn off Jupiter
 > [0.000000] [simix_process/WARNING] Cannot launch actor 'process_daemon' on failed host 'Jupiter'
 $ ${bindir}/host_on_off_processes ${platfdir}/small_platform.xml 2 --log=no_loc
 > [Tremblay:test_launcher:(1) 0.000000] [msg_test/INFO] Test 2:
 > [Tremblay:test_launcher:(1) 0.000000] [msg_test/INFO]   Turn off Jupiter
 > [0.000000] [simix_process/WARNING] Cannot launch actor 'process_daemon' on failed host 'Jupiter'
-> [Tremblay:test_launcher:(1) 10.000000] [msg_test/INFO]   Test 2 does not crash as it should (number of Process : 1, it should be 1)
-> [Tremblay:test_launcher:(1) 10.000000] [msg_test/INFO]   Ok so let's turn on/off the node to see whether the process is correctly bound to Jupiter
-> [Tremblay:test_launcher:(1) 10.000000] [msg_test/INFO]   Turn off
-> [Tremblay:test_launcher:(1) 10.000000] [msg_test/INFO]   sleep
-> [Tremblay:test_launcher:(1) 20.000000] [msg_test/INFO] number of Process : 1 it should be 1. The daemon that has been created for test2 has been correctly destroyed....ok at least it looks rigorous, cool ! You just have to disallow the possibility to create a new process on a node when the node is off.)
-> [Tremblay:test_launcher:(1) 20.000000] [msg_test/INFO]   Test done. See you!
-> [20.000000] [msg_test/INFO] Simulation time 20
+> [Tremblay:test_launcher:(1) 0.000000] [xbt/CRITICAL] Could not create a new process on failed host Jupiter.
 
 $ ${bindir}/host_on_off_processes ${platfdir}/small_platform.xml 4 --log=no_loc
 > [Tremblay:test_launcher:(1) 0.000000] [msg_test/INFO] Test 4 (turn off src during a communication) : Create a Process/task to make a communication between Jupiter and Tremblay and turn off Jupiter during the communication
 
 $ ${bindir}/host_on_off_processes ${platfdir}/small_platform.xml 4 --log=no_loc
 > [Tremblay:test_launcher:(1) 0.000000] [msg_test/INFO] Test 4 (turn off src during a communication) : Create a Process/task to make a communication between Jupiter and Tremblay and turn off Jupiter during the communication