, oPrintInsts
, oPrintCommands
, oOneline
- , oNodeFile
- , oInstFile
+ , oDataFile
+ , oEvacMode
, oRapiMaster
, oLuxiSocket
, oExecJobs
, oMinDisk
, oDiskMoves
, oDynuFile
+ , oExTags
+ , oExInst
, oShowVer
, oShowHelp
]
-> [MoveJob] -- ^ Current command list
-> Bool -- ^ Whether to be silent
-> Score -- ^ Score at which to stop
+ -> Bool -- ^ Enable evacuation mode
-> IO (Cluster.Table, [MoveJob]) -- ^ The resulting table
-- and commands
iterateDepth ini_tbl max_rounds disk_moves nmlen imlen
- cmd_strs oneline min_score =
+ cmd_strs oneline min_score evac_mode =
let Cluster.Table ini_nl ini_il _ _ = ini_tbl
- m_fin_tbl = Cluster.tryBalance ini_tbl max_rounds disk_moves min_score
+ allowed_next = Cluster.doNextBalance ini_tbl max_rounds min_score
+ m_fin_tbl = if allowed_next
+ then Cluster.tryBalance ini_tbl disk_moves evac_mode
+ else Nothing
in
case m_fin_tbl of
Just fin_tbl ->
hFlush stdout
iterateDepth fin_tbl max_rounds disk_moves
nmlen imlen upd_cmd_strs oneline min_score
+ evac_mode
Nothing -> return (ini_tbl, cmd_strs)
-- | Formats the solution for the oneline display
verbose = optVerbose opts
shownodes = optShowNodes opts
- (fixed_nl, il, csf) <- loadExternalData opts
+ (fixed_nl, il, ctags, csf) <- loadExternalData opts
let offline_names = optOffline opts
all_nodes = Container.elems fixed_nl
nl = Container.map (flip Node.setMdsk m_dsk . flip Node.setMcpu m_cpu)
nm
+ when (not oneline && verbose > 1) $
+ putStrLn $ "Loaded cluster tags: " ++ intercalate "," ctags
+
when (Container.size il == 0) $ do
(if oneline then putStrLn $ formatOneline 0 0 0
else printf "Cluster is empty, exiting.\n")
(fin_tbl, cmd_strs) <- iterateDepth ini_tbl (optMaxLength opts)
(optDiskMoves opts)
- nmlen imlen [] oneline min_cv
+ nmlen imlen [] oneline min_cv (optEvacMode opts)
let (Cluster.Table fin_nl fin_il fin_cv fin_plc) = fin_tbl
ord_plc = reverse fin_plc
sol_msg = if null fin_plc