Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
fix a test that got broken when I suppressed some simcalls
authorMartin Quinson <martin.quinson@loria.fr>
Sun, 1 Nov 2015 11:26:07 +0000 (12:26 +0100)
committerMartin Quinson <martin.quinson@loria.fr>
Sun, 1 Nov 2015 11:33:25 +0000 (12:33 +0100)
The execution order changed a very little bit as host_get_speed is not
a simcall anymore, and the process got the opportunity to start a new
task (and do the corresponding output) before being killed at the same
timestamp. But it actually dies at that timestamp, everything alright.

teshsuite/msg/host_on_off_processes/host_on_off_processes.c
teshsuite/msg/host_on_off_processes/host_on_off_processes.tesh

index b0ab942..0b19a41 100644 (file)
@@ -21,6 +21,7 @@ int commRX(int argc, char *argv[]);
 int commTX(int argc, char *argv[]);
 
 xbt_dynar_t tests;
+int tasks_done = 0;
 
 int test_launcher(int argc, char *argv[])
 {
@@ -42,7 +43,7 @@ int test_launcher(int argc, char *argv[])
     XBT_INFO("  Turn off Jupiter");
     MSG_host_off(jupiter);
     MSG_process_sleep(10);
-    XBT_INFO("Test 1 seems ok, cool !(number of Process : %d, it should be 1 (i.e. the Test one))", MSG_process_get_number());
+    XBT_INFO("Test 1 seems ok, cool !(#Processes: %d, it should be 1; #tasks: %d)", MSG_process_get_number(), tasks_done);
   }
 
   test = 2;
@@ -172,7 +173,6 @@ int test_launcher(int argc, char *argv[])
   return 0;
 }
 
-// adsein: Is this really a daemon ? it ran only one task ? I just added a stupid loop
 int process_daemon(int argc, char *argv[])
 {
   msg_task_t task = NULL;
@@ -182,6 +182,7 @@ int process_daemon(int argc, char *argv[])
     XBT_INFO("  Execute daemon");
     MSG_task_execute(task);
     MSG_task_destroy(task);
+    tasks_done ++;
   }
   XBT_INFO("  daemon done. See you!");
   return 0;
index 0e7369d..090157a 100644 (file)
@@ -7,7 +7,8 @@ $ ./host_on_off_processes ${srcdir:=.}/../../../examples/platforms/small_platfor
 > [Jupiter:process_daemon:(2) 1.000000] [msg_test/INFO]   Execute daemon
 > [Jupiter:process_daemon:(2) 2.000000] [msg_test/INFO]   Execute daemon
 > [Tremblay:test_launcher:(1) 3.000000] [msg_test/INFO]   Turn off Jupiter
-> [Tremblay:test_launcher:(1) 13.000000] [msg_test/INFO] Test 1 seems ok, cool !(number of Process : 1, it should be 1 (i.e. the Test one))
+> [Jupiter:process_daemon:(2) 3.000000] [msg_test/INFO]   Execute daemon
+> [Tremblay:test_launcher:(1) 13.000000] [msg_test/INFO] Test 1 seems ok, cool !(#Processes: 1, it should be 1; #tasks: 3)
 > [Tremblay:test_launcher:(1) 13.000000] [msg_test/INFO]   Test done. See you!
 > [13.000000] [msg_test/INFO] Simulation time 13