Data Parallel Haskell on Kubuntu 8.04 uses too much memory
Hey.
I tried to perform some tests on the performance of data parallel haskell today using the program from the DPH-wiki:
{-# OPTIONS -fparr -fglasgow-exts #-}
module Main
where
import GHC.PArr
dotp :: Num a => [:a:] -> [:a:] -> a
dotp xs ys = sumP [:x*y | x <- xs | y <- ys:]
main = putStrLn $ show $ dotp [:1..500000:] [:5..4999995:]
After compiling this with -threaded and running it, the memory usage starts to increase up until the point that the machine starts swapping. On a machine with 2GiB of memory, this hardly seems to be normal behaviour, especially since a program like this should presumably take up maximally 3*the size of the vectors used, which would translate to 3*500.000*32 bit = 6MiB. So this seems like a bug.
I tried it with the GHC 6.8.2 that is in the kubuntu repositories and with the GHC 6.8.3 binaries distributed on the GHC website. Both showed the same behaviour. Also, the behaviour does not seem to depend on the usage of +RTS -N2, as both with and without these flags the memory gets filled.
Additionally, I remember having similar problems when trying out parMap_ on an example, but I can't seem to find the example right now.
Hopefully this gets fixed (or maybe already is), so I can start using the power of DPH to optimise some of my programs.
Trac metadata
Trac field | Value |
---|---|
Version | 6.8.3 |
Type | Bug |
TypeOfFailure | OtherFailure |
Priority | normal |
Resolution | Unresolved |
Component | Compiler |
Test case | |
Differential revisions | |
BlockedBy | |
Related | |
Blocking | |
CC | |
Operating system | |
Architecture |