Filter löschen
Filter löschen

How to halt parfor execution from a UI

1 Ansicht (letzte 30 Tage)
Alexander Tye
Alexander Tye am 21 Mai 2018
Beantwortet: Edric Ellis am 22 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

Akzeptierte Antwort

Edric Ellis
Edric Ellis am 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.

Weitere Antworten (0)

Kategorien

Mehr zu Startup and Shutdown finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by