Commit b8a2c0ab authored by Iustin Pop's avatar Iustin Pop

Add an allocation limit to hspace

This is very useful for testing/benchmarking.
Signed-off-by: default avatarIustin Pop <iustin@google.com>
Reviewed-by: default avatarAgata Murawska <agatamurawska@google.com>
parent 1bf6d813
......@@ -298,8 +298,9 @@ oMaxCpu = Option "" ["max-cpu"]
oMaxSolLength :: OptType
oMaxSolLength = Option "l" ["max-length"]
(ReqArg (\ i opts -> Ok opts { optMaxLength = read i }) "N")
"cap the solution at this many moves (useful for very\
\ unbalanced clusters)"
"cap the solution at this many balancing or allocation \
\ rounds (useful for very unbalanced clusters or empty \
\ clusters)"
oMinDisk :: OptType
oMinDisk = Option "" ["min-disk"]
......
......@@ -65,6 +65,7 @@ options =
, oIVcpus
, oMachineReadable
, oMaxCpu
, oMaxSolLength
, oMinDisk
, oTieredSpec
, oSaveCluster
......@@ -427,6 +428,9 @@ main = do
let reqinst = iofspec ispec
alloclimit = if optMaxLength opts == -1
then Nothing
else Just (optMaxLength opts)
allocnodes <- exitifbad $ Cluster.genAllocNodes gl nl req_nodes True
......@@ -438,7 +442,7 @@ main = do
(treason, trl_nl, trl_il, trl_ixes, _) <-
if stop_allocation
then return result_noalloc
else exitifbad (Cluster.tieredAlloc nl il Nothing (iofspec tspec)
else exitifbad (Cluster.tieredAlloc nl il alloclimit (iofspec tspec)
allocnodes [] [])
let spec_map' = tieredSpecMap trl_ixes
treason' = sortReasons treason
......@@ -461,7 +465,7 @@ main = do
(ereason, fin_nl, fin_il, ixes, _) <-
if stop_allocation
then return result_noalloc
else exitifbad (Cluster.iterateAlloc nl il Nothing
else exitifbad (Cluster.iterateAlloc nl il alloclimit
reqinst allocnodes [] [])
let allocs = length ixes
......
......@@ -231,6 +231,11 @@ The options that can be passed to the program are as follows:
number. For example, specifying *disk-ratio* as **0.25** means that
at least one quarter of disk space should be left free on nodes.
-l *rounds*, --max-length=*rounds*
Restrict the number of instance allocations to this length. This is
not very useful in practice, but can be used for testing hspace
itself, or to limit the runtime for very big clusters.
-p, --print-nodes
Prints the before and after node status, in a format designed to allow
the user to understand the node's most important parameters. See the
......
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