How does parsim() run more instances than workstation cores?
10 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Elizabeth Gates
el 15 de Mayo de 2017
Comentada: Jason Ross
el 25 de Oct. de 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 comentarios
Artyom
el 25 de Oct. de 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
el 25 de Oct. de 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.
Respuesta aceptada
mizuki
el 15 de Mayo de 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 comentarios
Benjamin Hall
el 5 de Jul. de 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
el 25 de Oct. de 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.
Más respuestas (1)
Benjamin Hall
el 5 de Jul. de 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')
Ver también
Categorías
Más información sobre MATLAB Parallel Server en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!