viff

changeset 1283:9043758a351a

Moved creation of preruntime up before benchmark instantiation.
author Janus Dam Nielsen <janus.nielsen@alexandra.dk>
date Fri, 16 Oct 2009 15:58:49 +0200
parents 7265daadaa63
children eaf317ca1b80
files apps/benchmark.py
diffstat 1 files changed, 15 insertions(+), 15 deletions(-) [+]
line diff
     1.1 --- a/apps/benchmark.py	Fri Oct 16 15:57:56 2009 +0200
     1.2 +++ b/apps/benchmark.py	Fri Oct 16 15:58:49 2009 +0200
     1.3 @@ -190,6 +190,21 @@
     1.4  
     1.5  runtime_class = make_runtime_class(base_runtime_class, actual_mixins)
     1.6  
     1.7 +pre_runtime = create_runtime(id, players, options.threshold,
     1.8 +                             options, runtime_class)
     1.9 +
    1.10 +def update_args(runtime, options):
    1.11 +    args = {}
    1.12 +    if options.args != "":
    1.13 +        for arg in options.args.split(','):
    1.14 +            id, value = arg.split('=')
    1.15 +            args[id] = long(value)
    1.16 +        runtime.set_args(args)
    1.17 +    return runtime
    1.18 +
    1.19 +
    1.20 +pre_runtime.addCallback(update_args, options)
    1.21 +
    1.22  if options.parallel:
    1.23      benchmark = ParallelBenchmark
    1.24  else:
    1.25 @@ -211,21 +226,6 @@
    1.26  print "Using the Benchmark bases: ", bases
    1.27  benchmark = type("ExtendedBenchmark", bases, {})
    1.28  
    1.29 -pre_runtime = create_runtime(id, players, options.threshold,
    1.30 -                             options, runtime_class)
    1.31 -
    1.32 -def update_args(runtime, options):
    1.33 -    args = {}
    1.34 -    if options.args != "":
    1.35 -        for arg in options.args.split(','):
    1.36 -            id, value = arg.split('=')
    1.37 -            args[id] = long(value)
    1.38 -        runtime.set_args(args)
    1.39 -    return runtime
    1.40 -
    1.41 -
    1.42 -pre_runtime.addCallback(update_args, options)
    1.43 -
    1.44  def do_benchmark(runtime, operation, benchmark, field, count, *args):
    1.45      benchmark(runtime, operation, field, count).benchmark(*args)
    1.46