Add tests for DMD (Reference-LAPACK PR 736)
This commit is contained in:
parent
fa03e5497a
commit
c5fa318add
|
@ -1,31 +1,29 @@
|
||||||
#! /usr/bin/env python
|
#!/usr/bin/env python3
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
# lapack_testing.py
|
# lapack_testing.py
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
||||||
from __future__ import print_function
|
|
||||||
from subprocess import Popen, STDOUT, PIPE
|
from subprocess import Popen, STDOUT, PIPE
|
||||||
import os, sys, math
|
import os, sys, math
|
||||||
import getopt
|
import getopt
|
||||||
# Arguments
|
# Arguments
|
||||||
try:
|
try:
|
||||||
opts, args = getopt.getopt(sys.argv[1:], "hd:b:srep:t:n",
|
opts, args = getopt.getopt(sys.argv[1:], "hd:b:srep:t:n",
|
||||||
["help", "dir", "bin", "short", "run", "error","prec=","test=","number"])
|
["help", "dir=", "bin=", "short", "run", "error","prec=","test=","number"])
|
||||||
|
|
||||||
except getopt.error as msg:
|
except getopt.error as msg:
|
||||||
print(msg)
|
print(msg)
|
||||||
print("for help use --help")
|
print("for help use --help")
|
||||||
sys.exit(2)
|
sys.exit(2)
|
||||||
|
|
||||||
short_summary=0
|
short_summary = False
|
||||||
with_file=1
|
with_file = True
|
||||||
just_errors = 0
|
just_errors = False
|
||||||
prec='x'
|
prec='x'
|
||||||
test='all'
|
test='all'
|
||||||
only_numbers=0
|
only_numbers = False
|
||||||
test_dir='TESTING'
|
test_dir='TESTING'
|
||||||
bin_dir='bin/Release'
|
bin_dir='bin/Release'
|
||||||
|
|
||||||
|
@ -34,10 +32,9 @@ for o, a in opts:
|
||||||
print(sys.argv[0]+" [-h|--help] [-d dir |--dir dir] [-s |--short] [-r |--run] [-e |--error] [-p p |--prec p] [-t test |--test test] [-n | --number]")
|
print(sys.argv[0]+" [-h|--help] [-d dir |--dir dir] [-s |--short] [-r |--run] [-e |--error] [-p p |--prec p] [-t test |--test test] [-n | --number]")
|
||||||
print(" - h is to print this message")
|
print(" - h is to print this message")
|
||||||
print(" - r is to use to run the LAPACK tests then analyse the output (.out files). By default, the script will not run all the LAPACK tests")
|
print(" - r is to use to run the LAPACK tests then analyse the output (.out files). By default, the script will not run all the LAPACK tests")
|
||||||
print(" - d [dir] is to indicate where is the LAPACK testing directory (.out files). By default, the script will use .")
|
print(" - d [dir] indicates the location of the LAPACK testing directory (.out files). By default, the script will use {:s}.".format(test_dir))
|
||||||
print(" - b [bin] is to indicate where is the LAPACK binary files are located. By default, the script will use .")
|
print(" - b [bin] indicates the location of the LAPACK binary files. By default, the script will use {:s}.".format(bin_dir))
|
||||||
print(" LEVEL OF OUTPUT")
|
print(" LEVEL OF OUTPUT")
|
||||||
print(" - x is to print a detailed summary")
|
|
||||||
print(" - e is to print only the error summary")
|
print(" - e is to print only the error summary")
|
||||||
print(" - s is to print a short summary")
|
print(" - s is to print a short summary")
|
||||||
print(" - n is to print the numbers of failing tests (turn on summary mode)")
|
print(" - n is to print the numbers of failing tests (turn on summary mode)")
|
||||||
|
@ -63,15 +60,14 @@ for o, a in opts:
|
||||||
print(" Will return the numbers of failed tests in REAL precision by running the LAPACK Tests then analyzing the output")
|
print(" Will return the numbers of failed tests in REAL precision by running the LAPACK Tests then analyzing the output")
|
||||||
print(" ./lapack_testing.py -n -p s -t eig ")
|
print(" ./lapack_testing.py -n -p s -t eig ")
|
||||||
print(" Will return the numbers of failed tests in REAL precision by analyzing only the LAPACK output of EIGEN testings")
|
print(" Will return the numbers of failed tests in REAL precision by analyzing only the LAPACK output of EIGEN testings")
|
||||||
print("Written by Julie Langou (June 2011) ")
|
|
||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
else:
|
else:
|
||||||
if o in ("-s", "--short"):
|
if o in ("-s", "--short"):
|
||||||
short_summary = 1
|
short_summary = True
|
||||||
if o in ("-r", "--run"):
|
if o in ("-r", "--run"):
|
||||||
with_file = 0
|
with_file = False
|
||||||
if o in ("-e", "--error"):
|
if o in ("-e", "--error"):
|
||||||
just_errors = 1
|
just_errors = True
|
||||||
if o in ( '-p', '--prec' ):
|
if o in ( '-p', '--prec' ):
|
||||||
prec = a
|
prec = a
|
||||||
if o in ( '-b', '--bin' ):
|
if o in ( '-b', '--bin' ):
|
||||||
|
@ -81,12 +77,12 @@ for o, a in opts:
|
||||||
if o in ( '-t', '--test' ):
|
if o in ( '-t', '--test' ):
|
||||||
test = a
|
test = a
|
||||||
if o in ( '-n', '--number' ):
|
if o in ( '-n', '--number' ):
|
||||||
only_numbers = 1
|
only_numbers = True
|
||||||
short_summary = 1
|
short_summary = True
|
||||||
|
|
||||||
# process options
|
# process options
|
||||||
|
|
||||||
abs_bin_dir=os.path.normpath(os.path.join(os.getcwd(),bin_dir))
|
abs_bin_dir=os.path.abspath(bin_dir)
|
||||||
|
|
||||||
os.chdir(test_dir)
|
os.chdir(test_dir)
|
||||||
|
|
||||||
|
@ -108,7 +104,7 @@ def run_summary_test( f, cmdline, short_summary):
|
||||||
nb_test_illegal=0
|
nb_test_illegal=0
|
||||||
nb_test_info=0
|
nb_test_info=0
|
||||||
|
|
||||||
if (with_file):
|
if with_file:
|
||||||
if not os.path.exists(cmdline):
|
if not os.path.exists(cmdline):
|
||||||
error_message=cmdline+" file not found"
|
error_message=cmdline+" file not found"
|
||||||
r=1
|
r=1
|
||||||
|
@ -145,16 +141,16 @@ def run_summary_test( f, cmdline, short_summary):
|
||||||
whereisrun=words_in_line.index("run)")
|
whereisrun=words_in_line.index("run)")
|
||||||
nb_test_run+=int(words_in_line[whereisrun-2])
|
nb_test_run+=int(words_in_line[whereisrun-2])
|
||||||
if (line.find("out of")!=-1):
|
if (line.find("out of")!=-1):
|
||||||
if (short_summary==0): print(line, end=' ')
|
if not short_summary: print(line, end=' ')
|
||||||
whereisout= words_in_line.index("out")
|
whereisout= words_in_line.index("out")
|
||||||
nb_test_fail+=int(words_in_line[whereisout-1])
|
nb_test_fail+=int(words_in_line[whereisout-1])
|
||||||
if ((line.find("illegal")!=-1) or (line.find("Illegal")!=-1)):
|
if ((line.find("illegal")!=-1) or (line.find("Illegal")!=-1)):
|
||||||
if (short_summary==0):print(line, end=' ')
|
if not short_summary: print(line, end=' ')
|
||||||
nb_test_illegal+=1
|
nb_test_illegal+=1
|
||||||
if (line.find(" INFO")!=-1):
|
if (line.find(" INFO")!=-1):
|
||||||
if (short_summary==0):print(line, end=' ')
|
if not short_summary: print(line, end=' ')
|
||||||
nb_test_info+=1
|
nb_test_info+=1
|
||||||
if (with_file==1):
|
if with_file:
|
||||||
pipe.close()
|
pipe.close()
|
||||||
|
|
||||||
f.flush();
|
f.flush();
|
||||||
|
@ -169,7 +165,7 @@ try:
|
||||||
except IOError:
|
except IOError:
|
||||||
f = sys.stdout
|
f = sys.stdout
|
||||||
|
|
||||||
if (short_summary==0):
|
if not short_summary:
|
||||||
print(" ")
|
print(" ")
|
||||||
print("---------------- Testing LAPACK Routines ----------------")
|
print("---------------- Testing LAPACK Routines ----------------")
|
||||||
print(" ")
|
print(" ")
|
||||||
|
@ -203,6 +199,8 @@ elif test=='mixed':
|
||||||
range_prec=[1,3]
|
range_prec=[1,3]
|
||||||
elif test=='rfp':
|
elif test=='rfp':
|
||||||
range_test=[18]
|
range_test=[18]
|
||||||
|
elif test=='dmd':
|
||||||
|
range_test=[20]
|
||||||
elif test=='eig':
|
elif test=='eig':
|
||||||
range_test=list(range(16))
|
range_test=list(range(16))
|
||||||
else:
|
else:
|
||||||
|
@ -219,7 +217,7 @@ for dtype in range_prec:
|
||||||
letter = dtypes[0][dtype]
|
letter = dtypes[0][dtype]
|
||||||
name = dtypes[1][dtype]
|
name = dtypes[1][dtype]
|
||||||
|
|
||||||
if (short_summary==0):
|
if not short_summary:
|
||||||
print(" ")
|
print(" ")
|
||||||
print("------------------------- %s ------------------------" % name)
|
print("------------------------- %s ------------------------" % name)
|
||||||
print(" ")
|
print(" ")
|
||||||
|
@ -231,19 +229,19 @@ for dtype in range_prec:
|
||||||
letter+"gd",letter+"sb",letter+"sg",
|
letter+"gd",letter+"sb",letter+"sg",
|
||||||
letter+"bb","glm","gqr",
|
letter+"bb","glm","gqr",
|
||||||
"gsv","csd","lse",
|
"gsv","csd","lse",
|
||||||
letter+"test", letter+dtypes[0][dtype-1]+"test",letter+"test_rfp"),
|
letter+"test", letter+dtypes[0][dtype-1]+"test",letter+"test_rfp",letter+"dmd"),
|
||||||
("Nonsymmetric-Eigenvalue-Problem", "Symmetric-Eigenvalue-Problem", "Symmetric-Eigenvalue-Problem-2-stage", "Singular-Value-Decomposition",
|
("Nonsymmetric-Eigenvalue-Problem", "Symmetric-Eigenvalue-Problem", "Symmetric-Eigenvalue-Problem-2-stage", "Singular-Value-Decomposition",
|
||||||
"Eigen-Condition","Nonsymmetric-Eigenvalue","Nonsymmetric-Generalized-Eigenvalue-Problem",
|
"Eigen-Condition","Nonsymmetric-Eigenvalue","Nonsymmetric-Generalized-Eigenvalue-Problem",
|
||||||
"Nonsymmetric-Generalized-Eigenvalue-Problem-driver", "Symmetric-Eigenvalue-Problem", "Symmetric-Eigenvalue-Generalized-Problem",
|
"Nonsymmetric-Generalized-Eigenvalue-Problem-driver", "Symmetric-Eigenvalue-Problem", "Symmetric-Eigenvalue-Generalized-Problem",
|
||||||
"Banded-Singular-Value-Decomposition-routines", "Generalized-Linear-Regression-Model-routines", "Generalized-QR-and-RQ-factorization-routines",
|
"Banded-Singular-Value-Decomposition-routines", "Generalized-Linear-Regression-Model-routines", "Generalized-QR-and-RQ-factorization-routines",
|
||||||
"Generalized-Singular-Value-Decomposition-routines", "CS-Decomposition-routines", "Constrained-Linear-Least-Squares-routines",
|
"Generalized-Singular-Value-Decomposition-routines", "CS-Decomposition-routines", "Constrained-Linear-Least-Squares-routines",
|
||||||
"Linear-Equation-routines", "Mixed-Precision-linear-equation-routines","RFP-linear-equation-routines"),
|
"Linear-Equation-routines", "Mixed-Precision-linear-equation-routines","RFP-linear-equation-routines","Dynamic-Mode-Decomposition"),
|
||||||
(letter+"nep", letter+"sep", letter+"se2", letter+"svd",
|
(letter+"nep", letter+"sep", letter+"se2", letter+"svd",
|
||||||
letter+"ec",letter+"ed",letter+"gg",
|
letter+"ec",letter+"ed",letter+"gg",
|
||||||
letter+"gd",letter+"sb",letter+"sg",
|
letter+"gd",letter+"sb",letter+"sg",
|
||||||
letter+"bb",letter+"glm",letter+"gqr",
|
letter+"bb",letter+"glm",letter+"gqr",
|
||||||
letter+"gsv",letter+"csd",letter+"lse",
|
letter+"gsv",letter+"csd",letter+"lse",
|
||||||
letter+"test", letter+dtypes[0][dtype-1]+"test",letter+"test_rfp"),
|
letter+"test", letter+dtypes[0][dtype-1]+"test",letter+"test_rfp",letter+"dmd"),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@ -252,22 +250,25 @@ for dtype in range_prec:
|
||||||
# NEED TO SKIP SOME PRECISION (namely s and c) FOR PROTO MIXED PRECISION TESTING
|
# NEED TO SKIP SOME PRECISION (namely s and c) FOR PROTO MIXED PRECISION TESTING
|
||||||
if dtest==17 and (letter=="s" or letter=="c"):
|
if dtest==17 and (letter=="s" or letter=="c"):
|
||||||
continue
|
continue
|
||||||
if (with_file==1):
|
if with_file:
|
||||||
cmdbase=dtests[2][dtest]+".out"
|
cmdbase=dtests[2][dtest]+".out"
|
||||||
else:
|
else:
|
||||||
if dtest==16:
|
if dtest==16:
|
||||||
# LIN TESTS
|
# LIN TESTS
|
||||||
cmdbase="LIN/xlintst"+letter+" < "+dtests[0][dtest]+".in > "+dtests[2][dtest]+".out"
|
cmdbase="xlintst"+letter+" < "+dtests[0][dtest]+".in > "+dtests[2][dtest]+".out"
|
||||||
elif dtest==17:
|
elif dtest==17:
|
||||||
# PROTO LIN TESTS
|
# PROTO LIN TESTS
|
||||||
cmdbase="LIN/xlintst"+letter+dtypes[0][dtype-1]+" < "+dtests[0][dtest]+".in > "+dtests[2][dtest]+".out"
|
cmdbase="xlintst"+letter+dtypes[0][dtype-1]+" < "+dtests[0][dtest]+".in > "+dtests[2][dtest]+".out"
|
||||||
elif dtest==18:
|
elif dtest==18:
|
||||||
# PROTO LIN TESTS
|
# PROTO LIN TESTS
|
||||||
cmdbase="LIN/xlintstrf"+letter+" < "+dtests[0][dtest]+".in > "+dtests[2][dtest]+".out"
|
cmdbase="xlintstrf"+letter+" < "+dtests[0][dtest]+".in > "+dtests[2][dtest]+".out"
|
||||||
|
elif dtest==20:
|
||||||
|
# DMD EIG TESTS
|
||||||
|
cmdbase="xdmdeigtst"+letter+" < "+dtests[0][dtest]+".in > "+dtests[2][dtest]+".out"
|
||||||
else:
|
else:
|
||||||
# EIG TESTS
|
# EIG TESTS
|
||||||
cmdbase="EIG/xeigtst"+letter+" < "+dtests[0][dtest]+".in > "+dtests[2][dtest]+".out"
|
cmdbase="xeigtst"+letter+" < "+dtests[0][dtest]+".in > "+dtests[2][dtest]+".out"
|
||||||
if (not just_errors and not short_summary):
|
if not just_errors and not short_summary:
|
||||||
print("Testing "+name+" "+dtests[1][dtest]+"-"+cmdbase, end=' ')
|
print("Testing "+name+" "+dtests[1][dtest]+"-"+cmdbase, end=' ')
|
||||||
# Run the process: either to read the file or run the LAPACK testing
|
# Run the process: either to read the file or run the LAPACK testing
|
||||||
nb_test = run_summary_test(f, cmdbase, short_summary)
|
nb_test = run_summary_test(f, cmdbase, short_summary)
|
||||||
|
@ -277,19 +278,19 @@ for dtype in range_prec:
|
||||||
list_results[3][dtype]+=nb_test[3]
|
list_results[3][dtype]+=nb_test[3]
|
||||||
got_error=nb_test[1]+nb_test[2]+nb_test[3]
|
got_error=nb_test[1]+nb_test[2]+nb_test[3]
|
||||||
|
|
||||||
if (not short_summary):
|
if not short_summary:
|
||||||
if (nb_test[0]>0 and just_errors==0):
|
if nb_test[0] > 0 and not just_errors:
|
||||||
print("passed: "+str(nb_test[0]))
|
print("passed: "+str(nb_test[0]))
|
||||||
if (nb_test[1]>0):
|
if nb_test[1] > 0:
|
||||||
print("failing to pass the threshold: "+str(nb_test[1]))
|
print("failing to pass the threshold: "+str(nb_test[1]))
|
||||||
if (nb_test[2]>0):
|
if nb_test[2] > 0:
|
||||||
print("Illegal Error: "+str(nb_test[2]))
|
print("Illegal Error: "+str(nb_test[2]))
|
||||||
if (nb_test[3]>0):
|
if nb_test[3] > 0:
|
||||||
print("Info Error: "+str(nb_test[3]))
|
print("Info Error: "+str(nb_test[3]))
|
||||||
if (got_error>0 and just_errors==1):
|
if got_error > 0 and just_errors:
|
||||||
print("ERROR IS LOCATED IN "+name+" "+dtests[1][dtest]+" [ "+cmdbase+" ]")
|
print("ERROR IS LOCATED IN "+name+" "+dtests[1][dtest]+" [ "+cmdbase+" ]")
|
||||||
print("")
|
print("")
|
||||||
if (just_errors==0):
|
if not just_errors:
|
||||||
print("")
|
print("")
|
||||||
# elif (got_error>0):
|
# elif (got_error>0):
|
||||||
# print dtests[2][dtest]+".out \t"+str(nb_test[1])+"\t"+str(nb_test[2])+"\t"+str(nb_test[3])
|
# print dtests[2][dtest]+".out \t"+str(nb_test[1])+"\t"+str(nb_test[2])+"\t"+str(nb_test[3])
|
||||||
|
@ -307,7 +308,7 @@ for dtype in range_prec:
|
||||||
list_results[2][4]+=list_results[2][dtype]
|
list_results[2][4]+=list_results[2][dtype]
|
||||||
list_results[3][4]+=list_results[3][dtype]
|
list_results[3][4]+=list_results[3][dtype]
|
||||||
|
|
||||||
if only_numbers==1:
|
if only_numbers:
|
||||||
print(str(list_results[1][4])+"\n"+str(list_results[2][4]+list_results[3][4]))
|
print(str(list_results[1][4])+"\n"+str(list_results[2][4]+list_results[3][4]))
|
||||||
else:
|
else:
|
||||||
print(summary)
|
print(summary)
|
||||||
|
|
Loading…
Reference in New Issue