MPI Lectures
October 9, 2019 · View on GitHub
MPI Lectures
CS6320 Algorithms for parallel computing
1st and 3rd October 2019
Slides at: https://anagainaru.github.io/MPI_Lectures
Table of contents
-
Introduction to MPI
- Library and implementation characteristics
- MPI for python
- Error handling
-
Blocking point-to-point communication
- Sending and receiving with
MPI_SendandMPI_Recv - Dynamic receiving with
MPI_ProbeandMPI_Status - Groups and communicators
- Sending and receiving with
-
Non-blocking communication
-
Collective communication
- Synchronization (Barrier)
- Data movement (Broadcast, Gather, Scatter, Allgather, Alltoall)
- Collective computation (Reduce, AllReduce, Scan, Exscan, Reduce_scatter)
- Define your own collective routine
- Non-Blocking Collective Operations
-
Topology mapping and neighborhood collectives
-
Profiling MPI applications
Code examples
Basic Codes
hello_world.py- Basic hello world example
rank_hello.py- Hello world for each rank
communicator_split.py- Splitting the processes in two groups based on their ranks (keeping the order of their original ranks)
- Blocking send examples
send_dict.py- simple blocking send of a dictionarysend_np_array.py- simple example of sending a numpy arraysend_dtype.py- example of sending a custom datatype (tuple of int32, double64)
ping_pong.py- Simple non-blocking communication example
sendrecv.py- Example of using the sendrecv routine
barrier.py- Simple barrier example
custom_collective{_np}.py- Two examples of implementing a custom reduce operation
- Computing the product of Complex numbers (one per each MPI process) - Complex class defined in
Complex.py - Identifying the array indexes containing odd numbers in at least one process (all processes contining a numpy array of the same size)
- Computing the product of Complex numbers (one per each MPI process) - Complex class defined in
- Two examples of implementing a custom reduce operation
wtime.py- Time measurement for mpi processes
- Cartesian topology examples
cart_{topology, shift}.py- Two examples for creating a cartesian topology and identifying the neighbor processes
Other codes
- Computing PI
- Using numerical integration
- Merge Sort
- Matrix Vector Multiplication
- Split by row
- Split in blocks within one row