[Haskell-cafe] Haskell Paralellism

Dominik Luecke luecke at informatik.uni-bremen.de
Thu Oct 25 05:36:37 EDT 2007


Hello,

I am trying to use the code 

rels list = 
    let 
        o1 = (map makeCompEntry) $ head $ splitList list
        o2 = (map makeCompEntry) $ head $ tail $ splitList list
        o3 = (map makeCompEntry) $ head $ tail $ tail $ splitList list
    in
      case (head $ tail $ tail $ tail $ splitList list) of
        [] -> o1 `par` o2 `par` o3 `seq` o1 : o2 : o3 : []
        _  -> 
            let o4 = rels (head $ tail $ tail $ tail $ splitList list)
            in
              o1 `par` o2 `par` o3 `par` o4 `seq` 
              o1 : o2 : o3 : o4

to apply some operation on some lists in parallel. The input list "list"
is quite long (about 10^17) entries, and I split it into chunks of 1000
entries each. I am compiling with the options " -O2 --make -smp
-threaded" and when running the file with "+RTS -N2 -sstderr -RTS", I
see that only one worker thread is really doing anything. I am using a
vanilla build of ghc-6.6.1 running on Ubuntu 7.10. I am currently
wondering about what I am doing wrong.

Regards, 
 Dominik

-- 
Dominik Luecke                 Phone +49-421-218-64265
Dept. of Computer Science      Fax   +49-421-218-9864265
University of Bremen           luecke at informatik.uni-bremen.de           
P.O.Box 330440, D-28334 Bremen
PGP-Key ID 0x2D82571B



More information about the Haskell-Cafe mailing list