Skip to content

Commit

Permalink
fixed a bugs that shows GPU IDs for queueing jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
justanhduc committed Nov 4, 2021
1 parent 58a2e7b commit 1c1d28c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions jobs.c
Original file line number Diff line number Diff line change
Expand Up @@ -678,11 +678,11 @@ int next_run_job() {
* These GPUs should not be used.*/
int i = 0, j = 0;
/* loop until all GPUs required can be found, or there are enough GPUs */
p->gpu_ids = (int*) malloc(p->num_gpus * sizeof(int));
int *gpu_ids = (int*) malloc(p->num_gpus * sizeof(int));
while (i < p->num_gpus && j < numFree) {
/* if the prospective GPUs are in used, select the next one */
if (!used_gpus[freeGpuList[j]]) {
p->gpu_ids[i] = freeGpuList[j];
gpu_ids[i] = freeGpuList[j];
i++; /* select this GPU */
}
j++;
Expand All @@ -692,6 +692,7 @@ int next_run_job() {
p = p->next;
continue;
}
memcpy(p->gpu_ids, gpu_ids, p->num_gpus * sizeof(int));
}

if (p->do_depend) {
Expand Down

0 comments on commit 1c1d28c

Please sign in to comment.