[Haskell-beginners] I get no speedup with RWH examples of parallel sorting

David Place d at vidplace.com
Wed Jul 6 17:43:27 CEST 2011


My experience with running parallel programs on dual processor machines is similar.  With only two processors, one is always busy doing something for the OS.  As a result, it rarely gets scheduled.   You need a quad cpu to play with parallel programming.


____________________
David Place   
Owner, Panpipes Ho! LLC
http://panpipesho.com
d at vidplace.com



On Jul 6, 2011, at 11:08 AM, Kees Bleijenberg wrote:

> I've carefully followed the instructions in Real World Haskell for parallel sorting:
> In SortMain.hs
> 1. Set testfunction=sort
> Then del *.o  (force recompilation)
> ghc --make -O2 sortMain.hs
> run SortMain and I get 500000 numbers  => 3.9735 sec.
>  
> 2. Set testFunction = parSort2 2
> del *.o
> ghc -threaded --make -O2 sortMain.hs
> run SortMain +RTS -N2 -RTS,  I get =>  5.3 sec
> run SortMain +RTS -N1 -RTS,  I get =>  4.3 sec
> With the +RTS -s option I get 3 SPARK3 (3 converted, 0 pruned)
> All other testFunctions are worse.
>  
> I have a dual core computer that runs Windows XP.
> I've experimented a lot with par, pseq ... in other programs. I almost always get a few hundred sparks. Half of them are converted and the other half gets pruned. But I never got a faster program (then sequential).
>  
> What am I doing wrong, any ideas?
>  
> Kees
>  
>  
> _______________________________________________
> Beginners mailing list
> Beginners at haskell.org
> http://www.haskell.org/mailman/listinfo/beginners

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/beginners/attachments/20110706/318e2491/attachment.htm>


More information about the Beginners mailing list