parforでモデルを並列処理するときに、モデルのパラメータが初期化されない方法はありますか?
11 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
parforを使ってモデルを並列処理するときに、モデルのパラメータが設定されていないというエラーが出ます。
並列プールを作成したときに、並列プール用のワークスペースが新規で作成されると思います。
新規で作成されたワークスペース上には変数がないため、モデルのパラメータを変数名にしているとエラーが出ると考えているのですが、この認識で合っていますか?
また、この問題を解決するために、モデルのパラメータ(新規ワークスペース上の変数)を初期化されない方法はありますか?本来のワークスペース上にある変数をそのまま使いたいのですが、無理でしょうか?
1 commentaire
Walter Roberson
le 16 Mar 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?
Réponse acceptée
mizuki
le 2 Oct 2016
Modifié(e) : mizuki
le 10 Oct 2016
新規で作成されたワークスペース上には変数がないため、モデルのパラメータを変数名にしていると
エラーが出ると考えているのですが、この認識で合っていますか?
はい,理解されているとおりです.
また、この問題を解決するために、モデルのパラメータ(新規ワークスペース上の変数)を初期化されない
方法はありますか?本来のワークスペース上にある変数をそのまま使いたいのですが、無理でしょうか?
可能です.local 環境のワークスペースから parallel 環境の MATLAB workers に変数を飛ばすことで MATLAB workers 上で元の local 環境の変数を使うことができます.
simoptions = simset('SrcWorkspace', 'Current');
sim('*.mdl', [0 10], simoptions) % ここで [0 10] はシミュレーション時間を設定しています.
とすることで現在のワークスペースの変数を各 worker に飛ばすことができます.
0 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Linear Least Squares dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!