viff

changeset 1293:6952e7a560f8

benchmark: wrapped long string literals and docstrings
author Martin Geisler <mg@cs.au.dk>
date Fri, 16 Oct 2009 19:08:46 +0200
parents 9c49d09e2dac
children cefcb223c892
files apps/benchmark.py apps/benchmark_classes.py
diffstat 2 files changed, 19 insertions(+), 9 deletions(-) [+]
line diff
     1.1 --- a/apps/benchmark.py	Fri Oct 16 19:04:04 2009 +0200
     1.2 +++ b/apps/benchmark.py	Fri Oct 16 19:08:46 2009 +0200
     1.3 @@ -128,11 +128,18 @@
     1.4  parser.add_option("-f", "--fake", action="store_true",
     1.5                    help="skip local computations using fake field elements")
     1.6  parser.add_option("--args", type="string",
     1.7 -                  help="additional arguments to the runtime, the format is a comma separated list of id=value pairs e.g. --args s=1,d=0,lambda=1")
     1.8 +                  help=("additional arguments to the runtime, the format is "
     1.9 +                        "a comma separated list of id=value pairs e.g. "
    1.10 +                        "--args s=1,d=0,lambda=1"))
    1.11  parser.add_option("--needed_data", type="string",
    1.12 -                  help="name of a file containing already computed dictionary of needed_data. Useful for skipping generating the needed data, which usually elliminates half the execution time. Format of file: \"{('random_triple', (Zp,)): [(3, 1), (3, 4)]}\"")
    1.13 +                  help=("name of a file containing already computed "
    1.14 +                        "dictionary of needed_data. Useful for skipping "
    1.15 +                        "generating the needed data, which usually "
    1.16 +                        "elliminates half the execution time. Format of file: "
    1.17 +                        "\"{('random_triple', (Zp,)): [(3, 1), (3, 4)]}\""))
    1.18  parser.add_option("--pc", type="string",
    1.19 -                  help="The program counter to start from when using explicitly provided needed_data. Format: [3,0]")
    1.20 +                  help=("The program counter to start from when using "
    1.21 +                        "explicitly provided needed_data. Format: [3,0]"))
    1.22  
    1.23  parser.set_defaults(modulus=2**65, threshold=1, count=10,
    1.24                      runtime="PassiveRuntime", mixins="", num_players=2, prss=True,
     2.1 --- a/apps/benchmark_classes.py	Fri Oct 16 19:04:04 2009 +0200
     2.2 +++ b/apps/benchmark_classes.py	Fri Oct 16 19:08:46 2009 +0200
     2.3 @@ -47,8 +47,9 @@
     2.4  class Benchmark(object):
     2.5      """Abstract base class for all Benchmarks.
     2.6  
     2.7 -    For concrete classes see the `ParallelBenchmark` and `SequentialBenchmark` classes.
     2.8 -    A concrete class must be mixed with a `BenchmarkStrategy` and an `Operator`.
     2.9 +    For concrete classes see the `ParallelBenchmark` and
    2.10 +    `SequentialBenchmark` classes. A concrete class must be mixed with
    2.11 +    a `BenchmarkStrategy` and an `Operator`.
    2.12      """
    2.13  
    2.14      def __init__(self, rt, operation, field, count):
    2.15 @@ -127,7 +128,8 @@
    2.16  
    2.17  
    2.18  class SequentialBenchmark(Benchmark):
    2.19 -    """A benchmark where the operations are executed one after each other."""
    2.20 +    """A benchmark where the operations are executed one after each
    2.21 +    other."""
    2.22  
    2.23      def run_test(self, _, termination_function, d):
    2.24          record_start("sequential test")
    2.25 @@ -222,7 +224,8 @@
    2.26  
    2.27  
    2.28  class SelfcontainedBenchmarkStrategy(BenchmarkStrategy):
    2.29 -    """In a self contained benchmark strategy, all the needed data is generated on the fly."""
    2.30 +    """In a self contained benchmark strategy, all the needed data is
    2.31 +    generated on the fly."""
    2.32  
    2.33      def benchmark(self, *args):
    2.34          sys.stdout.flush()
    2.35 @@ -233,8 +236,8 @@
    2.36  
    2.37  
    2.38  class NeededDataBenchmarkStrategy(BenchmarkStrategy):
    2.39 -    """In a needed data benchmark strategy, all the needed data has to have been generated
    2.40 -    before the test is run."""
    2.41 +    """In a needed data benchmark strategy, all the needed data has to
    2.42 +    have been generated before the test is run."""
    2.43  
    2.44      def benchmark(self, needed_data, pc, *args):
    2.45          self.pc = pc