Skip to main content

SLURM

The slurm executor runs pipeline tasks using the SLURM resource manager. It submits each task as a SLURM job using the sbatch command.

To enable the SLURM executor, set process.executor = 'slurm' in the nextflow.config file. Launch the pipeline from a node where sbatch is available, typically the cluster login node.

Use the following process directives to control resource requests and other job characteristics:

Specify SLURM partitions with the queue directive.

note

Nextflow does not support SLURM multi-clusters directly. To submit tasks to a cluster other than the current one, set the SLURM_CLUSTERS variable in the launch environment.

Added in version 23.10

Some SLURM clusters require memory allocations to be specified with --mem-per-cpu instead of --mem. To enable this behavior, set executor.perCpuMemAllocation = true in the Nextflow configuration. Nextflow then computes the memory per CPU for each task, using 1 CPU by default.

Added in version 26.04

Since SLURM 24, squeue supports an --only-job-state option that ignores the partition (-p) or user (-u) filters. To enable this behavior, set executor.$slurm.onlyJobState = true in your Nextflow configuration. Enabling SchedulerParameters=enable_job_state_cache improves Nextflow performance and reduces load on the SLURM controller. See enable_job_state_cache and --only-job-state for more information.