How to run multiple different scripts in parallel ?

5 views (last 30 days)
Hi,
I am trying to paralellize a large job and the best solution I can think of so far is to break it up in several different scripts and send each script to a different core. Since I can't find any information in the documentation about how to acomplish this I need to ask for help. The idea is something like this:
matlabpool open local 4
Send each of the following: script1.m, script2.m, script3.m and script4.m to a separate core for a simultaneous execution
matlabpool close
Now my question is how should the code look like in between the two matalbpool statements except the code for the four scripts ?
Thank You in advance.
Mark

Answers (1)

Richard Brown
Richard Brown on 15 Oct 2012
One way to do it
matlabpool open local 4
spmd
switch labindex
case 1
script1
case 2
script2
case 3
script3
case 4
script4
end
end
matlabpool close

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!