MAGMA  magma-1.4.0
Matrix Algebra on GPU and Multicore Architectures
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups
lapack_testing.py
Go to the documentation of this file.
1 #! /usr/bin/env python
2 # -*- coding: utf-8 -*-
3 
4 import os
5 import sys
6 
7 filename = "testing_results.txt"
8 
9 # erase the file if it exists
10 f = open(filename, "w")
11 f.close()
12 
13 # Add current directory to the path for subshells of this shell
14 # Allows the popen to find local files in both windows and unix
15 os.environ["PATH"] += ":."
16 
17 print
18 print '---------------- LAPACK LIN Testing with MAGMA ----------------'
19 print
20 print '-- Detailed results are stored in', filename
21 
22 dtypes = (
23  ("s", "d", "c", "z"),
24  ("Single", "Double", "Complex", "Double Complex"),
25 )
26 for dtype in range( len( dtypes[0] )):
27  letter = dtypes[0][dtype]
28  name = dtypes[1][dtype]
29  print
30  print "------------------------- %s ------------------------" % name
31  print
32  sys.stdout.flush() # make sure progress of testing is shown
33  f = open(filename, "a")
34  test1 = os.popen("xlintst%s < %stest.in" % (letter, letter))
35  for line in test1.readlines():
36  f.write( line )
37  if "passed" in line : print line,
38  if "failed" in line : print "\n Failure =======>", line
39  if "recorded" in line : print "\n ===>", line
40  f.close()