I have a Matlab code computing the solution to an eigenvalue PDE. It consists of two parts: assembly of the stiffness/rigidity matrices and solving a generalized eigenvalue problem. I mention that the assembly is done using vectorized code in Matlab. It is likely that I would need to run the program on a quite large database of test-cases (a few million cases). In this case, performance in terms of computational time becomes noticeable.
I was wondering what could be the gain if I tried to code the algorithm in C/C++ ? (not sure I am capable of that... :) but I want to weigh the potential benefits)
I guess assembly could go faster, but the eigenvalue solver is pretty efficient in Matlab.
What is your experience with situations like this? Can coding in a faster language give important computation time reduction compared to Matlab?
More details on the problem as requested:
- eigenvalue computation for the Laplace-Beltrami operator on a portion of the sphere
- I use Lagrange P1 finite elements on a triangular mesh of the surface domain
- example of Matlab computation time for roughly 780000 points (degrees of freedom): assembly 3 seconds, eigenvalue computation 26 seconds
Apparently, the significant part of the computation is finding the eigenvalue. Maybe using SlepC could help with this... (In some old manual I saw a SlepC interface for Matlab, but not in the new ones...)