main content

parallel for-凯发k8网页登录

use parallel processing by running parfor on 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. use parfor to execute for-loop iterations in parallel on workers in a parallel pool. when you have profiled your code and identified slow for-loops, try parfor to increase your throughput. develop parfor-loops on your desktop and scale up to a cluster without changing your code.

functions

parforexecute for-loop iterations in parallel on workers
options set for parfor
parpoolcreate parallel pool on cluster
run function on parallel pool worker
start counting bytes transferred within parallel pool
read how many bytes have been transferred since calling ticbytes
send data from worker to client using a data queue
define a function to call when new data is received on a dataqueue
parallel pool of workers
send and listen for data between client and workers

topics

getting started with parfor


  • discover basic concepts of a parfor-loop, and decide when to use it.

  • diagnose and fix common parfor problems.

  • unlike a for-loop, parfor-loop iterations have no guaranteed order.

  • learn how to deal with parallel nested loops.

  • discover variable requirements and classification in parfor-loops.

running parfor-loops

  • interactively run loops in parallel using parfor
    convert a for-loop into a scalable parfor-loop.

  • create arrays inside or outside parfor-loops to speed up code.

  • learn about starting and stopping parallel pools, pool size, and cluster selection.
  • specify your parallel preferences
    specify your preferences, and automatically create a parallel pool.

  • discover how to use objects, handles, and sliced variables in parfor-loops.

  • all references to variables in parfor-loops must be visible in the body of the program.
  • scale up parfor-loops to cluster and cloud
    develop parfor-loops on your desktop, and scale up to a cluster without changing your code.

  • you can use parfor-loops to calculate cumulative values that are updated by each iteration.

  • control random number generation in parfor-loops by assigning a particular substream for each iteration.

  • this example shows how to speed up monte-carlo code by using parfor-loops.

deep learning

  • (deep learning toolbox)
    this example shows how to use a parfor loop to perform a parameter sweep on a training option.
网站地图