3

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.

ensberg
  • 31
  • 7
  • can you try `parpool(6)` and see what happens? Also, hyperthreading does not really achieve much efficiency, it is more for lightweight stuff. – GameOfThrows Feb 19 '16 at 10:23
  • You may take a look at [this post](http://stackoverflow.com/questions/2626230/running-multiprocess-applications-from-matlab) 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 Feb 19 '16 at 10:48
  • 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 Feb 19 '16 at 13:13

1 Answers1

0

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

CpuX
  • 1