parforでモデルを並列処理するときに、モデルのパラメータが初期化されない方法はありますか?
10 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
yuki maeda
am 16 Mär. 2016
Bearbeitet: mizuki
am 10 Okt. 2016
parforを使ってモデルを並列処理するときに、モデルのパラメータが設定されていないというエラーが出ます。
並列プールを作成したときに、並列プール用のワークスペースが新規で作成されると思います。
新規で作成されたワークスペース上には変数がないため、モデルのパラメータを変数名にしているとエラーが出ると考えているのですが、この認識で合っていますか?
また、この問題を解決するために、モデルのパラメータ(新規ワークスペース上の変数)を初期化されない方法はありますか?本来のワークスペース上にある変数をそのまま使いたいのですが、無理でしょうか?
1 Kommentar
Walter Roberson
am 16 Mär. 2016
Approximate translation:
When parallel processing model using parfor, you get an error that the model parameters are not set.
When you create a parallel pool, I think the work space for parallel pool is created with the new.
Because there is no variable on the work space that has been created in the new, How can and have the parameters of the model to the variable name is an error believe that out, do you fit in this recognition?
Also, is there in order to solve this problem, a method of the model parameters (variable on the new work space) are not initialized? Although the variable that is on the original work space you want to use as it is, or would be impossible?
Akzeptierte Antwort
mizuki
am 2 Okt. 2016
Bearbeitet: mizuki
am 10 Okt. 2016
新規で作成されたワークスペース上には変数がないため、モデルのパラメータを変数名にしていると
エラーが出ると考えているのですが、この認識で合っていますか?
はい,理解されているとおりです.
また、この問題を解決するために、モデルのパラメータ(新規ワークスペース上の変数)を初期化されない
方法はありますか?本来のワークスペース上にある変数をそのまま使いたいのですが、無理でしょうか?
可能です.local 環境のワークスペースから parallel 環境の MATLAB workers に変数を飛ばすことで MATLAB workers 上で元の local 環境の変数を使うことができます.
simoptions = simset('SrcWorkspace', 'Current');
sim('*.mdl', [0 10], simoptions) % ここで [0 10] はシミュレーション時間を設定しています.
とすることで現在のワークスペースの変数を各 worker に飛ばすことができます.
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Linear Least Squares finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!