Hello
sumtree.py get number of cpus using num_cpus = multiprocessing.cpu_count() which may be innacurate in a taskset context or a slurm allocation for example.
see:
$ nproc
96
$ taskset -c 1 nproc
1
$ taskset -c 1 python3 -c "import multiprocessing; print(multiprocessing.cpu_count())"
96
I would suggest to use len(os.sched_getaffinity(0)) instead of multiprocessing.cpu_count()
$ python3 -c "import os; print(len(os.sched_getaffinity(0)))"
96
$ taskset -c 1 python3 -c "import os; print(len(os.sched_getaffinity(0)))"
1
regards
Eric
Hello
sumtree.pyget number of cpus usingnum_cpus = multiprocessing.cpu_count()which may be innacurate in a taskset context or a slurm allocation for example.see:
I would suggest to use len(os.sched_getaffinity(0)) instead of multiprocessing.cpu_count()
regards
Eric