README.md 2.18 KB
Newer Older
Jussi Enkovaara's avatar
Jussi Enkovaara committed
1
2
3
4
# Parallel programming with MPI

This repository contains various exercises and examples on parallel programming with message passing interface (MPI).

5
6
7
8
9
10
11
12
13
14
15
16
17
18
A working MPI installation is needed for building the code. Simple cases can
be built and run as:

 - mpicc -o exe exercise.c ; mpirun -np xxx ./exe (C)
 - mpif90 -o exe exercise.c ; mpirun -np xxx ./exe (Fortran)
 - mpirun -np xxx python program.py (Python)

where mpicc/mpif90/mpirun should be replaced by the correct commands for
the particular computer platform. For more complex cases a Makefile is
provided.

## Exercises

 - [Hello world](hello-world) Simplest possible MPI program (C, Fortran and 
Jussi Enkovaara's avatar
Jussi Enkovaara committed
19
   Python versions). Level: **basic**
20
 - [Message exchange](message-exchange) Simple point-to-point communication 
Jussi Enkovaara's avatar
Jussi Enkovaara committed
21
   (C, Fortran and Python versions). Level: **basic**
22
23
 - [Message chain](message-chain) Point-to-point communication in one
   dimensional aperiodic chain. (C, Fortran and Python versions). 
Jussi Enkovaara's avatar
Jussi Enkovaara committed
24
   Level: **intermediate**
25
 - [Collective communciation](collectives) Basic collective communication
Jussi Enkovaara's avatar
Jussi Enkovaara committed
26
   patterns (C, Fortran and Python versions). Level: **basic/intermediate**
27
 - [Parallel I/O](parallel-io) Simple parallel I/O using Posix calls and 
Jussi Enkovaara's avatar
Jussi Enkovaara committed
28
   MPI I/O (C and Fortran versions). Level: **basic/intermediate**
29
30
 - [User defined datatypes](datatypes) Communication of non-uniform data using
   user defined datatypes (C, Fortran and Python versions). 
Jussi Enkovaara's avatar
Jussi Enkovaara committed
31
   Level: **intermediate/advanced**
32
33
34
35
36

## Examples
 - [Heat equation](heat-equation) A two dimensional heat equation solver which
 is parallelized with MPI. The code features non-blocking point-to-point
 communication, user defined datatypes, and parallel I/O with MPI I/O
Jussi Enkovaara's avatar
Jussi Enkovaara committed
37
 (C, Fortran and Python versions). Level: **advanced** 
Jussi Enkovaara's avatar
Jussi Enkovaara committed
38
39
40
41
42
43
44
45
46
47
48
49
50
51

## How to contribute

Any contributions (new exercises and examples, bug fixes, improvements etc.) are
warmly welcome. In order to contribute, please follow the standard
Gitlab workflow:

1. Fork the project into your personal space
2. Create a feature branch
3. Work on your contributions
4. Push the commit(s) to your fork
5. Submit a merge request to the master branch

As a quality assurance, the merge request is reviewed by PRACE staff before it is accepted into main branch.