With the previous algorithm, some nodes have no jobs assigned to them due to rounding consideration.
For example with 10 nodes and 13 jobs to assign:
13 jobs / 10 nodes -> 1.3 jobs per node -> rounded to 2 -> only the 1st 6 nodes run 2 jobs, the 7th 1 job and the other 0 job.
Using a modulo ensures that each node will at least run 1 job.