- Notifications
You must be signed in to change notification settings - Fork12
xavierleroy/ocamlmpi
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
This is OCamlMPI, an OCaml binding to the Message Passing Interface (MPI).
MPI is a popular library for distributed-memory parallel programmingin SPMD (single program, multiple data) style.
MPI offers both point-to-point message passing and group communicationoperations (broadcast, scatter/gather, etc).
Several implementations of MPI are available, both for networks ofUnix workstations and for supercomputers with specialized communicationnetworks.
More info on MPI is availablehere.
Two popular, free implementations of MPI areMPICHandOpenMPI .
OCamlMPI provides Caml bindings for a large subset of MPI functions.I omitted a number of MPI functions for which I had no use, though.The file mpi.mli in this directory lists the MPI functions provided,along with short documentation. See the MPI docs at the URLs abovefor more detailed info.
Most communication functions come in 10 flavors:
- one generic function operating on any data type (e.g.
Mpi.send
) - nine specialized functions for the following types:
Type | "Send" function |
---|---|
int | Mpi.send_int |
float | Mpi.send_float |
int array | Mpi.send_int_array |
float array | Mpi.send_float_array |
Bigarray.Genarray.t | Mpi.send_bigarray |
Bigarray.Array0.t | Mpi.send_bigarray0 |
Bigarray.Array1.t | Mpi.send_bigarray1 |
Bigarray.Array2.t | Mpi.send_bigarray2 |
Bigarray.Array3.t | Mpi.send_bigarray3 |
The generic function is simpler to use, and more general, but involvesmore overhead than the specialized functions.
The data types that can be transmitted using the genericcommunication functions are those that can be marshaled by theMarshal.to_channel
function (q.v.) with theMarshal.Closures
option.That is:
- all concrete data structures (base types, arrays, records, variant types),
- function closures,
- but not objects,
- nor certain abstract types (
in_channel
,out_channel
,Graphics.image
).
If MPI is installed in the standard locations, just do
make all opt
If MPI headers and libraries cannot be found, you may need to edit theMakefile and set the following variables according to your MPIinstallation:
MPIINCDIR
directory containing the MPI include file<mpi.h>
MPILIBDIR
directory containing the MPI library-lmpi
MPICC
path to thempicc
executableMPIRUN
path to thempirun
executable.
You may also need to adjustCFLAGS
.
For final installation: become super-user and domake install
.
make test
builds and runs a couple of test programs.
In native-code:
ocamlfind ocamlopt -package mpi -linkpkg <your files>
In bytecode:
ocamlfind ocamlc -package mpi -linkpkg <your files>
The OCamlMPI library is copyright 1998 INRIA and distributed under theterms of the GNU Library General Public License version 2, with aspecial exception on clause 6 described in the file LICENSE.
For issues specific to this OCaml-MPI binding, please usethe Github bug tracker.
Questions about the following issues should be directed to MPInewsgroups, mailing-lists or implementation vendors, but not to theissue tracker above: semantics of MPI functions, how to program withMPI, finding and installing implementations of MPI, performance tuningof MPI applications, etc.