From 4ea3092aaf2a67496748f2e9ecbd71c025317b4a Mon Sep 17 00:00:00 2001 From: Arnaud Giersch Date: Fri, 3 Jan 2020 16:02:02 +0100 Subject: [PATCH] Use different strings (and please sonar). --- examples/python/actor-join/actor-join.py | 24 ++++++++-------- examples/python/actor-join/actor-join.tesh | 32 +++++++++++----------- examples/python/exec-async/exec-async.py | 12 ++++---- examples/python/exec-async/exec-async.tesh | 12 ++++---- examples/python/exec-dvfs/exec-dvfs.py | 4 +-- examples/python/exec-dvfs/exec-dvfs.tesh | 16 +++++------ 6 files changed, 50 insertions(+), 50 deletions(-) diff --git a/examples/python/actor-join/actor-join.py b/examples/python/actor-join/actor-join.py index 2b43af485e..f322a849ab 100644 --- a/examples/python/actor-join/actor-join.py +++ b/examples/python/actor-join/actor-join.py @@ -14,26 +14,26 @@ def sleeper(): 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!") diff --git a/examples/python/actor-join/actor-join.tesh b/examples/python/actor-join/actor-join.tesh index a9f6a31118..85b6884d40 100644 --- a/examples/python/actor-join/actor-join.tesh +++ b/examples/python/actor-join/actor-join.tesh @@ -1,21 +1,21 @@ $ ${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 diff --git a/examples/python/exec-async/exec-async.py b/examples/python/exec-async/exec-async.py index 4f1d3a809c..c0d9a73b1e 100644 --- a/examples/python/exec-async/exec-async.py +++ b/examples/python/exec-async/exec-async.py @@ -12,12 +12,12 @@ class Waiter: 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: @@ -25,7 +25,7 @@ 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(): @@ -34,7 +34,7 @@ class Monitor: this_actor.sleep_for(0.3) activity.wait() - this_actor.info("Goodbye now!") + this_actor.info("Goodbye from monitor!") class Canceller: @@ -42,14 +42,14 @@ 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__': diff --git a/examples/python/exec-async/exec-async.tesh b/examples/python/exec-async/exec-async.tesh index d18f11c454..4df63cbe99 100644 --- a/examples/python/exec-async/exec-async.tesh +++ b/examples/python/exec-async/exec-async.tesh @@ -1,14 +1,14 @@ #!/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! diff --git a/examples/python/exec-dvfs/exec-dvfs.py b/examples/python/exec-dvfs/exec-dvfs.py index 12e67b4c40..a912916e77 100644 --- a/examples/python/exec-dvfs/exec-dvfs.py +++ b/examples/python/exec-dvfs/exec-dvfs.py @@ -30,7 +30,7 @@ class Dvfs: 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) @@ -42,7 +42,7 @@ class Dvfs: 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) diff --git a/examples/python/exec-dvfs/exec-dvfs.tesh b/examples/python/exec-dvfs/exec-dvfs.tesh index 215897badf..b3b5e2ebb1 100644 --- a/examples/python/exec-dvfs/exec-dvfs.tesh +++ b/examples/python/exec-dvfs/exec-dvfs.tesh @@ -11,14 +11,14 @@ $ ${pythoncmd:=python3} ${PYTHON_TOOL_OPTIONS:=} ${srcdir:=.}/exec-dvfs.py ${pla > [ 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 @@ -29,11 +29,11 @@ $ ${pythoncmd:=python3} ${PYTHON_TOOL_OPTIONS:=} ${srcdir:=.}/exec-dvfs.py ${pla > [ 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 -- 2.20.1