viff

changeset 969:343dbf9675d6

Added --threshold option to benchmark.
author Martin Geisler <mg@daimi.au.dk>
date Wed, 08 Oct 2008 11:20:27 +0200
parents f4de7f56103e
children 355607dc9f8f
files apps/benchmark.py
diffstat 1 files changed, 7 insertions(+), 2 deletions(-) [+]
line diff
     1.1 --- a/apps/benchmark.py	Tue Oct 07 21:11:00 2008 +0200
     1.2 +++ b/apps/benchmark.py	Wed Oct 08 11:20:27 2008 +0200
     1.3 @@ -106,6 +106,8 @@
     1.4                    help="use PRSS for preprocessing")
     1.5  parser.add_option("--hyper", action="store_false", dest="prss",
     1.6                    help="use hyperinvertible matrices for preprocessing")
     1.7 +parser.add_option("-t", "--threshold", type="int",
     1.8 +                  help="corruption threshold")
     1.9  parser.add_option("-c", "--count", type="int",
    1.10                    help="number of operations")
    1.11  parser.add_option("-o", "--operation", type="choice", choices=operations,
    1.12 @@ -115,7 +117,7 @@
    1.13  parser.add_option("-s", "--sequential", action="store_false", dest="parallel",
    1.14                    help="execute operations in sequence")
    1.15  
    1.16 -parser.set_defaults(modulus=2**65, count=10,
    1.17 +parser.set_defaults(modulus=2**65, threshold=1, count=10,
    1.18                      active=False, twoplayer=False, prss=True,
    1.19                      operation=operations[0], parallel=True)
    1.20  
    1.21 @@ -129,6 +131,9 @@
    1.22  
    1.23  id, players = load_config(args[0])
    1.24  
    1.25 +if not 1 <= options.threshold <= len(players):
    1.26 +    parser.error("threshold out of range")
    1.27 +
    1.28  Zp = GF(find_prime(options.modulus))
    1.29  count = options.count
    1.30  print "I am player %d, will %s %d numbers" % (id, options.operation, count)
    1.31 @@ -296,7 +301,7 @@
    1.32  else:
    1.33      benchmark = SequentialBenchmark
    1.34  
    1.35 -pre_runtime = create_runtime(id, players, max((len(players) -1)//3, 1),
    1.36 +pre_runtime = create_runtime(id, players, options.threshold,
    1.37                               options, runtime_class)
    1.38  pre_runtime.addCallback(benchmark, operation)
    1.39