Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Arrow up icon
GO TO TOP
Parallel Programming with Python

You're reading from   Parallel Programming with Python Develop efficient parallel systems using the robust Python environment.

Arrow left icon
Product type Paperback
Published in Jun 2014
Publisher
ISBN-13 9781783288397
Length 124 pages
Edition 1st Edition
Languages
Arrow right icon
Author (1):
Arrow left icon
 Palach Palach
Author Profile Icon Palach
Palach
Arrow right icon
View More author details
Toc

Table of Contents (10) Chapters Close

Preface 1. Contextualizing Parallel, Concurrent, and Distributed Programming 2. Designing Parallel Algorithms FREE CHAPTER 3. Identifying a Parallelizable Problem 4. Using the threading and concurrent.futures Modules 5. Using Multiprocessing and ProcessPoolExecutor 6. Utilizing Parallel Python 7. Distributing Tasks with Celery 8. Doing Things Asynchronously Index

Using data decomposition

One of the ways to parallelize a problem is through data decomposition. Imagine a situation in which the task is to multiply a 2 x 2 matrix, which we will call Matrix A, by a scalar value of 4. In a sequential system, we will perform each multiplication operation one after the other, generating the final result at the end of all the instructions. Depending on the size of Matrix A, the sequential solution of the problem may be time consuming. However, when decomposition of data is applied, we can picture a scenario in which Matrix A is broken into pieces, and these pieces are associated with the workers that process the received data in a parallel way. The following diagram illustrates the concept of data decomposition applied to the example of a 2 x 2 matrix multiplied by a scalar value:

Using data decomposition

Data decomposition in a matrix example

The matrix problem presented in the preceding diagram had a certain symmetry where each necessary operation to get to the final result was executed...

You have been reading a chapter from
Parallel Programming with Python
Published in: Jun 2014
Publisher:
ISBN-13: 9781783288397
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €18.99/month. Cancel anytime
Modal Close icon
Modal Close icon