#5100: Stack space overflow when using -N2 and not with -N1
--------------------------------+-------------------------------------------
Reporter: mitar | Owner: simonmar
Type: bug | Status: closed
Priority: high | Milestone: 7.2.1
Component: libraries (other) | Version: 7.1
Resolution: fixed | Keywords:
Testcase: | Blockedby:
Difficulty: | Os: Linux
Blocking: | Architecture: x86_64 (amd64)
Failure: None/Unknown |
--------------------------------+-------------------------------------------
Changes (by simonmar):
* status: new => closed
* resolution: => fixed
Comment:
Done, thanks. I did it slightly differently:
{{{
--- a/Control/Parallel/Strategies.hs
+++ b/Control/Parallel/Strategies.hs
@@ -428,9 +428,13 @@ parListNth n strat = evalListNth n (rpar `dot` strat)
-- It is expected that this function will be replaced by a more
-- generic clustering infrastructure in the future.
--
+-- If the chunk size is 1 or less, 'parListChunk' is equivalent to
+-- 'parList'
+--
parListChunk :: Int -> Strategy a -> Strategy [a]
-parListChunk n strat xs =
- concat `fmap` parList (evalList strat) (chunk n xs)
+parListChunk n strat xs
+ | n <= 1 = parList strat xs
+ | otherwise = concat `fmap` parList (evalList strat) (chunk n xs)
chunk :: Int -> [a] -> [[a]]
chunk _ [] = []
}}}
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/5100#comment:5>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs