Parsim slows down after many iterations
24 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Jörg Kunkelmoor
el 15 de Dic. de 2025 a las 7:03
Respondida: Ayush
el 18 de Dic. de 2025 a las 5:18
Hello, I have the following problem.
I use parsim to optimise the parameters of my simulation with particle swarm optimisation. I use it together with Rapidaccelerator.
The simulation is performed with 100 iterations of 32 particles. In one run, 32 simulations are performed with 3 workers.
The first iterations take about 500 seconds. After that, it slows down dramatically to 6000 seconds. The hard drive is then 100% utilised. RAM is still at 85% and the processor at 50%.
After each simulation, I summarise the results and then delete everything unnecessary. I have commented out all scopes. I have Fastrestart enabled.
Has anyone else had the same problem? After the 32 simulations, parsim automatically frees up the pool of resources and the RAM goes down.
Should i disable more of them:
simIn(k) = simIn(k).setModelParameter( ...
‘SaveOutput’,‘off’, ...
‘SaveTime’,‘off’, ...
‘SaveState’,‘off’, ...
‘SignalLogging’,‘off’);
and clear SDI:
simOut = parsim(simInBatch, ...
‘CleanupFcn’, @() Simulink.sdi.clear);
Workers are already cleaned up every time, or do I have to call it separately?
Simulink.sdi.cleanupWorkerResources
0 comentarios
Respuestas (1)
Ayush
el 18 de Dic. de 2025 a las 5:18
Hi Jörg,
I understand you’re seeing high disk usage and slowdowns when running "parsim" with Rapid Accelerator, even after disabling most logging.
A possible cause is that each parallel simulation sends its output back to the client and stores it in memory as a "Simulink.SimulationOutput" object. Over many iterations, this can fill up RAM and force your system to use disk swap, which slows everything down. Even with logging disabled, the accumulation of simulation results can overwhelm your resources.
You can refer to the following answer from MathWorks staff regarding Disk usage in parallel simulations:
Hope it helps.
0 comentarios
Ver también
Categorías
Más información sobre System Composer en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!