
27 Nov
2008
27 Nov
'08
6:58 a.m.
On Tue, Nov 25, 2008 at 11:07 PM, Don Stewart
What does the code look like?
It looks like that. Of course it doesn't compute the same number as the initial code, but it starts 3 sparks and I get the expected 100% CPU usage instead of 50%. parSumFibEuler :: Int -> Int -> Int -> Int parSumFibEuler a b c = f `par` (e `par` (g `pseq` (f + e + g))) where f = fib a e = sumEuler b g = sumEuler c r1 :: Int r1 = parSumFibEuler 40 7450 7449 Instead of: parSumFibEuler :: Int -> Int -> Int parSumFibEuler a b = f `par` (e `pseq` (f + e)) where f = fib a e = sumEuler b r1 :: Int r1 = parSumFibEuler 40 7450 Olivier.