def master():
- this_actor.info("Start sleeper")
- actor = Actor.create("sleeper from master", Host.current(), sleeper)
- this_actor.info("Join the sleeper (timeout 2)")
+ this_actor.info("Start 1st sleeper")
+ actor = Actor.create("1st sleeper from master", Host.current(), sleeper)
+ this_actor.info("Join the 1st sleeper (timeout 2)")
actor.join(2)
- this_actor.info("Start sleeper")
- actor = Actor.create("sleeper from master", Host.current(), sleeper)
- this_actor.info("Join the sleeper (timeout 4)")
+ this_actor.info("Start 2nd sleeper")
+ actor = Actor.create("2nd sleeper from master", Host.current(), sleeper)
+ this_actor.info("Join the 2nd sleeper (timeout 4)")
actor.join(4)
- this_actor.info("Start sleeper")
- actor = Actor.create("sleeper from master", Host.current(), sleeper)
- this_actor.info("Join the sleeper (timeout 2)")
+ this_actor.info("Start 3rd sleeper")
+ actor = Actor.create("3rd sleeper from master", Host.current(), sleeper)
+ this_actor.info("Join the 3rd sleeper (timeout 2)")
actor.join(2)
- this_actor.info("Start sleeper")
- actor = Actor.create("sleeper from master", Host.current(), sleeper)
+ this_actor.info("Start 4th sleeper")
+ actor = Actor.create("4th sleeper from master", Host.current(), sleeper)
this_actor.info("Waiting 4")
this_actor.sleep_for(4)
- this_actor.info("Join the sleeper after its end (timeout 1)")
+ this_actor.info("Join the 4th sleeper after its end (timeout 1)")
actor.join(1)
this_actor.info("Goodbye now!")
$ ${pythoncmd:=python3} ${PYTHON_TOOL_OPTIONS:=} ${srcdir:=.}/actor-join.py ${platfdir}/small_platform.xml
-> [Tremblay:master:(1) 0.000000] [python/INFO] Start sleeper
-> [Tremblay:sleeper from master:(2) 0.000000] [python/INFO] Sleeper started
-> [Tremblay:master:(1) 0.000000] [python/INFO] Join the sleeper (timeout 2)
-> [Tremblay:master:(1) 2.000000] [python/INFO] Start sleeper
-> [Tremblay:sleeper from master:(3) 2.000000] [python/INFO] Sleeper started
-> [Tremblay:master:(1) 2.000000] [python/INFO] Join the sleeper (timeout 4)
-> [Tremblay:sleeper from master:(2) 3.000000] [python/INFO] I'm done. See you!
-> [Tremblay:sleeper from master:(3) 5.000000] [python/INFO] I'm done. See you!
-> [Tremblay:master:(1) 5.000000] [python/INFO] Start sleeper
-> [Tremblay:sleeper from master:(4) 5.000000] [python/INFO] Sleeper started
-> [Tremblay:master:(1) 5.000000] [python/INFO] Join the sleeper (timeout 2)
-> [Tremblay:master:(1) 7.000000] [python/INFO] Start sleeper
-> [Tremblay:sleeper from master:(5) 7.000000] [python/INFO] Sleeper started
+> [Tremblay:master:(1) 0.000000] [python/INFO] Start 1st sleeper
+> [Tremblay:1st sleeper from master:(2) 0.000000] [python/INFO] Sleeper started
+> [Tremblay:master:(1) 0.000000] [python/INFO] Join the 1st sleeper (timeout 2)
+> [Tremblay:master:(1) 2.000000] [python/INFO] Start 2nd sleeper
+> [Tremblay:2nd sleeper from master:(3) 2.000000] [python/INFO] Sleeper started
+> [Tremblay:master:(1) 2.000000] [python/INFO] Join the 2nd sleeper (timeout 4)
+> [Tremblay:1st sleeper from master:(2) 3.000000] [python/INFO] I'm done. See you!
+> [Tremblay:2nd sleeper from master:(3) 5.000000] [python/INFO] I'm done. See you!
+> [Tremblay:master:(1) 5.000000] [python/INFO] Start 3rd sleeper
+> [Tremblay:3rd sleeper from master:(4) 5.000000] [python/INFO] Sleeper started
+> [Tremblay:master:(1) 5.000000] [python/INFO] Join the 3rd sleeper (timeout 2)
+> [Tremblay:master:(1) 7.000000] [python/INFO] Start 4th sleeper
+> [Tremblay:4th sleeper from master:(5) 7.000000] [python/INFO] Sleeper started
> [Tremblay:master:(1) 7.000000] [python/INFO] Waiting 4
-> [Tremblay:sleeper from master:(4) 8.000000] [python/INFO] I'm done. See you!
-> [Tremblay:sleeper from master:(5) 10.000000] [python/INFO] I'm done. See you!
-> [Tremblay:master:(1) 11.000000] [python/INFO] Join the sleeper after its end (timeout 1)
+> [Tremblay:3rd sleeper from master:(4) 8.000000] [python/INFO] I'm done. See you!
+> [Tremblay:4th sleeper from master:(5) 10.000000] [python/INFO] I'm done. See you!
+> [Tremblay:master:(1) 11.000000] [python/INFO] Join the 4th sleeper after its end (timeout 1)
> [Tremblay:master:(1) 11.000000] [python/INFO] Goodbye now!
> [Tremblay:master:(1) 12.000000] [python/INFO] Goodbye now!
> [12.000000] [python/INFO] Simulation time 12.0
def __call__(self):
computation_amount = this_actor.get_host().speed
- this_actor.info("Execute {:.0f} flops, should take 1 second.".format(computation_amount))
+ this_actor.info("Waiter executes {:.0f} flops, should take 1 second.".format(computation_amount))
activity = this_actor.exec_init(computation_amount)
activity.start()
activity.wait()
- this_actor.info("Goodbye now!")
+ this_actor.info("Goodbye from waiter!")
class Monitor:
def __call__(self):
computation_amount = this_actor.get_host().speed
- this_actor.info("Execute {:.0f} flops, should take 1 second.".format(computation_amount))
+ this_actor.info("Monitor executes {:.0f} flops, should take 1 second.".format(computation_amount))
activity = this_actor.exec_init(computation_amount).start()
while not activity.test():
this_actor.sleep_for(0.3)
activity.wait()
- this_actor.info("Goodbye now!")
+ this_actor.info("Goodbye from monitor!")
class Canceller:
def __call__(self):
computation_amount = this_actor.get_host().speed
- this_actor.info("Execute {:.0f} flops, should take 1 second.".format(computation_amount))
+ this_actor.info("Canceller executes {:.0f} flops, should take 1 second.".format(computation_amount))
activity = this_actor.exec_init(computation_amount).start()
this_actor.sleep_for(0.5)
this_actor.info("I changed my mind, cancel!")
activity.cancel()
- this_actor.info("Goodbye now!")
+ this_actor.info("Goodbye from canceller!")
if __name__ == '__main__':
#!/usr/bin/env tesh
$ ${pythoncmd:=python3} ${PYTHON_TOOL_OPTIONS:=} ${srcdir:=.}/exec-async.py ${platfdir}/small_platform.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
-> [ 0.000000] (1:wait@Fafard) Execute 76296000 flops, should take 1 second.
-> [ 0.000000] (2:monitor@Ginette) Execute 48492000 flops, should take 1 second.
-> [ 0.000000] (3:cancel@Boivin) Execute 98095000 flops, should take 1 second.
+> [ 0.000000] (1:wait@Fafard) Waiter executes 76296000 flops, should take 1 second.
+> [ 0.000000] (2:monitor@Ginette) Monitor executes 48492000 flops, should take 1 second.
+> [ 0.000000] (3:cancel@Boivin) Canceller executes 98095000 flops, should take 1 second.
> [ 0.000000] (2:monitor@Ginette) Remaining amount of flops: 48492000 (100%)
> [ 0.300000] (2:monitor@Ginette) Remaining amount of flops: 33944400 (70%)
> [ 0.500000] (3:cancel@Boivin) I changed my mind, cancel!
-> [ 0.500000] (3:cancel@Boivin) Goodbye now!
+> [ 0.500000] (3:cancel@Boivin) Goodbye from canceller!
> [ 0.600000] (2:monitor@Ginette) Remaining amount of flops: 19396800 (40%)
> [ 0.900000] (2:monitor@Ginette) Remaining amount of flops: 4849200 (10%)
-> [ 1.000000] (1:wait@Fafard) Goodbye now!
-> [ 1.200000] (2:monitor@Ginette) Goodbye now!
+> [ 1.000000] (1:wait@Fafard) Goodbye from waiter!
+> [ 1.200000] (2:monitor@Ginette) Goodbye from monitor!
host.pstate = new_pstate
- this_actor.info("Current power peak={:f}".format(host.speed))
+ this_actor.info("Changed power peak={:f}".format(host.speed))
# Run a second task
this_actor.execute(workload)
host2 = Host.by_name("MyHost2")
this_actor.info("Count of Processor states={:d}".format(host2.get_pstate_count()))
- this_actor.info("Current power peak={:f}".format(host2.speed))
+ this_actor.info("Final power peak={:f}".format(host2.speed))
if __name__ == '__main__':
e = Engine(sys.argv)
> [ 1.000000] (1:dvfs_test@MyHost1) Changing power peak value to 20000000.000000 (at index 2)
> [ 1.000000] (2:dvfs_test@MyHost2) Task1 duration: 1.00
> [ 1.000000] (2:dvfs_test@MyHost2) Changing power peak value to 20000000.000000 (at index 2)
-> [ 1.000000] (1:dvfs_test@MyHost1) Current power peak=20000000.000000
-> [ 1.000000] (2:dvfs_test@MyHost2) Current power peak=20000000.000000
+> [ 1.000000] (1:dvfs_test@MyHost1) Changed power peak=20000000.000000
+> [ 1.000000] (2:dvfs_test@MyHost2) Changed power peak=20000000.000000
> [ 6.000000] (1:dvfs_test@MyHost1) Task2 duration: 5.00
> [ 6.000000] (1:dvfs_test@MyHost1) Count of Processor states=3
-> [ 6.000000] (1:dvfs_test@MyHost1) Current power peak=20000000.000000
+> [ 6.000000] (1:dvfs_test@MyHost1) Final power peak=20000000.000000
> [ 6.000000] (2:dvfs_test@MyHost2) Task2 duration: 5.00
> [ 6.000000] (2:dvfs_test@MyHost2) Count of Processor states=3
-> [ 6.000000] (2:dvfs_test@MyHost2) Current power peak=20000000.000000
+> [ 6.000000] (2:dvfs_test@MyHost2) Final power peak=20000000.000000
$ ${pythoncmd:=python3} ${PYTHON_TOOL_OPTIONS:=} ${srcdir:=.}/exec-dvfs.py ${platfdir}/energy_cluster.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
> [ 0.000000] (1:dvfs_test@MyHost1) Count of Processor states=3
> [ 1.000000] (1:dvfs_test@MyHost1) Changing power peak value to 20000000.000000 (at index 2)
> [ 1.000000] (2:dvfs_test@MyHost2) Task1 duration: 1.00
> [ 1.000000] (2:dvfs_test@MyHost2) Changing power peak value to 20000000.000000 (at index 2)
-> [ 1.000000] (1:dvfs_test@MyHost1) Current power peak=20000000.000000
-> [ 1.000000] (2:dvfs_test@MyHost2) Current power peak=20000000.000000
+> [ 1.000000] (1:dvfs_test@MyHost1) Changed power peak=20000000.000000
+> [ 1.000000] (2:dvfs_test@MyHost2) Changed power peak=20000000.000000
> [ 6.000000] (1:dvfs_test@MyHost1) Task2 duration: 5.00
> [ 6.000000] (1:dvfs_test@MyHost1) Count of Processor states=3
-> [ 6.000000] (1:dvfs_test@MyHost1) Current power peak=20000000.000000
+> [ 6.000000] (1:dvfs_test@MyHost1) Final power peak=20000000.000000
> [ 6.000000] (2:dvfs_test@MyHost2) Task2 duration: 5.00
> [ 6.000000] (2:dvfs_test@MyHost2) Count of Processor states=3
-> [ 6.000000] (2:dvfs_test@MyHost2) Current power peak=20000000.000000
+> [ 6.000000] (2:dvfs_test@MyHost2) Final power peak=20000000.000000