Resource requirements
The keywords “MUST”, “MUST NOT”, “SHOULD”, etc. are to be interpreted as described in RFC 2119.
1 Use of labels in modules
An appropriate resource label MUST be provided for the module as listed in the nf-core pipeline template.
For example, process_single, process_low, process_medium or process_high.
2 Source of multiple threads or cores value
If the tool supports multi-threading, provide the appropriate parameter using the Nextflow task variable.
For example, --threads $task.cpus.
If the tool does not support multi-threading, consider process_single unless large amounts of RAM are required.
3 GPU acceleration
Modules that support GPU acceleration SHOULD use task.accelerator to detect whether a GPU has been requested.
Pipelines control GPU allocation by setting accelerator = 1 in their process config (e.g., via a process_gpu label or a withName block).
The module SHOULD NOT set the accelerator directive itself.
Placing GPU allocation in the pipeline config lets users control it through their pipeline config or profiles.
A label-only alternative (e.g., requiring a process_gpu label) would not work for modules that support both CPU and GPU modes (e.g., ribodetector), so the specification leaves this to the pipeline author.
See Software requirements: GPU-capable modules for container patterns based on task.accelerator.
Pipelines set accelerator = 1 and GPU container flags via containerOptions in their process config.
Use containerOptions (not global docker.runOptions) to scope GPU flags to GPU processes only.
Multiple concurrent GPU processes sharing a single GPU can deadlock under Singularity.
Docker’s NVIDIA runtime handles GPU memory arbitration, but Singularity does not.
When GPU tasks may land on the same machine (CI, local executor, shared HPC nodes), set maxForks = 1 on GPU processes to serialise access.
4 Specifying multiple threads for piped commands
If a module contains multiple tools that support multi-threading (e.g., piping output into a samtools command), assign CPUs per tool:
- [
task.cpus] is supplied unchanged when a process uses multiple cores. - If one tool is multi-threaded and another uses a single thread, specify directly in the command itself. For example, with
${task.cpus}.