How can I solve linear equation system in parallel?

조회 수: 26 (최근 30일)
Javier Alaminos
Javier Alaminos 2020년 1월 14일
댓글: Heiko Weichelt 2020년 1월 14일
I am solving a linear equation system, , where A is a sparse square matrix and B is a sparse column vector. Before solving the system I use the command
dA = decomposition(A);
to return a decomposition of matrix A that I can use to solve the linear system more efficiently. In my case, it is Cholesky decomposition. Then I solve the system
x = dA\B;
and it works perfectly. My question is: how can I do it in parallel computing? or What is the best way to solve it in a cluster?

채택된 답변

John D'Errico
John D'Errico 2020년 1월 14일
You already are doing that!
That is, decomposition uses all of the cores you have available for large problems.
Watching my activity monitor while the decomposition was being done:
A = sprand(10000,10000,.001);
tic,DA= decomposition(A);toc
Elapsed time is 8.250635 seconds.
All 8 cores were being used. MATLAB does try to multithread many large computations, especially those involving linear algebra.

추가 답변 (1개)

Christine Tobler
Christine Tobler 2020년 1월 14일
As John says, if you are using decomposition on one computer with several cores, the solver used already will use those cores if appropriate.
If you are working on a distributed system, and the matrix A is a distributed matrix, as of R2019b decomposition is also supported for this (see here).
  댓글 수: 1
Heiko Weichelt
Heiko Weichelt 2020년 1월 14일
Notice that decomposition of distributed arrays has a slightly limited subset for the underlying algorithms. Right now, sparse Cholesky, e.g., is not yet supported. Compare
>> help parallel.distributed.Decomposition.Type
and
>> help parallel.distributed.Decomposition
for the limitations.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Linear Algebra에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by