GatherResourceUsageTask#
- class lsst.analysis.tools.tasks.GatherResourceUsageTask(*, config: PipelineTaskConfig | None = None, log: logging.Logger | LsstLogAdapter | None = None, initInputs: dict[str, Any] | None = None, **kwargs: Any)#
Bases:
PipelineTaskA
PipelineTaskthat gathers resource usage statistics from task metadata.Notes#
This is an unusual
PipelineTaskin that its input connection has dynamic dimensions.Its output table has columns for each of the dimensions of the input metadata’s data ID, as well as (subject to configuration):
memory: the maximum resident set size for the entire quantum (in bytes);prep_time: the time spent in the pre-initialization step in which the middleware checks which of the quantum’s inputs are available;init_time: the time spent in task construction;run_time: the time spent executing the task’s runQuantum method.wall_time: elapsed time in the pre-initialization step, in task construction, and in executing the task’s runQuantum method. Specifically, this is the difference betweenprepUtc, which triggers as soon as single quantum execution has begun (but can include some checks and runningupdatedQuantumInputs), andendUtc, which triggers immediately afterrunQuantum.{method}: the time spent in a particular task or subtask method decorated withlsst.utils.timer.timeMethod.
All time durations are CPU times in seconds, and all columns are 64-bit floating point. Methods or steps that did not run are given a duration of zero.
It is expected that this task will be configured to run multiple times in most pipelines, often once for each other task in the pipeline.
Methods Summary
run(universe, input_metadata)Gather resource usage statistics from per-quantum metadata.
runQuantum(butlerQC, inputRefs, outputRefs)Do butler IO and transform to provide in memory objects for tasks
runmethod.Methods Documentation
- run(universe, input_metadata)#
Gather resource usage statistics from per-quantum metadata.
Parameters#
- universe
DimensionUniverse Object managing all dimensions recognized by the butler; used to standardize and expand
GatherResourceUsageConfig.dimensions.- input_metadata
list[DeferredDatasetHandle] List of
lsst.daf.butler.DeferredDatasetHandlethat can be used to load all input metadata datasets.
Returns#
- result
Struct Structure with a single element:
outout_table: apandas.DataFramethat aggregates the configured resource usage statistics.
- universe
- runQuantum(butlerQC, inputRefs, outputRefs)#
Do butler IO and transform to provide in memory objects for tasks
runmethod.Parameters#
- butlerQC
QuantumContext A butler which is specialized to operate in the context of a
lsst.daf.butler.Quantum.- inputRefs
InputQuantizedConnection Datastructure whose attribute names are the names that identify connections defined in corresponding
PipelineTaskConnectionsclass. The values of these attributes are thelsst.daf.butler.DatasetRefobjects associated with the defined input/prerequisite connections.- outputRefs
OutputQuantizedConnection Datastructure whose attribute names are the names that identify connections defined in corresponding
PipelineTaskConnectionsclass. The values of these attributes are thelsst.daf.butler.DatasetRefobjects associated with the defined output connections.
- butlerQC