GUI crashes when using eigs with a nonzero shift on a large generalised eigenvalue problem.
1 view (last 30 days)
Simon Kern on 27 Sep 2022
I am using matlab's eigs function to compute a few (5-10) eigenvalues close to a complex non-zero shift sigma of a complex valued generalized eigenvalue problem consisting of a system matrix F and a mass matrix M, both stored in sparse format.
The code I am running is the following:
nev = 10;
shift = 0.01 + 2.8*1i;
opts_F.tol = 1e-9;
opts_F.maxit = 1000;
opts_F.p = 3*nev;
opts_F.disp = 0;
[V,D] = eigs(F, -M, nev, shift/2, opts_F);
For a certain parameter setting where my system matrix is of the order 83000 x 83000 and nnz = ~130 million I can solve the problem. F has a size of ~3GB here.
For a slightly larger system matrix (3.7 GB, 99000 x 99000 with nnz = ~160 million) the GUI crashes mid computation for no detectable reason.
I have tried only computing a single eigenvalue for the large problem and this worked; unfortunately I need at least a few eigenvalue. Considering that I am running the computations on my workstation with 128GB RAM and a cpu with 12 cores (intel Core i9-9920X CPU @ 3.50GHz) I do not see that absolute sizes in the order of a few GB are a deal breaker. Is there some restriction on the matrix sizes for eigs? What else might be the reason for the crash? Could it be on the OS side?
I have also tried closing all but the most essential programs on the workstation while matlab was running to no avail.
I have tried using an external function to compute the action of the system matrix F on a vector instead of constructing it but this is not viable given that in order to use such a function in conjunction with eigs I would need to solve the system (F - sigma*M*I)\x at every step of the arnoldi iteration for which I do not have an efficient solver. This method using e.g. GMRES with a textbook preconditioner, is unfeasibly inefficient and alternative approaches of this sort will need to wait.
I am very grateful for any insight as to how I should proceed in this situation.
Christine Tobler on 27 Sep 2022
Ideally this shouldn't crash, but produce an out-of-memory error. However, for example on Linux there is the "out-of-memory killer", a process that will detect when too much system memory is used and just kill the process that uses the most memory. Since this happens on the OS side and not as an error when trying to allocate, MATLAB can't do much about it.
Now about the actual problem: I would have thought that the memory need for computing a factorization of F - sigma*M is what causes the out-of-memory error, but then that should also affect asking for just one eigenvalue. You could try calling
dA = decomposition(F - sigma*M);
and seeing if this finishes, and if yes, how much memory is left over on your OS. You can reuse that factorization by passing a function handle @(x) dA \ x into eigs as its first input (with the second input specifying the matrix size).
You could then try to use the SubspaceDimension NVP to limit the additional search space to be allocated in eigs; however, this usually really isn't that much, so I'm a bit astonished that it would be a problem.
More Answers (1)
Steven Lord on 27 Sep 2022
Please send the crash log file along with the code and data with which you can reproduce the crash to Technical Support directly using the Contact Support link under the Get Support heading at the end of this page. Since those data files are likely to be quite large, if you contact Support and let them know you have a large data file to upload they should be able to set up a secure location to which you can upload the file.