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 wrap: on
line diff
--- a/apps/benchmark.py	Tue Oct 07 21:11:00 2008 +0200
+++ b/apps/benchmark.py	Wed Oct 08 11:20:27 2008 +0200
@@ -106,6 +106,8 @@
                   help="use PRSS for preprocessing")
 parser.add_option("--hyper", action="store_false", dest="prss",
                   help="use hyperinvertible matrices for preprocessing")
+parser.add_option("-t", "--threshold", type="int",
+                  help="corruption threshold")
 parser.add_option("-c", "--count", type="int",
                   help="number of operations")
 parser.add_option("-o", "--operation", type="choice", choices=operations,
@@ -115,7 +117,7 @@
 parser.add_option("-s", "--sequential", action="store_false", dest="parallel",
                   help="execute operations in sequence")
 
-parser.set_defaults(modulus=2**65, count=10,
+parser.set_defaults(modulus=2**65, threshold=1, count=10,
                     active=False, twoplayer=False, prss=True,
                     operation=operations[0], parallel=True)
 
@@ -129,6 +131,9 @@
 
 id, players = load_config(args[0])
 
+if not 1 <= options.threshold <= len(players):
+    parser.error("threshold out of range")
+
 Zp = GF(find_prime(options.modulus))
 count = options.count
 print "I am player %d, will %s %d numbers" % (id, options.operation, count)
@@ -296,7 +301,7 @@
 else:
     benchmark = SequentialBenchmark
 
-pre_runtime = create_runtime(id, players, max((len(players) -1)//3, 1),
+pre_runtime = create_runtime(id, players, options.threshold,
                              options, runtime_class)
 pre_runtime.addCallback(benchmark, operation)