How to implement a progress bar for multistart global optimization when using parallel computing?
6 次查看(过去 30 天)
显示 更早的评论
Dear all,
I've been looking for a way to create a progress bar nested in a gui that shows the advancement of the calculations within a multistart (MS) global optimization. Ideally, there would be separate bars for each run of the solver on a different worker and a major one for the progress of the global optimization.
Do you have some ideas how one could achieve this?
Thank you in advance for your help.
greetings Chavdar
0 个评论
回答(2 个)
Matt J
2013-6-10
See the WAITBAR command.
2 个评论
Matt J
2013-6-11
Chavdar commented
Hi Matt,
thanks for your answer. I of course know the 'waitbar' option, however, it is not obvious to me how one can integrate it in a global optimization routine using parallel processing. The problem is that in this case the global optimization does not support output functions.
Any ideas on that part of the problem?
greetings Chavdar
Matt J
2013-6-11
编辑:Matt J
2013-6-11
Chavdar,
I was thinking that you would call waitbar() within the objective function to measure the progress of each objective function evaluation. I'm not aware of any reason each parallel clone of the objective function couldn't be displaying a waitbar to the screen.
As for measuring the progress of the optimization as a whole, normally you cannot know in advance how long an optimization will take, because it uses an iterative algorithm with an indefinite number of iterations: the algorithm stops only when one of several convergence criteria are met. If you plan to use a set number of iterations, e.g., using the MaxIter option, you could use persistent variables inside the objective function to measure how many iterations have passed (i.e. a persistent waitbar handle and a counter that would increment with each objective function call) in relation to MaxIter, and advance a waitbar based on that.
However, if the iterations finish earlier than expected, i.e., in less than MaxIter, due to a different stopping criterion, I imagine your progress bars would just be wiped from the screen when the parallel session closes. Not sure if you care about that or what you would want the progress bars to do in that instance instead... There are ways to turn off other stopping mechanisms so that MaxIter iterations will definitely be performed.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Dialog Boxes 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!