Skip to content
Snippets Groups Projects
Commit 8c5399ba authored by Stephen Trofinoff's avatar Stephen Trofinoff Committed by Morris Jette
Browse files

Fix calculation of tasks per code

A simple one-line fix to the "_adjust_cpus_nppcu" function that I had
added.  I had added this function as part of the NPPCU functionality;
however it wasn't a problem until that squeue patch.  That was because
then squeue had been updated to use this function and in this one case
the default value for the internal variable "ntasks_per_core" wound up
not being the 0xffff (65535) that I previously had coded for (as in
"select/cons_res") but instead was 0.  Therefore, in that adjustment
function of mine, I simply added a second clause to the if-statment
where I check for the sentinel value that also checks whether it is 0.
This resolved the problem.  Because we do not usually use
"select/serial", I did not notice this.
parent ee125a47
No related branches found
No related tags found
No related merge requests found
......@@ -1118,7 +1118,8 @@ extern uint32_t cr_get_coremap_offset(uint32_t node_index)
extern int adjust_cpus_nppcu(uint16_t ntasks_per_core, uint16_t threads,
int cpus)
{
if (ntasks_per_core != 0xffff) {
if ((ntasks_per_core != 0) && (ntasks_per_core != 0xffff) &&
(threads != 0)) {
/* Adjust the number of CPUs according to the percentage of the
* hwthreads/core being used. */
cpus = cpus * ntasks_per_core / threads;
......
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