Effacer les filtres
Effacer les filtres

How to set up multithreading on repetitive programs

3 vues (au cours des 30 derniers jours)
Eugene Kogan
Eugene Kogan le 14 Fév 2011
I am running a program which involves iterating through images and building a large matrix of results. There are no interactions or races between each iteration -- just simple brute force calculation on a different set of images. Since my computer has 8 cores, I'd like to divide up the task into 8 chunks and have them all go at the same time. I've actually done this manually by opening up 8 instances of matlab, loading the same dataset 8 times into RAM, and just changing the start and ending indexes of the program in each instance, and it worked great, reducing run time to nearly 1/8th. Of course this is silly -- is there some way to do this same process but on one instance of matlab with one dataset loaded into RAM but 8 processes?

Réponse acceptée

Walter Roberson
Walter Roberson le 14 Fév 2011
You need the Parallel Processing Toolkit for this. Parfor might be suitable, as might be codistributed arrays; if not, there is always SMPD.
  1 commentaire
Jiro Doke
Jiro Doke le 17 Fév 2011
Walter, can you rename the product name to "Parallel Computing Toolbox" and add a link to it? Thanks.
http://www.mathworks.com/products/parallel-computing/

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Loops and Conditional Statements dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by