MATLAB: difference between Multithreading and Multicore

后端 未结 3 1008
闹比i
闹比i 2020-12-19 21:42

I have an i7-M620 processor that have 2 physical cores and 2 threads (multi-threaded CPU) per core (a total of 4 threads). When I use the MATLAB Parallel Computing Toolbox,

3条回答
  •  有刺的猬
    2020-12-19 22:26

    For a parallel configuration, this is the error thrown when requesting more workers than the default:

    The default value of NumWorkers for a local cluster is the number of cores on the local machine. To run a communicating job on more workers than this , increase the value of the NumWorkers property for the cluster.

    You can remedy that by modifying the 'local' profile cluster properties, that effectively control the default number. From PCT R2013a documentation:

    myCluster = parcluster('local'); 
    myCluster.NumWorkers = 4; % 'Modified' property now TRUE 
    saveProfile(myCluster);   % 'local' profile now updated,
                              % 'Modified' property now FALSE
    

    Then matlabpool open will give you the (default) num. of workers, while matlabpool(n) will give you n workers, up to the above set maximum/default (n<=4). You can check the number of currently open workers by:

    matlabpool('size')
    

    or from the indicator icon at the lower-right corner of your desktop, e.g. enter image description here.

提交回复
热议问题