[Haskell-beginners] Performance of parallel mergesort

Antoine Latter aslatter at gmail.com
Wed Dec 23 19:22:00 EST 2009


On Thu, Dec 24, 2009 at 12:16 AM, Antoine Latter <aslatter at gmail.com> wrote:
> Hi Jon,
>
> You're more likely to get a useful response over on the
> glasgow-haskell-users mailing list, as it looks like this is a GHC
> specific bug: http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
>
> Running this at -N6 doesn't want to complete for me, so I'm not sure
> if it would segfault. I'm on a 64-bit Intel Mac OS X using GHC 6.12,
> dual core.
>
> With such a small example as this your best bet would be to file a bug report:
>
> http://hackage.haskell.org/trac/ghc/
>
> You'll need to use the login guest/guest to file a new ticket.
>
> Antoine
>

Here's a paste-bin link for the code in question:
http://hpaste.org/fastcgi/hpaste.fcgi/view?id=14871#a14871

> On Wed, Dec 23, 2009 at 9:14 PM, Jon Harrop <jon at ffconsultancy.com> wrote:
>>
>> I took the parallel merge sort described here:
>>
>>  http://martin.sulzmann.googlepages.com/AMP-Spring2008-intro.pdf
>>
>> and added a simple test:
>>
>> main :: IO ()
>> main = do
>>    putStrLn $ show $ sum $ mergesort $ [sin x | x <- [1.0 .. 1000000.0]]
>>
>> Compiled it with GHC 6.8.2 from Debian testing and ran it with various
>> +RTS -N<n> arguments to measure its performance and obtained the following
>> results on an 8 core:
>>
>> $ ghc --make -O2 -threaded mergesort.hs -o mergesort
>> [1 of 1] Compiling Main             ( mergesort.hs, mergesort.o )
>> Linking mergesort ...
>> $ time ./mergesort +RTS -N1
>> -0.117109518058233
>>
>> real    0m9.723s
>> user    0m9.461s
>> sys     0m0.232s
>> $ time ./mergesort +RTS -N2
>> -0.117109518058233
>>
>> real    0m13.574s
>> user    0m15.225s
>> sys     0m0.140s
>> $ time ./mergesort +RTS -N3
>> -0.117109518058233
>>
>> real    0m13.185s
>> user    0m15.529s
>> sys     0m0.184s
>> $ time ./mergesort +RTS -N4
>> -0.117109518058233
>>
>> real    0m13.251s
>> user    0m15.829s
>> sys     0m0.336s
>> $ time ./mergesort +RTS -N5
>> -0.117109518058233
>>
>> real    0m13.093s
>> user    0m16.929s
>> sys     0m0.164s
>> $ time ./mergesort +RTS -N6
>> Segmentation fault
>>
>> real    0m5.711s
>> user    0m7.408s
>> sys     0m0.136s
>>
>> That segfault must be due to a bug in GHC so I thought perhaps a newer version
>> of GHC might fix the segfault but I installed GHC 6.10.4 from Sid and now I
>> get:
>>
>> $ ghc --make -O2 -threaded mergesort.hs -o mergesort
>> Binary: Int64 truncated to fit in 32 bit Int
>> ghc: panic! (the 'impossible' happened)
>>  (GHC version 6.10.4 for i386-unknown-linux):
>>        Prelude.chr: bad argument
>>
>> Please report this as a GHC bug:  http://www.haskell.org/ghc/reportabug
>>
>> I'll try the haskell-platform package next. Are these known problems?
>>
>> --
>> Dr Jon Harrop, Flying Frog Consultancy Ltd.
>> http://www.ffconsultancy.com/?e
>> _______________________________________________
>> Beginners mailing list
>> Beginners at haskell.org
>> http://www.haskell.org/mailman/listinfo/beginners
>>
>


More information about the Beginners mailing list