-3

I'm using eigen3 package in c++ to invert some large sparse matrices (e.g. 12000*12000) which I need for later operations; however, it's really time-consuming and I can't extend it to larger matrices. Is it possible to do this in parallel for example using openmp?

Thanks in advance.

So R Kh
  • 3
  • 3
  • 2
    Are you sure you need to invert the matrix? How about solving `Ax = b` instead? (<- Will probably be faster and more stable.) – Baum mit Augen May 27 '16 at 14:29
  • 3
    Also, the inverse of a sparse matrix is not sparse in general, so expect increased memory use (> 1 GB for 12k x 12k, ca. 115GB for 120k x 120k) and slow matrix-vector multiplication if you actually do the inversion. – Baum mit Augen May 27 '16 at 14:35
  • @BaummitAugen it seems like you're not familiar with eigen packages! it is specifically designed for sparse/dense matrix manipulations and does not directly inverse the matrix; indeed, it does use the solve() function and so on... – So R Kh May 30 '16 at 07:53
  • @BaummitAugen still for my purposes, I need the calculation to be faster, so I thought it could be an idea to try the inversion in parallel using openmp to compare... – So R Kh May 30 '16 at 07:55
  • You can use Eigen to actually invert matrices alright. Anyways, afaik, Eigen has no "parallel mode" out of the box, it's more tuned towards usability than performance. (Which is still decent, don't get me wrong.) – Baum mit Augen May 30 '16 at 15:39

1 Answers1

0

You could use Eigen as a sparse matrix container and use MKL parallel sparse solver functions to calculate the inversion.

https://software.intel.com/node/521676

Although Eigen does not provide APIs for MKL spare solvers. You could still use them with low-level interface.

kangshiyin
  • 9,681
  • 1
  • 17
  • 29