# How to parallelize the computation of eigenvalues of a sparse symmetric matrix in MATLAB?

I have a similarity matrix which is symmetric and sparse. How can I parallelize the computation of the eigenvalues of this matrix in MATLAB?

• Do you have access to Parallel Computing Toolbox? Otherwise, you can code in Fortran using LAPACK (or whichever library you prefer) and link it to MATLAB using MEX. – Inquest Apr 26 '12 at 10:52
• Thanks to Nunixic! I don't know Fortran. I know Parallel Computing Toolbox, but I have no experience . I know the function eig to compute eigenvalues in MATLAB, but I don't know the way to use parallelism for this, or I have to code for computation eigenvalues myself and then parallel it. If you know, please give me some guides. Thanks! – HongTu Apr 26 '12 at 11:09
• Hi HongTu. Welcome to SciComp :) I'm curious... are you looking to implement the computation of eigenvalues yourself, or are you looking for a MATLAB routine that already computes them in parallel? Also, do you need all the eigenvalues, or just one in particular (e.g. spectral radius)? – Paul Apr 26 '12 at 13:44
• Hi Paul, thanks for your consideration for my problem. I'm really trying to code it myself. But I also look for the already parallelism for this because I haven't more time for my project at university. I don't need all the eigenvalues, just some largest or smallest eigenvalues. I have a similarity matrix of image, so this matrix is very large. So I think parallelism for the computation will get better performance. But I'm new in parallel computation. So I really need some guides. Thanks! – HongTu Apr 26 '12 at 14:53
• I haven't worked on MATLAB's PCT much but MATLAB"s newsletter and this article at OSC could be good starting points. Seems like what you need is overloaded functions on codistributed arrays. How do you access the matrix? If you have the MATRIX explicitly available (or you read from file or whatever), writing a parallel eigen solver is sell than 20 lines in FORTRAN when linked to an LAPACK. – Inquest Apr 26 '12 at 16:39

MathWorks doesn't think this is a good idea. Their basic defense for not multithreading eigs is that the MATLAB sparse matrix-vector products will not significantly benefit from multithreading. I recommend that you look into some of the libraries discussed in another answer on scicomp if you are interested in computing eigenvalues more efficiently.