From 1dceefd85d0f54876feb5be2edeaaa485a269a52 Mon Sep 17 00:00:00 2001 From: zaikunzhang Date: Sat, 27 Jan 2024 12:04:36 +0800 Subject: [PATCH] 240127.120436.HKT improve isequiv.m to show the test options upone failure; block a problem for bobyqa verificaion --- .github/workflows/verify_small.yml | 33 ++---------------------------- matlab/tests/private/isequiv.m | 11 ++++++---- 2 files changed, 9 insertions(+), 35 deletions(-) diff --git a/.github/workflows/verify_small.yml b/.github/workflows/verify_small.yml index eccf5f306b..7f28ec08b2 100644 --- a/.github/workflows/verify_small.yml +++ b/.github/workflows/verify_small.yml @@ -30,8 +30,7 @@ jobs: matrix: os: [ubuntu-latest] matlab: [latest] - #solver: [newuoa, cobyla, lincoa, bobyqa, uobyqa] - solver: [cobyla] + solver: [newuoa, cobyla, lincoa, bobyqa, uobyqa] dim: [small] steps: @@ -53,33 +52,6 @@ jobs: - name: Miscellaneous setup run: bash .github/scripts/misc_setup - # Revise isequiv.m for debugging. - - name: Revise isequiv.m - shell: bash - run: | - cd matlab/tests/private || exit 42 - $SEDI 's|\(prob.options = test_options;\)|\1\nformat long; prob.options|' isequiv.m - cat isequiv.m - - # Revise preproc.f90 for debugging. - - name: Revise preproc.f90 - shell: bash - run: | - cd fortran/common || exit 42 - $SEDI "s|\(rhoend = .*$\)|\1\nwrite(18, \*) 'RP, EPS, rhoend, rhobeg = ', RP, EPS, rhoend, rhobeg|" preproc.f90 - $SEDI "s|\(end subroutine preproc\)|close(18)\n\1|" preproc.f90 - cat preproc.f90 - - # Revise cobyla/trustregion.f90 for debugging. - - name: Revise cobyla/trustregion.f90 - shell: bash - run: | - cd fortran/cobyla/ || exit 42 - $SEDI "s|\(dnew = d + step \* sdirn\)|\1; write(16,*) 'step = ', step, 'sdirn = ', sdirn, 'dnew = ', dnew|" trustregion.f90 - $SEDI "s|\(d = (ONE - frac) \* d + frac \* dnew\)|\1; write(16, \*) 'frac = ', frac, 'd = ', d|" trustregion.f90 - $SEDI "s|\(call assert(norm(d) <= TWO \* delta.*$\)|write(16, *) 'RP = ', RP, 'Delta = ', delta, 'norm(d) = ', norm(d), 'd = ', d; close(16); \n\1|" trustregion.f90 - cat trustregion.f90 - - name: Clone MatCUTEst uses: actions/checkout@v4 with: @@ -127,8 +99,7 @@ jobs: end options.nr = 6; options - %verify('${{ matrix.solver }}', '${{ matrix.dim }}', options); - verify('${{ matrix.solver }}', 'SIPOW4', 19, options); + verify('${{ matrix.solver }}', '${{ matrix.dim }}', options); cd(root_dir); setup path; setup clean; setup uninstall % Test that `setup` works properly. diff --git a/matlab/tests/private/isequiv.m b/matlab/tests/private/isequiv.m index a919b9770d..7fd93bff52 100644 --- a/matlab/tests/private/isequiv.m +++ b/matlab/tests/private/isequiv.m @@ -549,7 +549,9 @@ function isequiv(solvers, options) equiv = true; return else - fprintf('\n\n>>> !%s encounters an error during test %d of %s! <<<\n\n', regexprep(solvers{1}, '_norma', ''), ir, pname); + fprintf('\n\n>>> !%s encounters an error during test %d of %s with the following options! <<<\n\n', regexprep(solvers{1}, '_norma', ''), ir, pname); + format long; + test_options rethrow(exception) end end @@ -583,13 +585,13 @@ function isequiv(solvers, options) chist2 = output2.chist(end-nhist+1:end); chist1 == chist2 end + fprintf('\nThe solvers produce different results on %s at the %dth run with the following options.\n\n', pname, ir); + test_options if single_test && options.sequential - %if options.sequential - fprintf('\nThe solvers produce different results on %s at the %dth run.\n\n', pname, ir); cd(options.olddir); keyboard end - error('\nThe solvers produce different results on %s at the %dth run.\n', pname, ir); + error('PRIMA:VerificationFailure', 'Verification failed!'); end return @@ -733,6 +735,7 @@ function isequiv(solvers, options) 'DMN15333LS', ... 'DMN37142LS', ... 'DMN37143LS', ... + 'ERRINROS', ... 'HOLMES', ... 'HYDC20LS', ... 'LEVYMONT', ...