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

10 visualizzazioni (ultimi 30 giorni)
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 Commenti
Artyom
Artyom il 25 Ott 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 il 25 Ott 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.

Accedi per commentare.

Risposta accettata

mizuki
mizuki il 15 Mag 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 Commenti
Benjamin Hall
Benjamin Hall il 5 Lug 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 il 25 Ott 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.

Accedi per commentare.

Più risposte (1)

Benjamin Hall
Benjamin Hall il 5 Lug 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')

Categorie

Scopri di più su MATLAB Parallel Server in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by