The Message in a Ring
The message in a ring is a simple MPI program where each process sends data to the next one and receive therefore from the previous one. This program was developed to investigate the difference between the several send and receive possibilities proposed by the MPI standard:
- Asynchronous send ; receive ; wait for the send
- Asyncrhonous receive ; send ; wait for receive
- Use of the special send and receive function
This code can be used as an example of real time communication, and checking on waiting for communications.
Calculating PI
The calculating PI was an exercise where each processor was computing a part of PI and then a reduction is done to add the results together. The goal was to illustrate the possible rounding errors when the sum wasn't done in the same order. In order to avoid it, an array was made on the master processor to store each result and do the sum in the end.
This code can be used to show a very simple data registering (float).
The traffic model
The traffic model simulation was a simple domain decomposition model, where a process can have several cells of road. Each cell can be either occupied or empty. A car moves to an empty cell forward to it. Therefore some communication has to be made to send cars across the neighbour processors: check if the next cell is empty (a very simple 1D hallow swapping).
The casestudy and coursework
The idea was to introduce a very simple reverse edge detection algorithm. The solution is quite computing intensive as a smooth operation has to be made several time in order to obtain the original picture. Therefore a simple domain decomposition was done on 1 of the dimension to share the work among processors.
This code involves typical hallo swapping and the use of MPI datatypes.
The coursework introduces a 2D domain decomposition. Making it more complex to share data with the neighbours processes.