Programmatically pre-detect number of cores available to Parallel Computing Toolbox

6 Ansichten (letzte 30 Tage)
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 Kommentare
Matt J
Matt J am 12 Mär. 2014
Bearbeitet: Matt J am 12 Mär. 2014
Windows 7 64-bit, as it happens. However, I'm looking for a programmatic way within MATLAB to do it, i.e., so that it is platform-independent.

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

Edric Ellis
Edric Ellis am 12 Mär. 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.

Weitere Antworten (0)

Kategorien

Mehr zu Parallel Computing Fundamentals finden Sie in Help Center und File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by