unicycler.pyuses multiprocessing.cpu_count() to ge the number of cpus.
multiprocessing.cpu_count() return 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.
NB misc.py also does the same
see:
Hello,
unicycler.py
usesmultiprocessing.cpu_count()
to ge the number of cpus.multiprocessing.cpu_count()
return 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. NBmisc.py
also does the same see:I would suggest to use len(os.sched_getaffinity(0)) instead of multiprocessing.cpu_count()
NB Mac OSX python does not have os.sched_getaffinity so a portable way to code it would be
regards
Eric