Open PeterKamphuis opened 1 year ago
When in the SelfCal worker the number of cpus is not specified caracal determines the number of cpus through psutil.cpu_count() in these lines:
https://github.com/caracal-pipeline/caracal/blob/29cd2a18905e7c6924f4aac1d9a6943ee37c87b5/caracal/workers/selfcal_worker.py#L283-L287
However psutil.cpu_count() determines the actual number of cpus on the hardware not necessarily the number of cpus caracal can use (see https://psutil.readthedocs.io/en/latest/index.html?highlight=cpu_count#psutil.cpu_count). This can especially lead to trouble when the amount of available cpus is limit by slurm or some other job manager.
The correct way would be (according to psutil):
ncpu = len(psutil.Process().cpu_affinity())
@PeterKamphuis any progress with this? Thanks!
@paoloserra No, but I shall try again to make some time for it.
When in the SelfCal worker the number of cpus is not specified caracal determines the number of cpus through psutil.cpu_count() in these lines:
https://github.com/caracal-pipeline/caracal/blob/29cd2a18905e7c6924f4aac1d9a6943ee37c87b5/caracal/workers/selfcal_worker.py#L283-L287
However psutil.cpu_count() determines the actual number of cpus on the hardware not necessarily the number of cpus caracal can use (see https://psutil.readthedocs.io/en/latest/index.html?highlight=cpu_count#psutil.cpu_count). This can especially lead to trouble when the amount of available cpus is limit by slurm or some other job manager.
The correct way would be (according to psutil):
ncpu = len(psutil.Process().cpu_affinity())