Parsim with Parallel Computing Toolbox provides unexpected results.

16 ビュー (過去 30 日間)
Elizabeth Gates
Elizabeth Gates 2017 年 5 月 15 日
コメント済み: Rahul Kumar 2018 年 9 月 4 日
I have the Parallel Computing Toolbox so that I can ultimately use parsim() to run a simulink model, containing six blocks, in parallel. The idea is to run each model with a different block enabled so that the blocks run in parallel.
As an experiment, I ran the model with one block enabled but ran sim(). It provided an expected figure with results.
When I then ran that model with the same block enabled but ran parsim(), it provided a blank figure.
How does pasim() run? I expected the same results with parsim() and sim() in this very simple case.

回答 (1 件)

Ed Marquez
Ed Marquez 2017 年 5 月 19 日
編集済み: Walter Roberson 2017 年 5 月 19 日
Hi Elizabeth,
the blog post below has a good description of the setup that you may need to run the Simulink model using parsim.
It comes down to properly creating the Simulink.SimulationInput object.
As the article says, by creating one Simulink.SimulationInput per simulation, you can define the properties specific to each run, including initial states, model parameters, block parameters, input signals, and variables used by the model.
  6 件のコメント
Antonio Carlo Bertolino
Antonio Carlo Bertolino 2017 年 10 月 16 日
Hi to both of you, I have the same issue: I run my model with parsim but my workspace variables aren't seen from the model on each worker. How can I send all the needed variables to each worker in such a way they can simulate successfully? Thank-you, kind regards, Antonio
Rahul Kumar
Rahul Kumar 2018 年 9 月 4 日
If variables are loaded separately from the model, you can use the 'TransferBaseWorkspaceVariables' option with parsim.
You could also use a data dictionary to store the variables used in the model in which case parsim will automatically pick them up for use on the parallel workers. https://www.mathworks.com/help/simulink/ug/what-is-a-data-dictionary.html

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

カテゴリ

Help Center および File ExchangeRun Multiple Simulations についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by