Data parallelism doesn't seem to work on windows...

Hi,I can't seem to get DPH to work on 6.10.1 on Vista-64. I run the executables with +RTS -N2, and to verify that I'm doing it correctly I checked with a simple benchmark using forkIO and that does indeed use both my cores: -- compiler command line: ghc --make -O2 -threaded parr.hs -- execution command line: parr.exe +RTS -N2 main = do forkIO $ print [ True | n <- [ 1000 .. 3000], fac n == 0 ] forkIO $ print [ True | n <- [ 1000 .. 3000], fac n == 0 ] getLine return () This, on the other hand does not use more than one core: -- compiler command line (from shootout code): ghc --make -fcpr-off -threaded -fdph-par -package dph-base -Odph -XPArr parr2.hs -- execution as before main = print $ [: True | n <- [: 1000 .. 5000 :], fac n == 0 :] That's 4000 items of work there, so surely it should kick off plenty of sparks to overcome the "sparks bug"? -- Sebastian Sylvan +44(0)7857-300802 UIN: 44640862

On 30/11/2008, at 10:43, Sebastian Sylvan wrote:
This, on the other hand does not use more than one core:
-- compiler command line (from shootout code): ghc --make -fcpr-off - threaded -fdph-par -package dph-base -Odph -XPArr parr2.hs -- execution as before main = print $ [: True | n <- [: 1000 .. 5000 :], fac n == 0 :]
Unfortunately, that's not enough to get parallelism. You also need to - fvectorise the computation, i.e., everything that comes after $ (but not print because that can't be vectorised yet). At the moment, this means that you have to split your code in two modules because - fvectorise is a module-wide flag. Please take a look at dph/examples/ dotp to see how this is done. Sorry that this is so inconvenient at the moment but we're working on it! Roman
participants (2)
-
Roman Leshchinskiy
-
Sebastian Sylvan