- MPI Topology. Simple 1d example Topology C and Fortran ([simple_1d_topology.c](simple_1d_topology.c)
and [simple_1d_topology.f90](simple_1d_topology.f90))
- MPI I/O. Serial hello world in C and Fortran ([hello_mpi.c](hello_mpi.c) and [hello_mpi.f90](hello_mpi.f90))
- MPI Latency: C and Fortran ([mpi_latency.c](mpi_latency.c) and [mpi_latency.f90](mpi_latency.f90))
- MPI Bandwidth : C and Fortran ([mpi_bandwidth.c](mpi_bandwidth.c) and [mpi_bandwidth.f90](mpi_bandwidth.f90))
...
...
@@ -27,27 +23,13 @@ Three hours
In preparation for this lab, read the [general instructions](../README.md) which will help you get going on Beskow.
# Exercise 1 - One sided communication
Take the prototype one sided communication code and complete the code by adding the correct one sided MPI calls so that the program works. The number of live cells after the calculation should be the same on any number of tasks that can easily divide the grid. The solution that will be provided towards the end of the class uses MPI_Get, but something similar could also be done with MPI_Put.
# Exercise 2 - Topologies
### Part A
Run the simple example topology program and understand how it works. Notice that the rank order in the MPI_COMM_WORLD communicator is not necessarily the same as for the cart_comm communicator.
### Part B
The code in Exercise 1 uses a simple and manually implemented "topology". Re-implement the calculation of which MPI task to read the halo data from using MPI topology functions, i.e. set up a simple periodic 1d topology then use MPI_Cart_shift to get the rank of the ranks to get the data from.
Note that the position in the new topology is not necessarily the same as the position in MPI_COMM_WORLD so make sure that the initial grid setup reflects that.
# Exercise 3 - MPI I/O
# Exercise 1 - MPI I/O
MPI I/O is used so that results can be written to the same file in parallel. Take the serial hello world programs and modify them so that instead of writing the output to screen the output is written to a file using MPI I/O.
The simplest solution is likely to be for you to create a character buffer, and then use the MPI_File_write_at function.
# Exercises 4 - Bandwidth and latency between nodes
# Exercises 2 - Bandwidth and latency between nodes
Use `mpi_wtime` to compute latency and bandwidth with the bandwidth and latency codes above