In job_tools.py, ensure_n_jobs / fix_job_kwargs resolve n_jobs=-1 using os.cpu_count().
On SLURM (and other schedulers/containers that restrict CPU affinity via cgroups or cpusets), os.cpu_count() reports the physical core count of the whole node, not the number of cores actually allocated to the job/task. When --cpus-per-task is smaller than the node's total core count, n_jobs=-1 spawns far more worker processes than are actually schedulable, causing heavy oversubscription. In our case this manifests as jobs intermittently hanging on the HPC.
In
job_tools.py,ensure_n_jobs/fix_job_kwargsresolven_jobs=-1usingos.cpu_count().On SLURM (and other schedulers/containers that restrict CPU affinity via cgroups or cpusets),
os.cpu_count()reports the physical core count of the whole node, not the number of cores actually allocated to the job/task. When--cpus-per-taskis smaller than the node's total core count,n_jobs=-1spawns far more worker processes than are actually schedulable, causing heavy oversubscription. In our case this manifests as jobs intermittently hanging on the HPC.