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

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@haskell.org
http://www.haskell.org/mailman/listinfo/beginners