aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVolker Hoffmann <volker@cheleb.net>2015-08-26 09:08:11 +0200
committerVolker Hoffmann <volker@cheleb.net>2015-08-26 09:08:11 +0200
commit68d53ef05ffd5084c1621b53f178fadf0c07e346 (patch)
tree883bbd3f1d0856ecdb35bf6d9ac18b73c5bb7710
parente4f7fcd1c53bbfc1e507eb34213fd6ac0dd6f752 (diff)
fix: compute cpu utilization with allocated cpu cores instead of partitions
-rw-r--r--Common/derived.py5
-rw-r--r--ticker.py3
2 files changed, 5 insertions, 3 deletions
diff --git a/Common/derived.py b/Common/derived.py
index fae3da5..eb29a14 100644
--- a/Common/derived.py
+++ b/Common/derived.py
@@ -4,7 +4,8 @@ Derived Quantities.
def compute_utilization(number_of_nodes_down, \
- number_of_jobs_by_partition):
+ number_of_jobs_by_partition, \
+ number_of_allocated_cpus):
"""
Compute Cluster Utilization.
@@ -21,7 +22,7 @@ def compute_utilization(number_of_nodes_down, \
# 2 Sockets per Server, 8 Cores per Socket, 192 Servers = 3072 Cores
total_cpu_cores = 16*192
cpu_nodes_down = number_of_nodes_down['cpu']*16
- allocated_cpu_cores = number_of_jobs_by_partition['cpu']['running']
+ allocated_cpu_cores = number_of_allocated_cpus['cpu']
utilization['cpu'] = \
float(allocated_cpu_cores) / float(total_cpu_cores - cpu_nodes_down)
diff --git a/ticker.py b/ticker.py
index 3cc34ec..12e4456 100644
--- a/ticker.py
+++ b/ticker.py
@@ -28,7 +28,8 @@ njobs_by_partition_and_state = \
# #############################################################################
utilization_by_partition = \
derived.compute_utilization(number_of_nodes_down, \
- njobs_by_partition_and_state)
+ njobs_by_partition_and_state, \
+ cpu_allocations)
# #############################################################################
# Load Data from Netatmo