ParslWorkflow#
- class lsst.ctrl.bps.parsl.ParslWorkflow(name: str, config: BpsConfig, path: str, jobs: dict[str, ParslJob], parents: Mapping[str, Iterable[str]], endpoints: Iterable[str], final: ParslJob | None = None)#
Bases:
BaseWmsWorkflowParsl-based workflow object to manage execution of workflow.
Parameters#
- name
str Unique name of workflow.
- config
lsst.ctrl.bps.BpsConfig Generic workflow config.
- path
str Path prefix for workflow output files.
- jobs
dictmappingstrtoParslJob Jobs to be executed.
- parents
dictmappingstrto iterable ofstr Dependency tree. Keywords are job names, and values are a list of job names that must be executed before the keyword job name can be executed.
- endpointsiterable of
str Endpoints of the dependency tree. These jobs (specified by name) have no children.
- final
ParslJob, optional Final job to be done, e.g., to merge the execution butler. This is done locally.
Methods Summary
execute(name)Execute a job.
Run final jobs.
from_generic_workflow(config, ...)Create a ParslWorkflow object from a BPS GenericWorkflow.
Run initial jobs.
load_dfk()Load data frame kernel.
read(out_prefix)Construct from the saved workflow state.
restart()Restart the workflow after interruption.
run([block])Run the workflow.
shutdown()Shut down the workflow.
start()Start the workflow.
write(out_prefix)Write workflow state.
Methods Documentation
- execute(name: str) Future | None#
Execute a job.
Parameters#
- name
str Name of job to execute.
Returns#
- future
FutureorNone A
Futureobject linked to the execution of the job, orNoneif the job is being reserved to run locally.
- name
- finalize_jobs()#
Run final jobs.
These jobs are run locally after all other jobs are complete.
This is used to merge the execution butler.
- classmethod from_generic_workflow(config: BpsConfig, generic_workflow: GenericWorkflow, out_prefix: str, service_class: str) BaseWmsWorkflow#
Create a ParslWorkflow object from a BPS GenericWorkflow.
Parameters#
- config
BpsConfig Configuration of the workflow.
- generic_workflow
lsst.ctrl.bps.generic_workflow.GenericWorkflow Generic representation of a single workflow.
- out_prefix
str Prefix for workflow output files.
- service_class
str Full module name of WMS service class that created this workflow.
Returns#
- self
ParslWorkflow Constructed workflow.
- config
- initialize_jobs()#
Run initial jobs.
These jobs are run locally before any other jobs are submitted to parsl.
This is used to set up the butler.
- load_dfk()#
Load data frame kernel.
This starts parsl.
- classmethod read(out_prefix: str) ParslWorkflow#
Construct from the saved workflow state.
Parameters#
- out_prefix
str Root directory to be used for WMS workflow inputs and outputs as well as internal WMS files.
Returns#
- self
ParslWorkflow Constructed workflow.
- out_prefix
- restart()#
Restart the workflow after interruption.
- run(block: bool = True) list[Future | None]#
Run the workflow.
Parameters#
- block
bool, optional Block returning from this method until the workflow is complete? If
False, jobs may still be running when this returns, and it is the user’s responsibility to call thefinalize_jobsandshutdownmethods when they are complete.
Returns#
- futures
listofFuture Futureobjects linked to the execution of the endpoint jobs.
- block
- shutdown()#
Shut down the workflow.
This stops parsl.
- start()#
Start the workflow.
- name