lsst.ctrl.mpexec¶
Command Line Scripts¶
The pipetask
command is being ported from an argparse framework to a Click
framework. During development the command implemented using Click is called
pipetask2
. At some point the current pipetask
command will be removed and
pipetask2
will be renamed to pipetask
.
pipetask2¶
pipetask2 [OPTIONS] COMMAND [ARGS]...
Options
-
--log-level
<log_level>
¶ The Python log level to use.
-
--long-log
¶
Make log messages appear in long format.
build¶
Build and optionally save pipeline definition.
This does not require input data to be specified.
pipetask2 build [OPTIONS]
Options
-
--log-level
<log_level>
¶ The Python log level to use.
-
--show
<ITEM|ITEM=VALUE>
¶ Dump various info to standard output. Possible items are:
config
,config=[Task::]
orconfig=[Task::]<PATTERN>:NOIGNORECASE
to dump configuration fields possibly matching given pattern and/or task label;history=
to dump configuration history for a field, field name is specified as [Task::][SubTask.]Field;dump-config
,dump-config=Task
to dump complete configuration for a task given its label or all tasks;pipeline
to show pipeline composition;graph
to show information about quanta;workflow
to show information about quanta and their dependency;tasks
to show task composition.
-
--option-section-17003221-2105-4482-ba44-d51304c43757
<option_section_17003221_2105_4482_ba44_d51304c43757>
¶
-
-p
,
--pipeline
<pipeline>
¶ Location of a pipeline definition file in YAML format.
-
-t
,
--task
<TASK[:LABEL>
¶ Task name to add to pipeline, must be a fully qualified task name. Task name can be followed by colon and label name, if label is not given then task base name (class name) is used as label.
-
--delete
<LABEL>
¶ Delete task with given label from pipeline.
-
-c
,
--config
<LABEL:NAME=VALUE>
¶ Config override, as a key-value pair.
-
-C
,
--config-file
<LABEL:FILE>
¶ Configuration override file(s), applies to a task with a given label.
-
--order-pipeline
¶
Order tasks in pipeline based on their data dependencies, ordering is performed as last step before saving or executing pipeline.
-
-s
,
--save-pipeline
<save_pipeline>
¶ Location for storing resulting pipeline definition in YAML format.
-
--pipeline-dot
<pipeline_dot>
¶ “Location for storing GraphViz DOT representation of a pipeline.
-
-i
,
--instrument
<instrument>
¶ Add an instrument which will be used to load config overrides when defining a pipeline. This must be the fully qualified class name.
-
--option-section-20387839-69ec-4b43-95af-bc01f05cc8c9
<option_section_20387839_69ec_4b43_95af_bc01f05cc8c9>
¶
Notes:
–task, –delete, –config, –config-file, and –instrument action options can appear multiple times; all values are used, in order left to right.
FILE reads command-line options from the specified file. Data may be distributed among multiple lines (e.g. one option per line). Data after # is treated as a comment and ignored. Blank lines and lines starting with # are ignored.)
qgraph¶
Build and optionally save quantum graph.
pipetask2 qgraph [OPTIONS]
Options
-
--log-level
<log_level>
¶ The Python log level to use.
-
--show
<ITEM|ITEM=VALUE>
¶ Dump various info to standard output. Possible items are:
config
,config=[Task::]
orconfig=[Task::]<PATTERN>:NOIGNORECASE
to dump configuration fields possibly matching given pattern and/or task label;history=
to dump configuration history for a field, field name is specified as [Task::][SubTask.]Field;dump-config
,dump-config=Task
to dump complete configuration for a task given its label or all tasks;pipeline
to show pipeline composition;graph
to show information about quanta;workflow
to show information about quanta and their dependency;tasks
to show task composition.
-
--option-section-c4d5bfce-543f-4153-92b4-678f2c226399
<option_section_c4d5bfce_543f_4153_92b4_678f2c226399>
¶
-
-p
,
--pipeline
<pipeline>
¶ Location of a pipeline definition file in YAML format.
-
-t
,
--task
<TASK[:LABEL>
¶ Task name to add to pipeline, must be a fully qualified task name. Task name can be followed by colon and label name, if label is not given then task base name (class name) is used as label.
-
--delete
<LABEL>
¶ Delete task with given label from pipeline.
-
-c
,
--config
<LABEL:NAME=VALUE>
¶ Config override, as a key-value pair.
-
-C
,
--config-file
<LABEL:FILE>
¶ Configuration override file(s), applies to a task with a given label.
-
--order-pipeline
¶
Order tasks in pipeline based on their data dependencies, ordering is performed as last step before saving or executing pipeline.
-
-s
,
--save-pipeline
<save_pipeline>
¶ Location for storing resulting pipeline definition in YAML format.
-
--pipeline-dot
<pipeline_dot>
¶ “Location for storing GraphViz DOT representation of a pipeline.
-
-i
,
--instrument
<instrument>
¶ Add an instrument which will be used to load config overrides when defining a pipeline. This must be the fully qualified class name.
-
--option-section-3abff9e3-8d3e-44ee-8544-17f305162108
<option_section_3abff9e3_8d3e_44ee_8544_17f305162108>
¶
-
-g
,
--qgraph
<qgraph>
¶ Location for a serialized quantum graph definition (pickle file). If this option is given then all input data options and pipeline-building options cannot be used.
-
--skip-existing
¶
If all Quantum outputs already exist in the output RUN collection then that Quantum will be excluded from the QuantumGraph. Requires the ‘run` command’s
--extend-run
flag to be set.
-
-q
,
--save-qgraph
<save_qgraph>
¶ Location for storing a serialized quantum graph definition (pickle file).
-
--save-single-quanta
<save_single_quanta>
¶ Format string of locations for storing individual quantum graph definition (pickle files). The curly brace {} in the input string will be replaced by a quantum number.
-
--qgraph-dot
<qgraph_dot>
¶ Location for storing GraphViz DOT representation of a quantum graph.
-
--option-section-f16289bc-0f0a-4580-b253-bb5cea630d61
<option_section_f16289bc_0f0a_4580_b253_bb5cea630d61>
¶
-
-b
,
--butler-config
<butler_config>
¶ Location of the gen3 butler/registry config file.
-
--input
<COLL,DSTYPE:COLL>
¶ Comma-separated names of the input collection(s). Entries may include a colon (:), the first string is a dataset type name that restricts the search in that collection.
-
-o
,
--output
<COLL>
¶ Name of the output CHAINED collection. This may either be an existing CHAINED collection to use as both input and output (incompatible with –input), or a new CHAINED collection created to include all inputs (requires –input). In both cases, the collection’s children will start with an output RUN collection that directly holds all new datasets (see –output-run).
-
--output-run
<COLL>
¶ Name of the new output RUN collection. If not provided then –output must be provided and a new RUN collection will be created by appending a timestamp to the value passed with –output. If this collection already exists then –extend-run must be passed.
-
--extend-run
¶
Instead of creating a new RUN collection, insert datasets into either the one given by –output-run (if provided) or the first child collection of - -output(which must be of type RUN).
-
--replace-run
¶
Before creating a new RUN collection in an existing CHAINED collection, remove the first child collection (which must be of type RUN). This can be used to repeatedly write to the same (parent) collection during development, but it does not delete the datasets associated with the replaced run unless –prune-replaced is also passed. Requires –output, and incompatible with –extend-run.
-
--prune-replaced
<prune_replaced>
¶ Delete the datasets in the collection replaced by –replace-run, either just from the datastore (‘unstore’) or by removing them and the RUN completely (‘purge’). Requires –replace-run.
Options: unstore|purge
-
-d
,
--data-query
<QUERY>
¶ User data selection expression.
-
--option-section-ec11c709-85d7-4ddd-bd01-afc93f70d9e9
<option_section_ec11c709_85d7_4ddd_bd01_afc93f70d9e9>
¶
Options marked with (f) are forwarded to the next subcommand if multiple subcommands are chained in the same command execution. Previous values may be overridden by passing new option values into the next subcommand.
run¶
Build and execute pipeline and quantum graph.
pipetask2 run [OPTIONS]
Options
-
--log-level
<log_level>
¶ The Python log level to use.
-
--debug
¶
Enable debugging output using lsstDebug facility (imports debug.py).
-
--show
<ITEM|ITEM=VALUE>
¶ Dump various info to standard output. Possible items are:
config
,config=[Task::]
orconfig=[Task::]<PATTERN>:NOIGNORECASE
to dump configuration fields possibly matching given pattern and/or task label;history=
to dump configuration history for a field, field name is specified as [Task::][SubTask.]Field;dump-config
,dump-config=Task
to dump complete configuration for a task given its label or all tasks;pipeline
to show pipeline composition;graph
to show information about quanta;workflow
to show information about quanta and their dependency;tasks
to show task composition.
-
--option-section-8bbce039-8fe0-4a1e-bdb7-ba43b5156629
<option_section_8bbce039_8fe0_4a1e_bdb7_ba43b5156629>
¶
-
-p
,
--pipeline
<pipeline>
¶ Location of a pipeline definition file in YAML format.
-
-t
,
--task
<TASK[:LABEL>
¶ Task name to add to pipeline, must be a fully qualified task name. Task name can be followed by colon and label name, if label is not given then task base name (class name) is used as label.
-
--delete
<LABEL>
¶ Delete task with given label from pipeline.
-
-c
,
--config
<LABEL:NAME=VALUE>
¶ Config override, as a key-value pair.
-
-C
,
--config-file
<LABEL:FILE>
¶ Configuration override file(s), applies to a task with a given label.
-
--order-pipeline
¶
Order tasks in pipeline based on their data dependencies, ordering is performed as last step before saving or executing pipeline.
-
-s
,
--save-pipeline
<save_pipeline>
¶ Location for storing resulting pipeline definition in YAML format.
-
--pipeline-dot
<pipeline_dot>
¶ “Location for storing GraphViz DOT representation of a pipeline.
-
-i
,
--instrument
<instrument>
¶ Add an instrument which will be used to load config overrides when defining a pipeline. This must be the fully qualified class name.
-
--option-section-7f567cb5-336c-4a1e-94eb-04d6d4b7f094
<option_section_7f567cb5_336c_4a1e_94eb_04d6d4b7f094>
¶
-
-g
,
--qgraph
<qgraph>
¶ Location for a serialized quantum graph definition (pickle file). If this option is given then all input data options and pipeline-building options cannot be used.
-
--skip-existing
¶
If all Quantum outputs already exist in the output RUN collection then that Quantum will be excluded from the QuantumGraph. Requires the ‘run` command’s
--extend-run
flag to be set.
-
-q
,
--save-qgraph
<save_qgraph>
¶ Location for storing a serialized quantum graph definition (pickle file).
-
--save-single-quanta
<save_single_quanta>
¶ Format string of locations for storing individual quantum graph definition (pickle files). The curly brace {} in the input string will be replaced by a quantum number.
-
--qgraph-dot
<qgraph_dot>
¶ Location for storing GraphViz DOT representation of a quantum graph.
-
--option-section-0002064c-77bc-487c-9aea-665e397d2730
<option_section_0002064c_77bc_487c_9aea_665e397d2730>
¶
-
-b
,
--butler-config
<butler_config>
¶ Location of the gen3 butler/registry config file.
-
--input
<COLL,DSTYPE:COLL>
¶ Comma-separated names of the input collection(s). Entries may include a colon (:), the first string is a dataset type name that restricts the search in that collection.
-
-o
,
--output
<COLL>
¶ Name of the output CHAINED collection. This may either be an existing CHAINED collection to use as both input and output (incompatible with –input), or a new CHAINED collection created to include all inputs (requires –input). In both cases, the collection’s children will start with an output RUN collection that directly holds all new datasets (see –output-run).
-
--output-run
<COLL>
¶ Name of the new output RUN collection. If not provided then –output must be provided and a new RUN collection will be created by appending a timestamp to the value passed with –output. If this collection already exists then –extend-run must be passed.
-
--extend-run
¶
Instead of creating a new RUN collection, insert datasets into either the one given by –output-run (if provided) or the first child collection of - -output(which must be of type RUN).
-
--replace-run
¶
Before creating a new RUN collection in an existing CHAINED collection, remove the first child collection (which must be of type RUN). This can be used to repeatedly write to the same (parent) collection during development, but it does not delete the datasets associated with the replaced run unless –prune-replaced is also passed. Requires –output, and incompatible with –extend-run.
-
--prune-replaced
<prune_replaced>
¶ Delete the datasets in the collection replaced by –replace-run, either just from the datastore (‘unstore’) or by removing them and the RUN completely (‘purge’). Requires –replace-run.
Options: unstore|purge
-
-d
,
--data-query
<QUERY>
¶ User data selection expression.
-
--option-section-dbec3a4d-a548-4e41-9166-47fac4f82b43
<option_section_dbec3a4d_a548_4e41_9166_47fac4f82b43>
¶
-
--clobber-partial-outputs
¶
Remove incomplete outputs from previous execution of the same quantum before new execution.
-
--do-raise
¶
Raise an exception on error. (else log a message and continue?)
-
--profile
<profile>
¶ Dump cProfile statistics to file name.
-
-j
,
--processes
<processes>
¶ Number of processes to use.
-
--timeout
<timeout>
¶ Timeout for multiprocessing; maximum wall time (sec).
-
--fail-fast
¶
Stop processing at first error, default is to process as many tasks as possible.
-
--graph-fixup
<graph_fixup>
¶ Name of the class or factory method which makes an instance used for execution graph fixup.
-
--option-section-96edaa9a-457c-47c9-b30b-6744a926dd0d
<option_section_96edaa9a_457c_47c9_b30b_6744a926dd0d>
¶
-
--skip-init-writes
¶
Do not write collection-wide ‘init output’ datasets (e.g.schemas).
-
--init-only
¶
Do not actually run; just register dataset types and/or save init outputs.
-
--register-dataset-types
¶
Register DatasetTypes that do not already exist in the Registry.
-
--no-versions
¶
Do not save or check package versions.
-
--option-section-af812a16-0498-4905-b3fe-2ce918034b7d
<option_section_af812a16_0498_4905_b3fe_2ce918034b7d>
¶
Options marked with (f) are forwarded to the next subcommand if multiple subcommands are chained in the same command execution. Previous values may be overridden by passing new option values into the next subcommand.
Contributing¶
lsst.ctrl.mpexec
is developed at https://github.com/lsst/ctrl_mpexec.
You can find Jira issues for this module under the ctrl_mpexec component.
Python API reference¶
lsst.ctrl.mpexec Package¶
Functions¶
graph2dot (qgraph, file) |
Convert QuantumGraph into GraphViz digraph. |
makeParser ([fromfile_prefix_chars, parser_class]) |
Make instance of command line parser for CmdLineFwk . |
pipeline2dot (pipeline, file) |
Convert Pipeline into GraphViz digraph. |
Classes¶
CmdLineFwk () |
PipelineTask framework which executes tasks from command line. |
ExecutionGraphFixup |
Interface for classes which update quantum graphs before execution. |
MPGraphExecutor (numProc, timeout, …[, …]) |
Implementation of QuantumGraphExecutor using same-host multiprocess execution of Quanta. |
MPGraphExecutorError |
Exception class for errors raised by MPGraphExecutor. |
MPTimeoutError |
Exception raised when task execution times out. |
PreExecInit (butler, taskFactory[, skipExisting]) |
Initialization of registry for QuantumGraph execution. |
QuantumExecutor |
Class which abstracts execution of a single Quantum. |
QuantumGraphExecutor |
Class which abstracts QuantumGraph execution. |
SingleQuantumExecutor (taskFactory[, …]) |
Executor class which runs one Quantum at a time. |
TaskFactory |
Class instantiating PipelineTasks. |