Skip to content

Commit

Permalink
fixed a freeing bug
Browse files Browse the repository at this point in the history
  • Loading branch information
justanhduc committed Nov 4, 2021
1 parent c05651b commit 17ce082
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions jobs.c
Original file line number Diff line number Diff line change
Expand Up @@ -666,7 +666,6 @@ int next_run_job() {
if (numFree < p->num_gpus) {
/* if fewer GPUs than required then next */
p = p->next;
free(freeGpuList);
continue;
}
shuffle(freeGpuList, numFree);
Expand All @@ -686,11 +685,9 @@ int next_run_job() {
}
/* some GPUs might already be claimed by other jobs, but the system still reports as free -> skip */
if (i < p->num_gpus) {
free(freeGpuList);
p = p->next;
continue;
}
free(freeGpuList);
}

if (p->do_depend) {
Expand Down Expand Up @@ -722,7 +719,7 @@ int next_run_job() {
}
p = p->next;
}

free(freeGpuList);
return -1;
}

Expand Down

0 comments on commit 17ce082

Please sign in to comment.