# Libraries for solving sparse linear systems

There are a number of different libraries out there that solve a sparse linear system of equations, however I'm finding it difficult to figure out what the differences are.

As far as I can tell there are three major packages: Trilinos, PETSc, and Intel MKL. They can all do sparse matrix solves, they are all fast (as far as I can tell, I haven't been able to find solid benchmarks on any of them), and they are all parallelizable. What I can't find is the differences.

So, what are the differences between the different sparse linear system solvers out there?

-

## 2 Answers

There are many more out there, all with different goals and views of the problems. It really depends on what you are trying to solve. Here is an incomplete list of packages out there. Feel free to add more details.

## Large Distributed Iterative Solver Packages

• PETSc — packages focused around Krylov subspace methods and easy switching between linear solvers. Much lighter weight than others in this category.
• Trilinos — a large set of packages aimed at FEM applications
• Hypre — similar to the two above. Notable because of its very good multigrid solvers (which can be downloaded by PETSc).

## Other Lists

-

MKL does not do distributed parallelism (e.g. MPI), and the support for sparse solvers is rudimentary, definitely not at the level of the other two. Currently, there is only one meaningful benchmark: scalable performance of Sparse Matrix-Vector product (SpMV). Since this is memory bandwidth limited, you can only screw it up. Both PETSc and Trilinos do fine on this.

The real difference is which programming environment makes you more productive.

-
So it pretty much boils down to if you want to be doing work in C or C++? – Andrew Spott Nov 30 '11 at 18:04
It's a little more open-ended than that. You could certainly call Trilinos or PETSc from most of the numerical computing languages (C, Python, C++, and Fortran are all viable options, and to some extent, MATLAB). – Aron Ahmadia Nov 30 '11 at 18:16
PETSc does the F90 array handling correctly :), and the entire object model is available in Matlab. – Matt Knepley Nov 30 '11 at 18:24
PETSc and Trilinos also engage different communities, to some extent. Perhaps you should consider first the sort of problems you would like to solve, and if any existing examples of similar problems are already available in either toolkit? – Aron Ahmadia Nov 30 '11 at 19:44
I would recommend looking at the examples of the different projects then deciding. If you have a specific example of which system would be better for a problem, that would be a more answerable question. Otherwise, we will only start the religious war that carried through my graduate career. – aterrel Nov 30 '11 at 22:41