|
Lines 484-509
static int _thread_update_node_energy(void)
Link Here
|
| 484 |
rc = _read_ipmi_values(); |
484 |
rc = _read_ipmi_values(); |
| 485 |
|
485 |
|
| 486 |
if (rc == SLURM_SUCCESS) { |
486 |
if (rc == SLURM_SUCCESS) { |
| 487 |
uint32_t additional_consumption; |
|
|
| 488 |
if (previous_update_time == 0) { |
| 489 |
additional_consumption = 0; |
| 490 |
previous_update_time = last_update_time; |
| 491 |
} else { |
| 492 |
additional_consumption = |
| 493 |
_get_additional_consumption( |
| 494 |
previous_update_time, last_update_time, |
| 495 |
local_energy->base_watts, |
| 496 |
local_energy->current_watts); |
| 497 |
} |
| 498 |
if (local_energy->current_watts != 0) { |
487 |
if (local_energy->current_watts != 0) { |
| 499 |
local_energy->base_watts = local_energy->current_watts; |
488 |
local_energy->base_watts = local_energy->current_watts; |
| 500 |
local_energy->current_watts = last_update_watt; |
489 |
local_energy->current_watts = last_update_watt; |
|
|
490 |
if (previous_update_time == 0) |
| 491 |
local_energy->base_consumed_energy = 0; |
| 492 |
else |
| 493 |
local_energy->base_consumed_energy = |
| 494 |
_get_additional_consumption( |
| 495 |
previous_update_time, last_update_time, |
| 496 |
local_energy->base_watts, |
| 497 |
local_energy->current_watts); |
| 501 |
local_energy->previous_consumed_energy = |
498 |
local_energy->previous_consumed_energy = |
| 502 |
local_energy->consumed_energy; |
499 |
local_energy->consumed_energy; |
| 503 |
local_energy->consumed_energy += additional_consumption; |
500 |
local_energy->consumed_energy += |
| 504 |
local_energy->base_consumed_energy = |
501 |
local_energy->base_consumed_energy; |
| 505 |
additional_consumption; |
|
|
| 506 |
} |
502 |
} |
|
|
503 |
if (previous_update_time == 0) |
| 504 |
previous_update_time = last_update_time; |
| 507 |
if (local_energy->current_watts == 0) { |
505 |
if (local_energy->current_watts == 0) { |
| 508 |
local_energy->consumed_energy = 0; |
506 |
local_energy->consumed_energy = 0; |
| 509 |
local_energy->base_watts = 0; |
507 |
local_energy->base_watts = 0; |