Performance of parsim with a large number of simulations

조회 수: 6 (최근 30일)
adrien ameye
adrien ameye 2023년 2월 17일
답변: Swastik Sarkar 2024년 9월 23일
Dear matlab community :)
I am using parsim for a simulation with a very large number of runs. It seems that the number of runs impacts the duration of each run.
My simulation has runs that normally require between 0.05 and 0.1 seconds for each run in a 5000 run simulation, but the runs increase to 0.25 seconds for a 500,000 run simulation :/
I am attaching a small piece of code that includes the parsim if it helps to identify the problem:
for j = 1:1:length(VdcPEl)
for k = 1:1:length(VdcEDl)
for l = 1:1:length(Wl)
ind=ind+1;
B0 = Bl(i);
F0s = F0(l);
VdcED = VdcEDl(k);
VdcPE = VdcPEl(j);
in(ind) = Simulink.SimulationInput('TestHyvrid');
in(ind) = in(ind).setVariable('B0',B0);
in(ind) = in(ind).setVariable('VdcPE',VdcPE);
in(ind) = in(ind).setVariable('VdcED',VdcED);
in(ind) = in(ind).setVariable('F0s',F0s);
end
end
end
end
out = parsim(in, 'ShowProgress', 'on','ShowSimulationManager', 'on','TransferBaseWorkspaceVariables','on','UseFastRestart','on' );
The processor used is a Intel Xeon Gold 5222 CPU @ 3.80GHz
If you have an idea to solve this problem, or simply ideas to get around it, I'm interested. Thanks for reading! :)
Adrien A

답변 (1개)

Swastik Sarkar
Swastik Sarkar 2024년 9월 23일
It appears that the ShowSimulationManager setting is enabled during the execution of parsim. Disabling this setting might alleviate the bottleneck, as continuous data updates to the Simulation Manager could be affecting performance, especially as the number of simulations increases.
A similar issue has been reported, indicating that the Simulation Manager can slow down overall simulation performance. More details can be found in this Bug Report:
Additionally, exploring different workflows might be beneficial. More information on multiple simulations workflows is available in the documentation:
Hope this helps.

카테고리

Help CenterFile Exchange에서 Run Multiple Simulations에 대해 자세히 알아보기

제품


릴리스

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by