How matlabpool does work??

Hi all
I am a new Matlab users and actually I would like to optimize a simple algorithm with parallel computing. By optimize I mean that getting the results faster than waiting for some hours for a merely launched algorithm... Could matlabpool helps me out??
Thx in advance
Ag Vdk

5 commentaires

Cedric
Cedric le 10 Avr 2013
Modifié(e) : Cedric le 10 Avr 2013
What kind of algorithm and how did you implement it? Did you vectorize it, optimize indexing operations, etc, the most you could already?
Again Vaudek
Again Vaudek le 10 Avr 2013
I don't have any loop for parralel computing or somethings else for example
Cedric
Cedric le 10 Avr 2013
Modifié(e) : Cedric le 10 Avr 2013
The obtain an increase of performance using parallel computing, the problem that you are solving must be formulated/implemented in a way that is well suited for parallelization.
Slow code is often slow because it was poorly designed and going parallel would bring no improvement, hence my question.
Again Vaudek
Again Vaudek le 10 Avr 2013
By asking your question you actually answered to mine :) I will not suit it for parallel calculus (not enough time) so because of its design parallel would not bring any improvement!!
Cedric
Cedric le 10 Avr 2013
Modifié(e) : Cedric le 10 Avr 2013
It is worth spending 30 minutes just for setting up a local parallel configuration, because your PDE solver may be able to exploit a few workers by itself. It is not something that I've often seen though, and usually I have to work a little on my code before I can see some improvement.
If you had a Monte-Carlo simulation to run though, I'd say that you could invest a day, because each experiment is disjoint from the others and writing code that is well suited for parallelization is almost direct. It means somehow adding the code for opening the pool, replacing FOR with PARFOR, and thinking a little about how you define/store sets of parameters/solutions.

Connectez-vous pour commenter.

 Réponse acceptée

Jason Ross
Jason Ross le 10 Avr 2013

1 vote

I'd suggest looking at the documentation for Parallel Computing Toolbox to see if the tools available might help with your problem. Matlabpool (parfor/spmd) is only one way you can do things, you can also run a batch job or control your own jobs and tasks.

1 commentaire

Jason Ross
Jason Ross le 10 Avr 2013
I also negelected to mention the other part of Parallel Computing : GPU support. I don't know if your problem can be arranged in such a way that a GPU would increase your performance, but that's another solution available.
From Cedric's comments it looks like you might have some thinking to do about how to set up your algorithm to make it amenable to parallel computing. Once you figure that part out, the one of the various methods available (parfor, spmd, job/task, batch and GPU) might show promise.

Connectez-vous pour commenter.

Plus de réponses (1)

Again Vaudek
Again Vaudek le 10 Avr 2013

0 votes

Thank you all answering.
thx for the documentation link !
My algorithm is really simple one. Just solving Navier-Stokes equation in the driven cavity case. As my number of time step and my spatial discretization increase the "real" time to get results increase too. So I thought that launching it with parrallel programming will certainly accelerate the business. that's all... Am I wrong?

Community Treasure Hunt

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

Start Hunting!

Translated by