X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/39c935d6d5ee86d153f6f7e6a10d723ae7c57f6f..3c19254bcc639fa7d14122d705a6bf977411137f:/examples/python/exec-dvfs/exec-dvfs.py diff --git a/examples/python/exec-dvfs/exec-dvfs.py b/examples/python/exec-dvfs/exec-dvfs.py index 54393ecff4..7a7a5dd709 100644 --- a/examples/python/exec-dvfs/exec-dvfs.py +++ b/examples/python/exec-dvfs/exec-dvfs.py @@ -1,4 +1,4 @@ -# Copyright (c) 2007-2021. The SimGrid Team. All rights reserved. +# Copyright (c) 2007-2022. The SimGrid Team. All rights reserved. # # This program is free software; you can redistribute it and/or modify it # under the terms of the license (GNU LGPL) which comes with this package. @@ -12,7 +12,7 @@ class Dvfs: workload = 100E6 host = this_actor.get_host() - nb = host.get_pstate_count() + nb = host.pstate_count this_actor.info("Count of Processor states={:d}".format(nb)) this_actor.info("Current power peak={:f}".format(host.speed)) @@ -20,13 +20,13 @@ class Dvfs: # Run a task this_actor.execute(workload) - task_time = Engine.get_clock() + task_time = Engine.clock this_actor.info("Task1 duration: {:.2f}".format(task_time)) # Change power peak new_pstate = 2 - this_actor.info("Changing power peak value to {:f} (at index {:d})".format( host.get_pstate_speed(new_pstate), new_pstate)) + this_actor.info("Changing power peak value to {:f} (at index {:d})".format( host.pstate_speed(new_pstate), new_pstate)) host.pstate = new_pstate @@ -35,12 +35,12 @@ class Dvfs: # Run a second task this_actor.execute(workload) - task_time = Engine.get_clock() - task_time + task_time = Engine.clock - task_time this_actor.info("Task2 duration: {:.2f}".format(task_time)) # Verify that the default pstate is set to 0 host2 = Host.by_name("MyHost2") - this_actor.info("Count of Processor states={:d}".format(host2.get_pstate_count())) + this_actor.info("Count of Processor states={:d}".format(host2.pstate_count)) this_actor.info("Final power peak={:f}".format(host2.speed))