1

I've been using the command matlabpool open 8 for a while in order to speed up things. However I just tried using it and am denied 8 cores and now limited to 4.

My laptop is an i7 with 4 cores but hyperthreaded which meant I had no issue making matlab working on 8 virtual cores.

Simultaneously I noticed the following warning message:

Warning: matlabpool will be removed in a future release. Use parpool instead.

Seems like MathsWorks decided this was a great update for some reason.

Any ideas how I can get my code running on 8 cores again?

Note: I was using R2010b (I think) and now using R2014b.

Sam Roberts
  • 23,951
  • 1
  • 40
  • 64
user88595
  • 195
  • 9
  • 1
    Did you try to set the number of workers using `parpool`? – Daniel Mar 29 '15 at 17:57
  • 1
    See [How to set the max number of workers in parpool/matlabpool from console?](http://stackoverflow.com/questions/24639939/how-to-set-the-max-number-of-workers-in-parpool-matlabpool-from-console) maybe? – horchler Mar 29 '15 at 18:09
  • That works thank you. I was however hoping for a way of "fixing" `matlabpool` as it's more user friendly. – user88595 Mar 29 '15 at 22:54

1 Answers1

3

It looks like @horchler has provided you with a direct solution to your question in the comments.

However, I would recommend sticking to the default 4 workers suggested by MATLAB, and not using 8. You're very unlikely to get significant speedup by moving to 8, and you're even likely to slow things down a bit.

You have four physical cores, and they can only do so much work. Hyperthreading enables the operating system to pretend that there are 8 cores, by interleaving operations done on pairs of virtual cores.

This is great for applications such as Outlook, which are not compute-intensive, but require lots of operations to appear simultaneous in order, for example, to keep a GUI responsive while checking for email over a network connection.

But for compute-intensive applications such as MATLAB, it will not give you any sort of real speed up, as the operations are just interleaved - you haven't increased the amount of work that the 4 real, physical cores can do. In addition, there's a small overhead in performing the hyperthreading.

In my experience, MATLAB will benefit slightly by turning hyperthreading off. (Of course other things, such as Outlook, won't: your choice).

Community
  • 1
  • 1
Sam Roberts
  • 23,951
  • 1
  • 40
  • 64
  • Thank you for the explanations, it's true that it doesn't always speed up the calculations and even slows some down depending on the calculations. – user88595 Mar 30 '15 at 21:40