Do I need to initiate the parallel computing toolbox for my code to run on multiple cores?
2 views (last 30 days)
I have a function that I minimize using fmincon. I am exploring the possibility of making my code run faster. I got rid of all for loops and replaced them with vectorised code. I further wanted to try the parallel computing toolbox. Yet before doing so, I checked how many cores MATLAB is using because if it is using already multiple cores, why would I need the parallel computing toolbox? Though I am not sure and this is a first question I would like to ask. I noticed that MATLAB actually does use all the cores when I inititate fmincon. How is it possible that multiple cores are used while I did not initiate the parallel comuting toolbox?
Bruno Luong on 21 Mar 2022
Edited: Bruno Luong on 21 Mar 2022
MATLAB has many low level functions are multi-thread coded and potentially use all the CPU core.
In this case parallel tbx will not bring you any speed up on the same computer. You can however use GPU, that can speed up in some specific cases.