Skip to content

Commit

Permalink
Add GPUs field to list output
Browse files Browse the repository at this point in the history
  • Loading branch information
bstee615 committed Oct 3, 2022
1 parent 455b39c commit 3c9e46f
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions jobs.c
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,17 @@ static int add_job_to_json_array(struct Job *p, cJSON *jobs) {
}
cJSON_AddItemToObject(job, "Time_ms", field);

/* GPUs */
#ifndef CPU
field = cJSON_CreateNumber(p->num_gpus);
if (field == NULL)
{
error("Error initializing JSON object for job %i field GPUs (value %d).", p->num_gpus);
return 0;
}
cJSON_AddItemToObject(job, "GPUs", field);
#endif /*CPU*/

/* Command */
field = cJSON_CreateStringReference(p->command);
if (field == NULL)
Expand Down

0 comments on commit 3c9e46f

Please sign in to comment.