diff --git a/src/Cluster.hs b/src/Cluster.hs index 753b6e11c99ddac0b73c8e3e72bfe9ca9117005c..e7deb2899303ffc862539a4242cc6ba26ccf7074 100644 --- a/src/Cluster.hs +++ b/src/Cluster.hs @@ -565,7 +565,9 @@ printNodes :: [(Int, String)] -> NodeList -> String printNodes ktn nl = let snl = sortBy (compare `on` Node.idx) (Container.elems nl) snl' = map (\ n -> ((fromJust $ lookup (Node.idx n) ktn), n)) snl - in unlines $ map (uncurry Node.list) snl' + m_name = maximum . (map length) . fst . unzip $ snl' + helper = Node.list m_name + in unlines $ map (uncurry helper) snl' -- | Compute the mem and disk covariance. compDetailedCV :: NodeList -> (Double, Double) diff --git a/src/Node.hs b/src/Node.hs index 0312ccfd42dd6ac762797b4766fb2afec0212c16..2d128a40a5fa95f00f07823caa0ce3e98603a741 100644 --- a/src/Node.hs +++ b/src/Node.hs @@ -197,18 +197,16 @@ str t = (commaJoin (map show (slist t))) -- | String converter for the node list functionality. -list :: String -> Node -> String -list n t = +list :: Int -> String -> Node -> String +list mname n t = let pl = plist t sl = slist t mp = p_mem t dp = p_dsk t fn = failN1 t in - printf " %c %s(%d)\t%5d\t%5d\t%3d\t%3d\t%s\t%s\t%.5f\t%.5f" + printf " %c %-*s %5d %5d %3d %3d %.5f %.5f" (if fn then '*' else ' ') - n (idx t) (f_mem t) ((f_dsk t) `div` 1024) + mname n (f_mem t) ((f_dsk t) `div` 1024) (length pl) (length sl) - (commaJoin (map show pl)) - (commaJoin (map show sl)) mp dp