Effacer les filtres
Effacer les filtres

How can we create a distributed array for specific number of workers (cores) in MATLAB?

1 vue (au cours des 30 derniers jours)
Ammar
Ammar le 8 Août 2017
Modifié(e) : Walter Roberson le 19 Août 2017
I have a question: How can we create a distributed array for specific number of workers in MATLAB? In other words, if we have 4 workers(cores) in our computer and we would like to designate just 3 workers to process a distributed array, how can we do that. I used the existing commands in this way:
a=[1 2 3 4 5 6]; b=codistributed(a);
Unfortunately, this instruction use all four workers!
Please, any idea how to solve this problem?
Kind regards Ammar

Réponses (1)

Edric Ellis
Edric Ellis le 17 Août 2017
You could either create the pool explicitly using only three workers
parpool(3)
Or, you could use spmd with the optional argument
spmd(3)
b = codistributed(a);
end
  1 commentaire
Ammar
Ammar le 19 Août 2017
Modifié(e) : Walter Roberson le 19 Août 2017
Dear Edric,
I would like to thank you for this answer.
Regards Ammar

Connectez-vous pour commenter.

Community Treasure Hunt

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

Start Hunting!

Translated by