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

list: A list of jobs to be included in this flow

name

character: Name of the flow. ['newflow']

desc

character Description of the flow, used to uniquely identify a flow instance. ['my_super_flow']

mode

character Mode of submission of the flow (depreciated). ['scheduler']

flow_run_path

The base path of all the flows you would submit. [~/flows]

trigger_path

character [~/flows/trigger].

flow_path

character: A unique path identifying a flow instance, populated by submit_flow.

version

version of flowr used to create and execute this flow.

status

character: Status of the flow.

module_cmds

[advanced use] a character vector of cmds which will be pre-pended to all script of this pipeline. Could be cmds like `module load mytool1;module load mytool2`

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)

[Package flowr version 0.9.11 Index]