From: Paul Bédaride Date: Mon, 28 Jul 2014 13:09:56 +0000 (+0200) Subject: Fix tesh host_on_off_processes 4 X-Git-Tag: v3_12~884^2~8 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/d833dda9521242feb555e6d12bb8121a4362f583 Fix tesh host_on_off_processes 4 --- diff --git a/src/simix/smx_network.c b/src/simix/smx_network.c index cbcba0fc4c..14e7e5718a 100644 --- a/src/simix/smx_network.c +++ b/src/simix/smx_network.c @@ -805,6 +805,9 @@ void SIMIX_comm_finish(smx_action_t action) it from the other actions in the waitany list. Afterwards, get the position of the actual action in the waitany dynar and return it as the result of the simcall */ + + if (simcall->call == SIMCALL_NONE) //FIXME: maybe a better way to handle this case + continue; // if process handling comm is killed if (simcall->call == SIMCALL_COMM_WAITANY) { SIMIX_waitany_remove_simcall_from_actions(simcall); if (!MC_is_active()) diff --git a/teshsuite/msg/host_on_off_processes/host_on_off_processes.c b/teshsuite/msg/host_on_off_processes/host_on_off_processes.c index c34b2a8bd6..12975d2b3a 100644 --- a/teshsuite/msg/host_on_off_processes/host_on_off_processes.c +++ b/teshsuite/msg/host_on_off_processes/host_on_off_processes.c @@ -92,7 +92,7 @@ int test_launcher(int argc, char *argv[]) MSG_process_create_with_arguments("commRX", commRX, NULL, MSG_get_host_by_name("Tremblay"), 1, argvF); argvF = xbt_new(char*, 2); argvF[0] = xbt_strdup("commTX"); - MSG_process_create_with_arguments("commTX", commTX, NULL, MSG_get_host_by_name("Jupiter"), 1, argvF); + MSG_process_create_with_arguments("commTX", commTX, NULL, jupiter, 1, argvF); XBT_INFO(" number of processes: %d", MSG_process_get_number()); MSG_process_sleep(10); XBT_INFO(" Turn Jupiter off"); @@ -106,13 +106,16 @@ int test_launcher(int argc, char *argv[]) MSG_host_on(jupiter); MSG_process_sleep(10); argvF = xbt_new(char*, 2); + argvF[0] = xbt_strdup("commRX"); + MSG_process_create_with_arguments("commRX", commRX, NULL, jupiter, 1, argvF); + argvF = xbt_new(char*, 2); argvF[0] = xbt_strdup("commTX"); MSG_process_create_with_arguments("commTX", commTX, NULL, MSG_get_host_by_name("Tremblay"), 1, argvF); - argvF = xbt_new(char*, 2); - argvF[0] = xbt_strdup("commRX"); - MSG_process_create_with_arguments("commRX", commRX, NULL, MSG_get_host_by_name("Jupiter"), 1, argvF); + XBT_INFO(" number of processes: %d", MSG_process_get_number()); + MSG_process_sleep(10); + XBT_INFO(" Turn Jupiter off"); MSG_host_off(jupiter); - XBT_INFO("Test 4 seems ok, cool !(number of Process : %d, it should be 1", MSG_process_get_number()); + XBT_INFO("Test 4 seems ok, cool !(number of Process : %d, it should be 2", MSG_process_get_number()); } test =6; @@ -134,7 +137,7 @@ int test_launcher(int argc, char *argv[]) if (xbt_dynar_member(tests, &test)){ } - + XBT_INFO(" Test done. See you!"); return 0; } @@ -148,7 +151,7 @@ int process_daemon(int argc, char *argv[]) MSG_task_destroy(task); } MSG_task_execute(task); - XBT_INFO(" I'm done. See you!"); + XBT_INFO(" Deamon done. See you!"); return 0; } diff --git a/teshsuite/msg/host_on_off_processes/host_on_off_processes.tesh b/teshsuite/msg/host_on_off_processes/host_on_off_processes.tesh index 6968449c19..a233c1cf5c 100644 --- a/teshsuite/msg/host_on_off_processes/host_on_off_processes.tesh +++ b/teshsuite/msg/host_on_off_processes/host_on_off_processes.tesh @@ -2,20 +2,22 @@ $ ./host_on_off_processes ${srcdir:=.}/../../../examples/platforms/small_platform.xml ${srcdir:=.}/host_on_off_processes_d.xml 1 --log=no_loc --log=msg.thresh:error --log=surf_maxmin.thresh:error > [Tremblay:test_launcher:(1) 0.000000] [msg_test/INFO] Test 1: > [Tremblay:test_launcher:(1) 0.000000] [msg_test/INFO] Create a process on Jupiter -> [Jupiter:process_daemon:(2) 0.000000] [msg_test/INFO] Execute deamon +> [Jupiter:test_daemon:(2) 0.000000] [msg_test/INFO] Execute deamon > [Tremblay:test_launcher:(1) 0.000000] [msg_test/INFO] Turn off Jupiter > [Tremblay:test_launcher:(1) 10.000000] [msg_test/INFO] Test 1 seems ok, cool !(number of Process : 1, it should be 1 (i.e. the Test one)) +> [Tremblay:test_launcher:(1) 10.000000] [msg_test/INFO] Test done. See you! > [10.000000] [msg_test/INFO] Simulation time 10 $ ./host_on_off_processes ${srcdir:=.}/../../../examples/platforms/small_platform.xml ${srcdir:=.}/host_on_off_processes_d.xml 2 --log=no_loc --log=msg.thresh:error --log=surf_maxmin.thresh:error > [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 process 'process_daemon' on failed host 'Jupiter' +> [0.000000] [simix_process/WARNING] Cannot launch process 'test_daemon' on failed host 'Jupiter' > [Tremblay:test_launcher:(1) 10.000000] [msg_test/INFO] Test 2 does not crash, WTF ?!(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 $ ./host_on_off_processes ${srcdir:=.}/../../../examples/platforms/small_platform.xml ${srcdir:=.}/host_on_off_processes_d.xml 3 --log=no_loc --log=msg.thresh:error --log=surf_maxmin.thresh:error @@ -43,6 +45,18 @@ $ ./host_on_off_processes ${srcdir:=.}/../../../examples/platforms/small_platfor > [Tremblay:test:(1) 10.000000] [msg_test/INFO] number of processes: 3 > [Tremblay:test:(1) 20.000000] [msg_test/INFO] Turn Jupiter off > [Tremblay:test:(1) 20.000000] [msg_test/INFO] Test 4 seems ok (number of Process : 2, it should be 1 or 2 if RX has not been satisfied) cool, you can now turn off a node that has a process paused by a sleep call +> [Tremblay:test:(1) 20.000000] [msg_test/INFO] Test done. See you! > [Tremblay:commRX:(2) 20.000000] [msg_test/INFO] Receive message: TRANSFERT_FAILURE > [Tremblay:commRX:(2) 20.000000] [msg_test/INFO] RX Done > [20.000000] [msg_test/INFO] Simulation time 20 + +$ ./host_on_off_processes ${srcdir:=.}/../../../examples/platforms/small_platform.xml ${srcdir:=.}/host_on_off_processes_d.xml 4 --log=no_loc --log=msg.thresh:error --log=surf_maxmin.thresh:error +> [Tremblay:test:(1) 0.000000] [msg_test/INFO] Test 4 (turn off dest during a communication : Create a Process/task to make a communication between Tremblay and Jupiter and turn off Jupiter during the communication +> [Jupiter:commRX:(2) 10.000000] [msg_test/INFO] Start RX +> [Tremblay:commTX:(3) 10.000000] [msg_test/INFO] Start TX +> [Tremblay:test:(1) 10.000000] [msg_test/INFO] number of processes: 3 +> [Tremblay:test:(1) 20.000000] [msg_test/INFO] Turn Jupiter off +> [Tremblay:test:(1) 20.000000] [msg_test/INFO] Test 4 seems ok, cool !(number of Process : 2, it should be 2 +> [Tremblay:test:(1) 20.000000] [msg_test/INFO] Test done. See you! +> [Tremblay:commTX:(3) 40.000000] [msg_test/INFO] TX done +> [40.000000] [msg_test/INFO] Simulation time 40