parforでモデルを並列処理するときに、モデルのパラメータが初期化されない方法はありますか?
11 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
yuki maeda
el 16 de Mzo. de 2016
parforを使ってモデルを並列処理するときに、モデルのパラメータが設定されていないというエラーが出ます。
並列プールを作成したときに、並列プール用のワークスペースが新規で作成されると思います。
新規で作成されたワークスペース上には変数がないため、モデルのパラメータを変数名にしているとエラーが出ると考えているのですが、この認識で合っていますか?
また、この問題を解決するために、モデルのパラメータ(新規ワークスペース上の変数)を初期化されない方法はありますか?本来のワークスペース上にある変数をそのまま使いたいのですが、無理でしょうか?
1 comentario
Walter Roberson
el 16 de Mzo. de 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?
Respuesta aceptada
mizuki
el 2 de Oct. de 2016
Editada: mizuki
el 10 de Oct. de 2016
新規で作成されたワークスペース上には変数がないため、モデルのパラメータを変数名にしていると
エラーが出ると考えているのですが、この認識で合っていますか?
はい,理解されているとおりです.
また、この問題を解決するために、モデルのパラメータ(新規ワークスペース上の変数)を初期化されない
方法はありますか?本来のワークスペース上にある変数をそのまま使いたいのですが、無理でしょうか?
可能です.local 環境のワークスペースから parallel 環境の MATLAB workers に変数を飛ばすことで MATLAB workers 上で元の local 環境の変数を使うことができます.
simoptions = simset('SrcWorkspace', 'Current');
sim('*.mdl', [0 10], simoptions) % ここで [0 10] はシミュレーション時間を設定しています.
とすることで現在のワークスペースの変数を各 worker に飛ばすことができます.
0 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Linear Least Squares en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!