megahit uses multiprocessing.cpu_count() to ge the max value of cpus//threads.
but multiprocessing.cpu_count() is the number of cpu in the machine. But this is not the same as the number of cpu available to the process. For example, you can run in a taskset context or a batch scheduler like slurm.
Hello
megahit
usesmultiprocessing.cpu_count()
to ge the max value of cpus//threads. butmultiprocessing.cpu_count()
is the number of cpu in the machine. But this is not the same as the number of cpu available to the process. For example, you can run in a taskset context or a batch scheduler like slurm.see:
I would suggest to use len(os.sched_getaffinity(0)) instead of multiprocessing.cpu_count()
regards
Eric