Glasgow Parallel Haskell |
|
Language ConstructsGpH is a modest conservative extension of Haskell realising thread-based semi-explicit parallelism. It provides a single primitive to create a thread, but thereafter threads are automatically managed by a sophisticated runtime system. Evaluation strategies combine simple thread primitives with higher-order functions to provide high-level coordination abstractions. Primitives
GpH provides parallel
On the most basic level, these two primitives are all that's needed to parallelise code. Here is the simplest possible example, Fibonacci numbers:
The annotation overhead is moderate compared to the sequential
version: just one Eval Monad
Beyond
The
Rewriting the Fibonacci example using the
Strategies
The idea that parallel coordination should be expressed
by monadic identity functions like
Strategies provide a clean separation between coordination
and computation via the
Combining Strategies
Because strategies are simply functions they can be
passed as parameters, or combined using standard language
constructs.
Composition of strategies can be expressed using the
A simple higher-order strategy is
Finally, the higher-order strategy
Skeletons
Skeletons are parametrized pieces of code that coordinate
the parallel computation of their parameters,
i.e. skeletons are simply higher-order functions implementing
patterns of parallelism, thereby separating algorithm from strategy.
Some skeletons can be conveniently implemented by combining
the algorithm with an appropriate strategy for the underlying
data structure.
For instance, a parallel map skeleton
|
This site is maintained by gph-www@macs.hw.ac.uk. Please email comments, questions and reports of any problems to do with the site. |