Are temporary variables eliminated at the end of each parfor loop on every single worker?
조회 수: 4 (최근 30일)
이전 댓글 표시
I want to know, if the temporary variables inside the parfor loop are eliminated at the end of each loop, even on a single worker?
댓글 수: 0
채택된 답변
Edric Ellis
2020년 12월 8일
Yes, as mentioned in the documentation https://www.mathworks.com/help/parallel-computing/temporary-variable.html temporary variables are never sent back to the client. There are two ways to get results out of a parfor loop: either use sliced output variables, or reduction output variables. These variable types are explained here https://www.mathworks.com/help/parallel-computing/troubleshoot-variables-in-parfor-loops.html .
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Parallel for-Loops (parfor)에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!