forked from bjpop/haskell-mpi
-
Notifications
You must be signed in to change notification settings - Fork 1
/
haskell-mpi.cabal
180 lines (173 loc) · 6.2 KB
/
haskell-mpi.cabal
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
name: haskell-mpi
version: 1.3.0
cabal-version: >= 1.6
synopsis: Distributed parallel programming in Haskell using MPI.
description:
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:
.
1. 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 provides 'gatherSend' and 'gatherRecv' which are called
by the sending and receiving processes respectively.
.
2. The order of arguments for some functions is changed to allow
for the most common patterns of partial function application.
.
3. 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 ()
category: FFI, Distributed Computing
license: BSD3
license-file: LICENSE
copyright: (c) 2010, 2011, 2012 Bernard James Pope, Dmitry Astapov, Abhishek Kulkarni, Andres Löh
author: Bernard James Pope (Bernie Pope)
maintainer: [email protected]
homepage: http://github.com/bjpop/haskell-mpi
build-type: Simple
stability: experimental
tested-with: GHC==6.10.4, GHC==6.12.1
extra-source-files: src/cbits/*.c src/include/*.h README.txt
test/examples/clientserver/*.c
test/examples/clientserver/*.hs
test/examples/HaskellAndC/Makefile
test/examples/HaskellAndC/*.c
test/examples/HaskellAndC/*.hs
test/examples/PiByIntegration/*.hs
test/examples/PiByIntegration/*.test
test/examples/simple/*.hs
test/examples/simple/*.test
test/examples/speed/*.hs
test/examples/speed/simple-api/*.hs
source-repository head
type: git
location: git://github.com/bjpop/haskell-mpi.git
flag test
description: Build testsuite and code coverage tests
default: False
flag mpich14
description: Link with extra libraries for MPICH 1.4
default: False
Library
if flag(mpich14)
extra-libraries: mpich, opa, mpl
else
extra-libraries: mpi, open-rte, open-pal
build-tools: c2hs
ghc-options: -O2 -Wall -fno-warn-name-shadowing -fno-warn-orphans
c-sources:
src/cbits/init_wrapper.c,
src/cbits/constants.c
include-dirs:
src/include
hs-source-dirs:
src
build-depends:
base > 3 && <= 5,
bytestring,
cereal,
extensible-exceptions,
array
exposed-modules:
Control.Parallel.MPI.Base,
Control.Parallel.MPI.Internal,
Control.Parallel.MPI.Fast,
Control.Parallel.MPI.Simple
other-modules:
C2HS,
Control.Parallel.MPI.Utils
executable haskell-mpi-testsuite
hs-source-dirs:
./test
./src
build-tools: c2hs
if flag(mpich14)
extra-libraries: mpich, opa, mpl
else
extra-libraries: mpi, open-rte, open-pal
ghc-options: -Wall -fno-warn-name-shadowing -fno-warn-orphans
c-sources:
src/cbits/init_wrapper.c,
src/cbits/constants.c
include-dirs:
src/include
other-modules:
Control.Parallel.MPI.Base,
Control.Parallel.MPI.Internal,
Control.Parallel.MPI.Fast,
Control.Parallel.MPI.Simple,
Control.Parallel.MPI.Utils,
C2HS,
IOArrayTests,
SimpleTests,
FastAndSimpleTests,
StorableArrayTests,
GroupTests,
PrimTypeTests,
ExceptionTests,
OtherTests,
TestHelpers
main-is: Testsuite.hs
if flag(test)
ghc-options: -fhpc
build-depends: base >=3 && <=5, HUnit, testrunner, hpc, unix
else
buildable: False
executable haskell-mpi-comprunclean
hs-source-dirs:
./test
ghc-options: -Wall -fno-warn-name-shadowing -fno-warn-orphans
other-modules:
main-is: CompileRunClean.hs
if flag(test)
build-depends: base >=3 && <=5, process
else
buildable: False