Clear persistent variables of function on worker
1 回表示 (過去 30 日間)
古いコメントを表示
I need to clear the persistent variables of a function on all workers after having called it from a parallelized statement.
parfor n = 1 : N
persistentFunction()
end
spmd
clear persistentFunction
end
The above will not work because clear cannot be called from an spmd statement.
How can I clear persistentFunction ?
0 件のコメント
採用された回答
その他の回答 (1 件)
Edric Ellis
2023 年 5 月 9 日
Whenever you issue a clear command at the client, the same clear command is issued on the workers. So you can simply do
clear persistentFunction
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で MATLAB Parallel Server についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!