How does parsim() run more instances than workstation cores?

13 vues (au cours des 30 derniers jours)
Elizabeth Gates
Elizabeth Gates le 15 Mai 2017
Commenté : Jason Ross le 25 Oct 2019
I want to run six simulink models in parallel using the parallel computing toolbox and parsim(). My workstation has 4 cores. The parallel computing toolbox creates no more workers than cores.
How does parsim() handle the six models in parallel when it can create no more than 4 workers? Threads?
  2 commentaires
Artyom
Artyom le 25 Oct 2019
What about Hyperthreading? Usually Intel CPUs provide twice number of virtual cores than physical - e.g. 8 for 4. Can the number of workers be increased in this case?
Jason Ross
Jason Ross le 25 Oct 2019
You can set the number or workers in a local cluster in the properties of the local scheduler. You can set this to whatever number of workers you wish. The default is the number of compute cores in your CPU, which is half the hyperthreaded cores. When doing numerical work, you need the compute cores, so in practice hyperthreaded cores provide little or no benefit for additional parallelization or performance.

Connectez-vous pour commenter.

Réponse acceptée

mizuki
mizuki le 15 Mai 2017
Set NumWorkers as 6 in cluster profile manager. Go to
MATLAB Toolstrip (menu bar)
-> Parallel
-> Manage Cluster Profiles
-> Select your cluster
(if you are working on your machine, please select "local")
-> Click Edit
-> Change/Set NumWorkers to 6
(In the image, NumWorkers is set as 4)
After setting NumWorkers as 6, run parsim again.
  2 commentaires
Benjamin Hall
Benjamin Hall le 5 Juil 2018
I don't think this will work, mizuki. MATLAB won't allow more workers than physical cores. Parsim can queue jobs though. If you call parsim with 'ShowSimulationManager' set to 'on', you will see that it queues parallel jobs in excess of the number of workers/cores. e.g. out = parsim(in, 'ShowProgress', 'on', 'ShowSimulationManager', 'on')
Jason Ross
Jason Ross le 25 Oct 2019
You can set the number of workers higher than the number of (compute) cores and the software will be 100% OK with it. It will dutifully start that many workers (or try to -- at some point you'll run out of something -- RAM, most likely) . The issue is that when the workers get blocked on compute cores, there's no real benefit to haveing more workers running. You are bottlenecked on the ability of the cores to process work, and therefore it's a no-win situation.
You are correct in your answer that the scheduler knows how to schedule and queue tasks. So parts of the job just wait on workers to complete work.

Connectez-vous pour commenter.

Plus de réponses (1)

Benjamin Hall
Benjamin Hall le 5 Juil 2018
MATLAB won't allow more workers than physical cores. Parsim can queue jobs though. If you call parsim with 'ShowSimulationManager' set to 'on', you will see that it queues parallel jobs in excess of the number of workers/cores. e.g. out = parsim(in, 'ShowProgress', 'on', 'ShowSimulationManager', 'on')

Catégories

En savoir plus sur Run Multiple Simulations 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