You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
minipolish/misc.py uses multiprocessing.cpu_count() to ge the max value of threads. in
def get_default_thread_count():
return min(multiprocessing.cpu_count(), 16)```
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.
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
The text was updated successfully, but these errors were encountered:
Hello
minipolish/misc.py
uses multiprocessing.cpu_count() to ge the max value of threads. inThe text was updated successfully, but these errors were encountered: