parpool sorting out the default number of workers
Show older comments
I'm a little bit lost in the default number of workers when parpool() is invoked. My PC is standalone with Intel Processor and Windows-based with MATLAB R200B.
- In the Preferences Parallel Computing Toolbox window, both Porcesses and Threads profiles indicate the default value of number of workers is 12
- My processor has 14 cores; 6 performance, 6 Efficient, and 20 (hyper) threading according to Intel link
The command maxNumCompThreads returns 6
>> maxNumCompThreads('automatic')
ans =
6
The command parpool returns 14
>> delete(gcp('nocreate'))
>> p = parpool('Threads')
Starting parallel pool (parpool) using the 'Threads' profile ...
Connected to the parallel pool (number of workers: 14).
p =
ThreadPool with properties:
NumWorkers: 14
Busy: false
The questions are
- Why 14 and not 12 as setup by Preferences?
- How parpool and Preferences setup those numbers?
In general it's all over the place to me, if someone can shed the light it would be great.
Accepted Answer
More Answers (1)
Raymond Norris
on 6 Jan 2023
Edited: Edric Ellis
on 6 Jan 2023
Hey @Bruno Luong, per your link, you have 8 Efficient cores, hence 14 (6+8) cores. For R2022b (which I think is the version you're using), the Threads profile doesn't allow for less than the number of cores you have. The Process profile uses the standard min(12,#cores).
For Performance vs Efficient, can you run the following and post the answer?
feature numcores
Categories
Find more on Parallel Computing Fundamentals 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!