Programmatically pre-detect number of cores available to Parallel Computing Toolbox
3 views (last 30 days)
Show older comments
Is there a way to detect the number of cores, i.e., the maximum number of non-oversubscribed workers that are available to a parallel pool in the Parallel Computing Toolbox, but without actually first opening a pool?
2 Comments
Accepted Answer
Edric Ellis
on 12 Mar 2014
Try this:
c = parcluster('local'); % build the 'local' cluster object
nw = c.NumWorkers % get the number of workers
Of course, this is a maximum - the user might have specified in their parallel preferences to automatically open pools of a smaller size.
More Answers (0)
See Also
Categories
Find more on Parallel Computing Fundamentals in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!