Why does TreeBagger in Matlab 2014a/b only use few workers from a parallel pool?
1 view (last 30 days)
I'm using the TreeBagger class provided by Matlab (R2014a&b), in conjunction with the distributed computing toolbox. I have a local cluster running, with 30 workers, on a Windows 7 machine with 40 cores.
I call the TreeBagger constructor to generate a regression forest (an ensemble containing 32 trees), passing an options structure with 'UseParallel' set to 'always'.
However, TreeBagger seems to only make use of 8 or so workers, out of the 30 available (judging by CPU usage per process, observed using the Task Manager). When I try to test the pool with a simple parfor loop:
a = fft(rand(20000));
Then all 30 workers are engaged.
My question is: (How) can I force TreeBagger to use all available resources?
Ilya on 5 Dec 2014
TreeBagger does not limit the number of used cores in any way. Everything is set by your parpool configuration.
The answer may be in the data you pass to TreeBagger. Make sure all trees in the returned TreeBagger object are deep (which means training did take place). If it takes little time to grow these 32 trees, increase the number of trees and see if the load changes.