Performance of parsim with a large number of simulations
7 ビュー (過去 30 日間)
古いコメントを表示
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
0 件のコメント
回答 (1 件)
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.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Run Multiple Simulations についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!