How are models with a model reference hierarchy updated in parsim

4 ビュー (過去 30 日間)
Qiong-zhong Chen
Qiong-zhong Chen 2018 年 11 月 21 日
編集済み: Nachiket Wadwankar 2022 年 8 月 22 日
Hello,
I am using parallel simulation for simulating a model with a model reference hierarchy. I precompiled my models and saved all generated cache files in a cache folder. I assumed that in the sequence of my parallel simulation, these models would not need to be recompiled again. However, it seemed not to be this case. In every run, the referenced models seemed to be recompiled as it took way more time than not using model referencing.
My question is, how are the models updated in every run in the sequence of parallel simulation?
Can I avoid updating the model in every run to save time?
Thanks!

採用された回答

Rahul Kumar
Rahul Kumar 2018 年 11 月 27 日
parsim should be able to use the cache files for parallel simulations on the workers. There are a few cases where the models may be compiled again
  1. A change is made to a non-tunable parameter (specified using the Simulation Input object). You can check if that's the case, by manually changing the value of the parameter and checking if running the simulation triggers a build
  2. If the model is configured to always recompile: https://www.mathworks.com/help/simulink/gui/rebuild.html https://www.mathworks.com/help/simulink/gui/model-referencing-pane.html
  3. If the architecture for which the cache file was created is not compatible with the parallel workers. This is typically the case if you run parallel simulations, for example, on a Linux cluster with a Windows host machine.
If none of the above apply for your case, would it be possible for you to provide the model files and reproduction steps?
  2 件のコメント
Qiong-zhong Chen
Qiong-zhong Chen 2018 年 11 月 27 日
Hi Rahul,
Thank you very much for the answer.
It likes more like the first case. Although the specific parameters in my model do not change, the structure variable containing these parameters have changed (my parameters are defined as structure fields). Therefore, I suppose that Matlab accounts it as a change to the model and thus recompiles it.
Nachiket Wadwankar
Nachiket Wadwankar 2022 年 8 月 22 日
編集済み: Nachiket Wadwankar 2022 年 8 月 22 日
Hi Rahul,
In continuation to the above conversation.
I need to perform Simulink.fileGenControl before parsim in the main run script and not required to do it on every worker, as in using eval command?

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSystem Composer についてさらに検索

製品


リリース

R2017b

Community Treasure Hunt

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

Start Hunting!

Translated by