diff options
author | 2011-08-17 00:26:52 +0200 | |
---|---|---|
committer | 2011-08-17 00:26:52 +0200 | |
commit | 5097bc3de82221a6ad0e04ab1cf4876b24ab0015 (patch) | |
tree | dfcbb10fbc45037fe307325e52a51972430a001d | |
parent | Added default to --help. Better documentation. (diff) | |
download | auto-numerical-bench-5097bc3de82221a6ad0e04ab1cf4876b24ab0015.tar.gz auto-numerical-bench-5097bc3de82221a6ad0e04ab1cf4876b24ab0015.tar.bz2 auto-numerical-bench-5097bc3de82221a6ad0e04ab1cf4876b24ab0015.zip |
Solved the test suit execution log issue. More documentation about logs.
-rw-r--r-- | basemodule.py | 2 | ||||
-rw-r--r-- | benchprint.py | 34 | ||||
-rw-r--r-- | blas_accuracy.py | 4 | ||||
-rw-r--r-- | btlbase.py | 4 | ||||
-rw-r--r-- | doc/numbench.1 | 22 | ||||
-rw-r--r-- | lapack_accuracy.py | 4 | ||||
-rwxr-xr-x | main.py | 3 | ||||
-rw-r--r-- | 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') @@ -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') @@ -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(): |