Effacer les filtres
Effacer les filtres

How to halt parfor execution from a UI

1 vue (au cours des 30 derniers jours)
Alexander Tye
Alexander Tye le 21 Mai 2018
Hi all,
I'm writing a program intended to be used by others via a UI. The operation that this program performs is parallelized (using parfor) and takes a long time to complete. I'd like to have a way for the user to halt the process from a UI window while it is running. I use parfor_progressbar, a wait bar for parallelized programs, and ideally the user would be able to halt the program by closing or pressing cancel on the progress bar. Does anyone have experience with this or any ideas?
Thanks,
Alex

Réponse acceptée

Edric Ellis
Edric Ellis le 22 Mai 2018
You might find it simpler to restructure your code to use parfeval rather than parfor. There's an example in the documentation here: https://www.mathworks.com/help/distcomp/examples/parfeval-blackjack.html that does pretty much exactly what you're after.

Plus de réponses (0)

Catégories

En savoir plus sur Startup and Shutdown dans Help Center et File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by