Commit 0c1df6fd authored by Iustin Pop's avatar Iustin Pop
Browse files

Also print cluster coefficients in hn1

This patch adds printing the initial and final cluster coefficients in
hn1 too, to better understand the found solution.
parent af53a5c4
......@@ -153,6 +153,10 @@ main = do
exitWith $ ExitFailure 2
let ini_cv = Cluster.compCV nl
printf "Initial coefficients: overall %.8f, %s\n"
ini_cv (Cluster.printStats nl)
putStr "Computing solution: depth "
hFlush stdout
......@@ -160,13 +164,23 @@ main = do
(optMinDelta opts) (optMaxDelta opts)
let (min_d, solution) =
case result of
Just (Cluster.Solution a b) -> (a, b)
Just (Cluster.Solution a b) -> (a, reverse b)
Nothing -> (-1, [])
when (min_d == -1) $ do
putStrLn "failed. Try to run with higher depth."
exitWith $ ExitFailure 1
printf "found.\nSolution (delta=%d):\n" $! min_d
printf "found.\n"
ns = Cluster.applySolution nl il solution
fin_cv = Cluster.compCV ns
printf "Final coefficients: overall %.8f, %s\n"
(Cluster.printStats ns)
printf "Solution (delta=%d):\n" $! min_d
let (sol_strs, cmd_strs) = Cluster.printSolution il ktn kti solution
putStr $ unlines $ sol_strs
when (optShowCmds opts) $
......@@ -177,7 +191,6 @@ main = do
when (optShowNodes opts) $
let (orig_mem, orig_disk) = Cluster.totalResources nl
ns = Cluster.applySolution nl il solution
(final_mem, final_disk) = Cluster.totalResources ns
putStrLn ""
putStrLn "Final cluster status:"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment