MATLAB: difference between Multithreading and Multicore

后端 未结 3 1018
闹比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:18

    I got around this (with my core i5 with 2 cores and 4 threads) by editing the "local" configuration for the parallel computing stuff:

    1. Go to Parallel->Manage Cluster Profiles
    2. Depending on you Matlab version, you'll need to Validate the local profile before changing anything.
    3. Click edit and change the NumWorkers variable to suit your needs.

    Then you can start matlabpool like this:

    matlabpool local
    

    Note I have never gotten a speedup using parfor. Matlab's overhead has always outweighed the benefits. What I'm saying is: benchmark your code first, then decide if parfor (or other parallel stuff) works for you or not.

提交回复
热议问题