EDIT: the question title and tags were adjusted after the discovery that the described behavior does not stem from SLURM but from the R package {drake} which is used as a proxy to execute SLURM array jobs.
I've got the following situation:
- A Slurm job array of
n=70
with X CPU and Y Mem per job - 120 tasks to be run
- Each task requires the same CPU + Mem but takes a different time to finish
This leads to the following situation:
For tasks 71-120 (after 1 - 70 completed), I have 50 active workers and 20 idle workers. The idle workers will not do any work anymore and just wait for the active workers to complete.
Now over time more and more workers finish and at some point I have 5 active workers and 65 idle ones. Let's assume that the last 5 tasks take quite some time to complete. During this time, the idle workers block resources on the cluster and also constantly print the following to their respective log files
2021-04-03 19:41:41.866282 | > WORKER_WAIT (0.000s wait)
2021-04-03 19:41:41.868709 | waiting 1.70s
2021-04-03 19:41:43.571948 | > WORKER_WAIT (0.000s wait)
[...]
Is there a way to shut down these idle workers and free resources after there is not more task for them to be allocated? Currently they wait until all workers are done and only then release the resources.