[Haskell-beginners] DPH
Daniel Fischer
daniel.is.fischer at web.de
Thu Jun 10 08:09:55 EDT 2010
On Thursday 10 June 2010 13:28:36, Luca Ciciriello wrote:
> Hi All.
>
> I've two question about Data Parallel Haskell.
>
> I'm trying some experiment using DPH and I've wrote a little program
> using the functions lengthP and mapP. I've imported the module GHC.PArr
> and I've informed the compiler that I want to use some language
> extension using the line {-# LANGUAGE PArr #-}. All works fine. Looking
> around I've saw that some code examples use {-# LANGUAGE PArr,
> ParallelListComp #-} instead.
>
Parallel list-comprehensions are something different from parallel arrays.
I think it's not implied by PArr, so if you use both features, you need to
specify both.
>
>
> The my first question is: Which is the difference in using or not the
> extension ParallelListComp? Seems that my program works fine with or
> without this extension (if I omit the extension PArr I've some
> compilation errors).
Then you probably only use parallel arrays and not parallel list-
comprehensions (which are just syntactic sugar for the families of
zip[With]N functions).
>
>
>
> The second question is: Have I to use the option -threaded when compile
> my program?
>
Would make sense. It wouldn't be able to profit from multiple cores
without. Compile with -threaded and run with +RTS -Nk (for a reasonable
value of k on your box).
>
>
> I'm using Haskell Platform (GHC 6.12.1) on MacOS X 10.6.3
>
>
>
> Thanks in advance for any answer.
>
>
>
> Luca.
More information about the Beginners
mailing list