Skip to content

Commit

Permalink
240127.120436.HKT improve isequiv.m to show the test options upone fa…
Browse files Browse the repository at this point in the history
…ilure; block a problem for bobyqa verificaion
  • Loading branch information
zaikunzhang committed Jan 27, 2024
1 parent 4840e2c commit 1dceefd
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 35 deletions.
33 changes: 2 additions & 31 deletions .github/workflows/verify_small.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
Expand Down Expand Up @@ -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.
Expand Down
11 changes: 7 additions & 4 deletions matlab/tests/private/isequiv.m
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -733,6 +735,7 @@ function isequiv(solvers, options)
'DMN15333LS', ...
'DMN37142LS', ...
'DMN37143LS', ...
'ERRINROS', ...
'HOLMES', ...
'HYDC20LS', ...
'LEVYMONT', ...
Expand Down

0 comments on commit 1dceefd

Please sign in to comment.