Parallel Programming With: MPI For Python
Parallel Programming With: MPI For Python
Parallel Programming With: MPI For Python
1. Point-to-Point Communication
2. Broadcasting
3. Scattering
4. Synchronization
5. Gathering
6. Calculating π
Message Passing Interface
● Message passing standard which
allows parallel computing on high
performance machines.
See mpi-forum.org
● Implementations
○ Open source:
■ Open-MPI
■ MPICH
○ Closed source:
■ Cray MPICH
■ Intel MPICH
comm = MPI.COMM_WORLD
rank = comm.Get_rank()
size = comm.Get_size() Core 0 Core N
Process 1
Send �� Process 2
Receive
Example 3
Broadcasting
🍐 🍐
🍐
Example 4
Scattering
🍐🍎🍋 🍐
🍋
Synchronization
🍐 🍐🍎🍋
🍋
Calculating π
π = S1 + S2 + S3 + S4 + S5
S1 S2 S3 S4 S5
Ex6. Simple Version
Ex7. MPI Version