Main Content

cancelAll

すべてのジョブまたはタスクをキャンセルする

R2022a 以降

    説明

    cancelAll(p.FevalQueue) は、指定されたプール内でキューに入っているかまたは実行中の要素をすべて停止します。

    すべて折りたたむ

    並列プールを作成します。

    pool = parpool;
    Starting parallel pool (parpool) using the 'Processes' profile ...
    Connected to the parallel pool (number of workers: 6).
    

    parfeval を使用して、出力を一切取得せずに pause(Inf) を実行します。

    f = parfeval(pool,@pause,0,Inf);

    プール内でキューに入っている実行中の関数のステータスを確認します。

    pool.FevalQueue
    ans = 
     FevalQueue with properties: 
    
            QueuedFutures: [0x0 parallel.FevalFuture]
           RunningFutures: [1x1 parallel.FevalFuture]
    
    

    cancelAll を使用して FevalQueue 内のすべての Futures を停止します。

    cancelAll(pool.FevalQueue)
    pool.FevalQueue
    ans = 
     FevalQueue with properties: 
    
            QueuedFutures: [0x0 parallel.FevalFuture]
           RunningFutures: [0x0 parallel.FevalFuture]
    
    

    入力引数

    すべて折りたたむ

    バックグラウンド プールで実行する、FevalFuture オブジェクトのキュー。FevalFuture スカラーおよび FevalFuture 配列として指定します。

    拡張機能

    バージョン履歴

    R2022a で導入