Personal tools

Parallel GHC Project

From HaskellWiki

(Difference between revisions)
Jump to: navigation, search
m (Cloud Haskell)
(RNG results: oops, wrong numbers)
Line 15: Line 15:
== Project News ==
== Project News ==
=== RNG results ===
Following up on our work implementing the [ Lagged Fibonacci] random number
generator, switching to our LFG implementation has improved overall
performance by a factor of 2 over System.Random. We are currently
working to get more of our expected improvements from this switch.
=== ThreadScope and friends ===
=== ThreadScope and friends ===

Revision as of 15:35, 18 November 2011


1 Overview

The Parallel GHC Project is an MSR-funded project to push the real-world use of parallel Haskell. The aim is to demonstrate that parallel Haskell can be employed successfully in industrial projects.

In the last few years GHC has gained impressive support for parallel programming on commodity multi-core systems. In addition to traditional threads and shared variables, it supports pure parallelism, software transactional memory (STM), and data parallelism. With much of this research and development complete, the next stage is to get the technology into more widespread use.

This project aims to do the engineering work to solve whatever remaining practical problems are blocking organisations from making serious use of parallelism with GHC. The driving force is the applications rather than the technology.

The project involves a partnership with six groups from commercial and scientific organisations. Over the course of two years these groups are applying parallel Haskell in their specific domains. They are being supported by GHC HQ and Well-Typed who are providing advice on Haskell tools and techniques, and applying engineering effort to resolve any issues that are hindering these groups' progress.

The project is being coordinated by Well-Typed and they are providing the bulk of the support and engineering effort. The project started in the summer of 2010.

2 Project News

2.1 ThreadScope and friends

We've been polishing the upcoming ThreadScope release containing the features we demonstrated at the Haskell Implementor's Workshop in September 2011. Recently we have greatly refined the spark histogram feature, tuning the visualisations so that they are easier to understand.

We are continuing to improve the backend tools that make ThreadScope possible.

First, we have improved the ghc-events package by encoding the meanings of events in state machines. This makes it possible to validate eventlogs, and doubles as an always up-to-date source of code as documentation.

Second, we have extended the GHC RTS to emit the startup wall-clock time and Haskell threads labels to the eventlog. The wall-clock time event allows us to synchronise logs for simultaneous processes, brining us a step closer to using ThreadScope on distributed programs. Named Haskell thread make it easier to distinguish threads from each other.

Along the way, we have made a general UI improvement to the RTS, relaxing the -rtsopts requirement so that commonly used RTS options can be used without it. This flag was originally implemented to counter security problems for CGI or setuid programs; however, it was also a hassle for users because enabling common options like -eventlog, -N or -prof would require (re)compiling with -rtsopts. The GHC 7.4 RTS will make a better tradeoff between security and convenience, allowing a common set of benign flags without needing -rtsopts.

2.2 Cloud Haskell

We have been exploring the use of Cloud Haskell for high performance computing on clusters. To do this we would need to abstract Cloud Haskell over different transport mechanisms, that is to develop a robust Cloud Haskell implementation sitting on top of a swappable transport layer. We have posted an initial design for this layer on the parallel-haskell list.

We have taken the substantial feedback into consideration and will be sending a revised design and recording it in a page on the GHC wiki.

Meanwhile, we are working to further validate our design on simple models of both the transport layer and a cloud Haskell layer on top. Longer term, we aim to implement some transports, an IP transport in particular and perhaps a single-node multi-process transport using forks and pipes.

2.3 Partner news

Our project partners having been working in various areas.

  • Toni from Telefonica have been attempting to parallelise the Bron-Kerbosch (BK) algorithm for the enumeration of maximal cliques in a graph.
  • Kazu from the IIJ has just finished a reverse proxy server for mighttpd2 and is finalising it for release on hackage.
  • Tim from LANL has been working to squeeze more performance from simulations already implemented.
  • Finlay from Dragonfly has been experimenting with various parallelism appropachs, Repa vs. the Eval and Par monads.

3 Project artefacts

Some of the work by our project partners is available to the public

Project Partner Description Status
mightttpd2 IIJ File/CGI server on top of Warp version 2.3.3 released 2011−08−29
webserver IIJ HTTP server library version 0.4.5 released 2011−08−31
wai-app-file-cgi IIJ File/CGI WAI application (used by Mighttpd) version 0.3.3 released 2011−08−29
wai-logger IIJ Logging system for WAI (used by Mighttpd) version 0.0.2 released 2011−08−29
http-date IIJ Fast parser and formatter for HTTP Date version 0.0.0 released 2011−05-25
dns IIJ DNS library version 0.2.0 released 2011−08−31
iproute IIJ IP routing table version 1.2.2 released 2011−08−31
domain-auth IIJ Library for Sender Policy Framework, SenderID, DomainKeys and DKIM. version 0.2.0 released 2011−08-31
RPF IIJ Receiver Policy Framework (milter) version 0.2.0 released 2011−08-31

In addition to helping the participating organisations, the project will whenever possible make improvements to libraries and tools that are useful to Haskell users more generally.

Project Description Status
multiprocess Threadscope profiling of multi-process or distributed Haskell systems such as client/server or MPI programs. in progress
LFG Haskell implementation of some pseudo random number generators from the SPRNG library testing
SPRNG binding Haskell wrapper around SPRNG in progress
ThreadScope improvements new spark profiling visualisation, bookmarks, GUI enhancements, bug fixes version 0.2.0 released 2011−09−05
ghc-events improvements spark events support version released 2011−09−05
gtk2hs maintenance & release GHC 7.2 support prerelease
Haskell-MPI Haskell bindings to C MPI library version 1.0 released 2010-12-09
GHC RTS improvements  #4449 - GHC 7 can't do IO when daemonized fixed in 7.0.x branch
 #4504 - "awaitSignal Nothing" does not block thread with -threaded fixed in 7.0.2
 #4512 - EventLog does not play well with forkProcess fixed in 7.0.x branch
 #4514 - IO manager can deadlock if a file descriptor is closed behind its back fixed in 7.0.x branch
 #4854 - Validating on a PPC Mac OS X: Fix miscellaneous errors and warnings fixed in 7.0.x branch
c2hs improvements marshalling functions now can have arguments supplied to them. version 0.16.3 released 2011−03−24

The project will also aim to document existing tools and parallel programming practices, making them accesible to a wider public.

Project Description Status
ThreadScope tutorial a short guide to using ThreadScope to help analyse parallel program performance in progress
submissions to TMR 19 Mighttpd – a High Performance Web Server in Haskell (Kazu Yamamoto) submitted
High Performance Haskell with MPI (Bernie Pope and Dmitry Astapov) submitted
Parallel Haskell Portal one-stop resource oriented for users of parallelism and concurrency in Haskell unveiled 2011−04−20

4 Getting involved

Progress reports will be posted to the parallel Haskell mailing list and to the Well-Typed blog.

The best starting point to get involved is to join the mailing list. Note that the list is for parallel Haskell generally, not just the Parallel GHC Project.

5 Participating organisations

Cloudy Bayes: Hierarchical Bayesian modeling in Haskell
The Cloudy Bayes project aims to develop a fast Bayesian model fitter that takes advantage of modern multiprocessor machines. It will support model descriptions in the BUGS model description language (WinBUGS, OpenBUGS, and JAGS). It will be implemented as an embedded domain specific language (EDSL) within Haskell. A wide range of model hierarchical Bayesian model structures will be possible, including many of the models used in medical, ecological, and biological sciences.
Cloudy Bayes will provide an easy to use interface for describing models, running Monte Carlo Markov chain (MCMC) fitters, diagnosing performance and convergence criteria as it runs, and collecting output for post-processing. Haskell's strong type system will be used to ensure that model descriptions make sense, providing a fast, safe development cycle.
IIJ Innovation Institute Inc.
Haskell is suitable for many kinds of domain, and GHC's support for lightweight threads makes it attractive for concurrency applications. An exception has been network server programming because GHC 6.12 and earlier have an IO manager that is limited to 1024 network sockets. GHC 7 has a new IO manager implementation that gets rid of this limitation.
This project will implement several network servers to demonstrate that Haskell is suitable for network servers that handle a massive number of concurrent connections.
Los Alamos National Laboratory
This project will use parallel Haskell to implement high-performance Monte Carlo algorithms, a class of algorithms which use randomness to sample large or otherwise intractable solution spaces. The initial goal is a particle-based MC algorithm suitable for modeling the flow of radiation, with application to problems in astrophysics. From this, the project is expected to move to identification of suitable abstractions for expressing a wider variety of Monte Carlo algorithms, and using models for different physical phenomena.
Willow Garage Inc.
Distributed Rigid Body Dynamics in ROS
Willow Garage seeks a high-level representation for a distributed rigid body dynamics simulation, capable of excellent parallel speedup on current and foreseeable hardware, yet linking to existing optimized libraries for low-level message passing and matrix math.
This project will drive API, performance, and profiling tool requirements for Haskell's interface to the Message Passing Interface (MPI) specification, an industry-standard in High Performance Computing (HPC), as used on clusters of many nodes.
Competing internal initiatives use C++/MPI and CUDA directly.
Willow Garage aims to lay the groundwork for personal robotics applications in everyday life. ROS (Robot Operating System) is an open source, meta-operating system for your robot.
Telefónica I+D
More details will be available shortly
More details will be available shortly