flow-class {flowr} | R Documentation |
Describing the flow class
Description
Internal function (used by to_flow), which aids in creating a flow object.
Usage
flow(
jobs = list(new("job")),
name = "newflow",
desc = "my_super_flow",
mode = c("scheduler", "local"),
flow_run_path = opts_flow$get("flow_run_path"),
trigger_path = "",
flow_path = "",
version = "0.0",
status = "created",
module_cmds = opts_flow$get("module_cmds"),
execute = ""
)
Arguments
jobs |
|
name |
|
desc |
|
mode |
|
flow_run_path |
The base path of all the flows you would submit. [~/flows] |
trigger_path |
|
flow_path |
|
version |
version of flowr used to create and execute this flow. |
status |
|
module_cmds |
[advanced use] a character vector of cmds which will be pre-pended to all script of this pipeline.
Could be cmds like |
execute |
execution status of flow object. [FALSE] |
Examples
cmds = rep("sleep 5", 10)
qobj <- queue(platform='torque')
## run the 10 commands in parallel
jobj1 <- job(q_obj=qobj, cmd = cmds, submission_type = "scatter", name = "job1")
## run the 10 commands sequentially, but WAIT for the previous job to complete
## Many-To-One
jobj2 <- job(q_obj=qobj, cmd = cmds, submission_type = "serial",
dependency_type = "gather", previous_job = "job1", name = "job2")
## As soon as first job on 'job1' is complete
## One-To-One
jobj3 <- job(q_obj=qobj, cmd = cmds, submission_type = "scatter",
dependency_type = "serial", previous_job = "job1", name = "job3")
fobj <- flow(jobs = list(jobj1, jobj2, jobj3))
## plot the flow
plot_flow(fobj)
## Not run:
## dry run, only create the structure without submitting jobs
submit_flow(fobj)
## execute the jobs: ONLY works on computing cluster, would fail otherwise
submit_flow(fobj, execute = TRUE)
## End(Not run)