售 价:¥
温馨提示:数字商品不支持退换货,不提供源文件,不支持导出打印
为你推荐
Python Parallel Programming Cookbook
Table of Contents
Python Parallel Programming Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Support files, eBooks, discount offers, and more
Why Subscribe?
Free Access for Packt account holders
Preface
What this book covers
What you need for this book
Who this book is for
Sections
Getting ready
How to do it…
How it works…
There's more…
See also
Conventions
Reader feedback
Customer support
Downloading the example code
Errata
Piracy
Questions
1. Getting Started with Parallel Computing and Python
Introduction
The parallel computing memory architecture
SISD
MISD
SIMD
MIMD
Memory organization
Shared memory
Distributed memory
Massively parallel processing
A cluster of workstations
The heterogeneous architecture
Parallel programming models
The shared memory model
The multithread model
The message passing model
The data parallel model
How to design a parallel program
Task decomposition
Task assignment
Agglomeration
Mapping
Dynamic mapping
Manager/worker
Hierarchical manager/worker
Decentralize
How to evaluate the performance of a parallel program
Speedup
Efficiency
Scaling
Amdahl's law
Gustafson's law
Introducing Python
Getting ready
How to do it…
Python in a parallel world
Introducing processes and threads
Start working with processes in Python
Getting ready
How to do it…
How it works…
Start working with threads in Python
How to do it…
How it works…
2. Thread-based Parallelism
Introduction
Using the Python threading module
How to define a thread
How to do it…
How it works…
How to determine the current thread
How to do it…
How it works…
How to use a thread in a subclass
How to do it…
How it works…
Thread synchronization with Lock and RLock
How to do it…
How it works…
There's more…
Thread synchronization with RLock
How to do it…
How it works…
Thread synchronization with semaphores
Getting ready
How to do it…
How it works…
There's more…
Thread synchronization with a condition
Getting ready
How to do it…
How it works…
There's more…
Thread synchronization with an event
How to do it…
How it works…
Using the with statement
Getting ready
How to do it…
How it works…
There's more…
Thread communication using a queue
How to do it…
How it works…
Evaluating the performance of multithread applications
How to do it…
How it works…
The first test
The second test
The third test
The fourth test
There's more…
3. Process-based Parallelism
Introduction
How to spawn a process
How to do it...
How it works...
There's more...
How to name a process
How to do it...
How it works...
How to run a process in the background
How to do it...
How it works...
There's more...
How to kill a process
How to do it...
How it works...
How to use a process in a subclass
How to do it...
How it works...
How to exchange objects between processes
Using queue to exchange objects
How to do it...
How it works...
There's more...
Using pipes to exchange objects
How to do it...
How it works...
How to synchronize processes
How to do it...
How it works...
How to manage a state between processes
How to do it...
How it works...
How to use a process pool
How to do it…
How it works…
Using the mpi4py Python module
Getting ready
How to do it…
How it works…
There's more…
Point-to-point communication
How to do it…
How it works…
There's more…
Avoiding deadlock problems
How to do it…
How it works…
There's more…
Collective communication using broadcast
How to do it…
How it works…
There's more…
Collective communication using scatter
How to do it…
How it works…
There's more…
Collective communication using gather
How to do it…
How it works…
There's more…
Collective communication using Alltoall
How to do it…
How it works…
There's more…
The reduction operation
How to do it…
How it works…
How to optimize communication
How to do it…
How it works…
There's more…
4. Asynchronous Programming
Introduction
Using the concurrent.futures Python modules
Dealing with the process and thread pool
Getting ready
How to do it…
How it works…
There's more…
Event loop management with Asyncio
What is an event loop
Getting ready
How to do it…
How it works…
Handling coroutines with Asyncio
Getting ready
How to do it…
How it works…
Task manipulation with Asyncio
Getting ready
How to do it…
How it works…
Dealing with Asyncio and Futures
Getting ready
How to do it…
How it works…
There's more…
5. Distributed Python
Introduction
Using Celery to distribute tasks
How to do it…
See also
How to create a task with Celery
How to do it…
How it works…
There's more…
Scientific computing with SCOOP
Getting ready
How to do it…
How it works…
Handling map functions with SCOOP
Getting ready
How to do it…
How it works…
Remote Method Invocation with Pyro4
Getting ready
How to do it…
How it works…
Chaining objects with Pyro4
How to do it…
How it works…
Developing a client-server application with Pyro4
How to do it…
How it works…
Communicating sequential processes with PyCSP
Getting ready
How to do it…
How it works…
There's more…
Using MapReduce with Disco
Getting ready
How to do it…
How it works…
There's more…
A remote procedure call with RPyC
Getting ready
How to do it…
How it works…
6. GPU Programming with Python
Introduction
Using the PyCUDA module
A hybrid programming model
The kernel and thread hierarchy
Getting ready
How to do it…
How it works…
See also
How to build a PyCUDA application
How to do it…
How it works…
There's more…
Understanding the PyCUDA memory model with matrix manipulation
How to do it…
How it works…
Kernel invocations with GPUArray
How to do it…
How it works…
There's more…
Evaluating element-wise expressions with PyCUDA
How to do it…
How it works…
There's more…
The MapReduce operation with PyCUDA
How to do it…
How it works…
GPU programming with NumbaPro
Getting ready
How to do it…
How it works…
Using GPU-accelerated libraries with NumbaPro
How to do it…
How it works…
There's more…
Using the PyOpenCL module
Getting ready
How to do it…
How it works…
How to build a PyOpenCL application
How to do it…
How it works…
Evaluating element-wise expressions with PyOpenCl
How to do it…
How it works…
Testing your GPU application with PyOpenCL
How to do it…
How it works…
Index
买过这本书的人还买过
读了这本书的人还在读
同类图书排行榜