MATLAB Multicore

Run MATLAB on multicore and multiprocessor machines

MATLAB® provides two main ways to take advantage of multicore and multiprocessor computers. By using the full computational power of your machine, you can run your MATLAB applications faster and more efficiently.

Built-in Multithreading

Since Release R2008a, linear algebra and multithreaded computations have been enabled by default; numerical functions such as chol, inv, linsolve, lu, qr, fft, \ (mldivide), eig, svd, and sort, among others, are multithreaded in MATLAB. These functions automatically execute on multiple computational threads in a single MATLAB session, allowing them to execute faster on multicore machines. Additionally, many functions in Image Processing Toolbox are multithreaded.

Multiprocessing Using MATLAB Workers

Multiprocessing using MATLAB workers allows you more control over the parallelism than with built-in multithreading, and is often used for coarse-grained problems, such as running parameter sweeps in parallel.

With Parallel Computing Toolbox, you can start and use multiple MATLAB workers (MATLAB process that runs in the background as part of the toolbox) to take advantage of multiple cores on a single multicore machine and execute applications in parallel. You can also control the number of threads per worker. The default on your local machine is typically one worker per physical CPU core and a single computational thread per worker.

You can use programming constructs such as parallel for-loops (parfor) and batch to automatically divide tasks and assign them to workers to execute the computations in parallel with minimal programming effort. Without changing the code further, you can also scale the same applications that use MATLAB workers to a computer cluster, grid, or cloud, using MATLAB Distributed Computing Server.

Several other products includng Optimization Toolbox, Statistics and Machine Learning Toolbox, and Image Processing Toolbox offer parallel-enabled algorithms that work with Parallel Computing Toolbox. These algorithms let you distribute computations across available parallel computing resources for improved performance without requiring any extra coding.

Parallel Computing Toolbox also allows you to accelerate your MATLAB applications using GPU cores without low-level CUDA programming.

Examples and How To

Software Reference

See also: Parallel Computing Toolbox, MATLAB Distributed Computing Server, MATLAB GPU computing, parallel computing, MATLAB acceleration, MATLAB multicore videos

Parallel Computing Training Course

In this course you’ll learn the tools and techniques for distributing code and writing parallel algorithms in MATLAB®.

Learn more and register