|
[Sponsors] |
Is there any library for computing the inverse of a sparse matrix using parallelism? |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
November 22, 2018, 03:21 |
Is there any library for computing the inverse of a sparse matrix using parallelism?
|
#1 |
Senior Member
Hector Redal
Join Date: Aug 2010
Location: Madrid, Spain
Posts: 243
Rep Power: 17 |
Hi,
I would like to know if there exists a mathematical library that can be used for computing the inverse of a matrix (or the solution to a A . x = b linear system) leveraging in paralelism. Currently I am using Eigen library, but the obtained paralelism is not very high. Thanks in advance for your support. Best regards, |
|
November 22, 2018, 05:19 |
|
#2 |
Senior Member
|
Computing the inverse is quite different from computing the solution to the system, for a number of reasons. In practice, the inverse is almost never looked for, especially for large parallel systems.
Try giving a look at PETSc and Hypre. PETSc is basically targeted toward giving you the solution but, maybe, among the different third party libraries it can link to, you may find also something for the inverse. |
|
November 22, 2018, 09:30 |
|
#3 |
Super Moderator
|
As sbaffini wrote, do you really need the inverse matrix ?
Anyway, MUMPS is a direct solver that works in parallel. It can solve Ax=b but I dont know if it can compute the inverse. You can do this yourself as follows. First compute the LU decomposition using MUMPS. Then solve a sequence of problems with varying right hand side A x_i = e_i, for i=1,2,...,n where e_i has zeros except it has 1 at i'th location. Then the matrix X = [x_1, x_2, ..., x_n] is the inverse of A. Solving these problems is cheap (O(n^2) in general) as compare to computing the LU decomposition which costs O(n^3). There is also superlu_dist. Both of these can be used via PETSc I think. If you already have your matrices setup in PETSc, then it is easy. |
|
November 22, 2018, 19:09 |
|
#4 |
Senior Member
Hector Redal
Join Date: Aug 2010
Location: Madrid, Spain
Posts: 243
Rep Power: 17 |
Hi,
I don't really need the computation of the inverse matrix. Indeed, in my current implementation, I am solving the linear system A . x = b without computing the inverse of the sparse matrix. I have implemented the BiGSTAB method for sparse matrices. I was just looking for a more efficient manner, since I have spotted the bottleneck of the computation in this part of the software. Thanks for the references, I will take a look at them. Best regards, |
|
November 23, 2018, 01:44 |
|
#5 |
Super Moderator
|
If your goal is to solve large problems, then I would recommend learning to use petsc. PETSc has its own solvers and it can also call many other solvers. So advantage is if you build your matrix/rhs in petsc, you can experiment with many solvers easily, and you dont have to learn to use all of them, since each one will have its own interface/data structures.
|
|
November 23, 2018, 04:22 |
|
#6 | |
Senior Member
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,896
Rep Power: 73 |
Quote:
An answer depends also on the shape of your matrix, sparse or not. If it is a matrix obtained by the discretization of elliptic equations on structured grids, you can find surprising that a black/white-marked SOR method will be the most efficient in terms of computational time and memory cost. |
||
November 23, 2018, 05:06 |
|
#7 | |
Senior Member
Hector Redal
Join Date: Aug 2010
Location: Madrid, Spain
Posts: 243
Rep Power: 17 |
Quote:
I will give it a try to petsc. Thanks. |
||
November 23, 2018, 05:07 |
|
#8 | |
Senior Member
Hector Redal
Join Date: Aug 2010
Location: Madrid, Spain
Posts: 243
Rep Power: 17 |
Quote:
The matrix is obtained from unstructured grids (no structured grid). That's the reason why I am using sparse matrices. Thanks. |
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
decomposePar is missing a library | whk1992 | OpenFOAM Pre-Processing | 8 | March 7, 2015 08:53 |
How can I find the inverse of a sparse matrix | mechy | OpenFOAM Programming & Development | 2 | January 19, 2014 22:29 |
Is there any c++ library that can be used for matrix calculation? | HectorRedal | Main CFD Forum | 12 | July 20, 2011 13:48 |
C++ solver for Large sparse matrix! | sina_mech | Main CFD Forum | 7 | November 20, 2009 14:52 |
OpenFOAM version 1.6 details | lakeat | OpenFOAM Running, Solving & CFD | 42 | August 26, 2009 22:47 |