フィルターのクリア

Why do my parfor loops run in parallel in matlab interactive mode, but in serial mode when I deployed, using Matlab compiler?

2 ビュー (過去 30 日間)
I have multiple programs that contain parfor loops. These parfor loops successfully execute the relevants sections in parallel when I run in interactive Matolab.
However when I deploy these programs using Matlab compiler, they only run in serial. It seems the Matlab compiler is not honouring my setting "Automatically create a parallel pool (if one doesn't exist) when parallel keywords are executed", which I have enabled in my Matlab settings. (I am compiling using the same settings, so these settings should be baked into the deployed app).
  2 件のコメント
Matt J
Matt J 2018 年 2 月 14 日
編集済み: Matt J 2018 年 2 月 14 日
I am compiling using the same settings, so these settings should be baked into the deployed app
I have a feeling that might not be a valid expectation. I don't see any such setting in the run-time options within the deploytool.
William Smith
William Smith 2018 年 2 月 14 日
編集済み: William Smith 2018 年 2 月 14 日
I'm compiling using mcc. I believe that the deployed program contains $PREFDIR and its contents, and unpacks these into $TEMPDIR/mcrCache9.1/ at runtime. I can see "parallel.settings" in that folder. And I can see
<key name="AutoCreate">
<bool>
<value>1</value>
</bool>
</key>
within that file.

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

採用された回答

William Smith
William Smith 2018 年 2 月 14 日
Note, after 1 day messing around, I was able to work around this by explicitly calling parpool() just before my parfor. This should not be necessary because of the "Automatically create a parallel pool" settings.
Note, I am running Matlab 2016b. I have not verified this incorrect behaviour on a more recent version of Matlab.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeParallel Computing Fundamentals についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by