How does parsim() run more instances than workstation cores?
10 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Elizabeth Gates
am 15 Mai 2017
Kommentiert: Jason Ross
am 25 Okt. 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 Kommentare
Artyom
am 25 Okt. 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
am 25 Okt. 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.
Akzeptierte Antwort
mizuki
am 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 Kommentare
Benjamin Hall
am 5 Jul. 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
am 25 Okt. 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.
Weitere Antworten (1)
Benjamin Hall
am 5 Jul. 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')
Siehe auch
Kategorien
Mehr zu MATLAB Parallel Server finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!