4
votes

I want to use parallel computing on matlab, i have i7-960 CPU with 4 cores and 8 threads, when i run feature('numCores') command in matlab, i obtain this

feature('numCores') 
MATLAB detected: 3 physical cores.
MATLAB detected: 6 logical cores.
MATLAB was assigned: 6 logical cores by the OS.
MATLAB is using: 3 logical cores.
MATLAB is not using all logical cores because hyper-threading is enabled.

ans =

     3

why matlab detect just juste 3 physical cores ! and how can i use all logical and physical cores for parallel computing. thanks.

1
can you try parpool(6) and see what happens? Also, hyperthreading does not really achieve much efficiency, it is more for lightweight stuff. - GameOfThrows
You may take a look at this post and set the number of threads in matlab's preferences. Moreover as feature is unsupported and undocumented it's hard to tell what its result really means. - Emilien
When i try parpool(6) i get this error : Error using parpool (line 99) You requested a minimum of 6 workers, but the cluster "local" has the NumWorkers property set to allow a maximum of 3 workers. To run a communicating job on more workers than this (up to a maximum of 512 for the Local cluster), increase the value of the NumWorkers property for the cluster. The default value of NumWorkers for a Local cluster is the number of cores on the local machine. - ensberg

1 Answers

0
votes

To use all logical processes (number of threads) you need to change the NumWorkers in the matlab setting. in matlab 2018 menu follow this: Preferences >> Parallel Computing Toolbox>> Cluster Profile Manager >> click "Edit" on the bottom right >> Set "NumWorkers" to the number of logical process, 8 in your case. > Done >> close and apply