About parallel computing toolbox
조회 수: 3 (최근 30일)
이전 댓글 표시
Hello, everyone,
I have a code of large scale problem, and it contains many for loops, and all loops are independent. I want to compute it by parallel toolbox.
Is it enough by changing all "for" to "parfor"?
Thank you.
댓글 수: 0
채택된 답변
Walter Roberson
2013년 11월 10일
It might be, but you might also find that you need to adjust the code slightly. The easiest way to find out is to try.
댓글 수: 4
Walter Roberson
2013년 11월 11일
Using multiple threads requires starting up new processes, setting up MATLAB on them, moving the code for the thread to the new process, moving the data for the thread to the new process, running the thread, synchronizing with the original process so that the various threads do not write over each other, collecting the results, and shutting down the process. That can be a lot more time than just doing the initial code in the original thread.
HK Physicist
2020년 5월 22일
It seems that it does not work cleverly.
It works only when the data structure is well planned manually.
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Parallel Computing Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!