Skip to content
Snippets Groups Projects
Commit 2baf245d authored by jette's avatar jette
Browse files

Reset job --mem=0 value

If a job is submitted with the option --mem=0, then once the job
is allocated resources, reset that value to the amount of memory
on the allocated node with the smallest amount of memory. This is
probably the best option for right now. The downside is that if
the job is requeued, its memory size will no longer be the total
memory on all nodes if the cluster is heterogeneous. On the upside,
some memory data is available for accounting purposes.
bug 1526
parent 700e7b1d
No related branches found
No related tags found
No related merge requests found
......@@ -2829,6 +2829,7 @@ alloc_job:
job_res->memory_allocated[i] = save_mem;
}
} else { /* --mem=0, allocate job all memory on node */
uint32_t lowest_mem = 0;
first = bit_ffs(job_res->node_bitmap);
if (first != -1)
last = bit_fls(job_res->node_bitmap);
......@@ -2837,9 +2838,13 @@ alloc_job:
for (i = first, j = 0; i <= last; i++) {
if (!bit_test(job_res->node_bitmap, i))
continue;
if ((j == 0) ||
(lowest_mem > select_node_record[i].real_memory))
lowest_mem = select_node_record[i].real_memory;
job_res->memory_allocated[j++] =
select_node_record[i].real_memory;
}
details_ptr->pn_min_memory = lowest_mem;
}
return error_code;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment