Parsim slows down after many iterations
조회 수: 24 (최근 30일)
이전 댓글 표시
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
답변 (1개)
Ayush
2025년 12월 18일 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
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!