Retrieves collected outputs from a named stage or automatically from the
terminal sink stage(s) of a slurm_pipeline_run().
Arguments
- run
A
slurmpilot_pipeline_runobject.- stage
Optional character stage name to collect. When
NULL(default), collects the single sink stage directly (or returns a named list if the DAG has multiple sink stages).- simplify
Logical; simplify results when fetching freshly from a stage job. Default
FALSE.- allow_partial
Logical; allow collecting incomplete stage results. Default
FALSE.
Examples
s1 <- slurm_stage("a", fun = function(x) x * 2, args_list = as.list(1:3))
s2 <- slurm_stage("b", fun = function(up) sum(up$a), depends_on = "a")
pipe <- slurm_pipeline(s1, s2, name = "collect_demo")
be <- mock_slurm_backend(max_workers = 1L)
run <- slurm_pipeline_run(pipe, be, poll_interval = 0.05)
slurm_pipeline_collect(run, simplify = TRUE)
#> [1] 12
unlink(be$root_dir, recursive = TRUE)
