Can the Parallel Computing Toolbox and the MATLAB Distributed Computing Server take advantage of nondistributed systems such as multi-CPU systems?

32 views (last 30 days)
I do not have access to a distributed cluster of separate computers, but would like to use the parallel computing products on non-distributed systems. These systems include:
1. Multi-core and / or multi-processor systems.
2. A single large server machine containing multiple processors, each with multiple cores.

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 22 Nov 2022
Edited: MathWorks Support Team on 22 Nov 2022
For MATLAB R2016b onward, the Parallel Computing Toolbox (PCT) provides the ability to run up to 512 local MATLAB “workers” on the same machine to perform computations. These workers can potentially leverage the additional computing power available in multi-core and multi-processor machines. Note that these worker processes are associated with the session of MATLAB from which they were invoked as well as the user who invoked these processes. As a result, the worker processes can not be accessed by multiple users.
As of MATLAB R2016b, PCT workers can be run in multithreaded mode so you can increase the number of computational threads without increasing the number of workers. This is seen in the following MATLAB release notes:
MATLAB itself has no limit on the number of computational threads. However, it is important to note that it is recommended to not have more computational threads from all MATLAB processes on a system than the number of physical cores.
 
Therefore, let's say you have 2 CPUs, 8 cores/CPU and so there are 16 physical cores. This setup can be used by any one of the following:
•    A single MATLAB client with 16 computational threads 
•    16 PCT local workers, each running single-threaded
•    8 PCT local workers, each running with 2 computational threads
•    4 PCT local workers, each running with 4 computational threads
For more information, refer to the following MATLAB documentation: 
For MATLAB R2016a and earlier, local MATLAB workers can only run in single-threaded mode. 
For MATLAB R2013b and earlier, the number of local workers is limited to twelve.
Alternatively, the MATLAB Distributed Computing Server can be used to start up a job manager and multiple workers on a multi-core or multi-CPU system. Even in the case of computing clusters that contain a mix of single CPU and multiple CPU machines, workers can be utilized on a per-core or per-CPU basis. Refer to the Related Solution for some guidelines to help you determine how many worker sessions to run on one computer.
When executing parallel jobs, workers communicate using MPI even if they are running on the same physical computer. However, you can choose to use a version of MPI that is optimized for Shared-Memory Processor systems.
Refer to the documentation for the mpiLibConf function (enter the following at the MATLAB command prompt)
web([docroot, '/toolbox/distcomp/mpilibconf.html'])
for information on using alternative versions of MPI instead of the build of MPICH2 that the MATLAB Distributed Computing Server uses by default.

More Answers (0)

Categories

Find more on Parallel Computing 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!