Skip to content
Snippets Groups Projects
Commit b6a8373c authored by Morris Jette's avatar Morris Jette
Browse files

power/cray - Prevent possible divide by zero

parent b118eca1
No related branches found
No related tags found
No related merge requests found
...@@ -14,6 +14,7 @@ documents those changes that are of interest to users and administrators. ...@@ -14,6 +14,7 @@ documents those changes that are of interest to users and administrators.
and it doesn't meet basic requirements. and it doesn't meet basic requirements.
-- burst_buffer/cray - Fix for script creating or deleting persistent buffer -- burst_buffer/cray - Fix for script creating or deleting persistent buffer
would fail "paths" operation and hold the job. would fail "paths" operation and hold the job.
-- power/cray - Prevent possible divide by zero.
* Changes in Slurm 15.08.10 * Changes in Slurm 15.08.10
=========================== ===========================
......
...@@ -1437,13 +1437,16 @@ static void _rebalance_node_power(void) ...@@ -1437,13 +1437,16 @@ static void _rebalance_node_power(void)
if ((alloc_power > cap_watts) || (node_power_needed > avail_power)) { if ((alloc_power > cap_watts) || (node_power_needed > avail_power)) {
/* When CapWatts changes, we might need to lower nodes more /* When CapWatts changes, we might need to lower nodes more
* than the configured change rate specifications */ * than the configured change rate specifications */
uint32_t red1 = 0, red2 = 0; uint32_t red1 = 0, red2 = 0, node_num;
if (alloc_power > cap_watts) if (alloc_power > cap_watts)
red1 = alloc_power - cap_watts; red1 = alloc_power - cap_watts;
if (node_power_needed > avail_power) if (node_power_needed > avail_power)
red2 = node_power_needed - avail_power; red2 = node_power_needed - avail_power;
red1 = MAX(red1, red2); red1 = MAX(red1, red2);
red1 /= (node_power_lower_cnt + node_power_same_cnt); node_num = node_power_lower_cnt + node_power_same_cnt;
if (node_num == 0)
node_num = node_record_count;
red1 /= node_num;
for (i = 0, node_ptr = node_record_table_ptr; for (i = 0, node_ptr = node_record_table_ptr;
i < node_record_count; i++, node_ptr++) { i < node_record_count; i++, node_ptr++) {
if (!node_ptr->power || !node_ptr->power->new_cap_watts) if (!node_ptr->power || !node_ptr->power->new_cap_watts)
......
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