Bucles for paralelos (parfor
)
Utilice procesamiento paralelo ejecutando
parfor
en workers en un grupo paralelo. Parallel Computing Toolbox™ admite computación paralela interactiva y le permite acelerar su flujo de trabajo ejecutándolo en varios workers en un grupo paralelo. Utilice parfor
para ejecutar iteraciones del bucle for
en paralelo en workers en un grupo paralelo. Cuando haya perfilado su código e identificado bucles for
lentos, intente parfor
para aumentar su rendimiento. Desarrolle parfor
-loops en su escritorio y escale a un clúster sin cambiar su código.
Funciones
Temas
Comenzando con parfor
- Decide When to Use parfor
Discover basic concepts of aparfor
-loop, and decide when to use it. - Convert for-Loops into parfor-Loops
Diagnose and fix commonparfor
problems. - Ensure That parfor-Loop Iterations Are Independent
Unlike afor
-loop,parfor
-loop Iterations have no guaranteed order. - Nested parfor and for-Loops and Other parfor Requirements
Learn how to deal with parallel nested loops. - Troubleshoot Variables in parfor-Loops
Discover variable requirements and classification inparfor
-loops.
Ejecutando parfor
-bucles
- Interactively Run Loops in Parallel Using parfor
Convert afor
-loop into a scalableparfor
-loop. - Improve parfor Performance
Create arrays inside or outsideparfor
-loops to speed up code. - Run Code on Parallel Pools
Learn about starting and stopping parallel pools, pool size, and parallel environment selection. - Specify Your Parallel Settings
Adjust your parallel settings, 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. - Save Variables in parfor-Loops
This example shows how to use thesave
function in aparfor
-loop to save one or more variables to a file. (Desde R2024a) - Scale Up parfor-Loops to Cluster and Cloud
Developparfor
-loops on your desktop, and scale up to a cluster without changing your code. - Use parfor-Loops for Reduction Assignments
You can useparfor
-loops to calculate cumulative values that are updated by each iteration. - Repeat Random Numbers in parfor-Loops
Control random number generation inparfor
-loops by assigning a particular substream for each iteration. - Use parfor to Speed Up Monte-Carlo Code
This example shows how to speed up Monte-Carlo code by usingparfor
-loops. - Interactively Import and Process Data in Parallel
This example shows how to import and process data simultaneously in an interactive parallel pool. (Desde R2023b)
Aprendizaje profundo
- 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.