how to disable matlabpool/parpool

i recently upgraded to matlab2018 from an older version. previously, parfor ran in serial unless a worker pool was opened explicitly. now in the newer version, the pool seems to open when parfor is detected.
how can i disable this behavior? -- i want to call 'parfor' but have it run in serial unless i explicitly open the pool.

 採用された回答

Walter Roberson
Walter Roberson 2018 年 10 月 18 日
編集済み: Walter Roberson 2018 年 10 月 18 日

1 投票

4 件のコメント

kkyaj
kkyaj 2018 年 10 月 18 日
"
1.) Turn off auto-opening pools in the parallel preferences UI. Then you have essentially the same situation as existed in R2013a.
2.) Use the optional "number of workers" argument in your PARFOR loop - see the documentation for more.
"
Option 1 requires opening the GUI, which i don't have access to via remote sessions.
Option 2 requires modifying multiple scripts. It is more desirable to maintain a single copy of the code for use on multiple ML releases.
Neither of these is satisfactory in my case. Is there a script/command-line method of applying #1?
Walter Roberson
Walter Roberson 2018 年 10 月 18 日
There is no provided command line method.
Fredrick showed which part of which file has to be changed. You can use any method to change that, including sed
https://www.mathworks.com/matlabcentral/answers/112457-controlling-new-parallel-feature-automatically-create-a-parallel-pool-when-parallel-keywords-are-ex#comment_189892
kkyaj
kkyaj 2018 年 10 月 18 日
編集済み: kkyaj 2018 年 10 月 19 日
i dislike it, but i'll accept your (Friedrich's) solution for the sake of moving on. the solution was a work-around from 2014. i am somewhat surprised that no local per-instance behaviour setting can be supplied after almost 5years.
my sysadmin will need to make changes on some systems that use system-wide prefs.
Walter Roberson
Walter Roberson 2018 年 10 月 19 日
I do not know if anyone ever put in an enhancement request for this. I know that I did not put in a request for it, as it is a not a bug, and I did not have a use for it myself, and I have seen very few requests for it.

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

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeParallel for-Loops (parfor) についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by