Does matlab using all cores in a multi-core cpu in sequential computing mode?

5 views (last 30 days)
When I use matlab to call pcg to solve a sparse linear algebraic system in a sequential way, the windows task manager shows that all cores in the two-core cpu are used simutaneously. It appears that all cores are parallely called. Does matlab parallely using all cores in a multi-core cpu in sequential computing mode?
  2 Comments
Mohammad Sami
Mohammad Sami on 22 Jun 2020
Only certain functions are optimized to take advantage of multiple core processor. More generally matlab remains a single threaded application and you have to use parallel computing toolbox to take full advantage of multi core processors.
More details are available here.
Walter Roberson
Walter Roberson on 22 Jun 2020
Most of the major linear algebra and vectorized mathematical operations automatically use all of the available cores.
I am not familiar with how pcg specifically works.
Parallel Computing Toolbox often turns out to be slower than the automatic vectorization, due to the overhead of communicating the data to the separate processes. Parallel Computing Toolbox mostly wins out for code that only needs to transfer relatively small amounts of data (compared to the computation) where the code iterates instead of working in vectorized form. For example chaotic mathematics often cannot take advantage of vectorization. (That said, there is a dandy fractal demonstration for GPU)

Sign in to comment.

Answers (0)

Categories

Find more on Systems of Nonlinear Equations 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!