From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1QtRoF-0007u3-5J for garchives@archives.gentoo.org; Tue, 16 Aug 2011 22:08:31 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 632AF21C29E; Tue, 16 Aug 2011 22:08:23 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 049E921C29E for ; Tue, 16 Aug 2011 22:08:22 +0000 (UTC) Received: from pelican.gentoo.org (unknown [66.219.59.40]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 3AA561B4058 for ; Tue, 16 Aug 2011 22:08:22 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id 914C180040 for ; Tue, 16 Aug 2011 22:08:21 +0000 (UTC) From: "Andrea Arteaga" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Andrea Arteaga" Message-ID: Subject: [gentoo-commits] proj/auto-numerical-bench:master commit in: /, doc/ X-VCS-Repository: proj/auto-numerical-bench X-VCS-Files: blastests.in doc/numbench.1 main.py X-VCS-Directories: / doc/ X-VCS-Committer: spiros X-VCS-Committer-Name: Andrea Arteaga X-VCS-Revision: f5e4e18523820339f062696d7f337e5f3c8a28a7 Date: Tue, 16 Aug 2011 22:08:21 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: X-Archives-Hash: 53e112566bbe9e23e105f2ed3b1b1dcf commit: f5e4e18523820339f062696d7f337e5f3c8a28a7 Author: Andrea Arteaga gmail com> AuthorDate: Tue Aug 16 22:07:29 2011 +0000 Commit: Andrea Arteaga gmail com> CommitDate: Tue Aug 16 22:07:29 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/auto-numerica= l-bench.git;a=3Dcommit;h=3Df5e4e185 Added default to --help. Better documentation. --- blastests.in | 16 +++++++++- doc/numbench.1 | 5 +++ main.py | 85 ++++++++------------------------------------------= ----- 3 files changed, 32 insertions(+), 74 deletions(-) diff --git a/blastests.in b/blastests.in index 4a6900d..b31b19f 100644 --- a/blastests.in +++ b/blastests.in @@ -1,8 +1,20 @@ # Testing almost all implementations using gcc-4.6.1 and enabling vector= ization =20 +# blas-reference is implemented in Fortran: set environment variables th= at are relevant for Fortran. blas-reference sci-libs/blas-reference-3.3.1-r1 FC=3Dgfortran-4.5.2 FFLA= GS=3D"-O3 -pipe -march=3Dnative -msse3 -msse4.1 -msse4.2" + +# ACML is a compiled library (no compiler/flags variables affect the res= ult). +# Depending on the USE flags, different implementations for both 32 and = 64 bits are installed. +# Use the -implementation syntax to mask them. acml sci-libs/acml-4.4.0-r1 -acml32-gfortran -acml32-gfortran-openmp -ac= ml64-gfortran-openmp + +# The gotoblas and openblas need the variable TARGET to be set for some = CPUs (e.g. for Nehalem) +# The use flags incblas installs the CBLAS interface, too. goto sci-libs/gotoblas2-1.13 CFLAGS=3D"-O3 -march=3Dnative" USE=3D'incbl= as' TARGET=3DNEHALEM -atlas sci-libs/atlas-3.9.41 CC=3Dgcc-4.6.1 CFLAGS=3D"-O3 -pipe -march=3D= native -msse3 -msse4.1 -msse4.2" openblas sci-libs/openblas CC=3Dgcc-4.6.1 CFLAGS=3D"-O3 -pipe -march=3Dn= ative -msse3 -msse4.1 -msse4.2" USE=3Dincblas TARGET=3DNEHALEM -eigen dev-cpp/eigen-3.0.1-r1 CC=3Dgcc-4.6.1 CXX=3Dg++-4.6.1 CFLAGS=3D"-O= 3 -pipe -march=3Dnative -msse3 -msse4.1 -msse4.2" CXXFLAGS=3D"-O3 -pipe -= march=3Dnative -msse3 -msse4.1 -msse4.2" + +# ATLAS is implemented in C: set flags for C +atlas sci-libs/atlas-3.9.41 CC=3Dgcc-4.6.1 CFLAGS=3D"-O3 -pipe -march=3D= native -msse3 -msse4.1 -msse4.2" + +# Eigen is mostly implemented in C++, with some C code. Set flags for bo= th languages. +eigen dev-cpp/eigen-3.0.1-r1 CC=3Dgcc-4.6.1 CXX=3Dg++-4.6.1 CFLAGS=3D"-O= 3 -pipe -march=3Dnative -msse3 -msse4.1 -msse4.2" CXXFLAGS=3D"-O3 -pipe -= march=3Dnative -msse3 -msse4.1 -msse4.2" \ No newline at end of file diff --git a/doc/numbench.1 b/doc/numbench.1 index f3aa0a6..1680889 100644 --- a/doc/numbench.1 +++ b/doc/numbench.1 @@ -117,3 +117,8 @@ this to work): .RS atlas sci-libs/atlas-3.9.46 blas:openblas .RE + +.PP +Some examples of configuration files are available in the directory +/usr/share/numbench/samples. Please refer to those files to see some det= ailed +working configuration files. \ No newline at end of file diff --git a/main.py b/main.py index 539e4ff..0a7d304 100755 --- a/main.py +++ b/main.py @@ -10,17 +10,10 @@ def print_usage(): =20 def print_help(): print "Usage: numbench module conffile [options]" - print " numbench module [-h|--help]" - print - print "numbench is a tool for compiling and benchmarking numerical" - print "libraries. It is useful to find out the implementations of co= mmon" - print "libraries that run faster on the machine and are more accurat= e." - print "The script makes use of the portage features in order to down= load," - print "compile, install and test the packages" - print + print " numbench [ -h | --help ]" + print " numbench module [ -h | --help ]" print print "Modules:" - print "The following modules are available:" print " blas - Test BLAS implementations" print " cblas - Test CBLAS implementations" print " lapack - Test LAPACK implementations" @@ -32,62 +25,6 @@ def print_help(): print print "More information about a module is available through the comm= and:" print " numbench module --help" - print - print - print "Config file:" - print "In order to run a test, a configuration file has to be provid= ed." - print "Each line of this file defines a package that is to be tested= ." - print "It is possible to test different versions of the same package= , or" - print "even to test many times the same package with different compi= le-time" - print "environment; for each different version or environment, a dif= ferent" - print "line has to be written." - print - print "Each line begins with an identification token of the test. Th= is" - print "identification can contain any characters, but it is recommen= ded" - print "that it only contains alphanumeric digits, the period . , the= minus" - print "sign - and the underscore _ ." - print "After the identification word, the package has to be provided= . The" - print "package specification should be fully provided, in the usual" - print "category/package-version[-revision] format. For instance" - print "sci-libs/lapack-reference-3.3.1-r1. However, the script will = try to" - print "choose the best package in case of lacking information." - print "After the package, the environment has to be specified. In or= der" - print "to do that, the user has to use the KEY=3DVALUE format. If th= e value" - print "contains a whitespace, the single or double quoting marks hav= e to be" - print "used. The following are two valid configuration lines that de= fine" - print "the tests for the sci-libs/atlas package with different compi= lers" - print "and CFLAGS:" - print - print "atlas-gcc sci-libs/atlas-3.9.46 CC=3Dgcc CFLAGS=3D-O2" - print "atlas-gcc-4.6.1 sci-libs/atlas-3.9.46 CC=3Dgcc-4.6.1", - print "CFLAGS=3D\"-O3 -march=3Dnative\"" - print - print "Variables that affect the emerge process, such as USE, can be= used" - print "and are effective." - print "More configuration options are available. As each package can= " - print "install many implementations of the same library (for instanc= e, the" - print "sci-libs/atlas package installs the serial version and the" - print "parallelized version with threads or openmp, depending on the= USE" - print "flags), each implementation is tested; but if you do not want= to" - print "test a specific implementation, you can mask it by adding to = the" - print "configuration line the string '-implementation' (without quot= ing" - print "marks); then the script will skip the implementation. The fol= lowing" - print "is an example where the 32-bit implementations of the acml ar= e" - print "skipped:" - print - print "acml sci-libs/acml-4.4.0 -acml32-gfortran -acml32-gfortran-op= enmp" - print - print "The last configuration option that can be used is for librari= es that" - print "internally use other libraries. For example, most LAPACK" - print "implementations lie on BLAS and/or CBLAS implementations. It = is" - print "possible to make the tested LAPACK implementation use a speci= fic" - print "BLAS implementation through the 'blas:implementation' (withou= t" - print "quotation marks) format. For instance, the following line" - print "defines a test where the atlas LAPACK implementation uses the= " - print "openblas library as BLAS and CBLAS (openblas has to be instal= led for" - print "this to work):" - print - print "atlas sci-libs/atlas-3.9.46 blas:openblas" =20 def tests_from_input(input): tests =3D {} @@ -122,8 +59,18 @@ def tests_from_input(input): sys.stderr.write('Error: package ' + spl[1] + ' not found\n'= ) return tests =20 + +########################## +# HERE BEGINS THE SCRIPT # +########################## + import benchconfig as cfg =20 +# If no argument is given, print the help +if (len(sys.argv) < 2): + print_help() + exit(0) + =20 # Import the desired module or print help and exit try: @@ -288,13 +235,7 @@ for tn,(name,test) in enumerate(cfg.tests.items(),1)= : print =20 =20 -# Reports will be saved in cfg.reportdir - -# Results are reordered: -# results -# |-(name1, impl1) -> resultobject11 -# |-(name1, impl2) -> resultobject12 -# |-(name2, impl1) -> resultobject21 =20 +# Save the results (first re-order them) =20 results =3D {} for (name,test) in cfg.tests.items(): if test.has_key('implementations'):