bugGNU Octave - Bugs: bug #54179, sparse/eigs.m test failure

 
 

bug #54179: sparse/eigs.m test failure

Submitter:  Andrew Janke <apjanke>
Submitted:  Sun 24 Jun 2018 09:17:31 PM UTC
   
 
Category:  Test Suite Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Unexpected Error or Warning
Status:  Fixed Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * 4.4.0 Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Wed 04 Jul 2018 02:08:37 PM UTC, comment #13: 

Pushed the change here http://hg.savannah.gnu.org/hgweb/octave/rev/8925207dbc26.  Marking as fixed.

Rik <rik5>
Group administrator
Wed 04 Jul 2018 03:59:42 AM UTC, comment #12: 

The patch works for me.

Dmitri.
--

Dmitri A. Sergatskov <dasergatskov>
Tue 03 Jul 2018 04:02:49 PM UTC, comment #11: 

I've attached a patch (54179.cset).  It can be tested with


patch -p1 < 54179.cset
run-octave -f
test eigs


@Andrew or @Dmitri: Could you verify this solves the problem.

I simply reduced the number of iterations from 5 to 4 on the tests that Dmitri indicated were failing.  It doesn't upset my installation (all 182 tests pass), but I have arpack-3.3.0.


(file #44499)

Rik <rik5>
Group administrator
Tue 03 Jul 2018 11:21:36 AM UTC, comment #10: 

I have two tests failing:


octave:12> [n, nmax]=test("eigs", "verbose")
<...>
***** testif HAVE_ARPACK
 A = toeplitz ([0, 1, zeros(1, 8)], [0, -1, zeros(1, 8)]);
 A = kron (A, eye (10)) + kron (eye (10), A);
 opts.v0 = (1:100)';
 opts.maxit = 5;
 warning ("off", "Octave:eigs:UnconvergedEigenvalues", "local");
 d = eigs (A, 4, "lm", opts);
 assert (d(3:4), [NaN+1i*NaN; NaN+1i*NaN]);
!!!!! test failed
ASSERT errors for:  assert (d (3:4),[NaN + 1i * NaN; NaN + 1i * NaN])

  Location  |  Observed  |  Expected  |  Reason
    (1)      -2.4903e-71+3.6015i   NaN+NaNi     'NaN' mismatch
    (2)      -2.4903e-71-3.6015i   NaN+NaNi     'NaN' mismatch
<...>
***** testif HAVE_ARPACK
 A = toeplitz ([0, 1, zeros(1, 8)], [0, -1, zeros(1, 8)]);
 A = kron (A, eye (10)) + kron (eye (10), A);
 Afun = @(x) A * x;
 opts.v0 = (1:100)';
 opts.maxit = 5;
 warning ("off", "Octave:eigs:UnconvergedEigenvalues", "local");
 d = eigs (Afun, 100, 4, "lm", opts);
 assert (d(3:4), [NaN+1i*NaN; NaN+1i*NaN]);
!!!!! test failed
ASSERT errors for:  assert (d (3:4),[NaN + 1i * NaN; NaN + 1i * NaN])

  Location  |  Observed  |  Expected  |  Reason
    (1)      -2.4903e-71+3.6015i   NaN+NaNi     'NaN' mismatch
    (2)      -2.4903e-71-3.6015i   NaN+NaNi     'NaN' mismatch
<...>
n =  180
nmax =  182


and yes, changing opts.maxit to 4 in both cases allow them to pass.

Dmitri.
--

Dmitri A. Sergatskov <dasergatskov>
Tue 03 Jul 2018 07:02:35 AM UTC, comment #9: 

@Rik: from comment #6, it seems that it is just a single test.
@Dmitri: do you confirm that if you decrease opts.maxit to 4, Fedora 28 + arpack 3.6.1 passes the test?

Marco Caliari <caliari>
Group Member
Mon 02 Jul 2018 04:38:52 PM UTC, comment #8: 

@Marco: For the time being, is it just a single test that we need to lower the iteration count on?

If so, it seems worthwhile to make that change now and postpone making the the long term decision about testing for unconverged eigenvalues.

If this is not the case then I would be okay with removing these tests.

Rik <rik5>
Group administrator
Mon 25 Jun 2018 02:54:12 PM UTC, comment #7: 

Four iterations are enough to get at least two eigenvalues, while three are not. When no eigenvalue is found at the desired precision, arpack gives error -14.

There were a lot of {blas,arpack,platform}-dependent failing tests since the introduction of NaNs as placeholders for unconverged eigenvalues. Are we sure we want to keep these tests?

Marco Caliari <caliari>
Group Member
Mon 25 Jun 2018 09:54:59 AM UTC, comment #6: 

Under Octave 4.4.0 built against arpack 3.6.1 on macOS 10.13.5:

If I take the following test in eigs.m at lines 1439 through 1446:


%! A = toeplitz ([0, 1, zeros(1, 8)], [0, -1, zeros(1, 8)]);
%! A = kron (A, eye (10)) + kron (eye (10), A);
%! Afun = @(x) A * x;
%! opts.v0 = (1:100)';
%! opts.maxit = 5;
%! warning ("off", "Octave:eigs:UnconvergedEigenvalues", "local");
%! d = eigs (Afun, 100, 4, "lm", opts);
%! assert (d(3:4), [NaN+1i*NaN; NaN+1i*NaN]);


and decrease opts.maxit from 5 to 4, then the test passes.


octave:12> test eigs
PASSES 182 out of 182 tests


If I decrease opts.maxit further to 3, I get a different error, `eigs: error -14 in dneupd`:


octave:10> test eigs
***** testif HAVE_ARPACK
 A = toeplitz ([0, 1, zeros(1, 8)], [0, -1, zeros(1, 8)]);
 A = kron (A, eye (10)) + kron (eye (10), A);
 Afun = @(x) A * x;
 opts.v0 = (1:100)';
 opts.maxit = 3;
 warning ("off", "Octave:eigs:UnconvergedEigenvalues", "local");
 d = eigs (Afun, 100, 4, "lm", opts);
 assert (d(3:4), [NaN+1i*NaN; NaN+1i*NaN]);
!!!!! test failed
eigs: error -14 in dneupd


This seems to agree with your analysis.

I am no math expert, so I am unable to evaluate these numbers as to correctness.

Andrew Janke <apjanke>
Mon 25 Jun 2018 06:57:24 AM UTC, comment #5: 

The result given with arpack-3.6.1 (original submission) is correct (you can try to increase opts.maxit and compare). If you look at the changes between 3.5.0 and 3.6.1 https://github.com/opencollab/arpack-ng/blob/master/CHANGES you see just one change to the algorithm (btw, by me) which could be responsible of a faster convergence od arpack. Dimitri confirmed the original result on a different platform, so I think we should change the test in order to reflect this improvement in arpack. What happens if you decrease opts.maxit to 4 or even smaller numbers?

Marco Caliari <caliari>
Group Member
Sun 24 Jun 2018 10:30:23 PM UTC, comment #4: 


> It appears arpack 3.6.1 is the problem.


Confirmed. I rebuilt my Octave against arpack 3.5.0, and `test eigs` now passes.


>> test eigs
PASSES 182 out of 182 tests


Andrew Janke <apjanke>
Sun 24 Jun 2018 09:56:05 PM UTC, comment #3: 

Not sure if I'm using DYLD_INSERT_LIBRARIES right, but using it to pull in OpenBLAS appears to have no effect:


$ OPENBLAS=$(brew --prefix openblas)
$ DYLD_INSERT_LIBRARIES=$OPENBLAS/lib/libblas.dylib:$OPENBLAS/lib/liblapack.dylib:$OPENBLAS/lib/libopenblas.dylib octave
GNU Octave, version 4.4.0
...
Octave was configured for "x86_64-apple-darwin17.6.0".
...

octave:1> test eigs
***** testif HAVE_ARPACK
 A = toeplitz ([0, 1, zeros(1, 8)], [0, -1, zeros(1, 8)]);
 A = kron (A, eye (10)) + kron (eye (10), A);
 opts.v0 = (1:100)';
 opts.maxit = 5;
 warning ("off", "Octave:eigs:UnconvergedEigenvalues", "local");
 d = eigs (A, 4, "lm", opts);
 assert (d(3:4), [NaN+1i*NaN; NaN+1i*NaN]);
!!!!! test failed
ASSERT errors for:  assert (d (3:4),[NaN + 1i * NaN; NaN + 1i * NaN])

  Location  |  Observed  |  Expected  |  Reason
    (1)      -3.4694e-18+3.6015i   NaN+NaNi     'NaN' mismatch
    (2)      -3.4694e-18-3.6015i   NaN+NaNi     'NaN' mismatch
octave:2>


Andrew Janke <apjanke>
Sun 24 Jun 2018 09:52:38 PM UTC, comment #2: 

It appears arpack 3.6.1 is the problem.
I can reproduce this problem on Fedora 28 when octave
linked with arpack 3.6.1. No problem with 3.5.0 (the default Fedora's arpack):



./run-octave -q -f
octave:1> test eigs
PASSES 182 out of 182 tests
octave:2>


LD_PRELOAD=~/src/arpack-ng/SRC/.libs/libarpack.so.2.0.0 ./run-octave -q -f
octave:1> test eigs
***** testif HAVE_ARPACK
 A = toeplitz ([0, 1, zeros(1, 8)], [0, -1, zeros(1, 8)]);
 A = kron (A, eye (10)) + kron (eye (10), A);
 opts.v0 = (1:100)';
 opts.maxit = 5;
 warning ("off", "Octave:eigs:UnconvergedEigenvalues", "local");
 d = eigs (A, 4, "lm", opts);
 assert (d(3:4), [NaN+1i*NaN; NaN+1i*NaN]);
!!!!! test failed
ASSERT errors for:  assert (d (3:4),[NaN + 1i * NaN; NaN + 1i * NaN])

  Location  |  Observed  |  Expected  |  Reason
    (1)      -2.4903e-71+3.6015i   NaN+NaNi     'NaN' mismatch
    (2)      -2.4903e-71-3.6015i   NaN+NaNi     'NaN' mismatch
octave:2>


Dmitri.
--

Dmitri A. Sergatskov <dasergatskov>
Sun 24 Jun 2018 09:37:32 PM UTC, comment #1: 

I think the blas library (veclib) is primary suspect.
Could you try some other one? E.g. Openblas?
Perhaps you can override it at run time with
 DYLD_INSERT_LIBRARIES

Dmitri.
--

Dmitri A. Sergatskov <dasergatskov>
Sun 24 Jun 2018 09:17:31 PM UTC, original submission:  

In Octave 4.4.0 on macOS 10.13.5, the sparse/eigs.m test is failing for me. This is with arpack 3.6.1 installed. Build logs attached.


>> test eigs
***** testif HAVE_ARPACK
 A = toeplitz ([0, 1, zeros(1, 8)], [0, -1, zeros(1, 8)]);
 A = kron (A, eye (10)) + kron (eye (10), A);
 opts.v0 = (1:100)';
 opts.maxit = 5;
 warning ("off", "Octave:eigs:UnconvergedEigenvalues", "local");
 d = eigs (A, 4, "lm", opts);
 assert (d(3:4), [NaN+1i*NaN; NaN+1i*NaN]);
!!!!! test failed
ASSERT errors for:  assert (d (3:4),[NaN + 1i * NaN; NaN + 1i * NaN])

  Location  |  Observed  |  Expected  |  Reason
    (1)      -3.4694e-18+3.6015i   NaN+NaNi     'NaN' mismatch
    (2)      -3.4694e-18-3.6015i   NaN+NaNi     'NaN' mismatch


Looks related, but not identical, to:

Andrew Janke <apjanke>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #44499:  54179.cset added by rik5 (1KiB - application/octet-stream)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by caliari (Posted a comment)
  • -email is unavailable- added by dasergatskov (Posted a comment)
  • -email is unavailable- added by apjanke (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 8 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2018-07-04 rik5 StatusIn Progress Fixed
        Open/ClosedOpen Closed
    2018-07-03 rik5 Attached File- Added 54179.cset, #44499
    2018-06-25 caliari StatusNone In Progress
    2018-06-25 caliari Item GroupIncorrect Result Unexpected Error or Warning
        Operating SystemMac OS Any
        Summarysparse/eigs.m test failure on macOS sparse/eigs.m test failure
    2018-06-24 apjanke Attached File- Added octave build logs - e7420cac8e489b4c38f287c587624cf3-a945c8e5c08b20b69682a6eaf08c5557f752991f.zip, #44425

    Back to the top

    Powered by Savane 3.13-758e.
    Corresponding source code