Parallel computing (parfor) or various GUI?
2 views (last 30 days)
Show older comments
Hi Everybody,
I can hav acces to more than one Matlab license so that I can run various GUI at the same time in my computer. The thing is I want to use all the power of my computer to speed up my simulations which are independent, say function f1,f2 and f3.
What would be the fastest way to launch all three simulations at the same time and get the best speed?
1st Way
parfor r=1:3
function1
function2
function3
end
2nd Way
Opening three different gui and launching in each one a different function.
I have donde some tests with "easy" functions and it seems that opening various gui slows the processs. But since using the parallelization toolbox would require changes in the programming (probably) I would like to ask you if you have any experience on this subject that you could share.
Thank you very much!
0 Comments
Accepted Answer
Edric Ellis
on 8 Apr 2013
Parallel Computing Toolbox workers aren't able to display graphics, so you cannot use them to display GUIs directly from the workers. However, you can use the workers to perform computations. How best to make things work depends on how long your different simulations take. Using PARFOR may well not turn out to be the best option, because the loop only completes when the entire body is complete. Even if one of your simulations takes less time than the others, you wont be able to see the results until all are complete.
0 Comments
More Answers (1)
esbolico
on 8 Apr 2013
2 Comments
Edric Ellis
on 8 Apr 2013
Hm, if I've understood correctly, running two simulations at the same time causes both of them to slow down. This implies that the simulations are competing for resources on your computer - this could be CPU time, or it could be memory bandwidth (or something else). Have you checked using task manager to see how much CPU each simulation uses? Have you used the MATLAB profiler to see where time is being spent?
See Also
Categories
Find more on MATLAB Compiler 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!