From 77552d080e88fc70312f55fd3303fac3464ab46e Mon Sep 17 00:00:00 2001 From: Alberto Ruiz Date: Wed, 14 Dec 2011 13:08:43 +0100 Subject: new package hmatrix-tests --- examples/parallel.hs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'examples/parallel.hs') diff --git a/examples/parallel.hs b/examples/parallel.hs index 566b729..e875407 100644 --- a/examples/parallel.hs +++ b/examples/parallel.hs @@ -1,4 +1,5 @@ --- $ runhaskell parallel.hs 2000 +-- $ ghc --make -O -rtsopts -threaded parallel.hs +-- $ ./parallel 3000 +RTS -N4 -s -A200M import System.Environment(getArgs) import Numeric.LinearAlgebra @@ -7,7 +8,6 @@ import System.Time inParallel = parMap rwhnf id - -- matrix product decomposed into p parallel subtasks parMul p x y = fromBlocks [ inParallel ( map (x <>) ys ) ] where [ys] = toBlocksEvery (rows y) (cols y `div` p) y @@ -25,3 +25,4 @@ time act = do act t1 <- getClockTime print $ tdSec $ normalizeTimeDiff $ diffClockTimes t1 t0 + -- cgit v1.2.3