cancel
Syntax
Description
Examples
Cancel Bioinformatics Pipeline Blocks Running in Parallel
Import the pipeline and block objects needed for the example.
import bioinfo.pipeline.Pipeline import bioinfo.pipeline.block.*
Create a pipeline.
P = Pipeline;
Add some pause blocks for illustration purposes. Each block pauses for 1 and 10 seconds, respectively.
PB1 = UserFunction(@() pause(1)); PB2 = UserFunction(@() pause(10)); addBlock(P,[PB1,PB2]);
Run the pipeline in parallel.
run(P,UseParallel=true);
Starting parallel pool (parpool) using the 'Processes' profile ... Connected to parallel pool with 4 workers.
Let the pipeline run for a few seconds in parallel. Then cancel the pipeline while it is still running.
cancel(P);
Check the process table that contains the run status of each block. Set Expanded
to true to expand the process table variable values which are in cell arrays.
t = processTable(P,Expanded=true)
t=2×5 table
Block Status RunStart RunEnd RunErrors
________________ ______ ____________________ ____________________ ________________
"UserFunction_1" Error 26-Jul-2023 08:51:44 26-Jul-2023 08:51:44 {1×1 MException}
"UserFunction_2" Error 26-Jul-2023 08:51:44 26-Jul-2023 08:51:44 {1×1 MException}
You can extract more information from the process table. For example, check the run status of the first block.
PB1Info = t(1,:); PB1Info.Status
ans = RunStatus enumeration Error
Check any error message associated with the block.
PB1Info.RunErrors{:}
ans = MException with properties: identifier: 'parallel:fevalqueue:ExecutionCancelled' message: 'Execution of the future was cancelled.' cause: {} stack: [0×1 struct] Correction: []
Input Arguments
pipeline
— Bioinformatics pipeline
bioinfo.pipeline.Pipeline
object
Bioinformatics pipeline, specified as a bioinfo.pipeline.Pipeline
object.
Version History
Introduced in R2023a
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)