Thomas Krannich
09/22/2025, 11:46 AMSAMTOOLS_FLAGSTAT nf-core module using one thread (see commandSh.png). Now, I checked the "Raw usage" and "% Allocated" tabs in the report.html (see cpuAllocated.png) and their stats tell me that some of the instances of SAMTOOLS_FLAGSTAT used up to 142% of the allocated CPUs (red circle highlighting in cpuAllocated.png). Besides the fact that imho you can never use more CPUs than allocated, this should also just not be possible according to Nextflow's CPU-usage formula. The formula should never result in something higher than 100%.
Any ideas what's going on here?Alexander Nater
09/22/2025, 12:57 PM--threads is the additional threads to use apart from the main thread. And a tool can absolutely use more CPUs than allocated by Nextflow. This depends a lot on your executor. With local, nothing enforces the Nextflow allocation, with SLURM it's up to your settings how strict your scheduler enforces that jobs don't exceed their allocation.Mahesh Binzer-Panchal
09/22/2025, 1:46 PMThomas Krannich
09/22/2025, 2:29 PMThomas Krannich
09/22/2025, 2:31 PMThomas Krannich
09/22/2025, 2:34 PMlabel 'process_single' is actually doing very little. Why are we even specifying this if it is virtually never enforced (it seems)?Alexander Nater
09/22/2025, 2:43 PMcpus directive is still important for Nextflow to know how many tasks it can run at the same time given the total amount of CPUs available to the executor. But Nextflow needs to rely on the tool/user to actually stick to the requested amount.Thomas Danhorn
09/23/2025, 12:25 AM(1) Why is nothing constraining the resources locally?The only thing to constrain it would be the kernel, and implementing mechanisms to make the kernel do that is well beyond Nextflow's scope -- that is something a scheduler does (like SLURM; sorry, I don't how to configure it, though, but there should be plenty of docs), and Nextflow uses schedulers, but does not implement them. (In practice, if you run Nextflow with the
local scheduler, you are either testing informally, or you have a server that you control, and you can implement guard rails in the Nextflow config with things like maxForks, or you could install SLURM.)pontus
09/24/2025, 7:39 AM