haskell-mpi: Distributed parallel programming in Haskell using MPI.
MPI is defined by the Message-Passing Interface Standard, as specified by the Message Passing Interface Forum. The latest release of the standard is known as MPI-2. These Haskell bindings are designed to work with any standards compliant implementation of MPI-2. Examples are MPICH2: http://www.mcs.anl.gov/research/projects/mpich2 and OpenMPI: http://www.open-mpi.org.
In addition to reading these documents, users may also find it beneficial to consult the MPI-2 standard documentation provided by the MPI Forum: http://www.mpi-forum.org, and also the documentation for the MPI implementation linked to this library (that is, the MPI implementation that was chosen when this Haskell library was compiled).
Control.Parallel.MPI.Fast contains a high-performance interface for working with (possibly mutable) arrays of storable Haskell data types.
Control.Parallel.MPI.Simple contains a convenient (but slower) interface for sending arbitrary serializable Haskell data values as messages.
Control.Parallel.MPI.Internal contains a direct binding to the C interface.
Control.Parallel.MPI.Base contains essential MPI functionality which is independent of the message passing API. This is re-exported by the Fast and Simple modules, and usually does not need to be explcitly imported itself.
Notable differences between Haskell-MPI and the standard C interface to MPI:
Some collective message passing operations are split into send and receive parts to facilitate a more idiomatic Haskell style of programming. For example, C provides the
MPI_Gather
function which is called by all processes participating in the communication, whereas Haskell-MPI providesgatherSend
andgatherRecv
which are called by the sending and receiving processes respectively.The order of arguments for some functions is changed to allow for the most common patterns of partial function application.
Errors are raised as exceptions rather than return codes (assuming that the error handler to
errorsThrowExceptions
, otherwise errors will terminate the computation just like C interface).
Below is a small but complete MPI program. Process 1 sends the message
"Hello World"
to process 0, which in turn receives the message and
prints it to standard output. All other processes, if there are any,
do nothing.
module Main where import Control.Parallel.MPI.Simple (mpiWorld, commWorld, unitTag, send, recv) main :: IO () main = mpiWorld $ \size rank -> if size < 2 then putStrLn "At least two processes are needed" else case rank of 0 -> do (msg, _status) <- recv commWorld 1 unitTag putStrLn msg 1 -> send commWorld 0 unitTag "Hello World" _ -> return ()
[Skip to Readme]
Modules
- Control
- Parallel
- MPI
- Control.Parallel.MPI.Base
- Control.Parallel.MPI.Fast
- Control.Parallel.MPI.Internal
- Control.Parallel.MPI.Simple
- MPI
- Parallel
Flags
Automatic Flags
Name | Description | Default |
---|---|---|
test | Build testsuite and code coverage tests | Disabled |
mpich14 | Link with extra libraries for MPICH 1.4 | Disabled |
Use -f <flag> to enable a flag, or -f -<flag> to disable that flag. More info
Downloads
- haskell-mpi-1.4.0.tar.gz [browse] (Cabal source package)
- Package description (as included in the package)
Maintainer's Corner
For package maintainers and hackage trustees
Candidates
- No Candidates
Versions [RSS] | 0.5.0, 1.0.0, 1.1.0, 1.2.0, 1.2.1, 1.4.0 |
---|---|
Dependencies | array, base (>3 && <=5), bytestring, cereal, extensible-exceptions, hpc, HUnit, process, testrunner, unix [details] |
Tested with | ghc ==6.10.4, ghc ==6.12.1, ghc ==7.4.1 |
License | BSD-3-Clause |
Copyright | (c) 2010-2015 Bernard James Pope, Dmitry Astapov, Abhishek Kulkarni, Andres Löh, Ian Ross |
Author | Bernard James Pope (Bernie Pope) |
Maintainer | florbitous@gmail.com |
Category | FFI, Distributed Computing |
Home page | http://github.com/bjpop/haskell-mpi |
Source repo | head: git clone git://github.com/bjpop/haskell-mpi.git |
Uploaded | by BerniePope at 2015-02-08T23:33:15Z |
Distributions | |
Reverse Dependencies | 2 direct, 0 indirect [details] |
Executables | haskell-mpi-comprunclean, haskell-mpi-testsuite |
Downloads | 5283 total (25 in the last 30 days) |
Rating | 2.0 (votes: 1) [estimated by Bayesian average] |
Your Rating | |
Status | Docs not available [build log] All reported builds failed as of 2016-12-11 [all 8 reports] |