Shodor

a national resource for computational science education

HOME BWPEP Shodor Blue Waters

Distributed Memory: Code

Resources:

Game of Life with MPI : Conway's Game of Life is a classic example of a cellular automaton. Each cell's next state is based on its neighbors' states. This implementation, written in C, breaks the grid into parts and communicates the boundaries between processes using MPI.

GalaxSee MPI : GalaxSee is a simple implementation of a classic gravitation N-Body simulation: the formation of a galaxy. This version is parallelized using MPI.

Area Under a Curve MPI : This code sample demonstrates how to use MPI (distributed memory parallelism) to estimate the area under a curve (integration) using Riemann sums.

Deadlock.c : Henry Neeman's codes

Deadlock.F90 : This program is an example of bad MPI.

Deadlock.c : Tom's code

Erathosthenes MPI.c : A C version of Erathosthenes using MPI.

greetings Werr.c : A first code in MPI - "hello world" with error detection and handling.

greetings.c : A first code in MPI - "hello world".

Greetings.f : A first code in MPI - "hello world" using Fortran.

Hello World.c : A C version of Hello World.

Hello World.F90 : Fortran 90 version of Hello World program.

PI MPI Collectives.c : Calculate Pi using MPI Collective Communication.

NBody.zip : The N-Body problem using MPI.

Scatter and Gather example : Trivial example illustrating using both Scatter and Gather.

Primes Work Pool : Calculating the number of primes in a range using a work pool model.

Brute force prime checker : Simple function to check if a number is prime.

Brute force prime checker source header :

Primes Divide and Conquer : Source file for counting the number of primes. Divide and Conquer model.

Primes Divide and Conquer source header :

Tom's MPI Hello World : A simple MPI "hello world" example code.

Group built area :

Group written area with MPI :

N-Body MPI Collective Code : Zip archive of source for MPI collective communication version of N-Body code