Commit 36ab9f39 authored by Hans-Peter Deifel's avatar Hans-Peter Deifel
Browse files

main: Whitespace fixes

parent d4028f66
......@@ -328,14 +328,14 @@ outputPartition (Just file) = writePartition file
main :: IO ()
main = do
termColumns <- flip fmap (lookupEnv "COLUMNS") $ \case
Nothing -> 120
Nothing -> 120
Just val -> min (read val) 120
let optionParserPrefs = prefs (showHelpOnEmpty <> columns termColumns)
params <- customExecParser optionParserPrefs $
info (options <**> helper) fullDesc
params <- customExecParser optionParserPrefs
$ info (options <**> helper) fullDesc
case optCommand params of
(HelpCommand f) -> printHelp f
(HelpCommand f) -> printHelp f
(RefineCommand r) -> do
stats <- initStats (refineStats r) (refineStatsJson r)
......@@ -346,12 +346,13 @@ main = do
then ApplyTransformations
else DontApplyTransformations
readCoalgebra (refineFunctor r) transPolicy (refineInputFile r) >>= \case
Left err -> hPutStrLn stderr err >> exitFailure
Right res -> evaluate $ res
readCoalgebra (refineFunctor r) transPolicy (refineInputFile r)
>>= \case
Left err -> hPutStrLn stderr err >> exitFailure
Right res -> evaluate $ res
logStat stats "states" (tshow (Encoding.size encoding))
logStat stats "edges" (tshow (Encoding.numEdges encoding))
logStat stats "edges" (tshow (Encoding.numEdges encoding))
let isFirstSort x = sortedSort x == 1
logStat
......@@ -360,35 +361,35 @@ main = do
(tshow (length (V.filter isFirstSort (Encoding.structure encoding))))
partition <- case statsType stats of
NoStats -> withTimeStat stats "algorithm-duration" (stToIO (refine f encoding))
NoStats ->
withTimeStat stats "algorithm-duration" (stToIO (refine f encoding))
_ -> do
(part, algoStats) <- withTimeStat stats "algorithm-duration" $
(refineWithStats f encoding)
logStat
stats
"initial-partition-size"
(tshow (initialBlocks algoStats))
logStat stats "initialize-duration"
(showTimeDiff (initTime algoStats))
logStat
stats
"split-operation-count"
(tshow (splitCount algoStats))
logStat stats "refine-duration"
(showTimeDiff (refineTime algoStats))
(part, algoStats) <-
withTimeStat stats "algorithm-duration"
$ (refineWithStats f encoding)
logStat stats
"initial-partition-size"
(tshow (initialBlocks algoStats))
logStat stats
"initialize-duration"
(showTimeDiff (initTime algoStats))
logStat stats "split-operation-count" (tshow (splitCount algoStats))
logStat stats
"refine-duration"
(showTimeDiff (refineTime algoStats))
return part
logStat
stats
"final-partition-size"
(tshow (Partition.numBlocks partition))
logStat stats
"final-partition-size"
(tshow (Partition.numBlocks partition))
logStat
stats
"explicit-final-partition-size"
(tshow (length (restrictPartitionToSort1 encoding partition)))
logStat stats
"explicit-final-partition-size"
(tshow (length (restrictPartitionToSort1 encoding partition)))
withTimeStat stats "output-duration"
withTimeStat
stats
"output-duration"
(outputPartition (refineOutputFile r) encoding symbolTable partition)
finalizeStats stats
......@@ -400,27 +401,25 @@ main = do
else DontApplyTransformations
readCoalgebra (graphFunctor r) transPolicy (graphInputFile r) >>= \case
Left err -> hPutStrLn stderr err >> exitFailure
Left err -> hPutStrLn stderr err >> exitFailure
Right res -> evaluate $ res
part <-
if graphDrawPartition r
then (Just <$> stToIO (refine f encoding))
else return Nothing
part <- if graphDrawPartition r
then (Just <$> stToIO (refine f encoding))
else return Nothing
let config = DotConfig
{ nodeLabels = graphDrawNodeLabels r
, edgeLabels = graphDrawEdgeLabels r
}
let config = DotConfig { nodeLabels = graphDrawNodeLabels r
, edgeLabels = graphDrawEdgeLabels r
}
case graphOutputFile r of
Nothing -> printDot config symbolTable encoding part
Just "-" -> printDot config symbolTable encoding part
Nothing -> printDot config symbolTable encoding part
Just "-" -> printDot config symbolTable encoding part
Just file -> writeDot file config symbolTable encoding part
DebugCommand (DebugFunctor applyTrans f)
| applyTrans -> pPrint (applyFunctorRewrites f)
| otherwise -> pPrint f
| otherwise -> pPrint f
printHelp :: HelpCommand -> IO ()
......
Supports Markdown
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