If I call matlabpool open 4 and I have 4 cores, will I work in parallel with 4 or with 3 workers?

1 view (last 30 days)
Hi, I have a desktop machine with 4 cores available. 1) I wonder whether, calling a pool of 4 workers with the PCT, there will be 4 workers working in parallel, or just 3 since 1 is the client. 2) Working with a cluster workstation (with MDCS), when I connect to the master node (client), I run my code in parallel calling "n" workers, and I want to compare the simulation time of the parallel computation with that of the sequential one (I want to see the speedup). For the sequential computation, should I call in the master node matlabpool open 1 (calling 1 slave node from the master node) or should I work directly with the master node, than I don't need to call a matlabpool? Thank you in advance.

Accepted Answer

Thomas
Thomas on 12 Jul 2013
Edited: Thomas on 12 Jul 2013
If you call matlabpool open local 4 - you will have 4 workers (though you will have 5 matlab instances running - 1 master ans 4 workers)
To study speedup you can just run the code sequentially on the master- I do not think you need to start a matlabpool with 1 worker. (I would also convert my 'parfor' to a regular 'for' while running sequentially)

More Answers (1)

Giovanni De Luca
Giovanni De Luca on 12 Jul 2013
Thank you Thomas. Then, according to the first answer, if a call 4 workers the theoretical linear speedup I can obtain is 4, since I work with 4 workers in parallel. RIght? By the way, if I have 4 cores in my machine (with hyperthreading disable) and I call for 4 workers, is 1 core shared between the client and 1 workers, whilst the other 3 cores are assigned to the left workers? I make this question because I would to understand how the shared memory (not the last level of cache, just the RAM) is partitioned along the instance of Matlab when I work in parallel. Thank you

Categories

Find more on Parallel Computing Fundamentals 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!