How to stop parfor from launching a parallel pool automatically?

조회 수: 21 (최근 30일)
Whenever MATLAB reaches parfor it will try to start a parallel pool and then run the parfor in parallel.
How can I stop parfor from launching a parallel pool automatically? I mean I want parfor to use a parallel pool if it was launched before. But once the code reaches parfor, if there is no parallel pool already launched then it just runs the parfor in serial without launching a parallel pool.
Any help is appreciated.

채택된 답변

Oleg Komarov
Oleg Komarov 2014년 10월 12일
편집: Oleg Komarov 2014년 10월 13일
In the preferences:
.
To edit parallel preferences programmatically:
ps = parallel.Settings;
ps.Pool.AutoCreate = false;
  댓글 수: 3

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Parallel for-Loops (parfor)에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by