Faster processing with parfor loop
Mostrar comentarios más antiguos
I am running a matlab code using parfor and using 2/4 local workers. I would like to speed up the code . Can you please suggest how to use the code efficiently in cluster. An example code is:
parfor k= 3:(NZ-3)
for j=1:NY
for i=1:NX
value_dvy_dx = (27*vy(i,j,k)-27*vy(i-1,j,k)-vy(i+1,j,k)+vy(i-2,j,k)) /DELTAX/24;
memory_dvy_dx(i,j,k) = b_x(i) * memory_dvy_dx(i,j,k) + a_x(i) * value_dvy_dx;
end
end
end
1 comentario
Walter Roberson
el 21 de Abr. de 2017
If vy is an array instead of a function, as it looks to be, then your
for i=1:NX
would lead to indices as low as -1, which is a problem.
Respuestas (0)
Categorías
Más información sobre Loops and Conditional Statements en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!