tryAlloc nl _ inst 1 =
let all_nodes = getOnline nl
- sols = foldl' (\cstate p ->
- concatAllocs cstate $ allocateOnSingle nl inst p
+ sols = foldl' (\cstate ->
+ concatAllocs cstate . allocateOnSingle nl inst
) ([], 0, Nothing) all_nodes
in return sols
-- | Builds the cluster data from an URL.
loadData :: String -- ^ Unix socket to use as source
-> IO (Result (Node.AssocList, Instance.AssocList))
-loadData master = do -- IO monad
+loadData master =
E.bracket
(getClient master)
closeClient
let ini_cv = Cluster.compCV nl
ini_stats = Cluster.totalResources nl
- when (verbose > 2) $ do
+ when (verbose > 2) $
hPrintf stderr "Initial coefficients: overall %.8f, %s\n"
ini_cv (Cluster.printStats nl)