Clear persistent variables of function on worker
5 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Massimiliano Zanoli
il 6 Mag 2023
Risposto: Edric Ellis
il 9 Mag 2023
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 Commenti
Risposta accettata
Più risposte (1)
Edric Ellis
il 9 Mag 2023
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 Commenti
Vedere anche
Categorie
Scopri di più su Parallel for-Loops (parfor) in Help Center e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!