In my experience, the local matlabpool configuration uses by default the number of physical cores a machine has, rather than the number of logical cores. Therefore, on your machine, matlabpool only connects to two laboratories.
However, this is just a setting and can be overwritten with the following command:
matlabpool poolsize n
where n is an integer from 1 to 12, indicating the number of laboratories you want to use Matlab.
Now we will meet an interesting dock that I am a little better to answer, thanks to a quick tutorial from @RodyOldenhuis in the comments.
Hyper-threading implies that a given physical core can have two threads passing through it at the same time. Of course, they cannot literally be processed at the same time. The idea is something like this: if one of the threads is inefficient at distributing tasks across the kernel, then the kernel may show some "downtime". A second thread can take advantage of these downtimes to do some work.
In my experience, Matlab is often effective in distributing threads to the cores, so with one Matlab thread (i.e. with one lab) passing through it, the kernel can have very little downtime and therefore there will be very little benefit for hyperthreads. My desktop is an i7 core with 4 physical cores but 8 logical cores. However, I noticed very few differences between starting a parfor cycle with 4 laboratories versus 8 laboratories. In fact, 8 laboratories are often slower due to the initial costs associated with initializing additional laboratories.
Of course, this is probably complicated by other external factors, such as other programs that you use for Matlab at the same time.
Thus, my suspicion is that even if you can force Matlab to initialize 4 laboratories (or even 12 laboratories), you will not see much of the accelerated work on 2 laboratories, since Matlab is usually quite efficient at distributing tasks for the processor.
Colin t bowers
source share