parfor
)parfor
on workers in a parallel poolParallel Computing Toolbox™ supports interactive parallel computing and enables you to accelerate your workflow by running on multiple workers in a parallel pool. Useparfor
to executefor
-loop iterations in parallel on workers in a parallel pool. When you have profiled your code and identified slowfor
-loops, tryparfor
to increase your throughput. Developparfor
-loops on your desktop and scale up to a cluster without changing your code.
parfor
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.
Discover variable requirements and classification inparfor
-loops.
parfor
-LoopsInteractively Run a Loop in Parallel Using parfor
Convert a slowfor
-loop into a fasterparfor
-loop.
在内部或外部创建阵列parfor
- 速度加快代码。
了解开始和停止并行池,池大小和群集选择。
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.
You can useparfor
- 计算每次迭代更新的累积值。
Control random number generation inparfor
-loops by assigning a particular substream for each iteration.
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 aparfor
loop to perform a parameter sweep on a training option.