Problems with the parallel inversion of a large, sparse and linear system in Matlab

7 views (last 30 days)
I am trying to figure out how to invert a sparse system (x=A\b) in parallel. I've tried the spmd environment, but apparently it has a problem with sparse matrices (I get the error message that sparse matrices are not supported). Do I need to use a different setup? How can I invert a large, sparse, and linear system in parallel using Matlab?
Thanks a lot, Jenny

Answers (1)

John D'Errico
John D'Errico on 7 Feb 2023
You should NEVER be inverting a large sparse linear system. The result will generally not be sparse, so you will then gain nothing from the sparsity. All it does is then make the code run more slowly, and use more memory.
Instead, you should be using tools to form matrix factorizatinos, which if properly chosen, and with proper -reordering of the row/columns, a grat deal of sparity can be maintained in the factors. Even better is to recognize that the sparse system often needs never to be inverted at all. Just use one of the iterative solvers to solve the linear system, since almost always, when you are computing a matrix inverse, that is why you needed to do it in the first place.


Find more on Sparse Matrices in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by