diff --git a/test/run_tests.py b/test/run_tests.py index ebd38ed3b..40c7ae7ca 100755 --- a/test/run_tests.py +++ b/test/run_tests.py @@ -78,7 +78,7 @@ group_cat.add_argument( '--svd', action='store_true', help='run SVD tests' ), group_cat.add_argument( '--aux', action='store_true', help='run auxiliary routine tests' ), group_cat.add_argument( '--norms', action='store_true', help='run norm tests' ), - group_cat.add_argument( '--cond', action='store_true', help='run condition number estimate tests' ), + group_cat.add_argument( '--condest', action='store_true', help='run condition number estimate tests' ), ] # map category objects to category names: ['lu', 'chol', ...] categories = list( map( lambda x: x.dest, categories ) ) @@ -133,6 +133,7 @@ group_opt.add_argument( '--matrix', action='store', help='default=%(default)s', default='' ) group_opt.add_argument( '--matrixB', action='store', help='default=%(default)s', default='' ) group_opt.add_argument( '--matrixC', action='store', help='default=%(default)s', default='' ) +group_opt.add_argument( '--cond', action='store', help='default=%(default)s', default='1e2' ) parser.add_argument( 'tests', nargs=argparse.REMAINDER ) opts = parser.parse_args() @@ -183,8 +184,10 @@ nk_wide = dim nk = dim -# for xsmall and small, use smaller nb, but not with medium or large +# For xsmall and small, use smaller nb, but not with medium or large. +# For xsmall, use smaller cond (1e2) than default (1e3) for Cholesky QR to pass. is_default_nb = (opts.nb == parser.get_default('nb')) +is_default_cond = (opts.cond == parser.get_default('cond')) if (not opts.dim): if (opts.quick): @@ -192,8 +195,6 @@ tall = ' --dim 100x50' # 2:1 wide = ' --dim 50x100' # 1:2 mnk = ' --dim 25x50x75' - nk_tall = ' --dim 1x100x50' # 2:1 - nk_wide = ' --dim 1x50x100' # 1:2 if (is_default_nb): opts.nb = '8' @@ -204,10 +205,10 @@ mnk += ' --dim 10x15x20 --dim 15x10x20' \ + ' --dim 10x20x15 --dim 15x20x10' \ + ' --dim 20x10x15 --dim 20x15x10' - nk_tall += ' --dim 1x20x10' - nk_wide += ' --dim 1x10x20' if (is_default_nb): opts.nb = '5,8' + if (is_default_cond): + opts.cond = '1e2' if (opts.small): n += ' --dim 25:100:25' @@ -216,8 +217,6 @@ mnk += ' --dim 25x50x75 --dim 50x25x75' \ + ' --dim 25x75x50 --dim 50x75x25' \ + ' --dim 75x25x50 --dim 75x50x25' - nk_tall += ' --dim 1x50:200:50x25:100:25' - nk_wide += ' --dim 1x25:100:25x50:200:50' if (is_default_nb): opts.nb = '25,32' @@ -228,8 +227,6 @@ mnk += ' --dim 100x300x600 --dim 300x100x600' \ + ' --dim 100x600x300 --dim 300x600x100' \ + ' --dim 600x100x300 --dim 600x300x100' - nk_tall += ' --dim 1x200:1000:200x100:500:100' - nk_wide += ' --dim 1x100:500:100x200:1000:200' if (is_default_nb): opts.nb = parser.get_default('nb') @@ -240,11 +237,13 @@ mnk += ' --dim 1000x3000x6000 --dim 3000x1000x6000' \ + ' --dim 1000x6000x3000 --dim 3000x6000x1000' \ + ' --dim 6000x1000x3000 --dim 6000x3000x1000' - nk_tall += ' --dim 1x2000:10000:2000x1000:5000:1000' - nk_wide += ' --dim 1x1000:5000:1000x2000:10000:2000' if (is_default_nb): opts.nb = parser.get_default('nb') + # For nk, prepend 1x for the unused m dimension. + nk_tall = re.sub( r'--dim (\d)', r'--dim 1x\1', tall ) + nk_wide = re.sub( r'--dim (\d)', r'--dim 1x\1', wide ) + mn = '' nk = '' if (opts.square): @@ -310,6 +309,7 @@ matrixB = ' --matrixB ' + opts.matrixB if (opts.matrixB) else '' matrixC = ' --matrixC ' + opts.matrixC if (opts.matrixC) else '' matrixBC = matrixB + matrixC +cond = ' --cond ' + opts.cond if (opts.cond) else '' # general options for all routines gen = origin + target + grid + check + ref + tol + repeat + nb @@ -338,6 +338,7 @@ def filter_csv( values, csv ): # limit options to specific values dtype_real = ' --type ' + filter_csv( ('s', 'd'), opts.type ) dtype_complex = ' --type ' + filter_csv( ('c', 'z'), opts.type ) +dtype_single = ' --type ' + filter_csv( ('s', 'c'), opts.type ) dtype_double = ' --type ' + filter_csv( ('d', 'z'), opts.type ) trans_nt = ' --trans ' + filter_csv( ('n', 't'), opts.trans ) @@ -366,19 +367,19 @@ def filter_csv( values, csv ): [ 'hbmm', gen + dtype + la + side + uplo + mn + ab + kd + matrixBC ], - [ 'herk', gen + dtype_real + la + he_matrix + trans + mn + ab + matrixC ], - [ 'herk', gen + dtype_complex + la + he_matrix + trans_nc + mn + ab + matrixC ], + [ 'herk', gen + dtype_real + la + he_matrix + trans + nk + ab + matrixC ], + [ 'herk', gen + dtype_complex + la + he_matrix + trans_nc + nk + ab + matrixC ], - [ 'her2k', gen + dtype_real + la + he_matrix + trans + mn + ab + matrixBC ], - [ 'her2k', gen + dtype_complex + la + he_matrix + trans_nc + mn + ab + matrixBC ], + [ 'her2k', gen + dtype_real + la + he_matrix + trans + nk + ab + matrixBC ], + [ 'her2k', gen + dtype_complex + la + he_matrix + trans_nc + nk + ab + matrixBC ], [ 'symm', gen + dtype + la + side + sy_matrix + mn + ab + matrixBC ], - [ 'syr2k', gen + dtype_real + la + sy_matrix + trans + mn + ab + matrixC ], - [ 'syr2k', gen + dtype_complex + la + sy_matrix + trans_nt + mn + ab + matrixC ], + [ 'syr2k', gen + dtype_real + la + sy_matrix + trans + nk + ab + matrixC ], + [ 'syr2k', gen + dtype_complex + la + sy_matrix + trans_nt + nk + ab + matrixC ], - [ 'syrk', gen + dtype_real + la + sy_matrix + trans + mn + ab + matrixBC ], - [ 'syrk', gen + dtype_complex + la + sy_matrix + trans_nt + mn + ab + matrixBC ], + [ 'syrk', gen + dtype_real + la + sy_matrix + trans + nk + ab + matrixBC ], + [ 'syrk', gen + dtype_complex + la + sy_matrix + trans_nt + nk + ab + matrixBC ], # todo: tbsm fails for nb=8 or 16 with --quick. [ 'tbsm', gen_no_nb + ' --nb 32' + dtype + la + side + uplo + transA + diag + mn + a + kd + matrixB ], @@ -481,8 +482,7 @@ def filter_csv( values, csv ): # todo: mn (i.e., add wide) [ 'gels', gen + dtype + la + n + tall + trans_nc + ' --method-gels qr' ], # Cholesky QR needs well-conditioned problem. - [ 'gels', gen + la + n + tall + trans_nc + ' --method-gels cholqr --matrix svd --cond 1e3 --type s,c' ], - [ 'gels', gen + la + n + tall + trans_nc + ' --method-gels cholqr --matrix svd --cond 1e3 --type d,z' ], + [ 'gels', gen + dtype + la + n + tall + trans_nc + cond + ' --method-gels cholqr --matrix svd' ], # Generalized #[ 'gglse', gen + dtype + la + mnk ], @@ -619,8 +619,8 @@ def filter_csv( values, csv ): #[ 'tbnorm', gen + dtype + la + n + kd + norm ], ] -# cond -if (opts.cond): +# condest +if (opts.condest): cmds += [ [ 'gecondest', gen + dtype + n ], [ 'pocondest', gen + dtype + n + uplo ], @@ -743,6 +743,7 @@ def run_test( cmd ): # ------------------------------------------------------------------------------ # run each test +print_tee( ' '.join( sys.argv ) ) start = time.time() print_tee( time.ctime() ) diff --git a/test/test_her2k.cc b/test/test_her2k.cc index e72f734d7..23c012993 100644 --- a/test/test_her2k.cc +++ b/test/test_her2k.cc @@ -124,9 +124,9 @@ void test_her2k_work(Params& params, bool run) opA = conj_transpose( A ); opB = conj_transpose( B ); } - slate_assert(A.mt() == C.mt()); - slate_assert(B.mt() == C.mt()); - slate_assert(A.nt() == B.nt()); + slate_assert( opA.mt() == C.mt() ); + slate_assert( opB.mt() == C.mt() ); + slate_assert( opA.nt() == opB.nt() ); print_matrix("A", A, params); print_matrix("B", B, params); @@ -138,9 +138,9 @@ void test_her2k_work(Params& params, bool run) // If check run, perform first half of SLATE residual check. TestMatrix> X_alloc, Y_alloc, Z_alloc; if (check && ! ref) { - X_alloc = allocate_test_Matrix( false, true, An, nrhs, params ); - Y_alloc = allocate_test_Matrix( false, true, Am, nrhs, params ); - Z_alloc = allocate_test_Matrix( false, true, Am, nrhs, params ); + X_alloc = allocate_test_Matrix( false, true, n, nrhs, params ); + Y_alloc = allocate_test_Matrix( false, true, n, nrhs, params ); + Z_alloc = allocate_test_Matrix( false, true, k, nrhs, params ); auto& X = X_alloc.A; auto& Y = Y_alloc.A; diff --git a/test/test_herk.cc b/test/test_herk.cc index 747badc56..45764a67a 100644 --- a/test/test_herk.cc +++ b/test/test_herk.cc @@ -117,9 +117,9 @@ void test_herk_work(Params& params, bool run) // If check run, perform first half of SLATE residual check. TestMatrix> X_alloc, Y_alloc, Z_alloc; if (check && ! ref) { - X_alloc = allocate_test_Matrix( false, true, An, nrhs, params ); - Y_alloc = allocate_test_Matrix( false, true, Am, nrhs, params ); - Z_alloc = allocate_test_Matrix( false, true, Am, nrhs, params ); + X_alloc = allocate_test_Matrix( false, true, n, nrhs, params ); + Y_alloc = allocate_test_Matrix( false, true, n, nrhs, params ); + Z_alloc = allocate_test_Matrix( false, true, k, nrhs, params ); auto& X = X_alloc.A; auto& Y = Y_alloc.A; diff --git a/test/test_syr2k.cc b/test/test_syr2k.cc index 0a3d422f5..42163784b 100644 --- a/test/test_syr2k.cc +++ b/test/test_syr2k.cc @@ -122,9 +122,9 @@ void test_syr2k_work(Params& params, bool run) opA = conj_transpose( A ); opB = conj_transpose( B ); } - slate_assert(opA.mt() == C.mt()); - slate_assert(opB.mt() == C.mt()); - slate_assert(opA.nt() == B.nt()); + slate_assert( opA.mt() == C.mt() ); + slate_assert( opB.mt() == C.mt() ); + slate_assert( opA.nt() == opB.nt() ); print_matrix("A", A, params); print_matrix("B", B, params); @@ -136,9 +136,9 @@ void test_syr2k_work(Params& params, bool run) // If check run, perform first half of SLATE residual check. TestMatrix> X_alloc, Y_alloc, Z_alloc; if (check && ! ref) { - X_alloc = allocate_test_Matrix( false, true, An, nrhs, params ); - Y_alloc = allocate_test_Matrix( false, true, Am, nrhs, params ); - Z_alloc = allocate_test_Matrix( false, true, Am, nrhs, params ); + X_alloc = allocate_test_Matrix( false, true, n, nrhs, params ); + Y_alloc = allocate_test_Matrix( false, true, n, nrhs, params ); + Z_alloc = allocate_test_Matrix( false, true, k, nrhs, params ); auto& X = X_alloc.A; auto& Y = Y_alloc.A; diff --git a/test/test_syrk.cc b/test/test_syrk.cc index 6779aada2..2b0c30f3e 100644 --- a/test/test_syrk.cc +++ b/test/test_syrk.cc @@ -115,9 +115,9 @@ void test_syrk_work(Params& params, bool run) // If check run, perform first half of SLATE residual check. TestMatrix> X_alloc, Y_alloc, Z_alloc; if (check && ! ref) { - X_alloc = allocate_test_Matrix( false, true, An, nrhs, params ); - Y_alloc = allocate_test_Matrix( false, true, Am, nrhs, params ); - Z_alloc = allocate_test_Matrix( false, true, Am, nrhs, params ); + X_alloc = allocate_test_Matrix( false, true, n, nrhs, params ); + Y_alloc = allocate_test_Matrix( false, true, n, nrhs, params ); + Z_alloc = allocate_test_Matrix( false, true, k, nrhs, params ); auto& X = X_alloc.A; auto& Y = Y_alloc.A;