Parallel Programming with Python


Parallel Programming with Python
eBook: $13.99
Formats: PDF, PacktLib, ePub and Mobi formats
$11.90
save 15%!
Print + free eBook + free PacktLib access to the book: $36.98    Print cover: $22.99
$34.89
save 6%!
Free Shipping!
UK, US, Europe and selected countries in Asia.
Also available on:
Overview
Table of Contents
Author
Support
Sample Chapters
  • Demonstrates the concepts of Python parallel programming
  • Boosts your Python computing capabilities
  • Contains easy-to-understand explanations and plenty of examples

Book Details

Language : English
Paperback : 128 pages [ 235mm x 191mm ]
Release Date : June 2014
ISBN : 1783288396
ISBN 13 : 9781783288397
Author(s) : Jan Palach
Topics and Technologies : All Books, Application Development, Other, Open Source


Table of Contents

Preface
Chapter 1: Contextualizing Parallel, Concurrent, and Distributed Programming
Chapter 2: Designing Parallel Algorithms
Chapter 3: Identifying a Parallelizable Problem
Chapter 4: Using the threading and concurrent.futures Modules
Chapter 5: Using Multiprocessing and ProcessPoolExecutor
Chapter 6: Utilizing Parallel Python
Chapter 7: Distributing Tasks with Celery
Chapter 8: Doing Things Asynchronously
Index
  • Chapter 1: Contextualizing Parallel, Concurrent, and Distributed Programming
    • Why use parallel programming?
    • Exploring common forms of parallelization
    • Communicating in parallel programming
      • Understanding shared state
      • Understanding message passing
    • Identifying parallel programming problems
      • Deadlock
      • Starvation
      • Race conditions
    • Discovering Python's parallel programming tools
      • The Python threading module
      • The Python multiprocessing module
      • The parallel Python module
      • Celery – a distributed task queue
    • Taking care of Python GIL
    • Summary
  • Chapter 2: Designing Parallel Algorithms
    • The divide and conquer technique
    • Using data decomposition
    • Decomposing tasks with pipeline
    • Processing and mapping
      • Identifying independent tasks
      • Identifying the tasks that require data exchange
      • Load balance
    • Summary
  • Chapter 4: Using the threading and concurrent.futures Modules
    • Defining threads
      • Advantages and disadvantages of using threads
      • Understanding different kinds of threads
      • Defining the states of a thread
      • Choosing between threading and _thread
    • Using threading to obtain the Fibonacci series term with multiple inputs
    • Crawling the Web using the concurrent.futures module
    • Summary
  • Chapter 5: Using Multiprocessing and ProcessPoolExecutor
    • Understanding the concept of a process
      • Understanding the process model
        • Defining the states of a process
    • Implementing multiprocessing communication
      • Using multiprocessing.Pipe
      • Understanding multiprocessing.Queue
    • Using multiprocessing to compute Fibonacci series terms with multiple inputs
    • Crawling the Web using ProcessPoolExecutor
    • Summary
  • Chapter 6: Utilizing Parallel Python
    • Understanding interprocess communication
      • Exploring named pipes
      • Using named pipes with Python
        • Writing in a named pipe
        • Reading named pipes
    • Discovering PP
    • Using PP to calculate the Fibonacci series term on SMP architecture
    • Using PP to make a distributed Web crawler
    • Summary
  • Chapter 7: Distributing Tasks with Celery
    • Understanding Celery
      • Why use Celery?
    • Understanding Celery's architecture
      • Working with tasks
      • Discovering message transport (broker)
      • Understanding workers
      • Understanding result backends
    • Setting up the environment
      • Setting up the client machine
      • Setting up the server machine
    • Dispatching a simple task
    • Using Celery to obtain a Fibonacci series term
    • Defining queues by task types
    • Using Celery to make a distributed Web crawler
    • Summary
  • Chapter 8: Doing Things Asynchronously
    • Understanding blocking, nonblocking, and asynchronous operations
      • Understanding blocking operations
      • Understanding nonblocking operations
      • Understanding asynchronous operations
    • Understanding event loop
      • Polling functions
      • Using event loops
    • Using asyncio
      • Understanding coroutines and futures
        • Using coroutine and asyncio.Future
        • Using asyncio.Task
        • Using an incompatible library with asyncio
    • Summary

Jan Palach

Jan Palach has been a software developer for 13 years, having worked with scientific visualization and backend for private companies using C++, Java, and Python technologies. Jan has a degree in Information Systems from Estácio de Sá University, Rio de Janeiro, Brazil, and a postgraduate degree in Software Development from Paraná State Federal Technological University. Currently, he works as a senior system analyst at a private company within the telecommunication sector implementing C++ systems; however, he likes to have fun experimenting with Python and Erlang—his two technological passions. Naturally curious, he loves challenges and learning new technologies, meeting new people, and learning about different cultures.

Sorry, we don't have any reviews for this title yet.

Code Downloads

Download the code and support files for this book.


Submit Errata

Please let us know if you have found any errors not listed on this list by completing our errata submission form. Our editors will check them and add them to this list. Thank you.

Sample chapters

You can view our sample chapters and prefaces of this title on PacktLib or download sample chapters in PDF format.

Frequently bought together

Parallel Programming with Python +    Building Probabilistic Graphical  Models with Python =
50% Off
the second eBook
Price for both: $21.45

Buy both these recommended eBooks together and get 50% off the cheapest eBook.

What you will learn from this book

  • Explore techniques to parallelize problems
  • Integrate the Parallel Python module to implement Python code
  • Execute parallel solutions on simple problems
  • Achieve communication between processes using Pipe and Queue
  • Use Celery Distributed Task Queue
  • Implement asynchronous I/O using the Python asyncio module
  • Create thread-safe structures

In Detail

Starting with the basics of parallel programming, you will proceed to learn about how to build parallel algorithms and their implementation. You will then gain the expertise to evaluate problem domains, identify if a particular problem can be parallelized, and how to use the Threading and Multiprocessor modules in Python.

The Python Parallel (PP) module, which is another mechanism for parallel programming, is covered in depth to help you optimize the usage of PP. You will also delve into using Celery to perform distributed tasks efficiently and easily. Furthermore, you will learn about asynchronous I/O using the asyncio module. Finally, by the end of this book you will acquire an in-depth understanding about what the Python language has to offer in terms of built-in and external modules for an effective implementation of Parallel Programming.

This is a definitive guide that will teach you everything you need to know to develop and maintain high-performance parallel computing systems using the feature-rich Python.

Approach

A fast, easy-to-follow and clear tutorial to help you develop Parallel computing systems using Python. Along with explaining the fundamentals, the book will also introduce you to slightly advanced concepts and will help you in implementing these techniques in the real world.

Who this book is for

If you are an experienced Python programmer and are willing to utilize the available computing resources by parallelizing applications in a simple way, then this book is for you. You are required to have a basic knowledge of Python development to get the most of this book.

Code Download and Errata
Packt Anytime, Anywhere
Register Books
Print Upgrades
eBook Downloads
Video Support
Contact Us
Awards Voting Nominations Previous Winners
Judges Open Source CMS Hall Of Fame CMS Most Promising Open Source Project Open Source E-Commerce Applications Open Source JavaScript Library Open Source Graphics Software
Resources
Open Source CMS Hall Of Fame CMS Most Promising Open Source Project Open Source E-Commerce Applications Open Source JavaScript Library Open Source Graphics Software