public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] proj/auto-numerical-bench:master commit in: /, doc/
@ 2011-08-16 22:08 Andrea Arteaga
  0 siblings, 0 replies; 2+ messages in thread
From: Andrea Arteaga @ 2011-08-16 22:08 UTC (permalink / raw
  To: gentoo-commits

commit:     f5e4e18523820339f062696d7f337e5f3c8a28a7
Author:     Andrea Arteaga <andyspiros <AT> gmail <DOT> com>
AuthorDate: Tue Aug 16 22:07:29 2011 +0000
Commit:     Andrea Arteaga <andyspiros <AT> gmail <DOT> com>
CommitDate: Tue Aug 16 22:07:29 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/auto-numerical-bench.git;a=commit;h=f5e4e185

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 vectorization
 
+# blas-reference is implemented in Fortran: set environment variables that are relevant for Fortran.
 blas-reference sci-libs/blas-reference-3.3.1-r1 FC=gfortran-4.5.2 FFLAGS="-O3 -pipe -march=native -msse3 -msse4.1 -msse4.2"
+
+# ACML is a compiled library (no compiler/flags variables affect the result).
+# 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 -acml64-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="-O3 -march=native" USE='incblas' TARGET=NEHALEM
-atlas sci-libs/atlas-3.9.41 CC=gcc-4.6.1 CFLAGS="-O3 -pipe -march=native -msse3 -msse4.1 -msse4.2"
 openblas sci-libs/openblas CC=gcc-4.6.1 CFLAGS="-O3 -pipe -march=native -msse3 -msse4.1 -msse4.2" USE=incblas TARGET=NEHALEM
-eigen dev-cpp/eigen-3.0.1-r1 CC=gcc-4.6.1 CXX=g++-4.6.1 CFLAGS="-O3 -pipe -march=native -msse3 -msse4.1 -msse4.2" CXXFLAGS="-O3 -pipe -march=native -msse3 -msse4.1 -msse4.2"
+
+# ATLAS is implemented in C: set flags for C
+atlas sci-libs/atlas-3.9.41 CC=gcc-4.6.1 CFLAGS="-O3 -pipe -march=native -msse3 -msse4.1 -msse4.2"
+
+# Eigen is mostly implemented in C++, with some C code. Set flags for both languages.
+eigen dev-cpp/eigen-3.0.1-r1 CC=gcc-4.6.1 CXX=g++-4.6.1 CFLAGS="-O3 -pipe -march=native -msse3 -msse4.1 -msse4.2" CXXFLAGS="-O3 -pipe -march=native -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 detailed
+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():
 
 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 common"
-    print "libraries that run faster on the machine and are more accurate."
-    print "The script makes use of the portage features in order to download,"
-    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 command:"
     print "  numbench module --help"
-    print
-    print
-    print "Config file:"
-    print "In order to run a test, a configuration file has to be provided."
-    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 compile-time"
-    print "environment; for each different version or environment, a different"
-    print "line has to be written."
-    print
-    print "Each line begins with an identification token of the test. This"
-    print "identification can contain any characters, but it is recommended"
-    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 order"
-    print "to do that, the user has to use the KEY=VALUE format. If the value"
-    print "contains a whitespace, the single or double quoting marks have to be"
-    print "used. The following are two valid configuration lines that define"
-    print "the tests for the sci-libs/atlas package with different compilers"
-    print "and CFLAGS:"
-    print
-    print "atlas-gcc sci-libs/atlas-3.9.46 CC=gcc CFLAGS=-O2"
-    print "atlas-gcc-4.6.1 sci-libs/atlas-3.9.46 CC=gcc-4.6.1",
-    print "CFLAGS=\"-O3 -march=native\""
-    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 instance, 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 quoting"
-    print "marks); then the script will skip the implementation. The following"
-    print "is an example where the 32-bit implementations of the acml are"
-    print "skipped:"
-    print
-    print "acml sci-libs/acml-4.4.0 -acml32-gfortran -acml32-gfortran-openmp"
-    print
-    print "The last configuration option that can be used is for libraries 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 specific"
-    print "BLAS implementation through the 'blas:implementation' (without"
-    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 installed for"
-    print "this to work):"
-    print
-    print "atlas sci-libs/atlas-3.9.46 blas:openblas"
     
 def tests_from_input(input):
     tests = {}
@@ -122,8 +59,18 @@ def tests_from_input(input):
             sys.stderr.write('Error: package ' + spl[1] + ' not found\n')
     return tests
 
+
+##########################
+# HERE BEGINS THE SCRIPT #
+##########################
+
 import benchconfig as cfg
 
+# If no argument is given, print the help
+if (len(sys.argv) < 2):
+    print_help()
+    exit(0)
+
 
 # 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
     
 
-# Reports will be saved in cfg.reportdir
-
-# Results are reordered:
-# results
-# |-(name1, impl1) -> resultobject11
-# |-(name1, impl2) -> resultobject12
-# |-(name2, impl1) -> resultobject21        
+# Save the results (first re-order them)     
 results = {}
 for (name,test) in cfg.tests.items():
     if test.has_key('implementations'):



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [gentoo-commits] proj/auto-numerical-bench:master commit in: /, doc/
@ 2011-08-16 22:27 Andrea Arteaga
  0 siblings, 0 replies; 2+ messages in thread
From: Andrea Arteaga @ 2011-08-16 22:27 UTC (permalink / raw
  To: gentoo-commits

commit:     5097bc3de82221a6ad0e04ab1cf4876b24ab0015
Author:     Andrea Arteaga <andyspiros <AT> gmail <DOT> com>
AuthorDate: Tue Aug 16 22:26:52 2011 +0000
Commit:     Andrea Arteaga <andyspiros <AT> gmail <DOT> com>
CommitDate: Tue Aug 16 22:26:52 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/auto-numerical-bench.git;a=commit;h=5097bc3d

Solved the test suit execution log issue. More documentation about logs.

---
 basemodule.py      |    2 +-
 benchprint.py      |   34 ++++++++++++++++------------------
 blas_accuracy.py   |    4 ++--
 btlbase.py         |    4 ++--
 doc/numbench.1     |   22 +++++++++++++++++++++-
 lapack_accuracy.py |    4 ++--
 main.py            |    3 +++
 scalapack.py       |    5 +++--
 8 files changed, 50 insertions(+), 28 deletions(-)

diff --git a/basemodule.py b/basemodule.py
index 7eda37f..c04b56c 100644
--- a/basemodule.py
+++ b/basemodule.py
@@ -259,7 +259,7 @@ class BaseTest:
         
         # Run test
         logfile = pjoin(self.logdir, name+"_run.log")
-        retcode = self._executeTest(exe)
+        retcode = self._executeTest(exe, logfile=logfile)
         if retcode != 0:
             Print("Test failed")
             Print("See log: " + logfile)

diff --git a/benchprint.py b/benchprint.py
index 0836bbe..9cca417 100644
--- a/benchprint.py
+++ b/benchprint.py
@@ -15,30 +15,28 @@ if needsinitialization:
             self._logfile = logfile
         
         def __call__(self, arg='\n'):
-            if self._level > self._maxlevel:
-                return
-                
-            if self._level <= 0:
-                print str(arg)
-                bu.mkdir(dirname(self._logfile))
-                logfile = file(self._logfile, 'a')
-                print >> logfile, str(arg)
-                logfile.close()
-                return
-                
-            printstr = (self._level-1)*"  " + "-- " + str(arg)
-            if self._level <= self._maxlevel-1:
-                bu.mkdir(dirname(self._logfile))
-                logfile = file(self._logfile, 'a')
-                print >> logfile, printstr
-                logfile.close()
-            print printstr
+            printstr = str(arg)
+            if self._level > 0:
+                printstr = (self._level-1)*"  " + "-- " + printstr
+            
+            # Print to logfile
+            bu.mkdir(dirname(self._logfile))
+            logfile = file(self._logfile, 'a')
+            print >> logfile, str(arg)
+            logfile.close()
+            
+            # Print to terminal
+            if self._level <= self._maxlevel:
+                print printstr
             
         def up(self, n=1):
             self._level = max(self._level-n, 0)
         
         def down(self, n=1):
             self._level = max(self._level+n, 0)
+            
+    # Initialize main Print object ("static")
     Print = _Print(pjoin(cfg.logdir, 'main.log'), 3)
 
+
 initialized = True

diff --git a/blas_accuracy.py b/blas_accuracy.py
index c0e9915..99f1cd4 100644
--- a/blas_accuracy.py
+++ b/blas_accuracy.py
@@ -110,13 +110,13 @@ class BLAS_accuracyTest(basemodule.BaseTest):
         return proc.returncode, exe, logfile.name
     
     
-    def _executeTest(self, exe):
+    def _executeTest(self, exe, logfile):
         # Log dynamic link
         lddlogfile = file(pjoin(self.logdir, 'ldd.log'), 'w')
         sp.Popen(['ldd', '-v', exe], stdout=lddlogfile, env=self.runenv).wait()
         
         # Open pipe
-        logfile = file(pjoin(self.logdir, 'run.log'), 'w')
+        logfile = file(logfile, 'w')
         args = [exe] + self.tests
         logfile.write(' '.join([n+'='+v for n,v in self.runenv.items()]) + ' ')
         logfile.write(' '.join(args) + '\n')

diff --git a/btlbase.py b/btlbase.py
index 84ec1c6..d64b1ed 100644
--- a/btlbase.py
+++ b/btlbase.py
@@ -112,13 +112,13 @@ class BTLTest(basemodule.BaseTest):
         logfile.close()
         return proc.returncode, exe, logfile.name
     
-    def _executeTest(self, exe, preargs=[]):
+    def _executeTest(self, exe, logfile, preargs=[]):
         # Log dynamic link
         lddlogfile = file(pjoin(self.logdir, 'ldd.log'), 'w')
         sp.Popen(['ldd', '-v', exe], stdout=lddlogfile, env=self.runenv).wait()
         
         # Open pipe
-        logfile = file(pjoin(self.logdir, 'btlrun.log'), 'w')
+        logfile = file(logfile, 'w')
         args = preargs + [exe] + list(self.tests)
         logfile.write(' '.join( \
           [n + '="'+v+'"' for n,v in self.runenv.items()]  ) + ' ')

diff --git a/doc/numbench.1 b/doc/numbench.1
index 1680889..f7c3905 100644
--- a/doc/numbench.1
+++ b/doc/numbench.1
@@ -121,4 +121,24 @@ atlas sci-libs/atlas-3.9.46 blas:openblas
 .PP
 Some examples of configuration files are available in the directory
 /usr/share/numbench/samples. Please refer to those files to see some detailed
-working configuration files.
\ No newline at end of file
+working configuration files.
+
+
+.SS Logs
+
+.PP
+A complete set of log is saved during the execution of the script. The script
+itself will print at the beginning the directory where the logs are saved.
+In the directory you will find the file main.log, which contains everything
+that is written to the terminal and a directory for each test which is defined
+in the configuration file. Each of them contains the log of the emerge process
+(if any) and a directory for each implementation found, which in turn contains
+a log for the pkg-config process, one for the compilation of the test suite,
+one that checks whether the linking is correct and finally the test suit
+execution log.
+
+.PP
+The logs are present only if the related process has been performed. For
+instance, no log is available for the emerge process if the package was already
+compiled. Please refer to the main.log file to see which processes have been
+skipped.
\ No newline at end of file

diff --git a/lapack_accuracy.py b/lapack_accuracy.py
index ef0c504..3f66547 100644
--- a/lapack_accuracy.py
+++ b/lapack_accuracy.py
@@ -115,13 +115,13 @@ class LAPACK_accuracyTest(basemodule.BaseTest):
         return proc.returncode, exe, logfile.name
     
     
-    def _executeTest(self, exe):
+    def _executeTest(self, exe, logfile):
         # Log dynamic link
         lddlogfile = file(pjoin(self.logdir, 'ldd.log'), 'w')
         sp.Popen(['ldd', '-v', exe], stdout=lddlogfile, env=self.runenv).wait()
         
         # Open pipe
-        logfile = file(pjoin(self.logdir, 'run.log'), 'w')
+        logfile = file(logfile, 'w')
         args = [exe] + self.tests
         logfile.write(' '.join([n+'='+v for n,v in self.runenv.items()]) + ' ')
         logfile.write(' '.join(args) + '\n')

diff --git a/main.py b/main.py
index 0a7d304..f71de0b 100755
--- a/main.py
+++ b/main.py
@@ -166,6 +166,9 @@ for tname, ttest in cfg.tests.items():
     print
 print 80*'='
 print
+print "The logs will be available in the directory " + cfg.logdir
+print "The results will be available in the directory " + cfg.reportdir
+print
 
 for tn,(name,test) in enumerate(cfg.tests.items(),1):
     Print._level = 0

diff --git a/scalapack.py b/scalapack.py
index 1d38782..54f79cb 100644
--- a/scalapack.py
+++ b/scalapack.py
@@ -53,8 +53,9 @@ class ScaLAPACKTest(btlbase.BTLTest):
               + " run the scalapack tests.")
         return shlex.split(out)[1:] + btlbase.BTLTest._get_flags(self)
     
-    def _executeTest(self, exe):
-        btlbase.BTLTest._executeTest(self, exe, ['mpirun', '-n', str(numproc)])
+    def _executeTest(self, exe, logfile):
+        btlbase.BTLTest._executeTest(self, exe, logfile, \
+          ['mpirun', '-n', str(numproc)])
     
     @staticmethod
     def _btl_source():



^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-08-16 22:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-08-16 22:08 [gentoo-commits] proj/auto-numerical-bench:master commit in: /, doc/ Andrea Arteaga
  -- strict thread matches above, loose matches on Subject: below --
2011-08-16 22:27 Andrea Arteaga

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox