0
$\begingroup$

I am working on a flow physics problem (2D), which ultimately boils down to solving Eigen value problem. Even for a grid size of 60 x 60, the matrix in the Eigen value problem end up with 1260 million elements (This matrix has to be solved iteratively!). Sometimes the matrix is sparse and other times it is not depending on the nature of problem to be solved.

I use ARPACK written in Fortran to solve the problem. Surprisingly, MATLAB solves the same Eigen value problems at least 5 times faster than the Fortran counterpart. (And I wonder how!)

My question is : Are there any techniques that is known in the computation community to speed up the Eigen solver?

Parallel-ized ARPACK is one solution that I tried, but still not up to the level of MATLAB

$\endgroup$
  • 3
    $\begingroup$ You did not say whether you are trying to calculate a few of the smallest, largest, or other subset of the eigenvalues of your matrix? (If you are trying to calculate all eigenvalues for such a large matrix, my suggestion would be to look for a different solution approach.) The eigs function in MATLAB uses arpack so you should be able to duplicate its performance by calling arpack directly. $\endgroup$ – Bill Greene Dec 20 '16 at 13:54
  • $\begingroup$ @BillGreene : Now, that you asked this, I thought about it and I realised that I need only the set of smallest eigen values and corresponding eigen vectors. Also, I would like add that my matrix is Complex(data type) $\endgroup$ – Rhinocerotidae Dec 20 '16 at 14:31
  • 3
    $\begingroup$ It's likely that MATLAB is using a more efficient matrix-vector multiplication than you are. In particular, if your computer has multiple processor cores, MATLAB might be doing the matrix-vector multiplications in parallel. $\endgroup$ – Brian Borchers Dec 20 '16 at 14:44
  • $\begingroup$ OK, arpack is a good choice if you want only a few of the smallest eigenpairs. It would be a poor choice if you are trying to calculate all eigenvalues-- which it sounds like you might be doing. You say that sometimes your matrix is sparse and sometimes dense? That is unusual. The approaches to making arpack faster will be fairly different depending on those two situations. $\endgroup$ – Bill Greene Dec 20 '16 at 15:45
  • 4
    $\begingroup$ Sometimes problems are just caused by memory operations like copying. Profile your program to actually see what the critical part is. $\endgroup$ – Tobias Dec 21 '16 at 0:30
3
$\begingroup$

MATLAB's eigs function simply calls ARPACK. So if you are using that, there is no difference and they should be equally fast. If they are not, the difference is in your own code.

$\endgroup$
0
$\begingroup$

I'm not an expert on this, but from what I can tell all of your matrix operations essentially reduce to polynomial time algorithms at best. MatLab, being purpose-specific software might be using some tricks to get results faster (heuristics, caching or look-up tables). People might look at you funny if you tell them math is hard, but most of it is NP-hard or NPC. ColPack is another related software library that does a great job with graph coloring.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.