X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/237fd22b56db7d1c67360c37559ce3aab16a002d..500f2123a1cc27f0727a1da2f7f9917e36f63ad5:/examples/python/exec-cpu-nonlinear/exec-cpu-nonlinear.py diff --git a/examples/python/exec-cpu-nonlinear/exec-cpu-nonlinear.py b/examples/python/exec-cpu-nonlinear/exec-cpu-nonlinear.py index c7ed498733..2fa4294fc4 100644 --- a/examples/python/exec-cpu-nonlinear/exec-cpu-nonlinear.py +++ b/examples/python/exec-cpu-nonlinear/exec-cpu-nonlinear.py @@ -1,23 +1,23 @@ -# Copyright (c) 2006-2021. The SimGrid Team. All rights reserved. +# Copyright (c) 2006-2023. 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. -# This example shows how to simulate a non-linear resource sharing for -# CPUs. +""" +This example shows how to simulate a non-linear resource sharing for CPUs. +""" - -from simgrid import Actor, Engine, NetZone, Host, this_actor -import sys import functools +import sys +from simgrid import Actor, Engine, NetZone, Host, this_actor def runner(): computation_amount = this_actor.get_host().speed n_task = 10 - this_actor.info("Execute %d tasks of %g flops, should take %d second in a CPU without degradation. It will take the double here." % ( - n_task, computation_amount, n_task)) + this_actor.info("Execute %d tasks of %g flops, should take %d second in a CPU without degradation. \ +It will take the double here." % (n_task, computation_amount, n_task)) tasks = [this_actor.exec_init(computation_amount).start() for _ in range(n_task)] @@ -64,4 +64,4 @@ if __name__ == '__main__': # During Engine destruction, the cleanup of std::function linked to non_linear callback is called. # If we let the cleanup by itself, it fails trying on its destruction because the python main program # has already freed its variables - del(e) + del e