Skip to content

Commit e79b9ef

Browse files
Document dynamic directive syntax with named arguments (#5758)
Signed-off-by: Ben Sherman <[email protected]> Co-authored-by: Chris Hakkaart <[email protected]>
1 parent 5ead5ba commit e79b9ef

File tree

1 file changed

+17
-4
lines changed

1 file changed

+17
-4
lines changed

docs/process.md

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1293,13 +1293,26 @@ process foo {
12931293
}
12941294
```
12951295

1296-
In the above example the {ref}`process-memory` and execution {ref}`process-time` limits are defined dynamically. The first time the process is executed the `task.attempt` is set to `1`, thus it will request a two GB of memory and one hour of maximum execution time.
1296+
In the above example the {ref}`process-memory` and execution {ref}`process-time` limits are defined dynamically. The first time the process is executed the `task.attempt` is set to `1`, thus it will request 2 GB of memory and 1 hour of walltime.
12971297

1298-
If the task execution fail reporting an exit status in the range between 137 and 140, the task is re-submitted (otherwise terminates immediately). This time the value of `task.attempt` is `2`, thus increasing the amount of the memory to four GB and the time to 2 hours, and so on.
1298+
If the task execution fails with an exit status between 137 and 140, the task is re-executed; otherwise, the run is terminated immediately. The re-executed task will have `task.attempt` set to `2`, and will request 4 GB of memory and 2 hours of walltime.
12991299

1300-
The directive {ref}`process-maxretries` set the maximum number of time the same task can be re-executed.
1300+
The {ref}`process-maxretries` directive sets the maximum number of times the same task can be re-executed.
1301+
1302+
:::{tip}
1303+
Directives with named arguments, such as `accelerator` and `disk`, must use a more verbose syntax when they are dynamic. For example:
1304+
1305+
```nextflow
1306+
// static request
1307+
disk 375.GB, type: 'local-ssd'
1308+
1309+
// dynamic request
1310+
disk { [request: 375.GB * task.attempt, type: 'local-ssd'] }
1311+
```
1312+
:::
13011313

13021314
### Dynamic task resources with previous execution trace
1315+
13031316
:::{versionadded} 24.10.0
13041317
:::
13051318

@@ -1317,8 +1330,8 @@ process foo {
13171330
"""
13181331
}
13191332
```
1320-
In the above example, the {ref}`process-memory` is set according to previous trace record metrics. In the first attempt, when no trace metrics are available, it is set to one GB. In the subsequent attempts, it doubles the previously allocated memory. See {ref}`trace-report` for more information about trace records.
13211333

1334+
In the above example, the {ref}`process-memory` is set according to previous trace record metrics. In the first attempt, when no trace metrics are available, it is set to 1 GB. In each subsequent attempt, the requested memory is doubled. See {ref}`trace-report` for more information about trace records.
13221335

13231336
### Dynamic retry with backoff
13241337

0 commit comments

Comments
 (0)