move more tests around
authorBen Lippmeier <benl@ouroborus.net>
Fri, 3 Dec 2010 03:09:57 +0000 (03:09 +0000)
committerBen Lippmeier <benl@ouroborus.net>
Fri, 3 Dec 2010 03:09:57 +0000 (03:09 +0000)
dph-buildbot/src/Benchmarks.hs
dph-examples/imaginary/DotProduct/DotProductVector.hs [new file with mode: 0644]
dph-examples/imaginary/DotProduct/DotProductVectorised.hs [moved from dph-examples/imaginary/DotProduct/DotProductVect.hs with 89% similarity]
dph-examples/imaginary/DotProduct/Main.hs

index 7a86091..e38768b 100644 (file)
@@ -13,12 +13,12 @@ benchmarksDPH config
        -- dot product --------------------------------------------------------
  =       (let  run n   = bench config
                                ("dph.dotp.vectorised.par.N" ++ show n)
-                               ("dph-examples/dist/build/dph-dotp/dph-dotp dph 10000000 +RTS -N" ++ show n)
+                               ("dph-examples/dist/build/dph-dotp/dph-dotp vectorised 10000000 +RTS -N" ++ show n)
           in   map run [1, 2, 4, 8])
        
  ++    [ bench config
                "dph.dotp.vectorised.seq.N4"
-               "dph-examples/dist/build/dph-dotp-seq/dph-dotp-seq dph 10000000 +RTS -N4"               
+               "dph-examples/dist/build/dph-dotp-seq/dph-dotp-seq vectorised 10000000 +RTS -N4"                
 
        , bench config
                "dph.dotp.vector.seq.N4"
@@ -28,12 +28,12 @@ benchmarksDPH config
          -- sum of squares ---------------------------------------------------
  ++    (let    run n   = bench config
                                ("dph.sumsq.vectorised.par.N" ++ show n)
-                               ("dph-examples/dist/build/dph-sumsq/dph-sumsq dph 100000000 +RTS -N" ++ show n)
+                               ("dph-examples/dist/build/dph-sumsq/dph-sumsq vectorised 100000000 +RTS -N" ++ show n)
         in     map run [1, 2, 4, 8])
 
  ++    [ bench config
                "dph.sumsq.vectorised.seq.N4"
-               "dph-examples/dist/build/dph-sumsq-seq/dph-sumsq-seq dph 100000000 +RTS -N4"
+               "dph-examples/dist/build/dph-sumsq-seq/dph-sumsq-seq vectorised 100000000 +RTS -N4"
 
        , bench config
                "dph.sumsq.vector.seq.N4"
@@ -43,12 +43,16 @@ benchmarksDPH config
          -- evens ------------------------------------------------------------
  ++    (let    run n   = bench config
                                ("dph.evens.vectorised.par.N" ++ show n)
-                               ("dph-examples/dist/build/dph-evens/dph-evens 10000000 +RTS -N" ++ show n)
+                               ("dph-examples/dist/build/dph-evens/dph-evens vectorised 10000000 +RTS -N" ++ show n)
         in     map run [1, 2, 4, 8])
 
  ++    [ bench config
                "dph.evens.vectorised.seq.N4"
-               "dph-examples/dist/build/dph-evens-seq/dph-evens-seq 10000000 +RTS -N4" ]
+               "dph-examples/dist/build/dph-evens-seq/dph-evens-seq vectorised 10000000 +RTS -N4"
+       
+       , bench config
+               "dph.evens.vector.seq.N4"
+               "dph-examples/dist/build/dph-evens-seq/dph-evens-seq vector 10000000 +RTS -N4" ]
        
 
          -- quicksort --------------------------------------------------------
@@ -88,21 +92,22 @@ benchmarksDPH config
        , benchUp config
                "dph.quickhull.c.seq"
                (inDir "dph-examples/spectral/QuickHull/c" $ qssystem "make")
-               "dph-examples/spectral/QuickHull/c/quickhull 1000000"
+               "dph-examples/spectral/QuickHull/c/quickhull 1000000" ]
                
-         -- nbody
-{-     , bench config
-               "dph.nbody.vectorised.par.N4"
-               "dph-examples/dist/build/dph-nbody/dph-nbody --max-steps 100 -b 100 -s nested-bh +RTS -N4"
-
-       , bench config
+         -- nbody ------------------------------------------------------------
+ ++    (let    run n   = bench config
+                               ("dph.nbody.vectorised.par.N" ++ show n)
+                               ("dph-examples/dist/build/dph-nbody/dph-nbody --max-steps 10 -b 100 -s nested-bh +RTS -N" ++ show n)
+                               
+        in     map run [1, 2, 4])
+       
+ ++    [ bench config
                "dph.nbody.vectorised.seq.N4"
-               "dph-examples/dist/build/dph-nbody/dph-nbody --max-steps 100 -b 100 -s nested-bh +RTS -N4"
+               "dph-examples/dist/build/dph-nbody/dph-nbody --max-steps 10 -b 100 -s nested-bh +RTS -N4"
 
        , bench config
                "dph.nbody.vector.seq.N4"
-               "dph-examples/dist/build/dph-nbody/dph-nbody --max-steps 100 -b 100 -s vector-bh +RTS -N4"
--}
+               "dph-examples/dist/build/dph-nbody/dph-nbody --max-steps 10 -b 100 -s vector-bh +RTS -N4"
        ]
 
 
diff --git a/dph-examples/imaginary/DotProduct/DotProductVector.hs b/dph-examples/imaginary/DotProduct/DotProductVector.hs
new file mode 100644 (file)
index 0000000..55f5c6f
--- /dev/null
@@ -0,0 +1,7 @@
+
+module DotProductVector (dotV) where
+import Data.Vector.Unboxed             (Vector)
+import qualified Data.Vector.Unboxed   as V
+
+dotV :: Vector Double -> Vector Double -> Double
+dotV vec1 vec2 = V.sum $ V.zipWith (*) vec1 vec2
\ No newline at end of file
@@ -1,6 +1,6 @@
 {-# LANGUAGE ParallelArrays #-}
 {-# OPTIONS -fvectorise #-}
-module DotProductVect ( dotPA ) where
+module DotProductVectorised ( dotPA ) where
 
 import Data.Array.Parallel.Prelude
 import Data.Array.Parallel.Prelude.Double as D
index e5837aa..5cae36c 100644 (file)
@@ -1,13 +1,12 @@
 
-import DotProductVect
 import Timing
 import Randomish
 import System.Environment
-import Data.Vector.Unboxed             (Vector)
 import Data.Array.Parallel.Prelude     as P
 import Data.Array.Parallel.PArray      as P
 import qualified Data.Vector.Unboxed   as V
-
+import qualified DotProductVector      as V
+import qualified DotProductVectorised  as Z
 
 main :: IO ()
 main 
@@ -15,6 +14,11 @@ main
        case args of
          [alg, len]    -> run alg (read len) 
          _             -> usage
+
+usage
+ = putStr $ unlines
+       [ "usage: dotp <alg> <length>"
+       , "  alg one of " ++ show ["vectorised", "vector"] ]
        
 run alg len
  = do  let vec1 = randomishDoubles len 0 1 1234
@@ -25,22 +29,17 @@ run alg len
        putStr  $ prettyTime tElapsed
        putStr  $ (take 12 $ show result) ++ "\n"
 
-runAlg "dph" vec1 vec2 
+runAlg "vectorised" vec1 vec2 
  = do  let arr1 = fromUArrPA' vec1
        let arr2 = fromUArrPA' vec2
        arr1 `seq` arr2 `seq` return ()
 
-       time    $ let result    = dotPA arr1 arr2
+       time    $ let result    = Z.dotPA arr1 arr2
                  in  result `seq` return result
 
 runAlg "vector" vec1 vec2
  = do  vec1 `seq` vec2 `seq` return ()
 
-       time    $ let result    = V.sum $ V.zipWith (*) vec1 vec2
+       time    $ let result    = V.dotV vec1 vec2 
                  in  result `seq` return result
                
-usage
- = putStr $ unlines
-       [ "usage: dotp <alg> <length>"
-       , "  alg one of " ++ show ["dph", "vector"] ]
-