Differences createCommunicatingJob( ..., 'Type','pool') and ...'Type', 'SPMD')

2 views (last 30 days)
I'm just introducing myself into Parallel Computing Toolbox and trying to organize all its functionality - for better understanding purposes.
Now, I'm wondering:
  • createJob(...) creates an Independent Job (check!)
  • createCommunicatingJob(..., 'Type', 'SPMD') creates a communcating Job which runs simulatneously on all workers, due to synchronized interprocess communication purposes, bla, bla... (check!)
BUT:
  • createCommunicatingJob(..., 'Type', 'Pool') creates a communicating Job which: A 'pool' job runs the specified task function with a MATLAB pool available to run the body of parfor loops or spmd blocks.
WHAT?!?:
  • the inside of a parfor loop? parfor is independent so, why classifying as CommunicatingJob? (hmm#1)
  • spmd tasky must be run simultaneously .. otherwise communication might be quite tricky ... (hmm#2)
So, where's my understanding problem ...? I'm a little ... confused ...
Enlightenment whished-for ... :)
Cheers, Tobi

Accepted Answer

Thomas Ibbotson
Thomas Ibbotson on 23 Nov 2012
Both spmd and parfor require a matlabpool to be open to send their work to each worker in the pool. You can create the matlabpool on your client using the 'matlabpool' function, which creates an interactive matlabpool tied to the lifetime of your MATLAB session.
If however you wish to run your code in the background, or submit it to a cluster to run later, you create a communicating job of type 'Pool'. This creates a job that starts a matlabpool on the cluster, using one of the workers as the 'client' and the remaining workers to form the matlabpool.
  6 Comments
Tobias
Tobias on 26 Nov 2012
enlightment proccess ... completed! :D
Thanks a lot for your patience and your explaining skills ... ;) This helped a lot. Next time I will double(-cross) iterate the manual following "RTFM" ;)
cheers, tobi
Thomas Ibbotson
Thomas Ibbotson on 26 Nov 2012
Hi Tobi,
I'm glad that helped. I don't think that this is a particularly easy set of concepts to grasp, it took me a while to fully understand it all. Although all the information is contained in the manual, it often takes someone else who understands it to help link it all together. I certainly didn't learn it by just reading the documentation, I had lots of discussions with my colleagues, and I'm happy to be able to pass on what I have learnt.
Thanks, Tom

Sign in to comment.

More Answers (0)

Categories

Find more on MATLAB Parallel Server 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!