Sparse backslash stopped doing pivoting forever after crash

1 view (last 30 days)
Earlier today when I was trying to solve a large sparse complex-valued problem, Matlab r2014a got so low on memory that my system hung and I had to kill the process with the windows task manager. Ever since then, backslash of large complex-valued sparse matrices is much slower than before, and consumes much more memory. It feels like Matlab "forgot" how to do pivoting.
At first I thought I was going crazy, but luckily I still have an older version of Matlab installed (r2012a) to compare to. Consider the following commands:
N = 200;
A = 1i*gallery('poisson',N);
m = N^2/2;
A(1:m,1:m)\A(1:m,m+1:end);
Here is an image comparing the windows memory usage for the same command above run on r2014a (my corrupted version) vs. r2012a:
Clearly something is wrong with my installation of r2014a. To remedy this, I tried the following.
  • First, I restarted my computer. The problem remained.
  • Second, I uninstalled/deactivated my copy of r2014a, then deleted the Matlab folder, then reinstalled/reactivated. Even after reinstalling, the same problem remains. :(
What is going on here? How could the problem remain even after I reinstalled Matlab? Any ideas how to fix it?
----
A few notes:
1) If I explicitly tell Matlab to perform a pivoted LU factorization, it works fine. Eg., no problems with this sequence of commands:
N = 200;
A = 1i*gallery('poisson',N);
m = N^2/2;
[L,U,P,Q] = lu(A(1:m,1:m));
Q\(U\(L\(P\A(1:m,m+1:end)))); % OK
2) If the problem is small enough that I don't have to kill the process, backslash eventually finishes and returns a correct answer.
3) If the matrix is real, it works fine. Eg., (note the lack of 1i):
N = 200;
A = gallery('poisson',N);
m = N^2/2;
A(1:m,1:m)\A(1:m,m+1:end); % OK

Answers (1)

Titus Edelhofer
Titus Edelhofer on 6 Jan 2015
Hi,
interesting observation ;-).
The "forgot to do pivoting" got me thinking. Please take a look at the function spparms:
doc spparms
There you can specify to use umfpack or LU based solver for "\". It seems that in this special case the LU based solver is the better choice. The umfpack was already available in R2012a, but the problem does not arise there. My guess therefore is, that R2012a does not use umfpack for complex matrices.
Specifying
spparms('umfpack', 0)
before doing the "\" works fine and fast for your case in R2014a.
Titus
  3 Comments
Nick Alger
Nick Alger on 6 Jan 2015
Interesting. This workaround does work. However, the question is then, why did r2014a work fine before the first time it crashed? Maybe my UMFPACK install has a problem, and won't terminate when Matlab tells it to?
Titus Edelhofer
Titus Edelhofer on 7 Jan 2015
Admittedly I don't know. On my machine the memory consumption showed the same behavior as in your screenshot also the first time I tried.

Sign in to comment.

Categories

Find more on Introduction to Installation and Licensing in Help Center and File Exchange

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!