[Haskell-beginners] Re: Parallelizing array-based functions

Ahn, Ki Yung kyagrd at gmail.com
Fri Jul 17 19:25:58 EDT 2009


Jon Harrop wrote:
> If you have a function that mutates the elements of an array in-place and 
> leverages parallelism by recursively subdividing the problem and mutating 
> parts of the array separately, can this be expressed in Haskell?
> 
> In-place quicksort and many of the numerical methods from linear algebra fall 
> into this category.

Most relevant work I know of is DPH:

http://www.haskell.org/haskellwiki/GHC/Data_Parallel_Haskell
http://www.cse.unsw.edu.au/~chak/project/dph/

but this isn't exactly about in-place algorithms.  Although in theory it 
may be possible to optimized as in-place when compiling it down in 
certain situations, I don't think it would enforce that in general.

However, when working with monadic code and mutable arrays one can 
always fork Haskell threads with forkIO or using other similar 
libraries.  This can of course do in-place quicksort kind of things in 
parallel, but I don't think what you've expected is this.

Is there a nice work going on in OCaml or F#?



More information about the Beginners mailing list