主要内容

Parallel for-Loops (parfor)

通过运行使用并行处理parforon workers in a parallel pool

Parallel Computing Toolbox™ supports interactive parallel computing and enables you to accelerate your workflow by running on multiple workers in a parallel pool. Useparforto executefor-loop iterations in parallel on workers in a parallel pool. When you have profiled your code and identified slowfor-loops, tryparforto increase your throughput. Developparfor-loops on your desktop and scale up to a cluster without changing your code.

Functions

expand all

parfor 执行for-loop iterations in parallel on workers
parforptions. Options set forparfor
parpool Create parallel pool on cluster
parfeval Run function on parallel pool worker
ticBytes Start counting bytes transferred within parallel pool
tocBytes Read how many bytes have been transferred since callingticBytes
发送 Send data from worker to client using a data queue
afterEach Define a function to call when new data is received on a DataQueue
parallel.Pool 平行的工人游泳池
parallel.pool.DataQueue Send and listen for data between client and workers

Topics

Getting Started withparfor

决定何时使用律程

Discover basic concepts of aparfor-loop, and decide when to use it.

将循环转换为循环循环

诊断和修复常见parfor问题。

Ensure That parfor-Loop Iterations are Independent

Unlike afor-loop,parfor-Loop迭代没有保证订单。

Nested parfor and for-Loops and Other parfor Requirements

Learn how to deal with parallel nested loops.

在ParfoS循环中排除丢失的变量

Discover variable requirements and classification inparfor-loops.

Runningparfor-Loops

Interactively Run a Loop in Parallel Using parfor

Convert a slowfor-loop into a fasterparfor-loop.

Improve parfor Performance

在内部或外部创建阵列parfor- 速度加快代码。

Run Code on Parallel Pools

了解开始和停止并行池,池大小和群集选择。

Specify Your Parallel Preferences

Specify your preferences, and automatically create a parallel pool.

Use Objects and Handles in parfor-Loops

Discover how to use objects, handles, and sliced variables inparfor-loops.

Ensure Transparency in parfor-Loops or spmd Statements

All references to variables inparfor-loops must be visible in the body of the program.

扩展到群集和云的循环循环

Developparfor-loops on your desktop, and scale up to a cluster without changing your code.

使用parfor-Loops减少一个ssignments

You can useparfor- 计算每次迭代更新的累积值。

在ParfoS循环中重复随机数

Control random number generation inparfor-loops by assigning a particular substream for each iteration.

使用parcom来加速Monte-Carlo代码

This example shows how to useparfor-loops to speed up Monte-Carlo code.

深度学习

Use parfor to Train Multiple Deep Learning Networks(Deep Learning Toolbox)

This example shows how to use aparforloop to perform a parameter sweep on a training option.

Featured Examples