Azzera filtri
Azzera filtri

How to halt parfor execution from a UI

1 visualizzazione (ultimi 30 giorni)
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

Risposta accettata

Edric Ellis
Edric Ellis il 22 Mag 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.

Più risposte (0)

Categorie

Scopri di più su Startup and Shutdown in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by