How to save computations of each "for" loop iteration in "SPMD"?

조회 수: 8 (최근 30일)
Bill Masters
Bill Masters 2020년 5월 19일
댓글: Science Machine 2022년 10월 6일
Hello,
I have a "for" loop in SPMD to implement parallel computing through some workers. the computation of each worker in each iteration, must be saved to be used in the next iteration. I have used cell arrays to determine the variables and other approachs with no success. there is a function to be calculated in each iteration with respect to the above variable and when the variable is not updated in each iteration, the answer comes up with the same value for all the iterations.
the overall structure of my script:
spmd
for i=1:maxiter
x %variable calculated is each iteration
y=x(i-1)+... %the amount of x variable in the last iteration is needed
end
end
  댓글 수: 1
Science Machine
Science Machine 2022년 10월 6일
I would have also liked to know! It seems that for loops within spmd loops are quite slow due to JIT (just in time)

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Parallel Computing Fundamentals에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by