Only half of available cores being used in parfor

1 Ansicht (letzte 30 Tage)
David Regan
David Regan am 18 Jun. 2014
Bearbeitet: Vishal_R am 30 Jun. 2014
I have two computers running the same code in which there is a parfor loop. Both computers are running Windows 7 but have different numbers of cores and different versions of Matlab: Machine 1: 8 cores, Matlab 2013A Machine 2: 4 cores, Matlab 2014A On machine 1 I start a worker pool with the command matlabpool open 8. On machine 2 I start a worker pool with the command parpool 4 as this has superseded the matlabpool open command. On Machine 2, all 4 cores are in use at 100% during the simulation. On machine 1, 8 cores are in use for a minute or so at the beginning of the simulation and then 4 drop off to almost 0% and the other 4 continue at close to 100%. Why is machine 1 only using half of the available cores even though a pool of 8 workers has been established?
  1 Kommentar
Matt J
Matt J am 18 Jun. 2014
Bearbeitet: Matt J am 18 Jun. 2014
Maybe the other 4 cores had less work to do and finished their tasks early. It depends what tasks and how much data they were given. How similar in work & data size are the different iterations of the loop?

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Vishal_R
Vishal_R am 30 Jun. 2014
Bearbeitet: Vishal_R am 30 Jun. 2014
Looking at your problem statement, it is probable that other workers (in 8 workers scenario) have completed their task which was assigned to them and you cannot see those cores being used. I would suggest you to repeat this experiment with a huge input set and try to visualize your cores. Also, you can attach "matlab.exe" in process monitor to check what is happening in each worker process because Windows OS might be running other application processes on those four cores.
You can refer Process Monitor for your reference.

Kategorien

Mehr zu Parallel for-Loops (parfor) 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