230 likes | 697 Views
Parallel Python. Ben Agar , Gal Paikin. Outline. What is Python Parallel Python pyMPI Efficiency – Python Vs. C Conclusions Questions. What is Python. High level programming language invented in late 1980s Philosophy : code readability, “short” codes, fast programming.
E N D
Parallel Python Ben Agar , Gal Paikin
Outline • What is Python • Parallel Python • pyMPI • Efficiency – Python Vs. C • Conclusions • Questions
What is Python • High level programming language invented in late 1980s • Philosophy : code readability, “short” codes, fast programming. • Programming paradigms: object oriented, imperative, functional programming • Indentation based runtime compilation.
Parallel Python • Environment : Multiple CPUs, Multicore CPUs, Clusters. • The goal is to improve performance by parallel computing invisible to the user.
Parallel Python with pyMPI • Developed by Pat Miller at the Lawrence Livermore National Laboratory • Provides Python level interface to MPI routines (bcast, barrier, reduce, send, recv, scatter, gather etc…) • pyMPIis a separate executable that incorporates Python • pyMPIruns on every processor and all executes the same Python code • First processor serves as the Master. All input read in by first processor and sent to all other processors. • Output can be controlled – either only from first processor, all processors or a mix • Extensive wrapping of MPI
Efficiency • pyMPI messages contain more overhead than native languages MPI. • Message repetition
pyMPI code example Calculating PI :
Conclusions • Python is a fast, hands-on programming language • As a higher level language, python is slower than C or Fortran • pyMPI offers an MPI solution for python that is slower in performance yet worthwhile. • pyMPI slow factor is similar to the general python slower factor comparing to C.