For a new in-house pipeline, each module takes bet...
# help
p
For a new in-house pipeline, each module takes between 8s to 5m. This is extremely inefficient on the HPC. Is there a way to push the entire pipeline into a single job instead of running each module separately. We cannot run anything on the head node. Reposting here from #hpc
m
At the moment no. Combining the modules into single processes and piping within the script is still the most efficient way to group stuff. Use
xargs
etc within to also improve within script parallelisation / resource usage.
See below.
p
So it would mean rewriting the pipeline – not modular, combining the commands into a single process.
u
Another option can be to submit the head job to a worker node and ask for enough CPU/mem. Set max forks on the small tasks in combination with local executor. Only use SLURM/etc executor for larger tasks. We used this quite successfully with mag which at one stage was creating short 28000+ tasks.
👍🏽 1
👍 3
I meant
nf-core/mag
m
How did you choose which to set to local executor? Is there a sensible way to select the processes without doing a full run?
u
We started with a small set of samples. Then based on the Nextflow report/trace, set the max forks and executor. The initial few runs were not optimal but each run made the setup better and better.
s
this is where your
when
operator is handy @Mahesh Binzer-Panchal
m
how come?
s
@Usman you have that when code block to share ?
or maybe I am mixing things and to run local just change executor to local ?
u
Because part way through a big run, we were able to skip failing modules for specific samples. That helped a lot with finishing off non runs.
Yes, there is some mixup. But still sort of related.
n
The people at the HPC here have some setup where the whole nextflow thing is subsmitted as a srun job, which then uses the flux executor on the node
💥 1
they seem pretty happy with it, it is outlined here
m
n
You could also use the process.array option if you are using Slurm on the HPC
p
x-linking the OP
I'd love to have more documentation / guides around doing this with flux or hyperqueue, it comes up fairly often.
The thread Mahesh posted above went cold for that, so if anyone else would be interested in writing a guide for the Nextflow blog (or knows someone who would be) then shout 🙂
m
I'd like to learn more about it too.
I thought Ben posted about it somewhere but I can't find it so perhaps I'm misremembering. The podcast focused on that it was integrated by a contributor.
p
Yeah that was for Flux itself, ages ago when we were just getting started with the podcast. I don't think that we went into very much detail about it.
I'd love a "from zero to full setup" type blog / guide, with slurm + hyperqueue and/or slurm + flux
p
Naive question - is this only a slurm feature or does it work with other HPC schedulers too?
m
I believe it works with a wide variety of HPC schedulers and perhaps cloud and kubernetes too. I can't find a hard list, but there's a number of projects on their page: https://flux-framework.org/ which doesn't help the explanation. There's a write up on the Nextflows docs though how to use flux: https://www.nextflow.io/docs/stable/flux.html although I've not tried it myself.
p
My understanding is that for this context, we don't care about integration with HPC schedulers at all. In fact we actively don't want integration with schedulers - the whole point is that flux / hyperqueue runs as a local scheduler on a single node without submitting any jobs anywhere.
It's a scheduler within a scheduler
n
You can actually do multi-node setups i think
think about it 1
Copy code
srun -N 2 -M inter -p cm4_inter --pty flux start      # srun is needed for multi-node operation
compute-node> flux resource info
2 Nodes, 224 Cores, 0 GPUs
m
I thought that was the use-case here. Multi-node, otherwise is there any benefit over just using the
local
executor?
n
The local executor does not enforce any resource requests as I understand, this can be offloaded to the container engine, but flux actually limits resources (except memory)
p
See, this is why I need a guide / blog post! 😆
🤣 1
💯 2
n
Someone should turn https://www.nextflow.io/docs/latest/executor.html into a speadsheet
p
What would the columns be?
n
Can it limit resource X
and is it replacing "local" or does it require some sort of server / DB
And if it replaces local it can probably be stuffed inside job for one of the other executors 😉
m
Might need more than that if this table is anything to go by: https://flux-framework.readthedocs.io/en/latest/tables/comparison-table.html#comparison-table
p
Yeah but most stuff in that table isn't really relevant to Nextflow
n
yeah taht seems more relevant when building some hpc center and deciding on a scheduluer
p
I think that only Flux and Hyperqueue can be stuffed inside a job? But I might be wrong there..
n
i am not even sure if hq can really go into jobs without extra setup
but i am also not sure how much extra setup flux requires
I once got a (confusing) explanation from our HPC guys why setting up hq inside slurm jobs is more complex and maybe more confusing than using flux
Since this is the thread collecting information for phils blog post: it also seems that short tasks with flux are problematic, since there is scheduling overhead, and if you have a pipeline with many 10 second jobs, it might be good to increase queuesize to make sure the queue is always full while flux handles job overhead stuff
p
Some of my old friends have an example for how to use hyperqueue in a job at https://www.c3se.chalmers.se/documentation/miscellaneous/hyperqueue/#example, seems quite similar to how I'd expect a flux version to go. Doing a quick test on my laptop I doubt either hyperqueue or flux should have a problem that needs explicit management. (I haven't checked if these executors support array jobs in nextflow but compared to slurm setups I've seen, it'd be a lot more useful here 🙂
m
We used to launch #sarek on #helpdesk-hpc-sweden on a single node via local executor and scratch, it works quite well