These codes implement a dot product calculation and are designed to show the progression of developing a hybrid MPI / Pthreads program from a a serial code. The problem size increases as the examples go from serial, to threads/mpi to mpi with threads.
Suggestion: simply making and running this series of codes is rather unremarkable. Using the available lab time to understand what is actually happening is the intent. The instructor is available for your questions.
Use the provided makefile to compile all of the codes at once. The makefile uses the gcc compiler - feel free to modify it and use a different compiler.
make -f mpithreads.makefile
Execution command | Description |
---|---|
mpithreads_serial | Serial version - no threads or MPI |
mpithreads_threads | Threads only version of the code using 8 threads |
srun -n8 -ppReserved mpithreads_mpi | MPI only version with 8 tasks running on a single node in the special workshop pool |
srun -N4 -ppReserved mpithreads_both | MPI with threads using 4 tasks running on 4 different nodes, each of which spawns 8 threads, running in special workshop pool |