bugGNU Octave - Bugs: bug #54399, function LuAminusSigmaB in...

 
 

bug #54399: function LuAminusSigmaB in eigs-base.cc can be made faster for special case of sigma == 0

Submitter:  Dmitri A. Sergatskov <dasergatskov>
Submitted:  Sat 28 Jul 2018 02:38:40 AM UTC
   
 
Category:  Octave Function Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Performance
Status:  Fixed Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * dev Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Wed 01 Aug 2018 06:10:07 PM UTC, comment #24: 

I pushed Marco's second cset here (https://hg.savannah.gnu.org/hgweb/octave/rev/feaa2169cb36).  Marking as fixed and closing report.

Rik <rik5>
Group administrator
Wed 01 Aug 2018 03:23:20 PM UTC, comment #23: 

octave:1> m = ones(11, 11) * 0.15 / 11;
octave:2> m(1, 2:11) += 0.85;
octave:3>  m(2:11, 1) = (1 - m(1, 1)) / 10;
octave:4> [v, lambda] = eigs(m, 1)
v =

  -0.94054
  -0.10742
  -0.10742
  -0.10742
  -0.10742
  -0.10742
  -0.10742
  -0.10742
  -0.10742
  -0.10742
  -0.10742

lambda =  1.00000

So I do not have that bug.

Dmitri.
--

Dmitri A. Sergatskov <dasergatskov>
Wed 01 Aug 2018 03:21:17 PM UTC, comment #22: 

3.5.0

Dmitri.
--

Dmitri A. Sergatskov <dasergatskov>
Wed 01 Aug 2018 03:11:19 PM UTC, comment #21: 

@Dmitri: which version of arpack are you using? 3.6.0? Because there is a bug report there https://github.com/opencollab/arpack-ng/issues/142 about a swap of real and imaginary parts.

Marco Caliari <caliari>
Group Member
Wed 01 Aug 2018 07:13:11 AM UTC, comment #20: 

I used


if (std:real (sigma) != 0.0 || std:imag (sigma) != 0.0)


in the complex case.

(file #44679)

Marco Caliari <caliari>
Group Member
Tue 31 Jul 2018 04:28:40 PM UTC, comment #19: 

There are several different templates for the function.  In some of them, sigma is a real value declared in C++ as a double.  Here is one such example.


static bool
LuAminusSigmaB (const SparseMatrix& m, const SparseMatrix& b,
                bool cholB, const ColumnVector& permB, double sigma,
                SparseMatrix& L, SparseMatrix& U, octave_idx_type *P,
                octave_idx_type *Q, ColumnVector &r)


In this case it is appropriate to compare sigma to 0.0.

In other cases sigma can be complex as in this prototype for the function


static bool
LuAminusSigmaB (const SparseComplexMatrix& m, const SparseComplexMatrix& b,
                bool cholB, const ColumnVector& permB, Complex sigma,
                SparseComplexMatrix& L, SparseComplexMatrix& U,
                octave_idx_type *P, octave_idx_type *Q, ColumnVector &r)
{


In these cases you can use the C++ abs() function to get the magnitude of the complex number so something like this


if (std::abs (sigma) != 0.0)



Rik <rik5>
Group administrator
Tue 31 Jul 2018 07:52:56 AM UTC, comment #18: 

Is the syntax


if (sigma != 0.0)


correct even when signa is complex?

Marco Caliari <caliari>
Group Member
Mon 30 Jul 2018 11:37:52 PM UTC, comment #17: 

Re-titling bug to reflect remaining issue.

Rik <rik5>
Group administrator
Mon 30 Jul 2018 11:36:17 PM UTC, comment #16: 
Rik <rik5>
Group administrator
Mon 30 Jul 2018 04:22:48 PM UTC, comment #15: 

yes, with this patch "test eigs" passes with all blas libraries
I have available.

Dmitri.
--

Dmitri A. Sergatskov <dasergatskov>
Mon 30 Jul 2018 04:14:27 PM UTC, comment #14: 

eigs.diff is the changeset for the BISTs. @Dimitri: does it work for you?
With a second changeset I will address the (sigma == 0) case.

(file #44660)

Marco Caliari <caliari>
Group Member
Mon 30 Jul 2018 02:40:44 PM UTC, comment #13: 

I don't see why you can't increase the performance a bit by having a special case for sigma == 0.

The code is


  if (have_b)
    {
      if (cholB)
        {
          if (permB.numel ())
            {
              SparseMatrix tmp (n,n,n);
              for (octave_idx_type i = 0; i < n; i++)
                {
                  tmp.xcidx (i) = i;
                  tmp.xridx (i) =
                    static_cast<octave_idx_type> (permB(i));
                  tmp.xdata (i) = 1;
                }
              tmp.xcidx (n) = n;

              AminusSigmaB -= sigma * tmp *
                              b.transpose () * b * tmp.transpose ();
            }
          else
            AminusSigmaB -= sigma * b.transpose () * b;
        }
      else
        AminusSigmaB -= sigma * b;
    }
  else
    {
      SparseMatrix sigmat (n, n, n);

      // Create sigma * speye (n,n)
      sigmat.xcidx (0) = 0;
      for (octave_idx_type i = 0; i < n; i++)
        {
          sigmat.xdata (i) = sigma;
          sigmat.xridx (i) = i;
          sigmat.xcidx (i+1) = i + 1;
        }

      AminusSigmaB -= sigmat;
    }


It looks like there is a similar opportunity when have_B is false.  Instead of calculating sigmat, just leave AminusSigmaB unchanged.

 Is sigma guaranteed to be scalar at that point?

Rik <rik5>
Group administrator
Mon 30 Jul 2018 01:23:30 PM UTC, comment #12: 

Then, I'm going to change the BISTs to use reproducible matrices and the LU factorization. It is strange that using LU factorization or direct linear system solution can lead to very different results, but this is not a problem in eigs.
While trying to debug this, I noticed that LuAminusSigmaB in liboctave/numeric/eigs-base.cc performs A-sigma*B even if sigma is zero. Is it ok if I put that block inside a if (sigma != 0)?

Marco Caliari <caliari>
Group Member
Mon 30 Jul 2018 01:05:33 PM UTC, comment #11: 

Yes, LU factorization solves both failing tests.

Without LU I see only one failure in eigs test.
With openblas this is


 A = rand (10);
 B = rand (10);


with ref blas this is



 A = rand (10) + 1i * rand (10);
 B = rand (10) + 1i * rand (10);


but apparently some debian buildbots fails both of those tests
with whatever blas library they are using.

Dmitri.
--


Dmitri A. Sergatskov <dasergatskov>
Mon 30 Jul 2018 07:02:27 AM UTC, comment #10: 

@Dmitri: do you mean that the LU factorization solves the problem to the latest tests? Which one fails?

Marco Caliari <caliari>
Group Member
Sun 29 Jul 2018 03:27:08 PM UTC, comment #9: 

yes and yes.

test("eigs", "verbose", "test_eigs.log")
PASSES 187 out of 188 tests

So only one test is failing (though it is a different test
case depending on blas library).

(with either ref blas or openblas)

And i am not the only one. e.g.:

http://buildbot.octave.org:8010/#/builders/10/builds/204/steps/6/logs/stdio

http://buildbot.octave.org:8010/#/builders/19/builds/208/steps/6/logs/stdio

Dmitri.
--


Dmitri A. Sergatskov <dasergatskov>
Sun 29 Jul 2018 02:29:17 PM UTC, comment #8: 

@Dmitri: your tests work for me. What happens if you replace


Afun = @(x) A\x;


with


[L,U,P] = lu(A);
Afun = @(x) U\(L\(P*x));


Do you confirm that the BIST with "LM" option (instead of "SM") work for you?

Marco Caliari <caliari>
Group Member
Sat 28 Jul 2018 04:44:13 PM UTC, comment #7: 

I did not notice that it was different tests that fail with openbls and with reference blas. Attached two test scripts -- one fails with openblas, another with ref blas.
Essentially I used A = sin(a*magic(10)) variations to construct the matrix. The values of "a" does not appear critical, it would fail every time I tried.

Openblas:


LD_PRELOAD=/usr/lib64/libopenblas.so ./run-octave -f -q
octave:1> eigs_fail_openblas
ans = ba8227df92ae
error: ASSERT errors for:  assert (Evector,Evector_f)

  Location  |  Observed  |  Expected  |  Reason
   (1,1)     0.040785+0i  0.040785+0i    Abs err 1.4572e-16 exceeds tol 0 by 1e-16
   (2,1)     -0.055363+0i -0.055363+0i   Abs err 2.7756e-17 exceeds tol 0 by 3e-17
   (3,1)     0.037331+0i  0.037331+0i    Abs err 5.5511e-17 exceeds tol 0 by 6e-17
   (4,1)      0.19551+0i   0.19551+0i    Abs err 1.3878e-16 exceeds tol 0 by 1e-16
   (5,1)      0.13734+0i   0.13734+0i    Abs err 8.3267e-17 exceeds tol 0 by 8e-17
   (6,1)     -0.040516+0i -0.040516+0i   Abs err 7.6328e-17 exceeds tol 0 by 8e-17
   (7,1)     0.045628+0i  0.045628+0i    Abs err 1.1102e-16 exceeds tol 0 by 1e-16
   (8,1)      -0.0456+0i   -0.0456+0i    Abs err 5.5511e-17 exceeds tol 0 by 6e-17
   (9,1)     -0.20177+0i  -0.20177+0i    Abs err 1.1102e-16 exceeds tol 0 by 1e-16
   (10,1)     -0.1282+0i   -0.1282+0i    Abs err 2.7756e-17 exceeds tol 0 by 3e-17
   (1,2)     -0.04529+0i  -0.04529+0i    Abs err 8.3267e-17 exceeds tol 0 by 8e-17
   (2,2)     -0.22421+0i  -0.22421+0i    Abs err 2.7756e-17 exceeds tol 0 by 3e-17
   (3,2)     0.081909+0i  0.081909+0i    Abs err 1.3878e-17 exceeds tol 0 by 1e-17
   (4,2)     -0.021274+0i -0.021274+0i   Abs err 1.3878e-16 exceeds tol 0 by 1e-16
   (5,2)      0.21574+0i   0.21574+0i    Abs err 2.7756e-17 exceeds tol 0 by 3e-17
   (8,2)     -0.074681+0i -0.074681+0i   Abs err 6.9389e-17 exceeds tol 0 by 7e-17
   (9,2)     0.030061+0i  0.030061+0i    Abs err 4.1633e-17 exceeds tol 0 by 4e-17
   (10,2)    -0.21714+0i  -0.21714+0i    Abs err 8.3267e-17 exceeds tol 0 by 8e-17
   (1,3)     0.27472-0.12463i 0.27472-0.12463i   Abs err 5.4672e-16 exceeds tol 0 by 5e-16
   (2,3)     0.24391-0.08352i 0.24391-0.08352i   Abs err 4.003e-16 exceeds tol 0 by 4e-16
   (3,3)     -0.23805-0.022089i -0.23805-0.022089i   Abs err 1.3531e-16 exceeds tol 0 by 1e-16
   (4,3)     0.34398-0.24846i 0.34398-0.24846i   Abs err 1.1322e-15 exceeds tol 0 by 1e-15
   (5,3)     -0.26944-0.14689i -0.26944-0.14689i   Abs err 4.4496e-16 exceeds tol 0 by 4e-16
   (6,3)     -0.26338+0.11476i -0.26338+0.11476i   Abs err 2.0015e-16 exceeds tol 0 by 2e-16
   (7,3)     -0.24263+0.071979i -0.24263+0.071979i   Abs err 5.6201e-16 exceeds tol 0 by 6e-16
   (8,3)     0.21314+0.046626i 0.21314+0.046626i   Abs err 6.9389e-17 exceeds tol 0 by 7e-17
   (9,3)     -0.33649+0.2332i -0.33649+0.2332i   Abs err 8.6933e-16 exceeds tol 0 by 9e-16
   (10,3)    0.26938+0.12755i 0.26938+0.12755i   Abs err 2.2204e-16 exceeds tol 0 by 2e-16
   (1,4)     0.27472+0.12463i 0.27472+0.12463i   Abs err 5.4672e-16 exceeds tol 0 by 5e-16
   (2,4)     0.24391+0.08352i 0.24391+0.08352i   Abs err 4.003e-16 exceeds tol 0 by 4e-16
   (3,4)     -0.23805+0.022089i -0.23805+0.022089i   Abs err 1.3531e-16 exceeds tol 0 by 1e-16
   (4,4)     0.34398+0.24846i 0.34398+0.24846i   Abs err 1.1322e-15 exceeds tol 0 by 1e-15
   (5,4)     -0.26944+0.14689i -0.26944+0.14689i   Abs err 4.4496e-16 exceeds tol 0 by 4e-16
   (6,4)     -0.26338-0.11476i -0.26338-0.11476i   Abs err 2.0015e-16 exceeds tol 0 by 2e-16
   (7,4)     -0.24263-0.071979i -0.24263-0.071979i   Abs err 5.6201e-16 exceeds tol 0 by 6e-16
   (8,4)     0.21314-0.046626i 0.21314-0.046626i   Abs err 6.9389e-17 exceeds tol 0 by 7e-17
   (9,4)     -0.33649-0.2332i -0.33649-0.2332i   Abs err 8.6933e-16 exceeds tol 0 by 9e-16
   (10,4)    0.26938-0.12755i 0.26938-0.12755i   Abs err 2.2204e-16 exceeds tol 0 by 2e-16


and reference blas:


 LD_PRELOAD=/usr/lib64/libblas.so ./run-octave -f -q
octave:1> eigs_fail_refblas
ans = ba8227df92ae
error: ASSERT errors for:  assert (Evector,Evector_f)

  Location  |  Observed  |  Expected  |  Reason
   (1,1)     -0.071017+0.074565i -0.071017+0.074566i   Abs err 3.3524e-07 exceeds tol 0 by 3e-07
   (2,1)     -0.17565-0.2761i -0.17565-0.2761i   Abs err 1.0653e-06 exceeds tol 0 by 1e-06
   (3,1)     -0.0067953+0.006023i -0.0067953+0.006023i   Abs err 2.9562e-08 exceeds tol 0 by 3e-08
   (4,1)     -0.12045-0.13675i -0.12045-0.13675i   Abs err 5.9328e-07 exceeds tol 0 by 6e-07
   (5,1)     -0.10914+0.12296i -0.10914+0.12296i   Abs err 5.3526e-07 exceeds tol 0 by 5e-07
   (6,1)     0.045553+0.13595i 0.045553+0.13595i   Abs err 4.6679e-07 exceeds tol 0 by 5e-07
   (7,1)     -0.14379-0.1448i -0.14379-0.1448i   Abs err 6.6435e-07 exceeds tol 0 by 7e-07
   (8,1)     -0.035338+0.12118i -0.035337+0.12118i   Abs err 4.1094e-07 exceeds tol 0 by 4e-07
   (9,1)     -0.16312-0.09351i -0.16312-0.09351i   Abs err 6.1211e-07 exceeds tol 0 by 6e-07
   (10,1)    -0.035689+0.15288i -0.035688+0.15288i   Abs err 5.111e-07 exceeds tol 0 by 5e-07
   (1,2)     -0.015924+0.001396i 0.004222+0.015417i   Abs err 0.024545 exceeds tol 0 by 0.02
   (2,2)     -0.002571+0.16368i 0.1615-0.026751i   Abs err 0.25137 exceeds tol 0 by 0.3
   (3,2)     0.11059+0.17509i 0.15248-0.14012i   Abs err 0.31798 exceeds tol 0 by 0.3
   (4,2)     -0.11432+0.079543i 0.09871+0.09825i   Abs err 0.21385 exceeds tol 0 by 0.2
   (5,2)     0.17136-0.05308i -0.082878-0.1591i   Abs err 0.27546 exceeds tol 0 by 0.3
   (6,2)     0.025526-0.088726i -0.091861-0.0092429i   Abs err 0.14177 exceeds tol 0 by 0.1
   (7,2)     0.061377+0.11307i 0.10027-0.080615i   Abs err 0.19756 exceeds tol 0 by 0.2
   (8,2)     -0.057129-0.11445i -0.10239+0.076681i   Abs err 0.19642 exceeds tol 0 by 0.2
   (9,2)     0.0041094+0.23767i 0.2331-0.046559i   Abs err 0.365 exceeds tol 0 by 0.4
   (10,2)    0.03398-0.20873i -0.21144+0.003907i   Abs err 0.32472 exceeds tol 0 by 0.3
   (1,3)     0.12455-0.0879i 0.097869-0.11688i   Abs err 0.039388 exceeds tol 0 by 0.04
   (2,3)     -0.043022+0.12201i -0.010325+0.12896i   Abs err 0.033428 exceeds tol 0 by 0.03
   (3,3)     -0.019835+0.042526i -0.008277+0.046188i   Abs err 0.012124 exceeds tol 0 by 0.01
   (4,3)     0.010388+0.082815i 0.031259+0.077389i   Abs err 0.021565 exceeds tol 0 by 0.02
   (5,3)     0.10949-0.048964i 0.093288-0.075382i   Abs err 0.030989 exceeds tol 0 by 0.03
   (6,3)     -0.016475-0.15047i -0.054477-0.14122i   Abs err 0.03911 exceeds tol 0 by 0.04
   (7,3)     0.0016431+0.22524i 0.059296+0.2173i   Abs err 0.058197 exceeds tol 0 by 0.06
   (8,3)     0.015394+0.011785i 0.017899+0.0074471i   Abs err 0.0050091 exceeds tol 0 by 0.005
   (9,3)     0.028258+0.12216i 0.058612+0.11084i   Abs err 0.032396 exceeds tol 0 by 0.03
   (10,3)    -0.040279-0.12763i -0.071634-0.11305i   Abs err 0.034579 exceeds tol 0 by 0.03
   (1,4)     0.016914+0.18931i 0.016914+0.18931i   Abs err 2.163e-15 exceeds tol 0 by 2e-15
   (2,4)     -0.072252+0.010435i -0.072252+0.010435i   Abs err 9.3353e-16 exceeds tol 0 by 9e-16
   (3,4)     -0.12413-0.15762i -0.12413-0.15762i   Abs err 2.2996e-15 exceeds tol 0 by 2e-15
   (4,4)     -0.047428+0.013488i -0.047428+0.013488i   Abs err 6.2107e-16 exceeds tol 0 by 6e-16
   (5,4)     0.0093526+0.073147i 0.0093526+0.073147i   Abs err 8.0083e-16 exceeds tol 0 by 8e-16
   (6,4)     -0.051259+0.049822i -0.051259+0.049822i   Abs err 7.7595e-16 exceeds tol 0 by 8e-16
   (7,4)     -0.036039-0.06536i -0.036039-0.06536i   Abs err 7.5923e-16 exceeds tol 0 by 8e-16
   (8,4)     0.066386+0.064302i 0.066386+0.064302i   Abs err 1.1089e-15 exceeds tol 0 by 1e-15
   (9,4)     0.018931+0.0059828i 0.018931+0.0059828i   Abs err 2.541e-16 exceeds tol 0 by 3e-16
   (10,4)    0.0699+0.15279i 0.0699+0.15279i   Abs err 1.9502e-15 exceeds tol 0 by 2e-15


Dmitri.
--


(file #44644, file #44645)

Dmitri A. Sergatskov <dasergatskov>
Sat 28 Jul 2018 03:46:55 PM UTC, comment #6: 

In the original submission, it was the real nonsymmetric case to fail, in comment #4 it is the complex case. Dmitri, can you find reproducible (no random) examples? I remind you that they should have size larger than 8 (otherwise, eig is called).

For me it works with openblas 0.2.8, atlas 3.10.1, ref blas and arpack 3.3.0.

Marco Caliari <caliari>
Group Member
Sat 28 Jul 2018 03:31:04 PM UTC, comment #5: 

But then the other caases look kind of gross...

Dmitri.
--

Dmitri A. Sergatskov <dasergatskov>
Sat 28 Jul 2018 03:28:40 PM UTC, comment #4: 

Hmm... This is only with openblas. With reference blas it still fails, but no swapping:


 LD_PRELOAD=/usr/lib64/libblas.so ./run-octave -f -q
octave:1> test eigs
***** testif HAVE_ARPACK
 A = rand (10) + 1i * rand (10);
 B = rand (10) + 1i * rand (10);
 B = B * B';
 opts.v0 = (1:10)';
 [Evector, Evalues] = eigs (A, B, 4, "SM", opts);
 Afun = @(x) A \ x;
 opts.isreal = false;
 [Evector_f, Evalues_f] = eigs (Afun, 10, B, 4, "SM", opts);
 assert (Evector, Evector_f);
 assert (Evalues, Evalues_f);
!!!!! test failed
ASSERT errors for:  assert (Evector,Evector_f)

  Location  |  Observed  |  Expected  |  Reason
   (1,1)     0.44932+0.36053i 0.062793+0.57265i   Abs err 0.44091 exceeds tol 0 by 0.4
   (2,1)     -0.2014+0.061636i -0.186-0.098823i   Abs err 0.1612 exceeds tol 0 by 0.2
   (3,1)     0.11407+0.016089i 0.069286+0.092035i   Abs err 0.088168 exceeds tol 0 by 0.09
   (4,1)     0.0063383+0.01503i -0.0061453+0.015109i   Abs err 0.012484 exceeds tol 0 by 0.01
   (5,1)     -0.21947-0.20332i -0.011424-0.29896i   Abs err 0.22898 exceeds tol 0 by 0.2
   (6,1)     0.078061-0.03096i 0.077091+0.033304i   Abs err 0.064272 exceeds tol 0 by 0.06
   (7,1)     0.21379-0.029145i 0.17178+0.13056i   Abs err 0.16514 exceeds tol 0 by 0.2
   (8,1)     0.026375-0.17993i 0.14588-0.10859i   Abs err 0.13918 exceeds tol 0 by 0.1
   (9,1)     -0.26341-0.039268i -0.15849-0.21402i   Abs err 0.20383 exceeds tol 0 by 0.2
   (10,1)    0.022875-0.31838i 0.2413-0.20896i   Abs err 0.2443 exceeds tol 0 by 0.2
   (1,2)     -0.097689+0.26252i -0.082802+0.26758i   Abs err 0.015726 exceeds tol 0 by 0.02
   (2,2)     -0.28431+0.16468i -0.27462+0.18038i   Abs err 0.018447 exceeds tol 0 by 0.02
   (3,2)     -0.059822+0.18621i -0.049277+0.18928i   Abs err 0.010981 exceeds tol 0 by 0.01
   (4,2)     0.19295-0.019498i 0.19155-0.030296i   Abs err 0.010888 exceeds tol 0 by 0.01
   (5,2)     0.29759+0.010432i 0.29771-0.0062855i   Abs err 0.016718 exceeds tol 0 by 0.02
   (6,2)     -0.28995+0.021831i -0.28827+0.038069i   Abs err 0.016325 exceeds tol 0 by 0.02
   (7,2)     -0.091281+0.2275i -0.078369+0.23227i   Abs err 0.013763 exceeds tol 0 by 0.01
   (8,2)     -0.043801-0.23869i -0.057128-0.23586i   Abs err 0.013625 exceeds tol 0 by 0.01
   (9,2)     0.16326-0.35502i 0.14308-0.36362i   Abs err 0.021939 exceeds tol 0 by 0.02
   (10,2)    0.31081-0.18609i 0.29988-0.20324i   Abs err 0.020339 exceeds tol 0 by 0.02
   (1,3)     -0.18758-0.014342i -0.071058-0.17419i   Abs err 0.1978 exceeds tol 0 by 0.2
   (2,3)     0.026441+0.1237i -0.098819+0.078972i   Abs err 0.13301 exceeds tol 0 by 0.1
   (3,3)     0.0013691+0.078902i -0.06996+0.036511i   Abs err 0.082975 exceeds tol 0 by 0.08
   (4,3)     -0.044882+0.037667i -0.053762-0.023299i   Abs err 0.061609 exceeds tol 0 by 0.06
   (5,3)     0.015823-0.01741i 0.022648+0.0063664i   Abs err 0.024736 exceeds tol 0 by 0.02
   (6,3)     -0.17024-0.12416i 0.03492-0.20779i   Abs err 0.22155 exceeds tol 0 by 0.2
   (7,3)     -0.18329+0.01315i -0.09373-0.15806i   Abs err 0.19321 exceeds tol 0 by 0.2
   (8,3)     0.042603-0.059632i 0.072389+0.011437i   Abs err 0.077058 exceeds tol 0 by 0.08
   (9,3)     0.10692-0.077796i 0.1174+0.060844i   Abs err 0.13904 exceeds tol 0 by 0.1
   (10,3)    0.053564+0.089147i -0.055781+0.087777i   Abs err 0.10935 exceeds tol 0 by 0.1
   (1,4)     0.10283-0.28385i 0.10283-0.28385i   Abs err 1.5927e-15 exceeds tol 0 by 2e-15
   (2,4)     0.048707+0.26316i 0.048707+0.26316i   Abs err 1.4289e-15 exceeds tol 0 by 1e-15
   (3,4)     0.13125+0.10726i 0.13125+0.10726i   Abs err 9.4532e-16 exceeds tol 0 by 9e-16
   (4,4)     0.20488+0.03423i 0.20488+0.03423i   Abs err 1.1271e-15 exceeds tol 0 by 1e-15
   (5,4)     -0.10285+0.11154i -0.10285+0.11154i   Abs err 8.2803e-16 exceeds tol 0 by 8e-16
   (6,4)     -0.26098-0.37498i -0.26098-0.37498i   Abs err 2.2651e-15 exceeds tol 0 by 2e-15
   (7,4)     -0.35516+0.012622i -0.35516+0.012622i   Abs err 1.8629e-15 exceeds tol 0 by 2e-15
   (8,4)     -0.029845-0.049972i -0.029845-0.049972i   Abs err 3.1101e-16 exceeds tol 0 by 3e-16
   (9,4)     0.45968+0.13373i 0.45968+0.13373i   Abs err 2.5853e-15 exceeds tol 0 by 3e-15
   (10,4)    -0.10302+0.075966i -0.10302+0.075966i   Abs err 6.5506e-16 exceeds tol 0 by 7e-16


Dmitri.
--

Dmitri A. Sergatskov <dasergatskov>
Sat 28 Jul 2018 03:21:31 PM UTC, comment #3: 

Wait, in the last part of the assert error, real and imaginary parts are swapped between observed and expected. This is super strange.

Marco Caliari <caliari>
Group Member
Sat 28 Jul 2018 12:43:20 PM UTC, comment #2: 

Yes, Imessed up the changeset. Somehow with new buildbot it is more difficult to find out what changeset caused the particular build.

I used openblas-0.3.1; I see now that it passes with atlas (3.10.3), still fails with reference blas (3.8.0).

Dmitri.
--

Dmitri A. Sergatskov <dasergatskov>
Sat 28 Jul 2018 04:40:06 AM UTC, comment #1: 

Adding Marco to the CC list.  The failing tests are most likely due to this changeset.  I don't see why adding a tolerance of 5 eps would be a problem.  This also probably depends on which BLAS libraries you are using.


changeset:   25696:3b6691ff0f59
parent:      25693:038fb01854a0
user:        Marco Caliari <marco.caliari@univr.it>
date:        Wed Jun 27 08:36:55 2018 +0200
summary:     Fix eigs for generalized problems with user defined function (bug #54167).



Rik <rik5>
Group administrator
Sat 28 Jul 2018 02:38:40 AM UTC, original submission:  

It appears that after the last check-in:

hg head
changeset:   25697:91f0416c2ba7
bookmark:    @
tag:         tip
parent:      25696:3b6691ff0f59
parent:      25695:cfc32b131755
user:        John W. Eaton <jwe@octave.org>
date:        Fri Jul 27 18:15:17 2018 -0400
summary:     maint: Merge stable to default.

changeset:   25695:cfc32b131755
branch:      stable
user:        John W. Eaton <jwe@octave.org>
date:        Fri Jul 27 13:21:50 2018 -0400
summary:     avoid questionable cast

test eigs fil with:



octave:1> test eigs
***** testif HAVE_ARPACK
 A = rand (10);
 B = rand (10);
 B = B * B';
 opts.v0 = (1:10)';
 [Evector, Evalues] = eigs (A, B, 4, "SM", opts);
 Afun = @(x) A \ x;
 [Evector_f Evalues_f] = eigs (Afun, 10, B, 4, "SM", opts);
 assert (Evector, Evector_f);
 assert (Evalues, Evalues_f);
!!!!! test failed
ASSERT errors for:  assert (Evector,Evector_f)

  Location  |  Observed  |  Expected  |  Reason
   (1,1)     0.039202+0i  0.039202+0i    Abs err 8.3267e-17 exceeds tol 0 by 8e-17
   (2,1)     -0.47728+0i  -0.47728+0i    Abs err 5.5511e-17 exceeds tol 0 by 6e-17
   (3,1)     -0.26688+0i  -0.26688+0i    Abs err 5.5511e-17 exceeds tol 0 by 6e-17
   (4,1)      0.24262+0i   0.24262+0i    Abs err 5.5511e-17 exceeds tol 0 by 6e-17
   (5,1)     -0.30222+0i  -0.30222+0i    Abs err 1.6653e-16 exceeds tol 0 by 2e-16
   (6,1)      0.3733+0i    0.3733+0i     Abs err 5.5511e-17 exceeds tol 0 by 6e-17
   (7,1)      0.20615+0i   0.20615+0i    Abs err 5.5511e-17 exceeds tol 0 by 6e-17
   (8,1)      0.24472+0i   0.24472+0i    Abs err 2.7756e-16 exceeds tol 0 by 3e-16
   (9,1)     -0.032564+0i -0.032564+0i   Abs err 8.3267e-17 exceeds tol 0 by 8e-17
   (10,1)    0.067874+0i  0.067874+0i    Abs err 5.5511e-17 exceeds tol 0 by 6e-17
   (1,2)     -0.14068+0i  -0.14068+0i    Abs err 6.9389e-16 exceeds tol 0 by 7e-16
   (2,2)     -0.47604+0i  -0.47604+0i    Abs err 8.3267e-16 exceeds tol 0 by 8e-16
   (3,2)      0.12838+0i   0.12838+0i    Abs err 1.1102e-16 exceeds tol 0 by 1e-16
   (4,2)     -0.10735+0i  -0.10735+0i    Abs err 5.5511e-17 exceeds tol 0 by 6e-17
   (5,2)     -0.0013885+0i -0.0013885+0i   Abs err 1.1178e-15 exceeds tol 0 by 1e-15
   (6,2)     0.098606+0i  0.098606+0i    Abs err 4.1633e-16 exceeds tol 0 by 4e-16
   (7,2)      0.20902+0i   0.20902+0i    Abs err 5.8287e-16 exceeds tol 0 by 6e-16
   (8,2)      0.23101+0i   0.23101+0i    Abs err 1.3323e-15 exceeds tol 0 by 1e-15
   (9,2)     0.052558+0i  0.052558+0i    Abs err 9.4369e-16 exceeds tol 0 by 9e-16
   (10,2)    -0.37364+0i  -0.37364+0i    Abs err 7.7716e-16 exceeds tol 0 by 8e-16
   (1,3)     -0.31312+0i  -0.31312+0i    Abs err 4.4409e-16 exceeds tol 0 by 4e-16
   (2,3)     -0.55234+0i  -0.55234+0i    Abs err 2.2204e-16 exceeds tol 0 by 2e-16
   (3,3)     0.082344+0i  0.082344+0i    Abs err 4.5797e-16 exceeds tol 0 by 5e-16
   (4,3)     -0.080656+0i -0.080656+0i   Abs err 1.3878e-16 exceeds tol 0 by 1e-16
   (5,3)      0.3594+0i    0.3594+0i     Abs err 3.8858e-16 exceeds tol 0 by 4e-16
   (6,3)      0.22037+0i   0.22037+0i    Abs err 6.1062e-16 exceeds tol 0 by 6e-16
   (7,3)      0.35982+0i   0.35982+0i    Abs err 3.8858e-16 exceeds tol 0 by 4e-16
   (8,3)      0.27437+0i   0.27437+0i    Abs err 4.996e-16 exceeds tol 0 by 5e-16
   (9,3)      0.39752+0i   0.39752+0i    Abs err 1.0547e-15 exceeds tol 0 by 1e-15
   (10,3)    -0.50035+0i  -0.50035+0i    Abs err 1.1102e-16 exceeds tol 0 by 1e-16
   (1,4)     -0.084833+0.40857i 0.40857+0.084833i   Abs err 0.59012 exceeds tol 0 by 0.6
   (2,4)     0.14708-0.48518i -0.48518-0.14708i   Abs err 0.71698 exceeds tol 0 by 0.7
   (3,4)     -0.29952-0.10353i -0.10353+0.29952i   Abs err 0.44817 exceeds tol 0 by 0.4
   (4,4)     -0.028404+0.22032i 0.22032+0.028404i   Abs err 0.31416 exceeds tol 0 by 0.3
   (5,4)     -0.059085-0.18242i -0.18242+0.059085i   Abs err 0.27118 exceeds tol 0 by 0.3
   (6,4)     -0.13868+0.15719i 0.15719+0.13868i   Abs err 0.29645 exceeds tol 0 by 0.3
   (7,4)     -0.32197+0.42888i 0.42888+0.32197i   Abs err 0.75843 exceeds tol 0 by 0.8
   (8,4)     0.11036-0.7379i -0.7379-0.11036i   Abs err 1.0552 exceeds tol 0 by 1
   (9,4)     0.062964+0.40427i 0.40427-0.062964i   Abs err 0.57862 exceeds tol 0 by 0.6
   (10,4)    0.60332-0.30705i -0.30705-0.60332i   Abs err 0.95737 exceeds tol 0 by 1
octave:2>


I think assert needs some tolerance.

Dmitri.
--

Dmitri A. Sergatskov <dasergatskov>

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #44679:  eigs2.diff added by caliari (9KiB - application/x-tex)
file #44660:  eigs.diff added by caliari (3KiB - application/x-tex)
file #44644:  eigs_fail_refblas.m added by dasergatskov (399B - text/x-objcsrc)
file #44645:  eigs_fail_openblas.m added by dasergatskov (355B - text/x-objcsrc)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by caliari (Posted a comment)
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by rik5
  • -email is unavailable- added by dasergatskov (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 14 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2018-08-01 rik5 StatusPatch Submitted Fixed
        Open/ClosedOpen Closed
    2018-08-01 caliari Attached File- Added eigs2.diff, #44679
        StatusIn Progress Patch Submitted
    2018-07-30 rik5 CategoryTest Suite Octave Function
        Item GroupNone Performance
        Summarytest eigs fail function LuAminusSigmaB in eigs-base.cc can be made faster for special case of sigma == 0
    2018-07-30 rik5 StatusPatch Submitted In Progress
    2018-07-30 caliari Attached File- Added eigs.diff, #44660
        StatusIn Progress Patch Submitted
    2018-07-30 caliari StatusNone In Progress
    2018-07-28 dasergatskov Attached File- Added eigs_fail_refblas.m, #44644
        Attached File- Added eigs_fail_openblas.m, #44645
    2018-07-28 rik5 Carbon-Copy- Added caliari

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code