#! ./tesh

p Test1 MSG_comm_test() with Sleep_sender > Sleep_receiver

! output sort
$ ./peer ${srcdir:=.}/small_platform.xml ${srcdir:=.}/deployment_peer01.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
> [  0.000000] (1:sender@Tremblay) sleep_start_time : 5.000000 , sleep_test_time : 0.100000
> [  0.000000] (2:receiver@Ruby) sleep_start_time : 1.000000 , sleep_test_time : 0.100000
> [  1.000000] (2:receiver@Ruby) Wait to receive a task
> [  5.000000] (1:sender@Tremblay) Send to receiver-0 Task_0
> [  5.100000] (1:sender@Tremblay) Send to receiver-0 Task_1
> [  5.100000] (2:receiver@Ruby) Received "Task_0"
> [  5.100000] (2:receiver@Ruby) Processing "Task_0"
> [  5.609710] (2:receiver@Ruby) "Task_0" done
> [  5.609710] (2:receiver@Ruby) Wait to receive a task
> [  5.700000] (1:sender@Tremblay) Send to receiver-0 Task_2
> [  5.709710] (2:receiver@Ruby) Received "Task_1"
> [  5.709710] (2:receiver@Ruby) Processing "Task_1"
> [  6.219420] (2:receiver@Ruby) "Task_1" done
> [  6.219420] (2:receiver@Ruby) Wait to receive a task
> [  6.300000] (1:sender@Tremblay) Send to receiver-0 finalize
> [  6.319420] (2:receiver@Ruby) Received "Task_2"
> [  6.319420] (2:receiver@Ruby) Processing "Task_2"
> [  6.829130] (2:receiver@Ruby) "Task_2" done
> [  6.829130] (2:receiver@Ruby) Wait to receive a task
> [  6.900000] (1:sender@Tremblay) Goodbye now!
> [  6.929130] (0:@) Simulation time 6.92913
> [  6.929130] (2:receiver@Ruby) Received "finalize"
> [  6.929130] (2:receiver@Ruby) I'm done. See you!

p Test2 MSG_comm_test() with Sleep_sender < Sleep_receiver

! output sort
$ ./peer ${srcdir:=.}/small_platform.xml ${srcdir:=.}/deployment_peer02.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
> [  0.000000] (1:sender@Tremblay) sleep_start_time : 1.000000 , sleep_test_time : 0.100000
> [  0.000000] (2:receiver@Ruby) sleep_start_time : 5.000000 , sleep_test_time : 0.100000
> [  1.000000] (1:sender@Tremblay) Send to receiver-0 Task_0
> [  5.000000] (2:receiver@Ruby) Wait to receive a task
> [  5.100000] (1:sender@Tremblay) Send to receiver-0 Task_1
> [  5.100000] (2:receiver@Ruby) Received "Task_0"
> [  5.100000] (2:receiver@Ruby) Processing "Task_0"
> [  5.609710] (2:receiver@Ruby) "Task_0" done
> [  5.609710] (2:receiver@Ruby) Wait to receive a task
> [  5.700000] (1:sender@Tremblay) Send to receiver-0 Task_2
> [  5.709710] (2:receiver@Ruby) Received "Task_1"
> [  5.709710] (2:receiver@Ruby) Processing "Task_1"
> [  6.219420] (2:receiver@Ruby) "Task_1" done
> [  6.219420] (2:receiver@Ruby) Wait to receive a task
> [  6.300000] (1:sender@Tremblay) Send to receiver-0 finalize
> [  6.319420] (2:receiver@Ruby) Received "Task_2"
> [  6.319420] (2:receiver@Ruby) Processing "Task_2"
> [  6.829130] (2:receiver@Ruby) "Task_2" done
> [  6.829130] (2:receiver@Ruby) Wait to receive a task
> [  6.900000] (1:sender@Tremblay) Goodbye now!
> [  6.929130] (0:@) Simulation time 6.92913
> [  6.929130] (2:receiver@Ruby) Received "finalize"
> [  6.929130] (2:receiver@Ruby) I'm done. See you!

p Test1 MSG_comm_wait() with Sleep_sender > Sleep_receiver

! output sort
$ ./peer ${srcdir:=.}/small_platform.xml ${srcdir:=.}/deployment_peer03.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
> [  0.000000] (1:sender@Tremblay) sleep_start_time : 5.000000 , sleep_test_time : 0.000000
> [  0.000000] (2:receiver@Ruby) sleep_start_time : 1.000000 , sleep_test_time : 0.000000
> [  1.000000] (2:receiver@Ruby) Wait to receive a task
> [  5.000000] (1:sender@Tremblay) Send to receiver-0 Task_0
> [  5.004022] (1:sender@Tremblay) Send to receiver-0 Task_1
> [  5.004022] (2:receiver@Ruby) Received "Task_0"
> [  5.004022] (2:receiver@Ruby) Processing "Task_0"
> [  5.513732] (2:receiver@Ruby) "Task_0" done
> [  5.513732] (2:receiver@Ruby) Wait to receive a task
> [  5.517753] (1:sender@Tremblay) Send to receiver-0 Task_2
> [  5.517753] (2:receiver@Ruby) Received "Task_1"
> [  5.517753] (2:receiver@Ruby) Processing "Task_1"
> [  6.027463] (2:receiver@Ruby) "Task_1" done
> [  6.027463] (2:receiver@Ruby) Wait to receive a task
> [  6.031485] (1:sender@Tremblay) Send to receiver-0 finalize
> [  6.031485] (2:receiver@Ruby) Received "Task_2"
> [  6.031485] (2:receiver@Ruby) Processing "Task_2"
> [  6.541195] (2:receiver@Ruby) "Task_2" done
> [  6.541195] (2:receiver@Ruby) Wait to receive a task
> [  6.543146] (0:@) Simulation time 6.54315
> [  6.543146] (1:sender@Tremblay) Goodbye now!
> [  6.543146] (2:receiver@Ruby) Received "finalize"
> [  6.543146] (2:receiver@Ruby) I'm done. See you!


p Test2 MSG_comm_wait() with Sleep_sender < Sleep_receiver

! output sort
$ ./peer ${srcdir:=.}/small_platform.xml ${srcdir:=.}/deployment_peer04.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
> [  0.000000] (1:sender@Tremblay) sleep_start_time : 1.000000 , sleep_test_time : 0.000000
> [  0.000000] (2:receiver@Ruby) sleep_start_time : 5.000000 , sleep_test_time : 0.000000
> [  1.000000] (1:sender@Tremblay) Send to receiver-0 Task_0
> [  5.000000] (2:receiver@Ruby) Wait to receive a task
> [  5.004022] (1:sender@Tremblay) Send to receiver-0 Task_1
> [  5.004022] (2:receiver@Ruby) Received "Task_0"
> [  5.004022] (2:receiver@Ruby) Processing "Task_0"
> [  5.513732] (2:receiver@Ruby) "Task_0" done
> [  5.513732] (2:receiver@Ruby) Wait to receive a task
> [  5.517753] (1:sender@Tremblay) Send to receiver-0 Task_2
> [  5.517753] (2:receiver@Ruby) Received "Task_1"
> [  5.517753] (2:receiver@Ruby) Processing "Task_1"
> [  6.027463] (2:receiver@Ruby) "Task_1" done
> [  6.027463] (2:receiver@Ruby) Wait to receive a task
> [  6.031485] (1:sender@Tremblay) Send to receiver-0 finalize
> [  6.031485] (2:receiver@Ruby) Received "Task_2"
> [  6.031485] (2:receiver@Ruby) Processing "Task_2"
> [  6.541195] (2:receiver@Ruby) "Task_2" done
> [  6.541195] (2:receiver@Ruby) Wait to receive a task
> [  6.543146] (0:@) Simulation time 6.54315
> [  6.543146] (1:sender@Tremblay) Goodbye now!
> [  6.543146] (2:receiver@Ruby) Received "finalize"
> [  6.543146] (2:receiver@Ruby) I'm done. See you!

p Test1 MSG_comm_waitall() for sender

! output sort
$ ./peer2 ${srcdir:=.}/small_platform.xml ${srcdir:=.}/deployment_peer.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
> [  0.000000] (1:sender@Tremblay) Send to receiver-0 Task_0
> [  0.000000] (1:sender@Tremblay) Send to receiver-0 Task_1
> [  0.000000] (1:sender@Tremblay) Send to receiver-0 Task_2
> [  0.000000] (1:sender@Tremblay) Send to receiver-0 finalize
> [ 10.000000] (2:receiver@Ruby) Wait to receive a task
> [ 10.004022] (2:receiver@Ruby) Received "Task_0"
> [ 10.004022] (2:receiver@Ruby) Processing "Task_0"
> [ 10.513732] (2:receiver@Ruby) "Task_0" done
> [ 10.513732] (2:receiver@Ruby) Wait to receive a task
> [ 10.517753] (2:receiver@Ruby) Received "Task_1"
> [ 10.517753] (2:receiver@Ruby) Processing "Task_1"
> [ 11.027463] (2:receiver@Ruby) "Task_1" done
> [ 11.027463] (2:receiver@Ruby) Wait to receive a task
> [ 11.031485] (2:receiver@Ruby) Received "Task_2"
> [ 11.031485] (2:receiver@Ruby) Processing "Task_2"
> [ 11.541195] (2:receiver@Ruby) "Task_2" done
> [ 11.541195] (2:receiver@Ruby) Wait to receive a task
> [ 11.543146] (0:@) Simulation time 11.5431
> [ 11.543146] (1:sender@Tremblay) Goodbye now!
> [ 11.543146] (2:receiver@Ruby) Received "finalize"
> [ 11.543146] (2:receiver@Ruby) I'm done. See you!
