MPI for Python Outline
Communicators
Point to Point Communication
Collective Operations Compute
Pi
Mandelbrot Set
Dynamic Process Management What is mpi4py?
I
I
I
Full-featured Python bindings for MPI.
API based on the standard MPI-2 C++ bindings.
Almost all MPI calls are supported.
I
I
targeted to MPI-2 implementations.
also works with MPI-1 implementations. Implementation
Implemented with Cython
I
Code base far easier to write, maintain, and extend.
I
Faster than other solutions (mixed Python and C codes).
I
A pythonic API that runs at C speed ! Features – MPI-1
I
Process groups and communication domains.
I
I
I
Point to point communication.
I
I
I
intracommunicators
intercommunicators
blocking (send/recv)
nonblocking (isend/irecv + test/wait)
Collective operations.
I
I
I
Synchronization (barrier)
Communication (broadcast, scatter/gather)
Global reductions (reduce, scan) Features – MPI-2
I
Dynamic process management (spawn, connect/accept).
I
Parallel I/O (read/write).
I
One sided operations, a.k.a. RMA (put/get/accumulate).
I
Extended collective operations. Features – Python
I
Communication of Python objects.
I
I
high level and very convenient, based in pickle serialization
can be slow for large data (CPU and memory consuming)