PyMPI
Encyclopedia
pyMPI is a software project that integrates the Message Passing Interface (MPI)
into the Python
interpreter.
It allows one to write parallel
programs using the Python language.
$ mpirun -np 3 pyMPI
> import mpi
> print "Hi, I'm process #%d" % mpi.rank
will print this output:
Hi, I'm process #0
Hi, I'm process #1
Hi, I'm process #2
The -np parameter given to mpirun tells mpi to use 3 processes, and each process in its turn prints its output on the screen.
Message Passing Interface
Message Passing Interface is a standardized and portable message-passing system designed by a group of researchers from academia and industry to function on a wide variety of parallel computers...
into the Python
Python (programming language)
Python is a general-purpose, high-level programming language whose design philosophy emphasizes code readability. Python claims to "[combine] remarkable power with very clear syntax", and its standard library is large and comprehensive...
interpreter.
It allows one to write parallel
Parallel processing
Parallel processing is the ability to carry out multiple operations or tasks simultaneously. The term is used in the contexts of both human cognition, particularly in the ability of the brain to simultaneously process incoming stimuli, and in parallel computing by machines.-Parallel processing by...
programs using the Python language.
Example of usage
This python program:$ mpirun -np 3 pyMPI
> import mpi
> print "Hi, I'm process #%d" % mpi.rank
will print this output:
Hi, I'm process #0
Hi, I'm process #1
Hi, I'm process #2
The -np parameter given to mpirun tells mpi to use 3 processes, and each process in its turn prints its output on the screen.