Book Image

Python Parallel Programming Cookbook

By : Giancarlo Zaccone
Book Image

Python Parallel Programming Cookbook

By: Giancarlo Zaccone

Overview of this book

This book will teach you parallel programming techniques using examples in Python and will help you explore the many ways in which you can write code that allows more than one process to happen at once. Starting with introducing you to the world of parallel computing, it moves on to cover the fundamentals in Python. This is followed by exploring the thread-based parallelism model using the Python threading module by synchronizing threads and using locks, mutex, semaphores queues, GIL, and the thread pool. Next you will be taught about process-based parallelism where you will synchronize processes using message passing along with learning about the performance of MPI Python Modules. You will then go on to learn the asynchronous parallel programming model using the Python asyncio module along with handling exceptions. Moving on, you will discover distributed computing with Python, and learn how to install a broker, use Celery Python Module, and create a worker. You will understand anche Pycsp, the Scoop framework, and disk modules in Python. Further on, you will learnGPU programming withPython using the PyCUDA module along with evaluating performance limitations.
Table of Contents (13 chapters)
Python Parallel Programming Cookbook
About the Author
About the Reviewers

About the Reviewers

Aditya Avinash is a graduate student who focuses on computer graphics and GPUs. His areas of interest are compilers, drivers, physically based rendering, and real-time rendering. His current focus is on making a contribution to MESA (the open source graphics driver stack for Linux), where he will implement OpenGL extensions for the AMD backend. This is something that he is really excited about. He also likes writing compilers to translate high-level abstraction code into GPU code. He has developed Urutu, which gives GPUs thread-level parallelism with Python. For this, NVIDIA funded him with a couple of Tesla K40 GPUs. Currently, he is working on RockChuck, translating the Python code (written using data parallel abstraction) into GPU/CPU code, depending on the available backend. This project was started after he reviewed the opinions of a lot of Python programmers who wanted data parallel abstraction for Python and GPUs.

He has a computer engineering background, where he designed hardware and software to fit certain applications (ASIC). From this, he gained experience of how to use FPGAs and HDLs. Apart from this, he mainly programs using Python and C++. In C++, he uses OpenGL, CUDA, OpenCL, and other multicore programming APIs. Since he is a student, most of his work is not affiliated with any institution or person.

Ravi Chityala is a senior engineer at Elekta Inc. He has more than 12 years of experience in image processing and scientific computing. He is also a part time instructor at the University of California, Santa Cruz Extension, San Jose, CA, where he teaches advanced Python to programmers. He began using Python as a scripting tool and fell in love with the language's simplicity, power, and expressiveness. He now uses it for web development, scientific prototyping and computing, and he uses it as a glue to automate the process. He combined his experience in image processing and his love for Python and coauthored the book Image Acquisition and Processing using Python, published by CRC Press.

Mike Galloy is a software developer who focuses on high-performance computing and visualization in scientific programming. He works mostly on IDL, but occasionally uses C, CUDA, and Python. He currently works for the National Center for Atmospheric Research (NCAR) at the Mauna Loa Solar Observatory. Previously, he worked for Tech-X Corporation, where he was the main developer for GPULib, a library of IDL bindings for GPU-accelerated computation routines. He is the creator and main developer of the open source projects, IDLdoc, mgunit, and rIDL, as well as the author of the book Modern IDL.

Ludovic Gasc is a senior software developer and engineer at Eyepea and ALLOcloud, a highly renowned open source VoIP and unified communications company in Europe.

Over the last 5 years, he has developed redundant distributed systems for the telecom sector that are based on Python, AsyncIO, PostgreSQL, and Redis.

You can contact him on his blog at

He is also the creator of the blog API-Hour: Write efficient network daemons (HTTP, SSH) with ease. For more information, visit