Project 2: Barrier Synchronization

Goal

The goal of this assignment is to introduce OpenMP, MPI, and barrier synchronization concepts. You will implement several barriers using OpenMP and MPI, and synchronize between multiple threads and machines. You may work in groups of 2, and will document the individual contributions of each team member in your project write-up.

General Information

Resources

Relevant reading with barrier implementation and testing:

Usage

Compilers:

MPI Specifics:

Specifics

Construct:

1. Use OpenMP to implement a barrier between threads on a single machine. Create several threads on one machine using basic OpenMP threads. Use the OpenMP locking calls to implement barrier synchronization between them. You can choose any barrier algorithm you want, but implement at least two distinct algorithms.

2. Use MPI to implement synchronization between different OpenMP machines (a barrier where each entity is an individual machine). After all the threads on an individual machine reach the OpenMP barrier, the machine will try to achieve the MPI barrier.



There are several machines, and we have one OpenMP barrier on each machine to synchronize several threads. Implement a tree-like MPI barrier. Interface the built-in OpenMP barrier with your MPI barrier call to synchronize a group of machines.

3. Scale the number of machines from 1 to 8.

Evaluate:

1. Write a testing harness that times many iterations of each barrier call. Collect performance results for a different number of machines (1-8) and a different number of threads (1-4) per machine. Explain the results. Try unequal numbers of threads on different machines. What is the difference when the threads are evenly distributed on each machine? You don't have to provide a huge number of different testing configurations, but justify and document your choices. Remember to describe your testing hardware configurations!

2. Compare the different algorithms you used to implement the OpenMP barrier. Explain the results.

Deliverables