[petsc-users] [SLEPc] Best method to compute all eigenvalues of a MatShell
Sreeram R Venkat
srvenkat at utexas.edu
Mon May 13 14:51:38 CDT 2024
I also just ran with cupy.linalg.eigvalsh (which wraps cuSOLVER), and it
only took 3.1 seconds. I will probably use this, but it is good to know
about the SLEPc cases if I don't need the full spectrum or have sparse
matrices, etc.
Thanks,
Sreeram
On Mon, May 13, 2024 at 2:13 PM Sreeram R Venkat <srvenkat at utexas.edu>
wrote:
>
> Apologies, I accidentally hit "reply" instead of "reply-all."
>
> Thank you for the reference. Actually, I just tested that N ~ 1e4 case
> where I had saved the dense matrix to a python-readable format. Using
> scipy.linalg.eigvalsh, I got the eigenvalues in ~1.5 minutes. They agree
> with the ones I got from SLEPc as well. I believe the scipy routine just
> calls LAPACK in the backend, so I assume I would get similar results if I
> used the LAPACK solver in SLEPc.
>
> The MatShell object I am working with requires me to operate on multiple
> processes to fit all the data, so to use the LAPACK solver in SLEPc, I
> believe I would have to read/write the dense matrix as well.
>
> So at the cost of storing the dense matrix, I think the dense eigensolver
> seems to be the way to go. I will need to store at least one large dense
> matrix of this size for my application, so that should not be the limiting
> factor.
>
> Sreeram
>
> On Mon, May 13, 2024 at 1:54 PM Jose E. Roman <jroman at dsic.upv.es> wrote:
>
>> Please respond to the list.
>>
>> The mpd parameter means "maximum projected dimension". You can think of
>> the projected problem as the "sequential" part of the computation, that is
>> not parallelized ("small" dense eigenproblem). When you run with MPI,
>> everything will scale reasonably well except that part, so it is better to
>> keep it small, specially when you request many eigenvalues. A value
>> mpd=2000 might be too large, it may be better to reduce it to 500, say. The
>> paper https://urldefense.us/v3/__https://doi.org/10.1016/j.cpc.2010.09.007__;!!G_uCfscf7eWS!f2yCdZSL_oAtFe32noZqGhwa3rbTgx34qUGo9HuXkP6nQm_-ryGpPFxDt_2hEv3HzLy7POL3H28uob9D4qchyj3kXA$ includes a discussion on
>> the ncv and mpd paramters, mostly in terms of memory usage.
>>
>> Jose
>>
>> > El 13 may 2024, a las 20:33, Sreeram R Venkat <srvenkat at utexas.edu>
>> escribió:
>> >
>> > Thank you for the suggestions. I will try out LAPACK/ELPA and the n/2
>> method. For the latter, how should I choose the MPD? In the examples I
>> could find online, it looked like they were using something like mpd ~
>> nev/10.
>> >
>> > Sreeram
>> >
>>
>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20240513/e91bddae/attachment-0001.html>
More information about the petsc-users
mailing list