diff --git a/hspace.1 b/hspace.1 index 34d147ed6084198cfe48b08b335e5a63005d55dd..23bd296ae45266dc384d40fc36900d3de4d2eb9f 100644 --- a/hspace.1 +++ b/hspace.1 @@ -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 diff --git a/hspace.hs b/hspace.hs index 8b8405c76fc40f6756ccc4c21f85f351b21db085..90986d950ec9bf35d3fa2c3549878939141d2fba 100644 --- a/hspace.hs +++ b/hspace.hs @@ -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