Parallel computing for eigs() function

Hello, I am new to julia and parallel computing. I want to use parallel computing capability in julia in doing shift-invert calculations. My problem is that I have a couple of sparse matrices, and want to find specific eigenvalue of these matrices. depending on the size of my matrices, I want to use 4-24 of cores available on each computing node. The usual sparse matrices, shift-invert, Arpack function I use is as follows:

Val, Vec = eigs(A, nev=10, sigma=-5, ritzvec=true, tol=0.0);

My question is how can I run this single function on multiple cores. There is no ‘for loop’ in my code, just this line.

Thank you,

1 Like

To the best of my knowledge there is no way to run the Arpack eigensolver in parallel. Since the process is iterative, the previous result is needed in every step of the iteration in order to obtain a new approximation to a subspace. However, it might be possible to parallelize the application of the operator (i.e. the shift-and-invert operation in your case) to the vectors of the krylov subspace.

1 Like

It looks like there is a P_ARPACK library that uses MPI to to do ARPACK algorithms in parallel. This doesn’t appear to have a counterpart in julia, but you can make a ccall wrapper to use it from julia.

If you do succeed in getting that working, it may be a valuable contribution to the julia community as a package.

3 Likes

Thank you for your reply. Strange thing is that on my personal computer, I see that all my core are 100% working when I use:

eigs(sparse(rand(n,n)), nev=10, sigma=5, ritzvec=true, tol=0.0)

But whenever I load my desire matrix from a .txt file, only one CPU get to work.

For the case that all my core start to work, I don’t do anything regarding parallel computing, even when I start julia by:

julia -p 2

still, there are 8 workers.

I believe Arpack calls into blas. Then multiple threads might be engaged.

2 Likes

According to my observations, it seems like only the initial factorization of the matrix is performed using multiple threads and afterwards only a single one is used. But honestly, I do not know whether it makes sense to perform the subsequent calculations in parallel…

2 Likes

I just came across this library: https://pardiso-project.org which does have a julia wrapper already: https://github.com/JuliaSparse/Pardiso.jl

1 Like

Hi, could you please tell me how you can use eigs() in Julia 1.0 version?
I cannot find this function.

eigs is now in Arpack.jl

1 Like