Nauras Daraghmeh
07/31/2026, 10:38 AMnextflow run nf-core/ampliseq \
-r 2.17.0 \
-params-file nf-params.json \
-profile pdc_kth \
-work-dir $SCRATCH/nxf_work \
--project naiss2025-xx-yyyy \
-c pull_timeout_retry.config \
-resume
Got contacted by the PDC team that the pipeline had launched multiple java processes on the node where the pipeline was started, which triggered the center alert for using too much resources on the login node. Possible cause - CPU demanding local tasks.
They were a bit surprised that this happened. I ran it with -profile pdc_kth which should submit the run to slurm and not run anything locally, right?
Suggested solution: run via
salloc -p shared --nodes=1 -t 48:00:00
or
sbatch -p shared --nodes=1 -t 48:00:00
Just wanted to inform the community that this issue came up!Mahesh Binzer-Panchal
07/31/2026, 11:52 AM-profile pdc_kth doesn't submit the entire run to slurm. nextflow itself is running on the login node, but the process instances are submitted to slurm. Unless the executor set to local, the jobs should automatically select the correct partition and resources, and submit to slurm. It's possible though because of how the pipeline logic is programmed, that nextflow itself can take up excessive memory. Similarly if a pipeline uses native processes (exec rather than script) these run also where nextflow is running. Unless you're doing pipeline chaining there's generally no reason multiple instances of the JVM should run. Depending on the pipeline to run, there are various best practices. For a long running pipeline that might take several days, run it on the login node with profile pdc_kth in a screen session. If it's a shorter running pipeline, that uses a lot of cores, then submitting to a large node and running locally on the node with profile apptainer is better practice.Nauras Daraghmeh
07/31/2026, 12:10 PMpdc_kth. That's when the issue came up though. According to the PDC team, 12 core hours were consumed before the pipeline started). I was running the pipeline with 939 samples. Also, in some previous runs, it seems like there was some issues with how temporary files and processes were being handled, so I am setting up scratch manually before running the pipeline (hence the -work-dir $SCRATCH/nxf_work flag). Not sure if this is was part of the problem.Mahesh Binzer-Panchal
07/31/2026, 12:13 PMMahesh Binzer-Panchal
07/31/2026, 12:16 PMNauras Daraghmeh
07/31/2026, 12:19 PMpontus
08/01/2026, 12:49 PMexec usage for processes, or just Groovy code in the workflow or similar - but none of that should appear as separate processes, so that's kind of weird).pontus
08/01/2026, 12:54 PMNauras Daraghmeh
09/07/2026, 7:34 AM|-screen,1612118,nauras -S ampliseq
| `-bash,1612119
| `-bash,1624030 run_ampliseq.sh
| `-java,1624034 --add-opens=java.base/java.lang=
ALL-UNNAMED--add-opens=java.base/java.io=ALL-UNNAMED
| |-{java},1624294
| |-{java},1624298
| |-{java},1624299
| |-{java},1624300
...
"As I mentioned, it currently seems to be sleeping, probably waiting for the jobs on the compute nodes to finish. When it started, it consumed 12 core hours, which is suboptimal."
This was the info I got from the Dardel folks.pontus
09/07/2026, 8:02 AMlocal tasks as well if assume precise communication. Unfortunately, I have a hard time coming up with anything that might use that. Even if there's busy waiting somewhere while resources are being fetched, it should be difficult to get it to that level without it giving up.Nauras Daraghmeh
09/07/2026, 8:05 AMpontus
09/07/2026, 8:09 AMapptainer.cacheDir in a local config/environment (we've considered it but there's no real good place suitable for everybody).
Otherwise, every run will need to pull images again.Nauras Daraghmeh
09/07/2026, 8:21 AM# Load required modules
module load nextflow PDC/26.03 apptainer/1.5.1-cpeGNU-26.03
# Set scratch variable
export SCRATCH=/cfs/klemming/scratch/$(whoami | cut -c1)/$USER
# Set project storage variable
export PROJECT=/cfs/klemming/projects/supr/naiss2025-xx-yyyy
# Make directories if they don't already exist
mkdir -p $SCRATCH/nxf_work
mkdir -p $SCRATCH/tmp
mkdir -p $PROJECT/$USER/containers
# Set other variables
export TMPDIR=$SCRATCH/tmp
export SINGULARITY_TMPDIR=$SCRATCH/tmp
export SINGULARITY_CACHEDIR=$PROJECT/$USER/containers
export NXF_SINGULARITY_CACHEDIR=$PROJECT/$USER/containers
export APPTAINER_TMPDIR=$SCRATCH/tmp
export APPTAINER_CACHEDIR=$PROJECT/$USER/containers
export NXF_APPTAINER_CACHEDIR=$PROJECT/$USER/containerspontus
09/07/2026, 8:23 AMAPPTAINER_CACHEDIR and NXF_APPTAINER_CACHEDIR are different things and we usually don't recommend mixing them.pontus
09/07/2026, 8:24 AMsingularity from a nextflow perspective, so it's NXF_SINGULARITY_CACHEDIR that would be important.pontus
09/07/2026, 8:25 AMNauras Daraghmeh
09/07/2026, 8:30 AMexport SCRATCH=/cfs/klemming/scratch/$(whoami | cut -c1)/$USER
export PROJECT=/cfs/klemming/projects/supr/naiss2025-xx-yyyy
mkdir -p $SCRATCH/nxf_work
mkdir -p $SCRATCH/tmp
mkdir -p $PROJECT/$USER/containers
export TMPDIR=$SCRATCH/tmp
export APPTAINER_TMPDIR=$SCRATCH/tmp
export NXF_SINGULARITY_CACHEDIR=$PROJECT/$USER/containerspontus
09/07/2026, 8:32 AMwhoami there seems a bit superfluous if you rely expect USER to be set anyway (it should be).
I'm not sure if anything cares if you set those `TMPDIR`s.Nauras Daraghmeh
09/07/2026, 8:36 AMnxf_work probably still good to define for intermediate files that may be needed during runs with resume ?pontus
09/07/2026, 8:37 AMTMPDIR but that's probably it. Whatever runs belong in scratch or the project directory is a bit of a policy issue.Nauras Daraghmeh
09/07/2026, 8:40 AM# Load required modules
module load nextflow PDC/26.03 apptainer/1.5.1-cpeGNU-26.03
# Set scratch variable
export SCRATCH=/cfs/klemming/scratch/${USER:0:1}/$USER
# Set project storage variable
export PROJECT=/cfs/klemming/projects/supr/naiss2025-xx-yyyy
# Make directories if they don't already exist
mkdir -p $SCRATCH/nxf_work
mkdir -p $PROJECT/$USER/containers
# Set persistent Nextflow container cache
export NXF_SINGULARITY_CACHEDIR=$PROJECT/$USER/containerspontus
09/07/2026, 8:51 AMNauras Daraghmeh
09/07/2026, 8:58 AMresume wont be able to make use of intermediate files, but the same results should be obtained?
So after all, should I set any of the things above then, i.e., nxf_work or NXF_SINGULARITY_CACHEDIR ? Just the latter?pontus
09/07/2026, 9:12 AMNauras Daraghmeh
09/08/2026, 8:04 AM-profile pdc_kth ) handle scratch paths. Further down on this page, it is written that workDir should point to "fast scratch storage on HPC to keep your home filesystem clean". So it seems to me that there is a good practice recommendation to avoid persistent project storage as the place for temportary/intermediate files?Nauras Daraghmeh
09/08/2026, 8:06 AMpdc_kth points to scratch in any way...pontus
09/08/2026, 8:08 AMscratch function.
Since dardel is diskless (and things going to local filesystems are completely memorylocked) so far it has not seemed a worthwhile tradeoff to force use of the nextflow scratch function there - it does miss small database-like workloads that could likely benefit greatly, but the alternative would be tuning almost all jobs to use rather more memory.pontus
09/08/2026, 8:09 AMNauras Daraghmeh
09/08/2026, 8:10 AM