simulink in parfor and for: different results
2 ビュー (過去 30 日間)
古いコメントを表示
Hello,
I have a Simulink-Simulation. I need many evaluations with different parameters, therefore, i tried parallel computing.
The strange thing is: when i run the simulation on the matlab "workers" in a parfor loop, i get a different result compared to when i run it in a normal for-loop.
What could be the reason?
Thank you in advance, Arco Bast
3 件のコメント
Edric Ellis
2014 年 6 月 4 日
There are very occasional slight numerical differences caused by the fact that workers run in single-computational-thread mode. Try launching the MATLAB desktop client with the "-singleCompThread" command-line argument and comparing results.
回答 (1 件)
Abhishek M
2014 年 4 月 14 日
Hi Arco, This problem arises when you aren't doing anything to save the results of the parfor loop iterations. You need introduce a new output variable and then assign your parfor output to this new variable in order to save them.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Loops and Conditional Statements についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!