# HG changeset patch # User Thomas Pelle Jakobsen <[EMAIL PROTECTED]> # Date 1226015362 -3600 # Node ID aa8ba57c7833f0d68792db7c36782e3ba9fbc194 # Parent dd640eac89c544273c9e1a7230af6b44c975bf01 Added example benchmark suite.
diff -r dd640eac89c5 -r aa8ba57c7833 apps/benchmark/example.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/apps/benchmark/example.py Fri Nov 07 00:49:22 2008 +0100 @@ -0,0 +1,104 @@ +#!/usr/bin/python +# +# Copyright 2007, 2008 VIFF Development Team. +# +# This file is part of VIFF, the Virtual Ideal Functionality Framework. +# +# VIFF is free software: you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License (LGPL) as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# VIFF is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General +# Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with VIFF. If not, see <http://www.gnu.org/licenses/>. + +from database import Database +from suite import Suite +from examples.ComparisonToft05 import ComparisonToft05 +from examples.LocalMult import LocalMult +import sys + +if __name__ == "__main__": + database = Database(host="localhost", + db="viff_benchmark", + user="root", + passwd=sys.argv[1]) + + """ + These statements reset the database and define the needed attributes + and hosts. They should only be executed once for a certain benchmark + database. + + TODO: Move the predefined attributes, e.g. n, threshold, etc. to + constructors of Benchmark and VIFFBenchmark. Ideally, user should only + need to add the attributes that are specific for his benchmarks. + + TODO: Make sure that adding an already existing host causes no harm. + """ + database.reset() + database.add_host("camel17.daimi.au.dk") + database.add_host("camel18.daimi.au.dk") + database.add_host("camel19.daimi.au.dk") + database.add_host("camel21.daimi.au.dk") + database.add_host("camel22.daimi.au.dk") + database.add_attribute(name="execution_time", label="microseconds") + database.add_attribute(name="runs") + database.add_attribute(name="benchmark_id") # Redundant, but still need it. + database.add_attribute(name="db_user", type=Database.AttributeType.String) + database.add_attribute(name="db_passwd", type=Database.AttributeType.String) + database.add_attribute(name="db_name", type=Database.AttributeType.String) + database.add_attribute(name="db_host", type=Database.AttributeType.String) + database.add_attribute(name="db_port") + database.add_attribute(name="n") + database.add_attribute(name="threshold") + database.add_attribute(name="modulus", type=Database.AttributeType.String) + database.add_attribute(name="use_ssl", enum=['False', 'True'], + type=Database.AttributeType.Enumeration) + + + + s = Suite(#hg_repository="http://hg.viff.dk/viff", + revision="383e6bfb4863", + database=database, + user="mas", + viff_dir="$HOME/opt", + work_dir="/users/mas/temp/viff-benchmark", + hosts=[("camel17.daimi.au.dk", 9734), + ("camel18.daimi.au.dk", 9843), + ("camel19.daimi.au.dk", 9962), + ("camel21.daimi.au.dk", 9963), + ("camel22.daimi.au.dk", 9964)]) + + s.add_benchmark(ComparisonToft05({\ + 'runs': 10, \ + 'n': 3, \ + 'threshold': 1, \ + 'modulus': 30916444023318367583, \ + 'db_user': 'viff_benchmark', + 'db_host': 'tpj.dyndns.org', + 'db_passwd': sys.argv[2], + 'use_ssl': "True"})) + + s.add_benchmark(ComparisonToft05({\ + 'runs': 10, \ + 'n': 5, \ + 'threshold': 2, \ + 'modulus': 30916444023318367583, \ + 'db_user': 'viff_benchmark', + 'db_host': 'tpj.dyndns.org', + 'db_passwd': sys.argv[2], + 'use_ssl': "True"})) + + s.add_benchmark(LocalMult({ + 'runs': 5, + 'modulus': 30916444023318367583, + 'db_user': 'viff_benchmark', + 'db_host': 'tpj.dyndns.org', + 'db_passwd': sys.argv[2]})) + + s.run() _______________________________________________ viff-patches mailing list [email protected] http://lists.viff.dk/listinfo.cgi/viff-patches-viff.dk
