Skip to content
Snippets Groups Projects
Commit 4886952e authored by Iustin Pop's avatar Iustin Pop
Browse files

Add a hack for normalized CPU values in hspace

Currently, the key metrics/tiered spec computations show the virtual cpu
count. However, since we do have a maximum ration Vcpu/Pcpu, we can also
show the “normalized” cpu count, i.e. the equivalent physical cpu count
corresponding to the virtual ones.
parent 03c6d8fa
No related branches found
No related tags found
No related merge requests found
......@@ -144,18 +144,20 @@ complete value for this variable could be: \fB4096,102400,2=225
2560,102400,2=20 512,102400,2=21\fR.
.TP
.I KM_USED_CPU, KM_USED_MEM, KM_USED_DSK
.I KM_USED_CPU, KM_USED_NPU, KM_USED_MEM, KM_USED_DSK
These represents the metrics of used resources at the start of the
computation (only for tiered allocation mode).
computation (only for tiered allocation mode). The NPU value is
"normalized" CPU count, i.e. the number of virtual CPUs divided by the
maximum ratio of the virtual to physical CPUs.
.TP
.I KM_POOL_CPU, KM_POOL_MEM, KM_POOL_DSK
.I KM_POOL_CPU, KM_POOL_NPU, KM_POOL_MEM, KM_POOL_DSK
These represents the total resources allocated during the tiered
allocation process. In effect, they represent how much is readily
available for allocation.
.TP
.I KM_UNAV_CPU, KM_UNAV_MEM, KM_UNAV_DSK
.I KM_UNAV_CPU, KM_POOL_NPU, KM_UNAV_MEM, KM_UNAV_DSK
These represents the resources left over (either free as in
unallocable or allocable on their own) after the tiered allocation has
been completed. They represent better the actual unallocable
......
......@@ -154,21 +154,22 @@ printResults fin_nl num_instances allocs sreason = do
-- this should be the final entry
printKeys [("OK", "1")]
formatRSpec :: String -> RSpec -> [(String, String)]
formatRSpec s r =
formatRSpec :: Double -> String -> RSpec -> [(String, String)]
formatRSpec m_cpu s r =
[ ("KM_" ++ s ++ "_CPU", show $ rspecCpu r)
, ("KM_" ++ s ++ "_NPU", show $ fromIntegral (rspecCpu r) / m_cpu)
, ("KM_" ++ s ++ "_MEM", show $ rspecMem r)
, ("KM_" ++ s ++ "_DSK", show $ rspecDsk r)
]
printAllocationStats :: Node.List -> Node.List -> IO ()
printAllocationStats ini_nl fin_nl = do
printAllocationStats :: Double -> Node.List -> Node.List -> IO ()
printAllocationStats m_cpu ini_nl fin_nl = do
let ini_stats = Cluster.totalResources ini_nl
fin_stats = Cluster.totalResources fin_nl
(rini, ralo, runa) = Cluster.computeAllocationDelta ini_stats fin_stats
printKeys $ formatRSpec "USED" rini
printKeys $ formatRSpec "POOL" ralo
printKeys $ formatRSpec "UNAV" runa
printKeys $ formatRSpec m_cpu "USED" rini
printKeys $ formatRSpec m_cpu "POOL"ralo
printKeys $ formatRSpec m_cpu "UNAV" runa
-- | Ensure a value is quoted if needed
ensureQuoted :: String -> String
......@@ -318,7 +319,7 @@ main = do
out_path
printKeys $ printStats PTiered (Cluster.totalResources trl_nl)
printKeys [("TSPEC", intercalate " " spec_map')]
printAllocationStats nl trl_nl)
printAllocationStats m_cpu nl trl_nl)
-- Run the standard (avg-mode) allocation
......
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