GHC/Data Parallel Haskell/GHC.PArr

Convenience without the speed: syntactic sugar for a high-level array library

The following explains how to install and use parallel arrays and array comprehensions to prototype nested data-parallel algorithms in Haskell.

But your programs will only run sequentially! That's what we mean by "convenience without speed"!

Installation

Any compiler in GHC's 6.8 series includes support for parallel arrays. It is invoked by supplying the compiler option -XPArr and importing the module GHC.PArr. Moreover, to use parallel array comprehensions, the compiler option -fglasgow-exts is required.

Caveat: This version of DPH is essentially an initial high-level prototype that we do not support anymore. Feel free to use it to experiment with the array syntax, but please do not expect good performance.

A small example

The following module implements the dot product of two vectors using parallel arrays:

(NB: The :set is needed despite the OPTIONS pragma in DotP.hs, so that you can use array syntax on the interactive command line of GHCi.)

Unfortunately, the current version of Haddock does not grok the special array syntax, so there is no nice HTML version of the interface of GHC.PArr. Instead, please consult the source code of GHC.PArr for details on the supplied array operations.