Are temporary variables eliminated at the end of each parfor loop on every single worker?
4 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
shuai li
am 8 Dez. 2020
Beantwortet: Edric Ellis
am 8 Dez. 2020
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 Kommentare
Akzeptierte Antwort
Edric Ellis
am 8 Dez. 2020
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 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Parallel for-Loops (parfor) finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!