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

Print partition size while refining

parent 1f8b6e79
......@@ -24,7 +24,7 @@ import Control.Monad.ST
import Control.Monad.ST.Unsafe (unsafeSTToIO)
import Data.Maybe (maybeToList)
import Data.STRef
import System.IO.Unsafe (unsafeDupablePerformIO)
import System.IO.Unsafe (unsafeDupablePerformIO, unsafePerformIO)
import Data.Ord (comparing)
import Control.Monad.Extra (unlessM, whenM)
......@@ -45,11 +45,17 @@ import Copar.RefinementInterface (RefinementInterface, F3)
import qualified Copar.RefinementInterface as RI
import Copar.Algorithm.Types
import Debug.Trace
import System.CPUTime
type SplitM s f = ReaderT (AlgoState s f, BlockQueue s) (ST s)
split :: RefinementInterface f => Block -> SplitM s f ()
split blockS = do
(as, _) <- ask
let !time = unsafePerformIO getCPUTime
size <- lift (Partition.numBlocks (partition as))
traceM $ show time <> " " <> show size
touchedBlocks <- collectTouchedBlocks blockS
forM_ touchedBlocks $ \(b, v0) -> do
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