number of processors to use is either hardcoded (4, 8) either set using multiprocessing.cpu_count()
problem is that multiprocessing.cpu_count() returns the number of available cpu, 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,
number of processors to use is either hardcoded (4, 8) either set using
multiprocessing.cpu_count()
problem is that
multiprocessing.cpu_count()
returns the number of available cpu, 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 ofmultiprocessing.cpu_count()
regards
Eric