How to restart a new backgroundPool

18 ビュー (過去 30 日間)
Pete sherer
Pete sherer 2025 年 2 月 12 日 12:32
コメント済み: Matt J 2025 年 2 月 12 日 18:23
The delete( gcp('nocreate')) doesn't seem to be deleting the predefined backgroundPool.
>> pool = backgroundPool;
>> delete(gcp('nocreate'));
>> pool
pool =
BackgroundPool with properties:
NumWorkers: 24
Busy: false
Below would work. However we will not have variable pool in advance
>> pool = backgroundPool;
>> delete( pool);
>> pool
pool =
Deleted object.
any suggestion how to restart a fresh backgroundPool?

回答 (1 件)

Matt J
Matt J 2025 年 2 月 12 日 15:30
編集済み: Matt J 2025 年 2 月 12 日 15:30
delete(pool)
pool = backgroundPool;
  2 件のコメント
Pete sherer
Pete sherer 2025 年 2 月 12 日 17:32
the problem is that you will get error if you don't have pool pre-defined
that's why looking to use something like
delete(gcp('nocreate'));
Matt J
Matt J 2025 年 2 月 12 日 18:23
From ChatGPT:
There isn't a direct analog of gcp('nocreate') for backgroundPool because backgroundPool is a built-in, persistent pool that always exists when Parallel Computing Toolbox is available. Behavior Differences from gcp:
  • Unlike parpool, which creates and manages a pool of workers explicitly, backgroundPool is always available.
  • Calling backgroundPool multiple times always returns the same handle; it does not create additional instances.
  • Since backgroundPool is never "closed" or "deleted," there's no need for a 'nocreate' option like gcp('nocreate').

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

カテゴリ

Help Center および File ExchangeProgramming Utilities についてさらに検索

タグ

製品


リリース

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by