nf-core/configs: Snellius Configuration

All nf-core pipelines have been configured for use on Snellius, the Dutch national supercomputer hosted at SURF.

To use, run the pipeline with -profile snellius. This will download and launch the snellius.config which has been pre-configured with a setup suitable for Snellius. Jobs are submitted with Slurm, and software is run in containers with Apptainer, which is the only container engine installed on Snellius.

Partitions

Jobs can only run on the partitions your budget covers. The fat and high memory nodes need their own budget, which has to be requested in your Snellius application. Run accinfo and look at the Products line to see which partitions your budget covers.

The profile assumes a budget for rome and genoa. If your budget covers other CPU partitions, list them with --snellius_nodes, for example:

nextflow run nf-core/<pipeline> -profile snellius --snellius_nodes 'rome,genoa,fat_genoa' <other parameters>

The partitions you list set the following:

  • Maximum resources: processes are capped at the CPUs and memory of the listed node with the most memory, using the memory available to jobs on the Snellius partitions page. Both caps come from the same node, so every process fits on at least one of the listed partitions. The default rome,genoa caps processes at 192 CPUs and 336 GB, and adding fat_genoa raises this to 192 CPUs and 1440 GB. Adding himem_8tb raises the memory cap to 7680 GB but lowers the CPU cap to 128, because the high memory nodes have 128 CPUs.
  • Partition: Slurm on Snellius sends jobs without a partition to rome, so the profile sets the partition for each job. Snellius accepts only one partition per job, so each job is sent to the first of the listed partitions it fits on, in the order rome, genoa, fat_rome, fat_genoa, himem_4tb, himem_8tb. This puts jobs on the cheapest and smallest node that fits. With the default rome,genoa, jobs go to rome, and jobs that need more than 128 CPUs or 224 GB go to genoa. Jobs are never sent to a partition you did not list.

If you list a partition your budget does not cover, Slurm refuses the jobs sent there, and the pipeline stops with:

Terminal window
sbatch: error: No compute budget was found for the partition fat_genoa.
sbatch: error: Batch job submission failed: Access/permission denied

Remove that partition from --snellius_nodes and run the pipeline again with -resume.

GPUs

This profile does not support GPUs yet. It does not send processes to the GPU partitions or request GPUs from Slurm, so all processes run on CPU nodes, including those that pipelines label process_gpu. Pipelines that need a GPU for some steps, such as the Parabricks steps in nf-core/sarek, need to run those steps on the CPU alternative the pipeline offers.

Job names

Nextflow names each Slurm job after the process and its tag, for example NFCORE_RNASEQ:RNASEQ:FASTQC (SAMPLE1). Slurm on Snellius does not accept special characters such as :, ( and ) in job names, so this profile replaces every character other than letters, digits and underscores with an underscore. The job above is submitted as NFCORE_RNASEQ_RNASEQ_FASTQC__SAMPLE1_. Use these names to find your jobs in squeue and sacct.

Before running the pipeline

You need a Snellius login with an active budget (SBUs), either through an NWO grant or through your institution’s SURF contract. Snellius logins are per person and per project, so jobs are billed to the budget of the login you submit them from. Use accinfo or budget-overview to check your remaining budget.

Install Nextflow on a login node in one of the following ways. With mamba, from a Miniforge installation in your home directory. The environment includes Java, so no modules are needed:

mamba create -n nextflow -c conda-forge -c bioconda nextflow

Or with the Java module and the Nextflow installer:

module load 2024
module load Java/21.0.5
curl -s https://get.nextflow.io | bash
mkdir -p ~/bin && mv nextflow ~/bin/

If ~/bin is not on your PATH yet, add export PATH=$HOME/bin:$PATH to your ~/.bashrc.

Check that Nextflow works with:

nextflow info

See the nf-core installation guide for more on the Java and Nextflow versions pipelines need.

Then add the following to your ~/.bashrc, so that the settings are also passed to the Nextflow job you submit with sbatch:

# Nextflow on Snellius
export NXF_WORK=/scratch-shared/$USER/work
export NXF_APPTAINER_CACHEDIR=/projects/0/<your_project>/apptainer_cache
export NXF_OPTS="-Xms1g -Xmx8g"

Storage

Your home directory has a quota of 200 GiB, which is too small for most pipeline runs. The settings above put the files on the following file systems:

  • Work directory (NXF_WORK): /scratch-shared/$USER/work. The work directory has to be visible from all nodes, and /scratch-shared is. Files that have not changed for 14 days are removed automatically and without notice, so a run cannot be resumed with -resume after that.
  • Temporary files ($TMPDIR): Snellius sets $TMPDIR to a directory under /scratch-local/$USER in every job, and processes use it without any extra settings. This profile does not use the node-local /scratch-node disks, because only some nodes have them.
  • Results (--outdir): point this to your project space.

Scratch space has a quota of 8 TiB and a soft limit of 3 million files, counted over /scratch-shared and /scratch-local together. Pipelines with many samples can create a lot of files in the work directory, so remove it once a run has finished and you have checked the results. See the Snellius filesystems documentation for details.

Running the pipeline

Submit Nextflow itself as a Slurm job. The Nextflow job then submits the pipeline’s processes as separate Slurm jobs. Save the following as nextflow.sbatch:

#!/bin/bash
#SBATCH --job-name=nextflow
#SBATCH --ntasks=1
#SBATCH --cpus-per-task=8
#SBATCH --time=5-0:00:00
#SBATCH --output=nextflow_%j.log
# If you installed Nextflow with mamba
eval "$(conda shell.bash hook)"
conda activate nextflow
# If you installed Nextflow with the installer, use this instead
# module load 2024
# module load Java/21.0.5
nextflow run nf-core/<pipeline> -profile snellius --outdir /projects/0/<your_project>/results <other parameters>

And submit it from a login node with:

sbatch nextflow.sbatch

The Nextflow job itself goes to rome, because --snellius_nodes only applies to the pipeline’s processes. If your budget does not cover rome, give the Nextflow job a partition it does cover, for example sbatch --partition=fat_genoa nextflow.sbatch, or add #SBATCH --partition=fat_genoa to the script.

sbatch passes on the environment of the shell you submit from, so the variables from your ~/.bashrc are also set in the Nextflow job and in the jobs it submits.

The Nextflow job needs little compute, but it is billed as at least the smallest allocation on the partition it runs on (see below). Set --time to how long you expect the whole pipeline to take, up to the maximum walltime of 120 hours on Snellius. If a run does not finish in time, submit the script again with -resume added to the nextflow run command.

NB: Snellius bills SBUs per allocated core, and the smallest possible allocation is 1/8 of a node (16 cores and 28 GiB on rome, 24 cores and 42 GiB on genoa, 24 cores and 180 GiB on fat_genoa). Every job is therefore billed as at least 16 cores. Jobs are billed in steps of 1/8 of a node, by whichever is larger: the cores or the memory they request. For example, the STAR alignment in nf-core/rnaseq requests 12 CPUs and 72 GB, which on rome is the memory of 41 cores, so it is billed as 48 cores (3/8 of a node). fat_genoa is billed at 1.5 SBU per core hour, against 1.0 for rome and genoa. See the Snellius partitions and accounting documentation for details.

Config file

See config file on GitHub

conf/snellius
// Nextflow config for running on Snellius, the Dutch national supercomputer hosted at SURF
params {
config_profile_description = 'Snellius, the Dutch national supercomputer hosted at SURF.'
config_profile_contact = 'Barbara Verhaar (@barbarahelena)'
config_profile_url = 'https://servicedesk.surf.nl/wiki/spaces/WIKI/pages/30660184/Snellius'
// Partitions covered by your budget (see the 'Products' line of accinfo), e.g. --snellius_nodes 'rome,genoa,fat_genoa'
snellius_nodes = 'rome,genoa'
}
validation {
ignoreParams = ['snellius_nodes']
}
apptainer {
enabled = true
autoMounts = true
pullTimeout = 3.h
}
process {
// Listed node with the most memory, using the available memory per node from the Snellius partitions page.
// CPUs and memory both come from that one node, so every capped task fits on at least one listed partition.
// GPU and service partitions (staging, cbuild) are not included in this yet
resourceLimits = {
def nodes = [
rome : [cpus: 128, memory: 224.GB],
genoa : [cpus: 192, memory: 336.GB],
fat_rome : [cpus: 128, memory: 960.GB],
fat_genoa: [cpus: 192, memory: 1440.GB],
himem_4tb: [cpus: 128, memory: 3840.GB],
himem_8tb: [cpus: 128, memory: 7680.GB]
]
def requested = params.snellius_nodes.tokenize(',')
if (!requested || requested.any { name -> !nodes.containsKey(name) }) {
throw new IllegalArgumentException("Invalid --snellius_nodes '${params.snellius_nodes}'; choose from ${nodes.keySet().join(',')}")
}
def largest = nodes.subMap(requested).values().max { a, b -> a.memory <=> b.memory ?: a.cpus <=> b.cpus }
return [
cpus : largest.cpus,
memory: largest.memory,
time : 120.h
]
}.call()
executor = 'slurm'
// Jobs without a partition only go to rome, and Snellius accepts only one partition for shared jobs,
// so each task is sent to the first listed partition it fits on, from cheapest and smallest to largest
queue = {
def nodes = [
[name: 'rome', cpus: 128, memory: 224.GB],
[name: 'genoa', cpus: 192, memory: 336.GB],
[name: 'fat_rome', cpus: 128, memory: 960.GB],
[name: 'fat_genoa', cpus: 192, memory: 1440.GB],
[name: 'himem_4tb', cpus: 128, memory: 3840.GB],
[name: 'himem_8tb', cpus: 128, memory: 7680.GB]
]
def listed = nodes.findAll { node -> node.name in params.snellius_nodes.tokenize(',') }.toList() ?: [nodes[1]]
def fits = listed.find { node -> task.cpus <= node.cpus && (task.memory ?: 0.GB) <= node.memory }
return (fits ?: listed.max { node -> node.memory }).name
}
}
executor {
queueSize = 100
submitRateLimit = '30/1min'
// Slurm on Snellius does not accept special characters such as ':', '(' and ')' in job names
jobName = { task.name.replaceAll('[^a-zA-Z0-9_]', '_') }
}