Faster processing with parfor loop
古いコメントを表示
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 件のコメント
Walter Roberson
2017 年 4 月 21 日
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.
回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Loops and Conditional Statements についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!