Parameters¶
Parameterized workflows are supported by Sirocco, typically for ensemble or sensitivity experiments. Since Sirocco includes data nodes in the workflow graph, parameters apply to both task and data instances. As each configuration section is documented in its own place, the parameter related specifications are spread across several of them. This page gathers them and shows how they are assembled in a complete example.
Parameters not yet fully functional
Even though workflows with parameterized tasks and pieces of data can be generated, the parameter values are not yet exposed to the tasks themselves.
Overview¶
Using parameters is a three step process:
| Step | Where | What |
|---|---|---|
| Declare | root level parameters section |
parameter names and their possible values |
| Attach | tasks and data entries, under parameters |
which tasks and pieces of data are instantiated for each combination of parameter values |
| Target | cycles section, under parameters of an input or a wait_on entry |
which instances of a parameterized node are targeted, using one of the two targeting modes single or all (default) |
full parameter space
Note that a task or data instance will be generated for each possible combination of the parameters attached to it, i.e. the full matrix will be used. It is not possible to select only a subset of these possible combinations.
Specifications¶
This root level section is short and simple. It is just a mapping from parameter names to the sequence of their possible values and reads like this:
Rules¶
Targeting modes¶
When a task targets a parameterized node, either as an input or in wait_on, the targeted instances are selected parameter by parameter, using one of the two following modes:
single: only the instance with the same value as the current task is targeted. This requires the current task to be parameterized by the same parameter.all: all instances, i.e. all values of that parameter, are targeted.
all is the default
Any parameter of the targeted node that is not explicitly mentioned is resolved with the all mode. For instance, if a task parameterized by foo takes as input a piece of data also parameterized by foo without specifying foo: single, each task instance will receive the data instances for all values of foo, not only its own.
Modes given for parameters the targeted node does not carry are ignored.
Outputs¶
A generated piece of data must carry exactly the same parameters as the task producing it. Parameters can therefore neither be added nor dropped through outputs. Reducing a parameter dimension, e.g. computing statistics over ensemble members, is done with a task that is not parameterized by that parameter and takes the data instances as input in the all mode. This is what the statistics foo and statistics bar tasks do in the example below.
Available data¶
Available data can be parameterized as well, for instance to provide different initial conditions for each ensemble member. Since available data does not belong to any cycle, its instances only have parameter coordinates and no date.
Example of a parameterized workflow¶
In order to better understand where and how parameters are declared, attached and targeted, the graph representation of a parameterized workflow is displayed below and the corresponding sirocco.yaml configuration file, with all mentions of parameters highlighted, comes right after. Click on the markers for explanations.
var_start_date: &root_start_date '2026-01-01T00:00'
var_stop_date: &root_stop_date '2026-05-01T00:00'
scheduler: slurm
cycles:
- bi-monthly:
cycling:
start_date: *root_start_date
stop_date: *root_stop_date
period: "P2M"
tasks:
- pre proc:
inputs:
raw_input: [raw input data]
outputs:
processed: [boundary conditions]
wait_on:
- model: # (1)!
when:
after: "2026-03-01T00:00"
target_cycle:
lag: "-P4M"
- model:
inputs:
init:
- initial conditions:
when:
at: *root_start_date
bc: [boundary conditions]
restart_in:
- restart_file:
when:
after: *root_start_date
target_cycle:
lag: "-P2M"
parameters: # (2)!
foo: single
bar: single
outputs:
output_streams: [stream 1]
restart_out: [restart_file]
- post proc:
inputs:
in:
- stream 1:
parameters: # (3)!
foo: single
bar: single
outputs:
out: [processed]
- statistics foo:
inputs:
in:
- processed:
parameters: # (4)!
foo: all
bar: single
outputs:
out: [stat foo]
- statistics bar:
inputs:
in:
- stat foo:
parameters: # (5)!
bar: all
outputs:
out: [stat bar]
tasks:
- ROOT: [...]
- pre proc: [...]
- model:
[...]
parameters: [foo, bar] # (6)!
- post proc:
[...]
parameters: [foo, bar]
- statistics foo:
[...]
parameters: [bar] # (7)!
- statistics bar: [...]
data:
available:
- raw input data: [...]
- initial conditions: [...]
generated:
- boundary conditions: [...]
- stream 1:
[...]
parameters: [foo, bar] # (8)!
- restart_file:
[...]
parameters: [foo, bar]
- processed:
[...]
parameters: [foo, bar]
- stat foo:
[...]
parameters: [bar]
- stat bar: [...]
parameters: # (9)!
foo: [0, 1, 2]
bar: [1.5, 2.9]
- No
parametersare given here althoughmodelis parameterized byfooandbar. The defaultallmode applies, so eachpre procinstance waits on all 6modelinstances of the targeted cycle occurrence. Note that with only 2 cycle occurrences, thewhencondition is never met, so this dependency doesn't appear in the graph. - Each
modelinstance continues from its own restart file. Withoutsingle, the defaultallmode would feed all 6 restart files to eachmodelinstance. - Each
post procinstance processes the output of themodelinstance with the samefooandbarvalues. - Reduction over
foo: eachstatistics fooinstance gathers the 3processedinstances (one perfoovalue) sharing its ownbarvalue. - Reduction over
bar: the singlestatistics barinstance gathers bothstat fooinstances. - Attaching
fooandbartomodelcreates \(3 \times 2 = 6\) instances per cycle occurrence. - Only parameterized by
bar, so 2 instances per cycle occurrence. Sincefoois dropped, it has to be reduced over in the inputs with theallmode (see 4). - Generated data must carry exactly the same parameters as the task producing it:
stream 1is an output ofmodel, so it is parameterized byfooandbar. The same holds forrestart_file(model),processed(post proc) andstat foo(statistics foo). - Declaration of the parameters and their possible values.
Reading the graph¶
The following table summarizes, for each cycle occurrence, the parameterized tasks of the example and how many instances are created.
| Task | Parameters | Instances per cycle occurrence | Gathers |
|---|---|---|---|
model, post proc |
foo, bar |
\(3 \times 2 = 6\) | — |
statistics foo |
bar |
2 | 3 processed instances (all foo values) |
statistics bar |
— | 1 | 2 stat foo instances (all bar values) |