Clear Filters
Clear Filters

Didn't recognize full workers when using 'matlabpool'?

3 views (last 30 days)
Hi,
I have trouble in connecting to full labs for the parallel computing.
>> matlabpool open
Starting matlabpool using the 'local' profile ... connected to 2 labs.
As you can see above, only two labs could be connected for the parallel computing, but I am using quad-core PC that means four labs have to be connected. Moreover, the strange thing is that four labs was connected when using the Matlab version R2008a (Now I am using Matlab version R2012a).
Would you help me out with that problem?
Thank you.
Seongjun Park

Accepted Answer

Jason Ross
Jason Ross on 6 Apr 2012
I would venture to guess that you have a machine with hyper-threading. This essentially means that two cores are presented as four. You can read more about it here:
If you wish to open four labs, you can do so by using Kaustubha's suggestion or by changing the NumWorkers property of the local scheduler to have four.
  2 Comments
Seongjun
Seongjun on 6 Apr 2012
Hi jason,
Thank you. But I have still faced some problems. In fact, I am using a notebook with Core 'i5' CPU from Intel. This means that hyper-threading tech. is used.
I did some tests to see if the parallel computing works well.
(I changed the default no. of workers to 4)
Case 1. None: computation time (29.23 sec), CPU (50 % used)
Case 2. 2 labs used: computation time (15.19 sec), CPU (52 % used)
Case 3. 4 labs used: computation time (14.02 sec), CPU (100 % used)
As you can see above results, there are several odd things:
- The computation time was not significantly reduced when using 4 labs.
- The number of workers was not simply propotional to the amount of CPU used.
Would you help me out?
Thank you
Sengjun Park
Jason Ross
Jason Ross on 6 Apr 2012
You are seeing exactly what I've seen on most hyperthreaded systems. Since there are only two cores that execute things, they get fully loaded and execute things. When you bump up the workers to four, you are still waiting on the execution to happen, and it makes no actual difference towards overall execution time.
Another way of putting it is that you have four units of work, and a processor that can effectively deal with only two units of work at a time. With two workers, they each process two units of work in 15 seconds, giving you four units of work processed. With four workers, each one gets a unit of work, but the processor can only really deal with two units of work, so it processes those, then moves onto the two workers that are waiting.
It's also entirely possible to have conditions where memory becomes a bottleneck, or where disk I/O will become a bottleneck, as well.

Sign in to comment.

More Answers (1)

Thomas
Thomas on 6 Apr 2012
If you have a quad core machine
Try
matlabpool open local 4
( it it errors out) You might have to change the default no. of workers in your local configuration. Goto
Parallel>Manage Cluster Profile> Local> edit (at the bottom)
Number of Workers to start on your local machine
NumWorkers 4

Categories

Find more on Startup and Shutdown in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!